InvokeAI/invokeai/frontend/web/dist/assets/App-dbf8f111.js
2023-09-19 14:03:22 -04:00

170 lines
911 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var U0=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var Se=(e,t,n)=>(U0(e,t,"read from private field"),n?n.call(e):t.get(e)),en=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},ro=(e,t,n,r)=>(U0(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var bu=(e,t,n,r)=>({set _(o){ro(e,t,o,n)},get _(){return Se(e,t,r)}}),os=(e,t,n)=>(U0(e,t,"access private method"),n);import{a as bd,b as Pj,S as Ij,c as Ej,d as Mj,e as t1,f as Oj,i as n1,g as g7,k as v7,h as TC,j as Dj,t as b7,l as x7,m as y7,n as C7,o as w7,p as S7,q as k7,r as G0,s as _7,u as d,v as a,w as Rb,x as Vp,y as j7,z as P7,A as I7,B as E7,P as M7,C as Ab,D as O7,E as D7,F as R7,G as A7,H as Rj,I as Pe,J as N7,K as _e,L as et,M as Fe,N as xd,O as nr,Q as vn,R as Wn,T as Yt,U as Xi,V as Qa,W as at,X as po,Y as Zl,Z as ia,_ as fm,$ as Nb,a0 as Rc,a1 as rn,a2 as T7,a3 as H,a4 as $C,a5 as $7,a6 as Aj,a7 as r1,a8 as yd,a9 as L7,aa as Nj,ab as Tj,ac as ds,ad as z7,ae as ie,af as we,ag as _t,ah as L,ai as F7,aj as LC,ak as B7,al as H7,am as W7,an as Yi,ao as ee,ap as V7,aq as Tt,ar as Ft,as as Ie,at as $,au as io,av as xe,aw as wn,ax as $j,ay as U7,az as G7,aA as K7,aB as q7,aC as Fr,aD as Tb,aE as la,aF as Ir,aG as pm,aH as X7,aI as Y7,aJ as zC,aK as $b,aL as ye,aM as Br,aN as Q7,aO as Lj,aP as zj,aQ as FC,aR as Z7,aS as J7,aT as eD,aU as Qi,aV as Fj,aW as vt,aX as tD,aY as nD,aZ as rD,a_ as Bj,a$ as rr,b0 as hm,b1 as oD,b2 as BC,b3 as Hj,b4 as sD,b5 as aD,b6 as iD,b7 as lD,b8 as cD,b9 as uD,ba as dD,bb as fD,bc as Wj,bd as pD,be as hD,bf as mD,bg as gD,bh as vD,bi as Er,bj as bD,bk as xD,bl as yD,bm as HC,bn as CD,bo as wD,bp as Ba,bq as mm,br as Vj,bs as Uj,bt as Wr,bu as Gj,bv as SD,bw as Ni,bx as Mu,by as WC,bz as kD,bA as _D,bB as jD,bC as Gf,bD as Kf,bE as xu,bF as K0,bG as Lu,bH as zu,bI as Fu,bJ as Bu,bK as VC,bL as Up,bM as q0,bN as Gp,bO as UC,bP as o1,bQ as X0,bR as s1,bS as Y0,bT as Kp,bU as GC,bV as Ti,bW as KC,bX as $i,bY as qC,bZ as qp,b_ as Cd,b$ as PD,c0 as Kj,c1 as XC,c2 as gm,c3 as ID,c4 as qj,c5 as a1,c6 as i1,c7 as Xj,c8 as ED,c9 as l1,ca as MD,cb as c1,cc as OD,cd as u1,ce as Lb,cf as zb,cg as Fb,ch as Bb,ci as Hb,cj as vm,ck as Wb,cl as Aa,cm as Yj,cn as Qj,co as Vb,cp as Zj,cq as DD,cr as yu,cs as Li,ct as Jj,cu as e5,cv as YC,cw as RD,cx as AD,cy as ND,cz as Cn,cA as TD,cB as Pn,cC as wd,cD as bm,cE as $D,cF as LD,cG as zD,cH as FD,cI as BD,cJ as HD,cK as WD,cL as VD,cM as UD,cN as GD,cO as QC,cP as Ub,cQ as KD,cR as qD,cS as Sd,cT as XD,cU as YD,cV as xm,cW as QD,cX as ZD,cY as JD,cZ as Gb,c_ as eR,c$ as on,d0 as tR,d1 as nR,d2 as rR,d3 as oR,d4 as sR,d5 as aR,d6 as Yu,d7 as ZC,d8 as Bo,d9 as t5,da as iR,db as Kb,dc as lR,dd as JC,de as cR,df as uR,dg as dR,dh as n5,di as fR,dj as pR,dk as r5,dl as hR,dm as o5,dn as mR,dp as gR,dq as vR,dr as bR,ds as xR,dt as yR,du as CR,dv as wR,dw as s5,dx as a5,dy as SR,dz as kR,dA as _R,dB as jR,dC as PR,dD as No,dE as IR,dF as bo,dG as ER,dH as MR,dI as OR,dJ as DR,dK as RR,dL as AR,dM as NR,dN as TR,dO as $R,dP as LR,dQ as zR,dR as FR,dS as BR,dT as HR,dU as WR,dV as VR,dW as ew,dX as UR,dY as GR,dZ as KR,d_ as qR,d$ as XR,e0 as tw,e1 as YR,e2 as nw,e3 as QR,e4 as ZR,e5 as JR,e6 as eA,e7 as tA,e8 as nA,e9 as rw,ea as ow,eb as sw,ec as qb,ed as rA,ee as Do,ef as Qu,eg as fr,eh as oA,ei as sA,ej as i5,ek as l5,el as aA,em as aw,en as iA,eo as iw,ep as lw,eq as cw,er as lA,es as cA,et as uw,eu as dw,ev as uA,ew as dA,ex as Xp,ey as fA,ez as fw,eA as qf,eB as pw,eC as hw,eD as pA,eE as hA,eF as mA,eG as c5,eH as gA,eI as vA,eJ as mw,eK as bA,eL as gw,eM as xA,eN as u5,eO as d5,eP as kd,eQ as f5,eR as Ci,eS as p5,eT as vw,eU as yA,eV as CA,eW as h5,eX as wA,eY as SA,eZ as kA,e_ as _A,e$ as jA,f0 as Xb,f1 as d1,f2 as bw,f3 as Zi,f4 as PA,f5 as IA,f6 as m5,f7 as Us,f8 as Gs,f9 as g5,fa as v5,fb as Yb,fc as b5,fd as EA,fe as Ks,ff as MA,fg as x5,fh as OA,fi as DA,fj as RA,fk as AA,fl as NA,fm as TA,fn as $A,fo as Yp,fp as Ou,fq as Ul,fr as LA,fs as zA,ft as FA,fu as BA,fv as HA,fw as WA,fx as VA,fy as UA,fz as GA,fA as KA,fB as qA,fC as XA,fD as YA,fE as QA,fF as ZA,fG as JA,fH as e9,fI as t9,fJ as n9,fK as r9,fL as xw,fM as o9,fN as s9,fO as a9,fP as i9,fQ as l9,fR as c9,fS as u9,fT as d9,fU as f9,fV as p9,fW as h9,fX as m9,fY as g9,fZ as v9,f_ as yw,f$ as Dp,g0 as b9,g1 as Qp,g2 as y5,g3 as Zp,g4 as x9,g5 as y9,g6 as Jl,g7 as C5,g8 as w5,g9 as Qb,ga as C9,gb as w9,gc as S9,gd as f1,ge as S5,gf as k9,gg as _9,gh as k5,gi as j9,gj as P9,gk as I9,gl as E9,gm as M9,gn as _l,go as O9,gp as D9,gq as R9,gr as A9,gs as N9,gt as T9,gu as Cw,gv as $9,gw as L9,gx as z9,gy as F9,gz as B9,gA as H9,gB as W9,gC as V9,gD as Q0,gE as Z0,gF as J0,gG as Xf,gH as ww,gI as p1,gJ as Sw,gK as U9,gL as G9,gM as K9,gN as q9,gO as _5,gP as X9,gQ as Y9,gR as Q9,gS as Z9,gT as J9,gU as eN,gV as tN,gW as nN,gX as rN,gY as oN,gZ as sN,g_ as Yf,g$ as ev,h0 as aN,h1 as iN,h2 as lN,h3 as cN,h4 as uN,h5 as dN,h6 as fN,h7 as pN,h8 as hN,h9 as mN,ha as gN,hb as vN,hc as bN,hd as xN,he as kw,hf as _w,hg as yN,hh as CN,hi as wN}from"./index-f6c3f475.js";import{I as Tn,u as SN,c as kN,a as $t,b as nn,d as ca,P as _d,C as _N,e as Z,f as j5,g as ua,h as jN,r as Oe,i as PN,j as jw,k as ut,l as Sn,m as vc}from"./menu-c9cc8c3d.js";var IN=200;function EN(e,t,n,r){var o=-1,s=Ej,i=!0,l=e.length,u=[],p=t.length;if(!l)return u;n&&(t=bd(t,Pj(n))),r?(s=Mj,i=!1):t.length>=IN&&(s=t1,i=!1,t=new Ij(t));e:for(;++o<l;){var h=e[o],m=n==null?h:n(h);if(h=r||h!==0?h:0,i&&m===m){for(var v=p;v--;)if(t[v]===m)continue e;u.push(h)}else s(t,m,r)||u.push(h)}return u}var MN=Oj(function(e,t){return n1(e)?EN(e,g7(t,1,n1,!0)):[]});const ON=MN;function DN(e,t){return bd(t,function(n){return e[n]})}function RN(e){return e==null?[]:DN(e,v7(e))}var AN=Math.min;function NN(e,t,n){for(var r=n?Mj:Ej,o=e[0].length,s=e.length,i=s,l=Array(s),u=1/0,p=[];i--;){var h=e[i];i&&t&&(h=bd(h,Pj(t))),u=AN(h.length,u),l[i]=!n&&(t||o>=120&&h.length>=120)?new Ij(i&&h):void 0}h=e[0];var m=-1,v=l[0];e:for(;++m<o&&p.length<u;){var b=h[m],y=t?t(b):b;if(b=n||b!==0?b:0,!(v?t1(v,y):r(p,y,n))){for(i=s;--i;){var x=l[i];if(!(x?t1(x,y):r(e[i],y,n)))continue e}v&&v.push(y),p.push(b)}}return p}function TN(e){return n1(e)?e:[]}var $N=Oj(function(e){var t=bd(e,TN);return t.length&&t[0]===e[0]?NN(t):[]});const LN=$N;function zN(e,t,n,r){if(!TC(e))return e;t=Dj(t,e);for(var o=-1,s=t.length,i=s-1,l=e;l!=null&&++o<s;){var u=b7(t[o]),p=n;if(u==="__proto__"||u==="constructor"||u==="prototype")return e;if(o!=i){var h=l[u];p=r?r(h,u,l):void 0,p===void 0&&(p=TC(h)?h:x7(t[o+1])?[]:{})}y7(l,u,p),l=l[u]}return e}function FN(e,t,n){for(var r=-1,o=t.length,s={};++r<o;){var i=t[r],l=C7(e,i);n(l,i)&&zN(s,Dj(i,e),l)}return s}function Pw(e,t){if(e==null)return{};var n=bd(w7(e),function(r){return[r]});return t=S7(t),FN(e,n,function(r,o){return t(r,o[0])})}var BN=Math.ceil,HN=Math.max;function WN(e,t,n,r){for(var o=-1,s=HN(BN((t-e)/(n||1)),0),i=Array(s);s--;)i[r?s:++o]=e,e+=n;return i}function VN(e){return function(t,n,r){return r&&typeof r!="number"&&k7(t,n,r)&&(n=r=void 0),t=G0(t),n===void 0?(n=t,t=0):n=G0(n),r=r===void 0?t<n?1:-1:G0(r),WN(t,n,r,e)}}var UN=VN();const Iw=UN;function Ew(e){return e&&e.length?_7(e):[]}function GN(e,t,n){let r=new Set([...t,void 0]);return e.listen((o,s)=>{r.has(s)&&n(o,s)})}function KN(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 P5=({id:e,x:t,y:n,width:r,height:o,style:s,color:i,strokeColor:l,strokeWidth:u,className:p,borderRadius:h,shapeRendering:m,onClick:v,selected:b})=>{const{background:y,backgroundColor:x}=s||{},w=i||y||x;return a.jsx("rect",{className:Rb(["react-flow__minimap-node",{selected:b},p]),x:t,y:n,rx:h,ry:h,width:r,height:o,fill:w,stroke:l,strokeWidth:u,shapeRendering:m,onClick:v?k=>v(k,e):void 0})};P5.displayName="MiniMapNode";var qN=d.memo(P5);const XN=e=>e.nodeOrigin,YN=e=>e.getNodes().filter(t=>!t.hidden&&t.width&&t.height),tv=e=>e instanceof Function?e:()=>e;function QN({nodeStrokeColor:e="transparent",nodeColor:t="#e2e2e2",nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:o=2,nodeComponent:s=qN,onClick:i}){const l=Vp(YN,Ab),u=Vp(XN),p=tv(t),h=tv(e),m=tv(n),v=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return a.jsx(a.Fragment,{children:l.map(b=>{const{x:y,y:x}=j7(b,u).positionAbsolute;return a.jsx(s,{x:y,y:x,width:b.width,height:b.height,style:b.style,selected:b.selected,className:m(b),color:p(b),borderRadius:r,strokeColor:h(b),strokeWidth:o,shapeRendering:v,onClick:i,id:b.id},b.id)})})}var ZN=d.memo(QN);const JN=200,eT=150,tT=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?R7(A7(t,e.nodeOrigin),n):n,rfId:e.rfId}},nT="react-flow__minimap-desc";function I5({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:h=1,position:m="bottom-right",onClick:v,onNodeClick:b,pannable:y=!1,zoomable:x=!1,ariaLabel:w="React Flow mini map",inversePan:k=!1,zoomStep:_=10,offsetScale:j=5}){const I=P7(),E=d.useRef(null),{boundingRect:M,viewBB:D,rfId:R}=Vp(tT,Ab),A=(e==null?void 0:e.width)??JN,O=(e==null?void 0:e.height)??eT,T=M.width/A,K=M.height/O,F=Math.max(T,K),V=F*A,X=F*O,W=j*F,z=M.x-(V-M.width)/2-W,Y=M.y-(X-M.height)/2-W,B=V+W*2,q=X+W*2,re=`${nT}-${R}`,Q=d.useRef(0);Q.current=F,d.useEffect(()=>{if(E.current){const U=I7(E.current),G=oe=>{const{transform:pe,d3Selection:ue,d3Zoom:me}=I.getState();if(oe.sourceEvent.type!=="wheel"||!ue||!me)return;const Ce=-oe.sourceEvent.deltaY*(oe.sourceEvent.deltaMode===1?.05:oe.sourceEvent.deltaMode?1:.002)*_,ge=pe[2]*Math.pow(2,Ce);me.scaleTo(ue,ge)},te=oe=>{const{transform:pe,d3Selection:ue,d3Zoom:me,translateExtent:Ce,width:ge,height:fe}=I.getState();if(oe.sourceEvent.type!=="mousemove"||!ue||!me)return;const De=Q.current*Math.max(1,pe[2])*(k?-1:1),je={x:pe[0]-oe.sourceEvent.movementX*De,y:pe[1]-oe.sourceEvent.movementY*De},Be=[[0,0],[ge,fe]],rt=O7.translate(je.x,je.y).scale(pe[2]),Ue=me.constrain()(rt,Be,Ce);me.transform(ue,Ue)},ae=E7().on("zoom",y?te:null).on("zoom.wheel",x?G:null);return U.call(ae),()=>{U.on("zoom",null)}}},[y,x,k,_]);const le=v?U=>{const G=D7(U);v(U,{x:G[0],y:G[1]})}:void 0,se=b?(U,G)=>{const te=I.getState().nodeInternals.get(G);b(U,te)}:void 0;return a.jsx(M7,{position:m,style:e,className:Rb(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:a.jsxs("svg",{width:A,height:O,viewBox:`${z} ${Y} ${B} ${q}`,role:"img","aria-labelledby":re,ref:E,onClick:le,children:[w&&a.jsx("title",{id:re,children:w}),a.jsx(ZN,{onClick:se,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:o,nodeStrokeWidth:i,nodeComponent:l}),a.jsx("path",{className:"react-flow__minimap-mask",d:`M${z-W},${Y-W}h${B+W*2}v${q+W*2}h${-B-W*2}z
M${D.x},${D.y}h${D.width}v${D.height}h${-D.width}z`,fill:u,fillRule:"evenodd",stroke:p,strokeWidth:h,pointerEvents:"none"})]})})}I5.displayName="MiniMap";var rT=d.memo(I5),To;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(To||(To={}));function oT({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 sT({color:e,radius:t}){return a.jsx("circle",{cx:t,cy:t,r:t,fill:e})}const aT={[To.Dots]:"#91919a",[To.Lines]:"#eee",[To.Cross]:"#e2e2e2"},iT={[To.Dots]:1,[To.Lines]:1,[To.Cross]:6},lT=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function E5({id:e,variant:t=To.Dots,gap:n=20,size:r,lineWidth:o=1,offset:s=2,color:i,style:l,className:u}){const p=d.useRef(null),{transform:h,patternId:m}=Vp(lT,Ab),v=i||aT[t],b=r||iT[t],y=t===To.Dots,x=t===To.Cross,w=Array.isArray(n)?n:[n,n],k=[w[0]*h[2]||1,w[1]*h[2]||1],_=b*h[2],j=x?[_,_]:k,I=y?[_/s,_/s]:[j[0]/s,j[1]/s];return a.jsxs("svg",{className:Rb(["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:m+e,x:h[0]%k[0],y:h[1]%k[1],width:k[0],height:k[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${I[0]},-${I[1]})`,children:y?a.jsx(sT,{color:v,radius:_/s}):a.jsx(oT,{dimensions:j,color:v,lineWidth:o})}),a.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${m+e})`})]})}E5.displayName="Background";var cT=d.memo(E5);const Mw=(e,t,n)=>{uT(n);const r=Rj(e,t);return M5[n].includes(r)},M5={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Ow=Object.keys(M5),uT=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(Ow.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${Ow.join("|")}`)};function dT(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var fT=dT();const O5=1/60*1e3,pT=typeof performance<"u"?()=>performance.now():()=>Date.now(),D5=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(pT()),O5);function hT(e){let t=[],n=[],r=0,o=!1,s=!1;const i=new WeakSet,l={schedule:(u,p=!1,h=!1)=>{const m=h&&o,v=m?t:n;return p&&i.add(u),v.indexOf(u)===-1&&(v.push(u),m&&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 h=t[p];h(u),i.has(h)&&(l.schedule(h),e())}o=!1,s&&(s=!1,l.process(u))}};return l}const mT=40;let h1=!0,Zu=!1,m1=!1;const ec={delta:0,timestamp:0},jd=["read","update","preRender","render","postRender"],ym=jd.reduce((e,t)=>(e[t]=hT(()=>Zu=!0),e),{}),gT=jd.reduce((e,t)=>{const n=ym[t];return e[t]=(r,o=!1,s=!1)=>(Zu||xT(),n.schedule(r,o,s)),e},{}),vT=jd.reduce((e,t)=>(e[t]=ym[t].cancel,e),{});jd.reduce((e,t)=>(e[t]=()=>ym[t].process(ec),e),{});const bT=e=>ym[e].process(ec),R5=e=>{Zu=!1,ec.delta=h1?O5:Math.max(Math.min(e-ec.timestamp,mT),1),ec.timestamp=e,m1=!0,jd.forEach(bT),m1=!1,Zu&&(h1=!1,D5(R5))},xT=()=>{Zu=!0,h1=!0,m1||D5(R5)},Dw=()=>ec;function Pd(e){const{viewBox:t="0 0 24 24",d:n,displayName:r,defaultProps:o={}}=e,s=d.Children.toArray(e.path),i=Pe((l,u)=>a.jsx(Tn,{ref:u,viewBox:t,...o,...l,children:s.length?s:a.jsx("path",{fill:"currentColor",d:n})}));return i.displayName=r,i}function A5(e){const{theme:t}=N7(),n=SN();return d.useMemo(()=>kN(t.direction,{...n,...e}),[e,t.direction,n])}var yT=Object.defineProperty,CT=(e,t,n)=>t in e?yT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hn=(e,t,n)=>(CT(e,typeof t!="symbol"?t+"":t,n),n);function Rw(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 wT=e=>typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE;function Aw(e,t,n){let r=e+1;return n&&r>=t&&(r=0),r}function Nw(e,t,n){let r=e-1;return n&&r<0&&(r=t),r}var g1=typeof window<"u"?d.useLayoutEffect:d.useEffect,Jp=e=>e,ST=class{constructor(){hn(this,"descendants",new Map),hn(this,"register",e=>{if(e!=null)return wT(e)?this.registerNode(e):t=>{this.registerNode(t,e)}}),hn(this,"unregister",e=>{this.descendants.delete(e);const t=Rw(Array.from(this.descendants.keys()));this.assignIndex(t)}),hn(this,"destroy",()=>{this.descendants.clear()}),hn(this,"assignIndex",e=>{this.descendants.forEach(t=>{const n=e.indexOf(t.node);t.index=n,t.node.dataset.index=t.index.toString()})}),hn(this,"count",()=>this.descendants.size),hn(this,"enabledCount",()=>this.enabledValues().length),hn(this,"values",()=>Array.from(this.descendants.values()).sort((t,n)=>t.index-n.index)),hn(this,"enabledValues",()=>this.values().filter(e=>!e.disabled)),hn(this,"item",e=>{if(this.count()!==0)return this.values()[e]}),hn(this,"enabledItem",e=>{if(this.enabledCount()!==0)return this.enabledValues()[e]}),hn(this,"first",()=>this.item(0)),hn(this,"firstEnabled",()=>this.enabledItem(0)),hn(this,"last",()=>this.item(this.descendants.size-1)),hn(this,"lastEnabled",()=>{const e=this.enabledValues().length-1;return this.enabledItem(e)}),hn(this,"indexOf",e=>{var t,n;return e&&(n=(t=this.descendants.get(e))==null?void 0:t.index)!=null?n:-1}),hn(this,"enabledIndexOf",e=>e==null?-1:this.enabledValues().findIndex(t=>t.node.isSameNode(e))),hn(this,"next",(e,t=!0)=>{const n=Aw(e,this.count(),t);return this.item(n)}),hn(this,"nextEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),o=Aw(r,this.enabledCount(),t);return this.enabledItem(o)}),hn(this,"prev",(e,t=!0)=>{const n=Nw(e,this.count()-1,t);return this.item(n)}),hn(this,"prevEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),o=Nw(r,this.enabledCount()-1,t);return this.enabledItem(o)}),hn(this,"registerNode",(e,t)=>{if(!e||this.descendants.has(e))return;const n=Array.from(this.descendants.keys()).concat(e),r=Rw(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 kT(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 Ct(...e){return t=>{e.forEach(n=>{kT(n,t)})}}function _T(...e){return d.useMemo(()=>Ct(...e),e)}function jT(){const e=d.useRef(new ST);return g1(()=>()=>e.current.destroy()),e.current}var[PT,N5]=$t({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});function IT(e){const t=N5(),[n,r]=d.useState(-1),o=d.useRef(null);g1(()=>()=>{o.current&&t.unregister(o.current)},[]),g1(()=>{if(!o.current)return;const i=Number(o.current.dataset.index);n!=i&&!Number.isNaN(i)&&r(i)});const s=Jp(e?t.register(e):t.register);return{descendants:t,index:n,enabledIndex:t.enabledIndexOf(o.current),register:Ct(s,o)}}function Zb(){return[Jp(PT),()=>Jp(N5()),()=>jT(),o=>IT(o)]}var[ET,Cm]=$t({name:"AccordionStylesContext",hookName:"useAccordionStyles",providerName:"<Accordion />"}),[MT,Jb]=$t({name:"AccordionItemContext",hookName:"useAccordionItemContext",providerName:"<AccordionItem />"}),[OT,P0e,DT,RT]=Zb(),Tl=Pe(function(t,n){const{getButtonProps:r}=Jb(),o=r(t,n),i={display:"flex",alignItems:"center",width:"100%",outline:0,...Cm().button};return a.jsx(_e.button,{...o,className:et("chakra-accordion__button",t.className),__css:i})});Tl.displayName="AccordionButton";function Ac(e){const{value:t,defaultValue:n,onChange:r,shouldUpdate:o=(v,b)=>v!==b}=e,s=nn(r),i=nn(o),[l,u]=d.useState(n),p=t!==void 0,h=p?t:l,m=nn(v=>{const y=typeof v=="function"?v(h):v;i(h,y)&&(p||u(y),s(y))},[p,s,h,i]);return[h,m]}function AT(e){const{onChange:t,defaultIndex:n,index:r,allowMultiple:o,allowToggle:s,...i}=e;$T(e),LT(e);const l=DT(),[u,p]=d.useState(-1);d.useEffect(()=>()=>{p(-1)},[]);const[h,m]=Ac({value:r,defaultValue(){return o?n??[]:n??-1},onChange:t});return{index:h,setIndex:m,htmlProps:i,getAccordionItemProps:b=>{let y=!1;return b!==null&&(y=Array.isArray(h)?h.includes(b):h===b),{isOpen:y,onChange:w=>{if(b!==null)if(o&&Array.isArray(h)){const k=w?h.concat(b):h.filter(_=>_!==b);m(k)}else w?m(b):s&&m(-1)}}},focusedIndex:u,setFocusedIndex:p,descendants:l}}var[NT,ex]=$t({name:"AccordionContext",hookName:"useAccordionContext",providerName:"Accordion"});function TT(e){const{isDisabled:t,isFocusable:n,id:r,...o}=e,{getAccordionItemProps:s,setFocusedIndex:i}=ex(),l=d.useRef(null),u=d.useId(),p=r??u,h=`accordion-button-${p}`,m=`accordion-panel-${p}`;zT(e);const{register:v,index:b,descendants:y}=RT({disabled:t&&!n}),{isOpen:x,onChange:w}=s(b===-1?null:b);FT({isOpen:x,isDisabled:t});const k=()=>{w==null||w(!0)},_=()=>{w==null||w(!1)},j=d.useCallback(()=>{w==null||w(!x),i(b)},[b,i,x,w]),I=d.useCallback(R=>{const O={ArrowDown:()=>{const T=y.nextEnabled(b);T==null||T.node.focus()},ArrowUp:()=>{const T=y.prevEnabled(b);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()}}[R.key];O&&(R.preventDefault(),O(R))},[y,b]),E=d.useCallback(()=>{i(b)},[i,b]),M=d.useCallback(function(A={},O=null){return{...A,type:"button",ref:Ct(v,l,O),id:h,disabled:!!t,"aria-expanded":!!x,"aria-controls":m,onClick:Fe(A.onClick,j),onFocus:Fe(A.onFocus,E),onKeyDown:Fe(A.onKeyDown,I)}},[h,t,x,j,E,I,m,v]),D=d.useCallback(function(A={},O=null){return{...A,ref:O,role:"region",id:m,"aria-labelledby":h,hidden:!x}},[h,x,m]);return{isOpen:x,isDisabled:t,isFocusable:n,onOpen:k,onClose:_,getButtonProps:M,getPanelProps:D,htmlProps:o}}function $T(e){const t=e.index||e.defaultIndex,n=t!=null&&!Array.isArray(t)&&e.allowMultiple;xd({condition:!!n,message:`If 'allowMultiple' is passed, then 'index' or 'defaultIndex' must be an array. You passed: ${typeof t},`})}function LT(e){xd({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 zT(e){xd({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 FT(e){xd({condition:e.isOpen&&!!e.isDisabled,message:"Cannot open a disabled accordion item"})}function $l(e){const{isOpen:t,isDisabled:n}=Jb(),{reduceMotion:r}=ex(),o=et("chakra-accordion__icon",e.className),s=Cm(),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(Tn,{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"})})}$l.displayName="AccordionIcon";var Ll=Pe(function(t,n){const{children:r,className:o}=t,{htmlProps:s,...i}=TT(t),u={...Cm().container,overflowAnchor:"none"},p=d.useMemo(()=>i,[i]);return a.jsx(MT,{value:p,children:a.jsx(_e.div,{ref:n,...s,className:et("chakra-accordion__item",o),__css:u,children:typeof r=="function"?r({isExpanded:!!i.isOpen,isDisabled:!!i.isDisabled}):r})})});Ll.displayName="AccordionItem";var Gl={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},ki={enter:{duration:.2,ease:Gl.easeOut},exit:{duration:.1,ease:Gl.easeIn}},Xs={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})},BT=e=>e!=null&&parseInt(e.toString(),10)>0,Tw={exit:{height:{duration:.2,ease:Gl.ease},opacity:{duration:.3,ease:Gl.ease}},enter:{height:{duration:.3,ease:Gl.ease},opacity:{duration:.4,ease:Gl.ease}}},HT={exit:({animateOpacity:e,startingHeight:t,transition:n,transitionEnd:r,delay:o})=>{var s;return{...e&&{opacity:BT(t)?1:0},height:t,transitionEnd:r==null?void 0:r.exit,transition:(s=n==null?void 0:n.exit)!=null?s:Xs.exit(Tw.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:Xs.enter(Tw.enter,o)}}},wm=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:h,...m}=e,[v,b]=d.useState(!1);d.useEffect(()=>{const _=setTimeout(()=>{b(!0)});return()=>clearTimeout(_)},[]),xd({condition:Number(s)>0&&!!r,message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const y=parseFloat(s.toString())>0,x={startingHeight:s,endingHeight:i,animateOpacity:o,transition:v?p:{enter:{duration:0}},transitionEnd:{enter:h==null?void 0:h.enter,exit:r?h==null?void 0:h.exit:{...h==null?void 0:h.exit,display:y?"block":"none"}}},w=r?n:!0,k=n||r?"enter":"exit";return a.jsx(nr,{initial:!1,custom:x,children:w&&a.jsx(vn.div,{ref:t,...m,className:et("chakra-collapse",u),style:{overflow:"hidden",display:"block",...l},custom:x,variants:HT,initial:r?"exit":!1,animate:k,exit:"exit"})})});wm.displayName="Collapse";var WT={enter:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:1,transition:(r=e==null?void 0:e.enter)!=null?r:Xs.enter(ki.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:Xs.exit(ki.exit,n),transitionEnd:t==null?void 0:t.exit}}},T5={initial:"exit",animate:"enter",exit:"exit",variants:WT},VT=d.forwardRef(function(t,n){const{unmountOnExit:r,in:o,className:s,transition:i,transitionEnd:l,delay:u,...p}=t,h=o||r?"enter":"exit",m=r?o&&r:!0,v={transition:i,transitionEnd:l,delay:u};return a.jsx(nr,{custom:v,children:m&&a.jsx(vn.div,{ref:n,className:et("chakra-fade",s),custom:v,...T5,animate:h,...p})})});VT.displayName="Fade";var UT={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:Xs.exit(ki.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:Xs.enter(ki.enter,n),transitionEnd:e==null?void 0:e.enter}}},$5={initial:"exit",animate:"enter",exit:"exit",variants:UT},GT=d.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:s=!0,initialScale:i=.95,className:l,transition:u,transitionEnd:p,delay:h,...m}=t,v=r?o&&r:!0,b=o||r?"enter":"exit",y={initialScale:i,reverse:s,transition:u,transitionEnd:p,delay:h};return a.jsx(nr,{custom:y,children:v&&a.jsx(vn.div,{ref:n,className:et("chakra-offset-slide",l),...$5,animate:b,custom:y,...m})})});GT.displayName="ScaleFade";var KT={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:Xs.exit(ki.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:Xs.enter(ki.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:Xs.exit(ki.exit,s),...o?{...l,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{...l,...r==null?void 0:r.exit}}}}},v1={initial:"initial",animate:"enter",exit:"exit",variants:KT},qT=d.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:s=!0,className:i,offsetX:l=0,offsetY:u=8,transition:p,transitionEnd:h,delay:m,...v}=t,b=r?o&&r:!0,y=o||r?"enter":"exit",x={offsetX:l,offsetY:u,reverse:s,transition:p,transitionEnd:h,delay:m};return a.jsx(nr,{custom:x,children:b&&a.jsx(vn.div,{ref:n,className:et("chakra-offset-slide",i),custom:x,...v1,animate:y,...v})})});qT.displayName="SlideFade";var zl=Pe(function(t,n){const{className:r,motionProps:o,...s}=t,{reduceMotion:i}=ex(),{getPanelProps:l,isOpen:u}=Jb(),p=l(s,n),h=et("chakra-accordion__panel",r),m=Cm();i||delete p.hidden;const v=a.jsx(_e.div,{...p,__css:m.panel,className:h});return i?v:a.jsx(wm,{in:u,...o,children:v})});zl.displayName="AccordionPanel";var L5=Pe(function({children:t,reduceMotion:n,...r},o){const s=Wn("Accordion",r),i=Yt(r),{htmlProps:l,descendants:u,...p}=AT(i),h=d.useMemo(()=>({...p,reduceMotion:!!n}),[p,n]);return a.jsx(OT,{value:u,children:a.jsx(NT,{value:h,children:a.jsx(ET,{value:s,children:a.jsx(_e.div,{ref:o,...l,className:et("chakra-accordion",r.className),__css:s.root,children:t})})})})});L5.displayName="Accordion";function Id(e){return d.Children.toArray(e).filter(t=>d.isValidElement(t))}var[XT,YT]=$t({strict:!1,name:"ButtonGroupContext"}),QT={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}}},ZT={horizontal:e=>({"& > *:not(style) ~ *:not(style)":{marginStart:e}}),vertical:e=>({"& > *:not(style) ~ *:not(style)":{marginTop:e}})},mn=Pe(function(t,n){const{size:r,colorScheme:o,variant:s,className:i,spacing:l="0.5rem",isAttached:u,isDisabled:p,orientation:h="horizontal",...m}=t,v=et("chakra-button__group",i),b=d.useMemo(()=>({size:r,colorScheme:o,variant:s,isDisabled:p}),[r,o,s,p]);let y={display:"inline-flex",...u?QT[h]:ZT[h](l)};const x=h==="vertical";return a.jsx(XT,{value:b,children:a.jsx(_e.div,{ref:n,role:"group",__css:y,className:v,"data-attached":u?"":void 0,"data-orientation":h,flexDir:x?"column":void 0,...m})})});mn.displayName="ButtonGroup";function JT(e){const[t,n]=d.useState(!e);return{ref:d.useCallback(s=>{s&&n(s.tagName==="BUTTON")},[]),type:t?"button":void 0}}function b1(e){const{children:t,className:n,...r}=e,o=d.isValidElement(t)?d.cloneElement(t,{"aria-hidden":!0,focusable:!1}):t,s=et("chakra-button__icon",n);return a.jsx(_e.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...r,className:s,children:o})}b1.displayName="ButtonIcon";function eh(e){const{label:t,placement:n,spacing:r="0.5rem",children:o=a.jsx(Xi,{color:"currentColor",width:"1em",height:"1em"}),className:s,__css:i,...l}=e,u=et("chakra-button__spinner",s),p=n==="start"?"marginEnd":"marginStart",h=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(_e.div,{className:u,...l,__css:h,children:o})}eh.displayName="ButtonSpinner";var bc=Pe((e,t)=>{const n=YT(),r=Qa("Button",{...n,...e}),{isDisabled:o=n==null?void 0:n.isDisabled,isLoading:s,isActive:i,children:l,leftIcon:u,rightIcon:p,loadingText:h,iconSpacing:m="0.5rem",type:v,spinner:b,spinnerPlacement:y="start",className:x,as:w,...k}=Yt(e),_=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:j,type:I}=JT(w),E={rightIcon:p,leftIcon:u,iconSpacing:m,children:l};return a.jsxs(_e.button,{ref:_T(t,j),as:w,type:v??I,"data-active":at(i),"data-loading":at(s),__css:_,className:et("chakra-button",x),...k,disabled:o||s,children:[s&&y==="start"&&a.jsx(eh,{className:"chakra-button__spinner--start",label:h,placement:"start",spacing:m,children:b}),s?h||a.jsx(_e.span,{opacity:0,children:a.jsx($w,{...E})}):a.jsx($w,{...E}),s&&y==="end"&&a.jsx(eh,{className:"chakra-button__spinner--end",label:h,placement:"end",spacing:m,children:b})]})});bc.displayName="Button";function $w(e){const{leftIcon:t,rightIcon:n,children:r,iconSpacing:o}=e;return a.jsxs(a.Fragment,{children:[t&&a.jsx(b1,{marginEnd:o,children:t}),r,n&&a.jsx(b1,{marginStart:o,children:n})]})}var ps=Pe((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(bc,{padding:"0",borderRadius:o?"full":void 0,ref:t,"aria-label":s,...i,children:u})});ps.displayName="IconButton";var[I0e,e$]=$t({name:"CheckboxGroupContext",strict:!1});function t$(e){const[t,n]=d.useState(e),[r,o]=d.useState(!1);return e!==t&&(o(!0),n(e)),r}function n$(e){return a.jsx(_e.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 r$(e){return a.jsx(_e.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 o$(e){const{isIndeterminate:t,isChecked:n,...r}=e,o=t?r$:n$;return n||t?a.jsx(_e.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:a.jsx(o,{...r})}):null}var[s$,z5]=$t({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "<FormControl />" `}),[a$,Ed]=$t({strict:!1,name:"FormControlContext"});function i$(e){const{id:t,isRequired:n,isInvalid:r,isDisabled:o,isReadOnly:s,...i}=e,l=d.useId(),u=t||`field-${l}`,p=`${u}-label`,h=`${u}-feedback`,m=`${u}-helptext`,[v,b]=d.useState(!1),[y,x]=d.useState(!1),[w,k]=d.useState(!1),_=d.useCallback((D={},R=null)=>({id:m,...D,ref:Ct(R,A=>{A&&x(!0)})}),[m]),j=d.useCallback((D={},R=null)=>({...D,ref:R,"data-focus":at(w),"data-disabled":at(o),"data-invalid":at(r),"data-readonly":at(s),id:D.id!==void 0?D.id:p,htmlFor:D.htmlFor!==void 0?D.htmlFor:u}),[u,o,w,r,s,p]),I=d.useCallback((D={},R=null)=>({id:h,...D,ref:Ct(R,A=>{A&&b(!0)}),"aria-live":"polite"}),[h]),E=d.useCallback((D={},R=null)=>({...D,...i,ref:R,role:"group"}),[i]),M=d.useCallback((D={},R=null)=>({...D,ref:R,role:"presentation","aria-hidden":!0,children:D.children||"*"}),[]);return{isRequired:!!n,isInvalid:!!r,isReadOnly:!!s,isDisabled:!!o,isFocused:!!w,onFocus:()=>k(!0),onBlur:()=>k(!1),hasFeedbackText:v,setHasFeedbackText:b,hasHelpText:y,setHasHelpText:x,id:u,labelId:p,feedbackId:h,helpTextId:m,htmlProps:i,getHelpTextProps:_,getErrorMessageProps:I,getRootProps:E,getLabelProps:j,getRequiredIndicatorProps:M}}var sn=Pe(function(t,n){const r=Wn("Form",t),o=Yt(t),{getRootProps:s,htmlProps:i,...l}=i$(o),u=et("chakra-form-control",t.className);return a.jsx(a$,{value:l,children:a.jsx(s$,{value:r,children:a.jsx(_e.div,{...s({},n),className:u,__css:r.container})})})});sn.displayName="FormControl";var F5=Pe(function(t,n){const r=Ed(),o=z5(),s=et("chakra-form__helper-text",t.className);return a.jsx(_e.div,{...r==null?void 0:r.getHelpTextProps(t,n),__css:o.helperText,className:s})});F5.displayName="FormHelperText";var Hn=Pe(function(t,n){var r;const o=Qa("FormLabel",t),s=Yt(t),{className:i,children:l,requiredIndicator:u=a.jsx(B5,{}),optionalIndicator:p=null,...h}=s,m=Ed(),v=(r=m==null?void 0:m.getLabelProps(h,n))!=null?r:{ref:n,...h};return a.jsxs(_e.label,{...v,className:et("chakra-form__label",s.className),__css:{display:"block",textAlign:"start",...o},children:[l,m!=null&&m.isRequired?u:p]})});Hn.displayName="FormLabel";var B5=Pe(function(t,n){const r=Ed(),o=z5();if(!(r!=null&&r.isRequired))return null;const s=et("chakra-form__required-indicator",t.className);return a.jsx(_e.span,{...r==null?void 0:r.getRequiredIndicatorProps(t,n),__css:o.requiredIndicator,className:s})});B5.displayName="RequiredIndicator";function tx(e){const{isDisabled:t,isInvalid:n,isReadOnly:r,isRequired:o,...s}=nx(e);return{...s,disabled:t,readOnly:r,required:o,"aria-invalid":po(n),"aria-required":po(o),"aria-readonly":po(r)}}function nx(e){var t,n,r;const o=Ed(),{id:s,disabled:i,readOnly:l,required:u,isRequired:p,isInvalid:h,isReadOnly:m,isDisabled:v,onFocus:b,onBlur:y,...x}=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),{...x,"aria-describedby":w.join(" ")||void 0,id:s??(o==null?void 0:o.id),isDisabled:(t=i??v)!=null?t:o==null?void 0:o.isDisabled,isReadOnly:(n=l??m)!=null?n:o==null?void 0:o.isReadOnly,isRequired:(r=u??p)!=null?r:o==null?void 0:o.isRequired,isInvalid:h??(o==null?void 0:o.isInvalid),onFocus:Fe(o==null?void 0:o.onFocus,b),onBlur:Fe(o==null?void 0:o.onBlur,y)}}var rx={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},H5=_e("span",{baseStyle:rx});H5.displayName="VisuallyHidden";var l$=_e("input",{baseStyle:rx});l$.displayName="VisuallyHiddenInput";const c$=()=>typeof document<"u";let Lw=!1,Md=null,zi=!1,x1=!1;const y1=new Set;function ox(e,t){y1.forEach(n=>n(e,t))}const u$=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function d$(e){return!(e.metaKey||!u$&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function zw(e){zi=!0,d$(e)&&(Md="keyboard",ox("keyboard",e))}function jl(e){if(Md="pointer",e.type==="mousedown"||e.type==="pointerdown"){zi=!0;const t=e.composedPath?e.composedPath()[0]:e.target;let n=!1;try{n=t.matches(":focus-visible")}catch{}if(n)return;ox("pointer",e)}}function f$(e){return e.mozInputSource===0&&e.isTrusted?!0:e.detail===0&&!e.pointerType}function p$(e){f$(e)&&(zi=!0,Md="virtual")}function h$(e){e.target===window||e.target===document||(!zi&&!x1&&(Md="virtual",ox("virtual",e)),zi=!1,x1=!1)}function m$(){zi=!1,x1=!0}function Fw(){return Md!=="pointer"}function g$(){if(!c$()||Lw)return;const{focus:e}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...n){zi=!0,e.apply(this,n)},document.addEventListener("keydown",zw,!0),document.addEventListener("keyup",zw,!0),document.addEventListener("click",p$,!0),window.addEventListener("focus",h$,!0),window.addEventListener("blur",m$,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",jl,!0),document.addEventListener("pointermove",jl,!0),document.addEventListener("pointerup",jl,!0)):(document.addEventListener("mousedown",jl,!0),document.addEventListener("mousemove",jl,!0),document.addEventListener("mouseup",jl,!0)),Lw=!0}function W5(e){g$(),e(Fw());const t=()=>e(Fw());return y1.add(t),()=>{y1.delete(t)}}function v$(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function V5(e={}){const t=nx(e),{isDisabled:n,isReadOnly:r,isRequired:o,isInvalid:s,id:i,onBlur:l,onFocus:u,"aria-describedby":p}=t,{defaultChecked:h,isChecked:m,isFocusable:v,onChange:b,isIndeterminate:y,name:x,value:w,tabIndex:k=void 0,"aria-label":_,"aria-labelledby":j,"aria-invalid":I,...E}=e,M=v$(E,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),D=nn(b),R=nn(l),A=nn(u),[O,T]=d.useState(!1),[K,F]=d.useState(!1),[V,X]=d.useState(!1),[W,z]=d.useState(!1);d.useEffect(()=>W5(T),[]);const Y=d.useRef(null),[B,q]=d.useState(!0),[re,Q]=d.useState(!!h),le=m!==void 0,se=le?m:re,U=d.useCallback(fe=>{if(r||n){fe.preventDefault();return}le||Q(se?fe.target.checked:y?!0:fe.target.checked),D==null||D(fe)},[r,n,se,le,y,D]);Zl(()=>{Y.current&&(Y.current.indeterminate=!!y)},[y]),ca(()=>{n&&F(!1)},[n,F]),Zl(()=>{const fe=Y.current;if(!(fe!=null&&fe.form))return;const De=()=>{Q(!!h)};return fe.form.addEventListener("reset",De),()=>{var je;return(je=fe.form)==null?void 0:je.removeEventListener("reset",De)}},[]);const G=n&&!v,te=d.useCallback(fe=>{fe.key===" "&&z(!0)},[z]),ae=d.useCallback(fe=>{fe.key===" "&&z(!1)},[z]);Zl(()=>{if(!Y.current)return;Y.current.checked!==se&&Q(Y.current.checked)},[Y.current]);const oe=d.useCallback((fe={},De=null)=>{const je=Be=>{K&&Be.preventDefault(),z(!0)};return{...fe,ref:De,"data-active":at(W),"data-hover":at(V),"data-checked":at(se),"data-focus":at(K),"data-focus-visible":at(K&&O),"data-indeterminate":at(y),"data-disabled":at(n),"data-invalid":at(s),"data-readonly":at(r),"aria-hidden":!0,onMouseDown:Fe(fe.onMouseDown,je),onMouseUp:Fe(fe.onMouseUp,()=>z(!1)),onMouseEnter:Fe(fe.onMouseEnter,()=>X(!0)),onMouseLeave:Fe(fe.onMouseLeave,()=>X(!1))}},[W,se,n,K,O,V,y,s,r]),pe=d.useCallback((fe={},De=null)=>({...fe,ref:De,"data-active":at(W),"data-hover":at(V),"data-checked":at(se),"data-focus":at(K),"data-focus-visible":at(K&&O),"data-indeterminate":at(y),"data-disabled":at(n),"data-invalid":at(s),"data-readonly":at(r)}),[W,se,n,K,O,V,y,s,r]),ue=d.useCallback((fe={},De=null)=>({...M,...fe,ref:Ct(De,je=>{je&&q(je.tagName==="LABEL")}),onClick:Fe(fe.onClick,()=>{var je;B||((je=Y.current)==null||je.click(),requestAnimationFrame(()=>{var Be;(Be=Y.current)==null||Be.focus({preventScroll:!0})}))}),"data-disabled":at(n),"data-checked":at(se),"data-invalid":at(s)}),[M,n,se,s,B]),me=d.useCallback((fe={},De=null)=>({...fe,ref:Ct(Y,De),type:"checkbox",name:x,value:w,id:i,tabIndex:k,onChange:Fe(fe.onChange,U),onBlur:Fe(fe.onBlur,R,()=>F(!1)),onFocus:Fe(fe.onFocus,A,()=>F(!0)),onKeyDown:Fe(fe.onKeyDown,te),onKeyUp:Fe(fe.onKeyUp,ae),required:o,checked:se,disabled:G,readOnly:r,"aria-label":_,"aria-labelledby":j,"aria-invalid":I?!!I:s,"aria-describedby":p,"aria-disabled":n,style:rx}),[x,w,i,U,R,A,te,ae,o,se,G,r,_,j,I,s,p,n,k]),Ce=d.useCallback((fe={},De=null)=>({...fe,ref:De,onMouseDown:Fe(fe.onMouseDown,b$),"data-disabled":at(n),"data-checked":at(se),"data-invalid":at(s)}),[se,n,s]);return{state:{isInvalid:s,isFocused:K,isChecked:se,isActive:W,isHovered:V,isIndeterminate:y,isDisabled:n,isReadOnly:r,isRequired:o},getRootProps:ue,getCheckboxProps:oe,getIndicatorProps:pe,getInputProps:me,getLabelProps:Ce,htmlProps:M}}function b$(e){e.preventDefault(),e.stopPropagation()}var x$={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},y$={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},C$=ia({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),w$=ia({from:{opacity:0},to:{opacity:1}}),S$=ia({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),Sm=Pe(function(t,n){const r=e$(),o={...r,...t},s=Wn("Checkbox",o),i=Yt(t),{spacing:l="0.5rem",className:u,children:p,iconColor:h,iconSize:m,icon:v=a.jsx(o$,{}),isChecked:b,isDisabled:y=r==null?void 0:r.isDisabled,onChange:x,inputProps:w,...k}=i;let _=b;r!=null&&r.value&&i.value&&(_=r.value.includes(i.value));let j=x;r!=null&&r.onChange&&i.value&&(j=fm(r.onChange,x));const{state:I,getInputProps:E,getCheckboxProps:M,getLabelProps:D,getRootProps:R}=V5({...k,isDisabled:y,isChecked:_,onChange:j}),A=t$(I.isChecked),O=d.useMemo(()=>({animation:A?I.isIndeterminate?`${w$} 20ms linear, ${S$} 200ms linear`:`${C$} 200ms linear`:void 0,fontSize:m,color:h,...s.icon}),[h,m,A,I.isIndeterminate,s.icon]),T=d.cloneElement(v,{__css:O,isIndeterminate:I.isIndeterminate,isChecked:I.isChecked});return a.jsxs(_e.label,{__css:{...y$,...s.container},className:et("chakra-checkbox",u),...R(),children:[a.jsx("input",{className:"chakra-checkbox__input",...E(w,n)}),a.jsx(_e.span,{__css:{...x$,...s.control},className:"chakra-checkbox__control",...M(),children:T}),p&&a.jsx(_e.span,{className:"chakra-checkbox__label",...D(),__css:{marginStart:l,...s.label},children:p})]})});Sm.displayName="Checkbox";function k$(e){const t=parseFloat(e);return typeof t!="number"||Number.isNaN(t)?0:t}function sx(e,t){let n=k$(e);const r=10**(t??10);return n=Math.round(n*r)/r,t?n.toFixed(t):n.toString()}function C1(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 th(e,t,n){return(e-t)*100/(n-t)}function U5(e,t,n){return(n-t)*e+t}function w1(e,t,n){const r=Math.round((e-t)/n)*n+t,o=C1(n);return sx(r,o)}function tc(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 _$(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=nn(t),[h,m]=d.useState(()=>{var O;return r==null?"":(O=nv(r,s,n))!=null?O:""}),v=typeof o<"u",b=v?o:h,y=G5(Ma(b),s),x=n??y,w=d.useCallback(O=>{O!==b&&(v||m(O.toString()),p==null||p(O.toString(),Ma(O)))},[p,v,b]),k=d.useCallback(O=>{let T=O;return u&&(T=tc(T,i,l)),sx(T,x)},[x,u,l,i]),_=d.useCallback((O=s)=>{let T;b===""?T=Ma(O):T=Ma(b)+O,T=k(T),w(T)},[k,s,w,b]),j=d.useCallback((O=s)=>{let T;b===""?T=Ma(-O):T=Ma(b)-O,T=k(T),w(T)},[k,s,w,b]),I=d.useCallback(()=>{var O;let T;r==null?T="":T=(O=nv(r,s,n))!=null?O:i,w(T)},[r,n,s,w,i]),E=d.useCallback(O=>{var T;const K=(T=nv(O,s,x))!=null?T:i;w(K)},[x,s,w,i]),M=Ma(b);return{isOutOfRange:M>l||M<i,isAtMax:M===l,isAtMin:M===i,precision:x,value:b,valueAsNumber:M,update:w,reset:I,increment:_,decrement:j,clamp:k,cast:E,setValue:m}}function Ma(e){return parseFloat(e.toString().replace(/[^\w.-]+/g,""))}function G5(e,t){return Math.max(C1(t),C1(e))}function nv(e,t,n){const r=Ma(e);if(Number.isNaN(r))return;const o=G5(r,t);return sx(r,n??o)}var[j$,K5]=$t({name:"EditableStylesContext",errorMessage:`useEditableStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Editable />" `}),[P$,ax]=$t({name:"EditableContext",errorMessage:"useEditableContext: context is undefined. Seems you forgot to wrap the editable components in `<Editable />`"}),q5={fontSize:"inherit",fontWeight:"inherit",textAlign:"inherit",bg:"transparent"},km=Pe(function(t,n){const{getInputProps:r}=ax(),o=K5(),s=r(t,n),i=et("chakra-editable__input",t.className);return a.jsx(_e.input,{...s,__css:{outline:0,...q5,...o.input},className:i})});km.displayName="EditableInput";var _m=Pe(function(t,n){const{getPreviewProps:r}=ax(),o=K5(),s=r(t,n),i=et("chakra-editable__preview",t.className);return a.jsx(_e.span,{...s,__css:{cursor:"text",display:"inline-block",...q5,...o.preview},className:i})});_m.displayName="EditablePreview";function _i(e,t,n,r){const o=nn(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 I$(e){return"current"in e}var X5=()=>typeof window<"u";function E$(){var e;const t=navigator.userAgentData;return(e=t==null?void 0:t.platform)!=null?e:navigator.platform}var M$=e=>X5()&&e.test(navigator.vendor),O$=e=>X5()&&e.test(E$()),D$=()=>O$(/mac|iphone|ipad|ipod/i),R$=()=>D$()&&M$(/apple/i);function Y5(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};_i(o,"pointerdown",s=>{if(!R$()||!r)return;const i=s.target,u=(n??[t]).some(p=>{const h=I$(p)?p.current:p;return(h==null?void 0:h.contains(i))||h===i});o().activeElement!==i&&u&&(s.preventDefault(),i.focus())})}function Bw(e,t){return e?e===t||e.contains(t):!1}function A$(e={}){const{onChange:t,onCancel:n,onSubmit:r,onBlur:o,value:s,isDisabled:i,defaultValue:l,startWithEditView:u,isPreviewFocusable:p=!0,submitOnBlur:h=!0,selectAllOnFocus:m=!0,placeholder:v,onEdit:b,finalFocusRef:y,...x}=e,w=nn(b),k=!!(u&&!i),[_,j]=d.useState(k),[I,E]=Ac({defaultValue:l||"",value:s,onChange:t}),[M,D]=d.useState(I),R=d.useRef(null),A=d.useRef(null),O=d.useRef(null),T=d.useRef(null),K=d.useRef(null);Y5({ref:R,enabled:_,elements:[T,K]});const F=!_&&!i;Zl(()=>{var oe,pe;_&&((oe=R.current)==null||oe.focus(),m&&((pe=R.current)==null||pe.select()))},[]),ca(()=>{var oe,pe,ue,me;if(!_){y?(oe=y.current)==null||oe.focus():(pe=O.current)==null||pe.focus();return}(ue=R.current)==null||ue.focus(),m&&((me=R.current)==null||me.select()),w==null||w()},[_,w,m]);const V=d.useCallback(()=>{F&&j(!0)},[F]),X=d.useCallback(()=>{D(I)},[I]),W=d.useCallback(()=>{j(!1),E(M),n==null||n(M),o==null||o(M)},[n,o,E,M]),z=d.useCallback(()=>{j(!1),D(I),r==null||r(I),o==null||o(M)},[I,r,o,M]);d.useEffect(()=>{if(_)return;const oe=R.current;(oe==null?void 0:oe.ownerDocument.activeElement)===oe&&(oe==null||oe.blur())},[_]);const Y=d.useCallback(oe=>{E(oe.currentTarget.value)},[E]),B=d.useCallback(oe=>{const pe=oe.key,me={Escape:W,Enter:Ce=>{!Ce.shiftKey&&!Ce.metaKey&&z()}}[pe];me&&(oe.preventDefault(),me(oe))},[W,z]),q=d.useCallback(oe=>{const pe=oe.key,me={Escape:W}[pe];me&&(oe.preventDefault(),me(oe))},[W]),re=I.length===0,Q=d.useCallback(oe=>{var pe;if(!_)return;const ue=oe.currentTarget.ownerDocument,me=(pe=oe.relatedTarget)!=null?pe:ue.activeElement,Ce=Bw(T.current,me),ge=Bw(K.current,me);!Ce&&!ge&&(h?z():W())},[h,z,W,_]),le=d.useCallback((oe={},pe=null)=>{const ue=F&&p?0:void 0;return{...oe,ref:Ct(pe,A),children:re?v:I,hidden:_,"aria-disabled":po(i),tabIndex:ue,onFocus:Fe(oe.onFocus,V,X)}},[i,_,F,p,re,V,X,v,I]),se=d.useCallback((oe={},pe=null)=>({...oe,hidden:!_,placeholder:v,ref:Ct(pe,R),disabled:i,"aria-disabled":po(i),value:I,onBlur:Fe(oe.onBlur,Q),onChange:Fe(oe.onChange,Y),onKeyDown:Fe(oe.onKeyDown,B),onFocus:Fe(oe.onFocus,X)}),[i,_,Q,Y,B,X,v,I]),U=d.useCallback((oe={},pe=null)=>({...oe,hidden:!_,placeholder:v,ref:Ct(pe,R),disabled:i,"aria-disabled":po(i),value:I,onBlur:Fe(oe.onBlur,Q),onChange:Fe(oe.onChange,Y),onKeyDown:Fe(oe.onKeyDown,q),onFocus:Fe(oe.onFocus,X)}),[i,_,Q,Y,q,X,v,I]),G=d.useCallback((oe={},pe=null)=>({"aria-label":"Edit",...oe,type:"button",onClick:Fe(oe.onClick,V),ref:Ct(pe,O),disabled:i}),[V,i]),te=d.useCallback((oe={},pe=null)=>({...oe,"aria-label":"Submit",ref:Ct(K,pe),type:"button",onClick:Fe(oe.onClick,z),disabled:i}),[z,i]),ae=d.useCallback((oe={},pe=null)=>({"aria-label":"Cancel",id:"cancel",...oe,ref:Ct(T,pe),type:"button",onClick:Fe(oe.onClick,W),disabled:i}),[W,i]);return{isEditing:_,isDisabled:i,isValueEmpty:re,value:I,onEdit:V,onCancel:W,onSubmit:z,getPreviewProps:le,getInputProps:se,getTextareaProps:U,getEditButtonProps:G,getSubmitButtonProps:te,getCancelButtonProps:ae,htmlProps:x}}var jm=Pe(function(t,n){const r=Wn("Editable",t),o=Yt(t),{htmlProps:s,...i}=A$(o),{isEditing:l,onSubmit:u,onCancel:p,onEdit:h}=i,m=et("chakra-editable",t.className),v=Nb(t.children,{isEditing:l,onSubmit:u,onCancel:p,onEdit:h});return a.jsx(P$,{value:i,children:a.jsx(j$,{value:r,children:a.jsx(_e.div,{ref:n,...s,className:m,children:v})})})});jm.displayName="Editable";function Q5(){const{isEditing:e,getEditButtonProps:t,getCancelButtonProps:n,getSubmitButtonProps:r}=ax();return{isEditing:e,getEditButtonProps:t,getCancelButtonProps:n,getSubmitButtonProps:r}}var Z5={exports:{}},N$="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",T$=N$,$$=T$;function J5(){}function e3(){}e3.resetWarningCache=J5;var L$=function(){function e(r,o,s,i,l,u){if(u!==$$){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:e3,resetWarningCache:J5};return n.PropTypes=n,n};Z5.exports=L$();var z$=Z5.exports;const Ht=Rc(z$);var S1="data-focus-lock",t3="data-focus-lock-disabled",F$="data-no-focus-lock",B$="data-autofocus-inside",H$="data-no-autofocus";function W$(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function V$(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 n3(e,t){return V$(t||null,function(n){return e.forEach(function(r){return W$(r,n)})})}var rv={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"},us=function(){return us=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},us.apply(this,arguments)};function r3(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 Nc(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(h){try{p(r.next(h))}catch(m){i(m)}}function u(h){try{p(r.throw(h))}catch(m){i(m)}}function p(h){h.done?s(h.value):o(h.value).then(l,u)}p((r=r.apply(e,t||[])).next())})}function Tc(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(h){return u([p,h])}}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(h){p=[6,h],o=0}finally{r=s=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}}function Hw(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 k1(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 o3(e){return e}function s3(e,t){t===void 0&&(t=o3);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 h=i;i=[],h.forEach(s)},p=function(){return Promise.resolve().then(u)};p(),n={push:function(h){i.push(h),p()},filter:function(h){return i=i.filter(h),n}}}};return o}function ix(e,t){return t===void 0&&(t=o3),s3(e,t)}function a3(e){e===void 0&&(e={});var t=s3(null);return t.options=us({async:!0,ssr:!1},e),t}var i3=function(e){var t=e.sideCar,n=r3(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,us({},n))};i3.isSideCarExport=!0;function U$(e,t){return e.useMedium(t),i3}var l3=ix({},function(e){var t=e.target,n=e.currentTarget;return{target:t,currentTarget:n}}),c3=ix(),G$=ix(),K$=a3({async:!0}),q$=[],lx=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),h=t.children,m=t.disabled,v=t.noFocusGuards,b=t.persistentFocus,y=t.crossFrame,x=t.autoFocus;t.allowTextSelection;var w=t.group,k=t.className,_=t.whiteList,j=t.hasPositiveIndices,I=t.shards,E=I===void 0?q$:I,M=t.as,D=M===void 0?"div":M,R=t.lockProps,A=R===void 0?{}:R,O=t.sideCar,T=t.returnFocus,K=t.focusOptions,F=t.onActivation,V=t.onDeactivation,X=d.useState({}),W=X[0],z=d.useCallback(function(){p.current=p.current||document&&document.activeElement,l.current&&F&&F(l.current),u.current=!0},[F]),Y=d.useCallback(function(){u.current=!1,V&&V(l.current)},[V]);d.useEffect(function(){m||(p.current=null)},[]);var B=d.useCallback(function(te){var ae=p.current;if(ae&&ae.focus){var oe=typeof T=="function"?T(ae):T;if(oe){var pe=typeof oe=="object"?oe:void 0;p.current=null,te?Promise.resolve().then(function(){return ae.focus(pe)}):ae.focus(pe)}}},[T]),q=d.useCallback(function(te){u.current&&l3.useMedium(te)},[]),re=c3.useMedium,Q=d.useCallback(function(te){l.current!==te&&(l.current=te,i(te))},[]),le=rn((r={},r[t3]=m&&"disabled",r[S1]=w,r),A),se=v!==!0,U=se&&v!=="tail",G=n3([n,Q]);return d.createElement(d.Fragment,null,se&&[d.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:m?-1:0,style:rv}),j?d.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:m?-1:1,style:rv}):null],!m&&d.createElement(O,{id:W,sideCar:K$,observed:s,disabled:m,persistentFocus:b,crossFrame:y,autoFocus:x,whiteList:_,shards:E,onActivation:z,onDeactivation:Y,returnFocus:B,focusOptions:K}),d.createElement(D,rn({ref:G},le,{className:k,onBlur:re,onFocus:q}),h),U&&d.createElement("div",{"data-focus-guard":!0,tabIndex:m?-1:0,style:rv}))});lx.propTypes={};lx.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 u3=lx;function _1(e,t){return _1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},_1(e,t)}function X$(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,_1(e,t)}function Y$(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){X$(h,p);function h(){return p.apply(this,arguments)||this}h.peek=function(){return i};var m=h.prototype;return m.componentDidMount=function(){s.push(this),l()},m.componentDidUpdate=function(){l()},m.componentWillUnmount=function(){var b=s.indexOf(this);s.splice(b,1),l()},m.render=function(){return H.createElement(o,this.props)},h}(d.PureComponent);return T7(u,"displayName","SideEffect("+n(o)+")"),u}}var _s=function(e){for(var t=Array(e.length),n=0;n<e.length;++n)t[n]=e[n];return t},nh=function(e){return Array.isArray(e)?e:[e]},d3=function(e){return Array.isArray(e)?e[0]:e},Q$=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"},f3=function(e){return e.parentNode&&e.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.parentNode.host:e.parentNode},p3=function(e){return e===document||e&&e.nodeType===Node.DOCUMENT_NODE},Z$=function(e,t){return!e||p3(e)||!Q$(e)&&t(f3(e))},h3=function(e,t){var n=e.get(t);if(n!==void 0)return n;var r=Z$(t,h3.bind(void 0,e));return e.set(t,r),r},J$=function(e,t){return e&&!p3(e)?nL(e)?t(f3(e)):!1:!0},m3=function(e,t){var n=e.get(t);if(n!==void 0)return n;var r=J$(t,m3.bind(void 0,e));return e.set(t,r),r},g3=function(e){return e.dataset},eL=function(e){return e.tagName==="BUTTON"},v3=function(e){return e.tagName==="INPUT"},b3=function(e){return v3(e)&&e.type==="radio"},tL=function(e){return!((v3(e)||eL(e))&&(e.type==="hidden"||e.disabled))},nL=function(e){var t=e.getAttribute(H$);return![!0,"true",""].includes(t)},cx=function(e){var t;return!!(e&&(!((t=g3(e))===null||t===void 0)&&t.focusGuard))},rh=function(e){return!cx(e)},rL=function(e){return!!e},oL=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},x3=function(e,t,n){return _s(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(oL)},sL=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],ux=sL.join(","),aL="".concat(ux,", [data-focus-guard]"),y3=function(e,t){return _s((e.shadowRoot||e).children).reduce(function(n,r){return n.concat(r.matches(t?aL:ux)?[r]:[],y3(r))},[])},iL=function(e,t){var n;return e instanceof HTMLIFrameElement&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?Pm([e.contentDocument.body],t):[e]},Pm=function(e,t){return e.reduce(function(n,r){var o,s=y3(r,t),i=(o=[]).concat.apply(o,s.map(function(l){return iL(l,t)}));return n.concat(i,r.parentNode?_s(r.parentNode.querySelectorAll(ux)).filter(function(l){return l===r}):[])},[])},lL=function(e){var t=e.querySelectorAll("[".concat(B$,"]"));return _s(t).map(function(n){return Pm([n])}).reduce(function(n,r){return n.concat(r)},[])},dx=function(e,t){return _s(e).filter(function(n){return h3(t,n)}).filter(function(n){return tL(n)})},Ww=function(e,t){return t===void 0&&(t=new Map),_s(e).filter(function(n){return m3(t,n)})},j1=function(e,t,n){return x3(dx(Pm(e,n),t),!0,n)},Vw=function(e,t){return x3(dx(Pm(e),t),!1)},cL=function(e,t){return dx(lL(e),t)},nc=function(e,t){return e.shadowRoot?nc(e.shadowRoot,t):Object.getPrototypeOf(e).contains!==void 0&&Object.getPrototypeOf(e).contains.call(e,t)?!0:_s(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?nc(o,t):!1}return nc(n,t)})},uL=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)})},C3=function(e){return e.parentNode?C3(e.parentNode):e},fx=function(e){var t=nh(e);return t.filter(Boolean).reduce(function(n,r){var o=r.getAttribute(S1);return n.push.apply(n,o?uL(_s(C3(r).querySelectorAll("[".concat(S1,'="').concat(o,'"]:not([').concat(t3,'="disabled"])')))):[r]),n},[])},dL=function(e){try{return e()}catch{return}},Ju=function(e){if(e===void 0&&(e=document),!(!e||!e.activeElement)){var t=e.activeElement;return t.shadowRoot?Ju(t.shadowRoot):t instanceof HTMLIFrameElement&&dL(function(){return t.contentWindow.document})?Ju(t.contentWindow.document):t}},fL=function(e,t){return e===t},pL=function(e,t){return!!_s(e.querySelectorAll("iframe")).some(function(n){return fL(n,t)})},w3=function(e,t){return t===void 0&&(t=Ju(d3(e).ownerDocument)),!t||t.dataset&&t.dataset.focusGuard?!1:fx(e).some(function(n){return nc(n,t)||pL(n,t)})},hL=function(e){e===void 0&&(e=document);var t=Ju(e);return t?_s(e.querySelectorAll("[".concat(F$,"]"))).some(function(n){return nc(n,t)}):!1},mL=function(e,t){return t.filter(b3).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},px=function(e,t){return b3(e)&&e.name?mL(e,t):e},gL=function(e){var t=new Set;return e.forEach(function(n){return t.add(px(n,e))}),e.filter(function(n){return t.has(n)})},Uw=function(e){return e[0]&&e.length>1?px(e[0],e):e[0]},Gw=function(e,t){return e.length>1?e.indexOf(px(e[t],e)):t},S3="NEW_FOCUS",vL=function(e,t,n,r){var o=e.length,s=e[0],i=e[o-1],l=cx(n);if(!(n&&e.indexOf(n)>=0)){var u=n!==void 0?t.indexOf(n):-1,p=r?t.indexOf(r):u,h=r?e.indexOf(r):-1,m=u-p,v=t.indexOf(s),b=t.indexOf(i),y=gL(t),x=n!==void 0?y.indexOf(n):-1,w=x-(r?y.indexOf(r):u),k=Gw(e,0),_=Gw(e,o-1);if(u===-1||h===-1)return S3;if(!m&&h>=0)return h;if(u<=v&&l&&Math.abs(m)>1)return _;if(u>=b&&l&&Math.abs(m)>1)return k;if(m&&Math.abs(w)>1)return h;if(u<=v)return _;if(u>b)return k;if(m)return Math.abs(m)>1?h:(o+h+m)%o}},bL=function(e){return function(t){var n,r=(n=g3(t))===null||n===void 0?void 0:n.autofocus;return t.autofocus||r!==void 0&&r!=="false"||e.indexOf(t)>=0}},xL=function(e,t,n){var r=e.map(function(s){var i=s.node;return i}),o=Ww(r.filter(bL(n)));return o&&o.length?Uw(o):Uw(Ww(t))},P1=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&P1(e.parentNode.host||e.parentNode,t),t},ov=function(e,t){for(var n=P1(e),r=P1(t),o=0;o<n.length;o+=1){var s=n[o];if(r.indexOf(s)>=0)return s}return!1},k3=function(e,t,n){var r=nh(e),o=nh(t),s=r[0],i=!1;return o.filter(Boolean).forEach(function(l){i=ov(i||l,l)||i,n.filter(Boolean).forEach(function(u){var p=ov(s,u);p&&(!i||nc(p,i)?i=p:i=ov(p,i))})}),i},yL=function(e,t){return e.reduce(function(n,r){return n.concat(cL(r,t))},[])},CL=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(rL)},wL=function(e,t){var n=Ju(nh(e).length>0?document:d3(e).ownerDocument),r=fx(e).filter(rh),o=k3(n||e,e,r),s=new Map,i=Vw(r,s),l=j1(r,s).filter(function(b){var y=b.node;return rh(y)});if(!(!l[0]&&(l=i,!l[0]))){var u=Vw([o],s).map(function(b){var y=b.node;return y}),p=CL(u,l),h=p.map(function(b){var y=b.node;return y}),m=vL(h,u,n,t);if(m===S3){var v=xL(i,h,yL(r,s));if(v)return{node:v};console.warn("focus-lock: cannot find any node to move focus into");return}return m===void 0?m:p[m]}},SL=function(e){var t=fx(e).filter(rh),n=k3(e,e,t),r=new Map,o=j1([n],r,!0),s=j1(t,r).filter(function(i){var l=i.node;return rh(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:cx(l)}})},kL=function(e,t){"focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus()},sv=0,av=!1,_3=function(e,t,n){n===void 0&&(n={});var r=wL(e,t);if(!av&&r){if(sv>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),av=!0,setTimeout(function(){av=!1},1);return}sv++,kL(r.node,n.focusOptions),sv--}};function hx(e){setTimeout(e,1)}var _L=function(){return document&&document.activeElement===document.body},jL=function(){return _L()||hL()},rc=null,Kl=null,oc=null,ed=!1,PL=function(){return!0},IL=function(t){return(rc.whiteList||PL)(t)},EL=function(t,n){oc={observerNode:t,portaledElement:n}},ML=function(t){return oc&&oc.portaledElement===t};function Kw(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 OL=function(t){return t&&"current"in t?t.current:t},DL=function(t){return t?!!ed:ed==="meanwhile"},RL=function e(t,n,r){return n&&(n.host===t&&(!n.activeElement||r.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,r))},AL=function(t,n){return n.some(function(r){return RL(t,r,r)})},oh=function(){var t=!1;if(rc){var n=rc,r=n.observed,o=n.persistentFocus,s=n.autoFocus,i=n.shards,l=n.crossFrame,u=n.focusOptions,p=r||oc&&oc.portaledElement,h=document&&document.activeElement;if(p){var m=[p].concat(i.map(OL).filter(Boolean));if((!h||IL(h))&&(o||DL(l)||!jL()||!Kl&&s)&&(p&&!(w3(m)||h&&AL(h,m)||ML(h))&&(document&&!Kl&&h&&!s?(h.blur&&h.blur(),document.body.focus()):(t=_3(m,Kl,{focusOptions:u}),oc={})),ed=!1,Kl=document&&document.activeElement),document){var v=document&&document.activeElement,b=SL(m),y=b.map(function(x){var w=x.node;return w}).indexOf(v);y>-1&&(b.filter(function(x){var w=x.guard,k=x.node;return w&&k.dataset.focusAutoGuard}).forEach(function(x){var w=x.node;return w.removeAttribute("tabIndex")}),Kw(y,b.length,1,b),Kw(y,-1,-1,b))}}}return t},j3=function(t){oh()&&t&&(t.stopPropagation(),t.preventDefault())},mx=function(){return hx(oh)},NL=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||EL(r,n)},TL=function(){return null},P3=function(){ed="just",hx(function(){ed="meanwhile"})},$L=function(){document.addEventListener("focusin",j3),document.addEventListener("focusout",mx),window.addEventListener("blur",P3)},LL=function(){document.removeEventListener("focusin",j3),document.removeEventListener("focusout",mx),window.removeEventListener("blur",P3)};function zL(e){return e.filter(function(t){var n=t.disabled;return!n})}function FL(e){var t=e.slice(-1)[0];t&&!rc&&$L();var n=rc,r=n&&t&&t.id===n.id;rc=t,n&&!r&&(n.onDeactivation(),e.filter(function(o){var s=o.id;return s===n.id}).length||n.returnFocus(!t)),t?(Kl=null,(!r||n.observed!==t.observed)&&t.onActivation(),oh(),hx(oh)):(LL(),Kl=null)}l3.assignSyncMedium(NL);c3.assignMedium(mx);G$.assignMedium(function(e){return e({moveFocusInside:_3,focusInside:w3})});const BL=Y$(zL,FL)(TL);var I3=d.forwardRef(function(t,n){return d.createElement(u3,rn({sideCar:BL,ref:n},t))}),E3=u3.propTypes||{};E3.sideCar;KN(E3,["sideCar"]);I3.propTypes={};const qw=I3;function M3(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function gx(e){var t;if(!M3(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function HL(e){var t,n;return(n=(t=O3(e))==null?void 0:t.defaultView)!=null?n:window}function O3(e){return M3(e)?e.ownerDocument:document}function WL(e){return O3(e).activeElement}function VL(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 UL(e){return e.localName==="html"?e:e.assignedSlot||e.parentElement||e.ownerDocument.documentElement}function D3(e){return["html","body","#document"].includes(e.localName)?e.ownerDocument.body:gx(e)&&VL(e)?e:D3(UL(e))}var R3=e=>e.hasAttribute("tabindex"),GL=e=>R3(e)&&e.tabIndex===-1;function KL(e){return!!e.getAttribute("disabled")||!!e.getAttribute("aria-disabled")}function A3(e){return e.parentElement&&A3(e.parentElement)?!0:e.hidden}function qL(e){const t=e.getAttribute("contenteditable");return t!=="false"&&t!=null}function N3(e){if(!gx(e)||A3(e)||KL(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]():qL(e)?!0:R3(e)}function XL(e){return e?gx(e)&&N3(e)&&!GL(e):!1}var YL=["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]"],QL=YL.join(),ZL=e=>e.offsetWidth>0&&e.offsetHeight>0;function T3(e){const t=Array.from(e.querySelectorAll(QL));return t.unshift(e),t.filter(n=>N3(n)&&ZL(n))}var Xw,JL=(Xw=qw.default)!=null?Xw:qw,$3=e=>{const{initialFocusRef:t,finalFocusRef:n,contentRef:r,restoreFocus:o,children:s,isDisabled:i,autoFocus:l,persistentFocus:u,lockFocusAcrossFrames:p}=e,h=d.useCallback(()=>{t!=null&&t.current?t.current.focus():r!=null&&r.current&&T3(r.current).length===0&&requestAnimationFrame(()=>{var y;(y=r.current)==null||y.focus()})},[t,r]),m=d.useCallback(()=>{var b;(b=n==null?void 0:n.current)==null||b.focus()},[n]),v=o&&!n;return a.jsx(JL,{crossFrame:p,persistentFocus:u,autoFocus:l,disabled:i,onActivation:h,onDeactivation:m,returnFocus:v,children:s})};$3.displayName="FocusLock";var ez=fT?d.useLayoutEffect:d.useEffect;function I1(e,t=[]){const n=d.useRef(e);return ez(()=>{n.current=e}),d.useCallback((...r)=>{var o;return(o=n.current)==null?void 0:o.call(n,...r)},t)}function tz(e,t,n,r){const o=I1(t);return d.useEffect(()=>{var s;const i=(s=$C(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=$C(n))!=null?s:document).removeEventListener(e,o,r)}}function nz(e,t){const n=d.useId();return d.useMemo(()=>e||[t,n].filter(Boolean).join("-"),[e,t,n])}function rz(e,t){const n=e!==void 0;return[n,n&&typeof e<"u"?e:t]}function Mr(e={}){const{onClose:t,onOpen:n,isOpen:r,id:o}=e,s=I1(n),i=I1(t),[l,u]=d.useState(e.defaultIsOpen||!1),[p,h]=rz(r,l),m=nz(o,"disclosure"),v=d.useCallback(()=>{p||u(!1),i==null||i()},[p,i]),b=d.useCallback(()=>{p||u(!0),s==null||s()},[p,s]),y=d.useCallback(()=>{(h?v:b)()},[h,b,v]);return{isOpen:!!h,onOpen:b,onClose:v,onToggle:y,isControlled:p,getButtonProps:(x={})=>({...x,"aria-expanded":h,"aria-controls":m,onClick:$7(x.onClick,y)}),getDisclosureProps:(x={})=>({...x,hidden:!h,id:m})}}var[oz,sz]=$t({name:"InputGroupStylesContext",errorMessage:`useInputGroupStyles returned is 'undefined'. Seems you forgot to wrap the components in "<InputGroup />" `}),L3=Pe(function(t,n){const r=Wn("Input",t),{children:o,className:s,...i}=Yt(t),l=et("chakra-input__group",s),u={},p=Id(o),h=r.field;p.forEach(v=>{var b,y;r&&(h&&v.type.id==="InputLeftElement"&&(u.paddingStart=(b=h.height)!=null?b:h.h),h&&v.type.id==="InputRightElement"&&(u.paddingEnd=(y=h.height)!=null?y:h.h),v.type.id==="InputRightAddon"&&(u.borderEndRadius=0),v.type.id==="InputLeftAddon"&&(u.borderStartRadius=0))});const m=p.map(v=>{var b,y;const x=Aj({size:((b=v.props)==null?void 0:b.size)||t.size,variant:((y=v.props)==null?void 0:y.variant)||t.variant});return v.type.id!=="Input"?d.cloneElement(v,x):d.cloneElement(v,Object.assign(x,u,v.props))});return a.jsx(_e.div,{className:l,ref:n,__css:{width:"100%",display:"flex",position:"relative",isolation:"isolate",...r.group},"data-group":!0,...i,children:a.jsx(oz,{value:r,children:m})})});L3.displayName="InputGroup";var az=_e("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"0",zIndex:2}}),Im=Pe(function(t,n){var r,o;const{placement:s="left",...i}=t,l=sz(),u=l.field,h={[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(az,{ref:n,__css:h,...i})});Im.id="InputElement";Im.displayName="InputElement";var z3=Pe(function(t,n){const{className:r,...o}=t,s=et("chakra-input__left-element",r);return a.jsx(Im,{ref:n,placement:"left",className:s,...o})});z3.id="InputLeftElement";z3.displayName="InputLeftElement";var vx=Pe(function(t,n){const{className:r,...o}=t,s=et("chakra-input__right-element",r);return a.jsx(Im,{ref:n,placement:"right",className:s,...o})});vx.id="InputRightElement";vx.displayName="InputRightElement";var Em=Pe(function(t,n){const{htmlSize:r,...o}=t,s=Wn("Input",o),i=Yt(o),l=tx(i),u=et("chakra-input",t.className);return a.jsx(_e.input,{size:r,...l,__css:s.field,ref:n,className:u})});Em.displayName="Input";Em.id="Input";var Mm=Pe(function(t,n){const r=Qa("Link",t),{className:o,isExternal:s,...i}=Yt(t);return a.jsx(_e.a,{target:s?"_blank":void 0,rel:s?"noopener":void 0,ref:n,className:et("chakra-link",o),...i,__css:r})});Mm.displayName="Link";var[iz,F3]=$t({name:"ListStylesContext",errorMessage:`useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "<List />" `}),bx=Pe(function(t,n){const r=Wn("List",t),{children:o,styleType:s="none",stylePosition:i,spacing:l,...u}=Yt(t),p=Id(o),m=l?{["& > *:not(style) ~ *:not(style)"]:{mt:l}}:{};return a.jsx(iz,{value:r,children:a.jsx(_e.ul,{ref:n,listStyleType:s,listStylePosition:i,role:"list",__css:{...r.container,...m},...u,children:p})})});bx.displayName="List";var lz=Pe((e,t)=>{const{as:n,...r}=e;return a.jsx(bx,{ref:t,as:"ol",styleType:"decimal",marginStart:"1em",...r})});lz.displayName="OrderedList";var Od=Pe(function(t,n){const{as:r,...o}=t;return a.jsx(bx,{ref:n,as:"ul",styleType:"initial",marginStart:"1em",...o})});Od.displayName="UnorderedList";var lo=Pe(function(t,n){const r=F3();return a.jsx(_e.li,{ref:n,...t,__css:r.item})});lo.displayName="ListItem";var cz=Pe(function(t,n){const r=F3();return a.jsx(Tn,{ref:n,role:"presentation",...t,__css:r.icon})});cz.displayName="ListIcon";var Ga=Pe(function(t,n){const{templateAreas:r,gap:o,rowGap:s,columnGap:i,column:l,row:u,autoFlow:p,autoRows:h,templateRows:m,autoColumns:v,templateColumns:b,...y}=t,x={display:"grid",gridTemplateAreas:r,gridGap:o,gridRowGap:s,gridColumnGap:i,gridAutoColumns:v,gridColumn:l,gridRow:u,gridAutoFlow:p,gridAutoRows:h,gridTemplateRows:m,gridTemplateColumns:b};return a.jsx(_e.div,{ref:n,__css:x,...y})});Ga.displayName="Grid";function B3(e,t){return Array.isArray(e)?e.map(n=>n===null?null:t(n)):r1(e)?Object.keys(e).reduce((n,r)=>(n[r]=t(e[r]),n),{}):e!=null?t(e):null}var Za=_e("div",{baseStyle:{flex:1,justifySelf:"stretch",alignSelf:"stretch"}});Za.displayName="Spacer";var H3=e=>a.jsx(_e.div,{className:"chakra-stack__item",...e,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...e.__css}});H3.displayName="StackItem";function uz(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{"&":B3(n,o=>r[o])}}var xx=Pe((e,t)=>{const{isInline:n,direction:r,align:o,justify:s,spacing:i="0.5rem",wrap:l,children:u,divider:p,className:h,shouldWrapChildren:m,...v}=e,b=n?"row":r??"column",y=d.useMemo(()=>uz({spacing:i,direction:b}),[i,b]),x=!!p,w=!m&&!x,k=d.useMemo(()=>{const j=Id(u);return w?j:j.map((I,E)=>{const M=typeof I.key<"u"?I.key:E,D=E+1===j.length,A=m?a.jsx(H3,{children:I},M):I;if(!x)return A;const O=d.cloneElement(p,{__css:y}),T=D?null:O;return a.jsxs(d.Fragment,{children:[A,T]},M)})},[p,y,x,w,m,u]),_=et("chakra-stack",h);return a.jsx(_e.div,{ref:t,display:"flex",alignItems:o,justifyContent:s,flexDirection:b,flexWrap:l,gap:x?void 0:i,className:_,...v,children:k})});xx.displayName="Stack";var W3=Pe((e,t)=>a.jsx(xx,{align:"center",...e,direction:"column",ref:t}));W3.displayName="VStack";var Om=Pe((e,t)=>a.jsx(xx,{align:"center",...e,direction:"row",ref:t}));Om.displayName="HStack";function Yw(e){return B3(e,t=>t==="auto"?"auto":`span ${t}/span ${t}`)}var td=Pe(function(t,n){const{area:r,colSpan:o,colStart:s,colEnd:i,rowEnd:l,rowSpan:u,rowStart:p,...h}=t,m=Aj({gridArea:r,gridColumn:Yw(o),gridRow:Yw(u),gridColumnStart:s,gridColumnEnd:i,gridRowStart:p,gridRowEnd:l});return a.jsx(_e.div,{ref:n,__css:m,...h})});td.displayName="GridItem";var da=Pe(function(t,n){const r=Qa("Badge",t),{className:o,...s}=Yt(t);return a.jsx(_e.span,{ref:n,className:et("chakra-badge",t.className),...s,__css:{display:"inline-block",whiteSpace:"nowrap",verticalAlign:"middle",...r}})});da.displayName="Badge";var Vr=Pe(function(t,n){const{borderLeftWidth:r,borderBottomWidth:o,borderTopWidth:s,borderRightWidth:i,borderWidth:l,borderStyle:u,borderColor:p,...h}=Qa("Divider",t),{className:m,orientation:v="horizontal",__css:b,...y}=Yt(t),x={vertical:{borderLeftWidth:r||i||l||"1px",height:"100%"},horizontal:{borderBottomWidth:o||s||l||"1px",width:"100%"}};return a.jsx(_e.hr,{ref:n,"aria-orientation":v,...y,__css:{...h,border:"0",borderColor:p,borderStyle:u,...x[v],...b},className:et("chakra-divider",m)})});Vr.displayName="Divider";function dz(e){const{key:t}=e;return t.length===1||t.length>1&&/[^a-zA-Z0-9]/.test(t)}function fz(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 h=>{if(h.key==="Backspace"){const m=[...r];m.pop(),o(m);return}if(dz(h)){const m=r.concat(h.key);n(h)&&(h.preventDefault(),h.stopPropagation()),o(m),p(m.join("")),l()}}}return u}function pz(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 hz(){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 iv(e){const t=e.target,{tagName:n,isContentEditable:r}=t;return n!=="INPUT"&&n!=="TEXTAREA"&&r!==!0}function V3(e={}){const{ref:t,isDisabled:n,isFocusable:r,clickOnEnter:o=!0,clickOnSpace:s=!0,onMouseDown:i,onMouseUp:l,onClick:u,onKeyDown:p,onKeyUp:h,tabIndex:m,onMouseOver:v,onMouseLeave:b,...y}=e,[x,w]=d.useState(!0),[k,_]=d.useState(!1),j=hz(),I=z=>{z&&z.tagName!=="BUTTON"&&w(!1)},E=x?m:m||0,M=n&&!r,D=d.useCallback(z=>{if(n){z.stopPropagation(),z.preventDefault();return}z.currentTarget.focus(),u==null||u(z)},[n,u]),R=d.useCallback(z=>{k&&iv(z)&&(z.preventDefault(),z.stopPropagation(),_(!1),j.remove(document,"keyup",R,!1))},[k,j]),A=d.useCallback(z=>{if(p==null||p(z),n||z.defaultPrevented||z.metaKey||!iv(z.nativeEvent)||x)return;const Y=o&&z.key==="Enter";s&&z.key===" "&&(z.preventDefault(),_(!0)),Y&&(z.preventDefault(),z.currentTarget.click()),j.add(document,"keyup",R,!1)},[n,x,p,o,s,j,R]),O=d.useCallback(z=>{if(h==null||h(z),n||z.defaultPrevented||z.metaKey||!iv(z.nativeEvent)||x)return;s&&z.key===" "&&(z.preventDefault(),_(!1),z.currentTarget.click())},[s,x,n,h]),T=d.useCallback(z=>{z.button===0&&(_(!1),j.remove(document,"mouseup",T,!1))},[j]),K=d.useCallback(z=>{if(z.button!==0)return;if(n){z.stopPropagation(),z.preventDefault();return}x||_(!0),z.currentTarget.focus({preventScroll:!0}),j.add(document,"mouseup",T,!1),i==null||i(z)},[n,x,i,j,T]),F=d.useCallback(z=>{z.button===0&&(x||_(!1),l==null||l(z))},[l,x]),V=d.useCallback(z=>{if(n){z.preventDefault();return}v==null||v(z)},[n,v]),X=d.useCallback(z=>{k&&(z.preventDefault(),_(!1)),b==null||b(z)},[k,b]),W=Ct(t,I);return x?{...y,ref:W,type:"button","aria-disabled":M?void 0:n,disabled:M,onClick:D,onMouseDown:i,onMouseUp:l,onKeyUp:h,onKeyDown:p,onMouseOver:v,onMouseLeave:b}:{...y,ref:W,role:"button","data-active":at(k),"aria-disabled":n?"true":void 0,tabIndex:M?void 0:E,onClick:D,onMouseDown:K,onMouseUp:F,onKeyUp:O,onKeyDown:A,onMouseOver:V,onMouseLeave:X}}function mz(e){const t=e.current;if(!t)return!1;const n=WL(t);return!n||t.contains(n)?!1:!!XL(n)}function U3(e,t){const{shouldFocus:n,visible:r,focusRef:o}=t,s=n&&!r;ca(()=>{if(!s||mz(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 gz={preventScroll:!0,shouldFocus:!1};function vz(e,t=gz){const{focusRef:n,preventScroll:r,shouldFocus:o,visible:s}=t,i=bz(e)?e.current:e,l=o&&s,u=d.useRef(l),p=d.useRef(s);Zl(()=>{!p.current&&s&&(u.current=l),p.current=s},[s,l]);const h=d.useCallback(()=>{if(!(!s||!i||!u.current)&&(u.current=!1,!i.contains(document.activeElement)))if(n!=null&&n.current)requestAnimationFrame(()=>{var m;(m=n.current)==null||m.focus({preventScroll:r})});else{const m=T3(i);m.length>0&&requestAnimationFrame(()=>{m[0].focus({preventScroll:r})})}},[s,r,i,n]);ca(()=>{h()},[h]),_i(i,"transitionend",h)}function bz(e){return"current"in e}var Pl=(e,t)=>({var:e,varRef:t?`var(${e}, ${t})`:`var(${e})`}),jn={arrowShadowColor:Pl("--popper-arrow-shadow-color"),arrowSize:Pl("--popper-arrow-size","8px"),arrowSizeHalf:Pl("--popper-arrow-size-half"),arrowBg:Pl("--popper-arrow-bg"),transformOrigin:Pl("--popper-transform-origin"),arrowOffset:Pl("--popper-arrow-offset")};function xz(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 yz={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"},Cz=e=>yz[e],Qw={scroll:!0,resize:!0};function wz(e){let t;return typeof e=="object"?t={enabled:!0,options:{...Qw,...e}}:t={enabled:e,options:Qw},t}var Sz={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`}},kz={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:e})=>{Zw(e)},effect:({state:e})=>()=>{Zw(e)}},Zw=e=>{e.elements.popper.style.setProperty(jn.transformOrigin.var,Cz(e.placement))},_z={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:e})=>{jz(e)}},jz=e=>{var t;if(!e.placement)return;const n=Pz(e.placement);if((t=e.elements)!=null&&t.arrow&&n){Object.assign(e.elements.arrow.style,{[n.property]:n.value,width:jn.arrowSize.varRef,height:jn.arrowSize.varRef,zIndex:-1});const r={[jn.arrowSizeHalf.var]:`calc(${jn.arrowSize.varRef} / 2 - 1px)`,[jn.arrowOffset.var]:`calc(${jn.arrowSizeHalf.varRef} * -1)`};for(const o in r)e.elements.arrow.style.setProperty(o,r[o])}},Pz=e=>{if(e.startsWith("top"))return{property:"bottom",value:jn.arrowOffset.varRef};if(e.startsWith("bottom"))return{property:"top",value:jn.arrowOffset.varRef};if(e.startsWith("left"))return{property:"right",value:jn.arrowOffset.varRef};if(e.startsWith("right"))return{property:"left",value:jn.arrowOffset.varRef}},Iz={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:e})=>{Jw(e)},effect:({state:e})=>()=>{Jw(e)}},Jw=e=>{if(!e.elements.arrow)return;const t=e.elements.arrow.querySelector("[data-popper-arrow-inner]");if(!t)return;const n=xz(e.placement);n&&t.style.setProperty("--popper-arrow-default-shadow",n),Object.assign(t.style,{transform:"rotate(45deg)",background:jn.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:"var(--popper-arrow-shadow, var(--popper-arrow-default-shadow))"})},Ez={"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"}},Mz={"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 Oz(e,t="ltr"){var n,r;const o=((n=Ez[e])==null?void 0:n[t])||e;return t==="ltr"?o:(r=Mz[e])!=null?r:o}var _r="top",go="bottom",vo="right",jr="left",yx="auto",Dd=[_r,go,vo,jr],xc="start",nd="end",Dz="clippingParents",G3="viewport",Cu="popper",Rz="reference",eS=Dd.reduce(function(e,t){return e.concat([t+"-"+xc,t+"-"+nd])},[]),K3=[].concat(Dd,[yx]).reduce(function(e,t){return e.concat([t,t+"-"+xc,t+"-"+nd])},[]),Az="beforeRead",Nz="read",Tz="afterRead",$z="beforeMain",Lz="main",zz="afterMain",Fz="beforeWrite",Bz="write",Hz="afterWrite",Wz=[Az,Nz,Tz,$z,Lz,zz,Fz,Bz,Hz];function ms(e){return e?(e.nodeName||"").toLowerCase():null}function Ur(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Fi(e){var t=Ur(e).Element;return e instanceof t||e instanceof Element}function ho(e){var t=Ur(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Cx(e){if(typeof ShadowRoot>"u")return!1;var t=Ur(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Vz(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];!ho(s)||!ms(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 Uz(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},{});!ho(o)||!ms(o)||(Object.assign(o.style,l),Object.keys(s).forEach(function(u){o.removeAttribute(u)}))})}}const Gz={name:"applyStyles",enabled:!0,phase:"write",fn:Vz,effect:Uz,requires:["computeStyles"]};function hs(e){return e.split("-")[0]}var ji=Math.max,sh=Math.min,yc=Math.round;function E1(){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 q3(){return!/^((?!chrome|android).)*safari/i.test(E1())}function Cc(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),o=1,s=1;t&&ho(e)&&(o=e.offsetWidth>0&&yc(r.width)/e.offsetWidth||1,s=e.offsetHeight>0&&yc(r.height)/e.offsetHeight||1);var i=Fi(e)?Ur(e):window,l=i.visualViewport,u=!q3()&&n,p=(r.left+(u&&l?l.offsetLeft:0))/o,h=(r.top+(u&&l?l.offsetTop:0))/s,m=r.width/o,v=r.height/s;return{width:m,height:v,top:h,right:p+m,bottom:h+v,left:p,x:p,y:h}}function wx(e){var t=Cc(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 X3(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Cx(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ta(e){return Ur(e).getComputedStyle(e)}function Kz(e){return["table","td","th"].indexOf(ms(e))>=0}function Ja(e){return((Fi(e)?e.ownerDocument:e.document)||window.document).documentElement}function Dm(e){return ms(e)==="html"?e:e.assignedSlot||e.parentNode||(Cx(e)?e.host:null)||Ja(e)}function tS(e){return!ho(e)||ta(e).position==="fixed"?null:e.offsetParent}function qz(e){var t=/firefox/i.test(E1()),n=/Trident/i.test(E1());if(n&&ho(e)){var r=ta(e);if(r.position==="fixed")return null}var o=Dm(e);for(Cx(o)&&(o=o.host);ho(o)&&["html","body"].indexOf(ms(o))<0;){var s=ta(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 Rd(e){for(var t=Ur(e),n=tS(e);n&&Kz(n)&&ta(n).position==="static";)n=tS(n);return n&&(ms(n)==="html"||ms(n)==="body"&&ta(n).position==="static")?t:n||qz(e)||t}function Sx(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Hu(e,t,n){return ji(e,sh(t,n))}function Xz(e,t,n){var r=Hu(e,t,n);return r>n?n:r}function Y3(){return{top:0,right:0,bottom:0,left:0}}function Q3(e){return Object.assign({},Y3(),e)}function Z3(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var Yz=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,Q3(typeof t!="number"?t:Z3(t,Dd))};function Qz(e){var t,n=e.state,r=e.name,o=e.options,s=n.elements.arrow,i=n.modifiersData.popperOffsets,l=hs(n.placement),u=Sx(l),p=[jr,vo].indexOf(l)>=0,h=p?"height":"width";if(!(!s||!i)){var m=Yz(o.padding,n),v=wx(s),b=u==="y"?_r:jr,y=u==="y"?go:vo,x=n.rects.reference[h]+n.rects.reference[u]-i[u]-n.rects.popper[h],w=i[u]-n.rects.reference[u],k=Rd(s),_=k?u==="y"?k.clientHeight||0:k.clientWidth||0:0,j=x/2-w/2,I=m[b],E=_-v[h]-m[y],M=_/2-v[h]/2+j,D=Hu(I,M,E),R=u;n.modifiersData[r]=(t={},t[R]=D,t.centerOffset=D-M,t)}}function Zz(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)||X3(t.elements.popper,o)&&(t.elements.arrow=o))}const Jz={name:"arrow",enabled:!0,phase:"main",fn:Qz,effect:Zz,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function wc(e){return e.split("-")[1]}var eF={top:"auto",right:"auto",bottom:"auto",left:"auto"};function tF(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:yc(n*o)/o||0,y:yc(r*o)/o||0}}function nS(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,h=e.roundOffsets,m=e.isFixed,v=i.x,b=v===void 0?0:v,y=i.y,x=y===void 0?0:y,w=typeof h=="function"?h({x:b,y:x}):{x:b,y:x};b=w.x,x=w.y;var k=i.hasOwnProperty("x"),_=i.hasOwnProperty("y"),j=jr,I=_r,E=window;if(p){var M=Rd(n),D="clientHeight",R="clientWidth";if(M===Ur(n)&&(M=Ja(n),ta(M).position!=="static"&&l==="absolute"&&(D="scrollHeight",R="scrollWidth")),M=M,o===_r||(o===jr||o===vo)&&s===nd){I=go;var A=m&&M===E&&E.visualViewport?E.visualViewport.height:M[D];x-=A-r.height,x*=u?1:-1}if(o===jr||(o===_r||o===go)&&s===nd){j=vo;var O=m&&M===E&&E.visualViewport?E.visualViewport.width:M[R];b-=O-r.width,b*=u?1:-1}}var T=Object.assign({position:l},p&&eF),K=h===!0?tF({x:b,y:x},Ur(n)):{x:b,y:x};if(b=K.x,x=K.y,u){var F;return Object.assign({},T,(F={},F[I]=_?"0":"",F[j]=k?"0":"",F.transform=(E.devicePixelRatio||1)<=1?"translate("+b+"px, "+x+"px)":"translate3d("+b+"px, "+x+"px, 0)",F))}return Object.assign({},T,(t={},t[I]=_?x+"px":"",t[j]=k?b+"px":"",t.transform="",t))}function nF(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:hs(t.placement),variation:wc(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,nS(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,nS(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 rF={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:nF,data:{}};var Qf={passive:!0};function oF(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=Ur(t.elements.popper),p=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&p.forEach(function(h){h.addEventListener("scroll",n.update,Qf)}),l&&u.addEventListener("resize",n.update,Qf),function(){s&&p.forEach(function(h){h.removeEventListener("scroll",n.update,Qf)}),l&&u.removeEventListener("resize",n.update,Qf)}}const sF={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:oF,data:{}};var aF={left:"right",right:"left",bottom:"top",top:"bottom"};function Rp(e){return e.replace(/left|right|bottom|top/g,function(t){return aF[t]})}var iF={start:"end",end:"start"};function rS(e){return e.replace(/start|end/g,function(t){return iF[t]})}function kx(e){var t=Ur(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function _x(e){return Cc(Ja(e)).left+kx(e).scrollLeft}function lF(e,t){var n=Ur(e),r=Ja(e),o=n.visualViewport,s=r.clientWidth,i=r.clientHeight,l=0,u=0;if(o){s=o.width,i=o.height;var p=q3();(p||!p&&t==="fixed")&&(l=o.offsetLeft,u=o.offsetTop)}return{width:s,height:i,x:l+_x(e),y:u}}function cF(e){var t,n=Ja(e),r=kx(e),o=(t=e.ownerDocument)==null?void 0:t.body,s=ji(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),i=ji(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),l=-r.scrollLeft+_x(e),u=-r.scrollTop;return ta(o||n).direction==="rtl"&&(l+=ji(n.clientWidth,o?o.clientWidth:0)-s),{width:s,height:i,x:l,y:u}}function jx(e){var t=ta(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function J3(e){return["html","body","#document"].indexOf(ms(e))>=0?e.ownerDocument.body:ho(e)&&jx(e)?e:J3(Dm(e))}function Wu(e,t){var n;t===void 0&&(t=[]);var r=J3(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),s=Ur(r),i=o?[s].concat(s.visualViewport||[],jx(r)?r:[]):r,l=t.concat(i);return o?l:l.concat(Wu(Dm(i)))}function M1(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function uF(e,t){var n=Cc(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 oS(e,t,n){return t===G3?M1(lF(e,n)):Fi(t)?uF(t,n):M1(cF(Ja(e)))}function dF(e){var t=Wu(Dm(e)),n=["absolute","fixed"].indexOf(ta(e).position)>=0,r=n&&ho(e)?Rd(e):e;return Fi(r)?t.filter(function(o){return Fi(o)&&X3(o,r)&&ms(o)!=="body"}):[]}function fF(e,t,n,r){var o=t==="clippingParents"?dF(e):[].concat(t),s=[].concat(o,[n]),i=s[0],l=s.reduce(function(u,p){var h=oS(e,p,r);return u.top=ji(h.top,u.top),u.right=sh(h.right,u.right),u.bottom=sh(h.bottom,u.bottom),u.left=ji(h.left,u.left),u},oS(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 eP(e){var t=e.reference,n=e.element,r=e.placement,o=r?hs(r):null,s=r?wc(r):null,i=t.x+t.width/2-n.width/2,l=t.y+t.height/2-n.height/2,u;switch(o){case _r:u={x:i,y:t.y-n.height};break;case go:u={x:i,y:t.y+t.height};break;case vo:u={x:t.x+t.width,y:l};break;case jr:u={x:t.x-n.width,y:l};break;default:u={x:t.x,y:t.y}}var p=o?Sx(o):null;if(p!=null){var h=p==="y"?"height":"width";switch(s){case xc:u[p]=u[p]-(t[h]/2-n[h]/2);break;case nd:u[p]=u[p]+(t[h]/2-n[h]/2);break}}return u}function rd(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?Dz:l,p=n.rootBoundary,h=p===void 0?G3:p,m=n.elementContext,v=m===void 0?Cu:m,b=n.altBoundary,y=b===void 0?!1:b,x=n.padding,w=x===void 0?0:x,k=Q3(typeof w!="number"?w:Z3(w,Dd)),_=v===Cu?Rz:Cu,j=e.rects.popper,I=e.elements[y?_:v],E=fF(Fi(I)?I:I.contextElement||Ja(e.elements.popper),u,h,i),M=Cc(e.elements.reference),D=eP({reference:M,element:j,strategy:"absolute",placement:o}),R=M1(Object.assign({},j,D)),A=v===Cu?R:M,O={top:E.top-A.top+k.top,bottom:A.bottom-E.bottom+k.bottom,left:E.left-A.left+k.left,right:A.right-E.right+k.right},T=e.modifiersData.offset;if(v===Cu&&T){var K=T[o];Object.keys(O).forEach(function(F){var V=[vo,go].indexOf(F)>=0?1:-1,X=[_r,go].indexOf(F)>=0?"y":"x";O[F]+=K[X]*V})}return O}function pF(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?K3:u,h=wc(r),m=h?l?eS:eS.filter(function(y){return wc(y)===h}):Dd,v=m.filter(function(y){return p.indexOf(y)>=0});v.length===0&&(v=m);var b=v.reduce(function(y,x){return y[x]=rd(e,{placement:x,boundary:o,rootBoundary:s,padding:i})[hs(x)],y},{});return Object.keys(b).sort(function(y,x){return b[y]-b[x]})}function hF(e){if(hs(e)===yx)return[];var t=Rp(e);return[rS(e),t,rS(t)]}function mF(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,h=n.boundary,m=n.rootBoundary,v=n.altBoundary,b=n.flipVariations,y=b===void 0?!0:b,x=n.allowedAutoPlacements,w=t.options.placement,k=hs(w),_=k===w,j=u||(_||!y?[Rp(w)]:hF(w)),I=[w].concat(j).reduce(function(se,U){return se.concat(hs(U)===yx?pF(t,{placement:U,boundary:h,rootBoundary:m,padding:p,flipVariations:y,allowedAutoPlacements:x}):U)},[]),E=t.rects.reference,M=t.rects.popper,D=new Map,R=!0,A=I[0],O=0;O<I.length;O++){var T=I[O],K=hs(T),F=wc(T)===xc,V=[_r,go].indexOf(K)>=0,X=V?"width":"height",W=rd(t,{placement:T,boundary:h,rootBoundary:m,altBoundary:v,padding:p}),z=V?F?vo:jr:F?go:_r;E[X]>M[X]&&(z=Rp(z));var Y=Rp(z),B=[];if(s&&B.push(W[K]<=0),l&&B.push(W[z]<=0,W[Y]<=0),B.every(function(se){return se})){A=T,R=!1;break}D.set(T,B)}if(R)for(var q=y?3:1,re=function(U){var G=I.find(function(te){var ae=D.get(te);if(ae)return ae.slice(0,U).every(function(oe){return oe})});if(G)return A=G,"break"},Q=q;Q>0;Q--){var le=re(Q);if(le==="break")break}t.placement!==A&&(t.modifiersData[r]._skip=!0,t.placement=A,t.reset=!0)}}const gF={name:"flip",enabled:!0,phase:"main",fn:mF,requiresIfExists:["offset"],data:{_skip:!1}};function sS(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 aS(e){return[_r,vo,go,jr].some(function(t){return e[t]>=0})}function vF(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,s=t.modifiersData.preventOverflow,i=rd(t,{elementContext:"reference"}),l=rd(t,{altBoundary:!0}),u=sS(i,r),p=sS(l,o,s),h=aS(u),m=aS(p);t.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:p,isReferenceHidden:h,hasPopperEscaped:m},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":m})}const bF={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:vF};function xF(e,t,n){var r=hs(e),o=[jr,_r].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,[jr,vo].indexOf(r)>=0?{x:l,y:i}:{x:i,y:l}}function yF(e){var t=e.state,n=e.options,r=e.name,o=n.offset,s=o===void 0?[0,0]:o,i=K3.reduce(function(h,m){return h[m]=xF(m,t.rects,s),h},{}),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 CF={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:yF};function wF(e){var t=e.state,n=e.name;t.modifiersData[n]=eP({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const SF={name:"popperOffsets",enabled:!0,phase:"read",fn:wF,data:{}};function kF(e){return e==="x"?"y":"x"}function _F(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,h=n.altBoundary,m=n.padding,v=n.tether,b=v===void 0?!0:v,y=n.tetherOffset,x=y===void 0?0:y,w=rd(t,{boundary:u,rootBoundary:p,padding:m,altBoundary:h}),k=hs(t.placement),_=wc(t.placement),j=!_,I=Sx(k),E=kF(I),M=t.modifiersData.popperOffsets,D=t.rects.reference,R=t.rects.popper,A=typeof x=="function"?x(Object.assign({},t.rects,{placement:t.placement})):x,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,K={x:0,y:0};if(M){if(s){var F,V=I==="y"?_r:jr,X=I==="y"?go:vo,W=I==="y"?"height":"width",z=M[I],Y=z+w[V],B=z-w[X],q=b?-R[W]/2:0,re=_===xc?D[W]:R[W],Q=_===xc?-R[W]:-D[W],le=t.elements.arrow,se=b&&le?wx(le):{width:0,height:0},U=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Y3(),G=U[V],te=U[X],ae=Hu(0,D[W],se[W]),oe=j?D[W]/2-q-ae-G-O.mainAxis:re-ae-G-O.mainAxis,pe=j?-D[W]/2+q+ae+te+O.mainAxis:Q+ae+te+O.mainAxis,ue=t.elements.arrow&&Rd(t.elements.arrow),me=ue?I==="y"?ue.clientTop||0:ue.clientLeft||0:0,Ce=(F=T==null?void 0:T[I])!=null?F:0,ge=z+oe-Ce-me,fe=z+pe-Ce,De=Hu(b?sh(Y,ge):Y,z,b?ji(B,fe):B);M[I]=De,K[I]=De-z}if(l){var je,Be=I==="x"?_r:jr,rt=I==="x"?go:vo,Ue=M[E],wt=E==="y"?"height":"width",Ye=Ue+w[Be],tt=Ue-w[rt],be=[_r,jr].indexOf(k)!==-1,Re=(je=T==null?void 0:T[E])!=null?je:0,st=be?Ye:Ue-D[wt]-R[wt]-Re+O.altAxis,mt=be?Ue+D[wt]+R[wt]-Re-O.altAxis:tt,ve=b&&be?Xz(st,Ue,mt):Hu(b?st:Ye,Ue,b?mt:tt);M[E]=ve,K[E]=ve-Ue}t.modifiersData[r]=K}}const jF={name:"preventOverflow",enabled:!0,phase:"main",fn:_F,requiresIfExists:["offset"]};function PF(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function IF(e){return e===Ur(e)||!ho(e)?kx(e):PF(e)}function EF(e){var t=e.getBoundingClientRect(),n=yc(t.width)/e.offsetWidth||1,r=yc(t.height)/e.offsetHeight||1;return n!==1||r!==1}function MF(e,t,n){n===void 0&&(n=!1);var r=ho(t),o=ho(t)&&EF(t),s=Ja(t),i=Cc(e,o,n),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&((ms(t)!=="body"||jx(s))&&(l=IF(t)),ho(t)?(u=Cc(t,!0),u.x+=t.clientLeft,u.y+=t.clientTop):s&&(u.x=_x(s))),{x:i.left+l.scrollLeft-u.x,y:i.top+l.scrollTop-u.y,width:i.width,height:i.height}}function OF(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 DF(e){var t=OF(e);return Wz.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function RF(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function AF(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 iS={placement:"bottom",modifiers:[],strategy:"absolute"};function lS(){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 NF(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,o=t.defaultOptions,s=o===void 0?iS:o;return function(l,u,p){p===void 0&&(p=s);var h={placement:"bottom",orderedModifiers:[],options:Object.assign({},iS,s),modifiersData:{},elements:{reference:l,popper:u},attributes:{},styles:{}},m=[],v=!1,b={state:h,setOptions:function(k){var _=typeof k=="function"?k(h.options):k;x(),h.options=Object.assign({},s,h.options,_),h.scrollParents={reference:Fi(l)?Wu(l):l.contextElement?Wu(l.contextElement):[],popper:Wu(u)};var j=DF(AF([].concat(r,h.options.modifiers)));return h.orderedModifiers=j.filter(function(I){return I.enabled}),y(),b.update()},forceUpdate:function(){if(!v){var k=h.elements,_=k.reference,j=k.popper;if(lS(_,j)){h.rects={reference:MF(_,Rd(j),h.options.strategy==="fixed"),popper:wx(j)},h.reset=!1,h.placement=h.options.placement,h.orderedModifiers.forEach(function(O){return h.modifiersData[O.name]=Object.assign({},O.data)});for(var I=0;I<h.orderedModifiers.length;I++){if(h.reset===!0){h.reset=!1,I=-1;continue}var E=h.orderedModifiers[I],M=E.fn,D=E.options,R=D===void 0?{}:D,A=E.name;typeof M=="function"&&(h=M({state:h,options:R,name:A,instance:b})||h)}}}},update:RF(function(){return new Promise(function(w){b.forceUpdate(),w(h)})}),destroy:function(){x(),v=!0}};if(!lS(l,u))return b;b.setOptions(p).then(function(w){!v&&p.onFirstUpdate&&p.onFirstUpdate(w)});function y(){h.orderedModifiers.forEach(function(w){var k=w.name,_=w.options,j=_===void 0?{}:_,I=w.effect;if(typeof I=="function"){var E=I({state:h,name:k,instance:b,options:j}),M=function(){};m.push(E||M)}})}function x(){m.forEach(function(w){return w()}),m=[]}return b}}var TF=[sF,SF,rF,Gz,CF,gF,jF,Jz,bF],$F=NF({defaultModifiers:TF});function Px(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:h="clippingParents",preventOverflow:m=!0,matchWidth:v,direction:b="ltr"}=e,y=d.useRef(null),x=d.useRef(null),w=d.useRef(null),k=Oz(r,b),_=d.useRef(()=>{}),j=d.useCallback(()=>{var O;!t||!y.current||!x.current||((O=_.current)==null||O.call(_),w.current=$F(y.current,x.current,{placement:k,modifiers:[Iz,_z,kz,{...Sz,enabled:!!v},{name:"eventListeners",...wz(i)},{name:"arrow",options:{padding:s}},{name:"offset",options:{offset:l??[0,u]}},{name:"flip",enabled:!!p,options:{padding:8}},{name:"preventOverflow",enabled:!!m,options:{boundary:h}},...n??[]],strategy:o}),w.current.forceUpdate(),_.current=w.current.destroy)},[k,t,n,v,i,s,l,u,p,m,h,o]);d.useEffect(()=>()=>{var O;!y.current&&!x.current&&((O=w.current)==null||O.destroy(),w.current=null)},[]);const I=d.useCallback(O=>{y.current=O,j()},[j]),E=d.useCallback((O={},T=null)=>({...O,ref:Ct(I,T)}),[I]),M=d.useCallback(O=>{x.current=O,j()},[j]),D=d.useCallback((O={},T=null)=>({...O,ref:Ct(M,T),style:{...O.style,position:o,minWidth:v?void 0:"max-content",inset:"0 auto auto 0"}}),[o,M,v]),R=d.useCallback((O={},T=null)=>{const{size:K,shadowColor:F,bg:V,style:X,...W}=O;return{...W,ref:T,"data-popper-arrow":"",style:LF(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:jn.transformOrigin.varRef,referenceRef:I,popperRef:M,getPopperProps:D,getArrowProps:R,getArrowInnerProps:A,getReferenceProps:E}}function LF(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 Ix(e={}){const{onClose:t,onOpen:n,isOpen:r,id:o}=e,s=nn(n),i=nn(t),[l,u]=d.useState(e.defaultIsOpen||!1),p=r!==void 0?r:l,h=r!==void 0,m=d.useId(),v=o??`disclosure-${m}`,b=d.useCallback(()=>{h||u(!1),i==null||i()},[h,i]),y=d.useCallback(()=>{h||u(!0),s==null||s()},[h,s]),x=d.useCallback(()=>{p?b():y()},[p,y,b]);function w(_={}){return{..._,"aria-expanded":p,"aria-controls":v,onClick(j){var I;(I=_.onClick)==null||I.call(_,j),x()}}}function k(_={}){return{..._,hidden:!p,id:v}}return{isOpen:p,onOpen:y,onClose:b,onToggle:x,isControlled:h,getButtonProps:w,getDisclosureProps:k}}function zF(e){const{ref:t,handler:n,enabled:r=!0}=e,o=nn(n),i=d.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}).current;d.useEffect(()=>{if(!r)return;const l=m=>{lv(m,t)&&(i.isPointerDown=!0)},u=m=>{if(i.ignoreEmulatedMouseEvents){i.ignoreEmulatedMouseEvents=!1;return}i.isPointerDown&&n&&lv(m,t)&&(i.isPointerDown=!1,o(m))},p=m=>{i.ignoreEmulatedMouseEvents=!0,n&&i.isPointerDown&&lv(m,t)&&(i.isPointerDown=!1,o(m))},h=tP(t.current);return h.addEventListener("mousedown",l,!0),h.addEventListener("mouseup",u,!0),h.addEventListener("touchstart",l,!0),h.addEventListener("touchend",p,!0),()=>{h.removeEventListener("mousedown",l,!0),h.removeEventListener("mouseup",u,!0),h.removeEventListener("touchstart",l,!0),h.removeEventListener("touchend",p,!0)}},[n,t,o,i,r])}function lv(e,t){var n;const r=e.target;return r&&!tP(r).contains(r)?!1:!((n=t.current)!=null&&n.contains(r))}function tP(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function nP(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]),_i(()=>n.current,"animationend",()=>{o(t)}),{present:!(t?!1:!r),onComplete(){var u;const p=HL(n.current),h=new p.CustomEvent("animationend",{bubbles:!0});(u=n.current)==null||u.dispatchEvent(h)}}}function Ex(e){const{wasSelected:t,enabled:n,isSelected:r,mode:o="unmount"}=e;return!!(!n||r||o==="keepMounted"&&t)}var[FF,BF,HF,WF]=Zb(),[VF,Ad]=$t({strict:!1,name:"MenuContext"});function UF(e,...t){const n=d.useId(),r=e||n;return d.useMemo(()=>t.map(o=>`${o}-${r}`),[r,t])}function rP(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function cS(e){return rP(e).activeElement===e}function GF(e={}){const{id:t,closeOnSelect:n=!0,closeOnBlur:r=!0,initialFocusRef:o,autoSelect:s=!0,isLazy:i,isOpen:l,defaultIsOpen:u,onClose:p,onOpen:h,placement:m="bottom-start",lazyBehavior:v="unmount",direction:b,computePositionOnMount:y=!1,...x}=e,w=d.useRef(null),k=d.useRef(null),_=HF(),j=d.useCallback(()=>{requestAnimationFrame(()=>{var le;(le=w.current)==null||le.focus({preventScroll:!1})})},[]),I=d.useCallback(()=>{const le=setTimeout(()=>{var se;if(o)(se=o.current)==null||se.focus();else{const U=_.firstEnabled();U&&F(U.index)}});Y.current.add(le)},[_,o]),E=d.useCallback(()=>{const le=setTimeout(()=>{const se=_.lastEnabled();se&&F(se.index)});Y.current.add(le)},[_]),M=d.useCallback(()=>{h==null||h(),s?I():j()},[s,I,j,h]),{isOpen:D,onOpen:R,onClose:A,onToggle:O}=Ix({isOpen:l,defaultIsOpen:u,onClose:p,onOpen:M});zF({enabled:D&&r,ref:w,handler:le=>{var se;(se=k.current)!=null&&se.contains(le.target)||A()}});const T=Px({...x,enabled:D||y,placement:m,direction:b}),[K,F]=d.useState(-1);ca(()=>{D||F(-1)},[D]),U3(w,{focusRef:k,visible:D,shouldFocus:!0});const V=nP({isOpen:D,ref:w}),[X,W]=UF(t,"menu-button","menu-list"),z=d.useCallback(()=>{R(),j()},[R,j]),Y=d.useRef(new Set([]));eB(()=>{Y.current.forEach(le=>clearTimeout(le)),Y.current.clear()});const B=d.useCallback(()=>{R(),I()},[I,R]),q=d.useCallback(()=>{R(),E()},[R,E]),re=d.useCallback(()=>{var le,se;const U=rP(w.current),G=(le=w.current)==null?void 0:le.contains(U.activeElement);if(!(D&&!G))return;const ae=(se=_.item(K))==null?void 0:se.node;ae==null||ae.focus()},[D,K,_]),Q=d.useRef(null);return{openAndFocusMenu:z,openAndFocusFirstItem:B,openAndFocusLastItem:q,onTransitionEnd:re,unstable__animationState:V,descendants:_,popper:T,buttonId:X,menuId:W,forceUpdate:T.forceUpdate,orientation:"vertical",isOpen:D,onToggle:O,onOpen:R,onClose:A,menuRef:w,buttonRef:k,focusedIndex:K,closeOnSelect:n,closeOnBlur:r,autoSelect:s,setFocusedIndex:F,isLazy:i,lazyBehavior:v,initialFocusRef:o,rafId:Q}}function KF(e={},t=null){const n=Ad(),{onToggle:r,popper:o,openAndFocusFirstItem:s,openAndFocusLastItem:i}=n,l=d.useCallback(u=>{const p=u.key,m={Enter:s,ArrowDown:s,ArrowUp:i}[p];m&&(u.preventDefault(),u.stopPropagation(),m(u))},[s,i]);return{...e,ref:Ct(n.buttonRef,t,o.referenceRef),id:n.buttonId,"data-active":at(n.isOpen),"aria-expanded":n.isOpen,"aria-haspopup":"menu","aria-controls":n.menuId,onClick:Fe(e.onClick,r),onKeyDown:Fe(e.onKeyDown,l)}}function O1(e){var t;return ZF(e)&&!!((t=e==null?void 0:e.getAttribute("role"))!=null&&t.startsWith("menuitem"))}function qF(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:h,unstable__animationState:m}=n,v=BF(),b=fz({preventDefault:k=>k.key!==" "&&O1(k.target)}),y=d.useCallback(k=>{if(!k.currentTarget.contains(k.target))return;const _=k.key,I={Tab:M=>M.preventDefault(),Escape:l,ArrowDown:()=>{const M=v.nextEnabled(r);M&&o(M.index)},ArrowUp:()=>{const M=v.prevEnabled(r);M&&o(M.index)}}[_];if(I){k.preventDefault(),I(k);return}const E=b(M=>{const D=pz(v.values(),M,R=>{var A,O;return(O=(A=R==null?void 0:R.node)==null?void 0:A.textContent)!=null?O:""},v.item(r));if(D){const R=v.indexOf(D.node);o(R)}});O1(k.target)&&E(k)},[v,r,b,l,o]),x=d.useRef(!1);i&&(x.current=!0);const w=Ex({wasSelected:x.current,enabled:p,mode:h,isSelected:m.present});return{...e,ref:Ct(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:Fe(e.onKeyDown,y)}}function XF(e={}){const{popper:t,isOpen:n}=Ad();return t.getPopperProps({...e,style:{visibility:n?"visible":"hidden",...e.style}})}function oP(e={},t=null){const{onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onClick:s,onFocus:i,isDisabled:l,isFocusable:u,closeOnSelect:p,type:h,...m}=e,v=Ad(),{setFocusedIndex:b,focusedIndex:y,closeOnSelect:x,onClose:w,menuRef:k,isOpen:_,menuId:j,rafId:I}=v,E=d.useRef(null),M=`${j}-menuitem-${d.useId()}`,{index:D,register:R}=WF({disabled:l&&!u}),A=d.useCallback(z=>{n==null||n(z),!l&&b(D)},[b,D,l,n]),O=d.useCallback(z=>{r==null||r(z),E.current&&!cS(E.current)&&A(z)},[A,r]),T=d.useCallback(z=>{o==null||o(z),!l&&b(-1)},[b,l,o]),K=d.useCallback(z=>{s==null||s(z),O1(z.currentTarget)&&(p??x)&&w()},[w,s,x,p]),F=d.useCallback(z=>{i==null||i(z),b(D)},[b,i,D]),V=D===y,X=l&&!u;ca(()=>{_&&(V&&!X&&E.current?(I.current&&cancelAnimationFrame(I.current),I.current=requestAnimationFrame(()=>{var z;(z=E.current)==null||z.focus(),I.current=null})):k.current&&!cS(k.current)&&k.current.focus({preventScroll:!0}))},[V,X,k,_]);const W=V3({onClick:K,onFocus:F,onMouseEnter:A,onMouseMove:O,onMouseLeave:T,ref:Ct(R,E,t),isDisabled:l,isFocusable:u});return{...m,...W,type:h??W.type,id:M,role:"menuitem",tabIndex:V?0:-1}}function YF(e={},t=null){const{type:n="radio",isChecked:r,...o}=e;return{...oP(o,t),role:`menuitem${n}`,"aria-checked":r}}function QF(e={}){const{children:t,type:n="radio",value:r,defaultValue:o,onChange:s,...i}=e,u=n==="radio"?"":[],[p,h]=Ac({defaultValue:o??u,value:r,onChange:s}),m=d.useCallback(y=>{if(n==="radio"&&typeof p=="string"&&h(y),n==="checkbox"&&Array.isArray(p)){const x=p.includes(y)?p.filter(w=>w!==y):p.concat(y);h(x)}},[p,h,n]),b=Id(t).map(y=>{if(y.type.id!=="MenuItemOption")return y;const x=k=>{var _,j;m(y.props.value),(j=(_=y.props).onClick)==null||j.call(_,k)},w=n==="radio"?y.props.value===p:p.includes(y.props.value);return d.cloneElement(y,{type:n,onClick:x,isChecked:w})});return{...i,children:b}}function ZF(e){var t;if(!JF(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function JF(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function eB(e,t=[]){return d.useEffect(()=>()=>e(),t)}var[tB,$c]=$t({name:"MenuStylesContext",errorMessage:`useMenuStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Menu />" `}),Nd=e=>{const{children:t}=e,n=Wn("Menu",e),r=Yt(e),{direction:o}=yd(),{descendants:s,...i}=GF({...r,direction:o}),l=d.useMemo(()=>i,[i]),{isOpen:u,onClose:p,forceUpdate:h}=l;return a.jsx(FF,{value:s,children:a.jsx(VF,{value:l,children:a.jsx(tB,{value:n,children:Nb(t,{isOpen:u,onClose:p,forceUpdate:h})})})})};Nd.displayName="Menu";var sP=Pe((e,t)=>{const n=$c();return a.jsx(_e.span,{ref:t,...e,__css:n.command,className:"chakra-menu__command"})});sP.displayName="MenuCommand";var aP=Pe((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(_e.button,{ref:t,type:s,...r,__css:i})}),Mx=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:et("chakra-menu__icon",s.props.className)}):null,l=et("chakra-menu__icon-wrapper",t);return a.jsx(_e.span,{className:l,...r,__css:o.icon,children:i})};Mx.displayName="MenuIcon";var Wt=Pe((e,t)=>{const{icon:n,iconSpacing:r="0.75rem",command:o,commandSpacing:s="0.75rem",children:i,...l}=e,u=oP(l,t),h=n||o?a.jsx("span",{style:{pointerEvents:"none",flex:1},children:i}):i;return a.jsxs(aP,{...u,className:et("chakra-menu__menuitem",u.className),children:[n&&a.jsx(Mx,{fontSize:"0.8em",marginEnd:r,children:n}),h,o&&a.jsx(sP,{marginStart:s,children:o})]})});Wt.displayName="MenuItem";var nB={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"}}},rB=_e(vn.div),Ka=Pe(function(t,n){var r,o;const{rootProps:s,motionProps:i,...l}=t,{isOpen:u,onTransitionEnd:p,unstable__animationState:h}=Ad(),m=qF(l,n),v=XF(s),b=$c();return a.jsx(_e.div,{...v,__css:{zIndex:(o=t.zIndex)!=null?o:(r=b.list)==null?void 0:r.zIndex},children:a.jsx(rB,{variants:nB,initial:!1,animate:u?"enter":"exit",__css:{outline:0,...b.list},...i,className:et("chakra-menu__menu-list",m.className),...m,onUpdate:p,onAnimationComplete:fm(h.onComplete,m.onAnimationComplete)})})});Ka.displayName="MenuList";var Sc=Pe((e,t)=>{const{title:n,children:r,className:o,...s}=e,i=et("chakra-menu__group__title",o),l=$c();return a.jsxs("div",{ref:t,className:"chakra-menu__group",role:"group",children:[n&&a.jsx(_e.p,{className:i,...s,__css:l.groupTitle,children:n}),r]})});Sc.displayName="MenuGroup";var iP=e=>{const{className:t,title:n,...r}=e,o=QF(r);return a.jsx(Sc,{title:n,className:et("chakra-menu__option-group",t),...o})};iP.displayName="MenuOptionGroup";var oB=Pe((e,t)=>{const n=$c();return a.jsx(_e.button,{ref:t,...e,__css:{display:"inline-flex",appearance:"none",alignItems:"center",outline:0,...n.button}})}),Td=Pe((e,t)=>{const{children:n,as:r,...o}=e,s=KF(o,t),i=r||oB;return a.jsx(i,{...s,className:et("chakra-menu__menu-button",e.className),children:a.jsx(_e.span,{__css:{pointerEvents:"none",flex:"1 1 auto",minW:0},children:e.children})})});Td.displayName="MenuButton";var sB=e=>a.jsx("svg",{viewBox:"0 0 14 14",width:"1em",height:"1em",...e,children:a.jsx("polygon",{fill:"currentColor",points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"})}),ah=Pe((e,t)=>{const{icon:n,iconSpacing:r="0.75rem",...o}=e,s=YF(o,t);return a.jsxs(aP,{...s,className:et("chakra-menu__menuitem-option",o.className),children:[n!==null&&a.jsx(Mx,{fontSize:"0.8em",marginEnd:r,opacity:e.isChecked?1:0,children:n||a.jsx(sB,{})}),a.jsx("span",{style:{flex:1},children:s.children})]})});ah.id="MenuItemOption";ah.displayName="MenuItemOption";var aB={slideInBottom:{...v1,custom:{offsetY:16,reverse:!0}},slideInRight:{...v1,custom:{offsetX:16,reverse:!0}},scale:{...$5,custom:{initialScale:.95,reverse:!0}},none:{}},iB=_e(vn.section),lB=e=>aB[e||"none"],lP=d.forwardRef((e,t)=>{const{preset:n,motionProps:r=lB(n),...o}=e;return a.jsx(iB,{ref:t,...r,...o})});lP.displayName="ModalTransition";var cB=Object.defineProperty,uB=(e,t,n)=>t in e?cB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dB=(e,t,n)=>(uB(e,typeof t!="symbol"?t+"":t,n),n),fB=class{constructor(){dB(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}},D1=new fB;function cP(e,t){const[n,r]=d.useState(0);return d.useEffect(()=>{const o=e.current;if(o){if(t){const s=D1.add(o);r(s)}return()=>{D1.remove(o),r(0)}}},[t,e]),n}var pB=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Il=new WeakMap,Zf=new WeakMap,Jf={},cv=0,uP=function(e){return e&&(e.host||uP(e.parentNode))},hB=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=uP(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})},mB=function(e,t,n,r){var o=hB(t,Array.isArray(e)?e:[e]);Jf[n]||(Jf[n]=new WeakMap);var s=Jf[n],i=[],l=new Set,u=new Set(o),p=function(m){!m||l.has(m)||(l.add(m),p(m.parentNode))};o.forEach(p);var h=function(m){!m||u.has(m)||Array.prototype.forEach.call(m.children,function(v){if(l.has(v))h(v);else{var b=v.getAttribute(r),y=b!==null&&b!=="false",x=(Il.get(v)||0)+1,w=(s.get(v)||0)+1;Il.set(v,x),s.set(v,w),i.push(v),x===1&&y&&Zf.set(v,!0),w===1&&v.setAttribute(n,"true"),y||v.setAttribute(r,"true")}})};return h(t),l.clear(),cv++,function(){i.forEach(function(m){var v=Il.get(m)-1,b=s.get(m)-1;Il.set(m,v),s.set(m,b),v||(Zf.has(m)||m.removeAttribute(r),Zf.delete(m)),b||m.removeAttribute(n)}),cv--,cv||(Il=new WeakMap,Il=new WeakMap,Zf=new WeakMap,Jf={})}},gB=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||pB(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),mB(r,o,n,"aria-hidden")):function(){return null}};function vB(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),h=d.useRef(null),[m,v,b]=xB(r,"chakra-modal","chakra-modal--header","chakra-modal--body");bB(p,t&&i);const y=cP(p,t),x=d.useRef(null),w=d.useCallback(A=>{x.current=A.target},[]),k=d.useCallback(A=>{A.key==="Escape"&&(A.stopPropagation(),s&&(n==null||n()),u==null||u())},[s,n,u]),[_,j]=d.useState(!1),[I,E]=d.useState(!1),M=d.useCallback((A={},O=null)=>({role:"dialog",...A,ref:Ct(O,p),id:m,tabIndex:-1,"aria-modal":!0,"aria-labelledby":_?v:void 0,"aria-describedby":I?b:void 0,onClick:Fe(A.onClick,T=>T.stopPropagation())}),[b,I,m,v,_]),D=d.useCallback(A=>{A.stopPropagation(),x.current===A.target&&D1.isTopModal(p.current)&&(o&&(n==null||n()),l==null||l())},[n,o,l]),R=d.useCallback((A={},O=null)=>({...A,ref:Ct(O,h),onClick:Fe(A.onClick,D),onKeyDown:Fe(A.onKeyDown,k),onMouseDown:Fe(A.onMouseDown,w)}),[k,w,D]);return{isOpen:t,onClose:n,headerId:v,bodyId:b,setBodyMounted:E,setHeaderMounted:j,dialogRef:p,overlayRef:h,getDialogProps:M,getDialogContainerProps:R,index:y}}function bB(e,t){const n=e.current;d.useEffect(()=>{if(!(!e.current||!t))return gB(e.current)},[t,e,n])}function xB(e,...t){const n=d.useId(),r=e||n;return d.useMemo(()=>t.map(o=>`${o}-${r}`),[r,t])}var[yB,Lc]=$t({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Modal />" `}),[CB,Bi]=$t({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in `<Modal />`"}),Hi=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:h,preserveScrollBarGap:m,motionPreset:v,lockFocusAcrossFrames:b,onCloseComplete:y}=t,x=Wn("Modal",t),k={...vB(t),autoFocus:o,trapFocus:s,initialFocusRef:i,finalFocusRef:l,returnFocusOnClose:u,blockScrollOnMount:p,allowPinchZoom:h,preserveScrollBarGap:m,motionPreset:v,lockFocusAcrossFrames:b};return a.jsx(CB,{value:k,children:a.jsx(yB,{value:x,children:a.jsx(nr,{onExitComplete:y,children:k.isOpen&&a.jsx(_d,{...n,children:r})})})})};Hi.displayName="Modal";var Ap="right-scroll-bar-position",Np="width-before-scroll-bar",wB="with-scroll-bars-hidden",SB="--removed-body-scroll-bar-size",dP=a3(),uv=function(){},Rm=d.forwardRef(function(e,t){var n=d.useRef(null),r=d.useState({onScrollCapture:uv,onWheelCapture:uv,onTouchMoveCapture:uv}),o=r[0],s=r[1],i=e.forwardProps,l=e.children,u=e.className,p=e.removeScrollBar,h=e.enabled,m=e.shards,v=e.sideCar,b=e.noIsolation,y=e.inert,x=e.allowPinchZoom,w=e.as,k=w===void 0?"div":w,_=e.gapMode,j=r3(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),I=v,E=n3([n,t]),M=us(us({},j),o);return d.createElement(d.Fragment,null,h&&d.createElement(I,{sideCar:dP,removeScrollBar:p,shards:m,noIsolation:b,inert:y,setCallbacks:s,allowPinchZoom:!!x,lockRef:n,gapMode:_}),i?d.cloneElement(d.Children.only(l),us(us({},M),{ref:E})):d.createElement(k,us({},M,{className:u,ref:E}),l))});Rm.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Rm.classNames={fullWidth:Np,zeroRight:Ap};var uS,kB=function(){if(uS)return uS;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function _B(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=kB();return t&&e.setAttribute("nonce",t),e}function jB(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function PB(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var IB=function(){var e=0,t=null;return{add:function(n){e==0&&(t=_B())&&(jB(t,n),PB(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},EB=function(){var e=IB();return function(t,n){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},fP=function(){var e=EB(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},MB={left:0,top:0,right:0,gap:0},dv=function(e){return parseInt(e||"",10)||0},OB=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[dv(n),dv(r),dv(o)]},DB=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return MB;var t=OB(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])}},RB=fP(),AB=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(wB,` {
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(Ap,` {
right: `).concat(l,"px ").concat(r,`;
}
.`).concat(Np,` {
margin-right: `).concat(l,"px ").concat(r,`;
}
.`).concat(Ap," .").concat(Ap,` {
right: 0 `).concat(r,`;
}
.`).concat(Np," .").concat(Np,` {
margin-right: 0 `).concat(r,`;
}
body {
`).concat(SB,": ").concat(l,`px;
}
`)},NB=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,s=d.useMemo(function(){return DB(o)},[o]);return d.createElement(RB,{styles:AB(s,!t,o,n?"":"!important")})},R1=!1;if(typeof window<"u")try{var ep=Object.defineProperty({},"passive",{get:function(){return R1=!0,!0}});window.addEventListener("test",ep,ep),window.removeEventListener("test",ep,ep)}catch{R1=!1}var El=R1?{passive:!1}:!1,TB=function(e){return e.tagName==="TEXTAREA"},pP=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!TB(e)&&n[t]==="visible")},$B=function(e){return pP(e,"overflowY")},LB=function(e){return pP(e,"overflowX")},dS=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=hP(e,r);if(o){var s=mP(e,r),i=s[1],l=s[2];if(i>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},zB=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},FB=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},hP=function(e,t){return e==="v"?$B(t):LB(t)},mP=function(e,t){return e==="v"?zB(t):FB(t)},BB=function(e,t){return e==="h"&&t==="rtl"?-1:1},HB=function(e,t,n,r,o){var s=BB(e,window.getComputedStyle(t).direction),i=s*r,l=n.target,u=t.contains(l),p=!1,h=i>0,m=0,v=0;do{var b=mP(e,l),y=b[0],x=b[1],w=b[2],k=x-w-s*y;(y||k)&&hP(e,l)&&(m+=k,v+=y),l=l.parentNode}while(!u&&l!==document.body||u&&(t.contains(l)||t===l));return(h&&(o&&m===0||!o&&i>m)||!h&&(o&&v===0||!o&&-i>v))&&(p=!0),p},tp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},fS=function(e){return[e.deltaX,e.deltaY]},pS=function(e){return e&&"current"in e?e.current:e},WB=function(e,t){return e[0]===t[0]&&e[1]===t[1]},VB=function(e){return`
.block-interactivity-`.concat(e,` {pointer-events: none;}
.allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},UB=0,Ml=[];function GB(e){var t=d.useRef([]),n=d.useRef([0,0]),r=d.useRef(),o=d.useState(UB++)[0],s=d.useState(fP)[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 x=k1([e.lockRef.current],(e.shards||[]).map(pS),!0).filter(Boolean);return x.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),x.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=d.useCallback(function(x,w){if("touches"in x&&x.touches.length===2)return!i.current.allowPinchZoom;var k=tp(x),_=n.current,j="deltaX"in x?x.deltaX:_[0]-k[0],I="deltaY"in x?x.deltaY:_[1]-k[1],E,M=x.target,D=Math.abs(j)>Math.abs(I)?"h":"v";if("touches"in x&&D==="h"&&M.type==="range")return!1;var R=dS(D,M);if(!R)return!0;if(R?E=D:(E=D==="v"?"h":"v",R=dS(D,M)),!R)return!1;if(!r.current&&"changedTouches"in x&&(j||I)&&(r.current=E),!E)return!0;var A=r.current||E;return HB(A,w,x,A==="h"?j:I,!0)},[]),u=d.useCallback(function(x){var w=x;if(!(!Ml.length||Ml[Ml.length-1]!==s)){var k="deltaY"in w?fS(w):tp(w),_=t.current.filter(function(E){return E.name===w.type&&E.target===w.target&&WB(E.delta,k)})[0];if(_&&_.should){w.cancelable&&w.preventDefault();return}if(!_){var j=(i.current.shards||[]).map(pS).filter(Boolean).filter(function(E){return E.contains(w.target)}),I=j.length>0?l(w,j[0]):!i.current.noIsolation;I&&w.cancelable&&w.preventDefault()}}},[]),p=d.useCallback(function(x,w,k,_){var j={name:x,delta:w,target:k,should:_};t.current.push(j),setTimeout(function(){t.current=t.current.filter(function(I){return I!==j})},1)},[]),h=d.useCallback(function(x){n.current=tp(x),r.current=void 0},[]),m=d.useCallback(function(x){p(x.type,fS(x),x.target,l(x,e.lockRef.current))},[]),v=d.useCallback(function(x){p(x.type,tp(x),x.target,l(x,e.lockRef.current))},[]);d.useEffect(function(){return Ml.push(s),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:v}),document.addEventListener("wheel",u,El),document.addEventListener("touchmove",u,El),document.addEventListener("touchstart",h,El),function(){Ml=Ml.filter(function(x){return x!==s}),document.removeEventListener("wheel",u,El),document.removeEventListener("touchmove",u,El),document.removeEventListener("touchstart",h,El)}},[]);var b=e.removeScrollBar,y=e.inert;return d.createElement(d.Fragment,null,y?d.createElement(s,{styles:VB(o)}):null,b?d.createElement(NB,{gapMode:e.gapMode}):null)}const KB=U$(dP,GB);var gP=d.forwardRef(function(e,t){return d.createElement(Rm,us({},e,{ref:t,sideCar:KB}))});gP.classNames=Rm.classNames;const qB=gP;function XB(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:o,blockScrollOnMount:s,allowPinchZoom:i,finalFocusRef:l,returnFocusOnClose:u,preserveScrollBarGap:p,lockFocusAcrossFrames:h,isOpen:m}=Bi(),[v,b]=L7();d.useEffect(()=>{!v&&b&&setTimeout(b)},[v,b]);const y=cP(r,m);return a.jsx($3,{autoFocus:t,isDisabled:!n,initialFocusRef:o,finalFocusRef:l,restoreFocus:u,contentRef:r,lockFocusAcrossFrames:h,children:a.jsx(qB,{removeScrollBar:!p,allowPinchZoom:i,enabled:y===1&&s,forwardProps:!0,children:e.children})})}var Wi=Pe((e,t)=>{const{className:n,children:r,containerProps:o,motionProps:s,...i}=e,{getDialogProps:l,getDialogContainerProps:u}=Bi(),p=l(i,t),h=u(o),m=et("chakra-modal__content",n),v=Lc(),b={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...v.dialog},y={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...v.dialogContainer},{motionPreset:x}=Bi();return a.jsx(XB,{children:a.jsx(_e.div,{...h,className:"chakra-modal__content-container",tabIndex:-1,__css:y,children:a.jsx(lP,{preset:x,motionProps:s,className:m,...p,__css:b,children:r})})})});Wi.displayName="ModalContent";function $d(e){const{leastDestructiveRef:t,...n}=e;return a.jsx(Hi,{...n,initialFocusRef:t})}var Ld=Pe((e,t)=>a.jsx(Wi,{ref:t,role:"alertdialog",...e})),gs=Pe((e,t)=>{const{className:n,...r}=e,o=et("chakra-modal__footer",n),i={display:"flex",alignItems:"center",justifyContent:"flex-end",...Lc().footer};return a.jsx(_e.footer,{ref:t,...r,__css:i,className:o})});gs.displayName="ModalFooter";var Ho=Pe((e,t)=>{const{className:n,...r}=e,{headerId:o,setHeaderMounted:s}=Bi();d.useEffect(()=>(s(!0),()=>s(!1)),[s]);const i=et("chakra-modal__header",n),u={flex:0,...Lc().header};return a.jsx(_e.header,{ref:t,className:i,id:o,...r,__css:u})});Ho.displayName="ModalHeader";var YB=_e(vn.div),Wo=Pe((e,t)=>{const{className:n,transition:r,motionProps:o,...s}=e,i=et("chakra-modal__overlay",n),u={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...Lc().overlay},{motionPreset:p}=Bi(),m=o||(p==="none"?{}:T5);return a.jsx(YB,{...m,__css:u,ref:t,className:i,...s})});Wo.displayName="ModalOverlay";var Vo=Pe((e,t)=>{const{className:n,...r}=e,{bodyId:o,setBodyMounted:s}=Bi();d.useEffect(()=>(s(!0),()=>s(!1)),[s]);const i=et("chakra-modal__body",n),l=Lc();return a.jsx(_e.div,{ref:t,className:i,id:o,...r,__css:l.body})});Vo.displayName="ModalBody";var zd=Pe((e,t)=>{const{onClick:n,className:r,...o}=e,{onClose:s}=Bi(),i=et("chakra-modal__close-btn",r),l=Lc();return a.jsx(_N,{ref:t,__css:l.closeButton,className:i,onClick:Fe(n,u=>{u.stopPropagation(),s()}),...o})});zd.displayName="ModalCloseButton";var QB=e=>a.jsx(Tn,{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"})}),ZB=e=>a.jsx(Tn,{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 hS(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 JB(e,t){const n=nn(e);d.useEffect(()=>{let r=null;const o=()=>n();return t!==null&&(r=window.setInterval(o,t)),()=>{r&&window.clearInterval(r)}},[t,n])}var eH=50,mS=300;function tH(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);JB(()=>{o==="increment"&&e(),o==="decrement"&&t()},n?eH:null);const h=d.useCallback(()=>{i&&e(),u.current=setTimeout(()=>{l(!1),r(!0),s("increment")},mS)},[e,i]),m=d.useCallback(()=>{i&&t(),u.current=setTimeout(()=>{l(!1),r(!0),s("decrement")},mS)},[t,i]),v=d.useCallback(()=>{l(!0),r(!1),p()},[]);return d.useEffect(()=>()=>p(),[]),{up:h,down:m,stop:v,isSpinning:n}}var nH=/^[Ee0-9+\-.]$/;function rH(e){return nH.test(e)}function oH(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 sH(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:h,pattern:m="[0-9]*(.[0-9]+)?",inputMode:v="decimal",allowMouseWheel:b,id:y,onChange:x,precision:w,name:k,"aria-describedby":_,"aria-label":j,"aria-labelledby":I,onFocus:E,onBlur:M,onInvalid:D,getAriaValueText:R,isValidCharacter:A,format:O,parse:T,...K}=e,F=nn(E),V=nn(M),X=nn(D),W=nn(A??rH),z=nn(R),Y=_$(e),{update:B,increment:q,decrement:re}=Y,[Q,le]=d.useState(!1),se=!(l||u),U=d.useRef(null),G=d.useRef(null),te=d.useRef(null),ae=d.useRef(null),oe=d.useCallback(ve=>ve.split("").filter(W).join(""),[W]),pe=d.useCallback(ve=>{var Qe;return(Qe=T==null?void 0:T(ve))!=null?Qe:ve},[T]),ue=d.useCallback(ve=>{var Qe;return((Qe=O==null?void 0:O(ve))!=null?Qe:ve).toString()},[O]);ca(()=>{(Y.valueAsNumber>s||Y.valueAsNumber<o)&&(X==null||X("rangeOverflow",ue(Y.value),Y.valueAsNumber))},[Y.valueAsNumber,Y.value,ue,X]),Zl(()=>{if(!U.current)return;if(U.current.value!=Y.value){const Qe=pe(U.current.value);Y.setValue(oe(Qe))}},[pe,oe]);const me=d.useCallback((ve=i)=>{se&&q(ve)},[q,se,i]),Ce=d.useCallback((ve=i)=>{se&&re(ve)},[re,se,i]),ge=tH(me,Ce);hS(te,"disabled",ge.stop,ge.isSpinning),hS(ae,"disabled",ge.stop,ge.isSpinning);const fe=d.useCallback(ve=>{if(ve.nativeEvent.isComposing)return;const ot=pe(ve.currentTarget.value);B(oe(ot)),G.current={start:ve.currentTarget.selectionStart,end:ve.currentTarget.selectionEnd}},[B,oe,pe]),De=d.useCallback(ve=>{var Qe,ot,lt;F==null||F(ve),G.current&&(ve.target.selectionStart=(ot=G.current.start)!=null?ot:(Qe=ve.currentTarget.value)==null?void 0:Qe.length,ve.currentTarget.selectionEnd=(lt=G.current.end)!=null?lt:ve.currentTarget.selectionStart)},[F]),je=d.useCallback(ve=>{if(ve.nativeEvent.isComposing)return;oH(ve,W)||ve.preventDefault();const Qe=Be(ve)*i,ot=ve.key,Me={ArrowUp:()=>me(Qe),ArrowDown:()=>Ce(Qe),Home:()=>B(o),End:()=>B(s)}[ot];Me&&(ve.preventDefault(),Me(ve))},[W,i,me,Ce,B,o,s]),Be=ve=>{let Qe=1;return(ve.metaKey||ve.ctrlKey)&&(Qe=.1),ve.shiftKey&&(Qe=10),Qe},rt=d.useMemo(()=>{const ve=z==null?void 0:z(Y.value);if(ve!=null)return ve;const Qe=Y.value.toString();return Qe||void 0},[Y.value,z]),Ue=d.useCallback(()=>{let ve=Y.value;if(Y.value==="")return;/^[eE]/.test(Y.value.toString())?Y.setValue(""):(Y.valueAsNumber<o&&(ve=o),Y.valueAsNumber>s&&(ve=s),Y.cast(ve))},[Y,s,o]),wt=d.useCallback(()=>{le(!1),n&&Ue()},[n,le,Ue]),Ye=d.useCallback(()=>{t&&requestAnimationFrame(()=>{var ve;(ve=U.current)==null||ve.focus()})},[t]),tt=d.useCallback(ve=>{ve.preventDefault(),ge.up(),Ye()},[Ye,ge]),be=d.useCallback(ve=>{ve.preventDefault(),ge.down(),Ye()},[Ye,ge]);_i(()=>U.current,"wheel",ve=>{var Qe,ot;const Me=((ot=(Qe=U.current)==null?void 0:Qe.ownerDocument)!=null?ot:document).activeElement===U.current;if(!b||!Me)return;ve.preventDefault();const $e=Be(ve)*i,At=Math.sign(ve.deltaY);At===-1?me($e):At===1&&Ce($e)},{passive:!1});const Re=d.useCallback((ve={},Qe=null)=>{const ot=u||r&&Y.isAtMax;return{...ve,ref:Ct(Qe,te),role:"button",tabIndex:-1,onPointerDown:Fe(ve.onPointerDown,lt=>{lt.button!==0||ot||tt(lt)}),onPointerLeave:Fe(ve.onPointerLeave,ge.stop),onPointerUp:Fe(ve.onPointerUp,ge.stop),disabled:ot,"aria-disabled":po(ot)}},[Y.isAtMax,r,tt,ge.stop,u]),st=d.useCallback((ve={},Qe=null)=>{const ot=u||r&&Y.isAtMin;return{...ve,ref:Ct(Qe,ae),role:"button",tabIndex:-1,onPointerDown:Fe(ve.onPointerDown,lt=>{lt.button!==0||ot||be(lt)}),onPointerLeave:Fe(ve.onPointerLeave,ge.stop),onPointerUp:Fe(ve.onPointerUp,ge.stop),disabled:ot,"aria-disabled":po(ot)}},[Y.isAtMin,r,be,ge.stop,u]),mt=d.useCallback((ve={},Qe=null)=>{var ot,lt,Me,$e;return{name:k,inputMode:v,type:"text",pattern:m,"aria-labelledby":I,"aria-label":j,"aria-describedby":_,id:y,disabled:u,...ve,readOnly:(ot=ve.readOnly)!=null?ot:l,"aria-readonly":(lt=ve.readOnly)!=null?lt:l,"aria-required":(Me=ve.required)!=null?Me:p,required:($e=ve.required)!=null?$e:p,ref:Ct(U,Qe),value:ue(Y.value),role:"spinbutton","aria-valuemin":o,"aria-valuemax":s,"aria-valuenow":Number.isNaN(Y.valueAsNumber)?void 0:Y.valueAsNumber,"aria-invalid":po(h??Y.isOutOfRange),"aria-valuetext":rt,autoComplete:"off",autoCorrect:"off",onChange:Fe(ve.onChange,fe),onKeyDown:Fe(ve.onKeyDown,je),onFocus:Fe(ve.onFocus,De,()=>le(!0)),onBlur:Fe(ve.onBlur,V,wt)}},[k,v,m,I,j,ue,_,y,u,p,l,h,Y.value,Y.valueAsNumber,Y.isOutOfRange,o,s,rt,fe,je,De,V,wt]);return{value:ue(Y.value),valueAsNumber:Y.valueAsNumber,isFocused:Q,isDisabled:u,isReadOnly:l,getIncrementButtonProps:Re,getDecrementButtonProps:st,getInputProps:mt,htmlProps:K}}var[aH,Am]=$t({name:"NumberInputStylesContext",errorMessage:`useNumberInputStyles returned is 'undefined'. Seems you forgot to wrap the components in "<NumberInput />" `}),[iH,Ox]=$t({name:"NumberInputContext",errorMessage:"useNumberInputContext: `context` is undefined. Seems you forgot to wrap number-input's components within <NumberInput />"}),Nm=Pe(function(t,n){const r=Wn("NumberInput",t),o=Yt(t),s=nx(o),{htmlProps:i,...l}=sH(s),u=d.useMemo(()=>l,[l]);return a.jsx(iH,{value:u,children:a.jsx(aH,{value:r,children:a.jsx(_e.div,{...i,ref:n,className:et("chakra-numberinput",t.className),__css:{position:"relative",zIndex:0,...r.root}})})})});Nm.displayName="NumberInput";var Tm=Pe(function(t,n){const r=Am();return a.jsx(_e.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}})});Tm.displayName="NumberInputStepper";var $m=Pe(function(t,n){const{getInputProps:r}=Ox(),o=r(t,n),s=Am();return a.jsx(_e.input,{...o,className:et("chakra-numberinput__field",t.className),__css:{width:"100%",...s.field}})});$m.displayName="NumberInputField";var vP=_e("div",{baseStyle:{display:"flex",justifyContent:"center",alignItems:"center",flex:1,transitionProperty:"common",transitionDuration:"normal",userSelect:"none",cursor:"pointer",lineHeight:"normal"}}),Lm=Pe(function(t,n){var r;const o=Am(),{getDecrementButtonProps:s}=Ox(),i=s(t,n);return a.jsx(vP,{...i,__css:o.stepper,children:(r=t.children)!=null?r:a.jsx(QB,{})})});Lm.displayName="NumberDecrementStepper";var zm=Pe(function(t,n){var r;const{getIncrementButtonProps:o}=Ox(),s=o(t,n),i=Am();return a.jsx(vP,{...s,__css:i.stepper,children:(r=t.children)!=null?r:a.jsx(ZB,{})})});zm.displayName="NumberIncrementStepper";var[lH,zc]=$t({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within `<Popover />`"}),[cH,Dx]=$t({name:"PopoverStylesContext",errorMessage:`usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Popover />" `});function Rx(e){const t=d.Children.only(e.children),{getTriggerProps:n}=zc();return d.cloneElement(t,n(t.props,t.ref))}Rx.displayName="PopoverTrigger";var Ol={click:"click",hover:"hover"};function uH(e={}){const{closeOnBlur:t=!0,closeOnEsc:n=!0,initialFocusRef:r,id:o,returnFocusOnClose:s=!0,autoFocus:i=!0,arrowSize:l,arrowShadowColor:u,trigger:p=Ol.click,openDelay:h=200,closeDelay:m=200,isLazy:v,lazyBehavior:b="unmount",computePositionOnMount:y,...x}=e,{isOpen:w,onClose:k,onOpen:_,onToggle:j}=Ix(e),I=d.useRef(null),E=d.useRef(null),M=d.useRef(null),D=d.useRef(!1),R=d.useRef(!1);w&&(R.current=!0);const[A,O]=d.useState(!1),[T,K]=d.useState(!1),F=d.useId(),V=o??F,[X,W,z,Y]=["popover-trigger","popover-content","popover-header","popover-body"].map(fe=>`${fe}-${V}`),{referenceRef:B,getArrowProps:q,getPopperProps:re,getArrowInnerProps:Q,forceUpdate:le}=Px({...x,enabled:w||!!y}),se=nP({isOpen:w,ref:M});Y5({enabled:w,ref:E}),U3(M,{focusRef:E,visible:w,shouldFocus:s&&p===Ol.click}),vz(M,{focusRef:r,visible:w,shouldFocus:i&&p===Ol.click});const U=Ex({wasSelected:R.current,enabled:v,mode:b,isSelected:se.present}),G=d.useCallback((fe={},De=null)=>{const je={...fe,style:{...fe.style,transformOrigin:jn.transformOrigin.varRef,[jn.arrowSize.var]:l?`${l}px`:void 0,[jn.arrowShadowColor.var]:u},ref:Ct(M,De),children:U?fe.children:null,id:W,tabIndex:-1,role:"dialog",onKeyDown:Fe(fe.onKeyDown,Be=>{n&&Be.key==="Escape"&&k()}),onBlur:Fe(fe.onBlur,Be=>{const rt=gS(Be),Ue=fv(M.current,rt),wt=fv(E.current,rt);w&&t&&(!Ue&&!wt)&&k()}),"aria-labelledby":A?z:void 0,"aria-describedby":T?Y:void 0};return p===Ol.hover&&(je.role="tooltip",je.onMouseEnter=Fe(fe.onMouseEnter,()=>{D.current=!0}),je.onMouseLeave=Fe(fe.onMouseLeave,Be=>{Be.nativeEvent.relatedTarget!==null&&(D.current=!1,setTimeout(()=>k(),m))})),je},[U,W,A,z,T,Y,p,n,k,w,t,m,u,l]),te=d.useCallback((fe={},De=null)=>re({...fe,style:{visibility:w?"visible":"hidden",...fe.style}},De),[w,re]),ae=d.useCallback((fe,De=null)=>({...fe,ref:Ct(De,I,B)}),[I,B]),oe=d.useRef(),pe=d.useRef(),ue=d.useCallback(fe=>{I.current==null&&B(fe)},[B]),me=d.useCallback((fe={},De=null)=>{const je={...fe,ref:Ct(E,De,ue),id:X,"aria-haspopup":"dialog","aria-expanded":w,"aria-controls":W};return p===Ol.click&&(je.onClick=Fe(fe.onClick,j)),p===Ol.hover&&(je.onFocus=Fe(fe.onFocus,()=>{oe.current===void 0&&_()}),je.onBlur=Fe(fe.onBlur,Be=>{const rt=gS(Be),Ue=!fv(M.current,rt);w&&t&&Ue&&k()}),je.onKeyDown=Fe(fe.onKeyDown,Be=>{Be.key==="Escape"&&k()}),je.onMouseEnter=Fe(fe.onMouseEnter,()=>{D.current=!0,oe.current=window.setTimeout(()=>_(),h)}),je.onMouseLeave=Fe(fe.onMouseLeave,()=>{D.current=!1,oe.current&&(clearTimeout(oe.current),oe.current=void 0),pe.current=window.setTimeout(()=>{D.current===!1&&k()},m)})),je},[X,w,W,p,ue,j,_,t,k,h,m]);d.useEffect(()=>()=>{oe.current&&clearTimeout(oe.current),pe.current&&clearTimeout(pe.current)},[]);const Ce=d.useCallback((fe={},De=null)=>({...fe,id:z,ref:Ct(De,je=>{O(!!je)})}),[z]),ge=d.useCallback((fe={},De=null)=>({...fe,id:Y,ref:Ct(De,je=>{K(!!je)})}),[Y]);return{forceUpdate:le,isOpen:w,onAnimationComplete:se.onComplete,onClose:k,getAnchorProps:ae,getArrowProps:q,getArrowInnerProps:Q,getPopoverPositionerProps:te,getPopoverProps:G,getTriggerProps:me,getHeaderProps:Ce,getBodyProps:ge}}function fv(e,t){return e===t||(e==null?void 0:e.contains(t))}function gS(e){var t;const n=e.currentTarget.ownerDocument.activeElement;return(t=e.relatedTarget)!=null?t:n}function Fm(e){const t=Wn("Popover",e),{children:n,...r}=Yt(e),o=yd(),s=uH({...r,direction:o.direction});return a.jsx(lH,{value:s,children:a.jsx(cH,{value:t,children:Nb(n,{isOpen:s.isOpen,onClose:s.onClose,forceUpdate:s.forceUpdate})})})}Fm.displayName="Popover";function bP(e){const t=d.Children.only(e.children),{getAnchorProps:n}=zc();return d.cloneElement(t,n(t.props,t.ref))}bP.displayName="PopoverAnchor";var pv=(e,t)=>t?`${e}.${t}, ${t}`:void 0;function xP(e){var t;const{bg:n,bgColor:r,backgroundColor:o,shadow:s,boxShadow:i,shadowColor:l}=e,{getArrowProps:u,getArrowInnerProps:p}=zc(),h=Dx(),m=(t=n??r)!=null?t:o,v=s??i;return a.jsx(_e.div,{...u(),className:"chakra-popover__arrow-positioner",children:a.jsx(_e.div,{className:et("chakra-popover__arrow",e.className),...p(e),__css:{"--popper-arrow-shadow-color":pv("colors",l),"--popper-arrow-bg":pv("colors",m),"--popper-arrow-shadow":pv("shadows",v),...h.arrow}})})}xP.displayName="PopoverArrow";var Ax=Pe(function(t,n){const{getBodyProps:r}=zc(),o=Dx();return a.jsx(_e.div,{...r(t,n),className:et("chakra-popover__body",t.className),__css:o.body})});Ax.displayName="PopoverBody";function dH(e){if(e)return{enter:{...e.enter,visibility:"visible"},exit:{...e.exit,transitionEnd:{visibility:"hidden"}}}}var fH={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]}}},pH=_e(vn.section),yP=Pe(function(t,n){const{variants:r=fH,...o}=t,{isOpen:s}=zc();return a.jsx(pH,{ref:n,variants:dH(r),initial:!1,animate:s?"enter":"exit",...o})});yP.displayName="PopoverTransition";var Bm=Pe(function(t,n){const{rootProps:r,motionProps:o,...s}=t,{getPopoverProps:i,getPopoverPositionerProps:l,onAnimationComplete:u}=zc(),p=Dx(),h={position:"relative",display:"flex",flexDirection:"column",...p.content};return a.jsx(_e.div,{...l(r),__css:p.popper,className:"chakra-popover__popper",children:a.jsx(yP,{...o,...i(s,n),onAnimationComplete:fm(u,s.onAnimationComplete),className:et("chakra-popover__content",t.className),__css:h})})});Bm.displayName="PopoverContent";var A1=e=>a.jsx(_e.circle,{cx:50,cy:50,r:42,fill:"transparent",...e});A1.displayName="Circle";function hH(e,t,n){return(e-t)*100/(n-t)}var mH=ia({"0%":{strokeDasharray:"1, 400",strokeDashoffset:"0"},"50%":{strokeDasharray:"400, 400",strokeDashoffset:"-100"},"100%":{strokeDasharray:"400, 400",strokeDashoffset:"-260"}}),gH=ia({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),vH=ia({"0%":{left:"-40%"},"100%":{left:"100%"}}),bH=ia({from:{backgroundPosition:"1rem 0"},to:{backgroundPosition:"0 0"}});function CP(e){const{value:t=0,min:n,max:r,valueText:o,getValueText:s,isIndeterminate:i,role:l="progressbar"}=e,u=hH(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 wP=e=>{const{size:t,isIndeterminate:n,...r}=e;return a.jsx(_e.svg,{viewBox:"0 0 100 100",__css:{width:t,height:t,animation:n?`${gH} 2s linear infinite`:void 0},...r})};wP.displayName="Shape";var N1=Pe((e,t)=>{var n;const{size:r="48px",max:o=100,min:s=0,valueText:i,getValueText:l,value:u,capIsRound:p,children:h,thickness:m="10px",color:v="#0078d4",trackColor:b="#edebe9",isIndeterminate:y,...x}=e,w=CP({min:s,max:o,value:u,valueText:i,getValueText:l,isIndeterminate:y}),k=y?void 0:((n=w.percent)!=null?n:0)*2.64,_=k==null?void 0:`${k} ${264-k}`,j=y?{css:{animation:`${mH} 1.5s linear infinite`}}:{strokeDashoffset:66,strokeDasharray:_,transitionProperty:"stroke-dasharray, stroke",transitionDuration:"0.6s",transitionTimingFunction:"ease"},I={display:"inline-block",position:"relative",verticalAlign:"middle",fontSize:r};return a.jsxs(_e.div,{ref:t,className:"chakra-progress",...w.bind,...x,__css:I,children:[a.jsxs(wP,{size:r,isIndeterminate:y,children:[a.jsx(A1,{stroke:b,strokeWidth:m,className:"chakra-progress__track"}),a.jsx(A1,{stroke:v,strokeWidth:m,className:"chakra-progress__indicator",strokeLinecap:p?"round":void 0,opacity:w.value===0&&!y?0:void 0,...j})]}),h]})});N1.displayName="CircularProgress";var[xH,yH]=$t({name:"ProgressStylesContext",errorMessage:`useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Progress />" `}),CH=Pe((e,t)=>{const{min:n,max:r,value:o,isIndeterminate:s,role:i,...l}=e,u=CP({value:o,min:n,max:r,isIndeterminate:s,role:i}),h={height:"100%",...yH().filledTrack};return a.jsx(_e.div,{ref:t,style:{width:`${u.percent}%`,...l.style},...u.bind,...l,__css:h})}),SP=Pe((e,t)=>{var n;const{value:r,min:o=0,max:s=100,hasStripe:i,isAnimated:l,children:u,borderRadius:p,isIndeterminate:h,"aria-label":m,"aria-labelledby":v,"aria-valuetext":b,title:y,role:x,...w}=Yt(e),k=Wn("Progress",e),_=p??((n=k.track)==null?void 0:n.borderRadius),j={animation:`${bH} 1s linear infinite`},M={...!h&&i&&l&&j,...h&&{position:"absolute",willChange:"left",minWidth:"50%",animation:`${vH} 1s ease infinite normal none running`}},D={overflow:"hidden",position:"relative",...k.track};return a.jsx(_e.div,{ref:t,borderRadius:_,__css:D,...w,children:a.jsxs(xH,{value:k,children:[a.jsx(CH,{"aria-label":m,"aria-labelledby":v,"aria-valuetext":b,min:o,max:s,value:r,isIndeterminate:h,css:M,borderRadius:_,title:y,role:x}),u]})})});SP.displayName="Progress";function wH(e){return e&&r1(e)&&r1(e.target)}function SH(e={}){const{onChange:t,value:n,defaultValue:r,name:o,isDisabled:s,isFocusable:i,isNative:l,...u}=e,[p,h]=d.useState(r||""),m=typeof n<"u",v=m?n:p,b=d.useRef(null),y=d.useCallback(()=>{const E=b.current;if(!E)return;let M="input:not(:disabled):checked";const D=E.querySelector(M);if(D){D.focus();return}M="input:not(:disabled)";const R=E.querySelector(M);R==null||R.focus()},[]),w=`radio-${d.useId()}`,k=o||w,_=d.useCallback(E=>{const M=wH(E)?E.target.value:E;m||h(M),t==null||t(String(M))},[t,m]),j=d.useCallback((E={},M=null)=>({...E,ref:Ct(M,b),role:"radiogroup"}),[]),I=d.useCallback((E={},M=null)=>({...E,ref:M,name:k,[l?"checked":"isChecked"]:v!=null?E.value===v:void 0,onChange(R){_(R)},"data-radiogroup":!0}),[l,k,_,v]);return{getRootProps:j,getRadioProps:I,name:k,ref:b,focus:y,setValue:h,value:v,onChange:_,isDisabled:s,isFocusable:i,htmlProps:u}}var[kH,kP]=$t({name:"RadioGroupContext",strict:!1}),ih=Pe((e,t)=>{const{colorScheme:n,size:r,variant:o,children:s,className:i,isDisabled:l,isFocusable:u,...p}=e,{value:h,onChange:m,getRootProps:v,name:b,htmlProps:y}=SH(p),x=d.useMemo(()=>({name:b,size:r,onChange:m,colorScheme:n,value:h,variant:o,isDisabled:l,isFocusable:u}),[b,r,m,n,h,o,l,u]);return a.jsx(kH,{value:x,children:a.jsx(_e.div,{...v(y,t),className:et("chakra-radio-group",i),children:s})})});ih.displayName="RadioGroup";var _H={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};function jH(e={}){const{defaultChecked:t,isChecked:n,isFocusable:r,isDisabled:o,isReadOnly:s,isRequired:i,onChange:l,isInvalid:u,name:p,value:h,id:m,"data-radiogroup":v,"aria-describedby":b,...y}=e,x=`radio-${d.useId()}`,w=Ed(),_=!!kP()||!!v;let I=!!w&&!_?w.id:x;I=m??I;const E=o??(w==null?void 0:w.isDisabled),M=s??(w==null?void 0:w.isReadOnly),D=i??(w==null?void 0:w.isRequired),R=u??(w==null?void 0:w.isInvalid),[A,O]=d.useState(!1),[T,K]=d.useState(!1),[F,V]=d.useState(!1),[X,W]=d.useState(!1),[z,Y]=d.useState(!!t),B=typeof n<"u",q=B?n:z;d.useEffect(()=>W5(O),[]);const re=d.useCallback(ue=>{if(M||E){ue.preventDefault();return}B||Y(ue.target.checked),l==null||l(ue)},[B,E,M,l]),Q=d.useCallback(ue=>{ue.key===" "&&W(!0)},[W]),le=d.useCallback(ue=>{ue.key===" "&&W(!1)},[W]),se=d.useCallback((ue={},me=null)=>({...ue,ref:me,"data-active":at(X),"data-hover":at(F),"data-disabled":at(E),"data-invalid":at(R),"data-checked":at(q),"data-focus":at(T),"data-focus-visible":at(T&&A),"data-readonly":at(M),"aria-hidden":!0,onMouseDown:Fe(ue.onMouseDown,()=>W(!0)),onMouseUp:Fe(ue.onMouseUp,()=>W(!1)),onMouseEnter:Fe(ue.onMouseEnter,()=>V(!0)),onMouseLeave:Fe(ue.onMouseLeave,()=>V(!1))}),[X,F,E,R,q,T,M,A]),{onFocus:U,onBlur:G}=w??{},te=d.useCallback((ue={},me=null)=>{const Ce=E&&!r;return{...ue,id:I,ref:me,type:"radio",name:p,value:h,onChange:Fe(ue.onChange,re),onBlur:Fe(G,ue.onBlur,()=>K(!1)),onFocus:Fe(U,ue.onFocus,()=>K(!0)),onKeyDown:Fe(ue.onKeyDown,Q),onKeyUp:Fe(ue.onKeyUp,le),checked:q,disabled:Ce,readOnly:M,required:D,"aria-invalid":po(R),"aria-disabled":po(Ce),"aria-required":po(D),"data-readonly":at(M),"aria-describedby":b,style:_H}},[E,r,I,p,h,re,G,U,Q,le,q,M,D,R,b]);return{state:{isInvalid:R,isFocused:T,isChecked:q,isActive:X,isHovered:F,isDisabled:E,isReadOnly:M,isRequired:D},getCheckboxProps:se,getRadioProps:se,getInputProps:te,getLabelProps:(ue={},me=null)=>({...ue,ref:me,onMouseDown:Fe(ue.onMouseDown,PH),"data-disabled":at(E),"data-checked":at(q),"data-invalid":at(R)}),getRootProps:(ue,me=null)=>({...ue,ref:me,"data-disabled":at(E),"data-checked":at(q),"data-invalid":at(R)}),htmlProps:y}}function PH(e){e.preventDefault(),e.stopPropagation()}function IH(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 zs=Pe((e,t)=>{var n;const r=kP(),{onChange:o,value:s}=e,i=Wn("Radio",{...r,...e}),l=Yt(e),{spacing:u="0.5rem",children:p,isDisabled:h=r==null?void 0:r.isDisabled,isFocusable:m=r==null?void 0:r.isFocusable,inputProps:v,...b}=l;let y=e.isChecked;(r==null?void 0:r.value)!=null&&s!=null&&(y=r.value===s);let x=o;r!=null&&r.onChange&&s!=null&&(x=fm(r.onChange,o));const w=(n=e==null?void 0:e.name)!=null?n:r==null?void 0:r.name,{getInputProps:k,getCheckboxProps:_,getLabelProps:j,getRootProps:I,htmlProps:E}=jH({...b,isChecked:y,isFocusable:m,isDisabled:h,onChange:x,name:w}),[M,D]=IH(E,Nj),R=_(D),A=k(v,t),O=j(),T=Object.assign({},M,I()),K={display:"inline-flex",alignItems:"center",verticalAlign:"top",cursor:"pointer",position:"relative",...i.container},F={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,...i.control},V={userSelect:"none",marginStart:u,...i.label};return a.jsxs(_e.label,{className:"chakra-radio",...T,__css:K,children:[a.jsx("input",{className:"chakra-radio__input",...A}),a.jsx(_e.span,{className:"chakra-radio__control",...R,__css:F}),p&&a.jsx(_e.span,{className:"chakra-radio__label",...O,__css:V,children:p})]})});zs.displayName="Radio";var _P=Pe(function(t,n){const{children:r,placeholder:o,className:s,...i}=t;return a.jsxs(_e.select,{...i,ref:n,className:et("chakra-select",s),children:[o&&a.jsx("option",{value:"",children:o}),r]})});_P.displayName="SelectField";function EH(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 jP=Pe((e,t)=>{var n;const r=Wn("Select",e),{rootProps:o,placeholder:s,icon:i,color:l,height:u,h:p,minH:h,minHeight:m,iconColor:v,iconSize:b,...y}=Yt(e),[x,w]=EH(y,Nj),k=tx(w),_={width:"100%",height:"fit-content",position:"relative",color:l},j={paddingEnd:"2rem",...r.field,_focus:{zIndex:"unset",...(n=r.field)==null?void 0:n._focus}};return a.jsxs(_e.div,{className:"chakra-select__wrapper",__css:_,...x,...o,children:[a.jsx(_P,{ref:t,height:p??u,minH:h??m,placeholder:s,...k,__css:j,children:e.children}),a.jsx(PP,{"data-disabled":at(k.disabled),...(v||l)&&{color:v||l},__css:r.icon,...b&&{fontSize:b},children:i})]})});jP.displayName="Select";var MH=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"})}),OH=_e("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),PP=e=>{const{children:t=a.jsx(MH,{}),...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(OH,{...n,className:"chakra-select__icon-wrapper",children:d.isValidElement(t)?r:null})};PP.displayName="SelectIcon";function DH(){const e=d.useRef(!0);return d.useEffect(()=>{e.current=!1},[]),e.current}function RH(e){const t=d.useRef();return d.useEffect(()=>{t.current=e},[e]),t.current}var AH=_e("div",{baseStyle:{boxShadow:"none",backgroundClip:"padding-box",cursor:"default",color:"transparent",pointerEvents:"none",userSelect:"none","&::before, &::after, *":{visibility:"hidden"}}}),T1=Tj("skeleton-start-color"),$1=Tj("skeleton-end-color"),NH=ia({from:{opacity:0},to:{opacity:1}}),TH=ia({from:{borderColor:T1.reference,background:T1.reference},to:{borderColor:$1.reference,background:$1.reference}}),Hm=Pe((e,t)=>{const n={...e,fadeDuration:typeof e.fadeDuration=="number"?e.fadeDuration:.4,speed:typeof e.speed=="number"?e.speed:.8},r=Qa("Skeleton",n),o=DH(),{startColor:s="",endColor:i="",isLoaded:l,fadeDuration:u,speed:p,className:h,fitContent:m,...v}=Yt(n),[b,y]=ds("colors",[s,i]),x=RH(l),w=et("chakra-skeleton",h),k={...b&&{[T1.variable]:b},...y&&{[$1.variable]:y}};if(l){const _=o||x?"none":`${NH} ${u}s`;return a.jsx(_e.div,{ref:t,className:w,__css:{animation:_},...v})}return a.jsx(AH,{ref:t,className:w,...v,__css:{width:m?"fit-content":void 0,...r,...k,_dark:{...r._dark,...k},animation:`${p}s linear infinite alternate ${TH}`}})});Hm.displayName="Skeleton";var ao=e=>e?"":void 0,sc=e=>e?!0:void 0,ei=(...e)=>e.filter(Boolean).join(" ");function ac(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function $H(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 Du(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}var Tp={width:0,height:0},np=e=>e||Tp;function IP(e){const{orientation:t,thumbPercents:n,thumbRects:r,isReversed:o}=e,s=x=>{var w;const k=(w=r[x])!=null?w:Tp;return{position:"absolute",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",touchAction:"none",...Du({orientation:t,vertical:{bottom:`calc(${n[x]}% - ${k.height/2}px)`},horizontal:{left:`calc(${n[x]}% - ${k.width/2}px)`}})}},i=t==="vertical"?r.reduce((x,w)=>np(x).height>np(w).height?x:w,Tp):r.reduce((x,w)=>np(x).width>np(w).width?x:w,Tp),l={position:"relative",touchAction:"none",WebkitTapHighlightColor:"rgba(0,0,0,0)",userSelect:"none",outline:0,...Du({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",...Du({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",height:"100%"},horizontal:{top:"50%",transform:"translateY(-50%)",width:"100%"}})},p=n.length===1,h=[0,o?100-n[0]:n[0]],m=p?h:n;let v=m[0];!p&&o&&(v=100-v);const b=Math.abs(m[m.length-1]-m[0]),y={...u,...Du({orientation:t,vertical:o?{height:`${b}%`,top:`${v}%`}:{height:`${b}%`,bottom:`${v}%`},horizontal:o?{width:`${b}%`,right:`${v}%`}:{width:`${b}%`,left:`${v}%`}})};return{trackStyle:u,innerTrackStyle:y,rootStyle:l,getThumbStyle:s}}function EP(e){const{isReversed:t,direction:n,orientation:r}=e;return n==="ltr"||r==="vertical"?t:!t}function LH(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function zH(e){const t=BH(e);return typeof t.PointerEvent<"u"&&e instanceof t.PointerEvent?e.pointerType==="mouse":e instanceof t.MouseEvent}function MP(e){return!!e.touches}function FH(e){return MP(e)&&e.touches.length>1}function BH(e){var t;return(t=e.view)!=null?t:window}function HH(e,t="page"){const n=e.touches[0]||e.changedTouches[0];return{x:n[`${t}X`],y:n[`${t}Y`]}}function WH(e,t="page"){return{x:e[`${t}X`],y:e[`${t}Y`]}}function OP(e,t="page"){return MP(e)?HH(e,t):WH(e,t)}function VH(e){return t=>{const n=zH(t);(!n||n&&t.button===0)&&e(t)}}function UH(e,t=!1){function n(o){e(o,{point:OP(o)})}return t?VH(n):n}function $p(e,t,n,r){return LH(e,t,UH(n,t==="pointerdown"),r)}var GH=Object.defineProperty,KH=(e,t,n)=>t in e?GH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Eo=(e,t,n)=>(KH(e,typeof t!="symbol"?t+"":t,n),n),qH=class{constructor(e,t,n){Eo(this,"history",[]),Eo(this,"startEvent",null),Eo(this,"lastEvent",null),Eo(this,"lastEventInfo",null),Eo(this,"handlers",{}),Eo(this,"removeListeners",()=>{}),Eo(this,"threshold",3),Eo(this,"win"),Eo(this,"updatePoint",()=>{if(!(this.lastEvent&&this.lastEventInfo))return;const l=hv(this.lastEventInfo,this.history),u=this.startEvent!==null,p=ZH(l.offset,{x:0,y:0})>=this.threshold;if(!u&&!p)return;const{timestamp:h}=Dw();this.history.push({...l.point,timestamp:h});const{onStart:m,onMove:v}=this.handlers;u||(m==null||m(this.lastEvent,l),this.startEvent=this.lastEvent),v==null||v(this.lastEvent,l)}),Eo(this,"onPointerMove",(l,u)=>{this.lastEvent=l,this.lastEventInfo=u,gT.update(this.updatePoint,!0)}),Eo(this,"onPointerUp",(l,u)=>{const p=hv(u,this.history),{onEnd:h,onSessionEnd:m}=this.handlers;m==null||m(l,p),this.end(),!(!h||!this.startEvent)&&(h==null||h(l,p))});var r;if(this.win=(r=e.view)!=null?r:window,FH(e))return;this.handlers=t,n&&(this.threshold=n),e.stopPropagation(),e.preventDefault();const o={point:OP(e)},{timestamp:s}=Dw();this.history=[{...o.point,timestamp:s}];const{onSessionStart:i}=t;i==null||i(e,hv(o,this.history)),this.removeListeners=QH($p(this.win,"pointermove",this.onPointerMove),$p(this.win,"pointerup",this.onPointerUp),$p(this.win,"pointercancel",this.onPointerUp))}updateHandlers(e){this.handlers=e}end(){var e;(e=this.removeListeners)==null||e.call(this),vT.update(this.updatePoint)}};function vS(e,t){return{x:e.x-t.x,y:e.y-t.y}}function hv(e,t){return{point:e.point,delta:vS(e.point,t[t.length-1]),offset:vS(e.point,t[0]),velocity:YH(t,.1)}}var XH=e=>e*1e3;function YH(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>XH(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 QH(...e){return t=>e.reduce((n,r)=>r(n),t)}function mv(e,t){return Math.abs(e-t)}function bS(e){return"x"in e&&"y"in e}function ZH(e,t){if(typeof e=="number"&&typeof t=="number")return mv(e,t);if(bS(e)&&bS(t)){const n=mv(e.x,t.x),r=mv(e.y,t.y);return Math.sqrt(n**2+r**2)}return 0}function DP(e){const t=d.useRef(null);return t.current=e,t}function RP(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),h=DP({onSessionStart:s,onSessionEnd:i,onStart:r,onMove:n,onEnd(m,v){p.current=null,o==null||o(m,v)}});d.useEffect(()=>{var m;(m=p.current)==null||m.updateHandlers(h.current)}),d.useEffect(()=>{const m=e.current;if(!m||!u)return;function v(b){p.current=new qH(b,h.current,l)}return $p(m,"pointerdown",v)},[e,u,h,l]),d.useEffect(()=>()=>{var m;(m=p.current)==null||m.end(),p.current=null},[])}function JH(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 eW=globalThis!=null&&globalThis.document?d.useLayoutEffect:d.useEffect;function tW(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 AP({getNodes:e,observeMutation:t=!0}){const[n,r]=d.useState([]),[o,s]=d.useState(0);return eW(()=>{const i=e(),l=i.map((u,p)=>JH(u,h=>{r(m=>[...m.slice(0,p),h,...m.slice(p+1)])}));if(t){const u=i[0];l.push(tW(u,()=>{s(p=>p+1)}))}return()=>{l.forEach(u=>{u==null||u()})}},[o]),n}function nW(e){return typeof e=="object"&&e!==null&&"current"in e}function rW(e){const[t]=AP({observeMutation:!1,getNodes(){return[nW(e)?e.current:e]}});return t}function oW(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:h,isReadOnly:m,onChangeStart:v,onChangeEnd:b,step:y=1,getAriaValueText:x,"aria-valuetext":w,"aria-label":k,"aria-labelledby":_,name:j,focusThumbOnChange:I=!0,minStepsBetweenThumbs:E=0,...M}=e,D=nn(v),R=nn(b),A=nn(x),O=EP({isReversed:i,direction:l,orientation:u}),[T,K]=Ac({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[F,V]=d.useState(!1),[X,W]=d.useState(!1),[z,Y]=d.useState(-1),B=!(h||m),q=d.useRef(T),re=T.map(ke=>tc(ke,t,n)),Q=E*y,le=sW(re,t,n,Q),se=d.useRef({eventSource:null,value:[],valueBounds:[]});se.current.value=re,se.current.valueBounds=le;const U=re.map(ke=>n-ke+t),te=(O?U:re).map(ke=>th(ke,t,n)),ae=u==="vertical",oe=d.useRef(null),pe=d.useRef(null),ue=AP({getNodes(){const ke=pe.current,ze=ke==null?void 0:ke.querySelectorAll("[role=slider]");return ze?Array.from(ze):[]}}),me=d.useId(),ge=$H(p??me),fe=d.useCallback(ke=>{var ze,Le;if(!oe.current)return;se.current.eventSource="pointer";const Ve=oe.current.getBoundingClientRect(),{clientX:ct,clientY:bn}=(Le=(ze=ke.touches)==null?void 0:ze[0])!=null?Le:ke,jt=ae?Ve.bottom-bn:ct-Ve.left,Pt=ae?Ve.height:Ve.width;let sr=jt/Pt;return O&&(sr=1-sr),U5(sr,t,n)},[ae,O,n,t]),De=(n-t)/10,je=y||(n-t)/100,Be=d.useMemo(()=>({setValueAtIndex(ke,ze){if(!B)return;const Le=se.current.valueBounds[ke];ze=parseFloat(w1(ze,Le.min,je)),ze=tc(ze,Le.min,Le.max);const Ve=[...se.current.value];Ve[ke]=ze,K(Ve)},setActiveIndex:Y,stepUp(ke,ze=je){const Le=se.current.value[ke],Ve=O?Le-ze:Le+ze;Be.setValueAtIndex(ke,Ve)},stepDown(ke,ze=je){const Le=se.current.value[ke],Ve=O?Le+ze:Le-ze;Be.setValueAtIndex(ke,Ve)},reset(){K(q.current)}}),[je,O,K,B]),rt=d.useCallback(ke=>{const ze=ke.key,Ve={ArrowRight:()=>Be.stepUp(z),ArrowUp:()=>Be.stepUp(z),ArrowLeft:()=>Be.stepDown(z),ArrowDown:()=>Be.stepDown(z),PageUp:()=>Be.stepUp(z,De),PageDown:()=>Be.stepDown(z,De),Home:()=>{const{min:ct}=le[z];Be.setValueAtIndex(z,ct)},End:()=>{const{max:ct}=le[z];Be.setValueAtIndex(z,ct)}}[ze];Ve&&(ke.preventDefault(),ke.stopPropagation(),Ve(ke),se.current.eventSource="keyboard")},[Be,z,De,le]),{getThumbStyle:Ue,rootStyle:wt,trackStyle:Ye,innerTrackStyle:tt}=d.useMemo(()=>IP({isReversed:O,orientation:u,thumbRects:ue,thumbPercents:te}),[O,u,te,ue]),be=d.useCallback(ke=>{var ze;const Le=ke??z;if(Le!==-1&&I){const Ve=ge.getThumb(Le),ct=(ze=pe.current)==null?void 0:ze.ownerDocument.getElementById(Ve);ct&&setTimeout(()=>ct.focus())}},[I,z,ge]);ca(()=>{se.current.eventSource==="keyboard"&&(R==null||R(se.current.value))},[re,R]);const Re=ke=>{const ze=fe(ke)||0,Le=se.current.value.map(Pt=>Math.abs(Pt-ze)),Ve=Math.min(...Le);let ct=Le.indexOf(Ve);const bn=Le.filter(Pt=>Pt===Ve);bn.length>1&&ze>se.current.value[ct]&&(ct=ct+bn.length-1),Y(ct),Be.setValueAtIndex(ct,ze),be(ct)},st=ke=>{if(z==-1)return;const ze=fe(ke)||0;Y(z),Be.setValueAtIndex(z,ze),be(z)};RP(pe,{onPanSessionStart(ke){B&&(V(!0),Re(ke),D==null||D(se.current.value))},onPanSessionEnd(){B&&(V(!1),R==null||R(se.current.value))},onPan(ke){B&&st(ke)}});const mt=d.useCallback((ke={},ze=null)=>({...ke,...M,id:ge.root,ref:Ct(ze,pe),tabIndex:-1,"aria-disabled":sc(h),"data-focused":ao(X),style:{...ke.style,...wt}}),[M,h,X,wt,ge]),ve=d.useCallback((ke={},ze=null)=>({...ke,ref:Ct(ze,oe),id:ge.track,"data-disabled":ao(h),style:{...ke.style,...Ye}}),[h,Ye,ge]),Qe=d.useCallback((ke={},ze=null)=>({...ke,ref:ze,id:ge.innerTrack,style:{...ke.style,...tt}}),[tt,ge]),ot=d.useCallback((ke,ze=null)=>{var Le;const{index:Ve,...ct}=ke,bn=re[Ve];if(bn==null)throw new TypeError(`[range-slider > thumb] Cannot find value at index \`${Ve}\`. The \`value\` or \`defaultValue\` length is : ${re.length}`);const jt=le[Ve];return{...ct,ref:ze,role:"slider",tabIndex:B?0:void 0,id:ge.getThumb(Ve),"data-active":ao(F&&z===Ve),"aria-valuetext":(Le=A==null?void 0:A(bn))!=null?Le:w==null?void 0:w[Ve],"aria-valuemin":jt.min,"aria-valuemax":jt.max,"aria-valuenow":bn,"aria-orientation":u,"aria-disabled":sc(h),"aria-readonly":sc(m),"aria-label":k==null?void 0:k[Ve],"aria-labelledby":k!=null&&k[Ve]||_==null?void 0:_[Ve],style:{...ke.style,...Ue(Ve)},onKeyDown:ac(ke.onKeyDown,rt),onFocus:ac(ke.onFocus,()=>{W(!0),Y(Ve)}),onBlur:ac(ke.onBlur,()=>{W(!1),Y(-1)})}},[ge,re,le,B,F,z,A,w,u,h,m,k,_,Ue,rt,W]),lt=d.useCallback((ke={},ze=null)=>({...ke,ref:ze,id:ge.output,htmlFor:re.map((Le,Ve)=>ge.getThumb(Ve)).join(" "),"aria-live":"off"}),[ge,re]),Me=d.useCallback((ke,ze=null)=>{const{value:Le,...Ve}=ke,ct=!(Le<t||Le>n),bn=Le>=re[0]&&Le<=re[re.length-1];let jt=th(Le,t,n);jt=O?100-jt:jt;const Pt={position:"absolute",pointerEvents:"none",...Du({orientation:u,vertical:{bottom:`${jt}%`},horizontal:{left:`${jt}%`}})};return{...Ve,ref:ze,id:ge.getMarker(ke.value),role:"presentation","aria-hidden":!0,"data-disabled":ao(h),"data-invalid":ao(!ct),"data-highlighted":ao(bn),style:{...ke.style,...Pt}}},[h,O,n,t,u,re,ge]),$e=d.useCallback((ke,ze=null)=>{const{index:Le,...Ve}=ke;return{...Ve,ref:ze,id:ge.getInput(Le),type:"hidden",value:re[Le],name:Array.isArray(j)?j[Le]:`${j}-${Le}`}},[j,re,ge]);return{state:{value:re,isFocused:X,isDragging:F,getThumbPercent:ke=>te[ke],getThumbMinValue:ke=>le[ke].min,getThumbMaxValue:ke=>le[ke].max},actions:Be,getRootProps:mt,getTrackProps:ve,getInnerTrackProps:Qe,getThumbProps:ot,getMarkerProps:Me,getInputProps:$e,getOutputProps:lt}}function sW(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[aW,Wm]=$t({name:"SliderContext",errorMessage:"useSliderContext: `context` is undefined. Seems you forgot to wrap all slider components within <RangeSlider />"}),[iW,Vm]=$t({name:"RangeSliderStylesContext",errorMessage:`useRangeSliderStyles returned is 'undefined'. Seems you forgot to wrap the components in "<RangeSlider />" `}),Nx=Pe(function(t,n){const r={orientation:"horizontal",...t},o=Wn("Slider",r),s=Yt(r),{direction:i}=yd();s.direction=i;const{getRootProps:l,...u}=oW(s),p=d.useMemo(()=>({...u,name:r.name}),[u,r.name]);return a.jsx(aW,{value:p,children:a.jsx(iW,{value:o,children:a.jsx(_e.div,{...l({},n),className:"chakra-slider",__css:o.container,children:r.children})})})});Nx.displayName="RangeSlider";var od=Pe(function(t,n){const{getThumbProps:r,getInputProps:o,name:s}=Wm(),i=Vm(),l=r(t,n);return a.jsxs(_e.div,{...l,className:ei("chakra-slider__thumb",t.className),__css:i.thumb,children:[l.children,s&&a.jsx("input",{...o({index:t.index})})]})});od.displayName="RangeSliderThumb";var Tx=Pe(function(t,n){const{getTrackProps:r}=Wm(),o=Vm(),s=r(t,n);return a.jsx(_e.div,{...s,className:ei("chakra-slider__track",t.className),__css:o.track,"data-testid":"chakra-range-slider-track"})});Tx.displayName="RangeSliderTrack";var $x=Pe(function(t,n){const{getInnerTrackProps:r}=Wm(),o=Vm(),s=r(t,n);return a.jsx(_e.div,{...s,className:"chakra-slider__filled-track",__css:o.filledTrack})});$x.displayName="RangeSliderFilledTrack";var Pi=Pe(function(t,n){const{getMarkerProps:r}=Wm(),o=Vm(),s=r(t,n);return a.jsx(_e.div,{...s,className:ei("chakra-slider__marker",t.className),__css:o.mark})});Pi.displayName="RangeSliderMark";function lW(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:h,isDisabled:m,isReadOnly:v,onChangeStart:b,onChangeEnd:y,step:x=1,getAriaValueText:w,"aria-valuetext":k,"aria-label":_,"aria-labelledby":j,name:I,focusThumbOnChange:E=!0,...M}=e,D=nn(b),R=nn(y),A=nn(w),O=EP({isReversed:l,direction:u,orientation:p}),[T,K]=Ac({value:s,defaultValue:i??uW(n,r),onChange:o}),[F,V]=d.useState(!1),[X,W]=d.useState(!1),z=!(m||v),Y=(r-n)/10,B=x||(r-n)/100,q=tc(T,n,r),re=r-q+n,le=th(O?re:q,n,r),se=p==="vertical",U=DP({min:n,max:r,step:x,isDisabled:m,value:q,isInteractive:z,isReversed:O,isVertical:se,eventSource:null,focusThumbOnChange:E,orientation:p}),G=d.useRef(null),te=d.useRef(null),ae=d.useRef(null),oe=d.useId(),pe=h??oe,[ue,me]=[`slider-thumb-${pe}`,`slider-track-${pe}`],Ce=d.useCallback(Me=>{var $e,At;if(!G.current)return;const ke=U.current;ke.eventSource="pointer";const ze=G.current.getBoundingClientRect(),{clientX:Le,clientY:Ve}=(At=($e=Me.touches)==null?void 0:$e[0])!=null?At:Me,ct=se?ze.bottom-Ve:Le-ze.left,bn=se?ze.height:ze.width;let jt=ct/bn;O&&(jt=1-jt);let Pt=U5(jt,ke.min,ke.max);return ke.step&&(Pt=parseFloat(w1(Pt,ke.min,ke.step))),Pt=tc(Pt,ke.min,ke.max),Pt},[se,O,U]),ge=d.useCallback(Me=>{const $e=U.current;$e.isInteractive&&(Me=parseFloat(w1(Me,$e.min,B)),Me=tc(Me,$e.min,$e.max),K(Me))},[B,K,U]),fe=d.useMemo(()=>({stepUp(Me=B){const $e=O?q-Me:q+Me;ge($e)},stepDown(Me=B){const $e=O?q+Me:q-Me;ge($e)},reset(){ge(i||0)},stepTo(Me){ge(Me)}}),[ge,O,q,B,i]),De=d.useCallback(Me=>{const $e=U.current,ke={ArrowRight:()=>fe.stepUp(),ArrowUp:()=>fe.stepUp(),ArrowLeft:()=>fe.stepDown(),ArrowDown:()=>fe.stepDown(),PageUp:()=>fe.stepUp(Y),PageDown:()=>fe.stepDown(Y),Home:()=>ge($e.min),End:()=>ge($e.max)}[Me.key];ke&&(Me.preventDefault(),Me.stopPropagation(),ke(Me),$e.eventSource="keyboard")},[fe,ge,Y,U]),je=(t=A==null?void 0:A(q))!=null?t:k,Be=rW(te),{getThumbStyle:rt,rootStyle:Ue,trackStyle:wt,innerTrackStyle:Ye}=d.useMemo(()=>{const Me=U.current,$e=Be??{width:0,height:0};return IP({isReversed:O,orientation:Me.orientation,thumbRects:[$e],thumbPercents:[le]})},[O,Be,le,U]),tt=d.useCallback(()=>{U.current.focusThumbOnChange&&setTimeout(()=>{var $e;return($e=te.current)==null?void 0:$e.focus()})},[U]);ca(()=>{const Me=U.current;tt(),Me.eventSource==="keyboard"&&(R==null||R(Me.value))},[q,R]);function be(Me){const $e=Ce(Me);$e!=null&&$e!==U.current.value&&K($e)}RP(ae,{onPanSessionStart(Me){const $e=U.current;$e.isInteractive&&(V(!0),tt(),be(Me),D==null||D($e.value))},onPanSessionEnd(){const Me=U.current;Me.isInteractive&&(V(!1),R==null||R(Me.value))},onPan(Me){U.current.isInteractive&&be(Me)}});const Re=d.useCallback((Me={},$e=null)=>({...Me,...M,ref:Ct($e,ae),tabIndex:-1,"aria-disabled":sc(m),"data-focused":ao(X),style:{...Me.style,...Ue}}),[M,m,X,Ue]),st=d.useCallback((Me={},$e=null)=>({...Me,ref:Ct($e,G),id:me,"data-disabled":ao(m),style:{...Me.style,...wt}}),[m,me,wt]),mt=d.useCallback((Me={},$e=null)=>({...Me,ref:$e,style:{...Me.style,...Ye}}),[Ye]),ve=d.useCallback((Me={},$e=null)=>({...Me,ref:Ct($e,te),role:"slider",tabIndex:z?0:void 0,id:ue,"data-active":ao(F),"aria-valuetext":je,"aria-valuemin":n,"aria-valuemax":r,"aria-valuenow":q,"aria-orientation":p,"aria-disabled":sc(m),"aria-readonly":sc(v),"aria-label":_,"aria-labelledby":_?void 0:j,style:{...Me.style,...rt(0)},onKeyDown:ac(Me.onKeyDown,De),onFocus:ac(Me.onFocus,()=>W(!0)),onBlur:ac(Me.onBlur,()=>W(!1))}),[z,ue,F,je,n,r,q,p,m,v,_,j,rt,De]),Qe=d.useCallback((Me,$e=null)=>{const At=!(Me.value<n||Me.value>r),ke=q>=Me.value,ze=th(Me.value,n,r),Le={position:"absolute",pointerEvents:"none",...cW({orientation:p,vertical:{bottom:O?`${100-ze}%`:`${ze}%`},horizontal:{left:O?`${100-ze}%`:`${ze}%`}})};return{...Me,ref:$e,role:"presentation","aria-hidden":!0,"data-disabled":ao(m),"data-invalid":ao(!At),"data-highlighted":ao(ke),style:{...Me.style,...Le}}},[m,O,r,n,p,q]),ot=d.useCallback((Me={},$e=null)=>({...Me,ref:$e,type:"hidden",value:q,name:I}),[I,q]);return{state:{value:q,isFocused:X,isDragging:F},actions:fe,getRootProps:Re,getTrackProps:st,getInnerTrackProps:mt,getThumbProps:ve,getMarkerProps:Qe,getInputProps:ot}}function cW(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}function uW(e,t){return t<e?e:e+(t-e)/2}var[dW,Um]=$t({name:"SliderContext",hookName:"useSliderContext",providerName:"<Slider />"}),[fW,Gm]=$t({name:"SliderStylesContext",hookName:"useSliderStyles",providerName:"<Slider />"}),Lx=Pe((e,t)=>{var n;const r={...e,orientation:(n=e==null?void 0:e.orientation)!=null?n:"horizontal"},o=Wn("Slider",r),s=Yt(r),{direction:i}=yd();s.direction=i;const{getInputProps:l,getRootProps:u,...p}=lW(s),h=u(),m=l({},t);return a.jsx(dW,{value:p,children:a.jsx(fW,{value:o,children:a.jsxs(_e.div,{...h,className:ei("chakra-slider",r.className),__css:o.container,children:[r.children,a.jsx("input",{...m})]})})})});Lx.displayName="Slider";var zx=Pe((e,t)=>{const{getThumbProps:n}=Um(),r=Gm(),o=n(e,t);return a.jsx(_e.div,{...o,className:ei("chakra-slider__thumb",e.className),__css:r.thumb})});zx.displayName="SliderThumb";var Fx=Pe((e,t)=>{const{getTrackProps:n}=Um(),r=Gm(),o=n(e,t);return a.jsx(_e.div,{...o,className:ei("chakra-slider__track",e.className),__css:r.track})});Fx.displayName="SliderTrack";var Bx=Pe((e,t)=>{const{getInnerTrackProps:n}=Um(),r=Gm(),o=n(e,t);return a.jsx(_e.div,{...o,className:ei("chakra-slider__filled-track",e.className),__css:r.filledTrack})});Bx.displayName="SliderFilledTrack";var Fl=Pe((e,t)=>{const{getMarkerProps:n}=Um(),r=Gm(),o=n(e,t);return a.jsx(_e.div,{...o,className:ei("chakra-slider__marker",e.className),__css:r.mark})});Fl.displayName="SliderMark";var Hx=Pe(function(t,n){const r=Wn("Switch",t),{spacing:o="0.5rem",children:s,...i}=Yt(t),{getIndicatorProps:l,getInputProps:u,getCheckboxProps:p,getRootProps:h,getLabelProps:m}=V5(i),v=d.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...r.container}),[r.container]),b=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(_e.label,{...h(),className:et("chakra-switch",t.className),__css:v,children:[a.jsx("input",{className:"chakra-switch__input",...u({},n)}),a.jsx(_e.span,{...p(),className:"chakra-switch__track",__css:b,children:a.jsx(_e.span,{__css:r.thumb,className:"chakra-switch__thumb",...l()})}),s&&a.jsx(_e.span,{className:"chakra-switch__label",...m(),__css:y,children:s})]})});Hx.displayName="Switch";var[pW,hW,mW,gW]=Zb();function vW(e){var t;const{defaultIndex:n,onChange:r,index:o,isManual:s,isLazy:i,lazyBehavior:l="unmount",orientation:u="horizontal",direction:p="ltr",...h}=e,[m,v]=d.useState(n??0),[b,y]=Ac({defaultValue:n??0,value:o,onChange:r});d.useEffect(()=>{o!=null&&v(o)},[o]);const x=mW(),w=d.useId();return{id:`tabs-${(t=e.id)!=null?t:w}`,selectedIndex:b,focusedIndex:m,setSelectedIndex:y,setFocusedIndex:v,isManual:s,isLazy:i,lazyBehavior:l,orientation:u,descendants:x,direction:p,htmlProps:h}}var[bW,Km]=$t({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within <Tabs />"});function xW(e){const{focusedIndex:t,orientation:n,direction:r}=Km(),o=hW(),s=d.useCallback(i=>{const l=()=>{var _;const j=o.nextEnabled(t);j&&((_=j.node)==null||_.focus())},u=()=>{var _;const j=o.prevEnabled(t);j&&((_=j.node)==null||_.focus())},p=()=>{var _;const j=o.firstEnabled();j&&((_=j.node)==null||_.focus())},h=()=>{var _;const j=o.lastEnabled();j&&((_=j.node)==null||_.focus())},m=n==="horizontal",v=n==="vertical",b=i.key,y=r==="ltr"?"ArrowLeft":"ArrowRight",x=r==="ltr"?"ArrowRight":"ArrowLeft",k={[y]:()=>m&&u(),[x]:()=>m&&l(),ArrowDown:()=>v&&l(),ArrowUp:()=>v&&u(),Home:p,End:h}[b];k&&(i.preventDefault(),k(i))},[o,t,n,r]);return{...e,role:"tablist","aria-orientation":n,onKeyDown:Fe(e.onKeyDown,s)}}function yW(e){const{isDisabled:t=!1,isFocusable:n=!1,...r}=e,{setSelectedIndex:o,isManual:s,id:i,setFocusedIndex:l,selectedIndex:u}=Km(),{index:p,register:h}=gW({disabled:t&&!n}),m=p===u,v=()=>{o(p)},b=()=>{l(p),!s&&!(t&&n)&&o(p)},y=V3({...r,ref:Ct(h,e.ref),isDisabled:t,isFocusable:n,onClick:Fe(e.onClick,v)}),x="button";return{...y,id:NP(i,p),role:"tab",tabIndex:m?0:-1,type:x,"aria-selected":m,"aria-controls":TP(i,p),onFocus:t?void 0:Fe(e.onFocus,b)}}var[CW,wW]=$t({});function SW(e){const t=Km(),{id:n,selectedIndex:r}=t,s=Id(e.children).map((i,l)=>d.createElement(CW,{key:l,value:{isSelected:l===r,id:TP(n,l),tabId:NP(n,l),selectedIndex:r}},i));return{...e,children:s}}function kW(e){const{children:t,...n}=e,{isLazy:r,lazyBehavior:o}=Km(),{isSelected:s,id:i,tabId:l}=wW(),u=d.useRef(!1);s&&(u.current=!0);const p=Ex({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 NP(e,t){return`${e}--tab-${t}`}function TP(e,t){return`${e}--tabpanel-${t}`}var[_W,qm]=$t({name:"TabsStylesContext",errorMessage:`useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Tabs />" `}),Ji=Pe(function(t,n){const r=Wn("Tabs",t),{children:o,className:s,...i}=Yt(t),{htmlProps:l,descendants:u,...p}=vW(i),h=d.useMemo(()=>p,[p]),{isFitted:m,...v}=l;return a.jsx(pW,{value:u,children:a.jsx(bW,{value:h,children:a.jsx(_W,{value:r,children:a.jsx(_e.div,{className:et("chakra-tabs",s),ref:n,...v,__css:r.root,children:o})})})})});Ji.displayName="Tabs";var el=Pe(function(t,n){const r=xW({...t,ref:n}),s={display:"flex",...qm().tablist};return a.jsx(_e.div,{...r,className:et("chakra-tabs__tablist",t.className),__css:s})});el.displayName="TabList";var mo=Pe(function(t,n){const r=kW({...t,ref:n}),o=qm();return a.jsx(_e.div,{outline:"0",...r,className:et("chakra-tabs__tab-panel",t.className),__css:o.tabpanel})});mo.displayName="TabPanel";var Fc=Pe(function(t,n){const r=SW(t),o=qm();return a.jsx(_e.div,{...r,width:"100%",ref:n,className:et("chakra-tabs__tab-panels",t.className),__css:o.tabpanels})});Fc.displayName="TabPanels";var Pr=Pe(function(t,n){const r=qm(),o=yW({...t,ref:n}),s={outline:"0",display:"flex",alignItems:"center",justifyContent:"center",...r.tab};return a.jsx(_e.button,{...o,className:et("chakra-tabs__tab",t.className),__css:s})});Pr.displayName="Tab";function jW(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var PW=["h","minH","height","minHeight"],$P=Pe((e,t)=>{const n=Qa("Textarea",e),{className:r,rows:o,...s}=Yt(e),i=tx(s),l=o?jW(n,PW):n;return a.jsx(_e.textarea,{ref:t,rows:o,...i,className:et("chakra-textarea",r),__css:l})});$P.displayName="Textarea";var IW={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]}}}},L1=e=>{var t;return((t=e.current)==null?void 0:t.ownerDocument)||document},Lp=e=>{var t,n;return((n=(t=e.current)==null?void 0:t.ownerDocument)==null?void 0:n.defaultView)||window};function EW(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:h,id:m,isOpen:v,defaultIsOpen:b,arrowSize:y=10,arrowShadowColor:x,arrowPadding:w,modifiers:k,isDisabled:_,gutter:j,offset:I,direction:E,...M}=e,{isOpen:D,onOpen:R,onClose:A}=Ix({isOpen:v,defaultIsOpen:b,onOpen:u,onClose:p}),{referenceRef:O,getPopperProps:T,getArrowInnerProps:K,getArrowProps:F}=Px({enabled:D,placement:h,arrowPadding:w,modifiers:k,gutter:j,offset:I,direction:E}),V=d.useId(),W=`tooltip-${m??V}`,z=d.useRef(null),Y=d.useRef(),B=d.useCallback(()=>{Y.current&&(clearTimeout(Y.current),Y.current=void 0)},[]),q=d.useRef(),re=d.useCallback(()=>{q.current&&(clearTimeout(q.current),q.current=void 0)},[]),Q=d.useCallback(()=>{re(),A()},[A,re]),le=MW(z,Q),se=d.useCallback(()=>{if(!_&&!Y.current){D&&le();const me=Lp(z);Y.current=me.setTimeout(R,t)}},[le,_,D,R,t]),U=d.useCallback(()=>{B();const me=Lp(z);q.current=me.setTimeout(Q,n)},[n,Q,B]),G=d.useCallback(()=>{D&&r&&U()},[r,U,D]),te=d.useCallback(()=>{D&&i&&U()},[i,U,D]),ae=d.useCallback(me=>{D&&me.key==="Escape"&&U()},[D,U]);_i(()=>L1(z),"keydown",l?ae:void 0),_i(()=>{const me=z.current;if(!me)return null;const Ce=D3(me);return Ce.localName==="body"?Lp(z):Ce},"scroll",()=>{D&&s&&Q()},{passive:!0,capture:!0}),d.useEffect(()=>{_&&(B(),D&&A())},[_,D,A,B]),d.useEffect(()=>()=>{B(),re()},[B,re]),_i(()=>z.current,"pointerleave",U);const oe=d.useCallback((me={},Ce=null)=>({...me,ref:Ct(z,Ce,O),onPointerEnter:Fe(me.onPointerEnter,fe=>{fe.pointerType!=="touch"&&se()}),onClick:Fe(me.onClick,G),onPointerDown:Fe(me.onPointerDown,te),onFocus:Fe(me.onFocus,se),onBlur:Fe(me.onBlur,U),"aria-describedby":D?W:void 0}),[se,U,te,D,W,G,O]),pe=d.useCallback((me={},Ce=null)=>T({...me,style:{...me.style,[jn.arrowSize.var]:y?`${y}px`:void 0,[jn.arrowShadowColor.var]:x}},Ce),[T,y,x]),ue=d.useCallback((me={},Ce=null)=>{const ge={...me.style,position:"relative",transformOrigin:jn.transformOrigin.varRef};return{ref:Ce,...M,...me,id:W,role:"tooltip",style:ge}},[M,W]);return{isOpen:D,show:se,hide:U,getTriggerProps:oe,getTooltipProps:ue,getTooltipPositionerProps:pe,getArrowProps:F,getArrowInnerProps:K}}var gv="chakra-ui:close-tooltip";function MW(e,t){return d.useEffect(()=>{const n=L1(e);return n.addEventListener(gv,t),()=>n.removeEventListener(gv,t)},[t,e]),()=>{const n=L1(e),r=Lp(e);n.dispatchEvent(new r.CustomEvent(gv))}}function OW(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function DW(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var RW=_e(vn.div),Rt=Pe((e,t)=>{var n,r;const o=Qa("Tooltip",e),s=Yt(e),i=yd(),{children:l,label:u,shouldWrapChildren:p,"aria-label":h,hasArrow:m,bg:v,portalProps:b,background:y,backgroundColor:x,bgColor:w,motionProps:k,..._}=s,j=(r=(n=y??x)!=null?n:v)!=null?r:w;if(j){o.bg=j;const T=z7(i,"colors",j);o[jn.arrowBg.var]=T}const I=EW({..._,direction:i.direction}),E=typeof l=="string"||p;let M;if(E)M=a.jsx(_e.span,{display:"inline-block",tabIndex:0,...I.getTriggerProps(),children:l});else{const T=d.Children.only(l);M=d.cloneElement(T,I.getTriggerProps(T.props,T.ref))}const D=!!h,R=I.getTooltipProps({},t),A=D?OW(R,["role","id"]):R,O=DW(R,["role","id"]);return u?a.jsxs(a.Fragment,{children:[M,a.jsx(nr,{children:I.isOpen&&a.jsx(_d,{...b,children:a.jsx(_e.div,{...I.getTooltipPositionerProps(),__css:{zIndex:o.zIndex,pointerEvents:"none"},children:a.jsxs(RW,{variants:IW,initial:"exit",animate:"enter",exit:"exit",...k,...A,__css:o,children:[u,D&&a.jsx(_e.span,{srOnly:!0,...O,children:h}),m&&a.jsx(_e.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper",children:a.jsx(_e.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:o.bg}})})]})})})})]}):a.jsx(a.Fragment,{children:l})});Rt.displayName="Tooltip";const xo=e=>e.system,AW=e=>e.system.toastQueue,LP=ie(xo,e=>e.language,we),En=ie(e=>e,e=>e.system.isProcessing||!e.system.isConnected),NW=ie(xo,e=>{const{consoleLogLevel:t,shouldLogToConsole:n}=e;return{consoleLogLevel:t,shouldLogToConsole:n}},{memoizeOptions:{resultEqualityCheck:_t}}),zP=e=>{const{consoleLogLevel:t,shouldLogToConsole:n}=L(NW);return d.useEffect(()=>{n?(localStorage.setItem("ROARR_LOG","true"),localStorage.setItem("ROARR_FILTER",`context.logLevel:>=${F7[t]}`)):localStorage.setItem("ROARR_LOG","false"),LC.ROARR.write=B7.createLogWriter()},[t,n]),d.useEffect(()=>{const o={...H7};W7.set(LC.Roarr.child(o))},[]),d.useMemo(()=>Yi(e),[e])},TW=()=>{const e=ee(),t=L(AW),n=A5();return d.useEffect(()=>{t.forEach(r=>{n(r)}),t.length>0&&e(V7())},[e,n,t]),null},tl=()=>{const e=ee();return d.useCallback(n=>e(Tt(Ft(n))),[e])},$W=d.memo(TW);var LW=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=zW(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 zW(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),o=LW.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var FW=[".DS_Store","Thumbs.db"];function BW(e){return Nc(this,void 0,void 0,function(){return Tc(this,function(t){return lh(e)&&HW(e.dataTransfer)?[2,GW(e.dataTransfer,e.type)]:WW(e)?[2,VW(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,UW(e)]:[2,[]]})})}function HW(e){return lh(e)}function WW(e){return lh(e)&&lh(e.target)}function lh(e){return typeof e=="object"&&e!==null}function VW(e){return z1(e.target.files).map(function(t){return Fd(t)})}function UW(e){return Nc(this,void 0,void 0,function(){var t;return Tc(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 GW(e,t){return Nc(this,void 0,void 0,function(){var n,r;return Tc(this,function(o){switch(o.label){case 0:return e.items?(n=z1(e.items).filter(function(s){return s.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(KW))]):[3,2];case 1:return r=o.sent(),[2,xS(FP(r))];case 2:return[2,xS(z1(e.files).map(function(s){return Fd(s)}))]}})})}function xS(e){return e.filter(function(t){return FW.indexOf(t.name)===-1})}function z1(e){if(e===null)return[];for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r)}return t}function KW(e){if(typeof e.webkitGetAsEntry!="function")return yS(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?BP(t):yS(e)}function FP(e){return e.reduce(function(t,n){return k1(k1([],Hw(t),!1),Hw(Array.isArray(n)?FP(n):[n]),!1)},[])}function yS(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 qW(e){return Nc(this,void 0,void 0,function(){return Tc(this,function(t){return[2,e.isDirectory?BP(e):XW(e)]})})}function BP(e){var t=e.createReader();return new Promise(function(n,r){var o=[];function s(){var i=this;t.readEntries(function(l){return Nc(i,void 0,void 0,function(){var u,p,h;return Tc(this,function(m){switch(m.label){case 0:if(l.length)return[3,5];m.label=1;case 1:return m.trys.push([1,3,,4]),[4,Promise.all(o)];case 2:return u=m.sent(),n(u),[3,4];case 3:return p=m.sent(),r(p),[3,4];case 4:return[3,6];case 5:h=Promise.all(l.map(qW)),o.push(h),s(),m.label=6;case 6:return[2]}})})},function(l){r(l)})}s()})}function XW(e){return Nc(this,void 0,void 0,function(){return Tc(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 YW=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 CS(e){return JW(e)||ZW(e)||WP(e)||QW()}function QW(){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 ZW(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function JW(e){if(Array.isArray(e))return F1(e)}function wS(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 SS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wS(Object(n),!0).forEach(function(r){HP(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wS(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 sd(e,t){return nV(e)||tV(e,t)||WP(e,t)||eV()}function eV(){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 WP(e,t){if(e){if(typeof e=="string")return F1(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 F1(e,t)}}function F1(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 tV(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 nV(e){if(Array.isArray(e))return e}var rV="file-invalid-type",oV="file-too-large",sV="file-too-small",aV="too-many-files",iV=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:rV,message:"File type must be ".concat(n)}},kS=function(t){return{code:oV,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},_S=function(t){return{code:sV,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},lV={code:aV,message:"Too many files"};function VP(e,t){var n=e.type==="application/x-moz-file"||YW(e,t);return[n,n?null:iV(t)]}function UP(e,t,n){if(xi(e.size))if(xi(t)&&xi(n)){if(e.size>n)return[!1,kS(n)];if(e.size<t)return[!1,_S(t)]}else{if(xi(t)&&e.size<t)return[!1,_S(t)];if(xi(n)&&e.size>n)return[!1,kS(n)]}return[!0,null]}function xi(e){return e!=null}function cV(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),h=sd(p,1),m=h[0],v=UP(u,r,o),b=sd(v,1),y=b[0],x=l?l(u):null;return m&&y&&!x})}function ch(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function rp(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 jS(e){e.preventDefault()}function uV(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function dV(e){return e.indexOf("Edge/")!==-1}function fV(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return uV(e)||dV(e)}function ss(){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!ch(r)&&l&&l.apply(void 0,[r].concat(s)),ch(r)})}}function pV(){return"showOpenFilePicker"in window}function hV(e){if(xi(e)){var t=Object.entries(e).filter(function(n){var r=sd(n,2),o=r[0],s=r[1],i=!0;return GP(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(KP))&&(console.warn('Skipped "'.concat(o,'" because an invalid file extension was provided.')),i=!1),i}).reduce(function(n,r){var o=sd(r,2),s=o[0],i=o[1];return SS(SS({},n),{},HP({},s,i))},{});return[{description:"Files",accept:t}]}return e}function mV(e){if(xi(e))return Object.entries(e).reduce(function(t,n){var r=sd(n,2),o=r[0],s=r[1];return[].concat(CS(t),[o],CS(s))},[]).filter(function(t){return GP(t)||KP(t)}).join(",")}function gV(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function vV(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function GP(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function KP(e){return/^.*\.[\w]+$/.test(e)}var bV=["children"],xV=["open"],yV=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],CV=["refKey","onChange","onClick"];function wV(e){return _V(e)||kV(e)||qP(e)||SV()}function SV(){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 kV(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function _V(e){if(Array.isArray(e))return B1(e)}function vv(e,t){return IV(e)||PV(e,t)||qP(e,t)||jV()}function jV(){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 qP(e,t){if(e){if(typeof e=="string")return B1(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 B1(e,t)}}function B1(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 PV(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 IV(e){if(Array.isArray(e))return e}function PS(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 un(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?PS(Object(n),!0).forEach(function(r){H1(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function H1(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uh(e,t){if(e==null)return{};var n=EV(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 EV(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 Wx=d.forwardRef(function(e,t){var n=e.children,r=uh(e,bV),o=Vx(r),s=o.open,i=uh(o,xV);return d.useImperativeHandle(t,function(){return{open:s}},[s]),H.createElement(d.Fragment,null,n(un(un({},i),{},{open:s})))});Wx.displayName="Dropzone";var XP={disabled:!1,getFilesFromEvent:BW,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};Wx.defaultProps=XP;Wx.propTypes={children:Ht.func,accept:Ht.objectOf(Ht.arrayOf(Ht.string)),multiple:Ht.bool,preventDropOnDocument:Ht.bool,noClick:Ht.bool,noKeyboard:Ht.bool,noDrag:Ht.bool,noDragEventsBubbling:Ht.bool,minSize:Ht.number,maxSize:Ht.number,maxFiles:Ht.number,disabled:Ht.bool,getFilesFromEvent:Ht.func,onFileDialogCancel:Ht.func,onFileDialogOpen:Ht.func,useFsAccessApi:Ht.bool,autoFocus:Ht.bool,onDragEnter:Ht.func,onDragLeave:Ht.func,onDragOver:Ht.func,onDrop:Ht.func,onDropAccepted:Ht.func,onDropRejected:Ht.func,onError:Ht.func,validator:Ht.func};var W1={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function Vx(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=un(un({},XP),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,h=t.onDragLeave,m=t.onDragOver,v=t.onDrop,b=t.onDropAccepted,y=t.onDropRejected,x=t.onFileDialogCancel,w=t.onFileDialogOpen,k=t.useFsAccessApi,_=t.autoFocus,j=t.preventDropOnDocument,I=t.noClick,E=t.noKeyboard,M=t.noDrag,D=t.noDragEventsBubbling,R=t.onError,A=t.validator,O=d.useMemo(function(){return mV(n)},[n]),T=d.useMemo(function(){return hV(n)},[n]),K=d.useMemo(function(){return typeof w=="function"?w:IS},[w]),F=d.useMemo(function(){return typeof x=="function"?x:IS},[x]),V=d.useRef(null),X=d.useRef(null),W=d.useReducer(MV,W1),z=vv(W,2),Y=z[0],B=z[1],q=Y.isFocused,re=Y.isFileDialogActive,Q=d.useRef(typeof window<"u"&&window.isSecureContext&&k&&pV()),le=function(){!Q.current&&re&&setTimeout(function(){if(X.current){var Re=X.current.files;Re.length||(B({type:"closeDialog"}),F())}},300)};d.useEffect(function(){return window.addEventListener("focus",le,!1),function(){window.removeEventListener("focus",le,!1)}},[X,re,F,Q]);var se=d.useRef([]),U=function(Re){V.current&&V.current.contains(Re.target)||(Re.preventDefault(),se.current=[])};d.useEffect(function(){return j&&(document.addEventListener("dragover",jS,!1),document.addEventListener("drop",U,!1)),function(){j&&(document.removeEventListener("dragover",jS),document.removeEventListener("drop",U))}},[V,j]),d.useEffect(function(){return!r&&_&&V.current&&V.current.focus(),function(){}},[V,_,r]);var G=d.useCallback(function(be){R?R(be):console.error(be)},[R]),te=d.useCallback(function(be){be.preventDefault(),be.persist(),Ue(be),se.current=[].concat(wV(se.current),[be.target]),rp(be)&&Promise.resolve(o(be)).then(function(Re){if(!(ch(be)&&!D)){var st=Re.length,mt=st>0&&cV({files:Re,accept:O,minSize:i,maxSize:s,multiple:l,maxFiles:u,validator:A}),ve=st>0&&!mt;B({isDragAccept:mt,isDragReject:ve,isDragActive:!0,type:"setDraggedFiles"}),p&&p(be)}}).catch(function(Re){return G(Re)})},[o,p,G,D,O,i,s,l,u,A]),ae=d.useCallback(function(be){be.preventDefault(),be.persist(),Ue(be);var Re=rp(be);if(Re&&be.dataTransfer)try{be.dataTransfer.dropEffect="copy"}catch{}return Re&&m&&m(be),!1},[m,D]),oe=d.useCallback(function(be){be.preventDefault(),be.persist(),Ue(be);var Re=se.current.filter(function(mt){return V.current&&V.current.contains(mt)}),st=Re.indexOf(be.target);st!==-1&&Re.splice(st,1),se.current=Re,!(Re.length>0)&&(B({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),rp(be)&&h&&h(be))},[V,h,D]),pe=d.useCallback(function(be,Re){var st=[],mt=[];be.forEach(function(ve){var Qe=VP(ve,O),ot=vv(Qe,2),lt=ot[0],Me=ot[1],$e=UP(ve,i,s),At=vv($e,2),ke=At[0],ze=At[1],Le=A?A(ve):null;if(lt&&ke&&!Le)st.push(ve);else{var Ve=[Me,ze];Le&&(Ve=Ve.concat(Le)),mt.push({file:ve,errors:Ve.filter(function(ct){return ct})})}}),(!l&&st.length>1||l&&u>=1&&st.length>u)&&(st.forEach(function(ve){mt.push({file:ve,errors:[lV]})}),st.splice(0)),B({acceptedFiles:st,fileRejections:mt,type:"setFiles"}),v&&v(st,mt,Re),mt.length>0&&y&&y(mt,Re),st.length>0&&b&&b(st,Re)},[B,l,O,i,s,u,v,b,y,A]),ue=d.useCallback(function(be){be.preventDefault(),be.persist(),Ue(be),se.current=[],rp(be)&&Promise.resolve(o(be)).then(function(Re){ch(be)&&!D||pe(Re,be)}).catch(function(Re){return G(Re)}),B({type:"reset"})},[o,pe,G,D]),me=d.useCallback(function(){if(Q.current){B({type:"openDialog"}),K();var be={multiple:l,types:T};window.showOpenFilePicker(be).then(function(Re){return o(Re)}).then(function(Re){pe(Re,null),B({type:"closeDialog"})}).catch(function(Re){gV(Re)?(F(Re),B({type:"closeDialog"})):vV(Re)?(Q.current=!1,X.current?(X.current.value=null,X.current.click()):G(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."))):G(Re)});return}X.current&&(B({type:"openDialog"}),K(),X.current.value=null,X.current.click())},[B,K,F,k,pe,G,T,l]),Ce=d.useCallback(function(be){!V.current||!V.current.isEqualNode(be.target)||(be.key===" "||be.key==="Enter"||be.keyCode===32||be.keyCode===13)&&(be.preventDefault(),me())},[V,me]),ge=d.useCallback(function(){B({type:"focus"})},[]),fe=d.useCallback(function(){B({type:"blur"})},[]),De=d.useCallback(function(){I||(fV()?setTimeout(me,0):me())},[I,me]),je=function(Re){return r?null:Re},Be=function(Re){return E?null:je(Re)},rt=function(Re){return M?null:je(Re)},Ue=function(Re){D&&Re.stopPropagation()},wt=d.useMemo(function(){return function(){var be=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Re=be.refKey,st=Re===void 0?"ref":Re,mt=be.role,ve=be.onKeyDown,Qe=be.onFocus,ot=be.onBlur,lt=be.onClick,Me=be.onDragEnter,$e=be.onDragOver,At=be.onDragLeave,ke=be.onDrop,ze=uh(be,yV);return un(un(H1({onKeyDown:Be(ss(ve,Ce)),onFocus:Be(ss(Qe,ge)),onBlur:Be(ss(ot,fe)),onClick:je(ss(lt,De)),onDragEnter:rt(ss(Me,te)),onDragOver:rt(ss($e,ae)),onDragLeave:rt(ss(At,oe)),onDrop:rt(ss(ke,ue)),role:typeof mt=="string"&&mt!==""?mt:"presentation"},st,V),!r&&!E?{tabIndex:0}:{}),ze)}},[V,Ce,ge,fe,De,te,ae,oe,ue,E,M,r]),Ye=d.useCallback(function(be){be.stopPropagation()},[]),tt=d.useMemo(function(){return function(){var be=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Re=be.refKey,st=Re===void 0?"ref":Re,mt=be.onChange,ve=be.onClick,Qe=uh(be,CV),ot=H1({accept:O,multiple:l,type:"file",style:{display:"none"},onChange:je(ss(mt,ue)),onClick:je(ss(ve,Ye)),tabIndex:-1},st,X);return un(un({},ot),Qe)}},[X,n,l,ue,r]);return un(un({},Y),{},{isFocused:q&&!r,getRootProps:wt,getInputProps:tt,rootRef:V,inputRef:X,open:je(me)})}function MV(e,t){switch(t.type){case"focus":return un(un({},e),{},{isFocused:!0});case"blur":return un(un({},e),{},{isFocused:!1});case"openDialog":return un(un({},W1),{},{isFileDialogActive:!0});case"closeDialog":return un(un({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return un(un({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return un(un({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return un({},W1);default:return e}}function IS(){}function V1(){return V1=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},V1.apply(this,arguments)}var YP=["shift","alt","meta","mod","ctrl"],OV={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 La(e){return(OV[e]||e).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function DV(e){return YP.includes(e)}function bv(e,t){return t===void 0&&(t=","),e.split(t)}function xv(e,t,n){t===void 0&&(t="+");var r=e.toLocaleLowerCase().split(t).map(function(i){return La(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!YP.includes(i)});return V1({},o,{keys:s,description:n})}(function(){typeof document<"u"&&(document.addEventListener("keydown",function(e){e.key!==void 0&&QP([La(e.key),La(e.code)])}),document.addEventListener("keyup",function(e){e.key!==void 0&&ZP([La(e.key),La(e.code)])})),typeof window<"u"&&window.addEventListener("blur",function(){za.clear()})})();var za=new Set;function Ux(e){return Array.isArray(e)}function zp(e,t){t===void 0&&(t=",");var n=Ux(e)?e:e.split(t);return n.every(function(r){return za.has(r.trim().toLowerCase())})}function QP(e){var t=Array.isArray(e)?e:[e];za.has("meta")&&za.forEach(function(n){return!DV(n)&&za.delete(n.toLowerCase())}),t.forEach(function(n){return za.add(n.toLowerCase())})}function ZP(e){var t=Array.isArray(e)?e:[e];e==="meta"?za.clear():t.forEach(function(n){return za.delete(n.toLowerCase())})}function RV(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function AV(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function NV(e){return JP(e,["input","textarea","select"])}function JP(e,t){var n=e.target;t===void 0&&(t=!1);var r=n&&n.tagName;return Ux(t)?!!(r&&t&&t.some(function(o){return o.toLowerCase()===r.toLowerCase()})):!!(r&&t&&t===!0)}function TV(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 $V=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,h=t.key,m=t.code,v=t.ctrlKey,b=t.metaKey,y=t.shiftKey,x=t.altKey,w=La(m),k=h.toLowerCase();if(!r){if(o===!x&&k!=="alt"||l===!y&&k!=="shift")return!1;if(i){if(!b&&!v)return!1}else if(s===!b&&k!=="meta"&&k!=="os"||u===!v&&k!=="ctrl"&&k!=="control")return!1}return p&&p.length===1&&(p.includes(k)||p.includes(w))?!0:p?zp(p):!p},LV=d.createContext(void 0),zV=function(){return d.useContext(LV)};function eI(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&&eI(e[r],t[r])},!0):e===t}var FV=d.createContext({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),BV=function(){return d.useContext(FV)};function HV(e){var t=d.useRef(void 0);return eI(t.current,e)||(t.current=e),t.current}var ES=function(t){t.stopPropagation(),t.preventDefault(),t.stopImmediatePropagation()},WV=typeof window<"u"?d.useLayoutEffect:d.useEffect;function Ze(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=Ux(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??[]),h=d.useRef(p);u?h.current=p:h.current=t;var m=HV(i),v=BV(),b=v.enabledScopes,y=zV();return WV(function(){if(!((m==null?void 0:m.enabled)===!1||!TV(b,m==null?void 0:m.scopes))){var x=function(I,E){var M;if(E===void 0&&(E=!1),!(NV(I)&&!JP(I,m==null?void 0:m.enableOnFormTags))&&!(m!=null&&m.ignoreEventWhen!=null&&m.ignoreEventWhen(I))){if(o.current!==null&&document.activeElement!==o.current&&!o.current.contains(document.activeElement)){ES(I);return}(M=I.target)!=null&&M.isContentEditable&&!(m!=null&&m.enableOnContentEditable)||bv(l,m==null?void 0:m.splitKey).forEach(function(D){var R,A=xv(D,m==null?void 0:m.combinationKey);if($V(I,A,m==null?void 0:m.ignoreModifiers)||(R=A.keys)!=null&&R.includes("*")){if(E&&s.current)return;if(RV(I,A,m==null?void 0:m.preventDefault),!AV(I,A,m==null?void 0:m.enabled)){ES(I);return}h.current(I,A),E||(s.current=!0)}})}},w=function(I){I.key!==void 0&&(QP(La(I.code)),((m==null?void 0:m.keydown)===void 0&&(m==null?void 0:m.keyup)!==!0||m!=null&&m.keydown)&&x(I))},k=function(I){I.key!==void 0&&(ZP(La(I.code)),s.current=!1,m!=null&&m.keyup&&x(I,!0))},_=o.current||(i==null?void 0:i.document)||document;return _.addEventListener("keyup",k),_.addEventListener("keydown",w),y&&bv(l,m==null?void 0:m.splitKey).forEach(function(j){return y.addHotkey(xv(j,m==null?void 0:m.combinationKey,m==null?void 0:m.description))}),function(){_.removeEventListener("keyup",k),_.removeEventListener("keydown",w),y&&bv(l,m==null?void 0:m.splitKey).forEach(function(j){return y.removeHotkey(xv(j,m==null?void 0:m.combinationKey,m==null?void 0:m.description))})}}},[l,m,b]),o}const VV=e=>{const{isDragAccept:t,isDragReject:n,setIsHandlingUpload:r}=e;return Ze("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($,{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($,{sx:{position:"absolute",top:0,insetInlineStart:0,width:"full",height:"full",alignItems:"center",justifyContent:"center",p:4},children:a.jsx($,{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(io,{size:"lg",children:"Drop to Upload"}):a.jsxs(a.Fragment,{children:[a.jsx(io,{size:"lg",children:"Invalid Upload"}),a.jsx(io,{size:"md",children:"Must be single JPEG or PNG image"})]})})})]})},UV=d.memo(VV),GV=ie([xe,wn],({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}},we),KV=e=>{const{children:t}=e,{autoAddBoardId:n,postUploadAction:r}=L(GV),o=L(En),s=tl(),{t:i}=Z(),[l,u]=d.useState(!1),[p]=$j(),h=d.useCallback(j=>{u(!0),s({title:i("toast.uploadFailed"),description:j.errors.map(I=>I.message).join(`
`),status:"error"})},[i,s]),m=d.useCallback(async j=>{p({file:j,image_category:"user",is_intermediate:!1,postUploadAction:r,board_id:n==="none"?void 0:n})},[n,r,p]),v=d.useCallback((j,I)=>{if(I.length>1){s({title:i("toast.uploadFailed"),description:i("toast.uploadFailedInvalidUploadDesc"),status:"error"});return}I.forEach(E=>{h(E)}),j.forEach(E=>{m(E)})},[i,s,m,h]),{getRootProps:b,getInputProps:y,isDragAccept:x,isDragReject:w,isDragActive:k,inputRef:_}=Vx({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},noClick:!0,onDrop:v,onDragOver:()=>u(!0),disabled:o,multiple:!1});return d.useEffect(()=>{const j=async I=>{var E,M;_.current&&(E=I.clipboardData)!=null&&E.files&&(_.current.files=I.clipboardData.files,(M=_.current)==null||M.dispatchEvent(new Event("change",{bubbles:!0})))};return document.addEventListener("paste",j),()=>{document.removeEventListener("paste",j)}},[_]),a.jsxs(Ie,{...b({style:{}}),onKeyDown:j=>{j.key},children:[a.jsx("input",{...y()}),t,a.jsx(nr,{children:k&&l&&a.jsx(vn.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}},children:a.jsx(UV,{isDragAccept:x,isDragReject:w,setIsHandlingUpload:u})},"image-upload-overlay")})]})},qV=d.memo(KV),XV=Pe((e,t)=>{const{children:n,tooltip:r="",tooltipProps:{placement:o="top",hasArrow:s=!0,...i}={},isChecked:l,...u}=e;return a.jsx(Rt,{label:r,placement:o,hasArrow:s,...i,children:a.jsx(bc,{ref:t,colorScheme:l?"accent":"base",...u,children:n})})}),it=d.memo(XV);function YV(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 tI(e){return Array.isArray(e)?e:[e]}const QV=()=>{};function ZV(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||QV:n=>{var r;n.key==="Escape"&&(e(n),(r=t.onTrigger)==null||r.call(t))}}function nI({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 rI(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==H.Fragment:!1}function oI(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=oI(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function sI(){for(var e=0,t,n,r="";e<arguments.length;)(t=arguments[e++])&&(n=oI(t))&&(r&&(r+=" "),r+=n);return r}const JV={app:100,modal:200,popover:300,overlay:400,max:9999};function Gx(e){return JV[e]}function eU(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 tU=U7({key:"mantine",prepend:!0});function nU(){return j5()||tU}var rU=Object.defineProperty,MS=Object.getOwnPropertySymbols,oU=Object.prototype.hasOwnProperty,sU=Object.prototype.propertyIsEnumerable,OS=(e,t,n)=>t in e?rU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,aU=(e,t)=>{for(var n in t||(t={}))oU.call(t,n)&&OS(e,n,t[n]);if(MS)for(var n of MS(t))sU.call(t,n)&&OS(e,n,t[n]);return e};const yv="ref";function iU(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(!(yv in n))return{args:e,ref:t};t=n[yv];const r=aU({},n);return delete r[yv],{args:[r],ref:t}}const{cssFactory:lU}=(()=>{function e(n,r,o){const s=[],i=q7(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}=iU(i),p=G7(u,r.registered);return K7(r,p,!1),`${r.key}-${p.name}${l===void 0?"":` ${l}`}`};return{css:o,cx:(...i)=>e(r.registered,o,sI(i))}}return{cssFactory:t}})();function aI(){const e=nU();return eU(()=>lU({cache:e}),[e])}function cU({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 uU=Object.defineProperty,DS=Object.getOwnPropertySymbols,dU=Object.prototype.hasOwnProperty,fU=Object.prototype.propertyIsEnumerable,RS=(e,t,n)=>t in e?uU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Cv=(e,t)=>{for(var n in t||(t={}))dU.call(t,n)&&RS(e,n,t[n]);if(DS)for(var n of DS(t))fU.call(t,n)&&RS(e,n,t[n]);return e};function U1(e,t){return t&&Object.keys(t).forEach(n=>{e[n]?e[n]=Cv(Cv({},e[n]),t[n]):e[n]=Cv({},t[n])}),e}function AS(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)=>U1(s,i),{}):o(e)}function pU({ctx:e,theme:t,params:n,variant:r,size:o}){return e.reduce((s,i)=>(i.variants&&r in i.variants&&U1(s,i.variants[r](t,n,{variant:r,size:o})),i.sizes&&o in i.sizes&&U1(s,i.sizes[o](t,n,{variant:r,size:o})),s),{})}function or(e){const t=typeof e=="function"?e:()=>e;function n(r,o){const s=ua(),i=jN(o==null?void 0:o.name),l=j5(),u={variant:o==null?void 0:o.variant,size:o==null?void 0:o.size},{css:p,cx:h}=aI(),m=t(s,r,u),v=AS(o==null?void 0:o.styles,s,r,u),b=AS(i,s,r,u),y=pU({ctx:i,theme:s,params:r,variant:o==null?void 0:o.variant,size:o==null?void 0:o.size}),x=Object.fromEntries(Object.keys(m).map(w=>{const k=h({[p(m[w])]:!(o!=null&&o.unstyled)},p(y[w]),p(b[w]),p(v[w]));return[w,k]}));return{classes:cU({cx:h,classes:x,context:i,classNames:o==null?void 0:o.classNames,name:o==null?void 0:o.name,cache:l}),cx:h,theme:s}}return n}function NS(e){return`___ref-${e||""}`}var hU=Object.defineProperty,mU=Object.defineProperties,gU=Object.getOwnPropertyDescriptors,TS=Object.getOwnPropertySymbols,vU=Object.prototype.hasOwnProperty,bU=Object.prototype.propertyIsEnumerable,$S=(e,t,n)=>t in e?hU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wu=(e,t)=>{for(var n in t||(t={}))vU.call(t,n)&&$S(e,n,t[n]);if(TS)for(var n of TS(t))bU.call(t,n)&&$S(e,n,t[n]);return e},Su=(e,t)=>mU(e,gU(t));const ku={in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${Oe(10)})`},transitionProperty:"transform, opacity"},op={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(-${Oe(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(${Oe(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(${Oe(20)}) rotate(-5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${Oe(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"}})},LS=["mousedown","touchstart"];function xU(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||LS).forEach(s=>document.addEventListener(s,o)),()=>{(t||LS).forEach(s=>document.removeEventListener(s,o))}},[r,e,n]),r}function yU(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function CU(e,t){return typeof t=="boolean"?t:typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function wU(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,o]=d.useState(n?t:CU(e,t)),s=d.useRef();return d.useEffect(()=>{if("matchMedia"in window)return s.current=window.matchMedia(e),o(s.current.matches),yU(s.current,i=>o(i.matches))},[e]),r}const iI=typeof document<"u"?d.useLayoutEffect:d.useEffect;function $o(e,t){const n=d.useRef(!1);d.useEffect(()=>()=>{n.current=!1},[]),d.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function SU({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 $o(()=>{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 kU=/input|select|textarea|button|object/,lI="a, input, select, textarea, button, object, [tabindex]";function _U(e){return e.style.display==="none"}function jU(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(_U(n))return!1;n=n.parentNode}return!0}function cI(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function G1(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(cI(e));return(kU.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&jU(e)}function uI(e){const t=cI(e);return(Number.isNaN(t)||t>=0)&&G1(e)}function PU(e){return Array.from(e.querySelectorAll(lI)).filter(uI)}function IU(e,t){const n=PU(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 Kx(){return`mantine-${Math.random().toString(36).slice(2,11)}`}function EU(e,t="body > :not(script)"){const n=Kx(),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 MU(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(lI));i=l.find(uI)||l.find(G1)||null,!i&&G1(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=EU(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&&IU(t.current,i)};return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s),n.current&&n.current()}},[e]),o}const OU=H["useId".toString()]||(()=>{});function DU(){const e=OU();return e?`mantine-${e.replace(/:/g,"")}`:""}function qx(e){const t=DU(),[n,r]=d.useState(t);return iI(()=>{r(Kx())},[]),typeof e=="string"?e:typeof window>"u"?t:n}function zS(e,t,n){d.useEffect(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function dI(e,t){typeof e=="function"?e(t):typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function RU(...e){return t=>{e.forEach(n=>dI(n,t))}}function Bd(...e){return d.useCallback(RU(...e),e)}function ad({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 fI(e,t){return wU("(prefers-reduced-motion: reduce)",e,t)}const AU=e=>e<.5?2*e*e:-1+(4-2*e)*e,NU=({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(),h=m=>p[m]-u[m];if(e==="y"){const m=h("top");if(m===0)return 0;if(r==="start"){const b=m-o;return b<=p.height*(s?0:1)||!s?b:0}const v=i?u.height:window.innerHeight;if(r==="end"){const b=m+o-v+p.height;return b>=-p.height*(s?0:1)||!s?b:0}return r==="center"?m-v/2+p.height/2:0}if(e==="x"){const m=h("left");if(m===0)return 0;if(r==="start"){const b=m-o;return b<=p.width||!s?b:0}const v=i?u.width:window.innerWidth;if(r==="end"){const b=m+o-v+p.width;return b>=-p.width||!s?b:0}return r==="center"?m-v/2+p.width/2:0}return 0},TU=({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]},$U=({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 pI({duration:e=1250,axis:t="y",onScrollFinish:n,easing:r=AU,offset:o=0,cancelable:s=!0,isList:i=!1}={}){const l=d.useRef(0),u=d.useRef(0),p=d.useRef(!1),h=d.useRef(null),m=d.useRef(null),v=fI(),b=()=>{l.current&&cancelAnimationFrame(l.current)},y=d.useCallback(({alignment:w="start"}={})=>{var k;p.current=!1,l.current&&b();const _=(k=TU({parent:h.current,axis:t}))!=null?k:0,j=NU({parent:h.current,target:m.current,axis:t,alignment:w,offset:o,isList:i})-(h.current?0:_);function I(){u.current===0&&(u.current=performance.now());const M=performance.now()-u.current,D=v||e===0?1:M/e,R=_+j*r(D);$U({parent:h.current,axis:t,distance:R}),!p.current&&D<1?l.current=requestAnimationFrame(I):(typeof n=="function"&&n(),u.current=0,l.current=0,b())}I()},[t,e,r,i,o,n,v]),x=()=>{s&&(p.current=!0)};return zS("wheel",x,{passive:!0}),zS("touchmove",x,{passive:!0}),d.useEffect(()=>b,[]),{scrollableRef:h,targetRef:m,scrollIntoView:y,cancel:b}}var FS=Object.getOwnPropertySymbols,LU=Object.prototype.hasOwnProperty,zU=Object.prototype.propertyIsEnumerable,FU=(e,t)=>{var n={};for(var r in e)LU.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&FS)for(var r of FS(e))t.indexOf(r)<0&&zU.call(e,r)&&(n[r]=e[r]);return n};function Xm(e){const t=e,{m:n,mx:r,my:o,mt:s,mb:i,ml:l,mr:u,p,px:h,py:m,pt:v,pb:b,pl:y,pr:x,bg:w,c:k,opacity:_,ff:j,fz:I,fw:E,lts:M,ta:D,lh:R,fs:A,tt:O,td:T,w:K,miw:F,maw:V,h:X,mih:W,mah:z,bgsz:Y,bgp:B,bgr:q,bga:re,pos:Q,top:le,left:se,bottom:U,right:G,inset:te,display:ae}=t,oe=FU(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:PN({m:n,mx:r,my:o,mt:s,mb:i,ml:l,mr:u,p,px:h,py:m,pt:v,pb:b,pl:y,pr:x,bg:w,c:k,opacity:_,ff:j,fz:I,fw:E,lts:M,ta:D,lh:R,fs:A,tt:O,td:T,w:K,miw:F,maw:V,h:X,mih:W,mah:z,bgsz:Y,bgp:B,bgr:q,bga:re,pos:Q,top:le,left:se,bottom:U,right:G,inset:te,display:ae}),rest:oe}}function BU(e,t){const n=Object.keys(e).filter(r=>r!=="base").sort((r,o)=>jw(ut({size:r,sizes:t.breakpoints}))-jw(ut({size:o,sizes:t.breakpoints})));return"base"in e?["base",...n]:n}function HU({value:e,theme:t,getValue:n,property:r}){if(e==null)return;if(typeof e=="object")return BU(e,t).reduce((i,l)=>{if(l==="base"&&e.base!==void 0){const p=n(e.base,t);return Array.isArray(r)?(r.forEach(h=>{i[h]=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 WU(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 VU(e){return Oe(e)}function UU(e){return e}function GU(e,t){return ut({size:e,sizes:t.fontSizes})}const KU=["-xs","-sm","-md","-lg","-xl"];function qU(e,t){return KU.includes(e)?`calc(${ut({size:e.replace("-",""),sizes:t.spacing})} * -1)`:ut({size:e,sizes:t.spacing})}const XU={identity:UU,color:WU,size:VU,fontSize:GU,spacing:qU},YU={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 QU=Object.defineProperty,BS=Object.getOwnPropertySymbols,ZU=Object.prototype.hasOwnProperty,JU=Object.prototype.propertyIsEnumerable,HS=(e,t,n)=>t in e?QU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,WS=(e,t)=>{for(var n in t||(t={}))ZU.call(t,n)&&HS(e,n,t[n]);if(BS)for(var n of BS(t))JU.call(t,n)&&HS(e,n,t[n]);return e};function VS(e,t,n=YU){return Object.keys(n).reduce((o,s)=>(s in e&&e[s]!==void 0&&o.push(HU({value:e[s],getValue:XU[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]=WS(WS({},o[i]),s[i]):o[i]=s[i]}),o),{})}function US(e,t){return typeof e=="function"?e(t):e}function eG(e,t,n){const r=ua(),{css:o,cx:s}=aI();return Array.isArray(e)?s(n,o(VS(t,r)),e.map(i=>o(US(i,r)))):s(n,o(US(e,r)),o(VS(t,r)))}var tG=Object.defineProperty,dh=Object.getOwnPropertySymbols,hI=Object.prototype.hasOwnProperty,mI=Object.prototype.propertyIsEnumerable,GS=(e,t,n)=>t in e?tG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nG=(e,t)=>{for(var n in t||(t={}))hI.call(t,n)&&GS(e,n,t[n]);if(dh)for(var n of dh(t))mI.call(t,n)&&GS(e,n,t[n]);return e},rG=(e,t)=>{var n={};for(var r in e)hI.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&dh)for(var r of dh(e))t.indexOf(r)<0&&mI.call(e,r)&&(n[r]=e[r]);return n};const gI=d.forwardRef((e,t)=>{var n=e,{className:r,component:o,style:s,sx:i}=n,l=rG(n,["className","component","style","sx"]);const{systemStyles:u,rest:p}=Xm(l),h=o||"div";return H.createElement(h,nG({ref:t,className:eG(i,u,r),style:s},p))});gI.displayName="@mantine/core/Box";const Or=gI;var oG=Object.defineProperty,sG=Object.defineProperties,aG=Object.getOwnPropertyDescriptors,KS=Object.getOwnPropertySymbols,iG=Object.prototype.hasOwnProperty,lG=Object.prototype.propertyIsEnumerable,qS=(e,t,n)=>t in e?oG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,XS=(e,t)=>{for(var n in t||(t={}))iG.call(t,n)&&qS(e,n,t[n]);if(KS)for(var n of KS(t))lG.call(t,n)&&qS(e,n,t[n]);return e},cG=(e,t)=>sG(e,aG(t)),uG=or(e=>({root:cG(XS(XS({},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 dG=uG;var fG=Object.defineProperty,fh=Object.getOwnPropertySymbols,vI=Object.prototype.hasOwnProperty,bI=Object.prototype.propertyIsEnumerable,YS=(e,t,n)=>t in e?fG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pG=(e,t)=>{for(var n in t||(t={}))vI.call(t,n)&&YS(e,n,t[n]);if(fh)for(var n of fh(t))bI.call(t,n)&&YS(e,n,t[n]);return e},hG=(e,t)=>{var n={};for(var r in e)vI.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&fh)for(var r of fh(e))t.indexOf(r)<0&&bI.call(e,r)&&(n[r]=e[r]);return n};const xI=d.forwardRef((e,t)=>{const n=Sn("UnstyledButton",{},e),{className:r,component:o="button",unstyled:s,variant:i}=n,l=hG(n,["className","component","unstyled","variant"]),{classes:u,cx:p}=dG(null,{name:"UnstyledButton",unstyled:s,variant:i});return H.createElement(Or,pG({component:o,ref:t,className:p(u.root,r),type:o==="button"?"button":void 0},l))});xI.displayName="@mantine/core/UnstyledButton";const mG=xI;var gG=Object.defineProperty,vG=Object.defineProperties,bG=Object.getOwnPropertyDescriptors,QS=Object.getOwnPropertySymbols,xG=Object.prototype.hasOwnProperty,yG=Object.prototype.propertyIsEnumerable,ZS=(e,t,n)=>t in e?gG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,K1=(e,t)=>{for(var n in t||(t={}))xG.call(t,n)&&ZS(e,n,t[n]);if(QS)for(var n of QS(t))yG.call(t,n)&&ZS(e,n,t[n]);return e},JS=(e,t)=>vG(e,bG(t));const CG=["subtle","filled","outline","light","default","transparent","gradient"],sp={xs:Oe(18),sm:Oe(22),md:Oe(28),lg:Oe(34),xl:Oe(44)};function wG({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%"})}:CG.includes(e)?K1({border:`${Oe(1)} solid ${o.border}`,backgroundColor:o.background,color:o.color},t.fn.hover({backgroundColor:o.hover})):null}var SG=or((e,{radius:t,color:n,gradient:r},{variant:o,size:s})=>({root:JS(K1({position:"relative",borderRadius:e.fn.radius(t),padding:0,lineHeight:1,display:"flex",alignItems:"center",justifyContent:"center",height:ut({size:s,sizes:sp}),minHeight:ut({size:s,sizes:sp}),width:ut({size:s,sizes:sp}),minWidth:ut({size:s,sizes:sp})},wG({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":JS(K1({content:'""'},e.fn.cover(Oe(-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 kG=SG;var _G=Object.defineProperty,ph=Object.getOwnPropertySymbols,yI=Object.prototype.hasOwnProperty,CI=Object.prototype.propertyIsEnumerable,e4=(e,t,n)=>t in e?_G(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,t4=(e,t)=>{for(var n in t||(t={}))yI.call(t,n)&&e4(e,n,t[n]);if(ph)for(var n of ph(t))CI.call(t,n)&&e4(e,n,t[n]);return e},n4=(e,t)=>{var n={};for(var r in e)yI.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ph)for(var r of ph(e))t.indexOf(r)<0&&CI.call(e,r)&&(n[r]=e[r]);return n};function jG(e){var t=e,{size:n,color:r}=t,o=n4(t,["size","color"]);const s=o,{style:i}=s,l=n4(s,["style"]);return H.createElement("svg",t4({viewBox:"0 0 135 140",xmlns:"http://www.w3.org/2000/svg",fill:r,style:t4({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 PG=Object.defineProperty,hh=Object.getOwnPropertySymbols,wI=Object.prototype.hasOwnProperty,SI=Object.prototype.propertyIsEnumerable,r4=(e,t,n)=>t in e?PG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,o4=(e,t)=>{for(var n in t||(t={}))wI.call(t,n)&&r4(e,n,t[n]);if(hh)for(var n of hh(t))SI.call(t,n)&&r4(e,n,t[n]);return e},s4=(e,t)=>{var n={};for(var r in e)wI.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&hh)for(var r of hh(e))t.indexOf(r)<0&&SI.call(e,r)&&(n[r]=e[r]);return n};function IG(e){var t=e,{size:n,color:r}=t,o=s4(t,["size","color"]);const s=o,{style:i}=s,l=s4(s,["style"]);return H.createElement("svg",o4({viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:r,style:o4({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 EG=Object.defineProperty,mh=Object.getOwnPropertySymbols,kI=Object.prototype.hasOwnProperty,_I=Object.prototype.propertyIsEnumerable,a4=(e,t,n)=>t in e?EG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,i4=(e,t)=>{for(var n in t||(t={}))kI.call(t,n)&&a4(e,n,t[n]);if(mh)for(var n of mh(t))_I.call(t,n)&&a4(e,n,t[n]);return e},l4=(e,t)=>{var n={};for(var r in e)kI.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&mh)for(var r of mh(e))t.indexOf(r)<0&&_I.call(e,r)&&(n[r]=e[r]);return n};function MG(e){var t=e,{size:n,color:r}=t,o=l4(t,["size","color"]);const s=o,{style:i}=s,l=l4(s,["style"]);return H.createElement("svg",i4({viewBox:"0 0 120 30",xmlns:"http://www.w3.org/2000/svg",fill:r,style:i4({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 OG=Object.defineProperty,gh=Object.getOwnPropertySymbols,jI=Object.prototype.hasOwnProperty,PI=Object.prototype.propertyIsEnumerable,c4=(e,t,n)=>t in e?OG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,DG=(e,t)=>{for(var n in t||(t={}))jI.call(t,n)&&c4(e,n,t[n]);if(gh)for(var n of gh(t))PI.call(t,n)&&c4(e,n,t[n]);return e},RG=(e,t)=>{var n={};for(var r in e)jI.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&gh)for(var r of gh(e))t.indexOf(r)<0&&PI.call(e,r)&&(n[r]=e[r]);return n};const wv={bars:jG,oval:IG,dots:MG},AG={xs:Oe(18),sm:Oe(22),md:Oe(36),lg:Oe(44),xl:Oe(58)},NG={size:"md"};function II(e){const t=Sn("Loader",NG,e),{size:n,color:r,variant:o}=t,s=RG(t,["size","color","variant"]),i=ua(),l=o in wv?o:i.loader;return H.createElement(Or,DG({role:"presentation",component:wv[l]||wv.bars,size:ut({size:n,sizes:AG}),color:i.fn.variant({variant:"filled",primaryFallback:!1,color:r||i.primaryColor}).background},s))}II.displayName="@mantine/core/Loader";var TG=Object.defineProperty,vh=Object.getOwnPropertySymbols,EI=Object.prototype.hasOwnProperty,MI=Object.prototype.propertyIsEnumerable,u4=(e,t,n)=>t in e?TG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,d4=(e,t)=>{for(var n in t||(t={}))EI.call(t,n)&&u4(e,n,t[n]);if(vh)for(var n of vh(t))MI.call(t,n)&&u4(e,n,t[n]);return e},$G=(e,t)=>{var n={};for(var r in e)EI.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&vh)for(var r of vh(e))t.indexOf(r)<0&&MI.call(e,r)&&(n[r]=e[r]);return n};const LG={color:"gray",size:"md",variant:"subtle"},OI=d.forwardRef((e,t)=>{const n=Sn("ActionIcon",LG,e),{className:r,color:o,children:s,radius:i,size:l,variant:u,gradient:p,disabled:h,loaderProps:m,loading:v,unstyled:b,__staticSelector:y}=n,x=$G(n,["className","color","children","radius","size","variant","gradient","disabled","loaderProps","loading","unstyled","__staticSelector"]),{classes:w,cx:k,theme:_}=kG({radius:i,color:o,gradient:p},{name:["ActionIcon",y],unstyled:b,size:l,variant:u}),j=H.createElement(II,d4({color:_.fn.variant({color:o,variant:u}).color,size:"100%","data-action-icon-loader":!0},m));return H.createElement(mG,d4({className:k(w.root,r),ref:t,disabled:h,"data-disabled":h||void 0,"data-loading":v||void 0,unstyled:b},x),v?j:s)});OI.displayName="@mantine/core/ActionIcon";const zG=OI;var FG=Object.defineProperty,BG=Object.defineProperties,HG=Object.getOwnPropertyDescriptors,bh=Object.getOwnPropertySymbols,DI=Object.prototype.hasOwnProperty,RI=Object.prototype.propertyIsEnumerable,f4=(e,t,n)=>t in e?FG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,WG=(e,t)=>{for(var n in t||(t={}))DI.call(t,n)&&f4(e,n,t[n]);if(bh)for(var n of bh(t))RI.call(t,n)&&f4(e,n,t[n]);return e},VG=(e,t)=>BG(e,HG(t)),UG=(e,t)=>{var n={};for(var r in e)DI.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&bh)for(var r of bh(e))t.indexOf(r)<0&&RI.call(e,r)&&(n[r]=e[r]);return n};function AI(e){const t=Sn("Portal",{},e),{children:n,target:r,className:o,innerRef:s}=t,i=UG(t,["children","target","className","innerRef"]),l=ua(),[u,p]=d.useState(!1),h=d.useRef();return iI(()=>(p(!0),h.current=r?typeof r=="string"?document.querySelector(r):r:document.createElement("div"),r||document.body.appendChild(h.current),()=>{!r&&document.body.removeChild(h.current)}),[r]),u?Fr.createPortal(H.createElement("div",VG(WG({className:o,dir:l.dir},i),{ref:s}),n),h.current):null}AI.displayName="@mantine/core/Portal";var GG=Object.defineProperty,xh=Object.getOwnPropertySymbols,NI=Object.prototype.hasOwnProperty,TI=Object.prototype.propertyIsEnumerable,p4=(e,t,n)=>t in e?GG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,KG=(e,t)=>{for(var n in t||(t={}))NI.call(t,n)&&p4(e,n,t[n]);if(xh)for(var n of xh(t))TI.call(t,n)&&p4(e,n,t[n]);return e},qG=(e,t)=>{var n={};for(var r in e)NI.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&xh)for(var r of xh(e))t.indexOf(r)<0&&TI.call(e,r)&&(n[r]=e[r]);return n};function $I(e){var t=e,{withinPortal:n=!0,children:r}=t,o=qG(t,["withinPortal","children"]);return n?H.createElement(AI,KG({},o),r):H.createElement(H.Fragment,null,r)}$I.displayName="@mantine/core/OptionalPortal";var XG=Object.defineProperty,yh=Object.getOwnPropertySymbols,LI=Object.prototype.hasOwnProperty,zI=Object.prototype.propertyIsEnumerable,h4=(e,t,n)=>t in e?XG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,m4=(e,t)=>{for(var n in t||(t={}))LI.call(t,n)&&h4(e,n,t[n]);if(yh)for(var n of yh(t))zI.call(t,n)&&h4(e,n,t[n]);return e},YG=(e,t)=>{var n={};for(var r in e)LI.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&yh)for(var r of yh(e))t.indexOf(r)<0&&zI.call(e,r)&&(n[r]=e[r]);return n};function FI(e){const t=e,{width:n,height:r,style:o}=t,s=YG(t,["width","height","style"]);return H.createElement("svg",m4({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:m4({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"}))}FI.displayName="@mantine/core/CloseIcon";var QG=Object.defineProperty,Ch=Object.getOwnPropertySymbols,BI=Object.prototype.hasOwnProperty,HI=Object.prototype.propertyIsEnumerable,g4=(e,t,n)=>t in e?QG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ZG=(e,t)=>{for(var n in t||(t={}))BI.call(t,n)&&g4(e,n,t[n]);if(Ch)for(var n of Ch(t))HI.call(t,n)&&g4(e,n,t[n]);return e},JG=(e,t)=>{var n={};for(var r in e)BI.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ch)for(var r of Ch(e))t.indexOf(r)<0&&HI.call(e,r)&&(n[r]=e[r]);return n};const eK={xs:Oe(12),sm:Oe(16),md:Oe(20),lg:Oe(28),xl:Oe(34)},tK={size:"sm"},WI=d.forwardRef((e,t)=>{const n=Sn("CloseButton",tK,e),{iconSize:r,size:o,children:s}=n,i=JG(n,["iconSize","size","children"]),l=Oe(r||eK[o]);return H.createElement(zG,ZG({ref:t,__staticSelector:"CloseButton",size:o},i),s||H.createElement(FI,{width:l,height:l}))});WI.displayName="@mantine/core/CloseButton";const VI=WI;var nK=Object.defineProperty,rK=Object.defineProperties,oK=Object.getOwnPropertyDescriptors,v4=Object.getOwnPropertySymbols,sK=Object.prototype.hasOwnProperty,aK=Object.prototype.propertyIsEnumerable,b4=(e,t,n)=>t in e?nK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ap=(e,t)=>{for(var n in t||(t={}))sK.call(t,n)&&b4(e,n,t[n]);if(v4)for(var n of v4(t))aK.call(t,n)&&b4(e,n,t[n]);return e},iK=(e,t)=>rK(e,oK(t));function lK({underline:e,strikethrough:t}){const n=[];return e&&n.push("underline"),t&&n.push("line-through"),n.length>0?n.join(" "):"none"}function cK({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 uK(e){return typeof e=="number"?{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical"}:null}function dK({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 fK=or((e,{color:t,lineClamp:n,truncate:r,inline:o,inherit:s,underline:i,gradient:l,weight:u,transform:p,align:h,strikethrough:m,italic:v},{size:b})=>{const y=e.fn.variant({variant:"gradient",gradient:l});return{root:iK(ap(ap(ap(ap({},e.fn.fontStyles()),e.fn.focusStyles()),uK(n)),dK({theme:e,truncate:r})),{color:cK({color:t,theme:e}),fontFamily:s?"inherit":e.fontFamily,fontSize:s||b===void 0?"inherit":ut({size:b,sizes:e.fontSizes}),lineHeight:s?"inherit":o?1:e.lineHeight,textDecoration:lK({underline:i,strikethrough:m}),WebkitTapHighlightColor:"transparent",fontWeight:s?"inherit":u,textTransform:p,textAlign:h,fontStyle:v?"italic":void 0}),gradient:{backgroundImage:y.background,WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"}}});const pK=fK;var hK=Object.defineProperty,wh=Object.getOwnPropertySymbols,UI=Object.prototype.hasOwnProperty,GI=Object.prototype.propertyIsEnumerable,x4=(e,t,n)=>t in e?hK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mK=(e,t)=>{for(var n in t||(t={}))UI.call(t,n)&&x4(e,n,t[n]);if(wh)for(var n of wh(t))GI.call(t,n)&&x4(e,n,t[n]);return e},gK=(e,t)=>{var n={};for(var r in e)UI.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&wh)for(var r of wh(e))t.indexOf(r)<0&&GI.call(e,r)&&(n[r]=e[r]);return n};const vK={variant:"text"},KI=d.forwardRef((e,t)=>{const n=Sn("Text",vK,e),{className:r,size:o,weight:s,transform:i,color:l,align:u,variant:p,lineClamp:h,truncate:m,gradient:v,inline:b,inherit:y,underline:x,strikethrough:w,italic:k,classNames:_,styles:j,unstyled:I,span:E,__staticSelector:M}=n,D=gK(n,["className","size","weight","transform","color","align","variant","lineClamp","truncate","gradient","inline","inherit","underline","strikethrough","italic","classNames","styles","unstyled","span","__staticSelector"]),{classes:R,cx:A}=pK({color:l,lineClamp:h,truncate:m,inline:b,inherit:y,underline:x,strikethrough:w,italic:k,weight:s,transform:i,align:u,gradient:v},{unstyled:I,name:M||"Text",variant:p,size:o});return H.createElement(Or,mK({ref:t,className:A(R.root,{[R.gradient]:p==="gradient"},r),component:E?"span":"div"},D))});KI.displayName="@mantine/core/Text";const kc=KI,ip={xs:Oe(1),sm:Oe(2),md:Oe(3),lg:Oe(4),xl:Oe(5)};function lp(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 bK=or((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:Oe(1),borderTop:`${ut({size:n,sizes:ip})} ${r} ${lp(e,t)}`,marginRight:e.spacing.xs},"&::after":{content:'""',flex:1,borderTop:`${ut({size:n,sizes:ip})} ${r} ${lp(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:Oe(ut({size:n,sizes:ip})),borderTopColor:lp(e,t),borderTopStyle:r,margin:0},vertical:{border:0,alignSelf:"stretch",height:"auto",borderLeftWidth:Oe(ut({size:n,sizes:ip})),borderLeftColor:lp(e,t),borderLeftStyle:r}}));const xK=bK;var yK=Object.defineProperty,CK=Object.defineProperties,wK=Object.getOwnPropertyDescriptors,Sh=Object.getOwnPropertySymbols,qI=Object.prototype.hasOwnProperty,XI=Object.prototype.propertyIsEnumerable,y4=(e,t,n)=>t in e?yK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,C4=(e,t)=>{for(var n in t||(t={}))qI.call(t,n)&&y4(e,n,t[n]);if(Sh)for(var n of Sh(t))XI.call(t,n)&&y4(e,n,t[n]);return e},SK=(e,t)=>CK(e,wK(t)),kK=(e,t)=>{var n={};for(var r in e)qI.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Sh)for(var r of Sh(e))t.indexOf(r)<0&&XI.call(e,r)&&(n[r]=e[r]);return n};const _K={orientation:"horizontal",size:"xs",labelPosition:"left",variant:"solid"},q1=d.forwardRef((e,t)=>{const n=Sn("Divider",_K,e),{className:r,color:o,orientation:s,size:i,label:l,labelPosition:u,labelProps:p,variant:h,styles:m,classNames:v,unstyled:b}=n,y=kK(n,["className","color","orientation","size","label","labelPosition","labelProps","variant","styles","classNames","unstyled"]),{classes:x,cx:w}=xK({color:o},{classNames:v,styles:m,unstyled:b,name:"Divider",variant:h,size:i}),k=s==="vertical",_=s==="horizontal",j=!!l&&_,I=!(p!=null&&p.color);return H.createElement(Or,C4({ref:t,className:w(x.root,{[x.vertical]:k,[x.horizontal]:_,[x.withLabel]:j},r),role:"separator"},y),j&&H.createElement(kc,SK(C4({},p),{size:(p==null?void 0:p.size)||"xs",mt:Oe(2),className:w(x.label,x[u],{[x.labelDefaultStyles]:I})}),l))});q1.displayName="@mantine/core/Divider";var jK=Object.defineProperty,PK=Object.defineProperties,IK=Object.getOwnPropertyDescriptors,w4=Object.getOwnPropertySymbols,EK=Object.prototype.hasOwnProperty,MK=Object.prototype.propertyIsEnumerable,S4=(e,t,n)=>t in e?jK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,k4=(e,t)=>{for(var n in t||(t={}))EK.call(t,n)&&S4(e,n,t[n]);if(w4)for(var n of w4(t))MK.call(t,n)&&S4(e,n,t[n]);return e},OK=(e,t)=>PK(e,IK(t)),DK=or((e,t,{size:n})=>({item:OK(k4({},e.fn.fontStyles()),{boxSizing:"border-box",wordBreak:"break-all",textAlign:"left",width:"100%",padding:`calc(${ut({size:n,sizes:e.spacing})} / 1.5) ${ut({size:n,sizes:e.spacing})}`,cursor:"pointer",fontSize:ut({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]":k4({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(${ut({size:n,sizes:e.spacing})} / 2)`,paddingBottom:`calc(${ut({size:n,sizes:e.spacing})} / 2)`,textAlign:"center"},separator:{boxSizing:"border-box",textAlign:"left",width:"100%",padding:`calc(${ut({size:n,sizes:e.spacing})} / 1.5) ${ut({size:n,sizes:e.spacing})}`},separatorLabel:{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]}}));const RK=DK;var AK=Object.defineProperty,_4=Object.getOwnPropertySymbols,NK=Object.prototype.hasOwnProperty,TK=Object.prototype.propertyIsEnumerable,j4=(e,t,n)=>t in e?AK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$K=(e,t)=>{for(var n in t||(t={}))NK.call(t,n)&&j4(e,n,t[n]);if(_4)for(var n of _4(t))TK.call(t,n)&&j4(e,n,t[n]);return e};function Xx({data:e,hovered:t,classNames:n,styles:r,isItemSelected:o,uuid:s,__staticSelector:i,onItemHover:l,onItemSelect:u,itemsRefs:p,itemComponent:h,size:m,nothingFound:v,creatable:b,createLabel:y,unstyled:x,variant:w}){const{classes:k}=RK(null,{classNames:n,styles:r,unstyled:x,name:i,variant:w,size:m}),_=[],j=[];let I=null;const E=(D,R)=>{const A=typeof o=="function"?o(D.value):!1;return H.createElement(h,$K({key:D.value,className:k.item,"data-disabled":D.disabled||void 0,"data-hovered":!D.disabled&&t===R||void 0,"data-selected":!D.disabled&&A||void 0,selected:A,onMouseEnter:()=>l(R),id:`${s}-${R}`,role:"option",tabIndex:-1,"aria-selected":t===R,ref:O=>{p&&p.current&&(p.current[D.value]=O)},onMouseDown:D.disabled?null:O=>{O.preventDefault(),u(D)},disabled:D.disabled,variant:w},D))};let M=null;if(e.forEach((D,R)=>{D.creatable?I=R:D.group?(M!==D.group&&(M=D.group,j.push(H.createElement("div",{className:k.separator,key:`__mantine-divider-${R}`},H.createElement(q1,{classNames:{label:k.separatorLabel},label:D.group})))),j.push(E(D,R))):_.push(E(D,R))}),b){const D=e[I];_.push(H.createElement("div",{key:Kx(),className:k.item,"data-hovered":t===I||void 0,onMouseEnter:()=>l(I),onMouseDown:R=>{R.preventDefault(),u(D)},tabIndex:-1,ref:R=>{p&&p.current&&(p.current[D.value]=R)}},y))}return j.length>0&&_.length>0&&_.unshift(H.createElement("div",{className:k.separator,key:"empty-group-separator"},H.createElement(q1,null))),j.length>0||_.length>0?H.createElement(H.Fragment,null,j,_):H.createElement(kc,{size:m,unstyled:x,className:k.nothingFound},v)}Xx.displayName="@mantine/core/SelectItems";var LK=Object.defineProperty,kh=Object.getOwnPropertySymbols,YI=Object.prototype.hasOwnProperty,QI=Object.prototype.propertyIsEnumerable,P4=(e,t,n)=>t in e?LK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zK=(e,t)=>{for(var n in t||(t={}))YI.call(t,n)&&P4(e,n,t[n]);if(kh)for(var n of kh(t))QI.call(t,n)&&P4(e,n,t[n]);return e},FK=(e,t)=>{var n={};for(var r in e)YI.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&kh)for(var r of kh(e))t.indexOf(r)<0&&QI.call(e,r)&&(n[r]=e[r]);return n};const Yx=d.forwardRef((e,t)=>{var n=e,{label:r,value:o}=n,s=FK(n,["label","value"]);return H.createElement("div",zK({ref:t},s),r||o)});Yx.displayName="@mantine/core/DefaultItem";function BK(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function ZI(...e){return t=>e.forEach(n=>BK(n,t))}function nl(...e){return d.useCallback(ZI(...e),e)}const JI=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),s=o.find(WK);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(X1,rn({},r,{ref:t}),d.isValidElement(i)?d.cloneElement(i,void 0,l):null)}return d.createElement(X1,rn({},r,{ref:t}),n)});JI.displayName="Slot";const X1=d.forwardRef((e,t)=>{const{children:n,...r}=e;return d.isValidElement(n)?d.cloneElement(n,{...VK(r,n.props),ref:ZI(t,n.ref)}):d.Children.count(n)>1?d.Children.only(null):null});X1.displayName="SlotClone";const HK=({children:e})=>d.createElement(d.Fragment,null,e);function WK(e){return d.isValidElement(e)&&e.type===HK}function VK(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 UK=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],Hd=UK.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:s,...i}=r,l=s?JI:t;return d.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),d.createElement(l,rn({},i,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Y1=globalThis!=null&&globalThis.document?d.useLayoutEffect:()=>{};function GK(e,t){return d.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const Wd=e=>{const{present:t,children:n}=e,r=KK(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),s=nl(r.ref,o.ref);return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:s}):null};Wd.displayName="Presence";function KK(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),s=d.useRef("none"),i=e?"mounted":"unmounted",[l,u]=GK(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const p=cp(r.current);s.current=l==="mounted"?p:"none"},[l]),Y1(()=>{const p=r.current,h=o.current;if(h!==e){const v=s.current,b=cp(p);e?u("MOUNT"):b==="none"||(p==null?void 0:p.display)==="none"?u("UNMOUNT"):u(h&&v!==b?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),Y1(()=>{if(t){const p=m=>{const b=cp(r.current).includes(m.animationName);m.target===t&&b&&Fr.flushSync(()=>u("ANIMATION_END"))},h=m=>{m.target===t&&(s.current=cp(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{t.removeEventListener("animationstart",h),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 cp(e){return(e==null?void 0:e.animationName)||"none"}function qK(e,t=[]){let n=[];function r(s,i){const l=d.createContext(i),u=n.length;n=[...n,i];function p(m){const{scope:v,children:b,...y}=m,x=(v==null?void 0:v[e][u])||l,w=d.useMemo(()=>y,Object.values(y));return d.createElement(x.Provider,{value:w},b)}function h(m,v){const b=(v==null?void 0:v[e][u])||l,y=d.useContext(b);if(y)return y;if(i!==void 0)return i;throw new Error(`\`${m}\` must be used within \`${s}\``)}return p.displayName=s+"Provider",[p,h]}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,XK(o,...t)]}function XK(...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 m=u(s)[`__scope${p}`];return{...l,...m}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function yi(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 YK=d.createContext(void 0);function QK(e){const t=d.useContext(YK);return e||t||"ltr"}function ZK(e,[t,n]){return Math.min(n,Math.max(t,e))}function Ii(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 JK(e,t){return d.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const e6="ScrollArea",[t6,E0e]=qK(e6),[eq,yo]=t6(e6),tq=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:s=600,...i}=e,[l,u]=d.useState(null),[p,h]=d.useState(null),[m,v]=d.useState(null),[b,y]=d.useState(null),[x,w]=d.useState(null),[k,_]=d.useState(0),[j,I]=d.useState(0),[E,M]=d.useState(!1),[D,R]=d.useState(!1),A=nl(t,T=>u(T)),O=QK(o);return d.createElement(eq,{scope:n,type:r,dir:O,scrollHideDelay:s,scrollArea:l,viewport:p,onViewportChange:h,content:m,onContentChange:v,scrollbarX:b,onScrollbarXChange:y,scrollbarXEnabled:E,onScrollbarXEnabledChange:M,scrollbarY:x,onScrollbarYChange:w,scrollbarYEnabled:D,onScrollbarYEnabledChange:R,onCornerWidthChange:_,onCornerHeightChange:I},d.createElement(Hd.div,rn({dir:O},i,{ref:A,style:{position:"relative","--radix-scroll-area-corner-width":k+"px","--radix-scroll-area-corner-height":j+"px",...e.style}})))}),nq="ScrollAreaViewport",rq=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,...o}=e,s=yo(nq,n),i=d.useRef(null),l=nl(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,rn({"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)))}),fa="ScrollAreaScrollbar",oq=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=yo(fa,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(sq,rn({},r,{ref:t,forceMount:n})):o.type==="scroll"?d.createElement(aq,rn({},r,{ref:t,forceMount:n})):o.type==="auto"?d.createElement(n6,rn({},r,{ref:t,forceMount:n})):o.type==="always"?d.createElement(Qx,rn({},r,{ref:t})):null}),sq=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=yo(fa,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)},h=()=>{u=window.setTimeout(()=>i(!1),o.scrollHideDelay)};return l.addEventListener("pointerenter",p),l.addEventListener("pointerleave",h),()=>{window.clearTimeout(u),l.removeEventListener("pointerenter",p),l.removeEventListener("pointerleave",h)}}},[o.scrollArea,o.scrollHideDelay]),d.createElement(Wd,{present:n||s},d.createElement(n6,rn({"data-state":s?"visible":"hidden"},r,{ref:t})))}),aq=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=yo(fa,e.__scopeScrollArea),s=e.orientation==="horizontal",i=Qm(()=>u("SCROLL_END"),100),[l,u]=JK("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,h=s?"scrollLeft":"scrollTop";if(p){let m=p[h];const v=()=>{const b=p[h];m!==b&&(u("SCROLL"),i()),m=b};return p.addEventListener("scroll",v),()=>p.removeEventListener("scroll",v)}},[o.viewport,s,u,i]),d.createElement(Wd,{present:n||l!=="hidden"},d.createElement(Qx,rn({"data-state":l==="hidden"?"hidden":"visible"},r,{ref:t,onPointerEnter:Ii(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:Ii(e.onPointerLeave,()=>u("POINTER_LEAVE"))})))}),n6=d.forwardRef((e,t)=>{const n=yo(fa,e.__scopeScrollArea),{forceMount:r,...o}=e,[s,i]=d.useState(!1),l=e.orientation==="horizontal",u=Qm(()=>{if(n.viewport){const p=n.viewport.offsetWidth<n.viewport.scrollWidth,h=n.viewport.offsetHeight<n.viewport.scrollHeight;i(l?p:h)}},10);return _c(n.viewport,u),_c(n.content,u),d.createElement(Wd,{present:r||s},d.createElement(Qx,rn({"data-state":s?"visible":"hidden"},o,{ref:t})))}),Qx=d.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=yo(fa,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=a6(l.viewport,l.content),h={...r,sizes:l,onSizesChange:u,hasThumb:p>0&&p<1,onThumbChange:v=>s.current=v,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:v=>i.current=v};function m(v,b){return hq(v,i.current,l,b)}return n==="horizontal"?d.createElement(iq,rn({},h,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const v=o.viewport.scrollLeft,b=I4(v,l,o.dir);s.current.style.transform=`translate3d(${b}px, 0, 0)`}},onWheelScroll:v=>{o.viewport&&(o.viewport.scrollLeft=v)},onDragScroll:v=>{o.viewport&&(o.viewport.scrollLeft=m(v,o.dir))}})):n==="vertical"?d.createElement(lq,rn({},h,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const v=o.viewport.scrollTop,b=I4(v,l);s.current.style.transform=`translate3d(0, ${b}px, 0)`}},onWheelScroll:v=>{o.viewport&&(o.viewport.scrollTop=v)},onDragScroll:v=>{o.viewport&&(o.viewport.scrollTop=m(v))}})):null}),iq=d.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=yo(fa,e.__scopeScrollArea),[i,l]=d.useState(),u=d.useRef(null),p=nl(t,u,s.onScrollbarXChange);return d.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),d.createElement(o6,rn({"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":Ym(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.x),onDragScroll:h=>e.onDragScroll(h.x),onWheelScroll:(h,m)=>{if(s.viewport){const v=s.viewport.scrollLeft+h.deltaX;e.onWheelScroll(v),l6(v,m)&&h.preventDefault()}},onResize:()=>{u.current&&s.viewport&&i&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:_h(i.paddingLeft),paddingEnd:_h(i.paddingRight)}})}}))}),lq=d.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=yo(fa,e.__scopeScrollArea),[i,l]=d.useState(),u=d.useRef(null),p=nl(t,u,s.onScrollbarYChange);return d.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),d.createElement(o6,rn({"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":Ym(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.y),onDragScroll:h=>e.onDragScroll(h.y),onWheelScroll:(h,m)=>{if(s.viewport){const v=s.viewport.scrollTop+h.deltaY;e.onWheelScroll(v),l6(v,m)&&h.preventDefault()}},onResize:()=>{u.current&&s.viewport&&i&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:_h(i.paddingTop),paddingEnd:_h(i.paddingBottom)}})}}))}),[cq,r6]=t6(fa),o6=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:s,onThumbPointerUp:i,onThumbPointerDown:l,onThumbPositionChange:u,onDragScroll:p,onWheelScroll:h,onResize:m,...v}=e,b=yo(fa,n),[y,x]=d.useState(null),w=nl(t,A=>x(A)),k=d.useRef(null),_=d.useRef(""),j=b.viewport,I=r.content-r.viewport,E=yi(h),M=yi(u),D=Qm(m,10);function R(A){if(k.current){const O=A.clientX-k.current.left,T=A.clientY-k.current.top;p({x:O,y:T})}}return d.useEffect(()=>{const A=O=>{const T=O.target;(y==null?void 0:y.contains(T))&&E(O,I)};return document.addEventListener("wheel",A,{passive:!1}),()=>document.removeEventListener("wheel",A,{passive:!1})},[j,y,I,E]),d.useEffect(M,[r,M]),_c(y,D),_c(b.content,D),d.createElement(cq,{scope:n,scrollbar:y,hasThumb:o,onThumbChange:yi(s),onThumbPointerUp:yi(i),onThumbPositionChange:M,onThumbPointerDown:yi(l)},d.createElement(Hd.div,rn({},v,{ref:w,style:{position:"absolute",...v.style},onPointerDown:Ii(e.onPointerDown,A=>{A.button===0&&(A.target.setPointerCapture(A.pointerId),k.current=y.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",R(A))}),onPointerMove:Ii(e.onPointerMove,R),onPointerUp:Ii(e.onPointerUp,A=>{const O=A.target;O.hasPointerCapture(A.pointerId)&&O.releasePointerCapture(A.pointerId),document.body.style.webkitUserSelect=_.current,k.current=null})})))}),Q1="ScrollAreaThumb",uq=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=r6(Q1,e.__scopeScrollArea);return d.createElement(Wd,{present:n||o.hasThumb},d.createElement(dq,rn({ref:t},r)))}),dq=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,s=yo(Q1,n),i=r6(Q1,n),{onThumbPositionChange:l}=i,u=nl(t,m=>i.onThumbChange(m)),p=d.useRef(),h=Qm(()=>{p.current&&(p.current(),p.current=void 0)},100);return d.useEffect(()=>{const m=s.viewport;if(m){const v=()=>{if(h(),!p.current){const b=mq(m,l);p.current=b,l()}};return l(),m.addEventListener("scroll",v),()=>m.removeEventListener("scroll",v)}},[s.viewport,h,l]),d.createElement(Hd.div,rn({"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:Ii(e.onPointerDownCapture,m=>{const b=m.target.getBoundingClientRect(),y=m.clientX-b.left,x=m.clientY-b.top;i.onThumbPointerDown({x:y,y:x})}),onPointerUp:Ii(e.onPointerUp,i.onThumbPointerUp)}))}),s6="ScrollAreaCorner",fq=d.forwardRef((e,t)=>{const n=yo(s6,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?d.createElement(pq,rn({},e,{ref:t})):null}),pq=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=yo(s6,n),[s,i]=d.useState(0),[l,u]=d.useState(0),p=!!(s&&l);return _c(o.scrollbarX,()=>{var h;const m=((h=o.scrollbarX)===null||h===void 0?void 0:h.offsetHeight)||0;o.onCornerHeightChange(m),u(m)}),_c(o.scrollbarY,()=>{var h;const m=((h=o.scrollbarY)===null||h===void 0?void 0:h.offsetWidth)||0;o.onCornerWidthChange(m),i(m)}),p?d.createElement(Hd.div,rn({},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 _h(e){return e?parseInt(e,10):0}function a6(e,t){const n=e/t;return isNaN(n)?0:n}function Ym(e){const t=a6(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function hq(e,t,n,r="ltr"){const o=Ym(n),s=o/2,i=t||s,l=o-i,u=n.scrollbar.paddingStart+i,p=n.scrollbar.size-n.scrollbar.paddingEnd-l,h=n.content-n.viewport,m=r==="ltr"?[0,h]:[h*-1,0];return i6([u,p],m)(e)}function I4(e,t,n="ltr"){const r=Ym(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=ZK(e,u);return i6([0,i],[0,l])(p)}function i6(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 l6(e,t){return e>0&&e<t}const mq=(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 Qm(e,t){const n=yi(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 _c(e,t){const n=yi(t);Y1(()=>{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 gq=tq,vq=rq,E4=oq,M4=uq,bq=fq;var xq=or((e,{scrollbarSize:t,offsetScrollbars:n,scrollbarHovered:r,hidden:o})=>({root:{overflow:"hidden"},viewport:{width:"100%",height:"100%",paddingRight:n?Oe(t):void 0,paddingBottom:n?Oe(t):void 0},scrollbar:{display:o?"none":"flex",userSelect:"none",touchAction:"none",boxSizing:"border-box",padding:`calc(${Oe(t)} / 5)`,transition:"background-color 150ms ease, opacity 150ms ease","&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[8]:e.colors.gray[0],[`& .${NS("thumb")}`]:{backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.white,.5):e.fn.rgba(e.black,.5)}},'&[data-orientation="vertical"]':{width:Oe(t)},'&[data-orientation="horizontal"]':{flexDirection:"column",height:Oe(t)},'&[data-state="hidden"]':{display:"none",opacity:0}},thumb:{ref:NS("thumb"),flex:1,backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.white,.4):e.fn.rgba(e.black,.4),borderRadius:Oe(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:Oe(44),minHeight:Oe(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 yq=xq;var Cq=Object.defineProperty,wq=Object.defineProperties,Sq=Object.getOwnPropertyDescriptors,jh=Object.getOwnPropertySymbols,c6=Object.prototype.hasOwnProperty,u6=Object.prototype.propertyIsEnumerable,O4=(e,t,n)=>t in e?Cq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Z1=(e,t)=>{for(var n in t||(t={}))c6.call(t,n)&&O4(e,n,t[n]);if(jh)for(var n of jh(t))u6.call(t,n)&&O4(e,n,t[n]);return e},d6=(e,t)=>wq(e,Sq(t)),f6=(e,t)=>{var n={};for(var r in e)c6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&jh)for(var r of jh(e))t.indexOf(r)<0&&u6.call(e,r)&&(n[r]=e[r]);return n};const p6={scrollbarSize:12,scrollHideDelay:1e3,type:"hover",offsetScrollbars:!1},Zm=d.forwardRef((e,t)=>{const n=Sn("ScrollArea",p6,e),{children:r,className:o,classNames:s,styles:i,scrollbarSize:l,scrollHideDelay:u,type:p,dir:h,offsetScrollbars:m,viewportRef:v,onScrollPositionChange:b,unstyled:y,variant:x,viewportProps:w}=n,k=f6(n,["children","className","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled","variant","viewportProps"]),[_,j]=d.useState(!1),I=ua(),{classes:E,cx:M}=yq({scrollbarSize:l,offsetScrollbars:m,scrollbarHovered:_,hidden:p==="never"},{name:"ScrollArea",classNames:s,styles:i,unstyled:y,variant:x});return H.createElement(gq,{type:p==="never"?"always":p,scrollHideDelay:u,dir:h||I.dir,ref:t,asChild:!0},H.createElement(Or,Z1({className:M(E.root,o)},k),H.createElement(vq,d6(Z1({},w),{className:E.viewport,ref:v,onScroll:typeof b=="function"?({currentTarget:D})=>b({x:D.scrollLeft,y:D.scrollTop}):void 0}),r),H.createElement(E4,{orientation:"horizontal",className:E.scrollbar,forceMount:!0,onMouseEnter:()=>j(!0),onMouseLeave:()=>j(!1)},H.createElement(M4,{className:E.thumb})),H.createElement(E4,{orientation:"vertical",className:E.scrollbar,forceMount:!0,onMouseEnter:()=>j(!0),onMouseLeave:()=>j(!1)},H.createElement(M4,{className:E.thumb})),H.createElement(bq,{className:E.corner})))}),h6=d.forwardRef((e,t)=>{const n=Sn("ScrollAreaAutosize",p6,e),{children:r,classNames:o,styles:s,scrollbarSize:i,scrollHideDelay:l,type:u,dir:p,offsetScrollbars:h,viewportRef:m,onScrollPositionChange:v,unstyled:b,sx:y,variant:x,viewportProps:w}=n,k=f6(n,["children","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled","sx","variant","viewportProps"]);return H.createElement(Or,d6(Z1({},k),{ref:t,sx:[{display:"flex"},...tI(y)]}),H.createElement(Or,{sx:{display:"flex",flexDirection:"column",flex:1}},H.createElement(Zm,{classNames:o,styles:s,scrollHideDelay:l,scrollbarSize:i,type:u,dir:p,offsetScrollbars:h,viewportRef:m,onScrollPositionChange:v,unstyled:b,variant:x,viewportProps:w},r)))});h6.displayName="@mantine/core/ScrollAreaAutosize";Zm.displayName="@mantine/core/ScrollArea";Zm.Autosize=h6;const m6=Zm;var kq=Object.defineProperty,_q=Object.defineProperties,jq=Object.getOwnPropertyDescriptors,Ph=Object.getOwnPropertySymbols,g6=Object.prototype.hasOwnProperty,v6=Object.prototype.propertyIsEnumerable,D4=(e,t,n)=>t in e?kq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,R4=(e,t)=>{for(var n in t||(t={}))g6.call(t,n)&&D4(e,n,t[n]);if(Ph)for(var n of Ph(t))v6.call(t,n)&&D4(e,n,t[n]);return e},Pq=(e,t)=>_q(e,jq(t)),Iq=(e,t)=>{var n={};for(var r in e)g6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ph)for(var r of Ph(e))t.indexOf(r)<0&&v6.call(e,r)&&(n[r]=e[r]);return n};const Jm=d.forwardRef((e,t)=>{var n=e,{style:r}=n,o=Iq(n,["style"]);return H.createElement(m6,Pq(R4({},o),{style:R4({width:"100%"},r),viewportProps:{tabIndex:-1},viewportRef:t}),o.children)});Jm.displayName="@mantine/core/SelectScrollArea";var Eq=or(()=>({dropdown:{},itemsWrapper:{padding:Oe(4),display:"flex",width:"100%",boxSizing:"border-box"}}));const Mq=Eq;function Bc(e){return e.split("-")[1]}function Zx(e){return e==="y"?"height":"width"}function Lo(e){return e.split("-")[0]}function ti(e){return["top","bottom"].includes(Lo(e))?"x":"y"}function A4(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=ti(t),u=Zx(l),p=r[u]/2-o[u]/2,h=l==="x";let m;switch(Lo(t)){case"top":m={x:s,y:r.y-o.height};break;case"bottom":m={x:s,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:i};break;case"left":m={x:r.x-o.width,y:i};break;default:m={x:r.x,y:r.y}}switch(Bc(t)){case"start":m[l]-=p*(n&&h?-1:1);break;case"end":m[l]+=p*(n&&h?-1:1)}return m}const Oq=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:h,y:m}=A4(p,r,u),v=r,b={},y=0;for(let x=0;x<l.length;x++){const{name:w,fn:k}=l[x],{x:_,y:j,data:I,reset:E}=await k({x:h,y:m,initialPlacement:r,placement:v,strategy:o,middlewareData:b,rects:p,platform:i,elements:{reference:e,floating:t}});h=_??h,m=j??m,b={...b,[w]:{...b[w],...I}},E&&y<=50&&(y++,typeof E=="object"&&(E.placement&&(v=E.placement),E.rects&&(p=E.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:h,y:m}=A4(p,v,u)),x=-1)}return{x:h,y:m,placement:v,strategy:o,middlewareData:b}};function na(e,t){return typeof e=="function"?e(t):e}function Jx(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 jc(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function ey(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:h="viewport",elementContext:m="floating",altBoundary:v=!1,padding:b=0}=na(t,e),y=Jx(b),x=l[v?m==="floating"?"reference":"floating":m],w=jc(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(x)))==null||n?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:p,rootBoundary:h,strategy:u})),k=m==="floating"?{...i.floating,x:r,y:o}:i.reference,_=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),j=await(s.isElement==null?void 0:s.isElement(_))&&await(s.getScale==null?void 0:s.getScale(_))||{x:1,y:1},I=jc(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:k,offsetParent:_,strategy:u}):k);return{top:(w.top-I.top+y.top)/j.y,bottom:(I.bottom-w.bottom+y.bottom)/j.y,left:(w.left-I.left+y.left)/j.x,right:(I.right-w.right+y.right)/j.x}}const qa=Math.min,ls=Math.max;function J1(e,t,n){return ls(e,qa(t,n))}const N4=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}=na(e,t)||{};if(u==null)return{};const h=Jx(p),m={x:n,y:r},v=ti(o),b=Zx(v),y=await i.getDimensions(u),x=v==="y",w=x?"top":"left",k=x?"bottom":"right",_=x?"clientHeight":"clientWidth",j=s.reference[b]+s.reference[v]-m[v]-s.floating[b],I=m[v]-s.reference[v],E=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let M=E?E[_]:0;M&&await(i.isElement==null?void 0:i.isElement(E))||(M=l.floating[_]||s.floating[b]);const D=j/2-I/2,R=M/2-y[b]/2-1,A=qa(h[w],R),O=qa(h[k],R),T=A,K=M-y[b]-O,F=M/2-y[b]/2+D,V=J1(T,F,K),X=Bc(o)!=null&&F!=V&&s.reference[b]/2-(F<T?A:O)-y[b]/2<0?F<T?T-F:K-F:0;return{[v]:m[v]-X,data:{[v]:V,centerOffset:F-V+X}}}}),Dq=["top","right","bottom","left"];Dq.reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);const Rq={left:"right",right:"left",bottom:"top",top:"bottom"};function Ih(e){return e.replace(/left|right|bottom|top/g,t=>Rq[t])}function Aq(e,t,n){n===void 0&&(n=!1);const r=Bc(e),o=ti(e),s=Zx(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Ih(i)),{main:i,cross:Ih(i)}}const Nq={start:"end",end:"start"};function Sv(e){return e.replace(/start|end/g,t=>Nq[t])}const Tq=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:h=!0,fallbackPlacements:m,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:y=!0,...x}=na(e,t),w=Lo(r),k=Lo(i)===i,_=await(l.isRTL==null?void 0:l.isRTL(u.floating)),j=m||(k||!y?[Ih(i)]:function(T){const K=Ih(T);return[Sv(T),K,Sv(K)]}(i));m||b==="none"||j.push(...function(T,K,F,V){const X=Bc(T);let W=function(z,Y,B){const q=["left","right"],re=["right","left"],Q=["top","bottom"],le=["bottom","top"];switch(z){case"top":case"bottom":return B?Y?re:q:Y?q:re;case"left":case"right":return Y?Q:le;default:return[]}}(Lo(T),F==="start",V);return X&&(W=W.map(z=>z+"-"+X),K&&(W=W.concat(W.map(Sv)))),W}(i,y,b,_));const I=[i,...j],E=await ey(t,x),M=[];let D=((n=o.flip)==null?void 0:n.overflows)||[];if(p&&M.push(E[w]),h){const{main:T,cross:K}=Aq(r,s,_);M.push(E[T],E[K])}if(D=[...D,{placement:r,overflows:M}],!M.every(T=>T<=0)){var R,A;const T=(((R=o.flip)==null?void 0:R.index)||0)+1,K=I[T];if(K)return{data:{index:T,overflows:D},reset:{placement:K}};let F=(A=D.filter(V=>V.overflows[0]<=0).sort((V,X)=>V.overflows[1]-X.overflows[1])[0])==null?void 0:A.placement;if(!F)switch(v){case"bestFit":{var O;const V=(O=D.map(X=>[X.placement,X.overflows.filter(W=>W>0).reduce((W,z)=>W+z,0)]).sort((X,W)=>X[1]-W[1])[0])==null?void 0:O[0];V&&(F=V);break}case"initialPlacement":F=i}if(r!==F)return{reset:{placement:F}}}return{}}}};function T4(e){const t=qa(...e.map(r=>r.left)),n=qa(...e.map(r=>r.top));return{x:t,y:n,width:ls(...e.map(r=>r.right))-t,height:ls(...e.map(r=>r.bottom))-n}}const $q=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}=na(e,t),h=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(r.reference))||[]),m=function(x){const w=x.slice().sort((j,I)=>j.y-I.y),k=[];let _=null;for(let j=0;j<w.length;j++){const I=w[j];!_||I.y-_.y>_.height/2?k.push([I]):k[k.length-1].push(I),_=I}return k.map(j=>jc(T4(j)))}(h),v=jc(T4(h)),b=Jx(l),y=await s.getElementRects({reference:{getBoundingClientRect:function(){if(m.length===2&&m[0].left>m[1].right&&u!=null&&p!=null)return m.find(x=>u>x.left-b.left&&u<x.right+b.right&&p>x.top-b.top&&p<x.bottom+b.bottom)||v;if(m.length>=2){if(ti(n)==="x"){const E=m[0],M=m[m.length-1],D=Lo(n)==="top",R=E.top,A=M.bottom,O=D?E.left:M.left,T=D?E.right:M.right;return{top:R,bottom:A,left:O,right:T,width:T-O,height:A-R,x:O,y:R}}const x=Lo(n)==="left",w=ls(...m.map(E=>E.right)),k=qa(...m.map(E=>E.left)),_=m.filter(E=>x?E.left===k:E.right===w),j=_[0].top,I=_[_.length-1].bottom;return{top:j,bottom:I,left:k,right:w,width:w-k,height:I-j,x:k,y:j}}return v}},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}}:{}}}},Lq=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,h=await(u.isRTL==null?void 0:u.isRTL(p.floating)),m=Lo(l),v=Bc(l),b=ti(l)==="x",y=["left","top"].includes(m)?-1:1,x=h&&b?-1:1,w=na(i,s);let{mainAxis:k,crossAxis:_,alignmentAxis:j}=typeof w=="number"?{mainAxis:w,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...w};return v&&typeof j=="number"&&(_=v==="end"?-1*j:j),b?{x:_*x,y:k*y}:{x:k*y,y:_*x}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};function b6(e){return e==="x"?"y":"x"}const zq=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:k,y:_}=w;return{x:k,y:_}}},...u}=na(e,t),p={x:n,y:r},h=await ey(t,u),m=ti(Lo(o)),v=b6(m);let b=p[m],y=p[v];if(s){const w=m==="y"?"bottom":"right";b=J1(b+h[m==="y"?"top":"left"],b,b-h[w])}if(i){const w=v==="y"?"bottom":"right";y=J1(y+h[v==="y"?"top":"left"],y,y-h[w])}const x=l.fn({...t,[m]:b,[v]:y});return{...x,data:{x:x.x-n,y:x.y-r}}}}},Fq=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}=na(e,t),h={x:n,y:r},m=ti(o),v=b6(m);let b=h[m],y=h[v];const x=na(l,t),w=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(u){const j=m==="y"?"height":"width",I=s.reference[m]-s.floating[j]+w.mainAxis,E=s.reference[m]+s.reference[j]-w.mainAxis;b<I?b=I:b>E&&(b=E)}if(p){var k,_;const j=m==="y"?"width":"height",I=["top","left"].includes(Lo(o)),E=s.reference[v]-s.floating[j]+(I&&((k=i.offset)==null?void 0:k[v])||0)+(I?0:w.crossAxis),M=s.reference[v]+s.reference[j]+(I?0:((_=i.offset)==null?void 0:_[v])||0)-(I?w.crossAxis:0);y<E?y=E:y>M&&(y=M)}return{[m]:b,[v]:y}}}},Bq=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}=na(e,t),u=await ey(t,l),p=Lo(n),h=Bc(n),m=ti(n)==="x",{width:v,height:b}=r.floating;let y,x;p==="top"||p==="bottom"?(y=p,x=h===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(x=p,y=h==="end"?"top":"bottom");const w=b-u[y],k=v-u[x],_=!t.middlewareData.shift;let j=w,I=k;if(m){const M=v-u.left-u.right;I=h||_?qa(k,M):M}else{const M=b-u.top-u.bottom;j=h||_?qa(w,M):M}if(_&&!h){const M=ls(u.left,0),D=ls(u.right,0),R=ls(u.top,0),A=ls(u.bottom,0);m?I=v-2*(M!==0||D!==0?M+D:ls(u.left,u.right)):j=b-2*(R!==0||A!==0?R+A:ls(u.top,u.bottom))}await i({...t,availableWidth:I,availableHeight:j});const E=await o.getDimensions(s.floating);return v!==E.width||b!==E.height?{reset:{rects:!0}}:{}}}};function Hr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function vs(e){return Hr(e).getComputedStyle(e)}function x6(e){return e instanceof Hr(e).Node}function Xa(e){return x6(e)?(e.nodeName||"").toLowerCase():"#document"}function Uo(e){return e instanceof HTMLElement||e instanceof Hr(e).HTMLElement}function $4(e){return typeof ShadowRoot<"u"&&(e instanceof Hr(e).ShadowRoot||e instanceof ShadowRoot)}function id(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=vs(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Hq(e){return["table","td","th"].includes(Xa(e))}function eb(e){const t=ty(),n=vs(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 ty(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function eg(e){return["html","body","#document"].includes(Xa(e))}const tb=Math.min,ic=Math.max,Eh=Math.round,up=Math.floor,Ya=e=>({x:e,y:e});function y6(e){const t=vs(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Uo(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,l=Eh(n)!==s||Eh(r)!==i;return l&&(n=s,r=i),{width:n,height:r,$:l}}function Ys(e){return e instanceof Element||e instanceof Hr(e).Element}function ny(e){return Ys(e)?e:e.contextElement}function lc(e){const t=ny(e);if(!Uo(t))return Ya(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=y6(t);let i=(s?Eh(n.width):n.width)/r,l=(s?Eh(n.height):n.height)/o;return i&&Number.isFinite(i)||(i=1),l&&Number.isFinite(l)||(l=1),{x:i,y:l}}const Wq=Ya(0);function C6(e){const t=Hr(e);return ty()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Wq}function Vi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=ny(e);let i=Ya(1);t&&(r?Ys(r)&&(i=lc(r)):i=lc(e));const l=function(v,b,y){return b===void 0&&(b=!1),!(!y||b&&y!==Hr(v))&&b}(s,n,r)?C6(s):Ya(0);let u=(o.left+l.x)/i.x,p=(o.top+l.y)/i.y,h=o.width/i.x,m=o.height/i.y;if(s){const v=Hr(s),b=r&&Ys(r)?Hr(r):r;let y=v.frameElement;for(;y&&r&&b!==v;){const x=lc(y),w=y.getBoundingClientRect(),k=getComputedStyle(y),_=w.left+(y.clientLeft+parseFloat(k.paddingLeft))*x.x,j=w.top+(y.clientTop+parseFloat(k.paddingTop))*x.y;u*=x.x,p*=x.y,h*=x.x,m*=x.y,u+=_,p+=j,y=Hr(y).frameElement}}return jc({width:h,height:m,x:u,y:p})}function tg(e){return Ys(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Qs(e){var t;return(t=(x6(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function w6(e){return Vi(Qs(e)).left+tg(e).scrollLeft}function Pc(e){if(Xa(e)==="html")return e;const t=e.assignedSlot||e.parentNode||$4(e)&&e.host||Qs(e);return $4(t)?t.host:t}function S6(e){const t=Pc(e);return eg(t)?e.ownerDocument?e.ownerDocument.body:e.body:Uo(t)&&id(t)?t:S6(t)}function Mh(e,t){var n;t===void 0&&(t=[]);const r=S6(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),s=Hr(r);return o?t.concat(s,s.visualViewport||[],id(r)?r:[]):t.concat(r,Mh(r))}function L4(e,t,n){let r;if(t==="viewport")r=function(o,s){const i=Hr(o),l=Qs(o),u=i.visualViewport;let p=l.clientWidth,h=l.clientHeight,m=0,v=0;if(u){p=u.width,h=u.height;const b=ty();(!b||b&&s==="fixed")&&(m=u.offsetLeft,v=u.offsetTop)}return{width:p,height:h,x:m,y:v}}(e,n);else if(t==="document")r=function(o){const s=Qs(o),i=tg(o),l=o.ownerDocument.body,u=ic(s.scrollWidth,s.clientWidth,l.scrollWidth,l.clientWidth),p=ic(s.scrollHeight,s.clientHeight,l.scrollHeight,l.clientHeight);let h=-i.scrollLeft+w6(o);const m=-i.scrollTop;return vs(l).direction==="rtl"&&(h+=ic(s.clientWidth,l.clientWidth)-u),{width:u,height:p,x:h,y:m}}(Qs(e));else if(Ys(t))r=function(o,s){const i=Vi(o,!0,s==="fixed"),l=i.top+o.clientTop,u=i.left+o.clientLeft,p=Uo(o)?lc(o):Ya(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=C6(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return jc(r)}function k6(e,t){const n=Pc(e);return!(n===t||!Ys(n)||eg(n))&&(vs(n).position==="fixed"||k6(n,t))}function Vq(e,t,n){const r=Uo(t),o=Qs(t),s=n==="fixed",i=Vi(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const u=Ya(0);if(r||!r&&!s)if((Xa(t)!=="body"||id(o))&&(l=tg(t)),Uo(t)){const p=Vi(t,!0,s,t);u.x=p.x+t.clientLeft,u.y=p.y+t.clientTop}else o&&(u.x=w6(o));return{x:i.left+l.scrollLeft-u.x,y:i.top+l.scrollTop-u.y,width:i.width,height:i.height}}function z4(e,t){return Uo(e)&&vs(e).position!=="fixed"?t?t(e):e.offsetParent:null}function F4(e,t){const n=Hr(e);if(!Uo(e))return n;let r=z4(e,t);for(;r&&Hq(r)&&vs(r).position==="static";)r=z4(r,t);return r&&(Xa(r)==="html"||Xa(r)==="body"&&vs(r).position==="static"&&!eb(r))?n:r||function(o){let s=Pc(o);for(;Uo(s)&&!eg(s);){if(eb(s))return s;s=Pc(s)}return null}(e)||n}const Uq={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=Uo(n),s=Qs(n);if(n===s)return t;let i={scrollLeft:0,scrollTop:0},l=Ya(1);const u=Ya(0);if((o||!o&&r!=="fixed")&&((Xa(n)!=="body"||id(s))&&(i=tg(n)),Uo(n))){const p=Vi(n);l=lc(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:Qs,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?function(u,p){const h=p.get(u);if(h)return h;let m=Mh(u).filter(x=>Ys(x)&&Xa(x)!=="body"),v=null;const b=vs(u).position==="fixed";let y=b?Pc(u):u;for(;Ys(y)&&!eg(y);){const x=vs(y),w=eb(y);w||x.position!=="fixed"||(v=null),(b?!w&&!v:!w&&x.position==="static"&&v&&["absolute","fixed"].includes(v.position)||id(y)&&!w&&k6(u,y))?m=m.filter(k=>k!==y):v=x,y=Pc(y)}return p.set(u,m),m}(t,this._c):[].concat(n),r],i=s[0],l=s.reduce((u,p)=>{const h=L4(t,p,o);return u.top=ic(h.top,u.top),u.right=tb(h.right,u.right),u.bottom=tb(h.bottom,u.bottom),u.left=ic(h.left,u.left),u},L4(t,i,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:F4,getElementRects:async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||F4,s=this.getDimensions;return{reference:Vq(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 y6(e)},getScale:lc,isElement:Ys,isRTL:function(e){return getComputedStyle(e).direction==="rtl"}};function Gq(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=ny(e),h=o||s?[...p?Mh(p):[],...Mh(t)]:[];h.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),s&&w.addEventListener("resize",n)});const m=p&&l?function(w,k){let _,j=null;const I=Qs(w);function E(){clearTimeout(_),j&&j.disconnect(),j=null}return function M(D,R){D===void 0&&(D=!1),R===void 0&&(R=1),E();const{left:A,top:O,width:T,height:K}=w.getBoundingClientRect();if(D||k(),!T||!K)return;const F={rootMargin:-up(O)+"px "+-up(I.clientWidth-(A+T))+"px "+-up(I.clientHeight-(O+K))+"px "+-up(A)+"px",threshold:ic(0,tb(1,R))||1};let V=!0;function X(W){const z=W[0].intersectionRatio;if(z!==R){if(!V)return M();z?M(!1,z):_=setTimeout(()=>{M(!1,1e-7)},100)}V=!1}try{j=new IntersectionObserver(X,{...F,root:I.ownerDocument})}catch{j=new IntersectionObserver(X,F)}j.observe(w)}(!0),E}(p,n):null;let v,b=-1,y=null;i&&(y=new ResizeObserver(w=>{let[k]=w;k&&k.target===p&&y&&(y.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{y&&y.observe(t)})),n()}),p&&!u&&y.observe(p),y.observe(t));let x=u?Vi(e):null;return u&&function w(){const k=Vi(e);!x||k.x===x.x&&k.y===x.y&&k.width===x.width&&k.height===x.height||n(),x=k,v=requestAnimationFrame(w)}(),n(),()=>{h.forEach(w=>{o&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),m&&m(),y&&y.disconnect(),y=null,u&&cancelAnimationFrame(v)}}const Kq=(e,t,n)=>{const r=new Map,o={platform:Uq,...n},s={...o.platform,_c:r};return Oq(e,t,{...o,platform:s})},qq=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?N4({element:t.current,padding:n}).fn(o):{}:t?N4({element:t,padding:n}).fn(o):{}}}};var Fp=typeof document<"u"?d.useLayoutEffect:d.useEffect;function Oh(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(!Oh(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)&&!Oh(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function B4(e){const t=d.useRef(e);return Fp(()=>{t.current=e}),t}function Xq(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,h]=d.useState(r);Oh(p,r)||h(r);const m=d.useRef(null),v=d.useRef(null),b=d.useRef(l),y=B4(s),x=B4(o),[w,k]=d.useState(null),[_,j]=d.useState(null),I=d.useCallback(O=>{m.current!==O&&(m.current=O,k(O))},[]),E=d.useCallback(O=>{v.current!==O&&(v.current=O,j(O))},[]),M=d.useCallback(()=>{if(!m.current||!v.current)return;const O={placement:t,strategy:n,middleware:p};x.current&&(O.platform=x.current),Kq(m.current,v.current,O).then(T=>{const K={...T,isPositioned:!0};D.current&&!Oh(b.current,K)&&(b.current=K,Fr.flushSync(()=>{u(K)}))})},[p,t,n,x]);Fp(()=>{i===!1&&b.current.isPositioned&&(b.current.isPositioned=!1,u(O=>({...O,isPositioned:!1})))},[i]);const D=d.useRef(!1);Fp(()=>(D.current=!0,()=>{D.current=!1}),[]),Fp(()=>{if(w&&_){if(y.current)return y.current(w,_,M);M()}},[w,_,M,y]);const R=d.useMemo(()=>({reference:m,floating:v,setReference:I,setFloating:E}),[I,E]),A=d.useMemo(()=>({reference:w,floating:_}),[w,_]);return d.useMemo(()=>({...l,update:M,refs:R,elements:A,reference:I,floating:E}),[l,M,R,A,I,E])}var Yq=typeof document<"u"?d.useLayoutEffect:d.useEffect;function Qq(){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 Zq=d.createContext(null),Jq=()=>d.useContext(Zq);function eX(e){return(e==null?void 0:e.ownerDocument)||document}function tX(e){return eX(e).defaultView||window}function dp(e){return e?e instanceof tX(e).Element:!1}const nX=Tb["useInsertionEffect".toString()],rX=nX||(e=>e());function oX(e){const t=d.useRef(()=>{});return rX(()=>{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 sX(e){e===void 0&&(e={});const{open:t=!1,onOpenChange:n,nodeId:r}=e,o=Xq(e),s=Jq(),i=d.useRef(null),l=d.useRef({}),u=d.useState(()=>Qq())[0],[p,h]=d.useState(null),m=d.useCallback(k=>{const _=dp(k)?{getBoundingClientRect:()=>k.getBoundingClientRect(),contextElement:k}:k;o.refs.setReference(_)},[o.refs]),v=d.useCallback(k=>{(dp(k)||k===null)&&(i.current=k,h(k)),(dp(o.refs.reference.current)||o.refs.reference.current===null||k!==null&&!dp(k))&&o.refs.setReference(k)},[o.refs]),b=d.useMemo(()=>({...o.refs,setReference:v,setPositionReference:m,domReference:i}),[o.refs,v,m]),y=d.useMemo(()=>({...o.elements,domReference:p}),[o.elements,p]),x=oX(n),w=d.useMemo(()=>({...o,refs:b,elements:y,dataRef:l,nodeId:r,events:u,open:t,onOpenChange:x}),[o,r,u,t,x,b,y]);return Yq(()=>{const k=s==null?void 0:s.nodesRef.current.find(_=>_.id===r);k&&(k.context=w)}),d.useMemo(()=>({...o,context:w,refs:b,reference:v,positionReference:m}),[o,b,w,v,m])}function aX({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 Gq(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,o,n]),$o(()=>{t.update()},r),$o(()=>{s(i=>i+1)},[e])}function iX(e){const t=[Lq(e.offset)];return e.middlewares.shift&&t.push(zq({limiter:Fq()})),e.middlewares.flip&&t.push(Tq()),e.middlewares.inline&&t.push($q()),t.push(qq({element:e.arrowRef,padding:e.arrowOffset})),t}function lX(e){const[t,n]=ad({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=sX({placement:e.position,middleware:[...iX(e),...e.width==="target"?[Bq({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 aX({opened:e.opened,position:e.position,positionDependencies:e.positionDependencies,floating:s}),$o(()=>{var i;(i=e.onPositionChange)==null||i.call(e,s.placement)},[s.placement]),$o(()=>{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 _6={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"},[cX,j6]=YV(_6.context);var uX=Object.defineProperty,dX=Object.defineProperties,fX=Object.getOwnPropertyDescriptors,Dh=Object.getOwnPropertySymbols,P6=Object.prototype.hasOwnProperty,I6=Object.prototype.propertyIsEnumerable,H4=(e,t,n)=>t in e?uX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fp=(e,t)=>{for(var n in t||(t={}))P6.call(t,n)&&H4(e,n,t[n]);if(Dh)for(var n of Dh(t))I6.call(t,n)&&H4(e,n,t[n]);return e},pX=(e,t)=>dX(e,fX(t)),hX=(e,t)=>{var n={};for(var r in e)P6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Dh)for(var r of Dh(e))t.indexOf(r)<0&&I6.call(e,r)&&(n[r]=e[r]);return n};const mX={refProp:"ref",popupType:"dialog"},E6=d.forwardRef((e,t)=>{const n=Sn("PopoverTarget",mX,e),{children:r,refProp:o,popupType:s}=n,i=hX(n,["children","refProp","popupType"]);if(!rI(r))throw new Error(_6.children);const l=i,u=j6(),p=Bd(u.reference,r.ref,t),h=u.withRoles?{"aria-haspopup":s,"aria-expanded":u.opened,"aria-controls":u.getDropdownId(),id:u.getTargetId()}:{};return d.cloneElement(r,fp(pX(fp(fp(fp({},l),h),u.targetProps),{className:sI(u.targetProps.className,l.className,r.props.className),[o]:p}),u.controlled?null:{onClick:u.onToggle}))});E6.displayName="@mantine/core/PopoverTarget";var gX=or((e,{radius:t,shadow:n})=>({dropdown:{position:"absolute",backgroundColor:e.white,background:e.colorScheme==="dark"?e.colors.dark[6]:e.white,border:`${Oe(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:`${Oe(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`,zIndex:1}}));const vX=gX;var bX=Object.defineProperty,W4=Object.getOwnPropertySymbols,xX=Object.prototype.hasOwnProperty,yX=Object.prototype.propertyIsEnumerable,V4=(e,t,n)=>t in e?bX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Dl=(e,t)=>{for(var n in t||(t={}))xX.call(t,n)&&V4(e,n,t[n]);if(W4)for(var n of W4(t))yX.call(t,n)&&V4(e,n,t[n]);return e};const U4={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function CX({transition:e,state:t,duration:n,timingFunction:r}){const o={transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e=="string"?e in op?Dl(Dl(Dl({transitionProperty:op[e].transitionProperty},o),op[e].common),op[e][U4[t]]):null:Dl(Dl(Dl({transitionProperty:e.transitionProperty},o),e.common),e[U4[t]])}function wX({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:o,onExit:s,onEntered:i,onExited:l}){const u=ua(),p=fI(),h=u.respectReducedMotion?p:!1,[m,v]=d.useState(h?0:e),[b,y]=d.useState(r?"entered":"exited"),x=d.useRef(-1),w=k=>{const _=k?o:s,j=k?i:l;y(k?"pre-entering":"pre-exiting"),window.clearTimeout(x.current);const I=h?0:k?e:t;if(v(I),I===0)typeof _=="function"&&_(),typeof j=="function"&&j(),y(k?"entered":"exited");else{const E=window.setTimeout(()=>{typeof _=="function"&&_(),y(k?"entering":"exiting")},10);x.current=window.setTimeout(()=>{window.clearTimeout(E),typeof j=="function"&&j(),y(k?"entered":"exited")},I)}};return $o(()=>{w(r)},[r]),d.useEffect(()=>()=>window.clearTimeout(x.current),[]),{transitionDuration:m,transitionStatus:b,transitionTimingFunction:n||u.transitionTimingFunction}}function M6({keepMounted:e,transition:t,duration:n=250,exitDuration:r=n,mounted:o,children:s,timingFunction:i,onExit:l,onEntered:u,onEnter:p,onExited:h}){const{transitionDuration:m,transitionStatus:v,transitionTimingFunction:b}=wX({mounted:o,exitDuration:r,duration:n,timingFunction:i,onExit:l,onEntered:u,onEnter:p,onExited:h});return m===0?o?H.createElement(H.Fragment,null,s({})):e?s({display:"none"}):null:v==="exited"?e?s({display:"none"}):null:H.createElement(H.Fragment,null,s(CX({transition:t,duration:m,state:v,timingFunction:b})))}M6.displayName="@mantine/core/Transition";function O6({children:e,active:t=!0,refProp:n="ref"}){const r=MU(t),o=Bd(r,e==null?void 0:e.ref);return rI(e)?d.cloneElement(e,{[n]:o}):e}O6.displayName="@mantine/core/FocusTrap";var SX=Object.defineProperty,kX=Object.defineProperties,_X=Object.getOwnPropertyDescriptors,G4=Object.getOwnPropertySymbols,jX=Object.prototype.hasOwnProperty,PX=Object.prototype.propertyIsEnumerable,K4=(e,t,n)=>t in e?SX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Pa=(e,t)=>{for(var n in t||(t={}))jX.call(t,n)&&K4(e,n,t[n]);if(G4)for(var n of G4(t))PX.call(t,n)&&K4(e,n,t[n]);return e},pp=(e,t)=>kX(e,_X(t));function q4(e,t,n,r){return e==="center"||r==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function X4(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 IX={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function EX({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,arrowX:s,arrowY:i,dir:l}){const[u,p="center"]=e.split("-"),h={width:Oe(t),height:Oe(t),transform:"rotate(45deg)",position:"absolute",[IX[u]]:Oe(r)},m=Oe(-t/2);return u==="left"?pp(Pa(Pa({},h),q4(p,i,n,o)),{right:m,borderLeftColor:"transparent",borderBottomColor:"transparent"}):u==="right"?pp(Pa(Pa({},h),q4(p,i,n,o)),{left:m,borderRightColor:"transparent",borderTopColor:"transparent"}):u==="top"?pp(Pa(Pa({},h),X4(p,s,n,o,l)),{bottom:m,borderTopColor:"transparent",borderLeftColor:"transparent"}):u==="bottom"?pp(Pa(Pa({},h),X4(p,s,n,o,l)),{top:m,borderBottomColor:"transparent",borderRightColor:"transparent"}):{}}var MX=Object.defineProperty,OX=Object.defineProperties,DX=Object.getOwnPropertyDescriptors,Rh=Object.getOwnPropertySymbols,D6=Object.prototype.hasOwnProperty,R6=Object.prototype.propertyIsEnumerable,Y4=(e,t,n)=>t in e?MX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,RX=(e,t)=>{for(var n in t||(t={}))D6.call(t,n)&&Y4(e,n,t[n]);if(Rh)for(var n of Rh(t))R6.call(t,n)&&Y4(e,n,t[n]);return e},AX=(e,t)=>OX(e,DX(t)),NX=(e,t)=>{var n={};for(var r in e)D6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Rh)for(var r of Rh(e))t.indexOf(r)<0&&R6.call(e,r)&&(n[r]=e[r]);return n};const A6=d.forwardRef((e,t)=>{var n=e,{position:r,arrowSize:o,arrowOffset:s,arrowRadius:i,arrowPosition:l,visible:u,arrowX:p,arrowY:h}=n,m=NX(n,["position","arrowSize","arrowOffset","arrowRadius","arrowPosition","visible","arrowX","arrowY"]);const v=ua();return u?H.createElement("div",AX(RX({},m),{ref:t,style:EX({position:r,arrowSize:o,arrowOffset:s,arrowRadius:i,arrowPosition:l,dir:v.dir,arrowX:p,arrowY:h})})):null});A6.displayName="@mantine/core/FloatingArrow";var TX=Object.defineProperty,$X=Object.defineProperties,LX=Object.getOwnPropertyDescriptors,Ah=Object.getOwnPropertySymbols,N6=Object.prototype.hasOwnProperty,T6=Object.prototype.propertyIsEnumerable,Q4=(e,t,n)=>t in e?TX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Rl=(e,t)=>{for(var n in t||(t={}))N6.call(t,n)&&Q4(e,n,t[n]);if(Ah)for(var n of Ah(t))T6.call(t,n)&&Q4(e,n,t[n]);return e},hp=(e,t)=>$X(e,LX(t)),zX=(e,t)=>{var n={};for(var r in e)N6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ah)for(var r of Ah(e))t.indexOf(r)<0&&T6.call(e,r)&&(n[r]=e[r]);return n};const FX={};function $6(e){var t;const n=Sn("PopoverDropdown",FX,e),{style:r,className:o,children:s,onKeyDownCapture:i}=n,l=zX(n,["style","className","children","onKeyDownCapture"]),u=j6(),{classes:p,cx:h}=vX({radius:u.radius,shadow:u.shadow},{name:u.__staticSelector,classNames:u.classNames,styles:u.styles,unstyled:u.unstyled,variant:u.variant}),m=SU({opened:u.opened,shouldReturnFocus:u.returnFocus}),v=u.withRoles?{"aria-labelledby":u.getTargetId(),id:u.getDropdownId(),role:"dialog"}:{};return u.disabled?null:H.createElement($I,hp(Rl({},u.portalProps),{withinPortal:u.withinPortal}),H.createElement(M6,hp(Rl({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}),b=>{var y,x;return H.createElement(O6,{active:u.trapFocus},H.createElement(Or,Rl(hp(Rl({},v),{tabIndex:-1,ref:u.floating,style:hp(Rl(Rl({},r),b),{zIndex:u.zIndex,top:(y=u.y)!=null?y:0,left:(x=u.x)!=null?x:0,width:u.width==="target"?void 0:Oe(u.width)}),className:h(p.dropdown,o),onKeyDownCapture:ZV(u.onClose,{active:u.closeOnEscape,onTrigger:m,onKeyDown:i}),"data-position":u.placement}),l),s,H.createElement(A6,{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})))}))}$6.displayName="@mantine/core/PopoverDropdown";function BX(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 Z4=Object.getOwnPropertySymbols,HX=Object.prototype.hasOwnProperty,WX=Object.prototype.propertyIsEnumerable,VX=(e,t)=>{var n={};for(var r in e)HX.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Z4)for(var r of Z4(e))t.indexOf(r)<0&&WX.call(e,r)&&(n[r]=e[r]);return n};const UX={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:Gx("popover"),__staticSelector:"Popover",width:"max-content"};function Hc(e){var t,n,r,o,s,i;const l=d.useRef(null),u=Sn("Popover",UX,e),{children:p,position:h,offset:m,onPositionChange:v,positionDependencies:b,opened:y,transitionProps:x,width:w,middlewares:k,withArrow:_,arrowSize:j,arrowOffset:I,arrowRadius:E,arrowPosition:M,unstyled:D,classNames:R,styles:A,closeOnClickOutside:O,withinPortal:T,portalProps:K,closeOnEscape:F,clickOutsideEvents:V,trapFocus:X,onClose:W,onOpen:z,onChange:Y,zIndex:B,radius:q,shadow:re,id:Q,defaultOpened:le,__staticSelector:se,withRoles:U,disabled:G,returnFocus:te,variant:ae,keepMounted:oe}=u,pe=VX(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"]),[ue,me]=d.useState(null),[Ce,ge]=d.useState(null),fe=qx(Q),De=ua(),je=lX({middlewares:k,width:w,position:BX(De.dir,h),offset:typeof m=="number"?m+(_?j/2:0):m,arrowRef:l,arrowOffset:I,onPositionChange:v,positionDependencies:b,opened:y,defaultOpened:le,onChange:Y,onOpen:z,onClose:W});xU(()=>je.opened&&O&&je.onClose(),V,[ue,Ce]);const Be=d.useCallback(Ue=>{me(Ue),je.floating.reference(Ue)},[je.floating.reference]),rt=d.useCallback(Ue=>{ge(Ue),je.floating.floating(Ue)},[je.floating.floating]);return H.createElement(cX,{value:{returnFocus:te,disabled:G,controlled:je.controlled,reference:Be,floating:rt,x:je.floating.x,y:je.floating.y,arrowX:(r=(n=(t=je.floating)==null?void 0:t.middlewareData)==null?void 0:n.arrow)==null?void 0:r.x,arrowY:(i=(s=(o=je.floating)==null?void 0:o.middlewareData)==null?void 0:s.arrow)==null?void 0:i.y,opened:je.opened,arrowRef:l,transitionProps:x,width:w,withArrow:_,arrowSize:j,arrowOffset:I,arrowRadius:E,arrowPosition:M,placement:je.floating.placement,trapFocus:X,withinPortal:T,portalProps:K,zIndex:B,radius:q,shadow:re,closeOnEscape:F,onClose:je.onClose,onToggle:je.onToggle,getTargetId:()=>`${fe}-target`,getDropdownId:()=>`${fe}-dropdown`,withRoles:U,targetProps:pe,__staticSelector:se,classNames:R,styles:A,unstyled:D,variant:ae,keepMounted:oe}},p)}Hc.Target=E6;Hc.Dropdown=$6;Hc.displayName="@mantine/core/Popover";var GX=Object.defineProperty,Nh=Object.getOwnPropertySymbols,L6=Object.prototype.hasOwnProperty,z6=Object.prototype.propertyIsEnumerable,J4=(e,t,n)=>t in e?GX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,KX=(e,t)=>{for(var n in t||(t={}))L6.call(t,n)&&J4(e,n,t[n]);if(Nh)for(var n of Nh(t))z6.call(t,n)&&J4(e,n,t[n]);return e},qX=(e,t)=>{var n={};for(var r in e)L6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Nh)for(var r of Nh(e))t.indexOf(r)<0&&z6.call(e,r)&&(n[r]=e[r]);return n};function XX(e){var t=e,{children:n,component:r="div",maxHeight:o=220,direction:s="column",id:i,innerRef:l,__staticSelector:u,styles:p,classNames:h,unstyled:m}=t,v=qX(t,["children","component","maxHeight","direction","id","innerRef","__staticSelector","styles","classNames","unstyled"]);const{classes:b}=Mq(null,{name:u,styles:p,classNames:h,unstyled:m});return H.createElement(Hc.Dropdown,KX({p:0,onMouseDown:y=>y.preventDefault()},v),H.createElement("div",{style:{maxHeight:Oe(o),display:"flex"}},H.createElement(Or,{component:r||"div",id:`${i}-items`,"aria-labelledby":`${i}-label`,role:"listbox",onMouseDown:y=>y.preventDefault(),style:{flex:1,overflowY:r!==Jm?"auto":void 0},"data-combobox-popover":!0,tabIndex:-1,ref:l},H.createElement("div",{className:b.itemsWrapper,style:{flexDirection:s}},n))))}function Ha({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:h,positionDependencies:m=[],classNames:v,styles:b,unstyled:y,readOnly:x,variant:w}){return H.createElement(Hc,{unstyled:y,classNames:v,styles:b,width:"target",withRoles:!1,opened:e,middlewares:{flip:h==="flip",shift:!1},position:h==="flip"?"bottom":h,positionDependencies:m,zIndex:p,__staticSelector:i,withinPortal:r,portalProps:o,transitionProps:t,shadow:n,disabled:x,onPositionChange:k=>u&&(l==null?void 0:l(k==="top"?"column-reverse":"column")),variant:w},s)}Ha.Target=Hc.Target;Ha.Dropdown=XX;var YX=Object.defineProperty,QX=Object.defineProperties,ZX=Object.getOwnPropertyDescriptors,Th=Object.getOwnPropertySymbols,F6=Object.prototype.hasOwnProperty,B6=Object.prototype.propertyIsEnumerable,ek=(e,t,n)=>t in e?YX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mp=(e,t)=>{for(var n in t||(t={}))F6.call(t,n)&&ek(e,n,t[n]);if(Th)for(var n of Th(t))B6.call(t,n)&&ek(e,n,t[n]);return e},JX=(e,t)=>QX(e,ZX(t)),eY=(e,t)=>{var n={};for(var r in e)F6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Th)for(var r of Th(e))t.indexOf(r)<0&&B6.call(e,r)&&(n[r]=e[r]);return n};function H6(e,t,n){const r=Sn(e,t,n),{label:o,description:s,error:i,required:l,classNames:u,styles:p,className:h,unstyled:m,__staticSelector:v,sx:b,errorProps:y,labelProps:x,descriptionProps:w,wrapperProps:k,id:_,size:j,style:I,inputContainer:E,inputWrapperOrder:M,withAsterisk:D,variant:R}=r,A=eY(r,["label","description","error","required","classNames","styles","className","unstyled","__staticSelector","sx","errorProps","labelProps","descriptionProps","wrapperProps","id","size","style","inputContainer","inputWrapperOrder","withAsterisk","variant"]),O=qx(_),{systemStyles:T,rest:K}=Xm(A),F=mp({label:o,description:s,error:i,required:l,classNames:u,className:h,__staticSelector:v,sx:b,errorProps:y,labelProps:x,descriptionProps:w,unstyled:m,styles:p,id:O,size:j,style:I,inputContainer:E,inputWrapperOrder:M,withAsterisk:D,variant:R},k);return JX(mp({},K),{classNames:u,styles:p,unstyled:m,wrapperProps:mp(mp({},F),T),inputProps:{required:l,classNames:u,styles:p,unstyled:m,id:O,size:j,__staticSelector:v,error:i,variant:R}})}var tY=or((e,t,{size:n})=>({label:{display:"inline-block",fontSize:ut({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 nY=tY;var rY=Object.defineProperty,$h=Object.getOwnPropertySymbols,W6=Object.prototype.hasOwnProperty,V6=Object.prototype.propertyIsEnumerable,tk=(e,t,n)=>t in e?rY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,oY=(e,t)=>{for(var n in t||(t={}))W6.call(t,n)&&tk(e,n,t[n]);if($h)for(var n of $h(t))V6.call(t,n)&&tk(e,n,t[n]);return e},sY=(e,t)=>{var n={};for(var r in e)W6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&$h)for(var r of $h(e))t.indexOf(r)<0&&V6.call(e,r)&&(n[r]=e[r]);return n};const aY={labelElement:"label",size:"sm"},ry=d.forwardRef((e,t)=>{const n=Sn("InputLabel",aY,e),{labelElement:r,children:o,required:s,size:i,classNames:l,styles:u,unstyled:p,className:h,htmlFor:m,__staticSelector:v,variant:b,onMouseDown:y}=n,x=sY(n,["labelElement","children","required","size","classNames","styles","unstyled","className","htmlFor","__staticSelector","variant","onMouseDown"]),{classes:w,cx:k}=nY(null,{name:["InputWrapper",v],classNames:l,styles:u,unstyled:p,variant:b,size:i});return H.createElement(Or,oY({component:r,ref:t,className:k(w.label,h),htmlFor:r==="label"?m:void 0,onMouseDown:_=>{y==null||y(_),!_.defaultPrevented&&_.detail>1&&_.preventDefault()}},x),o,s&&H.createElement("span",{className:w.required,"aria-hidden":!0}," *"))});ry.displayName="@mantine/core/InputLabel";var iY=or((e,t,{size:n})=>({error:{wordBreak:"break-word",color:e.fn.variant({variant:"filled",color:"red"}).background,fontSize:`calc(${ut({size:n,sizes:e.fontSizes})} - ${Oe(2)})`,lineHeight:1.2,display:"block"}}));const lY=iY;var cY=Object.defineProperty,Lh=Object.getOwnPropertySymbols,U6=Object.prototype.hasOwnProperty,G6=Object.prototype.propertyIsEnumerable,nk=(e,t,n)=>t in e?cY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,uY=(e,t)=>{for(var n in t||(t={}))U6.call(t,n)&&nk(e,n,t[n]);if(Lh)for(var n of Lh(t))G6.call(t,n)&&nk(e,n,t[n]);return e},dY=(e,t)=>{var n={};for(var r in e)U6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Lh)for(var r of Lh(e))t.indexOf(r)<0&&G6.call(e,r)&&(n[r]=e[r]);return n};const fY={size:"sm"},oy=d.forwardRef((e,t)=>{const n=Sn("InputError",fY,e),{children:r,className:o,classNames:s,styles:i,unstyled:l,size:u,__staticSelector:p,variant:h}=n,m=dY(n,["children","className","classNames","styles","unstyled","size","__staticSelector","variant"]),{classes:v,cx:b}=lY(null,{name:["InputWrapper",p],classNames:s,styles:i,unstyled:l,variant:h,size:u});return H.createElement(kc,uY({className:b(v.error,o),ref:t},m),r)});oy.displayName="@mantine/core/InputError";var pY=or((e,t,{size:n})=>({description:{wordBreak:"break-word",color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],fontSize:`calc(${ut({size:n,sizes:e.fontSizes})} - ${Oe(2)})`,lineHeight:1.2,display:"block"}}));const hY=pY;var mY=Object.defineProperty,zh=Object.getOwnPropertySymbols,K6=Object.prototype.hasOwnProperty,q6=Object.prototype.propertyIsEnumerable,rk=(e,t,n)=>t in e?mY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gY=(e,t)=>{for(var n in t||(t={}))K6.call(t,n)&&rk(e,n,t[n]);if(zh)for(var n of zh(t))q6.call(t,n)&&rk(e,n,t[n]);return e},vY=(e,t)=>{var n={};for(var r in e)K6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&zh)for(var r of zh(e))t.indexOf(r)<0&&q6.call(e,r)&&(n[r]=e[r]);return n};const bY={size:"sm"},sy=d.forwardRef((e,t)=>{const n=Sn("InputDescription",bY,e),{children:r,className:o,classNames:s,styles:i,unstyled:l,size:u,__staticSelector:p,variant:h}=n,m=vY(n,["children","className","classNames","styles","unstyled","size","__staticSelector","variant"]),{classes:v,cx:b}=hY(null,{name:["InputWrapper",p],classNames:s,styles:i,unstyled:l,variant:h,size:u});return H.createElement(kc,gY({color:"dimmed",className:b(v.description,o),ref:t,unstyled:l},m),r)});sy.displayName="@mantine/core/InputDescription";const X6=d.createContext({offsetBottom:!1,offsetTop:!1,describedBy:void 0}),xY=X6.Provider,yY=()=>d.useContext(X6);function CY(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 wY=Object.defineProperty,SY=Object.defineProperties,kY=Object.getOwnPropertyDescriptors,ok=Object.getOwnPropertySymbols,_Y=Object.prototype.hasOwnProperty,jY=Object.prototype.propertyIsEnumerable,sk=(e,t,n)=>t in e?wY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,PY=(e,t)=>{for(var n in t||(t={}))_Y.call(t,n)&&sk(e,n,t[n]);if(ok)for(var n of ok(t))jY.call(t,n)&&sk(e,n,t[n]);return e},IY=(e,t)=>SY(e,kY(t)),EY=or(e=>({root:IY(PY({},e.fn.fontStyles()),{lineHeight:e.lineHeight})}));const MY=EY;var OY=Object.defineProperty,DY=Object.defineProperties,RY=Object.getOwnPropertyDescriptors,Fh=Object.getOwnPropertySymbols,Y6=Object.prototype.hasOwnProperty,Q6=Object.prototype.propertyIsEnumerable,ak=(e,t,n)=>t in e?OY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ia=(e,t)=>{for(var n in t||(t={}))Y6.call(t,n)&&ak(e,n,t[n]);if(Fh)for(var n of Fh(t))Q6.call(t,n)&&ak(e,n,t[n]);return e},ik=(e,t)=>DY(e,RY(t)),AY=(e,t)=>{var n={};for(var r in e)Y6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Fh)for(var r of Fh(e))t.indexOf(r)<0&&Q6.call(e,r)&&(n[r]=e[r]);return n};const NY={labelElement:"label",size:"sm",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},Z6=d.forwardRef((e,t)=>{const n=Sn("InputWrapper",NY,e),{className:r,label:o,children:s,required:i,id:l,error:u,description:p,labelElement:h,labelProps:m,descriptionProps:v,errorProps:b,classNames:y,styles:x,size:w,inputContainer:k,__staticSelector:_,unstyled:j,inputWrapperOrder:I,withAsterisk:E,variant:M}=n,D=AY(n,["className","label","children","required","id","error","description","labelElement","labelProps","descriptionProps","errorProps","classNames","styles","size","inputContainer","__staticSelector","unstyled","inputWrapperOrder","withAsterisk","variant"]),{classes:R,cx:A}=MY(null,{classNames:y,styles:x,name:["InputWrapper",_],unstyled:j,variant:M,size:w}),O={classNames:y,styles:x,unstyled:j,size:w,variant:M,__staticSelector:_},T=typeof E=="boolean"?E:i,K=l?`${l}-error`:b==null?void 0:b.id,F=l?`${l}-description`:v==null?void 0:v.id,X=`${!!u&&typeof u!="boolean"?K:""} ${p?F:""}`,W=X.trim().length>0?X.trim():void 0,z=o&&H.createElement(ry,Ia(Ia({key:"label",labelElement:h,id:l?`${l}-label`:void 0,htmlFor:l,required:T},O),m),o),Y=p&&H.createElement(sy,ik(Ia(Ia({key:"description"},v),O),{size:(v==null?void 0:v.size)||O.size,id:(v==null?void 0:v.id)||F}),p),B=H.createElement(d.Fragment,{key:"input"},k(s)),q=typeof u!="boolean"&&u&&H.createElement(oy,ik(Ia(Ia({},b),O),{size:(b==null?void 0:b.size)||O.size,key:"error",id:(b==null?void 0:b.id)||K}),u),re=I.map(Q=>{switch(Q){case"label":return z;case"input":return B;case"description":return Y;case"error":return q;default:return null}});return H.createElement(xY,{value:Ia({describedBy:W},CY(I,{hasDescription:!!Y,hasError:!!q}))},H.createElement(Or,Ia({className:A(R.root,r),ref:t},D),re))});Z6.displayName="@mantine/core/InputWrapper";var TY=Object.defineProperty,Bh=Object.getOwnPropertySymbols,J6=Object.prototype.hasOwnProperty,eE=Object.prototype.propertyIsEnumerable,lk=(e,t,n)=>t in e?TY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$Y=(e,t)=>{for(var n in t||(t={}))J6.call(t,n)&&lk(e,n,t[n]);if(Bh)for(var n of Bh(t))eE.call(t,n)&&lk(e,n,t[n]);return e},LY=(e,t)=>{var n={};for(var r in e)J6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Bh)for(var r of Bh(e))t.indexOf(r)<0&&eE.call(e,r)&&(n[r]=e[r]);return n};const zY={},tE=d.forwardRef((e,t)=>{const n=Sn("InputPlaceholder",zY,e),{sx:r}=n,o=LY(n,["sx"]);return H.createElement(Or,$Y({component:"span",sx:[s=>s.fn.placeholderStyles(),...tI(r)],ref:t},o))});tE.displayName="@mantine/core/InputPlaceholder";var FY=Object.defineProperty,BY=Object.defineProperties,HY=Object.getOwnPropertyDescriptors,ck=Object.getOwnPropertySymbols,WY=Object.prototype.hasOwnProperty,VY=Object.prototype.propertyIsEnumerable,uk=(e,t,n)=>t in e?FY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gp=(e,t)=>{for(var n in t||(t={}))WY.call(t,n)&&uk(e,n,t[n]);if(ck)for(var n of ck(t))VY.call(t,n)&&uk(e,n,t[n]);return e},kv=(e,t)=>BY(e,HY(t));const oo={xs:Oe(30),sm:Oe(36),md:Oe(42),lg:Oe(50),xl:Oe(60)},UY=["default","filled","unstyled"];function GY({theme:e,variant:t}){return UY.includes(t)?t==="default"?{border:`${Oe(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:`${Oe(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:Oe(28),outline:0,"&:focus, &:focus-within":{outline:"none",borderColor:"transparent"},"&:disabled":{backgroundColor:"transparent","&:focus, &:focus-within":{outline:"none",borderColor:"transparent"}}}:null}var KY=or((e,{multiline:t,radius:n,invalid:r,rightSectionWidth:o,withRightSection:s,iconWidth:i,offsetBottom:l,offsetTop:u,pointer:p},{variant:h,size:m})=>{const v=e.fn.variant({variant:"filled",color:"red"}).background,b=h==="default"||h==="filled"?{minHeight:ut({size:m,sizes:oo}),paddingLeft:`calc(${ut({size:m,sizes:oo})} / 3)`,paddingRight:s?o||ut({size:m,sizes:oo}):`calc(${ut({size:m,sizes:oo})} / 3)`,borderRadius:e.fn.radius(n)}:h==="unstyled"&&s?{paddingRight:o||ut({size:m,sizes:oo})}: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:kv(gp(gp(kv(gp({},e.fn.fontStyles()),{height:t?h==="unstyled"?void 0:"auto":ut({size:m,sizes:oo}),WebkitTapHighlightColor:"transparent",lineHeight:t?e.lineHeight:`calc(${ut({size:m,sizes:oo})} - ${Oe(2)})`,appearance:"none",resize:"none",boxSizing:"border-box",fontSize:ut({size:m,sizes:e.fontSizes}),width:"100%",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,display:"block",textAlign:"left",cursor:p?"pointer":void 0}),GY({theme:e,variant:h})),b),{"&: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:v,borderColor:v,"&::placeholder":{opacity:1,color:v}},"&[data-with-icon]":{paddingLeft:typeof i=="number"?Oe(i):ut({size:m,sizes:oo})},"&::placeholder":kv(gp({},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?Oe(i):ut({size:m,sizes:oo}),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||ut({size:m,sizes:oo})}}});const qY=KY;var XY=Object.defineProperty,YY=Object.defineProperties,QY=Object.getOwnPropertyDescriptors,Hh=Object.getOwnPropertySymbols,nE=Object.prototype.hasOwnProperty,rE=Object.prototype.propertyIsEnumerable,dk=(e,t,n)=>t in e?XY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vp=(e,t)=>{for(var n in t||(t={}))nE.call(t,n)&&dk(e,n,t[n]);if(Hh)for(var n of Hh(t))rE.call(t,n)&&dk(e,n,t[n]);return e},fk=(e,t)=>YY(e,QY(t)),ZY=(e,t)=>{var n={};for(var r in e)nE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Hh)for(var r of Hh(e))t.indexOf(r)<0&&rE.call(e,r)&&(n[r]=e[r]);return n};const JY={size:"sm",variant:"default"},rl=d.forwardRef((e,t)=>{const n=Sn("Input",JY,e),{className:r,error:o,required:s,disabled:i,variant:l,icon:u,style:p,rightSectionWidth:h,iconWidth:m,rightSection:v,rightSectionProps:b,radius:y,size:x,wrapperProps:w,classNames:k,styles:_,__staticSelector:j,multiline:I,sx:E,unstyled:M,pointer:D}=n,R=ZY(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}=yY(),{classes:K,cx:F}=qY({radius:y,multiline:I,invalid:!!o,rightSectionWidth:h?Oe(h):void 0,iconWidth:m,withRightSection:!!v,offsetBottom:A,offsetTop:O,pointer:D},{classNames:k,styles:_,name:["Input",j],unstyled:M,variant:l,size:x}),{systemStyles:V,rest:X}=Xm(R);return H.createElement(Or,vp(vp({className:F(K.wrapper,r),sx:E,style:p},V),w),u&&H.createElement("div",{className:K.icon},u),H.createElement(Or,fk(vp({component:"input"},X),{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:K.input})),v&&H.createElement("div",fk(vp({},b),{className:K.rightSection}),v))});rl.displayName="@mantine/core/Input";rl.Wrapper=Z6;rl.Label=ry;rl.Description=sy;rl.Error=oy;rl.Placeholder=tE;const Ic=rl;var eQ=Object.defineProperty,Wh=Object.getOwnPropertySymbols,oE=Object.prototype.hasOwnProperty,sE=Object.prototype.propertyIsEnumerable,pk=(e,t,n)=>t in e?eQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hk=(e,t)=>{for(var n in t||(t={}))oE.call(t,n)&&pk(e,n,t[n]);if(Wh)for(var n of Wh(t))sE.call(t,n)&&pk(e,n,t[n]);return e},tQ=(e,t)=>{var n={};for(var r in e)oE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Wh)for(var r of Wh(e))t.indexOf(r)<0&&sE.call(e,r)&&(n[r]=e[r]);return n};const nQ={multiple:!1},aE=d.forwardRef((e,t)=>{const n=Sn("FileButton",nQ,e),{onChange:r,children:o,multiple:s,accept:i,name:l,form:u,resetRef:p,disabled:h,capture:m,inputProps:v}=n,b=tQ(n,["onChange","children","multiple","accept","name","form","resetRef","disabled","capture","inputProps"]),y=d.useRef(),x=()=>{!h&&y.current.click()},w=_=>{r(s?Array.from(_.currentTarget.files):_.currentTarget.files[0]||null)};return dI(p,()=>{y.current.value=""}),H.createElement(H.Fragment,null,o(hk({onClick:x},b)),H.createElement("input",hk({style:{display:"none"},type:"file",accept:i,multiple:s,onChange:w,ref:Bd(t,y),name:l,form:u,capture:m},v)))});aE.displayName="@mantine/core/FileButton";const iE={xs:Oe(16),sm:Oe(22),md:Oe(26),lg:Oe(30),xl:Oe(36)},rQ={xs:Oe(10),sm:Oe(12),md:Oe(14),lg:Oe(16),xl:Oe(18)};var oQ=or((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:ut({size:o,sizes:iE}),paddingLeft:`calc(${ut({size:o,sizes:e.spacing})} / 1.5)`,paddingRight:t||r?ut({size:o,sizes:e.spacing}):0,fontWeight:500,fontSize:ut({size:o,sizes:rQ}),borderRadius:ut({size:n,sizes:e.radius}),cursor:t?"not-allowed":"default",userSelect:"none",maxWidth:`calc(100% - ${Oe(10)})`},defaultValueRemove:{color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],marginLeft:`calc(${ut({size:o,sizes:e.spacing})} / 6)`},defaultValueLabel:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}));const sQ=oQ;var aQ=Object.defineProperty,Vh=Object.getOwnPropertySymbols,lE=Object.prototype.hasOwnProperty,cE=Object.prototype.propertyIsEnumerable,mk=(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={}))lE.call(t,n)&&mk(e,n,t[n]);if(Vh)for(var n of Vh(t))cE.call(t,n)&&mk(e,n,t[n]);return e},lQ=(e,t)=>{var n={};for(var r in e)lE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Vh)for(var r of Vh(e))t.indexOf(r)<0&&cE.call(e,r)&&(n[r]=e[r]);return n};const cQ={xs:16,sm:22,md:24,lg:26,xl:30};function uE(e){var t=e,{label:n,classNames:r,styles:o,className:s,onRemove:i,disabled:l,readOnly:u,size:p,radius:h="sm",variant:m,unstyled:v}=t,b=lQ(t,["label","classNames","styles","className","onRemove","disabled","readOnly","size","radius","variant","unstyled"]);const{classes:y,cx:x}=sQ({disabled:l,readOnly:u,radius:h},{name:"MultiSelect",classNames:r,styles:o,unstyled:v,size:p,variant:m});return H.createElement("div",iQ({className:x(y.defaultValue,s)},b),H.createElement("span",{className:y.defaultValueLabel},n),!l&&!u&&H.createElement(VI,{"aria-hidden":!0,onMouseDown:i,size:cQ[p],radius:2,color:"blue",variant:"transparent",iconSize:"70%",className:y.defaultValueRemove,tabIndex:-1,unstyled:v}))}uE.displayName="@mantine/core/MultiSelect/DefaultValue";function uQ({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(h=>h===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 dQ=Object.defineProperty,Uh=Object.getOwnPropertySymbols,dE=Object.prototype.hasOwnProperty,fE=Object.prototype.propertyIsEnumerable,gk=(e,t,n)=>t in e?dQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vk=(e,t)=>{for(var n in t||(t={}))dE.call(t,n)&&gk(e,n,t[n]);if(Uh)for(var n of Uh(t))fE.call(t,n)&&gk(e,n,t[n]);return e},fQ=(e,t)=>{var n={};for(var r in e)dE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Uh)for(var r of Uh(e))t.indexOf(r)<0&&fE.call(e,r)&&(n[r]=e[r]);return n};const pQ={xs:Oe(14),sm:Oe(18),md:Oe(20),lg:Oe(24),xl:Oe(28)};function hQ(e){var t=e,{size:n,error:r,style:o}=t,s=fQ(t,["size","error","style"]);const i=ua(),l=ut({size:n,sizes:pQ});return H.createElement("svg",vk({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:vk({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 mQ=Object.defineProperty,gQ=Object.defineProperties,vQ=Object.getOwnPropertyDescriptors,bk=Object.getOwnPropertySymbols,bQ=Object.prototype.hasOwnProperty,xQ=Object.prototype.propertyIsEnumerable,xk=(e,t,n)=>t in e?mQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yQ=(e,t)=>{for(var n in t||(t={}))bQ.call(t,n)&&xk(e,n,t[n]);if(bk)for(var n of bk(t))xQ.call(t,n)&&xk(e,n,t[n]);return e},CQ=(e,t)=>gQ(e,vQ(t));function pE({shouldClear:e,clearButtonProps:t,onClear:n,size:r,error:o}){return e?H.createElement(VI,CQ(yQ({},t),{variant:"transparent",onClick:n,size:r,onMouseDown:s=>s.preventDefault()})):H.createElement(hQ,{error:o,size:r})}pE.displayName="@mantine/core/SelectRightSection";var wQ=Object.defineProperty,SQ=Object.defineProperties,kQ=Object.getOwnPropertyDescriptors,Gh=Object.getOwnPropertySymbols,hE=Object.prototype.hasOwnProperty,mE=Object.prototype.propertyIsEnumerable,yk=(e,t,n)=>t in e?wQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_v=(e,t)=>{for(var n in t||(t={}))hE.call(t,n)&&yk(e,n,t[n]);if(Gh)for(var n of Gh(t))mE.call(t,n)&&yk(e,n,t[n]);return e},Ck=(e,t)=>SQ(e,kQ(t)),_Q=(e,t)=>{var n={};for(var r in e)hE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Gh)for(var r of Gh(e))t.indexOf(r)<0&&mE.call(e,r)&&(n[r]=e[r]);return n};function gE(e){var t=e,{styles:n,rightSection:r,rightSectionWidth:o,theme:s}=t,i=_Q(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(pE,_v({},i)),styles:Ck(_v({},l),{rightSection:Ck(_v({},l==null?void 0:l.rightSection),{pointerEvents:i.shouldClear?void 0:"none"})})}}var jQ=Object.defineProperty,PQ=Object.defineProperties,IQ=Object.getOwnPropertyDescriptors,wk=Object.getOwnPropertySymbols,EQ=Object.prototype.hasOwnProperty,MQ=Object.prototype.propertyIsEnumerable,Sk=(e,t,n)=>t in e?jQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,OQ=(e,t)=>{for(var n in t||(t={}))EQ.call(t,n)&&Sk(e,n,t[n]);if(wk)for(var n of wk(t))MQ.call(t,n)&&Sk(e,n,t[n]);return e},DQ=(e,t)=>PQ(e,IQ(t)),RQ=or((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(${ut({size:n,sizes:oo})} - ${Oe(2)})`,display:"flex",alignItems:"center",flexWrap:"wrap",marginLeft:`calc(-${e.spacing.xs} / 2)`,boxSizing:"border-box","&[data-clearable]":{marginRight:ut({size:n,sizes:oo})}},value:{margin:`calc(${e.spacing.xs} / 2 - ${Oe(2)}) calc(${e.spacing.xs} / 2)`},searchInput:DQ(OQ({},e.fn.fontStyles()),{flex:1,minWidth:Oe(60),backgroundColor:"transparent",border:0,outline:0,fontSize:ut({size:n,sizes:e.fontSizes}),padding:0,marginLeft:`calc(${e.spacing.xs} / 2)`,appearance:"none",color:"inherit",maxHeight:ut({size:n,sizes:iE}),"&::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 AQ=RQ;var NQ=Object.defineProperty,TQ=Object.defineProperties,$Q=Object.getOwnPropertyDescriptors,Kh=Object.getOwnPropertySymbols,vE=Object.prototype.hasOwnProperty,bE=Object.prototype.propertyIsEnumerable,kk=(e,t,n)=>t in e?NQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Al=(e,t)=>{for(var n in t||(t={}))vE.call(t,n)&&kk(e,n,t[n]);if(Kh)for(var n of Kh(t))bE.call(t,n)&&kk(e,n,t[n]);return e},_k=(e,t)=>TQ(e,$Q(t)),LQ=(e,t)=>{var n={};for(var r in e)vE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Kh)for(var r of Kh(e))t.indexOf(r)<0&&bE.call(e,r)&&(n[r]=e[r]);return n};function zQ(e,t,n){return t?!1:n.label.toLowerCase().trim().includes(e.toLowerCase().trim())}function FQ(e,t){return!!e&&!t.some(n=>n.value.toLowerCase()===e.toLowerCase())}function jk(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 BQ={size:"sm",valueComponent:uE,itemComponent:Yx,transitionProps:{transition:"fade",duration:0},maxDropdownHeight:220,shadow:"sm",searchable:!1,filter:zQ,limit:1/0,clearSearchOnChange:!0,clearable:!1,clearSearchOnBlur:!1,disabled:!1,initiallyOpened:!1,creatable:!1,shouldCreate:FQ,switchDirectionOnFlip:!1,zIndex:Gx("popover"),selectOnBlur:!1,positionDependencies:[],dropdownPosition:"flip"},xE=d.forwardRef((e,t)=>{const n=Sn("MultiSelect",BQ,e),{className:r,style:o,required:s,label:i,description:l,size:u,error:p,classNames:h,styles:m,wrapperProps:v,value:b,defaultValue:y,data:x,onChange:w,valueComponent:k,itemComponent:_,id:j,transitionProps:I,maxDropdownHeight:E,shadow:M,nothingFound:D,onFocus:R,onBlur:A,searchable:O,placeholder:T,filter:K,limit:F,clearSearchOnChange:V,clearable:X,clearSearchOnBlur:W,variant:z,onSearchChange:Y,searchValue:B,disabled:q,initiallyOpened:re,radius:Q,icon:le,rightSection:se,rightSectionWidth:U,creatable:G,getCreateLabel:te,shouldCreate:ae,onCreate:oe,sx:pe,dropdownComponent:ue,onDropdownClose:me,onDropdownOpen:Ce,maxSelectedValues:ge,withinPortal:fe,portalProps:De,switchDirectionOnFlip:je,zIndex:Be,selectOnBlur:rt,name:Ue,dropdownPosition:wt,errorProps:Ye,labelProps:tt,descriptionProps:be,form:Re,positionDependencies:st,onKeyDown:mt,unstyled:ve,inputContainer:Qe,inputWrapperOrder:ot,readOnly:lt,withAsterisk:Me,clearButtonProps:$e,hoverOnSearchChange:At,disableSelectedItemFiltering:ke}=n,ze=LQ(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:Le,cx:Ve,theme:ct}=AQ({invalid:!!p},{name:"MultiSelect",classNames:h,styles:m,unstyled:ve,size:u,variant:z}),{systemStyles:bn,rest:jt}=Xm(ze),Pt=d.useRef(),sr=d.useRef({}),Mn=qx(j),[pn,an]=d.useState(re),[Qt,mr]=d.useState(-1),[wo,ar]=d.useState("column"),[ir,Is]=ad({value:B,defaultValue:"",finalValue:void 0,onChange:Y}),[Es,ha]=d.useState(!1),{scrollIntoView:ma,targetRef:cl,scrollableRef:ga}=pI({duration:0,offset:5,cancelable:!1,isList:!0}),ul=G&&typeof te=="function";let qe=null;const Nt=x.map(Je=>typeof Je=="string"?{label:Je,value:Je}:Je),On=nI({data:Nt}),[bt,va]=ad({value:jk(b,x),defaultValue:jk(y,x),finalValue:[],onChange:w}),Ar=d.useRef(!!ge&&ge<bt.length),Zd=Je=>{if(!lt){const St=bt.filter(xt=>xt!==Je);va(St),ge&&St.length<ge&&(Ar.current=!1)}},Ag=Je=>{Is(Je.currentTarget.value),!q&&!Ar.current&&O&&an(!0)},Ng=Je=>{typeof R=="function"&&R(Je),!q&&!Ar.current&&O&&an(!0)},Dn=uQ({data:On,searchable:O,searchValue:ir,limit:F,filter:K,value:bt,disableSelectedItemFiltering:ke});ul&&ae(ir,On)&&(qe=te(ir),Dn.push({label:ir,value:ir,creatable:!0}));const Ms=Math.min(Qt,Dn.length-1),Jd=(Je,St,xt)=>{let kt=Je;for(;xt(kt);)if(kt=St(kt),!Dn[kt].disabled)return kt;return Je};$o(()=>{mr(At&&ir?0:-1)},[ir,At]),$o(()=>{!q&&bt.length>x.length&&an(!1),ge&&bt.length<ge&&(Ar.current=!1),ge&&bt.length>=ge&&(Ar.current=!0,an(!1))},[bt]);const dl=Je=>{if(!lt)if(V&&Is(""),bt.includes(Je.value))Zd(Je.value);else{if(Je.creatable&&typeof oe=="function"){const St=oe(Je.value);typeof St<"u"&&St!==null&&va(typeof St=="string"?[...bt,St]:[...bt,St.value])}else va([...bt,Je.value]);bt.length===ge-1&&(Ar.current=!0,an(!1)),Dn.length===1&&an(!1)}},Qc=Je=>{typeof A=="function"&&A(Je),rt&&Dn[Ms]&&pn&&dl(Dn[Ms]),W&&Is(""),an(!1)},ai=Je=>{if(Es||(mt==null||mt(Je),lt)||Je.key!=="Backspace"&&ge&&Ar.current)return;const St=wo==="column",xt=()=>{mr(qn=>{var Ut;const kn=Jd(qn,lr=>lr+1,lr=>lr<Dn.length-1);return pn&&(cl.current=sr.current[(Ut=Dn[kn])==null?void 0:Ut.value],ma({alignment:St?"end":"start"})),kn})},kt=()=>{mr(qn=>{var Ut;const kn=Jd(qn,lr=>lr-1,lr=>lr>0);return pn&&(cl.current=sr.current[(Ut=Dn[kn])==null?void 0:Ut.value],ma({alignment:St?"start":"end"})),kn})};switch(Je.key){case"ArrowUp":{Je.preventDefault(),an(!0),St?kt():xt();break}case"ArrowDown":{Je.preventDefault(),an(!0),St?xt():kt();break}case"Enter":{Je.preventDefault(),Dn[Ms]&&pn?dl(Dn[Ms]):an(!0);break}case" ":{O||(Je.preventDefault(),Dn[Ms]&&pn?dl(Dn[Ms]):an(!0));break}case"Backspace":{bt.length>0&&ir.length===0&&(va(bt.slice(0,-1)),an(!0),ge&&(Ar.current=!1));break}case"Home":{if(!O){Je.preventDefault(),pn||an(!0);const qn=Dn.findIndex(Ut=>!Ut.disabled);mr(qn),ma({alignment:St?"end":"start"})}break}case"End":{if(!O){Je.preventDefault(),pn||an(!0);const qn=Dn.map(Ut=>!!Ut.disabled).lastIndexOf(!1);mr(qn),ma({alignment:St?"end":"start"})}break}case"Escape":an(!1)}},Zc=bt.map(Je=>{let St=On.find(xt=>xt.value===Je&&!xt.disabled);return!St&&ul&&(St={value:Je,label:Je}),St}).filter(Je=>!!Je).map((Je,St)=>H.createElement(k,_k(Al({},Je),{variant:z,disabled:q,className:Le.value,readOnly:lt,onRemove:xt=>{xt.preventDefault(),xt.stopPropagation(),Zd(Je.value)},key:Je.value,size:u,styles:m,classNames:h,radius:Q,index:St}))),Jc=Je=>bt.includes(Je),Tg=()=>{var Je;Is(""),va([]),(Je=Pt.current)==null||Je.focus(),ge&&(Ar.current=!1)},ba=!lt&&(Dn.length>0?pn:pn&&!!D);return $o(()=>{const Je=ba?Ce:me;typeof Je=="function"&&Je()},[ba]),H.createElement(Ic.Wrapper,Al(Al({required:s,id:Mn,label:i,error:p,description:l,size:u,className:r,style:o,classNames:h,styles:m,__staticSelector:"MultiSelect",sx:pe,errorProps:Ye,descriptionProps:be,labelProps:tt,inputContainer:Qe,inputWrapperOrder:ot,unstyled:ve,withAsterisk:Me,variant:z},bn),v),H.createElement(Ha,{opened:ba,transitionProps:I,shadow:"sm",withinPortal:fe,portalProps:De,__staticSelector:"MultiSelect",onDirectionChange:ar,switchDirectionOnFlip:je,zIndex:Be,dropdownPosition:wt,positionDependencies:[...st,ir],classNames:h,styles:m,unstyled:ve,variant:z},H.createElement(Ha.Target,null,H.createElement("div",{className:Le.wrapper,role:"combobox","aria-haspopup":"listbox","aria-owns":pn&&ba?`${Mn}-items`:null,"aria-controls":Mn,"aria-expanded":pn,onMouseLeave:()=>mr(-1),tabIndex:-1},H.createElement("input",{type:"hidden",name:Ue,value:bt.join(","),form:Re,disabled:q}),H.createElement(Ic,Al({__staticSelector:"MultiSelect",style:{overflow:"hidden"},component:"div",multiline:!0,size:u,variant:z,disabled:q,error:p,required:s,radius:Q,icon:le,unstyled:ve,onMouseDown:Je=>{var St;Je.preventDefault(),!q&&!Ar.current&&an(!pn),(St=Pt.current)==null||St.focus()},classNames:_k(Al({},h),{input:Ve({[Le.input]:!O},h==null?void 0:h.input)})},gE({theme:ct,rightSection:se,rightSectionWidth:U,styles:m,size:u,shouldClear:X&&bt.length>0,onClear:Tg,error:p,disabled:q,clearButtonProps:$e,readOnly:lt})),H.createElement("div",{className:Le.values,"data-clearable":X||void 0},Zc,H.createElement("input",Al({ref:Bd(t,Pt),type:"search",id:Mn,className:Ve(Le.searchInput,{[Le.searchInputPointer]:!O,[Le.searchInputInputHidden]:!pn&&bt.length>0||!O&&bt.length>0,[Le.searchInputEmpty]:bt.length===0}),onKeyDown:ai,value:ir,onChange:Ag,onFocus:Ng,onBlur:Qc,readOnly:!O||Ar.current||lt,placeholder:bt.length===0?T:void 0,disabled:q,"data-mantine-stop-propagation":pn,autoComplete:"off",onCompositionStart:()=>ha(!0),onCompositionEnd:()=>ha(!1)},jt)))))),H.createElement(Ha.Dropdown,{component:ue||Jm,maxHeight:E,direction:wo,id:Mn,innerRef:ga,__staticSelector:"MultiSelect",classNames:h,styles:m},H.createElement(Xx,{data:Dn,hovered:Ms,classNames:h,styles:m,uuid:Mn,__staticSelector:"MultiSelect",onItemHover:mr,onItemSelect:dl,itemsRefs:sr,itemComponent:_,size:u,nothingFound:D,isItemSelected:Jc,creatable:G&&!!qe,createLabel:qe,unstyled:ve,variant:z}))))});xE.displayName="@mantine/core/MultiSelect";var HQ=Object.defineProperty,WQ=Object.defineProperties,VQ=Object.getOwnPropertyDescriptors,qh=Object.getOwnPropertySymbols,yE=Object.prototype.hasOwnProperty,CE=Object.prototype.propertyIsEnumerable,Pk=(e,t,n)=>t in e?HQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jv=(e,t)=>{for(var n in t||(t={}))yE.call(t,n)&&Pk(e,n,t[n]);if(qh)for(var n of qh(t))CE.call(t,n)&&Pk(e,n,t[n]);return e},UQ=(e,t)=>WQ(e,VQ(t)),GQ=(e,t)=>{var n={};for(var r in e)yE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&qh)for(var r of qh(e))t.indexOf(r)<0&&CE.call(e,r)&&(n[r]=e[r]);return n};const KQ={type:"text",size:"sm",__staticSelector:"TextInput"},wE=d.forwardRef((e,t)=>{const n=H6("TextInput",KQ,e),{inputProps:r,wrapperProps:o}=n,s=GQ(n,["inputProps","wrapperProps"]);return H.createElement(Ic.Wrapper,jv({},o),H.createElement(Ic,UQ(jv(jv({},r),s),{ref:t})))});wE.displayName="@mantine/core/TextInput";function qQ({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),h=p+n,m=h-e.length;return m>0?e.slice(p-m):e.slice(p,h)}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 XQ=or(()=>({input:{"&:not(:disabled)":{cursor:"pointer","&::selection":{backgroundColor:"transparent"}}}}));const YQ=XQ;var QQ=Object.defineProperty,ZQ=Object.defineProperties,JQ=Object.getOwnPropertyDescriptors,Xh=Object.getOwnPropertySymbols,SE=Object.prototype.hasOwnProperty,kE=Object.prototype.propertyIsEnumerable,Ik=(e,t,n)=>t in e?QQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_u=(e,t)=>{for(var n in t||(t={}))SE.call(t,n)&&Ik(e,n,t[n]);if(Xh)for(var n of Xh(t))kE.call(t,n)&&Ik(e,n,t[n]);return e},Pv=(e,t)=>ZQ(e,JQ(t)),eZ=(e,t)=>{var n={};for(var r in e)SE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Xh)for(var r of Xh(e))t.indexOf(r)<0&&kE.call(e,r)&&(n[r]=e[r]);return n};function tZ(e,t){return t.label.toLowerCase().trim().includes(e.toLowerCase().trim())}function nZ(e,t){return!!e&&!t.some(n=>n.label.toLowerCase()===e.toLowerCase())}const rZ={required:!1,size:"sm",shadow:"sm",itemComponent:Yx,transitionProps:{transition:"fade",duration:0},initiallyOpened:!1,filter:tZ,maxDropdownHeight:220,searchable:!1,clearable:!1,limit:1/0,disabled:!1,creatable:!1,shouldCreate:nZ,selectOnBlur:!1,switchDirectionOnFlip:!1,filterDataOnExactSearchMatch:!1,zIndex:Gx("popover"),positionDependencies:[],dropdownPosition:"flip"},ay=d.forwardRef((e,t)=>{const n=H6("Select",rZ,e),{inputProps:r,wrapperProps:o,shadow:s,data:i,value:l,defaultValue:u,onChange:p,itemComponent:h,onKeyDown:m,onBlur:v,onFocus:b,transitionProps:y,initiallyOpened:x,unstyled:w,classNames:k,styles:_,filter:j,maxDropdownHeight:I,searchable:E,clearable:M,nothingFound:D,limit:R,disabled:A,onSearchChange:O,searchValue:T,rightSection:K,rightSectionWidth:F,creatable:V,getCreateLabel:X,shouldCreate:W,selectOnBlur:z,onCreate:Y,dropdownComponent:B,onDropdownClose:q,onDropdownOpen:re,withinPortal:Q,portalProps:le,switchDirectionOnFlip:se,zIndex:U,name:G,dropdownPosition:te,allowDeselect:ae,placeholder:oe,filterDataOnExactSearchMatch:pe,form:ue,positionDependencies:me,readOnly:Ce,clearButtonProps:ge,hoverOnSearchChange:fe}=n,De=eZ(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:je,cx:Be,theme:rt}=YQ(),[Ue,wt]=d.useState(x),[Ye,tt]=d.useState(-1),be=d.useRef(),Re=d.useRef({}),[st,mt]=d.useState("column"),ve=st==="column",{scrollIntoView:Qe,targetRef:ot,scrollableRef:lt}=pI({duration:0,offset:5,cancelable:!1,isList:!0}),Me=ae===void 0?M:ae,$e=qe=>{if(Ue!==qe){wt(qe);const Nt=qe?re:q;typeof Nt=="function"&&Nt()}},At=V&&typeof X=="function";let ke=null;const ze=i.map(qe=>typeof qe=="string"?{label:qe,value:qe}:qe),Le=nI({data:ze}),[Ve,ct,bn]=ad({value:l,defaultValue:u,finalValue:null,onChange:p}),jt=Le.find(qe=>qe.value===Ve),[Pt,sr]=ad({value:T,defaultValue:(jt==null?void 0:jt.label)||"",finalValue:void 0,onChange:O}),Mn=qe=>{sr(qe),E&&typeof O=="function"&&O(qe)},pn=()=>{var qe;Ce||(ct(null),bn||Mn(""),(qe=be.current)==null||qe.focus())};d.useEffect(()=>{const qe=Le.find(Nt=>Nt.value===Ve);qe?Mn(qe.label):(!At||!Ve)&&Mn("")},[Ve]),d.useEffect(()=>{jt&&(!E||!Ue)&&Mn(jt.label)},[jt==null?void 0:jt.label]);const an=qe=>{if(!Ce)if(Me&&(jt==null?void 0:jt.value)===qe.value)ct(null),$e(!1);else{if(qe.creatable&&typeof Y=="function"){const Nt=Y(qe.value);typeof Nt<"u"&&Nt!==null&&ct(typeof Nt=="string"?Nt:Nt.value)}else ct(qe.value);bn||Mn(qe.label),tt(-1),$e(!1),be.current.focus()}},Qt=qQ({data:Le,searchable:E,limit:R,searchValue:Pt,filter:j,filterDataOnExactSearchMatch:pe,value:Ve});At&&W(Pt,Qt)&&(ke=X(Pt),Qt.push({label:Pt,value:Pt,creatable:!0}));const mr=(qe,Nt,On)=>{let bt=qe;for(;On(bt);)if(bt=Nt(bt),!Qt[bt].disabled)return bt;return qe};$o(()=>{tt(fe&&Pt?0:-1)},[Pt,fe]);const wo=Ve?Qt.findIndex(qe=>qe.value===Ve):0,ar=!Ce&&(Qt.length>0?Ue:Ue&&!!D),ir=()=>{tt(qe=>{var Nt;const On=mr(qe,bt=>bt-1,bt=>bt>0);return ot.current=Re.current[(Nt=Qt[On])==null?void 0:Nt.value],ar&&Qe({alignment:ve?"start":"end"}),On})},Is=()=>{tt(qe=>{var Nt;const On=mr(qe,bt=>bt+1,bt=>bt<Qt.length-1);return ot.current=Re.current[(Nt=Qt[On])==null?void 0:Nt.value],ar&&Qe({alignment:ve?"end":"start"}),On})},Es=()=>window.setTimeout(()=>{var qe;ot.current=Re.current[(qe=Qt[wo])==null?void 0:qe.value],Qe({alignment:ve?"end":"start"})},50);$o(()=>{ar&&Es()},[ar]);const ha=qe=>{switch(typeof m=="function"&&m(qe),qe.key){case"ArrowUp":{qe.preventDefault(),Ue?ve?ir():Is():(tt(wo),$e(!0),Es());break}case"ArrowDown":{qe.preventDefault(),Ue?ve?Is():ir():(tt(wo),$e(!0),Es());break}case"Home":{if(!E){qe.preventDefault(),Ue||$e(!0);const Nt=Qt.findIndex(On=>!On.disabled);tt(Nt),ar&&Qe({alignment:ve?"end":"start"})}break}case"End":{if(!E){qe.preventDefault(),Ue||$e(!0);const Nt=Qt.map(On=>!!On.disabled).lastIndexOf(!1);tt(Nt),ar&&Qe({alignment:ve?"end":"start"})}break}case"Escape":{qe.preventDefault(),$e(!1),tt(-1);break}case" ":{E||(qe.preventDefault(),Qt[Ye]&&Ue?an(Qt[Ye]):($e(!0),tt(wo),Es()));break}case"Enter":E||qe.preventDefault(),Qt[Ye]&&Ue&&(qe.preventDefault(),an(Qt[Ye]))}},ma=qe=>{typeof v=="function"&&v(qe);const Nt=Le.find(On=>On.value===Ve);z&&Qt[Ye]&&Ue&&an(Qt[Ye]),Mn((Nt==null?void 0:Nt.label)||""),$e(!1)},cl=qe=>{typeof b=="function"&&b(qe),E&&$e(!0)},ga=qe=>{Ce||(Mn(qe.currentTarget.value),M&&qe.currentTarget.value===""&&ct(null),tt(-1),$e(!0))},ul=()=>{Ce||($e(!Ue),Ve&&!Ue&&tt(wo))};return H.createElement(Ic.Wrapper,Pv(_u({},o),{__staticSelector:"Select"}),H.createElement(Ha,{opened:ar,transitionProps:y,shadow:s,withinPortal:Q,portalProps:le,__staticSelector:"Select",onDirectionChange:mt,switchDirectionOnFlip:se,zIndex:U,dropdownPosition:te,positionDependencies:[...me,Pt],classNames:k,styles:_,unstyled:w,variant:r.variant},H.createElement(Ha.Target,null,H.createElement("div",{role:"combobox","aria-haspopup":"listbox","aria-owns":ar?`${r.id}-items`:null,"aria-controls":r.id,"aria-expanded":ar,onMouseLeave:()=>tt(-1),tabIndex:-1},H.createElement("input",{type:"hidden",name:G,value:Ve||"",form:ue,disabled:A}),H.createElement(Ic,_u(Pv(_u(_u({autoComplete:"off",type:"search"},r),De),{ref:Bd(t,be),onKeyDown:ha,__staticSelector:"Select",value:Pt,placeholder:oe,onChange:ga,"aria-autocomplete":"list","aria-controls":ar?`${r.id}-items`:null,"aria-activedescendant":Ye>=0?`${r.id}-${Ye}`:null,onMouseDown:ul,onBlur:ma,onFocus:cl,readOnly:!E||Ce,disabled:A,"data-mantine-stop-propagation":ar,name:null,classNames:Pv(_u({},k),{input:Be({[je.input]:!E},k==null?void 0:k.input)})}),gE({theme:rt,rightSection:K,rightSectionWidth:F,styles:_,size:r.size,shouldClear:M&&!!jt,onClear:pn,error:o.error,clearButtonProps:ge,disabled:A,readOnly:Ce}))))),H.createElement(Ha.Dropdown,{component:B||Jm,maxHeight:I,direction:st,id:r.id,innerRef:lt,__staticSelector:"Select",classNames:k,styles:_},H.createElement(Xx,{data:Qt,hovered:Ye,classNames:k,styles:_,isItemSelected:qe=>qe===Ve,uuid:r.id,__staticSelector:"Select",onItemHover:tt,onItemSelect:an,itemsRefs:Re,itemComponent:h,size:r.size,nothingFound:D,creatable:At&&!!ke,createLabel:ke,"aria-label":o.label,unstyled:w,variant:r.variant}))))});ay.displayName="@mantine/core/Select";const Vd=()=>{const[e,t,n,r,o,s,i,l,u,p,h,m,v,b,y,x,w,k,_,j,I,E,M,D,R,A,O,T,K,F,V,X,W,z,Y,B,q,re,Q,le,se,U,G,te,ae,oe,pe,ue,me,Ce,ge,fe,De,je,Be,rt,Ue,wt,Ye,tt,be,Re,st,mt,ve,Qe,ot,lt,Me,$e,At,ke,ze,Le,Ve,ct]=ds("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:h,base600:m,base650:v,base700:b,base750:y,base800:x,base850:w,base900:k,base950:_,accent50:j,accent100:I,accent150:E,accent200:M,accent250:D,accent300:R,accent350:A,accent400:O,accent450:T,accent500:K,accent550:F,accent600:V,accent650:X,accent700:W,accent750:z,accent800:Y,accent850:B,accent900:q,accent950:re,baseAlpha50:Q,baseAlpha100:le,baseAlpha150:se,baseAlpha200:U,baseAlpha250:G,baseAlpha300:te,baseAlpha350:ae,baseAlpha400:oe,baseAlpha450:pe,baseAlpha500:ue,baseAlpha550:me,baseAlpha600:Ce,baseAlpha650:ge,baseAlpha700:fe,baseAlpha750:De,baseAlpha800:je,baseAlpha850:Be,baseAlpha900:rt,baseAlpha950:Ue,accentAlpha50:wt,accentAlpha100:Ye,accentAlpha150:tt,accentAlpha200:be,accentAlpha250:Re,accentAlpha300:st,accentAlpha350:mt,accentAlpha400:ve,accentAlpha450:Qe,accentAlpha500:ot,accentAlpha550:lt,accentAlpha600:Me,accentAlpha650:$e,accentAlpha700:At,accentAlpha750:ke,accentAlpha800:ze,accentAlpha850:Le,accentAlpha900:Ve,accentAlpha950:ct}},Ae=(e,t)=>n=>n==="light"?e:t,_E=()=>{const{base50:e,base100:t,base200:n,base300:r,base400:o,base500:s,base600:i,base700:l,base800:u,base900:p,accent200:h,accent300:m,accent400:v,accent500:b,accent600:y}=Vd(),{colorMode:x}=la(),[w]=ds("shadows",["dark-lg"]),[k,_,j]=ds("space",[1,2,6]),[I]=ds("radii",["base"]),[E]=ds("lineHeights",["base"]);return d.useCallback(()=>({label:{color:Ae(l,r)(x)},separatorLabel:{color:Ae(s,s)(x),"::after":{borderTopColor:Ae(r,l)(x)}},input:{border:"unset",backgroundColor:Ae(e,p)(x),borderRadius:I,borderStyle:"solid",borderWidth:"2px",borderColor:Ae(n,u)(x),color:Ae(p,t)(x),minHeight:"unset",lineHeight:E,height:"auto",paddingRight:0,paddingLeft:0,paddingInlineStart:_,paddingInlineEnd:j,paddingTop:k,paddingBottom:k,fontWeight:600,"&:hover":{borderColor:Ae(r,i)(x)},"&:focus":{borderColor:Ae(m,y)(x)},"&:is(:focus, :hover)":{borderColor:Ae(o,s)(x)},"&:focus-within":{borderColor:Ae(h,y)(x)},"&[data-disabled]":{backgroundColor:Ae(r,l)(x),color:Ae(i,o)(x),cursor:"not-allowed"}},value:{backgroundColor:Ae(t,p)(x),color:Ae(p,t)(x),button:{color:Ae(p,t)(x)},"&:hover":{backgroundColor:Ae(r,l)(x),cursor:"pointer"}},dropdown:{backgroundColor:Ae(n,u)(x),borderColor:Ae(n,u)(x),boxShadow:w},item:{backgroundColor:Ae(n,u)(x),color:Ae(u,n)(x),padding:6,"&[data-hovered]":{color:Ae(p,t)(x),backgroundColor:Ae(r,l)(x)},"&[data-active]":{backgroundColor:Ae(r,l)(x),"&:hover":{color:Ae(p,t)(x),backgroundColor:Ae(r,l)(x)}},"&[data-selected]":{backgroundColor:Ae(v,y)(x),color:Ae(e,t)(x),fontWeight:600,"&:hover":{backgroundColor:Ae(b,b)(x),color:Ae("white",e)(x)}},"&[data-disabled]":{color:Ae(s,i)(x),cursor:"not-allowed"}},rightSection:{width:32,button:{color:Ae(p,t)(x)}}}),[h,m,v,b,y,t,n,r,o,e,s,i,l,u,p,w,x,E,I,k,_,j])},oZ=e=>{const{searchable:t=!0,tooltip:n,inputRef:r,onChange:o,label:s,disabled:i,...l}=e,u=ee(),[p,h]=d.useState(""),m=d.useCallback(x=>{x.shiftKey&&u(Ir(!0))},[u]),v=d.useCallback(x=>{x.shiftKey||u(Ir(!1))},[u]),b=d.useCallback(x=>{o&&o(x)},[o]),y=_E();return a.jsx(Rt,{label:n,placement:"top",hasArrow:!0,children:a.jsx(ay,{ref:r,label:s?a.jsx(sn,{isDisabled:i,children:a.jsx(Hn,{children:s})}):void 0,disabled:i,searchValue:p,onSearchChange:h,onChange:b,onKeyDown:m,onKeyUp:v,searchable:t,maxDropdownHeight:300,styles:y,...l})})},Kt=d.memo(oZ),sZ=ie([xe],({changeBoardModal:e})=>{const{isModalOpen:t,imagesToChange:n}=e;return{isModalOpen:t,imagesToChange:n}},we),aZ=()=>{const e=ee(),[t,n]=d.useState(),{data:r,isFetching:o}=pm(),{imagesToChange:s,isModalOpen:i}=L(sZ),[l]=X7(),[u]=Y7(),{t:p}=Z(),h=d.useMemo(()=>{const y=[{label:p("boards.uncategorized"),value:"none"}];return(r??[]).forEach(x=>y.push({label:x.board_name,value:x.board_id})),y},[r,p]),m=d.useCallback(()=>{e(zC()),e($b(!1))},[e]),v=d.useCallback(()=>{!s.length||!t||(t==="none"?u({imageDTOs:s}):l({imageDTOs:s,board_id:t}),n(null),e(zC()))},[l,e,s,u,t]),b=d.useRef(null);return a.jsx($d,{isOpen:i,onClose:m,leastDestructiveRef:b,isCentered:!0,children:a.jsx(Wo,{children:a.jsxs(Ld,{children:[a.jsx(Ho,{fontSize:"lg",fontWeight:"bold",children:p("boards.changeBoard")}),a.jsx(Vo,{children:a.jsxs($,{sx:{flexDir:"column",gap:4},children:[a.jsxs(ye,{children:["Moving ",`${s.length}`," image",`${s.length>1?"s":""}`," to board:"]}),a.jsx(Kt,{placeholder:p(o?"boards.loading":"boards.selectBoard"),disabled:o,onChange:y=>n(y),value:t,data:h})]})}),a.jsxs(gs,{children:[a.jsx(it,{ref:b,onClick:m,children:p("boards.cancel")}),a.jsx(it,{colorScheme:"accent",onClick:v,ml:3,children:p("boards.move")})]})]})})})},iZ=d.memo(aZ),lZ=e=>{const{label:t,isDisabled:n=!1,width:r="auto",formControlProps:o,formLabelProps:s,tooltip:i,helperText:l,...u}=e;return a.jsx(Rt,{label:i,hasArrow:!0,placement:"top",isDisabled:!i,children:a.jsx(sn,{isDisabled:n,width:r,alignItems:"center",...o,children:a.jsxs($,{sx:{flexDir:"column",w:"full"},children:[a.jsxs($,{sx:{alignItems:"center",w:"full"},children:[t&&a.jsx(Hn,{my:1,flexGrow:1,sx:{cursor:n?"not-allowed":"pointer",...s==null?void 0:s.sx,pe:4},...s,children:t}),a.jsx(Hx,{...u})]}),l&&a.jsx(F5,{children:a.jsx(ye,{variant:"subtext",children:l})})]})})})},Vt=d.memo(lZ),cZ=e=>{const{t}=Z(),{imageUsage:n,topMessage:r=t("gallery.currentlyInUse"),bottomMessage:o=t("gallery.featuresWillReset")}=e;return!n||!Br(n)?null:a.jsxs(a.Fragment,{children:[a.jsx(ye,{children:r}),a.jsxs(Od,{sx:{paddingInlineStart:6},children:[n.isInitialImage&&a.jsx(lo,{children:t("common.img2img")}),n.isCanvasImage&&a.jsx(lo,{children:t("common.unifiedCanvas")}),n.isControlNetImage&&a.jsx(lo,{children:t("common.controlNet")}),n.isIPAdapterImage&&a.jsx(lo,{children:t("common.ipAdapter")}),n.isNodesImage&&a.jsx(lo,{children:t("common.nodeEditor")})]}),a.jsx(ye,{children:o})]})},jE=d.memo(cZ),uZ=ie([xe,Q7],(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:m})=>Lj(e,m)),h={isInitialImage:Br(p,m=>m.isInitialImage),isCanvasImage:Br(p,m=>m.isCanvasImage),isNodesImage:Br(p,m=>m.isNodesImage),isControlNetImage:Br(p,m=>m.isControlNetImage),isIPAdapterImage:Br(p,m=>m.isIPAdapterImage)};return{shouldConfirmOnDelete:s,canRestoreDeletedImagesFromBin:i,imagesToDelete:l,imagesUsage:t,isModalOpen:u,imageUsageSummary:h}},we),dZ=()=>{const e=ee(),{t}=Z(),{shouldConfirmOnDelete:n,canRestoreDeletedImagesFromBin:r,imagesToDelete:o,imagesUsage:s,isModalOpen:i,imageUsageSummary:l}=L(uZ),u=d.useCallback(v=>e(zj(!v.target.checked)),[e]),p=d.useCallback(()=>{e(FC()),e(Z7(!1))},[e]),h=d.useCallback(()=>{!o.length||!s.length||(e(FC()),e(J7({imageDTOs:o,imagesUsage:s})))},[e,o,s]),m=d.useRef(null);return a.jsx($d,{isOpen:i,onClose:p,leastDestructiveRef:m,isCentered:!0,children:a.jsx(Wo,{children:a.jsxs(Ld,{children:[a.jsx(Ho,{fontSize:"lg",fontWeight:"bold",children:t("gallery.deleteImage")}),a.jsx(Vo,{children:a.jsxs($,{direction:"column",gap:3,children:[a.jsx(jE,{imageUsage:l}),a.jsx(Vr,{}),a.jsx(ye,{children:t(r?"gallery.deleteImageBin":"gallery.deleteImagePermanent")}),a.jsx(ye,{children:t("common.areYouSure")}),a.jsx(Vt,{label:t("common.dontAskMeAgain"),isChecked:!n,onChange:u})]})}),a.jsxs(gs,{children:[a.jsx(it,{ref:m,onClick:p,children:"Cancel"}),a.jsx(it,{colorScheme:"error",onClick:h,ml:3,children:"Delete"})]})]})})})},fZ=d.memo(dZ),PE=Pe((e,t)=>{const{role:n,tooltip:r="",tooltipProps:o,isChecked:s,...i}=e;return a.jsx(Rt,{label:r,hasArrow:!0,...o,...o!=null&&o.placement?{placement:o.placement}:{placement:"top"},children:a.jsx(ps,{ref:t,role:n,colorScheme:s?"accent":"base",...i})})});PE.displayName="IAIIconButton";const Te=d.memo(PE);var IE={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Ek=H.createContext&&H.createContext(IE),Wa=globalThis&&globalThis.__assign||function(){return Wa=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},Wa.apply(this,arguments)},pZ=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 EE(e){return e&&e.map(function(t,n){return H.createElement(t.tag,Wa({key:n},t.attr),EE(t.child))})}function Ne(e){return function(t){return H.createElement(hZ,Wa({attr:Wa({},e.attr)},t),EE(e.child))}}function hZ(e){var t=function(n){var r=e.attr,o=e.size,s=e.title,i=pZ(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",Wa({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,i,{className:u,style:Wa(Wa({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 Ek!==void 0?H.createElement(Ek.Consumer,null,function(n){return t(n)}):t(IE)}function mZ(e){return Ne({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 gZ(e){return Ne({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 vZ(e){return Ne({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 bZ(e){return Ne({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 xZ(e){return Ne({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 yZ(e){return Ne({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 CZ(e){return Ne({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 wZ(e){return Ne({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 ME(e){return Ne({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 SZ(e){return Ne({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 kZ(e){return Ne({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 OE(e){return Ne({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 _Z(e){return Ne({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 DE(e){return Ne({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 RE(e){return Ne({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 Wc(e){return Ne({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 jZ(e){return Ne({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 PZ(e){return Ne({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 ng(e){return Ne({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 IZ(e){return Ne({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 EZ(e){return Ne({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 MZ(e){return Ne({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 OZ(e){return Ne({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 DZ(e){return Ne({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M448 344v112a23.94 23.94 0 0 1-24 24H312c-21.39 0-32.09-25.9-17-41l36.2-36.2L224 295.6 116.77 402.9 153 439c15.09 15.1 4.39 41-17 41H24a23.94 23.94 0 0 1-24-24V344c0-21.4 25.89-32.1 41-17l36.19 36.2L184.46 256 77.18 148.7 41 185c-15.1 15.1-41 4.4-41-17V56a23.94 23.94 0 0 1 24-24h112c21.39 0 32.09 25.9 17 41l-36.2 36.2L224 216.4l107.23-107.3L295 73c-15.09-15.1-4.39-41 17-41h112a23.94 23.94 0 0 1 24 24v112c0 21.4-25.89 32.1-41 17l-36.19-36.2L263.54 256l107.28 107.3L407 327.1c15.1-15.2 41-4.5 41 16.9z"}}]})(e)}function RZ(e){return Ne({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 AE(e){return Ne({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 AZ(e){return Ne({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 NZ(e){return Ne({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 TZ(e){return Ne({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 $Z(e){return Ne({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 NE(e){return Ne({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 LZ(e){return Ne({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 zZ(e){return Ne({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 Ui(e){return Ne({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 FZ(e){return Ne({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 TE(e){return Ne({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 BZ(e){return Ne({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 HZ(e){return Ne({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 $E(e){return Ne({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 LE(e){return Ne({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 WZ(e){return Ne({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 zE(e){return Ne({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 VZ(e){return Ne({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 UZ(e){return Ne({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 Mk(e){return Ne({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 ol(e){return Ne({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 FE(e){return Ne({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 GZ(e){return Ne({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 KZ(e){return Ne({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 qZ(e){return Ne({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 rg(e){return Ne({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 XZ(e){return Ne({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 BE(e){return Ne({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 YZ(e){return Ne({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 QZ(e){return Ne({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M352 320c-22.608 0-43.387 7.819-59.79 20.895l-102.486-64.054a96.551 96.551 0 0 0 0-41.683l102.486-64.054C308.613 184.181 329.392 192 352 192c53.019 0 96-42.981 96-96S405.019 0 352 0s-96 42.981-96 96c0 7.158.79 14.13 2.276 20.841L155.79 180.895C139.387 167.819 118.608 160 96 160c-53.019 0-96 42.981-96 96s42.981 96 96 96c22.608 0 43.387-7.819 59.79-20.895l102.486 64.054A96.301 96.301 0 0 0 256 416c0 53.019 42.981 96 96 96s96-42.981 96-96-42.981-96-96-96z"}}]})(e)}function Ok(e){return Ne({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 HE(e){return Ne({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 ZZ(e){return Ne({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 WE(e){return Ne({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 JZ(e){return Ne({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 Kr(e){return Ne({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 Ne({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 og(e){return Ne({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 eJ(e){return Ne({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 VE(e){return Ne({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 Xt=e=>{const t=L(i=>i.config.disabledTabs),n=L(i=>i.config.disabledFeatures),r=L(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 tJ(e){const{title:t,hotkey:n,description:r}=e;return a.jsxs(Ga,{sx:{gridTemplateColumns:"auto max-content",justifyContent:"space-between",alignItems:"center"},children:[a.jsxs(Ga,{children:[a.jsx(ye,{fontWeight:600,children:t}),r&&a.jsx(ye,{sx:{fontSize:"sm"},variant:"subtext",children:r})]}),a.jsx(Ie,{sx:{fontSize:"sm",fontWeight:600,px:2,py:1},children:n})]})}function nJ({children:e}){const{isOpen:t,onOpen:n,onClose:r}=Mr(),{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"}],h=m=>a.jsx($,{flexDir:"column",gap:4,children:m.map((v,b)=>a.jsxs($,{flexDir:"column",px:2,gap:4,children:[a.jsx(tJ,{title:v.title,description:v.desc,hotkey:v.hotkey}),b<m.length-1&&a.jsx(Vr,{})]},b))});return a.jsxs(a.Fragment,{children:[d.cloneElement(e,{onClick:n}),a.jsxs(Hi,{isOpen:t,onClose:r,children:[a.jsx(Wo,{}),a.jsxs(Wi,{children:[a.jsx(Ho,{children:o("hotkeys.keyboardShortcuts")}),a.jsx(zd,{}),a.jsx(Vo,{children:a.jsx(L5,{allowMultiple:!0,children:a.jsxs($,{flexDir:"column",gap:2,children:[a.jsxs(Ll,{children:[a.jsx(Tl,{children:a.jsxs($,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.appHotkeys")}),a.jsx($l,{})]})}),a.jsx(zl,{children:h(s)})]}),a.jsxs(Ll,{children:[a.jsx(Tl,{children:a.jsxs($,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.generalHotkeys")}),a.jsx($l,{})]})}),a.jsx(zl,{children:h(i)})]}),a.jsxs(Ll,{children:[a.jsx(Tl,{children:a.jsxs($,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.galleryHotkeys")}),a.jsx($l,{})]})}),a.jsx(zl,{children:h(l)})]}),a.jsxs(Ll,{children:[a.jsx(Tl,{children:a.jsxs($,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.unifiedCanvasHotkeys")}),a.jsx($l,{})]})}),a.jsx(zl,{children:h(u)})]}),a.jsxs(Ll,{children:[a.jsx(Tl,{children:a.jsxs($,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.nodesHotkeys")}),a.jsx($l,{})]})}),a.jsx(zl,{children:h(p)})]})]})})}),a.jsx(gs,{})]})]})]})}function Dk(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.addEventListener&&e.addEventListener.apply(e,t)}function Rk(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.removeEventListener&&e.removeEventListener.apply(e,t)}var rJ=function(e,t){return typeof t=="boolean"?t:!e},oJ=function(e){return d.useReducer(rJ,e)};const sJ=oJ;function aJ(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 iJ(e,t,n){t===void 0&&(t=0),n===void 0&&(n=[]);var r=aJ(e,t),o=r[0],s=r[1],i=r[2];return d.useEffect(i,n),[o,s]}var lJ=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&&(Dk(e.current,"mouseover",s),Dk(e.current,"mouseout",i));var l=e.current;return function(){t&&l&&(Rk(l,"mouseover",s),Rk(l,"mouseout",i))}},[t,e]),r};const UE=lJ,cJ=({showVersion:e=!0})=>{const{data:t}=eD(),n=d.useRef(null),r=UE(n);return a.jsxs($,{alignItems:"center",gap:5,ps:1,ref:n,children:[a.jsx(Qi,{src:Fj,alt:"invoke-ai-logo",sx:{w:"32px",h:"32px",minW:"32px",minH:"32px",userSelect:"none"}}),a.jsxs($,{sx:{gap:3,alignItems:"center"},children:[a.jsxs(ye,{sx:{fontSize:"xl",userSelect:"none"},children:["invoke ",a.jsx("strong",{children:"ai"})]}),a.jsx(nr,{children:e&&r&&t&&a.jsx(vn.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.15}},exit:{opacity:0,transition:{delay:.8}},children:a.jsx(ye,{sx:{fontWeight:600,marginTop:1,color:"base.300",fontSize:14},variant:"subtext",children:t.version})},"statusText")})]})]})},uJ=d.memo(cJ),dJ=e=>{const{tooltip:t,inputRef:n,label:r,disabled:o,required:s,...i}=e,l=_E();return a.jsx(Rt,{label:t,placement:"top",hasArrow:!0,children:a.jsx(ay,{label:r?a.jsx(sn,{isRequired:s,isDisabled:o,children:a.jsx(Hn,{children:r})}):void 0,disabled:o,ref:n,styles:l,...i})})},In=d.memo(dJ),fJ={ar:vt.t("common.langArabic",{lng:"ar"}),nl:vt.t("common.langDutch",{lng:"nl"}),en:vt.t("common.langEnglish",{lng:"en"}),fr:vt.t("common.langFrench",{lng:"fr"}),de:vt.t("common.langGerman",{lng:"de"}),he:vt.t("common.langHebrew",{lng:"he"}),it:vt.t("common.langItalian",{lng:"it"}),ja:vt.t("common.langJapanese",{lng:"ja"}),ko:vt.t("common.langKorean",{lng:"ko"}),pl:vt.t("common.langPolish",{lng:"pl"}),pt_BR:vt.t("common.langBrPortuguese",{lng:"pt_BR"}),pt:vt.t("common.langPortuguese",{lng:"pt"}),ru:vt.t("common.langRussian",{lng:"ru"}),zh_CN:vt.t("common.langSimplifiedChinese",{lng:"zh_CN"}),es:vt.t("common.langSpanish",{lng:"es"}),uk:vt.t("common.langUkranian",{lng:"ua"})};function Mo(e){const{t}=Z(),{label:n,textProps:r,useBadge:o=!1,badgeLabel:s=t("settings.experimental"),badgeProps:i,...l}=e;return a.jsxs($,{justifyContent:"space-between",py:1,children:[a.jsxs($,{gap:2,alignItems:"center",children:[a.jsx(ye,{sx:{fontSize:14,_dark:{color:"base.300"}},...r,children:n}),o&&a.jsx(da,{size:"xs",sx:{px:2,color:"base.700",bg:"accent.200",_dark:{bg:"accent.500",color:"base.200"}},...i,children:s})]}),a.jsx(Vt,{...l})]})}const pJ=e=>a.jsx($,{sx:{flexDirection:"column",gap:2,p:4,borderRadius:"base",bg:"base.100",_dark:{bg:"base.900"}},children:e.children}),Bl=d.memo(pJ);function hJ(){const e=ee(),{data:t,refetch:n}=tD(),[r,{isLoading:o}]=nD(),s=d.useCallback(()=>{r().unwrap().then(l=>{e(rD()),e(Bj()),e(Tt({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(Bl,{children:[a.jsx(io,{size:"sm",children:"Clear Intermediates"}),a.jsx(it,{colorScheme:"warning",onClick:s,isLoading:o,isDisabled:!t,children:i}),a.jsx(ye,{fontWeight:"bold",children:"Clearing intermediates will reset your Canvas and ControlNet state."}),a.jsx(ye,{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(ye,{variant:"subtext",children:"Your gallery images will not be deleted."})]})}const mJ=()=>{const{base50:e,base100:t,base200:n,base300:r,base400:o,base500:s,base600:i,base700:l,base800:u,base900:p,accent200:h,accent300:m,accent400:v,accent500:b,accent600:y}=Vd(),{colorMode:x}=la(),[w]=ds("shadows",["dark-lg"]);return d.useCallback(()=>({label:{color:Ae(l,r)(x)},separatorLabel:{color:Ae(s,s)(x),"::after":{borderTopColor:Ae(r,l)(x)}},searchInput:{":placeholder":{color:Ae(r,l)(x)}},input:{backgroundColor:Ae(e,p)(x),borderWidth:"2px",borderColor:Ae(n,u)(x),color:Ae(p,t)(x),paddingRight:24,fontWeight:600,"&:hover":{borderColor:Ae(r,i)(x)},"&:focus":{borderColor:Ae(m,y)(x)},"&:is(:focus, :hover)":{borderColor:Ae(o,s)(x)},"&:focus-within":{borderColor:Ae(h,y)(x)},"&[data-disabled]":{backgroundColor:Ae(r,l)(x),color:Ae(i,o)(x),cursor:"not-allowed"}},value:{backgroundColor:Ae(n,u)(x),color:Ae(p,t)(x),button:{color:Ae(p,t)(x)},"&:hover":{backgroundColor:Ae(r,l)(x),cursor:"pointer"}},dropdown:{backgroundColor:Ae(n,u)(x),borderColor:Ae(n,u)(x),boxShadow:w},item:{backgroundColor:Ae(n,u)(x),color:Ae(u,n)(x),padding:6,"&[data-hovered]":{color:Ae(p,t)(x),backgroundColor:Ae(r,l)(x)},"&[data-active]":{backgroundColor:Ae(r,l)(x),"&:hover":{color:Ae(p,t)(x),backgroundColor:Ae(r,l)(x)}},"&[data-selected]":{backgroundColor:Ae(v,y)(x),color:Ae(e,t)(x),fontWeight:600,"&:hover":{backgroundColor:Ae(b,b)(x),color:Ae("white",e)(x)}},"&[data-disabled]":{color:Ae(s,i)(x),cursor:"not-allowed"}},rightSection:{width:24,padding:20,button:{color:Ae(p,t)(x)}}}),[h,m,v,b,y,t,n,r,o,e,s,i,l,u,p,w,x])},gJ=e=>{const{searchable:t=!0,tooltip:n,inputRef:r,label:o,disabled:s,...i}=e,l=ee(),u=d.useCallback(m=>{m.shiftKey&&l(Ir(!0))},[l]),p=d.useCallback(m=>{m.shiftKey||l(Ir(!1))},[l]),h=mJ();return a.jsx(Rt,{label:n,placement:"top",hasArrow:!0,isOpen:!0,children:a.jsx(xE,{label:o?a.jsx(sn,{isDisabled:s,children:a.jsx(Hn,{children:o})}):void 0,ref:r,disabled:s,onKeyDown:u,onKeyUp:p,searchable:t,maxDropdownHeight:300,styles:h,...i})})},vJ=d.memo(gJ),bJ=rr(hm,(e,t)=>({value:t,label:e})).sort((e,t)=>e.label.localeCompare(t.label));function xJ(){const e=ee(),{t}=Z(),n=L(o=>o.ui.favoriteSchedulers),r=d.useCallback(o=>{e(oD(o))},[e]);return a.jsx(vJ,{label:t("settings.favoriteSchedulers"),value:n,data:bJ,onChange:r,clearable:!0,searchable:!0,maxSelectedValues:99,placeholder:t("settings.favoriteSchedulersPlaceholder")})}const yJ=ie([xe],({system:e,ui:t,generation:n})=>{const{shouldConfirmOnDelete:r,enableImageDebugging:o,consoleLogLevel:s,shouldLogToConsole:i,shouldAntialiasProgressImage:l,shouldUseNSFWChecker:u,shouldUseWatermarker:p}=e,{shouldUseSliders:h,shouldShowProgressInViewer:m,shouldAutoChangeDimensions:v}=t,{shouldShowAdvancedOptions:b}=n;return{shouldConfirmOnDelete:r,enableImageDebugging:o,shouldUseSliders:h,shouldShowProgressInViewer:m,consoleLogLevel:s,shouldLogToConsole:i,shouldAntialiasProgressImage:l,shouldShowAdvancedOptions:b,shouldUseNSFWChecker:u,shouldUseWatermarker:p,shouldAutoChangeDimensions:v}},{memoizeOptions:{resultEqualityCheck:_t}}),CJ=({children:e,config:t})=>{const n=ee(),{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.shouldShowAdvancedOptionsSettings)??!0,p=(t==null?void 0:t.shouldShowClearIntermediates)??!0,h=(t==null?void 0:t.shouldShowLocalizationToggle)??!0;d.useEffect(()=>{i||n(BC(!1))},[i,n]);const{isNSFWCheckerAvailable:m,isWatermarkerAvailable:v}=Hj(void 0,{selectFromResult:({data:Q})=>({isNSFWCheckerAvailable:(Q==null?void 0:Q.nsfw_methods.includes("nsfw_checker"))??!1,isWatermarkerAvailable:(Q==null?void 0:Q.watermarking_methods.includes("invisible_watermark"))??!1})}),{isOpen:b,onOpen:y,onClose:x}=Mr(),{isOpen:w,onOpen:k,onClose:_}=Mr(),{shouldConfirmOnDelete:j,enableImageDebugging:I,shouldUseSliders:E,shouldShowProgressInViewer:M,consoleLogLevel:D,shouldLogToConsole:R,shouldAntialiasProgressImage:A,shouldShowAdvancedOptions:O,shouldUseNSFWChecker:T,shouldUseWatermarker:K,shouldAutoChangeDimensions:F}=L(yJ),V=d.useCallback(()=>{Object.keys(window.localStorage).forEach(Q=>{(sD.includes(Q)||Q.startsWith(aD))&&localStorage.removeItem(Q)}),x(),k(),setInterval(()=>s(Q=>Q-1),1e3)},[x,k]);d.useEffect(()=>{o<=0&&window.location.reload()},[o]);const X=d.useCallback(Q=>{n(iD(Q))},[n]),W=d.useCallback(Q=>{n(lD(Q))},[n]),z=d.useCallback(Q=>{n(BC(Q.target.checked))},[n]),{colorMode:Y,toggleColorMode:B}=la(),q=Xt("localization").isFeatureEnabled,re=L(LP);return a.jsxs(a.Fragment,{children:[d.cloneElement(e,{onClick:y}),a.jsxs(Hi,{isOpen:b,onClose:x,size:"2xl",isCentered:!0,children:[a.jsx(Wo,{}),a.jsxs(Wi,{children:[a.jsx(Ho,{bg:"none",children:r("common.settingsLabel")}),a.jsx(zd,{}),a.jsx(Vo,{children:a.jsxs($,{sx:{gap:4,flexDirection:"column"},children:[a.jsxs(Bl,{children:[a.jsx(io,{size:"sm",children:r("settings.general")}),a.jsx(Mo,{label:r("settings.confirmOnDelete"),isChecked:j,onChange:Q=>n(zj(Q.target.checked))}),u&&a.jsx(Mo,{label:r("settings.showAdvancedOptions"),isChecked:O,onChange:Q=>n(cD(Q.target.checked))})]}),a.jsxs(Bl,{children:[a.jsx(io,{size:"sm",children:r("settings.generation")}),a.jsx(xJ,{}),a.jsx(Mo,{label:"Enable NSFW Checker",isDisabled:!m,isChecked:T,onChange:Q=>n(uD(Q.target.checked))}),a.jsx(Mo,{label:"Enable Invisible Watermark",isDisabled:!v,isChecked:K,onChange:Q=>n(dD(Q.target.checked))})]}),a.jsxs(Bl,{children:[a.jsx(io,{size:"sm",children:r("settings.ui")}),a.jsx(Mo,{label:r("common.darkMode"),isChecked:Y==="dark",onChange:B}),a.jsx(Mo,{label:r("settings.useSlidersForAll"),isChecked:E,onChange:Q=>n(fD(Q.target.checked))}),a.jsx(Mo,{label:r("settings.showProgressInViewer"),isChecked:M,onChange:Q=>n(Wj(Q.target.checked))}),a.jsx(Mo,{label:r("settings.antialiasProgressImages"),isChecked:A,onChange:Q=>n(pD(Q.target.checked))}),a.jsx(Mo,{label:r("settings.autoChangeDimensions"),isChecked:F,onChange:Q=>n(hD(Q.target.checked))}),h&&a.jsx(In,{disabled:!q,label:r("common.languagePickerLabel"),value:re,data:Object.entries(fJ).map(([Q,le])=>({value:Q,label:le})),onChange:W})]}),i&&a.jsxs(Bl,{children:[a.jsx(io,{size:"sm",children:r("settings.developer")}),a.jsx(Mo,{label:r("settings.shouldLogToConsole"),isChecked:R,onChange:z}),a.jsx(In,{disabled:!R,label:r("settings.consoleLogLevel"),onChange:X,value:D,data:mD.concat()}),a.jsx(Mo,{label:r("settings.enableImageDebugging"),isChecked:I,onChange:Q=>n(gD(Q.target.checked))})]}),p&&a.jsx(hJ,{}),a.jsxs(Bl,{children:[a.jsx(io,{size:"sm",children:r("settings.resetWebUI")}),a.jsx(it,{colorScheme:"error",onClick:V,children:r("settings.resetWebUI")}),l&&a.jsxs(a.Fragment,{children:[a.jsx(ye,{variant:"subtext",children:r("settings.resetWebUIDesc1")}),a.jsx(ye,{variant:"subtext",children:r("settings.resetWebUIDesc2")})]})]})]})}),a.jsx(gs,{children:a.jsx(it,{onClick:x,children:r("common.close")})})]})]}),a.jsxs(Hi,{closeOnOverlayClick:!1,isOpen:w,onClose:_,isCentered:!0,closeOnEsc:!1,children:[a.jsx(Wo,{backdropFilter:"blur(40px)"}),a.jsxs(Wi,{children:[a.jsx(Ho,{}),a.jsx(Vo,{children:a.jsx($,{justifyContent:"center",children:a.jsx(ye,{fontSize:"lg",children:a.jsxs(ye,{children:[r("settings.resetComplete")," Reloading in ",o,"..."]})})})}),a.jsx(gs,{})]})]})]})},wJ=d.memo(CJ),SJ=ie(xo,e=>{const{isConnected:t,isProcessing:n,statusTranslationKey:r,currentIteration:o,totalIterations:s,currentStatusHasSteps:i}=e;return{isConnected:t,isProcessing:n,currentIteration:o,totalIterations:s,statusTranslationKey:r,currentStatusHasSteps:i}},we),Ak={ok:"green.400",working:"yellow.400",error:"red.400"},Nk={ok:"green.600",working:"yellow.500",error:"red.500"},kJ=()=>{const{isConnected:e,isProcessing:t,currentIteration:n,totalIterations:r,statusTranslationKey:o}=L(SJ),{t:s}=Z(),i=d.useRef(null),l=d.useMemo(()=>t?"working":e?"ok":"error",[t,e]),u=d.useMemo(()=>{if(n&&r)return` (${n}/${r})`},[n,r]),p=UE(i);return a.jsxs($,{ref:i,h:"full",px:2,alignItems:"center",gap:5,children:[a.jsx(nr,{children:p&&a.jsx(vn.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.15}},exit:{opacity:0,transition:{delay:.8}},children:a.jsxs(ye,{sx:{fontSize:"sm",fontWeight:"600",pb:"1px",userSelect:"none",color:Nk[l],_dark:{color:Ak[l]}},children:[s(o),u]})},"statusText")}),a.jsx(Tn,{as:_Z,sx:{boxSize:"0.5rem",color:Nk[l],_dark:{color:Ak[l]}}})]})},_J=d.memo(kJ),jJ=()=>{const{t:e}=Z(),t=Xt("bugLink").isFeatureEnabled,n=Xt("discordLink").isFeatureEnabled,r=Xt("githubLink").isFeatureEnabled,o="http://github.com/invoke-ai/InvokeAI",s="https://discord.gg/ZmtBAhwWhy";return a.jsxs($,{sx:{gap:2,alignItems:"center"},children:[a.jsx(uJ,{}),a.jsx(Za,{}),a.jsx(_J,{}),a.jsxs(Nd,{children:[a.jsx(Td,{as:Te,variant:"link","aria-label":e("accessibility.menu"),icon:a.jsx(SZ,{}),sx:{boxSize:8}}),a.jsxs(Ka,{motionProps:vc,children:[a.jsxs(Sc,{title:e("common.communityLabel"),children:[r&&a.jsx(Wt,{as:"a",href:o,target:"_blank",icon:a.jsx(gZ,{}),children:e("common.githubLabel")}),t&&a.jsx(Wt,{as:"a",href:`${o}/issues`,target:"_blank",icon:a.jsx(kZ,{}),children:e("common.reportBugLabel")}),n&&a.jsx(Wt,{as:"a",href:s,target:"_blank",icon:a.jsx(mZ,{}),children:e("common.discordLabel")})]}),a.jsxs(Sc,{title:e("common.settingsLabel"),children:[a.jsx(nJ,{children:a.jsx(Wt,{as:"button",icon:a.jsx(BZ,{}),children:e("common.hotkeysLabel")})}),a.jsx(wJ,{children:a.jsx(Wt,{as:"button",icon:a.jsx(RE,{}),children:e("common.settingsLabel")})})]})]})]})]})},PJ=d.memo(jJ),IJ=ie(xo,e=>{const{isUploading:t}=e;let n="";return t&&(n="Uploading..."),{tooltip:n,shouldShow:t}}),EJ=()=>{const{shouldShow:e,tooltip:t}=L(IJ);return e?a.jsx($,{sx:{alignItems:"center",justifyContent:"center",color:"base.600"},children:a.jsx(Rt,{label:t,placement:"right",hasArrow:!0,children:a.jsx(Xi,{})})}):null},MJ=d.memo(EJ);/*!
* OverlayScrollbars
* Version: 2.2.1
*
* Copyright (c) Rene Haas | KingSora.
* https://github.com/KingSora
*
* Released under the MIT license.
*/function Dt(e,t){if(ag(e))for(let n=0;n<e.length&&t(e[n],n,e)!==!1;n++);else e&&Dt(Object.keys(e),n=>t(e[n],n,e));return e}function tr(e,t){const n=ni(t);if(Ko(t)||n){let o=n?"":{};if(e){const s=window.getComputedStyle(e,null);o=n?zk(e,s,t):t.reduce((i,l)=>(i[l]=zk(e,s,l),i),o)}return o}e&&Dt(Gr(t),o=>GJ(e,o,t[o]))}const Ro=(e,t)=>{const{o:n,u:r,_:o}=e;let s=n,i;const l=(h,m)=>{const v=s,b=h,y=m||(r?!r(v,b):v!==b);return(y||o)&&(s=b,i=v),[s,y,i]};return[t?h=>l(t(s,i),h):l,h=>[s,!!h,i]]},Gd=()=>typeof window<"u",GE=Gd()&&Node.ELEMENT_NODE,{toString:OJ,hasOwnProperty:Iv}=Object.prototype,pa=e=>e===void 0,sg=e=>e===null,DJ=e=>pa(e)||sg(e)?`${e}`:OJ.call(e).replace(/^\[object (.+)\]$/,"$1").toLowerCase(),Va=e=>typeof e=="number",ni=e=>typeof e=="string",iy=e=>typeof e=="boolean",Go=e=>typeof e=="function",Ko=e=>Array.isArray(e),ld=e=>typeof e=="object"&&!Ko(e)&&!sg(e),ag=e=>{const t=!!e&&e.length,n=Va(t)&&t>-1&&t%1==0;return Ko(e)||!Go(e)&&n?t>0&&ld(e)?t-1 in e:!0:!1},nb=e=>{if(!e||!ld(e)||DJ(e)!=="object")return!1;let t;const n="constructor",r=e[n],o=r&&r.prototype,s=Iv.call(e,n),i=o&&Iv.call(o,"isPrototypeOf");if(r&&!s&&!i)return!1;for(t in e);return pa(t)||Iv.call(e,t)},Yh=e=>{const t=HTMLElement;return e?t?e instanceof t:e.nodeType===GE:!1},ig=e=>{const t=Element;return e?t?e instanceof t:e.nodeType===GE:!1},ly=(e,t,n)=>e.indexOf(t,n),zt=(e,t,n)=>(!n&&!ni(t)&&ag(t)?Array.prototype.push.apply(e,t):e.push(t),e),Gi=e=>{const t=Array.from,n=[];return t&&e?t(e):(e instanceof Set?e.forEach(r=>{zt(n,r)}):Dt(e,r=>{zt(n,r)}),n)},cy=e=>!!e&&e.length===0,js=(e,t,n)=>{Dt(e,o=>o&&o.apply(void 0,t||[])),!n&&(e.length=0)},lg=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Gr=e=>e?Object.keys(e):[],fn=(e,t,n,r,o,s,i)=>{const l=[t,n,r,o,s,i];return(typeof e!="object"||sg(e))&&!Go(e)&&(e={}),Dt(l,u=>{Dt(Gr(u),p=>{const h=u[p];if(e===h)return!0;const m=Ko(h);if(h&&(nb(h)||m)){const v=e[p];let b=v;m&&!Ko(v)?b=[]:!m&&!nb(v)&&(b={}),e[p]=fn(b,h)}else e[p]=h})}),e},uy=e=>{for(const t in e)return!1;return!0},KE=(e,t,n,r)=>{if(pa(r))return n?n[e]:t;n&&(ni(r)||Va(r))&&(n[e]=r)},er=(e,t,n)=>{if(pa(n))return e?e.getAttribute(t):null;e&&e.setAttribute(t,n)},Cr=(e,t)=>{e&&e.removeAttribute(t)},Ei=(e,t,n,r)=>{if(n){const o=er(e,t)||"",s=new Set(o.split(" "));s[r?"add":"delete"](n);const i=Gi(s).join(" ").trim();er(e,t,i)}},RJ=(e,t,n)=>{const r=er(e,t)||"";return new Set(r.split(" ")).has(n)},zo=(e,t)=>KE("scrollLeft",0,e,t),Zs=(e,t)=>KE("scrollTop",0,e,t),rb=Gd()&&Element.prototype,qE=(e,t)=>{const n=[],r=t?ig(t)?t:null:document;return r?zt(n,r.querySelectorAll(e)):n},AJ=(e,t)=>{const n=t?ig(t)?t:null:document;return n?n.querySelector(e):null},Qh=(e,t)=>ig(e)?(rb.matches||rb.msMatchesSelector).call(e,t):!1,dy=e=>e?Gi(e.childNodes):[],ra=e=>e?e.parentElement:null,ql=(e,t)=>{if(ig(e)){const n=rb.closest;if(n)return n.call(e,t);do{if(Qh(e,t))return e;e=ra(e)}while(e)}return null},NJ=(e,t,n)=>{const r=e&&ql(e,t),o=e&&AJ(n,r),s=ql(o,t)===r;return r&&o?r===e||o===e||s&&ql(ql(e,n),t)!==r:!1},fy=(e,t,n)=>{if(n&&e){let r=t,o;ag(n)?(o=document.createDocumentFragment(),Dt(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)}},fo=(e,t)=>{fy(e,null,t)},TJ=(e,t)=>{fy(ra(e),e,t)},Tk=(e,t)=>{fy(ra(e),e&&e.nextSibling,t)},bs=e=>{if(ag(e))Dt(Gi(e),t=>bs(t));else if(e){const t=ra(e);t&&t.removeChild(e)}},Mi=e=>{const t=document.createElement("div");return e&&er(t,"class",e),t},XE=e=>{const t=Mi();return t.innerHTML=e.trim(),Dt(dy(t),n=>bs(n))},ob=e=>e.charAt(0).toUpperCase()+e.slice(1),$J=()=>Mi().style,LJ=["-webkit-","-moz-","-o-","-ms-"],zJ=["WebKit","Moz","O","MS","webkit","moz","o","ms"],Ev={},Mv={},FJ=e=>{let t=Mv[e];if(lg(Mv,e))return t;const n=ob(e),r=$J();return Dt(LJ,o=>{const s=o.replace(/-/g,"");return!(t=[e,o+e,s+n,ob(s)+n].find(l=>r[l]!==void 0))}),Mv[e]=t||""},Kd=e=>{if(Gd()){let t=Ev[e]||window[e];return lg(Ev,e)||(Dt(zJ,n=>(t=t||window[n+ob(e)],!t)),Ev[e]=t),t}},BJ=Kd("MutationObserver"),$k=Kd("IntersectionObserver"),Xl=Kd("ResizeObserver"),YE=Kd("cancelAnimationFrame"),QE=Kd("requestAnimationFrame"),Zh=Gd()&&window.setTimeout,sb=Gd()&&window.clearTimeout,HJ=/[^\x20\t\r\n\f]+/g,ZE=(e,t,n)=>{const r=e&&e.classList;let o,s=0,i=!1;if(r&&t&&ni(t)){const l=t.match(HJ)||[];for(i=l.length>0;o=l[s++];)i=!!n(r,o)&&i}return i},py=(e,t)=>{ZE(e,t,(n,r)=>n.remove(r))},Js=(e,t)=>(ZE(e,t,(n,r)=>n.add(r)),py.bind(0,e,t)),cg=(e,t,n,r)=>{if(e&&t){let o=!0;return Dt(n,s=>{const i=r?r(e[s]):e[s],l=r?r(t[s]):t[s];i!==l&&(o=!1)}),o}return!1},JE=(e,t)=>cg(e,t,["w","h"]),eM=(e,t)=>cg(e,t,["x","y"]),WJ=(e,t)=>cg(e,t,["t","r","b","l"]),Lk=(e,t,n)=>cg(e,t,["width","height"],n&&(r=>Math.round(r))),co=()=>{},Hl=e=>{let t;const n=e?Zh:QE,r=e?sb:YE;return[o=>{r(t),t=n(o,Go(e)?e():e)},()=>r(t)]},hy=(e,t)=>{let n,r,o,s=co;const{v:i,g:l,p:u}=t||{},p=function(y){s(),sb(n),n=r=void 0,s=co,e.apply(this,y)},h=b=>u&&r?u(r,b):b,m=()=>{s!==co&&p(h(o)||o)},v=function(){const y=Gi(arguments),x=Go(i)?i():i;if(Va(x)&&x>=0){const k=Go(l)?l():l,_=Va(k)&&k>=0,j=x>0?Zh:QE,I=x>0?sb:YE,M=h(y)||y,D=p.bind(0,M);s();const R=j(D,x);s=()=>I(R),_&&!n&&(n=Zh(m,k)),r=o=M}else p(y)};return v.m=m,v},VJ={opacity:1,zindex:1},bp=(e,t)=>{const n=t?parseFloat(e):parseInt(e,10);return n===n?n:0},UJ=(e,t)=>!VJ[e.toLowerCase()]&&Va(t)?`${t}px`:t,zk=(e,t,n)=>t!=null?t[n]||t.getPropertyValue(n):e.style[n],GJ=(e,t,n)=>{try{const{style:r}=e;pa(r[t])?r.setProperty(t,n):r[t]=UJ(t,n)}catch{}},cd=e=>tr(e,"direction")==="rtl",Fk=(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=tr(e,[s,i,l,u]);return{t:bp(p[s],!0),r:bp(p[i],!0),b:bp(p[l],!0),l:bp(p[u],!0)}},{round:Bk}=Math,my={w:0,h:0},ud=e=>e?{w:e.offsetWidth,h:e.offsetHeight}:my,Bp=e=>e?{w:e.clientWidth,h:e.clientHeight}:my,Jh=e=>e?{w:e.scrollWidth,h:e.scrollHeight}:my,em=e=>{const t=parseFloat(tr(e,"height"))||0,n=parseFloat(tr(e,"width"))||0;return{w:n-Bk(n),h:t-Bk(t)}},fs=e=>e.getBoundingClientRect();let xp;const KJ=()=>{if(pa(xp)){xp=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get(){xp=!0}}))}catch{}}return xp},tM=e=>e.split(" "),qJ=(e,t,n,r)=>{Dt(tM(t),o=>{e.removeEventListener(o,n,r)})},$n=(e,t,n,r)=>{var o;const s=KJ(),i=(o=s&&r&&r.S)!=null?o:s,l=r&&r.$||!1,u=r&&r.C||!1,p=[],h=s?{passive:i,capture:l}:l;return Dt(tM(t),m=>{const v=u?b=>{e.removeEventListener(m,v,l),n&&n(b)}:n;zt(p,qJ.bind(null,e,m,v,l)),e.addEventListener(m,v,h)}),js.bind(0,p)},nM=e=>e.stopPropagation(),rM=e=>e.preventDefault(),XJ={x:0,y:0},Ov=e=>{const t=e?fs(e):0;return t?{x:t.left+window.pageYOffset,y:t.top+window.pageXOffset}:XJ},Hk=(e,t)=>{Dt(Ko(t)?t:[t],e)},gy=e=>{const t=new Map,n=(s,i)=>{if(s){const l=t.get(s);Hk(u=>{l&&l[u?"delete":"clear"](u)},i)}else t.forEach(l=>{l.clear()}),t.clear()},r=(s,i)=>{if(ni(s)){const p=t.get(s)||new Set;return t.set(s,p),Hk(h=>{Go(h)&&p.add(h)},i),n.bind(0,s,i)}iy(i)&&i&&n();const l=Gr(s),u=[];return Dt(l,p=>{const h=s[p];h&&zt(u,r(p,h))}),js.bind(0,u)},o=(s,i)=>{const l=t.get(s);Dt(Gi(l),u=>{i&&!cy(i)?u.apply(0,i):u()})};return r(e||{}),[r,n,o]},Wk=e=>JSON.stringify(e,(t,n)=>{if(Go(n))throw new Error;return n}),YJ={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"]}},oM=(e,t)=>{const n={},r=Gr(t).concat(Gr(e));return Dt(r,o=>{const s=e[o],i=t[o];if(ld(s)&&ld(i))fn(n[o]={},oM(s,i)),uy(n[o])&&delete n[o];else if(lg(t,o)&&i!==s){let l=!0;if(Ko(s)||Ko(i))try{Wk(s)===Wk(i)&&(l=!1)}catch{}l&&(n[o]=i)}}),n},sM="os-environment",aM=`${sM}-flexbox-glue`,QJ=`${aM}-max`,iM="os-scrollbar-hidden",Dv="data-overlayscrollbars-initialize",Ao="data-overlayscrollbars",lM=`${Ao}-overflow-x`,cM=`${Ao}-overflow-y`,cc="overflowVisible",ZJ="scrollbarHidden",Vk="scrollbarPressed",tm="updating",Oa="data-overlayscrollbars-viewport",Rv="arrange",uM="scrollbarHidden",uc=cc,ab="data-overlayscrollbars-padding",JJ=uc,Uk="data-overlayscrollbars-content",vy="os-size-observer",eee=`${vy}-appear`,tee=`${vy}-listener`,nee="os-trinsic-observer",ree="os-no-css-vars",oee="os-theme-none",Dr="os-scrollbar",see=`${Dr}-rtl`,aee=`${Dr}-horizontal`,iee=`${Dr}-vertical`,dM=`${Dr}-track`,by=`${Dr}-handle`,lee=`${Dr}-visible`,cee=`${Dr}-cornerless`,Gk=`${Dr}-transitionless`,Kk=`${Dr}-interaction`,qk=`${Dr}-unusable`,Xk=`${Dr}-auto-hidden`,Yk=`${Dr}-wheel`,uee=`${dM}-interactive`,dee=`${by}-interactive`,fM={},Ki=()=>fM,fee=e=>{const t=[];return Dt(Ko(e)?e:[e],n=>{const r=Gr(n);Dt(r,o=>{zt(t,fM[o]=n[o])})}),t},pee="__osOptionsValidationPlugin",hee="__osSizeObserverPlugin",xy="__osScrollbarsHidingPlugin",mee="__osClickScrollPlugin";let Av;const Qk=(e,t,n,r)=>{fo(e,t);const o=Bp(t),s=ud(t),i=em(n);return r&&bs(t),{x:s.h-o.h+i.h,y:s.w-o.w+i.w}},gee=e=>{let t=!1;const n=Js(e,iM);try{t=tr(e,FJ("scrollbar-width"))==="none"||window.getComputedStyle(e,"::-webkit-scrollbar").getPropertyValue("display")==="none"}catch{}return n(),t},vee=(e,t)=>{const n="hidden";tr(e,{overflowX:n,overflowY:n,direction:"rtl"}),zo(e,0);const r=Ov(e),o=Ov(t);zo(e,-999);const s=Ov(t);return{i:r.x===o.x,n:o.x!==s.x}},bee=(e,t)=>{const n=Js(e,aM),r=fs(e),o=fs(t),s=Lk(o,r,!0),i=Js(e,QJ),l=fs(e),u=fs(t),p=Lk(u,l,!0);return n(),i(),s&&p},xee=()=>{const{body:e}=document,n=XE(`<div class="${sM}"><div></div></div>`)[0],r=n.firstChild,[o,,s]=gy(),[i,l]=Ro({o:Qk(e,n,r),u:eM},Qk.bind(0,e,n,r,!0)),[u]=l(),p=gee(n),h={x:u.x===0,y:u.y===0},m={elements:{host:null,padding:!p,viewport:_=>p&&_===_.ownerDocument.body&&_,content:!1},scrollbars:{slot:!0},cancel:{nativeScrollbarsOverlaid:!1,body:null}},v=fn({},YJ),b=fn.bind(0,{},v),y=fn.bind(0,{},m),x={k:u,A:h,I:p,L:tr(n,"zIndex")==="-1",B:vee(n,r),V:bee(n,r),Y:o.bind(0,"z"),j:o.bind(0,"r"),N:y,q:_=>fn(m,_)&&y(),F:b,G:_=>fn(v,_)&&b(),X:fn({},m),U:fn({},v)},w=window.addEventListener,k=hy(_=>s(_?"z":"r"),{v:33,g:99});if(Cr(n,"style"),bs(n),w("resize",k.bind(0,!1)),!p&&(!h.x||!h.y)){let _;w("resize",()=>{const j=Ki()[xy];_=_||j&&j.R(),_&&_(x,i,k.bind(0,!0))})}return x},Rr=()=>(Av||(Av=xee()),Av),yy=(e,t)=>Go(t)?t.apply(0,e):t,yee=(e,t,n,r)=>{const o=pa(r)?n:r;return yy(e,o)||t.apply(0,e)},pM=(e,t,n,r)=>{const o=pa(r)?n:r,s=yy(e,o);return!!s&&(Yh(s)?s:t.apply(0,e))},Cee=(e,t,n)=>{const{nativeScrollbarsOverlaid:r,body:o}=n||{},{A:s,I:i}=Rr(),{nativeScrollbarsOverlaid:l,body:u}=t,p=r??l,h=pa(o)?u:o,m=(s.x||s.y)&&p,v=e&&(sg(h)?!i:h);return!!m||!!v},Cy=new WeakMap,wee=(e,t)=>{Cy.set(e,t)},See=e=>{Cy.delete(e)},hM=e=>Cy.get(e),Zk=(e,t)=>e?t.split(".").reduce((n,r)=>n&&lg(n,r)?n[r]:void 0,e):void 0,ib=(e,t,n)=>r=>[Zk(e,r),n||Zk(t,r)!==void 0],mM=e=>{let t=e;return[()=>t,n=>{t=fn({},t,n)}]},yp="tabindex",Cp=Mi.bind(0,""),Nv=e=>{fo(ra(e),dy(e)),bs(e)},kee=e=>{const t=Rr(),{N:n,I:r}=t,o=Ki()[xy],s=o&&o.T,{elements:i}=n(),{host:l,padding:u,viewport:p,content:h}=i,m=Yh(e),v=m?{}:e,{elements:b}=v,{host:y,padding:x,viewport:w,content:k}=b||{},_=m?e:v.target,j=Qh(_,"textarea"),I=_.ownerDocument,E=I.documentElement,M=_===I.body,D=I.defaultView,R=yee.bind(0,[_]),A=pM.bind(0,[_]),O=yy.bind(0,[_]),T=R.bind(0,Cp,p),K=A.bind(0,Cp,h),F=T(w),V=F===_,X=V&&M,W=!V&&K(k),z=!V&&Yh(F)&&F===W,Y=z&&!!O(h),B=Y?T():F,q=Y?W:K(),Q=X?E:z?B:F,le=j?R(Cp,l,y):_,se=X?Q:le,U=z?q:W,G=I.activeElement,te=!V&&D.top===D&&G===_,ae={W:_,Z:se,J:Q,K:!V&&A(Cp,u,x),tt:U,nt:!V&&!r&&s&&s(t),ot:X?E:Q,st:X?I:Q,et:D,ct:I,rt:j,it:M,lt:m,ut:V,dt:z,ft:(Ye,tt)=>RJ(Q,V?Ao:Oa,V?tt:Ye),_t:(Ye,tt,be)=>Ei(Q,V?Ao:Oa,V?tt:Ye,be)},oe=Gr(ae).reduce((Ye,tt)=>{const be=ae[tt];return zt(Ye,be&&!ra(be)?be:!1)},[]),pe=Ye=>Ye?ly(oe,Ye)>-1:null,{W:ue,Z:me,K:Ce,J:ge,tt:fe,nt:De}=ae,je=[()=>{Cr(me,Ao),Cr(me,Dv),Cr(ue,Dv),M&&(Cr(E,Ao),Cr(E,Dv))}],Be=j&&pe(me);let rt=j?ue:dy([fe,ge,Ce,me,ue].find(Ye=>pe(Ye)===!1));const Ue=X?ue:fe||ge;return[ae,()=>{er(me,Ao,V?"viewport":"host"),er(Ce,ab,""),er(fe,Uk,""),V||er(ge,Oa,"");const Ye=M&&!V?Js(ra(_),iM):co;if(Be&&(Tk(ue,me),zt(je,()=>{Tk(me,ue),bs(me)})),fo(Ue,rt),fo(me,Ce),fo(Ce||me,!V&&ge),fo(ge,fe),zt(je,()=>{Ye(),Cr(Ce,ab),Cr(fe,Uk),Cr(ge,lM),Cr(ge,cM),Cr(ge,Oa),pe(fe)&&Nv(fe),pe(ge)&&Nv(ge),pe(Ce)&&Nv(Ce)}),r&&!V&&(Ei(ge,Oa,uM,!0),zt(je,Cr.bind(0,ge,Oa))),De&&(TJ(ge,De),zt(je,bs.bind(0,De))),te){const tt=er(ge,yp);er(ge,yp,"-1"),ge.focus();const be=()=>tt?er(ge,yp,tt):Cr(ge,yp),Re=$n(I,"pointerdown keydown",()=>{be(),Re()});zt(je,[be,Re])}else G&&G.focus&&G.focus();rt=0},js.bind(0,je)]},_ee=(e,t)=>{const{tt:n}=e,[r]=t;return o=>{const{V:s}=Rr(),{ht:i}=r(),{vt:l}=o,u=(n||!s)&&l;return u&&tr(n,{height:i?"":"100%"}),{gt:u,wt:u}}},jee=(e,t)=>{const[n,r]=t,{Z:o,K:s,J:i,ut:l}=e,[u,p]=Ro({u:WJ,o:Fk()},Fk.bind(0,o,"padding",""));return(h,m,v)=>{let[b,y]=p(v);const{I:x,V:w}=Rr(),{bt:k}=n(),{gt:_,wt:j,yt:I}=h,[E,M]=m("paddingAbsolute");(_||y||!w&&j)&&([b,y]=u(v));const R=!l&&(M||I||y);if(R){const A=!E||!s&&!x,O=b.r+b.l,T=b.t+b.b,K={marginRight:A&&!k?-O:0,marginBottom:A?-T:0,marginLeft:A&&k?-O:0,top:A?-b.t:0,right:A?k?-b.r:"auto":0,left:A?k?"auto":-b.l:0,width:A?`calc(100% + ${O}px)`:""},F={paddingTop:A?b.t:0,paddingRight:A?b.r:0,paddingBottom:A?b.b:0,paddingLeft:A?b.l:0};tr(s||i,K),tr(i,F),r({K:b,St:!A,P:s?F:fn({},K,F)})}return{xt:R}}},{max:lb}=Math,Da=lb.bind(0,0),gM="visible",Jk="hidden",Pee=42,wp={u:JE,o:{w:0,h:0}},Iee={u:eM,o:{x:Jk,y:Jk}},Eee=(e,t)=>{const n=window.devicePixelRatio%1!==0?1:0,r={w:Da(e.w-t.w),h:Da(e.h-t.h)};return{w:r.w>n?r.w:0,h:r.h>n?r.h:0}},Sp=e=>e.indexOf(gM)===0,Mee=(e,t)=>{const[n,r]=t,{Z:o,K:s,J:i,nt:l,ut:u,_t:p,it:h,et:m}=e,{k:v,V:b,I:y,A:x}=Rr(),w=Ki()[xy],k=!u&&!y&&(x.x||x.y),_=h&&u,[j,I]=Ro(wp,em.bind(0,i)),[E,M]=Ro(wp,Jh.bind(0,i)),[D,R]=Ro(wp),[A,O]=Ro(wp),[T]=Ro(Iee),K=(Y,B)=>{if(tr(i,{height:""}),B){const{St:q,K:re}=n(),{$t:Q,D:le}=Y,se=em(o),U=Bp(o),G=tr(i,"boxSizing")==="content-box",te=q||G?re.b+re.t:0,ae=!(x.x&&G);tr(i,{height:U.h+se.h+(Q.x&&ae?le.x:0)-te})}},F=(Y,B)=>{const q=!y&&!Y?Pee:0,re=(pe,ue,me)=>{const Ce=tr(i,pe),fe=(B?B[pe]:Ce)==="scroll";return[Ce,fe,fe&&!y?ue?q:me:0,ue&&!!q]},[Q,le,se,U]=re("overflowX",x.x,v.x),[G,te,ae,oe]=re("overflowY",x.y,v.y);return{Ct:{x:Q,y:G},$t:{x:le,y:te},D:{x:se,y:ae},M:{x:U,y:oe}}},V=(Y,B,q,re)=>{const Q=(te,ae)=>{const oe=Sp(te),pe=ae&&oe&&te.replace(`${gM}-`,"")||"";return[ae&&!oe?te:"",Sp(pe)?"hidden":pe]},[le,se]=Q(q.x,B.x),[U,G]=Q(q.y,B.y);return re.overflowX=se&&U?se:le,re.overflowY=G&&le?G:U,F(Y,re)},X=(Y,B,q,re)=>{const{D:Q,M:le}=Y,{x:se,y:U}=le,{x:G,y:te}=Q,{P:ae}=n(),oe=B?"marginLeft":"marginRight",pe=B?"paddingLeft":"paddingRight",ue=ae[oe],me=ae.marginBottom,Ce=ae[pe],ge=ae.paddingBottom;re.width=`calc(100% + ${te+-1*ue}px)`,re[oe]=-te+ue,re.marginBottom=-G+me,q&&(re[pe]=Ce+(U?te:0),re.paddingBottom=ge+(se?G:0))},[W,z]=w?w.H(k,b,i,l,n,F,X):[()=>k,()=>[co]];return(Y,B,q)=>{const{gt:re,Ot:Q,wt:le,xt:se,vt:U,yt:G}=Y,{ht:te,bt:ae}=n(),[oe,pe]=B("showNativeOverlaidScrollbars"),[ue,me]=B("overflow"),Ce=oe&&x.x&&x.y,ge=!u&&!b&&(re||le||Q||pe||U),fe=Sp(ue.x),De=Sp(ue.y),je=fe||De;let Be=I(q),rt=M(q),Ue=R(q),wt=O(q),Ye;if(pe&&y&&p(uM,ZJ,!Ce),ge&&(Ye=F(Ce),K(Ye,te)),re||se||le||G||pe){je&&p(uc,cc,!1);const[ke,ze]=z(Ce,ae,Ye),[Le,Ve]=Be=j(q),[ct,bn]=rt=E(q),jt=Bp(i);let Pt=ct,sr=jt;ke(),(bn||Ve||pe)&&ze&&!Ce&&W(ze,ct,Le,ae)&&(sr=Bp(i),Pt=Jh(i));const Mn={w:Da(lb(ct.w,Pt.w)+Le.w),h:Da(lb(ct.h,Pt.h)+Le.h)},pn={w:Da((_?m.innerWidth:sr.w+Da(jt.w-ct.w))+Le.w),h:Da((_?m.innerHeight+Le.h:sr.h+Da(jt.h-ct.h))+Le.h)};wt=A(pn),Ue=D(Eee(Mn,pn),q)}const[tt,be]=wt,[Re,st]=Ue,[mt,ve]=rt,[Qe,ot]=Be,lt={x:Re.w>0,y:Re.h>0},Me=fe&&De&&(lt.x||lt.y)||fe&&lt.x&&!lt.y||De&&lt.y&&!lt.x;if(se||G||ot||ve||be||st||me||pe||ge){const ke={marginRight:0,marginBottom:0,marginLeft:0,width:"",overflowY:"",overflowX:""},ze=V(Ce,lt,ue,ke),Le=W(ze,mt,Qe,ae);u||X(ze,ae,Le,ke),ge&&K(ze,te),u?(er(o,lM,ke.overflowX),er(o,cM,ke.overflowY)):tr(i,ke)}Ei(o,Ao,cc,Me),Ei(s,ab,JJ,Me),u||Ei(i,Oa,uc,je);const[$e,At]=T(F(Ce).Ct);return r({Ct:$e,zt:{x:tt.w,y:tt.h},Tt:{x:Re.w,y:Re.h},Et:lt}),{It:At,At:be,Lt:st}}},e_=(e,t,n)=>{const r={},o=t||{},s=Gr(e).concat(Gr(o));return Dt(s,i=>{const l=e[i],u=o[i];r[i]=!!(n||l||u)}),r},Oee=(e,t)=>{const{W:n,J:r,_t:o,ut:s}=e,{I:i,A:l,V:u}=Rr(),p=!i&&(l.x||l.y),h=[_ee(e,t),jee(e,t),Mee(e,t)];return(m,v,b)=>{const y=e_(fn({gt:!1,xt:!1,yt:!1,vt:!1,At:!1,Lt:!1,It:!1,Ot:!1,wt:!1},v),{},b),x=p||!u,w=x&&zo(r),k=x&&Zs(r);o("",tm,!0);let _=y;return Dt(h,j=>{_=e_(_,j(_,m,!!b)||{},b)}),zo(r,w),Zs(r,k),o("",tm),s||(zo(n,0),Zs(n,0)),_}},Dee=(e,t,n)=>{let r,o=!1;const s=()=>{o=!0},i=l=>{if(n){const u=n.reduce((p,h)=>{if(h){const[m,v]=h,b=v&&m&&(l?l(m):qE(m,e));b&&b.length&&v&&ni(v)&&zt(p,[b,v.trim()],!0)}return p},[]);Dt(u,p=>Dt(p[0],h=>{const m=p[1],v=r.get(h)||[];if(e.contains(h)){const y=$n(h,m,x=>{o?(y(),r.delete(h)):t(x)});r.set(h,zt(v,y))}else js(v),r.delete(h)}))}};return n&&(r=new WeakMap,i()),[s,i]},t_=(e,t,n,r)=>{let o=!1;const{Ht:s,Pt:i,Dt:l,Mt:u,Rt:p,kt:h}=r||{},m=hy(()=>{o&&n(!0)},{v:33,g:99}),[v,b]=Dee(e,m,l),y=s||[],x=i||[],w=y.concat(x),k=(j,I)=>{const E=p||co,M=h||co,D=new Set,R=new Set;let A=!1,O=!1;if(Dt(j,T=>{const{attributeName:K,target:F,type:V,oldValue:X,addedNodes:W,removedNodes:z}=T,Y=V==="attributes",B=V==="childList",q=e===F,re=Y&&ni(K)?er(F,K):0,Q=re!==0&&X!==re,le=ly(x,K)>-1&&Q;if(t&&(B||!q)){const se=!Y,U=Y&&Q,G=U&&u&&Qh(F,u),ae=(G?!E(F,K,X,re):se||U)&&!M(T,!!G,e,r);Dt(W,oe=>D.add(oe)),Dt(z,oe=>D.add(oe)),O=O||ae}!t&&q&&Q&&!E(F,K,X,re)&&(R.add(K),A=A||le)}),D.size>0&&b(T=>Gi(D).reduce((K,F)=>(zt(K,qE(T,F)),Qh(F,T)?zt(K,F):K),[])),t)return!I&&O&&n(!1),[!1];if(R.size>0||A){const T=[Gi(R),A];return!I&&n.apply(0,T),T}},_=new BJ(j=>k(j));return _.observe(e,{attributes:!0,attributeOldValue:!0,attributeFilter:w,subtree:t,childList:t,characterData:t}),o=!0,[()=>{o&&(v(),_.disconnect(),o=!1)},()=>{if(o){m.m();const j=_.takeRecords();return!cy(j)&&k(j,!0)}}]},kp=3333333,_p=e=>e&&(e.height||e.width),vM=(e,t,n)=>{const{Bt:r=!1,Vt:o=!1}=n||{},s=Ki()[hee],{B:i}=Rr(),u=XE(`<div class="${vy}"><div class="${tee}"></div></div>`)[0],p=u.firstChild,h=cd.bind(0,e),[m]=Ro({o:void 0,_:!0,u:(x,w)=>!(!x||!_p(x)&&_p(w))}),v=x=>{const w=Ko(x)&&x.length>0&&ld(x[0]),k=!w&&iy(x[0]);let _=!1,j=!1,I=!0;if(w){const[E,,M]=m(x.pop().contentRect),D=_p(E),R=_p(M);_=!M||!D,j=!R&&D,I=!_}else k?[,I]=x:j=x===!0;if(r&&I){const E=k?x[0]:cd(u);zo(u,E?i.n?-kp:i.i?0:kp:kp),Zs(u,kp)}_||t({gt:!k,Yt:k?x:void 0,Vt:!!j})},b=[];let y=o?v:!1;return[()=>{js(b),bs(u)},()=>{if(Xl){const x=new Xl(v);x.observe(p),zt(b,()=>{x.disconnect()})}else if(s){const[x,w]=s.O(p,v,o);y=x,zt(b,w)}if(r){const[x]=Ro({o:void 0},h);zt(b,$n(u,"scroll",w=>{const k=x(),[_,j,I]=k;j&&(py(p,"ltr rtl"),_?Js(p,"rtl"):Js(p,"ltr"),v([!!_,j,I])),nM(w)}))}y&&(Js(u,eee),zt(b,$n(u,"animationstart",y,{C:!!Xl}))),(Xl||s)&&fo(e,u)}]},Ree=e=>e.h===0||e.isIntersecting||e.intersectionRatio>0,Aee=(e,t)=>{let n;const r=Mi(nee),o=[],[s]=Ro({o:!1}),i=(u,p)=>{if(u){const h=s(Ree(u)),[,m]=h;if(m)return!p&&t(h),[h]}},l=(u,p)=>{if(u&&u.length>0)return i(u.pop(),p)};return[()=>{js(o),bs(r)},()=>{if($k)n=new $k(u=>l(u),{root:e}),n.observe(r),zt(o,()=>{n.disconnect()});else{const u=()=>{const m=ud(r);i(m)},[p,h]=vM(r,u);zt(o,p),h(),u()}fo(e,r)},()=>{if(n)return l(n.takeRecords(),!0)}]},n_=`[${Ao}]`,Nee=`[${Oa}]`,Tv=["tabindex"],r_=["wrap","cols","rows"],$v=["id","class","style","open"],Tee=(e,t,n)=>{let r,o,s;const{Z:i,J:l,tt:u,rt:p,ut:h,ft:m,_t:v}=e,{V:b}=Rr(),[y]=Ro({u:JE,o:{w:0,h:0}},()=>{const V=m(uc,cc),X=m(Rv,""),W=X&&zo(l),z=X&&Zs(l);v(uc,cc),v(Rv,""),v("",tm,!0);const Y=Jh(u),B=Jh(l),q=em(l);return v(uc,cc,V),v(Rv,"",X),v("",tm),zo(l,W),Zs(l,z),{w:B.w+Y.w+q.w,h:B.h+Y.h+q.h}}),x=p?r_:$v.concat(r_),w=hy(n,{v:()=>r,g:()=>o,p(V,X){const[W]=V,[z]=X;return[Gr(W).concat(Gr(z)).reduce((Y,B)=>(Y[B]=W[B]||z[B],Y),{})]}}),k=V=>{Dt(V||Tv,X=>{if(ly(Tv,X)>-1){const W=er(i,X);ni(W)?er(l,X,W):Cr(l,X)}})},_=(V,X)=>{const[W,z]=V,Y={vt:z};return t({ht:W}),!X&&n(Y),Y},j=({gt:V,Yt:X,Vt:W})=>{const z=!V||W?n:w;let Y=!1;if(X){const[B,q]=X;Y=q,t({bt:B})}z({gt:V,yt:Y})},I=(V,X)=>{const[,W]=y(),z={wt:W};return W&&!X&&(V?n:w)(z),z},E=(V,X,W)=>{const z={Ot:X};return X?!W&&w(z):h||k(V),z},[M,D,R]=u||!b?Aee(i,_):[co,co,co],[A,O]=h?[co,co]:vM(i,j,{Vt:!0,Bt:!0}),[T,K]=t_(i,!1,E,{Pt:$v,Ht:$v.concat(Tv)}),F=h&&Xl&&new Xl(j.bind(0,{gt:!0}));return F&&F.observe(i),k(),[()=>{M(),A(),s&&s[0](),F&&F.disconnect(),T()},()=>{O(),D()},()=>{const V={},X=K(),W=R(),z=s&&s[1]();return X&&fn(V,E.apply(0,zt(X,!0))),W&&fn(V,_.apply(0,zt(W,!0))),z&&fn(V,I.apply(0,zt(z,!0))),V},V=>{const[X]=V("update.ignoreMutation"),[W,z]=V("update.attributes"),[Y,B]=V("update.elementEvents"),[q,re]=V("update.debounce"),Q=B||z,le=se=>Go(X)&&X(se);if(Q&&(s&&(s[1](),s[0]()),s=t_(u||l,!0,I,{Ht:x.concat(W||[]),Dt:Y,Mt:n_,kt:(se,U)=>{const{target:G,attributeName:te}=se;return(!U&&te&&!h?NJ(G,n_,Nee):!1)||!!ql(G,`.${Dr}`)||!!le(se)}})),re)if(w.m(),Ko(q)){const se=q[0],U=q[1];r=Va(se)&&se,o=Va(U)&&U}else Va(q)?(r=q,o=!1):(r=!1,o=!1)}]},o_={x:0,y:0},$ee=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:o_,Tt:o_,Ct:{x:"hidden",y:"hidden"},Et:{x:!1,y:!1},ht:!1,bt:cd(e.Z)}),Lee=(e,t)=>{const n=ib(t,{}),[r,o,s]=gy(),[i,l,u]=kee(e),p=mM($ee(i)),[h,m]=p,v=Oee(i,p),b=(j,I,E)=>{const D=Gr(j).some(R=>j[R])||!uy(I)||E;return D&&s("u",[j,I,E]),D},[y,x,w,k]=Tee(i,m,j=>b(v(n,j),{},!1)),_=h.bind(0);return _.jt=j=>r("u",j),_.Nt=()=>{const{W:j,J:I}=i,E=zo(j),M=Zs(j);x(),l(),zo(I,E),Zs(I,M)},_.qt=i,[(j,I)=>{const E=ib(t,j,I);return k(E),b(v(E,w(),I),j,!!I)},_,()=>{o(),y(),u()}]},{round:s_}=Math,zee=e=>{const{width:t,height:n}=fs(e),{w:r,h:o}=ud(e);return{x:s_(t)/r||1,y:s_(n)/o||1}},Fee=(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)},Bee=(e,t)=>$n(e,"mousedown",$n.bind(0,t,"click",nM,{C:!0,$:!0}),{$:!0}),a_="pointerup pointerleave pointercancel lostpointercapture",Hee=(e,t,n,r,o,s,i)=>{const{B:l}=Rr(),{Ft:u,Gt:p,Xt:h}=r,m=`scroll${i?"Left":"Top"}`,v=`client${i?"X":"Y"}`,b=i?"width":"height",y=i?"left":"top",x=i?"w":"h",w=i?"x":"y",k=(_,j)=>I=>{const{Tt:E}=s(),M=ud(p)[x]-ud(u)[x],R=j*I/M*E[w],O=cd(h)&&i?l.n||l.i?1:-1:1;o[m]=_+R*O};return $n(p,"pointerdown",_=>{const j=ql(_.target,`.${by}`)===u,I=j?u:p;if(Ei(t,Ao,Vk,!0),Fee(_,e,j)){const E=!j&&_.shiftKey,M=()=>fs(u),D=()=>fs(p),R=(B,q)=>(B||M())[y]-(q||D())[y],A=k(o[m]||0,1/zee(o)[w]),O=_[v],T=M(),K=D(),F=T[b],V=R(T,K)+F/2,X=O-K[y],W=j?0:X-V,z=B=>{js(Y),I.releasePointerCapture(B.pointerId)},Y=[Ei.bind(0,t,Ao,Vk),$n(n,a_,z),$n(n,"selectstart",B=>rM(B),{S:!1}),$n(p,a_,z),$n(p,"pointermove",B=>{const q=B[v]-O;(j||E)&&A(W+q)})];if(E)A(W);else if(!j){const B=Ki()[mee];B&&zt(Y,B.O(A,R,W,F,X))}I.setPointerCapture(_.pointerId)}})},Wee=(e,t)=>(n,r,o,s,i,l)=>{const{Xt:u}=n,[p,h]=Hl(333),m=!!i.scrollBy;let v=!0;return js.bind(0,[$n(u,"pointerenter",()=>{r(Kk,!0)}),$n(u,"pointerleave pointercancel",()=>{r(Kk)}),$n(u,"wheel",b=>{const{deltaX:y,deltaY:x,deltaMode:w}=b;m&&v&&w===0&&ra(u)===s&&i.scrollBy({left:y,top:x,behavior:"smooth"}),v=!1,r(Yk,!0),p(()=>{v=!0,r(Yk)}),rM(b)},{S:!1,$:!0}),Bee(u,o),Hee(e,s,o,n,i,t,l),h])},{min:cb,max:i_,abs:Vee,round:Uee}=Math,bM=(e,t,n,r)=>{if(r){const l=n?"x":"y",{Tt:u,zt:p}=r,h=p[l],m=u[l];return i_(0,cb(1,h/(h+m)))}const o=n?"width":"height",s=fs(e)[o],i=fs(t)[o];return i_(0,cb(1,s/i))},Gee=(e,t,n,r,o,s)=>{const{B:i}=Rr(),l=s?"x":"y",u=s?"Left":"Top",{Tt:p}=r,h=Uee(p[l]),m=Vee(n[`scroll${u}`]),v=s&&o,b=i.i?m:h-m,x=cb(1,(v?b:m)/h),w=bM(e,t,s);return 1/w*(1-w)*x},Kee=(e,t,n)=>{const{N:r,L:o}=Rr(),{scrollbars:s}=r(),{slot:i}=s,{ct:l,W:u,Z:p,J:h,lt:m,ot:v,it:b,ut:y}=t,{scrollbars:x}=m?{}:e,{slot:w}=x||{},k=pM([u,p,h],()=>y&&b?u:p,i,w),_=(W,z,Y)=>{const B=Y?Js:py;Dt(W,q=>{B(q.Xt,z)})},j=(W,z)=>{Dt(W,Y=>{const[B,q]=z(Y);tr(B,q)})},I=(W,z,Y)=>{j(W,B=>{const{Ft:q,Gt:re}=B;return[q,{[Y?"width":"height"]:`${(100*bM(q,re,Y,z)).toFixed(3)}%`}]})},E=(W,z,Y)=>{const B=Y?"X":"Y";j(W,q=>{const{Ft:re,Gt:Q,Xt:le}=q,se=Gee(re,Q,v,z,cd(le),Y);return[re,{transform:se===se?`translate${B}(${(100*se).toFixed(3)}%)`:""}]})},M=[],D=[],R=[],A=(W,z,Y)=>{const B=iy(Y),q=B?Y:!0,re=B?!Y:!0;q&&_(D,W,z),re&&_(R,W,z)},O=W=>{I(D,W,!0),I(R,W)},T=W=>{E(D,W,!0),E(R,W)},K=W=>{const z=W?aee:iee,Y=W?D:R,B=cy(Y)?Gk:"",q=Mi(`${Dr} ${z} ${B}`),re=Mi(dM),Q=Mi(by),le={Xt:q,Gt:re,Ft:Q};return o||Js(q,ree),fo(q,re),fo(re,Q),zt(Y,le),zt(M,[bs.bind(0,q),n(le,A,l,p,v,W)]),le},F=K.bind(0,!0),V=K.bind(0,!1),X=()=>{fo(k,D[0].Xt),fo(k,R[0].Xt),Zh(()=>{A(Gk)},300)};return F(),V(),[{Ut:O,Wt:T,Zt:A,Jt:{Kt:D,Qt:F,tn:j.bind(0,D)},nn:{Kt:R,Qt:V,tn:j.bind(0,R)}},X,js.bind(0,M)]},qee=(e,t,n,r)=>{let o,s,i,l,u,p=0;const h=mM({}),[m]=h,[v,b]=Hl(),[y,x]=Hl(),[w,k]=Hl(100),[_,j]=Hl(100),[I,E]=Hl(()=>p),[M,D,R]=Kee(e,n.qt,Wee(t,n)),{Z:A,J:O,ot:T,st:K,ut:F,it:V}=n.qt,{Jt:X,nn:W,Zt:z,Ut:Y,Wt:B}=M,{tn:q}=X,{tn:re}=W,Q=te=>{const{Xt:ae}=te,oe=F&&!V&&ra(ae)===O&&ae;return[oe,{transform:oe?`translate(${zo(T)}px, ${Zs(T)}px)`:""}]},le=(te,ae)=>{if(E(),te)z(Xk);else{const oe=()=>z(Xk,!0);p>0&&!ae?I(oe):oe()}},se=()=>{l=s,l&&le(!0)},U=[k,E,j,x,b,R,$n(A,"pointerover",se,{C:!0}),$n(A,"pointerenter",se),$n(A,"pointerleave",()=>{l=!1,s&&le(!1)}),$n(A,"pointermove",()=>{o&&v(()=>{k(),le(!0),_(()=>{o&&le(!1)})})}),$n(K,"scroll",te=>{y(()=>{B(n()),i&&le(!0),w(()=>{i&&!l&&le(!1)})}),r(te),F&&q(Q),F&&re(Q)})],G=m.bind(0);return G.qt=M,G.Nt=D,[(te,ae,oe)=>{const{At:pe,Lt:ue,It:me,yt:Ce}=oe,{A:ge}=Rr(),fe=ib(t,te,ae),De=n(),{Tt:je,Ct:Be,bt:rt}=De,[Ue,wt]=fe("showNativeOverlaidScrollbars"),[Ye,tt]=fe("scrollbars.theme"),[be,Re]=fe("scrollbars.visibility"),[st,mt]=fe("scrollbars.autoHide"),[ve]=fe("scrollbars.autoHideDelay"),[Qe,ot]=fe("scrollbars.dragScroll"),[lt,Me]=fe("scrollbars.clickScroll"),$e=pe||ue||Ce,At=me||Re,ke=Ue&&ge.x&&ge.y,ze=(Le,Ve)=>{const ct=be==="visible"||be==="auto"&&Le==="scroll";return z(lee,ct,Ve),ct};if(p=ve,wt&&z(oee,ke),tt&&(z(u),z(Ye,!0),u=Ye),mt&&(o=st==="move",s=st==="leave",i=st!=="never",le(!i,!0)),ot&&z(dee,Qe),Me&&z(uee,lt),At){const Le=ze(Be.x,!0),Ve=ze(Be.y,!1);z(cee,!(Le&&Ve))}$e&&(Y(De),B(De),z(qk,!je.x,!0),z(qk,!je.y,!1),z(see,rt&&!V))},G,js.bind(0,U)]},xM=(e,t,n)=>{Go(e)&&e(t||void 0,n||void 0)},Fa=(e,t,n)=>{const{F:r,N:o,Y:s,j:i}=Rr(),l=Ki(),u=Yh(e),p=u?e:e.target,h=hM(p);if(t&&!h){let m=!1;const v=F=>{const V=Ki()[pee],X=V&&V.O;return X?X(F,!0):F},b=fn({},r(),v(t)),[y,x,w]=gy(n),[k,_,j]=Lee(e,b),[I,E,M]=qee(e,b,_,F=>w("scroll",[K,F])),D=(F,V)=>k(F,!!V),R=D.bind(0,{},!0),A=s(R),O=i(R),T=F=>{See(p),A(),O(),M(),j(),m=!0,w("destroyed",[K,!!F]),x()},K={options(F,V){if(F){const X=V?r():{},W=oM(b,fn(X,v(F)));uy(W)||(fn(b,W),D(W))}return fn({},b)},on:y,off:(F,V)=>{F&&V&&x(F,V)},state(){const{zt:F,Tt:V,Ct:X,Et:W,K:z,St:Y,bt:B}=_();return fn({},{overflowEdge:F,overflowAmount:V,overflowStyle:X,hasOverflow:W,padding:z,paddingAbsolute:Y,directionRTL:B,destroyed:m})},elements(){const{W:F,Z:V,K:X,J:W,tt:z,ot:Y,st:B}=_.qt,{Jt:q,nn:re}=E.qt,Q=se=>{const{Ft:U,Gt:G,Xt:te}=se;return{scrollbar:te,track:G,handle:U}},le=se=>{const{Kt:U,Qt:G}=se,te=Q(U[0]);return fn({},te,{clone:()=>{const ae=Q(G());return I({},!0,{}),ae}})};return fn({},{target:F,host:V,padding:X||W,viewport:W,content:z||W,scrollOffsetElement:Y,scrollEventElement:B,scrollbarHorizontal:le(q),scrollbarVertical:le(re)})},update:F=>D({},F),destroy:T.bind(0)};return _.jt((F,V,X)=>{I(V,X,F)}),wee(p,K),Dt(Gr(l),F=>xM(l[F],0,K)),Cee(_.qt.it,o().cancel,!u&&e.cancel)?(T(!0),K):(_.Nt(),E.Nt(),w("initialized",[K]),_.jt((F,V,X)=>{const{gt:W,yt:z,vt:Y,At:B,Lt:q,It:re,wt:Q,Ot:le}=F;w("updated",[K,{updateHints:{sizeChanged:W,directionChanged:z,heightIntrinsicChanged:Y,overflowEdgeChanged:B,overflowAmountChanged:q,overflowStyleChanged:re,contentMutation:Q,hostMutation:le},changedOptions:V,force:X}])}),K.update(!0),K)}return h};Fa.plugin=e=>{Dt(fee(e),t=>xM(t,Fa))};Fa.valid=e=>{const t=e&&e.elements,n=Go(t)&&t();return nb(n)&&!!hM(n.target)};Fa.env=()=>{const{k:e,A:t,I:n,B:r,V:o,L:s,X:i,U:l,N:u,q:p,F:h,G:m}=Rr();return fn({},{scrollbarsSize:e,scrollbarsOverlaid:t,scrollbarsHiding:n,rtlScrollBehavior:r,flexboxGlue:o,cssCustomProperties:s,staticDefaultInitialization:i,staticDefaultOptions:l,getDefaultInitialization:u,setDefaultInitialization:p,getDefaultOptions:h,setDefaultOptions:m})};const Xee=()=>{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,h)=>{u(),e=i(r?()=>{u(),t=o(p)}:p,typeof h=="object"?h:{timeout:2233})},u]},yM=e=>{const{options:t,events:n,defer:r}=e||{},[o,s]=d.useMemo(Xee,[]),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:h}=i;u.current=t,Fa.valid(h)&&h.options(t||{},!0)},[t]),d.useEffect(()=>{const{current:h}=i;p.current=n,Fa.valid(h)&&h.on(n||{},!0)},[n]),d.useEffect(()=>()=>{var h;s(),(h=i.current)==null||h.destroy()},[]),d.useMemo(()=>[h=>{const m=i.current;if(Fa.valid(m))return;const v=l.current,b=u.current||{},y=p.current||{},x=()=>i.current=Fa(h,b,y);v?o(x,v):x()},()=>i.current],[])},Yee=(e,t)=>{const{element:n="div",options:r,events:o,defer:s,children:i,...l}=e,u=n,p=d.useRef(null),h=d.useRef(null),[m,v]=yM({options:r,events:o,defer:s});return d.useEffect(()=>{const{current:b}=p,{current:y}=h;return b&&y&&m({target:b,elements:{viewport:y,content:y}}),()=>{var x;return(x=v())==null?void 0:x.destroy()}},[m,n]),d.useImperativeHandle(t,()=>({osInstance:v,getElement:()=>p.current}),[]),H.createElement(u,{"data-overlayscrollbars-initialize":"",ref:p,...l},H.createElement("div",{ref:h},i))},ug=d.forwardRef(Yee),Qee=e=>{const{boardToDelete:t,setBoardToDelete:n}=e,{t:r}=Z(),o=L(_=>_.config.canRestoreDeletedImagesFromBin),{currentData:s,isFetching:i}=vD((t==null?void 0:t.board_id)??Er.skipToken),l=d.useMemo(()=>ie([xe],_=>{const j=(s??[]).map(E=>Lj(_,E));return{imageUsageSummary:{isInitialImage:Br(j,E=>E.isInitialImage),isCanvasImage:Br(j,E=>E.isCanvasImage),isNodesImage:Br(j,E=>E.isNodesImage),isControlNetImage:Br(j,E=>E.isControlNetImage),isIPAdapterImage:Br(j,E=>E.isIPAdapterImage)}}}),[s]),[u,{isLoading:p}]=bD(),[h,{isLoading:m}]=xD(),{imageUsageSummary:v}=L(l),b=d.useCallback(()=>{t&&(u(t.board_id),n(void 0))},[t,u,n]),y=d.useCallback(()=>{t&&(h(t.board_id),n(void 0))},[t,h,n]),x=d.useCallback(()=>{n(void 0)},[n]),w=d.useRef(null),k=d.useMemo(()=>m||p||i,[m,p,i]);return t?a.jsx($d,{isOpen:!!t,onClose:x,leastDestructiveRef:w,isCentered:!0,children:a.jsx(Wo,{children:a.jsxs(Ld,{children:[a.jsxs(Ho,{fontSize:"lg",fontWeight:"bold",children:["Delete ",t.board_name]}),a.jsx(Vo,{children:a.jsxs($,{direction:"column",gap:3,children:[i?a.jsx(Hm,{children:a.jsx($,{sx:{w:"full",h:32}})}):a.jsx(jE,{imageUsage:v,topMessage:r("boards.topMessage"),bottomMessage:r("boards.bottomMessage")}),a.jsx(ye,{children:"Deleted boards cannot be restored."}),a.jsx(ye,{children:r(o?"gallery.deleteImageBin":"gallery.deleteImagePermanent")})]})}),a.jsx(gs,{children:a.jsxs($,{sx:{justifyContent:"space-between",width:"full",gap:2},children:[a.jsx(it,{ref:w,onClick:x,children:"Cancel"}),a.jsx(it,{colorScheme:"warning",isLoading:k,onClick:b,children:"Delete Board Only"}),a.jsx(it,{colorScheme:"error",isLoading:k,onClick:y,children:"Delete Board and Images"})]})})]})})}):null},Zee=d.memo(Qee),Jee=()=>{const{t:e}=Z(),[t,{isLoading:n}]=yD(),r=e("boards.myBoard"),o=d.useCallback(()=>{t(r)},[t,r]);return a.jsx(Te,{icon:a.jsx(ol,{}),isLoading:n,tooltip:e("boards.addBoard"),"aria-label":e("boards.addBoard"),onClick:o,size:"sm"})},ete=d.memo(Jee);var CM=Pd({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"})]})}),dg=Pd({d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z",displayName:"ChevronUpIcon"}),tte=Pd({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"}),nte=Pd({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"})})}),rte=Pd({displayName:"ChevronDownIcon",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"});const ote=ie([xe],({gallery:e})=>{const{boardSearchText:t}=e;return{boardSearchText:t}},we),ste=()=>{const e=ee(),{boardSearchText:t}=L(ote),n=d.useRef(null),{t:r}=Z(),o=d.useCallback(u=>{e(HC(u))},[e]),s=d.useCallback(()=>{e(HC(""))},[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(L3,{children:[a.jsx(Em,{ref:n,placeholder:r("boards.searchBoard"),value:t,onKeyDown:i,onChange:l}),t&&t.length&&a.jsx(vx,{children:a.jsx(ps,{onClick:s,size:"xs",variant:"ghost","aria-label":r("boards.clearSearch"),opacity:.5,icon:a.jsx(tte,{boxSize:2})})})]})},ate=d.memo(ste);function wM(e){return CD(e)}function ite(e){return wD(e)}const SM=(e,t)=>{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:s}=t.data.current.payload,i=s.board_id??"none",l=e.context.boardId;return i!==l}return r==="IMAGE_DTOS"}case"REMOVE_FROM_BOARD":{if(!(r==="IMAGE_DTO"||"IMAGE_DTOS"))return!1;if(r==="IMAGE_DTO"){const{imageDTO:s}=t.data.current.payload;return s.board_id!=="none"}return r==="IMAGE_DTOS"}default:return!1}},lte=e=>{const{isOver:t,label:n="Drop"}=e,r=d.useRef(Ba()),{colorMode:o}=la();return a.jsx(vn.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}},children:a.jsxs($,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full"},children:[a.jsx($,{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($,{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)},kM=d.memo(lte),cte=e=>{const{dropLabel:t,data:n,disabled:r}=e,o=d.useRef(Ba()),{isOver:s,setNodeRef:i,active:l}=wM({id:o.current,disabled:r,data:n});return a.jsx(Ie,{ref:i,position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",pointerEvents:"none",children:a.jsx(nr,{children:SM(n,l)&&a.jsx(kM,{isOver:s,label:t})})})},wy=d.memo(cte),ute=({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}}}),Sy=d.memo(ute),dte=()=>a.jsx($,{sx:{position:"absolute",insetInlineEnd:0,top:0,p:1},children:a.jsx(da,{variant:"solid",sx:{bg:"accent.400",_dark:{bg:"accent.500"}},children:"auto"})}),_M=d.memo(dte);function ky(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),h=L(v=>v.ui.globalContextMenuCloseTrigger);d.useEffect(()=>{if(t)setTimeout(()=>{o(!0),setTimeout(()=>{i(!0)})});else{i(!1);const v=setTimeout(()=>{o(t)},1e3);return()=>clearTimeout(v)}},[t]),d.useEffect(()=>{n(!1),i(!1),o(!1)},[h]),tz("contextmenu",v=>{var b;(b=p.current)!=null&&b.contains(v.target)||v.target===p.current?(v.preventDefault(),n(!0),u([v.pageX,v.pageY])):n(!1)});const m=d.useCallback(()=>{var v,b;(b=(v=e.menuProps)==null?void 0:v.onClose)==null||b.call(v),n(!1)},[e.menuProps]);return a.jsxs(a.Fragment,{children:[e.children(p),r&&a.jsx(_d,{...e.portalProps,children:a.jsxs(Nd,{isOpen:s,gutter:0,...e.menuProps,onClose:m,children:[a.jsx(Td,{"aria-hidden":!0,w:1,h:1,style:{position:"absolute",left:l[0],top:l[1],cursor:"default"},...e.menuButtonProps}),e.renderMenu()]})})]})}const fg=e=>{const{boardName:t}=pm(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},fte=({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(Wt,{sx:{color:"error.600",_dark:{color:"error.300"}},icon:a.jsx(Kr,{}),onClick:n,children:"Delete Board"})]})},pte=d.memo(fte),hte=()=>a.jsx(a.Fragment,{}),mte=d.memo(hte),gte=({board:e,board_id:t,setBoardToDelete:n,children:r})=>{const o=ee(),s=d.useMemo(()=>ie(xe,({gallery:b,system:y})=>{const x=b.autoAddBoardId===t,w=y.isProcessing,k=b.autoAssignBoardOnClick;return{isAutoAdd:x,isProcessing:w,autoAssignBoardOnClick:k}},we),[t]),{isAutoAdd:i,isProcessing:l,autoAssignBoardOnClick:u}=L(s),p=fg(t),h=d.useCallback(()=>{o(mm(t))},[t,o]),m=d.useCallback(b=>{b.preventDefault()},[]),{t:v}=Z();return a.jsx(ky,{menuProps:{size:"sm",isLazy:!0},menuButtonProps:{bg:"transparent",_hover:{bg:"transparent"}},renderMenu:()=>a.jsx(Ka,{sx:{visibility:"visible !important"},motionProps:vc,onContextMenu:m,children:a.jsxs(Sc,{title:p,children:[a.jsx(Wt,{icon:a.jsx(ol,{}),isDisabled:i||l||u,onClick:h,children:v("boards.menuItemAutoAdd")}),!e&&a.jsx(mte,{}),e&&a.jsx(pte,{board:e,setBoardToDelete:n})]})}),children:r})},jM=d.memo(gte),vte=({board:e,isSelected:t,setBoardToDelete:n})=>{const r=ee(),o=d.useMemo(()=>ie(xe,({gallery:O,system:T})=>{const K=e.board_id===O.autoAddBoardId,F=O.autoAssignBoardOnClick,V=T.isProcessing;return{isSelectedForAutoAdd:K,autoAssignBoardOnClick:F,isProcessing:V}},we),[e.board_id]),{isSelectedForAutoAdd:s,autoAssignBoardOnClick:i,isProcessing:l}=L(o),[u,p]=d.useState(!1),h=d.useCallback(()=>{p(!0)},[]),m=d.useCallback(()=>{p(!1)},[]),{data:v}=Vj(e.board_id),{data:b}=Uj(e.board_id),y=d.useMemo(()=>{if(!(!v||!b))return`${v} image${v>1?"s":""}, ${b} asset${b>1?"s":""}`},[b,v]),{currentData:x}=Wr(e.cover_image_name??Er.skipToken),{board_name:w,board_id:k}=e,[_,j]=d.useState(w),I=d.useCallback(()=>{r(Gj(k)),i&&!l&&r(mm(k))},[k,i,l,r]),[E,{isLoading:M}]=SD(),D=d.useMemo(()=>({id:k,actionType:"ADD_TO_BOARD",context:{boardId:k}}),[k]),R=d.useCallback(async O=>{if(!O.trim()){j(w);return}if(O!==w)try{const{board_name:T}=await E({board_id:k,changes:{board_name:O}}).unwrap();j(T)}catch{j(w)}},[k,w,E]),A=d.useCallback(O=>{j(O)},[]);return a.jsx(Ie,{sx:{w:"full",h:"full",touchAction:"none",userSelect:"none"},children:a.jsx($,{onMouseOver:h,onMouseOut:m,sx:{position:"relative",justifyContent:"center",alignItems:"center",aspectRatio:"1/1",w:"full",h:"full"},children:a.jsx(jM,{board:e,board_id:k,setBoardToDelete:n,children:O=>a.jsx(Rt,{label:y,openDelay:1e3,hasArrow:!0,children:a.jsxs($,{ref:O,onClick:I,sx:{w:"full",h:"full",position:"relative",justifyContent:"center",alignItems:"center",borderRadius:"base",cursor:"pointer",bg:"base.200",_dark:{bg:"base.800"}},children:[x!=null&&x.thumbnail_url?a.jsx(Qi,{src:x==null?void 0:x.thumbnail_url,draggable:!1,sx:{objectFit:"cover",w:"full",h:"full",maxH:"full",borderRadius:"base",borderBottomRadius:"lg"}}):a.jsx($,{sx:{w:"full",h:"full",justifyContent:"center",alignItems:"center"},children:a.jsx(Tn,{boxSize:12,as:eJ,sx:{mt:-6,opacity:.7,color:"base.500",_dark:{color:"base.500"}}})}),s&&a.jsx(_M,{}),a.jsx(Sy,{isSelected:t,isHovered:u}),a.jsx($,{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(jm,{value:_,isDisabled:M,submitOnBlur:!0,onChange:A,onSubmit:R,sx:{w:"full"},children:[a.jsx(_m,{sx:{p:0,fontWeight:t?700:500,textAlign:"center",overflow:"hidden",textOverflow:"ellipsis"},noOfLines:1}),a.jsx(km,{sx:{p:0,_focusVisible:{p:0,textAlign:"center",boxShadow:"none"}}})]})}),a.jsx(wy,{data:D,dropLabel:a.jsx(ye,{fontSize:"md",children:"Move"})})]})})})})})},bte=d.memo(vte),xte=ie(xe,({gallery:e,system:t})=>{const{autoAddBoardId:n,autoAssignBoardOnClick:r}=e,{isProcessing:o}=t;return{autoAddBoardId:n,autoAssignBoardOnClick:r,isProcessing:o}},we),PM=d.memo(({isSelected:e})=>{const t=ee(),{autoAddBoardId:n,autoAssignBoardOnClick:r,isProcessing:o}=L(xte),s=fg("none"),i=d.useCallback(()=>{t(Gj("none")),r&&!o&&t(mm("none"))},[t,r,o]),[l,u]=d.useState(!1),p=d.useCallback(()=>{u(!0)},[]),h=d.useCallback(()=>{u(!1)},[]),m=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($,{onMouseOver:p,onMouseOut:h,sx:{position:"relative",justifyContent:"center",alignItems:"center",aspectRatio:"1/1",borderRadius:"base",w:"full",h:"full"},children:a.jsx(jM,{board_id:"none",children:v=>a.jsxs($,{ref:v,onClick:i,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($,{sx:{w:"full",h:"full",justifyContent:"center",alignItems:"center"},children:a.jsx(Qi,{src:Fj,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(_M,{}),a.jsx($,{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:s}),a.jsx(Sy,{isSelected:e,isHovered:l}),a.jsx(wy,{data:m,dropLabel:a.jsx(ye,{fontSize:"md",children:"Move"})})]})})})})});PM.displayName="HoverableBoard";const yte=d.memo(PM),Cte=ie([xe],({gallery:e})=>{const{selectedBoardId:t,boardSearchText:n}=e;return{selectedBoardId:t,boardSearchText:n}},we),wte=e=>{const{isOpen:t}=e,{selectedBoardId:n,boardSearchText:r}=L(Cte),{data:o}=pm(),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(wm,{in:t,animateOpacity:!0,children:a.jsxs($,{layerStyle:"first",sx:{flexDir:"column",gap:2,p:2,mt:2,borderRadius:"base"},children:[a.jsxs($,{sx:{gap:2,alignItems:"center"},children:[a.jsx(ate,{}),a.jsx(ete,{})]}),a.jsx(ug,{defer:!0,style:{height:"100%",width:"100%"},options:{scrollbars:{visibility:"auto",autoHide:"move",autoHideDelay:1300,theme:"os-theme-dark"}},children:a.jsxs(Ga,{className:"list-container",sx:{gridTemplateColumns:"repeat(auto-fill, minmax(108px, 1fr));",maxH:346},children:[a.jsx(td,{sx:{p:1.5},children:a.jsx(yte,{isSelected:n==="none"})}),s&&s.map(u=>a.jsx(td,{sx:{p:1.5},children:a.jsx(bte,{board:u,isSelected:n===u.board_id,setBoardToDelete:l})},u.board_id))]})})]})}),a.jsx(Zee,{boardToDelete:i,setBoardToDelete:l})]})},Ste=d.memo(wte),kte=ie([xe],e=>{const{selectedBoardId:t}=e.gallery;return{selectedBoardId:t}},we),_te=e=>{const{isOpen:t,onToggle:n}=e,{selectedBoardId:r}=L(kte),o=fg(r),s=d.useMemo(()=>o.length>20?`${o.substring(0,20)}...`:o,[o]);return a.jsxs($,{as:bc,onClick:n,size:"sm",sx:{position:"relative",gap:2,w:"full",justifyContent:"space-between",alignItems:"center",px:2},children:[a.jsx(ye,{noOfLines:1,sx:{fontWeight:600,w:"100%",textAlign:"center",color:"base.800",_dark:{color:"base.200"}},children:s}),a.jsx(dg,{sx:{transform:t?"rotate(0deg)":"rotate(180deg)",transitionProperty:"common",transitionDuration:"normal"}})]})},jte=d.memo(_te),Pte=e=>{const{triggerComponent:t,children:n,hasArrow:r=!0,isLazy:o=!0,...s}=e;return a.jsxs(Fm,{isLazy:o,...s,children:[a.jsx(Rx,{children:t}),a.jsxs(Bm,{shadow:"dark-lg",children:[r&&a.jsx(xP,{}),n]})]})},qd=d.memo(Pte);function Ite(e){return Ne({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 Ete=e=>{const[t,n]=d.useState(!1),{label:r,value:o,min:s=1,max:i=100,step:l=1,onChange:u,tooltipSuffix:p="",withSliderMarks:h=!1,withInput:m=!1,isInteger:v=!1,inputWidth:b=16,withReset:y=!1,hideTooltip:x=!1,isCompact:w=!1,isDisabled:k=!1,sliderMarks:_,handleReset:j,sliderFormControlProps:I,sliderFormLabelProps:E,sliderMarkProps:M,sliderTrackProps:D,sliderThumbProps:R,sliderNumberInputProps:A,sliderNumberInputFieldProps:O,sliderNumberInputStepperProps:T,sliderTooltipProps:K,sliderIAIIconButtonProps:F,...V}=e,X=ee(),{t:W}=Z(),[z,Y]=d.useState(String(o));d.useEffect(()=>{Y(o)},[o]);const B=d.useMemo(()=>A!=null&&A.min?A.min:s,[s,A==null?void 0:A.min]),q=d.useMemo(()=>A!=null&&A.max?A.max:i,[i,A==null?void 0:A.max]),re=d.useCallback(ae=>{u(ae)},[u]),Q=d.useCallback(ae=>{ae.target.value===""&&(ae.target.value=String(B));const oe=Ni(v?Math.floor(Number(ae.target.value)):Number(z),B,q),pe=Mu(oe,l);u(pe),Y(pe)},[v,z,B,q,u,l]),le=d.useCallback(ae=>{Y(ae)},[]),se=d.useCallback(()=>{j&&j()},[j]),U=d.useCallback(ae=>{ae.target instanceof HTMLDivElement&&ae.target.focus()},[]),G=d.useCallback(ae=>{ae.shiftKey&&X(Ir(!0))},[X]),te=d.useCallback(ae=>{ae.shiftKey||X(Ir(!1))},[X]);return a.jsxs(sn,{onClick:U,sx:w?{display:"flex",flexDirection:"row",alignItems:"center",columnGap:4,margin:0,padding:0}:{},isDisabled:k,...I,children:[r&&a.jsx(Hn,{sx:m?{mb:-1.5}:{},...E,children:r}),a.jsxs(Om,{w:"100%",gap:2,alignItems:"center",children:[a.jsxs(Lx,{"aria-label":r,value:o,min:s,max:i,step:l,onChange:re,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),focusThumbOnChange:!1,isDisabled:k,...V,children:[h&&!_&&a.jsxs(a.Fragment,{children:[a.jsx(Fl,{value:s,sx:{insetInlineStart:"0 !important",insetInlineEnd:"unset !important"},...M,children:s}),a.jsx(Fl,{value:i,sx:{insetInlineStart:"unset !important",insetInlineEnd:"0 !important"},...M,children:i})]}),h&&_&&a.jsx(a.Fragment,{children:_.map((ae,oe)=>oe===0?a.jsx(Fl,{value:ae,sx:{insetInlineStart:"0 !important",insetInlineEnd:"unset !important"},...M,children:ae},ae):oe===_.length-1?a.jsx(Fl,{value:ae,sx:{insetInlineStart:"unset !important",insetInlineEnd:"0 !important"},...M,children:ae},ae):a.jsx(Fl,{value:ae,sx:{transform:"translateX(-50%)"},...M,children:ae},ae))}),a.jsx(Fx,{...D,children:a.jsx(Bx,{})}),a.jsx(Rt,{hasArrow:!0,placement:"top",isOpen:t,label:`${o}${p}`,hidden:x,...K,children:a.jsx(zx,{...R,zIndex:0})})]}),m&&a.jsxs(Nm,{min:B,max:q,step:l,value:z,onChange:le,onBlur:Q,focusInputOnChange:!1,...A,children:[a.jsx($m,{onKeyDown:G,onKeyUp:te,minWidth:b,...O}),a.jsxs(Tm,{...T,children:[a.jsx(zm,{onClick:()=>u(Number(z))}),a.jsx(Lm,{onClick:()=>u(Number(z))})]})]}),y&&a.jsx(Te,{size:"sm","aria-label":W("accessibility.reset"),tooltip:W("accessibility.reset"),icon:a.jsx(Ite,{}),isDisabled:k,onClick:se,...F})]})]})},Xe=d.memo(Ete),IM=d.forwardRef(({label:e,tooltip:t,description:n,disabled:r,...o},s)=>a.jsx(Rt,{label:t,placement:"top",hasArrow:!0,openDelay:500,children:a.jsx(Ie,{ref:s,...o,children:a.jsxs(Ie,{children:[a.jsx(kc,{children:e}),n&&a.jsx(kc,{size:"xs",color:"base.600",children:n})]})})}));IM.displayName="IAIMantineSelectItemWithTooltip";const ri=d.memo(IM),Mte=ie([xe],({gallery:e,system:t})=>{const{autoAddBoardId:n,autoAssignBoardOnClick:r}=e,{isProcessing:o}=t;return{autoAddBoardId:n,autoAssignBoardOnClick:r,isProcessing:o}},we),Ote=()=>{const e=ee(),{t}=Z(),{autoAddBoardId:n,autoAssignBoardOnClick:r,isProcessing:o}=L(Mte),s=d.useRef(null),{boards:i,hasBoards:l}=pm(void 0,{selectFromResult:({data:p})=>{const h=[{label:"None",value:"none"}];return p==null||p.forEach(({board_id:m,board_name:v})=>{h.push({label:v,value:m})}),{boards:h,hasBoards:h.length>1}}}),u=d.useCallback(p=>{p&&e(mm(p))},[e]);return a.jsx(Kt,{label:t("boards.autoAddBoard"),inputRef:s,autoFocus:!0,placeholder:t("boards.selectBoard"),value:n,data:i,nothingFound:t("boards.noMatching"),itemComponent:ri,disabled:!l||r||o,filter:(p,h)=>{var m;return((m=h.label)==null?void 0:m.toLowerCase().includes(p.toLowerCase().trim()))||h.value.toLowerCase().includes(p.toLowerCase().trim())},onChange:u})},Dte=d.memo(Ote),Rte=e=>{const{label:t,...n}=e,{colorMode:r}=la();return a.jsx(Sm,{colorScheme:"accent",...n,children:a.jsx(ye,{sx:{fontSize:"sm",color:Ae("base.800","base.200")(r)},children:t})})},ur=d.memo(Rte),Ate=ie([xe],e=>{const{galleryImageMinimumWidth:t,shouldAutoSwitch:n,autoAssignBoardOnClick:r}=e.gallery;return{galleryImageMinimumWidth:t,shouldAutoSwitch:n,autoAssignBoardOnClick:r}},we),Nte=()=>{const e=ee(),{t}=Z(),{galleryImageMinimumWidth:n,shouldAutoSwitch:r,autoAssignBoardOnClick:o}=L(Ate),s=d.useCallback(u=>{e(WC(u))},[e]),i=d.useCallback(()=>{e(WC(64))},[e]),l=d.useCallback(u=>{e(kD(u.target.checked))},[e]);return a.jsx(qd,{triggerComponent:a.jsx(Te,{tooltip:t("gallery.gallerySettings"),"aria-label":t("gallery.gallerySettings"),size:"sm",icon:a.jsx(VE,{})}),children:a.jsxs($,{direction:"column",gap:2,children:[a.jsx(Xe,{value:n,onChange:s,min:45,max:256,hideTooltip:!0,label:t("gallery.galleryImageSize"),withReset:!0,handleReset:i}),a.jsx(Vt,{label:t("gallery.autoSwitchNewImages"),isChecked:r,onChange:l}),a.jsx(ur,{label:t("gallery.autoAssignBoardOnClick"),isChecked:o,onChange:u=>e(_D(u.target.checked))}),a.jsx(Dte,{})]})})},Tte=d.memo(Nte),$te=e=>e.image?a.jsx(Hm,{sx:{w:`${e.image.width}px`,h:"auto",objectFit:"contain",aspectRatio:`${e.image.width}/${e.image.height}`}}):a.jsx($,{sx:{opacity:.7,w:"full",h:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",bg:"base.200",_dark:{bg:"base.900"}},children:a.jsx(Xi,{size:"xl"})}),Kn=e=>{const{icon:t=Ui,boxSize:n=16}=e;return a.jsxs($,{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"},...e.sx},children:[t&&a.jsx(Tn,{as:t,boxSize:n,opacity:.7}),e.label&&a.jsx(ye,{textAlign:"center",children:e.label})]})},pg=0,oi=1,Vc=2,EM=4;function Lte(e,t){return n=>e(t(n))}function zte(e,t){return t(e)}function MM(e,t){return n=>e(t,n)}function l_(e,t){return()=>e(t)}function _y(e,t){return t(e),e}function sl(...e){return e}function Fte(e){e()}function c_(e){return()=>e}function Bte(...e){return()=>{e.map(Fte)}}function hg(){}function pr(e,t){return e(oi,t)}function Nn(e,t){e(pg,t)}function jy(e){e(Vc)}function mg(e){return e(EM)}function Gt(e,t){return pr(e,MM(t,pg))}function u_(e,t){const n=e(oi,r=>{n(),t(r)});return n}function yn(){const e=[];return(t,n)=>{switch(t){case Vc:e.splice(0,e.length);return;case oi:return e.push(n),()=>{const r=e.indexOf(n);r>-1&&e.splice(r,1)};case pg:e.slice().forEach(r=>{r(n)});return;default:throw new Error(`unrecognized action ${t}`)}}}function dt(e){let t=e;const n=yn();return(r,o)=>{switch(r){case oi:o(t);break;case pg:t=o;break;case EM:return t}return n(r,o)}}function Hte(e){let t,n;const r=()=>t&&t();return function(o,s){switch(o){case oi:return s?n===s?void 0:(r(),n=s,t=pr(e,s),t):(r(),hg);case Vc:r(),n=null;return;default:throw new Error(`unrecognized action ${o}`)}}}function Vu(e){return _y(yn(),t=>Gt(e,t))}function dc(e,t){return _y(dt(t),n=>Gt(e,n))}function Wte(...e){return t=>e.reduceRight(zte,t)}function ft(e,...t){const n=Wte(...t);return(r,o)=>{switch(r){case oi:return pr(e,n(o));case Vc:jy(e);return}}}function OM(e,t){return e===t}function kr(e=OM){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function Gn(e){return t=>n=>{e(n)&&t(n)}}function tn(e){return t=>Lte(t,e)}function Ra(e){return t=>()=>t(e)}function jp(e,t){return n=>r=>n(t=e(t,r))}function ub(e){return t=>n=>{e>0?e--:t(n)}}function Ru(e){let t=null,n;return r=>o=>{t=o,!n&&(n=setTimeout(()=>{n=void 0,r(t)},e))}}function d_(e){let t,n;return r=>o=>{t=o,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function cs(...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);pr(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 f_(...e){return function(t,n){switch(t){case oi:return Bte(...e.map(r=>pr(r,n)));case Vc:return;default:throw new Error(`unrecognized action ${t}`)}}}function It(e,t=OM){return ft(e,kr(t))}function qs(...e){const t=yn(),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);pr(s,u=>{n[i]=u,r=r|l,r===o&&Nn(t,n)})}),function(s,i){switch(s){case oi:return r===o&&i(n),pr(t,i);case Vc:return jy(t);default:throw new Error(`unrecognized action ${s}`)}}}function Ps(e,t=[],{singleton:n}={singleton:!0}){return{id:Vte(),constructor:e,dependencies:t,singleton:n}}const Vte=()=>Symbol();function Ute(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 Gte(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 Kte(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(x,w){x.propsReady&&Nn(x.propsReady,!1);for(const k of r){const _=x[t.required[k]];Nn(_,w[k])}for(const k of o)if(k in w){const _=x[t.optional[k]];Nn(_,w[k])}x.propsReady&&Nn(x.propsReady,!0)}function p(x){return s.reduce((w,k)=>(w[k]=_=>{const j=x[t.methods[k]];Nn(j,_)},w),{})}function h(x){return i.reduce((w,k)=>(w[k]=Hte(x[t.events[k]]),w),{})}return{Component:H.forwardRef((x,w)=>{const{children:k,..._}=x,[j]=H.useState(()=>_y(Ute(e),E=>u(E,_))),[I]=H.useState(l_(h,j));return Pp(()=>{for(const E of i)E in _&&pr(I[E],_[E]);return()=>{Object.values(I).map(jy)}},[_,I,j]),Pp(()=>{u(j,_)}),H.useImperativeHandle(w,c_(p(j))),H.createElement(l.Provider,{value:j},n?H.createElement(n,Gte([...r,...o,...i],_),k):k)}),usePublisher:x=>H.useCallback(MM(Nn,H.useContext(l)[x]),[x]),useEmitterValue:x=>{const k=H.useContext(l)[x],[_,j]=H.useState(l_(mg,k));return Pp(()=>pr(k,I=>{I!==_&&j(c_(I))}),[k,_]),_},useEmitter:(x,w)=>{const _=H.useContext(l)[x];Pp(()=>pr(_,w),[w,_])}}}const qte=typeof document<"u"?H.useLayoutEffect:H.useEffect,Xte=qte;var Py=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(Py||{});const Yte={0:"debug",1:"log",2:"warn",3:"error"},Qte=()=>typeof globalThis>"u"?window:globalThis,DM=Ps(()=>{const e=dt(3);return{log:dt((n,r,o=1)=>{var s;const i=(s=Qte().VIRTUOSO_LOG_LEVEL)!=null?s:mg(e);o>=i&&console[Yte[o]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",n,r)}),logLevel:e}},[],{singleton:!0});function RM(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 gg(e,t=!0){return RM(e,t).callbackRef}function nm(e,t){return Math.round(e.getBoundingClientRect()[t])}function AM(e,t){return Math.abs(e-t)<1.01}function NM(e,t,n,r=hg,o){const s=H.useRef(null),i=H.useRef(null),l=H.useRef(null),u=H.useCallback(m=>{const v=m.target,b=v===window||v===document,y=b?window.pageYOffset||document.documentElement.scrollTop:v.scrollTop,x=b?document.documentElement.scrollHeight:v.scrollHeight,w=b?window.innerHeight:v.offsetHeight,k=()=>{e({scrollTop:Math.max(y,0),scrollHeight:x,viewportHeight:w})};m.suppressFlushSync?k():jD.flushSync(k),i.current!==null&&(y===i.current||y<=0||y===x-w)&&(i.current=null,t(!0),l.current&&(clearTimeout(l.current),l.current=null))},[e,t]);H.useEffect(()=>{const m=o||s.current;return r(o||s.current),u({target:m,suppressFlushSync:!0}),m.addEventListener("scroll",u,{passive:!0}),()=>{r(null),m.removeEventListener("scroll",u)}},[s,u,n,r,o]);function p(m){const v=s.current;if(!v||"offsetHeight"in v&&v.offsetHeight===0)return;const b=m.behavior==="smooth";let y,x,w;v===window?(x=Math.max(nm(document.documentElement,"height"),document.documentElement.scrollHeight),y=window.innerHeight,w=document.documentElement.scrollTop):(x=v.scrollHeight,y=nm(v,"height"),w=v.scrollTop);const k=x-y;if(m.top=Math.ceil(Math.max(Math.min(k,m.top),0)),AM(y,x)||m.top===w){e({scrollTop:w,scrollHeight:x,viewportHeight:y}),b&&t(!0);return}b?(i.current=m.top,l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{l.current=null,i.current=null,t(!0)},1e3)):i.current=null,v.scrollTo(m)}function h(m){s.current.scrollBy(m)}return{scrollerRef:s,scrollByCallback:h,scrollToCallback:p}}const vg=Ps(()=>{const e=yn(),t=yn(),n=dt(0),r=yn(),o=dt(0),s=yn(),i=yn(),l=dt(0),u=dt(0),p=dt(0),h=dt(0),m=yn(),v=yn(),b=dt(!1);return Gt(ft(e,tn(({scrollTop:y})=>y)),t),Gt(ft(e,tn(({scrollHeight:y})=>y)),i),Gt(t,o),{scrollContainerState:e,scrollTop:t,viewportHeight:s,headerHeight:l,fixedHeaderHeight:u,fixedFooterHeight:p,footerHeight:h,scrollHeight:i,smoothScrollTargetReached:r,scrollTo:m,scrollBy:v,statefulScrollTop:o,deviation:n,scrollingInProgress:b}},[],{singleton:!0}),Zte=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function Jte(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!Zte)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const rm="up",Uu="down",ene="none",tne={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},nne=0,TM=Ps(([{scrollContainerState:e,scrollTop:t,viewportHeight:n,headerHeight:r,footerHeight:o,scrollBy:s}])=>{const i=dt(!1),l=dt(!0),u=yn(),p=yn(),h=dt(4),m=dt(nne),v=dc(ft(f_(ft(It(t),ub(1),Ra(!0)),ft(It(t),ub(1),Ra(!1),d_(100))),kr()),!1),b=dc(ft(f_(ft(s,Ra(!0)),ft(s,Ra(!1),d_(200))),kr()),!1);Gt(ft(qs(It(t),It(m)),tn(([_,j])=>_<=j),kr()),l),Gt(ft(l,Ru(50)),p);const y=Vu(ft(qs(e,It(n),It(r),It(o),It(h)),jp((_,[{scrollTop:j,scrollHeight:I},E,M,D,R])=>{const A=j+E-I>-R,O={viewportHeight:E,scrollTop:j,scrollHeight:I};if(A){let K,F;return j>_.state.scrollTop?(K="SCROLLED_DOWN",F=_.state.scrollTop-j):(K="SIZE_DECREASED",F=_.state.scrollTop-j||_.scrollTopDelta),{atBottom:!0,state:O,atBottomBecause:K,scrollTopDelta:F}}let T;return O.scrollHeight>_.state.scrollHeight?T="SIZE_INCREASED":E<_.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}},tne),kr((_,j)=>_&&_.atBottom===j.atBottom))),x=dc(ft(e,jp((_,{scrollTop:j,scrollHeight:I,viewportHeight:E})=>{if(AM(_.scrollHeight,I))return{scrollTop:j,scrollHeight:I,jump:0,changed:!1};{const M=I-(j+E)<1;return _.scrollTop!==j&&M?{scrollHeight:I,scrollTop:j,jump:_.scrollTop-j,changed:!0}:{scrollHeight:I,scrollTop:j,jump:0,changed:!0}}},{scrollHeight:0,jump:0,scrollTop:0,changed:!1}),Gn(_=>_.changed),tn(_=>_.jump)),0);Gt(ft(y,tn(_=>_.atBottom)),i),Gt(ft(i,Ru(50)),u);const w=dt(Uu);Gt(ft(e,tn(({scrollTop:_})=>_),kr(),jp((_,j)=>mg(b)?{direction:_.direction,prevScrollTop:j}:{direction:j<_.prevScrollTop?rm:Uu,prevScrollTop:j},{direction:Uu,prevScrollTop:0}),tn(_=>_.direction)),w),Gt(ft(e,Ru(50),Ra(ene)),w);const k=dt(0);return Gt(ft(v,Gn(_=>!_),Ra(0)),k),Gt(ft(t,Ru(100),cs(v),Gn(([_,j])=>!!j),jp(([_,j],[I])=>[j,I],[0,0]),tn(([_,j])=>j-_)),k),{isScrolling:v,isAtTop:l,isAtBottom:i,atBottomState:y,atTopStateChange:p,atBottomStateChange:u,scrollDirection:w,atBottomThreshold:h,atTopThreshold:m,scrollVelocity:k,lastJumpDueToItemResize:x}},sl(vg)),rne=Ps(([{log:e}])=>{const t=dt(!1),n=Vu(ft(t,Gn(r=>r),kr()));return pr(t,r=>{r&&mg(e)("props updated",{},Py.DEBUG)}),{propsReady:t,didMount:n}},sl(DM),{singleton:!0});function $M(e,t){e==0?t():requestAnimationFrame(()=>$M(e-1,t))}function one(e,t){const n=t-1;return typeof e=="number"?e:e.index==="LAST"?n:e.index}function db(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}function sne(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}const om="top",sm="bottom",p_="none";function h_(e,t,n){return typeof e=="number"?n===rm&&t===om||n===Uu&&t===sm?e:0:n===rm?t===om?e.main:e.reverse:t===sm?e.main:e.reverse}function m_(e,t){return typeof e=="number"?e:e[t]||0}const ane=Ps(([{scrollTop:e,viewportHeight:t,deviation:n,headerHeight:r,fixedHeaderHeight:o}])=>{const s=yn(),i=dt(0),l=dt(0),u=dt(0),p=dc(ft(qs(It(e),It(t),It(r),It(s,db),It(u),It(i),It(o),It(n),It(l)),tn(([h,m,v,[b,y],x,w,k,_,j])=>{const I=h-_,E=w+k,M=Math.max(v-I,0);let D=p_;const R=m_(j,om),A=m_(j,sm);return b-=_,b+=v+k,y+=v+k,y-=_,b>h+E-R&&(D=rm),y<h-M+m+A&&(D=Uu),D!==p_?[Math.max(I-v-h_(x,om,D)-R,0),I-M-k+m+h_(x,sm,D)+A]:null}),Gn(h=>h!=null),kr(db)),[0,0]);return{listBoundary:s,overscan:u,topListHeight:i,increaseViewportBy:l,visibleRange:p}},sl(vg),{singleton:!0}),ine=Ps(([{scrollVelocity:e}])=>{const t=dt(!1),n=yn(),r=dt(!1);return Gt(ft(e,cs(r,t,n),Gn(([o,s])=>!!s),tn(([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}),kr()),t),pr(ft(qs(t,e,n),cs(r)),([[o,s,i],l])=>o&&l&&l.change&&l.change(s,i)),{isSeeking:t,scrollSeekConfiguration:r,scrollVelocity:e,scrollSeekRangeChanged:n}},sl(TM),{singleton:!0});function lne(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}const cne=Ps(([{scrollTo:e,scrollContainerState:t}])=>{const n=yn(),r=yn(),o=yn(),s=dt(!1),i=dt(void 0);return Gt(ft(qs(n,r),tn(([{viewportHeight:l,scrollTop:u,scrollHeight:p},{offsetTop:h}])=>({scrollTop:Math.max(0,u-h),scrollHeight:p,viewportHeight:l}))),t),Gt(ft(e,cs(r),tn(([l,{offsetTop:u}])=>({...l,top:l.top+u}))),o),{useWindowScroll:s,customScrollParent:i,windowScrollContainerState:n,windowViewportRect:r,windowScrollTo:o}},sl(vg)),Lv="-webkit-sticky",g_="sticky",LM=lne(()=>{if(typeof document>"u")return g_;const e=document.createElement("div");return e.style.position=Lv,e.style.position===Lv?Lv:g_});function une(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 h,m;if(t){const v=t.getBoundingClientRect(),b=u.top-v.top;h=v.height-Math.max(0,b),m=b+t.scrollTop}else h=window.innerHeight-Math.max(0,u.top),m=u.top+window.pageYOffset;n.current={offsetTop:m,visibleHeight:h,visibleWidth:p},e(n.current)},[e,t]),{callbackRef:o,ref:s}=RM(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}H.createContext(void 0);const zM=H.createContext(void 0);function dne(e){return e}LM();const fne={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},FM={width:"100%",height:"100%",position:"absolute",top:0};LM();function Oi(e,t){if(typeof e!="string")return{context:t}}function pne({usePublisher:e,useEmitter:t,useEmitterValue:n}){return H.memo(function({style:s,children:i,...l}){const u=e("scrollContainerState"),p=n("ScrollerComponent"),h=e("smoothScrollTargetReached"),m=n("scrollerRef"),v=n("context"),{scrollerRef:b,scrollByCallback:y,scrollToCallback:x}=NM(u,h,p,m);return t("scrollTo",x),t("scrollBy",y),H.createElement(p,{ref:b,style:{...fne,...s},"data-test-id":"virtuoso-scroller","data-virtuoso-scroller":!0,tabIndex:0,...l,...Oi(p,v)},i)})}function hne({usePublisher:e,useEmitter:t,useEmitterValue:n}){return H.memo(function({style:s,children:i,...l}){const u=e("windowScrollContainerState"),p=n("ScrollerComponent"),h=e("smoothScrollTargetReached"),m=n("totalListHeight"),v=n("deviation"),b=n("customScrollParent"),y=n("context"),{scrollerRef:x,scrollByCallback:w,scrollToCallback:k}=NM(u,h,p,hg,b);return Xte(()=>(x.current=b||window,()=>{x.current=null}),[x,b]),t("windowScrollTo",k),t("scrollBy",w),H.createElement(p,{style:{position:"relative",...s,...m!==0?{height:m+v}:{}},"data-virtuoso-scroller":!0,...l,...Oi(p,y)},i)})}const v_={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},mne={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},{round:b_,ceil:x_,floor:am,min:zv,max:Gu}=Math;function gne(e){return{...mne,items:e}}function y_(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 vne(e,t){return e&&e.column===t.column&&e.row===t.row}function Ip(e,t){return e&&e.width===t.width&&e.height===t.height}const bne=Ps(([{overscan:e,visibleRange:t,listBoundary:n},{scrollTop:r,viewportHeight:o,scrollBy:s,scrollTo:i,smoothScrollTargetReached:l,scrollContainerState:u,footerHeight:p,headerHeight:h},m,v,{propsReady:b,didMount:y},{windowViewportRect:x,useWindowScroll:w,customScrollParent:k,windowScrollContainerState:_,windowScrollTo:j},I])=>{const E=dt(0),M=dt(0),D=dt(v_),R=dt({height:0,width:0}),A=dt({height:0,width:0}),O=yn(),T=yn(),K=dt(0),F=dt(null),V=dt({row:0,column:0}),X=yn(),W=yn(),z=dt(!1),Y=dt(0),B=dt(!0),q=dt(!1);pr(ft(y,cs(Y),Gn(([G,te])=>!!te)),()=>{Nn(B,!1),Nn(M,0)}),pr(ft(qs(y,B,A,R,Y,q),Gn(([G,te,ae,oe,,pe])=>G&&!te&&ae.height!==0&&oe.height!==0&&!pe)),([,,,,G])=>{Nn(q,!0),$M(1,()=>{Nn(O,G)}),u_(ft(r),()=>{Nn(n,[0,0]),Nn(B,!0)})}),Gt(ft(W,Gn(G=>G!=null&&G.scrollTop>0),Ra(0)),M),pr(ft(y,cs(W),Gn(([,G])=>G!=null)),([,G])=>{G&&(Nn(R,G.viewport),Nn(A,G==null?void 0:G.item),Nn(V,G.gap),G.scrollTop>0&&(Nn(z,!0),u_(ft(r,ub(1)),te=>{Nn(z,!1)}),Nn(i,{top:G.scrollTop})))}),Gt(ft(R,tn(({height:G})=>G)),o),Gt(ft(qs(It(R,Ip),It(A,Ip),It(V,(G,te)=>G&&G.column===te.column&&G.row===te.row),It(r)),tn(([G,te,ae,oe])=>({viewport:G,item:te,gap:ae,scrollTop:oe}))),X),Gt(ft(qs(It(E),t,It(V,vne),It(A,Ip),It(R,Ip),It(F),It(M),It(z),It(B),It(Y)),Gn(([,,,,,,,G])=>!G),tn(([G,[te,ae],oe,pe,ue,me,Ce,,ge,fe])=>{const{row:De,column:je}=oe,{height:Be,width:rt}=pe,{width:Ue}=ue;if(Ce===0&&(G===0||Ue===0))return v_;if(rt===0){const ot=one(fe,G),lt=ot===0?Math.max(Ce-1,0):ot;return gne(y_(ot,lt,me))}const wt=BM(Ue,rt,je);let Ye,tt;ge?te===0&&ae===0&&Ce>0?(Ye=0,tt=Ce-1):(Ye=wt*am((te+De)/(Be+De)),tt=wt*x_((ae+De)/(Be+De))-1,tt=zv(G-1,Gu(tt,wt-1)),Ye=zv(tt,Gu(0,Ye))):(Ye=0,tt=-1);const be=y_(Ye,tt,me),{top:Re,bottom:st}=C_(ue,oe,pe,be),mt=x_(G/wt),Qe=mt*Be+(mt-1)*De-st;return{items:be,offsetTop:Re,offsetBottom:Qe,top:Re,bottom:st,itemHeight:Be,itemWidth:rt}})),D),Gt(ft(F,Gn(G=>G!==null),tn(G=>G.length)),E),Gt(ft(qs(R,A,D,V),Gn(([G,te,{items:ae}])=>ae.length>0&&te.height!==0&&G.height!==0),tn(([G,te,{items:ae},oe])=>{const{top:pe,bottom:ue}=C_(G,oe,te,ae);return[pe,ue]}),kr(db)),n);const re=dt(!1);Gt(ft(r,cs(re),tn(([G,te])=>te||G!==0)),re);const Q=Vu(ft(It(D),Gn(({items:G})=>G.length>0),cs(E,re),Gn(([{items:G},te,ae])=>ae&&G[G.length-1].index===te-1),tn(([,G])=>G-1),kr())),le=Vu(ft(It(D),Gn(({items:G})=>G.length>0&&G[0].index===0),Ra(0),kr())),se=Vu(ft(It(D),cs(z),Gn(([{items:G},te])=>G.length>0&&!te),tn(([{items:G}])=>({startIndex:G[0].index,endIndex:G[G.length-1].index})),kr(sne),Ru(0)));Gt(se,v.scrollSeekRangeChanged),Gt(ft(O,cs(R,A,E,V),tn(([G,te,ae,oe,pe])=>{const ue=Jte(G),{align:me,behavior:Ce,offset:ge}=ue;let fe=ue.index;fe==="LAST"&&(fe=oe-1),fe=Gu(0,fe,zv(oe-1,fe));let De=fb(te,pe,ae,fe);return me==="end"?De=b_(De-te.height+ae.height):me==="center"&&(De=b_(De-te.height/2+ae.height/2)),ge&&(De+=ge),{top:De,behavior:Ce}})),i);const U=dc(ft(D,tn(G=>G.offsetBottom+G.bottom)),0);return Gt(ft(x,tn(G=>({width:G.visibleWidth,height:G.visibleHeight}))),R),{data:F,totalCount:E,viewportDimensions:R,itemDimensions:A,scrollTop:r,scrollHeight:T,overscan:e,scrollBy:s,scrollTo:i,scrollToIndex:O,smoothScrollTargetReached:l,windowViewportRect:x,windowScrollTo:j,useWindowScroll:w,customScrollParent:k,windowScrollContainerState:_,deviation:K,scrollContainerState:u,footerHeight:p,headerHeight:h,initialItemCount:M,gap:V,restoreStateFrom:W,...v,initialTopMostItemIndex:Y,gridState:D,totalListHeight:U,...m,startReached:le,endReached:Q,rangeChanged:se,stateChanged:X,propsReady:b,stateRestoreInProgress:z,...I}},sl(ane,vg,TM,ine,rne,cne,DM));function C_(e,t,n,r){const{height:o}=n;if(o===void 0||r.length===0)return{top:0,bottom:0};const s=fb(e,t,n,r[0].index),i=fb(e,t,n,r[r.length-1].index)+o;return{top:s,bottom:i}}function fb(e,t,n,r){const o=BM(e.width,n.width,t.column),s=am(r/o),i=s*n.height+Gu(0,s-1)*t.row;return i>0?i+t.row:i}function BM(e,t,n){return Gu(1,am((e+n)/(am(t)+n)))}const xne=Ps(()=>{const e=dt(p=>`Item ${p}`),t=dt({}),n=dt(null),r=dt("virtuoso-grid-item"),o=dt("virtuoso-grid-list"),s=dt(dne),i=dt("div"),l=dt(hg),u=(p,h=null)=>dc(ft(t,tn(m=>m[p]),kr()),h);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")}}),yne=Ps(([e,t])=>({...e,...t}),sl(bne,xne)),Cne=H.memo(function(){const t=dn("gridState"),n=dn("listClassName"),r=dn("itemClassName"),o=dn("itemContent"),s=dn("computeItemKey"),i=dn("isSeeking"),l=Fo("scrollHeight"),u=dn("ItemComponent"),p=dn("ListComponent"),h=dn("ScrollSeekPlaceholder"),m=dn("context"),v=Fo("itemDimensions"),b=Fo("gap"),y=dn("log"),x=dn("stateRestoreInProgress"),w=gg(k=>{const _=k.parentElement.parentElement.scrollHeight;l(_);const j=k.firstChild;if(j){const{width:I,height:E}=j.getBoundingClientRect();v({width:I,height:E})}b({row:w_("row-gap",getComputedStyle(k).rowGap,y),column:w_("column-gap",getComputedStyle(k).columnGap,y)})});return x?null:H.createElement(p,{ref:w,className:n,...Oi(p,m),style:{paddingTop:t.offsetTop,paddingBottom:t.offsetBottom},"data-test-id":"virtuoso-item-list"},t.items.map(k=>{const _=s(k.index,k.data,m);return i?H.createElement(h,{key:_,...Oi(h,m),index:k.index,height:t.itemHeight,width:t.itemWidth}):H.createElement(u,{...Oi(u,m),className:r,"data-index":k.index,key:_},o(k.index,k.data,m))}))}),wne=H.memo(function(){const t=dn("HeaderComponent"),n=Fo("headerHeight"),r=dn("headerFooterTag"),o=gg(i=>n(nm(i,"height"))),s=dn("context");return t?H.createElement(r,{ref:o},H.createElement(t,Oi(t,s))):null}),Sne=H.memo(function(){const t=dn("FooterComponent"),n=Fo("footerHeight"),r=dn("headerFooterTag"),o=gg(i=>n(nm(i,"height"))),s=dn("context");return t?H.createElement(r,{ref:o},H.createElement(t,Oi(t,s))):null}),kne=({children:e})=>{const t=H.useContext(zM),n=Fo("itemDimensions"),r=Fo("viewportDimensions"),o=gg(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:FM,ref:o},e)},_ne=({children:e})=>{const t=H.useContext(zM),n=Fo("windowViewportRect"),r=Fo("itemDimensions"),o=dn("customScrollParent"),s=une(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:FM},e)},jne=H.memo(function({...t}){const n=dn("useWindowScroll"),r=dn("customScrollParent"),o=r||n?Ene:Ine,s=r||n?_ne:kne;return H.createElement(o,{...t},H.createElement(s,null,H.createElement(wne,null),H.createElement(Cne,null),H.createElement(Sne,null)))}),{Component:Pne,usePublisher:Fo,useEmitterValue:dn,useEmitter:HM}=Kte(yne,{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"}},jne),Ine=pne({usePublisher:Fo,useEmitterValue:dn,useEmitter:HM}),Ene=hne({usePublisher:Fo,useEmitterValue:dn,useEmitter:HM});function w_(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,Py.WARN),t==="normal"?0:parseInt(t??"0",10)}const Mne=Pne,One=e=>{const t=L(s=>s.gallery.galleryView),{data:n}=Vj(e),{data:r}=Uj(e),o=d.useMemo(()=>t==="images"?n:r,[t,r,n]);return{totalImages:n,totalAssets:r,currentViewTotal:o}};function bg(e,t={}){let n=d.useCallback(o=>t.keys?GN(e,t.keys,o):e.listen(o),[t.keys,e]),r=e.get.bind(e);return d.useSyncExternalStore(n,r,r)}const Dne=({imageDTO:e})=>a.jsx($,{sx:{pointerEvents:"none",flexDirection:"column",position:"absolute",top:0,insetInlineStart:0,p:2,alignItems:"flex-start",gap:2},children:a.jsxs(da,{variant:"solid",colorScheme:"base",children:[e.width," × ",e.height]})}),Rne=d.memo(Dne),Iy=({postUploadAction:e,isDisabled:t})=>{const n=L(u=>u.gallery.autoAddBoardId),[r]=$j(),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}=Vx({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},onDropAccepted:o,disabled:t,noDrag:!0,multiple:!1});return{getUploadButtonProps:s,getUploadInputProps:i,openUploader:l}},Ane=ie(xe,({generation:e})=>{const{model:t}=e;return{model:t}}),xg=()=>{const e=ee(),t=tl(),{t:n}=Z(),{model:r}=L(Ane),o=d.useCallback(()=>{t({title:n("toast.parameterSet"),status:"info",duration:2500,isClosable:!0})},[n,t]),s=d.useCallback(O=>{t({title:n("toast.parameterNotSet"),description:O,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(O=>{t({title:n("toast.parametersNotSet"),status:"warning",description:O,duration:2500,isClosable:!0})},[n,t]),u=d.useCallback((O,T,K,F)=>{if(Gf(O)||Kf(T)||xu(K)||K0(F)){Gf(O)&&e(Lu(O)),Kf(T)&&e(zu(T)),xu(K)&&e(Fu(K)),xu(F)&&e(Bu(F)),o();return}s()},[e,o,s]),p=d.useCallback(O=>{if(!Gf(O)){s();return}e(Lu(O)),o()},[e,o,s]),h=d.useCallback(O=>{if(!Kf(O)){s();return}e(zu(O)),o()},[e,o,s]),m=d.useCallback(O=>{if(!xu(O)){s();return}e(Fu(O)),o()},[e,o,s]),v=d.useCallback(O=>{if(!K0(O)){s();return}e(Bu(O)),o()},[e,o,s]),b=d.useCallback(O=>{if(!VC(O)){s();return}e(Up(O)),o()},[e,o,s]),y=d.useCallback(O=>{if(!q0(O)){s();return}e(Gp(O)),o()},[e,o,s]),x=d.useCallback(O=>{if(!UC(O)){s();return}e(o1(O)),o()},[e,o,s]),w=d.useCallback(O=>{if(!X0(O)){s();return}e(s1(O)),o()},[e,o,s]),k=d.useCallback(O=>{if(!Y0(O)){s();return}e(Kp(O)),o()},[e,o,s]),_=d.useCallback(O=>{if(!GC(O)){s();return}e(Ti(O)),o()},[e,o,s]),j=d.useCallback(O=>{if(!KC(O)){s();return}e($i(O)),o()},[e,o,s]),I=d.useCallback(O=>{if(!qC(O)){s();return}e(qp(O)),o()},[e,o,s]),{loras:E}=Cd(void 0,{selectFromResult:O=>({loras:O.data?PD.getSelectors().selectAll(O.data):[]})}),M=d.useCallback(O=>{if(!Kj(O.lora))return{lora:null,error:"Invalid LoRA model"};const{base_model:T,model_name:K}=O.lora,F=E.find(X=>X.base_model===T&&X.model_name===K);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"}},[E,r==null?void 0:r.base_model]),D=d.useCallback(O=>{const T=M(O);if(!T.lora){s(T.error);return}e(XC({...T.lora,weight:O.weight})),o()},[M,e,o,s]),R=d.useCallback(O=>{e(gm(O))},[e]),A=d.useCallback(O=>{if(!O){l();return}const{cfg_scale:T,height:K,model:F,positive_prompt:V,negative_prompt:X,scheduler:W,seed:z,steps:Y,width:B,strength:q,positive_style_prompt:re,negative_style_prompt:Q,refiner_model:le,refiner_cfg_scale:se,refiner_steps:U,refiner_scheduler:G,refiner_positive_aesthetic_score:te,refiner_negative_aesthetic_score:ae,refiner_start:oe,loras:pe}=O;q0(T)&&e(Gp(T)),UC(F)&&e(o1(F)),Gf(V)&&e(Lu(V)),Kf(X)&&e(zu(X)),X0(W)&&e(s1(W)),VC(z)&&e(Up(z)),Y0(Y)&&e(Kp(Y)),GC(B)&&e(Ti(B)),KC(K)&&e($i(K)),qC(q)&&e(qp(q)),xu(re)&&e(Fu(re)),K0(Q)&&e(Bu(Q)),ID(le)&&e(qj(le)),Y0(U)&&e(a1(U)),q0(se)&&e(i1(se)),X0(G)&&e(Xj(G)),ED(te)&&e(l1(te)),MD(ae)&&e(c1(ae)),OD(oe)&&e(u1(oe)),pe==null||pe.forEach(ue=>{const me=M(ue);me.lora&&e(XC({...me.lora,weight:ue.weight}))}),i()},[l,i,e,M]);return{recallBothPrompts:u,recallPositivePrompt:p,recallNegativePrompt:h,recallSDXLPositiveStylePrompt:m,recallSDXLNegativeStylePrompt:v,recallSeed:b,recallCfgScale:y,recallModel:x,recallScheduler:w,recallSteps:k,recallWidth:_,recallHeight:j,recallStrength:I,recallLoRA:D,recallAllParameters:A,sendToImageToImage:R}},WM=()=>{const e=tl(),{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{const i=await(await fetch(o)).blob();await navigator.clipboard.write([new ClipboardItem({[i.type]:i})]),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 Nne(e){return Ne({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16.5 9c-.42 0-.83.04-1.24.11L1.01 3 1 10l9 2-9 2 .01 7 8.07-3.46C9.59 21.19 12.71 24 16.5 24c4.14 0 7.5-3.36 7.5-7.5S20.64 9 16.5 9zm0 13c-3.03 0-5.5-2.47-5.5-5.5s2.47-5.5 5.5-5.5 5.5 2.47 5.5 5.5-2.47 5.5-5.5 5.5z"}},{tag:"path",attr:{d:"M18.27 14.03l-1.77 1.76-1.77-1.76-.7.7 1.76 1.77-1.76 1.77.7.7 1.77-1.76 1.77 1.76.7-.7-1.76-1.77 1.76-1.77z"}}]})(e)}function yg(e){return Ne({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 Tne(e){return Ne({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 $ne(e){return Ne({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 Lne(e){return Ne({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}}]})(e)}function Ey(e){return Ne({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 My(e){return Ne({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 VM(e){return Ne({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 Oy=e=>e.config;Lb("gallery/requestedBoardImagesDeletion");const zne=Lb("gallery/sentImageToCanvas"),UM=Lb("gallery/sentImageToImg2Img"),Fne=e=>{const{imageDTO:t}=e,n=ee(),{t:r}=Z(),o=tl(),s=Xt("unifiedCanvas").isFeatureEnabled,{shouldFetchMetadataFromApi:i}=L(Oy),l=bg(zb),{metadata:u,workflow:p,isLoading:h}=Fb({image:t,shouldFetchMetadataFromApi:i},{selectFromResult:F=>{var V,X;return{isLoading:F.isFetching,metadata:(V=F==null?void 0:F.currentData)==null?void 0:V.metadata,workflow:(X=F==null?void 0:F.currentData)==null?void 0:X.workflow}}}),[m]=Bb(),[v]=Hb(),{isClipboardAPIAvailable:b,copyImageToClipboard:y}=WM(),x=d.useCallback(()=>{t&&n(vm([t]))},[n,t]),{recallBothPrompts:w,recallSeed:k,recallAllParameters:_}=xg(),j=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]),I=d.useCallback(()=>{k(u==null?void 0:u.seed)},[u==null?void 0:u.seed,k]),E=d.useCallback(()=>{p&&n(Wb(p))},[n,p]),M=d.useCallback(()=>{n(UM()),n(gm(t))},[n,t]),D=d.useCallback(()=>{n(zne()),Fr.flushSync(()=>{n(Aa("unifiedCanvas"))}),n(Yj(t)),o({title:r("toast.sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0})},[n,t,r,o]),R=d.useCallback(()=>{_(u)},[u,_]),A=d.useCallback(()=>{n(Qj([t])),n($b(!0))},[n,t]),O=d.useCallback(()=>{y(t.image_url)},[y,t.image_url]),T=d.useCallback(()=>{t&&m({imageDTOs:[t]})},[m,t]),K=d.useCallback(()=>{t&&v({imageDTOs:[t]})},[v,t]);return a.jsxs(a.Fragment,{children:[a.jsx(Wt,{as:"a",href:t.image_url,target:"_blank",icon:a.jsx(AE,{}),children:r("common.openInNewTab")}),b&&a.jsx(Wt,{icon:a.jsx(Wc,{}),onClickCapture:O,children:r("parameters.copyImage")}),a.jsx(Wt,{as:"a",download:!0,href:t.image_url,target:"_blank",icon:a.jsx(ng,{}),w:"100%",children:r("parameters.downloadImage")}),a.jsx(Wt,{icon:h?a.jsx(Ep,{}):a.jsx(yg,{}),onClickCapture:E,isDisabled:h||!p,children:r("nodes.loadWorkflow")}),a.jsx(Wt,{icon:h?a.jsx(Ep,{}):a.jsx(FE,{}),onClickCapture:j,isDisabled:h||(u==null?void 0:u.positive_prompt)===void 0&&(u==null?void 0:u.negative_prompt)===void 0,children:r("parameters.usePrompt")}),a.jsx(Wt,{icon:h?a.jsx(Ep,{}):a.jsx(BE,{}),onClickCapture:I,isDisabled:h||(u==null?void 0:u.seed)===void 0,children:r("parameters.useSeed")}),a.jsx(Wt,{icon:h?a.jsx(Ep,{}):a.jsx(ME,{}),onClickCapture:R,isDisabled:h||!u,children:r("parameters.useAll")}),a.jsx(Wt,{icon:a.jsx(Ok,{}),onClickCapture:M,id:"send-to-img2img",children:r("parameters.sendToImg2Img")}),s&&a.jsx(Wt,{icon:a.jsx(Ok,{}),onClickCapture:D,id:"send-to-canvas",children:r("parameters.sendToUnifiedCanvas")}),a.jsx(Wt,{icon:a.jsx(NE,{}),onClickCapture:A,children:"Change Board"}),t.starred?a.jsx(Wt,{icon:l?l.off.icon:a.jsx(My,{}),onClickCapture:K,children:l?l.off.text:"Unstar Image"}):a.jsx(Wt,{icon:l?l.on.icon:a.jsx(Ey,{}),onClickCapture:T,children:l?l.on.text:"Star Image"}),a.jsx(Wt,{sx:{color:"error.600",_dark:{color:"error.300"}},icon:a.jsx(Kr,{}),onClickCapture:x,children:r("gallery.deleteImage")})]})},GM=d.memo(Fne),Ep=()=>a.jsx($,{w:"14px",alignItems:"center",justifyContent:"center",children:a.jsx(Xi,{size:"xs"})}),Bne=()=>{const e=ee(),t=L(m=>m.gallery.selection),n=bg(zb),[r]=Bb(),[o]=Hb(),s=d.useCallback(()=>{e(Qj(t)),e($b(!0))},[e,t]),i=d.useCallback(()=>{e(vm(t))},[e,t]),l=d.useCallback(()=>{r({imageDTOs:t})},[r,t]),u=d.useCallback(()=>{o({imageDTOs:t})},[o,t]),p=d.useMemo(()=>t.every(m=>m.starred),[t]),h=d.useMemo(()=>t.every(m=>!m.starred),[t]);return a.jsxs(a.Fragment,{children:[p&&a.jsx(Wt,{icon:n?n.on.icon:a.jsx(Ey,{}),onClickCapture:u,children:n?n.off.text:"Unstar All"}),(h||!p&&!h)&&a.jsx(Wt,{icon:n?n.on.icon:a.jsx(My,{}),onClickCapture:l,children:n?n.on.text:"Star All"}),a.jsx(Wt,{icon:a.jsx(NE,{}),onClickCapture:s,children:"Change Board"}),a.jsx(Wt,{sx:{color:"error.600",_dark:{color:"error.300"}},icon:a.jsx(Kr,{}),onClickCapture:i,children:"Delete Selection"})]})},Hne=d.memo(Bne),Wne=ie([xe],({gallery:e})=>({selectionCount:e.selection.length}),we),Vne=({imageDTO:e,children:t})=>{const{selectionCount:n}=L(Wne),r=d.useCallback(o=>{o.preventDefault()},[]);return a.jsx(ky,{menuProps:{size:"sm",isLazy:!0},menuButtonProps:{bg:"transparent",_hover:{bg:"transparent"}},renderMenu:()=>e?n>1?a.jsx(Ka,{sx:{visibility:"visible !important"},motionProps:vc,onContextMenu:r,children:a.jsx(Hne,{})}):a.jsx(Ka,{sx:{visibility:"visible !important"},motionProps:vc,onContextMenu:r,children:a.jsx(GM,{imageDTO:e})}):null,children:t})},Une=d.memo(Vne),Gne=e=>{const{data:t,disabled:n,...r}=e,o=d.useRef(Ba()),{attributes:s,listeners:i,setNodeRef:l}=ite({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})},Kne=d.memo(Gne),qne=a.jsx(Tn,{as:og,sx:{boxSize:16}}),Xne=a.jsx(Kn,{icon:Ui}),Yne=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:h,fitContainer:m=!1,droppableData:v,draggableData:b,dropLabel:y,isSelected:x=!1,thumbnail:w=!1,noContentFallback:k=Xne,uploadElement:_=qne,useThumbailFallback:j,withHoverOverlay:I=!1,children:E,onMouseOver:M,onMouseOut:D}=e,{colorMode:R}=la(),[A,O]=d.useState(!1),T=d.useCallback(W=>{M&&M(W),O(!0)},[M]),K=d.useCallback(W=>{D&&D(W),O(!1)},[D]),{getUploadButtonProps:F,getUploadInputProps:V}=Iy({postUploadAction:p,isDisabled:l}),X=l?{}:{cursor:"pointer",bg:Ae("base.200","base.700")(R),_hover:{bg:Ae("base.300","base.650")(R),color:Ae("base.500","base.300")(R)}};return a.jsx(Une,{imageDTO:t,children:W=>a.jsxs($,{ref:W,onMouseOver:T,onMouseOut:K,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($,{sx:{w:"full",h:"full",position:m?"absolute":"relative",alignItems:"center",justifyContent:"center"},children:[a.jsx(Qi,{src:w?t.thumbnail_url:t.image_url,fallbackStrategy:"beforeLoadOrError",fallbackSrc:j?t.thumbnail_url:void 0,fallback:j?void 0:a.jsx($te,{image:t}),onError:n,draggable:!1,sx:{w:t.width,objectFit:"contain",maxW:"full",maxH:"full",borderRadius:"base",...h}}),o&&a.jsx(Rne,{imageDTO:t}),a.jsx(Sy,{isSelected:x,isHovered:I?A:!1})]}),!t&&!l&&a.jsx(a.Fragment,{children:a.jsxs($,{sx:{minH:u,w:"full",h:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",transitionProperty:"common",transitionDuration:"0.1s",color:Ae("base.500","base.500")(R),...X},...F(),children:[a.jsx("input",{...V()}),_]})}),!t&&l&&k,t&&!i&&a.jsx(Kne,{data:b,disabled:i||!t,onClick:r}),E,!s&&a.jsx(wy,{data:v,disabled:s,dropLabel:y})]})})},oa=d.memo(Yne),Qne=()=>a.jsx(Hm,{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"}})}),Zne=d.memo(Qne),Jne=ie([xe,Vb],({gallery:e},t)=>{const n=e.selection;return{queryArgs:t,selection:n}},we),ere=e=>{const t=ee(),{queryArgs:n,selection:r}=L(Jne),{imageDTOs:o}=Zj(n,{selectFromResult:p=>({imageDTOs:p.data?DD.selectAll(p.data):[]})}),s=Xt("multiselect").isFeatureEnabled,i=d.useCallback(p=>{var h;if(e){if(!s){t(yu([e]));return}if(p.shiftKey){const m=e.image_name,v=(h=r[r.length-1])==null?void 0:h.image_name,b=o.findIndex(x=>x.image_name===v),y=o.findIndex(x=>x.image_name===m);if(b>-1&&y>-1){const x=Math.min(b,y),w=Math.max(b,y),k=o.slice(x,w+1);t(yu(Ew(r.concat(k))))}}else p.ctrlKey||p.metaKey?r.some(m=>m.image_name===e.image_name)&&r.length>1?t(yu(r.filter(m=>m.image_name!==e.image_name))):t(yu(Ew(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}},tre=e=>{const{onClick:t,tooltip:n,icon:r,styleOverrides:o}=e,s=Li("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(Te,{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}})},Di=d.memo(tre),nre=e=>{const t=ee(),{imageName:n}=e,{currentData:r}=Wr(n),o=L(M=>M.hotkeys.shift),{t:s}=Z(),{handleClick:i,isSelected:l,selection:u,selectionCount:p}=ere(r),h=bg(zb),m=d.useCallback(M=>{M.stopPropagation(),r&&t(vm([r]))},[t,r]),v=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]),[b]=Bb(),[y]=Hb(),x=d.useCallback(()=>{r&&(r.starred&&y({imageDTOs:[r]}),r.starred||b({imageDTOs:[r]}))},[b,y,r]),[w,k]=d.useState(!1),_=d.useCallback(()=>{k(!0)},[]),j=d.useCallback(()=>{k(!1)},[]),I=d.useMemo(()=>{if(r!=null&&r.starred)return h?h.on.icon:a.jsx(My,{size:"20"});if(!(r!=null&&r.starred)&&w)return h?h.off.icon:a.jsx(Ey,{size:"20"})},[r==null?void 0:r.starred,w,h]),E=d.useMemo(()=>r!=null&&r.starred?h?h.off.text:"Unstar":r!=null&&r.starred?"":h?h.on.text:"Star",[r==null?void 0:r.starred,h]);return r?a.jsx(Ie,{sx:{w:"full",h:"full",touchAction:"none"},children:a.jsx($,{userSelect:"none",sx:{position:"relative",justifyContent:"center",alignItems:"center",aspectRatio:"1/1"},children:a.jsx(oa,{onClick:i,imageDTO:r,draggableData:v,isSelected:l,minSize:0,imageSx:{w:"full",h:"full"},isDropDisabled:!0,isUploadDisabled:!0,thumbnail:!0,withHoverOverlay:!0,onMouseOver:_,onMouseOut:j,children:a.jsxs(a.Fragment,{children:[a.jsx(Di,{onClick:x,icon:I,tooltip:E}),w&&o&&a.jsx(Di,{onClick:m,icon:a.jsx(Kr,{}),tooltip:s("gallery.deleteImage"),styleOverrides:{bottom:2,top:"auto"}})]})})})}):a.jsx(Zne,{})},rre=d.memo(nre),ore=Pe((e,t)=>a.jsx(Ie,{className:"item-container",ref:t,p:1.5,children:e.children})),sre=d.memo(ore),are=Pe((e,t)=>{const n=L(r=>r.gallery.galleryImageMinimumWidth);return a.jsx(Ga,{...e,className:"list-container",ref:t,sx:{gridTemplateColumns:`repeat(auto-fill, minmax(${n}px, 1fr));`},children:e.children})}),ire=d.memo(are),lre={defer:!0,options:{scrollbars:{visibility:"auto",autoHide:"scroll",autoHideDelay:1300,theme:"os-theme-dark"},overflow:{x:"hidden"}}},cre=()=>{const{t:e}=Z(),t=d.useRef(null),[n,r]=d.useState(null),[o,s]=yM(lre),i=L(w=>w.gallery.selectedBoardId),{currentViewTotal:l}=One(i),u=L(Vb),{currentData:p,isFetching:h,isSuccess:m,isError:v}=Zj(u),[b]=Jj(),y=d.useMemo(()=>!p||!l?!1:p.ids.length<l,[p,l]),x=d.useCallback(()=>{y&&b({...u,offset:(p==null?void 0:p.ids.length)??0,limit:e5})},[y,b,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 k;return(k=s())==null?void 0:k.destroy()}},[n,o,s]),p?m&&(p==null?void 0:p.ids.length)===0?a.jsx($,{sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center"},children:a.jsx(Kn,{label:e("gallery.noImagesInGallery"),icon:Ui})}):m&&p?a.jsxs(a.Fragment,{children:[a.jsx(Ie,{ref:t,"data-overlayscrollbars":"",h:"100%",children:a.jsx(Mne,{style:{height:"100%"},data:p.ids,endReached:x,components:{Item:sre,List:ire},scrollerRef:r,itemContent:(w,k)=>a.jsx(rre,{imageName:k},k)})}),a.jsx(it,{onClick:x,isDisabled:!y,isLoading:h,loadingText:e("gallery.loading"),flexShrink:0,children:`Load More (${p.ids.length} of ${l})`})]}):v?a.jsx(Ie,{sx:{w:"full",h:"full"},children:a.jsx(Kn,{label:e("gallery.unableToLoad"),icon:MZ})}):null:a.jsx($,{sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center"},children:a.jsx(Kn,{label:e("gallery.loading"),icon:Ui})})},ure=d.memo(cre),dre=ie([xe],e=>{const{galleryView:t}=e.gallery;return{galleryView:t}},we),fre=()=>{const e=d.useRef(null),t=d.useRef(null),{galleryView:n}=L(dre),r=ee(),{isOpen:o,onToggle:s}=Mr({defaultIsOpen:!0}),i=d.useCallback(()=>{r(YC("images"))},[r]),l=d.useCallback(()=>{r(YC("assets"))},[r]);return a.jsxs(W3,{layerStyle:"first",sx:{flexDirection:"column",h:"full",w:"full",borderRadius:"base",p:2},children:[a.jsxs(Ie,{sx:{w:"full"},children:[a.jsxs($,{ref:e,sx:{alignItems:"center",justifyContent:"space-between",gap:2},children:[a.jsx(jte,{isOpen:o,onToggle:s}),a.jsx(Tte,{})]}),a.jsx(Ie,{children:a.jsx(Ste,{isOpen:o})})]}),a.jsxs($,{ref:t,direction:"column",gap:2,h:"full",w:"full",children:[a.jsx($,{sx:{alignItems:"center",justifyContent:"space-between",gap:2},children:a.jsx(Ji,{index:n==="images"?0:1,variant:"unstyled",size:"sm",sx:{w:"full"},children:a.jsx(el,{children:a.jsxs(mn,{isAttached:!0,sx:{w:"full"},children:[a.jsx(Pr,{as:it,size:"sm",isChecked:n==="images",onClick:i,sx:{w:"full"},leftIcon:a.jsx(FZ,{}),children:"Images"}),a.jsx(Pr,{as:it,size:"sm",isChecked:n==="assets",onClick:l,sx:{w:"full"},leftIcon:a.jsx(YZ,{}),children:"Assets"})]})})})}),a.jsx(ure,{})]})]})},pre=d.memo(fre),hre=ie(xo,e=>({isProcessing:e.isProcessing,isConnected:e.isConnected,isCancelable:e.isCancelable,currentIteration:e.currentIteration,totalIterations:e.totalIterations,sessionId:e.sessionId,cancelType:e.cancelType,isCancelScheduled:e.isCancelScheduled}),{memoizeOptions:{resultEqualityCheck:_t}}),mre=e=>{const t=ee(),{btnGroupWidth:n="auto",asIconButton:r=!1,...o}=e,{isProcessing:s,isConnected:i,isCancelable:l,cancelType:u,isCancelScheduled:p,sessionId:h}=L(hre),m=d.useCallback(()=>{if(h){if(u==="scheduled"){t(RD());return}t(AD({session_id:h}))}},[t,h,u]),{t:v}=Z(),b=d.useCallback(w=>{const k=Array.isArray(w)?w[0]:w;t(ND(k))},[t]);Ze("shift+x",()=>{(i||s)&&l&&m()},[i,s,l]);const y=d.useMemo(()=>v(p?"parameters.cancel.isScheduled":u==="immediate"?"parameters.cancel.immediate":"parameters.cancel.schedule"),[v,u,p]),x=d.useMemo(()=>p?a.jsx(eh,{}):u==="immediate"?a.jsx(Lne,{}):a.jsx(Nne,{}),[u,p]);return a.jsxs(mn,{isAttached:!0,width:n,children:[r?a.jsx(Te,{icon:x,tooltip:y,"aria-label":y,isDisabled:!i||!s||!l,onClick:m,colorScheme:"error",id:"cancel-button",...o}):a.jsx(it,{leftIcon:x,tooltip:y,"aria-label":y,isDisabled:!i||!s||!l,onClick:m,colorScheme:"error",id:"cancel-button",...o,children:v("parameters.cancel.cancel")}),a.jsxs(Nd,{closeOnSelect:!1,children:[a.jsx(Td,{as:Te,tooltip:v("parameters.cancel.setType"),"aria-label":v("parameters.cancel.setType"),icon:a.jsx(rte,{w:"1em",h:"1em"}),paddingX:0,paddingY:0,colorScheme:"error",minWidth:5,...o}),a.jsx(Ka,{minWidth:"240px",children:a.jsxs(iP,{value:u,title:"Cancel Type",type:"radio",onChange:b,children:[a.jsx(ah,{value:"immediate",children:v("parameters.cancel.immediate")}),a.jsx(ah,{value:"scheduled",children:v("parameters.cancel.schedule")})]})})]})]})},KM=d.memo(mre),gre=ie([xe,wn],(e,t)=>{const{generation:n,system:r,nodes:o}=e,{initialImage:s,model:i}=n,{isProcessing:l,isConnected:u}=r,p=[];return l&&p.push(vt.t("parameters.invoke.systemBusy")),u||p.push(vt.t("parameters.invoke.systemDisconnected")),t==="img2img"&&!s&&p.push(vt.t("parameters.invoke.noInitialImageSelected")),t==="nodes"?o.shouldValidateGraph&&(o.nodes.length||p.push(vt.t("parameters.invoke.noNodesInGraph")),o.nodes.forEach(h=>{if(!Cn(h))return;const m=o.nodeTemplates[h.data.type];if(!m){p.push(vt.t("parameters.invoke.missingNodeTemplate"));return}const v=TD([h],o.edges);Pn(h.data.inputs,b=>{const y=m.inputs[b.name],x=v.some(w=>w.target===h.id&&w.targetHandle===b.name);if(!y){p.push(vt.t("parameters.invoke.missingFieldTemplate"));return}if(y.required&&b.value===void 0&&!x){p.push(vt.t("parameters.invoke.missingInputForField",{nodeLabel:h.data.label||m.title,fieldLabel:b.label||y.title}));return}})})):(i||p.push(vt.t("parameters.invoke.noModelSelected")),e.controlNet.isEnabled&&rr(e.controlNet.controlNets).forEach((h,m)=>{h.isEnabled&&(h.model||p.push(vt.t("parameters.invoke.noModelForControlNet",{index:m+1})),(!h.controlImage||!h.processedControlImage&&h.processorType!=="none")&&p.push(vt.t("parameters.invoke.noControlImageForControlNet",{index:m+1})))})),{isReady:!p.length,isProcessing:l,reasons:p}},we),Xd=()=>{const{isReady:e,isProcessing:t,reasons:n}=L(gre);return{isReady:e,isProcessing:t,reasons:n}},vre=ie(xo,e=>({isProcessing:e.isProcessing,currentStep:e.currentStep,totalSteps:e.totalSteps,currentStatusHasSteps:e.currentStatusHasSteps}),{memoizeOptions:{resultEqualityCheck:_t}}),bre=()=>{const{t:e}=Z(),{isProcessing:t,currentStep:n,totalSteps:r,currentStatusHasSteps:o}=L(vre),s=n?Math.round(n*100/r):0;return a.jsx(SP,{value:s,"aria-label":e("accessibility.invokeProgressBar"),isIndeterminate:t&&!o,height:"full",colorScheme:"accent"})},xre=d.memo(bre);function qM(e){const{asIconButton:t=!1,sx:n,...r}=e,o=ee(),{isReady:s,isProcessing:i}=Xd(),l=L(wn),u=d.useCallback(()=>{o(wd()),o(bm(l))},[o,l]),{t:p}=Z();return Ze(["ctrl+enter","meta+enter"],u,{enabled:()=>s,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[s,l]),a.jsx(Ie,{style:{flexGrow:4},position:"relative",children:a.jsxs(Ie,{style:{position:"relative"},children:[!s&&a.jsx(Ie,{sx:{position:"absolute",bottom:"0",left:"0",right:"0",height:"100%",overflow:"clip",borderRadius:"base",...n},...r,children:a.jsx(xre,{})}),t?a.jsx(Te,{"aria-label":p("parameters.invoke.invoke"),type:"submit",icon:a.jsx(Mk,{}),isDisabled:!s,onClick:u,tooltip:a.jsx(pb,{}),colorScheme:"accent",isLoading:i,id:"invoke-button","data-progress":i,sx:{w:"full",flexGrow:1,...n},...r}):a.jsx(it,{tooltip:a.jsx(pb,{}),"aria-label":p("parameters.invoke.invoke"),type:"submit","data-progress":i,isDisabled:!s,onClick:u,colorScheme:"accent",id:"invoke-button",leftIcon:i?void 0:a.jsx(Mk,{}),isLoading:i,loadingText:p("parameters.invoke.invoke"),sx:{w:"full",flexGrow:1,fontWeight:700,...n},...r,children:"Invoke"})]})})}const yre=ie([xe],({gallery:e})=>{const{autoAddBoardId:t}=e;return{autoAddBoardId:t}},we),pb=d.memo(()=>{const{isReady:e,reasons:t}=Xd(),{autoAddBoardId:n}=L(yre),r=fg(n),{t:o}=Z();return a.jsxs($,{flexDir:"column",gap:1,children:[a.jsx(ye,{fontWeight:600,children:o(e?"parameters.invoke.readyToInvoke":"parameters.invoke.unableToInvoke")}),t.length>0&&a.jsx(Od,{children:t.map((s,i)=>a.jsx(lo,{children:a.jsx(ye,{fontWeight:400,children:s})},`${s}.${i}`))}),a.jsx(Vr,{opacity:.2,borderColor:"base.50",_dark:{borderColor:"base.900"}}),a.jsxs(ye,{fontWeight:400,fontStyle:"oblique 10deg",children:[o("parameters.invoke.addingImagesTo")," ",a.jsx(ye,{as:"span",fontWeight:600,children:r||"Uncategorized"})]})]})});pb.displayName="InvokeButtonTooltipContent";const Cre=()=>a.jsxs($,{layerStyle:"first",sx:{gap:2,borderRadius:"base",p:2},children:[a.jsx(qM,{}),a.jsx(KM,{})]}),XM=d.memo(Cre),{createElement:Ec,createContext:wre,forwardRef:YM,useCallback:Ls,useContext:QM,useEffect:ea,useImperativeHandle:ZM,useLayoutEffect:Sre,useMemo:kre,useRef:zr,useState:Ku}=Tb,S_=Tb["useId".toString()],qu=Sre,_re=typeof S_=="function"?S_:()=>null;let jre=0;function Dy(e=null){const t=_re(),n=zr(e||t||null);return n.current===null&&(n.current=""+jre++),n.current}const Cg=wre(null);Cg.displayName="PanelGroupContext";function JM({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:h=null,order:m=null,style:v={},tagName:b="div"}){const y=QM(Cg);if(y===null)throw Error("Panel components must be rendered within a PanelGroup container");const x=Dy(i),{collapsePanel:w,expandPanel:k,getPanelSize:_,getPanelStyle:j,registerPanel:I,resizePanel:E,units:M,unregisterPanel:D}=y;u==null&&(M==="percentages"?u=10:u=0);const R=zr({onCollapse:p,onResize:h});ea(()=>{R.current.onCollapse=p,R.current.onResize=h});const A=j(x,o),O=zr({size:k_(A)}),T=zr({callbacksRef:R,collapsedSize:n,collapsible:r,defaultSize:o,id:x,idWasAutoGenerated:i==null,maxSize:l,minSize:u,order:m});return qu(()=>{O.current.size=k_(A),T.current.callbacksRef=R,T.current.collapsedSize=n,T.current.collapsible=r,T.current.defaultSize=o,T.current.id=x,T.current.idWasAutoGenerated=i==null,T.current.maxSize=l,T.current.minSize=u,T.current.order=m}),qu(()=>(I(x,T),()=>{D(x)}),[m,x,I,D]),ZM(s,()=>({collapse:()=>w(x),expand:()=>k(x),getCollapsed(){return O.current.size===0},getId(){return x},getSize(K){return _(x,K)},resize:(K,F)=>E(x,K,F)}),[w,k,_,x,E]),Ec(b,{children:e,className:t,"data-panel":"","data-panel-collapsible":r||void 0,"data-panel-id":x,"data-panel-size":parseFloat(""+A.flexGrow).toFixed(1),id:`data-panel-id-${x}`,style:{...A,...v}})}const Ua=YM((e,t)=>Ec(JM,{...e,forwardedRef:t}));JM.displayName="Panel";Ua.displayName="forwardRef(Panel)";function k_(e){const{flexGrow:t}=e;return typeof t=="string"?parseFloat(t):t}const qi=10;function Au(e,t,n,r,o,s,i,l){const{id:u,panels:p,units:h}=t,m=h==="pixels"?Na(u):NaN,{sizes:v}=l||{},b=v||s,y=Sr(p),x=b.concat();let w=0;{const j=o<0?r:n,I=y.findIndex(R=>R.current.id===j),E=y[I],M=b[I],D=hb(h,m,E,M,M+Math.abs(o),e);if(M===D)return b;D===0&&M>0&&i.set(j,M),o=o<0?M-D:D-M}let k=o<0?n:r,_=y.findIndex(j=>j.current.id===k);for(;;){const j=y[_],I=b[_],E=Math.abs(o)-Math.abs(w),M=hb(h,m,j,I,I-E,e);if(I!==M&&(M===0&&I>0&&i.set(j.current.id,I),w+=I-M,x[_]=M,w.toPrecision(qi).localeCompare(Math.abs(o).toPrecision(qi),void 0,{numeric:!0})>=0))break;if(o<0){if(--_<0)break}else if(++_>=y.length)break}return w===0?b:(k=o<0?r:n,_=y.findIndex(j=>j.current.id===k),x[_]=b[_]+w,x)}function Nl(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,h=n[p];if(h!==r){n[p]=r;const{onCollapse:m,onResize:v}=i.current;v&&v(r,h),u&&m&&((h==null||h===l)&&r!==l?m(!1):h!==l&&r===l&&m(!0))}})}function Pre({groupId:e,panels:t,units:n}){const r=n==="pixels"?Na(e):NaN,o=Sr(t),s=Array(o.length);let i=0,l=100;for(let u=0;u<o.length;u++){const p=o[u],{defaultSize:h}=p.current;h!=null&&(i++,s[u]=n==="pixels"?h/r*100:h,l-=s[u])}for(let u=0;u<o.length;u++){const p=o[u];let{defaultSize:h,id:m,maxSize:v,minSize:b}=p.current;if(h!=null)continue;n==="pixels"&&(b=b/r*100,v!=null&&(v=v/r*100));const y=o.length-i,x=Math.min(v??100,Math.max(b,l/y));s[u]=x,i++,l-=x}if(l!==0)for(let u=0;u<o.length;u++){const p=o[u];let{maxSize:h,minSize:m}=p.current;n==="pixels"&&(m=m/r*100,h!=null&&(h=h/r*100));const v=Math.min(h??100,Math.max(m,s[u]+l));if(v!==s[u]&&(l-=v-s[u],s[u]=v,Math.abs(l).toFixed(3)==="0.000"))break}return Math.abs(l).toFixed(3),s}function Fv(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 Na(e){const t=dd(e);if(t==null)return NaN;const n=t.getAttribute("data-panel-group-direction"),r=Ry(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 eO(e,t,n){if(e.size===1)return"100";const o=Sr(e).findIndex(i=>i.current.id===t),s=n[o];return s==null?"0":s.toPrecision(qi)}function Ire(e){const t=document.querySelector(`[data-panel-id="${e}"]`);return t||null}function dd(e){const t=document.querySelector(`[data-panel-group-id="${e}"]`);return t||null}function wg(e){const t=document.querySelector(`[data-panel-resize-handle-id="${e}"]`);return t||null}function Ere(e){return tO().findIndex(r=>r.getAttribute("data-panel-resize-handle-id")===e)??null}function tO(){return Array.from(document.querySelectorAll("[data-panel-resize-handle-id]"))}function Ry(e){return Array.from(document.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function Ay(e,t,n){var u,p,h,m;const r=wg(t),o=Ry(e),s=r?o.indexOf(r):-1,i=((p=(u=n[s])==null?void 0:u.current)==null?void 0:p.id)??null,l=((m=(h=n[s+1])==null?void 0:h.current)==null?void 0:m.id)??null;return[i,l]}function Sr(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 hb(e,t,n,r,o,s=null){var h;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(!((h=s==null?void 0:s.type)==null?void 0:h.startsWith("key"))&&o<p)return i}return Math.min(u??100,Math.max(p,o))}function Mre(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 Bv({groupId:e,panels:t,nextSizes:n,prevSizes:r,units:o}){n=[...n];const s=Sr(t),i=o==="pixels"?Na(e):NaN;let l=0;for(let u=0;u<s.length;u++){const p=s[u],h=r[u],m=n[u],v=hb(o,i,p,h,m);m!=v&&(l+=m-v,n[u]=v)}if(l.toFixed(3)!=="0.000")for(let u=0;u<s.length;u++){const p=s[u];let{maxSize:h,minSize:m}=p.current;o==="pixels"&&(m=m/i*100,h!=null&&(h=h/i*100));const v=Math.min(h??100,Math.max(m,n[u]+l));if(v!==n[u]&&(l-=v-n[u],n[u]=v,Math.abs(l).toFixed(3)==="0.000"))break}return l.toFixed(3),n}function nO(e,t="Assertion failed!"){if(!e)throw console.error(t),Error(t)}function Ore({committedValuesRef:e,groupId:t,panels:n,setSizes:r,sizes:o,panelSizeBeforeCollapse:s}){ea(()=>{const{direction:i,panels:l}=e.current,u=dd(t);nO(u!=null,`No group found for id "${t}"`);const{height:p,width:h}=u.getBoundingClientRect(),v=Ry(t).map(b=>{const y=b.getAttribute("data-panel-resize-handle-id"),x=Sr(l),[w,k]=Ay(t,y,x);if(w==null||k==null)return()=>{};let _=0,j=100,I=0,E=0;x.forEach(T=>{const{id:K,maxSize:F,minSize:V}=T.current;K===w?(_=V,j=F??100):(I+=V,E+=F??100)});const M=Math.min(j,100-I),D=Math.max(_,(x.length-1)*100-E),R=eO(l,w,o);b.setAttribute("aria-valuemax",""+Math.round(M)),b.setAttribute("aria-valuemin",""+Math.round(D)),b.setAttribute("aria-valuenow",""+Math.round(parseInt(R)));const A=T=>{if(!T.defaultPrevented)switch(T.key){case"Enter":{T.preventDefault();const K=x.findIndex(F=>F.current.id===w);if(K>=0){const F=x[K],V=o[K];if(V!=null){let X=0;V.toPrecision(qi)<=F.current.minSize.toPrecision(qi)?X=i==="horizontal"?h:p:X=-(i==="horizontal"?h:p);const W=Au(T,e.current,w,k,X,o,s.current,null);o!==W&&r(W)}}break}}};b.addEventListener("keydown",A);const O=Ire(w);return O!=null&&b.setAttribute("aria-controls",O.id),()=>{b.removeAttribute("aria-valuemax"),b.removeAttribute("aria-valuemin"),b.removeAttribute("aria-valuenow"),b.removeEventListener("keydown",A),O!=null&&b.removeAttribute("aria-controls")}});return()=>{v.forEach(b=>b())}},[e,t,n,s,r,o])}function Dre({disabled:e,handleId:t,resizeHandler:n}){ea(()=>{if(e||n==null)return;const r=wg(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=tO(),l=Ere(t);nO(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 Hv(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 rO(e,t,n,r=0,o=null){const s=n==="horizontal";let i=0;if(mb(e))i=s?e.clientX:e.clientY;else if(gb(e)){const h=e.touches[0];i=s?h.screenX:h.screenY}else return 0;const l=wg(t),u=o||l.getBoundingClientRect(),p=s?u.left:u.top;return i-p-r}function Rre(e,t,n,r,o,s,i){const{dragOffset:l=0,dragHandleRect:u,sizes:p}=i||{},h=p||s;if(Are(e)){const m=o==="horizontal",b=dd(t).getBoundingClientRect(),y=m?b.width:b.height,x=e.shiftKey?10:100,w=y/x;let k=0;switch(e.key){case"ArrowDown":k=m?0:w;break;case"ArrowLeft":k=m?-w:0;break;case"ArrowRight":k=m?w:0;break;case"ArrowUp":k=m?0:-w;break;case"End":k=y;break;case"Home":k=-y;break}const[_,j]=Ay(t,n,r),I=k<0?_:j,E=r.findIndex(D=>D.current.id===I),M=r[E];if(M.current.collapsible){const D=h[E];(D===0||D.toPrecision(qi)===M.current.minSize.toPrecision(qi))&&(k=k<0?-M.current.minSize*y:M.current.minSize*y)}return k}else return rO(e,n,o,l,u)}function Are(e){return e.type==="keydown"}function mb(e){return e.type.startsWith("mouse")}function gb(e){return e.type.startsWith("touch")}let vb=null,wi=null;function oO(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 Nre(){wi!==null&&(document.head.removeChild(wi),vb=null,wi=null)}function Wv(e){if(vb===e)return;vb=e;const t=oO(e);wi===null&&(wi=document.createElement("style"),document.head.appendChild(wi)),wi.innerHTML=`*{cursor: ${t}!important;}`}function Tre(e,t=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}function sO(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 aO(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 $re(e,t,n){const r=aO(e,n);if(r){const o=sO(t);return r[o]??null}return null}function Lre(e,t,n,r){const o=sO(t),s=aO(e,r)||{};s[o]=n;try{r.setItem(`PanelGroup:sizes:${e}`,JSON.stringify(s))}catch(i){console.error(i)}}const Vv={};function __(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 Nu={getItem:e=>(__(Nu),Nu.getItem(e)),setItem:(e,t)=>{__(Nu),Nu.setItem(e,t)}};function iO({autoSaveId:e,children:t=null,className:n="",direction:r,disablePointerEventsDuringResize:o=!1,forwardedRef:s,id:i=null,onLayout:l,storage:u=Nu,style:p={},tagName:h="div",units:m="percentages"}){const v=Dy(i),[b,y]=Ku(null),[x,w]=Ku(new Map),k=zr(null);zr({didLogDefaultSizeWarning:!1,didLogIdAndOrderWarning:!1,didLogInvalidLayoutWarning:!1,prevPanelIds:[]});const _=zr({onLayout:l});ea(()=>{_.current.onLayout=l});const j=zr({}),[I,E]=Ku([]),M=zr(new Map),D=zr(0),R=zr({direction:r,id:v,panels:x,sizes:I,units:m});ZM(s,()=>({getId:()=>v,getLayout:B=>{const{sizes:q,units:re}=R.current;if((B??re)==="pixels"){const le=Na(v);return q.map(se=>se/100*le)}else return q},setLayout:(B,q)=>{const{id:re,panels:Q,sizes:le,units:se}=R.current;if((q||se)==="pixels"){const ae=Na(re);B=B.map(oe=>oe/ae*100)}const U=j.current,G=Sr(Q),te=Bv({groupId:re,panels:Q,nextSizes:B,prevSizes:le,units:se});Hv(le,te)||(E(te),Nl(G,te,U))}}),[v]),qu(()=>{R.current.direction=r,R.current.id=v,R.current.panels=x,R.current.sizes=I,R.current.units=m}),Ore({committedValuesRef:R,groupId:v,panels:x,setSizes:E,sizes:I,panelSizeBeforeCollapse:M}),ea(()=>{const{onLayout:B}=_.current,{panels:q,sizes:re}=R.current;if(re.length>0){B&&B(re);const Q=j.current,le=Sr(q);Nl(le,re,Q)}},[I]),qu(()=>{const{id:B,sizes:q,units:re}=R.current;if(q.length===x.size)return;let Q=null;if(e){const le=Sr(x);Q=$re(e,le,u)}if(Q!=null){const le=Bv({groupId:B,panels:x,nextSizes:Q,prevSizes:Q,units:re});E(le)}else{const le=Pre({groupId:B,panels:x,units:re});E(le)}},[e,x,u]),ea(()=>{if(e){if(I.length===0||I.length!==x.size)return;const B=Sr(x);Vv[e]||(Vv[e]=Tre(Lre,100)),Vv[e](e,B,I,u)}},[e,x,I,u]),qu(()=>{if(m==="pixels"){const B=new ResizeObserver(()=>{const{panels:q,sizes:re}=R.current,Q=Bv({groupId:v,panels:q,nextSizes:re,prevSizes:re,units:m});Hv(re,Q)||E(Q)});return B.observe(dd(v)),()=>{B.disconnect()}}},[v,m]);const A=Ls((B,q)=>{const{panels:re,units:Q}=R.current,se=Sr(re).findIndex(te=>te.current.id===B),U=I[se];if((q??Q)==="pixels"){const te=Na(v);return U/100*te}else return U},[v,I]),O=Ls((B,q)=>{const{panels:re}=R.current;return re.size===0?{flexBasis:0,flexGrow:q??void 0,flexShrink:1,overflow:"hidden"}:{flexBasis:0,flexGrow:eO(re,B,I),flexShrink:1,overflow:"hidden",pointerEvents:o&&b!==null?"none":void 0}},[b,o,I]),T=Ls((B,q)=>{const{units:re}=R.current;Mre(re,q),w(Q=>{if(Q.has(B))return Q;const le=new Map(Q);return le.set(B,q),le})},[]),K=Ls(B=>re=>{re.preventDefault();const{direction:Q,panels:le,sizes:se}=R.current,U=Sr(le),[G,te]=Ay(v,B,U);if(G==null||te==null)return;let ae=Rre(re,v,B,U,Q,se,k.current);if(ae===0)return;const pe=dd(v).getBoundingClientRect(),ue=Q==="horizontal";document.dir==="rtl"&&ue&&(ae=-ae);const me=ue?pe.width:pe.height,Ce=ae/me*100,ge=Au(re,R.current,G,te,Ce,se,M.current,k.current),fe=!Hv(se,ge);if((mb(re)||gb(re))&&D.current!=Ce&&Wv(fe?ue?"horizontal":"vertical":ue?ae<0?"horizontal-min":"horizontal-max":ae<0?"vertical-min":"vertical-max"),fe){const De=j.current;E(ge),Nl(U,ge,De)}D.current=Ce},[v]),F=Ls(B=>{w(q=>{if(!q.has(B))return q;const re=new Map(q);return re.delete(B),re})},[]),V=Ls(B=>{const{panels:q,sizes:re}=R.current,Q=q.get(B);if(Q==null)return;const{collapsedSize:le,collapsible:se}=Q.current;if(!se)return;const U=Sr(q),G=U.indexOf(Q);if(G<0)return;const te=re[G];if(te===le)return;M.current.set(B,te);const[ae,oe]=Fv(B,U);if(ae==null||oe==null)return;const ue=G===U.length-1?te:le-te,me=Au(null,R.current,ae,oe,ue,re,M.current,null);if(re!==me){const Ce=j.current;E(me),Nl(U,me,Ce)}},[]),X=Ls(B=>{const{panels:q,sizes:re}=R.current,Q=q.get(B);if(Q==null)return;const{collapsedSize:le,minSize:se}=Q.current,U=M.current.get(B)||se;if(!U)return;const G=Sr(q),te=G.indexOf(Q);if(te<0||re[te]!==le)return;const[oe,pe]=Fv(B,G);if(oe==null||pe==null)return;const me=te===G.length-1?le-U:U,Ce=Au(null,R.current,oe,pe,me,re,M.current,null);if(re!==Ce){const ge=j.current;E(Ce),Nl(G,Ce,ge)}},[]),W=Ls((B,q,re)=>{const{id:Q,panels:le,sizes:se,units:U}=R.current;if((re||U)==="pixels"){const rt=Na(Q);q=q/rt*100}const G=le.get(B);if(G==null)return;let{collapsedSize:te,collapsible:ae,maxSize:oe,minSize:pe}=G.current;if(U==="pixels"){const rt=Na(Q);pe=pe/rt*100,oe!=null&&(oe=oe/rt*100)}const ue=Sr(le),me=ue.indexOf(G);if(me<0)return;const Ce=se[me];if(Ce===q)return;ae&&q===te||(q=Math.min(oe??100,Math.max(pe,q)));const[ge,fe]=Fv(B,ue);if(ge==null||fe==null)return;const je=me===ue.length-1?Ce-q:q-Ce,Be=Au(null,R.current,ge,fe,je,se,M.current,null);if(se!==Be){const rt=j.current;E(Be),Nl(ue,Be,rt)}},[]),z=kre(()=>({activeHandleId:b,collapsePanel:V,direction:r,expandPanel:X,getPanelSize:A,getPanelStyle:O,groupId:v,registerPanel:T,registerResizeHandle:K,resizePanel:W,startDragging:(B,q)=>{if(y(B),mb(q)||gb(q)){const re=wg(B);k.current={dragHandleRect:re.getBoundingClientRect(),dragOffset:rO(q,B,r),sizes:R.current.sizes}}},stopDragging:()=>{Nre(),y(null),k.current=null},units:m,unregisterPanel:F}),[b,V,r,X,A,O,v,T,K,W,m,F]),Y={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return Ec(Cg.Provider,{children:Ec(h,{children:t,className:n,"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":v,"data-panel-group-units":m,style:{...Y,...p}}),value:z})}const Sg=YM((e,t)=>Ec(iO,{...e,forwardedRef:t}));iO.displayName="PanelGroup";Sg.displayName="forwardRef(PanelGroup)";function bb({children:e=null,className:t="",disabled:n=!1,id:r=null,onDragging:o,style:s={},tagName:i="div"}){const l=zr(null),u=zr({onDragging:o});ea(()=>{u.current.onDragging=o});const p=QM(Cg);if(p===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{activeHandleId:h,direction:m,groupId:v,registerResizeHandle:b,startDragging:y,stopDragging:x}=p,w=Dy(r),k=h===w,[_,j]=Ku(!1),[I,E]=Ku(null),M=Ls(()=>{l.current.blur(),x();const{onDragging:A}=u.current;A&&A(!1)},[x]);ea(()=>{if(n)E(null);else{const R=b(w);E(()=>R)}},[n,w,b]),ea(()=>{if(n||I==null||!k)return;const R=K=>{I(K)},A=K=>{I(K)},T=l.current.ownerDocument;return T.body.addEventListener("contextmenu",M),T.body.addEventListener("mousemove",R),T.body.addEventListener("touchmove",R),T.body.addEventListener("mouseleave",A),window.addEventListener("mouseup",M),window.addEventListener("touchend",M),()=>{T.body.removeEventListener("contextmenu",M),T.body.removeEventListener("mousemove",R),T.body.removeEventListener("touchmove",R),T.body.removeEventListener("mouseleave",A),window.removeEventListener("mouseup",M),window.removeEventListener("touchend",M)}},[m,n,k,I,M]),Dre({disabled:n,handleId:w,resizeHandler:I});const D={cursor:oO(m),touchAction:"none",userSelect:"none"};return Ec(i,{children:e,className:t,"data-resize-handle-active":k?"pointer":_?"keyboard":void 0,"data-panel-group-direction":m,"data-panel-group-id":v,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":w,onBlur:()=>j(!1),onFocus:()=>j(!0),onMouseDown:R=>{y(w,R.nativeEvent);const{onDragging:A}=u.current;A&&A(!0)},onMouseUp:M,onTouchCancel:M,onTouchEnd:M,onTouchStart:R=>{y(w,R.nativeEvent);const{onDragging:A}=u.current;A&&A(!0)},ref:l,role:"separator",style:{...D,...s},tabIndex:0})}bb.displayName="PanelResizeHandle";const zre=e=>{const{direction:t="horizontal",collapsedDirection:n,isCollapsed:r=!1,...o}=e,s=Li("base.100","base.850"),i=Li("base.300","base.700");return t==="horizontal"?a.jsx(bb,{style:{visibility:r?"hidden":"visible",width:r?0:"auto"},children:a.jsx($,{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(bb,{style:{visibility:r?"hidden":"visible",width:r?0:"auto"},children:a.jsx($,{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"}})})})},im=d.memo(zre),Ny=()=>{const e=ee(),t=L(o=>o.ui.panels),n=d.useCallback(o=>t[o]??"",[t]),r=d.useCallback((o,s)=>{e($D({name:o,value:s}))},[e]);return{getItem:n,setItem:r}};const Fre=e=>{const{label:t,data:n,fileName:r,withDownload:o=!0,withCopy:s=!0}=e,i=d.useMemo(()=>LD(n)?n:JSON.stringify(n,null,2),[n]),l=d.useCallback(()=>{navigator.clipboard.writeText(i)},[i]),u=d.useCallback(()=>{const h=new Blob([i]),m=document.createElement("a");m.href=URL.createObjectURL(h),m.download=`${r||t}.json`,document.body.appendChild(m),m.click(),m.remove()},[i,t,r]),{t:p}=Z();return a.jsxs($,{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(ug,{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($,{sx:{position:"absolute",top:0,insetInlineEnd:0,p:2},children:[o&&a.jsx(Rt,{label:`${p("gallery.download")} ${t} JSON`,children:a.jsx(ps,{"aria-label":`${p("gallery.download")} ${t} JSON`,icon:a.jsx(ng,{}),variant:"ghost",opacity:.7,onClick:u})}),s&&a.jsx(Rt,{label:`${p("gallery.copy")} ${t} JSON`,children:a.jsx(ps,{"aria-label":`${p("gallery.copy")} ${t} JSON`,icon:a.jsx(Wc,{}),variant:"ghost",opacity:.7,onClick:l})})]})]})},Ri=d.memo(Fre),Bre=ie(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}},we),Hre=()=>{const{data:e}=L(Bre);return e?a.jsx(Ri,{data:e,label:"Node Data"}):a.jsx(Kn,{label:"No node selected",icon:null})},Wre=d.memo(Hre),Vre=e=>a.jsx($,{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(ug,{defer:!0,style:{height:"100%",width:"100%"},options:{scrollbars:{visibility:"auto",autoHide:"scroll",autoHideDelay:1300,theme:"os-theme-dark"},overflow:{x:"hidden"}},children:e.children})})}),Ty=d.memo(Vre),Ure=({output:e})=>{const{image:t}=e,{data:n}=Wr(t.image_name);return a.jsx(oa,{imageDTO:n})},Gre=d.memo(Ure),Kre=ie(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}},we),qre=()=>{const{node:e,template:t,nes:n}=L(Kre),{t:r}=Z();return!e||!n||!Cn(e)?a.jsx(Kn,{label:r("nodes.noNodeSelected"),icon:null}):n.outputs.length===0?a.jsx(Kn,{label:r("nodes.noOutputRecorded"),icon:null}):a.jsx(Ie,{sx:{position:"relative",w:"full",h:"full"},children:a.jsx(Ty,{children:a.jsx($,{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(Gre,{output:o},Yre(o,s))):a.jsx(Ri,{data:n.outputs,label:r("nodes.nodesOutputs")})})})})},Xre=d.memo(qre),Yre=(e,t)=>`${e.type}-${t}`,Qre=ie(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}},we),Zre=()=>{const{template:e}=L(Qre),{t}=Z();return e?a.jsx(Ri,{data:e,label:t("nodes.NodeTemplate")}):a.jsx(Kn,{label:t("nodes.noNodeSelected"),icon:null})},Jre=d.memo(Zre),eoe=()=>a.jsx($,{layerStyle:"first",sx:{flexDir:"column",w:"full",h:"full",borderRadius:"base",p:2,gap:2},children:a.jsxs(Ji,{variant:"line",sx:{display:"flex",flexDir:"column",w:"full",h:"full"},children:[a.jsxs(el,{children:[a.jsx(Pr,{children:"Outputs"}),a.jsx(Pr,{children:"Data"}),a.jsx(Pr,{children:"Template"})]}),a.jsxs(Fc,{children:[a.jsx(mo,{children:a.jsx(Xre,{})}),a.jsx(mo,{children:a.jsx(Wre,{})}),a.jsx(mo,{children:a.jsx(Jre,{})})]})]})}),toe=d.memo(eoe),$y=e=>{e.stopPropagation()},noe={display:"flex",flexDirection:"row",alignItems:"center",gap:10},roe=e=>{const{label:t="",labelPos:n="top",isDisabled:r=!1,isInvalid:o,formControlProps:s,...i}=e,l=ee(),u=d.useCallback(h=>{h.shiftKey&&l(Ir(!0))},[l]),p=d.useCallback(h=>{h.shiftKey||l(Ir(!1))},[l]);return a.jsxs(sn,{isInvalid:o,isDisabled:r,...s,style:n==="side"?noe:void 0,children:[t!==""&&a.jsx(Hn,{children:t}),a.jsx(Em,{...i,onPaste:$y,onKeyDown:u,onKeyUp:p})]})},uo=d.memo(roe),ooe=Pe((e,t)=>{const n=ee(),r=d.useCallback(s=>{s.shiftKey&&n(Ir(!0))},[n]),o=d.useCallback(s=>{s.shiftKey||n(Ir(!1))},[n]);return a.jsx($P,{ref:t,onPaste:$y,onKeyDown:r,onKeyUp:o,...e})}),sa=d.memo(ooe),soe=ie(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}},we),aoe=()=>{const{author:e,name:t,description:n,tags:r,version:o,contact:s,notes:i}=L(soe),l=ee(),u=d.useCallback(w=>{l(zD(w.target.value))},[l]),p=d.useCallback(w=>{l(FD(w.target.value))},[l]),h=d.useCallback(w=>{l(BD(w.target.value))},[l]),m=d.useCallback(w=>{l(HD(w.target.value))},[l]),v=d.useCallback(w=>{l(WD(w.target.value))},[l]),b=d.useCallback(w=>{l(VD(w.target.value))},[l]),y=d.useCallback(w=>{l(UD(w.target.value))},[l]),{t:x}=Z();return a.jsx(Ty,{children:a.jsxs($,{sx:{flexDir:"column",alignItems:"flex-start",gap:2,h:"full"},children:[a.jsxs($,{sx:{gap:2,w:"full"},children:[a.jsx(uo,{label:x("nodes.workflowName"),value:t,onChange:u}),a.jsx(uo,{label:x("nodes.workflowVersion"),value:o,onChange:m})]}),a.jsxs($,{sx:{gap:2,w:"full"},children:[a.jsx(uo,{label:x("nodes.workflowAuthor"),value:e,onChange:p}),a.jsx(uo,{label:x("nodes.workflowContact"),value:s,onChange:h})]}),a.jsx(uo,{label:x("nodes.workflowTags"),value:r,onChange:b}),a.jsxs(sn,{as:$,sx:{flexDir:"column"},children:[a.jsx(Hn,{children:x("nodes.workflowDescription")}),a.jsx(sa,{onChange:v,value:n,fontSize:"sm",sx:{resize:"none"}})]}),a.jsxs(sn,{as:$,sx:{flexDir:"column",h:"full"},children:[a.jsx(Hn,{children:x("nodes.workflowNotes")}),a.jsx(sa,{onChange:y,value:i,fontSize:"sm",sx:{h:"full",resize:"none"}})]})]})})},ioe=d.memo(aoe);function loe(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(),h=d.useRef(e),m=d.useRef(!0);d.useEffect(function(){h.current=e},[e]);var v=!t&&t!==0&&typeof window<"u";if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var b=!!(n=n||{}).leading,y=!("trailing"in n)||!!n.trailing,x="maxWait"in n,w=x?Math.max(+n.maxWait||0,t):null;d.useEffect(function(){return m.current=!0,function(){m.current=!1}},[]);var k=d.useMemo(function(){var _=function(R){var A=l.current,O=u.current;return l.current=u.current=null,s.current=R,p.current=h.current.apply(O,A)},j=function(R,A){v&&cancelAnimationFrame(i.current),i.current=v?requestAnimationFrame(R):setTimeout(R,A)},I=function(R){if(!m.current)return!1;var A=R-o.current;return!o.current||A>=t||A<0||x&&R-s.current>=w},E=function(R){return i.current=null,y&&l.current?_(R):(l.current=u.current=null,p.current)},M=function R(){var A=Date.now();if(I(A))return E(A);if(m.current){var O=t-(A-o.current),T=x?Math.min(O,w-(A-s.current)):O;j(R,T)}},D=function(){var R=Date.now(),A=I(R);if(l.current=[].slice.call(arguments),u.current=r,o.current=R,A){if(!i.current&&m.current)return s.current=o.current,j(M,t),b?_(o.current):p.current;if(x)return j(M,t),_(o.current)}return i.current||j(M,t),p.current};return D.cancel=function(){i.current&&(v?cancelAnimationFrame(i.current):clearTimeout(i.current)),s.current=0,l.current=o.current=u.current=i.current=null},D.isPending=function(){return!!i.current},D.flush=function(){return i.current?E(Date.now()):p.current},D},[b,x,t,w,y,v]);return k}function coe(e,t){return e===t}function j_(e){return typeof e=="function"?function(){return e}:e}function uoe(e,t,n){var r,o,s=n&&n.equalityFn||coe,i=(r=d.useState(j_(e)),o=r[1],[r[0],d.useCallback(function(m){return o(j_(m))},[])]),l=i[0],u=i[1],p=loe(d.useCallback(function(m){return u(m)},[u]),t,n),h=d.useRef(e);return s(h.current,e)||(p(e),h.current=e),[l,p]}const lO=()=>{const e=L(r=>r.nodes),[t]=uoe(e,300);return d.useMemo(()=>GD(t),[t])},doe=()=>{const e=lO(),{t}=Z();return a.jsx($,{sx:{flexDir:"column",alignItems:"flex-start",gap:2,h:"full"},children:a.jsx(Ri,{data:e,label:t("nodes.workflow")})})},foe=d.memo(doe),poe=({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}}})},cO=d.memo(poe),uO=e=>{const t=ee(),n=d.useMemo(()=>ie(xe,({nodes:i})=>i.mouseOverNode===e,we),[e]),r=L(n),o=d.useCallback(()=>{!r&&t(QC(e))},[t,e,r]),s=d.useCallback(()=>{r&&t(QC(null))},[t,r]);return{isMouseOverNode:r,handleMouseOver:o,handleMouseOut:s}},dO=(e,t)=>{const n=d.useMemo(()=>ie(xe,({nodes:o})=>{var i;const s=o.nodes.find(l=>l.id===e);if(Cn(s))return(i=s==null?void 0:s.data.inputs[t])==null?void 0:i.label},we),[t,e]);return L(n)},fO=(e,t,n)=>{const r=d.useMemo(()=>ie(xe,({nodes:s})=>{var u;const i=s.nodes.find(p=>p.id===e);if(!Cn(i))return;const l=s.nodeTemplates[(i==null?void 0:i.data.type)??""];return(u=l==null?void 0:l[Ub[n]][t])==null?void 0:u.title},we),[t,n,e]);return L(r)},pO=(e,t)=>{const n=d.useMemo(()=>ie(xe,({nodes:o})=>{const s=o.nodes.find(i=>i.id===e);if(Cn(s))return s==null?void 0:s.data.inputs[t]},we),[t,e]);return L(n)},kg=(e,t,n)=>{const r=d.useMemo(()=>ie(xe,({nodes:s})=>{const i=s.nodes.find(u=>u.id===e);if(!Cn(i))return;const l=s.nodeTemplates[(i==null?void 0:i.data.type)??""];return l==null?void 0:l[Ub[n]][t]},we),[t,n,e]);return L(r)},hoe=({nodeId:e,fieldName:t,kind:n})=>{const r=pO(e,t),o=kg(e,t,n),s=KD(o),{t:i}=Z(),l=d.useMemo(()=>qD(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($,{sx:{flexDir:"column"},children:[a.jsx(ye,{sx:{fontWeight:600},children:l}),o&&a.jsx(ye,{sx:{opacity:.7,fontStyle:"oblique 5deg"},children:o.description}),o&&a.jsxs(ye,{children:["Type: ",Sd[o.type].title]}),s&&a.jsxs(ye,{children:["Input: ",XD(o.input)]})]})},Ly=d.memo(hoe),moe=Pe((e,t)=>{const{nodeId:n,fieldName:r,kind:o,isMissingInput:s=!1,withTooltip:i=!1}=e,l=dO(n,r),u=fO(n,r,o),{t:p}=Z(),h=ee(),[m,v]=d.useState(l||u||p("nodes.unknownFeild")),b=d.useCallback(async x=>{x&&(x===l||x===u)||(v(x||u||p("nodes.unknownField")),h(YD({nodeId:n,fieldName:r,label:x})))},[l,u,h,n,r,p]),y=d.useCallback(x=>{v(x)},[]);return d.useEffect(()=>{v(l||u||p("nodes.unknownField"))},[l,u,p]),a.jsx(Rt,{label:i?a.jsx(Ly,{nodeId:n,fieldName:r,kind:"input"}):void 0,openDelay:xm,placement:"top",hasArrow:!0,children:a.jsx($,{ref:t,sx:{position:"relative",overflow:"hidden",alignItems:"center",justifyContent:"flex-start",gap:1,h:"full"},children:a.jsxs(jm,{value:m,onChange:y,onSubmit:b,as:$,sx:{position:"relative",alignItems:"center",h:"full"},children:[a.jsx(_m,{sx:{p:0,fontWeight:s?600:400,textAlign:"left",_hover:{fontWeight:"600 !important"}},noOfLines:1}),a.jsx(km,{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(mO,{})]})})})}),hO=d.memo(moe),mO=d.memo(()=>{const{isEditing:e,getEditButtonProps:t}=Q5(),n=d.useCallback(r=>{const{onClick:o}=t();o&&(o(r),r.preventDefault())},[t]);return e?null:a.jsx($,{onClick:n,position:"absolute",w:"full",h:"full",top:0,insetInlineStart:0,cursor:"text"})});mO.displayName="EditableControls";const goe=e=>{const{nodeId:t,field:n}=e,r=ee(),o=d.useCallback(s=>{r(QD({nodeId:t,fieldName:n.name,value:s.target.checked}))},[r,n.name,t]);return a.jsx(Hx,{className:"nodrag",onChange:o,isChecked:n.value})},voe=d.memo(goe);function _g(){return(_g=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 gO(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 xb(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},Xu=function(e){return"touches"in e},yb=function(e){return e&&e.ownerDocument.defaultView||self},P_=function(e,t,n){var r=e.getBoundingClientRect(),o=Xu(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+yb(e).pageXOffset))/r.width),top:Mc((o.pageY-(r.top+yb(e).pageYOffset))/r.height)}},I_=function(e){!Xu(e)&&e.preventDefault()},zy=H.memo(function(e){var t=e.onMove,n=e.onKey,r=gO(e,["onMove","onKey"]),o=d.useRef(null),s=xb(t),i=xb(n),l=d.useRef(null),u=d.useRef(!1),p=d.useMemo(function(){var b=function(w){I_(w),(Xu(w)?w.touches.length>0:w.buttons>0)&&o.current?s(P_(o.current,w,l.current)):x(!1)},y=function(){return x(!1)};function x(w){var k=u.current,_=yb(o.current),j=w?_.addEventListener:_.removeEventListener;j(k?"touchmove":"mousemove",b),j(k?"touchend":"mouseup",y)}return[function(w){var k=w.nativeEvent,_=o.current;if(_&&(I_(k),!function(I,E){return E&&!Xu(I)}(k,u.current)&&_)){if(Xu(k)){u.current=!0;var j=k.changedTouches||[];j.length&&(l.current=j[0].identifier)}_.focus(),s(P_(_,k,l.current)),x(!0)}},function(w){var k=w.which||w.keyCode;k<37||k>40||(w.preventDefault(),i({left:k===39?.05:k===37?-.05:0,top:k===40?.05:k===38?-.05:0}))},x]},[i,s]),h=p[0],m=p[1],v=p[2];return d.useEffect(function(){return v},[v]),H.createElement("div",_g({},r,{onTouchStart:h,onMouseDown:h,className:"react-colorful__interactive",ref:o,onKeyDown:m,tabIndex:0,role:"slider"}))}),jg=function(e){return e.filter(Boolean).join(" ")},Fy=function(e){var t=e.color,n=e.left,r=e.top,o=r===void 0?.5:r,s=jg(["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}}))},dr=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},vO=function(e){var t=e.s,n=e.v,r=e.a,o=(200-t)*n/100;return{h:dr(e.h),s:dr(o>0&&o<200?t*n/100/(o<=100?o:200-o)*100:0),l:dr(o/2),a:dr(r,2)}},Cb=function(e){var t=vO(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},Uv=function(e){var t=vO(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},boe=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:dr(255*[r,l,i,i,u,r][p]),g:dr(255*[u,r,r,l,i,i][p]),b:dr(255*[i,i,u,r,r,l][p]),a:dr(o,2)}},xoe=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:dr(60*(l<0?l+6:l)),s:dr(s?i/s*100:0),v:dr(s/255*100),a:o}},yoe=H.memo(function(e){var t=e.hue,n=e.onChange,r=jg(["react-colorful__hue",e.className]);return H.createElement("div",{className:r},H.createElement(zy,{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":dr(t),"aria-valuemax":"360","aria-valuemin":"0"},H.createElement(Fy,{className:"react-colorful__hue-pointer",left:t/360,color:Cb({h:t,s:100,v:100,a:1})})))}),Coe=H.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:Cb({h:t.h,s:100,v:100,a:1})};return H.createElement("div",{className:"react-colorful__saturation",style:r},H.createElement(zy,{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 "+dr(t.s)+"%, Brightness "+dr(t.v)+"%"},H.createElement(Fy,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:Cb(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 woe(e,t,n){var r=xb(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(h){return Object.assign({},h,p)})},[]);return[s,u]}var Soe=typeof window<"u"?d.useLayoutEffect:d.useEffect,koe=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},E_=new Map,_oe=function(e){Soe(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!E_.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}`,E_.set(t,n);var r=koe();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},joe=function(e){var t=e.className,n=e.hsva,r=e.onChange,o={backgroundImage:"linear-gradient(90deg, "+Uv(Object.assign({},n,{a:0}))+", "+Uv(Object.assign({},n,{a:1}))+")"},s=jg(["react-colorful__alpha",t]),i=dr(100*n.a);return H.createElement("div",{className:s},H.createElement("div",{className:"react-colorful__alpha-gradient",style:o}),H.createElement(zy,{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(Fy,{className:"react-colorful__alpha-pointer",left:n.a,color:Uv(n)})))},Poe=function(e){var t=e.className,n=e.colorModel,r=e.color,o=r===void 0?n.defaultColor:r,s=e.onChange,i=gO(e,["className","colorModel","color","onChange"]),l=d.useRef(null);_oe(l);var u=woe(n,o,s),p=u[0],h=u[1],m=jg(["react-colorful",t]);return H.createElement("div",_g({},i,{ref:l,className:m}),H.createElement(Coe,{hsva:p,onChange:h}),H.createElement(yoe,{hue:p.h,onChange:h}),H.createElement(joe,{hsva:p,onChange:h,className:"react-colorful__last-control"}))},Ioe={defaultColor:{r:0,g:0,b:0,a:1},toHsva:xoe,fromHsva:boe,equal:bO},xO=function(e){return H.createElement(Poe,_g({},e,{colorModel:Ioe}))};const Eoe=e=>{const{nodeId:t,field:n}=e,r=ee(),o=d.useCallback(s=>{r(ZD({nodeId:t,fieldName:n.name,value:s}))},[r,n.name,t]);return a.jsx(xO,{className:"nodrag",color:n.value,onChange:o})},Moe=d.memo(Eoe),yO=e=>{const t=Yi("models"),[n,r,o]=e.split("/"),s=JD.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},Ooe=e=>{const{nodeId:t,field:n}=e,r=n.value,o=ee(),{data:s}=Gb(),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 Pn(s.entities,(h,m)=>{h&&p.push({value:m,label:h.model_name,group:on[h.base_model]})}),p},[s]),u=d.useCallback(p=>{if(!p)return;const h=yO(p);h&&o(eR({nodeId:t,fieldName:n.name,value:h}))},[o,n.name,t]);return a.jsx(In,{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%"}})},Doe=d.memo(Ooe),Roe=e=>{const{nodeId:t,field:n,fieldTemplate:r}=e,o=ee(),s=d.useCallback(i=>{o(tR({nodeId:t,fieldName:n.name,value:i.target.value}))},[o,n.name,t]);return a.jsx(jP,{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))})},Aoe=d.memo(Roe),Noe=e=>{var p;const{nodeId:t,field:n}=e,r=ee(),{currentData:o}=Wr(((p=n.value)==null?void 0:p.image_name)??Er.skipToken),s=d.useCallback(()=>{r(nR({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($,{className:"nodrag",sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center"},children:a.jsx(oa,{imageDTO:o,droppableData:l,draggableData:i,postUploadAction:u,useThumbailFallback:!0,uploadElement:a.jsx(CO,{}),dropLabel:a.jsx(wO,{}),minSize:8,children:a.jsx(Di,{onClick:s,icon:o?a.jsx(Ud,{}):void 0,tooltip:"Reset Image"})})})},Toe=d.memo(Noe),CO=d.memo(()=>a.jsx(ye,{fontSize:16,fontWeight:600,children:"Drop or Upload"}));CO.displayName="UploadElement";const wO=d.memo(()=>a.jsx(ye,{fontSize:16,fontWeight:600,children:"Drop"}));wO.displayName="DropLabel";const $oe=e=>{const t=Yi("models"),[n,r,o]=e.split("/"),s=rR.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},Loe=e=>{const{nodeId:t,field:n}=e,r=n.value,o=ee(),{data:s}=Cd(),{t:i}=Z(),l=d.useMemo(()=>{if(!s)return[];const h=[];return Pn(s.entities,(m,v)=>{m&&h.push({value:v,label:m.model_name,group:on[m.base_model]})}),h.sort((m,v)=>m.disabled&&!v.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(h=>{if(!h)return;const m=$oe(h);m&&o(oR({nodeId:t,fieldName:n.name,value:m}))},[o,n.name,t]);return(s==null?void 0:s.ids.length)===0?a.jsx($,{sx:{justifyContent:"center",p:2},children:a.jsx(ye,{sx:{fontSize:"sm",color:"base.500",_dark:"base.700"},children:"No LoRAs Loaded"})}):a.jsx(Kt,{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:ri,disabled:l.length===0,filter:(h,m)=>{var v;return((v=m.label)==null?void 0:v.toLowerCase().includes(h.toLowerCase().trim()))||m.value.toLowerCase().includes(h.toLowerCase().trim())},error:!u,onChange:p,sx:{width:"100%",".mantine-Select-dropdown":{width:"16rem !important"}}})},zoe=d.memo(Loe),Pg=e=>{const t=Yi("models"),[n,r,o]=e.split("/"),s=sR.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 Uc(e){const{iconMode:t=!1,...n}=e,r=ee(),{t:o}=Z(),[s,{isLoading:i}]=aR(),l=()=>{s().unwrap().then(u=>{r(Tt(Ft({title:`${o("modelManager.modelsSynced")}`,status:"success"})))}).catch(u=>{u&&r(Tt(Ft({title:`${o("modelManager.modelSyncFailed")}`,status:"error"})))})};return t?a.jsx(Te,{icon:a.jsx(WE,{}),tooltip:o("modelManager.syncModels"),"aria-label":o("modelManager.syncModels"),isLoading:i,onClick:l,size:"sm",...n}):a.jsx(it,{isLoading:i,onClick:l,minW:"max-content",...n,children:"Sync Models"})}const Foe=e=>{var y,x;const{nodeId:t,field:n}=e,r=ee(),o=Xt("syncModels").isFeatureEnabled,{t:s}=Z(),{data:i,isLoading:l}=Yu(ZC),{data:u,isLoading:p}=Bo(ZC),h=d.useMemo(()=>l||p,[l,p]),m=d.useMemo(()=>{if(!u)return[];const w=[];return Pn(u.entities,(k,_)=>{k&&w.push({value:_,label:k.model_name,group:on[k.base_model]})}),i&&Pn(i.entities,(k,_)=>{k&&w.push({value:_,label:k.model_name,group:on[k.base_model]})}),w},[u,i]),v=d.useMemo(()=>{var w,k,_,j;return((u==null?void 0:u.entities[`${(w=n.value)==null?void 0:w.base_model}/main/${(k=n.value)==null?void 0:k.model_name}`])||(i==null?void 0:i.entities[`${(_=n.value)==null?void 0:_.base_model}/onnx/${(j=n.value)==null?void 0:j.model_name}`]))??null},[(y=n.value)==null?void 0:y.base_model,(x=n.value)==null?void 0:x.model_name,u==null?void 0:u.entities,i==null?void 0:i.entities]),b=d.useCallback(w=>{if(!w)return;const k=Pg(w);k&&r(t5({nodeId:t,fieldName:n.name,value:k}))},[r,n.name,t]);return a.jsxs($,{sx:{w:"full",alignItems:"center",gap:2},children:[h?a.jsx(ye,{variant:"subtext",children:"Loading..."}):a.jsx(Kt,{className:"nowheel nodrag",tooltip:v==null?void 0:v.description,value:v==null?void 0:v.id,placeholder:m.length>0?s("models.selectModel"):s("models.noModelsAvailable"),data:m,error:!v,disabled:m.length===0,onChange:b,sx:{width:"100%",".mantine-Select-dropdown":{width:"16rem !important"}}}),o&&a.jsx(Uc,{className:"nodrag",iconMode:!0})]})},Boe=d.memo(Foe),lm=/^-?(0\.)?\.?$/,Hoe=e=>{const{label:t,isDisabled:n=!1,showStepper:r=!0,isInvalid:o,value:s,onChange:i,min:l,max:u,isInteger:p=!0,formControlProps:h,formLabelProps:m,numberInputFieldProps:v,numberInputStepperProps:b,tooltipProps:y,...x}=e,w=ee(),[k,_]=d.useState(String(s));d.useEffect(()=>{!k.match(lm)&&s!==Number(k)&&_(String(s))},[s,k]);const j=D=>{_(D),D.match(lm)||i(p?Math.floor(Number(D)):Number(D))},I=D=>{const R=Ni(p?Math.floor(Number(D.target.value)):Number(D.target.value),l,u);_(String(R)),i(R)},E=d.useCallback(D=>{D.shiftKey&&w(Ir(!0))},[w]),M=d.useCallback(D=>{D.shiftKey||w(Ir(!1))},[w]);return a.jsx(Rt,{...y,children:a.jsxs(sn,{isDisabled:n,isInvalid:o,...h,children:[t&&a.jsx(Hn,{...m,children:t}),a.jsxs(Nm,{value:k,min:l,max:u,keepWithinRange:!0,clampValueOnBlur:!1,onChange:j,onBlur:I,...x,onPaste:$y,children:[a.jsx($m,{...v,onKeyDown:E,onKeyUp:M}),r&&a.jsxs(Tm,{children:[a.jsx(zm,{...b}),a.jsx(Lm,{...b})]})]})]})})},Gc=d.memo(Hoe),Woe=e=>{const{nodeId:t,field:n,fieldTemplate:r}=e,o=ee(),[s,i]=d.useState(String(n.value)),l=d.useMemo(()=>r.type==="integer",[r.type]),u=p=>{i(p),p.match(lm)||o(iR({nodeId:t,fieldName:n.name,value:l?Math.floor(Number(p)):Number(p)}))};return d.useEffect(()=>{!s.match(lm)&&n.value!==Number(s)&&i(String(n.value))},[n.value,s]),a.jsxs(Nm,{onChange:u,value:s,step:l?1:.1,precision:l?0:3,children:[a.jsx($m,{className:"nodrag"}),a.jsxs(Tm,{children:[a.jsx(zm,{}),a.jsx(Lm,{})]})]})},Voe=d.memo(Woe),Uoe=e=>{var m,v;const{nodeId:t,field:n}=e,r=ee(),{t:o}=Z(),s=Xt("syncModels").isFeatureEnabled,{data:i,isLoading:l}=Bo(Kb),u=d.useMemo(()=>{if(!i)return[];const b=[];return Pn(i.entities,(y,x)=>{y&&b.push({value:x,label:y.model_name,group:on[y.base_model]})}),b},[i]),p=d.useMemo(()=>{var b,y;return(i==null?void 0:i.entities[`${(b=n.value)==null?void 0:b.base_model}/main/${(y=n.value)==null?void 0:y.model_name}`])??null},[(m=n.value)==null?void 0:m.base_model,(v=n.value)==null?void 0:v.model_name,i==null?void 0:i.entities]),h=d.useCallback(b=>{if(!b)return;const y=Pg(b);y&&r(lR({nodeId:t,fieldName:n.name,value:y}))},[r,n.name,t]);return l?a.jsx(Kt,{label:o("modelManager.model"),placeholder:o("models.loading"),disabled:!0,data:[]}):a.jsxs($,{w:"100%",alignItems:"center",gap:2,children:[a.jsx(Kt,{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:h,sx:{width:"100%",".mantine-Select-dropdown":{width:"16rem !important"}}}),s&&a.jsx(Uc,{className:"nodrag",iconMode:!0})]})},Goe=d.memo(Uoe),Koe=e=>{var v,b;const{nodeId:t,field:n}=e,r=ee(),{t:o}=Z(),s=Xt("syncModels").isFeatureEnabled,{data:i}=Yu(JC),{data:l,isLoading:u}=Bo(JC),p=d.useMemo(()=>{if(!l)return[];const y=[];return Pn(l.entities,(x,w)=>{!x||x.base_model!=="sdxl"||y.push({value:w,label:x.model_name,group:on[x.base_model]})}),i&&Pn(i.entities,(x,w)=>{!x||x.base_model!=="sdxl"||y.push({value:w,label:x.model_name,group:on[x.base_model]})}),y},[l,i]),h=d.useMemo(()=>{var y,x,w,k;return((l==null?void 0:l.entities[`${(y=n.value)==null?void 0:y.base_model}/main/${(x=n.value)==null?void 0:x.model_name}`])||(i==null?void 0:i.entities[`${(w=n.value)==null?void 0:w.base_model}/onnx/${(k=n.value)==null?void 0:k.model_name}`]))??null},[(v=n.value)==null?void 0:v.base_model,(b=n.value)==null?void 0:b.model_name,l==null?void 0:l.entities,i==null?void 0:i.entities]),m=d.useCallback(y=>{if(!y)return;const x=Pg(y);x&&r(t5({nodeId:t,fieldName:n.name,value:x}))},[r,n.name,t]);return u?a.jsx(Kt,{label:o("modelManager.model"),placeholder:o("models.loading"),disabled:!0,data:[]}):a.jsxs($,{w:"100%",alignItems:"center",gap:2,children:[a.jsx(Kt,{className:"nowheel nodrag",tooltip:h==null?void 0:h.description,value:h==null?void 0:h.id,placeholder:p.length>0?o("models.selectModel"):o("models.noModelsAvailable"),data:p,error:!h,disabled:p.length===0,onChange:m,sx:{width:"100%",".mantine-Select-dropdown":{width:"16rem !important"}}}),s&&a.jsx(Uc,{className:"nodrag",iconMode:!0})]})},qoe=d.memo(Koe),Xoe=ie([xe],({ui:e})=>{const{favoriteSchedulers:t}=e;return{data:rr(hm,(r,o)=>({value:o,label:r,group:t.includes(o)?"Favorites":void 0})).sort((r,o)=>r.label.localeCompare(o.label))}},we),Yoe=e=>{const{nodeId:t,field:n}=e,r=ee(),{data:o}=L(Xoe),s=d.useCallback(i=>{i&&r(cR({nodeId:t,fieldName:n.name,value:i}))},[r,n.name,t]);return a.jsx(Kt,{className:"nowheel nodrag",sx:{".mantine-Select-dropdown":{width:"14rem !important"}},value:n.value,data:o,onChange:s})},Qoe=d.memo(Yoe),Zoe=e=>{const{nodeId:t,field:n,fieldTemplate:r}=e,o=ee(),s=d.useCallback(i=>{o(uR({nodeId:t,fieldName:n.name,value:i.target.value}))},[o,n.name,t]);return r.ui_component==="textarea"?a.jsx(sa,{className:"nodrag",onChange:s,value:n.value,rows:5,resize:"none"}):a.jsx(uo,{onChange:s,value:n.value})},Joe=d.memo(Zoe),SO=e=>{const t=Yi("models"),[n,r,o]=e.split("/"),s=dR.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},ese=e=>{const{nodeId:t,field:n}=e,r=n.value,o=ee(),{data:s}=n5(),i=d.useMemo(()=>{if(!s)return[];const p=[{value:"default",label:"Default",group:"Default"}];return Pn(s.entities,(h,m)=>{h&&p.push({value:m,label:h.model_name,group:on[h.base_model]})}),p.sort((h,m)=>h.disabled&&!m.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 h=SO(p);h&&o(fR({nodeId:t,fieldName:n.name,value:h}))},[o,n.name,t]);return a.jsx(Kt,{className:"nowheel nodrag",itemComponent:ri,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"}}})},tse=d.memo(ese),kO=e=>{const t=Yi("models"),[n,r,o]=e.split("/"),s=pR.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},nse=e=>{const{nodeId:t,field:n}=e,r=n.value,o=ee(),{data:s}=r5(),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 Pn(s.entities,(h,m)=>{h&&p.push({value:m,label:h.model_name,group:on[h.base_model]})}),p},[s]),u=d.useCallback(p=>{if(!p)return;const h=kO(p);h&&o(hR({nodeId:t,fieldName:n.name,value:h}))},[o,n.name,t]);return a.jsx(In,{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%"}})},rse=d.memo(nse),ose=({nodeId:e,fieldName:t})=>{const n=pO(e,t),r=kg(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"?a.jsx(Joe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="boolean"&&(r==null?void 0:r.type)==="boolean"?a.jsx(voe,{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"?a.jsx(Voe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="enum"&&(r==null?void 0:r.type)==="enum"?a.jsx(Aoe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="ImageField"&&(r==null?void 0:r.type)==="ImageField"?a.jsx(Toe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="MainModelField"&&(r==null?void 0:r.type)==="MainModelField"?a.jsx(Boe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="SDXLRefinerModelField"&&(r==null?void 0:r.type)==="SDXLRefinerModelField"?a.jsx(Goe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="VaeModelField"&&(r==null?void 0:r.type)==="VaeModelField"?a.jsx(tse,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="LoRAModelField"&&(r==null?void 0:r.type)==="LoRAModelField"?a.jsx(zoe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="ControlNetModelField"&&(r==null?void 0:r.type)==="ControlNetModelField"?a.jsx(Doe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="IPAdapterModelField"&&(r==null?void 0:r.type)==="IPAdapterModelField"?a.jsx(rse,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="ColorField"&&(r==null?void 0:r.type)==="ColorField"?a.jsx(Moe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="SDXLMainModelField"&&(r==null?void 0:r.type)==="SDXLMainModelField"?a.jsx(qoe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="Scheduler"&&(r==null?void 0:r.type)==="Scheduler"?a.jsx(Qoe,{nodeId:e,field:n,fieldTemplate:r}):n&&r?null:a.jsx(Ie,{p:1,children:a.jsxs(ye,{sx:{fontSize:"sm",fontWeight:600,color:"error.400",_dark:{color:"error.300"}},children:["Unknown field type: ",n==null?void 0:n.type]})})},_O=d.memo(ose),sse=({nodeId:e,fieldName:t})=>{const n=ee(),{isMouseOverNode:r,handleMouseOut:o,handleMouseOver:s}=uO(e),{t:i}=Z(),l=d.useCallback(()=>{n(o5({nodeId:e,fieldName:t}))},[n,t,e]);return a.jsxs($,{onMouseEnter:s,onMouseLeave:o,layerStyle:"second",sx:{position:"relative",borderRadius:"base",w:"full",p:2},children:[a.jsxs(sn,{as:$,sx:{flexDir:"column",gap:1,flexShrink:1},children:[a.jsxs(Hn,{sx:{display:"flex",alignItems:"center",mb:0},children:[a.jsx(hO,{nodeId:e,fieldName:t,kind:"input"}),a.jsx(Za,{}),a.jsx(Rt,{label:a.jsx(Ly,{nodeId:e,fieldName:t,kind:"input"}),openDelay:xm,placement:"top",hasArrow:!0,children:a.jsx($,{h:"full",alignItems:"center",children:a.jsx(Tn,{as:TE})})}),a.jsx(Te,{"aria-label":i("nodes.removeLinearView"),tooltip:i("nodes.removeLinearView"),variant:"ghost",size:"sm",onClick:l,icon:a.jsx(Kr,{})})]}),a.jsx(_O,{nodeId:e,fieldName:t})]}),a.jsx(cO,{isSelected:!1,isHovered:r})]})},ase=d.memo(sse),ise=ie(xe,({nodes:e})=>({fields:e.workflow.exposedFields}),we),lse=()=>{const{fields:e}=L(ise),{t}=Z();return a.jsx(Ie,{sx:{position:"relative",w:"full",h:"full"},children:a.jsx(Ty,{children:a.jsx($,{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(ase,{nodeId:n,fieldName:r},`${n}.${r}`)):a.jsx(Kn,{label:t("nodes.noFieldsLinearview"),icon:null})})})})},cse=d.memo(lse),use=()=>a.jsx($,{layerStyle:"first",sx:{flexDir:"column",w:"full",h:"full",borderRadius:"base",p:2,gap:2},children:a.jsxs(Ji,{variant:"line",sx:{display:"flex",flexDir:"column",w:"full",h:"full"},children:[a.jsxs(el,{children:[a.jsx(Pr,{children:"Linear"}),a.jsx(Pr,{children:"Details"}),a.jsx(Pr,{children:"JSON"})]}),a.jsxs(Fc,{children:[a.jsx(mo,{children:a.jsx(cse,{})}),a.jsx(mo,{children:a.jsx(ioe,{})}),a.jsx(mo,{children:a.jsx(foe,{})})]})]})}),dse=d.memo(use),fse=()=>{const[e,t]=d.useState(!1),[n,r]=d.useState(!1),o=d.useRef(null),s=Ny(),i=d.useCallback(()=>{o.current&&o.current.setLayout([50,50])},[]);return a.jsxs($,{sx:{flexDir:"column",gap:2,height:"100%",width:"100%"},children:[a.jsx(XM,{}),a.jsxs(Sg,{ref:o,id:"workflow-panel-group",direction:"vertical",style:{height:"100%",width:"100%"},storage:s,children:[a.jsx(Ua,{id:"workflow",collapsible:!0,onCollapse:t,minSize:25,children:a.jsx(dse,{})}),a.jsx(im,{direction:"vertical",onDoubleClick:i,collapsedDirection:e?"top":n?"bottom":void 0}),a.jsx(Ua,{id:"inspector",collapsible:!0,onCollapse:r,minSize:25,children:a.jsx(toe,{})})]})]})},pse=d.memo(fse),M_=(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()?Fr.flushSync(()=>{var h;(h=n.current)==null||h.expand()}):Fr.flushSync(()=>{var h;(h=n.current)==null||h.collapse()})},[]),i=d.useCallback(()=>{Fr.flushSync(()=>{var p;(p=n.current)==null||p.expand()})},[]),l=d.useCallback(()=>{Fr.flushSync(()=>{var p;(p=n.current)==null||p.collapse()})},[]),u=d.useCallback(()=>{Fr.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}},hse=({isGalleryCollapsed:e,galleryPanelRef:t})=>{const{t:n}=Z(),r=()=>{var o;(o=t.current)==null||o.expand()};return e?a.jsx(_d,{children:a.jsx($,{pos:"absolute",transform:"translate(0, -50%)",minW:8,top:"50%",insetInlineEnd:"1.63rem",children:a.jsx(Te,{tooltip:"Show Gallery (G)",tooltipProps:{placement:"top"},"aria-label":n("common.showGalleryPanel"),onClick:r,icon:a.jsx($ne,{}),sx:{p:0,px:3,h:48,borderStartEndRadius:0,borderEndEndRadius:0,shadow:"2xl"}})})}):null},mse=d.memo(hse),Gv={borderStartStartRadius:0,borderEndStartRadius:0,shadow:"2xl"},gse=({isSidePanelCollapsed:e,sidePanelRef:t})=>{const{t:n}=Z(),r=()=>{var o;(o=t.current)==null||o.expand()};return e?a.jsx(_d,{children:a.jsxs($,{pos:"absolute",transform:"translate(0, -50%)",minW:8,top:"50%",insetInlineStart:"5.13rem",direction:"column",gap:2,children:[a.jsx(Te,{tooltip:"Show Side Panel (O, T)","aria-label":n("common.showOptionsPanel"),onClick:r,sx:Gv,icon:a.jsx(HE,{})}),a.jsx(qM,{asIconButton:!0,sx:Gv}),a.jsx(KM,{sx:Gv,asIconButton:!0})]})}):null},vse=d.memo(gse),bse=e=>{const{label:t,activeLabel:n,children:r,defaultIsOpen:o=!1}=e,{isOpen:s,onToggle:i}=Mr({defaultIsOpen:o}),{colorMode:l}=la();return a.jsxs(Ie,{children:[a.jsxs($,{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"},children:[t,a.jsx(nr,{children:n&&a.jsx(vn.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}},children:a.jsx(ye,{sx:{color:"accent.500",_dark:{color:"accent.300"}},children:n})},"statusText")}),a.jsx(Za,{}),a.jsx(dg,{sx:{w:"1rem",h:"1rem",transform:s?"rotate(0deg)":"rotate(180deg)",transitionProperty:"common",transitionDuration:"normal"}})]}),a.jsx(wm,{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})})]})},hr=d.memo(bse),xse=ie(xe,e=>{const{combinatorial:t,isEnabled:n}=e.dynamicPrompts;return{combinatorial:t,isDisabled:!n}},we),yse=()=>{const{combinatorial:e,isDisabled:t}=L(xse),n=ee(),{t:r}=Z(),o=d.useCallback(()=>{n(mR())},[n]);return a.jsx(Vt,{isDisabled:t,label:r("prompt.combinatorial"),isChecked:e,onChange:o})},Cse=d.memo(yse),wse=ie(xe,e=>{const{isEnabled:t}=e.dynamicPrompts;return{isEnabled:t}},we),Sse=()=>{const e=ee(),{isEnabled:t}=L(wse),{t:n}=Z(),r=d.useCallback(()=>{e(gR())},[e]);return a.jsx(Vt,{label:n("prompt.enableDynamicPrompts"),isChecked:t,onChange:r})},kse=d.memo(Sse),_se=ie(xe,e=>{const{maxPrompts:t,combinatorial:n,isEnabled:r}=e.dynamicPrompts,{min:o,sliderMax:s,inputMax:i}=e.config.sd.dynamicPrompts.maxPrompts;return{maxPrompts:t,min:o,sliderMax:s,inputMax:i,isDisabled:!r||!n}},we),jse=()=>{const{maxPrompts:e,min:t,sliderMax:n,inputMax:r,isDisabled:o}=L(_se),s=ee(),{t:i}=Z(),l=d.useCallback(p=>{s(vR(p))},[s]),u=d.useCallback(()=>{s(bR())},[s]);return a.jsx(Xe,{label:i("prompt.maxPrompts"),isDisabled:o,min:t,max:n,value:e,onChange:l,sliderNumberInputProps:{max:r},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:u})},Pse=d.memo(jse),Ise=ie(xe,e=>{const{isEnabled:t}=e.dynamicPrompts;return{activeLabel:t?"Enabled":void 0}},we),Ese=()=>{const{activeLabel:e}=L(Ise),{t}=Z();return Xt("dynamicPrompting").isFeatureEnabled?a.jsx(hr,{label:t("prompt.dynamicPrompts"),activeLabel:e,children:a.jsxs($,{sx:{gap:2,flexDir:"column"},children:[a.jsx(kse,{}),a.jsx(Cse,{}),a.jsx(Pse,{})]})}):null},Kc=d.memo(Ese),Mse=e=>{const t=ee(),{lora:n}=e,r=d.useCallback(i=>{t(xR({id:n.id,weight:i}))},[t,n.id]),o=d.useCallback(()=>{t(yR(n.id))},[t,n.id]),s=d.useCallback(()=>{t(CR(n.id))},[t,n.id]);return a.jsxs($,{sx:{gap:2.5,alignItems:"flex-end"},children:[a.jsx(Xe,{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(Te,{size:"sm",onClick:s,tooltip:"Remove LoRA","aria-label":"Remove LoRA",icon:a.jsx(Kr,{}),colorScheme:"error"})]})},Ose=d.memo(Mse),Dse=ie(xe,({lora:e})=>({lorasArray:rr(e.loras)}),we),Rse=()=>{const{lorasArray:e}=L(Dse);return a.jsx(a.Fragment,{children:e.map((t,n)=>a.jsxs($,{sx:{flexDirection:"column",gap:2},children:[n>0&&a.jsx(Vr,{pt:1}),a.jsx(Ose,{lora:t})]},t.model_name))})},Ase=d.memo(Rse),Nse=ie(xe,({lora:e})=>({loras:e.loras}),we),Tse=()=>{const e=ee(),{loras:t}=L(Nse),{data:n}=Cd(),r=L(i=>i.generation.model),o=d.useMemo(()=>{if(!n)return[];const i=[];return Pn(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:on[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(wR(l))},[e,n==null?void 0:n.entities]);return(n==null?void 0:n.ids.length)===0?a.jsx($,{sx:{justifyContent:"center",p:2},children:a.jsx(ye,{sx:{fontSize:"sm",color:"base.500",_dark:"base.700"},children:"No LoRAs Loaded"})}):a.jsx(Kt,{placeholder:o.length===0?"All LoRAs added":"Add LoRA",value:null,data:o,nothingFound:"No matching LoRAs",itemComponent:ri,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})},$se=d.memo(Tse),Lse=ie(xe,e=>{const t=s5(e.lora.loras);return{activeLabel:t>0?`${t} Active`:void 0}},we),zse=()=>{const{activeLabel:e}=L(Lse);return Xt("lora").isFeatureEnabled?a.jsx(hr,{label:"LoRA",activeLabel:e,children:a.jsxs($,{sx:{flexDir:"column",gap:2},children:[a.jsx($se,{}),a.jsx(Ase,{})]})}):null},qc=d.memo(zse),Fse=ie(xe,({generation:e})=>{const{model:t}=e;return{mainModel:t}},we),Bse=e=>{const{controlNetId:t,model:n,isEnabled:r}=e.controlNet,o=ee(),s=L(En),{mainModel:i}=L(Fse),{t:l}=Z(),{data:u}=Gb(),p=d.useMemo(()=>{if(!u)return[];const v=[];return Pn(u.entities,(b,y)=>{if(!b)return;const x=(b==null?void 0:b.base_model)!==(i==null?void 0:i.base_model);v.push({value:y,label:b.model_name,group:on[b.base_model],disabled:x,tooltip:x?`${l("controlnet.incompatibleBaseModel")} ${b.base_model}`:void 0})}),v},[u,i==null?void 0:i.base_model,l]),h=d.useMemo(()=>(u==null?void 0:u.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,u==null?void 0:u.entities]),m=d.useCallback(v=>{if(!v)return;const b=yO(v);b&&o(a5({controlNetId:t,model:b}))},[t,o]);return a.jsx(Kt,{itemComponent:ri,data:p,error:!h||(i==null?void 0:i.base_model)!==h.base_model,placeholder:l("controlnet.selectModel"),value:(h==null?void 0:h.id)??null,onChange:m,disabled:s||!r,tooltip:h==null?void 0:h.description})},Hse=d.memo(Bse),Wse=e=>{const{weight:t,isEnabled:n,controlNetId:r}=e.controlNet,o=ee(),{t:s}=Z(),i=d.useCallback(l=>{o(SR({controlNetId:r,weight:l}))},[r,o]);return a.jsx(Xe,{isDisabled:!n,label:s("controlnet.weight"),value:t,onChange:i,min:0,max:2,step:.01,withSliderMarks:!0,sliderMarks:[0,1,2]})},Vse=d.memo(Wse),Use=ie(xe,({controlNet:e,gallery:t})=>{const{pendingControlImages:n}=e,{autoAddBoardId:r}=t;return{pendingControlImages:n,autoAddBoardId:r}},we),Gse=({isSmall:e,controlNet:t})=>{const{controlImage:n,processedControlImage:r,processorType:o,isEnabled:s,controlNetId:i}=t,l=ee(),{t:u}=Z(),{pendingControlImages:p,autoAddBoardId:h}=L(Use),m=L(wn),[v,b]=d.useState(!1),{currentData:y}=Wr(n??Er.skipToken),{currentData:x}=Wr(r??Er.skipToken),[w]=kR(),[k]=_R(),[_]=jR(),j=d.useCallback(()=>{l(PR({controlNetId:i,controlImage:null}))},[i,l]),I=d.useCallback(async()=>{x&&(await w({imageDTO:x,is_intermediate:!1}).unwrap(),h!=="none"?k({imageDTO:x,board_id:h}):_({imageDTO:x}))},[x,w,h,k,_]),E=d.useCallback(()=>{y&&(m==="unifiedCanvas"?l(No({width:y.width,height:y.height})):(l(Ti(y.width)),l($i(y.height))))},[y,m,l]),M=d.useCallback(()=>{b(!0)},[]),D=d.useCallback(()=>{b(!1)},[]),R=d.useMemo(()=>{if(y)return{id:i,payloadType:"IMAGE_DTO",payload:{imageDTO:y}}},[y,i]),A=d.useMemo(()=>({id:i,actionType:"SET_CONTROLNET_IMAGE",context:{controlNetId:i}}),[i]),O=d.useMemo(()=>({type:"SET_CONTROLNET_IMAGE",controlNetId:i}),[i]),T=y&&x&&!v&&!p.includes(i)&&o!=="none";return a.jsxs($,{onMouseEnter:M,onMouseLeave:D,sx:{position:"relative",w:"full",h:e?28:366,alignItems:"center",justifyContent:"center",pointerEvents:s?"auto":"none",opacity:s?1:.5},children:[a.jsx(oa,{draggableData:R,droppableData:A,imageDTO:y,isDropDisabled:T||!s,postUploadAction:O}),a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",opacity:T?1:0,transitionProperty:"common",transitionDuration:"normal",pointerEvents:"none"},children:a.jsx(oa,{draggableData:R,droppableData:A,imageDTO:x,isUploadDisabled:!0,isDropDisabled:!s})}),a.jsxs(a.Fragment,{children:[a.jsx(Di,{onClick:j,icon:y?a.jsx(Ud,{}):void 0,tooltip:u("controlnet.resetControlImage")}),a.jsx(Di,{onClick:I,icon:y?a.jsx(rg,{size:16}):void 0,tooltip:u("controlnet.saveControlImage"),styleOverrides:{marginTop:6}}),a.jsx(Di,{onClick:E,icon:y?a.jsx(qZ,{size:16}):void 0,tooltip:u("controlnet.setControlImageDimensions"),styleOverrides:{marginTop:12}})]}),p.includes(i)&&a.jsx($,{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(Xi,{size:"xl",sx:{color:"base.100",_dark:{color:"base.400"}}})})]})},O_=d.memo(Gse),qo=()=>{const e=ee();return d.useCallback((n,r)=>{e(IR({controlNetId:n,changes:r}))},[e])};function Xo(e){return a.jsx($,{sx:{flexDirection:"column",gap:2},children:e.children})}const D_=bo.canny_image_processor.default,Kse=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{low_threshold:o,high_threshold:s}=n,i=L(En),l=qo(),{t:u}=Z(),p=d.useCallback(b=>{l(t,{low_threshold:b})},[t,l]),h=d.useCallback(()=>{l(t,{low_threshold:D_.low_threshold})},[t,l]),m=d.useCallback(b=>{l(t,{high_threshold:b})},[t,l]),v=d.useCallback(()=>{l(t,{high_threshold:D_.high_threshold})},[t,l]);return a.jsxs(Xo,{children:[a.jsx(Xe,{isDisabled:i||!r,label:u("controlnet.lowThreshold"),value:o,onChange:p,handleReset:h,withReset:!0,min:0,max:255,withInput:!0,withSliderMarks:!0}),a.jsx(Xe,{isDisabled:i||!r,label:u("controlnet.highThreshold"),value:s,onChange:m,handleReset:v,withReset:!0,min:0,max:255,withInput:!0,withSliderMarks:!0})]})},qse=d.memo(Kse),ju=bo.content_shuffle_image_processor.default,Xse=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,w:i,h:l,f:u}=n,p=qo(),h=L(En),{t:m}=Z(),v=d.useCallback(M=>{p(t,{detect_resolution:M})},[t,p]),b=d.useCallback(()=>{p(t,{detect_resolution:ju.detect_resolution})},[t,p]),y=d.useCallback(M=>{p(t,{image_resolution:M})},[t,p]),x=d.useCallback(()=>{p(t,{image_resolution:ju.image_resolution})},[t,p]),w=d.useCallback(M=>{p(t,{w:M})},[t,p]),k=d.useCallback(()=>{p(t,{w:ju.w})},[t,p]),_=d.useCallback(M=>{p(t,{h:M})},[t,p]),j=d.useCallback(()=>{p(t,{h:ju.h})},[t,p]),I=d.useCallback(M=>{p(t,{f:M})},[t,p]),E=d.useCallback(()=>{p(t,{f:ju.f})},[t,p]);return a.jsxs(Xo,{children:[a.jsx(Xe,{label:m("controlnet.detectResolution"),value:s,onChange:v,handleReset:b,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:h||!r}),a.jsx(Xe,{label:m("controlnet.imageResolution"),value:o,onChange:y,handleReset:x,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:h||!r}),a.jsx(Xe,{label:m("controlnet.w"),value:i,onChange:w,handleReset:k,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:h||!r}),a.jsx(Xe,{label:m("controlnet.h"),value:l,onChange:_,handleReset:j,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:h||!r}),a.jsx(Xe,{label:m("controlnet.f"),value:u,onChange:I,handleReset:E,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:h||!r})]})},Yse=d.memo(Xse),R_=bo.hed_image_processor.default,Qse=e=>{const{controlNetId:t,processorNode:{detect_resolution:n,image_resolution:r,scribble:o},isEnabled:s}=e,i=L(En),l=qo(),{t:u}=Z(),p=d.useCallback(y=>{l(t,{detect_resolution:y})},[t,l]),h=d.useCallback(y=>{l(t,{image_resolution:y})},[t,l]),m=d.useCallback(y=>{l(t,{scribble:y.target.checked})},[t,l]),v=d.useCallback(()=>{l(t,{detect_resolution:R_.detect_resolution})},[t,l]),b=d.useCallback(()=>{l(t,{image_resolution:R_.image_resolution})},[t,l]);return a.jsxs(Xo,{children:[a.jsx(Xe,{label:u("controlnet.detectResolution"),value:n,onChange:p,handleReset:v,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:i||!s}),a.jsx(Xe,{label:u("controlnet.imageResolution"),value:r,onChange:h,handleReset:b,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:i||!s}),a.jsx(Vt,{label:u("controlnet.scribble"),isChecked:o,onChange:m,isDisabled:i||!s})]})},Zse=d.memo(Qse),A_=bo.lineart_anime_image_processor.default,Jse=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s}=n,i=qo(),l=L(En),{t:u}=Z(),p=d.useCallback(b=>{i(t,{detect_resolution:b})},[t,i]),h=d.useCallback(b=>{i(t,{image_resolution:b})},[t,i]),m=d.useCallback(()=>{i(t,{detect_resolution:A_.detect_resolution})},[t,i]),v=d.useCallback(()=>{i(t,{image_resolution:A_.image_resolution})},[t,i]);return a.jsxs(Xo,{children:[a.jsx(Xe,{label:u("controlnet.detectResolution"),value:s,onChange:p,handleReset:m,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:l||!r}),a.jsx(Xe,{label:u("controlnet.imageResolution"),value:o,onChange:h,handleReset:v,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:l||!r})]})},eae=d.memo(Jse),N_=bo.lineart_image_processor.default,tae=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,coarse:i}=n,l=qo(),u=L(En),{t:p}=Z(),h=d.useCallback(x=>{l(t,{detect_resolution:x})},[t,l]),m=d.useCallback(x=>{l(t,{image_resolution:x})},[t,l]),v=d.useCallback(()=>{l(t,{detect_resolution:N_.detect_resolution})},[t,l]),b=d.useCallback(()=>{l(t,{image_resolution:N_.image_resolution})},[t,l]),y=d.useCallback(x=>{l(t,{coarse:x.target.checked})},[t,l]);return a.jsxs(Xo,{children:[a.jsx(Xe,{label:p("controlnet.detectResolution"),value:s,onChange:h,handleReset:v,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:u||!r}),a.jsx(Xe,{label:p("controlnet.imageResolution"),value:o,onChange:m,handleReset:b,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:u||!r}),a.jsx(Vt,{label:p("controlnet.coarse"),isChecked:i,onChange:y,isDisabled:u||!r})]})},nae=d.memo(tae),T_=bo.mediapipe_face_processor.default,rae=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{max_faces:o,min_confidence:s}=n,i=qo(),l=L(En),{t:u}=Z(),p=d.useCallback(b=>{i(t,{max_faces:b})},[t,i]),h=d.useCallback(b=>{i(t,{min_confidence:b})},[t,i]),m=d.useCallback(()=>{i(t,{max_faces:T_.max_faces})},[t,i]),v=d.useCallback(()=>{i(t,{min_confidence:T_.min_confidence})},[t,i]);return a.jsxs(Xo,{children:[a.jsx(Xe,{label:u("controlnet.maxFaces"),value:o,onChange:p,handleReset:m,withReset:!0,min:1,max:20,withInput:!0,withSliderMarks:!0,isDisabled:l||!r}),a.jsx(Xe,{label:u("controlnet.minConfidence"),value:s,onChange:h,handleReset:v,withReset:!0,min:0,max:1,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:l||!r})]})},oae=d.memo(rae),$_=bo.midas_depth_image_processor.default,sae=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{a_mult:o,bg_th:s}=n,i=qo(),l=L(En),{t:u}=Z(),p=d.useCallback(b=>{i(t,{a_mult:b})},[t,i]),h=d.useCallback(b=>{i(t,{bg_th:b})},[t,i]),m=d.useCallback(()=>{i(t,{a_mult:$_.a_mult})},[t,i]),v=d.useCallback(()=>{i(t,{bg_th:$_.bg_th})},[t,i]);return a.jsxs(Xo,{children:[a.jsx(Xe,{label:u("controlnet.amult"),value:o,onChange:p,handleReset:m,withReset:!0,min:0,max:20,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:l||!r}),a.jsx(Xe,{label:u("controlnet.bgth"),value:s,onChange:h,handleReset:v,withReset:!0,min:0,max:20,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:l||!r})]})},aae=d.memo(sae),Mp=bo.mlsd_image_processor.default,iae=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,thr_d:i,thr_v:l}=n,u=qo(),p=L(En),{t:h}=Z(),m=d.useCallback(j=>{u(t,{detect_resolution:j})},[t,u]),v=d.useCallback(j=>{u(t,{image_resolution:j})},[t,u]),b=d.useCallback(j=>{u(t,{thr_d:j})},[t,u]),y=d.useCallback(j=>{u(t,{thr_v:j})},[t,u]),x=d.useCallback(()=>{u(t,{detect_resolution:Mp.detect_resolution})},[t,u]),w=d.useCallback(()=>{u(t,{image_resolution:Mp.image_resolution})},[t,u]),k=d.useCallback(()=>{u(t,{thr_d:Mp.thr_d})},[t,u]),_=d.useCallback(()=>{u(t,{thr_v:Mp.thr_v})},[t,u]);return a.jsxs(Xo,{children:[a.jsx(Xe,{label:h("controlnet.detectResolution"),value:s,onChange:m,handleReset:x,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:p||!r}),a.jsx(Xe,{label:h("controlnet.imageResolution"),value:o,onChange:v,handleReset:w,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:p||!r}),a.jsx(Xe,{label:h("controlnet.w"),value:i,onChange:b,handleReset:k,withReset:!0,min:0,max:1,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:p||!r}),a.jsx(Xe,{label:h("controlnet.h"),value:l,onChange:y,handleReset:_,withReset:!0,min:0,max:1,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:p||!r})]})},lae=d.memo(iae),L_=bo.normalbae_image_processor.default,cae=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s}=n,i=qo(),l=L(En),{t:u}=Z(),p=d.useCallback(b=>{i(t,{detect_resolution:b})},[t,i]),h=d.useCallback(b=>{i(t,{image_resolution:b})},[t,i]),m=d.useCallback(()=>{i(t,{detect_resolution:L_.detect_resolution})},[t,i]),v=d.useCallback(()=>{i(t,{image_resolution:L_.image_resolution})},[t,i]);return a.jsxs(Xo,{children:[a.jsx(Xe,{label:u("controlnet.detectResolution"),value:s,onChange:p,handleReset:m,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:l||!r}),a.jsx(Xe,{label:u("controlnet.imageResolution"),value:o,onChange:h,handleReset:v,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:l||!r})]})},uae=d.memo(cae),z_=bo.openpose_image_processor.default,dae=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,hand_and_face:i}=n,l=qo(),u=L(En),{t:p}=Z(),h=d.useCallback(x=>{l(t,{detect_resolution:x})},[t,l]),m=d.useCallback(x=>{l(t,{image_resolution:x})},[t,l]),v=d.useCallback(()=>{l(t,{detect_resolution:z_.detect_resolution})},[t,l]),b=d.useCallback(()=>{l(t,{image_resolution:z_.image_resolution})},[t,l]),y=d.useCallback(x=>{l(t,{hand_and_face:x.target.checked})},[t,l]);return a.jsxs(Xo,{children:[a.jsx(Xe,{label:p("controlnet.detectResolution"),value:s,onChange:h,handleReset:v,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:u||!r}),a.jsx(Xe,{label:p("controlnet.imageResolution"),value:o,onChange:m,handleReset:b,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:u||!r}),a.jsx(Vt,{label:p("controlnet.handAndFace"),isChecked:i,onChange:y,isDisabled:u||!r})]})},fae=d.memo(dae),F_=bo.pidi_image_processor.default,pae=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,scribble:i,safe:l}=n,u=qo(),p=L(En),{t:h}=Z(),m=d.useCallback(k=>{u(t,{detect_resolution:k})},[t,u]),v=d.useCallback(k=>{u(t,{image_resolution:k})},[t,u]),b=d.useCallback(()=>{u(t,{detect_resolution:F_.detect_resolution})},[t,u]),y=d.useCallback(()=>{u(t,{image_resolution:F_.image_resolution})},[t,u]),x=d.useCallback(k=>{u(t,{scribble:k.target.checked})},[t,u]),w=d.useCallback(k=>{u(t,{safe:k.target.checked})},[t,u]);return a.jsxs(Xo,{children:[a.jsx(Xe,{label:h("controlnet.detectResolution"),value:s,onChange:m,handleReset:b,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:p||!r}),a.jsx(Xe,{label:h("controlnet.imageResolution"),value:o,onChange:v,handleReset:y,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:p||!r}),a.jsx(Vt,{label:h("controlnet.scribble"),isChecked:i,onChange:x}),a.jsx(Vt,{label:h("controlnet.safe"),isChecked:l,onChange:w,isDisabled:p||!r})]})},hae=d.memo(pae),mae=e=>null,gae=d.memo(mae),vae=e=>{const{controlNetId:t,isEnabled:n,processorNode:r}=e.controlNet;return r.type==="canny_image_processor"?a.jsx(qse,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="hed_image_processor"?a.jsx(Zse,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="lineart_image_processor"?a.jsx(nae,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="content_shuffle_image_processor"?a.jsx(Yse,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="lineart_anime_image_processor"?a.jsx(eae,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="mediapipe_face_processor"?a.jsx(oae,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="midas_depth_image_processor"?a.jsx(aae,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="mlsd_image_processor"?a.jsx(lae,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="normalbae_image_processor"?a.jsx(uae,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="openpose_image_processor"?a.jsx(fae,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="pidi_image_processor"?a.jsx(hae,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="zoe_depth_image_processor"?a.jsx(gae,{controlNetId:t,processorNode:r,isEnabled:n}):null},bae=d.memo(vae),xae=e=>{const{controlNetId:t,isEnabled:n,shouldAutoConfig:r}=e.controlNet,o=ee(),s=L(En),{t:i}=Z(),l=d.useCallback(()=>{o(ER({controlNetId:t}))},[t,o]);return a.jsx(Vt,{label:i("controlnet.autoConfigure"),"aria-label":i("controlnet.autoConfigure"),isChecked:r,onChange:l,isDisabled:s||!n})},yae=d.memo(xae),Cae=e=>{const{controlNet:t}=e,n=ee(),{t:r}=Z(),o=d.useCallback(()=>{n(MR({controlNet:t}))},[t,n]),s=d.useCallback(()=>{n(OR({controlNet:t}))},[t,n]);return a.jsxs($,{sx:{gap:2},children:[a.jsx(Te,{size:"sm",icon:a.jsx(Ui,{}),tooltip:r("controlnet.importImageFromCanvas"),"aria-label":r("controlnet.importImageFromCanvas"),onClick:o}),a.jsx(Te,{size:"sm",icon:a.jsx(zE,{}),tooltip:r("controlnet.importMaskFromCanvas"),"aria-label":r("controlnet.importMaskFromCanvas"),onClick:s})]})},wae=d.memo(Cae),B_=e=>`${Math.round(e*100)}%`,Sae=e=>{const{beginStepPct:t,endStepPct:n,isEnabled:r,controlNetId:o}=e.controlNet,s=ee(),{t:i}=Z(),l=d.useCallback(u=>{s(DR({controlNetId:o,beginStepPct:u[0]})),s(RR({controlNetId:o,endStepPct:u[1]}))},[o,s]);return a.jsxs(sn,{isDisabled:!r,children:[a.jsx(Hn,{children:i("controlnet.beginEndStepPercent")}),a.jsx(Om,{w:"100%",gap:2,alignItems:"center",children:a.jsxs(Nx,{"aria-label":["Begin Step %","End Step %!"],value:[t,n],onChange:l,min:0,max:1,step:.01,minStepsBetweenThumbs:5,isDisabled:!r,children:[a.jsx(Tx,{children:a.jsx($x,{})}),a.jsx(Rt,{label:B_(t),placement:"top",hasArrow:!0,children:a.jsx(od,{index:0})}),a.jsx(Rt,{label:B_(n),placement:"top",hasArrow:!0,children:a.jsx(od,{index:1})}),a.jsx(Pi,{value:0,sx:{insetInlineStart:"0 !important",insetInlineEnd:"unset !important"},children:"0%"}),a.jsx(Pi,{value:.5,sx:{insetInlineStart:"50% !important",transform:"translateX(-50%)"},children:"50%"}),a.jsx(Pi,{value:1,sx:{insetInlineStart:"unset !important",insetInlineEnd:"0 !important"},children:"100%"})]})})]})},kae=d.memo(Sae);function _ae(e){const{controlMode:t,isEnabled:n,controlNetId:r}=e.controlNet,o=ee(),{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(AR({controlNetId:r,controlMode:u}))},[r,o]);return a.jsx(In,{disabled:!n,label:s("controlnet.controlMode"),data:i,value:String(t),onChange:l})}const jae=ie(Oy,e=>rr(bo,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)),we),Pae=e=>{const t=ee(),{controlNetId:n,isEnabled:r,processorNode:o}=e.controlNet,s=L(En),i=L(jae),{t:l}=Z(),u=d.useCallback(p=>{t(NR({controlNetId:n,processorType:p}))},[n,t]);return a.jsx(Kt,{label:l("controlnet.processor"),value:o.type??"canny_image_processor",data:i,onChange:u,disabled:s||!r})},Iae=d.memo(Pae);function Eae(e){const{resizeMode:t,isEnabled:n,controlNetId:r}=e.controlNet,o=ee(),{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(TR({controlNetId:r,resizeMode:u}))},[r,o]);return a.jsx(In,{disabled:!n,label:s("controlnet.resizeMode"),data:i,value:String(t),onChange:l})}const Mae=e=>{const{controlNet:t}=e,{controlNetId:n}=t,r=ee(),{t:o}=Z(),s=L(wn),i=ie(xe,({controlNet:y})=>{const x=y.controlNets[n];if(!x)return{isEnabled:!1,shouldAutoConfig:!1};const{isEnabled:w,shouldAutoConfig:k}=x;return{isEnabled:w,shouldAutoConfig:k}},we),{isEnabled:l,shouldAutoConfig:u}=L(i),[p,h]=sJ(!1),m=d.useCallback(()=>{r($R({controlNetId:n}))},[n,r]),v=d.useCallback(()=>{r(LR({sourceControlNetId:n,newControlNetId:Ba()}))},[n,r]),b=d.useCallback(()=>{r(zR({controlNetId:n}))},[n,r]);return a.jsxs($,{sx:{flexDir:"column",gap:3,p:2,borderRadius:"base",position:"relative",bg:"base.250",_dark:{bg:"base.750"}},children:[a.jsxs($,{sx:{gap:2,alignItems:"center"},children:[a.jsx(Vt,{tooltip:o("controlnet.toggleControlNet"),"aria-label":o("controlnet.toggleControlNet"),isChecked:l,onChange:b}),a.jsx(Ie,{sx:{w:"full",minW:0,opacity:l?1:.5,pointerEvents:l?"auto":"none",transitionProperty:"common",transitionDuration:"0.1s"},children:a.jsx(Hse,{controlNet:t})}),s==="unifiedCanvas"&&a.jsx(wae,{controlNet:t}),a.jsx(Te,{size:"sm",tooltip:o("controlnet.duplicate"),"aria-label":o("controlnet.duplicate"),onClick:v,icon:a.jsx(Wc,{})}),a.jsx(Te,{size:"sm",tooltip:o("controlnet.delete"),"aria-label":o("controlnet.delete"),colorScheme:"error",onClick:m,icon:a.jsx(Kr,{})}),a.jsx(Te,{size:"sm",tooltip:o(p?"controlnet.hideAdvanced":"controlnet.showAdvanced"),"aria-label":o(p?"controlnet.hideAdvanced":"controlnet.showAdvanced"),onClick:h,variant:"ghost",sx:{_hover:{bg:"none"}},icon:a.jsx(dg,{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($,{sx:{w:"full",flexDirection:"column",gap:3},children:[a.jsxs($,{sx:{gap:4,w:"full",alignItems:"center"},children:[a.jsxs($,{sx:{flexDir:"column",gap:3,h:28,w:"full",paddingInlineStart:1,paddingInlineEnd:p?1:0,pb:2,justifyContent:"space-between"},children:[a.jsx(Vse,{controlNet:t}),a.jsx(kae,{controlNet:t})]}),!p&&a.jsx($,{sx:{alignItems:"center",justifyContent:"center",h:28,w:28,aspectRatio:"1/1"},children:a.jsx(O_,{controlNet:t,isSmall:!0})})]}),a.jsxs($,{sx:{gap:2},children:[a.jsx(_ae,{controlNet:t}),a.jsx(Eae,{controlNet:t})]}),a.jsx(Iae,{controlNet:t})]}),p&&a.jsxs(a.Fragment,{children:[a.jsx(O_,{controlNet:t}),a.jsx(yae,{controlNet:t}),a.jsx(bae,{controlNet:t})]})]})},Oae=d.memo(Mae),H_=e=>`${Math.round(e*100)}%`,Dae=()=>{const e=L(i=>i.controlNet.isIPAdapterEnabled),t=L(i=>i.controlNet.ipAdapterInfo.beginStepPct),n=L(i=>i.controlNet.ipAdapterInfo.endStepPct),r=ee(),{t:o}=Z(),s=d.useCallback(i=>{r(FR(i[0])),r(BR(i[1]))},[r]);return a.jsxs(sn,{isDisabled:!e,children:[a.jsx(Hn,{children:o("controlnet.beginEndStepPercent")}),a.jsx(Om,{w:"100%",gap:2,alignItems:"center",children:a.jsxs(Nx,{"aria-label":["Begin Step %","End Step %!"],value:[t,n],onChange:s,min:0,max:1,step:.01,minStepsBetweenThumbs:5,isDisabled:!e,children:[a.jsx(Tx,{children:a.jsx($x,{})}),a.jsx(Rt,{label:H_(t),placement:"top",hasArrow:!0,children:a.jsx(od,{index:0})}),a.jsx(Rt,{label:H_(n),placement:"top",hasArrow:!0,children:a.jsx(od,{index:1})}),a.jsx(Pi,{value:0,sx:{insetInlineStart:"0 !important",insetInlineEnd:"unset !important"},children:"0%"}),a.jsx(Pi,{value:.5,sx:{insetInlineStart:"50% !important",transform:"translateX(-50%)"},children:"50%"}),a.jsx(Pi,{value:1,sx:{insetInlineStart:"unset !important",insetInlineEnd:"0 !important"},children:"100%"})]})})]})},Rae=d.memo(Dae),Aae=ie(xe,e=>{const{isIPAdapterEnabled:t}=e.controlNet;return{isIPAdapterEnabled:t}},we),Nae=()=>{const{isIPAdapterEnabled:e}=L(Aae),t=ee(),{t:n}=Z(),r=d.useCallback(()=>{t(HR())},[t]);return a.jsx(Vt,{label:n("controlnet.enableIPAdapter"),isChecked:e,onChange:r,formControlProps:{width:"100%"}})},Tae=d.memo(Nae),$ae=()=>{var u;const e=L(p=>p.controlNet.ipAdapterInfo),t=L(p=>p.controlNet.isIPAdapterEnabled),n=ee(),{t:r}=Z(),{currentData:o}=Wr(((u=e.adapterImage)==null?void 0:u.image_name)??Er.skipToken),s=d.useMemo(()=>{if(o)return{id:"ip-adapter-image",payloadType:"IMAGE_DTO",payload:{imageDTO:o}}},[o]),i=d.useMemo(()=>({id:"ip-adapter-image",actionType:"SET_IP_ADAPTER_IMAGE"}),[]),l=d.useMemo(()=>({type:"SET_IP_ADAPTER_IMAGE"}),[]);return a.jsxs($,{sx:{position:"relative",w:"full",alignItems:"center",justifyContent:"center"},children:[a.jsx(oa,{imageDTO:o,droppableData:i,draggableData:s,postUploadAction:l,isUploadDisabled:!t,isDropDisabled:!t,dropLabel:r("toast.setIPAdapterImage"),noContentFallback:a.jsx(Kn,{label:r("controlnet.ipAdapterImageFallback")})}),a.jsx(Di,{onClick:()=>n(WR(null)),icon:e.adapterImage?a.jsx(Ud,{}):void 0,tooltip:r("controlnet.resetIPAdapterImage")})]})},Lae=d.memo($ae),zae=()=>{const e=L(u=>u.controlNet.ipAdapterInfo.model),t=L(u=>u.generation.model),n=ee(),{t:r}=Z(),{data:o}=r5(),s=d.useMemo(()=>(o==null?void 0:o.entities[`${e==null?void 0:e.base_model}/ip_adapter/${e==null?void 0:e.model_name}`])??null,[e==null?void 0:e.base_model,e==null?void 0:e.model_name,o==null?void 0:o.entities]),i=d.useMemo(()=>{if(!o)return[];const u=[];return Pn(o.entities,(p,h)=>{if(!p)return;const m=(t==null?void 0:t.base_model)!==p.base_model;u.push({value:h,label:p.model_name,group:on[p.base_model],disabled:m,tooltip:m?`Incompatible base model: ${p.base_model}`:void 0})}),u.sort((p,h)=>p.disabled&&!h.disabled?1:-1)},[o,t==null?void 0:t.base_model]),l=d.useCallback(u=>{if(!u)return;const p=kO(u);p&&n(VR(p))},[n]);return a.jsx(In,{label:r("controlnet.ipAdapterModel"),className:"nowheel nodrag",tooltip:s==null?void 0:s.description,value:(s==null?void 0:s.id)??null,placeholder:"Pick one",error:!s,data:i,onChange:l,sx:{width:"100%"}})},Fae=d.memo(zae),Bae=()=>{const e=L(i=>i.controlNet.isIPAdapterEnabled),t=L(i=>i.controlNet.ipAdapterInfo.weight),n=ee(),{t:r}=Z(),o=d.useCallback(i=>{n(ew(i))},[n]),s=d.useCallback(()=>{n(ew(1))},[n]);return a.jsx(Xe,{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})},Hae=d.memo(Bae),Wae=()=>a.jsxs($,{sx:{flexDir:"column",gap:3,paddingInline:3,paddingBlock:2,paddingBottom:5,borderRadius:"base",position:"relative",bg:"base.250",_dark:{bg:"base.750"}},children:[a.jsx(Tae,{}),a.jsx(Lae,{}),a.jsx(Fae,{}),a.jsx(Hae,{}),a.jsx(Rae,{})]}),Vae=d.memo(Wae),Uae=ie(xe,e=>{const{isEnabled:t}=e.controlNet;return{isEnabled:t}},we),Gae=()=>{const{isEnabled:e}=L(Uae),t=ee(),n=d.useCallback(()=>{t(UR())},[t]);return a.jsx(Vt,{label:"Enable ControlNet",isChecked:e,onChange:n,formControlProps:{width:"100%"}})},Kae=d.memo(Gae),qae=ie([xe],({controlNet:e})=>{const{controlNets:t,isEnabled:n,isIPAdapterEnabled:r}=e,o=GR(t);let s;return n&&o.length>0&&(s=`${o.length} ControlNet`),r&&(s?s=`${s}, IP Adapter`:s="IP Adapter"),{controlNetsArray:rr(t),activeLabel:s}},we),Xae=()=>{const{controlNetsArray:e,activeLabel:t}=L(qae),n=Xt("controlNet").isFeatureDisabled,r=ee(),{firstModel:o}=Gb(void 0,{selectFromResult:i=>({firstModel:i.data?KR.getSelectors().selectAll(i.data)[0]:void 0})}),s=d.useCallback(()=>{if(!o)return;const i=Ba();r(qR({controlNetId:i})),r(a5({controlNetId:i,model:o}))},[r,o]);return n?null:a.jsx(hr,{label:"Control Adapters",activeLabel:t,children:a.jsxs($,{sx:{flexDir:"column",gap:2},children:[a.jsxs($,{sx:{w:"100%",gap:2,p:2,ps:3,borderRadius:"base",alignItems:"center",bg:"base.250",_dark:{bg:"base.750"}},children:[a.jsx(Kae,{}),a.jsx(Te,{tooltip:"Add ControlNet","aria-label":"Add ControlNet",icon:a.jsx(ol,{}),isDisabled:!o,flexGrow:1,size:"sm",onClick:s})]}),e.map((i,l)=>a.jsxs(d.Fragment,{children:[l>0&&a.jsx(Vr,{}),a.jsx(Oae,{controlNet:i})]},i.controlNetId)),a.jsx(Vae,{})]})})},Xc=d.memo(Xae),Yae=ie(xe,e=>{const{shouldUseNoiseSettings:t,shouldUseCpuNoise:n}=e.generation;return{isDisabled:!t,shouldUseCpuNoise:n}},we),Qae=()=>{const e=ee(),{isDisabled:t,shouldUseCpuNoise:n}=L(Yae),{t:r}=Z(),o=s=>e(XR(s.target.checked));return a.jsx(Vt,{isDisabled:t,label:r("parameters.useCpuNoise"),isChecked:n,onChange:o})},Zae=ie(xe,e=>{const{shouldUseNoiseSettings:t,threshold:n}=e.generation;return{isDisabled:!t,threshold:n}},we);function Jae(){const e=ee(),{threshold:t,isDisabled:n}=L(Zae),{t:r}=Z();return a.jsx(Xe,{isDisabled:n,label:r("parameters.noiseThreshold"),min:0,max:20,step:.1,onChange:o=>e(tw(o)),handleReset:()=>e(tw(0)),value:t,withInput:!0,withReset:!0,withSliderMarks:!0})}const eie=()=>{const e=ee(),{t}=Z(),n=L(o=>o.generation.shouldUseNoiseSettings),r=o=>e(YR(o.target.checked));return a.jsx(Vt,{label:t("parameters.enableNoiseSettings"),isChecked:n,onChange:r})},tie=ie(xe,e=>{const{shouldUseNoiseSettings:t,perlin:n}=e.generation;return{isDisabled:!t,perlin:n}},we);function nie(){const e=ee(),{perlin:t,isDisabled:n}=L(tie),{t:r}=Z();return a.jsx(Xe,{isDisabled:n,label:r("parameters.perlinNoise"),min:0,max:1,step:.05,onChange:o=>e(nw(o)),handleReset:()=>e(nw(0)),value:t,withInput:!0,withReset:!0,withSliderMarks:!0})}const rie=ie(xe,e=>{const{shouldUseNoiseSettings:t}=e.generation;return{activeLabel:t?"Enabled":void 0}},we),oie=()=>{const{t:e}=Z(),t=Xt("noise").isFeatureEnabled,n=Xt("perlinNoise").isFeatureEnabled,r=Xt("noiseThreshold").isFeatureEnabled,{activeLabel:o}=L(rie);return t?a.jsx(hr,{label:e("parameters.noiseSettings"),activeLabel:o,children:a.jsxs($,{sx:{gap:2,flexDirection:"column"},children:[a.jsx(eie,{}),a.jsx(Qae,{}),n&&a.jsx(nie,{}),r&&a.jsx(Jae,{})]})}):null},Yd=d.memo(oie),qr=e=>e.generation,sie=ie(qr,e=>{const{seamlessXAxis:t}=e;return{seamlessXAxis:t}},we),aie=()=>{const{t:e}=Z(),{seamlessXAxis:t}=L(sie),n=ee(),r=d.useCallback(o=>{n(QR(o.target.checked))},[n]);return a.jsx(Vt,{label:e("parameters.seamlessXAxis"),"aria-label":e("parameters.seamlessXAxis"),isChecked:t,onChange:r})},iie=d.memo(aie),lie=ie(qr,e=>{const{seamlessYAxis:t}=e;return{seamlessYAxis:t}},we),cie=()=>{const{t:e}=Z(),{seamlessYAxis:t}=L(lie),n=ee(),r=d.useCallback(o=>{n(ZR(o.target.checked))},[n]);return a.jsx(Vt,{label:e("parameters.seamlessYAxis"),"aria-label":e("parameters.seamlessYAxis"),isChecked:t,onChange:r})},uie=d.memo(cie),die=(e,t)=>{if(e&&t)return"X & Y";if(e)return"X";if(t)return"Y"},fie=ie(qr,e=>{const{seamlessXAxis:t,seamlessYAxis:n}=e;return{activeLabel:die(t,n)}},we),pie=()=>{const{t:e}=Z(),{activeLabel:t}=L(fie);return Xt("seamless").isFeatureEnabled?a.jsx(hr,{label:e("parameters.seamlessTiling"),activeLabel:t,children:a.jsxs($,{sx:{gap:5},children:[a.jsx(Ie,{flexGrow:1,children:a.jsx(iie,{})}),a.jsx(Ie,{flexGrow:1,children:a.jsx(uie,{})})]})}):null},Yc=d.memo(pie),hie=e=>{const{onClick:t}=e,{t:n}=Z();return a.jsx(Te,{size:"sm","aria-label":n("embedding.addEmbedding"),tooltip:n("embedding.addEmbedding"),icon:a.jsx(DE,{}),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})},Ig=d.memo(hie),mie="28rem",gie=e=>{const{onSelect:t,isOpen:n,onClose:r,children:o}=e,{data:s}=JR(),i=d.useRef(null),{t:l}=Z(),u=L(m=>m.generation.model),p=d.useMemo(()=>{if(!s)return[];const m=[];return Pn(s.entities,(v,b)=>{if(!v)return;const y=(u==null?void 0:u.base_model)!==v.base_model;m.push({value:v.model_name,label:v.model_name,group:on[v.base_model],disabled:y,tooltip:y?`${l("embedding.incompatibleModel")} ${v.base_model}`:void 0})}),m.sort((v,b)=>{var y;return v.label&&b.label?(y=v.label)!=null&&y.localeCompare(b.label)?-1:1:-1}),m.sort((v,b)=>v.disabled&&!b.disabled?1:-1)},[s,u==null?void 0:u.base_model,l]),h=d.useCallback(m=>{m&&t(m)},[t]);return a.jsxs(Fm,{initialFocusRef:i,isOpen:n,onClose:r,placement:"bottom",openDelay:0,closeDelay:0,closeOnBlur:!0,returnFocusOnClose:!0,children:[a.jsx(Rx,{children:o}),a.jsx(Bm,{sx:{p:0,top:-1,shadow:"dark-lg",borderColor:"accent.300",borderWidth:"2px",borderStyle:"solid",_dark:{borderColor:"accent.400"}},children:a.jsx(Ax,{sx:{p:0,w:`calc(${mie} - 2rem )`},children:p.length===0?a.jsx($,{sx:{justifyContent:"center",p:2,fontSize:"sm",color:"base.500",_dark:{color:"base.700"}},children:a.jsx(ye,{children:"No Embeddings Loaded"})}):a.jsx(Kt,{inputRef:i,autoFocus:!0,placeholder:l("embedding.addEmbedding"),value:null,data:p,nothingFound:l("embedding.noMatchingEmbedding"),itemComponent:ri,disabled:p.length===0,onDropdownClose:r,filter:(m,v)=>{var b;return((b=v.label)==null?void 0:b.toLowerCase().includes(m.toLowerCase().trim()))||v.value.toLowerCase().includes(m.toLowerCase().trim())},onChange:h})})})]})},Eg=d.memo(gie),vie=()=>{const e=L(m=>m.generation.negativePrompt),t=d.useRef(null),{isOpen:n,onClose:r,onOpen:o}=Mr(),s=ee(),{t:i}=Z(),l=d.useCallback(m=>{s(zu(m.target.value))},[s]),u=d.useCallback(m=>{m.key==="<"&&o()},[o]),p=d.useCallback(m=>{if(!t.current)return;const v=t.current.selectionStart;if(v===void 0)return;let b=e.slice(0,v);b[b.length-1]!=="<"&&(b+="<"),b+=`${m}>`;const y=b.length;b+=e.slice(v),Fr.flushSync(()=>{s(zu(b))}),t.current.selectionEnd=y,r()},[s,r,e]),h=Xt("embedding").isFeatureEnabled;return a.jsxs(sn,{children:[a.jsx(Eg,{isOpen:n,onClose:r,onSelect:p,children:a.jsx(sa,{id:"negativePrompt",name:"negativePrompt",ref:t,value:e,placeholder:i("parameters.negativePromptPlaceholder"),onChange:l,resize:"vertical",fontSize:"sm",minH:16,...h&&{onKeyDown:u}})}),!n&&h&&a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineEnd:0},children:a.jsx(Ig,{onClick:o})})]})},jO=d.memo(vie),bie=ie([xe,wn],({generation:e},t)=>({prompt:e.positivePrompt,activeTabName:t}),{memoizeOptions:{resultEqualityCheck:_t}}),xie=()=>{const e=ee(),{prompt:t,activeTabName:n}=L(bie),r=Xd(),o=d.useRef(null),{isOpen:s,onClose:i,onOpen:l}=Mr(),{t:u}=Z(),p=d.useCallback(b=>{e(Lu(b.target.value))},[e]);Ze("alt+a",()=>{var b;(b=o.current)==null||b.focus()},[]);const h=d.useCallback(b=>{if(!o.current)return;const y=o.current.selectionStart;if(y===void 0)return;let x=t.slice(0,y);x[x.length-1]!=="<"&&(x+="<"),x+=`${b}>`;const w=x.length;x+=t.slice(y),Fr.flushSync(()=>{e(Lu(x))}),o.current.selectionStart=w,o.current.selectionEnd=w,i()},[e,i,t]),m=Xt("embedding").isFeatureEnabled,v=d.useCallback(b=>{b.key==="Enter"&&b.shiftKey===!1&&r&&(b.preventDefault(),e(wd()),e(bm(n))),m&&b.key==="<"&&l()},[r,e,n,l,m]);return a.jsxs(Ie,{position:"relative",children:[a.jsx(sn,{children:a.jsx(Eg,{isOpen:s,onClose:i,onSelect:h,children:a.jsx(sa,{id:"prompt",name:"prompt",ref:o,value:t,placeholder:u("parameters.positivePromptPlaceholder"),onChange:p,onKeyDown:v,resize:"vertical",minH:32})})}),!s&&m&&a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineEnd:0},children:a.jsx(Ig,{onClick:l})})]})},PO=d.memo(xie);function yie(){const e=L(o=>o.sdxl.shouldConcatSDXLStylePrompt),t=ee(),{t:n}=Z(),r=()=>{t(eA(!e))};return a.jsx(Te,{"aria-label":n("sdxl.concatPromptStyle"),tooltip:n("sdxl.concatPromptStyle"),variant:"outline",isChecked:e,onClick:r,icon:a.jsx($E,{}),size:"xs",sx:{position:"absolute",insetInlineEnd:1,top:6,border:"none",color:e?"accent.500":"base.500",_hover:{bg:"none"}}})}const W_={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 IO(){return a.jsxs($,{children:[a.jsx(Ie,{as:vn.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",...W_,_dark:{borderColor:"accent.500"}}}),a.jsx(Ie,{as:vn.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($E,{size:12})}),a.jsx(Ie,{as:vn.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",...W_,_dark:{borderColor:"accent.500"}}})]})}const Cie=ie([xe,wn],({sdxl:e},t)=>{const{negativeStylePrompt:n,shouldConcatSDXLStylePrompt:r}=e;return{prompt:n,shouldConcatSDXLStylePrompt:r,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:_t}}),wie=()=>{const e=ee(),t=Xd(),n=d.useRef(null),{isOpen:r,onClose:o,onOpen:s}=Mr(),{t:i}=Z(),{prompt:l,activeTabName:u,shouldConcatSDXLStylePrompt:p}=L(Cie),h=d.useCallback(y=>{e(Bu(y.target.value))},[e]),m=d.useCallback(y=>{if(!n.current)return;const x=n.current.selectionStart;if(x===void 0)return;let w=l.slice(0,x);w[w.length-1]!=="<"&&(w+="<"),w+=`${y}>`;const k=w.length;w+=l.slice(x),Fr.flushSync(()=>{e(Bu(w))}),n.current.selectionStart=k,n.current.selectionEnd=k,o()},[e,o,l]),v=Xt("embedding").isFeatureEnabled,b=d.useCallback(y=>{y.key==="Enter"&&y.shiftKey===!1&&t&&(y.preventDefault(),e(wd()),e(bm(u))),v&&y.key==="<"&&s()},[t,e,u,s,v]);return a.jsxs(Ie,{position:"relative",children:[a.jsx(nr,{children:p&&a.jsx(Ie,{sx:{position:"absolute",left:"3",w:"94%",top:"-17px"},children:a.jsx(IO,{})})}),a.jsx(sn,{children:a.jsx(Eg,{isOpen:r,onClose:o,onSelect:m,children:a.jsx(sa,{id:"prompt",name:"prompt",ref:n,value:l,placeholder:i("sdxl.negStylePrompt"),onChange:h,onKeyDown:b,resize:"vertical",fontSize:"sm",minH:16})})}),!r&&v&&a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineEnd:0},children:a.jsx(Ig,{onClick:s})})]})},Sie=d.memo(wie),kie=ie([xe,wn],({sdxl:e},t)=>{const{positiveStylePrompt:n,shouldConcatSDXLStylePrompt:r}=e;return{prompt:n,shouldConcatSDXLStylePrompt:r,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:_t}}),_ie=()=>{const e=ee(),t=Xd(),n=d.useRef(null),{isOpen:r,onClose:o,onOpen:s}=Mr(),{t:i}=Z(),{prompt:l,activeTabName:u,shouldConcatSDXLStylePrompt:p}=L(kie),h=d.useCallback(y=>{e(Fu(y.target.value))},[e]),m=d.useCallback(y=>{if(!n.current)return;const x=n.current.selectionStart;if(x===void 0)return;let w=l.slice(0,x);w[w.length-1]!=="<"&&(w+="<"),w+=`${y}>`;const k=w.length;w+=l.slice(x),Fr.flushSync(()=>{e(Fu(w))}),n.current.selectionStart=k,n.current.selectionEnd=k,o()},[e,o,l]),v=Xt("embedding").isFeatureEnabled,b=d.useCallback(y=>{y.key==="Enter"&&y.shiftKey===!1&&t&&(y.preventDefault(),e(wd()),e(bm(u))),v&&y.key==="<"&&s()},[t,e,u,s,v]);return a.jsxs(Ie,{position:"relative",children:[a.jsx(nr,{children:p&&a.jsx(Ie,{sx:{position:"absolute",left:"3",w:"94%",top:"-17px"},children:a.jsx(IO,{})})}),a.jsx(sn,{children:a.jsx(Eg,{isOpen:r,onClose:o,onSelect:m,children:a.jsx(sa,{id:"prompt",name:"prompt",ref:n,value:l,placeholder:i("sdxl.posStylePrompt"),onChange:h,onKeyDown:b,resize:"vertical",minH:16})})}),!r&&v&&a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineEnd:0},children:a.jsx(Ig,{onClick:s})})]})},jie=d.memo(_ie);function By(){return a.jsxs($,{sx:{flexDirection:"column",gap:2},children:[a.jsx(PO,{}),a.jsx(yie,{}),a.jsx(jie,{}),a.jsx(jO,{}),a.jsx(Sie,{})]})}const al=()=>{const{isRefinerAvailable:e}=Bo(Kb,{selectFromResult:({data:t})=>({isRefinerAvailable:t?t.ids.length>0:!1})});return e},Pie=ie([xe],({sdxl:e,ui:t,hotkeys:n})=>{const{refinerCFGScale:r}=e,{shouldUseSliders:o}=t,{shift:s}=n;return{refinerCFGScale:r,shouldUseSliders:o,shift:s}},we),Iie=()=>{const{refinerCFGScale:e,shouldUseSliders:t,shift:n}=L(Pie),r=al(),o=ee(),{t:s}=Z(),i=d.useCallback(u=>o(i1(u)),[o]),l=d.useCallback(()=>o(i1(7)),[o]);return t?a.jsx(Xe,{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(Gc,{label:s("sdxl.cfgScale"),step:.5,min:1,max:200,onChange:i,value:e,isInteger:!1,numberInputFieldProps:{textAlign:"center"},isDisabled:!r})},Eie=d.memo(Iie),Mie=e=>{const t=Yi("models"),[n,r,o]=e.split("/"),s=tA.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},Oie=ie(xe,e=>({model:e.sdxl.refinerModel}),we),Die=()=>{const e=ee(),t=Xt("syncModels").isFeatureEnabled,{model:n}=L(Oie),{t:r}=Z(),{data:o,isLoading:s}=Bo(Kb),i=d.useMemo(()=>{if(!o)return[];const p=[];return Pn(o.entities,(h,m)=>{h&&p.push({value:m,label:h.model_name,group:on[h.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 h=Mie(p);h&&e(qj(h))},[e]);return s?a.jsx(Kt,{label:r("sdxl.refinermodel"),placeholder:r("sdxl.loading"),disabled:!0,data:[]}):a.jsxs($,{w:"100%",alignItems:"center",gap:2,children:[a.jsx(Kt,{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(Uc,{iconMode:!0})})]})},Rie=d.memo(Die),Aie=ie([xe],({sdxl:e,hotkeys:t})=>{const{refinerNegativeAestheticScore:n}=e,{shift:r}=t;return{refinerNegativeAestheticScore:n,shift:r}},we),Nie=()=>{const{refinerNegativeAestheticScore:e,shift:t}=L(Aie),n=al(),r=ee(),{t:o}=Z(),s=d.useCallback(l=>r(c1(l)),[r]),i=d.useCallback(()=>r(c1(2.5)),[r]);return a.jsx(Xe,{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})},Tie=d.memo(Nie),$ie=ie([xe],({sdxl:e,hotkeys:t})=>{const{refinerPositiveAestheticScore:n}=e,{shift:r}=t;return{refinerPositiveAestheticScore:n,shift:r}},we),Lie=()=>{const{refinerPositiveAestheticScore:e,shift:t}=L($ie),n=al(),r=ee(),{t:o}=Z(),s=d.useCallback(l=>r(l1(l)),[r]),i=d.useCallback(()=>r(l1(6)),[r]);return a.jsx(Xe,{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})},zie=d.memo(Lie),Fie=ie(xe,({ui:e,sdxl:t})=>{const{refinerScheduler:n}=t,{favoriteSchedulers:r}=e,o=rr(hm,(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}},we),Bie=()=>{const e=ee(),{t}=Z(),{refinerScheduler:n,data:r}=L(Fie),o=al(),s=d.useCallback(i=>{i&&e(Xj(i))},[e]);return a.jsx(Kt,{w:"100%",label:t("sdxl.scheduler"),value:n,data:r,onChange:s,disabled:!o})},Hie=d.memo(Bie),Wie=ie([xe],({sdxl:e})=>{const{refinerStart:t}=e;return{refinerStart:t}},we),Vie=()=>{const{refinerStart:e}=L(Wie),t=ee(),n=al(),r=d.useCallback(i=>t(u1(i)),[t]),{t:o}=Z(),s=d.useCallback(()=>t(u1(.8)),[t]);return a.jsx(Xe,{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})},Uie=d.memo(Vie),Gie=ie([xe],({sdxl:e,ui:t})=>{const{refinerSteps:n}=e,{shouldUseSliders:r}=t;return{refinerSteps:n,shouldUseSliders:r}},we),Kie=()=>{const{refinerSteps:e,shouldUseSliders:t}=L(Gie),n=al(),r=ee(),{t:o}=Z(),s=d.useCallback(l=>{r(a1(l))},[r]),i=d.useCallback(()=>{r(a1(20))},[r]);return t?a.jsx(Xe,{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(Gc,{label:o("sdxl.steps"),min:1,max:500,step:1,onChange:s,value:e,numberInputFieldProps:{textAlign:"center"},isDisabled:!n})},qie=d.memo(Kie);function Xie(){const e=L(s=>s.sdxl.shouldUseSDXLRefiner),t=al(),n=ee(),{t:r}=Z(),o=s=>{n(nA(s.target.checked))};return a.jsx(Vt,{label:r("sdxl.useRefiner"),isChecked:e,onChange:o,isDisabled:!t})}const Yie=ie(xe,e=>{const{shouldUseSDXLRefiner:t}=e.sdxl,{shouldUseSliders:n}=e.ui;return{activeLabel:t?"Enabled":void 0,shouldUseSliders:n}},we),Qie=()=>{const{activeLabel:e,shouldUseSliders:t}=L(Yie),{t:n}=Z();return a.jsx(hr,{label:n("sdxl.refiner"),activeLabel:e,children:a.jsxs($,{sx:{gap:2,flexDir:"column"},children:[a.jsx(Xie,{}),a.jsx(Rie,{}),a.jsxs($,{gap:2,flexDirection:t?"column":"row",children:[a.jsx(qie,{}),a.jsx(Eie,{})]}),a.jsx(Hie,{}),a.jsx(zie,{}),a.jsx(Tie,{}),a.jsx(Uie,{})]})})},Hy=d.memo(Qie),Zie=ie([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:h}=r;return{cfgScale:u,initial:o,min:s,sliderMax:i,inputMax:l,shouldUseSliders:p,shift:h}},we),Jie=()=>{const{cfgScale:e,initial:t,min:n,sliderMax:r,inputMax:o,shouldUseSliders:s,shift:i}=L(Zie),l=ee(),{t:u}=Z(),p=d.useCallback(m=>l(Gp(m)),[l]),h=d.useCallback(()=>l(Gp(t)),[l,t]);return s?a.jsx(Xe,{label:u("parameters.cfgScale"),step:i?.1:.5,min:n,max:r,onChange:p,handleReset:h,value:e,sliderNumberInputProps:{max:o},withInput:!0,withReset:!0,withSliderMarks:!0,isInteger:!1}):a.jsx(Gc,{label:u("parameters.cfgScale"),step:.5,min:n,max:o,onChange:p,value:e,isInteger:!1,numberInputFieldProps:{textAlign:"center"}})},xs=d.memo(Jie),ele=ie([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.dynamicPrompts.isEnabled&&e.dynamicPrompts.combinatorial,h=e.hotkeys.shift?s:i;return{iterations:l,initial:t,min:n,sliderMax:r,inputMax:o,step:h,shouldUseSliders:u,isDisabled:p}},we),tle=()=>{const{iterations:e,initial:t,min:n,sliderMax:r,inputMax:o,step:s,shouldUseSliders:i,isDisabled:l}=L(ele),u=ee(),{t:p}=Z(),h=d.useCallback(v=>{u(rw(v))},[u]),m=d.useCallback(()=>{u(rw(t))},[u,t]);return i?a.jsx(Xe,{isDisabled:l,label:p("parameters.images"),step:s,min:n,max:r,onChange:h,handleReset:m,value:e,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:o}}):a.jsx(Gc,{isDisabled:l,label:p("parameters.images"),step:s,min:n,max:o,onChange:h,value:e,numberInputFieldProps:{textAlign:"center"}})},ys=d.memo(tle),nle=ie(xe,e=>({model:e.generation.model}),we),rle=()=>{const e=ee(),{t}=Z(),{model:n}=L(nle),r=Xt("syncModels").isFeatureEnabled,{data:o,isLoading:s}=Bo(ow),{data:i,isLoading:l}=Yu(ow),u=L(wn),p=d.useMemo(()=>{if(!o)return[];const v=[];return Pn(o.entities,(b,y)=>{b&&v.push({value:y,label:b.model_name,group:on[b.base_model]})}),Pn(i==null?void 0:i.entities,(b,y)=>{!b||u==="unifiedCanvas"||u==="img2img"||v.push({value:y,label:b.model_name,group:on[b.base_model]})}),v},[o,i,u]),h=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]),m=d.useCallback(v=>{if(!v)return;const b=Pg(v);b&&e(o1(b))},[e]);return s||l?a.jsx(Kt,{label:t("modelManager.model"),placeholder:"Loading...",disabled:!0,data:[]}):a.jsxs($,{w:"100%",alignItems:"center",gap:3,children:[a.jsx(Kt,{tooltip:h==null?void 0:h.description,label:t("modelManager.model"),value:h==null?void 0:h.id,placeholder:p.length>0?"Select a model":"No models available",data:p,error:p.length===0,disabled:p.length===0,onChange:m,w:"100%"}),r&&a.jsx(Ie,{mt:7,children:a.jsx(Uc,{iconMode:!0})})]})},ole=d.memo(rle),sle=ie(xe,({generation:e})=>{const{model:t,vae:n}=e;return{model:t,vae:n}},we),ale=()=>{const e=ee(),{t}=Z(),{model:n,vae:r}=L(sle),{data:o}=n5(),s=d.useMemo(()=>{if(!o)return[];const u=[{value:"default",label:"Default",group:"Default"}];return Pn(o.entities,(p,h)=>{if(!p)return;const m=(n==null?void 0:n.base_model)!==p.base_model;u.push({value:h,label:p.model_name,group:on[p.base_model],disabled:m,tooltip:m?`Incompatible base model: ${p.base_model}`:void 0})}),u.sort((p,h)=>p.disabled&&!h.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(sw(null));return}const p=SO(u);p&&e(sw(p))},[e]);return a.jsx(Kt,{itemComponent:ri,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})},ile=d.memo(ale),lle=ie([qb,qr],(e,t)=>{const{scheduler:n}=t,{favoriteSchedulers:r}=e,o=rr(hm,(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}},we),cle=()=>{const e=ee(),{t}=Z(),{scheduler:n,data:r}=L(lle),o=d.useCallback(s=>{s&&e(s1(s))},[e]);return a.jsx(Kt,{label:t("parameters.scheduler"),value:n,data:r,onChange:o})},ule=d.memo(cle),dle=ie(xe,({generation:e})=>{const{vaePrecision:t}=e;return{vaePrecision:t}},we),fle=["fp16","fp32"],ple=()=>{const e=ee(),{vaePrecision:t}=L(dle),n=d.useCallback(r=>{r&&e(rA(r))},[e]);return a.jsx(In,{label:"VAE Precision",value:t,data:fle,onChange:n})},hle=d.memo(ple),mle=()=>{const e=Xt("vae").isFeatureEnabled;return a.jsxs($,{gap:3,w:"full",flexWrap:e?"wrap":"nowrap",children:[a.jsx(Ie,{w:"full",children:a.jsx(ole,{})}),a.jsx(Ie,{w:"full",children:a.jsx(ule,{})}),e&&a.jsxs($,{w:"full",gap:3,children:[a.jsx(ile,{}),a.jsx(hle,{})]})]})},Cs=d.memo(mle),EO=[{name:"Free",value:null},{name:"2:3",value:2/3},{name:"16:9",value:16/9},{name:"1:1",value:1/1}],MO=EO.map(e=>e.value);function OO(){const e=L(o=>o.generation.aspectRatio),t=ee(),n=L(o=>o.generation.shouldFitToWidthHeight),r=L(wn);return a.jsx($,{gap:2,flexGrow:1,children:a.jsx(mn,{isAttached:!0,children:EO.map(o=>a.jsx(it,{size:"sm",isChecked:e===o.value,isDisabled:r==="img2img"?!n:!1,onClick:()=>{t(Do(o.value)),t(Qu(!1))},children:o.name},o.name))})})}const gle=ie([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:h}=e,m=t.shift?i:l;return{model:u,height:p,min:r,sliderMax:o,inputMax:s,step:m,aspectRatio:h}},we),vle=e=>{const{model:t,height:n,min:r,sliderMax:o,inputMax:s,step:i,aspectRatio:l}=L(gle),u=ee(),{t:p}=Z(),h=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,m=d.useCallback(b=>{if(u($i(b)),l){const y=fr(b*l,8);u(Ti(y))}},[u,l]),v=d.useCallback(()=>{if(u($i(h)),l){const b=fr(h*l,8);u(Ti(b))}},[u,h,l]);return a.jsx(Xe,{label:p("parameters.height"),value:n,min:r,step:i,max:o,onChange:m,handleReset:v,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:s},...e})},ble=d.memo(vle),xle=ie([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:h}=e,m=t.shift?i:l;return{model:u,width:p,min:r,sliderMax:o,inputMax:s,step:m,aspectRatio:h}},we),yle=e=>{const{model:t,width:n,min:r,sliderMax:o,inputMax:s,step:i,aspectRatio:l}=L(xle),u=ee(),{t:p}=Z(),h=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,m=d.useCallback(b=>{if(u(Ti(b)),l){const y=fr(b/l,8);u($i(y))}},[u,l]),v=d.useCallback(()=>{if(u(Ti(h)),l){const b=fr(h/l,8);u($i(b))}},[u,h,l]);return a.jsx(Xe,{label:p("parameters.width"),value:n,min:r,step:i,max:o,onChange:m,handleReset:v,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:s},...e})},Cle=d.memo(yle),wle=ie([qr,wn],(e,t)=>{const{shouldFitToWidthHeight:n,shouldLockAspectRatio:r,width:o,height:s}=e;return{activeTabName:t,shouldFitToWidthHeight:n,shouldLockAspectRatio:r,width:o,height:s}});function Oc(){const{t:e}=Z(),t=ee(),{activeTabName:n,shouldFitToWidthHeight:r,shouldLockAspectRatio:o,width:s,height:i}=L(wle),l=d.useCallback(()=>{o?(t(Qu(!1)),MO.includes(s/i)?t(Do(s/i)):t(Do(null))):(t(Qu(!0)),t(Do(s/i)))},[o,s,i,t]),u=d.useCallback(()=>{t(oA()),t(Do(null)),o&&t(Do(i/s))},[t,o,s,i]);return a.jsxs($,{sx:{gap:2,p:4,borderRadius:4,flexDirection:"column",w:"full",bg:"base.150",_dark:{bg:"base.750"}},children:[a.jsxs($,{alignItems:"center",gap:2,children:[a.jsx(ye,{sx:{fontSize:"sm",width:"full",color:"base.700",_dark:{color:"base.300"}},children:e("parameters.aspectRatio")}),a.jsx(Za,{}),a.jsx(OO,{}),a.jsx(Te,{tooltip:e("ui.swapSizes"),"aria-label":e("ui.swapSizes"),size:"sm",icon:a.jsx(VM,{}),fontSize:20,isDisabled:n==="img2img"?!r:!1,onClick:u}),a.jsx(Te,{tooltip:e("ui.lockRatio"),"aria-label":e("ui.lockRatio"),size:"sm",icon:a.jsx(LE,{}),isChecked:o,isDisabled:n==="img2img"?!r:!1,onClick:l})]}),a.jsx($,{gap:2,alignItems:"center",children:a.jsxs($,{gap:2,flexDirection:"column",width:"full",children:[a.jsx(Cle,{isDisabled:n==="img2img"?!r:!1}),a.jsx(ble,{isDisabled:n==="img2img"?!r:!1})]})})]})}const Sle=ie([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:h}=e,{shouldUseSliders:m}=n,v=r.shift?u:p;return{steps:h,initial:o,min:s,sliderMax:i,inputMax:l,step:v,shouldUseSliders:m}},we),kle=()=>{const{steps:e,initial:t,min:n,sliderMax:r,inputMax:o,step:s,shouldUseSliders:i}=L(Sle),l=ee(),{t:u}=Z(),p=d.useCallback(v=>{l(Kp(v))},[l]),h=d.useCallback(()=>{l(Kp(t))},[l,t]),m=d.useCallback(()=>{l(wd())},[l]);return i?a.jsx(Xe,{label:u("parameters.steps"),min:n,max:r,step:s,onChange:p,handleReset:h,value:e,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:o}}):a.jsx(Gc,{label:u("parameters.steps"),min:n,max:o,step:s,onChange:p,value:e,numberInputFieldProps:{textAlign:"center"},onBlur:m})},ws=d.memo(kle);function DO(){const e=ee(),t=L(o=>o.generation.shouldFitToWidthHeight),n=o=>e(sA(o.target.checked)),{t:r}=Z();return a.jsx(Vt,{label:r("parameters.imageFit"),isChecked:t,onChange:n})}function _le(){const e=L(i=>i.generation.seed),t=L(i=>i.generation.shouldRandomizeSeed),n=L(i=>i.generation.shouldGenerateVariations),{t:r}=Z(),o=ee(),s=i=>o(Up(i));return a.jsx(Gc,{label:r("parameters.seed"),step:1,precision:0,flexGrow:1,min:i5,max:l5,isDisabled:t,isInvalid:e<0&&n,onChange:s,value:e})}const jle=(e,t)=>Math.floor(Math.random()*(t-e+1)+e);function Ple(){const e=ee(),t=L(o=>o.generation.shouldRandomizeSeed),{t:n}=Z(),r=()=>e(Up(jle(i5,l5)));return a.jsx(Te,{size:"sm",isDisabled:t,"aria-label":n("parameters.shuffle"),tooltip:n("parameters.shuffle"),onClick:r,icon:a.jsx(GZ,{})})}const Ile=()=>{const e=ee(),{t}=Z(),n=L(o=>o.generation.shouldRandomizeSeed),r=o=>e(aA(o.target.checked));return a.jsx(Vt,{label:t("common.random"),isChecked:n,onChange:r})},Ele=d.memo(Ile),Mle=()=>a.jsxs($,{sx:{gap:3,alignItems:"flex-end"},children:[a.jsx(_le,{}),a.jsx(Ple,{}),a.jsx(Ele,{})]}),Ss=d.memo(Mle),RO=e=>a.jsxs($,{sx:{flexDir:"column",gap:2,bg:"base.100",px:4,pt:2,pb:4,borderRadius:"base",_dark:{bg:"base.750"}},children:[e.label&&a.jsx(ye,{fontSize:"sm",fontWeight:"bold",sx:{color:"base.600",_dark:{color:"base.300"}},children:e.label}),e.children]});RO.displayName="SubSettingsWrapper";const Dc=d.memo(RO),Ole=ie([xe],({sdxl:e})=>{const{sdxlImg2ImgDenoisingStrength:t}=e;return{sdxlImg2ImgDenoisingStrength:t}},we),Dle=()=>{const{sdxlImg2ImgDenoisingStrength:e}=L(Ole),t=ee(),{t:n}=Z(),r=d.useCallback(s=>t(aw(s)),[t]),o=d.useCallback(()=>{t(aw(.7))},[t]);return a.jsx(Dc,{children:a.jsx(Xe,{label:n("sdxl.denoisingStrength"),step:.01,min:0,max:1,onChange:r,handleReset:o,value:e,isInteger:!1,withInput:!0,withSliderMarks:!0,withReset:!0})})},AO=d.memo(Dle),Rle=ie([qb,qr],(e,t)=>{const{shouldUseSliders:n}=e,{shouldRandomizeSeed:r}=t;return{shouldUseSliders:n,activeLabel:r?void 0:"Manual Seed"}},we),Ale=()=>{const{shouldUseSliders:e,activeLabel:t}=L(Rle);return a.jsx(hr,{label:"General",activeLabel:t,defaultIsOpen:!0,children:a.jsxs($,{sx:{flexDirection:"column",gap:3},children:[e?a.jsxs(a.Fragment,{children:[a.jsx(ys,{}),a.jsx(ws,{}),a.jsx(xs,{}),a.jsx(Cs,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ss,{})}),a.jsx(Oc,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs($,{gap:3,children:[a.jsx(ys,{}),a.jsx(ws,{}),a.jsx(xs,{})]}),a.jsx(Cs,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ss,{})}),a.jsx(Oc,{})]}),a.jsx(AO,{}),a.jsx(DO,{})]})})},Nle=d.memo(Ale),Tle=()=>a.jsxs(a.Fragment,{children:[a.jsx(By,{}),a.jsx(Nle,{}),a.jsx(Hy,{}),a.jsx(Xc,{}),a.jsx(qc,{}),a.jsx(Kc,{}),a.jsx(Yd,{}),a.jsx(Yc,{})]}),$le=d.memo(Tle),Lle=ie(xe,({ui:e,generation:t})=>{const{shouldUseSliders:n}=e,{shouldRandomizeSeed:r}=t;return{shouldUseSliders:n,activeLabel:r?void 0:"Manual Seed"}},we),zle=()=>{const{shouldUseSliders:e,activeLabel:t}=L(Lle);return a.jsx(hr,{label:"General",activeLabel:t,defaultIsOpen:!0,children:a.jsx($,{sx:{flexDirection:"column",gap:3},children:e?a.jsxs(a.Fragment,{children:[a.jsx(ys,{}),a.jsx(ws,{}),a.jsx(xs,{}),a.jsx(Cs,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ss,{})}),a.jsx(Oc,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs($,{gap:3,children:[a.jsx(ys,{}),a.jsx(ws,{}),a.jsx(xs,{})]}),a.jsx(Cs,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ss,{})}),a.jsx(Oc,{})]})})})},NO=d.memo(zle),Fle=()=>a.jsxs(a.Fragment,{children:[a.jsx(By,{}),a.jsx(NO,{}),a.jsx(Hy,{}),a.jsx(Xc,{}),a.jsx(qc,{}),a.jsx(Kc,{}),a.jsx(Yd,{}),a.jsx(Yc,{})]}),Ble=d.memo(Fle),Hle=[{label:"Unmasked",value:"unmasked"},{label:"Mask",value:"mask"},{label:"Mask Edge",value:"edge"}],Wle=()=>{const e=ee(),t=L(o=>o.generation.canvasCoherenceMode),{t:n}=Z(),r=o=>{o&&e(iA(o))};return a.jsx(In,{label:n("parameters.coherenceMode"),data:Hle,value:t,onChange:r})},Vle=d.memo(Wle),Ule=()=>{const e=ee(),t=L(r=>r.generation.canvasCoherenceSteps),{t:n}=Z();return a.jsx(Xe,{label:n("parameters.coherenceSteps"),min:1,max:100,step:1,sliderNumberInputProps:{max:999},value:t,onChange:r=>{e(iw(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(iw(20))}})},Gle=d.memo(Ule),Kle=()=>{const e=ee(),t=L(r=>r.generation.canvasCoherenceStrength),{t:n}=Z();return a.jsx(Xe,{label:n("parameters.coherenceStrength"),min:0,max:1,step:.01,sliderNumberInputProps:{max:999},value:t,onChange:r=>{e(lw(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(lw(.3))}})},qle=d.memo(Kle);function Xle(){const e=ee(),t=L(r=>r.generation.maskBlur),{t:n}=Z();return a.jsx(Xe,{label:n("parameters.maskBlur"),min:0,max:64,sliderNumberInputProps:{max:512},value:t,onChange:r=>{e(cw(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(cw(16))}})}const Yle=[{label:"Box Blur",value:"box"},{label:"Gaussian Blur",value:"gaussian"}];function Qle(){const e=L(o=>o.generation.maskBlurMethod),t=ee(),{t:n}=Z(),r=o=>{o&&t(lA(o))};return a.jsx(In,{value:e,onChange:r,label:n("parameters.maskBlurMethod"),data:Yle})}const Zle=()=>{const{t:e}=Z();return a.jsx(hr,{label:e("parameters.compositingSettingsHeader"),children:a.jsxs($,{sx:{flexDirection:"column",gap:2},children:[a.jsxs(Dc,{label:e("parameters.coherencePassHeader"),children:[a.jsx(Vle,{}),a.jsx(Gle,{}),a.jsx(qle,{})]}),a.jsx(Vr,{}),a.jsxs(Dc,{label:e("parameters.maskAdjustmentsHeader"),children:[a.jsx(Xle,{}),a.jsx(Qle,{})]})]})})},TO=d.memo(Zle),Jle=ie([xe],({generation:e})=>{const{infillMethod:t}=e;return{infillMethod:t}},we),ece=()=>{const e=ee(),{infillMethod:t}=L(Jle),{data:n,isLoading:r}=Hj(),o=n==null?void 0:n.infill_methods,{t:s}=Z(),i=d.useCallback(l=>{e(cA(l))},[e]);return a.jsx(In,{disabled:(o==null?void 0:o.length)===0,placeholder:r?"Loading...":void 0,label:s("parameters.infillMethod"),value:t,data:o??[],onChange:i})},tce=d.memo(ece),nce=ie([qr],e=>{const{infillPatchmatchDownscaleSize:t,infillMethod:n}=e;return{infillPatchmatchDownscaleSize:t,infillMethod:n}},we),rce=()=>{const e=ee(),{infillPatchmatchDownscaleSize:t,infillMethod:n}=L(nce),{t:r}=Z(),o=d.useCallback(i=>{e(uw(i))},[e]),s=d.useCallback(()=>{e(uw(2))},[e]);return a.jsx(Xe,{isDisabled:n!=="patchmatch",label:r("parameters.patchmatchDownScaleSize"),min:1,max:10,value:t,onChange:o,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:s})},oce=d.memo(rce),sce=ie([qr],e=>{const{infillTileSize:t,infillMethod:n}=e;return{infillTileSize:t,infillMethod:n}},we),ace=()=>{const e=ee(),{infillTileSize:t,infillMethod:n}=L(sce),{t:r}=Z(),o=d.useCallback(i=>{e(dw(i))},[e]),s=d.useCallback(()=>{e(dw(32))},[e]);return a.jsx(Xe,{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})},ice=d.memo(ace),lce=ie([qr],e=>{const{infillMethod:t}=e;return{infillMethod:t}},we);function cce(){const{infillMethod:e}=L(lce);return a.jsxs($,{children:[e==="tile"&&a.jsx(ice,{}),e==="patchmatch"&&a.jsx(oce,{})]})}const Lt=e=>e.canvas,Co=ie([Lt,wn,xo],(e,t,n)=>e.layerState.stagingArea.images.length>0||t==="unifiedCanvas"&&n.isProcessing),uce=ie([Lt],e=>{const{boundingBoxScaleMethod:t}=e;return{boundingBoxScale:t}},we),dce=()=>{const e=ee(),{boundingBoxScale:t}=L(uce),{t:n}=Z(),r=o=>{e(dA(o))};return a.jsx(Kt,{label:n("parameters.scaleBeforeProcessing"),data:uA,value:t,onChange:r})},fce=d.memo(dce),pce=ie([qr,Lt],(e,t)=>{const{scaledBoundingBoxDimensions:n,boundingBoxScaleMethod:r}=t,{model:o,aspectRatio:s}=e;return{model:o,scaledBoundingBoxDimensions:n,isManual:r==="manual",aspectRatio:s}},we),hce=()=>{const e=ee(),{model:t,isManual:n,scaledBoundingBoxDimensions:r,aspectRatio:o}=L(pce),s=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,{t:i}=Z(),l=p=>{let h=r.width;const m=Math.floor(p);o&&(h=fr(m*o,64)),e(Xp({width:h,height:m}))},u=()=>{let p=r.width;const h=Math.floor(s);o&&(p=fr(h*o,64)),e(Xp({width:p,height:h}))};return a.jsx(Xe,{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})},mce=d.memo(hce),gce=ie([Lt,qr],(e,t)=>{const{boundingBoxScaleMethod:n,scaledBoundingBoxDimensions:r}=e,{model:o,aspectRatio:s}=t;return{model:o,scaledBoundingBoxDimensions:r,aspectRatio:s,isManual:n==="manual"}},we),vce=()=>{const e=ee(),{model:t,isManual:n,scaledBoundingBoxDimensions:r,aspectRatio:o}=L(gce),s=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,{t:i}=Z(),l=p=>{const h=Math.floor(p);let m=r.height;o&&(m=fr(h/o,64)),e(Xp({width:h,height:m}))},u=()=>{const p=Math.floor(s);let h=r.height;o&&(h=fr(p/o,64)),e(Xp({width:p,height:h}))};return a.jsx(Xe,{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})},bce=d.memo(vce),xce=()=>{const{t:e}=Z();return a.jsx(hr,{label:e("parameters.infillScalingHeader"),children:a.jsxs($,{sx:{gap:2,flexDirection:"column"},children:[a.jsxs(Dc,{children:[a.jsx(tce,{}),a.jsx(cce,{})]}),a.jsx(Vr,{}),a.jsxs(Dc,{children:[a.jsx(fce,{}),a.jsx(bce,{}),a.jsx(mce,{})]})]})})},$O=d.memo(xce),yce=ie([xe,Co],({canvas:e,generation:t},n)=>{const{boundingBoxDimensions:r}=e,{model:o,aspectRatio:s}=t;return{model:o,boundingBoxDimensions:r,isStaging:n,aspectRatio:s}},we),Cce=()=>{const e=ee(),{model:t,boundingBoxDimensions:n,isStaging:r,aspectRatio:o}=L(yce),{t:s}=Z(),i=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,l=p=>{if(e(No({...n,height:Math.floor(p)})),o){const h=fr(p*o,64);e(No({width:h,height:Math.floor(p)}))}},u=()=>{if(e(No({...n,height:Math.floor(i)})),o){const p=fr(i*o,64);e(No({width:p,height:Math.floor(i)}))}};return a.jsx(Xe,{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})},wce=d.memo(Cce),Sce=ie([xe,Co],({canvas:e,generation:t},n)=>{const{boundingBoxDimensions:r}=e,{model:o,aspectRatio:s}=t;return{model:o,boundingBoxDimensions:r,isStaging:n,aspectRatio:s}},we),kce=()=>{const e=ee(),{model:t,boundingBoxDimensions:n,isStaging:r,aspectRatio:o}=L(Sce),s=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,{t:i}=Z(),l=p=>{if(e(No({...n,width:Math.floor(p)})),o){const h=fr(p/o,64);e(No({width:Math.floor(p),height:h}))}},u=()=>{if(e(No({...n,width:Math.floor(s)})),o){const p=fr(s/o,64);e(No({width:Math.floor(s),height:p}))}};return a.jsx(Xe,{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})},_ce=d.memo(kce),jce=ie([qr,Lt],(e,t)=>{const{shouldFitToWidthHeight:n,shouldLockAspectRatio:r}=e,{boundingBoxDimensions:o}=t;return{shouldFitToWidthHeight:n,shouldLockAspectRatio:r,boundingBoxDimensions:o}});function cm(){const e=ee(),{t}=Z(),{shouldLockAspectRatio:n,boundingBoxDimensions:r}=L(jce),o=d.useCallback(()=>{n?(e(Qu(!1)),MO.includes(r.width/r.height)?e(Do(r.width/r.height)):e(Do(null))):(e(Qu(!0)),e(Do(r.width/r.height)))},[n,r,e]),s=d.useCallback(()=>{e(fA()),e(Do(null)),n&&e(Do(r.height/r.width))},[e,n,r]);return a.jsxs($,{sx:{gap:2,p:4,borderRadius:4,flexDirection:"column",w:"full",bg:"base.100",_dark:{bg:"base.750"}},children:[a.jsxs($,{alignItems:"center",gap:2,children:[a.jsx(ye,{sx:{fontSize:"sm",width:"full",color:"base.700",_dark:{color:"base.300"}},children:t("parameters.aspectRatio")}),a.jsx(Za,{}),a.jsx(OO,{}),a.jsx(Te,{tooltip:t("ui.swapSizes"),"aria-label":t("ui.swapSizes"),size:"sm",icon:a.jsx(VM,{}),fontSize:20,onClick:s}),a.jsx(Te,{tooltip:t("ui.lockRatio"),"aria-label":t("ui.lockRatio"),size:"sm",icon:a.jsx(LE,{}),isChecked:n,onClick:o})]}),a.jsx(_ce,{}),a.jsx(wce,{})]})}const Pce=ie(xe,({ui:e,generation:t})=>{const{shouldUseSliders:n}=e,{shouldRandomizeSeed:r}=t;return{shouldUseSliders:n,activeLabel:r?void 0:"Manual Seed"}},we),Ice=()=>{const{shouldUseSliders:e,activeLabel:t}=L(Pce);return a.jsx(hr,{label:"General",activeLabel:t,defaultIsOpen:!0,children:a.jsxs($,{sx:{flexDirection:"column",gap:3},children:[e?a.jsxs(a.Fragment,{children:[a.jsx(ys,{}),a.jsx(ws,{}),a.jsx(xs,{}),a.jsx(Cs,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ss,{})}),a.jsx(cm,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs($,{gap:3,children:[a.jsx(ys,{}),a.jsx(ws,{}),a.jsx(xs,{})]}),a.jsx(Cs,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ss,{})}),a.jsx(cm,{})]}),a.jsx(AO,{})]})})},Ece=d.memo(Ice);function Mce(){return a.jsxs(a.Fragment,{children:[a.jsx(By,{}),a.jsx(Ece,{}),a.jsx(Hy,{}),a.jsx(Xc,{}),a.jsx(qc,{}),a.jsx(Kc,{}),a.jsx(Yd,{}),a.jsx($O,{}),a.jsx(TO,{}),a.jsx(Yc,{})]})}function Oce(){const e=L(u=>u.generation.clipSkip),{model:t}=L(u=>u.generation),n=ee(),{t:r}=Z(),o=d.useCallback(u=>{n(fw(u))},[n]),s=d.useCallback(()=>{n(fw(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 a.jsx(Xe,{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 Dce=ie(xe,e=>({activeLabel:e.generation.clipSkip>0?"Clip Skip":void 0}),we);function Wy(){const{activeLabel:e}=L(Dce),t=L(r=>r.generation.shouldShowAdvancedOptions),{t:n}=Z();return t?a.jsx(hr,{label:n("common.advanced"),activeLabel:e,children:a.jsx($,{sx:{flexDir:"column",gap:2},children:a.jsx(Oce,{})})}):null}function Vy(){return a.jsxs($,{sx:{flexDirection:"column",gap:2},children:[a.jsx(PO,{}),a.jsx(jO,{})]})}function Rce(){const e=L(o=>o.generation.horizontalSymmetrySteps),t=L(o=>o.generation.steps),n=ee(),{t:r}=Z();return a.jsx(Xe,{label:r("parameters.hSymmetryStep"),value:e,onChange:o=>n(pw(o)),min:0,max:t,step:1,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>n(pw(0))})}function Ace(){const e=L(o=>o.generation.verticalSymmetrySteps),t=L(o=>o.generation.steps),n=ee(),{t:r}=Z();return a.jsx(Xe,{label:r("parameters.vSymmetryStep"),value:e,onChange:o=>n(hw(o)),min:0,max:t,step:1,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>n(hw(0))})}function Nce(){const e=L(n=>n.generation.shouldUseSymmetry),t=ee();return a.jsx(Vt,{label:"Enable Symmetry",isChecked:e,onChange:n=>t(pA(n.target.checked))})}const Tce=ie(xe,e=>({activeLabel:e.generation.shouldUseSymmetry?"Enabled":void 0}),we),$ce=()=>{const{t:e}=Z(),{activeLabel:t}=L(Tce);return Xt("symmetry").isFeatureEnabled?a.jsx(hr,{label:e("parameters.symmetry"),activeLabel:t,children:a.jsxs($,{sx:{gap:2,flexDirection:"column"},children:[a.jsx(Nce,{}),a.jsx(Rce,{}),a.jsx(Ace,{})]})}):null},Uy=d.memo($ce),Lce=ie([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,h=t.shift?l:u;return{img2imgStrength:p,initial:r,min:o,sliderMax:s,inputMax:i,step:h}},we),zce=()=>{const{img2imgStrength:e,initial:t,min:n,sliderMax:r,inputMax:o,step:s}=L(Lce),i=ee(),{t:l}=Z(),u=d.useCallback(h=>i(qp(h)),[i]),p=d.useCallback(()=>{i(qp(t))},[i,t]);return a.jsx(Dc,{children:a.jsx(Xe,{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}})})},LO=d.memo(zce),Fce=ie([qb,qr],(e,t)=>{const{shouldUseSliders:n}=e,{shouldRandomizeSeed:r}=t;return{shouldUseSliders:n,activeLabel:r?void 0:"Manual Seed"}},we),Bce=()=>{const{shouldUseSliders:e,activeLabel:t}=L(Fce);return a.jsx(hr,{label:"General",activeLabel:t,defaultIsOpen:!0,children:a.jsxs($,{sx:{flexDirection:"column",gap:3},children:[e?a.jsxs(a.Fragment,{children:[a.jsx(ys,{}),a.jsx(ws,{}),a.jsx(xs,{}),a.jsx(Cs,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ss,{})}),a.jsx(Oc,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs($,{gap:3,children:[a.jsx(ys,{}),a.jsx(ws,{}),a.jsx(xs,{})]}),a.jsx(Cs,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ss,{})}),a.jsx(Oc,{})]}),a.jsx(LO,{}),a.jsx(DO,{})]})})},Hce=d.memo(Bce),Wce=()=>a.jsxs(a.Fragment,{children:[a.jsx(Vy,{}),a.jsx(Hce,{}),a.jsx(Xc,{}),a.jsx(qc,{}),a.jsx(Kc,{}),a.jsx(Yd,{}),a.jsx(Uy,{}),a.jsx(Yc,{}),a.jsx(Wy,{})]}),Vce=d.memo(Wce),Uce=()=>a.jsxs(a.Fragment,{children:[a.jsx(Vy,{}),a.jsx(NO,{}),a.jsx(Xc,{}),a.jsx(qc,{}),a.jsx(Kc,{}),a.jsx(Yd,{}),a.jsx(Uy,{}),a.jsx(Yc,{}),a.jsx(Wy,{})]}),Gce=d.memo(Uce),Kce=ie(xe,({ui:e,generation:t})=>{const{shouldUseSliders:n}=e,{shouldRandomizeSeed:r}=t;return{shouldUseSliders:n,activeLabel:r?void 0:"Manual Seed"}},we),qce=()=>{const{shouldUseSliders:e,activeLabel:t}=L(Kce);return a.jsx(hr,{label:"General",activeLabel:t,defaultIsOpen:!0,children:a.jsxs($,{sx:{flexDirection:"column",gap:3},children:[e?a.jsxs(a.Fragment,{children:[a.jsx(ys,{}),a.jsx(ws,{}),a.jsx(xs,{}),a.jsx(Cs,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ss,{})}),a.jsx(cm,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs($,{gap:3,children:[a.jsx(ys,{}),a.jsx(ws,{}),a.jsx(xs,{})]}),a.jsx(Cs,{}),a.jsx(Ie,{pt:2,children:a.jsx(Ss,{})}),a.jsx(cm,{})]}),a.jsx(LO,{})]})})},Xce=d.memo(qce),Yce=()=>a.jsxs(a.Fragment,{children:[a.jsx(Vy,{}),a.jsx(Xce,{}),a.jsx(Xc,{}),a.jsx(qc,{}),a.jsx(Kc,{}),a.jsx(Uy,{}),a.jsx($O,{}),a.jsx(TO,{}),a.jsx(Yc,{}),a.jsx(Wy,{})]}),Qce=d.memo(Yce),Zce=()=>{const e=L(wn),t=L(n=>n.generation.model);return e==="txt2img"?a.jsx(Hp,{children:t&&t.base_model==="sdxl"?a.jsx(Ble,{}):a.jsx(Gce,{})}):e==="img2img"?a.jsx(Hp,{children:t&&t.base_model==="sdxl"?a.jsx($le,{}):a.jsx(Vce,{})}):e==="unifiedCanvas"?a.jsx(Hp,{children:t&&t.base_model==="sdxl"?a.jsx(Mce,{}):a.jsx(Qce,{})}):null},Jce=d.memo(Zce),Hp=d.memo(e=>a.jsxs($,{sx:{w:"full",h:"full",flexDir:"column",gap:2},children:[a.jsx(XM,{}),a.jsx($,{layerStyle:"first",sx:{w:"full",h:"full",position:"relative",borderRadius:"base",p:2},children:a.jsx($,{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(ug,{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($,{sx:{gap:2,flexDirection:"column",h:"full",w:"full"},children:e.children})})})})})]}));Hp.displayName="ParametersPanelWrapper";const eue=ie([xe],e=>{const{initialImage:t}=e.generation;return{initialImage:t,isResetButtonDisabled:!t}},we),tue=()=>{const{initialImage:e}=L(eue),{currentData:t}=Wr((e==null?void 0:e.imageName)??Er.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(oa,{imageDTO:t,droppableData:r,draggableData:n,isUploadDisabled:!0,fitContainer:!0,dropLabel:"Set as Initial Image",noContentFallback:a.jsx(Kn,{label:"No initial image selected"})})},nue=d.memo(tue),rue=ie([xe],e=>{const{initialImage:t}=e.generation;return{isResetButtonDisabled:!t}},we),oue={type:"SET_INITIAL_IMAGE"},sue=()=>{const{isResetButtonDisabled:e}=L(rue),t=ee(),{getUploadButtonProps:n,getUploadInputProps:r}=Iy({postUploadAction:oue}),o=d.useCallback(()=>{t(hA())},[t]);return a.jsxs($,{layerStyle:"first",sx:{position:"relative",flexDirection:"column",height:"full",width:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",p:2,gap:4},children:[a.jsxs($,{sx:{w:"full",flexWrap:"wrap",justifyContent:"center",alignItems:"center",gap:2},children:[a.jsx(ye,{sx:{ps:2,fontWeight:600,userSelect:"none",color:"base.700",_dark:{color:"base.200"}},children:"Initial Image"}),a.jsx(Za,{}),a.jsx(Te,{tooltip:"Upload Initial Image","aria-label":"Upload Initial Image",icon:a.jsx(og,{}),...n()}),a.jsx(Te,{tooltip:"Reset Initial Image","aria-label":"Reset Initial Image",icon:a.jsx(Ud,{}),onClick:o,isDisabled:e})]}),a.jsx(nue,{}),a.jsx("input",{...r()})]})},aue=d.memo(sue),iue=ie([xe],({system:e})=>{const{isProcessing:t,isConnected:n}=e;return n&&!t}),lue=e=>{const{onClick:t,isDisabled:n}=e,{t:r}=Z(),o=L(iue);return a.jsx(Te,{onClick:t,icon:a.jsx(Kr,{}),tooltip:`${r("gallery.deleteImage")} (Del)`,"aria-label":`${r("gallery.deleteImage")} (Del)`,isDisabled:n||!o,colorScheme:"error"})},cue=[{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 uue(){const e=L(r=>r.postprocessing.esrganModelName),t=ee(),n=r=>t(mA(r));return a.jsx(In,{label:"ESRGAN Model",value:e,itemComponent:ri,onChange:n,data:cue})}const due=e=>{const{imageDTO:t}=e,n=ee(),r=L(En),{t:o}=Z(),{isOpen:s,onOpen:i,onClose:l}=Mr(),u=d.useCallback(()=>{l(),t&&n(c5({image_name:t.image_name}))},[n,t,l]);return a.jsx(qd,{isOpen:s,onClose:l,triggerComponent:a.jsx(Te,{onClick:i,icon:a.jsx(DZ,{}),"aria-label":o("parameters.upscale")}),children:a.jsxs($,{sx:{flexDirection:"column",gap:4},children:[a.jsx(uue,{}),a.jsx(it,{size:"sm",isDisabled:!t||r,onClick:u,children:o("parameters.upscaleImage")})]})})},fue=d.memo(due),pue=ie([xe,wn],({gallery:e,system:t,ui:n,config:r},o)=>{const{isProcessing:s,isConnected:i,shouldConfirmOnDelete:l,progressImage:u}=t,{shouldShowImageDetails:p,shouldHidePreview:h,shouldShowProgressInViewer:m}=n,{shouldFetchMetadataFromApi:v}=r,b=e.selection[e.selection.length-1];return{canDeleteImage:i&&!s,shouldConfirmOnDelete:l,isProcessing:s,isConnected:i,shouldDisableToolbarButtons:!!u||!b,shouldShowImageDetails:p,activeTabName:o,shouldHidePreview:h,shouldShowProgressInViewer:m,lastSelectedImage:b,shouldFetchMetadataFromApi:v}},{memoizeOptions:{resultEqualityCheck:_t}}),hue=e=>{const t=ee(),{isProcessing:n,isConnected:r,shouldDisableToolbarButtons:o,shouldShowImageDetails:s,lastSelectedImage:i,shouldShowProgressInViewer:l,shouldFetchMetadataFromApi:u}=L(pue),p=Xt("upscaling").isFeatureEnabled,h=tl(),{t:m}=Z(),{recallBothPrompts:v,recallSeed:b,recallAllParameters:y}=xg(),{currentData:x}=Wr((i==null?void 0:i.image_name)??Er.skipToken),w=d.useMemo(()=>i?{image:i,shouldFetchMetadataFromApi:u}:Er.skipToken,[i,u]),{metadata:k,workflow:_,isLoading:j}=Fb(w,{selectFromResult:F=>{var V,X;return{isLoading:F.isFetching,metadata:(V=F==null?void 0:F.currentData)==null?void 0:V.metadata,workflow:(X=F==null?void 0:F.currentData)==null?void 0:X.workflow}}}),I=d.useCallback(()=>{_&&t(Wb(_))},[t,_]),E=d.useCallback(()=>{y(k)},[k,y]);Ze("a",()=>{},[k,y]);const M=d.useCallback(()=>{b(k==null?void 0:k.seed)},[k==null?void 0:k.seed,b]);Ze("s",M,[x]);const D=d.useCallback(()=>{v(k==null?void 0:k.positive_prompt,k==null?void 0:k.negative_prompt,k==null?void 0:k.positive_style_prompt,k==null?void 0:k.negative_style_prompt)},[k==null?void 0:k.negative_prompt,k==null?void 0:k.positive_prompt,k==null?void 0:k.positive_style_prompt,k==null?void 0:k.negative_style_prompt,v]);Ze("p",D,[x]),Ze("w",I,[_]);const R=d.useCallback(()=>{t(UM()),t(gm(x))},[t,x]);Ze("shift+i",R,[x]);const A=d.useCallback(()=>{x&&t(c5({image_name:x.image_name}))},[t,x]),O=d.useCallback(()=>{x&&t(vm([x]))},[t,x]);Ze("Shift+U",()=>{A()},{enabled:()=>!!(p&&!o&&r&&!n)},[p,x,o,r,n]);const T=d.useCallback(()=>t(gA(!s)),[t,s]);Ze("i",()=>{x?T():h({title:m("toast.metadataLoadFailed"),status:"error",duration:2500,isClosable:!0})},[x,s,h]),Ze("delete",()=>{O()},[t,x]);const K=d.useCallback(()=>{t(Wj(!l))},[t,l]);return a.jsx(a.Fragment,{children:a.jsxs($,{sx:{flexWrap:"wrap",justifyContent:"center",alignItems:"center",gap:2},...e,children:[a.jsx(mn,{isAttached:!0,isDisabled:o,children:a.jsxs(Nd,{children:[a.jsx(Td,{as:Te,"aria-label":`${m("parameters.sendTo")}...`,tooltip:`${m("parameters.sendTo")}...`,isDisabled:!x,icon:a.jsx(QZ,{})}),a.jsx(Ka,{motionProps:vc,children:x&&a.jsx(GM,{imageDTO:x})})]})}),a.jsxs(mn,{isAttached:!0,isDisabled:o,children:[a.jsx(Te,{isLoading:j,icon:a.jsx(yg,{}),tooltip:`${m("nodes.loadWorkflow")} (W)`,"aria-label":`${m("nodes.loadWorkflow")} (W)`,isDisabled:!_,onClick:I}),a.jsx(Te,{isLoading:j,icon:a.jsx(FE,{}),tooltip:`${m("parameters.usePrompt")} (P)`,"aria-label":`${m("parameters.usePrompt")} (P)`,isDisabled:!(k!=null&&k.positive_prompt),onClick:D}),a.jsx(Te,{isLoading:j,icon:a.jsx(BE,{}),tooltip:`${m("parameters.useSeed")} (S)`,"aria-label":`${m("parameters.useSeed")} (S)`,isDisabled:!(k!=null&&k.seed),onClick:M}),a.jsx(Te,{isLoading:j,icon:a.jsx(ME,{}),tooltip:`${m("parameters.useAll")} (A)`,"aria-label":`${m("parameters.useAll")} (A)`,isDisabled:!k,onClick:E})]}),p&&a.jsx(mn,{isAttached:!0,isDisabled:o,children:p&&a.jsx(fue,{imageDTO:x})}),a.jsx(mn,{isAttached:!0,isDisabled:o,children:a.jsx(Te,{icon:a.jsx(DE,{}),tooltip:`${m("parameters.info")} (I)`,"aria-label":`${m("parameters.info")} (I)`,isChecked:s,onClick:T})}),a.jsx(mn,{isAttached:!0,children:a.jsx(Te,{"aria-label":m("settings.displayInProgress"),tooltip:m("settings.displayInProgress"),icon:a.jsx(zZ,{}),isChecked:l,onClick:K})}),a.jsx(mn,{isAttached:!0,children:a.jsx(lue,{onClick:O,isDisabled:o})})]})})},mue=d.memo(hue),gue=ie([xe,Vb],(e,t)=>{var _,j;const{data:n,status:r}=vA.endpoints.listImages.select(t)(e),{data:o}=e.gallery.galleryView==="images"?mw.endpoints.getBoardImagesTotal.select(t.board_id??"none")(e):mw.endpoints.getBoardAssetsTotal.select(t.board_id??"none")(e),s=e.gallery.selection[e.gallery.selection.length-1],i=r==="pending";if(!n||!s||o===0)return{isFetching:i,queryArgs:t,isOnFirstImage:!0,isOnLastImage:!0};const l={...t,offset:n.ids.length,limit:e5},u=bA.getSelectors(),p=u.selectAll(n),h=p.findIndex(I=>I.image_name===s.image_name),m=Ni(h+1,0,p.length-1),v=Ni(h-1,0,p.length-1),b=(_=p[m])==null?void 0:_.image_name,y=(j=p[v])==null?void 0:j.image_name,x=b?u.selectById(n,b):void 0,w=y?u.selectById(n,y):void 0,k=p.length;return{loadedImagesCount:p.length,currentImageIndex:h,areMoreImagesAvailable:(o??0)>k,isFetching:r==="pending",nextImage:x,prevImage:w,queryArgs:l}},{memoizeOptions:{resultEqualityCheck:_t}}),zO=()=>{const e=ee(),{nextImage:t,prevImage:n,areMoreImagesAvailable:r,isFetching:o,queryArgs:s,loadedImagesCount:i,currentImageIndex:l}=L(gue),u=d.useCallback(()=>{n&&e(gw(n))},[e,n]),p=d.useCallback(()=>{t&&e(gw(t))},[e,t]),[h]=Jj(),m=d.useCallback(()=>{h(s)},[h,s]);return{handlePrevImage:u,handleNextImage:p,isOnFirstImage:l===0,isOnLastImage:l!==void 0&&l===i-1,nextImage:t,prevImage:n,areMoreImagesAvailable:r,handleLoadMoreImages:m,isFetching:o}};function vue(e){return Ne({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 bue=({label:e,value:t,onClick:n,isLink:r,labelPosition:o,withCopy:s=!1})=>{const{t:i}=Z();return t?a.jsxs($,{gap:2,children:[n&&a.jsx(Rt,{label:`Recall ${e}`,children:a.jsx(ps,{"aria-label":i("accessibility.useThisParameter"),icon:a.jsx(vue,{}),size:"xs",variant:"ghost",fontSize:20,onClick:n})}),s&&a.jsx(Rt,{label:`Copy ${e}`,children:a.jsx(ps,{"aria-label":`Copy ${e}`,icon:a.jsx(Wc,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(t.toString())})}),a.jsxs($,{direction:o?"column":"row",children:[a.jsxs(ye,{fontWeight:"semibold",whiteSpace:"pre-wrap",pr:2,children:[e,":"]}),r?a.jsxs(Mm,{href:t.toString(),isExternal:!0,wordBreak:"break-all",children:[t.toString()," ",a.jsx(CM,{mx:"2px"})]}):a.jsx(ye,{overflowY:"scroll",wordBreak:"break-all",children:t.toString()})]})]}):null},$r=d.memo(bue),xue=e=>{const{metadata:t}=e,{t:n}=Z(),{recallPositivePrompt:r,recallNegativePrompt:o,recallSeed:s,recallCfgScale:i,recallModel:l,recallScheduler:u,recallSteps:p,recallWidth:h,recallHeight:m,recallStrength:v,recallLoRA:b}=xg(),y=d.useCallback(()=>{r(t==null?void 0:t.positive_prompt)},[t==null?void 0:t.positive_prompt,r]),x=d.useCallback(()=>{o(t==null?void 0:t.negative_prompt)},[t==null?void 0:t.negative_prompt,o]),w=d.useCallback(()=>{s(t==null?void 0:t.seed)},[t==null?void 0:t.seed,s]),k=d.useCallback(()=>{l(t==null?void 0:t.model)},[t==null?void 0:t.model,l]),_=d.useCallback(()=>{h(t==null?void 0:t.width)},[t==null?void 0:t.width,h]),j=d.useCallback(()=>{m(t==null?void 0:t.height)},[t==null?void 0:t.height,m]),I=d.useCallback(()=>{u(t==null?void 0:t.scheduler)},[t==null?void 0:t.scheduler,u]),E=d.useCallback(()=>{p(t==null?void 0:t.steps)},[t==null?void 0:t.steps,p]),M=d.useCallback(()=>{i(t==null?void 0:t.cfg_scale)},[t==null?void 0:t.cfg_scale,i]),D=d.useCallback(()=>{v(t==null?void 0:t.strength)},[t==null?void 0:t.strength,v]),R=d.useCallback(A=>{b(A)},[b]);return!t||Object.keys(t).length===0?null:a.jsxs(a.Fragment,{children:[t.created_by&&a.jsx($r,{label:n("metadata.createdBy"),value:t.created_by}),t.generation_mode&&a.jsx($r,{label:n("metadata.generationMode"),value:t.generation_mode}),t.positive_prompt&&a.jsx($r,{label:n("metadata.positivePrompt"),labelPosition:"top",value:t.positive_prompt,onClick:y}),t.negative_prompt&&a.jsx($r,{label:n("metadata.NegativePrompt"),labelPosition:"top",value:t.negative_prompt,onClick:x}),t.seed!==void 0&&t.seed!==null&&a.jsx($r,{label:n("metadata.seed"),value:t.seed,onClick:w}),t.model!==void 0&&t.model!==null&&t.model.model_name&&a.jsx($r,{label:n("metadata.model"),value:t.model.model_name,onClick:k}),t.width&&a.jsx($r,{label:n("metadata.width"),value:t.width,onClick:_}),t.height&&a.jsx($r,{label:n("metadata.height"),value:t.height,onClick:j}),t.scheduler&&a.jsx($r,{label:n("metadata.scheduler"),value:t.scheduler,onClick:I}),t.steps&&a.jsx($r,{label:n("metadata.steps"),value:t.steps,onClick:E}),t.cfg_scale!==void 0&&t.cfg_scale!==null&&a.jsx($r,{label:n("metadata.cfgScale"),value:t.cfg_scale,onClick:M}),t.strength&&a.jsx($r,{label:n("metadata.strength"),value:t.strength,onClick:D}),t.loras&&t.loras.map((A,O)=>{if(Kj(A.lora))return a.jsx($r,{label:"LoRA",value:`${A.lora.model_name} - ${A.weight}`,onClick:()=>R(A)},O)})]})},yue=d.memo(xue),Cue=({image:e})=>{const{t}=Z(),{shouldFetchMetadataFromApi:n}=L(Oy),{metadata:r,workflow:o}=Fb({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($,{layerStyle:"first",sx:{padding:4,gap:1,flexDirection:"column",width:"full",height:"full",borderRadius:"base",position:"absolute",overflow:"hidden"},children:[a.jsxs($,{gap:2,children:[a.jsx(ye,{fontWeight:"semibold",children:"File:"}),a.jsxs(Mm,{href:e.image_url,isExternal:!0,maxW:"calc(100% - 3rem)",children:[e.image_name,a.jsx(CM,{mx:"2px"})]})]}),a.jsx(yue,{metadata:r}),a.jsxs(Ji,{variant:"line",sx:{display:"flex",flexDir:"column",w:"full",h:"full"},children:[a.jsxs(el,{children:[a.jsx(Pr,{children:t("metadata.metadata")}),a.jsx(Pr,{children:t("metadata.imageDetails")}),a.jsx(Pr,{children:t("metadata.workflow")})]}),a.jsxs(Fc,{children:[a.jsx(mo,{children:r?a.jsx(Ri,{data:r,label:t("metadata.metadata")}):a.jsx(Kn,{label:t("metadata.noMetaData")})}),a.jsx(mo,{children:e?a.jsx(Ri,{data:e,label:t("metadata.imageDetails")}):a.jsx(Kn,{label:t("metadata.noImageDetails")})}),a.jsx(mo,{children:o?a.jsx(Ri,{data:o,label:t("metadata.workflow")}):a.jsx(Kn,{label:t("metadata.noWorkFlow")})})]})]})]})},wue=d.memo(Cue),Kv={color:"base.100",pointerEvents:"auto"},Sue=()=>{const{t:e}=Z(),{handlePrevImage:t,handleNextImage:n,isOnFirstImage:r,isOnLastImage:o,handleLoadMoreImages:s,areMoreImagesAvailable:i,isFetching:l}=zO();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(ps,{"aria-label":e("accessibility.previousImage"),icon:a.jsx(bZ,{size:64}),variant:"unstyled",onClick:t,boxSize:16,sx:Kv})}),a.jsxs(Ie,{sx:{pos:"absolute",top:"50%",transform:"translate(0, -50%)",insetInlineEnd:0},children:[!o&&a.jsx(ps,{"aria-label":e("accessibility.nextImage"),icon:a.jsx(xZ,{size:64}),variant:"unstyled",onClick:n,boxSize:16,sx:Kv}),o&&i&&!l&&a.jsx(ps,{"aria-label":e("accessibility.loadMore"),icon:a.jsx(vZ,{size:64}),variant:"unstyled",onClick:s,boxSize:16,sx:Kv}),o&&i&&l&&a.jsx($,{sx:{w:16,h:16,alignItems:"center",justifyContent:"center"},children:a.jsx(Xi,{opacity:.5,size:"xl"})})]})]})},FO=d.memo(Sue),kue=ie([xe,xA],({ui:e,system:t},n)=>{const{shouldShowImageDetails:r,shouldHidePreview:o,shouldShowProgressInViewer:s}=e,{progressImage:i,shouldAntialiasProgressImage:l}=t;return{shouldShowImageDetails:r,shouldHidePreview:o,imageName:n==null?void 0:n.image_name,progressImage:i,shouldShowProgressInViewer:s,shouldAntialiasProgressImage:l}},{memoizeOptions:{resultEqualityCheck:_t}}),_ue=()=>{const{shouldShowImageDetails:e,imageName:t,progressImage:n,shouldShowProgressInViewer:r,shouldAntialiasProgressImage:o}=L(kue),{handlePrevImage:s,handleNextImage:i,isOnLastImage:l,handleLoadMoreImages:u,areMoreImagesAvailable:p,isFetching:h}=zO();Ze("left",()=>{s()},[s]),Ze("right",()=>{if(l&&p&&!h){u();return}l||i()},[l,p,u,h,i]);const{currentData:m}=Wr(t??Er.skipToken),v=d.useMemo(()=>{if(m)return{id:"current-image",payloadType:"IMAGE_DTO",payload:{imageDTO:m}}},[m]),b=d.useMemo(()=>({id:"current-image",actionType:"SET_CURRENT_IMAGE"}),[]),[y,x]=d.useState(!1),w=d.useRef(0),{t:k}=Z(),_=d.useCallback(()=>{x(!0),window.clearTimeout(w.current)},[]),j=d.useCallback(()=>{w.current=window.setTimeout(()=>{x(!1)},500)},[]);return a.jsxs($,{onMouseOver:_,onMouseOut:j,sx:{width:"full",height:"full",alignItems:"center",justifyContent:"center",position:"relative"},children:[n&&r?a.jsx(Qi,{src:n.dataURL,width:n.width,height:n.height,draggable:!1,sx:{objectFit:"contain",maxWidth:"full",maxHeight:"full",height:"auto",position:"absolute",borderRadius:"base",imageRendering:o?"auto":"pixelated"}}):a.jsx(oa,{imageDTO:m,droppableData:b,draggableData:v,isUploadDisabled:!0,fitContainer:!0,useThumbailFallback:!0,dropLabel:k("gallery.setCurrentImage"),noContentFallback:a.jsx(Kn,{icon:Ui,label:"No image selected"})}),e&&m&&a.jsx(Ie,{sx:{position:"absolute",top:"0",width:"full",height:"full",borderRadius:"base"},children:a.jsx(wue,{image:m})}),a.jsx(nr,{children:!e&&m&&y&&a.jsx(vn.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(FO,{})},"nextPrevButtons")})]})},jue=d.memo(_ue),Pue=()=>a.jsxs($,{sx:{position:"relative",flexDirection:"column",height:"100%",width:"100%",rowGap:4,alignItems:"center",justifyContent:"center"},children:[a.jsx(mue,{}),a.jsx(jue,{})]}),Iue=d.memo(Pue),Eue=()=>a.jsx(Ie,{layerStyle:"first",sx:{position:"relative",width:"100%",height:"100%",p:2,borderRadius:"base"},children:a.jsx($,{sx:{width:"100%",height:"100%"},children:a.jsx(Iue,{})})}),BO=d.memo(Eue),Mue=()=>{const e=d.useRef(null),t=d.useCallback(()=>{e.current&&e.current.setLayout([50,50])},[]),n=Ny();return a.jsx(Ie,{sx:{w:"full",h:"full"},children:a.jsxs(Sg,{ref:e,autoSaveId:"imageTab.content",direction:"horizontal",style:{height:"100%",width:"100%"},storage:n,units:"percentages",children:[a.jsx(Ua,{id:"imageTab.content.initImage",order:0,defaultSize:50,minSize:25,style:{position:"relative"},children:a.jsx(aue,{})}),a.jsx(im,{onDoubleClick:t}),a.jsx(Ua,{id:"imageTab.content.selectedImage",order:1,defaultSize:50,minSize:25,children:a.jsx(BO,{})})]})})},Oue=d.memo(Mue);var Due=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 V_=Rc(Due);function wb(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 Rue=Object.defineProperty,U_=Object.getOwnPropertySymbols,Aue=Object.prototype.hasOwnProperty,Nue=Object.prototype.propertyIsEnumerable,G_=(e,t,n)=>t in e?Rue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Tue=(e,t)=>{for(var n in t||(t={}))Aue.call(t,n)&&G_(e,n,t[n]);if(U_)for(var n of U_(t))Nue.call(t,n)&&G_(e,n,t[n]);return e};function HO(e,t){if(t===null||typeof t!="object")return{};const n=Tue({},t);return Object.keys(t).forEach(r=>{r.includes(`${String(e)}.`)&&delete n[r]}),n}const $ue="__MANTINE_FORM_INDEX__";function K_(e,t){return t?typeof t=="boolean"?t:Array.isArray(t)?t.includes(e.replace(/[.][0-9]/g,`.${$ue}`)):!1:!1}function q_(e,t,n){typeof n.value=="object"&&(n.value=Yl(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||t==="__proto__"?Object.defineProperty(e,t,n):e[t]=n.value}function Yl(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(Yl(i))})):s==="[object Map]"?(o=new Map,e.forEach(function(i,l){o.set(Yl(l),Yl(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(Yl(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++)q_(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]||q_(o,n,Object.getOwnPropertyDescriptor(e,n))}return o||e}function WO(e){return typeof e!="string"?[]:e.split(".")}function Mg(e,t,n){const r=WO(e);if(r.length===0)return n;const o=Yl(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 Vs(e,t){const n=WO(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=wb(e);return{hasErrors:Object.keys(t).length>0,errors:t}}function Sb(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=Vs(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((h,m)=>Sb(i,t,`${l}.${m}`,o))),typeof i=="object"&&typeof u=="object"&&u!==null&&(p||Sb(i,t,l,o)),o},r)}function kb(e,t){return X_(typeof e=="function"?e(t):Sb(e,t))}function Op(e,t,n){if(typeof e!="string")return{hasError:!1,error:null};const r=kb(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 Lue(e,{from:t,to:n},r){const o=Vs(e,r);if(!Array.isArray(o))return r;const s=[...o],i=o[t];return s.splice(t,1),s.splice(n,0,i),Mg(e,s,r)}var zue=Object.defineProperty,Y_=Object.getOwnPropertySymbols,Fue=Object.prototype.hasOwnProperty,Bue=Object.prototype.propertyIsEnumerable,Q_=(e,t,n)=>t in e?zue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Hue=(e,t)=>{for(var n in t||(t={}))Fue.call(t,n)&&Q_(e,n,t[n]);if(Y_)for(var n of Y_(t))Bue.call(t,n)&&Q_(e,n,t[n]);return e};function Wue(e,{from:t,to:n},r){const o=`${e}.${t}`,s=`${e}.${n}`,i=Hue({},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 h=i[u],m=i[p];return m===void 0?delete i[u]:i[u]=m,h===void 0?delete i[p]:i[p]=h,!1}return!0}),i}function Vue(e,t,n){const r=Vs(e,n);return Array.isArray(r)?Mg(e,r.filter((o,s)=>s!==t),n):n}var Uue=Object.defineProperty,Z_=Object.getOwnPropertySymbols,Gue=Object.prototype.hasOwnProperty,Kue=Object.prototype.propertyIsEnumerable,J_=(e,t,n)=>t in e?Uue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,que=(e,t)=>{for(var n in t||(t={}))Gue.call(t,n)&&J_(e,n,t[n]);if(Z_)for(var n of Z_(t))Kue.call(t,n)&&J_(e,n,t[n]);return e};function ej(e,t){const n=e.substring(t.length+1).split(".")[0];return parseInt(n,10)}function tj(e,t,n,r){if(t===void 0)return n;const o=`${String(e)}`;let s=n;r===-1&&(s=HO(`${o}.${t}`,s));const i=que({},s),l=new Set;return Object.entries(s).filter(([u])=>{if(!u.startsWith(`${o}.`))return!1;const p=ej(u,o);return Number.isNaN(p)?!1:p>=t}).forEach(([u,p])=>{const h=ej(u,o),m=u.replace(`${o}.${h}`,`${o}.${h+r}`);i[m]=p,l.add(m),l.has(u)||delete i[u]}),i}function Xue(e,t,n,r){const o=Vs(e,r);if(!Array.isArray(o))return r;const s=[...o];return s.splice(typeof n=="number"?n:s.length,0,t),Mg(e,s,r)}function nj(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 Yue(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 Que=Object.defineProperty,Zue=Object.defineProperties,Jue=Object.getOwnPropertyDescriptors,rj=Object.getOwnPropertySymbols,ede=Object.prototype.hasOwnProperty,tde=Object.prototype.propertyIsEnumerable,oj=(e,t,n)=>t in e?Que(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ea=(e,t)=>{for(var n in t||(t={}))ede.call(t,n)&&oj(e,n,t[n]);if(rj)for(var n of rj(t))tde.call(t,n)&&oj(e,n,t[n]);return e},qv=(e,t)=>Zue(e,Jue(t));function il({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,h]=d.useState(r),[m,v]=d.useState(n),[b,y]=d.useState(e),[x,w]=d.useState(wb(t)),k=d.useRef(e),_=U=>{k.current=U},j=d.useCallback(()=>h({}),[]),I=U=>{const G=U?Ea(Ea({},b),U):b;_(G),v({})},E=d.useCallback(U=>w(G=>wb(typeof U=="function"?U(G):U)),[]),M=d.useCallback(()=>w({}),[]),D=d.useCallback(()=>{y(e),M(),_(e),v({}),j()},[]),R=d.useCallback((U,G)=>E(te=>qv(Ea({},te),{[U]:G})),[]),A=d.useCallback(U=>E(G=>{if(typeof U!="string")return G;const te=Ea({},G);return delete te[U],te}),[]),O=d.useCallback(U=>v(G=>{if(typeof U!="string")return G;const te=HO(U,G);return delete te[U],te}),[]),T=d.useCallback((U,G)=>{const te=K_(U,s);O(U),h(ae=>qv(Ea({},ae),{[U]:!0})),y(ae=>{const oe=Mg(U,G,ae);if(te){const pe=Op(U,u,oe);pe.hasError?R(U,pe.error):A(U)}return oe}),!te&&o&&R(U,null)},[]),K=d.useCallback(U=>{y(G=>{const te=typeof U=="function"?U(G):U;return Ea(Ea({},G),te)}),o&&M()},[]),F=d.useCallback((U,G)=>{O(U),y(te=>Lue(U,G,te)),w(te=>Wue(U,G,te))},[]),V=d.useCallback((U,G)=>{O(U),y(te=>Vue(U,G,te)),w(te=>tj(U,G,te,-1))},[]),X=d.useCallback((U,G,te)=>{O(U),y(ae=>Xue(U,G,te,ae)),w(ae=>tj(U,te,ae,1))},[]),W=d.useCallback(()=>{const U=kb(u,b);return w(U.errors),U},[b,u]),z=d.useCallback(U=>{const G=Op(U,u,b);return G.hasError?R(U,G.error):A(U),G},[b,u]),Y=(U,{type:G="input",withError:te=!0,withFocus:ae=!0}={})=>{const pe={onChange:Yue(ue=>T(U,ue))};return te&&(pe.error=x[U]),G==="checkbox"?pe.checked=Vs(U,b):pe.value=Vs(U,b),ae&&(pe.onFocus=()=>h(ue=>qv(Ea({},ue),{[U]:!0})),pe.onBlur=()=>{if(K_(U,i)){const ue=Op(U,u,b);ue.hasError?R(U,ue.error):A(U)}}),pe},B=(U,G)=>te=>{te==null||te.preventDefault();const ae=W();ae.hasErrors?G==null||G(ae.errors,b,te):U==null||U(l(b),te)},q=U=>l(U||b),re=d.useCallback(U=>{U.preventDefault(),D()},[]),Q=U=>{if(U){const te=Vs(U,m);if(typeof te=="boolean")return te;const ae=Vs(U,b),oe=Vs(U,k.current);return!V_(ae,oe)}return Object.keys(m).length>0?nj(m):!V_(b,k.current)},le=d.useCallback(U=>nj(p,U),[p]),se=d.useCallback(U=>U?!Op(U,u,b).hasError:!kb(u,b).hasErrors,[b,u]);return{values:b,errors:x,setValues:K,setErrors:E,setFieldValue:T,setFieldError:R,clearFieldError:A,clearErrors:M,reset:D,validate:W,validateField:z,reorderListItem:F,removeListItem:V,insertListItem:X,getInputProps:Y,onSubmit:B,onReset:re,isDirty:Q,isTouched:le,setTouched:h,setDirty:v,resetTouched:j,resetDirty:I,isValid:se,getTransformedValues:q}}function gn(e){const{...t}=e,{base50:n,base100:r,base200:o,base300:s,base800:i,base700:l,base900:u,accent500:p,accent300:h}=Vd(),{colorMode:m}=la();return a.jsx(wE,{styles:()=>({input:{color:Ae(u,r)(m),backgroundColor:Ae(n,u)(m),borderColor:Ae(o,i)(m),borderWidth:2,outline:"none",":focus":{borderColor:Ae(h,p)(m)}},label:{color:Ae(l,s)(m),fontWeight:"normal",marginBottom:4}}),...t})}const nde=[{value:"sd-1",label:on["sd-1"]},{value:"sd-2",label:on["sd-2"]},{value:"sdxl",label:on.sdxl},{value:"sdxl-refiner",label:on["sdxl-refiner"]}];function Qd(e){const{...t}=e,{t:n}=Z();return a.jsx(In,{label:n("modelManager.baseModel"),data:nde,...t})}function VO(e){const{data:t}=u5(),{...n}=e;return a.jsx(In,{label:"Config File",placeholder:"Select A Config File",data:t||[],...n})}const rde=[{value:"normal",label:"Normal"},{value:"inpaint",label:"Inpaint"},{value:"depth",label:"Depth"}];function Og(e){const{...t}=e,{t:n}=Z();return a.jsx(In,{label:n("modelManager.variant"),data:rde,...t})}function um(e,t=!0){let n;t?n=new RegExp("[^\\\\/]+(?=\\.)"):n=new RegExp("[^\\\\/]+(?=[\\\\/]?$)");const r=e.match(n);return r?r[0]:""}function UO(e){const{t}=Z(),n=ee(),{model_path:r}=e,o=il({initialValues:{model_name:r?um(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]=d5(),[i,l]=d.useState(!1),u=p=>{s({body:p}).unwrap().then(h=>{n(Tt(Ft({title:t("modelManager.modelAdded",{modelName:p.model_name}),status:"success"}))),o.reset(),r&&n(kd(null))}).catch(h=>{h&&n(Tt(Ft({title:t("toast.modelAddFailed"),status:"error"})))})};return a.jsx("form",{onSubmit:o.onSubmit(p=>u(p)),style:{width:"100%"},children:a.jsxs($,{flexDirection:"column",gap:2,children:[a.jsx(gn,{label:t("modelManager.model"),required:!0,...o.getInputProps("model_name")}),a.jsx(Qd,{label:t("modelManager.baseModel"),...o.getInputProps("base_model")}),a.jsx(gn,{label:t("modelManager.modelLocation"),required:!0,...o.getInputProps("path"),onBlur:p=>{if(o.values.model_name===""){const h=um(p.currentTarget.value);h&&o.setFieldValue("model_name",h)}}}),a.jsx(gn,{label:t("modelManager.description"),...o.getInputProps("description")}),a.jsx(gn,{label:t("modelManager.vaeLocation"),...o.getInputProps("vae")}),a.jsx(Og,{label:t("modelManager.variant"),...o.getInputProps("variant")}),a.jsxs($,{flexDirection:"column",width:"100%",gap:2,children:[i?a.jsx(gn,{required:!0,label:t("modelManager.customConfigFileLocation"),...o.getInputProps("config")}):a.jsx(VO,{required:!0,width:"100%",...o.getInputProps("config")}),a.jsx(ur,{isChecked:i,onChange:()=>l(!i),label:t("modelManager.useCustomConfig")}),a.jsx(it,{mt:2,type:"submit",children:t("modelManager.addModel")})]})]})})}function GO(e){const{t}=Z(),n=ee(),{model_path:r}=e,[o]=d5(),s=il({initialValues:{model_name:r?um(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(Tt(Ft({title:t("modelManager.modelAdded",{modelName:l.model_name}),status:"success"}))),s.reset(),r&&n(kd(null))}).catch(u=>{u&&n(Tt(Ft({title:t("toast.modelAddFailed"),status:"error"})))})};return a.jsx("form",{onSubmit:s.onSubmit(l=>i(l)),style:{width:"100%"},children:a.jsxs($,{flexDirection:"column",gap:2,children:[a.jsx(gn,{required:!0,label:t("modelManager.model"),...s.getInputProps("model_name")}),a.jsx(Qd,{label:t("modelManager.baseModel"),...s.getInputProps("base_model")}),a.jsx(gn,{required:!0,label:t("modelManager.modelLocation"),placeholder:t("modelManager.modelLocationValidationMsg"),...s.getInputProps("path"),onBlur:l=>{if(s.values.model_name===""){const u=um(l.currentTarget.value,!1);u&&s.setFieldValue("model_name",u)}}}),a.jsx(gn,{label:t("modelManager.description"),...s.getInputProps("description")}),a.jsx(gn,{label:t("modelManager.vaeLocation"),...s.getInputProps("vae")}),a.jsx(Og,{label:t("modelManager.variant"),...s.getInputProps("variant")}),a.jsx(it,{mt:2,type:"submit",children:t("modelManager.addModel")})]})})}const KO=[{label:"Diffusers",value:"diffusers"},{label:"Checkpoint / Safetensors",value:"checkpoint"}];function ode(){const[e,t]=d.useState("diffusers"),{t:n}=Z();return a.jsxs($,{flexDirection:"column",gap:4,width:"100%",children:[a.jsx(In,{label:n("modelManager.modelType"),value:e,data:KO,onChange:r=>{r&&t(r)}}),a.jsxs($,{sx:{p:4,borderRadius:4,bg:"base.300",_dark:{bg:"base.850"}},children:[e==="diffusers"&&a.jsx(GO,{}),e==="checkpoint"&&a.jsx(UO,{})]})]})}const sde=[{label:"None",value:"none"},{label:"v_prediction",value:"v_prediction"},{label:"epsilon",value:"epsilon"},{label:"sample",value:"sample"}];function ade(){const e=ee(),{t}=Z(),n=L(l=>l.system.isProcessing),[r,{isLoading:o}]=f5(),s=il({initialValues:{location:"",prediction_type:void 0}}),i=l=>{const u={location:l.location,prediction_type:l.prediction_type==="none"?void 0:l.prediction_type};r({body:u}).unwrap().then(p=>{e(Tt(Ft({title:t("toast.modelAddSimple"),status:"success"}))),s.reset()}).catch(p=>{p&&(console.log(p),e(Tt(Ft({title:`${p.data.detail} `,status:"error"}))))})};return a.jsx("form",{onSubmit:s.onSubmit(l=>i(l)),style:{width:"100%"},children:a.jsxs($,{flexDirection:"column",width:"100%",gap:4,children:[a.jsx(gn,{label:t("modelManager.modelLocation"),placeholder:t("modelManager.simpleModelDesc"),w:"100%",...s.getInputProps("location")}),a.jsx(In,{label:t("modelManager.predictionType"),data:sde,defaultValue:"none",...s.getInputProps("prediction_type")}),a.jsx(it,{type:"submit",isLoading:o,isDisabled:o||n,children:t("modelManager.addModel")})]})})}function ide(){const[e,t]=d.useState("simple");return a.jsxs($,{flexDirection:"column",width:"100%",overflow:"scroll",maxHeight:window.innerHeight-250,gap:4,children:[a.jsxs(mn,{isAttached:!0,children:[a.jsx(it,{size:"sm",isChecked:e=="simple",onClick:()=>t("simple"),children:"Simple"}),a.jsx(it,{size:"sm",isChecked:e=="advanced",onClick:()=>t("advanced"),children:"Advanced"})]}),a.jsxs($,{sx:{p:4,borderRadius:4,background:"base.200",_dark:{background:"base.800"}},children:[e==="simple"&&a.jsx(ade,{}),e==="advanced"&&a.jsx(ode,{})]})]})}function lde(e){const{...t}=e;return a.jsx(m6,{w:"100%",...t,children:e.children})}function cde(){const e=L(x=>x.modelmanager.searchFolder),[t,n]=d.useState(""),{data:r}=Bo(Ci),{foundModels:o,alreadyInstalled:s,filteredModels:i}=p5({search_path:e||""},{selectFromResult:({data:x})=>{const w=RN(r==null?void 0:r.entities),k=rr(w,"path"),_=ON(x,k),j=LN(x,k);return{foundModels:x,alreadyInstalled:sj(j,t),filteredModels:sj(_,t)}}}),[l,{isLoading:u}]=f5(),p=ee(),{t:h}=Z(),m=d.useCallback(x=>{const w=x.currentTarget.id.split("\\").splice(-1)[0];l({body:{location:x.currentTarget.id}}).unwrap().then(k=>{p(Tt(Ft({title:`Added Model: ${w}`,status:"success"})))}).catch(k=>{k&&p(Tt(Ft({title:h("toast.modelAddFailed"),status:"error"})))})},[p,l,h]),v=d.useCallback(x=>{n(x.target.value)},[]),b=({models:x,showActions:w=!0})=>x.map(k=>a.jsxs($,{sx:{p:4,gap:4,alignItems:"center",borderRadius:4,bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsxs($,{w:"100%",sx:{flexDirection:"column",minW:"25%"},children:[a.jsx(ye,{sx:{fontWeight:600},children:k.split("\\").slice(-1)[0]}),a.jsx(ye,{sx:{fontSize:"sm",color:"base.600",_dark:{color:"base.400"}},children:k})]}),w?a.jsxs($,{gap:2,children:[a.jsx(it,{id:k,onClick:m,isLoading:u,children:h("modelManager.quickAdd")}),a.jsx(it,{onClick:()=>p(kd(k)),isLoading:u,children:h("modelManager.advanced")})]}):a.jsx(ye,{sx:{fontWeight:600,p:2,borderRadius:4,color:"accent.50",bg:"accent.400",_dark:{color:"accent.100",bg:"accent.600"}},children:"Installed"})]},k));return(()=>e?!o||o.length===0?a.jsx($,{sx:{w:"full",h:"full",justifyContent:"center",alignItems:"center",height:96,userSelect:"none",bg:"base.200",_dark:{bg:"base.900"}},children:a.jsx(ye,{variant:"subtext",children:h("modelManager.noModels")})}):a.jsxs($,{sx:{flexDirection:"column",gap:2,w:"100%",minW:"50%"},children:[a.jsx(uo,{onChange:v,label:h("modelManager.search"),labelPos:"side"}),a.jsxs($,{p:2,gap:2,children:[a.jsxs(ye,{sx:{fontWeight:600},children:["Models Found: ",o.length]}),a.jsxs(ye,{sx:{fontWeight:600,color:"accent.500",_dark:{color:"accent.200"}},children:["Not Installed: ",i.length]})]}),a.jsx(lde,{offsetScrollbars:!0,children:a.jsxs($,{gap:2,flexDirection:"column",children:[b({models:i}),b({models:s,showActions:!1})]})})]}):null)()}const sj=(e,t)=>{const n=[];return Pn(e,r=>{if(!r)return null;r.includes(t)&&n.push(r)}),n};function ude(){const e=L(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=ee();return e?a.jsxs(Ie,{as:vn.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($,{justifyContent:"space-between",alignItems:"center",children:[a.jsx(ye,{size:"xl",fontWeight:600,children:o||n==="checkpoint"?"Add Checkpoint Model":"Add Diffusers Model"}),a.jsx(Te,{icon:a.jsx(JZ,{}),"aria-label":t("modelManager.closeAdvanced"),onClick:()=>i(kd(null)),size:"sm"})]}),a.jsx(In,{label:t("modelManager.modelType"),value:n,data:KO,onChange:l=>{l&&(r(l),s(l==="checkpoint"))}}),o?a.jsx(UO,{model_path:e},e):a.jsx(GO,{model_path:e},e)]}):null}function dde(){const e=ee(),{t}=Z(),n=L(l=>l.modelmanager.searchFolder),{refetch:r}=p5({search_path:n||""}),o=il({initialValues:{folder:""}}),s=d.useCallback(l=>{e(vw(l.folder))},[e]),i=()=>{r()};return a.jsx("form",{onSubmit:o.onSubmit(l=>s(l)),style:{width:"100%"},children:a.jsxs($,{sx:{w:"100%",gap:2,borderRadius:4,alignItems:"center"},children:[a.jsxs($,{w:"100%",alignItems:"center",gap:4,minH:12,children:[a.jsx(ye,{sx:{fontSize:"sm",fontWeight:600,color:"base.700",minW:"max-content",_dark:{color:"base.300"}},children:"Folder"}),n?a.jsx($,{sx:{w:"100%",p:2,px:4,bg:"base.300",borderRadius:4,fontSize:"sm",fontWeight:"bold",_dark:{bg:"base.700"}},children:n}):a.jsx(uo,{w:"100%",size:"md",...o.getInputProps("folder")})]}),a.jsxs($,{gap:2,children:[n?a.jsx(Te,{"aria-label":t("modelManager.scanAgain"),tooltip:t("modelManager.scanAgain"),icon:a.jsx(WE,{}),onClick:i,fontSize:18,size:"sm"}):a.jsx(Te,{"aria-label":t("modelManager.findModels"),tooltip:t("modelManager.findModels"),icon:a.jsx(XZ,{}),fontSize:18,size:"sm",type:"submit"}),a.jsx(Te,{"aria-label":t("modelManager.clearCheckpointFolder"),tooltip:t("modelManager.clearCheckpointFolder"),icon:a.jsx(Kr,{}),size:"sm",onClick:()=>{e(vw(null)),e(kd(null))},isDisabled:!n,colorScheme:"red"})]})]})})}const fde=d.memo(dde);function pde(){return a.jsxs($,{flexDirection:"column",w:"100%",gap:4,children:[a.jsx(fde,{}),a.jsxs($,{gap:4,children:[a.jsx($,{sx:{maxHeight:window.innerHeight-300,overflow:"scroll",gap:4,w:"100%"},children:a.jsx(cde,{})}),a.jsx(ude,{})]})]})}function hde(){const[e,t]=d.useState("add"),{t:n}=Z();return a.jsxs($,{flexDirection:"column",gap:4,children:[a.jsxs(mn,{isAttached:!0,children:[a.jsx(it,{onClick:()=>t("add"),isChecked:e=="add",size:"sm",width:"100%",children:n("modelManager.addModel")}),a.jsx(it,{onClick:()=>t("scan"),isChecked:e=="scan",size:"sm",width:"100%",children:n("modelManager.scanForModels")})]}),e=="add"&&a.jsx(ide,{}),e=="scan"&&a.jsx(pde,{})]})}const mde=[{label:"Stable Diffusion 1",value:"sd-1"},{label:"Stable Diffusion 2",value:"sd-2"}];function gde(){var z,Y;const{t:e}=Z(),t=ee(),{data:n}=Bo(Ci),[r,{isLoading:o}]=yA(),[s,i]=d.useState("sd-1"),l=Pw(n==null?void 0:n.entities,(B,q)=>(B==null?void 0:B.model_format)==="diffusers"&&(B==null?void 0:B.base_model)==="sd-1"),u=Pw(n==null?void 0:n.entities,(B,q)=>(B==null?void 0:B.model_format)==="diffusers"&&(B==null?void 0:B.base_model)==="sd-2"),p=d.useMemo(()=>({"sd-1":l,"sd-2":u}),[l,u]),[h,m]=d.useState(((z=Object.keys(p[s]))==null?void 0:z[0])??null),[v,b]=d.useState(((Y=Object.keys(p[s]))==null?void 0:Y[1])??null),[y,x]=d.useState(null),[w,k]=d.useState(""),[_,j]=d.useState(.5),[I,E]=d.useState("weighted_sum"),[M,D]=d.useState("root"),[R,A]=d.useState(""),[O,T]=d.useState(!1),K=Object.keys(p[s]).filter(B=>B!==v&&B!==y),F=Object.keys(p[s]).filter(B=>B!==h&&B!==y),V=Object.keys(p[s]).filter(B=>B!==h&&B!==v),X=B=>{i(B),m(null),b(null)},W=()=>{const B=[];let q=[h,v,y];q=q.filter(Q=>Q!==null),q.forEach(Q=>{var se;const le=(se=Q==null?void 0:Q.split("/"))==null?void 0:se[2];le&&B.push(le)});const re={model_names:B,merged_model_name:w!==""?w:B.join("-"),alpha:_,interp:I,force:O,merge_dest_directory:M==="root"?void 0:R};r({base_model:s,body:re}).unwrap().then(Q=>{t(Tt(Ft({title:e("modelManager.modelsMerged"),status:"success"})))}).catch(Q=>{Q&&t(Tt(Ft({title:e("modelManager.modelsMergeFailed"),status:"error"})))})};return a.jsxs($,{flexDirection:"column",rowGap:4,children:[a.jsxs($,{sx:{flexDirection:"column",rowGap:1},children:[a.jsx(ye,{children:e("modelManager.modelMergeHeaderHelp1")}),a.jsx(ye,{fontSize:"sm",variant:"subtext",children:e("modelManager.modelMergeHeaderHelp2")})]}),a.jsxs($,{columnGap:4,children:[a.jsx(In,{label:"Model Type",w:"100%",data:mde,value:s,onChange:X}),a.jsx(Kt,{label:e("modelManager.modelOne"),w:"100%",value:h,placeholder:e("modelManager.selectModel"),data:K,onChange:B=>m(B)}),a.jsx(Kt,{label:e("modelManager.modelTwo"),w:"100%",placeholder:e("modelManager.selectModel"),value:v,data:F,onChange:B=>b(B)}),a.jsx(Kt,{label:e("modelManager.modelThree"),data:V,w:"100%",placeholder:e("modelManager.selectModel"),clearable:!0,onChange:B=>{B?(x(B),E("weighted_sum")):(x(null),E("add_difference"))}})]}),a.jsx(uo,{label:e("modelManager.mergedModelName"),value:w,onChange:B=>k(B.target.value)}),a.jsxs($,{sx:{flexDirection:"column",padding:4,borderRadius:"base",gap:4,bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsx(Xe,{label:e("modelManager.alpha"),min:.01,max:.99,step:.01,value:_,onChange:B=>j(B),withInput:!0,withReset:!0,handleReset:()=>j(.5),withSliderMarks:!0}),a.jsx(ye,{variant:"subtext",fontSize:"sm",children:e("modelManager.modelMergeAlphaHelp")})]}),a.jsxs($,{sx:{padding:4,borderRadius:"base",gap:4,bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsx(ye,{fontWeight:500,fontSize:"sm",variant:"subtext",children:e("modelManager.interpolationType")}),a.jsx(ih,{value:I,onChange:B=>E(B),children:a.jsx($,{columnGap:4,children:y===null?a.jsxs(a.Fragment,{children:[a.jsx(zs,{value:"weighted_sum",children:a.jsx(ye,{fontSize:"sm",children:e("modelManager.weightedSum")})}),a.jsx(zs,{value:"sigmoid",children:a.jsx(ye,{fontSize:"sm",children:e("modelManager.sigmoid")})}),a.jsx(zs,{value:"inv_sigmoid",children:a.jsx(ye,{fontSize:"sm",children:e("modelManager.inverseSigmoid")})})]}):a.jsx(zs,{value:"add_difference",children:a.jsx(Rt,{label:e("modelManager.modelMergeInterpAddDifferenceHelp"),children:a.jsx(ye,{fontSize:"sm",children:e("modelManager.addDifference")})})})})})]}),a.jsxs($,{sx:{flexDirection:"column",padding:4,borderRadius:"base",gap:4,bg:"base.200",_dark:{bg:"base.900"}},children:[a.jsxs($,{columnGap:4,children:[a.jsx(ye,{fontWeight:"500",fontSize:"sm",variant:"subtext",children:e("modelManager.mergedModelSaveLocation")}),a.jsx(ih,{value:M,onChange:B=>D(B),children:a.jsxs($,{columnGap:4,children:[a.jsx(zs,{value:"root",children:a.jsx(ye,{fontSize:"sm",children:e("modelManager.invokeAIFolder")})}),a.jsx(zs,{value:"custom",children:a.jsx(ye,{fontSize:"sm",children:e("modelManager.custom")})})]})})]}),M==="custom"&&a.jsx(uo,{label:e("modelManager.mergedModelCustomSaveLocation"),value:R,onChange:B=>A(B.target.value)})]}),a.jsx(ur,{label:e("modelManager.ignoreMismatch"),isChecked:O,onChange:B=>T(B.target.checked),fontWeight:"500"}),a.jsx(it,{onClick:W,isLoading:o,isDisabled:h===null||v===null,children:e("modelManager.merge")})]})}const vde=Pe((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:h,onOpen:m,onClose:v}=Mr(),b=d.useRef(null),y=()=>{o(),v()},x=()=>{i&&i(),v()};return a.jsxs(a.Fragment,{children:[d.cloneElement(p,{onClick:m,ref:t}),a.jsx($d,{isOpen:h,leastDestructiveRef:b,onClose:v,isCentered:!0,children:a.jsx(Wo,{children:a.jsxs(Ld,{children:[a.jsx(Ho,{fontSize:"lg",fontWeight:"bold",children:u}),a.jsx(Vo,{children:l}),a.jsxs(gs,{children:[a.jsx(it,{ref:b,onClick:x,children:s}),a.jsx(it,{colorScheme:"error",onClick:y,ml:3,children:r})]})]})})})]})}),Gy=d.memo(vde);function bde(e){const{model:t}=e,n=ee(),{t:r}=Z(),[o,{isLoading:s}]=CA(),[i,l]=d.useState("InvokeAIRoot"),[u,p]=d.useState("");d.useEffect(()=>{l("InvokeAIRoot")},[t]);const h=()=>{l("InvokeAIRoot")},m=()=>{const v={base_model:t.base_model,model_name:t.model_name,convert_dest_directory:i==="Custom"?u:void 0};if(i==="Custom"&&u===""){n(Tt(Ft({title:r("modelManager.noCustomLocationProvided"),status:"error"})));return}n(Tt(Ft({title:`${r("modelManager.convertingModelBegin")}: ${t.model_name}`,status:"info"}))),o(v).unwrap().then(()=>{n(Tt(Ft({title:`${r("modelManager.modelConverted")}: ${t.model_name}`,status:"success"})))}).catch(()=>{n(Tt(Ft({title:`${r("modelManager.modelConversionFailed")}: ${t.model_name}`,status:"error"})))})};return a.jsxs(Gy,{title:`${r("modelManager.convert")} ${t.model_name}`,acceptCallback:m,cancelCallback:h,acceptButtonText:`${r("modelManager.convert")}`,triggerComponent:a.jsxs(it,{size:"sm","aria-label":r("modelManager.convertToDiffusers"),className:" modal-close-btn",isLoading:s,children:["🧨 ",r("modelManager.convertToDiffusers")]}),motionPreset:"slideInBottom",children:[a.jsxs($,{flexDirection:"column",rowGap:4,children:[a.jsx(ye,{children:r("modelManager.convertToDiffusersHelpText1")}),a.jsxs(Od,{children:[a.jsx(lo,{children:r("modelManager.convertToDiffusersHelpText2")}),a.jsx(lo,{children:r("modelManager.convertToDiffusersHelpText3")}),a.jsx(lo,{children:r("modelManager.convertToDiffusersHelpText4")}),a.jsx(lo,{children:r("modelManager.convertToDiffusersHelpText5")})]}),a.jsx(ye,{children:r("modelManager.convertToDiffusersHelpText6")})]}),a.jsxs($,{flexDir:"column",gap:2,children:[a.jsxs($,{marginTop:4,flexDir:"column",gap:2,children:[a.jsx(ye,{fontWeight:"600",children:r("modelManager.convertToDiffusersSaveLocation")}),a.jsx(ih,{value:i,onChange:v=>l(v),children:a.jsxs($,{gap:4,children:[a.jsx(zs,{value:"InvokeAIRoot",children:a.jsx(Rt,{label:"Save converted model in the InvokeAI root folder",children:r("modelManager.invokeRoot")})}),a.jsx(zs,{value:"Custom",children:a.jsx(Rt,{label:"Save converted model in a custom folder",children:r("modelManager.custom")})})]})})]}),i==="Custom"&&a.jsxs($,{flexDirection:"column",rowGap:2,children:[a.jsx(ye,{fontWeight:"500",fontSize:"sm",variant:"subtext",children:r("modelManager.customSaveLocation")}),a.jsx(uo,{value:u,onChange:v=>{p(v.target.value)},width:"full"})]})]})]})}function xde(e){const t=L(En),{model:n}=e,[r,{isLoading:o}]=h5(),{data:s}=u5(),[i,l]=d.useState(!1);d.useEffect(()=>{s!=null&&s.includes(n.config)||l(!0)},[s,n.config]);const u=ee(),{t:p}=Z(),h=il({initialValues:{model_name:n.model_name?n.model_name:"",base_model:n.base_model,model_type:"main",path:n.path?n.path:"",description:n.description?n.description:"",model_format:"checkpoint",vae:n.vae?n.vae:"",config:n.config?n.config:"",variant:n.variant},validate:{path:v=>v.trim().length===0?"Must provide a path":null}}),m=d.useCallback(v=>{const b={base_model:n.base_model,model_name:n.model_name,body:v};r(b).unwrap().then(y=>{h.setValues(y),u(Tt(Ft({title:p("modelManager.modelUpdated"),status:"success"})))}).catch(y=>{h.reset(),u(Tt(Ft({title:p("modelManager.modelUpdateFailed"),status:"error"})))})},[h,u,n.base_model,n.model_name,p,r]);return a.jsxs($,{flexDirection:"column",rowGap:4,width:"100%",children:[a.jsxs($,{justifyContent:"space-between",alignItems:"center",children:[a.jsxs($,{flexDirection:"column",children:[a.jsx(ye,{fontSize:"lg",fontWeight:"bold",children:n.model_name}),a.jsxs(ye,{fontSize:"sm",color:"base.400",children:[on[n.base_model]," Model"]})]}),[""].includes(n.base_model)?a.jsx(da,{sx:{p:2,borderRadius:4,bg:"error.200",_dark:{bg:"error.400"}},children:"Conversion Not Supported"}):a.jsx(bde,{model:n})]}),a.jsx(Vr,{}),a.jsx($,{flexDirection:"column",maxHeight:window.innerHeight-270,overflowY:"scroll",children:a.jsx("form",{onSubmit:h.onSubmit(v=>m(v)),children:a.jsxs($,{flexDirection:"column",overflowY:"scroll",gap:4,children:[a.jsx(gn,{label:p("modelManager.name"),...h.getInputProps("model_name")}),a.jsx(gn,{label:p("modelManager.description"),...h.getInputProps("description")}),a.jsx(Qd,{required:!0,...h.getInputProps("base_model")}),a.jsx(Og,{required:!0,...h.getInputProps("variant")}),a.jsx(gn,{required:!0,label:p("modelManager.modelLocation"),...h.getInputProps("path")}),a.jsx(gn,{label:p("modelManager.vaeLocation"),...h.getInputProps("vae")}),a.jsxs($,{flexDirection:"column",gap:2,children:[i?a.jsx(gn,{required:!0,label:p("modelManager.config"),...h.getInputProps("config")}):a.jsx(VO,{required:!0,...h.getInputProps("config")}),a.jsx(ur,{isChecked:i,onChange:()=>l(!i),label:"Use Custom Config"})]}),a.jsx(it,{type:"submit",isDisabled:t||o,isLoading:o,children:p("modelManager.updateModel")})]})})})]})}function yde(e){const t=L(En),{model:n}=e,[r,{isLoading:o}]=h5(),s=ee(),{t:i}=Z(),l=il({initialValues:{model_name:n.model_name?n.model_name:"",base_model:n.base_model,model_type:"main",path:n.path?n.path:"",description:n.description?n.description:"",model_format:"diffusers",vae:n.vae?n.vae:"",variant:n.variant},validate:{path:p=>p.trim().length===0?"Must provide a path":null}}),u=d.useCallback(p=>{const h={base_model:n.base_model,model_name:n.model_name,body:p};r(h).unwrap().then(m=>{l.setValues(m),s(Tt(Ft({title:i("modelManager.modelUpdated"),status:"success"})))}).catch(m=>{l.reset(),s(Tt(Ft({title:i("modelManager.modelUpdateFailed"),status:"error"})))})},[l,s,n.base_model,n.model_name,i,r]);return a.jsxs($,{flexDirection:"column",rowGap:4,width:"100%",children:[a.jsxs($,{flexDirection:"column",children:[a.jsx(ye,{fontSize:"lg",fontWeight:"bold",children:n.model_name}),a.jsxs(ye,{fontSize:"sm",color:"base.400",children:[on[n.base_model]," Model"]})]}),a.jsx(Vr,{}),a.jsx("form",{onSubmit:l.onSubmit(p=>u(p)),children:a.jsxs($,{flexDirection:"column",overflowY:"scroll",gap:4,children:[a.jsx(gn,{label:i("modelManager.name"),...l.getInputProps("model_name")}),a.jsx(gn,{label:i("modelManager.description"),...l.getInputProps("description")}),a.jsx(Qd,{required:!0,...l.getInputProps("base_model")}),a.jsx(Og,{required:!0,...l.getInputProps("variant")}),a.jsx(gn,{required:!0,label:i("modelManager.modelLocation"),...l.getInputProps("path")}),a.jsx(gn,{label:i("modelManager.vaeLocation"),...l.getInputProps("vae")}),a.jsx(it,{type:"submit",isDisabled:t||o,isLoading:o,children:i("modelManager.updateModel")})]})})]})}function Cde(e){const t=L(En),{model:n}=e,[r,{isLoading:o}]=wA(),s=ee(),{t:i}=Z(),l=il({initialValues:{model_name:n.model_name?n.model_name:"",base_model:n.base_model,model_type:"lora",path:n.path?n.path:"",description:n.description?n.description:"",model_format:n.model_format},validate:{path:p=>p.trim().length===0?"Must provide a path":null}}),u=d.useCallback(p=>{const h={base_model:n.base_model,model_name:n.model_name,body:p};r(h).unwrap().then(m=>{l.setValues(m),s(Tt(Ft({title:i("modelManager.modelUpdated"),status:"success"})))}).catch(m=>{l.reset(),s(Tt(Ft({title:i("modelManager.modelUpdateFailed"),status:"error"})))})},[s,l,n.base_model,n.model_name,i,r]);return a.jsxs($,{flexDirection:"column",rowGap:4,width:"100%",children:[a.jsxs($,{flexDirection:"column",children:[a.jsx(ye,{fontSize:"lg",fontWeight:"bold",children:n.model_name}),a.jsxs(ye,{fontSize:"sm",color:"base.400",children:[on[n.base_model]," Model ⋅"," ",SA[n.model_format]," format"]})]}),a.jsx(Vr,{}),a.jsx("form",{onSubmit:l.onSubmit(p=>u(p)),children:a.jsxs($,{flexDirection:"column",overflowY:"scroll",gap:4,children:[a.jsx(gn,{label:i("modelManager.name"),...l.getInputProps("model_name")}),a.jsx(gn,{label:i("modelManager.description"),...l.getInputProps("description")}),a.jsx(Qd,{...l.getInputProps("base_model")}),a.jsx(gn,{label:i("modelManager.modelLocation"),...l.getInputProps("path")}),a.jsx(it,{type:"submit",isDisabled:t||o,isLoading:o,children:i("modelManager.updateModel")})]})})]})}function wde(e){const t=L(En),{t:n}=Z(),r=ee(),[o]=kA(),[s]=_A(),{model:i,isSelected:l,setSelectedModelId:u}=e,p=d.useCallback(()=>{u(i.id)},[i.id,u]),h=d.useCallback(()=>{const m={main:o,lora:s,onnx:o}[i.model_type];m(i).unwrap().then(v=>{r(Tt(Ft({title:`${n("modelManager.modelDeleted")}: ${i.model_name}`,status:"success"})))}).catch(v=>{v&&r(Tt(Ft({title:`${n("modelManager.modelDeleteFailed")}: ${i.model_name}`,status:"error"})))}),u(void 0)},[o,s,i,u,r,n]);return a.jsxs($,{sx:{gap:2,alignItems:"center",w:"full"},children:[a.jsx($,{as:it,isChecked:l,sx:{justifyContent:"start",p:2,borderRadius:"base",w:"full",alignItems:"center",bg:l?"accent.400":"base.100",color:l?"base.50":"base.800",_hover:{bg:l?"accent.500":"base.300",color:l?"base.50":"base.800"},_dark:{color:l?"base.50":"base.100",bg:l?"accent.600":"base.850",_hover:{color:l?"base.50":"base.100",bg:l?"accent.550":"base.700"}}},onClick:p,children:a.jsxs($,{gap:4,alignItems:"center",children:[a.jsx(da,{minWidth:14,p:.5,fontSize:"sm",variant:"solid",children:jA[i.base_model]}),a.jsx(Rt,{label:i.description,hasArrow:!0,placement:"bottom",children:a.jsx(ye,{sx:{fontWeight:500},children:i.model_name})})]})}),a.jsx(Gy,{title:n("modelManager.deleteModel"),acceptCallback:h,acceptButtonText:n("modelManager.delete"),triggerComponent:a.jsx(Te,{icon:a.jsx(nte,{}),"aria-label":n("modelManager.deleteConfig"),isDisabled:t,colorScheme:"error"}),children:a.jsxs($,{rowGap:4,flexDirection:"column",children:[a.jsx("p",{style:{fontWeight:"bold"},children:n("modelManager.deleteMsg1")}),a.jsx("p",{children:n("modelManager.deleteMsg2")})]})})]})}const Sde=e=>{const{selectedModelId:t,setSelectedModelId:n}=e,{t:r}=Z(),[o,s]=d.useState(""),[i,l]=d.useState("all"),{filteredDiffusersModels:u,isLoadingDiffusersModels:p}=Bo(Ci,{selectFromResult:({data:j,isLoading:I})=>({filteredDiffusersModels:Pu(j,"main","diffusers",o),isLoadingDiffusersModels:I})}),{filteredCheckpointModels:h,isLoadingCheckpointModels:m}=Bo(Ci,{selectFromResult:({data:j,isLoading:I})=>({filteredCheckpointModels:Pu(j,"main","checkpoint",o),isLoadingCheckpointModels:I})}),{filteredLoraModels:v,isLoadingLoraModels:b}=Cd(void 0,{selectFromResult:({data:j,isLoading:I})=>({filteredLoraModels:Pu(j,"lora",void 0,o),isLoadingLoraModels:I})}),{filteredOnnxModels:y,isLoadingOnnxModels:x}=Yu(Ci,{selectFromResult:({data:j,isLoading:I})=>({filteredOnnxModels:Pu(j,"onnx","onnx",o),isLoadingOnnxModels:I})}),{filteredOliveModels:w,isLoadingOliveModels:k}=Yu(Ci,{selectFromResult:({data:j,isLoading:I})=>({filteredOliveModels:Pu(j,"onnx","olive",o),isLoadingOliveModels:I})}),_=d.useCallback(j=>{s(j.target.value)},[]);return a.jsx($,{flexDirection:"column",rowGap:4,width:"50%",minWidth:"50%",children:a.jsxs($,{flexDirection:"column",gap:4,paddingInlineEnd:4,children:[a.jsxs(mn,{isAttached:!0,children:[a.jsx(it,{onClick:()=>l("all"),isChecked:i==="all",size:"sm",children:r("modelManager.allModels")}),a.jsx(it,{size:"sm",onClick:()=>l("diffusers"),isChecked:i==="diffusers",children:r("modelManager.diffusersModels")}),a.jsx(it,{size:"sm",onClick:()=>l("checkpoint"),isChecked:i==="checkpoint",children:r("modelManager.checkpointModels")}),a.jsx(it,{size:"sm",onClick:()=>l("onnx"),isChecked:i==="onnx",children:r("modelManager.onnxModels")}),a.jsx(it,{size:"sm",onClick:()=>l("olive"),isChecked:i==="olive",children:r("modelManager.oliveModels")}),a.jsx(it,{size:"sm",onClick:()=>l("lora"),isChecked:i==="lora",children:r("modelManager.loraModels")})]}),a.jsx(uo,{onChange:_,label:r("modelManager.search"),labelPos:"side"}),a.jsxs($,{flexDirection:"column",gap:4,maxHeight:window.innerHeight-280,overflow:"scroll",children:[p&&a.jsx(Vl,{loadingMessage:"Loading Diffusers..."}),["all","diffusers"].includes(i)&&!p&&u.length>0&&a.jsx(Wl,{title:"Diffusers",modelList:u,selected:{selectedModelId:t,setSelectedModelId:n}},"diffusers"),m&&a.jsx(Vl,{loadingMessage:"Loading Checkpoints..."}),["all","checkpoint"].includes(i)&&!m&&h.length>0&&a.jsx(Wl,{title:"Checkpoints",modelList:h,selected:{selectedModelId:t,setSelectedModelId:n}},"checkpoints"),b&&a.jsx(Vl,{loadingMessage:"Loading LoRAs..."}),["all","lora"].includes(i)&&!b&&v.length>0&&a.jsx(Wl,{title:"LoRAs",modelList:v,selected:{selectedModelId:t,setSelectedModelId:n}},"loras"),k&&a.jsx(Vl,{loadingMessage:"Loading Olives..."}),["all","olive"].includes(i)&&!k&&w.length>0&&a.jsx(Wl,{title:"Olives",modelList:w,selected:{selectedModelId:t,setSelectedModelId:n}},"olive"),x&&a.jsx(Vl,{loadingMessage:"Loading ONNX..."}),["all","onnx"].includes(i)&&!x&&y.length>0&&a.jsx(Wl,{title:"ONNX",modelList:y,selected:{selectedModelId:t,setSelectedModelId:n}},"onnx")]})]})})},kde=d.memo(Sde),Pu=(e,t,n,r)=>{const o=[];return Pn(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},Ky=d.memo(e=>a.jsx($,{flexDirection:"column",gap:4,borderRadius:4,p:4,sx:{bg:"base.200",_dark:{bg:"base.800"}},children:e.children}));Ky.displayName="StyledModelContainer";const Wl=d.memo(e=>{const{title:t,modelList:n,selected:r}=e;return a.jsx(Ky,{children:a.jsxs($,{sx:{gap:2,flexDir:"column"},children:[a.jsx(ye,{variant:"subtext",fontSize:"sm",children:t}),n.map(o=>a.jsx(wde,{model:o,isSelected:r.selectedModelId===o.id,setSelectedModelId:r.setSelectedModelId},o.id))]})})});Wl.displayName="ModelListWrapper";const Vl=d.memo(({loadingMessage:e})=>a.jsx(Ky,{children:a.jsxs($,{justifyContent:"center",alignItems:"center",flexDirection:"column",p:4,gap:8,children:[a.jsx(Xi,{}),a.jsx(ye,{variant:"subtext",children:e||"Fetching..."})]})}));Vl.displayName="FetchingModelsLoader";function _de(){const[e,t]=d.useState(),{mainModel:n}=Bo(Ci,{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($,{sx:{gap:8,w:"full",h:"full"},children:[a.jsx(kde,{selectedModelId:e,setSelectedModelId:t}),a.jsx(jde,{model:o})]})}const jde=e=>{const{model:t}=e;return(t==null?void 0:t.model_format)==="checkpoint"?a.jsx(xde,{model:t},t.id):(t==null?void 0:t.model_format)==="diffusers"?a.jsx(yde,{model:t},t.id):(t==null?void 0:t.model_type)==="lora"?a.jsx(Cde,{model:t},t.id):a.jsx($,{sx:{w:"full",h:"full",justifyContent:"center",alignItems:"center",maxH:96,userSelect:"none"},children:a.jsx(ye,{variant:"subtext",children:"No Model Selected"})})};function Pde(){const{t:e}=Z();return a.jsxs($,{sx:{w:"full",p:4,borderRadius:4,gap:4,justifyContent:"space-between",alignItems:"center",bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsxs($,{sx:{flexDirection:"column",gap:2},children:[a.jsx(ye,{sx:{fontWeight:600},children:e("modelManager.syncModels")}),a.jsx(ye,{fontSize:"sm",sx:{_dark:{color:"base.400"}},children:e("modelManager.syncModelsDesc")})]}),a.jsx(Uc,{})]})}function Ide(){return a.jsx($,{children:a.jsx(Pde,{})})}const aj=[{id:"modelManager",label:vt.t("modelManager.modelManager"),content:a.jsx(_de,{})},{id:"importModels",label:vt.t("modelManager.importModels"),content:a.jsx(hde,{})},{id:"mergeModels",label:vt.t("modelManager.mergeModels"),content:a.jsx(gde,{})},{id:"settings",label:vt.t("modelManager.settings"),content:a.jsx(Ide,{})}],Ede=()=>a.jsxs(Ji,{isLazy:!0,variant:"line",layerStyle:"first",sx:{w:"full",h:"full",p:4,gap:4,borderRadius:"base"},children:[a.jsx(el,{children:aj.map(e=>a.jsx(Pr,{sx:{borderTopRadius:"base"},children:e.label},e.id))}),a.jsx(Fc,{sx:{w:"full",h:"full"},children:aj.map(e=>a.jsx(mo,{sx:{w:"full",h:"full"},children:e.content},e.id))})]}),Mde=d.memo(Ede),Ode={enum:"",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,IPAdapterField:void 0,IPAdapterModelField: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:"",UNetField:void 0,VaeField:void 0,VaeModelField:void 0},Dde=(e,t)=>{const n={id:e,name:t.name,type:t.type,label:"",fieldKind:"input"};return n.value=t.default??Ode[t.type],n},Rde=ie([e=>e.nodes],e=>e.nodeTemplates),Xv={dragHandle:`.${Zi}`},Ade=()=>{const e=L(Rde),t=Xb();return d.useCallback(n=>{var b;const r=Ba();let o=window.innerWidth/2,s=window.innerHeight/2;const i=(b=document.querySelector("#workflow-editor"))==null?void 0:b.getBoundingClientRect();i&&(o=i.width/2-d1/2,s=i.height/2-d1/2);const{x:l,y:u}=t.project({x:o,y:s});if(n==="current_image")return{...Xv,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{...Xv,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 h=bw(p.inputs,(y,x,w)=>{const k=Ba(),_=Dde(k,x);return y[w]=_,y},{}),m=bw(p.outputs,(y,x,w)=>{const _={id:Ba(),name:w,type:x.type,fieldKind:"output"};return y[w]=_,y},{});return{...Xv,id:r,type:"invocation",position:{x:l,y:u},data:{id:r,type:n,version:p.version,label:"",notes:"",isOpen:!0,embedWorkflow:!1,isIntermediate:!0,inputs:h,outputs:m}}},[e,t])},qO=d.forwardRef(({label:e,description:t,...n},r)=>a.jsx("div",{ref:r,...n,children:a.jsxs("div",{children:[a.jsx(ye,{fontWeight:600,children:e}),a.jsx(ye,{size:"xs",sx:{color:"base.600",_dark:{color:"base.500"}},children:t})]})}));qO.displayName="AddNodePopoverSelectItem";const Nde=(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))},Tde=()=>{const e=ee(),t=Ade(),n=tl(),{t:r}=Z(),o=ie([xe],({nodes:y})=>{const x=rr(y.nodeTemplates,w=>({label:w.title,value:w.type,description:w.description,tags:w.tags}));return x.push({label:r("nodes.currentImage"),value:"current_image",description:r("nodes.currentImageDescription"),tags:["progress"]}),x.push({label:r("nodes.notes"),value:"notes",description:r("nodes.notesDescription"),tags:["notes"]}),x.sort((w,k)=>w.label.localeCompare(k.label)),{data:x,t:r}},we),{data:s}=L(o),i=L(y=>y.nodes.isAddNodePopoverOpen),l=d.useRef(null),u=d.useCallback(y=>{const x=t(y);if(!x){const w=r("nodes.unknownInvocation",{nodeType:y});n({status:"error",title:w});return}e(PA(x))},[e,t,n,r]),p=d.useCallback(y=>{y&&u(y)},[u]),h=d.useCallback(()=>{e(IA())},[e]),m=d.useCallback(()=>{e(m5())},[e]),v=d.useCallback(y=>{y.preventDefault(),m(),setTimeout(()=>{var x;(x=l.current)==null||x.focus()},0)},[m]),b=d.useCallback(()=>{h()},[h]);return Ze(["shift+a","space"],v),Ze(["escape"],b),a.jsxs(Fm,{initialFocusRef:l,isOpen:i,onClose:h,placement:"bottom",openDelay:0,closeDelay:0,closeOnBlur:!0,returnFocusOnClose:!0,children:[a.jsx(bP,{children:a.jsx($,{sx:{position:"absolute",top:"15%",insetInlineStart:"50%",pointerEvents:"none"}})}),a.jsx(Bm,{sx:{p:0,top:-1,shadow:"dark-lg",borderColor:"accent.300",borderWidth:"2px",borderStyle:"solid",_dark:{borderColor:"accent.400"}},children:a.jsx(Ax,{sx:{p:0},children:a.jsx(Kt,{inputRef:l,selectOnBlur:!1,placeholder:r("nodes.nodeSearch"),value:null,data:s,maxDropdownHeight:400,nothingFound:r("nodes.noMatchingNodes"),itemComponent:qO,filter:Nde,onChange:p,hoverOnSearchChange:!0,onDropdownClose:h,sx:{width:"32rem",input:{padding:"0.5rem"}}})})})]})},$de=d.memo(Tde);var Lde="\0",gi="\0",ij="",wr,Si,Lr,hd,fc,pc,so,as,Ta,is,$a,Fs,Bs,hc,mc,Hs,Oo,md,_b,_j;let zde=(_j=class{constructor(t){en(this,md);en(this,wr,!0);en(this,Si,!1);en(this,Lr,!1);en(this,hd,void 0);en(this,fc,()=>{});en(this,pc,()=>{});en(this,so,{});en(this,as,{});en(this,Ta,{});en(this,is,{});en(this,$a,{});en(this,Fs,{});en(this,Bs,{});en(this,hc,0);en(this,mc,0);en(this,Hs,void 0);en(this,Oo,void 0);t&&(ro(this,wr,t.hasOwnProperty("directed")?t.directed:!0),ro(this,Si,t.hasOwnProperty("multigraph")?t.multigraph:!1),ro(this,Lr,t.hasOwnProperty("compound")?t.compound:!1)),Se(this,Lr)&&(ro(this,Hs,{}),ro(this,Oo,{}),Se(this,Oo)[gi]={})}isDirected(){return Se(this,wr)}isMultigraph(){return Se(this,Si)}isCompound(){return Se(this,Lr)}setGraph(t){return ro(this,hd,t),this}graph(){return Se(this,hd)}setDefaultNodeLabel(t){return ro(this,fc,t),typeof t!="function"&&ro(this,fc,()=>t),this}nodeCount(){return Se(this,hc)}nodes(){return Object.keys(Se(this,so))}sources(){var t=this;return this.nodes().filter(n=>Object.keys(Se(t,as)[n]).length===0)}sinks(){var t=this;return this.nodes().filter(n=>Object.keys(Se(t,is)[n]).length===0)}setNodes(t,n){var r=arguments,o=this;return t.forEach(function(s){r.length>1?o.setNode(s,n):o.setNode(s)}),this}setNode(t,n){return Se(this,so).hasOwnProperty(t)?(arguments.length>1&&(Se(this,so)[t]=n),this):(Se(this,so)[t]=arguments.length>1?n:Se(this,fc).call(this,t),Se(this,Lr)&&(Se(this,Hs)[t]=gi,Se(this,Oo)[t]={},Se(this,Oo)[gi][t]=!0),Se(this,as)[t]={},Se(this,Ta)[t]={},Se(this,is)[t]={},Se(this,$a)[t]={},++bu(this,hc)._,this)}node(t){return Se(this,so)[t]}hasNode(t){return Se(this,so).hasOwnProperty(t)}removeNode(t){var n=this;if(Se(this,so).hasOwnProperty(t)){var r=o=>n.removeEdge(Se(n,Fs)[o]);delete Se(this,so)[t],Se(this,Lr)&&(os(this,md,_b).call(this,t),delete Se(this,Hs)[t],this.children(t).forEach(function(o){n.setParent(o)}),delete Se(this,Oo)[t]),Object.keys(Se(this,as)[t]).forEach(r),delete Se(this,as)[t],delete Se(this,Ta)[t],Object.keys(Se(this,is)[t]).forEach(r),delete Se(this,is)[t],delete Se(this,$a)[t],--bu(this,hc)._}return this}setParent(t,n){if(!Se(this,Lr))throw new Error("Cannot set parent in a non-compound graph");if(n===void 0)n=gi;else{n+="";for(var r=n;r!==void 0;r=this.parent(r))if(r===t)throw new Error("Setting "+n+" as parent of "+t+" would create a cycle");this.setNode(n)}return this.setNode(t),os(this,md,_b).call(this,t),Se(this,Hs)[t]=n,Se(this,Oo)[n][t]=!0,this}parent(t){if(Se(this,Lr)){var n=Se(this,Hs)[t];if(n!==gi)return n}}children(t=gi){if(Se(this,Lr)){var n=Se(this,Oo)[t];if(n)return Object.keys(n)}else{if(t===gi)return this.nodes();if(this.hasNode(t))return[]}}predecessors(t){var n=Se(this,Ta)[t];if(n)return Object.keys(n)}successors(t){var n=Se(this,$a)[t];if(n)return Object.keys(n)}neighbors(t){var n=this.predecessors(t);if(n){const o=new Set(n);for(var r of this.successors(t))o.add(r);return Array.from(o.values())}}isLeaf(t){var n;return this.isDirected()?n=this.successors(t):n=this.neighbors(t),n.length===0}filterNodes(t){var n=new this.constructor({directed:Se(this,wr),multigraph:Se(this,Si),compound:Se(this,Lr)});n.setGraph(this.graph());var r=this;Object.entries(Se(this,so)).forEach(function([i,l]){t(i)&&n.setNode(i,l)}),Object.values(Se(this,Fs)).forEach(function(i){n.hasNode(i.v)&&n.hasNode(i.w)&&n.setEdge(i,r.edge(i))});var o={};function s(i){var l=r.parent(i);return l===void 0||n.hasNode(l)?(o[i]=l,l):l in o?o[l]:s(l)}return Se(this,Lr)&&n.nodes().forEach(i=>n.setParent(i,s(i))),n}setDefaultEdgeLabel(t){return ro(this,pc,t),typeof t!="function"&&ro(this,pc,()=>t),this}edgeCount(){return Se(this,mc)}edges(){return Object.values(Se(this,Fs))}setPath(t,n){var r=this,o=arguments;return t.reduce(function(s,i){return o.length>1?r.setEdge(s,i,n):r.setEdge(s,i),i}),this}setEdge(){var t,n,r,o,s=!1,i=arguments[0];typeof i=="object"&&i!==null&&"v"in i?(t=i.v,n=i.w,r=i.name,arguments.length===2&&(o=arguments[1],s=!0)):(t=i,n=arguments[1],r=arguments[3],arguments.length>2&&(o=arguments[2],s=!0)),t=""+t,n=""+n,r!==void 0&&(r=""+r);var l=Tu(Se(this,wr),t,n,r);if(Se(this,Bs).hasOwnProperty(l))return s&&(Se(this,Bs)[l]=o),this;if(r!==void 0&&!Se(this,Si))throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(n),Se(this,Bs)[l]=s?o:Se(this,pc).call(this,t,n,r);var u=Fde(Se(this,wr),t,n,r);return t=u.v,n=u.w,Object.freeze(u),Se(this,Fs)[l]=u,lj(Se(this,Ta)[n],t),lj(Se(this,$a)[t],n),Se(this,as)[n][l]=u,Se(this,is)[t][l]=u,bu(this,mc)._++,this}edge(t,n,r){var o=arguments.length===1?Yv(Se(this,wr),arguments[0]):Tu(Se(this,wr),t,n,r);return Se(this,Bs)[o]}edgeAsObj(){const t=this.edge(...arguments);return typeof t!="object"?{label:t}:t}hasEdge(t,n,r){var o=arguments.length===1?Yv(Se(this,wr),arguments[0]):Tu(Se(this,wr),t,n,r);return Se(this,Bs).hasOwnProperty(o)}removeEdge(t,n,r){var o=arguments.length===1?Yv(Se(this,wr),arguments[0]):Tu(Se(this,wr),t,n,r),s=Se(this,Fs)[o];return s&&(t=s.v,n=s.w,delete Se(this,Bs)[o],delete Se(this,Fs)[o],cj(Se(this,Ta)[n],t),cj(Se(this,$a)[t],n),delete Se(this,as)[n][o],delete Se(this,is)[t][o],bu(this,mc)._--),this}inEdges(t,n){var r=Se(this,as)[t];if(r){var o=Object.values(r);return n?o.filter(s=>s.v===n):o}}outEdges(t,n){var r=Se(this,is)[t];if(r){var o=Object.values(r);return n?o.filter(s=>s.w===n):o}}nodeEdges(t,n){var r=this.inEdges(t,n);if(r)return r.concat(this.outEdges(t,n))}},wr=new WeakMap,Si=new WeakMap,Lr=new WeakMap,hd=new WeakMap,fc=new WeakMap,pc=new WeakMap,so=new WeakMap,as=new WeakMap,Ta=new WeakMap,is=new WeakMap,$a=new WeakMap,Fs=new WeakMap,Bs=new WeakMap,hc=new WeakMap,mc=new WeakMap,Hs=new WeakMap,Oo=new WeakMap,md=new WeakSet,_b=function(t){delete Se(this,Oo)[Se(this,Hs)[t]][t]},_j);function lj(e,t){e[t]?e[t]++:e[t]=1}function cj(e,t){--e[t]||delete e[t]}function Tu(e,t,n,r){var o=""+t,s=""+n;if(!e&&o>s){var i=o;o=s,s=i}return o+ij+s+ij+(r===void 0?Lde:r)}function Fde(e,t,n,r){var o=""+t,s=""+n;if(!e&&o>s){var i=o;o=s,s=i}var l={v:o,w:s};return r&&(l.name=r),l}function Yv(e,t){return Tu(e,t.v,t.w,t.name)}var qy=zde,Bde="2.1.13",Hde={Graph:qy,version:Bde},Wde=qy,Vde={write:Ude,read:qde};function Ude(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:Gde(e),edges:Kde(e)};return e.graph()!==void 0&&(t.value=structuredClone(e.graph())),t}function Gde(e){return e.nodes().map(function(t){var n=e.node(t),r=e.parent(t),o={v:t};return n!==void 0&&(o.value=n),r!==void 0&&(o.parent=r),o})}function Kde(e){return e.edges().map(function(t){var n=e.edge(t),r={v:t.v,w:t.w};return t.name!==void 0&&(r.name=t.name),n!==void 0&&(r.value=n),r})}function qde(e){var t=new Wde(e.options).setGraph(e.value);return e.nodes.forEach(function(n){t.setNode(n.v,n.value),n.parent&&t.setParent(n.v,n.parent)}),e.edges.forEach(function(n){t.setEdge({v:n.v,w:n.w,name:n.name},n.value)}),t}var Xde=Yde;function Yde(e){var t={},n=[],r;function o(s){t.hasOwnProperty(s)||(t[s]=!0,r.push(s),e.successors(s).forEach(o),e.predecessors(s).forEach(o))}return e.nodes().forEach(function(s){r=[],o(s),r.length&&n.push(r)}),n}var Jn,Ws,gd,jb,vd,Pb,gc,Wp,jj;let Qde=(jj=class{constructor(){en(this,gd);en(this,vd);en(this,gc);en(this,Jn,[]);en(this,Ws,{})}size(){return Se(this,Jn).length}keys(){return Se(this,Jn).map(function(t){return t.key})}has(t){return Se(this,Ws).hasOwnProperty(t)}priority(t){var n=Se(this,Ws)[t];if(n!==void 0)return Se(this,Jn)[n].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return Se(this,Jn)[0].key}add(t,n){var r=Se(this,Ws);if(t=String(t),!r.hasOwnProperty(t)){var o=Se(this,Jn),s=o.length;return r[t]=s,o.push({key:t,priority:n}),os(this,vd,Pb).call(this,s),!0}return!1}removeMin(){os(this,gc,Wp).call(this,0,Se(this,Jn).length-1);var t=Se(this,Jn).pop();return delete Se(this,Ws)[t.key],os(this,gd,jb).call(this,0),t.key}decrease(t,n){var r=Se(this,Ws)[t];if(n>Se(this,Jn)[r].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+Se(this,Jn)[r].priority+" New: "+n);Se(this,Jn)[r].priority=n,os(this,vd,Pb).call(this,r)}},Jn=new WeakMap,Ws=new WeakMap,gd=new WeakSet,jb=function(t){var n=Se(this,Jn),r=2*t,o=r+1,s=t;r<n.length&&(s=n[r].priority<n[s].priority?r:s,o<n.length&&(s=n[o].priority<n[s].priority?o:s),s!==t&&(os(this,gc,Wp).call(this,t,s),os(this,gd,jb).call(this,s)))},vd=new WeakSet,Pb=function(t){for(var n=Se(this,Jn),r=n[t].priority,o;t!==0&&(o=t>>1,!(n[o].priority<r));)os(this,gc,Wp).call(this,t,o),t=o},gc=new WeakSet,Wp=function(t,n){var r=Se(this,Jn),o=Se(this,Ws),s=r[t],i=r[n];r[t]=i,r[n]=s,o[i.key]=t,o[s.key]=n},jj);var XO=Qde,Zde=XO,YO=efe,Jde=()=>1;function efe(e,t,n,r){return tfe(e,String(t),n||Jde,r||function(o){return e.outEdges(o)})}function tfe(e,t,n,r){var o={},s=new Zde,i,l,u=function(p){var h=p.v!==i?p.v:p.w,m=o[h],v=n(p),b=l.distance+v;if(v<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+p+" Weight: "+v);b<m.distance&&(m.distance=b,m.predecessor=i,s.decrease(h,b))};for(e.nodes().forEach(function(p){var h=p===t?0:Number.POSITIVE_INFINITY;o[p]={distance:h},s.add(p,h)});s.size()>0&&(i=s.removeMin(),l=o[i],l.distance!==Number.POSITIVE_INFINITY);)r(i).forEach(u);return o}var nfe=YO,rfe=ofe;function ofe(e,t,n){return e.nodes().reduce(function(r,o){return r[o]=nfe(e,o,t,n),r},{})}var QO=sfe;function sfe(e){var t=0,n=[],r={},o=[];function s(i){var l=r[i]={onStack:!0,lowlink:t,index:t++};if(n.push(i),e.successors(i).forEach(function(h){r.hasOwnProperty(h)?r[h].onStack&&(l.lowlink=Math.min(l.lowlink,r[h].index)):(s(h),l.lowlink=Math.min(l.lowlink,r[h].lowlink))}),l.lowlink===l.index){var u=[],p;do p=n.pop(),r[p].onStack=!1,u.push(p);while(i!==p);o.push(u)}}return e.nodes().forEach(function(i){r.hasOwnProperty(i)||s(i)}),o}var afe=QO,ife=lfe;function lfe(e){return afe(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var cfe=dfe,ufe=()=>1;function dfe(e,t,n){return ffe(e,t||ufe,n||function(r){return e.outEdges(r)})}function ffe(e,t,n){var r={},o=e.nodes();return o.forEach(function(s){r[s]={},r[s][s]={distance:0},o.forEach(function(i){s!==i&&(r[s][i]={distance:Number.POSITIVE_INFINITY})}),n(s).forEach(function(i){var l=i.v===s?i.w:i.v,u=t(i);r[s][l]={distance:u,predecessor:s}})}),o.forEach(function(s){var i=r[s];o.forEach(function(l){var u=r[l];o.forEach(function(p){var h=u[s],m=i[p],v=u[p],b=h.distance+m.distance;b<v.distance&&(v.distance=b,v.predecessor=m.predecessor)})})}),r}function ZO(e){var t={},n={},r=[];function o(s){if(n.hasOwnProperty(s))throw new Ib;t.hasOwnProperty(s)||(n[s]=!0,t[s]=!0,e.predecessors(s).forEach(o),delete n[s],r.push(s))}if(e.sinks().forEach(o),Object.keys(t).length!==e.nodeCount())throw new Ib;return r}class Ib extends Error{constructor(){super(...arguments)}}var JO=ZO;ZO.CycleException=Ib;var uj=JO,pfe=hfe;function hfe(e){try{uj(e)}catch(t){if(t instanceof uj.CycleException)return!1;throw t}return!0}var e8=mfe;function mfe(e,t,n){Array.isArray(t)||(t=[t]);var r=e.isDirected()?l=>e.successors(l):l=>e.neighbors(l),o=n==="post"?gfe:vfe,s=[],i={};return t.forEach(l=>{if(!e.hasNode(l))throw new Error("Graph does not have node: "+l);o(l,r,i,s)}),s}function gfe(e,t,n,r){for(var o=[[e,!1]];o.length>0;){var s=o.pop();s[1]?r.push(s[0]):n.hasOwnProperty(s[0])||(n[s[0]]=!0,o.push([s[0],!0]),t8(t(s[0]),i=>o.push([i,!1])))}}function vfe(e,t,n,r){for(var o=[e];o.length>0;){var s=o.pop();n.hasOwnProperty(s)||(n[s]=!0,r.push(s),t8(t(s),i=>o.push(i)))}}function t8(e,t){for(var n=e.length;n--;)t(e[n],n,e);return e}var bfe=e8,xfe=yfe;function yfe(e,t){return bfe(e,t,"post")}var Cfe=e8,wfe=Sfe;function Sfe(e,t){return Cfe(e,t,"pre")}var kfe=qy,_fe=XO,jfe=Pfe;function Pfe(e,t){var n=new kfe,r={},o=new _fe,s;function i(u){var p=u.v===s?u.w:u.v,h=o.priority(p);if(h!==void 0){var m=t(u);m<h&&(r[p]=s,o.decrease(p,m))}}if(e.nodeCount()===0)return n;e.nodes().forEach(function(u){o.add(u,Number.POSITIVE_INFINITY),n.setNode(u)}),o.decrease(e.nodes()[0],0);for(var l=!1;o.size()>0;){if(s=o.removeMin(),r.hasOwnProperty(s))n.setEdge(s,r[s]);else{if(l)throw new Error("Input graph is not connected: "+e);l=!0}e.nodeEdges(s).forEach(i)}return n}var Ife={components:Xde,dijkstra:YO,dijkstraAll:rfe,findCycles:ife,floydWarshall:cfe,isAcyclic:pfe,postorder:xfe,preorder:wfe,prim:jfe,tarjan:QO,topsort:JO},dj=Hde,Efe={Graph:dj.Graph,json:Vde,alg:Ife,version:dj.version};const fj=Rc(Efe),Mfe=()=>{const e=Xb(),t=L(r=>r.nodes.shouldValidateGraph);return d.useCallback(({source:r,sourceHandle:o,target:s,targetHandle:i})=>{var b,y;if(!t)return!0;const l=e.getEdges(),u=e.getNodes();if(!(r&&o&&s&&i))return!1;const p=e.getNode(r),h=e.getNode(s);if(!(p&&h&&p.data&&h.data))return!1;const m=(b=p.data.outputs[o])==null?void 0:b.type,v=(y=h.data.inputs[i])==null?void 0:y.type;if(!m||!v||l.filter(x=>x.target===s&&x.targetHandle===i).find(x=>{x.source===r&&x.sourceHandle})||l.find(x=>x.target===s&&x.targetHandle===i)&&v!=="CollectionItem")return!1;if(m!==v){const x=m==="CollectionItem"&&!Us.includes(v),w=v==="CollectionItem"&&!Us.includes(m)&&!Gs.includes(m),k=Gs.includes(v)&&(()=>{if(!Gs.includes(v))return!1;const E=g5[v],M=v5[E];return m===E||m===M})(),_=m==="Collection"&&(Us.includes(v)||Gs.includes(v)),j=v==="Collection"&&Us.includes(m);return x||w||k||_||j||m==="integer"&&v==="float"}return n8(r,s,u,l)},[e,t])},n8=(e,t,n,r)=>{const o=new fj.Graph;return n.forEach(s=>{o.setNode(s.id)}),r.forEach(s=>{o.setEdge(s.source,s.target)}),o.setEdge(e,t),fj.alg.isAcyclic(o)},fd=e=>`var(--invokeai-colors-${e.split(".").join("-")})`,Ofe=ie(xe,({nodes:e})=>{const{shouldAnimateEdges:t,currentConnectionFieldType:n,shouldColorEdges:r}=e,o=fd(n&&r?Sd[n].color:"base.500");let s="react-flow__custom_connection-path";return t&&(s=s.concat(" animated")),{stroke:o,className:s}}),Dfe=({fromX:e,fromY:t,fromPosition:n,toX:r,toY:o,toPosition:s})=>{const{stroke:i,className:l}=L(Ofe),u={sourceX:e,sourceY:t,sourcePosition:n,targetX:r,targetY:o,targetPosition:s},[p]=Yb(u);return a.jsx("g",{children:a.jsx("path",{fill:"none",stroke:i,strokeWidth:2,className:l,d:p,style:{opacity:.8}})})},Rfe=d.memo(Dfe),r8=(e,t,n,r,o)=>ie(xe,({nodes:s})=>{var v,b;const i=s.nodes.find(y=>y.id===e),l=s.nodes.find(y=>y.id===n),u=Cn(i)&&Cn(l),p=(i==null?void 0:i.selected)||(l==null?void 0:l.selected)||o,h=u?(b=(v=i==null?void 0:i.data)==null?void 0:v.outputs[t||""])==null?void 0:b.type:void 0,m=h&&s.shouldColorEdges?fd(Sd[h].color):fd("base.500");return{isSelected:p,shouldAnimate:s.shouldAnimateEdges&&p,stroke:m}},we),Afe=({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o,targetPosition:s,markerEnd:i,data:l,selected:u,source:p,target:h,sourceHandleId:m,targetHandleId:v})=>{const b=d.useMemo(()=>r8(p,m,h,v,u),[u,p,m,h,v]),{isSelected:y,shouldAnimate:x}=L(b),[w,k,_]=Yb({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:s}),{base500:j}=Vd();return a.jsxs(a.Fragment,{children:[a.jsx(b5,{path:w,markerEnd:i,style:{strokeWidth:y?3:2,stroke:j,opacity:y?.8:.5,animation:x?"dashdraw 0.5s linear infinite":void 0,strokeDasharray:x?5:"none"}}),(l==null?void 0:l.count)&&l.count>1&&a.jsx(EA,{children:a.jsx($,{sx:{position:"absolute",transform:`translate(-50%, -50%) translate(${k}px,${_}px)`},className:"nodrag nopan",children:a.jsx(da,{variant:"solid",sx:{bg:"base.500",opacity:y?.8:.5,boxShadow:"base"},children:l.count})})})]})},Nfe=d.memo(Afe),Tfe=({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o,targetPosition:s,markerEnd:i,selected:l,source:u,target:p,sourceHandleId:h,targetHandleId:m})=>{const v=d.useMemo(()=>r8(u,h,p,m,l),[u,h,p,m,l]),{isSelected:b,shouldAnimate:y,stroke:x}=L(v),[w]=Yb({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:s});return a.jsx(b5,{path:w,markerEnd:i,style:{strokeWidth:b?3:2,stroke:x,opacity:b?.8:.5,animation:y?"dashdraw 0.5s linear infinite":void 0,strokeDasharray:y?5:"none"}})},$fe=d.memo(Tfe),Lfe=e=>{const{nodeId:t,width:n,children:r,selected:o}=e,{isMouseOverNode:s,handleMouseOut:i,handleMouseOver:l}=uO(t),u=d.useMemo(()=>ie(xe,({nodes:_})=>{var j;return((j=_.nodeExecutionStates[t])==null?void 0:j.status)===Ks.IN_PROGRESS}),[t]),p=L(u),[h,m,v,b]=ds("shadows",["nodeInProgress.light","nodeInProgress.dark","shadows.xl","shadows.base"]),y=ee(),x=Li(h,m),w=L(_=>_.nodes.nodeOpacity),k=d.useCallback(_=>{!_.ctrlKey&&!_.altKey&&!_.metaKey&&!_.shiftKey&&y(MA(t)),y(x5())},[y,t]);return a.jsxs(Ie,{onClick:k,onMouseEnter:l,onMouseLeave:i,className:Zi,sx:{h:"full",position:"relative",borderRadius:"base",w:n??d1,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:`${v}, ${b}, ${b}`,zIndex:-1}}),a.jsx(Ie,{sx:{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,borderRadius:"md",pointerEvents:"none",transitionProperty:"common",transitionDuration:"normal",opacity:.7,shadow:p?x:void 0,zIndex:-1}}),r,a.jsx(cO,{isSelected:o,isHovered:s})]})},Dg=d.memo(Lfe),zfe=ie(xe,({system:e,gallery:t})=>({imageDTO:t.selection[t.selection.length-1],progressImage:e.progressImage})),Ffe=e=>{const{progressImage:t,imageDTO:n}=OA(zfe);return t?a.jsx(Qv,{nodeProps:e,children:a.jsx(Qi,{src:t.dataURL,sx:{w:"full",h:"full",objectFit:"contain",borderRadius:"base"}})}):n?a.jsx(Qv,{nodeProps:e,children:a.jsx(oa,{imageDTO:n,isDragDisabled:!0,useThumbailFallback:!0})}):a.jsx(Qv,{nodeProps:e,children:a.jsx(Kn,{})})},Bfe=d.memo(Ffe),Qv=e=>{const[t,n]=d.useState(!1),r=()=>{n(!0)},o=()=>{n(!1)};return a.jsx(Dg,{nodeId:e.nodeProps.id,selected:e.nodeProps.selected,width:384,children:a.jsxs($,{onMouseEnter:r,onMouseLeave:o,className:Zi,sx:{position:"relative",flexDirection:"column"},children:[a.jsx($,{layerStyle:"nodeHeader",sx:{borderTopRadius:"base",alignItems:"center",justifyContent:"center",h:8},children:a.jsx(ye,{sx:{fontSize:"sm",fontWeight:600,color:"base.700",_dark:{color:"base.200"}},children:"Current Image"})}),a.jsxs($,{layerStyle:"nodeBody",sx:{w:"full",h:"full",borderBottomRadius:"base",p:2},children:[e.children,t&&a.jsx(vn.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(FO,{})},"nextPrevButtons")]})]})})},Hfe=e=>{const t=d.useMemo(()=>ie(xe,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return Cn(o)?o.data.embedWorkflow:!1},we),[e]);return L(t)},o8=e=>{const t=d.useMemo(()=>ie(xe,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return Cn(o)?Br(o.data.outputs,s=>DA.includes(s.type)):!1},we),[e]);return L(t)},Wfe=({nodeId:e})=>{const t=ee(),n=o8(e),r=Hfe(e),o=d.useCallback(s=>{t(RA({nodeId:e,embedWorkflow:s.target.checked}))},[t,e]);return n?a.jsxs(sn,{as:$,sx:{alignItems:"center",gap:2,w:"auto"},children:[a.jsx(Hn,{sx:{fontSize:"xs",mb:"1px"},children:"Embed Workflow"}),a.jsx(Sm,{className:"nopan",size:"sm",onChange:o,isChecked:r})]}):null},Vfe=d.memo(Wfe),Ufe=e=>{const t=d.useMemo(()=>ie(xe,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return Cn(o)?o.data.isIntermediate:!1},we),[e]);return L(t)},Gfe=({nodeId:e})=>{const t=ee(),n=o8(e),r=Ufe(e),o=d.useCallback(s=>{t(AA({nodeId:e,isIntermediate:!s.target.checked}))},[t,e]);return n?a.jsxs(sn,{as:$,sx:{alignItems:"center",gap:2,w:"auto"},children:[a.jsx(Hn,{sx:{fontSize:"xs",mb:"1px"},children:"Save to Gallery"}),a.jsx(Sm,{className:"nopan",size:"sm",onChange:o,isChecked:!r})]}):null},Kfe=d.memo(Gfe),qfe=({nodeId:e})=>a.jsxs($,{className:Zi,layerStyle:"nodeFooter",sx:{w:"full",borderBottomRadius:"base",px:2,py:0,h:6,justifyContent:"space-between"},children:[a.jsx(Vfe,{nodeId:e}),a.jsx(Kfe,{nodeId:e})]}),Xfe=d.memo(qfe),Yfe=({nodeId:e,isOpen:t})=>{const n=ee(),r=NA(),o=d.useCallback(()=>{n(TA({nodeId:e,isOpen:!t})),r(e)},[n,t,e,r]);return a.jsx(Te,{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(dg,{sx:{transform:t?"rotate(0deg)":"rotate(180deg)",transitionProperty:"common",transitionDuration:"normal"}})})},Xy=d.memo(Yfe),s8=e=>{const t=d.useMemo(()=>ie(xe,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return Cn(o)?o.data.label:!1},we),[e]);return L(t)},a8=e=>{const t=d.useMemo(()=>ie(xe,({nodes:r})=>{const o=r.nodes.find(i=>i.id===e);if(!Cn(o))return!1;const s=o?r.nodeTemplates[o.data.type]:void 0;return s==null?void 0:s.title},we),[e]);return L(t)},Qfe=({nodeId:e,title:t})=>{const n=ee(),r=s8(e),o=a8(e),{t:s}=Z(),[i,l]=d.useState(""),u=d.useCallback(async h=>{n($A({nodeId:e,label:h})),l(r||t||o||s("nodes.problemSettingTitle"))},[n,e,t,o,r,s]),p=d.useCallback(h=>{l(h)},[]);return d.useEffect(()=>{l(r||t||o||s("nodes.problemSettingTitle"))},[r,o,t,s]),a.jsx($,{sx:{overflow:"hidden",w:"full",h:"full",alignItems:"center",justifyContent:"center",cursor:"text"},children:a.jsxs(jm,{as:$,value:i,onChange:p,onSubmit:u,sx:{alignItems:"center",position:"relative",w:"full",h:"full"},children:[a.jsx(_m,{fontSize:"sm",sx:{p:0,w:"full"},noOfLines:1}),a.jsx(km,{className:"nodrag",fontSize:"sm",sx:{p:0,fontWeight:700,_focusVisible:{p:0,boxShadow:"none"}}}),a.jsx(Zfe,{})]})})},i8=d.memo(Qfe);function Zfe(){const{isEditing:e,getEditButtonProps:t}=Q5(),n=d.useCallback(r=>{const{onClick:o}=t();o&&o(r)},[t]);return e?null:a.jsx(Ie,{className:Zi,onDoubleClick:n,sx:{position:"absolute",w:"full",h:"full",top:0,cursor:"grab"}})}const Yy=e=>{const t=d.useMemo(()=>ie(xe,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return o==null?void 0:o.data},we),[e]);return L(t)},Jfe=({nodeId:e})=>{const t=Yy(e),{base400:n,base600:r}=Vd(),o=Li(n,r),s=d.useMemo(()=>({borderWidth:0,borderRadius:"3px",width:"1rem",height:"1rem",backgroundColor:o,zIndex:-1}),[o]);return Yp(t)?a.jsxs(a.Fragment,{children:[a.jsx(Ou,{type:"target",id:`${t.id}-collapsed-target`,isConnectable:!1,position:Ul.Left,style:{...s,left:"-0.5rem"}}),rr(t.inputs,i=>a.jsx(Ou,{type:"target",id:i.name,isConnectable:!1,position:Ul.Left,style:{visibility:"hidden"}},`${t.id}-${i.name}-collapsed-input-handle`)),a.jsx(Ou,{type:"source",id:`${t.id}-collapsed-source`,isConnectable:!1,position:Ul.Right,style:{...s,right:"-0.5rem"}}),rr(t.outputs,i=>a.jsx(Ou,{type:"source",id:i.name,isConnectable:!1,position:Ul.Right,style:{visibility:"hidden"}},`${t.id}-${i.name}-collapsed-output-handle`))]}):null},epe=d.memo(Jfe),tpe=e=>{const t=d.useMemo(()=>ie(xe,({nodes:r})=>{const o=r.nodes.find(i=>i.id===e);return r.nodeTemplates[(o==null?void 0:o.data.type)??""]},we),[e]);return L(t)},npe=({nodeId:e})=>{const t=ee(),n=Yy(e),{t:r}=Z(),o=d.useCallback(s=>{t(LA({nodeId:e,notes:s.target.value}))},[t,e]);return Yp(n)?a.jsxs(sn,{children:[a.jsx(Hn,{children:r("nodes.notes")}),a.jsx(sa,{value:n==null?void 0:n.notes,onChange:o,rows:10})]}):null},rpe=d.memo(npe),ope=e=>{const t=d.useMemo(()=>ie(xe,({nodes:r})=>{var i;const o=r.nodes.find(l=>l.id===e);if(!Cn(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:Rj(s.version,o.data.version)===0},we),[e]);return L(t)},spe=({nodeId:e})=>{const{isOpen:t,onOpen:n,onClose:r}=Mr(),o=s8(e),s=a8(e),i=ope(e),{t:l}=Z();return a.jsxs(a.Fragment,{children:[a.jsx(Rt,{label:a.jsx(l8,{nodeId:e}),placement:"top",shouldWrapChildren:!0,children:a.jsx($,{className:"nodrag",onClick:n,sx:{alignItems:"center",justifyContent:"center",w:8,h:8,cursor:"pointer"},children:a.jsx(Tn,{as:TE,sx:{boxSize:4,w:8,color:i?"base.400":"error.400"}})})}),a.jsxs(Hi,{isOpen:t,onClose:r,isCentered:!0,children:[a.jsx(Wo,{}),a.jsxs(Wi,{children:[a.jsx(Ho,{children:o||s||l("nodes.unknownNode")}),a.jsx(zd,{}),a.jsx(Vo,{children:a.jsx(rpe,{nodeId:e})}),a.jsx(gs,{})]})]})]})},ape=d.memo(spe),l8=d.memo(({nodeId:e})=>{const t=Yy(e),n=tpe(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(()=>!Yp(t)||!n?null:t.version?n.version?Mw(t.version,n.version,"<")?a.jsxs(ye,{as:"span",sx:{color:"error.500"},children:[r("nodes.version")," ",t.version," (",r("nodes.updateNode"),")"]}):Mw(t.version,n.version,">")?a.jsxs(ye,{as:"span",sx:{color:"error.500"},children:[r("nodes.version")," ",t.version," (",r("nodes.updateApp"),")"]}):a.jsxs(ye,{as:"span",children:[r("nodes.version")," ",t.version]}):a.jsxs(ye,{as:"span",sx:{color:"error.500"},children:[r("nodes.version")," ",t.version," (",r("nodes.unknownTemplate"),")"]}):a.jsx(ye,{as:"span",sx:{color:"error.500"},children:r("nodes.versionUnknown")}),[t,n,r]);return Yp(t)?a.jsxs($,{sx:{flexDir:"column"},children:[a.jsx(ye,{as:"span",sx:{fontWeight:600},children:o}),a.jsx(ye,{sx:{opacity:.7,fontStyle:"oblique 5deg"},children:n==null?void 0:n.description}),s,(t==null?void 0:t.notes)&&a.jsx(ye,{children:t.notes})]}):a.jsx(ye,{sx:{fontWeight:600},children:r("nodes.unknownNode")})});l8.displayName="TooltipContent";const Zv=3,pj={circle:{transitionProperty:"none",transitionDuration:"0s"},".chakra-progress__track":{stroke:"transparent"}},ipe=({nodeId:e})=>{const t=d.useMemo(()=>ie(xe,({nodes:r})=>r.nodeExecutionStates[e]),[e]),n=L(t);return n?a.jsx(Rt,{label:a.jsx(c8,{nodeExecutionState:n}),placement:"top",children:a.jsx($,{className:Zi,sx:{w:5,h:"full",alignItems:"center",justifyContent:"flex-end"},children:a.jsx(u8,{nodeExecutionState:n})})}):null},lpe=d.memo(ipe),c8=d.memo(({nodeExecutionState:e})=>{const{status:t,progress:n,progressImage:r}=e,{t:o}=Z();return t===Ks.PENDING?a.jsx(ye,{children:"Pending"}):t===Ks.IN_PROGRESS?r?a.jsxs($,{sx:{pos:"relative",pt:1.5,pb:.5},children:[a.jsx(Qi,{src:r.dataURL,sx:{w:32,h:32,borderRadius:"base",objectFit:"contain"}}),n!==null&&a.jsxs(da,{variant:"solid",sx:{pos:"absolute",top:2.5,insetInlineEnd:1},children:[Math.round(n*100),"%"]})]}):n!==null?a.jsxs(ye,{children:[o("nodes.executionStateInProgress")," (",Math.round(n*100),"%)"]}):a.jsx(ye,{children:o("nodes.executionStateInProgress")}):t===Ks.COMPLETED?a.jsx(ye,{children:o("nodes.executionStateCompleted")}):t===Ks.FAILED?a.jsx(ye,{children:o("nodes.executionStateError")}):null});c8.displayName="TooltipLabel";const u8=d.memo(e=>{const{progress:t,status:n}=e.nodeExecutionState;return n===Ks.PENDING?a.jsx(Tn,{as:IZ,sx:{boxSize:Zv,color:"base.600",_dark:{color:"base.300"}}}):n===Ks.IN_PROGRESS?t===null?a.jsx(N1,{isIndeterminate:!0,size:"14px",color:"base.500",thickness:14,sx:pj}):a.jsx(N1,{value:Math.round(t*100),size:"14px",color:"base.500",thickness:14,sx:pj}):n===Ks.COMPLETED?a.jsx(Tn,{as:OE,sx:{boxSize:Zv,color:"ok.600",_dark:{color:"ok.300"}}}):n===Ks.FAILED?a.jsx(Tn,{as:OZ,sx:{boxSize:Zv,color:"error.600",_dark:{color:"error.300"}}}):null});u8.displayName="StatusIcon";const cpe=({nodeId:e,isOpen:t})=>a.jsxs($,{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(Xy,{nodeId:e,isOpen:t}),a.jsx(i8,{nodeId:e}),a.jsxs($,{alignItems:"center",children:[a.jsx(lpe,{nodeId:e}),a.jsx(ape,{nodeId:e})]}),!t&&a.jsx(epe,{nodeId:e})]}),upe=d.memo(cpe),dpe=(e,t,n,r)=>ie(xe,o=>{if(!r)return vt.t("nodes.noFieldType");const{currentConnectionFieldType:s,connectionStartParams:i,nodes:l,edges:u}=o.nodes;if(!i||!s)return vt.t("nodes.noConnectionInProgress");const{handleType:p,nodeId:h,handleId:m}=i;if(!p||!h||!m)return vt.t("nodes.noConnectionData");const v=n==="target"?r:s,b=n==="source"?r:s;if(e===h)return vt.t("nodes.cannotConnectToSelf");if(n===p)return n==="source"?vt.t("nodes.cannotConnectOutputToOutput"):vt.t("nodes.cannotConnectInputToInput");if(u.find(x=>x.target===e&&x.targetHandle===t)&&v!=="CollectionItem")return vt.t("nodes.inputMayOnlyHaveOneConnection");if(b!==v){const x=b==="CollectionItem"&&!Us.includes(v),w=v==="CollectionItem"&&!Us.includes(b)&&!Gs.includes(b),k=Gs.includes(v)&&(()=>{if(!Gs.includes(v))return!1;const E=g5[v],M=v5[E];return b===E||b===M})(),_=b==="Collection"&&(Us.includes(v)||Gs.includes(v)),j=v==="Collection"&&Us.includes(b);if(!(x||w||k||_||j||b==="integer"&&v==="float"))return vt.t("nodes.fieldTypesMustMatch")}return n8(p==="source"?h:e,p==="source"?e:h,l,u)?null:vt.t("nodes.connectionWouldCreateCycle")}),fpe=(e,t,n)=>{const r=d.useMemo(()=>ie(xe,({nodes:s})=>{var l;const i=s.nodes.find(u=>u.id===e);if(Cn(i))return(l=i==null?void 0:i.data[Ub[n]][t])==null?void 0:l.type},we),[t,n,e]);return L(r)},ppe=ie(xe,({nodes:e})=>e.currentConnectionFieldType!==null&&e.connectionStartParams!==null),d8=({nodeId:e,fieldName:t,kind:n})=>{const r=fpe(e,t,n),o=d.useMemo(()=>ie(xe,({nodes:v})=>!!v.edges.filter(b=>(n==="input"?b.target:b.source)===e&&(n==="input"?b.targetHandle:b.sourceHandle)===t).length),[t,n,e]),s=d.useMemo(()=>dpe(e,t,n==="input"?"target":"source",r),[e,t,n,r]),i=d.useMemo(()=>ie(xe,({nodes:v})=>{var b,y,x;return((b=v.connectionStartParams)==null?void 0:b.nodeId)===e&&((y=v.connectionStartParams)==null?void 0:y.handleId)===t&&((x=v.connectionStartParams)==null?void 0:x.handleType)==={input:"target",output:"source"}[n]}),[t,n,e]),l=L(o),u=L(ppe),p=L(i),h=L(s),m=d.useMemo(()=>!!(u&&h&&!p),[h,u,p]);return{isConnected:l,isConnectionInProgress:u,isConnectionStartField:p,connectionError:h,shouldDim:m}},hpe=e=>{const{fieldTemplate:t,handleType:n,isConnectionInProgress:r,isConnectionStartField:o,connectionError:s}=e,{name:i,type:l}=t,{color:u,title:p}=Sd[l],h=d.useMemo(()=>{const v=Us.includes(l),b=Gs.includes(l),y=zA.includes(l),x=fd(u),w={backgroundColor:v||b?"var(--invokeai-colors-base-900)":x,position:"absolute",width:"1rem",height:"1rem",borderWidth:v||b?4:0,borderStyle:"solid",borderColor:x,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]),m=d.useMemo(()=>r&&o?p:r&&s?s??p:p,[s,r,o,p]);return a.jsx(Rt,{label:m,placement:n==="target"?"start":"end",hasArrow:!0,openDelay:xm,children:a.jsx(Ou,{type:n,id:i,position:n==="target"?Ul.Left:Ul.Right,style:h})})},f8=d.memo(hpe),mpe=({nodeId:e,fieldName:t})=>{const n=kg(e,t,"output"),{isConnected:r,isConnectionInProgress:o,isConnectionStartField:s,connectionError:i,shouldDim:l}=d8({nodeId:e,fieldName:t,kind:"output"});return(n==null?void 0:n.fieldKind)!=="output"?a.jsx(Eb,{shouldDim:l,children:a.jsxs(sn,{sx:{color:"error.400",textAlign:"right",fontSize:"sm"},children:["Unknown output: ",t]})}):a.jsxs(Eb,{shouldDim:l,children:[a.jsx(Rt,{label:a.jsx(Ly,{nodeId:e,fieldName:t,kind:"output"}),openDelay:xm,placement:"top",shouldWrapChildren:!0,hasArrow:!0,children:a.jsx(sn,{isDisabled:r,pe:2,children:a.jsx(Hn,{sx:{mb:0,fontWeight:500},children:n==null?void 0:n.title})})}),a.jsx(f8,{fieldTemplate:n,handleType:"source",isConnectionInProgress:o,isConnectionStartField:s,connectionError:i})]})},gpe=d.memo(mpe),Eb=d.memo(({shouldDim:e,children:t})=>a.jsx($,{sx:{position:"relative",minH:8,py:.5,alignItems:"center",opacity:e?.5:1,transitionProperty:"opacity",transitionDuration:"0.1s",justifyContent:"flex-end"},children:t}));Eb.displayName="OutputFieldWrapper";const vpe=(e,t)=>{const n=d.useMemo(()=>ie(xe,({nodes:o})=>{var i;const s=o.nodes.find(l=>l.id===e);if(Cn(s))return((i=s==null?void 0:s.data.inputs[t])==null?void 0:i.value)!==void 0},we),[t,e]);return L(n)},bpe=(e,t)=>{const n=d.useMemo(()=>ie(xe,({nodes:o})=>{const s=o.nodes.find(u=>u.id===e);if(!Cn(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},we),[t,e]);return L(n)},xpe=({nodeId:e,fieldName:t,kind:n,children:r})=>{const o=ee(),s=dO(e,t),i=fO(e,t,n),l=bpe(e,t),{t:u}=Z(),p=d.useCallback(w=>{w.preventDefault()},[]),h=d.useMemo(()=>ie(xe,({nodes:w})=>({isExposed:!!w.workflow.exposedFields.find(_=>_.nodeId===e&&_.fieldName===t)}),we),[t,e]),m=d.useMemo(()=>["any","direct"].includes(l??"__UNKNOWN_INPUT__"),[l]),{isExposed:v}=L(h),b=d.useCallback(()=>{o(FA({nodeId:e,fieldName:t}))},[o,t,e]),y=d.useCallback(()=>{o(o5({nodeId:e,fieldName:t}))},[o,t,e]),x=d.useMemo(()=>{const w=[];return m&&!v&&w.push(a.jsx(Wt,{icon:a.jsx(ol,{}),onClick:b,children:"Add to Linear View"},`${e}.${t}.expose-field`)),m&&v&&w.push(a.jsx(Wt,{icon:a.jsx(VZ,{}),onClick:y,children:"Remove from Linear View"},`${e}.${t}.unexpose-field`)),w},[t,b,y,v,m,e]);return a.jsx(ky,{menuProps:{size:"sm",isLazy:!0},menuButtonProps:{bg:"transparent",_hover:{bg:"transparent"}},renderMenu:()=>x.length?a.jsx(Ka,{sx:{visibility:"visible !important"},motionProps:vc,onContextMenu:p,children:a.jsx(Sc,{title:s||i||u("nodes.unknownField"),children:x})}):null,children:r})},ype=d.memo(xpe),Cpe=({nodeId:e,fieldName:t})=>{const n=kg(e,t,"input"),r=vpe(e,t),{isConnected:o,isConnectionInProgress:s,isConnectionStartField:i,connectionError:l,shouldDim:u}=d8({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(Mb,{shouldDim:u,children:a.jsxs(sn,{sx:{color:"error.400",textAlign:"left",fontSize:"sm"},children:["Unknown input: ",t]})}):a.jsxs(Mb,{shouldDim:u,children:[a.jsxs(sn,{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(ype,{nodeId:e,fieldName:t,kind:"input",children:h=>a.jsx(Hn,{sx:{display:"flex",alignItems:"center",h:"full",mb:0,px:1,gap:2},children:a.jsx(hO,{ref:h,nodeId:e,fieldName:t,kind:"input",isMissingInput:p,withTooltip:!0})})}),a.jsx(Ie,{children:a.jsx(_O,{nodeId:e,fieldName:t})})]}),n.input!=="direct"&&a.jsx(f8,{fieldTemplate:n,handleType:"target",isConnectionInProgress:s,isConnectionStartField:i,connectionError:l})]})},hj=d.memo(Cpe),Mb=d.memo(({shouldDim:e,children:t})=>a.jsx($,{sx:{position:"relative",minH:8,py:.5,alignItems:"center",opacity:e?.5:1,transitionProperty:"opacity",transitionDuration:"0.1s",w:"full",h:"full"},children:t}));Mb.displayName="InputFieldWrapper";const wpe=e=>{const t=d.useMemo(()=>ie(xe,({nodes:r})=>{const o=r.nodes.find(i=>i.id===e);if(!Cn(o))return[];const s=r.nodeTemplates[o.data.type];return s?rr(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"):[]},we),[e]);return L(t)},Spe=e=>{const t=d.useMemo(()=>ie(xe,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return Cn(o)?Br(o.data.outputs,s=>BA.includes(s.type)):!1},we),[e]);return L(t)},kpe=e=>{const t=d.useMemo(()=>ie(xe,({nodes:r})=>{const o=r.nodes.find(i=>i.id===e);if(!Cn(o))return[];const s=r.nodeTemplates[o.data.type];return s?rr(s.inputs).filter(i=>i.input==="connection").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"):[]},we),[e]);return L(t)},_pe=e=>{const t=d.useMemo(()=>ie(xe,({nodes:r})=>{const o=r.nodes.find(i=>i.id===e);if(!Cn(o))return[];const s=r.nodeTemplates[o.data.type];return s?rr(s.inputs).filter(i=>["any","direct"].includes(i.input)).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"):[]},we),[e]);return L(t)},jpe=({nodeId:e,isOpen:t,label:n,type:r,selected:o})=>{const s=kpe(e),i=_pe(e),l=wpe(e),u=Spe(e);return a.jsxs(Dg,{nodeId:e,selected:o,children:[a.jsx(upe,{nodeId:e,isOpen:t,label:n,selected:o,type:r}),t&&a.jsxs(a.Fragment,{children:[a.jsx($,{layerStyle:"nodeBody",sx:{flexDirection:"column",w:"full",h:"full",py:2,gap:1,borderBottomRadius:u?0:"base"},children:a.jsxs($,{sx:{flexDir:"column",px:2,w:"full",h:"full"},children:[a.jsxs(Ga,{gridTemplateColumns:"1fr auto",gridAutoRows:"1fr",children:[s.map((p,h)=>a.jsx(td,{gridColumnStart:1,gridRowStart:h+1,children:a.jsx(hj,{nodeId:e,fieldName:p})},`${e}.${p}.input-field`)),l.map((p,h)=>a.jsx(td,{gridColumnStart:2,gridRowStart:h+1,children:a.jsx(gpe,{nodeId:e,fieldName:p})},`${e}.${p}.output-field`))]}),i.map(p=>a.jsx(hj,{nodeId:e,fieldName:p},`${e}.${p}.input-field`))]})}),u&&a.jsx(Xfe,{nodeId:e})]})]})},Ppe=d.memo(jpe),Ipe=({nodeId:e,isOpen:t,label:n,type:r,selected:o})=>a.jsxs(Dg,{nodeId:e,selected:o,children:[a.jsxs($,{className:Zi,layerStyle:"nodeHeader",sx:{borderTopRadius:"base",borderBottomRadius:t?0:"base",alignItems:"center",h:8,fontWeight:600,fontSize:"sm"},children:[a.jsx(Xy,{nodeId:e,isOpen:t}),a.jsx(ye,{sx:{w:"full",textAlign:"center",pe:8,color:"error.500",_dark:{color:"error.300"}},children:n?`${n} (${r})`:r})]}),t&&a.jsx($,{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(ye,{as:"span",children:"Unknown node type: "}),a.jsx(ye,{as:"span",fontWeight:600,children:r})]})})]}),Epe=d.memo(Ipe),Mpe=e=>{const{data:t,selected:n}=e,{id:r,type:o,isOpen:s,label:i}=t,l=d.useMemo(()=>ie(xe,({nodes:p})=>!!p.nodeTemplates[o]),[o]);return L(l)?a.jsx(Ppe,{nodeId:r,isOpen:s,label:i,type:o,selected:n}):a.jsx(Epe,{nodeId:r,isOpen:s,label:i,type:o,selected:n})},Ope=d.memo(Mpe),Dpe=e=>{const{id:t,data:n,selected:r}=e,{notes:o,isOpen:s}=n,i=ee(),l=d.useCallback(u=>{i(HA({nodeId:t,value:u.target.value}))},[i,t]);return a.jsxs(Dg,{nodeId:t,selected:r,children:[a.jsxs($,{layerStyle:"nodeHeader",sx:{borderTopRadius:"base",borderBottomRadius:s?0:"base",alignItems:"center",justifyContent:"space-between",h:8},children:[a.jsx(Xy,{nodeId:t,isOpen:s}),a.jsx(i8,{nodeId:t,title:"Notes"}),a.jsx(Ie,{minW:8})]}),s&&a.jsx(a.Fragment,{children:a.jsx($,{layerStyle:"nodeBody",className:"nopan",sx:{cursor:"auto",flexDirection:"column",borderBottomRadius:"base",w:"full",h:"full",p:2,gap:1},children:a.jsx($,{className:"nopan",sx:{flexDir:"column",w:"full",h:"full"},children:a.jsx(sa,{value:o,onChange:l,rows:8,resize:"none",sx:{fontSize:"xs"}})})})})]})},Rpe=d.memo(Dpe),Ape=["Delete","Backspace"],Npe={collapsed:Nfe,default:$fe},Tpe={invocation:Ope,current_image:Bfe,notes:Rpe},$pe={hideAttribution:!0},Lpe=ie(xe,({nodes:e})=>{const{shouldSnapToGrid:t,selectionMode:n}=e;return{shouldSnapToGrid:t,selectionMode:n}},we),zpe=()=>{const e=ee(),t=L(j=>j.nodes.nodes),n=L(j=>j.nodes.edges),r=L(j=>j.nodes.viewport),{shouldSnapToGrid:o,selectionMode:s}=L(Lpe),i=Mfe(),[l]=ds("radii",["base"]),u=d.useCallback(j=>{e(WA(j))},[e]),p=d.useCallback(j=>{e(VA(j))},[e]),h=d.useCallback((j,I)=>{e(UA(I))},[e]),m=d.useCallback(j=>{e(GA(j))},[e]),v=d.useCallback(()=>{e(KA())},[e]),b=d.useCallback(j=>{e(qA(j))},[e]),y=d.useCallback(j=>{e(XA(j))},[e]),x=d.useCallback(({nodes:j,edges:I})=>{e(YA(j?j.map(E=>E.id):[])),e(QA(I?I.map(E=>E.id):[]))},[e]),w=d.useCallback((j,I)=>{e(ZA(I))},[e]),k=d.useCallback(()=>{e(x5())},[e]),_=d.useCallback(j=>{JA.set(j),j.fitView()},[]);return Ze(["Ctrl+c","Meta+c"],j=>{j.preventDefault(),e(e9())}),Ze(["Ctrl+a","Meta+a"],j=>{j.preventDefault(),e(t9())}),Ze(["Ctrl+v","Meta+v"],j=>{j.preventDefault(),e(n9())}),a.jsx(r9,{id:"workflow-editor",defaultViewport:r,nodeTypes:Tpe,edgeTypes:Npe,nodes:t,edges:n,onInit:_,onNodesChange:u,onEdgesChange:p,onEdgesDelete:b,onNodesDelete:y,onConnectStart:h,onConnect:m,onConnectEnd:v,onMoveEnd:w,connectionLineComponent:Rfe,onSelectionChange:x,isValidConnection:i,minZoom:.1,snapToGrid:o,snapGrid:[25,25],connectionRadius:30,proOptions:$pe,style:{borderRadius:l},onPaneClick:k,deleteKeyCode:Ape,selectionMode:s,children:a.jsx(cT,{})})},Fpe=()=>{const e=ee(),{t}=Z(),n=d.useCallback(()=>{e(m5())},[e]);return a.jsx($,{sx:{gap:2,position:"absolute",top:2,insetInlineStart:2},children:a.jsx(Te,{tooltip:t("nodes.addNodeToolTip"),"aria-label":t("nodes.addNode"),icon:a.jsx(ol,{}),onClick:n})})},Bpe=d.memo(Fpe),Hpe=()=>{const e=ee(),t=zP("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=o9.safeParse(l);if(!u.success){const{message:p}=s9(u.error,{prefix:n("nodes.workflowValidation")});t.error({error:a9(u.error)},p),e(Tt(Ft({title:n("nodes.unableToValidateWorkflow"),status:"error",duration:5e3}))),s.abort();return}e(Wb(u.data)),s.abort()}catch{e(Tt(Ft({title:n("nodes.unableToLoadWorkflow"),status:"error"})))}},s.readAsText(o)},[e,t,n])},Wpe=d.memo(e=>e.error.issues[0]?a.jsx(ye,{children:xw(e.error.issues[0],{prefix:null}).toString()}):a.jsx(Od,{children:e.error.issues.map((t,n)=>a.jsx(lo,{children:a.jsx(ye,{children:xw(t,{prefix:null}).toString()})},n))}));Wpe.displayName="WorkflowValidationErrorContent";const Vpe=()=>{const{t:e}=Z(),t=d.useRef(null),n=Hpe();return a.jsx(aE,{resetRef:t,accept:"application/json",onChange:n,children:r=>a.jsx(Te,{icon:a.jsx(og,{}),tooltip:e("nodes.loadWorkflow"),"aria-label":e("nodes.loadWorkflow"),...r})})},Upe=d.memo(Vpe),Gpe=()=>{const{t:e}=Z(),t=ee(),{isOpen:n,onOpen:r,onClose:o}=Mr(),s=d.useRef(null),i=L(u=>u.nodes.nodes.length),l=d.useCallback(()=>{t(i9()),t(Tt(Ft({title:e("toast.nodesCleared"),status:"success"}))),o()},[t,e,o]);return a.jsxs(a.Fragment,{children:[a.jsx(Te,{icon:a.jsx(Kr,{}),tooltip:e("nodes.resetWorkflow"),"aria-label":e("nodes.resetWorkflow"),onClick:r,isDisabled:!i,colorScheme:"error"}),a.jsxs($d,{isOpen:n,onClose:o,leastDestructiveRef:s,isCentered:!0,children:[a.jsx(Wo,{}),a.jsxs(Ld,{children:[a.jsx(Ho,{fontSize:"lg",fontWeight:"bold",children:e("nodes.resetWorkflow")}),a.jsx(Vo,{py:4,children:a.jsxs($,{flexDir:"column",gap:2,children:[a.jsx(ye,{children:e("nodes.resetWorkflowDesc")}),a.jsx(ye,{variant:"subtext",children:e("nodes.resetWorkflowDesc2")})]})}),a.jsxs(gs,{children:[a.jsx(bc,{ref:s,onClick:o,children:e("common.cancel")}),a.jsx(bc,{colorScheme:"error",ml:3,onClick:l,children:e("common.accept")})]})]})]})]})},Kpe=d.memo(Gpe),qpe=()=>{const{t:e}=Z(),t=lO(),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(Te,{icon:a.jsx(ng,{}),tooltip:e("nodes.downloadWorkflow"),"aria-label":e("nodes.downloadWorkflow"),onClick:n})},Xpe=d.memo(qpe),Ype=()=>a.jsxs($,{sx:{gap:2,position:"absolute",top:2,insetInlineStart:"50%",transform:"translate(-50%)"},children:[a.jsx(Xpe,{}),a.jsx(Upe,{}),a.jsx(Kpe,{})]}),Qpe=d.memo(Ype),Zpe=()=>a.jsx($,{sx:{gap:2,flexDir:"column"},children:rr(Sd,({title:e,description:t,color:n},r)=>a.jsx(Rt,{label:t,children:a.jsx(da,{sx:{userSelect:"none",color:parseInt(n.split(".")[1]??"0",10)<500?"base.800":"base.50",bg:n},textAlign:"center",children:e})},r))}),Jpe=d.memo(Zpe),ehe=()=>{const{t:e}=Z(),t=ee(),n=d.useCallback(()=>{t(l9())},[t]);return a.jsx(it,{leftIcon:a.jsx(ZZ,{}),tooltip:e("nodes.reloadNodeTemplates"),"aria-label":e("nodes.reloadNodeTemplates"),onClick:n,children:e("nodes.reloadNodeTemplates")})},the=d.memo(ehe),Iu={fontWeight:600},nhe=ie(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===c9.Full}},we),rhe=Pe((e,t)=>{const{isOpen:n,onOpen:r,onClose:o}=Mr(),s=ee(),{shouldAnimateEdges:i,shouldValidateGraph:l,shouldSnapToGrid:u,shouldColorEdges:p,selectionModeIsChecked:h}=L(nhe),m=d.useCallback(k=>{s(u9(k.target.checked))},[s]),v=d.useCallback(k=>{s(d9(k.target.checked))},[s]),b=d.useCallback(k=>{s(f9(k.target.checked))},[s]),y=d.useCallback(k=>{s(p9(k.target.checked))},[s]),x=d.useCallback(k=>{s(h9(k.target.checked))},[s]),{t:w}=Z();return a.jsxs(a.Fragment,{children:[a.jsx(Te,{ref:t,"aria-label":w("nodes.workflowSettings"),tooltip:w("nodes.workflowSettings"),icon:a.jsx(RE,{}),onClick:r}),a.jsxs(Hi,{isOpen:n,onClose:o,size:"2xl",isCentered:!0,children:[a.jsx(Wo,{}),a.jsxs(Wi,{children:[a.jsx(Ho,{children:w("nodes.workflowSettings")}),a.jsx(zd,{}),a.jsx(Vo,{children:a.jsxs($,{sx:{flexDirection:"column",gap:4,py:4},children:[a.jsx(io,{size:"sm",children:"General"}),a.jsx(Vt,{formLabelProps:Iu,onChange:v,isChecked:i,label:w("nodes.animatedEdges"),helperText:w("nodes.animatedEdgesHelp")}),a.jsx(Vr,{}),a.jsx(Vt,{formLabelProps:Iu,isChecked:u,onChange:b,label:w("nodes.snapToGrid"),helperText:w("nodes.snapToGridHelp")}),a.jsx(Vr,{}),a.jsx(Vt,{formLabelProps:Iu,isChecked:p,onChange:y,label:w("nodes.colorCodeEdges"),helperText:w("nodes.colorCodeEdgesHelp")}),a.jsx(Vt,{formLabelProps:Iu,isChecked:h,onChange:x,label:w("nodes.fullyContainNodes"),helperText:w("nodes.fullyContainNodesHelp")}),a.jsx(io,{size:"sm",pt:4,children:"Advanced"}),a.jsx(Vt,{formLabelProps:Iu,isChecked:l,onChange:m,label:w("nodes.validateConnections"),helperText:w("nodes.validateConnectionsHelp")}),a.jsx(the,{})]})})]})]})]})}),ohe=d.memo(rhe),she=()=>{const e=L(t=>t.nodes.shouldShowFieldTypeLegend);return a.jsxs($,{sx:{gap:2,position:"absolute",top:2,insetInlineEnd:2},children:[a.jsx(ohe,{}),e&&a.jsx(Jpe,{})]})},ahe=d.memo(she);function ihe(){const e=ee(),t=L(o=>o.nodes.nodeOpacity),{t:n}=Z(),r=d.useCallback(o=>{e(m9(o))},[e]);return a.jsx($,{alignItems:"center",children:a.jsxs(Lx,{"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(Fx,{children:a.jsx(Bx,{})}),a.jsx(zx,{})]})})}function lhe(e){return Ne({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 che(e){return Ne({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 uhe(e){return Ne({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)}const dhe=()=>{const{t:e}=Z(),{zoomIn:t,zoomOut:n,fitView:r}=Xb(),o=ee(),s=L(h=>h.nodes.shouldShowMinimapPanel),i=d.useCallback(()=>{t()},[t]),l=d.useCallback(()=>{n()},[n]),u=d.useCallback(()=>{r()},[r]),p=d.useCallback(()=>{o(g9(!s))},[s,o]);return a.jsxs(mn,{isAttached:!0,orientation:"vertical",children:[a.jsx(Te,{tooltip:e("nodes.zoomInNodes"),"aria-label":e("nodes.zoomInNodes"),onClick:i,icon:a.jsx(uhe,{})}),a.jsx(Te,{tooltip:e("nodes.zoomOutNodes"),"aria-label":e("nodes.zoomOutNodes"),onClick:l,icon:a.jsx(che,{})}),a.jsx(Te,{tooltip:e("nodes.fitViewportNodes"),"aria-label":e("nodes.fitViewportNodes"),onClick:u,icon:a.jsx(RZ,{})}),a.jsx(Te,{tooltip:e(s?"nodes.hideMinimapnodes":"nodes.showMinimapnodes"),"aria-label":e(s?"nodes.hideMinimapnodes":"nodes.showMinimapnodes"),isChecked:s,onClick:p,icon:a.jsx(WZ,{})})]})},fhe=d.memo(dhe),phe=()=>a.jsxs($,{sx:{gap:2,position:"absolute",bottom:2,insetInlineStart:2},children:[a.jsx(fhe,{}),a.jsx(ihe,{})]}),hhe=d.memo(phe),mhe=_e(rT),ghe=()=>{const e=L(r=>r.nodes.shouldShowMinimapPanel),t=Li("var(--invokeai-colors-accent-300)","var(--invokeai-colors-accent-600)"),n=Li("var(--invokeai-colors-blackAlpha-300)","var(--invokeai-colors-blackAlpha-600)");return a.jsx($,{sx:{gap:2,position:"absolute",bottom:2,insetInlineEnd:2},children:e&&a.jsx(mhe,{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})})},vhe=d.memo(ghe),bhe=()=>{const e=L(n=>n.nodes.isReady),{t}=Z();return a.jsxs($,{layerStyle:"first",sx:{position:"relative",width:"full",height:"full",borderRadius:"base",alignItems:"center",justifyContent:"center"},children:[a.jsx(nr,{children:e&&a.jsxs(vn.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(zpe,{}),a.jsx($de,{}),a.jsx(Bpe,{}),a.jsx(Qpe,{}),a.jsx(ahe,{}),a.jsx(hhe,{}),a.jsx(vhe,{})]})}),a.jsx(nr,{children:!e&&a.jsx(vn.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($,{layerStyle:"first",sx:{position:"relative",width:"full",height:"full",borderRadius:"base",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:a.jsx(Kn,{label:t("nodes.loadingNodes"),icon:yg})})})})]})},xhe=d.memo(bhe),yhe=()=>a.jsx(v9,{children:a.jsx(xhe,{})}),Che=d.memo(yhe),whe=()=>a.jsx(BO,{}),She=d.memo(whe);var Ob={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Konva=void 0;var n=yw;Object.defineProperty(t,"Konva",{enumerable:!0,get:function(){return n.Konva}});const r=yw;e.exports=r.Konva})(Ob,Ob.exports);var khe=Ob.exports;const pd=Rc(khe);var p8={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 _he=function(t){var n={},r=d,o=Dp,s=Object.assign;function i(c){for(var f="https://reactjs.org/docs/error-decoder.html?invariant="+c,g=1;g<arguments.length;g++)f+="&args[]="+encodeURIComponent(arguments[g]);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"),h=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),b=Symbol.for("react.provider"),y=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),I=Symbol.for("react.offscreen"),E=Symbol.iterator;function M(c){return c===null||typeof c!="object"?null:(c=E&&c[E]||c["@@iterator"],typeof c=="function"?c:null)}function D(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 h:return"Fragment";case p:return"Portal";case v:return"Profiler";case m:return"StrictMode";case w:return"Suspense";case k:return"SuspenseList"}if(typeof c=="object")switch(c.$$typeof){case y:return(c.displayName||"Context")+".Consumer";case b:return(c._context.displayName||"Context")+".Provider";case x:var f=c.render;return c=c.displayName,c||(c=f.displayName||f.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case _:return f=c.displayName||null,f!==null?f:D(c.type)||"Memo";case j:f=c._payload,c=c._init;try{return D(c(f))}catch{}}return null}function R(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 D(f);case 8:return f===m?"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,g=c;if(c.alternate)for(;f.return;)f=f.return;else{c=f;do f=c,f.flags&4098&&(g=f.return),c=f.return;while(c)}return f.tag===3?g: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 g=c,C=f;;){var S=g.return;if(S===null)break;var P=S.alternate;if(P===null){if(C=S.return,C!==null){g=C;continue}break}if(S.child===P.child){for(P=S.child;P;){if(P===g)return O(S),c;if(P===C)return O(S),f;P=P.sibling}throw Error(i(188))}if(g.return!==C.return)g=S,C=P;else{for(var N=!1,J=S.child;J;){if(J===g){N=!0,g=S,C=P;break}if(J===C){N=!0,C=S,g=P;break}J=J.sibling}if(!N){for(J=P.child;J;){if(J===g){N=!0,g=P,C=S;break}if(J===C){N=!0,C=P,g=S;break}J=J.sibling}if(!N)throw Error(i(189))}}if(g.alternate!==C)throw Error(i(190))}if(g.tag!==3)throw Error(i(188));return g.stateNode.current===g?c:f}function K(c){return c=T(c),c!==null?F(c):null}function F(c){if(c.tag===5||c.tag===6)return c;for(c=c.child;c!==null;){var f=F(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 X=Array.isArray,W=t.getPublicInstance,z=t.getRootHostContext,Y=t.getChildHostContext,B=t.prepareForCommit,q=t.resetAfterCommit,re=t.createInstance,Q=t.appendInitialChild,le=t.finalizeInitialChildren,se=t.prepareUpdate,U=t.shouldSetTextContent,G=t.createTextInstance,te=t.scheduleTimeout,ae=t.cancelTimeout,oe=t.noTimeout,pe=t.isPrimaryRenderer,ue=t.supportsMutation,me=t.supportsPersistence,Ce=t.supportsHydration,ge=t.getInstanceFromNode,fe=t.preparePortalMount,De=t.getCurrentEventPriority,je=t.detachDeletedInstance,Be=t.supportsMicrotasks,rt=t.scheduleMicrotask,Ue=t.supportsTestSelectors,wt=t.findFiberRoot,Ye=t.getBoundingRect,tt=t.getTextContent,be=t.isHiddenSubtree,Re=t.matchAccessibilityRole,st=t.setFocusIfFocusable,mt=t.setupIntersectionObserver,ve=t.appendChild,Qe=t.appendChildToContainer,ot=t.commitTextUpdate,lt=t.commitMount,Me=t.commitUpdate,$e=t.insertBefore,At=t.insertInContainerBefore,ke=t.removeChild,ze=t.removeChildFromContainer,Le=t.resetTextContent,Ve=t.hideInstance,ct=t.hideTextInstance,bn=t.unhideInstance,jt=t.unhideTextInstance,Pt=t.clearContainer,sr=t.cloneInstance,Mn=t.createContainerChildSet,pn=t.appendChildToContainerChildSet,an=t.finalizeContainerChildren,Qt=t.replaceContainerChildren,mr=t.cloneHiddenInstance,wo=t.cloneHiddenTextInstance,ar=t.canHydrateInstance,ir=t.canHydrateTextInstance,Is=t.canHydrateSuspenseInstance,Es=t.isSuspenseInstancePending,ha=t.isSuspenseInstanceFallback,ma=t.getSuspenseInstanceFallbackErrorDetails,cl=t.registerSuspenseInstanceRetry,ga=t.getNextHydratableSibling,ul=t.getFirstHydratableChild,qe=t.getFirstHydratableChildWithinContainer,Nt=t.getFirstHydratableChildWithinSuspenseInstance,On=t.hydrateInstance,bt=t.hydrateTextInstance,va=t.hydrateSuspenseInstance,Ar=t.getNextHydratableInstanceAfterSuspenseInstance,Zd=t.commitHydratedContainer,Ag=t.commitHydratedSuspenseInstance,Ng=t.clearSuspenseBoundary,Dn=t.clearSuspenseBoundaryFromContainer,Ms=t.shouldDeleteUnhydratedTailInstances,Jd=t.didNotMatchHydratedContainerTextInstance,dl=t.didNotMatchHydratedTextInstance,Qc;function ai(c){if(Qc===void 0)try{throw Error()}catch(g){var f=g.stack.trim().match(/\n( *(at )?)/);Qc=f&&f[1]||""}return`
`+Qc+c}var Zc=!1;function Jc(c,f){if(!c||Zc)return"";Zc=!0;var g=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 S=Ee.stack.split(`
`),P=C.stack.split(`
`),N=S.length-1,J=P.length-1;1<=N&&0<=J&&S[N]!==P[J];)J--;for(;1<=N&&0<=J;N--,J--)if(S[N]!==P[J]){if(N!==1||J!==1)do if(N--,J--,0>J||S[N]!==P[J]){var de=`
`+S[N].replace(" at new "," at ");return c.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",c.displayName)),de}while(1<=N&&0<=J);break}}}finally{Zc=!1,Error.prepareStackTrace=g}return(c=c?c.displayName||c.name:"")?ai(c):""}var Tg=Object.prototype.hasOwnProperty,ba=[],Je=-1;function St(c){return{current:c}}function xt(c){0>Je||(c.current=ba[Je],ba[Je]=null,Je--)}function kt(c,f){Je++,ba[Je]=c.current,c.current=f}var qn={},Ut=St(qn),kn=St(!1),lr=qn;function fl(c,f){var g=c.type.contextTypes;if(!g)return qn;var C=c.stateNode;if(C&&C.__reactInternalMemoizedUnmaskedChildContext===f)return C.__reactInternalMemoizedMaskedChildContext;var S={},P;for(P in g)S[P]=f[P];return C&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=f,c.__reactInternalMemoizedMaskedChildContext=S),S}function gr(c){return c=c.childContextTypes,c!=null}function ef(){xt(kn),xt(Ut)}function e2(c,f,g){if(Ut.current!==qn)throw Error(i(168));kt(Ut,f),kt(kn,g)}function t2(c,f,g){var C=c.stateNode;if(f=f.childContextTypes,typeof C.getChildContext!="function")return g;C=C.getChildContext();for(var S in C)if(!(S in f))throw Error(i(108,R(c)||"Unknown",S));return s({},g,C)}function tf(c){return c=(c=c.stateNode)&&c.__reactInternalMemoizedMergedChildContext||qn,lr=Ut.current,kt(Ut,c),kt(kn,kn.current),!0}function n2(c,f,g){var C=c.stateNode;if(!C)throw Error(i(169));g?(c=t2(c,f,lr),C.__reactInternalMemoizedMergedChildContext=c,xt(kn),xt(Ut),kt(Ut,c)):xt(kn),kt(kn,g)}var So=Math.clz32?Math.clz32:P8,_8=Math.log,j8=Math.LN2;function P8(c){return c>>>=0,c===0?32:31-(_8(c)/j8|0)|0}var nf=64,rf=4194304;function eu(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 of(c,f){var g=c.pendingLanes;if(g===0)return 0;var C=0,S=c.suspendedLanes,P=c.pingedLanes,N=g&268435455;if(N!==0){var J=N&~S;J!==0?C=eu(J):(P&=N,P!==0&&(C=eu(P)))}else N=g&~S,N!==0?C=eu(N):P!==0&&(C=eu(P));if(C===0)return 0;if(f!==0&&f!==C&&!(f&S)&&(S=C&-C,P=f&-f,S>=P||S===16&&(P&4194240)!==0))return f;if(C&4&&(C|=g&16),f=c.entangledLanes,f!==0)for(c=c.entanglements,f&=C;0<f;)g=31-So(f),S=1<<g,C|=c[g],f&=~S;return C}function I8(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 E8(c,f){for(var g=c.suspendedLanes,C=c.pingedLanes,S=c.expirationTimes,P=c.pendingLanes;0<P;){var N=31-So(P),J=1<<N,de=S[N];de===-1?(!(J&g)||J&C)&&(S[N]=I8(J,f)):de<=f&&(c.expiredLanes|=J),P&=~J}}function $g(c){return c=c.pendingLanes&-1073741825,c!==0?c:c&1073741824?1073741824:0}function r2(){var c=nf;return nf<<=1,!(nf&4194240)&&(nf=64),c}function Lg(c){for(var f=[],g=0;31>g;g++)f.push(c);return f}function tu(c,f,g){c.pendingLanes|=f,f!==536870912&&(c.suspendedLanes=0,c.pingedLanes=0),c=c.eventTimes,f=31-So(f),c[f]=g}function M8(c,f){var g=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<g;){var S=31-So(g),P=1<<S;f[S]=0,C[S]=-1,c[S]=-1,g&=~P}}function zg(c,f){var g=c.entangledLanes|=f;for(c=c.entanglements;g;){var C=31-So(g),S=1<<C;S&f|c[C]&f&&(c[C]|=f),g&=~S}}var Et=0;function o2(c){return c&=-c,1<c?4<c?c&268435455?16:536870912:4:1}var Fg=o.unstable_scheduleCallback,s2=o.unstable_cancelCallback,O8=o.unstable_shouldYield,D8=o.unstable_requestPaint,Ln=o.unstable_now,Bg=o.unstable_ImmediatePriority,R8=o.unstable_UserBlockingPriority,Hg=o.unstable_NormalPriority,A8=o.unstable_IdlePriority,sf=null,Yo=null;function N8(c){if(Yo&&typeof Yo.onCommitFiberRoot=="function")try{Yo.onCommitFiberRoot(sf,c,void 0,(c.current.flags&128)===128)}catch{}}function T8(c,f){return c===f&&(c!==0||1/c===1/f)||c!==c&&f!==f}var ko=typeof Object.is=="function"?Object.is:T8,Os=null,af=!1,Wg=!1;function a2(c){Os===null?Os=[c]:Os.push(c)}function $8(c){af=!0,a2(c)}function Qo(){if(!Wg&&Os!==null){Wg=!0;var c=0,f=Et;try{var g=Os;for(Et=1;c<g.length;c++){var C=g[c];do C=C(!0);while(C!==null)}Os=null,af=!1}catch(S){throw Os!==null&&(Os=Os.slice(c+1)),Fg(Bg,Qo),S}finally{Et=f,Wg=!1}}return null}var pl=[],hl=0,lf=null,cf=0,Xr=[],Yr=0,ii=null,Ds=1,Rs="";function li(c,f){pl[hl++]=cf,pl[hl++]=lf,lf=c,cf=f}function i2(c,f,g){Xr[Yr++]=Ds,Xr[Yr++]=Rs,Xr[Yr++]=ii,ii=c;var C=Ds;c=Rs;var S=32-So(C)-1;C&=~(1<<S),g+=1;var P=32-So(f)+S;if(30<P){var N=S-S%5;P=(C&(1<<N)-1).toString(32),C>>=N,S-=N,Ds=1<<32-So(f)+S|g<<S|C,Rs=P+c}else Ds=1<<P|g<<S|C,Rs=c}function Vg(c){c.return!==null&&(li(c,1),i2(c,1,0))}function Ug(c){for(;c===lf;)lf=pl[--hl],pl[hl]=null,cf=pl[--hl],pl[hl]=null;for(;c===ii;)ii=Xr[--Yr],Xr[Yr]=null,Rs=Xr[--Yr],Xr[Yr]=null,Ds=Xr[--Yr],Xr[Yr]=null}var Nr=null,Qr=null,Zt=!1,nu=!1,_o=null;function l2(c,f){var g=no(5,null,null,0);g.elementType="DELETED",g.stateNode=f,g.return=c,f=c.deletions,f===null?(c.deletions=[g],c.flags|=16):f.push(g)}function c2(c,f){switch(c.tag){case 5:return f=ar(f,c.type,c.pendingProps),f!==null?(c.stateNode=f,Nr=c,Qr=ul(f),!0):!1;case 6:return f=ir(f,c.pendingProps),f!==null?(c.stateNode=f,Nr=c,Qr=null,!0):!1;case 13:if(f=Is(f),f!==null){var g=ii!==null?{id:Ds,overflow:Rs}:null;return c.memoizedState={dehydrated:f,treeContext:g,retryLane:1073741824},g=no(18,null,null,0),g.stateNode=f,g.return=c,c.child=g,Nr=c,Qr=null,!0}return!1;default:return!1}}function Gg(c){return(c.mode&1)!==0&&(c.flags&128)===0}function Kg(c){if(Zt){var f=Qr;if(f){var g=f;if(!c2(c,f)){if(Gg(c))throw Error(i(418));f=ga(g);var C=Nr;f&&c2(c,f)?l2(C,g):(c.flags=c.flags&-4097|2,Zt=!1,Nr=c)}}else{if(Gg(c))throw Error(i(418));c.flags=c.flags&-4097|2,Zt=!1,Nr=c}}}function u2(c){for(c=c.return;c!==null&&c.tag!==5&&c.tag!==3&&c.tag!==13;)c=c.return;Nr=c}function uf(c){if(!Ce||c!==Nr)return!1;if(!Zt)return u2(c),Zt=!0,!1;if(c.tag!==3&&(c.tag!==5||Ms(c.type)&&!U(c.type,c.memoizedProps))){var f=Qr;if(f){if(Gg(c))throw d2(),Error(i(418));for(;f;)l2(c,f),f=ga(f)}}if(u2(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));Qr=Ar(c)}else Qr=Nr?ga(c.stateNode):null;return!0}function d2(){for(var c=Qr;c;)c=ga(c)}function ml(){Ce&&(Qr=Nr=null,nu=Zt=!1)}function qg(c){_o===null?_o=[c]:_o.push(c)}var L8=l.ReactCurrentBatchConfig;function df(c,f){if(ko(c,f))return!0;if(typeof c!="object"||c===null||typeof f!="object"||f===null)return!1;var g=Object.keys(c),C=Object.keys(f);if(g.length!==C.length)return!1;for(C=0;C<g.length;C++){var S=g[C];if(!Tg.call(f,S)||!ko(c[S],f[S]))return!1}return!0}function z8(c){switch(c.tag){case 5:return ai(c.type);case 16:return ai("Lazy");case 13:return ai("Suspense");case 19:return ai("SuspenseList");case 0:case 2:case 15:return c=Jc(c.type,!1),c;case 11:return c=Jc(c.type.render,!1),c;case 1:return c=Jc(c.type,!0),c;default:return""}}function jo(c,f){if(c&&c.defaultProps){f=s({},f),c=c.defaultProps;for(var g in c)f[g]===void 0&&(f[g]=c[g]);return f}return f}var ff=St(null),pf=null,gl=null,Xg=null;function Yg(){Xg=gl=pf=null}function f2(c,f,g){pe?(kt(ff,f._currentValue),f._currentValue=g):(kt(ff,f._currentValue2),f._currentValue2=g)}function Qg(c){var f=ff.current;xt(ff),pe?c._currentValue=f:c._currentValue2=f}function Zg(c,f,g){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===g)break;c=c.return}}function vl(c,f){pf=c,Xg=gl=null,c=c.dependencies,c!==null&&c.firstContext!==null&&(c.lanes&f&&(vr=!0),c.firstContext=null)}function Zr(c){var f=pe?c._currentValue:c._currentValue2;if(Xg!==c)if(c={context:c,memoizedValue:f,next:null},gl===null){if(pf===null)throw Error(i(308));gl=c,pf.dependencies={lanes:0,firstContext:c}}else gl=gl.next=c;return f}var ci=null;function Jg(c){ci===null?ci=[c]:ci.push(c)}function p2(c,f,g,C){var S=f.interleaved;return S===null?(g.next=g,Jg(f)):(g.next=S.next,S.next=g),f.interleaved=g,Zo(c,C)}function Zo(c,f){c.lanes|=f;var g=c.alternate;for(g!==null&&(g.lanes|=f),g=c,c=c.return;c!==null;)c.childLanes|=f,g=c.alternate,g!==null&&(g.childLanes|=f),g=c,c=c.return;return g.tag===3?g.stateNode:null}var xa=!1;function e0(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function h2(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 As(c,f){return{eventTime:c,lane:f,tag:0,payload:null,callback:null,next:null}}function ya(c,f,g){var C=c.updateQueue;if(C===null)return null;if(C=C.shared,yt&2){var S=C.pending;return S===null?f.next=f:(f.next=S.next,S.next=f),C.pending=f,Zo(c,g)}return S=C.interleaved,S===null?(f.next=f,Jg(C)):(f.next=S.next,S.next=f),C.interleaved=f,Zo(c,g)}function hf(c,f,g){if(f=f.updateQueue,f!==null&&(f=f.shared,(g&4194240)!==0)){var C=f.lanes;C&=c.pendingLanes,g|=C,f.lanes=g,zg(c,g)}}function m2(c,f){var g=c.updateQueue,C=c.alternate;if(C!==null&&(C=C.updateQueue,g===C)){var S=null,P=null;if(g=g.firstBaseUpdate,g!==null){do{var N={eventTime:g.eventTime,lane:g.lane,tag:g.tag,payload:g.payload,callback:g.callback,next:null};P===null?S=P=N:P=P.next=N,g=g.next}while(g!==null);P===null?S=P=f:P=P.next=f}else S=P=f;g={baseState:C.baseState,firstBaseUpdate:S,lastBaseUpdate:P,shared:C.shared,effects:C.effects},c.updateQueue=g;return}c=g.lastBaseUpdate,c===null?g.firstBaseUpdate=f:c.next=f,g.lastBaseUpdate=f}function mf(c,f,g,C){var S=c.updateQueue;xa=!1;var P=S.firstBaseUpdate,N=S.lastBaseUpdate,J=S.shared.pending;if(J!==null){S.shared.pending=null;var de=J,Ee=de.next;de.next=null,N===null?P=Ee:N.next=Ee,N=de;var Ke=c.alternate;Ke!==null&&(Ke=Ke.updateQueue,J=Ke.lastBaseUpdate,J!==N&&(J===null?Ke.firstBaseUpdate=Ee:J.next=Ee,Ke.lastBaseUpdate=de))}if(P!==null){var pt=S.baseState;N=0,Ke=Ee=de=null,J=P;do{var He=J.lane,qt=J.eventTime;if((C&He)===He){Ke!==null&&(Ke=Ke.next={eventTime:qt,lane:0,tag:J.tag,payload:J.payload,callback:J.callback,next:null});e:{var Bt=c,yr=J;switch(He=f,qt=g,yr.tag){case 1:if(Bt=yr.payload,typeof Bt=="function"){pt=Bt.call(qt,pt,He);break e}pt=Bt;break e;case 3:Bt.flags=Bt.flags&-65537|128;case 0:if(Bt=yr.payload,He=typeof Bt=="function"?Bt.call(qt,pt,He):Bt,He==null)break e;pt=s({},pt,He);break e;case 2:xa=!0}}J.callback!==null&&J.lane!==0&&(c.flags|=64,He=S.effects,He===null?S.effects=[J]:He.push(J))}else qt={eventTime:qt,lane:He,tag:J.tag,payload:J.payload,callback:J.callback,next:null},Ke===null?(Ee=Ke=qt,de=pt):Ke=Ke.next=qt,N|=He;if(J=J.next,J===null){if(J=S.shared.pending,J===null)break;He=J,J=He.next,He.next=null,S.lastBaseUpdate=He,S.shared.pending=null}}while(1);if(Ke===null&&(de=pt),S.baseState=de,S.firstBaseUpdate=Ee,S.lastBaseUpdate=Ke,f=S.shared.interleaved,f!==null){S=f;do N|=S.lane,S=S.next;while(S!==f)}else P===null&&(S.shared.lanes=0);di|=N,c.lanes=N,c.memoizedState=pt}}function g2(c,f,g){if(c=f.effects,f.effects=null,c!==null)for(f=0;f<c.length;f++){var C=c[f],S=C.callback;if(S!==null){if(C.callback=null,C=g,typeof S!="function")throw Error(i(191,S));S.call(C)}}}var v2=new r.Component().refs;function t0(c,f,g,C){f=c.memoizedState,g=g(C,f),g=g==null?f:s({},f,g),c.memoizedState=g,c.lanes===0&&(c.updateQueue.baseState=g)}var gf={isMounted:function(c){return(c=c._reactInternals)?A(c)===c:!1},enqueueSetState:function(c,f,g){c=c._reactInternals;var C=Zn(),S=Sa(c),P=As(C,S);P.payload=f,g!=null&&(P.callback=g),f=ya(c,P,S),f!==null&&(to(f,c,S,C),hf(f,c,S))},enqueueReplaceState:function(c,f,g){c=c._reactInternals;var C=Zn(),S=Sa(c),P=As(C,S);P.tag=1,P.payload=f,g!=null&&(P.callback=g),f=ya(c,P,S),f!==null&&(to(f,c,S,C),hf(f,c,S))},enqueueForceUpdate:function(c,f){c=c._reactInternals;var g=Zn(),C=Sa(c),S=As(g,C);S.tag=2,f!=null&&(S.callback=f),f=ya(c,S,C),f!==null&&(to(f,c,C,g),hf(f,c,C))}};function b2(c,f,g,C,S,P,N){return c=c.stateNode,typeof c.shouldComponentUpdate=="function"?c.shouldComponentUpdate(C,P,N):f.prototype&&f.prototype.isPureReactComponent?!df(g,C)||!df(S,P):!0}function x2(c,f,g){var C=!1,S=qn,P=f.contextType;return typeof P=="object"&&P!==null?P=Zr(P):(S=gr(f)?lr:Ut.current,C=f.contextTypes,P=(C=C!=null)?fl(c,S):qn),f=new f(g,P),c.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=gf,c.stateNode=f,f._reactInternals=c,C&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=S,c.__reactInternalMemoizedMaskedChildContext=P),f}function y2(c,f,g,C){c=f.state,typeof f.componentWillReceiveProps=="function"&&f.componentWillReceiveProps(g,C),typeof f.UNSAFE_componentWillReceiveProps=="function"&&f.UNSAFE_componentWillReceiveProps(g,C),f.state!==c&&gf.enqueueReplaceState(f,f.state,null)}function n0(c,f,g,C){var S=c.stateNode;S.props=g,S.state=c.memoizedState,S.refs=v2,e0(c);var P=f.contextType;typeof P=="object"&&P!==null?S.context=Zr(P):(P=gr(f)?lr:Ut.current,S.context=fl(c,P)),S.state=c.memoizedState,P=f.getDerivedStateFromProps,typeof P=="function"&&(t0(c,f,P,g),S.state=c.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(f=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),f!==S.state&&gf.enqueueReplaceState(S,S.state,null),mf(c,g,S,C),S.state=c.memoizedState),typeof S.componentDidMount=="function"&&(c.flags|=4194308)}function ru(c,f,g){if(c=g.ref,c!==null&&typeof c!="function"&&typeof c!="object"){if(g._owner){if(g=g._owner,g){if(g.tag!==1)throw Error(i(309));var C=g.stateNode}if(!C)throw Error(i(147,c));var S=C,P=""+c;return f!==null&&f.ref!==null&&typeof f.ref=="function"&&f.ref._stringRef===P?f.ref:(f=function(N){var J=S.refs;J===v2&&(J=S.refs={}),N===null?delete J[P]:J[P]=N},f._stringRef=P,f)}if(typeof c!="string")throw Error(i(284));if(!g._owner)throw Error(i(290,c))}return c}function vf(c,f){throw c=Object.prototype.toString.call(f),Error(i(31,c==="[object Object]"?"object with keys {"+Object.keys(f).join(", ")+"}":c))}function C2(c){var f=c._init;return f(c._payload)}function w2(c){function f(ce,ne){if(c){var he=ce.deletions;he===null?(ce.deletions=[ne],ce.flags|=16):he.push(ne)}}function g(ce,ne){if(!c)return null;for(;ne!==null;)f(ce,ne),ne=ne.sibling;return null}function C(ce,ne){for(ce=new Map;ne!==null;)ne.key!==null?ce.set(ne.key,ne):ce.set(ne.index,ne),ne=ne.sibling;return ce}function S(ce,ne){return ce=_a(ce,ne),ce.index=0,ce.sibling=null,ce}function P(ce,ne,he){return ce.index=he,c?(he=ce.alternate,he!==null?(he=he.index,he<ne?(ce.flags|=2,ne):he):(ce.flags|=2,ne)):(ce.flags|=1048576,ne)}function N(ce){return c&&ce.alternate===null&&(ce.flags|=2),ce}function J(ce,ne,he,We){return ne===null||ne.tag!==6?(ne=W0(he,ce.mode,We),ne.return=ce,ne):(ne=S(ne,he),ne.return=ce,ne)}function de(ce,ne,he,We){var nt=he.type;return nt===h?Ke(ce,ne,he.props.children,We,he.key):ne!==null&&(ne.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===j&&C2(nt)===ne.type)?(We=S(ne,he.props),We.ref=ru(ce,ne,he),We.return=ce,We):(We=Wf(he.type,he.key,he.props,null,ce.mode,We),We.ref=ru(ce,ne,he),We.return=ce,We)}function Ee(ce,ne,he,We){return ne===null||ne.tag!==4||ne.stateNode.containerInfo!==he.containerInfo||ne.stateNode.implementation!==he.implementation?(ne=V0(he,ce.mode,We),ne.return=ce,ne):(ne=S(ne,he.children||[]),ne.return=ce,ne)}function Ke(ce,ne,he,We,nt){return ne===null||ne.tag!==7?(ne=mi(he,ce.mode,We,nt),ne.return=ce,ne):(ne=S(ne,he),ne.return=ce,ne)}function pt(ce,ne,he){if(typeof ne=="string"&&ne!==""||typeof ne=="number")return ne=W0(""+ne,ce.mode,he),ne.return=ce,ne;if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case u:return he=Wf(ne.type,ne.key,ne.props,null,ce.mode,he),he.ref=ru(ce,null,ne),he.return=ce,he;case p:return ne=V0(ne,ce.mode,he),ne.return=ce,ne;case j:var We=ne._init;return pt(ce,We(ne._payload),he)}if(X(ne)||M(ne))return ne=mi(ne,ce.mode,he,null),ne.return=ce,ne;vf(ce,ne)}return null}function He(ce,ne,he,We){var nt=ne!==null?ne.key:null;if(typeof he=="string"&&he!==""||typeof he=="number")return nt!==null?null:J(ce,ne,""+he,We);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case u:return he.key===nt?de(ce,ne,he,We):null;case p:return he.key===nt?Ee(ce,ne,he,We):null;case j:return nt=he._init,He(ce,ne,nt(he._payload),We)}if(X(he)||M(he))return nt!==null?null:Ke(ce,ne,he,We,null);vf(ce,he)}return null}function qt(ce,ne,he,We,nt){if(typeof We=="string"&&We!==""||typeof We=="number")return ce=ce.get(he)||null,J(ne,ce,""+We,nt);if(typeof We=="object"&&We!==null){switch(We.$$typeof){case u:return ce=ce.get(We.key===null?he:We.key)||null,de(ne,ce,We,nt);case p:return ce=ce.get(We.key===null?he:We.key)||null,Ee(ne,ce,We,nt);case j:var gt=We._init;return qt(ce,ne,he,gt(We._payload),nt)}if(X(We)||M(We))return ce=ce.get(he)||null,Ke(ne,ce,We,nt,null);vf(ne,We)}return null}function Bt(ce,ne,he,We){for(var nt=null,gt=null,ht=ne,Mt=ne=0,Bn=null;ht!==null&&Mt<he.length;Mt++){ht.index>Mt?(Bn=ht,ht=null):Bn=ht.sibling;var Ot=He(ce,ht,he[Mt],We);if(Ot===null){ht===null&&(ht=Bn);break}c&&ht&&Ot.alternate===null&&f(ce,ht),ne=P(Ot,ne,Mt),gt===null?nt=Ot:gt.sibling=Ot,gt=Ot,ht=Bn}if(Mt===he.length)return g(ce,ht),Zt&&li(ce,Mt),nt;if(ht===null){for(;Mt<he.length;Mt++)ht=pt(ce,he[Mt],We),ht!==null&&(ne=P(ht,ne,Mt),gt===null?nt=ht:gt.sibling=ht,gt=ht);return Zt&&li(ce,Mt),nt}for(ht=C(ce,ht);Mt<he.length;Mt++)Bn=qt(ht,ce,Mt,he[Mt],We),Bn!==null&&(c&&Bn.alternate!==null&&ht.delete(Bn.key===null?Mt:Bn.key),ne=P(Bn,ne,Mt),gt===null?nt=Bn:gt.sibling=Bn,gt=Bn);return c&&ht.forEach(function(ja){return f(ce,ja)}),Zt&&li(ce,Mt),nt}function yr(ce,ne,he,We){var nt=M(he);if(typeof nt!="function")throw Error(i(150));if(he=nt.call(he),he==null)throw Error(i(151));for(var gt=nt=null,ht=ne,Mt=ne=0,Bn=null,Ot=he.next();ht!==null&&!Ot.done;Mt++,Ot=he.next()){ht.index>Mt?(Bn=ht,ht=null):Bn=ht.sibling;var ja=He(ce,ht,Ot.value,We);if(ja===null){ht===null&&(ht=Bn);break}c&&ht&&ja.alternate===null&&f(ce,ht),ne=P(ja,ne,Mt),gt===null?nt=ja:gt.sibling=ja,gt=ja,ht=Bn}if(Ot.done)return g(ce,ht),Zt&&li(ce,Mt),nt;if(ht===null){for(;!Ot.done;Mt++,Ot=he.next())Ot=pt(ce,Ot.value,We),Ot!==null&&(ne=P(Ot,ne,Mt),gt===null?nt=Ot:gt.sibling=Ot,gt=Ot);return Zt&&li(ce,Mt),nt}for(ht=C(ce,ht);!Ot.done;Mt++,Ot=he.next())Ot=qt(ht,ce,Mt,Ot.value,We),Ot!==null&&(c&&Ot.alternate!==null&&ht.delete(Ot.key===null?Mt:Ot.key),ne=P(Ot,ne,Mt),gt===null?nt=Ot:gt.sibling=Ot,gt=Ot);return c&&ht.forEach(function(m7){return f(ce,m7)}),Zt&&li(ce,Mt),nt}function $s(ce,ne,he,We){if(typeof he=="object"&&he!==null&&he.type===h&&he.key===null&&(he=he.props.children),typeof he=="object"&&he!==null){switch(he.$$typeof){case u:e:{for(var nt=he.key,gt=ne;gt!==null;){if(gt.key===nt){if(nt=he.type,nt===h){if(gt.tag===7){g(ce,gt.sibling),ne=S(gt,he.props.children),ne.return=ce,ce=ne;break e}}else if(gt.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===j&&C2(nt)===gt.type){g(ce,gt.sibling),ne=S(gt,he.props),ne.ref=ru(ce,gt,he),ne.return=ce,ce=ne;break e}g(ce,gt);break}else f(ce,gt);gt=gt.sibling}he.type===h?(ne=mi(he.props.children,ce.mode,We,he.key),ne.return=ce,ce=ne):(We=Wf(he.type,he.key,he.props,null,ce.mode,We),We.ref=ru(ce,ne,he),We.return=ce,ce=We)}return N(ce);case p:e:{for(gt=he.key;ne!==null;){if(ne.key===gt)if(ne.tag===4&&ne.stateNode.containerInfo===he.containerInfo&&ne.stateNode.implementation===he.implementation){g(ce,ne.sibling),ne=S(ne,he.children||[]),ne.return=ce,ce=ne;break e}else{g(ce,ne);break}else f(ce,ne);ne=ne.sibling}ne=V0(he,ce.mode,We),ne.return=ce,ce=ne}return N(ce);case j:return gt=he._init,$s(ce,ne,gt(he._payload),We)}if(X(he))return Bt(ce,ne,he,We);if(M(he))return yr(ce,ne,he,We);vf(ce,he)}return typeof he=="string"&&he!==""||typeof he=="number"?(he=""+he,ne!==null&&ne.tag===6?(g(ce,ne.sibling),ne=S(ne,he),ne.return=ce,ce=ne):(g(ce,ne),ne=W0(he,ce.mode,We),ne.return=ce,ce=ne),N(ce)):g(ce,ne)}return $s}var bl=w2(!0),S2=w2(!1),ou={},Jr=St(ou),su=St(ou),xl=St(ou);function Jo(c){if(c===ou)throw Error(i(174));return c}function r0(c,f){kt(xl,f),kt(su,c),kt(Jr,ou),c=z(f),xt(Jr),kt(Jr,c)}function yl(){xt(Jr),xt(su),xt(xl)}function k2(c){var f=Jo(xl.current),g=Jo(Jr.current);f=Y(g,c.type,f),g!==f&&(kt(su,c),kt(Jr,f))}function o0(c){su.current===c&&(xt(Jr),xt(su))}var ln=St(0);function bf(c){for(var f=c;f!==null;){if(f.tag===13){var g=f.memoizedState;if(g!==null&&(g=g.dehydrated,g===null||Es(g)||ha(g)))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 s0=[];function a0(){for(var c=0;c<s0.length;c++){var f=s0[c];pe?f._workInProgressVersionPrimary=null:f._workInProgressVersionSecondary=null}s0.length=0}var xf=l.ReactCurrentDispatcher,i0=l.ReactCurrentBatchConfig,ui=0,cn=null,Rn=null,zn=null,yf=!1,au=!1,iu=0,F8=0;function Xn(){throw Error(i(321))}function l0(c,f){if(f===null)return!1;for(var g=0;g<f.length&&g<c.length;g++)if(!ko(c[g],f[g]))return!1;return!0}function c0(c,f,g,C,S,P){if(ui=P,cn=f,f.memoizedState=null,f.updateQueue=null,f.lanes=0,xf.current=c===null||c.memoizedState===null?V8:U8,c=g(C,S),au){P=0;do{if(au=!1,iu=0,25<=P)throw Error(i(301));P+=1,zn=Rn=null,f.updateQueue=null,xf.current=G8,c=g(C,S)}while(au)}if(xf.current=Sf,f=Rn!==null&&Rn.next!==null,ui=0,zn=Rn=cn=null,yf=!1,f)throw Error(i(300));return c}function u0(){var c=iu!==0;return iu=0,c}function es(){var c={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return zn===null?cn.memoizedState=zn=c:zn=zn.next=c,zn}function eo(){if(Rn===null){var c=cn.alternate;c=c!==null?c.memoizedState:null}else c=Rn.next;var f=zn===null?cn.memoizedState:zn.next;if(f!==null)zn=f,Rn=c;else{if(c===null)throw Error(i(310));Rn=c,c={memoizedState:Rn.memoizedState,baseState:Rn.baseState,baseQueue:Rn.baseQueue,queue:Rn.queue,next:null},zn===null?cn.memoizedState=zn=c:zn=zn.next=c}return zn}function lu(c,f){return typeof f=="function"?f(c):f}function d0(c){var f=eo(),g=f.queue;if(g===null)throw Error(i(311));g.lastRenderedReducer=c;var C=Rn,S=C.baseQueue,P=g.pending;if(P!==null){if(S!==null){var N=S.next;S.next=P.next,P.next=N}C.baseQueue=S=P,g.pending=null}if(S!==null){P=S.next,C=C.baseState;var J=N=null,de=null,Ee=P;do{var Ke=Ee.lane;if((ui&Ke)===Ke)de!==null&&(de=de.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 pt={lane:Ke,action:Ee.action,hasEagerState:Ee.hasEagerState,eagerState:Ee.eagerState,next:null};de===null?(J=de=pt,N=C):de=de.next=pt,cn.lanes|=Ke,di|=Ke}Ee=Ee.next}while(Ee!==null&&Ee!==P);de===null?N=C:de.next=J,ko(C,f.memoizedState)||(vr=!0),f.memoizedState=C,f.baseState=N,f.baseQueue=de,g.lastRenderedState=C}if(c=g.interleaved,c!==null){S=c;do P=S.lane,cn.lanes|=P,di|=P,S=S.next;while(S!==c)}else S===null&&(g.lanes=0);return[f.memoizedState,g.dispatch]}function f0(c){var f=eo(),g=f.queue;if(g===null)throw Error(i(311));g.lastRenderedReducer=c;var C=g.dispatch,S=g.pending,P=f.memoizedState;if(S!==null){g.pending=null;var N=S=S.next;do P=c(P,N.action),N=N.next;while(N!==S);ko(P,f.memoizedState)||(vr=!0),f.memoizedState=P,f.baseQueue===null&&(f.baseState=P),g.lastRenderedState=P}return[P,C]}function _2(){}function j2(c,f){var g=cn,C=eo(),S=f(),P=!ko(C.memoizedState,S);if(P&&(C.memoizedState=S,vr=!0),C=C.queue,p0(E2.bind(null,g,C,c),[c]),C.getSnapshot!==f||P||zn!==null&&zn.memoizedState.tag&1){if(g.flags|=2048,cu(9,I2.bind(null,g,C,S,f),void 0,null),Fn===null)throw Error(i(349));ui&30||P2(g,f,S)}return S}function P2(c,f,g){c.flags|=16384,c={getSnapshot:f,value:g},f=cn.updateQueue,f===null?(f={lastEffect:null,stores:null},cn.updateQueue=f,f.stores=[c]):(g=f.stores,g===null?f.stores=[c]:g.push(c))}function I2(c,f,g,C){f.value=g,f.getSnapshot=C,M2(f)&&O2(c)}function E2(c,f,g){return g(function(){M2(f)&&O2(c)})}function M2(c){var f=c.getSnapshot;c=c.value;try{var g=f();return!ko(c,g)}catch{return!0}}function O2(c){var f=Zo(c,1);f!==null&&to(f,c,1,-1)}function D2(c){var f=es();return typeof c=="function"&&(c=c()),f.memoizedState=f.baseState=c,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:lu,lastRenderedState:c},f.queue=c,c=c.dispatch=W8.bind(null,cn,c),[f.memoizedState,c]}function cu(c,f,g,C){return c={tag:c,create:f,destroy:g,deps:C,next:null},f=cn.updateQueue,f===null?(f={lastEffect:null,stores:null},cn.updateQueue=f,f.lastEffect=c.next=c):(g=f.lastEffect,g===null?f.lastEffect=c.next=c:(C=g.next,g.next=c,c.next=C,f.lastEffect=c)),c}function R2(){return eo().memoizedState}function Cf(c,f,g,C){var S=es();cn.flags|=c,S.memoizedState=cu(1|f,g,void 0,C===void 0?null:C)}function wf(c,f,g,C){var S=eo();C=C===void 0?null:C;var P=void 0;if(Rn!==null){var N=Rn.memoizedState;if(P=N.destroy,C!==null&&l0(C,N.deps)){S.memoizedState=cu(f,g,P,C);return}}cn.flags|=c,S.memoizedState=cu(1|f,g,P,C)}function A2(c,f){return Cf(8390656,8,c,f)}function p0(c,f){return wf(2048,8,c,f)}function N2(c,f){return wf(4,2,c,f)}function T2(c,f){return wf(4,4,c,f)}function $2(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 L2(c,f,g){return g=g!=null?g.concat([c]):null,wf(4,4,$2.bind(null,f,c),g)}function h0(){}function z2(c,f){var g=eo();f=f===void 0?null:f;var C=g.memoizedState;return C!==null&&f!==null&&l0(f,C[1])?C[0]:(g.memoizedState=[c,f],c)}function F2(c,f){var g=eo();f=f===void 0?null:f;var C=g.memoizedState;return C!==null&&f!==null&&l0(f,C[1])?C[0]:(c=c(),g.memoizedState=[c,f],c)}function B2(c,f,g){return ui&21?(ko(g,f)||(g=r2(),cn.lanes|=g,di|=g,c.baseState=!0),f):(c.baseState&&(c.baseState=!1,vr=!0),c.memoizedState=g)}function B8(c,f){var g=Et;Et=g!==0&&4>g?g:4,c(!0);var C=i0.transition;i0.transition={};try{c(!1),f()}finally{Et=g,i0.transition=C}}function H2(){return eo().memoizedState}function H8(c,f,g){var C=Sa(c);if(g={lane:C,action:g,hasEagerState:!1,eagerState:null,next:null},W2(c))V2(f,g);else if(g=p2(c,f,g,C),g!==null){var S=Zn();to(g,c,C,S),U2(g,f,C)}}function W8(c,f,g){var C=Sa(c),S={lane:C,action:g,hasEagerState:!1,eagerState:null,next:null};if(W2(c))V2(f,S);else{var P=c.alternate;if(c.lanes===0&&(P===null||P.lanes===0)&&(P=f.lastRenderedReducer,P!==null))try{var N=f.lastRenderedState,J=P(N,g);if(S.hasEagerState=!0,S.eagerState=J,ko(J,N)){var de=f.interleaved;de===null?(S.next=S,Jg(f)):(S.next=de.next,de.next=S),f.interleaved=S;return}}catch{}finally{}g=p2(c,f,S,C),g!==null&&(S=Zn(),to(g,c,C,S),U2(g,f,C))}}function W2(c){var f=c.alternate;return c===cn||f!==null&&f===cn}function V2(c,f){au=yf=!0;var g=c.pending;g===null?f.next=f:(f.next=g.next,g.next=f),c.pending=f}function U2(c,f,g){if(g&4194240){var C=f.lanes;C&=c.pendingLanes,g|=C,f.lanes=g,zg(c,g)}}var Sf={readContext:Zr,useCallback:Xn,useContext:Xn,useEffect:Xn,useImperativeHandle:Xn,useInsertionEffect:Xn,useLayoutEffect:Xn,useMemo:Xn,useReducer:Xn,useRef:Xn,useState:Xn,useDebugValue:Xn,useDeferredValue:Xn,useTransition:Xn,useMutableSource:Xn,useSyncExternalStore:Xn,useId:Xn,unstable_isNewReconciler:!1},V8={readContext:Zr,useCallback:function(c,f){return es().memoizedState=[c,f===void 0?null:f],c},useContext:Zr,useEffect:A2,useImperativeHandle:function(c,f,g){return g=g!=null?g.concat([c]):null,Cf(4194308,4,$2.bind(null,f,c),g)},useLayoutEffect:function(c,f){return Cf(4194308,4,c,f)},useInsertionEffect:function(c,f){return Cf(4,2,c,f)},useMemo:function(c,f){var g=es();return f=f===void 0?null:f,c=c(),g.memoizedState=[c,f],c},useReducer:function(c,f,g){var C=es();return f=g!==void 0?g(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=H8.bind(null,cn,c),[C.memoizedState,c]},useRef:function(c){var f=es();return c={current:c},f.memoizedState=c},useState:D2,useDebugValue:h0,useDeferredValue:function(c){return es().memoizedState=c},useTransition:function(){var c=D2(!1),f=c[0];return c=B8.bind(null,c[1]),es().memoizedState=c,[f,c]},useMutableSource:function(){},useSyncExternalStore:function(c,f,g){var C=cn,S=es();if(Zt){if(g===void 0)throw Error(i(407));g=g()}else{if(g=f(),Fn===null)throw Error(i(349));ui&30||P2(C,f,g)}S.memoizedState=g;var P={value:g,getSnapshot:f};return S.queue=P,A2(E2.bind(null,C,P,c),[c]),C.flags|=2048,cu(9,I2.bind(null,C,P,g,f),void 0,null),g},useId:function(){var c=es(),f=Fn.identifierPrefix;if(Zt){var g=Rs,C=Ds;g=(C&~(1<<32-So(C)-1)).toString(32)+g,f=":"+f+"R"+g,g=iu++,0<g&&(f+="H"+g.toString(32)),f+=":"}else g=F8++,f=":"+f+"r"+g.toString(32)+":";return c.memoizedState=f},unstable_isNewReconciler:!1},U8={readContext:Zr,useCallback:z2,useContext:Zr,useEffect:p0,useImperativeHandle:L2,useInsertionEffect:N2,useLayoutEffect:T2,useMemo:F2,useReducer:d0,useRef:R2,useState:function(){return d0(lu)},useDebugValue:h0,useDeferredValue:function(c){var f=eo();return B2(f,Rn.memoizedState,c)},useTransition:function(){var c=d0(lu)[0],f=eo().memoizedState;return[c,f]},useMutableSource:_2,useSyncExternalStore:j2,useId:H2,unstable_isNewReconciler:!1},G8={readContext:Zr,useCallback:z2,useContext:Zr,useEffect:p0,useImperativeHandle:L2,useInsertionEffect:N2,useLayoutEffect:T2,useMemo:F2,useReducer:f0,useRef:R2,useState:function(){return f0(lu)},useDebugValue:h0,useDeferredValue:function(c){var f=eo();return Rn===null?f.memoizedState=c:B2(f,Rn.memoizedState,c)},useTransition:function(){var c=f0(lu)[0],f=eo().memoizedState;return[c,f]},useMutableSource:_2,useSyncExternalStore:j2,useId:H2,unstable_isNewReconciler:!1};function Cl(c,f){try{var g="",C=f;do g+=z8(C),C=C.return;while(C);var S=g}catch(P){S=`
Error generating stack: `+P.message+`
`+P.stack}return{value:c,source:f,stack:S,digest:null}}function m0(c,f,g){return{value:c,source:null,stack:g??null,digest:f??null}}function g0(c,f){try{console.error(f.value)}catch(g){setTimeout(function(){throw g})}}var K8=typeof WeakMap=="function"?WeakMap:Map;function G2(c,f,g){g=As(-1,g),g.tag=3,g.payload={element:null};var C=f.value;return g.callback=function(){$f||($f=!0,T0=C),g0(c,f)},g}function K2(c,f,g){g=As(-1,g),g.tag=3;var C=c.type.getDerivedStateFromError;if(typeof C=="function"){var S=f.value;g.payload=function(){return C(S)},g.callback=function(){g0(c,f)}}var P=c.stateNode;return P!==null&&typeof P.componentDidCatch=="function"&&(g.callback=function(){g0(c,f),typeof C!="function"&&(Ca===null?Ca=new Set([this]):Ca.add(this));var N=f.stack;this.componentDidCatch(f.value,{componentStack:N!==null?N:""})}),g}function q2(c,f,g){var C=c.pingCache;if(C===null){C=c.pingCache=new K8;var S=new Set;C.set(f,S)}else S=C.get(f),S===void 0&&(S=new Set,C.set(f,S));S.has(g)||(S.add(g),c=i7.bind(null,c,f,g),f.then(c,c))}function X2(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 Y2(c,f,g,C,S){return c.mode&1?(c.flags|=65536,c.lanes=S,c):(c===f?c.flags|=65536:(c.flags|=128,g.flags|=131072,g.flags&=-52805,g.tag===1&&(g.alternate===null?g.tag=17:(f=As(-1,1),f.tag=2,ya(g,f,1))),g.lanes|=1),c)}var q8=l.ReactCurrentOwner,vr=!1;function cr(c,f,g,C){f.child=c===null?S2(f,null,g,C):bl(f,c.child,g,C)}function Q2(c,f,g,C,S){g=g.render;var P=f.ref;return vl(f,S),C=c0(c,f,g,C,P,S),g=u0(),c!==null&&!vr?(f.updateQueue=c.updateQueue,f.flags&=-2053,c.lanes&=~S,Ns(c,f,S)):(Zt&&g&&Vg(f),f.flags|=1,cr(c,f,C,S),f.child)}function Z2(c,f,g,C,S){if(c===null){var P=g.type;return typeof P=="function"&&!H0(P)&&P.defaultProps===void 0&&g.compare===null&&g.defaultProps===void 0?(f.tag=15,f.type=P,J2(c,f,P,C,S)):(c=Wf(g.type,null,C,f,f.mode,S),c.ref=f.ref,c.return=f,f.child=c)}if(P=c.child,!(c.lanes&S)){var N=P.memoizedProps;if(g=g.compare,g=g!==null?g:df,g(N,C)&&c.ref===f.ref)return Ns(c,f,S)}return f.flags|=1,c=_a(P,C),c.ref=f.ref,c.return=f,f.child=c}function J2(c,f,g,C,S){if(c!==null){var P=c.memoizedProps;if(df(P,C)&&c.ref===f.ref)if(vr=!1,f.pendingProps=C=P,(c.lanes&S)!==0)c.flags&131072&&(vr=!0);else return f.lanes=c.lanes,Ns(c,f,S)}return v0(c,f,g,C,S)}function eC(c,f,g){var C=f.pendingProps,S=C.children,P=c!==null?c.memoizedState:null;if(C.mode==="hidden")if(!(f.mode&1))f.memoizedState={baseLanes:0,cachePool:null,transitions:null},kt(Sl,Tr),Tr|=g;else{if(!(g&1073741824))return c=P!==null?P.baseLanes|g:g,f.lanes=f.childLanes=1073741824,f.memoizedState={baseLanes:c,cachePool:null,transitions:null},f.updateQueue=null,kt(Sl,Tr),Tr|=c,null;f.memoizedState={baseLanes:0,cachePool:null,transitions:null},C=P!==null?P.baseLanes:g,kt(Sl,Tr),Tr|=C}else P!==null?(C=P.baseLanes|g,f.memoizedState=null):C=g,kt(Sl,Tr),Tr|=C;return cr(c,f,S,g),f.child}function tC(c,f){var g=f.ref;(c===null&&g!==null||c!==null&&c.ref!==g)&&(f.flags|=512,f.flags|=2097152)}function v0(c,f,g,C,S){var P=gr(g)?lr:Ut.current;return P=fl(f,P),vl(f,S),g=c0(c,f,g,C,P,S),C=u0(),c!==null&&!vr?(f.updateQueue=c.updateQueue,f.flags&=-2053,c.lanes&=~S,Ns(c,f,S)):(Zt&&C&&Vg(f),f.flags|=1,cr(c,f,g,S),f.child)}function nC(c,f,g,C,S){if(gr(g)){var P=!0;tf(f)}else P=!1;if(vl(f,S),f.stateNode===null)_f(c,f),x2(f,g,C),n0(f,g,C,S),C=!0;else if(c===null){var N=f.stateNode,J=f.memoizedProps;N.props=J;var de=N.context,Ee=g.contextType;typeof Ee=="object"&&Ee!==null?Ee=Zr(Ee):(Ee=gr(g)?lr:Ut.current,Ee=fl(f,Ee));var Ke=g.getDerivedStateFromProps,pt=typeof Ke=="function"||typeof N.getSnapshotBeforeUpdate=="function";pt||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(J!==C||de!==Ee)&&y2(f,N,C,Ee),xa=!1;var He=f.memoizedState;N.state=He,mf(f,C,N,S),de=f.memoizedState,J!==C||He!==de||kn.current||xa?(typeof Ke=="function"&&(t0(f,g,Ke,C),de=f.memoizedState),(J=xa||b2(f,g,J,C,He,de,Ee))?(pt||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount()),typeof N.componentDidMount=="function"&&(f.flags|=4194308)):(typeof N.componentDidMount=="function"&&(f.flags|=4194308),f.memoizedProps=C,f.memoizedState=de),N.props=C,N.state=de,N.context=Ee,C=J):(typeof N.componentDidMount=="function"&&(f.flags|=4194308),C=!1)}else{N=f.stateNode,h2(c,f),J=f.memoizedProps,Ee=f.type===f.elementType?J:jo(f.type,J),N.props=Ee,pt=f.pendingProps,He=N.context,de=g.contextType,typeof de=="object"&&de!==null?de=Zr(de):(de=gr(g)?lr:Ut.current,de=fl(f,de));var qt=g.getDerivedStateFromProps;(Ke=typeof qt=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(J!==pt||He!==de)&&y2(f,N,C,de),xa=!1,He=f.memoizedState,N.state=He,mf(f,C,N,S);var Bt=f.memoizedState;J!==pt||He!==Bt||kn.current||xa?(typeof qt=="function"&&(t0(f,g,qt,C),Bt=f.memoizedState),(Ee=xa||b2(f,g,Ee,C,He,Bt,de)||!1)?(Ke||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(C,Bt,de),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(C,Bt,de)),typeof N.componentDidUpdate=="function"&&(f.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(f.flags|=1024)):(typeof N.componentDidUpdate!="function"||J===c.memoizedProps&&He===c.memoizedState||(f.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||J===c.memoizedProps&&He===c.memoizedState||(f.flags|=1024),f.memoizedProps=C,f.memoizedState=Bt),N.props=C,N.state=Bt,N.context=de,C=Ee):(typeof N.componentDidUpdate!="function"||J===c.memoizedProps&&He===c.memoizedState||(f.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||J===c.memoizedProps&&He===c.memoizedState||(f.flags|=1024),C=!1)}return b0(c,f,g,C,P,S)}function b0(c,f,g,C,S,P){tC(c,f);var N=(f.flags&128)!==0;if(!C&&!N)return S&&n2(f,g,!1),Ns(c,f,P);C=f.stateNode,q8.current=f;var J=N&&typeof g.getDerivedStateFromError!="function"?null:C.render();return f.flags|=1,c!==null&&N?(f.child=bl(f,c.child,null,P),f.child=bl(f,null,J,P)):cr(c,f,J,P),f.memoizedState=C.state,S&&n2(f,g,!0),f.child}function rC(c){var f=c.stateNode;f.pendingContext?e2(c,f.pendingContext,f.pendingContext!==f.context):f.context&&e2(c,f.context,!1),r0(c,f.containerInfo)}function oC(c,f,g,C,S){return ml(),qg(S),f.flags|=256,cr(c,f,g,C),f.child}var x0={dehydrated:null,treeContext:null,retryLane:0};function y0(c){return{baseLanes:c,cachePool:null,transitions:null}}function sC(c,f,g){var C=f.pendingProps,S=ln.current,P=!1,N=(f.flags&128)!==0,J;if((J=N)||(J=c!==null&&c.memoizedState===null?!1:(S&2)!==0),J?(P=!0,f.flags&=-129):(c===null||c.memoizedState!==null)&&(S|=1),kt(ln,S&1),c===null)return Kg(f),c=f.memoizedState,c!==null&&(c=c.dehydrated,c!==null)?(f.mode&1?ha(c)?f.lanes=8:f.lanes=1073741824:f.lanes=1,null):(N=C.children,c=C.fallback,P?(C=f.mode,P=f.child,N={mode:"hidden",children:N},!(C&1)&&P!==null?(P.childLanes=0,P.pendingProps=N):P=Vf(N,C,0,null),c=mi(c,C,g,null),P.return=f,c.return=f,P.sibling=c,f.child=P,f.child.memoizedState=y0(g),f.memoizedState=x0,c):C0(f,N));if(S=c.memoizedState,S!==null&&(J=S.dehydrated,J!==null))return X8(c,f,N,C,J,S,g);if(P){P=C.fallback,N=f.mode,S=c.child,J=S.sibling;var de={mode:"hidden",children:C.children};return!(N&1)&&f.child!==S?(C=f.child,C.childLanes=0,C.pendingProps=de,f.deletions=null):(C=_a(S,de),C.subtreeFlags=S.subtreeFlags&14680064),J!==null?P=_a(J,P):(P=mi(P,N,g,null),P.flags|=2),P.return=f,C.return=f,C.sibling=P,f.child=C,C=P,P=f.child,N=c.child.memoizedState,N=N===null?y0(g):{baseLanes:N.baseLanes|g,cachePool:null,transitions:N.transitions},P.memoizedState=N,P.childLanes=c.childLanes&~g,f.memoizedState=x0,C}return P=c.child,c=P.sibling,C=_a(P,{mode:"visible",children:C.children}),!(f.mode&1)&&(C.lanes=g),C.return=f,C.sibling=null,c!==null&&(g=f.deletions,g===null?(f.deletions=[c],f.flags|=16):g.push(c)),f.child=C,f.memoizedState=null,C}function C0(c,f){return f=Vf({mode:"visible",children:f},c.mode,0,null),f.return=c,c.child=f}function kf(c,f,g,C){return C!==null&&qg(C),bl(f,c.child,null,g),c=C0(f,f.pendingProps.children),c.flags|=2,f.memoizedState=null,c}function X8(c,f,g,C,S,P,N){if(g)return f.flags&256?(f.flags&=-257,C=m0(Error(i(422))),kf(c,f,N,C)):f.memoizedState!==null?(f.child=c.child,f.flags|=128,null):(P=C.fallback,S=f.mode,C=Vf({mode:"visible",children:C.children},S,0,null),P=mi(P,S,N,null),P.flags|=2,C.return=f,P.return=f,C.sibling=P,f.child=C,f.mode&1&&bl(f,c.child,null,N),f.child.memoizedState=y0(N),f.memoizedState=x0,P);if(!(f.mode&1))return kf(c,f,N,null);if(ha(S))return C=ma(S).digest,P=Error(i(419)),C=m0(P,C,void 0),kf(c,f,N,C);if(g=(N&c.childLanes)!==0,vr||g){if(C=Fn,C!==null){switch(N&-N){case 4:S=2;break;case 16:S=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:S=32;break;case 536870912:S=268435456;break;default:S=0}S=S&(C.suspendedLanes|N)?0:S,S!==0&&S!==P.retryLane&&(P.retryLane=S,Zo(c,S),to(C,c,S,-1))}return B0(),C=m0(Error(i(421))),kf(c,f,N,C)}return Es(S)?(f.flags|=128,f.child=c.child,f=l7.bind(null,c),cl(S,f),null):(c=P.treeContext,Ce&&(Qr=Nt(S),Nr=f,Zt=!0,_o=null,nu=!1,c!==null&&(Xr[Yr++]=Ds,Xr[Yr++]=Rs,Xr[Yr++]=ii,Ds=c.id,Rs=c.overflow,ii=f)),f=C0(f,C.children),f.flags|=4096,f)}function aC(c,f,g){c.lanes|=f;var C=c.alternate;C!==null&&(C.lanes|=f),Zg(c.return,f,g)}function w0(c,f,g,C,S){var P=c.memoizedState;P===null?c.memoizedState={isBackwards:f,rendering:null,renderingStartTime:0,last:C,tail:g,tailMode:S}:(P.isBackwards=f,P.rendering=null,P.renderingStartTime=0,P.last=C,P.tail=g,P.tailMode=S)}function iC(c,f,g){var C=f.pendingProps,S=C.revealOrder,P=C.tail;if(cr(c,f,C.children,g),C=ln.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&&aC(c,g,f);else if(c.tag===19)aC(c,g,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(kt(ln,C),!(f.mode&1))f.memoizedState=null;else switch(S){case"forwards":for(g=f.child,S=null;g!==null;)c=g.alternate,c!==null&&bf(c)===null&&(S=g),g=g.sibling;g=S,g===null?(S=f.child,f.child=null):(S=g.sibling,g.sibling=null),w0(f,!1,S,g,P);break;case"backwards":for(g=null,S=f.child,f.child=null;S!==null;){if(c=S.alternate,c!==null&&bf(c)===null){f.child=S;break}c=S.sibling,S.sibling=g,g=S,S=c}w0(f,!0,g,null,P);break;case"together":w0(f,!1,null,null,void 0);break;default:f.memoizedState=null}return f.child}function _f(c,f){!(f.mode&1)&&c!==null&&(c.alternate=null,f.alternate=null,f.flags|=2)}function Ns(c,f,g){if(c!==null&&(f.dependencies=c.dependencies),di|=f.lanes,!(g&f.childLanes))return null;if(c!==null&&f.child!==c.child)throw Error(i(153));if(f.child!==null){for(c=f.child,g=_a(c,c.pendingProps),f.child=g,g.return=f;c.sibling!==null;)c=c.sibling,g=g.sibling=_a(c,c.pendingProps),g.return=f;g.sibling=null}return f.child}function Y8(c,f,g){switch(f.tag){case 3:rC(f),ml();break;case 5:k2(f);break;case 1:gr(f.type)&&tf(f);break;case 4:r0(f,f.stateNode.containerInfo);break;case 10:f2(f,f.type._context,f.memoizedProps.value);break;case 13:var C=f.memoizedState;if(C!==null)return C.dehydrated!==null?(kt(ln,ln.current&1),f.flags|=128,null):g&f.child.childLanes?sC(c,f,g):(kt(ln,ln.current&1),c=Ns(c,f,g),c!==null?c.sibling:null);kt(ln,ln.current&1);break;case 19:if(C=(g&f.childLanes)!==0,c.flags&128){if(C)return iC(c,f,g);f.flags|=128}var S=f.memoizedState;if(S!==null&&(S.rendering=null,S.tail=null,S.lastEffect=null),kt(ln,ln.current),C)break;return null;case 22:case 23:return f.lanes=0,eC(c,f,g)}return Ns(c,f,g)}function ts(c){c.flags|=4}function lC(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 uu,du,jf,Pf;if(ue)uu=function(c,f){for(var g=f.child;g!==null;){if(g.tag===5||g.tag===6)Q(c,g.stateNode);else if(g.tag!==4&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===f)break;for(;g.sibling===null;){if(g.return===null||g.return===f)return;g=g.return}g.sibling.return=g.return,g=g.sibling}},du=function(){},jf=function(c,f,g,C,S){if(c=c.memoizedProps,c!==C){var P=f.stateNode,N=Jo(Jr.current);g=se(P,g,c,C,S,N),(f.updateQueue=g)&&ts(f)}},Pf=function(c,f,g,C){g!==C&&ts(f)};else if(me){uu=function(c,f,g,C){for(var S=f.child;S!==null;){if(S.tag===5){var P=S.stateNode;g&&C&&(P=mr(P,S.type,S.memoizedProps,S)),Q(c,P)}else if(S.tag===6)P=S.stateNode,g&&C&&(P=wo(P,S.memoizedProps,S)),Q(c,P);else if(S.tag!==4){if(S.tag===22&&S.memoizedState!==null)P=S.child,P!==null&&(P.return=S),uu(c,S,!0,!0);else if(S.child!==null){S.child.return=S,S=S.child;continue}}if(S===f)break;for(;S.sibling===null;){if(S.return===null||S.return===f)return;S=S.return}S.sibling.return=S.return,S=S.sibling}};var cC=function(c,f,g,C){for(var S=f.child;S!==null;){if(S.tag===5){var P=S.stateNode;g&&C&&(P=mr(P,S.type,S.memoizedProps,S)),pn(c,P)}else if(S.tag===6)P=S.stateNode,g&&C&&(P=wo(P,S.memoizedProps,S)),pn(c,P);else if(S.tag!==4){if(S.tag===22&&S.memoizedState!==null)P=S.child,P!==null&&(P.return=S),cC(c,S,!0,!0);else if(S.child!==null){S.child.return=S,S=S.child;continue}}if(S===f)break;for(;S.sibling===null;){if(S.return===null||S.return===f)return;S=S.return}S.sibling.return=S.return,S=S.sibling}};du=function(c,f){var g=f.stateNode;if(!lC(c,f)){c=g.containerInfo;var C=Mn(c);cC(C,f,!1,!1),g.pendingChildren=C,ts(f),an(c,C)}},jf=function(c,f,g,C,S){var P=c.stateNode,N=c.memoizedProps;if((c=lC(c,f))&&N===C)f.stateNode=P;else{var J=f.stateNode,de=Jo(Jr.current),Ee=null;N!==C&&(Ee=se(J,g,N,C,S,de)),c&&Ee===null?f.stateNode=P:(P=sr(P,Ee,g,N,C,f,c,J),le(P,g,C,S,de)&&ts(f),f.stateNode=P,c?ts(f):uu(P,f,!1,!1))}},Pf=function(c,f,g,C){g!==C?(c=Jo(xl.current),g=Jo(Jr.current),f.stateNode=G(C,c,g,f),ts(f)):f.stateNode=c.stateNode}}else du=function(){},jf=function(){},Pf=function(){};function fu(c,f){if(!Zt)switch(c.tailMode){case"hidden":f=c.tail;for(var g=null;f!==null;)f.alternate!==null&&(g=f),f=f.sibling;g===null?c.tail=null:g.sibling=null;break;case"collapsed":g=c.tail;for(var C=null;g!==null;)g.alternate!==null&&(C=g),g=g.sibling;C===null?f||c.tail===null?c.tail=null:c.tail.sibling=null:C.sibling=null}}function Yn(c){var f=c.alternate!==null&&c.alternate.child===c.child,g=0,C=0;if(f)for(var S=c.child;S!==null;)g|=S.lanes|S.childLanes,C|=S.subtreeFlags&14680064,C|=S.flags&14680064,S.return=c,S=S.sibling;else for(S=c.child;S!==null;)g|=S.lanes|S.childLanes,C|=S.subtreeFlags,C|=S.flags,S.return=c,S=S.sibling;return c.subtreeFlags|=C,c.childLanes=g,f}function Q8(c,f,g){var C=f.pendingProps;switch(Ug(f),f.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Yn(f),null;case 1:return gr(f.type)&&ef(),Yn(f),null;case 3:return g=f.stateNode,yl(),xt(kn),xt(Ut),a0(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(c===null||c.child===null)&&(uf(f)?ts(f):c===null||c.memoizedState.isDehydrated&&!(f.flags&256)||(f.flags|=1024,_o!==null&&(z0(_o),_o=null))),du(c,f),Yn(f),null;case 5:o0(f),g=Jo(xl.current);var S=f.type;if(c!==null&&f.stateNode!=null)jf(c,f,S,C,g),c.ref!==f.ref&&(f.flags|=512,f.flags|=2097152);else{if(!C){if(f.stateNode===null)throw Error(i(166));return Yn(f),null}if(c=Jo(Jr.current),uf(f)){if(!Ce)throw Error(i(175));c=On(f.stateNode,f.type,f.memoizedProps,g,c,f,!nu),f.updateQueue=c,c!==null&&ts(f)}else{var P=re(S,C,g,c,f);uu(P,f,!1,!1),f.stateNode=P,le(P,S,C,g,c)&&ts(f)}f.ref!==null&&(f.flags|=512,f.flags|=2097152)}return Yn(f),null;case 6:if(c&&f.stateNode!=null)Pf(c,f,c.memoizedProps,C);else{if(typeof C!="string"&&f.stateNode===null)throw Error(i(166));if(c=Jo(xl.current),g=Jo(Jr.current),uf(f)){if(!Ce)throw Error(i(176));if(c=f.stateNode,g=f.memoizedProps,(C=bt(c,g,f,!nu))&&(S=Nr,S!==null))switch(S.tag){case 3:Jd(S.stateNode.containerInfo,c,g,(S.mode&1)!==0);break;case 5:dl(S.type,S.memoizedProps,S.stateNode,c,g,(S.mode&1)!==0)}C&&ts(f)}else f.stateNode=G(C,c,g,f)}return Yn(f),null;case 13:if(xt(ln),C=f.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(Zt&&Qr!==null&&f.mode&1&&!(f.flags&128))d2(),ml(),f.flags|=98560,S=!1;else if(S=uf(f),C!==null&&C.dehydrated!==null){if(c===null){if(!S)throw Error(i(318));if(!Ce)throw Error(i(344));if(S=f.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error(i(317));va(S,f)}else ml(),!(f.flags&128)&&(f.memoizedState=null),f.flags|=4;Yn(f),S=!1}else _o!==null&&(z0(_o),_o=null),S=!0;if(!S)return f.flags&65536?f:null}return f.flags&128?(f.lanes=g,f):(g=C!==null,g!==(c!==null&&c.memoizedState!==null)&&g&&(f.child.flags|=8192,f.mode&1&&(c===null||ln.current&1?An===0&&(An=3):B0())),f.updateQueue!==null&&(f.flags|=4),Yn(f),null);case 4:return yl(),du(c,f),c===null&&fe(f.stateNode.containerInfo),Yn(f),null;case 10:return Qg(f.type._context),Yn(f),null;case 17:return gr(f.type)&&ef(),Yn(f),null;case 19:if(xt(ln),S=f.memoizedState,S===null)return Yn(f),null;if(C=(f.flags&128)!==0,P=S.rendering,P===null)if(C)fu(S,!1);else{if(An!==0||c!==null&&c.flags&128)for(c=f.child;c!==null;){if(P=bf(c),P!==null){for(f.flags|=128,fu(S,!1),c=P.updateQueue,c!==null&&(f.updateQueue=c,f.flags|=4),f.subtreeFlags=0,c=g,g=f.child;g!==null;)C=g,S=c,C.flags&=14680066,P=C.alternate,P===null?(C.childLanes=0,C.lanes=S,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,S=P.dependencies,C.dependencies=S===null?null:{lanes:S.lanes,firstContext:S.firstContext}),g=g.sibling;return kt(ln,ln.current&1|2),f.child}c=c.sibling}S.tail!==null&&Ln()>N0&&(f.flags|=128,C=!0,fu(S,!1),f.lanes=4194304)}else{if(!C)if(c=bf(P),c!==null){if(f.flags|=128,C=!0,c=c.updateQueue,c!==null&&(f.updateQueue=c,f.flags|=4),fu(S,!0),S.tail===null&&S.tailMode==="hidden"&&!P.alternate&&!Zt)return Yn(f),null}else 2*Ln()-S.renderingStartTime>N0&&g!==1073741824&&(f.flags|=128,C=!0,fu(S,!1),f.lanes=4194304);S.isBackwards?(P.sibling=f.child,f.child=P):(c=S.last,c!==null?c.sibling=P:f.child=P,S.last=P)}return S.tail!==null?(f=S.tail,S.rendering=f,S.tail=f.sibling,S.renderingStartTime=Ln(),f.sibling=null,c=ln.current,kt(ln,C?c&1|2:c&1),f):(Yn(f),null);case 22:case 23:return F0(),g=f.memoizedState!==null,c!==null&&c.memoizedState!==null!==g&&(f.flags|=8192),g&&f.mode&1?Tr&1073741824&&(Yn(f),ue&&f.subtreeFlags&6&&(f.flags|=8192)):Yn(f),null;case 24:return null;case 25:return null}throw Error(i(156,f.tag))}function Z8(c,f){switch(Ug(f),f.tag){case 1:return gr(f.type)&&ef(),c=f.flags,c&65536?(f.flags=c&-65537|128,f):null;case 3:return yl(),xt(kn),xt(Ut),a0(),c=f.flags,c&65536&&!(c&128)?(f.flags=c&-65537|128,f):null;case 5:return o0(f),null;case 13:if(xt(ln),c=f.memoizedState,c!==null&&c.dehydrated!==null){if(f.alternate===null)throw Error(i(340));ml()}return c=f.flags,c&65536?(f.flags=c&-65537|128,f):null;case 19:return xt(ln),null;case 4:return yl(),null;case 10:return Qg(f.type._context),null;case 22:case 23:return F0(),null;case 24:return null;default:return null}}var If=!1,Qn=!1,J8=typeof WeakSet=="function"?WeakSet:Set,Ge=null;function wl(c,f){var g=c.ref;if(g!==null)if(typeof g=="function")try{g(null)}catch(C){Jt(c,f,C)}else g.current=null}function S0(c,f,g){try{g()}catch(C){Jt(c,f,C)}}var uC=!1;function e7(c,f){for(B(c.containerInfo),Ge=f;Ge!==null;)if(c=Ge,f=c.child,(c.subtreeFlags&1028)!==0&&f!==null)f.return=c,Ge=f;else for(;Ge!==null;){c=Ge;try{var g=c.alternate;if(c.flags&1024)switch(c.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var C=g.memoizedProps,S=g.memoizedState,P=c.stateNode,N=P.getSnapshotBeforeUpdate(c.elementType===c.type?C:jo(c.type,C),S);P.__reactInternalSnapshotBeforeUpdate=N}break;case 3:ue&&Pt(c.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(J){Jt(c,c.return,J)}if(f=c.sibling,f!==null){f.return=c.return,Ge=f;break}Ge=c.return}return g=uC,uC=!1,g}function pu(c,f,g){var C=f.updateQueue;if(C=C!==null?C.lastEffect:null,C!==null){var S=C=C.next;do{if((S.tag&c)===c){var P=S.destroy;S.destroy=void 0,P!==void 0&&S0(f,g,P)}S=S.next}while(S!==C)}}function Ef(c,f){if(f=f.updateQueue,f=f!==null?f.lastEffect:null,f!==null){var g=f=f.next;do{if((g.tag&c)===c){var C=g.create;g.destroy=C()}g=g.next}while(g!==f)}}function k0(c){var f=c.ref;if(f!==null){var g=c.stateNode;switch(c.tag){case 5:c=W(g);break;default:c=g}typeof f=="function"?f(c):f.current=c}}function dC(c){var f=c.alternate;f!==null&&(c.alternate=null,dC(f)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(f=c.stateNode,f!==null&&je(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 fC(c){return c.tag===5||c.tag===3||c.tag===4}function pC(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||fC(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 _0(c,f,g){var C=c.tag;if(C===5||C===6)c=c.stateNode,f?At(g,c,f):Qe(g,c);else if(C!==4&&(c=c.child,c!==null))for(_0(c,f,g),c=c.sibling;c!==null;)_0(c,f,g),c=c.sibling}function j0(c,f,g){var C=c.tag;if(C===5||C===6)c=c.stateNode,f?$e(g,c,f):ve(g,c);else if(C!==4&&(c=c.child,c!==null))for(j0(c,f,g),c=c.sibling;c!==null;)j0(c,f,g),c=c.sibling}var Vn=null,Po=!1;function ns(c,f,g){for(g=g.child;g!==null;)P0(c,f,g),g=g.sibling}function P0(c,f,g){if(Yo&&typeof Yo.onCommitFiberUnmount=="function")try{Yo.onCommitFiberUnmount(sf,g)}catch{}switch(g.tag){case 5:Qn||wl(g,f);case 6:if(ue){var C=Vn,S=Po;Vn=null,ns(c,f,g),Vn=C,Po=S,Vn!==null&&(Po?ze(Vn,g.stateNode):ke(Vn,g.stateNode))}else ns(c,f,g);break;case 18:ue&&Vn!==null&&(Po?Dn(Vn,g.stateNode):Ng(Vn,g.stateNode));break;case 4:ue?(C=Vn,S=Po,Vn=g.stateNode.containerInfo,Po=!0,ns(c,f,g),Vn=C,Po=S):(me&&(C=g.stateNode.containerInfo,S=Mn(C),Qt(C,S)),ns(c,f,g));break;case 0:case 11:case 14:case 15:if(!Qn&&(C=g.updateQueue,C!==null&&(C=C.lastEffect,C!==null))){S=C=C.next;do{var P=S,N=P.destroy;P=P.tag,N!==void 0&&(P&2||P&4)&&S0(g,f,N),S=S.next}while(S!==C)}ns(c,f,g);break;case 1:if(!Qn&&(wl(g,f),C=g.stateNode,typeof C.componentWillUnmount=="function"))try{C.props=g.memoizedProps,C.state=g.memoizedState,C.componentWillUnmount()}catch(J){Jt(g,f,J)}ns(c,f,g);break;case 21:ns(c,f,g);break;case 22:g.mode&1?(Qn=(C=Qn)||g.memoizedState!==null,ns(c,f,g),Qn=C):ns(c,f,g);break;default:ns(c,f,g)}}function hC(c){var f=c.updateQueue;if(f!==null){c.updateQueue=null;var g=c.stateNode;g===null&&(g=c.stateNode=new J8),f.forEach(function(C){var S=c7.bind(null,c,C);g.has(C)||(g.add(C),C.then(S,S))})}}function Io(c,f){var g=f.deletions;if(g!==null)for(var C=0;C<g.length;C++){var S=g[C];try{var P=c,N=f;if(ue){var J=N;e:for(;J!==null;){switch(J.tag){case 5:Vn=J.stateNode,Po=!1;break e;case 3:Vn=J.stateNode.containerInfo,Po=!0;break e;case 4:Vn=J.stateNode.containerInfo,Po=!0;break e}J=J.return}if(Vn===null)throw Error(i(160));P0(P,N,S),Vn=null,Po=!1}else P0(P,N,S);var de=S.alternate;de!==null&&(de.return=null),S.return=null}catch(Ee){Jt(S,f,Ee)}}if(f.subtreeFlags&12854)for(f=f.child;f!==null;)mC(f,c),f=f.sibling}function mC(c,f){var g=c.alternate,C=c.flags;switch(c.tag){case 0:case 11:case 14:case 15:if(Io(f,c),rs(c),C&4){try{pu(3,c,c.return),Ef(3,c)}catch(He){Jt(c,c.return,He)}try{pu(5,c,c.return)}catch(He){Jt(c,c.return,He)}}break;case 1:Io(f,c),rs(c),C&512&&g!==null&&wl(g,g.return);break;case 5:if(Io(f,c),rs(c),C&512&&g!==null&&wl(g,g.return),ue){if(c.flags&32){var S=c.stateNode;try{Le(S)}catch(He){Jt(c,c.return,He)}}if(C&4&&(S=c.stateNode,S!=null)){var P=c.memoizedProps;if(g=g!==null?g.memoizedProps:P,C=c.type,f=c.updateQueue,c.updateQueue=null,f!==null)try{Me(S,f,C,g,P,c)}catch(He){Jt(c,c.return,He)}}}break;case 6:if(Io(f,c),rs(c),C&4&&ue){if(c.stateNode===null)throw Error(i(162));S=c.stateNode,P=c.memoizedProps,g=g!==null?g.memoizedProps:P;try{ot(S,g,P)}catch(He){Jt(c,c.return,He)}}break;case 3:if(Io(f,c),rs(c),C&4){if(ue&&Ce&&g!==null&&g.memoizedState.isDehydrated)try{Zd(f.containerInfo)}catch(He){Jt(c,c.return,He)}if(me){S=f.containerInfo,P=f.pendingChildren;try{Qt(S,P)}catch(He){Jt(c,c.return,He)}}}break;case 4:if(Io(f,c),rs(c),C&4&&me){P=c.stateNode,S=P.containerInfo,P=P.pendingChildren;try{Qt(S,P)}catch(He){Jt(c,c.return,He)}}break;case 13:Io(f,c),rs(c),S=c.child,S.flags&8192&&(P=S.memoizedState!==null,S.stateNode.isHidden=P,!P||S.alternate!==null&&S.alternate.memoizedState!==null||(A0=Ln())),C&4&&hC(c);break;case 22:var N=g!==null&&g.memoizedState!==null;if(c.mode&1?(Qn=(g=Qn)||N,Io(f,c),Qn=g):Io(f,c),rs(c),C&8192){if(g=c.memoizedState!==null,(c.stateNode.isHidden=g)&&!N&&c.mode&1)for(Ge=c,C=c.child;C!==null;){for(f=Ge=C;Ge!==null;){N=Ge;var J=N.child;switch(N.tag){case 0:case 11:case 14:case 15:pu(4,N,N.return);break;case 1:wl(N,N.return);var de=N.stateNode;if(typeof de.componentWillUnmount=="function"){var Ee=N,Ke=N.return;try{var pt=Ee;de.props=pt.memoizedProps,de.state=pt.memoizedState,de.componentWillUnmount()}catch(He){Jt(Ee,Ke,He)}}break;case 5:wl(N,N.return);break;case 22:if(N.memoizedState!==null){bC(f);continue}}J!==null?(J.return=N,Ge=J):bC(f)}C=C.sibling}if(ue){e:if(C=null,ue)for(f=c;;){if(f.tag===5){if(C===null){C=f;try{S=f.stateNode,g?Ve(S):bn(f.stateNode,f.memoizedProps)}catch(He){Jt(c,c.return,He)}}}else if(f.tag===6){if(C===null)try{P=f.stateNode,g?ct(P):jt(P,f.memoizedProps)}catch(He){Jt(c,c.return,He)}}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:Io(f,c),rs(c),C&4&&hC(c);break;case 21:break;default:Io(f,c),rs(c)}}function rs(c){var f=c.flags;if(f&2){try{if(ue){e:{for(var g=c.return;g!==null;){if(fC(g)){var C=g;break e}g=g.return}throw Error(i(160))}switch(C.tag){case 5:var S=C.stateNode;C.flags&32&&(Le(S),C.flags&=-33);var P=pC(c);j0(c,P,S);break;case 3:case 4:var N=C.stateNode.containerInfo,J=pC(c);_0(c,J,N);break;default:throw Error(i(161))}}}catch(de){Jt(c,c.return,de)}c.flags&=-3}f&4096&&(c.flags&=-4097)}function t7(c,f,g){Ge=c,gC(c)}function gC(c,f,g){for(var C=(c.mode&1)!==0;Ge!==null;){var S=Ge,P=S.child;if(S.tag===22&&C){var N=S.memoizedState!==null||If;if(!N){var J=S.alternate,de=J!==null&&J.memoizedState!==null||Qn;J=If;var Ee=Qn;if(If=N,(Qn=de)&&!Ee)for(Ge=S;Ge!==null;)N=Ge,de=N.child,N.tag===22&&N.memoizedState!==null?xC(S):de!==null?(de.return=N,Ge=de):xC(S);for(;P!==null;)Ge=P,gC(P),P=P.sibling;Ge=S,If=J,Qn=Ee}vC(c)}else S.subtreeFlags&8772&&P!==null?(P.return=S,Ge=P):vC(c)}}function vC(c){for(;Ge!==null;){var f=Ge;if(f.flags&8772){var g=f.alternate;try{if(f.flags&8772)switch(f.tag){case 0:case 11:case 15:Qn||Ef(5,f);break;case 1:var C=f.stateNode;if(f.flags&4&&!Qn)if(g===null)C.componentDidMount();else{var S=f.elementType===f.type?g.memoizedProps:jo(f.type,g.memoizedProps);C.componentDidUpdate(S,g.memoizedState,C.__reactInternalSnapshotBeforeUpdate)}var P=f.updateQueue;P!==null&&g2(f,P,C);break;case 3:var N=f.updateQueue;if(N!==null){if(g=null,f.child!==null)switch(f.child.tag){case 5:g=W(f.child.stateNode);break;case 1:g=f.child.stateNode}g2(f,N,g)}break;case 5:var J=f.stateNode;g===null&&f.flags&4&&lt(J,f.type,f.memoizedProps,f);break;case 6:break;case 4:break;case 12:break;case 13:if(Ce&&f.memoizedState===null){var de=f.alternate;if(de!==null){var Ee=de.memoizedState;if(Ee!==null){var Ke=Ee.dehydrated;Ke!==null&&Ag(Ke)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(i(163))}Qn||f.flags&512&&k0(f)}catch(pt){Jt(f,f.return,pt)}}if(f===c){Ge=null;break}if(g=f.sibling,g!==null){g.return=f.return,Ge=g;break}Ge=f.return}}function bC(c){for(;Ge!==null;){var f=Ge;if(f===c){Ge=null;break}var g=f.sibling;if(g!==null){g.return=f.return,Ge=g;break}Ge=f.return}}function xC(c){for(;Ge!==null;){var f=Ge;try{switch(f.tag){case 0:case 11:case 15:var g=f.return;try{Ef(4,f)}catch(de){Jt(f,g,de)}break;case 1:var C=f.stateNode;if(typeof C.componentDidMount=="function"){var S=f.return;try{C.componentDidMount()}catch(de){Jt(f,S,de)}}var P=f.return;try{k0(f)}catch(de){Jt(f,P,de)}break;case 5:var N=f.return;try{k0(f)}catch(de){Jt(f,N,de)}}}catch(de){Jt(f,f.return,de)}if(f===c){Ge=null;break}var J=f.sibling;if(J!==null){J.return=f.return,Ge=J;break}Ge=f.return}}var Mf=0,Of=1,Df=2,Rf=3,Af=4;if(typeof Symbol=="function"&&Symbol.for){var hu=Symbol.for;Mf=hu("selector.component"),Of=hu("selector.has_pseudo_class"),Df=hu("selector.role"),Rf=hu("selector.test_id"),Af=hu("selector.text")}function I0(c){var f=ge(c);if(f!=null){if(typeof f.memoizedProps["data-testname"]!="string")throw Error(i(364));return f}if(c=wt(c),c===null)throw Error(i(362));return c.stateNode.current}function E0(c,f){switch(f.$$typeof){case Mf:if(c.type===f.value)return!0;break;case Of:e:{f=f.value,c=[c,0];for(var g=0;g<c.length;){var C=c[g++],S=c[g++],P=f[S];if(C.tag!==5||!be(C)){for(;P!=null&&E0(C,P);)S++,P=f[S];if(S===f.length){f=!0;break e}else for(C=C.child;C!==null;)c.push(C,S),C=C.sibling}}f=!1}return f;case Df:if(c.tag===5&&Re(c.stateNode,f.value))return!0;break;case Af:if((c.tag===5||c.tag===6)&&(c=tt(c),c!==null&&0<=c.indexOf(f.value)))return!0;break;case Rf: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 M0(c){switch(c.$$typeof){case Mf:return"<"+(D(c.value)||"Unknown")+">";case Of:return":has("+(M0(c)||"")+")";case Df:return'[role="'+c.value+'"]';case Af:return'"'+c.value+'"';case Rf:return'[data-testname="'+c.value+'"]';default:throw Error(i(365))}}function yC(c,f){var g=[];c=[c,0];for(var C=0;C<c.length;){var S=c[C++],P=c[C++],N=f[P];if(S.tag!==5||!be(S)){for(;N!=null&&E0(S,N);)P++,N=f[P];if(P===f.length)g.push(S);else for(S=S.child;S!==null;)c.push(S,P),S=S.sibling}}return g}function O0(c,f){if(!Ue)throw Error(i(363));c=I0(c),c=yC(c,f),f=[],c=Array.from(c);for(var g=0;g<c.length;){var C=c[g++];if(C.tag===5)be(C)||f.push(C.stateNode);else for(C=C.child;C!==null;)c.push(C),C=C.sibling}return f}var n7=Math.ceil,Nf=l.ReactCurrentDispatcher,D0=l.ReactCurrentOwner,xn=l.ReactCurrentBatchConfig,yt=0,Fn=null,_n=null,Un=0,Tr=0,Sl=St(0),An=0,mu=null,di=0,Tf=0,R0=0,gu=null,br=null,A0=0,N0=1/0,Ts=null;function kl(){N0=Ln()+500}var $f=!1,T0=null,Ca=null,Lf=!1,wa=null,zf=0,vu=0,$0=null,Ff=-1,Bf=0;function Zn(){return yt&6?Ln():Ff!==-1?Ff:Ff=Ln()}function Sa(c){return c.mode&1?yt&2&&Un!==0?Un&-Un:L8.transition!==null?(Bf===0&&(Bf=r2()),Bf):(c=Et,c!==0?c:De()):1}function to(c,f,g,C){if(50<vu)throw vu=0,$0=null,Error(i(185));tu(c,g,C),(!(yt&2)||c!==Fn)&&(c===Fn&&(!(yt&2)&&(Tf|=g),An===4&&ka(c,Un)),xr(c,C),g===1&&yt===0&&!(f.mode&1)&&(kl(),af&&Qo()))}function xr(c,f){var g=c.callbackNode;E8(c,f);var C=of(c,c===Fn?Un:0);if(C===0)g!==null&&s2(g),c.callbackNode=null,c.callbackPriority=0;else if(f=C&-C,c.callbackPriority!==f){if(g!=null&&s2(g),f===1)c.tag===0?$8(wC.bind(null,c)):a2(wC.bind(null,c)),Be?rt(function(){!(yt&6)&&Qo()}):Fg(Bg,Qo),g=null;else{switch(o2(C)){case 1:g=Bg;break;case 4:g=R8;break;case 16:g=Hg;break;case 536870912:g=A8;break;default:g=Hg}g=OC(g,CC.bind(null,c))}c.callbackPriority=f,c.callbackNode=g}}function CC(c,f){if(Ff=-1,Bf=0,yt&6)throw Error(i(327));var g=c.callbackNode;if(hi()&&c.callbackNode!==g)return null;var C=of(c,c===Fn?Un:0);if(C===0)return null;if(C&30||C&c.expiredLanes||f)f=Hf(c,C);else{f=C;var S=yt;yt|=2;var P=_C();(Fn!==c||Un!==f)&&(Ts=null,kl(),fi(c,f));do try{s7();break}catch(J){kC(c,J)}while(1);Yg(),Nf.current=P,yt=S,_n!==null?f=0:(Fn=null,Un=0,f=An)}if(f!==0){if(f===2&&(S=$g(c),S!==0&&(C=S,f=L0(c,S))),f===1)throw g=mu,fi(c,0),ka(c,C),xr(c,Ln()),g;if(f===6)ka(c,C);else{if(S=c.current.alternate,!(C&30)&&!r7(S)&&(f=Hf(c,C),f===2&&(P=$g(c),P!==0&&(C=P,f=L0(c,P))),f===1))throw g=mu,fi(c,0),ka(c,C),xr(c,Ln()),g;switch(c.finishedWork=S,c.finishedLanes=C,f){case 0:case 1:throw Error(i(345));case 2:pi(c,br,Ts);break;case 3:if(ka(c,C),(C&130023424)===C&&(f=A0+500-Ln(),10<f)){if(of(c,0)!==0)break;if(S=c.suspendedLanes,(S&C)!==C){Zn(),c.pingedLanes|=c.suspendedLanes&S;break}c.timeoutHandle=te(pi.bind(null,c,br,Ts),f);break}pi(c,br,Ts);break;case 4:if(ka(c,C),(C&4194240)===C)break;for(f=c.eventTimes,S=-1;0<C;){var N=31-So(C);P=1<<N,N=f[N],N>S&&(S=N),C&=~P}if(C=S,C=Ln()-C,C=(120>C?120:480>C?480:1080>C?1080:1920>C?1920:3e3>C?3e3:4320>C?4320:1960*n7(C/1960))-C,10<C){c.timeoutHandle=te(pi.bind(null,c,br,Ts),C);break}pi(c,br,Ts);break;case 5:pi(c,br,Ts);break;default:throw Error(i(329))}}}return xr(c,Ln()),c.callbackNode===g?CC.bind(null,c):null}function L0(c,f){var g=gu;return c.current.memoizedState.isDehydrated&&(fi(c,f).flags|=256),c=Hf(c,f),c!==2&&(f=br,br=g,f!==null&&z0(f)),c}function z0(c){br===null?br=c:br.push.apply(br,c)}function r7(c){for(var f=c;;){if(f.flags&16384){var g=f.updateQueue;if(g!==null&&(g=g.stores,g!==null))for(var C=0;C<g.length;C++){var S=g[C],P=S.getSnapshot;S=S.value;try{if(!ko(P(),S))return!1}catch{return!1}}}if(g=f.child,f.subtreeFlags&16384&&g!==null)g.return=f,f=g;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 ka(c,f){for(f&=~R0,f&=~Tf,c.suspendedLanes|=f,c.pingedLanes&=~f,c=c.expirationTimes;0<f;){var g=31-So(f),C=1<<g;c[g]=-1,f&=~C}}function wC(c){if(yt&6)throw Error(i(327));hi();var f=of(c,0);if(!(f&1))return xr(c,Ln()),null;var g=Hf(c,f);if(c.tag!==0&&g===2){var C=$g(c);C!==0&&(f=C,g=L0(c,C))}if(g===1)throw g=mu,fi(c,0),ka(c,f),xr(c,Ln()),g;if(g===6)throw Error(i(345));return c.finishedWork=c.current.alternate,c.finishedLanes=f,pi(c,br,Ts),xr(c,Ln()),null}function SC(c){wa!==null&&wa.tag===0&&!(yt&6)&&hi();var f=yt;yt|=1;var g=xn.transition,C=Et;try{if(xn.transition=null,Et=1,c)return c()}finally{Et=C,xn.transition=g,yt=f,!(yt&6)&&Qo()}}function F0(){Tr=Sl.current,xt(Sl)}function fi(c,f){c.finishedWork=null,c.finishedLanes=0;var g=c.timeoutHandle;if(g!==oe&&(c.timeoutHandle=oe,ae(g)),_n!==null)for(g=_n.return;g!==null;){var C=g;switch(Ug(C),C.tag){case 1:C=C.type.childContextTypes,C!=null&&ef();break;case 3:yl(),xt(kn),xt(Ut),a0();break;case 5:o0(C);break;case 4:yl();break;case 13:xt(ln);break;case 19:xt(ln);break;case 10:Qg(C.type._context);break;case 22:case 23:F0()}g=g.return}if(Fn=c,_n=c=_a(c.current,null),Un=Tr=f,An=0,mu=null,R0=Tf=di=0,br=gu=null,ci!==null){for(f=0;f<ci.length;f++)if(g=ci[f],C=g.interleaved,C!==null){g.interleaved=null;var S=C.next,P=g.pending;if(P!==null){var N=P.next;P.next=S,C.next=N}g.pending=C}ci=null}return c}function kC(c,f){do{var g=_n;try{if(Yg(),xf.current=Sf,yf){for(var C=cn.memoizedState;C!==null;){var S=C.queue;S!==null&&(S.pending=null),C=C.next}yf=!1}if(ui=0,zn=Rn=cn=null,au=!1,iu=0,D0.current=null,g===null||g.return===null){An=1,mu=f,_n=null;break}e:{var P=c,N=g.return,J=g,de=f;if(f=Un,J.flags|=32768,de!==null&&typeof de=="object"&&typeof de.then=="function"){var Ee=de,Ke=J,pt=Ke.tag;if(!(Ke.mode&1)&&(pt===0||pt===11||pt===15)){var He=Ke.alternate;He?(Ke.updateQueue=He.updateQueue,Ke.memoizedState=He.memoizedState,Ke.lanes=He.lanes):(Ke.updateQueue=null,Ke.memoizedState=null)}var qt=X2(N);if(qt!==null){qt.flags&=-257,Y2(qt,N,J,P,f),qt.mode&1&&q2(P,Ee,f),f=qt,de=Ee;var Bt=f.updateQueue;if(Bt===null){var yr=new Set;yr.add(de),f.updateQueue=yr}else Bt.add(de);break e}else{if(!(f&1)){q2(P,Ee,f),B0();break e}de=Error(i(426))}}else if(Zt&&J.mode&1){var $s=X2(N);if($s!==null){!($s.flags&65536)&&($s.flags|=256),Y2($s,N,J,P,f),qg(Cl(de,J));break e}}P=de=Cl(de,J),An!==4&&(An=2),gu===null?gu=[P]:gu.push(P),P=N;do{switch(P.tag){case 3:P.flags|=65536,f&=-f,P.lanes|=f;var ce=G2(P,de,f);m2(P,ce);break e;case 1:J=de;var ne=P.type,he=P.stateNode;if(!(P.flags&128)&&(typeof ne.getDerivedStateFromError=="function"||he!==null&&typeof he.componentDidCatch=="function"&&(Ca===null||!Ca.has(he)))){P.flags|=65536,f&=-f,P.lanes|=f;var We=K2(P,J,f);m2(P,We);break e}}P=P.return}while(P!==null)}PC(g)}catch(nt){f=nt,_n===g&&g!==null&&(_n=g=g.return);continue}break}while(1)}function _C(){var c=Nf.current;return Nf.current=Sf,c===null?Sf:c}function B0(){(An===0||An===3||An===2)&&(An=4),Fn===null||!(di&268435455)&&!(Tf&268435455)||ka(Fn,Un)}function Hf(c,f){var g=yt;yt|=2;var C=_C();(Fn!==c||Un!==f)&&(Ts=null,fi(c,f));do try{o7();break}catch(S){kC(c,S)}while(1);if(Yg(),yt=g,Nf.current=C,_n!==null)throw Error(i(261));return Fn=null,Un=0,An}function o7(){for(;_n!==null;)jC(_n)}function s7(){for(;_n!==null&&!O8();)jC(_n)}function jC(c){var f=MC(c.alternate,c,Tr);c.memoizedProps=c.pendingProps,f===null?PC(c):_n=f,D0.current=null}function PC(c){var f=c;do{var g=f.alternate;if(c=f.return,f.flags&32768){if(g=Z8(g,f),g!==null){g.flags&=32767,_n=g;return}if(c!==null)c.flags|=32768,c.subtreeFlags=0,c.deletions=null;else{An=6,_n=null;return}}else if(g=Q8(g,f,Tr),g!==null){_n=g;return}if(f=f.sibling,f!==null){_n=f;return}_n=f=c}while(f!==null);An===0&&(An=5)}function pi(c,f,g){var C=Et,S=xn.transition;try{xn.transition=null,Et=1,a7(c,f,g,C)}finally{xn.transition=S,Et=C}return null}function a7(c,f,g,C){do hi();while(wa!==null);if(yt&6)throw Error(i(327));g=c.finishedWork;var S=c.finishedLanes;if(g===null)return null;if(c.finishedWork=null,c.finishedLanes=0,g===c.current)throw Error(i(177));c.callbackNode=null,c.callbackPriority=0;var P=g.lanes|g.childLanes;if(M8(c,P),c===Fn&&(_n=Fn=null,Un=0),!(g.subtreeFlags&2064)&&!(g.flags&2064)||Lf||(Lf=!0,OC(Hg,function(){return hi(),null})),P=(g.flags&15990)!==0,g.subtreeFlags&15990||P){P=xn.transition,xn.transition=null;var N=Et;Et=1;var J=yt;yt|=4,D0.current=null,e7(c,g),mC(g,c),q(c.containerInfo),c.current=g,t7(g),D8(),yt=J,Et=N,xn.transition=P}else c.current=g;if(Lf&&(Lf=!1,wa=c,zf=S),P=c.pendingLanes,P===0&&(Ca=null),N8(g.stateNode),xr(c,Ln()),f!==null)for(C=c.onRecoverableError,g=0;g<f.length;g++)S=f[g],C(S.value,{componentStack:S.stack,digest:S.digest});if($f)throw $f=!1,c=T0,T0=null,c;return zf&1&&c.tag!==0&&hi(),P=c.pendingLanes,P&1?c===$0?vu++:(vu=0,$0=c):vu=0,Qo(),null}function hi(){if(wa!==null){var c=o2(zf),f=xn.transition,g=Et;try{if(xn.transition=null,Et=16>c?16:c,wa===null)var C=!1;else{if(c=wa,wa=null,zf=0,yt&6)throw Error(i(331));var S=yt;for(yt|=4,Ge=c.current;Ge!==null;){var P=Ge,N=P.child;if(Ge.flags&16){var J=P.deletions;if(J!==null){for(var de=0;de<J.length;de++){var Ee=J[de];for(Ge=Ee;Ge!==null;){var Ke=Ge;switch(Ke.tag){case 0:case 11:case 15:pu(8,Ke,P)}var pt=Ke.child;if(pt!==null)pt.return=Ke,Ge=pt;else for(;Ge!==null;){Ke=Ge;var He=Ke.sibling,qt=Ke.return;if(dC(Ke),Ke===Ee){Ge=null;break}if(He!==null){He.return=qt,Ge=He;break}Ge=qt}}}var Bt=P.alternate;if(Bt!==null){var yr=Bt.child;if(yr!==null){Bt.child=null;do{var $s=yr.sibling;yr.sibling=null,yr=$s}while(yr!==null)}}Ge=P}}if(P.subtreeFlags&2064&&N!==null)N.return=P,Ge=N;else e:for(;Ge!==null;){if(P=Ge,P.flags&2048)switch(P.tag){case 0:case 11:case 15:pu(9,P,P.return)}var ce=P.sibling;if(ce!==null){ce.return=P.return,Ge=ce;break e}Ge=P.return}}var ne=c.current;for(Ge=ne;Ge!==null;){N=Ge;var he=N.child;if(N.subtreeFlags&2064&&he!==null)he.return=N,Ge=he;else e:for(N=ne;Ge!==null;){if(J=Ge,J.flags&2048)try{switch(J.tag){case 0:case 11:case 15:Ef(9,J)}}catch(nt){Jt(J,J.return,nt)}if(J===N){Ge=null;break e}var We=J.sibling;if(We!==null){We.return=J.return,Ge=We;break e}Ge=J.return}}if(yt=S,Qo(),Yo&&typeof Yo.onPostCommitFiberRoot=="function")try{Yo.onPostCommitFiberRoot(sf,c)}catch{}C=!0}return C}finally{Et=g,xn.transition=f}}return!1}function IC(c,f,g){f=Cl(g,f),f=G2(c,f,1),c=ya(c,f,1),f=Zn(),c!==null&&(tu(c,1,f),xr(c,f))}function Jt(c,f,g){if(c.tag===3)IC(c,c,g);else for(;f!==null;){if(f.tag===3){IC(f,c,g);break}else if(f.tag===1){var C=f.stateNode;if(typeof f.type.getDerivedStateFromError=="function"||typeof C.componentDidCatch=="function"&&(Ca===null||!Ca.has(C))){c=Cl(g,c),c=K2(f,c,1),f=ya(f,c,1),c=Zn(),f!==null&&(tu(f,1,c),xr(f,c));break}}f=f.return}}function i7(c,f,g){var C=c.pingCache;C!==null&&C.delete(f),f=Zn(),c.pingedLanes|=c.suspendedLanes&g,Fn===c&&(Un&g)===g&&(An===4||An===3&&(Un&130023424)===Un&&500>Ln()-A0?fi(c,0):R0|=g),xr(c,f)}function EC(c,f){f===0&&(c.mode&1?(f=rf,rf<<=1,!(rf&130023424)&&(rf=4194304)):f=1);var g=Zn();c=Zo(c,f),c!==null&&(tu(c,f,g),xr(c,g))}function l7(c){var f=c.memoizedState,g=0;f!==null&&(g=f.retryLane),EC(c,g)}function c7(c,f){var g=0;switch(c.tag){case 13:var C=c.stateNode,S=c.memoizedState;S!==null&&(g=S.retryLane);break;case 19:C=c.stateNode;break;default:throw Error(i(314))}C!==null&&C.delete(f),EC(c,g)}var MC;MC=function(c,f,g){if(c!==null)if(c.memoizedProps!==f.pendingProps||kn.current)vr=!0;else{if(!(c.lanes&g)&&!(f.flags&128))return vr=!1,Y8(c,f,g);vr=!!(c.flags&131072)}else vr=!1,Zt&&f.flags&1048576&&i2(f,cf,f.index);switch(f.lanes=0,f.tag){case 2:var C=f.type;_f(c,f),c=f.pendingProps;var S=fl(f,Ut.current);vl(f,g),S=c0(null,f,C,c,S,g);var P=u0();return f.flags|=1,typeof S=="object"&&S!==null&&typeof S.render=="function"&&S.$$typeof===void 0?(f.tag=1,f.memoizedState=null,f.updateQueue=null,gr(C)?(P=!0,tf(f)):P=!1,f.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,e0(f),S.updater=gf,f.stateNode=S,S._reactInternals=f,n0(f,C,c,g),f=b0(null,f,C,!0,P,g)):(f.tag=0,Zt&&P&&Vg(f),cr(null,f,S,g),f=f.child),f;case 16:C=f.elementType;e:{switch(_f(c,f),c=f.pendingProps,S=C._init,C=S(C._payload),f.type=C,S=f.tag=d7(C),c=jo(C,c),S){case 0:f=v0(null,f,C,c,g);break e;case 1:f=nC(null,f,C,c,g);break e;case 11:f=Q2(null,f,C,c,g);break e;case 14:f=Z2(null,f,C,jo(C.type,c),g);break e}throw Error(i(306,C,""))}return f;case 0:return C=f.type,S=f.pendingProps,S=f.elementType===C?S:jo(C,S),v0(c,f,C,S,g);case 1:return C=f.type,S=f.pendingProps,S=f.elementType===C?S:jo(C,S),nC(c,f,C,S,g);case 3:e:{if(rC(f),c===null)throw Error(i(387));C=f.pendingProps,P=f.memoizedState,S=P.element,h2(c,f),mf(f,C,null,g);var N=f.memoizedState;if(C=N.element,Ce&&P.isDehydrated)if(P={element:C,isDehydrated:!1,cache:N.cache,pendingSuspenseBoundaries:N.pendingSuspenseBoundaries,transitions:N.transitions},f.updateQueue.baseState=P,f.memoizedState=P,f.flags&256){S=Cl(Error(i(423)),f),f=oC(c,f,C,g,S);break e}else if(C!==S){S=Cl(Error(i(424)),f),f=oC(c,f,C,g,S);break e}else for(Ce&&(Qr=qe(f.stateNode.containerInfo),Nr=f,Zt=!0,_o=null,nu=!1),g=S2(f,null,C,g),f.child=g;g;)g.flags=g.flags&-3|4096,g=g.sibling;else{if(ml(),C===S){f=Ns(c,f,g);break e}cr(c,f,C,g)}f=f.child}return f;case 5:return k2(f),c===null&&Kg(f),C=f.type,S=f.pendingProps,P=c!==null?c.memoizedProps:null,N=S.children,U(C,S)?N=null:P!==null&&U(C,P)&&(f.flags|=32),tC(c,f),cr(c,f,N,g),f.child;case 6:return c===null&&Kg(f),null;case 13:return sC(c,f,g);case 4:return r0(f,f.stateNode.containerInfo),C=f.pendingProps,c===null?f.child=bl(f,null,C,g):cr(c,f,C,g),f.child;case 11:return C=f.type,S=f.pendingProps,S=f.elementType===C?S:jo(C,S),Q2(c,f,C,S,g);case 7:return cr(c,f,f.pendingProps,g),f.child;case 8:return cr(c,f,f.pendingProps.children,g),f.child;case 12:return cr(c,f,f.pendingProps.children,g),f.child;case 10:e:{if(C=f.type._context,S=f.pendingProps,P=f.memoizedProps,N=S.value,f2(f,C,N),P!==null)if(ko(P.value,N)){if(P.children===S.children&&!kn.current){f=Ns(c,f,g);break e}}else for(P=f.child,P!==null&&(P.return=f);P!==null;){var J=P.dependencies;if(J!==null){N=P.child;for(var de=J.firstContext;de!==null;){if(de.context===C){if(P.tag===1){de=As(-1,g&-g),de.tag=2;var Ee=P.updateQueue;if(Ee!==null){Ee=Ee.shared;var Ke=Ee.pending;Ke===null?de.next=de:(de.next=Ke.next,Ke.next=de),Ee.pending=de}}P.lanes|=g,de=P.alternate,de!==null&&(de.lanes|=g),Zg(P.return,g,f),J.lanes|=g;break}de=de.next}}else if(P.tag===10)N=P.type===f.type?null:P.child;else if(P.tag===18){if(N=P.return,N===null)throw Error(i(341));N.lanes|=g,J=N.alternate,J!==null&&(J.lanes|=g),Zg(N,g,f),N=P.sibling}else N=P.child;if(N!==null)N.return=P;else for(N=P;N!==null;){if(N===f){N=null;break}if(P=N.sibling,P!==null){P.return=N.return,N=P;break}N=N.return}P=N}cr(c,f,S.children,g),f=f.child}return f;case 9:return S=f.type,C=f.pendingProps.children,vl(f,g),S=Zr(S),C=C(S),f.flags|=1,cr(c,f,C,g),f.child;case 14:return C=f.type,S=jo(C,f.pendingProps),S=jo(C.type,S),Z2(c,f,C,S,g);case 15:return J2(c,f,f.type,f.pendingProps,g);case 17:return C=f.type,S=f.pendingProps,S=f.elementType===C?S:jo(C,S),_f(c,f),f.tag=1,gr(C)?(c=!0,tf(f)):c=!1,vl(f,g),x2(f,C,S),n0(f,C,S,g),b0(null,f,C,!0,c,g);case 19:return iC(c,f,g);case 22:return eC(c,f,g)}throw Error(i(156,f.tag))};function OC(c,f){return Fg(c,f)}function u7(c,f,g,C){this.tag=c,this.key=g,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 no(c,f,g,C){return new u7(c,f,g,C)}function H0(c){return c=c.prototype,!(!c||!c.isReactComponent)}function d7(c){if(typeof c=="function")return H0(c)?1:0;if(c!=null){if(c=c.$$typeof,c===x)return 11;if(c===_)return 14}return 2}function _a(c,f){var g=c.alternate;return g===null?(g=no(c.tag,f,c.key,c.mode),g.elementType=c.elementType,g.type=c.type,g.stateNode=c.stateNode,g.alternate=c,c.alternate=g):(g.pendingProps=f,g.type=c.type,g.flags=0,g.subtreeFlags=0,g.deletions=null),g.flags=c.flags&14680064,g.childLanes=c.childLanes,g.lanes=c.lanes,g.child=c.child,g.memoizedProps=c.memoizedProps,g.memoizedState=c.memoizedState,g.updateQueue=c.updateQueue,f=c.dependencies,g.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext},g.sibling=c.sibling,g.index=c.index,g.ref=c.ref,g}function Wf(c,f,g,C,S,P){var N=2;if(C=c,typeof c=="function")H0(c)&&(N=1);else if(typeof c=="string")N=5;else e:switch(c){case h:return mi(g.children,S,P,f);case m:N=8,S|=8;break;case v:return c=no(12,g,f,S|2),c.elementType=v,c.lanes=P,c;case w:return c=no(13,g,f,S),c.elementType=w,c.lanes=P,c;case k:return c=no(19,g,f,S),c.elementType=k,c.lanes=P,c;case I:return Vf(g,S,P,f);default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case b:N=10;break e;case y:N=9;break e;case x:N=11;break e;case _:N=14;break e;case j:N=16,C=null;break e}throw Error(i(130,c==null?c:typeof c,""))}return f=no(N,g,f,S),f.elementType=c,f.type=C,f.lanes=P,f}function mi(c,f,g,C){return c=no(7,c,C,f),c.lanes=g,c}function Vf(c,f,g,C){return c=no(22,c,C,f),c.elementType=I,c.lanes=g,c.stateNode={isHidden:!1},c}function W0(c,f,g){return c=no(6,c,null,f),c.lanes=g,c}function V0(c,f,g){return f=no(4,c.children!==null?c.children:[],c.key,f),f.lanes=g,f.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},f}function f7(c,f,g,C,S){this.tag=f,this.containerInfo=c,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=oe,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Lg(0),this.expirationTimes=Lg(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Lg(0),this.identifierPrefix=C,this.onRecoverableError=S,Ce&&(this.mutableSourceEagerHydrationData=null)}function DC(c,f,g,C,S,P,N,J,de){return c=new f7(c,f,g,J,de),f===1?(f=1,P===!0&&(f|=8)):f=0,P=no(3,null,null,f),c.current=P,P.stateNode=c,P.memoizedState={element:C,isDehydrated:g,cache:null,transitions:null,pendingSuspenseBoundaries:null},e0(P),c}function RC(c){if(!c)return qn;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(gr(f.type)){f=f.stateNode.__reactInternalMemoizedMergedChildContext;break e}}f=f.return}while(f!==null);throw Error(i(171))}if(c.tag===1){var g=c.type;if(gr(g))return t2(c,g,f)}return f}function AC(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=K(f),c===null?null:c.stateNode}function NC(c,f){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var g=c.retryLane;c.retryLane=g!==0&&g<f?g:f}}function Uf(c,f){NC(c,f),(c=c.alternate)&&NC(c,f)}function p7(c){return c=K(c),c===null?null:c.stateNode}function h7(){return null}return n.attemptContinuousHydration=function(c){if(c.tag===13){var f=Zo(c,134217728);if(f!==null){var g=Zn();to(f,c,134217728,g)}Uf(c,134217728)}},n.attemptDiscreteHydration=function(c){if(c.tag===13){var f=Zo(c,1);if(f!==null){var g=Zn();to(f,c,1,g)}Uf(c,1)}},n.attemptHydrationAtCurrentPriority=function(c){if(c.tag===13){var f=Sa(c),g=Zo(c,f);if(g!==null){var C=Zn();to(g,c,f,C)}Uf(c,f)}},n.attemptSynchronousHydration=function(c){switch(c.tag){case 3:var f=c.stateNode;if(f.current.memoizedState.isDehydrated){var g=eu(f.pendingLanes);g!==0&&(zg(f,g|1),xr(f,Ln()),!(yt&6)&&(kl(),Qo()))}break;case 13:SC(function(){var C=Zo(c,1);if(C!==null){var S=Zn();to(C,c,1,S)}}),Uf(c,1)}},n.batchedUpdates=function(c,f){var g=yt;yt|=1;try{return c(f)}finally{yt=g,yt===0&&(kl(),af&&Qo())}},n.createComponentSelector=function(c){return{$$typeof:Mf,value:c}},n.createContainer=function(c,f,g,C,S,P,N){return DC(c,f,!1,null,g,C,S,P,N)},n.createHasPseudoClassSelector=function(c){return{$$typeof:Of,value:c}},n.createHydrationContainer=function(c,f,g,C,S,P,N,J,de){return c=DC(g,C,!0,c,S,P,N,J,de),c.context=RC(null),g=c.current,C=Zn(),S=Sa(g),P=As(C,S),P.callback=f??null,ya(g,P,S),c.current.lanes=S,tu(c,S,C),xr(c,C),c},n.createPortal=function(c,f,g){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:g}},n.createRoleSelector=function(c){return{$$typeof:Df,value:c}},n.createTestNameSelector=function(c){return{$$typeof:Rf,value:c}},n.createTextSelector=function(c){return{$$typeof:Af,value:c}},n.deferredUpdates=function(c){var f=Et,g=xn.transition;try{return xn.transition=null,Et=16,c()}finally{Et=f,xn.transition=g}},n.discreteUpdates=function(c,f,g,C,S){var P=Et,N=xn.transition;try{return xn.transition=null,Et=1,c(f,g,C,S)}finally{Et=P,xn.transition=N,yt===0&&kl()}},n.findAllNodes=O0,n.findBoundingRects=function(c,f){if(!Ue)throw Error(i(363));f=O0(c,f),c=[];for(var g=0;g<f.length;g++)c.push(Ye(f[g]));for(f=c.length-1;0<f;f--){g=c[f];for(var C=g.x,S=C+g.width,P=g.y,N=P+g.height,J=f-1;0<=J;J--)if(f!==J){var de=c[J],Ee=de.x,Ke=Ee+de.width,pt=de.y,He=pt+de.height;if(C>=Ee&&P>=pt&&S<=Ke&&N<=He){c.splice(f,1);break}else if(C!==Ee||g.width!==de.width||He<P||pt>N){if(!(P!==pt||g.height!==de.height||Ke<C||Ee>S)){Ee>C&&(de.width+=Ee-C,de.x=C),Ke<S&&(de.width=S-Ee),c.splice(f,1);break}}else{pt>P&&(de.height+=pt-P,de.y=P),He<N&&(de.height=N-pt),c.splice(f,1);break}}}return c},n.findHostInstance=AC,n.findHostInstanceWithNoPortals=function(c){return c=T(c),c=c!==null?V(c):null,c===null?null:c.stateNode},n.findHostInstanceWithWarning=function(c){return AC(c)},n.flushControlled=function(c){var f=yt;yt|=1;var g=xn.transition,C=Et;try{xn.transition=null,Et=1,c()}finally{Et=C,xn.transition=g,yt=f,yt===0&&(kl(),Qo())}},n.flushPassiveEffects=hi,n.flushSync=SC,n.focusWithin=function(c,f){if(!Ue)throw Error(i(363));for(c=I0(c),f=yC(c,f),f=Array.from(f),c=0;c<f.length;){var g=f[c++];if(!be(g)){if(g.tag===5&&st(g.stateNode))return!0;for(g=g.child;g!==null;)f.push(g),g=g.sibling}}return!1},n.getCurrentUpdatePriority=function(){return Et},n.getFindAllNodesFailureDescription=function(c,f){if(!Ue)throw Error(i(363));var g=0,C=[];c=[I0(c),0];for(var S=0;S<c.length;){var P=c[S++],N=c[S++],J=f[N];if((P.tag!==5||!be(P))&&(E0(P,J)&&(C.push(M0(J)),N++,N>g&&(g=N)),N<f.length))for(P=P.child;P!==null;)c.push(P,N),P=P.sibling}if(g<f.length){for(c=[];g<f.length;g++)c.push(M0(f[g]));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 W(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:p7,findFiberByHostInstance:c.findFiberByHostInstance||h7,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{sf=f.inject(c),Yo=f}catch{}c=!!f.checkDCE}}return c},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(c,f,g,C){if(!Ue)throw Error(i(363));c=O0(c,f);var S=mt(c,g,C).disconnect;return{disconnect:function(){S()}}},n.registerMutableSourceForHydration=function(c,f){var g=f._getVersion;g=g(f._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[f,g]:c.mutableSourceEagerHydrationData.push(f,g)},n.runWithPriority=function(c,f){var g=Et;try{return Et=c,f()}finally{Et=g}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(c,f,g,C){var S=f.current,P=Zn(),N=Sa(S);return g=RC(g),f.context===null?f.context=g:f.pendingContext=g,f=As(P,N),f.payload={element:c},C=C===void 0?null:C,C!==null&&(f.callback=C),c=ya(S,f,N),c!==null&&(to(c,S,N,P),hf(c,S,N)),N},n};p8.exports=_he;var jhe=p8.exports;const Phe=Rc(jhe);var h8={exports:{}},ll={};/**
* @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.
*/ll.ConcurrentRoot=1;ll.ContinuousEventPriority=4;ll.DefaultEventPriority=16;ll.DiscreteEventPriority=1;ll.IdleEventPriority=536870912;ll.LegacyRoot=0;h8.exports=ll;var m8=h8.exports;const mj={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let gj=!1,vj=!1;const Qy=".react-konva-event",Ihe=`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
`,Ehe=`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
`,Mhe={};function Rg(e,t,n=Mhe){if(!gj&&"zIndex"in t&&(console.warn(Ehe),gj=!0),!vj&&t.draggable){var r=t.x!==void 0||t.y!==void 0,o=t.onDragEnd||t.onDragMove;r&&!o&&(console.warn(Ihe),vj=!0)}for(var s in n)if(!mj[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 h=t._useStrictMode,m={},v=!1;const b={};for(var s in t)if(!mj[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]&&(b[u]=t[s])}!i&&(t[s]!==n[s]||h&&t[s]!==e.getAttr(s))&&(v=!0,m[s]=t[s])}v&&(e.setAttrs(m),si(e));for(var u in b)e.on(u+Qy,b[u])}function si(e){if(!b9.Konva.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const g8={},Ohe={};pd.Node.prototype._applyProps=Rg;function Dhe(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),si(e)}function Rhe(e,t,n){let r=pd[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=pd.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 Rg(u,s),u}function Ahe(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function Nhe(e,t,n){return!1}function The(e){return e}function $he(){return null}function Lhe(){return null}function zhe(e,t,n,r){return Ohe}function Fhe(){}function Bhe(e){}function Hhe(e,t){return!1}function Whe(){return g8}function Vhe(){return g8}const Uhe=setTimeout,Ghe=clearTimeout,Khe=-1;function qhe(e,t){return!1}const Xhe=!1,Yhe=!0,Qhe=!0;function Zhe(e,t){t.parent===e?t.moveToTop():e.add(t),si(e)}function Jhe(e,t){t.parent===e?t.moveToTop():e.add(t),si(e)}function v8(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),si(e)}function eme(e,t,n){v8(e,t,n)}function tme(e,t){t.destroy(),t.off(Qy),si(e)}function nme(e,t){t.destroy(),t.off(Qy),si(e)}function rme(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function ome(e,t,n){}function sme(e,t,n,r,o){Rg(e,o,r)}function ame(e){e.hide(),si(e)}function ime(e){}function lme(e,t){(t.visible==null||t.visible)&&e.show()}function cme(e,t){}function ume(e){}function dme(){}const fme=()=>m8.DefaultEventPriority,pme=Object.freeze(Object.defineProperty({__proto__:null,appendChild:Zhe,appendChildToContainer:Jhe,appendInitialChild:Dhe,cancelTimeout:Ghe,clearContainer:ume,commitMount:ome,commitTextUpdate:rme,commitUpdate:sme,createInstance:Rhe,createTextInstance:Ahe,detachDeletedInstance:dme,finalizeInitialChildren:Nhe,getChildHostContext:Vhe,getCurrentEventPriority:fme,getPublicInstance:The,getRootHostContext:Whe,hideInstance:ame,hideTextInstance:ime,idlePriority:Dp.unstable_IdlePriority,insertBefore:v8,insertInContainerBefore:eme,isPrimaryRenderer:Xhe,noTimeout:Khe,now:Dp.unstable_now,prepareForCommit:$he,preparePortalMount:Lhe,prepareUpdate:zhe,removeChild:tme,removeChildFromContainer:nme,resetAfterCommit:Fhe,resetTextContent:Bhe,run:Dp.unstable_runWithPriority,scheduleTimeout:Uhe,shouldDeprioritizeSubtree:Hhe,shouldSetTextContent:qhe,supportsMutation:Qhe,unhideInstance:lme,unhideTextInstance:cme,warnsIfNotActing:Yhe},Symbol.toStringTag,{value:"Module"}));var hme=Object.defineProperty,mme=Object.defineProperties,gme=Object.getOwnPropertyDescriptors,bj=Object.getOwnPropertySymbols,vme=Object.prototype.hasOwnProperty,bme=Object.prototype.propertyIsEnumerable,xj=(e,t,n)=>t in e?hme(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yj=(e,t)=>{for(var n in t||(t={}))vme.call(t,n)&&xj(e,n,t[n]);if(bj)for(var n of bj(t))bme.call(t,n)&&xj(e,n,t[n]);return e},xme=(e,t)=>mme(e,gme(t));function b8(e,t,n){if(!e)return;if(n(e)===!0)return e;let r=t?e.return:e.child;for(;r;){const o=b8(r,t,n);if(o)return o;r=t?null:r.sibling}}function x8(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const Zy=x8(d.createContext(null));class y8 extends d.Component{render(){return d.createElement(Zy.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:Cj,ReactCurrentDispatcher:wj}=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function yme(){const e=d.useContext(Zy);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[Cj==null?void 0:Cj.current,e,e==null?void 0:e.alternate]){if(!r)continue;const o=b8(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 Cme(){var e,t;const n=yme(),[r]=d.useState(()=>new Map);r.clear();let o=n;for(;o;){const s=(e=o.type)==null?void 0:e._context;s&&s!==Zy&&!r.has(s)&&r.set(s,(t=wj==null?void 0:wj.current)==null?void 0:t.readContext(x8(s))),o=o.return}return r}function wme(){const e=Cme();return d.useMemo(()=>Array.from(e.keys()).reduce((t,n)=>r=>d.createElement(t,null,d.createElement(n.Provider,xme(yj({},r),{value:e.get(n)}))),t=>d.createElement(y8,yj({},t))),[e])}function Sme(e){const t=H.useRef({});return H.useLayoutEffect(()=>{t.current=e}),H.useLayoutEffect(()=>()=>{t.current={}},[]),t.current}const kme=e=>{const t=H.useRef(),n=H.useRef(),r=H.useRef(),o=Sme(e),s=wme(),i=l=>{const{forwardedRef:u}=e;u&&(typeof u=="function"?u(l):u.current=l)};return H.useLayoutEffect(()=>(n.current=new pd.Stage({width:e.width,height:e.height,container:t.current}),i(n.current),r.current=$u.createContainer(n.current,m8.LegacyRoot,!1,null),$u.updateContainer(H.createElement(s,{},e.children),r.current),()=>{pd.isBrowser&&(i(null),$u.updateContainer(null,r.current,null),n.current.destroy())}),[]),H.useLayoutEffect(()=>{i(n.current),Rg(n.current,e,o),$u.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",aa="Group",ks="Rect",vi="Circle",dm="Line",C8="Image",_me="Transformer",$u=Phe(pme);$u.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:H.version,rendererPackageName:"react-konva"});const jme=H.forwardRef((e,t)=>H.createElement(y8,{},H.createElement(kme,{...e,forwardedRef:t}))),Pme=ie([Lt,Co],(e,t)=>{const{tool:n,isMovingBoundingBox:r}=e;return{tool:n,isStaging:t,isMovingBoundingBox:r}},{memoizeOptions:{resultEqualityCheck:_t}}),Ime=()=>{const e=ee(),{tool:t,isStaging:n,isMovingBoundingBox:r}=L(Pme);return{handleDragStart:d.useCallback(()=>{(t==="move"||n)&&!r&&e(Qp(!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(y5(s))},[e,r,n,t]),handleDragEnd:d.useCallback(()=>{(t==="move"||n)&&!r&&e(Qp(!1))},[e,r,n,t])}},Eme=ie([Lt,wn,Co],(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:_t}}),Mme=()=>{const e=ee(),{activeTabName:t,shouldShowBoundingBox:n,tool:r,isStaging:o,isMaskEnabled:s,shouldSnapToGrid:i}=L(Eme),l=d.useRef(null),u=C5(),p=()=>e(w5());Ze(["shift+c"],()=>{p()},{enabled:()=>!o,preventDefault:!0},[]);const h=()=>e(Qb(!s));Ze(["h"],()=>{h()},{enabled:()=>!o,preventDefault:!0},[s]),Ze(["n"],()=>{e(Zp(!i))},{enabled:!0,preventDefault:!0},[i]),Ze("esc",()=>{e(x9())},{enabled:()=>!0,preventDefault:!0}),Ze("shift+h",()=>{e(y9(!n))},{enabled:()=>!o,preventDefault:!0},[t,n]),Ze(["space"],m=>{m.repeat||(u==null||u.container().focus(),r!=="move"&&(l.current=r,e(Jl("move"))),r==="move"&&l.current&&l.current!=="move"&&(e(Jl(l.current)),l.current="move"))},{keyup:!0,keydown:!0,preventDefault:!0},[r,l])},Jy=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}},w8=()=>{const e=ee(),t=f1(),n=C5();return{updateColorUnderCursor:()=>{if(!n||!t)return;const r=n.getPointerPosition();if(!r)return;const o=C9.pixelRatio,[s,i,l,u]=t.getContext().getImageData(r.x*o,r.y*o,1,1).data;u&&s&&i&&l&&e(w9({r:s,g:i,b:l,a:u}))},commitColorUnderCursor:()=>{e(S9())}}},Ome=ie([wn,Lt,Co],(e,t,n)=>{const{tool:r}=t;return{tool:r,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:_t}}),Dme=e=>{const t=ee(),{tool:n,isStaging:r}=L(Ome),{commitColorUnderCursor:o}=w8();return d.useCallback(s=>{if(!e.current)return;if(e.current.container().focus(),n==="move"||r){t(Qp(!0));return}if(n==="colorPicker"){o();return}const i=Jy(e.current);i&&(s.evt.preventDefault(),t(S5(!0)),t(k9([i.x,i.y])))},[e,n,r,t,o])},Rme=ie([wn,Lt,Co],(e,t,n)=>{const{tool:r,isDrawing:o}=t;return{tool:r,isDrawing:o,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:_t}}),Ame=(e,t,n)=>{const r=ee(),{isDrawing:o,tool:s,isStaging:i}=L(Rme),{updateColorUnderCursor:l}=w8();return d.useCallback(()=>{if(!e.current)return;const u=Jy(e.current);if(u){if(r(_9(u)),n.current=u,s==="colorPicker"){l();return}!o||s==="move"||i||(t.current=!0,r(k5([u.x,u.y])))}},[t,r,o,i,n,e,s,l])},Nme=()=>{const e=ee();return d.useCallback(()=>{e(j9())},[e])},Tme=ie([wn,Lt,Co],(e,t,n)=>{const{tool:r,isDrawing:o}=t;return{tool:r,isDrawing:o,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:_t}}),$me=(e,t)=>{const n=ee(),{tool:r,isDrawing:o,isStaging:s}=L(Tme);return d.useCallback(()=>{if(r==="move"||s){n(Qp(!1));return}if(!t.current&&o&&e.current){const i=Jy(e.current);if(!i)return;n(k5([i.x,i.y]))}else t.current=!1;n(S5(!1))},[t,n,o,s,e,r])},Lme=ie([Lt],e=>{const{isMoveStageKeyHeld:t,stageScale:n}=e;return{isMoveStageKeyHeld:t,stageScale:n}},{memoizeOptions:{resultEqualityCheck:_t}}),zme=e=>{const t=ee(),{isMoveStageKeyHeld:n,stageScale:r}=L(Lme);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=Ni(r*E9**l,I9,P9),p={x:s.x-i.x*u,y:s.y-i.y*u};t(M9(u)),t(y5(p))},[e,n,r,t])},Fme=ie(Lt,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:_t}}),Bme=()=>{const{boundingBoxCoordinates:e,boundingBoxDimensions:t,shouldDarkenOutsideBoundingBox:n,stageCoordinates:r,stageDimensions:o,stageScale:s}=L(Fme);return a.jsxs(aa,{children:[a.jsx(ks,{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(ks,{x:e.x,y:e.y,width:t.width,height:t.height,fill:"rgb(255,255,255)",listening:!1,visible:n,globalCompositeOperation:"destination-out"})]})},Hme=d.memo(Bme),Wme=ie([Lt],e=>{const{stageScale:t,stageCoordinates:n,stageDimensions:r}=e;return{stageScale:t,stageCoordinates:n,stageDimensions:r}},{memoizeOptions:{resultEqualityCheck:_t}}),Vme=()=>{const{stageScale:e,stageCoordinates:t,stageDimensions:n}=L(Wme),{colorMode:r}=la(),[o,s]=d.useState([]),[i,l]=ds("colors",["base.800","base.200"]),u=d.useCallback(p=>p/e,[e]);return d.useLayoutEffect(()=>{const{width:p,height:h}=n,{x:m,y:v}=t,b={x1:0,y1:0,x2:p,y2:h,offset:{x:u(m),y:u(v)}},y={x:Math.ceil(u(m)/64)*64,y:Math.ceil(u(v)/64)*64},x={x1:-y.x,y1:-y.y,x2:u(p)-y.x+64,y2:u(h)-y.y+64},k={x1:Math.min(b.x1,x.x1),y1:Math.min(b.y1,x.y1),x2:Math.max(b.x2,x.x2),y2:Math.max(b.y2,x.y2)},_=k.x2-k.x1,j=k.y2-k.y1,I=Math.round(_/64)+1,E=Math.round(j/64)+1,M=Iw(0,I).map(R=>a.jsx(dm,{x:k.x1+R*64,y:k.y1,points:[0,0,0,j],stroke:r==="dark"?i:l,strokeWidth:1},`x_${R}`)),D=Iw(0,E).map(R=>a.jsx(dm,{x:k.x1,y:k.y1+R*64,points:[0,0,_,0],stroke:r==="dark"?i:l,strokeWidth:1},`y_${R}`));s(M.concat(D))},[e,t,n,u,r,i,l]),a.jsx(aa,{children:o})},Ume=d.memo(Vme),Gme=ie([xo,Lt],(e,t)=>{const{progressImage:n,sessionId:r}=e,{sessionId:o,boundingBox:s}=t.layerState.stagingArea;return{boundingBox:s,progressImage:r===o?n:void 0}},{memoizeOptions:{resultEqualityCheck:_t}}),Kme=e=>{const{...t}=e,{progressImage:n,boundingBox:r}=L(Gme),[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(C8,{x:r.x,y:r.y,width:r.width,height:r.height,image:o,listening:!1,...t}):null},qme=d.memo(Kme),Ai=e=>{const{r:t,g:n,b:r,a:o}=e;return`rgba(${t}, ${n}, ${r}, ${o})`},Xme=ie(Lt,e=>{const{maskColor:t,stageCoordinates:n,stageDimensions:r,stageScale:o}=e;return{stageCoordinates:n,stageDimensions:r,stageScale:o,maskColorString:Ai(t)}}),Sj=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),Yme=e=>{const{...t}=e,{maskColorString:n,stageCoordinates:r,stageDimensions:o,stageScale:s}=L(Xme),[i,l]=d.useState(null),[u,p]=d.useState(0),h=d.useRef(null),m=d.useCallback(()=>{p(u+1),setTimeout(m,500)},[u]);return d.useEffect(()=>{if(i)return;const v=new Image;v.onload=()=>{l(v)},v.src=Sj(n)},[i,n]),d.useEffect(()=>{i&&(i.src=Sj(n))},[i,n]),d.useEffect(()=>{const v=setInterval(()=>p(b=>(b+1)%5),50);return()=>clearInterval(v)},[]),!i||!_l(r.x)||!_l(r.y)||!_l(s)||!_l(o.width)||!_l(o.height)?null:a.jsx(ks,{ref:h,offsetX:r.x/s,offsetY:r.y/s,height:o.height/s,width:o.width/s,fillPatternImage:i,fillPatternOffsetY:_l(u)?u:0,fillPatternRepeat:"repeat",fillPatternScale:{x:1/s,y:1/s},listening:!0,globalCompositeOperation:"source-in",...t})},Qme=d.memo(Yme),Zme=ie([Lt],e=>({objects:e.layerState.objects}),{memoizeOptions:{resultEqualityCheck:_t}}),Jme=e=>{const{...t}=e,{objects:n}=L(Zme);return a.jsx(aa,{listening:!1,...t,children:n.filter(O9).map((r,o)=>a.jsx(dm,{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))})},ege=d.memo(Jme);var bi=d,tge=function(t,n,r){const o=bi.useRef("loading"),s=bi.useRef(),[i,l]=bi.useState(0),u=bi.useRef(),p=bi.useRef(),h=bi.useRef();return(u.current!==t||p.current!==n||h.current!==r)&&(o.current="loading",s.current=void 0,u.current=t,p.current=n,h.current=r),bi.useLayoutEffect(function(){if(!t)return;var m=document.createElement("img");function v(){o.current="loaded",s.current=m,l(Math.random())}function b(){o.current="failed",s.current=void 0,l(Math.random())}return m.addEventListener("load",v),m.addEventListener("error",b),n&&(m.crossOrigin=n),r&&(m.referrerPolicy=r),m.src=t,function(){m.removeEventListener("load",v),m.removeEventListener("error",b)}},[t,n,r]),[s.current,o.current]};const nge=Rc(tge),rge=e=>{const{width:t,height:n,x:r,y:o,imageName:s}=e.canvasImage,{currentData:i,isError:l}=Wr(s??Er.skipToken),[u]=nge((i==null?void 0:i.image_url)??"",D9.get()?"use-credentials":"anonymous");return l?a.jsx(ks,{x:r,y:o,width:t,height:n,fill:"red"}):a.jsx(C8,{x:r,y:o,image:u,listening:!1})},S8=d.memo(rge),oge=ie([Lt],e=>{const{layerState:{objects:t}}=e;return{objects:t}},{memoizeOptions:{resultEqualityCheck:_t}}),sge=()=>{const{objects:e}=L(oge);return e?a.jsx(aa,{name:"outpainting-objects",listening:!1,children:e.map((t,n)=>{if(R9(t))return a.jsx(S8,{canvasImage:t},n);if(A9(t)){const r=a.jsx(dm,{points:t.points,stroke:t.color?Ai(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(aa,{clipX:t.clip.x,clipY:t.clip.y,clipWidth:t.clip.width,clipHeight:t.clip.height,children:r},n):r}else{if(N9(t))return a.jsx(ks,{x:t.x,y:t.y,width:t.width,height:t.height,fill:Ai(t.color)},n);if(T9(t))return a.jsx(ks,{x:t.x,y:t.y,width:t.width,height:t.height,fill:"rgb(255, 255, 255)",globalCompositeOperation:"destination-out"},n)}})}):null},age=d.memo(sge),ige=ie([Lt],e=>{const{layerState:t,shouldShowStagingImage:n,shouldShowStagingOutline:r,boundingBoxCoordinates:{x:o,y:s},boundingBoxDimensions:{width:i,height:l}}=e,{selectedImageIndex:u,images:p}=t.stagingArea;return{currentStagingAreaImage:p.length>0&&u!==void 0?p[u]:void 0,isOnFirstImage:u===0,isOnLastImage:u===p.length-1,shouldShowStagingImage:n,shouldShowStagingOutline:r,x:o,y:s,width:i,height:l}},{memoizeOptions:{resultEqualityCheck:_t}}),lge=e=>{const{...t}=e,{currentStagingAreaImage:n,shouldShowStagingImage:r,shouldShowStagingOutline:o,x:s,y:i,width:l,height:u}=L(ige);return a.jsxs(aa,{...t,children:[r&&n&&a.jsx(S8,{canvasImage:n}),o&&a.jsxs(aa,{children:[a.jsx(ks,{x:s,y:i,width:l,height:u,strokeWidth:1,stroke:"white",strokeScaleEnabled:!1}),a.jsx(ks,{x:s,y:i,width:l,height:u,dash:[4,4],strokeWidth:1,stroke:"black",strokeScaleEnabled:!1})]})]})},cge=d.memo(lge),uge=ie([Lt],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n,sessionId:r}},shouldShowStagingOutline:o,shouldShowStagingImage:s}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shouldShowStagingImage:s,shouldShowStagingOutline:o,sessionId:r}},{memoizeOptions:{resultEqualityCheck:_t}}),dge=()=>{const e=ee(),{isOnFirstImage:t,isOnLastImage:n,currentStagingAreaImage:r,shouldShowStagingImage:o,sessionId:s}=L(uge),{t:i}=Z(),l=d.useCallback(()=>{e(Cw(!0))},[e]),u=d.useCallback(()=>{e(Cw(!1))},[e]);Ze(["left"],()=>{p()},{enabled:()=>!0,preventDefault:!0}),Ze(["right"],()=>{h()},{enabled:()=>!0,preventDefault:!0}),Ze(["enter"],()=>{m()},{enabled:()=>!0,preventDefault:!0});const p=d.useCallback(()=>e($9()),[e]),h=d.useCallback(()=>e(L9()),[e]),m=d.useCallback(()=>e(z9(s)),[e,s]),{data:v}=Wr((r==null?void 0:r.imageName)??Er.skipToken);return r?a.jsx($,{pos:"absolute",bottom:4,w:"100%",align:"center",justify:"center",onMouseOver:l,onMouseOut:u,children:a.jsxs(mn,{isAttached:!0,borderRadius:"base",shadow:"dark-lg",children:[a.jsx(Te,{tooltip:`${i("unifiedCanvas.previous")} (Left)`,"aria-label":`${i("unifiedCanvas.previous")} (Left)`,icon:a.jsx(yZ,{}),onClick:p,colorScheme:"accent",isDisabled:t}),a.jsx(Te,{tooltip:`${i("unifiedCanvas.next")} (Right)`,"aria-label":`${i("unifiedCanvas.next")} (Right)`,icon:a.jsx(CZ,{}),onClick:h,colorScheme:"accent",isDisabled:n}),a.jsx(Te,{tooltip:`${i("unifiedCanvas.accept")} (Enter)`,"aria-label":`${i("unifiedCanvas.accept")} (Enter)`,icon:a.jsx(OE,{}),onClick:m,colorScheme:"accent"}),a.jsx(Te,{tooltip:i("unifiedCanvas.showHide"),"aria-label":i("unifiedCanvas.showHide"),"data-alert":!o,icon:o?a.jsx(TZ,{}):a.jsx(NZ,{}),onClick:()=>e(F9(!o)),colorScheme:"accent"}),a.jsx(Te,{tooltip:i("unifiedCanvas.saveToGallery"),"aria-label":i("unifiedCanvas.saveToGallery"),isDisabled:!v||!v.is_intermediate,icon:a.jsx(rg,{}),onClick:()=>{v&&e(B9({imageDTO:v}))},colorScheme:"accent"}),a.jsx(Te,{tooltip:i("unifiedCanvas.discardAll"),"aria-label":i("unifiedCanvas.discardAll"),icon:a.jsx(ol,{style:{transform:"rotate(45deg)"}}),onClick:()=>e(H9()),colorScheme:"error",fontSize:20})]})}):null},fge=d.memo(dge),pge=()=>{const e=L(l=>l.canvas.layerState),t=L(l=>l.canvas.boundingBoxCoordinates),n=L(l=>l.canvas.boundingBoxDimensions),r=L(l=>l.canvas.isMaskEnabled),o=L(l=>l.canvas.shouldPreserveMaskedArea),[s,i]=d.useState();return d.useEffect(()=>{i(void 0)},[e,t,n,r,o]),iJ(async()=>{const l=await W9(e,t,n,r,o);if(!l)return;const{baseImageData:u,maskImageData:p}=l,h=V9(u,p);i(h)},1e3,[e,t,n,r,o]),s},hge={txt2img:"Text to Image",img2img:"Image to Image",inpaint:"Inpaint",outpaint:"Inpaint"},mge=()=>{const e=pge();return a.jsxs(Ie,{children:["Mode: ",e?hge[e]:"..."]})},gge=d.memo(mge),Ql=e=>Math.round(e*100)/100,vge=ie([Lt],e=>{const{cursorPosition:t}=e,{cursorX:n,cursorY:r}=t?{cursorX:t.x,cursorY:t.y}:{cursorX:-1,cursorY:-1};return{cursorCoordinatesString:`(${Ql(n)}, ${Ql(r)})`}},{memoizeOptions:{resultEqualityCheck:_t}});function bge(){const{cursorCoordinatesString:e}=L(vge),{t}=Z();return a.jsx(Ie,{children:`${t("unifiedCanvas.cursorPosition")}: ${e}`})}const Db="var(--invokeai-colors-warning-500)",xge=ie([Lt],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:h},stageScale:m,shouldShowCanvasDebugInfo:v,layer:b,boundingBoxScaleMethod:y,shouldPreserveMaskedArea:x}=e;let w="inherit";return(y==="none"&&(s<512||i<512)||y==="manual"&&l*u<512*512)&&(w=Db),{activeLayerColor:b==="mask"?Db:"inherit",activeLayerString:b.charAt(0).toUpperCase()+b.slice(1),boundingBoxColor:w,boundingBoxCoordinatesString:`(${Ql(p)}, ${Ql(h)})`,boundingBoxDimensionsString:`${s}×${i}`,scaledBoundingBoxDimensionsString:`${l}×${u}`,canvasCoordinatesString:`${Ql(r)}×${Ql(o)}`,canvasDimensionsString:`${t}×${n}`,canvasScaleString:Math.round(m*100),shouldShowCanvasDebugInfo:v,shouldShowBoundingBox:y!=="auto",shouldShowScaledBoundingBox:y!=="none",shouldPreserveMaskedArea:x}},{memoizeOptions:{resultEqualityCheck:_t}}),yge=()=>{const{activeLayerColor:e,activeLayerString:t,boundingBoxColor:n,boundingBoxCoordinatesString:r,boundingBoxDimensionsString:o,scaledBoundingBoxDimensionsString:s,shouldShowScaledBoundingBox:i,canvasCoordinatesString:l,canvasDimensionsString:u,canvasScaleString:p,shouldShowCanvasDebugInfo:h,shouldShowBoundingBox:m,shouldPreserveMaskedArea:v}=L(xge),{t:b}=Z();return a.jsxs($,{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(gge,{}),a.jsx(Ie,{style:{color:e},children:`${b("unifiedCanvas.activeLayer")}: ${t}`}),a.jsx(Ie,{children:`${b("unifiedCanvas.canvasScale")}: ${p}%`}),v&&a.jsx(Ie,{style:{color:Db},children:"Preserve Masked Area: On"}),m&&a.jsx(Ie,{style:{color:n},children:`${b("unifiedCanvas.boundingBox")}: ${o}`}),i&&a.jsx(Ie,{style:{color:n},children:`${b("unifiedCanvas.scaledBoundingBox")}: ${s}`}),h&&a.jsxs(a.Fragment,{children:[a.jsx(Ie,{children:`${b("unifiedCanvas.boundingBoxPosition")}: ${r}`}),a.jsx(Ie,{children:`${b("unifiedCanvas.canvasDimensions")}: ${u}`}),a.jsx(Ie,{children:`${b("unifiedCanvas.canvasPosition")}: ${l}`}),a.jsx(bge,{})]})]})},Cge=d.memo(yge),wge=ie([xe],({canvas:e,generation:t})=>{const{boundingBoxCoordinates:n,boundingBoxDimensions:r,stageScale:o,isDrawing:s,isTransformingBoundingBox:i,isMovingBoundingBox:l,tool:u,shouldSnapToGrid:p}=e,{aspectRatio:h}=t;return{boundingBoxCoordinates:n,boundingBoxDimensions:r,isDrawing:s,isMovingBoundingBox:l,isTransformingBoundingBox:i,stageScale:o,shouldSnapToGrid:p,tool:u,hitStrokeWidth:20/o,aspectRatio:h}},{memoizeOptions:{resultEqualityCheck:_t}}),Sge=e=>{const{...t}=e,n=ee(),{boundingBoxCoordinates:r,boundingBoxDimensions:o,isDrawing:s,isMovingBoundingBox:i,isTransformingBoundingBox:l,stageScale:u,shouldSnapToGrid:p,tool:h,hitStrokeWidth:m,aspectRatio:v}=L(wge),b=d.useRef(null),y=d.useRef(null),[x,w]=d.useState(!1);d.useEffect(()=>{var F;!b.current||!y.current||(b.current.nodes([y.current]),(F=b.current.getLayer())==null||F.batchDraw())},[]);const k=64*u;Ze("N",()=>{n(Zp(!p))});const _=d.useCallback(F=>{if(!p){n(Q0({x:Math.floor(F.target.x()),y:Math.floor(F.target.y())}));return}const V=F.target.x(),X=F.target.y(),W=fr(V,64),z=fr(X,64);F.target.x(W),F.target.y(z),n(Q0({x:W,y:z}))},[n,p]),j=d.useCallback(()=>{if(!y.current)return;const F=y.current,V=F.scaleX(),X=F.scaleY(),W=Math.round(F.width()*V),z=Math.round(F.height()*X),Y=Math.round(F.x()),B=Math.round(F.y());if(v){const q=fr(W/v,64);n(No({width:W,height:q}))}else n(No({width:W,height:z}));n(Q0({x:p?Mu(Y,64):Y,y:p?Mu(B,64):B})),F.scaleX(1),F.scaleY(1)},[n,p,v]),I=d.useCallback((F,V,X)=>{const W=F.x%k,z=F.y%k;return{x:Mu(V.x,k)+W,y:Mu(V.y,k)+z}},[k]),E=()=>{n(Z0(!0))},M=()=>{n(Z0(!1)),n(J0(!1)),n(Xf(!1)),w(!1)},D=()=>{n(J0(!0))},R=()=>{n(Z0(!1)),n(J0(!1)),n(Xf(!1)),w(!1)},A=()=>{w(!0)},O=()=>{!l&&!i&&w(!1)},T=()=>{n(Xf(!0))},K=()=>{n(Xf(!1))};return a.jsxs(aa,{...t,children:[a.jsx(ks,{height:o.height,width:o.width,x:r.x,y:r.y,onMouseEnter:T,onMouseOver:T,onMouseLeave:K,onMouseOut:K}),a.jsx(ks,{draggable:!0,fillEnabled:!1,height:o.height,hitStrokeWidth:m,listening:!s&&h==="move",onDragStart:D,onDragEnd:R,onDragMove:_,onMouseDown:D,onMouseOut:O,onMouseOver:A,onMouseEnter:A,onMouseUp:R,onTransform:j,onTransformEnd:M,ref:y,stroke:x?"rgba(255,255,255,0.7)":"white",strokeWidth:(x?8:1)/u,width:o.width,x:r.x,y:r.y}),a.jsx(_me,{anchorCornerRadius:3,anchorDragBoundFunc:I,anchorFill:"rgba(212,216,234,1)",anchorSize:15,anchorStroke:"rgb(42,42,42)",borderDash:[4,4],borderEnabled:!0,borderStroke:"black",draggable:!1,enabledAnchors:h==="move"?void 0:[],flipEnabled:!1,ignoreStroke:!0,keepRatio:!1,listening:!s&&h==="move",onDragStart:D,onDragEnd:R,onMouseDown:E,onMouseUp:M,onTransformEnd:M,ref:b,rotateEnabled:!1})]})},kge=d.memo(Sge),_ge=ie(Lt,e=>{const{cursorPosition:t,brushSize:n,colorPickerColor:r,maskColor:o,brushColor:s,tool:i,layer:l,shouldShowBrush:u,isMovingBoundingBox:p,isTransformingBoundingBox:h,stageScale:m,stageDimensions:v,boundingBoxCoordinates:b,boundingBoxDimensions:y,shouldRestrictStrokesToBox:x}=e,w=x?{clipX:b.x,clipY:b.y,clipWidth:y.width,clipHeight:y.height}:{};return{cursorPosition:t,brushX:t?t.x:v.width/2,brushY:t?t.y:v.height/2,radius:n/2,colorPickerOuterRadius:ww/m,colorPickerInnerRadius:(ww-p1+1)/m,maskColorString:Ai({...o,a:.5}),brushColorString:Ai(s),colorPickerColorString:Ai(r),tool:i,layer:l,shouldShowBrush:u,shouldDrawBrushPreview:!(p||h||!t)&&u,strokeWidth:1.5/m,dotRadius:1.5/m,clip:w}},{memoizeOptions:{resultEqualityCheck:_t}}),jge=e=>{const{...t}=e,{brushX:n,brushY:r,radius:o,maskColorString:s,tool:i,layer:l,shouldDrawBrushPreview:u,dotRadius:p,strokeWidth:h,brushColorString:m,colorPickerColorString:v,colorPickerInnerRadius:b,colorPickerOuterRadius:y,clip:x}=L(_ge);return u?a.jsxs(aa,{listening:!1,...x,...t,children:[i==="colorPicker"?a.jsxs(a.Fragment,{children:[a.jsx(vi,{x:n,y:r,radius:y,stroke:m,strokeWidth:p1,strokeScaleEnabled:!1}),a.jsx(vi,{x:n,y:r,radius:b,stroke:v,strokeWidth:p1,strokeScaleEnabled:!1})]}):a.jsxs(a.Fragment,{children:[a.jsx(vi,{x:n,y:r,radius:o,fill:l==="mask"?s:m,globalCompositeOperation:i==="eraser"?"destination-out":"source-out"}),a.jsx(vi,{x:n,y:r,radius:o,stroke:"rgba(255,255,255,0.4)",strokeWidth:h*2,strokeEnabled:!0,listening:!1}),a.jsx(vi,{x:n,y:r,radius:o,stroke:"rgba(0,0,0,1)",strokeWidth:h,strokeEnabled:!0,listening:!1})]}),a.jsx(vi,{x:n,y:r,radius:p*2,fill:"rgba(255,255,255,0.4)",listening:!1}),a.jsx(vi,{x:n,y:r,radius:p,fill:"rgba(0,0,0,1)",listening:!1})]}):null},Pge=d.memo(jge),Ige=ie([Lt,Co],(e,t)=>{const{isMaskEnabled:n,stageScale:r,shouldShowBoundingBox:o,isTransformingBoundingBox:s,isMouseOverBoundingBox:i,isMovingBoundingBox:l,stageDimensions:u,stageCoordinates:p,tool:h,isMovingStage:m,shouldShowIntermediates:v,shouldShowGrid:b,shouldRestrictStrokesToBox:y,shouldAntialias:x}=e;let w="none";return h==="move"||t?m?w="grabbing":w="grab":s?w=void 0:y&&!i&&(w="default"),{isMaskEnabled:n,isModifyingBoundingBox:s||l,shouldShowBoundingBox:o,shouldShowGrid:b,stageCoordinates:p,stageCursor:w,stageDimensions:u,stageScale:r,tool:h,isStaging:t,shouldShowIntermediates:v,shouldAntialias:x}},we),Ege=_e(jme,{shouldForwardProp:e=>!["sx"].includes(e)}),Mge=()=>{const{isMaskEnabled:e,isModifyingBoundingBox:t,shouldShowBoundingBox:n,shouldShowGrid:r,stageCoordinates:o,stageCursor:s,stageDimensions:i,stageScale:l,tool:u,isStaging:p,shouldShowIntermediates:h,shouldAntialias:m}=L(Ige);Mme();const v=ee(),b=d.useRef(null),y=d.useRef(null),x=d.useRef(null),w=d.useCallback(K=>{U9(K),y.current=K},[]),k=d.useCallback(K=>{G9(K),x.current=K},[]),_=d.useRef({x:0,y:0}),j=d.useRef(!1),I=zme(y),E=Dme(y),M=$me(y,j),D=Ame(y,j,_),R=Nme(),{handleDragStart:A,handleDragMove:O,handleDragEnd:T}=Ime();return d.useEffect(()=>{if(!b.current)return;const K=new ResizeObserver(F=>{for(const V of F)if(V.contentBoxSize){const{width:X,height:W}=V.contentRect;v(Sw({width:X,height:W}))}});return K.observe(b.current),v(Sw(b.current.getBoundingClientRect())),()=>{K.disconnect()}},[v]),a.jsxs($,{id:"canvas-container",ref:b,sx:{position:"relative",height:"100%",width:"100%",borderRadius:"base"},children:[a.jsx(Ie,{sx:{position:"absolute"},children:a.jsxs(Ege,{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:E,onTouchMove:D,onTouchEnd:M,onMouseDown:E,onMouseLeave:R,onMouseMove:D,onMouseUp:M,onDragStart:A,onDragMove:O,onDragEnd:T,onContextMenu:K=>K.evt.preventDefault(),onWheel:I,draggable:(u==="move"||p)&&!t,children:[a.jsx(Eu,{id:"grid",visible:r,children:a.jsx(Ume,{})}),a.jsx(Eu,{id:"base",ref:k,listening:!1,imageSmoothingEnabled:m,children:a.jsx(age,{})}),a.jsxs(Eu,{id:"mask",visible:e,listening:!1,children:[a.jsx(ege,{visible:!0,listening:!1}),a.jsx(Qme,{listening:!1})]}),a.jsx(Eu,{children:a.jsx(Hme,{})}),a.jsxs(Eu,{id:"preview",imageSmoothingEnabled:m,children:[!p&&a.jsx(Pge,{visible:u!=="move",listening:!1}),a.jsx(cge,{visible:p}),h&&a.jsx(qme,{}),a.jsx(kge,{visible:n&&!p})]})]})}),a.jsx(Cge,{}),a.jsx(fge,{})]})},Oge=d.memo(Mge);function Dge(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 Rge=_e(xO,{baseStyle:{paddingInline:4},shouldForwardProp:e=>!["pickerColor"].includes(e)}),Jv={width:6,height:6,borderColor:"base.100"},Age=e=>{const{styleClass:t="",...n}=e;return a.jsx(Rge,{sx:{".react-colorful__hue-pointer":Jv,".react-colorful__saturation-pointer":Jv,".react-colorful__alpha-pointer":Jv},className:t,...n})},k8=d.memo(Age),Nge=ie([Lt,Co],(e,t)=>{const{maskColor:n,layer:r,isMaskEnabled:o,shouldPreserveMaskedArea:s}=e;return{layer:r,maskColor:n,maskColorString:Ai(n),isMaskEnabled:o,shouldPreserveMaskedArea:s,isStaging:t}},{memoizeOptions:{resultEqualityCheck:_t}}),Tge=()=>{const e=ee(),{t}=Z(),{layer:n,maskColor:r,isMaskEnabled:o,shouldPreserveMaskedArea:s,isStaging:i}=L(Nge);Ze(["q"],()=>{l()},{enabled:()=>!i,preventDefault:!0},[n]),Ze(["shift+c"],()=>{u()},{enabled:()=>!i,preventDefault:!0},[]),Ze(["h"],()=>{p()},{enabled:()=>!i,preventDefault:!0},[o]);const l=()=>{e(_5(n==="mask"?"base":"mask"))},u=()=>e(w5()),p=()=>e(Qb(!o)),h=async()=>{e(X9())};return a.jsx(qd,{triggerComponent:a.jsx(mn,{children:a.jsx(Te,{"aria-label":t("unifiedCanvas.maskingOptions"),tooltip:t("unifiedCanvas.maskingOptions"),icon:a.jsx(zE,{}),isChecked:n==="mask",isDisabled:i})}),children:a.jsxs($,{direction:"column",gap:2,children:[a.jsx(ur,{label:`${t("unifiedCanvas.enableMask")} (H)`,isChecked:o,onChange:p}),a.jsx(ur,{label:t("unifiedCanvas.preserveMaskedArea"),isChecked:s,onChange:m=>e(K9(m.target.checked))}),a.jsx(k8,{sx:{paddingTop:2,paddingBottom:2},pickerColor:r,onChange:m=>e(q9(m))}),a.jsx(it,{size:"sm",leftIcon:a.jsx(rg,{}),onClick:h,children:"Save Mask"}),a.jsxs(it,{size:"sm",leftIcon:a.jsx(Kr,{}),onClick:u,children:[t("unifiedCanvas.clearMask")," (Shift+C)"]})]})})},$ge=d.memo(Tge),Lge=ie([Lt,wn,xo],(e,t,n)=>{const{futureLayerStates:r}=e;return{canRedo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:_t}});function zge(){const e=ee(),{canRedo:t,activeTabName:n}=L(Lge),{t:r}=Z(),o=()=>{e(Y9())};return Ze(["meta+shift+z","ctrl+shift+z","control+y","meta+y"],()=>{o()},{enabled:()=>t,preventDefault:!0},[n,t]),a.jsx(Te,{"aria-label":`${r("unifiedCanvas.redo")} (Ctrl+Shift+Z)`,tooltip:`${r("unifiedCanvas.redo")} (Ctrl+Shift+Z)`,icon:a.jsx(KZ,{}),onClick:o,isDisabled:!t})}const Fge=()=>{const e=L(Co),t=ee(),{t:n}=Z();return a.jsxs(Gy,{title:n("unifiedCanvas.clearCanvasHistory"),acceptCallback:()=>t(Q9()),acceptButtonText:n("unifiedCanvas.clearHistory"),triggerComponent:a.jsx(it,{size:"sm",leftIcon:a.jsx(Kr,{}),isDisabled:e,children:n("unifiedCanvas.clearCanvasHistory")}),children:[a.jsx("p",{children:n("unifiedCanvas.clearCanvasHistoryMessage")}),a.jsx("br",{}),a.jsx("p",{children:n("unifiedCanvas.clearCanvasHistoryConfirm")})]})},Bge=d.memo(Fge),Hge=ie([Lt],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:_t}}),Wge=()=>{const e=ee(),{t}=Z(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldDarkenOutsideBoundingBox:o,shouldShowCanvasDebugInfo:s,shouldShowGrid:i,shouldShowIntermediates:l,shouldSnapToGrid:u,shouldRestrictStrokesToBox:p,shouldAntialias:h}=L(Hge);Ze(["n"],()=>{e(Zp(!u))},{enabled:!0,preventDefault:!0},[u]);const m=v=>e(Zp(v.target.checked));return a.jsx(qd,{isLazy:!1,triggerComponent:a.jsx(Te,{tooltip:t("unifiedCanvas.canvasSettings"),"aria-label":t("unifiedCanvas.canvasSettings"),icon:a.jsx(VE,{})}),children:a.jsxs($,{direction:"column",gap:2,children:[a.jsx(ur,{label:t("unifiedCanvas.showIntermediates"),isChecked:l,onChange:v=>e(Z9(v.target.checked))}),a.jsx(ur,{label:t("unifiedCanvas.showGrid"),isChecked:i,onChange:v=>e(J9(v.target.checked))}),a.jsx(ur,{label:t("unifiedCanvas.snapToGrid"),isChecked:u,onChange:m}),a.jsx(ur,{label:t("unifiedCanvas.darkenOutsideSelection"),isChecked:o,onChange:v=>e(eN(v.target.checked))}),a.jsx(ur,{label:t("unifiedCanvas.autoSaveToGallery"),isChecked:n,onChange:v=>e(tN(v.target.checked))}),a.jsx(ur,{label:t("unifiedCanvas.saveBoxRegionOnly"),isChecked:r,onChange:v=>e(nN(v.target.checked))}),a.jsx(ur,{label:t("unifiedCanvas.limitStrokesToBox"),isChecked:p,onChange:v=>e(rN(v.target.checked))}),a.jsx(ur,{label:t("unifiedCanvas.showCanvasDebugInfo"),isChecked:s,onChange:v=>e(oN(v.target.checked))}),a.jsx(ur,{label:t("unifiedCanvas.antialiasing"),isChecked:h,onChange:v=>e(sN(v.target.checked))}),a.jsx(Bge,{})]})})},Vge=d.memo(Wge),Uge=ie([Lt,Co,xo],(e,t,n)=>{const{isProcessing:r}=n,{tool:o,brushColor:s,brushSize:i}=e;return{tool:o,isStaging:t,isProcessing:r,brushColor:s,brushSize:i}},{memoizeOptions:{resultEqualityCheck:_t}}),Gge=()=>{const e=ee(),{tool:t,brushColor:n,brushSize:r,isStaging:o}=L(Uge),{t:s}=Z();Ze(["b"],()=>{i()},{enabled:()=>!o,preventDefault:!0},[]),Ze(["e"],()=>{l()},{enabled:()=>!o,preventDefault:!0},[t]),Ze(["c"],()=>{u()},{enabled:()=>!o,preventDefault:!0},[t]),Ze(["shift+f"],()=>{p()},{enabled:()=>!o,preventDefault:!0}),Ze(["delete","backspace"],()=>{h()},{enabled:()=>!o,preventDefault:!0}),Ze(["BracketLeft"],()=>{r-5<=5?e(Yf(Math.max(r-1,1))):e(Yf(Math.max(r-5,1)))},{enabled:()=>!o,preventDefault:!0},[r]),Ze(["BracketRight"],()=>{e(Yf(Math.min(r+5,500)))},{enabled:()=>!o,preventDefault:!0},[r]),Ze(["Shift+BracketLeft"],()=>{e(ev({...n,a:Ni(n.a-.05,.05,1)}))},{enabled:()=>!o,preventDefault:!0},[n]),Ze(["Shift+BracketRight"],()=>{e(ev({...n,a:Ni(n.a+.05,.05,1)}))},{enabled:()=>!o,preventDefault:!0},[n]);const i=()=>e(Jl("brush")),l=()=>e(Jl("eraser")),u=()=>e(Jl("colorPicker")),p=()=>e(aN()),h=()=>e(iN());return a.jsxs(mn,{isAttached:!0,children:[a.jsx(Te,{"aria-label":`${s("unifiedCanvas.brush")} (B)`,tooltip:`${s("unifiedCanvas.brush")} (B)`,icon:a.jsx(UZ,{}),isChecked:t==="brush"&&!o,onClick:i,isDisabled:o}),a.jsx(Te,{"aria-label":`${s("unifiedCanvas.eraser")} (E)`,tooltip:`${s("unifiedCanvas.eraser")} (E)`,icon:a.jsx(EZ,{}),isChecked:t==="eraser"&&!o,isDisabled:o,onClick:l}),a.jsx(Te,{"aria-label":`${s("unifiedCanvas.fillBoundingBox")} (Shift+F)`,tooltip:`${s("unifiedCanvas.fillBoundingBox")} (Shift+F)`,icon:a.jsx($Z,{}),isDisabled:o,onClick:p}),a.jsx(Te,{"aria-label":`${s("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,tooltip:`${s("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,icon:a.jsx(ol,{style:{transform:"rotate(45deg)"}}),isDisabled:o,onClick:h}),a.jsx(Te,{"aria-label":`${s("unifiedCanvas.colorPicker")} (C)`,tooltip:`${s("unifiedCanvas.colorPicker")} (C)`,icon:a.jsx(AZ,{}),isChecked:t==="colorPicker"&&!o,isDisabled:o,onClick:u}),a.jsx(qd,{triggerComponent:a.jsx(Te,{"aria-label":s("unifiedCanvas.brushOptions"),tooltip:s("unifiedCanvas.brushOptions"),icon:a.jsx(HE,{})}),children:a.jsxs($,{minWidth:60,direction:"column",gap:4,width:"100%",children:[a.jsx($,{gap:4,justifyContent:"space-between",children:a.jsx(Xe,{label:s("unifiedCanvas.brushSize"),value:r,withInput:!0,onChange:m=>e(Yf(m)),sliderNumberInputProps:{max:500}})}),a.jsx(k8,{sx:{width:"100%",paddingTop:2,paddingBottom:2},pickerColor:n,onChange:m=>e(ev(m))})]})})]})},Kge=d.memo(Gge),qge=ie([Lt,wn,xo],(e,t,n)=>{const{pastLayerStates:r}=e;return{canUndo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:_t}});function Xge(){const e=ee(),{t}=Z(),{canUndo:n,activeTabName:r}=L(qge),o=()=>{e(lN())};return Ze(["meta+z","ctrl+z"],()=>{o()},{enabled:()=>n,preventDefault:!0},[r,n]),a.jsx(Te,{"aria-label":`${t("unifiedCanvas.undo")} (Ctrl+Z)`,tooltip:`${t("unifiedCanvas.undo")} (Ctrl+Z)`,icon:a.jsx(Ud,{}),onClick:o,isDisabled:!n})}const Yge=ie([xo,Lt,Co],(e,t,n)=>{const{isProcessing:r}=e,{tool:o,shouldCropToBoundingBoxOnSave:s,layer:i,isMaskEnabled:l}=t;return{isProcessing:r,isStaging:n,isMaskEnabled:l,tool:o,layer:i,shouldCropToBoundingBoxOnSave:s}},{memoizeOptions:{resultEqualityCheck:_t}}),Qge=()=>{const e=ee(),{isProcessing:t,isStaging:n,isMaskEnabled:r,layer:o,tool:s}=L(Yge),i=f1(),{t:l}=Z(),{isClipboardAPIAvailable:u}=WM(),{getUploadButtonProps:p,getUploadInputProps:h}=Iy({postUploadAction:{type:"SET_CANVAS_INITIAL_IMAGE"}});Ze(["v"],()=>{m()},{enabled:()=>!n,preventDefault:!0},[]),Ze(["r"],()=>{b()},{enabled:()=>!0,preventDefault:!0},[i]),Ze(["shift+m"],()=>{x()},{enabled:()=>!n,preventDefault:!0},[i,t]),Ze(["shift+s"],()=>{w()},{enabled:()=>!n,preventDefault:!0},[i,t]),Ze(["meta+c","ctrl+c"],()=>{k()},{enabled:()=>!n&&u,preventDefault:!0},[i,t,u]),Ze(["shift+d"],()=>{_()},{enabled:()=>!n,preventDefault:!0},[i,t]);const m=()=>e(Jl("move")),v=Dge(()=>b(!1),()=>b(!0)),b=(I=!1)=>{const E=f1();if(!E)return;const M=E.getClientRect({skipTransform:!0});e(uN({contentRect:M,shouldScaleTo1:I}))},y=()=>{e(Bj())},x=()=>{e(dN())},w=()=>{e(fN())},k=()=>{u&&e(pN())},_=()=>{e(hN())},j=I=>{const E=I;e(_5(E)),E==="mask"&&!r&&e(Qb(!0))};return a.jsxs($,{sx:{alignItems:"center",gap:2,flexWrap:"wrap"},children:[a.jsx(Ie,{w:24,children:a.jsx(In,{tooltip:`${l("unifiedCanvas.layer")} (Q)`,value:o,data:cN,onChange:j,disabled:n})}),a.jsx($ge,{}),a.jsx(Kge,{}),a.jsxs(mn,{isAttached:!0,children:[a.jsx(Te,{"aria-label":`${l("unifiedCanvas.move")} (V)`,tooltip:`${l("unifiedCanvas.move")} (V)`,icon:a.jsx(wZ,{}),isChecked:s==="move"||n,onClick:m}),a.jsx(Te,{"aria-label":`${l("unifiedCanvas.resetView")} (R)`,tooltip:`${l("unifiedCanvas.resetView")} (R)`,icon:a.jsx(jZ,{}),onClick:v})]}),a.jsxs(mn,{isAttached:!0,children:[a.jsx(Te,{"aria-label":`${l("unifiedCanvas.mergeVisible")} (Shift+M)`,tooltip:`${l("unifiedCanvas.mergeVisible")} (Shift+M)`,icon:a.jsx(HZ,{}),onClick:x,isDisabled:n}),a.jsx(Te,{"aria-label":`${l("unifiedCanvas.saveToGallery")} (Shift+S)`,tooltip:`${l("unifiedCanvas.saveToGallery")} (Shift+S)`,icon:a.jsx(rg,{}),onClick:w,isDisabled:n}),u&&a.jsx(Te,{"aria-label":`${l("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${l("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,icon:a.jsx(Wc,{}),onClick:k,isDisabled:n}),a.jsx(Te,{"aria-label":`${l("unifiedCanvas.downloadAsImage")} (Shift+D)`,tooltip:`${l("unifiedCanvas.downloadAsImage")} (Shift+D)`,icon:a.jsx(ng,{}),onClick:_,isDisabled:n})]}),a.jsxs(mn,{isAttached:!0,children:[a.jsx(Xge,{}),a.jsx(zge,{})]}),a.jsxs(mn,{isAttached:!0,children:[a.jsx(Te,{"aria-label":`${l("common.upload")}`,tooltip:`${l("common.upload")}`,icon:a.jsx(og,{}),isDisabled:n,...p()}),a.jsx("input",{...h()}),a.jsx(Te,{"aria-label":`${l("unifiedCanvas.clearCanvas")}`,tooltip:`${l("unifiedCanvas.clearCanvas")}`,icon:a.jsx(Kr,{}),onClick:y,colorScheme:"error",isDisabled:n})]}),a.jsx(mn,{isAttached:!0,children:a.jsx(Vge,{})})]})},Zge=d.memo(Qge),kj={id:"canvas-intial-image",actionType:"SET_CANVAS_INITIAL_IMAGE"},Jge=()=>{const{isOver:e,setNodeRef:t,active:n}=wM({id:"unifiedCanvas",data:kj});return a.jsxs($,{layerStyle:"first",ref:t,tabIndex:-1,sx:{flexDirection:"column",alignItems:"center",gap:4,p:2,borderRadius:"base",w:"full",h:"full"},children:[a.jsx(Zge,{}),a.jsx(Oge,{}),SM(kj,n)&&a.jsx(kM,{isOver:e,label:"Set Canvas Initial Image"})]})},e0e=d.memo(Jge),t0e=()=>a.jsx(e0e,{}),n0e=d.memo(t0e),r0e=[{id:"txt2img",translationKey:"common.txt2img",icon:a.jsx(Tn,{as:LZ,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(She,{})},{id:"img2img",translationKey:"common.img2img",icon:a.jsx(Tn,{as:Ui,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(Oue,{})},{id:"unifiedCanvas",translationKey:"common.unifiedCanvas",icon:a.jsx(Tn,{as:Tne,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(n0e,{})},{id:"nodes",translationKey:"common.nodes",icon:a.jsx(Tn,{as:yg,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(Che,{})},{id:"modelManager",translationKey:"modelManager.modelManager",icon:a.jsx(Tn,{as:PZ,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(Mde,{})}],o0e=ie([xe],({config:e})=>{const{disabledTabs:t}=e;return r0e.filter(r=>!t.includes(r.id))},{memoizeOptions:{resultEqualityCheck:_t}}),s0e=448,a0e=448,i0e=360,l0e=["modelManager"],c0e=["modelManager"],u0e=()=>{const e=L(mN),t=L(wn),n=L(o0e),{t:r}=Z(),o=ee(),s=d.useCallback(O=>{O.target instanceof HTMLElement&&O.target.blur()},[]),i=d.useMemo(()=>n.map(O=>a.jsx(Rt,{hasArrow:!0,label:String(r(O.translationKey)),placement:"end",children:a.jsxs(Pr,{onClick:s,children:[a.jsx(H5,{children:String(r(O.translationKey))}),O.icon]})},O.id)),[n,r,s]),l=d.useMemo(()=>n.map(O=>a.jsx(mo,{children:O.content},O.id)),[n]),u=d.useCallback(O=>{const T=gN[O];T&&o(Aa(T))},[o]),{minSize:p,isCollapsed:h,setIsCollapsed:m,ref:v,reset:b,expand:y,collapse:x,toggle:w}=M_(s0e,"pixels"),{ref:k,minSize:_,isCollapsed:j,setIsCollapsed:I,reset:E,expand:M,collapse:D,toggle:R}=M_(i0e,"pixels");Ze("f",()=>{j||h?(M(),y()):(x(),D())},[o,j,h]),Ze(["t","o"],()=>{w()},[o]),Ze("g",()=>{R()},[o]);const A=Ny();return a.jsxs(Ji,{variant:"appTabs",defaultIndex:e,index:e,onChange:u,sx:{flexGrow:1,gap:4},isLazy:!0,children:[a.jsxs(el,{sx:{pt:2,gap:4,flexDir:"column"},children:[i,a.jsx(Za,{}),a.jsx(MJ,{})]}),a.jsxs(Sg,{id:"app",autoSaveId:"app",direction:"horizontal",style:{height:"100%",width:"100%"},storage:A,units:"pixels",children:[!c0e.includes(t)&&a.jsxs(a.Fragment,{children:[a.jsx(Ua,{order:0,id:"side",ref:v,defaultSize:p,minSize:p,onCollapse:m,collapsible:!0,children:t==="nodes"?a.jsx(pse,{}):a.jsx(Jce,{})}),a.jsx(im,{onDoubleClick:b,collapsedDirection:h?"left":void 0}),a.jsx(vse,{isSidePanelCollapsed:h,sidePanelRef:v})]}),a.jsx(Ua,{id:"main",order:1,minSize:a0e,children:a.jsx(Fc,{style:{height:"100%",width:"100%"},children:l})}),!l0e.includes(t)&&a.jsxs(a.Fragment,{children:[a.jsx(im,{onDoubleClick:E,collapsedDirection:j?"right":void 0}),a.jsx(Ua,{id:"gallery",ref:k,order:2,defaultSize:_,minSize:_,onCollapse:I,collapsible:!0,children:a.jsx(pre,{})}),a.jsx(mse,{isGalleryCollapsed:j,galleryPanelRef:k})]})]})]})},d0e=d.memo(u0e),f0e=d.createContext(null),e1={didCatch:!1,error:null};class p0e extends d.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=e1}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(e1)}}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&&h0e(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(e1)}}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(f0e.Provider,{value:{didCatch:s,error:i,resetErrorBoundary:this.resetErrorBoundary}},l)}}function h0e(){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]))}const m0e=()=>{const e=ee(),[t,n]=d.useState(),[r,o]=d.useState(),{recallAllParameters:s}=xg(),i=tl(),{currentData:l}=Wr(t??Er.skipToken),{currentData:u}=vN(r??Er.skipToken);return{handlePreselectedImage:d.useCallback(h=>{h&&(h.action==="sendToCanvas"&&(n(h==null?void 0:h.imageName),l&&(e(Yj(l)),e(Aa("unifiedCanvas")),i({title:bN("toast.sentToUnifiedCanvas"),status:"info",duration:2500,isClosable:!0}))),h.action==="sendToImg2Img"&&(n(h==null?void 0:h.imageName),l&&e(gm(l))),h.action==="useAllParameters"&&(o(h==null?void 0:h.imageName),u&&s(u.metadata)))},[e,l,u,s,i])}};function g0e(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 v0e=({error:e,resetErrorBoundary:t})=>{const n=A5(),r=d.useCallback(()=>{const s=JSON.stringify(xN(e),null,2);navigator.clipboard.writeText(`\`\`\`
${s}
\`\`\``),n({title:"Error Copied"})},[e,n]),o=d.useMemo(()=>g0e({user:"invoke-ai",repo:"InvokeAI",template:"BUG_REPORT.yml",title:`[bug]: ${e.name}: ${e.message}`}),[e.message,e.name]);return a.jsx($,{layerStyle:"body",sx:{w:"100vw",h:"100vh",alignItems:"center",justifyContent:"center",p:4},children:a.jsxs($,{layerStyle:"first",sx:{flexDir:"column",borderRadius:"base",justifyContent:"center",gap:8,p:16},children:[a.jsx(io,{children:"Something went wrong"}),a.jsx($,{layerStyle:"second",sx:{px:8,py:4,borderRadius:"base",gap:4,justifyContent:"space-between",alignItems:"center"},children:a.jsxs(ye,{sx:{fontWeight:600,color:"error.500",_dark:{color:"error.400"}},children:[e.name,": ",e.message]})}),a.jsxs($,{sx:{gap:4},children:[a.jsx(it,{leftIcon:a.jsx(lhe,{}),onClick:t,children:"Reset UI"}),a.jsx(it,{leftIcon:a.jsx(Wc,{}),onClick:r,children:"Copy Error"}),a.jsx(Mm,{href:o,isExternal:!0,children:a.jsx(it,{leftIcon:a.jsx(AE,{}),children:"Create Issue"})})]})]})})},b0e=d.memo(v0e),x0e=ie([xe],({hotkeys:e})=>{const{shift:t,ctrl:n,meta:r}=e;return{shift:t,ctrl:n,meta:r}},{memoizeOptions:{resultEqualityCheck:_t}}),y0e=()=>{const e=ee(),{shift:t,ctrl:n,meta:r}=L(x0e);return Ze("*",()=>{zp("shift")?!t&&e(Ir(!0)):t&&e(Ir(!1)),zp("ctrl")?!n&&e(kw(!0)):n&&e(kw(!1)),zp("meta")?!r&&e(_w(!0)):r&&e(_w(!1))},{keyup:!0,keydown:!0},[t,n,r]),Ze("1",()=>{e(Aa("txt2img"))}),Ze("2",()=>{e(Aa("img2img"))}),Ze("3",()=>{e(Aa("unifiedCanvas"))}),Ze("4",()=>{e(Aa("nodes"))}),Ze("5",()=>{e(Aa("modelManager"))}),null},C0e=d.memo(y0e),w0e={},S0e=({config:e=w0e,selectedImage:t})=>{const n=L(LP),r=zP("system"),o=ee(),{handlePreselectedImage:s}=m0e(),i=d.useCallback(()=>(localStorage.clear(),location.reload(),!1),[]);d.useEffect(()=>{vt.changeLanguage(n)},[n]),d.useEffect(()=>{s5(e)&&(r.info({config:e},"Received config"),o(yN(e)))},[o,e,r]),d.useEffect(()=>{o(CN())},[o]),d.useEffect(()=>{s(t)},[s,t]);const l=bg(wN);return a.jsxs(p0e,{onReset:i,FallbackComponent:b0e,children:[a.jsx(Ga,{w:"100vw",h:"100vh",position:"relative",overflow:"hidden",children:a.jsx(qV,{children:a.jsxs(Ga,{sx:{gap:4,p:4,gridAutoRows:"min-content auto",w:"full",h:"full"},children:[l||a.jsx(PJ,{}),a.jsx($,{sx:{gap:4,w:"full",h:"full"},children:a.jsx(d0e,{})})]})})}),a.jsx(fZ,{}),a.jsx(iZ,{}),a.jsx($W,{}),a.jsx(C0e,{})]})},D0e=d.memo(S0e);export{D0e as default};