InvokeAI/invokeai/frontend/web/dist/assets/App-78495256.js
2023-08-31 10:35:17 -04:00

172 lines
940 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 iv=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var Pe=(e,t,n)=>(iv(e,t,"read from private field"),n?n.call(e):t.get(e)),rr=(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)},as=(e,t,n,r)=>(iv(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var rd=(e,t,n,r)=>({set _(o){as(e,t,o,n)},get _(){return Pe(e,t,r)}}),da=(e,t,n)=>(iv(e,t,"access private method"),n);import{t as o7,a as rf,b as D_,S as A_,c as N_,d as T_,e as b1,f as $_,i as x1,g as s7,k as a7,h as i7,j as l7,l as Kw,m as L_,n as c7,o as u7,p as d7,q as f7,r as p7,s as h7,u as m7,v as g7,w as u,x as a,y as Yb,z as vh,A as v7,B as b7,C as x7,D as y7,P as w7,E as Jb,F as C7,G as S7,H as k7,I as j7,J as Te,K as _7,L as Me,M as _t,N as rt,O as of,Q as co,R as yr,T as Vr,U as Jn,V as Wl,W as Xi,X as Ht,Y as gs,Z as zc,_ as ui,$ as Lm,a0 as Zb,a1 as Cu,a2 as ar,a3 as P7,a4 as H,a5 as Xw,a6 as I7,a7 as F_,a8 as y1,a9 as sf,aa as E7,ab as z_,ac as B_,ad as xa,ae as O7,af as le,ag as Oe,ah as mn,ai as z,aj as M7,ak as Qw,al as R7,am as D7,an as A7,ao as Su,ap as se,aq as N7,ar as Cn,as as _n,at as Fe,au as $,av as ds,aw as ke,ax as jr,ay as H_,az as T7,aA as $7,aB as L7,aC as F7,aD as fs,aE as ex,aF as di,aG as Do,aH as Fm,aI as z7,aJ as B7,aK as Yw,aL as tx,aM as Ee,aN as $s,aO as H7,aP as W_,aQ as V_,aR as Jw,aS as W7,aT as V7,aU as U7,aV as Vl,aW as U_,aX as Sr,aY as G7,aZ as q7,a_ as K7,a$ as G_,b0 as uo,b1 as zm,b2 as X7,b3 as Zw,b4 as q_,b5 as Q7,b6 as Y7,b7 as J7,b8 as Z7,b9 as eR,ba as tR,bb as nR,bc as rR,bd as K_,be as oR,bf as sR,bg as aR,bh as iR,bi as nx,bj as lR,bk as cR,bl as uR,bm as fc,bn as dR,bo as fR,bp as pR,bq as hR,br as eC,bs as mR,bt as gR,bu as Fi,bv as Bm,bw as X_,bx as Q_,by as qo,bz as Y_,bA as vR,bB as El,bC as gd,bD as tC,bE as bR,bF as xR,bG as yR,bH as xp,bI as yp,bJ as od,bK as lv,bL as kd,bM as jd,bN as _d,bO as Pd,bP as nC,bQ as bh,bR as cv,bS as xh,bT as rC,bU as w1,bV as uv,bW as C1,bX as dv,bY as yh,bZ as oC,b_ as Ol,b$ as sC,c0 as Ml,c1 as aC,c2 as wh,c3 as Hm,c4 as wR,c5 as J_,c6 as S1,c7 as k1,c8 as Z_,c9 as CR,ca as j1,cb as SR,cc as _1,cd as kR,ce as P1,cf as rx,cg as ox,ch as sx,ci as ax,cj as Wm,ck as ix,cl as va,cm as e3,cn as t3,co as lx,cp as n3,cq as jR,cr as sd,cs as Rl,ct as r3,cu as o3,cv as iC,cw as _R,cx as PR,cy as IR,cz as Er,cA as ER,cB as Wr,cC as af,cD as Vm,cE as OR,cF as MR,cG as RR,cH as DR,cI as AR,cJ as NR,cK as TR,cL as $R,cM as LR,cN as FR,cO as lC,cP as cx,cQ as zR,cR as BR,cS as lf,cT as HR,cU as WR,cV as Um,cW as VR,cX as UR,cY as GR,cZ as ux,c_ as qR,c$ as xr,d0 as KR,d1 as XR,d2 as QR,d3 as Gm,d4 as YR,d5 as JR,d6 as ZR,d7 as Td,d8 as cC,d9 as Gs,da as s3,db as eD,dc as dx,dd as tD,de as uC,df as nD,dg as rD,dh as oD,di as a3,dj as sD,dk as i3,dl as aD,dm as iD,dn as lD,dp as cD,dq as uD,dr as dD,ds as fD,dt as pD,du as l3,dv as c3,dw as hD,dx as mD,dy as gD,dz as vD,dA as bD,dB as Ls,dC as xD,dD as ws,dE as yD,dF as wD,dG as CD,dH as SD,dI as kD,dJ as jD,dK as _D,dL as PD,dM as ID,dN as ED,dO as OD,dP as MD,dQ as RD,dR as DD,dS as AD,dT as ND,dU as dC,dV as TD,dW as fC,dX as $D,dY as LD,dZ as FD,d_ as zD,d$ as BD,e0 as HD,e1 as pC,e2 as hC,e3 as mC,e4 as fx,e5 as WD,e6 as As,e7 as $d,e8 as zs,e9 as VD,ea as UD,eb as u3,ec as d3,ed as GD,ee as gC,ef as vC,eg as bC,eh as xC,ei as qD,ej as KD,ek as yC,el as XD,em as QD,en as Ch,eo as YD,ep as wC,eq as wp,er as CC,es as SC,et as JD,eu as ZD,ev as eA,ew as f3,ex as tA,ey as nA,ez as kC,eA as rA,eB as jC,eC as oA,eD as p3,eE as h3,eF as cf,eG as m3,eH as vl,eI as g3,eJ as _C,eK as sA,eL as aA,eM as v3,eN as iA,eO as lA,eP as cA,eQ as uA,eR as dA,eS as px,eT as I1,eU as PC,eV as Ul,eW as fA,eX as pA,eY as b3,eZ as Sh,e_ as hx,e$ as x3,f0 as hA,f1 as Qa,f2 as y3,f3 as mA,f4 as gA,f5 as vA,f6 as bA,f7 as xA,f8 as yA,f9 as wA,fa as mx,fb as vd,fc as Dc,fd as CA,fe as SA,ff as kA,fg as jA,fh as _A,fi as PA,fj as IA,fk as EA,fl as OA,fm as MA,fn as RA,fo as DA,fp as AA,fq as NA,fr as TA,fs as $A,ft as LA,fu as FA,fv as IC,fw as zA,fx as BA,fy as HA,fz as WA,fA as VA,fB as UA,fC as GA,fD as qA,fE as KA,fF as XA,fG as QA,fH as YA,fI as JA,fJ as ZA,fK as EC,fL as oh,fM as eN,fN as kh,fO as w3,fP as jh,fQ as tN,fR as nN,fS as Bc,fT as C3,fU as S3,fV as gx,fW as rN,fX as oN,fY as sN,fZ as E1,f_ as k3,f$ as aN,g0 as iN,g1 as j3,g2 as lN,g3 as cN,g4 as uN,g5 as dN,g6 as fN,g7 as pN,g8 as hN,g9 as mN,ga as gN,gb as vN,gc as bN,gd as OC,ge as xN,gf as yN,gg as wN,gh as CN,gi as SN,gj as kN,gk as jN,gl as _N,gm as fv,gn as pv,go as hv,gp as Cp,gq as MC,gr as O1,gs as PN,gt as IN,gu as EN,gv as ON,gw as MN,gx as _3,gy as RN,gz as DN,gA as AN,gB as NN,gC as TN,gD as $N,gE as LN,gF as FN,gG as zN,gH as BN,gI as HN,gJ as mv,gK as gv,gL as WN,gM as VN,gN as UN,gO as GN,gP as qN,gQ as KN,gR as XN,gS as QN,gT as YN,gU as JN,gV as ZN,gW as e9,gX as t9,gY as n9,gZ as RC,g_ as DC,g$ as r9,h0 as o9}from"./index-08cda350.js";import{I as Tr,u as s9,c as a9,a as Dn,b as sr,d as fi,P as uf,C as i9,e as Ie,f as P3,g as pi,h as l9,r as Ge,i as c9,j as AC,k as Gt,l as _r,m as au}from"./menu-3d10c968.js";var NC=1/0,u9=17976931348623157e292;function vv(e){if(!e)return e===0?e:0;if(e=o7(e),e===NC||e===-NC){var t=e<0?-1:1;return t*u9}return e===e?e:0}var d9=200;function f9(e,t,n,r){var o=-1,s=N_,i=!0,c=e.length,f=[],p=t.length;if(!c)return f;n&&(t=rf(t,D_(n))),r?(s=T_,i=!1):t.length>=d9&&(s=b1,i=!1,t=new A_(t));e:for(;++o<c;){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;f.push(h)}else s(t,m,r)||f.push(h)}return f}var p9=$_(function(e,t){return x1(e)?f9(e,s7(t,1,x1,!0)):[]});const h9=p9;function m9(e,t){return rf(t,function(n){return e[n]})}function g9(e){return e==null?[]:m9(e,a7(e))}var v9=Math.min;function b9(e,t,n){for(var r=n?T_:N_,o=e[0].length,s=e.length,i=s,c=Array(s),f=1/0,p=[];i--;){var h=e[i];i&&t&&(h=rf(h,D_(t))),f=v9(h.length,f),c[i]=!n&&(t||o>=120&&h.length>=120)?new A_(i&&h):void 0}h=e[0];var m=-1,v=c[0];e:for(;++m<o&&p.length<f;){var b=h[m],y=t?t(b):b;if(b=n||b!==0?b:0,!(v?b1(v,y):r(p,y,n))){for(i=s;--i;){var x=c[i];if(!(x?b1(x,y):r(e[i],y,n)))continue e}v&&v.push(y),p.push(b)}}return p}function x9(e){return x1(e)?e:[]}var y9=$_(function(e){var t=rf(e,x9);return t.length&&t[0]===e[0]?b9(t):[]});const w9=y9;var C9="[object Number]";function pc(e){return typeof e=="number"||i7(e)&&l7(e)==C9}function S9(e,t,n,r){if(!Kw(e))return e;t=L_(t,e);for(var o=-1,s=t.length,i=s-1,c=e;c!=null&&++o<s;){var f=c7(t[o]),p=n;if(f==="__proto__"||f==="constructor"||f==="prototype")return e;if(o!=i){var h=c[f];p=r?r(h,f,c):void 0,p===void 0&&(p=Kw(h)?h:u7(t[o+1])?[]:{})}d7(c,f,p),c=c[f]}return e}function k9(e,t,n){for(var r=-1,o=t.length,s={};++r<o;){var i=t[r],c=f7(e,i);n(c,i)&&S9(s,L_(i,e),c)}return s}function TC(e,t){if(e==null)return{};var n=rf(p7(e),function(r){return[r]});return t=h7(t),k9(e,n,function(r,o){return t(r,o[0])})}var j9=Math.ceil,_9=Math.max;function P9(e,t,n,r){for(var o=-1,s=_9(j9((t-e)/(n||1)),0),i=Array(s);s--;)i[r?s:++o]=e,e+=n;return i}function I9(e){return function(t,n,r){return r&&typeof r!="number"&&m7(t,n,r)&&(n=r=void 0),t=vv(t),n===void 0?(n=t,t=0):n=vv(n),r=r===void 0?t<n?1:-1:vv(r),P9(t,n,r,e)}}var E9=I9();const $C=E9;function LC(e){return e&&e.length?g7(e):[]}function O9(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 I3=({id:e,x:t,y:n,width:r,height:o,style:s,color:i,strokeColor:c,strokeWidth:f,className:p,borderRadius:h,shapeRendering:m,onClick:v,selected:b})=>{const{background:y,backgroundColor:x}=s||{},C=i||y||x;return a.jsx("rect",{className:Yb(["react-flow__minimap-node",{selected:b},p]),x:t,y:n,rx:h,ry:h,width:r,height:o,fill:C,stroke:c,strokeWidth:f,shapeRendering:m,onClick:v?k=>v(k,e):void 0})};I3.displayName="MiniMapNode";var M9=u.memo(I3);const R9=e=>e.nodeOrigin,D9=e=>e.getNodes().filter(t=>!t.hidden&&t.width&&t.height),bv=e=>e instanceof Function?e:()=>e;function A9({nodeStrokeColor:e="transparent",nodeColor:t="#e2e2e2",nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:o=2,nodeComponent:s=M9,onClick:i}){const c=vh(D9,Jb),f=vh(R9),p=bv(t),h=bv(e),m=bv(n),v=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return a.jsx(a.Fragment,{children:c.map(b=>{const{x:y,y:x}=v7(b,f).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 N9=u.memo(A9);const T9=200,$9=150,L9=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?k7(j7(t,e.nodeOrigin),n):n,rfId:e.rfId}},F9="react-flow__minimap-desc";function E3({style:e,className:t,nodeStrokeColor:n="transparent",nodeColor:r="#e2e2e2",nodeClassName:o="",nodeBorderRadius:s=5,nodeStrokeWidth:i=2,nodeComponent:c,maskColor:f="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:C="React Flow mini map",inversePan:k=!1,zoomStep:j=10,offsetScale:_=5}){const I=b7(),O=u.useRef(null),{boundingRect:E,viewBB:M,rfId:R}=vh(L9,Jb),A=(e==null?void 0:e.width)??T9,D=(e==null?void 0:e.height)??$9,T=E.width/A,K=E.height/D,B=Math.max(T,K),G=B*A,Q=B*D,V=_*B,L=E.x-(G-E.width)/2-V,X=E.y-(Q-E.height)/2-V,F=G+V*2,q=Q+V*2,te=`${F9}-${R}`,Y=u.useRef(0);Y.current=B,u.useEffect(()=>{if(O.current){const U=x7(O.current),W=oe=>{const{transform:me,d3Selection:fe,d3Zoom:he}=I.getState();if(oe.sourceEvent.type!=="wheel"||!fe||!he)return;const Ce=-oe.sourceEvent.deltaY*(oe.sourceEvent.deltaMode===1?.05:oe.sourceEvent.deltaMode?1:.002)*j,xe=me[2]*Math.pow(2,Ce);he.scaleTo(fe,xe)},ne=oe=>{const{transform:me,d3Selection:fe,d3Zoom:he,translateExtent:Ce,width:xe,height:de}=I.getState();if(oe.sourceEvent.type!=="mousemove"||!fe||!he)return;const Ne=Y.current*Math.max(1,me[2])*(k?-1:1),De={x:me[0]-oe.sourceEvent.movementX*Ne,y:me[1]-oe.sourceEvent.movementY*Ne},Xe=[[0,0],[xe,de]],It=C7.translate(De.x,De.y).scale(me[2]),lt=he.constrain()(It,Xe,Ce);he.transform(fe,lt)},ie=y7().on("zoom",y?ne:null).on("zoom.wheel",x?W:null);return U.call(ie),()=>{U.on("zoom",null)}}},[y,x,k,j]);const ce=v?U=>{const W=S7(U);v(U,{x:W[0],y:W[1]})}:void 0,ae=b?(U,W)=>{const ne=I.getState().nodeInternals.get(W);b(U,ne)}:void 0;return a.jsx(w7,{position:m,style:e,className:Yb(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:a.jsxs("svg",{width:A,height:D,viewBox:`${L} ${X} ${F} ${q}`,role:"img","aria-labelledby":te,ref:O,onClick:ce,children:[C&&a.jsx("title",{id:te,children:C}),a.jsx(N9,{onClick:ae,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:o,nodeStrokeWidth:i,nodeComponent:c}),a.jsx("path",{className:"react-flow__minimap-mask",d:`M${L-V},${X-V}h${F+V*2}v${q+V*2}h${-F-V*2}z
M${M.x},${M.y}h${M.width}v${M.height}h${-M.width}z`,fill:f,fillRule:"evenodd",stroke:p,strokeWidth:h,pointerEvents:"none"})]})})}E3.displayName="MiniMap";var z9=u.memo(E3),Bs;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Bs||(Bs={}));function B9({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 H9({color:e,radius:t}){return a.jsx("circle",{cx:t,cy:t,r:t,fill:e})}const W9={[Bs.Dots]:"#91919a",[Bs.Lines]:"#eee",[Bs.Cross]:"#e2e2e2"},V9={[Bs.Dots]:1,[Bs.Lines]:1,[Bs.Cross]:6},U9=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function O3({id:e,variant:t=Bs.Dots,gap:n=20,size:r,lineWidth:o=1,offset:s=2,color:i,style:c,className:f}){const p=u.useRef(null),{transform:h,patternId:m}=vh(U9,Jb),v=i||W9[t],b=r||V9[t],y=t===Bs.Dots,x=t===Bs.Cross,C=Array.isArray(n)?n:[n,n],k=[C[0]*h[2]||1,C[1]*h[2]||1],j=b*h[2],_=x?[j,j]:k,I=y?[j/s,j/s]:[_[0]/s,_[1]/s];return a.jsxs("svg",{className:Yb(["react-flow__background",f]),style:{...c,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(H9,{color:v,radius:j/s}):a.jsx(B9,{dimensions:_,color:v,lineWidth:o})}),a.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${m+e})`})]})}O3.displayName="Background";var G9=u.memo(O3);function q9(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var K9=q9();const M3=1/60*1e3,X9=typeof performance<"u"?()=>performance.now():()=>Date.now(),R3=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(X9()),M3);function Q9(e){let t=[],n=[],r=0,o=!1,s=!1;const i=new WeakSet,c={schedule:(f,p=!1,h=!1)=>{const m=h&&o,v=m?t:n;return p&&i.add(f),v.indexOf(f)===-1&&(v.push(f),m&&o&&(r=t.length)),f},cancel:f=>{const p=n.indexOf(f);p!==-1&&n.splice(p,1),i.delete(f)},process:f=>{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(f),i.has(h)&&(c.schedule(h),e())}o=!1,s&&(s=!1,c.process(f))}};return c}const Y9=40;let M1=!0,Ld=!1,R1=!1;const Hc={delta:0,timestamp:0},df=["read","update","preRender","render","postRender"],qm=df.reduce((e,t)=>(e[t]=Q9(()=>Ld=!0),e),{}),J9=df.reduce((e,t)=>{const n=qm[t];return e[t]=(r,o=!1,s=!1)=>(Ld||tT(),n.schedule(r,o,s)),e},{}),Z9=df.reduce((e,t)=>(e[t]=qm[t].cancel,e),{});df.reduce((e,t)=>(e[t]=()=>qm[t].process(Hc),e),{});const eT=e=>qm[e].process(Hc),D3=e=>{Ld=!1,Hc.delta=M1?M3:Math.max(Math.min(e-Hc.timestamp,Y9),1),Hc.timestamp=e,R1=!0,df.forEach(eT),R1=!1,Ld&&(M1=!1,R3(D3))},tT=()=>{Ld=!0,M1=!0,R1||R3(D3)},FC=()=>Hc;function ff(e){const{viewBox:t="0 0 24 24",d:n,displayName:r,defaultProps:o={}}=e,s=u.Children.toArray(e.path),i=Te((c,f)=>a.jsx(Tr,{ref:f,viewBox:t,...o,...c,children:s.length?s:a.jsx("path",{fill:"currentColor",d:n})}));return i.displayName=r,i}function A3(e){const{theme:t}=_7(),n=s9();return u.useMemo(()=>a9(t.direction,{...n,...e}),[e,t.direction,n])}var nT=Object.defineProperty,rT=(e,t,n)=>t in e?nT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gr=(e,t,n)=>(rT(e,typeof t!="symbol"?t+"":t,n),n);function zC(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 oT=e=>typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE;function BC(e,t,n){let r=e+1;return n&&r>=t&&(r=0),r}function HC(e,t,n){let r=e-1;return n&&r<0&&(r=t),r}var D1=typeof window<"u"?u.useLayoutEffect:u.useEffect,_h=e=>e,sT=class{constructor(){gr(this,"descendants",new Map),gr(this,"register",e=>{if(e!=null)return oT(e)?this.registerNode(e):t=>{this.registerNode(t,e)}}),gr(this,"unregister",e=>{this.descendants.delete(e);const t=zC(Array.from(this.descendants.keys()));this.assignIndex(t)}),gr(this,"destroy",()=>{this.descendants.clear()}),gr(this,"assignIndex",e=>{this.descendants.forEach(t=>{const n=e.indexOf(t.node);t.index=n,t.node.dataset.index=t.index.toString()})}),gr(this,"count",()=>this.descendants.size),gr(this,"enabledCount",()=>this.enabledValues().length),gr(this,"values",()=>Array.from(this.descendants.values()).sort((t,n)=>t.index-n.index)),gr(this,"enabledValues",()=>this.values().filter(e=>!e.disabled)),gr(this,"item",e=>{if(this.count()!==0)return this.values()[e]}),gr(this,"enabledItem",e=>{if(this.enabledCount()!==0)return this.enabledValues()[e]}),gr(this,"first",()=>this.item(0)),gr(this,"firstEnabled",()=>this.enabledItem(0)),gr(this,"last",()=>this.item(this.descendants.size-1)),gr(this,"lastEnabled",()=>{const e=this.enabledValues().length-1;return this.enabledItem(e)}),gr(this,"indexOf",e=>{var t,n;return e&&(n=(t=this.descendants.get(e))==null?void 0:t.index)!=null?n:-1}),gr(this,"enabledIndexOf",e=>e==null?-1:this.enabledValues().findIndex(t=>t.node.isSameNode(e))),gr(this,"next",(e,t=!0)=>{const n=BC(e,this.count(),t);return this.item(n)}),gr(this,"nextEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),o=BC(r,this.enabledCount(),t);return this.enabledItem(o)}),gr(this,"prev",(e,t=!0)=>{const n=HC(e,this.count()-1,t);return this.item(n)}),gr(this,"prevEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),o=HC(r,this.enabledCount()-1,t);return this.enabledItem(o)}),gr(this,"registerNode",(e,t)=>{if(!e||this.descendants.has(e))return;const n=Array.from(this.descendants.keys()).concat(e),r=zC(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 aT(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 cn(...e){return t=>{e.forEach(n=>{aT(n,t)})}}function iT(...e){return u.useMemo(()=>cn(...e),e)}function lT(){const e=u.useRef(new sT);return D1(()=>()=>e.current.destroy()),e.current}var[cT,N3]=Dn({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});function uT(e){const t=N3(),[n,r]=u.useState(-1),o=u.useRef(null);D1(()=>()=>{o.current&&t.unregister(o.current)},[]),D1(()=>{if(!o.current)return;const i=Number(o.current.dataset.index);n!=i&&!Number.isNaN(i)&&r(i)});const s=_h(e?t.register(e):t.register);return{descendants:t,index:n,enabledIndex:t.enabledIndexOf(o.current),register:cn(s,o)}}function vx(){return[_h(cT),()=>_h(N3()),()=>lT(),o=>uT(o)]}var[dT,Km]=Dn({name:"AccordionStylesContext",hookName:"useAccordionStyles",providerName:"<Accordion />"}),[fT,bx]=Dn({name:"AccordionItemContext",hookName:"useAccordionItemContext",providerName:"<AccordionItem />"}),[pT,u0e,hT,mT]=vx(),kc=Te(function(t,n){const{getButtonProps:r}=bx(),o=r(t,n),i={display:"flex",alignItems:"center",width:"100%",outline:0,...Km().button};return a.jsx(Me.button,{...o,className:_t("chakra-accordion__button",t.className),__css:i})});kc.displayName="AccordionButton";function ku(e){const{value:t,defaultValue:n,onChange:r,shouldUpdate:o=(v,b)=>v!==b}=e,s=sr(r),i=sr(o),[c,f]=u.useState(n),p=t!==void 0,h=p?t:c,m=sr(v=>{const y=typeof v=="function"?v(h):v;i(h,y)&&(p||f(y),s(y))},[p,s,h,i]);return[h,m]}function gT(e){const{onChange:t,defaultIndex:n,index:r,allowMultiple:o,allowToggle:s,...i}=e;xT(e),yT(e);const c=hT(),[f,p]=u.useState(-1);u.useEffect(()=>()=>{p(-1)},[]);const[h,m]=ku({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:C=>{if(b!==null)if(o&&Array.isArray(h)){const k=C?h.concat(b):h.filter(j=>j!==b);m(k)}else C?m(b):s&&m(-1)}}},focusedIndex:f,setFocusedIndex:p,descendants:c}}var[vT,xx]=Dn({name:"AccordionContext",hookName:"useAccordionContext",providerName:"Accordion"});function bT(e){const{isDisabled:t,isFocusable:n,id:r,...o}=e,{getAccordionItemProps:s,setFocusedIndex:i}=xx(),c=u.useRef(null),f=u.useId(),p=r??f,h=`accordion-button-${p}`,m=`accordion-panel-${p}`;wT(e);const{register:v,index:b,descendants:y}=mT({disabled:t&&!n}),{isOpen:x,onChange:C}=s(b===-1?null:b);CT({isOpen:x,isDisabled:t});const k=()=>{C==null||C(!0)},j=()=>{C==null||C(!1)},_=u.useCallback(()=>{C==null||C(!x),i(b)},[b,i,x,C]),I=u.useCallback(R=>{const D={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];D&&(R.preventDefault(),D(R))},[y,b]),O=u.useCallback(()=>{i(b)},[i,b]),E=u.useCallback(function(A={},D=null){return{...A,type:"button",ref:cn(v,c,D),id:h,disabled:!!t,"aria-expanded":!!x,"aria-controls":m,onClick:rt(A.onClick,_),onFocus:rt(A.onFocus,O),onKeyDown:rt(A.onKeyDown,I)}},[h,t,x,_,O,I,m,v]),M=u.useCallback(function(A={},D=null){return{...A,ref:D,role:"region",id:m,"aria-labelledby":h,hidden:!x}},[h,x,m]);return{isOpen:x,isDisabled:t,isFocusable:n,onOpen:k,onClose:j,getButtonProps:E,getPanelProps:M,htmlProps:o}}function xT(e){const t=e.index||e.defaultIndex,n=t!=null&&!Array.isArray(t)&&e.allowMultiple;of({condition:!!n,message:`If 'allowMultiple' is passed, then 'index' or 'defaultIndex' must be an array. You passed: ${typeof t},`})}function yT(e){of({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 wT(e){of({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 CT(e){of({condition:e.isOpen&&!!e.isDisabled,message:"Cannot open a disabled accordion item"})}function jc(e){const{isOpen:t,isDisabled:n}=bx(),{reduceMotion:r}=xx(),o=_t("chakra-accordion__icon",e.className),s=Km(),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(Tr,{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"})})}jc.displayName="AccordionIcon";var _c=Te(function(t,n){const{children:r,className:o}=t,{htmlProps:s,...i}=bT(t),f={...Km().container,overflowAnchor:"none"},p=u.useMemo(()=>i,[i]);return a.jsx(fT,{value:p,children:a.jsx(Me.div,{ref:n,...s,className:_t("chakra-accordion__item",o),__css:f,children:typeof r=="function"?r({isExpanded:!!i.isOpen,isDisabled:!!i.isDisabled}):r})})});_c.displayName="AccordionItem";var Ac={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},yl={enter:{duration:.2,ease:Ac.easeOut},exit:{duration:.1,ease:Ac.easeIn}},Ja={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})},ST=e=>e!=null&&parseInt(e.toString(),10)>0,WC={exit:{height:{duration:.2,ease:Ac.ease},opacity:{duration:.3,ease:Ac.ease}},enter:{height:{duration:.3,ease:Ac.ease},opacity:{duration:.4,ease:Ac.ease}}},kT={exit:({animateOpacity:e,startingHeight:t,transition:n,transitionEnd:r,delay:o})=>{var s;return{...e&&{opacity:ST(t)?1:0},height:t,transitionEnd:r==null?void 0:r.exit,transition:(s=n==null?void 0:n.exit)!=null?s:Ja.exit(WC.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:Ja.enter(WC.enter,o)}}},Xm=u.forwardRef((e,t)=>{const{in:n,unmountOnExit:r,animateOpacity:o=!0,startingHeight:s=0,endingHeight:i="auto",style:c,className:f,transition:p,transitionEnd:h,...m}=e,[v,b]=u.useState(!1);u.useEffect(()=>{const j=setTimeout(()=>{b(!0)});return()=>clearTimeout(j)},[]),of({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"}}},C=r?n:!0,k=n||r?"enter":"exit";return a.jsx(co,{initial:!1,custom:x,children:C&&a.jsx(yr.div,{ref:t,...m,className:_t("chakra-collapse",f),style:{overflow:"hidden",display:"block",...c},custom:x,variants:kT,initial:r?"exit":!1,animate:k,exit:"exit"})})});Xm.displayName="Collapse";var jT={enter:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:1,transition:(r=e==null?void 0:e.enter)!=null?r:Ja.enter(yl.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:Ja.exit(yl.exit,n),transitionEnd:t==null?void 0:t.exit}}},T3={initial:"exit",animate:"enter",exit:"exit",variants:jT},_T=u.forwardRef(function(t,n){const{unmountOnExit:r,in:o,className:s,transition:i,transitionEnd:c,delay:f,...p}=t,h=o||r?"enter":"exit",m=r?o&&r:!0,v={transition:i,transitionEnd:c,delay:f};return a.jsx(co,{custom:v,children:m&&a.jsx(yr.div,{ref:n,className:_t("chakra-fade",s),custom:v,...T3,animate:h,...p})})});_T.displayName="Fade";var PT={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:Ja.exit(yl.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:Ja.enter(yl.enter,n),transitionEnd:e==null?void 0:e.enter}}},$3={initial:"exit",animate:"enter",exit:"exit",variants:PT},IT=u.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:s=!0,initialScale:i=.95,className:c,transition:f,transitionEnd:p,delay:h,...m}=t,v=r?o&&r:!0,b=o||r?"enter":"exit",y={initialScale:i,reverse:s,transition:f,transitionEnd:p,delay:h};return a.jsx(co,{custom:y,children:v&&a.jsx(yr.div,{ref:n,className:_t("chakra-offset-slide",c),...$3,animate:b,custom:y,...m})})});IT.displayName="ScaleFade";var ET={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:Ja.exit(yl.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:Ja.enter(yl.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 c={x:t,y:e};return{opacity:0,transition:(i=n==null?void 0:n.exit)!=null?i:Ja.exit(yl.exit,s),...o?{...c,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{...c,...r==null?void 0:r.exit}}}}},A1={initial:"initial",animate:"enter",exit:"exit",variants:ET},OT=u.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:s=!0,className:i,offsetX:c=0,offsetY:f=8,transition:p,transitionEnd:h,delay:m,...v}=t,b=r?o&&r:!0,y=o||r?"enter":"exit",x={offsetX:c,offsetY:f,reverse:s,transition:p,transitionEnd:h,delay:m};return a.jsx(co,{custom:x,children:b&&a.jsx(yr.div,{ref:n,className:_t("chakra-offset-slide",i),custom:x,...A1,animate:y,...v})})});OT.displayName="SlideFade";var Pc=Te(function(t,n){const{className:r,motionProps:o,...s}=t,{reduceMotion:i}=xx(),{getPanelProps:c,isOpen:f}=bx(),p=c(s,n),h=_t("chakra-accordion__panel",r),m=Km();i||delete p.hidden;const v=a.jsx(Me.div,{...p,__css:m.panel,className:h});return i?v:a.jsx(Xm,{in:f,...o,children:v})});Pc.displayName="AccordionPanel";var L3=Te(function({children:t,reduceMotion:n,...r},o){const s=Vr("Accordion",r),i=Jn(r),{htmlProps:c,descendants:f,...p}=gT(i),h=u.useMemo(()=>({...p,reduceMotion:!!n}),[p,n]);return a.jsx(pT,{value:f,children:a.jsx(vT,{value:h,children:a.jsx(dT,{value:s,children:a.jsx(Me.div,{ref:o,...c,className:_t("chakra-accordion",r.className),__css:s.root,children:t})})})})});L3.displayName="Accordion";function pf(e){return u.Children.toArray(e).filter(t=>u.isValidElement(t))}var[MT,RT]=Dn({strict:!1,name:"ButtonGroupContext"}),DT={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}}},AT={horizontal:e=>({"& > *:not(style) ~ *:not(style)":{marginStart:e}}),vertical:e=>({"& > *:not(style) ~ *:not(style)":{marginTop:e}})},vr=Te(function(t,n){const{size:r,colorScheme:o,variant:s,className:i,spacing:c="0.5rem",isAttached:f,isDisabled:p,orientation:h="horizontal",...m}=t,v=_t("chakra-button__group",i),b=u.useMemo(()=>({size:r,colorScheme:o,variant:s,isDisabled:p}),[r,o,s,p]);let y={display:"inline-flex",...f?DT[h]:AT[h](c)};const x=h==="vertical";return a.jsx(MT,{value:b,children:a.jsx(Me.div,{ref:n,role:"group",__css:y,className:v,"data-attached":f?"":void 0,"data-orientation":h,flexDir:x?"column":void 0,...m})})});vr.displayName="ButtonGroup";function NT(e){const[t,n]=u.useState(!e);return{ref:u.useCallback(s=>{s&&n(s.tagName==="BUTTON")},[]),type:t?"button":void 0}}function N1(e){const{children:t,className:n,...r}=e,o=u.isValidElement(t)?u.cloneElement(t,{"aria-hidden":!0,focusable:!1}):t,s=_t("chakra-button__icon",n);return a.jsx(Me.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...r,className:s,children:o})}N1.displayName="ButtonIcon";function Ph(e){const{label:t,placement:n,spacing:r="0.5rem",children:o=a.jsx(Wl,{color:"currentColor",width:"1em",height:"1em"}),className:s,__css:i,...c}=e,f=_t("chakra-button__spinner",s),p=n==="start"?"marginEnd":"marginStart",h=u.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(Me.div,{className:f,...c,__css:h,children:o})}Ph.displayName="ButtonSpinner";var iu=Te((e,t)=>{const n=RT(),r=Xi("Button",{...n,...e}),{isDisabled:o=n==null?void 0:n.isDisabled,isLoading:s,isActive:i,children:c,leftIcon:f,rightIcon:p,loadingText:h,iconSpacing:m="0.5rem",type:v,spinner:b,spinnerPlacement:y="start",className:x,as:C,...k}=Jn(e),j=u.useMemo(()=>{const E={...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:E}}},[r,n]),{ref:_,type:I}=NT(C),O={rightIcon:p,leftIcon:f,iconSpacing:m,children:c};return a.jsxs(Me.button,{ref:iT(t,_),as:C,type:v??I,"data-active":Ht(i),"data-loading":Ht(s),__css:j,className:_t("chakra-button",x),...k,disabled:o||s,children:[s&&y==="start"&&a.jsx(Ph,{className:"chakra-button__spinner--start",label:h,placement:"start",spacing:m,children:b}),s?h||a.jsx(Me.span,{opacity:0,children:a.jsx(VC,{...O})}):a.jsx(VC,{...O}),s&&y==="end"&&a.jsx(Ph,{className:"chakra-button__spinner--end",label:h,placement:"end",spacing:m,children:b})]})});iu.displayName="Button";function VC(e){const{leftIcon:t,rightIcon:n,children:r,iconSpacing:o}=e;return a.jsxs(a.Fragment,{children:[t&&a.jsx(N1,{marginEnd:o,children:t}),r,n&&a.jsx(N1,{marginStart:o,children:n})]})}var wa=Te((e,t)=>{const{icon:n,children:r,isRound:o,"aria-label":s,...i}=e,c=n||r,f=u.isValidElement(c)?u.cloneElement(c,{"aria-hidden":!0,focusable:!1}):null;return a.jsx(iu,{padding:"0",borderRadius:o?"full":void 0,ref:t,"aria-label":s,...i,children:f})});wa.displayName="IconButton";var[d0e,TT]=Dn({name:"CheckboxGroupContext",strict:!1});function $T(e){const[t,n]=u.useState(e),[r,o]=u.useState(!1);return e!==t&&(o(!0),n(e)),r}function LT(e){return a.jsx(Me.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 FT(e){return a.jsx(Me.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 zT(e){const{isIndeterminate:t,isChecked:n,...r}=e,o=t?FT:LT;return n||t?a.jsx(Me.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:a.jsx(o,{...r})}):null}var[BT,F3]=Dn({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "<FormControl />" `}),[HT,hf]=Dn({strict:!1,name:"FormControlContext"});function WT(e){const{id:t,isRequired:n,isInvalid:r,isDisabled:o,isReadOnly:s,...i}=e,c=u.useId(),f=t||`field-${c}`,p=`${f}-label`,h=`${f}-feedback`,m=`${f}-helptext`,[v,b]=u.useState(!1),[y,x]=u.useState(!1),[C,k]=u.useState(!1),j=u.useCallback((M={},R=null)=>({id:m,...M,ref:cn(R,A=>{A&&x(!0)})}),[m]),_=u.useCallback((M={},R=null)=>({...M,ref:R,"data-focus":Ht(C),"data-disabled":Ht(o),"data-invalid":Ht(r),"data-readonly":Ht(s),id:M.id!==void 0?M.id:p,htmlFor:M.htmlFor!==void 0?M.htmlFor:f}),[f,o,C,r,s,p]),I=u.useCallback((M={},R=null)=>({id:h,...M,ref:cn(R,A=>{A&&b(!0)}),"aria-live":"polite"}),[h]),O=u.useCallback((M={},R=null)=>({...M,...i,ref:R,role:"group"}),[i]),E=u.useCallback((M={},R=null)=>({...M,ref:R,role:"presentation","aria-hidden":!0,children:M.children||"*"}),[]);return{isRequired:!!n,isInvalid:!!r,isReadOnly:!!s,isDisabled:!!o,isFocused:!!C,onFocus:()=>k(!0),onBlur:()=>k(!1),hasFeedbackText:v,setHasFeedbackText:b,hasHelpText:y,setHasHelpText:x,id:f,labelId:p,feedbackId:h,helpTextId:m,htmlProps:i,getHelpTextProps:j,getErrorMessageProps:I,getRootProps:O,getLabelProps:_,getRequiredIndicatorProps:E}}var pr=Te(function(t,n){const r=Vr("Form",t),o=Jn(t),{getRootProps:s,htmlProps:i,...c}=WT(o),f=_t("chakra-form-control",t.className);return a.jsx(HT,{value:c,children:a.jsx(BT,{value:r,children:a.jsx(Me.div,{...s({},n),className:f,__css:r.container})})})});pr.displayName="FormControl";var z3=Te(function(t,n){const r=hf(),o=F3(),s=_t("chakra-form__helper-text",t.className);return a.jsx(Me.div,{...r==null?void 0:r.getHelpTextProps(t,n),__css:o.helperText,className:s})});z3.displayName="FormHelperText";var Jr=Te(function(t,n){var r;const o=Xi("FormLabel",t),s=Jn(t),{className:i,children:c,requiredIndicator:f=a.jsx(B3,{}),optionalIndicator:p=null,...h}=s,m=hf(),v=(r=m==null?void 0:m.getLabelProps(h,n))!=null?r:{ref:n,...h};return a.jsxs(Me.label,{...v,className:_t("chakra-form__label",s.className),__css:{display:"block",textAlign:"start",...o},children:[c,m!=null&&m.isRequired?f:p]})});Jr.displayName="FormLabel";var B3=Te(function(t,n){const r=hf(),o=F3();if(!(r!=null&&r.isRequired))return null;const s=_t("chakra-form__required-indicator",t.className);return a.jsx(Me.span,{...r==null?void 0:r.getRequiredIndicatorProps(t,n),__css:o.requiredIndicator,className:s})});B3.displayName="RequiredIndicator";function yx(e){const{isDisabled:t,isInvalid:n,isReadOnly:r,isRequired:o,...s}=wx(e);return{...s,disabled:t,readOnly:r,required:o,"aria-invalid":gs(n),"aria-required":gs(o),"aria-readonly":gs(r)}}function wx(e){var t,n,r;const o=hf(),{id:s,disabled:i,readOnly:c,required:f,isRequired:p,isInvalid:h,isReadOnly:m,isDisabled:v,onFocus:b,onBlur:y,...x}=e,C=e["aria-describedby"]?[e["aria-describedby"]]:[];return o!=null&&o.hasFeedbackText&&(o!=null&&o.isInvalid)&&C.push(o.feedbackId),o!=null&&o.hasHelpText&&C.push(o.helpTextId),{...x,"aria-describedby":C.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=c??m)!=null?n:o==null?void 0:o.isReadOnly,isRequired:(r=f??p)!=null?r:o==null?void 0:o.isRequired,isInvalid:h??(o==null?void 0:o.isInvalid),onFocus:rt(o==null?void 0:o.onFocus,b),onBlur:rt(o==null?void 0:o.onBlur,y)}}var Cx={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},H3=Me("span",{baseStyle:Cx});H3.displayName="VisuallyHidden";var VT=Me("input",{baseStyle:Cx});VT.displayName="VisuallyHiddenInput";const UT=()=>typeof document<"u";let UC=!1,mf=null,Dl=!1,T1=!1;const $1=new Set;function Sx(e,t){$1.forEach(n=>n(e,t))}const GT=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function qT(e){return!(e.metaKey||!GT&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function GC(e){Dl=!0,qT(e)&&(mf="keyboard",Sx("keyboard",e))}function hc(e){if(mf="pointer",e.type==="mousedown"||e.type==="pointerdown"){Dl=!0;const t=e.composedPath?e.composedPath()[0]:e.target;let n=!1;try{n=t.matches(":focus-visible")}catch{}if(n)return;Sx("pointer",e)}}function KT(e){return e.mozInputSource===0&&e.isTrusted?!0:e.detail===0&&!e.pointerType}function XT(e){KT(e)&&(Dl=!0,mf="virtual")}function QT(e){e.target===window||e.target===document||(!Dl&&!T1&&(mf="virtual",Sx("virtual",e)),Dl=!1,T1=!1)}function YT(){Dl=!1,T1=!0}function qC(){return mf!=="pointer"}function JT(){if(!UT()||UC)return;const{focus:e}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...n){Dl=!0,e.apply(this,n)},document.addEventListener("keydown",GC,!0),document.addEventListener("keyup",GC,!0),document.addEventListener("click",XT,!0),window.addEventListener("focus",QT,!0),window.addEventListener("blur",YT,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",hc,!0),document.addEventListener("pointermove",hc,!0),document.addEventListener("pointerup",hc,!0)):(document.addEventListener("mousedown",hc,!0),document.addEventListener("mousemove",hc,!0),document.addEventListener("mouseup",hc,!0)),UC=!0}function W3(e){JT(),e(qC());const t=()=>e(qC());return $1.add(t),()=>{$1.delete(t)}}function ZT(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function V3(e={}){const t=wx(e),{isDisabled:n,isReadOnly:r,isRequired:o,isInvalid:s,id:i,onBlur:c,onFocus:f,"aria-describedby":p}=t,{defaultChecked:h,isChecked:m,isFocusable:v,onChange:b,isIndeterminate:y,name:x,value:C,tabIndex:k=void 0,"aria-label":j,"aria-labelledby":_,"aria-invalid":I,...O}=e,E=ZT(O,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),M=sr(b),R=sr(c),A=sr(f),[D,T]=u.useState(!1),[K,B]=u.useState(!1),[G,Q]=u.useState(!1),[V,L]=u.useState(!1);u.useEffect(()=>W3(T),[]);const X=u.useRef(null),[F,q]=u.useState(!0),[te,Y]=u.useState(!!h),ce=m!==void 0,ae=ce?m:te,U=u.useCallback(de=>{if(r||n){de.preventDefault();return}ce||Y(ae?de.target.checked:y?!0:de.target.checked),M==null||M(de)},[r,n,ae,ce,y,M]);zc(()=>{X.current&&(X.current.indeterminate=!!y)},[y]),fi(()=>{n&&B(!1)},[n,B]),zc(()=>{const de=X.current;if(!(de!=null&&de.form))return;const Ne=()=>{Y(!!h)};return de.form.addEventListener("reset",Ne),()=>{var De;return(De=de.form)==null?void 0:De.removeEventListener("reset",Ne)}},[]);const W=n&&!v,ne=u.useCallback(de=>{de.key===" "&&L(!0)},[L]),ie=u.useCallback(de=>{de.key===" "&&L(!1)},[L]);zc(()=>{if(!X.current)return;X.current.checked!==ae&&Y(X.current.checked)},[X.current]);const oe=u.useCallback((de={},Ne=null)=>{const De=Xe=>{K&&Xe.preventDefault(),L(!0)};return{...de,ref:Ne,"data-active":Ht(V),"data-hover":Ht(G),"data-checked":Ht(ae),"data-focus":Ht(K),"data-focus-visible":Ht(K&&D),"data-indeterminate":Ht(y),"data-disabled":Ht(n),"data-invalid":Ht(s),"data-readonly":Ht(r),"aria-hidden":!0,onMouseDown:rt(de.onMouseDown,De),onMouseUp:rt(de.onMouseUp,()=>L(!1)),onMouseEnter:rt(de.onMouseEnter,()=>Q(!0)),onMouseLeave:rt(de.onMouseLeave,()=>Q(!1))}},[V,ae,n,K,D,G,y,s,r]),me=u.useCallback((de={},Ne=null)=>({...de,ref:Ne,"data-active":Ht(V),"data-hover":Ht(G),"data-checked":Ht(ae),"data-focus":Ht(K),"data-focus-visible":Ht(K&&D),"data-indeterminate":Ht(y),"data-disabled":Ht(n),"data-invalid":Ht(s),"data-readonly":Ht(r)}),[V,ae,n,K,D,G,y,s,r]),fe=u.useCallback((de={},Ne=null)=>({...E,...de,ref:cn(Ne,De=>{De&&q(De.tagName==="LABEL")}),onClick:rt(de.onClick,()=>{var De;F||((De=X.current)==null||De.click(),requestAnimationFrame(()=>{var Xe;(Xe=X.current)==null||Xe.focus({preventScroll:!0})}))}),"data-disabled":Ht(n),"data-checked":Ht(ae),"data-invalid":Ht(s)}),[E,n,ae,s,F]),he=u.useCallback((de={},Ne=null)=>({...de,ref:cn(X,Ne),type:"checkbox",name:x,value:C,id:i,tabIndex:k,onChange:rt(de.onChange,U),onBlur:rt(de.onBlur,R,()=>B(!1)),onFocus:rt(de.onFocus,A,()=>B(!0)),onKeyDown:rt(de.onKeyDown,ne),onKeyUp:rt(de.onKeyUp,ie),required:o,checked:ae,disabled:W,readOnly:r,"aria-label":j,"aria-labelledby":_,"aria-invalid":I?!!I:s,"aria-describedby":p,"aria-disabled":n,style:Cx}),[x,C,i,U,R,A,ne,ie,o,ae,W,r,j,_,I,s,p,n,k]),Ce=u.useCallback((de={},Ne=null)=>({...de,ref:Ne,onMouseDown:rt(de.onMouseDown,e$),"data-disabled":Ht(n),"data-checked":Ht(ae),"data-invalid":Ht(s)}),[ae,n,s]);return{state:{isInvalid:s,isFocused:K,isChecked:ae,isActive:V,isHovered:G,isIndeterminate:y,isDisabled:n,isReadOnly:r,isRequired:o},getRootProps:fe,getCheckboxProps:oe,getIndicatorProps:me,getInputProps:he,getLabelProps:Ce,htmlProps:E}}function e$(e){e.preventDefault(),e.stopPropagation()}var t$={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},n$={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},r$=ui({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),o$=ui({from:{opacity:0},to:{opacity:1}}),s$=ui({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),Qm=Te(function(t,n){const r=TT(),o={...r,...t},s=Vr("Checkbox",o),i=Jn(t),{spacing:c="0.5rem",className:f,children:p,iconColor:h,iconSize:m,icon:v=a.jsx(zT,{}),isChecked:b,isDisabled:y=r==null?void 0:r.isDisabled,onChange:x,inputProps:C,...k}=i;let j=b;r!=null&&r.value&&i.value&&(j=r.value.includes(i.value));let _=x;r!=null&&r.onChange&&i.value&&(_=Lm(r.onChange,x));const{state:I,getInputProps:O,getCheckboxProps:E,getLabelProps:M,getRootProps:R}=V3({...k,isDisabled:y,isChecked:j,onChange:_}),A=$T(I.isChecked),D=u.useMemo(()=>({animation:A?I.isIndeterminate?`${o$} 20ms linear, ${s$} 200ms linear`:`${r$} 200ms linear`:void 0,fontSize:m,color:h,...s.icon}),[h,m,A,I.isIndeterminate,s.icon]),T=u.cloneElement(v,{__css:D,isIndeterminate:I.isIndeterminate,isChecked:I.isChecked});return a.jsxs(Me.label,{__css:{...n$,...s.container},className:_t("chakra-checkbox",f),...R(),children:[a.jsx("input",{className:"chakra-checkbox__input",...O(C,n)}),a.jsx(Me.span,{__css:{...t$,...s.control},className:"chakra-checkbox__control",...E(),children:T}),p&&a.jsx(Me.span,{className:"chakra-checkbox__label",...M(),__css:{marginStart:c,...s.label},children:p})]})});Qm.displayName="Checkbox";function a$(e){const t=parseFloat(e);return typeof t!="number"||Number.isNaN(t)?0:t}function kx(e,t){let n=a$(e);const r=10**(t??10);return n=Math.round(n*r)/r,t?n.toFixed(t):n.toString()}function L1(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 Ih(e,t,n){return(e-t)*100/(n-t)}function U3(e,t,n){return(n-t)*e+t}function F1(e,t,n){const r=Math.round((e-t)/n)*n+t,o=L1(n);return kx(r,o)}function Wc(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 i$(e={}){const{onChange:t,precision:n,defaultValue:r,value:o,step:s=1,min:i=Number.MIN_SAFE_INTEGER,max:c=Number.MAX_SAFE_INTEGER,keepWithinRange:f=!0}=e,p=sr(t),[h,m]=u.useState(()=>{var D;return r==null?"":(D=xv(r,s,n))!=null?D:""}),v=typeof o<"u",b=v?o:h,y=G3(Ei(b),s),x=n??y,C=u.useCallback(D=>{D!==b&&(v||m(D.toString()),p==null||p(D.toString(),Ei(D)))},[p,v,b]),k=u.useCallback(D=>{let T=D;return f&&(T=Wc(T,i,c)),kx(T,x)},[x,f,c,i]),j=u.useCallback((D=s)=>{let T;b===""?T=Ei(D):T=Ei(b)+D,T=k(T),C(T)},[k,s,C,b]),_=u.useCallback((D=s)=>{let T;b===""?T=Ei(-D):T=Ei(b)-D,T=k(T),C(T)},[k,s,C,b]),I=u.useCallback(()=>{var D;let T;r==null?T="":T=(D=xv(r,s,n))!=null?D:i,C(T)},[r,n,s,C,i]),O=u.useCallback(D=>{var T;const K=(T=xv(D,s,x))!=null?T:i;C(K)},[x,s,C,i]),E=Ei(b);return{isOutOfRange:E>c||E<i,isAtMax:E===c,isAtMin:E===i,precision:x,value:b,valueAsNumber:E,update:C,reset:I,increment:j,decrement:_,clamp:k,cast:O,setValue:m}}function Ei(e){return parseFloat(e.toString().replace(/[^\w.-]+/g,""))}function G3(e,t){return Math.max(L1(t),L1(e))}function xv(e,t,n){const r=Ei(e);if(Number.isNaN(r))return;const o=G3(r,t);return kx(r,n??o)}var[l$,q3]=Dn({name:"EditableStylesContext",errorMessage:`useEditableStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Editable />" `}),[c$,jx]=Dn({name:"EditableContext",errorMessage:"useEditableContext: context is undefined. Seems you forgot to wrap the editable components in `<Editable />`"}),K3={fontSize:"inherit",fontWeight:"inherit",textAlign:"inherit",bg:"transparent"},Ym=Te(function(t,n){const{getInputProps:r}=jx(),o=q3(),s=r(t,n),i=_t("chakra-editable__input",t.className);return a.jsx(Me.input,{...s,__css:{outline:0,...K3,...o.input},className:i})});Ym.displayName="EditableInput";var Jm=Te(function(t,n){const{getPreviewProps:r}=jx(),o=q3(),s=r(t,n),i=_t("chakra-editable__preview",t.className);return a.jsx(Me.span,{...s,__css:{cursor:"text",display:"inline-block",...K3,...o.preview},className:i})});Jm.displayName="EditablePreview";function wl(e,t,n,r){const o=sr(n);return u.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 u$(e){return"current"in e}var X3=()=>typeof window<"u";function d$(){var e;const t=navigator.userAgentData;return(e=t==null?void 0:t.platform)!=null?e:navigator.platform}var f$=e=>X3()&&e.test(navigator.vendor),p$=e=>X3()&&e.test(d$()),h$=()=>p$(/mac|iphone|ipad|ipod/i),m$=()=>h$()&&f$(/apple/i);function Q3(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};wl(o,"pointerdown",s=>{if(!m$()||!r)return;const i=s.target,f=(n??[t]).some(p=>{const h=u$(p)?p.current:p;return(h==null?void 0:h.contains(i))||h===i});o().activeElement!==i&&f&&(s.preventDefault(),i.focus())})}function KC(e,t){return e?e===t||e.contains(t):!1}function g$(e={}){const{onChange:t,onCancel:n,onSubmit:r,onBlur:o,value:s,isDisabled:i,defaultValue:c,startWithEditView:f,isPreviewFocusable:p=!0,submitOnBlur:h=!0,selectAllOnFocus:m=!0,placeholder:v,onEdit:b,finalFocusRef:y,...x}=e,C=sr(b),k=!!(f&&!i),[j,_]=u.useState(k),[I,O]=ku({defaultValue:c||"",value:s,onChange:t}),[E,M]=u.useState(I),R=u.useRef(null),A=u.useRef(null),D=u.useRef(null),T=u.useRef(null),K=u.useRef(null);Q3({ref:R,enabled:j,elements:[T,K]});const B=!j&&!i;zc(()=>{var oe,me;j&&((oe=R.current)==null||oe.focus(),m&&((me=R.current)==null||me.select()))},[]),fi(()=>{var oe,me,fe,he;if(!j){y?(oe=y.current)==null||oe.focus():(me=D.current)==null||me.focus();return}(fe=R.current)==null||fe.focus(),m&&((he=R.current)==null||he.select()),C==null||C()},[j,C,m]);const G=u.useCallback(()=>{B&&_(!0)},[B]),Q=u.useCallback(()=>{M(I)},[I]),V=u.useCallback(()=>{_(!1),O(E),n==null||n(E),o==null||o(E)},[n,o,O,E]),L=u.useCallback(()=>{_(!1),M(I),r==null||r(I),o==null||o(E)},[I,r,o,E]);u.useEffect(()=>{if(j)return;const oe=R.current;(oe==null?void 0:oe.ownerDocument.activeElement)===oe&&(oe==null||oe.blur())},[j]);const X=u.useCallback(oe=>{O(oe.currentTarget.value)},[O]),F=u.useCallback(oe=>{const me=oe.key,he={Escape:V,Enter:Ce=>{!Ce.shiftKey&&!Ce.metaKey&&L()}}[me];he&&(oe.preventDefault(),he(oe))},[V,L]),q=u.useCallback(oe=>{const me=oe.key,he={Escape:V}[me];he&&(oe.preventDefault(),he(oe))},[V]),te=I.length===0,Y=u.useCallback(oe=>{var me;if(!j)return;const fe=oe.currentTarget.ownerDocument,he=(me=oe.relatedTarget)!=null?me:fe.activeElement,Ce=KC(T.current,he),xe=KC(K.current,he);!Ce&&!xe&&(h?L():V())},[h,L,V,j]),ce=u.useCallback((oe={},me=null)=>{const fe=B&&p?0:void 0;return{...oe,ref:cn(me,A),children:te?v:I,hidden:j,"aria-disabled":gs(i),tabIndex:fe,onFocus:rt(oe.onFocus,G,Q)}},[i,j,B,p,te,G,Q,v,I]),ae=u.useCallback((oe={},me=null)=>({...oe,hidden:!j,placeholder:v,ref:cn(me,R),disabled:i,"aria-disabled":gs(i),value:I,onBlur:rt(oe.onBlur,Y),onChange:rt(oe.onChange,X),onKeyDown:rt(oe.onKeyDown,F),onFocus:rt(oe.onFocus,Q)}),[i,j,Y,X,F,Q,v,I]),U=u.useCallback((oe={},me=null)=>({...oe,hidden:!j,placeholder:v,ref:cn(me,R),disabled:i,"aria-disabled":gs(i),value:I,onBlur:rt(oe.onBlur,Y),onChange:rt(oe.onChange,X),onKeyDown:rt(oe.onKeyDown,q),onFocus:rt(oe.onFocus,Q)}),[i,j,Y,X,q,Q,v,I]),W=u.useCallback((oe={},me=null)=>({"aria-label":"Edit",...oe,type:"button",onClick:rt(oe.onClick,G),ref:cn(me,D),disabled:i}),[G,i]),ne=u.useCallback((oe={},me=null)=>({...oe,"aria-label":"Submit",ref:cn(K,me),type:"button",onClick:rt(oe.onClick,L),disabled:i}),[L,i]),ie=u.useCallback((oe={},me=null)=>({"aria-label":"Cancel",id:"cancel",...oe,ref:cn(T,me),type:"button",onClick:rt(oe.onClick,V),disabled:i}),[V,i]);return{isEditing:j,isDisabled:i,isValueEmpty:te,value:I,onEdit:G,onCancel:V,onSubmit:L,getPreviewProps:ce,getInputProps:ae,getTextareaProps:U,getEditButtonProps:W,getSubmitButtonProps:ne,getCancelButtonProps:ie,htmlProps:x}}var Zm=Te(function(t,n){const r=Vr("Editable",t),o=Jn(t),{htmlProps:s,...i}=g$(o),{isEditing:c,onSubmit:f,onCancel:p,onEdit:h}=i,m=_t("chakra-editable",t.className),v=Zb(t.children,{isEditing:c,onSubmit:f,onCancel:p,onEdit:h});return a.jsx(c$,{value:i,children:a.jsx(l$,{value:r,children:a.jsx(Me.div,{ref:n,...s,className:m,children:v})})})});Zm.displayName="Editable";function Y3(){const{isEditing:e,getEditButtonProps:t,getCancelButtonProps:n,getSubmitButtonProps:r}=jx();return{isEditing:e,getEditButtonProps:t,getCancelButtonProps:n,getSubmitButtonProps:r}}var J3={exports:{}},v$="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",b$=v$,x$=b$;function Z3(){}function e5(){}e5.resetWarningCache=Z3;var y$=function(){function e(r,o,s,i,c,f){if(f!==x$){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:e5,resetWarningCache:Z3};return n.PropTypes=n,n};J3.exports=y$();var w$=J3.exports;const zn=Cu(w$);var z1="data-focus-lock",t5="data-focus-lock-disabled",C$="data-no-focus-lock",S$="data-autofocus-inside",k$="data-no-autofocus";function j$(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function _$(e,t){var n=u.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 n5(e,t){return _$(t||null,function(n){return e.forEach(function(r){return j$(r,n)})})}var yv={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"},ba=function(){return ba=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},ba.apply(this,arguments)};function r5(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 ju(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 c(h){try{p(r.next(h))}catch(m){i(m)}}function f(h){try{p(r.throw(h))}catch(m){i(m)}}function p(h){h.done?s(h.value):o(h.value).then(c,f)}p((r=r.apply(e,t||[])).next())})}function _u(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:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function c(p){return function(h){return f([p,h])}}function f(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 XC(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(c){i={error:c}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return s}function B1(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 o5(e){return e}function s5(e,t){t===void 0&&(t=o5);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(c){return c!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(c){return s(c)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var c=n;n=[],c.forEach(s),i=n}var f=function(){var h=i;i=[],h.forEach(s)},p=function(){return Promise.resolve().then(f)};p(),n={push:function(h){i.push(h),p()},filter:function(h){return i=i.filter(h),n}}}};return o}function _x(e,t){return t===void 0&&(t=o5),s5(e,t)}function a5(e){e===void 0&&(e={});var t=s5(null);return t.options=ba({async:!0,ssr:!1},e),t}var i5=function(e){var t=e.sideCar,n=r5(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 u.createElement(r,ba({},n))};i5.isSideCarExport=!0;function P$(e,t){return e.useMedium(t),i5}var l5=_x({},function(e){var t=e.target,n=e.currentTarget;return{target:t,currentTarget:n}}),c5=_x(),I$=_x(),E$=a5({async:!0}),O$=[],Px=u.forwardRef(function(t,n){var r,o=u.useState(),s=o[0],i=o[1],c=u.useRef(),f=u.useRef(!1),p=u.useRef(null),h=t.children,m=t.disabled,v=t.noFocusGuards,b=t.persistentFocus,y=t.crossFrame,x=t.autoFocus;t.allowTextSelection;var C=t.group,k=t.className,j=t.whiteList,_=t.hasPositiveIndices,I=t.shards,O=I===void 0?O$:I,E=t.as,M=E===void 0?"div":E,R=t.lockProps,A=R===void 0?{}:R,D=t.sideCar,T=t.returnFocus,K=t.focusOptions,B=t.onActivation,G=t.onDeactivation,Q=u.useState({}),V=Q[0],L=u.useCallback(function(){p.current=p.current||document&&document.activeElement,c.current&&B&&B(c.current),f.current=!0},[B]),X=u.useCallback(function(){f.current=!1,G&&G(c.current)},[G]);u.useEffect(function(){m||(p.current=null)},[]);var F=u.useCallback(function(ne){var ie=p.current;if(ie&&ie.focus){var oe=typeof T=="function"?T(ie):T;if(oe){var me=typeof oe=="object"?oe:void 0;p.current=null,ne?Promise.resolve().then(function(){return ie.focus(me)}):ie.focus(me)}}},[T]),q=u.useCallback(function(ne){f.current&&l5.useMedium(ne)},[]),te=c5.useMedium,Y=u.useCallback(function(ne){c.current!==ne&&(c.current=ne,i(ne))},[]),ce=ar((r={},r[t5]=m&&"disabled",r[z1]=C,r),A),ae=v!==!0,U=ae&&v!=="tail",W=n5([n,Y]);return u.createElement(u.Fragment,null,ae&&[u.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:m?-1:0,style:yv}),_?u.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:m?-1:1,style:yv}):null],!m&&u.createElement(D,{id:V,sideCar:E$,observed:s,disabled:m,persistentFocus:b,crossFrame:y,autoFocus:x,whiteList:j,shards:O,onActivation:L,onDeactivation:X,returnFocus:F,focusOptions:K}),u.createElement(M,ar({ref:W},ce,{className:k,onBlur:te,onFocus:q}),h),U&&u.createElement("div",{"data-focus-guard":!0,tabIndex:m?-1:0,style:yv}))});Px.propTypes={};Px.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 u5=Px;function H1(e,t){return H1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},H1(e,t)}function M$(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,H1(e,t)}function R$(e,t){function n(r){return r.displayName||r.name||"Component"}return function(o){var s=[],i;function c(){i=e(s.map(function(p){return p.props})),t(i)}var f=function(p){M$(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),c()},m.componentDidUpdate=function(){c()},m.componentWillUnmount=function(){var b=s.indexOf(this);s.splice(b,1),c()},m.render=function(){return H.createElement(o,this.props)},h}(u.PureComponent);return P7(f,"displayName","SideEffect("+n(o)+")"),f}}var Da=function(e){for(var t=Array(e.length),n=0;n<e.length;++n)t[n]=e[n];return t},Eh=function(e){return Array.isArray(e)?e:[e]},d5=function(e){return Array.isArray(e)?e[0]:e},D$=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"},f5=function(e){return e.parentNode&&e.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.parentNode.host:e.parentNode},p5=function(e){return e===document||e&&e.nodeType===Node.DOCUMENT_NODE},A$=function(e,t){return!e||p5(e)||!D$(e)&&t(f5(e))},h5=function(e,t){var n=e.get(t);if(n!==void 0)return n;var r=A$(t,h5.bind(void 0,e));return e.set(t,r),r},N$=function(e,t){return e&&!p5(e)?L$(e)?t(f5(e)):!1:!0},m5=function(e,t){var n=e.get(t);if(n!==void 0)return n;var r=N$(t,m5.bind(void 0,e));return e.set(t,r),r},g5=function(e){return e.dataset},T$=function(e){return e.tagName==="BUTTON"},v5=function(e){return e.tagName==="INPUT"},b5=function(e){return v5(e)&&e.type==="radio"},$$=function(e){return!((v5(e)||T$(e))&&(e.type==="hidden"||e.disabled))},L$=function(e){var t=e.getAttribute(k$);return![!0,"true",""].includes(t)},Ix=function(e){var t;return!!(e&&(!((t=g5(e))===null||t===void 0)&&t.focusGuard))},Oh=function(e){return!Ix(e)},F$=function(e){return!!e},z$=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},x5=function(e,t,n){return Da(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(z$)},B$=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],Ex=B$.join(","),H$="".concat(Ex,", [data-focus-guard]"),y5=function(e,t){return Da((e.shadowRoot||e).children).reduce(function(n,r){return n.concat(r.matches(t?H$:Ex)?[r]:[],y5(r))},[])},W$=function(e,t){var n;return e instanceof HTMLIFrameElement&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?eg([e.contentDocument.body],t):[e]},eg=function(e,t){return e.reduce(function(n,r){var o,s=y5(r,t),i=(o=[]).concat.apply(o,s.map(function(c){return W$(c,t)}));return n.concat(i,r.parentNode?Da(r.parentNode.querySelectorAll(Ex)).filter(function(c){return c===r}):[])},[])},V$=function(e){var t=e.querySelectorAll("[".concat(S$,"]"));return Da(t).map(function(n){return eg([n])}).reduce(function(n,r){return n.concat(r)},[])},Ox=function(e,t){return Da(e).filter(function(n){return h5(t,n)}).filter(function(n){return $$(n)})},QC=function(e,t){return t===void 0&&(t=new Map),Da(e).filter(function(n){return m5(t,n)})},W1=function(e,t,n){return x5(Ox(eg(e,n),t),!0,n)},YC=function(e,t){return x5(Ox(eg(e),t),!1)},U$=function(e,t){return Ox(V$(e),t)},Vc=function(e,t){return e.shadowRoot?Vc(e.shadowRoot,t):Object.getPrototypeOf(e).contains!==void 0&&Object.getPrototypeOf(e).contains.call(e,t)?!0:Da(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?Vc(o,t):!1}return Vc(n,t)})},G$=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,c){return!t.has(c)})},w5=function(e){return e.parentNode?w5(e.parentNode):e},Mx=function(e){var t=Eh(e);return t.filter(Boolean).reduce(function(n,r){var o=r.getAttribute(z1);return n.push.apply(n,o?G$(Da(w5(r).querySelectorAll("[".concat(z1,'="').concat(o,'"]:not([').concat(t5,'="disabled"])')))):[r]),n},[])},q$=function(e){try{return e()}catch{return}},Fd=function(e){if(e===void 0&&(e=document),!(!e||!e.activeElement)){var t=e.activeElement;return t.shadowRoot?Fd(t.shadowRoot):t instanceof HTMLIFrameElement&&q$(function(){return t.contentWindow.document})?Fd(t.contentWindow.document):t}},K$=function(e,t){return e===t},X$=function(e,t){return!!Da(e.querySelectorAll("iframe")).some(function(n){return K$(n,t)})},C5=function(e,t){return t===void 0&&(t=Fd(d5(e).ownerDocument)),!t||t.dataset&&t.dataset.focusGuard?!1:Mx(e).some(function(n){return Vc(n,t)||X$(n,t)})},Q$=function(e){e===void 0&&(e=document);var t=Fd(e);return t?Da(e.querySelectorAll("[".concat(C$,"]"))).some(function(n){return Vc(n,t)}):!1},Y$=function(e,t){return t.filter(b5).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},Rx=function(e,t){return b5(e)&&e.name?Y$(e,t):e},J$=function(e){var t=new Set;return e.forEach(function(n){return t.add(Rx(n,e))}),e.filter(function(n){return t.has(n)})},JC=function(e){return e[0]&&e.length>1?Rx(e[0],e):e[0]},ZC=function(e,t){return e.length>1?e.indexOf(Rx(e[t],e)):t},S5="NEW_FOCUS",Z$=function(e,t,n,r){var o=e.length,s=e[0],i=e[o-1],c=Ix(n);if(!(n&&e.indexOf(n)>=0)){var f=n!==void 0?t.indexOf(n):-1,p=r?t.indexOf(r):f,h=r?e.indexOf(r):-1,m=f-p,v=t.indexOf(s),b=t.indexOf(i),y=J$(t),x=n!==void 0?y.indexOf(n):-1,C=x-(r?y.indexOf(r):f),k=ZC(e,0),j=ZC(e,o-1);if(f===-1||h===-1)return S5;if(!m&&h>=0)return h;if(f<=v&&c&&Math.abs(m)>1)return j;if(f>=b&&c&&Math.abs(m)>1)return k;if(m&&Math.abs(C)>1)return h;if(f<=v)return j;if(f>b)return k;if(m)return Math.abs(m)>1?h:(o+h+m)%o}},eL=function(e){return function(t){var n,r=(n=g5(t))===null||n===void 0?void 0:n.autofocus;return t.autofocus||r!==void 0&&r!=="false"||e.indexOf(t)>=0}},tL=function(e,t,n){var r=e.map(function(s){var i=s.node;return i}),o=QC(r.filter(eL(n)));return o&&o.length?JC(o):JC(QC(t))},V1=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&V1(e.parentNode.host||e.parentNode,t),t},wv=function(e,t){for(var n=V1(e),r=V1(t),o=0;o<n.length;o+=1){var s=n[o];if(r.indexOf(s)>=0)return s}return!1},k5=function(e,t,n){var r=Eh(e),o=Eh(t),s=r[0],i=!1;return o.filter(Boolean).forEach(function(c){i=wv(i||c,c)||i,n.filter(Boolean).forEach(function(f){var p=wv(s,f);p&&(!i||Vc(p,i)?i=p:i=wv(p,i))})}),i},nL=function(e,t){return e.reduce(function(n,r){return n.concat(U$(r,t))},[])},rL=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(F$)},oL=function(e,t){var n=Fd(Eh(e).length>0?document:d5(e).ownerDocument),r=Mx(e).filter(Oh),o=k5(n||e,e,r),s=new Map,i=YC(r,s),c=W1(r,s).filter(function(b){var y=b.node;return Oh(y)});if(!(!c[0]&&(c=i,!c[0]))){var f=YC([o],s).map(function(b){var y=b.node;return y}),p=rL(f,c),h=p.map(function(b){var y=b.node;return y}),m=Z$(h,f,n,t);if(m===S5){var v=tL(i,h,nL(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=Mx(e).filter(Oh),n=k5(e,e,t),r=new Map,o=W1([n],r,!0),s=W1(t,r).filter(function(i){var c=i.node;return Oh(c)}).map(function(i){var c=i.node;return c});return o.map(function(i){var c=i.node,f=i.index;return{node:c,index:f,lockItem:s.indexOf(c)>=0,guard:Ix(c)}})},aL=function(e,t){"focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus()},Cv=0,Sv=!1,j5=function(e,t,n){n===void 0&&(n={});var r=oL(e,t);if(!Sv&&r){if(Cv>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),Sv=!0,setTimeout(function(){Sv=!1},1);return}Cv++,aL(r.node,n.focusOptions),Cv--}};function Dx(e){setTimeout(e,1)}var iL=function(){return document&&document.activeElement===document.body},lL=function(){return iL()||Q$()},Uc=null,Nc=null,Gc=null,zd=!1,cL=function(){return!0},uL=function(t){return(Uc.whiteList||cL)(t)},dL=function(t,n){Gc={observerNode:t,portaledElement:n}},fL=function(t){return Gc&&Gc.portaledElement===t};function eS(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 pL=function(t){return t&&"current"in t?t.current:t},hL=function(t){return t?!!zd:zd==="meanwhile"},mL=function e(t,n,r){return n&&(n.host===t&&(!n.activeElement||r.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,r))},gL=function(t,n){return n.some(function(r){return mL(t,r,r)})},Mh=function(){var t=!1;if(Uc){var n=Uc,r=n.observed,o=n.persistentFocus,s=n.autoFocus,i=n.shards,c=n.crossFrame,f=n.focusOptions,p=r||Gc&&Gc.portaledElement,h=document&&document.activeElement;if(p){var m=[p].concat(i.map(pL).filter(Boolean));if((!h||uL(h))&&(o||hL(c)||!lL()||!Nc&&s)&&(p&&!(C5(m)||h&&gL(h,m)||fL(h))&&(document&&!Nc&&h&&!s?(h.blur&&h.blur(),document.body.focus()):(t=j5(m,Nc,{focusOptions:f}),Gc={})),zd=!1,Nc=document&&document.activeElement),document){var v=document&&document.activeElement,b=sL(m),y=b.map(function(x){var C=x.node;return C}).indexOf(v);y>-1&&(b.filter(function(x){var C=x.guard,k=x.node;return C&&k.dataset.focusAutoGuard}).forEach(function(x){var C=x.node;return C.removeAttribute("tabIndex")}),eS(y,b.length,1,b),eS(y,-1,-1,b))}}}return t},_5=function(t){Mh()&&t&&(t.stopPropagation(),t.preventDefault())},Ax=function(){return Dx(Mh)},vL=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||dL(r,n)},bL=function(){return null},P5=function(){zd="just",Dx(function(){zd="meanwhile"})},xL=function(){document.addEventListener("focusin",_5),document.addEventListener("focusout",Ax),window.addEventListener("blur",P5)},yL=function(){document.removeEventListener("focusin",_5),document.removeEventListener("focusout",Ax),window.removeEventListener("blur",P5)};function wL(e){return e.filter(function(t){var n=t.disabled;return!n})}function CL(e){var t=e.slice(-1)[0];t&&!Uc&&xL();var n=Uc,r=n&&t&&t.id===n.id;Uc=t,n&&!r&&(n.onDeactivation(),e.filter(function(o){var s=o.id;return s===n.id}).length||n.returnFocus(!t)),t?(Nc=null,(!r||n.observed!==t.observed)&&t.onActivation(),Mh(),Dx(Mh)):(yL(),Nc=null)}l5.assignSyncMedium(vL);c5.assignMedium(Ax);I$.assignMedium(function(e){return e({moveFocusInside:j5,focusInside:C5})});const SL=R$(wL,CL)(bL);var I5=u.forwardRef(function(t,n){return u.createElement(u5,ar({sideCar:SL,ref:n},t))}),E5=u5.propTypes||{};E5.sideCar;O9(E5,["sideCar"]);I5.propTypes={};const tS=I5;function O5(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Nx(e){var t;if(!O5(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function kL(e){var t,n;return(n=(t=M5(e))==null?void 0:t.defaultView)!=null?n:window}function M5(e){return O5(e)?e.ownerDocument:document}function jL(e){return M5(e).activeElement}function _L(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 PL(e){return e.localName==="html"?e:e.assignedSlot||e.parentElement||e.ownerDocument.documentElement}function R5(e){return["html","body","#document"].includes(e.localName)?e.ownerDocument.body:Nx(e)&&_L(e)?e:R5(PL(e))}var D5=e=>e.hasAttribute("tabindex"),IL=e=>D5(e)&&e.tabIndex===-1;function EL(e){return!!e.getAttribute("disabled")||!!e.getAttribute("aria-disabled")}function A5(e){return e.parentElement&&A5(e.parentElement)?!0:e.hidden}function OL(e){const t=e.getAttribute("contenteditable");return t!=="false"&&t!=null}function N5(e){if(!Nx(e)||A5(e)||EL(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]():OL(e)?!0:D5(e)}function ML(e){return e?Nx(e)&&N5(e)&&!IL(e):!1}var RL=["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]"],DL=RL.join(),AL=e=>e.offsetWidth>0&&e.offsetHeight>0;function T5(e){const t=Array.from(e.querySelectorAll(DL));return t.unshift(e),t.filter(n=>N5(n)&&AL(n))}var nS,NL=(nS=tS.default)!=null?nS:tS,$5=e=>{const{initialFocusRef:t,finalFocusRef:n,contentRef:r,restoreFocus:o,children:s,isDisabled:i,autoFocus:c,persistentFocus:f,lockFocusAcrossFrames:p}=e,h=u.useCallback(()=>{t!=null&&t.current?t.current.focus():r!=null&&r.current&&T5(r.current).length===0&&requestAnimationFrame(()=>{var y;(y=r.current)==null||y.focus()})},[t,r]),m=u.useCallback(()=>{var b;(b=n==null?void 0:n.current)==null||b.focus()},[n]),v=o&&!n;return a.jsx(NL,{crossFrame:p,persistentFocus:f,autoFocus:c,disabled:i,onActivation:h,onDeactivation:m,returnFocus:v,children:s})};$5.displayName="FocusLock";var TL=K9?u.useLayoutEffect:u.useEffect;function U1(e,t=[]){const n=u.useRef(e);return TL(()=>{n.current=e}),u.useCallback((...r)=>{var o;return(o=n.current)==null?void 0:o.call(n,...r)},t)}function $L(e,t,n,r){const o=U1(t);return u.useEffect(()=>{var s;const i=(s=Xw(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=Xw(n))!=null?s:document).removeEventListener(e,o,r)}}function LL(e,t){const n=u.useId();return u.useMemo(()=>e||[t,n].filter(Boolean).join("-"),[e,t,n])}function FL(e,t){const n=e!==void 0;return[n,n&&typeof e<"u"?e:t]}function Ao(e={}){const{onClose:t,onOpen:n,isOpen:r,id:o}=e,s=U1(n),i=U1(t),[c,f]=u.useState(e.defaultIsOpen||!1),[p,h]=FL(r,c),m=LL(o,"disclosure"),v=u.useCallback(()=>{p||f(!1),i==null||i()},[p,i]),b=u.useCallback(()=>{p||f(!0),s==null||s()},[p,s]),y=u.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:I7(x.onClick,y)}),getDisclosureProps:(x={})=>({...x,hidden:!h,id:m})}}var[zL,BL]=Dn({name:"InputGroupStylesContext",errorMessage:`useInputGroupStyles returned is 'undefined'. Seems you forgot to wrap the components in "<InputGroup />" `}),L5=Te(function(t,n){const r=Vr("Input",t),{children:o,className:s,...i}=Jn(t),c=_t("chakra-input__group",s),f={},p=pf(o),h=r.field;p.forEach(v=>{var b,y;r&&(h&&v.type.id==="InputLeftElement"&&(f.paddingStart=(b=h.height)!=null?b:h.h),h&&v.type.id==="InputRightElement"&&(f.paddingEnd=(y=h.height)!=null?y:h.h),v.type.id==="InputRightAddon"&&(f.borderEndRadius=0),v.type.id==="InputLeftAddon"&&(f.borderStartRadius=0))});const m=p.map(v=>{var b,y;const x=F_({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"?u.cloneElement(v,x):u.cloneElement(v,Object.assign(x,f,v.props))});return a.jsx(Me.div,{className:c,ref:n,__css:{width:"100%",display:"flex",position:"relative",isolation:"isolate",...r.group},"data-group":!0,...i,children:a.jsx(zL,{value:r,children:m})})});L5.displayName="InputGroup";var HL=Me("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"0",zIndex:2}}),tg=Te(function(t,n){var r,o;const{placement:s="left",...i}=t,c=BL(),f=c.field,h={[s==="left"?"insetStart":"insetEnd"]:"0",width:(r=f==null?void 0:f.height)!=null?r:f==null?void 0:f.h,height:(o=f==null?void 0:f.height)!=null?o:f==null?void 0:f.h,fontSize:f==null?void 0:f.fontSize,...c.element};return a.jsx(HL,{ref:n,__css:h,...i})});tg.id="InputElement";tg.displayName="InputElement";var F5=Te(function(t,n){const{className:r,...o}=t,s=_t("chakra-input__left-element",r);return a.jsx(tg,{ref:n,placement:"left",className:s,...o})});F5.id="InputLeftElement";F5.displayName="InputLeftElement";var Tx=Te(function(t,n){const{className:r,...o}=t,s=_t("chakra-input__right-element",r);return a.jsx(tg,{ref:n,placement:"right",className:s,...o})});Tx.id="InputRightElement";Tx.displayName="InputRightElement";var ng=Te(function(t,n){const{htmlSize:r,...o}=t,s=Vr("Input",o),i=Jn(o),c=yx(i),f=_t("chakra-input",t.className);return a.jsx(Me.input,{size:r,...c,__css:s.field,ref:n,className:f})});ng.displayName="Input";ng.id="Input";var rg=Te(function(t,n){const r=Xi("Link",t),{className:o,isExternal:s,...i}=Jn(t);return a.jsx(Me.a,{target:s?"_blank":void 0,rel:s?"noopener":void 0,ref:n,className:_t("chakra-link",o),...i,__css:r})});rg.displayName="Link";var[WL,z5]=Dn({name:"ListStylesContext",errorMessage:`useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "<List />" `}),$x=Te(function(t,n){const r=Vr("List",t),{children:o,styleType:s="none",stylePosition:i,spacing:c,...f}=Jn(t),p=pf(o),m=c?{["& > *:not(style) ~ *:not(style)"]:{mt:c}}:{};return a.jsx(WL,{value:r,children:a.jsx(Me.ul,{ref:n,listStyleType:s,listStylePosition:i,role:"list",__css:{...r.container,...m},...f,children:p})})});$x.displayName="List";var VL=Te((e,t)=>{const{as:n,...r}=e;return a.jsx($x,{ref:t,as:"ol",styleType:"decimal",marginStart:"1em",...r})});VL.displayName="OrderedList";var gf=Te(function(t,n){const{as:r,...o}=t;return a.jsx($x,{ref:n,as:"ul",styleType:"initial",marginStart:"1em",...o})});gf.displayName="UnorderedList";var Fs=Te(function(t,n){const r=z5();return a.jsx(Me.li,{ref:n,...t,__css:r.item})});Fs.displayName="ListItem";var UL=Te(function(t,n){const r=z5();return a.jsx(Tr,{ref:n,role:"presentation",...t,__css:r.icon})});UL.displayName="ListIcon";var Vi=Te(function(t,n){const{templateAreas:r,gap:o,rowGap:s,columnGap:i,column:c,row:f,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:c,gridRow:f,gridAutoFlow:p,gridAutoRows:h,gridTemplateRows:m,gridTemplateColumns:b};return a.jsx(Me.div,{ref:n,__css:x,...y})});Vi.displayName="Grid";function B5(e,t){return Array.isArray(e)?e.map(n=>n===null?null:t(n)):y1(e)?Object.keys(e).reduce((n,r)=>(n[r]=t(e[r]),n),{}):e!=null?t(e):null}var Qi=Me("div",{baseStyle:{flex:1,justifySelf:"stretch",alignSelf:"stretch"}});Qi.displayName="Spacer";var H5=e=>a.jsx(Me.div,{className:"chakra-stack__item",...e,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...e.__css}});H5.displayName="StackItem";function GL(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{"&":B5(n,o=>r[o])}}var Lx=Te((e,t)=>{const{isInline:n,direction:r,align:o,justify:s,spacing:i="0.5rem",wrap:c,children:f,divider:p,className:h,shouldWrapChildren:m,...v}=e,b=n?"row":r??"column",y=u.useMemo(()=>GL({spacing:i,direction:b}),[i,b]),x=!!p,C=!m&&!x,k=u.useMemo(()=>{const _=pf(f);return C?_:_.map((I,O)=>{const E=typeof I.key<"u"?I.key:O,M=O+1===_.length,A=m?a.jsx(H5,{children:I},E):I;if(!x)return A;const D=u.cloneElement(p,{__css:y}),T=M?null:D;return a.jsxs(u.Fragment,{children:[A,T]},E)})},[p,y,x,C,m,f]),j=_t("chakra-stack",h);return a.jsx(Me.div,{ref:t,display:"flex",alignItems:o,justifyContent:s,flexDirection:b,flexWrap:c,gap:x?void 0:i,className:j,...v,children:k})});Lx.displayName="Stack";var W5=Te((e,t)=>a.jsx(Lx,{align:"center",...e,direction:"column",ref:t}));W5.displayName="VStack";var Fx=Te((e,t)=>a.jsx(Lx,{align:"center",...e,direction:"row",ref:t}));Fx.displayName="HStack";function rS(e){return B5(e,t=>t==="auto"?"auto":`span ${t}/span ${t}`)}var Bd=Te(function(t,n){const{area:r,colSpan:o,colStart:s,colEnd:i,rowEnd:c,rowSpan:f,rowStart:p,...h}=t,m=F_({gridArea:r,gridColumn:rS(o),gridRow:rS(f),gridColumnStart:s,gridColumnEnd:i,gridRowStart:p,gridRowEnd:c});return a.jsx(Me.div,{ref:n,__css:m,...h})});Bd.displayName="GridItem";var hi=Te(function(t,n){const r=Xi("Badge",t),{className:o,...s}=Jn(t);return a.jsx(Me.span,{ref:n,className:_t("chakra-badge",t.className),...s,__css:{display:"inline-block",whiteSpace:"nowrap",verticalAlign:"middle",...r}})});hi.displayName="Badge";var Ko=Te(function(t,n){const{borderLeftWidth:r,borderBottomWidth:o,borderTopWidth:s,borderRightWidth:i,borderWidth:c,borderStyle:f,borderColor:p,...h}=Xi("Divider",t),{className:m,orientation:v="horizontal",__css:b,...y}=Jn(t),x={vertical:{borderLeftWidth:r||i||c||"1px",height:"100%"},horizontal:{borderBottomWidth:o||s||c||"1px",width:"100%"}};return a.jsx(Me.hr,{ref:n,"aria-orientation":v,...y,__css:{...h,border:"0",borderColor:p,borderStyle:f,...x[v],...b},className:_t("chakra-divider",m)})});Ko.displayName="Divider";function qL(e){const{key:t}=e;return t.length===1||t.length>1&&/[^a-zA-Z0-9]/.test(t)}function KL(e={}){const{timeout:t=300,preventDefault:n=()=>!0}=e,[r,o]=u.useState([]),s=u.useRef(),i=()=>{s.current&&(clearTimeout(s.current),s.current=null)},c=()=>{i(),s.current=setTimeout(()=>{o([]),s.current=null},t)};u.useEffect(()=>i,[]);function f(p){return h=>{if(h.key==="Backspace"){const m=[...r];m.pop(),o(m);return}if(qL(h)){const m=r.concat(h.key);n(h)&&(h.preventDefault(),h.stopPropagation()),o(m),p(m.join("")),c()}}}return f}function XL(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 QL(){const e=u.useRef(new Map),t=e.current,n=u.useCallback((o,s,i,c)=>{e.current.set(i,{type:s,el:o,options:c}),o.addEventListener(s,i,c)},[]),r=u.useCallback((o,s,i,c)=>{o.removeEventListener(s,i,c),e.current.delete(i)},[]);return u.useEffect(()=>()=>{t.forEach((o,s)=>{r(o.el,o.type,s,o.options)})},[r,t]),{add:n,remove:r}}function kv(e){const t=e.target,{tagName:n,isContentEditable:r}=t;return n!=="INPUT"&&n!=="TEXTAREA"&&r!==!0}function V5(e={}){const{ref:t,isDisabled:n,isFocusable:r,clickOnEnter:o=!0,clickOnSpace:s=!0,onMouseDown:i,onMouseUp:c,onClick:f,onKeyDown:p,onKeyUp:h,tabIndex:m,onMouseOver:v,onMouseLeave:b,...y}=e,[x,C]=u.useState(!0),[k,j]=u.useState(!1),_=QL(),I=L=>{L&&L.tagName!=="BUTTON"&&C(!1)},O=x?m:m||0,E=n&&!r,M=u.useCallback(L=>{if(n){L.stopPropagation(),L.preventDefault();return}L.currentTarget.focus(),f==null||f(L)},[n,f]),R=u.useCallback(L=>{k&&kv(L)&&(L.preventDefault(),L.stopPropagation(),j(!1),_.remove(document,"keyup",R,!1))},[k,_]),A=u.useCallback(L=>{if(p==null||p(L),n||L.defaultPrevented||L.metaKey||!kv(L.nativeEvent)||x)return;const X=o&&L.key==="Enter";s&&L.key===" "&&(L.preventDefault(),j(!0)),X&&(L.preventDefault(),L.currentTarget.click()),_.add(document,"keyup",R,!1)},[n,x,p,o,s,_,R]),D=u.useCallback(L=>{if(h==null||h(L),n||L.defaultPrevented||L.metaKey||!kv(L.nativeEvent)||x)return;s&&L.key===" "&&(L.preventDefault(),j(!1),L.currentTarget.click())},[s,x,n,h]),T=u.useCallback(L=>{L.button===0&&(j(!1),_.remove(document,"mouseup",T,!1))},[_]),K=u.useCallback(L=>{if(L.button!==0)return;if(n){L.stopPropagation(),L.preventDefault();return}x||j(!0),L.currentTarget.focus({preventScroll:!0}),_.add(document,"mouseup",T,!1),i==null||i(L)},[n,x,i,_,T]),B=u.useCallback(L=>{L.button===0&&(x||j(!1),c==null||c(L))},[c,x]),G=u.useCallback(L=>{if(n){L.preventDefault();return}v==null||v(L)},[n,v]),Q=u.useCallback(L=>{k&&(L.preventDefault(),j(!1)),b==null||b(L)},[k,b]),V=cn(t,I);return x?{...y,ref:V,type:"button","aria-disabled":E?void 0:n,disabled:E,onClick:M,onMouseDown:i,onMouseUp:c,onKeyUp:h,onKeyDown:p,onMouseOver:v,onMouseLeave:b}:{...y,ref:V,role:"button","data-active":Ht(k),"aria-disabled":n?"true":void 0,tabIndex:E?void 0:O,onClick:M,onMouseDown:K,onMouseUp:B,onKeyUp:D,onKeyDown:A,onMouseOver:G,onMouseLeave:Q}}function YL(e){const t=e.current;if(!t)return!1;const n=jL(t);return!n||t.contains(n)?!1:!!ML(n)}function U5(e,t){const{shouldFocus:n,visible:r,focusRef:o}=t,s=n&&!r;fi(()=>{if(!s||YL(e))return;const i=(o==null?void 0:o.current)||e.current;let c;if(i)return c=requestAnimationFrame(()=>{i.focus({preventScroll:!0})}),()=>{cancelAnimationFrame(c)}},[s,e,o])}var JL={preventScroll:!0,shouldFocus:!1};function ZL(e,t=JL){const{focusRef:n,preventScroll:r,shouldFocus:o,visible:s}=t,i=eF(e)?e.current:e,c=o&&s,f=u.useRef(c),p=u.useRef(s);zc(()=>{!p.current&&s&&(f.current=c),p.current=s},[s,c]);const h=u.useCallback(()=>{if(!(!s||!i||!f.current)&&(f.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=T5(i);m.length>0&&requestAnimationFrame(()=>{m[0].focus({preventScroll:r})})}},[s,r,i,n]);fi(()=>{h()},[h]),wl(i,"transitionend",h)}function eF(e){return"current"in e}var mc=(e,t)=>({var:e,varRef:t?`var(${e}, ${t})`:`var(${e})`}),Ir={arrowShadowColor:mc("--popper-arrow-shadow-color"),arrowSize:mc("--popper-arrow-size","8px"),arrowSizeHalf:mc("--popper-arrow-size-half"),arrowBg:mc("--popper-arrow-bg"),transformOrigin:mc("--popper-transform-origin"),arrowOffset:mc("--popper-arrow-offset")};function tF(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 nF={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"},rF=e=>nF[e],oS={scroll:!0,resize:!0};function oF(e){let t;return typeof e=="object"?t={enabled:!0,options:{...oS,...e}}:t={enabled:e,options:oS},t}var sF={name:"matchWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:e})=>{e.styles.popper.width=`${e.rects.reference.width}px`},effect:({state:e})=>()=>{const t=e.elements.reference;e.elements.popper.style.width=`${t.offsetWidth}px`}},aF={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:e})=>{sS(e)},effect:({state:e})=>()=>{sS(e)}},sS=e=>{e.elements.popper.style.setProperty(Ir.transformOrigin.var,rF(e.placement))},iF={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:e})=>{lF(e)}},lF=e=>{var t;if(!e.placement)return;const n=cF(e.placement);if((t=e.elements)!=null&&t.arrow&&n){Object.assign(e.elements.arrow.style,{[n.property]:n.value,width:Ir.arrowSize.varRef,height:Ir.arrowSize.varRef,zIndex:-1});const r={[Ir.arrowSizeHalf.var]:`calc(${Ir.arrowSize.varRef} / 2 - 1px)`,[Ir.arrowOffset.var]:`calc(${Ir.arrowSizeHalf.varRef} * -1)`};for(const o in r)e.elements.arrow.style.setProperty(o,r[o])}},cF=e=>{if(e.startsWith("top"))return{property:"bottom",value:Ir.arrowOffset.varRef};if(e.startsWith("bottom"))return{property:"top",value:Ir.arrowOffset.varRef};if(e.startsWith("left"))return{property:"right",value:Ir.arrowOffset.varRef};if(e.startsWith("right"))return{property:"left",value:Ir.arrowOffset.varRef}},uF={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:e})=>{aS(e)},effect:({state:e})=>()=>{aS(e)}},aS=e=>{if(!e.elements.arrow)return;const t=e.elements.arrow.querySelector("[data-popper-arrow-inner]");if(!t)return;const n=tF(e.placement);n&&t.style.setProperty("--popper-arrow-default-shadow",n),Object.assign(t.style,{transform:"rotate(45deg)",background:Ir.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:"var(--popper-arrow-shadow, var(--popper-arrow-default-shadow))"})},dF={"start-start":{ltr:"left-start",rtl:"right-start"},"start-end":{ltr:"left-end",rtl:"right-end"},"end-start":{ltr:"right-start",rtl:"left-start"},"end-end":{ltr:"right-end",rtl:"left-end"},start:{ltr:"left",rtl:"right"},end:{ltr:"right",rtl:"left"}},fF={"auto-start":"auto-end","auto-end":"auto-start","top-start":"top-end","top-end":"top-start","bottom-start":"bottom-end","bottom-end":"bottom-start"};function pF(e,t="ltr"){var n,r;const o=((n=dF[e])==null?void 0:n[t])||e;return t==="ltr"?o:(r=fF[e])!=null?r:o}var Oo="top",xs="bottom",ys="right",Mo="left",zx="auto",vf=[Oo,xs,ys,Mo],lu="start",Hd="end",hF="clippingParents",G5="viewport",ad="popper",mF="reference",iS=vf.reduce(function(e,t){return e.concat([t+"-"+lu,t+"-"+Hd])},[]),q5=[].concat(vf,[zx]).reduce(function(e,t){return e.concat([t,t+"-"+lu,t+"-"+Hd])},[]),gF="beforeRead",vF="read",bF="afterRead",xF="beforeMain",yF="main",wF="afterMain",CF="beforeWrite",SF="write",kF="afterWrite",jF=[gF,vF,bF,xF,yF,wF,CF,SF,kF];function Sa(e){return e?(e.nodeName||"").toLowerCase():null}function Xo(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Al(e){var t=Xo(e).Element;return e instanceof t||e instanceof Element}function vs(e){var t=Xo(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Bx(e){if(typeof ShadowRoot>"u")return!1;var t=Xo(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function _F(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];!vs(s)||!Sa(s)||(Object.assign(s.style,r),Object.keys(o).forEach(function(i){var c=o[i];c===!1?s.removeAttribute(i):s.setAttribute(i,c===!0?"":c)}))})}function PF(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]),c=i.reduce(function(f,p){return f[p]="",f},{});!vs(o)||!Sa(o)||(Object.assign(o.style,c),Object.keys(s).forEach(function(f){o.removeAttribute(f)}))})}}const IF={name:"applyStyles",enabled:!0,phase:"write",fn:_F,effect:PF,requires:["computeStyles"]};function Ca(e){return e.split("-")[0]}var Cl=Math.max,Rh=Math.min,cu=Math.round;function G1(){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 K5(){return!/^((?!chrome|android).)*safari/i.test(G1())}function uu(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),o=1,s=1;t&&vs(e)&&(o=e.offsetWidth>0&&cu(r.width)/e.offsetWidth||1,s=e.offsetHeight>0&&cu(r.height)/e.offsetHeight||1);var i=Al(e)?Xo(e):window,c=i.visualViewport,f=!K5()&&n,p=(r.left+(f&&c?c.offsetLeft:0))/o,h=(r.top+(f&&c?c.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 Hx(e){var t=uu(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 X5(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Bx(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function oi(e){return Xo(e).getComputedStyle(e)}function EF(e){return["table","td","th"].indexOf(Sa(e))>=0}function Yi(e){return((Al(e)?e.ownerDocument:e.document)||window.document).documentElement}function og(e){return Sa(e)==="html"?e:e.assignedSlot||e.parentNode||(Bx(e)?e.host:null)||Yi(e)}function lS(e){return!vs(e)||oi(e).position==="fixed"?null:e.offsetParent}function OF(e){var t=/firefox/i.test(G1()),n=/Trident/i.test(G1());if(n&&vs(e)){var r=oi(e);if(r.position==="fixed")return null}var o=og(e);for(Bx(o)&&(o=o.host);vs(o)&&["html","body"].indexOf(Sa(o))<0;){var s=oi(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 bf(e){for(var t=Xo(e),n=lS(e);n&&EF(n)&&oi(n).position==="static";)n=lS(n);return n&&(Sa(n)==="html"||Sa(n)==="body"&&oi(n).position==="static")?t:n||OF(e)||t}function Wx(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Id(e,t,n){return Cl(e,Rh(t,n))}function MF(e,t,n){var r=Id(e,t,n);return r>n?n:r}function Q5(){return{top:0,right:0,bottom:0,left:0}}function Y5(e){return Object.assign({},Q5(),e)}function J5(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var RF=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,Y5(typeof t!="number"?t:J5(t,vf))};function DF(e){var t,n=e.state,r=e.name,o=e.options,s=n.elements.arrow,i=n.modifiersData.popperOffsets,c=Ca(n.placement),f=Wx(c),p=[Mo,ys].indexOf(c)>=0,h=p?"height":"width";if(!(!s||!i)){var m=RF(o.padding,n),v=Hx(s),b=f==="y"?Oo:Mo,y=f==="y"?xs:ys,x=n.rects.reference[h]+n.rects.reference[f]-i[f]-n.rects.popper[h],C=i[f]-n.rects.reference[f],k=bf(s),j=k?f==="y"?k.clientHeight||0:k.clientWidth||0:0,_=x/2-C/2,I=m[b],O=j-v[h]-m[y],E=j/2-v[h]/2+_,M=Id(I,E,O),R=f;n.modifiersData[r]=(t={},t[R]=M,t.centerOffset=M-E,t)}}function AF(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)||X5(t.elements.popper,o)&&(t.elements.arrow=o))}const NF={name:"arrow",enabled:!0,phase:"main",fn:DF,effect:AF,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function du(e){return e.split("-")[1]}var TF={top:"auto",right:"auto",bottom:"auto",left:"auto"};function $F(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:cu(n*o)/o||0,y:cu(r*o)/o||0}}function cS(e){var t,n=e.popper,r=e.popperRect,o=e.placement,s=e.variation,i=e.offsets,c=e.position,f=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,C=typeof h=="function"?h({x:b,y:x}):{x:b,y:x};b=C.x,x=C.y;var k=i.hasOwnProperty("x"),j=i.hasOwnProperty("y"),_=Mo,I=Oo,O=window;if(p){var E=bf(n),M="clientHeight",R="clientWidth";if(E===Xo(n)&&(E=Yi(n),oi(E).position!=="static"&&c==="absolute"&&(M="scrollHeight",R="scrollWidth")),E=E,o===Oo||(o===Mo||o===ys)&&s===Hd){I=xs;var A=m&&E===O&&O.visualViewport?O.visualViewport.height:E[M];x-=A-r.height,x*=f?1:-1}if(o===Mo||(o===Oo||o===xs)&&s===Hd){_=ys;var D=m&&E===O&&O.visualViewport?O.visualViewport.width:E[R];b-=D-r.width,b*=f?1:-1}}var T=Object.assign({position:c},p&&TF),K=h===!0?$F({x:b,y:x},Xo(n)):{x:b,y:x};if(b=K.x,x=K.y,f){var B;return Object.assign({},T,(B={},B[I]=j?"0":"",B[_]=k?"0":"",B.transform=(O.devicePixelRatio||1)<=1?"translate("+b+"px, "+x+"px)":"translate3d("+b+"px, "+x+"px, 0)",B))}return Object.assign({},T,(t={},t[I]=j?x+"px":"",t[_]=k?b+"px":"",t.transform="",t))}function LF(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,c=n.roundOffsets,f=c===void 0?!0:c,p={placement:Ca(t.placement),variation:du(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,cS(Object.assign({},p,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:i,roundOffsets:f})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,cS(Object.assign({},p,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:f})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const FF={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:LF,data:{}};var Sp={passive:!0};function zF(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,s=o===void 0?!0:o,i=r.resize,c=i===void 0?!0:i,f=Xo(t.elements.popper),p=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&p.forEach(function(h){h.addEventListener("scroll",n.update,Sp)}),c&&f.addEventListener("resize",n.update,Sp),function(){s&&p.forEach(function(h){h.removeEventListener("scroll",n.update,Sp)}),c&&f.removeEventListener("resize",n.update,Sp)}}const BF={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:zF,data:{}};var HF={left:"right",right:"left",bottom:"top",top:"bottom"};function sh(e){return e.replace(/left|right|bottom|top/g,function(t){return HF[t]})}var WF={start:"end",end:"start"};function uS(e){return e.replace(/start|end/g,function(t){return WF[t]})}function Vx(e){var t=Xo(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Ux(e){return uu(Yi(e)).left+Vx(e).scrollLeft}function VF(e,t){var n=Xo(e),r=Yi(e),o=n.visualViewport,s=r.clientWidth,i=r.clientHeight,c=0,f=0;if(o){s=o.width,i=o.height;var p=K5();(p||!p&&t==="fixed")&&(c=o.offsetLeft,f=o.offsetTop)}return{width:s,height:i,x:c+Ux(e),y:f}}function UF(e){var t,n=Yi(e),r=Vx(e),o=(t=e.ownerDocument)==null?void 0:t.body,s=Cl(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),i=Cl(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),c=-r.scrollLeft+Ux(e),f=-r.scrollTop;return oi(o||n).direction==="rtl"&&(c+=Cl(n.clientWidth,o?o.clientWidth:0)-s),{width:s,height:i,x:c,y:f}}function Gx(e){var t=oi(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function Z5(e){return["html","body","#document"].indexOf(Sa(e))>=0?e.ownerDocument.body:vs(e)&&Gx(e)?e:Z5(og(e))}function Ed(e,t){var n;t===void 0&&(t=[]);var r=Z5(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),s=Xo(r),i=o?[s].concat(s.visualViewport||[],Gx(r)?r:[]):r,c=t.concat(i);return o?c:c.concat(Ed(og(i)))}function q1(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function GF(e,t){var n=uu(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 dS(e,t,n){return t===G5?q1(VF(e,n)):Al(t)?GF(t,n):q1(UF(Yi(e)))}function qF(e){var t=Ed(og(e)),n=["absolute","fixed"].indexOf(oi(e).position)>=0,r=n&&vs(e)?bf(e):e;return Al(r)?t.filter(function(o){return Al(o)&&X5(o,r)&&Sa(o)!=="body"}):[]}function KF(e,t,n,r){var o=t==="clippingParents"?qF(e):[].concat(t),s=[].concat(o,[n]),i=s[0],c=s.reduce(function(f,p){var h=dS(e,p,r);return f.top=Cl(h.top,f.top),f.right=Rh(h.right,f.right),f.bottom=Rh(h.bottom,f.bottom),f.left=Cl(h.left,f.left),f},dS(e,i,r));return c.width=c.right-c.left,c.height=c.bottom-c.top,c.x=c.left,c.y=c.top,c}function eP(e){var t=e.reference,n=e.element,r=e.placement,o=r?Ca(r):null,s=r?du(r):null,i=t.x+t.width/2-n.width/2,c=t.y+t.height/2-n.height/2,f;switch(o){case Oo:f={x:i,y:t.y-n.height};break;case xs:f={x:i,y:t.y+t.height};break;case ys:f={x:t.x+t.width,y:c};break;case Mo:f={x:t.x-n.width,y:c};break;default:f={x:t.x,y:t.y}}var p=o?Wx(o):null;if(p!=null){var h=p==="y"?"height":"width";switch(s){case lu:f[p]=f[p]-(t[h]/2-n[h]/2);break;case Hd:f[p]=f[p]+(t[h]/2-n[h]/2);break}}return f}function Wd(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,c=n.boundary,f=c===void 0?hF:c,p=n.rootBoundary,h=p===void 0?G5:p,m=n.elementContext,v=m===void 0?ad:m,b=n.altBoundary,y=b===void 0?!1:b,x=n.padding,C=x===void 0?0:x,k=Y5(typeof C!="number"?C:J5(C,vf)),j=v===ad?mF:ad,_=e.rects.popper,I=e.elements[y?j:v],O=KF(Al(I)?I:I.contextElement||Yi(e.elements.popper),f,h,i),E=uu(e.elements.reference),M=eP({reference:E,element:_,strategy:"absolute",placement:o}),R=q1(Object.assign({},_,M)),A=v===ad?R:E,D={top:O.top-A.top+k.top,bottom:A.bottom-O.bottom+k.bottom,left:O.left-A.left+k.left,right:A.right-O.right+k.right},T=e.modifiersData.offset;if(v===ad&&T){var K=T[o];Object.keys(D).forEach(function(B){var G=[ys,xs].indexOf(B)>=0?1:-1,Q=[Oo,xs].indexOf(B)>=0?"y":"x";D[B]+=K[Q]*G})}return D}function XF(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=n.boundary,s=n.rootBoundary,i=n.padding,c=n.flipVariations,f=n.allowedAutoPlacements,p=f===void 0?q5:f,h=du(r),m=h?c?iS:iS.filter(function(y){return du(y)===h}):vf,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]=Wd(e,{placement:x,boundary:o,rootBoundary:s,padding:i})[Ca(x)],y},{});return Object.keys(b).sort(function(y,x){return b[y]-b[x]})}function QF(e){if(Ca(e)===zx)return[];var t=sh(e);return[uS(e),t,uS(t)]}function YF(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,c=i===void 0?!0:i,f=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,C=t.options.placement,k=Ca(C),j=k===C,_=f||(j||!y?[sh(C)]:QF(C)),I=[C].concat(_).reduce(function(ae,U){return ae.concat(Ca(U)===zx?XF(t,{placement:U,boundary:h,rootBoundary:m,padding:p,flipVariations:y,allowedAutoPlacements:x}):U)},[]),O=t.rects.reference,E=t.rects.popper,M=new Map,R=!0,A=I[0],D=0;D<I.length;D++){var T=I[D],K=Ca(T),B=du(T)===lu,G=[Oo,xs].indexOf(K)>=0,Q=G?"width":"height",V=Wd(t,{placement:T,boundary:h,rootBoundary:m,altBoundary:v,padding:p}),L=G?B?ys:Mo:B?xs:Oo;O[Q]>E[Q]&&(L=sh(L));var X=sh(L),F=[];if(s&&F.push(V[K]<=0),c&&F.push(V[L]<=0,V[X]<=0),F.every(function(ae){return ae})){A=T,R=!1;break}M.set(T,F)}if(R)for(var q=y?3:1,te=function(U){var W=I.find(function(ne){var ie=M.get(ne);if(ie)return ie.slice(0,U).every(function(oe){return oe})});if(W)return A=W,"break"},Y=q;Y>0;Y--){var ce=te(Y);if(ce==="break")break}t.placement!==A&&(t.modifiersData[r]._skip=!0,t.placement=A,t.reset=!0)}}const JF={name:"flip",enabled:!0,phase:"main",fn:YF,requiresIfExists:["offset"],data:{_skip:!1}};function fS(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 pS(e){return[Oo,ys,xs,Mo].some(function(t){return e[t]>=0})}function ZF(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,s=t.modifiersData.preventOverflow,i=Wd(t,{elementContext:"reference"}),c=Wd(t,{altBoundary:!0}),f=fS(i,r),p=fS(c,o,s),h=pS(f),m=pS(p);t.modifiersData[n]={referenceClippingOffsets:f,popperEscapeOffsets:p,isReferenceHidden:h,hasPopperEscaped:m},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":m})}const ez={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:ZF};function tz(e,t,n){var r=Ca(e),o=[Mo,Oo].indexOf(r)>=0?-1:1,s=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,i=s[0],c=s[1];return i=i||0,c=(c||0)*o,[Mo,ys].indexOf(r)>=0?{x:c,y:i}:{x:i,y:c}}function nz(e){var t=e.state,n=e.options,r=e.name,o=n.offset,s=o===void 0?[0,0]:o,i=q5.reduce(function(h,m){return h[m]=tz(m,t.rects,s),h},{}),c=i[t.placement],f=c.x,p=c.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=f,t.modifiersData.popperOffsets.y+=p),t.modifiersData[r]=i}const rz={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:nz};function oz(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 sz={name:"popperOffsets",enabled:!0,phase:"read",fn:oz,data:{}};function az(e){return e==="x"?"y":"x"}function iz(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,s=o===void 0?!0:o,i=n.altAxis,c=i===void 0?!1:i,f=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,C=Wd(t,{boundary:f,rootBoundary:p,padding:m,altBoundary:h}),k=Ca(t.placement),j=du(t.placement),_=!j,I=Wx(k),O=az(I),E=t.modifiersData.popperOffsets,M=t.rects.reference,R=t.rects.popper,A=typeof x=="function"?x(Object.assign({},t.rects,{placement:t.placement})):x,D=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(E){if(s){var B,G=I==="y"?Oo:Mo,Q=I==="y"?xs:ys,V=I==="y"?"height":"width",L=E[I],X=L+C[G],F=L-C[Q],q=b?-R[V]/2:0,te=j===lu?M[V]:R[V],Y=j===lu?-R[V]:-M[V],ce=t.elements.arrow,ae=b&&ce?Hx(ce):{width:0,height:0},U=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Q5(),W=U[G],ne=U[Q],ie=Id(0,M[V],ae[V]),oe=_?M[V]/2-q-ie-W-D.mainAxis:te-ie-W-D.mainAxis,me=_?-M[V]/2+q+ie+ne+D.mainAxis:Y+ie+ne+D.mainAxis,fe=t.elements.arrow&&bf(t.elements.arrow),he=fe?I==="y"?fe.clientTop||0:fe.clientLeft||0:0,Ce=(B=T==null?void 0:T[I])!=null?B:0,xe=L+oe-Ce-he,de=L+me-Ce,Ne=Id(b?Rh(X,xe):X,L,b?Cl(F,de):F);E[I]=Ne,K[I]=Ne-L}if(c){var De,Xe=I==="x"?Oo:Mo,It=I==="x"?xs:ys,lt=E[O],on=O==="y"?"height":"width",gt=lt+C[Xe],bt=lt-C[It],ye=[Oo,Mo].indexOf(k)!==-1,We=(De=T==null?void 0:T[O])!=null?De:0,Et=ye?gt:lt-M[on]-R[on]-We+D.altAxis,zt=ye?lt+M[on]+R[on]-We-D.altAxis:bt,we=b&&ye?MF(Et,lt,zt):Id(b?Et:gt,lt,b?zt:bt);E[O]=we,K[O]=we-lt}t.modifiersData[r]=K}}const lz={name:"preventOverflow",enabled:!0,phase:"main",fn:iz,requiresIfExists:["offset"]};function cz(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function uz(e){return e===Xo(e)||!vs(e)?Vx(e):cz(e)}function dz(e){var t=e.getBoundingClientRect(),n=cu(t.width)/e.offsetWidth||1,r=cu(t.height)/e.offsetHeight||1;return n!==1||r!==1}function fz(e,t,n){n===void 0&&(n=!1);var r=vs(t),o=vs(t)&&dz(t),s=Yi(t),i=uu(e,o,n),c={scrollLeft:0,scrollTop:0},f={x:0,y:0};return(r||!r&&!n)&&((Sa(t)!=="body"||Gx(s))&&(c=uz(t)),vs(t)?(f=uu(t,!0),f.x+=t.clientLeft,f.y+=t.clientTop):s&&(f.x=Ux(s))),{x:i.left+c.scrollLeft-f.x,y:i.top+c.scrollTop-f.y,width:i.width,height:i.height}}function pz(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(c){if(!n.has(c)){var f=t.get(c);f&&o(f)}}),r.push(s)}return e.forEach(function(s){n.has(s.name)||o(s)}),r}function hz(e){var t=pz(e);return jF.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function mz(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function gz(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 hS={placement:"bottom",modifiers:[],strategy:"absolute"};function mS(){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 vz(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,o=t.defaultOptions,s=o===void 0?hS:o;return function(c,f,p){p===void 0&&(p=s);var h={placement:"bottom",orderedModifiers:[],options:Object.assign({},hS,s),modifiersData:{},elements:{reference:c,popper:f},attributes:{},styles:{}},m=[],v=!1,b={state:h,setOptions:function(k){var j=typeof k=="function"?k(h.options):k;x(),h.options=Object.assign({},s,h.options,j),h.scrollParents={reference:Al(c)?Ed(c):c.contextElement?Ed(c.contextElement):[],popper:Ed(f)};var _=hz(gz([].concat(r,h.options.modifiers)));return h.orderedModifiers=_.filter(function(I){return I.enabled}),y(),b.update()},forceUpdate:function(){if(!v){var k=h.elements,j=k.reference,_=k.popper;if(mS(j,_)){h.rects={reference:fz(j,bf(_),h.options.strategy==="fixed"),popper:Hx(_)},h.reset=!1,h.placement=h.options.placement,h.orderedModifiers.forEach(function(D){return h.modifiersData[D.name]=Object.assign({},D.data)});for(var I=0;I<h.orderedModifiers.length;I++){if(h.reset===!0){h.reset=!1,I=-1;continue}var O=h.orderedModifiers[I],E=O.fn,M=O.options,R=M===void 0?{}:M,A=O.name;typeof E=="function"&&(h=E({state:h,options:R,name:A,instance:b})||h)}}}},update:mz(function(){return new Promise(function(C){b.forceUpdate(),C(h)})}),destroy:function(){x(),v=!0}};if(!mS(c,f))return b;b.setOptions(p).then(function(C){!v&&p.onFirstUpdate&&p.onFirstUpdate(C)});function y(){h.orderedModifiers.forEach(function(C){var k=C.name,j=C.options,_=j===void 0?{}:j,I=C.effect;if(typeof I=="function"){var O=I({state:h,name:k,instance:b,options:_}),E=function(){};m.push(O||E)}})}function x(){m.forEach(function(C){return C()}),m=[]}return b}}var bz=[BF,sz,FF,IF,rz,JF,lz,NF,ez],xz=vz({defaultModifiers:bz});function qx(e={}){const{enabled:t=!0,modifiers:n,placement:r="bottom",strategy:o="absolute",arrowPadding:s=8,eventListeners:i=!0,offset:c,gutter:f=8,flip:p=!0,boundary:h="clippingParents",preventOverflow:m=!0,matchWidth:v,direction:b="ltr"}=e,y=u.useRef(null),x=u.useRef(null),C=u.useRef(null),k=pF(r,b),j=u.useRef(()=>{}),_=u.useCallback(()=>{var D;!t||!y.current||!x.current||((D=j.current)==null||D.call(j),C.current=xz(y.current,x.current,{placement:k,modifiers:[uF,iF,aF,{...sF,enabled:!!v},{name:"eventListeners",...oF(i)},{name:"arrow",options:{padding:s}},{name:"offset",options:{offset:c??[0,f]}},{name:"flip",enabled:!!p,options:{padding:8}},{name:"preventOverflow",enabled:!!m,options:{boundary:h}},...n??[]],strategy:o}),C.current.forceUpdate(),j.current=C.current.destroy)},[k,t,n,v,i,s,c,f,p,m,h,o]);u.useEffect(()=>()=>{var D;!y.current&&!x.current&&((D=C.current)==null||D.destroy(),C.current=null)},[]);const I=u.useCallback(D=>{y.current=D,_()},[_]),O=u.useCallback((D={},T=null)=>({...D,ref:cn(I,T)}),[I]),E=u.useCallback(D=>{x.current=D,_()},[_]),M=u.useCallback((D={},T=null)=>({...D,ref:cn(E,T),style:{...D.style,position:o,minWidth:v?void 0:"max-content",inset:"0 auto auto 0"}}),[o,E,v]),R=u.useCallback((D={},T=null)=>{const{size:K,shadowColor:B,bg:G,style:Q,...V}=D;return{...V,ref:T,"data-popper-arrow":"",style:yz(D)}},[]),A=u.useCallback((D={},T=null)=>({...D,ref:T,"data-popper-arrow-inner":""}),[]);return{update(){var D;(D=C.current)==null||D.update()},forceUpdate(){var D;(D=C.current)==null||D.forceUpdate()},transformOrigin:Ir.transformOrigin.varRef,referenceRef:I,popperRef:E,getPopperProps:M,getArrowProps:R,getArrowInnerProps:A,getReferenceProps:O}}function yz(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 Kx(e={}){const{onClose:t,onOpen:n,isOpen:r,id:o}=e,s=sr(n),i=sr(t),[c,f]=u.useState(e.defaultIsOpen||!1),p=r!==void 0?r:c,h=r!==void 0,m=u.useId(),v=o??`disclosure-${m}`,b=u.useCallback(()=>{h||f(!1),i==null||i()},[h,i]),y=u.useCallback(()=>{h||f(!0),s==null||s()},[h,s]),x=u.useCallback(()=>{p?b():y()},[p,y,b]);function C(j={}){return{...j,"aria-expanded":p,"aria-controls":v,onClick(_){var I;(I=j.onClick)==null||I.call(j,_),x()}}}function k(j={}){return{...j,hidden:!p,id:v}}return{isOpen:p,onOpen:y,onClose:b,onToggle:x,isControlled:h,getButtonProps:C,getDisclosureProps:k}}function wz(e){const{ref:t,handler:n,enabled:r=!0}=e,o=sr(n),i=u.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}).current;u.useEffect(()=>{if(!r)return;const c=m=>{jv(m,t)&&(i.isPointerDown=!0)},f=m=>{if(i.ignoreEmulatedMouseEvents){i.ignoreEmulatedMouseEvents=!1;return}i.isPointerDown&&n&&jv(m,t)&&(i.isPointerDown=!1,o(m))},p=m=>{i.ignoreEmulatedMouseEvents=!0,n&&i.isPointerDown&&jv(m,t)&&(i.isPointerDown=!1,o(m))},h=tP(t.current);return h.addEventListener("mousedown",c,!0),h.addEventListener("mouseup",f,!0),h.addEventListener("touchstart",c,!0),h.addEventListener("touchend",p,!0),()=>{h.removeEventListener("mousedown",c,!0),h.removeEventListener("mouseup",f,!0),h.removeEventListener("touchstart",c,!0),h.removeEventListener("touchend",p,!0)}},[n,t,o,i,r])}function jv(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]=u.useState(t),[s,i]=u.useState(!1);return u.useEffect(()=>{s||(o(t),i(!0))},[t,s,r]),wl(()=>n.current,"animationend",()=>{o(t)}),{present:!(t?!1:!r),onComplete(){var f;const p=kL(n.current),h=new p.CustomEvent("animationend",{bubbles:!0});(f=n.current)==null||f.dispatchEvent(h)}}}function Xx(e){const{wasSelected:t,enabled:n,isSelected:r,mode:o="unmount"}=e;return!!(!n||r||o==="keepMounted"&&t)}var[Cz,Sz,kz,jz]=vx(),[_z,xf]=Dn({strict:!1,name:"MenuContext"});function Pz(e,...t){const n=u.useId(),r=e||n;return u.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 gS(e){return rP(e).activeElement===e}function Iz(e={}){const{id:t,closeOnSelect:n=!0,closeOnBlur:r=!0,initialFocusRef:o,autoSelect:s=!0,isLazy:i,isOpen:c,defaultIsOpen:f,onClose:p,onOpen:h,placement:m="bottom-start",lazyBehavior:v="unmount",direction:b,computePositionOnMount:y=!1,...x}=e,C=u.useRef(null),k=u.useRef(null),j=kz(),_=u.useCallback(()=>{requestAnimationFrame(()=>{var ce;(ce=C.current)==null||ce.focus({preventScroll:!1})})},[]),I=u.useCallback(()=>{const ce=setTimeout(()=>{var ae;if(o)(ae=o.current)==null||ae.focus();else{const U=j.firstEnabled();U&&B(U.index)}});X.current.add(ce)},[j,o]),O=u.useCallback(()=>{const ce=setTimeout(()=>{const ae=j.lastEnabled();ae&&B(ae.index)});X.current.add(ce)},[j]),E=u.useCallback(()=>{h==null||h(),s?I():_()},[s,I,_,h]),{isOpen:M,onOpen:R,onClose:A,onToggle:D}=Kx({isOpen:c,defaultIsOpen:f,onClose:p,onOpen:E});wz({enabled:M&&r,ref:C,handler:ce=>{var ae;(ae=k.current)!=null&&ae.contains(ce.target)||A()}});const T=qx({...x,enabled:M||y,placement:m,direction:b}),[K,B]=u.useState(-1);fi(()=>{M||B(-1)},[M]),U5(C,{focusRef:k,visible:M,shouldFocus:!0});const G=nP({isOpen:M,ref:C}),[Q,V]=Pz(t,"menu-button","menu-list"),L=u.useCallback(()=>{R(),_()},[R,_]),X=u.useRef(new Set([]));Tz(()=>{X.current.forEach(ce=>clearTimeout(ce)),X.current.clear()});const F=u.useCallback(()=>{R(),I()},[I,R]),q=u.useCallback(()=>{R(),O()},[R,O]),te=u.useCallback(()=>{var ce,ae;const U=rP(C.current),W=(ce=C.current)==null?void 0:ce.contains(U.activeElement);if(!(M&&!W))return;const ie=(ae=j.item(K))==null?void 0:ae.node;ie==null||ie.focus()},[M,K,j]),Y=u.useRef(null);return{openAndFocusMenu:L,openAndFocusFirstItem:F,openAndFocusLastItem:q,onTransitionEnd:te,unstable__animationState:G,descendants:j,popper:T,buttonId:Q,menuId:V,forceUpdate:T.forceUpdate,orientation:"vertical",isOpen:M,onToggle:D,onOpen:R,onClose:A,menuRef:C,buttonRef:k,focusedIndex:K,closeOnSelect:n,closeOnBlur:r,autoSelect:s,setFocusedIndex:B,isLazy:i,lazyBehavior:v,initialFocusRef:o,rafId:Y}}function Ez(e={},t=null){const n=xf(),{onToggle:r,popper:o,openAndFocusFirstItem:s,openAndFocusLastItem:i}=n,c=u.useCallback(f=>{const p=f.key,m={Enter:s,ArrowDown:s,ArrowUp:i}[p];m&&(f.preventDefault(),f.stopPropagation(),m(f))},[s,i]);return{...e,ref:cn(n.buttonRef,t,o.referenceRef),id:n.buttonId,"data-active":Ht(n.isOpen),"aria-expanded":n.isOpen,"aria-haspopup":"menu","aria-controls":n.menuId,onClick:rt(e.onClick,r),onKeyDown:rt(e.onKeyDown,c)}}function K1(e){var t;return Az(e)&&!!((t=e==null?void 0:e.getAttribute("role"))!=null&&t.startsWith("menuitem"))}function Oz(e={},t=null){const n=xf();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:c,menuId:f,isLazy:p,lazyBehavior:h,unstable__animationState:m}=n,v=Sz(),b=KL({preventDefault:k=>k.key!==" "&&K1(k.target)}),y=u.useCallback(k=>{if(!k.currentTarget.contains(k.target))return;const j=k.key,I={Tab:E=>E.preventDefault(),Escape:c,ArrowDown:()=>{const E=v.nextEnabled(r);E&&o(E.index)},ArrowUp:()=>{const E=v.prevEnabled(r);E&&o(E.index)}}[j];if(I){k.preventDefault(),I(k);return}const O=b(E=>{const M=XL(v.values(),E,R=>{var A,D;return(D=(A=R==null?void 0:R.node)==null?void 0:A.textContent)!=null?D:""},v.item(r));if(M){const R=v.indexOf(M.node);o(R)}});K1(k.target)&&O(k)},[v,r,b,c,o]),x=u.useRef(!1);i&&(x.current=!0);const C=Xx({wasSelected:x.current,enabled:p,mode:h,isSelected:m.present});return{...e,ref:cn(s,t),children:C?e.children:null,tabIndex:-1,role:"menu",id:f,style:{...e.style,transformOrigin:"var(--popper-transform-origin)"},"aria-orientation":"vertical",onKeyDown:rt(e.onKeyDown,y)}}function Mz(e={}){const{popper:t,isOpen:n}=xf();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:c,isFocusable:f,closeOnSelect:p,type:h,...m}=e,v=xf(),{setFocusedIndex:b,focusedIndex:y,closeOnSelect:x,onClose:C,menuRef:k,isOpen:j,menuId:_,rafId:I}=v,O=u.useRef(null),E=`${_}-menuitem-${u.useId()}`,{index:M,register:R}=jz({disabled:c&&!f}),A=u.useCallback(L=>{n==null||n(L),!c&&b(M)},[b,M,c,n]),D=u.useCallback(L=>{r==null||r(L),O.current&&!gS(O.current)&&A(L)},[A,r]),T=u.useCallback(L=>{o==null||o(L),!c&&b(-1)},[b,c,o]),K=u.useCallback(L=>{s==null||s(L),K1(L.currentTarget)&&(p??x)&&C()},[C,s,x,p]),B=u.useCallback(L=>{i==null||i(L),b(M)},[b,i,M]),G=M===y,Q=c&&!f;fi(()=>{j&&(G&&!Q&&O.current?(I.current&&cancelAnimationFrame(I.current),I.current=requestAnimationFrame(()=>{var L;(L=O.current)==null||L.focus(),I.current=null})):k.current&&!gS(k.current)&&k.current.focus({preventScroll:!0}))},[G,Q,k,j]);const V=V5({onClick:K,onFocus:B,onMouseEnter:A,onMouseMove:D,onMouseLeave:T,ref:cn(R,O,t),isDisabled:c,isFocusable:f});return{...m,...V,type:h??V.type,id:E,role:"menuitem",tabIndex:G?0:-1}}function Rz(e={},t=null){const{type:n="radio",isChecked:r,...o}=e;return{...oP(o,t),role:`menuitem${n}`,"aria-checked":r}}function Dz(e={}){const{children:t,type:n="radio",value:r,defaultValue:o,onChange:s,...i}=e,f=n==="radio"?"":[],[p,h]=ku({defaultValue:o??f,value:r,onChange:s}),m=u.useCallback(y=>{if(n==="radio"&&typeof p=="string"&&h(y),n==="checkbox"&&Array.isArray(p)){const x=p.includes(y)?p.filter(C=>C!==y):p.concat(y);h(x)}},[p,h,n]),b=pf(t).map(y=>{if(y.type.id!=="MenuItemOption")return y;const x=k=>{var j,_;m(y.props.value),(_=(j=y.props).onClick)==null||_.call(j,k)},C=n==="radio"?y.props.value===p:p.includes(y.props.value);return u.cloneElement(y,{type:n,onClick:x,isChecked:C})});return{...i,children:b}}function Az(e){var t;if(!Nz(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function Nz(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Tz(e,t=[]){return u.useEffect(()=>()=>e(),t)}var[$z,Pu]=Dn({name:"MenuStylesContext",errorMessage:`useMenuStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Menu />" `}),yf=e=>{const{children:t}=e,n=Vr("Menu",e),r=Jn(e),{direction:o}=sf(),{descendants:s,...i}=Iz({...r,direction:o}),c=u.useMemo(()=>i,[i]),{isOpen:f,onClose:p,forceUpdate:h}=c;return a.jsx(Cz,{value:s,children:a.jsx(_z,{value:c,children:a.jsx($z,{value:n,children:Zb(t,{isOpen:f,onClose:p,forceUpdate:h})})})})};yf.displayName="Menu";var sP=Te((e,t)=>{const n=Pu();return a.jsx(Me.span,{ref:t,...e,__css:n.command,className:"chakra-menu__command"})});sP.displayName="MenuCommand";var aP=Te((e,t)=>{const{type:n,...r}=e,o=Pu(),s=r.as||n?n??void 0:"button",i=u.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(Me.button,{ref:t,type:s,...r,__css:i})}),Qx=e=>{const{className:t,children:n,...r}=e,o=Pu(),s=u.Children.only(n),i=u.isValidElement(s)?u.cloneElement(s,{focusable:"false","aria-hidden":!0,className:_t("chakra-menu__icon",s.props.className)}):null,c=_t("chakra-menu__icon-wrapper",t);return a.jsx(Me.span,{className:c,...r,__css:o.icon,children:i})};Qx.displayName="MenuIcon";var Bn=Te((e,t)=>{const{icon:n,iconSpacing:r="0.75rem",command:o,commandSpacing:s="0.75rem",children:i,...c}=e,f=oP(c,t),h=n||o?a.jsx("span",{style:{pointerEvents:"none",flex:1},children:i}):i;return a.jsxs(aP,{...f,className:_t("chakra-menu__menuitem",f.className),children:[n&&a.jsx(Qx,{fontSize:"0.8em",marginEnd:r,children:n}),h,o&&a.jsx(sP,{marginStart:s,children:o})]})});Bn.displayName="MenuItem";var Lz={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"}}},Fz=Me(yr.div),Ui=Te(function(t,n){var r,o;const{rootProps:s,motionProps:i,...c}=t,{isOpen:f,onTransitionEnd:p,unstable__animationState:h}=xf(),m=Oz(c,n),v=Mz(s),b=Pu();return a.jsx(Me.div,{...v,__css:{zIndex:(o=t.zIndex)!=null?o:(r=b.list)==null?void 0:r.zIndex},children:a.jsx(Fz,{variants:Lz,initial:!1,animate:f?"enter":"exit",__css:{outline:0,...b.list},...i,className:_t("chakra-menu__menu-list",m.className),...m,onUpdate:p,onAnimationComplete:Lm(h.onComplete,m.onAnimationComplete)})})});Ui.displayName="MenuList";var fu=Te((e,t)=>{const{title:n,children:r,className:o,...s}=e,i=_t("chakra-menu__group__title",o),c=Pu();return a.jsxs("div",{ref:t,className:"chakra-menu__group",role:"group",children:[n&&a.jsx(Me.p,{className:i,...s,__css:c.groupTitle,children:n}),r]})});fu.displayName="MenuGroup";var iP=e=>{const{className:t,title:n,...r}=e,o=Dz(r);return a.jsx(fu,{title:n,className:_t("chakra-menu__option-group",t),...o})};iP.displayName="MenuOptionGroup";var zz=Te((e,t)=>{const n=Pu();return a.jsx(Me.button,{ref:t,...e,__css:{display:"inline-flex",appearance:"none",alignItems:"center",outline:0,...n.button}})}),wf=Te((e,t)=>{const{children:n,as:r,...o}=e,s=Ez(o,t),i=r||zz;return a.jsx(i,{...s,className:_t("chakra-menu__menu-button",e.className),children:a.jsx(Me.span,{__css:{pointerEvents:"none",flex:"1 1 auto",minW:0},children:e.children})})});wf.displayName="MenuButton";var Bz=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"})}),Dh=Te((e,t)=>{const{icon:n,iconSpacing:r="0.75rem",...o}=e,s=Rz(o,t);return a.jsxs(aP,{...s,className:_t("chakra-menu__menuitem-option",o.className),children:[n!==null&&a.jsx(Qx,{fontSize:"0.8em",marginEnd:r,opacity:e.isChecked?1:0,children:n||a.jsx(Bz,{})}),a.jsx("span",{style:{flex:1},children:s.children})]})});Dh.id="MenuItemOption";Dh.displayName="MenuItemOption";var Hz={slideInBottom:{...A1,custom:{offsetY:16,reverse:!0}},slideInRight:{...A1,custom:{offsetX:16,reverse:!0}},scale:{...$3,custom:{initialScale:.95,reverse:!0}},none:{}},Wz=Me(yr.section),Vz=e=>Hz[e||"none"],lP=u.forwardRef((e,t)=>{const{preset:n,motionProps:r=Vz(n),...o}=e;return a.jsx(Wz,{ref:t,...r,...o})});lP.displayName="ModalTransition";var Uz=Object.defineProperty,Gz=(e,t,n)=>t in e?Uz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qz=(e,t,n)=>(Gz(e,typeof t!="symbol"?t+"":t,n),n),Kz=class{constructor(){qz(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}},X1=new Kz;function cP(e,t){const[n,r]=u.useState(0);return u.useEffect(()=>{const o=e.current;if(o){if(t){const s=X1.add(o);r(s)}return()=>{X1.remove(o),r(0)}}},[t,e]),n}var Xz=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},gc=new WeakMap,kp=new WeakMap,jp={},_v=0,uP=function(e){return e&&(e.host||uP(e.parentNode))},Qz=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})},Yz=function(e,t,n,r){var o=Qz(t,Array.isArray(e)?e:[e]);jp[n]||(jp[n]=new WeakMap);var s=jp[n],i=[],c=new Set,f=new Set(o),p=function(m){!m||c.has(m)||(c.add(m),p(m.parentNode))};o.forEach(p);var h=function(m){!m||f.has(m)||Array.prototype.forEach.call(m.children,function(v){if(c.has(v))h(v);else{var b=v.getAttribute(r),y=b!==null&&b!=="false",x=(gc.get(v)||0)+1,C=(s.get(v)||0)+1;gc.set(v,x),s.set(v,C),i.push(v),x===1&&y&&kp.set(v,!0),C===1&&v.setAttribute(n,"true"),y||v.setAttribute(r,"true")}})};return h(t),c.clear(),_v++,function(){i.forEach(function(m){var v=gc.get(m)-1,b=s.get(m)-1;gc.set(m,v),s.set(m,b),v||(kp.has(m)||m.removeAttribute(r),kp.delete(m)),b||m.removeAttribute(n)}),_v--,_v||(gc=new WeakMap,gc=new WeakMap,kp=new WeakMap,jp={})}},Jz=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||Xz(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),Yz(r,o,n,"aria-hidden")):function(){return null}};function Zz(e){const{isOpen:t,onClose:n,id:r,closeOnOverlayClick:o=!0,closeOnEsc:s=!0,useInert:i=!0,onOverlayClick:c,onEsc:f}=e,p=u.useRef(null),h=u.useRef(null),[m,v,b]=tB(r,"chakra-modal","chakra-modal--header","chakra-modal--body");eB(p,t&&i);const y=cP(p,t),x=u.useRef(null),C=u.useCallback(A=>{x.current=A.target},[]),k=u.useCallback(A=>{A.key==="Escape"&&(A.stopPropagation(),s&&(n==null||n()),f==null||f())},[s,n,f]),[j,_]=u.useState(!1),[I,O]=u.useState(!1),E=u.useCallback((A={},D=null)=>({role:"dialog",...A,ref:cn(D,p),id:m,tabIndex:-1,"aria-modal":!0,"aria-labelledby":j?v:void 0,"aria-describedby":I?b:void 0,onClick:rt(A.onClick,T=>T.stopPropagation())}),[b,I,m,v,j]),M=u.useCallback(A=>{A.stopPropagation(),x.current===A.target&&X1.isTopModal(p.current)&&(o&&(n==null||n()),c==null||c())},[n,o,c]),R=u.useCallback((A={},D=null)=>({...A,ref:cn(D,h),onClick:rt(A.onClick,M),onKeyDown:rt(A.onKeyDown,k),onMouseDown:rt(A.onMouseDown,C)}),[k,C,M]);return{isOpen:t,onClose:n,headerId:v,bodyId:b,setBodyMounted:O,setHeaderMounted:_,dialogRef:p,overlayRef:h,getDialogProps:E,getDialogContainerProps:R,index:y}}function eB(e,t){const n=e.current;u.useEffect(()=>{if(!(!e.current||!t))return Jz(e.current)},[t,e,n])}function tB(e,...t){const n=u.useId(),r=e||n;return u.useMemo(()=>t.map(o=>`${o}-${r}`),[r,t])}var[nB,Iu]=Dn({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Modal />" `}),[rB,Nl]=Dn({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in `<Modal />`"}),Tl=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:c,returnFocusOnClose:f,blockScrollOnMount:p,allowPinchZoom:h,preserveScrollBarGap:m,motionPreset:v,lockFocusAcrossFrames:b,onCloseComplete:y}=t,x=Vr("Modal",t),k={...Zz(t),autoFocus:o,trapFocus:s,initialFocusRef:i,finalFocusRef:c,returnFocusOnClose:f,blockScrollOnMount:p,allowPinchZoom:h,preserveScrollBarGap:m,motionPreset:v,lockFocusAcrossFrames:b};return a.jsx(rB,{value:k,children:a.jsx(nB,{value:x,children:a.jsx(co,{onExitComplete:y,children:k.isOpen&&a.jsx(uf,{...n,children:r})})})})};Tl.displayName="Modal";var ah="right-scroll-bar-position",ih="width-before-scroll-bar",oB="with-scroll-bars-hidden",sB="--removed-body-scroll-bar-size",dP=a5(),Pv=function(){},sg=u.forwardRef(function(e,t){var n=u.useRef(null),r=u.useState({onScrollCapture:Pv,onWheelCapture:Pv,onTouchMoveCapture:Pv}),o=r[0],s=r[1],i=e.forwardProps,c=e.children,f=e.className,p=e.removeScrollBar,h=e.enabled,m=e.shards,v=e.sideCar,b=e.noIsolation,y=e.inert,x=e.allowPinchZoom,C=e.as,k=C===void 0?"div":C,j=e.gapMode,_=r5(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),I=v,O=n5([n,t]),E=ba(ba({},_),o);return u.createElement(u.Fragment,null,h&&u.createElement(I,{sideCar:dP,removeScrollBar:p,shards:m,noIsolation:b,inert:y,setCallbacks:s,allowPinchZoom:!!x,lockRef:n,gapMode:j}),i?u.cloneElement(u.Children.only(c),ba(ba({},E),{ref:O})):u.createElement(k,ba({},E,{className:f,ref:O}),c))});sg.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};sg.classNames={fullWidth:ih,zeroRight:ah};var vS,aB=function(){if(vS)return vS;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function iB(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=aB();return t&&e.setAttribute("nonce",t),e}function lB(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function cB(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var uB=function(){var e=0,t=null;return{add:function(n){e==0&&(t=iB())&&(lB(t,n),cB(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},dB=function(){var e=uB();return function(t,n){u.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},fP=function(){var e=dB(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},fB={left:0,top:0,right:0,gap:0},Iv=function(e){return parseInt(e||"",10)||0},pB=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[Iv(n),Iv(r),Iv(o)]},hB=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return fB;var t=pB(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])}},mB=fP(),gB=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,c=e.gap;return n===void 0&&(n="margin"),`
.`.concat(oB,` {
overflow: hidden `).concat(r,`;
padding-right: `).concat(c,"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(c,"px ").concat(r,`;
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
}
.`).concat(ah,` {
right: `).concat(c,"px ").concat(r,`;
}
.`).concat(ih,` {
margin-right: `).concat(c,"px ").concat(r,`;
}
.`).concat(ah," .").concat(ah,` {
right: 0 `).concat(r,`;
}
.`).concat(ih," .").concat(ih,` {
margin-right: 0 `).concat(r,`;
}
body {
`).concat(sB,": ").concat(c,`px;
}
`)},vB=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,s=u.useMemo(function(){return hB(o)},[o]);return u.createElement(mB,{styles:gB(s,!t,o,n?"":"!important")})},Q1=!1;if(typeof window<"u")try{var _p=Object.defineProperty({},"passive",{get:function(){return Q1=!0,!0}});window.addEventListener("test",_p,_p),window.removeEventListener("test",_p,_p)}catch{Q1=!1}var vc=Q1?{passive:!1}:!1,bB=function(e){return e.tagName==="TEXTAREA"},pP=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!bB(e)&&n[t]==="visible")},xB=function(e){return pP(e,"overflowY")},yB=function(e){return pP(e,"overflowX")},bS=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],c=s[2];if(i>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},wB=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},CB=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},hP=function(e,t){return e==="v"?xB(t):yB(t)},mP=function(e,t){return e==="v"?wB(t):CB(t)},SB=function(e,t){return e==="h"&&t==="rtl"?-1:1},kB=function(e,t,n,r,o){var s=SB(e,window.getComputedStyle(t).direction),i=s*r,c=n.target,f=t.contains(c),p=!1,h=i>0,m=0,v=0;do{var b=mP(e,c),y=b[0],x=b[1],C=b[2],k=x-C-s*y;(y||k)&&hP(e,c)&&(m+=k,v+=y),c=c.parentNode}while(!f&&c!==document.body||f&&(t.contains(c)||t===c));return(h&&(o&&m===0||!o&&i>m)||!h&&(o&&v===0||!o&&-i>v))&&(p=!0),p},Pp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},xS=function(e){return[e.deltaX,e.deltaY]},yS=function(e){return e&&"current"in e?e.current:e},jB=function(e,t){return e[0]===t[0]&&e[1]===t[1]},_B=function(e){return`
.block-interactivity-`.concat(e,` {pointer-events: none;}
.allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},PB=0,bc=[];function IB(e){var t=u.useRef([]),n=u.useRef([0,0]),r=u.useRef(),o=u.useState(PB++)[0],s=u.useState(fP)[0],i=u.useRef(e);u.useEffect(function(){i.current=e},[e]),u.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var x=B1([e.lockRef.current],(e.shards||[]).map(yS),!0).filter(Boolean);return x.forEach(function(C){return C.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),x.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var c=u.useCallback(function(x,C){if("touches"in x&&x.touches.length===2)return!i.current.allowPinchZoom;var k=Pp(x),j=n.current,_="deltaX"in x?x.deltaX:j[0]-k[0],I="deltaY"in x?x.deltaY:j[1]-k[1],O,E=x.target,M=Math.abs(_)>Math.abs(I)?"h":"v";if("touches"in x&&M==="h"&&E.type==="range")return!1;var R=bS(M,E);if(!R)return!0;if(R?O=M:(O=M==="v"?"h":"v",R=bS(M,E)),!R)return!1;if(!r.current&&"changedTouches"in x&&(_||I)&&(r.current=O),!O)return!0;var A=r.current||O;return kB(A,C,x,A==="h"?_:I,!0)},[]),f=u.useCallback(function(x){var C=x;if(!(!bc.length||bc[bc.length-1]!==s)){var k="deltaY"in C?xS(C):Pp(C),j=t.current.filter(function(O){return O.name===C.type&&O.target===C.target&&jB(O.delta,k)})[0];if(j&&j.should){C.cancelable&&C.preventDefault();return}if(!j){var _=(i.current.shards||[]).map(yS).filter(Boolean).filter(function(O){return O.contains(C.target)}),I=_.length>0?c(C,_[0]):!i.current.noIsolation;I&&C.cancelable&&C.preventDefault()}}},[]),p=u.useCallback(function(x,C,k,j){var _={name:x,delta:C,target:k,should:j};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(I){return I!==_})},1)},[]),h=u.useCallback(function(x){n.current=Pp(x),r.current=void 0},[]),m=u.useCallback(function(x){p(x.type,xS(x),x.target,c(x,e.lockRef.current))},[]),v=u.useCallback(function(x){p(x.type,Pp(x),x.target,c(x,e.lockRef.current))},[]);u.useEffect(function(){return bc.push(s),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:v}),document.addEventListener("wheel",f,vc),document.addEventListener("touchmove",f,vc),document.addEventListener("touchstart",h,vc),function(){bc=bc.filter(function(x){return x!==s}),document.removeEventListener("wheel",f,vc),document.removeEventListener("touchmove",f,vc),document.removeEventListener("touchstart",h,vc)}},[]);var b=e.removeScrollBar,y=e.inert;return u.createElement(u.Fragment,null,y?u.createElement(s,{styles:_B(o)}):null,b?u.createElement(vB,{gapMode:e.gapMode}):null)}const EB=P$(dP,IB);var gP=u.forwardRef(function(e,t){return u.createElement(sg,ba({},e,{ref:t,sideCar:EB}))});gP.classNames=sg.classNames;const OB=gP;function MB(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:o,blockScrollOnMount:s,allowPinchZoom:i,finalFocusRef:c,returnFocusOnClose:f,preserveScrollBarGap:p,lockFocusAcrossFrames:h,isOpen:m}=Nl(),[v,b]=E7();u.useEffect(()=>{!v&&b&&setTimeout(b)},[v,b]);const y=cP(r,m);return a.jsx($5,{autoFocus:t,isDisabled:!n,initialFocusRef:o,finalFocusRef:c,restoreFocus:f,contentRef:r,lockFocusAcrossFrames:h,children:a.jsx(OB,{removeScrollBar:!p,allowPinchZoom:i,enabled:y===1&&s,forwardProps:!0,children:e.children})})}var $l=Te((e,t)=>{const{className:n,children:r,containerProps:o,motionProps:s,...i}=e,{getDialogProps:c,getDialogContainerProps:f}=Nl(),p=c(i,t),h=f(o),m=_t("chakra-modal__content",n),v=Iu(),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}=Nl();return a.jsx(MB,{children:a.jsx(Me.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})})})});$l.displayName="ModalContent";function Cf(e){const{leastDestructiveRef:t,...n}=e;return a.jsx(Tl,{...n,initialFocusRef:t})}var Sf=Te((e,t)=>a.jsx($l,{ref:t,role:"alertdialog",...e})),ka=Te((e,t)=>{const{className:n,...r}=e,o=_t("chakra-modal__footer",n),i={display:"flex",alignItems:"center",justifyContent:"flex-end",...Iu().footer};return a.jsx(Me.footer,{ref:t,...r,__css:i,className:o})});ka.displayName="ModalFooter";var qs=Te((e,t)=>{const{className:n,...r}=e,{headerId:o,setHeaderMounted:s}=Nl();u.useEffect(()=>(s(!0),()=>s(!1)),[s]);const i=_t("chakra-modal__header",n),f={flex:0,...Iu().header};return a.jsx(Me.header,{ref:t,className:i,id:o,...r,__css:f})});qs.displayName="ModalHeader";var RB=Me(yr.div),Ks=Te((e,t)=>{const{className:n,transition:r,motionProps:o,...s}=e,i=_t("chakra-modal__overlay",n),f={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...Iu().overlay},{motionPreset:p}=Nl(),m=o||(p==="none"?{}:T3);return a.jsx(RB,{...m,__css:f,ref:t,className:i,...s})});Ks.displayName="ModalOverlay";var Xs=Te((e,t)=>{const{className:n,...r}=e,{bodyId:o,setBodyMounted:s}=Nl();u.useEffect(()=>(s(!0),()=>s(!1)),[s]);const i=_t("chakra-modal__body",n),c=Iu();return a.jsx(Me.div,{ref:t,className:i,id:o,...r,__css:c.body})});Xs.displayName="ModalBody";var kf=Te((e,t)=>{const{onClick:n,className:r,...o}=e,{onClose:s}=Nl(),i=_t("chakra-modal__close-btn",r),c=Iu();return a.jsx(i9,{ref:t,__css:c.closeButton,className:i,onClick:rt(n,f=>{f.stopPropagation(),s()}),...o})});kf.displayName="ModalCloseButton";var DB=e=>a.jsx(Tr,{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"})}),AB=e=>a.jsx(Tr,{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 wS(e,t,n,r){u.useEffect(()=>{var o;if(!e.current||!r)return;const s=(o=e.current.ownerDocument.defaultView)!=null?o:window,i=Array.isArray(t)?t:[t],c=new s.MutationObserver(f=>{for(const p of f)p.type==="attributes"&&p.attributeName&&i.includes(p.attributeName)&&n(p)});return c.observe(e.current,{attributes:!0,attributeFilter:i}),()=>c.disconnect()})}function NB(e,t){const n=sr(e);u.useEffect(()=>{let r=null;const o=()=>n();return t!==null&&(r=window.setInterval(o,t)),()=>{r&&window.clearInterval(r)}},[t,n])}var TB=50,CS=300;function $B(e,t){const[n,r]=u.useState(!1),[o,s]=u.useState(null),[i,c]=u.useState(!0),f=u.useRef(null),p=()=>clearTimeout(f.current);NB(()=>{o==="increment"&&e(),o==="decrement"&&t()},n?TB:null);const h=u.useCallback(()=>{i&&e(),f.current=setTimeout(()=>{c(!1),r(!0),s("increment")},CS)},[e,i]),m=u.useCallback(()=>{i&&t(),f.current=setTimeout(()=>{c(!1),r(!0),s("decrement")},CS)},[t,i]),v=u.useCallback(()=>{c(!0),r(!1),p()},[]);return u.useEffect(()=>()=>p(),[]),{up:h,down:m,stop:v,isSpinning:n}}var LB=/^[Ee0-9+\-.]$/;function FB(e){return LB.test(e)}function zB(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 BB(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:c,isDisabled:f,isRequired:p,isInvalid:h,pattern:m="[0-9]*(.[0-9]+)?",inputMode:v="decimal",allowMouseWheel:b,id:y,onChange:x,precision:C,name:k,"aria-describedby":j,"aria-label":_,"aria-labelledby":I,onFocus:O,onBlur:E,onInvalid:M,getAriaValueText:R,isValidCharacter:A,format:D,parse:T,...K}=e,B=sr(O),G=sr(E),Q=sr(M),V=sr(A??FB),L=sr(R),X=i$(e),{update:F,increment:q,decrement:te}=X,[Y,ce]=u.useState(!1),ae=!(c||f),U=u.useRef(null),W=u.useRef(null),ne=u.useRef(null),ie=u.useRef(null),oe=u.useCallback(we=>we.split("").filter(V).join(""),[V]),me=u.useCallback(we=>{var xt;return(xt=T==null?void 0:T(we))!=null?xt:we},[T]),fe=u.useCallback(we=>{var xt;return((xt=D==null?void 0:D(we))!=null?xt:we).toString()},[D]);fi(()=>{(X.valueAsNumber>s||X.valueAsNumber<o)&&(Q==null||Q("rangeOverflow",fe(X.value),X.valueAsNumber))},[X.valueAsNumber,X.value,fe,Q]),zc(()=>{if(!U.current)return;if(U.current.value!=X.value){const xt=me(U.current.value);X.setValue(oe(xt))}},[me,oe]);const he=u.useCallback((we=i)=>{ae&&q(we)},[q,ae,i]),Ce=u.useCallback((we=i)=>{ae&&te(we)},[te,ae,i]),xe=$B(he,Ce);wS(ne,"disabled",xe.stop,xe.isSpinning),wS(ie,"disabled",xe.stop,xe.isSpinning);const de=u.useCallback(we=>{if(we.nativeEvent.isComposing)return;const Nt=me(we.currentTarget.value);F(oe(Nt)),W.current={start:we.currentTarget.selectionStart,end:we.currentTarget.selectionEnd}},[F,oe,me]),Ne=u.useCallback(we=>{var xt,Nt,Lt;B==null||B(we),W.current&&(we.target.selectionStart=(Nt=W.current.start)!=null?Nt:(xt=we.currentTarget.value)==null?void 0:xt.length,we.currentTarget.selectionEnd=(Lt=W.current.end)!=null?Lt:we.currentTarget.selectionStart)},[B]),De=u.useCallback(we=>{if(we.nativeEvent.isComposing)return;zB(we,V)||we.preventDefault();const xt=Xe(we)*i,Nt=we.key,$e={ArrowUp:()=>he(xt),ArrowDown:()=>Ce(xt),Home:()=>F(o),End:()=>F(s)}[Nt];$e&&(we.preventDefault(),$e(we))},[V,i,he,Ce,F,o,s]),Xe=we=>{let xt=1;return(we.metaKey||we.ctrlKey)&&(xt=.1),we.shiftKey&&(xt=10),xt},It=u.useMemo(()=>{const we=L==null?void 0:L(X.value);if(we!=null)return we;const xt=X.value.toString();return xt||void 0},[X.value,L]),lt=u.useCallback(()=>{let we=X.value;if(X.value==="")return;/^[eE]/.test(X.value.toString())?X.setValue(""):(X.valueAsNumber<o&&(we=o),X.valueAsNumber>s&&(we=s),X.cast(we))},[X,s,o]),on=u.useCallback(()=>{ce(!1),n&&lt()},[n,ce,lt]),gt=u.useCallback(()=>{t&&requestAnimationFrame(()=>{var we;(we=U.current)==null||we.focus()})},[t]),bt=u.useCallback(we=>{we.preventDefault(),xe.up(),gt()},[gt,xe]),ye=u.useCallback(we=>{we.preventDefault(),xe.down(),gt()},[gt,xe]);wl(()=>U.current,"wheel",we=>{var xt,Nt;const $e=((Nt=(xt=U.current)==null?void 0:xt.ownerDocument)!=null?Nt:document).activeElement===U.current;if(!b||!$e)return;we.preventDefault();const Ke=Xe(we)*i,vn=Math.sign(we.deltaY);vn===-1?he(Ke):vn===1&&Ce(Ke)},{passive:!1});const We=u.useCallback((we={},xt=null)=>{const Nt=f||r&&X.isAtMax;return{...we,ref:cn(xt,ne),role:"button",tabIndex:-1,onPointerDown:rt(we.onPointerDown,Lt=>{Lt.button!==0||Nt||bt(Lt)}),onPointerLeave:rt(we.onPointerLeave,xe.stop),onPointerUp:rt(we.onPointerUp,xe.stop),disabled:Nt,"aria-disabled":gs(Nt)}},[X.isAtMax,r,bt,xe.stop,f]),Et=u.useCallback((we={},xt=null)=>{const Nt=f||r&&X.isAtMin;return{...we,ref:cn(xt,ie),role:"button",tabIndex:-1,onPointerDown:rt(we.onPointerDown,Lt=>{Lt.button!==0||Nt||ye(Lt)}),onPointerLeave:rt(we.onPointerLeave,xe.stop),onPointerUp:rt(we.onPointerUp,xe.stop),disabled:Nt,"aria-disabled":gs(Nt)}},[X.isAtMin,r,ye,xe.stop,f]),zt=u.useCallback((we={},xt=null)=>{var Nt,Lt,$e,Ke;return{name:k,inputMode:v,type:"text",pattern:m,"aria-labelledby":I,"aria-label":_,"aria-describedby":j,id:y,disabled:f,...we,readOnly:(Nt=we.readOnly)!=null?Nt:c,"aria-readonly":(Lt=we.readOnly)!=null?Lt:c,"aria-required":($e=we.required)!=null?$e:p,required:(Ke=we.required)!=null?Ke:p,ref:cn(U,xt),value:fe(X.value),role:"spinbutton","aria-valuemin":o,"aria-valuemax":s,"aria-valuenow":Number.isNaN(X.valueAsNumber)?void 0:X.valueAsNumber,"aria-invalid":gs(h??X.isOutOfRange),"aria-valuetext":It,autoComplete:"off",autoCorrect:"off",onChange:rt(we.onChange,de),onKeyDown:rt(we.onKeyDown,De),onFocus:rt(we.onFocus,Ne,()=>ce(!0)),onBlur:rt(we.onBlur,G,on)}},[k,v,m,I,_,fe,j,y,f,p,c,h,X.value,X.valueAsNumber,X.isOutOfRange,o,s,It,de,De,Ne,G,on]);return{value:fe(X.value),valueAsNumber:X.valueAsNumber,isFocused:Y,isDisabled:f,isReadOnly:c,getIncrementButtonProps:We,getDecrementButtonProps:Et,getInputProps:zt,htmlProps:K}}var[HB,ag]=Dn({name:"NumberInputStylesContext",errorMessage:`useNumberInputStyles returned is 'undefined'. Seems you forgot to wrap the components in "<NumberInput />" `}),[WB,Yx]=Dn({name:"NumberInputContext",errorMessage:"useNumberInputContext: `context` is undefined. Seems you forgot to wrap number-input's components within <NumberInput />"}),ig=Te(function(t,n){const r=Vr("NumberInput",t),o=Jn(t),s=wx(o),{htmlProps:i,...c}=BB(s),f=u.useMemo(()=>c,[c]);return a.jsx(WB,{value:f,children:a.jsx(HB,{value:r,children:a.jsx(Me.div,{...i,ref:n,className:_t("chakra-numberinput",t.className),__css:{position:"relative",zIndex:0,...r.root}})})})});ig.displayName="NumberInput";var lg=Te(function(t,n){const r=ag();return a.jsx(Me.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}})});lg.displayName="NumberInputStepper";var cg=Te(function(t,n){const{getInputProps:r}=Yx(),o=r(t,n),s=ag();return a.jsx(Me.input,{...o,className:_t("chakra-numberinput__field",t.className),__css:{width:"100%",...s.field}})});cg.displayName="NumberInputField";var vP=Me("div",{baseStyle:{display:"flex",justifyContent:"center",alignItems:"center",flex:1,transitionProperty:"common",transitionDuration:"normal",userSelect:"none",cursor:"pointer",lineHeight:"normal"}}),ug=Te(function(t,n){var r;const o=ag(),{getDecrementButtonProps:s}=Yx(),i=s(t,n);return a.jsx(vP,{...i,__css:o.stepper,children:(r=t.children)!=null?r:a.jsx(DB,{})})});ug.displayName="NumberDecrementStepper";var dg=Te(function(t,n){var r;const{getIncrementButtonProps:o}=Yx(),s=o(t,n),i=ag();return a.jsx(vP,{...s,__css:i.stepper,children:(r=t.children)!=null?r:a.jsx(AB,{})})});dg.displayName="NumberIncrementStepper";var[VB,Eu]=Dn({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within `<Popover />`"}),[UB,Jx]=Dn({name:"PopoverStylesContext",errorMessage:`usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Popover />" `});function Zx(e){const t=u.Children.only(e.children),{getTriggerProps:n}=Eu();return u.cloneElement(t,n(t.props,t.ref))}Zx.displayName="PopoverTrigger";var xc={click:"click",hover:"hover"};function GB(e={}){const{closeOnBlur:t=!0,closeOnEsc:n=!0,initialFocusRef:r,id:o,returnFocusOnClose:s=!0,autoFocus:i=!0,arrowSize:c,arrowShadowColor:f,trigger:p=xc.click,openDelay:h=200,closeDelay:m=200,isLazy:v,lazyBehavior:b="unmount",computePositionOnMount:y,...x}=e,{isOpen:C,onClose:k,onOpen:j,onToggle:_}=Kx(e),I=u.useRef(null),O=u.useRef(null),E=u.useRef(null),M=u.useRef(!1),R=u.useRef(!1);C&&(R.current=!0);const[A,D]=u.useState(!1),[T,K]=u.useState(!1),B=u.useId(),G=o??B,[Q,V,L,X]=["popover-trigger","popover-content","popover-header","popover-body"].map(de=>`${de}-${G}`),{referenceRef:F,getArrowProps:q,getPopperProps:te,getArrowInnerProps:Y,forceUpdate:ce}=qx({...x,enabled:C||!!y}),ae=nP({isOpen:C,ref:E});Q3({enabled:C,ref:O}),U5(E,{focusRef:O,visible:C,shouldFocus:s&&p===xc.click}),ZL(E,{focusRef:r,visible:C,shouldFocus:i&&p===xc.click});const U=Xx({wasSelected:R.current,enabled:v,mode:b,isSelected:ae.present}),W=u.useCallback((de={},Ne=null)=>{const De={...de,style:{...de.style,transformOrigin:Ir.transformOrigin.varRef,[Ir.arrowSize.var]:c?`${c}px`:void 0,[Ir.arrowShadowColor.var]:f},ref:cn(E,Ne),children:U?de.children:null,id:V,tabIndex:-1,role:"dialog",onKeyDown:rt(de.onKeyDown,Xe=>{n&&Xe.key==="Escape"&&k()}),onBlur:rt(de.onBlur,Xe=>{const It=SS(Xe),lt=Ev(E.current,It),on=Ev(O.current,It);C&&t&&(!lt&&!on)&&k()}),"aria-labelledby":A?L:void 0,"aria-describedby":T?X:void 0};return p===xc.hover&&(De.role="tooltip",De.onMouseEnter=rt(de.onMouseEnter,()=>{M.current=!0}),De.onMouseLeave=rt(de.onMouseLeave,Xe=>{Xe.nativeEvent.relatedTarget!==null&&(M.current=!1,setTimeout(()=>k(),m))})),De},[U,V,A,L,T,X,p,n,k,C,t,m,f,c]),ne=u.useCallback((de={},Ne=null)=>te({...de,style:{visibility:C?"visible":"hidden",...de.style}},Ne),[C,te]),ie=u.useCallback((de,Ne=null)=>({...de,ref:cn(Ne,I,F)}),[I,F]),oe=u.useRef(),me=u.useRef(),fe=u.useCallback(de=>{I.current==null&&F(de)},[F]),he=u.useCallback((de={},Ne=null)=>{const De={...de,ref:cn(O,Ne,fe),id:Q,"aria-haspopup":"dialog","aria-expanded":C,"aria-controls":V};return p===xc.click&&(De.onClick=rt(de.onClick,_)),p===xc.hover&&(De.onFocus=rt(de.onFocus,()=>{oe.current===void 0&&j()}),De.onBlur=rt(de.onBlur,Xe=>{const It=SS(Xe),lt=!Ev(E.current,It);C&&t&&lt&&k()}),De.onKeyDown=rt(de.onKeyDown,Xe=>{Xe.key==="Escape"&&k()}),De.onMouseEnter=rt(de.onMouseEnter,()=>{M.current=!0,oe.current=window.setTimeout(()=>j(),h)}),De.onMouseLeave=rt(de.onMouseLeave,()=>{M.current=!1,oe.current&&(clearTimeout(oe.current),oe.current=void 0),me.current=window.setTimeout(()=>{M.current===!1&&k()},m)})),De},[Q,C,V,p,fe,_,j,t,k,h,m]);u.useEffect(()=>()=>{oe.current&&clearTimeout(oe.current),me.current&&clearTimeout(me.current)},[]);const Ce=u.useCallback((de={},Ne=null)=>({...de,id:L,ref:cn(Ne,De=>{D(!!De)})}),[L]),xe=u.useCallback((de={},Ne=null)=>({...de,id:X,ref:cn(Ne,De=>{K(!!De)})}),[X]);return{forceUpdate:ce,isOpen:C,onAnimationComplete:ae.onComplete,onClose:k,getAnchorProps:ie,getArrowProps:q,getArrowInnerProps:Y,getPopoverPositionerProps:ne,getPopoverProps:W,getTriggerProps:he,getHeaderProps:Ce,getBodyProps:xe}}function Ev(e,t){return e===t||(e==null?void 0:e.contains(t))}function SS(e){var t;const n=e.currentTarget.ownerDocument.activeElement;return(t=e.relatedTarget)!=null?t:n}function fg(e){const t=Vr("Popover",e),{children:n,...r}=Jn(e),o=sf(),s=GB({...r,direction:o.direction});return a.jsx(VB,{value:s,children:a.jsx(UB,{value:t,children:Zb(n,{isOpen:s.isOpen,onClose:s.onClose,forceUpdate:s.forceUpdate})})})}fg.displayName="Popover";function bP(e){const t=u.Children.only(e.children),{getAnchorProps:n}=Eu();return u.cloneElement(t,n(t.props,t.ref))}bP.displayName="PopoverAnchor";var Ov=(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:c}=e,{getArrowProps:f,getArrowInnerProps:p}=Eu(),h=Jx(),m=(t=n??r)!=null?t:o,v=s??i;return a.jsx(Me.div,{...f(),className:"chakra-popover__arrow-positioner",children:a.jsx(Me.div,{className:_t("chakra-popover__arrow",e.className),...p(e),__css:{"--popper-arrow-shadow-color":Ov("colors",c),"--popper-arrow-bg":Ov("colors",m),"--popper-arrow-shadow":Ov("shadows",v),...h.arrow}})})}xP.displayName="PopoverArrow";var ey=Te(function(t,n){const{getBodyProps:r}=Eu(),o=Jx();return a.jsx(Me.div,{...r(t,n),className:_t("chakra-popover__body",t.className),__css:o.body})});ey.displayName="PopoverBody";function qB(e){if(e)return{enter:{...e.enter,visibility:"visible"},exit:{...e.exit,transitionEnd:{visibility:"hidden"}}}}var KB={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]}}},XB=Me(yr.section),yP=Te(function(t,n){const{variants:r=KB,...o}=t,{isOpen:s}=Eu();return a.jsx(XB,{ref:n,variants:qB(r),initial:!1,animate:s?"enter":"exit",...o})});yP.displayName="PopoverTransition";var pg=Te(function(t,n){const{rootProps:r,motionProps:o,...s}=t,{getPopoverProps:i,getPopoverPositionerProps:c,onAnimationComplete:f}=Eu(),p=Jx(),h={position:"relative",display:"flex",flexDirection:"column",...p.content};return a.jsx(Me.div,{...c(r),__css:p.popper,className:"chakra-popover__popper",children:a.jsx(yP,{...o,...i(s,n),onAnimationComplete:Lm(f,s.onAnimationComplete),className:_t("chakra-popover__content",t.className),__css:h})})});pg.displayName="PopoverContent";var Y1=e=>a.jsx(Me.circle,{cx:50,cy:50,r:42,fill:"transparent",...e});Y1.displayName="Circle";function QB(e,t,n){return(e-t)*100/(n-t)}var YB=ui({"0%":{strokeDasharray:"1, 400",strokeDashoffset:"0"},"50%":{strokeDasharray:"400, 400",strokeDashoffset:"-100"},"100%":{strokeDasharray:"400, 400",strokeDashoffset:"-260"}}),JB=ui({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),ZB=ui({"0%":{left:"-40%"},"100%":{left:"100%"}}),eH=ui({from:{backgroundPosition:"1rem 0"},to:{backgroundPosition:"0 0"}});function wP(e){const{value:t=0,min:n,max:r,valueText:o,getValueText:s,isIndeterminate:i,role:c="progressbar"}=e,f=QB(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,f):o})(),role:c},percent:f,value:t}}var CP=e=>{const{size:t,isIndeterminate:n,...r}=e;return a.jsx(Me.svg,{viewBox:"0 0 100 100",__css:{width:t,height:t,animation:n?`${JB} 2s linear infinite`:void 0},...r})};CP.displayName="Shape";var J1=Te((e,t)=>{var n;const{size:r="48px",max:o=100,min:s=0,valueText:i,getValueText:c,value:f,capIsRound:p,children:h,thickness:m="10px",color:v="#0078d4",trackColor:b="#edebe9",isIndeterminate:y,...x}=e,C=wP({min:s,max:o,value:f,valueText:i,getValueText:c,isIndeterminate:y}),k=y?void 0:((n=C.percent)!=null?n:0)*2.64,j=k==null?void 0:`${k} ${264-k}`,_=y?{css:{animation:`${YB} 1.5s linear infinite`}}:{strokeDashoffset:66,strokeDasharray:j,transitionProperty:"stroke-dasharray, stroke",transitionDuration:"0.6s",transitionTimingFunction:"ease"},I={display:"inline-block",position:"relative",verticalAlign:"middle",fontSize:r};return a.jsxs(Me.div,{ref:t,className:"chakra-progress",...C.bind,...x,__css:I,children:[a.jsxs(CP,{size:r,isIndeterminate:y,children:[a.jsx(Y1,{stroke:b,strokeWidth:m,className:"chakra-progress__track"}),a.jsx(Y1,{stroke:v,strokeWidth:m,className:"chakra-progress__indicator",strokeLinecap:p?"round":void 0,opacity:C.value===0&&!y?0:void 0,..._})]}),h]})});J1.displayName="CircularProgress";var[tH,nH]=Dn({name:"ProgressStylesContext",errorMessage:`useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Progress />" `}),rH=Te((e,t)=>{const{min:n,max:r,value:o,isIndeterminate:s,role:i,...c}=e,f=wP({value:o,min:n,max:r,isIndeterminate:s,role:i}),h={height:"100%",...nH().filledTrack};return a.jsx(Me.div,{ref:t,style:{width:`${f.percent}%`,...c.style},...f.bind,...c,__css:h})}),SP=Te((e,t)=>{var n;const{value:r,min:o=0,max:s=100,hasStripe:i,isAnimated:c,children:f,borderRadius:p,isIndeterminate:h,"aria-label":m,"aria-labelledby":v,"aria-valuetext":b,title:y,role:x,...C}=Jn(e),k=Vr("Progress",e),j=p??((n=k.track)==null?void 0:n.borderRadius),_={animation:`${eH} 1s linear infinite`},E={...!h&&i&&c&&_,...h&&{position:"absolute",willChange:"left",minWidth:"50%",animation:`${ZB} 1s ease infinite normal none running`}},M={overflow:"hidden",position:"relative",...k.track};return a.jsx(Me.div,{ref:t,borderRadius:j,__css:M,...C,children:a.jsxs(tH,{value:k,children:[a.jsx(rH,{"aria-label":m,"aria-labelledby":v,"aria-valuetext":b,min:o,max:s,value:r,isIndeterminate:h,css:E,borderRadius:j,title:y,role:x}),f]})})});SP.displayName="Progress";function oH(e){return e&&y1(e)&&y1(e.target)}function sH(e={}){const{onChange:t,value:n,defaultValue:r,name:o,isDisabled:s,isFocusable:i,isNative:c,...f}=e,[p,h]=u.useState(r||""),m=typeof n<"u",v=m?n:p,b=u.useRef(null),y=u.useCallback(()=>{const O=b.current;if(!O)return;let E="input:not(:disabled):checked";const M=O.querySelector(E);if(M){M.focus();return}E="input:not(:disabled)";const R=O.querySelector(E);R==null||R.focus()},[]),C=`radio-${u.useId()}`,k=o||C,j=u.useCallback(O=>{const E=oH(O)?O.target.value:O;m||h(E),t==null||t(String(E))},[t,m]),_=u.useCallback((O={},E=null)=>({...O,ref:cn(E,b),role:"radiogroup"}),[]),I=u.useCallback((O={},E=null)=>({...O,ref:E,name:k,[c?"checked":"isChecked"]:v!=null?O.value===v:void 0,onChange(R){j(R)},"data-radiogroup":!0}),[c,k,j,v]);return{getRootProps:_,getRadioProps:I,name:k,ref:b,focus:y,setValue:h,value:v,onChange:j,isDisabled:s,isFocusable:i,htmlProps:f}}var[aH,kP]=Dn({name:"RadioGroupContext",strict:!1}),Ah=Te((e,t)=>{const{colorScheme:n,size:r,variant:o,children:s,className:i,isDisabled:c,isFocusable:f,...p}=e,{value:h,onChange:m,getRootProps:v,name:b,htmlProps:y}=sH(p),x=u.useMemo(()=>({name:b,size:r,onChange:m,colorScheme:n,value:h,variant:o,isDisabled:c,isFocusable:f}),[b,r,m,n,h,o,c,f]);return a.jsx(aH,{value:x,children:a.jsx(Me.div,{...v(y,t),className:_t("chakra-radio-group",i),children:s})})});Ah.displayName="RadioGroup";var iH={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};function lH(e={}){const{defaultChecked:t,isChecked:n,isFocusable:r,isDisabled:o,isReadOnly:s,isRequired:i,onChange:c,isInvalid:f,name:p,value:h,id:m,"data-radiogroup":v,"aria-describedby":b,...y}=e,x=`radio-${u.useId()}`,C=hf(),j=!!kP()||!!v;let I=!!C&&!j?C.id:x;I=m??I;const O=o??(C==null?void 0:C.isDisabled),E=s??(C==null?void 0:C.isReadOnly),M=i??(C==null?void 0:C.isRequired),R=f??(C==null?void 0:C.isInvalid),[A,D]=u.useState(!1),[T,K]=u.useState(!1),[B,G]=u.useState(!1),[Q,V]=u.useState(!1),[L,X]=u.useState(!!t),F=typeof n<"u",q=F?n:L;u.useEffect(()=>W3(D),[]);const te=u.useCallback(fe=>{if(E||O){fe.preventDefault();return}F||X(fe.target.checked),c==null||c(fe)},[F,O,E,c]),Y=u.useCallback(fe=>{fe.key===" "&&V(!0)},[V]),ce=u.useCallback(fe=>{fe.key===" "&&V(!1)},[V]),ae=u.useCallback((fe={},he=null)=>({...fe,ref:he,"data-active":Ht(Q),"data-hover":Ht(B),"data-disabled":Ht(O),"data-invalid":Ht(R),"data-checked":Ht(q),"data-focus":Ht(T),"data-focus-visible":Ht(T&&A),"data-readonly":Ht(E),"aria-hidden":!0,onMouseDown:rt(fe.onMouseDown,()=>V(!0)),onMouseUp:rt(fe.onMouseUp,()=>V(!1)),onMouseEnter:rt(fe.onMouseEnter,()=>G(!0)),onMouseLeave:rt(fe.onMouseLeave,()=>G(!1))}),[Q,B,O,R,q,T,E,A]),{onFocus:U,onBlur:W}=C??{},ne=u.useCallback((fe={},he=null)=>{const Ce=O&&!r;return{...fe,id:I,ref:he,type:"radio",name:p,value:h,onChange:rt(fe.onChange,te),onBlur:rt(W,fe.onBlur,()=>K(!1)),onFocus:rt(U,fe.onFocus,()=>K(!0)),onKeyDown:rt(fe.onKeyDown,Y),onKeyUp:rt(fe.onKeyUp,ce),checked:q,disabled:Ce,readOnly:E,required:M,"aria-invalid":gs(R),"aria-disabled":gs(Ce),"aria-required":gs(M),"data-readonly":Ht(E),"aria-describedby":b,style:iH}},[O,r,I,p,h,te,W,U,Y,ce,q,E,M,R,b]);return{state:{isInvalid:R,isFocused:T,isChecked:q,isActive:Q,isHovered:B,isDisabled:O,isReadOnly:E,isRequired:M},getCheckboxProps:ae,getRadioProps:ae,getInputProps:ne,getLabelProps:(fe={},he=null)=>({...fe,ref:he,onMouseDown:rt(fe.onMouseDown,cH),"data-disabled":Ht(O),"data-checked":Ht(q),"data-invalid":Ht(R)}),getRootProps:(fe,he=null)=>({...fe,ref:he,"data-disabled":Ht(O),"data-checked":Ht(q),"data-invalid":Ht(R)}),htmlProps:y}}function cH(e){e.preventDefault(),e.stopPropagation()}function uH(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 Va=Te((e,t)=>{var n;const r=kP(),{onChange:o,value:s}=e,i=Vr("Radio",{...r,...e}),c=Jn(e),{spacing:f="0.5rem",children:p,isDisabled:h=r==null?void 0:r.isDisabled,isFocusable:m=r==null?void 0:r.isFocusable,inputProps:v,...b}=c;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=Lm(r.onChange,o));const C=(n=e==null?void 0:e.name)!=null?n:r==null?void 0:r.name,{getInputProps:k,getCheckboxProps:j,getLabelProps:_,getRootProps:I,htmlProps:O}=lH({...b,isChecked:y,isFocusable:m,isDisabled:h,onChange:x,name:C}),[E,M]=uH(O,z_),R=j(M),A=k(v,t),D=_(),T=Object.assign({},E,I()),K={display:"inline-flex",alignItems:"center",verticalAlign:"top",cursor:"pointer",position:"relative",...i.container},B={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,...i.control},G={userSelect:"none",marginStart:f,...i.label};return a.jsxs(Me.label,{className:"chakra-radio",...T,__css:K,children:[a.jsx("input",{className:"chakra-radio__input",...A}),a.jsx(Me.span,{className:"chakra-radio__control",...R,__css:B}),p&&a.jsx(Me.span,{className:"chakra-radio__label",...D,__css:G,children:p})]})});Va.displayName="Radio";var jP=Te(function(t,n){const{children:r,placeholder:o,className:s,...i}=t;return a.jsxs(Me.select,{...i,ref:n,className:_t("chakra-select",s),children:[o&&a.jsx("option",{value:"",children:o}),r]})});jP.displayName="SelectField";function dH(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 _P=Te((e,t)=>{var n;const r=Vr("Select",e),{rootProps:o,placeholder:s,icon:i,color:c,height:f,h:p,minH:h,minHeight:m,iconColor:v,iconSize:b,...y}=Jn(e),[x,C]=dH(y,z_),k=yx(C),j={width:"100%",height:"fit-content",position:"relative",color:c},_={paddingEnd:"2rem",...r.field,_focus:{zIndex:"unset",...(n=r.field)==null?void 0:n._focus}};return a.jsxs(Me.div,{className:"chakra-select__wrapper",__css:j,...x,...o,children:[a.jsx(jP,{ref:t,height:p??f,minH:h??m,placeholder:s,...k,__css:_,children:e.children}),a.jsx(PP,{"data-disabled":Ht(k.disabled),...(v||c)&&{color:v||c},__css:r.icon,...b&&{fontSize:b},children:i})]})});_P.displayName="Select";var fH=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"})}),pH=Me("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(fH,{}),...n}=e,r=u.cloneElement(t,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return a.jsx(pH,{...n,className:"chakra-select__icon-wrapper",children:u.isValidElement(t)?r:null})};PP.displayName="SelectIcon";function hH(){const e=u.useRef(!0);return u.useEffect(()=>{e.current=!1},[]),e.current}function mH(e){const t=u.useRef();return u.useEffect(()=>{t.current=e},[e]),t.current}var gH=Me("div",{baseStyle:{boxShadow:"none",backgroundClip:"padding-box",cursor:"default",color:"transparent",pointerEvents:"none",userSelect:"none","&::before, &::after, *":{visibility:"hidden"}}}),Z1=B_("skeleton-start-color"),eb=B_("skeleton-end-color"),vH=ui({from:{opacity:0},to:{opacity:1}}),bH=ui({from:{borderColor:Z1.reference,background:Z1.reference},to:{borderColor:eb.reference,background:eb.reference}}),hg=Te((e,t)=>{const n={...e,fadeDuration:typeof e.fadeDuration=="number"?e.fadeDuration:.4,speed:typeof e.speed=="number"?e.speed:.8},r=Xi("Skeleton",n),o=hH(),{startColor:s="",endColor:i="",isLoaded:c,fadeDuration:f,speed:p,className:h,fitContent:m,...v}=Jn(n),[b,y]=xa("colors",[s,i]),x=mH(c),C=_t("chakra-skeleton",h),k={...b&&{[Z1.variable]:b},...y&&{[eb.variable]:y}};if(c){const j=o||x?"none":`${vH} ${f}s`;return a.jsx(Me.div,{ref:t,className:C,__css:{animation:j},...v})}return a.jsx(gH,{ref:t,className:C,...v,__css:{width:m?"fit-content":void 0,...r,...k,_dark:{...r._dark,...k},animation:`${p}s linear infinite alternate ${bH}`}})});hg.displayName="Skeleton";var us=e=>e?"":void 0,qc=e=>e?!0:void 0,Ji=(...e)=>e.filter(Boolean).join(" ");function Kc(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function xH(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 bd(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}var lh={width:0,height:0},Ip=e=>e||lh;function IP(e){const{orientation:t,thumbPercents:n,thumbRects:r,isReversed:o}=e,s=x=>{var C;const k=(C=r[x])!=null?C:lh;return{position:"absolute",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",touchAction:"none",...bd({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,C)=>Ip(x).height>Ip(C).height?x:C,lh):r.reduce((x,C)=>Ip(x).width>Ip(C).width?x:C,lh),c={position:"relative",touchAction:"none",WebkitTapHighlightColor:"rgba(0,0,0,0)",userSelect:"none",outline:0,...bd({orientation:t,vertical:i?{paddingLeft:i.width/2,paddingRight:i.width/2}:{},horizontal:i?{paddingTop:i.height/2,paddingBottom:i.height/2}:{}})},f={position:"absolute",...bd({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={...f,...bd({orientation:t,vertical:o?{height:`${b}%`,top:`${v}%`}:{height:`${b}%`,bottom:`${v}%`},horizontal:o?{width:`${b}%`,right:`${v}%`}:{width:`${b}%`,left:`${v}%`}})};return{trackStyle:f,innerTrackStyle:y,rootStyle:c,getThumbStyle:s}}function EP(e){const{isReversed:t,direction:n,orientation:r}=e;return n==="ltr"||r==="vertical"?t:!t}function yH(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function wH(e){const t=SH(e);return typeof t.PointerEvent<"u"&&e instanceof t.PointerEvent?e.pointerType==="mouse":e instanceof t.MouseEvent}function OP(e){return!!e.touches}function CH(e){return OP(e)&&e.touches.length>1}function SH(e){var t;return(t=e.view)!=null?t:window}function kH(e,t="page"){const n=e.touches[0]||e.changedTouches[0];return{x:n[`${t}X`],y:n[`${t}Y`]}}function jH(e,t="page"){return{x:e[`${t}X`],y:e[`${t}Y`]}}function MP(e,t="page"){return OP(e)?kH(e,t):jH(e,t)}function _H(e){return t=>{const n=wH(t);(!n||n&&t.button===0)&&e(t)}}function PH(e,t=!1){function n(o){e(o,{point:MP(o)})}return t?_H(n):n}function ch(e,t,n,r){return yH(e,t,PH(n,t==="pointerdown"),r)}var IH=Object.defineProperty,EH=(e,t,n)=>t in e?IH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ms=(e,t,n)=>(EH(e,typeof t!="symbol"?t+"":t,n),n),OH=class{constructor(e,t,n){Ms(this,"history",[]),Ms(this,"startEvent",null),Ms(this,"lastEvent",null),Ms(this,"lastEventInfo",null),Ms(this,"handlers",{}),Ms(this,"removeListeners",()=>{}),Ms(this,"threshold",3),Ms(this,"win"),Ms(this,"updatePoint",()=>{if(!(this.lastEvent&&this.lastEventInfo))return;const c=Mv(this.lastEventInfo,this.history),f=this.startEvent!==null,p=AH(c.offset,{x:0,y:0})>=this.threshold;if(!f&&!p)return;const{timestamp:h}=FC();this.history.push({...c.point,timestamp:h});const{onStart:m,onMove:v}=this.handlers;f||(m==null||m(this.lastEvent,c),this.startEvent=this.lastEvent),v==null||v(this.lastEvent,c)}),Ms(this,"onPointerMove",(c,f)=>{this.lastEvent=c,this.lastEventInfo=f,J9.update(this.updatePoint,!0)}),Ms(this,"onPointerUp",(c,f)=>{const p=Mv(f,this.history),{onEnd:h,onSessionEnd:m}=this.handlers;m==null||m(c,p),this.end(),!(!h||!this.startEvent)&&(h==null||h(c,p))});var r;if(this.win=(r=e.view)!=null?r:window,CH(e))return;this.handlers=t,n&&(this.threshold=n),e.stopPropagation(),e.preventDefault();const o={point:MP(e)},{timestamp:s}=FC();this.history=[{...o.point,timestamp:s}];const{onSessionStart:i}=t;i==null||i(e,Mv(o,this.history)),this.removeListeners=DH(ch(this.win,"pointermove",this.onPointerMove),ch(this.win,"pointerup",this.onPointerUp),ch(this.win,"pointercancel",this.onPointerUp))}updateHandlers(e){this.handlers=e}end(){var e;(e=this.removeListeners)==null||e.call(this),Z9.update(this.updatePoint)}};function kS(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Mv(e,t){return{point:e.point,delta:kS(e.point,t[t.length-1]),offset:kS(e.point,t[0]),velocity:RH(t,.1)}}var MH=e=>e*1e3;function RH(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>MH(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 DH(...e){return t=>e.reduce((n,r)=>r(n),t)}function Rv(e,t){return Math.abs(e-t)}function jS(e){return"x"in e&&"y"in e}function AH(e,t){if(typeof e=="number"&&typeof t=="number")return Rv(e,t);if(jS(e)&&jS(t)){const n=Rv(e.x,t.x),r=Rv(e.y,t.y);return Math.sqrt(n**2+r**2)}return 0}function RP(e){const t=u.useRef(null);return t.current=e,t}function DP(e,t){const{onPan:n,onPanStart:r,onPanEnd:o,onPanSessionStart:s,onPanSessionEnd:i,threshold:c}=t,f=!!(n||r||o||s||i),p=u.useRef(null),h=RP({onSessionStart:s,onSessionEnd:i,onStart:r,onMove:n,onEnd(m,v){p.current=null,o==null||o(m,v)}});u.useEffect(()=>{var m;(m=p.current)==null||m.updateHandlers(h.current)}),u.useEffect(()=>{const m=e.current;if(!m||!f)return;function v(b){p.current=new OH(b,h.current,c)}return ch(m,"pointerdown",v)},[e,f,h,c]),u.useEffect(()=>()=>{var m;(m=p.current)==null||m.end(),p.current=null},[])}function NH(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,c;if("borderBoxSize"in s){const f=s.borderBoxSize,p=Array.isArray(f)?f[0]:f;i=p.inlineSize,c=p.blockSize}else i=e.offsetWidth,c=e.offsetHeight;t({width:i,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}var TH=globalThis!=null&&globalThis.document?u.useLayoutEffect:u.useEffect;function $H(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]=u.useState([]),[o,s]=u.useState(0);return TH(()=>{const i=e(),c=i.map((f,p)=>NH(f,h=>{r(m=>[...m.slice(0,p),h,...m.slice(p+1)])}));if(t){const f=i[0];c.push($H(f,()=>{s(p=>p+1)}))}return()=>{c.forEach(f=>{f==null||f()})}},[o]),n}function LH(e){return typeof e=="object"&&e!==null&&"current"in e}function FH(e){const[t]=AP({observeMutation:!1,getNodes(){return[LH(e)?e.current:e]}});return t}function zH(e){const{min:t=0,max:n=100,onChange:r,value:o,defaultValue:s,isReversed:i,direction:c="ltr",orientation:f="horizontal",id:p,isDisabled:h,isReadOnly:m,onChangeStart:v,onChangeEnd:b,step:y=1,getAriaValueText:x,"aria-valuetext":C,"aria-label":k,"aria-labelledby":j,name:_,focusThumbOnChange:I=!0,minStepsBetweenThumbs:O=0,...E}=e,M=sr(v),R=sr(b),A=sr(x),D=EP({isReversed:i,direction:c,orientation:f}),[T,K]=ku({value:o,defaultValue:s??[25,75],onChange:r});if(!Array.isArray(T))throw new TypeError(`[range-slider] You passed an invalid value for \`value\` or \`defaultValue\`, expected \`Array\` but got \`${typeof T}\``);const[B,G]=u.useState(!1),[Q,V]=u.useState(!1),[L,X]=u.useState(-1),F=!(h||m),q=u.useRef(T),te=T.map(_e=>Wc(_e,t,n)),Y=O*y,ce=BH(te,t,n,Y),ae=u.useRef({eventSource:null,value:[],valueBounds:[]});ae.current.value=te,ae.current.valueBounds=ce;const U=te.map(_e=>n-_e+t),ne=(D?U:te).map(_e=>Ih(_e,t,n)),ie=f==="vertical",oe=u.useRef(null),me=u.useRef(null),fe=AP({getNodes(){const _e=me.current,Ze=_e==null?void 0:_e.querySelectorAll("[role=slider]");return Ze?Array.from(Ze):[]}}),he=u.useId(),xe=xH(p??he),de=u.useCallback(_e=>{var Ze,Qe;if(!oe.current)return;ae.current.eventSource="pointer";const ct=oe.current.getBoundingClientRect(),{clientX:Ft,clientY:ir}=(Qe=(Ze=_e.touches)==null?void 0:Ze[0])!=null?Qe:_e,pn=ie?ct.bottom-ir:Ft-ct.left,ln=ie?ct.height:ct.width;let Ur=pn/ln;return D&&(Ur=1-Ur),U3(Ur,t,n)},[ie,D,n,t]),Ne=(n-t)/10,De=y||(n-t)/100,Xe=u.useMemo(()=>({setValueAtIndex(_e,Ze){if(!F)return;const Qe=ae.current.valueBounds[_e];Ze=parseFloat(F1(Ze,Qe.min,De)),Ze=Wc(Ze,Qe.min,Qe.max);const ct=[...ae.current.value];ct[_e]=Ze,K(ct)},setActiveIndex:X,stepUp(_e,Ze=De){const Qe=ae.current.value[_e],ct=D?Qe-Ze:Qe+Ze;Xe.setValueAtIndex(_e,ct)},stepDown(_e,Ze=De){const Qe=ae.current.value[_e],ct=D?Qe+Ze:Qe-Ze;Xe.setValueAtIndex(_e,ct)},reset(){K(q.current)}}),[De,D,K,F]),It=u.useCallback(_e=>{const Ze=_e.key,ct={ArrowRight:()=>Xe.stepUp(L),ArrowUp:()=>Xe.stepUp(L),ArrowLeft:()=>Xe.stepDown(L),ArrowDown:()=>Xe.stepDown(L),PageUp:()=>Xe.stepUp(L,Ne),PageDown:()=>Xe.stepDown(L,Ne),Home:()=>{const{min:Ft}=ce[L];Xe.setValueAtIndex(L,Ft)},End:()=>{const{max:Ft}=ce[L];Xe.setValueAtIndex(L,Ft)}}[Ze];ct&&(_e.preventDefault(),_e.stopPropagation(),ct(_e),ae.current.eventSource="keyboard")},[Xe,L,Ne,ce]),{getThumbStyle:lt,rootStyle:on,trackStyle:gt,innerTrackStyle:bt}=u.useMemo(()=>IP({isReversed:D,orientation:f,thumbRects:fe,thumbPercents:ne}),[D,f,ne,fe]),ye=u.useCallback(_e=>{var Ze;const Qe=_e??L;if(Qe!==-1&&I){const ct=xe.getThumb(Qe),Ft=(Ze=me.current)==null?void 0:Ze.ownerDocument.getElementById(ct);Ft&&setTimeout(()=>Ft.focus())}},[I,L,xe]);fi(()=>{ae.current.eventSource==="keyboard"&&(R==null||R(ae.current.value))},[te,R]);const We=_e=>{const Ze=de(_e)||0,Qe=ae.current.value.map(ln=>Math.abs(ln-Ze)),ct=Math.min(...Qe);let Ft=Qe.indexOf(ct);const ir=Qe.filter(ln=>ln===ct);ir.length>1&&Ze>ae.current.value[Ft]&&(Ft=Ft+ir.length-1),X(Ft),Xe.setValueAtIndex(Ft,Ze),ye(Ft)},Et=_e=>{if(L==-1)return;const Ze=de(_e)||0;X(L),Xe.setValueAtIndex(L,Ze),ye(L)};DP(me,{onPanSessionStart(_e){F&&(G(!0),We(_e),M==null||M(ae.current.value))},onPanSessionEnd(){F&&(G(!1),R==null||R(ae.current.value))},onPan(_e){F&&Et(_e)}});const zt=u.useCallback((_e={},Ze=null)=>({..._e,...E,id:xe.root,ref:cn(Ze,me),tabIndex:-1,"aria-disabled":qc(h),"data-focused":us(Q),style:{..._e.style,...on}}),[E,h,Q,on,xe]),we=u.useCallback((_e={},Ze=null)=>({..._e,ref:cn(Ze,oe),id:xe.track,"data-disabled":us(h),style:{..._e.style,...gt}}),[h,gt,xe]),xt=u.useCallback((_e={},Ze=null)=>({..._e,ref:Ze,id:xe.innerTrack,style:{..._e.style,...bt}}),[bt,xe]),Nt=u.useCallback((_e,Ze=null)=>{var Qe;const{index:ct,...Ft}=_e,ir=te[ct];if(ir==null)throw new TypeError(`[range-slider > thumb] Cannot find value at index \`${ct}\`. The \`value\` or \`defaultValue\` length is : ${te.length}`);const pn=ce[ct];return{...Ft,ref:Ze,role:"slider",tabIndex:F?0:void 0,id:xe.getThumb(ct),"data-active":us(B&&L===ct),"aria-valuetext":(Qe=A==null?void 0:A(ir))!=null?Qe:C==null?void 0:C[ct],"aria-valuemin":pn.min,"aria-valuemax":pn.max,"aria-valuenow":ir,"aria-orientation":f,"aria-disabled":qc(h),"aria-readonly":qc(m),"aria-label":k==null?void 0:k[ct],"aria-labelledby":k!=null&&k[ct]||j==null?void 0:j[ct],style:{..._e.style,...lt(ct)},onKeyDown:Kc(_e.onKeyDown,It),onFocus:Kc(_e.onFocus,()=>{V(!0),X(ct)}),onBlur:Kc(_e.onBlur,()=>{V(!1),X(-1)})}},[xe,te,ce,F,B,L,A,C,f,h,m,k,j,lt,It,V]),Lt=u.useCallback((_e={},Ze=null)=>({..._e,ref:Ze,id:xe.output,htmlFor:te.map((Qe,ct)=>xe.getThumb(ct)).join(" "),"aria-live":"off"}),[xe,te]),$e=u.useCallback((_e,Ze=null)=>{const{value:Qe,...ct}=_e,Ft=!(Qe<t||Qe>n),ir=Qe>=te[0]&&Qe<=te[te.length-1];let pn=Ih(Qe,t,n);pn=D?100-pn:pn;const ln={position:"absolute",pointerEvents:"none",...bd({orientation:f,vertical:{bottom:`${pn}%`},horizontal:{left:`${pn}%`}})};return{...ct,ref:Ze,id:xe.getMarker(_e.value),role:"presentation","aria-hidden":!0,"data-disabled":us(h),"data-invalid":us(!Ft),"data-highlighted":us(ir),style:{..._e.style,...ln}}},[h,D,n,t,f,te,xe]),Ke=u.useCallback((_e,Ze=null)=>{const{index:Qe,...ct}=_e;return{...ct,ref:Ze,id:xe.getInput(Qe),type:"hidden",value:te[Qe],name:Array.isArray(_)?_[Qe]:`${_}-${Qe}`}},[_,te,xe]);return{state:{value:te,isFocused:Q,isDragging:B,getThumbPercent:_e=>ne[_e],getThumbMinValue:_e=>ce[_e].min,getThumbMaxValue:_e=>ce[_e].max},actions:Xe,getRootProps:zt,getTrackProps:we,getInnerTrackProps:xt,getThumbProps:Nt,getMarkerProps:$e,getInputProps:Ke,getOutputProps:Lt}}function BH(e,t,n,r){return e.map((o,s)=>{const i=s===0?t:e[s-1]+r,c=s===e.length-1?n:e[s+1]-r;return{min:i,max:c}})}var[HH,mg]=Dn({name:"SliderContext",errorMessage:"useSliderContext: `context` is undefined. Seems you forgot to wrap all slider components within <RangeSlider />"}),[WH,gg]=Dn({name:"RangeSliderStylesContext",errorMessage:`useRangeSliderStyles returned is 'undefined'. Seems you forgot to wrap the components in "<RangeSlider />" `}),NP=Te(function(t,n){const r={orientation:"horizontal",...t},o=Vr("Slider",r),s=Jn(r),{direction:i}=sf();s.direction=i;const{getRootProps:c,...f}=zH(s),p=u.useMemo(()=>({...f,name:r.name}),[f,r.name]);return a.jsx(HH,{value:p,children:a.jsx(WH,{value:o,children:a.jsx(Me.div,{...c({},n),className:"chakra-slider",__css:o.container,children:r.children})})})});NP.displayName="RangeSlider";var tb=Te(function(t,n){const{getThumbProps:r,getInputProps:o,name:s}=mg(),i=gg(),c=r(t,n);return a.jsxs(Me.div,{...c,className:Ji("chakra-slider__thumb",t.className),__css:i.thumb,children:[c.children,s&&a.jsx("input",{...o({index:t.index})})]})});tb.displayName="RangeSliderThumb";var TP=Te(function(t,n){const{getTrackProps:r}=mg(),o=gg(),s=r(t,n);return a.jsx(Me.div,{...s,className:Ji("chakra-slider__track",t.className),__css:o.track,"data-testid":"chakra-range-slider-track"})});TP.displayName="RangeSliderTrack";var $P=Te(function(t,n){const{getInnerTrackProps:r}=mg(),o=gg(),s=r(t,n);return a.jsx(Me.div,{...s,className:"chakra-slider__filled-track",__css:o.filledTrack})});$P.displayName="RangeSliderFilledTrack";var uh=Te(function(t,n){const{getMarkerProps:r}=mg(),o=gg(),s=r(t,n);return a.jsx(Me.div,{...s,className:Ji("chakra-slider__marker",t.className),__css:o.mark})});uh.displayName="RangeSliderMark";function VH(e){var t;const{min:n=0,max:r=100,onChange:o,value:s,defaultValue:i,isReversed:c,direction:f="ltr",orientation:p="horizontal",id:h,isDisabled:m,isReadOnly:v,onChangeStart:b,onChangeEnd:y,step:x=1,getAriaValueText:C,"aria-valuetext":k,"aria-label":j,"aria-labelledby":_,name:I,focusThumbOnChange:O=!0,...E}=e,M=sr(b),R=sr(y),A=sr(C),D=EP({isReversed:c,direction:f,orientation:p}),[T,K]=ku({value:s,defaultValue:i??GH(n,r),onChange:o}),[B,G]=u.useState(!1),[Q,V]=u.useState(!1),L=!(m||v),X=(r-n)/10,F=x||(r-n)/100,q=Wc(T,n,r),te=r-q+n,ce=Ih(D?te:q,n,r),ae=p==="vertical",U=RP({min:n,max:r,step:x,isDisabled:m,value:q,isInteractive:L,isReversed:D,isVertical:ae,eventSource:null,focusThumbOnChange:O,orientation:p}),W=u.useRef(null),ne=u.useRef(null),ie=u.useRef(null),oe=u.useId(),me=h??oe,[fe,he]=[`slider-thumb-${me}`,`slider-track-${me}`],Ce=u.useCallback($e=>{var Ke,vn;if(!W.current)return;const _e=U.current;_e.eventSource="pointer";const Ze=W.current.getBoundingClientRect(),{clientX:Qe,clientY:ct}=(vn=(Ke=$e.touches)==null?void 0:Ke[0])!=null?vn:$e,Ft=ae?Ze.bottom-ct:Qe-Ze.left,ir=ae?Ze.height:Ze.width;let pn=Ft/ir;D&&(pn=1-pn);let ln=U3(pn,_e.min,_e.max);return _e.step&&(ln=parseFloat(F1(ln,_e.min,_e.step))),ln=Wc(ln,_e.min,_e.max),ln},[ae,D,U]),xe=u.useCallback($e=>{const Ke=U.current;Ke.isInteractive&&($e=parseFloat(F1($e,Ke.min,F)),$e=Wc($e,Ke.min,Ke.max),K($e))},[F,K,U]),de=u.useMemo(()=>({stepUp($e=F){const Ke=D?q-$e:q+$e;xe(Ke)},stepDown($e=F){const Ke=D?q+$e:q-$e;xe(Ke)},reset(){xe(i||0)},stepTo($e){xe($e)}}),[xe,D,q,F,i]),Ne=u.useCallback($e=>{const Ke=U.current,_e={ArrowRight:()=>de.stepUp(),ArrowUp:()=>de.stepUp(),ArrowLeft:()=>de.stepDown(),ArrowDown:()=>de.stepDown(),PageUp:()=>de.stepUp(X),PageDown:()=>de.stepDown(X),Home:()=>xe(Ke.min),End:()=>xe(Ke.max)}[$e.key];_e&&($e.preventDefault(),$e.stopPropagation(),_e($e),Ke.eventSource="keyboard")},[de,xe,X,U]),De=(t=A==null?void 0:A(q))!=null?t:k,Xe=FH(ne),{getThumbStyle:It,rootStyle:lt,trackStyle:on,innerTrackStyle:gt}=u.useMemo(()=>{const $e=U.current,Ke=Xe??{width:0,height:0};return IP({isReversed:D,orientation:$e.orientation,thumbRects:[Ke],thumbPercents:[ce]})},[D,Xe,ce,U]),bt=u.useCallback(()=>{U.current.focusThumbOnChange&&setTimeout(()=>{var Ke;return(Ke=ne.current)==null?void 0:Ke.focus()})},[U]);fi(()=>{const $e=U.current;bt(),$e.eventSource==="keyboard"&&(R==null||R($e.value))},[q,R]);function ye($e){const Ke=Ce($e);Ke!=null&&Ke!==U.current.value&&K(Ke)}DP(ie,{onPanSessionStart($e){const Ke=U.current;Ke.isInteractive&&(G(!0),bt(),ye($e),M==null||M(Ke.value))},onPanSessionEnd(){const $e=U.current;$e.isInteractive&&(G(!1),R==null||R($e.value))},onPan($e){U.current.isInteractive&&ye($e)}});const We=u.useCallback(($e={},Ke=null)=>({...$e,...E,ref:cn(Ke,ie),tabIndex:-1,"aria-disabled":qc(m),"data-focused":us(Q),style:{...$e.style,...lt}}),[E,m,Q,lt]),Et=u.useCallback(($e={},Ke=null)=>({...$e,ref:cn(Ke,W),id:he,"data-disabled":us(m),style:{...$e.style,...on}}),[m,he,on]),zt=u.useCallback(($e={},Ke=null)=>({...$e,ref:Ke,style:{...$e.style,...gt}}),[gt]),we=u.useCallback(($e={},Ke=null)=>({...$e,ref:cn(Ke,ne),role:"slider",tabIndex:L?0:void 0,id:fe,"data-active":us(B),"aria-valuetext":De,"aria-valuemin":n,"aria-valuemax":r,"aria-valuenow":q,"aria-orientation":p,"aria-disabled":qc(m),"aria-readonly":qc(v),"aria-label":j,"aria-labelledby":j?void 0:_,style:{...$e.style,...It(0)},onKeyDown:Kc($e.onKeyDown,Ne),onFocus:Kc($e.onFocus,()=>V(!0)),onBlur:Kc($e.onBlur,()=>V(!1))}),[L,fe,B,De,n,r,q,p,m,v,j,_,It,Ne]),xt=u.useCallback(($e,Ke=null)=>{const vn=!($e.value<n||$e.value>r),_e=q>=$e.value,Ze=Ih($e.value,n,r),Qe={position:"absolute",pointerEvents:"none",...UH({orientation:p,vertical:{bottom:D?`${100-Ze}%`:`${Ze}%`},horizontal:{left:D?`${100-Ze}%`:`${Ze}%`}})};return{...$e,ref:Ke,role:"presentation","aria-hidden":!0,"data-disabled":us(m),"data-invalid":us(!vn),"data-highlighted":us(_e),style:{...$e.style,...Qe}}},[m,D,r,n,p,q]),Nt=u.useCallback(($e={},Ke=null)=>({...$e,ref:Ke,type:"hidden",value:q,name:I}),[I,q]);return{state:{value:q,isFocused:Q,isDragging:B},actions:de,getRootProps:We,getTrackProps:Et,getInnerTrackProps:zt,getThumbProps:we,getMarkerProps:xt,getInputProps:Nt}}function UH(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}function GH(e,t){return t<e?e:e+(t-e)/2}var[qH,vg]=Dn({name:"SliderContext",hookName:"useSliderContext",providerName:"<Slider />"}),[KH,bg]=Dn({name:"SliderStylesContext",hookName:"useSliderStyles",providerName:"<Slider />"}),ty=Te((e,t)=>{var n;const r={...e,orientation:(n=e==null?void 0:e.orientation)!=null?n:"horizontal"},o=Vr("Slider",r),s=Jn(r),{direction:i}=sf();s.direction=i;const{getInputProps:c,getRootProps:f,...p}=VH(s),h=f(),m=c({},t);return a.jsx(qH,{value:p,children:a.jsx(KH,{value:o,children:a.jsxs(Me.div,{...h,className:Ji("chakra-slider",r.className),__css:o.container,children:[r.children,a.jsx("input",{...m})]})})})});ty.displayName="Slider";var ny=Te((e,t)=>{const{getThumbProps:n}=vg(),r=bg(),o=n(e,t);return a.jsx(Me.div,{...o,className:Ji("chakra-slider__thumb",e.className),__css:r.thumb})});ny.displayName="SliderThumb";var ry=Te((e,t)=>{const{getTrackProps:n}=vg(),r=bg(),o=n(e,t);return a.jsx(Me.div,{...o,className:Ji("chakra-slider__track",e.className),__css:r.track})});ry.displayName="SliderTrack";var oy=Te((e,t)=>{const{getInnerTrackProps:n}=vg(),r=bg(),o=n(e,t);return a.jsx(Me.div,{...o,className:Ji("chakra-slider__filled-track",e.className),__css:r.filledTrack})});oy.displayName="SliderFilledTrack";var Ic=Te((e,t)=>{const{getMarkerProps:n}=vg(),r=bg(),o=n(e,t);return a.jsx(Me.div,{...o,className:Ji("chakra-slider__marker",e.className),__css:r.mark})});Ic.displayName="SliderMark";var sy=Te(function(t,n){const r=Vr("Switch",t),{spacing:o="0.5rem",children:s,...i}=Jn(t),{getIndicatorProps:c,getInputProps:f,getCheckboxProps:p,getRootProps:h,getLabelProps:m}=V3(i),v=u.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...r.container}),[r.container]),b=u.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...r.track}),[r.track]),y=u.useMemo(()=>({userSelect:"none",marginStart:o,...r.label}),[o,r.label]);return a.jsxs(Me.label,{...h(),className:_t("chakra-switch",t.className),__css:v,children:[a.jsx("input",{className:"chakra-switch__input",...f({},n)}),a.jsx(Me.span,{...p(),className:"chakra-switch__track",__css:b,children:a.jsx(Me.span,{__css:r.thumb,className:"chakra-switch__thumb",...c()})}),s&&a.jsx(Me.span,{className:"chakra-switch__label",...m(),__css:y,children:s})]})});sy.displayName="Switch";var[XH,QH,YH,JH]=vx();function ZH(e){var t;const{defaultIndex:n,onChange:r,index:o,isManual:s,isLazy:i,lazyBehavior:c="unmount",orientation:f="horizontal",direction:p="ltr",...h}=e,[m,v]=u.useState(n??0),[b,y]=ku({defaultValue:n??0,value:o,onChange:r});u.useEffect(()=>{o!=null&&v(o)},[o]);const x=YH(),C=u.useId();return{id:`tabs-${(t=e.id)!=null?t:C}`,selectedIndex:b,focusedIndex:m,setSelectedIndex:y,setFocusedIndex:v,isManual:s,isLazy:i,lazyBehavior:c,orientation:f,descendants:x,direction:p,htmlProps:h}}var[eW,xg]=Dn({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within <Tabs />"});function tW(e){const{focusedIndex:t,orientation:n,direction:r}=xg(),o=QH(),s=u.useCallback(i=>{const c=()=>{var j;const _=o.nextEnabled(t);_&&((j=_.node)==null||j.focus())},f=()=>{var j;const _=o.prevEnabled(t);_&&((j=_.node)==null||j.focus())},p=()=>{var j;const _=o.firstEnabled();_&&((j=_.node)==null||j.focus())},h=()=>{var j;const _=o.lastEnabled();_&&((j=_.node)==null||j.focus())},m=n==="horizontal",v=n==="vertical",b=i.key,y=r==="ltr"?"ArrowLeft":"ArrowRight",x=r==="ltr"?"ArrowRight":"ArrowLeft",k={[y]:()=>m&&f(),[x]:()=>m&&c(),ArrowDown:()=>v&&c(),ArrowUp:()=>v&&f(),Home:p,End:h}[b];k&&(i.preventDefault(),k(i))},[o,t,n,r]);return{...e,role:"tablist","aria-orientation":n,onKeyDown:rt(e.onKeyDown,s)}}function nW(e){const{isDisabled:t=!1,isFocusable:n=!1,...r}=e,{setSelectedIndex:o,isManual:s,id:i,setFocusedIndex:c,selectedIndex:f}=xg(),{index:p,register:h}=JH({disabled:t&&!n}),m=p===f,v=()=>{o(p)},b=()=>{c(p),!s&&!(t&&n)&&o(p)},y=V5({...r,ref:cn(h,e.ref),isDisabled:t,isFocusable:n,onClick:rt(e.onClick,v)}),x="button";return{...y,id:LP(i,p),role:"tab",tabIndex:m?0:-1,type:x,"aria-selected":m,"aria-controls":FP(i,p),onFocus:t?void 0:rt(e.onFocus,b)}}var[rW,oW]=Dn({});function sW(e){const t=xg(),{id:n,selectedIndex:r}=t,s=pf(e.children).map((i,c)=>u.createElement(rW,{key:c,value:{isSelected:c===r,id:FP(n,c),tabId:LP(n,c),selectedIndex:r}},i));return{...e,children:s}}function aW(e){const{children:t,...n}=e,{isLazy:r,lazyBehavior:o}=xg(),{isSelected:s,id:i,tabId:c}=oW(),f=u.useRef(!1);s&&(f.current=!0);const p=Xx({wasSelected:f.current,isSelected:s,enabled:r,mode:o});return{tabIndex:0,...n,children:p?t:null,role:"tabpanel","aria-labelledby":c,hidden:!s,id:i}}function LP(e,t){return`${e}--tab-${t}`}function FP(e,t){return`${e}--tabpanel-${t}`}var[iW,yg]=Dn({name:"TabsStylesContext",errorMessage:`useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Tabs />" `}),Gl=Te(function(t,n){const r=Vr("Tabs",t),{children:o,className:s,...i}=Jn(t),{htmlProps:c,descendants:f,...p}=ZH(i),h=u.useMemo(()=>p,[p]),{isFitted:m,...v}=c;return a.jsx(XH,{value:f,children:a.jsx(eW,{value:h,children:a.jsx(iW,{value:r,children:a.jsx(Me.div,{className:_t("chakra-tabs",s),ref:n,...v,__css:r.root,children:o})})})})});Gl.displayName="Tabs";var ql=Te(function(t,n){const r=tW({...t,ref:n}),s={display:"flex",...yg().tablist};return a.jsx(Me.div,{...r,className:_t("chakra-tabs__tablist",t.className),__css:s})});ql.displayName="TabList";var bs=Te(function(t,n){const r=aW({...t,ref:n}),o=yg();return a.jsx(Me.div,{outline:"0",...r,className:_t("chakra-tabs__tab-panel",t.className),__css:o.tabpanel})});bs.displayName="TabPanel";var Ou=Te(function(t,n){const r=sW(t),o=yg();return a.jsx(Me.div,{...r,width:"100%",ref:n,className:_t("chakra-tabs__tab-panels",t.className),__css:o.tabpanels})});Ou.displayName="TabPanels";var Ro=Te(function(t,n){const r=yg(),o=nW({...t,ref:n}),s={outline:"0",display:"flex",alignItems:"center",justifyContent:"center",...r.tab};return a.jsx(Me.button,{...o,className:_t("chakra-tabs__tab",t.className),__css:s})});Ro.displayName="Tab";function lW(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var cW=["h","minH","height","minHeight"],zP=Te((e,t)=>{const n=Xi("Textarea",e),{className:r,rows:o,...s}=Jn(e),i=yx(s),c=o?lW(n,cW):n;return a.jsx(Me.textarea,{ref:t,rows:o,...i,className:_t("chakra-textarea",r),__css:c})});zP.displayName="Textarea";var uW={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]}}}},nb=e=>{var t;return((t=e.current)==null?void 0:t.ownerDocument)||document},dh=e=>{var t,n;return((n=(t=e.current)==null?void 0:t.ownerDocument)==null?void 0:n.defaultView)||window};function dW(e={}){const{openDelay:t=0,closeDelay:n=0,closeOnClick:r=!0,closeOnMouseDown:o,closeOnScroll:s,closeOnPointerDown:i=o,closeOnEsc:c=!0,onOpen:f,onClose:p,placement:h,id:m,isOpen:v,defaultIsOpen:b,arrowSize:y=10,arrowShadowColor:x,arrowPadding:C,modifiers:k,isDisabled:j,gutter:_,offset:I,direction:O,...E}=e,{isOpen:M,onOpen:R,onClose:A}=Kx({isOpen:v,defaultIsOpen:b,onOpen:f,onClose:p}),{referenceRef:D,getPopperProps:T,getArrowInnerProps:K,getArrowProps:B}=qx({enabled:M,placement:h,arrowPadding:C,modifiers:k,gutter:_,offset:I,direction:O}),G=u.useId(),V=`tooltip-${m??G}`,L=u.useRef(null),X=u.useRef(),F=u.useCallback(()=>{X.current&&(clearTimeout(X.current),X.current=void 0)},[]),q=u.useRef(),te=u.useCallback(()=>{q.current&&(clearTimeout(q.current),q.current=void 0)},[]),Y=u.useCallback(()=>{te(),A()},[A,te]),ce=fW(L,Y),ae=u.useCallback(()=>{if(!j&&!X.current){M&&ce();const he=dh(L);X.current=he.setTimeout(R,t)}},[ce,j,M,R,t]),U=u.useCallback(()=>{F();const he=dh(L);q.current=he.setTimeout(Y,n)},[n,Y,F]),W=u.useCallback(()=>{M&&r&&U()},[r,U,M]),ne=u.useCallback(()=>{M&&i&&U()},[i,U,M]),ie=u.useCallback(he=>{M&&he.key==="Escape"&&U()},[M,U]);wl(()=>nb(L),"keydown",c?ie:void 0),wl(()=>{const he=L.current;if(!he)return null;const Ce=R5(he);return Ce.localName==="body"?dh(L):Ce},"scroll",()=>{M&&s&&Y()},{passive:!0,capture:!0}),u.useEffect(()=>{j&&(F(),M&&A())},[j,M,A,F]),u.useEffect(()=>()=>{F(),te()},[F,te]),wl(()=>L.current,"pointerleave",U);const oe=u.useCallback((he={},Ce=null)=>({...he,ref:cn(L,Ce,D),onPointerEnter:rt(he.onPointerEnter,de=>{de.pointerType!=="touch"&&ae()}),onClick:rt(he.onClick,W),onPointerDown:rt(he.onPointerDown,ne),onFocus:rt(he.onFocus,ae),onBlur:rt(he.onBlur,U),"aria-describedby":M?V:void 0}),[ae,U,ne,M,V,W,D]),me=u.useCallback((he={},Ce=null)=>T({...he,style:{...he.style,[Ir.arrowSize.var]:y?`${y}px`:void 0,[Ir.arrowShadowColor.var]:x}},Ce),[T,y,x]),fe=u.useCallback((he={},Ce=null)=>{const xe={...he.style,position:"relative",transformOrigin:Ir.transformOrigin.varRef};return{ref:Ce,...E,...he,id:V,role:"tooltip",style:xe}},[E,V]);return{isOpen:M,show:ae,hide:U,getTriggerProps:oe,getTooltipProps:fe,getTooltipPositionerProps:me,getArrowProps:B,getArrowInnerProps:K}}var Dv="chakra-ui:close-tooltip";function fW(e,t){return u.useEffect(()=>{const n=nb(e);return n.addEventListener(Dv,t),()=>n.removeEventListener(Dv,t)},[t,e]),()=>{const n=nb(e),r=dh(e);n.dispatchEvent(new r.CustomEvent(Dv))}}function pW(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function hW(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var mW=Me(yr.div),Mn=Te((e,t)=>{var n,r;const o=Xi("Tooltip",e),s=Jn(e),i=sf(),{children:c,label:f,shouldWrapChildren:p,"aria-label":h,hasArrow:m,bg:v,portalProps:b,background:y,backgroundColor:x,bgColor:C,motionProps:k,...j}=s,_=(r=(n=y??x)!=null?n:v)!=null?r:C;if(_){o.bg=_;const T=O7(i,"colors",_);o[Ir.arrowBg.var]=T}const I=dW({...j,direction:i.direction}),O=typeof c=="string"||p;let E;if(O)E=a.jsx(Me.span,{display:"inline-block",tabIndex:0,...I.getTriggerProps(),children:c});else{const T=u.Children.only(c);E=u.cloneElement(T,I.getTriggerProps(T.props,T.ref))}const M=!!h,R=I.getTooltipProps({},t),A=M?pW(R,["role","id"]):R,D=hW(R,["role","id"]);return f?a.jsxs(a.Fragment,{children:[E,a.jsx(co,{children:I.isOpen&&a.jsx(uf,{...b,children:a.jsx(Me.div,{...I.getTooltipPositionerProps(),__css:{zIndex:o.zIndex,pointerEvents:"none"},children:a.jsxs(mW,{variants:uW,initial:"exit",animate:"enter",exit:"exit",...k,...A,__css:o,children:[f,M&&a.jsx(Me.span,{srOnly:!0,...D,children:h}),m&&a.jsx(Me.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper",children:a.jsx(Me.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:o.bg}})})]})})})})]}):a.jsx(a.Fragment,{children:c})});Mn.displayName="Tooltip";const Cs=e=>e.system,gW=e=>e.system.toastQueue,BP=le(Cs,e=>e.language,Oe),Or=le(e=>e,e=>e.system.isProcessing||!e.system.isConnected),vW=le(Cs,e=>{const{consoleLogLevel:t,shouldLogToConsole:n}=e;return{consoleLogLevel:t,shouldLogToConsole:n}},{memoizeOptions:{resultEqualityCheck:mn}}),HP=e=>{const{consoleLogLevel:t,shouldLogToConsole:n}=z(vW);return u.useEffect(()=>{n?(localStorage.setItem("ROARR_LOG","true"),localStorage.setItem("ROARR_FILTER",`context.logLevel:>=${M7[t]}`)):localStorage.setItem("ROARR_LOG","false"),Qw.ROARR.write=R7.createLogWriter()},[t,n]),u.useEffect(()=>{const o={...D7};A7.set(Qw.Roarr.child(o))},[]),u.useMemo(()=>Su(e),[e])},bW=()=>{const e=se(),t=z(gW),n=A3();return u.useEffect(()=>{t.forEach(r=>{n(r)}),t.length>0&&e(N7())},[e,n,t]),null},Kl=()=>{const e=se();return u.useCallback(n=>e(Cn(_n(n))),[e])},xW=u.memo(bW);var yW=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 jf(e,t){var n=wW(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 wW(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),o=yW.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var CW=[".DS_Store","Thumbs.db"];function SW(e){return ju(this,void 0,void 0,function(){return _u(this,function(t){return Nh(e)&&kW(e.dataTransfer)?[2,IW(e.dataTransfer,e.type)]:jW(e)?[2,_W(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,PW(e)]:[2,[]]})})}function kW(e){return Nh(e)}function jW(e){return Nh(e)&&Nh(e.target)}function Nh(e){return typeof e=="object"&&e!==null}function _W(e){return rb(e.target.files).map(function(t){return jf(t)})}function PW(e){return ju(this,void 0,void 0,function(){var t;return _u(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 jf(r)})]}})})}function IW(e,t){return ju(this,void 0,void 0,function(){var n,r;return _u(this,function(o){switch(o.label){case 0:return e.items?(n=rb(e.items).filter(function(s){return s.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(EW))]):[3,2];case 1:return r=o.sent(),[2,_S(WP(r))];case 2:return[2,_S(rb(e.files).map(function(s){return jf(s)}))]}})})}function _S(e){return e.filter(function(t){return CW.indexOf(t.name)===-1})}function rb(e){if(e===null)return[];for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r)}return t}function EW(e){if(typeof e.webkitGetAsEntry!="function")return PS(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?VP(t):PS(e)}function WP(e){return e.reduce(function(t,n){return B1(B1([],XC(t),!1),XC(Array.isArray(n)?WP(n):[n]),!1)},[])}function PS(e){var t=e.getAsFile();if(!t)return Promise.reject("".concat(e," is not a File"));var n=jf(t);return Promise.resolve(n)}function OW(e){return ju(this,void 0,void 0,function(){return _u(this,function(t){return[2,e.isDirectory?VP(e):MW(e)]})})}function VP(e){var t=e.createReader();return new Promise(function(n,r){var o=[];function s(){var i=this;t.readEntries(function(c){return ju(i,void 0,void 0,function(){var f,p,h;return _u(this,function(m){switch(m.label){case 0:if(c.length)return[3,5];m.label=1;case 1:return m.trys.push([1,3,,4]),[4,Promise.all(o)];case 2:return f=m.sent(),n(f),[3,4];case 3:return p=m.sent(),r(p),[3,4];case 4:return[3,6];case 5:h=Promise.all(c.map(OW)),o.push(h),s(),m.label=6;case 6:return[2]}})})},function(c){r(c)})}s()})}function MW(e){return ju(this,void 0,void 0,function(){return _u(this,function(t){return[2,new Promise(function(n,r){e.file(function(o){var s=jf(o,e.fullPath);n(s)},function(o){r(o)})})]})})}var RW=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 c=i.trim().toLowerCase();return c.charAt(0)==="."?r.toLowerCase().endsWith(c):c.endsWith("/*")?s===c.replace(/\/.*$/,""):o===c})}return!0};function IS(e){return NW(e)||AW(e)||GP(e)||DW()}function DW(){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 AW(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function NW(e){if(Array.isArray(e))return ob(e)}function ES(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 OS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ES(Object(n),!0).forEach(function(r){UP(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ES(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function UP(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vd(e,t){return LW(e)||$W(e,t)||GP(e,t)||TW()}function TW(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function GP(e,t){if(e){if(typeof e=="string")return ob(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 ob(e,t)}}function ob(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 $W(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,c;try{for(n=n.call(e);!(o=(i=n.next()).done)&&(r.push(i.value),!(t&&r.length===t));o=!0);}catch(f){s=!0,c=f}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw c}}return r}}function LW(e){if(Array.isArray(e))return e}var FW="file-invalid-type",zW="file-too-large",BW="file-too-small",HW="too-many-files",WW=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:FW,message:"File type must be ".concat(n)}},MS=function(t){return{code:zW,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},RS=function(t){return{code:BW,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},VW={code:HW,message:"Too many files"};function qP(e,t){var n=e.type==="application/x-moz-file"||RW(e,t);return[n,n?null:WW(t)]}function KP(e,t,n){if(ml(e.size))if(ml(t)&&ml(n)){if(e.size>n)return[!1,MS(n)];if(e.size<t)return[!1,RS(t)]}else{if(ml(t)&&e.size<t)return[!1,RS(t)];if(ml(n)&&e.size>n)return[!1,MS(n)]}return[!0,null]}function ml(e){return e!=null}function UW(e){var t=e.files,n=e.accept,r=e.minSize,o=e.maxSize,s=e.multiple,i=e.maxFiles,c=e.validator;return!s&&t.length>1||s&&i>=1&&t.length>i?!1:t.every(function(f){var p=qP(f,n),h=Vd(p,1),m=h[0],v=KP(f,r,o),b=Vd(v,1),y=b[0],x=c?c(f):null;return m&&y&&!x})}function Th(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Ep(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 DS(e){e.preventDefault()}function GW(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function qW(e){return e.indexOf("Edge/")!==-1}function KW(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return GW(e)||qW(e)}function fa(){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(c){return!Th(r)&&c&&c.apply(void 0,[r].concat(s)),Th(r)})}}function XW(){return"showOpenFilePicker"in window}function QW(e){if(ml(e)){var t=Object.entries(e).filter(function(n){var r=Vd(n,2),o=r[0],s=r[1],i=!0;return XP(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(QP))&&(console.warn('Skipped "'.concat(o,'" because an invalid file extension was provided.')),i=!1),i}).reduce(function(n,r){var o=Vd(r,2),s=o[0],i=o[1];return OS(OS({},n),{},UP({},s,i))},{});return[{description:"Files",accept:t}]}return e}function YW(e){if(ml(e))return Object.entries(e).reduce(function(t,n){var r=Vd(n,2),o=r[0],s=r[1];return[].concat(IS(t),[o],IS(s))},[]).filter(function(t){return XP(t)||QP(t)}).join(",")}function JW(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function ZW(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function XP(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function QP(e){return/^.*\.[\w]+$/.test(e)}var eV=["children"],tV=["open"],nV=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],rV=["refKey","onChange","onClick"];function oV(e){return iV(e)||aV(e)||YP(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 aV(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function iV(e){if(Array.isArray(e))return sb(e)}function Av(e,t){return uV(e)||cV(e,t)||YP(e,t)||lV()}function lV(){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 YP(e,t){if(e){if(typeof e=="string")return sb(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 sb(e,t)}}function sb(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 cV(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,c;try{for(n=n.call(e);!(o=(i=n.next()).done)&&(r.push(i.value),!(t&&r.length===t));o=!0);}catch(f){s=!0,c=f}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw c}}return r}}function uV(e){if(Array.isArray(e))return e}function AS(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 ur(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AS(Object(n),!0).forEach(function(r){ab(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ab(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $h(e,t){if(e==null)return{};var n=dV(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 dV(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 ay=u.forwardRef(function(e,t){var n=e.children,r=$h(e,eV),o=iy(r),s=o.open,i=$h(o,tV);return u.useImperativeHandle(t,function(){return{open:s}},[s]),H.createElement(u.Fragment,null,n(ur(ur({},i),{},{open:s})))});ay.displayName="Dropzone";var JP={disabled:!1,getFilesFromEvent:SW,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};ay.defaultProps=JP;ay.propTypes={children:zn.func,accept:zn.objectOf(zn.arrayOf(zn.string)),multiple:zn.bool,preventDropOnDocument:zn.bool,noClick:zn.bool,noKeyboard:zn.bool,noDrag:zn.bool,noDragEventsBubbling:zn.bool,minSize:zn.number,maxSize:zn.number,maxFiles:zn.number,disabled:zn.bool,getFilesFromEvent:zn.func,onFileDialogCancel:zn.func,onFileDialogOpen:zn.func,useFsAccessApi:zn.bool,autoFocus:zn.bool,onDragEnter:zn.func,onDragLeave:zn.func,onDragOver:zn.func,onDrop:zn.func,onDropAccepted:zn.func,onDropRejected:zn.func,onError:zn.func,validator:zn.func};var ib={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function iy(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=ur(ur({},JP),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,s=t.maxSize,i=t.minSize,c=t.multiple,f=t.maxFiles,p=t.onDragEnter,h=t.onDragLeave,m=t.onDragOver,v=t.onDrop,b=t.onDropAccepted,y=t.onDropRejected,x=t.onFileDialogCancel,C=t.onFileDialogOpen,k=t.useFsAccessApi,j=t.autoFocus,_=t.preventDropOnDocument,I=t.noClick,O=t.noKeyboard,E=t.noDrag,M=t.noDragEventsBubbling,R=t.onError,A=t.validator,D=u.useMemo(function(){return YW(n)},[n]),T=u.useMemo(function(){return QW(n)},[n]),K=u.useMemo(function(){return typeof C=="function"?C:NS},[C]),B=u.useMemo(function(){return typeof x=="function"?x:NS},[x]),G=u.useRef(null),Q=u.useRef(null),V=u.useReducer(fV,ib),L=Av(V,2),X=L[0],F=L[1],q=X.isFocused,te=X.isFileDialogActive,Y=u.useRef(typeof window<"u"&&window.isSecureContext&&k&&XW()),ce=function(){!Y.current&&te&&setTimeout(function(){if(Q.current){var We=Q.current.files;We.length||(F({type:"closeDialog"}),B())}},300)};u.useEffect(function(){return window.addEventListener("focus",ce,!1),function(){window.removeEventListener("focus",ce,!1)}},[Q,te,B,Y]);var ae=u.useRef([]),U=function(We){G.current&&G.current.contains(We.target)||(We.preventDefault(),ae.current=[])};u.useEffect(function(){return _&&(document.addEventListener("dragover",DS,!1),document.addEventListener("drop",U,!1)),function(){_&&(document.removeEventListener("dragover",DS),document.removeEventListener("drop",U))}},[G,_]),u.useEffect(function(){return!r&&j&&G.current&&G.current.focus(),function(){}},[G,j,r]);var W=u.useCallback(function(ye){R?R(ye):console.error(ye)},[R]),ne=u.useCallback(function(ye){ye.preventDefault(),ye.persist(),lt(ye),ae.current=[].concat(oV(ae.current),[ye.target]),Ep(ye)&&Promise.resolve(o(ye)).then(function(We){if(!(Th(ye)&&!M)){var Et=We.length,zt=Et>0&&UW({files:We,accept:D,minSize:i,maxSize:s,multiple:c,maxFiles:f,validator:A}),we=Et>0&&!zt;F({isDragAccept:zt,isDragReject:we,isDragActive:!0,type:"setDraggedFiles"}),p&&p(ye)}}).catch(function(We){return W(We)})},[o,p,W,M,D,i,s,c,f,A]),ie=u.useCallback(function(ye){ye.preventDefault(),ye.persist(),lt(ye);var We=Ep(ye);if(We&&ye.dataTransfer)try{ye.dataTransfer.dropEffect="copy"}catch{}return We&&m&&m(ye),!1},[m,M]),oe=u.useCallback(function(ye){ye.preventDefault(),ye.persist(),lt(ye);var We=ae.current.filter(function(zt){return G.current&&G.current.contains(zt)}),Et=We.indexOf(ye.target);Et!==-1&&We.splice(Et,1),ae.current=We,!(We.length>0)&&(F({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Ep(ye)&&h&&h(ye))},[G,h,M]),me=u.useCallback(function(ye,We){var Et=[],zt=[];ye.forEach(function(we){var xt=qP(we,D),Nt=Av(xt,2),Lt=Nt[0],$e=Nt[1],Ke=KP(we,i,s),vn=Av(Ke,2),_e=vn[0],Ze=vn[1],Qe=A?A(we):null;if(Lt&&_e&&!Qe)Et.push(we);else{var ct=[$e,Ze];Qe&&(ct=ct.concat(Qe)),zt.push({file:we,errors:ct.filter(function(Ft){return Ft})})}}),(!c&&Et.length>1||c&&f>=1&&Et.length>f)&&(Et.forEach(function(we){zt.push({file:we,errors:[VW]})}),Et.splice(0)),F({acceptedFiles:Et,fileRejections:zt,type:"setFiles"}),v&&v(Et,zt,We),zt.length>0&&y&&y(zt,We),Et.length>0&&b&&b(Et,We)},[F,c,D,i,s,f,v,b,y,A]),fe=u.useCallback(function(ye){ye.preventDefault(),ye.persist(),lt(ye),ae.current=[],Ep(ye)&&Promise.resolve(o(ye)).then(function(We){Th(ye)&&!M||me(We,ye)}).catch(function(We){return W(We)}),F({type:"reset"})},[o,me,W,M]),he=u.useCallback(function(){if(Y.current){F({type:"openDialog"}),K();var ye={multiple:c,types:T};window.showOpenFilePicker(ye).then(function(We){return o(We)}).then(function(We){me(We,null),F({type:"closeDialog"})}).catch(function(We){JW(We)?(B(We),F({type:"closeDialog"})):ZW(We)?(Y.current=!1,Q.current?(Q.current.value=null,Q.current.click()):W(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."))):W(We)});return}Q.current&&(F({type:"openDialog"}),K(),Q.current.value=null,Q.current.click())},[F,K,B,k,me,W,T,c]),Ce=u.useCallback(function(ye){!G.current||!G.current.isEqualNode(ye.target)||(ye.key===" "||ye.key==="Enter"||ye.keyCode===32||ye.keyCode===13)&&(ye.preventDefault(),he())},[G,he]),xe=u.useCallback(function(){F({type:"focus"})},[]),de=u.useCallback(function(){F({type:"blur"})},[]),Ne=u.useCallback(function(){I||(KW()?setTimeout(he,0):he())},[I,he]),De=function(We){return r?null:We},Xe=function(We){return O?null:De(We)},It=function(We){return E?null:De(We)},lt=function(We){M&&We.stopPropagation()},on=u.useMemo(function(){return function(){var ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},We=ye.refKey,Et=We===void 0?"ref":We,zt=ye.role,we=ye.onKeyDown,xt=ye.onFocus,Nt=ye.onBlur,Lt=ye.onClick,$e=ye.onDragEnter,Ke=ye.onDragOver,vn=ye.onDragLeave,_e=ye.onDrop,Ze=$h(ye,nV);return ur(ur(ab({onKeyDown:Xe(fa(we,Ce)),onFocus:Xe(fa(xt,xe)),onBlur:Xe(fa(Nt,de)),onClick:De(fa(Lt,Ne)),onDragEnter:It(fa($e,ne)),onDragOver:It(fa(Ke,ie)),onDragLeave:It(fa(vn,oe)),onDrop:It(fa(_e,fe)),role:typeof zt=="string"&&zt!==""?zt:"presentation"},Et,G),!r&&!O?{tabIndex:0}:{}),Ze)}},[G,Ce,xe,de,Ne,ne,ie,oe,fe,O,E,r]),gt=u.useCallback(function(ye){ye.stopPropagation()},[]),bt=u.useMemo(function(){return function(){var ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},We=ye.refKey,Et=We===void 0?"ref":We,zt=ye.onChange,we=ye.onClick,xt=$h(ye,rV),Nt=ab({accept:D,multiple:c,type:"file",style:{display:"none"},onChange:De(fa(zt,fe)),onClick:De(fa(we,gt)),tabIndex:-1},Et,Q);return ur(ur({},Nt),xt)}},[Q,n,c,fe,r]);return ur(ur({},X),{},{isFocused:q&&!r,getRootProps:on,getInputProps:bt,rootRef:G,inputRef:Q,open:De(he)})}function fV(e,t){switch(t.type){case"focus":return ur(ur({},e),{},{isFocused:!0});case"blur":return ur(ur({},e),{},{isFocused:!1});case"openDialog":return ur(ur({},ib),{},{isFileDialogActive:!0});case"closeDialog":return ur(ur({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return ur(ur({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return ur(ur({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return ur({},ib);default:return e}}function NS(){}function lb(){return lb=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},lb.apply(this,arguments)}var ZP=["shift","alt","meta","mod","ctrl"],pV={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 Ti(e){return(pV[e]||e).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function hV(e){return ZP.includes(e)}function Nv(e,t){return t===void 0&&(t=","),e.split(t)}function Tv(e,t,n){t===void 0&&(t="+");var r=e.toLocaleLowerCase().split(t).map(function(i){return Ti(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!ZP.includes(i)});return lb({},o,{keys:s,description:n})}(function(){typeof document<"u"&&(document.addEventListener("keydown",function(e){e.key!==void 0&&eI([Ti(e.key),Ti(e.code)])}),document.addEventListener("keyup",function(e){e.key!==void 0&&tI([Ti(e.key),Ti(e.code)])})),typeof window<"u"&&window.addEventListener("blur",function(){$i.clear()})})();var $i=new Set;function ly(e){return Array.isArray(e)}function fh(e,t){t===void 0&&(t=",");var n=ly(e)?e:e.split(t);return n.every(function(r){return $i.has(r.trim().toLowerCase())})}function eI(e){var t=Array.isArray(e)?e:[e];$i.has("meta")&&$i.forEach(function(n){return!hV(n)&&$i.delete(n.toLowerCase())}),t.forEach(function(n){return $i.add(n.toLowerCase())})}function tI(e){var t=Array.isArray(e)?e:[e];e==="meta"?$i.clear():t.forEach(function(n){return $i.delete(n.toLowerCase())})}function mV(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function gV(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function vV(e){return nI(e,["input","textarea","select"])}function nI(e,t){var n=e.target;t===void 0&&(t=!1);var r=n&&n.tagName;return ly(t)?!!(r&&t&&t.some(function(o){return o.toLowerCase()===r.toLowerCase()})):!!(r&&t&&t===!0)}function bV(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 xV=function(t,n,r){r===void 0&&(r=!1);var o=n.alt,s=n.meta,i=n.mod,c=n.shift,f=n.ctrl,p=n.keys,h=t.key,m=t.code,v=t.ctrlKey,b=t.metaKey,y=t.shiftKey,x=t.altKey,C=Ti(m),k=h.toLowerCase();if(!r){if(o===!x&&k!=="alt"||c===!y&&k!=="shift")return!1;if(i){if(!b&&!v)return!1}else if(s===!b&&k!=="meta"&&k!=="os"||f===!v&&k!=="ctrl"&&k!=="control")return!1}return p&&p.length===1&&(p.includes(k)||p.includes(C))?!0:p?fh(p):!p},yV=u.createContext(void 0),wV=function(){return u.useContext(yV)};function rI(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&&rI(e[r],t[r])},!0):e===t}var CV=u.createContext({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),SV=function(){return u.useContext(CV)};function kV(e){var t=u.useRef(void 0);return rI(t.current,e)||(t.current=e),t.current}var TS=function(t){t.stopPropagation(),t.preventDefault(),t.stopImmediatePropagation()},jV=typeof window<"u"?u.useLayoutEffect:u.useEffect;function St(e,t,n,r){var o=u.useRef(null),s=u.useRef(!1),i=n instanceof Array?r instanceof Array?void 0:r:n,c=ly(e)?e.join(i==null?void 0:i.splitKey):e,f=n instanceof Array?n:r instanceof Array?r:void 0,p=u.useCallback(t,f??[]),h=u.useRef(p);f?h.current=p:h.current=t;var m=kV(i),v=SV(),b=v.enabledScopes,y=wV();return jV(function(){if(!((m==null?void 0:m.enabled)===!1||!bV(b,m==null?void 0:m.scopes))){var x=function(I,O){var E;if(O===void 0&&(O=!1),!(vV(I)&&!nI(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)){TS(I);return}(E=I.target)!=null&&E.isContentEditable&&!(m!=null&&m.enableOnContentEditable)||Nv(c,m==null?void 0:m.splitKey).forEach(function(M){var R,A=Tv(M,m==null?void 0:m.combinationKey);if(xV(I,A,m==null?void 0:m.ignoreModifiers)||(R=A.keys)!=null&&R.includes("*")){if(O&&s.current)return;if(mV(I,A,m==null?void 0:m.preventDefault),!gV(I,A,m==null?void 0:m.enabled)){TS(I);return}h.current(I,A),O||(s.current=!0)}})}},C=function(I){I.key!==void 0&&(eI(Ti(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&&(tI(Ti(I.code)),s.current=!1,m!=null&&m.keyup&&x(I,!0))},j=o.current||(i==null?void 0:i.document)||document;return j.addEventListener("keyup",k),j.addEventListener("keydown",C),y&&Nv(c,m==null?void 0:m.splitKey).forEach(function(_){return y.addHotkey(Tv(_,m==null?void 0:m.combinationKey,m==null?void 0:m.description))}),function(){j.removeEventListener("keyup",k),j.removeEventListener("keydown",C),y&&Nv(c,m==null?void 0:m.splitKey).forEach(function(_){return y.removeHotkey(Tv(_,m==null?void 0:m.combinationKey,m==null?void 0:m.description))})}}},[c,m,b]),o}const _V=e=>{const{isDragAccept:t,isDragReject:n,setIsHandlingUpload:r}=e;return St("esc",()=>{r(!1)}),a.jsxs(Fe,{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(ds,{size:"lg",children:"Drop to Upload"}):a.jsxs(a.Fragment,{children:[a.jsx(ds,{size:"lg",children:"Invalid Upload"}),a.jsx(ds,{size:"md",children:"Must be single JPEG or PNG image"})]})})})]})},PV=u.memo(_V),IV=le([ke,jr],({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}},Oe),EV=e=>{const{children:t}=e,{autoAddBoardId:n,postUploadAction:r}=z(IV),o=z(Or),s=Kl(),{t:i}=Ie(),[c,f]=u.useState(!1),[p]=H_(),h=u.useCallback(_=>{f(!0),s({title:i("toast.uploadFailed"),description:_.errors.map(I=>I.message).join(`
`),status:"error"})},[i,s]),m=u.useCallback(async _=>{p({file:_,image_category:"user",is_intermediate:!1,postUploadAction:r,board_id:n==="none"?void 0:n})},[n,r,p]),v=u.useCallback((_,I)=>{if(I.length>1){s({title:i("toast.uploadFailed"),description:i("toast.uploadFailedInvalidUploadDesc"),status:"error"});return}I.forEach(O=>{h(O)}),_.forEach(O=>{m(O)})},[i,s,m,h]),{getRootProps:b,getInputProps:y,isDragAccept:x,isDragReject:C,isDragActive:k,inputRef:j}=iy({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},noClick:!0,onDrop:v,onDragOver:()=>f(!0),disabled:o,multiple:!1});return u.useEffect(()=>{const _=async I=>{var O,E;j.current&&(O=I.clipboardData)!=null&&O.files&&(j.current.files=I.clipboardData.files,(E=j.current)==null||E.dispatchEvent(new Event("change",{bubbles:!0})))};return document.addEventListener("paste",_),()=>{document.removeEventListener("paste",_)}},[j]),a.jsxs(Fe,{...b({style:{}}),onKeyDown:_=>{_.key},children:[a.jsx("input",{...y()}),t,a.jsx(co,{children:k&&c&&a.jsx(yr.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}},children:a.jsx(PV,{isDragAccept:x,isDragReject:C,setIsHandlingUpload:f})},"image-upload-overlay")})]})},OV=u.memo(EV),MV=Te((e,t)=>{const{children:n,tooltip:r="",tooltipProps:{placement:o="top",hasArrow:s=!0,...i}={},isChecked:c,...f}=e;return a.jsx(Mn,{label:r,placement:o,hasArrow:s,...i,children:a.jsx(iu,{ref:t,colorScheme:c?"accent":"base",...f,children:n})})}),Wt=u.memo(MV);function RV(e){const t=u.createContext(null);return[({children:o,value:s})=>H.createElement(t.Provider,{value:s},o),()=>{const o=u.useContext(t);if(o===null)throw new Error(e);return o}]}function oI(e){return Array.isArray(e)?e:[e]}const DV=()=>{};function AV(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||DV:n=>{var r;n.key==="Escape"&&(e(n),(r=t.onTrigger)==null||r.call(t))}}function sI({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 aI(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==H.Fragment:!1}function iI(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=iI(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function lI(){for(var e=0,t,n,r="";e<arguments.length;)(t=arguments[e++])&&(n=iI(t))&&(r&&(r+=" "),r+=n);return r}const NV={app:100,modal:200,popover:300,overlay:400,max:9999};function cy(e){return NV[e]}function TV(e,t){const n=u.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 $V=T7({key:"mantine",prepend:!0});function LV(){return P3()||$V}var FV=Object.defineProperty,$S=Object.getOwnPropertySymbols,zV=Object.prototype.hasOwnProperty,BV=Object.prototype.propertyIsEnumerable,LS=(e,t,n)=>t in e?FV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,HV=(e,t)=>{for(var n in t||(t={}))zV.call(t,n)&&LS(e,n,t[n]);if($S)for(var n of $S(t))BV.call(t,n)&&LS(e,n,t[n]);return e};const $v="ref";function WV(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(!($v in n))return{args:e,ref:t};t=n[$v];const r=HV({},n);return delete r[$v],{args:[r],ref:t}}const{cssFactory:VV}=(()=>{function e(n,r,o){const s=[],i=F7(n,s,o);return s.length<2?o:i+r(s)}function t(n){const{cache:r}=n,o=(...i)=>{const{ref:c,args:f}=WV(i),p=$7(f,r.registered);return L7(r,p,!1),`${r.key}-${p.name}${c===void 0?"":` ${c}`}`};return{css:o,cx:(...i)=>e(r.registered,o,lI(i))}}return{cssFactory:t}})();function cI(){const e=LV();return TV(()=>VV({cache:e}),[e])}function UV({cx:e,classes:t,context:n,classNames:r,name:o,cache:s}){const i=n.reduce((c,f)=>(Object.keys(f.classNames).forEach(p=>{typeof c[p]!="string"?c[p]=`${f.classNames[p]}`:c[p]=`${c[p]} ${f.classNames[p]}`}),c),{});return Object.keys(t).reduce((c,f)=>(c[f]=e(t[f],i[f],r!=null&&r[f],Array.isArray(o)?o.filter(Boolean).map(p=>`${(s==null?void 0:s.key)||"mantine"}-${p}-${f}`).join(" "):o?`${(s==null?void 0:s.key)||"mantine"}-${o}-${f}`:null),c),{})}var GV=Object.defineProperty,FS=Object.getOwnPropertySymbols,qV=Object.prototype.hasOwnProperty,KV=Object.prototype.propertyIsEnumerable,zS=(e,t,n)=>t in e?GV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Lv=(e,t)=>{for(var n in t||(t={}))qV.call(t,n)&&zS(e,n,t[n]);if(FS)for(var n of FS(t))KV.call(t,n)&&zS(e,n,t[n]);return e};function cb(e,t){return t&&Object.keys(t).forEach(n=>{e[n]?e[n]=Lv(Lv({},e[n]),t[n]):e[n]=Lv({},t[n])}),e}function BS(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)=>cb(s,i),{}):o(e)}function XV({ctx:e,theme:t,params:n,variant:r,size:o}){return e.reduce((s,i)=>(i.variants&&r in i.variants&&cb(s,i.variants[r](t,n,{variant:r,size:o})),i.sizes&&o in i.sizes&&cb(s,i.sizes[o](t,n,{variant:r,size:o})),s),{})}function fo(e){const t=typeof e=="function"?e:()=>e;function n(r,o){const s=pi(),i=l9(o==null?void 0:o.name),c=P3(),f={variant:o==null?void 0:o.variant,size:o==null?void 0:o.size},{css:p,cx:h}=cI(),m=t(s,r,f),v=BS(o==null?void 0:o.styles,s,r,f),b=BS(i,s,r,f),y=XV({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(C=>{const k=h({[p(m[C])]:!(o!=null&&o.unstyled)},p(y[C]),p(b[C]),p(v[C]));return[C,k]}));return{classes:UV({cx:h,classes:x,context:i,classNames:o==null?void 0:o.classNames,name:o==null?void 0:o.name,cache:c}),cx:h,theme:s}}return n}function HS(e){return`___ref-${e||""}`}var QV=Object.defineProperty,YV=Object.defineProperties,JV=Object.getOwnPropertyDescriptors,WS=Object.getOwnPropertySymbols,ZV=Object.prototype.hasOwnProperty,eU=Object.prototype.propertyIsEnumerable,VS=(e,t,n)=>t in e?QV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,id=(e,t)=>{for(var n in t||(t={}))ZV.call(t,n)&&VS(e,n,t[n]);if(WS)for(var n of WS(t))eU.call(t,n)&&VS(e,n,t[n]);return e},ld=(e,t)=>YV(e,JV(t));const cd={in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${Ge(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(-${Ge(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(${Ge(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(${Ge(20)}) rotate(-5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${Ge(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:ld(id({},cd),{common:{transformOrigin:"center center"}}),"pop-bottom-left":ld(id({},cd),{common:{transformOrigin:"bottom left"}}),"pop-bottom-right":ld(id({},cd),{common:{transformOrigin:"bottom right"}}),"pop-top-left":ld(id({},cd),{common:{transformOrigin:"top left"}}),"pop-top-right":ld(id({},cd),{common:{transformOrigin:"top right"}})},US=["mousedown","touchstart"];function tU(e,t,n){const r=u.useRef();return u.useEffect(()=>{const o=s=>{const{target:i}=s??{};if(Array.isArray(n)){const c=(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))&&!c&&e()}else r.current&&!r.current.contains(i)&&e()};return(t||US).forEach(s=>document.addEventListener(s,o)),()=>{(t||US).forEach(s=>document.removeEventListener(s,o))}},[r,e,n]),r}function nU(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function rU(e,t){return typeof t=="boolean"?t:typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function oU(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,o]=u.useState(n?t:rU(e,t)),s=u.useRef();return u.useEffect(()=>{if("matchMedia"in window)return s.current=window.matchMedia(e),o(s.current.matches),nU(s.current,i=>o(i.matches))},[e]),r}const uI=typeof document<"u"?u.useLayoutEffect:u.useEffect;function Hs(e,t){const n=u.useRef(!1);u.useEffect(()=>()=>{n.current=!1},[]),u.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function sU({opened:e,shouldReturnFocus:t=!0}){const n=u.useRef(),r=()=>{var o;n.current&&"focus"in n.current&&typeof n.current.focus=="function"&&((o=n.current)==null||o.focus({preventScroll:!0}))};return Hs(()=>{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 aU=/input|select|textarea|button|object/,dI="a, input, select, textarea, button, object, [tabindex]";function iU(e){return e.style.display==="none"}function lU(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(iU(n))return!1;n=n.parentNode}return!0}function fI(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function ub(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(fI(e));return(aU.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&lU(e)}function pI(e){const t=fI(e);return(Number.isNaN(t)||t>=0)&&ub(e)}function cU(e){return Array.from(e.querySelectorAll(dI)).filter(pI)}function uU(e,t){const n=cU(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 uy(){return`mantine-${Math.random().toString(36).slice(2,11)}`}function dU(e,t="body > :not(script)"){const n=uy(),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"),c=o.getAttribute("data-hidden"),f=o.getAttribute("data-focus-id");return o.setAttribute("data-focus-id",n),i===null||i==="false"?o.setAttribute("aria-hidden","true"):!c&&!f&&o.setAttribute("data-hidden",i),{node:o,ariaHidden:c||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 fU(e=!0){const t=u.useRef(),n=u.useRef(null),r=s=>{let i=s.querySelector("[data-autofocus]");if(!i){const c=Array.from(s.querySelectorAll(dI));i=c.find(pI)||c.find(ub)||null,!i&&ub(s)&&(i=s)}i&&i.focus({preventScroll:!0})},o=u.useCallback(s=>{if(e){if(s===null){n.current&&(n.current(),n.current=null);return}n.current=dU(s),t.current!==s&&(s?(setTimeout(()=>{s.getRootNode()&&r(s)}),t.current=s):t.current=null)}},[e]);return u.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>r(t.current));const s=i=>{i.key==="Tab"&&t.current&&uU(t.current,i)};return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s),n.current&&n.current()}},[e]),o}const pU=H["useId".toString()]||(()=>{});function hU(){const e=pU();return e?`mantine-${e.replace(/:/g,"")}`:""}function dy(e){const t=hU(),[n,r]=u.useState(t);return uI(()=>{r(uy())},[]),typeof e=="string"?e:typeof window>"u"?t:n}function GS(e,t,n){u.useEffect(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function hI(e,t){typeof e=="function"?e(t):typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function mU(...e){return t=>{e.forEach(n=>hI(n,t))}}function _f(...e){return u.useCallback(mU(...e),e)}function Ud({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){const[o,s]=u.useState(t!==void 0?t:n),i=c=>{s(c),r==null||r(c)};return e!==void 0?[e,r,!0]:[o,i,!1]}function mI(e,t){return oU("(prefers-reduced-motion: reduce)",e,t)}const gU=e=>e<.5?2*e*e:-1+(4-2*e)*e,vU=({axis:e,target:t,parent:n,alignment:r,offset:o,isList:s})=>{if(!t||!n&&typeof document>"u")return 0;const i=!!n,f=(n||document.body).getBoundingClientRect(),p=t.getBoundingClientRect(),h=m=>p[m]-f[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?f.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?f.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},bU=({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]},xU=({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 gI({duration:e=1250,axis:t="y",onScrollFinish:n,easing:r=gU,offset:o=0,cancelable:s=!0,isList:i=!1}={}){const c=u.useRef(0),f=u.useRef(0),p=u.useRef(!1),h=u.useRef(null),m=u.useRef(null),v=mI(),b=()=>{c.current&&cancelAnimationFrame(c.current)},y=u.useCallback(({alignment:C="start"}={})=>{var k;p.current=!1,c.current&&b();const j=(k=bU({parent:h.current,axis:t}))!=null?k:0,_=vU({parent:h.current,target:m.current,axis:t,alignment:C,offset:o,isList:i})-(h.current?0:j);function I(){f.current===0&&(f.current=performance.now());const E=performance.now()-f.current,M=v||e===0?1:E/e,R=j+_*r(M);xU({parent:h.current,axis:t,distance:R}),!p.current&&M<1?c.current=requestAnimationFrame(I):(typeof n=="function"&&n(),f.current=0,c.current=0,b())}I()},[t,e,r,i,o,n,v]),x=()=>{s&&(p.current=!0)};return GS("wheel",x,{passive:!0}),GS("touchmove",x,{passive:!0}),u.useEffect(()=>b,[]),{scrollableRef:h,targetRef:m,scrollIntoView:y,cancel:b}}var qS=Object.getOwnPropertySymbols,yU=Object.prototype.hasOwnProperty,wU=Object.prototype.propertyIsEnumerable,CU=(e,t)=>{var n={};for(var r in e)yU.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&qS)for(var r of qS(e))t.indexOf(r)<0&&wU.call(e,r)&&(n[r]=e[r]);return n};function wg(e){const t=e,{m:n,mx:r,my:o,mt:s,mb:i,ml:c,mr:f,p,px:h,py:m,pt:v,pb:b,pl:y,pr:x,bg:C,c:k,opacity:j,ff:_,fz:I,fw:O,lts:E,ta:M,lh:R,fs:A,tt:D,td:T,w:K,miw:B,maw:G,h:Q,mih:V,mah:L,bgsz:X,bgp:F,bgr:q,bga:te,pos:Y,top:ce,left:ae,bottom:U,right:W,inset:ne,display:ie}=t,oe=CU(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:c9({m:n,mx:r,my:o,mt:s,mb:i,ml:c,mr:f,p,px:h,py:m,pt:v,pb:b,pl:y,pr:x,bg:C,c:k,opacity:j,ff:_,fz:I,fw:O,lts:E,ta:M,lh:R,fs:A,tt:D,td:T,w:K,miw:B,maw:G,h:Q,mih:V,mah:L,bgsz:X,bgp:F,bgr:q,bga:te,pos:Y,top:ce,left:ae,bottom:U,right:W,inset:ne,display:ie}),rest:oe}}function SU(e,t){const n=Object.keys(e).filter(r=>r!=="base").sort((r,o)=>AC(Gt({size:r,sizes:t.breakpoints}))-AC(Gt({size:o,sizes:t.breakpoints})));return"base"in e?["base",...n]:n}function kU({value:e,theme:t,getValue:n,property:r}){if(e==null)return;if(typeof e=="object")return SU(e,t).reduce((i,c)=>{if(c==="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 f=n(e[c],t);return Array.isArray(r)?(i[t.fn.largerThan(c)]={},r.forEach(p=>{i[t.fn.largerThan(c)][p]=f}),i):(i[t.fn.largerThan(c)]={[r]:f},i)},{});const o=n(e,t);return Array.isArray(r)?r.reduce((s,i)=>(s[i]=o,s),{}):{[r]:o}}function jU(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 _U(e){return Ge(e)}function PU(e){return e}function IU(e,t){return Gt({size:e,sizes:t.fontSizes})}const EU=["-xs","-sm","-md","-lg","-xl"];function OU(e,t){return EU.includes(e)?`calc(${Gt({size:e.replace("-",""),sizes:t.spacing})} * -1)`:Gt({size:e,sizes:t.spacing})}const MU={identity:PU,color:jU,size:_U,fontSize:IU,spacing:OU},RU={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 DU=Object.defineProperty,KS=Object.getOwnPropertySymbols,AU=Object.prototype.hasOwnProperty,NU=Object.prototype.propertyIsEnumerable,XS=(e,t,n)=>t in e?DU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,QS=(e,t)=>{for(var n in t||(t={}))AU.call(t,n)&&XS(e,n,t[n]);if(KS)for(var n of KS(t))NU.call(t,n)&&XS(e,n,t[n]);return e};function YS(e,t,n=RU){return Object.keys(n).reduce((o,s)=>(s in e&&e[s]!==void 0&&o.push(kU({value:e[s],getValue:MU[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]=QS(QS({},o[i]),s[i]):o[i]=s[i]}),o),{})}function JS(e,t){return typeof e=="function"?e(t):e}function TU(e,t,n){const r=pi(),{css:o,cx:s}=cI();return Array.isArray(e)?s(n,o(YS(t,r)),e.map(i=>o(JS(i,r)))):s(n,o(JS(e,r)),o(YS(t,r)))}var $U=Object.defineProperty,Lh=Object.getOwnPropertySymbols,vI=Object.prototype.hasOwnProperty,bI=Object.prototype.propertyIsEnumerable,ZS=(e,t,n)=>t in e?$U(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,LU=(e,t)=>{for(var n in t||(t={}))vI.call(t,n)&&ZS(e,n,t[n]);if(Lh)for(var n of Lh(t))bI.call(t,n)&&ZS(e,n,t[n]);return e},FU=(e,t)=>{var n={};for(var r in e)vI.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&&bI.call(e,r)&&(n[r]=e[r]);return n};const xI=u.forwardRef((e,t)=>{var n=e,{className:r,component:o,style:s,sx:i}=n,c=FU(n,["className","component","style","sx"]);const{systemStyles:f,rest:p}=wg(c),h=o||"div";return H.createElement(h,LU({ref:t,className:TU(i,f,r),style:s},p))});xI.displayName="@mantine/core/Box";const No=xI;var zU=Object.defineProperty,BU=Object.defineProperties,HU=Object.getOwnPropertyDescriptors,e4=Object.getOwnPropertySymbols,WU=Object.prototype.hasOwnProperty,VU=Object.prototype.propertyIsEnumerable,t4=(e,t,n)=>t in e?zU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,n4=(e,t)=>{for(var n in t||(t={}))WU.call(t,n)&&t4(e,n,t[n]);if(e4)for(var n of e4(t))VU.call(t,n)&&t4(e,n,t[n]);return e},UU=(e,t)=>BU(e,HU(t)),GU=fo(e=>({root:UU(n4(n4({},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 qU=GU;var KU=Object.defineProperty,Fh=Object.getOwnPropertySymbols,yI=Object.prototype.hasOwnProperty,wI=Object.prototype.propertyIsEnumerable,r4=(e,t,n)=>t in e?KU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,XU=(e,t)=>{for(var n in t||(t={}))yI.call(t,n)&&r4(e,n,t[n]);if(Fh)for(var n of Fh(t))wI.call(t,n)&&r4(e,n,t[n]);return e},QU=(e,t)=>{var n={};for(var r in e)yI.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&&wI.call(e,r)&&(n[r]=e[r]);return n};const CI=u.forwardRef((e,t)=>{const n=_r("UnstyledButton",{},e),{className:r,component:o="button",unstyled:s,variant:i}=n,c=QU(n,["className","component","unstyled","variant"]),{classes:f,cx:p}=qU(null,{name:"UnstyledButton",unstyled:s,variant:i});return H.createElement(No,XU({component:o,ref:t,className:p(f.root,r),type:o==="button"?"button":void 0},c))});CI.displayName="@mantine/core/UnstyledButton";const YU=CI;var JU=Object.defineProperty,ZU=Object.defineProperties,eG=Object.getOwnPropertyDescriptors,o4=Object.getOwnPropertySymbols,tG=Object.prototype.hasOwnProperty,nG=Object.prototype.propertyIsEnumerable,s4=(e,t,n)=>t in e?JU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,db=(e,t)=>{for(var n in t||(t={}))tG.call(t,n)&&s4(e,n,t[n]);if(o4)for(var n of o4(t))nG.call(t,n)&&s4(e,n,t[n]);return e},a4=(e,t)=>ZU(e,eG(t));const rG=["subtle","filled","outline","light","default","transparent","gradient"],Mp={xs:Ge(18),sm:Ge(22),md:Ge(28),lg:Ge(34),xl:Ge(44)};function oG({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%"})}:rG.includes(e)?db({border:`${Ge(1)} solid ${o.border}`,backgroundColor:o.background,color:o.color},t.fn.hover({backgroundColor:o.hover})):null}var sG=fo((e,{radius:t,color:n,gradient:r},{variant:o,size:s})=>({root:a4(db({position:"relative",borderRadius:e.fn.radius(t),padding:0,lineHeight:1,display:"flex",alignItems:"center",justifyContent:"center",height:Gt({size:s,sizes:Mp}),minHeight:Gt({size:s,sizes:Mp}),width:Gt({size:s,sizes:Mp}),minWidth:Gt({size:s,sizes:Mp})},oG({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":a4(db({content:'""'},e.fn.cover(Ge(-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 aG=sG;var iG=Object.defineProperty,zh=Object.getOwnPropertySymbols,SI=Object.prototype.hasOwnProperty,kI=Object.prototype.propertyIsEnumerable,i4=(e,t,n)=>t in e?iG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,l4=(e,t)=>{for(var n in t||(t={}))SI.call(t,n)&&i4(e,n,t[n]);if(zh)for(var n of zh(t))kI.call(t,n)&&i4(e,n,t[n]);return e},c4=(e,t)=>{var n={};for(var r in e)SI.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&&kI.call(e,r)&&(n[r]=e[r]);return n};function lG(e){var t=e,{size:n,color:r}=t,o=c4(t,["size","color"]);const s=o,{style:i}=s,c=c4(s,["style"]);return H.createElement("svg",l4({viewBox:"0 0 135 140",xmlns:"http://www.w3.org/2000/svg",fill:r,style:l4({width:n},i)},c),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 cG=Object.defineProperty,Bh=Object.getOwnPropertySymbols,jI=Object.prototype.hasOwnProperty,_I=Object.prototype.propertyIsEnumerable,u4=(e,t,n)=>t in e?cG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,d4=(e,t)=>{for(var n in t||(t={}))jI.call(t,n)&&u4(e,n,t[n]);if(Bh)for(var n of Bh(t))_I.call(t,n)&&u4(e,n,t[n]);return e},f4=(e,t)=>{var n={};for(var r in e)jI.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&&_I.call(e,r)&&(n[r]=e[r]);return n};function uG(e){var t=e,{size:n,color:r}=t,o=f4(t,["size","color"]);const s=o,{style:i}=s,c=f4(s,["style"]);return H.createElement("svg",d4({viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:r,style:d4({width:n,height:n},i)},c),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 dG=Object.defineProperty,Hh=Object.getOwnPropertySymbols,PI=Object.prototype.hasOwnProperty,II=Object.prototype.propertyIsEnumerable,p4=(e,t,n)=>t in e?dG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,h4=(e,t)=>{for(var n in t||(t={}))PI.call(t,n)&&p4(e,n,t[n]);if(Hh)for(var n of Hh(t))II.call(t,n)&&p4(e,n,t[n]);return e},m4=(e,t)=>{var n={};for(var r in e)PI.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&&II.call(e,r)&&(n[r]=e[r]);return n};function fG(e){var t=e,{size:n,color:r}=t,o=m4(t,["size","color"]);const s=o,{style:i}=s,c=m4(s,["style"]);return H.createElement("svg",h4({viewBox:"0 0 120 30",xmlns:"http://www.w3.org/2000/svg",fill:r,style:h4({width:n},i)},c),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 pG=Object.defineProperty,Wh=Object.getOwnPropertySymbols,EI=Object.prototype.hasOwnProperty,OI=Object.prototype.propertyIsEnumerable,g4=(e,t,n)=>t in e?pG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hG=(e,t)=>{for(var n in t||(t={}))EI.call(t,n)&&g4(e,n,t[n]);if(Wh)for(var n of Wh(t))OI.call(t,n)&&g4(e,n,t[n]);return e},mG=(e,t)=>{var n={};for(var r in e)EI.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&&OI.call(e,r)&&(n[r]=e[r]);return n};const Fv={bars:lG,oval:uG,dots:fG},gG={xs:Ge(18),sm:Ge(22),md:Ge(36),lg:Ge(44),xl:Ge(58)},vG={size:"md"};function MI(e){const t=_r("Loader",vG,e),{size:n,color:r,variant:o}=t,s=mG(t,["size","color","variant"]),i=pi(),c=o in Fv?o:i.loader;return H.createElement(No,hG({role:"presentation",component:Fv[c]||Fv.bars,size:Gt({size:n,sizes:gG}),color:i.fn.variant({variant:"filled",primaryFallback:!1,color:r||i.primaryColor}).background},s))}MI.displayName="@mantine/core/Loader";var bG=Object.defineProperty,Vh=Object.getOwnPropertySymbols,RI=Object.prototype.hasOwnProperty,DI=Object.prototype.propertyIsEnumerable,v4=(e,t,n)=>t in e?bG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,b4=(e,t)=>{for(var n in t||(t={}))RI.call(t,n)&&v4(e,n,t[n]);if(Vh)for(var n of Vh(t))DI.call(t,n)&&v4(e,n,t[n]);return e},xG=(e,t)=>{var n={};for(var r in e)RI.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&&DI.call(e,r)&&(n[r]=e[r]);return n};const yG={color:"gray",size:"md",variant:"subtle"},AI=u.forwardRef((e,t)=>{const n=_r("ActionIcon",yG,e),{className:r,color:o,children:s,radius:i,size:c,variant:f,gradient:p,disabled:h,loaderProps:m,loading:v,unstyled:b,__staticSelector:y}=n,x=xG(n,["className","color","children","radius","size","variant","gradient","disabled","loaderProps","loading","unstyled","__staticSelector"]),{classes:C,cx:k,theme:j}=aG({radius:i,color:o,gradient:p},{name:["ActionIcon",y],unstyled:b,size:c,variant:f}),_=H.createElement(MI,b4({color:j.fn.variant({color:o,variant:f}).color,size:"100%","data-action-icon-loader":!0},m));return H.createElement(YU,b4({className:k(C.root,r),ref:t,disabled:h,"data-disabled":h||void 0,"data-loading":v||void 0,unstyled:b},x),v?_:s)});AI.displayName="@mantine/core/ActionIcon";const wG=AI;var CG=Object.defineProperty,SG=Object.defineProperties,kG=Object.getOwnPropertyDescriptors,Uh=Object.getOwnPropertySymbols,NI=Object.prototype.hasOwnProperty,TI=Object.prototype.propertyIsEnumerable,x4=(e,t,n)=>t in e?CG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jG=(e,t)=>{for(var n in t||(t={}))NI.call(t,n)&&x4(e,n,t[n]);if(Uh)for(var n of Uh(t))TI.call(t,n)&&x4(e,n,t[n]);return e},_G=(e,t)=>SG(e,kG(t)),PG=(e,t)=>{var n={};for(var r in e)NI.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&&TI.call(e,r)&&(n[r]=e[r]);return n};function $I(e){const t=_r("Portal",{},e),{children:n,target:r,className:o,innerRef:s}=t,i=PG(t,["children","target","className","innerRef"]),c=pi(),[f,p]=u.useState(!1),h=u.useRef();return uI(()=>(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]),f?fs.createPortal(H.createElement("div",_G(jG({className:o,dir:c.dir},i),{ref:s}),n),h.current):null}$I.displayName="@mantine/core/Portal";var IG=Object.defineProperty,Gh=Object.getOwnPropertySymbols,LI=Object.prototype.hasOwnProperty,FI=Object.prototype.propertyIsEnumerable,y4=(e,t,n)=>t in e?IG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,EG=(e,t)=>{for(var n in t||(t={}))LI.call(t,n)&&y4(e,n,t[n]);if(Gh)for(var n of Gh(t))FI.call(t,n)&&y4(e,n,t[n]);return e},OG=(e,t)=>{var n={};for(var r in e)LI.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&&FI.call(e,r)&&(n[r]=e[r]);return n};function zI(e){var t=e,{withinPortal:n=!0,children:r}=t,o=OG(t,["withinPortal","children"]);return n?H.createElement($I,EG({},o),r):H.createElement(H.Fragment,null,r)}zI.displayName="@mantine/core/OptionalPortal";var MG=Object.defineProperty,qh=Object.getOwnPropertySymbols,BI=Object.prototype.hasOwnProperty,HI=Object.prototype.propertyIsEnumerable,w4=(e,t,n)=>t in e?MG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,C4=(e,t)=>{for(var n in t||(t={}))BI.call(t,n)&&w4(e,n,t[n]);if(qh)for(var n of qh(t))HI.call(t,n)&&w4(e,n,t[n]);return e},RG=(e,t)=>{var n={};for(var r in e)BI.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&&HI.call(e,r)&&(n[r]=e[r]);return n};function WI(e){const t=e,{width:n,height:r,style:o}=t,s=RG(t,["width","height","style"]);return H.createElement("svg",C4({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:C4({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"}))}WI.displayName="@mantine/core/CloseIcon";var DG=Object.defineProperty,Kh=Object.getOwnPropertySymbols,VI=Object.prototype.hasOwnProperty,UI=Object.prototype.propertyIsEnumerable,S4=(e,t,n)=>t in e?DG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,AG=(e,t)=>{for(var n in t||(t={}))VI.call(t,n)&&S4(e,n,t[n]);if(Kh)for(var n of Kh(t))UI.call(t,n)&&S4(e,n,t[n]);return e},NG=(e,t)=>{var n={};for(var r in e)VI.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&&UI.call(e,r)&&(n[r]=e[r]);return n};const TG={xs:Ge(12),sm:Ge(16),md:Ge(20),lg:Ge(28),xl:Ge(34)},$G={size:"sm"},GI=u.forwardRef((e,t)=>{const n=_r("CloseButton",$G,e),{iconSize:r,size:o,children:s}=n,i=NG(n,["iconSize","size","children"]),c=Ge(r||TG[o]);return H.createElement(wG,AG({ref:t,__staticSelector:"CloseButton",size:o},i),s||H.createElement(WI,{width:c,height:c}))});GI.displayName="@mantine/core/CloseButton";const qI=GI;var LG=Object.defineProperty,FG=Object.defineProperties,zG=Object.getOwnPropertyDescriptors,k4=Object.getOwnPropertySymbols,BG=Object.prototype.hasOwnProperty,HG=Object.prototype.propertyIsEnumerable,j4=(e,t,n)=>t in e?LG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Rp=(e,t)=>{for(var n in t||(t={}))BG.call(t,n)&&j4(e,n,t[n]);if(k4)for(var n of k4(t))HG.call(t,n)&&j4(e,n,t[n]);return e},WG=(e,t)=>FG(e,zG(t));function VG({underline:e,strikethrough:t}){const n=[];return e&&n.push("underline"),t&&n.push("line-through"),n.length>0?n.join(" "):"none"}function UG({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 GG(e){return typeof e=="number"?{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical"}:null}function qG({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 KG=fo((e,{color:t,lineClamp:n,truncate:r,inline:o,inherit:s,underline:i,gradient:c,weight:f,transform:p,align:h,strikethrough:m,italic:v},{size:b})=>{const y=e.fn.variant({variant:"gradient",gradient:c});return{root:WG(Rp(Rp(Rp(Rp({},e.fn.fontStyles()),e.fn.focusStyles()),GG(n)),qG({theme:e,truncate:r})),{color:UG({color:t,theme:e}),fontFamily:s?"inherit":e.fontFamily,fontSize:s||b===void 0?"inherit":Gt({size:b,sizes:e.fontSizes}),lineHeight:s?"inherit":o?1:e.lineHeight,textDecoration:VG({underline:i,strikethrough:m}),WebkitTapHighlightColor:"transparent",fontWeight:s?"inherit":f,textTransform:p,textAlign:h,fontStyle:v?"italic":void 0}),gradient:{backgroundImage:y.background,WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"}}});const XG=KG;var QG=Object.defineProperty,Xh=Object.getOwnPropertySymbols,KI=Object.prototype.hasOwnProperty,XI=Object.prototype.propertyIsEnumerable,_4=(e,t,n)=>t in e?QG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,YG=(e,t)=>{for(var n in t||(t={}))KI.call(t,n)&&_4(e,n,t[n]);if(Xh)for(var n of Xh(t))XI.call(t,n)&&_4(e,n,t[n]);return e},JG=(e,t)=>{var n={};for(var r in e)KI.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&&XI.call(e,r)&&(n[r]=e[r]);return n};const ZG={variant:"text"},QI=u.forwardRef((e,t)=>{const n=_r("Text",ZG,e),{className:r,size:o,weight:s,transform:i,color:c,align:f,variant:p,lineClamp:h,truncate:m,gradient:v,inline:b,inherit:y,underline:x,strikethrough:C,italic:k,classNames:j,styles:_,unstyled:I,span:O,__staticSelector:E}=n,M=JG(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}=XG({color:c,lineClamp:h,truncate:m,inline:b,inherit:y,underline:x,strikethrough:C,italic:k,weight:s,transform:i,align:f,gradient:v},{unstyled:I,name:E||"Text",variant:p,size:o});return H.createElement(No,YG({ref:t,className:A(R.root,{[R.gradient]:p==="gradient"},r),component:O?"span":"div"},M))});QI.displayName="@mantine/core/Text";const pu=QI,Dp={xs:Ge(1),sm:Ge(2),md:Ge(3),lg:Ge(4),xl:Ge(5)};function Ap(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 eq=fo((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:Ge(1),borderTop:`${Gt({size:n,sizes:Dp})} ${r} ${Ap(e,t)}`,marginRight:e.spacing.xs},"&::after":{content:'""',flex:1,borderTop:`${Gt({size:n,sizes:Dp})} ${r} ${Ap(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:Ge(Gt({size:n,sizes:Dp})),borderTopColor:Ap(e,t),borderTopStyle:r,margin:0},vertical:{border:0,alignSelf:"stretch",height:"auto",borderLeftWidth:Ge(Gt({size:n,sizes:Dp})),borderLeftColor:Ap(e,t),borderLeftStyle:r}}));const tq=eq;var nq=Object.defineProperty,rq=Object.defineProperties,oq=Object.getOwnPropertyDescriptors,Qh=Object.getOwnPropertySymbols,YI=Object.prototype.hasOwnProperty,JI=Object.prototype.propertyIsEnumerable,P4=(e,t,n)=>t in e?nq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,I4=(e,t)=>{for(var n in t||(t={}))YI.call(t,n)&&P4(e,n,t[n]);if(Qh)for(var n of Qh(t))JI.call(t,n)&&P4(e,n,t[n]);return e},sq=(e,t)=>rq(e,oq(t)),aq=(e,t)=>{var n={};for(var r in e)YI.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&&JI.call(e,r)&&(n[r]=e[r]);return n};const iq={orientation:"horizontal",size:"xs",labelPosition:"left",variant:"solid"},fb=u.forwardRef((e,t)=>{const n=_r("Divider",iq,e),{className:r,color:o,orientation:s,size:i,label:c,labelPosition:f,labelProps:p,variant:h,styles:m,classNames:v,unstyled:b}=n,y=aq(n,["className","color","orientation","size","label","labelPosition","labelProps","variant","styles","classNames","unstyled"]),{classes:x,cx:C}=tq({color:o},{classNames:v,styles:m,unstyled:b,name:"Divider",variant:h,size:i}),k=s==="vertical",j=s==="horizontal",_=!!c&&j,I=!(p!=null&&p.color);return H.createElement(No,I4({ref:t,className:C(x.root,{[x.vertical]:k,[x.horizontal]:j,[x.withLabel]:_},r),role:"separator"},y),_&&H.createElement(pu,sq(I4({},p),{size:(p==null?void 0:p.size)||"xs",mt:Ge(2),className:C(x.label,x[f],{[x.labelDefaultStyles]:I})}),c))});fb.displayName="@mantine/core/Divider";var lq=Object.defineProperty,cq=Object.defineProperties,uq=Object.getOwnPropertyDescriptors,E4=Object.getOwnPropertySymbols,dq=Object.prototype.hasOwnProperty,fq=Object.prototype.propertyIsEnumerable,O4=(e,t,n)=>t in e?lq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,M4=(e,t)=>{for(var n in t||(t={}))dq.call(t,n)&&O4(e,n,t[n]);if(E4)for(var n of E4(t))fq.call(t,n)&&O4(e,n,t[n]);return e},pq=(e,t)=>cq(e,uq(t)),hq=fo((e,t,{size:n})=>({item:pq(M4({},e.fn.fontStyles()),{boxSizing:"border-box",wordBreak:"break-all",textAlign:"left",width:"100%",padding:`calc(${Gt({size:n,sizes:e.spacing})} / 1.5) ${Gt({size:n,sizes:e.spacing})}`,cursor:"pointer",fontSize:Gt({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]":M4({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(${Gt({size:n,sizes:e.spacing})} / 2)`,paddingBottom:`calc(${Gt({size:n,sizes:e.spacing})} / 2)`,textAlign:"center"},separator:{boxSizing:"border-box",textAlign:"left",width:"100%",padding:`calc(${Gt({size:n,sizes:e.spacing})} / 1.5) ${Gt({size:n,sizes:e.spacing})}`},separatorLabel:{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]}}));const mq=hq;var gq=Object.defineProperty,R4=Object.getOwnPropertySymbols,vq=Object.prototype.hasOwnProperty,bq=Object.prototype.propertyIsEnumerable,D4=(e,t,n)=>t in e?gq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xq=(e,t)=>{for(var n in t||(t={}))vq.call(t,n)&&D4(e,n,t[n]);if(R4)for(var n of R4(t))bq.call(t,n)&&D4(e,n,t[n]);return e};function fy({data:e,hovered:t,classNames:n,styles:r,isItemSelected:o,uuid:s,__staticSelector:i,onItemHover:c,onItemSelect:f,itemsRefs:p,itemComponent:h,size:m,nothingFound:v,creatable:b,createLabel:y,unstyled:x,variant:C}){const{classes:k}=mq(null,{classNames:n,styles:r,unstyled:x,name:i,variant:C,size:m}),j=[],_=[];let I=null;const O=(M,R)=>{const A=typeof o=="function"?o(M.value):!1;return H.createElement(h,xq({key:M.value,className:k.item,"data-disabled":M.disabled||void 0,"data-hovered":!M.disabled&&t===R||void 0,"data-selected":!M.disabled&&A||void 0,selected:A,onMouseEnter:()=>c(R),id:`${s}-${R}`,role:"option",tabIndex:-1,"aria-selected":t===R,ref:D=>{p&&p.current&&(p.current[M.value]=D)},onMouseDown:M.disabled?null:D=>{D.preventDefault(),f(M)},disabled:M.disabled,variant:C},M))};let E=null;if(e.forEach((M,R)=>{M.creatable?I=R:M.group?(E!==M.group&&(E=M.group,_.push(H.createElement("div",{className:k.separator,key:`__mantine-divider-${R}`},H.createElement(fb,{classNames:{label:k.separatorLabel},label:M.group})))),_.push(O(M,R))):j.push(O(M,R))}),b){const M=e[I];j.push(H.createElement("div",{key:uy(),className:k.item,"data-hovered":t===I||void 0,onMouseEnter:()=>c(I),onMouseDown:R=>{R.preventDefault(),f(M)},tabIndex:-1,ref:R=>{p&&p.current&&(p.current[M.value]=R)}},y))}return _.length>0&&j.length>0&&j.unshift(H.createElement("div",{className:k.separator,key:"empty-group-separator"},H.createElement(fb,null))),_.length>0||j.length>0?H.createElement(H.Fragment,null,_,j):H.createElement(pu,{size:m,unstyled:x,className:k.nothingFound},v)}fy.displayName="@mantine/core/SelectItems";var yq=Object.defineProperty,Yh=Object.getOwnPropertySymbols,ZI=Object.prototype.hasOwnProperty,e6=Object.prototype.propertyIsEnumerable,A4=(e,t,n)=>t in e?yq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wq=(e,t)=>{for(var n in t||(t={}))ZI.call(t,n)&&A4(e,n,t[n]);if(Yh)for(var n of Yh(t))e6.call(t,n)&&A4(e,n,t[n]);return e},Cq=(e,t)=>{var n={};for(var r in e)ZI.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&&e6.call(e,r)&&(n[r]=e[r]);return n};const py=u.forwardRef((e,t)=>{var n=e,{label:r,value:o}=n,s=Cq(n,["label","value"]);return H.createElement("div",wq({ref:t},s),r||o)});py.displayName="@mantine/core/DefaultItem";function Sq(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function t6(...e){return t=>e.forEach(n=>Sq(n,t))}function Xl(...e){return u.useCallback(t6(...e),e)}const n6=u.forwardRef((e,t)=>{const{children:n,...r}=e,o=u.Children.toArray(n),s=o.find(jq);if(s){const i=s.props.children,c=o.map(f=>f===s?u.Children.count(i)>1?u.Children.only(null):u.isValidElement(i)?i.props.children:null:f);return u.createElement(pb,ar({},r,{ref:t}),u.isValidElement(i)?u.cloneElement(i,void 0,c):null)}return u.createElement(pb,ar({},r,{ref:t}),n)});n6.displayName="Slot";const pb=u.forwardRef((e,t)=>{const{children:n,...r}=e;return u.isValidElement(n)?u.cloneElement(n,{..._q(r,n.props),ref:t6(t,n.ref)}):u.Children.count(n)>1?u.Children.only(null):null});pb.displayName="SlotClone";const kq=({children:e})=>u.createElement(u.Fragment,null,e);function jq(e){return u.isValidElement(e)&&e.type===kq}function _q(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]=(...c)=>{s(...c),o(...c)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}const Pq=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],Pf=Pq.reduce((e,t)=>{const n=u.forwardRef((r,o)=>{const{asChild:s,...i}=r,c=s?n6:t;return u.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),u.createElement(c,ar({},i,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),hb=globalThis!=null&&globalThis.document?u.useLayoutEffect:()=>{};function Iq(e,t){return u.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const If=e=>{const{present:t,children:n}=e,r=Eq(t),o=typeof n=="function"?n({present:r.isPresent}):u.Children.only(n),s=Xl(r.ref,o.ref);return typeof n=="function"||r.isPresent?u.cloneElement(o,{ref:s}):null};If.displayName="Presence";function Eq(e){const[t,n]=u.useState(),r=u.useRef({}),o=u.useRef(e),s=u.useRef("none"),i=e?"mounted":"unmounted",[c,f]=Iq(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return u.useEffect(()=>{const p=Np(r.current);s.current=c==="mounted"?p:"none"},[c]),hb(()=>{const p=r.current,h=o.current;if(h!==e){const v=s.current,b=Np(p);e?f("MOUNT"):b==="none"||(p==null?void 0:p.display)==="none"?f("UNMOUNT"):f(h&&v!==b?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,f]),hb(()=>{if(t){const p=m=>{const b=Np(r.current).includes(m.animationName);m.target===t&&b&&fs.flushSync(()=>f("ANIMATION_END"))},h=m=>{m.target===t&&(s.current=Np(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 f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:u.useCallback(p=>{p&&(r.current=getComputedStyle(p)),n(p)},[])}}function Np(e){return(e==null?void 0:e.animationName)||"none"}function Oq(e,t=[]){let n=[];function r(s,i){const c=u.createContext(i),f=n.length;n=[...n,i];function p(m){const{scope:v,children:b,...y}=m,x=(v==null?void 0:v[e][f])||c,C=u.useMemo(()=>y,Object.values(y));return u.createElement(x.Provider,{value:C},b)}function h(m,v){const b=(v==null?void 0:v[e][f])||c,y=u.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=>u.createContext(i));return function(c){const f=(c==null?void 0:c[e])||s;return u.useMemo(()=>({[`__scope${e}`]:{...c,[e]:f}}),[c,f])}};return o.scopeName=e,[r,Mq(o,...t)]}function Mq(...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((c,{useScope:f,scopeName:p})=>{const m=f(s)[`__scope${p}`];return{...c,...m}},{});return u.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function gl(e){const t=u.useRef(e);return u.useEffect(()=>{t.current=e}),u.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}const Rq=u.createContext(void 0);function Dq(e){const t=u.useContext(Rq);return e||t||"ltr"}function Aq(e,[t,n]){return Math.min(n,Math.max(t,e))}function Sl(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 Nq(e,t){return u.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const r6="ScrollArea",[o6,f0e]=Oq(r6),[Tq,Ss]=o6(r6),$q=u.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:s=600,...i}=e,[c,f]=u.useState(null),[p,h]=u.useState(null),[m,v]=u.useState(null),[b,y]=u.useState(null),[x,C]=u.useState(null),[k,j]=u.useState(0),[_,I]=u.useState(0),[O,E]=u.useState(!1),[M,R]=u.useState(!1),A=Xl(t,T=>f(T)),D=Dq(o);return u.createElement(Tq,{scope:n,type:r,dir:D,scrollHideDelay:s,scrollArea:c,viewport:p,onViewportChange:h,content:m,onContentChange:v,scrollbarX:b,onScrollbarXChange:y,scrollbarXEnabled:O,onScrollbarXEnabledChange:E,scrollbarY:x,onScrollbarYChange:C,scrollbarYEnabled:M,onScrollbarYEnabledChange:R,onCornerWidthChange:j,onCornerHeightChange:I},u.createElement(Pf.div,ar({dir:D},i,{ref:A,style:{position:"relative","--radix-scroll-area-corner-width":k+"px","--radix-scroll-area-corner-height":_+"px",...e.style}})))}),Lq="ScrollAreaViewport",Fq=u.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,...o}=e,s=Ss(Lq,n),i=u.useRef(null),c=Xl(t,i,s.onViewportChange);return u.createElement(u.Fragment,null,u.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}"}}),u.createElement(Pf.div,ar({"data-radix-scroll-area-viewport":""},o,{ref:c,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style}}),u.createElement("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"}},r)))}),mi="ScrollAreaScrollbar",zq=u.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Ss(mi,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:i}=o,c=e.orientation==="horizontal";return u.useEffect(()=>(c?s(!0):i(!0),()=>{c?s(!1):i(!1)}),[c,s,i]),o.type==="hover"?u.createElement(Bq,ar({},r,{ref:t,forceMount:n})):o.type==="scroll"?u.createElement(Hq,ar({},r,{ref:t,forceMount:n})):o.type==="auto"?u.createElement(s6,ar({},r,{ref:t,forceMount:n})):o.type==="always"?u.createElement(hy,ar({},r,{ref:t})):null}),Bq=u.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Ss(mi,e.__scopeScrollArea),[s,i]=u.useState(!1);return u.useEffect(()=>{const c=o.scrollArea;let f=0;if(c){const p=()=>{window.clearTimeout(f),i(!0)},h=()=>{f=window.setTimeout(()=>i(!1),o.scrollHideDelay)};return c.addEventListener("pointerenter",p),c.addEventListener("pointerleave",h),()=>{window.clearTimeout(f),c.removeEventListener("pointerenter",p),c.removeEventListener("pointerleave",h)}}},[o.scrollArea,o.scrollHideDelay]),u.createElement(If,{present:n||s},u.createElement(s6,ar({"data-state":s?"visible":"hidden"},r,{ref:t})))}),Hq=u.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Ss(mi,e.__scopeScrollArea),s=e.orientation==="horizontal",i=Sg(()=>f("SCROLL_END"),100),[c,f]=Nq("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 u.useEffect(()=>{if(c==="idle"){const p=window.setTimeout(()=>f("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(p)}},[c,o.scrollHideDelay,f]),u.useEffect(()=>{const p=o.viewport,h=s?"scrollLeft":"scrollTop";if(p){let m=p[h];const v=()=>{const b=p[h];m!==b&&(f("SCROLL"),i()),m=b};return p.addEventListener("scroll",v),()=>p.removeEventListener("scroll",v)}},[o.viewport,s,f,i]),u.createElement(If,{present:n||c!=="hidden"},u.createElement(hy,ar({"data-state":c==="hidden"?"hidden":"visible"},r,{ref:t,onPointerEnter:Sl(e.onPointerEnter,()=>f("POINTER_ENTER")),onPointerLeave:Sl(e.onPointerLeave,()=>f("POINTER_LEAVE"))})))}),s6=u.forwardRef((e,t)=>{const n=Ss(mi,e.__scopeScrollArea),{forceMount:r,...o}=e,[s,i]=u.useState(!1),c=e.orientation==="horizontal",f=Sg(()=>{if(n.viewport){const p=n.viewport.offsetWidth<n.viewport.scrollWidth,h=n.viewport.offsetHeight<n.viewport.scrollHeight;i(c?p:h)}},10);return hu(n.viewport,f),hu(n.content,f),u.createElement(If,{present:r||s},u.createElement(hy,ar({"data-state":s?"visible":"hidden"},o,{ref:t})))}),hy=u.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=Ss(mi,e.__scopeScrollArea),s=u.useRef(null),i=u.useRef(0),[c,f]=u.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),p=c6(c.viewport,c.content),h={...r,sizes:c,onSizesChange:f,hasThumb:p>0&&p<1,onThumbChange:v=>s.current=v,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:v=>i.current=v};function m(v,b){return Qq(v,i.current,c,b)}return n==="horizontal"?u.createElement(Wq,ar({},h,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const v=o.viewport.scrollLeft,b=N4(v,c,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"?u.createElement(Vq,ar({},h,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const v=o.viewport.scrollTop,b=N4(v,c);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}),Wq=u.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=Ss(mi,e.__scopeScrollArea),[i,c]=u.useState(),f=u.useRef(null),p=Xl(t,f,s.onScrollbarXChange);return u.useEffect(()=>{f.current&&c(getComputedStyle(f.current))},[f]),u.createElement(i6,ar({"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":Cg(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),d6(v,m)&&h.preventDefault()}},onResize:()=>{f.current&&s.viewport&&i&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:f.current.clientWidth,paddingStart:Jh(i.paddingLeft),paddingEnd:Jh(i.paddingRight)}})}}))}),Vq=u.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=Ss(mi,e.__scopeScrollArea),[i,c]=u.useState(),f=u.useRef(null),p=Xl(t,f,s.onScrollbarYChange);return u.useEffect(()=>{f.current&&c(getComputedStyle(f.current))},[f]),u.createElement(i6,ar({"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":Cg(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),d6(v,m)&&h.preventDefault()}},onResize:()=>{f.current&&s.viewport&&i&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:f.current.clientHeight,paddingStart:Jh(i.paddingTop),paddingEnd:Jh(i.paddingBottom)}})}}))}),[Uq,a6]=o6(mi),i6=u.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:s,onThumbPointerUp:i,onThumbPointerDown:c,onThumbPositionChange:f,onDragScroll:p,onWheelScroll:h,onResize:m,...v}=e,b=Ss(mi,n),[y,x]=u.useState(null),C=Xl(t,A=>x(A)),k=u.useRef(null),j=u.useRef(""),_=b.viewport,I=r.content-r.viewport,O=gl(h),E=gl(f),M=Sg(m,10);function R(A){if(k.current){const D=A.clientX-k.current.left,T=A.clientY-k.current.top;p({x:D,y:T})}}return u.useEffect(()=>{const A=D=>{const T=D.target;(y==null?void 0:y.contains(T))&&O(D,I)};return document.addEventListener("wheel",A,{passive:!1}),()=>document.removeEventListener("wheel",A,{passive:!1})},[_,y,I,O]),u.useEffect(E,[r,E]),hu(y,M),hu(b.content,M),u.createElement(Uq,{scope:n,scrollbar:y,hasThumb:o,onThumbChange:gl(s),onThumbPointerUp:gl(i),onThumbPositionChange:E,onThumbPointerDown:gl(c)},u.createElement(Pf.div,ar({},v,{ref:C,style:{position:"absolute",...v.style},onPointerDown:Sl(e.onPointerDown,A=>{A.button===0&&(A.target.setPointerCapture(A.pointerId),k.current=y.getBoundingClientRect(),j.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",R(A))}),onPointerMove:Sl(e.onPointerMove,R),onPointerUp:Sl(e.onPointerUp,A=>{const D=A.target;D.hasPointerCapture(A.pointerId)&&D.releasePointerCapture(A.pointerId),document.body.style.webkitUserSelect=j.current,k.current=null})})))}),mb="ScrollAreaThumb",Gq=u.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=a6(mb,e.__scopeScrollArea);return u.createElement(If,{present:n||o.hasThumb},u.createElement(qq,ar({ref:t},r)))}),qq=u.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,s=Ss(mb,n),i=a6(mb,n),{onThumbPositionChange:c}=i,f=Xl(t,m=>i.onThumbChange(m)),p=u.useRef(),h=Sg(()=>{p.current&&(p.current(),p.current=void 0)},100);return u.useEffect(()=>{const m=s.viewport;if(m){const v=()=>{if(h(),!p.current){const b=Yq(m,c);p.current=b,c()}};return c(),m.addEventListener("scroll",v),()=>m.removeEventListener("scroll",v)}},[s.viewport,h,c]),u.createElement(Pf.div,ar({"data-state":i.hasThumb?"visible":"hidden"},o,{ref:f,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Sl(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:Sl(e.onPointerUp,i.onThumbPointerUp)}))}),l6="ScrollAreaCorner",Kq=u.forwardRef((e,t)=>{const n=Ss(l6,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?u.createElement(Xq,ar({},e,{ref:t})):null}),Xq=u.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=Ss(l6,n),[s,i]=u.useState(0),[c,f]=u.useState(0),p=!!(s&&c);return hu(o.scrollbarX,()=>{var h;const m=((h=o.scrollbarX)===null||h===void 0?void 0:h.offsetHeight)||0;o.onCornerHeightChange(m),f(m)}),hu(o.scrollbarY,()=>{var h;const m=((h=o.scrollbarY)===null||h===void 0?void 0:h.offsetWidth)||0;o.onCornerWidthChange(m),i(m)}),p?u.createElement(Pf.div,ar({},r,{ref:t,style:{width:s,height:c,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}})):null});function Jh(e){return e?parseInt(e,10):0}function c6(e,t){const n=e/t;return isNaN(n)?0:n}function Cg(e){const t=c6(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Qq(e,t,n,r="ltr"){const o=Cg(n),s=o/2,i=t||s,c=o-i,f=n.scrollbar.paddingStart+i,p=n.scrollbar.size-n.scrollbar.paddingEnd-c,h=n.content-n.viewport,m=r==="ltr"?[0,h]:[h*-1,0];return u6([f,p],m)(e)}function N4(e,t,n="ltr"){const r=Cg(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-o,i=t.content-t.viewport,c=s-r,f=n==="ltr"?[0,i]:[i*-1,0],p=Aq(e,f);return u6([0,i],[0,c])(p)}function u6(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 d6(e,t){return e>0&&e<t}const Yq=(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,c=n.top!==s.top;(i||c)&&t(),n=s,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function Sg(e,t){const n=gl(e),r=u.useRef(0);return u.useEffect(()=>()=>window.clearTimeout(r.current),[]),u.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function hu(e,t){const n=gl(t);hb(()=>{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 Jq=$q,Zq=Fq,T4=zq,$4=Gq,eK=Kq;var tK=fo((e,{scrollbarSize:t,offsetScrollbars:n,scrollbarHovered:r,hidden:o})=>({root:{overflow:"hidden"},viewport:{width:"100%",height:"100%",paddingRight:n?Ge(t):void 0,paddingBottom:n?Ge(t):void 0},scrollbar:{display:o?"none":"flex",userSelect:"none",touchAction:"none",boxSizing:"border-box",padding:`calc(${Ge(t)} / 5)`,transition:"background-color 150ms ease, opacity 150ms ease","&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[8]:e.colors.gray[0],[`& .${HS("thumb")}`]:{backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.white,.5):e.fn.rgba(e.black,.5)}},'&[data-orientation="vertical"]':{width:Ge(t)},'&[data-orientation="horizontal"]':{flexDirection:"column",height:Ge(t)},'&[data-state="hidden"]':{display:"none",opacity:0}},thumb:{ref:HS("thumb"),flex:1,backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.white,.4):e.fn.rgba(e.black,.4),borderRadius:Ge(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:Ge(44),minHeight:Ge(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 nK=tK;var rK=Object.defineProperty,oK=Object.defineProperties,sK=Object.getOwnPropertyDescriptors,Zh=Object.getOwnPropertySymbols,f6=Object.prototype.hasOwnProperty,p6=Object.prototype.propertyIsEnumerable,L4=(e,t,n)=>t in e?rK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gb=(e,t)=>{for(var n in t||(t={}))f6.call(t,n)&&L4(e,n,t[n]);if(Zh)for(var n of Zh(t))p6.call(t,n)&&L4(e,n,t[n]);return e},h6=(e,t)=>oK(e,sK(t)),m6=(e,t)=>{var n={};for(var r in e)f6.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&&p6.call(e,r)&&(n[r]=e[r]);return n};const g6={scrollbarSize:12,scrollHideDelay:1e3,type:"hover",offsetScrollbars:!1},kg=u.forwardRef((e,t)=>{const n=_r("ScrollArea",g6,e),{children:r,className:o,classNames:s,styles:i,scrollbarSize:c,scrollHideDelay:f,type:p,dir:h,offsetScrollbars:m,viewportRef:v,onScrollPositionChange:b,unstyled:y,variant:x,viewportProps:C}=n,k=m6(n,["children","className","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled","variant","viewportProps"]),[j,_]=u.useState(!1),I=pi(),{classes:O,cx:E}=nK({scrollbarSize:c,offsetScrollbars:m,scrollbarHovered:j,hidden:p==="never"},{name:"ScrollArea",classNames:s,styles:i,unstyled:y,variant:x});return H.createElement(Jq,{type:p==="never"?"always":p,scrollHideDelay:f,dir:h||I.dir,ref:t,asChild:!0},H.createElement(No,gb({className:E(O.root,o)},k),H.createElement(Zq,h6(gb({},C),{className:O.viewport,ref:v,onScroll:typeof b=="function"?({currentTarget:M})=>b({x:M.scrollLeft,y:M.scrollTop}):void 0}),r),H.createElement(T4,{orientation:"horizontal",className:O.scrollbar,forceMount:!0,onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1)},H.createElement($4,{className:O.thumb})),H.createElement(T4,{orientation:"vertical",className:O.scrollbar,forceMount:!0,onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1)},H.createElement($4,{className:O.thumb})),H.createElement(eK,{className:O.corner})))}),v6=u.forwardRef((e,t)=>{const n=_r("ScrollAreaAutosize",g6,e),{children:r,classNames:o,styles:s,scrollbarSize:i,scrollHideDelay:c,type:f,dir:p,offsetScrollbars:h,viewportRef:m,onScrollPositionChange:v,unstyled:b,sx:y,variant:x,viewportProps:C}=n,k=m6(n,["children","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled","sx","variant","viewportProps"]);return H.createElement(No,h6(gb({},k),{ref:t,sx:[{display:"flex"},...oI(y)]}),H.createElement(No,{sx:{display:"flex",flexDirection:"column",flex:1}},H.createElement(kg,{classNames:o,styles:s,scrollHideDelay:c,scrollbarSize:i,type:f,dir:p,offsetScrollbars:h,viewportRef:m,onScrollPositionChange:v,unstyled:b,variant:x,viewportProps:C},r)))});v6.displayName="@mantine/core/ScrollAreaAutosize";kg.displayName="@mantine/core/ScrollArea";kg.Autosize=v6;const b6=kg;var aK=Object.defineProperty,iK=Object.defineProperties,lK=Object.getOwnPropertyDescriptors,em=Object.getOwnPropertySymbols,x6=Object.prototype.hasOwnProperty,y6=Object.prototype.propertyIsEnumerable,F4=(e,t,n)=>t in e?aK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,z4=(e,t)=>{for(var n in t||(t={}))x6.call(t,n)&&F4(e,n,t[n]);if(em)for(var n of em(t))y6.call(t,n)&&F4(e,n,t[n]);return e},cK=(e,t)=>iK(e,lK(t)),uK=(e,t)=>{var n={};for(var r in e)x6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&em)for(var r of em(e))t.indexOf(r)<0&&y6.call(e,r)&&(n[r]=e[r]);return n};const jg=u.forwardRef((e,t)=>{var n=e,{style:r}=n,o=uK(n,["style"]);return H.createElement(b6,cK(z4({},o),{style:z4({width:"100%"},r),viewportProps:{tabIndex:-1},viewportRef:t}),o.children)});jg.displayName="@mantine/core/SelectScrollArea";var dK=fo(()=>({dropdown:{},itemsWrapper:{padding:Ge(4),display:"flex",width:"100%",boxSizing:"border-box"}}));const fK=dK;function Mu(e){return e.split("-")[1]}function my(e){return e==="y"?"height":"width"}function Ws(e){return e.split("-")[0]}function Zi(e){return["top","bottom"].includes(Ws(e))?"x":"y"}function B4(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,c=Zi(t),f=my(c),p=r[f]/2-o[f]/2,h=c==="x";let m;switch(Ws(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(Mu(t)){case"start":m[c]-=p*(n&&h?-1:1);break;case"end":m[c]+=p*(n&&h?-1:1)}return m}const pK=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,c=s.filter(Boolean),f=await(i.isRTL==null?void 0:i.isRTL(t));let p=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:h,y:m}=B4(p,r,f),v=r,b={},y=0;for(let x=0;x<c.length;x++){const{name:C,fn:k}=c[x],{x:j,y:_,data:I,reset:O}=await k({x:h,y:m,initialPlacement:r,placement:v,strategy:o,middlewareData:b,rects:p,platform:i,elements:{reference:e,floating:t}});h=j??h,m=_??m,b={...b,[C]:{...b[C],...I}},O&&y<=50&&(y++,typeof O=="object"&&(O.placement&&(v=O.placement),O.rects&&(p=O.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):O.rects),{x:h,y:m}=B4(p,v,f)),x=-1)}return{x:h,y:m,placement:v,strategy:o,middlewareData:b}};function si(e,t){return typeof e=="function"?e(t):e}function gy(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 mu(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function vy(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:c,strategy:f}=e,{boundary:p="clippingAncestors",rootBoundary:h="viewport",elementContext:m="floating",altBoundary:v=!1,padding:b=0}=si(t,e),y=gy(b),x=c[v?m==="floating"?"reference":"floating":m],C=mu(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(c.floating)),boundary:p,rootBoundary:h,strategy:f})),k=m==="floating"?{...i.floating,x:r,y:o}:i.reference,j=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),_=await(s.isElement==null?void 0:s.isElement(j))&&await(s.getScale==null?void 0:s.getScale(j))||{x:1,y:1},I=mu(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:k,offsetParent:j,strategy:f}):k);return{top:(C.top-I.top+y.top)/_.y,bottom:(I.bottom-C.bottom+y.bottom)/_.y,left:(C.left-I.left+y.left)/_.x,right:(I.right-C.right+y.right)/_.x}}const Gi=Math.min,ma=Math.max;function vb(e,t,n){return ma(e,Gi(t,n))}const H4=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:c}=t,{element:f,padding:p=0}=si(e,t)||{};if(f==null)return{};const h=gy(p),m={x:n,y:r},v=Zi(o),b=my(v),y=await i.getDimensions(f),x=v==="y",C=x?"top":"left",k=x?"bottom":"right",j=x?"clientHeight":"clientWidth",_=s.reference[b]+s.reference[v]-m[v]-s.floating[b],I=m[v]-s.reference[v],O=await(i.getOffsetParent==null?void 0:i.getOffsetParent(f));let E=O?O[j]:0;E&&await(i.isElement==null?void 0:i.isElement(O))||(E=c.floating[j]||s.floating[b]);const M=_/2-I/2,R=E/2-y[b]/2-1,A=Gi(h[C],R),D=Gi(h[k],R),T=A,K=E-y[b]-D,B=E/2-y[b]/2+M,G=vb(T,B,K),Q=Mu(o)!=null&&B!=G&&s.reference[b]/2-(B<T?A:D)-y[b]/2<0?B<T?T-B:K-B:0;return{[v]:m[v]-Q,data:{[v]:G,centerOffset:B-G+Q}}}}),hK=["top","right","bottom","left"];hK.reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);const mK={left:"right",right:"left",bottom:"top",top:"bottom"};function tm(e){return e.replace(/left|right|bottom|top/g,t=>mK[t])}function gK(e,t,n){n===void 0&&(n=!1);const r=Mu(e),o=Zi(e),s=my(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=tm(i)),{main:i,cross:tm(i)}}const vK={start:"end",end:"start"};function zv(e){return e.replace(/start|end/g,t=>vK[t])}const bK=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:c,elements:f}=t,{mainAxis:p=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:y=!0,...x}=si(e,t),C=Ws(r),k=Ws(i)===i,j=await(c.isRTL==null?void 0:c.isRTL(f.floating)),_=m||(k||!y?[tm(i)]:function(T){const K=tm(T);return[zv(T),K,zv(K)]}(i));m||b==="none"||_.push(...function(T,K,B,G){const Q=Mu(T);let V=function(L,X,F){const q=["left","right"],te=["right","left"],Y=["top","bottom"],ce=["bottom","top"];switch(L){case"top":case"bottom":return F?X?te:q:X?q:te;case"left":case"right":return X?Y:ce;default:return[]}}(Ws(T),B==="start",G);return Q&&(V=V.map(L=>L+"-"+Q),K&&(V=V.concat(V.map(zv)))),V}(i,y,b,j));const I=[i,..._],O=await vy(t,x),E=[];let M=((n=o.flip)==null?void 0:n.overflows)||[];if(p&&E.push(O[C]),h){const{main:T,cross:K}=gK(r,s,j);E.push(O[T],O[K])}if(M=[...M,{placement:r,overflows:E}],!E.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:M},reset:{placement:K}};let B=(A=M.filter(G=>G.overflows[0]<=0).sort((G,Q)=>G.overflows[1]-Q.overflows[1])[0])==null?void 0:A.placement;if(!B)switch(v){case"bestFit":{var D;const G=(D=M.map(Q=>[Q.placement,Q.overflows.filter(V=>V>0).reduce((V,L)=>V+L,0)]).sort((Q,V)=>Q[1]-V[1])[0])==null?void 0:D[0];G&&(B=G);break}case"initialPlacement":B=i}if(r!==B)return{reset:{placement:B}}}return{}}}};function W4(e){const t=Gi(...e.map(r=>r.left)),n=Gi(...e.map(r=>r.top));return{x:t,y:n,width:ma(...e.map(r=>r.right))-t,height:ma(...e.map(r=>r.bottom))-n}}const xK=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:c=2,x:f,y:p}=si(e,t),h=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(r.reference))||[]),m=function(x){const C=x.slice().sort((_,I)=>_.y-I.y),k=[];let j=null;for(let _=0;_<C.length;_++){const I=C[_];!j||I.y-j.y>j.height/2?k.push([I]):k[k.length-1].push(I),j=I}return k.map(_=>mu(W4(_)))}(h),v=mu(W4(h)),b=gy(c),y=await s.getElementRects({reference:{getBoundingClientRect:function(){if(m.length===2&&m[0].left>m[1].right&&f!=null&&p!=null)return m.find(x=>f>x.left-b.left&&f<x.right+b.right&&p>x.top-b.top&&p<x.bottom+b.bottom)||v;if(m.length>=2){if(Zi(n)==="x"){const O=m[0],E=m[m.length-1],M=Ws(n)==="top",R=O.top,A=E.bottom,D=M?O.left:E.left,T=M?O.right:E.right;return{top:R,bottom:A,left:D,right:T,width:T-D,height:A-R,x:D,y:R}}const x=Ws(n)==="left",C=ma(...m.map(O=>O.right)),k=Gi(...m.map(O=>O.left)),j=m.filter(O=>x?O.left===k:O.right===C),_=j[0].top,I=j[j.length-1].bottom;return{top:_,bottom:I,left:k,right:C,width:C-k,height:I-_,x:k,y:_}}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}}:{}}}},yK=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:c,platform:f,elements:p}=s,h=await(f.isRTL==null?void 0:f.isRTL(p.floating)),m=Ws(c),v=Mu(c),b=Zi(c)==="x",y=["left","top"].includes(m)?-1:1,x=h&&b?-1:1,C=si(i,s);let{mainAxis:k,crossAxis:j,alignmentAxis:_}=typeof C=="number"?{mainAxis:C,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...C};return v&&typeof _=="number"&&(j=v==="end"?-1*_:_),b?{x:j*x,y:k*y}:{x:k*y,y:j*x}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};function w6(e){return e==="x"?"y":"x"}const wK=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:c={fn:C=>{let{x:k,y:j}=C;return{x:k,y:j}}},...f}=si(e,t),p={x:n,y:r},h=await vy(t,f),m=Zi(Ws(o)),v=w6(m);let b=p[m],y=p[v];if(s){const C=m==="y"?"bottom":"right";b=vb(b+h[m==="y"?"top":"left"],b,b-h[C])}if(i){const C=v==="y"?"bottom":"right";y=vb(y+h[v==="y"?"top":"left"],y,y-h[C])}const x=c.fn({...t,[m]:b,[v]:y});return{...x,data:{x:x.x-n,y:x.y-r}}}}},CK=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:c=0,mainAxis:f=!0,crossAxis:p=!0}=si(e,t),h={x:n,y:r},m=Zi(o),v=w6(m);let b=h[m],y=h[v];const x=si(c,t),C=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(f){const _=m==="y"?"height":"width",I=s.reference[m]-s.floating[_]+C.mainAxis,O=s.reference[m]+s.reference[_]-C.mainAxis;b<I?b=I:b>O&&(b=O)}if(p){var k,j;const _=m==="y"?"width":"height",I=["top","left"].includes(Ws(o)),O=s.reference[v]-s.floating[_]+(I&&((k=i.offset)==null?void 0:k[v])||0)+(I?0:C.crossAxis),E=s.reference[v]+s.reference[_]+(I?0:((j=i.offset)==null?void 0:j[v])||0)-(I?C.crossAxis:0);y<O?y=O:y>E&&(y=E)}return{[m]:b,[v]:y}}}},SK=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=()=>{},...c}=si(e,t),f=await vy(t,c),p=Ws(n),h=Mu(n),m=Zi(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 C=b-f[y],k=v-f[x],j=!t.middlewareData.shift;let _=C,I=k;if(m){const E=v-f.left-f.right;I=h||j?Gi(k,E):E}else{const E=b-f.top-f.bottom;_=h||j?Gi(C,E):E}if(j&&!h){const E=ma(f.left,0),M=ma(f.right,0),R=ma(f.top,0),A=ma(f.bottom,0);m?I=v-2*(E!==0||M!==0?E+M:ma(f.left,f.right)):_=b-2*(R!==0||A!==0?R+A:ma(f.top,f.bottom))}await i({...t,availableWidth:I,availableHeight:_});const O=await o.getDimensions(s.floating);return v!==O.width||b!==O.height?{reset:{rects:!0}}:{}}}};function Go(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ja(e){return Go(e).getComputedStyle(e)}function C6(e){return e instanceof Go(e).Node}function qi(e){return C6(e)?(e.nodeName||"").toLowerCase():"#document"}function Qs(e){return e instanceof HTMLElement||e instanceof Go(e).HTMLElement}function V4(e){return typeof ShadowRoot<"u"&&(e instanceof Go(e).ShadowRoot||e instanceof ShadowRoot)}function Gd(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ja(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function kK(e){return["table","td","th"].includes(qi(e))}function bb(e){const t=by(),n=ja(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 by(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function _g(e){return["html","body","#document"].includes(qi(e))}const xb=Math.min,Xc=Math.max,nm=Math.round,Tp=Math.floor,Ki=e=>({x:e,y:e});function S6(e){const t=ja(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Qs(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,c=nm(n)!==s||nm(r)!==i;return c&&(n=s,r=i),{width:n,height:r,$:c}}function Za(e){return e instanceof Element||e instanceof Go(e).Element}function xy(e){return Za(e)?e:e.contextElement}function Qc(e){const t=xy(e);if(!Qs(t))return Ki(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=S6(t);let i=(s?nm(n.width):n.width)/r,c=(s?nm(n.height):n.height)/o;return i&&Number.isFinite(i)||(i=1),c&&Number.isFinite(c)||(c=1),{x:i,y:c}}const jK=Ki(0);function k6(e){const t=Go(e);return by()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:jK}function Ll(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=xy(e);let i=Ki(1);t&&(r?Za(r)&&(i=Qc(r)):i=Qc(e));const c=function(v,b,y){return b===void 0&&(b=!1),!(!y||b&&y!==Go(v))&&b}(s,n,r)?k6(s):Ki(0);let f=(o.left+c.x)/i.x,p=(o.top+c.y)/i.y,h=o.width/i.x,m=o.height/i.y;if(s){const v=Go(s),b=r&&Za(r)?Go(r):r;let y=v.frameElement;for(;y&&r&&b!==v;){const x=Qc(y),C=y.getBoundingClientRect(),k=getComputedStyle(y),j=C.left+(y.clientLeft+parseFloat(k.paddingLeft))*x.x,_=C.top+(y.clientTop+parseFloat(k.paddingTop))*x.y;f*=x.x,p*=x.y,h*=x.x,m*=x.y,f+=j,p+=_,y=Go(y).frameElement}}return mu({width:h,height:m,x:f,y:p})}function Pg(e){return Za(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ei(e){var t;return(t=(C6(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function j6(e){return Ll(ei(e)).left+Pg(e).scrollLeft}function gu(e){if(qi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||V4(e)&&e.host||ei(e);return V4(t)?t.host:t}function _6(e){const t=gu(e);return _g(t)?e.ownerDocument?e.ownerDocument.body:e.body:Qs(t)&&Gd(t)?t:_6(t)}function rm(e,t){var n;t===void 0&&(t=[]);const r=_6(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),s=Go(r);return o?t.concat(s,s.visualViewport||[],Gd(r)?r:[]):t.concat(r,rm(r))}function U4(e,t,n){let r;if(t==="viewport")r=function(o,s){const i=Go(o),c=ei(o),f=i.visualViewport;let p=c.clientWidth,h=c.clientHeight,m=0,v=0;if(f){p=f.width,h=f.height;const b=by();(!b||b&&s==="fixed")&&(m=f.offsetLeft,v=f.offsetTop)}return{width:p,height:h,x:m,y:v}}(e,n);else if(t==="document")r=function(o){const s=ei(o),i=Pg(o),c=o.ownerDocument.body,f=Xc(s.scrollWidth,s.clientWidth,c.scrollWidth,c.clientWidth),p=Xc(s.scrollHeight,s.clientHeight,c.scrollHeight,c.clientHeight);let h=-i.scrollLeft+j6(o);const m=-i.scrollTop;return ja(c).direction==="rtl"&&(h+=Xc(s.clientWidth,c.clientWidth)-f),{width:f,height:p,x:h,y:m}}(ei(e));else if(Za(t))r=function(o,s){const i=Ll(o,!0,s==="fixed"),c=i.top+o.clientTop,f=i.left+o.clientLeft,p=Qs(o)?Qc(o):Ki(1);return{width:o.clientWidth*p.x,height:o.clientHeight*p.y,x:f*p.x,y:c*p.y}}(t,n);else{const o=k6(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return mu(r)}function P6(e,t){const n=gu(e);return!(n===t||!Za(n)||_g(n))&&(ja(n).position==="fixed"||P6(n,t))}function _K(e,t,n){const r=Qs(t),o=ei(t),s=n==="fixed",i=Ll(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const f=Ki(0);if(r||!r&&!s)if((qi(t)!=="body"||Gd(o))&&(c=Pg(t)),Qs(t)){const p=Ll(t,!0,s,t);f.x=p.x+t.clientLeft,f.y=p.y+t.clientTop}else o&&(f.x=j6(o));return{x:i.left+c.scrollLeft-f.x,y:i.top+c.scrollTop-f.y,width:i.width,height:i.height}}function G4(e,t){return Qs(e)&&ja(e).position!=="fixed"?t?t(e):e.offsetParent:null}function q4(e,t){const n=Go(e);if(!Qs(e))return n;let r=G4(e,t);for(;r&&kK(r)&&ja(r).position==="static";)r=G4(r,t);return r&&(qi(r)==="html"||qi(r)==="body"&&ja(r).position==="static"&&!bb(r))?n:r||function(o){let s=gu(o);for(;Qs(s)&&!_g(s);){if(bb(s))return s;s=gu(s)}return null}(e)||n}const PK={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=Qs(n),s=ei(n);if(n===s)return t;let i={scrollLeft:0,scrollTop:0},c=Ki(1);const f=Ki(0);if((o||!o&&r!=="fixed")&&((qi(n)!=="body"||Gd(s))&&(i=Pg(n)),Qs(n))){const p=Ll(n);c=Qc(n),f.x=p.x+n.clientLeft,f.y=p.y+n.clientTop}return{width:t.width*c.x,height:t.height*c.y,x:t.x*c.x-i.scrollLeft*c.x+f.x,y:t.y*c.y-i.scrollTop*c.y+f.y}},getDocumentElement:ei,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?function(f,p){const h=p.get(f);if(h)return h;let m=rm(f).filter(x=>Za(x)&&qi(x)!=="body"),v=null;const b=ja(f).position==="fixed";let y=b?gu(f):f;for(;Za(y)&&!_g(y);){const x=ja(y),C=bb(y);C||x.position!=="fixed"||(v=null),(b?!C&&!v:!C&&x.position==="static"&&v&&["absolute","fixed"].includes(v.position)||Gd(y)&&!C&&P6(f,y))?m=m.filter(k=>k!==y):v=x,y=gu(y)}return p.set(f,m),m}(t,this._c):[].concat(n),r],i=s[0],c=s.reduce((f,p)=>{const h=U4(t,p,o);return f.top=Xc(h.top,f.top),f.right=xb(h.right,f.right),f.bottom=xb(h.bottom,f.bottom),f.left=Xc(h.left,f.left),f},U4(t,i,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:q4,getElementRects:async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||q4,s=this.getDimensions;return{reference:_K(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 S6(e)},getScale:Qc,isElement:Za,isRTL:function(e){return getComputedStyle(e).direction==="rtl"}};function IK(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,p=xy(e),h=o||s?[...p?rm(p):[],...rm(t)]:[];h.forEach(C=>{o&&C.addEventListener("scroll",n,{passive:!0}),s&&C.addEventListener("resize",n)});const m=p&&c?function(C,k){let j,_=null;const I=ei(C);function O(){clearTimeout(j),_&&_.disconnect(),_=null}return function E(M,R){M===void 0&&(M=!1),R===void 0&&(R=1),O();const{left:A,top:D,width:T,height:K}=C.getBoundingClientRect();if(M||k(),!T||!K)return;const B={rootMargin:-Tp(D)+"px "+-Tp(I.clientWidth-(A+T))+"px "+-Tp(I.clientHeight-(D+K))+"px "+-Tp(A)+"px",threshold:Xc(0,xb(1,R))||1};let G=!0;function Q(V){const L=V[0].intersectionRatio;if(L!==R){if(!G)return E();L?E(!1,L):j=setTimeout(()=>{E(!1,1e-7)},100)}G=!1}try{_=new IntersectionObserver(Q,{...B,root:I.ownerDocument})}catch{_=new IntersectionObserver(Q,B)}_.observe(C)}(!0),O}(p,n):null;let v,b=-1,y=null;i&&(y=new ResizeObserver(C=>{let[k]=C;k&&k.target===p&&y&&(y.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{y&&y.observe(t)})),n()}),p&&!f&&y.observe(p),y.observe(t));let x=f?Ll(e):null;return f&&function C(){const k=Ll(e);!x||k.x===x.x&&k.y===x.y&&k.width===x.width&&k.height===x.height||n(),x=k,v=requestAnimationFrame(C)}(),n(),()=>{h.forEach(C=>{o&&C.removeEventListener("scroll",n),s&&C.removeEventListener("resize",n)}),m&&m(),y&&y.disconnect(),y=null,f&&cancelAnimationFrame(v)}}const EK=(e,t,n)=>{const r=new Map,o={platform:PK,...n},s={...o.platform,_c:r};return pK(e,t,{...o,platform:s})},OK=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?H4({element:t.current,padding:n}).fn(o):{}:t?H4({element:t,padding:n}).fn(o):{}}}};var ph=typeof document<"u"?u.useLayoutEffect:u.useEffect;function om(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(!om(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)&&!om(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function K4(e){const t=u.useRef(e);return ph(()=>{t.current=e}),t}function MK(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,whileElementsMounted:s,open:i}=e,[c,f]=u.useState({x:null,y:null,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=u.useState(r);om(p,r)||h(r);const m=u.useRef(null),v=u.useRef(null),b=u.useRef(c),y=K4(s),x=K4(o),[C,k]=u.useState(null),[j,_]=u.useState(null),I=u.useCallback(D=>{m.current!==D&&(m.current=D,k(D))},[]),O=u.useCallback(D=>{v.current!==D&&(v.current=D,_(D))},[]),E=u.useCallback(()=>{if(!m.current||!v.current)return;const D={placement:t,strategy:n,middleware:p};x.current&&(D.platform=x.current),EK(m.current,v.current,D).then(T=>{const K={...T,isPositioned:!0};M.current&&!om(b.current,K)&&(b.current=K,fs.flushSync(()=>{f(K)}))})},[p,t,n,x]);ph(()=>{i===!1&&b.current.isPositioned&&(b.current.isPositioned=!1,f(D=>({...D,isPositioned:!1})))},[i]);const M=u.useRef(!1);ph(()=>(M.current=!0,()=>{M.current=!1}),[]),ph(()=>{if(C&&j){if(y.current)return y.current(C,j,E);E()}},[C,j,E,y]);const R=u.useMemo(()=>({reference:m,floating:v,setReference:I,setFloating:O}),[I,O]),A=u.useMemo(()=>({reference:C,floating:j}),[C,j]);return u.useMemo(()=>({...c,update:E,refs:R,elements:A,reference:I,floating:O}),[c,E,R,A,I,O])}var RK=typeof document<"u"?u.useLayoutEffect:u.useEffect;function DK(){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 AK=u.createContext(null),NK=()=>u.useContext(AK);function TK(e){return(e==null?void 0:e.ownerDocument)||document}function $K(e){return TK(e).defaultView||window}function $p(e){return e?e instanceof $K(e).Element:!1}const LK=ex["useInsertionEffect".toString()],FK=LK||(e=>e());function zK(e){const t=u.useRef(()=>{});return FK(()=>{t.current=e}),u.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 BK(e){e===void 0&&(e={});const{open:t=!1,onOpenChange:n,nodeId:r}=e,o=MK(e),s=NK(),i=u.useRef(null),c=u.useRef({}),f=u.useState(()=>DK())[0],[p,h]=u.useState(null),m=u.useCallback(k=>{const j=$p(k)?{getBoundingClientRect:()=>k.getBoundingClientRect(),contextElement:k}:k;o.refs.setReference(j)},[o.refs]),v=u.useCallback(k=>{($p(k)||k===null)&&(i.current=k,h(k)),($p(o.refs.reference.current)||o.refs.reference.current===null||k!==null&&!$p(k))&&o.refs.setReference(k)},[o.refs]),b=u.useMemo(()=>({...o.refs,setReference:v,setPositionReference:m,domReference:i}),[o.refs,v,m]),y=u.useMemo(()=>({...o.elements,domReference:p}),[o.elements,p]),x=zK(n),C=u.useMemo(()=>({...o,refs:b,elements:y,dataRef:c,nodeId:r,events:f,open:t,onOpenChange:x}),[o,r,f,t,x,b,y]);return RK(()=>{const k=s==null?void 0:s.nodesRef.current.find(j=>j.id===r);k&&(k.context=C)}),u.useMemo(()=>({...o,context:C,refs:b,reference:v,positionReference:m}),[o,b,C,v,m])}function HK({opened:e,floating:t,position:n,positionDependencies:r}){const[o,s]=u.useState(0);u.useEffect(()=>{if(t.refs.reference.current&&t.refs.floating.current)return IK(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,o,n]),Hs(()=>{t.update()},r),Hs(()=>{s(i=>i+1)},[e])}function WK(e){const t=[yK(e.offset)];return e.middlewares.shift&&t.push(wK({limiter:CK()})),e.middlewares.flip&&t.push(bK()),e.middlewares.inline&&t.push(xK()),t.push(OK({element:e.arrowRef,padding:e.arrowOffset})),t}function VK(e){const[t,n]=Ud({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,c;t?((i=e.onClose)==null||i.call(e),n(!1)):((c=e.onOpen)==null||c.call(e),n(!0))},s=BK({placement:e.position,middleware:[...WK(e),...e.width==="target"?[SK({apply({rects:i}){var c,f;Object.assign((f=(c=s.refs.floating.current)==null?void 0:c.style)!=null?f:{},{width:`${i.reference.width}px`})}})]:[]]});return HK({opened:e.opened,position:e.position,positionDependencies:e.positionDependencies,floating:s}),Hs(()=>{var i;(i=e.onPositionChange)==null||i.call(e,s.placement)},[s.placement]),Hs(()=>{var i,c;e.opened?(c=e.onOpen)==null||c.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 I6={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"},[UK,E6]=RV(I6.context);var GK=Object.defineProperty,qK=Object.defineProperties,KK=Object.getOwnPropertyDescriptors,sm=Object.getOwnPropertySymbols,O6=Object.prototype.hasOwnProperty,M6=Object.prototype.propertyIsEnumerable,X4=(e,t,n)=>t in e?GK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Lp=(e,t)=>{for(var n in t||(t={}))O6.call(t,n)&&X4(e,n,t[n]);if(sm)for(var n of sm(t))M6.call(t,n)&&X4(e,n,t[n]);return e},XK=(e,t)=>qK(e,KK(t)),QK=(e,t)=>{var n={};for(var r in e)O6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&sm)for(var r of sm(e))t.indexOf(r)<0&&M6.call(e,r)&&(n[r]=e[r]);return n};const YK={refProp:"ref",popupType:"dialog"},R6=u.forwardRef((e,t)=>{const n=_r("PopoverTarget",YK,e),{children:r,refProp:o,popupType:s}=n,i=QK(n,["children","refProp","popupType"]);if(!aI(r))throw new Error(I6.children);const c=i,f=E6(),p=_f(f.reference,r.ref,t),h=f.withRoles?{"aria-haspopup":s,"aria-expanded":f.opened,"aria-controls":f.getDropdownId(),id:f.getTargetId()}:{};return u.cloneElement(r,Lp(XK(Lp(Lp(Lp({},c),h),f.targetProps),{className:lI(f.targetProps.className,c.className,r.props.className),[o]:p}),f.controlled?null:{onClick:f.onToggle}))});R6.displayName="@mantine/core/PopoverTarget";var JK=fo((e,{radius:t,shadow:n})=>({dropdown:{position:"absolute",backgroundColor:e.white,background:e.colorScheme==="dark"?e.colors.dark[6]:e.white,border:`${Ge(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:`${Ge(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`,zIndex:1}}));const ZK=JK;var eX=Object.defineProperty,Q4=Object.getOwnPropertySymbols,tX=Object.prototype.hasOwnProperty,nX=Object.prototype.propertyIsEnumerable,Y4=(e,t,n)=>t in e?eX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yc=(e,t)=>{for(var n in t||(t={}))tX.call(t,n)&&Y4(e,n,t[n]);if(Q4)for(var n of Q4(t))nX.call(t,n)&&Y4(e,n,t[n]);return e};const J4={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function rX({transition:e,state:t,duration:n,timingFunction:r}){const o={transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e=="string"?e in Op?yc(yc(yc({transitionProperty:Op[e].transitionProperty},o),Op[e].common),Op[e][J4[t]]):null:yc(yc(yc({transitionProperty:e.transitionProperty},o),e.common),e[J4[t]])}function oX({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:o,onExit:s,onEntered:i,onExited:c}){const f=pi(),p=mI(),h=f.respectReducedMotion?p:!1,[m,v]=u.useState(h?0:e),[b,y]=u.useState(r?"entered":"exited"),x=u.useRef(-1),C=k=>{const j=k?o:s,_=k?i:c;y(k?"pre-entering":"pre-exiting"),window.clearTimeout(x.current);const I=h?0:k?e:t;if(v(I),I===0)typeof j=="function"&&j(),typeof _=="function"&&_(),y(k?"entered":"exited");else{const O=window.setTimeout(()=>{typeof j=="function"&&j(),y(k?"entering":"exiting")},10);x.current=window.setTimeout(()=>{window.clearTimeout(O),typeof _=="function"&&_(),y(k?"entered":"exited")},I)}};return Hs(()=>{C(r)},[r]),u.useEffect(()=>()=>window.clearTimeout(x.current),[]),{transitionDuration:m,transitionStatus:b,transitionTimingFunction:n||f.transitionTimingFunction}}function D6({keepMounted:e,transition:t,duration:n=250,exitDuration:r=n,mounted:o,children:s,timingFunction:i,onExit:c,onEntered:f,onEnter:p,onExited:h}){const{transitionDuration:m,transitionStatus:v,transitionTimingFunction:b}=oX({mounted:o,exitDuration:r,duration:n,timingFunction:i,onExit:c,onEntered:f,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(rX({transition:t,duration:m,state:v,timingFunction:b})))}D6.displayName="@mantine/core/Transition";function A6({children:e,active:t=!0,refProp:n="ref"}){const r=fU(t),o=_f(r,e==null?void 0:e.ref);return aI(e)?u.cloneElement(e,{[n]:o}):e}A6.displayName="@mantine/core/FocusTrap";var sX=Object.defineProperty,aX=Object.defineProperties,iX=Object.getOwnPropertyDescriptors,Z4=Object.getOwnPropertySymbols,lX=Object.prototype.hasOwnProperty,cX=Object.prototype.propertyIsEnumerable,ek=(e,t,n)=>t in e?sX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_i=(e,t)=>{for(var n in t||(t={}))lX.call(t,n)&&ek(e,n,t[n]);if(Z4)for(var n of Z4(t))cX.call(t,n)&&ek(e,n,t[n]);return e},Fp=(e,t)=>aX(e,iX(t));function tk(e,t,n,r){return e==="center"||r==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function nk(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 uX={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function dX({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,arrowX:s,arrowY:i,dir:c}){const[f,p="center"]=e.split("-"),h={width:Ge(t),height:Ge(t),transform:"rotate(45deg)",position:"absolute",[uX[f]]:Ge(r)},m=Ge(-t/2);return f==="left"?Fp(_i(_i({},h),tk(p,i,n,o)),{right:m,borderLeftColor:"transparent",borderBottomColor:"transparent"}):f==="right"?Fp(_i(_i({},h),tk(p,i,n,o)),{left:m,borderRightColor:"transparent",borderTopColor:"transparent"}):f==="top"?Fp(_i(_i({},h),nk(p,s,n,o,c)),{bottom:m,borderTopColor:"transparent",borderLeftColor:"transparent"}):f==="bottom"?Fp(_i(_i({},h),nk(p,s,n,o,c)),{top:m,borderBottomColor:"transparent",borderRightColor:"transparent"}):{}}var fX=Object.defineProperty,pX=Object.defineProperties,hX=Object.getOwnPropertyDescriptors,am=Object.getOwnPropertySymbols,N6=Object.prototype.hasOwnProperty,T6=Object.prototype.propertyIsEnumerable,rk=(e,t,n)=>t in e?fX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mX=(e,t)=>{for(var n in t||(t={}))N6.call(t,n)&&rk(e,n,t[n]);if(am)for(var n of am(t))T6.call(t,n)&&rk(e,n,t[n]);return e},gX=(e,t)=>pX(e,hX(t)),vX=(e,t)=>{var n={};for(var r in e)N6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&am)for(var r of am(e))t.indexOf(r)<0&&T6.call(e,r)&&(n[r]=e[r]);return n};const $6=u.forwardRef((e,t)=>{var n=e,{position:r,arrowSize:o,arrowOffset:s,arrowRadius:i,arrowPosition:c,visible:f,arrowX:p,arrowY:h}=n,m=vX(n,["position","arrowSize","arrowOffset","arrowRadius","arrowPosition","visible","arrowX","arrowY"]);const v=pi();return f?H.createElement("div",gX(mX({},m),{ref:t,style:dX({position:r,arrowSize:o,arrowOffset:s,arrowRadius:i,arrowPosition:c,dir:v.dir,arrowX:p,arrowY:h})})):null});$6.displayName="@mantine/core/FloatingArrow";var bX=Object.defineProperty,xX=Object.defineProperties,yX=Object.getOwnPropertyDescriptors,im=Object.getOwnPropertySymbols,L6=Object.prototype.hasOwnProperty,F6=Object.prototype.propertyIsEnumerable,ok=(e,t,n)=>t in e?bX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wc=(e,t)=>{for(var n in t||(t={}))L6.call(t,n)&&ok(e,n,t[n]);if(im)for(var n of im(t))F6.call(t,n)&&ok(e,n,t[n]);return e},zp=(e,t)=>xX(e,yX(t)),wX=(e,t)=>{var n={};for(var r in e)L6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&im)for(var r of im(e))t.indexOf(r)<0&&F6.call(e,r)&&(n[r]=e[r]);return n};const CX={};function z6(e){var t;const n=_r("PopoverDropdown",CX,e),{style:r,className:o,children:s,onKeyDownCapture:i}=n,c=wX(n,["style","className","children","onKeyDownCapture"]),f=E6(),{classes:p,cx:h}=ZK({radius:f.radius,shadow:f.shadow},{name:f.__staticSelector,classNames:f.classNames,styles:f.styles,unstyled:f.unstyled,variant:f.variant}),m=sU({opened:f.opened,shouldReturnFocus:f.returnFocus}),v=f.withRoles?{"aria-labelledby":f.getTargetId(),id:f.getDropdownId(),role:"dialog"}:{};return f.disabled?null:H.createElement(zI,zp(wc({},f.portalProps),{withinPortal:f.withinPortal}),H.createElement(D6,zp(wc({mounted:f.opened},f.transitionProps),{transition:f.transitionProps.transition||"fade",duration:(t=f.transitionProps.duration)!=null?t:150,keepMounted:f.keepMounted,exitDuration:typeof f.transitionProps.exitDuration=="number"?f.transitionProps.exitDuration:f.transitionProps.duration}),b=>{var y,x;return H.createElement(A6,{active:f.trapFocus},H.createElement(No,wc(zp(wc({},v),{tabIndex:-1,ref:f.floating,style:zp(wc(wc({},r),b),{zIndex:f.zIndex,top:(y=f.y)!=null?y:0,left:(x=f.x)!=null?x:0,width:f.width==="target"?void 0:Ge(f.width)}),className:h(p.dropdown,o),onKeyDownCapture:AV(f.onClose,{active:f.closeOnEscape,onTrigger:m,onKeyDown:i}),"data-position":f.placement}),c),s,H.createElement($6,{ref:f.arrowRef,arrowX:f.arrowX,arrowY:f.arrowY,visible:f.withArrow,position:f.placement,arrowSize:f.arrowSize,arrowRadius:f.arrowRadius,arrowOffset:f.arrowOffset,arrowPosition:f.arrowPosition,className:p.arrow})))}))}z6.displayName="@mantine/core/PopoverDropdown";function SX(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 sk=Object.getOwnPropertySymbols,kX=Object.prototype.hasOwnProperty,jX=Object.prototype.propertyIsEnumerable,_X=(e,t)=>{var n={};for(var r in e)kX.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&sk)for(var r of sk(e))t.indexOf(r)<0&&jX.call(e,r)&&(n[r]=e[r]);return n};const PX={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:cy("popover"),__staticSelector:"Popover",width:"max-content"};function Ru(e){var t,n,r,o,s,i;const c=u.useRef(null),f=_r("Popover",PX,e),{children:p,position:h,offset:m,onPositionChange:v,positionDependencies:b,opened:y,transitionProps:x,width:C,middlewares:k,withArrow:j,arrowSize:_,arrowOffset:I,arrowRadius:O,arrowPosition:E,unstyled:M,classNames:R,styles:A,closeOnClickOutside:D,withinPortal:T,portalProps:K,closeOnEscape:B,clickOutsideEvents:G,trapFocus:Q,onClose:V,onOpen:L,onChange:X,zIndex:F,radius:q,shadow:te,id:Y,defaultOpened:ce,__staticSelector:ae,withRoles:U,disabled:W,returnFocus:ne,variant:ie,keepMounted:oe}=f,me=_X(f,["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"]),[fe,he]=u.useState(null),[Ce,xe]=u.useState(null),de=dy(Y),Ne=pi(),De=VK({middlewares:k,width:C,position:SX(Ne.dir,h),offset:typeof m=="number"?m+(j?_/2:0):m,arrowRef:c,arrowOffset:I,onPositionChange:v,positionDependencies:b,opened:y,defaultOpened:ce,onChange:X,onOpen:L,onClose:V});tU(()=>De.opened&&D&&De.onClose(),G,[fe,Ce]);const Xe=u.useCallback(lt=>{he(lt),De.floating.reference(lt)},[De.floating.reference]),It=u.useCallback(lt=>{xe(lt),De.floating.floating(lt)},[De.floating.floating]);return H.createElement(UK,{value:{returnFocus:ne,disabled:W,controlled:De.controlled,reference:Xe,floating:It,x:De.floating.x,y:De.floating.y,arrowX:(r=(n=(t=De.floating)==null?void 0:t.middlewareData)==null?void 0:n.arrow)==null?void 0:r.x,arrowY:(i=(s=(o=De.floating)==null?void 0:o.middlewareData)==null?void 0:s.arrow)==null?void 0:i.y,opened:De.opened,arrowRef:c,transitionProps:x,width:C,withArrow:j,arrowSize:_,arrowOffset:I,arrowRadius:O,arrowPosition:E,placement:De.floating.placement,trapFocus:Q,withinPortal:T,portalProps:K,zIndex:F,radius:q,shadow:te,closeOnEscape:B,onClose:De.onClose,onToggle:De.onToggle,getTargetId:()=>`${de}-target`,getDropdownId:()=>`${de}-dropdown`,withRoles:U,targetProps:me,__staticSelector:ae,classNames:R,styles:A,unstyled:M,variant:ie,keepMounted:oe}},p)}Ru.Target=R6;Ru.Dropdown=z6;Ru.displayName="@mantine/core/Popover";var IX=Object.defineProperty,lm=Object.getOwnPropertySymbols,B6=Object.prototype.hasOwnProperty,H6=Object.prototype.propertyIsEnumerable,ak=(e,t,n)=>t in e?IX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,EX=(e,t)=>{for(var n in t||(t={}))B6.call(t,n)&&ak(e,n,t[n]);if(lm)for(var n of lm(t))H6.call(t,n)&&ak(e,n,t[n]);return e},OX=(e,t)=>{var n={};for(var r in e)B6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&lm)for(var r of lm(e))t.indexOf(r)<0&&H6.call(e,r)&&(n[r]=e[r]);return n};function MX(e){var t=e,{children:n,component:r="div",maxHeight:o=220,direction:s="column",id:i,innerRef:c,__staticSelector:f,styles:p,classNames:h,unstyled:m}=t,v=OX(t,["children","component","maxHeight","direction","id","innerRef","__staticSelector","styles","classNames","unstyled"]);const{classes:b}=fK(null,{name:f,styles:p,classNames:h,unstyled:m});return H.createElement(Ru.Dropdown,EX({p:0,onMouseDown:y=>y.preventDefault()},v),H.createElement("div",{style:{maxHeight:Ge(o),display:"flex"}},H.createElement(No,{component:r||"div",id:`${i}-items`,"aria-labelledby":`${i}-label`,role:"listbox",onMouseDown:y=>y.preventDefault(),style:{flex:1,overflowY:r!==jg?"auto":void 0},"data-combobox-popover":!0,tabIndex:-1,ref:c},H.createElement("div",{className:b.itemsWrapper,style:{flexDirection:s}},n))))}function zi({opened:e,transitionProps:t={transition:"fade",duration:0},shadow:n,withinPortal:r,portalProps:o,children:s,__staticSelector:i,onDirectionChange:c,switchDirectionOnFlip:f,zIndex:p,dropdownPosition:h,positionDependencies:m=[],classNames:v,styles:b,unstyled:y,readOnly:x,variant:C}){return H.createElement(Ru,{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=>f&&(c==null?void 0:c(k==="top"?"column-reverse":"column")),variant:C},s)}zi.Target=Ru.Target;zi.Dropdown=MX;var RX=Object.defineProperty,DX=Object.defineProperties,AX=Object.getOwnPropertyDescriptors,cm=Object.getOwnPropertySymbols,W6=Object.prototype.hasOwnProperty,V6=Object.prototype.propertyIsEnumerable,ik=(e,t,n)=>t in e?RX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Bp=(e,t)=>{for(var n in t||(t={}))W6.call(t,n)&&ik(e,n,t[n]);if(cm)for(var n of cm(t))V6.call(t,n)&&ik(e,n,t[n]);return e},NX=(e,t)=>DX(e,AX(t)),TX=(e,t)=>{var n={};for(var r in e)W6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&cm)for(var r of cm(e))t.indexOf(r)<0&&V6.call(e,r)&&(n[r]=e[r]);return n};function U6(e,t,n){const r=_r(e,t,n),{label:o,description:s,error:i,required:c,classNames:f,styles:p,className:h,unstyled:m,__staticSelector:v,sx:b,errorProps:y,labelProps:x,descriptionProps:C,wrapperProps:k,id:j,size:_,style:I,inputContainer:O,inputWrapperOrder:E,withAsterisk:M,variant:R}=r,A=TX(r,["label","description","error","required","classNames","styles","className","unstyled","__staticSelector","sx","errorProps","labelProps","descriptionProps","wrapperProps","id","size","style","inputContainer","inputWrapperOrder","withAsterisk","variant"]),D=dy(j),{systemStyles:T,rest:K}=wg(A),B=Bp({label:o,description:s,error:i,required:c,classNames:f,className:h,__staticSelector:v,sx:b,errorProps:y,labelProps:x,descriptionProps:C,unstyled:m,styles:p,id:D,size:_,style:I,inputContainer:O,inputWrapperOrder:E,withAsterisk:M,variant:R},k);return NX(Bp({},K),{classNames:f,styles:p,unstyled:m,wrapperProps:Bp(Bp({},B),T),inputProps:{required:c,classNames:f,styles:p,unstyled:m,id:D,size:_,__staticSelector:v,error:i,variant:R}})}var $X=fo((e,t,{size:n})=>({label:{display:"inline-block",fontSize:Gt({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 LX=$X;var FX=Object.defineProperty,um=Object.getOwnPropertySymbols,G6=Object.prototype.hasOwnProperty,q6=Object.prototype.propertyIsEnumerable,lk=(e,t,n)=>t in e?FX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zX=(e,t)=>{for(var n in t||(t={}))G6.call(t,n)&&lk(e,n,t[n]);if(um)for(var n of um(t))q6.call(t,n)&&lk(e,n,t[n]);return e},BX=(e,t)=>{var n={};for(var r in e)G6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&um)for(var r of um(e))t.indexOf(r)<0&&q6.call(e,r)&&(n[r]=e[r]);return n};const HX={labelElement:"label",size:"sm"},yy=u.forwardRef((e,t)=>{const n=_r("InputLabel",HX,e),{labelElement:r,children:o,required:s,size:i,classNames:c,styles:f,unstyled:p,className:h,htmlFor:m,__staticSelector:v,variant:b,onMouseDown:y}=n,x=BX(n,["labelElement","children","required","size","classNames","styles","unstyled","className","htmlFor","__staticSelector","variant","onMouseDown"]),{classes:C,cx:k}=LX(null,{name:["InputWrapper",v],classNames:c,styles:f,unstyled:p,variant:b,size:i});return H.createElement(No,zX({component:r,ref:t,className:k(C.label,h),htmlFor:r==="label"?m:void 0,onMouseDown:j=>{y==null||y(j),!j.defaultPrevented&&j.detail>1&&j.preventDefault()}},x),o,s&&H.createElement("span",{className:C.required,"aria-hidden":!0}," *"))});yy.displayName="@mantine/core/InputLabel";var WX=fo((e,t,{size:n})=>({error:{wordBreak:"break-word",color:e.fn.variant({variant:"filled",color:"red"}).background,fontSize:`calc(${Gt({size:n,sizes:e.fontSizes})} - ${Ge(2)})`,lineHeight:1.2,display:"block"}}));const VX=WX;var UX=Object.defineProperty,dm=Object.getOwnPropertySymbols,K6=Object.prototype.hasOwnProperty,X6=Object.prototype.propertyIsEnumerable,ck=(e,t,n)=>t in e?UX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,GX=(e,t)=>{for(var n in t||(t={}))K6.call(t,n)&&ck(e,n,t[n]);if(dm)for(var n of dm(t))X6.call(t,n)&&ck(e,n,t[n]);return e},qX=(e,t)=>{var n={};for(var r in e)K6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&dm)for(var r of dm(e))t.indexOf(r)<0&&X6.call(e,r)&&(n[r]=e[r]);return n};const KX={size:"sm"},wy=u.forwardRef((e,t)=>{const n=_r("InputError",KX,e),{children:r,className:o,classNames:s,styles:i,unstyled:c,size:f,__staticSelector:p,variant:h}=n,m=qX(n,["children","className","classNames","styles","unstyled","size","__staticSelector","variant"]),{classes:v,cx:b}=VX(null,{name:["InputWrapper",p],classNames:s,styles:i,unstyled:c,variant:h,size:f});return H.createElement(pu,GX({className:b(v.error,o),ref:t},m),r)});wy.displayName="@mantine/core/InputError";var XX=fo((e,t,{size:n})=>({description:{wordBreak:"break-word",color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],fontSize:`calc(${Gt({size:n,sizes:e.fontSizes})} - ${Ge(2)})`,lineHeight:1.2,display:"block"}}));const QX=XX;var YX=Object.defineProperty,fm=Object.getOwnPropertySymbols,Q6=Object.prototype.hasOwnProperty,Y6=Object.prototype.propertyIsEnumerable,uk=(e,t,n)=>t in e?YX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,JX=(e,t)=>{for(var n in t||(t={}))Q6.call(t,n)&&uk(e,n,t[n]);if(fm)for(var n of fm(t))Y6.call(t,n)&&uk(e,n,t[n]);return e},ZX=(e,t)=>{var n={};for(var r in e)Q6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&fm)for(var r of fm(e))t.indexOf(r)<0&&Y6.call(e,r)&&(n[r]=e[r]);return n};const eQ={size:"sm"},Cy=u.forwardRef((e,t)=>{const n=_r("InputDescription",eQ,e),{children:r,className:o,classNames:s,styles:i,unstyled:c,size:f,__staticSelector:p,variant:h}=n,m=ZX(n,["children","className","classNames","styles","unstyled","size","__staticSelector","variant"]),{classes:v,cx:b}=QX(null,{name:["InputWrapper",p],classNames:s,styles:i,unstyled:c,variant:h,size:f});return H.createElement(pu,JX({color:"dimmed",className:b(v.description,o),ref:t,unstyled:c},m),r)});Cy.displayName="@mantine/core/InputDescription";const J6=u.createContext({offsetBottom:!1,offsetTop:!1,describedBy:void 0}),tQ=J6.Provider,nQ=()=>u.useContext(J6);function rQ(e,{hasDescription:t,hasError:n}){const r=e.findIndex(f=>f==="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 oQ=Object.defineProperty,sQ=Object.defineProperties,aQ=Object.getOwnPropertyDescriptors,dk=Object.getOwnPropertySymbols,iQ=Object.prototype.hasOwnProperty,lQ=Object.prototype.propertyIsEnumerable,fk=(e,t,n)=>t in e?oQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,cQ=(e,t)=>{for(var n in t||(t={}))iQ.call(t,n)&&fk(e,n,t[n]);if(dk)for(var n of dk(t))lQ.call(t,n)&&fk(e,n,t[n]);return e},uQ=(e,t)=>sQ(e,aQ(t)),dQ=fo(e=>({root:uQ(cQ({},e.fn.fontStyles()),{lineHeight:e.lineHeight})}));const fQ=dQ;var pQ=Object.defineProperty,hQ=Object.defineProperties,mQ=Object.getOwnPropertyDescriptors,pm=Object.getOwnPropertySymbols,Z6=Object.prototype.hasOwnProperty,eE=Object.prototype.propertyIsEnumerable,pk=(e,t,n)=>t in e?pQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Pi=(e,t)=>{for(var n in t||(t={}))Z6.call(t,n)&&pk(e,n,t[n]);if(pm)for(var n of pm(t))eE.call(t,n)&&pk(e,n,t[n]);return e},hk=(e,t)=>hQ(e,mQ(t)),gQ=(e,t)=>{var n={};for(var r in e)Z6.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&pm)for(var r of pm(e))t.indexOf(r)<0&&eE.call(e,r)&&(n[r]=e[r]);return n};const vQ={labelElement:"label",size:"sm",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},tE=u.forwardRef((e,t)=>{const n=_r("InputWrapper",vQ,e),{className:r,label:o,children:s,required:i,id:c,error:f,description:p,labelElement:h,labelProps:m,descriptionProps:v,errorProps:b,classNames:y,styles:x,size:C,inputContainer:k,__staticSelector:j,unstyled:_,inputWrapperOrder:I,withAsterisk:O,variant:E}=n,M=gQ(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}=fQ(null,{classNames:y,styles:x,name:["InputWrapper",j],unstyled:_,variant:E,size:C}),D={classNames:y,styles:x,unstyled:_,size:C,variant:E,__staticSelector:j},T=typeof O=="boolean"?O:i,K=c?`${c}-error`:b==null?void 0:b.id,B=c?`${c}-description`:v==null?void 0:v.id,Q=`${!!f&&typeof f!="boolean"?K:""} ${p?B:""}`,V=Q.trim().length>0?Q.trim():void 0,L=o&&H.createElement(yy,Pi(Pi({key:"label",labelElement:h,id:c?`${c}-label`:void 0,htmlFor:c,required:T},D),m),o),X=p&&H.createElement(Cy,hk(Pi(Pi({key:"description"},v),D),{size:(v==null?void 0:v.size)||D.size,id:(v==null?void 0:v.id)||B}),p),F=H.createElement(u.Fragment,{key:"input"},k(s)),q=typeof f!="boolean"&&f&&H.createElement(wy,hk(Pi(Pi({},b),D),{size:(b==null?void 0:b.size)||D.size,key:"error",id:(b==null?void 0:b.id)||K}),f),te=I.map(Y=>{switch(Y){case"label":return L;case"input":return F;case"description":return X;case"error":return q;default:return null}});return H.createElement(tQ,{value:Pi({describedBy:V},rQ(I,{hasDescription:!!X,hasError:!!q}))},H.createElement(No,Pi({className:A(R.root,r),ref:t},M),te))});tE.displayName="@mantine/core/InputWrapper";var bQ=Object.defineProperty,hm=Object.getOwnPropertySymbols,nE=Object.prototype.hasOwnProperty,rE=Object.prototype.propertyIsEnumerable,mk=(e,t,n)=>t in e?bQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xQ=(e,t)=>{for(var n in t||(t={}))nE.call(t,n)&&mk(e,n,t[n]);if(hm)for(var n of hm(t))rE.call(t,n)&&mk(e,n,t[n]);return e},yQ=(e,t)=>{var n={};for(var r in e)nE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&hm)for(var r of hm(e))t.indexOf(r)<0&&rE.call(e,r)&&(n[r]=e[r]);return n};const wQ={},oE=u.forwardRef((e,t)=>{const n=_r("InputPlaceholder",wQ,e),{sx:r}=n,o=yQ(n,["sx"]);return H.createElement(No,xQ({component:"span",sx:[s=>s.fn.placeholderStyles(),...oI(r)],ref:t},o))});oE.displayName="@mantine/core/InputPlaceholder";var CQ=Object.defineProperty,SQ=Object.defineProperties,kQ=Object.getOwnPropertyDescriptors,gk=Object.getOwnPropertySymbols,jQ=Object.prototype.hasOwnProperty,_Q=Object.prototype.propertyIsEnumerable,vk=(e,t,n)=>t in e?CQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Hp=(e,t)=>{for(var n in t||(t={}))jQ.call(t,n)&&vk(e,n,t[n]);if(gk)for(var n of gk(t))_Q.call(t,n)&&vk(e,n,t[n]);return e},Bv=(e,t)=>SQ(e,kQ(t));const ls={xs:Ge(30),sm:Ge(36),md:Ge(42),lg:Ge(50),xl:Ge(60)},PQ=["default","filled","unstyled"];function IQ({theme:e,variant:t}){return PQ.includes(t)?t==="default"?{border:`${Ge(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:`${Ge(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:Ge(28),outline:0,"&:focus, &:focus-within":{outline:"none",borderColor:"transparent"},"&:disabled":{backgroundColor:"transparent","&:focus, &:focus-within":{outline:"none",borderColor:"transparent"}}}:null}var EQ=fo((e,{multiline:t,radius:n,invalid:r,rightSectionWidth:o,withRightSection:s,iconWidth:i,offsetBottom:c,offsetTop:f,pointer:p},{variant:h,size:m})=>{const v=e.fn.variant({variant:"filled",color:"red"}).background,b=h==="default"||h==="filled"?{minHeight:Gt({size:m,sizes:ls}),paddingLeft:`calc(${Gt({size:m,sizes:ls})} / 3)`,paddingRight:s?o||Gt({size:m,sizes:ls}):`calc(${Gt({size:m,sizes:ls})} / 3)`,borderRadius:e.fn.radius(n)}:h==="unstyled"&&s?{paddingRight:o||Gt({size:m,sizes:ls})}:null;return{wrapper:{position:"relative",marginTop:f?`calc(${e.spacing.xs} / 2)`:void 0,marginBottom:c?`calc(${e.spacing.xs} / 2)`:void 0,"&:has(input:disabled)":{"& .mantine-Input-rightSection":{display:"none"}}},input:Bv(Hp(Hp(Bv(Hp({},e.fn.fontStyles()),{height:t?h==="unstyled"?void 0:"auto":Gt({size:m,sizes:ls}),WebkitTapHighlightColor:"transparent",lineHeight:t?e.lineHeight:`calc(${Gt({size:m,sizes:ls})} - ${Ge(2)})`,appearance:"none",resize:"none",boxSizing:"border-box",fontSize:Gt({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}),IQ({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"?Ge(i):Gt({size:m,sizes:ls})},"&::placeholder":Bv(Hp({},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?Ge(i):Gt({size:m,sizes:ls}),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||Gt({size:m,sizes:ls})}}});const OQ=EQ;var MQ=Object.defineProperty,RQ=Object.defineProperties,DQ=Object.getOwnPropertyDescriptors,mm=Object.getOwnPropertySymbols,sE=Object.prototype.hasOwnProperty,aE=Object.prototype.propertyIsEnumerable,bk=(e,t,n)=>t in e?MQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Wp=(e,t)=>{for(var n in t||(t={}))sE.call(t,n)&&bk(e,n,t[n]);if(mm)for(var n of mm(t))aE.call(t,n)&&bk(e,n,t[n]);return e},xk=(e,t)=>RQ(e,DQ(t)),AQ=(e,t)=>{var n={};for(var r in e)sE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&mm)for(var r of mm(e))t.indexOf(r)<0&&aE.call(e,r)&&(n[r]=e[r]);return n};const NQ={size:"sm",variant:"default"},Ql=u.forwardRef((e,t)=>{const n=_r("Input",NQ,e),{className:r,error:o,required:s,disabled:i,variant:c,icon:f,style:p,rightSectionWidth:h,iconWidth:m,rightSection:v,rightSectionProps:b,radius:y,size:x,wrapperProps:C,classNames:k,styles:j,__staticSelector:_,multiline:I,sx:O,unstyled:E,pointer:M}=n,R=AQ(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:D,describedBy:T}=nQ(),{classes:K,cx:B}=OQ({radius:y,multiline:I,invalid:!!o,rightSectionWidth:h?Ge(h):void 0,iconWidth:m,withRightSection:!!v,offsetBottom:A,offsetTop:D,pointer:M},{classNames:k,styles:j,name:["Input",_],unstyled:E,variant:c,size:x}),{systemStyles:G,rest:Q}=wg(R);return H.createElement(No,Wp(Wp({className:B(K.wrapper,r),sx:O,style:p},G),C),f&&H.createElement("div",{className:K.icon},f),H.createElement(No,xk(Wp({component:"input"},Q),{ref:t,required:s,"aria-invalid":!!o,"aria-describedby":T,disabled:i,"data-disabled":i||void 0,"data-with-icon":!!f||void 0,"data-invalid":!!o||void 0,className:K.input})),v&&H.createElement("div",xk(Wp({},b),{className:K.rightSection}),v))});Ql.displayName="@mantine/core/Input";Ql.Wrapper=tE;Ql.Label=yy;Ql.Description=Cy;Ql.Error=wy;Ql.Placeholder=oE;const vu=Ql;var TQ=Object.defineProperty,gm=Object.getOwnPropertySymbols,iE=Object.prototype.hasOwnProperty,lE=Object.prototype.propertyIsEnumerable,yk=(e,t,n)=>t in e?TQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wk=(e,t)=>{for(var n in t||(t={}))iE.call(t,n)&&yk(e,n,t[n]);if(gm)for(var n of gm(t))lE.call(t,n)&&yk(e,n,t[n]);return e},$Q=(e,t)=>{var n={};for(var r in e)iE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&gm)for(var r of gm(e))t.indexOf(r)<0&&lE.call(e,r)&&(n[r]=e[r]);return n};const LQ={multiple:!1},cE=u.forwardRef((e,t)=>{const n=_r("FileButton",LQ,e),{onChange:r,children:o,multiple:s,accept:i,name:c,form:f,resetRef:p,disabled:h,capture:m,inputProps:v}=n,b=$Q(n,["onChange","children","multiple","accept","name","form","resetRef","disabled","capture","inputProps"]),y=u.useRef(),x=()=>{!h&&y.current.click()},C=j=>{r(s?Array.from(j.currentTarget.files):j.currentTarget.files[0]||null)};return hI(p,()=>{y.current.value=""}),H.createElement(H.Fragment,null,o(wk({onClick:x},b)),H.createElement("input",wk({style:{display:"none"},type:"file",accept:i,multiple:s,onChange:C,ref:_f(t,y),name:c,form:f,capture:m},v)))});cE.displayName="@mantine/core/FileButton";const uE={xs:Ge(16),sm:Ge(22),md:Ge(26),lg:Ge(30),xl:Ge(36)},FQ={xs:Ge(10),sm:Ge(12),md:Ge(14),lg:Ge(16),xl:Ge(18)};var zQ=fo((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:Gt({size:o,sizes:uE}),paddingLeft:`calc(${Gt({size:o,sizes:e.spacing})} / 1.5)`,paddingRight:t||r?Gt({size:o,sizes:e.spacing}):0,fontWeight:500,fontSize:Gt({size:o,sizes:FQ}),borderRadius:Gt({size:n,sizes:e.radius}),cursor:t?"not-allowed":"default",userSelect:"none",maxWidth:`calc(100% - ${Ge(10)})`},defaultValueRemove:{color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],marginLeft:`calc(${Gt({size:o,sizes:e.spacing})} / 6)`},defaultValueLabel:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}));const BQ=zQ;var HQ=Object.defineProperty,vm=Object.getOwnPropertySymbols,dE=Object.prototype.hasOwnProperty,fE=Object.prototype.propertyIsEnumerable,Ck=(e,t,n)=>t in e?HQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,WQ=(e,t)=>{for(var n in t||(t={}))dE.call(t,n)&&Ck(e,n,t[n]);if(vm)for(var n of vm(t))fE.call(t,n)&&Ck(e,n,t[n]);return e},VQ=(e,t)=>{var n={};for(var r in e)dE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&vm)for(var r of vm(e))t.indexOf(r)<0&&fE.call(e,r)&&(n[r]=e[r]);return n};const UQ={xs:16,sm:22,md:24,lg:26,xl:30};function pE(e){var t=e,{label:n,classNames:r,styles:o,className:s,onRemove:i,disabled:c,readOnly:f,size:p,radius:h="sm",variant:m,unstyled:v}=t,b=VQ(t,["label","classNames","styles","className","onRemove","disabled","readOnly","size","radius","variant","unstyled"]);const{classes:y,cx:x}=BQ({disabled:c,readOnly:f,radius:h},{name:"MultiSelect",classNames:r,styles:o,unstyled:v,size:p,variant:m});return H.createElement("div",WQ({className:x(y.defaultValue,s)},b),H.createElement("span",{className:y.defaultValueLabel},n),!c&&!f&&H.createElement(qI,{"aria-hidden":!0,onMouseDown:i,size:UQ[p],radius:2,color:"blue",variant:"transparent",iconSize:"70%",className:y.defaultValueRemove,tabIndex:-1,unstyled:v}))}pE.displayName="@mantine/core/MultiSelect/DefaultValue";function GQ({data:e,searchable:t,limit:n,searchValue:r,filter:o,value:s,disableSelectedItemFiltering:i}){if(!t&&s.length===0)return e;if(!t){const f=[];for(let p=0;p<e.length;p+=1)(i||!s.some(h=>h===e[p].value&&!e[p].disabled))&&f.push(e[p]);return f}const c=[];for(let f=0;f<e.length&&(o(r,!i&&s.some(p=>p===e[f].value&&!e[f].disabled),e[f])&&c.push(e[f]),!(c.length>=n));f+=1);return c}var qQ=Object.defineProperty,bm=Object.getOwnPropertySymbols,hE=Object.prototype.hasOwnProperty,mE=Object.prototype.propertyIsEnumerable,Sk=(e,t,n)=>t in e?qQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,kk=(e,t)=>{for(var n in t||(t={}))hE.call(t,n)&&Sk(e,n,t[n]);if(bm)for(var n of bm(t))mE.call(t,n)&&Sk(e,n,t[n]);return e},KQ=(e,t)=>{var n={};for(var r in e)hE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&bm)for(var r of bm(e))t.indexOf(r)<0&&mE.call(e,r)&&(n[r]=e[r]);return n};const XQ={xs:Ge(14),sm:Ge(18),md:Ge(20),lg:Ge(24),xl:Ge(28)};function QQ(e){var t=e,{size:n,error:r,style:o}=t,s=KQ(t,["size","error","style"]);const i=pi(),c=Gt({size:n,sizes:XQ});return H.createElement("svg",kk({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:kk({color:r?i.colors.red[6]:i.colors.gray[6],width:c,height:c},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 YQ=Object.defineProperty,JQ=Object.defineProperties,ZQ=Object.getOwnPropertyDescriptors,jk=Object.getOwnPropertySymbols,eY=Object.prototype.hasOwnProperty,tY=Object.prototype.propertyIsEnumerable,_k=(e,t,n)=>t in e?YQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nY=(e,t)=>{for(var n in t||(t={}))eY.call(t,n)&&_k(e,n,t[n]);if(jk)for(var n of jk(t))tY.call(t,n)&&_k(e,n,t[n]);return e},rY=(e,t)=>JQ(e,ZQ(t));function gE({shouldClear:e,clearButtonProps:t,onClear:n,size:r,error:o}){return e?H.createElement(qI,rY(nY({},t),{variant:"transparent",onClick:n,size:r,onMouseDown:s=>s.preventDefault()})):H.createElement(QQ,{error:o,size:r})}gE.displayName="@mantine/core/SelectRightSection";var oY=Object.defineProperty,sY=Object.defineProperties,aY=Object.getOwnPropertyDescriptors,xm=Object.getOwnPropertySymbols,vE=Object.prototype.hasOwnProperty,bE=Object.prototype.propertyIsEnumerable,Pk=(e,t,n)=>t in e?oY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Hv=(e,t)=>{for(var n in t||(t={}))vE.call(t,n)&&Pk(e,n,t[n]);if(xm)for(var n of xm(t))bE.call(t,n)&&Pk(e,n,t[n]);return e},Ik=(e,t)=>sY(e,aY(t)),iY=(e,t)=>{var n={};for(var r in e)vE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&xm)for(var r of xm(e))t.indexOf(r)<0&&bE.call(e,r)&&(n[r]=e[r]);return n};function xE(e){var t=e,{styles:n,rightSection:r,rightSectionWidth:o,theme:s}=t,i=iY(t,["styles","rightSection","rightSectionWidth","theme"]);if(r)return{rightSection:r,rightSectionWidth:o,styles:n};const c=typeof n=="function"?n(s):n;return{rightSection:!i.readOnly&&!(i.disabled&&i.shouldClear)&&H.createElement(gE,Hv({},i)),styles:Ik(Hv({},c),{rightSection:Ik(Hv({},c==null?void 0:c.rightSection),{pointerEvents:i.shouldClear?void 0:"none"})})}}var lY=Object.defineProperty,cY=Object.defineProperties,uY=Object.getOwnPropertyDescriptors,Ek=Object.getOwnPropertySymbols,dY=Object.prototype.hasOwnProperty,fY=Object.prototype.propertyIsEnumerable,Ok=(e,t,n)=>t in e?lY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pY=(e,t)=>{for(var n in t||(t={}))dY.call(t,n)&&Ok(e,n,t[n]);if(Ek)for(var n of Ek(t))fY.call(t,n)&&Ok(e,n,t[n]);return e},hY=(e,t)=>cY(e,uY(t)),mY=fo((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(${Gt({size:n,sizes:ls})} - ${Ge(2)})`,display:"flex",alignItems:"center",flexWrap:"wrap",marginLeft:`calc(-${e.spacing.xs} / 2)`,boxSizing:"border-box","&[data-clearable]":{marginRight:Gt({size:n,sizes:ls})}},value:{margin:`calc(${e.spacing.xs} / 2 - ${Ge(2)}) calc(${e.spacing.xs} / 2)`},searchInput:hY(pY({},e.fn.fontStyles()),{flex:1,minWidth:Ge(60),backgroundColor:"transparent",border:0,outline:0,fontSize:Gt({size:n,sizes:e.fontSizes}),padding:0,marginLeft:`calc(${e.spacing.xs} / 2)`,appearance:"none",color:"inherit",maxHeight:Gt({size:n,sizes:uE}),"&::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 gY=mY;var vY=Object.defineProperty,bY=Object.defineProperties,xY=Object.getOwnPropertyDescriptors,ym=Object.getOwnPropertySymbols,yE=Object.prototype.hasOwnProperty,wE=Object.prototype.propertyIsEnumerable,Mk=(e,t,n)=>t in e?vY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Cc=(e,t)=>{for(var n in t||(t={}))yE.call(t,n)&&Mk(e,n,t[n]);if(ym)for(var n of ym(t))wE.call(t,n)&&Mk(e,n,t[n]);return e},Rk=(e,t)=>bY(e,xY(t)),yY=(e,t)=>{var n={};for(var r in e)yE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ym)for(var r of ym(e))t.indexOf(r)<0&&wE.call(e,r)&&(n[r]=e[r]);return n};function wY(e,t,n){return t?!1:n.label.toLowerCase().trim().includes(e.toLowerCase().trim())}function CY(e,t){return!!e&&!t.some(n=>n.value.toLowerCase()===e.toLowerCase())}function Dk(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 SY={size:"sm",valueComponent:pE,itemComponent:py,transitionProps:{transition:"fade",duration:0},maxDropdownHeight:220,shadow:"sm",searchable:!1,filter:wY,limit:1/0,clearSearchOnChange:!0,clearable:!1,clearSearchOnBlur:!1,disabled:!1,initiallyOpened:!1,creatable:!1,shouldCreate:CY,switchDirectionOnFlip:!1,zIndex:cy("popover"),selectOnBlur:!1,positionDependencies:[],dropdownPosition:"flip"},CE=u.forwardRef((e,t)=>{const n=_r("MultiSelect",SY,e),{className:r,style:o,required:s,label:i,description:c,size:f,error:p,classNames:h,styles:m,wrapperProps:v,value:b,defaultValue:y,data:x,onChange:C,valueComponent:k,itemComponent:j,id:_,transitionProps:I,maxDropdownHeight:O,shadow:E,nothingFound:M,onFocus:R,onBlur:A,searchable:D,placeholder:T,filter:K,limit:B,clearSearchOnChange:G,clearable:Q,clearSearchOnBlur:V,variant:L,onSearchChange:X,searchValue:F,disabled:q,initiallyOpened:te,radius:Y,icon:ce,rightSection:ae,rightSectionWidth:U,creatable:W,getCreateLabel:ne,shouldCreate:ie,onCreate:oe,sx:me,dropdownComponent:fe,onDropdownClose:he,onDropdownOpen:Ce,maxSelectedValues:xe,withinPortal:de,portalProps:Ne,switchDirectionOnFlip:De,zIndex:Xe,selectOnBlur:It,name:lt,dropdownPosition:on,errorProps:gt,labelProps:bt,descriptionProps:ye,form:We,positionDependencies:Et,onKeyDown:zt,unstyled:we,inputContainer:xt,inputWrapperOrder:Nt,readOnly:Lt,withAsterisk:$e,clearButtonProps:Ke,hoverOnSearchChange:vn,disableSelectedItemFiltering:_e}=n,Ze=yY(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:Qe,cx:ct,theme:Ft}=gY({invalid:!!p},{name:"MultiSelect",classNames:h,styles:m,unstyled:we,size:f,variant:L}),{systemStyles:ir,rest:pn}=wg(Ze),ln=u.useRef(),Ur=u.useRef({}),wr=dy(_),[Hn,Wn]=u.useState(te),[Vn,Lr]=u.useState(-1),[Lo,Gr]=u.useState("column"),[qr,js]=Ud({value:F,defaultValue:"",finalValue:void 0,onChange:X}),[Fr,na]=u.useState(!1),{scrollIntoView:_s,targetRef:Ta,scrollableRef:ra}=gI({duration:0,offset:5,cancelable:!1,isList:!0}),J=W&&typeof ne=="function";let ee=null;const ge=x.map(Be=>typeof Be=="string"?{label:Be,value:Be}:Be),je=sI({data:ge}),[ve,dt]=Ud({value:Dk(b,x),defaultValue:Dk(y,x),finalValue:[],onChange:C}),st=u.useRef(!!xe&&xe<ve.length),Vt=Be=>{if(!Lt){const vt=ve.filter(Dt=>Dt!==Be);dt(vt),xe&&vt.length<xe&&(st.current=!1)}},ft=Be=>{js(Be.currentTarget.value),!q&&!st.current&&D&&Wn(!0)},yt=Be=>{typeof R=="function"&&R(Be),!q&&!st.current&&D&&Wn(!0)},He=GQ({data:je,searchable:D,searchValue:qr,limit:B,filter:K,value:ve,disableSelectedItemFiltering:_e});J&&ie(qr,je)&&(ee=ne(qr),He.push({label:qr,value:qr,creatable:!0}));const Se=Math.min(Vn,He.length-1),et=(Be,vt,Dt)=>{let Ut=Be;for(;Dt(Ut);)if(Ut=vt(Ut),!He[Ut].disabled)return Ut;return Be};Hs(()=>{Lr(vn&&qr?0:-1)},[qr,vn]),Hs(()=>{!q&&ve.length>x.length&&Wn(!1),xe&&ve.length<xe&&(st.current=!1),xe&&ve.length>=xe&&(st.current=!0,Wn(!1))},[ve]);const kt=Be=>{if(!Lt)if(G&&js(""),ve.includes(Be.value))Vt(Be.value);else{if(Be.creatable&&typeof oe=="function"){const vt=oe(Be.value);typeof vt<"u"&&vt!==null&&dt(typeof vt=="string"?[...ve,vt]:[...ve,vt.value])}else dt([...ve,Be.value]);ve.length===xe-1&&(st.current=!0,Wn(!1)),He.length===1&&Wn(!1)}},Ot=Be=>{typeof A=="function"&&A(Be),It&&He[Se]&&Hn&&kt(He[Se]),V&&js(""),Wn(!1)},$t=Be=>{if(Fr||(zt==null||zt(Be),Lt)||Be.key!=="Backspace"&&xe&&st.current)return;const vt=Lo==="column",Dt=()=>{Lr(In=>{var Kt;const un=et(In,sn=>sn+1,sn=>sn<He.length-1);return Hn&&(Ta.current=Ur.current[(Kt=He[un])==null?void 0:Kt.value],_s({alignment:vt?"end":"start"})),un})},Ut=()=>{Lr(In=>{var Kt;const un=et(In,sn=>sn-1,sn=>sn>0);return Hn&&(Ta.current=Ur.current[(Kt=He[un])==null?void 0:Kt.value],_s({alignment:vt?"start":"end"})),un})};switch(Be.key){case"ArrowUp":{Be.preventDefault(),Wn(!0),vt?Ut():Dt();break}case"ArrowDown":{Be.preventDefault(),Wn(!0),vt?Dt():Ut();break}case"Enter":{Be.preventDefault(),He[Se]&&Hn?kt(He[Se]):Wn(!0);break}case" ":{D||(Be.preventDefault(),He[Se]&&Hn?kt(He[Se]):Wn(!0));break}case"Backspace":{ve.length>0&&qr.length===0&&(dt(ve.slice(0,-1)),Wn(!0),xe&&(st.current=!1));break}case"Home":{if(!D){Be.preventDefault(),Hn||Wn(!0);const In=He.findIndex(Kt=>!Kt.disabled);Lr(In),_s({alignment:vt?"end":"start"})}break}case"End":{if(!D){Be.preventDefault(),Hn||Wn(!0);const In=He.map(Kt=>!!Kt.disabled).lastIndexOf(!1);Lr(In),_s({alignment:vt?"end":"start"})}break}case"Escape":Wn(!1)}},Xt=ve.map(Be=>{let vt=je.find(Dt=>Dt.value===Be&&!Dt.disabled);return!vt&&J&&(vt={value:Be,label:Be}),vt}).filter(Be=>!!Be).map((Be,vt)=>H.createElement(k,Rk(Cc({},Be),{variant:L,disabled:q,className:Qe.value,readOnly:Lt,onRemove:Dt=>{Dt.preventDefault(),Dt.stopPropagation(),Vt(Be.value)},key:Be.value,size:f,styles:m,classNames:h,radius:Y,index:vt}))),tn=Be=>ve.includes(Be),en=()=>{var Be;js(""),dt([]),(Be=ln.current)==null||Be.focus(),xe&&(st.current=!1)},qt=!Lt&&(He.length>0?Hn:Hn&&!!M);return Hs(()=>{const Be=qt?Ce:he;typeof Be=="function"&&Be()},[qt]),H.createElement(vu.Wrapper,Cc(Cc({required:s,id:wr,label:i,error:p,description:c,size:f,className:r,style:o,classNames:h,styles:m,__staticSelector:"MultiSelect",sx:me,errorProps:gt,descriptionProps:ye,labelProps:bt,inputContainer:xt,inputWrapperOrder:Nt,unstyled:we,withAsterisk:$e,variant:L},ir),v),H.createElement(zi,{opened:qt,transitionProps:I,shadow:"sm",withinPortal:de,portalProps:Ne,__staticSelector:"MultiSelect",onDirectionChange:Gr,switchDirectionOnFlip:De,zIndex:Xe,dropdownPosition:on,positionDependencies:[...Et,qr],classNames:h,styles:m,unstyled:we,variant:L},H.createElement(zi.Target,null,H.createElement("div",{className:Qe.wrapper,role:"combobox","aria-haspopup":"listbox","aria-owns":Hn&&qt?`${wr}-items`:null,"aria-controls":wr,"aria-expanded":Hn,onMouseLeave:()=>Lr(-1),tabIndex:-1},H.createElement("input",{type:"hidden",name:lt,value:ve.join(","),form:We,disabled:q}),H.createElement(vu,Cc({__staticSelector:"MultiSelect",style:{overflow:"hidden"},component:"div",multiline:!0,size:f,variant:L,disabled:q,error:p,required:s,radius:Y,icon:ce,unstyled:we,onMouseDown:Be=>{var vt;Be.preventDefault(),!q&&!st.current&&Wn(!Hn),(vt=ln.current)==null||vt.focus()},classNames:Rk(Cc({},h),{input:ct({[Qe.input]:!D},h==null?void 0:h.input)})},xE({theme:Ft,rightSection:ae,rightSectionWidth:U,styles:m,size:f,shouldClear:Q&&ve.length>0,onClear:en,error:p,disabled:q,clearButtonProps:Ke,readOnly:Lt})),H.createElement("div",{className:Qe.values,"data-clearable":Q||void 0},Xt,H.createElement("input",Cc({ref:_f(t,ln),type:"search",id:wr,className:ct(Qe.searchInput,{[Qe.searchInputPointer]:!D,[Qe.searchInputInputHidden]:!Hn&&ve.length>0||!D&&ve.length>0,[Qe.searchInputEmpty]:ve.length===0}),onKeyDown:$t,value:qr,onChange:ft,onFocus:yt,onBlur:Ot,readOnly:!D||st.current||Lt,placeholder:ve.length===0?T:void 0,disabled:q,"data-mantine-stop-propagation":Hn,autoComplete:"off",onCompositionStart:()=>na(!0),onCompositionEnd:()=>na(!1)},pn)))))),H.createElement(zi.Dropdown,{component:fe||jg,maxHeight:O,direction:Lo,id:wr,innerRef:ra,__staticSelector:"MultiSelect",classNames:h,styles:m},H.createElement(fy,{data:He,hovered:Se,classNames:h,styles:m,uuid:wr,__staticSelector:"MultiSelect",onItemHover:Lr,onItemSelect:kt,itemsRefs:Ur,itemComponent:j,size:f,nothingFound:M,isItemSelected:tn,creatable:W&&!!ee,createLabel:ee,unstyled:we,variant:L}))))});CE.displayName="@mantine/core/MultiSelect";var kY=Object.defineProperty,jY=Object.defineProperties,_Y=Object.getOwnPropertyDescriptors,wm=Object.getOwnPropertySymbols,SE=Object.prototype.hasOwnProperty,kE=Object.prototype.propertyIsEnumerable,Ak=(e,t,n)=>t in e?kY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Wv=(e,t)=>{for(var n in t||(t={}))SE.call(t,n)&&Ak(e,n,t[n]);if(wm)for(var n of wm(t))kE.call(t,n)&&Ak(e,n,t[n]);return e},PY=(e,t)=>jY(e,_Y(t)),IY=(e,t)=>{var n={};for(var r in e)SE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&wm)for(var r of wm(e))t.indexOf(r)<0&&kE.call(e,r)&&(n[r]=e[r]);return n};const EY={type:"text",size:"sm",__staticSelector:"TextInput"},jE=u.forwardRef((e,t)=>{const n=U6("TextInput",EY,e),{inputProps:r,wrapperProps:o}=n,s=IY(n,["inputProps","wrapperProps"]);return H.createElement(vu.Wrapper,Wv({},o),H.createElement(vu,PY(Wv(Wv({},r),s),{ref:t})))});jE.displayName="@mantine/core/TextInput";function OY({data:e,searchable:t,limit:n,searchValue:r,filter:o,value:s,filterDataOnExactSearchMatch:i}){if(!t)return e;const c=s!=null&&e.find(p=>p.value===s)||null;if(c&&!i&&(c==null?void 0:c.label)===r){if(n){if(n>=e.length)return e;const p=e.indexOf(c),h=p+n,m=h-e.length;return m>0?e.slice(p-m):e.slice(p,h)}return e}const f=[];for(let p=0;p<e.length&&(o(r,e[p])&&f.push(e[p]),!(f.length>=n));p+=1);return f}var MY=fo(()=>({input:{"&:not(:disabled)":{cursor:"pointer","&::selection":{backgroundColor:"transparent"}}}}));const RY=MY;var DY=Object.defineProperty,AY=Object.defineProperties,NY=Object.getOwnPropertyDescriptors,Cm=Object.getOwnPropertySymbols,_E=Object.prototype.hasOwnProperty,PE=Object.prototype.propertyIsEnumerable,Nk=(e,t,n)=>t in e?DY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ud=(e,t)=>{for(var n in t||(t={}))_E.call(t,n)&&Nk(e,n,t[n]);if(Cm)for(var n of Cm(t))PE.call(t,n)&&Nk(e,n,t[n]);return e},Vv=(e,t)=>AY(e,NY(t)),TY=(e,t)=>{var n={};for(var r in e)_E.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Cm)for(var r of Cm(e))t.indexOf(r)<0&&PE.call(e,r)&&(n[r]=e[r]);return n};function $Y(e,t){return t.label.toLowerCase().trim().includes(e.toLowerCase().trim())}function LY(e,t){return!!e&&!t.some(n=>n.label.toLowerCase()===e.toLowerCase())}const FY={required:!1,size:"sm",shadow:"sm",itemComponent:py,transitionProps:{transition:"fade",duration:0},initiallyOpened:!1,filter:$Y,maxDropdownHeight:220,searchable:!1,clearable:!1,limit:1/0,disabled:!1,creatable:!1,shouldCreate:LY,selectOnBlur:!1,switchDirectionOnFlip:!1,filterDataOnExactSearchMatch:!1,zIndex:cy("popover"),positionDependencies:[],dropdownPosition:"flip"},Sy=u.forwardRef((e,t)=>{const n=U6("Select",FY,e),{inputProps:r,wrapperProps:o,shadow:s,data:i,value:c,defaultValue:f,onChange:p,itemComponent:h,onKeyDown:m,onBlur:v,onFocus:b,transitionProps:y,initiallyOpened:x,unstyled:C,classNames:k,styles:j,filter:_,maxDropdownHeight:I,searchable:O,clearable:E,nothingFound:M,limit:R,disabled:A,onSearchChange:D,searchValue:T,rightSection:K,rightSectionWidth:B,creatable:G,getCreateLabel:Q,shouldCreate:V,selectOnBlur:L,onCreate:X,dropdownComponent:F,onDropdownClose:q,onDropdownOpen:te,withinPortal:Y,portalProps:ce,switchDirectionOnFlip:ae,zIndex:U,name:W,dropdownPosition:ne,allowDeselect:ie,placeholder:oe,filterDataOnExactSearchMatch:me,form:fe,positionDependencies:he,readOnly:Ce,clearButtonProps:xe,hoverOnSearchChange:de}=n,Ne=TY(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:De,cx:Xe,theme:It}=RY(),[lt,on]=u.useState(x),[gt,bt]=u.useState(-1),ye=u.useRef(),We=u.useRef({}),[Et,zt]=u.useState("column"),we=Et==="column",{scrollIntoView:xt,targetRef:Nt,scrollableRef:Lt}=gI({duration:0,offset:5,cancelable:!1,isList:!0}),$e=ie===void 0?E:ie,Ke=ee=>{if(lt!==ee){on(ee);const ge=ee?te:q;typeof ge=="function"&&ge()}},vn=G&&typeof Q=="function";let _e=null;const Ze=i.map(ee=>typeof ee=="string"?{label:ee,value:ee}:ee),Qe=sI({data:Ze}),[ct,Ft,ir]=Ud({value:c,defaultValue:f,finalValue:null,onChange:p}),pn=Qe.find(ee=>ee.value===ct),[ln,Ur]=Ud({value:T,defaultValue:(pn==null?void 0:pn.label)||"",finalValue:void 0,onChange:D}),wr=ee=>{Ur(ee),O&&typeof D=="function"&&D(ee)},Hn=()=>{var ee;Ce||(Ft(null),ir||wr(""),(ee=ye.current)==null||ee.focus())};u.useEffect(()=>{const ee=Qe.find(ge=>ge.value===ct);ee?wr(ee.label):(!vn||!ct)&&wr("")},[ct]),u.useEffect(()=>{pn&&(!O||!lt)&&wr(pn.label)},[pn==null?void 0:pn.label]);const Wn=ee=>{if(!Ce)if($e&&(pn==null?void 0:pn.value)===ee.value)Ft(null),Ke(!1);else{if(ee.creatable&&typeof X=="function"){const ge=X(ee.value);typeof ge<"u"&&ge!==null&&Ft(typeof ge=="string"?ge:ge.value)}else Ft(ee.value);ir||wr(ee.label),bt(-1),Ke(!1),ye.current.focus()}},Vn=OY({data:Qe,searchable:O,limit:R,searchValue:ln,filter:_,filterDataOnExactSearchMatch:me,value:ct});vn&&V(ln,Vn)&&(_e=Q(ln),Vn.push({label:ln,value:ln,creatable:!0}));const Lr=(ee,ge,je)=>{let ve=ee;for(;je(ve);)if(ve=ge(ve),!Vn[ve].disabled)return ve;return ee};Hs(()=>{bt(de&&ln?0:-1)},[ln,de]);const Lo=ct?Vn.findIndex(ee=>ee.value===ct):0,Gr=!Ce&&(Vn.length>0?lt:lt&&!!M),qr=()=>{bt(ee=>{var ge;const je=Lr(ee,ve=>ve-1,ve=>ve>0);return Nt.current=We.current[(ge=Vn[je])==null?void 0:ge.value],Gr&&xt({alignment:we?"start":"end"}),je})},js=()=>{bt(ee=>{var ge;const je=Lr(ee,ve=>ve+1,ve=>ve<Vn.length-1);return Nt.current=We.current[(ge=Vn[je])==null?void 0:ge.value],Gr&&xt({alignment:we?"end":"start"}),je})},Fr=()=>window.setTimeout(()=>{var ee;Nt.current=We.current[(ee=Vn[Lo])==null?void 0:ee.value],xt({alignment:we?"end":"start"})},50);Hs(()=>{Gr&&Fr()},[Gr]);const na=ee=>{switch(typeof m=="function"&&m(ee),ee.key){case"ArrowUp":{ee.preventDefault(),lt?we?qr():js():(bt(Lo),Ke(!0),Fr());break}case"ArrowDown":{ee.preventDefault(),lt?we?js():qr():(bt(Lo),Ke(!0),Fr());break}case"Home":{if(!O){ee.preventDefault(),lt||Ke(!0);const ge=Vn.findIndex(je=>!je.disabled);bt(ge),Gr&&xt({alignment:we?"end":"start"})}break}case"End":{if(!O){ee.preventDefault(),lt||Ke(!0);const ge=Vn.map(je=>!!je.disabled).lastIndexOf(!1);bt(ge),Gr&&xt({alignment:we?"end":"start"})}break}case"Escape":{ee.preventDefault(),Ke(!1),bt(-1);break}case" ":{O||(ee.preventDefault(),Vn[gt]&&lt?Wn(Vn[gt]):(Ke(!0),bt(Lo),Fr()));break}case"Enter":O||ee.preventDefault(),Vn[gt]&&lt&&(ee.preventDefault(),Wn(Vn[gt]))}},_s=ee=>{typeof v=="function"&&v(ee);const ge=Qe.find(je=>je.value===ct);L&&Vn[gt]&&lt&&Wn(Vn[gt]),wr((ge==null?void 0:ge.label)||""),Ke(!1)},Ta=ee=>{typeof b=="function"&&b(ee),O&&Ke(!0)},ra=ee=>{Ce||(wr(ee.currentTarget.value),E&&ee.currentTarget.value===""&&Ft(null),bt(-1),Ke(!0))},J=()=>{Ce||(Ke(!lt),ct&&!lt&&bt(Lo))};return H.createElement(vu.Wrapper,Vv(ud({},o),{__staticSelector:"Select"}),H.createElement(zi,{opened:Gr,transitionProps:y,shadow:s,withinPortal:Y,portalProps:ce,__staticSelector:"Select",onDirectionChange:zt,switchDirectionOnFlip:ae,zIndex:U,dropdownPosition:ne,positionDependencies:[...he,ln],classNames:k,styles:j,unstyled:C,variant:r.variant},H.createElement(zi.Target,null,H.createElement("div",{role:"combobox","aria-haspopup":"listbox","aria-owns":Gr?`${r.id}-items`:null,"aria-controls":r.id,"aria-expanded":Gr,onMouseLeave:()=>bt(-1),tabIndex:-1},H.createElement("input",{type:"hidden",name:W,value:ct||"",form:fe,disabled:A}),H.createElement(vu,ud(Vv(ud(ud({autoComplete:"off",type:"search"},r),Ne),{ref:_f(t,ye),onKeyDown:na,__staticSelector:"Select",value:ln,placeholder:oe,onChange:ra,"aria-autocomplete":"list","aria-controls":Gr?`${r.id}-items`:null,"aria-activedescendant":gt>=0?`${r.id}-${gt}`:null,onMouseDown:J,onBlur:_s,onFocus:Ta,readOnly:!O||Ce,disabled:A,"data-mantine-stop-propagation":Gr,name:null,classNames:Vv(ud({},k),{input:Xe({[De.input]:!O},k==null?void 0:k.input)})}),xE({theme:It,rightSection:K,rightSectionWidth:B,styles:j,size:r.size,shouldClear:E&&!!pn,onClear:Hn,error:o.error,clearButtonProps:xe,disabled:A,readOnly:Ce}))))),H.createElement(zi.Dropdown,{component:F||jg,maxHeight:I,direction:Et,id:r.id,innerRef:Lt,__staticSelector:"Select",classNames:k,styles:j},H.createElement(fy,{data:Vn,hovered:gt,classNames:k,styles:j,isItemSelected:ee=>ee===ct,uuid:r.id,__staticSelector:"Select",onItemHover:bt,onItemSelect:Wn,itemsRefs:We,itemComponent:h,size:r.size,nothingFound:M,creatable:vn&&!!_e,createLabel:_e,"aria-label":o.label,unstyled:C,variant:r.variant}))))});Sy.displayName="@mantine/core/Select";const Ef=()=>{const[e,t,n,r,o,s,i,c,f,p,h,m,v,b,y,x,C,k,j,_,I,O,E,M,R,A,D,T,K,B,G,Q,V,L,X,F,q,te,Y,ce,ae,U,W,ne,ie,oe,me,fe,he,Ce,xe,de,Ne,De,Xe,It,lt,on,gt,bt,ye,We,Et,zt,we,xt,Nt,Lt,$e,Ke,vn,_e,Ze,Qe,ct,Ft]=xa("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:c,base450:f,base500:p,base550:h,base600:m,base650:v,base700:b,base750:y,base800:x,base850:C,base900:k,base950:j,accent50:_,accent100:I,accent150:O,accent200:E,accent250:M,accent300:R,accent350:A,accent400:D,accent450:T,accent500:K,accent550:B,accent600:G,accent650:Q,accent700:V,accent750:L,accent800:X,accent850:F,accent900:q,accent950:te,baseAlpha50:Y,baseAlpha100:ce,baseAlpha150:ae,baseAlpha200:U,baseAlpha250:W,baseAlpha300:ne,baseAlpha350:ie,baseAlpha400:oe,baseAlpha450:me,baseAlpha500:fe,baseAlpha550:he,baseAlpha600:Ce,baseAlpha650:xe,baseAlpha700:de,baseAlpha750:Ne,baseAlpha800:De,baseAlpha850:Xe,baseAlpha900:It,baseAlpha950:lt,accentAlpha50:on,accentAlpha100:gt,accentAlpha150:bt,accentAlpha200:ye,accentAlpha250:We,accentAlpha300:Et,accentAlpha350:zt,accentAlpha400:we,accentAlpha450:xt,accentAlpha500:Nt,accentAlpha550:Lt,accentAlpha600:$e,accentAlpha650:Ke,accentAlpha700:vn,accentAlpha750:_e,accentAlpha800:Ze,accentAlpha850:Qe,accentAlpha900:ct,accentAlpha950:Ft}},qe=(e,t)=>n=>n==="light"?e:t,IE=()=>{const{base50:e,base100:t,base200:n,base300:r,base400:o,base500:s,base600:i,base700:c,base800:f,base900:p,accent200:h,accent300:m,accent400:v,accent500:b,accent600:y}=Ef(),{colorMode:x}=di(),[C]=xa("shadows",["dark-lg"]),[k,j,_]=xa("space",[1,2,6]),[I]=xa("radii",["base"]),[O]=xa("lineHeights",["base"]);return u.useCallback(()=>({label:{color:qe(c,r)(x)},separatorLabel:{color:qe(s,s)(x),"::after":{borderTopColor:qe(r,c)(x)}},input:{border:"unset",backgroundColor:qe(e,p)(x),borderRadius:I,borderStyle:"solid",borderWidth:"2px",borderColor:qe(n,f)(x),color:qe(p,t)(x),minHeight:"unset",lineHeight:O,height:"auto",paddingRight:0,paddingLeft:0,paddingInlineStart:j,paddingInlineEnd:_,paddingTop:k,paddingBottom:k,fontWeight:600,"&:hover":{borderColor:qe(r,i)(x)},"&:focus":{borderColor:qe(m,y)(x)},"&:is(:focus, :hover)":{borderColor:qe(o,s)(x)},"&:focus-within":{borderColor:qe(h,y)(x)},"&[data-disabled]":{backgroundColor:qe(r,c)(x),color:qe(i,o)(x),cursor:"not-allowed"}},value:{backgroundColor:qe(t,p)(x),color:qe(p,t)(x),button:{color:qe(p,t)(x)},"&:hover":{backgroundColor:qe(r,c)(x),cursor:"pointer"}},dropdown:{backgroundColor:qe(n,f)(x),borderColor:qe(n,f)(x),boxShadow:C},item:{backgroundColor:qe(n,f)(x),color:qe(f,n)(x),padding:6,"&[data-hovered]":{color:qe(p,t)(x),backgroundColor:qe(r,c)(x)},"&[data-active]":{backgroundColor:qe(r,c)(x),"&:hover":{color:qe(p,t)(x),backgroundColor:qe(r,c)(x)}},"&[data-selected]":{backgroundColor:qe(v,y)(x),color:qe(e,t)(x),fontWeight:600,"&:hover":{backgroundColor:qe(b,b)(x),color:qe("white",e)(x)}},"&[data-disabled]":{color:qe(s,i)(x),cursor:"not-allowed"}},rightSection:{width:32,button:{color:qe(p,t)(x)}}}),[h,m,v,b,y,t,n,r,o,e,s,i,c,f,p,C,x,O,I,k,j,_])},zY=e=>{const{searchable:t=!0,tooltip:n,inputRef:r,onChange:o,label:s,disabled:i,...c}=e,f=se(),[p,h]=u.useState(""),m=u.useCallback(x=>{x.shiftKey&&f(Do(!0))},[f]),v=u.useCallback(x=>{x.shiftKey||f(Do(!1))},[f]),b=u.useCallback(x=>{o&&o(x)},[o]),y=IE();return a.jsx(Mn,{label:n,placement:"top",hasArrow:!0,children:a.jsx(Sy,{ref:r,label:s?a.jsx(pr,{isDisabled:i,children:a.jsx(Jr,{children:s})}):void 0,disabled:i,searchValue:p,onSearchChange:h,onChange:b,onKeyDown:m,onKeyUp:v,searchable:t,maxDropdownHeight:300,styles:y,...c})})},Kn=u.memo(zY),BY=le([ke],({changeBoardModal:e})=>{const{isModalOpen:t,imagesToChange:n}=e;return{isModalOpen:t,imagesToChange:n}},Oe),HY=()=>{const e=se(),[t,n]=u.useState(),{data:r,isFetching:o}=Fm(),{imagesToChange:s,isModalOpen:i}=z(BY),[c]=z7(),[f]=B7(),p=u.useMemo(()=>{const b=[{label:"Uncategorized",value:"none"}];return(r??[]).forEach(y=>b.push({label:y.board_name,value:y.board_id})),b},[r]),h=u.useCallback(()=>{e(Yw()),e(tx(!1))},[e]),m=u.useCallback(()=>{!s.length||!t||(t==="none"?f({imageDTOs:s}):c({imageDTOs:s,board_id:t}),n(null),e(Yw()))},[c,e,s,f,t]),v=u.useRef(null);return a.jsx(Cf,{isOpen:i,onClose:h,leastDestructiveRef:v,isCentered:!0,children:a.jsx(Ks,{children:a.jsxs(Sf,{children:[a.jsx(qs,{fontSize:"lg",fontWeight:"bold",children:"Change Board"}),a.jsx(Xs,{children:a.jsxs($,{sx:{flexDir:"column",gap:4},children:[a.jsxs(Ee,{children:["Moving ",`${s.length}`," image",`${s.length>1?"s":""}`," to board:"]}),a.jsx(Kn,{placeholder:o?"Loading...":"Select Board",disabled:o,onChange:b=>n(b),value:t,data:p})]})}),a.jsxs(ka,{children:[a.jsx(Wt,{ref:v,onClick:h,children:"Cancel"}),a.jsx(Wt,{colorScheme:"accent",onClick:m,ml:3,children:"Move"})]})]})})})},WY=u.memo(HY),VY=e=>{const{label:t,isDisabled:n=!1,width:r="auto",formControlProps:o,formLabelProps:s,tooltip:i,helperText:c,...f}=e;return a.jsx(Mn,{label:i,hasArrow:!0,placement:"top",isDisabled:!i,children:a.jsx(pr,{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(Jr,{my:1,flexGrow:1,sx:{cursor:n?"not-allowed":"pointer",...s==null?void 0:s.sx,pe:4},...s,children:t}),a.jsx(sy,{...f})]}),c&&a.jsx(z3,{children:a.jsx(Ee,{variant:"subtext",children:c})})]})})})},qn=u.memo(VY),UY=e=>{const{imageUsage:t,topMessage:n="This image is currently in use in the following features:",bottomMessage:r="If you delete this image, those features will immediately be reset."}=e;return!t||!$s(t)?null:a.jsxs(a.Fragment,{children:[a.jsx(Ee,{children:n}),a.jsxs(gf,{sx:{paddingInlineStart:6},children:[t.isInitialImage&&a.jsx(Fs,{children:"Image to Image"}),t.isCanvasImage&&a.jsx(Fs,{children:"Unified Canvas"}),t.isControlNetImage&&a.jsx(Fs,{children:"ControlNet"}),t.isNodesImage&&a.jsx(Fs,{children:"Node Editor"})]}),a.jsx(Ee,{children:r})]})},EE=u.memo(UY),GY=le([ke,H7],(e,t)=>{const{system:n,config:r,deleteImageModal:o}=e,{shouldConfirmOnDelete:s}=n,{canRestoreDeletedImagesFromBin:i}=r,{imagesToDelete:c,isModalOpen:f}=o,p=(c??[]).map(({image_name:m})=>W_(e,m)),h={isInitialImage:$s(p,m=>m.isInitialImage),isCanvasImage:$s(p,m=>m.isCanvasImage),isNodesImage:$s(p,m=>m.isNodesImage),isControlNetImage:$s(p,m=>m.isControlNetImage)};return{shouldConfirmOnDelete:s,canRestoreDeletedImagesFromBin:i,imagesToDelete:c,imagesUsage:t,isModalOpen:f,imageUsageSummary:h}},Oe),qY=()=>{const e=se(),{t}=Ie(),{shouldConfirmOnDelete:n,canRestoreDeletedImagesFromBin:r,imagesToDelete:o,imagesUsage:s,isModalOpen:i,imageUsageSummary:c}=z(GY),f=u.useCallback(v=>e(V_(!v.target.checked)),[e]),p=u.useCallback(()=>{e(Jw()),e(W7(!1))},[e]),h=u.useCallback(()=>{!o.length||!s.length||(e(Jw()),e(V7({imageDTOs:o,imagesUsage:s})))},[e,o,s]),m=u.useRef(null);return a.jsx(Cf,{isOpen:i,onClose:p,leastDestructiveRef:m,isCentered:!0,children:a.jsx(Ks,{children:a.jsxs(Sf,{children:[a.jsx(qs,{fontSize:"lg",fontWeight:"bold",children:t("gallery.deleteImage")}),a.jsx(Xs,{children:a.jsxs($,{direction:"column",gap:3,children:[a.jsx(EE,{imageUsage:c}),a.jsx(Ko,{}),a.jsx(Ee,{children:t(r?"gallery.deleteImageBin":"gallery.deleteImagePermanent")}),a.jsx(Ee,{children:t("common.areYouSure")}),a.jsx(qn,{label:t("common.dontAskMeAgain"),isChecked:!n,onChange:f})]})}),a.jsxs(ka,{children:[a.jsx(Wt,{ref:m,onClick:p,children:"Cancel"}),a.jsx(Wt,{colorScheme:"error",onClick:h,ml:3,children:"Delete"})]})]})})})},KY=u.memo(qY),OE=Te((e,t)=>{const{role:n,tooltip:r="",tooltipProps:o,isChecked:s,...i}=e;return a.jsx(Mn,{label:r,hasArrow:!0,...o,...o!=null&&o.placement?{placement:o.placement}:{placement:"top"},children:a.jsx(wa,{ref:t,role:n,colorScheme:s?"accent":"base",...i})})});OE.displayName="IAIIconButton";const tt=u.memo(OE);var ME={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Tk=H.createContext&&H.createContext(ME),Bi=globalThis&&globalThis.__assign||function(){return Bi=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},Bi.apply(this,arguments)},XY=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 RE(e){return e&&e.map(function(t,n){return H.createElement(t.tag,Bi({key:n},t.attr),RE(t.child))})}function Je(e){return function(t){return H.createElement(QY,Bi({attr:Bi({},e.attr)},t),RE(e.child))}}function QY(e){var t=function(n){var r=e.attr,o=e.size,s=e.title,i=XY(e,["attr","size","title"]),c=o||n.size||"1em",f;return n.className&&(f=n.className),e.className&&(f=(f?f+" ":"")+e.className),H.createElement("svg",Bi({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,i,{className:f,style:Bi(Bi({color:e.color||n.color},n.style),e.style),height:c,width:c,xmlns:"http://www.w3.org/2000/svg"}),s&&H.createElement("title",null,s),e.children)};return Tk!==void 0?H.createElement(Tk.Consumer,null,function(n){return t(n)}):t(ME)}function YY(e){return Je({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 JY(e){return Je({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 ZY(e){return Je({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 eJ(e){return Je({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 tJ(e){return Je({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 nJ(e){return Je({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 rJ(e){return Je({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 oJ(e){return Je({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 DE(e){return Je({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 sJ(e){return Je({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 aJ(e){return Je({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 AE(e){return Je({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 iJ(e){return Je({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 NE(e){return Je({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 TE(e){return Je({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 Du(e){return Je({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 lJ(e){return Je({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 cJ(e){return Je({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M239.1 6.3l-208 78c-18.7 7-31.1 25-31.1 45v225.1c0 18.2 10.3 34.8 26.5 42.9l208 104c13.5 6.8 29.4 6.8 42.9 0l208-104c16.3-8.1 26.5-24.8 26.5-42.9V129.3c0-20-12.4-37.9-31.1-44.9l-208-78C262 2.2 250 2.2 239.1 6.3zM256 68.4l192 72v1.1l-192 78-192-78v-1.1l192-72zm32 356V275.5l160-65v133.9l-160 80z"}}]})(e)}function Ig(e){return Je({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 uJ(e){return Je({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 dJ(e){return Je({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 fJ(e){return Je({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 pJ(e){return Je({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 hJ(e){return Je({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 mJ(e){return Je({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 $E(e){return Je({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 gJ(e){return Je({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 vJ(e){return Je({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M320 400c-75.85 0-137.25-58.71-142.9-133.11L72.2 185.82c-13.79 17.3-26.48 35.59-36.72 55.59a32.35 32.35 0 0 0 0 29.19C89.71 376.41 197.07 448 320 448c26.91 0 52.87-4 77.89-10.46L346 397.39a144.13 144.13 0 0 1-26 2.61zm313.82 58.1l-110.55-85.44a331.25 331.25 0 0 0 81.25-102.07 32.35 32.35 0 0 0 0-29.19C550.29 135.59 442.93 64 320 64a308.15 308.15 0 0 0-147.32 37.7L45.46 3.37A16 16 0 0 0 23 6.18L3.37 31.45A16 16 0 0 0 6.18 53.9l588.36 454.73a16 16 0 0 0 22.46-2.81l19.64-25.27a16 16 0 0 0-2.82-22.45zm-183.72-142l-39.3-30.38A94.75 94.75 0 0 0 416 256a94.76 94.76 0 0 0-121.31-92.21A47.65 47.65 0 0 1 304 192a46.64 46.64 0 0 1-1.54 10l-73.61-56.89A142.31 142.31 0 0 1 320 112a143.92 143.92 0 0 1 144 144c0 21.63-5.29 41.79-13.9 60.11z"}}]})(e)}function bJ(e){return Je({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 xJ(e){return Je({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 LE(e){return Je({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 yJ(e){return Je({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M432 416h-23.41L277.88 53.69A32 32 0 0 0 247.58 32h-47.16a32 32 0 0 0-30.3 21.69L39.41 416H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16h-19.58l23.3-64h152.56l23.3 64H304a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zM176.85 272L224 142.51 271.15 272z"}}]})(e)}function wJ(e){return Je({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 Fl(e){return Je({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 CJ(e){return Je({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 FE(e){return Je({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 SJ(e){return Je({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M528 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h480c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM128 180v-40c0-6.627-5.373-12-12-12H76c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm-336 96v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm-336 96v-40c0-6.627-5.373-12-12-12H76c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12zm288 0v-40c0-6.627-5.373-12-12-12H172c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h232c6.627 0 12-5.373 12-12zm96 0v-40c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12z"}}]})(e)}function kJ(e){return Je({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 zE(e){return Je({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 BE(e){return Je({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 jJ(e){return Je({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 HE(e){return Je({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 _J(e){return Je({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 PJ(e){return Je({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 $k(e){return Je({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 Yl(e){return Je({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 WE(e){return Je({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 IJ(e){return Je({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 EJ(e){return Je({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 OJ(e){return Je({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 Eg(e){return Je({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 MJ(e){return Je({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 VE(e){return Je({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 RJ(e){return Je({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 DJ(e){return Je({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 Lk(e){return Je({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 UE(e){return Je({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 AJ(e){return Je({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 GE(e){return Je({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 NJ(e){return Je({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 Jo(e){return Je({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 Og(e){return Je({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 Mg(e){return Je({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 TJ(e){return Je({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 qE(e){return Je({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 Yn=e=>{const t=z(i=>i.config.disabledTabs),n=z(i=>i.config.disabledFeatures),r=z(i=>i.config.disabledSDFeatures),o=u.useMemo(()=>n.includes(e)||r.includes(e)||t.includes(e),[n,r,t,e]),s=u.useMemo(()=>!(n.includes(e)||r.includes(e)||t.includes(e)),[n,r,t,e]);return{isFeatureDisabled:o,isFeatureEnabled:s}};function $J(e){const{title:t,hotkey:n,description:r}=e;return a.jsxs(Vi,{sx:{gridTemplateColumns:"auto max-content",justifyContent:"space-between",alignItems:"center"},children:[a.jsxs(Vi,{children:[a.jsx(Ee,{fontWeight:600,children:t}),r&&a.jsx(Ee,{sx:{fontSize:"sm"},variant:"subtext",children:r})]}),a.jsx(Fe,{sx:{fontSize:"sm",fontWeight:600,px:2,py:1},children:n})]})}function LJ({children:e}){const{isOpen:t,onOpen:n,onClose:r}=Ao(),{t:o}=Ie(),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"}],c=[{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"}],f=[{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($J,{title:v.title,description:v.desc,hotkey:v.hotkey}),b<m.length-1&&a.jsx(Ko,{})]},b))});return a.jsxs(a.Fragment,{children:[u.cloneElement(e,{onClick:n}),a.jsxs(Tl,{isOpen:t,onClose:r,children:[a.jsx(Ks,{}),a.jsxs($l,{children:[a.jsx(qs,{children:o("hotkeys.keyboardShortcuts")}),a.jsx(kf,{}),a.jsx(Xs,{children:a.jsx(L3,{allowMultiple:!0,children:a.jsxs($,{flexDir:"column",gap:2,children:[a.jsxs(_c,{children:[a.jsx(kc,{children:a.jsxs($,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.appHotkeys")}),a.jsx(jc,{})]})}),a.jsx(Pc,{children:h(s)})]}),a.jsxs(_c,{children:[a.jsx(kc,{children:a.jsxs($,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.generalHotkeys")}),a.jsx(jc,{})]})}),a.jsx(Pc,{children:h(i)})]}),a.jsxs(_c,{children:[a.jsx(kc,{children:a.jsxs($,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.galleryHotkeys")}),a.jsx(jc,{})]})}),a.jsx(Pc,{children:h(c)})]}),a.jsxs(_c,{children:[a.jsx(kc,{children:a.jsxs($,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.unifiedCanvasHotkeys")}),a.jsx(jc,{})]})}),a.jsx(Pc,{children:h(f)})]}),a.jsxs(_c,{children:[a.jsx(kc,{children:a.jsxs($,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.nodesHotkeys")}),a.jsx(jc,{})]})}),a.jsx(Pc,{children:h(p)})]})]})})}),a.jsx(ka,{})]})]})]})}function Fk(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.addEventListener&&e.addEventListener.apply(e,t)}function zk(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.removeEventListener&&e.removeEventListener.apply(e,t)}var FJ=function(e,t){return typeof t=="boolean"?t:!e},zJ=function(e){return u.useReducer(FJ,e)};const BJ=zJ;function HJ(e,t){t===void 0&&(t=0);var n=u.useRef(!1),r=u.useRef(),o=u.useRef(e),s=u.useCallback(function(){return n.current},[]),i=u.useCallback(function(){n.current=!1,r.current&&clearTimeout(r.current),r.current=setTimeout(function(){n.current=!0,o.current()},t)},[t]),c=u.useCallback(function(){n.current=null,r.current&&clearTimeout(r.current)},[]);return u.useEffect(function(){o.current=e},[e]),u.useEffect(function(){return i(),c},[t]),[s,c,i]}function WJ(e,t,n){t===void 0&&(t=0),n===void 0&&(n=[]);var r=HJ(e,t),o=r[0],s=r[1],i=r[2];return u.useEffect(i,n),[o,s]}var VJ=function(e,t){t===void 0&&(t=!0);var n=u.useState(!1),r=n[0],o=n[1];return u.useEffect(function(){var s=function(){return o(!0)},i=function(){return o(!1)};t&&e&&e.current&&(Fk(e.current,"mouseover",s),Fk(e.current,"mouseout",i));var c=e.current;return function(){t&&c&&(zk(c,"mouseover",s),zk(c,"mouseout",i))}},[t,e]),r};const KE=VJ,UJ=({showVersion:e=!0})=>{const{data:t}=U7(),n=u.useRef(null),r=KE(n);return a.jsxs($,{alignItems:"center",gap:5,ps:1,ref:n,children:[a.jsx(Vl,{src:U_,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(Ee,{sx:{fontSize:"xl",userSelect:"none"},children:["invoke ",a.jsx("strong",{children:"ai"})]}),a.jsx(co,{children:e&&r&&t&&a.jsx(yr.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.15}},exit:{opacity:0,transition:{delay:.8}},children:a.jsx(Ee,{sx:{fontWeight:600,marginTop:1,color:"base.300",fontSize:14},variant:"subtext",children:t.version})},"statusText")})]})]})},GJ=u.memo(UJ),qJ=e=>{const{tooltip:t,inputRef:n,label:r,disabled:o,required:s,...i}=e,c=IE();return a.jsx(Mn,{label:t,placement:"top",hasArrow:!0,children:a.jsx(Sy,{label:r?a.jsx(pr,{isRequired:s,isDisabled:o,children:a.jsx(Jr,{children:r})}):void 0,disabled:o,ref:n,styles:c,...i})})},Zr=u.memo(qJ),KJ={ar:Sr.t("common.langArabic",{lng:"ar"}),nl:Sr.t("common.langDutch",{lng:"nl"}),en:Sr.t("common.langEnglish",{lng:"en"}),fr:Sr.t("common.langFrench",{lng:"fr"}),de:Sr.t("common.langGerman",{lng:"de"}),he:Sr.t("common.langHebrew",{lng:"he"}),it:Sr.t("common.langItalian",{lng:"it"}),ja:Sr.t("common.langJapanese",{lng:"ja"}),ko:Sr.t("common.langKorean",{lng:"ko"}),pl:Sr.t("common.langPolish",{lng:"pl"}),pt_BR:Sr.t("common.langBrPortuguese",{lng:"pt_BR"}),pt:Sr.t("common.langPortuguese",{lng:"pt"}),ru:Sr.t("common.langRussian",{lng:"ru"}),zh_CN:Sr.t("common.langSimplifiedChinese",{lng:"zh_CN"}),es:Sr.t("common.langSpanish",{lng:"es"}),uk:Sr.t("common.langUkranian",{lng:"ua"})};function Rs(e){const{t}=Ie(),{label:n,textProps:r,useBadge:o=!1,badgeLabel:s=t("settings.experimental"),badgeProps:i,...c}=e;return a.jsxs($,{justifyContent:"space-between",py:1,children:[a.jsxs($,{gap:2,alignItems:"center",children:[a.jsx(Ee,{sx:{fontSize:14,_dark:{color:"base.300"}},...r,children:n}),o&&a.jsx(hi,{size:"xs",sx:{px:2,color:"base.700",bg:"accent.200",_dark:{bg:"accent.500",color:"base.200"}},...i,children:s})]}),a.jsx(qn,{...c})]})}const XJ=e=>a.jsx($,{sx:{flexDirection:"column",gap:2,p:4,borderRadius:"base",bg:"base.100",_dark:{bg:"base.900"}},children:e.children}),Ec=u.memo(XJ);function QJ(){const e=se(),{data:t,refetch:n}=G7(),[r,{isLoading:o}]=q7(),s=u.useCallback(()=>{r().unwrap().then(c=>{e(K7()),e(G_()),e(Cn({title:`Cleared ${c} intermediates`,status:"info"}))})},[r,e]);u.useEffect(()=>{n()},[n]);const i=t?`Clear ${t} Intermediate${t>1?"s":""}`:"No Intermediates to Clear";return a.jsxs(Ec,{children:[a.jsx(ds,{size:"sm",children:"Clear Intermediates"}),a.jsx(Wt,{colorScheme:"warning",onClick:s,isLoading:o,isDisabled:!t,children:i}),a.jsx(Ee,{fontWeight:"bold",children:"Clearing intermediates will reset your Canvas and ControlNet state."}),a.jsx(Ee,{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(Ee,{variant:"subtext",children:"Your gallery images will not be deleted."})]})}const YJ=()=>{const{base50:e,base100:t,base200:n,base300:r,base400:o,base500:s,base600:i,base700:c,base800:f,base900:p,accent200:h,accent300:m,accent400:v,accent500:b,accent600:y}=Ef(),{colorMode:x}=di(),[C]=xa("shadows",["dark-lg"]);return u.useCallback(()=>({label:{color:qe(c,r)(x)},separatorLabel:{color:qe(s,s)(x),"::after":{borderTopColor:qe(r,c)(x)}},searchInput:{":placeholder":{color:qe(r,c)(x)}},input:{backgroundColor:qe(e,p)(x),borderWidth:"2px",borderColor:qe(n,f)(x),color:qe(p,t)(x),paddingRight:24,fontWeight:600,"&:hover":{borderColor:qe(r,i)(x)},"&:focus":{borderColor:qe(m,y)(x)},"&:is(:focus, :hover)":{borderColor:qe(o,s)(x)},"&:focus-within":{borderColor:qe(h,y)(x)},"&[data-disabled]":{backgroundColor:qe(r,c)(x),color:qe(i,o)(x),cursor:"not-allowed"}},value:{backgroundColor:qe(n,f)(x),color:qe(p,t)(x),button:{color:qe(p,t)(x)},"&:hover":{backgroundColor:qe(r,c)(x),cursor:"pointer"}},dropdown:{backgroundColor:qe(n,f)(x),borderColor:qe(n,f)(x),boxShadow:C},item:{backgroundColor:qe(n,f)(x),color:qe(f,n)(x),padding:6,"&[data-hovered]":{color:qe(p,t)(x),backgroundColor:qe(r,c)(x)},"&[data-active]":{backgroundColor:qe(r,c)(x),"&:hover":{color:qe(p,t)(x),backgroundColor:qe(r,c)(x)}},"&[data-selected]":{backgroundColor:qe(v,y)(x),color:qe(e,t)(x),fontWeight:600,"&:hover":{backgroundColor:qe(b,b)(x),color:qe("white",e)(x)}},"&[data-disabled]":{color:qe(s,i)(x),cursor:"not-allowed"}},rightSection:{width:24,padding:20,button:{color:qe(p,t)(x)}}}),[h,m,v,b,y,t,n,r,o,e,s,i,c,f,p,C,x])},JJ=e=>{const{searchable:t=!0,tooltip:n,inputRef:r,label:o,disabled:s,...i}=e,c=se(),f=u.useCallback(m=>{m.shiftKey&&c(Do(!0))},[c]),p=u.useCallback(m=>{m.shiftKey||c(Do(!1))},[c]),h=YJ();return a.jsx(Mn,{label:n,placement:"top",hasArrow:!0,isOpen:!0,children:a.jsx(CE,{label:o?a.jsx(pr,{isDisabled:s,children:a.jsx(Jr,{children:o})}):void 0,ref:r,disabled:s,onKeyDown:f,onKeyUp:p,searchable:t,maxDropdownHeight:300,styles:h,...i})})},ZJ=u.memo(JJ),eZ=uo(zm,(e,t)=>({value:t,label:e})).sort((e,t)=>e.label.localeCompare(t.label));function tZ(){const e=se(),{t}=Ie(),n=z(o=>o.ui.favoriteSchedulers),r=u.useCallback(o=>{e(X7(o))},[e]);return a.jsx(ZJ,{label:t("settings.favoriteSchedulers"),value:n,data:eZ,onChange:r,clearable:!0,searchable:!0,maxSelectedValues:99,placeholder:t("settings.favoriteSchedulersPlaceholder")})}const nZ=le([ke],({system:e,ui:t,generation:n})=>{const{shouldConfirmOnDelete:r,enableImageDebugging:o,consoleLogLevel:s,shouldLogToConsole:i,shouldAntialiasProgressImage:c,shouldUseNSFWChecker:f,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:c,shouldShowAdvancedOptions:b,shouldUseNSFWChecker:f,shouldUseWatermarker:p,shouldAutoChangeDimensions:v}},{memoizeOptions:{resultEqualityCheck:mn}}),rZ=({children:e,config:t})=>{const n=se(),{t:r}=Ie(),[o,s]=u.useState(3),i=(t==null?void 0:t.shouldShowDeveloperSettings)??!0,c=(t==null?void 0:t.shouldShowResetWebUiText)??!0,f=(t==null?void 0:t.shouldShowAdvancedOptionsSettings)??!0,p=(t==null?void 0:t.shouldShowClearIntermediates)??!0,h=(t==null?void 0:t.shouldShowLocalizationToggle)??!0;u.useEffect(()=>{i||n(Zw(!1))},[i,n]);const{isNSFWCheckerAvailable:m,isWatermarkerAvailable:v}=q_(void 0,{selectFromResult:({data:Y})=>({isNSFWCheckerAvailable:(Y==null?void 0:Y.nsfw_methods.includes("nsfw_checker"))??!1,isWatermarkerAvailable:(Y==null?void 0:Y.watermarking_methods.includes("invisible_watermark"))??!1})}),{isOpen:b,onOpen:y,onClose:x}=Ao(),{isOpen:C,onOpen:k,onClose:j}=Ao(),{shouldConfirmOnDelete:_,enableImageDebugging:I,shouldUseSliders:O,shouldShowProgressInViewer:E,consoleLogLevel:M,shouldLogToConsole:R,shouldAntialiasProgressImage:A,shouldShowAdvancedOptions:D,shouldUseNSFWChecker:T,shouldUseWatermarker:K,shouldAutoChangeDimensions:B}=z(nZ),G=u.useCallback(()=>{Object.keys(window.localStorage).forEach(Y=>{(Q7.includes(Y)||Y.startsWith(Y7))&&localStorage.removeItem(Y)}),x(),k(),setInterval(()=>s(Y=>Y-1),1e3)},[x,k]);u.useEffect(()=>{o<=0&&window.location.reload()},[o]);const Q=u.useCallback(Y=>{n(J7(Y))},[n]),V=u.useCallback(Y=>{n(Z7(Y))},[n]),L=u.useCallback(Y=>{n(Zw(Y.target.checked))},[n]),{colorMode:X,toggleColorMode:F}=di(),q=Yn("localization").isFeatureEnabled,te=z(BP);return a.jsxs(a.Fragment,{children:[u.cloneElement(e,{onClick:y}),a.jsxs(Tl,{isOpen:b,onClose:x,size:"2xl",isCentered:!0,children:[a.jsx(Ks,{}),a.jsxs($l,{children:[a.jsx(qs,{bg:"none",children:r("common.settingsLabel")}),a.jsx(kf,{}),a.jsx(Xs,{children:a.jsxs($,{sx:{gap:4,flexDirection:"column"},children:[a.jsxs(Ec,{children:[a.jsx(ds,{size:"sm",children:r("settings.general")}),a.jsx(Rs,{label:r("settings.confirmOnDelete"),isChecked:_,onChange:Y=>n(V_(Y.target.checked))}),f&&a.jsx(Rs,{label:r("settings.showAdvancedOptions"),isChecked:D,onChange:Y=>n(eR(Y.target.checked))})]}),a.jsxs(Ec,{children:[a.jsx(ds,{size:"sm",children:r("settings.generation")}),a.jsx(tZ,{}),a.jsx(Rs,{label:"Enable NSFW Checker",isDisabled:!m,isChecked:T,onChange:Y=>n(tR(Y.target.checked))}),a.jsx(Rs,{label:"Enable Invisible Watermark",isDisabled:!v,isChecked:K,onChange:Y=>n(nR(Y.target.checked))})]}),a.jsxs(Ec,{children:[a.jsx(ds,{size:"sm",children:r("settings.ui")}),a.jsx(Rs,{label:r("common.darkMode"),isChecked:X==="dark",onChange:F}),a.jsx(Rs,{label:r("settings.useSlidersForAll"),isChecked:O,onChange:Y=>n(rR(Y.target.checked))}),a.jsx(Rs,{label:r("settings.showProgressInViewer"),isChecked:E,onChange:Y=>n(K_(Y.target.checked))}),a.jsx(Rs,{label:r("settings.antialiasProgressImages"),isChecked:A,onChange:Y=>n(oR(Y.target.checked))}),a.jsx(Rs,{label:r("settings.autoChangeDimensions"),isChecked:B,onChange:Y=>n(sR(Y.target.checked))}),h&&a.jsx(Zr,{disabled:!q,label:r("common.languagePickerLabel"),value:te,data:Object.entries(KJ).map(([Y,ce])=>({value:Y,label:ce})),onChange:V})]}),i&&a.jsxs(Ec,{children:[a.jsx(ds,{size:"sm",children:r("settings.developer")}),a.jsx(Rs,{label:r("settings.shouldLogToConsole"),isChecked:R,onChange:L}),a.jsx(Zr,{disabled:!R,label:r("settings.consoleLogLevel"),onChange:Q,value:M,data:aR.concat()}),a.jsx(Rs,{label:r("settings.enableImageDebugging"),isChecked:I,onChange:Y=>n(iR(Y.target.checked))})]}),p&&a.jsx(QJ,{}),a.jsxs(Ec,{children:[a.jsx(ds,{size:"sm",children:r("settings.resetWebUI")}),a.jsx(Wt,{colorScheme:"error",onClick:G,children:r("settings.resetWebUI")}),c&&a.jsxs(a.Fragment,{children:[a.jsx(Ee,{variant:"subtext",children:r("settings.resetWebUIDesc1")}),a.jsx(Ee,{variant:"subtext",children:r("settings.resetWebUIDesc2")})]})]})]})}),a.jsx(ka,{children:a.jsx(Wt,{onClick:x,children:r("common.close")})})]})]}),a.jsxs(Tl,{closeOnOverlayClick:!1,isOpen:C,onClose:j,isCentered:!0,closeOnEsc:!1,children:[a.jsx(Ks,{backdropFilter:"blur(40px)"}),a.jsxs($l,{children:[a.jsx(qs,{}),a.jsx(Xs,{children:a.jsx($,{justifyContent:"center",children:a.jsx(Ee,{fontSize:"lg",children:a.jsxs(Ee,{children:[r("settings.resetComplete")," Reloading in ",o,"..."]})})})}),a.jsx(ka,{})]})]})]})},oZ=u.memo(rZ),sZ=le(Cs,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}},Oe),Bk={ok:"green.400",working:"yellow.400",error:"red.400"},Hk={ok:"green.600",working:"yellow.500",error:"red.500"},aZ=()=>{const{isConnected:e,isProcessing:t,currentIteration:n,totalIterations:r,statusTranslationKey:o}=z(sZ),{t:s}=Ie(),i=u.useRef(null),c=u.useMemo(()=>t?"working":e?"ok":"error",[t,e]),f=u.useMemo(()=>{if(n&&r)return` (${n}/${r})`},[n,r]),p=KE(i);return a.jsxs($,{ref:i,h:"full",px:2,alignItems:"center",gap:5,children:[a.jsx(co,{children:p&&a.jsx(yr.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.15}},exit:{opacity:0,transition:{delay:.8}},children:a.jsxs(Ee,{sx:{fontSize:"sm",fontWeight:"600",pb:"1px",userSelect:"none",color:Hk[c],_dark:{color:Bk[c]}},children:[s(o),f]})},"statusText")}),a.jsx(Tr,{as:iJ,sx:{boxSize:"0.5rem",color:Hk[c],_dark:{color:Bk[c]}}})]})},iZ=u.memo(aZ),lZ=()=>{const{t:e}=Ie(),t=Yn("bugLink").isFeatureEnabled,n=Yn("discordLink").isFeatureEnabled,r=Yn("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(GJ,{}),a.jsx(Qi,{}),a.jsx(iZ,{}),a.jsxs(yf,{children:[a.jsx(wf,{as:tt,variant:"link","aria-label":e("accessibility.menu"),icon:a.jsx(sJ,{}),sx:{boxSize:8}}),a.jsxs(Ui,{motionProps:au,children:[a.jsxs(fu,{title:e("common.communityLabel"),children:[r&&a.jsx(Bn,{as:"a",href:o,target:"_blank",icon:a.jsx(JY,{}),children:e("common.githubLabel")}),t&&a.jsx(Bn,{as:"a",href:`${o}/issues`,target:"_blank",icon:a.jsx(aJ,{}),children:e("common.reportBugLabel")}),n&&a.jsx(Bn,{as:"a",href:s,target:"_blank",icon:a.jsx(YY,{}),children:e("common.discordLabel")})]}),a.jsxs(fu,{title:e("common.settingsLabel"),children:[a.jsx(LJ,{children:a.jsx(Bn,{as:"button",icon:a.jsx(SJ,{}),children:e("common.hotkeysLabel")})}),a.jsx(oZ,{children:a.jsx(Bn,{as:"button",icon:a.jsx(TE,{}),children:e("common.settingsLabel")})})]})]})]})]})},cZ=u.memo(lZ),uZ=le(Cs,e=>{const{isUploading:t}=e;let n="";return t&&(n="Uploading..."),{tooltip:n,shouldShow:t}}),dZ=()=>{const{shouldShow:e,tooltip:t}=z(uZ);return e?a.jsx($,{sx:{alignItems:"center",justifyContent:"center",color:"base.600"},children:a.jsx(Mn,{label:t,placement:"right",hasArrow:!0,children:a.jsx(Wl,{})})}):null},fZ=u.memo(dZ);/*!
* OverlayScrollbars
* Version: 2.2.1
*
* Copyright (c) Rene Haas | KingSora.
* https://github.com/KingSora
*
* Released under the MIT license.
*/function Pn(e,t){if(Dg(e))for(let n=0;n<e.length&&t(e[n],n,e)!==!1;n++);else e&&Pn(Object.keys(e),n=>t(e[n],n,e));return e}function io(e,t){const n=el(t);if(Js(t)||n){let o=n?"":{};if(e){const s=window.getComputedStyle(e,null);o=n?Gk(e,s,t):t.reduce((i,c)=>(i[c]=Gk(e,s,c),i),o)}return o}e&&Pn(Qo(t),o=>IZ(e,o,t[o]))}const Ns=(e,t)=>{const{o:n,u:r,_:o}=e;let s=n,i;const c=(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=>c(t(s,i),h):c,h=>[s,!!h,i]]},Of=()=>typeof window<"u",XE=Of()&&Node.ELEMENT_NODE,{toString:pZ,hasOwnProperty:Uv}=Object.prototype,gi=e=>e===void 0,Rg=e=>e===null,hZ=e=>gi(e)||Rg(e)?`${e}`:pZ.call(e).replace(/^\[object (.+)\]$/,"$1").toLowerCase(),Hi=e=>typeof e=="number",el=e=>typeof e=="string",ky=e=>typeof e=="boolean",Ys=e=>typeof e=="function",Js=e=>Array.isArray(e),qd=e=>typeof e=="object"&&!Js(e)&&!Rg(e),Dg=e=>{const t=!!e&&e.length,n=Hi(t)&&t>-1&&t%1==0;return Js(e)||!Ys(e)&&n?t>0&&qd(e)?t-1 in e:!0:!1},yb=e=>{if(!e||!qd(e)||hZ(e)!=="object")return!1;let t;const n="constructor",r=e[n],o=r&&r.prototype,s=Uv.call(e,n),i=o&&Uv.call(o,"isPrototypeOf");if(r&&!s&&!i)return!1;for(t in e);return gi(t)||Uv.call(e,t)},Sm=e=>{const t=HTMLElement;return e?t?e instanceof t:e.nodeType===XE:!1},Ag=e=>{const t=Element;return e?t?e instanceof t:e.nodeType===XE:!1},jy=(e,t,n)=>e.indexOf(t,n),Nn=(e,t,n)=>(!n&&!el(t)&&Dg(t)?Array.prototype.push.apply(e,t):e.push(t),e),zl=e=>{const t=Array.from,n=[];return t&&e?t(e):(e instanceof Set?e.forEach(r=>{Nn(n,r)}):Pn(e,r=>{Nn(n,r)}),n)},_y=e=>!!e&&e.length===0,Aa=(e,t,n)=>{Pn(e,o=>o&&o.apply(void 0,t||[])),!n&&(e.length=0)},Ng=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Qo=e=>e?Object.keys(e):[],fr=(e,t,n,r,o,s,i)=>{const c=[t,n,r,o,s,i];return(typeof e!="object"||Rg(e))&&!Ys(e)&&(e={}),Pn(c,f=>{Pn(Qo(f),p=>{const h=f[p];if(e===h)return!0;const m=Js(h);if(h&&(yb(h)||m)){const v=e[p];let b=v;m&&!Js(v)?b=[]:!m&&!yb(v)&&(b={}),e[p]=fr(b,h)}else e[p]=h})}),e},Py=e=>{for(const t in e)return!1;return!0},QE=(e,t,n,r)=>{if(gi(r))return n?n[e]:t;n&&(el(r)||Hi(r))&&(n[e]=r)},ao=(e,t,n)=>{if(gi(n))return e?e.getAttribute(t):null;e&&e.setAttribute(t,n)},_o=(e,t)=>{e&&e.removeAttribute(t)},kl=(e,t,n,r)=>{if(n){const o=ao(e,t)||"",s=new Set(o.split(" "));s[r?"add":"delete"](n);const i=zl(s).join(" ").trim();ao(e,t,i)}},mZ=(e,t,n)=>{const r=ao(e,t)||"";return new Set(r.split(" ")).has(n)},Vs=(e,t)=>QE("scrollLeft",0,e,t),ti=(e,t)=>QE("scrollTop",0,e,t),wb=Of()&&Element.prototype,YE=(e,t)=>{const n=[],r=t?Ag(t)?t:null:document;return r?Nn(n,r.querySelectorAll(e)):n},gZ=(e,t)=>{const n=t?Ag(t)?t:null:document;return n?n.querySelector(e):null},km=(e,t)=>Ag(e)?(wb.matches||wb.msMatchesSelector).call(e,t):!1,Iy=e=>e?zl(e.childNodes):[],ai=e=>e?e.parentElement:null,Tc=(e,t)=>{if(Ag(e)){const n=wb.closest;if(n)return n.call(e,t);do{if(km(e,t))return e;e=ai(e)}while(e)}return null},vZ=(e,t,n)=>{const r=e&&Tc(e,t),o=e&&gZ(n,r),s=Tc(o,t)===r;return r&&o?r===e||o===e||s&&Tc(Tc(e,n),t)!==r:!1},Ey=(e,t,n)=>{if(n&&e){let r=t,o;Dg(n)?(o=document.createDocumentFragment(),Pn(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)}},ms=(e,t)=>{Ey(e,null,t)},bZ=(e,t)=>{Ey(ai(e),e,t)},Wk=(e,t)=>{Ey(ai(e),e&&e.nextSibling,t)},_a=e=>{if(Dg(e))Pn(zl(e),t=>_a(t));else if(e){const t=ai(e);t&&t.removeChild(e)}},jl=e=>{const t=document.createElement("div");return e&&ao(t,"class",e),t},JE=e=>{const t=jl();return t.innerHTML=e.trim(),Pn(Iy(t),n=>_a(n))},Cb=e=>e.charAt(0).toUpperCase()+e.slice(1),xZ=()=>jl().style,yZ=["-webkit-","-moz-","-o-","-ms-"],wZ=["WebKit","Moz","O","MS","webkit","moz","o","ms"],Gv={},qv={},CZ=e=>{let t=qv[e];if(Ng(qv,e))return t;const n=Cb(e),r=xZ();return Pn(yZ,o=>{const s=o.replace(/-/g,"");return!(t=[e,o+e,s+n,Cb(s)+n].find(c=>r[c]!==void 0))}),qv[e]=t||""},Mf=e=>{if(Of()){let t=Gv[e]||window[e];return Ng(Gv,e)||(Pn(wZ,n=>(t=t||window[n+Cb(e)],!t)),Gv[e]=t),t}},SZ=Mf("MutationObserver"),Vk=Mf("IntersectionObserver"),$c=Mf("ResizeObserver"),ZE=Mf("cancelAnimationFrame"),eO=Mf("requestAnimationFrame"),jm=Of()&&window.setTimeout,Sb=Of()&&window.clearTimeout,kZ=/[^\x20\t\r\n\f]+/g,tO=(e,t,n)=>{const r=e&&e.classList;let o,s=0,i=!1;if(r&&t&&el(t)){const c=t.match(kZ)||[];for(i=c.length>0;o=c[s++];)i=!!n(r,o)&&i}return i},Oy=(e,t)=>{tO(e,t,(n,r)=>n.remove(r))},ni=(e,t)=>(tO(e,t,(n,r)=>n.add(r)),Oy.bind(0,e,t)),Tg=(e,t,n,r)=>{if(e&&t){let o=!0;return Pn(n,s=>{const i=r?r(e[s]):e[s],c=r?r(t[s]):t[s];i!==c&&(o=!1)}),o}return!1},nO=(e,t)=>Tg(e,t,["w","h"]),rO=(e,t)=>Tg(e,t,["x","y"]),jZ=(e,t)=>Tg(e,t,["t","r","b","l"]),Uk=(e,t,n)=>Tg(e,t,["width","height"],n&&(r=>Math.round(r))),ps=()=>{},Oc=e=>{let t;const n=e?jm:eO,r=e?Sb:ZE;return[o=>{r(t),t=n(o,Ys(e)?e():e)},()=>r(t)]},My=(e,t)=>{let n,r,o,s=ps;const{v:i,g:c,p:f}=t||{},p=function(y){s(),Sb(n),n=r=void 0,s=ps,e.apply(this,y)},h=b=>f&&r?f(r,b):b,m=()=>{s!==ps&&p(h(o)||o)},v=function(){const y=zl(arguments),x=Ys(i)?i():i;if(Hi(x)&&x>=0){const k=Ys(c)?c():c,j=Hi(k)&&k>=0,_=x>0?jm:eO,I=x>0?Sb:ZE,E=h(y)||y,M=p.bind(0,E);s();const R=_(M,x);s=()=>I(R),j&&!n&&(n=jm(m,k)),r=o=E}else p(y)};return v.m=m,v},_Z={opacity:1,zindex:1},Vp=(e,t)=>{const n=t?parseFloat(e):parseInt(e,10);return n===n?n:0},PZ=(e,t)=>!_Z[e.toLowerCase()]&&Hi(t)?`${t}px`:t,Gk=(e,t,n)=>t!=null?t[n]||t.getPropertyValue(n):e.style[n],IZ=(e,t,n)=>{try{const{style:r}=e;gi(r[t])?r.setProperty(t,n):r[t]=PZ(t,n)}catch{}},Kd=e=>io(e,"direction")==="rtl",qk=(e,t,n)=>{const r=t?`${t}-`:"",o=n?`-${n}`:"",s=`${r}top${o}`,i=`${r}right${o}`,c=`${r}bottom${o}`,f=`${r}left${o}`,p=io(e,[s,i,c,f]);return{t:Vp(p[s],!0),r:Vp(p[i],!0),b:Vp(p[c],!0),l:Vp(p[f],!0)}},{round:Kk}=Math,Ry={w:0,h:0},Xd=e=>e?{w:e.offsetWidth,h:e.offsetHeight}:Ry,hh=e=>e?{w:e.clientWidth,h:e.clientHeight}:Ry,_m=e=>e?{w:e.scrollWidth,h:e.scrollHeight}:Ry,Pm=e=>{const t=parseFloat(io(e,"height"))||0,n=parseFloat(io(e,"width"))||0;return{w:n-Kk(n),h:t-Kk(t)}},ya=e=>e.getBoundingClientRect();let Up;const EZ=()=>{if(gi(Up)){Up=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get(){Up=!0}}))}catch{}}return Up},oO=e=>e.split(" "),OZ=(e,t,n,r)=>{Pn(oO(t),o=>{e.removeEventListener(o,n,r)})},$r=(e,t,n,r)=>{var o;const s=EZ(),i=(o=s&&r&&r.S)!=null?o:s,c=r&&r.$||!1,f=r&&r.C||!1,p=[],h=s?{passive:i,capture:c}:c;return Pn(oO(t),m=>{const v=f?b=>{e.removeEventListener(m,v,c),n&&n(b)}:n;Nn(p,OZ.bind(null,e,m,v,c)),e.addEventListener(m,v,h)}),Aa.bind(0,p)},sO=e=>e.stopPropagation(),aO=e=>e.preventDefault(),MZ={x:0,y:0},Kv=e=>{const t=e?ya(e):0;return t?{x:t.left+window.pageYOffset,y:t.top+window.pageXOffset}:MZ},Xk=(e,t)=>{Pn(Js(t)?t:[t],e)},Dy=e=>{const t=new Map,n=(s,i)=>{if(s){const c=t.get(s);Xk(f=>{c&&c[f?"delete":"clear"](f)},i)}else t.forEach(c=>{c.clear()}),t.clear()},r=(s,i)=>{if(el(s)){const p=t.get(s)||new Set;return t.set(s,p),Xk(h=>{Ys(h)&&p.add(h)},i),n.bind(0,s,i)}ky(i)&&i&&n();const c=Qo(s),f=[];return Pn(c,p=>{const h=s[p];h&&Nn(f,r(p,h))}),Aa.bind(0,f)},o=(s,i)=>{const c=t.get(s);Pn(zl(c),f=>{i&&!_y(i)?f.apply(0,i):f()})};return r(e||{}),[r,n,o]},Qk=e=>JSON.stringify(e,(t,n)=>{if(Ys(n))throw new Error;return n}),RZ={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"]}},iO=(e,t)=>{const n={},r=Qo(t).concat(Qo(e));return Pn(r,o=>{const s=e[o],i=t[o];if(qd(s)&&qd(i))fr(n[o]={},iO(s,i)),Py(n[o])&&delete n[o];else if(Ng(t,o)&&i!==s){let c=!0;if(Js(s)||Js(i))try{Qk(s)===Qk(i)&&(c=!1)}catch{}c&&(n[o]=i)}}),n},lO="os-environment",cO=`${lO}-flexbox-glue`,DZ=`${cO}-max`,uO="os-scrollbar-hidden",Xv="data-overlayscrollbars-initialize",Ts="data-overlayscrollbars",dO=`${Ts}-overflow-x`,fO=`${Ts}-overflow-y`,Yc="overflowVisible",AZ="scrollbarHidden",Yk="scrollbarPressed",Im="updating",Oi="data-overlayscrollbars-viewport",Qv="arrange",pO="scrollbarHidden",Jc=Yc,kb="data-overlayscrollbars-padding",NZ=Jc,Jk="data-overlayscrollbars-content",Ay="os-size-observer",TZ=`${Ay}-appear`,$Z=`${Ay}-listener`,LZ="os-trinsic-observer",FZ="os-no-css-vars",zZ="os-theme-none",To="os-scrollbar",BZ=`${To}-rtl`,HZ=`${To}-horizontal`,WZ=`${To}-vertical`,hO=`${To}-track`,Ny=`${To}-handle`,VZ=`${To}-visible`,UZ=`${To}-cornerless`,Zk=`${To}-transitionless`,ej=`${To}-interaction`,tj=`${To}-unusable`,nj=`${To}-auto-hidden`,rj=`${To}-wheel`,GZ=`${hO}-interactive`,qZ=`${Ny}-interactive`,mO={},Bl=()=>mO,KZ=e=>{const t=[];return Pn(Js(e)?e:[e],n=>{const r=Qo(n);Pn(r,o=>{Nn(t,mO[o]=n[o])})}),t},XZ="__osOptionsValidationPlugin",QZ="__osSizeObserverPlugin",Ty="__osScrollbarsHidingPlugin",YZ="__osClickScrollPlugin";let Yv;const oj=(e,t,n,r)=>{ms(e,t);const o=hh(t),s=Xd(t),i=Pm(n);return r&&_a(t),{x:s.h-o.h+i.h,y:s.w-o.w+i.w}},JZ=e=>{let t=!1;const n=ni(e,uO);try{t=io(e,CZ("scrollbar-width"))==="none"||window.getComputedStyle(e,"::-webkit-scrollbar").getPropertyValue("display")==="none"}catch{}return n(),t},ZZ=(e,t)=>{const n="hidden";io(e,{overflowX:n,overflowY:n,direction:"rtl"}),Vs(e,0);const r=Kv(e),o=Kv(t);Vs(e,-999);const s=Kv(t);return{i:r.x===o.x,n:o.x!==s.x}},eee=(e,t)=>{const n=ni(e,cO),r=ya(e),o=ya(t),s=Uk(o,r,!0),i=ni(e,DZ),c=ya(e),f=ya(t),p=Uk(f,c,!0);return n(),i(),s&&p},tee=()=>{const{body:e}=document,n=JE(`<div class="${lO}"><div></div></div>`)[0],r=n.firstChild,[o,,s]=Dy(),[i,c]=Ns({o:oj(e,n,r),u:rO},oj.bind(0,e,n,r,!0)),[f]=c(),p=JZ(n),h={x:f.x===0,y:f.y===0},m={elements:{host:null,padding:!p,viewport:j=>p&&j===j.ownerDocument.body&&j,content:!1},scrollbars:{slot:!0},cancel:{nativeScrollbarsOverlaid:!1,body:null}},v=fr({},RZ),b=fr.bind(0,{},v),y=fr.bind(0,{},m),x={k:f,A:h,I:p,L:io(n,"zIndex")==="-1",B:ZZ(n,r),V:eee(n,r),Y:o.bind(0,"z"),j:o.bind(0,"r"),N:y,q:j=>fr(m,j)&&y(),F:b,G:j=>fr(v,j)&&b(),X:fr({},m),U:fr({},v)},C=window.addEventListener,k=My(j=>s(j?"z":"r"),{v:33,g:99});if(_o(n,"style"),_a(n),C("resize",k.bind(0,!1)),!p&&(!h.x||!h.y)){let j;C("resize",()=>{const _=Bl()[Ty];j=j||_&&_.R(),j&&j(x,i,k.bind(0,!0))})}return x},$o=()=>(Yv||(Yv=tee()),Yv),$y=(e,t)=>Ys(t)?t.apply(0,e):t,nee=(e,t,n,r)=>{const o=gi(r)?n:r;return $y(e,o)||t.apply(0,e)},gO=(e,t,n,r)=>{const o=gi(r)?n:r,s=$y(e,o);return!!s&&(Sm(s)?s:t.apply(0,e))},ree=(e,t,n)=>{const{nativeScrollbarsOverlaid:r,body:o}=n||{},{A:s,I:i}=$o(),{nativeScrollbarsOverlaid:c,body:f}=t,p=r??c,h=gi(o)?f:o,m=(s.x||s.y)&&p,v=e&&(Rg(h)?!i:h);return!!m||!!v},Ly=new WeakMap,oee=(e,t)=>{Ly.set(e,t)},see=e=>{Ly.delete(e)},vO=e=>Ly.get(e),sj=(e,t)=>e?t.split(".").reduce((n,r)=>n&&Ng(n,r)?n[r]:void 0,e):void 0,jb=(e,t,n)=>r=>[sj(e,r),n||sj(t,r)!==void 0],bO=e=>{let t=e;return[()=>t,n=>{t=fr({},t,n)}]},Gp="tabindex",qp=jl.bind(0,""),Jv=e=>{ms(ai(e),Iy(e)),_a(e)},aee=e=>{const t=$o(),{N:n,I:r}=t,o=Bl()[Ty],s=o&&o.T,{elements:i}=n(),{host:c,padding:f,viewport:p,content:h}=i,m=Sm(e),v=m?{}:e,{elements:b}=v,{host:y,padding:x,viewport:C,content:k}=b||{},j=m?e:v.target,_=km(j,"textarea"),I=j.ownerDocument,O=I.documentElement,E=j===I.body,M=I.defaultView,R=nee.bind(0,[j]),A=gO.bind(0,[j]),D=$y.bind(0,[j]),T=R.bind(0,qp,p),K=A.bind(0,qp,h),B=T(C),G=B===j,Q=G&&E,V=!G&&K(k),L=!G&&Sm(B)&&B===V,X=L&&!!D(h),F=X?T():B,q=X?V:K(),Y=Q?O:L?F:B,ce=_?R(qp,c,y):j,ae=Q?Y:ce,U=L?q:V,W=I.activeElement,ne=!G&&M.top===M&&W===j,ie={W:j,Z:ae,J:Y,K:!G&&A(qp,f,x),tt:U,nt:!G&&!r&&s&&s(t),ot:Q?O:Y,st:Q?I:Y,et:M,ct:I,rt:_,it:E,lt:m,ut:G,dt:L,ft:(gt,bt)=>mZ(Y,G?Ts:Oi,G?bt:gt),_t:(gt,bt,ye)=>kl(Y,G?Ts:Oi,G?bt:gt,ye)},oe=Qo(ie).reduce((gt,bt)=>{const ye=ie[bt];return Nn(gt,ye&&!ai(ye)?ye:!1)},[]),me=gt=>gt?jy(oe,gt)>-1:null,{W:fe,Z:he,K:Ce,J:xe,tt:de,nt:Ne}=ie,De=[()=>{_o(he,Ts),_o(he,Xv),_o(fe,Xv),E&&(_o(O,Ts),_o(O,Xv))}],Xe=_&&me(he);let It=_?fe:Iy([de,xe,Ce,he,fe].find(gt=>me(gt)===!1));const lt=Q?fe:de||xe;return[ie,()=>{ao(he,Ts,G?"viewport":"host"),ao(Ce,kb,""),ao(de,Jk,""),G||ao(xe,Oi,"");const gt=E&&!G?ni(ai(j),uO):ps;if(Xe&&(Wk(fe,he),Nn(De,()=>{Wk(he,fe),_a(he)})),ms(lt,It),ms(he,Ce),ms(Ce||he,!G&&xe),ms(xe,de),Nn(De,()=>{gt(),_o(Ce,kb),_o(de,Jk),_o(xe,dO),_o(xe,fO),_o(xe,Oi),me(de)&&Jv(de),me(xe)&&Jv(xe),me(Ce)&&Jv(Ce)}),r&&!G&&(kl(xe,Oi,pO,!0),Nn(De,_o.bind(0,xe,Oi))),Ne&&(bZ(xe,Ne),Nn(De,_a.bind(0,Ne))),ne){const bt=ao(xe,Gp);ao(xe,Gp,"-1"),xe.focus();const ye=()=>bt?ao(xe,Gp,bt):_o(xe,Gp),We=$r(I,"pointerdown keydown",()=>{ye(),We()});Nn(De,[ye,We])}else W&&W.focus&&W.focus();It=0},Aa.bind(0,De)]},iee=(e,t)=>{const{tt:n}=e,[r]=t;return o=>{const{V:s}=$o(),{ht:i}=r(),{vt:c}=o,f=(n||!s)&&c;return f&&io(n,{height:i?"":"100%"}),{gt:f,wt:f}}},lee=(e,t)=>{const[n,r]=t,{Z:o,K:s,J:i,ut:c}=e,[f,p]=Ns({u:jZ,o:qk()},qk.bind(0,o,"padding",""));return(h,m,v)=>{let[b,y]=p(v);const{I:x,V:C}=$o(),{bt:k}=n(),{gt:j,wt:_,yt:I}=h,[O,E]=m("paddingAbsolute");(j||y||!C&&_)&&([b,y]=f(v));const R=!c&&(E||I||y);if(R){const A=!O||!s&&!x,D=b.r+b.l,T=b.t+b.b,K={marginRight:A&&!k?-D:0,marginBottom:A?-T:0,marginLeft:A&&k?-D:0,top:A?-b.t:0,right:A?k?-b.r:"auto":0,left:A?k?"auto":-b.l:0,width:A?`calc(100% + ${D}px)`:""},B={paddingTop:A?b.t:0,paddingRight:A?b.r:0,paddingBottom:A?b.b:0,paddingLeft:A?b.l:0};io(s||i,K),io(i,B),r({K:b,St:!A,P:s?B:fr({},K,B)})}return{xt:R}}},{max:_b}=Math,Mi=_b.bind(0,0),xO="visible",aj="hidden",cee=42,Kp={u:nO,o:{w:0,h:0}},uee={u:rO,o:{x:aj,y:aj}},dee=(e,t)=>{const n=window.devicePixelRatio%1!==0?1:0,r={w:Mi(e.w-t.w),h:Mi(e.h-t.h)};return{w:r.w>n?r.w:0,h:r.h>n?r.h:0}},Xp=e=>e.indexOf(xO)===0,fee=(e,t)=>{const[n,r]=t,{Z:o,K:s,J:i,nt:c,ut:f,_t:p,it:h,et:m}=e,{k:v,V:b,I:y,A:x}=$o(),C=Bl()[Ty],k=!f&&!y&&(x.x||x.y),j=h&&f,[_,I]=Ns(Kp,Pm.bind(0,i)),[O,E]=Ns(Kp,_m.bind(0,i)),[M,R]=Ns(Kp),[A,D]=Ns(Kp),[T]=Ns(uee),K=(X,F)=>{if(io(i,{height:""}),F){const{St:q,K:te}=n(),{$t:Y,D:ce}=X,ae=Pm(o),U=hh(o),W=io(i,"boxSizing")==="content-box",ne=q||W?te.b+te.t:0,ie=!(x.x&&W);io(i,{height:U.h+ae.h+(Y.x&&ie?ce.x:0)-ne})}},B=(X,F)=>{const q=!y&&!X?cee:0,te=(me,fe,he)=>{const Ce=io(i,me),de=(F?F[me]:Ce)==="scroll";return[Ce,de,de&&!y?fe?q:he:0,fe&&!!q]},[Y,ce,ae,U]=te("overflowX",x.x,v.x),[W,ne,ie,oe]=te("overflowY",x.y,v.y);return{Ct:{x:Y,y:W},$t:{x:ce,y:ne},D:{x:ae,y:ie},M:{x:U,y:oe}}},G=(X,F,q,te)=>{const Y=(ne,ie)=>{const oe=Xp(ne),me=ie&&oe&&ne.replace(`${xO}-`,"")||"";return[ie&&!oe?ne:"",Xp(me)?"hidden":me]},[ce,ae]=Y(q.x,F.x),[U,W]=Y(q.y,F.y);return te.overflowX=ae&&U?ae:ce,te.overflowY=W&&ce?W:U,B(X,te)},Q=(X,F,q,te)=>{const{D:Y,M:ce}=X,{x:ae,y:U}=ce,{x:W,y:ne}=Y,{P:ie}=n(),oe=F?"marginLeft":"marginRight",me=F?"paddingLeft":"paddingRight",fe=ie[oe],he=ie.marginBottom,Ce=ie[me],xe=ie.paddingBottom;te.width=`calc(100% + ${ne+-1*fe}px)`,te[oe]=-ne+fe,te.marginBottom=-W+he,q&&(te[me]=Ce+(U?ne:0),te.paddingBottom=xe+(ae?W:0))},[V,L]=C?C.H(k,b,i,c,n,B,Q):[()=>k,()=>[ps]];return(X,F,q)=>{const{gt:te,Ot:Y,wt:ce,xt:ae,vt:U,yt:W}=X,{ht:ne,bt:ie}=n(),[oe,me]=F("showNativeOverlaidScrollbars"),[fe,he]=F("overflow"),Ce=oe&&x.x&&x.y,xe=!f&&!b&&(te||ce||Y||me||U),de=Xp(fe.x),Ne=Xp(fe.y),De=de||Ne;let Xe=I(q),It=E(q),lt=R(q),on=D(q),gt;if(me&&y&&p(pO,AZ,!Ce),xe&&(gt=B(Ce),K(gt,ne)),te||ae||ce||W||me){De&&p(Jc,Yc,!1);const[_e,Ze]=L(Ce,ie,gt),[Qe,ct]=Xe=_(q),[Ft,ir]=It=O(q),pn=hh(i);let ln=Ft,Ur=pn;_e(),(ir||ct||me)&&Ze&&!Ce&&V(Ze,Ft,Qe,ie)&&(Ur=hh(i),ln=_m(i));const wr={w:Mi(_b(Ft.w,ln.w)+Qe.w),h:Mi(_b(Ft.h,ln.h)+Qe.h)},Hn={w:Mi((j?m.innerWidth:Ur.w+Mi(pn.w-Ft.w))+Qe.w),h:Mi((j?m.innerHeight+Qe.h:Ur.h+Mi(pn.h-Ft.h))+Qe.h)};on=A(Hn),lt=M(dee(wr,Hn),q)}const[bt,ye]=on,[We,Et]=lt,[zt,we]=It,[xt,Nt]=Xe,Lt={x:We.w>0,y:We.h>0},$e=de&&Ne&&(Lt.x||Lt.y)||de&&Lt.x&&!Lt.y||Ne&&Lt.y&&!Lt.x;if(ae||W||Nt||we||ye||Et||he||me||xe){const _e={marginRight:0,marginBottom:0,marginLeft:0,width:"",overflowY:"",overflowX:""},Ze=G(Ce,Lt,fe,_e),Qe=V(Ze,zt,xt,ie);f||Q(Ze,ie,Qe,_e),xe&&K(Ze,ne),f?(ao(o,dO,_e.overflowX),ao(o,fO,_e.overflowY)):io(i,_e)}kl(o,Ts,Yc,$e),kl(s,kb,NZ,$e),f||kl(i,Oi,Jc,De);const[Ke,vn]=T(B(Ce).Ct);return r({Ct:Ke,zt:{x:bt.w,y:bt.h},Tt:{x:We.w,y:We.h},Et:Lt}),{It:vn,At:ye,Lt:Et}}},ij=(e,t,n)=>{const r={},o=t||{},s=Qo(e).concat(Qo(o));return Pn(s,i=>{const c=e[i],f=o[i];r[i]=!!(n||c||f)}),r},pee=(e,t)=>{const{W:n,J:r,_t:o,ut:s}=e,{I:i,A:c,V:f}=$o(),p=!i&&(c.x||c.y),h=[iee(e,t),lee(e,t),fee(e,t)];return(m,v,b)=>{const y=ij(fr({gt:!1,xt:!1,yt:!1,vt:!1,At:!1,Lt:!1,It:!1,Ot:!1,wt:!1},v),{},b),x=p||!f,C=x&&Vs(r),k=x&&ti(r);o("",Im,!0);let j=y;return Pn(h,_=>{j=ij(j,_(j,m,!!b)||{},b)}),Vs(r,C),ti(r,k),o("",Im),s||(Vs(n,0),ti(n,0)),j}},hee=(e,t,n)=>{let r,o=!1;const s=()=>{o=!0},i=c=>{if(n){const f=n.reduce((p,h)=>{if(h){const[m,v]=h,b=v&&m&&(c?c(m):YE(m,e));b&&b.length&&v&&el(v)&&Nn(p,[b,v.trim()],!0)}return p},[]);Pn(f,p=>Pn(p[0],h=>{const m=p[1],v=r.get(h)||[];if(e.contains(h)){const y=$r(h,m,x=>{o?(y(),r.delete(h)):t(x)});r.set(h,Nn(v,y))}else Aa(v),r.delete(h)}))}};return n&&(r=new WeakMap,i()),[s,i]},lj=(e,t,n,r)=>{let o=!1;const{Ht:s,Pt:i,Dt:c,Mt:f,Rt:p,kt:h}=r||{},m=My(()=>{o&&n(!0)},{v:33,g:99}),[v,b]=hee(e,m,c),y=s||[],x=i||[],C=y.concat(x),k=(_,I)=>{const O=p||ps,E=h||ps,M=new Set,R=new Set;let A=!1,D=!1;if(Pn(_,T=>{const{attributeName:K,target:B,type:G,oldValue:Q,addedNodes:V,removedNodes:L}=T,X=G==="attributes",F=G==="childList",q=e===B,te=X&&el(K)?ao(B,K):0,Y=te!==0&&Q!==te,ce=jy(x,K)>-1&&Y;if(t&&(F||!q)){const ae=!X,U=X&&Y,W=U&&f&&km(B,f),ie=(W?!O(B,K,Q,te):ae||U)&&!E(T,!!W,e,r);Pn(V,oe=>M.add(oe)),Pn(L,oe=>M.add(oe)),D=D||ie}!t&&q&&Y&&!O(B,K,Q,te)&&(R.add(K),A=A||ce)}),M.size>0&&b(T=>zl(M).reduce((K,B)=>(Nn(K,YE(T,B)),km(B,T)?Nn(K,B):K),[])),t)return!I&&D&&n(!1),[!1];if(R.size>0||A){const T=[zl(R),A];return!I&&n.apply(0,T),T}},j=new SZ(_=>k(_));return j.observe(e,{attributes:!0,attributeOldValue:!0,attributeFilter:C,subtree:t,childList:t,characterData:t}),o=!0,[()=>{o&&(v(),j.disconnect(),o=!1)},()=>{if(o){m.m();const _=j.takeRecords();return!_y(_)&&k(_,!0)}}]},Qp=3333333,Yp=e=>e&&(e.height||e.width),yO=(e,t,n)=>{const{Bt:r=!1,Vt:o=!1}=n||{},s=Bl()[QZ],{B:i}=$o(),f=JE(`<div class="${Ay}"><div class="${$Z}"></div></div>`)[0],p=f.firstChild,h=Kd.bind(0,e),[m]=Ns({o:void 0,_:!0,u:(x,C)=>!(!x||!Yp(x)&&Yp(C))}),v=x=>{const C=Js(x)&&x.length>0&&qd(x[0]),k=!C&&ky(x[0]);let j=!1,_=!1,I=!0;if(C){const[O,,E]=m(x.pop().contentRect),M=Yp(O),R=Yp(E);j=!E||!M,_=!R&&M,I=!j}else k?[,I]=x:_=x===!0;if(r&&I){const O=k?x[0]:Kd(f);Vs(f,O?i.n?-Qp:i.i?0:Qp:Qp),ti(f,Qp)}j||t({gt:!k,Yt:k?x:void 0,Vt:!!_})},b=[];let y=o?v:!1;return[()=>{Aa(b),_a(f)},()=>{if($c){const x=new $c(v);x.observe(p),Nn(b,()=>{x.disconnect()})}else if(s){const[x,C]=s.O(p,v,o);y=x,Nn(b,C)}if(r){const[x]=Ns({o:void 0},h);Nn(b,$r(f,"scroll",C=>{const k=x(),[j,_,I]=k;_&&(Oy(p,"ltr rtl"),j?ni(p,"rtl"):ni(p,"ltr"),v([!!j,_,I])),sO(C)}))}y&&(ni(f,TZ),Nn(b,$r(f,"animationstart",y,{C:!!$c}))),($c||s)&&ms(e,f)}]},mee=e=>e.h===0||e.isIntersecting||e.intersectionRatio>0,gee=(e,t)=>{let n;const r=jl(LZ),o=[],[s]=Ns({o:!1}),i=(f,p)=>{if(f){const h=s(mee(f)),[,m]=h;if(m)return!p&&t(h),[h]}},c=(f,p)=>{if(f&&f.length>0)return i(f.pop(),p)};return[()=>{Aa(o),_a(r)},()=>{if(Vk)n=new Vk(f=>c(f),{root:e}),n.observe(r),Nn(o,()=>{n.disconnect()});else{const f=()=>{const m=Xd(r);i(m)},[p,h]=yO(r,f);Nn(o,p),h(),f()}ms(e,r)},()=>{if(n)return c(n.takeRecords(),!0)}]},cj=`[${Ts}]`,vee=`[${Oi}]`,Zv=["tabindex"],uj=["wrap","cols","rows"],e1=["id","class","style","open"],bee=(e,t,n)=>{let r,o,s;const{Z:i,J:c,tt:f,rt:p,ut:h,ft:m,_t:v}=e,{V:b}=$o(),[y]=Ns({u:nO,o:{w:0,h:0}},()=>{const G=m(Jc,Yc),Q=m(Qv,""),V=Q&&Vs(c),L=Q&&ti(c);v(Jc,Yc),v(Qv,""),v("",Im,!0);const X=_m(f),F=_m(c),q=Pm(c);return v(Jc,Yc,G),v(Qv,"",Q),v("",Im),Vs(c,V),ti(c,L),{w:F.w+X.w+q.w,h:F.h+X.h+q.h}}),x=p?uj:e1.concat(uj),C=My(n,{v:()=>r,g:()=>o,p(G,Q){const[V]=G,[L]=Q;return[Qo(V).concat(Qo(L)).reduce((X,F)=>(X[F]=V[F]||L[F],X),{})]}}),k=G=>{Pn(G||Zv,Q=>{if(jy(Zv,Q)>-1){const V=ao(i,Q);el(V)?ao(c,Q,V):_o(c,Q)}})},j=(G,Q)=>{const[V,L]=G,X={vt:L};return t({ht:V}),!Q&&n(X),X},_=({gt:G,Yt:Q,Vt:V})=>{const L=!G||V?n:C;let X=!1;if(Q){const[F,q]=Q;X=q,t({bt:F})}L({gt:G,yt:X})},I=(G,Q)=>{const[,V]=y(),L={wt:V};return V&&!Q&&(G?n:C)(L),L},O=(G,Q,V)=>{const L={Ot:Q};return Q?!V&&C(L):h||k(G),L},[E,M,R]=f||!b?gee(i,j):[ps,ps,ps],[A,D]=h?[ps,ps]:yO(i,_,{Vt:!0,Bt:!0}),[T,K]=lj(i,!1,O,{Pt:e1,Ht:e1.concat(Zv)}),B=h&&$c&&new $c(_.bind(0,{gt:!0}));return B&&B.observe(i),k(),[()=>{E(),A(),s&&s[0](),B&&B.disconnect(),T()},()=>{D(),M()},()=>{const G={},Q=K(),V=R(),L=s&&s[1]();return Q&&fr(G,O.apply(0,Nn(Q,!0))),V&&fr(G,j.apply(0,Nn(V,!0))),L&&fr(G,I.apply(0,Nn(L,!0))),G},G=>{const[Q]=G("update.ignoreMutation"),[V,L]=G("update.attributes"),[X,F]=G("update.elementEvents"),[q,te]=G("update.debounce"),Y=F||L,ce=ae=>Ys(Q)&&Q(ae);if(Y&&(s&&(s[1](),s[0]()),s=lj(f||c,!0,I,{Ht:x.concat(V||[]),Dt:X,Mt:cj,kt:(ae,U)=>{const{target:W,attributeName:ne}=ae;return(!U&&ne&&!h?vZ(W,cj,vee):!1)||!!Tc(W,`.${To}`)||!!ce(ae)}})),te)if(C.m(),Js(q)){const ae=q[0],U=q[1];r=Hi(ae)&&ae,o=Hi(U)&&U}else Hi(q)?(r=q,o=!1):(r=!1,o=!1)}]},dj={x:0,y:0},xee=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:dj,Tt:dj,Ct:{x:"hidden",y:"hidden"},Et:{x:!1,y:!1},ht:!1,bt:Kd(e.Z)}),yee=(e,t)=>{const n=jb(t,{}),[r,o,s]=Dy(),[i,c,f]=aee(e),p=bO(xee(i)),[h,m]=p,v=pee(i,p),b=(_,I,O)=>{const M=Qo(_).some(R=>_[R])||!Py(I)||O;return M&&s("u",[_,I,O]),M},[y,x,C,k]=bee(i,m,_=>b(v(n,_),{},!1)),j=h.bind(0);return j.jt=_=>r("u",_),j.Nt=()=>{const{W:_,J:I}=i,O=Vs(_),E=ti(_);x(),c(),Vs(I,O),ti(I,E)},j.qt=i,[(_,I)=>{const O=jb(t,_,I);return k(O),b(v(O,C(),I),_,!!I)},j,()=>{o(),y(),f()}]},{round:fj}=Math,wee=e=>{const{width:t,height:n}=ya(e),{w:r,h:o}=Xd(e);return{x:fj(t)/r||1,y:fj(n)/o||1}},Cee=(e,t,n)=>{const r=t.scrollbars,{button:o,isPrimary:s,pointerType:i}=e,{pointers:c}=r;return o===0&&s&&r[n?"dragScroll":"clickScroll"]&&(c||[]).includes(i)},See=(e,t)=>$r(e,"mousedown",$r.bind(0,t,"click",sO,{C:!0,$:!0}),{$:!0}),pj="pointerup pointerleave pointercancel lostpointercapture",kee=(e,t,n,r,o,s,i)=>{const{B:c}=$o(),{Ft:f,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",C=i?"x":"y",k=(j,_)=>I=>{const{Tt:O}=s(),E=Xd(p)[x]-Xd(f)[x],R=_*I/E*O[C],D=Kd(h)&&i?c.n||c.i?1:-1:1;o[m]=j+R*D};return $r(p,"pointerdown",j=>{const _=Tc(j.target,`.${Ny}`)===f,I=_?f:p;if(kl(t,Ts,Yk,!0),Cee(j,e,_)){const O=!_&&j.shiftKey,E=()=>ya(f),M=()=>ya(p),R=(F,q)=>(F||E())[y]-(q||M())[y],A=k(o[m]||0,1/wee(o)[C]),D=j[v],T=E(),K=M(),B=T[b],G=R(T,K)+B/2,Q=D-K[y],V=_?0:Q-G,L=F=>{Aa(X),I.releasePointerCapture(F.pointerId)},X=[kl.bind(0,t,Ts,Yk),$r(n,pj,L),$r(n,"selectstart",F=>aO(F),{S:!1}),$r(p,pj,L),$r(p,"pointermove",F=>{const q=F[v]-D;(_||O)&&A(V+q)})];if(O)A(V);else if(!_){const F=Bl()[YZ];F&&Nn(X,F.O(A,R,V,B,Q))}I.setPointerCapture(j.pointerId)}})},jee=(e,t)=>(n,r,o,s,i,c)=>{const{Xt:f}=n,[p,h]=Oc(333),m=!!i.scrollBy;let v=!0;return Aa.bind(0,[$r(f,"pointerenter",()=>{r(ej,!0)}),$r(f,"pointerleave pointercancel",()=>{r(ej)}),$r(f,"wheel",b=>{const{deltaX:y,deltaY:x,deltaMode:C}=b;m&&v&&C===0&&ai(f)===s&&i.scrollBy({left:y,top:x,behavior:"smooth"}),v=!1,r(rj,!0),p(()=>{v=!0,r(rj)}),aO(b)},{S:!1,$:!0}),See(f,o),kee(e,s,o,n,i,t,c),h])},{min:Pb,max:hj,abs:_ee,round:Pee}=Math,wO=(e,t,n,r)=>{if(r){const c=n?"x":"y",{Tt:f,zt:p}=r,h=p[c],m=f[c];return hj(0,Pb(1,h/(h+m)))}const o=n?"width":"height",s=ya(e)[o],i=ya(t)[o];return hj(0,Pb(1,s/i))},Iee=(e,t,n,r,o,s)=>{const{B:i}=$o(),c=s?"x":"y",f=s?"Left":"Top",{Tt:p}=r,h=Pee(p[c]),m=_ee(n[`scroll${f}`]),v=s&&o,b=i.i?m:h-m,x=Pb(1,(v?b:m)/h),C=wO(e,t,s);return 1/C*(1-C)*x},Eee=(e,t,n)=>{const{N:r,L:o}=$o(),{scrollbars:s}=r(),{slot:i}=s,{ct:c,W:f,Z:p,J:h,lt:m,ot:v,it:b,ut:y}=t,{scrollbars:x}=m?{}:e,{slot:C}=x||{},k=gO([f,p,h],()=>y&&b?f:p,i,C),j=(V,L,X)=>{const F=X?ni:Oy;Pn(V,q=>{F(q.Xt,L)})},_=(V,L)=>{Pn(V,X=>{const[F,q]=L(X);io(F,q)})},I=(V,L,X)=>{_(V,F=>{const{Ft:q,Gt:te}=F;return[q,{[X?"width":"height"]:`${(100*wO(q,te,X,L)).toFixed(3)}%`}]})},O=(V,L,X)=>{const F=X?"X":"Y";_(V,q=>{const{Ft:te,Gt:Y,Xt:ce}=q,ae=Iee(te,Y,v,L,Kd(ce),X);return[te,{transform:ae===ae?`translate${F}(${(100*ae).toFixed(3)}%)`:""}]})},E=[],M=[],R=[],A=(V,L,X)=>{const F=ky(X),q=F?X:!0,te=F?!X:!0;q&&j(M,V,L),te&&j(R,V,L)},D=V=>{I(M,V,!0),I(R,V)},T=V=>{O(M,V,!0),O(R,V)},K=V=>{const L=V?HZ:WZ,X=V?M:R,F=_y(X)?Zk:"",q=jl(`${To} ${L} ${F}`),te=jl(hO),Y=jl(Ny),ce={Xt:q,Gt:te,Ft:Y};return o||ni(q,FZ),ms(q,te),ms(te,Y),Nn(X,ce),Nn(E,[_a.bind(0,q),n(ce,A,c,p,v,V)]),ce},B=K.bind(0,!0),G=K.bind(0,!1),Q=()=>{ms(k,M[0].Xt),ms(k,R[0].Xt),jm(()=>{A(Zk)},300)};return B(),G(),[{Ut:D,Wt:T,Zt:A,Jt:{Kt:M,Qt:B,tn:_.bind(0,M)},nn:{Kt:R,Qt:G,tn:_.bind(0,R)}},Q,Aa.bind(0,E)]},Oee=(e,t,n,r)=>{let o,s,i,c,f,p=0;const h=bO({}),[m]=h,[v,b]=Oc(),[y,x]=Oc(),[C,k]=Oc(100),[j,_]=Oc(100),[I,O]=Oc(()=>p),[E,M,R]=Eee(e,n.qt,jee(t,n)),{Z:A,J:D,ot:T,st:K,ut:B,it:G}=n.qt,{Jt:Q,nn:V,Zt:L,Ut:X,Wt:F}=E,{tn:q}=Q,{tn:te}=V,Y=ne=>{const{Xt:ie}=ne,oe=B&&!G&&ai(ie)===D&&ie;return[oe,{transform:oe?`translate(${Vs(T)}px, ${ti(T)}px)`:""}]},ce=(ne,ie)=>{if(O(),ne)L(nj);else{const oe=()=>L(nj,!0);p>0&&!ie?I(oe):oe()}},ae=()=>{c=s,c&&ce(!0)},U=[k,O,_,x,b,R,$r(A,"pointerover",ae,{C:!0}),$r(A,"pointerenter",ae),$r(A,"pointerleave",()=>{c=!1,s&&ce(!1)}),$r(A,"pointermove",()=>{o&&v(()=>{k(),ce(!0),j(()=>{o&&ce(!1)})})}),$r(K,"scroll",ne=>{y(()=>{F(n()),i&&ce(!0),C(()=>{i&&!c&&ce(!1)})}),r(ne),B&&q(Y),B&&te(Y)})],W=m.bind(0);return W.qt=E,W.Nt=M,[(ne,ie,oe)=>{const{At:me,Lt:fe,It:he,yt:Ce}=oe,{A:xe}=$o(),de=jb(t,ne,ie),Ne=n(),{Tt:De,Ct:Xe,bt:It}=Ne,[lt,on]=de("showNativeOverlaidScrollbars"),[gt,bt]=de("scrollbars.theme"),[ye,We]=de("scrollbars.visibility"),[Et,zt]=de("scrollbars.autoHide"),[we]=de("scrollbars.autoHideDelay"),[xt,Nt]=de("scrollbars.dragScroll"),[Lt,$e]=de("scrollbars.clickScroll"),Ke=me||fe||Ce,vn=he||We,_e=lt&&xe.x&&xe.y,Ze=(Qe,ct)=>{const Ft=ye==="visible"||ye==="auto"&&Qe==="scroll";return L(VZ,Ft,ct),Ft};if(p=we,on&&L(zZ,_e),bt&&(L(f),L(gt,!0),f=gt),zt&&(o=Et==="move",s=Et==="leave",i=Et!=="never",ce(!i,!0)),Nt&&L(qZ,xt),$e&&L(GZ,Lt),vn){const Qe=Ze(Xe.x,!0),ct=Ze(Xe.y,!1);L(UZ,!(Qe&&ct))}Ke&&(X(Ne),F(Ne),L(tj,!De.x,!0),L(tj,!De.y,!1),L(BZ,It&&!G))},W,Aa.bind(0,U)]},CO=(e,t,n)=>{Ys(e)&&e(t||void 0,n||void 0)},Li=(e,t,n)=>{const{F:r,N:o,Y:s,j:i}=$o(),c=Bl(),f=Sm(e),p=f?e:e.target,h=vO(p);if(t&&!h){let m=!1;const v=B=>{const G=Bl()[XZ],Q=G&&G.O;return Q?Q(B,!0):B},b=fr({},r(),v(t)),[y,x,C]=Dy(n),[k,j,_]=yee(e,b),[I,O,E]=Oee(e,b,j,B=>C("scroll",[K,B])),M=(B,G)=>k(B,!!G),R=M.bind(0,{},!0),A=s(R),D=i(R),T=B=>{see(p),A(),D(),E(),_(),m=!0,C("destroyed",[K,!!B]),x()},K={options(B,G){if(B){const Q=G?r():{},V=iO(b,fr(Q,v(B)));Py(V)||(fr(b,V),M(V))}return fr({},b)},on:y,off:(B,G)=>{B&&G&&x(B,G)},state(){const{zt:B,Tt:G,Ct:Q,Et:V,K:L,St:X,bt:F}=j();return fr({},{overflowEdge:B,overflowAmount:G,overflowStyle:Q,hasOverflow:V,padding:L,paddingAbsolute:X,directionRTL:F,destroyed:m})},elements(){const{W:B,Z:G,K:Q,J:V,tt:L,ot:X,st:F}=j.qt,{Jt:q,nn:te}=O.qt,Y=ae=>{const{Ft:U,Gt:W,Xt:ne}=ae;return{scrollbar:ne,track:W,handle:U}},ce=ae=>{const{Kt:U,Qt:W}=ae,ne=Y(U[0]);return fr({},ne,{clone:()=>{const ie=Y(W());return I({},!0,{}),ie}})};return fr({},{target:B,host:G,padding:Q||V,viewport:V,content:L||V,scrollOffsetElement:X,scrollEventElement:F,scrollbarHorizontal:ce(q),scrollbarVertical:ce(te)})},update:B=>M({},B),destroy:T.bind(0)};return j.jt((B,G,Q)=>{I(G,Q,B)}),oee(p,K),Pn(Qo(c),B=>CO(c[B],0,K)),ree(j.qt.it,o().cancel,!f&&e.cancel)?(T(!0),K):(j.Nt(),O.Nt(),C("initialized",[K]),j.jt((B,G,Q)=>{const{gt:V,yt:L,vt:X,At:F,Lt:q,It:te,wt:Y,Ot:ce}=B;C("updated",[K,{updateHints:{sizeChanged:V,directionChanged:L,heightIntrinsicChanged:X,overflowEdgeChanged:F,overflowAmountChanged:q,overflowStyleChanged:te,contentMutation:Y,hostMutation:ce},changedOptions:G,force:Q}])}),K.update(!0),K)}return h};Li.plugin=e=>{Pn(KZ(e),t=>CO(t,Li))};Li.valid=e=>{const t=e&&e.elements,n=Ys(t)&&t();return yb(n)&&!!vO(n.target)};Li.env=()=>{const{k:e,A:t,I:n,B:r,V:o,L:s,X:i,U:c,N:f,q:p,F:h,G:m}=$o();return fr({},{scrollbarsSize:e,scrollbarsOverlaid:t,scrollbarsHiding:n,rtlScrollBehavior:r,flexboxGlue:o,cssCustomProperties:s,staticDefaultInitialization:i,staticDefaultOptions:c,getDefaultInitialization:f,setDefaultInitialization:p,getDefaultOptions:h,setDefaultOptions:m})};const Mee=()=>{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,c=r?n.cancelIdleCallback:s,f=()=>{c(e),s(t)};return[(p,h)=>{f(),e=i(r?()=>{f(),t=o(p)}:p,typeof h=="object"?h:{timeout:2233})},f]},SO=e=>{const{options:t,events:n,defer:r}=e||{},[o,s]=u.useMemo(Mee,[]),i=u.useRef(null),c=u.useRef(r),f=u.useRef(t),p=u.useRef(n);return u.useEffect(()=>{c.current=r},[r]),u.useEffect(()=>{const{current:h}=i;f.current=t,Li.valid(h)&&h.options(t||{},!0)},[t]),u.useEffect(()=>{const{current:h}=i;p.current=n,Li.valid(h)&&h.on(n||{},!0)},[n]),u.useEffect(()=>()=>{var h;s(),(h=i.current)==null||h.destroy()},[]),u.useMemo(()=>[h=>{const m=i.current;if(Li.valid(m))return;const v=c.current,b=f.current||{},y=p.current||{},x=()=>i.current=Li(h,b,y);v?o(x,v):x()},()=>i.current],[])},Ree=(e,t)=>{const{element:n="div",options:r,events:o,defer:s,children:i,...c}=e,f=n,p=u.useRef(null),h=u.useRef(null),[m,v]=SO({options:r,events:o,defer:s});return u.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]),u.useImperativeHandle(t,()=>({osInstance:v,getElement:()=>p.current}),[]),H.createElement(f,{"data-overlayscrollbars-initialize":"",ref:p,...c},H.createElement("div",{ref:h},i))},$g=u.forwardRef(Ree);var kO={exports:{}},jO={};const Wo=nx(lR),dd=nx(cR),Dee=nx(uR);(function(e){var t,n,r=fc&&fc.__generator||function(J,ee){var ge,je,ve,dt,st={label:0,sent:function(){if(1&ve[0])throw ve[1];return ve[1]},trys:[],ops:[]};return dt={next:Vt(0),throw:Vt(1),return:Vt(2)},typeof Symbol=="function"&&(dt[Symbol.iterator]=function(){return this}),dt;function Vt(ft){return function(yt){return function(He){if(ge)throw new TypeError("Generator is already executing.");for(;st;)try{if(ge=1,je&&(ve=2&He[0]?je.return:He[0]?je.throw||((ve=je.return)&&ve.call(je),0):je.next)&&!(ve=ve.call(je,He[1])).done)return ve;switch(je=0,ve&&(He=[2&He[0],ve.value]),He[0]){case 0:case 1:ve=He;break;case 4:return st.label++,{value:He[1],done:!1};case 5:st.label++,je=He[1],He=[0];continue;case 7:He=st.ops.pop(),st.trys.pop();continue;default:if(!((ve=(ve=st.trys).length>0&&ve[ve.length-1])||He[0]!==6&&He[0]!==2)){st=0;continue}if(He[0]===3&&(!ve||He[1]>ve[0]&&He[1]<ve[3])){st.label=He[1];break}if(He[0]===6&&st.label<ve[1]){st.label=ve[1],ve=He;break}if(ve&&st.label<ve[2]){st.label=ve[2],st.ops.push(He);break}ve[2]&&st.ops.pop(),st.trys.pop();continue}He=ee.call(J,st)}catch(Se){He=[6,Se],je=0}finally{ge=ve=0}if(5&He[0])throw He[1];return{value:He[0]?He[1]:void 0,done:!0}}([ft,yt])}}},o=fc&&fc.__spreadArray||function(J,ee){for(var ge=0,je=ee.length,ve=J.length;ge<je;ge++,ve++)J[ve]=ee[ge];return J},s=Object.create,i=Object.defineProperty,c=Object.defineProperties,f=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyDescriptors,h=Object.getOwnPropertyNames,m=Object.getOwnPropertySymbols,v=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,x=function(J,ee,ge){return ee in J?i(J,ee,{enumerable:!0,configurable:!0,writable:!0,value:ge}):J[ee]=ge},C=function(J,ee){for(var ge in ee||(ee={}))b.call(ee,ge)&&x(J,ge,ee[ge]);if(m)for(var je=0,ve=m(ee);je<ve.length;je++)y.call(ee,ge=ve[je])&&x(J,ge,ee[ge]);return J},k=function(J,ee){return c(J,p(ee))},j=function(J){return i(J,"__esModule",{value:!0})},_=function(J,ee){var ge={};for(var je in J)b.call(J,je)&&ee.indexOf(je)<0&&(ge[je]=J[je]);if(J!=null&&m)for(var ve=0,dt=m(J);ve<dt.length;ve++)ee.indexOf(je=dt[ve])<0&&y.call(J,je)&&(ge[je]=J[je]);return ge},I=function(J){return function(ee,ge,je){if(ge&&typeof ge=="object"||typeof ge=="function")for(var ve=function(Vt){b.call(ee,Vt)||Vt==="default"||i(ee,Vt,{get:function(){return ge[Vt]},enumerable:!(je=f(ge,Vt))||je.enumerable})},dt=0,st=h(ge);dt<st.length;dt++)ve(st[dt]);return ee}(j(i(J!=null?s(v(J)):{},"default",J&&J.__esModule&&"default"in J?{get:function(){return J.default},enumerable:!0}:{value:J,enumerable:!0})),J)},O=function(J,ee,ge){return new Promise(function(je,ve){var dt=function(ft){try{Vt(ge.next(ft))}catch(yt){ve(yt)}},st=function(ft){try{Vt(ge.throw(ft))}catch(yt){ve(yt)}},Vt=function(ft){return ft.done?je(ft.value):Promise.resolve(ft.value).then(dt,st)};Vt((ge=ge.apply(J,ee)).next())})};j(e),function(J,ee){for(var ge in ee)i(J,ge,{get:ee[ge],enumerable:!0})}(e,{QueryStatus:function(){return t},buildCreateApi:function(){return Qe},copyWithStructuralSharing:function(){return R},coreModule:function(){return Ta},createApi:function(){return ra},defaultSerializeQueryArgs:function(){return vn},fakeBaseQuery:function(){return ct},fetchBaseQuery:function(){return G},retry:function(){return X},setupListeners:function(){return U},skipSelector:function(){return we},skipToken:function(){return zt}}),(n=t||(t={})).uninitialized="uninitialized",n.pending="pending",n.fulfilled="fulfilled",n.rejected="rejected";var E=function(J){return[].concat.apply([],J)},M=I(Wo).isPlainObject;function R(J,ee){if(J===ee||!(M(J)&&M(ee)||Array.isArray(J)&&Array.isArray(ee)))return ee;for(var ge=Object.keys(ee),je=Object.keys(J),ve=ge.length===je.length,dt=Array.isArray(ee)?[]:{},st=0,Vt=ge;st<Vt.length;st++){var ft=Vt[st];dt[ft]=R(J[ft],ee[ft]),ve&&(ve=J[ft]===dt[ft])}return ve?J:dt}var A=I(Wo),D=function(){for(var J=[],ee=0;ee<arguments.length;ee++)J[ee]=arguments[ee];return fetch.apply(void 0,J)},T=function(J){return J.status>=200&&J.status<=299},K=function(J){return/ion\/(vnd\.api\+)?json/.test(J.get("content-type")||"")};function B(J){if(!(0,A.isPlainObject)(J))return J;for(var ee=C({},J),ge=0,je=Object.entries(ee);ge<je.length;ge++){var ve=je[ge];ve[1]===void 0&&delete ee[ve[0]]}return ee}function G(J){var ee=this;J===void 0&&(J={});var ge=J.baseUrl,je=J.prepareHeaders,ve=je===void 0?function(en){return en}:je,dt=J.fetchFn,st=dt===void 0?D:dt,Vt=J.paramsSerializer,ft=J.isJsonContentType,yt=ft===void 0?K:ft,He=J.jsonContentType,Se=He===void 0?"application/json":He,et=J.jsonReplacer,kt=J.timeout,Ot=J.responseHandler,$t=J.validateStatus,Xt=_(J,["baseUrl","prepareHeaders","fetchFn","paramsSerializer","isJsonContentType","jsonContentType","jsonReplacer","timeout","responseHandler","validateStatus"]);return typeof fetch>"u"&&st===D&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),function(en,qt){return O(ee,null,function(){var Be,vt,Dt,Ut,In,Kt,un,sn,Mr,Zn,Pt,En,Rn,er,hr,Tn,$n,dn,Sn,On,bn,xn,Ye,Mt,Ct,at,wt,Bt,ht,ot,Ae,Re,Le,Ve,nt,At;return r(this,function(Rt){switch(Rt.label){case 0:return Be=qt.signal,vt=qt.getState,Dt=qt.extra,Ut=qt.endpoint,In=qt.forced,Kt=qt.type,Mr=(sn=typeof en=="string"?{url:en}:en).url,Pt=(Zn=sn.headers)===void 0?new Headers(Xt.headers):Zn,Rn=(En=sn.params)===void 0?void 0:En,hr=(er=sn.responseHandler)===void 0?Ot??"json":er,$n=(Tn=sn.validateStatus)===void 0?$t??T:Tn,Sn=(dn=sn.timeout)===void 0?kt:dn,On=_(sn,["url","headers","params","responseHandler","validateStatus","timeout"]),bn=C(k(C({},Xt),{signal:Be}),On),Pt=new Headers(B(Pt)),xn=bn,[4,ve(Pt,{getState:vt,extra:Dt,endpoint:Ut,forced:In,type:Kt})];case 1:xn.headers=Rt.sent()||Pt,Ye=function(Ue){return typeof Ue=="object"&&((0,A.isPlainObject)(Ue)||Array.isArray(Ue)||typeof Ue.toJSON=="function")},!bn.headers.has("content-type")&&Ye(bn.body)&&bn.headers.set("content-type",Se),Ye(bn.body)&&yt(bn.headers)&&(bn.body=JSON.stringify(bn.body,et)),Rn&&(Mt=~Mr.indexOf("?")?"&":"?",Ct=Vt?Vt(Rn):new URLSearchParams(B(Rn)),Mr+=Mt+Ct),Mr=function(Ue,nn){if(!Ue)return nn;if(!nn)return Ue;if(function(hn){return new RegExp("(^|:)//").test(hn)}(nn))return nn;var yn=Ue.endsWith("/")||!nn.startsWith("?")?"/":"";return Ue=function(hn){return hn.replace(/\/$/,"")}(Ue),""+Ue+yn+function(hn){return hn.replace(/^\//,"")}(nn)}(ge,Mr),at=new Request(Mr,bn),wt=at.clone(),un={request:wt},ht=!1,ot=Sn&&setTimeout(function(){ht=!0,qt.abort()},Sn),Rt.label=2;case 2:return Rt.trys.push([2,4,5,6]),[4,st(at)];case 3:return Bt=Rt.sent(),[3,6];case 4:return Ae=Rt.sent(),[2,{error:{status:ht?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(Ae)},meta:un}];case 5:return ot&&clearTimeout(ot),[7];case 6:Re=Bt.clone(),un.response=Re,Ve="",Rt.label=7;case 7:return Rt.trys.push([7,9,,10]),[4,Promise.all([tn(Bt,hr).then(function(Ue){return Le=Ue},function(Ue){return nt=Ue}),Re.text().then(function(Ue){return Ve=Ue},function(){})])];case 8:if(Rt.sent(),nt)throw nt;return[3,10];case 9:return At=Rt.sent(),[2,{error:{status:"PARSING_ERROR",originalStatus:Bt.status,data:Ve,error:String(At)},meta:un}];case 10:return[2,$n(Bt,Le)?{data:Le,meta:un}:{error:{status:Bt.status,data:Le},meta:un}]}})})};function tn(en,qt){return O(this,null,function(){var Be;return r(this,function(vt){switch(vt.label){case 0:return typeof qt=="function"?[2,qt(en)]:(qt==="content-type"&&(qt=yt(en.headers)?"json":"text"),qt!=="json"?[3,2]:[4,en.text()]);case 1:return[2,(Be=vt.sent()).length?JSON.parse(Be):null];case 2:return[2,en.text()]}})})}}var Q=function(J,ee){ee===void 0&&(ee=void 0),this.value=J,this.meta=ee};function V(J,ee){return J===void 0&&(J=0),ee===void 0&&(ee=5),O(this,null,function(){var ge,je;return r(this,function(ve){switch(ve.label){case 0:return ge=Math.min(J,ee),je=~~((Math.random()+.4)*(300<<ge)),[4,new Promise(function(dt){return setTimeout(function(st){return dt(st)},je)})];case 1:return ve.sent(),[2]}})})}var L={},X=Object.assign(function(J,ee){return function(ge,je,ve){return O(void 0,null,function(){var dt,st,Vt,ft,yt,He,Se;return r(this,function(et){switch(et.label){case 0:dt=[5,(ee||L).maxRetries,(ve||L).maxRetries].filter(function(kt){return kt!==void 0}),st=dt.slice(-1)[0],Vt=function(kt,Ot,$t){return $t.attempt<=st},ft=C(C({maxRetries:st,backoff:V,retryCondition:Vt},ee),ve),yt=0,et.label=1;case 1:et.label=2;case 2:return et.trys.push([2,4,,6]),[4,J(ge,je,ve)];case 3:if((He=et.sent()).error)throw new Q(He);return[2,He];case 4:if(Se=et.sent(),yt++,Se.throwImmediately){if(Se instanceof Q)return[2,Se.value];throw Se}return Se instanceof Q&&!ft.retryCondition(Se.value.error,ge,{attempt:yt,baseQueryApi:je,extraOptions:ve})?[2,Se.value]:[4,ft.backoff(yt,ft.maxRetries)];case 5:return et.sent(),[3,6];case 6:return[3,1];case 7:return[2]}})})}},{fail:function(J){throw Object.assign(new Q({error:J}),{throwImmediately:!0})}}),F=I(Wo),q=(0,F.createAction)("__rtkq/focused"),te=(0,F.createAction)("__rtkq/unfocused"),Y=(0,F.createAction)("__rtkq/online"),ce=(0,F.createAction)("__rtkq/offline"),ae=!1;function U(J,ee){return ee?ee(J,{onFocus:q,onFocusLost:te,onOffline:ce,onOnline:Y}):(ge=function(){return J(q())},je=function(){return J(Y())},ve=function(){return J(ce())},dt=function(){window.document.visibilityState==="visible"?ge():J(te())},ae||typeof window<"u"&&window.addEventListener&&(window.addEventListener("visibilitychange",dt,!1),window.addEventListener("focus",ge,!1),window.addEventListener("online",je,!1),window.addEventListener("offline",ve,!1),ae=!0),function(){window.removeEventListener("focus",ge),window.removeEventListener("visibilitychange",dt),window.removeEventListener("online",je),window.removeEventListener("offline",ve),ae=!1});var ge,je,ve,dt}var W,ne,ie=I(Wo);function oe(J){return J.type===W.query}function me(J,ee,ge,je,ve,dt){return typeof J=="function"?J(ee,ge,je,ve).map(fe).map(dt):Array.isArray(J)?J.map(fe).map(dt):[]}function fe(J){return typeof J=="string"?{type:J}:J}(ne=W||(W={})).query="query",ne.mutation="mutation";var he=I(Wo);function Ce(J){return J!=null}var xe=Symbol("forceQueryFn"),de=function(J){return typeof J[xe]=="function"},Ne=I(Wo),De=I(dd),Xe=I(Wo);function It(J){return J}function lt(J,ee,ge,je){return me(ge[J.meta.arg.endpointName][ee],(0,Ne.isFulfilled)(J)?J.payload:void 0,(0,Ne.isRejectedWithValue)(J)?J.payload:void 0,J.meta.arg.originalArgs,"baseQueryMeta"in J.meta?J.meta.baseQueryMeta:void 0,je)}var on=I(dd),gt=I(dd);function bt(J,ee,ge){var je=J[ee];je&&ge(je)}function ye(J){var ee;return(ee="arg"in J?J.arg.fixedCacheKey:J.fixedCacheKey)!=null?ee:J.requestId}function We(J,ee,ge){var je=J[ye(ee)];je&&ge(je)}var Et={},zt=Symbol.for("RTKQ/skipToken"),we=zt,xt={status:t.uninitialized},Nt=(0,ie.createNextState)(xt,function(){}),Lt=(0,ie.createNextState)(xt,function(){}),$e=I(Wo),Ke=WeakMap?new WeakMap:void 0,vn=function(J){var ee=J.endpointName,ge=J.queryArgs,je="",ve=Ke==null?void 0:Ke.get(ge);if(typeof ve=="string")je=ve;else{var dt=JSON.stringify(ge,function(st,Vt){return(0,$e.isPlainObject)(Vt)?Object.keys(Vt).sort().reduce(function(ft,yt){return ft[yt]=Vt[yt],ft},{}):Vt});(0,$e.isPlainObject)(ge)&&(Ke==null||Ke.set(ge,dt)),je=dt}return ee+"("+je+")"},_e=I(Wo),Ze=I(Dee);function Qe(){for(var J=[],ee=0;ee<arguments.length;ee++)J[ee]=arguments[ee];return function(ge){var je=(0,Ze.defaultMemoize)(function(ft){var yt,He;return(He=ge.extractRehydrationInfo)==null?void 0:He.call(ge,ft,{reducerPath:(yt=ge.reducerPath)!=null?yt:"api"})}),ve=k(C({reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1},ge),{extractRehydrationInfo:je,serializeQueryArgs:function(ft){var yt=vn;if("serializeQueryArgs"in ft.endpointDefinition){var He=ft.endpointDefinition.serializeQueryArgs;yt=function(Se){var et=He(Se);return typeof et=="string"?et:vn(k(C({},Se),{queryArgs:et}))}}else ge.serializeQueryArgs&&(yt=ge.serializeQueryArgs);return yt(ft)},tagTypes:o([],ge.tagTypes||[])}),dt={endpointDefinitions:{},batch:function(ft){ft()},apiUid:(0,_e.nanoid)(),extractRehydrationInfo:je,hasRehydrationInfo:(0,Ze.defaultMemoize)(function(ft){return je(ft)!=null})},st={injectEndpoints:function(ft){for(var yt=ft.endpoints({query:function(tn){return k(C({},tn),{type:W.query})},mutation:function(tn){return k(C({},tn),{type:W.mutation})}}),He=0,Se=Object.entries(yt);He<Se.length;He++){var et=Se[He],kt=et[0],Ot=et[1];if(ft.overrideExisting||!(kt in dt.endpointDefinitions)){dt.endpointDefinitions[kt]=Ot;for(var $t=0,Xt=Vt;$t<Xt.length;$t++)Xt[$t].injectEndpoint(kt,Ot)}}return st},enhanceEndpoints:function(ft){var yt=ft.addTagTypes,He=ft.endpoints;if(yt)for(var Se=0,et=yt;Se<et.length;Se++){var kt=et[Se];ve.tagTypes.includes(kt)||ve.tagTypes.push(kt)}if(He)for(var Ot=0,$t=Object.entries(He);Ot<$t.length;Ot++){var Xt=$t[Ot],tn=Xt[0],en=Xt[1];typeof en=="function"?en(dt.endpointDefinitions[tn]):Object.assign(dt.endpointDefinitions[tn]||{},en)}return st}},Vt=J.map(function(ft){return ft.init(st,ve,dt)});return st.injectEndpoints({endpoints:ge.endpoints})}}function ct(){return function(){throw new Error("When using `fakeBaseQuery`, all queries & mutations must use the `queryFn` definition syntax.")}}var Ft,ir=I(Wo),pn=function(J){var ee=J.reducerPath,ge=J.api,je=J.context,ve=J.internalState,dt=ge.internalActions,st=dt.removeQueryResult,Vt=dt.unsubscribeQueryResult;function ft(Se){var et=ve.currentSubscriptions[Se];return!!et&&!function(kt){for(var Ot in kt)return!1;return!0}(et)}var yt={};function He(Se,et,kt,Ot){var $t,Xt=je.endpointDefinitions[et],tn=($t=Xt==null?void 0:Xt.keepUnusedDataFor)!=null?$t:Ot.keepUnusedDataFor;if(tn!==1/0){var en=Math.max(0,Math.min(tn,2147482647e-3));if(!ft(Se)){var qt=yt[Se];qt&&clearTimeout(qt),yt[Se]=setTimeout(function(){ft(Se)||kt.dispatch(st({queryCacheKey:Se})),delete yt[Se]},1e3*en)}}}return function(Se,et,kt){var Ot;if(Vt.match(Se)){var $t=et.getState()[ee];He(In=Se.payload.queryCacheKey,(Ot=$t.queries[In])==null?void 0:Ot.endpointName,et,$t.config)}if(ge.util.resetApiState.match(Se))for(var Xt=0,tn=Object.entries(yt);Xt<tn.length;Xt++){var en=tn[Xt],qt=en[0],Be=en[1];Be&&clearTimeout(Be),delete yt[qt]}if(je.hasRehydrationInfo(Se)){$t=et.getState()[ee];for(var vt=je.extractRehydrationInfo(Se).queries,Dt=0,Ut=Object.entries(vt);Dt<Ut.length;Dt++){var In,Kt=Ut[Dt],un=Kt[1];He(In=Kt[0],un==null?void 0:un.endpointName,et,$t.config)}}}},ln=I(Wo),Ur=function(J){var ee=J.reducerPath,ge=J.context,je=J.context.endpointDefinitions,ve=J.mutationThunk,dt=J.api,st=J.assertTagType,Vt=J.refetchQuery,ft=dt.internalActions.removeQueryResult,yt=(0,ln.isAnyOf)((0,ln.isFulfilled)(ve),(0,ln.isRejectedWithValue)(ve));function He(Se,et){var kt=et.getState(),Ot=kt[ee],$t=dt.util.selectInvalidatedBy(kt,Se);ge.batch(function(){for(var Xt,tn=0,en=Array.from($t.values());tn<en.length;tn++){var qt=en[tn].queryCacheKey,Be=Ot.queries[qt],vt=(Xt=Ot.subscriptions[qt])!=null?Xt:{};Be&&(Object.keys(vt).length===0?et.dispatch(ft({queryCacheKey:qt})):Be.status!==t.uninitialized&&et.dispatch(Vt(Be,qt)))}})}return function(Se,et){yt(Se)&&He(lt(Se,"invalidatesTags",je,st),et),dt.util.invalidateTags.match(Se)&&He(me(Se.payload,void 0,void 0,void 0,void 0,st),et)}},wr=function(J){var ee=J.reducerPath,ge=J.queryThunk,je=J.api,ve=J.refetchQuery,dt=J.internalState,st={};function Vt(Se,et){var kt=Se.queryCacheKey,Ot=et.getState()[ee].queries[kt];if(Ot&&Ot.status!==t.uninitialized){var $t=He(dt.currentSubscriptions[kt]);if(Number.isFinite($t)){var Xt=st[kt];Xt!=null&&Xt.timeout&&(clearTimeout(Xt.timeout),Xt.timeout=void 0);var tn=Date.now()+$t,en=st[kt]={nextPollTimestamp:tn,pollingInterval:$t,timeout:setTimeout(function(){en.timeout=void 0,et.dispatch(ve(Ot,kt))},$t)}}}}function ft(Se,et){var kt=Se.queryCacheKey,Ot=et.getState()[ee].queries[kt];if(Ot&&Ot.status!==t.uninitialized){var $t=He(dt.currentSubscriptions[kt]);if(Number.isFinite($t)){var Xt=st[kt],tn=Date.now()+$t;(!Xt||tn<Xt.nextPollTimestamp)&&Vt({queryCacheKey:kt},et)}else yt(kt)}}function yt(Se){var et=st[Se];et!=null&&et.timeout&&clearTimeout(et.timeout),delete st[Se]}function He(Se){Se===void 0&&(Se={});var et=Number.POSITIVE_INFINITY;for(var kt in Se)Se[kt].pollingInterval&&(et=Math.min(Se[kt].pollingInterval,et));return et}return function(Se,et){(je.internalActions.updateSubscriptionOptions.match(Se)||je.internalActions.unsubscribeQueryResult.match(Se))&&ft(Se.payload,et),(ge.pending.match(Se)||ge.rejected.match(Se)&&Se.meta.condition)&&ft(Se.meta.arg,et),(ge.fulfilled.match(Se)||ge.rejected.match(Se)&&!Se.meta.condition)&&Vt(Se.meta.arg,et),je.util.resetApiState.match(Se)&&function(){for(var kt=0,Ot=Object.keys(st);kt<Ot.length;kt++)yt(Ot[kt])}()}},Hn=I(Wo),Wn=new Error("Promise never resolved before cacheEntryRemoved."),Vn=function(J){var ee=J.api,ge=J.reducerPath,je=J.context,ve=J.queryThunk,dt=J.mutationThunk,st=(0,Hn.isAsyncThunkAction)(ve),Vt=(0,Hn.isAsyncThunkAction)(dt),ft=(0,Hn.isFulfilled)(ve,dt),yt={};function He(Se,et,kt,Ot,$t){var Xt=je.endpointDefinitions[Se],tn=Xt==null?void 0:Xt.onCacheEntryAdded;if(tn){var en={},qt=new Promise(function(Kt){en.cacheEntryRemoved=Kt}),Be=Promise.race([new Promise(function(Kt){en.valueResolved=Kt}),qt.then(function(){throw Wn})]);Be.catch(function(){}),yt[kt]=en;var vt=ee.endpoints[Se].select(Xt.type===W.query?et:kt),Dt=Ot.dispatch(function(Kt,un,sn){return sn}),Ut=k(C({},Ot),{getCacheEntry:function(){return vt(Ot.getState())},requestId:$t,extra:Dt,updateCachedData:Xt.type===W.query?function(Kt){return Ot.dispatch(ee.util.updateQueryData(Se,et,Kt))}:void 0,cacheDataLoaded:Be,cacheEntryRemoved:qt}),In=tn(et,Ut);Promise.resolve(In).catch(function(Kt){if(Kt!==Wn)throw Kt})}}return function(Se,et,kt){var Ot=function(vt){return st(vt)?vt.meta.arg.queryCacheKey:Vt(vt)?vt.meta.requestId:ee.internalActions.removeQueryResult.match(vt)?vt.payload.queryCacheKey:ee.internalActions.removeMutationResult.match(vt)?ye(vt.payload):""}(Se);if(ve.pending.match(Se)){var $t=kt[ge].queries[Ot],Xt=et.getState()[ge].queries[Ot];!$t&&Xt&&He(Se.meta.arg.endpointName,Se.meta.arg.originalArgs,Ot,et,Se.meta.requestId)}else if(dt.pending.match(Se))(Xt=et.getState()[ge].mutations[Ot])&&He(Se.meta.arg.endpointName,Se.meta.arg.originalArgs,Ot,et,Se.meta.requestId);else if(ft(Se))(Be=yt[Ot])!=null&&Be.valueResolved&&(Be.valueResolved({data:Se.payload,meta:Se.meta.baseQueryMeta}),delete Be.valueResolved);else if(ee.internalActions.removeQueryResult.match(Se)||ee.internalActions.removeMutationResult.match(Se))(Be=yt[Ot])&&(delete yt[Ot],Be.cacheEntryRemoved());else if(ee.util.resetApiState.match(Se))for(var tn=0,en=Object.entries(yt);tn<en.length;tn++){var qt=en[tn],Be=qt[1];delete yt[qt[0]],Be.cacheEntryRemoved()}}},Lr=I(Wo),Lo=function(J){var ee=J.api,ge=J.context,je=J.queryThunk,ve=J.mutationThunk,dt=(0,Lr.isPending)(je,ve),st=(0,Lr.isRejected)(je,ve),Vt=(0,Lr.isFulfilled)(je,ve),ft={};return function(yt,He){var Se,et,kt;if(dt(yt)){var Ot=yt.meta,$t=Ot.requestId,Xt=Ot.arg,tn=Xt.endpointName,en=Xt.originalArgs,qt=ge.endpointDefinitions[tn],Be=qt==null?void 0:qt.onQueryStarted;if(Be){var vt={},Dt=new Promise(function(Zn,Pt){vt.resolve=Zn,vt.reject=Pt});Dt.catch(function(){}),ft[$t]=vt;var Ut=ee.endpoints[tn].select(qt.type===W.query?en:$t),In=He.dispatch(function(Zn,Pt,En){return En}),Kt=k(C({},He),{getCacheEntry:function(){return Ut(He.getState())},requestId:$t,extra:In,updateCachedData:qt.type===W.query?function(Zn){return He.dispatch(ee.util.updateQueryData(tn,en,Zn))}:void 0,queryFulfilled:Dt});Be(en,Kt)}}else if(Vt(yt)){var un=yt.meta,sn=un.baseQueryMeta;(Se=ft[$t=un.requestId])==null||Se.resolve({data:yt.payload,meta:sn}),delete ft[$t]}else if(st(yt)){var Mr=yt.meta;sn=Mr.baseQueryMeta,(kt=ft[$t=Mr.requestId])==null||kt.reject({error:(et=yt.payload)!=null?et:yt.error,isUnhandledError:!Mr.rejectedWithValue,meta:sn}),delete ft[$t]}}},Gr=function(J){var ee=J.api,ge=J.context.apiUid;return function(je,ve){ee.util.resetApiState.match(je)&&ve.dispatch(ee.internalActions.middlewareRegistered(ge))}},qr=I(dd),js=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof fc<"u"?fc:globalThis):function(J){return(Ft||(Ft=Promise.resolve())).then(J).catch(function(ee){return setTimeout(function(){throw ee},0)})};function Fr(J){for(var ee=[],ge=1;ge<arguments.length;ge++)ee[ge-1]=arguments[ge];Object.assign.apply(Object,o([J],ee))}var na=I(dd),_s=Symbol(),Ta=function(){return{name:_s,init:function(J,ee,ge){var je=ee.baseQuery,ve=ee.reducerPath,dt=ee.serializeQueryArgs,st=ee.keepUnusedDataFor,Vt=ee.refetchOnMountOrArgChange,ft=ee.refetchOnFocus,yt=ee.refetchOnReconnect;(0,na.enablePatches)();var He=function(Pt){return Pt};Object.assign(J,{reducerPath:ve,endpoints:{},internalActions:{onOnline:Y,onOffline:ce,onFocus:q,onFocusLost:te},util:{}});var Se=function(Pt){var En=this,Rn=Pt.reducerPath,er=Pt.baseQuery,hr=Pt.context.endpointDefinitions,Tn=Pt.serializeQueryArgs,$n=Pt.api,dn=function(Ye,Mt){return O(En,[Ye,Mt],function(Ct,at){var wt,Bt,ht,ot,Ae,Re,Le,Ve,nt,At,Rt,Ue,nn,yn=at.signal,hn=at.abort,mr=at.rejectWithValue,Xn=at.fulfillWithValue,gn=at.dispatch,Un=at.getState,po=at.extra;return r(this,function(fn){switch(fn.label){case 0:wt=hr[Ct.endpointName],fn.label=1;case 1:return fn.trys.push([1,8,,13]),Bt=It,ht=void 0,ot={signal:yn,abort:hn,dispatch:gn,getState:Un,extra:po,endpoint:Ct.endpointName,type:Ct.type,forced:Ct.type==="query"?Sn(Ct,Un()):void 0},(Ae=Ct.type==="query"?Ct[xe]:void 0)?(ht=Ae(),[3,6]):[3,2];case 2:return wt.query?[4,er(wt.query(Ct.originalArgs),ot,wt.extraOptions)]:[3,4];case 3:return ht=fn.sent(),wt.transformResponse&&(Bt=wt.transformResponse),[3,6];case 4:return[4,wt.queryFn(Ct.originalArgs,ot,wt.extraOptions,function(Ln){return er(Ln,ot,wt.extraOptions)})];case 5:ht=fn.sent(),fn.label=6;case 6:if(ht.error)throw new Q(ht.error,ht.meta);return Re=Xn,[4,Bt(ht.data,ht.meta,Ct.originalArgs)];case 7:return[2,Re.apply(void 0,[fn.sent(),(Ue={fulfilledTimeStamp:Date.now(),baseQueryMeta:ht.meta},Ue[Xe.SHOULD_AUTOBATCH]=!0,Ue)])];case 8:if(Le=fn.sent(),!((Ve=Le)instanceof Q))return[3,12];nt=It,wt.query&&wt.transformErrorResponse&&(nt=wt.transformErrorResponse),fn.label=9;case 9:return fn.trys.push([9,11,,12]),At=mr,[4,nt(Ve.value,Ve.meta,Ct.originalArgs)];case 10:return[2,At.apply(void 0,[fn.sent(),(nn={baseQueryMeta:Ve.meta},nn[Xe.SHOULD_AUTOBATCH]=!0,nn)])];case 11:return Rt=fn.sent(),Ve=Rt,[3,12];case 12:throw console.error(Ve),Ve;case 13:return[2]}})})};function Sn(Ye,Mt){var Ct,at,wt,Bt,ht=(at=(Ct=Mt[Rn])==null?void 0:Ct.queries)==null?void 0:at[Ye.queryCacheKey],ot=(wt=Mt[Rn])==null?void 0:wt.config.refetchOnMountOrArgChange,Ae=ht==null?void 0:ht.fulfilledTimeStamp,Re=(Bt=Ye.forceRefetch)!=null?Bt:Ye.subscribe&&ot;return!!Re&&(Re===!0||(Number(new Date)-Number(Ae))/1e3>=Re)}var On=(0,Xe.createAsyncThunk)(Rn+"/executeQuery",dn,{getPendingMeta:function(){var Ye;return(Ye={startedTimeStamp:Date.now()})[Xe.SHOULD_AUTOBATCH]=!0,Ye},condition:function(Ye,Mt){var Ct,at,wt,Bt=(0,Mt.getState)(),ht=(at=(Ct=Bt[Rn])==null?void 0:Ct.queries)==null?void 0:at[Ye.queryCacheKey],ot=ht==null?void 0:ht.fulfilledTimeStamp,Ae=Ye.originalArgs,Re=ht==null?void 0:ht.originalArgs,Le=hr[Ye.endpointName];return!(!de(Ye)&&((ht==null?void 0:ht.status)==="pending"||!Sn(Ye,Bt)&&(!oe(Le)||!((wt=Le==null?void 0:Le.forceRefetch)!=null&&wt.call(Le,{currentArg:Ae,previousArg:Re,endpointState:ht,state:Bt})))&&ot))},dispatchConditionRejection:!0}),bn=(0,Xe.createAsyncThunk)(Rn+"/executeMutation",dn,{getPendingMeta:function(){var Ye;return(Ye={startedTimeStamp:Date.now()})[Xe.SHOULD_AUTOBATCH]=!0,Ye}});function xn(Ye){return function(Mt){var Ct,at;return((at=(Ct=Mt==null?void 0:Mt.meta)==null?void 0:Ct.arg)==null?void 0:at.endpointName)===Ye}}return{queryThunk:On,mutationThunk:bn,prefetch:function(Ye,Mt,Ct){return function(at,wt){var Bt=function(Le){return"force"in Le}(Ct)&&Ct.force,ht=function(Le){return"ifOlderThan"in Le}(Ct)&&Ct.ifOlderThan,ot=function(Le){return Le===void 0&&(Le=!0),$n.endpoints[Ye].initiate(Mt,{forceRefetch:Le})},Ae=$n.endpoints[Ye].select(Mt)(wt());if(Bt)at(ot());else if(ht){var Re=Ae==null?void 0:Ae.fulfilledTimeStamp;if(!Re)return void at(ot());(Number(new Date)-Number(new Date(Re)))/1e3>=ht&&at(ot())}else at(ot(!1))}},updateQueryData:function(Ye,Mt,Ct){return function(at,wt){var Bt,ht,ot=$n.endpoints[Ye].select(Mt)(wt()),Ae={patches:[],inversePatches:[],undo:function(){return at($n.util.patchQueryData(Ye,Mt,Ae.inversePatches))}};if(ot.status===t.uninitialized)return Ae;if("data"in ot)if((0,De.isDraftable)(ot.data)){var Re=(0,De.produceWithPatches)(ot.data,Ct),Le=Re[2];(Bt=Ae.patches).push.apply(Bt,Re[1]),(ht=Ae.inversePatches).push.apply(ht,Le)}else{var Ve=Ct(ot.data);Ae.patches.push({op:"replace",path:[],value:Ve}),Ae.inversePatches.push({op:"replace",path:[],value:ot.data})}return at($n.util.patchQueryData(Ye,Mt,Ae.patches)),Ae}},upsertQueryData:function(Ye,Mt,Ct){return function(at){var wt;return at($n.endpoints[Ye].initiate(Mt,((wt={subscribe:!1,forceRefetch:!0})[xe]=function(){return{data:Ct}},wt)))}},patchQueryData:function(Ye,Mt,Ct){return function(at){at($n.internalActions.queryResultPatched({queryCacheKey:Tn({queryArgs:Mt,endpointDefinition:hr[Ye],endpointName:Ye}),patches:Ct}))}},buildMatchThunkActions:function(Ye,Mt){return{matchPending:(0,Ne.isAllOf)((0,Ne.isPending)(Ye),xn(Mt)),matchFulfilled:(0,Ne.isAllOf)((0,Ne.isFulfilled)(Ye),xn(Mt)),matchRejected:(0,Ne.isAllOf)((0,Ne.isRejected)(Ye),xn(Mt))}}}}({baseQuery:je,reducerPath:ve,context:ge,api:J,serializeQueryArgs:dt}),et=Se.queryThunk,kt=Se.mutationThunk,Ot=Se.patchQueryData,$t=Se.updateQueryData,Xt=Se.upsertQueryData,tn=Se.prefetch,en=Se.buildMatchThunkActions,qt=function(Pt){var En=Pt.reducerPath,Rn=Pt.queryThunk,er=Pt.mutationThunk,hr=Pt.context,Tn=hr.endpointDefinitions,$n=hr.apiUid,dn=hr.extractRehydrationInfo,Sn=hr.hasRehydrationInfo,On=Pt.assertTagType,bn=Pt.config,xn=(0,he.createAction)(En+"/resetApiState"),Ye=(0,he.createSlice)({name:En+"/queries",initialState:Et,reducers:{removeQueryResult:{reducer:function(ot,Ae){delete ot[Ae.payload.queryCacheKey]},prepare:(0,he.prepareAutoBatched)()},queryResultPatched:function(ot,Ae){var Re=Ae.payload,Le=Re.patches;bt(ot,Re.queryCacheKey,function(Ve){Ve.data=(0,gt.applyPatches)(Ve.data,Le.concat())})}},extraReducers:function(ot){ot.addCase(Rn.pending,function(Ae,Re){var Le,Ve=Re.meta,nt=Re.meta.arg,At=de(nt);(nt.subscribe||At)&&(Ae[Le=nt.queryCacheKey]!=null||(Ae[Le]={status:t.uninitialized,endpointName:nt.endpointName})),bt(Ae,nt.queryCacheKey,function(Rt){Rt.status=t.pending,Rt.requestId=At&&Rt.requestId?Rt.requestId:Ve.requestId,nt.originalArgs!==void 0&&(Rt.originalArgs=nt.originalArgs),Rt.startedTimeStamp=Ve.startedTimeStamp})}).addCase(Rn.fulfilled,function(Ae,Re){var Le=Re.meta,Ve=Re.payload;bt(Ae,Le.arg.queryCacheKey,function(nt){var At;if(nt.requestId===Le.requestId||de(Le.arg)){var Rt=Tn[Le.arg.endpointName].merge;if(nt.status=t.fulfilled,Rt)if(nt.data!==void 0){var Ue=Le.fulfilledTimeStamp,nn=Le.arg,yn=Le.baseQueryMeta,hn=Le.requestId,mr=(0,he.createNextState)(nt.data,function(Xn){return Rt(Xn,Ve,{arg:nn.originalArgs,baseQueryMeta:yn,fulfilledTimeStamp:Ue,requestId:hn})});nt.data=mr}else nt.data=Ve;else nt.data=(At=Tn[Le.arg.endpointName].structuralSharing)==null||At?R((0,on.isDraft)(nt.data)?(0,gt.original)(nt.data):nt.data,Ve):Ve;delete nt.error,nt.fulfilledTimeStamp=Le.fulfilledTimeStamp}})}).addCase(Rn.rejected,function(Ae,Re){var Le=Re.meta,Ve=Le.condition,nt=Le.requestId,At=Re.error,Rt=Re.payload;bt(Ae,Le.arg.queryCacheKey,function(Ue){if(!Ve){if(Ue.requestId!==nt)return;Ue.status=t.rejected,Ue.error=Rt??At}})}).addMatcher(Sn,function(Ae,Re){for(var Le=dn(Re).queries,Ve=0,nt=Object.entries(Le);Ve<nt.length;Ve++){var At=nt[Ve],Rt=At[1];(Rt==null?void 0:Rt.status)!==t.fulfilled&&(Rt==null?void 0:Rt.status)!==t.rejected||(Ae[At[0]]=Rt)}})}}),Mt=(0,he.createSlice)({name:En+"/mutations",initialState:Et,reducers:{removeMutationResult:{reducer:function(ot,Ae){var Re=ye(Ae.payload);Re in ot&&delete ot[Re]},prepare:(0,he.prepareAutoBatched)()}},extraReducers:function(ot){ot.addCase(er.pending,function(Ae,Re){var Le=Re.meta,Ve=Le.requestId,nt=Le.arg,At=Le.startedTimeStamp;nt.track&&(Ae[ye(Re.meta)]={requestId:Ve,status:t.pending,endpointName:nt.endpointName,startedTimeStamp:At})}).addCase(er.fulfilled,function(Ae,Re){var Le=Re.payload,Ve=Re.meta;Ve.arg.track&&We(Ae,Ve,function(nt){nt.requestId===Ve.requestId&&(nt.status=t.fulfilled,nt.data=Le,nt.fulfilledTimeStamp=Ve.fulfilledTimeStamp)})}).addCase(er.rejected,function(Ae,Re){var Le=Re.payload,Ve=Re.error,nt=Re.meta;nt.arg.track&&We(Ae,nt,function(At){At.requestId===nt.requestId&&(At.status=t.rejected,At.error=Le??Ve)})}).addMatcher(Sn,function(Ae,Re){for(var Le=dn(Re).mutations,Ve=0,nt=Object.entries(Le);Ve<nt.length;Ve++){var At=nt[Ve],Rt=At[0],Ue=At[1];(Ue==null?void 0:Ue.status)!==t.fulfilled&&(Ue==null?void 0:Ue.status)!==t.rejected||Rt===(Ue==null?void 0:Ue.requestId)||(Ae[Rt]=Ue)}})}}),Ct=(0,he.createSlice)({name:En+"/invalidation",initialState:Et,reducers:{},extraReducers:function(ot){ot.addCase(Ye.actions.removeQueryResult,function(Ae,Re){for(var Le=Re.payload.queryCacheKey,Ve=0,nt=Object.values(Ae);Ve<nt.length;Ve++)for(var At=0,Rt=Object.values(nt[Ve]);At<Rt.length;At++){var Ue=Rt[At],nn=Ue.indexOf(Le);nn!==-1&&Ue.splice(nn,1)}}).addMatcher(Sn,function(Ae,Re){for(var Le,Ve,nt,At,Rt=dn(Re).provided,Ue=0,nn=Object.entries(Rt);Ue<nn.length;Ue++)for(var yn=nn[Ue],hn=yn[0],mr=0,Xn=Object.entries(yn[1]);mr<Xn.length;mr++)for(var gn=Xn[mr],Un=gn[0],po=gn[1],fn=(At=(Ve=(Le=Ae[hn])!=null?Le:Ae[hn]={})[nt=Un||"__internal_without_id"])!=null?At:Ve[nt]=[],Ln=0,Kr=po;Ln<Kr.length;Ln++){var Rr=Kr[Ln];fn.includes(Rr)||fn.push(Rr)}}).addMatcher((0,he.isAnyOf)((0,he.isFulfilled)(Rn),(0,he.isRejectedWithValue)(Rn)),function(Ae,Re){for(var Le,Ve,nt,At,Rt=lt(Re,"providesTags",Tn,On),Ue=Re.meta.arg.queryCacheKey,nn=0,yn=Object.values(Ae);nn<yn.length;nn++)for(var hn=0,mr=Object.values(yn[nn]);hn<mr.length;hn++){var Xn=mr[hn],gn=Xn.indexOf(Ue);gn!==-1&&Xn.splice(gn,1)}for(var Un=0,po=Rt;Un<po.length;Un++){var fn=po[Un],Ln=fn.type,Kr=fn.id,Rr=(At=(Ve=(Le=Ae[Ln])!=null?Le:Ae[Ln]={})[nt=Kr||"__internal_without_id"])!=null?At:Ve[nt]=[];Rr.includes(Ue)||Rr.push(Ue)}})}}),at=(0,he.createSlice)({name:En+"/subscriptions",initialState:Et,reducers:{updateSubscriptionOptions:function(ot,Ae){},unsubscribeQueryResult:function(ot,Ae){},internal_probeSubscription:function(ot,Ae){}}}),wt=(0,he.createSlice)({name:En+"/internalSubscriptions",initialState:Et,reducers:{subscriptionsUpdated:{reducer:function(ot,Ae){return(0,gt.applyPatches)(ot,Ae.payload)},prepare:(0,he.prepareAutoBatched)()}}}),Bt=(0,he.createSlice)({name:En+"/config",initialState:C({online:typeof navigator>"u"||navigator.onLine===void 0||navigator.onLine,focused:typeof document>"u"||document.visibilityState!=="hidden",middlewareRegistered:!1},bn),reducers:{middlewareRegistered:function(ot,Ae){ot.middlewareRegistered=ot.middlewareRegistered!=="conflict"&&$n===Ae.payload||"conflict"}},extraReducers:function(ot){ot.addCase(Y,function(Ae){Ae.online=!0}).addCase(ce,function(Ae){Ae.online=!1}).addCase(q,function(Ae){Ae.focused=!0}).addCase(te,function(Ae){Ae.focused=!1}).addMatcher(Sn,function(Ae){return C({},Ae)})}}),ht=(0,he.combineReducers)({queries:Ye.reducer,mutations:Mt.reducer,provided:Ct.reducer,subscriptions:wt.reducer,config:Bt.reducer});return{reducer:function(ot,Ae){return ht(xn.match(Ae)?void 0:ot,Ae)},actions:k(C(C(C(C(C({},Bt.actions),Ye.actions),at.actions),wt.actions),Mt.actions),{unsubscribeMutationResult:Mt.actions.removeMutationResult,resetApiState:xn})}}({context:ge,queryThunk:et,mutationThunk:kt,reducerPath:ve,assertTagType:He,config:{refetchOnFocus:ft,refetchOnReconnect:yt,refetchOnMountOrArgChange:Vt,keepUnusedDataFor:st,reducerPath:ve}}),Be=qt.reducer,vt=qt.actions;Fr(J.util,{patchQueryData:Ot,updateQueryData:$t,upsertQueryData:Xt,prefetch:tn,resetApiState:vt.resetApiState}),Fr(J.internalActions,vt);var Dt=function(Pt){var En=Pt.reducerPath,Rn=Pt.queryThunk,er=Pt.api,hr=Pt.context,Tn=hr.apiUid,$n={invalidateTags:(0,ir.createAction)(En+"/invalidateTags")},dn=[Gr,pn,Ur,wr,Vn,Lo];return{middleware:function(On){var bn=!1,xn=k(C({},Pt),{internalState:{currentSubscriptions:{}},refetchQuery:Sn}),Ye=dn.map(function(at){return at(xn)}),Mt=function(at){var wt=at.api,Bt=at.queryThunk,ht=at.internalState,ot=wt.reducerPath+"/subscriptions",Ae=null,Re=!1,Le=wt.internalActions,Ve=Le.updateSubscriptionOptions,nt=Le.unsubscribeQueryResult;return function(At,Rt){var Ue,nn;if(Ae||(Ae=JSON.parse(JSON.stringify(ht.currentSubscriptions))),wt.util.resetApiState.match(At))return Ae=ht.currentSubscriptions={},[!0,!1];if(wt.internalActions.internal_probeSubscription.match(At)){var yn=At.payload;return[!1,!!((Ue=ht.currentSubscriptions[yn.queryCacheKey])!=null&&Ue[yn.requestId])]}var hn=function(gn,Un){var po,fn,Ln,Kr,Rr,vi,Tf,Fo,$a;if(Ve.match(Un)){var oa=Un.payload,La=oa.queryCacheKey,ho=oa.requestId;return(po=gn==null?void 0:gn[La])!=null&&po[ho]&&(gn[La][ho]=oa.options),!0}if(nt.match(Un)){var mo=Un.payload;return ho=mo.requestId,gn[La=mo.queryCacheKey]&&delete gn[La][ho],!0}if(wt.internalActions.removeQueryResult.match(Un))return delete gn[Un.payload.queryCacheKey],!0;if(Bt.pending.match(Un)){var go=Un.meta;if(ho=go.requestId,(eo=go.arg).subscribe)return(Zo=(Ln=gn[fn=eo.queryCacheKey])!=null?Ln:gn[fn]={})[ho]=(Rr=(Kr=eo.subscriptionOptions)!=null?Kr:Zo[ho])!=null?Rr:{},!0}if(Bt.rejected.match(Un)){var Zo,zo=Un.meta,eo=zo.arg;if(ho=zo.requestId,zo.condition&&eo.subscribe)return(Zo=(Tf=gn[vi=eo.queryCacheKey])!=null?Tf:gn[vi]={})[ho]=($a=(Fo=eo.subscriptionOptions)!=null?Fo:Zo[ho])!=null?$a:{},!0}return!1}(ht.currentSubscriptions,At);if(hn){Re||(js(function(){var gn=JSON.parse(JSON.stringify(ht.currentSubscriptions)),Un=(0,qr.produceWithPatches)(Ae,function(){return gn});Rt.next(wt.internalActions.subscriptionsUpdated(Un[1])),Ae=gn,Re=!1}),Re=!0);var mr=!!((nn=At.type)!=null&&nn.startsWith(ot)),Xn=Bt.rejected.match(At)&&At.meta.condition&&!!At.meta.arg.subscribe;return[!mr&&!Xn,!1]}return[!0,!1]}}(xn),Ct=function(at){var wt=at.reducerPath,Bt=at.context,ht=at.refetchQuery,ot=at.internalState,Ae=at.api.internalActions.removeQueryResult;function Re(Le,Ve){var nt=Le.getState()[wt],At=nt.queries,Rt=ot.currentSubscriptions;Bt.batch(function(){for(var Ue=0,nn=Object.keys(Rt);Ue<nn.length;Ue++){var yn=nn[Ue],hn=At[yn],mr=Rt[yn];mr&&hn&&(Object.values(mr).some(function(Xn){return Xn[Ve]===!0})||Object.values(mr).every(function(Xn){return Xn[Ve]===void 0})&&nt.config[Ve])&&(Object.keys(mr).length===0?Le.dispatch(Ae({queryCacheKey:yn})):hn.status!==t.uninitialized&&Le.dispatch(ht(hn,yn)))}})}return function(Le,Ve){q.match(Le)&&Re(Ve,"refetchOnFocus"),Y.match(Le)&&Re(Ve,"refetchOnReconnect")}}(xn);return function(at){return function(wt){bn||(bn=!0,On.dispatch(er.internalActions.middlewareRegistered(Tn)));var Bt,ht=k(C({},On),{next:at}),ot=On.getState(),Ae=Mt(wt,ht,ot),Re=Ae[1];if(Bt=Ae[0]?at(wt):Re,On.getState()[En]&&(Ct(wt,ht,ot),function(nt){return!!nt&&typeof nt.type=="string"&&nt.type.startsWith(En+"/")}(wt)||hr.hasRehydrationInfo(wt)))for(var Le=0,Ve=Ye;Le<Ve.length;Le++)(0,Ve[Le])(wt,ht,ot);return Bt}}},actions:$n};function Sn(On,bn,xn){return xn===void 0&&(xn={}),Rn(C({type:"query",endpointName:On.endpointName,originalArgs:On.originalArgs,subscribe:!1,forceRefetch:!0,queryCacheKey:bn},xn))}}({reducerPath:ve,context:ge,queryThunk:et,mutationThunk:kt,api:J,assertTagType:He}),Ut=Dt.middleware;Fr(J.util,Dt.actions),Fr(J,{reducer:Be,middleware:Ut});var In=function(Pt){var En=Pt.serializeQueryArgs,Rn=Pt.reducerPath,er=function(dn){return Nt},hr=function(dn){return Lt};return{buildQuerySelector:function(dn,Sn){return function(On){var bn=En({queryArgs:On,endpointDefinition:Sn,endpointName:dn});return(0,ie.createSelector)(On===zt?er:function(xn){var Ye,Mt,Ct;return(Ct=(Mt=(Ye=$n(xn))==null?void 0:Ye.queries)==null?void 0:Mt[bn])!=null?Ct:Nt},Tn)}},buildMutationSelector:function(){return function(dn){var Sn,On;return On=typeof dn=="object"?(Sn=ye(dn))!=null?Sn:zt:dn,(0,ie.createSelector)(On===zt?hr:function(bn){var xn,Ye,Mt;return(Mt=(Ye=(xn=$n(bn))==null?void 0:xn.mutations)==null?void 0:Ye[On])!=null?Mt:Lt},Tn)}},selectInvalidatedBy:function(dn,Sn){for(var On,bn=dn[Rn],xn=new Set,Ye=0,Mt=Sn.map(fe);Ye<Mt.length;Ye++){var Ct=Mt[Ye],at=bn.provided[Ct.type];if(at)for(var wt=0,Bt=(On=Ct.id!==void 0?at[Ct.id]:E(Object.values(at)))!=null?On:[];wt<Bt.length;wt++)xn.add(Bt[wt])}return E(Array.from(xn.values()).map(function(ht){var ot=bn.queries[ht];return ot?[{queryCacheKey:ht,endpointName:ot.endpointName,originalArgs:ot.originalArgs}]:[]}))}};function Tn(dn){return C(C({},dn),{status:Sn=dn.status,isUninitialized:Sn===t.uninitialized,isLoading:Sn===t.pending,isSuccess:Sn===t.fulfilled,isError:Sn===t.rejected});var Sn}function $n(dn){return dn[Rn]}}({serializeQueryArgs:dt,reducerPath:ve}),Kt=In.buildQuerySelector,un=In.buildMutationSelector;Fr(J.util,{selectInvalidatedBy:In.selectInvalidatedBy});var sn=function(Pt){var En=Pt.serializeQueryArgs,Rn=Pt.queryThunk,er=Pt.mutationThunk,hr=Pt.api,Tn=Pt.context,$n=new Map,dn=new Map,Sn=hr.internalActions,On=Sn.unsubscribeQueryResult,bn=Sn.removeMutationResult,xn=Sn.updateSubscriptionOptions;return{buildInitiateQuery:function(Ye,Mt){var Ct=function(at,wt){var Bt=wt===void 0?{}:wt,ht=Bt.subscribe,ot=ht===void 0||ht,Ae=Bt.forceRefetch,Re=Bt.subscriptionOptions,Le=Bt[xe];return function(Ve,nt){var At,Rt,Ue=En({queryArgs:at,endpointDefinition:Mt,endpointName:Ye}),nn=Rn(((At={type:"query",subscribe:ot,forceRefetch:Ae,subscriptionOptions:Re,endpointName:Ye,originalArgs:at,queryCacheKey:Ue})[xe]=Le,At)),yn=hr.endpoints[Ye].select(at),hn=Ve(nn),mr=yn(nt()),Xn=hn.requestId,gn=hn.abort,Un=mr.requestId!==Xn,po=(Rt=$n.get(Ve))==null?void 0:Rt[Ue],fn=function(){return yn(nt())},Ln=Object.assign(Le?hn.then(fn):Un&&!po?Promise.resolve(mr):Promise.all([po,hn]).then(fn),{arg:at,requestId:Xn,subscriptionOptions:Re,queryCacheKey:Ue,abort:gn,unwrap:function(){return O(this,null,function(){var Rr;return r(this,function(vi){switch(vi.label){case 0:return[4,Ln];case 1:if((Rr=vi.sent()).isError)throw Rr.error;return[2,Rr.data]}})})},refetch:function(){return Ve(Ct(at,{subscribe:!1,forceRefetch:!0}))},unsubscribe:function(){ot&&Ve(On({queryCacheKey:Ue,requestId:Xn}))},updateSubscriptionOptions:function(Rr){Ln.subscriptionOptions=Rr,Ve(xn({endpointName:Ye,requestId:Xn,queryCacheKey:Ue,options:Rr}))}});if(!po&&!Un&&!Le){var Kr=$n.get(Ve)||{};Kr[Ue]=Ln,$n.set(Ve,Kr),Ln.then(function(){delete Kr[Ue],Object.keys(Kr).length||$n.delete(Ve)})}return Ln}};return Ct},buildInitiateMutation:function(Ye){return function(Mt,Ct){var at=Ct===void 0?{}:Ct,wt=at.track,Bt=wt===void 0||wt,ht=at.fixedCacheKey;return function(ot,Ae){var Re=er({type:"mutation",endpointName:Ye,originalArgs:Mt,track:Bt,fixedCacheKey:ht}),Le=ot(Re),Ve=Le.requestId,nt=Le.abort,At=Le.unwrap,Rt=Le.unwrap().then(function(hn){return{data:hn}}).catch(function(hn){return{error:hn}}),Ue=function(){ot(bn({requestId:Ve,fixedCacheKey:ht}))},nn=Object.assign(Rt,{arg:Le.arg,requestId:Ve,abort:nt,unwrap:At,unsubscribe:Ue,reset:Ue}),yn=dn.get(ot)||{};return dn.set(ot,yn),yn[Ve]=nn,nn.then(function(){delete yn[Ve],Object.keys(yn).length||dn.delete(ot)}),ht&&(yn[ht]=nn,nn.then(function(){yn[ht]===nn&&(delete yn[ht],Object.keys(yn).length||dn.delete(ot))})),nn}}},getRunningQueryThunk:function(Ye,Mt){return function(Ct){var at,wt=En({queryArgs:Mt,endpointDefinition:Tn.endpointDefinitions[Ye],endpointName:Ye});return(at=$n.get(Ct))==null?void 0:at[wt]}},getRunningMutationThunk:function(Ye,Mt){return function(Ct){var at;return(at=dn.get(Ct))==null?void 0:at[Mt]}},getRunningQueriesThunk:function(){return function(Ye){return Object.values($n.get(Ye)||{}).filter(Ce)}},getRunningMutationsThunk:function(){return function(Ye){return Object.values(dn.get(Ye)||{}).filter(Ce)}},getRunningOperationPromises:function(){var Ye=function(Mt){return Array.from(Mt.values()).flatMap(function(Ct){return Ct?Object.values(Ct):[]})};return o(o([],Ye($n)),Ye(dn)).filter(Ce)},removalWarning:function(){throw new Error(`This method had to be removed due to a conceptual bug in RTK.
Please see https://github.com/reduxjs/redux-toolkit/pull/2481 for details.
See https://redux-toolkit.js.org/rtk-query/usage/server-side-rendering for new guidance on SSR.`)}}}({queryThunk:et,mutationThunk:kt,api:J,serializeQueryArgs:dt,context:ge}),Mr=sn.buildInitiateQuery,Zn=sn.buildInitiateMutation;return Fr(J.util,{getRunningOperationPromises:sn.getRunningOperationPromises,getRunningOperationPromise:sn.removalWarning,getRunningMutationThunk:sn.getRunningMutationThunk,getRunningMutationsThunk:sn.getRunningMutationsThunk,getRunningQueryThunk:sn.getRunningQueryThunk,getRunningQueriesThunk:sn.getRunningQueriesThunk}),{name:_s,injectEndpoint:function(Pt,En){var Rn,er=J;(Rn=er.endpoints)[Pt]!=null||(Rn[Pt]={}),oe(En)?Fr(er.endpoints[Pt],{name:Pt,select:Kt(Pt,En),initiate:Mr(Pt,En)},en(et,Pt)):En.type===W.mutation&&Fr(er.endpoints[Pt],{name:Pt,select:un(),initiate:Zn(Pt)},en(kt,Pt))}}}}},ra=Qe(Ta())})(jO);kO.exports=jO;var Yo=kO.exports;const Aee=e=>{const{boardToDelete:t,setBoardToDelete:n}=e,{t:r}=Ie(),o=z(j=>j.config.canRestoreDeletedImagesFromBin),{currentData:s,isFetching:i}=dR((t==null?void 0:t.board_id)??Yo.skipToken),c=u.useMemo(()=>le([ke],j=>{const _=(s??[]).map(O=>W_(j,O));return{imageUsageSummary:{isInitialImage:$s(_,O=>O.isInitialImage),isCanvasImage:$s(_,O=>O.isCanvasImage),isNodesImage:$s(_,O=>O.isNodesImage),isControlNetImage:$s(_,O=>O.isControlNetImage)}}}),[s]),[f,{isLoading:p}]=fR(),[h,{isLoading:m}]=pR(),{imageUsageSummary:v}=z(c),b=u.useCallback(()=>{t&&(f(t.board_id),n(void 0))},[t,f,n]),y=u.useCallback(()=>{t&&(h(t.board_id),n(void 0))},[t,h,n]),x=u.useCallback(()=>{n(void 0)},[n]),C=u.useRef(null),k=u.useMemo(()=>m||p||i,[m,p,i]);return t?a.jsx(Cf,{isOpen:!!t,onClose:x,leastDestructiveRef:C,isCentered:!0,children:a.jsx(Ks,{children:a.jsxs(Sf,{children:[a.jsxs(qs,{fontSize:"lg",fontWeight:"bold",children:["Delete ",t.board_name]}),a.jsx(Xs,{children:a.jsxs($,{direction:"column",gap:3,children:[i?a.jsx(hg,{children:a.jsx($,{sx:{w:"full",h:32}})}):a.jsx(EE,{imageUsage:v,topMessage:"This board contains images used in the following features:",bottomMessage:"Deleting this board and its images will reset any features currently using them."}),a.jsx(Ee,{children:"Deleted boards cannot be restored."}),a.jsx(Ee,{children:r(o?"gallery.deleteImageBin":"gallery.deleteImagePermanent")})]})}),a.jsx(ka,{children:a.jsxs($,{sx:{justifyContent:"space-between",width:"full",gap:2},children:[a.jsx(Wt,{ref:C,onClick:x,children:"Cancel"}),a.jsx(Wt,{colorScheme:"warning",isLoading:k,onClick:b,children:"Delete Board Only"}),a.jsx(Wt,{colorScheme:"error",isLoading:k,onClick:y,children:"Delete Board and Images"})]})})]})})}):null},Nee=u.memo(Aee),Tee="My Board",$ee=()=>{const[e,{isLoading:t}]=hR(),n=u.useCallback(()=>{e(Tee)},[e]);return a.jsx(tt,{icon:a.jsx(Yl,{}),isLoading:t,tooltip:"Add Board","aria-label":"Add Board",onClick:n,size:"sm"})},Lee=u.memo($ee);var _O=ff({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"})]})}),Lg=ff({d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z",displayName:"ChevronUpIcon"}),Fee=ff({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"}),zee=ff({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"})})}),Bee=ff({displayName:"ChevronDownIcon",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"});const Hee=le([ke],({gallery:e})=>{const{boardSearchText:t}=e;return{boardSearchText:t}},Oe),Wee=()=>{const e=se(),{boardSearchText:t}=z(Hee),n=u.useRef(null),r=u.useCallback(c=>{e(eC(c))},[e]),o=u.useCallback(()=>{e(eC(""))},[e]),s=u.useCallback(c=>{c.key==="Escape"&&o()},[o]),i=u.useCallback(c=>{r(c.target.value)},[r]);return u.useEffect(()=>{n.current&&n.current.focus()},[]),a.jsxs(L5,{children:[a.jsx(ng,{ref:n,placeholder:"Search Boards...",value:t,onKeyDown:s,onChange:i}),t&&t.length&&a.jsx(Tx,{children:a.jsx(wa,{onClick:o,size:"xs",variant:"ghost","aria-label":"Clear Search",opacity:.5,icon:a.jsx(Fee,{boxSize:2})})})]})},Vee=u.memo(Wee);function Fy(e){return mR(e)}function Uee(e){return gR(e)}const zy=(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_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",c=e.context.boardId;return i!==c}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}},Gee=e=>{const{isOver:t,label:n="Drop"}=e,r=u.useRef(Fi()),{colorMode:o}=di();return a.jsx(yr.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:qe("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?qe("base.50","base.50")(o):qe("base.200","base.300")(o),borderRadius:"lg",borderStyle:"dashed",transitionProperty:"common",transitionDuration:"0.1s",alignItems:"center",justifyContent:"center"},children:a.jsx(Fe,{sx:{fontSize:"2xl",fontWeight:600,transform:t?"scale(1.1)":"scale(1)",color:t?qe("base.50","base.50")(o):qe("base.200","base.300")(o),transitionProperty:"common",transitionDuration:"0.1s"},children:n})})]})},r.current)},By=u.memo(Gee),qee=e=>{const{dropLabel:t,data:n,disabled:r}=e,o=u.useRef(Fi()),{isOver:s,setNodeRef:i,active:c}=Fy({id:o.current,disabled:r,data:n});return a.jsx(Fe,{ref:i,position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",pointerEvents:"none",children:a.jsx(co,{children:zy(n,c)&&a.jsx(By,{isOver:s,label:t})})})},Hy=u.memo(qee),Kee=({isSelected:e,isHovered:t})=>a.jsx(Fe,{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}}}),Wy=u.memo(Kee),Xee=()=>a.jsx($,{sx:{position:"absolute",insetInlineEnd:0,top:0,p:1},children:a.jsx(hi,{variant:"solid",sx:{bg:"accent.400",_dark:{bg:"accent.500"}},children:"auto"})}),PO=u.memo(Xee);function Vy(e){const[t,n]=u.useState(!1),[r,o]=u.useState(!1),[s,i]=u.useState(!1),[c,f]=u.useState([0,0]),p=u.useRef(null),h=z(v=>v.ui.globalContextMenuCloseTrigger);u.useEffect(()=>{if(t)setTimeout(()=>{o(!0),setTimeout(()=>{i(!0)})});else{i(!1);const v=setTimeout(()=>{o(t)},1e3);return()=>clearTimeout(v)}},[t]),u.useEffect(()=>{n(!1),i(!1),o(!1)},[h]),$L("contextmenu",v=>{var b;(b=p.current)!=null&&b.contains(v.target)||v.target===p.current?(v.preventDefault(),n(!0),f([v.pageX,v.pageY])):n(!1)});const m=u.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(uf,{...e.portalProps,children:a.jsxs(yf,{isOpen:s,gutter:0,...e.menuProps,onClose:m,children:[a.jsx(wf,{"aria-hidden":!0,w:1,h:1,style:{position:"absolute",left:c[0],top:c[1],cursor:"default"},...e.menuButtonProps}),e.renderMenu()]})})]})}const Fg=e=>{const{boardName:t}=Fm(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},Qee=({board:e,setBoardToDelete:t})=>{const n=u.useCallback(()=>{t&&t(e)},[e,t]);return a.jsxs(a.Fragment,{children:[e.image_count>0&&a.jsx(a.Fragment,{}),a.jsx(Bn,{sx:{color:"error.600",_dark:{color:"error.300"}},icon:a.jsx(Jo,{}),onClick:n,children:"Delete Board"})]})},Yee=u.memo(Qee),Jee=()=>a.jsx(a.Fragment,{}),Zee=u.memo(Jee),ete=({board:e,board_id:t,setBoardToDelete:n,children:r})=>{const o=se(),s=u.useMemo(()=>le(ke,({gallery:v,system:b})=>{const y=v.autoAddBoardId===t,x=b.isProcessing,C=v.autoAssignBoardOnClick;return{isAutoAdd:y,isProcessing:x,autoAssignBoardOnClick:C}},Oe),[t]),{isAutoAdd:i,isProcessing:c,autoAssignBoardOnClick:f}=z(s),p=Fg(t),h=u.useCallback(()=>{o(Bm(t))},[t,o]),m=u.useCallback(v=>{v.preventDefault()},[]);return a.jsx(Vy,{menuProps:{size:"sm",isLazy:!0},menuButtonProps:{bg:"transparent",_hover:{bg:"transparent"}},renderMenu:()=>a.jsx(Ui,{sx:{visibility:"visible !important"},motionProps:au,onContextMenu:m,children:a.jsxs(fu,{title:p,children:[a.jsx(Bn,{icon:a.jsx(Yl,{}),isDisabled:i||c||f,onClick:h,children:"Auto-add to this Board"}),!e&&a.jsx(Zee,{}),e&&a.jsx(Yee,{board:e,setBoardToDelete:n})]})}),children:r})},IO=u.memo(ete),tte=({board:e,isSelected:t,setBoardToDelete:n})=>{const r=se(),o=u.useMemo(()=>le(ke,({gallery:D,system:T})=>{const K=e.board_id===D.autoAddBoardId,B=D.autoAssignBoardOnClick,G=T.isProcessing;return{isSelectedForAutoAdd:K,autoAssignBoardOnClick:B,isProcessing:G}},Oe),[e.board_id]),{isSelectedForAutoAdd:s,autoAssignBoardOnClick:i,isProcessing:c}=z(o),[f,p]=u.useState(!1),h=u.useCallback(()=>{p(!0)},[]),m=u.useCallback(()=>{p(!1)},[]),{data:v}=X_(e.board_id),{data:b}=Q_(e.board_id),y=u.useMemo(()=>{if(!(!v||!b))return`${v} image${v>1?"s":""}, ${b} asset${b>1?"s":""}`},[b,v]),{currentData:x}=qo(e.cover_image_name??Yo.skipToken),{board_name:C,board_id:k}=e,[j,_]=u.useState(C),I=u.useCallback(()=>{r(Y_(k)),i&&!c&&r(Bm(k))},[k,i,c,r]),[O,{isLoading:E}]=vR(),M=u.useMemo(()=>({id:k,actionType:"ADD_TO_BOARD",context:{boardId:k}}),[k]),R=u.useCallback(async D=>{if(!D.trim()){_(C);return}if(D!==C)try{const{board_name:T}=await O({board_id:k,changes:{board_name:D}}).unwrap();_(T)}catch{_(C)}},[k,C,O]),A=u.useCallback(D=>{_(D)},[]);return a.jsx(Fe,{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(IO,{board:e,board_id:k,setBoardToDelete:n,children:D=>a.jsx(Mn,{label:y,openDelay:1e3,hasArrow:!0,children:a.jsxs($,{ref:D,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(Vl,{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(Tr,{boxSize:12,as:TJ,sx:{mt:-6,opacity:.7,color:"base.500",_dark:{color:"base.500"}}})}),s&&a.jsx(PO,{}),a.jsx(Wy,{isSelected:t,isHovered:f}),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(Zm,{value:j,isDisabled:E,submitOnBlur:!0,onChange:A,onSubmit:R,sx:{w:"full"},children:[a.jsx(Jm,{sx:{p:0,fontWeight:t?700:500,textAlign:"center",overflow:"hidden",textOverflow:"ellipsis"},noOfLines:1}),a.jsx(Ym,{sx:{p:0,_focusVisible:{p:0,textAlign:"center",boxShadow:"none"}}})]})}),a.jsx(Hy,{data:M,dropLabel:a.jsx(Ee,{fontSize:"md",children:"Move"})})]})})})})})},nte=u.memo(tte),rte=le(ke,({gallery:e,system:t})=>{const{autoAddBoardId:n,autoAssignBoardOnClick:r}=e,{isProcessing:o}=t;return{autoAddBoardId:n,autoAssignBoardOnClick:r,isProcessing:o}},Oe),EO=u.memo(({isSelected:e})=>{const t=se(),{autoAddBoardId:n,autoAssignBoardOnClick:r,isProcessing:o}=z(rte),s=Fg("none"),i=u.useCallback(()=>{t(Y_("none")),r&&!o&&t(Bm("none"))},[t,r,o]),[c,f]=u.useState(!1),p=u.useCallback(()=>{f(!0)},[]),h=u.useCallback(()=>{f(!1)},[]),m=u.useMemo(()=>({id:"no_board",actionType:"REMOVE_FROM_BOARD"}),[]);return a.jsx(Fe,{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(IO,{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(Vl,{src:U_,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(PO,{}),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(Wy,{isSelected:e,isHovered:c}),a.jsx(Hy,{data:m,dropLabel:a.jsx(Ee,{fontSize:"md",children:"Move"})})]})})})})});EO.displayName="HoverableBoard";const ote=u.memo(EO),ste=le([ke],({gallery:e})=>{const{selectedBoardId:t,boardSearchText:n}=e;return{selectedBoardId:t,boardSearchText:n}},Oe),ate=e=>{const{isOpen:t}=e,{selectedBoardId:n,boardSearchText:r}=z(ste),{data:o}=Fm(),s=r?o==null?void 0:o.filter(f=>f.board_name.toLowerCase().includes(r.toLowerCase())):o,[i,c]=u.useState();return a.jsxs(a.Fragment,{children:[a.jsx(Xm,{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(Vee,{}),a.jsx(Lee,{})]}),a.jsx($g,{defer:!0,style:{height:"100%",width:"100%"},options:{scrollbars:{visibility:"auto",autoHide:"move",autoHideDelay:1300,theme:"os-theme-dark"}},children:a.jsxs(Vi,{className:"list-container",sx:{gridTemplateColumns:"repeat(auto-fill, minmax(108px, 1fr));",maxH:346},children:[a.jsx(Bd,{sx:{p:1.5},children:a.jsx(ote,{isSelected:n==="none"})}),s&&s.map(f=>a.jsx(Bd,{sx:{p:1.5},children:a.jsx(nte,{board:f,isSelected:n===f.board_id,setBoardToDelete:c})},f.board_id))]})})]})}),a.jsx(Nee,{boardToDelete:i,setBoardToDelete:c})]})},ite=u.memo(ate),lte=le([ke],e=>{const{selectedBoardId:t}=e.gallery;return{selectedBoardId:t}},Oe),cte=e=>{const{isOpen:t,onToggle:n}=e,{selectedBoardId:r}=z(lte),o=Fg(r),s=u.useMemo(()=>o.length>20?`${o.substring(0,20)}...`:o,[o]);return a.jsxs($,{as:iu,onClick:n,size:"sm",sx:{position:"relative",gap:2,w:"full",justifyContent:"space-between",alignItems:"center",px:2},children:[a.jsx(Ee,{noOfLines:1,sx:{fontWeight:600,w:"100%",textAlign:"center",color:"base.800",_dark:{color:"base.200"}},children:s}),a.jsx(Lg,{sx:{transform:t?"rotate(0deg)":"rotate(180deg)",transitionProperty:"common",transitionDuration:"normal"}})]})},ute=u.memo(cte),dte=e=>{const{triggerComponent:t,children:n,hasArrow:r=!0,isLazy:o=!0,...s}=e;return a.jsxs(fg,{isLazy:o,...s,children:[a.jsx(Zx,{children:t}),a.jsxs(pg,{shadow:"dark-lg",children:[r&&a.jsx(xP,{}),n]})]})},Rf=u.memo(dte);function fte(e){return Je({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 pte=e=>{const[t,n]=u.useState(!1),{label:r,value:o,min:s=1,max:i=100,step:c=1,onChange:f,tooltipSuffix:p="",withSliderMarks:h=!1,withInput:m=!1,isInteger:v=!1,inputWidth:b=16,withReset:y=!1,hideTooltip:x=!1,isCompact:C=!1,isDisabled:k=!1,sliderMarks:j,handleReset:_,sliderFormControlProps:I,sliderFormLabelProps:O,sliderMarkProps:E,sliderTrackProps:M,sliderThumbProps:R,sliderNumberInputProps:A,sliderNumberInputFieldProps:D,sliderNumberInputStepperProps:T,sliderTooltipProps:K,sliderIAIIconButtonProps:B,...G}=e,Q=se(),{t:V}=Ie(),[L,X]=u.useState(String(o));u.useEffect(()=>{X(o)},[o]);const F=u.useMemo(()=>A!=null&&A.min?A.min:s,[s,A==null?void 0:A.min]),q=u.useMemo(()=>A!=null&&A.max?A.max:i,[i,A==null?void 0:A.max]),te=u.useCallback(ie=>{f(ie)},[f]),Y=u.useCallback(ie=>{ie.target.value===""&&(ie.target.value=String(F));const oe=El(v?Math.floor(Number(ie.target.value)):Number(L),F,q),me=gd(oe,c);f(me),X(me)},[v,L,F,q,f,c]),ce=u.useCallback(ie=>{X(ie)},[]),ae=u.useCallback(()=>{_&&_()},[_]),U=u.useCallback(ie=>{ie.target instanceof HTMLDivElement&&ie.target.focus()},[]),W=u.useCallback(ie=>{ie.shiftKey&&Q(Do(!0))},[Q]),ne=u.useCallback(ie=>{ie.shiftKey||Q(Do(!1))},[Q]);return a.jsxs(pr,{onClick:U,sx:C?{display:"flex",flexDirection:"row",alignItems:"center",columnGap:4,margin:0,padding:0}:{},isDisabled:k,...I,children:[r&&a.jsx(Jr,{sx:m?{mb:-1.5}:{},...O,children:r}),a.jsxs(Fx,{w:"100%",gap:2,alignItems:"center",children:[a.jsxs(ty,{"aria-label":r,value:o,min:s,max:i,step:c,onChange:te,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),focusThumbOnChange:!1,isDisabled:k,...G,children:[h&&!j&&a.jsxs(a.Fragment,{children:[a.jsx(Ic,{value:s,sx:{insetInlineStart:"0 !important",insetInlineEnd:"unset !important"},...E,children:s}),a.jsx(Ic,{value:i,sx:{insetInlineStart:"unset !important",insetInlineEnd:"0 !important"},...E,children:i})]}),h&&j&&a.jsx(a.Fragment,{children:j.map((ie,oe)=>oe===0?a.jsx(Ic,{value:ie,sx:{insetInlineStart:"0 !important",insetInlineEnd:"unset !important"},...E,children:ie},ie):oe===j.length-1?a.jsx(Ic,{value:ie,sx:{insetInlineStart:"unset !important",insetInlineEnd:"0 !important"},...E,children:ie},ie):a.jsx(Ic,{value:ie,sx:{transform:"translateX(-50%)"},...E,children:ie},ie))}),a.jsx(ry,{...M,children:a.jsx(oy,{})}),a.jsx(Mn,{hasArrow:!0,placement:"top",isOpen:t,label:`${o}${p}`,hidden:x,...K,children:a.jsx(ny,{...R,zIndex:0})})]}),m&&a.jsxs(ig,{min:F,max:q,step:c,value:L,onChange:ce,onBlur:Y,focusInputOnChange:!1,...A,children:[a.jsx(cg,{onKeyDown:W,onKeyUp:ne,minWidth:b,...D}),a.jsxs(lg,{...T,children:[a.jsx(dg,{onClick:()=>f(Number(L))}),a.jsx(ug,{onClick:()=>f(Number(L))})]})]}),y&&a.jsx(tt,{size:"sm","aria-label":V("accessibility.reset"),tooltip:V("accessibility.reset"),icon:a.jsx(fte,{}),isDisabled:k,onClick:ae,...B})]})]})},jt=u.memo(pte),OO=u.forwardRef(({label:e,tooltip:t,description:n,disabled:r,...o},s)=>a.jsx(Mn,{label:t,placement:"top",hasArrow:!0,openDelay:500,children:a.jsx(Fe,{ref:s,...o,children:a.jsxs(Fe,{children:[a.jsx(pu,{children:e}),n&&a.jsx(pu,{size:"xs",color:"base.600",children:n})]})})}));OO.displayName="IAIMantineSelectItemWithTooltip";const tl=u.memo(OO),hte=le([ke],({gallery:e,system:t})=>{const{autoAddBoardId:n,autoAssignBoardOnClick:r}=e,{isProcessing:o}=t;return{autoAddBoardId:n,autoAssignBoardOnClick:r,isProcessing:o}},Oe),mte=()=>{const e=se(),{autoAddBoardId:t,autoAssignBoardOnClick:n,isProcessing:r}=z(hte),o=u.useRef(null),{boards:s,hasBoards:i}=Fm(void 0,{selectFromResult:({data:f})=>{const p=[{label:"None",value:"none"}];return f==null||f.forEach(({board_id:h,board_name:m})=>{p.push({label:m,value:h})}),{boards:p,hasBoards:p.length>1}}}),c=u.useCallback(f=>{f&&e(Bm(f))},[e]);return a.jsx(Kn,{label:"Auto-Add Board",inputRef:o,autoFocus:!0,placeholder:"Select a Board",value:t,data:s,nothingFound:"No matching Boards",itemComponent:tl,disabled:!i||n||r,filter:(f,p)=>{var h;return((h=p.label)==null?void 0:h.toLowerCase().includes(f.toLowerCase().trim()))||p.value.toLowerCase().includes(f.toLowerCase().trim())},onChange:c})},gte=u.memo(mte),vte=e=>{const{label:t,...n}=e,{colorMode:r}=di();return a.jsx(Qm,{colorScheme:"accent",...n,children:a.jsx(Ee,{sx:{fontSize:"sm",color:qe("base.800","base.200")(r)},children:t})})},bo=u.memo(vte),bte=le([ke],e=>{const{galleryImageMinimumWidth:t,shouldAutoSwitch:n,autoAssignBoardOnClick:r}=e.gallery;return{galleryImageMinimumWidth:t,shouldAutoSwitch:n,autoAssignBoardOnClick:r}},Oe),xte=()=>{const e=se(),{t}=Ie(),{galleryImageMinimumWidth:n,shouldAutoSwitch:r,autoAssignBoardOnClick:o}=z(bte),s=u.useCallback(f=>{e(tC(f))},[e]),i=u.useCallback(()=>{e(tC(64))},[e]),c=u.useCallback(f=>{e(bR(f.target.checked))},[e]);return a.jsx(Rf,{triggerComponent:a.jsx(tt,{tooltip:t("gallery.gallerySettings"),"aria-label":t("gallery.gallerySettings"),size:"sm",icon:a.jsx(qE,{})}),children:a.jsxs($,{direction:"column",gap:2,children:[a.jsx(jt,{value:n,onChange:s,min:45,max:256,hideTooltip:!0,label:t("gallery.galleryImageSize"),withReset:!0,handleReset:i}),a.jsx(qn,{label:t("gallery.autoSwitchNewImages"),isChecked:r,onChange:c}),a.jsx(bo,{label:t("gallery.autoAssignBoardOnClick"),isChecked:o,onChange:f=>e(xR(f.target.checked))}),a.jsx(gte,{})]})})},yte=u.memo(xte),wte=e=>e.image?a.jsx(hg,{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(Wl,{size:"xl"})}),lo=e=>{const{icon:t=Fl,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(Tr,{as:t,boxSize:n,opacity:.7}),e.label&&a.jsx(Ee,{textAlign:"center",children:e.label})]})},zg=0,nl=1,Au=2,MO=4;function Cte(e,t){return n=>e(t(n))}function Ste(e,t){return t(e)}function RO(e,t){return n=>e(t,n)}function mj(e,t){return()=>e(t)}function Uy(e,t){return t(e),e}function Jl(...e){return e}function kte(e){e()}function gj(e){return()=>e}function jte(...e){return()=>{e.map(kte)}}function Bg(){}function yo(e,t){return e(nl,t)}function Nr(e,t){e(zg,t)}function Gy(e){e(Au)}function Hg(e){return e(MO)}function Gn(e,t){return yo(e,RO(t,zg))}function vj(e,t){const n=e(nl,r=>{n(),t(r)});return n}function kr(){const e=[];return(t,n)=>{switch(t){case Au:e.splice(0,e.length);return;case nl:return e.push(n),()=>{const r=e.indexOf(n);r>-1&&e.splice(r,1)};case zg:e.slice().forEach(r=>{r(n)});return;default:throw new Error(`unrecognized action ${t}`)}}}function Qt(e){let t=e;const n=kr();return(r,o)=>{switch(r){case nl:o(t);break;case zg:t=o;break;case MO:return t}return n(r,o)}}function _te(e){let t,n;const r=()=>t&&t();return function(o,s){switch(o){case nl:return s?n===s?void 0:(r(),n=s,t=yo(e,s),t):(r(),Bg);case Au:r(),n=null;return;default:throw new Error(`unrecognized action ${o}`)}}}function Od(e){return Uy(kr(),t=>Gn(e,t))}function Zc(e,t){return Uy(Qt(t),n=>Gn(e,n))}function Pte(...e){return t=>e.reduceRight(Ste,t)}function Yt(e,...t){const n=Pte(...t);return(r,o)=>{switch(r){case nl:return yo(e,n(o));case Au:Gy(e);return}}}function DO(e,t){return e===t}function Eo(e=DO){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function Yr(e){return t=>n=>{e(n)&&t(n)}}function or(e){return t=>Cte(t,e)}function Ri(e){return t=>()=>t(e)}function Jp(e,t){return n=>r=>n(t=e(t,r))}function Ib(e){return t=>n=>{e>0?e--:t(n)}}function xd(e){let t=null,n;return r=>o=>{t=o,!n&&(n=setTimeout(()=>{n=void 0,r(t)},e))}}function bj(e){let t,n;return r=>o=>{t=o,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function ga(...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 c=Math.pow(2,i);yo(s,f=>{const p=n;n=n|c,t[i]=f,p!==o&&n===o&&r&&(r(),r=null)})}),s=>i=>{const c=()=>s([i].concat(t));n===o?c():r=c}}function xj(...e){return function(t,n){switch(t){case nl:return jte(...e.map(r=>yo(r,n)));case Au:return;default:throw new Error(`unrecognized action ${t}`)}}}function wn(e,t=DO){return Yt(e,Eo(t))}function Ya(...e){const t=kr(),n=new Array(e.length);let r=0;const o=Math.pow(2,e.length)-1;return e.forEach((s,i)=>{const c=Math.pow(2,i);yo(s,f=>{n[i]=f,r=r|c,r===o&&Nr(t,n)})}),function(s,i){switch(s){case nl:return r===o&&i(n),yo(t,i);case Au:return Gy(t);default:throw new Error(`unrecognized action ${s}`)}}}function Na(e,t=[],{singleton:n}={singleton:!0}){return{id:Ite(),constructor:e,dependencies:t,singleton:n}}const Ite=()=>Symbol();function Ete(e){const t=new Map,n=({id:r,constructor:o,dependencies:s,singleton:i})=>{if(i&&t.has(r))return t.get(r);const c=o(s.map(f=>n(f)));return i&&t.set(r,c),c};return n(e)}function Ote(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 Zp=typeof document<"u"?H.useLayoutEffect:H.useEffect;function Mte(e,t,n){const r=Object.keys(t.required||{}),o=Object.keys(t.optional||{}),s=Object.keys(t.methods||{}),i=Object.keys(t.events||{}),c=H.createContext({});function f(x,C){x.propsReady&&Nr(x.propsReady,!1);for(const k of r){const j=x[t.required[k]];Nr(j,C[k])}for(const k of o)if(k in C){const j=x[t.optional[k]];Nr(j,C[k])}x.propsReady&&Nr(x.propsReady,!0)}function p(x){return s.reduce((C,k)=>(C[k]=j=>{const _=x[t.methods[k]];Nr(_,j)},C),{})}function h(x){return i.reduce((C,k)=>(C[k]=_te(x[t.events[k]]),C),{})}return{Component:H.forwardRef((x,C)=>{const{children:k,...j}=x,[_]=H.useState(()=>Uy(Ete(e),O=>f(O,j))),[I]=H.useState(mj(h,_));return Zp(()=>{for(const O of i)O in j&&yo(I[O],j[O]);return()=>{Object.values(I).map(Gy)}},[j,I,_]),Zp(()=>{f(_,j)}),H.useImperativeHandle(C,gj(p(_))),H.createElement(c.Provider,{value:_},n?H.createElement(n,Ote([...r,...o,...i],j),k):k)}),usePublisher:x=>H.useCallback(RO(Nr,H.useContext(c)[x]),[x]),useEmitterValue:x=>{const k=H.useContext(c)[x],[j,_]=H.useState(mj(Hg,k));return Zp(()=>yo(k,I=>{I!==j&&_(gj(I))}),[k,j]),j},useEmitter:(x,C)=>{const j=H.useContext(c)[x];Zp(()=>yo(j,C),[C,j])}}}const Rte=typeof document<"u"?H.useLayoutEffect:H.useEffect,Dte=Rte;var qy=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(qy||{});const Ate={0:"debug",1:"log",2:"warn",3:"error"},Nte=()=>typeof globalThis>"u"?window:globalThis,AO=Na(()=>{const e=Qt(3);return{log:Qt((n,r,o=1)=>{var s;const i=(s=Nte().VIRTUOSO_LOG_LEVEL)!=null?s:Hg(e);o>=i&&console[Ate[o]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",n,r)}),logLevel:e}},[],{singleton:!0});function NO(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 Wg(e,t=!0){return NO(e,t).callbackRef}function Em(e,t){return Math.round(e.getBoundingClientRect()[t])}function TO(e,t){return Math.abs(e-t)<1.01}function $O(e,t,n,r=Bg,o){const s=H.useRef(null),i=H.useRef(null),c=H.useRef(null),f=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,C=b?window.innerHeight:v.offsetHeight,k=()=>{e({scrollTop:Math.max(y,0),scrollHeight:x,viewportHeight:C})};m.suppressFlushSync?k():yR.flushSync(k),i.current!==null&&(y===i.current||y<=0||y===x-C)&&(i.current=null,t(!0),c.current&&(clearTimeout(c.current),c.current=null))},[e,t]);H.useEffect(()=>{const m=o||s.current;return r(o||s.current),f({target:m,suppressFlushSync:!0}),m.addEventListener("scroll",f,{passive:!0}),()=>{r(null),m.removeEventListener("scroll",f)}},[s,f,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,C;v===window?(x=Math.max(Em(document.documentElement,"height"),document.documentElement.scrollHeight),y=window.innerHeight,C=document.documentElement.scrollTop):(x=v.scrollHeight,y=Em(v,"height"),C=v.scrollTop);const k=x-y;if(m.top=Math.ceil(Math.max(Math.min(k,m.top),0)),TO(y,x)||m.top===C){e({scrollTop:C,scrollHeight:x,viewportHeight:y}),b&&t(!0);return}b?(i.current=m.top,c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{c.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=Na(()=>{const e=kr(),t=kr(),n=Qt(0),r=kr(),o=Qt(0),s=kr(),i=kr(),c=Qt(0),f=Qt(0),p=Qt(0),h=Qt(0),m=kr(),v=kr(),b=Qt(!1);return Gn(Yt(e,or(({scrollTop:y})=>y)),t),Gn(Yt(e,or(({scrollHeight:y})=>y)),i),Gn(t,o),{scrollContainerState:e,scrollTop:t,viewportHeight:s,headerHeight:c,fixedHeaderHeight:f,fixedFooterHeight:p,footerHeight:h,scrollHeight:i,smoothScrollTargetReached:r,scrollTo:m,scrollBy:v,statefulScrollTop:o,deviation:n,scrollingInProgress:b}},[],{singleton:!0}),Tte=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function $te(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!Tte)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const Om="up",Md="down",Lte="none",Fte={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},zte=0,LO=Na(([{scrollContainerState:e,scrollTop:t,viewportHeight:n,headerHeight:r,footerHeight:o,scrollBy:s}])=>{const i=Qt(!1),c=Qt(!0),f=kr(),p=kr(),h=Qt(4),m=Qt(zte),v=Zc(Yt(xj(Yt(wn(t),Ib(1),Ri(!0)),Yt(wn(t),Ib(1),Ri(!1),bj(100))),Eo()),!1),b=Zc(Yt(xj(Yt(s,Ri(!0)),Yt(s,Ri(!1),bj(200))),Eo()),!1);Gn(Yt(Ya(wn(t),wn(m)),or(([j,_])=>j<=_),Eo()),c),Gn(Yt(c,xd(50)),p);const y=Od(Yt(Ya(e,wn(n),wn(r),wn(o),wn(h)),Jp((j,[{scrollTop:_,scrollHeight:I},O,E,M,R])=>{const A=_+O-I>-R,D={viewportHeight:O,scrollTop:_,scrollHeight:I};if(A){let K,B;return _>j.state.scrollTop?(K="SCROLLED_DOWN",B=j.state.scrollTop-_):(K="SIZE_DECREASED",B=j.state.scrollTop-_||j.scrollTopDelta),{atBottom:!0,state:D,atBottomBecause:K,scrollTopDelta:B}}let T;return D.scrollHeight>j.state.scrollHeight?T="SIZE_INCREASED":O<j.state.viewportHeight?T="VIEWPORT_HEIGHT_DECREASING":_<j.state.scrollTop?T="SCROLLING_UPWARDS":T="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:T,state:D}},Fte),Eo((j,_)=>j&&j.atBottom===_.atBottom))),x=Zc(Yt(e,Jp((j,{scrollTop:_,scrollHeight:I,viewportHeight:O})=>{if(TO(j.scrollHeight,I))return{scrollTop:_,scrollHeight:I,jump:0,changed:!1};{const E=I-(_+O)<1;return j.scrollTop!==_&&E?{scrollHeight:I,scrollTop:_,jump:j.scrollTop-_,changed:!0}:{scrollHeight:I,scrollTop:_,jump:0,changed:!0}}},{scrollHeight:0,jump:0,scrollTop:0,changed:!1}),Yr(j=>j.changed),or(j=>j.jump)),0);Gn(Yt(y,or(j=>j.atBottom)),i),Gn(Yt(i,xd(50)),f);const C=Qt(Md);Gn(Yt(e,or(({scrollTop:j})=>j),Eo(),Jp((j,_)=>Hg(b)?{direction:j.direction,prevScrollTop:_}:{direction:_<j.prevScrollTop?Om:Md,prevScrollTop:_},{direction:Md,prevScrollTop:0}),or(j=>j.direction)),C),Gn(Yt(e,xd(50),Ri(Lte)),C);const k=Qt(0);return Gn(Yt(v,Yr(j=>!j),Ri(0)),k),Gn(Yt(t,xd(100),ga(v),Yr(([j,_])=>!!_),Jp(([j,_],[I])=>[_,I],[0,0]),or(([j,_])=>_-j)),k),{isScrolling:v,isAtTop:c,isAtBottom:i,atBottomState:y,atTopStateChange:p,atBottomStateChange:f,scrollDirection:C,atBottomThreshold:h,atTopThreshold:m,scrollVelocity:k,lastJumpDueToItemResize:x}},Jl(Vg)),Bte=Na(([{log:e}])=>{const t=Qt(!1),n=Od(Yt(t,Yr(r=>r),Eo()));return yo(t,r=>{r&&Hg(e)("props updated",{},qy.DEBUG)}),{propsReady:t,didMount:n}},Jl(AO),{singleton:!0});function FO(e,t){e==0?t():requestAnimationFrame(()=>FO(e-1,t))}function Hte(e,t){const n=t-1;return typeof e=="number"?e:e.index==="LAST"?n:e.index}function Eb(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}function Wte(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}const Mm="top",Rm="bottom",yj="none";function wj(e,t,n){return typeof e=="number"?n===Om&&t===Mm||n===Md&&t===Rm?e:0:n===Om?t===Mm?e.main:e.reverse:t===Rm?e.main:e.reverse}function Cj(e,t){return typeof e=="number"?e:e[t]||0}const Vte=Na(([{scrollTop:e,viewportHeight:t,deviation:n,headerHeight:r,fixedHeaderHeight:o}])=>{const s=kr(),i=Qt(0),c=Qt(0),f=Qt(0),p=Zc(Yt(Ya(wn(e),wn(t),wn(r),wn(s,Eb),wn(f),wn(i),wn(o),wn(n),wn(c)),or(([h,m,v,[b,y],x,C,k,j,_])=>{const I=h-j,O=C+k,E=Math.max(v-I,0);let M=yj;const R=Cj(_,Mm),A=Cj(_,Rm);return b-=j,b+=v+k,y+=v+k,y-=j,b>h+O-R&&(M=Om),y<h-E+m+A&&(M=Md),M!==yj?[Math.max(I-v-wj(x,Mm,M)-R,0),I-E-k+m+wj(x,Rm,M)+A]:null}),Yr(h=>h!=null),Eo(Eb)),[0,0]);return{listBoundary:s,overscan:f,topListHeight:i,increaseViewportBy:c,visibleRange:p}},Jl(Vg),{singleton:!0}),Ute=Na(([{scrollVelocity:e}])=>{const t=Qt(!1),n=kr(),r=Qt(!1);return Gn(Yt(e,ga(r,t,n),Yr(([o,s])=>!!s),or(([o,s,i,c])=>{const{exit:f,enter:p}=s;if(i){if(f(o,c))return!1}else if(p(o,c))return!0;return i}),Eo()),t),yo(Yt(Ya(t,e,n),ga(r)),([[o,s,i],c])=>o&&c&&c.change&&c.change(s,i)),{isSeeking:t,scrollSeekConfiguration:r,scrollVelocity:e,scrollSeekRangeChanged:n}},Jl(LO),{singleton:!0});function Gte(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}const qte=Na(([{scrollTo:e,scrollContainerState:t}])=>{const n=kr(),r=kr(),o=kr(),s=Qt(!1),i=Qt(void 0);return Gn(Yt(Ya(n,r),or(([{viewportHeight:c,scrollTop:f,scrollHeight:p},{offsetTop:h}])=>({scrollTop:Math.max(0,f-h),scrollHeight:p,viewportHeight:c}))),t),Gn(Yt(e,ga(r),or(([c,{offsetTop:f}])=>({...c,top:c.top+f}))),o),{useWindowScroll:s,customScrollParent:i,windowScrollContainerState:n,windowViewportRect:r,windowScrollTo:o}},Jl(Vg)),t1="-webkit-sticky",Sj="sticky",zO=Gte(()=>{if(typeof document>"u")return Sj;const e=document.createElement("div");return e.style.position=t1,e.style.position===t1?t1:Sj});function Kte(e,t){const n=H.useRef(null),r=H.useCallback(c=>{if(c===null||!c.offsetParent)return;const f=c.getBoundingClientRect(),p=f.width;let h,m;if(t){const v=t.getBoundingClientRect(),b=f.top-v.top;h=v.height-Math.max(0,b),m=b+t.scrollTop}else h=window.innerHeight-Math.max(0,f.top),m=f.top+window.pageYOffset;n.current={offsetTop:m,visibleHeight:h,visibleWidth:p},e(n.current)},[e,t]),{callbackRef:o,ref:s}=NO(r),i=H.useCallback(()=>{r(s.current)},[r,s]);return H.useEffect(()=>{if(t){t.addEventListener("scroll",i);const c=new ResizeObserver(i);return c.observe(t),()=>{t.removeEventListener("scroll",i),c.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 BO=H.createContext(void 0);function Xte(e){return e}zO();const Qte={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},HO={width:"100%",height:"100%",position:"absolute",top:0};zO();function _l(e,t){if(typeof e!="string")return{context:t}}function Yte({usePublisher:e,useEmitter:t,useEmitterValue:n}){return H.memo(function({style:s,children:i,...c}){const f=e("scrollContainerState"),p=n("ScrollerComponent"),h=e("smoothScrollTargetReached"),m=n("scrollerRef"),v=n("context"),{scrollerRef:b,scrollByCallback:y,scrollToCallback:x}=$O(f,h,p,m);return t("scrollTo",x),t("scrollBy",y),H.createElement(p,{ref:b,style:{...Qte,...s},"data-test-id":"virtuoso-scroller","data-virtuoso-scroller":!0,tabIndex:0,...c,..._l(p,v)},i)})}function Jte({usePublisher:e,useEmitter:t,useEmitterValue:n}){return H.memo(function({style:s,children:i,...c}){const f=e("windowScrollContainerState"),p=n("ScrollerComponent"),h=e("smoothScrollTargetReached"),m=n("totalListHeight"),v=n("deviation"),b=n("customScrollParent"),y=n("context"),{scrollerRef:x,scrollByCallback:C,scrollToCallback:k}=$O(f,h,p,Bg,b);return Dte(()=>(x.current=b||window,()=>{x.current=null}),[x,b]),t("windowScrollTo",k),t("scrollBy",C),H.createElement(p,{style:{position:"relative",...s,...m!==0?{height:m+v}:{}},"data-virtuoso-scroller":!0,...c,..._l(p,y)},i)})}const kj={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},Zte={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},{round:jj,ceil:_j,floor:Dm,min:n1,max:Rd}=Math;function ene(e){return{...Zte,items:e}}function Pj(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 tne(e,t){return e&&e.column===t.column&&e.row===t.row}function eh(e,t){return e&&e.width===t.width&&e.height===t.height}const nne=Na(([{overscan:e,visibleRange:t,listBoundary:n},{scrollTop:r,viewportHeight:o,scrollBy:s,scrollTo:i,smoothScrollTargetReached:c,scrollContainerState:f,footerHeight:p,headerHeight:h},m,v,{propsReady:b,didMount:y},{windowViewportRect:x,useWindowScroll:C,customScrollParent:k,windowScrollContainerState:j,windowScrollTo:_},I])=>{const O=Qt(0),E=Qt(0),M=Qt(kj),R=Qt({height:0,width:0}),A=Qt({height:0,width:0}),D=kr(),T=kr(),K=Qt(0),B=Qt(null),G=Qt({row:0,column:0}),Q=kr(),V=kr(),L=Qt(!1),X=Qt(0),F=Qt(!0),q=Qt(!1);yo(Yt(y,ga(X),Yr(([W,ne])=>!!ne)),()=>{Nr(F,!1),Nr(E,0)}),yo(Yt(Ya(y,F,A,R,X,q),Yr(([W,ne,ie,oe,,me])=>W&&!ne&&ie.height!==0&&oe.height!==0&&!me)),([,,,,W])=>{Nr(q,!0),FO(1,()=>{Nr(D,W)}),vj(Yt(r),()=>{Nr(n,[0,0]),Nr(F,!0)})}),Gn(Yt(V,Yr(W=>W!=null&&W.scrollTop>0),Ri(0)),E),yo(Yt(y,ga(V),Yr(([,W])=>W!=null)),([,W])=>{W&&(Nr(R,W.viewport),Nr(A,W==null?void 0:W.item),Nr(G,W.gap),W.scrollTop>0&&(Nr(L,!0),vj(Yt(r,Ib(1)),ne=>{Nr(L,!1)}),Nr(i,{top:W.scrollTop})))}),Gn(Yt(R,or(({height:W})=>W)),o),Gn(Yt(Ya(wn(R,eh),wn(A,eh),wn(G,(W,ne)=>W&&W.column===ne.column&&W.row===ne.row),wn(r)),or(([W,ne,ie,oe])=>({viewport:W,item:ne,gap:ie,scrollTop:oe}))),Q),Gn(Yt(Ya(wn(O),t,wn(G,tne),wn(A,eh),wn(R,eh),wn(B),wn(E),wn(L),wn(F),wn(X)),Yr(([,,,,,,,W])=>!W),or(([W,[ne,ie],oe,me,fe,he,Ce,,xe,de])=>{const{row:Ne,column:De}=oe,{height:Xe,width:It}=me,{width:lt}=fe;if(Ce===0&&(W===0||lt===0))return kj;if(It===0){const Nt=Hte(de,W),Lt=Nt===0?Math.max(Ce-1,0):Nt;return ene(Pj(Nt,Lt,he))}const on=WO(lt,It,De);let gt,bt;xe?ne===0&&ie===0&&Ce>0?(gt=0,bt=Ce-1):(gt=on*Dm((ne+Ne)/(Xe+Ne)),bt=on*_j((ie+Ne)/(Xe+Ne))-1,bt=n1(W-1,Rd(bt,on-1)),gt=n1(bt,Rd(0,gt))):(gt=0,bt=-1);const ye=Pj(gt,bt,he),{top:We,bottom:Et}=Ij(fe,oe,me,ye),zt=_j(W/on),xt=zt*Xe+(zt-1)*Ne-Et;return{items:ye,offsetTop:We,offsetBottom:xt,top:We,bottom:Et,itemHeight:Xe,itemWidth:It}})),M),Gn(Yt(B,Yr(W=>W!==null),or(W=>W.length)),O),Gn(Yt(Ya(R,A,M,G),Yr(([W,ne,{items:ie}])=>ie.length>0&&ne.height!==0&&W.height!==0),or(([W,ne,{items:ie},oe])=>{const{top:me,bottom:fe}=Ij(W,oe,ne,ie);return[me,fe]}),Eo(Eb)),n);const te=Qt(!1);Gn(Yt(r,ga(te),or(([W,ne])=>ne||W!==0)),te);const Y=Od(Yt(wn(M),Yr(({items:W})=>W.length>0),ga(O,te),Yr(([{items:W},ne,ie])=>ie&&W[W.length-1].index===ne-1),or(([,W])=>W-1),Eo())),ce=Od(Yt(wn(M),Yr(({items:W})=>W.length>0&&W[0].index===0),Ri(0),Eo())),ae=Od(Yt(wn(M),ga(L),Yr(([{items:W},ne])=>W.length>0&&!ne),or(([{items:W}])=>({startIndex:W[0].index,endIndex:W[W.length-1].index})),Eo(Wte),xd(0)));Gn(ae,v.scrollSeekRangeChanged),Gn(Yt(D,ga(R,A,O,G),or(([W,ne,ie,oe,me])=>{const fe=$te(W),{align:he,behavior:Ce,offset:xe}=fe;let de=fe.index;de==="LAST"&&(de=oe-1),de=Rd(0,de,n1(oe-1,de));let Ne=Ob(ne,me,ie,de);return he==="end"?Ne=jj(Ne-ne.height+ie.height):he==="center"&&(Ne=jj(Ne-ne.height/2+ie.height/2)),xe&&(Ne+=xe),{top:Ne,behavior:Ce}})),i);const U=Zc(Yt(M,or(W=>W.offsetBottom+W.bottom)),0);return Gn(Yt(x,or(W=>({width:W.visibleWidth,height:W.visibleHeight}))),R),{data:B,totalCount:O,viewportDimensions:R,itemDimensions:A,scrollTop:r,scrollHeight:T,overscan:e,scrollBy:s,scrollTo:i,scrollToIndex:D,smoothScrollTargetReached:c,windowViewportRect:x,windowScrollTo:_,useWindowScroll:C,customScrollParent:k,windowScrollContainerState:j,deviation:K,scrollContainerState:f,footerHeight:p,headerHeight:h,initialItemCount:E,gap:G,restoreStateFrom:V,...v,initialTopMostItemIndex:X,gridState:M,totalListHeight:U,...m,startReached:ce,endReached:Y,rangeChanged:ae,stateChanged:Q,propsReady:b,stateRestoreInProgress:L,...I}},Jl(Vte,Vg,LO,Ute,Bte,qte,AO));function Ij(e,t,n,r){const{height:o}=n;if(o===void 0||r.length===0)return{top:0,bottom:0};const s=Ob(e,t,n,r[0].index),i=Ob(e,t,n,r[r.length-1].index)+o;return{top:s,bottom:i}}function Ob(e,t,n,r){const o=WO(e.width,n.width,t.column),s=Dm(r/o),i=s*n.height+Rd(0,s-1)*t.row;return i>0?i+t.row:i}function WO(e,t,n){return Rd(1,Dm((e+n)/(Dm(t)+n)))}const rne=Na(()=>{const e=Qt(p=>`Item ${p}`),t=Qt({}),n=Qt(null),r=Qt("virtuoso-grid-item"),o=Qt("virtuoso-grid-list"),s=Qt(Xte),i=Qt("div"),c=Qt(Bg),f=(p,h=null)=>Zc(Yt(t,or(m=>m[p]),Eo()),h);return{context:n,itemContent:e,components:t,computeItemKey:s,itemClassName:r,listClassName:o,headerFooterTag:i,scrollerRef:c,FooterComponent:f("Footer"),HeaderComponent:f("Header"),ListComponent:f("List","div"),ItemComponent:f("Item","div"),ScrollerComponent:f("Scroller","div"),ScrollSeekPlaceholder:f("ScrollSeekPlaceholder","div")}}),one=Na(([e,t])=>({...e,...t}),Jl(nne,rne)),sne=H.memo(function(){const t=dr("gridState"),n=dr("listClassName"),r=dr("itemClassName"),o=dr("itemContent"),s=dr("computeItemKey"),i=dr("isSeeking"),c=Us("scrollHeight"),f=dr("ItemComponent"),p=dr("ListComponent"),h=dr("ScrollSeekPlaceholder"),m=dr("context"),v=Us("itemDimensions"),b=Us("gap"),y=dr("log"),x=dr("stateRestoreInProgress"),C=Wg(k=>{const j=k.parentElement.parentElement.scrollHeight;c(j);const _=k.firstChild;if(_){const{width:I,height:O}=_.getBoundingClientRect();v({width:I,height:O})}b({row:Ej("row-gap",getComputedStyle(k).rowGap,y),column:Ej("column-gap",getComputedStyle(k).columnGap,y)})});return x?null:H.createElement(p,{ref:C,className:n,..._l(p,m),style:{paddingTop:t.offsetTop,paddingBottom:t.offsetBottom},"data-test-id":"virtuoso-item-list"},t.items.map(k=>{const j=s(k.index,k.data,m);return i?H.createElement(h,{key:j,..._l(h,m),index:k.index,height:t.itemHeight,width:t.itemWidth}):H.createElement(f,{..._l(f,m),className:r,"data-index":k.index,key:j},o(k.index,k.data,m))}))}),ane=H.memo(function(){const t=dr("HeaderComponent"),n=Us("headerHeight"),r=dr("headerFooterTag"),o=Wg(i=>n(Em(i,"height"))),s=dr("context");return t?H.createElement(r,{ref:o},H.createElement(t,_l(t,s))):null}),ine=H.memo(function(){const t=dr("FooterComponent"),n=Us("footerHeight"),r=dr("headerFooterTag"),o=Wg(i=>n(Em(i,"height"))),s=dr("context");return t?H.createElement(r,{ref:o},H.createElement(t,_l(t,s))):null}),lne=({children:e})=>{const t=H.useContext(BO),n=Us("itemDimensions"),r=Us("viewportDimensions"),o=Wg(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:HO,ref:o},e)},cne=({children:e})=>{const t=H.useContext(BO),n=Us("windowViewportRect"),r=Us("itemDimensions"),o=dr("customScrollParent"),s=Kte(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:HO},e)},une=H.memo(function({...t}){const n=dr("useWindowScroll"),r=dr("customScrollParent"),o=r||n?pne:fne,s=r||n?cne:lne;return H.createElement(o,{...t},H.createElement(s,null,H.createElement(ane,null),H.createElement(sne,null),H.createElement(ine,null)))}),{Component:dne,usePublisher:Us,useEmitterValue:dr,useEmitter:VO}=Mte(one,{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"}},une),fne=Yte({usePublisher:Us,useEmitterValue:dr,useEmitter:VO}),pne=Jte({usePublisher:Us,useEmitterValue:dr,useEmitter:VO});function Ej(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,qy.WARN),t==="normal"?0:parseInt(t??"0",10)}const hne=dne,mne=e=>{const t=z(s=>s.gallery.galleryView),{data:n}=X_(e),{data:r}=Q_(e),o=u.useMemo(()=>t==="images"?n:r,[t,r,n]);return{totalImages:n,totalAssets:r,currentViewTotal:o}},gne=({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(hi,{variant:"solid",colorScheme:"base",children:[e.width," × ",e.height]})}),vne=u.memo(gne),Ky=({postUploadAction:e,isDisabled:t})=>{const n=z(f=>f.gallery.autoAddBoardId),[r]=H_(),o=u.useCallback(f=>{const p=f[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:c}=iy({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},onDropAccepted:o,disabled:t,noDrag:!0,multiple:!1});return{getUploadButtonProps:s,getUploadInputProps:i,openUploader:c}},Ug=()=>{const e=se(),t=Kl(),{t:n}=Ie(),r=u.useCallback(()=>{t({title:n("toast.parameterSet"),status:"info",duration:2500,isClosable:!0})},[n,t]),o=u.useCallback(()=>{t({title:n("toast.parameterNotSet"),status:"warning",duration:2500,isClosable:!0})},[n,t]),s=u.useCallback(()=>{t({title:n("toast.parametersSet"),status:"info",duration:2500,isClosable:!0})},[n,t]),i=u.useCallback(()=>{t({title:n("toast.parametersNotSet"),status:"warning",duration:2500,isClosable:!0})},[n,t]),c=u.useCallback((E,M,R,A)=>{if(xp(E)||yp(M)||od(R)||lv(A)){xp(E)&&e(kd(E)),yp(M)&&e(jd(M)),od(R)&&e(_d(R)),od(A)&&e(Pd(A)),r();return}o()},[e,r,o]),f=u.useCallback(E=>{if(!xp(E)){o();return}e(kd(E)),r()},[e,r,o]),p=u.useCallback(E=>{if(!yp(E)){o();return}e(jd(E)),r()},[e,r,o]),h=u.useCallback(E=>{if(!od(E)){o();return}e(_d(E)),r()},[e,r,o]),m=u.useCallback(E=>{if(!lv(E)){o();return}e(Pd(E)),r()},[e,r,o]),v=u.useCallback(E=>{if(!nC(E)){o();return}e(bh(E)),r()},[e,r,o]),b=u.useCallback(E=>{if(!cv(E)){o();return}e(xh(E)),r()},[e,r,o]),y=u.useCallback(E=>{if(!rC(E)){o();return}e(w1(E)),r()},[e,r,o]),x=u.useCallback(E=>{if(!uv(E)){o();return}e(C1(E)),r()},[e,r,o]),C=u.useCallback(E=>{if(!dv(E)){o();return}e(yh(E)),r()},[e,r,o]),k=u.useCallback(E=>{if(!oC(E)){o();return}e(Ol(E)),r()},[e,r,o]),j=u.useCallback(E=>{if(!sC(E)){o();return}e(Ml(E)),r()},[e,r,o]),_=u.useCallback(E=>{if(!aC(E)){o();return}e(wh(E)),r()},[e,r,o]),I=u.useCallback(E=>{e(Hm(E))},[e]),O=u.useCallback(E=>{if(!E){i();return}const{cfg_scale:M,height:R,model:A,positive_prompt:D,negative_prompt:T,scheduler:K,seed:B,steps:G,width:Q,strength:V,positive_style_prompt:L,negative_style_prompt:X,refiner_model:F,refiner_cfg_scale:q,refiner_steps:te,refiner_scheduler:Y,refiner_positive_aesthetic_store:ce,refiner_negative_aesthetic_store:ae,refiner_start:U}=E;cv(M)&&e(xh(M)),rC(A)&&e(w1(A)),xp(D)&&e(kd(D)),yp(T)&&e(jd(T)),uv(K)&&e(C1(K)),nC(B)&&e(bh(B)),dv(G)&&e(yh(G)),oC(Q)&&e(Ol(Q)),sC(R)&&e(Ml(R)),aC(V)&&e(wh(V)),od(L)&&e(_d(L)),lv(X)&&e(Pd(X)),wR(F)&&e(J_(F)),dv(te)&&e(S1(te)),cv(q)&&e(k1(q)),uv(Y)&&e(Z_(Y)),CR(ce)&&e(j1(ce)),SR(ae)&&e(_1(ae)),kR(U)&&e(P1(U)),s()},[i,s,e]);return{recallBothPrompts:c,recallPositivePrompt:f,recallNegativePrompt:p,recallSDXLPositiveStylePrompt:h,recallSDXLNegativeStylePrompt:m,recallSeed:v,recallCfgScale:b,recallModel:y,recallScheduler:x,recallSteps:C,recallWidth:k,recallHeight:j,recallStrength:_,recallAllParameters:O,sendToImageToImage:I}},UO=()=>{const e=Kl(),{t}=Ie(),n=u.useMemo(()=>!!navigator.clipboard&&!!window.ClipboardItem,[]),r=u.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 bne(e){return Je({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 Gg(e){return Je({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 xne(e){return Je({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 yne(e){return Je({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 wne(e){return Je({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 Xy(e){return Je({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z"}}]})(e)}function Qy(e){return Je({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 GO(e){return Je({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)}rx("gallery/requestedBoardImagesDeletion");const Cne=rx("gallery/sentImageToCanvas"),qO=rx("gallery/sentImageToImg2Img"),Sne=e=>{const{imageDTO:t}=e,n=se(),{t:r}=Ie(),o=Kl(),s=Yn("unifiedCanvas").isFeatureEnabled,{metadata:i,workflow:c,isLoading:f}=ox(t.image_name,{selectFromResult:T=>{var K,B;return{isLoading:T.isFetching,metadata:(K=T==null?void 0:T.currentData)==null?void 0:K.metadata,workflow:(B=T==null?void 0:T.currentData)==null?void 0:B.workflow}}}),[p]=sx(),[h]=ax(),{isClipboardAPIAvailable:m,copyImageToClipboard:v}=UO(),b=u.useCallback(()=>{t&&n(Wm([t]))},[n,t]),{recallBothPrompts:y,recallSeed:x,recallAllParameters:C}=Ug(),k=u.useCallback(()=>{y(i==null?void 0:i.positive_prompt,i==null?void 0:i.negative_prompt,i==null?void 0:i.positive_style_prompt,i==null?void 0:i.negative_style_prompt)},[i==null?void 0:i.negative_prompt,i==null?void 0:i.positive_prompt,i==null?void 0:i.positive_style_prompt,i==null?void 0:i.negative_style_prompt,y]),j=u.useCallback(()=>{x(i==null?void 0:i.seed)},[i==null?void 0:i.seed,x]),_=u.useCallback(()=>{c&&(n(ix(c)),n(va("nodes")),n(Cn(_n({title:"Workflow Loaded",status:"success"}))))},[n,c]),I=u.useCallback(()=>{n(qO()),n(Hm(t))},[n,t]),O=u.useCallback(()=>{n(Cne()),n(e3(t)),n(va("unifiedCanvas")),o({title:r("toast.sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0})},[n,t,r,o]),E=u.useCallback(()=>{C(i)},[i,C]),M=u.useCallback(()=>{n(t3([t])),n(tx(!0))},[n,t]),R=u.useCallback(()=>{v(t.image_url)},[v,t.image_url]),A=u.useCallback(()=>{t&&p({imageDTOs:[t]})},[p,t]),D=u.useCallback(()=>{t&&h({imageDTOs:[t]})},[h,t]);return a.jsxs(a.Fragment,{children:[a.jsx(Bn,{as:"a",href:t.image_url,target:"_blank",icon:a.jsx($E,{}),children:r("common.openInNewTab")}),m&&a.jsx(Bn,{icon:a.jsx(Du,{}),onClickCapture:R,children:r("parameters.copyImage")}),a.jsx(Bn,{as:"a",download:!0,href:t.image_url,target:"_blank",icon:a.jsx(Ig,{}),w:"100%",children:r("parameters.downloadImage")}),a.jsx(Bn,{icon:f?a.jsx(th,{}):a.jsx(Gg,{}),onClickCapture:_,isDisabled:f||!c,children:r("nodes.loadWorkflow")}),a.jsx(Bn,{icon:f?a.jsx(th,{}):a.jsx(WE,{}),onClickCapture:k,isDisabled:f||(i==null?void 0:i.positive_prompt)===void 0&&(i==null?void 0:i.negative_prompt)===void 0,children:r("parameters.usePrompt")}),a.jsx(Bn,{icon:f?a.jsx(th,{}):a.jsx(VE,{}),onClickCapture:j,isDisabled:f||(i==null?void 0:i.seed)===void 0,children:r("parameters.useSeed")}),a.jsx(Bn,{icon:f?a.jsx(th,{}):a.jsx(DE,{}),onClickCapture:E,isDisabled:f||!i,children:r("parameters.useAll")}),a.jsx(Bn,{icon:a.jsx(Lk,{}),onClickCapture:I,id:"send-to-img2img",children:r("parameters.sendToImg2Img")}),s&&a.jsx(Bn,{icon:a.jsx(Lk,{}),onClickCapture:O,id:"send-to-canvas",children:r("parameters.sendToUnifiedCanvas")}),a.jsx(Bn,{icon:a.jsx(LE,{}),onClickCapture:M,children:"Change Board"}),t.starred?a.jsx(Bn,{icon:a.jsx(Qy,{}),onClickCapture:D,children:"Unstar Image"}):a.jsx(Bn,{icon:a.jsx(Xy,{}),onClickCapture:A,children:"Star Image"}),a.jsx(Bn,{sx:{color:"error.600",_dark:{color:"error.300"}},icon:a.jsx(Jo,{}),onClickCapture:b,children:r("gallery.deleteImage")})]})},KO=u.memo(Sne),th=()=>a.jsx($,{w:"14px",alignItems:"center",justifyContent:"center",children:a.jsx(Wl,{size:"xs"})}),kne=()=>{const e=se(),t=z(h=>h.gallery.selection),[n]=sx(),[r]=ax(),o=u.useCallback(()=>{e(t3(t)),e(tx(!0))},[e,t]),s=u.useCallback(()=>{e(Wm(t))},[e,t]),i=u.useCallback(()=>{n({imageDTOs:t})},[n,t]),c=u.useCallback(()=>{r({imageDTOs:t})},[r,t]),f=u.useMemo(()=>t.every(h=>h.starred),[t]),p=u.useMemo(()=>t.every(h=>!h.starred),[t]);return a.jsxs(a.Fragment,{children:[f&&a.jsx(Bn,{icon:a.jsx(Xy,{}),onClickCapture:c,children:"Unstar All"}),(p||!f&&!p)&&a.jsx(Bn,{icon:a.jsx(Qy,{}),onClickCapture:i,children:"Star All"}),a.jsx(Bn,{icon:a.jsx(LE,{}),onClickCapture:o,children:"Change Board"}),a.jsx(Bn,{sx:{color:"error.600",_dark:{color:"error.300"}},icon:a.jsx(Jo,{}),onClickCapture:s,children:"Delete Selection"})]})},jne=u.memo(kne),_ne=le([ke],({gallery:e})=>({selectionCount:e.selection.length}),Oe),Pne=({imageDTO:e,children:t})=>{const{selectionCount:n}=z(_ne),r=u.useCallback(o=>{o.preventDefault()},[]);return a.jsx(Vy,{menuProps:{size:"sm",isLazy:!0},menuButtonProps:{bg:"transparent",_hover:{bg:"transparent"}},renderMenu:()=>e?n>1?a.jsx(Ui,{sx:{visibility:"visible !important"},motionProps:au,onContextMenu:r,children:a.jsx(jne,{})}):a.jsx(Ui,{sx:{visibility:"visible !important"},motionProps:au,onContextMenu:r,children:a.jsx(KO,{imageDTO:e})}):null,children:t})},Ine=u.memo(Pne),Ene=e=>{const{data:t,disabled:n,...r}=e,o=u.useRef(Fi()),{attributes:s,listeners:i,setNodeRef:c}=Uee({id:o.current,disabled:n,data:t});return a.jsx(Fe,{ref:c,position:"absolute",w:"full",h:"full",top:0,insetInlineStart:0,...s,...i,...r})},One=u.memo(Ene),Mne=a.jsx(Tr,{as:Mg,sx:{boxSize:16}}),Rne=a.jsx(lo,{icon:Fl}),Dne=e=>{const{imageDTO:t,onError:n,onClick:r,withMetadataOverlay:o=!1,isDropDisabled:s=!1,isDragDisabled:i=!1,isUploadDisabled:c=!1,minSize:f=24,postUploadAction:p,imageSx:h,fitContainer:m=!1,droppableData:v,draggableData:b,dropLabel:y,isSelected:x=!1,thumbnail:C=!1,noContentFallback:k=Rne,uploadElement:j=Mne,useThumbailFallback:_,withHoverOverlay:I=!1,children:O,onMouseOver:E,onMouseOut:M}=e,{colorMode:R}=di(),[A,D]=u.useState(!1),T=u.useCallback(V=>{E&&E(V),D(!0)},[E]),K=u.useCallback(V=>{M&&M(V),D(!1)},[M]),{getUploadButtonProps:B,getUploadInputProps:G}=Ky({postUploadAction:p,isDisabled:c}),Q=c?{}:{cursor:"pointer",bg:qe("base.200","base.700")(R),_hover:{bg:qe("base.300","base.650")(R),color:qe("base.500","base.300")(R)}};return a.jsx(Ine,{imageDTO:t,children:V=>a.jsxs($,{ref:V,onMouseOver:T,onMouseOut:K,sx:{width:"full",height:"full",alignItems:"center",justifyContent:"center",position:"relative",minW:f||void 0,minH:f||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(Vl,{src:C?t.thumbnail_url:t.image_url,fallbackStrategy:"beforeLoadOrError",fallbackSrc:_?t.thumbnail_url:void 0,fallback:_?void 0:a.jsx(wte,{image:t}),onError:n,draggable:!1,sx:{w:t.width,objectFit:"contain",maxW:"full",maxH:"full",borderRadius:"base",...h}}),o&&a.jsx(vne,{imageDTO:t}),a.jsx(Wy,{isSelected:x,isHovered:I?A:!1})]}),!t&&!c&&a.jsx(a.Fragment,{children:a.jsxs($,{sx:{minH:f,w:"full",h:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",transitionProperty:"common",transitionDuration:"0.1s",color:qe("base.500","base.500")(R),...Q},...B(),children:[a.jsx("input",{...G()}),j]})}),!t&&c&&k,t&&!i&&a.jsx(One,{data:b,disabled:i||!t,onClick:r}),O,!s&&a.jsx(Hy,{data:v,disabled:s,dropLabel:y})]})})},ii=u.memo(Dne),Ane=()=>a.jsx(hg,{sx:{position:"relative",height:"full",width:"full","::before":{content:"''",display:"block",pt:"100%"}},children:a.jsx(Fe,{sx:{position:"absolute",top:0,insetInlineStart:0,height:"full",width:"full"}})}),Nne=u.memo(Ane),Tne=le([ke,lx],({gallery:e},t)=>{const n=e.selection;return{queryArgs:t,selection:n}},Oe),$ne=e=>{const t=se(),{queryArgs:n,selection:r}=z(Tne),{imageDTOs:o}=n3(n,{selectFromResult:p=>({imageDTOs:p.data?jR.selectAll(p.data):[]})}),s=Yn("multiselect").isFeatureEnabled,i=u.useCallback(p=>{var h;if(e){if(!s){t(sd([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),C=Math.max(b,y),k=o.slice(x,C+1);t(sd(LC(r.concat(k))))}}else p.ctrlKey||p.metaKey?r.some(m=>m.image_name===e.image_name)&&r.length>1?t(sd(r.filter(m=>m.image_name!==e.image_name))):t(sd(LC(r.concat(e)))):t(sd([e]))}},[t,e,o,r,s]),c=u.useMemo(()=>e?r.some(p=>p.image_name===e.image_name):!1,[e,r]),f=u.useMemo(()=>r.length,[r.length]);return{selection:r,selectionCount:f,isSelected:c,handleClick:i}},Lne=e=>{const{onClick:t,tooltip:n,icon:r,styleOverrides:o}=e,s=Rl("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(tt,{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}})},eu=u.memo(Lne),Fne=e=>{const t=se(),{imageName:n}=e,{currentData:r}=qo(n),o=z(_=>_.hotkeys.shift),{handleClick:s,isSelected:i,selection:c,selectionCount:f}=$ne(r),p=u.useCallback(_=>{_.stopPropagation(),r&&t(Wm([r]))},[t,r]),h=u.useMemo(()=>{if(f>1)return{id:"gallery-image",payloadType:"IMAGE_DTOS",payload:{imageDTOs:c}};if(r)return{id:"gallery-image",payloadType:"IMAGE_DTO",payload:{imageDTO:r}}},[r,c,f]),[m]=sx(),[v]=ax(),b=u.useCallback(()=>{r&&(r.starred&&v({imageDTOs:[r]}),r.starred||m({imageDTOs:[r]}))},[m,v,r]),[y,x]=u.useState(!1),C=u.useCallback(()=>{x(!0)},[]),k=u.useCallback(()=>{x(!1)},[]),j=u.useMemo(()=>{if(r!=null&&r.starred)return a.jsx(Qy,{size:"20"});if(!(r!=null&&r.starred)&&y)return a.jsx(Xy,{size:"20"})},[r==null?void 0:r.starred,y]);return r?a.jsx(Fe,{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(ii,{onClick:s,imageDTO:r,draggableData:h,isSelected:i,minSize:0,imageSx:{w:"full",h:"full"},isDropDisabled:!0,isUploadDisabled:!0,thumbnail:!0,withHoverOverlay:!0,onMouseOver:C,onMouseOut:k,children:a.jsxs(a.Fragment,{children:[a.jsx(eu,{onClick:b,icon:j,tooltip:r.starred?"Unstar":"Star"}),y&&o&&a.jsx(eu,{onClick:p,icon:a.jsx(Jo,{}),tooltip:"Delete",styleOverrides:{bottom:2,top:"auto"}})]})})})}):a.jsx(Nne,{})},zne=u.memo(Fne),Bne=Te((e,t)=>a.jsx(Fe,{className:"item-container",ref:t,p:1.5,children:e.children})),Hne=u.memo(Bne),Wne=Te((e,t)=>{const n=z(r=>r.gallery.galleryImageMinimumWidth);return a.jsx(Vi,{...e,className:"list-container",ref:t,sx:{gridTemplateColumns:`repeat(auto-fill, minmax(${n}px, 1fr));`},children:e.children})}),Vne=u.memo(Wne),Une={defer:!0,options:{scrollbars:{visibility:"auto",autoHide:"scroll",autoHideDelay:1300,theme:"os-theme-dark"},overflow:{x:"hidden"}}},Gne=()=>{const{t:e}=Ie(),t=u.useRef(null),[n,r]=u.useState(null),[o,s]=SO(Une),i=z(C=>C.gallery.selectedBoardId),{currentViewTotal:c}=mne(i),f=z(lx),{currentData:p,isFetching:h,isSuccess:m,isError:v}=n3(f),[b]=r3(),y=u.useMemo(()=>!p||!c?!1:p.ids.length<c,[p,c]),x=u.useCallback(()=>{y&&b({...f,offset:(p==null?void 0:p.ids.length)??0,limit:o3})},[y,b,f,p==null?void 0:p.ids.length]);return u.useEffect(()=>{const{current:C}=t;return n&&C&&o({target:C,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(lo,{label:e("gallery.noImagesInGallery"),icon:Fl})}):m&&p?a.jsxs(a.Fragment,{children:[a.jsx(Fe,{ref:t,"data-overlayscrollbars":"",h:"100%",children:a.jsx(hne,{style:{height:"100%"},data:p.ids,endReached:x,components:{Item:Hne,List:Vne},scrollerRef:r,itemContent:(C,k)=>a.jsx(zne,{imageName:k},k)})}),a.jsx(Wt,{onClick:x,isDisabled:!y,isLoading:h,loadingText:"Loading",flexShrink:0,children:`Load More (${p.ids.length} of ${c})`})]}):v?a.jsx(Fe,{sx:{w:"full",h:"full"},children:a.jsx(lo,{label:"Unable to load Gallery",icon:fJ})}):null:a.jsx($,{sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center"},children:a.jsx(lo,{label:"Loading...",icon:Fl})})},qne=u.memo(Gne),Kne=le([ke],e=>{const{galleryView:t}=e.gallery;return{galleryView:t}},Oe),Xne=()=>{const e=u.useRef(null),t=u.useRef(null),{galleryView:n}=z(Kne),r=se(),{isOpen:o,onToggle:s}=Ao({defaultIsOpen:!0}),i=u.useCallback(()=>{r(iC("images"))},[r]),c=u.useCallback(()=>{r(iC("assets"))},[r]);return a.jsxs(W5,{layerStyle:"first",sx:{flexDirection:"column",h:"full",w:"full",borderRadius:"base",p:2},children:[a.jsxs(Fe,{sx:{w:"full"},children:[a.jsxs($,{ref:e,sx:{alignItems:"center",justifyContent:"space-between",gap:2},children:[a.jsx(ute,{isOpen:o,onToggle:s}),a.jsx(yte,{})]}),a.jsx(Fe,{children:a.jsx(ite,{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(Gl,{index:n==="images"?0:1,variant:"unstyled",size:"sm",sx:{w:"full"},children:a.jsx(ql,{children:a.jsxs(vr,{isAttached:!0,sx:{w:"full"},children:[a.jsx(Ro,{as:Wt,size:"sm",isChecked:n==="images",onClick:i,sx:{w:"full"},leftIcon:a.jsx(CJ,{}),children:"Images"}),a.jsx(Ro,{as:Wt,size:"sm",isChecked:n==="assets",onClick:c,sx:{w:"full"},leftIcon:a.jsx(RJ,{}),children:"Assets"})]})})})}),a.jsx(qne,{})]})]})},Qne=u.memo(Xne),Yne=le(Cs,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:mn}}),Jne=e=>{const t=se(),{btnGroupWidth:n="auto",asIconButton:r=!1,...o}=e,{isProcessing:s,isConnected:i,isCancelable:c,cancelType:f,isCancelScheduled:p,sessionId:h}=z(Yne),m=u.useCallback(()=>{if(h){if(f==="scheduled"){t(_R());return}t(PR({session_id:h}))}},[t,h,f]),{t:v}=Ie(),b=u.useCallback(C=>{const k=Array.isArray(C)?C[0]:C;t(IR(k))},[t]);St("shift+x",()=>{(i||s)&&c&&m()},[i,s,c]);const y=u.useMemo(()=>v(p?"parameters.cancel.isScheduled":f==="immediate"?"parameters.cancel.immediate":"parameters.cancel.schedule"),[v,f,p]),x=u.useMemo(()=>p?a.jsx(Ph,{}):f==="immediate"?a.jsx(wne,{}):a.jsx(bne,{}),[f,p]);return a.jsxs(vr,{isAttached:!0,width:n,children:[r?a.jsx(tt,{icon:x,tooltip:y,"aria-label":y,isDisabled:!i||!s||!c,onClick:m,colorScheme:"error",id:"cancel-button",...o}):a.jsx(Wt,{leftIcon:x,tooltip:y,"aria-label":y,isDisabled:!i||!s||!c,onClick:m,colorScheme:"error",id:"cancel-button",...o,children:"Cancel"}),a.jsxs(yf,{closeOnSelect:!1,children:[a.jsx(wf,{as:tt,tooltip:v("parameters.cancel.setType"),"aria-label":v("parameters.cancel.setType"),icon:a.jsx(Bee,{w:"1em",h:"1em"}),paddingX:0,paddingY:0,colorScheme:"error",minWidth:5,...o}),a.jsx(Ui,{minWidth:"240px",children:a.jsxs(iP,{value:f,title:"Cancel Type",type:"radio",onChange:b,children:[a.jsx(Dh,{value:"immediate",children:v("parameters.cancel.immediate")}),a.jsx(Dh,{value:"scheduled",children:v("parameters.cancel.schedule")})]})})]})]})},XO=u.memo(Jne),Zne=le([ke,jr],(e,t)=>{const{generation:n,system:r,nodes:o}=e,{initialImage:s,model:i}=n,{isProcessing:c,isConnected:f}=r,p=[];return c&&p.push("System busy"),f||p.push("System disconnected"),t==="img2img"&&!s&&p.push("No initial image selected"),t==="nodes"&&o.shouldValidateGraph?(o.nodes.length||p.push("No nodes in graph"),o.nodes.forEach(h=>{if(!Er(h))return;const m=o.nodeTemplates[h.data.type];if(!m){p.push("Missing node template");return}const v=ER([h],o.edges);Wr(h.data.inputs,b=>{const y=m.inputs[b.name],x=v.some(C=>C.target===h.id&&C.targetHandle===b.name);if(!y){p.push("Missing field template");return}if(y.required&&!b.value&&!x){p.push(`${h.data.label||m.title} -> ${b.label||y.title} missing input`);return}})})):(i||p.push("No model selected"),e.controlNet.isEnabled&&uo(e.controlNet.controlNets).forEach((h,m)=>{h.isEnabled&&(h.model||p.push(`ControlNet ${m+1} has no model selected.`),(!h.controlImage||!h.processedControlImage&&h.processorType!=="none")&&p.push(`ControlNet ${m+1} has no control image`))})),{isReady:!p.length,isProcessing:c,reasons:p}},Oe),Df=()=>{const{isReady:e,isProcessing:t,reasons:n}=z(Zne);return{isReady:e,isProcessing:t,reasons:n}},ere=le(Cs,e=>({isProcessing:e.isProcessing,currentStep:e.currentStep,totalSteps:e.totalSteps,currentStatusHasSteps:e.currentStatusHasSteps}),{memoizeOptions:{resultEqualityCheck:mn}}),tre=()=>{const{t:e}=Ie(),{isProcessing:t,currentStep:n,totalSteps:r,currentStatusHasSteps:o}=z(ere),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"})},nre=u.memo(tre);function QO(e){const{asIconButton:t=!1,sx:n,...r}=e,o=se(),{isReady:s,isProcessing:i}=Df(),c=z(jr),f=u.useCallback(()=>{o(af()),o(Vm(c))},[o,c]),{t:p}=Ie();return St(["ctrl+enter","meta+enter"],f,{enabled:()=>s,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[s,c]),a.jsx(Fe,{style:{flexGrow:4},position:"relative",children:a.jsxs(Fe,{style:{position:"relative"},children:[!s&&a.jsx(Fe,{sx:{position:"absolute",bottom:"0",left:"0",right:"0",height:"100%",overflow:"clip",borderRadius:"base",...n},...r,children:a.jsx(nre,{})}),t?a.jsx(tt,{"aria-label":p("parameters.invoke"),type:"submit",icon:a.jsx($k,{}),isDisabled:!s,onClick:f,tooltip:a.jsx(Mb,{}),colorScheme:"accent",isLoading:i,id:"invoke-button","data-progress":i,sx:{w:"full",flexGrow:1,...n},...r}):a.jsx(Wt,{tooltip:a.jsx(Mb,{}),"aria-label":p("parameters.invoke"),type:"submit","data-progress":i,isDisabled:!s,onClick:f,colorScheme:"accent",id:"invoke-button",leftIcon:i?void 0:a.jsx($k,{}),isLoading:i,loadingText:p("parameters.invoke"),sx:{w:"full",flexGrow:1,fontWeight:700,...n},...r,children:"Invoke"})]})})}const rre=le([ke],({gallery:e})=>{const{autoAddBoardId:t}=e;return{autoAddBoardId:t}},Oe),Mb=u.memo(()=>{const{isReady:e,reasons:t}=Df(),{autoAddBoardId:n}=z(rre),r=Fg(n);return a.jsxs($,{flexDir:"column",gap:1,children:[a.jsx(Ee,{fontWeight:600,children:e?"Ready to Invoke":"Unable to Invoke"}),t.length>0&&a.jsx(gf,{children:t.map((o,s)=>a.jsx(Fs,{children:a.jsx(Ee,{fontWeight:400,children:o})},`${o}.${s}`))}),a.jsx(Ko,{opacity:.2,borderColor:"base.50",_dark:{borderColor:"base.900"}}),a.jsxs(Ee,{fontWeight:400,fontStyle:"oblique 10deg",children:["Adding images to"," ",a.jsx(Ee,{as:"span",fontWeight:600,children:r||"Uncategorized"})]})]})});Mb.displayName="InvokeButtonTooltipContent";const ore=()=>a.jsxs($,{layerStyle:"first",sx:{gap:2,borderRadius:"base",p:2},children:[a.jsx(QO,{}),a.jsx(XO,{})]}),YO=u.memo(ore),{createElement:bu,createContext:sre,forwardRef:JO,useCallback:Wa,useContext:ZO,useEffect:ri,useImperativeHandle:eM,useLayoutEffect:are,useMemo:ire,useRef:Uo,useState:Dd}=ex,Oj=ex["useId".toString()],Ad=are,lre=typeof Oj=="function"?Oj:()=>null;let cre=0;function Yy(e=null){const t=lre(),n=Uo(e||t||null);return n.current===null&&(n.current=""+cre++),n.current}const qg=sre(null);qg.displayName="PanelGroupContext";function tM({children:e=null,className:t="",collapsedSize:n=0,collapsible:r=!1,defaultSize:o=null,forwardedRef:s,id:i=null,maxSize:c=null,minSize:f,onCollapse:p=null,onResize:h=null,order:m=null,style:v={},tagName:b="div"}){const y=ZO(qg);if(y===null)throw Error("Panel components must be rendered within a PanelGroup container");const x=Yy(i),{collapsePanel:C,expandPanel:k,getPanelSize:j,getPanelStyle:_,registerPanel:I,resizePanel:O,units:E,unregisterPanel:M}=y;f==null&&(E==="percentages"?f=10:f=0);const R=Uo({onCollapse:p,onResize:h});ri(()=>{R.current.onCollapse=p,R.current.onResize=h});const A=_(x,o),D=Uo({size:Mj(A)}),T=Uo({callbacksRef:R,collapsedSize:n,collapsible:r,defaultSize:o,id:x,idWasAutoGenerated:i==null,maxSize:c,minSize:f,order:m});return Ad(()=>{D.current.size=Mj(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=c,T.current.minSize=f,T.current.order=m}),Ad(()=>(I(x,T),()=>{M(x)}),[m,x,I,M]),eM(s,()=>({collapse:()=>C(x),expand:()=>k(x),getCollapsed(){return D.current.size===0},getId(){return x},getSize(K){return j(x,K)},resize:(K,B)=>O(x,K,B)}),[C,k,j,x,O]),bu(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 Wi=JO((e,t)=>bu(tM,{...e,forwardedRef:t}));tM.displayName="Panel";Wi.displayName="forwardRef(Panel)";function Mj(e){const{flexGrow:t}=e;return typeof t=="string"?parseFloat(t):t}const Hl=10;function yd(e,t,n,r,o,s,i,c){const{id:f,panels:p,units:h}=t,m=h==="pixels"?Di(f):NaN,{sizes:v}=c||{},b=v||s,y=Io(p),x=b.concat();let C=0;{const _=o<0?r:n,I=y.findIndex(R=>R.current.id===_),O=y[I],E=b[I],M=Rb(h,m,O,E,E+Math.abs(o),e);if(E===M)return b;M===0&&E>0&&i.set(_,E),o=o<0?E-M:M-E}let k=o<0?n:r,j=y.findIndex(_=>_.current.id===k);for(;;){const _=y[j],I=b[j],O=Math.abs(o)-Math.abs(C),E=Rb(h,m,_,I,I-O,e);if(I!==E&&(E===0&&I>0&&i.set(_.current.id,I),C+=I-E,x[j]=E,C.toPrecision(Hl).localeCompare(Math.abs(o).toPrecision(Hl),void 0,{numeric:!0})>=0))break;if(o<0){if(--j<0)break}else if(++j>=y.length)break}return C===0?b:(k=o<0?r:n,j=y.findIndex(_=>_.current.id===k),x[j]=b[j]+C,x)}function Sc(e,t,n){t.forEach((r,o)=>{const s=e[o];if(!s)return;const{callbacksRef:i,collapsedSize:c,collapsible:f,id:p}=s.current,h=n[p];if(h!==r){n[p]=r;const{onCollapse:m,onResize:v}=i.current;v&&v(r,h),f&&m&&((h==null||h===c)&&r!==c?m(!1):h!==c&&r===c&&m(!0))}})}function ure({groupId:e,panels:t,units:n}){const r=n==="pixels"?Di(e):NaN,o=Io(t),s=Array(o.length);let i=0,c=100;for(let f=0;f<o.length;f++){const p=o[f],{defaultSize:h}=p.current;h!=null&&(i++,s[f]=n==="pixels"?h/r*100:h,c-=s[f])}for(let f=0;f<o.length;f++){const p=o[f];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,c/y));s[f]=x,i++,c-=x}if(c!==0)for(let f=0;f<o.length;f++){const p=o[f];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[f]+c));if(v!==s[f]&&(c-=v-s[f],s[f]=v,Math.abs(c).toFixed(3)==="0.000"))break}return Math.abs(c).toFixed(3),s}function r1(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 Di(e){const t=Qd(e);if(t==null)return NaN;const n=t.getAttribute("data-panel-group-direction"),r=Jy(e);return n==="horizontal"?t.offsetWidth-r.reduce((o,s)=>o+s.offsetWidth,0):t.offsetHeight-r.reduce((o,s)=>o+s.offsetHeight,0)}function nM(e,t,n){if(e.size===1)return"100";const o=Io(e).findIndex(i=>i.current.id===t),s=n[o];return s==null?"0":s.toPrecision(Hl)}function dre(e){const t=document.querySelector(`[data-panel-id="${e}"]`);return t||null}function Qd(e){const t=document.querySelector(`[data-panel-group-id="${e}"]`);return t||null}function Kg(e){const t=document.querySelector(`[data-panel-resize-handle-id="${e}"]`);return t||null}function fre(e){return rM().findIndex(r=>r.getAttribute("data-panel-resize-handle-id")===e)??null}function rM(){return Array.from(document.querySelectorAll("[data-panel-resize-handle-id]"))}function Jy(e){return Array.from(document.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function Zy(e,t,n){var f,p,h,m;const r=Kg(t),o=Jy(e),s=r?o.indexOf(r):-1,i=((p=(f=n[s])==null?void 0:f.current)==null?void 0:p.id)??null,c=((m=(h=n[s+1])==null?void 0:h.current)==null?void 0:m.id)??null;return[i,c]}function Io(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 Rb(e,t,n,r,o,s=null){var h;let{collapsedSize:i,collapsible:c,maxSize:f,minSize:p}=n.current;if(e==="pixels"&&(i=i/t*100,f!=null&&(f=f/t*100),p=p/t*100),c){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(f??100,Math.max(p,o))}function pre(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 o1({groupId:e,panels:t,nextSizes:n,prevSizes:r,units:o}){n=[...n];const s=Io(t),i=o==="pixels"?Di(e):NaN;let c=0;for(let f=0;f<s.length;f++){const p=s[f],h=r[f],m=n[f],v=Rb(o,i,p,h,m);m!=v&&(c+=m-v,n[f]=v)}if(c.toFixed(3)!=="0.000")for(let f=0;f<s.length;f++){const p=s[f];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[f]+c));if(v!==n[f]&&(c-=v-n[f],n[f]=v,Math.abs(c).toFixed(3)==="0.000"))break}return c.toFixed(3),n}function oM(e,t="Assertion failed!"){if(!e)throw console.error(t),Error(t)}function hre({committedValuesRef:e,groupId:t,panels:n,setSizes:r,sizes:o,panelSizeBeforeCollapse:s}){ri(()=>{const{direction:i,panels:c}=e.current,f=Qd(t);oM(f!=null,`No group found for id "${t}"`);const{height:p,width:h}=f.getBoundingClientRect(),v=Jy(t).map(b=>{const y=b.getAttribute("data-panel-resize-handle-id"),x=Io(c),[C,k]=Zy(t,y,x);if(C==null||k==null)return()=>{};let j=0,_=100,I=0,O=0;x.forEach(T=>{const{id:K,maxSize:B,minSize:G}=T.current;K===C?(j=G,_=B??100):(I+=G,O+=B??100)});const E=Math.min(_,100-I),M=Math.max(j,(x.length-1)*100-O),R=nM(c,C,o);b.setAttribute("aria-valuemax",""+Math.round(E)),b.setAttribute("aria-valuemin",""+Math.round(M)),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(B=>B.current.id===C);if(K>=0){const B=x[K],G=o[K];if(G!=null){let Q=0;G.toPrecision(Hl)<=B.current.minSize.toPrecision(Hl)?Q=i==="horizontal"?h:p:Q=-(i==="horizontal"?h:p);const V=yd(T,e.current,C,k,Q,o,s.current,null);o!==V&&r(V)}}break}}};b.addEventListener("keydown",A);const D=dre(C);return D!=null&&b.setAttribute("aria-controls",D.id),()=>{b.removeAttribute("aria-valuemax"),b.removeAttribute("aria-valuemin"),b.removeAttribute("aria-valuenow"),b.removeEventListener("keydown",A),D!=null&&b.removeAttribute("aria-controls")}});return()=>{v.forEach(b=>b())}},[e,t,n,s,r,o])}function mre({disabled:e,handleId:t,resizeHandler:n}){ri(()=>{if(e||n==null)return;const r=Kg(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=rM(),c=fre(t);oM(c!==null);const f=s.shiftKey?c>0?c-1:i.length-1:c+1<i.length?c+1:0;i[f].focus();break}}};return r.addEventListener("keydown",o),()=>{r.removeEventListener("keydown",o)}},[e,t,n])}function s1(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 sM(e,t,n,r=0,o=null){const s=n==="horizontal";let i=0;if(Db(e))i=s?e.clientX:e.clientY;else if(Ab(e)){const h=e.touches[0];i=s?h.screenX:h.screenY}else return 0;const c=Kg(t),f=o||c.getBoundingClientRect(),p=s?f.left:f.top;return i-p-r}function gre(e,t,n,r,o,s,i){const{dragOffset:c=0,dragHandleRect:f,sizes:p}=i||{},h=p||s;if(vre(e)){const m=o==="horizontal",b=Qd(t).getBoundingClientRect(),y=m?b.width:b.height,x=e.shiftKey?10:100,C=y/x;let k=0;switch(e.key){case"ArrowDown":k=m?0:C;break;case"ArrowLeft":k=m?-C:0;break;case"ArrowRight":k=m?C:0;break;case"ArrowUp":k=m?0:-C;break;case"End":k=y;break;case"Home":k=-y;break}const[j,_]=Zy(t,n,r),I=k<0?j:_,O=r.findIndex(M=>M.current.id===I),E=r[O];if(E.current.collapsible){const M=h[O];(M===0||M.toPrecision(Hl)===E.current.minSize.toPrecision(Hl))&&(k=k<0?-E.current.minSize*y:E.current.minSize*y)}return k}else return sM(e,n,o,c,f)}function vre(e){return e.type==="keydown"}function Db(e){return e.type.startsWith("mouse")}function Ab(e){return e.type.startsWith("touch")}let Nb=null,bl=null;function aM(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 bre(){bl!==null&&(document.head.removeChild(bl),Nb=null,bl=null)}function a1(e){if(Nb===e)return;Nb=e;const t=aM(e);bl===null&&(bl=document.createElement("style"),document.head.appendChild(bl)),bl.innerHTML=`*{cursor: ${t}!important;}`}function xre(e,t=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}function iM(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 lM(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 yre(e,t,n){const r=lM(e,n);if(r){const o=iM(t);return r[o]??null}return null}function wre(e,t,n,r){const o=iM(t),s=lM(e,r)||{};s[o]=n;try{r.setItem(`PanelGroup:sizes:${e}`,JSON.stringify(s))}catch(i){console.error(i)}}const i1={};function Rj(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 wd={getItem:e=>(Rj(wd),wd.getItem(e)),setItem:(e,t)=>{Rj(wd),wd.setItem(e,t)}};function cM({autoSaveId:e,children:t=null,className:n="",direction:r,disablePointerEventsDuringResize:o=!1,forwardedRef:s,id:i=null,onLayout:c,storage:f=wd,style:p={},tagName:h="div",units:m="percentages"}){const v=Yy(i),[b,y]=Dd(null),[x,C]=Dd(new Map),k=Uo(null);Uo({didLogDefaultSizeWarning:!1,didLogIdAndOrderWarning:!1,didLogInvalidLayoutWarning:!1,prevPanelIds:[]});const j=Uo({onLayout:c});ri(()=>{j.current.onLayout=c});const _=Uo({}),[I,O]=Dd([]),E=Uo(new Map),M=Uo(0),R=Uo({direction:r,id:v,panels:x,sizes:I,units:m});eM(s,()=>({getId:()=>v,getLayout:F=>{const{sizes:q,units:te}=R.current;if((F??te)==="pixels"){const ce=Di(v);return q.map(ae=>ae/100*ce)}else return q},setLayout:(F,q)=>{const{id:te,panels:Y,sizes:ce,units:ae}=R.current;if((q||ae)==="pixels"){const ie=Di(te);F=F.map(oe=>oe/ie*100)}const U=_.current,W=Io(Y),ne=o1({groupId:te,panels:Y,nextSizes:F,prevSizes:ce,units:ae});s1(ce,ne)||(O(ne),Sc(W,ne,U))}}),[v]),Ad(()=>{R.current.direction=r,R.current.id=v,R.current.panels=x,R.current.sizes=I,R.current.units=m}),hre({committedValuesRef:R,groupId:v,panels:x,setSizes:O,sizes:I,panelSizeBeforeCollapse:E}),ri(()=>{const{onLayout:F}=j.current,{panels:q,sizes:te}=R.current;if(te.length>0){F&&F(te);const Y=_.current,ce=Io(q);Sc(ce,te,Y)}},[I]),Ad(()=>{const{id:F,sizes:q,units:te}=R.current;if(q.length===x.size)return;let Y=null;if(e){const ce=Io(x);Y=yre(e,ce,f)}if(Y!=null){const ce=o1({groupId:F,panels:x,nextSizes:Y,prevSizes:Y,units:te});O(ce)}else{const ce=ure({groupId:F,panels:x,units:te});O(ce)}},[e,x,f]),ri(()=>{if(e){if(I.length===0||I.length!==x.size)return;const F=Io(x);i1[e]||(i1[e]=xre(wre,100)),i1[e](e,F,I,f)}},[e,x,I,f]),Ad(()=>{if(m==="pixels"){const F=new ResizeObserver(()=>{const{panels:q,sizes:te}=R.current,Y=o1({groupId:v,panels:q,nextSizes:te,prevSizes:te,units:m});s1(te,Y)||O(Y)});return F.observe(Qd(v)),()=>{F.disconnect()}}},[v,m]);const A=Wa((F,q)=>{const{panels:te,units:Y}=R.current,ae=Io(te).findIndex(ne=>ne.current.id===F),U=I[ae];if((q??Y)==="pixels"){const ne=Di(v);return U/100*ne}else return U},[v,I]),D=Wa((F,q)=>{const{panels:te}=R.current;return te.size===0?{flexBasis:0,flexGrow:q??void 0,flexShrink:1,overflow:"hidden"}:{flexBasis:0,flexGrow:nM(te,F,I),flexShrink:1,overflow:"hidden",pointerEvents:o&&b!==null?"none":void 0}},[b,o,I]),T=Wa((F,q)=>{const{units:te}=R.current;pre(te,q),C(Y=>{if(Y.has(F))return Y;const ce=new Map(Y);return ce.set(F,q),ce})},[]),K=Wa(F=>te=>{te.preventDefault();const{direction:Y,panels:ce,sizes:ae}=R.current,U=Io(ce),[W,ne]=Zy(v,F,U);if(W==null||ne==null)return;let ie=gre(te,v,F,U,Y,ae,k.current);if(ie===0)return;const me=Qd(v).getBoundingClientRect(),fe=Y==="horizontal";document.dir==="rtl"&&fe&&(ie=-ie);const he=fe?me.width:me.height,Ce=ie/he*100,xe=yd(te,R.current,W,ne,Ce,ae,E.current,k.current),de=!s1(ae,xe);if((Db(te)||Ab(te))&&M.current!=Ce&&a1(de?fe?"horizontal":"vertical":fe?ie<0?"horizontal-min":"horizontal-max":ie<0?"vertical-min":"vertical-max"),de){const Ne=_.current;O(xe),Sc(U,xe,Ne)}M.current=Ce},[v]),B=Wa(F=>{C(q=>{if(!q.has(F))return q;const te=new Map(q);return te.delete(F),te})},[]),G=Wa(F=>{const{panels:q,sizes:te}=R.current,Y=q.get(F);if(Y==null)return;const{collapsedSize:ce,collapsible:ae}=Y.current;if(!ae)return;const U=Io(q),W=U.indexOf(Y);if(W<0)return;const ne=te[W];if(ne===ce)return;E.current.set(F,ne);const[ie,oe]=r1(F,U);if(ie==null||oe==null)return;const fe=W===U.length-1?ne:ce-ne,he=yd(null,R.current,ie,oe,fe,te,E.current,null);if(te!==he){const Ce=_.current;O(he),Sc(U,he,Ce)}},[]),Q=Wa(F=>{const{panels:q,sizes:te}=R.current,Y=q.get(F);if(Y==null)return;const{collapsedSize:ce,minSize:ae}=Y.current,U=E.current.get(F)||ae;if(!U)return;const W=Io(q),ne=W.indexOf(Y);if(ne<0||te[ne]!==ce)return;const[oe,me]=r1(F,W);if(oe==null||me==null)return;const he=ne===W.length-1?ce-U:U,Ce=yd(null,R.current,oe,me,he,te,E.current,null);if(te!==Ce){const xe=_.current;O(Ce),Sc(W,Ce,xe)}},[]),V=Wa((F,q,te)=>{const{id:Y,panels:ce,sizes:ae,units:U}=R.current;if((te||U)==="pixels"){const It=Di(Y);q=q/It*100}const W=ce.get(F);if(W==null)return;let{collapsedSize:ne,collapsible:ie,maxSize:oe,minSize:me}=W.current;if(U==="pixels"){const It=Di(Y);me=me/It*100,oe!=null&&(oe=oe/It*100)}const fe=Io(ce),he=fe.indexOf(W);if(he<0)return;const Ce=ae[he];if(Ce===q)return;ie&&q===ne||(q=Math.min(oe??100,Math.max(me,q)));const[xe,de]=r1(F,fe);if(xe==null||de==null)return;const De=he===fe.length-1?Ce-q:q-Ce,Xe=yd(null,R.current,xe,de,De,ae,E.current,null);if(ae!==Xe){const It=_.current;O(Xe),Sc(fe,Xe,It)}},[]),L=ire(()=>({activeHandleId:b,collapsePanel:G,direction:r,expandPanel:Q,getPanelSize:A,getPanelStyle:D,groupId:v,registerPanel:T,registerResizeHandle:K,resizePanel:V,startDragging:(F,q)=>{if(y(F),Db(q)||Ab(q)){const te=Kg(F);k.current={dragHandleRect:te.getBoundingClientRect(),dragOffset:sM(q,F,r),sizes:R.current.sizes}}},stopDragging:()=>{bre(),y(null),k.current=null},units:m,unregisterPanel:B}),[b,G,r,Q,A,D,v,T,K,V,m,B]),X={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return bu(qg.Provider,{children:bu(h,{children:t,className:n,"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":v,"data-panel-group-units":m,style:{...X,...p}}),value:L})}const Xg=JO((e,t)=>bu(cM,{...e,forwardedRef:t}));cM.displayName="PanelGroup";Xg.displayName="forwardRef(PanelGroup)";function Tb({children:e=null,className:t="",disabled:n=!1,id:r=null,onDragging:o,style:s={},tagName:i="div"}){const c=Uo(null),f=Uo({onDragging:o});ri(()=>{f.current.onDragging=o});const p=ZO(qg);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,C=Yy(r),k=h===C,[j,_]=Dd(!1),[I,O]=Dd(null),E=Wa(()=>{c.current.blur(),x();const{onDragging:A}=f.current;A&&A(!1)},[x]);ri(()=>{if(n)O(null);else{const R=b(C);O(()=>R)}},[n,C,b]),ri(()=>{if(n||I==null||!k)return;const R=K=>{I(K)},A=K=>{I(K)},T=c.current.ownerDocument;return T.body.addEventListener("contextmenu",E),T.body.addEventListener("mousemove",R),T.body.addEventListener("touchmove",R),T.body.addEventListener("mouseleave",A),window.addEventListener("mouseup",E),window.addEventListener("touchend",E),()=>{T.body.removeEventListener("contextmenu",E),T.body.removeEventListener("mousemove",R),T.body.removeEventListener("touchmove",R),T.body.removeEventListener("mouseleave",A),window.removeEventListener("mouseup",E),window.removeEventListener("touchend",E)}},[m,n,k,I,E]),mre({disabled:n,handleId:C,resizeHandler:I});const M={cursor:aM(m),touchAction:"none",userSelect:"none"};return bu(i,{children:e,className:t,"data-resize-handle-active":k?"pointer":j?"keyboard":void 0,"data-panel-group-direction":m,"data-panel-group-id":v,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":C,onBlur:()=>_(!1),onFocus:()=>_(!0),onMouseDown:R=>{y(C,R.nativeEvent);const{onDragging:A}=f.current;A&&A(!0)},onMouseUp:E,onTouchCancel:E,onTouchEnd:E,onTouchStart:R=>{y(C,R.nativeEvent);const{onDragging:A}=f.current;A&&A(!0)},ref:c,role:"separator",style:{...M,...s},tabIndex:0})}Tb.displayName="PanelResizeHandle";const Cre=e=>{const{direction:t="horizontal",collapsedDirection:n,isCollapsed:r=!1,...o}=e,s=Rl("base.100","base.850"),i=Rl("base.300","base.700");return t==="horizontal"?a.jsx(Tb,{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(Fe,{sx:{w:1,h:"calc(100% - 1rem)",borderRadius:"base",transitionProperty:"common",transitionDuration:"normal"}})})}):a.jsx(Tb,{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(Fe,{sx:{h:1,w:"calc(100% - 1rem)",borderRadius:"base",transitionProperty:"common",transitionDuration:"normal"}})})})},Am=u.memo(Cre),e2=()=>{const e=se(),t=z(o=>o.ui.panels),n=u.useCallback(o=>t[o]??"",[t]),r=u.useCallback((o,s)=>{e(OR({name:o,value:s}))},[e]);return{getItem:n,setItem:r}};const Sre=e=>{const{label:t,data:n,fileName:r,withDownload:o=!0,withCopy:s=!0}=e,i=u.useMemo(()=>MR(n)?n:JSON.stringify(n,null,2),[n]),c=u.useCallback(()=>{navigator.clipboard.writeText(i)},[i]),f=u.useCallback(()=>{const p=new Blob([i]),h=document.createElement("a");h.href=URL.createObjectURL(p),h.download=`${r||t}.json`,document.body.appendChild(h),h.click(),h.remove()},[i,t,r]);return a.jsxs($,{layerStyle:"second",sx:{borderRadius:"base",flexGrow:1,w:"full",h:"full",position:"relative"},children:[a.jsx(Fe,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"auto",p:4,fontSize:"sm"},children:a.jsx($g,{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(Mn,{label:`Download ${t} JSON`,children:a.jsx(wa,{"aria-label":`Download ${t} JSON`,icon:a.jsx(Ig,{}),variant:"ghost",opacity:.7,onClick:f})}),s&&a.jsx(Mn,{label:`Copy ${t} JSON`,children:a.jsx(wa,{"aria-label":`Copy ${t} JSON`,icon:a.jsx(Du,{}),variant:"ghost",opacity:.7,onClick:c})})]})]})},Pl=u.memo(Sre),kre=le(ke,({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}},Oe),jre=()=>{const{data:e}=z(kre);return e?a.jsx(Pl,{data:e,label:"Node Data"}):a.jsx(lo,{label:"No node selected",icon:null})},_re=u.memo(jre),Pre=e=>a.jsx($,{sx:{w:"full",h:"full",position:"relative"},children:a.jsx(Fe,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0},children:a.jsx($g,{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})})}),t2=u.memo(Pre),Ire=({output:e})=>{const{image:t}=e,{data:n}=qo(t.image_name);return a.jsx(ii,{imageDTO:n})},Ere=u.memo(Ire),Ore=le(ke,({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}},Oe),Mre=()=>{const{node:e,template:t,nes:n}=z(Ore);return!e||!n||!Er(e)?a.jsx(lo,{label:"No node selected",icon:null}):n.outputs.length===0?a.jsx(lo,{label:"No outputs recorded",icon:null}):a.jsx(Fe,{sx:{position:"relative",w:"full",h:"full"},children:a.jsx(t2,{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((r,o)=>a.jsx(Ere,{output:r},Dre(r,o))):a.jsx(Pl,{data:n.outputs,label:"Node Outputs"})})})})},Rre=u.memo(Mre),Dre=(e,t)=>`${e.type}-${t}`,Are=le(ke,({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}},Oe),Nre=()=>{const{template:e}=z(Are);return e?a.jsx(Pl,{data:e,label:"Node Template"}):a.jsx(lo,{label:"No node selected",icon:null})},Tre=u.memo(Nre),$re=()=>a.jsx($,{layerStyle:"first",sx:{flexDir:"column",w:"full",h:"full",borderRadius:"base",p:2,gap:2},children:a.jsxs(Gl,{variant:"line",sx:{display:"flex",flexDir:"column",w:"full",h:"full"},children:[a.jsxs(ql,{children:[a.jsx(Ro,{children:"Outputs"}),a.jsx(Ro,{children:"Data"}),a.jsx(Ro,{children:"Template"})]}),a.jsxs(Ou,{children:[a.jsx(bs,{children:a.jsx(Rre,{})}),a.jsx(bs,{children:a.jsx(_re,{})}),a.jsx(bs,{children:a.jsx(Tre,{})})]})]})}),Lre=u.memo($re),n2=e=>{e.stopPropagation()},Fre={display:"flex",flexDirection:"row",alignItems:"center",gap:10},zre=e=>{const{label:t="",labelPos:n="top",isDisabled:r=!1,isInvalid:o,formControlProps:s,...i}=e,c=se(),f=u.useCallback(h=>{h.shiftKey&&c(Do(!0))},[c]),p=u.useCallback(h=>{h.shiftKey||c(Do(!1))},[c]);return a.jsxs(pr,{isInvalid:o,isDisabled:r,...s,style:n==="side"?Fre:void 0,children:[t!==""&&a.jsx(Jr,{children:t}),a.jsx(ng,{...i,onPaste:n2,onKeyDown:f,onKeyUp:p})]})},hs=u.memo(zre),Bre=Te((e,t)=>{const n=se(),r=u.useCallback(s=>{s.shiftKey&&n(Do(!0))},[n]),o=u.useCallback(s=>{s.shiftKey||n(Do(!1))},[n]);return a.jsx(zP,{ref:t,onPaste:n2,onKeyDown:r,onKeyUp:o,...e})}),li=u.memo(Bre),Hre=le(ke,({nodes:e})=>{const{author:t,name:n,description:r,tags:o,version:s,contact:i,notes:c}=e.workflow;return{name:n,author:t,description:r,tags:o,version:s,contact:i,notes:c}},Oe),Wre=()=>{const{author:e,name:t,description:n,tags:r,version:o,contact:s,notes:i}=z(Hre),c=se(),f=u.useCallback(x=>{c(RR(x.target.value))},[c]),p=u.useCallback(x=>{c(DR(x.target.value))},[c]),h=u.useCallback(x=>{c(AR(x.target.value))},[c]),m=u.useCallback(x=>{c(NR(x.target.value))},[c]),v=u.useCallback(x=>{c(TR(x.target.value))},[c]),b=u.useCallback(x=>{c($R(x.target.value))},[c]),y=u.useCallback(x=>{c(LR(x.target.value))},[c]);return a.jsx(t2,{children:a.jsxs($,{sx:{flexDir:"column",alignItems:"flex-start",gap:2,h:"full"},children:[a.jsxs($,{sx:{gap:2,w:"full"},children:[a.jsx(hs,{label:"Name",value:t,onChange:f}),a.jsx(hs,{label:"Version",value:o,onChange:m})]}),a.jsxs($,{sx:{gap:2,w:"full"},children:[a.jsx(hs,{label:"Author",value:e,onChange:p}),a.jsx(hs,{label:"Contact",value:s,onChange:h})]}),a.jsx(hs,{label:"Tags",value:r,onChange:b}),a.jsxs(pr,{as:$,sx:{flexDir:"column"},children:[a.jsx(Jr,{children:"Short Description"}),a.jsx(li,{onChange:v,value:n,fontSize:"sm",sx:{resize:"none"}})]}),a.jsxs(pr,{as:$,sx:{flexDir:"column",h:"full"},children:[a.jsx(Jr,{children:"Notes"}),a.jsx(li,{onChange:y,value:i,fontSize:"sm",sx:{h:"full",resize:"none"}})]})]})})},Vre=u.memo(Wre);function Ure(e,t,n){var r=this,o=u.useRef(null),s=u.useRef(0),i=u.useRef(null),c=u.useRef([]),f=u.useRef(),p=u.useRef(),h=u.useRef(e),m=u.useRef(!0);u.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,C=x?Math.max(+n.maxWait||0,t):null;u.useEffect(function(){return m.current=!0,function(){m.current=!1}},[]);var k=u.useMemo(function(){var j=function(R){var A=c.current,D=f.current;return c.current=f.current=null,s.current=R,p.current=h.current.apply(D,A)},_=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>=C},O=function(R){return i.current=null,y&&c.current?j(R):(c.current=f.current=null,p.current)},E=function R(){var A=Date.now();if(I(A))return O(A);if(m.current){var D=t-(A-o.current),T=x?Math.min(D,C-(A-s.current)):D;_(R,T)}},M=function(){var R=Date.now(),A=I(R);if(c.current=[].slice.call(arguments),f.current=r,o.current=R,A){if(!i.current&&m.current)return s.current=o.current,_(E,t),b?j(o.current):p.current;if(x)return _(E,t),j(o.current)}return i.current||_(E,t),p.current};return M.cancel=function(){i.current&&(v?cancelAnimationFrame(i.current):clearTimeout(i.current)),s.current=0,c.current=o.current=f.current=i.current=null},M.isPending=function(){return!!i.current},M.flush=function(){return i.current?O(Date.now()):p.current},M},[b,x,t,C,y,v]);return k}function Gre(e,t){return e===t}function Dj(e){return typeof e=="function"?function(){return e}:e}function qre(e,t,n){var r,o,s=n&&n.equalityFn||Gre,i=(r=u.useState(Dj(e)),o=r[1],[r[0],u.useCallback(function(m){return o(Dj(m))},[])]),c=i[0],f=i[1],p=Ure(u.useCallback(function(m){return f(m)},[f]),t,n),h=u.useRef(e);return s(h.current,e)||(p(e),h.current=e),[c,p]}const uM=()=>{const e=z(r=>r.nodes),[t]=qre(e,300);return u.useMemo(()=>FR(t),[t])},Kre=()=>{const e=uM();return a.jsx($,{sx:{flexDir:"column",alignItems:"flex-start",gap:2,h:"full"},children:a.jsx(Pl,{data:e,label:"Workflow"})})},Xre=u.memo(Kre),Qre=({isSelected:e,isHovered:t})=>{const n=u.useMemo(()=>{if(e&&t)return"nodeHoveredSelected.light";if(e)return"nodeSelected.light";if(t)return"nodeHovered.light"},[t,e]),r=u.useMemo(()=>{if(e&&t)return"nodeHoveredSelected.dark";if(e)return"nodeSelected.dark";if(t)return"nodeHovered.dark"},[t,e]);return a.jsx(Fe,{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}}})},dM=u.memo(Qre),fM=e=>{const t=se(),n=u.useMemo(()=>le(ke,({nodes:i})=>i.mouseOverNode===e,Oe),[e]),r=z(n),o=u.useCallback(()=>{!r&&t(lC(e))},[t,e,r]),s=u.useCallback(()=>{r&&t(lC(null))},[t,r]);return{isMouseOverNode:r,handleMouseOver:o,handleMouseOut:s}},pM=(e,t)=>{const n=u.useMemo(()=>le(ke,({nodes:o})=>{var i;const s=o.nodes.find(c=>c.id===e);if(Er(s))return(i=s==null?void 0:s.data.inputs[t])==null?void 0:i.label},Oe),[t,e]);return z(n)},hM=(e,t,n)=>{const r=u.useMemo(()=>le(ke,({nodes:s})=>{var f;const i=s.nodes.find(p=>p.id===e);if(!Er(i))return;const c=s.nodeTemplates[(i==null?void 0:i.data.type)??""];return(f=c==null?void 0:c[cx[n]][t])==null?void 0:f.title},Oe),[t,n,e]);return z(r)},mM=(e,t)=>{const n=u.useMemo(()=>le(ke,({nodes:o})=>{const s=o.nodes.find(i=>i.id===e);if(Er(s))return s==null?void 0:s.data.inputs[t]},Oe),[t,e]);return z(n)},Qg=(e,t,n)=>{const r=u.useMemo(()=>le(ke,({nodes:s})=>{const i=s.nodes.find(f=>f.id===e);if(!Er(i))return;const c=s.nodeTemplates[(i==null?void 0:i.data.type)??""];return c==null?void 0:c[cx[n]][t]},Oe),[t,n,e]);return z(r)},Yre=({nodeId:e,fieldName:t,kind:n})=>{const r=mM(e,t),o=Qg(e,t,n),s=zR(o),i=u.useMemo(()=>BR(r)?r.label&&(o!=null&&o.title)?`${r.label} (${o.title})`:r.label&&!o?r.label:!r.label&&o?o.title:"Unknown Field":(o==null?void 0:o.title)||"Unknown Field",[r,o]);return a.jsxs($,{sx:{flexDir:"column"},children:[a.jsx(Ee,{sx:{fontWeight:600},children:i}),o&&a.jsx(Ee,{sx:{opacity:.7,fontStyle:"oblique 5deg"},children:o.description}),o&&a.jsxs(Ee,{children:["Type: ",lf[o.type].title]}),s&&a.jsxs(Ee,{children:["Input: ",HR(o.input)]})]})},r2=u.memo(Yre),Jre=Te((e,t)=>{const{nodeId:n,fieldName:r,kind:o,isMissingInput:s=!1,withTooltip:i=!1}=e,c=pM(n,r),f=hM(n,r,o),p=se(),[h,m]=u.useState(c||f||"Unknown Field"),v=u.useCallback(async y=>{y&&(y===c||y===f)||(m(y||f||"Unknown Field"),p(WR({nodeId:n,fieldName:r,label:y})))},[c,f,p,n,r]),b=u.useCallback(y=>{m(y)},[]);return u.useEffect(()=>{m(c||f||"Unknown Field")},[c,f]),a.jsx(Mn,{label:i?a.jsx(r2,{nodeId:n,fieldName:r,kind:"input"}):void 0,openDelay:Um,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(Zm,{value:h,onChange:b,onSubmit:v,as:$,sx:{position:"relative",alignItems:"center",h:"full"},children:[a.jsx(Jm,{sx:{p:0,fontWeight:s?600:400,textAlign:"left",_hover:{fontWeight:"600 !important"}},noOfLines:1}),a.jsx(Ym,{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(vM,{})]})})})}),gM=u.memo(Jre),vM=u.memo(()=>{const{isEditing:e,getEditButtonProps:t}=Y3(),n=u.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"})});vM.displayName="EditableControls";const Zre=e=>{const{nodeId:t,field:n}=e,r=se(),o=u.useCallback(s=>{r(VR({nodeId:t,fieldName:n.name,value:s.target.checked}))},[r,n.name,t]);return a.jsx(sy,{className:"nodrag",onChange:o,isChecked:n.value})},eoe=u.memo(Zre),toe=e=>null,noe=u.memo(toe),roe=e=>null,ooe=u.memo(roe),soe=e=>null,aoe=u.memo(soe);function Yg(){return(Yg=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 bM(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 $b(e){var t=u.useRef(e),n=u.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var xu=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e<t?t:e},Nd=function(e){return"touches"in e},Lb=function(e){return e&&e.ownerDocument.defaultView||self},Aj=function(e,t,n){var r=e.getBoundingClientRect(),o=Nd(t)?function(s,i){for(var c=0;c<s.length;c++)if(s[c].identifier===i)return s[c];return s[0]}(t.touches,n):t;return{left:xu((o.pageX-(r.left+Lb(e).pageXOffset))/r.width),top:xu((o.pageY-(r.top+Lb(e).pageYOffset))/r.height)}},Nj=function(e){!Nd(e)&&e.preventDefault()},o2=H.memo(function(e){var t=e.onMove,n=e.onKey,r=bM(e,["onMove","onKey"]),o=u.useRef(null),s=$b(t),i=$b(n),c=u.useRef(null),f=u.useRef(!1),p=u.useMemo(function(){var b=function(C){Nj(C),(Nd(C)?C.touches.length>0:C.buttons>0)&&o.current?s(Aj(o.current,C,c.current)):x(!1)},y=function(){return x(!1)};function x(C){var k=f.current,j=Lb(o.current),_=C?j.addEventListener:j.removeEventListener;_(k?"touchmove":"mousemove",b),_(k?"touchend":"mouseup",y)}return[function(C){var k=C.nativeEvent,j=o.current;if(j&&(Nj(k),!function(I,O){return O&&!Nd(I)}(k,f.current)&&j)){if(Nd(k)){f.current=!0;var _=k.changedTouches||[];_.length&&(c.current=_[0].identifier)}j.focus(),s(Aj(j,k,c.current)),x(!0)}},function(C){var k=C.which||C.keyCode;k<37||k>40||(C.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 u.useEffect(function(){return v},[v]),H.createElement("div",Yg({},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(" ")},s2=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}}))},xo=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},xM=function(e){var t=e.s,n=e.v,r=e.a,o=(200-t)*n/100;return{h:xo(e.h),s:xo(o>0&&o<200?t*n/100/(o<=100?o:200-o)*100:0),l:xo(o/2),a:xo(r,2)}},Fb=function(e){var t=xM(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},l1=function(e){var t=xM(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},ioe=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),c=r*(1-(t-s)*n),f=r*(1-(1-t+s)*n),p=s%6;return{r:xo(255*[r,c,i,i,f,r][p]),g:xo(255*[f,r,r,c,i,i][p]),b:xo(255*[i,i,f,r,r,c][p]),a:xo(o,2)}},loe=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),c=i?s===t?(n-r)/i:s===n?2+(r-t)/i:4+(t-n)/i:0;return{h:xo(60*(c<0?c+6:c)),s:xo(s?i/s*100:0),v:xo(s/255*100),a:o}},coe=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(o2,{onMove:function(o){n({h:360*o.left})},onKey:function(o){n({h:xu(t+360*o.left,0,360)})},"aria-label":"Hue","aria-valuenow":xo(t),"aria-valuemax":"360","aria-valuemin":"0"},H.createElement(s2,{className:"react-colorful__hue-pointer",left:t/360,color:Fb({h:t,s:100,v:100,a:1})})))}),uoe=H.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:Fb({h:t.h,s:100,v:100,a:1})};return H.createElement("div",{className:"react-colorful__saturation",style:r},H.createElement(o2,{onMove:function(o){n({s:100*o.left,v:100-100*o.top})},onKey:function(o){n({s:xu(t.s+100*o.left,0,100),v:xu(t.v-100*o.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+xo(t.s)+"%, Brightness "+xo(t.v)+"%"},H.createElement(s2,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:Fb(t)})))}),yM=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function doe(e,t,n){var r=$b(n),o=u.useState(function(){return e.toHsva(t)}),s=o[0],i=o[1],c=u.useRef({color:t,hsva:s});u.useEffect(function(){if(!e.equal(t,c.current.color)){var p=e.toHsva(t);c.current={hsva:p,color:t},i(p)}},[t,e]),u.useEffect(function(){var p;yM(s,c.current.hsva)||e.equal(p=e.fromHsva(s),c.current.color)||(c.current={hsva:s,color:p},r(p))},[s,e,r]);var f=u.useCallback(function(p){i(function(h){return Object.assign({},h,p)})},[]);return[s,f]}var foe=typeof window<"u"?u.useLayoutEffect:u.useEffect,poe=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},Tj=new Map,hoe=function(e){foe(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!Tj.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}`,Tj.set(t,n);var r=poe();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},moe=function(e){var t=e.className,n=e.hsva,r=e.onChange,o={backgroundImage:"linear-gradient(90deg, "+l1(Object.assign({},n,{a:0}))+", "+l1(Object.assign({},n,{a:1}))+")"},s=Jg(["react-colorful__alpha",t]),i=xo(100*n.a);return H.createElement("div",{className:s},H.createElement("div",{className:"react-colorful__alpha-gradient",style:o}),H.createElement(o2,{onMove:function(c){r({a:c.left})},onKey:function(c){r({a:xu(n.a+c.left)})},"aria-label":"Alpha","aria-valuetext":i+"%","aria-valuenow":i,"aria-valuemin":"0","aria-valuemax":"100"},H.createElement(s2,{className:"react-colorful__alpha-pointer",left:n.a,color:l1(n)})))},goe=function(e){var t=e.className,n=e.colorModel,r=e.color,o=r===void 0?n.defaultColor:r,s=e.onChange,i=bM(e,["className","colorModel","color","onChange"]),c=u.useRef(null);hoe(c);var f=doe(n,o,s),p=f[0],h=f[1],m=Jg(["react-colorful",t]);return H.createElement("div",Yg({},i,{ref:c,className:m}),H.createElement(uoe,{hsva:p,onChange:h}),H.createElement(coe,{hue:p.h,onChange:h}),H.createElement(moe,{hsva:p,onChange:h,className:"react-colorful__last-control"}))},voe={defaultColor:{r:0,g:0,b:0,a:1},toHsva:loe,fromHsva:ioe,equal:yM},wM=function(e){return H.createElement(goe,Yg({},e,{colorModel:voe}))};const boe=e=>{const{nodeId:t,field:n}=e,r=se(),o=u.useCallback(s=>{r(UR({nodeId:t,fieldName:n.name,value:s}))},[r,n.name,t]);return a.jsx(wM,{className:"nodrag",color:n.value,onChange:o})},xoe=u.memo(boe),yoe=e=>null,woe=u.memo(yoe),Coe=e=>null,Soe=u.memo(Coe),CM=e=>{const t=Su("models"),[n,r,o]=e.split("/"),s=GR.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},koe=e=>{const{nodeId:t,field:n}=e,r=n.value,o=se(),{data:s}=ux(),i=u.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]),c=u.useMemo(()=>{if(!s)return[];const p=[];return Wr(s.entities,(h,m)=>{h&&p.push({value:m,label:h.model_name,group:xr[h.base_model]})}),p},[s]),f=u.useCallback(p=>{if(!p)return;const h=CM(p);h&&o(qR({nodeId:t,fieldName:n.name,value:h}))},[o,n.name,t]);return a.jsx(Zr,{className:"nowheel nodrag",tooltip:i==null?void 0:i.description,value:(i==null?void 0:i.id)??null,placeholder:"Pick one",error:!i,data:c,onChange:f,sx:{width:"100%"}})},joe=u.memo(koe),_oe=e=>null,Poe=u.memo(_oe),Ioe=e=>{const{nodeId:t,field:n,fieldTemplate:r}=e,o=se(),s=u.useCallback(i=>{o(KR({nodeId:t,fieldName:n.name,value:i.target.value}))},[o,n.name,t]);return a.jsx(_P,{className:"nowheel nodrag",onChange:s,value:n.value,children:r.options.map(i=>a.jsx("option",{children:i},i))})},Eoe=u.memo(Ioe),Ooe=e=>{var c;const{nodeId:t,field:n}=e,r={id:`node-${t}-${n.name}`,actionType:"SET_MULTI_NODES_IMAGE",context:{nodeId:t,fieldName:n.name}},{isOver:o,setNodeRef:s,active:i}=Fy({id:`node_${t}`,data:r});return a.jsxs($,{ref:s,sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center",position:"relative",minH:"10rem"},children:[(c=n.value)==null?void 0:c.map(({image_name:f})=>a.jsx(Roe,{imageName:f},f)),zy(r,i)&&a.jsx(By,{isOver:o})]})},Moe=u.memo(Ooe),Roe=e=>{const{currentData:t}=qo(e.imageName);return a.jsx(ii,{imageDTO:t,isDropDisabled:!0,isDragDisabled:!0})},Doe=e=>{var p;const{nodeId:t,field:n}=e,r=se(),{currentData:o}=qo(((p=n.value)==null?void 0:p.image_name)??Yo.skipToken),s=u.useCallback(()=>{r(XR({nodeId:t,fieldName:n.name,value:void 0}))},[r,n.name,t]),i=u.useMemo(()=>{if(o)return{id:`node-${t}-${n.name}`,payloadType:"IMAGE_DTO",payload:{imageDTO:o}}},[n.name,o,t]),c=u.useMemo(()=>({id:`node-${t}-${n.name}`,actionType:"SET_NODES_IMAGE",context:{nodeId:t,fieldName:n.name}}),[n.name,t]),f=u.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(ii,{imageDTO:o,droppableData:c,draggableData:i,postUploadAction:f,useThumbailFallback:!0,uploadElement:a.jsx(SM,{}),dropLabel:a.jsx(kM,{}),minSize:8,children:a.jsx(eu,{onClick:s,icon:o?a.jsx(Og,{}):void 0,tooltip:"Reset Image"})})})},Aoe=u.memo(Doe),SM=u.memo(()=>a.jsx(Ee,{fontSize:16,fontWeight:600,children:"Drop or Upload"}));SM.displayName="UploadElement";const kM=u.memo(()=>a.jsx(Ee,{fontSize:16,fontWeight:600,children:"Drop"}));kM.displayName="DropLabel";const Noe=e=>null,Toe=u.memo(Noe),$oe=e=>{const t=Su("models"),[n,r,o]=e.split("/"),s=QR.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=se(),{data:s}=Gm(),i=u.useMemo(()=>{if(!s)return[];const p=[];return Wr(s.entities,(h,m)=>{h&&p.push({value:m,label:h.model_name,group:xr[h.base_model]})}),p.sort((h,m)=>h.disabled&&!m.disabled?1:-1)},[s]),c=u.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]),f=u.useCallback(p=>{if(!p)return;const h=$oe(p);h&&o(YR({nodeId:t,fieldName:n.name,value:h}))},[o,n.name,t]);return(s==null?void 0:s.ids.length)===0?a.jsx($,{sx:{justifyContent:"center",p:2},children:a.jsx(Ee,{sx:{fontSize:"sm",color:"base.500",_dark:"base.700"},children:"No LoRAs Loaded"})}):a.jsx(Kn,{className:"nowheel nodrag",value:(c==null?void 0:c.id)??null,placeholder:i.length>0?"Select a LoRA":"No LoRAs available",data:i,nothingFound:"No matching LoRAs",itemComponent:tl,disabled:i.length===0,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())},error:!c,onChange:f,sx:{width:"100%",".mantine-Select-dropdown":{width:"16rem !important"}}})},Foe=u.memo(Loe),Zg=e=>{const t=Su("models"),[n,r,o]=e.split("/"),s=JR.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 Nu(e){const{iconMode:t=!1,...n}=e,r=se(),{t:o}=Ie(),[s,{isLoading:i}]=ZR(),c=()=>{s().unwrap().then(f=>{r(Cn(_n({title:`${o("modelManager.modelsSynced")}`,status:"success"})))}).catch(f=>{f&&r(Cn(_n({title:`${o("modelManager.modelSyncFailed")}`,status:"error"})))})};return t?a.jsx(tt,{icon:a.jsx(GE,{}),tooltip:o("modelManager.syncModels"),"aria-label":o("modelManager.syncModels"),isLoading:i,onClick:c,size:"sm",...n}):a.jsx(Wt,{isLoading:i,onClick:c,minW:"max-content",...n,children:"Sync Models"})}const zoe=e=>{var b,y;const{nodeId:t,field:n}=e,r=se(),o=Yn("syncModels").isFeatureEnabled,{data:s,isLoading:i}=Td(cC),{data:c,isLoading:f}=Gs(cC),p=u.useMemo(()=>i||f,[i,f]),h=u.useMemo(()=>{if(!c)return[];const x=[];return Wr(c.entities,(C,k)=>{C&&x.push({value:k,label:C.model_name,group:xr[C.base_model]})}),s&&Wr(s.entities,(C,k)=>{C&&x.push({value:k,label:C.model_name,group:xr[C.base_model]})}),x},[c,s]),m=u.useMemo(()=>{var x,C,k,j;return((c==null?void 0:c.entities[`${(x=n.value)==null?void 0:x.base_model}/main/${(C=n.value)==null?void 0:C.model_name}`])||(s==null?void 0:s.entities[`${(k=n.value)==null?void 0:k.base_model}/onnx/${(j=n.value)==null?void 0:j.model_name}`]))??null},[(b=n.value)==null?void 0:b.base_model,(y=n.value)==null?void 0:y.model_name,c==null?void 0:c.entities,s==null?void 0:s.entities]),v=u.useCallback(x=>{if(!x)return;const C=Zg(x);C&&r(s3({nodeId:t,fieldName:n.name,value:C}))},[r,n.name,t]);return a.jsxs($,{sx:{w:"full",alignItems:"center",gap:2},children:[p?a.jsx(Ee,{variant:"subtext",children:"Loading..."}):a.jsx(Kn,{className:"nowheel nodrag",tooltip:m==null?void 0:m.description,value:m==null?void 0:m.id,placeholder:h.length>0?"Select a model":"No models available",data:h,error:!m,disabled:h.length===0,onChange:v,sx:{width:"100%",".mantine-Select-dropdown":{width:"16rem !important"}}}),o&&a.jsx(Nu,{className:"nodrag",iconMode:!0})]})},Boe=u.memo(zoe),Nm=/^-?(0\.)?\.?$/,Hoe=e=>{const{label:t,isDisabled:n=!1,showStepper:r=!0,isInvalid:o,value:s,onChange:i,min:c,max:f,isInteger:p=!0,formControlProps:h,formLabelProps:m,numberInputFieldProps:v,numberInputStepperProps:b,tooltipProps:y,...x}=e,C=se(),[k,j]=u.useState(String(s));u.useEffect(()=>{!k.match(Nm)&&s!==Number(k)&&j(String(s))},[s,k]);const _=M=>{j(M),M.match(Nm)||i(p?Math.floor(Number(M)):Number(M))},I=M=>{const R=El(p?Math.floor(Number(M.target.value)):Number(M.target.value),c,f);j(String(R)),i(R)},O=u.useCallback(M=>{M.shiftKey&&C(Do(!0))},[C]),E=u.useCallback(M=>{M.shiftKey||C(Do(!1))},[C]);return a.jsx(Mn,{...y,children:a.jsxs(pr,{isDisabled:n,isInvalid:o,...h,children:[t&&a.jsx(Jr,{...m,children:t}),a.jsxs(ig,{value:k,min:c,max:f,keepWithinRange:!0,clampValueOnBlur:!1,onChange:_,onBlur:I,...x,onPaste:n2,children:[a.jsx(cg,{...v,onKeyDown:O,onKeyUp:E}),r&&a.jsxs(lg,{children:[a.jsx(dg,{...b}),a.jsx(ug,{...b})]})]})]})})},Tu=u.memo(Hoe),Woe=e=>{const{nodeId:t,field:n,fieldTemplate:r}=e,o=se(),[s,i]=u.useState(String(n.value)),c=u.useMemo(()=>r.type==="integer",[r.type]),f=p=>{i(p),p.match(Nm)||o(eD({nodeId:t,fieldName:n.name,value:c?Math.floor(Number(p)):Number(p)}))};return u.useEffect(()=>{!s.match(Nm)&&n.value!==Number(s)&&i(String(n.value))},[n.value,s]),a.jsxs(ig,{onChange:f,value:s,step:c?1:.1,precision:c?0:3,children:[a.jsx(cg,{className:"nodrag"}),a.jsxs(lg,{children:[a.jsx(dg,{}),a.jsx(ug,{})]})]})},Voe=u.memo(Woe),Uoe=e=>{var m,v;const{nodeId:t,field:n}=e,r=se(),{t:o}=Ie(),s=Yn("syncModels").isFeatureEnabled,{data:i,isLoading:c}=Gs(dx),f=u.useMemo(()=>{if(!i)return[];const b=[];return Wr(i.entities,(y,x)=>{y&&b.push({value:x,label:y.model_name,group:xr[y.base_model]})}),b},[i]),p=u.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=u.useCallback(b=>{if(!b)return;const y=Zg(b);y&&r(tD({nodeId:t,fieldName:n.name,value:y}))},[r,n.name,t]);return c?a.jsx(Kn,{label:o("modelManager.model"),placeholder:"Loading...",disabled:!0,data:[]}):a.jsxs($,{w:"100%",alignItems:"center",gap:2,children:[a.jsx(Kn,{className:"nowheel nodrag",tooltip:p==null?void 0:p.description,value:p==null?void 0:p.id,placeholder:f.length>0?"Select a model":"No models available",data:f,error:!p,disabled:f.length===0,onChange:h,sx:{width:"100%",".mantine-Select-dropdown":{width:"16rem !important"}}}),s&&a.jsx(Nu,{className:"nodrag",iconMode:!0})]})},Goe=u.memo(Uoe),qoe=e=>{var v,b;const{nodeId:t,field:n}=e,r=se(),{t:o}=Ie(),s=Yn("syncModels").isFeatureEnabled,{data:i}=Td(uC),{data:c,isLoading:f}=Gs(uC),p=u.useMemo(()=>{if(!c)return[];const y=[];return Wr(c.entities,(x,C)=>{!x||x.base_model!=="sdxl"||y.push({value:C,label:x.model_name,group:xr[x.base_model]})}),i&&Wr(i.entities,(x,C)=>{!x||x.base_model!=="sdxl"||y.push({value:C,label:x.model_name,group:xr[x.base_model]})}),y},[c,i]),h=u.useMemo(()=>{var y,x,C,k;return((c==null?void 0:c.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[`${(C=n.value)==null?void 0:C.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,c==null?void 0:c.entities,i==null?void 0:i.entities]),m=u.useCallback(y=>{if(!y)return;const x=Zg(y);x&&r(s3({nodeId:t,fieldName:n.name,value:x}))},[r,n.name,t]);return f?a.jsx(Kn,{label:o("modelManager.model"),placeholder:"Loading...",disabled:!0,data:[]}):a.jsxs($,{w:"100%",alignItems:"center",gap:2,children:[a.jsx(Kn,{className:"nowheel nodrag",tooltip:h==null?void 0:h.description,value:h==null?void 0:h.id,placeholder:p.length>0?"Select a model":"No models available",data:p,error:!h,disabled:p.length===0,onChange:m,sx:{width:"100%",".mantine-Select-dropdown":{width:"16rem !important"}}}),s&&a.jsx(Nu,{className:"nodrag",iconMode:!0})]})},Koe=u.memo(qoe),Xoe=le([ke],({ui:e})=>{const{favoriteSchedulers:t}=e;return{data:uo(zm,(r,o)=>({value:o,label:r,group:t.includes(o)?"Favorites":void 0})).sort((r,o)=>r.label.localeCompare(o.label))}},Oe),Qoe=e=>{const{nodeId:t,field:n}=e,r=se(),{data:o}=z(Xoe),s=u.useCallback(i=>{i&&r(nD({nodeId:t,fieldName:n.name,value:i}))},[r,n.name,t]);return a.jsx(Kn,{className:"nowheel nodrag",sx:{".mantine-Select-dropdown":{width:"14rem !important"}},value:n.value,data:o,onChange:s})},Yoe=u.memo(Qoe),Joe=e=>{const{nodeId:t,field:n,fieldTemplate:r}=e,o=se(),s=u.useCallback(i=>{o(rD({nodeId:t,fieldName:n.name,value:i.target.value}))},[o,n.name,t]);return r.ui_component==="textarea"?a.jsx(li,{className:"nodrag",onChange:s,value:n.value,rows:5,resize:"none"}):a.jsx(hs,{onChange:s,value:n.value})},Zoe=u.memo(Joe),ese=e=>null,tse=u.memo(ese),nse=e=>null,rse=u.memo(nse),jM=e=>{const t=Su("models"),[n,r,o]=e.split("/"),s=oD.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},ose=e=>{const{nodeId:t,field:n}=e,r=n.value,o=se(),{data:s}=a3(),i=u.useMemo(()=>{if(!s)return[];const p=[{value:"default",label:"Default",group:"Default"}];return Wr(s.entities,(h,m)=>{h&&p.push({value:m,label:h.model_name,group:xr[h.base_model]})}),p.sort((h,m)=>h.disabled&&!m.disabled?1:-1)},[s]),c=u.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]),f=u.useCallback(p=>{if(!p)return;const h=jM(p);h&&o(sD({nodeId:t,fieldName:n.name,value:h}))},[o,n.name,t]);return a.jsx(Kn,{className:"nowheel nodrag",itemComponent:tl,tooltip:c==null?void 0:c.description,value:(c==null?void 0:c.id)??"default",placeholder:"Default",data:i,onChange:f,disabled:i.length===0,error:!c,clearable:!0,sx:{width:"100%",".mantine-Select-dropdown":{width:"16rem !important"}}})},sse=u.memo(ose),ase=({nodeId:e,fieldName:t})=>{const n=mM(e,t),r=Qg(e,t,"input");return(r==null?void 0:r.fieldKind)==="output"?a.jsxs(Fe,{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(Zoe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="boolean"&&(r==null?void 0:r.type)==="boolean"?a.jsx(eoe,{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(Eoe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="ImageField"&&(r==null?void 0:r.type)==="ImageField"?a.jsx(Aoe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="LatentsField"&&(r==null?void 0:r.type)==="LatentsField"?a.jsx(Toe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="DenoiseMaskField"&&(r==null?void 0:r.type)==="DenoiseMaskField"?a.jsx(Poe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="ConditioningField"&&(r==null?void 0:r.type)==="ConditioningField"?a.jsx(woe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="UNetField"&&(r==null?void 0:r.type)==="UNetField"?a.jsx(tse,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="ClipField"&&(r==null?void 0:r.type)==="ClipField"?a.jsx(noe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="VaeField"&&(r==null?void 0:r.type)==="VaeField"?a.jsx(rse,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="ControlField"&&(r==null?void 0:r.type)==="ControlField"?a.jsx(Soe,{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(sse,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="LoRAModelField"&&(r==null?void 0:r.type)==="LoRAModelField"?a.jsx(Foe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="ControlNetModelField"&&(r==null?void 0:r.type)==="ControlNetModelField"?a.jsx(joe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="Collection"&&(r==null?void 0:r.type)==="Collection"?a.jsx(ooe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="CollectionItem"&&(r==null?void 0:r.type)==="CollectionItem"?a.jsx(aoe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="ColorField"&&(r==null?void 0:r.type)==="ColorField"?a.jsx(xoe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="ImageCollection"&&(r==null?void 0:r.type)==="ImageCollection"?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(Koe,{nodeId:e,field:n,fieldTemplate:r}):(n==null?void 0:n.type)==="Scheduler"&&(r==null?void 0:r.type)==="Scheduler"?a.jsx(Yoe,{nodeId:e,field:n,fieldTemplate:r}):a.jsx(Fe,{p:1,children:a.jsxs(Ee,{sx:{fontSize:"sm",fontWeight:600,color:"error.400",_dark:{color:"error.300"}},children:["Unknown field type: ",n==null?void 0:n.type]})})},_M=u.memo(ase),ise=({nodeId:e,fieldName:t})=>{const n=se(),{isMouseOverNode:r,handleMouseOut:o,handleMouseOver:s}=fM(e),i=u.useCallback(()=>{n(i3({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(pr,{as:$,sx:{flexDir:"column",gap:1,flexShrink:1},children:[a.jsxs(Jr,{sx:{display:"flex",alignItems:"center",mb:0},children:[a.jsx(gM,{nodeId:e,fieldName:t,kind:"input"}),a.jsx(Qi,{}),a.jsx(Mn,{label:a.jsx(r2,{nodeId:e,fieldName:t,kind:"input"}),openDelay:Um,placement:"top",hasArrow:!0,children:a.jsx($,{h:"full",alignItems:"center",children:a.jsx(Tr,{as:FE})})}),a.jsx(tt,{"aria-label":"Remove from Linear View",tooltip:"Remove from Linear View",variant:"ghost",size:"sm",onClick:i,icon:a.jsx(Jo,{})})]}),a.jsx(_M,{nodeId:e,fieldName:t})]}),a.jsx(dM,{isSelected:!1,isHovered:r})]})},lse=u.memo(ise),cse=le(ke,({nodes:e})=>({fields:e.workflow.exposedFields}),Oe),use=()=>{const{fields:e}=z(cse);return a.jsx(Fe,{sx:{position:"relative",w:"full",h:"full"},children:a.jsx(t2,{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:t,fieldName:n})=>a.jsx(lse,{nodeId:t,fieldName:n},`${t}.${n}`)):a.jsx(lo,{label:"No fields added to Linear View",icon:null})})})})},dse=u.memo(use),fse=()=>a.jsx($,{layerStyle:"first",sx:{flexDir:"column",w:"full",h:"full",borderRadius:"base",p:2,gap:2},children:a.jsxs(Gl,{variant:"line",sx:{display:"flex",flexDir:"column",w:"full",h:"full"},children:[a.jsxs(ql,{children:[a.jsx(Ro,{children:"Linear"}),a.jsx(Ro,{children:"Details"}),a.jsx(Ro,{children:"JSON"})]}),a.jsxs(Ou,{children:[a.jsx(bs,{children:a.jsx(dse,{})}),a.jsx(bs,{children:a.jsx(Vre,{})}),a.jsx(bs,{children:a.jsx(Xre,{})})]})]})}),pse=u.memo(fse),hse=()=>{const[e,t]=u.useState(!1),[n,r]=u.useState(!1),o=u.useRef(null),s=e2(),i=u.useCallback(()=>{o.current&&o.current.setLayout([50,50])},[]);return a.jsxs($,{sx:{flexDir:"column",gap:2,height:"100%",width:"100%"},children:[a.jsx(YO,{}),a.jsxs(Xg,{ref:o,id:"workflow-panel-group",direction:"vertical",style:{height:"100%",width:"100%"},storage:s,children:[a.jsx(Wi,{id:"workflow",collapsible:!0,onCollapse:t,minSize:25,children:a.jsx(pse,{})}),a.jsx(Am,{direction:"vertical",onDoubleClick:i,collapsedDirection:e?"top":n?"bottom":void 0}),a.jsx(Wi,{id:"inspector",collapsible:!0,onCollapse:r,minSize:25,children:a.jsx(Lre,{})})]})]})},mse=u.memo(hse),$j=(e,t)=>{const n=u.useRef(null),[r,o]=u.useState(()=>{var p;return!!((p=n.current)!=null&&p.getCollapsed())}),s=u.useCallback(()=>{var p;(p=n.current)!=null&&p.getCollapsed()?fs.flushSync(()=>{var h;(h=n.current)==null||h.expand()}):fs.flushSync(()=>{var h;(h=n.current)==null||h.collapse()})},[]),i=u.useCallback(()=>{fs.flushSync(()=>{var p;(p=n.current)==null||p.expand()})},[]),c=u.useCallback(()=>{fs.flushSync(()=>{var p;(p=n.current)==null||p.collapse()})},[]),f=u.useCallback(()=>{fs.flushSync(()=>{var p;(p=n.current)==null||p.resize(e,t)})},[e,t]);return{ref:n,minSize:e,isCollapsed:r,setIsCollapsed:o,reset:f,toggle:s,expand:i,collapse:c}},gse=({isGalleryCollapsed:e,galleryPanelRef:t})=>{const{t:n}=Ie(),r=()=>{var o;(o=t.current)==null||o.expand()};return e?a.jsx(uf,{children:a.jsx($,{pos:"absolute",transform:"translate(0, -50%)",minW:8,top:"50%",insetInlineEnd:"1.63rem",children:a.jsx(tt,{tooltip:"Show Gallery (G)",tooltipProps:{placement:"top"},"aria-label":n("common.showGalleryPanel"),onClick:r,icon:a.jsx(yne,{}),sx:{p:0,px:3,h:48,borderStartEndRadius:0,borderEndEndRadius:0,shadow:"2xl"}})})}):null},vse=u.memo(gse),c1={borderStartStartRadius:0,borderEndStartRadius:0,shadow:"2xl"},bse=({isSidePanelCollapsed:e,sidePanelRef:t})=>{const{t:n}=Ie(),r=()=>{var o;(o=t.current)==null||o.expand()};return e?a.jsx(uf,{children:a.jsxs($,{pos:"absolute",transform:"translate(0, -50%)",minW:8,top:"50%",insetInlineStart:"5.13rem",direction:"column",gap:2,children:[a.jsx(tt,{tooltip:"Show Side Panel (O, T)","aria-label":n("common.showOptionsPanel"),onClick:r,sx:c1,icon:a.jsx(UE,{})}),a.jsx(QO,{asIconButton:!0,sx:c1}),a.jsx(XO,{sx:c1,asIconButton:!0})]})}):null},xse=u.memo(bse),yse=e=>{const{label:t,activeLabel:n,children:r,defaultIsOpen:o=!1}=e,{isOpen:s,onToggle:i}=Ao({defaultIsOpen:o}),{colorMode:c}=di();return a.jsxs(Fe,{children:[a.jsxs($,{onClick:i,sx:{alignItems:"center",p:2,px:4,gap:2,borderTopRadius:"base",borderBottomRadius:s?0:"base",bg:qe("base.250","base.750")(c),color:qe("base.900","base.100")(c),_hover:{bg:qe("base.300","base.700")(c)},fontSize:"sm",fontWeight:600,cursor:"pointer",transitionProperty:"common",transitionDuration:"normal",userSelect:"none"},children:[t,a.jsx(co,{children:n&&a.jsx(yr.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}},children:a.jsx(Ee,{sx:{color:"accent.500",_dark:{color:"accent.300"}},children:n})},"statusText")}),a.jsx(Qi,{}),a.jsx(Lg,{sx:{w:"1rem",h:"1rem",transform:s?"rotate(0deg)":"rotate(180deg)",transitionProperty:"common",transitionDuration:"normal"}})]}),a.jsx(Xm,{in:s,animateOpacity:!0,style:{overflow:"unset"},children:a.jsx(Fe,{sx:{p:4,pb:4,borderBottomRadius:"base",bg:"base.150",_dark:{bg:"base.800"}},children:r})})]})},wo=u.memo(yse),wse=le(ke,e=>{const{combinatorial:t,isEnabled:n}=e.dynamicPrompts;return{combinatorial:t,isDisabled:!n}},Oe),Cse=()=>{const{combinatorial:e,isDisabled:t}=z(wse),n=se(),r=u.useCallback(()=>{n(aD())},[n]);return a.jsx(qn,{isDisabled:t,label:"Combinatorial Generation",isChecked:e,onChange:r})},Sse=u.memo(Cse),kse=le(ke,e=>{const{isEnabled:t}=e.dynamicPrompts;return{isEnabled:t}},Oe),jse=()=>{const e=se(),{isEnabled:t}=z(kse),n=u.useCallback(()=>{e(iD())},[e]);return a.jsx(qn,{label:"Enable Dynamic Prompts",isChecked:t,onChange:n})},_se=u.memo(jse),Pse=le(ke,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}},Oe),Ise=()=>{const{maxPrompts:e,min:t,sliderMax:n,inputMax:r,isDisabled:o}=z(Pse),s=se(),i=u.useCallback(f=>{s(lD(f))},[s]),c=u.useCallback(()=>{s(cD())},[s]);return a.jsx(jt,{label:"Max Prompts",isDisabled:o,min:t,max:n,value:e,onChange:i,sliderNumberInputProps:{max:r},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:c})},Ese=u.memo(Ise),Ose=le(ke,e=>{const{isEnabled:t}=e.dynamicPrompts;return{activeLabel:t?"Enabled":void 0}},Oe),Mse=()=>{const{activeLabel:e}=z(Ose);return Yn("dynamicPrompting").isFeatureEnabled?a.jsx(wo,{label:"Dynamic Prompts",activeLabel:e,children:a.jsxs($,{sx:{gap:2,flexDir:"column"},children:[a.jsx(_se,{}),a.jsx(Sse,{}),a.jsx(Ese,{})]})}):null},$u=u.memo(Mse),Rse=e=>{const t=se(),{lora:n}=e,r=u.useCallback(i=>{t(uD({id:n.id,weight:i}))},[t,n.id]),o=u.useCallback(()=>{t(dD(n.id))},[t,n.id]),s=u.useCallback(()=>{t(fD(n.id))},[t,n.id]);return a.jsxs($,{sx:{gap:2.5,alignItems:"flex-end"},children:[a.jsx(jt,{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(tt,{size:"sm",onClick:s,tooltip:"Remove LoRA","aria-label":"Remove LoRA",icon:a.jsx(Jo,{}),colorScheme:"error"})]})},Dse=u.memo(Rse),Ase=le(ke,({lora:e})=>({lorasArray:uo(e.loras)}),Oe),Nse=()=>{const{lorasArray:e}=z(Ase);return a.jsx(a.Fragment,{children:e.map((t,n)=>a.jsxs($,{sx:{flexDirection:"column",gap:2},children:[n>0&&a.jsx(Ko,{pt:1}),a.jsx(Dse,{lora:t})]},t.model_name))})},Tse=u.memo(Nse),$se=le(ke,({lora:e})=>({loras:e.loras}),Oe),Lse=()=>{const e=se(),{loras:t}=z($se),{data:n}=Gm(),r=z(i=>i.generation.model),o=u.useMemo(()=>{if(!n)return[];const i=[];return Wr(n.entities,(c,f)=>{if(!c||f in t)return;const p=(r==null?void 0:r.base_model)!==c.base_model;i.push({value:f,label:c.model_name,disabled:p,group:xr[c.base_model],tooltip:p?`Incompatible base model: ${c.base_model}`:void 0})}),i.sort((c,f)=>c.label&&!f.label?1:-1),i.sort((c,f)=>c.disabled&&!f.disabled?1:-1)},[t,n,r==null?void 0:r.base_model]),s=u.useCallback(i=>{if(!i)return;const c=n==null?void 0:n.entities[i];c&&e(pD(c))},[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(Ee,{sx:{fontSize:"sm",color:"base.500",_dark:"base.700"},children:"No LoRAs Loaded"})}):a.jsx(Kn,{placeholder:o.length===0?"All LoRAs added":"Add LoRA",value:null,data:o,nothingFound:"No matching LoRAs",itemComponent:tl,disabled:o.length===0,filter:(i,c)=>{var f;return((f=c.label)==null?void 0:f.toLowerCase().includes(i.toLowerCase().trim()))||c.value.toLowerCase().includes(i.toLowerCase().trim())},onChange:s})},Fse=u.memo(Lse),zse=le(ke,e=>{const t=l3(e.lora.loras);return{activeLabel:t>0?`${t} Active`:void 0}},Oe),Bse=()=>{const{activeLabel:e}=z(zse);return Yn("lora").isFeatureEnabled?a.jsx(wo,{label:"LoRA",activeLabel:e,children:a.jsxs($,{sx:{flexDir:"column",gap:2},children:[a.jsx(Fse,{}),a.jsx(Tse,{})]})}):null},Lu=u.memo(Bse),Hse=le(ke,({generation:e})=>{const{model:t}=e;return{mainModel:t}},Oe),Wse=e=>{const{controlNetId:t,model:n,isEnabled:r}=e.controlNet,o=se(),s=z(Or),{mainModel:i}=z(Hse),{data:c}=ux(),f=u.useMemo(()=>{if(!c)return[];const m=[];return Wr(c.entities,(v,b)=>{if(!v)return;const y=(v==null?void 0:v.base_model)!==(i==null?void 0:i.base_model);m.push({value:b,label:v.model_name,group:xr[v.base_model],disabled:y,tooltip:y?`Incompatible base model: ${v.base_model}`:void 0})}),m},[c,i==null?void 0:i.base_model]),p=u.useMemo(()=>(c==null?void 0:c.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,c==null?void 0:c.entities]),h=u.useCallback(m=>{if(!m)return;const v=CM(m);v&&o(c3({controlNetId:t,model:v}))},[t,o]);return a.jsx(Kn,{itemComponent:tl,data:f,error:!p||(i==null?void 0:i.base_model)!==p.base_model,placeholder:"Select a model",value:(p==null?void 0:p.id)??null,onChange:h,disabled:s||!r,tooltip:p==null?void 0:p.description})},Vse=u.memo(Wse),Use=e=>{const{weight:t,isEnabled:n,controlNetId:r}=e.controlNet,o=se(),s=u.useCallback(i=>{o(hD({controlNetId:r,weight:i}))},[r,o]);return a.jsx(jt,{isDisabled:!n,label:"Weight",value:t,onChange:s,min:0,max:2,step:.01,withSliderMarks:!0,sliderMarks:[0,1,2]})},Gse=u.memo(Use),qse=le(ke,({controlNet:e,gallery:t})=>{const{pendingControlImages:n}=e,{autoAddBoardId:r}=t;return{pendingControlImages:n,autoAddBoardId:r}},Oe),Kse=({isSmall:e,controlNet:t})=>{const{controlImage:n,processedControlImage:r,processorType:o,isEnabled:s,controlNetId:i}=t,c=se(),{pendingControlImages:f,autoAddBoardId:p}=z(qse),h=z(jr),[m,v]=u.useState(!1),{currentData:b}=qo(n??Yo.skipToken),{currentData:y}=qo(r??Yo.skipToken),[x]=mD(),[C]=gD(),[k]=vD(),j=u.useCallback(()=>{c(bD({controlNetId:i,controlImage:null}))},[i,c]),_=u.useCallback(async()=>{y&&(await x({imageDTO:y,is_intermediate:!1}).unwrap(),p!=="none"?C({imageDTO:y,board_id:p}):k({imageDTO:y}))},[y,x,p,C,k]),I=u.useCallback(()=>{y&&(h==="unifiedCanvas"?c(Ls({width:y.width,height:y.height})):(c(Ol(y.width)),c(Ml(y.height))))},[y,h,c]),O=u.useCallback(()=>{v(!0)},[]),E=u.useCallback(()=>{v(!1)},[]),M=u.useMemo(()=>{if(b)return{id:i,payloadType:"IMAGE_DTO",payload:{imageDTO:b}}},[b,i]),R=u.useMemo(()=>({id:i,actionType:"SET_CONTROLNET_IMAGE",context:{controlNetId:i}}),[i]),A=u.useMemo(()=>({type:"SET_CONTROLNET_IMAGE",controlNetId:i}),[i]),D=b&&y&&!m&&!f.includes(i)&&o!=="none";return a.jsxs($,{onMouseEnter:O,onMouseLeave:E,sx:{position:"relative",w:"full",h:e?28:366,alignItems:"center",justifyContent:"center",pointerEvents:s?"auto":"none",opacity:s?1:.5},children:[a.jsx(ii,{draggableData:M,droppableData:R,imageDTO:b,isDropDisabled:D||!s,postUploadAction:A}),a.jsx(Fe,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",opacity:D?1:0,transitionProperty:"common",transitionDuration:"normal",pointerEvents:"none"},children:a.jsx(ii,{draggableData:M,droppableData:R,imageDTO:y,isUploadDisabled:!0,isDropDisabled:!s})}),a.jsxs(a.Fragment,{children:[a.jsx(eu,{onClick:j,icon:b?a.jsx(Og,{}):void 0,tooltip:"Reset Control Image"}),a.jsx(eu,{onClick:_,icon:b?a.jsx(Eg,{size:16}):void 0,tooltip:"Save Control Image",styleOverrides:{marginTop:6}}),a.jsx(eu,{onClick:I,icon:b?a.jsx(OJ,{size:16}):void 0,tooltip:"Set Control Image Dimensions To W/H",styleOverrides:{marginTop:12}})]}),f.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(Wl,{size:"xl",sx:{color:"base.100",_dark:{color:"base.400"}}})})]})},Lj=u.memo(Kse),Zs=()=>{const e=se();return u.useCallback((n,r)=>{e(xD({controlNetId:n,changes:r}))},[e])};function ea(e){return a.jsx($,{sx:{flexDirection:"column",gap:2},children:e.children})}const Fj=ws.canny_image_processor.default,Xse=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{low_threshold:o,high_threshold:s}=n,i=z(Or),c=Zs(),f=u.useCallback(v=>{c(t,{low_threshold:v})},[t,c]),p=u.useCallback(()=>{c(t,{low_threshold:Fj.low_threshold})},[t,c]),h=u.useCallback(v=>{c(t,{high_threshold:v})},[t,c]),m=u.useCallback(()=>{c(t,{high_threshold:Fj.high_threshold})},[t,c]);return a.jsxs(ea,{children:[a.jsx(jt,{isDisabled:i||!r,label:"Low Threshold",value:o,onChange:f,handleReset:p,withReset:!0,min:0,max:255,withInput:!0,withSliderMarks:!0}),a.jsx(jt,{isDisabled:i||!r,label:"High Threshold",value:s,onChange:h,handleReset:m,withReset:!0,min:0,max:255,withInput:!0,withSliderMarks:!0})]})},Qse=u.memo(Xse),fd=ws.content_shuffle_image_processor.default,Yse=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,w:i,h:c,f}=n,p=Zs(),h=z(Or),m=u.useCallback(O=>{p(t,{detect_resolution:O})},[t,p]),v=u.useCallback(()=>{p(t,{detect_resolution:fd.detect_resolution})},[t,p]),b=u.useCallback(O=>{p(t,{image_resolution:O})},[t,p]),y=u.useCallback(()=>{p(t,{image_resolution:fd.image_resolution})},[t,p]),x=u.useCallback(O=>{p(t,{w:O})},[t,p]),C=u.useCallback(()=>{p(t,{w:fd.w})},[t,p]),k=u.useCallback(O=>{p(t,{h:O})},[t,p]),j=u.useCallback(()=>{p(t,{h:fd.h})},[t,p]),_=u.useCallback(O=>{p(t,{f:O})},[t,p]),I=u.useCallback(()=>{p(t,{f:fd.f})},[t,p]);return a.jsxs(ea,{children:[a.jsx(jt,{label:"Detect Resolution",value:s,onChange:m,handleReset:v,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:h||!r}),a.jsx(jt,{label:"Image Resolution",value:o,onChange:b,handleReset:y,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:h||!r}),a.jsx(jt,{label:"W",value:i,onChange:x,handleReset:C,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:h||!r}),a.jsx(jt,{label:"H",value:c,onChange:k,handleReset:j,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:h||!r}),a.jsx(jt,{label:"F",value:f,onChange:_,handleReset:I,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:h||!r})]})},Jse=u.memo(Yse),zj=ws.hed_image_processor.default,Zse=e=>{const{controlNetId:t,processorNode:{detect_resolution:n,image_resolution:r,scribble:o},isEnabled:s}=e,i=z(Or),c=Zs(),f=u.useCallback(b=>{c(t,{detect_resolution:b})},[t,c]),p=u.useCallback(b=>{c(t,{image_resolution:b})},[t,c]),h=u.useCallback(b=>{c(t,{scribble:b.target.checked})},[t,c]),m=u.useCallback(()=>{c(t,{detect_resolution:zj.detect_resolution})},[t,c]),v=u.useCallback(()=>{c(t,{image_resolution:zj.image_resolution})},[t,c]);return a.jsxs(ea,{children:[a.jsx(jt,{label:"Detect Resolution",value:n,onChange:f,handleReset:m,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:i||!s}),a.jsx(jt,{label:"Image Resolution",value:r,onChange:p,handleReset:v,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:i||!s}),a.jsx(qn,{label:"Scribble",isChecked:o,onChange:h,isDisabled:i||!s})]})},eae=u.memo(Zse),Bj=ws.lineart_anime_image_processor.default,tae=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s}=n,i=Zs(),c=z(Or),f=u.useCallback(v=>{i(t,{detect_resolution:v})},[t,i]),p=u.useCallback(v=>{i(t,{image_resolution:v})},[t,i]),h=u.useCallback(()=>{i(t,{detect_resolution:Bj.detect_resolution})},[t,i]),m=u.useCallback(()=>{i(t,{image_resolution:Bj.image_resolution})},[t,i]);return a.jsxs(ea,{children:[a.jsx(jt,{label:"Detect Resolution",value:s,onChange:f,handleReset:h,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:c||!r}),a.jsx(jt,{label:"Image Resolution",value:o,onChange:p,handleReset:m,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:c||!r})]})},nae=u.memo(tae),Hj=ws.lineart_image_processor.default,rae=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,coarse:i}=n,c=Zs(),f=z(Or),p=u.useCallback(y=>{c(t,{detect_resolution:y})},[t,c]),h=u.useCallback(y=>{c(t,{image_resolution:y})},[t,c]),m=u.useCallback(()=>{c(t,{detect_resolution:Hj.detect_resolution})},[t,c]),v=u.useCallback(()=>{c(t,{image_resolution:Hj.image_resolution})},[t,c]),b=u.useCallback(y=>{c(t,{coarse:y.target.checked})},[t,c]);return a.jsxs(ea,{children:[a.jsx(jt,{label:"Detect Resolution",value:s,onChange:p,handleReset:m,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:f||!r}),a.jsx(jt,{label:"Image Resolution",value:o,onChange:h,handleReset:v,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:f||!r}),a.jsx(qn,{label:"Coarse",isChecked:i,onChange:b,isDisabled:f||!r})]})},oae=u.memo(rae),Wj=ws.mediapipe_face_processor.default,sae=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{max_faces:o,min_confidence:s}=n,i=Zs(),c=z(Or),f=u.useCallback(v=>{i(t,{max_faces:v})},[t,i]),p=u.useCallback(v=>{i(t,{min_confidence:v})},[t,i]),h=u.useCallback(()=>{i(t,{max_faces:Wj.max_faces})},[t,i]),m=u.useCallback(()=>{i(t,{min_confidence:Wj.min_confidence})},[t,i]);return a.jsxs(ea,{children:[a.jsx(jt,{label:"Max Faces",value:o,onChange:f,handleReset:h,withReset:!0,min:1,max:20,withInput:!0,withSliderMarks:!0,isDisabled:c||!r}),a.jsx(jt,{label:"Min Confidence",value:s,onChange:p,handleReset:m,withReset:!0,min:0,max:1,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:c||!r})]})},aae=u.memo(sae),Vj=ws.midas_depth_image_processor.default,iae=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{a_mult:o,bg_th:s}=n,i=Zs(),c=z(Or),f=u.useCallback(v=>{i(t,{a_mult:v})},[t,i]),p=u.useCallback(v=>{i(t,{bg_th:v})},[t,i]),h=u.useCallback(()=>{i(t,{a_mult:Vj.a_mult})},[t,i]),m=u.useCallback(()=>{i(t,{bg_th:Vj.bg_th})},[t,i]);return a.jsxs(ea,{children:[a.jsx(jt,{label:"a_mult",value:o,onChange:f,handleReset:h,withReset:!0,min:0,max:20,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:c||!r}),a.jsx(jt,{label:"bg_th",value:s,onChange:p,handleReset:m,withReset:!0,min:0,max:20,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:c||!r})]})},lae=u.memo(iae),nh=ws.mlsd_image_processor.default,cae=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,thr_d:i,thr_v:c}=n,f=Zs(),p=z(Or),h=u.useCallback(j=>{f(t,{detect_resolution:j})},[t,f]),m=u.useCallback(j=>{f(t,{image_resolution:j})},[t,f]),v=u.useCallback(j=>{f(t,{thr_d:j})},[t,f]),b=u.useCallback(j=>{f(t,{thr_v:j})},[t,f]),y=u.useCallback(()=>{f(t,{detect_resolution:nh.detect_resolution})},[t,f]),x=u.useCallback(()=>{f(t,{image_resolution:nh.image_resolution})},[t,f]),C=u.useCallback(()=>{f(t,{thr_d:nh.thr_d})},[t,f]),k=u.useCallback(()=>{f(t,{thr_v:nh.thr_v})},[t,f]);return a.jsxs(ea,{children:[a.jsx(jt,{label:"Detect Resolution",value:s,onChange:h,handleReset:y,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:p||!r}),a.jsx(jt,{label:"Image Resolution",value:o,onChange:m,handleReset:x,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:p||!r}),a.jsx(jt,{label:"W",value:i,onChange:v,handleReset:C,withReset:!0,min:0,max:1,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:p||!r}),a.jsx(jt,{label:"H",value:c,onChange:b,handleReset:k,withReset:!0,min:0,max:1,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:p||!r})]})},uae=u.memo(cae),Uj=ws.normalbae_image_processor.default,dae=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s}=n,i=Zs(),c=z(Or),f=u.useCallback(v=>{i(t,{detect_resolution:v})},[t,i]),p=u.useCallback(v=>{i(t,{image_resolution:v})},[t,i]),h=u.useCallback(()=>{i(t,{detect_resolution:Uj.detect_resolution})},[t,i]),m=u.useCallback(()=>{i(t,{image_resolution:Uj.image_resolution})},[t,i]);return a.jsxs(ea,{children:[a.jsx(jt,{label:"Detect Resolution",value:s,onChange:f,handleReset:h,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:c||!r}),a.jsx(jt,{label:"Image Resolution",value:o,onChange:p,handleReset:m,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:c||!r})]})},fae=u.memo(dae),Gj=ws.openpose_image_processor.default,pae=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,hand_and_face:i}=n,c=Zs(),f=z(Or),p=u.useCallback(y=>{c(t,{detect_resolution:y})},[t,c]),h=u.useCallback(y=>{c(t,{image_resolution:y})},[t,c]),m=u.useCallback(()=>{c(t,{detect_resolution:Gj.detect_resolution})},[t,c]),v=u.useCallback(()=>{c(t,{image_resolution:Gj.image_resolution})},[t,c]),b=u.useCallback(y=>{c(t,{hand_and_face:y.target.checked})},[t,c]);return a.jsxs(ea,{children:[a.jsx(jt,{label:"Detect Resolution",value:s,onChange:p,handleReset:m,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:f||!r}),a.jsx(jt,{label:"Image Resolution",value:o,onChange:h,handleReset:v,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:f||!r}),a.jsx(qn,{label:"Hand and Face",isChecked:i,onChange:b,isDisabled:f||!r})]})},hae=u.memo(pae),qj=ws.pidi_image_processor.default,mae=e=>{const{controlNetId:t,processorNode:n,isEnabled:r}=e,{image_resolution:o,detect_resolution:s,scribble:i,safe:c}=n,f=Zs(),p=z(Or),h=u.useCallback(C=>{f(t,{detect_resolution:C})},[t,f]),m=u.useCallback(C=>{f(t,{image_resolution:C})},[t,f]),v=u.useCallback(()=>{f(t,{detect_resolution:qj.detect_resolution})},[t,f]),b=u.useCallback(()=>{f(t,{image_resolution:qj.image_resolution})},[t,f]),y=u.useCallback(C=>{f(t,{scribble:C.target.checked})},[t,f]),x=u.useCallback(C=>{f(t,{safe:C.target.checked})},[t,f]);return a.jsxs(ea,{children:[a.jsx(jt,{label:"Detect Resolution",value:s,onChange:h,handleReset:v,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:p||!r}),a.jsx(jt,{label:"Image Resolution",value:o,onChange:m,handleReset:b,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:p||!r}),a.jsx(qn,{label:"Scribble",isChecked:i,onChange:y}),a.jsx(qn,{label:"Safe",isChecked:c,onChange:x,isDisabled:p||!r})]})},gae=u.memo(mae),vae=e=>null,bae=u.memo(vae),xae=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(eae,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="lineart_image_processor"?a.jsx(oae,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="content_shuffle_image_processor"?a.jsx(Jse,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="lineart_anime_image_processor"?a.jsx(nae,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="mediapipe_face_processor"?a.jsx(aae,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="midas_depth_image_processor"?a.jsx(lae,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="mlsd_image_processor"?a.jsx(uae,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="normalbae_image_processor"?a.jsx(fae,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="openpose_image_processor"?a.jsx(hae,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="pidi_image_processor"?a.jsx(gae,{controlNetId:t,processorNode:r,isEnabled:n}):r.type==="zoe_depth_image_processor"?a.jsx(bae,{controlNetId:t,processorNode:r,isEnabled:n}):null},yae=u.memo(xae),wae=e=>{const{controlNetId:t,isEnabled:n,shouldAutoConfig:r}=e.controlNet,o=se(),s=z(Or),i=u.useCallback(()=>{o(yD({controlNetId:t}))},[t,o]);return a.jsx(qn,{label:"Auto configure processor","aria-label":"Auto configure processor",isChecked:r,onChange:i,isDisabled:s||!n})},Cae=u.memo(wae),Sae=e=>{const{controlNet:t}=e,n=se(),r=u.useCallback(()=>{n(wD({controlNet:t}))},[t,n]),o=u.useCallback(()=>{n(CD({controlNet:t}))},[t,n]);return a.jsxs($,{sx:{gap:2},children:[a.jsx(tt,{size:"sm",icon:a.jsx(Fl,{}),tooltip:"Import Image From Canvas","aria-label":"Import Image From Canvas",onClick:r}),a.jsx(tt,{size:"sm",icon:a.jsx(HE,{}),tooltip:"Import Mask From Canvas","aria-label":"Import Mask From Canvas",onClick:o})]})},kae=u.memo(Sae),Kj=e=>`${Math.round(e*100)}%`,jae=e=>{const{beginStepPct:t,endStepPct:n,isEnabled:r,controlNetId:o}=e.controlNet,s=se(),i=u.useCallback(c=>{s(SD({controlNetId:o,beginStepPct:c[0]})),s(kD({controlNetId:o,endStepPct:c[1]}))},[o,s]);return a.jsxs(pr,{isDisabled:!r,children:[a.jsx(Jr,{children:"Begin / End Step Percentage"}),a.jsx(Fx,{w:"100%",gap:2,alignItems:"center",children:a.jsxs(NP,{"aria-label":["Begin Step %","End Step %"],value:[t,n],onChange:i,min:0,max:1,step:.01,minStepsBetweenThumbs:5,isDisabled:!r,children:[a.jsx(TP,{children:a.jsx($P,{})}),a.jsx(Mn,{label:Kj(t),placement:"top",hasArrow:!0,children:a.jsx(tb,{index:0})}),a.jsx(Mn,{label:Kj(n),placement:"top",hasArrow:!0,children:a.jsx(tb,{index:1})}),a.jsx(uh,{value:0,sx:{insetInlineStart:"0 !important",insetInlineEnd:"unset !important"},children:"0%"}),a.jsx(uh,{value:.5,sx:{insetInlineStart:"50% !important",transform:"translateX(-50%)"},children:"50%"}),a.jsx(uh,{value:1,sx:{insetInlineStart:"unset !important",insetInlineEnd:"0 !important"},children:"100%"})]})})]})},_ae=u.memo(jae),Pae=[{label:"Balanced",value:"balanced"},{label:"Prompt",value:"more_prompt"},{label:"Control",value:"more_control"},{label:"Mega Control",value:"unbalanced"}];function Iae(e){const{controlMode:t,isEnabled:n,controlNetId:r}=e.controlNet,o=se(),s=u.useCallback(i=>{o(jD({controlNetId:r,controlMode:i}))},[r,o]);return a.jsx(Zr,{disabled:!n,label:"Control Mode",data:Pae,value:String(t),onChange:s})}const Eae=e=>e.config,Oae=le(Eae,e=>uo(ws,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)),Oe),Mae=e=>{const t=se(),{controlNetId:n,isEnabled:r,processorNode:o}=e.controlNet,s=z(Or),i=z(Oae),c=u.useCallback(f=>{t(_D({controlNetId:n,processorType:f}))},[n,t]);return a.jsx(Kn,{label:"Processor",value:o.type??"canny_image_processor",data:i,onChange:c,disabled:s||!r})},Rae=u.memo(Mae),Dae=[{label:"Resize",value:"just_resize"},{label:"Crop",value:"crop_resize"},{label:"Fill",value:"fill_resize"}];function Aae(e){const{resizeMode:t,isEnabled:n,controlNetId:r}=e.controlNet,o=se(),s=u.useCallback(i=>{o(PD({controlNetId:r,resizeMode:i}))},[r,o]);return a.jsx(Zr,{disabled:!n,label:"Resize Mode",data:Dae,value:String(t),onChange:s})}const Nae=e=>{const{controlNet:t}=e,{controlNetId:n}=t,r=se(),o=z(jr),s=le(ke,({controlNet:b})=>{const y=b.controlNets[n];if(!y)return{isEnabled:!1,shouldAutoConfig:!1};const{isEnabled:x,shouldAutoConfig:C}=y;return{isEnabled:x,shouldAutoConfig:C}},Oe),{isEnabled:i,shouldAutoConfig:c}=z(s),[f,p]=BJ(!1),h=u.useCallback(()=>{r(ID({controlNetId:n}))},[n,r]),m=u.useCallback(()=>{r(ED({sourceControlNetId:n,newControlNetId:Fi()}))},[n,r]),v=u.useCallback(()=>{r(OD({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(qn,{tooltip:"Toggle this ControlNet","aria-label":"Toggle this ControlNet",isChecked:i,onChange:v}),a.jsx(Fe,{sx:{w:"full",minW:0,opacity:i?1:.5,pointerEvents:i?"auto":"none",transitionProperty:"common",transitionDuration:"0.1s"},children:a.jsx(Vse,{controlNet:t})}),o==="unifiedCanvas"&&a.jsx(kae,{controlNet:t}),a.jsx(tt,{size:"sm",tooltip:"Duplicate","aria-label":"Duplicate",onClick:m,icon:a.jsx(Du,{})}),a.jsx(tt,{size:"sm",tooltip:"Delete","aria-label":"Delete",colorScheme:"error",onClick:h,icon:a.jsx(Jo,{})}),a.jsx(tt,{size:"sm",tooltip:f?"Hide Advanced":"Show Advanced","aria-label":f?"Hide Advanced":"Show Advanced",onClick:p,variant:"ghost",sx:{_hover:{bg:"none"}},icon:a.jsx(Lg,{sx:{boxSize:4,color:"base.700",transform:f?"rotate(0deg)":"rotate(180deg)",transitionProperty:"common",transitionDuration:"normal",_dark:{color:"base.300"}}})}),!c&&a.jsx(Fe,{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:f?1:0,pb:2,justifyContent:"space-between"},children:[a.jsx(Gse,{controlNet:t}),a.jsx(_ae,{controlNet:t})]}),!f&&a.jsx($,{sx:{alignItems:"center",justifyContent:"center",h:28,w:28,aspectRatio:"1/1"},children:a.jsx(Lj,{controlNet:t,isSmall:!0})})]}),a.jsxs($,{sx:{gap:2},children:[a.jsx(Iae,{controlNet:t}),a.jsx(Aae,{controlNet:t})]}),a.jsx(Rae,{controlNet:t})]}),f&&a.jsxs(a.Fragment,{children:[a.jsx(Lj,{controlNet:t}),a.jsx(Cae,{controlNet:t}),a.jsx(yae,{controlNet:t})]})]})},Tae=u.memo(Nae),$ae=le(ke,e=>{const{isEnabled:t}=e.controlNet;return{isEnabled:t}},Oe),Lae=()=>{const{isEnabled:e}=z($ae),t=se(),n=u.useCallback(()=>{t(MD())},[t]);return a.jsx(qn,{label:"Enable ControlNet",isChecked:e,onChange:n,formControlProps:{width:"100%"}})},Fae=u.memo(Lae),zae=le([ke],({controlNet:e})=>{const{controlNets:t,isEnabled:n}=e,r=RD(t),o=n&&r.length>0?`${r.length} Active`:void 0;return{controlNetsArray:uo(t),activeLabel:o}},Oe),Bae=()=>{const{controlNetsArray:e,activeLabel:t}=z(zae),n=Yn("controlNet").isFeatureDisabled,r=se(),{firstModel:o}=ux(void 0,{selectFromResult:i=>({firstModel:i.data?DD.getSelectors().selectAll(i.data)[0]:void 0})}),s=u.useCallback(()=>{if(!o)return;const i=Fi();r(AD({controlNetId:i})),r(c3({controlNetId:i,model:o}))},[r,o]);return n?null:a.jsx(wo,{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(Fae,{}),a.jsx(tt,{tooltip:"Add ControlNet","aria-label":"Add ControlNet",icon:a.jsx(Yl,{}),isDisabled:!o,flexGrow:1,size:"sm",onClick:s})]}),e.map((i,c)=>a.jsxs(u.Fragment,{children:[c>0&&a.jsx(Ko,{}),a.jsx(Tae,{controlNet:i})]},i.controlNetId))]})})},Fu=u.memo(Bae),Hae=le(ke,e=>{const{shouldUseNoiseSettings:t,shouldUseCpuNoise:n}=e.generation;return{isDisabled:!t,shouldUseCpuNoise:n}},Oe),Wae=()=>{const e=se(),{isDisabled:t,shouldUseCpuNoise:n}=z(Hae),r=o=>e(ND(o.target.checked));return a.jsx(qn,{isDisabled:t,label:"Use CPU Noise",isChecked:n,onChange:r})},Vae=le(ke,e=>{const{shouldUseNoiseSettings:t,threshold:n}=e.generation;return{isDisabled:!t,threshold:n}},Oe);function Uae(){const e=se(),{threshold:t,isDisabled:n}=z(Vae),{t:r}=Ie();return a.jsx(jt,{isDisabled:n,label:r("parameters.noiseThreshold"),min:0,max:20,step:.1,onChange:o=>e(dC(o)),handleReset:()=>e(dC(0)),value:t,withInput:!0,withReset:!0,withSliderMarks:!0})}const Gae=()=>{const e=se(),t=z(r=>r.generation.shouldUseNoiseSettings),n=r=>e(TD(r.target.checked));return a.jsx(qn,{label:"Enable Noise Settings",isChecked:t,onChange:n})},qae=le(ke,e=>{const{shouldUseNoiseSettings:t,perlin:n}=e.generation;return{isDisabled:!t,perlin:n}},Oe);function Kae(){const e=se(),{perlin:t,isDisabled:n}=z(qae),{t:r}=Ie();return a.jsx(jt,{isDisabled:n,label:r("parameters.perlinNoise"),min:0,max:1,step:.05,onChange:o=>e(fC(o)),handleReset:()=>e(fC(0)),value:t,withInput:!0,withReset:!0,withSliderMarks:!0})}const Xae=le(ke,e=>{const{shouldUseNoiseSettings:t}=e.generation;return{activeLabel:t?"Enabled":void 0}},Oe),Qae=()=>{const{t:e}=Ie(),t=Yn("noise").isFeatureEnabled,n=Yn("perlinNoise").isFeatureEnabled,r=Yn("noiseThreshold").isFeatureEnabled,{activeLabel:o}=z(Xae);return t?a.jsx(wo,{label:e("parameters.noiseSettings"),activeLabel:o,children:a.jsxs($,{sx:{gap:2,flexDirection:"column"},children:[a.jsx(Gae,{}),a.jsx(Wae,{}),n&&a.jsx(Kae,{}),r&&a.jsx(Uae,{})]})}):null},Af=u.memo(Qae),ta=e=>e.generation,Yae=le(ta,e=>{const{seamlessXAxis:t}=e;return{seamlessXAxis:t}},Oe),Jae=()=>{const{t:e}=Ie(),{seamlessXAxis:t}=z(Yae),n=se(),r=u.useCallback(o=>{n($D(o.target.checked))},[n]);return a.jsx(qn,{label:e("parameters.seamlessXAxis"),"aria-label":e("parameters.seamlessXAxis"),isChecked:t,onChange:r})},Zae=u.memo(Jae),eie=le(ta,e=>{const{seamlessYAxis:t}=e;return{seamlessYAxis:t}},Oe),tie=()=>{const{t:e}=Ie(),{seamlessYAxis:t}=z(eie),n=se(),r=u.useCallback(o=>{n(LD(o.target.checked))},[n]);return a.jsx(qn,{label:e("parameters.seamlessYAxis"),"aria-label":e("parameters.seamlessYAxis"),isChecked:t,onChange:r})},nie=u.memo(tie),rie=(e,t)=>{if(e&&t)return"X & Y";if(e)return"X";if(t)return"Y"},oie=le(ta,e=>{const{seamlessXAxis:t,seamlessYAxis:n}=e;return{activeLabel:rie(t,n)}},Oe),sie=()=>{const{t:e}=Ie(),{activeLabel:t}=z(oie);return Yn("seamless").isFeatureEnabled?a.jsx(wo,{label:e("parameters.seamlessTiling"),activeLabel:t,children:a.jsxs($,{sx:{gap:5},children:[a.jsx(Fe,{flexGrow:1,children:a.jsx(Zae,{})}),a.jsx(Fe,{flexGrow:1,children:a.jsx(nie,{})})]})}):null},zu=u.memo(sie),aie=e=>{const{onClick:t}=e;return a.jsx(tt,{size:"sm","aria-label":"Add Embedding",tooltip:"Add Embedding",icon:a.jsx(NE,{}),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})},e0=u.memo(aie),iie="28rem",lie=e=>{const{onSelect:t,isOpen:n,onClose:r,children:o}=e,{data:s}=FD(),i=u.useRef(null),c=z(h=>h.generation.model),f=u.useMemo(()=>{if(!s)return[];const h=[];return Wr(s.entities,(m,v)=>{if(!m)return;const b=(c==null?void 0:c.base_model)!==m.base_model;h.push({value:m.model_name,label:m.model_name,group:xr[m.base_model],disabled:b,tooltip:b?`Incompatible base model: ${m.base_model}`:void 0})}),h.sort((m,v)=>{var b;return m.label&&v.label?(b=m.label)!=null&&b.localeCompare(v.label)?-1:1:-1}),h.sort((m,v)=>m.disabled&&!v.disabled?1:-1)},[s,c==null?void 0:c.base_model]),p=u.useCallback(h=>{h&&t(h)},[t]);return a.jsxs(fg,{initialFocusRef:i,isOpen:n,onClose:r,placement:"bottom",openDelay:0,closeDelay:0,closeOnBlur:!0,returnFocusOnClose:!0,children:[a.jsx(Zx,{children:o}),a.jsx(pg,{sx:{p:0,top:-1,shadow:"dark-lg",borderColor:"accent.300",borderWidth:"2px",borderStyle:"solid",_dark:{borderColor:"accent.400"}},children:a.jsx(ey,{sx:{p:0,w:`calc(${iie} - 2rem )`},children:f.length===0?a.jsx($,{sx:{justifyContent:"center",p:2,fontSize:"sm",color:"base.500",_dark:{color:"base.700"}},children:a.jsx(Ee,{children:"No Embeddings Loaded"})}):a.jsx(Kn,{inputRef:i,autoFocus:!0,placeholder:"Add Embedding",value:null,data:f,nothingFound:"No matching Embeddings",itemComponent:tl,disabled:f.length===0,onDropdownClose:r,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())},onChange:p})})})]})},t0=u.memo(lie),cie=()=>{const e=z(m=>m.generation.negativePrompt),t=u.useRef(null),{isOpen:n,onClose:r,onOpen:o}=Ao(),s=se(),{t:i}=Ie(),c=u.useCallback(m=>{s(jd(m.target.value))},[s]),f=u.useCallback(m=>{m.key==="<"&&o()},[o]),p=u.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),fs.flushSync(()=>{s(jd(b))}),t.current.selectionEnd=y,r()},[s,r,e]),h=Yn("embedding").isFeatureEnabled;return a.jsxs(pr,{children:[a.jsx(t0,{isOpen:n,onClose:r,onSelect:p,children:a.jsx(li,{id:"negativePrompt",name:"negativePrompt",ref:t,value:e,placeholder:i("parameters.negativePromptPlaceholder"),onChange:c,resize:"vertical",fontSize:"sm",minH:16,...h&&{onKeyDown:f}})}),!n&&h&&a.jsx(Fe,{sx:{position:"absolute",top:0,insetInlineEnd:0},children:a.jsx(e0,{onClick:o})})]})},PM=u.memo(cie),uie=le([ke,jr],({generation:e},t)=>({prompt:e.positivePrompt,activeTabName:t}),{memoizeOptions:{resultEqualityCheck:mn}}),die=()=>{const e=se(),{prompt:t,activeTabName:n}=z(uie),r=Df(),o=u.useRef(null),{isOpen:s,onClose:i,onOpen:c}=Ao(),{t:f}=Ie(),p=u.useCallback(b=>{e(kd(b.target.value))},[e]);St("alt+a",()=>{var b;(b=o.current)==null||b.focus()},[]);const h=u.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 C=x.length;x+=t.slice(y),fs.flushSync(()=>{e(kd(x))}),o.current.selectionStart=C,o.current.selectionEnd=C,i()},[e,i,t]),m=Yn("embedding").isFeatureEnabled,v=u.useCallback(b=>{b.key==="Enter"&&b.shiftKey===!1&&r&&(b.preventDefault(),e(af()),e(Vm(n))),m&&b.key==="<"&&c()},[r,e,n,c,m]);return a.jsxs(Fe,{position:"relative",children:[a.jsx(pr,{children:a.jsx(t0,{isOpen:s,onClose:i,onSelect:h,children:a.jsx(li,{id:"prompt",name:"prompt",ref:o,value:t,placeholder:f("parameters.positivePromptPlaceholder"),onChange:p,onKeyDown:v,resize:"vertical",minH:32})})}),!s&&m&&a.jsx(Fe,{sx:{position:"absolute",top:0,insetInlineEnd:0},children:a.jsx(e0,{onClick:c})})]})},IM=u.memo(die);function fie(){const e=z(r=>r.sdxl.shouldConcatSDXLStylePrompt),t=se(),n=()=>{t(zD(!e))};return a.jsx(tt,{"aria-label":"Concatenate Prompt & Style",tooltip:"Concatenate Prompt & Style",variant:"outline",isChecked:e,onClick:n,icon:a.jsx(zE,{}),size:"xs",sx:{position:"absolute",insetInlineEnd:1,top:6,border:"none",color:e?"accent.500":"base.500",_hover:{bg:"none"}}})}const Xj={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 EM(){return a.jsxs($,{children:[a.jsx(Fe,{as:yr.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",...Xj,_dark:{borderColor:"accent.500"}}}),a.jsx(Fe,{as:yr.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(zE,{size:12})}),a.jsx(Fe,{as:yr.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",...Xj,_dark:{borderColor:"accent.500"}}})]})}const pie=le([ke,jr],({sdxl:e},t)=>{const{negativeStylePrompt:n,shouldConcatSDXLStylePrompt:r}=e;return{prompt:n,shouldConcatSDXLStylePrompt:r,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:mn}}),hie=()=>{const e=se(),t=Df(),n=u.useRef(null),{isOpen:r,onClose:o,onOpen:s}=Ao(),{prompt:i,activeTabName:c,shouldConcatSDXLStylePrompt:f}=z(pie),p=u.useCallback(b=>{e(Pd(b.target.value))},[e]),h=u.useCallback(b=>{if(!n.current)return;const y=n.current.selectionStart;if(y===void 0)return;let x=i.slice(0,y);x[x.length-1]!=="<"&&(x+="<"),x+=`${b}>`;const C=x.length;x+=i.slice(y),fs.flushSync(()=>{e(Pd(x))}),n.current.selectionStart=C,n.current.selectionEnd=C,o()},[e,o,i]),m=Yn("embedding").isFeatureEnabled,v=u.useCallback(b=>{b.key==="Enter"&&b.shiftKey===!1&&t&&(b.preventDefault(),e(af()),e(Vm(c))),m&&b.key==="<"&&s()},[t,e,c,s,m]);return a.jsxs(Fe,{position:"relative",children:[a.jsx(co,{children:f&&a.jsx(Fe,{sx:{position:"absolute",left:"3",w:"94%",top:"-17px"},children:a.jsx(EM,{})})}),a.jsx(pr,{children:a.jsx(t0,{isOpen:r,onClose:o,onSelect:h,children:a.jsx(li,{id:"prompt",name:"prompt",ref:n,value:i,placeholder:"Negative Style Prompt",onChange:p,onKeyDown:v,resize:"vertical",fontSize:"sm",minH:16})})}),!r&&m&&a.jsx(Fe,{sx:{position:"absolute",top:0,insetInlineEnd:0},children:a.jsx(e0,{onClick:s})})]})},mie=u.memo(hie),gie=le([ke,jr],({sdxl:e},t)=>{const{positiveStylePrompt:n,shouldConcatSDXLStylePrompt:r}=e;return{prompt:n,shouldConcatSDXLStylePrompt:r,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:mn}}),vie=()=>{const e=se(),t=Df(),n=u.useRef(null),{isOpen:r,onClose:o,onOpen:s}=Ao(),{prompt:i,activeTabName:c,shouldConcatSDXLStylePrompt:f}=z(gie),p=u.useCallback(b=>{e(_d(b.target.value))},[e]),h=u.useCallback(b=>{if(!n.current)return;const y=n.current.selectionStart;if(y===void 0)return;let x=i.slice(0,y);x[x.length-1]!=="<"&&(x+="<"),x+=`${b}>`;const C=x.length;x+=i.slice(y),fs.flushSync(()=>{e(_d(x))}),n.current.selectionStart=C,n.current.selectionEnd=C,o()},[e,o,i]),m=Yn("embedding").isFeatureEnabled,v=u.useCallback(b=>{b.key==="Enter"&&b.shiftKey===!1&&t&&(b.preventDefault(),e(af()),e(Vm(c))),m&&b.key==="<"&&s()},[t,e,c,s,m]);return a.jsxs(Fe,{position:"relative",children:[a.jsx(co,{children:f&&a.jsx(Fe,{sx:{position:"absolute",left:"3",w:"94%",top:"-17px"},children:a.jsx(EM,{})})}),a.jsx(pr,{children:a.jsx(t0,{isOpen:r,onClose:o,onSelect:h,children:a.jsx(li,{id:"prompt",name:"prompt",ref:n,value:i,placeholder:"Positive Style Prompt",onChange:p,onKeyDown:v,resize:"vertical",minH:16})})}),!r&&m&&a.jsx(Fe,{sx:{position:"absolute",top:0,insetInlineEnd:0},children:a.jsx(e0,{onClick:s})})]})},bie=u.memo(vie);function a2(){return a.jsxs($,{sx:{flexDirection:"column",gap:2},children:[a.jsx(IM,{}),a.jsx(fie,{}),a.jsx(bie,{}),a.jsx(PM,{}),a.jsx(mie,{})]})}const Zl=()=>{const{isRefinerAvailable:e}=Gs(dx,{selectFromResult:({data:t})=>({isRefinerAvailable:t?t.ids.length>0:!1})});return e},xie=le([ke],({sdxl:e,ui:t,hotkeys:n})=>{const{refinerCFGScale:r}=e,{shouldUseSliders:o}=t,{shift:s}=n;return{refinerCFGScale:r,shouldUseSliders:o,shift:s}},Oe),yie=()=>{const{refinerCFGScale:e,shouldUseSliders:t,shift:n}=z(xie),r=Zl(),o=se(),{t:s}=Ie(),i=u.useCallback(f=>o(k1(f)),[o]),c=u.useCallback(()=>o(k1(7)),[o]);return t?a.jsx(jt,{label:s("parameters.cfgScale"),step:n?.1:.5,min:1,max:20,onChange:i,handleReset:c,value:e,sliderNumberInputProps:{max:200},withInput:!0,withReset:!0,withSliderMarks:!0,isInteger:!1,isDisabled:!r}):a.jsx(Tu,{label:s("parameters.cfgScale"),step:.5,min:1,max:200,onChange:i,value:e,isInteger:!1,numberInputFieldProps:{textAlign:"center"},isDisabled:!r})},wie=u.memo(yie),Cie=e=>{const t=Su("models"),[n,r,o]=e.split("/"),s=BD.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},Sie=le(ke,e=>({model:e.sdxl.refinerModel}),Oe),kie=()=>{const e=se(),t=Yn("syncModels").isFeatureEnabled,{model:n}=z(Sie),{data:r,isLoading:o}=Gs(dx),s=u.useMemo(()=>{if(!r)return[];const f=[];return Wr(r.entities,(p,h)=>{p&&f.push({value:h,label:p.model_name,group:xr[p.base_model]})}),f},[r]),i=u.useMemo(()=>(r==null?void 0:r.entities[`${n==null?void 0:n.base_model}/main/${n==null?void 0:n.model_name}`])??null,[r==null?void 0:r.entities,n]),c=u.useCallback(f=>{if(!f)return;const p=Cie(f);p&&e(J_(p))},[e]);return o?a.jsx(Kn,{label:"Refiner Model",placeholder:"Loading...",disabled:!0,data:[]}):a.jsxs($,{w:"100%",alignItems:"center",gap:2,children:[a.jsx(Kn,{tooltip:i==null?void 0:i.description,label:"Refiner Model",value:i==null?void 0:i.id,placeholder:s.length>0?"Select a model":"No models available",data:s,error:s.length===0,disabled:s.length===0,onChange:c,w:"100%"}),t&&a.jsx(Fe,{mt:7,children:a.jsx(Nu,{iconMode:!0})})]})},jie=u.memo(kie),_ie=le([ke],({sdxl:e,hotkeys:t})=>{const{refinerNegativeAestheticScore:n}=e,{shift:r}=t;return{refinerNegativeAestheticScore:n,shift:r}},Oe),Pie=()=>{const{refinerNegativeAestheticScore:e,shift:t}=z(_ie),n=Zl(),r=se(),o=u.useCallback(i=>r(_1(i)),[r]),s=u.useCallback(()=>r(_1(2.5)),[r]);return a.jsx(jt,{label:"Negative Aesthetic Score",step:t?.1:.5,min:1,max:10,onChange:o,handleReset:s,value:e,sliderNumberInputProps:{max:10},withInput:!0,withReset:!0,withSliderMarks:!0,isInteger:!1,isDisabled:!n})},Iie=u.memo(Pie),Eie=le([ke],({sdxl:e,hotkeys:t})=>{const{refinerPositiveAestheticScore:n}=e,{shift:r}=t;return{refinerPositiveAestheticScore:n,shift:r}},Oe),Oie=()=>{const{refinerPositiveAestheticScore:e,shift:t}=z(Eie),n=Zl(),r=se(),o=u.useCallback(i=>r(j1(i)),[r]),s=u.useCallback(()=>r(j1(6)),[r]);return a.jsx(jt,{label:"Positive Aesthetic Score",step:t?.1:.5,min:1,max:10,onChange:o,handleReset:s,value:e,sliderNumberInputProps:{max:10},withInput:!0,withReset:!0,withSliderMarks:!0,isInteger:!1,isDisabled:!n})},Mie=u.memo(Oie),Rie=le(ke,({ui:e,sdxl:t})=>{const{refinerScheduler:n}=t,{favoriteSchedulers:r}=e,o=uo(zm,(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}},Oe),Die=()=>{const e=se(),{t}=Ie(),{refinerScheduler:n,data:r}=z(Rie),o=Zl(),s=u.useCallback(i=>{i&&e(Z_(i))},[e]);return a.jsx(Kn,{w:"100%",label:t("parameters.scheduler"),value:n,data:r,onChange:s,disabled:!o})},Aie=u.memo(Die),Nie=le([ke],({sdxl:e})=>{const{refinerStart:t}=e;return{refinerStart:t}},Oe),Tie=()=>{const{refinerStart:e}=z(Nie),t=se(),n=Zl(),r=u.useCallback(s=>t(P1(s)),[t]),o=u.useCallback(()=>t(P1(.8)),[t]);return a.jsx(jt,{label:"Refiner Start",step:.01,min:0,max:1,onChange:r,handleReset:o,value:e,withInput:!0,withReset:!0,withSliderMarks:!0,isInteger:!1,isDisabled:!n})},$ie=u.memo(Tie),Lie=le([ke],({sdxl:e,ui:t})=>{const{refinerSteps:n}=e,{shouldUseSliders:r}=t;return{refinerSteps:n,shouldUseSliders:r}},Oe),Fie=()=>{const{refinerSteps:e,shouldUseSliders:t}=z(Lie),n=Zl(),r=se(),{t:o}=Ie(),s=u.useCallback(c=>{r(S1(c))},[r]),i=u.useCallback(()=>{r(S1(20))},[r]);return t?a.jsx(jt,{label:o("parameters.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(Tu,{label:o("parameters.steps"),min:1,max:500,step:1,onChange:s,value:e,numberInputFieldProps:{textAlign:"center"},isDisabled:!n})},zie=u.memo(Fie);function Bie(){const e=z(o=>o.sdxl.shouldUseSDXLRefiner),t=Zl(),n=se(),r=o=>{n(HD(o.target.checked))};return a.jsx(qn,{label:"Use Refiner",isChecked:e,onChange:r,isDisabled:!t})}const Hie=le(ke,e=>{const{shouldUseSDXLRefiner:t}=e.sdxl,{shouldUseSliders:n}=e.ui;return{activeLabel:t?"Enabled":void 0,shouldUseSliders:n}},Oe),Wie=()=>{const{activeLabel:e,shouldUseSliders:t}=z(Hie);return a.jsx(wo,{label:"Refiner",activeLabel:e,children:a.jsxs($,{sx:{gap:2,flexDir:"column"},children:[a.jsx(Bie,{}),a.jsx(jie,{}),a.jsxs($,{gap:2,flexDirection:t?"column":"row",children:[a.jsx(zie,{}),a.jsx(wie,{})]}),a.jsx(Aie,{}),a.jsx(Mie,{}),a.jsx(Iie,{}),a.jsx($ie,{})]})})},i2=u.memo(Wie),Vie=le([ke],({generation:e,config:t,ui:n,hotkeys:r})=>{const{initial:o,min:s,sliderMax:i,inputMax:c}=t.sd.guidance,{cfgScale:f}=e,{shouldUseSliders:p}=n,{shift:h}=r;return{cfgScale:f,initial:o,min:s,sliderMax:i,inputMax:c,shouldUseSliders:p,shift:h}},Oe),Uie=()=>{const{cfgScale:e,initial:t,min:n,sliderMax:r,inputMax:o,shouldUseSliders:s,shift:i}=z(Vie),c=se(),{t:f}=Ie(),p=u.useCallback(m=>c(xh(m)),[c]),h=u.useCallback(()=>c(xh(t)),[c,t]);return s?a.jsx(jt,{label:f("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(Tu,{label:f("parameters.cfgScale"),step:.5,min:n,max:o,onChange:p,value:e,isInteger:!1,numberInputFieldProps:{textAlign:"center"}})},Pa=u.memo(Uie),Gie=le([ke],e=>{const{initial:t,min:n,sliderMax:r,inputMax:o,fineStep:s,coarseStep:i}=e.config.sd.iterations,{iterations:c}=e.generation,{shouldUseSliders:f}=e.ui,p=e.dynamicPrompts.isEnabled&&e.dynamicPrompts.combinatorial,h=e.hotkeys.shift?s:i;return{iterations:c,initial:t,min:n,sliderMax:r,inputMax:o,step:h,shouldUseSliders:f,isDisabled:p}},Oe),qie=()=>{const{iterations:e,initial:t,min:n,sliderMax:r,inputMax:o,step:s,shouldUseSliders:i,isDisabled:c}=z(Gie),f=se(),{t:p}=Ie(),h=u.useCallback(v=>{f(pC(v))},[f]),m=u.useCallback(()=>{f(pC(t))},[f,t]);return i?a.jsx(jt,{isDisabled:c,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(Tu,{isDisabled:c,label:p("parameters.images"),step:s,min:n,max:o,onChange:h,value:e,numberInputFieldProps:{textAlign:"center"}})},Ia=u.memo(qie),Kie=le(ke,e=>({model:e.generation.model}),Oe),Xie=()=>{const e=se(),{t}=Ie(),{model:n}=z(Kie),r=Yn("syncModels").isFeatureEnabled,{data:o,isLoading:s}=Gs(hC),{data:i,isLoading:c}=Td(hC),f=z(jr),p=u.useMemo(()=>{if(!o)return[];const v=[];return Wr(o.entities,(b,y)=>{b&&v.push({value:y,label:b.model_name,group:xr[b.base_model]})}),Wr(i==null?void 0:i.entities,(b,y)=>{!b||f==="unifiedCanvas"||f==="img2img"||v.push({value:y,label:b.model_name,group:xr[b.base_model]})}),v},[o,i,f]),h=u.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=u.useCallback(v=>{if(!v)return;const b=Zg(v);b&&e(w1(b))},[e]);return s||c?a.jsx(Kn,{label:t("modelManager.model"),placeholder:"Loading...",disabled:!0,data:[]}):a.jsxs($,{w:"100%",alignItems:"center",gap:3,children:[a.jsx(Kn,{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(Fe,{mt:7,children:a.jsx(Nu,{iconMode:!0})})]})},Qie=u.memo(Xie),Yie=le(ke,({generation:e})=>{const{model:t,vae:n}=e;return{model:t,vae:n}},Oe),Jie=()=>{const e=se(),{t}=Ie(),{model:n,vae:r}=z(Yie),{data:o}=a3(),s=u.useMemo(()=>{if(!o)return[];const f=[{value:"default",label:"Default",group:"Default"}];return Wr(o.entities,(p,h)=>{if(!p)return;const m=(n==null?void 0:n.base_model)!==p.base_model;f.push({value:h,label:p.model_name,group:xr[p.base_model],disabled:m,tooltip:m?`Incompatible base model: ${p.base_model}`:void 0})}),f.sort((p,h)=>p.disabled&&!h.disabled?1:-1)},[o,n==null?void 0:n.base_model]),i=u.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]),c=u.useCallback(f=>{if(!f||f==="default"){e(mC(null));return}const p=jM(f);p&&e(mC(p))},[e]);return a.jsx(Kn,{itemComponent:tl,tooltip:i==null?void 0:i.description,label:t("modelManager.vae"),value:(i==null?void 0:i.id)??"default",placeholder:"Default",data:s,onChange:c,disabled:s.length===0,clearable:!0})},Zie=u.memo(Jie),ele=le([fx,ta],(e,t)=>{const{scheduler:n}=t,{favoriteSchedulers:r}=e,o=uo(zm,(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}},Oe),tle=()=>{const e=se(),{t}=Ie(),{scheduler:n,data:r}=z(ele),o=u.useCallback(s=>{s&&e(C1(s))},[e]);return a.jsx(Kn,{label:t("parameters.scheduler"),value:n,data:r,onChange:o})},nle=u.memo(tle),rle=le(ke,({generation:e})=>{const{vaePrecision:t}=e;return{vaePrecision:t}},Oe),ole=["fp16","fp32"],sle=()=>{const e=se(),{vaePrecision:t}=z(rle),n=u.useCallback(r=>{r&&e(WD(r))},[e]);return a.jsx(Zr,{label:"VAE Precision",value:t,data:ole,onChange:n})},ale=u.memo(sle),ile=()=>{const e=Yn("vae").isFeatureEnabled;return a.jsxs($,{gap:3,w:"full",flexWrap:e?"wrap":"nowrap",children:[a.jsx(Fe,{w:"full",children:a.jsx(Qie,{})}),a.jsx(Fe,{w:"full",children:a.jsx(nle,{})}),e&&a.jsxs($,{w:"full",gap:3,children:[a.jsx(Zie,{}),a.jsx(ale,{})]})]})},Ea=u.memo(ile),OM=[{name:"Free",value:null},{name:"2:3",value:2/3},{name:"16:9",value:16/9},{name:"1:1",value:1/1}],MM=OM.map(e=>e.value);function RM(){const e=z(o=>o.generation.aspectRatio),t=se(),n=z(o=>o.generation.shouldFitToWidthHeight),r=z(jr);return a.jsx($,{gap:2,flexGrow:1,children:a.jsx(vr,{isAttached:!0,children:OM.map(o=>a.jsx(Wt,{size:"sm",isChecked:e===o.value,isDisabled:r==="img2img"?!n:!1,onClick:()=>{t(As(o.value)),t($d(!1))},children:o.name},o.name))})})}const lle=le([ke],({generation:e,hotkeys:t,config:n})=>{const{min:r,sliderMax:o,inputMax:s,fineStep:i,coarseStep:c}=n.sd.height,{model:f,height:p}=e,{aspectRatio:h}=e,m=t.shift?i:c;return{model:f,height:p,min:r,sliderMax:o,inputMax:s,step:m,aspectRatio:h}},Oe),cle=e=>{const{model:t,height:n,min:r,sliderMax:o,inputMax:s,step:i,aspectRatio:c}=z(lle),f=se(),{t:p}=Ie(),h=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,m=u.useCallback(b=>{if(f(Ml(b)),c){const y=zs(b*c,8);f(Ol(y))}},[f,c]),v=u.useCallback(()=>{if(f(Ml(h)),c){const b=zs(h*c,8);f(Ol(b))}},[f,h,c]);return a.jsx(jt,{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})},ule=u.memo(cle),dle=le([ke],({generation:e,hotkeys:t,config:n})=>{const{min:r,sliderMax:o,inputMax:s,fineStep:i,coarseStep:c}=n.sd.width,{model:f,width:p,aspectRatio:h}=e,m=t.shift?i:c;return{model:f,width:p,min:r,sliderMax:o,inputMax:s,step:m,aspectRatio:h}},Oe),fle=e=>{const{model:t,width:n,min:r,sliderMax:o,inputMax:s,step:i,aspectRatio:c}=z(dle),f=se(),{t:p}=Ie(),h=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,m=u.useCallback(b=>{if(f(Ol(b)),c){const y=zs(b/c,8);f(Ml(y))}},[f,c]),v=u.useCallback(()=>{if(f(Ol(h)),c){const b=zs(h/c,8);f(Ml(b))}},[f,h,c]);return a.jsx(jt,{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})},ple=u.memo(fle),hle=le([ta,jr],(e,t)=>{const{shouldFitToWidthHeight:n,shouldLockAspectRatio:r,width:o,height:s}=e;return{activeTabName:t,shouldFitToWidthHeight:n,shouldLockAspectRatio:r,width:o,height:s}});function yu(){const{t:e}=Ie(),t=se(),{activeTabName:n,shouldFitToWidthHeight:r,shouldLockAspectRatio:o,width:s,height:i}=z(hle),c=u.useCallback(()=>{o?(t($d(!1)),MM.includes(s/i)?t(As(s/i)):t(As(null))):(t($d(!0)),t(As(s/i)))},[o,s,i,t]),f=u.useCallback(()=>{t(VD()),t(As(null)),o&&t(As(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(Ee,{sx:{fontSize:"sm",width:"full",color:"base.700",_dark:{color:"base.300"}},children:e("parameters.aspectRatio")}),a.jsx(Qi,{}),a.jsx(RM,{}),a.jsx(tt,{tooltip:e("ui.swapSizes"),"aria-label":e("ui.swapSizes"),size:"sm",icon:a.jsx(GO,{}),fontSize:20,isDisabled:n==="img2img"?!r:!1,onClick:f}),a.jsx(tt,{tooltip:e("ui.lockRatio"),"aria-label":e("ui.lockRatio"),size:"sm",icon:a.jsx(BE,{}),isChecked:o,isDisabled:n==="img2img"?!r:!1,onClick:c})]}),a.jsx($,{gap:2,alignItems:"center",children:a.jsxs($,{gap:2,flexDirection:"column",width:"full",children:[a.jsx(ple,{isDisabled:n==="img2img"?!r:!1}),a.jsx(ule,{isDisabled:n==="img2img"?!r:!1})]})})]})}const mle=le([ke],({generation:e,config:t,ui:n,hotkeys:r})=>{const{initial:o,min:s,sliderMax:i,inputMax:c,fineStep:f,coarseStep:p}=t.sd.steps,{steps:h}=e,{shouldUseSliders:m}=n,v=r.shift?f:p;return{steps:h,initial:o,min:s,sliderMax:i,inputMax:c,step:v,shouldUseSliders:m}},Oe),gle=()=>{const{steps:e,initial:t,min:n,sliderMax:r,inputMax:o,step:s,shouldUseSliders:i}=z(mle),c=se(),{t:f}=Ie(),p=u.useCallback(v=>{c(yh(v))},[c]),h=u.useCallback(()=>{c(yh(t))},[c,t]),m=u.useCallback(()=>{c(af())},[c]);return i?a.jsx(jt,{label:f("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(Tu,{label:f("parameters.steps"),min:n,max:o,step:s,onChange:p,value:e,numberInputFieldProps:{textAlign:"center"},onBlur:m})},Oa=u.memo(gle);function DM(){const e=se(),t=z(o=>o.generation.shouldFitToWidthHeight),n=o=>e(UD(o.target.checked)),{t:r}=Ie();return a.jsx(qn,{label:r("parameters.imageFit"),isChecked:t,onChange:n})}function vle(){const e=z(i=>i.generation.seed),t=z(i=>i.generation.shouldRandomizeSeed),n=z(i=>i.generation.shouldGenerateVariations),{t:r}=Ie(),o=se(),s=i=>o(bh(i));return a.jsx(Tu,{label:r("parameters.seed"),step:1,precision:0,flexGrow:1,min:u3,max:d3,isDisabled:t,isInvalid:e<0&&n,onChange:s,value:e})}const ble=(e,t)=>Math.floor(Math.random()*(t-e+1)+e);function xle(){const e=se(),t=z(o=>o.generation.shouldRandomizeSeed),{t:n}=Ie(),r=()=>e(bh(ble(u3,d3)));return a.jsx(tt,{size:"sm",isDisabled:t,"aria-label":n("parameters.shuffle"),tooltip:n("parameters.shuffle"),onClick:r,icon:a.jsx(IJ,{})})}const yle=()=>{const e=se(),{t}=Ie(),n=z(o=>o.generation.shouldRandomizeSeed),r=o=>e(GD(o.target.checked));return a.jsx(qn,{label:t("common.random"),isChecked:n,onChange:r})},wle=u.memo(yle),Cle=()=>a.jsxs($,{sx:{gap:3,alignItems:"flex-end"},children:[a.jsx(vle,{}),a.jsx(xle,{}),a.jsx(wle,{})]}),Ma=u.memo(Cle),AM=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(Ee,{fontSize:"sm",fontWeight:"bold",sx:{color:"base.600",_dark:{color:"base.300"}},children:e.label}),e.children]});AM.displayName="SubSettingsWrapper";const wu=u.memo(AM),Sle=le([ke],({sdxl:e})=>{const{sdxlImg2ImgDenoisingStrength:t}=e;return{sdxlImg2ImgDenoisingStrength:t}},Oe),kle=()=>{const{sdxlImg2ImgDenoisingStrength:e}=z(Sle),t=se(),{t:n}=Ie(),r=u.useCallback(s=>t(gC(s)),[t]),o=u.useCallback(()=>{t(gC(.7))},[t]);return a.jsx(wu,{children:a.jsx(jt,{label:`${n("parameters.denoisingStrength")}`,step:.01,min:0,max:1,onChange:r,handleReset:o,value:e,isInteger:!1,withInput:!0,withSliderMarks:!0,withReset:!0})})},NM=u.memo(kle),jle=le([fx,ta],(e,t)=>{const{shouldUseSliders:n}=e,{shouldRandomizeSeed:r}=t;return{shouldUseSliders:n,activeLabel:r?void 0:"Manual Seed"}},Oe),_le=()=>{const{shouldUseSliders:e,activeLabel:t}=z(jle);return a.jsx(wo,{label:"General",activeLabel:t,defaultIsOpen:!0,children:a.jsxs($,{sx:{flexDirection:"column",gap:3},children:[e?a.jsxs(a.Fragment,{children:[a.jsx(Ia,{}),a.jsx(Oa,{}),a.jsx(Pa,{}),a.jsx(Ea,{}),a.jsx(Fe,{pt:2,children:a.jsx(Ma,{})}),a.jsx(yu,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs($,{gap:3,children:[a.jsx(Ia,{}),a.jsx(Oa,{}),a.jsx(Pa,{})]}),a.jsx(Ea,{}),a.jsx(Fe,{pt:2,children:a.jsx(Ma,{})}),a.jsx(yu,{})]}),a.jsx(NM,{}),a.jsx(DM,{})]})})},Ple=u.memo(_le),Ile=()=>a.jsxs(a.Fragment,{children:[a.jsx(a2,{}),a.jsx(Ple,{}),a.jsx(i2,{}),a.jsx(Fu,{}),a.jsx(Lu,{}),a.jsx($u,{}),a.jsx(Af,{}),a.jsx(zu,{})]}),Ele=u.memo(Ile),Ole=le(ke,({ui:e,generation:t})=>{const{shouldUseSliders:n}=e,{shouldRandomizeSeed:r}=t;return{shouldUseSliders:n,activeLabel:r?void 0:"Manual Seed"}},Oe),Mle=()=>{const{shouldUseSliders:e,activeLabel:t}=z(Ole);return a.jsx(wo,{label:"General",activeLabel:t,defaultIsOpen:!0,children:a.jsx($,{sx:{flexDirection:"column",gap:3},children:e?a.jsxs(a.Fragment,{children:[a.jsx(Ia,{}),a.jsx(Oa,{}),a.jsx(Pa,{}),a.jsx(Ea,{}),a.jsx(Fe,{pt:2,children:a.jsx(Ma,{})}),a.jsx(yu,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs($,{gap:3,children:[a.jsx(Ia,{}),a.jsx(Oa,{}),a.jsx(Pa,{})]}),a.jsx(Ea,{}),a.jsx(Fe,{pt:2,children:a.jsx(Ma,{})}),a.jsx(yu,{})]})})})},TM=u.memo(Mle),Rle=()=>a.jsxs(a.Fragment,{children:[a.jsx(a2,{}),a.jsx(TM,{}),a.jsx(i2,{}),a.jsx(Fu,{}),a.jsx(Lu,{}),a.jsx($u,{}),a.jsx(Af,{}),a.jsx(zu,{})]}),Dle=u.memo(Rle),Ale=()=>{const e=se(),t=z(r=>r.generation.canvasCoherenceSteps),{t:n}=Ie();return a.jsx(jt,{label:n("parameters.coherenceSteps"),min:1,max:100,step:1,sliderNumberInputProps:{max:999},value:t,onChange:r=>{e(vC(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(vC(20))}})},Nle=u.memo(Ale),Tle=()=>{const e=se(),t=z(r=>r.generation.canvasCoherenceStrength),{t:n}=Ie();return a.jsx(jt,{label:n("parameters.coherenceStrength"),min:0,max:1,step:.01,sliderNumberInputProps:{max:999},value:t,onChange:r=>{e(bC(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(bC(.3))}})},$le=u.memo(Tle);function Lle(){const e=se(),t=z(r=>r.generation.maskBlur),{t:n}=Ie();return a.jsx(jt,{label:n("parameters.maskBlur"),min:0,max:64,sliderNumberInputProps:{max:512},value:t,onChange:r=>{e(xC(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(xC(16))}})}const Fle=[{label:"Box Blur",value:"box"},{label:"Gaussian Blur",value:"gaussian"}];function zle(){const e=z(o=>o.generation.maskBlurMethod),t=se(),{t:n}=Ie(),r=o=>{o&&t(qD(o))};return a.jsx(Zr,{value:e,onChange:r,label:n("parameters.maskBlurMethod"),data:Fle})}const Ble=()=>{const{t:e}=Ie();return a.jsx(wo,{label:e("parameters.compositingSettingsHeader"),children:a.jsxs($,{sx:{flexDirection:"column",gap:2},children:[a.jsxs(wu,{label:e("parameters.maskAdjustmentsHeader"),children:[a.jsx(Lle,{}),a.jsx(zle,{})]}),a.jsx(Ko,{}),a.jsxs(wu,{label:e("parameters.coherencePassHeader"),children:[a.jsx(Nle,{}),a.jsx($le,{})]})]})})},$M=u.memo(Ble),Hle=le([ke],({generation:e})=>{const{infillMethod:t}=e;return{infillMethod:t}},Oe),Wle=()=>{const e=se(),{infillMethod:t}=z(Hle),{data:n,isLoading:r}=q_(),o=n==null?void 0:n.infill_methods.filter(c=>c!=="lama"),{t:s}=Ie(),i=u.useCallback(c=>{e(KD(c))},[e]);return a.jsx(Zr,{disabled:(o==null?void 0:o.length)===0,placeholder:r?"Loading...":void 0,label:s("parameters.infillMethod"),value:t,data:o??[],onChange:i})},Vle=u.memo(Wle),Ule=le([ta],e=>{const{tileSize:t,infillMethod:n}=e;return{tileSize:t,infillMethod:n}},Oe),Gle=()=>{const e=se(),{tileSize:t,infillMethod:n}=z(Ule),{t:r}=Ie(),o=u.useCallback(i=>{e(yC(i))},[e]),s=u.useCallback(()=>{e(yC(32))},[e]);return a.jsx(jt,{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})},qle=u.memo(Gle),An=e=>e.canvas,ks=le([An,jr,Cs],(e,t,n)=>e.layerState.stagingArea.images.length>0||t==="unifiedCanvas"&&n.isProcessing),Kle=le([An],e=>{const{boundingBoxScaleMethod:t}=e;return{boundingBoxScale:t}},Oe),Xle=()=>{const e=se(),{boundingBoxScale:t}=z(Kle),{t:n}=Ie(),r=o=>{e(QD(o))};return a.jsx(Kn,{label:n("parameters.scaleBeforeProcessing"),data:XD,value:t,onChange:r})},Qle=u.memo(Xle),Yle=le([ta,An],(e,t)=>{const{scaledBoundingBoxDimensions:n,boundingBoxScaleMethod:r}=t,{model:o}=e;return{model:o,scaledBoundingBoxDimensions:n,isManual:r==="manual"}},Oe),Jle=()=>{const e=se(),{model:t,isManual:n,scaledBoundingBoxDimensions:r}=z(Yle),o=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,{t:s}=Ie(),i=f=>{e(Ch({...r,height:Math.floor(f)}))},c=()=>{e(Ch({...r,height:Math.floor(o)}))};return a.jsx(jt,{isDisabled:!n,label:s("parameters.scaledHeight"),min:64,max:1536,step:64,value:r.height,onChange:i,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:c})},Zle=u.memo(Jle),ece=le([An,ta],(e,t)=>{const{boundingBoxScaleMethod:n,scaledBoundingBoxDimensions:r}=e,{model:o}=t;return{model:o,scaledBoundingBoxDimensions:r,isManual:n==="manual"}},Oe),tce=()=>{const e=se(),{model:t,isManual:n,scaledBoundingBoxDimensions:r}=z(ece),o=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,{t:s}=Ie(),i=f=>{e(Ch({...r,width:Math.floor(f)}))},c=()=>{e(Ch({...r,width:Math.floor(o)}))};return a.jsx(jt,{isDisabled:!n,label:s("parameters.scaledWidth"),min:64,max:1536,step:64,value:r.width,onChange:i,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:c})},nce=u.memo(tce),rce=()=>{const{t:e}=Ie();return a.jsx(wo,{label:e("parameters.infillScalingHeader"),children:a.jsxs($,{sx:{gap:2,flexDirection:"column"},children:[a.jsxs(wu,{children:[a.jsx(Vle,{}),a.jsx(qle,{})]}),a.jsx(Ko,{}),a.jsxs(wu,{children:[a.jsx(Qle,{}),a.jsx(nce,{}),a.jsx(Zle,{})]})]})})},LM=u.memo(rce),oce=le([ke,ks],({canvas:e,generation:t},n)=>{const{boundingBoxDimensions:r}=e,{model:o,aspectRatio:s}=t;return{model:o,boundingBoxDimensions:r,isStaging:n,aspectRatio:s}},Oe),sce=()=>{const e=se(),{model:t,boundingBoxDimensions:n,isStaging:r,aspectRatio:o}=z(oce),{t:s}=Ie(),i=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,c=p=>{if(e(Ls({...n,height:Math.floor(p)})),o){const h=zs(p*o,64);e(Ls({width:h,height:Math.floor(p)}))}},f=()=>{if(e(Ls({...n,height:Math.floor(i)})),o){const p=zs(i*o,64);e(Ls({width:p,height:Math.floor(i)}))}};return a.jsx(jt,{label:s("parameters.boundingBoxHeight"),min:64,max:1536,step:64,value:n.height,onChange:c,isDisabled:r,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:f})},ace=u.memo(sce),ice=le([ke,ks],({canvas:e,generation:t},n)=>{const{boundingBoxDimensions:r}=e,{model:o,aspectRatio:s}=t;return{model:o,boundingBoxDimensions:r,isStaging:n,aspectRatio:s}},Oe),lce=()=>{const e=se(),{model:t,boundingBoxDimensions:n,isStaging:r,aspectRatio:o}=z(ice),s=["sdxl","sdxl-refiner"].includes(t==null?void 0:t.base_model)?1024:512,{t:i}=Ie(),c=p=>{if(e(Ls({...n,width:Math.floor(p)})),o){const h=zs(p/o,64);e(Ls({width:Math.floor(p),height:h}))}},f=()=>{if(e(Ls({...n,width:Math.floor(s)})),o){const p=zs(s/o,64);e(Ls({width:Math.floor(s),height:p}))}};return a.jsx(jt,{label:i("parameters.boundingBoxWidth"),min:64,max:1536,step:64,value:n.width,onChange:c,isDisabled:r,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:f})},cce=u.memo(lce),uce=le([ta,An],(e,t)=>{const{shouldFitToWidthHeight:n,shouldLockAspectRatio:r}=e,{boundingBoxDimensions:o}=t;return{shouldFitToWidthHeight:n,shouldLockAspectRatio:r,boundingBoxDimensions:o}});function Tm(){const e=se(),{t}=Ie(),{shouldLockAspectRatio:n,boundingBoxDimensions:r}=z(uce),o=u.useCallback(()=>{n?(e($d(!1)),MM.includes(r.width/r.height)?e(As(r.width/r.height)):e(As(null))):(e($d(!0)),e(As(r.width/r.height)))},[n,r,e]),s=u.useCallback(()=>{e(YD()),e(As(null)),n&&e(As(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(Ee,{sx:{fontSize:"sm",width:"full",color:"base.700",_dark:{color:"base.300"}},children:t("parameters.aspectRatio")}),a.jsx(Qi,{}),a.jsx(RM,{}),a.jsx(tt,{tooltip:t("ui.swapSizes"),"aria-label":t("ui.swapSizes"),size:"sm",icon:a.jsx(GO,{}),fontSize:20,onClick:s}),a.jsx(tt,{tooltip:t("ui.lockRatio"),"aria-label":t("ui.lockRatio"),size:"sm",icon:a.jsx(BE,{}),isChecked:n,onClick:o})]}),a.jsx(cce,{}),a.jsx(ace,{})]})}const dce=le(ke,({ui:e,generation:t})=>{const{shouldUseSliders:n}=e,{shouldRandomizeSeed:r}=t;return{shouldUseSliders:n,activeLabel:r?void 0:"Manual Seed"}},Oe),fce=()=>{const{shouldUseSliders:e,activeLabel:t}=z(dce);return a.jsx(wo,{label:"General",activeLabel:t,defaultIsOpen:!0,children:a.jsxs($,{sx:{flexDirection:"column",gap:3},children:[e?a.jsxs(a.Fragment,{children:[a.jsx(Ia,{}),a.jsx(Oa,{}),a.jsx(Pa,{}),a.jsx(Ea,{}),a.jsx(Fe,{pt:2,children:a.jsx(Ma,{})}),a.jsx(Tm,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs($,{gap:3,children:[a.jsx(Ia,{}),a.jsx(Oa,{}),a.jsx(Pa,{})]}),a.jsx(Ea,{}),a.jsx(Fe,{pt:2,children:a.jsx(Ma,{})}),a.jsx(Tm,{})]}),a.jsx(NM,{})]})})},pce=u.memo(fce);function hce(){return a.jsxs(a.Fragment,{children:[a.jsx(a2,{}),a.jsx(pce,{}),a.jsx(i2,{}),a.jsx(Fu,{}),a.jsx(Lu,{}),a.jsx($u,{}),a.jsx(Af,{}),a.jsx(LM,{}),a.jsx($M,{}),a.jsx(zu,{})]})}function mce(){const e=z(f=>f.generation.clipSkip),{model:t}=z(f=>f.generation),n=se(),{t:r}=Ie(),o=u.useCallback(f=>{n(wC(f))},[n]),s=u.useCallback(()=>{n(wC(0))},[n]),i=u.useMemo(()=>t?wp[t.base_model].maxClip:wp["sd-1"].maxClip,[t]),c=u.useMemo(()=>t?wp[t.base_model].markers:wp["sd-1"].markers,[t]);return a.jsx(jt,{label:r("parameters.clipSkip"),"aria-label":r("parameters.clipSkip"),min:0,max:i,step:1,value:e,onChange:o,withSliderMarks:!0,sliderMarks:c,withInput:!0,withReset:!0,handleReset:s})}const gce=le(ke,e=>({activeLabel:e.generation.clipSkip>0?"Clip Skip":void 0}),Oe);function l2(){const{activeLabel:e}=z(gce);return z(n=>n.generation.shouldShowAdvancedOptions)?a.jsx(wo,{label:"Advanced",activeLabel:e,children:a.jsx($,{sx:{flexDir:"column",gap:2},children:a.jsx(mce,{})})}):null}function c2(){return a.jsxs($,{sx:{flexDirection:"column",gap:2},children:[a.jsx(IM,{}),a.jsx(PM,{})]})}function vce(){const e=z(o=>o.generation.horizontalSymmetrySteps),t=z(o=>o.generation.steps),n=se(),{t:r}=Ie();return a.jsx(jt,{label:r("parameters.hSymmetryStep"),value:e,onChange:o=>n(CC(o)),min:0,max:t,step:1,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>n(CC(0))})}function bce(){const e=z(o=>o.generation.verticalSymmetrySteps),t=z(o=>o.generation.steps),n=se(),{t:r}=Ie();return a.jsx(jt,{label:r("parameters.vSymmetryStep"),value:e,onChange:o=>n(SC(o)),min:0,max:t,step:1,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>n(SC(0))})}function xce(){const e=z(n=>n.generation.shouldUseSymmetry),t=se();return a.jsx(qn,{label:"Enable Symmetry",isChecked:e,onChange:n=>t(JD(n.target.checked))})}const yce=le(ke,e=>({activeLabel:e.generation.shouldUseSymmetry?"Enabled":void 0}),Oe),wce=()=>{const{t:e}=Ie(),{activeLabel:t}=z(yce);return Yn("symmetry").isFeatureEnabled?a.jsx(wo,{label:e("parameters.symmetry"),activeLabel:t,children:a.jsxs($,{sx:{gap:2,flexDirection:"column"},children:[a.jsx(xce,{}),a.jsx(vce,{}),a.jsx(bce,{})]})}):null},u2=u.memo(wce),Cce=le([ke],({generation:e,hotkeys:t,config:n})=>{const{initial:r,min:o,sliderMax:s,inputMax:i,fineStep:c,coarseStep:f}=n.sd.img2imgStrength,{img2imgStrength:p}=e,h=t.shift?c:f;return{img2imgStrength:p,initial:r,min:o,sliderMax:s,inputMax:i,step:h}},Oe),Sce=()=>{const{img2imgStrength:e,initial:t,min:n,sliderMax:r,inputMax:o,step:s}=z(Cce),i=se(),{t:c}=Ie(),f=u.useCallback(h=>i(wh(h)),[i]),p=u.useCallback(()=>{i(wh(t))},[i,t]);return a.jsx(wu,{children:a.jsx(jt,{label:`${c("parameters.denoisingStrength")}`,step:s,min:n,max:r,onChange:f,handleReset:p,value:e,isInteger:!1,withInput:!0,withSliderMarks:!0,withReset:!0,sliderNumberInputProps:{max:o}})})},FM=u.memo(Sce),kce=le([fx,ta],(e,t)=>{const{shouldUseSliders:n}=e,{shouldRandomizeSeed:r}=t;return{shouldUseSliders:n,activeLabel:r?void 0:"Manual Seed"}},Oe),jce=()=>{const{shouldUseSliders:e,activeLabel:t}=z(kce);return a.jsx(wo,{label:"General",activeLabel:t,defaultIsOpen:!0,children:a.jsxs($,{sx:{flexDirection:"column",gap:3},children:[e?a.jsxs(a.Fragment,{children:[a.jsx(Ia,{}),a.jsx(Oa,{}),a.jsx(Pa,{}),a.jsx(Ea,{}),a.jsx(Fe,{pt:2,children:a.jsx(Ma,{})}),a.jsx(yu,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs($,{gap:3,children:[a.jsx(Ia,{}),a.jsx(Oa,{}),a.jsx(Pa,{})]}),a.jsx(Ea,{}),a.jsx(Fe,{pt:2,children:a.jsx(Ma,{})}),a.jsx(yu,{})]}),a.jsx(FM,{}),a.jsx(DM,{})]})})},_ce=u.memo(jce),Pce=()=>a.jsxs(a.Fragment,{children:[a.jsx(c2,{}),a.jsx(_ce,{}),a.jsx(Fu,{}),a.jsx(Lu,{}),a.jsx($u,{}),a.jsx(Af,{}),a.jsx(u2,{}),a.jsx(zu,{}),a.jsx(l2,{})]}),Ice=u.memo(Pce),Ece=()=>a.jsxs(a.Fragment,{children:[a.jsx(c2,{}),a.jsx(TM,{}),a.jsx(Fu,{}),a.jsx(Lu,{}),a.jsx($u,{}),a.jsx(Af,{}),a.jsx(u2,{}),a.jsx(zu,{}),a.jsx(l2,{})]}),Oce=u.memo(Ece),Mce=le(ke,({ui:e,generation:t})=>{const{shouldUseSliders:n}=e,{shouldRandomizeSeed:r}=t;return{shouldUseSliders:n,activeLabel:r?void 0:"Manual Seed"}},Oe),Rce=()=>{const{shouldUseSliders:e,activeLabel:t}=z(Mce);return a.jsx(wo,{label:"General",activeLabel:t,defaultIsOpen:!0,children:a.jsxs($,{sx:{flexDirection:"column",gap:3},children:[e?a.jsxs(a.Fragment,{children:[a.jsx(Ia,{}),a.jsx(Oa,{}),a.jsx(Pa,{}),a.jsx(Ea,{}),a.jsx(Fe,{pt:2,children:a.jsx(Ma,{})}),a.jsx(Tm,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs($,{gap:3,children:[a.jsx(Ia,{}),a.jsx(Oa,{}),a.jsx(Pa,{})]}),a.jsx(Ea,{}),a.jsx(Fe,{pt:2,children:a.jsx(Ma,{})}),a.jsx(Tm,{})]}),a.jsx(FM,{})]})})},Dce=u.memo(Rce),Ace=()=>a.jsxs(a.Fragment,{children:[a.jsx(c2,{}),a.jsx(Dce,{}),a.jsx(Fu,{}),a.jsx(Lu,{}),a.jsx($u,{}),a.jsx(u2,{}),a.jsx(LM,{}),a.jsx($M,{}),a.jsx(zu,{}),a.jsx(l2,{})]}),Nce=u.memo(Ace),Tce=()=>{const e=z(jr),t=z(n=>n.generation.model);return e==="txt2img"?a.jsx(mh,{children:t&&t.base_model==="sdxl"?a.jsx(Dle,{}):a.jsx(Oce,{})}):e==="img2img"?a.jsx(mh,{children:t&&t.base_model==="sdxl"?a.jsx(Ele,{}):a.jsx(Ice,{})}):e==="unifiedCanvas"?a.jsx(mh,{children:t&&t.base_model==="sdxl"?a.jsx(hce,{}):a.jsx(Nce,{})}):null},$ce=u.memo(Tce),mh=u.memo(e=>a.jsxs($,{sx:{w:"full",h:"full",flexDir:"column",gap:2},children:[a.jsx(YO,{}),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(Fe,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0},children:a.jsx($g,{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})})})})})]}));mh.displayName="ParametersPanelWrapper";const Lce=le([ke],e=>{const{initialImage:t}=e.generation;return{initialImage:t,isResetButtonDisabled:!t}},Oe),Fce=()=>{const{initialImage:e}=z(Lce),{currentData:t}=qo((e==null?void 0:e.imageName)??Yo.skipToken),n=u.useMemo(()=>{if(t)return{id:"initial-image",payloadType:"IMAGE_DTO",payload:{imageDTO:t}}},[t]),r=u.useMemo(()=>({id:"initial-image",actionType:"SET_INITIAL_IMAGE"}),[]);return a.jsx(ii,{imageDTO:t,droppableData:r,draggableData:n,isUploadDisabled:!0,fitContainer:!0,dropLabel:"Set as Initial Image",noContentFallback:a.jsx(lo,{label:"No initial image selected"})})},zce=u.memo(Fce),Bce=le([ke],e=>{const{initialImage:t}=e.generation;return{isResetButtonDisabled:!t}},Oe),Hce={type:"SET_INITIAL_IMAGE"},Wce=()=>{const{isResetButtonDisabled:e}=z(Bce),t=se(),{getUploadButtonProps:n,getUploadInputProps:r}=Ky({postUploadAction:Hce}),o=u.useCallback(()=>{t(ZD())},[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(Ee,{sx:{ps:2,fontWeight:600,userSelect:"none",color:"base.700",_dark:{color:"base.200"}},children:"Initial Image"}),a.jsx(Qi,{}),a.jsx(tt,{tooltip:"Upload Initial Image","aria-label":"Upload Initial Image",icon:a.jsx(Mg,{}),...n()}),a.jsx(tt,{tooltip:"Reset Initial Image","aria-label":"Reset Initial Image",icon:a.jsx(Og,{}),onClick:o,isDisabled:e})]}),a.jsx(zce,{}),a.jsx("input",{...r()})]})},Vce=u.memo(Wce),Uce=le([ke],({system:e})=>{const{isProcessing:t,isConnected:n}=e;return n&&!t}),Gce=e=>{const{onClick:t,isDisabled:n}=e,{t:r}=Ie(),o=z(Uce);return a.jsx(tt,{onClick:t,icon:a.jsx(Jo,{}),tooltip:`${r("gallery.deleteImage")} (Del)`,"aria-label":`${r("gallery.deleteImage")} (Del)`,isDisabled:n||!o,colorScheme:"error"})},qce=[{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 Kce(){const e=z(r=>r.postprocessing.esrganModelName),t=se(),n=r=>t(eA(r));return a.jsx(Zr,{label:"ESRGAN Model",value:e,itemComponent:tl,onChange:n,data:qce})}const Xce=e=>{const{imageDTO:t}=e,n=se(),r=z(Or),{t:o}=Ie(),{isOpen:s,onOpen:i,onClose:c}=Ao(),f=u.useCallback(()=>{c(),t&&n(f3({image_name:t.image_name}))},[n,t,c]);return a.jsx(Rf,{isOpen:s,onClose:c,triggerComponent:a.jsx(tt,{onClick:i,icon:a.jsx(hJ,{}),"aria-label":o("parameters.upscale")}),children:a.jsxs($,{sx:{flexDirection:"column",gap:4},children:[a.jsx(Kce,{}),a.jsx(Wt,{size:"sm",isDisabled:!t||r,onClick:f,children:o("parameters.upscaleImage")})]})})},Qce=u.memo(Xce),Yce=le([ke,jr],({gallery:e,system:t,ui:n},r)=>{const{isProcessing:o,isConnected:s,shouldConfirmOnDelete:i,progressImage:c}=t,{shouldShowImageDetails:f,shouldHidePreview:p,shouldShowProgressInViewer:h}=n,m=e.selection[e.selection.length-1];return{canDeleteImage:s&&!o,shouldConfirmOnDelete:i,isProcessing:o,isConnected:s,shouldDisableToolbarButtons:!!c||!m,shouldShowImageDetails:f,activeTabName:r,shouldHidePreview:p,shouldShowProgressInViewer:h,lastSelectedImage:m}},{memoizeOptions:{resultEqualityCheck:mn}}),Jce=e=>{const t=se(),{isProcessing:n,isConnected:r,shouldDisableToolbarButtons:o,shouldShowImageDetails:s,lastSelectedImage:i,shouldShowProgressInViewer:c}=z(Yce),f=Yn("upscaling").isFeatureEnabled,p=Kl(),{t:h}=Ie(),{recallBothPrompts:m,recallSeed:v,recallAllParameters:b}=Ug(),{currentData:y}=qo((i==null?void 0:i.image_name)??Yo.skipToken),{metadata:x,workflow:C,isLoading:k}=ox((i==null?void 0:i.image_name)??Yo.skipToken,{selectFromResult:T=>{var K,B;return{isLoading:T.isFetching,metadata:(K=T==null?void 0:T.currentData)==null?void 0:K.metadata,workflow:(B=T==null?void 0:T.currentData)==null?void 0:B.workflow}}}),j=u.useCallback(()=>{C&&(t(ix(C)),t(va("nodes")),t(Cn(_n({title:"Workflow Loaded",status:"success"}))))},[t,C]),_=u.useCallback(()=>{b(x)},[x,b]);St("a",()=>{},[x,b]);const I=u.useCallback(()=>{v(x==null?void 0:x.seed)},[x==null?void 0:x.seed,v]);St("s",I,[y]);const O=u.useCallback(()=>{m(x==null?void 0:x.positive_prompt,x==null?void 0:x.negative_prompt,x==null?void 0:x.positive_style_prompt,x==null?void 0:x.negative_style_prompt)},[x==null?void 0:x.negative_prompt,x==null?void 0:x.positive_prompt,x==null?void 0:x.positive_style_prompt,x==null?void 0:x.negative_style_prompt,m]);St("p",O,[y]),St("w",j,[C]);const E=u.useCallback(()=>{t(qO()),t(Hm(y))},[t,y]);St("shift+i",E,[y]);const M=u.useCallback(()=>{y&&t(f3({image_name:y.image_name}))},[t,y]),R=u.useCallback(()=>{y&&t(Wm([y]))},[t,y]);St("Shift+U",()=>{M()},{enabled:()=>!!(f&&!o&&r&&!n)},[f,y,o,r,n]);const A=u.useCallback(()=>t(tA(!s)),[t,s]);St("i",()=>{y?A():p({title:h("toast.metadataLoadFailed"),status:"error",duration:2500,isClosable:!0})},[y,s,p]),St("delete",()=>{R()},[t,y]);const D=u.useCallback(()=>{t(K_(!c))},[t,c]);return a.jsx(a.Fragment,{children:a.jsxs($,{sx:{flexWrap:"wrap",justifyContent:"center",alignItems:"center",gap:2},...e,children:[a.jsx(vr,{isAttached:!0,isDisabled:o,children:a.jsxs(yf,{children:[a.jsx(wf,{as:tt,"aria-label":`${h("parameters.sendTo")}...`,tooltip:`${h("parameters.sendTo")}...`,isDisabled:!y,icon:a.jsx(DJ,{})}),a.jsx(Ui,{motionProps:au,children:y&&a.jsx(KO,{imageDTO:y})})]})}),a.jsxs(vr,{isAttached:!0,isDisabled:o,children:[a.jsx(tt,{isLoading:k,icon:a.jsx(Gg,{}),tooltip:`${h("nodes.loadWorkflow")} (W)`,"aria-label":`${h("nodes.loadWorkflow")} (W)`,isDisabled:!C,onClick:j}),a.jsx(tt,{isLoading:k,icon:a.jsx(WE,{}),tooltip:`${h("parameters.usePrompt")} (P)`,"aria-label":`${h("parameters.usePrompt")} (P)`,isDisabled:!(x!=null&&x.positive_prompt),onClick:O}),a.jsx(tt,{isLoading:k,icon:a.jsx(VE,{}),tooltip:`${h("parameters.useSeed")} (S)`,"aria-label":`${h("parameters.useSeed")} (S)`,isDisabled:!(x!=null&&x.seed),onClick:I}),a.jsx(tt,{isLoading:k,icon:a.jsx(DE,{}),tooltip:`${h("parameters.useAll")} (A)`,"aria-label":`${h("parameters.useAll")} (A)`,isDisabled:!x,onClick:_})]}),f&&a.jsx(vr,{isAttached:!0,isDisabled:o,children:f&&a.jsx(Qce,{imageDTO:y})}),a.jsx(vr,{isAttached:!0,isDisabled:o,children:a.jsx(tt,{icon:a.jsx(NE,{}),tooltip:`${h("parameters.info")} (I)`,"aria-label":`${h("parameters.info")} (I)`,isChecked:s,onClick:A})}),a.jsx(vr,{isAttached:!0,children:a.jsx(tt,{"aria-label":h("settings.displayInProgress"),tooltip:h("settings.displayInProgress"),icon:a.jsx(wJ,{}),isChecked:c,onClick:D})}),a.jsx(vr,{isAttached:!0,children:a.jsx(Gce,{onClick:R,isDisabled:o})})]})})},Zce=u.memo(Jce),eue=le([ke,lx],(e,t)=>{var j,_;const{data:n,status:r}=nA.endpoints.listImages.select(t)(e),{data:o}=e.gallery.galleryView==="images"?kC.endpoints.getBoardImagesTotal.select(t.board_id??"none")(e):kC.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 c={...t,offset:n.ids.length,limit:o3},f=rA.getSelectors(),p=f.selectAll(n),h=p.findIndex(I=>I.image_name===s.image_name),m=El(h+1,0,p.length-1),v=El(h-1,0,p.length-1),b=(j=p[m])==null?void 0:j.image_name,y=(_=p[v])==null?void 0:_.image_name,x=b?f.selectById(n,b):void 0,C=y?f.selectById(n,y):void 0,k=p.length;return{loadedImagesCount:p.length,currentImageIndex:h,areMoreImagesAvailable:(o??0)>k,isFetching:r==="pending",nextImage:x,prevImage:C,queryArgs:c}},{memoizeOptions:{resultEqualityCheck:mn}}),zM=()=>{const e=se(),{nextImage:t,prevImage:n,areMoreImagesAvailable:r,isFetching:o,queryArgs:s,loadedImagesCount:i,currentImageIndex:c}=z(eue),f=u.useCallback(()=>{n&&e(jC(n))},[e,n]),p=u.useCallback(()=>{t&&e(jC(t))},[e,t]),[h]=r3(),m=u.useCallback(()=>{h(s)},[h,s]);return{handlePrevImage:f,handleNextImage:p,isOnFirstImage:c===0,isOnLastImage:c!==void 0&&c===i-1,nextImage:t,prevImage:n,areMoreImagesAvailable:r,handleLoadMoreImages:m,isFetching:o}};function tue(e){return Je({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 nue=({label:e,value:t,onClick:n,isLink:r,labelPosition:o,withCopy:s=!1})=>{const{t:i}=Ie();return t?a.jsxs($,{gap:2,children:[n&&a.jsx(Mn,{label:`Recall ${e}`,children:a.jsx(wa,{"aria-label":i("accessibility.useThisParameter"),icon:a.jsx(tue,{}),size:"xs",variant:"ghost",fontSize:20,onClick:n})}),s&&a.jsx(Mn,{label:`Copy ${e}`,children:a.jsx(wa,{"aria-label":`Copy ${e}`,icon:a.jsx(Du,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(t.toString())})}),a.jsxs($,{direction:o?"column":"row",children:[a.jsxs(Ee,{fontWeight:"semibold",whiteSpace:"pre-wrap",pr:2,children:[e,":"]}),r?a.jsxs(rg,{href:t.toString(),isExternal:!0,wordBreak:"break-all",children:[t.toString()," ",a.jsx(_O,{mx:"2px"})]}):a.jsx(Ee,{overflowY:"scroll",wordBreak:"break-all",children:t.toString()})]})]}):null},is=u.memo(nue),rue=e=>{const{metadata:t}=e,{recallPositivePrompt:n,recallNegativePrompt:r,recallSeed:o,recallCfgScale:s,recallModel:i,recallScheduler:c,recallSteps:f,recallWidth:p,recallHeight:h,recallStrength:m}=Ug(),v=u.useCallback(()=>{n(t==null?void 0:t.positive_prompt)},[t==null?void 0:t.positive_prompt,n]),b=u.useCallback(()=>{r(t==null?void 0:t.negative_prompt)},[t==null?void 0:t.negative_prompt,r]),y=u.useCallback(()=>{o(t==null?void 0:t.seed)},[t==null?void 0:t.seed,o]),x=u.useCallback(()=>{i(t==null?void 0:t.model)},[t==null?void 0:t.model,i]),C=u.useCallback(()=>{p(t==null?void 0:t.width)},[t==null?void 0:t.width,p]),k=u.useCallback(()=>{h(t==null?void 0:t.height)},[t==null?void 0:t.height,h]),j=u.useCallback(()=>{c(t==null?void 0:t.scheduler)},[t==null?void 0:t.scheduler,c]),_=u.useCallback(()=>{f(t==null?void 0:t.steps)},[t==null?void 0:t.steps,f]),I=u.useCallback(()=>{s(t==null?void 0:t.cfg_scale)},[t==null?void 0:t.cfg_scale,s]),O=u.useCallback(()=>{m(t==null?void 0:t.strength)},[t==null?void 0:t.strength,m]);return!t||Object.keys(t).length===0?null:a.jsxs(a.Fragment,{children:[t.created_by&&a.jsx(is,{label:"Created By",value:t.created_by}),t.generation_mode&&a.jsx(is,{label:"Generation Mode",value:t.generation_mode}),t.positive_prompt&&a.jsx(is,{label:"Positive Prompt",labelPosition:"top",value:t.positive_prompt,onClick:v}),t.negative_prompt&&a.jsx(is,{label:"Negative Prompt",labelPosition:"top",value:t.negative_prompt,onClick:b}),t.seed!==void 0&&t.seed!==null&&a.jsx(is,{label:"Seed",value:t.seed,onClick:y}),t.model!==void 0&&t.model!==null&&a.jsx(is,{label:"Model",value:t.model.model_name,onClick:x}),t.width&&a.jsx(is,{label:"Width",value:t.width,onClick:C}),t.height&&a.jsx(is,{label:"Height",value:t.height,onClick:k}),t.scheduler&&a.jsx(is,{label:"Scheduler",value:t.scheduler,onClick:j}),t.steps&&a.jsx(is,{label:"Steps",value:t.steps,onClick:_}),t.cfg_scale!==void 0&&t.cfg_scale!==null&&a.jsx(is,{label:"CFG scale",value:t.cfg_scale,onClick:I}),t.strength&&a.jsx(is,{label:"Image to image strength",value:t.strength,onClick:O})]})},oue=u.memo(rue),sue=({image:e})=>{const{metadata:t,workflow:n}=ox(e.image_name,{selectFromResult:r=>{var o,s;return{metadata:(o=r==null?void 0:r.currentData)==null?void 0:o.metadata,workflow:(s=r==null?void 0:r.currentData)==null?void 0:s.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(Ee,{fontWeight:"semibold",children:"File:"}),a.jsxs(rg,{href:e.image_url,isExternal:!0,maxW:"calc(100% - 3rem)",children:[e.image_name,a.jsx(_O,{mx:"2px"})]})]}),a.jsx(oue,{metadata:t}),a.jsxs(Gl,{variant:"line",sx:{display:"flex",flexDir:"column",w:"full",h:"full"},children:[a.jsxs(ql,{children:[a.jsx(Ro,{children:"Metadata"}),a.jsx(Ro,{children:"Image Details"}),a.jsx(Ro,{children:"Workflow"})]}),a.jsxs(Ou,{children:[a.jsx(bs,{children:t?a.jsx(Pl,{data:t,label:"Metadata"}):a.jsx(lo,{label:"No metadata found"})}),a.jsx(bs,{children:e?a.jsx(Pl,{data:e,label:"Image Details"}):a.jsx(lo,{label:"No image details found"})}),a.jsx(bs,{children:n?a.jsx(Pl,{data:n,label:"Workflow"}):a.jsx(lo,{label:"No workflow found"})})]})]})]})},aue=u.memo(sue),u1={color:"base.100",pointerEvents:"auto"},iue=()=>{const{t:e}=Ie(),{handlePrevImage:t,handleNextImage:n,isOnFirstImage:r,isOnLastImage:o,handleLoadMoreImages:s,areMoreImagesAvailable:i,isFetching:c}=zM();return a.jsxs(Fe,{sx:{position:"relative",height:"100%",width:"100%"},children:[a.jsx(Fe,{sx:{pos:"absolute",top:"50%",transform:"translate(0, -50%)",insetInlineStart:0},children:!r&&a.jsx(wa,{"aria-label":e("accessibility.previousImage"),icon:a.jsx(eJ,{size:64}),variant:"unstyled",onClick:t,boxSize:16,sx:u1})}),a.jsxs(Fe,{sx:{pos:"absolute",top:"50%",transform:"translate(0, -50%)",insetInlineEnd:0},children:[!o&&a.jsx(wa,{"aria-label":e("accessibility.nextImage"),icon:a.jsx(tJ,{size:64}),variant:"unstyled",onClick:n,boxSize:16,sx:u1}),o&&i&&!c&&a.jsx(wa,{"aria-label":e("accessibility.loadMore"),icon:a.jsx(ZY,{size:64}),variant:"unstyled",onClick:s,boxSize:16,sx:u1}),o&&i&&c&&a.jsx($,{sx:{w:16,h:16,alignItems:"center",justifyContent:"center"},children:a.jsx(Wl,{opacity:.5,size:"xl"})})]})]})},BM=u.memo(iue),lue=le([ke,oA],({ui:e,system:t},n)=>{const{shouldShowImageDetails:r,shouldHidePreview:o,shouldShowProgressInViewer:s}=e,{progressImage:i,shouldAntialiasProgressImage:c}=t;return{shouldShowImageDetails:r,shouldHidePreview:o,imageName:n==null?void 0:n.image_name,progressImage:i,shouldShowProgressInViewer:s,shouldAntialiasProgressImage:c}},{memoizeOptions:{resultEqualityCheck:mn}}),cue=()=>{const{shouldShowImageDetails:e,imageName:t,progressImage:n,shouldShowProgressInViewer:r,shouldAntialiasProgressImage:o}=z(lue),{handlePrevImage:s,handleNextImage:i,isOnLastImage:c,handleLoadMoreImages:f,areMoreImagesAvailable:p,isFetching:h}=zM();St("left",()=>{s()},[s]),St("right",()=>{if(c&&p&&!h){f();return}c||i()},[c,p,f,h,i]);const{currentData:m}=qo(t??Yo.skipToken),v=u.useMemo(()=>{if(m)return{id:"current-image",payloadType:"IMAGE_DTO",payload:{imageDTO:m}}},[m]),b=u.useMemo(()=>({id:"current-image",actionType:"SET_CURRENT_IMAGE"}),[]),[y,x]=u.useState(!1),C=u.useRef(0),k=u.useCallback(()=>{x(!0),window.clearTimeout(C.current)},[]),j=u.useCallback(()=>{C.current=window.setTimeout(()=>{x(!1)},500)},[]);return a.jsxs($,{onMouseOver:k,onMouseOut:j,sx:{width:"full",height:"full",alignItems:"center",justifyContent:"center",position:"relative"},children:[n&&r?a.jsx(Vl,{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(ii,{imageDTO:m,droppableData:b,draggableData:v,isUploadDisabled:!0,fitContainer:!0,useThumbailFallback:!0,dropLabel:"Set as Current Image",noContentFallback:a.jsx(lo,{icon:Fl,label:"No image selected"})}),e&&m&&a.jsx(Fe,{sx:{position:"absolute",top:"0",width:"full",height:"full",borderRadius:"base"},children:a.jsx(aue,{image:m})}),a.jsx(co,{children:!e&&m&&y&&a.jsx(yr.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(BM,{})},"nextPrevButtons")})]})},uue=u.memo(cue),due=()=>a.jsxs($,{sx:{position:"relative",flexDirection:"column",height:"100%",width:"100%",rowGap:4,alignItems:"center",justifyContent:"center"},children:[a.jsx(Zce,{}),a.jsx(uue,{})]}),fue=u.memo(due),pue=()=>a.jsx(Fe,{layerStyle:"first",sx:{position:"relative",width:"100%",height:"100%",p:2,borderRadius:"base"},children:a.jsx($,{sx:{width:"100%",height:"100%"},children:a.jsx(fue,{})})}),HM=u.memo(pue),hue=()=>{const e=u.useRef(null),t=u.useCallback(()=>{e.current&&e.current.setLayout([50,50])},[]),n=e2();return a.jsx(Fe,{sx:{w:"full",h:"full"},children:a.jsxs(Xg,{ref:e,autoSaveId:"imageTab.content",direction:"horizontal",style:{height:"100%",width:"100%"},storage:n,units:"percentages",children:[a.jsx(Wi,{id:"imageTab.content.initImage",order:0,defaultSize:50,minSize:25,style:{position:"relative"},children:a.jsx(Vce,{})}),a.jsx(Am,{onDoubleClick:t}),a.jsx(Wi,{id:"imageTab.content.selectedImage",order:1,defaultSize:50,minSize:25,children:a.jsx(HM,{})})]})})},mue=u.memo(hue);var gue=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 Qj=Cu(gue);function zb(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 vue=Object.defineProperty,Yj=Object.getOwnPropertySymbols,bue=Object.prototype.hasOwnProperty,xue=Object.prototype.propertyIsEnumerable,Jj=(e,t,n)=>t in e?vue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yue=(e,t)=>{for(var n in t||(t={}))bue.call(t,n)&&Jj(e,n,t[n]);if(Yj)for(var n of Yj(t))xue.call(t,n)&&Jj(e,n,t[n]);return e};function WM(e,t){if(t===null||typeof t!="object")return{};const n=yue({},t);return Object.keys(t).forEach(r=>{r.includes(`${String(e)}.`)&&delete n[r]}),n}const wue="__MANTINE_FORM_INDEX__";function Zj(e,t){return t?typeof t=="boolean"?t:Array.isArray(t)?t.includes(e.replace(/[.][0-9]/g,`.${wue}`)):!1:!1}function e_(e,t,n){typeof n.value=="object"&&(n.value=Lc(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||t==="__proto__"?Object.defineProperty(e,t,n):e[t]=n.value}function Lc(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(Lc(i))})):s==="[object Map]"?(o=new Map,e.forEach(function(i,c){o.set(Lc(c),Lc(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(Lc(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++)e_(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]||e_(o,n,Object.getOwnPropertyDescriptor(e,n))}return o||e}function VM(e){return typeof e!="string"?[]:e.split(".")}function n0(e,t,n){const r=VM(e);if(r.length===0)return n;const o=Lc(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 Xa(e,t){const n=VM(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 t_(e){const t=zb(e);return{hasErrors:Object.keys(t).length>0,errors:t}}function Bb(e,t,n="",r={}){return typeof e!="object"||e===null?r:Object.keys(e).reduce((o,s)=>{const i=e[s],c=`${n===""?"":`${n}.`}${s}`,f=Xa(c,t);let p=!1;return typeof i=="function"&&(o[c]=i(f,t,c)),typeof i=="object"&&Array.isArray(f)&&(p=!0,f.forEach((h,m)=>Bb(i,t,`${c}.${m}`,o))),typeof i=="object"&&typeof f=="object"&&f!==null&&(p||Bb(i,t,c,o)),o},r)}function Hb(e,t){return t_(typeof e=="function"?e(t):Bb(e,t))}function rh(e,t,n){if(typeof e!="string")return{hasError:!1,error:null};const r=Hb(t,n),o=Object.keys(r.errors).find(s=>e.split(".").every((i,c)=>i===s.split(".")[c]));return{hasError:!!o,error:o?r.errors[o]:null}}function Cue(e,{from:t,to:n},r){const o=Xa(e,r);if(!Array.isArray(o))return r;const s=[...o],i=o[t];return s.splice(t,1),s.splice(n,0,i),n0(e,s,r)}var Sue=Object.defineProperty,n_=Object.getOwnPropertySymbols,kue=Object.prototype.hasOwnProperty,jue=Object.prototype.propertyIsEnumerable,r_=(e,t,n)=>t in e?Sue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_ue=(e,t)=>{for(var n in t||(t={}))kue.call(t,n)&&r_(e,n,t[n]);if(n_)for(var n of n_(t))jue.call(t,n)&&r_(e,n,t[n]);return e};function Pue(e,{from:t,to:n},r){const o=`${e}.${t}`,s=`${e}.${n}`,i=_ue({},r);return Object.keys(r).every(c=>{let f,p;if(c.startsWith(o)&&(f=c,p=c.replace(o,s)),c.startsWith(s)&&(f=c.replace(s,o),p=c),f&&p){const h=i[f],m=i[p];return m===void 0?delete i[f]:i[f]=m,h===void 0?delete i[p]:i[p]=h,!1}return!0}),i}function Iue(e,t,n){const r=Xa(e,n);return Array.isArray(r)?n0(e,r.filter((o,s)=>s!==t),n):n}var Eue=Object.defineProperty,o_=Object.getOwnPropertySymbols,Oue=Object.prototype.hasOwnProperty,Mue=Object.prototype.propertyIsEnumerable,s_=(e,t,n)=>t in e?Eue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Rue=(e,t)=>{for(var n in t||(t={}))Oue.call(t,n)&&s_(e,n,t[n]);if(o_)for(var n of o_(t))Mue.call(t,n)&&s_(e,n,t[n]);return e};function a_(e,t){const n=e.substring(t.length+1).split(".")[0];return parseInt(n,10)}function i_(e,t,n,r){if(t===void 0)return n;const o=`${String(e)}`;let s=n;r===-1&&(s=WM(`${o}.${t}`,s));const i=Rue({},s),c=new Set;return Object.entries(s).filter(([f])=>{if(!f.startsWith(`${o}.`))return!1;const p=a_(f,o);return Number.isNaN(p)?!1:p>=t}).forEach(([f,p])=>{const h=a_(f,o),m=f.replace(`${o}.${h}`,`${o}.${h+r}`);i[m]=p,c.add(m),c.has(f)||delete i[f]}),i}function Due(e,t,n,r){const o=Xa(e,r);if(!Array.isArray(o))return r;const s=[...o];return s.splice(typeof n=="number"?n:s.length,0,t),n0(e,s,r)}function l_(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 Aue(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 Nue=Object.defineProperty,Tue=Object.defineProperties,$ue=Object.getOwnPropertyDescriptors,c_=Object.getOwnPropertySymbols,Lue=Object.prototype.hasOwnProperty,Fue=Object.prototype.propertyIsEnumerable,u_=(e,t,n)=>t in e?Nue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ii=(e,t)=>{for(var n in t||(t={}))Lue.call(t,n)&&u_(e,n,t[n]);if(c_)for(var n of c_(t))Fue.call(t,n)&&u_(e,n,t[n]);return e},d1=(e,t)=>Tue(e,$ue(t));function ec({initialValues:e={},initialErrors:t={},initialDirty:n={},initialTouched:r={},clearInputErrorOnChange:o=!0,validateInputOnChange:s=!1,validateInputOnBlur:i=!1,transformValues:c=p=>p,validate:f}={}){const[p,h]=u.useState(r),[m,v]=u.useState(n),[b,y]=u.useState(e),[x,C]=u.useState(zb(t)),k=u.useRef(e),j=U=>{k.current=U},_=u.useCallback(()=>h({}),[]),I=U=>{const W=U?Ii(Ii({},b),U):b;j(W),v({})},O=u.useCallback(U=>C(W=>zb(typeof U=="function"?U(W):U)),[]),E=u.useCallback(()=>C({}),[]),M=u.useCallback(()=>{y(e),E(),j(e),v({}),_()},[]),R=u.useCallback((U,W)=>O(ne=>d1(Ii({},ne),{[U]:W})),[]),A=u.useCallback(U=>O(W=>{if(typeof U!="string")return W;const ne=Ii({},W);return delete ne[U],ne}),[]),D=u.useCallback(U=>v(W=>{if(typeof U!="string")return W;const ne=WM(U,W);return delete ne[U],ne}),[]),T=u.useCallback((U,W)=>{const ne=Zj(U,s);D(U),h(ie=>d1(Ii({},ie),{[U]:!0})),y(ie=>{const oe=n0(U,W,ie);if(ne){const me=rh(U,f,oe);me.hasError?R(U,me.error):A(U)}return oe}),!ne&&o&&R(U,null)},[]),K=u.useCallback(U=>{y(W=>{const ne=typeof U=="function"?U(W):U;return Ii(Ii({},W),ne)}),o&&E()},[]),B=u.useCallback((U,W)=>{D(U),y(ne=>Cue(U,W,ne)),C(ne=>Pue(U,W,ne))},[]),G=u.useCallback((U,W)=>{D(U),y(ne=>Iue(U,W,ne)),C(ne=>i_(U,W,ne,-1))},[]),Q=u.useCallback((U,W,ne)=>{D(U),y(ie=>Due(U,W,ne,ie)),C(ie=>i_(U,ne,ie,1))},[]),V=u.useCallback(()=>{const U=Hb(f,b);return C(U.errors),U},[b,f]),L=u.useCallback(U=>{const W=rh(U,f,b);return W.hasError?R(U,W.error):A(U),W},[b,f]),X=(U,{type:W="input",withError:ne=!0,withFocus:ie=!0}={})=>{const me={onChange:Aue(fe=>T(U,fe))};return ne&&(me.error=x[U]),W==="checkbox"?me.checked=Xa(U,b):me.value=Xa(U,b),ie&&(me.onFocus=()=>h(fe=>d1(Ii({},fe),{[U]:!0})),me.onBlur=()=>{if(Zj(U,i)){const fe=rh(U,f,b);fe.hasError?R(U,fe.error):A(U)}}),me},F=(U,W)=>ne=>{ne==null||ne.preventDefault();const ie=V();ie.hasErrors?W==null||W(ie.errors,b,ne):U==null||U(c(b),ne)},q=U=>c(U||b),te=u.useCallback(U=>{U.preventDefault(),M()},[]),Y=U=>{if(U){const ne=Xa(U,m);if(typeof ne=="boolean")return ne;const ie=Xa(U,b),oe=Xa(U,k.current);return!Qj(ie,oe)}return Object.keys(m).length>0?l_(m):!Qj(b,k.current)},ce=u.useCallback(U=>l_(p,U),[p]),ae=u.useCallback(U=>U?!rh(U,f,b).hasError:!Hb(f,b).hasErrors,[b,f]);return{values:b,errors:x,setValues:K,setErrors:O,setFieldValue:T,setFieldError:R,clearFieldError:A,clearErrors:E,reset:M,validate:V,validateField:L,reorderListItem:B,removeListItem:G,insertListItem:Q,getInputProps:X,onSubmit:F,onReset:te,isDirty:Y,isTouched:ce,setTouched:h,setDirty:v,resetTouched:_,resetDirty:I,isValid:ae,getTransformedValues:q}}function br(e){const{...t}=e,{base50:n,base100:r,base200:o,base300:s,base800:i,base700:c,base900:f,accent500:p,accent300:h}=Ef(),{colorMode:m}=di();return a.jsx(jE,{styles:()=>({input:{color:qe(f,r)(m),backgroundColor:qe(n,f)(m),borderColor:qe(o,i)(m),borderWidth:2,outline:"none",":focus":{borderColor:qe(h,p)(m)}},label:{color:qe(c,s)(m),fontWeight:"normal",marginBottom:4}}),...t})}const zue=[{value:"sd-1",label:xr["sd-1"]},{value:"sd-2",label:xr["sd-2"]},{value:"sdxl",label:xr.sdxl},{value:"sdxl-refiner",label:xr["sdxl-refiner"]}];function Nf(e){const{...t}=e,{t:n}=Ie();return a.jsx(Zr,{label:n("modelManager.baseModel"),data:zue,...t})}function UM(e){const{data:t}=p3(),{...n}=e;return a.jsx(Zr,{label:"Config File",placeholder:"Select A Config File",data:t||[],...n})}const Bue=[{value:"normal",label:"Normal"},{value:"inpaint",label:"Inpaint"},{value:"depth",label:"Depth"}];function r0(e){const{...t}=e,{t:n}=Ie();return a.jsx(Zr,{label:n("modelManager.variant"),data:Bue,...t})}function GM(e){var p;const{t}=Ie(),n=se(),{model_path:r}=e,o=ec({initialValues:{model_name:((p=r==null?void 0:r.split("\\").splice(-1)[0])==null?void 0:p.split(".")[0])??"",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]=h3(),[i,c]=u.useState(!1),f=h=>{s({body:h}).unwrap().then(m=>{n(Cn(_n({title:`Model Added: ${h.model_name}`,status:"success"}))),o.reset(),r&&n(cf(null))}).catch(m=>{m&&n(Cn(_n({title:"Model Add Failed",status:"error"})))})};return a.jsx("form",{onSubmit:o.onSubmit(h=>f(h)),style:{width:"100%"},children:a.jsxs($,{flexDirection:"column",gap:2,children:[a.jsx(br,{label:"Model Name",required:!0,...o.getInputProps("model_name")}),a.jsx(Nf,{...o.getInputProps("base_model")}),a.jsx(br,{label:"Model Location",required:!0,...o.getInputProps("path")}),a.jsx(br,{label:"Description",...o.getInputProps("description")}),a.jsx(br,{label:"VAE Location",...o.getInputProps("vae")}),a.jsx(r0,{...o.getInputProps("variant")}),a.jsxs($,{flexDirection:"column",width:"100%",gap:2,children:[i?a.jsx(br,{required:!0,label:"Custom Config File Location",...o.getInputProps("config")}):a.jsx(UM,{required:!0,width:"100%",...o.getInputProps("config")}),a.jsx(bo,{isChecked:i,onChange:()=>c(!i),label:"Use Custom Config"}),a.jsx(Wt,{mt:2,type:"submit",children:t("modelManager.addModel")})]})]})})}function qM(e){const{t}=Ie(),n=se(),{model_path:r}=e,[o]=h3(),s=ec({initialValues:{model_name:(r==null?void 0:r.split("\\").splice(-1)[0])??"",base_model:"sd-1",model_type:"main",path:r||"",description:"",model_format:"diffusers",error:void 0,vae:"",variant:"normal"}}),i=c=>{o({body:c}).unwrap().then(f=>{n(Cn(_n({title:`Model Added: ${c.model_name}`,status:"success"}))),s.reset(),r&&n(cf(null))}).catch(f=>{f&&n(Cn(_n({title:"Model Add Failed",status:"error"})))})};return a.jsx("form",{onSubmit:s.onSubmit(c=>i(c)),style:{width:"100%"},children:a.jsxs($,{flexDirection:"column",gap:2,children:[a.jsx(br,{required:!0,label:"Model Name",...s.getInputProps("model_name")}),a.jsx(Nf,{...s.getInputProps("base_model")}),a.jsx(br,{required:!0,label:"Model Location",placeholder:"Provide the path to a local folder where your Diffusers Model is stored",...s.getInputProps("path")}),a.jsx(br,{label:"Description",...s.getInputProps("description")}),a.jsx(br,{label:"VAE Location",...s.getInputProps("vae")}),a.jsx(r0,{...s.getInputProps("variant")}),a.jsx(Wt,{mt:2,type:"submit",children:t("modelManager.addModel")})]})})}const KM=[{label:"Diffusers",value:"diffusers"},{label:"Checkpoint / Safetensors",value:"checkpoint"}];function Hue(){const[e,t]=u.useState("diffusers");return a.jsxs($,{flexDirection:"column",gap:4,width:"100%",children:[a.jsx(Zr,{label:"Model Type",value:e,data:KM,onChange:n=>{n&&t(n)}}),a.jsxs($,{sx:{p:4,borderRadius:4,bg:"base.300",_dark:{bg:"base.850"}},children:[e==="diffusers"&&a.jsx(qM,{}),e==="checkpoint"&&a.jsx(GM,{})]})]})}const Wue=[{label:"None",value:"none"},{label:"v_prediction",value:"v_prediction"},{label:"epsilon",value:"epsilon"},{label:"sample",value:"sample"}];function Vue(){const e=se(),{t}=Ie(),n=z(c=>c.system.isProcessing),[r,{isLoading:o}]=m3(),s=ec({initialValues:{location:"",prediction_type:void 0}}),i=c=>{const f={location:c.location,prediction_type:c.prediction_type==="none"?void 0:c.prediction_type};r({body:f}).unwrap().then(p=>{e(Cn(_n({title:"Model Added",status:"success"}))),s.reset()}).catch(p=>{p&&(console.log(p),e(Cn(_n({title:`${p.data.detail} `,status:"error"}))))})};return a.jsx("form",{onSubmit:s.onSubmit(c=>i(c)),style:{width:"100%"},children:a.jsxs($,{flexDirection:"column",width:"100%",gap:4,children:[a.jsx(br,{label:"Model Location",placeholder:"Provide a path to a local Diffusers model, local checkpoint / safetensors model a HuggingFace Repo ID, or a checkpoint/diffusers model URL.",w:"100%",...s.getInputProps("location")}),a.jsx(Zr,{label:"Prediction Type (for Stable Diffusion 2.x Models only)",data:Wue,defaultValue:"none",...s.getInputProps("prediction_type")}),a.jsx(Wt,{type:"submit",isLoading:o,isDisabled:o||n,children:t("modelManager.addModel")})]})})}function Uue(){const[e,t]=u.useState("simple");return a.jsxs($,{flexDirection:"column",width:"100%",overflow:"scroll",maxHeight:window.innerHeight-250,gap:4,children:[a.jsxs(vr,{isAttached:!0,children:[a.jsx(Wt,{size:"sm",isChecked:e=="simple",onClick:()=>t("simple"),children:"Simple"}),a.jsx(Wt,{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(Vue,{}),e==="advanced"&&a.jsx(Hue,{})]})]})}function Gue(e){const{...t}=e;return a.jsx(b6,{w:"100%",...t,children:e.children})}function que(){const e=z(x=>x.modelmanager.searchFolder),[t,n]=u.useState(""),{data:r}=Gs(vl),{foundModels:o,alreadyInstalled:s,filteredModels:i}=g3({search_path:e||""},{selectFromResult:({data:x})=>{const C=g9(r==null?void 0:r.entities),k=uo(C,"path"),j=h9(x,k),_=w9(x,k);return{foundModels:x,alreadyInstalled:d_(_,t),filteredModels:d_(j,t)}}}),[c,{isLoading:f}]=m3(),p=se(),{t:h}=Ie(),m=u.useCallback(x=>{const C=x.currentTarget.id.split("\\").splice(-1)[0];c({body:{location:x.currentTarget.id}}).unwrap().then(k=>{p(Cn(_n({title:`Added Model: ${C}`,status:"success"})))}).catch(k=>{k&&p(Cn(_n({title:"Failed To Add Model",status:"error"})))})},[p,c]),v=u.useCallback(x=>{n(x.target.value)},[]),b=({models:x,showActions:C=!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(Ee,{sx:{fontWeight:600},children:k.split("\\").slice(-1)[0]}),a.jsx(Ee,{sx:{fontSize:"sm",color:"base.600",_dark:{color:"base.400"}},children:k})]}),C?a.jsxs($,{gap:2,children:[a.jsx(Wt,{id:k,onClick:m,isLoading:f,children:"Quick Add"}),a.jsx(Wt,{onClick:()=>p(cf(k)),isLoading:f,children:"Advanced"})]}):a.jsx(Ee,{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(Ee,{variant:"subtext",children:"No Models Found"})}):a.jsxs($,{sx:{flexDirection:"column",gap:2,w:"100%",minW:"50%"},children:[a.jsx(hs,{onChange:v,label:h("modelManager.search"),labelPos:"side"}),a.jsxs($,{p:2,gap:2,children:[a.jsxs(Ee,{sx:{fontWeight:600},children:["Models Found: ",o.length]}),a.jsxs(Ee,{sx:{fontWeight:600,color:"accent.500",_dark:{color:"accent.200"}},children:["Not Installed: ",i.length]})]}),a.jsx(Gue,{offsetScrollbars:!0,children:a.jsxs($,{gap:2,flexDirection:"column",children:[b({models:i}),b({models:s,showActions:!1})]})})]}):null)()}const d_=(e,t)=>{const n=[];return Wr(e,r=>{if(!r)return null;r.includes(t)&&n.push(r)}),n};function Kue(){const e=z(i=>i.modelmanager.advancedAddScanModel),[t,n]=u.useState("diffusers"),[r,o]=u.useState(!0);u.useEffect(()=>{e&&[".ckpt",".safetensors",".pth",".pt"].some(i=>e.endsWith(i))?n("checkpoint"):n("diffusers")},[e,n,r]);const s=se();return e?a.jsxs(Fe,{as:yr.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(Ee,{size:"xl",fontWeight:600,children:r||t==="checkpoint"?"Add Checkpoint Model":"Add Diffusers Model"}),a.jsx(tt,{icon:a.jsx(NJ,{}),"aria-label":"Close Advanced",onClick:()=>s(cf(null)),size:"sm"})]}),a.jsx(Zr,{label:"Model Type",value:t,data:KM,onChange:i=>{i&&(n(i),o(i==="checkpoint"))}}),r?a.jsx(GM,{model_path:e},e):a.jsx(qM,{model_path:e},e)]}):null}function Xue(){const e=se(),{t}=Ie(),n=z(c=>c.modelmanager.searchFolder),{refetch:r}=g3({search_path:n||""}),o=ec({initialValues:{folder:""}}),s=u.useCallback(c=>{e(_C(c.folder))},[e]),i=()=>{r()};return a.jsx("form",{onSubmit:o.onSubmit(c=>s(c)),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(Ee,{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(hs,{w:"100%",size:"md",...o.getInputProps("folder")})]}),a.jsxs($,{gap:2,children:[n?a.jsx(tt,{"aria-label":t("modelManager.scanAgain"),tooltip:t("modelManager.scanAgain"),icon:a.jsx(GE,{}),onClick:i,fontSize:18,size:"sm"}):a.jsx(tt,{"aria-label":t("modelManager.findModels"),tooltip:t("modelManager.findModels"),icon:a.jsx(MJ,{}),fontSize:18,size:"sm",type:"submit"}),a.jsx(tt,{"aria-label":t("modelManager.clearCheckpointFolder"),tooltip:t("modelManager.clearCheckpointFolder"),icon:a.jsx(Jo,{}),size:"sm",onClick:()=>{e(_C(null)),e(cf(null))},isDisabled:!n,colorScheme:"red"})]})]})})}const Que=u.memo(Xue);function Yue(){return a.jsxs($,{flexDirection:"column",w:"100%",gap:4,children:[a.jsx(Que,{}),a.jsxs($,{gap:4,children:[a.jsx($,{sx:{maxHeight:window.innerHeight-300,overflow:"scroll",gap:4,w:"100%"},children:a.jsx(que,{})}),a.jsx(Kue,{})]})]})}function Jue(){const[e,t]=u.useState("add"),{t:n}=Ie();return a.jsxs($,{flexDirection:"column",gap:4,children:[a.jsxs(vr,{isAttached:!0,children:[a.jsx(Wt,{onClick:()=>t("add"),isChecked:e=="add",size:"sm",width:"100%",children:n("modelManager.addModel")}),a.jsx(Wt,{onClick:()=>t("scan"),isChecked:e=="scan",size:"sm",width:"100%",children:n("modelManager.scanForModels")})]}),e=="add"&&a.jsx(Uue,{}),e=="scan"&&a.jsx(Yue,{})]})}const Zue=[{label:"Stable Diffusion 1",value:"sd-1"},{label:"Stable Diffusion 2",value:"sd-2"}];function ede(){var L,X;const{t:e}=Ie(),t=se(),{data:n}=Gs(vl),[r,{isLoading:o}]=sA(),[s,i]=u.useState("sd-1"),c=TC(n==null?void 0:n.entities,(F,q)=>(F==null?void 0:F.model_format)==="diffusers"&&(F==null?void 0:F.base_model)==="sd-1"),f=TC(n==null?void 0:n.entities,(F,q)=>(F==null?void 0:F.model_format)==="diffusers"&&(F==null?void 0:F.base_model)==="sd-2"),p=u.useMemo(()=>({"sd-1":c,"sd-2":f}),[c,f]),[h,m]=u.useState(((L=Object.keys(p[s]))==null?void 0:L[0])??null),[v,b]=u.useState(((X=Object.keys(p[s]))==null?void 0:X[1])??null),[y,x]=u.useState(null),[C,k]=u.useState(""),[j,_]=u.useState(.5),[I,O]=u.useState("weighted_sum"),[E,M]=u.useState("root"),[R,A]=u.useState(""),[D,T]=u.useState(!1),K=Object.keys(p[s]).filter(F=>F!==v&&F!==y),B=Object.keys(p[s]).filter(F=>F!==h&&F!==y),G=Object.keys(p[s]).filter(F=>F!==h&&F!==v),Q=F=>{i(F),m(null),b(null)},V=()=>{const F=[];let q=[h,v,y];q=q.filter(Y=>Y!==null),q.forEach(Y=>{var ae;const ce=(ae=Y==null?void 0:Y.split("/"))==null?void 0:ae[2];ce&&F.push(ce)});const te={model_names:F,merged_model_name:C!==""?C:F.join("-"),alpha:j,interp:I,force:D,merge_dest_directory:E==="root"?void 0:R};r({base_model:s,body:te}).unwrap().then(Y=>{t(Cn(_n({title:e("modelManager.modelsMerged"),status:"success"})))}).catch(Y=>{Y&&t(Cn(_n({title:e("modelManager.modelsMergeFailed"),status:"error"})))})};return a.jsxs($,{flexDirection:"column",rowGap:4,children:[a.jsxs($,{sx:{flexDirection:"column",rowGap:1},children:[a.jsx(Ee,{children:e("modelManager.modelMergeHeaderHelp1")}),a.jsx(Ee,{fontSize:"sm",variant:"subtext",children:e("modelManager.modelMergeHeaderHelp2")})]}),a.jsxs($,{columnGap:4,children:[a.jsx(Zr,{label:"Model Type",w:"100%",data:Zue,value:s,onChange:Q}),a.jsx(Kn,{label:e("modelManager.modelOne"),w:"100%",value:h,placeholder:e("modelManager.selectModel"),data:K,onChange:F=>m(F)}),a.jsx(Kn,{label:e("modelManager.modelTwo"),w:"100%",placeholder:e("modelManager.selectModel"),value:v,data:B,onChange:F=>b(F)}),a.jsx(Kn,{label:e("modelManager.modelThree"),data:G,w:"100%",placeholder:e("modelManager.selectModel"),clearable:!0,onChange:F=>{F?(x(F),O("weighted_sum")):(x(null),O("add_difference"))}})]}),a.jsx(hs,{label:e("modelManager.mergedModelName"),value:C,onChange:F=>k(F.target.value)}),a.jsxs($,{sx:{flexDirection:"column",padding:4,borderRadius:"base",gap:4,bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsx(jt,{label:e("modelManager.alpha"),min:.01,max:.99,step:.01,value:j,onChange:F=>_(F),withInput:!0,withReset:!0,handleReset:()=>_(.5),withSliderMarks:!0}),a.jsx(Ee,{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(Ee,{fontWeight:500,fontSize:"sm",variant:"subtext",children:e("modelManager.interpolationType")}),a.jsx(Ah,{value:I,onChange:F=>O(F),children:a.jsx($,{columnGap:4,children:y===null?a.jsxs(a.Fragment,{children:[a.jsx(Va,{value:"weighted_sum",children:a.jsx(Ee,{fontSize:"sm",children:e("modelManager.weightedSum")})}),a.jsx(Va,{value:"sigmoid",children:a.jsx(Ee,{fontSize:"sm",children:e("modelManager.sigmoid")})}),a.jsx(Va,{value:"inv_sigmoid",children:a.jsx(Ee,{fontSize:"sm",children:e("modelManager.inverseSigmoid")})})]}):a.jsx(Va,{value:"add_difference",children:a.jsx(Mn,{label:e("modelManager.modelMergeInterpAddDifferenceHelp"),children:a.jsx(Ee,{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(Ee,{fontWeight:"500",fontSize:"sm",variant:"subtext",children:e("modelManager.mergedModelSaveLocation")}),a.jsx(Ah,{value:E,onChange:F=>M(F),children:a.jsxs($,{columnGap:4,children:[a.jsx(Va,{value:"root",children:a.jsx(Ee,{fontSize:"sm",children:e("modelManager.invokeAIFolder")})}),a.jsx(Va,{value:"custom",children:a.jsx(Ee,{fontSize:"sm",children:e("modelManager.custom")})})]})})]}),E==="custom"&&a.jsx(hs,{label:e("modelManager.mergedModelCustomSaveLocation"),value:R,onChange:F=>A(F.target.value)})]}),a.jsx(bo,{label:e("modelManager.ignoreMismatch"),isChecked:D,onChange:F=>T(F.target.checked),fontWeight:"500"}),a.jsx(Wt,{onClick:V,isLoading:o,isDisabled:h===null||v===null,children:e("modelManager.merge")})]})}const tde=Te((e,t)=>{const{t:n}=Ie(),{acceptButtonText:r=n("common.accept"),acceptCallback:o,cancelButtonText:s=n("common.cancel"),cancelCallback:i,children:c,title:f,triggerComponent:p}=e,{isOpen:h,onOpen:m,onClose:v}=Ao(),b=u.useRef(null),y=()=>{o(),v()},x=()=>{i&&i(),v()};return a.jsxs(a.Fragment,{children:[u.cloneElement(p,{onClick:m,ref:t}),a.jsx(Cf,{isOpen:h,leastDestructiveRef:b,onClose:v,isCentered:!0,children:a.jsx(Ks,{children:a.jsxs(Sf,{children:[a.jsx(qs,{fontSize:"lg",fontWeight:"bold",children:f}),a.jsx(Xs,{children:c}),a.jsxs(ka,{children:[a.jsx(Wt,{ref:b,onClick:x,children:s}),a.jsx(Wt,{colorScheme:"error",onClick:y,ml:3,children:r})]})]})})})]})}),d2=u.memo(tde);function nde(e){const{model:t}=e,n=se(),{t:r}=Ie(),[o,{isLoading:s}]=aA(),[i,c]=u.useState("InvokeAIRoot"),[f,p]=u.useState("");u.useEffect(()=>{c("InvokeAIRoot")},[t]);const h=()=>{c("InvokeAIRoot")},m=()=>{const v={base_model:t.base_model,model_name:t.model_name,convert_dest_directory:i==="Custom"?f:void 0};if(i==="Custom"&&f===""){n(Cn(_n({title:r("modelManager.noCustomLocationProvided"),status:"error"})));return}n(Cn(_n({title:`${r("modelManager.convertingModelBegin")}: ${t.model_name}`,status:"info"}))),o(v).unwrap().then(()=>{n(Cn(_n({title:`${r("modelManager.modelConverted")}: ${t.model_name}`,status:"success"})))}).catch(()=>{n(Cn(_n({title:`${r("modelManager.modelConversionFailed")}: ${t.model_name}`,status:"error"})))})};return a.jsxs(d2,{title:`${r("modelManager.convert")} ${t.model_name}`,acceptCallback:m,cancelCallback:h,acceptButtonText:`${r("modelManager.convert")}`,triggerComponent:a.jsxs(Wt,{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(Ee,{children:r("modelManager.convertToDiffusersHelpText1")}),a.jsxs(gf,{children:[a.jsx(Fs,{children:r("modelManager.convertToDiffusersHelpText2")}),a.jsx(Fs,{children:r("modelManager.convertToDiffusersHelpText3")}),a.jsx(Fs,{children:r("modelManager.convertToDiffusersHelpText4")}),a.jsx(Fs,{children:r("modelManager.convertToDiffusersHelpText5")})]}),a.jsx(Ee,{children:r("modelManager.convertToDiffusersHelpText6")})]}),a.jsxs($,{flexDir:"column",gap:2,children:[a.jsxs($,{marginTop:4,flexDir:"column",gap:2,children:[a.jsx(Ee,{fontWeight:"600",children:r("modelManager.convertToDiffusersSaveLocation")}),a.jsx(Ah,{value:i,onChange:v=>c(v),children:a.jsxs($,{gap:4,children:[a.jsx(Va,{value:"InvokeAIRoot",children:a.jsx(Mn,{label:"Save converted model in the InvokeAI root folder",children:r("modelManager.invokeRoot")})}),a.jsx(Va,{value:"Custom",children:a.jsx(Mn,{label:"Save converted model in a custom folder",children:r("modelManager.custom")})})]})})]}),i==="Custom"&&a.jsxs($,{flexDirection:"column",rowGap:2,children:[a.jsx(Ee,{fontWeight:"500",fontSize:"sm",variant:"subtext",children:r("modelManager.customSaveLocation")}),a.jsx(hs,{value:f,onChange:v=>{p(v.target.value)},width:"full"})]})]})]})}function rde(e){const t=z(Or),{model:n}=e,[r,{isLoading:o}]=v3(),{data:s}=p3(),[i,c]=u.useState(!1);u.useEffect(()=>{s!=null&&s.includes(n.config)||c(!0)},[s,n.config]);const f=se(),{t:p}=Ie(),h=ec({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=u.useCallback(v=>{const b={base_model:n.base_model,model_name:n.model_name,body:v};r(b).unwrap().then(y=>{h.setValues(y),f(Cn(_n({title:p("modelManager.modelUpdated"),status:"success"})))}).catch(y=>{h.reset(),f(Cn(_n({title:p("modelManager.modelUpdateFailed"),status:"error"})))})},[h,f,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(Ee,{fontSize:"lg",fontWeight:"bold",children:n.model_name}),a.jsxs(Ee,{fontSize:"sm",color:"base.400",children:[xr[n.base_model]," Model"]})]}),[""].includes(n.base_model)?a.jsx(hi,{sx:{p:2,borderRadius:4,bg:"error.200",_dark:{bg:"error.400"}},children:"Conversion Not Supported"}):a.jsx(nde,{model:n})]}),a.jsx(Ko,{}),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(br,{label:p("modelManager.name"),...h.getInputProps("model_name")}),a.jsx(br,{label:p("modelManager.description"),...h.getInputProps("description")}),a.jsx(Nf,{required:!0,...h.getInputProps("base_model")}),a.jsx(r0,{required:!0,...h.getInputProps("variant")}),a.jsx(br,{required:!0,label:p("modelManager.modelLocation"),...h.getInputProps("path")}),a.jsx(br,{label:p("modelManager.vaeLocation"),...h.getInputProps("vae")}),a.jsxs($,{flexDirection:"column",gap:2,children:[i?a.jsx(br,{required:!0,label:p("modelManager.config"),...h.getInputProps("config")}):a.jsx(UM,{required:!0,...h.getInputProps("config")}),a.jsx(bo,{isChecked:i,onChange:()=>c(!i),label:"Use Custom Config"})]}),a.jsx(Wt,{type:"submit",isDisabled:t||o,isLoading:o,children:p("modelManager.updateModel")})]})})})]})}function ode(e){const t=z(Or),{model:n}=e,[r,{isLoading:o}]=v3(),s=se(),{t:i}=Ie(),c=ec({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}}),f=u.useCallback(p=>{const h={base_model:n.base_model,model_name:n.model_name,body:p};r(h).unwrap().then(m=>{c.setValues(m),s(Cn(_n({title:i("modelManager.modelUpdated"),status:"success"})))}).catch(m=>{c.reset(),s(Cn(_n({title:i("modelManager.modelUpdateFailed"),status:"error"})))})},[c,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(Ee,{fontSize:"lg",fontWeight:"bold",children:n.model_name}),a.jsxs(Ee,{fontSize:"sm",color:"base.400",children:[xr[n.base_model]," Model"]})]}),a.jsx(Ko,{}),a.jsx("form",{onSubmit:c.onSubmit(p=>f(p)),children:a.jsxs($,{flexDirection:"column",overflowY:"scroll",gap:4,children:[a.jsx(br,{label:i("modelManager.name"),...c.getInputProps("model_name")}),a.jsx(br,{label:i("modelManager.description"),...c.getInputProps("description")}),a.jsx(Nf,{required:!0,...c.getInputProps("base_model")}),a.jsx(r0,{required:!0,...c.getInputProps("variant")}),a.jsx(br,{required:!0,label:i("modelManager.modelLocation"),...c.getInputProps("path")}),a.jsx(br,{label:i("modelManager.vaeLocation"),...c.getInputProps("vae")}),a.jsx(Wt,{type:"submit",isDisabled:t||o,isLoading:o,children:i("modelManager.updateModel")})]})})]})}function sde(e){const t=z(Or),{model:n}=e,[r,{isLoading:o}]=iA(),s=se(),{t:i}=Ie(),c=ec({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}}),f=u.useCallback(p=>{const h={base_model:n.base_model,model_name:n.model_name,body:p};r(h).unwrap().then(m=>{c.setValues(m),s(Cn(_n({title:i("modelManager.modelUpdated"),status:"success"})))}).catch(m=>{c.reset(),s(Cn(_n({title:i("modelManager.modelUpdateFailed"),status:"error"})))})},[s,c,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(Ee,{fontSize:"lg",fontWeight:"bold",children:n.model_name}),a.jsxs(Ee,{fontSize:"sm",color:"base.400",children:[xr[n.base_model]," Model ⋅"," ",lA[n.model_format]," format"]})]}),a.jsx(Ko,{}),a.jsx("form",{onSubmit:c.onSubmit(p=>f(p)),children:a.jsxs($,{flexDirection:"column",overflowY:"scroll",gap:4,children:[a.jsx(br,{label:i("modelManager.name"),...c.getInputProps("model_name")}),a.jsx(br,{label:i("modelManager.description"),...c.getInputProps("description")}),a.jsx(Nf,{...c.getInputProps("base_model")}),a.jsx(br,{label:i("modelManager.modelLocation"),...c.getInputProps("path")}),a.jsx(Wt,{type:"submit",isDisabled:t||o,isLoading:o,children:i("modelManager.updateModel")})]})})]})}function ade(e){const t=z(Or),{t:n}=Ie(),r=se(),[o]=cA(),[s]=uA(),{model:i,isSelected:c,setSelectedModelId:f}=e,p=u.useCallback(()=>{f(i.id)},[i.id,f]),h=u.useCallback(()=>{const m={main:o,lora:s,onnx:o}[i.model_type];m(i).unwrap().then(v=>{r(Cn(_n({title:`${n("modelManager.modelDeleted")}: ${i.model_name}`,status:"success"})))}).catch(v=>{v&&r(Cn(_n({title:`${n("modelManager.modelDeleteFailed")}: ${i.model_name}`,status:"error"})))}),f(void 0)},[o,s,i,f,r,n]);return a.jsxs($,{sx:{gap:2,alignItems:"center",w:"full"},children:[a.jsx($,{as:Wt,isChecked:c,sx:{justifyContent:"start",p:2,borderRadius:"base",w:"full",alignItems:"center",bg:c?"accent.400":"base.100",color:c?"base.50":"base.800",_hover:{bg:c?"accent.500":"base.300",color:c?"base.50":"base.800"},_dark:{color:c?"base.50":"base.100",bg:c?"accent.600":"base.850",_hover:{color:c?"base.50":"base.100",bg:c?"accent.550":"base.700"}}},onClick:p,children:a.jsxs($,{gap:4,alignItems:"center",children:[a.jsx(hi,{minWidth:14,p:.5,fontSize:"sm",variant:"solid",children:dA[i.base_model]}),a.jsx(Mn,{label:i.description,hasArrow:!0,placement:"bottom",children:a.jsx(Ee,{sx:{fontWeight:500},children:i.model_name})})]})}),a.jsx(d2,{title:n("modelManager.deleteModel"),acceptCallback:h,acceptButtonText:n("modelManager.delete"),triggerComponent:a.jsx(tt,{icon:a.jsx(zee,{}),"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 ide=e=>{const{selectedModelId:t,setSelectedModelId:n}=e,{t:r}=Ie(),[o,s]=u.useState(""),[i,c]=u.useState("all"),{filteredDiffusersModels:f,isLoadingDiffusersModels:p}=Gs(vl,{selectFromResult:({data:_,isLoading:I})=>({filteredDiffusersModels:pd(_,"main","diffusers",o),isLoadingDiffusersModels:I})}),{filteredCheckpointModels:h,isLoadingCheckpointModels:m}=Gs(vl,{selectFromResult:({data:_,isLoading:I})=>({filteredCheckpointModels:pd(_,"main","checkpoint",o),isLoadingCheckpointModels:I})}),{filteredLoraModels:v,isLoadingLoraModels:b}=Gm(void 0,{selectFromResult:({data:_,isLoading:I})=>({filteredLoraModels:pd(_,"lora",void 0,o),isLoadingLoraModels:I})}),{filteredOnnxModels:y,isLoadingOnnxModels:x}=Td(vl,{selectFromResult:({data:_,isLoading:I})=>({filteredOnnxModels:pd(_,"onnx","onnx",o),isLoadingOnnxModels:I})}),{filteredOliveModels:C,isLoadingOliveModels:k}=Td(vl,{selectFromResult:({data:_,isLoading:I})=>({filteredOliveModels:pd(_,"onnx","olive",o),isLoadingOliveModels:I})}),j=u.useCallback(_=>{s(_.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(vr,{isAttached:!0,children:[a.jsx(Wt,{onClick:()=>c("all"),isChecked:i==="all",size:"sm",children:r("modelManager.allModels")}),a.jsx(Wt,{size:"sm",onClick:()=>c("diffusers"),isChecked:i==="diffusers",children:r("modelManager.diffusersModels")}),a.jsx(Wt,{size:"sm",onClick:()=>c("checkpoint"),isChecked:i==="checkpoint",children:r("modelManager.checkpointModels")}),a.jsx(Wt,{size:"sm",onClick:()=>c("onnx"),isChecked:i==="onnx",children:r("modelManager.onnxModels")}),a.jsx(Wt,{size:"sm",onClick:()=>c("olive"),isChecked:i==="olive",children:r("modelManager.oliveModels")}),a.jsx(Wt,{size:"sm",onClick:()=>c("lora"),isChecked:i==="lora",children:r("modelManager.loraModels")})]}),a.jsx(hs,{onChange:j,label:r("modelManager.search"),labelPos:"side"}),a.jsxs($,{flexDirection:"column",gap:4,maxHeight:window.innerHeight-280,overflow:"scroll",children:[p&&a.jsx(Rc,{loadingMessage:"Loading Diffusers..."}),["all","diffusers"].includes(i)&&!p&&f.length>0&&a.jsx(Mc,{title:"Diffusers",modelList:f,selected:{selectedModelId:t,setSelectedModelId:n}},"diffusers"),m&&a.jsx(Rc,{loadingMessage:"Loading Checkpoints..."}),["all","checkpoint"].includes(i)&&!m&&h.length>0&&a.jsx(Mc,{title:"Checkpoints",modelList:h,selected:{selectedModelId:t,setSelectedModelId:n}},"checkpoints"),b&&a.jsx(Rc,{loadingMessage:"Loading LoRAs..."}),["all","lora"].includes(i)&&!b&&v.length>0&&a.jsx(Mc,{title:"LoRAs",modelList:v,selected:{selectedModelId:t,setSelectedModelId:n}},"loras"),k&&a.jsx(Rc,{loadingMessage:"Loading Olives..."}),["all","olive"].includes(i)&&!k&&C.length>0&&a.jsx(Mc,{title:"Olives",modelList:C,selected:{selectedModelId:t,setSelectedModelId:n}},"olive"),x&&a.jsx(Rc,{loadingMessage:"Loading ONNX..."}),["all","onnx"].includes(i)&&!x&&y.length>0&&a.jsx(Mc,{title:"ONNX",modelList:y,selected:{selectedModelId:t,setSelectedModelId:n}},"onnx")]})]})})},lde=u.memo(ide),pd=(e,t,n,r)=>{const o=[];return Wr(e==null?void 0:e.entities,s=>{if(!s)return;const i=s.model_name.toLowerCase().includes(r.toLowerCase()),c=n===void 0||s.model_format===n,f=s.model_type===t;i&&c&&f&&o.push(s)}),o},f2=u.memo(e=>a.jsx($,{flexDirection:"column",gap:4,borderRadius:4,p:4,sx:{bg:"base.200",_dark:{bg:"base.800"}},children:e.children}));f2.displayName="StyledModelContainer";const Mc=u.memo(e=>{const{title:t,modelList:n,selected:r}=e;return a.jsx(f2,{children:a.jsxs($,{sx:{gap:2,flexDir:"column"},children:[a.jsx(Ee,{variant:"subtext",fontSize:"sm",children:t}),n.map(o=>a.jsx(ade,{model:o,isSelected:r.selectedModelId===o.id,setSelectedModelId:r.setSelectedModelId},o.id))]})})});Mc.displayName="ModelListWrapper";const Rc=u.memo(({loadingMessage:e})=>a.jsx(f2,{children:a.jsxs($,{justifyContent:"center",alignItems:"center",flexDirection:"column",p:4,gap:8,children:[a.jsx(Wl,{}),a.jsx(Ee,{variant:"subtext",children:e||"Fetching..."})]})}));Rc.displayName="FetchingModelsLoader";function cde(){const[e,t]=u.useState(),{mainModel:n}=Gs(vl,{selectFromResult:({data:s})=>({mainModel:e?s==null?void 0:s.entities[e]:void 0})}),{loraModel:r}=Gm(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(lde,{selectedModelId:e,setSelectedModelId:t}),a.jsx(ude,{model:o})]})}const ude=e=>{const{model:t}=e;return(t==null?void 0:t.model_format)==="checkpoint"?a.jsx(rde,{model:t},t.id):(t==null?void 0:t.model_format)==="diffusers"?a.jsx(ode,{model:t},t.id):(t==null?void 0:t.model_type)==="lora"?a.jsx(sde,{model:t},t.id):a.jsx($,{sx:{w:"full",h:"full",justifyContent:"center",alignItems:"center",maxH:96,userSelect:"none"},children:a.jsx(Ee,{variant:"subtext",children:"No Model Selected"})})};function dde(){const{t:e}=Ie();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(Ee,{sx:{fontWeight:600},children:e("modelManager.syncModels")}),a.jsx(Ee,{fontSize:"sm",sx:{_dark:{color:"base.400"}},children:e("modelManager.syncModelsDesc")})]}),a.jsx(Nu,{})]})}function fde(){return a.jsx($,{children:a.jsx(dde,{})})}const f_=[{id:"modelManager",label:Sr.t("modelManager.modelManager"),content:a.jsx(cde,{})},{id:"importModels",label:Sr.t("modelManager.importModels"),content:a.jsx(Jue,{})},{id:"mergeModels",label:Sr.t("modelManager.mergeModels"),content:a.jsx(ede,{})},{id:"settings",label:Sr.t("modelManager.settings"),content:a.jsx(fde,{})}],pde=()=>a.jsxs(Gl,{isLazy:!0,variant:"line",layerStyle:"first",sx:{w:"full",h:"full",p:4,gap:4,borderRadius:"base"},children:[a.jsx(ql,{children:f_.map(e=>a.jsx(Ro,{sx:{borderTopRadius:"base"},children:e.label},e.id))}),a.jsx(Ou,{sx:{w:"full",h:"full"},children:f_.map(e=>a.jsx(bs,{sx:{w:"full",h:"full"},children:e.content},e.id))})]}),hde=u.memo(pde),mde=(e,t)=>{const n={id:e,name:t.name,type:t.type,label:"",fieldKind:"input"};return t.type==="string"&&(n.value=t.default??""),t.type==="integer"&&(n.value=t.default??0),t.type==="float"&&(n.value=t.default??0),t.type==="boolean"&&(n.value=t.default??!1),t.type==="enum"&&(t.enumType==="number"&&(n.value=t.default??0),t.enumType==="string"&&(n.value=t.default??"")),t.type==="Collection"&&(n.value=t.default??1),t.type==="ImageField"&&(n.value=void 0),t.type==="ImageCollection"&&(n.value=[]),t.type==="DenoiseMaskField"&&(n.value=void 0),t.type==="LatentsField"&&(n.value=void 0),t.type==="ConditioningField"&&(n.value=void 0),t.type==="UNetField"&&(n.value=void 0),t.type==="ClipField"&&(n.value=void 0),t.type==="VaeField"&&(n.value=void 0),t.type==="ControlField"&&(n.value=void 0),t.type==="MainModelField"&&(n.value=void 0),t.type==="SDXLRefinerModelField"&&(n.value=void 0),t.type==="VaeModelField"&&(n.value=void 0),t.type==="LoRAModelField"&&(n.value=void 0),t.type==="ControlNetModelField"&&(n.value=void 0),t.type==="Scheduler"&&(n.value="euler"),n},gde=le([e=>e.nodes],e=>e.nodeTemplates),f1={dragHandle:`.${Ul}`},vde=()=>{const e=z(gde),t=px();return u.useCallback(n=>{var b;const r=Fi();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-I1/2,s=i.height/2-I1/2);const{x:c,y:f}=t.project({x:o,y:s});if(n==="current_image")return{...f1,id:r,type:"current_image",position:{x:c,y:f},data:{id:r,type:"current_image",isOpen:!0,label:"Current Image"}};if(n==="notes")return{...f1,id:r,type:"notes",position:{x:c,y:f},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=PC(p.inputs,(y,x,C)=>{const k=Fi(),j=mde(k,x);return y[C]=j,y},{}),m=PC(p.outputs,(y,x,C)=>{const j={id:Fi(),name:C,type:x.type,fieldKind:"output"};return y[C]=j,y},{});return{...f1,id:r,type:"invocation",position:{x:c,y:f},data:{id:r,type:n,inputs:h,outputs:m,isOpen:!0,label:"",notes:"",embedWorkflow:!1,isIntermediate:!0}}},[e,t])},XM=u.forwardRef(({label:e,description:t,...n},r)=>a.jsx("div",{ref:r,...n,children:a.jsxs("div",{children:[a.jsx(Ee,{fontWeight:600,children:e}),a.jsx(Ee,{size:"xs",sx:{color:"base.600",_dark:{color:"base.500"}},children:t})]})}));XM.displayName="AddNodePopoverSelectItem";const bde=(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))},xde=le([ke],({nodes:e})=>{const t=uo(e.nodeTemplates,n=>({label:n.title,value:n.type,description:n.description,tags:n.tags}));return t.push({label:"Progress Image",value:"current_image",description:"Displays the current image in the Node Editor",tags:["progress"]}),t.push({label:"Notes",value:"notes",description:"Add notes about your workflow",tags:["notes"]}),t.sort((n,r)=>n.label.localeCompare(r.label)),{data:t}},Oe),yde=()=>{const e=se(),t=vde(),n=Kl(),{data:r}=z(xde),o=z(v=>v.nodes.isAddNodePopoverOpen),s=u.useRef(null),i=u.useCallback(v=>{const b=t(v);if(!b){n({status:"error",title:`Unknown Invocation type ${v}`});return}e(fA(b))},[e,t,n]),c=u.useCallback(v=>{v&&i(v)},[i]),f=u.useCallback(()=>{e(pA())},[e]),p=u.useCallback(()=>{e(b3())},[e]),h=u.useCallback(v=>{v.preventDefault(),p(),setTimeout(()=>{var b;(b=s.current)==null||b.focus()},0)},[p]),m=u.useCallback(()=>{f()},[f]);return St(["shift+a","space"],h),St(["escape"],m),a.jsxs(fg,{initialFocusRef:s,isOpen:o,onClose:f,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(pg,{sx:{p:0,top:-1,shadow:"dark-lg",borderColor:"accent.300",borderWidth:"2px",borderStyle:"solid",_dark:{borderColor:"accent.400"}},children:a.jsx(ey,{sx:{p:0},children:a.jsx(Kn,{inputRef:s,selectOnBlur:!1,placeholder:"Search for nodes",value:null,data:r,maxDropdownHeight:400,nothingFound:"No matching nodes",itemComponent:XM,filter:bde,onChange:c,hoverOnSearchChange:!0,onDropdownClose:f,sx:{width:"32rem",input:{padding:"0.5rem"}}})})})]})},wde=u.memo(yde);var Cde="\0",fl="\0",p_="",Po,xl,Vo,Zd,tu,nu,cs,pa,Ai,ha,Ni,Ua,Ga,ru,ou,qa,Ds,ef,Wb,M_;let Sde=(M_=class{constructor(t){rr(this,ef);rr(this,Po,!0);rr(this,xl,!1);rr(this,Vo,!1);rr(this,Zd,void 0);rr(this,tu,()=>{});rr(this,nu,()=>{});rr(this,cs,{});rr(this,pa,{});rr(this,Ai,{});rr(this,ha,{});rr(this,Ni,{});rr(this,Ua,{});rr(this,Ga,{});rr(this,ru,0);rr(this,ou,0);rr(this,qa,void 0);rr(this,Ds,void 0);t&&(as(this,Po,t.hasOwnProperty("directed")?t.directed:!0),as(this,xl,t.hasOwnProperty("multigraph")?t.multigraph:!1),as(this,Vo,t.hasOwnProperty("compound")?t.compound:!1)),Pe(this,Vo)&&(as(this,qa,{}),as(this,Ds,{}),Pe(this,Ds)[fl]={})}isDirected(){return Pe(this,Po)}isMultigraph(){return Pe(this,xl)}isCompound(){return Pe(this,Vo)}setGraph(t){return as(this,Zd,t),this}graph(){return Pe(this,Zd)}setDefaultNodeLabel(t){return as(this,tu,t),typeof t!="function"&&as(this,tu,()=>t),this}nodeCount(){return Pe(this,ru)}nodes(){return Object.keys(Pe(this,cs))}sources(){var t=this;return this.nodes().filter(n=>Object.keys(Pe(t,pa)[n]).length===0)}sinks(){var t=this;return this.nodes().filter(n=>Object.keys(Pe(t,ha)[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 Pe(this,cs).hasOwnProperty(t)?(arguments.length>1&&(Pe(this,cs)[t]=n),this):(Pe(this,cs)[t]=arguments.length>1?n:Pe(this,tu).call(this,t),Pe(this,Vo)&&(Pe(this,qa)[t]=fl,Pe(this,Ds)[t]={},Pe(this,Ds)[fl][t]=!0),Pe(this,pa)[t]={},Pe(this,Ai)[t]={},Pe(this,ha)[t]={},Pe(this,Ni)[t]={},++rd(this,ru)._,this)}node(t){return Pe(this,cs)[t]}hasNode(t){return Pe(this,cs).hasOwnProperty(t)}removeNode(t){var n=this;if(Pe(this,cs).hasOwnProperty(t)){var r=o=>n.removeEdge(Pe(n,Ua)[o]);delete Pe(this,cs)[t],Pe(this,Vo)&&(da(this,ef,Wb).call(this,t),delete Pe(this,qa)[t],this.children(t).forEach(function(o){n.setParent(o)}),delete Pe(this,Ds)[t]),Object.keys(Pe(this,pa)[t]).forEach(r),delete Pe(this,pa)[t],delete Pe(this,Ai)[t],Object.keys(Pe(this,ha)[t]).forEach(r),delete Pe(this,ha)[t],delete Pe(this,Ni)[t],--rd(this,ru)._}return this}setParent(t,n){if(!Pe(this,Vo))throw new Error("Cannot set parent in a non-compound graph");if(n===void 0)n=fl;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),da(this,ef,Wb).call(this,t),Pe(this,qa)[t]=n,Pe(this,Ds)[n][t]=!0,this}parent(t){if(Pe(this,Vo)){var n=Pe(this,qa)[t];if(n!==fl)return n}}children(t=fl){if(Pe(this,Vo)){var n=Pe(this,Ds)[t];if(n)return Object.keys(n)}else{if(t===fl)return this.nodes();if(this.hasNode(t))return[]}}predecessors(t){var n=Pe(this,Ai)[t];if(n)return Object.keys(n)}successors(t){var n=Pe(this,Ni)[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:Pe(this,Po),multigraph:Pe(this,xl),compound:Pe(this,Vo)});n.setGraph(this.graph());var r=this;Object.entries(Pe(this,cs)).forEach(function([i,c]){t(i)&&n.setNode(i,c)}),Object.values(Pe(this,Ua)).forEach(function(i){n.hasNode(i.v)&&n.hasNode(i.w)&&n.setEdge(i,r.edge(i))});var o={};function s(i){var c=r.parent(i);return c===void 0||n.hasNode(c)?(o[i]=c,c):c in o?o[c]:s(c)}return Pe(this,Vo)&&n.nodes().forEach(i=>n.setParent(i,s(i))),n}setDefaultEdgeLabel(t){return as(this,nu,t),typeof t!="function"&&as(this,nu,()=>t),this}edgeCount(){return Pe(this,ou)}edges(){return Object.values(Pe(this,Ua))}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 c=Cd(Pe(this,Po),t,n,r);if(Pe(this,Ga).hasOwnProperty(c))return s&&(Pe(this,Ga)[c]=o),this;if(r!==void 0&&!Pe(this,xl))throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(n),Pe(this,Ga)[c]=s?o:Pe(this,nu).call(this,t,n,r);var f=kde(Pe(this,Po),t,n,r);return t=f.v,n=f.w,Object.freeze(f),Pe(this,Ua)[c]=f,h_(Pe(this,Ai)[n],t),h_(Pe(this,Ni)[t],n),Pe(this,pa)[n][c]=f,Pe(this,ha)[t][c]=f,rd(this,ou)._++,this}edge(t,n,r){var o=arguments.length===1?p1(Pe(this,Po),arguments[0]):Cd(Pe(this,Po),t,n,r);return Pe(this,Ga)[o]}edgeAsObj(){const t=this.edge(...arguments);return typeof t!="object"?{label:t}:t}hasEdge(t,n,r){var o=arguments.length===1?p1(Pe(this,Po),arguments[0]):Cd(Pe(this,Po),t,n,r);return Pe(this,Ga).hasOwnProperty(o)}removeEdge(t,n,r){var o=arguments.length===1?p1(Pe(this,Po),arguments[0]):Cd(Pe(this,Po),t,n,r),s=Pe(this,Ua)[o];return s&&(t=s.v,n=s.w,delete Pe(this,Ga)[o],delete Pe(this,Ua)[o],m_(Pe(this,Ai)[n],t),m_(Pe(this,Ni)[t],n),delete Pe(this,pa)[n][o],delete Pe(this,ha)[t][o],rd(this,ou)._--),this}inEdges(t,n){var r=Pe(this,pa)[t];if(r){var o=Object.values(r);return n?o.filter(s=>s.v===n):o}}outEdges(t,n){var r=Pe(this,ha)[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))}},Po=new WeakMap,xl=new WeakMap,Vo=new WeakMap,Zd=new WeakMap,tu=new WeakMap,nu=new WeakMap,cs=new WeakMap,pa=new WeakMap,Ai=new WeakMap,ha=new WeakMap,Ni=new WeakMap,Ua=new WeakMap,Ga=new WeakMap,ru=new WeakMap,ou=new WeakMap,qa=new WeakMap,Ds=new WeakMap,ef=new WeakSet,Wb=function(t){delete Pe(this,Ds)[Pe(this,qa)[t]][t]},M_);function h_(e,t){e[t]?e[t]++:e[t]=1}function m_(e,t){--e[t]||delete e[t]}function Cd(e,t,n,r){var o=""+t,s=""+n;if(!e&&o>s){var i=o;o=s,s=i}return o+p_+s+p_+(r===void 0?Cde:r)}function kde(e,t,n,r){var o=""+t,s=""+n;if(!e&&o>s){var i=o;o=s,s=i}var c={v:o,w:s};return r&&(c.name=r),c}function p1(e,t){return Cd(e,t.v,t.w,t.name)}var p2=Sde,jde="2.1.13",_de={Graph:p2,version:jde},Pde=p2,Ide={write:Ede,read:Rde};function Ede(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:Ode(e),edges:Mde(e)};return e.graph()!==void 0&&(t.value=structuredClone(e.graph())),t}function Ode(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 Mde(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 Rde(e){var t=new Pde(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 Dde=Ade;function Ade(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 so,Ka,tf,Vb,nf,Ub,su,gh,R_;let Nde=(R_=class{constructor(){rr(this,tf);rr(this,nf);rr(this,su);rr(this,so,[]);rr(this,Ka,{})}size(){return Pe(this,so).length}keys(){return Pe(this,so).map(function(t){return t.key})}has(t){return Pe(this,Ka).hasOwnProperty(t)}priority(t){var n=Pe(this,Ka)[t];if(n!==void 0)return Pe(this,so)[n].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return Pe(this,so)[0].key}add(t,n){var r=Pe(this,Ka);if(t=String(t),!r.hasOwnProperty(t)){var o=Pe(this,so),s=o.length;return r[t]=s,o.push({key:t,priority:n}),da(this,nf,Ub).call(this,s),!0}return!1}removeMin(){da(this,su,gh).call(this,0,Pe(this,so).length-1);var t=Pe(this,so).pop();return delete Pe(this,Ka)[t.key],da(this,tf,Vb).call(this,0),t.key}decrease(t,n){var r=Pe(this,Ka)[t];if(n>Pe(this,so)[r].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+Pe(this,so)[r].priority+" New: "+n);Pe(this,so)[r].priority=n,da(this,nf,Ub).call(this,r)}},so=new WeakMap,Ka=new WeakMap,tf=new WeakSet,Vb=function(t){var n=Pe(this,so),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&&(da(this,su,gh).call(this,t,s),da(this,tf,Vb).call(this,s)))},nf=new WeakSet,Ub=function(t){for(var n=Pe(this,so),r=n[t].priority,o;t!==0&&(o=t>>1,!(n[o].priority<r));)da(this,su,gh).call(this,t,o),t=o},su=new WeakSet,gh=function(t,n){var r=Pe(this,so),o=Pe(this,Ka),s=r[t],i=r[n];r[t]=i,r[n]=s,o[i.key]=t,o[s.key]=n},R_);var QM=Nde,Tde=QM,YM=Lde,$de=()=>1;function Lde(e,t,n,r){return Fde(e,String(t),n||$de,r||function(o){return e.outEdges(o)})}function Fde(e,t,n,r){var o={},s=new Tde,i,c,f=function(p){var h=p.v!==i?p.v:p.w,m=o[h],v=n(p),b=c.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(),c=o[i],c.distance!==Number.POSITIVE_INFINITY);)r(i).forEach(f);return o}var zde=YM,Bde=Hde;function Hde(e,t,n){return e.nodes().reduce(function(r,o){return r[o]=zde(e,o,t,n),r},{})}var JM=Wde;function Wde(e){var t=0,n=[],r={},o=[];function s(i){var c=r[i]={onStack:!0,lowlink:t,index:t++};if(n.push(i),e.successors(i).forEach(function(h){r.hasOwnProperty(h)?r[h].onStack&&(c.lowlink=Math.min(c.lowlink,r[h].index)):(s(h),c.lowlink=Math.min(c.lowlink,r[h].lowlink))}),c.lowlink===c.index){var f=[],p;do p=n.pop(),r[p].onStack=!1,f.push(p);while(i!==p);o.push(f)}}return e.nodes().forEach(function(i){r.hasOwnProperty(i)||s(i)}),o}var Vde=JM,Ude=Gde;function Gde(e){return Vde(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var qde=Xde,Kde=()=>1;function Xde(e,t,n){return Qde(e,t||Kde,n||function(r){return e.outEdges(r)})}function Qde(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 c=i.v===s?i.w:i.v,f=t(i);r[s][c]={distance:f,predecessor:s}})}),o.forEach(function(s){var i=r[s];o.forEach(function(c){var f=r[c];o.forEach(function(p){var h=f[s],m=i[p],v=f[p],b=h.distance+m.distance;b<v.distance&&(v.distance=b,v.predecessor=m.predecessor)})})}),r}function ZM(e){var t={},n={},r=[];function o(s){if(n.hasOwnProperty(s))throw new Gb;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 Gb;return r}class Gb extends Error{constructor(){super(...arguments)}}var e8=ZM;ZM.CycleException=Gb;var g_=e8,Yde=Jde;function Jde(e){try{g_(e)}catch(t){if(t instanceof g_.CycleException)return!1;throw t}return!0}var t8=Zde;function Zde(e,t,n){Array.isArray(t)||(t=[t]);var r=e.isDirected()?c=>e.successors(c):c=>e.neighbors(c),o=n==="post"?efe:tfe,s=[],i={};return t.forEach(c=>{if(!e.hasNode(c))throw new Error("Graph does not have node: "+c);o(c,r,i,s)}),s}function efe(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]),n8(t(s[0]),i=>o.push([i,!1])))}}function tfe(e,t,n,r){for(var o=[e];o.length>0;){var s=o.pop();n.hasOwnProperty(s)||(n[s]=!0,r.push(s),n8(t(s),i=>o.push(i)))}}function n8(e,t){for(var n=e.length;n--;)t(e[n],n,e);return e}var nfe=t8,rfe=ofe;function ofe(e,t){return nfe(e,t,"post")}var sfe=t8,afe=ife;function ife(e,t){return sfe(e,t,"pre")}var lfe=p2,cfe=QM,ufe=dfe;function dfe(e,t){var n=new lfe,r={},o=new cfe,s;function i(f){var p=f.v===s?f.w:f.v,h=o.priority(p);if(h!==void 0){var m=t(f);m<h&&(r[p]=s,o.decrease(p,m))}}if(e.nodeCount()===0)return n;e.nodes().forEach(function(f){o.add(f,Number.POSITIVE_INFINITY),n.setNode(f)}),o.decrease(e.nodes()[0],0);for(var c=!1;o.size()>0;){if(s=o.removeMin(),r.hasOwnProperty(s))n.setEdge(s,r[s]);else{if(c)throw new Error("Input graph is not connected: "+e);c=!0}e.nodeEdges(s).forEach(i)}return n}var ffe={components:Dde,dijkstra:YM,dijkstraAll:Bde,findCycles:Ude,floydWarshall:qde,isAcyclic:Yde,postorder:rfe,preorder:afe,prim:ufe,tarjan:JM,topsort:e8},v_=_de,pfe={Graph:v_.Graph,json:Ide,alg:ffe,version:v_.version};const b_=Cu(pfe),hfe=()=>{const e=px(),t=z(r=>r.nodes.shouldValidateGraph);return u.useCallback(({source:r,sourceHandle:o,target:s,targetHandle:i})=>{var b,y;if(!t)return!0;const c=e.getEdges(),f=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;return!m||!v||c.find(x=>x.target===s&&x.targetHandle===i)&&v!=="CollectionItem"||m!==v&&m!=="CollectionItem"&&v!=="CollectionItem"&&!(Sh.includes(v)&&Sh.includes(m))?!1:r8(r,s,f,c)},[e,t])},r8=(e,t,n,r)=>{const o=new b_.Graph;return n.forEach(s=>{o.setNode(s.id)}),r.forEach(s=>{o.setEdge(s.source,s.target)}),o.setEdge(e,t),b_.alg.isAcyclic(o)},Yd=e=>`var(--invokeai-colors-${e.split(".").join("-")}`,mfe=le(ke,({nodes:e})=>{const{shouldAnimateEdges:t,currentConnectionFieldType:n,shouldColorEdges:r}=e,o=Yd(n&&r?lf[n].color:"base.500");let s="react-flow__custom_connection-path";return t&&(s=s.concat(" animated")),{stroke:o,className:s}}),gfe=({fromX:e,fromY:t,fromPosition:n,toX:r,toY:o,toPosition:s})=>{const{stroke:i,className:c}=z(mfe),f={sourceX:e,sourceY:t,sourcePosition:n,targetX:r,targetY:o,targetPosition:s},[p]=hx(f);return a.jsx("g",{children:a.jsx("path",{fill:"none",stroke:i,strokeWidth:2,className:c,d:p,style:{opacity:.8}})})},vfe=u.memo(gfe),o8=(e,t,n,r,o)=>le(ke,({nodes:s})=>{var v,b;const i=s.nodes.find(y=>y.id===e),c=s.nodes.find(y=>y.id===n),f=Er(i)&&Er(c),p=(i==null?void 0:i.selected)||(c==null?void 0:c.selected)||o,h=f?(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?Yd(lf[h].color):Yd("base.500");return{isSelected:p,shouldAnimate:s.shouldAnimateEdges&&p,stroke:m}},Oe),bfe=({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o,targetPosition:s,markerEnd:i,data:c,selected:f,source:p,target:h,sourceHandleId:m,targetHandleId:v})=>{const b=u.useMemo(()=>o8(p,m,h,v,f),[f,p,m,h,v]),{isSelected:y,shouldAnimate:x}=z(b),[C,k,j]=hx({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:s}),{base500:_}=Ef();return a.jsxs(a.Fragment,{children:[a.jsx(x3,{path:C,markerEnd:i,style:{strokeWidth:y?3:2,stroke:_,opacity:y?.8:.5,animation:x?"dashdraw 0.5s linear infinite":void 0,strokeDasharray:x?5:"none"}}),(c==null?void 0:c.count)&&c.count>1&&a.jsx(hA,{children:a.jsx($,{sx:{position:"absolute",transform:`translate(-50%, -50%) translate(${k}px,${j}px)`},className:"nodrag nopan",children:a.jsx(hi,{variant:"solid",sx:{bg:"base.500",opacity:y?.8:.5,boxShadow:"base"},children:c.count})})})]})},xfe=u.memo(bfe),yfe=({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o,targetPosition:s,markerEnd:i,selected:c,source:f,target:p,sourceHandleId:h,targetHandleId:m})=>{const v=u.useMemo(()=>o8(f,h,p,m,c),[f,h,p,m,c]),{isSelected:b,shouldAnimate:y,stroke:x}=z(v),[C]=hx({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:s});return a.jsx(x3,{path:C,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"}})},wfe=u.memo(yfe),Cfe=e=>{const{nodeId:t,width:n,children:r,selected:o}=e,{isMouseOverNode:s,handleMouseOut:i,handleMouseOver:c}=fM(t),f=u.useMemo(()=>le(ke,({nodes:j})=>{var _;return((_=j.nodeExecutionStates[t])==null?void 0:_.status)===Qa.IN_PROGRESS}),[t]),p=z(f),[h,m,v,b]=xa("shadows",["nodeInProgress.light","nodeInProgress.dark","shadows.xl","shadows.base"]),y=se(),x=Rl(h,m),C=z(j=>j.nodes.nodeOpacity),k=u.useCallback(()=>{y(y3())},[y]);return a.jsxs(Fe,{onClick:k,onMouseEnter:c,onMouseLeave:i,className:Ul,sx:{h:"full",position:"relative",borderRadius:"base",w:n??I1,transitionProperty:"common",transitionDuration:"0.1s",cursor:"grab",opacity:C},children:[a.jsx(Fe,{sx:{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,borderRadius:"base",pointerEvents:"none",shadow:`${v}, ${b}, ${b}`,zIndex:-1}}),a.jsx(Fe,{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(dM,{isSelected:o,isHovered:s})]})},o0=u.memo(Cfe),Sfe=le(ke,({system:e,gallery:t})=>({imageDTO:t.selection[t.selection.length-1],progressImage:e.progressImage})),kfe=e=>{const{progressImage:t,imageDTO:n}=mA(Sfe);return t?a.jsx(h1,{nodeProps:e,children:a.jsx(Vl,{src:t.dataURL,sx:{w:"full",h:"full",objectFit:"contain",borderRadius:"base"}})}):n?a.jsx(h1,{nodeProps:e,children:a.jsx(ii,{imageDTO:n,isDragDisabled:!0,useThumbailFallback:!0})}):a.jsx(h1,{nodeProps:e,children:a.jsx(lo,{})})},jfe=u.memo(kfe),h1=e=>{const[t,n]=u.useState(!1),r=()=>{n(!0)},o=()=>{n(!1)};return a.jsx(o0,{nodeId:e.nodeProps.id,selected:e.nodeProps.selected,width:384,children:a.jsxs($,{onMouseEnter:r,onMouseLeave:o,className:Ul,sx:{position:"relative",flexDirection:"column"},children:[a.jsx($,{layerStyle:"nodeHeader",sx:{borderTopRadius:"base",alignItems:"center",justifyContent:"center",h:8},children:a.jsx(Ee,{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(yr.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(BM,{})},"nextPrevButtons")]})]})})},_fe=e=>{const t=u.useMemo(()=>le(ke,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return Er(o)?o.data.embedWorkflow:!1},Oe),[e]);return z(t)},s8=e=>{const t=u.useMemo(()=>le(ke,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return Er(o)?$s(o.data.outputs,s=>gA.includes(s.type)):!1},Oe),[e]);return z(t)},Pfe=({nodeId:e})=>{const t=se(),n=s8(e),r=_fe(e),o=u.useCallback(s=>{t(vA({nodeId:e,embedWorkflow:s.target.checked}))},[t,e]);return n?a.jsxs(pr,{as:$,sx:{alignItems:"center",gap:2,w:"auto"},children:[a.jsx(Jr,{sx:{fontSize:"xs",mb:"1px"},children:"Embed Workflow"}),a.jsx(Qm,{className:"nopan",size:"sm",onChange:o,isChecked:r})]}):null},Ife=u.memo(Pfe),Efe=e=>{const t=u.useMemo(()=>le(ke,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return Er(o)?o.data.isIntermediate:!1},Oe),[e]);return z(t)},Ofe=({nodeId:e})=>{const t=se(),n=s8(e),r=Efe(e),o=u.useCallback(s=>{t(bA({nodeId:e,isIntermediate:!s.target.checked}))},[t,e]);return n?a.jsxs(pr,{as:$,sx:{alignItems:"center",gap:2,w:"auto"},children:[a.jsx(Jr,{sx:{fontSize:"xs",mb:"1px"},children:"Save to Gallery"}),a.jsx(Qm,{className:"nopan",size:"sm",onChange:o,isChecked:!r})]}):null},Mfe=u.memo(Ofe),Rfe=({nodeId:e})=>a.jsxs($,{className:Ul,layerStyle:"nodeFooter",sx:{w:"full",borderBottomRadius:"base",px:2,py:0,h:6,justifyContent:"space-between"},children:[a.jsx(Ife,{nodeId:e}),a.jsx(Mfe,{nodeId:e})]}),Dfe=u.memo(Rfe),Afe=({nodeId:e,isOpen:t})=>{const n=se(),r=xA(),o=u.useCallback(()=>{n(yA({nodeId:e,isOpen:!t})),r(e)},[n,t,e,r]);return a.jsx(tt,{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(Lg,{sx:{transform:t?"rotate(0deg)":"rotate(180deg)",transitionProperty:"common",transitionDuration:"normal"}})})},h2=u.memo(Afe),a8=e=>{const t=u.useMemo(()=>le(ke,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return Er(o)?o.data.label:!1},Oe),[e]);return z(t)},i8=e=>{const t=u.useMemo(()=>le(ke,({nodes:r})=>{const o=r.nodes.find(i=>i.id===e);if(!Er(o))return!1;const s=o?r.nodeTemplates[o.data.type]:void 0;return s==null?void 0:s.title},Oe),[e]);return z(t)},Nfe=({nodeId:e,title:t})=>{const n=se(),r=a8(e),o=i8(e),[s,i]=u.useState(""),c=u.useCallback(async p=>{n(wA({nodeId:e,label:p})),i(p||t||o||"Problem Setting Title")},[n,e,t,o]),f=u.useCallback(p=>{i(p)},[]);return u.useEffect(()=>{i(r||t||o||"Problem Setting Title")},[r,o,t]),a.jsx($,{sx:{overflow:"hidden",w:"full",h:"full",alignItems:"center",justifyContent:"center",cursor:"text"},children:a.jsxs(Zm,{as:$,value:s,onChange:f,onSubmit:c,sx:{alignItems:"center",position:"relative",w:"full",h:"full"},children:[a.jsx(Jm,{fontSize:"sm",sx:{p:0,w:"full"},noOfLines:1}),a.jsx(Ym,{className:"nodrag",fontSize:"sm",sx:{p:0,fontWeight:700,_focusVisible:{p:0,boxShadow:"none"}}}),a.jsx(Tfe,{})]})})},l8=u.memo(Nfe);function Tfe(){const{isEditing:e,getEditButtonProps:t}=Y3(),n=u.useCallback(r=>{const{onClick:o}=t();o&&o(r)},[t]);return e?null:a.jsx(Fe,{className:Ul,onDoubleClick:n,sx:{position:"absolute",w:"full",h:"full",top:0,cursor:"grab"}})}const m2=e=>{const t=u.useMemo(()=>le(ke,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return o==null?void 0:o.data},Oe),[e]);return z(t)},$fe=({nodeId:e})=>{const t=m2(e),{base400:n,base600:r}=Ef(),o=Rl(n,r),s=u.useMemo(()=>({borderWidth:0,borderRadius:"3px",width:"1rem",height:"1rem",backgroundColor:o,zIndex:-1}),[o]);return mx(t)?a.jsxs(a.Fragment,{children:[a.jsx(vd,{type:"target",id:`${t.id}-collapsed-target`,isConnectable:!1,position:Dc.Left,style:{...s,left:"-0.5rem"}}),uo(t.inputs,i=>a.jsx(vd,{type:"target",id:i.name,isConnectable:!1,position:Dc.Left,style:{visibility:"hidden"}},`${t.id}-${i.name}-collapsed-input-handle`)),a.jsx(vd,{type:"source",id:`${t.id}-collapsed-source`,isConnectable:!1,position:Dc.Right,style:{...s,right:"-0.5rem"}}),uo(t.outputs,i=>a.jsx(vd,{type:"source",id:i.name,isConnectable:!1,position:Dc.Right,style:{visibility:"hidden"}},`${t.id}-${i.name}-collapsed-output-handle`))]}):null},Lfe=u.memo($fe),Ffe=e=>{const t=u.useMemo(()=>le(ke,({nodes:r})=>{const o=r.nodes.find(i=>i.id===e);return r.nodeTemplates[(o==null?void 0:o.data.type)??""]},Oe),[e]);return z(t)},zfe=({nodeId:e})=>{const t=se(),n=m2(e),r=u.useCallback(o=>{t(CA({nodeId:e,notes:o.target.value}))},[t,e]);return mx(n)?a.jsxs(pr,{children:[a.jsx(Jr,{children:"Notes"}),a.jsx(li,{value:n==null?void 0:n.notes,onChange:r,rows:10})]}):null},Bfe=u.memo(zfe),Hfe=({nodeId:e})=>{const{isOpen:t,onOpen:n,onClose:r}=Ao(),o=a8(e),s=i8(e);return a.jsxs(a.Fragment,{children:[a.jsx(Mn,{label:a.jsx(c8,{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(Tr,{as:FE,sx:{boxSize:4,w:8,color:"base.400"}})})}),a.jsxs(Tl,{isOpen:t,onClose:r,isCentered:!0,children:[a.jsx(Ks,{}),a.jsxs($l,{children:[a.jsx(qs,{children:o||s||"Unknown Node"}),a.jsx(kf,{}),a.jsx(Xs,{children:a.jsx(Bfe,{nodeId:e})}),a.jsx(ka,{})]})]})]})},Wfe=u.memo(Hfe),c8=u.memo(({nodeId:e})=>{const t=m2(e),n=Ffe(e),r=u.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:"Unknown Node",[t,n]);return mx(t)?a.jsxs($,{sx:{flexDir:"column"},children:[a.jsx(Ee,{sx:{fontWeight:600},children:r}),a.jsx(Ee,{sx:{opacity:.7,fontStyle:"oblique 5deg"},children:n==null?void 0:n.description}),(t==null?void 0:t.notes)&&a.jsx(Ee,{children:t.notes})]}):a.jsx(Ee,{sx:{fontWeight:600},children:"Unknown Node"})});c8.displayName="TooltipContent";const m1=3,x_={circle:{transitionProperty:"none",transitionDuration:"0s"},".chakra-progress__track":{stroke:"transparent"}},Vfe=({nodeId:e})=>{const t=u.useMemo(()=>le(ke,({nodes:r})=>r.nodeExecutionStates[e]),[e]),n=z(t);return n?a.jsx(Mn,{label:a.jsx(u8,{nodeExecutionState:n}),placement:"top",children:a.jsx($,{className:Ul,sx:{w:5,h:"full",alignItems:"center",justifyContent:"flex-end"},children:a.jsx(d8,{nodeExecutionState:n})})}):null},Ufe=u.memo(Vfe),u8=u.memo(({nodeExecutionState:e})=>{const{status:t,progress:n,progressImage:r}=e;return t===Qa.PENDING?a.jsx(Ee,{children:"Pending"}):t===Qa.IN_PROGRESS?r?a.jsxs($,{sx:{pos:"relative",pt:1.5,pb:.5},children:[a.jsx(Vl,{src:r.dataURL,sx:{w:32,h:32,borderRadius:"base",objectFit:"contain"}}),n!==null&&a.jsxs(hi,{variant:"solid",sx:{pos:"absolute",top:2.5,insetInlineEnd:1},children:[Math.round(n*100),"%"]})]}):n!==null?a.jsxs(Ee,{children:["In Progress (",Math.round(n*100),"%)"]}):a.jsx(Ee,{children:"In Progress"}):t===Qa.COMPLETED?a.jsx(Ee,{children:"Completed"}):t===Qa.FAILED?a.jsx(Ee,{children:"nodeExecutionState.error"}):null});u8.displayName="TooltipLabel";const d8=u.memo(e=>{const{progress:t,status:n}=e.nodeExecutionState;return n===Qa.PENDING?a.jsx(Tr,{as:uJ,sx:{boxSize:m1,color:"base.600",_dark:{color:"base.300"}}}):n===Qa.IN_PROGRESS?t===null?a.jsx(J1,{isIndeterminate:!0,size:"14px",color:"base.500",thickness:14,sx:x_}):a.jsx(J1,{value:Math.round(t*100),size:"14px",color:"base.500",thickness:14,sx:x_}):n===Qa.COMPLETED?a.jsx(Tr,{as:AE,sx:{boxSize:m1,color:"ok.600",_dark:{color:"ok.300"}}}):n===Qa.FAILED?a.jsx(Tr,{as:pJ,sx:{boxSize:m1,color:"error.600",_dark:{color:"error.300"}}}):null});d8.displayName="StatusIcon";const Gfe=({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(h2,{nodeId:e,isOpen:t}),a.jsx(l8,{nodeId:e}),a.jsxs($,{alignItems:"center",children:[a.jsx(Ufe,{nodeId:e}),a.jsx(Wfe,{nodeId:e})]}),!t&&a.jsx(Lfe,{nodeId:e})]}),qfe=u.memo(Gfe),Kfe=(e,t,n,r)=>le(ke,o=>{if(!r)return"No field type";const{currentConnectionFieldType:s,connectionStartParams:i,nodes:c,edges:f}=o.nodes;if(!o.nodes.shouldValidateGraph)return null;if(!i||!s)return"No connection in progress";const{handleType:p,nodeId:h,handleId:m}=i;if(!p||!h||!m)return"No connection data";const v=n==="target"?r:s,b=n==="source"?r:s;return e===h?"Cannot connect to self":n===p?n==="source"?"Cannot connect output to output":"Cannot connect input to input":r!==s&&r!=="CollectionItem"&&s!=="CollectionItem"&&!(Sh.includes(v)&&Sh.includes(b))?"Field types must match":n==="target"&&f.find(x=>x.target===e&&x.targetHandle===t)&&v!=="CollectionItem"?"Inputs may only have one connection":r8(p==="source"?h:e,p==="source"?e:h,c,f)?null:"Connection would create a cycle"}),Xfe=(e,t,n)=>{const r=u.useMemo(()=>le(ke,({nodes:s})=>{var c;const i=s.nodes.find(f=>f.id===e);if(Er(i))return(c=i==null?void 0:i.data[cx[n]][t])==null?void 0:c.type},Oe),[t,n,e]);return z(r)},Qfe=le(ke,({nodes:e})=>e.currentConnectionFieldType!==null&&e.connectionStartParams!==null),f8=({nodeId:e,fieldName:t,kind:n})=>{const r=Xfe(e,t,n),o=u.useMemo(()=>le(ke,({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=u.useMemo(()=>Kfe(e,t,n==="input"?"target":"source",r),[e,t,n,r]),i=u.useMemo(()=>le(ke,({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]),c=z(o),f=z(Qfe),p=z(i),h=z(s),m=u.useMemo(()=>!!(f&&h&&!p),[h,f,p]);return{isConnected:c,isConnectionInProgress:f,isConnectionStartField:p,connectionError:h,shouldDim:m}},Yfe=e=>{const{fieldTemplate:t,handleType:n,isConnectionInProgress:r,isConnectionStartField:o,connectionError:s}=e,{name:i,type:c}=t,{color:f,title:p}=lf[c],h=u.useMemo(()=>{const v={backgroundColor:Yd(f),position:"absolute",width:"1rem",height:"1rem",borderWidth:0,zIndex:1};return n==="target"?v.insetInlineStart="-1rem":v.insetInlineEnd="-1rem",r&&!o&&s&&(v.filter="opacity(0.4) grayscale(0.7)"),r&&s?o?v.cursor="grab":v.cursor="not-allowed":v.cursor="crosshair",v},[f,s,n,r,o]),m=u.useMemo(()=>r&&o?p:r&&s?s??p:p,[s,r,o,p]);return a.jsx(Mn,{label:m,placement:n==="target"?"start":"end",hasArrow:!0,openDelay:Um,children:a.jsx(vd,{type:n,id:i,position:n==="target"?Dc.Left:Dc.Right,style:h})})},p8=u.memo(Yfe),Jfe=({nodeId:e,fieldName:t})=>{const n=Qg(e,t,"output"),{isConnected:r,isConnectionInProgress:o,isConnectionStartField:s,connectionError:i,shouldDim:c}=f8({nodeId:e,fieldName:t,kind:"output"});return(n==null?void 0:n.fieldKind)!=="output"?a.jsx(qb,{shouldDim:c,children:a.jsxs(pr,{sx:{color:"error.400",textAlign:"right",fontSize:"sm"},children:["Unknown output: ",t]})}):a.jsxs(qb,{shouldDim:c,children:[a.jsx(Mn,{label:a.jsx(r2,{nodeId:e,fieldName:t,kind:"output"}),openDelay:Um,placement:"top",shouldWrapChildren:!0,hasArrow:!0,children:a.jsx(pr,{isDisabled:r,pe:2,children:a.jsx(Jr,{sx:{mb:0,fontWeight:500},children:n==null?void 0:n.title})})}),a.jsx(p8,{fieldTemplate:n,handleType:"source",isConnectionInProgress:o,isConnectionStartField:s,connectionError:i})]})},Zfe=u.memo(Jfe),qb=u.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}));qb.displayName="OutputFieldWrapper";const epe=(e,t)=>{const n=u.useMemo(()=>le(ke,({nodes:o})=>{var i;const s=o.nodes.find(c=>c.id===e);if(Er(s))return!!((i=s==null?void 0:s.data.inputs[t])!=null&&i.value)},Oe),[t,e]);return z(n)},tpe=(e,t)=>{const n=u.useMemo(()=>le(ke,({nodes:o})=>{const s=o.nodes.find(f=>f.id===e);if(!Er(s))return;const i=o.nodeTemplates[(s==null?void 0:s.data.type)??""],c=i==null?void 0:i.inputs[t];return c==null?void 0:c.input},Oe),[t,e]);return z(n)},npe=({nodeId:e,fieldName:t,kind:n,children:r})=>{const o=se(),s=pM(e,t),i=hM(e,t,n),c=tpe(e,t),f=u.useCallback(x=>{x.preventDefault()},[]),p=u.useMemo(()=>le(ke,({nodes:x})=>({isExposed:!!x.workflow.exposedFields.find(k=>k.nodeId===e&&k.fieldName===t)}),Oe),[t,e]),h=u.useMemo(()=>["any","direct"].includes(c??"__UNKNOWN_INPUT__"),[c]),{isExposed:m}=z(p),v=u.useCallback(()=>{o(SA({nodeId:e,fieldName:t}))},[o,t,e]),b=u.useCallback(()=>{o(i3({nodeId:e,fieldName:t}))},[o,t,e]),y=u.useMemo(()=>{const x=[];return h&&!m&&x.push(a.jsx(Bn,{icon:a.jsx(Yl,{}),onClick:v,children:"Add to Linear View"},`${e}.${t}.expose-field`)),h&&m&&x.push(a.jsx(Bn,{icon:a.jsx(_J,{}),onClick:b,children:"Remove from Linear View"},`${e}.${t}.unexpose-field`)),x},[t,v,b,m,h,e]);return a.jsx(Vy,{menuProps:{size:"sm",isLazy:!0},menuButtonProps:{bg:"transparent",_hover:{bg:"transparent"}},renderMenu:()=>y.length?a.jsx(Ui,{sx:{visibility:"visible !important"},motionProps:au,onContextMenu:f,children:a.jsx(fu,{title:s||i||"Unknown Field",children:y})}):null,children:r})},rpe=u.memo(npe),ope=({nodeId:e,fieldName:t})=>{const n=Qg(e,t,"input"),r=epe(e,t),{isConnected:o,isConnectionInProgress:s,isConnectionStartField:i,connectionError:c,shouldDim:f}=f8({nodeId:e,fieldName:t,kind:"input"}),p=u.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(Kb,{shouldDim:f,children:a.jsxs(pr,{sx:{color:"error.400",textAlign:"left",fontSize:"sm"},children:["Unknown input: ",t]})}):a.jsxs(Kb,{shouldDim:f,children:[a.jsxs(pr,{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(rpe,{nodeId:e,fieldName:t,kind:"input",children:h=>a.jsx(Jr,{sx:{display:"flex",alignItems:"center",mb:0,px:1,gap:2},children:a.jsx(gM,{ref:h,nodeId:e,fieldName:t,kind:"input",isMissingInput:p,withTooltip:!0})})}),a.jsx(Fe,{children:a.jsx(_M,{nodeId:e,fieldName:t})})]}),n.input!=="direct"&&a.jsx(p8,{fieldTemplate:n,handleType:"target",isConnectionInProgress:s,isConnectionStartField:i,connectionError:c})]})},y_=u.memo(ope),Kb=u.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}));Kb.displayName="InputFieldWrapper";const spe=e=>{const t=u.useMemo(()=>le(ke,({nodes:r})=>{const o=r.nodes.find(i=>i.id===e);if(!Er(o))return[];const s=r.nodeTemplates[o.data.type];return s?uo(s.outputs).filter(i=>!i.ui_hidden).sort((i,c)=>(i.ui_order??0)-(c.ui_order??0)).map(i=>i.name).filter(i=>i!=="is_intermediate"):[]},Oe),[e]);return z(t)},ape=e=>{const t=u.useMemo(()=>le(ke,({nodes:r})=>{const o=r.nodes.find(s=>s.id===e);return Er(o)?$s(o.data.outputs,s=>kA.includes(s.type)):!1},Oe),[e]);return z(t)},ipe=e=>{const t=u.useMemo(()=>le(ke,({nodes:r})=>{const o=r.nodes.find(i=>i.id===e);if(!Er(o))return[];const s=r.nodeTemplates[o.data.type];return s?uo(s.inputs).filter(i=>i.input==="connection").filter(i=>!i.ui_hidden).sort((i,c)=>(i.ui_order??0)-(c.ui_order??0)).map(i=>i.name).filter(i=>i!=="is_intermediate"):[]},Oe),[e]);return z(t)},lpe=e=>{const t=u.useMemo(()=>le(ke,({nodes:r})=>{const o=r.nodes.find(i=>i.id===e);if(!Er(o))return[];const s=r.nodeTemplates[o.data.type];return s?uo(s.inputs).filter(i=>["any","direct"].includes(i.input)).filter(i=>!i.ui_hidden).sort((i,c)=>(i.ui_order??0)-(c.ui_order??0)).map(i=>i.name).filter(i=>i!=="is_intermediate"):[]},Oe),[e]);return z(t)},cpe=({nodeId:e,isOpen:t,label:n,type:r,selected:o})=>{const s=ipe(e),i=lpe(e),c=spe(e),f=ape(e);return a.jsxs(o0,{nodeId:e,selected:o,children:[a.jsx(qfe,{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:f?0:"base"},children:a.jsxs($,{sx:{flexDir:"column",px:2,w:"full",h:"full"},children:[a.jsxs(Vi,{gridTemplateColumns:"1fr auto",gridAutoRows:"1fr",children:[s.map((p,h)=>a.jsx(Bd,{gridColumnStart:1,gridRowStart:h+1,children:a.jsx(y_,{nodeId:e,fieldName:p})},`${e}.${p}.input-field`)),c.map((p,h)=>a.jsx(Bd,{gridColumnStart:2,gridRowStart:h+1,children:a.jsx(Zfe,{nodeId:e,fieldName:p})},`${e}.${p}.output-field`))]}),i.map(p=>a.jsx(y_,{nodeId:e,fieldName:p},`${e}.${p}.input-field`))]})}),f&&a.jsx(Dfe,{nodeId:e})]})]})},upe=u.memo(cpe),dpe=({nodeId:e,isOpen:t,label:n,type:r,selected:o})=>a.jsxs(o0,{nodeId:e,selected:o,children:[a.jsxs($,{className:Ul,layerStyle:"nodeHeader",sx:{borderTopRadius:"base",borderBottomRadius:t?0:"base",alignItems:"center",h:8,fontWeight:600,fontSize:"sm"},children:[a.jsx(h2,{nodeId:e,isOpen:t}),a.jsx(Ee,{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(Fe,{children:[a.jsx(Ee,{as:"span",children:"Unknown node type: "}),a.jsx(Ee,{as:"span",fontWeight:600,children:r})]})})]}),fpe=u.memo(dpe),ppe=e=>{const{data:t,selected:n}=e,{id:r,type:o,isOpen:s,label:i}=t,c=u.useMemo(()=>le(ke,({nodes:p})=>!!p.nodeTemplates[o]),[o]);return z(c)?a.jsx(upe,{nodeId:r,isOpen:s,label:i,type:o,selected:n}):a.jsx(fpe,{nodeId:r,isOpen:s,label:i,type:o,selected:n})},hpe=u.memo(ppe),mpe=e=>{const{id:t,data:n,selected:r}=e,{notes:o,isOpen:s}=n,i=se(),c=u.useCallback(f=>{i(jA({nodeId:t,value:f.target.value}))},[i,t]);return a.jsxs(o0,{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(h2,{nodeId:t,isOpen:s}),a.jsx(l8,{nodeId:t,title:"Notes"}),a.jsx(Fe,{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(li,{value:o,onChange:c,rows:8,resize:"none",sx:{fontSize:"xs"}})})})})]})},gpe=u.memo(mpe),vpe=["Delete","Backspace"],bpe={collapsed:xfe,default:wfe},xpe={invocation:hpe,current_image:jfe,notes:gpe},ype={hideAttribution:!0},wpe=le(ke,({nodes:e})=>{const{shouldSnapToGrid:t,selectionMode:n}=e;return{shouldSnapToGrid:t,selectionMode:n}},Oe),Cpe=()=>{const e=se(),t=z(j=>j.nodes.nodes),n=z(j=>j.nodes.edges),r=z(j=>j.nodes.viewport),{shouldSnapToGrid:o,selectionMode:s}=z(wpe),i=hfe(),[c]=xa("radii",["base"]),f=u.useCallback(j=>{e(_A(j))},[e]),p=u.useCallback(j=>{e(PA(j))},[e]),h=u.useCallback((j,_)=>{e(IA(_))},[e]),m=u.useCallback(j=>{e(EA(j))},[e]),v=u.useCallback(()=>{e(OA())},[e]),b=u.useCallback(j=>{e(MA(j))},[e]),y=u.useCallback(j=>{e(RA(j))},[e]),x=u.useCallback(({nodes:j,edges:_})=>{e(DA(j?j.map(I=>I.id):[])),e(AA(_?_.map(I=>I.id):[]))},[e]),C=u.useCallback((j,_)=>{e(NA(_))},[e]),k=u.useCallback(()=>{e(y3())},[e]);return St(["Ctrl+c","Meta+c"],j=>{j.preventDefault(),e(TA())}),St(["Ctrl+a","Meta+a"],j=>{j.preventDefault(),e($A())}),St(["Ctrl+v","Meta+v"],j=>{j.preventDefault(),e(LA())}),a.jsx(FA,{id:"workflow-editor",defaultViewport:r,nodeTypes:xpe,edgeTypes:bpe,nodes:t,edges:n,onNodesChange:f,onEdgesChange:p,onEdgesDelete:b,onNodesDelete:y,onConnectStart:h,onConnect:m,onConnectEnd:v,onMoveEnd:C,connectionLineComponent:vfe,onSelectionChange:x,isValidConnection:i,minZoom:.1,snapToGrid:o,snapGrid:[25,25],connectionRadius:30,proOptions:ype,style:{borderRadius:c},onPaneClick:k,deleteKeyCode:vpe,selectionMode:s,children:a.jsx(G9,{})})},Spe=()=>{const e=se(),t=u.useCallback(()=>{e(b3())},[e]);return a.jsx($,{sx:{gap:2,position:"absolute",top:2,insetInlineStart:2},children:a.jsx(tt,{tooltip:"Add Node (Shift+A, Space)","aria-label":"Add Node",icon:a.jsx(Yl,{}),onClick:t})})},kpe=u.memo(Spe),jpe=()=>{const e=se(),t=HP("nodes");return u.useCallback(r=>{if(!r)return;const o=new FileReader;o.onload=async()=>{const s=o.result;try{const i=JSON.parse(String(s)),c=zA.safeParse(i);if(!c.success){const{message:f}=BA(c.error,{prefix:"Workflow Validation Error"});t.error({error:HA(c.error)},f),e(Cn(_n({title:"Unable to Validate Workflow",status:"error",duration:5e3}))),o.abort();return}if(e(ix(c.data.workflow)),!c.data.warnings.length){e(Cn(_n({title:"Workflow Loaded",status:"success"}))),o.abort();return}e(Cn(_n({title:"Workflow Loaded with Warnings",status:"warning"}))),c.data.warnings.forEach(({message:f,...p})=>{t.warn(p,f)}),o.abort()}catch{e(Cn(_n({title:"Unable to Load Workflow",status:"error"})))}},o.readAsText(r)},[e,t])},_pe=u.memo(e=>e.error.issues[0]?a.jsx(Ee,{children:IC(e.error.issues[0],{prefix:null}).toString()}):a.jsx(gf,{children:e.error.issues.map((t,n)=>a.jsx(Fs,{children:a.jsx(Ee,{children:IC(t,{prefix:null}).toString()})},n))}));_pe.displayName="WorkflowValidationErrorContent";const Ppe=()=>{const{t:e}=Ie(),t=u.useRef(null),n=jpe();return a.jsx(cE,{resetRef:t,accept:"application/json",onChange:n,children:r=>a.jsx(tt,{icon:a.jsx(Mg,{}),tooltip:e("nodes.loadWorkflow"),"aria-label":e("nodes.loadWorkflow"),...r})})},Ipe=u.memo(Ppe),Epe=()=>{const{t:e}=Ie(),t=se(),{isOpen:n,onOpen:r,onClose:o}=Ao(),s=u.useRef(null),i=z(f=>f.nodes.nodes.length),c=u.useCallback(()=>{t(WA()),t(Cn(_n({title:e("toast.nodesCleared"),status:"success"}))),o()},[t,e,o]);return a.jsxs(a.Fragment,{children:[a.jsx(tt,{icon:a.jsx(Jo,{}),tooltip:e("nodes.resetWorkflow"),"aria-label":e("nodes.resetWorkflow"),onClick:r,isDisabled:!i,colorScheme:"error"}),a.jsxs(Cf,{isOpen:n,onClose:o,leastDestructiveRef:s,isCentered:!0,children:[a.jsx(Ks,{}),a.jsxs(Sf,{children:[a.jsx(qs,{fontSize:"lg",fontWeight:"bold",children:e("nodes.resetWorkflow")}),a.jsx(Xs,{py:4,children:a.jsxs($,{flexDir:"column",gap:2,children:[a.jsx(Ee,{children:e("nodes.resetWorkflowDesc")}),a.jsx(Ee,{variant:"subtext",children:e("nodes.resetWorkflowDesc2")})]})}),a.jsxs(ka,{children:[a.jsx(iu,{ref:s,onClick:o,children:e("common.cancel")}),a.jsx(iu,{colorScheme:"error",ml:3,onClick:c,children:e("common.accept")})]})]})]})]})},Ope=u.memo(Epe),Mpe=()=>{const{t:e}=Ie(),t=uM(),n=u.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(tt,{icon:a.jsx(Ig,{}),tooltip:e("nodes.downloadWorkflow"),"aria-label":e("nodes.downloadWorkflow"),onClick:n})},Rpe=u.memo(Mpe),Dpe=()=>a.jsxs($,{sx:{gap:2,position:"absolute",top:2,insetInlineStart:"50%",transform:"translate(-50%)"},children:[a.jsx(Rpe,{}),a.jsx(Ipe,{}),a.jsx(Ope,{})]}),Ape=u.memo(Dpe),Npe=()=>a.jsx($,{sx:{gap:2,flexDir:"column"},children:uo(lf,({title:e,description:t,color:n},r)=>a.jsx(Mn,{label:t,children:a.jsx(hi,{sx:{userSelect:"none",color:parseInt(n.split(".")[1]??"0",10)<500?"base.800":"base.50",bg:n},textAlign:"center",children:e})},r))}),Tpe=u.memo(Npe),$pe=()=>{const{t:e}=Ie(),t=se(),n=u.useCallback(()=>{t(VA())},[t]);return a.jsx(Wt,{leftIcon:a.jsx(AJ,{}),tooltip:e("nodes.reloadNodeTemplates"),"aria-label":e("nodes.reloadNodeTemplates"),onClick:n,children:e("nodes.reloadNodeTemplates")})},Lpe=u.memo($pe),hd={fontWeight:600},Fpe=le(ke,({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===UA.Full}},Oe),zpe=Te((e,t)=>{const{isOpen:n,onOpen:r,onClose:o}=Ao(),s=se(),{shouldAnimateEdges:i,shouldValidateGraph:c,shouldSnapToGrid:f,shouldColorEdges:p,selectionModeIsChecked:h}=z(Fpe),m=u.useCallback(C=>{s(GA(C.target.checked))},[s]),v=u.useCallback(C=>{s(qA(C.target.checked))},[s]),b=u.useCallback(C=>{s(KA(C.target.checked))},[s]),y=u.useCallback(C=>{s(XA(C.target.checked))},[s]),x=u.useCallback(C=>{s(QA(C.target.checked))},[s]);return a.jsxs(a.Fragment,{children:[a.jsx(tt,{ref:t,"aria-label":"Workflow Editor Settings",tooltip:"Workflow Editor Settings",icon:a.jsx(TE,{}),onClick:r}),a.jsxs(Tl,{isOpen:n,onClose:o,size:"2xl",isCentered:!0,children:[a.jsx(Ks,{}),a.jsxs($l,{children:[a.jsx(qs,{children:"Workflow Editor Settings"}),a.jsx(kf,{}),a.jsx(Xs,{children:a.jsxs($,{sx:{flexDirection:"column",gap:4,py:4},children:[a.jsx(ds,{size:"sm",children:"General"}),a.jsx(qn,{formLabelProps:hd,onChange:v,isChecked:i,label:"Animated Edges",helperText:"Animate selected edges and edges connected to selected nodes"}),a.jsx(Ko,{}),a.jsx(qn,{formLabelProps:hd,isChecked:f,onChange:b,label:"Snap to Grid",helperText:"Snap nodes to grid when moved"}),a.jsx(Ko,{}),a.jsx(qn,{formLabelProps:hd,isChecked:p,onChange:y,label:"Color-Code Edges",helperText:"Color-code edges according to their connected fields"}),a.jsx(qn,{formLabelProps:hd,isChecked:h,onChange:x,label:"Fully Contain Nodes to Select",helperText:"Nodes must be fully inside the selection box to be selected"}),a.jsx(ds,{size:"sm",pt:4,children:"Advanced"}),a.jsx(qn,{formLabelProps:hd,isChecked:c,onChange:m,label:"Validate Connections and Graph",helperText:"Prevent invalid connections from being made, and invalid graphs from being invoked"}),a.jsx(Lpe,{})]})})]})]})]})}),Bpe=u.memo(zpe),Hpe=()=>{const e=z(t=>t.nodes.shouldShowFieldTypeLegend);return a.jsxs($,{sx:{gap:2,position:"absolute",top:2,insetInlineEnd:2},children:[a.jsx(Bpe,{}),e&&a.jsx(Tpe,{})]})},Wpe=u.memo(Hpe);function Vpe(){const e=se(),t=z(r=>r.nodes.nodeOpacity),n=u.useCallback(r=>{e(YA(r))},[e]);return a.jsx($,{alignItems:"center",children:a.jsxs(ty,{"aria-label":"Node Opacity",value:t,min:.5,max:1,step:.01,onChange:n,orientation:"vertical",defaultValue:30,h:"calc(100% - 0.5rem)",children:[a.jsx(ry,{children:a.jsx(oy,{})}),a.jsx(ny,{})]})})}function Upe(e){return Je({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 Gpe(e){return Je({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 qpe(e){return Je({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 Kpe=()=>{const{t:e}=Ie(),{zoomIn:t,zoomOut:n,fitView:r}=px(),o=se(),s=z(h=>h.nodes.shouldShowMinimapPanel),i=u.useCallback(()=>{t()},[t]),c=u.useCallback(()=>{n()},[n]),f=u.useCallback(()=>{r()},[r]),p=u.useCallback(()=>{o(JA(!s))},[s,o]);return a.jsxs(vr,{isAttached:!0,orientation:"vertical",children:[a.jsx(tt,{tooltip:e("nodes.zoomInNodes"),"aria-label":e("nodes.zoomInNodes"),onClick:i,icon:a.jsx(qpe,{})}),a.jsx(tt,{tooltip:e("nodes.zoomOutNodes"),"aria-label":e("nodes.zoomOutNodes"),onClick:c,icon:a.jsx(Gpe,{})}),a.jsx(tt,{tooltip:e("nodes.fitViewportNodes"),"aria-label":e("nodes.fitViewportNodes"),onClick:f,icon:a.jsx(mJ,{})}),a.jsx(tt,{tooltip:e(s?"nodes.hideMinimapnodes":"nodes.showMinimapnodes"),"aria-label":e(s?"nodes.hideMinimapnodes":"nodes.showMinimapnodes"),isChecked:s,onClick:p,icon:a.jsx(jJ,{})})]})},Xpe=u.memo(Kpe),Qpe=()=>a.jsxs($,{sx:{gap:2,position:"absolute",bottom:2,insetInlineStart:2},children:[a.jsx(Xpe,{}),a.jsx(Vpe,{})]}),Ype=u.memo(Qpe),Jpe=Me(z9),Zpe=()=>{const e=z(r=>r.nodes.shouldShowMinimapPanel),t=Rl("var(--invokeai-colors-accent-300)","var(--invokeai-colors-accent-600)"),n=Rl("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(Jpe,{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})})},ehe=u.memo(Zpe),the=()=>{const e=z(t=>t.nodes.isReady);return a.jsxs($,{layerStyle:"first",sx:{position:"relative",width:"full",height:"full",borderRadius:"base",alignItems:"center",justifyContent:"center"},children:[a.jsx(co,{children:e&&a.jsxs(yr.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(Cpe,{}),a.jsx(wde,{}),a.jsx(kpe,{}),a.jsx(Ape,{}),a.jsx(Wpe,{}),a.jsx(Ype,{}),a.jsx(ehe,{})]})}),a.jsx(co,{children:!e&&a.jsx(yr.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(lo,{label:"Loading Nodes...",icon:Gg})})})})]})},nhe=u.memo(the),rhe=()=>a.jsx(ZA,{children:a.jsx(nhe,{})}),ohe=u.memo(rhe),she=()=>a.jsx(HM,{}),ahe=u.memo(she);var Xb={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Konva=void 0;var n=EC;Object.defineProperty(t,"Konva",{enumerable:!0,get:function(){return n.Konva}});const r=EC;e.exports=r.Konva})(Xb,Xb.exports);var ihe=Xb.exports;const Jd=Cu(ihe);var h8={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 lhe=function(t){var n={},r=u,o=oh,s=Object.assign;function i(l){for(var d="https://reactjs.org/docs/error-decoder.html?invariant="+l,g=1;g<arguments.length;g++)d+="&args[]="+encodeURIComponent(arguments[g]);return"Minified React error #"+l+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var c=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,f=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"),C=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),I=Symbol.for("react.offscreen"),O=Symbol.iterator;function E(l){return l===null||typeof l!="object"?null:(l=O&&l[O]||l["@@iterator"],typeof l=="function"?l:null)}function M(l){if(l==null)return null;if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case h:return"Fragment";case p:return"Portal";case v:return"Profiler";case m:return"StrictMode";case C:return"Suspense";case k:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case y:return(l.displayName||"Context")+".Consumer";case b:return(l._context.displayName||"Context")+".Provider";case x:var d=l.render;return l=l.displayName,l||(l=d.displayName||d.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case j:return d=l.displayName||null,d!==null?d:M(l.type)||"Memo";case _:d=l._payload,l=l._init;try{return M(l(d))}catch{}}return null}function R(l){var d=l.type;switch(l.tag){case 24:return"Cache";case 9:return(d.displayName||"Context")+".Consumer";case 10:return(d._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return l=d.render,l=l.displayName||l.name||"",d.displayName||(l!==""?"ForwardRef("+l+")":"ForwardRef");case 7:return"Fragment";case 5:return d;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return M(d);case 8:return d===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 d=="function")return d.displayName||d.name||null;if(typeof d=="string")return d}return null}function A(l){var d=l,g=l;if(l.alternate)for(;d.return;)d=d.return;else{l=d;do d=l,d.flags&4098&&(g=d.return),l=d.return;while(l)}return d.tag===3?g:null}function D(l){if(A(l)!==l)throw Error(i(188))}function T(l){var d=l.alternate;if(!d){if(d=A(l),d===null)throw Error(i(188));return d!==l?null:l}for(var g=l,w=d;;){var S=g.return;if(S===null)break;var P=S.alternate;if(P===null){if(w=S.return,w!==null){g=w;continue}break}if(S.child===P.child){for(P=S.child;P;){if(P===g)return D(S),l;if(P===w)return D(S),d;P=P.sibling}throw Error(i(188))}if(g.return!==w.return)g=S,w=P;else{for(var N=!1,Z=S.child;Z;){if(Z===g){N=!0,g=S,w=P;break}if(Z===w){N=!0,w=S,g=P;break}Z=Z.sibling}if(!N){for(Z=P.child;Z;){if(Z===g){N=!0,g=P,w=S;break}if(Z===w){N=!0,w=P,g=S;break}Z=Z.sibling}if(!N)throw Error(i(189))}}if(g.alternate!==w)throw Error(i(190))}if(g.tag!==3)throw Error(i(188));return g.stateNode.current===g?l:d}function K(l){return l=T(l),l!==null?B(l):null}function B(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){var d=B(l);if(d!==null)return d;l=l.sibling}return null}function G(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){if(l.tag!==4){var d=G(l);if(d!==null)return d}l=l.sibling}return null}var Q=Array.isArray,V=t.getPublicInstance,L=t.getRootHostContext,X=t.getChildHostContext,F=t.prepareForCommit,q=t.resetAfterCommit,te=t.createInstance,Y=t.appendInitialChild,ce=t.finalizeInitialChildren,ae=t.prepareUpdate,U=t.shouldSetTextContent,W=t.createTextInstance,ne=t.scheduleTimeout,ie=t.cancelTimeout,oe=t.noTimeout,me=t.isPrimaryRenderer,fe=t.supportsMutation,he=t.supportsPersistence,Ce=t.supportsHydration,xe=t.getInstanceFromNode,de=t.preparePortalMount,Ne=t.getCurrentEventPriority,De=t.detachDeletedInstance,Xe=t.supportsMicrotasks,It=t.scheduleMicrotask,lt=t.supportsTestSelectors,on=t.findFiberRoot,gt=t.getBoundingRect,bt=t.getTextContent,ye=t.isHiddenSubtree,We=t.matchAccessibilityRole,Et=t.setFocusIfFocusable,zt=t.setupIntersectionObserver,we=t.appendChild,xt=t.appendChildToContainer,Nt=t.commitTextUpdate,Lt=t.commitMount,$e=t.commitUpdate,Ke=t.insertBefore,vn=t.insertInContainerBefore,_e=t.removeChild,Ze=t.removeChildFromContainer,Qe=t.resetTextContent,ct=t.hideInstance,Ft=t.hideTextInstance,ir=t.unhideInstance,pn=t.unhideTextInstance,ln=t.clearContainer,Ur=t.cloneInstance,wr=t.createContainerChildSet,Hn=t.appendChildToContainerChildSet,Wn=t.finalizeContainerChildren,Vn=t.replaceContainerChildren,Lr=t.cloneHiddenInstance,Lo=t.cloneHiddenTextInstance,Gr=t.canHydrateInstance,qr=t.canHydrateTextInstance,js=t.canHydrateSuspenseInstance,Fr=t.isSuspenseInstancePending,na=t.isSuspenseInstanceFallback,_s=t.getSuspenseInstanceFallbackErrorDetails,Ta=t.registerSuspenseInstanceRetry,ra=t.getNextHydratableSibling,J=t.getFirstHydratableChild,ee=t.getFirstHydratableChildWithinContainer,ge=t.getFirstHydratableChildWithinSuspenseInstance,je=t.hydrateInstance,ve=t.hydrateTextInstance,dt=t.hydrateSuspenseInstance,st=t.getNextHydratableInstanceAfterSuspenseInstance,Vt=t.commitHydratedContainer,ft=t.commitHydratedSuspenseInstance,yt=t.clearSuspenseBoundary,He=t.clearSuspenseBoundaryFromContainer,Se=t.shouldDeleteUnhydratedTailInstances,et=t.didNotMatchHydratedContainerTextInstance,kt=t.didNotMatchHydratedTextInstance,Ot;function $t(l){if(Ot===void 0)try{throw Error()}catch(g){var d=g.stack.trim().match(/\n( *(at )?)/);Ot=d&&d[1]||""}return`
`+Ot+l}var Xt=!1;function tn(l,d){if(!l||Xt)return"";Xt=!0;var g=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(d)if(d=function(){throw Error()},Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(ze){var w=ze}Reflect.construct(l,[],d)}else{try{d.call()}catch(ze){w=ze}l.call(d.prototype)}else{try{throw Error()}catch(ze){w=ze}l()}}catch(ze){if(ze&&w&&typeof ze.stack=="string"){for(var S=ze.stack.split(`
`),P=w.stack.split(`
`),N=S.length-1,Z=P.length-1;1<=N&&0<=Z&&S[N]!==P[Z];)Z--;for(;1<=N&&0<=Z;N--,Z--)if(S[N]!==P[Z]){if(N!==1||Z!==1)do if(N--,Z--,0>Z||S[N]!==P[Z]){var pe=`
`+S[N].replace(" at new "," at ");return l.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",l.displayName)),pe}while(1<=N&&0<=Z);break}}}finally{Xt=!1,Error.prepareStackTrace=g}return(l=l?l.displayName||l.name:"")?$t(l):""}var en=Object.prototype.hasOwnProperty,qt=[],Be=-1;function vt(l){return{current:l}}function Dt(l){0>Be||(l.current=qt[Be],qt[Be]=null,Be--)}function Ut(l,d){Be++,qt[Be]=l.current,l.current=d}var In={},Kt=vt(In),un=vt(!1),sn=In;function Mr(l,d){var g=l.type.contextTypes;if(!g)return In;var w=l.stateNode;if(w&&w.__reactInternalMemoizedUnmaskedChildContext===d)return w.__reactInternalMemoizedMaskedChildContext;var S={},P;for(P in g)S[P]=d[P];return w&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=d,l.__reactInternalMemoizedMaskedChildContext=S),S}function Zn(l){return l=l.childContextTypes,l!=null}function Pt(){Dt(un),Dt(Kt)}function En(l,d,g){if(Kt.current!==In)throw Error(i(168));Ut(Kt,d),Ut(un,g)}function Rn(l,d,g){var w=l.stateNode;if(d=d.childContextTypes,typeof w.getChildContext!="function")return g;w=w.getChildContext();for(var S in w)if(!(S in d))throw Error(i(108,R(l)||"Unknown",S));return s({},g,w)}function er(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||In,sn=Kt.current,Ut(Kt,l),Ut(un,un.current),!0}function hr(l,d,g){var w=l.stateNode;if(!w)throw Error(i(169));g?(l=Rn(l,d,sn),w.__reactInternalMemoizedMergedChildContext=l,Dt(un),Dt(Kt),Ut(Kt,l)):Dt(un),Ut(un,g)}var Tn=Math.clz32?Math.clz32:Sn,$n=Math.log,dn=Math.LN2;function Sn(l){return l>>>=0,l===0?32:31-($n(l)/dn|0)|0}var On=64,bn=4194304;function xn(l){switch(l&-l){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 l&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return l&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return l}}function Ye(l,d){var g=l.pendingLanes;if(g===0)return 0;var w=0,S=l.suspendedLanes,P=l.pingedLanes,N=g&268435455;if(N!==0){var Z=N&~S;Z!==0?w=xn(Z):(P&=N,P!==0&&(w=xn(P)))}else N=g&~S,N!==0?w=xn(N):P!==0&&(w=xn(P));if(w===0)return 0;if(d!==0&&d!==w&&!(d&S)&&(S=w&-w,P=d&-d,S>=P||S===16&&(P&4194240)!==0))return d;if(w&4&&(w|=g&16),d=l.entangledLanes,d!==0)for(l=l.entanglements,d&=w;0<d;)g=31-Tn(d),S=1<<g,w|=l[g],d&=~S;return w}function Mt(l,d){switch(l){case 1:case 2:case 4:return d+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 d+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 Ct(l,d){for(var g=l.suspendedLanes,w=l.pingedLanes,S=l.expirationTimes,P=l.pendingLanes;0<P;){var N=31-Tn(P),Z=1<<N,pe=S[N];pe===-1?(!(Z&g)||Z&w)&&(S[N]=Mt(Z,d)):pe<=d&&(l.expiredLanes|=Z),P&=~Z}}function at(l){return l=l.pendingLanes&-1073741825,l!==0?l:l&1073741824?1073741824:0}function wt(){var l=On;return On<<=1,!(On&4194240)&&(On=64),l}function Bt(l){for(var d=[],g=0;31>g;g++)d.push(l);return d}function ht(l,d,g){l.pendingLanes|=d,d!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,d=31-Tn(d),l[d]=g}function ot(l,d){var g=l.pendingLanes&~d;l.pendingLanes=d,l.suspendedLanes=0,l.pingedLanes=0,l.expiredLanes&=d,l.mutableReadLanes&=d,l.entangledLanes&=d,d=l.entanglements;var w=l.eventTimes;for(l=l.expirationTimes;0<g;){var S=31-Tn(g),P=1<<S;d[S]=0,w[S]=-1,l[S]=-1,g&=~P}}function Ae(l,d){var g=l.entangledLanes|=d;for(l=l.entanglements;g;){var w=31-Tn(g),S=1<<w;S&d|l[w]&d&&(l[w]|=d),g&=~S}}var Re=0;function Le(l){return l&=-l,1<l?4<l?l&268435455?16:536870912:4:1}var Ve=o.unstable_scheduleCallback,nt=o.unstable_cancelCallback,At=o.unstable_shouldYield,Rt=o.unstable_requestPaint,Ue=o.unstable_now,nn=o.unstable_ImmediatePriority,yn=o.unstable_UserBlockingPriority,hn=o.unstable_NormalPriority,mr=o.unstable_IdlePriority,Xn=null,gn=null;function Un(l){if(gn&&typeof gn.onCommitFiberRoot=="function")try{gn.onCommitFiberRoot(Xn,l,void 0,(l.current.flags&128)===128)}catch{}}function po(l,d){return l===d&&(l!==0||1/l===1/d)||l!==l&&d!==d}var fn=typeof Object.is=="function"?Object.is:po,Ln=null,Kr=!1,Rr=!1;function vi(l){Ln===null?Ln=[l]:Ln.push(l)}function Tf(l){Kr=!0,vi(l)}function Fo(){if(!Rr&&Ln!==null){Rr=!0;var l=0,d=Re;try{var g=Ln;for(Re=1;l<g.length;l++){var w=g[l];do w=w(!0);while(w!==null)}Ln=null,Kr=!1}catch(S){throw Ln!==null&&(Ln=Ln.slice(l+1)),Ve(nn,Fo),S}finally{Re=d,Rr=!1}}return null}var $a=[],oa=0,La=null,ho=0,mo=[],go=0,Zo=null,zo=1,eo="";function ol(l,d){$a[oa++]=ho,$a[oa++]=La,La=l,ho=d}function x2(l,d,g){mo[go++]=zo,mo[go++]=eo,mo[go++]=Zo,Zo=l;var w=zo;l=eo;var S=32-Tn(w)-1;w&=~(1<<S),g+=1;var P=32-Tn(d)+S;if(30<P){var N=S-S%5;P=(w&(1<<N)-1).toString(32),w>>=N,S-=N,zo=1<<32-Tn(d)+S|g<<S|w,eo=P+l}else zo=1<<P|g<<S|w,eo=l}function a0(l){l.return!==null&&(ol(l,1),x2(l,1,0))}function i0(l){for(;l===La;)La=$a[--oa],$a[oa]=null,ho=$a[--oa],$a[oa]=null;for(;l===Zo;)Zo=mo[--go],mo[go]=null,eo=mo[--go],mo[go]=null,zo=mo[--go],mo[go]=null}var Bo=null,es=null,tr=!1,Bu=!1,Ps=null;function y2(l,d){var g=ss(5,null,null,0);g.elementType="DELETED",g.stateNode=d,g.return=l,d=l.deletions,d===null?(l.deletions=[g],l.flags|=16):d.push(g)}function w2(l,d){switch(l.tag){case 5:return d=Gr(d,l.type,l.pendingProps),d!==null?(l.stateNode=d,Bo=l,es=J(d),!0):!1;case 6:return d=qr(d,l.pendingProps),d!==null?(l.stateNode=d,Bo=l,es=null,!0):!1;case 13:if(d=js(d),d!==null){var g=Zo!==null?{id:zo,overflow:eo}:null;return l.memoizedState={dehydrated:d,treeContext:g,retryLane:1073741824},g=ss(18,null,null,0),g.stateNode=d,g.return=l,l.child=g,Bo=l,es=null,!0}return!1;default:return!1}}function l0(l){return(l.mode&1)!==0&&(l.flags&128)===0}function c0(l){if(tr){var d=es;if(d){var g=d;if(!w2(l,d)){if(l0(l))throw Error(i(418));d=ra(g);var w=Bo;d&&w2(l,d)?y2(w,g):(l.flags=l.flags&-4097|2,tr=!1,Bo=l)}}else{if(l0(l))throw Error(i(418));l.flags=l.flags&-4097|2,tr=!1,Bo=l}}}function C2(l){for(l=l.return;l!==null&&l.tag!==5&&l.tag!==3&&l.tag!==13;)l=l.return;Bo=l}function $f(l){if(!Ce||l!==Bo)return!1;if(!tr)return C2(l),tr=!0,!1;if(l.tag!==3&&(l.tag!==5||Se(l.type)&&!U(l.type,l.memoizedProps))){var d=es;if(d){if(l0(l))throw S2(),Error(i(418));for(;d;)y2(l,d),d=ra(d)}}if(C2(l),l.tag===13){if(!Ce)throw Error(i(316));if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(i(317));es=st(l)}else es=Bo?ra(l.stateNode):null;return!0}function S2(){for(var l=es;l;)l=ra(l)}function nc(){Ce&&(es=Bo=null,Bu=tr=!1)}function u0(l){Ps===null?Ps=[l]:Ps.push(l)}var _8=c.ReactCurrentBatchConfig;function Lf(l,d){if(fn(l,d))return!0;if(typeof l!="object"||l===null||typeof d!="object"||d===null)return!1;var g=Object.keys(l),w=Object.keys(d);if(g.length!==w.length)return!1;for(w=0;w<g.length;w++){var S=g[w];if(!en.call(d,S)||!fn(l[S],d[S]))return!1}return!0}function P8(l){switch(l.tag){case 5:return $t(l.type);case 16:return $t("Lazy");case 13:return $t("Suspense");case 19:return $t("SuspenseList");case 0:case 2:case 15:return l=tn(l.type,!1),l;case 11:return l=tn(l.type.render,!1),l;case 1:return l=tn(l.type,!0),l;default:return""}}function Is(l,d){if(l&&l.defaultProps){d=s({},d),l=l.defaultProps;for(var g in l)d[g]===void 0&&(d[g]=l[g]);return d}return d}var Ff=vt(null),zf=null,rc=null,d0=null;function f0(){d0=rc=zf=null}function k2(l,d,g){me?(Ut(Ff,d._currentValue),d._currentValue=g):(Ut(Ff,d._currentValue2),d._currentValue2=g)}function p0(l){var d=Ff.current;Dt(Ff),me?l._currentValue=d:l._currentValue2=d}function h0(l,d,g){for(;l!==null;){var w=l.alternate;if((l.childLanes&d)!==d?(l.childLanes|=d,w!==null&&(w.childLanes|=d)):w!==null&&(w.childLanes&d)!==d&&(w.childLanes|=d),l===g)break;l=l.return}}function oc(l,d){zf=l,d0=rc=null,l=l.dependencies,l!==null&&l.firstContext!==null&&(l.lanes&d&&(Co=!0),l.firstContext=null)}function ts(l){var d=me?l._currentValue:l._currentValue2;if(d0!==l)if(l={context:l,memoizedValue:d,next:null},rc===null){if(zf===null)throw Error(i(308));rc=l,zf.dependencies={lanes:0,firstContext:l}}else rc=rc.next=l;return d}var sl=null;function m0(l){sl===null?sl=[l]:sl.push(l)}function j2(l,d,g,w){var S=d.interleaved;return S===null?(g.next=g,m0(d)):(g.next=S.next,S.next=g),d.interleaved=g,sa(l,w)}function sa(l,d){l.lanes|=d;var g=l.alternate;for(g!==null&&(g.lanes|=d),g=l,l=l.return;l!==null;)l.childLanes|=d,g=l.alternate,g!==null&&(g.childLanes|=d),g=l,l=l.return;return g.tag===3?g.stateNode:null}var bi=!1;function g0(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function _2(l,d){l=l.updateQueue,d.updateQueue===l&&(d.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,effects:l.effects})}function Fa(l,d){return{eventTime:l,lane:d,tag:0,payload:null,callback:null,next:null}}function xi(l,d,g){var w=l.updateQueue;if(w===null)return null;if(w=w.shared,an&2){var S=w.pending;return S===null?d.next=d:(d.next=S.next,S.next=d),w.pending=d,sa(l,g)}return S=w.interleaved,S===null?(d.next=d,m0(w)):(d.next=S.next,S.next=d),w.interleaved=d,sa(l,g)}function Bf(l,d,g){if(d=d.updateQueue,d!==null&&(d=d.shared,(g&4194240)!==0)){var w=d.lanes;w&=l.pendingLanes,g|=w,d.lanes=g,Ae(l,g)}}function P2(l,d){var g=l.updateQueue,w=l.alternate;if(w!==null&&(w=w.updateQueue,g===w)){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=d:P=P.next=d}else S=P=d;g={baseState:w.baseState,firstBaseUpdate:S,lastBaseUpdate:P,shared:w.shared,effects:w.effects},l.updateQueue=g;return}l=g.lastBaseUpdate,l===null?g.firstBaseUpdate=d:l.next=d,g.lastBaseUpdate=d}function Hf(l,d,g,w){var S=l.updateQueue;bi=!1;var P=S.firstBaseUpdate,N=S.lastBaseUpdate,Z=S.shared.pending;if(Z!==null){S.shared.pending=null;var pe=Z,ze=pe.next;pe.next=null,N===null?P=ze:N.next=ze,N=pe;var mt=l.alternate;mt!==null&&(mt=mt.updateQueue,Z=mt.lastBaseUpdate,Z!==N&&(Z===null?mt.firstBaseUpdate=ze:Z.next=ze,mt.lastBaseUpdate=pe))}if(P!==null){var Jt=S.baseState;N=0,mt=ze=pe=null,Z=P;do{var it=Z.lane,Qn=Z.eventTime;if((w&it)===it){mt!==null&&(mt=mt.next={eventTime:Qn,lane:0,tag:Z.tag,payload:Z.payload,callback:Z.callback,next:null});e:{var Fn=l,jo=Z;switch(it=d,Qn=g,jo.tag){case 1:if(Fn=jo.payload,typeof Fn=="function"){Jt=Fn.call(Qn,Jt,it);break e}Jt=Fn;break e;case 3:Fn.flags=Fn.flags&-65537|128;case 0:if(Fn=jo.payload,it=typeof Fn=="function"?Fn.call(Qn,Jt,it):Fn,it==null)break e;Jt=s({},Jt,it);break e;case 2:bi=!0}}Z.callback!==null&&Z.lane!==0&&(l.flags|=64,it=S.effects,it===null?S.effects=[Z]:it.push(Z))}else Qn={eventTime:Qn,lane:it,tag:Z.tag,payload:Z.payload,callback:Z.callback,next:null},mt===null?(ze=mt=Qn,pe=Jt):mt=mt.next=Qn,N|=it;if(Z=Z.next,Z===null){if(Z=S.shared.pending,Z===null)break;it=Z,Z=it.next,it.next=null,S.lastBaseUpdate=it,S.shared.pending=null}}while(1);if(mt===null&&(pe=Jt),S.baseState=pe,S.firstBaseUpdate=ze,S.lastBaseUpdate=mt,d=S.shared.interleaved,d!==null){S=d;do N|=S.lane,S=S.next;while(S!==d)}else P===null&&(S.shared.lanes=0);il|=N,l.lanes=N,l.memoizedState=Jt}}function I2(l,d,g){if(l=d.effects,d.effects=null,l!==null)for(d=0;d<l.length;d++){var w=l[d],S=w.callback;if(S!==null){if(w.callback=null,w=g,typeof S!="function")throw Error(i(191,S));S.call(w)}}}var E2=new r.Component().refs;function v0(l,d,g,w){d=l.memoizedState,g=g(w,d),g=g==null?d:s({},d,g),l.memoizedState=g,l.lanes===0&&(l.updateQueue.baseState=g)}var Wf={isMounted:function(l){return(l=l._reactInternals)?A(l)===l:!1},enqueueSetState:function(l,d,g){l=l._reactInternals;var w=oo(),S=Ci(l),P=Fa(w,S);P.payload=d,g!=null&&(P.callback=g),d=xi(l,P,S),d!==null&&(os(d,l,S,w),Bf(d,l,S))},enqueueReplaceState:function(l,d,g){l=l._reactInternals;var w=oo(),S=Ci(l),P=Fa(w,S);P.tag=1,P.payload=d,g!=null&&(P.callback=g),d=xi(l,P,S),d!==null&&(os(d,l,S,w),Bf(d,l,S))},enqueueForceUpdate:function(l,d){l=l._reactInternals;var g=oo(),w=Ci(l),S=Fa(g,w);S.tag=2,d!=null&&(S.callback=d),d=xi(l,S,w),d!==null&&(os(d,l,w,g),Bf(d,l,w))}};function O2(l,d,g,w,S,P,N){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(w,P,N):d.prototype&&d.prototype.isPureReactComponent?!Lf(g,w)||!Lf(S,P):!0}function M2(l,d,g){var w=!1,S=In,P=d.contextType;return typeof P=="object"&&P!==null?P=ts(P):(S=Zn(d)?sn:Kt.current,w=d.contextTypes,P=(w=w!=null)?Mr(l,S):In),d=new d(g,P),l.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=Wf,l.stateNode=d,d._reactInternals=l,w&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=S,l.__reactInternalMemoizedMaskedChildContext=P),d}function R2(l,d,g,w){l=d.state,typeof d.componentWillReceiveProps=="function"&&d.componentWillReceiveProps(g,w),typeof d.UNSAFE_componentWillReceiveProps=="function"&&d.UNSAFE_componentWillReceiveProps(g,w),d.state!==l&&Wf.enqueueReplaceState(d,d.state,null)}function b0(l,d,g,w){var S=l.stateNode;S.props=g,S.state=l.memoizedState,S.refs=E2,g0(l);var P=d.contextType;typeof P=="object"&&P!==null?S.context=ts(P):(P=Zn(d)?sn:Kt.current,S.context=Mr(l,P)),S.state=l.memoizedState,P=d.getDerivedStateFromProps,typeof P=="function"&&(v0(l,d,P,g),S.state=l.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(d=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),d!==S.state&&Wf.enqueueReplaceState(S,S.state,null),Hf(l,g,S,w),S.state=l.memoizedState),typeof S.componentDidMount=="function"&&(l.flags|=4194308)}function Hu(l,d,g){if(l=g.ref,l!==null&&typeof l!="function"&&typeof l!="object"){if(g._owner){if(g=g._owner,g){if(g.tag!==1)throw Error(i(309));var w=g.stateNode}if(!w)throw Error(i(147,l));var S=w,P=""+l;return d!==null&&d.ref!==null&&typeof d.ref=="function"&&d.ref._stringRef===P?d.ref:(d=function(N){var Z=S.refs;Z===E2&&(Z=S.refs={}),N===null?delete Z[P]:Z[P]=N},d._stringRef=P,d)}if(typeof l!="string")throw Error(i(284));if(!g._owner)throw Error(i(290,l))}return l}function Vf(l,d){throw l=Object.prototype.toString.call(d),Error(i(31,l==="[object Object]"?"object with keys {"+Object.keys(d).join(", ")+"}":l))}function D2(l){var d=l._init;return d(l._payload)}function A2(l){function d(ue,re){if(l){var be=ue.deletions;be===null?(ue.deletions=[re],ue.flags|=16):be.push(re)}}function g(ue,re){if(!l)return null;for(;re!==null;)d(ue,re),re=re.sibling;return null}function w(ue,re){for(ue=new Map;re!==null;)re.key!==null?ue.set(re.key,re):ue.set(re.index,re),re=re.sibling;return ue}function S(ue,re){return ue=ki(ue,re),ue.index=0,ue.sibling=null,ue}function P(ue,re,be){return ue.index=be,l?(be=ue.alternate,be!==null?(be=be.index,be<re?(ue.flags|=2,re):be):(ue.flags|=2,re)):(ue.flags|=1048576,re)}function N(ue){return l&&ue.alternate===null&&(ue.flags|=2),ue}function Z(ue,re,be,ut){return re===null||re.tag!==6?(re=sv(be,ue.mode,ut),re.return=ue,re):(re=S(re,be),re.return=ue,re)}function pe(ue,re,be,ut){var Tt=be.type;return Tt===h?mt(ue,re,be.props.children,ut,be.key):re!==null&&(re.elementType===Tt||typeof Tt=="object"&&Tt!==null&&Tt.$$typeof===_&&D2(Tt)===re.type)?(ut=S(re,be.props),ut.ref=Hu(ue,re,be),ut.return=ue,ut):(ut=gp(be.type,be.key,be.props,null,ue.mode,ut),ut.ref=Hu(ue,re,be),ut.return=ue,ut)}function ze(ue,re,be,ut){return re===null||re.tag!==4||re.stateNode.containerInfo!==be.containerInfo||re.stateNode.implementation!==be.implementation?(re=av(be,ue.mode,ut),re.return=ue,re):(re=S(re,be.children||[]),re.return=ue,re)}function mt(ue,re,be,ut,Tt){return re===null||re.tag!==7?(re=dl(be,ue.mode,ut,Tt),re.return=ue,re):(re=S(re,be),re.return=ue,re)}function Jt(ue,re,be){if(typeof re=="string"&&re!==""||typeof re=="number")return re=sv(""+re,ue.mode,be),re.return=ue,re;if(typeof re=="object"&&re!==null){switch(re.$$typeof){case f:return be=gp(re.type,re.key,re.props,null,ue.mode,be),be.ref=Hu(ue,null,re),be.return=ue,be;case p:return re=av(re,ue.mode,be),re.return=ue,re;case _:var ut=re._init;return Jt(ue,ut(re._payload),be)}if(Q(re)||E(re))return re=dl(re,ue.mode,be,null),re.return=ue,re;Vf(ue,re)}return null}function it(ue,re,be,ut){var Tt=re!==null?re.key:null;if(typeof be=="string"&&be!==""||typeof be=="number")return Tt!==null?null:Z(ue,re,""+be,ut);if(typeof be=="object"&&be!==null){switch(be.$$typeof){case f:return be.key===Tt?pe(ue,re,be,ut):null;case p:return be.key===Tt?ze(ue,re,be,ut):null;case _:return Tt=be._init,it(ue,re,Tt(be._payload),ut)}if(Q(be)||E(be))return Tt!==null?null:mt(ue,re,be,ut,null);Vf(ue,be)}return null}function Qn(ue,re,be,ut,Tt){if(typeof ut=="string"&&ut!==""||typeof ut=="number")return ue=ue.get(be)||null,Z(re,ue,""+ut,Tt);if(typeof ut=="object"&&ut!==null){switch(ut.$$typeof){case f:return ue=ue.get(ut.key===null?be:ut.key)||null,pe(re,ue,ut,Tt);case p:return ue=ue.get(ut.key===null?be:ut.key)||null,ze(re,ue,ut,Tt);case _:var rn=ut._init;return Qn(ue,re,be,rn(ut._payload),Tt)}if(Q(ut)||E(ut))return ue=ue.get(be)||null,mt(re,ue,ut,Tt,null);Vf(re,ut)}return null}function Fn(ue,re,be,ut){for(var Tt=null,rn=null,Zt=re,kn=re=0,Hr=null;Zt!==null&&kn<be.length;kn++){Zt.index>kn?(Hr=Zt,Zt=null):Hr=Zt.sibling;var jn=it(ue,Zt,be[kn],ut);if(jn===null){Zt===null&&(Zt=Hr);break}l&&Zt&&jn.alternate===null&&d(ue,Zt),re=P(jn,re,kn),rn===null?Tt=jn:rn.sibling=jn,rn=jn,Zt=Hr}if(kn===be.length)return g(ue,Zt),tr&&ol(ue,kn),Tt;if(Zt===null){for(;kn<be.length;kn++)Zt=Jt(ue,be[kn],ut),Zt!==null&&(re=P(Zt,re,kn),rn===null?Tt=Zt:rn.sibling=Zt,rn=Zt);return tr&&ol(ue,kn),Tt}for(Zt=w(ue,Zt);kn<be.length;kn++)Hr=Qn(Zt,ue,kn,be[kn],ut),Hr!==null&&(l&&Hr.alternate!==null&&Zt.delete(Hr.key===null?kn:Hr.key),re=P(Hr,re,kn),rn===null?Tt=Hr:rn.sibling=Hr,rn=Hr);return l&&Zt.forEach(function(ji){return d(ue,ji)}),tr&&ol(ue,kn),Tt}function jo(ue,re,be,ut){var Tt=E(be);if(typeof Tt!="function")throw Error(i(150));if(be=Tt.call(be),be==null)throw Error(i(151));for(var rn=Tt=null,Zt=re,kn=re=0,Hr=null,jn=be.next();Zt!==null&&!jn.done;kn++,jn=be.next()){Zt.index>kn?(Hr=Zt,Zt=null):Hr=Zt.sibling;var ji=it(ue,Zt,jn.value,ut);if(ji===null){Zt===null&&(Zt=Hr);break}l&&Zt&&ji.alternate===null&&d(ue,Zt),re=P(ji,re,kn),rn===null?Tt=ji:rn.sibling=ji,rn=ji,Zt=Hr}if(jn.done)return g(ue,Zt),tr&&ol(ue,kn),Tt;if(Zt===null){for(;!jn.done;kn++,jn=be.next())jn=Jt(ue,jn.value,ut),jn!==null&&(re=P(jn,re,kn),rn===null?Tt=jn:rn.sibling=jn,rn=jn);return tr&&ol(ue,kn),Tt}for(Zt=w(ue,Zt);!jn.done;kn++,jn=be.next())jn=Qn(Zt,ue,kn,jn.value,ut),jn!==null&&(l&&jn.alternate!==null&&Zt.delete(jn.key===null?kn:jn.key),re=P(jn,re,kn),rn===null?Tt=jn:rn.sibling=jn,rn=jn);return l&&Zt.forEach(function(r7){return d(ue,r7)}),tr&&ol(ue,kn),Tt}function Ha(ue,re,be,ut){if(typeof be=="object"&&be!==null&&be.type===h&&be.key===null&&(be=be.props.children),typeof be=="object"&&be!==null){switch(be.$$typeof){case f:e:{for(var Tt=be.key,rn=re;rn!==null;){if(rn.key===Tt){if(Tt=be.type,Tt===h){if(rn.tag===7){g(ue,rn.sibling),re=S(rn,be.props.children),re.return=ue,ue=re;break e}}else if(rn.elementType===Tt||typeof Tt=="object"&&Tt!==null&&Tt.$$typeof===_&&D2(Tt)===rn.type){g(ue,rn.sibling),re=S(rn,be.props),re.ref=Hu(ue,rn,be),re.return=ue,ue=re;break e}g(ue,rn);break}else d(ue,rn);rn=rn.sibling}be.type===h?(re=dl(be.props.children,ue.mode,ut,be.key),re.return=ue,ue=re):(ut=gp(be.type,be.key,be.props,null,ue.mode,ut),ut.ref=Hu(ue,re,be),ut.return=ue,ue=ut)}return N(ue);case p:e:{for(rn=be.key;re!==null;){if(re.key===rn)if(re.tag===4&&re.stateNode.containerInfo===be.containerInfo&&re.stateNode.implementation===be.implementation){g(ue,re.sibling),re=S(re,be.children||[]),re.return=ue,ue=re;break e}else{g(ue,re);break}else d(ue,re);re=re.sibling}re=av(be,ue.mode,ut),re.return=ue,ue=re}return N(ue);case _:return rn=be._init,Ha(ue,re,rn(be._payload),ut)}if(Q(be))return Fn(ue,re,be,ut);if(E(be))return jo(ue,re,be,ut);Vf(ue,be)}return typeof be=="string"&&be!==""||typeof be=="number"?(be=""+be,re!==null&&re.tag===6?(g(ue,re.sibling),re=S(re,be),re.return=ue,ue=re):(g(ue,re),re=sv(be,ue.mode,ut),re.return=ue,ue=re),N(ue)):g(ue,re)}return Ha}var sc=A2(!0),N2=A2(!1),Wu={},ns=vt(Wu),Vu=vt(Wu),ac=vt(Wu);function aa(l){if(l===Wu)throw Error(i(174));return l}function x0(l,d){Ut(ac,d),Ut(Vu,l),Ut(ns,Wu),l=L(d),Dt(ns),Ut(ns,l)}function ic(){Dt(ns),Dt(Vu),Dt(ac)}function T2(l){var d=aa(ac.current),g=aa(ns.current);d=X(g,l.type,d),g!==d&&(Ut(Vu,l),Ut(ns,d))}function y0(l){Vu.current===l&&(Dt(ns),Dt(Vu))}var lr=vt(0);function Uf(l){for(var d=l;d!==null;){if(d.tag===13){var g=d.memoizedState;if(g!==null&&(g=g.dehydrated,g===null||Fr(g)||na(g)))return d}else if(d.tag===19&&d.memoizedProps.revealOrder!==void 0){if(d.flags&128)return d}else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===l)break;for(;d.sibling===null;){if(d.return===null||d.return===l)return null;d=d.return}d.sibling.return=d.return,d=d.sibling}return null}var w0=[];function C0(){for(var l=0;l<w0.length;l++){var d=w0[l];me?d._workInProgressVersionPrimary=null:d._workInProgressVersionSecondary=null}w0.length=0}var Gf=c.ReactCurrentDispatcher,S0=c.ReactCurrentBatchConfig,al=0,cr=null,Dr=null,zr=null,qf=!1,Uu=!1,Gu=0,I8=0;function to(){throw Error(i(321))}function k0(l,d){if(d===null)return!1;for(var g=0;g<d.length&&g<l.length;g++)if(!fn(l[g],d[g]))return!1;return!0}function j0(l,d,g,w,S,P){if(al=P,cr=d,d.memoizedState=null,d.updateQueue=null,d.lanes=0,Gf.current=l===null||l.memoizedState===null?R8:D8,l=g(w,S),Uu){P=0;do{if(Uu=!1,Gu=0,25<=P)throw Error(i(301));P+=1,zr=Dr=null,d.updateQueue=null,Gf.current=A8,l=g(w,S)}while(Uu)}if(Gf.current=Qf,d=Dr!==null&&Dr.next!==null,al=0,zr=Dr=cr=null,qf=!1,d)throw Error(i(300));return l}function _0(){var l=Gu!==0;return Gu=0,l}function ia(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return zr===null?cr.memoizedState=zr=l:zr=zr.next=l,zr}function rs(){if(Dr===null){var l=cr.alternate;l=l!==null?l.memoizedState:null}else l=Dr.next;var d=zr===null?cr.memoizedState:zr.next;if(d!==null)zr=d,Dr=l;else{if(l===null)throw Error(i(310));Dr=l,l={memoizedState:Dr.memoizedState,baseState:Dr.baseState,baseQueue:Dr.baseQueue,queue:Dr.queue,next:null},zr===null?cr.memoizedState=zr=l:zr=zr.next=l}return zr}function qu(l,d){return typeof d=="function"?d(l):d}function P0(l){var d=rs(),g=d.queue;if(g===null)throw Error(i(311));g.lastRenderedReducer=l;var w=Dr,S=w.baseQueue,P=g.pending;if(P!==null){if(S!==null){var N=S.next;S.next=P.next,P.next=N}w.baseQueue=S=P,g.pending=null}if(S!==null){P=S.next,w=w.baseState;var Z=N=null,pe=null,ze=P;do{var mt=ze.lane;if((al&mt)===mt)pe!==null&&(pe=pe.next={lane:0,action:ze.action,hasEagerState:ze.hasEagerState,eagerState:ze.eagerState,next:null}),w=ze.hasEagerState?ze.eagerState:l(w,ze.action);else{var Jt={lane:mt,action:ze.action,hasEagerState:ze.hasEagerState,eagerState:ze.eagerState,next:null};pe===null?(Z=pe=Jt,N=w):pe=pe.next=Jt,cr.lanes|=mt,il|=mt}ze=ze.next}while(ze!==null&&ze!==P);pe===null?N=w:pe.next=Z,fn(w,d.memoizedState)||(Co=!0),d.memoizedState=w,d.baseState=N,d.baseQueue=pe,g.lastRenderedState=w}if(l=g.interleaved,l!==null){S=l;do P=S.lane,cr.lanes|=P,il|=P,S=S.next;while(S!==l)}else S===null&&(g.lanes=0);return[d.memoizedState,g.dispatch]}function I0(l){var d=rs(),g=d.queue;if(g===null)throw Error(i(311));g.lastRenderedReducer=l;var w=g.dispatch,S=g.pending,P=d.memoizedState;if(S!==null){g.pending=null;var N=S=S.next;do P=l(P,N.action),N=N.next;while(N!==S);fn(P,d.memoizedState)||(Co=!0),d.memoizedState=P,d.baseQueue===null&&(d.baseState=P),g.lastRenderedState=P}return[P,w]}function $2(){}function L2(l,d){var g=cr,w=rs(),S=d(),P=!fn(w.memoizedState,S);if(P&&(w.memoizedState=S,Co=!0),w=w.queue,E0(B2.bind(null,g,w,l),[l]),w.getSnapshot!==d||P||zr!==null&&zr.memoizedState.tag&1){if(g.flags|=2048,Ku(9,z2.bind(null,g,w,S,d),void 0,null),Br===null)throw Error(i(349));al&30||F2(g,d,S)}return S}function F2(l,d,g){l.flags|=16384,l={getSnapshot:d,value:g},d=cr.updateQueue,d===null?(d={lastEffect:null,stores:null},cr.updateQueue=d,d.stores=[l]):(g=d.stores,g===null?d.stores=[l]:g.push(l))}function z2(l,d,g,w){d.value=g,d.getSnapshot=w,H2(d)&&W2(l)}function B2(l,d,g){return g(function(){H2(d)&&W2(l)})}function H2(l){var d=l.getSnapshot;l=l.value;try{var g=d();return!fn(l,g)}catch{return!0}}function W2(l){var d=sa(l,1);d!==null&&os(d,l,1,-1)}function V2(l){var d=ia();return typeof l=="function"&&(l=l()),d.memoizedState=d.baseState=l,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:qu,lastRenderedState:l},d.queue=l,l=l.dispatch=M8.bind(null,cr,l),[d.memoizedState,l]}function Ku(l,d,g,w){return l={tag:l,create:d,destroy:g,deps:w,next:null},d=cr.updateQueue,d===null?(d={lastEffect:null,stores:null},cr.updateQueue=d,d.lastEffect=l.next=l):(g=d.lastEffect,g===null?d.lastEffect=l.next=l:(w=g.next,g.next=l,l.next=w,d.lastEffect=l)),l}function U2(){return rs().memoizedState}function Kf(l,d,g,w){var S=ia();cr.flags|=l,S.memoizedState=Ku(1|d,g,void 0,w===void 0?null:w)}function Xf(l,d,g,w){var S=rs();w=w===void 0?null:w;var P=void 0;if(Dr!==null){var N=Dr.memoizedState;if(P=N.destroy,w!==null&&k0(w,N.deps)){S.memoizedState=Ku(d,g,P,w);return}}cr.flags|=l,S.memoizedState=Ku(1|d,g,P,w)}function G2(l,d){return Kf(8390656,8,l,d)}function E0(l,d){return Xf(2048,8,l,d)}function q2(l,d){return Xf(4,2,l,d)}function K2(l,d){return Xf(4,4,l,d)}function X2(l,d){if(typeof d=="function")return l=l(),d(l),function(){d(null)};if(d!=null)return l=l(),d.current=l,function(){d.current=null}}function Q2(l,d,g){return g=g!=null?g.concat([l]):null,Xf(4,4,X2.bind(null,d,l),g)}function O0(){}function Y2(l,d){var g=rs();d=d===void 0?null:d;var w=g.memoizedState;return w!==null&&d!==null&&k0(d,w[1])?w[0]:(g.memoizedState=[l,d],l)}function J2(l,d){var g=rs();d=d===void 0?null:d;var w=g.memoizedState;return w!==null&&d!==null&&k0(d,w[1])?w[0]:(l=l(),g.memoizedState=[l,d],l)}function Z2(l,d,g){return al&21?(fn(g,d)||(g=wt(),cr.lanes|=g,il|=g,l.baseState=!0),d):(l.baseState&&(l.baseState=!1,Co=!0),l.memoizedState=g)}function E8(l,d){var g=Re;Re=g!==0&&4>g?g:4,l(!0);var w=S0.transition;S0.transition={};try{l(!1),d()}finally{Re=g,S0.transition=w}}function ew(){return rs().memoizedState}function O8(l,d,g){var w=Ci(l);if(g={lane:w,action:g,hasEagerState:!1,eagerState:null,next:null},tw(l))nw(d,g);else if(g=j2(l,d,g,w),g!==null){var S=oo();os(g,l,w,S),rw(g,d,w)}}function M8(l,d,g){var w=Ci(l),S={lane:w,action:g,hasEagerState:!1,eagerState:null,next:null};if(tw(l))nw(d,S);else{var P=l.alternate;if(l.lanes===0&&(P===null||P.lanes===0)&&(P=d.lastRenderedReducer,P!==null))try{var N=d.lastRenderedState,Z=P(N,g);if(S.hasEagerState=!0,S.eagerState=Z,fn(Z,N)){var pe=d.interleaved;pe===null?(S.next=S,m0(d)):(S.next=pe.next,pe.next=S),d.interleaved=S;return}}catch{}finally{}g=j2(l,d,S,w),g!==null&&(S=oo(),os(g,l,w,S),rw(g,d,w))}}function tw(l){var d=l.alternate;return l===cr||d!==null&&d===cr}function nw(l,d){Uu=qf=!0;var g=l.pending;g===null?d.next=d:(d.next=g.next,g.next=d),l.pending=d}function rw(l,d,g){if(g&4194240){var w=d.lanes;w&=l.pendingLanes,g|=w,d.lanes=g,Ae(l,g)}}var Qf={readContext:ts,useCallback:to,useContext:to,useEffect:to,useImperativeHandle:to,useInsertionEffect:to,useLayoutEffect:to,useMemo:to,useReducer:to,useRef:to,useState:to,useDebugValue:to,useDeferredValue:to,useTransition:to,useMutableSource:to,useSyncExternalStore:to,useId:to,unstable_isNewReconciler:!1},R8={readContext:ts,useCallback:function(l,d){return ia().memoizedState=[l,d===void 0?null:d],l},useContext:ts,useEffect:G2,useImperativeHandle:function(l,d,g){return g=g!=null?g.concat([l]):null,Kf(4194308,4,X2.bind(null,d,l),g)},useLayoutEffect:function(l,d){return Kf(4194308,4,l,d)},useInsertionEffect:function(l,d){return Kf(4,2,l,d)},useMemo:function(l,d){var g=ia();return d=d===void 0?null:d,l=l(),g.memoizedState=[l,d],l},useReducer:function(l,d,g){var w=ia();return d=g!==void 0?g(d):d,w.memoizedState=w.baseState=d,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:d},w.queue=l,l=l.dispatch=O8.bind(null,cr,l),[w.memoizedState,l]},useRef:function(l){var d=ia();return l={current:l},d.memoizedState=l},useState:V2,useDebugValue:O0,useDeferredValue:function(l){return ia().memoizedState=l},useTransition:function(){var l=V2(!1),d=l[0];return l=E8.bind(null,l[1]),ia().memoizedState=l,[d,l]},useMutableSource:function(){},useSyncExternalStore:function(l,d,g){var w=cr,S=ia();if(tr){if(g===void 0)throw Error(i(407));g=g()}else{if(g=d(),Br===null)throw Error(i(349));al&30||F2(w,d,g)}S.memoizedState=g;var P={value:g,getSnapshot:d};return S.queue=P,G2(B2.bind(null,w,P,l),[l]),w.flags|=2048,Ku(9,z2.bind(null,w,P,g,d),void 0,null),g},useId:function(){var l=ia(),d=Br.identifierPrefix;if(tr){var g=eo,w=zo;g=(w&~(1<<32-Tn(w)-1)).toString(32)+g,d=":"+d+"R"+g,g=Gu++,0<g&&(d+="H"+g.toString(32)),d+=":"}else g=I8++,d=":"+d+"r"+g.toString(32)+":";return l.memoizedState=d},unstable_isNewReconciler:!1},D8={readContext:ts,useCallback:Y2,useContext:ts,useEffect:E0,useImperativeHandle:Q2,useInsertionEffect:q2,useLayoutEffect:K2,useMemo:J2,useReducer:P0,useRef:U2,useState:function(){return P0(qu)},useDebugValue:O0,useDeferredValue:function(l){var d=rs();return Z2(d,Dr.memoizedState,l)},useTransition:function(){var l=P0(qu)[0],d=rs().memoizedState;return[l,d]},useMutableSource:$2,useSyncExternalStore:L2,useId:ew,unstable_isNewReconciler:!1},A8={readContext:ts,useCallback:Y2,useContext:ts,useEffect:E0,useImperativeHandle:Q2,useInsertionEffect:q2,useLayoutEffect:K2,useMemo:J2,useReducer:I0,useRef:U2,useState:function(){return I0(qu)},useDebugValue:O0,useDeferredValue:function(l){var d=rs();return Dr===null?d.memoizedState=l:Z2(d,Dr.memoizedState,l)},useTransition:function(){var l=I0(qu)[0],d=rs().memoizedState;return[l,d]},useMutableSource:$2,useSyncExternalStore:L2,useId:ew,unstable_isNewReconciler:!1};function lc(l,d){try{var g="",w=d;do g+=P8(w),w=w.return;while(w);var S=g}catch(P){S=`
Error generating stack: `+P.message+`
`+P.stack}return{value:l,source:d,stack:S,digest:null}}function M0(l,d,g){return{value:l,source:null,stack:g??null,digest:d??null}}function R0(l,d){try{console.error(d.value)}catch(g){setTimeout(function(){throw g})}}var N8=typeof WeakMap=="function"?WeakMap:Map;function ow(l,d,g){g=Fa(-1,g),g.tag=3,g.payload={element:null};var w=d.value;return g.callback=function(){up||(up=!0,J0=w),R0(l,d)},g}function sw(l,d,g){g=Fa(-1,g),g.tag=3;var w=l.type.getDerivedStateFromError;if(typeof w=="function"){var S=d.value;g.payload=function(){return w(S)},g.callback=function(){R0(l,d)}}var P=l.stateNode;return P!==null&&typeof P.componentDidCatch=="function"&&(g.callback=function(){R0(l,d),typeof w!="function"&&(yi===null?yi=new Set([this]):yi.add(this));var N=d.stack;this.componentDidCatch(d.value,{componentStack:N!==null?N:""})}),g}function aw(l,d,g){var w=l.pingCache;if(w===null){w=l.pingCache=new N8;var S=new Set;w.set(d,S)}else S=w.get(d),S===void 0&&(S=new Set,w.set(d,S));S.has(g)||(S.add(g),l=X8.bind(null,l,d,g),d.then(l,l))}function iw(l){do{var d;if((d=l.tag===13)&&(d=l.memoizedState,d=d!==null?d.dehydrated!==null:!0),d)return l;l=l.return}while(l!==null);return null}function lw(l,d,g,w,S){return l.mode&1?(l.flags|=65536,l.lanes=S,l):(l===d?l.flags|=65536:(l.flags|=128,g.flags|=131072,g.flags&=-52805,g.tag===1&&(g.alternate===null?g.tag=17:(d=Fa(-1,1),d.tag=2,xi(g,d,1))),g.lanes|=1),l)}var T8=c.ReactCurrentOwner,Co=!1;function vo(l,d,g,w){d.child=l===null?N2(d,null,g,w):sc(d,l.child,g,w)}function cw(l,d,g,w,S){g=g.render;var P=d.ref;return oc(d,S),w=j0(l,d,g,w,P,S),g=_0(),l!==null&&!Co?(d.updateQueue=l.updateQueue,d.flags&=-2053,l.lanes&=~S,za(l,d,S)):(tr&&g&&a0(d),d.flags|=1,vo(l,d,w,S),d.child)}function uw(l,d,g,w,S){if(l===null){var P=g.type;return typeof P=="function"&&!ov(P)&&P.defaultProps===void 0&&g.compare===null&&g.defaultProps===void 0?(d.tag=15,d.type=P,dw(l,d,P,w,S)):(l=gp(g.type,null,w,d,d.mode,S),l.ref=d.ref,l.return=d,d.child=l)}if(P=l.child,!(l.lanes&S)){var N=P.memoizedProps;if(g=g.compare,g=g!==null?g:Lf,g(N,w)&&l.ref===d.ref)return za(l,d,S)}return d.flags|=1,l=ki(P,w),l.ref=d.ref,l.return=d,d.child=l}function dw(l,d,g,w,S){if(l!==null){var P=l.memoizedProps;if(Lf(P,w)&&l.ref===d.ref)if(Co=!1,d.pendingProps=w=P,(l.lanes&S)!==0)l.flags&131072&&(Co=!0);else return d.lanes=l.lanes,za(l,d,S)}return D0(l,d,g,w,S)}function fw(l,d,g){var w=d.pendingProps,S=w.children,P=l!==null?l.memoizedState:null;if(w.mode==="hidden")if(!(d.mode&1))d.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ut(uc,Ho),Ho|=g;else{if(!(g&1073741824))return l=P!==null?P.baseLanes|g:g,d.lanes=d.childLanes=1073741824,d.memoizedState={baseLanes:l,cachePool:null,transitions:null},d.updateQueue=null,Ut(uc,Ho),Ho|=l,null;d.memoizedState={baseLanes:0,cachePool:null,transitions:null},w=P!==null?P.baseLanes:g,Ut(uc,Ho),Ho|=w}else P!==null?(w=P.baseLanes|g,d.memoizedState=null):w=g,Ut(uc,Ho),Ho|=w;return vo(l,d,S,g),d.child}function pw(l,d){var g=d.ref;(l===null&&g!==null||l!==null&&l.ref!==g)&&(d.flags|=512,d.flags|=2097152)}function D0(l,d,g,w,S){var P=Zn(g)?sn:Kt.current;return P=Mr(d,P),oc(d,S),g=j0(l,d,g,w,P,S),w=_0(),l!==null&&!Co?(d.updateQueue=l.updateQueue,d.flags&=-2053,l.lanes&=~S,za(l,d,S)):(tr&&w&&a0(d),d.flags|=1,vo(l,d,g,S),d.child)}function hw(l,d,g,w,S){if(Zn(g)){var P=!0;er(d)}else P=!1;if(oc(d,S),d.stateNode===null)Jf(l,d),M2(d,g,w),b0(d,g,w,S),w=!0;else if(l===null){var N=d.stateNode,Z=d.memoizedProps;N.props=Z;var pe=N.context,ze=g.contextType;typeof ze=="object"&&ze!==null?ze=ts(ze):(ze=Zn(g)?sn:Kt.current,ze=Mr(d,ze));var mt=g.getDerivedStateFromProps,Jt=typeof mt=="function"||typeof N.getSnapshotBeforeUpdate=="function";Jt||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(Z!==w||pe!==ze)&&R2(d,N,w,ze),bi=!1;var it=d.memoizedState;N.state=it,Hf(d,w,N,S),pe=d.memoizedState,Z!==w||it!==pe||un.current||bi?(typeof mt=="function"&&(v0(d,g,mt,w),pe=d.memoizedState),(Z=bi||O2(d,g,Z,w,it,pe,ze))?(Jt||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"&&(d.flags|=4194308)):(typeof N.componentDidMount=="function"&&(d.flags|=4194308),d.memoizedProps=w,d.memoizedState=pe),N.props=w,N.state=pe,N.context=ze,w=Z):(typeof N.componentDidMount=="function"&&(d.flags|=4194308),w=!1)}else{N=d.stateNode,_2(l,d),Z=d.memoizedProps,ze=d.type===d.elementType?Z:Is(d.type,Z),N.props=ze,Jt=d.pendingProps,it=N.context,pe=g.contextType,typeof pe=="object"&&pe!==null?pe=ts(pe):(pe=Zn(g)?sn:Kt.current,pe=Mr(d,pe));var Qn=g.getDerivedStateFromProps;(mt=typeof Qn=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(Z!==Jt||it!==pe)&&R2(d,N,w,pe),bi=!1,it=d.memoizedState,N.state=it,Hf(d,w,N,S);var Fn=d.memoizedState;Z!==Jt||it!==Fn||un.current||bi?(typeof Qn=="function"&&(v0(d,g,Qn,w),Fn=d.memoizedState),(ze=bi||O2(d,g,ze,w,it,Fn,pe)||!1)?(mt||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(w,Fn,pe),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(w,Fn,pe)),typeof N.componentDidUpdate=="function"&&(d.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(d.flags|=1024)):(typeof N.componentDidUpdate!="function"||Z===l.memoizedProps&&it===l.memoizedState||(d.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||Z===l.memoizedProps&&it===l.memoizedState||(d.flags|=1024),d.memoizedProps=w,d.memoizedState=Fn),N.props=w,N.state=Fn,N.context=pe,w=ze):(typeof N.componentDidUpdate!="function"||Z===l.memoizedProps&&it===l.memoizedState||(d.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||Z===l.memoizedProps&&it===l.memoizedState||(d.flags|=1024),w=!1)}return A0(l,d,g,w,P,S)}function A0(l,d,g,w,S,P){pw(l,d);var N=(d.flags&128)!==0;if(!w&&!N)return S&&hr(d,g,!1),za(l,d,P);w=d.stateNode,T8.current=d;var Z=N&&typeof g.getDerivedStateFromError!="function"?null:w.render();return d.flags|=1,l!==null&&N?(d.child=sc(d,l.child,null,P),d.child=sc(d,null,Z,P)):vo(l,d,Z,P),d.memoizedState=w.state,S&&hr(d,g,!0),d.child}function mw(l){var d=l.stateNode;d.pendingContext?En(l,d.pendingContext,d.pendingContext!==d.context):d.context&&En(l,d.context,!1),x0(l,d.containerInfo)}function gw(l,d,g,w,S){return nc(),u0(S),d.flags|=256,vo(l,d,g,w),d.child}var N0={dehydrated:null,treeContext:null,retryLane:0};function T0(l){return{baseLanes:l,cachePool:null,transitions:null}}function vw(l,d,g){var w=d.pendingProps,S=lr.current,P=!1,N=(d.flags&128)!==0,Z;if((Z=N)||(Z=l!==null&&l.memoizedState===null?!1:(S&2)!==0),Z?(P=!0,d.flags&=-129):(l===null||l.memoizedState!==null)&&(S|=1),Ut(lr,S&1),l===null)return c0(d),l=d.memoizedState,l!==null&&(l=l.dehydrated,l!==null)?(d.mode&1?na(l)?d.lanes=8:d.lanes=1073741824:d.lanes=1,null):(N=w.children,l=w.fallback,P?(w=d.mode,P=d.child,N={mode:"hidden",children:N},!(w&1)&&P!==null?(P.childLanes=0,P.pendingProps=N):P=vp(N,w,0,null),l=dl(l,w,g,null),P.return=d,l.return=d,P.sibling=l,d.child=P,d.child.memoizedState=T0(g),d.memoizedState=N0,l):$0(d,N));if(S=l.memoizedState,S!==null&&(Z=S.dehydrated,Z!==null))return $8(l,d,N,w,Z,S,g);if(P){P=w.fallback,N=d.mode,S=l.child,Z=S.sibling;var pe={mode:"hidden",children:w.children};return!(N&1)&&d.child!==S?(w=d.child,w.childLanes=0,w.pendingProps=pe,d.deletions=null):(w=ki(S,pe),w.subtreeFlags=S.subtreeFlags&14680064),Z!==null?P=ki(Z,P):(P=dl(P,N,g,null),P.flags|=2),P.return=d,w.return=d,w.sibling=P,d.child=w,w=P,P=d.child,N=l.child.memoizedState,N=N===null?T0(g):{baseLanes:N.baseLanes|g,cachePool:null,transitions:N.transitions},P.memoizedState=N,P.childLanes=l.childLanes&~g,d.memoizedState=N0,w}return P=l.child,l=P.sibling,w=ki(P,{mode:"visible",children:w.children}),!(d.mode&1)&&(w.lanes=g),w.return=d,w.sibling=null,l!==null&&(g=d.deletions,g===null?(d.deletions=[l],d.flags|=16):g.push(l)),d.child=w,d.memoizedState=null,w}function $0(l,d){return d=vp({mode:"visible",children:d},l.mode,0,null),d.return=l,l.child=d}function Yf(l,d,g,w){return w!==null&&u0(w),sc(d,l.child,null,g),l=$0(d,d.pendingProps.children),l.flags|=2,d.memoizedState=null,l}function $8(l,d,g,w,S,P,N){if(g)return d.flags&256?(d.flags&=-257,w=M0(Error(i(422))),Yf(l,d,N,w)):d.memoizedState!==null?(d.child=l.child,d.flags|=128,null):(P=w.fallback,S=d.mode,w=vp({mode:"visible",children:w.children},S,0,null),P=dl(P,S,N,null),P.flags|=2,w.return=d,P.return=d,w.sibling=P,d.child=w,d.mode&1&&sc(d,l.child,null,N),d.child.memoizedState=T0(N),d.memoizedState=N0,P);if(!(d.mode&1))return Yf(l,d,N,null);if(na(S))return w=_s(S).digest,P=Error(i(419)),w=M0(P,w,void 0),Yf(l,d,N,w);if(g=(N&l.childLanes)!==0,Co||g){if(w=Br,w!==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&(w.suspendedLanes|N)?0:S,S!==0&&S!==P.retryLane&&(P.retryLane=S,sa(l,S),os(w,l,S,-1))}return rv(),w=M0(Error(i(421))),Yf(l,d,N,w)}return Fr(S)?(d.flags|=128,d.child=l.child,d=Q8.bind(null,l),Ta(S,d),null):(l=P.treeContext,Ce&&(es=ge(S),Bo=d,tr=!0,Ps=null,Bu=!1,l!==null&&(mo[go++]=zo,mo[go++]=eo,mo[go++]=Zo,zo=l.id,eo=l.overflow,Zo=d)),d=$0(d,w.children),d.flags|=4096,d)}function bw(l,d,g){l.lanes|=d;var w=l.alternate;w!==null&&(w.lanes|=d),h0(l.return,d,g)}function L0(l,d,g,w,S){var P=l.memoizedState;P===null?l.memoizedState={isBackwards:d,rendering:null,renderingStartTime:0,last:w,tail:g,tailMode:S}:(P.isBackwards=d,P.rendering=null,P.renderingStartTime=0,P.last=w,P.tail=g,P.tailMode=S)}function xw(l,d,g){var w=d.pendingProps,S=w.revealOrder,P=w.tail;if(vo(l,d,w.children,g),w=lr.current,w&2)w=w&1|2,d.flags|=128;else{if(l!==null&&l.flags&128)e:for(l=d.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&bw(l,g,d);else if(l.tag===19)bw(l,g,d);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===d)break e;for(;l.sibling===null;){if(l.return===null||l.return===d)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}w&=1}if(Ut(lr,w),!(d.mode&1))d.memoizedState=null;else switch(S){case"forwards":for(g=d.child,S=null;g!==null;)l=g.alternate,l!==null&&Uf(l)===null&&(S=g),g=g.sibling;g=S,g===null?(S=d.child,d.child=null):(S=g.sibling,g.sibling=null),L0(d,!1,S,g,P);break;case"backwards":for(g=null,S=d.child,d.child=null;S!==null;){if(l=S.alternate,l!==null&&Uf(l)===null){d.child=S;break}l=S.sibling,S.sibling=g,g=S,S=l}L0(d,!0,g,null,P);break;case"together":L0(d,!1,null,null,void 0);break;default:d.memoizedState=null}return d.child}function Jf(l,d){!(d.mode&1)&&l!==null&&(l.alternate=null,d.alternate=null,d.flags|=2)}function za(l,d,g){if(l!==null&&(d.dependencies=l.dependencies),il|=d.lanes,!(g&d.childLanes))return null;if(l!==null&&d.child!==l.child)throw Error(i(153));if(d.child!==null){for(l=d.child,g=ki(l,l.pendingProps),d.child=g,g.return=d;l.sibling!==null;)l=l.sibling,g=g.sibling=ki(l,l.pendingProps),g.return=d;g.sibling=null}return d.child}function L8(l,d,g){switch(d.tag){case 3:mw(d),nc();break;case 5:T2(d);break;case 1:Zn(d.type)&&er(d);break;case 4:x0(d,d.stateNode.containerInfo);break;case 10:k2(d,d.type._context,d.memoizedProps.value);break;case 13:var w=d.memoizedState;if(w!==null)return w.dehydrated!==null?(Ut(lr,lr.current&1),d.flags|=128,null):g&d.child.childLanes?vw(l,d,g):(Ut(lr,lr.current&1),l=za(l,d,g),l!==null?l.sibling:null);Ut(lr,lr.current&1);break;case 19:if(w=(g&d.childLanes)!==0,l.flags&128){if(w)return xw(l,d,g);d.flags|=128}var S=d.memoizedState;if(S!==null&&(S.rendering=null,S.tail=null,S.lastEffect=null),Ut(lr,lr.current),w)break;return null;case 22:case 23:return d.lanes=0,fw(l,d,g)}return za(l,d,g)}function la(l){l.flags|=4}function yw(l,d){if(l!==null&&l.child===d.child)return!0;if(d.flags&16)return!1;for(l=d.child;l!==null;){if(l.flags&12854||l.subtreeFlags&12854)return!1;l=l.sibling}return!0}var Xu,Qu,Zf,ep;if(fe)Xu=function(l,d){for(var g=d.child;g!==null;){if(g.tag===5||g.tag===6)Y(l,g.stateNode);else if(g.tag!==4&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===d)break;for(;g.sibling===null;){if(g.return===null||g.return===d)return;g=g.return}g.sibling.return=g.return,g=g.sibling}},Qu=function(){},Zf=function(l,d,g,w,S){if(l=l.memoizedProps,l!==w){var P=d.stateNode,N=aa(ns.current);g=ae(P,g,l,w,S,N),(d.updateQueue=g)&&la(d)}},ep=function(l,d,g,w){g!==w&&la(d)};else if(he){Xu=function(l,d,g,w){for(var S=d.child;S!==null;){if(S.tag===5){var P=S.stateNode;g&&w&&(P=Lr(P,S.type,S.memoizedProps,S)),Y(l,P)}else if(S.tag===6)P=S.stateNode,g&&w&&(P=Lo(P,S.memoizedProps,S)),Y(l,P);else if(S.tag!==4){if(S.tag===22&&S.memoizedState!==null)P=S.child,P!==null&&(P.return=S),Xu(l,S,!0,!0);else if(S.child!==null){S.child.return=S,S=S.child;continue}}if(S===d)break;for(;S.sibling===null;){if(S.return===null||S.return===d)return;S=S.return}S.sibling.return=S.return,S=S.sibling}};var ww=function(l,d,g,w){for(var S=d.child;S!==null;){if(S.tag===5){var P=S.stateNode;g&&w&&(P=Lr(P,S.type,S.memoizedProps,S)),Hn(l,P)}else if(S.tag===6)P=S.stateNode,g&&w&&(P=Lo(P,S.memoizedProps,S)),Hn(l,P);else if(S.tag!==4){if(S.tag===22&&S.memoizedState!==null)P=S.child,P!==null&&(P.return=S),ww(l,S,!0,!0);else if(S.child!==null){S.child.return=S,S=S.child;continue}}if(S===d)break;for(;S.sibling===null;){if(S.return===null||S.return===d)return;S=S.return}S.sibling.return=S.return,S=S.sibling}};Qu=function(l,d){var g=d.stateNode;if(!yw(l,d)){l=g.containerInfo;var w=wr(l);ww(w,d,!1,!1),g.pendingChildren=w,la(d),Wn(l,w)}},Zf=function(l,d,g,w,S){var P=l.stateNode,N=l.memoizedProps;if((l=yw(l,d))&&N===w)d.stateNode=P;else{var Z=d.stateNode,pe=aa(ns.current),ze=null;N!==w&&(ze=ae(Z,g,N,w,S,pe)),l&&ze===null?d.stateNode=P:(P=Ur(P,ze,g,N,w,d,l,Z),ce(P,g,w,S,pe)&&la(d),d.stateNode=P,l?la(d):Xu(P,d,!1,!1))}},ep=function(l,d,g,w){g!==w?(l=aa(ac.current),g=aa(ns.current),d.stateNode=W(w,l,g,d),la(d)):d.stateNode=l.stateNode}}else Qu=function(){},Zf=function(){},ep=function(){};function Yu(l,d){if(!tr)switch(l.tailMode){case"hidden":d=l.tail;for(var g=null;d!==null;)d.alternate!==null&&(g=d),d=d.sibling;g===null?l.tail=null:g.sibling=null;break;case"collapsed":g=l.tail;for(var w=null;g!==null;)g.alternate!==null&&(w=g),g=g.sibling;w===null?d||l.tail===null?l.tail=null:l.tail.sibling=null:w.sibling=null}}function no(l){var d=l.alternate!==null&&l.alternate.child===l.child,g=0,w=0;if(d)for(var S=l.child;S!==null;)g|=S.lanes|S.childLanes,w|=S.subtreeFlags&14680064,w|=S.flags&14680064,S.return=l,S=S.sibling;else for(S=l.child;S!==null;)g|=S.lanes|S.childLanes,w|=S.subtreeFlags,w|=S.flags,S.return=l,S=S.sibling;return l.subtreeFlags|=w,l.childLanes=g,d}function F8(l,d,g){var w=d.pendingProps;switch(i0(d),d.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return no(d),null;case 1:return Zn(d.type)&&Pt(),no(d),null;case 3:return g=d.stateNode,ic(),Dt(un),Dt(Kt),C0(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(l===null||l.child===null)&&($f(d)?la(d):l===null||l.memoizedState.isDehydrated&&!(d.flags&256)||(d.flags|=1024,Ps!==null&&(tv(Ps),Ps=null))),Qu(l,d),no(d),null;case 5:y0(d),g=aa(ac.current);var S=d.type;if(l!==null&&d.stateNode!=null)Zf(l,d,S,w,g),l.ref!==d.ref&&(d.flags|=512,d.flags|=2097152);else{if(!w){if(d.stateNode===null)throw Error(i(166));return no(d),null}if(l=aa(ns.current),$f(d)){if(!Ce)throw Error(i(175));l=je(d.stateNode,d.type,d.memoizedProps,g,l,d,!Bu),d.updateQueue=l,l!==null&&la(d)}else{var P=te(S,w,g,l,d);Xu(P,d,!1,!1),d.stateNode=P,ce(P,S,w,g,l)&&la(d)}d.ref!==null&&(d.flags|=512,d.flags|=2097152)}return no(d),null;case 6:if(l&&d.stateNode!=null)ep(l,d,l.memoizedProps,w);else{if(typeof w!="string"&&d.stateNode===null)throw Error(i(166));if(l=aa(ac.current),g=aa(ns.current),$f(d)){if(!Ce)throw Error(i(176));if(l=d.stateNode,g=d.memoizedProps,(w=ve(l,g,d,!Bu))&&(S=Bo,S!==null))switch(S.tag){case 3:et(S.stateNode.containerInfo,l,g,(S.mode&1)!==0);break;case 5:kt(S.type,S.memoizedProps,S.stateNode,l,g,(S.mode&1)!==0)}w&&la(d)}else d.stateNode=W(w,l,g,d)}return no(d),null;case 13:if(Dt(lr),w=d.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(tr&&es!==null&&d.mode&1&&!(d.flags&128))S2(),nc(),d.flags|=98560,S=!1;else if(S=$f(d),w!==null&&w.dehydrated!==null){if(l===null){if(!S)throw Error(i(318));if(!Ce)throw Error(i(344));if(S=d.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error(i(317));dt(S,d)}else nc(),!(d.flags&128)&&(d.memoizedState=null),d.flags|=4;no(d),S=!1}else Ps!==null&&(tv(Ps),Ps=null),S=!0;if(!S)return d.flags&65536?d:null}return d.flags&128?(d.lanes=g,d):(g=w!==null,g!==(l!==null&&l.memoizedState!==null)&&g&&(d.child.flags|=8192,d.mode&1&&(l===null||lr.current&1?Ar===0&&(Ar=3):rv())),d.updateQueue!==null&&(d.flags|=4),no(d),null);case 4:return ic(),Qu(l,d),l===null&&de(d.stateNode.containerInfo),no(d),null;case 10:return p0(d.type._context),no(d),null;case 17:return Zn(d.type)&&Pt(),no(d),null;case 19:if(Dt(lr),S=d.memoizedState,S===null)return no(d),null;if(w=(d.flags&128)!==0,P=S.rendering,P===null)if(w)Yu(S,!1);else{if(Ar!==0||l!==null&&l.flags&128)for(l=d.child;l!==null;){if(P=Uf(l),P!==null){for(d.flags|=128,Yu(S,!1),l=P.updateQueue,l!==null&&(d.updateQueue=l,d.flags|=4),d.subtreeFlags=0,l=g,g=d.child;g!==null;)w=g,S=l,w.flags&=14680066,P=w.alternate,P===null?(w.childLanes=0,w.lanes=S,w.child=null,w.subtreeFlags=0,w.memoizedProps=null,w.memoizedState=null,w.updateQueue=null,w.dependencies=null,w.stateNode=null):(w.childLanes=P.childLanes,w.lanes=P.lanes,w.child=P.child,w.subtreeFlags=0,w.deletions=null,w.memoizedProps=P.memoizedProps,w.memoizedState=P.memoizedState,w.updateQueue=P.updateQueue,w.type=P.type,S=P.dependencies,w.dependencies=S===null?null:{lanes:S.lanes,firstContext:S.firstContext}),g=g.sibling;return Ut(lr,lr.current&1|2),d.child}l=l.sibling}S.tail!==null&&Ue()>Y0&&(d.flags|=128,w=!0,Yu(S,!1),d.lanes=4194304)}else{if(!w)if(l=Uf(P),l!==null){if(d.flags|=128,w=!0,l=l.updateQueue,l!==null&&(d.updateQueue=l,d.flags|=4),Yu(S,!0),S.tail===null&&S.tailMode==="hidden"&&!P.alternate&&!tr)return no(d),null}else 2*Ue()-S.renderingStartTime>Y0&&g!==1073741824&&(d.flags|=128,w=!0,Yu(S,!1),d.lanes=4194304);S.isBackwards?(P.sibling=d.child,d.child=P):(l=S.last,l!==null?l.sibling=P:d.child=P,S.last=P)}return S.tail!==null?(d=S.tail,S.rendering=d,S.tail=d.sibling,S.renderingStartTime=Ue(),d.sibling=null,l=lr.current,Ut(lr,w?l&1|2:l&1),d):(no(d),null);case 22:case 23:return nv(),g=d.memoizedState!==null,l!==null&&l.memoizedState!==null!==g&&(d.flags|=8192),g&&d.mode&1?Ho&1073741824&&(no(d),fe&&d.subtreeFlags&6&&(d.flags|=8192)):no(d),null;case 24:return null;case 25:return null}throw Error(i(156,d.tag))}function z8(l,d){switch(i0(d),d.tag){case 1:return Zn(d.type)&&Pt(),l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 3:return ic(),Dt(un),Dt(Kt),C0(),l=d.flags,l&65536&&!(l&128)?(d.flags=l&-65537|128,d):null;case 5:return y0(d),null;case 13:if(Dt(lr),l=d.memoizedState,l!==null&&l.dehydrated!==null){if(d.alternate===null)throw Error(i(340));nc()}return l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 19:return Dt(lr),null;case 4:return ic(),null;case 10:return p0(d.type._context),null;case 22:case 23:return nv(),null;case 24:return null;default:return null}}var tp=!1,ro=!1,B8=typeof WeakSet=="function"?WeakSet:Set,pt=null;function cc(l,d){var g=l.ref;if(g!==null)if(typeof g=="function")try{g(null)}catch(w){nr(l,d,w)}else g.current=null}function F0(l,d,g){try{g()}catch(w){nr(l,d,w)}}var Cw=!1;function H8(l,d){for(F(l.containerInfo),pt=d;pt!==null;)if(l=pt,d=l.child,(l.subtreeFlags&1028)!==0&&d!==null)d.return=l,pt=d;else for(;pt!==null;){l=pt;try{var g=l.alternate;if(l.flags&1024)switch(l.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var w=g.memoizedProps,S=g.memoizedState,P=l.stateNode,N=P.getSnapshotBeforeUpdate(l.elementType===l.type?w:Is(l.type,w),S);P.__reactInternalSnapshotBeforeUpdate=N}break;case 3:fe&&ln(l.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(Z){nr(l,l.return,Z)}if(d=l.sibling,d!==null){d.return=l.return,pt=d;break}pt=l.return}return g=Cw,Cw=!1,g}function Ju(l,d,g){var w=d.updateQueue;if(w=w!==null?w.lastEffect:null,w!==null){var S=w=w.next;do{if((S.tag&l)===l){var P=S.destroy;S.destroy=void 0,P!==void 0&&F0(d,g,P)}S=S.next}while(S!==w)}}function np(l,d){if(d=d.updateQueue,d=d!==null?d.lastEffect:null,d!==null){var g=d=d.next;do{if((g.tag&l)===l){var w=g.create;g.destroy=w()}g=g.next}while(g!==d)}}function z0(l){var d=l.ref;if(d!==null){var g=l.stateNode;switch(l.tag){case 5:l=V(g);break;default:l=g}typeof d=="function"?d(l):d.current=l}}function Sw(l){var d=l.alternate;d!==null&&(l.alternate=null,Sw(d)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(d=l.stateNode,d!==null&&De(d)),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}function kw(l){return l.tag===5||l.tag===3||l.tag===4}function jw(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||kw(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function B0(l,d,g){var w=l.tag;if(w===5||w===6)l=l.stateNode,d?vn(g,l,d):xt(g,l);else if(w!==4&&(l=l.child,l!==null))for(B0(l,d,g),l=l.sibling;l!==null;)B0(l,d,g),l=l.sibling}function H0(l,d,g){var w=l.tag;if(w===5||w===6)l=l.stateNode,d?Ke(g,l,d):we(g,l);else if(w!==4&&(l=l.child,l!==null))for(H0(l,d,g),l=l.sibling;l!==null;)H0(l,d,g),l=l.sibling}var Xr=null,Es=!1;function ca(l,d,g){for(g=g.child;g!==null;)W0(l,d,g),g=g.sibling}function W0(l,d,g){if(gn&&typeof gn.onCommitFiberUnmount=="function")try{gn.onCommitFiberUnmount(Xn,g)}catch{}switch(g.tag){case 5:ro||cc(g,d);case 6:if(fe){var w=Xr,S=Es;Xr=null,ca(l,d,g),Xr=w,Es=S,Xr!==null&&(Es?Ze(Xr,g.stateNode):_e(Xr,g.stateNode))}else ca(l,d,g);break;case 18:fe&&Xr!==null&&(Es?He(Xr,g.stateNode):yt(Xr,g.stateNode));break;case 4:fe?(w=Xr,S=Es,Xr=g.stateNode.containerInfo,Es=!0,ca(l,d,g),Xr=w,Es=S):(he&&(w=g.stateNode.containerInfo,S=wr(w),Vn(w,S)),ca(l,d,g));break;case 0:case 11:case 14:case 15:if(!ro&&(w=g.updateQueue,w!==null&&(w=w.lastEffect,w!==null))){S=w=w.next;do{var P=S,N=P.destroy;P=P.tag,N!==void 0&&(P&2||P&4)&&F0(g,d,N),S=S.next}while(S!==w)}ca(l,d,g);break;case 1:if(!ro&&(cc(g,d),w=g.stateNode,typeof w.componentWillUnmount=="function"))try{w.props=g.memoizedProps,w.state=g.memoizedState,w.componentWillUnmount()}catch(Z){nr(g,d,Z)}ca(l,d,g);break;case 21:ca(l,d,g);break;case 22:g.mode&1?(ro=(w=ro)||g.memoizedState!==null,ca(l,d,g),ro=w):ca(l,d,g);break;default:ca(l,d,g)}}function _w(l){var d=l.updateQueue;if(d!==null){l.updateQueue=null;var g=l.stateNode;g===null&&(g=l.stateNode=new B8),d.forEach(function(w){var S=Y8.bind(null,l,w);g.has(w)||(g.add(w),w.then(S,S))})}}function Os(l,d){var g=d.deletions;if(g!==null)for(var w=0;w<g.length;w++){var S=g[w];try{var P=l,N=d;if(fe){var Z=N;e:for(;Z!==null;){switch(Z.tag){case 5:Xr=Z.stateNode,Es=!1;break e;case 3:Xr=Z.stateNode.containerInfo,Es=!0;break e;case 4:Xr=Z.stateNode.containerInfo,Es=!0;break e}Z=Z.return}if(Xr===null)throw Error(i(160));W0(P,N,S),Xr=null,Es=!1}else W0(P,N,S);var pe=S.alternate;pe!==null&&(pe.return=null),S.return=null}catch(ze){nr(S,d,ze)}}if(d.subtreeFlags&12854)for(d=d.child;d!==null;)Pw(d,l),d=d.sibling}function Pw(l,d){var g=l.alternate,w=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:if(Os(d,l),ua(l),w&4){try{Ju(3,l,l.return),np(3,l)}catch(it){nr(l,l.return,it)}try{Ju(5,l,l.return)}catch(it){nr(l,l.return,it)}}break;case 1:Os(d,l),ua(l),w&512&&g!==null&&cc(g,g.return);break;case 5:if(Os(d,l),ua(l),w&512&&g!==null&&cc(g,g.return),fe){if(l.flags&32){var S=l.stateNode;try{Qe(S)}catch(it){nr(l,l.return,it)}}if(w&4&&(S=l.stateNode,S!=null)){var P=l.memoizedProps;if(g=g!==null?g.memoizedProps:P,w=l.type,d=l.updateQueue,l.updateQueue=null,d!==null)try{$e(S,d,w,g,P,l)}catch(it){nr(l,l.return,it)}}}break;case 6:if(Os(d,l),ua(l),w&4&&fe){if(l.stateNode===null)throw Error(i(162));S=l.stateNode,P=l.memoizedProps,g=g!==null?g.memoizedProps:P;try{Nt(S,g,P)}catch(it){nr(l,l.return,it)}}break;case 3:if(Os(d,l),ua(l),w&4){if(fe&&Ce&&g!==null&&g.memoizedState.isDehydrated)try{Vt(d.containerInfo)}catch(it){nr(l,l.return,it)}if(he){S=d.containerInfo,P=d.pendingChildren;try{Vn(S,P)}catch(it){nr(l,l.return,it)}}}break;case 4:if(Os(d,l),ua(l),w&4&&he){P=l.stateNode,S=P.containerInfo,P=P.pendingChildren;try{Vn(S,P)}catch(it){nr(l,l.return,it)}}break;case 13:Os(d,l),ua(l),S=l.child,S.flags&8192&&(P=S.memoizedState!==null,S.stateNode.isHidden=P,!P||S.alternate!==null&&S.alternate.memoizedState!==null||(Q0=Ue())),w&4&&_w(l);break;case 22:var N=g!==null&&g.memoizedState!==null;if(l.mode&1?(ro=(g=ro)||N,Os(d,l),ro=g):Os(d,l),ua(l),w&8192){if(g=l.memoizedState!==null,(l.stateNode.isHidden=g)&&!N&&l.mode&1)for(pt=l,w=l.child;w!==null;){for(d=pt=w;pt!==null;){N=pt;var Z=N.child;switch(N.tag){case 0:case 11:case 14:case 15:Ju(4,N,N.return);break;case 1:cc(N,N.return);var pe=N.stateNode;if(typeof pe.componentWillUnmount=="function"){var ze=N,mt=N.return;try{var Jt=ze;pe.props=Jt.memoizedProps,pe.state=Jt.memoizedState,pe.componentWillUnmount()}catch(it){nr(ze,mt,it)}}break;case 5:cc(N,N.return);break;case 22:if(N.memoizedState!==null){Ow(d);continue}}Z!==null?(Z.return=N,pt=Z):Ow(d)}w=w.sibling}if(fe){e:if(w=null,fe)for(d=l;;){if(d.tag===5){if(w===null){w=d;try{S=d.stateNode,g?ct(S):ir(d.stateNode,d.memoizedProps)}catch(it){nr(l,l.return,it)}}}else if(d.tag===6){if(w===null)try{P=d.stateNode,g?Ft(P):pn(P,d.memoizedProps)}catch(it){nr(l,l.return,it)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===l)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===l)break e;for(;d.sibling===null;){if(d.return===null||d.return===l)break e;w===d&&(w=null),d=d.return}w===d&&(w=null),d.sibling.return=d.return,d=d.sibling}}}break;case 19:Os(d,l),ua(l),w&4&&_w(l);break;case 21:break;default:Os(d,l),ua(l)}}function ua(l){var d=l.flags;if(d&2){try{if(fe){e:{for(var g=l.return;g!==null;){if(kw(g)){var w=g;break e}g=g.return}throw Error(i(160))}switch(w.tag){case 5:var S=w.stateNode;w.flags&32&&(Qe(S),w.flags&=-33);var P=jw(l);H0(l,P,S);break;case 3:case 4:var N=w.stateNode.containerInfo,Z=jw(l);B0(l,Z,N);break;default:throw Error(i(161))}}}catch(pe){nr(l,l.return,pe)}l.flags&=-3}d&4096&&(l.flags&=-4097)}function W8(l,d,g){pt=l,Iw(l)}function Iw(l,d,g){for(var w=(l.mode&1)!==0;pt!==null;){var S=pt,P=S.child;if(S.tag===22&&w){var N=S.memoizedState!==null||tp;if(!N){var Z=S.alternate,pe=Z!==null&&Z.memoizedState!==null||ro;Z=tp;var ze=ro;if(tp=N,(ro=pe)&&!ze)for(pt=S;pt!==null;)N=pt,pe=N.child,N.tag===22&&N.memoizedState!==null?Mw(S):pe!==null?(pe.return=N,pt=pe):Mw(S);for(;P!==null;)pt=P,Iw(P),P=P.sibling;pt=S,tp=Z,ro=ze}Ew(l)}else S.subtreeFlags&8772&&P!==null?(P.return=S,pt=P):Ew(l)}}function Ew(l){for(;pt!==null;){var d=pt;if(d.flags&8772){var g=d.alternate;try{if(d.flags&8772)switch(d.tag){case 0:case 11:case 15:ro||np(5,d);break;case 1:var w=d.stateNode;if(d.flags&4&&!ro)if(g===null)w.componentDidMount();else{var S=d.elementType===d.type?g.memoizedProps:Is(d.type,g.memoizedProps);w.componentDidUpdate(S,g.memoizedState,w.__reactInternalSnapshotBeforeUpdate)}var P=d.updateQueue;P!==null&&I2(d,P,w);break;case 3:var N=d.updateQueue;if(N!==null){if(g=null,d.child!==null)switch(d.child.tag){case 5:g=V(d.child.stateNode);break;case 1:g=d.child.stateNode}I2(d,N,g)}break;case 5:var Z=d.stateNode;g===null&&d.flags&4&&Lt(Z,d.type,d.memoizedProps,d);break;case 6:break;case 4:break;case 12:break;case 13:if(Ce&&d.memoizedState===null){var pe=d.alternate;if(pe!==null){var ze=pe.memoizedState;if(ze!==null){var mt=ze.dehydrated;mt!==null&&ft(mt)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(i(163))}ro||d.flags&512&&z0(d)}catch(Jt){nr(d,d.return,Jt)}}if(d===l){pt=null;break}if(g=d.sibling,g!==null){g.return=d.return,pt=g;break}pt=d.return}}function Ow(l){for(;pt!==null;){var d=pt;if(d===l){pt=null;break}var g=d.sibling;if(g!==null){g.return=d.return,pt=g;break}pt=d.return}}function Mw(l){for(;pt!==null;){var d=pt;try{switch(d.tag){case 0:case 11:case 15:var g=d.return;try{np(4,d)}catch(pe){nr(d,g,pe)}break;case 1:var w=d.stateNode;if(typeof w.componentDidMount=="function"){var S=d.return;try{w.componentDidMount()}catch(pe){nr(d,S,pe)}}var P=d.return;try{z0(d)}catch(pe){nr(d,P,pe)}break;case 5:var N=d.return;try{z0(d)}catch(pe){nr(d,N,pe)}}}catch(pe){nr(d,d.return,pe)}if(d===l){pt=null;break}var Z=d.sibling;if(Z!==null){Z.return=d.return,pt=Z;break}pt=d.return}}var rp=0,op=1,sp=2,ap=3,ip=4;if(typeof Symbol=="function"&&Symbol.for){var Zu=Symbol.for;rp=Zu("selector.component"),op=Zu("selector.has_pseudo_class"),sp=Zu("selector.role"),ap=Zu("selector.test_id"),ip=Zu("selector.text")}function V0(l){var d=xe(l);if(d!=null){if(typeof d.memoizedProps["data-testname"]!="string")throw Error(i(364));return d}if(l=on(l),l===null)throw Error(i(362));return l.stateNode.current}function U0(l,d){switch(d.$$typeof){case rp:if(l.type===d.value)return!0;break;case op:e:{d=d.value,l=[l,0];for(var g=0;g<l.length;){var w=l[g++],S=l[g++],P=d[S];if(w.tag!==5||!ye(w)){for(;P!=null&&U0(w,P);)S++,P=d[S];if(S===d.length){d=!0;break e}else for(w=w.child;w!==null;)l.push(w,S),w=w.sibling}}d=!1}return d;case sp:if(l.tag===5&&We(l.stateNode,d.value))return!0;break;case ip:if((l.tag===5||l.tag===6)&&(l=bt(l),l!==null&&0<=l.indexOf(d.value)))return!0;break;case ap:if(l.tag===5&&(l=l.memoizedProps["data-testname"],typeof l=="string"&&l.toLowerCase()===d.value.toLowerCase()))return!0;break;default:throw Error(i(365))}return!1}function G0(l){switch(l.$$typeof){case rp:return"<"+(M(l.value)||"Unknown")+">";case op:return":has("+(G0(l)||"")+")";case sp:return'[role="'+l.value+'"]';case ip:return'"'+l.value+'"';case ap:return'[data-testname="'+l.value+'"]';default:throw Error(i(365))}}function Rw(l,d){var g=[];l=[l,0];for(var w=0;w<l.length;){var S=l[w++],P=l[w++],N=d[P];if(S.tag!==5||!ye(S)){for(;N!=null&&U0(S,N);)P++,N=d[P];if(P===d.length)g.push(S);else for(S=S.child;S!==null;)l.push(S,P),S=S.sibling}}return g}function q0(l,d){if(!lt)throw Error(i(363));l=V0(l),l=Rw(l,d),d=[],l=Array.from(l);for(var g=0;g<l.length;){var w=l[g++];if(w.tag===5)ye(w)||d.push(w.stateNode);else for(w=w.child;w!==null;)l.push(w),w=w.sibling}return d}var V8=Math.ceil,lp=c.ReactCurrentDispatcher,K0=c.ReactCurrentOwner,Cr=c.ReactCurrentBatchConfig,an=0,Br=null,Pr=null,Qr=0,Ho=0,uc=vt(0),Ar=0,ed=null,il=0,cp=0,X0=0,td=null,So=null,Q0=0,Y0=1/0,Ba=null;function dc(){Y0=Ue()+500}var up=!1,J0=null,yi=null,dp=!1,wi=null,fp=0,nd=0,Z0=null,pp=-1,hp=0;function oo(){return an&6?Ue():pp!==-1?pp:pp=Ue()}function Ci(l){return l.mode&1?an&2&&Qr!==0?Qr&-Qr:_8.transition!==null?(hp===0&&(hp=wt()),hp):(l=Re,l!==0?l:Ne()):1}function os(l,d,g,w){if(50<nd)throw nd=0,Z0=null,Error(i(185));ht(l,g,w),(!(an&2)||l!==Br)&&(l===Br&&(!(an&2)&&(cp|=g),Ar===4&&Si(l,Qr)),ko(l,w),g===1&&an===0&&!(d.mode&1)&&(dc(),Kr&&Fo()))}function ko(l,d){var g=l.callbackNode;Ct(l,d);var w=Ye(l,l===Br?Qr:0);if(w===0)g!==null&&nt(g),l.callbackNode=null,l.callbackPriority=0;else if(d=w&-w,l.callbackPriority!==d){if(g!=null&&nt(g),d===1)l.tag===0?Tf(Aw.bind(null,l)):vi(Aw.bind(null,l)),Xe?It(function(){!(an&6)&&Fo()}):Ve(nn,Fo),g=null;else{switch(Le(w)){case 1:g=nn;break;case 4:g=yn;break;case 16:g=hn;break;case 536870912:g=mr;break;default:g=hn}g=Ww(g,Dw.bind(null,l))}l.callbackPriority=d,l.callbackNode=g}}function Dw(l,d){if(pp=-1,hp=0,an&6)throw Error(i(327));var g=l.callbackNode;if(ul()&&l.callbackNode!==g)return null;var w=Ye(l,l===Br?Qr:0);if(w===0)return null;if(w&30||w&l.expiredLanes||d)d=mp(l,w);else{d=w;var S=an;an|=2;var P=$w();(Br!==l||Qr!==d)&&(Ba=null,dc(),ll(l,d));do try{q8();break}catch(Z){Tw(l,Z)}while(1);f0(),lp.current=P,an=S,Pr!==null?d=0:(Br=null,Qr=0,d=Ar)}if(d!==0){if(d===2&&(S=at(l),S!==0&&(w=S,d=ev(l,S))),d===1)throw g=ed,ll(l,0),Si(l,w),ko(l,Ue()),g;if(d===6)Si(l,w);else{if(S=l.current.alternate,!(w&30)&&!U8(S)&&(d=mp(l,w),d===2&&(P=at(l),P!==0&&(w=P,d=ev(l,P))),d===1))throw g=ed,ll(l,0),Si(l,w),ko(l,Ue()),g;switch(l.finishedWork=S,l.finishedLanes=w,d){case 0:case 1:throw Error(i(345));case 2:cl(l,So,Ba);break;case 3:if(Si(l,w),(w&130023424)===w&&(d=Q0+500-Ue(),10<d)){if(Ye(l,0)!==0)break;if(S=l.suspendedLanes,(S&w)!==w){oo(),l.pingedLanes|=l.suspendedLanes&S;break}l.timeoutHandle=ne(cl.bind(null,l,So,Ba),d);break}cl(l,So,Ba);break;case 4:if(Si(l,w),(w&4194240)===w)break;for(d=l.eventTimes,S=-1;0<w;){var N=31-Tn(w);P=1<<N,N=d[N],N>S&&(S=N),w&=~P}if(w=S,w=Ue()-w,w=(120>w?120:480>w?480:1080>w?1080:1920>w?1920:3e3>w?3e3:4320>w?4320:1960*V8(w/1960))-w,10<w){l.timeoutHandle=ne(cl.bind(null,l,So,Ba),w);break}cl(l,So,Ba);break;case 5:cl(l,So,Ba);break;default:throw Error(i(329))}}}return ko(l,Ue()),l.callbackNode===g?Dw.bind(null,l):null}function ev(l,d){var g=td;return l.current.memoizedState.isDehydrated&&(ll(l,d).flags|=256),l=mp(l,d),l!==2&&(d=So,So=g,d!==null&&tv(d)),l}function tv(l){So===null?So=l:So.push.apply(So,l)}function U8(l){for(var d=l;;){if(d.flags&16384){var g=d.updateQueue;if(g!==null&&(g=g.stores,g!==null))for(var w=0;w<g.length;w++){var S=g[w],P=S.getSnapshot;S=S.value;try{if(!fn(P(),S))return!1}catch{return!1}}}if(g=d.child,d.subtreeFlags&16384&&g!==null)g.return=d,d=g;else{if(d===l)break;for(;d.sibling===null;){if(d.return===null||d.return===l)return!0;d=d.return}d.sibling.return=d.return,d=d.sibling}}return!0}function Si(l,d){for(d&=~X0,d&=~cp,l.suspendedLanes|=d,l.pingedLanes&=~d,l=l.expirationTimes;0<d;){var g=31-Tn(d),w=1<<g;l[g]=-1,d&=~w}}function Aw(l){if(an&6)throw Error(i(327));ul();var d=Ye(l,0);if(!(d&1))return ko(l,Ue()),null;var g=mp(l,d);if(l.tag!==0&&g===2){var w=at(l);w!==0&&(d=w,g=ev(l,w))}if(g===1)throw g=ed,ll(l,0),Si(l,d),ko(l,Ue()),g;if(g===6)throw Error(i(345));return l.finishedWork=l.current.alternate,l.finishedLanes=d,cl(l,So,Ba),ko(l,Ue()),null}function Nw(l){wi!==null&&wi.tag===0&&!(an&6)&&ul();var d=an;an|=1;var g=Cr.transition,w=Re;try{if(Cr.transition=null,Re=1,l)return l()}finally{Re=w,Cr.transition=g,an=d,!(an&6)&&Fo()}}function nv(){Ho=uc.current,Dt(uc)}function ll(l,d){l.finishedWork=null,l.finishedLanes=0;var g=l.timeoutHandle;if(g!==oe&&(l.timeoutHandle=oe,ie(g)),Pr!==null)for(g=Pr.return;g!==null;){var w=g;switch(i0(w),w.tag){case 1:w=w.type.childContextTypes,w!=null&&Pt();break;case 3:ic(),Dt(un),Dt(Kt),C0();break;case 5:y0(w);break;case 4:ic();break;case 13:Dt(lr);break;case 19:Dt(lr);break;case 10:p0(w.type._context);break;case 22:case 23:nv()}g=g.return}if(Br=l,Pr=l=ki(l.current,null),Qr=Ho=d,Ar=0,ed=null,X0=cp=il=0,So=td=null,sl!==null){for(d=0;d<sl.length;d++)if(g=sl[d],w=g.interleaved,w!==null){g.interleaved=null;var S=w.next,P=g.pending;if(P!==null){var N=P.next;P.next=S,w.next=N}g.pending=w}sl=null}return l}function Tw(l,d){do{var g=Pr;try{if(f0(),Gf.current=Qf,qf){for(var w=cr.memoizedState;w!==null;){var S=w.queue;S!==null&&(S.pending=null),w=w.next}qf=!1}if(al=0,zr=Dr=cr=null,Uu=!1,Gu=0,K0.current=null,g===null||g.return===null){Ar=1,ed=d,Pr=null;break}e:{var P=l,N=g.return,Z=g,pe=d;if(d=Qr,Z.flags|=32768,pe!==null&&typeof pe=="object"&&typeof pe.then=="function"){var ze=pe,mt=Z,Jt=mt.tag;if(!(mt.mode&1)&&(Jt===0||Jt===11||Jt===15)){var it=mt.alternate;it?(mt.updateQueue=it.updateQueue,mt.memoizedState=it.memoizedState,mt.lanes=it.lanes):(mt.updateQueue=null,mt.memoizedState=null)}var Qn=iw(N);if(Qn!==null){Qn.flags&=-257,lw(Qn,N,Z,P,d),Qn.mode&1&&aw(P,ze,d),d=Qn,pe=ze;var Fn=d.updateQueue;if(Fn===null){var jo=new Set;jo.add(pe),d.updateQueue=jo}else Fn.add(pe);break e}else{if(!(d&1)){aw(P,ze,d),rv();break e}pe=Error(i(426))}}else if(tr&&Z.mode&1){var Ha=iw(N);if(Ha!==null){!(Ha.flags&65536)&&(Ha.flags|=256),lw(Ha,N,Z,P,d),u0(lc(pe,Z));break e}}P=pe=lc(pe,Z),Ar!==4&&(Ar=2),td===null?td=[P]:td.push(P),P=N;do{switch(P.tag){case 3:P.flags|=65536,d&=-d,P.lanes|=d;var ue=ow(P,pe,d);P2(P,ue);break e;case 1:Z=pe;var re=P.type,be=P.stateNode;if(!(P.flags&128)&&(typeof re.getDerivedStateFromError=="function"||be!==null&&typeof be.componentDidCatch=="function"&&(yi===null||!yi.has(be)))){P.flags|=65536,d&=-d,P.lanes|=d;var ut=sw(P,Z,d);P2(P,ut);break e}}P=P.return}while(P!==null)}Fw(g)}catch(Tt){d=Tt,Pr===g&&g!==null&&(Pr=g=g.return);continue}break}while(1)}function $w(){var l=lp.current;return lp.current=Qf,l===null?Qf:l}function rv(){(Ar===0||Ar===3||Ar===2)&&(Ar=4),Br===null||!(il&268435455)&&!(cp&268435455)||Si(Br,Qr)}function mp(l,d){var g=an;an|=2;var w=$w();(Br!==l||Qr!==d)&&(Ba=null,ll(l,d));do try{G8();break}catch(S){Tw(l,S)}while(1);if(f0(),an=g,lp.current=w,Pr!==null)throw Error(i(261));return Br=null,Qr=0,Ar}function G8(){for(;Pr!==null;)Lw(Pr)}function q8(){for(;Pr!==null&&!At();)Lw(Pr)}function Lw(l){var d=Hw(l.alternate,l,Ho);l.memoizedProps=l.pendingProps,d===null?Fw(l):Pr=d,K0.current=null}function Fw(l){var d=l;do{var g=d.alternate;if(l=d.return,d.flags&32768){if(g=z8(g,d),g!==null){g.flags&=32767,Pr=g;return}if(l!==null)l.flags|=32768,l.subtreeFlags=0,l.deletions=null;else{Ar=6,Pr=null;return}}else if(g=F8(g,d,Ho),g!==null){Pr=g;return}if(d=d.sibling,d!==null){Pr=d;return}Pr=d=l}while(d!==null);Ar===0&&(Ar=5)}function cl(l,d,g){var w=Re,S=Cr.transition;try{Cr.transition=null,Re=1,K8(l,d,g,w)}finally{Cr.transition=S,Re=w}return null}function K8(l,d,g,w){do ul();while(wi!==null);if(an&6)throw Error(i(327));g=l.finishedWork;var S=l.finishedLanes;if(g===null)return null;if(l.finishedWork=null,l.finishedLanes=0,g===l.current)throw Error(i(177));l.callbackNode=null,l.callbackPriority=0;var P=g.lanes|g.childLanes;if(ot(l,P),l===Br&&(Pr=Br=null,Qr=0),!(g.subtreeFlags&2064)&&!(g.flags&2064)||dp||(dp=!0,Ww(hn,function(){return ul(),null})),P=(g.flags&15990)!==0,g.subtreeFlags&15990||P){P=Cr.transition,Cr.transition=null;var N=Re;Re=1;var Z=an;an|=4,K0.current=null,H8(l,g),Pw(g,l),q(l.containerInfo),l.current=g,W8(g),Rt(),an=Z,Re=N,Cr.transition=P}else l.current=g;if(dp&&(dp=!1,wi=l,fp=S),P=l.pendingLanes,P===0&&(yi=null),Un(g.stateNode),ko(l,Ue()),d!==null)for(w=l.onRecoverableError,g=0;g<d.length;g++)S=d[g],w(S.value,{componentStack:S.stack,digest:S.digest});if(up)throw up=!1,l=J0,J0=null,l;return fp&1&&l.tag!==0&&ul(),P=l.pendingLanes,P&1?l===Z0?nd++:(nd=0,Z0=l):nd=0,Fo(),null}function ul(){if(wi!==null){var l=Le(fp),d=Cr.transition,g=Re;try{if(Cr.transition=null,Re=16>l?16:l,wi===null)var w=!1;else{if(l=wi,wi=null,fp=0,an&6)throw Error(i(331));var S=an;for(an|=4,pt=l.current;pt!==null;){var P=pt,N=P.child;if(pt.flags&16){var Z=P.deletions;if(Z!==null){for(var pe=0;pe<Z.length;pe++){var ze=Z[pe];for(pt=ze;pt!==null;){var mt=pt;switch(mt.tag){case 0:case 11:case 15:Ju(8,mt,P)}var Jt=mt.child;if(Jt!==null)Jt.return=mt,pt=Jt;else for(;pt!==null;){mt=pt;var it=mt.sibling,Qn=mt.return;if(Sw(mt),mt===ze){pt=null;break}if(it!==null){it.return=Qn,pt=it;break}pt=Qn}}}var Fn=P.alternate;if(Fn!==null){var jo=Fn.child;if(jo!==null){Fn.child=null;do{var Ha=jo.sibling;jo.sibling=null,jo=Ha}while(jo!==null)}}pt=P}}if(P.subtreeFlags&2064&&N!==null)N.return=P,pt=N;else e:for(;pt!==null;){if(P=pt,P.flags&2048)switch(P.tag){case 0:case 11:case 15:Ju(9,P,P.return)}var ue=P.sibling;if(ue!==null){ue.return=P.return,pt=ue;break e}pt=P.return}}var re=l.current;for(pt=re;pt!==null;){N=pt;var be=N.child;if(N.subtreeFlags&2064&&be!==null)be.return=N,pt=be;else e:for(N=re;pt!==null;){if(Z=pt,Z.flags&2048)try{switch(Z.tag){case 0:case 11:case 15:np(9,Z)}}catch(Tt){nr(Z,Z.return,Tt)}if(Z===N){pt=null;break e}var ut=Z.sibling;if(ut!==null){ut.return=Z.return,pt=ut;break e}pt=Z.return}}if(an=S,Fo(),gn&&typeof gn.onPostCommitFiberRoot=="function")try{gn.onPostCommitFiberRoot(Xn,l)}catch{}w=!0}return w}finally{Re=g,Cr.transition=d}}return!1}function zw(l,d,g){d=lc(g,d),d=ow(l,d,1),l=xi(l,d,1),d=oo(),l!==null&&(ht(l,1,d),ko(l,d))}function nr(l,d,g){if(l.tag===3)zw(l,l,g);else for(;d!==null;){if(d.tag===3){zw(d,l,g);break}else if(d.tag===1){var w=d.stateNode;if(typeof d.type.getDerivedStateFromError=="function"||typeof w.componentDidCatch=="function"&&(yi===null||!yi.has(w))){l=lc(g,l),l=sw(d,l,1),d=xi(d,l,1),l=oo(),d!==null&&(ht(d,1,l),ko(d,l));break}}d=d.return}}function X8(l,d,g){var w=l.pingCache;w!==null&&w.delete(d),d=oo(),l.pingedLanes|=l.suspendedLanes&g,Br===l&&(Qr&g)===g&&(Ar===4||Ar===3&&(Qr&130023424)===Qr&&500>Ue()-Q0?ll(l,0):X0|=g),ko(l,d)}function Bw(l,d){d===0&&(l.mode&1?(d=bn,bn<<=1,!(bn&130023424)&&(bn=4194304)):d=1);var g=oo();l=sa(l,d),l!==null&&(ht(l,d,g),ko(l,g))}function Q8(l){var d=l.memoizedState,g=0;d!==null&&(g=d.retryLane),Bw(l,g)}function Y8(l,d){var g=0;switch(l.tag){case 13:var w=l.stateNode,S=l.memoizedState;S!==null&&(g=S.retryLane);break;case 19:w=l.stateNode;break;default:throw Error(i(314))}w!==null&&w.delete(d),Bw(l,g)}var Hw;Hw=function(l,d,g){if(l!==null)if(l.memoizedProps!==d.pendingProps||un.current)Co=!0;else{if(!(l.lanes&g)&&!(d.flags&128))return Co=!1,L8(l,d,g);Co=!!(l.flags&131072)}else Co=!1,tr&&d.flags&1048576&&x2(d,ho,d.index);switch(d.lanes=0,d.tag){case 2:var w=d.type;Jf(l,d),l=d.pendingProps;var S=Mr(d,Kt.current);oc(d,g),S=j0(null,d,w,l,S,g);var P=_0();return d.flags|=1,typeof S=="object"&&S!==null&&typeof S.render=="function"&&S.$$typeof===void 0?(d.tag=1,d.memoizedState=null,d.updateQueue=null,Zn(w)?(P=!0,er(d)):P=!1,d.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,g0(d),S.updater=Wf,d.stateNode=S,S._reactInternals=d,b0(d,w,l,g),d=A0(null,d,w,!0,P,g)):(d.tag=0,tr&&P&&a0(d),vo(null,d,S,g),d=d.child),d;case 16:w=d.elementType;e:{switch(Jf(l,d),l=d.pendingProps,S=w._init,w=S(w._payload),d.type=w,S=d.tag=Z8(w),l=Is(w,l),S){case 0:d=D0(null,d,w,l,g);break e;case 1:d=hw(null,d,w,l,g);break e;case 11:d=cw(null,d,w,l,g);break e;case 14:d=uw(null,d,w,Is(w.type,l),g);break e}throw Error(i(306,w,""))}return d;case 0:return w=d.type,S=d.pendingProps,S=d.elementType===w?S:Is(w,S),D0(l,d,w,S,g);case 1:return w=d.type,S=d.pendingProps,S=d.elementType===w?S:Is(w,S),hw(l,d,w,S,g);case 3:e:{if(mw(d),l===null)throw Error(i(387));w=d.pendingProps,P=d.memoizedState,S=P.element,_2(l,d),Hf(d,w,null,g);var N=d.memoizedState;if(w=N.element,Ce&&P.isDehydrated)if(P={element:w,isDehydrated:!1,cache:N.cache,pendingSuspenseBoundaries:N.pendingSuspenseBoundaries,transitions:N.transitions},d.updateQueue.baseState=P,d.memoizedState=P,d.flags&256){S=lc(Error(i(423)),d),d=gw(l,d,w,g,S);break e}else if(w!==S){S=lc(Error(i(424)),d),d=gw(l,d,w,g,S);break e}else for(Ce&&(es=ee(d.stateNode.containerInfo),Bo=d,tr=!0,Ps=null,Bu=!1),g=N2(d,null,w,g),d.child=g;g;)g.flags=g.flags&-3|4096,g=g.sibling;else{if(nc(),w===S){d=za(l,d,g);break e}vo(l,d,w,g)}d=d.child}return d;case 5:return T2(d),l===null&&c0(d),w=d.type,S=d.pendingProps,P=l!==null?l.memoizedProps:null,N=S.children,U(w,S)?N=null:P!==null&&U(w,P)&&(d.flags|=32),pw(l,d),vo(l,d,N,g),d.child;case 6:return l===null&&c0(d),null;case 13:return vw(l,d,g);case 4:return x0(d,d.stateNode.containerInfo),w=d.pendingProps,l===null?d.child=sc(d,null,w,g):vo(l,d,w,g),d.child;case 11:return w=d.type,S=d.pendingProps,S=d.elementType===w?S:Is(w,S),cw(l,d,w,S,g);case 7:return vo(l,d,d.pendingProps,g),d.child;case 8:return vo(l,d,d.pendingProps.children,g),d.child;case 12:return vo(l,d,d.pendingProps.children,g),d.child;case 10:e:{if(w=d.type._context,S=d.pendingProps,P=d.memoizedProps,N=S.value,k2(d,w,N),P!==null)if(fn(P.value,N)){if(P.children===S.children&&!un.current){d=za(l,d,g);break e}}else for(P=d.child,P!==null&&(P.return=d);P!==null;){var Z=P.dependencies;if(Z!==null){N=P.child;for(var pe=Z.firstContext;pe!==null;){if(pe.context===w){if(P.tag===1){pe=Fa(-1,g&-g),pe.tag=2;var ze=P.updateQueue;if(ze!==null){ze=ze.shared;var mt=ze.pending;mt===null?pe.next=pe:(pe.next=mt.next,mt.next=pe),ze.pending=pe}}P.lanes|=g,pe=P.alternate,pe!==null&&(pe.lanes|=g),h0(P.return,g,d),Z.lanes|=g;break}pe=pe.next}}else if(P.tag===10)N=P.type===d.type?null:P.child;else if(P.tag===18){if(N=P.return,N===null)throw Error(i(341));N.lanes|=g,Z=N.alternate,Z!==null&&(Z.lanes|=g),h0(N,g,d),N=P.sibling}else N=P.child;if(N!==null)N.return=P;else for(N=P;N!==null;){if(N===d){N=null;break}if(P=N.sibling,P!==null){P.return=N.return,N=P;break}N=N.return}P=N}vo(l,d,S.children,g),d=d.child}return d;case 9:return S=d.type,w=d.pendingProps.children,oc(d,g),S=ts(S),w=w(S),d.flags|=1,vo(l,d,w,g),d.child;case 14:return w=d.type,S=Is(w,d.pendingProps),S=Is(w.type,S),uw(l,d,w,S,g);case 15:return dw(l,d,d.type,d.pendingProps,g);case 17:return w=d.type,S=d.pendingProps,S=d.elementType===w?S:Is(w,S),Jf(l,d),d.tag=1,Zn(w)?(l=!0,er(d)):l=!1,oc(d,g),M2(d,w,S),b0(d,w,S,g),A0(null,d,w,!0,l,g);case 19:return xw(l,d,g);case 22:return fw(l,d,g)}throw Error(i(156,d.tag))};function Ww(l,d){return Ve(l,d)}function J8(l,d,g,w){this.tag=l,this.key=g,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=d,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=w,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ss(l,d,g,w){return new J8(l,d,g,w)}function ov(l){return l=l.prototype,!(!l||!l.isReactComponent)}function Z8(l){if(typeof l=="function")return ov(l)?1:0;if(l!=null){if(l=l.$$typeof,l===x)return 11;if(l===j)return 14}return 2}function ki(l,d){var g=l.alternate;return g===null?(g=ss(l.tag,d,l.key,l.mode),g.elementType=l.elementType,g.type=l.type,g.stateNode=l.stateNode,g.alternate=l,l.alternate=g):(g.pendingProps=d,g.type=l.type,g.flags=0,g.subtreeFlags=0,g.deletions=null),g.flags=l.flags&14680064,g.childLanes=l.childLanes,g.lanes=l.lanes,g.child=l.child,g.memoizedProps=l.memoizedProps,g.memoizedState=l.memoizedState,g.updateQueue=l.updateQueue,d=l.dependencies,g.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext},g.sibling=l.sibling,g.index=l.index,g.ref=l.ref,g}function gp(l,d,g,w,S,P){var N=2;if(w=l,typeof l=="function")ov(l)&&(N=1);else if(typeof l=="string")N=5;else e:switch(l){case h:return dl(g.children,S,P,d);case m:N=8,S|=8;break;case v:return l=ss(12,g,d,S|2),l.elementType=v,l.lanes=P,l;case C:return l=ss(13,g,d,S),l.elementType=C,l.lanes=P,l;case k:return l=ss(19,g,d,S),l.elementType=k,l.lanes=P,l;case I:return vp(g,S,P,d);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case b:N=10;break e;case y:N=9;break e;case x:N=11;break e;case j:N=14;break e;case _:N=16,w=null;break e}throw Error(i(130,l==null?l:typeof l,""))}return d=ss(N,g,d,S),d.elementType=l,d.type=w,d.lanes=P,d}function dl(l,d,g,w){return l=ss(7,l,w,d),l.lanes=g,l}function vp(l,d,g,w){return l=ss(22,l,w,d),l.elementType=I,l.lanes=g,l.stateNode={isHidden:!1},l}function sv(l,d,g){return l=ss(6,l,null,d),l.lanes=g,l}function av(l,d,g){return d=ss(4,l.children!==null?l.children:[],l.key,d),d.lanes=g,d.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},d}function e7(l,d,g,w,S){this.tag=d,this.containerInfo=l,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=oe,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Bt(0),this.expirationTimes=Bt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Bt(0),this.identifierPrefix=w,this.onRecoverableError=S,Ce&&(this.mutableSourceEagerHydrationData=null)}function Vw(l,d,g,w,S,P,N,Z,pe){return l=new e7(l,d,g,Z,pe),d===1?(d=1,P===!0&&(d|=8)):d=0,P=ss(3,null,null,d),l.current=P,P.stateNode=l,P.memoizedState={element:w,isDehydrated:g,cache:null,transitions:null,pendingSuspenseBoundaries:null},g0(P),l}function Uw(l){if(!l)return In;l=l._reactInternals;e:{if(A(l)!==l||l.tag!==1)throw Error(i(170));var d=l;do{switch(d.tag){case 3:d=d.stateNode.context;break e;case 1:if(Zn(d.type)){d=d.stateNode.__reactInternalMemoizedMergedChildContext;break e}}d=d.return}while(d!==null);throw Error(i(171))}if(l.tag===1){var g=l.type;if(Zn(g))return Rn(l,g,d)}return d}function Gw(l){var d=l._reactInternals;if(d===void 0)throw typeof l.render=="function"?Error(i(188)):(l=Object.keys(l).join(","),Error(i(268,l)));return l=K(d),l===null?null:l.stateNode}function qw(l,d){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var g=l.retryLane;l.retryLane=g!==0&&g<d?g:d}}function bp(l,d){qw(l,d),(l=l.alternate)&&qw(l,d)}function t7(l){return l=K(l),l===null?null:l.stateNode}function n7(){return null}return n.attemptContinuousHydration=function(l){if(l.tag===13){var d=sa(l,134217728);if(d!==null){var g=oo();os(d,l,134217728,g)}bp(l,134217728)}},n.attemptDiscreteHydration=function(l){if(l.tag===13){var d=sa(l,1);if(d!==null){var g=oo();os(d,l,1,g)}bp(l,1)}},n.attemptHydrationAtCurrentPriority=function(l){if(l.tag===13){var d=Ci(l),g=sa(l,d);if(g!==null){var w=oo();os(g,l,d,w)}bp(l,d)}},n.attemptSynchronousHydration=function(l){switch(l.tag){case 3:var d=l.stateNode;if(d.current.memoizedState.isDehydrated){var g=xn(d.pendingLanes);g!==0&&(Ae(d,g|1),ko(d,Ue()),!(an&6)&&(dc(),Fo()))}break;case 13:Nw(function(){var w=sa(l,1);if(w!==null){var S=oo();os(w,l,1,S)}}),bp(l,1)}},n.batchedUpdates=function(l,d){var g=an;an|=1;try{return l(d)}finally{an=g,an===0&&(dc(),Kr&&Fo())}},n.createComponentSelector=function(l){return{$$typeof:rp,value:l}},n.createContainer=function(l,d,g,w,S,P,N){return Vw(l,d,!1,null,g,w,S,P,N)},n.createHasPseudoClassSelector=function(l){return{$$typeof:op,value:l}},n.createHydrationContainer=function(l,d,g,w,S,P,N,Z,pe){return l=Vw(g,w,!0,l,S,P,N,Z,pe),l.context=Uw(null),g=l.current,w=oo(),S=Ci(g),P=Fa(w,S),P.callback=d??null,xi(g,P,S),l.current.lanes=S,ht(l,S,w),ko(l,w),l},n.createPortal=function(l,d,g){var w=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:p,key:w==null?null:""+w,children:l,containerInfo:d,implementation:g}},n.createRoleSelector=function(l){return{$$typeof:sp,value:l}},n.createTestNameSelector=function(l){return{$$typeof:ap,value:l}},n.createTextSelector=function(l){return{$$typeof:ip,value:l}},n.deferredUpdates=function(l){var d=Re,g=Cr.transition;try{return Cr.transition=null,Re=16,l()}finally{Re=d,Cr.transition=g}},n.discreteUpdates=function(l,d,g,w,S){var P=Re,N=Cr.transition;try{return Cr.transition=null,Re=1,l(d,g,w,S)}finally{Re=P,Cr.transition=N,an===0&&dc()}},n.findAllNodes=q0,n.findBoundingRects=function(l,d){if(!lt)throw Error(i(363));d=q0(l,d),l=[];for(var g=0;g<d.length;g++)l.push(gt(d[g]));for(d=l.length-1;0<d;d--){g=l[d];for(var w=g.x,S=w+g.width,P=g.y,N=P+g.height,Z=d-1;0<=Z;Z--)if(d!==Z){var pe=l[Z],ze=pe.x,mt=ze+pe.width,Jt=pe.y,it=Jt+pe.height;if(w>=ze&&P>=Jt&&S<=mt&&N<=it){l.splice(d,1);break}else if(w!==ze||g.width!==pe.width||it<P||Jt>N){if(!(P!==Jt||g.height!==pe.height||mt<w||ze>S)){ze>w&&(pe.width+=ze-w,pe.x=w),mt<S&&(pe.width=S-ze),l.splice(d,1);break}}else{Jt>P&&(pe.height+=Jt-P,pe.y=P),it<N&&(pe.height=N-Jt),l.splice(d,1);break}}}return l},n.findHostInstance=Gw,n.findHostInstanceWithNoPortals=function(l){return l=T(l),l=l!==null?G(l):null,l===null?null:l.stateNode},n.findHostInstanceWithWarning=function(l){return Gw(l)},n.flushControlled=function(l){var d=an;an|=1;var g=Cr.transition,w=Re;try{Cr.transition=null,Re=1,l()}finally{Re=w,Cr.transition=g,an=d,an===0&&(dc(),Fo())}},n.flushPassiveEffects=ul,n.flushSync=Nw,n.focusWithin=function(l,d){if(!lt)throw Error(i(363));for(l=V0(l),d=Rw(l,d),d=Array.from(d),l=0;l<d.length;){var g=d[l++];if(!ye(g)){if(g.tag===5&&Et(g.stateNode))return!0;for(g=g.child;g!==null;)d.push(g),g=g.sibling}}return!1},n.getCurrentUpdatePriority=function(){return Re},n.getFindAllNodesFailureDescription=function(l,d){if(!lt)throw Error(i(363));var g=0,w=[];l=[V0(l),0];for(var S=0;S<l.length;){var P=l[S++],N=l[S++],Z=d[N];if((P.tag!==5||!ye(P))&&(U0(P,Z)&&(w.push(G0(Z)),N++,N>g&&(g=N)),N<d.length))for(P=P.child;P!==null;)l.push(P,N),P=P.sibling}if(g<d.length){for(l=[];g<d.length;g++)l.push(G0(d[g]));return`findAllNodes was able to match part of the selector:
`+(w.join(" > ")+`
No matching component was found for:
`)+l.join(" > ")}return null},n.getPublicRootInstance=function(l){if(l=l.current,!l.child)return null;switch(l.child.tag){case 5:return V(l.child.stateNode);default:return l.child.stateNode}},n.injectIntoDevTools=function(l){if(l={bundleType:l.bundleType,version:l.version,rendererPackageName:l.rendererPackageName,rendererConfig:l.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:c.ReactCurrentDispatcher,findHostInstanceByFiber:t7,findFiberByHostInstance:l.findFiberByHostInstance||n7,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")l=!1;else{var d=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(d.isDisabled||!d.supportsFiber)l=!0;else{try{Xn=d.inject(l),gn=d}catch{}l=!!d.checkDCE}}return l},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(l,d,g,w){if(!lt)throw Error(i(363));l=q0(l,d);var S=zt(l,g,w).disconnect;return{disconnect:function(){S()}}},n.registerMutableSourceForHydration=function(l,d){var g=d._getVersion;g=g(d._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[d,g]:l.mutableSourceEagerHydrationData.push(d,g)},n.runWithPriority=function(l,d){var g=Re;try{return Re=l,d()}finally{Re=g}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(l,d,g,w){var S=d.current,P=oo(),N=Ci(S);return g=Uw(g),d.context===null?d.context=g:d.pendingContext=g,d=Fa(P,N),d.payload={element:l},w=w===void 0?null:w,w!==null&&(d.callback=w),l=xi(S,d,N),l!==null&&(os(l,S,N,P),Bf(l,S,N)),N},n};h8.exports=lhe;var che=h8.exports;const uhe=Cu(che);var m8={exports:{}},tc={};/**
* @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.
*/tc.ConcurrentRoot=1;tc.ContinuousEventPriority=4;tc.DefaultEventPriority=16;tc.DiscreteEventPriority=1;tc.IdleEventPriority=536870912;tc.LegacyRoot=0;m8.exports=tc;var g8=m8.exports;const w_={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let C_=!1,S_=!1;const g2=".react-konva-event",dhe=`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
`,fhe=`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
`,phe={};function s0(e,t,n=phe){if(!C_&&"zIndex"in t&&(console.warn(fhe),C_=!0),!S_&&t.draggable){var r=t.x!==void 0||t.y!==void 0,o=t.onDragEnd||t.onDragMove;r&&!o&&(console.warn(dhe),S_=!0)}for(var s in n)if(!w_[s]){var i=s.slice(0,2)==="on",c=n[s]!==t[s];if(i&&c){var f=s.substr(2).toLowerCase();f.substr(0,7)==="content"&&(f="content"+f.substr(7,1).toUpperCase()+f.substr(8)),e.off(f,n[s])}var 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(!w_[s]){var i=s.slice(0,2)==="on",y=n[s]!==t[s];if(i&&y){var f=s.substr(2).toLowerCase();f.substr(0,7)==="content"&&(f="content"+f.substr(7,1).toUpperCase()+f.substr(8)),t[s]&&(b[f]=t[s])}!i&&(t[s]!==n[s]||h&&t[s]!==e.getAttr(s))&&(v=!0,m[s]=t[s])}v&&(e.setAttrs(m),rl(e));for(var f in b)e.on(f+g2,b[f])}function rl(e){if(!eN.Konva.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const v8={},hhe={};Jd.Node.prototype._applyProps=s0;function mhe(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),rl(e)}function ghe(e,t,n){let r=Jd[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=Jd.Group);const o={},s={};for(var i in t){var c=i.slice(0,2)==="on";c?s[i]=t[i]:o[i]=t[i]}const f=new r(o);return s0(f,s),f}function vhe(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function bhe(e,t,n){return!1}function xhe(e){return e}function yhe(){return null}function whe(){return null}function Che(e,t,n,r){return hhe}function She(){}function khe(e){}function jhe(e,t){return!1}function _he(){return v8}function Phe(){return v8}const Ihe=setTimeout,Ehe=clearTimeout,Ohe=-1;function Mhe(e,t){return!1}const Rhe=!1,Dhe=!0,Ahe=!0;function Nhe(e,t){t.parent===e?t.moveToTop():e.add(t),rl(e)}function The(e,t){t.parent===e?t.moveToTop():e.add(t),rl(e)}function b8(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),rl(e)}function $he(e,t,n){b8(e,t,n)}function Lhe(e,t){t.destroy(),t.off(g2),rl(e)}function Fhe(e,t){t.destroy(),t.off(g2),rl(e)}function zhe(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function Bhe(e,t,n){}function Hhe(e,t,n,r,o){s0(e,o,r)}function Whe(e){e.hide(),rl(e)}function Vhe(e){}function Uhe(e,t){(t.visible==null||t.visible)&&e.show()}function Ghe(e,t){}function qhe(e){}function Khe(){}const Xhe=()=>g8.DefaultEventPriority,Qhe=Object.freeze(Object.defineProperty({__proto__:null,appendChild:Nhe,appendChildToContainer:The,appendInitialChild:mhe,cancelTimeout:Ehe,clearContainer:qhe,commitMount:Bhe,commitTextUpdate:zhe,commitUpdate:Hhe,createInstance:ghe,createTextInstance:vhe,detachDeletedInstance:Khe,finalizeInitialChildren:bhe,getChildHostContext:Phe,getCurrentEventPriority:Xhe,getPublicInstance:xhe,getRootHostContext:_he,hideInstance:Whe,hideTextInstance:Vhe,idlePriority:oh.unstable_IdlePriority,insertBefore:b8,insertInContainerBefore:$he,isPrimaryRenderer:Rhe,noTimeout:Ohe,now:oh.unstable_now,prepareForCommit:yhe,preparePortalMount:whe,prepareUpdate:Che,removeChild:Lhe,removeChildFromContainer:Fhe,resetAfterCommit:She,resetTextContent:khe,run:oh.unstable_runWithPriority,scheduleTimeout:Ihe,shouldDeprioritizeSubtree:jhe,shouldSetTextContent:Mhe,supportsMutation:Ahe,unhideInstance:Uhe,unhideTextInstance:Ghe,warnsIfNotActing:Dhe},Symbol.toStringTag,{value:"Module"}));var Yhe=Object.defineProperty,Jhe=Object.defineProperties,Zhe=Object.getOwnPropertyDescriptors,k_=Object.getOwnPropertySymbols,eme=Object.prototype.hasOwnProperty,tme=Object.prototype.propertyIsEnumerable,j_=(e,t,n)=>t in e?Yhe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,__=(e,t)=>{for(var n in t||(t={}))eme.call(t,n)&&j_(e,n,t[n]);if(k_)for(var n of k_(t))tme.call(t,n)&&j_(e,n,t[n]);return e},nme=(e,t)=>Jhe(e,Zhe(t));function x8(e,t,n){if(!e)return;if(n(e)===!0)return e;let r=t?e.return:e.child;for(;r;){const o=x8(r,t,n);if(o)return o;r=t?null:r.sibling}}function y8(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const v2=y8(u.createContext(null));class w8 extends u.Component{render(){return u.createElement(v2.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:P_,ReactCurrentDispatcher:I_}=u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function rme(){const e=u.useContext(v2);if(e===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const t=u.useId();return u.useMemo(()=>{for(const r of[P_==null?void 0:P_.current,e,e==null?void 0:e.alternate]){if(!r)continue;const o=x8(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 ome(){var e,t;const n=rme(),[r]=u.useState(()=>new Map);r.clear();let o=n;for(;o;){const s=(e=o.type)==null?void 0:e._context;s&&s!==v2&&!r.has(s)&&r.set(s,(t=I_==null?void 0:I_.current)==null?void 0:t.readContext(y8(s))),o=o.return}return r}function sme(){const e=ome();return u.useMemo(()=>Array.from(e.keys()).reduce((t,n)=>r=>u.createElement(t,null,u.createElement(n.Provider,nme(__({},r),{value:e.get(n)}))),t=>u.createElement(w8,__({},t))),[e])}function ame(e){const t=H.useRef({});return H.useLayoutEffect(()=>{t.current=e}),H.useLayoutEffect(()=>()=>{t.current={}},[]),t.current}const ime=e=>{const t=H.useRef(),n=H.useRef(),r=H.useRef(),o=ame(e),s=sme(),i=c=>{const{forwardedRef:f}=e;f&&(typeof f=="function"?f(c):f.current=c)};return H.useLayoutEffect(()=>(n.current=new Jd.Stage({width:e.width,height:e.height,container:t.current}),i(n.current),r.current=Sd.createContainer(n.current,g8.LegacyRoot,!1,null),Sd.updateContainer(H.createElement(s,{},e.children),r.current),()=>{Jd.isBrowser&&(i(null),Sd.updateContainer(null,r.current,null),n.current.destroy())}),[]),H.useLayoutEffect(()=>{i(n.current),s0(n.current,e,o),Sd.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})},md="Layer",ci="Group",Ra="Rect",pl="Circle",$m="Line",C8="Image",lme="Transformer",Sd=uhe(Qhe);Sd.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:H.version,rendererPackageName:"react-konva"});const cme=H.forwardRef((e,t)=>H.createElement(w8,{},H.createElement(ime,{...e,forwardedRef:t}))),ume=le([An,ks],(e,t)=>{const{tool:n,isMovingBoundingBox:r}=e;return{tool:n,isStaging:t,isMovingBoundingBox:r}},{memoizeOptions:{resultEqualityCheck:mn}}),dme=()=>{const e=se(),{tool:t,isStaging:n,isMovingBoundingBox:r}=z(ume);return{handleDragStart:u.useCallback(()=>{(t==="move"||n)&&!r&&e(kh(!0))},[e,r,n,t]),handleDragMove:u.useCallback(o=>{if(!((t==="move"||n)&&!r))return;const s={x:o.target.x(),y:o.target.y()};e(w3(s))},[e,r,n,t]),handleDragEnd:u.useCallback(()=>{(t==="move"||n)&&!r&&e(kh(!1))},[e,r,n,t])}},fme=le([An,jr,ks],(e,t,n)=>{const{cursorPosition:r,shouldLockBoundingBox:o,shouldShowBoundingBox:s,tool:i,isMaskEnabled:c,shouldSnapToGrid:f}=e;return{activeTabName:t,isCursorOnCanvas:!!r,shouldLockBoundingBox:o,shouldShowBoundingBox:s,tool:i,isStaging:n,isMaskEnabled:c,shouldSnapToGrid:f}},{memoizeOptions:{resultEqualityCheck:mn}}),pme=()=>{const e=se(),{activeTabName:t,shouldShowBoundingBox:n,tool:r,isStaging:o,isMaskEnabled:s,shouldSnapToGrid:i}=z(fme),c=u.useRef(null),f=C3(),p=()=>e(S3());St(["shift+c"],()=>{p()},{enabled:()=>!o,preventDefault:!0},[]);const h=()=>e(gx(!s));St(["h"],()=>{h()},{enabled:()=>!o,preventDefault:!0},[s]),St(["n"],()=>{e(jh(!i))},{enabled:!0,preventDefault:!0},[i]),St("esc",()=>{e(tN())},{enabled:()=>!0,preventDefault:!0}),St("shift+h",()=>{e(nN(!n))},{enabled:()=>!o,preventDefault:!0},[t,n]),St(["space"],m=>{m.repeat||(f==null||f.container().focus(),r!=="move"&&(c.current=r,e(Bc("move"))),r==="move"&&c.current&&c.current!=="move"&&(e(Bc(c.current)),c.current="move"))},{keyup:!0,keydown:!0,preventDefault:!0},[r,c])},b2=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}},S8=()=>{const e=se(),t=E1(),n=C3();return{updateColorUnderCursor:()=>{if(!n||!t)return;const r=n.getPointerPosition();if(!r)return;const o=rN.pixelRatio,[s,i,c,f]=t.getContext().getImageData(r.x*o,r.y*o,1,1).data;f&&s&&i&&c&&e(oN({r:s,g:i,b:c,a:f}))},commitColorUnderCursor:()=>{e(sN())}}},hme=le([jr,An,ks],(e,t,n)=>{const{tool:r}=t;return{tool:r,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:mn}}),mme=e=>{const t=se(),{tool:n,isStaging:r}=z(hme),{commitColorUnderCursor:o}=S8();return u.useCallback(s=>{if(!e.current)return;if(e.current.container().focus(),n==="move"||r){t(kh(!0));return}if(n==="colorPicker"){o();return}const i=b2(e.current);i&&(s.evt.preventDefault(),t(k3(!0)),t(aN([i.x,i.y])))},[e,n,r,t,o])},gme=le([jr,An,ks],(e,t,n)=>{const{tool:r,isDrawing:o}=t;return{tool:r,isDrawing:o,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:mn}}),vme=(e,t,n)=>{const r=se(),{isDrawing:o,tool:s,isStaging:i}=z(gme),{updateColorUnderCursor:c}=S8();return u.useCallback(()=>{if(!e.current)return;const f=b2(e.current);if(f){if(r(iN(f)),n.current=f,s==="colorPicker"){c();return}!o||s==="move"||i||(t.current=!0,r(j3([f.x,f.y])))}},[t,r,o,i,n,e,s,c])},bme=()=>{const e=se();return u.useCallback(()=>{e(lN())},[e])},xme=le([jr,An,ks],(e,t,n)=>{const{tool:r,isDrawing:o}=t;return{tool:r,isDrawing:o,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:mn}}),yme=(e,t)=>{const n=se(),{tool:r,isDrawing:o,isStaging:s}=z(xme);return u.useCallback(()=>{if(r==="move"||s){n(kh(!1));return}if(!t.current&&o&&e.current){const i=b2(e.current);if(!i)return;n(j3([i.x,i.y]))}else t.current=!1;n(k3(!1))},[t,n,o,s,e,r])},wme=le([An],e=>{const{isMoveStageKeyHeld:t,stageScale:n}=e;return{isMoveStageKeyHeld:t,stageScale:n}},{memoizeOptions:{resultEqualityCheck:mn}}),Cme=e=>{const t=se(),{isMoveStageKeyHeld:n,stageScale:r}=z(wme);return u.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 c=o.evt.deltaY;o.evt.ctrlKey&&(c=-c);const f=El(r*dN**c,uN,cN),p={x:s.x-i.x*f,y:s.y-i.y*f};t(fN(f)),t(w3(p))},[e,n,r,t])},Sme=le(An,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:mn}}),kme=()=>{const{boundingBoxCoordinates:e,boundingBoxDimensions:t,shouldDarkenOutsideBoundingBox:n,stageCoordinates:r,stageDimensions:o,stageScale:s}=z(Sme);return a.jsxs(ci,{children:[a.jsx(Ra,{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(Ra,{x:e.x,y:e.y,width:t.width,height:t.height,fill:"rgb(255,255,255)",listening:!1,visible:n,globalCompositeOperation:"destination-out"})]})},jme=u.memo(kme),_me=le([An],e=>{const{stageScale:t,stageCoordinates:n,stageDimensions:r}=e;return{stageScale:t,stageCoordinates:n,stageDimensions:r}},{memoizeOptions:{resultEqualityCheck:mn}}),Pme=()=>{const{stageScale:e,stageCoordinates:t,stageDimensions:n}=z(_me),{colorMode:r}=di(),[o,s]=u.useState([]),[i,c]=xa("colors",["base.800","base.200"]),f=u.useCallback(p=>p/e,[e]);return u.useLayoutEffect(()=>{const{width:p,height:h}=n,{x:m,y:v}=t,b={x1:0,y1:0,x2:p,y2:h,offset:{x:f(m),y:f(v)}},y={x:Math.ceil(f(m)/64)*64,y:Math.ceil(f(v)/64)*64},x={x1:-y.x,y1:-y.y,x2:f(p)-y.x+64,y2:f(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)},j=k.x2-k.x1,_=k.y2-k.y1,I=Math.round(j/64)+1,O=Math.round(_/64)+1,E=$C(0,I).map(R=>a.jsx($m,{x:k.x1+R*64,y:k.y1,points:[0,0,0,_],stroke:r==="dark"?i:c,strokeWidth:1},`x_${R}`)),M=$C(0,O).map(R=>a.jsx($m,{x:k.x1,y:k.y1+R*64,points:[0,0,j,0],stroke:r==="dark"?i:c,strokeWidth:1},`y_${R}`));s(E.concat(M))},[e,t,n,f,r,i,c]),a.jsx(ci,{children:o})},Ime=u.memo(Pme),Eme=le([Cs,An],(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:mn}}),Ome=e=>{const{...t}=e,{progressImage:n,boundingBox:r}=z(Eme),[o,s]=u.useState(null);return u.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},Mme=u.memo(Ome),Il=e=>{const{r:t,g:n,b:r,a:o}=e;return`rgba(${t}, ${n}, ${r}, ${o})`},Rme=le(An,e=>{const{maskColor:t,stageCoordinates:n,stageDimensions:r,stageScale:o}=e;return{stageCoordinates:n,stageDimensions:r,stageScale:o,maskColorString:Il(t)}}),E_=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),Dme=e=>{const{...t}=e,{maskColorString:n,stageCoordinates:r,stageDimensions:o,stageScale:s}=z(Rme),[i,c]=u.useState(null),[f,p]=u.useState(0),h=u.useRef(null),m=u.useCallback(()=>{p(f+1),setTimeout(m,500)},[f]);return u.useEffect(()=>{if(i)return;const v=new Image;v.onload=()=>{c(v)},v.src=E_(n)},[i,n]),u.useEffect(()=>{i&&(i.src=E_(n))},[i,n]),u.useEffect(()=>{const v=setInterval(()=>p(b=>(b+1)%5),50);return()=>clearInterval(v)},[]),!i||!pc(r.x)||!pc(r.y)||!pc(s)||!pc(o.width)||!pc(o.height)?null:a.jsx(Ra,{ref:h,offsetX:r.x/s,offsetY:r.y/s,height:o.height/s,width:o.width/s,fillPatternImage:i,fillPatternOffsetY:pc(f)?f:0,fillPatternRepeat:"repeat",fillPatternScale:{x:1/s,y:1/s},listening:!0,globalCompositeOperation:"source-in",...t})},Ame=u.memo(Dme),Nme=le([An],e=>({objects:e.layerState.objects}),{memoizeOptions:{resultEqualityCheck:mn}}),Tme=e=>{const{...t}=e,{objects:n}=z(Nme);return a.jsx(ci,{listening:!1,...t,children:n.filter(pN).map((r,o)=>a.jsx($m,{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))})},$me=u.memo(Tme);var hl=u,Lme=function(t,n,r){const o=hl.useRef("loading"),s=hl.useRef(),[i,c]=hl.useState(0),f=hl.useRef(),p=hl.useRef(),h=hl.useRef();return(f.current!==t||p.current!==n||h.current!==r)&&(o.current="loading",s.current=void 0,f.current=t,p.current=n,h.current=r),hl.useLayoutEffect(function(){if(!t)return;var m=document.createElement("img");function v(){o.current="loaded",s.current=m,c(Math.random())}function b(){o.current="failed",s.current=void 0,c(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 Fme=Cu(Lme),zme=e=>{const{width:t,height:n,x:r,y:o,imageName:s}=e.canvasImage,{currentData:i,isError:c}=qo(s??Yo.skipToken),[f]=Fme((i==null?void 0:i.image_url)??"",hN.get()?"use-credentials":"anonymous");return c?a.jsx(Ra,{x:r,y:o,width:t,height:n,fill:"red"}):a.jsx(C8,{x:r,y:o,image:f,listening:!1})},k8=u.memo(zme),Bme=le([An],e=>{const{layerState:{objects:t}}=e;return{objects:t}},{memoizeOptions:{resultEqualityCheck:mn}}),Hme=()=>{const{objects:e}=z(Bme);return e?a.jsx(ci,{name:"outpainting-objects",listening:!1,children:e.map((t,n)=>{if(mN(t))return a.jsx(k8,{canvasImage:t},n);if(gN(t)){const r=a.jsx($m,{points:t.points,stroke:t.color?Il(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(ci,{clipX:t.clip.x,clipY:t.clip.y,clipWidth:t.clip.width,clipHeight:t.clip.height,children:r},n):r}else{if(vN(t))return a.jsx(Ra,{x:t.x,y:t.y,width:t.width,height:t.height,fill:Il(t.color)},n);if(bN(t))return a.jsx(Ra,{x:t.x,y:t.y,width:t.width,height:t.height,fill:"rgb(255, 255, 255)",globalCompositeOperation:"destination-out"},n)}})}):null},Wme=u.memo(Hme),Vme=le([An],e=>{const{layerState:t,shouldShowStagingImage:n,shouldShowStagingOutline:r,boundingBoxCoordinates:{x:o,y:s},boundingBoxDimensions:{width:i,height:c}}=e,{selectedImageIndex:f,images:p}=t.stagingArea;return{currentStagingAreaImage:p.length>0&&f!==void 0?p[f]:void 0,isOnFirstImage:f===0,isOnLastImage:f===p.length-1,shouldShowStagingImage:n,shouldShowStagingOutline:r,x:o,y:s,width:i,height:c}},{memoizeOptions:{resultEqualityCheck:mn}}),Ume=e=>{const{...t}=e,{currentStagingAreaImage:n,shouldShowStagingImage:r,shouldShowStagingOutline:o,x:s,y:i,width:c,height:f}=z(Vme);return a.jsxs(ci,{...t,children:[r&&n&&a.jsx(k8,{canvasImage:n}),o&&a.jsxs(ci,{children:[a.jsx(Ra,{x:s,y:i,width:c,height:f,strokeWidth:1,stroke:"white",strokeScaleEnabled:!1}),a.jsx(Ra,{x:s,y:i,width:c,height:f,dash:[4,4],strokeWidth:1,stroke:"black",strokeScaleEnabled:!1})]})]})},Gme=u.memo(Ume),qme=le([An],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:mn}}),Kme=()=>{const e=se(),{isOnFirstImage:t,isOnLastImage:n,currentStagingAreaImage:r,shouldShowStagingImage:o,sessionId:s}=z(qme),{t:i}=Ie(),c=u.useCallback(()=>{e(OC(!0))},[e]),f=u.useCallback(()=>{e(OC(!1))},[e]);St(["left"],()=>{p()},{enabled:()=>!0,preventDefault:!0}),St(["right"],()=>{h()},{enabled:()=>!0,preventDefault:!0}),St(["enter"],()=>{m()},{enabled:()=>!0,preventDefault:!0});const p=u.useCallback(()=>e(xN()),[e]),h=u.useCallback(()=>e(yN()),[e]),m=u.useCallback(()=>e(wN(s)),[e,s]),{data:v}=qo((r==null?void 0:r.imageName)??Yo.skipToken);return r?a.jsx($,{pos:"absolute",bottom:4,w:"100%",align:"center",justify:"center",onMouseOver:c,onMouseOut:f,children:a.jsxs(vr,{isAttached:!0,borderRadius:"base",shadow:"dark-lg",children:[a.jsx(tt,{tooltip:`${i("unifiedCanvas.previous")} (Left)`,"aria-label":`${i("unifiedCanvas.previous")} (Left)`,icon:a.jsx(nJ,{}),onClick:p,colorScheme:"accent",isDisabled:t}),a.jsx(tt,{tooltip:`${i("unifiedCanvas.next")} (Right)`,"aria-label":`${i("unifiedCanvas.next")} (Right)`,icon:a.jsx(rJ,{}),onClick:h,colorScheme:"accent",isDisabled:n}),a.jsx(tt,{tooltip:`${i("unifiedCanvas.accept")} (Enter)`,"aria-label":`${i("unifiedCanvas.accept")} (Enter)`,icon:a.jsx(AE,{}),onClick:m,colorScheme:"accent"}),a.jsx(tt,{tooltip:i("unifiedCanvas.showHide"),"aria-label":i("unifiedCanvas.showHide"),"data-alert":!o,icon:o?a.jsx(bJ,{}):a.jsx(vJ,{}),onClick:()=>e(CN(!o)),colorScheme:"accent"}),a.jsx(tt,{tooltip:i("unifiedCanvas.saveToGallery"),"aria-label":i("unifiedCanvas.saveToGallery"),isDisabled:!v||!v.is_intermediate,icon:a.jsx(Eg,{}),onClick:()=>{v&&e(SN({imageDTO:v}))},colorScheme:"accent"}),a.jsx(tt,{tooltip:i("unifiedCanvas.discardAll"),"aria-label":i("unifiedCanvas.discardAll"),icon:a.jsx(Yl,{style:{transform:"rotate(45deg)"}}),onClick:()=>e(kN()),colorScheme:"error",fontSize:20})]})}):null},Xme=u.memo(Kme),Qme=()=>{const e=z(c=>c.canvas.layerState),t=z(c=>c.canvas.boundingBoxCoordinates),n=z(c=>c.canvas.boundingBoxDimensions),r=z(c=>c.canvas.isMaskEnabled),o=z(c=>c.canvas.shouldPreserveMaskedArea),[s,i]=u.useState();return u.useEffect(()=>{i(void 0)},[e,t,n,r,o]),WJ(async()=>{const c=await jN(e,t,n,r,o);if(!c)return;const{baseImageData:f,maskImageData:p}=c,h=_N(f,p);i(h)},1e3,[e,t,n,r,o]),s},Yme={txt2img:"Text to Image",img2img:"Image to Image",inpaint:"Inpaint",outpaint:"Inpaint"},Jme=()=>{const e=Qme();return a.jsxs(Fe,{children:["Mode: ",e?Yme[e]:"..."]})},Zme=u.memo(Jme),Fc=e=>Math.round(e*100)/100,ege=le([An],e=>{const{cursorPosition:t}=e,{cursorX:n,cursorY:r}=t?{cursorX:t.x,cursorY:t.y}:{cursorX:-1,cursorY:-1};return{cursorCoordinatesString:`(${Fc(n)}, ${Fc(r)})`}},{memoizeOptions:{resultEqualityCheck:mn}});function tge(){const{cursorCoordinatesString:e}=z(ege),{t}=Ie();return a.jsx(Fe,{children:`${t("unifiedCanvas.cursorPosition")}: ${e}`})}const Qb="var(--invokeai-colors-warning-500)",nge=le([An],e=>{const{stageDimensions:{width:t,height:n},stageCoordinates:{x:r,y:o},boundingBoxDimensions:{width:s,height:i},scaledBoundingBoxDimensions:{width:c,height:f},boundingBoxCoordinates:{x:p,y:h},stageScale:m,shouldShowCanvasDebugInfo:v,layer:b,boundingBoxScaleMethod:y,shouldPreserveMaskedArea:x}=e;let C="inherit";return(y==="none"&&(s<512||i<512)||y==="manual"&&c*f<512*512)&&(C=Qb),{activeLayerColor:b==="mask"?Qb:"inherit",activeLayerString:b.charAt(0).toUpperCase()+b.slice(1),boundingBoxColor:C,boundingBoxCoordinatesString:`(${Fc(p)}, ${Fc(h)})`,boundingBoxDimensionsString:`${s}×${i}`,scaledBoundingBoxDimensionsString:`${c}×${f}`,canvasCoordinatesString:`${Fc(r)}×${Fc(o)}`,canvasDimensionsString:`${t}×${n}`,canvasScaleString:Math.round(m*100),shouldShowCanvasDebugInfo:v,shouldShowBoundingBox:y!=="auto",shouldShowScaledBoundingBox:y!=="none",shouldPreserveMaskedArea:x}},{memoizeOptions:{resultEqualityCheck:mn}}),rge=()=>{const{activeLayerColor:e,activeLayerString:t,boundingBoxColor:n,boundingBoxCoordinatesString:r,boundingBoxDimensionsString:o,scaledBoundingBoxDimensionsString:s,shouldShowScaledBoundingBox:i,canvasCoordinatesString:c,canvasDimensionsString:f,canvasScaleString:p,shouldShowCanvasDebugInfo:h,shouldShowBoundingBox:m,shouldPreserveMaskedArea:v}=z(nge),{t:b}=Ie();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(Zme,{}),a.jsx(Fe,{style:{color:e},children:`${b("unifiedCanvas.activeLayer")}: ${t}`}),a.jsx(Fe,{children:`${b("unifiedCanvas.canvasScale")}: ${p}%`}),v&&a.jsx(Fe,{style:{color:Qb},children:"Preserve Masked Area: On"}),m&&a.jsx(Fe,{style:{color:n},children:`${b("unifiedCanvas.boundingBox")}: ${o}`}),i&&a.jsx(Fe,{style:{color:n},children:`${b("unifiedCanvas.scaledBoundingBox")}: ${s}`}),h&&a.jsxs(a.Fragment,{children:[a.jsx(Fe,{children:`${b("unifiedCanvas.boundingBoxPosition")}: ${r}`}),a.jsx(Fe,{children:`${b("unifiedCanvas.canvasDimensions")}: ${f}`}),a.jsx(Fe,{children:`${b("unifiedCanvas.canvasPosition")}: ${c}`}),a.jsx(tge,{})]})]})},oge=u.memo(rge),sge=le([ke],({canvas:e,generation:t})=>{const{boundingBoxCoordinates:n,boundingBoxDimensions:r,stageScale:o,isDrawing:s,isTransformingBoundingBox:i,isMovingBoundingBox:c,tool:f,shouldSnapToGrid:p}=e,{aspectRatio:h}=t;return{boundingBoxCoordinates:n,boundingBoxDimensions:r,isDrawing:s,isMovingBoundingBox:c,isTransformingBoundingBox:i,stageScale:o,shouldSnapToGrid:p,tool:f,hitStrokeWidth:20/o,aspectRatio:h}},{memoizeOptions:{resultEqualityCheck:mn}}),age=e=>{const{...t}=e,n=se(),{boundingBoxCoordinates:r,boundingBoxDimensions:o,isDrawing:s,isMovingBoundingBox:i,isTransformingBoundingBox:c,stageScale:f,shouldSnapToGrid:p,tool:h,hitStrokeWidth:m,aspectRatio:v}=z(sge),b=u.useRef(null),y=u.useRef(null),[x,C]=u.useState(!1);u.useEffect(()=>{var B;!b.current||!y.current||(b.current.nodes([y.current]),(B=b.current.getLayer())==null||B.batchDraw())},[]);const k=64*f;St("N",()=>{n(jh(!p))});const j=u.useCallback(B=>{if(!p){n(fv({x:Math.floor(B.target.x()),y:Math.floor(B.target.y())}));return}const G=B.target.x(),Q=B.target.y(),V=zs(G,64),L=zs(Q,64);B.target.x(V),B.target.y(L),n(fv({x:V,y:L}))},[n,p]),_=u.useCallback(()=>{if(!y.current)return;const B=y.current,G=B.scaleX(),Q=B.scaleY(),V=Math.round(B.width()*G),L=Math.round(B.height()*Q),X=Math.round(B.x()),F=Math.round(B.y());if(v){const q=zs(V/v,64);n(Ls({width:V,height:q}))}else n(Ls({width:V,height:L}));n(fv({x:p?gd(X,64):X,y:p?gd(F,64):F})),B.scaleX(1),B.scaleY(1)},[n,p,v]),I=u.useCallback((B,G,Q)=>{const V=B.x%k,L=B.y%k;return{x:gd(G.x,k)+V,y:gd(G.y,k)+L}},[k]),O=()=>{n(pv(!0))},E=()=>{n(pv(!1)),n(hv(!1)),n(Cp(!1)),C(!1)},M=()=>{n(hv(!0))},R=()=>{n(pv(!1)),n(hv(!1)),n(Cp(!1)),C(!1)},A=()=>{C(!0)},D=()=>{!c&&!i&&C(!1)},T=()=>{n(Cp(!0))},K=()=>{n(Cp(!1))};return a.jsxs(ci,{...t,children:[a.jsx(Ra,{height:o.height,width:o.width,x:r.x,y:r.y,onMouseEnter:T,onMouseOver:T,onMouseLeave:K,onMouseOut:K}),a.jsx(Ra,{draggable:!0,fillEnabled:!1,height:o.height,hitStrokeWidth:m,listening:!s&&h==="move",onDragStart:M,onDragEnd:R,onDragMove:j,onMouseDown:M,onMouseOut:D,onMouseOver:A,onMouseEnter:A,onMouseUp:R,onTransform:_,onTransformEnd:E,ref:y,stroke:x?"rgba(255,255,255,0.7)":"white",strokeWidth:(x?8:1)/f,width:o.width,x:r.x,y:r.y}),a.jsx(lme,{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:M,onDragEnd:R,onMouseDown:O,onMouseUp:E,onTransformEnd:E,ref:b,rotateEnabled:!1})]})},ige=u.memo(age),lge=le(An,e=>{const{cursorPosition:t,brushSize:n,colorPickerColor:r,maskColor:o,brushColor:s,tool:i,layer:c,shouldShowBrush:f,isMovingBoundingBox:p,isTransformingBoundingBox:h,stageScale:m,stageDimensions:v,boundingBoxCoordinates:b,boundingBoxDimensions:y,shouldRestrictStrokesToBox:x}=e,C=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:MC/m,colorPickerInnerRadius:(MC-O1+1)/m,maskColorString:Il({...o,a:.5}),brushColorString:Il(s),colorPickerColorString:Il(r),tool:i,layer:c,shouldShowBrush:f,shouldDrawBrushPreview:!(p||h||!t)&&f,strokeWidth:1.5/m,dotRadius:1.5/m,clip:C}},{memoizeOptions:{resultEqualityCheck:mn}}),cge=e=>{const{...t}=e,{brushX:n,brushY:r,radius:o,maskColorString:s,tool:i,layer:c,shouldDrawBrushPreview:f,dotRadius:p,strokeWidth:h,brushColorString:m,colorPickerColorString:v,colorPickerInnerRadius:b,colorPickerOuterRadius:y,clip:x}=z(lge);return f?a.jsxs(ci,{listening:!1,...x,...t,children:[i==="colorPicker"?a.jsxs(a.Fragment,{children:[a.jsx(pl,{x:n,y:r,radius:y,stroke:m,strokeWidth:O1,strokeScaleEnabled:!1}),a.jsx(pl,{x:n,y:r,radius:b,stroke:v,strokeWidth:O1,strokeScaleEnabled:!1})]}):a.jsxs(a.Fragment,{children:[a.jsx(pl,{x:n,y:r,radius:o,fill:c==="mask"?s:m,globalCompositeOperation:i==="eraser"?"destination-out":"source-out"}),a.jsx(pl,{x:n,y:r,radius:o,stroke:"rgba(255,255,255,0.4)",strokeWidth:h*2,strokeEnabled:!0,listening:!1}),a.jsx(pl,{x:n,y:r,radius:o,stroke:"rgba(0,0,0,1)",strokeWidth:h,strokeEnabled:!0,listening:!1})]}),a.jsx(pl,{x:n,y:r,radius:p*2,fill:"rgba(255,255,255,0.4)",listening:!1}),a.jsx(pl,{x:n,y:r,radius:p,fill:"rgba(0,0,0,1)",listening:!1})]}):null},uge=u.memo(cge),dge=le([An,ks],(e,t)=>{const{isMaskEnabled:n,stageScale:r,shouldShowBoundingBox:o,isTransformingBoundingBox:s,isMouseOverBoundingBox:i,isMovingBoundingBox:c,stageDimensions:f,stageCoordinates:p,tool:h,isMovingStage:m,shouldShowIntermediates:v,shouldShowGrid:b,shouldRestrictStrokesToBox:y,shouldAntialias:x}=e;let C="none";return h==="move"||t?m?C="grabbing":C="grab":s?C=void 0:y&&!i&&(C="default"),{isMaskEnabled:n,isModifyingBoundingBox:s||c,shouldShowBoundingBox:o,shouldShowGrid:b,stageCoordinates:p,stageCursor:C,stageDimensions:f,stageScale:r,tool:h,isStaging:t,shouldShowIntermediates:v,shouldAntialias:x}},Oe),fge=Me(cme,{shouldForwardProp:e=>!["sx"].includes(e)}),pge=()=>{const{isMaskEnabled:e,isModifyingBoundingBox:t,shouldShowBoundingBox:n,shouldShowGrid:r,stageCoordinates:o,stageCursor:s,stageDimensions:i,stageScale:c,tool:f,isStaging:p,shouldShowIntermediates:h,shouldAntialias:m}=z(dge);pme();const v=se(),b=u.useRef(null),y=u.useRef(null),x=u.useRef(null),C=u.useCallback(K=>{IN(K),y.current=K},[]),k=u.useCallback(K=>{EN(K),x.current=K},[]),j=u.useRef({x:0,y:0}),_=u.useRef(!1),I=Cme(y),O=mme(y),E=yme(y,_),M=vme(y,_,j),R=bme(),{handleDragStart:A,handleDragMove:D,handleDragEnd:T}=dme();return u.useEffect(()=>{if(!b.current)return;const K=new ResizeObserver(B=>{for(const G of B)if(G.contentBoxSize){const{width:Q,height:V}=G.contentRect;v(PN({width:Q,height:V}))}});return K.observe(b.current),()=>{K.disconnect()}},[v]),a.jsxs($,{id:"canvas-container",ref:b,sx:{position:"relative",height:"100%",width:"100%",borderRadius:"base"},children:[a.jsx(Fe,{sx:{position:"absolute"},children:a.jsxs(fge,{tabIndex:-1,ref:C,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:c,y:c},onTouchStart:O,onTouchMove:M,onTouchEnd:E,onMouseDown:O,onMouseLeave:R,onMouseMove:M,onMouseUp:E,onDragStart:A,onDragMove:D,onDragEnd:T,onContextMenu:K=>K.evt.preventDefault(),onWheel:I,draggable:(f==="move"||p)&&!t,children:[a.jsx(md,{id:"grid",visible:r,children:a.jsx(Ime,{})}),a.jsx(md,{id:"base",ref:k,listening:!1,imageSmoothingEnabled:m,children:a.jsx(Wme,{})}),a.jsxs(md,{id:"mask",visible:e,listening:!1,children:[a.jsx($me,{visible:!0,listening:!1}),a.jsx(Ame,{listening:!1})]}),a.jsx(md,{children:a.jsx(jme,{})}),a.jsxs(md,{id:"preview",imageSmoothingEnabled:m,children:[!p&&a.jsx(uge,{visible:f!=="move",listening:!1}),a.jsx(Gme,{visible:p}),h&&a.jsx(Mme,{}),a.jsx(ige,{visible:n&&!p})]})]})}),a.jsx(oge,{}),a.jsx(Xme,{})]})},hge=u.memo(pge);function mge(e,t,n=250){const[r,o]=u.useState(0);return u.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 gge=Me(wM,{baseStyle:{paddingInline:4},shouldForwardProp:e=>!["pickerColor"].includes(e)}),g1={width:6,height:6,borderColor:"base.100"},vge=e=>{const{styleClass:t="",...n}=e;return a.jsx(gge,{sx:{".react-colorful__hue-pointer":g1,".react-colorful__saturation-pointer":g1,".react-colorful__alpha-pointer":g1},className:t,...n})},j8=u.memo(vge),bge=le([An,ks],(e,t)=>{const{maskColor:n,layer:r,isMaskEnabled:o,shouldPreserveMaskedArea:s}=e;return{layer:r,maskColor:n,maskColorString:Il(n),isMaskEnabled:o,shouldPreserveMaskedArea:s,isStaging:t}},{memoizeOptions:{resultEqualityCheck:mn}}),xge=()=>{const e=se(),{t}=Ie(),{layer:n,maskColor:r,isMaskEnabled:o,shouldPreserveMaskedArea:s,isStaging:i}=z(bge);St(["q"],()=>{c()},{enabled:()=>!i,preventDefault:!0},[n]),St(["shift+c"],()=>{f()},{enabled:()=>!i,preventDefault:!0},[]),St(["h"],()=>{p()},{enabled:()=>!i,preventDefault:!0},[o]);const c=()=>{e(_3(n==="mask"?"base":"mask"))},f=()=>e(S3()),p=()=>e(gx(!o)),h=async()=>{e(RN())};return a.jsx(Rf,{triggerComponent:a.jsx(vr,{children:a.jsx(tt,{"aria-label":t("unifiedCanvas.maskingOptions"),tooltip:t("unifiedCanvas.maskingOptions"),icon:a.jsx(HE,{}),isChecked:n==="mask",isDisabled:i})}),children:a.jsxs($,{direction:"column",gap:2,children:[a.jsx(bo,{label:`${t("unifiedCanvas.enableMask")} (H)`,isChecked:o,onChange:p}),a.jsx(bo,{label:t("unifiedCanvas.preserveMaskedArea"),isChecked:s,onChange:m=>e(ON(m.target.checked))}),a.jsx(j8,{sx:{paddingTop:2,paddingBottom:2},pickerColor:r,onChange:m=>e(MN(m))}),a.jsx(Wt,{size:"sm",leftIcon:a.jsx(Eg,{}),onClick:h,children:"Save Mask"}),a.jsxs(Wt,{size:"sm",leftIcon:a.jsx(Jo,{}),onClick:f,children:[t("unifiedCanvas.clearMask")," (Shift+C)"]})]})})},yge=u.memo(xge),wge=le([An,jr,Cs],(e,t,n)=>{const{futureLayerStates:r}=e;return{canRedo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:mn}});function Cge(){const e=se(),{canRedo:t,activeTabName:n}=z(wge),{t:r}=Ie(),o=()=>{e(DN())};return St(["meta+shift+z","ctrl+shift+z","control+y","meta+y"],()=>{o()},{enabled:()=>t,preventDefault:!0},[n,t]),a.jsx(tt,{"aria-label":`${r("unifiedCanvas.redo")} (Ctrl+Shift+Z)`,tooltip:`${r("unifiedCanvas.redo")} (Ctrl+Shift+Z)`,icon:a.jsx(EJ,{}),onClick:o,isDisabled:!t})}const Sge=()=>{const e=z(ks),t=se(),{t:n}=Ie();return a.jsxs(d2,{title:n("unifiedCanvas.clearCanvasHistory"),acceptCallback:()=>t(AN()),acceptButtonText:n("unifiedCanvas.clearHistory"),triggerComponent:a.jsx(Wt,{size:"sm",leftIcon:a.jsx(Jo,{}),isDisabled:e,children:n("unifiedCanvas.clearCanvasHistory")}),children:[a.jsx("p",{children:n("unifiedCanvas.clearCanvasHistoryMessage")}),a.jsx("br",{}),a.jsx("p",{children:n("unifiedCanvas.clearCanvasHistoryConfirm")})]})},kge=u.memo(Sge),jge=le([An],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:o,shouldShowGrid:s,shouldShowIntermediates:i,shouldSnapToGrid:c,shouldRestrictStrokesToBox:f,shouldAntialias:p}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:o,shouldShowGrid:s,shouldShowIntermediates:i,shouldSnapToGrid:c,shouldRestrictStrokesToBox:f,shouldAntialias:p}},{memoizeOptions:{resultEqualityCheck:mn}}),_ge=()=>{const e=se(),{t}=Ie(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldDarkenOutsideBoundingBox:o,shouldShowCanvasDebugInfo:s,shouldShowGrid:i,shouldShowIntermediates:c,shouldSnapToGrid:f,shouldRestrictStrokesToBox:p,shouldAntialias:h}=z(jge);St(["n"],()=>{e(jh(!f))},{enabled:!0,preventDefault:!0},[f]);const m=v=>e(jh(v.target.checked));return a.jsx(Rf,{isLazy:!1,triggerComponent:a.jsx(tt,{tooltip:t("unifiedCanvas.canvasSettings"),"aria-label":t("unifiedCanvas.canvasSettings"),icon:a.jsx(qE,{})}),children:a.jsxs($,{direction:"column",gap:2,children:[a.jsx(bo,{label:t("unifiedCanvas.showIntermediates"),isChecked:c,onChange:v=>e(NN(v.target.checked))}),a.jsx(bo,{label:t("unifiedCanvas.showGrid"),isChecked:i,onChange:v=>e(TN(v.target.checked))}),a.jsx(bo,{label:t("unifiedCanvas.snapToGrid"),isChecked:f,onChange:m}),a.jsx(bo,{label:t("unifiedCanvas.darkenOutsideSelection"),isChecked:o,onChange:v=>e($N(v.target.checked))}),a.jsx(bo,{label:t("unifiedCanvas.autoSaveToGallery"),isChecked:n,onChange:v=>e(LN(v.target.checked))}),a.jsx(bo,{label:t("unifiedCanvas.saveBoxRegionOnly"),isChecked:r,onChange:v=>e(FN(v.target.checked))}),a.jsx(bo,{label:t("unifiedCanvas.limitStrokesToBox"),isChecked:p,onChange:v=>e(zN(v.target.checked))}),a.jsx(bo,{label:t("unifiedCanvas.showCanvasDebugInfo"),isChecked:s,onChange:v=>e(BN(v.target.checked))}),a.jsx(bo,{label:t("unifiedCanvas.antialiasing"),isChecked:h,onChange:v=>e(HN(v.target.checked))}),a.jsx(kge,{})]})})},Pge=u.memo(_ge),Ige=le([An,ks,Cs],(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:mn}}),Ege=()=>{const e=se(),{tool:t,brushColor:n,brushSize:r,isStaging:o}=z(Ige),{t:s}=Ie();St(["b"],()=>{i()},{enabled:()=>!o,preventDefault:!0},[]),St(["e"],()=>{c()},{enabled:()=>!o,preventDefault:!0},[t]),St(["c"],()=>{f()},{enabled:()=>!o,preventDefault:!0},[t]),St(["shift+f"],()=>{p()},{enabled:()=>!o,preventDefault:!0}),St(["delete","backspace"],()=>{h()},{enabled:()=>!o,preventDefault:!0}),St(["BracketLeft"],()=>{e(mv(Math.max(r-5,5)))},{enabled:()=>!o,preventDefault:!0},[r]),St(["BracketRight"],()=>{e(mv(Math.min(r+5,500)))},{enabled:()=>!o,preventDefault:!0},[r]),St(["Shift+BracketLeft"],()=>{e(gv({...n,a:El(n.a-.05,.05,1)}))},{enabled:()=>!o,preventDefault:!0},[n]),St(["Shift+BracketRight"],()=>{e(gv({...n,a:El(n.a+.05,.05,1)}))},{enabled:()=>!o,preventDefault:!0},[n]);const i=()=>e(Bc("brush")),c=()=>e(Bc("eraser")),f=()=>e(Bc("colorPicker")),p=()=>e(WN()),h=()=>e(VN());return a.jsxs(vr,{isAttached:!0,children:[a.jsx(tt,{"aria-label":`${s("unifiedCanvas.brush")} (B)`,tooltip:`${s("unifiedCanvas.brush")} (B)`,icon:a.jsx(PJ,{}),isChecked:t==="brush"&&!o,onClick:i,isDisabled:o}),a.jsx(tt,{"aria-label":`${s("unifiedCanvas.eraser")} (E)`,tooltip:`${s("unifiedCanvas.eraser")} (E)`,icon:a.jsx(dJ,{}),isChecked:t==="eraser"&&!o,isDisabled:o,onClick:c}),a.jsx(tt,{"aria-label":`${s("unifiedCanvas.fillBoundingBox")} (Shift+F)`,tooltip:`${s("unifiedCanvas.fillBoundingBox")} (Shift+F)`,icon:a.jsx(xJ,{}),isDisabled:o,onClick:p}),a.jsx(tt,{"aria-label":`${s("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,tooltip:`${s("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,icon:a.jsx(Yl,{style:{transform:"rotate(45deg)"}}),isDisabled:o,onClick:h}),a.jsx(tt,{"aria-label":`${s("unifiedCanvas.colorPicker")} (C)`,tooltip:`${s("unifiedCanvas.colorPicker")} (C)`,icon:a.jsx(gJ,{}),isChecked:t==="colorPicker"&&!o,isDisabled:o,onClick:f}),a.jsx(Rf,{triggerComponent:a.jsx(tt,{"aria-label":s("unifiedCanvas.brushOptions"),tooltip:s("unifiedCanvas.brushOptions"),icon:a.jsx(UE,{})}),children:a.jsxs($,{minWidth:60,direction:"column",gap:4,width:"100%",children:[a.jsx($,{gap:4,justifyContent:"space-between",children:a.jsx(jt,{label:s("unifiedCanvas.brushSize"),value:r,withInput:!0,onChange:m=>e(mv(m)),sliderNumberInputProps:{max:500}})}),a.jsx(j8,{sx:{width:"100%",paddingTop:2,paddingBottom:2},pickerColor:n,onChange:m=>e(gv(m))})]})})]})},Oge=u.memo(Ege),Mge=le([An,jr,Cs],(e,t,n)=>{const{pastLayerStates:r}=e;return{canUndo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:mn}});function Rge(){const e=se(),{t}=Ie(),{canUndo:n,activeTabName:r}=z(Mge),o=()=>{e(UN())};return St(["meta+z","ctrl+z"],()=>{o()},{enabled:()=>n,preventDefault:!0},[r,n]),a.jsx(tt,{"aria-label":`${t("unifiedCanvas.undo")} (Ctrl+Z)`,tooltip:`${t("unifiedCanvas.undo")} (Ctrl+Z)`,icon:a.jsx(Og,{}),onClick:o,isDisabled:!n})}const Dge=le([Cs,An,ks],(e,t,n)=>{const{isProcessing:r}=e,{tool:o,shouldCropToBoundingBoxOnSave:s,layer:i,isMaskEnabled:c}=t;return{isProcessing:r,isStaging:n,isMaskEnabled:c,tool:o,layer:i,shouldCropToBoundingBoxOnSave:s}},{memoizeOptions:{resultEqualityCheck:mn}}),Age=()=>{const e=se(),{isProcessing:t,isStaging:n,isMaskEnabled:r,layer:o,tool:s}=z(Dge),i=E1(),{t:c}=Ie(),{isClipboardAPIAvailable:f}=UO(),{getUploadButtonProps:p,getUploadInputProps:h}=Ky({postUploadAction:{type:"SET_CANVAS_INITIAL_IMAGE"}});St(["v"],()=>{m()},{enabled:()=>!n,preventDefault:!0},[]),St(["r"],()=>{b()},{enabled:()=>!0,preventDefault:!0},[i]),St(["shift+m"],()=>{x()},{enabled:()=>!n,preventDefault:!0},[i,t]),St(["shift+s"],()=>{C()},{enabled:()=>!n,preventDefault:!0},[i,t]),St(["meta+c","ctrl+c"],()=>{k()},{enabled:()=>!n&&f,preventDefault:!0},[i,t,f]),St(["shift+d"],()=>{j()},{enabled:()=>!n,preventDefault:!0},[i,t]);const m=()=>e(Bc("move")),v=mge(()=>b(!1),()=>b(!0)),b=(I=!1)=>{const O=E1();if(!O)return;const E=O.getClientRect({skipTransform:!0});e(qN({contentRect:E,shouldScaleTo1:I}))},y=()=>{e(G_())},x=()=>{e(KN())},C=()=>{e(XN())},k=()=>{f&&e(QN())},j=()=>{e(YN())},_=I=>{const O=I;e(_3(O)),O==="mask"&&!r&&e(gx(!0))};return a.jsxs($,{sx:{alignItems:"center",gap:2,flexWrap:"wrap"},children:[a.jsx(Fe,{w:24,children:a.jsx(Zr,{tooltip:`${c("unifiedCanvas.layer")} (Q)`,value:o,data:GN,onChange:_,disabled:n})}),a.jsx(yge,{}),a.jsx(Oge,{}),a.jsxs(vr,{isAttached:!0,children:[a.jsx(tt,{"aria-label":`${c("unifiedCanvas.move")} (V)`,tooltip:`${c("unifiedCanvas.move")} (V)`,icon:a.jsx(oJ,{}),isChecked:s==="move"||n,onClick:m}),a.jsx(tt,{"aria-label":`${c("unifiedCanvas.resetView")} (R)`,tooltip:`${c("unifiedCanvas.resetView")} (R)`,icon:a.jsx(lJ,{}),onClick:v})]}),a.jsxs(vr,{isAttached:!0,children:[a.jsx(tt,{"aria-label":`${c("unifiedCanvas.mergeVisible")} (Shift+M)`,tooltip:`${c("unifiedCanvas.mergeVisible")} (Shift+M)`,icon:a.jsx(kJ,{}),onClick:x,isDisabled:n}),a.jsx(tt,{"aria-label":`${c("unifiedCanvas.saveToGallery")} (Shift+S)`,tooltip:`${c("unifiedCanvas.saveToGallery")} (Shift+S)`,icon:a.jsx(Eg,{}),onClick:C,isDisabled:n}),f&&a.jsx(tt,{"aria-label":`${c("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${c("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,icon:a.jsx(Du,{}),onClick:k,isDisabled:n}),a.jsx(tt,{"aria-label":`${c("unifiedCanvas.downloadAsImage")} (Shift+D)`,tooltip:`${c("unifiedCanvas.downloadAsImage")} (Shift+D)`,icon:a.jsx(Ig,{}),onClick:j,isDisabled:n})]}),a.jsxs(vr,{isAttached:!0,children:[a.jsx(Rge,{}),a.jsx(Cge,{})]}),a.jsxs(vr,{isAttached:!0,children:[a.jsx(tt,{"aria-label":`${c("common.upload")}`,tooltip:`${c("common.upload")}`,icon:a.jsx(Mg,{}),isDisabled:n,...p()}),a.jsx("input",{...h()}),a.jsx(tt,{"aria-label":`${c("unifiedCanvas.clearCanvas")}`,tooltip:`${c("unifiedCanvas.clearCanvas")}`,icon:a.jsx(Jo,{}),onClick:y,colorScheme:"error",isDisabled:n})]}),a.jsx(vr,{isAttached:!0,children:a.jsx(Pge,{})})]})},Nge=u.memo(Age),O_={id:"canvas-intial-image",actionType:"SET_CANVAS_INITIAL_IMAGE"},Tge=()=>{const{isOver:e,setNodeRef:t,active:n}=Fy({id:"unifiedCanvas",data:O_});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(Nge,{}),a.jsx(hge,{}),zy(O_,n)&&a.jsx(By,{isOver:e,label:"Set Canvas Initial Image"})]})},$ge=u.memo(Tge),Lge=()=>a.jsx($ge,{}),Fge=u.memo(Lge),zge=[{id:"txt2img",translationKey:"common.txt2img",icon:a.jsx(Tr,{as:yJ,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(ahe,{})},{id:"img2img",translationKey:"common.img2img",icon:a.jsx(Tr,{as:Fl,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(mue,{})},{id:"unifiedCanvas",translationKey:"common.unifiedCanvas",icon:a.jsx(Tr,{as:xne,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(Fge,{})},{id:"nodes",translationKey:"common.nodes",icon:a.jsx(Tr,{as:Gg,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(ohe,{})},{id:"modelManager",translationKey:"modelManager.modelManager",icon:a.jsx(Tr,{as:cJ,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(hde,{})}],Bge=le([ke],({config:e})=>{const{disabledTabs:t}=e;return zge.filter(r=>!t.includes(r.id))},{memoizeOptions:{resultEqualityCheck:mn}}),Hge=448,Wge=448,Vge=360,Uge=["modelManager"],Gge=["modelManager"],qge=()=>{const e=z(JN),t=z(jr),n=z(Bge),{t:r}=Ie(),o=se(),s=u.useCallback(D=>{D.target instanceof HTMLElement&&D.target.blur()},[]),i=u.useMemo(()=>n.map(D=>a.jsx(Mn,{hasArrow:!0,label:String(r(D.translationKey)),placement:"end",children:a.jsxs(Ro,{onClick:s,children:[a.jsx(H3,{children:String(r(D.translationKey))}),D.icon]})},D.id)),[n,r,s]),c=u.useMemo(()=>n.map(D=>a.jsx(bs,{children:D.content},D.id)),[n]),f=u.useCallback(D=>{const T=ZN[D];T&&o(va(T))},[o]),{minSize:p,isCollapsed:h,setIsCollapsed:m,ref:v,reset:b,expand:y,collapse:x,toggle:C}=$j(Hge,"pixels"),{ref:k,minSize:j,isCollapsed:_,setIsCollapsed:I,reset:O,expand:E,collapse:M,toggle:R}=$j(Vge,"pixels");St("f",()=>{_||h?(E(),y()):(x(),M())},[o,_,h]),St(["t","o"],()=>{C()},[o]),St("g",()=>{R()},[o]);const A=e2();return a.jsxs(Gl,{variant:"appTabs",defaultIndex:e,index:e,onChange:f,sx:{flexGrow:1,gap:4},isLazy:!0,children:[a.jsxs(ql,{sx:{pt:2,gap:4,flexDir:"column"},children:[i,a.jsx(Qi,{}),a.jsx(fZ,{})]}),a.jsxs(Xg,{id:"app",autoSaveId:"app",direction:"horizontal",style:{height:"100%",width:"100%"},storage:A,units:"pixels",children:[!Gge.includes(t)&&a.jsxs(a.Fragment,{children:[a.jsx(Wi,{order:0,id:"side",ref:v,defaultSize:p,minSize:p,onCollapse:m,collapsible:!0,children:t==="nodes"?a.jsx(mse,{}):a.jsx($ce,{})}),a.jsx(Am,{onDoubleClick:b,collapsedDirection:h?"left":void 0}),a.jsx(xse,{isSidePanelCollapsed:h,sidePanelRef:v})]}),a.jsx(Wi,{id:"main",order:1,minSize:Wge,children:a.jsx(Ou,{style:{height:"100%",width:"100%"},children:c})}),!Uge.includes(t)&&a.jsxs(a.Fragment,{children:[a.jsx(Am,{onDoubleClick:O,collapsedDirection:_?"right":void 0}),a.jsx(Wi,{id:"gallery",ref:k,order:2,defaultSize:j,minSize:j,onCollapse:I,collapsible:!0,children:a.jsx(Qne,{})}),a.jsx(vse,{isGalleryCollapsed:_,galleryPanelRef:k})]})]})]})},Kge=u.memo(qge),Xge=u.createContext(null),v1={didCatch:!1,error:null};class Qge extends u.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=v1}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(v1)}}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&&Yge(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(v1)}}render(){const{children:t,fallbackRender:n,FallbackComponent:r,fallback:o}=this.props,{didCatch:s,error:i}=this.state;let c=t;if(s){const f={error:i,resetErrorBoundary:this.resetErrorBoundary};if(u.isValidElement(o))c=o;else if(typeof n=="function")c=n(f);else if(r)c=u.createElement(r,f);else throw i}return u.createElement(Xge.Provider,{value:{didCatch:s,error:i,resetErrorBoundary:this.resetErrorBoundary}},c)}}function Yge(){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 Jge=()=>{const e=se(),[t,n]=u.useState(),[r,o]=u.useState(),{recallAllParameters:s}=Ug(),i=Kl(),{currentData:c}=qo(t??Yo.skipToken),{currentData:f}=e9(r??Yo.skipToken);return{handlePreselectedImage:u.useCallback(h=>{h&&(h.action==="sendToCanvas"&&(n(h==null?void 0:h.imageName),c&&(e(e3(c)),e(va("unifiedCanvas")),i({title:t9("toast.sentToUnifiedCanvas"),status:"info",duration:2500,isClosable:!0}))),h.action==="sendToImg2Img"&&(n(h==null?void 0:h.imageName),c&&e(Hm(c))),h.action==="useAllParameters"&&(o(h==null?void 0:h.imageName),f&&s(f.metadata)))},[e,c,f,s,i])}};function Zge(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 e0e=({error:e,resetErrorBoundary:t})=>{const n=A3(),r=u.useCallback(()=>{const s=JSON.stringify(n9(e),null,2);navigator.clipboard.writeText(`\`\`\`
${s}
\`\`\``),n({title:"Error Copied"})},[e,n]),o=u.useMemo(()=>Zge({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(ds,{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(Ee,{sx:{fontWeight:600,color:"error.500",_dark:{color:"error.400"}},children:[e.name,": ",e.message]})}),a.jsxs($,{sx:{gap:4},children:[a.jsx(Wt,{leftIcon:a.jsx(Upe,{}),onClick:t,children:"Reset UI"}),a.jsx(Wt,{leftIcon:a.jsx(Du,{}),onClick:r,children:"Copy Error"}),a.jsx(rg,{href:o,isExternal:!0,children:a.jsx(Wt,{leftIcon:a.jsx($E,{}),children:"Create Issue"})})]})]})})},t0e=u.memo(e0e),n0e=le([ke],({hotkeys:e})=>{const{shift:t,ctrl:n,meta:r}=e;return{shift:t,ctrl:n,meta:r}},{memoizeOptions:{resultEqualityCheck:mn}}),r0e=()=>{const e=se(),{shift:t,ctrl:n,meta:r}=z(n0e);return St("*",()=>{fh("shift")?!t&&e(Do(!0)):t&&e(Do(!1)),fh("ctrl")?!n&&e(RC(!0)):n&&e(RC(!1)),fh("meta")?!r&&e(DC(!0)):r&&e(DC(!1))},{keyup:!0,keydown:!0},[t,n,r]),St("1",()=>{e(va("txt2img"))}),St("2",()=>{e(va("img2img"))}),St("3",()=>{e(va("unifiedCanvas"))}),St("4",()=>{e(va("nodes"))}),St("5",()=>{e(va("modelManager"))}),null},o0e=u.memo(r0e),s0e={},a0e=({config:e=s0e,headerComponent:t,selectedImage:n})=>{const r=z(BP),o=HP("system"),s=se(),{handlePreselectedImage:i}=Jge(),c=u.useCallback(()=>(localStorage.clear(),location.reload(),!1),[]);return u.useEffect(()=>{Sr.changeLanguage(r)},[r]),u.useEffect(()=>{l3(e)&&(o.info({config:e},"Received config"),s(r9(e)))},[s,e,o]),u.useEffect(()=>{s(o9())},[s]),u.useEffect(()=>{i(n)},[i,n]),a.jsxs(Qge,{onReset:c,FallbackComponent:t0e,children:[a.jsx(Vi,{w:"100vw",h:"100vh",position:"relative",overflow:"hidden",children:a.jsx(OV,{children:a.jsxs(Vi,{sx:{gap:4,p:4,gridAutoRows:"min-content auto",w:"full",h:"full"},children:[t||a.jsx(cZ,{}),a.jsx($,{sx:{gap:4,w:"full",h:"full"},children:a.jsx(Kge,{})})]})})}),a.jsx(KY,{}),a.jsx(WY,{}),a.jsx(xW,{}),a.jsx(o0e,{})]})},m0e=u.memo(a0e);export{m0e as default};