InvokeAI/invokeai/frontend/web/dist/assets/App-9a48e001.js
2023-07-05 21:09:13 -04:00

200 lines
961 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

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.

import{t as b1,b as v8,r as y8,i as b8,a as x8,c as w8,d as UP,e as GP,f as qP,g as S8,h as C8,j as _8,k as k8,l as P8,m as j8,n as E8,o as I8,s as O8,p as T8,q as p,u as i,v as Zm,w as gh,x as R8,y as YP,z as KP,A as M8,P as ef,B as Gy,C as D8,D as A8,E as N8,F as z8,G as $8,H as L8,I as B8,J as Bw,K as ze,L as io,M as zn,N as Ie,O as jt,Q as mr,R as st,S as tf,T as Xo,U as No,V as Ur,W as Jn,X as mu,Y as ni,Z as on,_ as bs,$ as Tc,a0 as ri,a1 as oi,a2 as Qm,a3 as qy,a4 as gu,a5 as gr,a6 as F8,a7 as F,a8 as XP,a9 as Fw,aa as ZP,ab as x1,ac as vu,ad as Sd,ae as H8,af as V8,ag as QP,ah as JP,ai as Wl,aj as W8,ak as ut,al as X,am as $a,an as Oe,ao as wo,ap as Gr,aq as ce,ar as Y,as as nf,at as e3,au as zo,av as Ks,aw as od,ax as Jm,ay as yl,az as U8,aA as rf,aB as G8,aC as eh,aD as eg,aE as qc,aF as q8,aG as Yy,aH as th,aI as nh,aJ as vh,aK as yh,aL as w1,aM as S1,aN as bh,aO as xh,aP as wh,aQ as Sh,aR as Y8,aS as Ch,aT as Bn,aU as Lt,aV as t3,aW as Ky,aX as K8,aY as n3,aZ as X8,a_ as Z8,a$ as r3,b0 as o3,b1 as tg,b2 as ml,b3 as Q8,b4 as J8,b5 as C1,b6 as s3,b7 as e7,b8 as Xy,b9 as t7,ba as n7,bb as r7,bc as cc,bd as xa,be as a3,bf as i3,bg as o7,bh as s7,bi as a7,bj as i7,bk as Zy,bl as Hw,bm as l3,bn as l7,bo as Yc,bp as Vw,bq as c7,br as Ww,bs as u7,bt as _h,bu as d7,bv as c3,bw as ng,bx as en,by as ks,bz as vr,bA as _1,bB as u3,bC as f7,bD as d3,bE as Uw,bF as p7,bG as h7,bH as m7,bI as g7,bJ as v7,bK as y7,bL as Qy,bM as b7,bN as x7,bO as Gw,bP as qw,bQ as Yw,bR as Kw,bS as w7,bT as S7,bU as f3,bV as Cd,bW as p3,bX as Xw,bY as C7,bZ as Mr,b_ as h3,b$ as _7,c0 as m3,c1 as g3,c2 as k7,c3 as Zw,c4 as P7,c5 as j7,c6 as E7,c7 as I7,c8 as O7,c9 as T7,ca as R7,cb as M7,cc as D7,cd as A7,ce as N7,cf as z7,cg as $7,ch as L7,ci as B7,cj as F7,ck as H7,cl as V7,cm as Qw,cn as W7,co as of,cp as U7,cq as G7,cr as Vu,cs as Ul,ct as q7,cu as Y7,cv as K7,cw as X7,cx as Z7,cy as v3,cz as Q7,cA as J7,cB as Ps,cC as eM,cD as Jw,cE as eS,cF as tM,cG as nM,cH as rM,cI as y3,cJ as oM,cK as sM,cL as aM,cM as Jy,cN as eb,cO as tS,cP as iM,cQ as nS,cR as Zo,cS as lM,cT as cM,cU as rS,cV as oS,cW as uM,cX as sS,cY as dM,cZ as fM,c_ as pM,c$ as hM,d0 as mM,d1 as sf,d2 as aS,d3 as gM,d4 as vM,d5 as b3,d6 as yM,d7 as iS,d8 as bM,d9 as xM,da as wM,db as kh,dc as SM,dd as lS,de as x3,df as CM,dg as cS,dh as w3,di as tb,dj as Xs,dk as _M,dl as S3,dm as uS,dn as kM,dp as PM,dq as jM,dr as EM,ds as IM,dt as OM,du as TM,dv as RM,dw as MM,dx as DM,dy as AM,dz as NM,dA as dS,dB as zM,dC as fS,dD as rh,dE as $M,dF as vn,dG as Ph,dH as C3,dI as jh,dJ as LM,dK as BM,dL as va,dM as _3,dN as nb,dO as af,dP as FM,dQ as HM,dR as VM,dS as qa,dT as k3,dU as WM,dV as UM,dW as P3,dX as GM,dY as qM,dZ as YM,d_ as KM,d$ as XM,e0 as ZM,e1 as QM,e2 as JM,e3 as e9,e4 as t9,e5 as n9,e6 as pS,e7 as r9,e8 as o9,e9 as s9,ea as a9,eb as i9,ec as l9,ed as d0,ee as _d,ef as hS,eg as f0,eh as p0,ei as cp,ej as mS,ek as k1,el as c9,em as u9,en as d9,eo as f9,ep as p9,eq as Eh,er as j3,es as E3,et as h9,eu as m9,ev as I3,ew as O3,ex as T3,ey as R3,ez as M3,eA as D3,eB as A3,eC as N3,eD as Rc,eE as Mc,eF as z3,eG as $3,eH as g9,eI as L3,eJ as B3,eK as F3,eL as H3,eM as V3,eN as W3,eO as U3,eP as rb,eQ as v9,eR as gS,eS as y9,eT as b9,eU as Ih,eV as vS,eW as yS,eX as bS,eY as xS,eZ as x9,e_ as w9,e$ as wS,f0 as S9,f1 as C9,f2 as _9,f3 as k9,f4 as P9,f5 as j9}from"./index-581af3d4.js";import{u as we,a as G3,b as si,c as E9,r as Ge,f as I9,g as SS,d as Ut,e as zr}from"./MantineProvider-d7f01775.js";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}var CS=1/0,T9=17976931348623157e292;function h0(e){if(!e)return e===0?e:0;if(e=b1(e),e===CS||e===-CS){var t=e<0?-1:1;return t*T9}return e===e?e:0}var R9=4;function _S(e){return v8(e,R9)}var M9=function(){return y8.Date.now()};const m0=M9;var D9="Expected a function",A9=Math.max,N9=Math.min;function z9(e,t,n){var r,o,s,a,c,d,f=0,h=!1,m=!1,v=!0;if(typeof e!="function")throw new TypeError(D9);t=b1(t)||0,b8(n)&&(h=!!n.leading,m="maxWait"in n,s=m?A9(b1(n.maxWait)||0,t):s,v="trailing"in n?!!n.trailing:v);function y(O){var T=r,R=o;return r=o=void 0,f=O,a=e.apply(R,T),a}function S(O){return f=O,c=setTimeout(_,t),h?y(O):a}function x(O){var T=O-d,R=O-f,M=t-T;return m?N9(M,s-R):M}function w(O){var T=O-d,R=O-f;return d===void 0||T>=t||T<0||m&&R>=s}function _(){var O=m0();if(w(O))return k(O);c=setTimeout(_,x(O))}function k(O){return c=void 0,v&&r?y(O):(r=o=void 0,a)}function P(){c!==void 0&&clearTimeout(c),f=0,r=d=o=c=void 0}function j(){return c===void 0?a:k(m0())}function I(){var O=m0(),T=w(O);if(r=arguments,o=this,d=O,T){if(c===void 0)return S(d);if(m)return clearTimeout(c),c=setTimeout(_,t),y(d)}return c===void 0&&(c=setTimeout(_,t)),a}return I.cancel=P,I.flush=j,I}function $9(e,t){var n=-1,r=x8(e)?Array(e.length):[];return w8(e,function(o,s,a){r[++n]=t(o,s,a)}),r}function Pa(e,t){var n=UP(e)?GP:$9;return n(e,qP(t))}var L9="[object Number]";function uc(e){return typeof e=="number"||S8(e)&&C8(e)==L9}var B9=Array.prototype,F9=B9.splice;function H9(e,t){for(var n=e?t.length:0,r=n-1;n--;){var o=t[n];if(n==r||o!==s){var s=o;_8(o)?F9.call(e,o,1):k8(e,o)}}return e}var V9=Math.ceil,W9=Math.max;function U9(e,t,n,r){for(var o=-1,s=W9(V9((t-e)/(n||1)),0),a=Array(s);s--;)a[r?s:++o]=e,e+=n;return a}function G9(e){return function(t,n,r){return r&&typeof r!="number"&&P8(t,n,r)&&(n=r=void 0),t=h0(t),n===void 0?(n=t,t=0):n=h0(n),r=r===void 0?t<n?1:-1:h0(r),U9(t,n,r,e)}}var q9=G9();const kS=q9;function Y9(e,t){var n=[];if(!(e&&e.length))return n;var r=-1,o=[],s=e.length;for(t=qP(t);++r<s;){var a=e[r];t(a,r,e)&&(n.push(a),o.push(r))}return H9(e,o),n}function q3(e){return UP(e)?GP(e,j8):E8(e)?[e]:I8(O8(T8(e)))}const Y3=({id:e,x:t,y:n,width:r,height:o,style:s,color:a,strokeColor:c,strokeWidth:d,className:f,borderRadius:h,shapeRendering:m,onClick:v})=>{const{background:y,backgroundColor:S}=s||{},x=a||y||S;return i.jsx("rect",{className:Zm(["react-flow__minimap-node",f]),x:t,y:n,rx:h,ry:h,width:r,height:o,fill:x,stroke:c,strokeWidth:d,shapeRendering:m,onClick:v?w=>v(w,e):void 0})};Y3.displayName="MiniMapNode";var K9=p.memo(Y3);const X9=e=>e.nodeOrigin,Z9=e=>e.getNodes().filter(t=>!t.hidden&&t.width&&t.height),g0=e=>e instanceof Function?e:()=>e;function Q9({nodeStrokeColor:e="transparent",nodeColor:t="#e2e2e2",nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:o=2,nodeComponent:s=K9,onClick:a}){const c=gh(Z9,Gy),d=gh(X9),f=g0(t),h=g0(e),m=g0(n),v=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return i.jsx(i.Fragment,{children:c.map(y=>{const{x:S,y:x}=R8(y,d).positionAbsolute;return i.jsx(s,{x:S,y:x,width:y.width,height:y.height,style:y.style,className:m(y),color:f(y),borderRadius:r,strokeColor:h(y),strokeWidth:o,shapeRendering:v,onClick:a,id:y.id},y.id)})})}var J9=p.memo(Q9);const eD=200,tD=150,nD=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?N8(z8(t,e.nodeOrigin),n):n,rfId:e.rfId}},rD="react-flow__minimap-desc";function K3({style:e,className:t,nodeStrokeColor:n="transparent",nodeColor:r="#e2e2e2",nodeClassName:o="",nodeBorderRadius:s=5,nodeStrokeWidth:a=2,nodeComponent:c,maskColor:d="rgb(240, 240, 240, 0.6)",maskStrokeColor:f="none",maskStrokeWidth:h=1,position:m="bottom-right",onClick:v,onNodeClick:y,pannable:S=!1,zoomable:x=!1,ariaLabel:w="React Flow mini map",inversePan:_=!1,zoomStep:k=10}){const P=YP(),j=p.useRef(null),{boundingRect:I,viewBB:O,rfId:T}=gh(nD,Gy),R=(e==null?void 0:e.width)??eD,M=(e==null?void 0:e.height)??tD,D=I.width/R,A=I.height/M,G=Math.max(D,A),$=G*R,H=G*M,U=5*G,q=I.x-($-I.width)/2-U,z=I.y-(H-I.height)/2-U,L=$+U*2,V=H+U*2,W=`${rD}-${T}`,te=p.useRef(0);te.current=G,p.useEffect(()=>{if(j.current){const J=KP(j.current),B=ge=>{const{transform:se,d3Selection:pe,d3Zoom:ue}=P.getState();if(ge.sourceEvent.type!=="wheel"||!pe||!ue)return;const be=-ge.sourceEvent.deltaY*(ge.sourceEvent.deltaMode===1?.05:ge.sourceEvent.deltaMode?1:.002)*k,ke=se[2]*Math.pow(2,be);ue.scaleTo(pe,ke)},oe=ge=>{const{transform:se,d3Selection:pe,d3Zoom:ue,translateExtent:be,width:ke,height:ie}=P.getState();if(ge.sourceEvent.type!=="mousemove"||!pe||!ue)return;const Pe=te.current*Math.max(1,se[2])*(_?-1:1),Je={x:se[0]-ge.sourceEvent.movementX*Pe,y:se[1]-ge.sourceEvent.movementY*Pe},Ae=[[0,0],[ke,ie]],Ve=D8.translate(Je.x,Je.y).scale(se[2]),kt=ue.constrain()(Ve,Ae,be);ue.transform(pe,kt)},le=M8().on("zoom",S?oe:null).on("zoom.wheel",x?B:null);return J.call(le),()=>{J.on("zoom",null)}}},[S,x,_,k]);const fe=v?J=>{const B=A8(J);v(J,{x:B[0],y:B[1]})}:void 0,ae=y?(J,B)=>{const oe=P.getState().nodeInternals.get(B);y(J,oe)}:void 0;return i.jsx(ef,{position:m,style:e,className:Zm(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:i.jsxs("svg",{width:R,height:M,viewBox:`${q} ${z} ${L} ${V}`,role:"img","aria-labelledby":W,ref:j,onClick:fe,children:[w&&i.jsx("title",{id:W,children:w}),i.jsx(J9,{onClick:ae,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:o,nodeStrokeWidth:a,nodeComponent:c}),i.jsx("path",{className:"react-flow__minimap-mask",d:`M${q-U},${z-U}h${L+U*2}v${V+U*2}h${-L-U*2}z
M${O.x},${O.y}h${O.width}v${O.height}h${-O.width}z`,fill:d,fillRule:"evenodd",stroke:f,strokeWidth:h,pointerEvents:"none"})]})})}K3.displayName="MiniMap";var oD=p.memo(K3),Bs;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Bs||(Bs={}));function sD({color:e,dimensions:t,lineWidth:n}){return i.jsx("path",{stroke:e,strokeWidth:n,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function aD({color:e,radius:t}){return i.jsx("circle",{cx:t,cy:t,r:t,fill:e})}const iD={[Bs.Dots]:"#91919a",[Bs.Lines]:"#eee",[Bs.Cross]:"#e2e2e2"},lD={[Bs.Dots]:1,[Bs.Lines]:1,[Bs.Cross]:6},cD=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function X3({id:e,variant:t=Bs.Dots,gap:n=20,size:r,lineWidth:o=1,offset:s=2,color:a,style:c,className:d}){const f=p.useRef(null),{transform:h,patternId:m}=gh(cD,Gy),v=a||iD[t],y=r||lD[t],S=t===Bs.Dots,x=t===Bs.Cross,w=Array.isArray(n)?n:[n,n],_=[w[0]*h[2]||1,w[1]*h[2]||1],k=y*h[2],P=x?[k,k]:_,j=S?[k/s,k/s]:[P[0]/s,P[1]/s];return i.jsxs("svg",{className:Zm(["react-flow__background",d]),style:{...c,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:f,"data-testid":"rf__background",children:[i.jsx("pattern",{id:m+e,x:h[0]%_[0],y:h[1]%_[1],width:_[0],height:_[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${j[0]},-${j[1]})`,children:S?i.jsx(aD,{color:v,radius:k/s}):i.jsx(sD,{dimensions:P,color:v,lineWidth:o})}),i.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${m+e})`})]})}X3.displayName="Background";var uD=p.memo(X3),pd;(function(e){e.Line="line",e.Handle="handle"})(pd||(pd={}));function dD({width:e,prevWidth:t,height:n,prevHeight:r,invertX:o,invertY:s}){const a=e-t,c=n-r,d=[a>0?1:a<0?-1:0,c>0?1:c<0?-1:0];return a&&o&&(d[0]=d[0]*-1),c&&s&&(d[1]=d[1]*-1),d}const Z3={width:0,height:0,x:0,y:0},fD={...Z3,pointerX:0,pointerY:0,aspectRatio:1};function pD({nodeId:e,position:t,variant:n=pd.Handle,className:r,style:o={},children:s,color:a,minWidth:c=10,minHeight:d=10,maxWidth:f=Number.MAX_VALUE,maxHeight:h=Number.MAX_VALUE,keepAspectRatio:m=!1,shouldResize:v,onResizeStart:y,onResize:S,onResizeEnd:x}){const w=$8(),_=typeof e=="string"?e:w,k=YP(),P=p.useRef(null),j=p.useRef(fD),I=p.useRef(Z3),O=L8(),T=n===pd.Line?"right":"bottom-right",R=t??T;p.useEffect(()=>{if(!P.current||!_)return;const G=KP(P.current),$=R.includes("right")||R.includes("left"),H=R.includes("bottom")||R.includes("top"),U=R.includes("left"),q=R.includes("top"),z=B8().on("start",L=>{const V=k.getState().nodeInternals.get(_),{xSnapped:W,ySnapped:te}=O(L);I.current={width:(V==null?void 0:V.width)??0,height:(V==null?void 0:V.height)??0,x:(V==null?void 0:V.position.x)??0,y:(V==null?void 0:V.position.y)??0},j.current={...I.current,pointerX:W,pointerY:te,aspectRatio:I.current.width/I.current.height},y==null||y(L,{...I.current})}).on("drag",L=>{const{nodeInternals:V,triggerNodeChanges:W}=k.getState(),{xSnapped:te,ySnapped:fe}=O(L),ae=V.get(_);if(ae){const J=[],{pointerX:B,pointerY:oe,width:le,height:ge,x:se,y:pe,aspectRatio:ue}=j.current,{x:be,y:ke,width:ie,height:Pe}=I.current,Je=Math.floor($?te-B:0),Ae=Math.floor(H?fe-oe:0);let Ve=Bw(le+(U?-Je:Je),c,f),kt=Bw(ge+(q?-Ae:Ae),d,h);if(m){const me=Ve/kt,Re=$&&H,Ye=$&&!H,ye=H&&!$;Ve=me<=ue&&Re||ye?kt*ue:Ve,kt=me>ue&&Re||Ye?Ve/ue:kt,Ve>=f?(Ve=f,kt=f/ue):Ve<=c&&(Ve=c,kt=c/ue),kt>=h?(kt=h,Ve=h*ue):kt<=d&&(kt=d,Ve=d*ue)}const ft=Ve!==ie,yn=kt!==Pe;if(U||q){const me=U?se-(Ve-le):se,Re=q?pe-(kt-ge):pe,Ye=me!==be&&ft,ye=Re!==ke&&yn;if(Ye||ye){const lt={id:ae.id,type:"position",position:{x:Ye?me:be,y:ye?Re:ke}};J.push(lt),I.current.x=lt.position.x,I.current.y=lt.position.y}}if(ft||yn){const me={id:_,type:"dimensions",updateStyle:!0,resizing:!0,dimensions:{width:Ve,height:kt}};J.push(me),I.current.width=Ve,I.current.height=kt}if(J.length===0)return;const K=dD({width:I.current.width,prevWidth:ie,height:I.current.height,prevHeight:Pe,invertX:U,invertY:q}),Ce={...I.current,direction:K};if((v==null?void 0:v(L,Ce))===!1)return;S==null||S(L,Ce),W(J)}}).on("end",L=>{const V={id:_,type:"dimensions",resizing:!1};x==null||x(L,{...I.current}),k.getState().triggerNodeChanges([V])});return G.call(z),()=>{G.on(".drag",null)}},[_,R,c,d,f,h,m,O,y,S,x]);const M=R.split("-"),D=n===pd.Line?"borderColor":"backgroundColor",A=a?{...o,[D]:a}:o;return i.jsx("div",{className:Zm(["react-flow__resize-control","nodrag",...M,n,r]),ref:P,style:A,children:s})}var hD=p.memo(pD);const Q3=1/60*1e3,mD=typeof performance<"u"?()=>performance.now():()=>Date.now(),J3=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(mD()),Q3);function gD(e){let t=[],n=[],r=0,o=!1,s=!1;const a=new WeakSet,c={schedule:(d,f=!1,h=!1)=>{const m=h&&o,v=m?t:n;return f&&a.add(d),v.indexOf(d)===-1&&(v.push(d),m&&o&&(r=t.length)),d},cancel:d=>{const f=n.indexOf(d);f!==-1&&n.splice(f,1),a.delete(d)},process:d=>{if(o){s=!0;return}if(o=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let f=0;f<r;f++){const h=t[f];h(d),a.has(h)&&(c.schedule(h),e())}o=!1,s&&(s=!1,c.process(d))}};return c}const vD=40;let P1=!0,kd=!1,j1=!1;const Dc={delta:0,timestamp:0},lf=["read","update","preRender","render","postRender"],rg=lf.reduce((e,t)=>(e[t]=gD(()=>kd=!0),e),{}),yD=lf.reduce((e,t)=>{const n=rg[t];return e[t]=(r,o=!1,s=!1)=>(kd||wD(),n.schedule(r,o,s)),e},{}),bD=lf.reduce((e,t)=>(e[t]=rg[t].cancel,e),{});lf.reduce((e,t)=>(e[t]=()=>rg[t].process(Dc),e),{});const xD=e=>rg[e].process(Dc),e5=e=>{kd=!1,Dc.delta=P1?Q3:Math.max(Math.min(e-Dc.timestamp,vD),1),Dc.timestamp=e,j1=!0,lf.forEach(xD),j1=!1,kd&&(P1=!1,J3(e5))},wD=()=>{kd=!0,P1=!0,j1||J3(e5)},PS=()=>Dc;function ob(e){const t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function yu(e){const{viewBox:t="0 0 24 24",d:n,displayName:r,defaultProps:o={}}=e,s=p.Children.toArray(e.path),a=ze((c,d)=>i.jsx(io,{ref:d,viewBox:t,...o,...c,children:s.length?s:i.jsx("path",{fill:"currentColor",d:n})}));return a.displayName=r,a}var SD=Object.defineProperty,CD=(e,t,n)=>t in e?SD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Pr=(e,t,n)=>(CD(e,typeof t!="symbol"?t+"":t,n),n);function jS(e){return e.sort((t,n)=>{const r=t.compareDocumentPosition(n);if(r&Node.DOCUMENT_POSITION_FOLLOWING||r&Node.DOCUMENT_POSITION_CONTAINED_BY)return-1;if(r&Node.DOCUMENT_POSITION_PRECEDING||r&Node.DOCUMENT_POSITION_CONTAINS)return 1;if(r&Node.DOCUMENT_POSITION_DISCONNECTED||r&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC)throw Error("Cannot sort the given nodes.");return 0})}var _D=e=>typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE;function ES(e,t,n){let r=e+1;return n&&r>=t&&(r=0),r}function IS(e,t,n){let r=e-1;return n&&r<0&&(r=t),r}var E1=typeof window<"u"?p.useLayoutEffect:p.useEffect,Oh=e=>e,kD=class{constructor(){Pr(this,"descendants",new Map),Pr(this,"register",e=>{if(e!=null)return _D(e)?this.registerNode(e):t=>{this.registerNode(t,e)}}),Pr(this,"unregister",e=>{this.descendants.delete(e);const t=jS(Array.from(this.descendants.keys()));this.assignIndex(t)}),Pr(this,"destroy",()=>{this.descendants.clear()}),Pr(this,"assignIndex",e=>{this.descendants.forEach(t=>{const n=e.indexOf(t.node);t.index=n,t.node.dataset.index=t.index.toString()})}),Pr(this,"count",()=>this.descendants.size),Pr(this,"enabledCount",()=>this.enabledValues().length),Pr(this,"values",()=>Array.from(this.descendants.values()).sort((t,n)=>t.index-n.index)),Pr(this,"enabledValues",()=>this.values().filter(e=>!e.disabled)),Pr(this,"item",e=>{if(this.count()!==0)return this.values()[e]}),Pr(this,"enabledItem",e=>{if(this.enabledCount()!==0)return this.enabledValues()[e]}),Pr(this,"first",()=>this.item(0)),Pr(this,"firstEnabled",()=>this.enabledItem(0)),Pr(this,"last",()=>this.item(this.descendants.size-1)),Pr(this,"lastEnabled",()=>{const e=this.enabledValues().length-1;return this.enabledItem(e)}),Pr(this,"indexOf",e=>{var t,n;return e&&(n=(t=this.descendants.get(e))==null?void 0:t.index)!=null?n:-1}),Pr(this,"enabledIndexOf",e=>e==null?-1:this.enabledValues().findIndex(t=>t.node.isSameNode(e))),Pr(this,"next",(e,t=!0)=>{const n=ES(e,this.count(),t);return this.item(n)}),Pr(this,"nextEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),o=ES(r,this.enabledCount(),t);return this.enabledItem(o)}),Pr(this,"prev",(e,t=!0)=>{const n=IS(e,this.count()-1,t);return this.item(n)}),Pr(this,"prevEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),o=IS(r,this.enabledCount()-1,t);return this.enabledItem(o)}),Pr(this,"registerNode",(e,t)=>{if(!e||this.descendants.has(e))return;const n=Array.from(this.descendants.keys()).concat(e),r=jS(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 PD(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 gn(...e){return t=>{e.forEach(n=>{PD(n,t)})}}function jD(...e){return p.useMemo(()=>gn(...e),e)}function ED(){const e=p.useRef(new kD);return E1(()=>()=>e.current.destroy()),e.current}var[ID,t5]=zn({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});function OD(e){const t=t5(),[n,r]=p.useState(-1),o=p.useRef(null);E1(()=>()=>{o.current&&t.unregister(o.current)},[]),E1(()=>{if(!o.current)return;const a=Number(o.current.dataset.index);n!=a&&!Number.isNaN(a)&&r(a)});const s=Oh(e?t.register(e):t.register);return{descendants:t,index:n,enabledIndex:t.enabledIndexOf(o.current),register:gn(s,o)}}function sb(){return[Oh(ID),()=>Oh(t5()),()=>ED(),o=>OD(o)]}var[TD,og]=zn({name:"AccordionStylesContext",hookName:"useAccordionStyles",providerName:"<Accordion />"}),[RD,ab]=zn({name:"AccordionItemContext",hookName:"useAccordionItemContext",providerName:"<AccordionItem />"}),[MD,gpe,DD,AD]=sb(),sd=ze(function(t,n){const{getButtonProps:r}=ab(),o=r(t,n),a={display:"flex",alignItems:"center",width:"100%",outline:0,...og().button};return i.jsx(Ie.button,{...o,className:jt("chakra-accordion__button",t.className),__css:a})});sd.displayName="AccordionButton";function bu(e){const{value:t,defaultValue:n,onChange:r,shouldUpdate:o=(v,y)=>v!==y}=e,s=mr(r),a=mr(o),[c,d]=p.useState(n),f=t!==void 0,h=f?t:c,m=mr(v=>{const S=typeof v=="function"?v(h):v;a(h,S)&&(f||d(S),s(S))},[f,s,h,a]);return[h,m]}function ND(e){const{onChange:t,defaultIndex:n,index:r,allowMultiple:o,allowToggle:s,...a}=e;LD(e),BD(e);const c=DD(),[d,f]=p.useState(-1);p.useEffect(()=>()=>{f(-1)},[]);const[h,m]=bu({value:r,defaultValue(){return o?n??[]:n??-1},onChange:t});return{index:h,setIndex:m,htmlProps:a,getAccordionItemProps:y=>{let S=!1;return y!==null&&(S=Array.isArray(h)?h.includes(y):h===y),{isOpen:S,onChange:w=>{if(y!==null)if(o&&Array.isArray(h)){const _=w?h.concat(y):h.filter(k=>k!==y);m(_)}else w?m(y):s&&m(-1)}}},focusedIndex:d,setFocusedIndex:f,descendants:c}}var[zD,ib]=zn({name:"AccordionContext",hookName:"useAccordionContext",providerName:"Accordion"});function $D(e){const{isDisabled:t,isFocusable:n,id:r,...o}=e,{getAccordionItemProps:s,setFocusedIndex:a}=ib(),c=p.useRef(null),d=p.useId(),f=r??d,h=`accordion-button-${f}`,m=`accordion-panel-${f}`;FD(e);const{register:v,index:y,descendants:S}=AD({disabled:t&&!n}),{isOpen:x,onChange:w}=s(y===-1?null:y);HD({isOpen:x,isDisabled:t});const _=()=>{w==null||w(!0)},k=()=>{w==null||w(!1)},P=p.useCallback(()=>{w==null||w(!x),a(y)},[y,a,x,w]),j=p.useCallback(R=>{const D={ArrowDown:()=>{const A=S.nextEnabled(y);A==null||A.node.focus()},ArrowUp:()=>{const A=S.prevEnabled(y);A==null||A.node.focus()},Home:()=>{const A=S.firstEnabled();A==null||A.node.focus()},End:()=>{const A=S.lastEnabled();A==null||A.node.focus()}}[R.key];D&&(R.preventDefault(),D(R))},[S,y]),I=p.useCallback(()=>{a(y)},[a,y]),O=p.useCallback(function(M={},D=null){return{...M,type:"button",ref:gn(v,c,D),id:h,disabled:!!t,"aria-expanded":!!x,"aria-controls":m,onClick:st(M.onClick,P),onFocus:st(M.onFocus,I),onKeyDown:st(M.onKeyDown,j)}},[h,t,x,P,I,j,m,v]),T=p.useCallback(function(M={},D=null){return{...M,ref:D,role:"region",id:m,"aria-labelledby":h,hidden:!x}},[h,x,m]);return{isOpen:x,isDisabled:t,isFocusable:n,onOpen:_,onClose:k,getButtonProps:O,getPanelProps:T,htmlProps:o}}function LD(e){const t=e.index||e.defaultIndex,n=t!=null&&!Array.isArray(t)&&e.allowMultiple;tf({condition:!!n,message:`If 'allowMultiple' is passed, then 'index' or 'defaultIndex' must be an array. You passed: ${typeof t},`})}function BD(e){tf({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 FD(e){tf({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 HD(e){tf({condition:e.isOpen&&!!e.isDisabled,message:"Cannot open a disabled accordion item"})}function ad(e){const{isOpen:t,isDisabled:n}=ab(),{reduceMotion:r}=ib(),o=jt("chakra-accordion__icon",e.className),s=og(),a={opacity:n?.4:1,transform:t?"rotate(-180deg)":void 0,transition:r?void 0:"transform 0.2s",transformOrigin:"center",...s.icon};return i.jsx(io,{viewBox:"0 0 24 24","aria-hidden":!0,className:o,__css:a,...e,children:i.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})})}ad.displayName="AccordionIcon";var id=ze(function(t,n){const{children:r,className:o}=t,{htmlProps:s,...a}=$D(t),d={...og().container,overflowAnchor:"none"},f=p.useMemo(()=>a,[a]);return i.jsx(RD,{value:f,children:i.jsx(Ie.div,{ref:n,...s,className:jt("chakra-accordion__item",o),__css:d,children:typeof r=="function"?r({isExpanded:!!a.isOpen,isDisabled:!!a.isDisabled}):r})})});id.displayName="AccordionItem";var gl={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},Wu={scale:{enter:{scale:1},exit:{scale:.95}},fade:{enter:{opacity:1},exit:{opacity:0}},pushLeft:{enter:{x:"100%"},exit:{x:"-30%"}},pushRight:{enter:{x:"-100%"},exit:{x:"30%"}},pushUp:{enter:{y:"100%"},exit:{y:"-30%"}},pushDown:{enter:{y:"-100%"},exit:{y:"30%"}},slideLeft:{position:{left:0,top:0,bottom:0,width:"100%"},enter:{x:0,y:0},exit:{x:"-100%",y:0}},slideRight:{position:{right:0,top:0,bottom:0,width:"100%"},enter:{x:0,y:0},exit:{x:"100%",y:0}},slideUp:{position:{top:0,left:0,right:0,maxWidth:"100vw"},enter:{x:0,y:0},exit:{x:0,y:"-100%"}},slideDown:{position:{bottom:0,left:0,right:0,maxWidth:"100vw"},enter:{x:0,y:0},exit:{x:0,y:"100%"}}};function I1(e){var t;switch((t=e==null?void 0:e.direction)!=null?t:"right"){case"right":return Wu.slideRight;case"left":return Wu.slideLeft;case"bottom":return Wu.slideDown;case"top":return Wu.slideUp;default:return Wu.slideRight}}var bl={enter:{duration:.2,ease:gl.easeOut},exit:{duration:.1,ease:gl.easeIn}},Fs={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})},VD=e=>e!=null&&parseInt(e.toString(),10)>0,OS={exit:{height:{duration:.2,ease:gl.ease},opacity:{duration:.3,ease:gl.ease}},enter:{height:{duration:.3,ease:gl.ease},opacity:{duration:.4,ease:gl.ease}}},WD={exit:({animateOpacity:e,startingHeight:t,transition:n,transitionEnd:r,delay:o})=>{var s;return{...e&&{opacity:VD(t)?1:0},height:t,transitionEnd:r==null?void 0:r.exit,transition:(s=n==null?void 0:n.exit)!=null?s:Fs.exit(OS.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:Fs.enter(OS.enter,o)}}},sg=p.forwardRef((e,t)=>{const{in:n,unmountOnExit:r,animateOpacity:o=!0,startingHeight:s=0,endingHeight:a="auto",style:c,className:d,transition:f,transitionEnd:h,...m}=e,[v,y]=p.useState(!1);p.useEffect(()=>{const k=setTimeout(()=>{y(!0)});return()=>clearTimeout(k)},[]),tf({condition:Number(s)>0&&!!r,message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const S=parseFloat(s.toString())>0,x={startingHeight:s,endingHeight:a,animateOpacity:o,transition:v?f:{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:S?"block":"none"}}},w=r?n:!0,_=n||r?"enter":"exit";return i.jsx(Xo,{initial:!1,custom:x,children:w&&i.jsx(No.div,{ref:t,...m,className:jt("chakra-collapse",d),style:{overflow:"hidden",display:"block",...c},custom:x,variants:WD,initial:r?"exit":!1,animate:_,exit:"exit"})})});sg.displayName="Collapse";var UD={enter:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:1,transition:(r=e==null?void 0:e.enter)!=null?r:Fs.enter(bl.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:Fs.exit(bl.exit,n),transitionEnd:t==null?void 0:t.exit}}},n5={initial:"exit",animate:"enter",exit:"exit",variants:UD},GD=p.forwardRef(function(t,n){const{unmountOnExit:r,in:o,className:s,transition:a,transitionEnd:c,delay:d,...f}=t,h=o||r?"enter":"exit",m=r?o&&r:!0,v={transition:a,transitionEnd:c,delay:d};return i.jsx(Xo,{custom:v,children:m&&i.jsx(No.div,{ref:n,className:jt("chakra-fade",s),custom:v,...n5,animate:h,...f})})});GD.displayName="Fade";var qD={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:Fs.exit(bl.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:Fs.enter(bl.enter,n),transitionEnd:e==null?void 0:e.enter}}},r5={initial:"exit",animate:"enter",exit:"exit",variants:qD},YD=p.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:s=!0,initialScale:a=.95,className:c,transition:d,transitionEnd:f,delay:h,...m}=t,v=r?o&&r:!0,y=o||r?"enter":"exit",S={initialScale:a,reverse:s,transition:d,transitionEnd:f,delay:h};return i.jsx(Xo,{custom:S,children:v&&i.jsx(No.div,{ref:n,className:jt("chakra-offset-slide",c),...r5,animate:y,custom:S,...m})})});YD.displayName="ScaleFade";var KD={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:Fs.exit(bl.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:Fs.enter(bl.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({offsetY:e,offsetX:t,transition:n,transitionEnd:r,reverse:o,delay:s})=>{var a;const c={x:t,y:e};return{opacity:0,transition:(a=n==null?void 0:n.exit)!=null?a:Fs.exit(bl.exit,s),...o?{...c,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{...c,...r==null?void 0:r.exit}}}}},O1={initial:"initial",animate:"enter",exit:"exit",variants:KD},XD=p.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:s=!0,className:a,offsetX:c=0,offsetY:d=8,transition:f,transitionEnd:h,delay:m,...v}=t,y=r?o&&r:!0,S=o||r?"enter":"exit",x={offsetX:c,offsetY:d,reverse:s,transition:f,transitionEnd:h,delay:m};return i.jsx(Xo,{custom:x,children:y&&i.jsx(No.div,{ref:n,className:jt("chakra-offset-slide",a),custom:x,...O1,animate:S,...v})})});XD.displayName="SlideFade";var TS={exit:{duration:.15,ease:gl.easeInOut},enter:{type:"spring",damping:25,stiffness:180}},ZD={exit:({direction:e,transition:t,transitionEnd:n,delay:r})=>{var o;const{exit:s}=I1({direction:e});return{...s,transition:(o=t==null?void 0:t.exit)!=null?o:Fs.exit(TS.exit,r),transitionEnd:n==null?void 0:n.exit}},enter:({direction:e,transitionEnd:t,transition:n,delay:r})=>{var o;const{enter:s}=I1({direction:e});return{...s,transition:(o=n==null?void 0:n.enter)!=null?o:Fs.enter(TS.enter,r),transitionEnd:t==null?void 0:t.enter}}},o5=p.forwardRef(function(t,n){const{direction:r="right",style:o,unmountOnExit:s,in:a,className:c,transition:d,transitionEnd:f,delay:h,motionProps:m,...v}=t,y=I1({direction:r}),S=Object.assign({position:"fixed"},y.position,o),x=s?a&&s:!0,w=a||s?"enter":"exit",_={transitionEnd:f,transition:d,direction:r,delay:h};return i.jsx(Xo,{custom:_,children:x&&i.jsx(No.div,{...v,ref:n,initial:"exit",className:jt("chakra-slide",c),animate:w,exit:"exit",custom:_,variants:ZD,style:S,...m})})});o5.displayName="Slide";var ld=ze(function(t,n){const{className:r,motionProps:o,...s}=t,{reduceMotion:a}=ib(),{getPanelProps:c,isOpen:d}=ab(),f=c(s,n),h=jt("chakra-accordion__panel",r),m=og();a||delete f.hidden;const v=i.jsx(Ie.div,{...f,__css:m.panel,className:h});return a?v:i.jsx(sg,{in:d,...o,children:v})});ld.displayName="AccordionPanel";var s5=ze(function({children:t,reduceMotion:n,...r},o){const s=Ur("Accordion",r),a=Jn(r),{htmlProps:c,descendants:d,...f}=ND(a),h=p.useMemo(()=>({...f,reduceMotion:!!n}),[f,n]);return i.jsx(MD,{value:d,children:i.jsx(zD,{value:h,children:i.jsx(TD,{value:s,children:i.jsx(Ie.div,{ref:o,...c,className:jt("chakra-accordion",r.className),__css:s.root,children:t})})})})});s5.displayName="Accordion";function cf(e){return p.Children.toArray(e).filter(t=>p.isValidElement(t))}var[QD,JD]=zn({strict:!1,name:"ButtonGroupContext"}),eA={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}}},tA={horizontal:e=>({"& > *:not(style) ~ *:not(style)":{marginStart:e}}),vertical:e=>({"& > *:not(style) ~ *:not(style)":{marginTop:e}})},Or=ze(function(t,n){const{size:r,colorScheme:o,variant:s,className:a,spacing:c="0.5rem",isAttached:d,isDisabled:f,orientation:h="horizontal",...m}=t,v=jt("chakra-button__group",a),y=p.useMemo(()=>({size:r,colorScheme:o,variant:s,isDisabled:f}),[r,o,s,f]);let S={display:"inline-flex",...d?eA[h]:tA[h](c)};const x=h==="vertical";return i.jsx(QD,{value:y,children:i.jsx(Ie.div,{ref:n,role:"group",__css:S,className:v,"data-attached":d?"":void 0,"data-orientation":h,flexDir:x?"column":void 0,...m})})});Or.displayName="ButtonGroup";function nA(e){const[t,n]=p.useState(!e);return{ref:p.useCallback(s=>{s&&n(s.tagName==="BUTTON")},[]),type:t?"button":void 0}}function T1(e){const{children:t,className:n,...r}=e,o=p.isValidElement(t)?p.cloneElement(t,{"aria-hidden":!0,focusable:!1}):t,s=jt("chakra-button__icon",n);return i.jsx(Ie.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...r,className:s,children:o})}T1.displayName="ButtonIcon";function Th(e){const{label:t,placement:n,spacing:r="0.5rem",children:o=i.jsx(mu,{color:"currentColor",width:"1em",height:"1em"}),className:s,__css:a,...c}=e,d=jt("chakra-button__spinner",s),f=n==="start"?"marginEnd":"marginStart",h=p.useMemo(()=>({display:"flex",alignItems:"center",position:t?"relative":"absolute",[f]:t?r:0,fontSize:"1em",lineHeight:"normal",...a}),[a,t,f,r]);return i.jsx(Ie.div,{className:d,...c,__css:h,children:o})}Th.displayName="ButtonSpinner";var ag=ze((e,t)=>{const n=JD(),r=ni("Button",{...n,...e}),{isDisabled:o=n==null?void 0:n.isDisabled,isLoading:s,isActive:a,children:c,leftIcon:d,rightIcon:f,loadingText:h,iconSpacing:m="0.5rem",type:v,spinner:y,spinnerPlacement:S="start",className:x,as:w,..._}=Jn(e),k=p.useMemo(()=>{const O={...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:O}}},[r,n]),{ref:P,type:j}=nA(w),I={rightIcon:f,leftIcon:d,iconSpacing:m,children:c};return i.jsxs(Ie.button,{ref:jD(t,P),as:w,type:v??j,"data-active":on(a),"data-loading":on(s),__css:k,className:jt("chakra-button",x),..._,disabled:o||s,children:[s&&S==="start"&&i.jsx(Th,{className:"chakra-button__spinner--start",label:h,placement:"start",spacing:m,children:y}),s?h||i.jsx(Ie.span,{opacity:0,children:i.jsx(RS,{...I})}):i.jsx(RS,{...I}),s&&S==="end"&&i.jsx(Th,{className:"chakra-button__spinner--end",label:h,placement:"end",spacing:m,children:y})]})});ag.displayName="Button";function RS(e){const{leftIcon:t,rightIcon:n,children:r,iconSpacing:o}=e;return i.jsxs(i.Fragment,{children:[t&&i.jsx(T1,{marginEnd:o,children:t}),r,n&&i.jsx(T1,{marginStart:o,children:n})]})}var Ya=ze((e,t)=>{const{icon:n,children:r,isRound:o,"aria-label":s,...a}=e,c=n||r,d=p.isValidElement(c)?p.cloneElement(c,{"aria-hidden":!0,focusable:!1}):null;return i.jsx(ag,{padding:"0",borderRadius:o?"full":void 0,ref:t,"aria-label":s,...a,children:d})});Ya.displayName="IconButton";var[vpe,rA]=zn({name:"CheckboxGroupContext",strict:!1});function oA(e){const[t,n]=p.useState(e),[r,o]=p.useState(!1);return e!==t&&(o(!0),n(e)),r}function sA(e){return i.jsx(Ie.svg,{width:"1.2em",viewBox:"0 0 12 10",style:{fill:"none",strokeWidth:2,stroke:"currentColor",strokeDasharray:16},...e,children:i.jsx("polyline",{points:"1.5 6 4.5 9 10.5 1"})})}function aA(e){return i.jsx(Ie.svg,{width:"1.2em",viewBox:"0 0 24 24",style:{stroke:"currentColor",strokeWidth:4},...e,children:i.jsx("line",{x1:"21",x2:"3",y1:"12",y2:"12"})})}function iA(e){const{isIndeterminate:t,isChecked:n,...r}=e,o=t?aA:sA;return n||t?i.jsx(Ie.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:i.jsx(o,{...r})}):null}var[lA,a5]=zn({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "<FormControl />" `}),[cA,Gl]=zn({strict:!1,name:"FormControlContext"});function uA(e){const{id:t,isRequired:n,isInvalid:r,isDisabled:o,isReadOnly:s,...a}=e,c=p.useId(),d=t||`field-${c}`,f=`${d}-label`,h=`${d}-feedback`,m=`${d}-helptext`,[v,y]=p.useState(!1),[S,x]=p.useState(!1),[w,_]=p.useState(!1),k=p.useCallback((T={},R=null)=>({id:m,...T,ref:gn(R,M=>{M&&x(!0)})}),[m]),P=p.useCallback((T={},R=null)=>({...T,ref:R,"data-focus":on(w),"data-disabled":on(o),"data-invalid":on(r),"data-readonly":on(s),id:T.id!==void 0?T.id:f,htmlFor:T.htmlFor!==void 0?T.htmlFor:d}),[d,o,w,r,s,f]),j=p.useCallback((T={},R=null)=>({id:h,...T,ref:gn(R,M=>{M&&y(!0)}),"aria-live":"polite"}),[h]),I=p.useCallback((T={},R=null)=>({...T,...a,ref:R,role:"group"}),[a]),O=p.useCallback((T={},R=null)=>({...T,ref:R,role:"presentation","aria-hidden":!0,children:T.children||"*"}),[]);return{isRequired:!!n,isInvalid:!!r,isReadOnly:!!s,isDisabled:!!o,isFocused:!!w,onFocus:()=>_(!0),onBlur:()=>_(!1),hasFeedbackText:v,setHasFeedbackText:y,hasHelpText:S,setHasHelpText:x,id:d,labelId:f,feedbackId:h,helpTextId:m,htmlProps:a,getHelpTextProps:k,getErrorMessageProps:j,getRootProps:I,getLabelProps:P,getRequiredIndicatorProps:O}}var ar=ze(function(t,n){const r=Ur("Form",t),o=Jn(t),{getRootProps:s,htmlProps:a,...c}=uA(o),d=jt("chakra-form-control",t.className);return i.jsx(cA,{value:c,children:i.jsx(lA,{value:r,children:i.jsx(Ie.div,{...s({},n),className:d,__css:r.container})})})});ar.displayName="FormControl";var jo=ze(function(t,n){const r=Gl(),o=a5(),s=jt("chakra-form__helper-text",t.className);return i.jsx(Ie.div,{...r==null?void 0:r.getHelpTextProps(t,n),__css:o.helperText,className:s})});jo.displayName="FormHelperText";var[dA,fA]=zn({name:"FormErrorStylesContext",errorMessage:`useFormErrorStyles returned is 'undefined'. Seems you forgot to wrap the components in "<FormError />" `}),Eo=ze((e,t)=>{const n=Ur("FormError",e),r=Jn(e),o=Gl();return o!=null&&o.isInvalid?i.jsx(dA,{value:n,children:i.jsx(Ie.div,{...o==null?void 0:o.getErrorMessageProps(r,t),className:jt("chakra-form__error-message",e.className),__css:{display:"flex",alignItems:"center",...n.text}})}):null});Eo.displayName="FormErrorMessage";var pA=ze((e,t)=>{const n=fA(),r=Gl();if(!(r!=null&&r.isInvalid))return null;const o=jt("chakra-form__error-icon",e.className);return i.jsx(io,{ref:t,"aria-hidden":!0,...e,__css:n.icon,className:o,children:i.jsx("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"})})});pA.displayName="FormErrorIcon";var hr=ze(function(t,n){var r;const o=ni("FormLabel",t),s=Jn(t),{className:a,children:c,requiredIndicator:d=i.jsx(i5,{}),optionalIndicator:f=null,...h}=s,m=Gl(),v=(r=m==null?void 0:m.getLabelProps(h,n))!=null?r:{ref:n,...h};return i.jsxs(Ie.label,{...v,className:jt("chakra-form__label",s.className),__css:{display:"block",textAlign:"start",...o},children:[c,m!=null&&m.isRequired?d:f]})});hr.displayName="FormLabel";var i5=ze(function(t,n){const r=Gl(),o=a5();if(!(r!=null&&r.isRequired))return null;const s=jt("chakra-form__required-indicator",t.className);return i.jsx(Ie.span,{...r==null?void 0:r.getRequiredIndicatorProps(t,n),__css:o.requiredIndicator,className:s})});i5.displayName="RequiredIndicator";function lb(e){const{isDisabled:t,isInvalid:n,isReadOnly:r,isRequired:o,...s}=cb(e);return{...s,disabled:t,readOnly:r,required:o,"aria-invalid":bs(n),"aria-required":bs(o),"aria-readonly":bs(r)}}function cb(e){var t,n,r;const o=Gl(),{id:s,disabled:a,readOnly:c,required:d,isRequired:f,isInvalid:h,isReadOnly:m,isDisabled:v,onFocus:y,onBlur:S,...x}=e,w=e["aria-describedby"]?[e["aria-describedby"]]:[];return o!=null&&o.hasFeedbackText&&(o!=null&&o.isInvalid)&&w.push(o.feedbackId),o!=null&&o.hasHelpText&&w.push(o.helpTextId),{...x,"aria-describedby":w.join(" ")||void 0,id:s??(o==null?void 0:o.id),isDisabled:(t=a??v)!=null?t:o==null?void 0:o.isDisabled,isReadOnly:(n=c??m)!=null?n:o==null?void 0:o.isReadOnly,isRequired:(r=d??f)!=null?r:o==null?void 0:o.isRequired,isInvalid:h??(o==null?void 0:o.isInvalid),onFocus:st(o==null?void 0:o.onFocus,y),onBlur:st(o==null?void 0:o.onBlur,S)}}var ub={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},l5=Ie("span",{baseStyle:ub});l5.displayName="VisuallyHidden";var hA=Ie("input",{baseStyle:ub});hA.displayName="VisuallyHiddenInput";var MS=!1,uf=null,Ol=!1,R1=!1,M1=new Set;function db(e,t){M1.forEach(n=>n(e,t))}var mA=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function gA(e){return!(e.metaKey||!mA&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function DS(e){Ol=!0,gA(e)&&(uf="keyboard",db("keyboard",e))}function dc(e){if(uf="pointer",e.type==="mousedown"||e.type==="pointerdown"){Ol=!0;const t=e.composedPath?e.composedPath()[0]:e.target;let n=!1;try{n=t.matches(":focus-visible")}catch{}if(n)return;db("pointer",e)}}function vA(e){return e.mozInputSource===0&&e.isTrusted?!0:e.detail===0&&!e.pointerType}function yA(e){vA(e)&&(Ol=!0,uf="virtual")}function bA(e){e.target===window||e.target===document||(!Ol&&!R1&&(uf="virtual",db("virtual",e)),Ol=!1,R1=!1)}function xA(){Ol=!1,R1=!0}function AS(){return uf!=="pointer"}function wA(){if(typeof window>"u"||MS)return;const{focus:e}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...n){Ol=!0,e.apply(this,n)},document.addEventListener("keydown",DS,!0),document.addEventListener("keyup",DS,!0),document.addEventListener("click",yA,!0),window.addEventListener("focus",bA,!0),window.addEventListener("blur",xA,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",dc,!0),document.addEventListener("pointermove",dc,!0),document.addEventListener("pointerup",dc,!0)):(document.addEventListener("mousedown",dc,!0),document.addEventListener("mousemove",dc,!0),document.addEventListener("mouseup",dc,!0)),MS=!0}function c5(e){wA(),e(AS());const t=()=>e(AS());return M1.add(t),()=>{M1.delete(t)}}function SA(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function u5(e={}){const t=cb(e),{isDisabled:n,isReadOnly:r,isRequired:o,isInvalid:s,id:a,onBlur:c,onFocus:d,"aria-describedby":f}=t,{defaultChecked:h,isChecked:m,isFocusable:v,onChange:y,isIndeterminate:S,name:x,value:w,tabIndex:_=void 0,"aria-label":k,"aria-labelledby":P,"aria-invalid":j,...I}=e,O=SA(I,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),T=mr(y),R=mr(c),M=mr(d),[D,A]=p.useState(!1),[G,$]=p.useState(!1),[H,U]=p.useState(!1),[q,z]=p.useState(!1);p.useEffect(()=>c5(A),[]);const L=p.useRef(null),[V,W]=p.useState(!0),[te,fe]=p.useState(!!h),ae=m!==void 0,J=ae?m:te,B=p.useCallback(ie=>{if(r||n){ie.preventDefault();return}ae||fe(J?ie.target.checked:S?!0:ie.target.checked),T==null||T(ie)},[r,n,J,ae,S,T]);Tc(()=>{L.current&&(L.current.indeterminate=!!S)},[S]),ri(()=>{n&&$(!1)},[n,$]),Tc(()=>{const ie=L.current;ie!=null&&ie.form&&(ie.form.onreset=()=>{fe(!!h)})},[]);const oe=n&&!v,le=p.useCallback(ie=>{ie.key===" "&&z(!0)},[z]),ge=p.useCallback(ie=>{ie.key===" "&&z(!1)},[z]);Tc(()=>{if(!L.current)return;L.current.checked!==J&&fe(L.current.checked)},[L.current]);const se=p.useCallback((ie={},Pe=null)=>{const Je=Ae=>{G&&Ae.preventDefault(),z(!0)};return{...ie,ref:Pe,"data-active":on(q),"data-hover":on(H),"data-checked":on(J),"data-focus":on(G),"data-focus-visible":on(G&&D),"data-indeterminate":on(S),"data-disabled":on(n),"data-invalid":on(s),"data-readonly":on(r),"aria-hidden":!0,onMouseDown:st(ie.onMouseDown,Je),onMouseUp:st(ie.onMouseUp,()=>z(!1)),onMouseEnter:st(ie.onMouseEnter,()=>U(!0)),onMouseLeave:st(ie.onMouseLeave,()=>U(!1))}},[q,J,n,G,D,H,S,s,r]),pe=p.useCallback((ie={},Pe=null)=>({...O,...ie,ref:gn(Pe,Je=>{Je&&W(Je.tagName==="LABEL")}),onClick:st(ie.onClick,()=>{var Je;V||((Je=L.current)==null||Je.click(),requestAnimationFrame(()=>{var Ae;(Ae=L.current)==null||Ae.focus({preventScroll:!0})}))}),"data-disabled":on(n),"data-checked":on(J),"data-invalid":on(s)}),[O,n,J,s,V]),ue=p.useCallback((ie={},Pe=null)=>({...ie,ref:gn(L,Pe),type:"checkbox",name:x,value:w,id:a,tabIndex:_,onChange:st(ie.onChange,B),onBlur:st(ie.onBlur,R,()=>$(!1)),onFocus:st(ie.onFocus,M,()=>$(!0)),onKeyDown:st(ie.onKeyDown,le),onKeyUp:st(ie.onKeyUp,ge),required:o,checked:J,disabled:oe,readOnly:r,"aria-label":k,"aria-labelledby":P,"aria-invalid":j?!!j:s,"aria-describedby":f,"aria-disabled":n,style:ub}),[x,w,a,B,R,M,le,ge,o,J,oe,r,k,P,j,s,f,n,_]),be=p.useCallback((ie={},Pe=null)=>({...ie,ref:Pe,onMouseDown:st(ie.onMouseDown,CA),"data-disabled":on(n),"data-checked":on(J),"data-invalid":on(s)}),[J,n,s]);return{state:{isInvalid:s,isFocused:G,isChecked:J,isActive:q,isHovered:H,isIndeterminate:S,isDisabled:n,isReadOnly:r,isRequired:o},getRootProps:pe,getCheckboxProps:se,getInputProps:ue,getLabelProps:be,htmlProps:O}}function CA(e){e.preventDefault(),e.stopPropagation()}var _A={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},kA={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},PA=oi({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),jA=oi({from:{opacity:0},to:{opacity:1}}),EA=oi({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),d5=ze(function(t,n){const r=rA(),o={...r,...t},s=Ur("Checkbox",o),a=Jn(t),{spacing:c="0.5rem",className:d,children:f,iconColor:h,iconSize:m,icon:v=i.jsx(iA,{}),isChecked:y,isDisabled:S=r==null?void 0:r.isDisabled,onChange:x,inputProps:w,..._}=a;let k=y;r!=null&&r.value&&a.value&&(k=r.value.includes(a.value));let P=x;r!=null&&r.onChange&&a.value&&(P=Qm(r.onChange,x));const{state:j,getInputProps:I,getCheckboxProps:O,getLabelProps:T,getRootProps:R}=u5({..._,isDisabled:S,isChecked:k,onChange:P}),M=oA(j.isChecked),D=p.useMemo(()=>({animation:M?j.isIndeterminate?`${jA} 20ms linear, ${EA} 200ms linear`:`${PA} 200ms linear`:void 0,fontSize:m,color:h,...s.icon}),[h,m,M,j.isIndeterminate,s.icon]),A=p.cloneElement(v,{__css:D,isIndeterminate:j.isIndeterminate,isChecked:j.isChecked});return i.jsxs(Ie.label,{__css:{...kA,...s.container},className:jt("chakra-checkbox",d),...R(),children:[i.jsx("input",{className:"chakra-checkbox__input",...I(w,n)}),i.jsx(Ie.span,{__css:{..._A,...s.control},className:"chakra-checkbox__control",...O(),children:A}),f&&i.jsx(Ie.span,{className:"chakra-checkbox__label",...T(),__css:{marginStart:c,...s.label},children:f})]})});d5.displayName="Checkbox";function IA(e){const t=parseFloat(e);return typeof t!="number"||Number.isNaN(t)?0:t}function fb(e,t){let n=IA(e);const r=10**(t??10);return n=Math.round(n*r)/r,t?n.toFixed(t):n.toString()}function D1(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 Rh(e,t,n){return(e-t)*100/(n-t)}function f5(e,t,n){return(n-t)*e+t}function A1(e,t,n){const r=Math.round((e-t)/n)*n+t,o=D1(n);return fb(r,o)}function Ac(e,t,n){return e==null?e:(n<t&&console.warn("clamp: max cannot be less than min"),Math.min(Math.max(e,t),n))}function OA(e={}){const{onChange:t,precision:n,defaultValue:r,value:o,step:s=1,min:a=Number.MIN_SAFE_INTEGER,max:c=Number.MAX_SAFE_INTEGER,keepWithinRange:d=!0}=e,f=mr(t),[h,m]=p.useState(()=>{var D;return r==null?"":(D=v0(r,s,n))!=null?D:""}),v=typeof o<"u",y=v?o:h,S=p5(Ci(y),s),x=n??S,w=p.useCallback(D=>{D!==y&&(v||m(D.toString()),f==null||f(D.toString(),Ci(D)))},[f,v,y]),_=p.useCallback(D=>{let A=D;return d&&(A=Ac(A,a,c)),fb(A,x)},[x,d,c,a]),k=p.useCallback((D=s)=>{let A;y===""?A=Ci(D):A=Ci(y)+D,A=_(A),w(A)},[_,s,w,y]),P=p.useCallback((D=s)=>{let A;y===""?A=Ci(-D):A=Ci(y)-D,A=_(A),w(A)},[_,s,w,y]),j=p.useCallback(()=>{var D;let A;r==null?A="":A=(D=v0(r,s,n))!=null?D:a,w(A)},[r,n,s,w,a]),I=p.useCallback(D=>{var A;const G=(A=v0(D,s,x))!=null?A:a;w(G)},[x,s,w,a]),O=Ci(y);return{isOutOfRange:O>c||O<a,isAtMax:O===c,isAtMin:O===a,precision:x,value:y,valueAsNumber:O,update:w,reset:j,increment:k,decrement:P,clamp:_,cast:I,setValue:m}}function Ci(e){return parseFloat(e.toString().replace(/[^\w.-]+/g,""))}function p5(e,t){return Math.max(D1(t),D1(e))}function v0(e,t,n){const r=Ci(e);if(Number.isNaN(r))return;const o=p5(r,t);return fb(r,n??o)}var[TA,h5]=zn({name:"EditableStylesContext",errorMessage:`useEditableStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Editable />" `}),[RA,m5]=zn({name:"EditableContext",errorMessage:"useEditableContext: context is undefined. Seems you forgot to wrap the editable components in `<Editable />`"}),g5={fontSize:"inherit",fontWeight:"inherit",textAlign:"inherit",bg:"transparent"},v5=ze(function(t,n){const{getInputProps:r}=m5(),o=h5(),s=r(t,n),a=jt("chakra-editable__input",t.className);return i.jsx(Ie.input,{...s,__css:{outline:0,...g5,...o.input},className:a})});v5.displayName="EditableInput";var y5=ze(function(t,n){const{getPreviewProps:r}=m5(),o=h5(),s=r(t,n),a=jt("chakra-editable__preview",t.className);return i.jsx(Ie.span,{...s,__css:{cursor:"text",display:"inline-block",...g5,...o.preview},className:a})});y5.displayName="EditablePreview";function xl(e,t,n,r){const o=mr(n);return p.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 MA(e){return"current"in e}var b5=()=>typeof window<"u";function DA(){var e;const t=navigator.userAgentData;return(e=t==null?void 0:t.platform)!=null?e:navigator.platform}var AA=e=>b5()&&e.test(navigator.vendor),NA=e=>b5()&&e.test(DA()),zA=()=>NA(/mac|iphone|ipad|ipod/i),$A=()=>zA()&&AA(/apple/i);function x5(e){const{ref:t,elements:n,enabled:r}=e,o=()=>{var s,a;return(a=(s=t.current)==null?void 0:s.ownerDocument)!=null?a:document};xl(o,"pointerdown",s=>{if(!$A()||!r)return;const a=s.target,d=(n??[t]).some(f=>{const h=MA(f)?f.current:f;return(h==null?void 0:h.contains(a))||h===a});o().activeElement!==a&&d&&(s.preventDefault(),a.focus())})}function NS(e,t){return e?e===t||e.contains(t):!1}function LA(e={}){const{onChange:t,onCancel:n,onSubmit:r,onBlur:o,value:s,isDisabled:a,defaultValue:c,startWithEditView:d,isPreviewFocusable:f=!0,submitOnBlur:h=!0,selectAllOnFocus:m=!0,placeholder:v,onEdit:y,finalFocusRef:S,...x}=e,w=mr(y),_=!!(d&&!a),[k,P]=p.useState(_),[j,I]=bu({defaultValue:c||"",value:s,onChange:t}),[O,T]=p.useState(j),R=p.useRef(null),M=p.useRef(null),D=p.useRef(null),A=p.useRef(null),G=p.useRef(null);x5({ref:R,enabled:k,elements:[A,G]});const $=!k&&!a;Tc(()=>{var se,pe;k&&((se=R.current)==null||se.focus(),m&&((pe=R.current)==null||pe.select()))},[]),ri(()=>{var se,pe,ue,be;if(!k){S?(se=S.current)==null||se.focus():(pe=D.current)==null||pe.focus();return}(ue=R.current)==null||ue.focus(),m&&((be=R.current)==null||be.select()),w==null||w()},[k,w,m]);const H=p.useCallback(()=>{$&&P(!0)},[$]),U=p.useCallback(()=>{T(j)},[j]),q=p.useCallback(()=>{P(!1),I(O),n==null||n(O),o==null||o(O)},[n,o,I,O]),z=p.useCallback(()=>{P(!1),T(j),r==null||r(j),o==null||o(O)},[j,r,o,O]);p.useEffect(()=>{if(k)return;const se=R.current;(se==null?void 0:se.ownerDocument.activeElement)===se&&(se==null||se.blur())},[k]);const L=p.useCallback(se=>{I(se.currentTarget.value)},[I]),V=p.useCallback(se=>{const pe=se.key,be={Escape:q,Enter:ke=>{!ke.shiftKey&&!ke.metaKey&&z()}}[pe];be&&(se.preventDefault(),be(se))},[q,z]),W=p.useCallback(se=>{const pe=se.key,be={Escape:q}[pe];be&&(se.preventDefault(),be(se))},[q]),te=j.length===0,fe=p.useCallback(se=>{var pe;if(!k)return;const ue=se.currentTarget.ownerDocument,be=(pe=se.relatedTarget)!=null?pe:ue.activeElement,ke=NS(A.current,be),ie=NS(G.current,be);!ke&&!ie&&(h?z():q())},[h,z,q,k]),ae=p.useCallback((se={},pe=null)=>{const ue=$&&f?0:void 0;return{...se,ref:gn(pe,M),children:te?v:j,hidden:k,"aria-disabled":bs(a),tabIndex:ue,onFocus:st(se.onFocus,H,U)}},[a,k,$,f,te,H,U,v,j]),J=p.useCallback((se={},pe=null)=>({...se,hidden:!k,placeholder:v,ref:gn(pe,R),disabled:a,"aria-disabled":bs(a),value:j,onBlur:st(se.onBlur,fe),onChange:st(se.onChange,L),onKeyDown:st(se.onKeyDown,V),onFocus:st(se.onFocus,U)}),[a,k,fe,L,V,U,v,j]),B=p.useCallback((se={},pe=null)=>({...se,hidden:!k,placeholder:v,ref:gn(pe,R),disabled:a,"aria-disabled":bs(a),value:j,onBlur:st(se.onBlur,fe),onChange:st(se.onChange,L),onKeyDown:st(se.onKeyDown,W),onFocus:st(se.onFocus,U)}),[a,k,fe,L,W,U,v,j]),oe=p.useCallback((se={},pe=null)=>({"aria-label":"Edit",...se,type:"button",onClick:st(se.onClick,H),ref:gn(pe,D),disabled:a}),[H,a]),le=p.useCallback((se={},pe=null)=>({...se,"aria-label":"Submit",ref:gn(G,pe),type:"button",onClick:st(se.onClick,z),disabled:a}),[z,a]),ge=p.useCallback((se={},pe=null)=>({"aria-label":"Cancel",id:"cancel",...se,ref:gn(A,pe),type:"button",onClick:st(se.onClick,q),disabled:a}),[q,a]);return{isEditing:k,isDisabled:a,isValueEmpty:te,value:j,onEdit:H,onCancel:q,onSubmit:z,getPreviewProps:ae,getInputProps:J,getTextareaProps:B,getEditButtonProps:oe,getSubmitButtonProps:le,getCancelButtonProps:ge,htmlProps:x}}var w5=ze(function(t,n){const r=Ur("Editable",t),o=Jn(t),{htmlProps:s,...a}=LA(o),{isEditing:c,onSubmit:d,onCancel:f,onEdit:h}=a,m=jt("chakra-editable",t.className),v=qy(t.children,{isEditing:c,onSubmit:d,onCancel:f,onEdit:h});return i.jsx(RA,{value:a,children:i.jsx(TA,{value:r,children:i.jsx(Ie.div,{ref:n,...s,className:m,children:v})})})});w5.displayName="Editable";var S5={exports:{}},BA="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",FA=BA,HA=FA;function C5(){}function _5(){}_5.resetWarningCache=C5;var VA=function(){function e(r,o,s,a,c,d){if(d!==HA){var f=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 f.name="Invariant Violation",f}}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:_5,resetWarningCache:C5};return n.PropTypes=n,n};S5.exports=VA();var WA=S5.exports;const Kn=gu(WA);var N1="data-focus-lock",k5="data-focus-lock-disabled",UA="data-no-focus-lock",GA="data-autofocus-inside",qA="data-no-autofocus";function YA(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function KA(e,t){var n=p.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 P5(e,t){return KA(t||null,function(n){return e.forEach(function(r){return YA(r,n)})})}var y0={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"},ma=function(){return ma=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},ma.apply(this,arguments)};function j5(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 xu(e,t,n,r){function o(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function c(h){try{f(r.next(h))}catch(m){a(m)}}function d(h){try{f(r.throw(h))}catch(m){a(m)}}function f(h){h.done?s(h.value):o(h.value).then(c,d)}f((r=r.apply(e,t||[])).next())})}function wu(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,o,s,a;return a={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(f){return function(h){return d([f,h])}}function d(f){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,f[0]&&(n=0)),n;)try{if(r=1,o&&(s=f[0]&2?o.return:f[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,f[1])).done)return s;switch(o=0,s&&(f=[f[0]&2,s.value]),f[0]){case 0:case 1:s=f;break;case 4:return n.label++,{value:f[1],done:!1};case 5:n.label++,o=f[1],f=[0];continue;case 7:f=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(f[0]===6||f[0]===2)){n=0;continue}if(f[0]===3&&(!s||f[1]>s[0]&&f[1]<s[3])){n.label=f[1];break}if(f[0]===6&&n.label<s[1]){n.label=s[1],s=f;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(f);break}s[2]&&n.ops.pop(),n.trys.pop();continue}f=t.call(e,n)}catch(h){f=[6,h],o=0}finally{r=s=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function zS(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,s=[],a;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)s.push(o.value)}catch(c){a={error:c}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return s}function z1(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 E5(e){return e}function I5(e,t){t===void 0&&(t=E5);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 a=t(s,r);return n.push(a),function(){n=n.filter(function(c){return c!==a})}},assignSyncMedium:function(s){for(r=!0;n.length;){var a=n;n=[],a.forEach(s)}n={push:function(c){return s(c)},filter:function(){return n}}},assignMedium:function(s){r=!0;var a=[];if(n.length){var c=n;n=[],c.forEach(s),a=n}var d=function(){var h=a;a=[],h.forEach(s)},f=function(){return Promise.resolve().then(d)};f(),n={push:function(h){a.push(h),f()},filter:function(h){return a=a.filter(h),n}}}};return o}function pb(e,t){return t===void 0&&(t=E5),I5(e,t)}function O5(e){e===void 0&&(e={});var t=I5(null);return t.options=ma({async:!0,ssr:!1},e),t}var T5=function(e){var t=e.sideCar,n=j5(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 p.createElement(r,ma({},n))};T5.isSideCarExport=!0;function XA(e,t){return e.useMedium(t),T5}var R5=pb({},function(e){var t=e.target,n=e.currentTarget;return{target:t,currentTarget:n}}),M5=pb(),ZA=pb(),QA=O5({async:!0}),JA=[],hb=p.forwardRef(function(t,n){var r,o=p.useState(),s=o[0],a=o[1],c=p.useRef(),d=p.useRef(!1),f=p.useRef(null),h=t.children,m=t.disabled,v=t.noFocusGuards,y=t.persistentFocus,S=t.crossFrame,x=t.autoFocus;t.allowTextSelection;var w=t.group,_=t.className,k=t.whiteList,P=t.hasPositiveIndices,j=t.shards,I=j===void 0?JA:j,O=t.as,T=O===void 0?"div":O,R=t.lockProps,M=R===void 0?{}:R,D=t.sideCar,A=t.returnFocus,G=t.focusOptions,$=t.onActivation,H=t.onDeactivation,U=p.useState({}),q=U[0],z=p.useCallback(function(){f.current=f.current||document&&document.activeElement,c.current&&$&&$(c.current),d.current=!0},[$]),L=p.useCallback(function(){d.current=!1,H&&H(c.current)},[H]);p.useEffect(function(){m||(f.current=null)},[]);var V=p.useCallback(function(le){var ge=f.current;if(ge&&ge.focus){var se=typeof A=="function"?A(ge):A;if(se){var pe=typeof se=="object"?se:void 0;f.current=null,le?Promise.resolve().then(function(){return ge.focus(pe)}):ge.focus(pe)}}},[A]),W=p.useCallback(function(le){d.current&&R5.useMedium(le)},[]),te=M5.useMedium,fe=p.useCallback(function(le){c.current!==le&&(c.current=le,a(le))},[]),ae=gr((r={},r[k5]=m&&"disabled",r[N1]=w,r),M),J=v!==!0,B=J&&v!=="tail",oe=P5([n,fe]);return p.createElement(p.Fragment,null,J&&[p.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:m?-1:0,style:y0}),P?p.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:m?-1:1,style:y0}):null],!m&&p.createElement(D,{id:q,sideCar:QA,observed:s,disabled:m,persistentFocus:y,crossFrame:S,autoFocus:x,whiteList:k,shards:I,onActivation:z,onDeactivation:L,returnFocus:V,focusOptions:G}),p.createElement(T,gr({ref:oe},ae,{className:_,onBlur:te,onFocus:W}),h),B&&p.createElement("div",{"data-focus-guard":!0,tabIndex:m?-1:0,style:y0}))});hb.propTypes={};hb.defaultProps={children:void 0,disabled:!1,returnFocus:!1,focusOptions:void 0,noFocusGuards:!1,autoFocus:!0,persistentFocus:!1,crossFrame:!0,hasPositiveIndices:void 0,allowTextSelection:void 0,group:void 0,className:void 0,whiteList:void 0,shards:void 0,as:"div",lockProps:{},onActivation:void 0,onDeactivation:void 0};const D5=hb;function $1(e,t){return $1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},$1(e,t)}function eN(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,$1(e,t)}function tN(e,t){function n(r){return r.displayName||r.name||"Component"}return function(o){var s=[],a;function c(){a=e(s.map(function(f){return f.props})),t(a)}var d=function(f){eN(h,f);function h(){return f.apply(this,arguments)||this}h.peek=function(){return a};var m=h.prototype;return m.componentDidMount=function(){s.push(this),c()},m.componentDidUpdate=function(){c()},m.componentWillUnmount=function(){var y=s.indexOf(this);s.splice(y,1),c()},m.render=function(){return F.createElement(o,this.props)},h}(p.PureComponent);return F8(d,"displayName","SideEffect("+n(o)+")"),d}}var ja=function(e){for(var t=Array(e.length),n=0;n<e.length;++n)t[n]=e[n];return t},Mh=function(e){return Array.isArray(e)?e:[e]},A5=function(e){return Array.isArray(e)?e[0]:e},nN=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"},N5=function(e){return e.parentNode&&e.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.parentNode.host:e.parentNode},z5=function(e){return e===document||e&&e.nodeType===Node.DOCUMENT_NODE},rN=function(e,t){return!e||z5(e)||!nN(e)&&t(N5(e))},$5=function(e,t){var n=e.get(t);if(n!==void 0)return n;var r=rN(t,$5.bind(void 0,e));return e.set(t,r),r},oN=function(e,t){return e&&!z5(e)?iN(e)?t(N5(e)):!1:!0},L5=function(e,t){var n=e.get(t);if(n!==void 0)return n;var r=oN(t,L5.bind(void 0,e));return e.set(t,r),r},B5=function(e){return e.dataset},sN=function(e){return e.tagName==="BUTTON"},F5=function(e){return e.tagName==="INPUT"},H5=function(e){return F5(e)&&e.type==="radio"},aN=function(e){return!((F5(e)||sN(e))&&(e.type==="hidden"||e.disabled))},iN=function(e){var t=e.getAttribute(qA);return![!0,"true",""].includes(t)},mb=function(e){var t;return!!(e&&(!((t=B5(e))===null||t===void 0)&&t.focusGuard))},Dh=function(e){return!mb(e)},lN=function(e){return!!e},cN=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},V5=function(e,t,n){return ja(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(cN)},uN=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],gb=uN.join(","),dN="".concat(gb,", [data-focus-guard]"),W5=function(e,t){return ja((e.shadowRoot||e).children).reduce(function(n,r){return n.concat(r.matches(t?dN:gb)?[r]:[],W5(r))},[])},fN=function(e,t){var n;return e instanceof HTMLIFrameElement&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?ig([e.contentDocument.body],t):[e]},ig=function(e,t){return e.reduce(function(n,r){var o,s=W5(r,t),a=(o=[]).concat.apply(o,s.map(function(c){return fN(c,t)}));return n.concat(a,r.parentNode?ja(r.parentNode.querySelectorAll(gb)).filter(function(c){return c===r}):[])},[])},pN=function(e){var t=e.querySelectorAll("[".concat(GA,"]"));return ja(t).map(function(n){return ig([n])}).reduce(function(n,r){return n.concat(r)},[])},vb=function(e,t){return ja(e).filter(function(n){return $5(t,n)}).filter(function(n){return aN(n)})},$S=function(e,t){return t===void 0&&(t=new Map),ja(e).filter(function(n){return L5(t,n)})},L1=function(e,t,n){return V5(vb(ig(e,n),t),!0,n)},LS=function(e,t){return V5(vb(ig(e),t),!1)},hN=function(e,t){return vb(pN(e),t)},Nc=function(e,t){return e.shadowRoot?Nc(e.shadowRoot,t):Object.getPrototypeOf(e).contains!==void 0&&Object.getPrototypeOf(e).contains.call(e,t)?!0:ja(e.children).some(function(n){var r;if(n instanceof HTMLIFrameElement){var o=(r=n.contentDocument)===null||r===void 0?void 0:r.body;return o?Nc(o,t):!1}return Nc(n,t)})},mN=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(a,c){return!t.has(c)})},U5=function(e){return e.parentNode?U5(e.parentNode):e},yb=function(e){var t=Mh(e);return t.filter(Boolean).reduce(function(n,r){var o=r.getAttribute(N1);return n.push.apply(n,o?mN(ja(U5(r).querySelectorAll("[".concat(N1,'="').concat(o,'"]:not([').concat(k5,'="disabled"])')))):[r]),n},[])},gN=function(e){try{return e()}catch{return}},Pd=function(e){if(e===void 0&&(e=document),!(!e||!e.activeElement)){var t=e.activeElement;return t.shadowRoot?Pd(t.shadowRoot):t instanceof HTMLIFrameElement&&gN(function(){return t.contentWindow.document})?Pd(t.contentWindow.document):t}},vN=function(e,t){return e===t},yN=function(e,t){return!!ja(e.querySelectorAll("iframe")).some(function(n){return vN(n,t)})},G5=function(e,t){return t===void 0&&(t=Pd(A5(e).ownerDocument)),!t||t.dataset&&t.dataset.focusGuard?!1:yb(e).some(function(n){return Nc(n,t)||yN(n,t)})},bN=function(e){e===void 0&&(e=document);var t=Pd(e);return t?ja(e.querySelectorAll("[".concat(UA,"]"))).some(function(n){return Nc(n,t)}):!1},xN=function(e,t){return t.filter(H5).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},bb=function(e,t){return H5(e)&&e.name?xN(e,t):e},wN=function(e){var t=new Set;return e.forEach(function(n){return t.add(bb(n,e))}),e.filter(function(n){return t.has(n)})},BS=function(e){return e[0]&&e.length>1?bb(e[0],e):e[0]},FS=function(e,t){return e.length>1?e.indexOf(bb(e[t],e)):t},q5="NEW_FOCUS",SN=function(e,t,n,r){var o=e.length,s=e[0],a=e[o-1],c=mb(n);if(!(n&&e.indexOf(n)>=0)){var d=n!==void 0?t.indexOf(n):-1,f=r?t.indexOf(r):d,h=r?e.indexOf(r):-1,m=d-f,v=t.indexOf(s),y=t.indexOf(a),S=wN(t),x=n!==void 0?S.indexOf(n):-1,w=x-(r?S.indexOf(r):d),_=FS(e,0),k=FS(e,o-1);if(d===-1||h===-1)return q5;if(!m&&h>=0)return h;if(d<=v&&c&&Math.abs(m)>1)return k;if(d>=y&&c&&Math.abs(m)>1)return _;if(m&&Math.abs(w)>1)return h;if(d<=v)return k;if(d>y)return _;if(m)return Math.abs(m)>1?h:(o+h+m)%o}},CN=function(e){return function(t){var n,r=(n=B5(t))===null||n===void 0?void 0:n.autofocus;return t.autofocus||r!==void 0&&r!=="false"||e.indexOf(t)>=0}},_N=function(e,t,n){var r=e.map(function(s){var a=s.node;return a}),o=$S(r.filter(CN(n)));return o&&o.length?BS(o):BS($S(t))},B1=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&B1(e.parentNode.host||e.parentNode,t),t},b0=function(e,t){for(var n=B1(e),r=B1(t),o=0;o<n.length;o+=1){var s=n[o];if(r.indexOf(s)>=0)return s}return!1},Y5=function(e,t,n){var r=Mh(e),o=Mh(t),s=r[0],a=!1;return o.filter(Boolean).forEach(function(c){a=b0(a||c,c)||a,n.filter(Boolean).forEach(function(d){var f=b0(s,d);f&&(!a||Nc(f,a)?a=f:a=b0(f,a))})}),a},kN=function(e,t){return e.reduce(function(n,r){return n.concat(hN(r,t))},[])},PN=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(lN)},jN=function(e,t){var n=Pd(Mh(e).length>0?document:A5(e).ownerDocument),r=yb(e).filter(Dh),o=Y5(n||e,e,r),s=new Map,a=LS(r,s),c=L1(r,s).filter(function(y){var S=y.node;return Dh(S)});if(!(!c[0]&&(c=a,!c[0]))){var d=LS([o],s).map(function(y){var S=y.node;return S}),f=PN(d,c),h=f.map(function(y){var S=y.node;return S}),m=SN(h,d,n,t);if(m===q5){var v=_N(a,h,kN(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:f[m]}},EN=function(e){var t=yb(e).filter(Dh),n=Y5(e,e,t),r=new Map,o=L1([n],r,!0),s=L1(t,r).filter(function(a){var c=a.node;return Dh(c)}).map(function(a){var c=a.node;return c});return o.map(function(a){var c=a.node,d=a.index;return{node:c,index:d,lockItem:s.indexOf(c)>=0,guard:mb(c)}})},IN=function(e,t){"focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus()},x0=0,w0=!1,K5=function(e,t,n){n===void 0&&(n={});var r=jN(e,t);if(!w0&&r){if(x0>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),w0=!0,setTimeout(function(){w0=!1},1);return}x0++,IN(r.node,n.focusOptions),x0--}};function X5(e){var t=window,n=t.setImmediate;typeof n<"u"?n(e):setTimeout(e,1)}var ON=function(){return document&&document.activeElement===document.body},TN=function(){return ON()||bN()},zc=null,kc=null,$c=null,jd=!1,RN=function(){return!0},MN=function(t){return(zc.whiteList||RN)(t)},DN=function(t,n){$c={observerNode:t,portaledElement:n}},AN=function(t){return $c&&$c.portaledElement===t};function HS(e,t,n,r){var o=null,s=e;do{var a=r[s];if(a.guard)a.node.dataset.focusAutoGuard&&(o=a);else if(a.lockItem){if(s!==e)return;o=null}else break}while((s+=n)!==t);o&&(o.node.tabIndex=0)}var NN=function(t){return t&&"current"in t?t.current:t},zN=function(t){return t?!!jd:jd==="meanwhile"},$N=function e(t,n,r){return n&&(n.host===t&&(!n.activeElement||r.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,r))},LN=function(t,n){return n.some(function(r){return $N(t,r,r)})},Ah=function(){var t=!1;if(zc){var n=zc,r=n.observed,o=n.persistentFocus,s=n.autoFocus,a=n.shards,c=n.crossFrame,d=n.focusOptions,f=r||$c&&$c.portaledElement,h=document&&document.activeElement;if(f){var m=[f].concat(a.map(NN).filter(Boolean));if((!h||MN(h))&&(o||zN(c)||!TN()||!kc&&s)&&(f&&!(G5(m)||h&&LN(h,m)||AN(h))&&(document&&!kc&&h&&!s?(h.blur&&h.blur(),document.body.focus()):(t=K5(m,kc,{focusOptions:d}),$c={})),jd=!1,kc=document&&document.activeElement),document){var v=document&&document.activeElement,y=EN(m),S=y.map(function(x){var w=x.node;return w}).indexOf(v);S>-1&&(y.filter(function(x){var w=x.guard,_=x.node;return w&&_.dataset.focusAutoGuard}).forEach(function(x){var w=x.node;return w.removeAttribute("tabIndex")}),HS(S,y.length,1,y),HS(S,-1,-1,y))}}}return t},Z5=function(t){Ah()&&t&&(t.stopPropagation(),t.preventDefault())},xb=function(){return X5(Ah)},BN=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||DN(r,n)},FN=function(){return null},Q5=function(){jd="just",setTimeout(function(){jd="meanwhile"},0)},HN=function(){document.addEventListener("focusin",Z5),document.addEventListener("focusout",xb),window.addEventListener("blur",Q5)},VN=function(){document.removeEventListener("focusin",Z5),document.removeEventListener("focusout",xb),window.removeEventListener("blur",Q5)};function WN(e){return e.filter(function(t){var n=t.disabled;return!n})}function UN(e){var t=e.slice(-1)[0];t&&!zc&&HN();var n=zc,r=n&&t&&t.id===n.id;zc=t,n&&!r&&(n.onDeactivation(),e.filter(function(o){var s=o.id;return s===n.id}).length||n.returnFocus(!t)),t?(kc=null,(!r||n.observed!==t.observed)&&t.onActivation(),Ah(),X5(Ah)):(VN(),kc=null)}R5.assignSyncMedium(BN);M5.assignMedium(xb);ZA.assignMedium(function(e){return e({moveFocusInside:K5,focusInside:G5})});const GN=tN(WN,UN)(FN);var J5=p.forwardRef(function(t,n){return p.createElement(D5,gr({sideCar:GN,ref:n},t))}),e6=D5.propTypes||{};e6.sideCar;O9(e6,["sideCar"]);J5.propTypes={};const VS=J5;function t6(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function wb(e){var t;if(!t6(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function qN(e){var t,n;return(n=(t=n6(e))==null?void 0:t.defaultView)!=null?n:window}function n6(e){return t6(e)?e.ownerDocument:document}function YN(e){return n6(e).activeElement}function KN(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 XN(e){return e.localName==="html"?e:e.assignedSlot||e.parentElement||e.ownerDocument.documentElement}function r6(e){return["html","body","#document"].includes(e.localName)?e.ownerDocument.body:wb(e)&&KN(e)?e:r6(XN(e))}var o6=e=>e.hasAttribute("tabindex"),ZN=e=>o6(e)&&e.tabIndex===-1;function QN(e){return!!e.getAttribute("disabled")||!!e.getAttribute("aria-disabled")}function s6(e){return e.parentElement&&s6(e.parentElement)?!0:e.hidden}function JN(e){const t=e.getAttribute("contenteditable");return t!=="false"&&t!=null}function a6(e){if(!wb(e)||s6(e)||QN(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]():JN(e)?!0:o6(e)}function ez(e){return e?wb(e)&&a6(e)&&!ZN(e):!1}var tz=["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]"],nz=tz.join(),rz=e=>e.offsetWidth>0&&e.offsetHeight>0;function i6(e){const t=Array.from(e.querySelectorAll(nz));return t.unshift(e),t.filter(n=>a6(n)&&rz(n))}var WS,oz=(WS=VS.default)!=null?WS:VS,l6=e=>{const{initialFocusRef:t,finalFocusRef:n,contentRef:r,restoreFocus:o,children:s,isDisabled:a,autoFocus:c,persistentFocus:d,lockFocusAcrossFrames:f}=e,h=p.useCallback(()=>{t!=null&&t.current?t.current.focus():r!=null&&r.current&&i6(r.current).length===0&&requestAnimationFrame(()=>{var S;(S=r.current)==null||S.focus()})},[t,r]),m=p.useCallback(()=>{var y;(y=n==null?void 0:n.current)==null||y.focus()},[n]),v=o&&!n;return i.jsx(oz,{crossFrame:f,persistentFocus:d,autoFocus:c,disabled:a,onActivation:h,onDeactivation:m,returnFocus:v,children:s})};l6.displayName="FocusLock";function sz(e,t,n,r){const o=XP(t);return p.useEffect(()=>{var s;const a=(s=Fw(n))!=null?s:document;if(t)return a.addEventListener(e,o,r),()=>{a.removeEventListener(e,o,r)}},[e,n,r,o,t]),()=>{var s;((s=Fw(n))!=null?s:document).removeEventListener(e,o,r)}}function az(e){const{ref:t,handler:n,enabled:r=!0}=e,o=XP(n),a=p.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}).current;p.useEffect(()=>{if(!r)return;const c=m=>{S0(m,t)&&(a.isPointerDown=!0)},d=m=>{if(a.ignoreEmulatedMouseEvents){a.ignoreEmulatedMouseEvents=!1;return}a.isPointerDown&&n&&S0(m,t)&&(a.isPointerDown=!1,o(m))},f=m=>{a.ignoreEmulatedMouseEvents=!0,n&&a.isPointerDown&&S0(m,t)&&(a.isPointerDown=!1,o(m))},h=ZP(t.current);return h.addEventListener("mousedown",c,!0),h.addEventListener("mouseup",d,!0),h.addEventListener("touchstart",c,!0),h.addEventListener("touchend",f,!0),()=>{h.removeEventListener("mousedown",c,!0),h.removeEventListener("mouseup",d,!0),h.removeEventListener("touchstart",c,!0),h.removeEventListener("touchend",f,!0)}},[n,t,o,a,r])}function S0(e,t){var n;const r=e.target;return r&&!ZP(r).contains(r)?!1:!((n=t.current)!=null&&n.contains(r))}var[iz,lz]=zn({name:"InputGroupStylesContext",errorMessage:`useInputGroupStyles returned is 'undefined'. Seems you forgot to wrap the components in "<InputGroup />" `}),c6=ze(function(t,n){const r=Ur("Input",t),{children:o,className:s,...a}=Jn(t),c=jt("chakra-input__group",s),d={},f=cf(o),h=r.field;f.forEach(v=>{var y,S;r&&(h&&v.type.id==="InputLeftElement"&&(d.paddingStart=(y=h.height)!=null?y:h.h),h&&v.type.id==="InputRightElement"&&(d.paddingEnd=(S=h.height)!=null?S:h.h),v.type.id==="InputRightAddon"&&(d.borderEndRadius=0),v.type.id==="InputLeftAddon"&&(d.borderStartRadius=0))});const m=f.map(v=>{var y,S;const x=ob({size:((y=v.props)==null?void 0:y.size)||t.size,variant:((S=v.props)==null?void 0:S.variant)||t.variant});return v.type.id!=="Input"?p.cloneElement(v,x):p.cloneElement(v,Object.assign(x,d,v.props))});return i.jsx(Ie.div,{className:c,ref:n,__css:{width:"100%",display:"flex",position:"relative",isolation:"isolate"},"data-group":!0,...a,children:i.jsx(iz,{value:r,children:m})})});c6.displayName="InputGroup";var cz=Ie("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"0",zIndex:2}}),lg=ze(function(t,n){var r,o;const{placement:s="left",...a}=t,c=lz(),d=c.field,h={[s==="left"?"insetStart":"insetEnd"]:"0",width:(r=d==null?void 0:d.height)!=null?r:d==null?void 0:d.h,height:(o=d==null?void 0:d.height)!=null?o:d==null?void 0:d.h,fontSize:d==null?void 0:d.fontSize,...c.element};return i.jsx(cz,{ref:n,__css:h,...a})});lg.id="InputElement";lg.displayName="InputElement";var u6=ze(function(t,n){const{className:r,...o}=t,s=jt("chakra-input__left-element",r);return i.jsx(lg,{ref:n,placement:"left",className:s,...o})});u6.id="InputLeftElement";u6.displayName="InputLeftElement";var Sb=ze(function(t,n){const{className:r,...o}=t,s=jt("chakra-input__right-element",r);return i.jsx(lg,{ref:n,placement:"right",className:s,...o})});Sb.id="InputRightElement";Sb.displayName="InputRightElement";var df=ze(function(t,n){const{htmlSize:r,...o}=t,s=Ur("Input",o),a=Jn(o),c=lb(a),d=jt("chakra-input",t.className);return i.jsx(Ie.input,{size:r,...c,__css:s.field,ref:n,className:d})});df.displayName="Input";df.id="Input";var wl=ze(function(t,n){const r=ni("Link",t),{className:o,isExternal:s,...a}=Jn(t);return i.jsx(Ie.a,{target:s?"_blank":void 0,rel:s?"noopener":void 0,ref:n,className:jt("chakra-link",o),...a,__css:r})});wl.displayName="Link";var[uz,d6]=zn({name:"ListStylesContext",errorMessage:`useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "<List />" `}),Cb=ze(function(t,n){const r=Ur("List",t),{children:o,styleType:s="none",stylePosition:a,spacing:c,...d}=Jn(t),f=cf(o),m=c?{["& > *:not(style) ~ *:not(style)"]:{mt:c}}:{};return i.jsx(uz,{value:r,children:i.jsx(Ie.ul,{ref:n,listStyleType:s,listStylePosition:a,role:"list",__css:{...r.container,...m},...d,children:f})})});Cb.displayName="List";var dz=ze((e,t)=>{const{as:n,...r}=e;return i.jsx(Cb,{ref:t,as:"ol",styleType:"decimal",marginStart:"1em",...r})});dz.displayName="OrderedList";var cg=ze(function(t,n){const{as:r,...o}=t;return i.jsx(Cb,{ref:n,as:"ul",styleType:"initial",marginStart:"1em",...o})});cg.displayName="UnorderedList";var qo=ze(function(t,n){const r=d6();return i.jsx(Ie.li,{ref:n,...t,__css:r.item})});qo.displayName="ListItem";var fz=ze(function(t,n){const r=d6();return i.jsx(io,{ref:n,role:"presentation",...t,__css:r.icon})});fz.displayName="ListIcon";var Ka=ze(function(t,n){const{templateAreas:r,gap:o,rowGap:s,columnGap:a,column:c,row:d,autoFlow:f,autoRows:h,templateRows:m,autoColumns:v,templateColumns:y,...S}=t,x={display:"grid",gridTemplateAreas:r,gridGap:o,gridRowGap:s,gridColumnGap:a,gridAutoColumns:v,gridColumn:c,gridRow:d,gridAutoFlow:f,gridAutoRows:h,gridTemplateRows:m,gridTemplateColumns:y};return i.jsx(Ie.div,{ref:n,__css:x,...S})});Ka.displayName="Grid";function f6(e,t){return Array.isArray(e)?e.map(n=>n===null?null:t(n)):x1(e)?Object.keys(e).reduce((n,r)=>(n[r]=t(e[r]),n),{}):e!=null?t(e):null}var ql=Ie("div",{baseStyle:{flex:1,justifySelf:"stretch",alignSelf:"stretch"}});ql.displayName="Spacer";var nt=ze(function(t,n){const r=ni("Text",t),{className:o,align:s,decoration:a,casing:c,...d}=Jn(t),f=ob({textAlign:t.align,textDecoration:t.decoration,textTransform:t.casing});return i.jsx(Ie.p,{ref:n,className:jt("chakra-text",t.className),...f,...d,__css:r})});nt.displayName="Text";var p6=e=>i.jsx(Ie.div,{className:"chakra-stack__item",...e,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...e.__css}});p6.displayName="StackItem";function pz(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{"&":f6(n,o=>r[o])}}var _b=ze((e,t)=>{const{isInline:n,direction:r,align:o,justify:s,spacing:a="0.5rem",wrap:c,children:d,divider:f,className:h,shouldWrapChildren:m,...v}=e,y=n?"row":r??"column",S=p.useMemo(()=>pz({spacing:a,direction:y}),[a,y]),x=!!f,w=!m&&!x,_=p.useMemo(()=>{const P=cf(d);return w?P:P.map((j,I)=>{const O=typeof j.key<"u"?j.key:I,T=I+1===P.length,M=m?i.jsx(p6,{children:j},O):j;if(!x)return M;const D=p.cloneElement(f,{__css:S}),A=T?null:D;return i.jsxs(p.Fragment,{children:[M,A]},O)})},[f,S,x,w,m,d]),k=jt("chakra-stack",h);return i.jsx(Ie.div,{ref:t,display:"flex",alignItems:o,justifyContent:s,flexDirection:y,flexWrap:c,gap:x?void 0:a,className:k,...v,children:_})});_b.displayName="Stack";var Ar=ze((e,t)=>i.jsx(_b,{align:"center",...e,direction:"column",ref:t}));Ar.displayName="VStack";var ya=ze((e,t)=>i.jsx(_b,{align:"center",...e,direction:"row",ref:t}));ya.displayName="HStack";function US(e){return f6(e,t=>t==="auto"?"auto":`span ${t}/span ${t}`)}var F1=ze(function(t,n){const{area:r,colSpan:o,colStart:s,colEnd:a,rowEnd:c,rowSpan:d,rowStart:f,...h}=t,m=ob({gridArea:r,gridColumn:US(o),gridRow:US(d),gridColumnStart:s,gridColumnEnd:a,gridRowStart:f,gridRowEnd:c});return i.jsx(Ie.div,{ref:n,__css:m,...h})});F1.displayName="GridItem";var Kc=ze(function(t,n){const r=ni("Badge",t),{className:o,...s}=Jn(t);return i.jsx(Ie.span,{ref:n,className:jt("chakra-badge",t.className),...s,__css:{display:"inline-block",whiteSpace:"nowrap",verticalAlign:"middle",...r}})});Kc.displayName="Badge";var h6=Ie("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center"}});h6.displayName="Center";var hz={horizontal:{insetStart:"50%",transform:"translateX(-50%)"},vertical:{top:"50%",transform:"translateY(-50%)"},both:{insetStart:"50%",top:"50%",transform:"translate(-50%, -50%)"}};ze(function(t,n){const{axis:r="both",...o}=t;return i.jsx(Ie.div,{ref:n,__css:hz[r],...o,position:"absolute"})});var ai=ze(function(t,n){const{borderLeftWidth:r,borderBottomWidth:o,borderTopWidth:s,borderRightWidth:a,borderWidth:c,borderStyle:d,borderColor:f,...h}=ni("Divider",t),{className:m,orientation:v="horizontal",__css:y,...S}=Jn(t),x={vertical:{borderLeftWidth:r||a||c||"1px",height:"100%"},horizontal:{borderBottomWidth:o||s||c||"1px",width:"100%"}};return i.jsx(Ie.hr,{ref:n,"aria-orientation":v,...S,__css:{...h,border:"0",borderColor:f,borderStyle:d,...x[v],...y},className:jt("chakra-divider",m)})});ai.displayName="Divider";function mz(e){const{key:t}=e;return t.length===1||t.length>1&&/[^a-zA-Z0-9]/.test(t)}function gz(e={}){const{timeout:t=300,preventDefault:n=()=>!0}=e,[r,o]=p.useState([]),s=p.useRef(),a=()=>{s.current&&(clearTimeout(s.current),s.current=null)},c=()=>{a(),s.current=setTimeout(()=>{o([]),s.current=null},t)};p.useEffect(()=>a,[]);function d(f){return h=>{if(h.key==="Backspace"){const m=[...r];m.pop(),o(m);return}if(mz(h)){const m=r.concat(h.key);n(h)&&(h.preventDefault(),h.stopPropagation()),o(m),f(m.join("")),c()}}}return d}function vz(e,t,n,r){if(t==null)return r;if(!r)return e.find(a=>n(a).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 yz(){const e=p.useRef(new Map),t=e.current,n=p.useCallback((o,s,a,c)=>{e.current.set(a,{type:s,el:o,options:c}),o.addEventListener(s,a,c)},[]),r=p.useCallback((o,s,a,c)=>{o.removeEventListener(s,a,c),e.current.delete(a)},[]);return p.useEffect(()=>()=>{t.forEach((o,s)=>{r(o.el,o.type,s,o.options)})},[r,t]),{add:n,remove:r}}function C0(e){const t=e.target,{tagName:n,isContentEditable:r}=t;return n!=="INPUT"&&n!=="TEXTAREA"&&r!==!0}function m6(e={}){const{ref:t,isDisabled:n,isFocusable:r,clickOnEnter:o=!0,clickOnSpace:s=!0,onMouseDown:a,onMouseUp:c,onClick:d,onKeyDown:f,onKeyUp:h,tabIndex:m,onMouseOver:v,onMouseLeave:y,...S}=e,[x,w]=p.useState(!0),[_,k]=p.useState(!1),P=yz(),j=z=>{z&&z.tagName!=="BUTTON"&&w(!1)},I=x?m:m||0,O=n&&!r,T=p.useCallback(z=>{if(n){z.stopPropagation(),z.preventDefault();return}z.currentTarget.focus(),d==null||d(z)},[n,d]),R=p.useCallback(z=>{_&&C0(z)&&(z.preventDefault(),z.stopPropagation(),k(!1),P.remove(document,"keyup",R,!1))},[_,P]),M=p.useCallback(z=>{if(f==null||f(z),n||z.defaultPrevented||z.metaKey||!C0(z.nativeEvent)||x)return;const L=o&&z.key==="Enter";s&&z.key===" "&&(z.preventDefault(),k(!0)),L&&(z.preventDefault(),z.currentTarget.click()),P.add(document,"keyup",R,!1)},[n,x,f,o,s,P,R]),D=p.useCallback(z=>{if(h==null||h(z),n||z.defaultPrevented||z.metaKey||!C0(z.nativeEvent)||x)return;s&&z.key===" "&&(z.preventDefault(),k(!1),z.currentTarget.click())},[s,x,n,h]),A=p.useCallback(z=>{z.button===0&&(k(!1),P.remove(document,"mouseup",A,!1))},[P]),G=p.useCallback(z=>{if(z.button!==0)return;if(n){z.stopPropagation(),z.preventDefault();return}x||k(!0),z.currentTarget.focus({preventScroll:!0}),P.add(document,"mouseup",A,!1),a==null||a(z)},[n,x,a,P,A]),$=p.useCallback(z=>{z.button===0&&(x||k(!1),c==null||c(z))},[c,x]),H=p.useCallback(z=>{if(n){z.preventDefault();return}v==null||v(z)},[n,v]),U=p.useCallback(z=>{_&&(z.preventDefault(),k(!1)),y==null||y(z)},[_,y]),q=gn(t,j);return x?{...S,ref:q,type:"button","aria-disabled":O?void 0:n,disabled:O,onClick:T,onMouseDown:a,onMouseUp:c,onKeyUp:h,onKeyDown:f,onMouseOver:v,onMouseLeave:y}:{...S,ref:q,role:"button","data-active":on(_),"aria-disabled":n?"true":void 0,tabIndex:O?void 0:I,onClick:T,onMouseDown:G,onMouseUp:$,onKeyUp:D,onKeyDown:M,onMouseOver:H,onMouseLeave:U}}function bz(e){const t=e.current;if(!t)return!1;const n=YN(t);return!n||t.contains(n)?!1:!!ez(n)}function g6(e,t){const{shouldFocus:n,visible:r,focusRef:o}=t,s=n&&!r;ri(()=>{if(!s||bz(e))return;const a=(o==null?void 0:o.current)||e.current;let c;if(a)return c=requestAnimationFrame(()=>{a.focus({preventScroll:!0})}),()=>{cancelAnimationFrame(c)}},[s,e,o])}var xz={preventScroll:!0,shouldFocus:!1};function wz(e,t=xz){const{focusRef:n,preventScroll:r,shouldFocus:o,visible:s}=t,a=Sz(e)?e.current:e,c=o&&s,d=p.useRef(c),f=p.useRef(s);Tc(()=>{!f.current&&s&&(d.current=c),f.current=s},[s,c]);const h=p.useCallback(()=>{if(!(!s||!a||!d.current)&&(d.current=!1,!a.contains(document.activeElement)))if(n!=null&&n.current)requestAnimationFrame(()=>{var m;(m=n.current)==null||m.focus({preventScroll:r})});else{const m=i6(a);m.length>0&&requestAnimationFrame(()=>{m[0].focus({preventScroll:r})})}},[s,r,a,n]);ri(()=>{h()},[h]),xl(a,"transitionend",h)}function Sz(e){return"current"in e}var fc=(e,t)=>({var:e,varRef:t?`var(${e}, ${t})`:`var(${e})`}),Nr={arrowShadowColor:fc("--popper-arrow-shadow-color"),arrowSize:fc("--popper-arrow-size","8px"),arrowSizeHalf:fc("--popper-arrow-size-half"),arrowBg:fc("--popper-arrow-bg"),transformOrigin:fc("--popper-transform-origin"),arrowOffset:fc("--popper-arrow-offset")};function Cz(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 _z={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"},kz=e=>_z[e],GS={scroll:!0,resize:!0};function Pz(e){let t;return typeof e=="object"?t={enabled:!0,options:{...GS,...e}}:t={enabled:e,options:GS},t}var jz={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`}},Ez={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:e})=>{qS(e)},effect:({state:e})=>()=>{qS(e)}},qS=e=>{e.elements.popper.style.setProperty(Nr.transformOrigin.var,kz(e.placement))},Iz={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:e})=>{Oz(e)}},Oz=e=>{var t;if(!e.placement)return;const n=Tz(e.placement);if((t=e.elements)!=null&&t.arrow&&n){Object.assign(e.elements.arrow.style,{[n.property]:n.value,width:Nr.arrowSize.varRef,height:Nr.arrowSize.varRef,zIndex:-1});const r={[Nr.arrowSizeHalf.var]:`calc(${Nr.arrowSize.varRef} / 2 - 1px)`,[Nr.arrowOffset.var]:`calc(${Nr.arrowSizeHalf.varRef} * -1)`};for(const o in r)e.elements.arrow.style.setProperty(o,r[o])}},Tz=e=>{if(e.startsWith("top"))return{property:"bottom",value:Nr.arrowOffset.varRef};if(e.startsWith("bottom"))return{property:"top",value:Nr.arrowOffset.varRef};if(e.startsWith("left"))return{property:"right",value:Nr.arrowOffset.varRef};if(e.startsWith("right"))return{property:"left",value:Nr.arrowOffset.varRef}},Rz={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:e})=>{YS(e)},effect:({state:e})=>()=>{YS(e)}},YS=e=>{if(!e.elements.arrow)return;const t=e.elements.arrow.querySelector("[data-popper-arrow-inner]");if(!t)return;const n=Cz(e.placement);n&&t.style.setProperty("--popper-arrow-default-shadow",n),Object.assign(t.style,{transform:"rotate(45deg)",background:Nr.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:"var(--popper-arrow-shadow, var(--popper-arrow-default-shadow))"})},Mz={"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"}},Dz={"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 Az(e,t="ltr"){var n,r;const o=((n=Mz[e])==null?void 0:n[t])||e;return t==="ltr"?o:(r=Dz[e])!=null?r:o}var To="top",Cs="bottom",_s="right",Ro="left",kb="auto",ff=[To,Cs,_s,Ro],Xc="start",Ed="end",Nz="clippingParents",v6="viewport",Uu="popper",zz="reference",KS=ff.reduce(function(e,t){return e.concat([t+"-"+Xc,t+"-"+Ed])},[]),y6=[].concat(ff,[kb]).reduce(function(e,t){return e.concat([t,t+"-"+Xc,t+"-"+Ed])},[]),$z="beforeRead",Lz="read",Bz="afterRead",Fz="beforeMain",Hz="main",Vz="afterMain",Wz="beforeWrite",Uz="write",Gz="afterWrite",qz=[$z,Lz,Bz,Fz,Hz,Vz,Wz,Uz,Gz];function wa(e){return e?(e.nodeName||"").toLowerCase():null}function Yo(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Tl(e){var t=Yo(e).Element;return e instanceof t||e instanceof Element}function xs(e){var t=Yo(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Pb(e){if(typeof ShadowRoot>"u")return!1;var t=Yo(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Yz(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];!xs(s)||!wa(s)||(Object.assign(s.style,r),Object.keys(o).forEach(function(a){var c=o[a];c===!1?s.removeAttribute(a):s.setAttribute(a,c===!0?"":c)}))})}function Kz(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]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),c=a.reduce(function(d,f){return d[f]="",d},{});!xs(o)||!wa(o)||(Object.assign(o.style,c),Object.keys(s).forEach(function(d){o.removeAttribute(d)}))})}}const Xz={name:"applyStyles",enabled:!0,phase:"write",fn:Yz,effect:Kz,requires:["computeStyles"]};function ba(e){return e.split("-")[0]}var Sl=Math.max,Nh=Math.min,Zc=Math.round;function H1(){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 b6(){return!/^((?!chrome|android).)*safari/i.test(H1())}function Qc(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),o=1,s=1;t&&xs(e)&&(o=e.offsetWidth>0&&Zc(r.width)/e.offsetWidth||1,s=e.offsetHeight>0&&Zc(r.height)/e.offsetHeight||1);var a=Tl(e)?Yo(e):window,c=a.visualViewport,d=!b6()&&n,f=(r.left+(d&&c?c.offsetLeft:0))/o,h=(r.top+(d&&c?c.offsetTop:0))/s,m=r.width/o,v=r.height/s;return{width:m,height:v,top:h,right:f+m,bottom:h+v,left:f,x:f,y:h}}function jb(e){var t=Qc(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 x6(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Pb(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Xa(e){return Yo(e).getComputedStyle(e)}function Zz(e){return["table","td","th"].indexOf(wa(e))>=0}function Gi(e){return((Tl(e)?e.ownerDocument:e.document)||window.document).documentElement}function ug(e){return wa(e)==="html"?e:e.assignedSlot||e.parentNode||(Pb(e)?e.host:null)||Gi(e)}function XS(e){return!xs(e)||Xa(e).position==="fixed"?null:e.offsetParent}function Qz(e){var t=/firefox/i.test(H1()),n=/Trident/i.test(H1());if(n&&xs(e)){var r=Xa(e);if(r.position==="fixed")return null}var o=ug(e);for(Pb(o)&&(o=o.host);xs(o)&&["html","body"].indexOf(wa(o))<0;){var s=Xa(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 pf(e){for(var t=Yo(e),n=XS(e);n&&Zz(n)&&Xa(n).position==="static";)n=XS(n);return n&&(wa(n)==="html"||wa(n)==="body"&&Xa(n).position==="static")?t:n||Qz(e)||t}function Eb(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function hd(e,t,n){return Sl(e,Nh(t,n))}function Jz(e,t,n){var r=hd(e,t,n);return r>n?n:r}function w6(){return{top:0,right:0,bottom:0,left:0}}function S6(e){return Object.assign({},w6(),e)}function C6(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var e$=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,S6(typeof t!="number"?t:C6(t,ff))};function t$(e){var t,n=e.state,r=e.name,o=e.options,s=n.elements.arrow,a=n.modifiersData.popperOffsets,c=ba(n.placement),d=Eb(c),f=[Ro,_s].indexOf(c)>=0,h=f?"height":"width";if(!(!s||!a)){var m=e$(o.padding,n),v=jb(s),y=d==="y"?To:Ro,S=d==="y"?Cs:_s,x=n.rects.reference[h]+n.rects.reference[d]-a[d]-n.rects.popper[h],w=a[d]-n.rects.reference[d],_=pf(s),k=_?d==="y"?_.clientHeight||0:_.clientWidth||0:0,P=x/2-w/2,j=m[y],I=k-v[h]-m[S],O=k/2-v[h]/2+P,T=hd(j,O,I),R=d;n.modifiersData[r]=(t={},t[R]=T,t.centerOffset=T-O,t)}}function n$(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)||x6(t.elements.popper,o)&&(t.elements.arrow=o))}const r$={name:"arrow",enabled:!0,phase:"main",fn:t$,effect:n$,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Jc(e){return e.split("-")[1]}var o$={top:"auto",right:"auto",bottom:"auto",left:"auto"};function s$(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:Zc(n*o)/o||0,y:Zc(r*o)/o||0}}function ZS(e){var t,n=e.popper,r=e.popperRect,o=e.placement,s=e.variation,a=e.offsets,c=e.position,d=e.gpuAcceleration,f=e.adaptive,h=e.roundOffsets,m=e.isFixed,v=a.x,y=v===void 0?0:v,S=a.y,x=S===void 0?0:S,w=typeof h=="function"?h({x:y,y:x}):{x:y,y:x};y=w.x,x=w.y;var _=a.hasOwnProperty("x"),k=a.hasOwnProperty("y"),P=Ro,j=To,I=window;if(f){var O=pf(n),T="clientHeight",R="clientWidth";if(O===Yo(n)&&(O=Gi(n),Xa(O).position!=="static"&&c==="absolute"&&(T="scrollHeight",R="scrollWidth")),O=O,o===To||(o===Ro||o===_s)&&s===Ed){j=Cs;var M=m&&O===I&&I.visualViewport?I.visualViewport.height:O[T];x-=M-r.height,x*=d?1:-1}if(o===Ro||(o===To||o===Cs)&&s===Ed){P=_s;var D=m&&O===I&&I.visualViewport?I.visualViewport.width:O[R];y-=D-r.width,y*=d?1:-1}}var A=Object.assign({position:c},f&&o$),G=h===!0?s$({x:y,y:x},Yo(n)):{x:y,y:x};if(y=G.x,x=G.y,d){var $;return Object.assign({},A,($={},$[j]=k?"0":"",$[P]=_?"0":"",$.transform=(I.devicePixelRatio||1)<=1?"translate("+y+"px, "+x+"px)":"translate3d("+y+"px, "+x+"px, 0)",$))}return Object.assign({},A,(t={},t[j]=k?x+"px":"",t[P]=_?y+"px":"",t.transform="",t))}function a$(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=r===void 0?!0:r,s=n.adaptive,a=s===void 0?!0:s,c=n.roundOffsets,d=c===void 0?!0:c,f={placement:ba(t.placement),variation:Jc(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,ZS(Object.assign({},f,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:d})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,ZS(Object.assign({},f,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:d})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const i$={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:a$,data:{}};var up={passive:!0};function l$(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,s=o===void 0?!0:o,a=r.resize,c=a===void 0?!0:a,d=Yo(t.elements.popper),f=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&f.forEach(function(h){h.addEventListener("scroll",n.update,up)}),c&&d.addEventListener("resize",n.update,up),function(){s&&f.forEach(function(h){h.removeEventListener("scroll",n.update,up)}),c&&d.removeEventListener("resize",n.update,up)}}const c$={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:l$,data:{}};var u$={left:"right",right:"left",bottom:"top",top:"bottom"};function oh(e){return e.replace(/left|right|bottom|top/g,function(t){return u$[t]})}var d$={start:"end",end:"start"};function QS(e){return e.replace(/start|end/g,function(t){return d$[t]})}function Ib(e){var t=Yo(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Ob(e){return Qc(Gi(e)).left+Ib(e).scrollLeft}function f$(e,t){var n=Yo(e),r=Gi(e),o=n.visualViewport,s=r.clientWidth,a=r.clientHeight,c=0,d=0;if(o){s=o.width,a=o.height;var f=b6();(f||!f&&t==="fixed")&&(c=o.offsetLeft,d=o.offsetTop)}return{width:s,height:a,x:c+Ob(e),y:d}}function p$(e){var t,n=Gi(e),r=Ib(e),o=(t=e.ownerDocument)==null?void 0:t.body,s=Sl(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=Sl(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),c=-r.scrollLeft+Ob(e),d=-r.scrollTop;return Xa(o||n).direction==="rtl"&&(c+=Sl(n.clientWidth,o?o.clientWidth:0)-s),{width:s,height:a,x:c,y:d}}function Tb(e){var t=Xa(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function _6(e){return["html","body","#document"].indexOf(wa(e))>=0?e.ownerDocument.body:xs(e)&&Tb(e)?e:_6(ug(e))}function md(e,t){var n;t===void 0&&(t=[]);var r=_6(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),s=Yo(r),a=o?[s].concat(s.visualViewport||[],Tb(r)?r:[]):r,c=t.concat(a);return o?c:c.concat(md(ug(a)))}function V1(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function h$(e,t){var n=Qc(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 JS(e,t,n){return t===v6?V1(f$(e,n)):Tl(t)?h$(t,n):V1(p$(Gi(e)))}function m$(e){var t=md(ug(e)),n=["absolute","fixed"].indexOf(Xa(e).position)>=0,r=n&&xs(e)?pf(e):e;return Tl(r)?t.filter(function(o){return Tl(o)&&x6(o,r)&&wa(o)!=="body"}):[]}function g$(e,t,n,r){var o=t==="clippingParents"?m$(e):[].concat(t),s=[].concat(o,[n]),a=s[0],c=s.reduce(function(d,f){var h=JS(e,f,r);return d.top=Sl(h.top,d.top),d.right=Nh(h.right,d.right),d.bottom=Nh(h.bottom,d.bottom),d.left=Sl(h.left,d.left),d},JS(e,a,r));return c.width=c.right-c.left,c.height=c.bottom-c.top,c.x=c.left,c.y=c.top,c}function k6(e){var t=e.reference,n=e.element,r=e.placement,o=r?ba(r):null,s=r?Jc(r):null,a=t.x+t.width/2-n.width/2,c=t.y+t.height/2-n.height/2,d;switch(o){case To:d={x:a,y:t.y-n.height};break;case Cs:d={x:a,y:t.y+t.height};break;case _s:d={x:t.x+t.width,y:c};break;case Ro:d={x:t.x-n.width,y:c};break;default:d={x:t.x,y:t.y}}var f=o?Eb(o):null;if(f!=null){var h=f==="y"?"height":"width";switch(s){case Xc:d[f]=d[f]-(t[h]/2-n[h]/2);break;case Ed:d[f]=d[f]+(t[h]/2-n[h]/2);break}}return d}function Id(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=r===void 0?e.placement:r,s=n.strategy,a=s===void 0?e.strategy:s,c=n.boundary,d=c===void 0?Nz:c,f=n.rootBoundary,h=f===void 0?v6:f,m=n.elementContext,v=m===void 0?Uu:m,y=n.altBoundary,S=y===void 0?!1:y,x=n.padding,w=x===void 0?0:x,_=S6(typeof w!="number"?w:C6(w,ff)),k=v===Uu?zz:Uu,P=e.rects.popper,j=e.elements[S?k:v],I=g$(Tl(j)?j:j.contextElement||Gi(e.elements.popper),d,h,a),O=Qc(e.elements.reference),T=k6({reference:O,element:P,strategy:"absolute",placement:o}),R=V1(Object.assign({},P,T)),M=v===Uu?R:O,D={top:I.top-M.top+_.top,bottom:M.bottom-I.bottom+_.bottom,left:I.left-M.left+_.left,right:M.right-I.right+_.right},A=e.modifiersData.offset;if(v===Uu&&A){var G=A[o];Object.keys(D).forEach(function($){var H=[_s,Cs].indexOf($)>=0?1:-1,U=[To,Cs].indexOf($)>=0?"y":"x";D[$]+=G[U]*H})}return D}function v$(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=n.boundary,s=n.rootBoundary,a=n.padding,c=n.flipVariations,d=n.allowedAutoPlacements,f=d===void 0?y6:d,h=Jc(r),m=h?c?KS:KS.filter(function(S){return Jc(S)===h}):ff,v=m.filter(function(S){return f.indexOf(S)>=0});v.length===0&&(v=m);var y=v.reduce(function(S,x){return S[x]=Id(e,{placement:x,boundary:o,rootBoundary:s,padding:a})[ba(x)],S},{});return Object.keys(y).sort(function(S,x){return y[S]-y[x]})}function y$(e){if(ba(e)===kb)return[];var t=oh(e);return[QS(e),t,QS(t)]}function b$(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,a=n.altAxis,c=a===void 0?!0:a,d=n.fallbackPlacements,f=n.padding,h=n.boundary,m=n.rootBoundary,v=n.altBoundary,y=n.flipVariations,S=y===void 0?!0:y,x=n.allowedAutoPlacements,w=t.options.placement,_=ba(w),k=_===w,P=d||(k||!S?[oh(w)]:y$(w)),j=[w].concat(P).reduce(function(J,B){return J.concat(ba(B)===kb?v$(t,{placement:B,boundary:h,rootBoundary:m,padding:f,flipVariations:S,allowedAutoPlacements:x}):B)},[]),I=t.rects.reference,O=t.rects.popper,T=new Map,R=!0,M=j[0],D=0;D<j.length;D++){var A=j[D],G=ba(A),$=Jc(A)===Xc,H=[To,Cs].indexOf(G)>=0,U=H?"width":"height",q=Id(t,{placement:A,boundary:h,rootBoundary:m,altBoundary:v,padding:f}),z=H?$?_s:Ro:$?Cs:To;I[U]>O[U]&&(z=oh(z));var L=oh(z),V=[];if(s&&V.push(q[G]<=0),c&&V.push(q[z]<=0,q[L]<=0),V.every(function(J){return J})){M=A,R=!1;break}T.set(A,V)}if(R)for(var W=S?3:1,te=function(B){var oe=j.find(function(le){var ge=T.get(le);if(ge)return ge.slice(0,B).every(function(se){return se})});if(oe)return M=oe,"break"},fe=W;fe>0;fe--){var ae=te(fe);if(ae==="break")break}t.placement!==M&&(t.modifiersData[r]._skip=!0,t.placement=M,t.reset=!0)}}const x$={name:"flip",enabled:!0,phase:"main",fn:b$,requiresIfExists:["offset"],data:{_skip:!1}};function eC(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 tC(e){return[To,_s,Cs,Ro].some(function(t){return e[t]>=0})}function w$(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,s=t.modifiersData.preventOverflow,a=Id(t,{elementContext:"reference"}),c=Id(t,{altBoundary:!0}),d=eC(a,r),f=eC(c,o,s),h=tC(d),m=tC(f);t.modifiersData[n]={referenceClippingOffsets:d,popperEscapeOffsets:f,isReferenceHidden:h,hasPopperEscaped:m},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":m})}const S$={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:w$};function C$(e,t,n){var r=ba(e),o=[Ro,To].indexOf(r)>=0?-1:1,s=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=s[0],c=s[1];return a=a||0,c=(c||0)*o,[Ro,_s].indexOf(r)>=0?{x:c,y:a}:{x:a,y:c}}function _$(e){var t=e.state,n=e.options,r=e.name,o=n.offset,s=o===void 0?[0,0]:o,a=y6.reduce(function(h,m){return h[m]=C$(m,t.rects,s),h},{}),c=a[t.placement],d=c.x,f=c.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=d,t.modifiersData.popperOffsets.y+=f),t.modifiersData[r]=a}const k$={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:_$};function P$(e){var t=e.state,n=e.name;t.modifiersData[n]=k6({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const j$={name:"popperOffsets",enabled:!0,phase:"read",fn:P$,data:{}};function E$(e){return e==="x"?"y":"x"}function I$(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,s=o===void 0?!0:o,a=n.altAxis,c=a===void 0?!1:a,d=n.boundary,f=n.rootBoundary,h=n.altBoundary,m=n.padding,v=n.tether,y=v===void 0?!0:v,S=n.tetherOffset,x=S===void 0?0:S,w=Id(t,{boundary:d,rootBoundary:f,padding:m,altBoundary:h}),_=ba(t.placement),k=Jc(t.placement),P=!k,j=Eb(_),I=E$(j),O=t.modifiersData.popperOffsets,T=t.rects.reference,R=t.rects.popper,M=typeof x=="function"?x(Object.assign({},t.rects,{placement:t.placement})):x,D=typeof M=="number"?{mainAxis:M,altAxis:M}:Object.assign({mainAxis:0,altAxis:0},M),A=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,G={x:0,y:0};if(O){if(s){var $,H=j==="y"?To:Ro,U=j==="y"?Cs:_s,q=j==="y"?"height":"width",z=O[j],L=z+w[H],V=z-w[U],W=y?-R[q]/2:0,te=k===Xc?T[q]:R[q],fe=k===Xc?-R[q]:-T[q],ae=t.elements.arrow,J=y&&ae?jb(ae):{width:0,height:0},B=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:w6(),oe=B[H],le=B[U],ge=hd(0,T[q],J[q]),se=P?T[q]/2-W-ge-oe-D.mainAxis:te-ge-oe-D.mainAxis,pe=P?-T[q]/2+W+ge+le+D.mainAxis:fe+ge+le+D.mainAxis,ue=t.elements.arrow&&pf(t.elements.arrow),be=ue?j==="y"?ue.clientTop||0:ue.clientLeft||0:0,ke=($=A==null?void 0:A[j])!=null?$:0,ie=z+se-ke-be,Pe=z+pe-ke,Je=hd(y?Nh(L,ie):L,z,y?Sl(V,Pe):V);O[j]=Je,G[j]=Je-z}if(c){var Ae,Ve=j==="x"?To:Ro,kt=j==="x"?Cs:_s,ft=O[I],yn=I==="y"?"height":"width",K=ft+w[Ve],Ce=ft-w[kt],ne=[To,Ro].indexOf(_)!==-1,me=(Ae=A==null?void 0:A[I])!=null?Ae:0,Re=ne?K:ft-T[yn]-R[yn]-me+D.altAxis,Ye=ne?ft+T[yn]+R[yn]-me-D.altAxis:Ce,ye=y&&ne?Jz(Re,ft,Ye):hd(y?Re:K,ft,y?Ye:Ce);O[I]=ye,G[I]=ye-ft}t.modifiersData[r]=G}}const O$={name:"preventOverflow",enabled:!0,phase:"main",fn:I$,requiresIfExists:["offset"]};function T$(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function R$(e){return e===Yo(e)||!xs(e)?Ib(e):T$(e)}function M$(e){var t=e.getBoundingClientRect(),n=Zc(t.width)/e.offsetWidth||1,r=Zc(t.height)/e.offsetHeight||1;return n!==1||r!==1}function D$(e,t,n){n===void 0&&(n=!1);var r=xs(t),o=xs(t)&&M$(t),s=Gi(t),a=Qc(e,o,n),c={scrollLeft:0,scrollTop:0},d={x:0,y:0};return(r||!r&&!n)&&((wa(t)!=="body"||Tb(s))&&(c=R$(t)),xs(t)?(d=Qc(t,!0),d.x+=t.clientLeft,d.y+=t.clientTop):s&&(d.x=Ob(s))),{x:a.left+c.scrollLeft-d.x,y:a.top+c.scrollTop-d.y,width:a.width,height:a.height}}function A$(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 a=[].concat(s.requires||[],s.requiresIfExists||[]);a.forEach(function(c){if(!n.has(c)){var d=t.get(c);d&&o(d)}}),r.push(s)}return e.forEach(function(s){n.has(s.name)||o(s)}),r}function N$(e){var t=A$(e);return qz.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function z$(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function $$(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 nC={placement:"bottom",modifiers:[],strategy:"absolute"};function rC(){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 L$(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,o=t.defaultOptions,s=o===void 0?nC:o;return function(c,d,f){f===void 0&&(f=s);var h={placement:"bottom",orderedModifiers:[],options:Object.assign({},nC,s),modifiersData:{},elements:{reference:c,popper:d},attributes:{},styles:{}},m=[],v=!1,y={state:h,setOptions:function(_){var k=typeof _=="function"?_(h.options):_;x(),h.options=Object.assign({},s,h.options,k),h.scrollParents={reference:Tl(c)?md(c):c.contextElement?md(c.contextElement):[],popper:md(d)};var P=N$($$([].concat(r,h.options.modifiers)));return h.orderedModifiers=P.filter(function(j){return j.enabled}),S(),y.update()},forceUpdate:function(){if(!v){var _=h.elements,k=_.reference,P=_.popper;if(rC(k,P)){h.rects={reference:D$(k,pf(P),h.options.strategy==="fixed"),popper:jb(P)},h.reset=!1,h.placement=h.options.placement,h.orderedModifiers.forEach(function(D){return h.modifiersData[D.name]=Object.assign({},D.data)});for(var j=0;j<h.orderedModifiers.length;j++){if(h.reset===!0){h.reset=!1,j=-1;continue}var I=h.orderedModifiers[j],O=I.fn,T=I.options,R=T===void 0?{}:T,M=I.name;typeof O=="function"&&(h=O({state:h,options:R,name:M,instance:y})||h)}}}},update:z$(function(){return new Promise(function(w){y.forceUpdate(),w(h)})}),destroy:function(){x(),v=!0}};if(!rC(c,d))return y;y.setOptions(f).then(function(w){!v&&f.onFirstUpdate&&f.onFirstUpdate(w)});function S(){h.orderedModifiers.forEach(function(w){var _=w.name,k=w.options,P=k===void 0?{}:k,j=w.effect;if(typeof j=="function"){var I=j({state:h,name:_,instance:y,options:P}),O=function(){};m.push(I||O)}})}function x(){m.forEach(function(w){return w()}),m=[]}return y}}var B$=[c$,j$,i$,Xz,k$,x$,O$,r$,S$],F$=L$({defaultModifiers:B$});function Rb(e={}){const{enabled:t=!0,modifiers:n,placement:r="bottom",strategy:o="absolute",arrowPadding:s=8,eventListeners:a=!0,offset:c,gutter:d=8,flip:f=!0,boundary:h="clippingParents",preventOverflow:m=!0,matchWidth:v,direction:y="ltr"}=e,S=p.useRef(null),x=p.useRef(null),w=p.useRef(null),_=Az(r,y),k=p.useRef(()=>{}),P=p.useCallback(()=>{var D;!t||!S.current||!x.current||((D=k.current)==null||D.call(k),w.current=F$(S.current,x.current,{placement:_,modifiers:[Rz,Iz,Ez,{...jz,enabled:!!v},{name:"eventListeners",...Pz(a)},{name:"arrow",options:{padding:s}},{name:"offset",options:{offset:c??[0,d]}},{name:"flip",enabled:!!f,options:{padding:8}},{name:"preventOverflow",enabled:!!m,options:{boundary:h}},...n??[]],strategy:o}),w.current.forceUpdate(),k.current=w.current.destroy)},[_,t,n,v,a,s,c,d,f,m,h,o]);p.useEffect(()=>()=>{var D;!S.current&&!x.current&&((D=w.current)==null||D.destroy(),w.current=null)},[]);const j=p.useCallback(D=>{S.current=D,P()},[P]),I=p.useCallback((D={},A=null)=>({...D,ref:gn(j,A)}),[j]),O=p.useCallback(D=>{x.current=D,P()},[P]),T=p.useCallback((D={},A=null)=>({...D,ref:gn(O,A),style:{...D.style,position:o,minWidth:v?void 0:"max-content",inset:"0 auto auto 0"}}),[o,O,v]),R=p.useCallback((D={},A=null)=>{const{size:G,shadowColor:$,bg:H,style:U,...q}=D;return{...q,ref:A,"data-popper-arrow":"",style:H$(D)}},[]),M=p.useCallback((D={},A=null)=>({...D,ref:A,"data-popper-arrow-inner":""}),[]);return{update(){var D;(D=w.current)==null||D.update()},forceUpdate(){var D;(D=w.current)==null||D.forceUpdate()},transformOrigin:Nr.transformOrigin.varRef,referenceRef:j,popperRef:O,getPopperProps:T,getArrowProps:R,getArrowInnerProps:M,getReferenceProps:I}}function H$(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 Mb(e={}){const{onClose:t,onOpen:n,isOpen:r,id:o}=e,s=mr(n),a=mr(t),[c,d]=p.useState(e.defaultIsOpen||!1),f=r!==void 0?r:c,h=r!==void 0,m=p.useId(),v=o??`disclosure-${m}`,y=p.useCallback(()=>{h||d(!1),a==null||a()},[h,a]),S=p.useCallback(()=>{h||d(!0),s==null||s()},[h,s]),x=p.useCallback(()=>{f?y():S()},[f,S,y]);function w(k={}){return{...k,"aria-expanded":f,"aria-controls":v,onClick(P){var j;(j=k.onClick)==null||j.call(k,P),x()}}}function _(k={}){return{...k,hidden:!f,id:v}}return{isOpen:f,onOpen:S,onClose:y,onToggle:x,isControlled:h,getButtonProps:w,getDisclosureProps:_}}function V$(e){const{ref:t,handler:n,enabled:r=!0}=e,o=mr(n),a=p.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}).current;p.useEffect(()=>{if(!r)return;const c=m=>{_0(m,t)&&(a.isPointerDown=!0)},d=m=>{if(a.ignoreEmulatedMouseEvents){a.ignoreEmulatedMouseEvents=!1;return}a.isPointerDown&&n&&_0(m,t)&&(a.isPointerDown=!1,o(m))},f=m=>{a.ignoreEmulatedMouseEvents=!0,n&&a.isPointerDown&&_0(m,t)&&(a.isPointerDown=!1,o(m))},h=P6(t.current);return h.addEventListener("mousedown",c,!0),h.addEventListener("mouseup",d,!0),h.addEventListener("touchstart",c,!0),h.addEventListener("touchend",f,!0),()=>{h.removeEventListener("mousedown",c,!0),h.removeEventListener("mouseup",d,!0),h.removeEventListener("touchstart",c,!0),h.removeEventListener("touchend",f,!0)}},[n,t,o,a,r])}function _0(e,t){var n;const r=e.target;return r&&!P6(r).contains(r)?!1:!((n=t.current)!=null&&n.contains(r))}function P6(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function j6(e){const{isOpen:t,ref:n}=e,[r,o]=p.useState(t),[s,a]=p.useState(!1);return p.useEffect(()=>{s||(o(t),a(!0))},[t,s,r]),xl(()=>n.current,"animationend",()=>{o(t)}),{present:!(t?!1:!r),onComplete(){var d;const f=qN(n.current),h=new f.CustomEvent("animationend",{bubbles:!0});(d=n.current)==null||d.dispatchEvent(h)}}}function Db(e){const{wasSelected:t,enabled:n,isSelected:r,mode:o="unmount"}=e;return!!(!n||r||o==="keepMounted"&&t)}var[W$,U$,G$,q$]=sb(),[Y$,hf]=zn({strict:!1,name:"MenuContext"});function K$(e,...t){const n=p.useId(),r=e||n;return p.useMemo(()=>t.map(o=>`${o}-${r}`),[r,t])}function E6(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function oC(e){return E6(e).activeElement===e}function X$(e={}){const{id:t,closeOnSelect:n=!0,closeOnBlur:r=!0,initialFocusRef:o,autoSelect:s=!0,isLazy:a,isOpen:c,defaultIsOpen:d,onClose:f,onOpen:h,placement:m="bottom-start",lazyBehavior:v="unmount",direction:y,computePositionOnMount:S=!1,...x}=e,w=p.useRef(null),_=p.useRef(null),k=G$(),P=p.useCallback(()=>{requestAnimationFrame(()=>{var ae;(ae=w.current)==null||ae.focus({preventScroll:!1})})},[]),j=p.useCallback(()=>{const ae=setTimeout(()=>{var J;if(o)(J=o.current)==null||J.focus();else{const B=k.firstEnabled();B&&$(B.index)}});L.current.add(ae)},[k,o]),I=p.useCallback(()=>{const ae=setTimeout(()=>{const J=k.lastEnabled();J&&$(J.index)});L.current.add(ae)},[k]),O=p.useCallback(()=>{h==null||h(),s?j():P()},[s,j,P,h]),{isOpen:T,onOpen:R,onClose:M,onToggle:D}=Mb({isOpen:c,defaultIsOpen:d,onClose:f,onOpen:O});V$({enabled:T&&r,ref:w,handler:ae=>{var J;(J=_.current)!=null&&J.contains(ae.target)||M()}});const A=Rb({...x,enabled:T||S,placement:m,direction:y}),[G,$]=p.useState(-1);ri(()=>{T||$(-1)},[T]),g6(w,{focusRef:_,visible:T,shouldFocus:!0});const H=j6({isOpen:T,ref:w}),[U,q]=K$(t,"menu-button","menu-list"),z=p.useCallback(()=>{R(),P()},[R,P]),L=p.useRef(new Set([]));oL(()=>{L.current.forEach(ae=>clearTimeout(ae)),L.current.clear()});const V=p.useCallback(()=>{R(),j()},[j,R]),W=p.useCallback(()=>{R(),I()},[R,I]),te=p.useCallback(()=>{var ae,J;const B=E6(w.current),oe=(ae=w.current)==null?void 0:ae.contains(B.activeElement);if(!(T&&!oe))return;const ge=(J=k.item(G))==null?void 0:J.node;ge==null||ge.focus()},[T,G,k]),fe=p.useRef(null);return{openAndFocusMenu:z,openAndFocusFirstItem:V,openAndFocusLastItem:W,onTransitionEnd:te,unstable__animationState:H,descendants:k,popper:A,buttonId:U,menuId:q,forceUpdate:A.forceUpdate,orientation:"vertical",isOpen:T,onToggle:D,onOpen:R,onClose:M,menuRef:w,buttonRef:_,focusedIndex:G,closeOnSelect:n,closeOnBlur:r,autoSelect:s,setFocusedIndex:$,isLazy:a,lazyBehavior:v,initialFocusRef:o,rafId:fe}}function Z$(e={},t=null){const n=hf(),{onToggle:r,popper:o,openAndFocusFirstItem:s,openAndFocusLastItem:a}=n,c=p.useCallback(d=>{const f=d.key,m={Enter:s,ArrowDown:s,ArrowUp:a}[f];m&&(d.preventDefault(),d.stopPropagation(),m(d))},[s,a]);return{...e,ref:gn(n.buttonRef,t,o.referenceRef),id:n.buttonId,"data-active":on(n.isOpen),"aria-expanded":n.isOpen,"aria-haspopup":"menu","aria-controls":n.menuId,onClick:st(e.onClick,r),onKeyDown:st(e.onKeyDown,c)}}function W1(e){var t;return nL(e)&&!!((t=e==null?void 0:e.getAttribute("role"))!=null&&t.startsWith("menuitem"))}function Q$(e={},t=null){const n=hf();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:a,onClose:c,menuId:d,isLazy:f,lazyBehavior:h,unstable__animationState:m}=n,v=U$(),y=gz({preventDefault:_=>_.key!==" "&&W1(_.target)}),S=p.useCallback(_=>{if(!_.currentTarget.contains(_.target))return;const k=_.key,j={Tab:O=>O.preventDefault(),Escape:c,ArrowDown:()=>{const O=v.nextEnabled(r);O&&o(O.index)},ArrowUp:()=>{const O=v.prevEnabled(r);O&&o(O.index)}}[k];if(j){_.preventDefault(),j(_);return}const I=y(O=>{const T=vz(v.values(),O,R=>{var M,D;return(D=(M=R==null?void 0:R.node)==null?void 0:M.textContent)!=null?D:""},v.item(r));if(T){const R=v.indexOf(T.node);o(R)}});W1(_.target)&&I(_)},[v,r,y,c,o]),x=p.useRef(!1);a&&(x.current=!0);const w=Db({wasSelected:x.current,enabled:f,mode:h,isSelected:m.present});return{...e,ref:gn(s,t),children:w?e.children:null,tabIndex:-1,role:"menu",id:d,style:{...e.style,transformOrigin:"var(--popper-transform-origin)"},"aria-orientation":"vertical",onKeyDown:st(e.onKeyDown,S)}}function J$(e={}){const{popper:t,isOpen:n}=hf();return t.getPopperProps({...e,style:{visibility:n?"visible":"hidden",...e.style}})}function I6(e={},t=null){const{onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onClick:s,onFocus:a,isDisabled:c,isFocusable:d,closeOnSelect:f,type:h,...m}=e,v=hf(),{setFocusedIndex:y,focusedIndex:S,closeOnSelect:x,onClose:w,menuRef:_,isOpen:k,menuId:P,rafId:j}=v,I=p.useRef(null),O=`${P}-menuitem-${p.useId()}`,{index:T,register:R}=q$({disabled:c&&!d}),M=p.useCallback(z=>{n==null||n(z),!c&&y(T)},[y,T,c,n]),D=p.useCallback(z=>{r==null||r(z),I.current&&!oC(I.current)&&M(z)},[M,r]),A=p.useCallback(z=>{o==null||o(z),!c&&y(-1)},[y,c,o]),G=p.useCallback(z=>{s==null||s(z),W1(z.currentTarget)&&(f??x)&&w()},[w,s,x,f]),$=p.useCallback(z=>{a==null||a(z),y(T)},[y,a,T]),H=T===S,U=c&&!d;ri(()=>{k&&(H&&!U&&I.current?(j.current&&cancelAnimationFrame(j.current),j.current=requestAnimationFrame(()=>{var z;(z=I.current)==null||z.focus(),j.current=null})):_.current&&!oC(_.current)&&_.current.focus({preventScroll:!0}))},[H,U,_,k]);const q=m6({onClick:G,onFocus:$,onMouseEnter:M,onMouseMove:D,onMouseLeave:A,ref:gn(R,I,t),isDisabled:c,isFocusable:d});return{...m,...q,type:h??q.type,id:O,role:"menuitem",tabIndex:H?0:-1}}function eL(e={},t=null){const{type:n="radio",isChecked:r,...o}=e;return{...I6(o,t),role:`menuitem${n}`,"aria-checked":r}}function tL(e={}){const{children:t,type:n="radio",value:r,defaultValue:o,onChange:s,...a}=e,d=n==="radio"?"":[],[f,h]=bu({defaultValue:o??d,value:r,onChange:s}),m=p.useCallback(S=>{if(n==="radio"&&typeof f=="string"&&h(S),n==="checkbox"&&Array.isArray(f)){const x=f.includes(S)?f.filter(w=>w!==S):f.concat(S);h(x)}},[f,h,n]),y=cf(t).map(S=>{if(S.type.id!=="MenuItemOption")return S;const x=_=>{var k,P;m(S.props.value),(P=(k=S.props).onClick)==null||P.call(k,_)},w=n==="radio"?S.props.value===f:f.includes(S.props.value);return p.cloneElement(S,{type:n,onClick:x,isChecked:w})});return{...a,children:y}}function nL(e){var t;if(!rL(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function rL(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function oL(e,t=[]){return p.useEffect(()=>()=>e(),t)}var[sL,mf]=zn({name:"MenuStylesContext",errorMessage:`useMenuStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Menu />" `}),dg=e=>{const{children:t}=e,n=Ur("Menu",e),r=Jn(e),{direction:o}=vu(),{descendants:s,...a}=X$({...r,direction:o}),c=p.useMemo(()=>a,[a]),{isOpen:d,onClose:f,forceUpdate:h}=c;return i.jsx(W$,{value:s,children:i.jsx(Y$,{value:c,children:i.jsx(sL,{value:n,children:qy(t,{isOpen:d,onClose:f,forceUpdate:h})})})})};dg.displayName="Menu";var O6=ze((e,t)=>{const n=mf();return i.jsx(Ie.span,{ref:t,...e,__css:n.command,className:"chakra-menu__command"})});O6.displayName="MenuCommand";var T6=ze((e,t)=>{const{type:n,...r}=e,o=mf(),s=r.as||n?n??void 0:"button",a=p.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 i.jsx(Ie.button,{ref:t,type:s,...r,__css:a})}),Ab=e=>{const{className:t,children:n,...r}=e,o=p.Children.only(n),s=p.isValidElement(o)?p.cloneElement(o,{focusable:"false","aria-hidden":!0,className:jt("chakra-menu__icon",o.props.className)}):null,a=jt("chakra-menu__icon-wrapper",t);return i.jsx(Ie.span,{className:a,...r,__css:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:s})};Ab.displayName="MenuIcon";var vo=ze((e,t)=>{const{icon:n,iconSpacing:r="0.75rem",command:o,commandSpacing:s="0.75rem",children:a,...c}=e,d=I6(c,t),h=n||o?i.jsx("span",{style:{pointerEvents:"none",flex:1},children:a}):a;return i.jsxs(T6,{...d,className:jt("chakra-menu__menuitem",d.className),children:[n&&i.jsx(Ab,{fontSize:"0.8em",marginEnd:r,children:n}),h,o&&i.jsx(O6,{marginStart:s,children:o})]})});vo.displayName="MenuItem";var aL={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"}}},iL=Ie(No.div),gf=ze(function(t,n){var r,o;const{rootProps:s,motionProps:a,...c}=t,{isOpen:d,onTransitionEnd:f,unstable__animationState:h}=hf(),m=Q$(c,n),v=J$(s),y=mf();return i.jsx(Ie.div,{...v,__css:{zIndex:(o=t.zIndex)!=null?o:(r=y.list)==null?void 0:r.zIndex},children:i.jsx(iL,{variants:aL,initial:!1,animate:d?"enter":"exit",__css:{outline:0,...y.list},...a,className:jt("chakra-menu__menu-list",m.className),...m,onUpdate:f,onAnimationComplete:Qm(h.onComplete,m.onAnimationComplete)})})});gf.displayName="MenuList";var R6=ze((e,t)=>{const{title:n,children:r,className:o,...s}=e,a=jt("chakra-menu__group__title",o),c=mf();return i.jsxs("div",{ref:t,className:"chakra-menu__group",role:"group",children:[n&&i.jsx(Ie.p,{className:a,...s,__css:c.groupTitle,children:n}),r]})});R6.displayName="MenuGroup";var Nb=e=>{const{className:t,title:n,...r}=e,o=tL(r);return i.jsx(R6,{title:n,className:jt("chakra-menu__option-group",t),...o})};Nb.displayName="MenuOptionGroup";var lL=ze((e,t)=>{const n=mf();return i.jsx(Ie.button,{ref:t,...e,__css:{display:"inline-flex",appearance:"none",alignItems:"center",outline:0,...n.button}})}),fg=ze((e,t)=>{const{children:n,as:r,...o}=e,s=Z$(o,t),a=r||lL;return i.jsx(a,{...s,className:jt("chakra-menu__menu-button",e.className),children:i.jsx(Ie.span,{__css:{pointerEvents:"none",flex:"1 1 auto",minW:0},children:e.children})})});fg.displayName="MenuButton";var cL=e=>i.jsx("svg",{viewBox:"0 0 14 14",width:"1em",height:"1em",...e,children:i.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"})}),Od=ze((e,t)=>{const{icon:n,iconSpacing:r="0.75rem",...o}=e,s=eL(o,t);return i.jsxs(T6,{...s,className:jt("chakra-menu__menuitem-option",o.className),children:[n!==null&&i.jsx(Ab,{fontSize:"0.8em",marginEnd:r,opacity:e.isChecked?1:0,children:n||i.jsx(cL,{})}),i.jsx("span",{style:{flex:1},children:s.children})]})});Od.id="MenuItemOption";Od.displayName="MenuItemOption";var uL={slideInBottom:{...O1,custom:{offsetY:16,reverse:!0}},slideInRight:{...O1,custom:{offsetX:16,reverse:!0}},scale:{...r5,custom:{initialScale:.95,reverse:!0}},none:{}},dL=Ie(No.section),fL=e=>uL[e||"none"],M6=p.forwardRef((e,t)=>{const{preset:n,motionProps:r=fL(n),...o}=e;return i.jsx(dL,{ref:t,...r,...o})});M6.displayName="ModalTransition";var pL=Object.defineProperty,hL=(e,t,n)=>t in e?pL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mL=(e,t,n)=>(hL(e,typeof t!="symbol"?t+"":t,n),n),gL=class{constructor(){mL(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}},U1=new gL;function D6(e,t){const[n,r]=p.useState(0);return p.useEffect(()=>{const o=e.current;if(o){if(t){const s=U1.add(o);r(s)}return()=>{U1.remove(o),r(0)}}},[t,e]),n}var vL=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},pc=new WeakMap,dp=new WeakMap,fp={},k0=0,A6=function(e){return e&&(e.host||A6(e.parentNode))},yL=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=A6(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})},bL=function(e,t,n,r){var o=yL(t,Array.isArray(e)?e:[e]);fp[n]||(fp[n]=new WeakMap);var s=fp[n],a=[],c=new Set,d=new Set(o),f=function(m){!m||c.has(m)||(c.add(m),f(m.parentNode))};o.forEach(f);var h=function(m){!m||d.has(m)||Array.prototype.forEach.call(m.children,function(v){if(c.has(v))h(v);else{var y=v.getAttribute(r),S=y!==null&&y!=="false",x=(pc.get(v)||0)+1,w=(s.get(v)||0)+1;pc.set(v,x),s.set(v,w),a.push(v),x===1&&S&&dp.set(v,!0),w===1&&v.setAttribute(n,"true"),S||v.setAttribute(r,"true")}})};return h(t),c.clear(),k0++,function(){a.forEach(function(m){var v=pc.get(m)-1,y=s.get(m)-1;pc.set(m,v),s.set(m,y),v||(dp.has(m)||m.removeAttribute(r),dp.delete(m)),y||m.removeAttribute(n)}),k0--,k0||(pc=new WeakMap,pc=new WeakMap,dp=new WeakMap,fp={})}},xL=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||vL(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),bL(r,o,n,"aria-hidden")):function(){return null}};function wL(e){const{isOpen:t,onClose:n,id:r,closeOnOverlayClick:o=!0,closeOnEsc:s=!0,useInert:a=!0,onOverlayClick:c,onEsc:d}=e,f=p.useRef(null),h=p.useRef(null),[m,v,y]=CL(r,"chakra-modal","chakra-modal--header","chakra-modal--body");SL(f,t&&a);const S=D6(f,t),x=p.useRef(null),w=p.useCallback(M=>{x.current=M.target},[]),_=p.useCallback(M=>{M.key==="Escape"&&(M.stopPropagation(),s&&(n==null||n()),d==null||d())},[s,n,d]),[k,P]=p.useState(!1),[j,I]=p.useState(!1),O=p.useCallback((M={},D=null)=>({role:"dialog",...M,ref:gn(D,f),id:m,tabIndex:-1,"aria-modal":!0,"aria-labelledby":k?v:void 0,"aria-describedby":j?y:void 0,onClick:st(M.onClick,A=>A.stopPropagation())}),[y,j,m,v,k]),T=p.useCallback(M=>{M.stopPropagation(),x.current===M.target&&U1.isTopModal(f.current)&&(o&&(n==null||n()),c==null||c())},[n,o,c]),R=p.useCallback((M={},D=null)=>({...M,ref:gn(D,h),onClick:st(M.onClick,T),onKeyDown:st(M.onKeyDown,_),onMouseDown:st(M.onMouseDown,w)}),[_,w,T]);return{isOpen:t,onClose:n,headerId:v,bodyId:y,setBodyMounted:I,setHeaderMounted:P,dialogRef:f,overlayRef:h,getDialogProps:O,getDialogContainerProps:R,index:S}}function SL(e,t){const n=e.current;p.useEffect(()=>{if(!(!e.current||!t))return xL(e.current)},[t,e,n])}function CL(e,...t){const n=p.useId(),r=e||n;return p.useMemo(()=>t.map(o=>`${o}-${r}`),[r,t])}var[_L,Su]=zn({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Modal />" `}),[kL,Rl]=zn({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in `<Modal />`"}),Td=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:a,finalFocusRef:c,returnFocusOnClose:d,blockScrollOnMount:f,allowPinchZoom:h,preserveScrollBarGap:m,motionPreset:v,lockFocusAcrossFrames:y,onCloseComplete:S}=t,x=Ur("Modal",t),_={...wL(t),autoFocus:o,trapFocus:s,initialFocusRef:a,finalFocusRef:c,returnFocusOnClose:d,blockScrollOnMount:f,allowPinchZoom:h,preserveScrollBarGap:m,motionPreset:v,lockFocusAcrossFrames:y};return i.jsx(kL,{value:_,children:i.jsx(_L,{value:x,children:i.jsx(Xo,{onExitComplete:S,children:_.isOpen&&i.jsx(Sd,{...n,children:r})})})})};Td.displayName="Modal";var sh="right-scroll-bar-position",ah="width-before-scroll-bar",PL="with-scroll-bars-hidden",jL="--removed-body-scroll-bar-size",N6=O5(),P0=function(){},pg=p.forwardRef(function(e,t){var n=p.useRef(null),r=p.useState({onScrollCapture:P0,onWheelCapture:P0,onTouchMoveCapture:P0}),o=r[0],s=r[1],a=e.forwardProps,c=e.children,d=e.className,f=e.removeScrollBar,h=e.enabled,m=e.shards,v=e.sideCar,y=e.noIsolation,S=e.inert,x=e.allowPinchZoom,w=e.as,_=w===void 0?"div":w,k=e.gapMode,P=j5(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),j=v,I=P5([n,t]),O=ma(ma({},P),o);return p.createElement(p.Fragment,null,h&&p.createElement(j,{sideCar:N6,removeScrollBar:f,shards:m,noIsolation:y,inert:S,setCallbacks:s,allowPinchZoom:!!x,lockRef:n,gapMode:k}),a?p.cloneElement(p.Children.only(c),ma(ma({},O),{ref:I})):p.createElement(_,ma({},O,{className:d,ref:I}),c))});pg.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};pg.classNames={fullWidth:ah,zeroRight:sh};var sC,EL=function(){if(sC)return sC;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function IL(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=EL();return t&&e.setAttribute("nonce",t),e}function OL(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function TL(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var RL=function(){var e=0,t=null;return{add:function(n){e==0&&(t=IL())&&(OL(t,n),TL(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ML=function(){var e=RL();return function(t,n){p.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},z6=function(){var e=ML(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},DL={left:0,top:0,right:0,gap:0},j0=function(e){return parseInt(e||"",10)||0},AL=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[j0(n),j0(r),j0(o)]},NL=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return DL;var t=AL(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])}},zL=z6(),$L=function(e,t,n,r){var o=e.left,s=e.top,a=e.right,c=e.gap;return n===void 0&&(n="margin"),`
.`.concat(PL,` {
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(a,`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(sh,` {
right: `).concat(c,"px ").concat(r,`;
}
.`).concat(ah,` {
margin-right: `).concat(c,"px ").concat(r,`;
}
.`).concat(sh," .").concat(sh,` {
right: 0 `).concat(r,`;
}
.`).concat(ah," .").concat(ah,` {
margin-right: 0 `).concat(r,`;
}
body {
`).concat(jL,": ").concat(c,`px;
}
`)},LL=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,s=p.useMemo(function(){return NL(o)},[o]);return p.createElement(zL,{styles:$L(s,!t,o,n?"":"!important")})},G1=!1;if(typeof window<"u")try{var pp=Object.defineProperty({},"passive",{get:function(){return G1=!0,!0}});window.addEventListener("test",pp,pp),window.removeEventListener("test",pp,pp)}catch{G1=!1}var hc=G1?{passive:!1}:!1,BL=function(e){return e.tagName==="TEXTAREA"},$6=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!BL(e)&&n[t]==="visible")},FL=function(e){return $6(e,"overflowY")},HL=function(e){return $6(e,"overflowX")},aC=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=L6(e,r);if(o){var s=B6(e,r),a=s[1],c=s[2];if(a>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},VL=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},WL=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},L6=function(e,t){return e==="v"?FL(t):HL(t)},B6=function(e,t){return e==="v"?VL(t):WL(t)},UL=function(e,t){return e==="h"&&t==="rtl"?-1:1},GL=function(e,t,n,r,o){var s=UL(e,window.getComputedStyle(t).direction),a=s*r,c=n.target,d=t.contains(c),f=!1,h=a>0,m=0,v=0;do{var y=B6(e,c),S=y[0],x=y[1],w=y[2],_=x-w-s*S;(S||_)&&L6(e,c)&&(m+=_,v+=S),c=c.parentNode}while(!d&&c!==document.body||d&&(t.contains(c)||t===c));return(h&&(o&&m===0||!o&&a>m)||!h&&(o&&v===0||!o&&-a>v))&&(f=!0),f},hp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},iC=function(e){return[e.deltaX,e.deltaY]},lC=function(e){return e&&"current"in e?e.current:e},qL=function(e,t){return e[0]===t[0]&&e[1]===t[1]},YL=function(e){return`
.block-interactivity-`.concat(e,` {pointer-events: none;}
.allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},KL=0,mc=[];function XL(e){var t=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),o=p.useState(KL++)[0],s=p.useState(z6)[0],a=p.useRef(e);p.useEffect(function(){a.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var x=z1([e.lockRef.current],(e.shards||[]).map(lC),!0).filter(Boolean);return x.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),x.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var c=p.useCallback(function(x,w){if("touches"in x&&x.touches.length===2)return!a.current.allowPinchZoom;var _=hp(x),k=n.current,P="deltaX"in x?x.deltaX:k[0]-_[0],j="deltaY"in x?x.deltaY:k[1]-_[1],I,O=x.target,T=Math.abs(P)>Math.abs(j)?"h":"v";if("touches"in x&&T==="h"&&O.type==="range")return!1;var R=aC(T,O);if(!R)return!0;if(R?I=T:(I=T==="v"?"h":"v",R=aC(T,O)),!R)return!1;if(!r.current&&"changedTouches"in x&&(P||j)&&(r.current=I),!I)return!0;var M=r.current||I;return GL(M,w,x,M==="h"?P:j,!0)},[]),d=p.useCallback(function(x){var w=x;if(!(!mc.length||mc[mc.length-1]!==s)){var _="deltaY"in w?iC(w):hp(w),k=t.current.filter(function(I){return I.name===w.type&&I.target===w.target&&qL(I.delta,_)})[0];if(k&&k.should){w.cancelable&&w.preventDefault();return}if(!k){var P=(a.current.shards||[]).map(lC).filter(Boolean).filter(function(I){return I.contains(w.target)}),j=P.length>0?c(w,P[0]):!a.current.noIsolation;j&&w.cancelable&&w.preventDefault()}}},[]),f=p.useCallback(function(x,w,_,k){var P={name:x,delta:w,target:_,should:k};t.current.push(P),setTimeout(function(){t.current=t.current.filter(function(j){return j!==P})},1)},[]),h=p.useCallback(function(x){n.current=hp(x),r.current=void 0},[]),m=p.useCallback(function(x){f(x.type,iC(x),x.target,c(x,e.lockRef.current))},[]),v=p.useCallback(function(x){f(x.type,hp(x),x.target,c(x,e.lockRef.current))},[]);p.useEffect(function(){return mc.push(s),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:v}),document.addEventListener("wheel",d,hc),document.addEventListener("touchmove",d,hc),document.addEventListener("touchstart",h,hc),function(){mc=mc.filter(function(x){return x!==s}),document.removeEventListener("wheel",d,hc),document.removeEventListener("touchmove",d,hc),document.removeEventListener("touchstart",h,hc)}},[]);var y=e.removeScrollBar,S=e.inert;return p.createElement(p.Fragment,null,S?p.createElement(s,{styles:YL(o)}):null,y?p.createElement(LL,{gapMode:e.gapMode}):null)}const ZL=XA(N6,XL);var F6=p.forwardRef(function(e,t){return p.createElement(pg,ma({},e,{ref:t,sideCar:ZL}))});F6.classNames=pg.classNames;const QL=F6;function JL(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:o,blockScrollOnMount:s,allowPinchZoom:a,finalFocusRef:c,returnFocusOnClose:d,preserveScrollBarGap:f,lockFocusAcrossFrames:h,isOpen:m}=Rl(),[v,y]=H8();p.useEffect(()=>{!v&&y&&setTimeout(y)},[v,y]);const S=D6(r,m);return i.jsx(l6,{autoFocus:t,isDisabled:!n,initialFocusRef:o,finalFocusRef:c,restoreFocus:d,contentRef:r,lockFocusAcrossFrames:h,children:i.jsx(QL,{removeScrollBar:!f,allowPinchZoom:a,enabled:S===1&&s,forwardProps:!0,children:e.children})})}var Rd=ze((e,t)=>{const{className:n,children:r,containerProps:o,motionProps:s,...a}=e,{getDialogProps:c,getDialogContainerProps:d}=Rl(),f=c(a,t),h=d(o),m=jt("chakra-modal__content",n),v=Su(),y={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...v.dialog},S={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...v.dialogContainer},{motionPreset:x}=Rl();return i.jsx(JL,{children:i.jsx(Ie.div,{...h,className:"chakra-modal__content-container",tabIndex:-1,__css:S,children:i.jsx(M6,{preset:x,motionProps:s,className:m,...f,__css:y,children:r})})})});Rd.displayName="ModalContent";function hg(e){const{leastDestructiveRef:t,...n}=e;return i.jsx(Td,{...n,initialFocusRef:t})}var mg=ze((e,t)=>i.jsx(Rd,{ref:t,role:"alertdialog",...e})),zi=ze((e,t)=>{const{className:n,...r}=e,o=jt("chakra-modal__footer",n),a={display:"flex",alignItems:"center",justifyContent:"flex-end",...Su().footer};return i.jsx(Ie.footer,{ref:t,...r,__css:a,className:o})});zi.displayName="ModalFooter";var $i=ze((e,t)=>{const{className:n,...r}=e,{headerId:o,setHeaderMounted:s}=Rl();p.useEffect(()=>(s(!0),()=>s(!1)),[s]);const a=jt("chakra-modal__header",n),d={flex:0,...Su().header};return i.jsx(Ie.header,{ref:t,className:a,id:o,...r,__css:d})});$i.displayName="ModalHeader";var eB=Ie(No.div),Li=ze((e,t)=>{const{className:n,transition:r,motionProps:o,...s}=e,a=jt("chakra-modal__overlay",n),d={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...Su().overlay},{motionPreset:f}=Rl(),m=o||(f==="none"?{}:n5);return i.jsx(eB,{...m,__css:d,ref:t,className:a,...s})});Li.displayName="ModalOverlay";var Bi=ze((e,t)=>{const{className:n,...r}=e,{bodyId:o,setBodyMounted:s}=Rl();p.useEffect(()=>(s(!0),()=>s(!1)),[s]);const a=jt("chakra-modal__body",n),c=Su();return i.jsx(Ie.div,{ref:t,className:a,id:o,...r,__css:c.body})});Bi.displayName="ModalBody";var zb=ze((e,t)=>{const{onClick:n,className:r,...o}=e,{onClose:s}=Rl(),a=jt("chakra-modal__close-btn",r),c=Su();return i.jsx(V8,{ref:t,__css:c.closeButton,className:a,onClick:st(n,d=>{d.stopPropagation(),s()}),...o})});zb.displayName="ModalCloseButton";var tB=e=>i.jsx(io,{viewBox:"0 0 24 24",...e,children:i.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"})}),nB=e=>i.jsx(io,{viewBox:"0 0 24 24",...e,children:i.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 cC(e,t,n,r){p.useEffect(()=>{var o;if(!e.current||!r)return;const s=(o=e.current.ownerDocument.defaultView)!=null?o:window,a=Array.isArray(t)?t:[t],c=new s.MutationObserver(d=>{for(const f of d)f.type==="attributes"&&f.attributeName&&a.includes(f.attributeName)&&n(f)});return c.observe(e.current,{attributes:!0,attributeFilter:a}),()=>c.disconnect()})}function rB(e,t){const n=mr(e);p.useEffect(()=>{let r=null;const o=()=>n();return t!==null&&(r=window.setInterval(o,t)),()=>{r&&window.clearInterval(r)}},[t,n])}var oB=50,uC=300;function sB(e,t){const[n,r]=p.useState(!1),[o,s]=p.useState(null),[a,c]=p.useState(!0),d=p.useRef(null),f=()=>clearTimeout(d.current);rB(()=>{o==="increment"&&e(),o==="decrement"&&t()},n?oB:null);const h=p.useCallback(()=>{a&&e(),d.current=setTimeout(()=>{c(!1),r(!0),s("increment")},uC)},[e,a]),m=p.useCallback(()=>{a&&t(),d.current=setTimeout(()=>{c(!1),r(!0),s("decrement")},uC)},[t,a]),v=p.useCallback(()=>{c(!0),r(!1),f()},[]);return p.useEffect(()=>()=>f(),[]),{up:h,down:m,stop:v,isSpinning:n}}var aB=/^[Ee0-9+\-.]$/;function iB(e){return aB.test(e)}function lB(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 cB(e={}){const{focusInputOnChange:t=!0,clampValueOnBlur:n=!0,keepWithinRange:r=!0,min:o=Number.MIN_SAFE_INTEGER,max:s=Number.MAX_SAFE_INTEGER,step:a=1,isReadOnly:c,isDisabled:d,isRequired:f,isInvalid:h,pattern:m="[0-9]*(.[0-9]+)?",inputMode:v="decimal",allowMouseWheel:y,id:S,onChange:x,precision:w,name:_,"aria-describedby":k,"aria-label":P,"aria-labelledby":j,onFocus:I,onBlur:O,onInvalid:T,getAriaValueText:R,isValidCharacter:M,format:D,parse:A,...G}=e,$=mr(I),H=mr(O),U=mr(T),q=mr(M??iB),z=mr(R),L=OA(e),{update:V,increment:W,decrement:te}=L,[fe,ae]=p.useState(!1),J=!(c||d),B=p.useRef(null),oe=p.useRef(null),le=p.useRef(null),ge=p.useRef(null),se=p.useCallback(ye=>ye.split("").filter(q).join(""),[q]),pe=p.useCallback(ye=>{var lt;return(lt=A==null?void 0:A(ye))!=null?lt:ye},[A]),ue=p.useCallback(ye=>{var lt;return((lt=D==null?void 0:D(ye))!=null?lt:ye).toString()},[D]);ri(()=>{(L.valueAsNumber>s||L.valueAsNumber<o)&&(U==null||U("rangeOverflow",ue(L.value),L.valueAsNumber))},[L.valueAsNumber,L.value,ue,U]),Tc(()=>{if(!B.current)return;if(B.current.value!=L.value){const lt=pe(B.current.value);L.setValue(se(lt))}},[pe,se]);const be=p.useCallback((ye=a)=>{J&&W(ye)},[W,J,a]),ke=p.useCallback((ye=a)=>{J&&te(ye)},[te,J,a]),ie=sB(be,ke);cC(le,"disabled",ie.stop,ie.isSpinning),cC(ge,"disabled",ie.stop,ie.isSpinning);const Pe=p.useCallback(ye=>{if(ye.nativeEvent.isComposing)return;const It=pe(ye.currentTarget.value);V(se(It)),oe.current={start:ye.currentTarget.selectionStart,end:ye.currentTarget.selectionEnd}},[V,se,pe]),Je=p.useCallback(ye=>{var lt,It,Xt;$==null||$(ye),oe.current&&(ye.target.selectionStart=(It=oe.current.start)!=null?It:(lt=ye.currentTarget.value)==null?void 0:lt.length,ye.currentTarget.selectionEnd=(Xt=oe.current.end)!=null?Xt:ye.currentTarget.selectionStart)},[$]),Ae=p.useCallback(ye=>{if(ye.nativeEvent.isComposing)return;lB(ye,q)||ye.preventDefault();const lt=Ve(ye)*a,It=ye.key,$e={ArrowUp:()=>be(lt),ArrowDown:()=>ke(lt),Home:()=>V(o),End:()=>V(s)}[It];$e&&(ye.preventDefault(),$e(ye))},[q,a,be,ke,V,o,s]),Ve=ye=>{let lt=1;return(ye.metaKey||ye.ctrlKey)&&(lt=.1),ye.shiftKey&&(lt=10),lt},kt=p.useMemo(()=>{const ye=z==null?void 0:z(L.value);if(ye!=null)return ye;const lt=L.value.toString();return lt||void 0},[L.value,z]),ft=p.useCallback(()=>{let ye=L.value;if(L.value==="")return;/^[eE]/.test(L.value.toString())?L.setValue(""):(L.valueAsNumber<o&&(ye=o),L.valueAsNumber>s&&(ye=s),L.cast(ye))},[L,s,o]),yn=p.useCallback(()=>{ae(!1),n&&ft()},[n,ae,ft]),K=p.useCallback(()=>{t&&requestAnimationFrame(()=>{var ye;(ye=B.current)==null||ye.focus()})},[t]),Ce=p.useCallback(ye=>{ye.preventDefault(),ie.up(),K()},[K,ie]),ne=p.useCallback(ye=>{ye.preventDefault(),ie.down(),K()},[K,ie]);xl(()=>B.current,"wheel",ye=>{var lt,It;const $e=((It=(lt=B.current)==null?void 0:lt.ownerDocument)!=null?It:document).activeElement===B.current;if(!y||!$e)return;ye.preventDefault();const Ke=Ve(ye)*a,Cn=Math.sign(ye.deltaY);Cn===-1?be(Ke):Cn===1&&ke(Ke)},{passive:!1});const me=p.useCallback((ye={},lt=null)=>{const It=d||r&&L.isAtMax;return{...ye,ref:gn(lt,le),role:"button",tabIndex:-1,onPointerDown:st(ye.onPointerDown,Xt=>{Xt.button!==0||It||Ce(Xt)}),onPointerLeave:st(ye.onPointerLeave,ie.stop),onPointerUp:st(ye.onPointerUp,ie.stop),disabled:It,"aria-disabled":bs(It)}},[L.isAtMax,r,Ce,ie.stop,d]),Re=p.useCallback((ye={},lt=null)=>{const It=d||r&&L.isAtMin;return{...ye,ref:gn(lt,ge),role:"button",tabIndex:-1,onPointerDown:st(ye.onPointerDown,Xt=>{Xt.button!==0||It||ne(Xt)}),onPointerLeave:st(ye.onPointerLeave,ie.stop),onPointerUp:st(ye.onPointerUp,ie.stop),disabled:It,"aria-disabled":bs(It)}},[L.isAtMin,r,ne,ie.stop,d]),Ye=p.useCallback((ye={},lt=null)=>{var It,Xt,$e,Ke;return{name:_,inputMode:v,type:"text",pattern:m,"aria-labelledby":j,"aria-label":P,"aria-describedby":k,id:S,disabled:d,...ye,readOnly:(It=ye.readOnly)!=null?It:c,"aria-readonly":(Xt=ye.readOnly)!=null?Xt:c,"aria-required":($e=ye.required)!=null?$e:f,required:(Ke=ye.required)!=null?Ke:f,ref:gn(B,lt),value:ue(L.value),role:"spinbutton","aria-valuemin":o,"aria-valuemax":s,"aria-valuenow":Number.isNaN(L.valueAsNumber)?void 0:L.valueAsNumber,"aria-invalid":bs(h??L.isOutOfRange),"aria-valuetext":kt,autoComplete:"off",autoCorrect:"off",onChange:st(ye.onChange,Pe),onKeyDown:st(ye.onKeyDown,Ae),onFocus:st(ye.onFocus,Je,()=>ae(!0)),onBlur:st(ye.onBlur,H,yn)}},[_,v,m,j,P,ue,k,S,d,f,c,h,L.value,L.valueAsNumber,L.isOutOfRange,o,s,kt,Pe,Ae,Je,H,yn]);return{value:ue(L.value),valueAsNumber:L.valueAsNumber,isFocused:fe,isDisabled:d,isReadOnly:c,getIncrementButtonProps:me,getDecrementButtonProps:Re,getInputProps:Ye,htmlProps:G}}var[uB,gg]=zn({name:"NumberInputStylesContext",errorMessage:`useNumberInputStyles returned is 'undefined'. Seems you forgot to wrap the components in "<NumberInput />" `}),[dB,$b]=zn({name:"NumberInputContext",errorMessage:"useNumberInputContext: `context` is undefined. Seems you forgot to wrap number-input's components within <NumberInput />"}),vg=ze(function(t,n){const r=Ur("NumberInput",t),o=Jn(t),s=cb(o),{htmlProps:a,...c}=cB(s),d=p.useMemo(()=>c,[c]);return i.jsx(dB,{value:d,children:i.jsx(uB,{value:r,children:i.jsx(Ie.div,{...a,ref:n,className:jt("chakra-numberinput",t.className),__css:{position:"relative",zIndex:0,...r.root}})})})});vg.displayName="NumberInput";var yg=ze(function(t,n){const r=gg();return i.jsx(Ie.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}})});yg.displayName="NumberInputStepper";var bg=ze(function(t,n){const{getInputProps:r}=$b(),o=r(t,n),s=gg();return i.jsx(Ie.input,{...o,className:jt("chakra-numberinput__field",t.className),__css:{width:"100%",...s.field}})});bg.displayName="NumberInputField";var H6=Ie("div",{baseStyle:{display:"flex",justifyContent:"center",alignItems:"center",flex:1,transitionProperty:"common",transitionDuration:"normal",userSelect:"none",cursor:"pointer",lineHeight:"normal"}}),xg=ze(function(t,n){var r;const o=gg(),{getDecrementButtonProps:s}=$b(),a=s(t,n);return i.jsx(H6,{...a,__css:o.stepper,children:(r=t.children)!=null?r:i.jsx(tB,{})})});xg.displayName="NumberDecrementStepper";var wg=ze(function(t,n){var r;const{getIncrementButtonProps:o}=$b(),s=o(t,n),a=gg();return i.jsx(H6,{...s,__css:a.stepper,children:(r=t.children)!=null?r:i.jsx(nB,{})})});wg.displayName="NumberIncrementStepper";var[fB,Sg]=zn({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within `<Popover />`"}),[pB,V6]=zn({name:"PopoverStylesContext",errorMessage:`usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Popover />" `});function W6(e){const t=p.Children.only(e.children),{getTriggerProps:n}=Sg();return p.cloneElement(t,n(t.props,t.ref))}W6.displayName="PopoverTrigger";var gc={click:"click",hover:"hover"};function hB(e={}){const{closeOnBlur:t=!0,closeOnEsc:n=!0,initialFocusRef:r,id:o,returnFocusOnClose:s=!0,autoFocus:a=!0,arrowSize:c,arrowShadowColor:d,trigger:f=gc.click,openDelay:h=200,closeDelay:m=200,isLazy:v,lazyBehavior:y="unmount",computePositionOnMount:S,...x}=e,{isOpen:w,onClose:_,onOpen:k,onToggle:P}=Mb(e),j=p.useRef(null),I=p.useRef(null),O=p.useRef(null),T=p.useRef(!1),R=p.useRef(!1);w&&(R.current=!0);const[M,D]=p.useState(!1),[A,G]=p.useState(!1),$=p.useId(),H=o??$,[U,q,z,L]=["popover-trigger","popover-content","popover-header","popover-body"].map(Pe=>`${Pe}-${H}`),{referenceRef:V,getArrowProps:W,getPopperProps:te,getArrowInnerProps:fe,forceUpdate:ae}=Rb({...x,enabled:w||!!S}),J=j6({isOpen:w,ref:O});x5({enabled:w,ref:I}),g6(O,{focusRef:I,visible:w,shouldFocus:s&&f===gc.click}),wz(O,{focusRef:r,visible:w,shouldFocus:a&&f===gc.click});const B=Db({wasSelected:R.current,enabled:v,mode:y,isSelected:J.present}),oe=p.useCallback((Pe={},Je=null)=>{const Ae={...Pe,style:{...Pe.style,transformOrigin:Nr.transformOrigin.varRef,[Nr.arrowSize.var]:c?`${c}px`:void 0,[Nr.arrowShadowColor.var]:d},ref:gn(O,Je),children:B?Pe.children:null,id:q,tabIndex:-1,role:"dialog",onKeyDown:st(Pe.onKeyDown,Ve=>{n&&Ve.key==="Escape"&&_()}),onBlur:st(Pe.onBlur,Ve=>{const kt=dC(Ve),ft=E0(O.current,kt),yn=E0(I.current,kt);w&&t&&(!ft&&!yn)&&_()}),"aria-labelledby":M?z:void 0,"aria-describedby":A?L:void 0};return f===gc.hover&&(Ae.role="tooltip",Ae.onMouseEnter=st(Pe.onMouseEnter,()=>{T.current=!0}),Ae.onMouseLeave=st(Pe.onMouseLeave,Ve=>{Ve.nativeEvent.relatedTarget!==null&&(T.current=!1,setTimeout(()=>_(),m))})),Ae},[B,q,M,z,A,L,f,n,_,w,t,m,d,c]),le=p.useCallback((Pe={},Je=null)=>te({...Pe,style:{visibility:w?"visible":"hidden",...Pe.style}},Je),[w,te]),ge=p.useCallback((Pe,Je=null)=>({...Pe,ref:gn(Je,j,V)}),[j,V]),se=p.useRef(),pe=p.useRef(),ue=p.useCallback(Pe=>{j.current==null&&V(Pe)},[V]),be=p.useCallback((Pe={},Je=null)=>{const Ae={...Pe,ref:gn(I,Je,ue),id:U,"aria-haspopup":"dialog","aria-expanded":w,"aria-controls":q};return f===gc.click&&(Ae.onClick=st(Pe.onClick,P)),f===gc.hover&&(Ae.onFocus=st(Pe.onFocus,()=>{se.current===void 0&&k()}),Ae.onBlur=st(Pe.onBlur,Ve=>{const kt=dC(Ve),ft=!E0(O.current,kt);w&&t&&ft&&_()}),Ae.onKeyDown=st(Pe.onKeyDown,Ve=>{Ve.key==="Escape"&&_()}),Ae.onMouseEnter=st(Pe.onMouseEnter,()=>{T.current=!0,se.current=window.setTimeout(()=>k(),h)}),Ae.onMouseLeave=st(Pe.onMouseLeave,()=>{T.current=!1,se.current&&(clearTimeout(se.current),se.current=void 0),pe.current=window.setTimeout(()=>{T.current===!1&&_()},m)})),Ae},[U,w,q,f,ue,P,k,t,_,h,m]);p.useEffect(()=>()=>{se.current&&clearTimeout(se.current),pe.current&&clearTimeout(pe.current)},[]);const ke=p.useCallback((Pe={},Je=null)=>({...Pe,id:z,ref:gn(Je,Ae=>{D(!!Ae)})}),[z]),ie=p.useCallback((Pe={},Je=null)=>({...Pe,id:L,ref:gn(Je,Ae=>{G(!!Ae)})}),[L]);return{forceUpdate:ae,isOpen:w,onAnimationComplete:J.onComplete,onClose:_,getAnchorProps:ge,getArrowProps:W,getArrowInnerProps:fe,getPopoverPositionerProps:le,getPopoverProps:oe,getTriggerProps:be,getHeaderProps:ke,getBodyProps:ie}}function E0(e,t){return e===t||(e==null?void 0:e.contains(t))}function dC(e){var t;const n=e.currentTarget.ownerDocument.activeElement;return(t=e.relatedTarget)!=null?t:n}function U6(e){const t=Ur("Popover",e),{children:n,...r}=Jn(e),o=vu(),s=hB({...r,direction:o.direction});return i.jsx(fB,{value:s,children:i.jsx(pB,{value:t,children:qy(n,{isOpen:s.isOpen,onClose:s.onClose,forceUpdate:s.forceUpdate})})})}U6.displayName="Popover";var I0=(e,t)=>t?`${e}.${t}, ${t}`:void 0;function G6(e){var t;const{bg:n,bgColor:r,backgroundColor:o,shadow:s,boxShadow:a,shadowColor:c}=e,{getArrowProps:d,getArrowInnerProps:f}=Sg(),h=V6(),m=(t=n??r)!=null?t:o,v=s??a;return i.jsx(Ie.div,{...d(),className:"chakra-popover__arrow-positioner",children:i.jsx(Ie.div,{className:jt("chakra-popover__arrow",e.className),...f(e),__css:{"--popper-arrow-shadow-color":I0("colors",c),"--popper-arrow-bg":I0("colors",m),"--popper-arrow-shadow":I0("shadows",v),...h.arrow}})})}G6.displayName="PopoverArrow";function mB(e){if(e)return{enter:{...e.enter,visibility:"visible"},exit:{...e.exit,transitionEnd:{visibility:"hidden"}}}}var gB={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]}}},vB=Ie(No.section),q6=ze(function(t,n){const{variants:r=gB,...o}=t,{isOpen:s}=Sg();return i.jsx(vB,{ref:n,variants:mB(r),initial:!1,animate:s?"enter":"exit",...o})});q6.displayName="PopoverTransition";var Y6=ze(function(t,n){const{rootProps:r,motionProps:o,...s}=t,{getPopoverProps:a,getPopoverPositionerProps:c,onAnimationComplete:d}=Sg(),f=V6(),h={position:"relative",display:"flex",flexDirection:"column",...f.content};return i.jsx(Ie.div,{...c(r),__css:f.popper,className:"chakra-popover__popper",children:i.jsx(q6,{...o,...a(s,n),onAnimationComplete:Qm(d,s.onAnimationComplete),className:jt("chakra-popover__content",t.className),__css:h})})});Y6.displayName="PopoverContent";function yB(e,t,n){return(e-t)*100/(n-t)}oi({"0%":{strokeDasharray:"1, 400",strokeDashoffset:"0"},"50%":{strokeDasharray:"400, 400",strokeDashoffset:"-100"},"100%":{strokeDasharray:"400, 400",strokeDashoffset:"-260"}});oi({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}});var bB=oi({"0%":{left:"-40%"},"100%":{left:"100%"}}),xB=oi({from:{backgroundPosition:"1rem 0"},to:{backgroundPosition:"0 0"}});function wB(e){const{value:t=0,min:n,max:r,valueText:o,getValueText:s,isIndeterminate:a,role:c="progressbar"}=e,d=yB(t,n,r);return{bind:{"data-indeterminate":a?"":void 0,"aria-valuemax":r,"aria-valuemin":n,"aria-valuenow":a?void 0:t,"aria-valuetext":(()=>{if(t!=null)return typeof s=="function"?s(t,d):o})(),role:c},percent:d,value:t}}var[SB,CB]=zn({name:"ProgressStylesContext",errorMessage:`useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Progress />" `}),_B=ze((e,t)=>{const{min:n,max:r,value:o,isIndeterminate:s,role:a,...c}=e,d=wB({value:o,min:n,max:r,isIndeterminate:s,role:a}),h={height:"100%",...CB().filledTrack};return i.jsx(Ie.div,{ref:t,style:{width:`${d.percent}%`,...c.style},...d.bind,...c,__css:h})}),K6=ze((e,t)=>{var n;const{value:r,min:o=0,max:s=100,hasStripe:a,isAnimated:c,children:d,borderRadius:f,isIndeterminate:h,"aria-label":m,"aria-labelledby":v,"aria-valuetext":y,title:S,role:x,...w}=Jn(e),_=Ur("Progress",e),k=f??((n=_.track)==null?void 0:n.borderRadius),P={animation:`${xB} 1s linear infinite`},O={...!h&&a&&c&&P,...h&&{position:"absolute",willChange:"left",minWidth:"50%",animation:`${bB} 1s ease infinite normal none running`}},T={overflow:"hidden",position:"relative",..._.track};return i.jsx(Ie.div,{ref:t,borderRadius:k,__css:T,...w,children:i.jsxs(SB,{value:_,children:[i.jsx(_B,{"aria-label":m,"aria-labelledby":v,"aria-valuetext":y,min:o,max:s,value:r,isIndeterminate:h,css:O,borderRadius:k,title:S,role:x}),d]})})});K6.displayName="Progress";function kB(e){return e&&x1(e)&&x1(e.target)}function PB(e={}){const{onChange:t,value:n,defaultValue:r,name:o,isDisabled:s,isFocusable:a,isNative:c,...d}=e,[f,h]=p.useState(r||""),m=typeof n<"u",v=m?n:f,y=p.useRef(null),S=p.useCallback(()=>{const I=y.current;if(!I)return;let O="input:not(:disabled):checked";const T=I.querySelector(O);if(T){T.focus();return}O="input:not(:disabled)";const R=I.querySelector(O);R==null||R.focus()},[]),w=`radio-${p.useId()}`,_=o||w,k=p.useCallback(I=>{const O=kB(I)?I.target.value:I;m||h(O),t==null||t(String(O))},[t,m]),P=p.useCallback((I={},O=null)=>({...I,ref:gn(O,y),role:"radiogroup"}),[]),j=p.useCallback((I={},O=null)=>({...I,ref:O,name:_,[c?"checked":"isChecked"]:v!=null?I.value===v:void 0,onChange(R){k(R)},"data-radiogroup":!0}),[c,_,k,v]);return{getRootProps:P,getRadioProps:j,name:_,ref:y,focus:S,setValue:h,value:v,onChange:k,isDisabled:s,isFocusable:a,htmlProps:d}}var[jB,X6]=zn({name:"RadioGroupContext",strict:!1}),Md=ze((e,t)=>{const{colorScheme:n,size:r,variant:o,children:s,className:a,isDisabled:c,isFocusable:d,...f}=e,{value:h,onChange:m,getRootProps:v,name:y,htmlProps:S}=PB(f),x=p.useMemo(()=>({name:y,size:r,onChange:m,colorScheme:n,value:h,variant:o,isDisabled:c,isFocusable:d}),[y,r,m,n,h,o,c,d]);return i.jsx(jB,{value:x,children:i.jsx(Ie.div,{...v(S,t),className:jt("chakra-radio-group",a),children:s})})});Md.displayName="RadioGroup";var EB={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};function IB(e={}){const{defaultChecked:t,isChecked:n,isFocusable:r,isDisabled:o,isReadOnly:s,isRequired:a,onChange:c,isInvalid:d,name:f,value:h,id:m,"data-radiogroup":v,"aria-describedby":y,...S}=e,x=`radio-${p.useId()}`,w=Gl(),k=!!X6()||!!v;let j=!!w&&!k?w.id:x;j=m??j;const I=o??(w==null?void 0:w.isDisabled),O=s??(w==null?void 0:w.isReadOnly),T=a??(w==null?void 0:w.isRequired),R=d??(w==null?void 0:w.isInvalid),[M,D]=p.useState(!1),[A,G]=p.useState(!1),[$,H]=p.useState(!1),[U,q]=p.useState(!1),[z,L]=p.useState(!!t),V=typeof n<"u",W=V?n:z;p.useEffect(()=>c5(D),[]);const te=p.useCallback(ue=>{if(O||I){ue.preventDefault();return}V||L(ue.target.checked),c==null||c(ue)},[V,I,O,c]),fe=p.useCallback(ue=>{ue.key===" "&&q(!0)},[q]),ae=p.useCallback(ue=>{ue.key===" "&&q(!1)},[q]),J=p.useCallback((ue={},be=null)=>({...ue,ref:be,"data-active":on(U),"data-hover":on($),"data-disabled":on(I),"data-invalid":on(R),"data-checked":on(W),"data-focus":on(A),"data-focus-visible":on(A&&M),"data-readonly":on(O),"aria-hidden":!0,onMouseDown:st(ue.onMouseDown,()=>q(!0)),onMouseUp:st(ue.onMouseUp,()=>q(!1)),onMouseEnter:st(ue.onMouseEnter,()=>H(!0)),onMouseLeave:st(ue.onMouseLeave,()=>H(!1))}),[U,$,I,R,W,A,O,M]),{onFocus:B,onBlur:oe}=w??{},le=p.useCallback((ue={},be=null)=>{const ke=I&&!r;return{...ue,id:j,ref:be,type:"radio",name:f,value:h,onChange:st(ue.onChange,te),onBlur:st(oe,ue.onBlur,()=>G(!1)),onFocus:st(B,ue.onFocus,()=>G(!0)),onKeyDown:st(ue.onKeyDown,fe),onKeyUp:st(ue.onKeyUp,ae),checked:W,disabled:ke,readOnly:O,required:T,"aria-invalid":bs(R),"aria-disabled":bs(ke),"aria-required":bs(T),"data-readonly":on(O),"aria-describedby":y,style:EB}},[I,r,j,f,h,te,oe,B,fe,ae,W,O,T,R,y]);return{state:{isInvalid:R,isFocused:A,isChecked:W,isActive:U,isHovered:$,isDisabled:I,isReadOnly:O,isRequired:T},getCheckboxProps:J,getRadioProps:J,getInputProps:le,getLabelProps:(ue={},be=null)=>({...ue,ref:be,onMouseDown:st(ue.onMouseDown,OB),"data-disabled":on(I),"data-checked":on(W),"data-invalid":on(R)}),getRootProps:(ue,be=null)=>({...ue,ref:be,"data-disabled":on(I),"data-checked":on(W),"data-invalid":on(R)}),htmlProps:S}}function OB(e){e.preventDefault(),e.stopPropagation()}function TB(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 yo=ze((e,t)=>{var n;const r=X6(),{onChange:o,value:s}=e,a=Ur("Radio",{...r,...e}),c=Jn(e),{spacing:d="0.5rem",children:f,isDisabled:h=r==null?void 0:r.isDisabled,isFocusable:m=r==null?void 0:r.isFocusable,inputProps:v,...y}=c;let S=e.isChecked;(r==null?void 0:r.value)!=null&&s!=null&&(S=r.value===s);let x=o;r!=null&&r.onChange&&s!=null&&(x=Qm(r.onChange,o));const w=(n=e==null?void 0:e.name)!=null?n:r==null?void 0:r.name,{getInputProps:_,getCheckboxProps:k,getLabelProps:P,getRootProps:j,htmlProps:I}=IB({...y,isChecked:S,isFocusable:m,isDisabled:h,onChange:x,name:w}),[O,T]=TB(I,QP),R=k(T),M=_(v,t),D=P(),A=Object.assign({},O,j()),G={display:"inline-flex",alignItems:"center",verticalAlign:"top",cursor:"pointer",position:"relative",...a.container},$={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,...a.control},H={userSelect:"none",marginStart:d,...a.label};return i.jsxs(Ie.label,{className:"chakra-radio",...A,__css:G,children:[i.jsx("input",{className:"chakra-radio__input",...M}),i.jsx(Ie.span,{className:"chakra-radio__control",...R,__css:$}),f&&i.jsx(Ie.span,{className:"chakra-radio__label",...D,__css:H,children:f})]})});yo.displayName="Radio";var Z6=ze(function(t,n){const{children:r,placeholder:o,className:s,...a}=t;return i.jsxs(Ie.select,{...a,ref:n,className:jt("chakra-select",s),children:[o&&i.jsx("option",{value:"",children:o}),r]})});Z6.displayName="SelectField";function RB(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 Lb=ze((e,t)=>{var n;const r=Ur("Select",e),{rootProps:o,placeholder:s,icon:a,color:c,height:d,h:f,minH:h,minHeight:m,iconColor:v,iconSize:y,...S}=Jn(e),[x,w]=RB(S,QP),_=lb(w),k={width:"100%",height:"fit-content",position:"relative",color:c},P={paddingEnd:"2rem",...r.field,_focus:{zIndex:"unset",...(n=r.field)==null?void 0:n._focus}};return i.jsxs(Ie.div,{className:"chakra-select__wrapper",__css:k,...x,...o,children:[i.jsx(Z6,{ref:t,height:f??d,minH:h??m,placeholder:s,..._,__css:P,children:e.children}),i.jsx(Q6,{"data-disabled":on(_.disabled),...(v||c)&&{color:v||c},__css:r.icon,...y&&{fontSize:y},children:a})]})});Lb.displayName="Select";var MB=e=>i.jsx("svg",{viewBox:"0 0 24 24",...e,children:i.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})}),DB=Ie("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),Q6=e=>{const{children:t=i.jsx(MB,{}),...n}=e,r=p.cloneElement(t,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return i.jsx(DB,{...n,className:"chakra-select__icon-wrapper",children:p.isValidElement(t)?r:null})};Q6.displayName="SelectIcon";function AB(){const e=p.useRef(!0);return p.useEffect(()=>{e.current=!1},[]),e.current}function NB(e){const t=p.useRef();return p.useEffect(()=>{t.current=e},[e]),t.current}var zB=Ie("div",{baseStyle:{boxShadow:"none",backgroundClip:"padding-box",cursor:"default",color:"transparent",pointerEvents:"none",userSelect:"none","&::before, &::after, *":{visibility:"hidden"}}}),q1=JP("skeleton-start-color"),Y1=JP("skeleton-end-color"),$B=oi({from:{opacity:0},to:{opacity:1}}),LB=oi({from:{borderColor:q1.reference,background:q1.reference},to:{borderColor:Y1.reference,background:Y1.reference}}),Bb=ze((e,t)=>{const n={...e,fadeDuration:typeof e.fadeDuration=="number"?e.fadeDuration:.4,speed:typeof e.speed=="number"?e.speed:.8},r=ni("Skeleton",n),o=AB(),{startColor:s="",endColor:a="",isLoaded:c,fadeDuration:d,speed:f,className:h,fitContent:m,...v}=Jn(n),[y,S]=Wl("colors",[s,a]),x=NB(c),w=jt("chakra-skeleton",h),_={...y&&{[q1.variable]:y},...S&&{[Y1.variable]:S}};if(c){const k=o||x?"none":`${$B} ${d}s`;return i.jsx(Ie.div,{ref:t,className:w,__css:{animation:k},...v})}return i.jsx(zB,{ref:t,className:w,...v,__css:{width:m?"fit-content":void 0,...r,..._,_dark:{...r._dark,..._},animation:`${f}s linear infinite alternate ${LB}`}})});Bb.displayName="Skeleton";var ps=e=>e?"":void 0,Lc=e=>e?!0:void 0,qi=(...e)=>e.filter(Boolean).join(" ");function Bc(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function BB(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 cd(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}var ih={width:0,height:0},mp=e=>e||ih;function J6(e){const{orientation:t,thumbPercents:n,thumbRects:r,isReversed:o}=e,s=x=>{var w;const _=(w=r[x])!=null?w:ih;return{position:"absolute",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",touchAction:"none",...cd({orientation:t,vertical:{bottom:`calc(${n[x]}% - ${_.height/2}px)`},horizontal:{left:`calc(${n[x]}% - ${_.width/2}px)`}})}},a=t==="vertical"?r.reduce((x,w)=>mp(x).height>mp(w).height?x:w,ih):r.reduce((x,w)=>mp(x).width>mp(w).width?x:w,ih),c={position:"relative",touchAction:"none",WebkitTapHighlightColor:"rgba(0,0,0,0)",userSelect:"none",outline:0,...cd({orientation:t,vertical:a?{paddingLeft:a.width/2,paddingRight:a.width/2}:{},horizontal:a?{paddingTop:a.height/2,paddingBottom:a.height/2}:{}})},d={position:"absolute",...cd({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",height:"100%"},horizontal:{top:"50%",transform:"translateY(-50%)",width:"100%"}})},f=n.length===1,h=[0,o?100-n[0]:n[0]],m=f?h:n;let v=m[0];!f&&o&&(v=100-v);const y=Math.abs(m[m.length-1]-m[0]),S={...d,...cd({orientation:t,vertical:o?{height:`${y}%`,top:`${v}%`}:{height:`${y}%`,bottom:`${v}%`},horizontal:o?{width:`${y}%`,right:`${v}%`}:{width:`${y}%`,left:`${v}%`}})};return{trackStyle:d,innerTrackStyle:S,rootStyle:c,getThumbStyle:s}}function ej(e){const{isReversed:t,direction:n,orientation:r}=e;return n==="ltr"||r==="vertical"?t:!t}function FB(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function HB(e){const t=WB(e);return typeof t.PointerEvent<"u"&&e instanceof t.PointerEvent?e.pointerType==="mouse":e instanceof t.MouseEvent}function tj(e){return!!e.touches}function VB(e){return tj(e)&&e.touches.length>1}function WB(e){var t;return(t=e.view)!=null?t:window}function UB(e,t="page"){const n=e.touches[0]||e.changedTouches[0];return{x:n[`${t}X`],y:n[`${t}Y`]}}function GB(e,t="page"){return{x:e[`${t}X`],y:e[`${t}Y`]}}function nj(e,t="page"){return tj(e)?UB(e,t):GB(e,t)}function qB(e){return t=>{const n=HB(t);(!n||n&&t.button===0)&&e(t)}}function YB(e,t=!1){function n(o){e(o,{point:nj(o)})}return t?qB(n):n}function lh(e,t,n,r){return FB(e,t,YB(n,t==="pointerdown"),r)}var KB=Object.defineProperty,XB=(e,t,n)=>t in e?KB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,As=(e,t,n)=>(XB(e,typeof t!="symbol"?t+"":t,n),n),ZB=class{constructor(e,t,n){As(this,"history",[]),As(this,"startEvent",null),As(this,"lastEvent",null),As(this,"lastEventInfo",null),As(this,"handlers",{}),As(this,"removeListeners",()=>{}),As(this,"threshold",3),As(this,"win"),As(this,"updatePoint",()=>{if(!(this.lastEvent&&this.lastEventInfo))return;const c=O0(this.lastEventInfo,this.history),d=this.startEvent!==null,f=tF(c.offset,{x:0,y:0})>=this.threshold;if(!d&&!f)return;const{timestamp:h}=PS();this.history.push({...c.point,timestamp:h});const{onStart:m,onMove:v}=this.handlers;d||(m==null||m(this.lastEvent,c),this.startEvent=this.lastEvent),v==null||v(this.lastEvent,c)}),As(this,"onPointerMove",(c,d)=>{this.lastEvent=c,this.lastEventInfo=d,yD.update(this.updatePoint,!0)}),As(this,"onPointerUp",(c,d)=>{const f=O0(d,this.history),{onEnd:h,onSessionEnd:m}=this.handlers;m==null||m(c,f),this.end(),!(!h||!this.startEvent)&&(h==null||h(c,f))});var r;if(this.win=(r=e.view)!=null?r:window,VB(e))return;this.handlers=t,n&&(this.threshold=n),e.stopPropagation(),e.preventDefault();const o={point:nj(e)},{timestamp:s}=PS();this.history=[{...o.point,timestamp:s}];const{onSessionStart:a}=t;a==null||a(e,O0(o,this.history)),this.removeListeners=eF(lh(this.win,"pointermove",this.onPointerMove),lh(this.win,"pointerup",this.onPointerUp),lh(this.win,"pointercancel",this.onPointerUp))}updateHandlers(e){this.handlers=e}end(){var e;(e=this.removeListeners)==null||e.call(this),bD.update(this.updatePoint)}};function fC(e,t){return{x:e.x-t.x,y:e.y-t.y}}function O0(e,t){return{point:e.point,delta:fC(e.point,t[t.length-1]),offset:fC(e.point,t[0]),velocity:JB(t,.1)}}var QB=e=>e*1e3;function JB(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>QB(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 a={x:(o.x-r.x)/s,y:(o.y-r.y)/s};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function eF(...e){return t=>e.reduce((n,r)=>r(n),t)}function T0(e,t){return Math.abs(e-t)}function pC(e){return"x"in e&&"y"in e}function tF(e,t){if(typeof e=="number"&&typeof t=="number")return T0(e,t);if(pC(e)&&pC(t)){const n=T0(e.x,t.x),r=T0(e.y,t.y);return Math.sqrt(n**2+r**2)}return 0}function rj(e){const t=p.useRef(null);return t.current=e,t}function oj(e,t){const{onPan:n,onPanStart:r,onPanEnd:o,onPanSessionStart:s,onPanSessionEnd:a,threshold:c}=t,d=!!(n||r||o||s||a),f=p.useRef(null),h=rj({onSessionStart:s,onSessionEnd:a,onStart:r,onMove:n,onEnd(m,v){f.current=null,o==null||o(m,v)}});p.useEffect(()=>{var m;(m=f.current)==null||m.updateHandlers(h.current)}),p.useEffect(()=>{const m=e.current;if(!m||!d)return;function v(y){f.current=new ZB(y,h.current,c)}return lh(m,"pointerdown",v)},[e,d,h,c]),p.useEffect(()=>()=>{var m;(m=f.current)==null||m.end(),f.current=null},[])}function nF(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 a,c;if("borderBoxSize"in s){const d=s.borderBoxSize,f=Array.isArray(d)?d[0]:d;a=f.inlineSize,c=f.blockSize}else a=e.offsetWidth,c=e.offsetHeight;t({width:a,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}var rF=globalThis!=null&&globalThis.document?p.useLayoutEffect:p.useEffect;function oF(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 sj({getNodes:e,observeMutation:t=!0}){const[n,r]=p.useState([]),[o,s]=p.useState(0);return rF(()=>{const a=e(),c=a.map((d,f)=>nF(d,h=>{r(m=>[...m.slice(0,f),h,...m.slice(f+1)])}));if(t){const d=a[0];c.push(oF(d,()=>{s(f=>f+1)}))}return()=>{c.forEach(d=>{d==null||d()})}},[o]),n}function sF(e){return typeof e=="object"&&e!==null&&"current"in e}function aF(e){const[t]=sj({observeMutation:!1,getNodes(){return[sF(e)?e.current:e]}});return t}function iF(e){const{min:t=0,max:n=100,onChange:r,value:o,defaultValue:s,isReversed:a,direction:c="ltr",orientation:d="horizontal",id:f,isDisabled:h,isReadOnly:m,onChangeStart:v,onChangeEnd:y,step:S=1,getAriaValueText:x,"aria-valuetext":w,"aria-label":_,"aria-labelledby":k,name:P,focusThumbOnChange:j=!0,minStepsBetweenThumbs:I=0,...O}=e,T=mr(v),R=mr(y),M=mr(x),D=ej({isReversed:a,direction:c,orientation:d}),[A,G]=bu({value:o,defaultValue:s??[25,75],onChange:r});if(!Array.isArray(A))throw new TypeError(`[range-slider] You passed an invalid value for \`value\` or \`defaultValue\`, expected \`Array\` but got \`${typeof A}\``);const[$,H]=p.useState(!1),[U,q]=p.useState(!1),[z,L]=p.useState(-1),V=!(h||m),W=p.useRef(A),te=A.map(Ee=>Ac(Ee,t,n)),fe=I*S,ae=lF(te,t,n,fe),J=p.useRef({eventSource:null,value:[],valueBounds:[]});J.current.value=te,J.current.valueBounds=ae;const B=te.map(Ee=>n-Ee+t),le=(D?B:te).map(Ee=>Rh(Ee,t,n)),ge=d==="vertical",se=p.useRef(null),pe=p.useRef(null),ue=sj({getNodes(){const Ee=pe.current,qe=Ee==null?void 0:Ee.querySelectorAll("[role=slider]");return qe?Array.from(qe):[]}}),be=p.useId(),ie=BB(f??be),Pe=p.useCallback(Ee=>{var qe,pt;if(!se.current)return;J.current.eventSource="pointer";const gt=se.current.getBoundingClientRect(),{clientX:Ht,clientY:yr}=(pt=(qe=Ee.touches)==null?void 0:qe[0])!=null?pt:Ee,hn=ge?gt.bottom-yr:Ht-gt.left,mn=ge?gt.height:gt.width;let Tr=hn/mn;return D&&(Tr=1-Tr),f5(Tr,t,n)},[ge,D,n,t]),Je=(n-t)/10,Ae=S||(n-t)/100,Ve=p.useMemo(()=>({setValueAtIndex(Ee,qe){if(!V)return;const pt=J.current.valueBounds[Ee];qe=parseFloat(A1(qe,pt.min,Ae)),qe=Ac(qe,pt.min,pt.max);const gt=[...J.current.value];gt[Ee]=qe,G(gt)},setActiveIndex:L,stepUp(Ee,qe=Ae){const pt=J.current.value[Ee],gt=D?pt-qe:pt+qe;Ve.setValueAtIndex(Ee,gt)},stepDown(Ee,qe=Ae){const pt=J.current.value[Ee],gt=D?pt+qe:pt-qe;Ve.setValueAtIndex(Ee,gt)},reset(){G(W.current)}}),[Ae,D,G,V]),kt=p.useCallback(Ee=>{const qe=Ee.key,gt={ArrowRight:()=>Ve.stepUp(z),ArrowUp:()=>Ve.stepUp(z),ArrowLeft:()=>Ve.stepDown(z),ArrowDown:()=>Ve.stepDown(z),PageUp:()=>Ve.stepUp(z,Je),PageDown:()=>Ve.stepDown(z,Je),Home:()=>{const{min:Ht}=ae[z];Ve.setValueAtIndex(z,Ht)},End:()=>{const{max:Ht}=ae[z];Ve.setValueAtIndex(z,Ht)}}[qe];gt&&(Ee.preventDefault(),Ee.stopPropagation(),gt(Ee),J.current.eventSource="keyboard")},[Ve,z,Je,ae]),{getThumbStyle:ft,rootStyle:yn,trackStyle:K,innerTrackStyle:Ce}=p.useMemo(()=>J6({isReversed:D,orientation:d,thumbRects:ue,thumbPercents:le}),[D,d,le,ue]),ne=p.useCallback(Ee=>{var qe;const pt=Ee??z;if(pt!==-1&&j){const gt=ie.getThumb(pt),Ht=(qe=pe.current)==null?void 0:qe.ownerDocument.getElementById(gt);Ht&&setTimeout(()=>Ht.focus())}},[j,z,ie]);ri(()=>{J.current.eventSource==="keyboard"&&(R==null||R(J.current.value))},[te,R]);const me=Ee=>{const qe=Pe(Ee)||0,pt=J.current.value.map(mn=>Math.abs(mn-qe)),gt=Math.min(...pt);let Ht=pt.indexOf(gt);const yr=pt.filter(mn=>mn===gt);yr.length>1&&qe>J.current.value[Ht]&&(Ht=Ht+yr.length-1),L(Ht),Ve.setValueAtIndex(Ht,qe),ne(Ht)},Re=Ee=>{if(z==-1)return;const qe=Pe(Ee)||0;L(z),Ve.setValueAtIndex(z,qe),ne(z)};oj(pe,{onPanSessionStart(Ee){V&&(H(!0),me(Ee),T==null||T(J.current.value))},onPanSessionEnd(){V&&(H(!1),R==null||R(J.current.value))},onPan(Ee){V&&Re(Ee)}});const Ye=p.useCallback((Ee={},qe=null)=>({...Ee,...O,id:ie.root,ref:gn(qe,pe),tabIndex:-1,"aria-disabled":Lc(h),"data-focused":ps(U),style:{...Ee.style,...yn}}),[O,h,U,yn,ie]),ye=p.useCallback((Ee={},qe=null)=>({...Ee,ref:gn(qe,se),id:ie.track,"data-disabled":ps(h),style:{...Ee.style,...K}}),[h,K,ie]),lt=p.useCallback((Ee={},qe=null)=>({...Ee,ref:qe,id:ie.innerTrack,style:{...Ee.style,...Ce}}),[Ce,ie]),It=p.useCallback((Ee,qe=null)=>{var pt;const{index:gt,...Ht}=Ee,yr=te[gt];if(yr==null)throw new TypeError(`[range-slider > thumb] Cannot find value at index \`${gt}\`. The \`value\` or \`defaultValue\` length is : ${te.length}`);const hn=ae[gt];return{...Ht,ref:qe,role:"slider",tabIndex:V?0:void 0,id:ie.getThumb(gt),"data-active":ps($&&z===gt),"aria-valuetext":(pt=M==null?void 0:M(yr))!=null?pt:w==null?void 0:w[gt],"aria-valuemin":hn.min,"aria-valuemax":hn.max,"aria-valuenow":yr,"aria-orientation":d,"aria-disabled":Lc(h),"aria-readonly":Lc(m),"aria-label":_==null?void 0:_[gt],"aria-labelledby":_!=null&&_[gt]||k==null?void 0:k[gt],style:{...Ee.style,...ft(gt)},onKeyDown:Bc(Ee.onKeyDown,kt),onFocus:Bc(Ee.onFocus,()=>{q(!0),L(gt)}),onBlur:Bc(Ee.onBlur,()=>{q(!1),L(-1)})}},[ie,te,ae,V,$,z,M,w,d,h,m,_,k,ft,kt,q]),Xt=p.useCallback((Ee={},qe=null)=>({...Ee,ref:qe,id:ie.output,htmlFor:te.map((pt,gt)=>ie.getThumb(gt)).join(" "),"aria-live":"off"}),[ie,te]),$e=p.useCallback((Ee,qe=null)=>{const{value:pt,...gt}=Ee,Ht=!(pt<t||pt>n),yr=pt>=te[0]&&pt<=te[te.length-1];let hn=Rh(pt,t,n);hn=D?100-hn:hn;const mn={position:"absolute",pointerEvents:"none",...cd({orientation:d,vertical:{bottom:`${hn}%`},horizontal:{left:`${hn}%`}})};return{...gt,ref:qe,id:ie.getMarker(Ee.value),role:"presentation","aria-hidden":!0,"data-disabled":ps(h),"data-invalid":ps(!Ht),"data-highlighted":ps(yr),style:{...Ee.style,...mn}}},[h,D,n,t,d,te,ie]),Ke=p.useCallback((Ee,qe=null)=>{const{index:pt,...gt}=Ee;return{...gt,ref:qe,id:ie.getInput(pt),type:"hidden",value:te[pt],name:Array.isArray(P)?P[pt]:`${P}-${pt}`}},[P,te,ie]);return{state:{value:te,isFocused:U,isDragging:$,getThumbPercent:Ee=>le[Ee],getThumbMinValue:Ee=>ae[Ee].min,getThumbMaxValue:Ee=>ae[Ee].max},actions:Ve,getRootProps:Ye,getTrackProps:ye,getInnerTrackProps:lt,getThumbProps:It,getMarkerProps:$e,getInputProps:Ke,getOutputProps:Xt}}function lF(e,t,n,r){return e.map((o,s)=>{const a=s===0?t:e[s-1]+r,c=s===e.length-1?n:e[s+1]-r;return{min:a,max:c}})}var[cF,Cg]=zn({name:"SliderContext",errorMessage:"useSliderContext: `context` is undefined. Seems you forgot to wrap all slider components within <RangeSlider />"}),[uF,_g]=zn({name:"RangeSliderStylesContext",errorMessage:`useRangeSliderStyles returned is 'undefined'. Seems you forgot to wrap the components in "<RangeSlider />" `}),aj=ze(function(t,n){const r={orientation:"horizontal",...t},o=Ur("Slider",r),s=Jn(r),{direction:a}=vu();s.direction=a;const{getRootProps:c,...d}=iF(s),f=p.useMemo(()=>({...d,name:r.name}),[d,r.name]);return i.jsx(cF,{value:f,children:i.jsx(uF,{value:o,children:i.jsx(Ie.div,{...c({},n),className:"chakra-slider",__css:o.container,children:r.children})})})});aj.displayName="RangeSlider";var K1=ze(function(t,n){const{getThumbProps:r,getInputProps:o,name:s}=Cg(),a=_g(),c=r(t,n);return i.jsxs(Ie.div,{...c,className:qi("chakra-slider__thumb",t.className),__css:a.thumb,children:[c.children,s&&i.jsx("input",{...o({index:t.index})})]})});K1.displayName="RangeSliderThumb";var ij=ze(function(t,n){const{getTrackProps:r}=Cg(),o=_g(),s=r(t,n);return i.jsx(Ie.div,{...s,className:qi("chakra-slider__track",t.className),__css:o.track,"data-testid":"chakra-range-slider-track"})});ij.displayName="RangeSliderTrack";var lj=ze(function(t,n){const{getInnerTrackProps:r}=Cg(),o=_g(),s=r(t,n);return i.jsx(Ie.div,{...s,className:"chakra-slider__filled-track",__css:o.filledTrack})});lj.displayName="RangeSliderFilledTrack";var ch=ze(function(t,n){const{getMarkerProps:r}=Cg(),o=_g(),s=r(t,n);return i.jsx(Ie.div,{...s,className:qi("chakra-slider__marker",t.className),__css:o.mark})});ch.displayName="RangeSliderMark";function dF(e){var t;const{min:n=0,max:r=100,onChange:o,value:s,defaultValue:a,isReversed:c,direction:d="ltr",orientation:f="horizontal",id:h,isDisabled:m,isReadOnly:v,onChangeStart:y,onChangeEnd:S,step:x=1,getAriaValueText:w,"aria-valuetext":_,"aria-label":k,"aria-labelledby":P,name:j,focusThumbOnChange:I=!0,...O}=e,T=mr(y),R=mr(S),M=mr(w),D=ej({isReversed:c,direction:d,orientation:f}),[A,G]=bu({value:s,defaultValue:a??pF(n,r),onChange:o}),[$,H]=p.useState(!1),[U,q]=p.useState(!1),z=!(m||v),L=(r-n)/10,V=x||(r-n)/100,W=Ac(A,n,r),te=r-W+n,ae=Rh(D?te:W,n,r),J=f==="vertical",B=rj({min:n,max:r,step:x,isDisabled:m,value:W,isInteractive:z,isReversed:D,isVertical:J,eventSource:null,focusThumbOnChange:I,orientation:f}),oe=p.useRef(null),le=p.useRef(null),ge=p.useRef(null),se=p.useId(),pe=h??se,[ue,be]=[`slider-thumb-${pe}`,`slider-track-${pe}`],ke=p.useCallback($e=>{var Ke,Cn;if(!oe.current)return;const Ee=B.current;Ee.eventSource="pointer";const qe=oe.current.getBoundingClientRect(),{clientX:pt,clientY:gt}=(Cn=(Ke=$e.touches)==null?void 0:Ke[0])!=null?Cn:$e,Ht=J?qe.bottom-gt:pt-qe.left,yr=J?qe.height:qe.width;let hn=Ht/yr;D&&(hn=1-hn);let mn=f5(hn,Ee.min,Ee.max);return Ee.step&&(mn=parseFloat(A1(mn,Ee.min,Ee.step))),mn=Ac(mn,Ee.min,Ee.max),mn},[J,D,B]),ie=p.useCallback($e=>{const Ke=B.current;Ke.isInteractive&&($e=parseFloat(A1($e,Ke.min,V)),$e=Ac($e,Ke.min,Ke.max),G($e))},[V,G,B]),Pe=p.useMemo(()=>({stepUp($e=V){const Ke=D?W-$e:W+$e;ie(Ke)},stepDown($e=V){const Ke=D?W+$e:W-$e;ie(Ke)},reset(){ie(a||0)},stepTo($e){ie($e)}}),[ie,D,W,V,a]),Je=p.useCallback($e=>{const Ke=B.current,Ee={ArrowRight:()=>Pe.stepUp(),ArrowUp:()=>Pe.stepUp(),ArrowLeft:()=>Pe.stepDown(),ArrowDown:()=>Pe.stepDown(),PageUp:()=>Pe.stepUp(L),PageDown:()=>Pe.stepDown(L),Home:()=>ie(Ke.min),End:()=>ie(Ke.max)}[$e.key];Ee&&($e.preventDefault(),$e.stopPropagation(),Ee($e),Ke.eventSource="keyboard")},[Pe,ie,L,B]),Ae=(t=M==null?void 0:M(W))!=null?t:_,Ve=aF(le),{getThumbStyle:kt,rootStyle:ft,trackStyle:yn,innerTrackStyle:K}=p.useMemo(()=>{const $e=B.current,Ke=Ve??{width:0,height:0};return J6({isReversed:D,orientation:$e.orientation,thumbRects:[Ke],thumbPercents:[ae]})},[D,Ve,ae,B]),Ce=p.useCallback(()=>{B.current.focusThumbOnChange&&setTimeout(()=>{var Ke;return(Ke=le.current)==null?void 0:Ke.focus()})},[B]);ri(()=>{const $e=B.current;Ce(),$e.eventSource==="keyboard"&&(R==null||R($e.value))},[W,R]);function ne($e){const Ke=ke($e);Ke!=null&&Ke!==B.current.value&&G(Ke)}oj(ge,{onPanSessionStart($e){const Ke=B.current;Ke.isInteractive&&(H(!0),Ce(),ne($e),T==null||T(Ke.value))},onPanSessionEnd(){const $e=B.current;$e.isInteractive&&(H(!1),R==null||R($e.value))},onPan($e){B.current.isInteractive&&ne($e)}});const me=p.useCallback(($e={},Ke=null)=>({...$e,...O,ref:gn(Ke,ge),tabIndex:-1,"aria-disabled":Lc(m),"data-focused":ps(U),style:{...$e.style,...ft}}),[O,m,U,ft]),Re=p.useCallback(($e={},Ke=null)=>({...$e,ref:gn(Ke,oe),id:be,"data-disabled":ps(m),style:{...$e.style,...yn}}),[m,be,yn]),Ye=p.useCallback(($e={},Ke=null)=>({...$e,ref:Ke,style:{...$e.style,...K}}),[K]),ye=p.useCallback(($e={},Ke=null)=>({...$e,ref:gn(Ke,le),role:"slider",tabIndex:z?0:void 0,id:ue,"data-active":ps($),"aria-valuetext":Ae,"aria-valuemin":n,"aria-valuemax":r,"aria-valuenow":W,"aria-orientation":f,"aria-disabled":Lc(m),"aria-readonly":Lc(v),"aria-label":k,"aria-labelledby":k?void 0:P,style:{...$e.style,...kt(0)},onKeyDown:Bc($e.onKeyDown,Je),onFocus:Bc($e.onFocus,()=>q(!0)),onBlur:Bc($e.onBlur,()=>q(!1))}),[z,ue,$,Ae,n,r,W,f,m,v,k,P,kt,Je]),lt=p.useCallback(($e,Ke=null)=>{const Cn=!($e.value<n||$e.value>r),Ee=W>=$e.value,qe=Rh($e.value,n,r),pt={position:"absolute",pointerEvents:"none",...fF({orientation:f,vertical:{bottom:D?`${100-qe}%`:`${qe}%`},horizontal:{left:D?`${100-qe}%`:`${qe}%`}})};return{...$e,ref:Ke,role:"presentation","aria-hidden":!0,"data-disabled":ps(m),"data-invalid":ps(!Cn),"data-highlighted":ps(Ee),style:{...$e.style,...pt}}},[m,D,r,n,f,W]),It=p.useCallback(($e={},Ke=null)=>({...$e,ref:Ke,type:"hidden",value:W,name:j}),[j,W]);return{state:{value:W,isFocused:U,isDragging:$},actions:Pe,getRootProps:me,getTrackProps:Re,getInnerTrackProps:Ye,getThumbProps:ye,getMarkerProps:lt,getInputProps:It}}function fF(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}function pF(e,t){return t<e?e:e+(t-e)/2}var[hF,kg]=zn({name:"SliderContext",hookName:"useSliderContext",providerName:"<Slider />"}),[mF,Pg]=zn({name:"SliderStylesContext",hookName:"useSliderStyles",providerName:"<Slider />"}),cj=ze((e,t)=>{var n;const r={...e,orientation:(n=e==null?void 0:e.orientation)!=null?n:"horizontal"},o=Ur("Slider",r),s=Jn(r),{direction:a}=vu();s.direction=a;const{getInputProps:c,getRootProps:d,...f}=dF(s),h=d(),m=c({},t);return i.jsx(hF,{value:f,children:i.jsx(mF,{value:o,children:i.jsxs(Ie.div,{...h,className:qi("chakra-slider",r.className),__css:o.container,children:[r.children,i.jsx("input",{...m})]})})})});cj.displayName="Slider";var uj=ze((e,t)=>{const{getThumbProps:n}=kg(),r=Pg(),o=n(e,t);return i.jsx(Ie.div,{...o,className:qi("chakra-slider__thumb",e.className),__css:r.thumb})});uj.displayName="SliderThumb";var dj=ze((e,t)=>{const{getTrackProps:n}=kg(),r=Pg(),o=n(e,t);return i.jsx(Ie.div,{...o,className:qi("chakra-slider__track",e.className),__css:r.track})});dj.displayName="SliderTrack";var fj=ze((e,t)=>{const{getInnerTrackProps:n}=kg(),r=Pg(),o=n(e,t);return i.jsx(Ie.div,{...o,className:qi("chakra-slider__filled-track",e.className),__css:r.filledTrack})});fj.displayName="SliderFilledTrack";var Sc=ze((e,t)=>{const{getMarkerProps:n}=kg(),r=Pg(),o=n(e,t);return i.jsx(Ie.div,{...o,className:qi("chakra-slider__marker",e.className),__css:r.mark})});Sc.displayName="SliderMark";var Fb=ze(function(t,n){const r=Ur("Switch",t),{spacing:o="0.5rem",children:s,...a}=Jn(t),{state:c,getInputProps:d,getCheckboxProps:f,getRootProps:h,getLabelProps:m}=u5(a),v=p.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...r.container}),[r.container]),y=p.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...r.track}),[r.track]),S=p.useMemo(()=>({userSelect:"none",marginStart:o,...r.label}),[o,r.label]);return i.jsxs(Ie.label,{...h(),className:jt("chakra-switch",t.className),__css:v,children:[i.jsx("input",{className:"chakra-switch__input",...d({},n)}),i.jsx(Ie.span,{...f(),className:"chakra-switch__track",__css:y,children:i.jsx(Ie.span,{__css:r.thumb,className:"chakra-switch__thumb","data-checked":on(c.isChecked),"data-hover":on(c.isHovered)})}),s&&i.jsx(Ie.span,{className:"chakra-switch__label",...m(),__css:S,children:s})]})});Fb.displayName="Switch";var[gF,vF,yF,bF]=sb();function xF(e){var t;const{defaultIndex:n,onChange:r,index:o,isManual:s,isLazy:a,lazyBehavior:c="unmount",orientation:d="horizontal",direction:f="ltr",...h}=e,[m,v]=p.useState(n??0),[y,S]=bu({defaultValue:n??0,value:o,onChange:r});p.useEffect(()=>{o!=null&&v(o)},[o]);const x=yF(),w=p.useId();return{id:`tabs-${(t=e.id)!=null?t:w}`,selectedIndex:y,focusedIndex:m,setSelectedIndex:S,setFocusedIndex:v,isManual:s,isLazy:a,lazyBehavior:c,orientation:d,descendants:x,direction:f,htmlProps:h}}var[wF,jg]=zn({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within <Tabs />"});function SF(e){const{focusedIndex:t,orientation:n,direction:r}=jg(),o=vF(),s=p.useCallback(a=>{const c=()=>{var k;const P=o.nextEnabled(t);P&&((k=P.node)==null||k.focus())},d=()=>{var k;const P=o.prevEnabled(t);P&&((k=P.node)==null||k.focus())},f=()=>{var k;const P=o.firstEnabled();P&&((k=P.node)==null||k.focus())},h=()=>{var k;const P=o.lastEnabled();P&&((k=P.node)==null||k.focus())},m=n==="horizontal",v=n==="vertical",y=a.key,S=r==="ltr"?"ArrowLeft":"ArrowRight",x=r==="ltr"?"ArrowRight":"ArrowLeft",_={[S]:()=>m&&d(),[x]:()=>m&&c(),ArrowDown:()=>v&&c(),ArrowUp:()=>v&&d(),Home:f,End:h}[y];_&&(a.preventDefault(),_(a))},[o,t,n,r]);return{...e,role:"tablist","aria-orientation":n,onKeyDown:st(e.onKeyDown,s)}}function CF(e){const{isDisabled:t,isFocusable:n,...r}=e,{setSelectedIndex:o,isManual:s,id:a,setFocusedIndex:c,selectedIndex:d}=jg(),{index:f,register:h}=bF({disabled:t&&!n}),m=f===d,v=()=>{o(f)},y=()=>{c(f),!s&&!(t&&n)&&o(f)},S=m6({...r,ref:gn(h,e.ref),isDisabled:t,isFocusable:n,onClick:st(e.onClick,v)}),x="button";return{...S,id:pj(a,f),role:"tab",tabIndex:m?0:-1,type:x,"aria-selected":m,"aria-controls":hj(a,f),onFocus:t?void 0:st(e.onFocus,y)}}var[_F,kF]=zn({});function PF(e){const t=jg(),{id:n,selectedIndex:r}=t,s=cf(e.children).map((a,c)=>p.createElement(_F,{key:c,value:{isSelected:c===r,id:hj(n,c),tabId:pj(n,c),selectedIndex:r}},a));return{...e,children:s}}function jF(e){const{children:t,...n}=e,{isLazy:r,lazyBehavior:o}=jg(),{isSelected:s,id:a,tabId:c}=kF(),d=p.useRef(!1);s&&(d.current=!0);const f=Db({wasSelected:d.current,isSelected:s,enabled:r,mode:o});return{tabIndex:0,...n,children:f?t:null,role:"tabpanel","aria-labelledby":c,hidden:!s,id:a}}function pj(e,t){return`${e}--tab-${t}`}function hj(e,t){return`${e}--tabpanel-${t}`}var[EF,Eg]=zn({name:"TabsStylesContext",errorMessage:`useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Tabs />" `}),Hb=ze(function(t,n){const r=Ur("Tabs",t),{children:o,className:s,...a}=Jn(t),{htmlProps:c,descendants:d,...f}=xF(a),h=p.useMemo(()=>f,[f]),{isFitted:m,...v}=c;return i.jsx(gF,{value:d,children:i.jsx(wF,{value:h,children:i.jsx(EF,{value:r,children:i.jsx(Ie.div,{className:jt("chakra-tabs",s),ref:n,...v,__css:r.root,children:o})})})})});Hb.displayName="Tabs";var Vb=ze(function(t,n){const r=SF({...t,ref:n}),s={display:"flex",...Eg().tablist};return i.jsx(Ie.div,{...r,className:jt("chakra-tabs__tablist",t.className),__css:s})});Vb.displayName="TabList";var Wb=ze(function(t,n){const r=jF({...t,ref:n}),o=Eg();return i.jsx(Ie.div,{outline:"0",...r,className:jt("chakra-tabs__tab-panel",t.className),__css:o.tabpanel})});Wb.displayName="TabPanel";var Ub=ze(function(t,n){const r=PF(t),o=Eg();return i.jsx(Ie.div,{...r,width:"100%",ref:n,className:jt("chakra-tabs__tab-panels",t.className),__css:o.tabpanels})});Ub.displayName="TabPanels";var Gb=ze(function(t,n){const r=Eg(),o=CF({...t,ref:n}),s={outline:"0",display:"flex",alignItems:"center",justifyContent:"center",...r.tab};return i.jsx(Ie.button,{...o,className:jt("chakra-tabs__tab",t.className),__css:s})});Gb.displayName="Tab";function IF(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var OF=["h","minH","height","minHeight"],mj=ze((e,t)=>{const n=ni("Textarea",e),{className:r,rows:o,...s}=Jn(e),a=lb(s),c=o?IF(n,OF):n;return i.jsx(Ie.textarea,{ref:t,rows:o,...a,className:jt("chakra-textarea",r),__css:c})});mj.displayName="Textarea";var TF={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]}}}},X1=e=>{var t;return((t=e.current)==null?void 0:t.ownerDocument)||document},uh=e=>{var t,n;return((n=(t=e.current)==null?void 0:t.ownerDocument)==null?void 0:n.defaultView)||window};function RF(e={}){const{openDelay:t=0,closeDelay:n=0,closeOnClick:r=!0,closeOnMouseDown:o,closeOnScroll:s,closeOnPointerDown:a=o,closeOnEsc:c=!0,onOpen:d,onClose:f,placement:h,id:m,isOpen:v,defaultIsOpen:y,arrowSize:S=10,arrowShadowColor:x,arrowPadding:w,modifiers:_,isDisabled:k,gutter:P,offset:j,direction:I,...O}=e,{isOpen:T,onOpen:R,onClose:M}=Mb({isOpen:v,defaultIsOpen:y,onOpen:d,onClose:f}),{referenceRef:D,getPopperProps:A,getArrowInnerProps:G,getArrowProps:$}=Rb({enabled:T,placement:h,arrowPadding:w,modifiers:_,gutter:P,offset:j,direction:I}),H=p.useId(),q=`tooltip-${m??H}`,z=p.useRef(null),L=p.useRef(),V=p.useCallback(()=>{L.current&&(clearTimeout(L.current),L.current=void 0)},[]),W=p.useRef(),te=p.useCallback(()=>{W.current&&(clearTimeout(W.current),W.current=void 0)},[]),fe=p.useCallback(()=>{te(),M()},[M,te]),ae=MF(z,fe),J=p.useCallback(()=>{if(!k&&!L.current){ae();const be=uh(z);L.current=be.setTimeout(R,t)}},[ae,k,R,t]),B=p.useCallback(()=>{V();const be=uh(z);W.current=be.setTimeout(fe,n)},[n,fe,V]),oe=p.useCallback(()=>{T&&r&&B()},[r,B,T]),le=p.useCallback(()=>{T&&a&&B()},[a,B,T]),ge=p.useCallback(be=>{T&&be.key==="Escape"&&B()},[T,B]);xl(()=>X1(z),"keydown",c?ge:void 0),xl(()=>{const be=z.current;if(!be)return null;const ke=r6(be);return ke.localName==="body"?uh(z):ke},"scroll",()=>{T&&s&&fe()},{passive:!0,capture:!0}),p.useEffect(()=>{k&&(V(),T&&M())},[k,T,M,V]),p.useEffect(()=>()=>{V(),te()},[V,te]),xl(()=>z.current,"pointerleave",B);const se=p.useCallback((be={},ke=null)=>({...be,ref:gn(z,ke,D),onPointerEnter:st(be.onPointerEnter,Pe=>{Pe.pointerType!=="touch"&&J()}),onClick:st(be.onClick,oe),onPointerDown:st(be.onPointerDown,le),onFocus:st(be.onFocus,J),onBlur:st(be.onBlur,B),"aria-describedby":T?q:void 0}),[J,B,le,T,q,oe,D]),pe=p.useCallback((be={},ke=null)=>A({...be,style:{...be.style,[Nr.arrowSize.var]:S?`${S}px`:void 0,[Nr.arrowShadowColor.var]:x}},ke),[A,S,x]),ue=p.useCallback((be={},ke=null)=>{const ie={...be.style,position:"relative",transformOrigin:Nr.transformOrigin.varRef};return{ref:ke,...O,...be,id:q,role:"tooltip",style:ie}},[O,q]);return{isOpen:T,show:J,hide:B,getTriggerProps:se,getTooltipProps:ue,getTooltipPositionerProps:pe,getArrowProps:$,getArrowInnerProps:G}}var R0="chakra-ui:close-tooltip";function MF(e,t){return p.useEffect(()=>{const n=X1(e);return n.addEventListener(R0,t),()=>n.removeEventListener(R0,t)},[t,e]),()=>{const n=X1(e),r=uh(e);n.dispatchEvent(new r.CustomEvent(R0))}}function DF(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function AF(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var NF=Ie(No.div),Wn=ze((e,t)=>{var n,r;const o=ni("Tooltip",e),s=Jn(e),a=vu(),{children:c,label:d,shouldWrapChildren:f,"aria-label":h,hasArrow:m,bg:v,portalProps:y,background:S,backgroundColor:x,bgColor:w,motionProps:_,...k}=s,P=(r=(n=S??x)!=null?n:v)!=null?r:w;if(P){o.bg=P;const A=W8(a,"colors",P);o[Nr.arrowBg.var]=A}const j=RF({...k,direction:a.direction}),I=typeof c=="string"||f;let O;if(I)O=i.jsx(Ie.span,{display:"inline-block",tabIndex:0,...j.getTriggerProps(),children:c});else{const A=p.Children.only(c);O=p.cloneElement(A,j.getTriggerProps(A.props,A.ref))}const T=!!h,R=j.getTooltipProps({},t),M=T?DF(R,["role","id"]):R,D=AF(R,["role","id"]);return d?i.jsxs(i.Fragment,{children:[O,i.jsx(Xo,{children:j.isOpen&&i.jsx(Sd,{...y,children:i.jsx(Ie.div,{...j.getTooltipPositionerProps(),__css:{zIndex:o.zIndex,pointerEvents:"none"},children:i.jsxs(NF,{variants:TF,initial:"exit",animate:"enter",exit:"exit",..._,...M,__css:o,children:[d,T&&i.jsx(Ie.span,{srOnly:!0,...D,children:h}),m&&i.jsx(Ie.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper",children:i.jsx(Ie.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:o.bg}})})]})})})})]}):i.jsx(i.Fragment,{children:c})});Wn.displayName="Tooltip";let hC=()=>{};const Ig=()=>({setOpenUploaderFunction:p.useCallback(t=>{t&&(hC=t)},[]),openUploader:hC});var zF=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 vf(e,t){var n=$F(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 $F(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),o=zF.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var LF=[".DS_Store","Thumbs.db"];function BF(e){return xu(this,void 0,void 0,function(){return wu(this,function(t){return zh(e)&&FF(e.dataTransfer)?[2,UF(e.dataTransfer,e.type)]:HF(e)?[2,VF(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,WF(e)]:[2,[]]})})}function FF(e){return zh(e)}function HF(e){return zh(e)&&zh(e.target)}function zh(e){return typeof e=="object"&&e!==null}function VF(e){return Z1(e.target.files).map(function(t){return vf(t)})}function WF(e){return xu(this,void 0,void 0,function(){var t;return wu(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 vf(r)})]}})})}function UF(e,t){return xu(this,void 0,void 0,function(){var n,r;return wu(this,function(o){switch(o.label){case 0:return e.items?(n=Z1(e.items).filter(function(s){return s.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(GF))]):[3,2];case 1:return r=o.sent(),[2,mC(gj(r))];case 2:return[2,mC(Z1(e.files).map(function(s){return vf(s)}))]}})})}function mC(e){return e.filter(function(t){return LF.indexOf(t.name)===-1})}function Z1(e){if(e===null)return[];for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r)}return t}function GF(e){if(typeof e.webkitGetAsEntry!="function")return gC(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?vj(t):gC(e)}function gj(e){return e.reduce(function(t,n){return z1(z1([],zS(t),!1),zS(Array.isArray(n)?gj(n):[n]),!1)},[])}function gC(e){var t=e.getAsFile();if(!t)return Promise.reject("".concat(e," is not a File"));var n=vf(t);return Promise.resolve(n)}function qF(e){return xu(this,void 0,void 0,function(){return wu(this,function(t){return[2,e.isDirectory?vj(e):YF(e)]})})}function vj(e){var t=e.createReader();return new Promise(function(n,r){var o=[];function s(){var a=this;t.readEntries(function(c){return xu(a,void 0,void 0,function(){var d,f,h;return wu(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 d=m.sent(),n(d),[3,4];case 3:return f=m.sent(),r(f),[3,4];case 4:return[3,6];case 5:h=Promise.all(c.map(qF)),o.push(h),s(),m.label=6;case 6:return[2]}})})},function(c){r(c)})}s()})}function YF(e){return xu(this,void 0,void 0,function(){return wu(this,function(t){return[2,new Promise(function(n,r){e.file(function(o){var s=vf(o,e.fullPath);n(s)},function(o){r(o)})})]})})}var KF=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(a){var c=a.trim().toLowerCase();return c.charAt(0)==="."?r.toLowerCase().endsWith(c):c.endsWith("/*")?s===c.replace(/\/.*$/,""):o===c})}return!0};function vC(e){return QF(e)||ZF(e)||bj(e)||XF()}function XF(){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 ZF(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function QF(e){if(Array.isArray(e))return Q1(e)}function yC(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 bC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yC(Object(n),!0).forEach(function(r){yj(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yj(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dd(e,t){return tH(e)||eH(e,t)||bj(e,t)||JF()}function JF(){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 bj(e,t){if(e){if(typeof e=="string")return Q1(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 Q1(e,t)}}function Q1(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 eH(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,s=!1,a,c;try{for(n=n.call(e);!(o=(a=n.next()).done)&&(r.push(a.value),!(t&&r.length===t));o=!0);}catch(d){s=!0,c=d}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw c}}return r}}function tH(e){if(Array.isArray(e))return e}var nH="file-invalid-type",rH="file-too-large",oH="file-too-small",sH="too-many-files",aH=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:nH,message:"File type must be ".concat(n)}},xC=function(t){return{code:rH,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},wC=function(t){return{code:oH,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},iH={code:sH,message:"Too many files"};function xj(e,t){var n=e.type==="application/x-moz-file"||KF(e,t);return[n,n?null:aH(t)]}function wj(e,t,n){if(pl(e.size))if(pl(t)&&pl(n)){if(e.size>n)return[!1,xC(n)];if(e.size<t)return[!1,wC(t)]}else{if(pl(t)&&e.size<t)return[!1,wC(t)];if(pl(n)&&e.size>n)return[!1,xC(n)]}return[!0,null]}function pl(e){return e!=null}function lH(e){var t=e.files,n=e.accept,r=e.minSize,o=e.maxSize,s=e.multiple,a=e.maxFiles,c=e.validator;return!s&&t.length>1||s&&a>=1&&t.length>a?!1:t.every(function(d){var f=xj(d,n),h=Dd(f,1),m=h[0],v=wj(d,r,o),y=Dd(v,1),S=y[0],x=c?c(d):null;return m&&S&&!x})}function $h(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function gp(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 SC(e){e.preventDefault()}function cH(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function uH(e){return e.indexOf("Edge/")!==-1}function dH(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return cH(e)||uH(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),a=1;a<o;a++)s[a-1]=arguments[a];return t.some(function(c){return!$h(r)&&c&&c.apply(void 0,[r].concat(s)),$h(r)})}}function fH(){return"showOpenFilePicker"in window}function pH(e){if(pl(e)){var t=Object.entries(e).filter(function(n){var r=Dd(n,2),o=r[0],s=r[1],a=!0;return Sj(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.')),a=!1),(!Array.isArray(s)||!s.every(Cj))&&(console.warn('Skipped "'.concat(o,'" because an invalid file extension was provided.')),a=!1),a}).reduce(function(n,r){var o=Dd(r,2),s=o[0],a=o[1];return bC(bC({},n),{},yj({},s,a))},{});return[{description:"Files",accept:t}]}return e}function hH(e){if(pl(e))return Object.entries(e).reduce(function(t,n){var r=Dd(n,2),o=r[0],s=r[1];return[].concat(vC(t),[o],vC(s))},[]).filter(function(t){return Sj(t)||Cj(t)}).join(",")}function mH(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function gH(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function Sj(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function Cj(e){return/^.*\.[\w]+$/.test(e)}var vH=["children"],yH=["open"],bH=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],xH=["refKey","onChange","onClick"];function wH(e){return _H(e)||CH(e)||_j(e)||SH()}function SH(){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 CH(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function _H(e){if(Array.isArray(e))return J1(e)}function M0(e,t){return jH(e)||PH(e,t)||_j(e,t)||kH()}function kH(){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 _j(e,t){if(e){if(typeof e=="string")return J1(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 J1(e,t)}}function J1(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 PH(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,s=!1,a,c;try{for(n=n.call(e);!(o=(a=n.next()).done)&&(r.push(a.value),!(t&&r.length===t));o=!0);}catch(d){s=!0,c=d}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw c}}return r}}function jH(e){if(Array.isArray(e))return e}function CC(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 wr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CC(Object(n),!0).forEach(function(r){ey(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ey(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lh(e,t){if(e==null)return{};var n=EH(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 EH(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 qb=p.forwardRef(function(e,t){var n=e.children,r=Lh(e,vH),o=Yb(r),s=o.open,a=Lh(o,yH);return p.useImperativeHandle(t,function(){return{open:s}},[s]),F.createElement(p.Fragment,null,n(wr(wr({},a),{},{open:s})))});qb.displayName="Dropzone";var kj={disabled:!1,getFilesFromEvent:BF,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};qb.defaultProps=kj;qb.propTypes={children:Kn.func,accept:Kn.objectOf(Kn.arrayOf(Kn.string)),multiple:Kn.bool,preventDropOnDocument:Kn.bool,noClick:Kn.bool,noKeyboard:Kn.bool,noDrag:Kn.bool,noDragEventsBubbling:Kn.bool,minSize:Kn.number,maxSize:Kn.number,maxFiles:Kn.number,disabled:Kn.bool,getFilesFromEvent:Kn.func,onFileDialogCancel:Kn.func,onFileDialogOpen:Kn.func,useFsAccessApi:Kn.bool,autoFocus:Kn.bool,onDragEnter:Kn.func,onDragLeave:Kn.func,onDragOver:Kn.func,onDrop:Kn.func,onDropAccepted:Kn.func,onDropRejected:Kn.func,onError:Kn.func,validator:Kn.func};var ty={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function Yb(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=wr(wr({},kj),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,s=t.maxSize,a=t.minSize,c=t.multiple,d=t.maxFiles,f=t.onDragEnter,h=t.onDragLeave,m=t.onDragOver,v=t.onDrop,y=t.onDropAccepted,S=t.onDropRejected,x=t.onFileDialogCancel,w=t.onFileDialogOpen,_=t.useFsAccessApi,k=t.autoFocus,P=t.preventDropOnDocument,j=t.noClick,I=t.noKeyboard,O=t.noDrag,T=t.noDragEventsBubbling,R=t.onError,M=t.validator,D=p.useMemo(function(){return hH(n)},[n]),A=p.useMemo(function(){return pH(n)},[n]),G=p.useMemo(function(){return typeof w=="function"?w:_C},[w]),$=p.useMemo(function(){return typeof x=="function"?x:_C},[x]),H=p.useRef(null),U=p.useRef(null),q=p.useReducer(IH,ty),z=M0(q,2),L=z[0],V=z[1],W=L.isFocused,te=L.isFileDialogActive,fe=p.useRef(typeof window<"u"&&window.isSecureContext&&_&&fH()),ae=function(){!fe.current&&te&&setTimeout(function(){if(U.current){var me=U.current.files;me.length||(V({type:"closeDialog"}),$())}},300)};p.useEffect(function(){return window.addEventListener("focus",ae,!1),function(){window.removeEventListener("focus",ae,!1)}},[U,te,$,fe]);var J=p.useRef([]),B=function(me){H.current&&H.current.contains(me.target)||(me.preventDefault(),J.current=[])};p.useEffect(function(){return P&&(document.addEventListener("dragover",SC,!1),document.addEventListener("drop",B,!1)),function(){P&&(document.removeEventListener("dragover",SC),document.removeEventListener("drop",B))}},[H,P]),p.useEffect(function(){return!r&&k&&H.current&&H.current.focus(),function(){}},[H,k,r]);var oe=p.useCallback(function(ne){R?R(ne):console.error(ne)},[R]),le=p.useCallback(function(ne){ne.preventDefault(),ne.persist(),ft(ne),J.current=[].concat(wH(J.current),[ne.target]),gp(ne)&&Promise.resolve(o(ne)).then(function(me){if(!($h(ne)&&!T)){var Re=me.length,Ye=Re>0&&lH({files:me,accept:D,minSize:a,maxSize:s,multiple:c,maxFiles:d,validator:M}),ye=Re>0&&!Ye;V({isDragAccept:Ye,isDragReject:ye,isDragActive:!0,type:"setDraggedFiles"}),f&&f(ne)}}).catch(function(me){return oe(me)})},[o,f,oe,T,D,a,s,c,d,M]),ge=p.useCallback(function(ne){ne.preventDefault(),ne.persist(),ft(ne);var me=gp(ne);if(me&&ne.dataTransfer)try{ne.dataTransfer.dropEffect="copy"}catch{}return me&&m&&m(ne),!1},[m,T]),se=p.useCallback(function(ne){ne.preventDefault(),ne.persist(),ft(ne);var me=J.current.filter(function(Ye){return H.current&&H.current.contains(Ye)}),Re=me.indexOf(ne.target);Re!==-1&&me.splice(Re,1),J.current=me,!(me.length>0)&&(V({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),gp(ne)&&h&&h(ne))},[H,h,T]),pe=p.useCallback(function(ne,me){var Re=[],Ye=[];ne.forEach(function(ye){var lt=xj(ye,D),It=M0(lt,2),Xt=It[0],$e=It[1],Ke=wj(ye,a,s),Cn=M0(Ke,2),Ee=Cn[0],qe=Cn[1],pt=M?M(ye):null;if(Xt&&Ee&&!pt)Re.push(ye);else{var gt=[$e,qe];pt&&(gt=gt.concat(pt)),Ye.push({file:ye,errors:gt.filter(function(Ht){return Ht})})}}),(!c&&Re.length>1||c&&d>=1&&Re.length>d)&&(Re.forEach(function(ye){Ye.push({file:ye,errors:[iH]})}),Re.splice(0)),V({acceptedFiles:Re,fileRejections:Ye,type:"setFiles"}),v&&v(Re,Ye,me),Ye.length>0&&S&&S(Ye,me),Re.length>0&&y&&y(Re,me)},[V,c,D,a,s,d,v,y,S,M]),ue=p.useCallback(function(ne){ne.preventDefault(),ne.persist(),ft(ne),J.current=[],gp(ne)&&Promise.resolve(o(ne)).then(function(me){$h(ne)&&!T||pe(me,ne)}).catch(function(me){return oe(me)}),V({type:"reset"})},[o,pe,oe,T]),be=p.useCallback(function(){if(fe.current){V({type:"openDialog"}),G();var ne={multiple:c,types:A};window.showOpenFilePicker(ne).then(function(me){return o(me)}).then(function(me){pe(me,null),V({type:"closeDialog"})}).catch(function(me){mH(me)?($(me),V({type:"closeDialog"})):gH(me)?(fe.current=!1,U.current?(U.current.value=null,U.current.click()):oe(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."))):oe(me)});return}U.current&&(V({type:"openDialog"}),G(),U.current.value=null,U.current.click())},[V,G,$,_,pe,oe,A,c]),ke=p.useCallback(function(ne){!H.current||!H.current.isEqualNode(ne.target)||(ne.key===" "||ne.key==="Enter"||ne.keyCode===32||ne.keyCode===13)&&(ne.preventDefault(),be())},[H,be]),ie=p.useCallback(function(){V({type:"focus"})},[]),Pe=p.useCallback(function(){V({type:"blur"})},[]),Je=p.useCallback(function(){j||(dH()?setTimeout(be,0):be())},[j,be]),Ae=function(me){return r?null:me},Ve=function(me){return I?null:Ae(me)},kt=function(me){return O?null:Ae(me)},ft=function(me){T&&me.stopPropagation()},yn=p.useMemo(function(){return function(){var ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},me=ne.refKey,Re=me===void 0?"ref":me,Ye=ne.role,ye=ne.onKeyDown,lt=ne.onFocus,It=ne.onBlur,Xt=ne.onClick,$e=ne.onDragEnter,Ke=ne.onDragOver,Cn=ne.onDragLeave,Ee=ne.onDrop,qe=Lh(ne,bH);return wr(wr(ey({onKeyDown:Ve(fa(ye,ke)),onFocus:Ve(fa(lt,ie)),onBlur:Ve(fa(It,Pe)),onClick:Ae(fa(Xt,Je)),onDragEnter:kt(fa($e,le)),onDragOver:kt(fa(Ke,ge)),onDragLeave:kt(fa(Cn,se)),onDrop:kt(fa(Ee,ue)),role:typeof Ye=="string"&&Ye!==""?Ye:"presentation"},Re,H),!r&&!I?{tabIndex:0}:{}),qe)}},[H,ke,ie,Pe,Je,le,ge,se,ue,I,O,r]),K=p.useCallback(function(ne){ne.stopPropagation()},[]),Ce=p.useMemo(function(){return function(){var ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},me=ne.refKey,Re=me===void 0?"ref":me,Ye=ne.onChange,ye=ne.onClick,lt=Lh(ne,xH),It=ey({accept:D,multiple:c,type:"file",style:{display:"none"},onChange:Ae(fa(Ye,ue)),onClick:Ae(fa(ye,K)),tabIndex:-1},Re,U);return wr(wr({},It),lt)}},[U,n,c,ue,r]);return wr(wr({},L),{},{isFocused:W&&!r,getRootProps:yn,getInputProps:Ce,rootRef:H,inputRef:U,open:Ae(be)})}function IH(e,t){switch(t.type){case"focus":return wr(wr({},e),{},{isFocused:!0});case"blur":return wr(wr({},e),{},{isFocused:!1});case"openDialog":return wr(wr({},ty),{},{isFileDialogActive:!0});case"closeDialog":return wr(wr({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return wr(wr({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return wr(wr({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return wr({},ty);default:return e}}function _C(){}function ny(){return ny=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},ny.apply(this,arguments)}var Pj=["shift","alt","meta","mod","ctrl"],OH={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 Ei(e){return(OH[e]||e).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function TH(e){return Pj.includes(e)}function D0(e,t){return t===void 0&&(t=","),e.split(t)}function A0(e,t,n){t===void 0&&(t="+");var r=e.toLocaleLowerCase().split(t).map(function(a){return Ei(a)}),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(a){return!Pj.includes(a)});return ny({},o,{keys:s,description:n})}(function(){typeof document<"u"&&(document.addEventListener("keydown",function(e){e.key!==void 0&&Ej([Ei(e.key),Ei(e.code)])}),document.addEventListener("keyup",function(e){e.key!==void 0&&Ij([Ei(e.key),Ei(e.code)])})),typeof window<"u"&&window.addEventListener("blur",function(){Ii.clear()})})();var Ii=new Set;function jj(e,t){t===void 0&&(t=",");var n=Array.isArray(e)?e:e.split(t);return n.every(function(r){return Ii.has(r.trim().toLowerCase())})}function Ej(e){var t=Array.isArray(e)?e:[e];Ii.has("meta")&&Ii.forEach(function(n){return!TH(n)&&Ii.delete(n.toLowerCase())}),t.forEach(function(n){return Ii.add(n.toLowerCase())})}function Ij(e){var t=Array.isArray(e)?e:[e];e==="meta"?Ii.clear():t.forEach(function(n){return Ii.delete(n.toLowerCase())})}function RH(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function MH(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function DH(e){return Oj(e,["input","textarea","select"])}function Oj(e,t){var n=e.target;t===void 0&&(t=!1);var r=n&&n.tagName;return t instanceof Array?!!(r&&t&&t.some(function(o){return o.toLowerCase()===r.toLowerCase()})):!!(r&&t&&t===!0)}function AH(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 NH=function(t,n,r){r===void 0&&(r=!1);var o=n.alt,s=n.meta,a=n.mod,c=n.shift,d=n.ctrl,f=n.keys,h=t.key,m=t.code,v=t.ctrlKey,y=t.metaKey,S=t.shiftKey,x=t.altKey,w=Ei(m),_=h.toLowerCase();if(!r){if(o===!x&&_!=="alt"||c===!S&&_!=="shift")return!1;if(a){if(!y&&!v)return!1}else if(s===!y&&_!=="meta"&&_!=="os"||d===!v&&_!=="ctrl"&&_!=="control")return!1}return f&&f.length===1&&(f.includes(_)||f.includes(w))?!0:f?jj(f):!f},zH=p.createContext(void 0),$H=function(){return p.useContext(zH)};function Tj(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&&Tj(e[r],t[r])},!0):e===t}var LH=p.createContext({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),BH=function(){return p.useContext(LH)};function FH(e){var t=p.useRef(void 0);return Tj(t.current,e)||(t.current=e),t.current}var kC=function(t){t.stopPropagation(),t.preventDefault(),t.stopImmediatePropagation()},HH=typeof window<"u"?p.useLayoutEffect:p.useEffect;function et(e,t,n,r){var o=p.useRef(null),s=p.useRef(!1),a=n instanceof Array?r instanceof Array?void 0:r:n,c=e instanceof Array?e.join(a==null?void 0:a.splitKey):e,d=n instanceof Array?n:r instanceof Array?r:void 0,f=p.useCallback(t,d??[]),h=p.useRef(f);d?h.current=f:h.current=t;var m=FH(a),v=BH(),y=v.enabledScopes,S=$H();return HH(function(){if(!((m==null?void 0:m.enabled)===!1||!AH(y,m==null?void 0:m.scopes))){var x=function(j,I){var O;if(I===void 0&&(I=!1),!(DH(j)&&!Oj(j,m==null?void 0:m.enableOnFormTags))&&!(m!=null&&m.ignoreEventWhen!=null&&m.ignoreEventWhen(j))){if(o.current!==null&&document.activeElement!==o.current&&!o.current.contains(document.activeElement)){kC(j);return}(O=j.target)!=null&&O.isContentEditable&&!(m!=null&&m.enableOnContentEditable)||D0(c,m==null?void 0:m.splitKey).forEach(function(T){var R,M=A0(T,m==null?void 0:m.combinationKey);if(NH(j,M,m==null?void 0:m.ignoreModifiers)||(R=M.keys)!=null&&R.includes("*")){if(I&&s.current)return;if(RH(j,M,m==null?void 0:m.preventDefault),!MH(j,M,m==null?void 0:m.enabled)){kC(j);return}h.current(j,M),I||(s.current=!0)}})}},w=function(j){j.key!==void 0&&(Ej(Ei(j.code)),((m==null?void 0:m.keydown)===void 0&&(m==null?void 0:m.keyup)!==!0||m!=null&&m.keydown)&&x(j))},_=function(j){j.key!==void 0&&(Ij(Ei(j.code)),s.current=!1,m!=null&&m.keyup&&x(j,!0))},k=o.current||(a==null?void 0:a.document)||document;return k.addEventListener("keyup",_),k.addEventListener("keydown",w),S&&D0(c,m==null?void 0:m.splitKey).forEach(function(P){return S.addHotkey(A0(P,m==null?void 0:m.combinationKey,m==null?void 0:m.description))}),function(){k.removeEventListener("keyup",_),k.removeEventListener("keydown",w),S&&D0(c,m==null?void 0:m.splitKey).forEach(function(P){return S.removeHotkey(A0(P,m==null?void 0:m.combinationKey,m==null?void 0:m.description))})}}},[c,m,y]),o}const VH=e=>{const{isDragAccept:t,isDragReject:n,setIsHandlingUpload:r}=e;return et("esc",()=>{r(!1)}),i.jsx(ut,{sx:{position:"absolute",top:0,insetInlineStart:0,width:"100vw",height:"100vh",zIndex:999,backdropFilter:"blur(20px)"},children:i.jsx(X,{sx:{opacity:.4,width:"100%",height:"100%",flexDirection:"column",rowGap:4,alignItems:"center",justifyContent:"center",bg:"base.900",boxShadow:`inset 0 0 20rem 1rem var(--invokeai-colors-${t?"accent":"error"}-500)`},children:t?i.jsx($a,{size:"lg",children:"Drop to Upload"}):i.jsxs(i.Fragment,{children:[i.jsx($a,{size:"lg",children:"Invalid Upload"}),i.jsx($a,{size:"md",children:"Must be single JPEG or PNG image"})]})})})},WH=Oe([wo,Gr],(e,t)=>{const{isConnected:n,isUploading:r}=e;return{isUploaderDisabled:!n||r,activeTabName:t}}),UH=e=>{const{children:t}=e,n=ce(),{isUploaderDisabled:r,activeTabName:o}=Y(WH),s=nf(),{t:a}=we(),[c,d]=p.useState(!1),{setOpenUploaderFunction:f}=Ig(),h=p.useCallback(j=>{d(!0),s({title:a("toast.uploadFailed"),description:j.errors.map(I=>I.message).join(`
`),status:"error"})},[a,s]),m=p.useCallback(async j=>{n(e3({file:j,image_category:"user",is_intermediate:!1,postUploadAction:{type:"TOAST_UPLOADED"}}))},[n]),v=p.useCallback((j,I)=>{if(I.length>1){s({title:a("toast.uploadFailed"),description:a("toast.uploadFailedInvalidUploadDesc"),status:"error"});return}I.forEach(O=>{h(O)}),j.forEach(O=>{m(O)})},[a,s,m,h]),{getRootProps:y,getInputProps:S,isDragAccept:x,isDragReject:w,isDragActive:_,inputRef:k,open:P}=Yb({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},noClick:!0,onDrop:v,onDragOver:()=>d(!0),disabled:r,multiple:!1});return p.useEffect(()=>{const j=async I=>{var O,T;k.current&&(O=I.clipboardData)!=null&&O.files&&(k.current.files=I.clipboardData.files,(T=k.current)==null||T.dispatchEvent(new Event("change",{bubbles:!0})))};return f(P),document.addEventListener("paste",j),()=>{document.removeEventListener("paste",j),f(()=>{})}},[k,P,f]),i.jsxs(ut,{...y({style:{}}),onKeyDown:j=>{j.key},children:[i.jsx("input",{...S()}),t,_&&c&&i.jsx(VH,{isDragAccept:x,isDragReject:w,setIsHandlingUpload:d})]})},GH=p.memo(UH),Rj=e=>e.gallery;const qH=ze((e,t)=>{const{children:n,tooltip:r="",tooltipProps:{placement:o="top",hasArrow:s=!0,...a}={},isChecked:c,...d}=e;return i.jsx(Wn,{label:r,placement:o,hasArrow:s,...a,children:i.jsx(ag,{ref:t,colorScheme:c?"accent":"base",...d,children:n})})}),cn=p.memo(qH),Fe=(e,t)=>n=>n==="light"?e:t,YH=e=>{const{label:t,...n}=e,{colorMode:r}=zo();return i.jsx(d5,{colorScheme:"accent",...n,children:i.jsx(nt,{sx:{fontSize:"sm",color:Fe("base.800","base.200")(r)},children:t})})},Hn=p.memo(YH),Mj=ze((e,t)=>{const{role:n,tooltip:r="",tooltipProps:o,isChecked:s,...a}=e;return i.jsx(Wn,{label:r,hasArrow:!0,...o,...o!=null&&o.placement?{placement:o.placement}:{placement:"top"},children:i.jsx(Ya,{ref:t,role:n,colorScheme:s?"accent":"base",...a})})});Mj.displayName="IAIIconButton";const Ne=p.memo(Mj),KH=e=>{const{triggerComponent:t,children:n,hasArrow:r=!0,isLazy:o=!0,...s}=e;return i.jsxs(U6,{isLazy:o,...s,children:[i.jsx(W6,{children:t}),i.jsxs(Y6,{shadow:"dark-lg",children:[r&&i.jsx(G6,{}),n]})]})},Ba=p.memo(KH);var Dj={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},PC=F.createContext&&F.createContext(Dj),Mi=globalThis&&globalThis.__assign||function(){return Mi=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},Mi.apply(this,arguments)},XH=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 Aj(e){return e&&e.map(function(t,n){return F.createElement(t.tag,Mi({key:n},t.attr),Aj(t.child))})}function it(e){return function(t){return F.createElement(ZH,Mi({attr:Mi({},e.attr)},t),Aj(e.child))}}function ZH(e){var t=function(n){var r=e.attr,o=e.size,s=e.title,a=XH(e,["attr","size","title"]),c=o||n.size||"1em",d;return n.className&&(d=n.className),e.className&&(d=(d?d+" ":"")+e.className),F.createElement("svg",Mi({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,a,{className:d,style:Mi(Mi({color:e.color||n.color},n.style),e.style),height:c,width:c,xmlns:"http://www.w3.org/2000/svg"}),s&&F.createElement("title",null,s),e.children)};return PC!==void 0?F.createElement(PC.Consumer,null,function(n){return t(n)}):t(Dj)}function QH(e){return it({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19.002 3h-14c-1.103 0-2 .897-2 2v4h2V5h14v14h-14v-4h-2v4c0 1.103.897 2 2 2h14c1.103 0 2-.897 2-2V5c0-1.103-.898-2-2-2z"}},{tag:"path",attr:{d:"m11 16 5-4-5-4v3.001H3v2h8z"}}]})(e)}function Nj(e){return it({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)}function JH(e){return it({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M6.758 8.758 5.344 7.344a8.048 8.048 0 0 0-1.841 2.859l1.873.701a6.048 6.048 0 0 1 1.382-2.146zM19 12.999a7.935 7.935 0 0 0-2.344-5.655A7.917 7.917 0 0 0 12 5.069V2L7 6l5 4V7.089a5.944 5.944 0 0 1 3.242 1.669A5.956 5.956 0 0 1 17 13v.002c0 .33-.033.655-.086.977-.007.043-.011.088-.019.131a6.053 6.053 0 0 1-1.138 2.536c-.16.209-.331.412-.516.597a5.954 5.954 0 0 1-.728.613 5.906 5.906 0 0 1-2.277 1.015c-.142.03-.285.05-.43.069-.062.009-.122.021-.184.027a6.104 6.104 0 0 1-1.898-.103L9.3 20.819a8.087 8.087 0 0 0 2.534.136c.069-.007.138-.021.207-.03.205-.026.409-.056.61-.098l.053-.009-.001-.005a7.877 7.877 0 0 0 2.136-.795l.001.001.028-.019a7.906 7.906 0 0 0 1.01-.67c.27-.209.532-.43.777-.675.248-.247.47-.513.681-.785.021-.028.049-.053.07-.081l-.006-.004a7.899 7.899 0 0 0 1.093-1.997l.008.003c.029-.078.05-.158.076-.237.037-.11.075-.221.107-.333.04-.14.073-.281.105-.423.022-.099.048-.195.066-.295.032-.171.056-.344.076-.516.01-.076.023-.15.03-.227.023-.249.037-.5.037-.753.002-.002.002-.004.002-.008zM6.197 16.597l-1.6 1.201a8.045 8.045 0 0 0 2.569 2.225l.961-1.754a6.018 6.018 0 0 1-1.93-1.672zM5 13c0-.145.005-.287.015-.429l-1.994-.143a7.977 7.977 0 0 0 .483 3.372l1.873-.701A5.975 5.975 0 0 1 5 13z"}}]})(e)}function eV(e){return it({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M16.242 17.242a6.04 6.04 0 0 1-1.37 1.027l.961 1.754a8.068 8.068 0 0 0 2.569-2.225l-1.6-1.201a5.938 5.938 0 0 1-.56.645zm1.743-4.671a5.975 5.975 0 0 1-.362 2.528l1.873.701a7.977 7.977 0 0 0 .483-3.371l-1.994.142zm1.512-2.368a8.048 8.048 0 0 0-1.841-2.859l-1.414 1.414a6.071 6.071 0 0 1 1.382 2.146l1.873-.701zm-8.128 8.763c-.047-.005-.094-.015-.141-.021a6.701 6.701 0 0 1-.468-.075 5.923 5.923 0 0 1-2.421-1.122 5.954 5.954 0 0 1-.583-.506 6.138 6.138 0 0 1-.516-.597 5.91 5.91 0 0 1-.891-1.634 6.086 6.086 0 0 1-.247-.902c-.008-.043-.012-.088-.019-.131A6.332 6.332 0 0 1 6 13.002V13c0-1.603.624-3.109 1.758-4.242A5.944 5.944 0 0 1 11 7.089V10l5-4-5-4v3.069a7.917 7.917 0 0 0-4.656 2.275A7.936 7.936 0 0 0 4 12.999v.009c0 .253.014.504.037.753.007.076.021.15.03.227.021.172.044.345.076.516.019.1.044.196.066.295.032.142.065.283.105.423.032.112.07.223.107.333.026.079.047.159.076.237l.008-.003A7.948 7.948 0 0 0 5.6 17.785l-.007.005c.021.028.049.053.07.081.211.272.433.538.681.785a8.236 8.236 0 0 0 .966.816c.265.192.537.372.821.529l.028.019.001-.001a7.877 7.877 0 0 0 2.136.795l-.001.005.053.009c.201.042.405.071.61.098.069.009.138.023.207.03a8.038 8.038 0 0 0 2.532-.137l-.424-1.955a6.11 6.11 0 0 1-1.904.102z"}}]})(e)}function tV(e){return it({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M11 6H9v3H6v2h3v3h2v-3h3V9h-3z"}},{tag:"path",attr:{d:"M10 2c-4.411 0-8 3.589-8 8s3.589 8 8 8a7.952 7.952 0 0 0 4.897-1.688l4.396 4.396 1.414-1.414-4.396-4.396A7.952 7.952 0 0 0 18 10c0-4.411-3.589-8-8-8zm0 14c-3.309 0-6-2.691-6-6s2.691-6 6-6 6 2.691 6 6-2.691 6-6 6z"}}]})(e)}function nV(e){return it({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M6 9h8v2H6z"}},{tag:"path",attr:{d:"M10 18a7.952 7.952 0 0 0 4.897-1.688l4.396 4.396 1.414-1.414-4.396-4.396A7.952 7.952 0 0 0 18 10c0-4.411-3.589-8-8-8s-8 3.589-8 8 3.589 8 8 8zm0-14c3.309 0 6 2.691 6 6s-2.691 6-6 6-6-2.691-6-6 2.691-6 6-6z"}}]})(e)}const Gu={mt:1.5,fontSize:"2xs"},rV=e=>{const[t,n]=p.useState(!1),{label:r,value:o,min:s=1,max:a=100,step:c=1,onChange:d,tooltipSuffix:f="",withSliderMarks:h=!1,withInput:m=!1,isInteger:v=!1,inputWidth:y=16,inputReadOnly:S=!1,withReset:x=!1,hideTooltip:w=!1,isCompact:_=!1,isDisabled:k=!1,sliderMarks:P,handleReset:j,sliderFormControlProps:I,sliderFormLabelProps:O,sliderMarkProps:T,sliderTrackProps:R,sliderThumbProps:M,sliderNumberInputProps:D,sliderNumberInputFieldProps:A,sliderNumberInputStepperProps:G,sliderTooltipProps:$,sliderIAIIconButtonProps:H,...U}=e,{t:q}=we(),[z,L]=p.useState(String(o));p.useEffect(()=>{L(o)},[o]);const V=p.useMemo(()=>D!=null&&D.max?D.max:a,[a,D==null?void 0:D.max]),W=p.useCallback(B=>{d(B)},[d]),te=p.useCallback(B=>{B.target.value===""&&(B.target.value=String(s));const oe=Ks(v?Math.floor(Number(B.target.value)):Number(z),s,V),le=od(oe,c);d(le),L(le)},[v,z,s,V,d,c]),fe=p.useCallback(B=>{L(B)},[]),ae=p.useCallback(()=>{j&&j()},[j]),J=p.useCallback(B=>{B.target instanceof HTMLDivElement&&B.target.focus()},[]);return i.jsxs(ar,{onClick:J,sx:_?{display:"flex",flexDirection:"row",alignItems:"center",columnGap:4,margin:0,padding:0}:{},isDisabled:k,...I,children:[r&&i.jsx(hr,{...O,mb:-1,children:r}),i.jsxs(ya,{w:"100%",gap:2,alignItems:"center",children:[i.jsxs(cj,{"aria-label":r,value:o,min:s,max:a,step:c,onChange:W,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),focusThumbOnChange:!1,isDisabled:k,...U,children:[h&&!P&&i.jsxs(i.Fragment,{children:[i.jsx(Sc,{value:s,sx:{insetInlineStart:"0 !important",insetInlineEnd:"unset !important",...Gu},...T,children:s}),i.jsx(Sc,{value:a,sx:{insetInlineStart:"unset !important",insetInlineEnd:"0 !important",...Gu},...T,children:a})]}),h&&P&&i.jsx(i.Fragment,{children:P.map((B,oe)=>oe===0?i.jsx(Sc,{value:B,sx:{insetInlineStart:"0 !important",insetInlineEnd:"unset !important",...Gu},...T,children:B},B):oe===P.length-1?i.jsx(Sc,{value:B,sx:{insetInlineStart:"unset !important",insetInlineEnd:"0 !important",...Gu},...T,children:B},B):i.jsx(Sc,{value:B,sx:{...Gu},...T,children:B},B))}),i.jsx(dj,{...R,children:i.jsx(fj,{})}),i.jsx(Wn,{hasArrow:!0,placement:"top",isOpen:t,label:`${o}${f}`,hidden:w,...$,children:i.jsx(uj,{...M,zIndex:0})})]}),m&&i.jsxs(vg,{min:s,max:V,step:c,value:z,onChange:fe,onBlur:te,focusInputOnChange:!1,...D,children:[i.jsx(bg,{readOnly:S,minWidth:y,...A}),i.jsxs(yg,{...G,children:[i.jsx(wg,{onClick:()=>d(Number(z))}),i.jsx(xg,{onClick:()=>d(Number(z))})]})]}),x&&i.jsx(Ne,{size:"sm","aria-label":q("accessibility.reset"),tooltip:q("accessibility.reset"),icon:i.jsx(Nj,{}),isDisabled:k,onClick:ae,...H})]})]})},Et=p.memo(rV);/*!
* OverlayScrollbars
* Version: 2.2.0
*
* Copyright (c) Rene Haas | KingSora.
* https://github.com/KingSora
*
* Released under the MIT license.
*/function Mn(e,t){if(Tg(e))for(let n=0;n<e.length&&t(e[n],n,e)!==!1;n++);else e&&Mn(Object.keys(e),n=>t(e[n],n,e));return e}function lo(e,t){const n=Yi(t);if(Qs(t)||n){let o=n?"":{};if(e){const s=window.getComputedStyle(e,null);o=n?OC(e,s,t):t.reduce((a,c)=>(a[c]=OC(e,s,c),a),o)}return o}e&&Mn(Ko(t),o=>bV(e,o,t[o]))}const zs=(e,t)=>{const{o:n,u:r,_:o}=e;let s=n,a;const c=(h,m)=>{const v=s,y=h,S=m||(r?!r(v,y):v!==y);return(S||o)&&(s=y,a=v),[s,S,a]};return[t?h=>c(t(s,a),h):c,h=>[s,!!h,a]]},yf=()=>typeof window<"u",zj=yf()&&Node.ELEMENT_NODE,{toString:oV,hasOwnProperty:N0}=Object.prototype,ii=e=>e===void 0,Og=e=>e===null,sV=e=>ii(e)||Og(e)?`${e}`:oV.call(e).replace(/^\[object (.+)\]$/,"$1").toLowerCase(),Di=e=>typeof e=="number",Yi=e=>typeof e=="string",Kb=e=>typeof e=="boolean",Zs=e=>typeof e=="function",Qs=e=>Array.isArray(e),Ad=e=>typeof e=="object"&&!Qs(e)&&!Og(e),Tg=e=>{const t=!!e&&e.length,n=Di(t)&&t>-1&&t%1==0;return Qs(e)||!Zs(e)&&n?t>0&&Ad(e)?t-1 in e:!0:!1},ry=e=>{if(!e||!Ad(e)||sV(e)!=="object")return!1;let t;const n="constructor",r=e[n],o=r&&r.prototype,s=N0.call(e,n),a=o&&N0.call(o,"isPrototypeOf");if(r&&!s&&!a)return!1;for(t in e);return ii(t)||N0.call(e,t)},Bh=e=>{const t=HTMLElement;return e?t?e instanceof t:e.nodeType===zj:!1},Rg=e=>{const t=Element;return e?t?e instanceof t:e.nodeType===zj:!1},Xb=(e,t,n)=>e.indexOf(t,n),Vn=(e,t,n)=>(!n&&!Yi(t)&&Tg(t)?Array.prototype.push.apply(e,t):e.push(t),e),Ml=e=>{const t=Array.from,n=[];return t&&e?t(e):(e instanceof Set?e.forEach(r=>{Vn(n,r)}):Mn(e,r=>{Vn(n,r)}),n)},Zb=e=>!!e&&e.length===0,Ea=(e,t,n)=>{Mn(e,o=>o&&o.apply(void 0,t||[])),!n&&(e.length=0)},Mg=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Ko=e=>e?Object.keys(e):[],Cr=(e,t,n,r,o,s,a)=>{const c=[t,n,r,o,s,a];return(typeof e!="object"||Og(e))&&!Zs(e)&&(e={}),Mn(c,d=>{Mn(Ko(d),f=>{const h=d[f];if(e===h)return!0;const m=Qs(h);if(h&&(ry(h)||m)){const v=e[f];let y=v;m&&!Qs(v)?y=[]:!m&&!ry(v)&&(y={}),e[f]=Cr(y,h)}else e[f]=h})}),e},Qb=e=>{for(const t in e)return!1;return!0},$j=(e,t,n,r)=>{if(ii(r))return n?n[e]:t;n&&(Yi(r)||Di(r))&&(n[e]=r)},ao=(e,t,n)=>{if(ii(n))return e?e.getAttribute(t):null;e&&e.setAttribute(t,n)},Po=(e,t)=>{e&&e.removeAttribute(t)},Cl=(e,t,n,r)=>{if(n){const o=ao(e,t)||"",s=new Set(o.split(" "));s[r?"add":"delete"](n);const a=Ml(s).join(" ").trim();ao(e,t,a)}},aV=(e,t,n)=>{const r=ao(e,t)||"";return new Set(r.split(" ")).has(n)},Hs=(e,t)=>$j("scrollLeft",0,e,t),Fa=(e,t)=>$j("scrollTop",0,e,t),oy=yf()&&Element.prototype,Lj=(e,t)=>{const n=[],r=t?Rg(t)?t:null:document;return r?Vn(n,r.querySelectorAll(e)):n},iV=(e,t)=>{const n=t?Rg(t)?t:null:document;return n?n.querySelector(e):null},Fh=(e,t)=>Rg(e)?(oy.matches||oy.msMatchesSelector).call(e,t):!1,Jb=e=>e?Ml(e.childNodes):[],Za=e=>e?e.parentElement:null,Pc=(e,t)=>{if(Rg(e)){const n=oy.closest;if(n)return n.call(e,t);do{if(Fh(e,t))return e;e=Za(e)}while(e)}return null},lV=(e,t,n)=>{const r=e&&Pc(e,t),o=e&&iV(n,r),s=Pc(o,t)===r;return r&&o?r===e||o===e||s&&Pc(Pc(e,n),t)!==r:!1},ex=(e,t,n)=>{if(n&&e){let r=t,o;Tg(n)?(o=document.createDocumentFragment(),Mn(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)}},vs=(e,t)=>{ex(e,null,t)},cV=(e,t)=>{ex(Za(e),e,t)},jC=(e,t)=>{ex(Za(e),e&&e.nextSibling,t)},Sa=e=>{if(Tg(e))Mn(Ml(e),t=>Sa(t));else if(e){const t=Za(e);t&&t.removeChild(e)}},_l=e=>{const t=document.createElement("div");return e&&ao(t,"class",e),t},Bj=e=>{const t=_l();return t.innerHTML=e.trim(),Mn(Jb(t),n=>Sa(n))},sy=e=>e.charAt(0).toUpperCase()+e.slice(1),uV=()=>_l().style,dV=["-webkit-","-moz-","-o-","-ms-"],fV=["WebKit","Moz","O","MS","webkit","moz","o","ms"],z0={},$0={},pV=e=>{let t=$0[e];if(Mg($0,e))return t;const n=sy(e),r=uV();return Mn(dV,o=>{const s=o.replace(/-/g,"");return!(t=[e,o+e,s+n,sy(s)+n].find(c=>r[c]!==void 0))}),$0[e]=t||""},bf=e=>{if(yf()){let t=z0[e]||window[e];return Mg(z0,e)||(Mn(fV,n=>(t=t||window[n+sy(e)],!t)),z0[e]=t),t}},hV=bf("MutationObserver"),EC=bf("IntersectionObserver"),jc=bf("ResizeObserver"),Fj=bf("cancelAnimationFrame"),Hj=bf("requestAnimationFrame"),Hh=yf()&&window.setTimeout,ay=yf()&&window.clearTimeout,mV=/[^\x20\t\r\n\f]+/g,Vj=(e,t,n)=>{const r=e&&e.classList;let o,s=0,a=!1;if(r&&t&&Yi(t)){const c=t.match(mV)||[];for(a=c.length>0;o=c[s++];)a=!!n(r,o)&&a}return a},tx=(e,t)=>{Vj(e,t,(n,r)=>n.remove(r))},Ha=(e,t)=>(Vj(e,t,(n,r)=>n.add(r)),tx.bind(0,e,t)),Dg=(e,t,n,r)=>{if(e&&t){let o=!0;return Mn(n,s=>{const a=r?r(e[s]):e[s],c=r?r(t[s]):t[s];a!==c&&(o=!1)}),o}return!1},Wj=(e,t)=>Dg(e,t,["w","h"]),Uj=(e,t)=>Dg(e,t,["x","y"]),gV=(e,t)=>Dg(e,t,["t","r","b","l"]),IC=(e,t,n)=>Dg(e,t,["width","height"],n&&(r=>Math.round(r))),gs=()=>{},Cc=e=>{let t;const n=e?Hh:Hj,r=e?ay:Fj;return[o=>{r(t),t=n(o,Zs(e)?e():e)},()=>r(t)]},nx=(e,t)=>{let n,r,o,s=gs;const{v:a,g:c,p:d}=t||{},f=function(S){s(),ay(n),n=r=void 0,s=gs,e.apply(this,S)},h=y=>d&&r?d(r,y):y,m=()=>{s!==gs&&f(h(o)||o)},v=function(){const S=Ml(arguments),x=Zs(a)?a():a;if(Di(x)&&x>=0){const _=Zs(c)?c():c,k=Di(_)&&_>=0,P=x>0?Hh:Hj,j=x>0?ay:Fj,O=h(S)||S,T=f.bind(0,O);s();const R=P(T,x);s=()=>j(R),k&&!n&&(n=Hh(m,_)),r=o=O}else f(S)};return v.m=m,v},vV={opacity:1,zindex:1},vp=(e,t)=>{const n=t?parseFloat(e):parseInt(e,10);return n===n?n:0},yV=(e,t)=>!vV[e.toLowerCase()]&&Di(t)?`${t}px`:t,OC=(e,t,n)=>t!=null?t[n]||t.getPropertyValue(n):e.style[n],bV=(e,t,n)=>{try{const{style:r}=e;ii(r[t])?r.setProperty(t,n):r[t]=yV(t,n)}catch{}},Nd=e=>lo(e,"direction")==="rtl",TC=(e,t,n)=>{const r=t?`${t}-`:"",o=n?`-${n}`:"",s=`${r}top${o}`,a=`${r}right${o}`,c=`${r}bottom${o}`,d=`${r}left${o}`,f=lo(e,[s,a,c,d]);return{t:vp(f[s],!0),r:vp(f[a],!0),b:vp(f[c],!0),l:vp(f[d],!0)}},{round:RC}=Math,rx={w:0,h:0},Dl=e=>e?{w:e.offsetWidth,h:e.offsetHeight}:rx,dh=e=>e?{w:e.clientWidth,h:e.clientHeight}:rx,Vh=e=>e?{w:e.scrollWidth,h:e.scrollHeight}:rx,Wh=e=>{const t=parseFloat(lo(e,"height"))||0,n=parseFloat(lo(e,"width"))||0;return{w:n-RC(n),h:t-RC(t)}},Oi=e=>e.getBoundingClientRect();let yp;const xV=()=>{if(ii(yp)){yp=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get(){yp=!0}}))}catch{}}return yp},Gj=e=>e.split(" "),wV=(e,t,n,r)=>{Mn(Gj(t),o=>{e.removeEventListener(o,n,r)})},Wr=(e,t,n,r)=>{var o;const s=xV(),a=(o=s&&r&&r.S)!=null?o:s,c=r&&r.$||!1,d=r&&r.C||!1,f=[],h=s?{passive:a,capture:c}:c;return Mn(Gj(t),m=>{const v=d?y=>{e.removeEventListener(m,v,c),n&&n(y)}:n;Vn(f,wV.bind(null,e,m,v,c)),e.addEventListener(m,v,h)}),Ea.bind(0,f)},qj=e=>e.stopPropagation(),Yj=e=>e.preventDefault(),SV={x:0,y:0},L0=e=>{const t=e?Oi(e):0;return t?{x:t.left+window.pageYOffset,y:t.top+window.pageXOffset}:SV},MC=(e,t)=>{Mn(Qs(t)?t:[t],e)},ox=e=>{const t=new Map,n=(s,a)=>{if(s){const c=t.get(s);MC(d=>{c&&c[d?"delete":"clear"](d)},a)}else t.forEach(c=>{c.clear()}),t.clear()},r=(s,a)=>{if(Yi(s)){const f=t.get(s)||new Set;return t.set(s,f),MC(h=>{Zs(h)&&f.add(h)},a),n.bind(0,s,a)}Kb(a)&&a&&n();const c=Ko(s),d=[];return Mn(c,f=>{const h=s[f];h&&Vn(d,r(f,h))}),Ea.bind(0,d)},o=(s,a)=>{const c=t.get(s);Mn(Ml(c),d=>{a&&!Zb(a)?d.apply(0,a):d()})};return r(e||{}),[r,n,o]},DC=e=>JSON.stringify(e,(t,n)=>{if(Zs(n))throw new Error;return n}),CV={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"]}},Kj=(e,t)=>{const n={},r=Ko(t).concat(Ko(e));return Mn(r,o=>{const s=e[o],a=t[o];if(Ad(s)&&Ad(a))Cr(n[o]={},Kj(s,a)),Qb(n[o])&&delete n[o];else if(Mg(t,o)&&a!==s){let c=!0;if(Qs(s)||Qs(a))try{DC(s)===DC(a)&&(c=!1)}catch{}c&&(n[o]=a)}}),n},Xj="os-environment",Zj=`${Xj}-flexbox-glue`,_V=`${Zj}-max`,Qj="os-scrollbar-hidden",B0="data-overlayscrollbars-initialize",$s="data-overlayscrollbars",Jj=`${$s}-overflow-x`,eE=`${$s}-overflow-y`,Fc="overflowVisible",kV="scrollbarHidden",AC="scrollbarPressed",Uh="updating",ki="data-overlayscrollbars-viewport",F0="arrange",tE="scrollbarHidden",Hc=Fc,iy="data-overlayscrollbars-padding",PV=Hc,NC="data-overlayscrollbars-content",sx="os-size-observer",jV=`${sx}-appear`,EV=`${sx}-listener`,IV="os-trinsic-observer",OV="os-no-css-vars",TV="os-theme-none",$o="os-scrollbar",RV=`${$o}-rtl`,MV=`${$o}-horizontal`,DV=`${$o}-vertical`,nE=`${$o}-track`,ax=`${$o}-handle`,AV=`${$o}-visible`,NV=`${$o}-cornerless`,zC=`${$o}-transitionless`,$C=`${$o}-interaction`,LC=`${$o}-unusable`,BC=`${$o}-auto-hidden`,FC=`${$o}-wheel`,zV=`${nE}-interactive`,$V=`${ax}-interactive`,rE={},Al=()=>rE,LV=e=>{const t=[];return Mn(Qs(e)?e:[e],n=>{const r=Ko(n);Mn(r,o=>{Vn(t,rE[o]=n[o])})}),t},BV="__osOptionsValidationPlugin",FV="__osSizeObserverPlugin",ix="__osScrollbarsHidingPlugin",HV="__osClickScrollPlugin";let H0;const HC=(e,t,n,r)=>{vs(e,t);const o=dh(t),s=Dl(t),a=Wh(n);return r&&Sa(t),{x:s.h-o.h+a.h,y:s.w-o.w+a.w}},VV=e=>{let t=!1;const n=Ha(e,Qj);try{t=lo(e,pV("scrollbar-width"))==="none"||window.getComputedStyle(e,"::-webkit-scrollbar").getPropertyValue("display")==="none"}catch{}return n(),t},WV=(e,t)=>{const n="hidden";lo(e,{overflowX:n,overflowY:n,direction:"rtl"}),Hs(e,0);const r=L0(e),o=L0(t);Hs(e,-999);const s=L0(t);return{i:r.x===o.x,n:o.x!==s.x}},UV=(e,t)=>{const n=Ha(e,Zj),r=Oi(e),o=Oi(t),s=IC(o,r,!0),a=Ha(e,_V),c=Oi(e),d=Oi(t),f=IC(d,c,!0);return n(),a(),s&&f},GV=()=>{const{body:e}=document,n=Bj(`<div class="${Xj}"><div></div></div>`)[0],r=n.firstChild,[o,,s]=ox(),[a,c]=zs({o:HC(e,n,r),u:Uj},HC.bind(0,e,n,r,!0)),[d]=c(),f=VV(n),h={x:d.x===0,y:d.y===0},m={elements:{host:null,padding:!f,viewport:k=>f&&k===k.ownerDocument.body&&k,content:!1},scrollbars:{slot:!0},cancel:{nativeScrollbarsOverlaid:!1,body:null}},v=Cr({},CV),y=Cr.bind(0,{},v),S=Cr.bind(0,{},m),x={k:d,A:h,I:f,L:lo(n,"zIndex")==="-1",B:WV(n,r),V:UV(n,r),Y:o.bind(0,"z"),j:o.bind(0,"r"),N:S,q:k=>Cr(m,k)&&S(),F:y,G:k=>Cr(v,k)&&y(),X:Cr({},m),U:Cr({},v)},w=window.addEventListener,_=nx(k=>s(k?"z":"r"),{v:33,g:99});if(Po(n,"style"),Sa(n),w("resize",_.bind(0,!1)),!f&&(!h.x||!h.y)){let k;w("resize",()=>{const P=Al()[ix];k=k||P&&P.R(),k&&k(x,a,_.bind(0,!0))})}return x},Lo=()=>(H0||(H0=GV()),H0),lx=(e,t)=>Zs(t)?t.apply(0,e):t,qV=(e,t,n,r)=>{const o=ii(r)?n:r;return lx(e,o)||t.apply(0,e)},oE=(e,t,n,r)=>{const o=ii(r)?n:r,s=lx(e,o);return!!s&&(Bh(s)?s:t.apply(0,e))},YV=(e,t,n)=>{const{nativeScrollbarsOverlaid:r,body:o}=n||{},{A:s,I:a}=Lo(),{nativeScrollbarsOverlaid:c,body:d}=t,f=r??c,h=ii(o)?d:o,m=(s.x||s.y)&&f,v=e&&(Og(h)?!a:h);return!!m||!!v},cx=new WeakMap,KV=(e,t)=>{cx.set(e,t)},XV=e=>{cx.delete(e)},sE=e=>cx.get(e),VC=(e,t)=>e?t.split(".").reduce((n,r)=>n&&Mg(n,r)?n[r]:void 0,e):void 0,ly=(e,t,n)=>r=>[VC(e,r),n||VC(t,r)!==void 0],aE=e=>{let t=e;return[()=>t,n=>{t=Cr({},t,n)}]},bp="tabindex",xp=_l.bind(0,""),V0=e=>{vs(Za(e),Jb(e)),Sa(e)},ZV=e=>{const t=Lo(),{N:n,I:r}=t,o=Al()[ix],s=o&&o.T,{elements:a}=n(),{host:c,padding:d,viewport:f,content:h}=a,m=Bh(e),v=m?{}:e,{elements:y}=v,{host:S,padding:x,viewport:w,content:_}=y||{},k=m?e:v.target,P=Fh(k,"textarea"),j=k.ownerDocument,I=j.documentElement,O=k===j.body,T=j.defaultView,R=qV.bind(0,[k]),M=oE.bind(0,[k]),D=lx.bind(0,[k]),A=R.bind(0,xp,f),G=M.bind(0,xp,h),$=A(w),H=$===k,U=H&&O,q=!H&&G(_),z=!H&&Bh($)&&$===q,L=z&&!!D(h),V=L?A():$,W=L?q:G(),fe=U?I:z?V:$,ae=P?R(xp,c,S):k,J=U?fe:ae,B=z?W:q,oe=j.activeElement,le=!H&&T.top===T&&oe===k,ge={W:k,Z:J,J:fe,K:!H&&M(xp,d,x),tt:B,nt:!H&&!r&&s&&s(t),ot:U?I:fe,st:U?j:fe,et:T,ct:j,rt:P,it:O,lt:m,ut:H,dt:z,ft:(K,Ce)=>aV(fe,H?$s:ki,H?Ce:K),_t:(K,Ce,ne)=>Cl(fe,H?$s:ki,H?Ce:K,ne)},se=Ko(ge).reduce((K,Ce)=>{const ne=ge[Ce];return Vn(K,ne&&!Za(ne)?ne:!1)},[]),pe=K=>K?Xb(se,K)>-1:null,{W:ue,Z:be,K:ke,J:ie,tt:Pe,nt:Je}=ge,Ae=[()=>{Po(be,$s),Po(be,B0),Po(ue,B0),O&&(Po(I,$s),Po(I,B0))}],Ve=P&&pe(be);let kt=P?ue:Jb([Pe,ie,ke,be,ue].find(K=>pe(K)===!1));const ft=U?ue:Pe||ie;return[ge,()=>{ao(be,$s,H?"viewport":"host"),ao(ke,iy,""),ao(Pe,NC,""),H||ao(ie,ki,"");const K=O&&!H?Ha(Za(k),Qj):gs;if(Ve&&(jC(ue,be),Vn(Ae,()=>{jC(be,ue),Sa(be)})),vs(ft,kt),vs(be,ke),vs(ke||be,!H&&ie),vs(ie,Pe),Vn(Ae,()=>{K(),Po(ke,iy),Po(Pe,NC),Po(ie,Jj),Po(ie,eE),Po(ie,ki),pe(Pe)&&V0(Pe),pe(ie)&&V0(ie),pe(ke)&&V0(ke)}),r&&!H&&(Cl(ie,ki,tE,!0),Vn(Ae,Po.bind(0,ie,ki))),Je&&(cV(ie,Je),Vn(Ae,Sa.bind(0,Je))),le){const Ce=ao(ie,bp);ao(ie,bp,"-1"),ie.focus();const ne=()=>Ce?ao(ie,bp,Ce):Po(ie,bp),me=Wr(j,"pointerdown keydown",()=>{ne(),me()});Vn(Ae,[ne,me])}else oe&&oe.focus&&oe.focus();kt=0},Ea.bind(0,Ae)]},QV=(e,t)=>{const{tt:n}=e,[r]=t;return o=>{const{V:s}=Lo(),{ht:a}=r(),{vt:c}=o,d=(n||!s)&&c;return d&&lo(n,{height:a?"":"100%"}),{gt:d,wt:d}}},JV=(e,t)=>{const[n,r]=t,{Z:o,K:s,J:a,ut:c}=e,[d,f]=zs({u:gV,o:TC()},TC.bind(0,o,"padding",""));return(h,m,v)=>{let[y,S]=f(v);const{I:x,V:w}=Lo(),{bt:_}=n(),{gt:k,wt:P,yt:j}=h,[I,O]=m("paddingAbsolute");(k||S||!w&&P)&&([y,S]=d(v));const R=!c&&(O||j||S);if(R){const M=!I||!s&&!x,D=y.r+y.l,A=y.t+y.b,G={marginRight:M&&!_?-D:0,marginBottom:M?-A:0,marginLeft:M&&_?-D:0,top:M?-y.t:0,right:M?_?-y.r:"auto":0,left:M?_?"auto":-y.l:0,width:M?`calc(100% + ${D}px)`:""},$={paddingTop:M?y.t:0,paddingRight:M?y.r:0,paddingBottom:M?y.b:0,paddingLeft:M?y.l:0};lo(s||a,G),lo(a,$),r({K:y,St:!M,P:s?$:Cr({},G,$)})}return{xt:R}}},{max:cy}=Math,Pi=cy.bind(0,0),iE="visible",WC="hidden",eW=42,wp={u:Wj,o:{w:0,h:0}},tW={u:Uj,o:{x:WC,y:WC}},nW=(e,t)=>{const n=window.devicePixelRatio%1!==0?1:0,r={w:Pi(e.w-t.w),h:Pi(e.h-t.h)};return{w:r.w>n?r.w:0,h:r.h>n?r.h:0}},Sp=e=>e.indexOf(iE)===0,rW=(e,t)=>{const[n,r]=t,{Z:o,K:s,J:a,nt:c,ut:d,_t:f,it:h,et:m}=e,{k:v,V:y,I:S,A:x}=Lo(),w=Al()[ix],_=!d&&!S&&(x.x||x.y),k=h&&d,[P,j]=zs(wp,Wh.bind(0,a)),[I,O]=zs(wp,Vh.bind(0,a)),[T,R]=zs(wp),[M,D]=zs(wp),[A]=zs(tW),G=(L,V)=>{if(lo(a,{height:""}),V){const{St:W,K:te}=n(),{$t:fe,D:ae}=L,J=Wh(o),B=dh(o),oe=lo(a,"boxSizing")==="content-box",le=W||oe?te.b+te.t:0,ge=!(x.x&&oe);lo(a,{height:B.h+J.h+(fe.x&&ge?ae.x:0)-le})}},$=(L,V)=>{const W=!S&&!L?eW:0,te=(pe,ue,be)=>{const ke=lo(a,pe),Pe=(V?V[pe]:ke)==="scroll";return[ke,Pe,Pe&&!S?ue?W:be:0,ue&&!!W]},[fe,ae,J,B]=te("overflowX",x.x,v.x),[oe,le,ge,se]=te("overflowY",x.y,v.y);return{Ct:{x:fe,y:oe},$t:{x:ae,y:le},D:{x:J,y:ge},M:{x:B,y:se}}},H=(L,V,W,te)=>{const fe=(le,ge)=>{const se=Sp(le),pe=ge&&se&&le.replace(`${iE}-`,"")||"";return[ge&&!se?le:"",Sp(pe)?"hidden":pe]},[ae,J]=fe(W.x,V.x),[B,oe]=fe(W.y,V.y);return te.overflowX=J&&B?J:ae,te.overflowY=oe&&ae?oe:B,$(L,te)},U=(L,V,W,te)=>{const{D:fe,M:ae}=L,{x:J,y:B}=ae,{x:oe,y:le}=fe,{P:ge}=n(),se=V?"marginLeft":"marginRight",pe=V?"paddingLeft":"paddingRight",ue=ge[se],be=ge.marginBottom,ke=ge[pe],ie=ge.paddingBottom;te.width=`calc(100% + ${le+-1*ue}px)`,te[se]=-le+ue,te.marginBottom=-oe+be,W&&(te[pe]=ke+(B?le:0),te.paddingBottom=ie+(J?oe:0))},[q,z]=w?w.H(_,y,a,c,n,$,U):[()=>_,()=>[gs]];return(L,V,W)=>{const{gt:te,Ot:fe,wt:ae,xt:J,vt:B,yt:oe}=L,{ht:le,bt:ge}=n(),[se,pe]=V("showNativeOverlaidScrollbars"),[ue,be]=V("overflow"),ke=se&&x.x&&x.y,ie=!d&&!y&&(te||ae||fe||pe||B),Pe=Sp(ue.x),Je=Sp(ue.y),Ae=Pe||Je;let Ve=j(W),kt=O(W),ft=R(W),yn=D(W),K;if(pe&&S&&f(tE,kV,!ke),ie&&(K=$(ke),G(K,le)),te||J||ae||oe||pe){Ae&&f(Hc,Fc,!1);const[Ee,qe]=z(ke,ge,K),[pt,gt]=Ve=P(W),[Ht,yr]=kt=I(W),hn=dh(a);let mn=Ht,Tr=hn;Ee(),(yr||gt||pe)&&qe&&!ke&&q(qe,Ht,pt,ge)&&(Tr=dh(a),mn=Vh(a));const $n={w:Pi(cy(Ht.w,mn.w)+pt.w),h:Pi(cy(Ht.h,mn.h)+pt.h)},Fn={w:Pi((k?m.innerWidth:Tr.w+Pi(hn.w-Ht.w))+pt.w),h:Pi((k?m.innerHeight+pt.h:Tr.h+Pi(hn.h-Ht.h))+pt.h)};yn=M(Fn),ft=T(nW($n,Fn),W)}const[Ce,ne]=yn,[me,Re]=ft,[Ye,ye]=kt,[lt,It]=Ve,Xt={x:me.w>0,y:me.h>0},$e=Pe&&Je&&(Xt.x||Xt.y)||Pe&&Xt.x&&!Xt.y||Je&&Xt.y&&!Xt.x;if(J||oe||It||ye||ne||Re||be||pe||ie){const Ee={marginRight:0,marginBottom:0,marginLeft:0,width:"",overflowY:"",overflowX:""},qe=H(ke,Xt,ue,Ee),pt=q(qe,Ye,lt,ge);d||U(qe,ge,pt,Ee),ie&&G(qe,le),d?(ao(o,Jj,Ee.overflowX),ao(o,eE,Ee.overflowY)):lo(a,Ee)}Cl(o,$s,Fc,$e),Cl(s,iy,PV,$e),d||Cl(a,ki,Hc,Ae);const[Ke,Cn]=A($(ke).Ct);return r({Ct:Ke,zt:{x:Ce.w,y:Ce.h},Tt:{x:me.w,y:me.h},Et:Xt}),{It:Cn,At:ne,Lt:Re}}},UC=(e,t,n)=>{const r={},o=t||{},s=Ko(e).concat(Ko(o));return Mn(s,a=>{const c=e[a],d=o[a];r[a]=!!(n||c||d)}),r},oW=(e,t)=>{const{W:n,J:r,_t:o,ut:s}=e,{I:a,A:c,V:d}=Lo(),f=!a&&(c.x||c.y),h=[QV(e,t),JV(e,t),rW(e,t)];return(m,v,y)=>{const S=UC(Cr({gt:!1,xt:!1,yt:!1,vt:!1,At:!1,Lt:!1,It:!1,Ot:!1,wt:!1},v),{},y),x=f||!d,w=x&&Hs(r),_=x&&Fa(r);o("",Uh,!0);let k=S;return Mn(h,P=>{k=UC(k,P(k,m,!!y)||{},y)}),Hs(r,w),Fa(r,_),o("",Uh),s||(Hs(n,0),Fa(n,0)),k}},sW=(e,t,n)=>{let r,o=!1;const s=()=>{o=!0},a=c=>{if(n){const d=n.reduce((f,h)=>{if(h){const[m,v]=h,y=v&&m&&(c?c(m):Lj(m,e));y&&y.length&&v&&Yi(v)&&Vn(f,[y,v.trim()],!0)}return f},[]);Mn(d,f=>Mn(f[0],h=>{const m=f[1],v=r.get(h)||[];if(e.contains(h)){const S=Wr(h,m,x=>{o?(S(),r.delete(h)):t(x)});r.set(h,Vn(v,S))}else Ea(v),r.delete(h)}))}};return n&&(r=new WeakMap,a()),[s,a]},GC=(e,t,n,r)=>{let o=!1;const{Ht:s,Pt:a,Dt:c,Mt:d,Rt:f,kt:h}=r||{},m=nx(()=>{o&&n(!0)},{v:33,g:99}),[v,y]=sW(e,m,c),S=s||[],x=a||[],w=S.concat(x),_=(P,j)=>{const I=f||gs,O=h||gs,T=new Set,R=new Set;let M=!1,D=!1;if(Mn(P,A=>{const{attributeName:G,target:$,type:H,oldValue:U,addedNodes:q,removedNodes:z}=A,L=H==="attributes",V=H==="childList",W=e===$,te=L&&Yi(G)?ao($,G):0,fe=te!==0&&U!==te,ae=Xb(x,G)>-1&&fe;if(t&&(V||!W)){const J=!L,B=L&&fe,oe=B&&d&&Fh($,d),ge=(oe?!I($,G,U,te):J||B)&&!O(A,!!oe,e,r);Mn(q,se=>T.add(se)),Mn(z,se=>T.add(se)),D=D||ge}!t&&W&&fe&&!I($,G,U,te)&&(R.add(G),M=M||ae)}),T.size>0&&y(A=>Ml(T).reduce((G,$)=>(Vn(G,Lj(A,$)),Fh($,A)?Vn(G,$):G),[])),t)return!j&&D&&n(!1),[!1];if(R.size>0||M){const A=[Ml(R),M];return!j&&n.apply(0,A),A}},k=new hV(P=>_(P));return k.observe(e,{attributes:!0,attributeOldValue:!0,attributeFilter:w,subtree:t,childList:t,characterData:t}),o=!0,[()=>{o&&(v(),k.disconnect(),o=!1)},()=>{if(o){m.m();const P=k.takeRecords();return!Zb(P)&&_(P,!0)}}]},Cp=3333333,_p=e=>e&&(e.height||e.width),lE=(e,t,n)=>{const{Bt:r=!1,Vt:o=!1}=n||{},s=Al()[FV],{B:a}=Lo(),d=Bj(`<div class="${sx}"><div class="${EV}"></div></div>`)[0],f=d.firstChild,h=Nd.bind(0,e),[m]=zs({o:void 0,_:!0,u:(x,w)=>!(!x||!_p(x)&&_p(w))}),v=x=>{const w=Qs(x)&&x.length>0&&Ad(x[0]),_=!w&&Kb(x[0]);let k=!1,P=!1,j=!0;if(w){const[I,,O]=m(x.pop().contentRect),T=_p(I),R=_p(O);k=!O||!T,P=!R&&T,j=!k}else _?[,j]=x:P=x===!0;if(r&&j){const I=_?x[0]:Nd(d);Hs(d,I?a.n?-Cp:a.i?0:Cp:Cp),Fa(d,Cp)}k||t({gt:!_,Yt:_?x:void 0,Vt:!!P})},y=[];let S=o?v:!1;return[()=>{Ea(y),Sa(d)},()=>{if(jc){const x=new jc(v);x.observe(f),Vn(y,()=>{x.disconnect()})}else if(s){const[x,w]=s.O(f,v,o);S=x,Vn(y,w)}if(r){const[x]=zs({o:void 0},h);Vn(y,Wr(d,"scroll",w=>{const _=x(),[k,P,j]=_;P&&(tx(f,"ltr rtl"),k?Ha(f,"rtl"):Ha(f,"ltr"),v([!!k,P,j])),qj(w)}))}S&&(Ha(d,jV),Vn(y,Wr(d,"animationstart",S,{C:!!jc}))),(jc||s)&&vs(e,d)}]},aW=e=>e.h===0||e.isIntersecting||e.intersectionRatio>0,iW=(e,t)=>{let n;const r=_l(IV),o=[],[s]=zs({o:!1}),a=(d,f)=>{if(d){const h=s(aW(d)),[,m]=h;if(m)return!f&&t(h),[h]}},c=(d,f)=>{if(d&&d.length>0)return a(d.pop(),f)};return[()=>{Ea(o),Sa(r)},()=>{if(EC)n=new EC(d=>c(d),{root:e}),n.observe(r),Vn(o,()=>{n.disconnect()});else{const d=()=>{const m=Dl(r);a(m)},[f,h]=lE(r,d);Vn(o,f),h(),d()}vs(e,r)},()=>{if(n)return c(n.takeRecords(),!0)}]},qC=`[${$s}]`,lW=`[${ki}]`,W0=["tabindex"],YC=["wrap","cols","rows"],U0=["id","class","style","open"],cW=(e,t,n)=>{let r,o,s;const{Z:a,J:c,tt:d,rt:f,ut:h,ft:m,_t:v}=e,{V:y}=Lo(),[S]=zs({u:Wj,o:{w:0,h:0}},()=>{const H=m(Hc,Fc),U=m(F0,""),q=U&&Hs(c),z=U&&Fa(c);v(Hc,Fc),v(F0,""),v("",Uh,!0);const L=Vh(d),V=Vh(c),W=Wh(c);return v(Hc,Fc,H),v(F0,"",U),v("",Uh),Hs(c,q),Fa(c,z),{w:V.w+L.w+W.w,h:V.h+L.h+W.h}}),x=f?YC:U0.concat(YC),w=nx(n,{v:()=>r,g:()=>o,p(H,U){const[q]=H,[z]=U;return[Ko(q).concat(Ko(z)).reduce((L,V)=>(L[V]=q[V]||z[V],L),{})]}}),_=H=>{Mn(H||W0,U=>{if(Xb(W0,U)>-1){const q=ao(a,U);Yi(q)?ao(c,U,q):Po(c,U)}})},k=(H,U)=>{const[q,z]=H,L={vt:z};return t({ht:q}),!U&&n(L),L},P=({gt:H,Yt:U,Vt:q})=>{const z=!H||q?n:w;let L=!1;if(U){const[V,W]=U;L=W,t({bt:V})}z({gt:H,yt:L})},j=(H,U)=>{const[,q]=S(),z={wt:q};return q&&!U&&(H?n:w)(z),z},I=(H,U,q)=>{const z={Ot:U};return U?!q&&w(z):h||_(H),z},[O,T,R]=d||!y?iW(a,k):[gs,gs,gs],[M,D]=h?[gs,gs]:lE(a,P,{Vt:!0,Bt:!0}),[A,G]=GC(a,!1,I,{Pt:U0,Ht:U0.concat(W0)}),$=h&&jc&&new jc(P.bind(0,{gt:!0}));return $&&$.observe(a),_(),[()=>{O(),M(),s&&s[0](),$&&$.disconnect(),A()},()=>{D(),T()},()=>{const H={},U=G(),q=R(),z=s&&s[1]();return U&&Cr(H,I.apply(0,Vn(U,!0))),q&&Cr(H,k.apply(0,Vn(q,!0))),z&&Cr(H,j.apply(0,Vn(z,!0))),H},H=>{const[U]=H("update.ignoreMutation"),[q,z]=H("update.attributes"),[L,V]=H("update.elementEvents"),[W,te]=H("update.debounce"),fe=V||z,ae=J=>Zs(U)&&U(J);if(fe&&(s&&(s[1](),s[0]()),s=GC(d||c,!0,j,{Ht:x.concat(q||[]),Dt:L,Mt:qC,kt:(J,B)=>{const{target:oe,attributeName:le}=J;return(!B&&le&&!h?lV(oe,qC,lW):!1)||!!Pc(oe,`.${$o}`)||!!ae(J)}})),te)if(w.m(),Qs(W)){const J=W[0],B=W[1];r=Di(J)&&J,o=Di(B)&&B}else Di(W)?(r=W,o=!1):(r=!1,o=!1)}]},KC={x:0,y:0},uW=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:KC,Tt:KC,Ct:{x:"hidden",y:"hidden"},Et:{x:!1,y:!1},ht:!1,bt:Nd(e.Z)}),dW=(e,t)=>{const n=ly(t,{}),[r,o,s]=ox(),[a,c,d]=ZV(e),f=aE(uW(a)),[h,m]=f,v=oW(a,f),y=(P,j,I)=>{const T=Ko(P).some(R=>P[R])||!Qb(j)||I;return T&&s("u",[P,j,I]),T},[S,x,w,_]=cW(a,m,P=>y(v(n,P),{},!1)),k=h.bind(0);return k.jt=P=>r("u",P),k.Nt=()=>{const{W:P,J:j}=a,I=Hs(P),O=Fa(P);x(),c(),Hs(j,I),Fa(j,O)},k.qt=a,[(P,j)=>{const I=ly(t,P,j);return _(I),y(v(I,w(),j),P,!!j)},k,()=>{o(),S(),d()}]},{round:XC}=Math,fW=e=>{const{width:t,height:n}=Oi(e),{w:r,h:o}=Dl(e);return{x:XC(t)/r||1,y:XC(n)/o||1}},pW=(e,t,n)=>{const r=t.scrollbars,{button:o,isPrimary:s,pointerType:a}=e,{pointers:c}=r;return o===0&&s&&r[n?"dragScroll":"clickScroll"]&&(c||[]).includes(a)},hW=(e,t)=>Wr(e,"mousedown",Wr.bind(0,t,"click",qj,{C:!0,$:!0}),{$:!0}),ZC="pointerup pointerleave pointercancel lostpointercapture",mW=(e,t,n,r,o,s,a)=>{const{B:c}=Lo(),{Ft:d,Gt:f,Xt:h}=r,m=`scroll${a?"Left":"Top"}`,v=`client${a?"X":"Y"}`,y=a?"width":"height",S=a?"left":"top",x=a?"w":"h",w=a?"x":"y",_=(k,P)=>j=>{const{Tt:I}=s(),O=Dl(f)[x]-Dl(d)[x],R=P*j/O*I[w],D=Nd(h)&&a?c.n||c.i?1:-1:1;o[m]=k+R*D};return Wr(f,"pointerdown",k=>{const P=Pc(k.target,`.${ax}`)===d,j=P?d:f;if(Cl(t,$s,AC,!0),pW(k,e,P)){const I=!P&&k.shiftKey,O=()=>Oi(d),T=()=>Oi(f),R=(V,W)=>(V||O())[S]-(W||T())[S],M=_(o[m]||0,1/fW(o)[w]),D=k[v],A=O(),G=T(),$=A[y],H=R(A,G)+$/2,U=D-G[S],q=P?0:U-H,z=V=>{Ea(L),j.releasePointerCapture(V.pointerId)},L=[Cl.bind(0,t,$s,AC),Wr(n,ZC,z),Wr(n,"selectstart",V=>Yj(V),{S:!1}),Wr(f,ZC,z),Wr(f,"pointermove",V=>{const W=V[v]-D;(P||I)&&M(q+W)})];if(I)M(q);else if(!P){const V=Al()[HV];V&&Vn(L,V.O(M,R,q,$,U))}j.setPointerCapture(k.pointerId)}})},gW=(e,t)=>(n,r,o,s,a,c)=>{const{Xt:d}=n,[f,h]=Cc(333),m=!!a.scrollBy;let v=!0;return Ea.bind(0,[Wr(d,"pointerenter",()=>{r($C,!0)}),Wr(d,"pointerleave pointercancel",()=>{r($C)}),Wr(d,"wheel",y=>{const{deltaX:S,deltaY:x,deltaMode:w}=y;m&&v&&w===0&&Za(d)===s&&a.scrollBy({left:S,top:x,behavior:"smooth"}),v=!1,r(FC,!0),f(()=>{v=!0,r(FC)}),Yj(y)},{S:!1,$:!0}),hW(d,o),mW(e,s,o,n,a,t,c),h])},{min:uy,max:QC,abs:vW,round:yW}=Math,cE=(e,t,n,r)=>{if(r){const c=n?"x":"y",{Tt:d,zt:f}=r,h=f[c],m=d[c];return QC(0,uy(1,h/(h+m)))}const o=n?"w":"h",s=Dl(e)[o],a=Dl(t)[o];return QC(0,uy(1,s/a))},bW=(e,t,n,r,o,s)=>{const{B:a}=Lo(),c=s?"x":"y",d=s?"Left":"Top",{Tt:f}=r,h=yW(f[c]),m=vW(n[`scroll${d}`]),v=s&&o,y=a.i?m:h-m,x=uy(1,(v?y:m)/h),w=cE(e,t,s);return 1/w*(1-w)*x},xW=(e,t,n)=>{const{N:r,L:o}=Lo(),{scrollbars:s}=r(),{slot:a}=s,{ct:c,W:d,Z:f,J:h,lt:m,ot:v,it:y,ut:S}=t,{scrollbars:x}=m?{}:e,{slot:w}=x||{},_=oE([d,f,h],()=>S&&y?d:f,a,w),k=(q,z,L)=>{const V=L?Ha:tx;Mn(q,W=>{V(W.Xt,z)})},P=(q,z)=>{Mn(q,L=>{const[V,W]=z(L);lo(V,W)})},j=(q,z,L)=>{P(q,V=>{const{Ft:W,Gt:te}=V;return[W,{[L?"width":"height"]:`${(100*cE(W,te,L,z)).toFixed(3)}%`}]})},I=(q,z,L)=>{const V=L?"X":"Y";P(q,W=>{const{Ft:te,Gt:fe,Xt:ae}=W,J=bW(te,fe,v,z,Nd(ae),L);return[te,{transform:J===J?`translate${V}(${(100*J).toFixed(3)}%)`:""}]})},O=[],T=[],R=[],M=(q,z,L)=>{const V=Kb(L),W=V?L:!0,te=V?!L:!0;W&&k(T,q,z),te&&k(R,q,z)},D=q=>{j(T,q,!0),j(R,q)},A=q=>{I(T,q,!0),I(R,q)},G=q=>{const z=q?MV:DV,L=q?T:R,V=Zb(L)?zC:"",W=_l(`${$o} ${z} ${V}`),te=_l(nE),fe=_l(ax),ae={Xt:W,Gt:te,Ft:fe};return o||Ha(W,OV),vs(W,te),vs(te,fe),Vn(L,ae),Vn(O,[Sa.bind(0,W),n(ae,M,c,f,v,q)]),ae},$=G.bind(0,!0),H=G.bind(0,!1),U=()=>{vs(_,T[0].Xt),vs(_,R[0].Xt),Hh(()=>{M(zC)},300)};return $(),H(),[{Ut:D,Wt:A,Zt:M,Jt:{Kt:T,Qt:$,tn:P.bind(0,T)},nn:{Kt:R,Qt:H,tn:P.bind(0,R)}},U,Ea.bind(0,O)]},wW=(e,t,n,r)=>{let o,s,a,c,d,f=0;const h=aE({}),[m]=h,[v,y]=Cc(),[S,x]=Cc(),[w,_]=Cc(100),[k,P]=Cc(100),[j,I]=Cc(()=>f),[O,T,R]=xW(e,n.qt,gW(t,n)),{Z:M,J:D,ot:A,st:G,ut:$,it:H}=n.qt,{Jt:U,nn:q,Zt:z,Ut:L,Wt:V}=O,{tn:W}=U,{tn:te}=q,fe=le=>{const{Xt:ge}=le,se=$&&!H&&Za(ge)===D&&ge;return[se,{transform:se?`translate(${Hs(A)}px, ${Fa(A)}px)`:""}]},ae=(le,ge)=>{if(I(),le)z(BC);else{const se=()=>z(BC,!0);f>0&&!ge?j(se):se()}},J=()=>{c=s,c&&ae(!0)},B=[_,I,P,x,y,R,Wr(M,"pointerover",J,{C:!0}),Wr(M,"pointerenter",J),Wr(M,"pointerleave",()=>{c=!1,s&&ae(!1)}),Wr(M,"pointermove",()=>{o&&v(()=>{_(),ae(!0),k(()=>{o&&ae(!1)})})}),Wr(G,"scroll",le=>{S(()=>{V(n()),a&&ae(!0),w(()=>{a&&!c&&ae(!1)})}),r(le),$&&W(fe),$&&te(fe)})],oe=m.bind(0);return oe.qt=O,oe.Nt=T,[(le,ge,se)=>{const{At:pe,Lt:ue,It:be,yt:ke}=se,{A:ie}=Lo(),Pe=ly(t,le,ge),Je=n(),{Tt:Ae,Ct:Ve,bt:kt}=Je,[ft,yn]=Pe("showNativeOverlaidScrollbars"),[K,Ce]=Pe("scrollbars.theme"),[ne,me]=Pe("scrollbars.visibility"),[Re,Ye]=Pe("scrollbars.autoHide"),[ye]=Pe("scrollbars.autoHideDelay"),[lt,It]=Pe("scrollbars.dragScroll"),[Xt,$e]=Pe("scrollbars.clickScroll"),Ke=pe||ue||ke,Cn=be||me,Ee=ft&&ie.x&&ie.y,qe=(pt,gt)=>{const Ht=ne==="visible"||ne==="auto"&&pt==="scroll";return z(AV,Ht,gt),Ht};if(f=ye,yn&&z(TV,Ee),Ce&&(z(d),z(K,!0),d=K),Ye&&(o=Re==="move",s=Re==="leave",a=Re!=="never",ae(!a,!0)),It&&z($V,lt),$e&&z(zV,Xt),Cn){const pt=qe(Ve.x,!0),gt=qe(Ve.y,!1);z(NV,!(pt&&gt))}Ke&&(L(Je),V(Je),z(LC,!Ae.x,!0),z(LC,!Ae.y,!1),z(RV,kt&&!H))},oe,Ea.bind(0,B)]},uE=(e,t,n)=>{Zs(e)&&e(t||void 0,n||void 0)},Ti=(e,t,n)=>{const{F:r,N:o,Y:s,j:a}=Lo(),c=Al(),d=Bh(e),f=d?e:e.target,h=sE(f);if(t&&!h){let m=!1;const v=$=>{const H=Al()[BV],U=H&&H.O;return U?U($,!0):$},y=Cr({},r(),v(t)),[S,x,w]=ox(n),[_,k,P]=dW(e,y),[j,I,O]=wW(e,y,k,$=>w("scroll",[G,$])),T=($,H)=>_($,!!H),R=T.bind(0,{},!0),M=s(R),D=a(R),A=$=>{XV(f),M(),D(),O(),P(),m=!0,w("destroyed",[G,!!$]),x()},G={options($,H){if($){const U=H?r():{},q=Kj(y,Cr(U,v($)));Qb(q)||(Cr(y,q),T(q))}return Cr({},y)},on:S,off:($,H)=>{$&&H&&x($,H)},state(){const{zt:$,Tt:H,Ct:U,Et:q,K:z,St:L,bt:V}=k();return Cr({},{overflowEdge:$,overflowAmount:H,overflowStyle:U,hasOverflow:q,padding:z,paddingAbsolute:L,directionRTL:V,destroyed:m})},elements(){const{W:$,Z:H,K:U,J:q,tt:z,ot:L,st:V}=k.qt,{Jt:W,nn:te}=I.qt,fe=J=>{const{Ft:B,Gt:oe,Xt:le}=J;return{scrollbar:le,track:oe,handle:B}},ae=J=>{const{Kt:B,Qt:oe}=J,le=fe(B[0]);return Cr({},le,{clone:()=>{const ge=fe(oe());return j({},!0,{}),ge}})};return Cr({},{target:$,host:H,padding:U||q,viewport:q,content:z||q,scrollOffsetElement:L,scrollEventElement:V,scrollbarHorizontal:ae(W),scrollbarVertical:ae(te)})},update:$=>T({},$),destroy:A.bind(0)};return k.jt(($,H,U)=>{j(H,U,$)}),KV(f,G),Mn(Ko(c),$=>uE(c[$],0,G)),YV(k.qt.it,o().cancel,!d&&e.cancel)?(A(!0),G):(k.Nt(),I.Nt(),w("initialized",[G]),k.jt(($,H,U)=>{const{gt:q,yt:z,vt:L,At:V,Lt:W,It:te,wt:fe,Ot:ae}=$;w("updated",[G,{updateHints:{sizeChanged:q,directionChanged:z,heightIntrinsicChanged:L,overflowEdgeChanged:V,overflowAmountChanged:W,overflowStyleChanged:te,contentMutation:fe,hostMutation:ae},changedOptions:H,force:U}])}),G.update(!0),G)}return h};Ti.plugin=e=>{Mn(LV(e),t=>uE(t,Ti))};Ti.valid=e=>{const t=e&&e.elements,n=Zs(t)&&t();return ry(n)&&!!sE(n.target)};Ti.env=()=>{const{k:e,A:t,I:n,B:r,V:o,L:s,X:a,U:c,N:d,q:f,F:h,G:m}=Lo();return Cr({},{scrollbarsSize:e,scrollbarsOverlaid:t,scrollbarsHiding:n,rtlScrollBehavior:r,flexboxGlue:o,cssCustomProperties:s,staticDefaultInitialization:a,staticDefaultOptions:c,getDefaultInitialization:d,setDefaultInitialization:f,getDefaultOptions:h,setDefaultOptions:m})};const SW=()=>{if(typeof window>"u"){const f=()=>{};return[f,f]}let e,t;const n=window,r=typeof n.requestIdleCallback=="function",o=n.requestAnimationFrame,s=n.cancelAnimationFrame,a=r?n.requestIdleCallback:o,c=r?n.cancelIdleCallback:s,d=()=>{c(e),s(t)};return[(f,h)=>{d(),e=a(r?()=>{d(),t=o(f)}:f,typeof h=="object"?h:{timeout:2233})},d]},dE=e=>{const{options:t,events:n,defer:r}=e||{},[o,s]=p.useMemo(SW,[]),a=p.useRef(null),c=p.useRef(r),d=p.useRef(t),f=p.useRef(n);return p.useEffect(()=>{c.current=r},[r]),p.useEffect(()=>{const{current:h}=a;d.current=t,Ti.valid(h)&&h.options(t||{},!0)},[t]),p.useEffect(()=>{const{current:h}=a;f.current=n,Ti.valid(h)&&h.on(n||{},!0)},[n]),p.useEffect(()=>()=>{var h;s(),(h=a.current)==null||h.destroy()},[]),p.useMemo(()=>[h=>{const m=a.current;if(Ti.valid(m))return;const v=c.current,y=d.current||{},S=f.current||{},x=()=>a.current=Ti(h,y,S);v?o(x,v):x()},()=>a.current],[])},CW=(e,t)=>{const{element:n="div",options:r,events:o,defer:s,children:a,...c}=e,d=n,f=p.useRef(null),h=p.useRef(null),[m,v]=dE({options:r,events:o,defer:s});return p.useEffect(()=>{const{current:y}=f,{current:S}=h;return y&&S&&m({target:y,elements:{viewport:S,content:S}}),()=>{var x;return(x=v())==null?void 0:x.destroy()}},[m,n]),p.useImperativeHandle(t,()=>({osInstance:v,getElement:()=>f.current}),[]),F.createElement(d,{"data-overlayscrollbars-initialize":"",ref:f,...c},F.createElement("div",{ref:h},a))},fE=p.forwardRef(CW);function pE(e){return it({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.828.722a.5.5 0 0 1 .354.146l4.95 4.95a.5.5 0 0 1 0 .707c-.48.48-1.072.588-1.503.588-.177 0-.335-.018-.46-.039l-3.134 3.134a5.927 5.927 0 0 1 .16 1.013c.046.702-.032 1.687-.72 2.375a.5.5 0 0 1-.707 0l-2.829-2.828-3.182 3.182c-.195.195-1.219.902-1.414.707-.195-.195.512-1.22.707-1.414l3.182-3.182-2.828-2.829a.5.5 0 0 1 0-.707c.688-.688 1.673-.767 2.375-.72a5.922 5.922 0 0 1 1.013.16l3.134-3.133a2.772 2.772 0 0 1-.04-.461c0-.43.108-1.022.589-1.503a.5.5 0 0 1 .353-.146z"}}]})(e)}function hE(e){return it({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.828.722a.5.5 0 0 1 .354.146l4.95 4.95a.5.5 0 0 1 0 .707c-.48.48-1.072.588-1.503.588-.177 0-.335-.018-.46-.039l-3.134 3.134a5.927 5.927 0 0 1 .16 1.013c.046.702-.032 1.687-.72 2.375a.5.5 0 0 1-.707 0l-2.829-2.828-3.182 3.182c-.195.195-1.219.902-1.414.707-.195-.195.512-1.22.707-1.414l3.182-3.182-2.828-2.829a.5.5 0 0 1 0-.707c.688-.688 1.673-.767 2.375-.72a5.922 5.922 0 0 1 1.013.16l3.134-3.133a2.772 2.772 0 0 1-.04-.461c0-.43.108-1.022.589-1.503a.5.5 0 0 1 .353-.146zm.122 2.112v-.002.002zm0-.002v.002a.5.5 0 0 1-.122.51L6.293 6.878a.5.5 0 0 1-.511.12H5.78l-.014-.004a4.507 4.507 0 0 0-.288-.076 4.922 4.922 0 0 0-.765-.116c-.422-.028-.836.008-1.175.15l5.51 5.509c.141-.34.177-.753.149-1.175a4.924 4.924 0 0 0-.192-1.054l-.004-.013v-.001a.5.5 0 0 1 .12-.512l3.536-3.535a.5.5 0 0 1 .532-.115l.096.022c.087.017.208.034.344.034.114 0 .23-.011.343-.04L9.927 2.028c-.029.113-.04.23-.04.343a1.779 1.779 0 0 0 .062.46z"}}]})(e)}function _W(e){return it({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 kW(e){return it({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 PW(e){return it({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M528 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h480c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zm-352 96c35.3 0 64 28.7 64 64s-28.7 64-64 64-64-28.7-64-64 28.7-64 64-64zm112 236.8c0 10.6-10 19.2-22.4 19.2H86.4C74 384 64 375.4 64 364.8v-19.2c0-31.8 30.1-57.6 67.2-57.6h5c12.3 5.1 25.7 8 39.8 8s27.6-2.9 39.8-8h5c37.1 0 67.2 25.8 67.2 57.6v19.2zM512 312c0 4.4-3.6 8-8 8H360c-4.4 0-8-3.6-8-8v-16c0-4.4 3.6-8 8-8h144c4.4 0 8 3.6 8 8v16zm0-64c0 4.4-3.6 8-8 8H360c-4.4 0-8-3.6-8-8v-16c0-4.4 3.6-8 8-8h144c4.4 0 8 3.6 8 8v16zm0-64c0 4.4-3.6 8-8 8H360c-4.4 0-8-3.6-8-8v-16c0-4.4 3.6-8 8-8h144c4.4 0 8 3.6 8 8v16z"}}]})(e)}function jW(e){return it({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 EW(e){return it({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 IW(e){return it({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 OW(e){return it({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 mE(e){return it({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 TW(e){return it({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 RW(e){return it({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 MW(e){return it({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 DW(e){return it({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 gE(e){return it({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 Cu(e){return it({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 vE(e){return it({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 AW(e){return it({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 ux(e){return it({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 yE(e){return it({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 NW(e){return it({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 zW(e){return it({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 dx(e){return it({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 bE(e){return it({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 $W(e){return it({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 LW(e){return it({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 xE(e){return it({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 fh(e){return it({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 BW(e){return it({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 FW(e){return it({tag:"svg",attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zM94.6 168.9l34.9-5 15.5-31.6c2.9-5.8 11-5.8 13.9 0l15.5 31.6 34.9 5c6.2 1 8.9 8.6 4.3 13.2l-25.4 24.6 6 34.9c1 6.2-5.3 11-11 7.9L152 233.3l-31.3 16.3c-5.7 3.1-12-1.7-11-7.9l6-34.9-25.4-24.6c-4.6-4.7-1.9-12.3 4.3-13.3zM248 432c-60.6 0-134.5-38.3-143.8-93.3-2-11.8 9.3-21.5 20.7-17.9C155.1 330.5 200 336 248 336s92.9-5.5 123.1-15.2c11.5-3.7 22.6 6.1 20.7 17.9-9.3 55-83.2 93.3-143.8 93.3zm157.7-249.9l-25.4 24.6 6 34.9c1 6.2-5.3 11-11 7.9L344 233.3l-31.3 16.3c-5.7 3.1-12-1.7-11-7.9l6-34.9-25.4-24.6c-4.5-4.6-1.9-12.2 4.3-13.2l34.9-5 15.5-31.6c2.9-5.8 11-5.8 13.9 0l15.5 31.6 34.9 5c6.3.9 9 8.5 4.4 13.1z"}}]})(e)}function HW(e){return it({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 zd(e){return it({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 VW(e){return it({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 WW(e){return it({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 UW(e){return it({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 wE(e){return it({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 GW(e){return it({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M80 368H16a16 16 0 0 0-16 16v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16v-64a16 16 0 0 0-16-16zm0-320H16A16 16 0 0 0 0 64v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16V64a16 16 0 0 0-16-16zm0 160H16a16 16 0 0 0-16 16v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16v-64a16 16 0 0 0-16-16zm416 176H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0-320H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16V80a16 16 0 0 0-16-16zm0 160H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z"}}]})(e)}function qW(e){return it({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 YW(e){return it({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 KW(e){return it({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M283.211 512c78.962 0 151.079-35.925 198.857-94.792 7.068-8.708-.639-21.43-11.562-19.35-124.203 23.654-238.262-71.576-238.262-196.954 0-72.222 38.662-138.635 101.498-174.394 9.686-5.512 7.25-20.197-3.756-22.23A258.156 258.156 0 0 0 283.211 0c-141.309 0-256 114.511-256 256 0 141.309 114.511 256 256 256z"}}]})(e)}function SE(e){return it({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 CE(e){return it({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 Ag(e){return it({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 XW(e){return it({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 ZW(e){return it({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 QW(e){return it({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 fx(e){return it({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 JC(e){return it({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 JW(e){return it({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 eU(e){return it({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 tU(e){return it({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 Gh(e){return it({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 px(e){return it({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 nU(e){return it({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 160c-52.9 0-96 43.1-96 96s43.1 96 96 96 96-43.1 96-96-43.1-96-96-96zm246.4 80.5l-94.7-47.3 33.5-100.4c4.5-13.6-8.4-26.5-21.9-21.9l-100.4 33.5-47.4-94.8c-6.4-12.8-24.6-12.8-31 0l-47.3 94.7L92.7 70.8c-13.6-4.5-26.5 8.4-21.9 21.9l33.5 100.4-94.7 47.4c-12.8 6.4-12.8 24.6 0 31l94.7 47.3-33.5 100.5c-4.5 13.6 8.4 26.5 21.9 21.9l100.4-33.5 47.3 94.7c6.4 12.8 24.6 12.8 31 0l47.3-94.7 100.4 33.5c13.6 4.5 26.5-8.4 21.9-21.9l-33.5-100.4 94.7-47.3c13-6.5 13-24.7.2-31.1zm-155.9 106c-49.9 49.9-131.1 49.9-181 0-49.9-49.9-49.9-131.1 0-181 49.9-49.9 131.1-49.9 181 0 49.9 49.9 49.9 131.1 0 181z"}}]})(e)}function Mo(e){return it({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 hx(e){return it({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 Ng(e){return it({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 mx(e){return it({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 _E=e=>e.image?i.jsx(Bb,{sx:{w:`${e.image.width}px`,h:"auto",objectFit:"contain",aspectRatio:`${e.image.width}/${e.image.height}`}}):i.jsx(X,{sx:{opacity:.7,w:"full",h:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",bg:"base.200",_dark:{bg:"base.900"}},children:i.jsx(mu,{size:"xl"})}),xf=e=>{const{icon:t=zd,boxSize:n=16}=e;return i.jsxs(X,{sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",flexDir:"column",gap:2,userSelect:"none",color:"base.700",_dark:{color:"base.500"},...e.sx},children:[i.jsx(io,{as:t,boxSize:n,opacity:.7}),e.label&&i.jsx(nt,{textAlign:"center",children:e.label})]})},rU=({image:e})=>{const t=p.useMemo(()=>{var n,r;if(Jm((n=e.metadata)==null?void 0:n.model))return(r=e.metadata)==null?void 0:r.model},[e.metadata]);return i.jsxs(X,{sx:{pointerEvents:"none",flexDirection:"column",position:"absolute",top:0,insetInlineStart:0,p:2,alignItems:"flex-start",gap:2},children:[i.jsxs(Kc,{variant:"solid",colorScheme:"base",children:[e.width," × ",e.height]}),t&&i.jsx(Kc,{variant:"solid",colorScheme:"base",children:t})]})},oU=e=>{const{isOver:t,label:n="Drop"}=e,r=p.useRef(yl()),{colorMode:o}=zo();return i.jsx(No.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}},children:i.jsxs(X,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full"},children:[i.jsx(X,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",bg:Fe("base.700","base.900")(o),opacity:.7,borderRadius:"base",alignItems:"center",justifyContent:"center",transitionProperty:"common",transitionDuration:"0.1s"}}),i.jsx(X,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",opacity:1,borderWidth:3,borderColor:t?Fe("base.50","base.200")(o):Fe("base.100","base.500")(o),borderRadius:"base",borderStyle:"dashed",transitionProperty:"common",transitionDuration:"0.1s",alignItems:"center",justifyContent:"center"},children:i.jsx(nt,{sx:{fontSize:"2xl",fontWeight:600,transform:t?"scale(1.02)":"scale(1)",color:t?Fe("base.50","base.50")(o):Fe("base.100","base.200")(o),transitionProperty:"common",transitionDuration:"0.1s"},children:n})})]})},r.current)},eu=p.memo(oU),kE=({postUploadAction:e,isDisabled:t})=>{const n=ce(),r=p.useCallback(c=>{const d=c[0];d&&n(e3({file:d,image_category:"user",is_intermediate:!1,postUploadAction:e}))},[n,e]),{getRootProps:o,getInputProps:s,open:a}=Yb({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},onDropAccepted:r,disabled:t,noDrag:!0,multiple:!1});return{getUploadButtonProps:o,getUploadInputProps:s,openUploader:a}},sU=e=>{const{imageDTO:t,onClickReset:n,onError:r,onClick:o,withResetIcon:s=!1,withMetadataOverlay:a=!1,isDropDisabled:c=!1,isDragDisabled:d=!1,isUploadDisabled:f=!1,minSize:h=24,postUploadAction:m,imageSx:v,fitContainer:y=!1,droppableData:S,draggableData:x,dropLabel:w,isSelected:_=!1,thumbnail:k=!1,resetTooltip:P="Reset",resetIcon:j=i.jsx(hx,{}),noContentFallback:I=i.jsx(xf,{icon:zd})}=e,{colorMode:O}=zo(),T=p.useRef(yl()),{attributes:R,listeners:M,setNodeRef:D,isDragging:A,active:G}=U8({id:T.current,disabled:d||!t,data:x}),{isOver:$,setNodeRef:H}=rf({id:T.current,disabled:c,data:S}),U=G8(H,D),{getUploadButtonProps:q,getUploadInputProps:z}=kE({postUploadAction:m,isDisabled:f}),L=eh("drop-shadow(0px 0px 0.1rem var(--invokeai-colors-base-600))","drop-shadow(0px 0px 0.1rem var(--invokeai-colors-base-800))"),V=f?{}:{cursor:"pointer",bg:Fe("base.200","base.800")(O),_hover:{bg:Fe("base.300","base.650")(O),color:Fe("base.500","base.300")(O)}};return i.jsxs(X,{sx:{width:"full",height:"full",alignItems:"center",justifyContent:"center",position:"relative",minW:h||void 0,minH:h||void 0,userSelect:"none",cursor:d||!t?"default":"pointer"},...R,...M,ref:U,children:[t&&i.jsxs(X,{sx:{w:"full",h:"full",position:y?"absolute":"relative",alignItems:"center",justifyContent:"center"},children:[i.jsx(eg,{onClick:o,src:k?t.thumbnail_url:t.image_url,fallbackStrategy:"beforeLoadOrError",fallback:i.jsx(_E,{image:t}),onError:r,draggable:!1,sx:{objectFit:"contain",maxW:"full",maxH:"full",borderRadius:"base",shadow:_?"selected.light":void 0,_dark:{shadow:_?"selected.dark":void 0},...v}}),a&&i.jsx(rU,{image:t}),n&&s&&i.jsx(Ne,{onClick:n,"aria-label":P,tooltip:P,icon:j,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:L}}})]}),!t&&!f&&i.jsx(i.Fragment,{children:i.jsxs(X,{sx:{minH:h,w:"full",h:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",transitionProperty:"common",transitionDuration:"0.1s",color:Fe("base.500","base.500")(O),...V},...q(),children:[i.jsx("input",{...z()}),i.jsx(io,{as:Ng,sx:{boxSize:16}})]})}),!t&&f&&I,i.jsx(Xo,{children:qc(S,G)&&!A&&i.jsx(eu,{isOver:$,label:w})})]})},Nl=p.memo(sU);var gd=globalThis&&globalThis.__assign||function(){return gd=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},gd.apply(this,arguments)};function PE(e){var t,n=p.useState(!1),r=n[0],o=n[1],s=p.useState(!1),a=s[0],c=s[1],d=p.useState(!1),f=d[0],h=d[1],m=p.useState([0,0]),v=m[0],y=m[1],S=p.useRef(null);p.useEffect(function(){if(r)setTimeout(function(){c(!0),setTimeout(function(){h(!0)})});else{h(!1);var w=setTimeout(function(){c(r)},1e3);return function(){return clearTimeout(w)}}},[r]),sz("contextmenu",function(w){var _;!((_=S.current)===null||_===void 0)&&_.contains(w.target)||w.target===S.current?(w.preventDefault(),o(!0),y([w.pageX,w.pageY])):o(!1)});var x=p.useCallback(function(){var w,_;(_=(w=e.menuProps)===null||w===void 0?void 0:w.onClose)===null||_===void 0||_.call(w),o(!1)},[(t=e.menuProps)===null||t===void 0?void 0:t.onClose,o]);return p.createElement(p.Fragment,null,e.children(S),a&&p.createElement(Sd,gd({},e.portalProps),p.createElement(dg,gd({isOpen:f,gutter:0},e.menuProps,{onClose:x}),p.createElement(fg,gd({"aria-hidden":!0,w:1,h:1,style:{position:"absolute",left:v[0],top:v[1],cursor:"default"}},e.menuButtonProps)),e.renderMenu())))}var aU=yu({displayName:"EditIcon",path:i.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[i.jsx("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),i.jsx("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]})}),gx=yu({displayName:"ExternalLinkIcon",path:i.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[i.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),i.jsx("path",{d:"M15 3h6v6"}),i.jsx("path",{d:"M10 14L21 3"})]})}),vx=yu({d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z",displayName:"ChevronUpIcon"}),iU=yu({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"}),lU=yu({displayName:"DeleteIcon",path:i.jsx("g",{fill:"currentColor",children:i.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"})})}),cU=yu({displayName:"ChevronDownIcon",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"});function ph(e){return it({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)}function uU(e){return it({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M478.33 433.6l-90-218a22 22 0 00-40.67 0l-90 218a22 22 0 1040.67 16.79L316.66 406h102.67l18.33 44.39A22 22 0 00458 464a22 22 0 0020.32-30.4zM334.83 362L368 281.65 401.17 362zm-66.99-19.08a22 22 0 00-4.89-30.7c-.2-.15-15-11.13-36.49-34.73 39.65-53.68 62.11-114.75 71.27-143.49H330a22 22 0 000-44H214V70a22 22 0 00-44 0v20H54a22 22 0 000 44h197.25c-9.52 26.95-27.05 69.5-53.79 108.36-31.41-41.68-43.08-68.65-43.17-68.87a22 22 0 00-40.58 17c.58 1.38 14.55 34.23 52.86 83.93.92 1.19 1.83 2.35 2.74 3.51-39.24 44.35-77.74 71.86-93.85 80.74a22 22 0 1021.07 38.63c2.16-1.18 48.6-26.89 101.63-85.59 22.52 24.08 38 35.44 38.93 36.1a22 22 0 0030.75-4.9z"}}]})(e)}const Jr=e=>{const t=Y(a=>a.config.disabledTabs),n=Y(a=>a.config.disabledFeatures),r=Y(a=>a.config.disabledSDFeatures),o=p.useMemo(()=>n.includes(e)||r.includes(e)||t.includes(e),[n,r,t,e]),s=p.useMemo(()=>!(n.includes(e)||r.includes(e)||t.includes(e)),[n,r,t,e]);return{isFeatureDisabled:o,isFeatureEnabled:s}};var Rn;(function(e){e.assertEqual=o=>o;function t(o){}e.assertIs=t;function n(o){throw new Error}e.assertNever=n,e.arrayToEnum=o=>{const s={};for(const a of o)s[a]=a;return s},e.getValidEnumValues=o=>{const s=e.objectKeys(o).filter(c=>typeof o[o[c]]!="number"),a={};for(const c of s)a[c]=o[c];return e.objectValues(a)},e.objectValues=o=>e.objectKeys(o).map(function(s){return o[s]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const s=[];for(const a in o)Object.prototype.hasOwnProperty.call(o,a)&&s.push(a);return s},e.find=(o,s)=>{for(const a of o)if(s(a))return a},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&isFinite(o)&&Math.floor(o)===o;function r(o,s=" | "){return o.map(a=>typeof a=="string"?`'${a}'`:a).join(s)}e.joinValues=r,e.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(Rn||(Rn={}));var dy;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(dy||(dy={}));const mt=Rn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ji=e=>{switch(typeof e){case"undefined":return mt.undefined;case"string":return mt.string;case"number":return isNaN(e)?mt.nan:mt.number;case"boolean":return mt.boolean;case"function":return mt.function;case"bigint":return mt.bigint;case"symbol":return mt.symbol;case"object":return Array.isArray(e)?mt.array:e===null?mt.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?mt.promise:typeof Map<"u"&&e instanceof Map?mt.map:typeof Set<"u"&&e instanceof Set?mt.set:typeof Date<"u"&&e instanceof Date?mt.date:mt.object;default:return mt.unknown}},He=Rn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),dU=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Vs extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(s){return s.message},r={_errors:[]},o=s=>{for(const a of s.issues)if(a.code==="invalid_union")a.unionErrors.map(o);else if(a.code==="invalid_return_type")o(a.returnTypeError);else if(a.code==="invalid_arguments")o(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let c=r,d=0;for(;d<a.path.length;){const f=a.path[d];d===a.path.length-1?(c[f]=c[f]||{_errors:[]},c[f]._errors.push(n(a))):c[f]=c[f]||{_errors:[]},c=c[f],d++}}};return o(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,Rn.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const o of this.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Vs.create=e=>new Vs(e);const $d=(e,t)=>{let n;switch(e.code){case He.invalid_type:e.received===mt.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case He.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Rn.jsonStringifyReplacer)}`;break;case He.unrecognized_keys:n=`Unrecognized key(s) in object: ${Rn.joinValues(e.keys,", ")}`;break;case He.invalid_union:n="Invalid input";break;case He.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Rn.joinValues(e.options)}`;break;case He.invalid_enum_value:n=`Invalid enum value. Expected ${Rn.joinValues(e.options)}, received '${e.received}'`;break;case He.invalid_arguments:n="Invalid function arguments";break;case He.invalid_return_type:n="Invalid function return type";break;case He.invalid_date:n="Invalid date";break;case He.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Rn.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case He.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case He.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case He.custom:n="Invalid input";break;case He.invalid_intersection_types:n="Intersection results could not be merged";break;case He.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case He.not_finite:n="Number must be finite";break;default:n=t.defaultError,Rn.assertNever(e)}return{message:n}};let jE=$d;function fU(e){jE=e}function qh(){return jE}const Yh=e=>{const{data:t,path:n,errorMaps:r,issueData:o}=e,s=[...n,...o.path||[]],a={...o,path:s};let c="";const d=r.filter(f=>!!f).slice().reverse();for(const f of d)c=f(a,{data:t,defaultError:c}).message;return{...o,path:s,message:o.message||c}},pU=[];function vt(e,t){const n=Yh({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,qh(),$d].filter(r=>!!r)});e.common.issues.push(n)}class co{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const o of n){if(o.status==="aborted")return Zt;o.status==="dirty"&&t.dirty(),r.push(o.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const o of n)r.push({key:await o.key,value:await o.value});return co.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const o of n){const{key:s,value:a}=o;if(s.status==="aborted"||a.status==="aborted")return Zt;s.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),(typeof a.value<"u"||o.alwaysSet)&&(r[s.value]=a.value)}return{status:t.value,value:r}}}const Zt=Object.freeze({status:"aborted"}),EE=e=>({status:"dirty",value:e}),xo=e=>({status:"valid",value:e}),fy=e=>e.status==="aborted",py=e=>e.status==="dirty",Kh=e=>e.status==="valid",Xh=e=>typeof Promise<"u"&&e instanceof Promise;var Nt;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Nt||(Nt={}));class Ca{constructor(t,n,r,o){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=o}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const e4=(e,t)=>{if(Kh(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Vs(e.common.issues);return this._error=n,this._error}}};function an(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:o}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(a,c)=>a.code!=="invalid_type"?{message:c.defaultError}:typeof c.data>"u"?{message:r??c.defaultError}:{message:n??c.defaultError},description:o}}class un{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return ji(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:ji(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new co,ctx:{common:t.parent.common,data:t.data,parsedType:ji(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Xh(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const o={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ji(t)},s=this._parseSync({data:t,path:o.path,parent:o});return e4(o,s)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ji(t)},o=this._parse({data:t,path:r.path,parent:r}),s=await(Xh(o)?o:Promise.resolve(o));return e4(r,s)}refine(t,n){const r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,s)=>{const a=t(o),c=()=>s.addIssue({code:He.custom,...r(o)});return typeof Promise<"u"&&a instanceof Promise?a.then(d=>d?!0:(c(),!1)):a?!0:(c(),!1)})}refinement(t,n){return this._refinement((r,o)=>t(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(t){return new Js({schema:this,typeName:Wt.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Va.create(this,this._def)}nullable(){return Ll.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ws.create(this,this._def)}promise(){return nu.create(this,this._def)}or(t){return Hd.create([this,t],this._def)}and(t){return Vd.create(this,t,this._def)}transform(t){return new Js({...an(this._def),schema:this,typeName:Wt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new Yd({...an(this._def),innerType:this,defaultValue:n,typeName:Wt.ZodDefault})}brand(){return new OE({typeName:Wt.ZodBranded,type:this,...an(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new em({...an(this._def),innerType:this,catchValue:n,typeName:Wt.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return wf.create(this,t)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const hU=/^c[^\s-]{8,}$/i,mU=/^[a-z][a-z0-9]*$/,gU=/[0-9A-HJKMNP-TV-Z]{26}/,vU=/^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i,yU=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\])|(\[IPv6:(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))\])|([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])*(\.[A-Za-z]{2,})+))$/,bU=/^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u,xU=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,wU=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,SU=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function CU(e,t){return!!((t==="v4"||!t)&&xU.test(e)||(t==="v6"||!t)&&wU.test(e))}class Ls extends un{constructor(){super(...arguments),this._regex=(t,n,r)=>this.refinement(o=>t.test(o),{validation:n,code:He.invalid_string,...Nt.errToObj(r)}),this.nonempty=t=>this.min(1,Nt.errToObj(t)),this.trim=()=>new Ls({...this._def,checks:[...this._def.checks,{kind:"trim"}]}),this.toLowerCase=()=>new Ls({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]}),this.toUpperCase=()=>new Ls({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==mt.string){const s=this._getOrReturnCtx(t);return vt(s,{code:He.invalid_type,expected:mt.string,received:s.parsedType}),Zt}const r=new co;let o;for(const s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(o=this._getOrReturnCtx(t,o),vt(o,{code:He.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")t.data.length>s.value&&(o=this._getOrReturnCtx(t,o),vt(o,{code:He.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const a=t.data.length>s.value,c=t.data.length<s.value;(a||c)&&(o=this._getOrReturnCtx(t,o),a?vt(o,{code:He.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):c&&vt(o,{code:He.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")yU.test(t.data)||(o=this._getOrReturnCtx(t,o),vt(o,{validation:"email",code:He.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")bU.test(t.data)||(o=this._getOrReturnCtx(t,o),vt(o,{validation:"emoji",code:He.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")vU.test(t.data)||(o=this._getOrReturnCtx(t,o),vt(o,{validation:"uuid",code:He.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")hU.test(t.data)||(o=this._getOrReturnCtx(t,o),vt(o,{validation:"cuid",code:He.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")mU.test(t.data)||(o=this._getOrReturnCtx(t,o),vt(o,{validation:"cuid2",code:He.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")gU.test(t.data)||(o=this._getOrReturnCtx(t,o),vt(o,{validation:"ulid",code:He.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),vt(o,{validation:"url",code:He.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),vt(o,{validation:"regex",code:He.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(o=this._getOrReturnCtx(t,o),vt(o,{code:He.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(o=this._getOrReturnCtx(t,o),vt(o,{code:He.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(o=this._getOrReturnCtx(t,o),vt(o,{code:He.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?SU(s).test(t.data)||(o=this._getOrReturnCtx(t,o),vt(o,{code:He.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="ip"?CU(t.data,s.version)||(o=this._getOrReturnCtx(t,o),vt(o,{validation:"ip",code:He.invalid_string,message:s.message}),r.dirty()):Rn.assertNever(s);return{status:r.value,value:t.data}}_addCheck(t){return new Ls({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Nt.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Nt.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Nt.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Nt.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Nt.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Nt.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Nt.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Nt.errToObj(t)})}datetime(t){var n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,...Nt.errToObj(t==null?void 0:t.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Nt.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Nt.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Nt.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Nt.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Nt.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Nt.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Nt.errToObj(n)})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Ls.create=e=>{var t;return new Ls({checks:[],typeName:Wt.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...an(e)})};function _U(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,o=n>r?n:r,s=parseInt(e.toFixed(o).replace(".","")),a=parseInt(t.toFixed(o).replace(".",""));return s%a/Math.pow(10,o)}class Fi extends un{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==mt.number){const s=this._getOrReturnCtx(t);return vt(s,{code:He.invalid_type,expected:mt.number,received:s.parsedType}),Zt}let r;const o=new co;for(const s of this._def.checks)s.kind==="int"?Rn.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),vt(r,{code:He.invalid_type,expected:"integer",received:"float",message:s.message}),o.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(r=this._getOrReturnCtx(t,r),vt(r,{code:He.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),vt(r,{code:He.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?_U(t.data,s.value)!==0&&(r=this._getOrReturnCtx(t,r),vt(r,{code:He.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),vt(r,{code:He.not_finite,message:s.message}),o.dirty()):Rn.assertNever(s);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Nt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Nt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Nt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Nt.toString(n))}setLimit(t,n,r,o){return new Fi({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Nt.toString(o)}]})}_addCheck(t){return new Fi({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Nt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Nt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Nt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Nt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Nt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Nt.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Nt.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Nt.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Nt.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Rn.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}Fi.create=e=>new Fi({checks:[],typeName:Wt.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...an(e)});class Hi extends un{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==mt.bigint){const s=this._getOrReturnCtx(t);return vt(s,{code:He.invalid_type,expected:mt.bigint,received:s.parsedType}),Zt}let r;const o=new co;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(r=this._getOrReturnCtx(t,r),vt(r,{code:He.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),vt(r,{code:He.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),vt(r,{code:He.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):Rn.assertNever(s);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Nt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Nt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Nt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Nt.toString(n))}setLimit(t,n,r,o){return new Hi({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Nt.toString(o)}]})}_addCheck(t){return new Hi({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Nt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Nt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Nt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Nt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Nt.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Hi.create=e=>{var t;return new Hi({checks:[],typeName:Wt.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...an(e)})};class Ld extends un{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==mt.boolean){const r=this._getOrReturnCtx(t);return vt(r,{code:He.invalid_type,expected:mt.boolean,received:r.parsedType}),Zt}return xo(t.data)}}Ld.create=e=>new Ld({typeName:Wt.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...an(e)});class zl extends un{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==mt.date){const s=this._getOrReturnCtx(t);return vt(s,{code:He.invalid_type,expected:mt.date,received:s.parsedType}),Zt}if(isNaN(t.data.getTime())){const s=this._getOrReturnCtx(t);return vt(s,{code:He.invalid_date}),Zt}const r=new co;let o;for(const s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(o=this._getOrReturnCtx(t,o),vt(o,{code:He.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(o=this._getOrReturnCtx(t,o),vt(o,{code:He.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):Rn.assertNever(s);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new zl({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Nt.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Nt.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}zl.create=e=>new zl({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Wt.ZodDate,...an(e)});class Zh extends un{_parse(t){if(this._getType(t)!==mt.symbol){const r=this._getOrReturnCtx(t);return vt(r,{code:He.invalid_type,expected:mt.symbol,received:r.parsedType}),Zt}return xo(t.data)}}Zh.create=e=>new Zh({typeName:Wt.ZodSymbol,...an(e)});class Bd extends un{_parse(t){if(this._getType(t)!==mt.undefined){const r=this._getOrReturnCtx(t);return vt(r,{code:He.invalid_type,expected:mt.undefined,received:r.parsedType}),Zt}return xo(t.data)}}Bd.create=e=>new Bd({typeName:Wt.ZodUndefined,...an(e)});class Fd extends un{_parse(t){if(this._getType(t)!==mt.null){const r=this._getOrReturnCtx(t);return vt(r,{code:He.invalid_type,expected:mt.null,received:r.parsedType}),Zt}return xo(t.data)}}Fd.create=e=>new Fd({typeName:Wt.ZodNull,...an(e)});class tu extends un{constructor(){super(...arguments),this._any=!0}_parse(t){return xo(t.data)}}tu.create=e=>new tu({typeName:Wt.ZodAny,...an(e)});class kl extends un{constructor(){super(...arguments),this._unknown=!0}_parse(t){return xo(t.data)}}kl.create=e=>new kl({typeName:Wt.ZodUnknown,...an(e)});class Qa extends un{_parse(t){const n=this._getOrReturnCtx(t);return vt(n,{code:He.invalid_type,expected:mt.never,received:n.parsedType}),Zt}}Qa.create=e=>new Qa({typeName:Wt.ZodNever,...an(e)});class Qh extends un{_parse(t){if(this._getType(t)!==mt.undefined){const r=this._getOrReturnCtx(t);return vt(r,{code:He.invalid_type,expected:mt.void,received:r.parsedType}),Zt}return xo(t.data)}}Qh.create=e=>new Qh({typeName:Wt.ZodVoid,...an(e)});class Ws extends un{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),o=this._def;if(n.parsedType!==mt.array)return vt(n,{code:He.invalid_type,expected:mt.array,received:n.parsedType}),Zt;if(o.exactLength!==null){const a=n.data.length>o.exactLength.value,c=n.data.length<o.exactLength.value;(a||c)&&(vt(n,{code:a?He.too_big:He.too_small,minimum:c?o.exactLength.value:void 0,maximum:a?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),r.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(vt(n,{code:He.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),r.dirty()),o.maxLength!==null&&n.data.length>o.maxLength.value&&(vt(n,{code:He.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,c)=>o.type._parseAsync(new Ca(n,a,n.path,c)))).then(a=>co.mergeArray(r,a));const s=[...n.data].map((a,c)=>o.type._parseSync(new Ca(n,a,n.path,c)));return co.mergeArray(r,s)}get element(){return this._def.type}min(t,n){return new Ws({...this._def,minLength:{value:t,message:Nt.toString(n)}})}max(t,n){return new Ws({...this._def,maxLength:{value:t,message:Nt.toString(n)}})}length(t,n){return new Ws({...this._def,exactLength:{value:t,message:Nt.toString(n)}})}nonempty(t){return this.min(1,t)}}Ws.create=(e,t)=>new Ws({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Wt.ZodArray,...an(t)});function _c(e){if(e instanceof Sr){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Va.create(_c(r))}return new Sr({...e._def,shape:()=>t})}else return e instanceof Ws?new Ws({...e._def,type:_c(e.element)}):e instanceof Va?Va.create(_c(e.unwrap())):e instanceof Ll?Ll.create(_c(e.unwrap())):e instanceof _a?_a.create(e.items.map(t=>_c(t))):e}class Sr extends un{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Rn.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==mt.object){const f=this._getOrReturnCtx(t);return vt(f,{code:He.invalid_type,expected:mt.object,received:f.parsedType}),Zt}const{status:r,ctx:o}=this._processInputParams(t),{shape:s,keys:a}=this._getCached(),c=[];if(!(this._def.catchall instanceof Qa&&this._def.unknownKeys==="strip"))for(const f in o.data)a.includes(f)||c.push(f);const d=[];for(const f of a){const h=s[f],m=o.data[f];d.push({key:{status:"valid",value:f},value:h._parse(new Ca(o,m,o.path,f)),alwaysSet:f in o.data})}if(this._def.catchall instanceof Qa){const f=this._def.unknownKeys;if(f==="passthrough")for(const h of c)d.push({key:{status:"valid",value:h},value:{status:"valid",value:o.data[h]}});else if(f==="strict")c.length>0&&(vt(o,{code:He.unrecognized_keys,keys:c}),r.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const h of c){const m=o.data[h];d.push({key:{status:"valid",value:h},value:f._parse(new Ca(o,m,o.path,h)),alwaysSet:h in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const f=[];for(const h of d){const m=await h.key;f.push({key:m,value:await h.value,alwaysSet:h.alwaysSet})}return f}).then(f=>co.mergeObjectSync(r,f)):co.mergeObjectSync(r,d)}get shape(){return this._def.shape()}strict(t){return Nt.errToObj,new Sr({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var o,s,a,c;const d=(a=(s=(o=this._def).errorMap)===null||s===void 0?void 0:s.call(o,n,r).message)!==null&&a!==void 0?a:r.defaultError;return n.code==="unrecognized_keys"?{message:(c=Nt.errToObj(t).message)!==null&&c!==void 0?c:d}:{message:d}}}:{}})}strip(){return new Sr({...this._def,unknownKeys:"strip"})}passthrough(){return new Sr({...this._def,unknownKeys:"passthrough"})}extend(t){return new Sr({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Sr({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Wt.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Sr({...this._def,catchall:t})}pick(t){const n={};return Rn.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new Sr({...this._def,shape:()=>n})}omit(t){const n={};return Rn.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new Sr({...this._def,shape:()=>n})}deepPartial(){return _c(this)}partial(t){const n={};return Rn.objectKeys(this.shape).forEach(r=>{const o=this.shape[r];t&&!t[r]?n[r]=o:n[r]=o.optional()}),new Sr({...this._def,shape:()=>n})}required(t){const n={};return Rn.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof Va;)s=s._def.innerType;n[r]=s}}),new Sr({...this._def,shape:()=>n})}keyof(){return IE(Rn.objectKeys(this.shape))}}Sr.create=(e,t)=>new Sr({shape:()=>e,unknownKeys:"strip",catchall:Qa.create(),typeName:Wt.ZodObject,...an(t)});Sr.strictCreate=(e,t)=>new Sr({shape:()=>e,unknownKeys:"strict",catchall:Qa.create(),typeName:Wt.ZodObject,...an(t)});Sr.lazycreate=(e,t)=>new Sr({shape:e,unknownKeys:"strip",catchall:Qa.create(),typeName:Wt.ZodObject,...an(t)});class Hd extends un{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function o(s){for(const c of s)if(c.result.status==="valid")return c.result;for(const c of s)if(c.result.status==="dirty")return n.common.issues.push(...c.ctx.common.issues),c.result;const a=s.map(c=>new Vs(c.ctx.common.issues));return vt(n,{code:He.invalid_union,unionErrors:a}),Zt}if(n.common.async)return Promise.all(r.map(async s=>{const a={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(o);{let s;const a=[];for(const d of r){const f={...n,common:{...n.common,issues:[]},parent:null},h=d._parseSync({data:n.data,path:n.path,parent:f});if(h.status==="valid")return h;h.status==="dirty"&&!s&&(s={result:h,ctx:f}),f.common.issues.length&&a.push(f.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const c=a.map(d=>new Vs(d));return vt(n,{code:He.invalid_union,unionErrors:c}),Zt}}get options(){return this._def.options}}Hd.create=(e,t)=>new Hd({options:e,typeName:Wt.ZodUnion,...an(t)});const hh=e=>e instanceof Ud?hh(e.schema):e instanceof Js?hh(e.innerType()):e instanceof Gd?[e.value]:e instanceof Vi?e.options:e instanceof qd?Object.keys(e.enum):e instanceof Yd?hh(e._def.innerType):e instanceof Bd?[void 0]:e instanceof Fd?[null]:null;class zg extends un{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==mt.object)return vt(n,{code:He.invalid_type,expected:mt.object,received:n.parsedType}),Zt;const r=this.discriminator,o=n.data[r],s=this.optionsMap.get(o);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(vt(n,{code:He.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Zt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const o=new Map;for(const s of n){const a=hh(s.shape[t]);if(!a)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const c of a){if(o.has(c))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(c)}`);o.set(c,s)}}return new zg({typeName:Wt.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:o,...an(r)})}}function hy(e,t){const n=ji(e),r=ji(t);if(e===t)return{valid:!0,data:e};if(n===mt.object&&r===mt.object){const o=Rn.objectKeys(t),s=Rn.objectKeys(e).filter(c=>o.indexOf(c)!==-1),a={...e,...t};for(const c of s){const d=hy(e[c],t[c]);if(!d.valid)return{valid:!1};a[c]=d.data}return{valid:!0,data:a}}else if(n===mt.array&&r===mt.array){if(e.length!==t.length)return{valid:!1};const o=[];for(let s=0;s<e.length;s++){const a=e[s],c=t[s],d=hy(a,c);if(!d.valid)return{valid:!1};o.push(d.data)}return{valid:!0,data:o}}else return n===mt.date&&r===mt.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Vd extends un{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),o=(s,a)=>{if(fy(s)||fy(a))return Zt;const c=hy(s.value,a.value);return c.valid?((py(s)||py(a))&&n.dirty(),{status:n.value,value:c.data}):(vt(r,{code:He.invalid_intersection_types}),Zt)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,a])=>o(s,a)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Vd.create=(e,t,n)=>new Vd({left:e,right:t,typeName:Wt.ZodIntersection,...an(n)});class _a extends un{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==mt.array)return vt(r,{code:He.invalid_type,expected:mt.array,received:r.parsedType}),Zt;if(r.data.length<this._def.items.length)return vt(r,{code:He.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Zt;!this._def.rest&&r.data.length>this._def.items.length&&(vt(r,{code:He.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((a,c)=>{const d=this._def.items[c]||this._def.rest;return d?d._parse(new Ca(r,a,r.path,c)):null}).filter(a=>!!a);return r.common.async?Promise.all(s).then(a=>co.mergeArray(n,a)):co.mergeArray(n,s)}get items(){return this._def.items}rest(t){return new _a({...this._def,rest:t})}}_a.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new _a({items:e,typeName:Wt.ZodTuple,rest:null,...an(t)})};class Wd extends un{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==mt.object)return vt(r,{code:He.invalid_type,expected:mt.object,received:r.parsedType}),Zt;const o=[],s=this._def.keyType,a=this._def.valueType;for(const c in r.data)o.push({key:s._parse(new Ca(r,c,r.path,c)),value:a._parse(new Ca(r,r.data[c],r.path,c))});return r.common.async?co.mergeObjectAsync(n,o):co.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof un?new Wd({keyType:t,valueType:n,typeName:Wt.ZodRecord,...an(r)}):new Wd({keyType:Ls.create(),valueType:t,typeName:Wt.ZodRecord,...an(n)})}}class Jh extends un{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==mt.map)return vt(r,{code:He.invalid_type,expected:mt.map,received:r.parsedType}),Zt;const o=this._def.keyType,s=this._def.valueType,a=[...r.data.entries()].map(([c,d],f)=>({key:o._parse(new Ca(r,c,r.path,[f,"key"])),value:s._parse(new Ca(r,d,r.path,[f,"value"]))}));if(r.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const d of a){const f=await d.key,h=await d.value;if(f.status==="aborted"||h.status==="aborted")return Zt;(f.status==="dirty"||h.status==="dirty")&&n.dirty(),c.set(f.value,h.value)}return{status:n.value,value:c}})}else{const c=new Map;for(const d of a){const f=d.key,h=d.value;if(f.status==="aborted"||h.status==="aborted")return Zt;(f.status==="dirty"||h.status==="dirty")&&n.dirty(),c.set(f.value,h.value)}return{status:n.value,value:c}}}}Jh.create=(e,t,n)=>new Jh({valueType:t,keyType:e,typeName:Wt.ZodMap,...an(n)});class $l extends un{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==mt.set)return vt(r,{code:He.invalid_type,expected:mt.set,received:r.parsedType}),Zt;const o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(vt(r,{code:He.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()),o.maxSize!==null&&r.data.size>o.maxSize.value&&(vt(r,{code:He.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());const s=this._def.valueType;function a(d){const f=new Set;for(const h of d){if(h.status==="aborted")return Zt;h.status==="dirty"&&n.dirty(),f.add(h.value)}return{status:n.value,value:f}}const c=[...r.data.values()].map((d,f)=>s._parse(new Ca(r,d,r.path,f)));return r.common.async?Promise.all(c).then(d=>a(d)):a(c)}min(t,n){return new $l({...this._def,minSize:{value:t,message:Nt.toString(n)}})}max(t,n){return new $l({...this._def,maxSize:{value:t,message:Nt.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}$l.create=(e,t)=>new $l({valueType:e,minSize:null,maxSize:null,typeName:Wt.ZodSet,...an(t)});class Vc extends un{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==mt.function)return vt(n,{code:He.invalid_type,expected:mt.function,received:n.parsedType}),Zt;function r(c,d){return Yh({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,qh(),$d].filter(f=>!!f),issueData:{code:He.invalid_arguments,argumentsError:d}})}function o(c,d){return Yh({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,qh(),$d].filter(f=>!!f),issueData:{code:He.invalid_return_type,returnTypeError:d}})}const s={errorMap:n.common.contextualErrorMap},a=n.data;return this._def.returns instanceof nu?xo(async(...c)=>{const d=new Vs([]),f=await this._def.args.parseAsync(c,s).catch(v=>{throw d.addIssue(r(c,v)),d}),h=await a(...f);return await this._def.returns._def.type.parseAsync(h,s).catch(v=>{throw d.addIssue(o(h,v)),d})}):xo((...c)=>{const d=this._def.args.safeParse(c,s);if(!d.success)throw new Vs([r(c,d.error)]);const f=a(...d.data),h=this._def.returns.safeParse(f,s);if(!h.success)throw new Vs([o(f,h.error)]);return h.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Vc({...this._def,args:_a.create(t).rest(kl.create())})}returns(t){return new Vc({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new Vc({args:t||_a.create([]).rest(kl.create()),returns:n||kl.create(),typeName:Wt.ZodFunction,...an(r)})}}class Ud extends un{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Ud.create=(e,t)=>new Ud({getter:e,typeName:Wt.ZodLazy,...an(t)});class Gd extends un{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return vt(n,{received:n.data,code:He.invalid_literal,expected:this._def.value}),Zt}return{status:"valid",value:t.data}}get value(){return this._def.value}}Gd.create=(e,t)=>new Gd({value:e,typeName:Wt.ZodLiteral,...an(t)});function IE(e,t){return new Vi({values:e,typeName:Wt.ZodEnum,...an(t)})}class Vi extends un{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return vt(n,{expected:Rn.joinValues(r),received:n.parsedType,code:He.invalid_type}),Zt}if(this._def.values.indexOf(t.data)===-1){const n=this._getOrReturnCtx(t),r=this._def.values;return vt(n,{received:n.data,code:He.invalid_enum_value,options:r}),Zt}return xo(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t){return Vi.create(t)}exclude(t){return Vi.create(this.options.filter(n=>!t.includes(n)))}}Vi.create=IE;class qd extends un{_parse(t){const n=Rn.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==mt.string&&r.parsedType!==mt.number){const o=Rn.objectValues(n);return vt(r,{expected:Rn.joinValues(o),received:r.parsedType,code:He.invalid_type}),Zt}if(n.indexOf(t.data)===-1){const o=Rn.objectValues(n);return vt(r,{received:r.data,code:He.invalid_enum_value,options:o}),Zt}return xo(t.data)}get enum(){return this._def.values}}qd.create=(e,t)=>new qd({values:e,typeName:Wt.ZodNativeEnum,...an(t)});class nu extends un{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==mt.promise&&n.common.async===!1)return vt(n,{code:He.invalid_type,expected:mt.promise,received:n.parsedType}),Zt;const r=n.parsedType===mt.promise?n.data:Promise.resolve(n.data);return xo(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}}nu.create=(e,t)=>new nu({type:e,typeName:Wt.ZodPromise,...an(t)});class Js extends un{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Wt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),o=this._def.effect||null;if(o.type==="preprocess"){const a=o.transform(r.data);return r.common.async?Promise.resolve(a).then(c=>this._def.schema._parseAsync({data:c,path:r.path,parent:r})):this._def.schema._parseSync({data:a,path:r.path,parent:r})}const s={addIssue:a=>{vt(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="refinement"){const a=c=>{const d=o.refinement(c,s);if(r.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(r.common.async===!1){const c=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return c.status==="aborted"?Zt:(c.status==="dirty"&&n.dirty(),a(c.value),{status:n.value,value:c.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(c=>c.status==="aborted"?Zt:(c.status==="dirty"&&n.dirty(),a(c.value).then(()=>({status:n.value,value:c.value}))))}if(o.type==="transform")if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Kh(a))return a;const c=o.transform(a.value,s);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:c}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>Kh(a)?Promise.resolve(o.transform(a.value,s)).then(c=>({status:n.value,value:c})):a);Rn.assertNever(o)}}Js.create=(e,t,n)=>new Js({schema:e,typeName:Wt.ZodEffects,effect:t,...an(n)});Js.createWithPreprocess=(e,t,n)=>new Js({schema:t,effect:{type:"preprocess",transform:e},typeName:Wt.ZodEffects,...an(n)});class Va extends un{_parse(t){return this._getType(t)===mt.undefined?xo(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Va.create=(e,t)=>new Va({innerType:e,typeName:Wt.ZodOptional,...an(t)});class Ll extends un{_parse(t){return this._getType(t)===mt.null?xo(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Ll.create=(e,t)=>new Ll({innerType:e,typeName:Wt.ZodNullable,...an(t)});class Yd extends un{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===mt.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Yd.create=(e,t)=>new Yd({innerType:e,typeName:Wt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...an(t)});class em extends un{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Xh(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Vs(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Vs(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}em.create=(e,t)=>new em({innerType:e,typeName:Wt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...an(t)});class tm extends un{_parse(t){if(this._getType(t)!==mt.nan){const r=this._getOrReturnCtx(t);return vt(r,{code:He.invalid_type,expected:mt.nan,received:r.parsedType}),Zt}return{status:"valid",value:t.data}}}tm.create=e=>new tm({typeName:Wt.ZodNaN,...an(e)});const kU=Symbol("zod_brand");class OE extends un{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class wf extends un{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Zt:s.status==="dirty"?(n.dirty(),EE(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Zt:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(t,n){return new wf({in:t,out:n,typeName:Wt.ZodPipeline})}}const TE=(e,t={},n)=>e?tu.create().superRefine((r,o)=>{var s,a;if(!e(r)){const c=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,d=(a=(s=c.fatal)!==null&&s!==void 0?s:n)!==null&&a!==void 0?a:!0,f=typeof c=="string"?{message:c}:c;o.addIssue({code:"custom",...f,fatal:d})}}):tu.create(),PU={object:Sr.lazycreate};var Wt;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline"})(Wt||(Wt={}));const jU=(e,t={message:`Input not instance of ${e.name}`})=>TE(n=>n instanceof e,t),RE=Ls.create,ME=Fi.create,EU=tm.create,IU=Hi.create,DE=Ld.create,OU=zl.create,TU=Zh.create,RU=Bd.create,MU=Fd.create,DU=tu.create,AU=kl.create,NU=Qa.create,zU=Qh.create,$U=Ws.create,LU=Sr.create,BU=Sr.strictCreate,FU=Hd.create,HU=zg.create,VU=Vd.create,WU=_a.create,UU=Wd.create,GU=Jh.create,qU=$l.create,YU=Vc.create,KU=Ud.create,XU=Gd.create,ZU=Vi.create,QU=qd.create,JU=nu.create,t4=Js.create,eG=Va.create,tG=Ll.create,nG=Js.createWithPreprocess,rG=wf.create,oG=()=>RE().optional(),sG=()=>ME().optional(),aG=()=>DE().optional(),iG={string:e=>Ls.create({...e,coerce:!0}),number:e=>Fi.create({...e,coerce:!0}),boolean:e=>Ld.create({...e,coerce:!0}),bigint:e=>Hi.create({...e,coerce:!0}),date:e=>zl.create({...e,coerce:!0})},lG=Zt;var na=Object.freeze({__proto__:null,defaultErrorMap:$d,setErrorMap:fU,getErrorMap:qh,makeIssue:Yh,EMPTY_PATH:pU,addIssueToContext:vt,ParseStatus:co,INVALID:Zt,DIRTY:EE,OK:xo,isAborted:fy,isDirty:py,isValid:Kh,isAsync:Xh,get util(){return Rn},get objectUtil(){return dy},ZodParsedType:mt,getParsedType:ji,ZodType:un,ZodString:Ls,ZodNumber:Fi,ZodBigInt:Hi,ZodBoolean:Ld,ZodDate:zl,ZodSymbol:Zh,ZodUndefined:Bd,ZodNull:Fd,ZodAny:tu,ZodUnknown:kl,ZodNever:Qa,ZodVoid:Qh,ZodArray:Ws,ZodObject:Sr,ZodUnion:Hd,ZodDiscriminatedUnion:zg,ZodIntersection:Vd,ZodTuple:_a,ZodRecord:Wd,ZodMap:Jh,ZodSet:$l,ZodFunction:Vc,ZodLazy:Ud,ZodLiteral:Gd,ZodEnum:Vi,ZodNativeEnum:qd,ZodPromise:nu,ZodEffects:Js,ZodTransformer:Js,ZodOptional:Va,ZodNullable:Ll,ZodDefault:Yd,ZodCatch:em,ZodNaN:tm,BRAND:kU,ZodBranded:OE,ZodPipeline:wf,custom:TE,Schema:un,ZodSchema:un,late:PU,get ZodFirstPartyTypeKind(){return Wt},coerce:iG,any:DU,array:$U,bigint:IU,boolean:DE,date:OU,discriminatedUnion:HU,effect:t4,enum:ZU,function:YU,instanceof:jU,intersection:VU,lazy:KU,literal:XU,map:GU,nan:EU,nativeEnum:QU,never:NU,null:MU,nullable:tG,number:ME,object:LU,oboolean:aG,onumber:sG,optional:eG,ostring:oG,pipeline:rG,preprocess:nG,promise:JU,record:UU,set:qU,strictObject:BU,string:RE,symbol:TU,transformer:t4,tuple:WU,undefined:RU,union:FU,unknown:AU,void:zU,NEVER:lG,ZodIssueCode:He,quotelessJson:dU,ZodError:Vs});const cG=na.string(),kp=e=>cG.safeParse(e).success,uG=na.string(),Pp=e=>uG.safeParse(e).success,dG=na.number().int().min(1),n4=e=>dG.safeParse(e).success,fG=na.number().min(1),r4=e=>fG.safeParse(e).success,pG=na.enum(q8),o4=e=>pG.safeParse(e).success,hG=na.number().int().min(0).max(Yy),s4=e=>hG.safeParse(e).success,mG=na.number().multipleOf(8).min(64),a4=e=>mG.safeParse(e).success,gG=na.number().multipleOf(8).min(64),i4=e=>gG.safeParse(e).success,vG=na.string();na.string();const l4=e=>vG.safeParse(e).success,yG=na.number().min(0).max(1),c4=e=>yG.safeParse(e).success,yx=()=>{const e=ce(),t=nf(),{t:n}=we(),r=p.useCallback(()=>{t({title:n("toast.parameterSet"),status:"info",duration:2500,isClosable:!0})},[n,t]),o=p.useCallback(()=>{t({title:n("toast.parameterNotSet"),status:"warning",duration:2500,isClosable:!0})},[n,t]),s=p.useCallback(()=>{t({title:n("toast.parametersSet"),status:"info",duration:2500,isClosable:!0})},[n,t]),a=p.useCallback(()=>{t({title:n("toast.parametersNotSet"),status:"warning",duration:2500,isClosable:!0})},[n,t]),c=p.useCallback((I,O)=>{if(kp(I)||Pp(O)){kp(I)&&e(th(I)),Pp(O)&&e(nh(O)),r();return}o()},[e,r,o]),d=p.useCallback(I=>{if(!kp(I)){o();return}e(th(I)),r()},[e,r,o]),f=p.useCallback(I=>{if(!Pp(I)){o();return}e(nh(I)),r()},[e,r,o]),h=p.useCallback(I=>{if(!s4(I)){o();return}e(vh(I)),r()},[e,r,o]),m=p.useCallback(I=>{if(!r4(I)){o();return}e(yh(I)),r()},[e,r,o]),v=p.useCallback(I=>{if(!l4(I)){o();return}e(w1(I)),r()},[e,r,o]),y=p.useCallback(I=>{if(!o4(I)){o();return}e(S1(I)),r()},[e,r,o]),S=p.useCallback(I=>{if(!n4(I)){o();return}e(bh(I)),r()},[e,r,o]),x=p.useCallback(I=>{if(!a4(I)){o();return}e(xh(I)),r()},[e,r,o]),w=p.useCallback(I=>{if(!i4(I)){o();return}e(wh(I)),r()},[e,r,o]),_=p.useCallback(I=>{if(!c4(I)){o();return}e(Sh(I)),r()},[e,r,o]),k=p.useCallback(async I=>{if(!Y8(I)){o();return}e(Ch(I.image_name)),r()},[e,r,o]),P=p.useCallback(I=>{e(Ch(I))},[e]),j=p.useCallback(I=>{if(!I||!I.metadata){a();return}const{cfg_scale:O,height:T,model:R,positive_conditioning:M,negative_conditioning:D,scheduler:A,seed:G,steps:$,width:H,strength:U,clip:q,extra:z,latents:L,unet:V,vae:W}=I.metadata;r4(O)&&e(yh(O)),l4(R)&&e(w1(R)),kp(M)&&e(th(M)),Pp(D)&&e(nh(D)),o4(A)&&e(S1(A)),s4(G)&&e(vh(G)),n4($)&&e(bh($)),a4(H)&&e(xh(H)),i4(T)&&e(wh(T)),c4(U)&&e(Sh(U)),s()},[a,s,e]);return{recallBothPrompts:c,recallPositivePrompt:d,recallNegativePrompt:f,recallSeed:h,recallInitialImage:k,recallCfgScale:m,recallModel:v,recallScheduler:y,recallSteps:S,recallWidth:x,recallHeight:w,recallStrength:_,recallAllParameters:j,sendToImageToImage:P}},bG=Oe([Bn,(e,t)=>t],({gallery:e,batch:t},n)=>{const r=e.selection.length,o=t.imageNames.includes(n.image_name);return{selectionCount:r,isInBatch:o}},Lt),xG=({image:e,children:t})=>{var R,M;const{selectionCount:n,isInBatch:r}=Y(D=>bG(D,e)),o=ce(),{t:s}=we(),a=nf(),c=Jr("lightbox").isFeatureEnabled,d=Jr("unifiedCanvas").isFeatureEnabled,{onClickAddToBoard:f}=p.useContext(t3),h=p.useCallback(()=>{e&&o(Ky(e))},[o,e]),{recallBothPrompts:m,recallSeed:v,recallAllParameters:y}=yx(),[S]=K8(),x=p.useCallback(()=>{var D,A;m((D=e.metadata)==null?void 0:D.positive_conditioning,(A=e.metadata)==null?void 0:A.negative_conditioning)},[(R=e.metadata)==null?void 0:R.negative_conditioning,(M=e.metadata)==null?void 0:M.positive_conditioning,m]),w=p.useCallback(()=>{var D;v((D=e.metadata)==null?void 0:D.seed)},[e,v]),_=p.useCallback(()=>{o(n3()),o(Ch(e))},[o,e]),k=()=>{o(r3()),o(o3(e)),o(tg()),o(ml("unifiedCanvas")),a({title:s("toast.sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0})},P=p.useCallback(()=>{y(e)},[e,y]),j=()=>{},I=p.useCallback(()=>{f(e)},[e,f]),O=p.useCallback(()=>{e.board_id&&S({board_id:e.board_id,image_name:e.image_name})},[e.board_id,e.image_name,S]),T=()=>{window.open(e.image_url,"_blank")};return p.useCallback(()=>{o(X8())},[o]),p.useCallback(()=>{o(Z8([e.image_name]))},[o,e.image_name]),i.jsx(PE,{menuProps:{size:"sm",isLazy:!0},renderMenu:()=>{var D,A,G;return i.jsx(gf,{sx:{visibility:"visible !important"},children:n===1?i.jsxs(i.Fragment,{children:[i.jsx(vo,{icon:i.jsx(gx,{}),onClickCapture:T,children:s("common.openInNewTab")}),c&&i.jsx(vo,{icon:i.jsx(dx,{}),onClickCapture:j,children:s("parameters.openInViewer")}),i.jsx(vo,{icon:i.jsx(ph,{}),onClickCapture:x,isDisabled:((D=e==null?void 0:e.metadata)==null?void 0:D.positive_conditioning)===void 0,children:s("parameters.usePrompt")}),i.jsx(vo,{icon:i.jsx(ph,{}),onClickCapture:w,isDisabled:((A=e==null?void 0:e.metadata)==null?void 0:A.seed)===void 0,children:s("parameters.useSeed")}),i.jsx(vo,{icon:i.jsx(ph,{}),onClickCapture:P,isDisabled:!["t2l","l2l","inpaint"].includes(String((G=e==null?void 0:e.metadata)==null?void 0:G.type)),children:s("parameters.useAll")}),i.jsx(vo,{icon:i.jsx(Gh,{}),onClickCapture:_,id:"send-to-img2img",children:s("parameters.sendToImg2Img")}),d&&i.jsx(vo,{icon:i.jsx(Gh,{}),onClickCapture:k,id:"send-to-canvas",children:s("parameters.sendToUnifiedCanvas")}),i.jsx(vo,{icon:i.jsx(fh,{}),onClickCapture:I,children:e.board_id?"Change Board":"Add to Board"}),e.board_id&&i.jsx(vo,{icon:i.jsx(fh,{}),onClickCapture:O,children:"Remove from Board"}),i.jsx(vo,{sx:{color:"error.600",_dark:{color:"error.300"}},icon:i.jsx(Mo,{}),onClickCapture:h,children:s("gallery.deleteImage")})]}):i.jsxs(i.Fragment,{children:[i.jsx(vo,{isDisabled:!0,icon:i.jsx(fh,{}),onClickCapture:I,children:"Move Selection to Board"}),i.jsx(vo,{sx:{color:"error.600",_dark:{color:"error.300"}},icon:i.jsx(Mo,{}),onClickCapture:h,children:"Delete Selection"})]})})},children:t})},wG=p.memo(xG),SG=e=>Oe([Bn],({gallery:t})=>{const n=t.selection.includes(e),r=t.selection.length;return{isSelected:n,selectionCount:r}},Lt),CG=e=>{const{imageDTO:t}=e,{image_url:n,thumbnail_url:r,image_name:o}=t,s=p.useMemo(()=>SG(o),[o]),{isSelected:a,selectionCount:c}=Y(s),d=ce();we();const f=p.useCallback(v=>{v.shiftKey?d(Q8(e.imageDTO.image_name)):v.ctrlKey||v.metaKey?d(J8(e.imageDTO.image_name)):d(C1(e.imageDTO.image_name))},[d,e.imageDTO.image_name]),h=p.useCallback(v=>{v.stopPropagation(),t&&d(Ky(t))},[d,t]),m=p.useMemo(()=>{if(c>1)return{id:"gallery-image",payloadType:"GALLERY_SELECTION"};if(t)return{id:"gallery-image",payloadType:"IMAGE_DTO",payload:{imageDTO:t}}},[t,c]);return i.jsx(ut,{sx:{w:"full",h:"full",touchAction:"none"},children:i.jsx(wG,{image:t,children:v=>i.jsx(ut,{position:"relative",userSelect:"none",ref:v,sx:{display:"flex",justifyContent:"center",alignItems:"center",aspectRatio:"1/1"},children:i.jsx(Nl,{onClick:f,imageDTO:t,draggableData:m,isSelected:a,minSize:0,onClickReset:h,resetIcon:i.jsx(Mo,{}),resetTooltip:"Delete image",imageSx:{w:"full",h:"full"},withResetIcon:!0,isDropDisabled:!0,isUploadDisabled:!0})},o)})})},_G=p.memo(CG),kG=z9(e=>{e(s3(!0))},300),ea=()=>(e,t)=>{Gr(t())==="unifiedCanvas"&&kG(e)},$g=0,Yl=1,_u=2,AE=4;function PG(e,t){return n=>e(t(n))}function jG(e,t){return t(e)}function NE(e,t){return n=>e(t,n)}function u4(e,t){return()=>e(t)}function bx(e,t){return t(e),e}function Kl(...e){return e}function EG(e){e()}function d4(e){return()=>e}function IG(...e){return()=>{e.map(EG)}}function OG(e){return e!==void 0}function Lg(){}function ws(e,t){return e(Yl,t)}function ul(e,t){e($g,t)}function xx(e){e(_u)}function Bg(e){return e(AE)}function sr(e,t){return ws(e,NE(t,$g))}function Vr(){const e=[];return(t,n)=>{switch(t){case _u:e.splice(0,e.length);return;case Yl:return e.push(n),()=>{const r=e.indexOf(n);r>-1&&e.splice(r,1)};case $g:e.slice().forEach(r=>{r(n)});return;default:throw new Error(`unrecognized action ${t}`)}}}function sn(e){let t=e;const n=Vr();return(r,o)=>{switch(r){case Yl:o(t);break;case $g:t=o;break;case AE:return t}return n(r,o)}}function TG(e){let t,n;const r=()=>t&&t();return function(o,s){switch(o){case Yl:return s?n===s?void 0:(r(),n=s,t=ws(e,s),t):(r(),Lg);case _u:r(),n=null;return;default:throw new Error(`unrecognized action ${o}`)}}}function vd(e){return bx(Vr(),t=>sr(e,t))}function Wc(e,t){return bx(sn(t),n=>sr(e,n))}function RG(...e){return t=>e.reduceRight(jG,t)}function pn(e,...t){const n=RG(...t);return(r,o)=>{switch(r){case Yl:return ws(e,n(o));case _u:xx(e);return}}}function zE(e,t){return e===t}function Oo(e=zE){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function hs(e){return t=>n=>{e(n)&&t(n)}}function fr(e){return t=>PG(t,e)}function dl(e){return t=>()=>t(e)}function jp(e,t){return n=>r=>n(t=e(t,r))}function f4(e){return t=>n=>{e>0?e--:t(n)}}function Ep(e){let t=null,n;return r=>o=>{t=o,!n&&(n=setTimeout(()=>{n=void 0,r(t)},e))}}function p4(e){let t,n;return r=>o=>{t=o,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function Ri(...e){const t=new Array(e.length);let n=0,r=null;const o=Math.pow(2,e.length)-1;return e.forEach((s,a)=>{const c=Math.pow(2,a);ws(s,d=>{const f=n;n=n|c,t[a]=d,f!==o&&n===o&&r&&(r(),r=null)})}),s=>a=>{const c=()=>s([a].concat(t));n===o?c():r=c}}function h4(...e){return function(t,n){switch(t){case Yl:return IG(...e.map(r=>ws(r,n)));case _u:return;default:throw new Error(`unrecognized action ${t}`)}}}function pr(e,t=zE){return pn(e,Oo(t))}function Bl(...e){const t=Vr(),n=new Array(e.length);let r=0;const o=Math.pow(2,e.length)-1;return e.forEach((s,a)=>{const c=Math.pow(2,a);ws(s,d=>{n[a]=d,r=r|c,r===o&&ul(t,n)})}),function(s,a){switch(s){case Yl:return r===o&&a(n),ws(t,a);case _u:return xx(t);default:throw new Error(`unrecognized action ${s}`)}}}function Ia(e,t=[],{singleton:n}={singleton:!0}){return{id:MG(),constructor:e,dependencies:t,singleton:n}}const MG=()=>Symbol();function DG(e){const t=new Map,n=({id:r,constructor:o,dependencies:s,singleton:a})=>{if(a&&t.has(r))return t.get(r);const c=o(s.map(d=>n(d)));return a&&t.set(r,c),c};return n(e)}function AG(e,t){const n={},r={};let o=0;const s=e.length;for(;o<s;)r[e[o]]=1,o+=1;for(const a in t)r.hasOwnProperty(a)||(n[a]=t[a]);return n}const Ip=typeof document<"u"?F.useLayoutEffect:F.useEffect;function NG(e,t,n){const r=Object.keys(t.required||{}),o=Object.keys(t.optional||{}),s=Object.keys(t.methods||{}),a=Object.keys(t.events||{}),c=F.createContext({});function d(x,w){x.propsReady&&ul(x.propsReady,!1);for(const _ of r){const k=x[t.required[_]];ul(k,w[_])}for(const _ of o)if(_ in w){const k=x[t.optional[_]];ul(k,w[_])}x.propsReady&&ul(x.propsReady,!0)}function f(x){return s.reduce((w,_)=>(w[_]=k=>{const P=x[t.methods[_]];ul(P,k)},w),{})}function h(x){return a.reduce((w,_)=>(w[_]=TG(x[t.events[_]]),w),{})}return{Component:F.forwardRef((x,w)=>{const{children:_,...k}=x,[P]=F.useState(()=>bx(DG(e),I=>d(I,k))),[j]=F.useState(u4(h,P));return Ip(()=>{for(const I of a)I in k&&ws(j[I],k[I]);return()=>{Object.values(j).map(xx)}},[k,j,P]),Ip(()=>{d(P,k)}),F.useImperativeHandle(w,d4(f(P))),F.createElement(c.Provider,{value:P},n?F.createElement(n,AG([...r,...o,...a],k),_):_)}),usePublisher:x=>F.useCallback(NE(ul,F.useContext(c)[x]),[x]),useEmitterValue:x=>{const _=F.useContext(c)[x],[k,P]=F.useState(u4(Bg,_));return Ip(()=>ws(_,j=>{j!==k&&P(d4(j))}),[_,k]),k},useEmitter:(x,w)=>{const k=F.useContext(c)[x];Ip(()=>ws(k,w),[w,k])}}}const zG=typeof document<"u"?F.useLayoutEffect:F.useEffect,$G=zG;var wx=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(wx||{});const LG={[0]:"debug",[1]:"log",[2]:"warn",[3]:"error"},BG=()=>typeof globalThis>"u"?window:globalThis,$E=Ia(()=>{const e=sn(3);return{log:sn((n,r,o=1)=>{var s;const a=(s=BG().VIRTUOSO_LOG_LEVEL)!=null?s:Bg(e);o>=a&&console[LG[o]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",n,r)}),logLevel:e}},[],{singleton:!0});function LE(e,t=!0){const n=F.useRef(null);let r=o=>{};if(typeof ResizeObserver<"u"){const o=F.useMemo(()=>new ResizeObserver(s=>{const a=s[0].target;a.offsetParent!==null&&e(a)}),[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 Fg(e,t=!0){return LE(e,t).callbackRef}function nm(e,t){return Math.round(e.getBoundingClientRect()[t])}function BE(e,t){return Math.abs(e-t)<1.01}function FE(e,t,n,r=Lg,o){const s=F.useRef(null),a=F.useRef(null),c=F.useRef(null),d=F.useCallback(m=>{const v=m.target,y=v===window||v===document,S=y?window.pageYOffset||document.documentElement.scrollTop:v.scrollTop,x=y?document.documentElement.scrollHeight:v.scrollHeight,w=y?window.innerHeight:v.offsetHeight,_=()=>{e({scrollTop:Math.max(S,0),scrollHeight:x,viewportHeight:w})};m.suppressFlushSync?_():e7.flushSync(_),a.current!==null&&(S===a.current||S<=0||S===x-w)&&(a.current=null,t(!0),c.current&&(clearTimeout(c.current),c.current=null))},[e,t]);F.useEffect(()=>{const m=o||s.current;return r(o||s.current),d({target:m,suppressFlushSync:!0}),m.addEventListener("scroll",d,{passive:!0}),()=>{r(null),m.removeEventListener("scroll",d)}},[s,d,n,r,o]);function f(m){const v=s.current;if(!v||"offsetHeight"in v&&v.offsetHeight===0)return;const y=m.behavior==="smooth";let S,x,w;v===window?(x=Math.max(nm(document.documentElement,"height"),document.documentElement.scrollHeight),S=window.innerHeight,w=document.documentElement.scrollTop):(x=v.scrollHeight,S=nm(v,"height"),w=v.scrollTop);const _=x-S;if(m.top=Math.ceil(Math.max(Math.min(_,m.top),0)),BE(S,x)||m.top===w){e({scrollTop:w,scrollHeight:x,viewportHeight:S}),y&&t(!0);return}y?(a.current=m.top,c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{c.current=null,a.current=null,t(!0)},1e3)):a.current=null,v.scrollTo(m)}function h(m){s.current.scrollBy(m)}return{scrollerRef:s,scrollByCallback:h,scrollToCallback:f}}const Hg=Ia(()=>{const e=Vr(),t=Vr(),n=sn(0),r=Vr(),o=sn(0),s=Vr(),a=Vr(),c=sn(0),d=sn(0),f=sn(0),h=sn(0),m=Vr(),v=Vr(),y=sn(!1);return sr(pn(e,fr(({scrollTop:S})=>S)),t),sr(pn(e,fr(({scrollHeight:S})=>S)),a),sr(t,o),{scrollContainerState:e,scrollTop:t,viewportHeight:s,headerHeight:c,fixedHeaderHeight:d,fixedFooterHeight:f,footerHeight:h,scrollHeight:a,smoothScrollTargetReached:r,scrollTo:m,scrollBy:v,statefulScrollTop:o,deviation:n,scrollingInProgress:y}},[],{singleton:!0}),FG=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function HG(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!FG)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const rm="up",yd="down",VG="none",WG={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},UG=0,HE=Ia(([{scrollContainerState:e,scrollTop:t,viewportHeight:n,headerHeight:r,footerHeight:o,scrollBy:s}])=>{const a=sn(!1),c=sn(!0),d=Vr(),f=Vr(),h=sn(4),m=sn(UG),v=Wc(pn(h4(pn(pr(t),f4(1),dl(!0)),pn(pr(t),f4(1),dl(!1),p4(100))),Oo()),!1),y=Wc(pn(h4(pn(s,dl(!0)),pn(s,dl(!1),p4(200))),Oo()),!1);sr(pn(Bl(pr(t),pr(m)),fr(([k,P])=>k<=P),Oo()),c),sr(pn(c,Ep(50)),f);const S=vd(pn(Bl(e,pr(n),pr(r),pr(o),pr(h)),jp((k,[{scrollTop:P,scrollHeight:j},I,O,T,R])=>{const M=P+I-j>-R,D={viewportHeight:I,scrollTop:P,scrollHeight:j};if(M){let G,$;return P>k.state.scrollTop?(G="SCROLLED_DOWN",$=k.state.scrollTop-P):(G="SIZE_DECREASED",$=k.state.scrollTop-P||k.scrollTopDelta),{atBottom:!0,state:D,atBottomBecause:G,scrollTopDelta:$}}let A;return D.scrollHeight>k.state.scrollHeight?A="SIZE_INCREASED":I<k.state.viewportHeight?A="VIEWPORT_HEIGHT_DECREASING":P<k.state.scrollTop?A="SCROLLING_UPWARDS":A="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:A,state:D}},WG),Oo((k,P)=>k&&k.atBottom===P.atBottom))),x=Wc(pn(e,jp((k,{scrollTop:P,scrollHeight:j,viewportHeight:I})=>{if(BE(k.scrollHeight,j))return{scrollTop:P,scrollHeight:j,jump:0,changed:!1};{const O=j-(P+I)<1;return k.scrollTop!==P&&O?{scrollHeight:j,scrollTop:P,jump:k.scrollTop-P,changed:!0}:{scrollHeight:j,scrollTop:P,jump:0,changed:!0}}},{scrollHeight:0,jump:0,scrollTop:0,changed:!1}),hs(k=>k.changed),fr(k=>k.jump)),0);sr(pn(S,fr(k=>k.atBottom)),a),sr(pn(a,Ep(50)),d);const w=sn(yd);sr(pn(e,fr(({scrollTop:k})=>k),Oo(),jp((k,P)=>Bg(y)?{direction:k.direction,prevScrollTop:P}:{direction:P<k.prevScrollTop?rm:yd,prevScrollTop:P},{direction:yd,prevScrollTop:0}),fr(k=>k.direction)),w),sr(pn(e,Ep(50),dl(VG)),w);const _=sn(0);return sr(pn(v,hs(k=>!k),dl(0)),_),sr(pn(t,Ep(100),Ri(v),hs(([k,P])=>!!P),jp(([k,P],[j])=>[P,j],[0,0]),fr(([k,P])=>P-k)),_),{isScrolling:v,isAtTop:c,isAtBottom:a,atBottomState:S,atTopStateChange:f,atBottomStateChange:d,scrollDirection:w,atBottomThreshold:h,atTopThreshold:m,scrollVelocity:_,lastJumpDueToItemResize:x}},Kl(Hg)),GG=Ia(([{log:e}])=>{const t=sn(!1),n=vd(pn(t,hs(r=>r),Oo()));return ws(t,r=>{r&&Bg(e)("props updated",{},wx.DEBUG)}),{propsReady:t,didMount:n}},Kl($E),{singleton:!0});function my(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}function qG(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}const om="top",sm="bottom",m4="none";function g4(e,t,n){return typeof e=="number"?n===rm&&t===om||n===yd&&t===sm?e:0:n===rm?t===om?e.main:e.reverse:t===sm?e.main:e.reverse}function v4(e,t){return typeof e=="number"?e:e[t]||0}const YG=Ia(([{scrollTop:e,viewportHeight:t,deviation:n,headerHeight:r,fixedHeaderHeight:o}])=>{const s=Vr(),a=sn(0),c=sn(0),d=sn(0),f=Wc(pn(Bl(pr(e),pr(t),pr(r),pr(s,my),pr(d),pr(a),pr(o),pr(n),pr(c)),fr(([h,m,v,[y,S],x,w,_,k,P])=>{const j=h-k,I=w+_,O=Math.max(v-j,0);let T=m4;const R=v4(P,om),M=v4(P,sm);return y-=k,y+=v+_,S+=v+_,S-=k,y>h+I-R&&(T=rm),S<h-O+m+M&&(T=yd),T!==m4?[Math.max(j-v-g4(x,om,T)-R,0),j-O-_+m+g4(x,sm,T)+M]:null}),hs(h=>h!=null),Oo(my)),[0,0]);return{listBoundary:s,overscan:d,topListHeight:a,increaseViewportBy:c,visibleRange:f}},Kl(Hg),{singleton:!0}),KG=Ia(([{scrollVelocity:e}])=>{const t=sn(!1),n=Vr(),r=sn(!1);return sr(pn(e,Ri(r,t,n),hs(([o,s])=>!!s),fr(([o,s,a,c])=>{const{exit:d,enter:f}=s;if(a){if(d(o,c))return!1}else if(f(o,c))return!0;return a}),Oo()),t),ws(pn(Bl(t,e,n),Ri(r)),([[o,s,a],c])=>o&&c&&c.change&&c.change(s,a)),{isSeeking:t,scrollSeekConfiguration:r,scrollVelocity:e,scrollSeekRangeChanged:n}},Kl(HE),{singleton:!0});function XG(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}const ZG=Ia(([{scrollTo:e,scrollContainerState:t}])=>{const n=Vr(),r=Vr(),o=Vr(),s=sn(!1),a=sn(void 0);return sr(pn(Bl(n,r),fr(([{viewportHeight:c,scrollTop:d,scrollHeight:f},{offsetTop:h}])=>({scrollTop:Math.max(0,d-h),scrollHeight:f,viewportHeight:c}))),t),sr(pn(e,Ri(r),fr(([c,{offsetTop:d}])=>({...c,top:c.top+d}))),o),{useWindowScroll:s,customScrollParent:a,windowScrollContainerState:n,windowViewportRect:r,windowScrollTo:o}},Kl(Hg)),G0="-webkit-sticky",y4="sticky",VE=XG(()=>{if(typeof document>"u")return y4;const e=document.createElement("div");return e.style.position=G0,e.style.position===G0?G0:y4});function QG(e,t){const n=F.useRef(null),r=F.useCallback(c=>{if(c===null||!c.offsetParent)return;const d=c.getBoundingClientRect(),f=d.width;let h,m;if(t){const v=t.getBoundingClientRect(),y=d.top-v.top;h=v.height-Math.max(0,y),m=y+t.scrollTop}else h=window.innerHeight-Math.max(0,d.top),m=d.top+window.pageYOffset;n.current={offsetTop:m,visibleHeight:h,visibleWidth:f},e(n.current)},[e,t]),{callbackRef:o,ref:s}=LE(r),a=F.useCallback(()=>{r(s.current)},[r,s]);return F.useEffect(()=>{if(t){t.addEventListener("scroll",a);const c=new ResizeObserver(a);return c.observe(t),()=>{t.removeEventListener("scroll",a),c.unobserve(t)}}else return window.addEventListener("scroll",a),window.addEventListener("resize",a),()=>{window.removeEventListener("scroll",a),window.removeEventListener("resize",a)}},[a,t]),o}F.createContext(void 0);const WE=F.createContext(void 0);function JG(e){return e}VE();const eq={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},UE={width:"100%",height:"100%",position:"absolute",top:0};VE();function Pl(e,t){if(typeof e!="string")return{context:t}}function tq({usePublisher:e,useEmitter:t,useEmitterValue:n}){return F.memo(function({style:s,children:a,...c}){const d=e("scrollContainerState"),f=n("ScrollerComponent"),h=e("smoothScrollTargetReached"),m=n("scrollerRef"),v=n("context"),{scrollerRef:y,scrollByCallback:S,scrollToCallback:x}=FE(d,h,f,m);return t("scrollTo",x),t("scrollBy",S),F.createElement(f,{ref:y,style:{...eq,...s},"data-test-id":"virtuoso-scroller","data-virtuoso-scroller":!0,tabIndex:0,...c,...Pl(f,v)},a)})}function nq({usePublisher:e,useEmitter:t,useEmitterValue:n}){return F.memo(function({style:s,children:a,...c}){const d=e("windowScrollContainerState"),f=n("ScrollerComponent"),h=e("smoothScrollTargetReached"),m=n("totalListHeight"),v=n("deviation"),y=n("customScrollParent"),S=n("context"),{scrollerRef:x,scrollByCallback:w,scrollToCallback:_}=FE(d,h,f,Lg,y);return $G(()=>(x.current=y||window,()=>{x.current=null}),[x,y]),t("windowScrollTo",_),t("scrollBy",w),F.createElement(f,{style:{position:"relative",...s,...m!==0?{height:m+v}:{}},"data-virtuoso-scroller":!0,...c,...Pl(f,S)},a)})}const b4={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},rq={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},{round:x4,ceil:w4,floor:am,min:q0,max:bd}=Math;function oq(e){return{...rq,items:e}}function Y0(e,t,n){return Array.from({length:t-e+1}).map((r,o)=>({index:o+e,data:n==null?void 0:n[o+e]}))}function sq(e,t){return e&&e.column===t.column&&e.row===t.row}function S4(e,t){return e&&e.width===t.width&&e.height===t.height}const aq=Ia(([{overscan:e,visibleRange:t,listBoundary:n},{scrollTop:r,viewportHeight:o,scrollBy:s,scrollTo:a,smoothScrollTargetReached:c,scrollContainerState:d,footerHeight:f,headerHeight:h},m,v,{propsReady:y,didMount:S},{windowViewportRect:x,windowScrollTo:w,useWindowScroll:_,customScrollParent:k,windowScrollContainerState:P},j])=>{const I=sn(0),O=sn(0),T=sn(b4),R=sn({height:0,width:0}),M=sn({height:0,width:0}),D=Vr(),A=Vr(),G=sn(0),$=sn(void 0),H=sn({row:0,column:0});sr(pn(S,Ri(O,$),hs(([W,te])=>W&&te!==0),fr(([,W,te])=>({items:Y0(0,W-1,te),top:0,bottom:0,offsetBottom:0,offsetTop:0,itemHeight:0,itemWidth:0}))),T),sr(pn(Bl(pr(I),t,pr(H,sq),pr(M,S4),pr(R,S4),$),fr(([W,[te,fe],ae,J,B,oe])=>{const{row:le,column:ge}=ae,{height:se,width:pe}=J,{width:ue}=B;if(W===0||ue===0)return b4;if(pe===0)return oq(Y0(0,0,oe));const be=GE(ue,pe,ge);let ke=be*am((te+le)/(se+le)),ie=be*w4((fe+le)/(se+le))-1;ie=q0(W-1,bd(ie,be-1)),ke=q0(ie,bd(0,ke));const Pe=Y0(ke,ie,oe),{top:Je,bottom:Ae}=C4(B,ae,J,Pe),Ve=w4(W/be),ft=Ve*se+(Ve-1)*le-Ae;return{items:Pe,offsetTop:Je,offsetBottom:ft,top:Je,bottom:Ae,itemHeight:se,itemWidth:pe}})),T),sr(pn($,hs(OG),fr(W=>W.length)),I),sr(pn(R,fr(({height:W})=>W)),o),sr(pn(Bl(R,M,T,H),fr(([W,te,{items:fe},ae])=>{const{top:J,bottom:B}=C4(W,ae,te,fe);return[J,B]}),Oo(my)),n);const U=sn(!1);sr(pn(r,Ri(U),fr(([W,te])=>te||W!==0)),U);const q=vd(pn(pr(T),hs(({items:W})=>W.length>0),Ri(I,U),hs(([{items:W},te,fe])=>fe&&W[W.length-1].index===te-1),fr(([,W])=>W-1),Oo())),z=vd(pn(pr(T),hs(({items:W})=>W.length>0&&W[0].index===0),dl(0),Oo())),L=vd(pn(pr(T),hs(({items:W})=>W.length>0),fr(({items:W})=>({startIndex:W[0].index,endIndex:W[W.length-1].index})),Oo(qG)));sr(L,v.scrollSeekRangeChanged),sr(pn(D,Ri(R,M,I,H),fr(([W,te,fe,ae,J])=>{const B=HG(W),{align:oe,behavior:le,offset:ge}=B;let se=B.index;se==="LAST"&&(se=ae-1),se=bd(0,se,q0(ae-1,se));let pe=gy(te,J,fe,se);return oe==="end"?pe=x4(pe-te.height+fe.height):oe==="center"&&(pe=x4(pe-te.height/2+fe.height/2)),ge&&(pe+=ge),{top:pe,behavior:le}})),a);const V=Wc(pn(T,fr(W=>W.offsetBottom+W.bottom)),0);return sr(pn(x,fr(W=>({width:W.visibleWidth,height:W.visibleHeight}))),R),{data:$,totalCount:I,viewportDimensions:R,itemDimensions:M,scrollTop:r,scrollHeight:A,overscan:e,scrollBy:s,scrollTo:a,scrollToIndex:D,smoothScrollTargetReached:c,windowViewportRect:x,windowScrollTo:w,useWindowScroll:_,customScrollParent:k,windowScrollContainerState:P,deviation:G,scrollContainerState:d,footerHeight:f,headerHeight:h,initialItemCount:O,gap:H,...v,gridState:T,totalListHeight:V,...m,startReached:z,endReached:q,rangeChanged:L,propsReady:y,...j}},Kl(YG,Hg,HE,KG,GG,ZG,$E));function C4(e,t,n,r){const{height:o}=n;if(o===void 0||r.length===0)return{top:0,bottom:0};const s=gy(e,t,n,r[0].index),a=gy(e,t,n,r[r.length-1].index)+o;return{top:s,bottom:a}}function gy(e,t,n,r){const o=GE(e.width,n.width,t.column),s=am(r/o),a=s*n.height+bd(0,s-1)*t.row;return a>0?a+t.row:a}function GE(e,t,n){return bd(1,am((e+n)/(am(t)+n)))}const iq=Ia(()=>{const e=sn(f=>`Item ${f}`),t=sn({}),n=sn(null),r=sn("virtuoso-grid-item"),o=sn("virtuoso-grid-list"),s=sn(JG),a=sn("div"),c=sn(Lg),d=(f,h=null)=>Wc(pn(t,fr(m=>m[f]),Oo()),h);return{context:n,itemContent:e,components:t,computeItemKey:s,itemClassName:r,listClassName:o,headerFooterTag:a,scrollerRef:c,FooterComponent:d("Footer"),HeaderComponent:d("Header"),ListComponent:d("List","div"),ItemComponent:d("Item","div"),ScrollerComponent:d("Scroller","div"),ScrollSeekPlaceholder:d("ScrollSeekPlaceholder","div")}}),lq=Ia(([e,t])=>({...e,...t}),Kl(aq,iq)),cq=F.memo(function(){const t=jr("gridState"),n=jr("listClassName"),r=jr("itemClassName"),o=jr("itemContent"),s=jr("computeItemKey"),a=jr("isSeeking"),c=Us("scrollHeight"),d=jr("ItemComponent"),f=jr("ListComponent"),h=jr("ScrollSeekPlaceholder"),m=jr("context"),v=Us("itemDimensions"),y=Us("gap"),S=jr("log"),x=Fg(w=>{const _=w.parentElement.parentElement.scrollHeight;c(_);const k=w.firstChild;k&&v(k.getBoundingClientRect()),y({row:_4("row-gap",getComputedStyle(w).rowGap,S),column:_4("column-gap",getComputedStyle(w).columnGap,S)})});return F.createElement(f,{ref:x,className:n,...Pl(f,m),style:{paddingTop:t.offsetTop,paddingBottom:t.offsetBottom},"data-test-id":"virtuoso-item-list"},t.items.map(w=>{const _=s(w.index,w.data,m);return a?F.createElement(h,{key:_,...Pl(h,m),index:w.index,height:t.itemHeight,width:t.itemWidth}):F.createElement(d,{...Pl(d,m),className:r,"data-index":w.index,key:_},o(w.index,w.data,m))}))}),uq=F.memo(function(){const t=jr("HeaderComponent"),n=Us("headerHeight"),r=jr("headerFooterTag"),o=Fg(a=>n(nm(a,"height"))),s=jr("context");return t?F.createElement(r,{ref:o},F.createElement(t,Pl(t,s))):null}),dq=F.memo(function(){const t=jr("FooterComponent"),n=Us("footerHeight"),r=jr("headerFooterTag"),o=Fg(a=>n(nm(a,"height"))),s=jr("context");return t?F.createElement(r,{ref:o},F.createElement(t,Pl(t,s))):null}),fq=({children:e})=>{const t=F.useContext(WE),n=Us("itemDimensions"),r=Us("viewportDimensions"),o=Fg(s=>{r(s.getBoundingClientRect())});return F.useEffect(()=>{t&&(r({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,r,n]),F.createElement("div",{style:UE,ref:o},e)},pq=({children:e})=>{const t=F.useContext(WE),n=Us("windowViewportRect"),r=Us("itemDimensions"),o=jr("customScrollParent"),s=QG(n,o);return F.useEffect(()=>{t&&(r({height:t.itemHeight,width:t.itemWidth}),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,r]),F.createElement("div",{ref:s,style:UE},e)},hq=F.memo(function({...t}){const n=jr("useWindowScroll"),r=jr("customScrollParent"),o=r||n?vq:gq,s=r||n?pq:fq;return F.createElement(o,{...t},F.createElement(s,null,F.createElement(uq,null),F.createElement(cq,null),F.createElement(dq,null)))}),{Component:mq,usePublisher:Us,useEmitterValue:jr,useEmitter:qE}=NG(lq,{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"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange"}},hq),gq=tq({usePublisher:Us,useEmitterValue:jr,useEmitter:qE}),vq=nq({usePublisher:Us,useEmitterValue:jr,useEmitter:qE});function _4(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,wx.WARN),t==="normal"?0:parseInt(t??"0",10)}const yq=mq;var YE={exports:{}},KE={};const Wo=Xy(t7),qu=Xy(n7),bq=Xy(r7);(function(e){var t,n,r=cc&&cc.__generator||function(Z,ee){var ve,Se,_e,rt,St={label:0,sent:function(){if(1&_e[0])throw _e[1];return _e[1]},trys:[],ops:[]};return rt={next:Gt(0),throw:Gt(1),return:Gt(2)},typeof Symbol=="function"&&(rt[Symbol.iterator]=function(){return this}),rt;function Gt(yt){return function(Xe){return function(tt){if(ve)throw new TypeError("Generator is already executing.");for(;St;)try{if(ve=1,Se&&(_e=2&tt[0]?Se.return:tt[0]?Se.throw||((_e=Se.return)&&_e.call(Se),0):Se.next)&&!(_e=_e.call(Se,tt[1])).done)return _e;switch(Se=0,_e&&(tt=[2&tt[0],_e.value]),tt[0]){case 0:case 1:_e=tt;break;case 4:return St.label++,{value:tt[1],done:!1};case 5:St.label++,Se=tt[1],tt=[0];continue;case 7:tt=St.ops.pop(),St.trys.pop();continue;default:if(!((_e=(_e=St.trys).length>0&&_e[_e.length-1])||tt[0]!==6&&tt[0]!==2)){St=0;continue}if(tt[0]===3&&(!_e||tt[1]>_e[0]&&tt[1]<_e[3])){St.label=tt[1];break}if(tt[0]===6&&St.label<_e[1]){St.label=_e[1],_e=tt;break}if(_e&&St.label<_e[2]){St.label=_e[2],St.ops.push(tt);break}_e[2]&&St.ops.pop(),St.trys.pop();continue}tt=ee.call(Z,St)}catch(je){tt=[6,je],Se=0}finally{ve=_e=0}if(5&tt[0])throw tt[1];return{value:tt[0]?tt[1]:void 0,done:!0}}([yt,Xe])}}},o=cc&&cc.__spreadArray||function(Z,ee){for(var ve=0,Se=ee.length,_e=Z.length;ve<Se;ve++,_e++)Z[_e]=ee[ve];return Z},s=Object.create,a=Object.defineProperty,c=Object.defineProperties,d=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyDescriptors,h=Object.getOwnPropertyNames,m=Object.getOwnPropertySymbols,v=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable,x=function(Z,ee,ve){return ee in Z?a(Z,ee,{enumerable:!0,configurable:!0,writable:!0,value:ve}):Z[ee]=ve},w=function(Z,ee){for(var ve in ee||(ee={}))y.call(ee,ve)&&x(Z,ve,ee[ve]);if(m)for(var Se=0,_e=m(ee);Se<_e.length;Se++)S.call(ee,ve=_e[Se])&&x(Z,ve,ee[ve]);return Z},_=function(Z,ee){return c(Z,f(ee))},k=function(Z){return a(Z,"__esModule",{value:!0})},P=function(Z,ee){var ve={};for(var Se in Z)y.call(Z,Se)&&ee.indexOf(Se)<0&&(ve[Se]=Z[Se]);if(Z!=null&&m)for(var _e=0,rt=m(Z);_e<rt.length;_e++)ee.indexOf(Se=rt[_e])<0&&S.call(Z,Se)&&(ve[Se]=Z[Se]);return ve},j=function(Z){return function(ee,ve,Se){if(ve&&typeof ve=="object"||typeof ve=="function")for(var _e=function(Gt){y.call(ee,Gt)||Gt==="default"||a(ee,Gt,{get:function(){return ve[Gt]},enumerable:!(Se=d(ve,Gt))||Se.enumerable})},rt=0,St=h(ve);rt<St.length;rt++)_e(St[rt]);return ee}(k(a(Z!=null?s(v(Z)):{},"default",Z&&Z.__esModule&&"default"in Z?{get:function(){return Z.default},enumerable:!0}:{value:Z,enumerable:!0})),Z)},I=function(Z,ee,ve){return new Promise(function(Se,_e){var rt=function(yt){try{Gt(ve.next(yt))}catch(Xe){_e(Xe)}},St=function(yt){try{Gt(ve.throw(yt))}catch(Xe){_e(Xe)}},Gt=function(yt){return yt.done?Se(yt.value):Promise.resolve(yt.value).then(rt,St)};Gt((ve=ve.apply(Z,ee)).next())})};k(e),function(Z,ee){for(var ve in ee)a(Z,ve,{get:ee[ve],enumerable:!0})}(e,{QueryStatus:function(){return t},buildCreateApi:function(){return pt},copyWithStructuralSharing:function(){return R},coreModule:function(){return ui},createApi:function(){return Os},defaultSerializeQueryArgs:function(){return Cn},fakeBaseQuery:function(){return gt},fetchBaseQuery:function(){return H},retry:function(){return L},setupListeners:function(){return B},skipSelector:function(){return ye},skipToken:function(){return Ye}}),(n=t||(t={})).uninitialized="uninitialized",n.pending="pending",n.fulfilled="fulfilled",n.rejected="rejected";var O=function(Z){return[].concat.apply([],Z)},T=j(Wo).isPlainObject;function R(Z,ee){if(Z===ee||!(T(Z)&&T(ee)||Array.isArray(Z)&&Array.isArray(ee)))return ee;for(var ve=Object.keys(ee),Se=Object.keys(Z),_e=ve.length===Se.length,rt=Array.isArray(ee)?[]:{},St=0,Gt=ve;St<Gt.length;St++){var yt=Gt[St];rt[yt]=R(Z[yt],ee[yt]),_e&&(_e=Z[yt]===rt[yt])}return _e?Z:rt}var M=j(Wo),D=function(){for(var Z=[],ee=0;ee<arguments.length;ee++)Z[ee]=arguments[ee];return fetch.apply(void 0,Z)},A=function(Z){return Z.status>=200&&Z.status<=299},G=function(Z){return/ion\/(vnd\.api\+)?json/.test(Z.get("content-type")||"")};function $(Z){if(!(0,M.isPlainObject)(Z))return Z;for(var ee=w({},Z),ve=0,Se=Object.entries(ee);ve<Se.length;ve++){var _e=Se[ve];_e[1]===void 0&&delete ee[_e[0]]}return ee}function H(Z){var ee=this;Z===void 0&&(Z={});var ve=Z.baseUrl,Se=Z.prepareHeaders,_e=Se===void 0?function(Kt){return Kt}:Se,rt=Z.fetchFn,St=rt===void 0?D:rt,Gt=Z.paramsSerializer,yt=Z.isJsonContentType,Xe=yt===void 0?G:yt,tt=Z.jsonContentType,je=tt===void 0?"application/json":tt,Ze=Z.jsonReplacer,Ot=Z.timeout,Rt=Z.responseHandler,$t=Z.validateStatus,Yt=P(Z,["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(Kt,Me){return I(ee,null,function(){var Ct,Bt,Ft,qt,kn,tn,dn,Nn,Lr,ir,Tt,Dn,Ln,lr,_r,Un,Gn,bn,In,An,Pn,jn,Qe,Mt,Pt,ct,_t,Vt,xt,at,De,Te,Le,We,ot,At;return r(this,function(Dt){switch(Dt.label){case 0:return Ct=Me.signal,Bt=Me.getState,Ft=Me.extra,qt=Me.endpoint,kn=Me.forced,tn=Me.type,Lr=(Nn=typeof Kt=="string"?{url:Kt}:Kt).url,Tt=(ir=Nn.headers)===void 0?new Headers(Yt.headers):ir,Ln=(Dn=Nn.params)===void 0?void 0:Dn,_r=(lr=Nn.responseHandler)===void 0?Rt??"json":lr,Gn=(Un=Nn.validateStatus)===void 0?$t??A:Un,In=(bn=Nn.timeout)===void 0?Ot:bn,An=P(Nn,["url","headers","params","responseHandler","validateStatus","timeout"]),Pn=w(_(w({},Yt),{signal:Ct}),An),Tt=new Headers($(Tt)),jn=Pn,[4,_e(Tt,{getState:Bt,extra:Ft,endpoint:qt,forced:kn,type:tn})];case 1:jn.headers=Dt.sent()||Tt,Qe=function(Ue){return typeof Ue=="object"&&((0,M.isPlainObject)(Ue)||Array.isArray(Ue)||typeof Ue.toJSON=="function")},!Pn.headers.has("content-type")&&Qe(Pn.body)&&Pn.headers.set("content-type",je),Qe(Pn.body)&&Xe(Pn.headers)&&(Pn.body=JSON.stringify(Pn.body,Ze)),Ln&&(Mt=~Lr.indexOf("?")?"&":"?",Pt=Gt?Gt(Ln):new URLSearchParams($(Ln)),Lr+=Mt+Pt),Lr=function(Ue,rn){if(!Ue)return rn;if(!rn)return Ue;if(function(wn){return new RegExp("(^|:)//").test(wn)}(rn))return rn;var En=Ue.endsWith("/")||!rn.startsWith("?")?"/":"";return Ue=function(wn){return wn.replace(/\/$/,"")}(Ue),""+Ue+En+function(wn){return wn.replace(/^\//,"")}(rn)}(ve,Lr),ct=new Request(Lr,Pn),_t=ct.clone(),dn={request:_t},xt=!1,at=In&&setTimeout(function(){xt=!0,Me.abort()},In),Dt.label=2;case 2:return Dt.trys.push([2,4,5,6]),[4,St(ct)];case 3:return Vt=Dt.sent(),[3,6];case 4:return De=Dt.sent(),[2,{error:{status:xt?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(De)},meta:dn}];case 5:return at&&clearTimeout(at),[7];case 6:Te=Vt.clone(),dn.response=Te,We="",Dt.label=7;case 7:return Dt.trys.push([7,9,,10]),[4,Promise.all([nn(Vt,_r).then(function(Ue){return Le=Ue},function(Ue){return ot=Ue}),Te.text().then(function(Ue){return We=Ue},function(){})])];case 8:if(Dt.sent(),ot)throw ot;return[3,10];case 9:return At=Dt.sent(),[2,{error:{status:"PARSING_ERROR",originalStatus:Vt.status,data:We,error:String(At)},meta:dn}];case 10:return[2,Gn(Vt,Le)?{data:Le,meta:dn}:{error:{status:Vt.status,data:Le},meta:dn}]}})})};function nn(Kt,Me){return I(this,null,function(){var Ct;return r(this,function(Bt){switch(Bt.label){case 0:return typeof Me=="function"?[2,Me(Kt)]:(Me==="content-type"&&(Me=Xe(Kt.headers)?"json":"text"),Me!=="json"?[3,2]:[4,Kt.text()]);case 1:return[2,(Ct=Bt.sent()).length?JSON.parse(Ct):null];case 2:return[2,Kt.text()]}})})}}var U=function(Z,ee){ee===void 0&&(ee=void 0),this.value=Z,this.meta=ee};function q(Z,ee){return Z===void 0&&(Z=0),ee===void 0&&(ee=5),I(this,null,function(){var ve,Se;return r(this,function(_e){switch(_e.label){case 0:return ve=Math.min(Z,ee),Se=~~((Math.random()+.4)*(300<<ve)),[4,new Promise(function(rt){return setTimeout(function(St){return rt(St)},Se)})];case 1:return _e.sent(),[2]}})})}var z={},L=Object.assign(function(Z,ee){return function(ve,Se,_e){return I(void 0,null,function(){var rt,St,Gt,yt,Xe,tt,je;return r(this,function(Ze){switch(Ze.label){case 0:rt=[5,(ee||z).maxRetries,(_e||z).maxRetries].filter(function(Ot){return Ot!==void 0}),St=rt.slice(-1)[0],Gt=function(Ot,Rt,$t){return $t.attempt<=St},yt=w(w({maxRetries:St,backoff:q,retryCondition:Gt},ee),_e),Xe=0,Ze.label=1;case 1:Ze.label=2;case 2:return Ze.trys.push([2,4,,6]),[4,Z(ve,Se,_e)];case 3:if((tt=Ze.sent()).error)throw new U(tt);return[2,tt];case 4:if(je=Ze.sent(),Xe++,je.throwImmediately){if(je instanceof U)return[2,je.value];throw je}return je instanceof U&&!yt.retryCondition(je.value.error,ve,{attempt:Xe,baseQueryApi:Se,extraOptions:_e})?[2,je.value]:[4,yt.backoff(Xe,yt.maxRetries)];case 5:return Ze.sent(),[3,6];case 6:return[3,1];case 7:return[2]}})})}},{fail:function(Z){throw Object.assign(new U({error:Z}),{throwImmediately:!0})}}),V=j(Wo),W=(0,V.createAction)("__rtkq/focused"),te=(0,V.createAction)("__rtkq/unfocused"),fe=(0,V.createAction)("__rtkq/online"),ae=(0,V.createAction)("__rtkq/offline"),J=!1;function B(Z,ee){return ee?ee(Z,{onFocus:W,onFocusLost:te,onOffline:ae,onOnline:fe}):(ve=function(){return Z(W())},Se=function(){return Z(fe())},_e=function(){return Z(ae())},rt=function(){window.document.visibilityState==="visible"?ve():Z(te())},J||typeof window<"u"&&window.addEventListener&&(window.addEventListener("visibilitychange",rt,!1),window.addEventListener("focus",ve,!1),window.addEventListener("online",Se,!1),window.addEventListener("offline",_e,!1),J=!0),function(){window.removeEventListener("focus",ve),window.removeEventListener("visibilitychange",rt),window.removeEventListener("online",Se),window.removeEventListener("offline",_e),J=!1});var ve,Se,_e,rt}var oe,le,ge=j(Wo);function se(Z){return Z.type===oe.query}function pe(Z,ee,ve,Se,_e,rt){return typeof Z=="function"?Z(ee,ve,Se,_e).map(ue).map(rt):Array.isArray(Z)?Z.map(ue).map(rt):[]}function ue(Z){return typeof Z=="string"?{type:Z}:Z}(le=oe||(oe={})).query="query",le.mutation="mutation";var be=j(Wo);function ke(Z){return Z!=null}var ie=Symbol("forceQueryFn"),Pe=function(Z){return typeof Z[ie]=="function"},Je=j(Wo),Ae=j(qu),Ve=j(Wo);function kt(Z){return Z}function ft(Z,ee,ve,Se){return pe(ve[Z.meta.arg.endpointName][ee],(0,Je.isFulfilled)(Z)?Z.payload:void 0,(0,Je.isRejectedWithValue)(Z)?Z.payload:void 0,Z.meta.arg.originalArgs,"baseQueryMeta"in Z.meta?Z.meta.baseQueryMeta:void 0,Se)}var yn=j(qu),K=j(qu);function Ce(Z,ee,ve){var Se=Z[ee];Se&&ve(Se)}function ne(Z){var ee;return(ee="arg"in Z?Z.arg.fixedCacheKey:Z.fixedCacheKey)!=null?ee:Z.requestId}function me(Z,ee,ve){var Se=Z[ne(ee)];Se&&ve(Se)}var Re={},Ye=Symbol.for("RTKQ/skipToken"),ye=Ye,lt={status:t.uninitialized},It=(0,ge.createNextState)(lt,function(){}),Xt=(0,ge.createNextState)(lt,function(){}),$e=j(Wo),Ke=WeakMap?new WeakMap:void 0,Cn=function(Z){var ee=Z.endpointName,ve=Z.queryArgs,Se="",_e=Ke==null?void 0:Ke.get(ve);if(typeof _e=="string")Se=_e;else{var rt=JSON.stringify(ve,function(St,Gt){return(0,$e.isPlainObject)(Gt)?Object.keys(Gt).sort().reduce(function(yt,Xe){return yt[Xe]=Gt[Xe],yt},{}):Gt});(0,$e.isPlainObject)(ve)&&(Ke==null||Ke.set(ve,rt)),Se=rt}return ee+"("+Se+")"},Ee=j(Wo),qe=j(bq);function pt(){for(var Z=[],ee=0;ee<arguments.length;ee++)Z[ee]=arguments[ee];return function(ve){var Se=(0,qe.defaultMemoize)(function(yt){var Xe,tt;return(tt=ve.extractRehydrationInfo)==null?void 0:tt.call(ve,yt,{reducerPath:(Xe=ve.reducerPath)!=null?Xe:"api"})}),_e=_(w({reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1},ve),{extractRehydrationInfo:Se,serializeQueryArgs:function(yt){var Xe=Cn;if("serializeQueryArgs"in yt.endpointDefinition){var tt=yt.endpointDefinition.serializeQueryArgs;Xe=function(je){var Ze=tt(je);return typeof Ze=="string"?Ze:Cn(_(w({},je),{queryArgs:Ze}))}}else ve.serializeQueryArgs&&(Xe=ve.serializeQueryArgs);return Xe(yt)},tagTypes:o([],ve.tagTypes||[])}),rt={endpointDefinitions:{},batch:function(yt){yt()},apiUid:(0,Ee.nanoid)(),extractRehydrationInfo:Se,hasRehydrationInfo:(0,qe.defaultMemoize)(function(yt){return Se(yt)!=null})},St={injectEndpoints:function(yt){for(var Xe=yt.endpoints({query:function(nn){return _(w({},nn),{type:oe.query})},mutation:function(nn){return _(w({},nn),{type:oe.mutation})}}),tt=0,je=Object.entries(Xe);tt<je.length;tt++){var Ze=je[tt],Ot=Ze[0],Rt=Ze[1];if(yt.overrideExisting||!(Ot in rt.endpointDefinitions)){rt.endpointDefinitions[Ot]=Rt;for(var $t=0,Yt=Gt;$t<Yt.length;$t++)Yt[$t].injectEndpoint(Ot,Rt)}}return St},enhanceEndpoints:function(yt){var Xe=yt.addTagTypes,tt=yt.endpoints;if(Xe)for(var je=0,Ze=Xe;je<Ze.length;je++){var Ot=Ze[je];_e.tagTypes.includes(Ot)||_e.tagTypes.push(Ot)}if(tt)for(var Rt=0,$t=Object.entries(tt);Rt<$t.length;Rt++){var Yt=$t[Rt],nn=Yt[0],Kt=Yt[1];typeof Kt=="function"?Kt(rt.endpointDefinitions[nn]):Object.assign(rt.endpointDefinitions[nn]||{},Kt)}return St}},Gt=Z.map(function(yt){return yt.init(St,_e,rt)});return St.injectEndpoints({endpoints:ve.endpoints})}}function gt(){return function(){throw new Error("When using `fakeBaseQuery`, all queries & mutations must use the `queryFn` definition syntax.")}}var Ht,yr=j(Wo),hn=function(Z){var ee=Z.reducerPath,ve=Z.api,Se=Z.context,_e=Z.internalState,rt=ve.internalActions,St=rt.removeQueryResult,Gt=rt.unsubscribeQueryResult;function yt(je){var Ze=_e.currentSubscriptions[je];return!!Ze&&!function(Ot){for(var Rt in Ot)return!1;return!0}(Ze)}var Xe={};function tt(je,Ze,Ot,Rt){var $t,Yt=Se.endpointDefinitions[Ze],nn=($t=Yt==null?void 0:Yt.keepUnusedDataFor)!=null?$t:Rt.keepUnusedDataFor;if(nn!==1/0){var Kt=Math.max(0,Math.min(nn,2147482647e-3));if(!yt(je)){var Me=Xe[je];Me&&clearTimeout(Me),Xe[je]=setTimeout(function(){yt(je)||Ot.dispatch(St({queryCacheKey:je})),delete Xe[je]},1e3*Kt)}}}return function(je,Ze,Ot){var Rt;if(Gt.match(je)){var $t=Ze.getState()[ee];tt(kn=je.payload.queryCacheKey,(Rt=$t.queries[kn])==null?void 0:Rt.endpointName,Ze,$t.config)}if(ve.util.resetApiState.match(je))for(var Yt=0,nn=Object.entries(Xe);Yt<nn.length;Yt++){var Kt=nn[Yt],Me=Kt[0],Ct=Kt[1];Ct&&clearTimeout(Ct),delete Xe[Me]}if(Se.hasRehydrationInfo(je)){$t=Ze.getState()[ee];for(var Bt=Se.extractRehydrationInfo(je).queries,Ft=0,qt=Object.entries(Bt);Ft<qt.length;Ft++){var kn,tn=qt[Ft],dn=tn[1];tt(kn=tn[0],dn==null?void 0:dn.endpointName,Ze,$t.config)}}}},mn=j(Wo),Tr=function(Z){var ee=Z.reducerPath,ve=Z.context,Se=Z.context.endpointDefinitions,_e=Z.mutationThunk,rt=Z.api,St=Z.assertTagType,Gt=Z.refetchQuery,yt=rt.internalActions.removeQueryResult,Xe=(0,mn.isAnyOf)((0,mn.isFulfilled)(_e),(0,mn.isRejectedWithValue)(_e));function tt(je,Ze){var Ot=Ze.getState(),Rt=Ot[ee],$t=rt.util.selectInvalidatedBy(Ot,je);ve.batch(function(){for(var Yt,nn=0,Kt=Array.from($t.values());nn<Kt.length;nn++){var Me=Kt[nn].queryCacheKey,Ct=Rt.queries[Me],Bt=(Yt=Rt.subscriptions[Me])!=null?Yt:{};Ct&&(Object.keys(Bt).length===0?Ze.dispatch(yt({queryCacheKey:Me})):Ct.status!==t.uninitialized&&Ze.dispatch(Gt(Ct,Me)))}})}return function(je,Ze){Xe(je)&&tt(ft(je,"invalidatesTags",Se,St),Ze),rt.util.invalidateTags.match(je)&&tt(pe(je.payload,void 0,void 0,void 0,void 0,St),Ze)}},$n=function(Z){var ee=Z.reducerPath,ve=Z.queryThunk,Se=Z.api,_e=Z.refetchQuery,rt=Z.internalState,St={};function Gt(je,Ze){var Ot=je.queryCacheKey,Rt=Ze.getState()[ee].queries[Ot];if(Rt&&Rt.status!==t.uninitialized){var $t=tt(rt.currentSubscriptions[Ot]);if(Number.isFinite($t)){var Yt=St[Ot];Yt!=null&&Yt.timeout&&(clearTimeout(Yt.timeout),Yt.timeout=void 0);var nn=Date.now()+$t,Kt=St[Ot]={nextPollTimestamp:nn,pollingInterval:$t,timeout:setTimeout(function(){Kt.timeout=void 0,Ze.dispatch(_e(Rt,Ot))},$t)}}}}function yt(je,Ze){var Ot=je.queryCacheKey,Rt=Ze.getState()[ee].queries[Ot];if(Rt&&Rt.status!==t.uninitialized){var $t=tt(rt.currentSubscriptions[Ot]);if(Number.isFinite($t)){var Yt=St[Ot],nn=Date.now()+$t;(!Yt||nn<Yt.nextPollTimestamp)&&Gt({queryCacheKey:Ot},Ze)}else Xe(Ot)}}function Xe(je){var Ze=St[je];Ze!=null&&Ze.timeout&&clearTimeout(Ze.timeout),delete St[je]}function tt(je){je===void 0&&(je={});var Ze=Number.POSITIVE_INFINITY;for(var Ot in je)je[Ot].pollingInterval&&(Ze=Math.min(je[Ot].pollingInterval,Ze));return Ze}return function(je,Ze){(Se.internalActions.updateSubscriptionOptions.match(je)||Se.internalActions.unsubscribeQueryResult.match(je))&&yt(je.payload,Ze),(ve.pending.match(je)||ve.rejected.match(je)&&je.meta.condition)&&yt(je.meta.arg,Ze),(ve.fulfilled.match(je)||ve.rejected.match(je)&&!je.meta.condition)&&Gt(je.meta.arg,Ze),Se.util.resetApiState.match(je)&&function(){for(var Ot=0,Rt=Object.keys(St);Ot<Rt.length;Ot++)Xe(Rt[Ot])}()}},Fn=j(Wo),Es=new Error("Promise never resolved before cacheEntryRemoved."),_n=function(Z){var ee=Z.api,ve=Z.reducerPath,Se=Z.context,_e=Z.queryThunk,rt=Z.mutationThunk,St=(0,Fn.isAsyncThunkAction)(_e),Gt=(0,Fn.isAsyncThunkAction)(rt),yt=(0,Fn.isFulfilled)(_e,rt),Xe={};function tt(je,Ze,Ot,Rt,$t){var Yt=Se.endpointDefinitions[je],nn=Yt==null?void 0:Yt.onCacheEntryAdded;if(nn){var Kt={},Me=new Promise(function(tn){Kt.cacheEntryRemoved=tn}),Ct=Promise.race([new Promise(function(tn){Kt.valueResolved=tn}),Me.then(function(){throw Es})]);Ct.catch(function(){}),Xe[Ot]=Kt;var Bt=ee.endpoints[je].select(Yt.type===oe.query?Ze:Ot),Ft=Rt.dispatch(function(tn,dn,Nn){return Nn}),qt=_(w({},Rt),{getCacheEntry:function(){return Bt(Rt.getState())},requestId:$t,extra:Ft,updateCachedData:Yt.type===oe.query?function(tn){return Rt.dispatch(ee.util.updateQueryData(je,Ze,tn))}:void 0,cacheDataLoaded:Ct,cacheEntryRemoved:Me}),kn=nn(Ze,qt);Promise.resolve(kn).catch(function(tn){if(tn!==Es)throw tn})}}return function(je,Ze,Ot){var Rt=function(Bt){return St(Bt)?Bt.meta.arg.queryCacheKey:Gt(Bt)?Bt.meta.requestId:ee.internalActions.removeQueryResult.match(Bt)?Bt.payload.queryCacheKey:ee.internalActions.removeMutationResult.match(Bt)?ne(Bt.payload):""}(je);if(_e.pending.match(je)){var $t=Ot[ve].queries[Rt],Yt=Ze.getState()[ve].queries[Rt];!$t&&Yt&&tt(je.meta.arg.endpointName,je.meta.arg.originalArgs,Rt,Ze,je.meta.requestId)}else if(rt.pending.match(je))(Yt=Ze.getState()[ve].mutations[Rt])&&tt(je.meta.arg.endpointName,je.meta.arg.originalArgs,Rt,Ze,je.meta.requestId);else if(yt(je))(Ct=Xe[Rt])!=null&&Ct.valueResolved&&(Ct.valueResolved({data:je.payload,meta:je.meta.baseQueryMeta}),delete Ct.valueResolved);else if(ee.internalActions.removeQueryResult.match(je)||ee.internalActions.removeMutationResult.match(je))(Ct=Xe[Rt])&&(delete Xe[Rt],Ct.cacheEntryRemoved());else if(ee.util.resetApiState.match(je))for(var nn=0,Kt=Object.entries(Xe);nn<Kt.length;nn++){var Me=Kt[nn],Ct=Me[1];delete Xe[Me[0]],Ct.cacheEntryRemoved()}}},Jo=j(Wo),es=function(Z){var ee=Z.api,ve=Z.context,Se=Z.queryThunk,_e=Z.mutationThunk,rt=(0,Jo.isPending)(Se,_e),St=(0,Jo.isRejected)(Se,_e),Gt=(0,Jo.isFulfilled)(Se,_e),yt={};return function(Xe,tt){var je,Ze,Ot;if(rt(Xe)){var Rt=Xe.meta,$t=Rt.requestId,Yt=Rt.arg,nn=Yt.endpointName,Kt=Yt.originalArgs,Me=ve.endpointDefinitions[nn],Ct=Me==null?void 0:Me.onQueryStarted;if(Ct){var Bt={},Ft=new Promise(function(ir,Tt){Bt.resolve=ir,Bt.reject=Tt});Ft.catch(function(){}),yt[$t]=Bt;var qt=ee.endpoints[nn].select(Me.type===oe.query?Kt:$t),kn=tt.dispatch(function(ir,Tt,Dn){return Dn}),tn=_(w({},tt),{getCacheEntry:function(){return qt(tt.getState())},requestId:$t,extra:kn,updateCachedData:Me.type===oe.query?function(ir){return tt.dispatch(ee.util.updateQueryData(nn,Kt,ir))}:void 0,queryFulfilled:Ft});Ct(Kt,tn)}}else if(Gt(Xe)){var dn=Xe.meta,Nn=dn.baseQueryMeta;(je=yt[$t=dn.requestId])==null||je.resolve({data:Xe.payload,meta:Nn}),delete yt[$t]}else if(St(Xe)){var Lr=Xe.meta;Nn=Lr.baseQueryMeta,(Ot=yt[$t=Lr.requestId])==null||Ot.reject({error:(Ze=Xe.payload)!=null?Ze:Xe.error,isUnhandledError:!Lr.rejectedWithValue,meta:Nn}),delete yt[$t]}}},er=function(Z){var ee=Z.api,ve=Z.context.apiUid;return function(Se,_e){ee.util.resetApiState.match(Se)&&_e.dispatch(ee.internalActions.middlewareRegistered(ve))}},Is=j(qu),ci=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof cc<"u"?cc:globalThis):function(Z){return(Ht||(Ht=Promise.resolve())).then(Z).catch(function(ee){return setTimeout(function(){throw ee},0)})};function $r(Z){for(var ee=[],ve=1;ve<arguments.length;ve++)ee[ve-1]=arguments[ve];Object.assign.apply(Object,o([Z],ee))}var ts=j(qu),Oa=Symbol(),ui=function(){return{name:Oa,init:function(Z,ee,ve){var Se=ee.baseQuery,_e=ee.reducerPath,rt=ee.serializeQueryArgs,St=ee.keepUnusedDataFor,Gt=ee.refetchOnMountOrArgChange,yt=ee.refetchOnFocus,Xe=ee.refetchOnReconnect;(0,ts.enablePatches)();var tt=function(Tt){return Tt};Object.assign(Z,{reducerPath:_e,endpoints:{},internalActions:{onOnline:fe,onOffline:ae,onFocus:W,onFocusLost:te},util:{}});var je=function(Tt){var Dn=this,Ln=Tt.reducerPath,lr=Tt.baseQuery,_r=Tt.context.endpointDefinitions,Un=Tt.serializeQueryArgs,Gn=Tt.api,bn=function(Qe,Mt){return I(Dn,[Qe,Mt],function(Pt,ct){var _t,Vt,xt,at,De,Te,Le,We,ot,At,Dt,Ue,rn,En=ct.signal,wn=ct.abort,kr=ct.rejectWithValue,nr=ct.fulfillWithValue,Sn=ct.dispatch,tr=ct.getState,fo=ct.extra;return r(this,function(xn){switch(xn.label){case 0:_t=_r[Pt.endpointName],xn.label=1;case 1:return xn.trys.push([1,8,,13]),Vt=kt,xt=void 0,at={signal:En,abort:wn,dispatch:Sn,getState:tr,extra:fo,endpoint:Pt.endpointName,type:Pt.type,forced:Pt.type==="query"?In(Pt,tr()):void 0},(De=Pt.type==="query"?Pt[ie]:void 0)?(xt=De(),[3,6]):[3,2];case 2:return _t.query?[4,lr(_t.query(Pt.originalArgs),at,_t.extraOptions)]:[3,4];case 3:return xt=xn.sent(),_t.transformResponse&&(Vt=_t.transformResponse),[3,6];case 4:return[4,_t.queryFn(Pt.originalArgs,at,_t.extraOptions,function(qn){return lr(qn,at,_t.extraOptions)})];case 5:xt=xn.sent(),xn.label=6;case 6:if(xt.error)throw new U(xt.error,xt.meta);return Te=nr,[4,Vt(xt.data,xt.meta,Pt.originalArgs)];case 7:return[2,Te.apply(void 0,[xn.sent(),(Ue={fulfilledTimeStamp:Date.now(),baseQueryMeta:xt.meta},Ue[Ve.SHOULD_AUTOBATCH]=!0,Ue)])];case 8:if(Le=xn.sent(),!((We=Le)instanceof U))return[3,12];ot=kt,_t.query&&_t.transformErrorResponse&&(ot=_t.transformErrorResponse),xn.label=9;case 9:return xn.trys.push([9,11,,12]),At=kr,[4,ot(We.value,We.meta,Pt.originalArgs)];case 10:return[2,At.apply(void 0,[xn.sent(),(rn={baseQueryMeta:We.meta},rn[Ve.SHOULD_AUTOBATCH]=!0,rn)])];case 11:return Dt=xn.sent(),We=Dt,[3,12];case 12:throw console.error(We),We;case 13:return[2]}})})};function In(Qe,Mt){var Pt,ct,_t,Vt,xt=(ct=(Pt=Mt[Ln])==null?void 0:Pt.queries)==null?void 0:ct[Qe.queryCacheKey],at=(_t=Mt[Ln])==null?void 0:_t.config.refetchOnMountOrArgChange,De=xt==null?void 0:xt.fulfilledTimeStamp,Te=(Vt=Qe.forceRefetch)!=null?Vt:Qe.subscribe&&at;return!!Te&&(Te===!0||(Number(new Date)-Number(De))/1e3>=Te)}var An=(0,Ve.createAsyncThunk)(Ln+"/executeQuery",bn,{getPendingMeta:function(){var Qe;return(Qe={startedTimeStamp:Date.now()})[Ve.SHOULD_AUTOBATCH]=!0,Qe},condition:function(Qe,Mt){var Pt,ct,_t,Vt=(0,Mt.getState)(),xt=(ct=(Pt=Vt[Ln])==null?void 0:Pt.queries)==null?void 0:ct[Qe.queryCacheKey],at=xt==null?void 0:xt.fulfilledTimeStamp,De=Qe.originalArgs,Te=xt==null?void 0:xt.originalArgs,Le=_r[Qe.endpointName];return!(!Pe(Qe)&&((xt==null?void 0:xt.status)==="pending"||!In(Qe,Vt)&&(!se(Le)||!((_t=Le==null?void 0:Le.forceRefetch)!=null&&_t.call(Le,{currentArg:De,previousArg:Te,endpointState:xt,state:Vt})))&&at))},dispatchConditionRejection:!0}),Pn=(0,Ve.createAsyncThunk)(Ln+"/executeMutation",bn,{getPendingMeta:function(){var Qe;return(Qe={startedTimeStamp:Date.now()})[Ve.SHOULD_AUTOBATCH]=!0,Qe}});function jn(Qe){return function(Mt){var Pt,ct;return((ct=(Pt=Mt==null?void 0:Mt.meta)==null?void 0:Pt.arg)==null?void 0:ct.endpointName)===Qe}}return{queryThunk:An,mutationThunk:Pn,prefetch:function(Qe,Mt,Pt){return function(ct,_t){var Vt=function(Le){return"force"in Le}(Pt)&&Pt.force,xt=function(Le){return"ifOlderThan"in Le}(Pt)&&Pt.ifOlderThan,at=function(Le){return Le===void 0&&(Le=!0),Gn.endpoints[Qe].initiate(Mt,{forceRefetch:Le})},De=Gn.endpoints[Qe].select(Mt)(_t());if(Vt)ct(at());else if(xt){var Te=De==null?void 0:De.fulfilledTimeStamp;if(!Te)return void ct(at());(Number(new Date)-Number(new Date(Te)))/1e3>=xt&&ct(at())}else ct(at(!1))}},updateQueryData:function(Qe,Mt,Pt){return function(ct,_t){var Vt,xt,at=Gn.endpoints[Qe].select(Mt)(_t()),De={patches:[],inversePatches:[],undo:function(){return ct(Gn.util.patchQueryData(Qe,Mt,De.inversePatches))}};if(at.status===t.uninitialized)return De;if("data"in at)if((0,Ae.isDraftable)(at.data)){var Te=(0,Ae.produceWithPatches)(at.data,Pt),Le=Te[2];(Vt=De.patches).push.apply(Vt,Te[1]),(xt=De.inversePatches).push.apply(xt,Le)}else{var We=Pt(at.data);De.patches.push({op:"replace",path:[],value:We}),De.inversePatches.push({op:"replace",path:[],value:at.data})}return ct(Gn.util.patchQueryData(Qe,Mt,De.patches)),De}},upsertQueryData:function(Qe,Mt,Pt){return function(ct){var _t;return ct(Gn.endpoints[Qe].initiate(Mt,((_t={subscribe:!1,forceRefetch:!0})[ie]=function(){return{data:Pt}},_t)))}},patchQueryData:function(Qe,Mt,Pt){return function(ct){ct(Gn.internalActions.queryResultPatched({queryCacheKey:Un({queryArgs:Mt,endpointDefinition:_r[Qe],endpointName:Qe}),patches:Pt}))}},buildMatchThunkActions:function(Qe,Mt){return{matchPending:(0,Je.isAllOf)((0,Je.isPending)(Qe),jn(Mt)),matchFulfilled:(0,Je.isAllOf)((0,Je.isFulfilled)(Qe),jn(Mt)),matchRejected:(0,Je.isAllOf)((0,Je.isRejected)(Qe),jn(Mt))}}}}({baseQuery:Se,reducerPath:_e,context:ve,api:Z,serializeQueryArgs:rt}),Ze=je.queryThunk,Ot=je.mutationThunk,Rt=je.patchQueryData,$t=je.updateQueryData,Yt=je.upsertQueryData,nn=je.prefetch,Kt=je.buildMatchThunkActions,Me=function(Tt){var Dn=Tt.reducerPath,Ln=Tt.queryThunk,lr=Tt.mutationThunk,_r=Tt.context,Un=_r.endpointDefinitions,Gn=_r.apiUid,bn=_r.extractRehydrationInfo,In=_r.hasRehydrationInfo,An=Tt.assertTagType,Pn=Tt.config,jn=(0,be.createAction)(Dn+"/resetApiState"),Qe=(0,be.createSlice)({name:Dn+"/queries",initialState:Re,reducers:{removeQueryResult:{reducer:function(at,De){delete at[De.payload.queryCacheKey]},prepare:(0,be.prepareAutoBatched)()},queryResultPatched:function(at,De){var Te=De.payload,Le=Te.patches;Ce(at,Te.queryCacheKey,function(We){We.data=(0,K.applyPatches)(We.data,Le.concat())})}},extraReducers:function(at){at.addCase(Ln.pending,function(De,Te){var Le,We=Te.meta,ot=Te.meta.arg,At=Pe(ot);(ot.subscribe||At)&&(De[Le=ot.queryCacheKey]!=null||(De[Le]={status:t.uninitialized,endpointName:ot.endpointName})),Ce(De,ot.queryCacheKey,function(Dt){Dt.status=t.pending,Dt.requestId=At&&Dt.requestId?Dt.requestId:We.requestId,ot.originalArgs!==void 0&&(Dt.originalArgs=ot.originalArgs),Dt.startedTimeStamp=We.startedTimeStamp})}).addCase(Ln.fulfilled,function(De,Te){var Le=Te.meta,We=Te.payload;Ce(De,Le.arg.queryCacheKey,function(ot){var At;if(ot.requestId===Le.requestId||Pe(Le.arg)){var Dt=Un[Le.arg.endpointName].merge;if(ot.status=t.fulfilled,Dt)if(ot.data!==void 0){var Ue=Le.fulfilledTimeStamp,rn=Le.arg,En=Le.baseQueryMeta,wn=Le.requestId,kr=(0,be.createNextState)(ot.data,function(nr){return Dt(nr,We,{arg:rn.originalArgs,baseQueryMeta:En,fulfilledTimeStamp:Ue,requestId:wn})});ot.data=kr}else ot.data=We;else ot.data=(At=Un[Le.arg.endpointName].structuralSharing)==null||At?R((0,yn.isDraft)(ot.data)?(0,K.original)(ot.data):ot.data,We):We;delete ot.error,ot.fulfilledTimeStamp=Le.fulfilledTimeStamp}})}).addCase(Ln.rejected,function(De,Te){var Le=Te.meta,We=Le.condition,ot=Le.requestId,At=Te.error,Dt=Te.payload;Ce(De,Le.arg.queryCacheKey,function(Ue){if(!We){if(Ue.requestId!==ot)return;Ue.status=t.rejected,Ue.error=Dt??At}})}).addMatcher(In,function(De,Te){for(var Le=bn(Te).queries,We=0,ot=Object.entries(Le);We<ot.length;We++){var At=ot[We],Dt=At[1];(Dt==null?void 0:Dt.status)!==t.fulfilled&&(Dt==null?void 0:Dt.status)!==t.rejected||(De[At[0]]=Dt)}})}}),Mt=(0,be.createSlice)({name:Dn+"/mutations",initialState:Re,reducers:{removeMutationResult:{reducer:function(at,De){var Te=ne(De.payload);Te in at&&delete at[Te]},prepare:(0,be.prepareAutoBatched)()}},extraReducers:function(at){at.addCase(lr.pending,function(De,Te){var Le=Te.meta,We=Le.requestId,ot=Le.arg,At=Le.startedTimeStamp;ot.track&&(De[ne(Te.meta)]={requestId:We,status:t.pending,endpointName:ot.endpointName,startedTimeStamp:At})}).addCase(lr.fulfilled,function(De,Te){var Le=Te.payload,We=Te.meta;We.arg.track&&me(De,We,function(ot){ot.requestId===We.requestId&&(ot.status=t.fulfilled,ot.data=Le,ot.fulfilledTimeStamp=We.fulfilledTimeStamp)})}).addCase(lr.rejected,function(De,Te){var Le=Te.payload,We=Te.error,ot=Te.meta;ot.arg.track&&me(De,ot,function(At){At.requestId===ot.requestId&&(At.status=t.rejected,At.error=Le??We)})}).addMatcher(In,function(De,Te){for(var Le=bn(Te).mutations,We=0,ot=Object.entries(Le);We<ot.length;We++){var At=ot[We],Dt=At[0],Ue=At[1];(Ue==null?void 0:Ue.status)!==t.fulfilled&&(Ue==null?void 0:Ue.status)!==t.rejected||Dt===(Ue==null?void 0:Ue.requestId)||(De[Dt]=Ue)}})}}),Pt=(0,be.createSlice)({name:Dn+"/invalidation",initialState:Re,reducers:{},extraReducers:function(at){at.addCase(Qe.actions.removeQueryResult,function(De,Te){for(var Le=Te.payload.queryCacheKey,We=0,ot=Object.values(De);We<ot.length;We++)for(var At=0,Dt=Object.values(ot[We]);At<Dt.length;At++){var Ue=Dt[At],rn=Ue.indexOf(Le);rn!==-1&&Ue.splice(rn,1)}}).addMatcher(In,function(De,Te){for(var Le,We,ot,At,Dt=bn(Te).provided,Ue=0,rn=Object.entries(Dt);Ue<rn.length;Ue++)for(var En=rn[Ue],wn=En[0],kr=0,nr=Object.entries(En[1]);kr<nr.length;kr++)for(var Sn=nr[kr],tr=Sn[0],fo=Sn[1],xn=(At=(We=(Le=De[wn])!=null?Le:De[wn]={})[ot=tr||"__internal_without_id"])!=null?At:We[ot]=[],qn=0,Xr=fo;qn<Xr.length;qn++){var Br=Xr[qn];xn.includes(Br)||xn.push(Br)}}).addMatcher((0,be.isAnyOf)((0,be.isFulfilled)(Ln),(0,be.isRejectedWithValue)(Ln)),function(De,Te){for(var Le,We,ot,At,Dt=ft(Te,"providesTags",Un,An),Ue=Te.meta.arg.queryCacheKey,rn=0,En=Object.values(De);rn<En.length;rn++)for(var wn=0,kr=Object.values(En[rn]);wn<kr.length;wn++){var nr=kr[wn],Sn=nr.indexOf(Ue);Sn!==-1&&nr.splice(Sn,1)}for(var tr=0,fo=Dt;tr<fo.length;tr++){var xn=fo[tr],qn=xn.type,Xr=xn.id,Br=(At=(We=(Le=De[qn])!=null?Le:De[qn]={})[ot=Xr||"__internal_without_id"])!=null?At:We[ot]=[];Br.includes(Ue)||Br.push(Ue)}})}}),ct=(0,be.createSlice)({name:Dn+"/subscriptions",initialState:Re,reducers:{updateSubscriptionOptions:function(at,De){},unsubscribeQueryResult:function(at,De){},internal_probeSubscription:function(at,De){}}}),_t=(0,be.createSlice)({name:Dn+"/internalSubscriptions",initialState:Re,reducers:{subscriptionsUpdated:{reducer:function(at,De){return(0,K.applyPatches)(at,De.payload)},prepare:(0,be.prepareAutoBatched)()}}}),Vt=(0,be.createSlice)({name:Dn+"/config",initialState:w({online:typeof navigator>"u"||navigator.onLine===void 0||navigator.onLine,focused:typeof document>"u"||document.visibilityState!=="hidden",middlewareRegistered:!1},Pn),reducers:{middlewareRegistered:function(at,De){at.middlewareRegistered=at.middlewareRegistered!=="conflict"&&Gn===De.payload||"conflict"}},extraReducers:function(at){at.addCase(fe,function(De){De.online=!0}).addCase(ae,function(De){De.online=!1}).addCase(W,function(De){De.focused=!0}).addCase(te,function(De){De.focused=!1}).addMatcher(In,function(De){return w({},De)})}}),xt=(0,be.combineReducers)({queries:Qe.reducer,mutations:Mt.reducer,provided:Pt.reducer,subscriptions:_t.reducer,config:Vt.reducer});return{reducer:function(at,De){return xt(jn.match(De)?void 0:at,De)},actions:_(w(w(w(w(w({},Vt.actions),Qe.actions),ct.actions),_t.actions),Mt.actions),{unsubscribeMutationResult:Mt.actions.removeMutationResult,resetApiState:jn})}}({context:ve,queryThunk:Ze,mutationThunk:Ot,reducerPath:_e,assertTagType:tt,config:{refetchOnFocus:yt,refetchOnReconnect:Xe,refetchOnMountOrArgChange:Gt,keepUnusedDataFor:St,reducerPath:_e}}),Ct=Me.reducer,Bt=Me.actions;$r(Z.util,{patchQueryData:Rt,updateQueryData:$t,upsertQueryData:Yt,prefetch:nn,resetApiState:Bt.resetApiState}),$r(Z.internalActions,Bt);var Ft=function(Tt){var Dn=Tt.reducerPath,Ln=Tt.queryThunk,lr=Tt.api,_r=Tt.context,Un=_r.apiUid,Gn={invalidateTags:(0,yr.createAction)(Dn+"/invalidateTags")},bn=[er,hn,Tr,$n,_n,es];return{middleware:function(An){var Pn=!1,jn=_(w({},Tt),{internalState:{currentSubscriptions:{}},refetchQuery:In}),Qe=bn.map(function(ct){return ct(jn)}),Mt=function(ct){var _t=ct.api,Vt=ct.queryThunk,xt=ct.internalState,at=_t.reducerPath+"/subscriptions",De=null,Te=!1,Le=_t.internalActions,We=Le.updateSubscriptionOptions,ot=Le.unsubscribeQueryResult;return function(At,Dt){var Ue,rn;if(De||(De=JSON.parse(JSON.stringify(xt.currentSubscriptions))),_t.util.resetApiState.match(At))return De=xt.currentSubscriptions={},[!0,!1];if(_t.internalActions.internal_probeSubscription.match(At)){var En=At.payload;return[!1,!!((Ue=xt.currentSubscriptions[En.queryCacheKey])!=null&&Ue[En.requestId])]}var wn=function(Sn,tr){var fo,xn,qn,Xr,Br,di,Pf,Bo,Ta;if(We.match(tr)){var sa=tr.payload,Ra=sa.queryCacheKey,po=sa.requestId;return(fo=Sn==null?void 0:Sn[Ra])!=null&&fo[po]&&(Sn[Ra][po]=sa.options),!0}if(ot.match(tr)){var ho=tr.payload;return po=ho.requestId,Sn[Ra=ho.queryCacheKey]&&delete Sn[Ra][po],!0}if(_t.internalActions.removeQueryResult.match(tr))return delete Sn[tr.payload.queryCacheKey],!0;if(Vt.pending.match(tr)){var mo=tr.meta;if(po=mo.requestId,(to=mo.arg).subscribe)return(ns=(qn=Sn[xn=to.queryCacheKey])!=null?qn:Sn[xn]={})[po]=(Br=(Xr=to.subscriptionOptions)!=null?Xr:ns[po])!=null?Br:{},!0}if(Vt.rejected.match(tr)){var ns,Fo=tr.meta,to=Fo.arg;if(po=Fo.requestId,Fo.condition&&to.subscribe)return(ns=(Pf=Sn[di=to.queryCacheKey])!=null?Pf:Sn[di]={})[po]=(Ta=(Bo=to.subscriptionOptions)!=null?Bo:ns[po])!=null?Ta:{},!0}return!1}(xt.currentSubscriptions,At);if(wn){Te||(ci(function(){var Sn=JSON.parse(JSON.stringify(xt.currentSubscriptions)),tr=(0,Is.produceWithPatches)(De,function(){return Sn});Dt.next(_t.internalActions.subscriptionsUpdated(tr[1])),De=Sn,Te=!1}),Te=!0);var kr=!!((rn=At.type)!=null&&rn.startsWith(at)),nr=Vt.rejected.match(At)&&At.meta.condition&&!!At.meta.arg.subscribe;return[!kr&&!nr,!1]}return[!0,!1]}}(jn),Pt=function(ct){var _t=ct.reducerPath,Vt=ct.context,xt=ct.refetchQuery,at=ct.internalState,De=ct.api.internalActions.removeQueryResult;function Te(Le,We){var ot=Le.getState()[_t],At=ot.queries,Dt=at.currentSubscriptions;Vt.batch(function(){for(var Ue=0,rn=Object.keys(Dt);Ue<rn.length;Ue++){var En=rn[Ue],wn=At[En],kr=Dt[En];kr&&wn&&(Object.values(kr).some(function(nr){return nr[We]===!0})||Object.values(kr).every(function(nr){return nr[We]===void 0})&&ot.config[We])&&(Object.keys(kr).length===0?Le.dispatch(De({queryCacheKey:En})):wn.status!==t.uninitialized&&Le.dispatch(xt(wn,En)))}})}return function(Le,We){W.match(Le)&&Te(We,"refetchOnFocus"),fe.match(Le)&&Te(We,"refetchOnReconnect")}}(jn);return function(ct){return function(_t){Pn||(Pn=!0,An.dispatch(lr.internalActions.middlewareRegistered(Un)));var Vt,xt=_(w({},An),{next:ct}),at=An.getState(),De=Mt(_t,xt,at),Te=De[1];if(Vt=De[0]?ct(_t):Te,An.getState()[Dn]&&(Pt(_t,xt,at),function(ot){return!!ot&&typeof ot.type=="string"&&ot.type.startsWith(Dn+"/")}(_t)||_r.hasRehydrationInfo(_t)))for(var Le=0,We=Qe;Le<We.length;Le++)(0,We[Le])(_t,xt,at);return Vt}}},actions:Gn};function In(An,Pn,jn){return jn===void 0&&(jn={}),Ln(w({type:"query",endpointName:An.endpointName,originalArgs:An.originalArgs,subscribe:!1,forceRefetch:!0,queryCacheKey:Pn},jn))}}({reducerPath:_e,context:ve,queryThunk:Ze,mutationThunk:Ot,api:Z,assertTagType:tt}),qt=Ft.middleware;$r(Z.util,Ft.actions),$r(Z,{reducer:Ct,middleware:qt});var kn=function(Tt){var Dn=Tt.serializeQueryArgs,Ln=Tt.reducerPath,lr=function(bn){return It},_r=function(bn){return Xt};return{buildQuerySelector:function(bn,In){return function(An){var Pn=Dn({queryArgs:An,endpointDefinition:In,endpointName:bn});return(0,ge.createSelector)(An===Ye?lr:function(jn){var Qe,Mt,Pt;return(Pt=(Mt=(Qe=Gn(jn))==null?void 0:Qe.queries)==null?void 0:Mt[Pn])!=null?Pt:It},Un)}},buildMutationSelector:function(){return function(bn){var In,An;return An=typeof bn=="object"?(In=ne(bn))!=null?In:Ye:bn,(0,ge.createSelector)(An===Ye?_r:function(Pn){var jn,Qe,Mt;return(Mt=(Qe=(jn=Gn(Pn))==null?void 0:jn.mutations)==null?void 0:Qe[An])!=null?Mt:Xt},Un)}},selectInvalidatedBy:function(bn,In){for(var An,Pn=bn[Ln],jn=new Set,Qe=0,Mt=In.map(ue);Qe<Mt.length;Qe++){var Pt=Mt[Qe],ct=Pn.provided[Pt.type];if(ct)for(var _t=0,Vt=(An=Pt.id!==void 0?ct[Pt.id]:O(Object.values(ct)))!=null?An:[];_t<Vt.length;_t++)jn.add(Vt[_t])}return O(Array.from(jn.values()).map(function(xt){var at=Pn.queries[xt];return at?[{queryCacheKey:xt,endpointName:at.endpointName,originalArgs:at.originalArgs}]:[]}))}};function Un(bn){return w(w({},bn),{status:In=bn.status,isUninitialized:In===t.uninitialized,isLoading:In===t.pending,isSuccess:In===t.fulfilled,isError:In===t.rejected});var In}function Gn(bn){return bn[Ln]}}({serializeQueryArgs:rt,reducerPath:_e}),tn=kn.buildQuerySelector,dn=kn.buildMutationSelector;$r(Z.util,{selectInvalidatedBy:kn.selectInvalidatedBy});var Nn=function(Tt){var Dn=Tt.serializeQueryArgs,Ln=Tt.queryThunk,lr=Tt.mutationThunk,_r=Tt.api,Un=Tt.context,Gn=new Map,bn=new Map,In=_r.internalActions,An=In.unsubscribeQueryResult,Pn=In.removeMutationResult,jn=In.updateSubscriptionOptions;return{buildInitiateQuery:function(Qe,Mt){var Pt=function(ct,_t){var Vt=_t===void 0?{}:_t,xt=Vt.subscribe,at=xt===void 0||xt,De=Vt.forceRefetch,Te=Vt.subscriptionOptions,Le=Vt[ie];return function(We,ot){var At,Dt,Ue=Dn({queryArgs:ct,endpointDefinition:Mt,endpointName:Qe}),rn=Ln(((At={type:"query",subscribe:at,forceRefetch:De,subscriptionOptions:Te,endpointName:Qe,originalArgs:ct,queryCacheKey:Ue})[ie]=Le,At)),En=_r.endpoints[Qe].select(ct),wn=We(rn),kr=En(ot()),nr=wn.requestId,Sn=wn.abort,tr=kr.requestId!==nr,fo=(Dt=Gn.get(We))==null?void 0:Dt[Ue],xn=function(){return En(ot())},qn=Object.assign(Le?wn.then(xn):tr&&!fo?Promise.resolve(kr):Promise.all([fo,wn]).then(xn),{arg:ct,requestId:nr,subscriptionOptions:Te,queryCacheKey:Ue,abort:Sn,unwrap:function(){return I(this,null,function(){var Br;return r(this,function(di){switch(di.label){case 0:return[4,qn];case 1:if((Br=di.sent()).isError)throw Br.error;return[2,Br.data]}})})},refetch:function(){return We(Pt(ct,{subscribe:!1,forceRefetch:!0}))},unsubscribe:function(){at&&We(An({queryCacheKey:Ue,requestId:nr}))},updateSubscriptionOptions:function(Br){qn.subscriptionOptions=Br,We(jn({endpointName:Qe,requestId:nr,queryCacheKey:Ue,options:Br}))}});if(!fo&&!tr&&!Le){var Xr=Gn.get(We)||{};Xr[Ue]=qn,Gn.set(We,Xr),qn.then(function(){delete Xr[Ue],Object.keys(Xr).length||Gn.delete(We)})}return qn}};return Pt},buildInitiateMutation:function(Qe){return function(Mt,Pt){var ct=Pt===void 0?{}:Pt,_t=ct.track,Vt=_t===void 0||_t,xt=ct.fixedCacheKey;return function(at,De){var Te=lr({type:"mutation",endpointName:Qe,originalArgs:Mt,track:Vt,fixedCacheKey:xt}),Le=at(Te),We=Le.requestId,ot=Le.abort,At=Le.unwrap,Dt=Le.unwrap().then(function(wn){return{data:wn}}).catch(function(wn){return{error:wn}}),Ue=function(){at(Pn({requestId:We,fixedCacheKey:xt}))},rn=Object.assign(Dt,{arg:Le.arg,requestId:We,abort:ot,unwrap:At,unsubscribe:Ue,reset:Ue}),En=bn.get(at)||{};return bn.set(at,En),En[We]=rn,rn.then(function(){delete En[We],Object.keys(En).length||bn.delete(at)}),xt&&(En[xt]=rn,rn.then(function(){En[xt]===rn&&(delete En[xt],Object.keys(En).length||bn.delete(at))})),rn}}},getRunningQueryThunk:function(Qe,Mt){return function(Pt){var ct,_t=Dn({queryArgs:Mt,endpointDefinition:Un.endpointDefinitions[Qe],endpointName:Qe});return(ct=Gn.get(Pt))==null?void 0:ct[_t]}},getRunningMutationThunk:function(Qe,Mt){return function(Pt){var ct;return(ct=bn.get(Pt))==null?void 0:ct[Mt]}},getRunningQueriesThunk:function(){return function(Qe){return Object.values(Gn.get(Qe)||{}).filter(ke)}},getRunningMutationsThunk:function(){return function(Qe){return Object.values(bn.get(Qe)||{}).filter(ke)}},getRunningOperationPromises:function(){var Qe=function(Mt){return Array.from(Mt.values()).flatMap(function(Pt){return Pt?Object.values(Pt):[]})};return o(o([],Qe(Gn)),Qe(bn)).filter(ke)},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:Ze,mutationThunk:Ot,api:Z,serializeQueryArgs:rt,context:ve}),Lr=Nn.buildInitiateQuery,ir=Nn.buildInitiateMutation;return $r(Z.util,{getRunningOperationPromises:Nn.getRunningOperationPromises,getRunningOperationPromise:Nn.removalWarning,getRunningMutationThunk:Nn.getRunningMutationThunk,getRunningMutationsThunk:Nn.getRunningMutationsThunk,getRunningQueryThunk:Nn.getRunningQueryThunk,getRunningQueriesThunk:Nn.getRunningQueriesThunk}),{name:Oa,injectEndpoint:function(Tt,Dn){var Ln,lr=Z;(Ln=lr.endpoints)[Tt]!=null||(Ln[Tt]={}),se(Dn)?$r(lr.endpoints[Tt],{name:Tt,select:tn(Tt,Dn),initiate:Lr(Tt,Dn)},Kt(Ze,Tt)):Dn.type===oe.mutation&&$r(lr.endpoints[Tt],{name:Tt,select:dn(),initiate:ir(Tt)},Kt(Ot,Tt))}}}}},Os=pt(ui())})(KE);YE.exports=KE;var Ja=YE.exports;const XE=p.memo(({board:e,isSelected:t})=>{const n=ce(),{currentData:r}=xa(e.cover_image_name??Ja.skipToken),{colorMode:o}=zo(),{board_name:s,board_id:a}=e,{onClickDeleteBoardImages:c}=p.useContext(a3),d=p.useCallback(()=>{n(i3(a))},[a,n]),[f,{isLoading:h}]=o7(),[m,{isLoading:v}]=s7(),y=j=>{f({board_id:a,changes:{board_name:j}})},S=p.useCallback(()=>{m(a)},[a,m]),x=p.useCallback(()=>{console.log({board:e}),c(e)},[e,c]),w={id:a,actionType:"MOVE_BOARD",context:{boardId:a}},{isOver:_,setNodeRef:k,active:P}=rf({id:`board_droppable_${a}`,data:w});return i.jsx(ut,{sx:{touchAction:"none",height:"full"},children:i.jsx(PE,{menuProps:{size:"sm",isLazy:!0},renderMenu:()=>i.jsxs(gf,{sx:{visibility:"visible !important"},children:[e.image_count>0&&i.jsx(vo,{sx:{color:"error.300"},icon:i.jsx(Mo,{}),onClickCapture:x,children:"Delete Board and Images"}),i.jsx(vo,{sx:{color:Fe("error.700","error.300")(o)},icon:i.jsx(Mo,{}),onClickCapture:S,children:"Delete Board"})]}),children:j=>i.jsxs(X,{userSelect:"none",ref:j,sx:{flexDir:"column",justifyContent:"space-between",alignItems:"center",cursor:"pointer",w:"full",h:"full"},children:[i.jsxs(X,{ref:k,onClick:d,sx:{position:"relative",justifyContent:"center",alignItems:"center",borderRadius:"base",w:"full",aspectRatio:"1/1",overflow:"hidden",shadow:t?"selected.light":void 0,_dark:{shadow:t?"selected.dark":void 0},flexShrink:0},children:[e.cover_image_name&&(r==null?void 0:r.image_url)&&i.jsx(eg,{src:r==null?void 0:r.image_url,draggable:!1}),!(e.cover_image_name&&(r!=null&&r.image_url))&&i.jsx(xf,{boxSize:8,icon:fh,sx:{border:"2px solid var(--invokeai-colors-base-200)",_dark:{border:"2px solid var(--invokeai-colors-base-800)"}}}),i.jsx(X,{sx:{position:"absolute",insetInlineEnd:0,top:0,p:1},children:i.jsx(Kc,{variant:"solid",children:e.image_count})}),i.jsx(Xo,{children:qc(w,P)&&i.jsx(eu,{isOver:_})})]}),i.jsx(X,{sx:{width:"full",height:"full",justifyContent:"center",alignItems:"center"},children:i.jsxs(w5,{defaultValue:s,submitOnBlur:!1,onSubmit:I=>{y(I)},children:[i.jsx(y5,{sx:{color:t?Fe("base.900","base.50")(o):Fe("base.700","base.200")(o),fontWeight:t?600:void 0,fontSize:"xs",textAlign:"center",p:0},noOfLines:1}),i.jsx(v5,{sx:{color:Fe("base.900","base.50")(o),fontSize:"xs",borderColor:Fe("base.500","base.500")(o),p:0,outline:0}})]})})]},a)})})});XE.displayName="HoverableBoard";const xq="My Board",wq=()=>{const[e,{isLoading:t}]=a7(),n=p.useCallback(()=>{e(xq)},[e]);return i.jsx(cn,{isLoading:t,"aria-label":"Add Board",onClick:n,size:"sm",sx:{px:4},children:"Add Board"})},Sq=({isSelected:e})=>{const t=i7(),{colorMode:n}=zo(),r=()=>{t(i3())},o={id:"all-images-board",actionType:"MOVE_BOARD",context:{boardId:null}},{isOver:s,setNodeRef:a,active:c}=rf({id:"board_droppable_all_images",data:o});return i.jsxs(X,{sx:{flexDir:"column",justifyContent:"space-between",alignItems:"center",cursor:"pointer",w:"full",h:"full",borderRadius:"base"},children:[i.jsxs(X,{ref:a,onClick:r,sx:{position:"relative",justifyContent:"center",alignItems:"center",borderRadius:"base",w:"full",aspectRatio:"1/1",overflow:"hidden",shadow:e?"selected.light":void 0,_dark:{shadow:e?"selected.dark":void 0},flexShrink:0},children:[i.jsx(xf,{boxSize:8,icon:VW,sx:{border:"2px solid var(--invokeai-colors-base-200)",_dark:{border:"2px solid var(--invokeai-colors-base-800)"}}}),i.jsx(Xo,{children:qc(o,c)&&i.jsx(eu,{isOver:s})})]}),i.jsx(X,{sx:{h:"full",alignItems:"center",color:e?Fe("base.900","base.50")(n):Fe("base.700","base.200")(n),fontWeight:e?600:void 0,fontSize:"xs"},children:"All Images"})]})},Cq=Oe([Bn],({boards:e,gallery:t})=>{const{searchText:n}=e,{selectedBoardId:r}=t;return{selectedBoardId:r,searchText:n}},Lt),_q=e=>{const{isOpen:t}=e,n=ce(),{selectedBoardId:r,searchText:o}=Y(Cq),{data:s}=Zy(),a=o?s==null?void 0:s.filter(m=>m.board_name.toLowerCase().includes(o.toLowerCase())):s,[c,d]=p.useState(!1),f=m=>{d(m.length>0),n(Hw(m))},h=()=>{d(!1),n(Hw(""))};return i.jsx(sg,{in:t,animateOpacity:!0,children:i.jsxs(X,{layerStyle:"first",sx:{flexDir:"column",gap:2,p:2,mt:2,borderRadius:"base"},children:[i.jsxs(X,{sx:{gap:2,alignItems:"center"},children:[i.jsxs(c6,{children:[i.jsx(df,{placeholder:"Search Boards...",value:o,onChange:m=>{f(m.target.value)}}),o&&o.length&&i.jsx(Sb,{children:i.jsx(Ya,{onClick:h,size:"xs",variant:"ghost","aria-label":"Clear Search",icon:i.jsx(iU,{boxSize:3})})})]}),i.jsx(wq,{})]}),i.jsx(fE,{defer:!0,style:{height:"100%",width:"100%"},options:{scrollbars:{visibility:"auto",autoHide:"move",autoHideDelay:1300,theme:"os-theme-dark"}},children:i.jsxs(Ka,{className:"list-container",sx:{gridTemplateRows:"6.5rem 6.5rem",gridAutoFlow:"column dense",gridAutoColumns:"5rem"},children:[!c&&i.jsx(F1,{sx:{p:1.5},children:i.jsx(Sq,{isSelected:!r})}),a&&a.map(m=>i.jsx(F1,{sx:{p:1.5},children:i.jsx(XE,{board:m,isSelected:r===m.board_id})},m.board_id))]})})]})})},kq=p.memo(_q),Pq=Array(20).fill("loading"),jq=Oe([Bn,l3],(e,t)=>{const{categories:n,total:r,isLoading:o,selectedBoardId:s,galleryImageMinimumWidth:a,galleryView:c,shouldAutoSwitch:d}=e.gallery,{shouldPinGallery:f}=e.ui,h=t;return{images:o?h.concat(Pq):h,allImagesTotal:r,isLoading:o,categories:n,selectedBoardId:s,shouldPinGallery:f,galleryImageMinimumWidth:a,shouldAutoSwitch:d,galleryView:c}},Lt),Eq=()=>{const e=ce(),{t}=we(),n=p.useRef(null),r=p.useRef(null),[o,s]=p.useState(null),[a,c]=dE({defer:!0,options:{scrollbars:{visibility:"auto",autoHide:"leave",autoHideDelay:1300,theme:"os-theme-dark"},overflow:{x:"hidden"}}}),{colorMode:d}=zo(),{images:f,isLoading:h,allImagesTotal:m,categories:v,selectedBoardId:y,shouldPinGallery:S,galleryImageMinimumWidth:x,shouldAutoSwitch:w,galleryView:_}=Y(jq),{selectedBoard:k}=Zy(void 0,{selectFromResult:({data:$})=>({selectedBoard:$==null?void 0:$.find(H=>H.board_id===y)})}),P=p.useMemo(()=>(k==null?void 0:k.image_count)??m,[m,k==null?void 0:k.image_count]),j=p.useMemo(()=>f.length<P,[f.length,P]),I=p.useCallback(()=>{e(l7({categories:v,board_id:y,is_intermediate:!1}))},[v,e,y]),O=p.useMemo(()=>{if(j&&!h)return I},[j,I,h]),{isOpen:T,onToggle:R}=Yc(),M=$=>{e(_h($))},D=()=>{e(c3()),e(ea())};p.useEffect(()=>{const{current:$}=r;return o&&$&&a({target:$,elements:{viewport:o}}),()=>{var H;return(H=c())==null?void 0:H.destroy()}},[o,a,c]);const A=p.useCallback(()=>{e(Vw(c7)),e(Ww("images"))},[e]),G=p.useCallback(()=>{e(Vw(u7)),e(Ww("assets"))},[e]);return i.jsxs(Ar,{sx:{flexDirection:"column",h:"full",w:"full",borderRadius:"base"},children:[i.jsxs(ut,{sx:{w:"full"},children:[i.jsxs(X,{ref:n,sx:{alignItems:"center",justifyContent:"space-between",gap:2},children:[i.jsxs(Or,{isAttached:!0,children:[i.jsx(Ne,{tooltip:t("gallery.images"),"aria-label":t("gallery.images"),onClick:A,isChecked:_==="images",size:"sm",icon:i.jsx(zd,{})}),i.jsx(Ne,{tooltip:t("gallery.assets"),"aria-label":t("gallery.assets"),onClick:G,isChecked:_==="assets",size:"sm",icon:i.jsx(eU,{})})]}),i.jsxs(X,{as:ag,onClick:R,size:"sm",variant:"ghost",sx:{w:"full",justifyContent:"center",alignItems:"center",px:2,_hover:{bg:Fe("base.100","base.800")(d)}},children:[i.jsx(nt,{noOfLines:1,sx:{w:"full",color:Fe("base.800","base.200")(d),fontWeight:600},children:k?k.board_name:"All Images"}),i.jsx(vx,{sx:{transform:T?"rotate(0deg)":"rotate(180deg)",transitionProperty:"common",transitionDuration:"normal"}})]}),i.jsx(Ba,{triggerComponent:i.jsx(Ne,{tooltip:t("gallery.gallerySettings"),"aria-label":t("gallery.gallerySettings"),size:"sm",icon:i.jsx(mx,{})}),children:i.jsxs(X,{direction:"column",gap:2,children:[i.jsx(Et,{value:x,onChange:M,min:32,max:256,hideTooltip:!0,label:t("gallery.galleryImageSize"),withReset:!0,handleReset:()=>e(_h(64))}),i.jsx(Hn,{label:t("gallery.autoSwitchNewImages"),isChecked:w,onChange:$=>e(d7($.target.checked))})]})}),i.jsx(Ne,{size:"sm","aria-label":t("gallery.pinGallery"),tooltip:`${t("gallery.pinGallery")} (Shift+G)`,onClick:D,icon:S?i.jsx(pE,{}):i.jsx(hE,{})})]}),i.jsx(ut,{children:i.jsx(kq,{isOpen:T})})]}),i.jsx(X,{direction:"column",gap:2,h:"full",w:"full",children:f.length||j?i.jsxs(i.Fragment,{children:[i.jsx(ut,{ref:r,"data-overlayscrollbars":"",h:"100%",children:i.jsx(yq,{style:{height:"100%"},data:f,endReached:O,components:{Item:Iq,List:Oq},scrollerRef:s,itemContent:($,H)=>typeof H=="string"?i.jsx(Bb,{sx:{w:"full",h:"full",aspectRatio:"1/1"}}):i.jsx(_G,{imageDTO:H},`${H.image_name}-${H.thumbnail_url}`)})}),i.jsx(cn,{onClick:I,isDisabled:!j,isLoading:h,loadingText:"Loading",flexShrink:0,children:t(j?"gallery.loadMore":"gallery.allImagesLoaded")})]}):i.jsx(xf,{label:t("gallery.noImagesInGallery"),icon:zd})})]})},Iq=ze((e,t)=>i.jsx(ut,{className:"item-container",ref:t,p:1.5,children:e.children})),Oq=ze((e,t)=>{const n=Y(r=>r.gallery.galleryImageMinimumWidth);return i.jsx(Ka,{...e,className:"list-container",ref:t,sx:{gridTemplateColumns:`repeat(auto-fill, minmax(${n}px, 1fr));`},children:e.children})}),ZE=p.memo(Eq);var Tq=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(r[s]=o[s])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Dr=globalThis&&globalThis.__assign||function(){return Dr=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},Dr.apply(this,arguments)},k4={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},P4={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},Op={width:"20px",height:"20px",position:"absolute"},Rq={top:Dr(Dr({},k4),{top:"-5px"}),right:Dr(Dr({},P4),{left:void 0,right:"-5px"}),bottom:Dr(Dr({},k4),{top:void 0,bottom:"-5px"}),left:Dr(Dr({},P4),{left:"-5px"}),topRight:Dr(Dr({},Op),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:Dr(Dr({},Op),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:Dr(Dr({},Op),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:Dr(Dr({},Op),{left:"-10px",top:"-10px",cursor:"nw-resize"})},Mq=function(e){Tq(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.onMouseDown=function(r){n.props.onResizeStart(r,n.props.direction)},n.onTouchStart=function(r){n.props.onResizeStart(r,n.props.direction)},n}return t.prototype.render=function(){return p.createElement("div",{className:this.props.className||"",style:Dr(Dr({position:"absolute",userSelect:"none"},Rq[this.props.direction]),this.props.replaceStyles||{}),onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart},this.props.children)},t}(p.PureComponent),Dq=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(r[s]=o[s])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),pa=globalThis&&globalThis.__assign||function(){return pa=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},pa.apply(this,arguments)},Aq={width:"auto",height:"auto"},Tp=function(e,t,n){return Math.max(Math.min(e,n),t)},j4=function(e,t){return Math.round(e/t)*t},vc=function(e,t){return new RegExp(e,"i").test(t)},Rp=function(e){return!!(e.touches&&e.touches.length)},Nq=function(e){return!!((e.clientX||e.clientX===0)&&(e.clientY||e.clientY===0))},E4=function(e,t,n){n===void 0&&(n=0);var r=t.reduce(function(s,a,c){return Math.abs(a-e)<Math.abs(t[s]-e)?c:s},0),o=Math.abs(t[r]-e);return n===0||o<n?t[r]:e},K0=function(e){return e=e.toString(),e==="auto"||e.endsWith("px")||e.endsWith("%")||e.endsWith("vh")||e.endsWith("vw")||e.endsWith("vmax")||e.endsWith("vmin")?e:e+"px"},Mp=function(e,t,n,r){if(e&&typeof e=="string"){if(e.endsWith("px"))return Number(e.replace("px",""));if(e.endsWith("%")){var o=Number(e.replace("%",""))/100;return t*o}if(e.endsWith("vw")){var o=Number(e.replace("vw",""))/100;return n*o}if(e.endsWith("vh")){var o=Number(e.replace("vh",""))/100;return r*o}}return e},zq=function(e,t,n,r,o,s,a){return r=Mp(r,e.width,t,n),o=Mp(o,e.height,t,n),s=Mp(s,e.width,t,n),a=Mp(a,e.height,t,n),{maxWidth:typeof r>"u"?void 0:Number(r),maxHeight:typeof o>"u"?void 0:Number(o),minWidth:typeof s>"u"?void 0:Number(s),minHeight:typeof a>"u"?void 0:Number(a)}},$q=["as","style","className","grid","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],I4="__resizable_base__",Lq=function(e){Dq(t,e);function t(n){var r=e.call(this,n)||this;return r.ratio=1,r.resizable=null,r.parentLeft=0,r.parentTop=0,r.resizableLeft=0,r.resizableRight=0,r.resizableTop=0,r.resizableBottom=0,r.targetLeft=0,r.targetTop=0,r.appendBase=function(){if(!r.resizable||!r.window)return null;var o=r.parentNode;if(!o)return null;var s=r.window.document.createElement("div");return s.style.width="100%",s.style.height="100%",s.style.position="absolute",s.style.transform="scale(0, 0)",s.style.left="0",s.style.flex="0 0 100%",s.classList?s.classList.add(I4):s.className+=I4,o.appendChild(s),s},r.removeBase=function(o){var s=r.parentNode;s&&s.removeChild(o)},r.ref=function(o){o&&(r.resizable=o)},r.state={isResizing:!1,width:typeof(r.propsSize&&r.propsSize.width)>"u"?"auto":r.propsSize&&r.propsSize.width,height:typeof(r.propsSize&&r.propsSize.height)>"u"?"auto":r.propsSize&&r.propsSize.height,direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},r.onResizeStart=r.onResizeStart.bind(r),r.onMouseMove=r.onMouseMove.bind(r),r.onMouseUp=r.onMouseUp.bind(r),r}return Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return!this.resizable||!this.resizable.ownerDocument?null:this.resizable.ownerDocument.defaultView},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||Aq},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var n=0,r=0;if(this.resizable&&this.window){var o=this.resizable.offsetWidth,s=this.resizable.offsetHeight,a=this.resizable.style.position;a!=="relative"&&(this.resizable.style.position="relative"),n=this.resizable.style.width!=="auto"?this.resizable.offsetWidth:o,r=this.resizable.style.height!=="auto"?this.resizable.offsetHeight:s,this.resizable.style.position=a}return{width:n,height:r}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var n=this,r=this.props.size,o=function(c){if(typeof n.state[c]>"u"||n.state[c]==="auto")return"auto";if(n.propsSize&&n.propsSize[c]&&n.propsSize[c].toString().endsWith("%")){if(n.state[c].toString().endsWith("%"))return n.state[c].toString();var d=n.getParentSize(),f=Number(n.state[c].toString().replace("px","")),h=f/d[c]*100;return h+"%"}return K0(n.state[c])},s=r&&typeof r.width<"u"&&!this.state.isResizing?K0(r.width):o("width"),a=r&&typeof r.height<"u"&&!this.state.isResizing?K0(r.height):o("height");return{width:s,height:a}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var n=this.appendBase();if(!n)return{width:0,height:0};var r=!1,o=this.parentNode.style.flexWrap;o!=="wrap"&&(r=!0,this.parentNode.style.flexWrap="wrap"),n.style.position="relative",n.style.minWidth="100%",n.style.minHeight="100%";var s={width:n.offsetWidth,height:n.offsetHeight};return r&&(this.parentNode.style.flexWrap=o),this.removeBase(n),s},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},t.prototype.componentDidMount=function(){if(!(!this.resizable||!this.window)){var n=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:n.flexBasis!=="auto"?n.flexBasis:void 0})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(n,r){var o=this.propsSize&&this.propsSize[r];return this.state[r]==="auto"&&this.state.original[r]===n&&(typeof o>"u"||o==="auto")?"auto":n},t.prototype.calculateNewMaxFromBoundary=function(n,r){var o=this.props.boundsByDirection,s=this.state.direction,a=o&&vc("left",s),c=o&&vc("top",s),d,f;if(this.props.bounds==="parent"){var h=this.parentNode;h&&(d=a?this.resizableRight-this.parentLeft:h.offsetWidth+(this.parentLeft-this.resizableLeft),f=c?this.resizableBottom-this.parentTop:h.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(d=a?this.resizableRight:this.window.innerWidth-this.resizableLeft,f=c?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(d=a?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),f=c?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return d&&Number.isFinite(d)&&(n=n&&n<d?n:d),f&&Number.isFinite(f)&&(r=r&&r<f?r:f),{maxWidth:n,maxHeight:r}},t.prototype.calculateNewSizeFromDirection=function(n,r){var o=this.props.scale||1,s=this.props.resizeRatio||1,a=this.state,c=a.direction,d=a.original,f=this.props,h=f.lockAspectRatio,m=f.lockAspectRatioExtraHeight,v=f.lockAspectRatioExtraWidth,y=d.width,S=d.height,x=m||0,w=v||0;return vc("right",c)&&(y=d.width+(n-d.x)*s/o,h&&(S=(y-w)/this.ratio+x)),vc("left",c)&&(y=d.width-(n-d.x)*s/o,h&&(S=(y-w)/this.ratio+x)),vc("bottom",c)&&(S=d.height+(r-d.y)*s/o,h&&(y=(S-x)*this.ratio+w)),vc("top",c)&&(S=d.height-(r-d.y)*s/o,h&&(y=(S-x)*this.ratio+w)),{newWidth:y,newHeight:S}},t.prototype.calculateNewSizeFromAspectRatio=function(n,r,o,s){var a=this.props,c=a.lockAspectRatio,d=a.lockAspectRatioExtraHeight,f=a.lockAspectRatioExtraWidth,h=typeof s.width>"u"?10:s.width,m=typeof o.width>"u"||o.width<0?n:o.width,v=typeof s.height>"u"?10:s.height,y=typeof o.height>"u"||o.height<0?r:o.height,S=d||0,x=f||0;if(c){var w=(v-S)*this.ratio+x,_=(y-S)*this.ratio+x,k=(h-x)/this.ratio+S,P=(m-x)/this.ratio+S,j=Math.max(h,w),I=Math.min(m,_),O=Math.max(v,k),T=Math.min(y,P);n=Tp(n,j,I),r=Tp(r,O,T)}else n=Tp(n,h,m),r=Tp(r,v,y);return{newWidth:n,newHeight:r}},t.prototype.setBoundingClientRect=function(){if(this.props.bounds==="parent"){var n=this.parentNode;if(n){var r=n.getBoundingClientRect();this.parentLeft=r.left,this.parentTop=r.top}}if(this.props.bounds&&typeof this.props.bounds!="string"){var o=this.props.bounds.getBoundingClientRect();this.targetLeft=o.left,this.targetTop=o.top}if(this.resizable){var s=this.resizable.getBoundingClientRect(),a=s.left,c=s.top,d=s.right,f=s.bottom;this.resizableLeft=a,this.resizableRight=d,this.resizableTop=c,this.resizableBottom=f}},t.prototype.onResizeStart=function(n,r){if(!(!this.resizable||!this.window)){var o=0,s=0;if(n.nativeEvent&&Nq(n.nativeEvent)?(o=n.nativeEvent.clientX,s=n.nativeEvent.clientY):n.nativeEvent&&Rp(n.nativeEvent)&&(o=n.nativeEvent.touches[0].clientX,s=n.nativeEvent.touches[0].clientY),this.props.onResizeStart&&this.resizable){var a=this.props.onResizeStart(n,r,this.resizable);if(a===!1)return}this.props.size&&(typeof this.props.size.height<"u"&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),typeof this.props.size.width<"u"&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio=typeof this.props.lockAspectRatio=="number"?this.props.lockAspectRatio:this.size.width/this.size.height;var c,d=this.window.getComputedStyle(this.resizable);if(d.flexBasis!=="auto"){var f=this.parentNode;if(f){var h=this.window.getComputedStyle(f).flexDirection;this.flexDir=h.startsWith("row")?"row":"column",c=d.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var m={original:{x:o,y:s,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:pa(pa({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(n.target).cursor||"auto"}),direction:r,flexBasis:c};this.setState(m)}},t.prototype.onMouseMove=function(n){var r=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&Rp(n))try{n.preventDefault(),n.stopPropagation()}catch{}var o=this.props,s=o.maxWidth,a=o.maxHeight,c=o.minWidth,d=o.minHeight,f=Rp(n)?n.touches[0].clientX:n.clientX,h=Rp(n)?n.touches[0].clientY:n.clientY,m=this.state,v=m.direction,y=m.original,S=m.width,x=m.height,w=this.getParentSize(),_=zq(w,this.window.innerWidth,this.window.innerHeight,s,a,c,d);s=_.maxWidth,a=_.maxHeight,c=_.minWidth,d=_.minHeight;var k=this.calculateNewSizeFromDirection(f,h),P=k.newHeight,j=k.newWidth,I=this.calculateNewMaxFromBoundary(s,a);this.props.snap&&this.props.snap.x&&(j=E4(j,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(P=E4(P,this.props.snap.y,this.props.snapGap));var O=this.calculateNewSizeFromAspectRatio(j,P,{width:I.maxWidth,height:I.maxHeight},{width:c,height:d});if(j=O.newWidth,P=O.newHeight,this.props.grid){var T=j4(j,this.props.grid[0]),R=j4(P,this.props.grid[1]),M=this.props.snapGap||0;j=M===0||Math.abs(T-j)<=M?T:j,P=M===0||Math.abs(R-P)<=M?R:P}var D={width:j-y.width,height:P-y.height};if(S&&typeof S=="string"){if(S.endsWith("%")){var A=j/w.width*100;j=A+"%"}else if(S.endsWith("vw")){var G=j/this.window.innerWidth*100;j=G+"vw"}else if(S.endsWith("vh")){var $=j/this.window.innerHeight*100;j=$+"vh"}}if(x&&typeof x=="string"){if(x.endsWith("%")){var A=P/w.height*100;P=A+"%"}else if(x.endsWith("vw")){var G=P/this.window.innerWidth*100;P=G+"vw"}else if(x.endsWith("vh")){var $=P/this.window.innerHeight*100;P=$+"vh"}}var H={width:this.createSizeForCssProperty(j,"width"),height:this.createSizeForCssProperty(P,"height")};this.flexDir==="row"?H.flexBasis=H.width:this.flexDir==="column"&&(H.flexBasis=H.height),ng.flushSync(function(){r.setState(H)}),this.props.onResize&&this.props.onResize(n,v,this.resizable,D)}},t.prototype.onMouseUp=function(n){var r=this.state,o=r.isResizing,s=r.direction,a=r.original;if(!(!o||!this.resizable)){var c={width:this.size.width-a.width,height:this.size.height-a.height};this.props.onResizeStop&&this.props.onResizeStop(n,s,this.resizable,c),this.props.size&&this.setState(this.props.size),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:pa(pa({},this.state.backgroundStyle),{cursor:"auto"})})}},t.prototype.updateSize=function(n){this.setState({width:n.width,height:n.height})},t.prototype.renderResizer=function(){var n=this,r=this.props,o=r.enable,s=r.handleStyles,a=r.handleClasses,c=r.handleWrapperStyle,d=r.handleWrapperClass,f=r.handleComponent;if(!o)return null;var h=Object.keys(o).map(function(m){return o[m]!==!1?p.createElement(Mq,{key:m,direction:m,onResizeStart:n.onResizeStart,replaceStyles:s&&s[m],className:a&&a[m]},f&&f[m]?f[m]:null):null});return p.createElement("div",{className:d,style:c},h)},t.prototype.render=function(){var n=this,r=Object.keys(this.props).reduce(function(a,c){return $q.indexOf(c)!==-1||(a[c]=n.props[c]),a},{}),o=pa(pa(pa({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(o.flexBasis=this.state.flexBasis);var s=this.props.as||"div";return p.createElement(s,pa({ref:this.ref,style:o,className:this.props.className},r),this.state.isResizing&&p.createElement("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer())},t.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t}(p.PureComponent);const Bq=({direction:e,langDirection:t})=>({top:e==="bottom",right:t!=="rtl"&&e==="left"||t==="rtl"&&e==="right",bottom:e==="top",left:t!=="rtl"&&e==="right"||t==="rtl"&&e==="left"}),Fq=({direction:e,minWidth:t,maxWidth:n,minHeight:r,maxHeight:o})=>{const s=t??(["left","right"].includes(e)?10:void 0),a=n??(["left","right"].includes(e)?"95vw":void 0),c=r??(["top","bottom"].includes(e)?10:void 0),d=o??(["top","bottom"].includes(e)?"95vh":void 0);return{...s?{minWidth:s}:{},...a?{maxWidth:a}:{},...c?{minHeight:c}:{},...d?{maxHeight:d}:{}}},za="0.75rem",Dp="1rem",Yu="5px",Hq=({isResizable:e,direction:t})=>{const n=`calc((2 * ${za} + ${Yu}) / -2)`;return t==="top"?{containerStyles:{borderBottomWidth:Yu,paddingBottom:Dp},handleStyles:e?{top:{paddingTop:za,paddingBottom:za,bottom:n}}:{}}:t==="left"?{containerStyles:{borderInlineEndWidth:Yu,paddingInlineEnd:Dp},handleStyles:e?{right:{paddingInlineStart:za,paddingInlineEnd:za,insetInlineEnd:n}}:{}}:t==="bottom"?{containerStyles:{borderTopWidth:Yu,paddingTop:Dp},handleStyles:e?{bottom:{paddingTop:za,paddingBottom:za,top:n}}:{}}:t==="right"?{containerStyles:{borderInlineStartWidth:Yu,paddingInlineStart:Dp},handleStyles:e?{left:{paddingInlineStart:za,paddingInlineEnd:za,insetInlineStart:n}}:{}}:{containerStyles:{},handleStyles:{}}},Vq=(e,t)=>["top","bottom"].includes(e)?e:e==="left"?t==="rtl"?"right":"left":e==="right"?t==="rtl"?"left":"right":"left",Wq=Ie(Lq,{shouldForwardProp:e=>!["sx"].includes(e)}),QE=({direction:e="left",isResizable:t,isOpen:n,onClose:r,children:o,initialWidth:s,minWidth:a,maxWidth:c,initialHeight:d,minHeight:f,maxHeight:h,onResizeStart:m,onResizeStop:v,onResize:y,sx:S={}})=>{const x=vu().direction,{colorMode:w}=zo(),_=p.useRef(null),k=p.useMemo(()=>s??a??(["left","right"].includes(e)?"auto":"100%"),[s,a,e]),P=p.useMemo(()=>d??f??(["top","bottom"].includes(e)?"auto":"100%"),[d,f,e]),[j,I]=p.useState(k),[O,T]=p.useState(P);az({ref:_,handler:()=>{r()},enabled:n});const R=p.useMemo(()=>t?Bq({direction:e,langDirection:x}):{},[t,x,e]),M=p.useMemo(()=>Fq({direction:e,minWidth:a,maxWidth:c,minHeight:f,maxHeight:h}),[a,c,f,h,e]),{containerStyles:D,handleStyles:A}=p.useMemo(()=>Hq({isResizable:t,direction:e}),[t,e]),G=p.useMemo(()=>Vq(e,x),[e,x]);return p.useEffect(()=>{["left","right"].includes(e)&&T("100vh"),["top","bottom"].includes(e)&&I("100vw")},[e]),i.jsx(o5,{direction:G,in:n,motionProps:{initial:!1},style:{width:"full"},children:i.jsx(ut,{ref:_,sx:{width:"full",height:"full"},children:i.jsx(Wq,{size:{width:t?j:k,height:t?O:P},enable:R,handleStyles:A,...M,sx:{borderColor:Fe("base.200","base.800")(w),p:4,bg:Fe("base.100","base.900")(w),height:"full",shadow:n?"dark-lg":void 0,...D,...S},onResizeStart:($,H,U)=>{m&&m($,H,U)},onResize:($,H,U,q)=>{y&&y($,H,U,q)},onResizeStop:($,H,U,q)=>{["left","right"].includes(H)&&I(Number(j)+q.width),["top","bottom"].includes(H)&&T(Number(O)+q.height),v&&v($,H,U,q)},children:o})})})},JE=Oe(e=>e.lightbox,e=>e,{memoizeOptions:{equalityCheck:en}}),Uq=Oe([Gr,ks,Rj,vr,JE],(e,t,n,r,o)=>{const{shouldPinGallery:s,shouldShowGallery:a}=t,{galleryImageMinimumWidth:c}=n,{isLightboxOpen:d}=o;return{activeTabName:e,isStaging:r,shouldPinGallery:s,shouldShowGallery:a,galleryImageMinimumWidth:c,isResizable:e!=="unifiedCanvas",isLightboxOpen:d}},{memoizeOptions:{resultEqualityCheck:en}}),Gq=()=>{const e=ce(),{shouldPinGallery:t,shouldShowGallery:n,galleryImageMinimumWidth:r}=Y(Uq),o=()=>{e(_1(!1)),t&&e(ea())};et("esc",()=>{e(_1(!1))},{enabled:()=>!t,preventDefault:!0},[t]);const s=32;return et("shift+up",()=>{if(r<256){const a=Ks(r+s,32,256);e(_h(a))}},[r]),et("shift+down",()=>{if(r>32){const a=Ks(r-s,32,256);e(_h(a))}},[r]),t?null:i.jsx(QE,{direction:"right",isResizable:!0,isOpen:n,onClose:o,minWidth:337,children:i.jsx(ZE,{})})},qq=p.memo(Gq),Yq=e=>{const{label:t,isDisabled:n=!1,width:r="auto",formControlProps:o,formLabelProps:s,tooltip:a,...c}=e;return i.jsx(Wn,{label:a,hasArrow:!0,placement:"top",isDisabled:!a,children:i.jsxs(ar,{isDisabled:n,width:r,display:"flex",alignItems:"center",...o,children:[t&&i.jsx(hr,{my:1,flexGrow:1,sx:{cursor:n?"not-allowed":"pointer",...s==null?void 0:s.sx,pe:4},...s,children:t}),i.jsx(Fb,{...c})]})})},Zn=p.memo(Yq),Kq=e=>{const{imageUsage:t}=e;return!t||!u3(t)?null:i.jsxs(i.Fragment,{children:[i.jsx(nt,{children:"This image is currently in use in the following features:"}),i.jsxs(cg,{sx:{paddingInlineStart:6},children:[t.isInitialImage&&i.jsx(qo,{children:"Image to Image"}),t.isCanvasImage&&i.jsx(qo,{children:"Unified Canvas"}),t.isControlNetImage&&i.jsx(qo,{children:"ControlNet"}),t.isNodesImage&&i.jsx(qo,{children:"Node Editor"})]}),i.jsx(nt,{children:"If you delete this image, those features will immediately be reset."})]})},Xq=p.memo(Kq),Zq=Oe([Bn,f7],({system:e,config:t,imageDeletion:n},r)=>{const{shouldConfirmOnDelete:o}=e,{canRestoreDeletedImagesFromBin:s}=t,{imageToDelete:a,isModalOpen:c}=n;return{shouldConfirmOnDelete:o,canRestoreDeletedImagesFromBin:s,imageToDelete:a,imageUsage:r,isModalOpen:c}},Lt),Qq=()=>{const e=ce(),{t}=we(),{shouldConfirmOnDelete:n,canRestoreDeletedImagesFromBin:r,imageToDelete:o,imageUsage:s,isModalOpen:a}=Y(Zq),c=p.useCallback(m=>e(d3(!m.target.checked)),[e]),d=p.useCallback(()=>{e(Uw()),e(p7(!1))},[e]),f=p.useCallback(()=>{!o||!s||(e(Uw()),e(h7({imageDTO:o,imageUsage:s})))},[e,o,s]),h=p.useRef(null);return i.jsx(hg,{isOpen:a,onClose:d,leastDestructiveRef:h,isCentered:!0,children:i.jsx(Li,{children:i.jsxs(mg,{children:[i.jsx($i,{fontSize:"lg",fontWeight:"bold",children:t("gallery.deleteImage")}),i.jsx(Bi,{children:i.jsxs(X,{direction:"column",gap:3,children:[i.jsx(Xq,{imageUsage:s}),i.jsx(ai,{}),i.jsx(nt,{children:t(r?"gallery.deleteImageBin":"gallery.deleteImagePermanent")}),i.jsx(nt,{children:t("common.areYouSure")}),i.jsx(Zn,{label:t("common.dontAskMeAgain"),isChecked:!n,onChange:c})]})}),i.jsxs(zi,{children:[i.jsx(cn,{ref:h,onClick:d,children:"Cancel"}),i.jsx(cn,{colorScheme:"error",onClick:f,ml:3,children:"Delete"})]})]})})})},Jq=p.memo(Qq);function eY(e){const t=p.createContext(null);return[({children:o,value:s})=>F.createElement(t.Provider,{value:s},o),()=>{const o=p.useContext(t);if(o===null)throw new Error(e);return o}]}function eI(e){return Array.isArray(e)?e:[e]}const tY=()=>{};function nY(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||tY:n=>{var r;n.key==="Escape"&&(e(n),(r=t.onTrigger)==null||r.call(t))}}function tI({data:e}){const t=[],n=[],r=e.reduce((o,s,a)=>(s.group?o[s.group]?o[s.group].push(a):o[s.group]=[a]:n.push(a),o),{});return Object.keys(r).forEach(o=>{t.push(...r[o].map(s=>e[s]))}),t.push(...n.map(o=>e[o])),t}function nI(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==F.Fragment:!1}function rI(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=rI(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function oI(){for(var e=0,t,n,r="";e<arguments.length;)(t=arguments[e++])&&(n=rI(t))&&(r&&(r+=" "),r+=n);return r}const rY={app:100,modal:200,popover:300,overlay:400,max:9999};function Sx(e){return rY[e]}function oY(e,t){const n=p.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 sY=m7({key:"mantine",prepend:!0});function aY(){return G3()||sY}var iY=Object.defineProperty,O4=Object.getOwnPropertySymbols,lY=Object.prototype.hasOwnProperty,cY=Object.prototype.propertyIsEnumerable,T4=(e,t,n)=>t in e?iY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,uY=(e,t)=>{for(var n in t||(t={}))lY.call(t,n)&&T4(e,n,t[n]);if(O4)for(var n of O4(t))cY.call(t,n)&&T4(e,n,t[n]);return e};const X0="ref";function dY(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(!(X0 in n))return{args:e,ref:t};t=n[X0];const r=uY({},n);return delete r[X0],{args:[r],ref:t}}const{cssFactory:fY}=(()=>{function e(n,r,o){const s=[],a=y7(n,s,o);return s.length<2?o:a+r(s)}function t(n){const{cache:r}=n,o=(...a)=>{const{ref:c,args:d}=dY(a),f=g7(d,r.registered);return v7(r,f,!1),`${r.key}-${f.name}${c===void 0?"":` ${c}`}`};return{css:o,cx:(...a)=>e(r.registered,o,oI(a))}}return{cssFactory:t}})();function sI(){const e=aY();return oY(()=>fY({cache:e}),[e])}function pY({cx:e,classes:t,context:n,classNames:r,name:o,cache:s}){const a=n.reduce((c,d)=>(Object.keys(d.classNames).forEach(f=>{typeof c[f]!="string"?c[f]=`${d.classNames[f]}`:c[f]=`${c[f]} ${d.classNames[f]}`}),c),{});return Object.keys(t).reduce((c,d)=>(c[d]=e(t[d],a[d],r!=null&&r[d],Array.isArray(o)?o.filter(Boolean).map(f=>`${(s==null?void 0:s.key)||"mantine"}-${f}-${d}`).join(" "):o?`${(s==null?void 0:s.key)||"mantine"}-${o}-${d}`:null),c),{})}var hY=Object.defineProperty,R4=Object.getOwnPropertySymbols,mY=Object.prototype.hasOwnProperty,gY=Object.prototype.propertyIsEnumerable,M4=(e,t,n)=>t in e?hY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Z0=(e,t)=>{for(var n in t||(t={}))mY.call(t,n)&&M4(e,n,t[n]);if(R4)for(var n of R4(t))gY.call(t,n)&&M4(e,n,t[n]);return e};function vy(e,t){return t&&Object.keys(t).forEach(n=>{e[n]?e[n]=Z0(Z0({},e[n]),t[n]):e[n]=Z0({},t[n])}),e}function D4(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,a)=>vy(s,a),{}):o(e)}function vY({ctx:e,theme:t,params:n,variant:r,size:o}){return e.reduce((s,a)=>(a.variants&&r in a.variants&&vy(s,a.variants[r](t,n,{variant:r,size:o})),a.sizes&&o in a.sizes&&vy(s,a.sizes[o](t,n,{variant:r,size:o})),s),{})}function uo(e){const t=typeof e=="function"?e:()=>e;function n(r,o){const s=si(),a=E9(o==null?void 0:o.name),c=G3(),d={variant:o==null?void 0:o.variant,size:o==null?void 0:o.size},{css:f,cx:h}=sI(),m=t(s,r,d),v=D4(o==null?void 0:o.styles,s,r,d),y=D4(a,s,r,d),S=vY({ctx:a,theme:s,params:r,variant:o==null?void 0:o.variant,size:o==null?void 0:o.size}),x=Object.fromEntries(Object.keys(m).map(w=>{const _=h({[f(m[w])]:!(o!=null&&o.unstyled)},f(S[w]),f(y[w]),f(v[w]));return[w,_]}));return{classes:pY({cx:h,classes:x,context:a,classNames:o==null?void 0:o.classNames,name:o==null?void 0:o.name,cache:c}),cx:h,theme:s}}return n}function A4(e){return`___ref-${e||""}`}var yY=Object.defineProperty,bY=Object.defineProperties,xY=Object.getOwnPropertyDescriptors,N4=Object.getOwnPropertySymbols,wY=Object.prototype.hasOwnProperty,SY=Object.prototype.propertyIsEnumerable,z4=(e,t,n)=>t in e?yY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ku=(e,t)=>{for(var n in t||(t={}))wY.call(t,n)&&z4(e,n,t[n]);if(N4)for(var n of N4(t))SY.call(t,n)&&z4(e,n,t[n]);return e},Xu=(e,t)=>bY(e,xY(t));const Zu={in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${Ge(10)})`},transitionProperty:"transform, opacity"},Ap={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},scale:{in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:"scale(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-y":{in:{opacity:1,transform:"scaleY(1)"},out:{opacity:0,transform:"scaleY(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-x":{in:{opacity:1,transform:"scaleX(1)"},out:{opacity:0,transform:"scaleX(0)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"skew-up":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:`translateY(-${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:Xu(Ku({},Zu),{common:{transformOrigin:"center center"}}),"pop-bottom-left":Xu(Ku({},Zu),{common:{transformOrigin:"bottom left"}}),"pop-bottom-right":Xu(Ku({},Zu),{common:{transformOrigin:"bottom right"}}),"pop-top-left":Xu(Ku({},Zu),{common:{transformOrigin:"top left"}}),"pop-top-right":Xu(Ku({},Zu),{common:{transformOrigin:"top right"}})},$4=["mousedown","touchstart"];function CY(e,t,n){const r=p.useRef();return p.useEffect(()=>{const o=s=>{const{target:a}=s??{};if(Array.isArray(n)){const c=(a==null?void 0:a.hasAttribute("data-ignore-outside-clicks"))||!document.body.contains(a)&&a.tagName!=="HTML";n.every(f=>!!f&&!s.composedPath().includes(f))&&!c&&e()}else r.current&&!r.current.contains(a)&&e()};return(t||$4).forEach(s=>document.addEventListener(s,o)),()=>{(t||$4).forEach(s=>document.removeEventListener(s,o))}},[r,e,n]),r}function _Y(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function kY(e,t){return typeof t=="boolean"?t:typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function PY(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,o]=p.useState(n?t:kY(e,t)),s=p.useRef();return p.useEffect(()=>{if("matchMedia"in window)return s.current=window.matchMedia(e),o(s.current.matches),_Y(s.current,a=>o(a.matches))},[e]),r}const aI=typeof document<"u"?p.useLayoutEffect:p.useEffect;function Gs(e,t){const n=p.useRef(!1);p.useEffect(()=>()=>{n.current=!1},[]),p.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function jY({opened:e,shouldReturnFocus:t=!0}){const n=p.useRef(),r=()=>{var o;n.current&&"focus"in n.current&&typeof n.current.focus=="function"&&((o=n.current)==null||o.focus({preventScroll:!0}))};return Gs(()=>{let o=-1;const s=a=>{a.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 EY=/input|select|textarea|button|object/,iI="a, input, select, textarea, button, object, [tabindex]";function IY(e){return e.style.display==="none"}function OY(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(IY(n))return!1;n=n.parentNode}return!0}function lI(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function yy(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(lI(e));return(EY.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&OY(e)}function cI(e){const t=lI(e);return(Number.isNaN(t)||t>=0)&&yy(e)}function TY(e){return Array.from(e.querySelectorAll(iI)).filter(cI)}function RY(e,t){const n=TY(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 a=n[t.shiftKey?n.length-1:0];a&&a.focus()}function Cx(){return`mantine-${Math.random().toString(36).slice(2,11)}`}function MY(e,t="body > :not(script)"){const n=Cx(),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 a=o.getAttribute("aria-hidden"),c=o.getAttribute("data-hidden"),d=o.getAttribute("data-focus-id");return o.setAttribute("data-focus-id",n),a===null||a==="false"?o.setAttribute("aria-hidden","true"):!c&&!d&&o.setAttribute("data-hidden",a),{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 DY(e=!0){const t=p.useRef(),n=p.useRef(null),r=s=>{let a=s.querySelector("[data-autofocus]");if(!a){const c=Array.from(s.querySelectorAll(iI));a=c.find(cI)||c.find(yy)||null,!a&&yy(s)&&(a=s)}a&&a.focus({preventScroll:!0})},o=p.useCallback(s=>{if(e){if(s===null){n.current&&(n.current(),n.current=null);return}n.current=MY(s),t.current!==s&&(s?(setTimeout(()=>{s.getRootNode()&&r(s)}),t.current=s):t.current=null)}},[e]);return p.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>r(t.current));const s=a=>{a.key==="Tab"&&t.current&&RY(t.current,a)};return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s),n.current&&n.current()}},[e]),o}const AY=F["useId".toString()]||(()=>{});function NY(){const e=AY();return e?`mantine-${e.replace(/:/g,"")}`:""}function _x(e){const t=NY(),[n,r]=p.useState(t);return aI(()=>{r(Cx())},[]),typeof e=="string"?e:typeof window>"u"?t:n}function L4(e,t,n){p.useEffect(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function zY(e,t){typeof e=="function"?e(t):typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function $Y(...e){return t=>{e.forEach(n=>zY(n,t))}}function Vg(...e){return p.useCallback($Y(...e),e)}function Kd({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){const[o,s]=p.useState(t!==void 0?t:n),a=c=>{s(c),r==null||r(c)};return e!==void 0?[e,r,!0]:[o,a,!1]}function uI(e,t){return PY("(prefers-reduced-motion: reduce)",e,t)}const LY=e=>e<.5?2*e*e:-1+(4-2*e)*e,BY=({axis:e,target:t,parent:n,alignment:r,offset:o,isList:s})=>{if(!t||!n&&typeof document>"u")return 0;const a=!!n,d=(n||document.body).getBoundingClientRect(),f=t.getBoundingClientRect(),h=m=>f[m]-d[m];if(e==="y"){const m=h("top");if(m===0)return 0;if(r==="start"){const y=m-o;return y<=f.height*(s?0:1)||!s?y:0}const v=a?d.height:window.innerHeight;if(r==="end"){const y=m+o-v+f.height;return y>=-f.height*(s?0:1)||!s?y:0}return r==="center"?m-v/2+f.height/2:0}if(e==="x"){const m=h("left");if(m===0)return 0;if(r==="start"){const y=m-o;return y<=f.width||!s?y:0}const v=a?d.width:window.innerWidth;if(r==="end"){const y=m+o-v+f.width;return y>=-f.width||!s?y:0}return r==="center"?m-v/2+f.width/2:0}return 0},FY=({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]},HY=({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 dI({duration:e=1250,axis:t="y",onScrollFinish:n,easing:r=LY,offset:o=0,cancelable:s=!0,isList:a=!1}={}){const c=p.useRef(0),d=p.useRef(0),f=p.useRef(!1),h=p.useRef(null),m=p.useRef(null),v=uI(),y=()=>{c.current&&cancelAnimationFrame(c.current)},S=p.useCallback(({alignment:w="start"}={})=>{var _;f.current=!1,c.current&&y();const k=(_=FY({parent:h.current,axis:t}))!=null?_:0,P=BY({parent:h.current,target:m.current,axis:t,alignment:w,offset:o,isList:a})-(h.current?0:k);function j(){d.current===0&&(d.current=performance.now());const O=performance.now()-d.current,T=v||e===0?1:O/e,R=k+P*r(T);HY({parent:h.current,axis:t,distance:R}),!f.current&&T<1?c.current=requestAnimationFrame(j):(typeof n=="function"&&n(),d.current=0,c.current=0,y())}j()},[t,e,r,a,o,n,v]),x=()=>{s&&(f.current=!0)};return L4("wheel",x,{passive:!0}),L4("touchmove",x,{passive:!0}),p.useEffect(()=>y,[]),{scrollableRef:h,targetRef:m,scrollIntoView:S,cancel:y}}var B4=Object.getOwnPropertySymbols,VY=Object.prototype.hasOwnProperty,WY=Object.prototype.propertyIsEnumerable,UY=(e,t)=>{var n={};for(var r in e)VY.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&B4)for(var r of B4(e))t.indexOf(r)<0&&WY.call(e,r)&&(n[r]=e[r]);return n};function Wg(e){const t=e,{m:n,mx:r,my:o,mt:s,mb:a,ml:c,mr:d,p:f,px:h,py:m,pt:v,pb:y,pl:S,pr:x,bg:w,c:_,opacity:k,ff:P,fz:j,fw:I,lts:O,ta:T,lh:R,fs:M,tt:D,td:A,w:G,miw:$,maw:H,h:U,mih:q,mah:z,bgsz:L,bgp:V,bgr:W,bga:te,pos:fe,top:ae,left:J,bottom:B,right:oe,inset:le,display:ge}=t,se=UY(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:I9({m:n,mx:r,my:o,mt:s,mb:a,ml:c,mr:d,p:f,px:h,py:m,pt:v,pb:y,pl:S,pr:x,bg:w,c:_,opacity:k,ff:P,fz:j,fw:I,lts:O,ta:T,lh:R,fs:M,tt:D,td:A,w:G,miw:$,maw:H,h:U,mih:q,mah:z,bgsz:L,bgp:V,bgr:W,bga:te,pos:fe,top:ae,left:J,bottom:B,right:oe,inset:le,display:ge}),rest:se}}function GY(e,t){const n=Object.keys(e).filter(r=>r!=="base").sort((r,o)=>SS(Ut({size:r,sizes:t.breakpoints}))-SS(Ut({size:o,sizes:t.breakpoints})));return"base"in e?["base",...n]:n}function qY({value:e,theme:t,getValue:n,property:r}){if(e==null)return;if(typeof e=="object")return GY(e,t).reduce((a,c)=>{if(c==="base"&&e.base!==void 0){const f=n(e.base,t);return Array.isArray(r)?(r.forEach(h=>{a[h]=f}),a):(a[r]=f,a)}const d=n(e[c],t);return Array.isArray(r)?(a[t.fn.largerThan(c)]={},r.forEach(f=>{a[t.fn.largerThan(c)][f]=d}),a):(a[t.fn.largerThan(c)]={[r]:d},a)},{});const o=n(e,t);return Array.isArray(r)?r.reduce((s,a)=>(s[a]=o,s),{}):{[r]:o}}function YY(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 KY(e){return Ge(e)}function XY(e){return e}function ZY(e,t){return Ut({size:e,sizes:t.fontSizes})}const QY=["-xs","-sm","-md","-lg","-xl"];function JY(e,t){return QY.includes(e)?`calc(${Ut({size:e.replace("-",""),sizes:t.spacing})} * -1)`:Ut({size:e,sizes:t.spacing})}const eK={identity:XY,color:YY,size:KY,fontSize:ZY,spacing:JY},tK={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 nK=Object.defineProperty,F4=Object.getOwnPropertySymbols,rK=Object.prototype.hasOwnProperty,oK=Object.prototype.propertyIsEnumerable,H4=(e,t,n)=>t in e?nK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,V4=(e,t)=>{for(var n in t||(t={}))rK.call(t,n)&&H4(e,n,t[n]);if(F4)for(var n of F4(t))oK.call(t,n)&&H4(e,n,t[n]);return e};function W4(e,t,n=tK){return Object.keys(n).reduce((o,s)=>(s in e&&e[s]!==void 0&&o.push(qY({value:e[s],getValue:eK[n[s].type],property:n[s].property,theme:t})),o),[]).reduce((o,s)=>(Object.keys(s).forEach(a=>{typeof s[a]=="object"&&s[a]!==null&&a in o?o[a]=V4(V4({},o[a]),s[a]):o[a]=s[a]}),o),{})}function U4(e,t){return typeof e=="function"?e(t):e}function sK(e,t,n){const r=si(),{css:o,cx:s}=sI();return Array.isArray(e)?s(n,o(W4(t,r)),e.map(a=>o(U4(a,r)))):s(n,o(U4(e,r)),o(W4(t,r)))}var aK=Object.defineProperty,im=Object.getOwnPropertySymbols,fI=Object.prototype.hasOwnProperty,pI=Object.prototype.propertyIsEnumerable,G4=(e,t,n)=>t in e?aK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,iK=(e,t)=>{for(var n in t||(t={}))fI.call(t,n)&&G4(e,n,t[n]);if(im)for(var n of im(t))pI.call(t,n)&&G4(e,n,t[n]);return e},lK=(e,t)=>{var n={};for(var r in e)fI.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&&pI.call(e,r)&&(n[r]=e[r]);return n};const hI=p.forwardRef((e,t)=>{var n=e,{className:r,component:o,style:s,sx:a}=n,c=lK(n,["className","component","style","sx"]);const{systemStyles:d,rest:f}=Wg(c),h=o||"div";return F.createElement(h,iK({ref:t,className:sK(a,d,r),style:s},f))});hI.displayName="@mantine/core/Box";const Do=hI;var cK=Object.defineProperty,uK=Object.defineProperties,dK=Object.getOwnPropertyDescriptors,q4=Object.getOwnPropertySymbols,fK=Object.prototype.hasOwnProperty,pK=Object.prototype.propertyIsEnumerable,Y4=(e,t,n)=>t in e?cK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,K4=(e,t)=>{for(var n in t||(t={}))fK.call(t,n)&&Y4(e,n,t[n]);if(q4)for(var n of q4(t))pK.call(t,n)&&Y4(e,n,t[n]);return e},hK=(e,t)=>uK(e,dK(t)),mK=uo(e=>({root:hK(K4(K4({},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 gK=mK;var vK=Object.defineProperty,lm=Object.getOwnPropertySymbols,mI=Object.prototype.hasOwnProperty,gI=Object.prototype.propertyIsEnumerable,X4=(e,t,n)=>t in e?vK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yK=(e,t)=>{for(var n in t||(t={}))mI.call(t,n)&&X4(e,n,t[n]);if(lm)for(var n of lm(t))gI.call(t,n)&&X4(e,n,t[n]);return e},bK=(e,t)=>{var n={};for(var r in e)mI.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&&gI.call(e,r)&&(n[r]=e[r]);return n};const vI=p.forwardRef((e,t)=>{const n=zr("UnstyledButton",{},e),{className:r,component:o="button",unstyled:s,variant:a}=n,c=bK(n,["className","component","unstyled","variant"]),{classes:d,cx:f}=gK(null,{name:"UnstyledButton",unstyled:s,variant:a});return F.createElement(Do,yK({component:o,ref:t,className:f(d.root,r),type:o==="button"?"button":void 0},c))});vI.displayName="@mantine/core/UnstyledButton";const xK=vI;var wK=Object.defineProperty,SK=Object.defineProperties,CK=Object.getOwnPropertyDescriptors,Z4=Object.getOwnPropertySymbols,_K=Object.prototype.hasOwnProperty,kK=Object.prototype.propertyIsEnumerable,Q4=(e,t,n)=>t in e?wK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,by=(e,t)=>{for(var n in t||(t={}))_K.call(t,n)&&Q4(e,n,t[n]);if(Z4)for(var n of Z4(t))kK.call(t,n)&&Q4(e,n,t[n]);return e},J4=(e,t)=>SK(e,CK(t));const PK=["subtle","filled","outline","light","default","transparent","gradient"],Np={xs:Ge(18),sm:Ge(22),md:Ge(28),lg:Ge(34),xl:Ge(44)};function jK({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%"})}:PK.includes(e)?by({border:`${Ge(1)} solid ${o.border}`,backgroundColor:o.background,color:o.color},t.fn.hover({backgroundColor:o.hover})):null}var EK=uo((e,{radius:t,color:n,gradient:r},{variant:o,size:s})=>({root:J4(by({position:"relative",borderRadius:e.fn.radius(t),padding:0,lineHeight:1,display:"flex",alignItems:"center",justifyContent:"center",height:Ut({size:s,sizes:Np}),minHeight:Ut({size:s,sizes:Np}),width:Ut({size:s,sizes:Np}),minWidth:Ut({size:s,sizes:Np})},jK({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":J4(by({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 IK=EK;var OK=Object.defineProperty,cm=Object.getOwnPropertySymbols,yI=Object.prototype.hasOwnProperty,bI=Object.prototype.propertyIsEnumerable,e_=(e,t,n)=>t in e?OK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,TK=(e,t)=>{for(var n in t||(t={}))yI.call(t,n)&&e_(e,n,t[n]);if(cm)for(var n of cm(t))bI.call(t,n)&&e_(e,n,t[n]);return e},RK=(e,t)=>{var n={};for(var r in e)yI.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&&bI.call(e,r)&&(n[r]=e[r]);return n};function MK(e){var t=e,{size:n,color:r}=t,o=RK(t,["size","color"]);return F.createElement("svg",TK({viewBox:"0 0 135 140",xmlns:"http://www.w3.org/2000/svg",fill:r,width:n},o),F.createElement("rect",{y:"10",width:"15",height:"120",rx:"6"},F.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"}),F.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"})),F.createElement("rect",{x:"30",y:"10",width:"15",height:"120",rx:"6"},F.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"}),F.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"})),F.createElement("rect",{x:"60",width:"15",height:"140",rx:"6"},F.createElement("animate",{attributeName:"height",begin:"0s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),F.createElement("animate",{attributeName:"y",begin:"0s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),F.createElement("rect",{x:"90",y:"10",width:"15",height:"120",rx:"6"},F.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"}),F.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"})),F.createElement("rect",{x:"120",y:"10",width:"15",height:"120",rx:"6"},F.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"}),F.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 DK=Object.defineProperty,um=Object.getOwnPropertySymbols,xI=Object.prototype.hasOwnProperty,wI=Object.prototype.propertyIsEnumerable,t_=(e,t,n)=>t in e?DK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,AK=(e,t)=>{for(var n in t||(t={}))xI.call(t,n)&&t_(e,n,t[n]);if(um)for(var n of um(t))wI.call(t,n)&&t_(e,n,t[n]);return e},NK=(e,t)=>{var n={};for(var r in e)xI.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&&wI.call(e,r)&&(n[r]=e[r]);return n};function zK(e){var t=e,{size:n,color:r}=t,o=NK(t,["size","color"]);return F.createElement("svg",AK({width:n,height:n,viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:r},o),F.createElement("g",{fill:"none",fillRule:"evenodd"},F.createElement("g",{transform:"translate(2.5 2.5)",strokeWidth:"5"},F.createElement("circle",{strokeOpacity:".5",cx:"16",cy:"16",r:"16"}),F.createElement("path",{d:"M32 16c0-9.94-8.06-16-16-16"},F.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 16 16",to:"360 16 16",dur:"1s",repeatCount:"indefinite"})))))}var $K=Object.defineProperty,dm=Object.getOwnPropertySymbols,SI=Object.prototype.hasOwnProperty,CI=Object.prototype.propertyIsEnumerable,n_=(e,t,n)=>t in e?$K(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,LK=(e,t)=>{for(var n in t||(t={}))SI.call(t,n)&&n_(e,n,t[n]);if(dm)for(var n of dm(t))CI.call(t,n)&&n_(e,n,t[n]);return e},BK=(e,t)=>{var n={};for(var r in e)SI.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&&CI.call(e,r)&&(n[r]=e[r]);return n};function FK(e){var t=e,{size:n,color:r}=t,o=BK(t,["size","color"]);return F.createElement("svg",LK({width:n,viewBox:"0 0 120 30",xmlns:"http://www.w3.org/2000/svg",fill:r},o),F.createElement("circle",{cx:"15",cy:"15",r:"15"},F.createElement("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),F.createElement("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})),F.createElement("circle",{cx:"60",cy:"15",r:"9",fillOpacity:"0.3"},F.createElement("animate",{attributeName:"r",from:"9",to:"9",begin:"0s",dur:"0.8s",values:"9;15;9",calcMode:"linear",repeatCount:"indefinite"}),F.createElement("animate",{attributeName:"fill-opacity",from:"0.5",to:"0.5",begin:"0s",dur:"0.8s",values:".5;1;.5",calcMode:"linear",repeatCount:"indefinite"})),F.createElement("circle",{cx:"105",cy:"15",r:"15"},F.createElement("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),F.createElement("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})))}var HK=Object.defineProperty,fm=Object.getOwnPropertySymbols,_I=Object.prototype.hasOwnProperty,kI=Object.prototype.propertyIsEnumerable,r_=(e,t,n)=>t in e?HK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,VK=(e,t)=>{for(var n in t||(t={}))_I.call(t,n)&&r_(e,n,t[n]);if(fm)for(var n of fm(t))kI.call(t,n)&&r_(e,n,t[n]);return e},WK=(e,t)=>{var n={};for(var r in e)_I.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&&kI.call(e,r)&&(n[r]=e[r]);return n};const Q0={bars:MK,oval:zK,dots:FK},UK={xs:Ge(18),sm:Ge(22),md:Ge(36),lg:Ge(44),xl:Ge(58)},GK={size:"md"};function PI(e){const t=zr("Loader",GK,e),{size:n,color:r,variant:o}=t,s=WK(t,["size","color","variant"]),a=si(),c=o in Q0?o:a.loader;return F.createElement(Do,VK({role:"presentation",component:Q0[c]||Q0.bars,size:Ut({size:n,sizes:UK}),color:a.fn.variant({variant:"filled",primaryFallback:!1,color:r||a.primaryColor}).background},s))}PI.displayName="@mantine/core/Loader";var qK=Object.defineProperty,pm=Object.getOwnPropertySymbols,jI=Object.prototype.hasOwnProperty,EI=Object.prototype.propertyIsEnumerable,o_=(e,t,n)=>t in e?qK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,s_=(e,t)=>{for(var n in t||(t={}))jI.call(t,n)&&o_(e,n,t[n]);if(pm)for(var n of pm(t))EI.call(t,n)&&o_(e,n,t[n]);return e},YK=(e,t)=>{var n={};for(var r in e)jI.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&&EI.call(e,r)&&(n[r]=e[r]);return n};const KK={color:"gray",size:"md",variant:"subtle"},II=p.forwardRef((e,t)=>{const n=zr("ActionIcon",KK,e),{className:r,color:o,children:s,radius:a,size:c,variant:d,gradient:f,disabled:h,loaderProps:m,loading:v,unstyled:y,__staticSelector:S}=n,x=YK(n,["className","color","children","radius","size","variant","gradient","disabled","loaderProps","loading","unstyled","__staticSelector"]),{classes:w,cx:_,theme:k}=IK({radius:a,color:o,gradient:f},{name:["ActionIcon",S],unstyled:y,size:c,variant:d}),P=F.createElement(PI,s_({color:k.fn.variant({color:o,variant:d}).color,size:"100%","data-action-icon-loader":!0},m));return F.createElement(xK,s_({className:_(w.root,r),ref:t,disabled:h,"data-disabled":h||void 0,"data-loading":v||void 0,unstyled:y},x),v?P:s)});II.displayName="@mantine/core/ActionIcon";const XK=II;var ZK=Object.defineProperty,QK=Object.defineProperties,JK=Object.getOwnPropertyDescriptors,hm=Object.getOwnPropertySymbols,OI=Object.prototype.hasOwnProperty,TI=Object.prototype.propertyIsEnumerable,a_=(e,t,n)=>t in e?ZK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,eX=(e,t)=>{for(var n in t||(t={}))OI.call(t,n)&&a_(e,n,t[n]);if(hm)for(var n of hm(t))TI.call(t,n)&&a_(e,n,t[n]);return e},tX=(e,t)=>QK(e,JK(t)),nX=(e,t)=>{var n={};for(var r in e)OI.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&&TI.call(e,r)&&(n[r]=e[r]);return n};function RI(e){const t=zr("Portal",{},e),{children:n,target:r,className:o,innerRef:s}=t,a=nX(t,["children","target","className","innerRef"]),c=si(),[d,f]=p.useState(!1),h=p.useRef();return aI(()=>(f(!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]),d?ng.createPortal(F.createElement("div",tX(eX({className:o,dir:c.dir},a),{ref:s}),n),h.current):null}RI.displayName="@mantine/core/Portal";var rX=Object.defineProperty,mm=Object.getOwnPropertySymbols,MI=Object.prototype.hasOwnProperty,DI=Object.prototype.propertyIsEnumerable,i_=(e,t,n)=>t in e?rX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,oX=(e,t)=>{for(var n in t||(t={}))MI.call(t,n)&&i_(e,n,t[n]);if(mm)for(var n of mm(t))DI.call(t,n)&&i_(e,n,t[n]);return e},sX=(e,t)=>{var n={};for(var r in e)MI.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&&DI.call(e,r)&&(n[r]=e[r]);return n};function AI(e){var t=e,{withinPortal:n=!0,children:r}=t,o=sX(t,["withinPortal","children"]);return n?F.createElement(RI,oX({},o),r):F.createElement(F.Fragment,null,r)}AI.displayName="@mantine/core/OptionalPortal";var aX=Object.defineProperty,l_=Object.getOwnPropertySymbols,iX=Object.prototype.hasOwnProperty,lX=Object.prototype.propertyIsEnumerable,c_=(e,t,n)=>t in e?aX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,cX=(e,t)=>{for(var n in t||(t={}))iX.call(t,n)&&c_(e,n,t[n]);if(l_)for(var n of l_(t))lX.call(t,n)&&c_(e,n,t[n]);return e};function NI(e){return F.createElement("svg",cX({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),F.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"}))}NI.displayName="@mantine/core/CloseIcon";var uX=Object.defineProperty,gm=Object.getOwnPropertySymbols,zI=Object.prototype.hasOwnProperty,$I=Object.prototype.propertyIsEnumerable,u_=(e,t,n)=>t in e?uX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dX=(e,t)=>{for(var n in t||(t={}))zI.call(t,n)&&u_(e,n,t[n]);if(gm)for(var n of gm(t))$I.call(t,n)&&u_(e,n,t[n]);return e},fX=(e,t)=>{var n={};for(var r in e)zI.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&&$I.call(e,r)&&(n[r]=e[r]);return n};const pX={xs:Ge(12),sm:Ge(16),md:Ge(20),lg:Ge(28),xl:Ge(34)},hX={size:"sm"},LI=p.forwardRef((e,t)=>{const n=zr("CloseButton",hX,e),{iconSize:r,size:o,children:s}=n,a=fX(n,["iconSize","size","children"]),c=Ge(r||pX[o]);return F.createElement(XK,dX({ref:t,__staticSelector:"CloseButton",size:o},a),s||F.createElement(NI,{width:c,height:c}))});LI.displayName="@mantine/core/CloseButton";const BI=LI;var mX=Object.defineProperty,gX=Object.defineProperties,vX=Object.getOwnPropertyDescriptors,d_=Object.getOwnPropertySymbols,yX=Object.prototype.hasOwnProperty,bX=Object.prototype.propertyIsEnumerable,f_=(e,t,n)=>t in e?mX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zp=(e,t)=>{for(var n in t||(t={}))yX.call(t,n)&&f_(e,n,t[n]);if(d_)for(var n of d_(t))bX.call(t,n)&&f_(e,n,t[n]);return e},xX=(e,t)=>gX(e,vX(t));function wX({underline:e,strikethrough:t}){const n=[];return e&&n.push("underline"),t&&n.push("line-through"),n.length>0?n.join(" "):"none"}function SX({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 CX(e){return typeof e=="number"?{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical"}:null}function _X({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 kX=uo((e,{color:t,lineClamp:n,truncate:r,inline:o,inherit:s,underline:a,gradient:c,weight:d,transform:f,align:h,strikethrough:m,italic:v},{size:y})=>{const S=e.fn.variant({variant:"gradient",gradient:c});return{root:xX(zp(zp(zp(zp({},e.fn.fontStyles()),e.fn.focusStyles()),CX(n)),_X({theme:e,truncate:r})),{color:SX({color:t,theme:e}),fontFamily:s?"inherit":e.fontFamily,fontSize:s||y===void 0?"inherit":Ut({size:y,sizes:e.fontSizes}),lineHeight:s?"inherit":o?1:e.lineHeight,textDecoration:wX({underline:a,strikethrough:m}),WebkitTapHighlightColor:"transparent",fontWeight:s?"inherit":d,textTransform:f,textAlign:h,fontStyle:v?"italic":void 0}),gradient:{backgroundImage:S.background,WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"}}});const PX=kX;var jX=Object.defineProperty,vm=Object.getOwnPropertySymbols,FI=Object.prototype.hasOwnProperty,HI=Object.prototype.propertyIsEnumerable,p_=(e,t,n)=>t in e?jX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,EX=(e,t)=>{for(var n in t||(t={}))FI.call(t,n)&&p_(e,n,t[n]);if(vm)for(var n of vm(t))HI.call(t,n)&&p_(e,n,t[n]);return e},IX=(e,t)=>{var n={};for(var r in e)FI.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&&HI.call(e,r)&&(n[r]=e[r]);return n};const OX={variant:"text"},VI=p.forwardRef((e,t)=>{const n=zr("Text",OX,e),{className:r,size:o,weight:s,transform:a,color:c,align:d,variant:f,lineClamp:h,truncate:m,gradient:v,inline:y,inherit:S,underline:x,strikethrough:w,italic:_,classNames:k,styles:P,unstyled:j,span:I,__staticSelector:O}=n,T=IX(n,["className","size","weight","transform","color","align","variant","lineClamp","truncate","gradient","inline","inherit","underline","strikethrough","italic","classNames","styles","unstyled","span","__staticSelector"]),{classes:R,cx:M}=PX({color:c,lineClamp:h,truncate:m,inline:y,inherit:S,underline:x,strikethrough:w,italic:_,weight:s,transform:a,align:d,gradient:v},{unstyled:j,name:O||"Text",variant:f,size:o});return F.createElement(Do,EX({ref:t,className:M(R.root,{[R.gradient]:f==="gradient"},r),component:I?"span":"div"},T))});VI.displayName="@mantine/core/Text";const Ug=VI,$p={xs:Ge(1),sm:Ge(2),md:Ge(3),lg:Ge(4),xl:Ge(5)};function Lp(e,t){const n=e.fn.variant({variant:"outline",color:t}).border;return typeof t=="string"&&(t in e.colors||t.split(".")[0]in e.colors)?n:t===void 0?e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]:t}var TX=uo((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:`${Ut({size:n,sizes:$p})} ${r} ${Lp(e,t)}`,marginRight:e.spacing.xs},"&::after":{content:'""',flex:1,borderTop:`${Ut({size:n,sizes:$p})} ${r} ${Lp(e,t)}`,marginLeft:e.spacing.xs}},labelDefaultStyles:{color:t==="dark"?e.colors.dark[1]:e.fn.themeColor(t,e.colorScheme==="dark"?5:e.fn.primaryShade(),!1)},horizontal:{border:0,borderTopWidth:Ge(Ut({size:n,sizes:$p})),borderTopColor:Lp(e,t),borderTopStyle:r,margin:0},vertical:{border:0,alignSelf:"stretch",height:"auto",borderLeftWidth:Ge(Ut({size:n,sizes:$p})),borderLeftColor:Lp(e,t),borderLeftStyle:r}}));const RX=TX;var MX=Object.defineProperty,DX=Object.defineProperties,AX=Object.getOwnPropertyDescriptors,ym=Object.getOwnPropertySymbols,WI=Object.prototype.hasOwnProperty,UI=Object.prototype.propertyIsEnumerable,h_=(e,t,n)=>t in e?MX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,m_=(e,t)=>{for(var n in t||(t={}))WI.call(t,n)&&h_(e,n,t[n]);if(ym)for(var n of ym(t))UI.call(t,n)&&h_(e,n,t[n]);return e},NX=(e,t)=>DX(e,AX(t)),zX=(e,t)=>{var n={};for(var r in e)WI.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&&UI.call(e,r)&&(n[r]=e[r]);return n};const $X={orientation:"horizontal",size:"xs",labelPosition:"left",variant:"solid"},xy=p.forwardRef((e,t)=>{const n=zr("Divider",$X,e),{className:r,color:o,orientation:s,size:a,label:c,labelPosition:d,labelProps:f,variant:h,styles:m,classNames:v,unstyled:y}=n,S=zX(n,["className","color","orientation","size","label","labelPosition","labelProps","variant","styles","classNames","unstyled"]),{classes:x,cx:w}=RX({color:o},{classNames:v,styles:m,unstyled:y,name:"Divider",variant:h,size:a}),_=s==="vertical",k=s==="horizontal",P=!!c&&k,j=!(f!=null&&f.color);return F.createElement(Do,m_({ref:t,className:w(x.root,{[x.vertical]:_,[x.horizontal]:k,[x.withLabel]:P},r),role:"separator"},S),P&&F.createElement(Ug,NX(m_({},f),{size:(f==null?void 0:f.size)||"xs",mt:Ge(2),className:w(x.label,x[d],{[x.labelDefaultStyles]:j})}),c))});xy.displayName="@mantine/core/Divider";var LX=Object.defineProperty,BX=Object.defineProperties,FX=Object.getOwnPropertyDescriptors,g_=Object.getOwnPropertySymbols,HX=Object.prototype.hasOwnProperty,VX=Object.prototype.propertyIsEnumerable,v_=(e,t,n)=>t in e?LX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,y_=(e,t)=>{for(var n in t||(t={}))HX.call(t,n)&&v_(e,n,t[n]);if(g_)for(var n of g_(t))VX.call(t,n)&&v_(e,n,t[n]);return e},WX=(e,t)=>BX(e,FX(t)),UX=uo((e,t,{size:n})=>({item:WX(y_({},e.fn.fontStyles()),{boxSizing:"border-box",wordBreak:"break-all",textAlign:"left",width:"100%",padding:`calc(${Ut({size:n,sizes:e.spacing})} / 1.5) ${Ut({size:n,sizes:e.spacing})}`,cursor:"pointer",fontSize:Ut({size:n,sizes:e.fontSizes}),color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,borderRadius:e.fn.radius(),"&[data-hovered]":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[1]},"&[data-selected]":y_({backgroundColor:e.fn.variant({variant:"filled"}).background,color:e.fn.variant({variant:"filled"}).color},e.fn.hover({backgroundColor:e.fn.variant({variant:"filled"}).hover})),"&[data-disabled]":{cursor:"default",color:e.colors.dark[2]}}),nothingFound:{boxSizing:"border-box",color:e.colors.gray[6],paddingTop:`calc(${Ut({size:n,sizes:e.spacing})} / 2)`,paddingBottom:`calc(${Ut({size:n,sizes:e.spacing})} / 2)`,textAlign:"center"},separator:{boxSizing:"border-box",textAlign:"left",width:"100%",padding:`calc(${Ut({size:n,sizes:e.spacing})} / 1.5) ${Ut({size:n,sizes:e.spacing})}`},separatorLabel:{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]}}));const GX=UX;var qX=Object.defineProperty,b_=Object.getOwnPropertySymbols,YX=Object.prototype.hasOwnProperty,KX=Object.prototype.propertyIsEnumerable,x_=(e,t,n)=>t in e?qX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,XX=(e,t)=>{for(var n in t||(t={}))YX.call(t,n)&&x_(e,n,t[n]);if(b_)for(var n of b_(t))KX.call(t,n)&&x_(e,n,t[n]);return e};function kx({data:e,hovered:t,classNames:n,styles:r,isItemSelected:o,uuid:s,__staticSelector:a,onItemHover:c,onItemSelect:d,itemsRefs:f,itemComponent:h,size:m,nothingFound:v,creatable:y,createLabel:S,unstyled:x,variant:w}){const{classes:_}=GX(null,{classNames:n,styles:r,unstyled:x,name:a,variant:w,size:m}),k=[],P=[];let j=null;const I=(T,R)=>{const M=typeof o=="function"?o(T.value):!1;return F.createElement(h,XX({key:T.value,className:_.item,"data-disabled":T.disabled||void 0,"data-hovered":!T.disabled&&t===R||void 0,"data-selected":!T.disabled&&M||void 0,selected:M,onMouseEnter:()=>c(R),id:`${s}-${R}`,role:"option",tabIndex:-1,"aria-selected":t===R,ref:D=>{f&&f.current&&(f.current[T.value]=D)},onMouseDown:T.disabled?null:D=>{D.preventDefault(),d(T)},disabled:T.disabled,variant:w},T))};let O=null;if(e.forEach((T,R)=>{T.creatable?j=R:T.group?(O!==T.group&&(O=T.group,P.push(F.createElement("div",{className:_.separator,key:`__mantine-divider-${R}`},F.createElement(xy,{classNames:{label:_.separatorLabel},label:T.group})))),P.push(I(T,R))):k.push(I(T,R))}),y){const T=e[j];k.push(F.createElement("div",{key:Cx(),className:_.item,"data-hovered":t===j||void 0,onMouseEnter:()=>c(j),onMouseDown:R=>{R.preventDefault(),d(T)},tabIndex:-1,ref:R=>{f&&f.current&&(f.current[T.value]=R)}},S))}return P.length>0&&k.length>0&&k.unshift(F.createElement("div",{className:_.separator,key:"empty-group-separator"},F.createElement(xy,null))),P.length>0||k.length>0?F.createElement(F.Fragment,null,P,k):F.createElement(Ug,{size:m,unstyled:x,className:_.nothingFound},v)}kx.displayName="@mantine/core/SelectItems";var ZX=Object.defineProperty,bm=Object.getOwnPropertySymbols,GI=Object.prototype.hasOwnProperty,qI=Object.prototype.propertyIsEnumerable,w_=(e,t,n)=>t in e?ZX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,QX=(e,t)=>{for(var n in t||(t={}))GI.call(t,n)&&w_(e,n,t[n]);if(bm)for(var n of bm(t))qI.call(t,n)&&w_(e,n,t[n]);return e},JX=(e,t)=>{var n={};for(var r in e)GI.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&&qI.call(e,r)&&(n[r]=e[r]);return n};const Px=p.forwardRef((e,t)=>{var n=e,{label:r,value:o}=n,s=JX(n,["label","value"]);return F.createElement("div",QX({ref:t},s),r||o)});Px.displayName="@mantine/core/DefaultItem";function eZ(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function YI(...e){return t=>e.forEach(n=>eZ(n,t))}function Xl(...e){return p.useCallback(YI(...e),e)}const KI=p.forwardRef((e,t)=>{const{children:n,...r}=e,o=p.Children.toArray(n),s=o.find(nZ);if(s){const a=s.props.children,c=o.map(d=>d===s?p.Children.count(a)>1?p.Children.only(null):p.isValidElement(a)?a.props.children:null:d);return p.createElement(wy,gr({},r,{ref:t}),p.isValidElement(a)?p.cloneElement(a,void 0,c):null)}return p.createElement(wy,gr({},r,{ref:t}),n)});KI.displayName="Slot";const wy=p.forwardRef((e,t)=>{const{children:n,...r}=e;return p.isValidElement(n)?p.cloneElement(n,{...rZ(r,n.props),ref:YI(t,n.ref)}):p.Children.count(n)>1?p.Children.only(null):null});wy.displayName="SlotClone";const tZ=({children:e})=>p.createElement(p.Fragment,null,e);function nZ(e){return p.isValidElement(e)&&e.type===tZ}function rZ(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 oZ=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],Sf=oZ.reduce((e,t)=>{const n=p.forwardRef((r,o)=>{const{asChild:s,...a}=r,c=s?KI:t;return p.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),p.createElement(c,gr({},a,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Sy=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{};function sZ(e,t){return p.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const Cf=e=>{const{present:t,children:n}=e,r=aZ(t),o=typeof n=="function"?n({present:r.isPresent}):p.Children.only(n),s=Xl(r.ref,o.ref);return typeof n=="function"||r.isPresent?p.cloneElement(o,{ref:s}):null};Cf.displayName="Presence";function aZ(e){const[t,n]=p.useState(),r=p.useRef({}),o=p.useRef(e),s=p.useRef("none"),a=e?"mounted":"unmounted",[c,d]=sZ(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const f=Bp(r.current);s.current=c==="mounted"?f:"none"},[c]),Sy(()=>{const f=r.current,h=o.current;if(h!==e){const v=s.current,y=Bp(f);e?d("MOUNT"):y==="none"||(f==null?void 0:f.display)==="none"?d("UNMOUNT"):d(h&&v!==y?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,d]),Sy(()=>{if(t){const f=m=>{const y=Bp(r.current).includes(m.animationName);m.target===t&&y&&ng.flushSync(()=>d("ANIMATION_END"))},h=m=>{m.target===t&&(s.current=Bp(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:p.useCallback(f=>{f&&(r.current=getComputedStyle(f)),n(f)},[])}}function Bp(e){return(e==null?void 0:e.animationName)||"none"}function iZ(e,t=[]){let n=[];function r(s,a){const c=p.createContext(a),d=n.length;n=[...n,a];function f(m){const{scope:v,children:y,...S}=m,x=(v==null?void 0:v[e][d])||c,w=p.useMemo(()=>S,Object.values(S));return p.createElement(x.Provider,{value:w},y)}function h(m,v){const y=(v==null?void 0:v[e][d])||c,S=p.useContext(y);if(S)return S;if(a!==void 0)return a;throw new Error(`\`${m}\` must be used within \`${s}\``)}return f.displayName=s+"Provider",[f,h]}const o=()=>{const s=n.map(a=>p.createContext(a));return function(c){const d=(c==null?void 0:c[e])||s;return p.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])}};return o.scopeName=e,[r,lZ(o,...t)]}function lZ(...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 a=r.reduce((c,{useScope:d,scopeName:f})=>{const m=d(s)[`__scope${f}`];return{...c,...m}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function hl(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}const cZ=p.createContext(void 0);function uZ(e){const t=p.useContext(cZ);return e||t||"ltr"}function dZ(e,[t,n]){return Math.min(n,Math.max(t,e))}function jl(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 fZ(e,t){return p.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const XI="ScrollArea",[ZI,ype]=iZ(XI),[pZ,js]=ZI(XI),hZ=p.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:s=600,...a}=e,[c,d]=p.useState(null),[f,h]=p.useState(null),[m,v]=p.useState(null),[y,S]=p.useState(null),[x,w]=p.useState(null),[_,k]=p.useState(0),[P,j]=p.useState(0),[I,O]=p.useState(!1),[T,R]=p.useState(!1),M=Xl(t,A=>d(A)),D=uZ(o);return p.createElement(pZ,{scope:n,type:r,dir:D,scrollHideDelay:s,scrollArea:c,viewport:f,onViewportChange:h,content:m,onContentChange:v,scrollbarX:y,onScrollbarXChange:S,scrollbarXEnabled:I,onScrollbarXEnabledChange:O,scrollbarY:x,onScrollbarYChange:w,scrollbarYEnabled:T,onScrollbarYEnabledChange:R,onCornerWidthChange:k,onCornerHeightChange:j},p.createElement(Sf.div,gr({dir:D},a,{ref:M,style:{position:"relative",["--radix-scroll-area-corner-width"]:_+"px",["--radix-scroll-area-corner-height"]:P+"px",...e.style}})))}),mZ="ScrollAreaViewport",gZ=p.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,...o}=e,s=js(mZ,n),a=p.useRef(null),c=Xl(t,a,s.onViewportChange);return p.createElement(p.Fragment,null,p.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}"}}),p.createElement(Sf.div,gr({"data-radix-scroll-area-viewport":""},o,{ref:c,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style}}),p.createElement("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"}},r)))}),li="ScrollAreaScrollbar",vZ=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=js(li,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:a}=o,c=e.orientation==="horizontal";return p.useEffect(()=>(c?s(!0):a(!0),()=>{c?s(!1):a(!1)}),[c,s,a]),o.type==="hover"?p.createElement(yZ,gr({},r,{ref:t,forceMount:n})):o.type==="scroll"?p.createElement(bZ,gr({},r,{ref:t,forceMount:n})):o.type==="auto"?p.createElement(QI,gr({},r,{ref:t,forceMount:n})):o.type==="always"?p.createElement(jx,gr({},r,{ref:t})):null}),yZ=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=js(li,e.__scopeScrollArea),[s,a]=p.useState(!1);return p.useEffect(()=>{const c=o.scrollArea;let d=0;if(c){const f=()=>{window.clearTimeout(d),a(!0)},h=()=>{d=window.setTimeout(()=>a(!1),o.scrollHideDelay)};return c.addEventListener("pointerenter",f),c.addEventListener("pointerleave",h),()=>{window.clearTimeout(d),c.removeEventListener("pointerenter",f),c.removeEventListener("pointerleave",h)}}},[o.scrollArea,o.scrollHideDelay]),p.createElement(Cf,{present:n||s},p.createElement(QI,gr({"data-state":s?"visible":"hidden"},r,{ref:t})))}),bZ=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=js(li,e.__scopeScrollArea),s=e.orientation==="horizontal",a=qg(()=>d("SCROLL_END"),100),[c,d]=fZ("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 p.useEffect(()=>{if(c==="idle"){const f=window.setTimeout(()=>d("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(f)}},[c,o.scrollHideDelay,d]),p.useEffect(()=>{const f=o.viewport,h=s?"scrollLeft":"scrollTop";if(f){let m=f[h];const v=()=>{const y=f[h];m!==y&&(d("SCROLL"),a()),m=y};return f.addEventListener("scroll",v),()=>f.removeEventListener("scroll",v)}},[o.viewport,s,d,a]),p.createElement(Cf,{present:n||c!=="hidden"},p.createElement(jx,gr({"data-state":c==="hidden"?"hidden":"visible"},r,{ref:t,onPointerEnter:jl(e.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:jl(e.onPointerLeave,()=>d("POINTER_LEAVE"))})))}),QI=p.forwardRef((e,t)=>{const n=js(li,e.__scopeScrollArea),{forceMount:r,...o}=e,[s,a]=p.useState(!1),c=e.orientation==="horizontal",d=qg(()=>{if(n.viewport){const f=n.viewport.offsetWidth<n.viewport.scrollWidth,h=n.viewport.offsetHeight<n.viewport.scrollHeight;a(c?f:h)}},10);return ru(n.viewport,d),ru(n.content,d),p.createElement(Cf,{present:r||s},p.createElement(jx,gr({"data-state":s?"visible":"hidden"},o,{ref:t})))}),jx=p.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=js(li,e.__scopeScrollArea),s=p.useRef(null),a=p.useRef(0),[c,d]=p.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=nO(c.viewport,c.content),h={...r,sizes:c,onSizesChange:d,hasThumb:f>0&&f<1,onThumbChange:v=>s.current=v,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:v=>a.current=v};function m(v,y){return jZ(v,a.current,c,y)}return n==="horizontal"?p.createElement(xZ,gr({},h,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const v=o.viewport.scrollLeft,y=S_(v,c,o.dir);s.current.style.transform=`translate3d(${y}px, 0, 0)`}},onWheelScroll:v=>{o.viewport&&(o.viewport.scrollLeft=v)},onDragScroll:v=>{o.viewport&&(o.viewport.scrollLeft=m(v,o.dir))}})):n==="vertical"?p.createElement(wZ,gr({},h,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const v=o.viewport.scrollTop,y=S_(v,c);s.current.style.transform=`translate3d(0, ${y}px, 0)`}},onWheelScroll:v=>{o.viewport&&(o.viewport.scrollTop=v)},onDragScroll:v=>{o.viewport&&(o.viewport.scrollTop=m(v))}})):null}),xZ=p.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=js(li,e.__scopeScrollArea),[a,c]=p.useState(),d=p.useRef(null),f=Xl(t,d,s.onScrollbarXChange);return p.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),p.createElement(eO,gr({"data-orientation":"horizontal"},o,{ref:f,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"]:Gg(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),oO(v,m)&&h.preventDefault()}},onResize:()=>{d.current&&s.viewport&&a&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:xm(a.paddingLeft),paddingEnd:xm(a.paddingRight)}})}}))}),wZ=p.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=js(li,e.__scopeScrollArea),[a,c]=p.useState(),d=p.useRef(null),f=Xl(t,d,s.onScrollbarYChange);return p.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),p.createElement(eO,gr({"data-orientation":"vertical"},o,{ref:f,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"]:Gg(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),oO(v,m)&&h.preventDefault()}},onResize:()=>{d.current&&s.viewport&&a&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:xm(a.paddingTop),paddingEnd:xm(a.paddingBottom)}})}}))}),[SZ,JI]=ZI(li),eO=p.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:s,onThumbPointerUp:a,onThumbPointerDown:c,onThumbPositionChange:d,onDragScroll:f,onWheelScroll:h,onResize:m,...v}=e,y=js(li,n),[S,x]=p.useState(null),w=Xl(t,M=>x(M)),_=p.useRef(null),k=p.useRef(""),P=y.viewport,j=r.content-r.viewport,I=hl(h),O=hl(d),T=qg(m,10);function R(M){if(_.current){const D=M.clientX-_.current.left,A=M.clientY-_.current.top;f({x:D,y:A})}}return p.useEffect(()=>{const M=D=>{const A=D.target;(S==null?void 0:S.contains(A))&&I(D,j)};return document.addEventListener("wheel",M,{passive:!1}),()=>document.removeEventListener("wheel",M,{passive:!1})},[P,S,j,I]),p.useEffect(O,[r,O]),ru(S,T),ru(y.content,T),p.createElement(SZ,{scope:n,scrollbar:S,hasThumb:o,onThumbChange:hl(s),onThumbPointerUp:hl(a),onThumbPositionChange:O,onThumbPointerDown:hl(c)},p.createElement(Sf.div,gr({},v,{ref:w,style:{position:"absolute",...v.style},onPointerDown:jl(e.onPointerDown,M=>{M.button===0&&(M.target.setPointerCapture(M.pointerId),_.current=S.getBoundingClientRect(),k.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",R(M))}),onPointerMove:jl(e.onPointerMove,R),onPointerUp:jl(e.onPointerUp,M=>{const D=M.target;D.hasPointerCapture(M.pointerId)&&D.releasePointerCapture(M.pointerId),document.body.style.webkitUserSelect=k.current,_.current=null})})))}),Cy="ScrollAreaThumb",CZ=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=JI(Cy,e.__scopeScrollArea);return p.createElement(Cf,{present:n||o.hasThumb},p.createElement(_Z,gr({ref:t},r)))}),_Z=p.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,s=js(Cy,n),a=JI(Cy,n),{onThumbPositionChange:c}=a,d=Xl(t,m=>a.onThumbChange(m)),f=p.useRef(),h=qg(()=>{f.current&&(f.current(),f.current=void 0)},100);return p.useEffect(()=>{const m=s.viewport;if(m){const v=()=>{if(h(),!f.current){const y=EZ(m,c);f.current=y,c()}};return c(),m.addEventListener("scroll",v),()=>m.removeEventListener("scroll",v)}},[s.viewport,h,c]),p.createElement(Sf.div,gr({"data-state":a.hasThumb?"visible":"hidden"},o,{ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:jl(e.onPointerDownCapture,m=>{const y=m.target.getBoundingClientRect(),S=m.clientX-y.left,x=m.clientY-y.top;a.onThumbPointerDown({x:S,y:x})}),onPointerUp:jl(e.onPointerUp,a.onThumbPointerUp)}))}),tO="ScrollAreaCorner",kZ=p.forwardRef((e,t)=>{const n=js(tO,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?p.createElement(PZ,gr({},e,{ref:t})):null}),PZ=p.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=js(tO,n),[s,a]=p.useState(0),[c,d]=p.useState(0),f=!!(s&&c);return ru(o.scrollbarX,()=>{var h;const m=((h=o.scrollbarX)===null||h===void 0?void 0:h.offsetHeight)||0;o.onCornerHeightChange(m),d(m)}),ru(o.scrollbarY,()=>{var h;const m=((h=o.scrollbarY)===null||h===void 0?void 0:h.offsetWidth)||0;o.onCornerWidthChange(m),a(m)}),f?p.createElement(Sf.div,gr({},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 xm(e){return e?parseInt(e,10):0}function nO(e,t){const n=e/t;return isNaN(n)?0:n}function Gg(e){const t=nO(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function jZ(e,t,n,r="ltr"){const o=Gg(n),s=o/2,a=t||s,c=o-a,d=n.scrollbar.paddingStart+a,f=n.scrollbar.size-n.scrollbar.paddingEnd-c,h=n.content-n.viewport,m=r==="ltr"?[0,h]:[h*-1,0];return rO([d,f],m)(e)}function S_(e,t,n="ltr"){const r=Gg(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-o,a=t.content-t.viewport,c=s-r,d=n==="ltr"?[0,a]:[a*-1,0],f=dZ(e,d);return rO([0,a],[0,c])(f)}function rO(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 oO(e,t){return e>0&&e<t}const EZ=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const s={left:e.scrollLeft,top:e.scrollTop},a=n.left!==s.left,c=n.top!==s.top;(a||c)&&t(),n=s,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function qg(e,t){const n=hl(e),r=p.useRef(0);return p.useEffect(()=>()=>window.clearTimeout(r.current),[]),p.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function ru(e,t){const n=hl(t);Sy(()=>{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 IZ=hZ,OZ=gZ,C_=vZ,__=CZ,TZ=kZ;var RZ=uo((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],[`& .${A4("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:A4("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 MZ=RZ;var DZ=Object.defineProperty,AZ=Object.defineProperties,NZ=Object.getOwnPropertyDescriptors,wm=Object.getOwnPropertySymbols,sO=Object.prototype.hasOwnProperty,aO=Object.prototype.propertyIsEnumerable,k_=(e,t,n)=>t in e?DZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_y=(e,t)=>{for(var n in t||(t={}))sO.call(t,n)&&k_(e,n,t[n]);if(wm)for(var n of wm(t))aO.call(t,n)&&k_(e,n,t[n]);return e},iO=(e,t)=>AZ(e,NZ(t)),lO=(e,t)=>{var n={};for(var r in e)sO.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&&aO.call(e,r)&&(n[r]=e[r]);return n};const cO={scrollbarSize:12,scrollHideDelay:1e3,type:"hover",offsetScrollbars:!1},Yg=p.forwardRef((e,t)=>{const n=zr("ScrollArea",cO,e),{children:r,className:o,classNames:s,styles:a,scrollbarSize:c,scrollHideDelay:d,type:f,dir:h,offsetScrollbars:m,viewportRef:v,onScrollPositionChange:y,unstyled:S,variant:x,viewportProps:w}=n,_=lO(n,["children","className","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled","variant","viewportProps"]),[k,P]=p.useState(!1),j=si(),{classes:I,cx:O}=MZ({scrollbarSize:c,offsetScrollbars:m,scrollbarHovered:k,hidden:f==="never"},{name:"ScrollArea",classNames:s,styles:a,unstyled:S,variant:x});return F.createElement(IZ,{type:f==="never"?"always":f,scrollHideDelay:d,dir:h||j.dir,ref:t,asChild:!0},F.createElement(Do,_y({className:O(I.root,o)},_),F.createElement(OZ,iO(_y({},w),{className:I.viewport,ref:v,onScroll:typeof y=="function"?({currentTarget:T})=>y({x:T.scrollLeft,y:T.scrollTop}):void 0}),r),F.createElement(C_,{orientation:"horizontal",className:I.scrollbar,forceMount:!0,onMouseEnter:()=>P(!0),onMouseLeave:()=>P(!1)},F.createElement(__,{className:I.thumb})),F.createElement(C_,{orientation:"vertical",className:I.scrollbar,forceMount:!0,onMouseEnter:()=>P(!0),onMouseLeave:()=>P(!1)},F.createElement(__,{className:I.thumb})),F.createElement(TZ,{className:I.corner})))}),uO=p.forwardRef((e,t)=>{const n=zr("ScrollAreaAutosize",cO,e),{children:r,classNames:o,styles:s,scrollbarSize:a,scrollHideDelay:c,type:d,dir:f,offsetScrollbars:h,viewportRef:m,onScrollPositionChange:v,unstyled:y,sx:S,variant:x,viewportProps:w}=n,_=lO(n,["children","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled","sx","variant","viewportProps"]);return F.createElement(Do,iO(_y({},_),{ref:t,sx:[{display:"flex"},...eI(S)]}),F.createElement(Do,{sx:{display:"flex",flexDirection:"column",flex:1}},F.createElement(Yg,{classNames:o,styles:s,scrollHideDelay:c,scrollbarSize:a,type:d,dir:f,offsetScrollbars:h,viewportRef:m,onScrollPositionChange:v,unstyled:y,variant:x,viewportProps:w},r)))});uO.displayName="@mantine/core/ScrollAreaAutosize";Yg.displayName="@mantine/core/ScrollArea";Yg.Autosize=uO;const zZ=Yg;var $Z=Object.defineProperty,LZ=Object.defineProperties,BZ=Object.getOwnPropertyDescriptors,Sm=Object.getOwnPropertySymbols,dO=Object.prototype.hasOwnProperty,fO=Object.prototype.propertyIsEnumerable,P_=(e,t,n)=>t in e?$Z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,j_=(e,t)=>{for(var n in t||(t={}))dO.call(t,n)&&P_(e,n,t[n]);if(Sm)for(var n of Sm(t))fO.call(t,n)&&P_(e,n,t[n]);return e},FZ=(e,t)=>LZ(e,BZ(t)),HZ=(e,t)=>{var n={};for(var r in e)dO.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&&fO.call(e,r)&&(n[r]=e[r]);return n};const Kg=p.forwardRef((e,t)=>{var n=e,{style:r}=n,o=HZ(n,["style"]);return F.createElement(zZ,FZ(j_({},o),{style:j_({width:"100%"},r),viewportProps:{tabIndex:-1},viewportRef:t}),o.children)});Kg.displayName="@mantine/core/SelectScrollArea";var VZ=uo(()=>({dropdown:{},itemsWrapper:{padding:Ge(4),display:"flex",width:"100%",boxSizing:"border-box"}}));const WZ=VZ;function ku(e){return e.split("-")[1]}function Ex(e){return e==="y"?"height":"width"}function qs(e){return e.split("-")[0]}function Ki(e){return["top","bottom"].includes(qs(e))?"x":"y"}function E_(e,t,n){let{reference:r,floating:o}=e;const s=r.x+r.width/2-o.width/2,a=r.y+r.height/2-o.height/2,c=Ki(t),d=Ex(c),f=r[d]/2-o[d]/2,h=c==="x";let m;switch(qs(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:a};break;case"left":m={x:r.x-o.width,y:a};break;default:m={x:r.x,y:r.y}}switch(ku(t)){case"start":m[c]-=f*(n&&h?-1:1);break;case"end":m[c]+=f*(n&&h?-1:1)}return m}const UZ=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:a}=n,c=s.filter(Boolean),d=await(a.isRTL==null?void 0:a.isRTL(t));let f=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:h,y:m}=E_(f,r,d),v=r,y={},S=0;for(let x=0;x<c.length;x++){const{name:w,fn:_}=c[x],{x:k,y:P,data:j,reset:I}=await _({x:h,y:m,initialPlacement:r,placement:v,strategy:o,middlewareData:y,rects:f,platform:a,elements:{reference:e,floating:t}});h=k??h,m=P??m,y={...y,[w]:{...y[w],...j}},I&&S<=50&&(S++,typeof I=="object"&&(I.placement&&(v=I.placement),I.rects&&(f=I.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):I.rects),{x:h,y:m}=E_(f,v,d)),x=-1)}return{x:h,y:m,placement:v,strategy:o,middlewareData:y}};function ei(e,t){return typeof e=="function"?e(t):e}function Ix(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 ou(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function Ox(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:a,elements:c,strategy:d}=e,{boundary:f="clippingAncestors",rootBoundary:h="viewport",elementContext:m="floating",altBoundary:v=!1,padding:y=0}=ei(t,e),S=Ix(y),x=c[v?m==="floating"?"reference":"floating":m],w=ou(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:f,rootBoundary:h,strategy:d})),_=m==="floating"?{...a.floating,x:r,y:o}:a.reference,k=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),P=await(s.isElement==null?void 0:s.isElement(k))&&await(s.getScale==null?void 0:s.getScale(k))||{x:1,y:1},j=ou(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:_,offsetParent:k,strategy:d}):_);return{top:(w.top-j.top+S.top)/P.y,bottom:(j.bottom-w.bottom+S.bottom)/P.y,left:(w.left-j.left+S.left)/P.x,right:(j.right-w.right+S.right)/P.x}}const Wi=Math.min,ha=Math.max;function ky(e,t,n){return ha(e,Wi(t,n))}const I_=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:a,elements:c}=t,{element:d,padding:f=0}=ei(e,t)||{};if(d==null)return{};const h=Ix(f),m={x:n,y:r},v=Ki(o),y=Ex(v),S=await a.getDimensions(d),x=v==="y",w=x?"top":"left",_=x?"bottom":"right",k=x?"clientHeight":"clientWidth",P=s.reference[y]+s.reference[v]-m[v]-s.floating[y],j=m[v]-s.reference[v],I=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let O=I?I[k]:0;O&&await(a.isElement==null?void 0:a.isElement(I))||(O=c.floating[k]||s.floating[y]);const T=P/2-j/2,R=O/2-S[y]/2-1,M=Wi(h[w],R),D=Wi(h[_],R),A=M,G=O-S[y]-D,$=O/2-S[y]/2+T,H=ky(A,$,G),U=ku(o)!=null&&$!=H&&s.reference[y]/2-($<A?M:D)-S[y]/2<0?$<A?A-$:G-$:0;return{[v]:m[v]-U,data:{[v]:H,centerOffset:$-H+U}}}}),GZ=["top","right","bottom","left"];GZ.reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);const qZ={left:"right",right:"left",bottom:"top",top:"bottom"};function Cm(e){return e.replace(/left|right|bottom|top/g,t=>qZ[t])}function YZ(e,t,n){n===void 0&&(n=!1);const r=ku(e),o=Ki(e),s=Ex(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=Cm(a)),{main:a,cross:Cm(a)}}const KZ={start:"end",end:"start"};function J0(e){return e.replace(/start|end/g,t=>KZ[t])}const XZ=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:s,initialPlacement:a,platform:c,elements:d}=t,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:S=!0,...x}=ei(e,t),w=qs(r),_=qs(a)===a,k=await(c.isRTL==null?void 0:c.isRTL(d.floating)),P=m||(_||!S?[Cm(a)]:function(A){const G=Cm(A);return[J0(A),G,J0(G)]}(a));m||y==="none"||P.push(...function(A,G,$,H){const U=ku(A);let q=function(z,L,V){const W=["left","right"],te=["right","left"],fe=["top","bottom"],ae=["bottom","top"];switch(z){case"top":case"bottom":return V?L?te:W:L?W:te;case"left":case"right":return L?fe:ae;default:return[]}}(qs(A),$==="start",H);return U&&(q=q.map(z=>z+"-"+U),G&&(q=q.concat(q.map(J0)))),q}(a,S,y,k));const j=[a,...P],I=await Ox(t,x),O=[];let T=((n=o.flip)==null?void 0:n.overflows)||[];if(f&&O.push(I[w]),h){const{main:A,cross:G}=YZ(r,s,k);O.push(I[A],I[G])}if(T=[...T,{placement:r,overflows:O}],!O.every(A=>A<=0)){var R,M;const A=(((R=o.flip)==null?void 0:R.index)||0)+1,G=j[A];if(G)return{data:{index:A,overflows:T},reset:{placement:G}};let $=(M=T.filter(H=>H.overflows[0]<=0).sort((H,U)=>H.overflows[1]-U.overflows[1])[0])==null?void 0:M.placement;if(!$)switch(v){case"bestFit":{var D;const H=(D=T.map(U=>[U.placement,U.overflows.filter(q=>q>0).reduce((q,z)=>q+z,0)]).sort((U,q)=>U[1]-q[1])[0])==null?void 0:D[0];H&&($=H);break}case"initialPlacement":$=a}if(r!==$)return{reset:{placement:$}}}return{}}}};function O_(e){const t=Wi(...e.map(r=>r.left)),n=Wi(...e.map(r=>r.top));return{x:t,y:n,width:ha(...e.map(r=>r.right))-t,height:ha(...e.map(r=>r.bottom))-n}}const ZZ=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:o,platform:s,strategy:a}=t,{padding:c=2,x:d,y:f}=ei(e,t),h=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(r.reference))||[]),m=function(x){const w=x.slice().sort((P,j)=>P.y-j.y),_=[];let k=null;for(let P=0;P<w.length;P++){const j=w[P];!k||j.y-k.y>k.height/2?_.push([j]):_[_.length-1].push(j),k=j}return _.map(P=>ou(O_(P)))}(h),v=ou(O_(h)),y=Ix(c),S=await s.getElementRects({reference:{getBoundingClientRect:function(){if(m.length===2&&m[0].left>m[1].right&&d!=null&&f!=null)return m.find(x=>d>x.left-y.left&&d<x.right+y.right&&f>x.top-y.top&&f<x.bottom+y.bottom)||v;if(m.length>=2){if(Ki(n)==="x"){const I=m[0],O=m[m.length-1],T=qs(n)==="top",R=I.top,M=O.bottom,D=T?I.left:O.left,A=T?I.right:O.right;return{top:R,bottom:M,left:D,right:A,width:A-D,height:M-R,x:D,y:R}}const x=qs(n)==="left",w=ha(...m.map(I=>I.right)),_=Wi(...m.map(I=>I.left)),k=m.filter(I=>x?I.left===_:I.right===w),P=k[0].top,j=k[k.length-1].bottom;return{top:P,bottom:j,left:_,right:w,width:w-_,height:j-P,x:_,y:P}}return v}},floating:r.floating,strategy:a});return o.reference.x!==S.reference.x||o.reference.y!==S.reference.y||o.reference.width!==S.reference.width||o.reference.height!==S.reference.height?{reset:{rects:S}}:{}}}},QZ=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,a){const{placement:c,platform:d,elements:f}=s,h=await(d.isRTL==null?void 0:d.isRTL(f.floating)),m=qs(c),v=ku(c),y=Ki(c)==="x",S=["left","top"].includes(m)?-1:1,x=h&&y?-1:1,w=ei(a,s);let{mainAxis:_,crossAxis:k,alignmentAxis:P}=typeof w=="number"?{mainAxis:w,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...w};return v&&typeof P=="number"&&(k=v==="end"?-1*P:P),y?{x:k*x,y:_*S}:{x:_*S,y:k*x}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};function pO(e){return e==="x"?"y":"x"}const JZ=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:a=!1,limiter:c={fn:w=>{let{x:_,y:k}=w;return{x:_,y:k}}},...d}=ei(e,t),f={x:n,y:r},h=await Ox(t,d),m=Ki(qs(o)),v=pO(m);let y=f[m],S=f[v];if(s){const w=m==="y"?"bottom":"right";y=ky(y+h[m==="y"?"top":"left"],y,y-h[w])}if(a){const w=v==="y"?"bottom":"right";S=ky(S+h[v==="y"?"top":"left"],S,S-h[w])}const x=c.fn({...t,[m]:y,[v]:S});return{...x,data:{x:x.x-n,y:x.y-r}}}}},eQ=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:a}=t,{offset:c=0,mainAxis:d=!0,crossAxis:f=!0}=ei(e,t),h={x:n,y:r},m=Ki(o),v=pO(m);let y=h[m],S=h[v];const x=ei(c,t),w=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(d){const P=m==="y"?"height":"width",j=s.reference[m]-s.floating[P]+w.mainAxis,I=s.reference[m]+s.reference[P]-w.mainAxis;y<j?y=j:y>I&&(y=I)}if(f){var _,k;const P=m==="y"?"width":"height",j=["top","left"].includes(qs(o)),I=s.reference[v]-s.floating[P]+(j&&((_=a.offset)==null?void 0:_[v])||0)+(j?0:w.crossAxis),O=s.reference[v]+s.reference[P]+(j?0:((k=a.offset)==null?void 0:k[v])||0)-(j?w.crossAxis:0);S<I?S=I:S>O&&(S=O)}return{[m]:y,[v]:S}}}},tQ=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:a=()=>{},...c}=ei(e,t),d=await Ox(t,c),f=qs(n),h=ku(n),m=Ki(n)==="x",{width:v,height:y}=r.floating;let S,x;f==="top"||f==="bottom"?(S=f,x=h===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(x=f,S=h==="end"?"top":"bottom");const w=y-d[S],_=v-d[x],k=!t.middlewareData.shift;let P=w,j=_;if(m){const O=v-d.left-d.right;j=h||k?Wi(_,O):O}else{const O=y-d.top-d.bottom;P=h||k?Wi(w,O):O}if(k&&!h){const O=ha(d.left,0),T=ha(d.right,0),R=ha(d.top,0),M=ha(d.bottom,0);m?j=v-2*(O!==0||T!==0?O+T:ha(d.left,d.right)):P=y-2*(R!==0||M!==0?R+M:ha(d.top,d.bottom))}await a({...t,availableWidth:j,availableHeight:P});const I=await o.getDimensions(s.floating);return v!==I.width||y!==I.height?{reset:{rects:!0}}:{}}}};function Ss(e){var t;return((t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ys(e){return Ss(e).getComputedStyle(e)}function hO(e){return e instanceof Ss(e).Node}function Ui(e){return hO(e)?(e.nodeName||"").toLowerCase():"#document"}function ta(e){return e instanceof Ss(e).HTMLElement}function Wa(e){return e instanceof Ss(e).Element}function T_(e){return typeof ShadowRoot<"u"&&(e instanceof Ss(e).ShadowRoot||e instanceof ShadowRoot)}function Xd(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ys(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function nQ(e){return["table","td","th"].includes(Ui(e))}function Py(e){const t=Tx(),n=Ys(e);return n.transform!=="none"||n.perspective!=="none"||!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 Tx(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Xg(e){return["html","body","#document"].includes(Ui(e))}const jy=Math.min,Uc=Math.max,_m=Math.round,Fp=Math.floor,Fl=e=>({x:e,y:e});function mO(e){const t=Ys(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ta(e),s=o?e.offsetWidth:n,a=o?e.offsetHeight:r,c=_m(n)!==s||_m(r)!==a;return c&&(n=s,r=a),{width:n,height:r,$:c}}function Rx(e){return Wa(e)?e:e.contextElement}function Gc(e){const t=Rx(e);if(!ta(t))return Fl(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=mO(t);let a=(s?_m(n.width):n.width)/r,c=(s?_m(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),c&&Number.isFinite(c)||(c=1),{x:a,y:c}}const R_=Fl(0);function gO(e,t,n){var r,o;if(t===void 0&&(t=!0),!Tx())return R_;const s=e?Ss(e):window;return!n||t&&n!==s?R_:{x:((r=s.visualViewport)==null?void 0:r.offsetLeft)||0,y:((o=s.visualViewport)==null?void 0:o.offsetTop)||0}}function Hl(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Rx(e);let a=Fl(1);t&&(r?Wa(r)&&(a=Gc(r)):a=Gc(e));const c=gO(s,n,r);let d=(o.left+c.x)/a.x,f=(o.top+c.y)/a.y,h=o.width/a.x,m=o.height/a.y;if(s){const v=Ss(s),y=r&&Wa(r)?Ss(r):r;let S=v.frameElement;for(;S&&r&&y!==v;){const x=Gc(S),w=S.getBoundingClientRect(),_=getComputedStyle(S),k=w.left+(S.clientLeft+parseFloat(_.paddingLeft))*x.x,P=w.top+(S.clientTop+parseFloat(_.paddingTop))*x.y;d*=x.x,f*=x.y,h*=x.x,m*=x.y,d+=k,f+=P,S=Ss(S).frameElement}}return ou({width:h,height:m,x:d,y:f})}function Ua(e){return((hO(e)?e.ownerDocument:e.document)||window.document).documentElement}function Zg(e){return Wa(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function vO(e){return Hl(Ua(e)).left+Zg(e).scrollLeft}function su(e){if(Ui(e)==="html")return e;const t=e.assignedSlot||e.parentNode||T_(e)&&e.host||Ua(e);return T_(t)?t.host:t}function yO(e){const t=su(e);return Xg(t)?e.ownerDocument?e.ownerDocument.body:e.body:ta(t)&&Xd(t)?t:yO(t)}function km(e,t){var n;t===void 0&&(t=[]);const r=yO(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),s=Ss(r);return o?t.concat(s,s.visualViewport||[],Xd(r)?r:[]):t.concat(r,km(r))}function M_(e,t,n){let r;if(t==="viewport")r=function(o,s){const a=Ss(o),c=Ua(o),d=a.visualViewport;let f=c.clientWidth,h=c.clientHeight,m=0,v=0;if(d){f=d.width,h=d.height;const y=Tx();(!y||y&&s==="fixed")&&(m=d.offsetLeft,v=d.offsetTop)}return{width:f,height:h,x:m,y:v}}(e,n);else if(t==="document")r=function(o){const s=Ua(o),a=Zg(o),c=o.ownerDocument.body,d=Uc(s.scrollWidth,s.clientWidth,c.scrollWidth,c.clientWidth),f=Uc(s.scrollHeight,s.clientHeight,c.scrollHeight,c.clientHeight);let h=-a.scrollLeft+vO(o);const m=-a.scrollTop;return Ys(c).direction==="rtl"&&(h+=Uc(s.clientWidth,c.clientWidth)-d),{width:d,height:f,x:h,y:m}}(Ua(e));else if(Wa(t))r=function(o,s){const a=Hl(o,!0,s==="fixed"),c=a.top+o.clientTop,d=a.left+o.clientLeft,f=ta(o)?Gc(o):Fl(1);return{width:o.clientWidth*f.x,height:o.clientHeight*f.y,x:d*f.x,y:c*f.y}}(t,n);else{const o=gO(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return ou(r)}function bO(e,t){const n=su(e);return!(n===t||!Wa(n)||Xg(n))&&(Ys(n).position==="fixed"||bO(n,t))}function D_(e,t){return ta(e)&&Ys(e).position!=="fixed"?t?t(e):e.offsetParent:null}function A_(e,t){const n=Ss(e);if(!ta(e))return n;let r=D_(e,t);for(;r&&nQ(r)&&Ys(r).position==="static";)r=D_(r,t);return r&&(Ui(r)==="html"||Ui(r)==="body"&&Ys(r).position==="static"&&!Py(r))?n:r||function(o){let s=su(o);for(;ta(s)&&!Xg(s);){if(Py(s))return s;s=su(s)}return null}(e)||n}function rQ(e,t,n){const r=ta(t),o=Ua(t),s=n==="fixed",a=Hl(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const d=Fl(0);if(r||!r&&!s)if((Ui(t)!=="body"||Xd(o))&&(c=Zg(t)),ta(t)){const f=Hl(t,!0,s,t);d.x=f.x+t.clientLeft,d.y=f.y+t.clientTop}else o&&(d.x=vO(o));return{x:a.left+c.scrollLeft-d.x,y:a.top+c.scrollTop-d.y,width:a.width,height:a.height}}const oQ={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=n==="clippingAncestors"?function(f,h){const m=h.get(f);if(m)return m;let v=km(f).filter(w=>Wa(w)&&Ui(w)!=="body"),y=null;const S=Ys(f).position==="fixed";let x=S?su(f):f;for(;Wa(x)&&!Xg(x);){const w=Ys(x),_=Py(x);_||w.position!=="fixed"||(y=null),(S?!_&&!y:!_&&w.position==="static"&&y&&["absolute","fixed"].includes(y.position)||Xd(x)&&!_&&bO(f,x))?v=v.filter(k=>k!==x):y=w,x=su(x)}return h.set(f,v),v}(t,this._c):[].concat(n),a=[...s,r],c=a[0],d=a.reduce((f,h)=>{const m=M_(t,h,o);return f.top=Uc(m.top,f.top),f.right=jy(m.right,f.right),f.bottom=jy(m.bottom,f.bottom),f.left=Uc(m.left,f.left),f},M_(t,c,o));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=ta(n),s=Ua(n);if(n===s)return t;let a={scrollLeft:0,scrollTop:0},c=Fl(1);const d=Fl(0);if((o||!o&&r!=="fixed")&&((Ui(n)!=="body"||Xd(s))&&(a=Zg(n)),ta(n))){const f=Hl(n);c=Gc(n),d.x=f.x+n.clientLeft,d.y=f.y+n.clientTop}return{width:t.width*c.x,height:t.height*c.y,x:t.x*c.x-a.scrollLeft*c.x+d.x,y:t.y*c.y-a.scrollTop*c.y+d.y}},isElement:Wa,getDimensions:function(e){return mO(e)},getOffsetParent:A_,getDocumentElement:Ua,getScale:Gc,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||A_,s=this.getDimensions;return{reference:rQ(t,await o(n),r),floating:{x:0,y:0,...await s(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>Ys(e).direction==="rtl"};function sQ(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:a=!0,layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,f=Rx(e),h=o||s?[...f?km(f):[],...km(t)]:[];h.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),s&&x.addEventListener("resize",n)});const m=f&&c?function(x,w){let _,k=null;const P=Ua(x);function j(){clearTimeout(_),k&&k.disconnect(),k=null}return function I(O,T){O===void 0&&(O=!1),T===void 0&&(T=1),j();const{left:R,top:M,width:D,height:A}=x.getBoundingClientRect();if(O||w(),!D||!A)return;const G=Fp(M),$=Fp(P.clientWidth-(R+D)),H=Fp(P.clientHeight-(M+A)),U=Fp(R);let q=!0;k=new IntersectionObserver(z=>{const L=z[0].intersectionRatio;if(L!==T){if(!q)return I();L?I(!1,L):_=setTimeout(()=>{I(!1,1e-7)},100)}q=!1},{rootMargin:-G+"px "+-$+"px "+-H+"px "+-U+"px",threshold:Uc(0,jy(1,T))||1}),k.observe(x)}(!0),j}(f,n):null;let v,y=null;a&&(y=new ResizeObserver(n),f&&!d&&y.observe(f),y.observe(t));let S=d?Hl(e):null;return d&&function x(){const w=Hl(e);!S||w.x===S.x&&w.y===S.y&&w.width===S.width&&w.height===S.height||n(),S=w,v=requestAnimationFrame(x)}(),n(),()=>{h.forEach(x=>{o&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),m&&m(),y&&y.disconnect(),y=null,d&&cancelAnimationFrame(v)}}const aQ=(e,t,n)=>{const r=new Map,o={platform:oQ,...n},s={...o.platform,_c:r};return UZ(e,t,{...o,platform:s})},iQ=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?I_({element:t.current,padding:n}).fn(o):{}:t?I_({element:t,padding:n}).fn(o):{}}}};var mh=typeof document<"u"?p.useLayoutEffect:p.useEffect;function Pm(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(!Pm(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)&&!Pm(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function N_(e){const t=p.useRef(e);return mh(()=>{t.current=e}),t}function lQ(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,whileElementsMounted:s,open:a}=e,[c,d]=p.useState({x:null,y:null,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,h]=p.useState(r);Pm(f,r)||h(r);const m=p.useRef(null),v=p.useRef(null),y=p.useRef(c),S=N_(s),x=N_(o),[w,_]=p.useState(null),[k,P]=p.useState(null),j=p.useCallback(D=>{m.current!==D&&(m.current=D,_(D))},[]),I=p.useCallback(D=>{v.current!==D&&(v.current=D,P(D))},[]),O=p.useCallback(()=>{if(!m.current||!v.current)return;const D={placement:t,strategy:n,middleware:f};x.current&&(D.platform=x.current),aQ(m.current,v.current,D).then(A=>{const G={...A,isPositioned:!0};T.current&&!Pm(y.current,G)&&(y.current=G,ng.flushSync(()=>{d(G)}))})},[f,t,n,x]);mh(()=>{a===!1&&y.current.isPositioned&&(y.current.isPositioned=!1,d(D=>({...D,isPositioned:!1})))},[a]);const T=p.useRef(!1);mh(()=>(T.current=!0,()=>{T.current=!1}),[]),mh(()=>{if(w&&k){if(S.current)return S.current(w,k,O);O()}},[w,k,O,S]);const R=p.useMemo(()=>({reference:m,floating:v,setReference:j,setFloating:I}),[j,I]),M=p.useMemo(()=>({reference:w,floating:k}),[w,k]);return p.useMemo(()=>({...c,update:O,refs:R,elements:M,reference:j,floating:I}),[c,O,R,M,j,I])}var cQ=typeof document<"u"?p.useLayoutEffect:p.useEffect;function uQ(){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 dQ=p.createContext(null),fQ=()=>p.useContext(dQ);function pQ(e){return(e==null?void 0:e.ownerDocument)||document}function hQ(e){return pQ(e).defaultView||window}function Hp(e){return e?e instanceof hQ(e).Element:!1}const mQ=Qy["useInsertionEffect".toString()],gQ=mQ||(e=>e());function vQ(e){const t=p.useRef(()=>{});return gQ(()=>{t.current=e}),p.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 yQ(e){e===void 0&&(e={});const{open:t=!1,onOpenChange:n,nodeId:r}=e,o=lQ(e),s=fQ(),a=p.useRef(null),c=p.useRef({}),d=p.useState(()=>uQ())[0],[f,h]=p.useState(null),m=p.useCallback(_=>{const k=Hp(_)?{getBoundingClientRect:()=>_.getBoundingClientRect(),contextElement:_}:_;o.refs.setReference(k)},[o.refs]),v=p.useCallback(_=>{(Hp(_)||_===null)&&(a.current=_,h(_)),(Hp(o.refs.reference.current)||o.refs.reference.current===null||_!==null&&!Hp(_))&&o.refs.setReference(_)},[o.refs]),y=p.useMemo(()=>({...o.refs,setReference:v,setPositionReference:m,domReference:a}),[o.refs,v,m]),S=p.useMemo(()=>({...o.elements,domReference:f}),[o.elements,f]),x=vQ(n),w=p.useMemo(()=>({...o,refs:y,elements:S,dataRef:c,nodeId:r,events:d,open:t,onOpenChange:x}),[o,r,d,t,x,y,S]);return cQ(()=>{const _=s==null?void 0:s.nodesRef.current.find(k=>k.id===r);_&&(_.context=w)}),p.useMemo(()=>({...o,context:w,refs:y,reference:v,positionReference:m}),[o,y,w,v,m])}function bQ({opened:e,floating:t,position:n,positionDependencies:r}){const[o,s]=p.useState(0);p.useEffect(()=>{if(t.refs.reference.current&&t.refs.floating.current)return sQ(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,o,n]),Gs(()=>{t.update()},r),Gs(()=>{s(a=>a+1)},[e])}function xQ(e){const t=[QZ(e.offset)];return e.middlewares.shift&&t.push(JZ({limiter:eQ()})),e.middlewares.flip&&t.push(XZ()),e.middlewares.inline&&t.push(ZZ()),t.push(iQ({element:e.arrowRef,padding:e.arrowOffset})),t}function wQ(e){const[t,n]=Kd({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=()=>{var a;(a=e.onClose)==null||a.call(e),n(!1)},o=()=>{var a,c;t?((a=e.onClose)==null||a.call(e),n(!1)):((c=e.onOpen)==null||c.call(e),n(!0))},s=yQ({placement:e.position,middleware:[...xQ(e),...e.width==="target"?[tQ({apply({rects:a}){var c,d;Object.assign((d=(c=s.refs.floating.current)==null?void 0:c.style)!=null?d:{},{width:`${a.reference.width}px`})}})]:[]]});return bQ({opened:e.opened,position:e.position,positionDependencies:e.positionDependencies,floating:s}),Gs(()=>{var a;(a=e.onPositionChange)==null||a.call(e,s.placement)},[s.placement]),Gs(()=>{var a,c;e.opened?(c=e.onOpen)==null||c.call(e):(a=e.onClose)==null||a.call(e)},[e.opened]),{floating:s,controlled:typeof e.opened=="boolean",opened:t,onClose:r,onToggle:o}}const xO={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"},[SQ,wO]=eY(xO.context);var CQ=Object.defineProperty,_Q=Object.defineProperties,kQ=Object.getOwnPropertyDescriptors,jm=Object.getOwnPropertySymbols,SO=Object.prototype.hasOwnProperty,CO=Object.prototype.propertyIsEnumerable,z_=(e,t,n)=>t in e?CQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Vp=(e,t)=>{for(var n in t||(t={}))SO.call(t,n)&&z_(e,n,t[n]);if(jm)for(var n of jm(t))CO.call(t,n)&&z_(e,n,t[n]);return e},PQ=(e,t)=>_Q(e,kQ(t)),jQ=(e,t)=>{var n={};for(var r in e)SO.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&jm)for(var r of jm(e))t.indexOf(r)<0&&CO.call(e,r)&&(n[r]=e[r]);return n};const EQ={refProp:"ref",popupType:"dialog"},_O=p.forwardRef((e,t)=>{const n=zr("PopoverTarget",EQ,e),{children:r,refProp:o,popupType:s}=n,a=jQ(n,["children","refProp","popupType"]);if(!nI(r))throw new Error(xO.children);const c=a,d=wO(),f=Vg(d.reference,r.ref,t),h=d.withRoles?{"aria-haspopup":s,"aria-expanded":d.opened,"aria-controls":d.getDropdownId(),id:d.getTargetId()}:{};return p.cloneElement(r,Vp(PQ(Vp(Vp(Vp({},c),h),d.targetProps),{className:oI(d.targetProps.className,c.className,r.props.className),[o]:f}),d.controlled?null:{onClick:d.onToggle}))});_O.displayName="@mantine/core/PopoverTarget";var IQ=uo((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 OQ=IQ;var TQ=Object.defineProperty,$_=Object.getOwnPropertySymbols,RQ=Object.prototype.hasOwnProperty,MQ=Object.prototype.propertyIsEnumerable,L_=(e,t,n)=>t in e?TQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yc=(e,t)=>{for(var n in t||(t={}))RQ.call(t,n)&&L_(e,n,t[n]);if($_)for(var n of $_(t))MQ.call(t,n)&&L_(e,n,t[n]);return e};const B_={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function DQ({transition:e,state:t,duration:n,timingFunction:r}){const o={transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e=="string"?e in Ap?yc(yc(yc({transitionProperty:Ap[e].transitionProperty},o),Ap[e].common),Ap[e][B_[t]]):null:yc(yc(yc({transitionProperty:e.transitionProperty},o),e.common),e[B_[t]])}function AQ({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:o,onExit:s,onEntered:a,onExited:c}){const d=si(),f=uI(),h=d.respectReducedMotion?f:!1,[m,v]=p.useState(h?0:e),[y,S]=p.useState(r?"entered":"exited"),x=p.useRef(-1),w=_=>{const k=_?o:s,P=_?a:c;S(_?"pre-entering":"pre-exiting"),window.clearTimeout(x.current);const j=h?0:_?e:t;if(v(j),j===0)typeof k=="function"&&k(),typeof P=="function"&&P(),S(_?"entered":"exited");else{const I=window.setTimeout(()=>{typeof k=="function"&&k(),S(_?"entering":"exiting")},10);x.current=window.setTimeout(()=>{window.clearTimeout(I),typeof P=="function"&&P(),S(_?"entered":"exited")},j)}};return Gs(()=>{w(r)},[r]),p.useEffect(()=>()=>window.clearTimeout(x.current),[]),{transitionDuration:m,transitionStatus:y,transitionTimingFunction:n||d.transitionTimingFunction}}function kO({keepMounted:e,transition:t,duration:n=250,exitDuration:r=n,mounted:o,children:s,timingFunction:a,onExit:c,onEntered:d,onEnter:f,onExited:h}){const{transitionDuration:m,transitionStatus:v,transitionTimingFunction:y}=AQ({mounted:o,exitDuration:r,duration:n,timingFunction:a,onExit:c,onEntered:d,onEnter:f,onExited:h});return m===0?o?F.createElement(F.Fragment,null,s({})):e?s({display:"none"}):null:v==="exited"?e?s({display:"none"}):null:F.createElement(F.Fragment,null,s(DQ({transition:t,duration:m,state:v,timingFunction:y})))}kO.displayName="@mantine/core/Transition";function PO({children:e,active:t=!0,refProp:n="ref"}){const r=DY(t),o=Vg(r,e==null?void 0:e.ref);return nI(e)?p.cloneElement(e,{[n]:o}):e}PO.displayName="@mantine/core/FocusTrap";var NQ=Object.defineProperty,zQ=Object.defineProperties,$Q=Object.getOwnPropertyDescriptors,F_=Object.getOwnPropertySymbols,LQ=Object.prototype.hasOwnProperty,BQ=Object.prototype.propertyIsEnumerable,H_=(e,t,n)=>t in e?NQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xi=(e,t)=>{for(var n in t||(t={}))LQ.call(t,n)&&H_(e,n,t[n]);if(F_)for(var n of F_(t))BQ.call(t,n)&&H_(e,n,t[n]);return e},Wp=(e,t)=>zQ(e,$Q(t));function V_(e,t,n,r){return e==="center"||r==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function W_(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 FQ={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function HQ({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,arrowX:s,arrowY:a,dir:c}){const[d,f="center"]=e.split("-"),h={width:Ge(t),height:Ge(t),transform:"rotate(45deg)",position:"absolute",[FQ[d]]:Ge(r)},m=Ge(-t/2);return d==="left"?Wp(xi(xi({},h),V_(f,a,n,o)),{right:m,borderLeftColor:"transparent",borderBottomColor:"transparent"}):d==="right"?Wp(xi(xi({},h),V_(f,a,n,o)),{left:m,borderRightColor:"transparent",borderTopColor:"transparent"}):d==="top"?Wp(xi(xi({},h),W_(f,s,n,o,c)),{bottom:m,borderTopColor:"transparent",borderLeftColor:"transparent"}):d==="bottom"?Wp(xi(xi({},h),W_(f,s,n,o,c)),{top:m,borderBottomColor:"transparent",borderRightColor:"transparent"}):{}}var VQ=Object.defineProperty,WQ=Object.defineProperties,UQ=Object.getOwnPropertyDescriptors,Em=Object.getOwnPropertySymbols,jO=Object.prototype.hasOwnProperty,EO=Object.prototype.propertyIsEnumerable,U_=(e,t,n)=>t in e?VQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,GQ=(e,t)=>{for(var n in t||(t={}))jO.call(t,n)&&U_(e,n,t[n]);if(Em)for(var n of Em(t))EO.call(t,n)&&U_(e,n,t[n]);return e},qQ=(e,t)=>WQ(e,UQ(t)),YQ=(e,t)=>{var n={};for(var r in e)jO.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&&EO.call(e,r)&&(n[r]=e[r]);return n};const IO=p.forwardRef((e,t)=>{var n=e,{position:r,arrowSize:o,arrowOffset:s,arrowRadius:a,arrowPosition:c,visible:d,arrowX:f,arrowY:h}=n,m=YQ(n,["position","arrowSize","arrowOffset","arrowRadius","arrowPosition","visible","arrowX","arrowY"]);const v=si();return d?F.createElement("div",qQ(GQ({},m),{ref:t,style:HQ({position:r,arrowSize:o,arrowOffset:s,arrowRadius:a,arrowPosition:c,dir:v.dir,arrowX:f,arrowY:h})})):null});IO.displayName="@mantine/core/FloatingArrow";var KQ=Object.defineProperty,XQ=Object.defineProperties,ZQ=Object.getOwnPropertyDescriptors,Im=Object.getOwnPropertySymbols,OO=Object.prototype.hasOwnProperty,TO=Object.prototype.propertyIsEnumerable,G_=(e,t,n)=>t in e?KQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,bc=(e,t)=>{for(var n in t||(t={}))OO.call(t,n)&&G_(e,n,t[n]);if(Im)for(var n of Im(t))TO.call(t,n)&&G_(e,n,t[n]);return e},Up=(e,t)=>XQ(e,ZQ(t)),QQ=(e,t)=>{var n={};for(var r in e)OO.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&&TO.call(e,r)&&(n[r]=e[r]);return n};const JQ={};function RO(e){var t;const n=zr("PopoverDropdown",JQ,e),{style:r,className:o,children:s,onKeyDownCapture:a}=n,c=QQ(n,["style","className","children","onKeyDownCapture"]),d=wO(),{classes:f,cx:h}=OQ({radius:d.radius,shadow:d.shadow},{name:d.__staticSelector,classNames:d.classNames,styles:d.styles,unstyled:d.unstyled,variant:d.variant}),m=jY({opened:d.opened,shouldReturnFocus:d.returnFocus}),v=d.withRoles?{"aria-labelledby":d.getTargetId(),id:d.getDropdownId(),role:"dialog"}:{};return d.disabled?null:F.createElement(AI,Up(bc({},d.portalProps),{withinPortal:d.withinPortal}),F.createElement(kO,Up(bc({mounted:d.opened},d.transitionProps),{transition:d.transitionProps.transition||"fade",duration:(t=d.transitionProps.duration)!=null?t:150,keepMounted:d.keepMounted,exitDuration:typeof d.transitionProps.exitDuration=="number"?d.transitionProps.exitDuration:d.transitionProps.duration}),y=>{var S,x;return F.createElement(PO,{active:d.trapFocus},F.createElement(Do,bc(Up(bc({},v),{tabIndex:-1,ref:d.floating,style:Up(bc(bc({},r),y),{zIndex:d.zIndex,top:(S=d.y)!=null?S:0,left:(x=d.x)!=null?x:0,width:d.width==="target"?void 0:Ge(d.width)}),className:h(f.dropdown,o),onKeyDownCapture:nY(d.onClose,{active:d.closeOnEscape,onTrigger:m,onKeyDown:a}),"data-position":d.placement}),c),s,F.createElement(IO,{ref:d.arrowRef,arrowX:d.arrowX,arrowY:d.arrowY,visible:d.withArrow,position:d.placement,arrowSize:d.arrowSize,arrowRadius:d.arrowRadius,arrowOffset:d.arrowOffset,arrowPosition:d.arrowPosition,className:f.arrow})))}))}RO.displayName="@mantine/core/PopoverDropdown";function eJ(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 q_=Object.getOwnPropertySymbols,tJ=Object.prototype.hasOwnProperty,nJ=Object.prototype.propertyIsEnumerable,rJ=(e,t)=>{var n={};for(var r in e)tJ.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&q_)for(var r of q_(e))t.indexOf(r)<0&&nJ.call(e,r)&&(n[r]=e[r]);return n};const oJ={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:Sx("popover"),__staticSelector:"Popover",width:"max-content"};function Pu(e){var t,n,r,o,s,a;const c=p.useRef(null),d=zr("Popover",oJ,e),{children:f,position:h,offset:m,onPositionChange:v,positionDependencies:y,opened:S,transitionProps:x,width:w,middlewares:_,withArrow:k,arrowSize:P,arrowOffset:j,arrowRadius:I,arrowPosition:O,unstyled:T,classNames:R,styles:M,closeOnClickOutside:D,withinPortal:A,portalProps:G,closeOnEscape:$,clickOutsideEvents:H,trapFocus:U,onClose:q,onOpen:z,onChange:L,zIndex:V,radius:W,shadow:te,id:fe,defaultOpened:ae,__staticSelector:J,withRoles:B,disabled:oe,returnFocus:le,variant:ge,keepMounted:se}=d,pe=rJ(d,["children","position","offset","onPositionChange","positionDependencies","opened","transitionProps","width","middlewares","withArrow","arrowSize","arrowOffset","arrowRadius","arrowPosition","unstyled","classNames","styles","closeOnClickOutside","withinPortal","portalProps","closeOnEscape","clickOutsideEvents","trapFocus","onClose","onOpen","onChange","zIndex","radius","shadow","id","defaultOpened","__staticSelector","withRoles","disabled","returnFocus","variant","keepMounted"]),[ue,be]=p.useState(null),[ke,ie]=p.useState(null),Pe=_x(fe),Je=si(),Ae=wQ({middlewares:_,width:w,position:eJ(Je.dir,h),offset:typeof m=="number"?m+(k?P/2:0):m,arrowRef:c,arrowOffset:j,onPositionChange:v,positionDependencies:y,opened:S,defaultOpened:ae,onChange:L,onOpen:z,onClose:q});CY(()=>Ae.opened&&D&&Ae.onClose(),H,[ue,ke]);const Ve=p.useCallback(ft=>{be(ft),Ae.floating.reference(ft)},[Ae.floating.reference]),kt=p.useCallback(ft=>{ie(ft),Ae.floating.floating(ft)},[Ae.floating.floating]);return F.createElement(SQ,{value:{returnFocus:le,disabled:oe,controlled:Ae.controlled,reference:Ve,floating:kt,x:Ae.floating.x,y:Ae.floating.y,arrowX:(r=(n=(t=Ae.floating)==null?void 0:t.middlewareData)==null?void 0:n.arrow)==null?void 0:r.x,arrowY:(a=(s=(o=Ae.floating)==null?void 0:o.middlewareData)==null?void 0:s.arrow)==null?void 0:a.y,opened:Ae.opened,arrowRef:c,transitionProps:x,width:w,withArrow:k,arrowSize:P,arrowOffset:j,arrowRadius:I,arrowPosition:O,placement:Ae.floating.placement,trapFocus:U,withinPortal:A,portalProps:G,zIndex:V,radius:W,shadow:te,closeOnEscape:$,onClose:Ae.onClose,onToggle:Ae.onToggle,getTargetId:()=>`${Pe}-target`,getDropdownId:()=>`${Pe}-dropdown`,withRoles:B,targetProps:pe,__staticSelector:J,classNames:R,styles:M,unstyled:T,variant:ge,keepMounted:se}},f)}Pu.Target=_O;Pu.Dropdown=RO;Pu.displayName="@mantine/core/Popover";var sJ=Object.defineProperty,Om=Object.getOwnPropertySymbols,MO=Object.prototype.hasOwnProperty,DO=Object.prototype.propertyIsEnumerable,Y_=(e,t,n)=>t in e?sJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,aJ=(e,t)=>{for(var n in t||(t={}))MO.call(t,n)&&Y_(e,n,t[n]);if(Om)for(var n of Om(t))DO.call(t,n)&&Y_(e,n,t[n]);return e},iJ=(e,t)=>{var n={};for(var r in e)MO.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Om)for(var r of Om(e))t.indexOf(r)<0&&DO.call(e,r)&&(n[r]=e[r]);return n};function lJ(e){var t=e,{children:n,component:r="div",maxHeight:o=220,direction:s="column",id:a,innerRef:c,__staticSelector:d,styles:f,classNames:h,unstyled:m}=t,v=iJ(t,["children","component","maxHeight","direction","id","innerRef","__staticSelector","styles","classNames","unstyled"]);const{classes:y}=WZ(null,{name:d,styles:f,classNames:h,unstyled:m});return F.createElement(Pu.Dropdown,aJ({p:0,onMouseDown:S=>S.preventDefault()},v),F.createElement("div",{style:{maxHeight:Ge(o),display:"flex"}},F.createElement(Do,{component:r||"div",id:`${a}-items`,"aria-labelledby":`${a}-label`,role:"listbox",onMouseDown:S=>S.preventDefault(),style:{flex:1,overflowY:r!==Kg?"auto":void 0},"data-combobox-popover":!0,tabIndex:-1,ref:c},F.createElement("div",{className:y.itemsWrapper,style:{flexDirection:s}},n))))}function Ai({opened:e,transitionProps:t={transition:"fade",duration:0},shadow:n,withinPortal:r,portalProps:o,children:s,__staticSelector:a,onDirectionChange:c,switchDirectionOnFlip:d,zIndex:f,dropdownPosition:h,positionDependencies:m=[],classNames:v,styles:y,unstyled:S,readOnly:x,variant:w}){return F.createElement(Pu,{unstyled:S,classNames:v,styles:y,width:"target",withRoles:!1,opened:e,middlewares:{flip:h==="flip",shift:!1},position:h==="flip"?"bottom":h,positionDependencies:m,zIndex:f,__staticSelector:a,withinPortal:r,portalProps:o,transitionProps:t,shadow:n,disabled:x,onPositionChange:_=>d&&(c==null?void 0:c(_==="top"?"column-reverse":"column")),variant:w},s)}Ai.Target=Pu.Target;Ai.Dropdown=lJ;var cJ=Object.defineProperty,uJ=Object.defineProperties,dJ=Object.getOwnPropertyDescriptors,Tm=Object.getOwnPropertySymbols,AO=Object.prototype.hasOwnProperty,NO=Object.prototype.propertyIsEnumerable,K_=(e,t,n)=>t in e?cJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Gp=(e,t)=>{for(var n in t||(t={}))AO.call(t,n)&&K_(e,n,t[n]);if(Tm)for(var n of Tm(t))NO.call(t,n)&&K_(e,n,t[n]);return e},fJ=(e,t)=>uJ(e,dJ(t)),pJ=(e,t)=>{var n={};for(var r in e)AO.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Tm)for(var r of Tm(e))t.indexOf(r)<0&&NO.call(e,r)&&(n[r]=e[r]);return n};function hJ(e,t,n){const r=zr(e,t,n),{label:o,description:s,error:a,required:c,classNames:d,styles:f,className:h,unstyled:m,__staticSelector:v,sx:y,errorProps:S,labelProps:x,descriptionProps:w,wrapperProps:_,id:k,size:P,style:j,inputContainer:I,inputWrapperOrder:O,withAsterisk:T,variant:R}=r,M=pJ(r,["label","description","error","required","classNames","styles","className","unstyled","__staticSelector","sx","errorProps","labelProps","descriptionProps","wrapperProps","id","size","style","inputContainer","inputWrapperOrder","withAsterisk","variant"]),D=_x(k),{systemStyles:A,rest:G}=Wg(M),$=Gp({label:o,description:s,error:a,required:c,classNames:d,className:h,__staticSelector:v,sx:y,errorProps:S,labelProps:x,descriptionProps:w,unstyled:m,styles:f,id:D,size:P,style:j,inputContainer:I,inputWrapperOrder:O,withAsterisk:T,variant:R},_);return fJ(Gp({},G),{classNames:d,styles:f,unstyled:m,wrapperProps:Gp(Gp({},$),A),inputProps:{required:c,classNames:d,styles:f,unstyled:m,id:D,size:P,__staticSelector:v,error:a,variant:R}})}var mJ=uo((e,t,{size:n})=>({label:{display:"inline-block",fontSize:Ut({size:n,sizes:e.fontSizes}),fontWeight:500,color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[9],wordBreak:"break-word",cursor:"default",WebkitTapHighlightColor:"transparent"},required:{color:e.fn.variant({variant:"filled",color:"red"}).background}}));const gJ=mJ;var vJ=Object.defineProperty,Rm=Object.getOwnPropertySymbols,zO=Object.prototype.hasOwnProperty,$O=Object.prototype.propertyIsEnumerable,X_=(e,t,n)=>t in e?vJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yJ=(e,t)=>{for(var n in t||(t={}))zO.call(t,n)&&X_(e,n,t[n]);if(Rm)for(var n of Rm(t))$O.call(t,n)&&X_(e,n,t[n]);return e},bJ=(e,t)=>{var n={};for(var r in e)zO.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Rm)for(var r of Rm(e))t.indexOf(r)<0&&$O.call(e,r)&&(n[r]=e[r]);return n};const xJ={labelElement:"label",size:"sm"},Mx=p.forwardRef((e,t)=>{const n=zr("InputLabel",xJ,e),{labelElement:r,children:o,required:s,size:a,classNames:c,styles:d,unstyled:f,className:h,htmlFor:m,__staticSelector:v,variant:y,onMouseDown:S}=n,x=bJ(n,["labelElement","children","required","size","classNames","styles","unstyled","className","htmlFor","__staticSelector","variant","onMouseDown"]),{classes:w,cx:_}=gJ(null,{name:["InputWrapper",v],classNames:c,styles:d,unstyled:f,variant:y,size:a});return F.createElement(Do,yJ({component:r,ref:t,className:_(w.label,h),htmlFor:r==="label"?m:void 0,onMouseDown:k=>{S==null||S(k),!k.defaultPrevented&&k.detail>1&&k.preventDefault()}},x),o,s&&F.createElement("span",{className:w.required,"aria-hidden":!0}," *"))});Mx.displayName="@mantine/core/InputLabel";var wJ=uo((e,t,{size:n})=>({error:{wordBreak:"break-word",color:e.fn.variant({variant:"filled",color:"red"}).background,fontSize:`calc(${Ut({size:n,sizes:e.fontSizes})} - ${Ge(2)})`,lineHeight:1.2,display:"block"}}));const SJ=wJ;var CJ=Object.defineProperty,Mm=Object.getOwnPropertySymbols,LO=Object.prototype.hasOwnProperty,BO=Object.prototype.propertyIsEnumerable,Z_=(e,t,n)=>t in e?CJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_J=(e,t)=>{for(var n in t||(t={}))LO.call(t,n)&&Z_(e,n,t[n]);if(Mm)for(var n of Mm(t))BO.call(t,n)&&Z_(e,n,t[n]);return e},kJ=(e,t)=>{var n={};for(var r in e)LO.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&&BO.call(e,r)&&(n[r]=e[r]);return n};const PJ={size:"sm"},Dx=p.forwardRef((e,t)=>{const n=zr("InputError",PJ,e),{children:r,className:o,classNames:s,styles:a,unstyled:c,size:d,__staticSelector:f,variant:h}=n,m=kJ(n,["children","className","classNames","styles","unstyled","size","__staticSelector","variant"]),{classes:v,cx:y}=SJ(null,{name:["InputWrapper",f],classNames:s,styles:a,unstyled:c,variant:h,size:d});return F.createElement(Ug,_J({className:y(v.error,o),ref:t},m),r)});Dx.displayName="@mantine/core/InputError";var jJ=uo((e,t,{size:n})=>({description:{wordBreak:"break-word",color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],fontSize:`calc(${Ut({size:n,sizes:e.fontSizes})} - ${Ge(2)})`,lineHeight:1.2,display:"block"}}));const EJ=jJ;var IJ=Object.defineProperty,Dm=Object.getOwnPropertySymbols,FO=Object.prototype.hasOwnProperty,HO=Object.prototype.propertyIsEnumerable,Q_=(e,t,n)=>t in e?IJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,OJ=(e,t)=>{for(var n in t||(t={}))FO.call(t,n)&&Q_(e,n,t[n]);if(Dm)for(var n of Dm(t))HO.call(t,n)&&Q_(e,n,t[n]);return e},TJ=(e,t)=>{var n={};for(var r in e)FO.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&&HO.call(e,r)&&(n[r]=e[r]);return n};const RJ={size:"sm"},Ax=p.forwardRef((e,t)=>{const n=zr("InputDescription",RJ,e),{children:r,className:o,classNames:s,styles:a,unstyled:c,size:d,__staticSelector:f,variant:h}=n,m=TJ(n,["children","className","classNames","styles","unstyled","size","__staticSelector","variant"]),{classes:v,cx:y}=EJ(null,{name:["InputWrapper",f],classNames:s,styles:a,unstyled:c,variant:h,size:d});return F.createElement(Ug,OJ({color:"dimmed",className:y(v.description,o),ref:t,unstyled:c},m),r)});Ax.displayName="@mantine/core/InputDescription";const VO=p.createContext({offsetBottom:!1,offsetTop:!1,describedBy:void 0}),MJ=VO.Provider,DJ=()=>p.useContext(VO);function AJ(e,{hasDescription:t,hasError:n}){const r=e.findIndex(d=>d==="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 NJ=Object.defineProperty,zJ=Object.defineProperties,$J=Object.getOwnPropertyDescriptors,J_=Object.getOwnPropertySymbols,LJ=Object.prototype.hasOwnProperty,BJ=Object.prototype.propertyIsEnumerable,ek=(e,t,n)=>t in e?NJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,FJ=(e,t)=>{for(var n in t||(t={}))LJ.call(t,n)&&ek(e,n,t[n]);if(J_)for(var n of J_(t))BJ.call(t,n)&&ek(e,n,t[n]);return e},HJ=(e,t)=>zJ(e,$J(t)),VJ=uo(e=>({root:HJ(FJ({},e.fn.fontStyles()),{lineHeight:e.lineHeight})}));const WJ=VJ;var UJ=Object.defineProperty,GJ=Object.defineProperties,qJ=Object.getOwnPropertyDescriptors,Am=Object.getOwnPropertySymbols,WO=Object.prototype.hasOwnProperty,UO=Object.prototype.propertyIsEnumerable,tk=(e,t,n)=>t in e?UJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wi=(e,t)=>{for(var n in t||(t={}))WO.call(t,n)&&tk(e,n,t[n]);if(Am)for(var n of Am(t))UO.call(t,n)&&tk(e,n,t[n]);return e},nk=(e,t)=>GJ(e,qJ(t)),YJ=(e,t)=>{var n={};for(var r in e)WO.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&&UO.call(e,r)&&(n[r]=e[r]);return n};const KJ={labelElement:"label",size:"sm",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},GO=p.forwardRef((e,t)=>{const n=zr("InputWrapper",KJ,e),{className:r,label:o,children:s,required:a,id:c,error:d,description:f,labelElement:h,labelProps:m,descriptionProps:v,errorProps:y,classNames:S,styles:x,size:w,inputContainer:_,__staticSelector:k,unstyled:P,inputWrapperOrder:j,withAsterisk:I,variant:O}=n,T=YJ(n,["className","label","children","required","id","error","description","labelElement","labelProps","descriptionProps","errorProps","classNames","styles","size","inputContainer","__staticSelector","unstyled","inputWrapperOrder","withAsterisk","variant"]),{classes:R,cx:M}=WJ(null,{classNames:S,styles:x,name:["InputWrapper",k],unstyled:P,variant:O,size:w}),D={classNames:S,styles:x,unstyled:P,size:w,variant:O,__staticSelector:k},A=typeof I=="boolean"?I:a,G=c?`${c}-error`:y==null?void 0:y.id,$=c?`${c}-description`:v==null?void 0:v.id,U=`${!!d&&typeof d!="boolean"?G:""} ${f?$:""}`,q=U.trim().length>0?U.trim():void 0,z=o&&F.createElement(Mx,wi(wi({key:"label",labelElement:h,id:c?`${c}-label`:void 0,htmlFor:c,required:A},D),m),o),L=f&&F.createElement(Ax,nk(wi(wi({key:"description"},v),D),{size:(v==null?void 0:v.size)||D.size,id:(v==null?void 0:v.id)||$}),f),V=F.createElement(p.Fragment,{key:"input"},_(s)),W=typeof d!="boolean"&&d&&F.createElement(Dx,nk(wi(wi({},y),D),{size:(y==null?void 0:y.size)||D.size,key:"error",id:(y==null?void 0:y.id)||G}),d),te=j.map(fe=>{switch(fe){case"label":return z;case"input":return V;case"description":return L;case"error":return W;default:return null}});return F.createElement(MJ,{value:wi({describedBy:q},AJ(j,{hasDescription:!!L,hasError:!!W}))},F.createElement(Do,wi({className:M(R.root,r),ref:t},T),te))});GO.displayName="@mantine/core/InputWrapper";var XJ=Object.defineProperty,Nm=Object.getOwnPropertySymbols,qO=Object.prototype.hasOwnProperty,YO=Object.prototype.propertyIsEnumerable,rk=(e,t,n)=>t in e?XJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ZJ=(e,t)=>{for(var n in t||(t={}))qO.call(t,n)&&rk(e,n,t[n]);if(Nm)for(var n of Nm(t))YO.call(t,n)&&rk(e,n,t[n]);return e},QJ=(e,t)=>{var n={};for(var r in e)qO.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Nm)for(var r of Nm(e))t.indexOf(r)<0&&YO.call(e,r)&&(n[r]=e[r]);return n};const JJ={},KO=p.forwardRef((e,t)=>{const n=zr("InputPlaceholder",JJ,e),{sx:r}=n,o=QJ(n,["sx"]);return F.createElement(Do,ZJ({component:"span",sx:[s=>s.fn.placeholderStyles(),...eI(r)],ref:t},o))});KO.displayName="@mantine/core/InputPlaceholder";var eee=Object.defineProperty,tee=Object.defineProperties,nee=Object.getOwnPropertyDescriptors,ok=Object.getOwnPropertySymbols,ree=Object.prototype.hasOwnProperty,oee=Object.prototype.propertyIsEnumerable,sk=(e,t,n)=>t in e?eee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qp=(e,t)=>{for(var n in t||(t={}))ree.call(t,n)&&sk(e,n,t[n]);if(ok)for(var n of ok(t))oee.call(t,n)&&sk(e,n,t[n]);return e},e1=(e,t)=>tee(e,nee(t));const ds={xs:Ge(30),sm:Ge(36),md:Ge(42),lg:Ge(50),xl:Ge(60)},see=["default","filled","unstyled"];function aee({theme:e,variant:t}){return see.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 iee=uo((e,{multiline:t,radius:n,invalid:r,rightSectionWidth:o,withRightSection:s,iconWidth:a,offsetBottom:c,offsetTop:d,pointer:f},{variant:h,size:m})=>{const v=e.fn.variant({variant:"filled",color:"red"}).background,y=h==="default"||h==="filled"?{minHeight:Ut({size:m,sizes:ds}),paddingLeft:`calc(${Ut({size:m,sizes:ds})} / 3)`,paddingRight:s?o||Ut({size:m,sizes:ds}):`calc(${Ut({size:m,sizes:ds})} / 3)`,borderRadius:e.fn.radius(n)}:h==="unstyled"&&s?{paddingRight:o||Ut({size:m,sizes:ds})}:null;return{wrapper:{position:"relative",marginTop:d?`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:e1(qp(qp(e1(qp({},e.fn.fontStyles()),{height:t?h==="unstyled"?void 0:"auto":Ut({size:m,sizes:ds}),WebkitTapHighlightColor:"transparent",lineHeight:t?e.lineHeight:`calc(${Ut({size:m,sizes:ds})} - ${Ge(2)})`,appearance:"none",resize:"none",boxSizing:"border-box",fontSize:Ut({size:m,sizes:e.fontSizes}),width:"100%",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,display:"block",textAlign:"left",cursor:f?"pointer":void 0}),aee({theme:e,variant:h})),y),{"&: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 a=="number"?Ge(a):Ut({size:m,sizes:ds})},"&::placeholder":e1(qp({},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:a?Ge(a):Ut({size:m,sizes:ds}),color:r?e.colors.red[e.colorScheme==="dark"?6:7]:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[5]},rightSection:{position:"absolute",top:0,bottom:0,right:0,display:"flex",alignItems:"center",justifyContent:"center",width:o||Ut({size:m,sizes:ds})}}});const lee=iee;var cee=Object.defineProperty,uee=Object.defineProperties,dee=Object.getOwnPropertyDescriptors,zm=Object.getOwnPropertySymbols,XO=Object.prototype.hasOwnProperty,ZO=Object.prototype.propertyIsEnumerable,ak=(e,t,n)=>t in e?cee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Yp=(e,t)=>{for(var n in t||(t={}))XO.call(t,n)&&ak(e,n,t[n]);if(zm)for(var n of zm(t))ZO.call(t,n)&&ak(e,n,t[n]);return e},ik=(e,t)=>uee(e,dee(t)),fee=(e,t)=>{var n={};for(var r in e)XO.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&zm)for(var r of zm(e))t.indexOf(r)<0&&ZO.call(e,r)&&(n[r]=e[r]);return n};const pee={size:"sm",variant:"default"},Zl=p.forwardRef((e,t)=>{const n=zr("Input",pee,e),{className:r,error:o,required:s,disabled:a,variant:c,icon:d,style:f,rightSectionWidth:h,iconWidth:m,rightSection:v,rightSectionProps:y,radius:S,size:x,wrapperProps:w,classNames:_,styles:k,__staticSelector:P,multiline:j,sx:I,unstyled:O,pointer:T}=n,R=fee(n,["className","error","required","disabled","variant","icon","style","rightSectionWidth","iconWidth","rightSection","rightSectionProps","radius","size","wrapperProps","classNames","styles","__staticSelector","multiline","sx","unstyled","pointer"]),{offsetBottom:M,offsetTop:D,describedBy:A}=DJ(),{classes:G,cx:$}=lee({radius:S,multiline:j,invalid:!!o,rightSectionWidth:h?Ge(h):void 0,iconWidth:m,withRightSection:!!v,offsetBottom:M,offsetTop:D,pointer:T},{classNames:_,styles:k,name:["Input",P],unstyled:O,variant:c,size:x}),{systemStyles:H,rest:U}=Wg(R);return F.createElement(Do,Yp(Yp({className:$(G.wrapper,r),sx:I,style:f},H),w),d&&F.createElement("div",{className:G.icon},d),F.createElement(Do,ik(Yp({component:"input"},U),{ref:t,required:s,"aria-invalid":!!o,"aria-describedby":A,disabled:a,"data-disabled":a||void 0,"data-with-icon":!!d||void 0,"data-invalid":!!o||void 0,className:G.input})),v&&F.createElement("div",ik(Yp({},y),{className:G.rightSection}),v))});Zl.displayName="@mantine/core/Input";Zl.Wrapper=GO;Zl.Label=Mx;Zl.Description=Ax;Zl.Error=Dx;Zl.Placeholder=KO;const $m=Zl,QO={xs:Ge(16),sm:Ge(22),md:Ge(26),lg:Ge(30),xl:Ge(36)},hee={xs:Ge(10),sm:Ge(12),md:Ge(14),lg:Ge(16),xl:Ge(18)};var mee=uo((e,{disabled:t,radius:n,readOnly:r},{size:o,variant:s})=>({defaultValue:{display:"flex",alignItems:"center",backgroundColor:t?e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[3]:e.colorScheme==="dark"?e.colors.dark[7]:s==="filled"?e.white:e.colors.gray[1],color:t?e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7]:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],height:Ut({size:o,sizes:QO}),paddingLeft:`calc(${Ut({size:o,sizes:e.spacing})} / 1.5)`,paddingRight:t||r?Ut({size:o,sizes:e.spacing}):0,fontWeight:500,fontSize:Ut({size:o,sizes:hee}),borderRadius:Ut({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(${Ut({size:o,sizes:e.spacing})} / 6)`},defaultValueLabel:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}));const gee=mee;var vee=Object.defineProperty,Lm=Object.getOwnPropertySymbols,JO=Object.prototype.hasOwnProperty,eT=Object.prototype.propertyIsEnumerable,lk=(e,t,n)=>t in e?vee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yee=(e,t)=>{for(var n in t||(t={}))JO.call(t,n)&&lk(e,n,t[n]);if(Lm)for(var n of Lm(t))eT.call(t,n)&&lk(e,n,t[n]);return e},bee=(e,t)=>{var n={};for(var r in e)JO.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&&eT.call(e,r)&&(n[r]=e[r]);return n};const xee={xs:16,sm:22,md:24,lg:26,xl:30};function tT(e){var t=e,{label:n,classNames:r,styles:o,className:s,onRemove:a,disabled:c,readOnly:d,size:f,radius:h="sm",variant:m,unstyled:v}=t,y=bee(t,["label","classNames","styles","className","onRemove","disabled","readOnly","size","radius","variant","unstyled"]);const{classes:S,cx:x}=gee({disabled:c,readOnly:d,radius:h},{name:"MultiSelect",classNames:r,styles:o,unstyled:v,size:f,variant:m});return F.createElement("div",yee({className:x(S.defaultValue,s)},y),F.createElement("span",{className:S.defaultValueLabel},n),!c&&!d&&F.createElement(BI,{"aria-hidden":!0,onMouseDown:a,size:xee[f],radius:2,color:"blue",variant:"transparent",iconSize:"70%",className:S.defaultValueRemove,tabIndex:-1,unstyled:v}))}tT.displayName="@mantine/core/MultiSelect/DefaultValue";function wee({data:e,searchable:t,limit:n,searchValue:r,filter:o,value:s,disableSelectedItemFiltering:a}){if(!t&&s.length===0)return e;if(!t){const d=[];for(let f=0;f<e.length;f+=1)(a||!s.some(h=>h===e[f].value&&!e[f].disabled))&&d.push(e[f]);return d}const c=[];for(let d=0;d<e.length&&(o(r,!a&&s.some(f=>f===e[d].value&&!e[d].disabled),e[d])&&c.push(e[d]),!(c.length>=n));d+=1);return c}var See=Object.defineProperty,Bm=Object.getOwnPropertySymbols,nT=Object.prototype.hasOwnProperty,rT=Object.prototype.propertyIsEnumerable,ck=(e,t,n)=>t in e?See(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,uk=(e,t)=>{for(var n in t||(t={}))nT.call(t,n)&&ck(e,n,t[n]);if(Bm)for(var n of Bm(t))rT.call(t,n)&&ck(e,n,t[n]);return e},Cee=(e,t)=>{var n={};for(var r in e)nT.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&&rT.call(e,r)&&(n[r]=e[r]);return n};const _ee={xs:Ge(14),sm:Ge(18),md:Ge(20),lg:Ge(24),xl:Ge(28)};function kee(e){var t=e,{size:n,error:r,style:o}=t,s=Cee(t,["size","error","style"]);const a=si(),c=Ut({size:n,sizes:_ee});return F.createElement("svg",uk({width:c,height:c,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:uk({color:r?a.colors.red[6]:a.colors.gray[6]},o),"data-chevron":!0},s),F.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 Pee=Object.defineProperty,jee=Object.defineProperties,Eee=Object.getOwnPropertyDescriptors,dk=Object.getOwnPropertySymbols,Iee=Object.prototype.hasOwnProperty,Oee=Object.prototype.propertyIsEnumerable,fk=(e,t,n)=>t in e?Pee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Tee=(e,t)=>{for(var n in t||(t={}))Iee.call(t,n)&&fk(e,n,t[n]);if(dk)for(var n of dk(t))Oee.call(t,n)&&fk(e,n,t[n]);return e},Ree=(e,t)=>jee(e,Eee(t));function oT({shouldClear:e,clearButtonProps:t,onClear:n,size:r,error:o}){return e?F.createElement(BI,Ree(Tee({},t),{variant:"transparent",onClick:n,size:r,onMouseDown:s=>s.preventDefault()})):F.createElement(kee,{error:o,size:r})}oT.displayName="@mantine/core/SelectRightSection";var Mee=Object.defineProperty,Dee=Object.defineProperties,Aee=Object.getOwnPropertyDescriptors,Fm=Object.getOwnPropertySymbols,sT=Object.prototype.hasOwnProperty,aT=Object.prototype.propertyIsEnumerable,pk=(e,t,n)=>t in e?Mee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,t1=(e,t)=>{for(var n in t||(t={}))sT.call(t,n)&&pk(e,n,t[n]);if(Fm)for(var n of Fm(t))aT.call(t,n)&&pk(e,n,t[n]);return e},hk=(e,t)=>Dee(e,Aee(t)),Nee=(e,t)=>{var n={};for(var r in e)sT.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&&aT.call(e,r)&&(n[r]=e[r]);return n};function iT(e){var t=e,{styles:n,rightSection:r,rightSectionWidth:o,theme:s}=t,a=Nee(t,["styles","rightSection","rightSectionWidth","theme"]);if(r)return{rightSection:r,rightSectionWidth:o,styles:n};const c=typeof n=="function"?n(s):n;return{rightSection:!a.readOnly&&!(a.disabled&&a.shouldClear)&&F.createElement(oT,t1({},a)),styles:hk(t1({},c),{rightSection:hk(t1({},c==null?void 0:c.rightSection),{pointerEvents:a.shouldClear?void 0:"none"})})}}var zee=Object.defineProperty,$ee=Object.defineProperties,Lee=Object.getOwnPropertyDescriptors,mk=Object.getOwnPropertySymbols,Bee=Object.prototype.hasOwnProperty,Fee=Object.prototype.propertyIsEnumerable,gk=(e,t,n)=>t in e?zee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Hee=(e,t)=>{for(var n in t||(t={}))Bee.call(t,n)&&gk(e,n,t[n]);if(mk)for(var n of mk(t))Fee.call(t,n)&&gk(e,n,t[n]);return e},Vee=(e,t)=>$ee(e,Lee(t)),Wee=uo((e,{invalid:t},{size:n})=>({wrapper:{position:"relative","&:has(input:disabled)":{cursor:"not-allowed",pointerEvents:"none","& .mantine-MultiSelect-input":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[1],color:e.colors.dark[2],opacity:.6,"&::placeholder":{color:e.colors.dark[2]}},"& .mantine-MultiSelect-defaultValue":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[3],color:e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7]}}},values:{minHeight:`calc(${Ut({size:n,sizes:ds})} - ${Ge(2)})`,display:"flex",alignItems:"center",flexWrap:"wrap",marginLeft:`calc(-${e.spacing.xs} / 2)`,boxSizing:"border-box","&[data-clearable]":{marginRight:Ut({size:n,sizes:ds})}},value:{margin:`calc(${e.spacing.xs} / 2 - ${Ge(2)}) calc(${e.spacing.xs} / 2)`},searchInput:Vee(Hee({},e.fn.fontStyles()),{flex:1,minWidth:Ge(60),backgroundColor:"transparent",border:0,outline:0,fontSize:Ut({size:n,sizes:e.fontSizes}),padding:0,marginLeft:`calc(${e.spacing.xs} / 2)`,appearance:"none",color:"inherit",maxHeight:Ut({size:n,sizes:QO}),"&::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 Uee=Wee;var Gee=Object.defineProperty,qee=Object.defineProperties,Yee=Object.getOwnPropertyDescriptors,Hm=Object.getOwnPropertySymbols,lT=Object.prototype.hasOwnProperty,cT=Object.prototype.propertyIsEnumerable,vk=(e,t,n)=>t in e?Gee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xc=(e,t)=>{for(var n in t||(t={}))lT.call(t,n)&&vk(e,n,t[n]);if(Hm)for(var n of Hm(t))cT.call(t,n)&&vk(e,n,t[n]);return e},yk=(e,t)=>qee(e,Yee(t)),Kee=(e,t)=>{var n={};for(var r in e)lT.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&&cT.call(e,r)&&(n[r]=e[r]);return n};function Xee(e,t,n){return t?!1:n.label.toLowerCase().trim().includes(e.toLowerCase().trim())}function Zee(e,t){return!!e&&!t.some(n=>n.value.toLowerCase()===e.toLowerCase())}function bk(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 Qee={size:"sm",valueComponent:tT,itemComponent:Px,transitionProps:{transition:"fade",duration:0},maxDropdownHeight:220,shadow:"sm",searchable:!1,filter:Xee,limit:1/0,clearSearchOnChange:!0,clearable:!1,clearSearchOnBlur:!1,disabled:!1,initiallyOpened:!1,creatable:!1,shouldCreate:Zee,switchDirectionOnFlip:!1,zIndex:Sx("popover"),selectOnBlur:!1,positionDependencies:[],dropdownPosition:"flip"},uT=p.forwardRef((e,t)=>{const n=zr("MultiSelect",Qee,e),{className:r,style:o,required:s,label:a,description:c,size:d,error:f,classNames:h,styles:m,wrapperProps:v,value:y,defaultValue:S,data:x,onChange:w,valueComponent:_,itemComponent:k,id:P,transitionProps:j,maxDropdownHeight:I,shadow:O,nothingFound:T,onFocus:R,onBlur:M,searchable:D,placeholder:A,filter:G,limit:$,clearSearchOnChange:H,clearable:U,clearSearchOnBlur:q,variant:z,onSearchChange:L,searchValue:V,disabled:W,initiallyOpened:te,radius:fe,icon:ae,rightSection:J,rightSectionWidth:B,creatable:oe,getCreateLabel:le,shouldCreate:ge,onCreate:se,sx:pe,dropdownComponent:ue,onDropdownClose:be,onDropdownOpen:ke,maxSelectedValues:ie,withinPortal:Pe,switchDirectionOnFlip:Je,zIndex:Ae,selectOnBlur:Ve,name:kt,dropdownPosition:ft,errorProps:yn,labelProps:K,descriptionProps:Ce,form:ne,positionDependencies:me,onKeyDown:Re,unstyled:Ye,inputContainer:ye,inputWrapperOrder:lt,readOnly:It,withAsterisk:Xt,clearButtonProps:$e,hoverOnSearchChange:Ke,disableSelectedItemFiltering:Cn}=n,Ee=Kee(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","switchDirectionOnFlip","zIndex","selectOnBlur","name","dropdownPosition","errorProps","labelProps","descriptionProps","form","positionDependencies","onKeyDown","unstyled","inputContainer","inputWrapperOrder","readOnly","withAsterisk","clearButtonProps","hoverOnSearchChange","disableSelectedItemFiltering"]),{classes:qe,cx:pt,theme:gt}=Uee({invalid:!!f},{name:"MultiSelect",classNames:h,styles:m,unstyled:Ye,size:d,variant:z}),{systemStyles:Ht,rest:yr}=Wg(Ee),hn=p.useRef(),mn=p.useRef({}),Tr=_x(P),[$n,Fn]=p.useState(te),[Es,_n]=p.useState(-1),[Jo,es]=p.useState("column"),[er,Is]=Kd({value:V,defaultValue:"",finalValue:void 0,onChange:L}),[ci,$r]=p.useState(!1),{scrollIntoView:ts,targetRef:Oa,scrollableRef:ui}=dI({duration:0,offset:5,cancelable:!1,isList:!0}),Os=oe&&typeof le=="function";let Z=null;const ee=x.map(Me=>typeof Me=="string"?{label:Me,value:Me}:Me),ve=tI({data:ee}),[Se,_e]=Kd({value:bk(y,x),defaultValue:bk(S,x),finalValue:[],onChange:w}),rt=p.useRef(!!ie&&ie<Se.length),St=Me=>{if(!It){const Ct=Se.filter(Bt=>Bt!==Me);_e(Ct),ie&&Ct.length<ie&&(rt.current=!1)}},Gt=Me=>{Is(Me.currentTarget.value),!W&&!rt.current&&D&&Fn(!0)},yt=Me=>{typeof R=="function"&&R(Me),!W&&!rt.current&&D&&Fn(!0)},Xe=wee({data:ve,searchable:D,searchValue:er,limit:$,filter:G,value:Se,disableSelectedItemFiltering:Cn});Os&&ge(er,ve)&&(Z=le(er),Xe.push({label:er,value:er,creatable:!0}));const tt=Math.min(Es,Xe.length-1),je=(Me,Ct,Bt)=>{let Ft=Me;for(;Bt(Ft);)if(Ft=Ct(Ft),!Xe[Ft].disabled)return Ft;return Me};Gs(()=>{_n(Ke&&er?0:-1)},[er,Ke]),Gs(()=>{!W&&Se.length>x.length&&Fn(!1),ie&&Se.length<ie&&(rt.current=!1),ie&&Se.length>=ie&&(rt.current=!0,Fn(!1))},[Se]);const Ze=Me=>{if(!It)if(H&&Is(""),Se.includes(Me.value))St(Me.value);else{if(Me.creatable&&typeof se=="function"){const Ct=se(Me.value);typeof Ct<"u"&&Ct!==null&&_e(typeof Ct=="string"?[...Se,Ct]:[...Se,Ct.value])}else _e([...Se,Me.value]);Se.length===ie-1&&(rt.current=!0,Fn(!1)),Xe.length===1&&Fn(!1)}},Ot=Me=>{typeof M=="function"&&M(Me),Ve&&Xe[tt]&&$n&&Ze(Xe[tt]),q&&Is(""),Fn(!1)},Rt=Me=>{if(ci||(Re==null||Re(Me),It)||Me.key!=="Backspace"&&ie&&rt.current)return;const Ct=Jo==="column",Bt=()=>{_n(qt=>{var kn;const tn=je(qt,dn=>dn+1,dn=>dn<Xe.length-1);return $n&&(Oa.current=mn.current[(kn=Xe[tn])==null?void 0:kn.value],ts({alignment:Ct?"end":"start"})),tn})},Ft=()=>{_n(qt=>{var kn;const tn=je(qt,dn=>dn-1,dn=>dn>0);return $n&&(Oa.current=mn.current[(kn=Xe[tn])==null?void 0:kn.value],ts({alignment:Ct?"start":"end"})),tn})};switch(Me.key){case"ArrowUp":{Me.preventDefault(),Fn(!0),Ct?Ft():Bt();break}case"ArrowDown":{Me.preventDefault(),Fn(!0),Ct?Bt():Ft();break}case"Enter":{Me.preventDefault(),Xe[tt]&&$n?Ze(Xe[tt]):Fn(!0);break}case" ":{D||(Me.preventDefault(),Xe[tt]&&$n?Ze(Xe[tt]):Fn(!0));break}case"Backspace":{Se.length>0&&er.length===0&&(_e(Se.slice(0,-1)),Fn(!0),ie&&(rt.current=!1));break}case"Home":{if(!D){Me.preventDefault(),$n||Fn(!0);const qt=Xe.findIndex(kn=>!kn.disabled);_n(qt),ts({alignment:Ct?"end":"start"})}break}case"End":{if(!D){Me.preventDefault(),$n||Fn(!0);const qt=Xe.map(kn=>!!kn.disabled).lastIndexOf(!1);_n(qt),ts({alignment:Ct?"end":"start"})}break}case"Escape":Fn(!1)}},$t=Se.map(Me=>{let Ct=ve.find(Bt=>Bt.value===Me&&!Bt.disabled);return!Ct&&Os&&(Ct={value:Me,label:Me}),Ct}).filter(Me=>!!Me).map((Me,Ct)=>F.createElement(_,yk(xc({},Me),{variant:z,disabled:W,className:qe.value,readOnly:It,onRemove:Bt=>{Bt.preventDefault(),Bt.stopPropagation(),St(Me.value)},key:Me.value,size:d,styles:m,classNames:h,radius:fe,index:Ct}))),Yt=Me=>Se.includes(Me),nn=()=>{var Me;Is(""),_e([]),(Me=hn.current)==null||Me.focus(),ie&&(rt.current=!1)},Kt=!It&&(Xe.length>0?$n:$n&&!!T);return Gs(()=>{const Me=Kt?ke:be;typeof Me=="function"&&Me()},[Kt]),F.createElement($m.Wrapper,xc(xc({required:s,id:Tr,label:a,error:f,description:c,size:d,className:r,style:o,classNames:h,styles:m,__staticSelector:"MultiSelect",sx:pe,errorProps:yn,descriptionProps:Ce,labelProps:K,inputContainer:ye,inputWrapperOrder:lt,unstyled:Ye,withAsterisk:Xt,variant:z},Ht),v),F.createElement(Ai,{opened:Kt,transitionProps:j,shadow:"sm",withinPortal:Pe,__staticSelector:"MultiSelect",onDirectionChange:es,switchDirectionOnFlip:Je,zIndex:Ae,dropdownPosition:ft,positionDependencies:[...me,er],classNames:h,styles:m,unstyled:Ye,variant:z},F.createElement(Ai.Target,null,F.createElement("div",{className:qe.wrapper,role:"combobox","aria-haspopup":"listbox","aria-owns":$n&&Kt?`${Tr}-items`:null,"aria-controls":Tr,"aria-expanded":$n,onMouseLeave:()=>_n(-1),tabIndex:-1},F.createElement("input",{type:"hidden",name:kt,value:Se.join(","),form:ne,disabled:W}),F.createElement($m,xc({__staticSelector:"MultiSelect",style:{overflow:"hidden"},component:"div",multiline:!0,size:d,variant:z,disabled:W,error:f,required:s,radius:fe,icon:ae,unstyled:Ye,onMouseDown:Me=>{var Ct;Me.preventDefault(),!W&&!rt.current&&Fn(!$n),(Ct=hn.current)==null||Ct.focus()},classNames:yk(xc({},h),{input:pt({[qe.input]:!D},h==null?void 0:h.input)})},iT({theme:gt,rightSection:J,rightSectionWidth:B,styles:m,size:d,shouldClear:U&&Se.length>0,onClear:nn,error:f,disabled:W,clearButtonProps:$e,readOnly:It})),F.createElement("div",{className:qe.values,"data-clearable":U||void 0},$t,F.createElement("input",xc({ref:Vg(t,hn),type:"search",id:Tr,className:pt(qe.searchInput,{[qe.searchInputPointer]:!D,[qe.searchInputInputHidden]:!$n&&Se.length>0||!D&&Se.length>0,[qe.searchInputEmpty]:Se.length===0}),onKeyDown:Rt,value:er,onChange:Gt,onFocus:yt,onBlur:Ot,readOnly:!D||rt.current||It,placeholder:Se.length===0?A:void 0,disabled:W,"data-mantine-stop-propagation":$n,autoComplete:"off",onCompositionStart:()=>$r(!0),onCompositionEnd:()=>$r(!1)},yr)))))),F.createElement(Ai.Dropdown,{component:ue||Kg,maxHeight:I,direction:Jo,id:Tr,innerRef:ui,__staticSelector:"MultiSelect",classNames:h,styles:m},F.createElement(kx,{data:Xe,hovered:tt,classNames:h,styles:m,uuid:Tr,__staticSelector:"MultiSelect",onItemHover:_n,onItemSelect:Ze,itemsRefs:mn,itemComponent:k,size:d,nothingFound:T,isItemSelected:Yt,creatable:oe&&!!Z,createLabel:Z,unstyled:Ye,variant:z}))))});uT.displayName="@mantine/core/MultiSelect";function Jee({data:e,searchable:t,limit:n,searchValue:r,filter:o,value:s,filterDataOnExactSearchMatch:a}){if(!t)return e;const c=s!=null&&e.find(f=>f.value===s)||null;if(c&&!a&&(c==null?void 0:c.label)===r){if(n){if(n>=e.length)return e;const f=e.indexOf(c),h=f+n,m=h-e.length;return m>0?e.slice(f-m):e.slice(f,h)}return e}const d=[];for(let f=0;f<e.length&&(o(r,e[f])&&d.push(e[f]),!(d.length>=n));f+=1);return d}var ete=uo(()=>({input:{"&:not(:disabled)":{cursor:"pointer","&::selection":{backgroundColor:"transparent"}}}}));const tte=ete;var nte=Object.defineProperty,rte=Object.defineProperties,ote=Object.getOwnPropertyDescriptors,Vm=Object.getOwnPropertySymbols,dT=Object.prototype.hasOwnProperty,fT=Object.prototype.propertyIsEnumerable,xk=(e,t,n)=>t in e?nte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Qu=(e,t)=>{for(var n in t||(t={}))dT.call(t,n)&&xk(e,n,t[n]);if(Vm)for(var n of Vm(t))fT.call(t,n)&&xk(e,n,t[n]);return e},n1=(e,t)=>rte(e,ote(t)),ste=(e,t)=>{var n={};for(var r in e)dT.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&&fT.call(e,r)&&(n[r]=e[r]);return n};function ate(e,t){return t.label.toLowerCase().trim().includes(e.toLowerCase().trim())}function ite(e,t){return!!e&&!t.some(n=>n.label.toLowerCase()===e.toLowerCase())}const lte={required:!1,size:"sm",shadow:"sm",itemComponent:Px,transitionProps:{transition:"fade",duration:0},initiallyOpened:!1,filter:ate,maxDropdownHeight:220,searchable:!1,clearable:!1,limit:1/0,disabled:!1,creatable:!1,shouldCreate:ite,selectOnBlur:!1,switchDirectionOnFlip:!1,filterDataOnExactSearchMatch:!1,zIndex:Sx("popover"),positionDependencies:[],dropdownPosition:"flip"},pT=p.forwardRef((e,t)=>{const n=hJ("Select",lte,e),{inputProps:r,wrapperProps:o,shadow:s,data:a,value:c,defaultValue:d,onChange:f,itemComponent:h,onKeyDown:m,onBlur:v,onFocus:y,transitionProps:S,initiallyOpened:x,unstyled:w,classNames:_,styles:k,filter:P,maxDropdownHeight:j,searchable:I,clearable:O,nothingFound:T,limit:R,disabled:M,onSearchChange:D,searchValue:A,rightSection:G,rightSectionWidth:$,creatable:H,getCreateLabel:U,shouldCreate:q,selectOnBlur:z,onCreate:L,dropdownComponent:V,onDropdownClose:W,onDropdownOpen:te,withinPortal:fe,portalProps:ae,switchDirectionOnFlip:J,zIndex:B,name:oe,dropdownPosition:le,allowDeselect:ge,placeholder:se,filterDataOnExactSearchMatch:pe,form:ue,positionDependencies:be,readOnly:ke,clearButtonProps:ie,hoverOnSearchChange:Pe}=n,Je=ste(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:Ae,cx:Ve,theme:kt}=tte(),[ft,yn]=p.useState(x),[K,Ce]=p.useState(-1),ne=p.useRef(),me=p.useRef({}),[Re,Ye]=p.useState("column"),ye=Re==="column",{scrollIntoView:lt,targetRef:It,scrollableRef:Xt}=dI({duration:0,offset:5,cancelable:!1,isList:!0}),$e=ge===void 0?O:ge,Ke=ee=>{if(ft!==ee){yn(ee);const ve=ee?te:W;typeof ve=="function"&&ve()}},Cn=H&&typeof U=="function";let Ee=null;const qe=a.map(ee=>typeof ee=="string"?{label:ee,value:ee}:ee),pt=tI({data:qe}),[gt,Ht,yr]=Kd({value:c,defaultValue:d,finalValue:null,onChange:f}),hn=pt.find(ee=>ee.value===gt),[mn,Tr]=Kd({value:A,defaultValue:(hn==null?void 0:hn.label)||"",finalValue:void 0,onChange:D}),$n=ee=>{Tr(ee),I&&typeof D=="function"&&D(ee)},Fn=()=>{var ee;ke||(Ht(null),yr||$n(""),(ee=ne.current)==null||ee.focus())};p.useEffect(()=>{const ee=pt.find(ve=>ve.value===gt);ee?$n(ee.label):(!Cn||!gt)&&$n("")},[gt]),p.useEffect(()=>{hn&&(!I||!ft)&&$n(hn.label)},[hn==null?void 0:hn.label]);const Es=ee=>{if(!ke)if($e&&(hn==null?void 0:hn.value)===ee.value)Ht(null),Ke(!1);else{if(ee.creatable&&typeof L=="function"){const ve=L(ee.value);typeof ve<"u"&&ve!==null&&Ht(typeof ve=="string"?ve:ve.value)}else Ht(ee.value);yr||$n(ee.label),Ce(-1),Ke(!1),ne.current.focus()}},_n=Jee({data:pt,searchable:I,limit:R,searchValue:mn,filter:P,filterDataOnExactSearchMatch:pe,value:gt});Cn&&q(mn,_n)&&(Ee=U(mn),_n.push({label:mn,value:mn,creatable:!0}));const Jo=(ee,ve,Se)=>{let _e=ee;for(;Se(_e);)if(_e=ve(_e),!_n[_e].disabled)return _e;return ee};Gs(()=>{Ce(Pe&&mn?0:-1)},[mn,Pe]);const es=gt?_n.findIndex(ee=>ee.value===gt):0,er=!ke&&(_n.length>0?ft:ft&&!!T),Is=()=>{Ce(ee=>{var ve;const Se=Jo(ee,_e=>_e-1,_e=>_e>0);return It.current=me.current[(ve=_n[Se])==null?void 0:ve.value],er&&lt({alignment:ye?"start":"end"}),Se})},ci=()=>{Ce(ee=>{var ve;const Se=Jo(ee,_e=>_e+1,_e=>_e<_n.length-1);return It.current=me.current[(ve=_n[Se])==null?void 0:ve.value],er&&lt({alignment:ye?"end":"start"}),Se})},$r=()=>window.setTimeout(()=>{var ee;It.current=me.current[(ee=_n[es])==null?void 0:ee.value],lt({alignment:ye?"end":"start"})},50);Gs(()=>{er&&$r()},[er]);const ts=ee=>{switch(typeof m=="function"&&m(ee),ee.key){case"ArrowUp":{ee.preventDefault(),ft?ye?Is():ci():(Ce(es),Ke(!0),$r());break}case"ArrowDown":{ee.preventDefault(),ft?ye?ci():Is():(Ce(es),Ke(!0),$r());break}case"Home":{if(!I){ee.preventDefault(),ft||Ke(!0);const ve=_n.findIndex(Se=>!Se.disabled);Ce(ve),er&&lt({alignment:ye?"end":"start"})}break}case"End":{if(!I){ee.preventDefault(),ft||Ke(!0);const ve=_n.map(Se=>!!Se.disabled).lastIndexOf(!1);Ce(ve),er&&lt({alignment:ye?"end":"start"})}break}case"Escape":{ee.preventDefault(),Ke(!1),Ce(-1);break}case" ":{I||(ee.preventDefault(),_n[K]&&ft?Es(_n[K]):(Ke(!0),Ce(es),$r()));break}case"Enter":I||ee.preventDefault(),_n[K]&&ft&&(ee.preventDefault(),Es(_n[K]))}},Oa=ee=>{typeof v=="function"&&v(ee);const ve=pt.find(Se=>Se.value===gt);z&&_n[K]&&ft&&Es(_n[K]),$n((ve==null?void 0:ve.label)||""),Ke(!1)},ui=ee=>{typeof y=="function"&&y(ee),I&&Ke(!0)},Os=ee=>{ke||($n(ee.currentTarget.value),O&&ee.currentTarget.value===""&&Ht(null),Ce(-1),Ke(!0))},Z=()=>{ke||(Ke(!ft),gt&&!ft&&Ce(es))};return F.createElement($m.Wrapper,n1(Qu({},o),{__staticSelector:"Select"}),F.createElement(Ai,{opened:er,transitionProps:S,shadow:s,withinPortal:fe,portalProps:ae,__staticSelector:"Select",onDirectionChange:Ye,switchDirectionOnFlip:J,zIndex:B,dropdownPosition:le,positionDependencies:[...be,mn],classNames:_,styles:k,unstyled:w,variant:r.variant},F.createElement(Ai.Target,null,F.createElement("div",{role:"combobox","aria-haspopup":"listbox","aria-owns":er?`${r.id}-items`:null,"aria-controls":r.id,"aria-expanded":er,onMouseLeave:()=>Ce(-1),tabIndex:-1},F.createElement("input",{type:"hidden",name:oe,value:gt||"",form:ue,disabled:M}),F.createElement($m,Qu(n1(Qu(Qu({autoComplete:"off",type:"search"},r),Je),{ref:Vg(t,ne),onKeyDown:ts,__staticSelector:"Select",value:mn,placeholder:se,onChange:Os,"aria-autocomplete":"list","aria-controls":er?`${r.id}-items`:null,"aria-activedescendant":K>=0?`${r.id}-${K}`:null,onMouseDown:Z,onBlur:Oa,onFocus:ui,readOnly:!I||ke,disabled:M,"data-mantine-stop-propagation":er,name:null,classNames:n1(Qu({},_),{input:Ve({[Ae.input]:!I},_==null?void 0:_.input)})}),iT({theme:kt,rightSection:G,rightSectionWidth:$,styles:k,size:r.size,shouldClear:O&&!!hn,onClear:Fn,error:o.error,clearButtonProps:ie,disabled:M,readOnly:ke}))))),F.createElement(Ai.Dropdown,{component:V||Kg,maxHeight:j,direction:Re,id:r.id,innerRef:Xt,__staticSelector:"Select",classNames:_,styles:k},F.createElement(kx,{data:_n,hovered:K,classNames:_,styles:k,isItemSelected:ee=>ee===gt,uuid:r.id,__staticSelector:"Select",onItemHover:Ce,onItemSelect:Es,itemsRefs:me,itemComponent:h,size:r.size,nothingFound:T,creatable:Cn&&!!Ee,createLabel:Ee,"aria-label":o.label,unstyled:w,variant:r.variant}))))});pT.displayName="@mantine/core/Select";const hT=()=>{const[e,t,n,r,o,s,a,c,d,f,h,m,v,y,S,x,w,_,k,P,j,I,O,T,R,M,D,A,G,$,H,U,q,z,L,V,W,te]=Wl("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"]);return{base50:e,base100:t,base150:n,base200:r,base250:o,base300:s,base350:a,base400:c,base450:d,base500:f,base550:h,base600:m,base650:v,base700:y,base750:S,base800:x,base850:w,base900:_,base950:k,accent50:P,accent100:j,accent150:I,accent200:O,accent250:T,accent300:R,accent350:M,accent400:D,accent450:A,accent500:G,accent550:$,accent600:H,accent650:U,accent700:q,accent750:z,accent800:L,accent850:V,accent900:W,accent950:te}},cte=e=>{const{searchable:t=!0,tooltip:n,...r}=e,{base50:o,base100:s,base200:a,base300:c,base400:d,base500:f,base600:h,base700:m,base800:v,base900:y,accent200:S,accent300:x,accent400:w,accent500:_,accent600:k}=hT(),{colorMode:P}=zo(),[j]=Wl("shadows",["dark-lg"]);return i.jsx(Wn,{label:n,placement:"top",hasArrow:!0,children:i.jsx(pT,{searchable:t,styles:()=>({label:{color:Fe(m,c)(P),fontWeight:"normal"},input:{backgroundColor:Fe(o,y)(P),borderWidth:"2px",borderColor:Fe(a,v)(P),color:Fe(y,s)(P),paddingRight:24,fontWeight:600,"&:hover":{borderColor:Fe(c,h)(P)},"&:focus":{borderColor:Fe(x,k)(P)},"&:is(:focus, :hover)":{borderColor:Fe(d,f)(P)},"&:focus-within":{borderColor:Fe(S,k)(P)},"&[data-disabled]":{backgroundColor:Fe(c,m)(P),color:Fe(h,d)(P)}},value:{backgroundColor:Fe(s,y)(P),color:Fe(y,s)(P),button:{color:Fe(y,s)(P)},"&:hover":{backgroundColor:Fe(c,m)(P),cursor:"pointer"}},dropdown:{backgroundColor:Fe(a,v)(P),borderColor:Fe(a,v)(P),boxShadow:j},item:{backgroundColor:Fe(a,v)(P),color:Fe(v,a)(P),padding:6,"&[data-hovered]":{color:Fe(y,s)(P),backgroundColor:Fe(c,m)(P)},"&[data-active]":{backgroundColor:Fe(c,m)(P),"&:hover":{color:Fe(y,s)(P),backgroundColor:Fe(c,m)(P)}},"&[data-selected]":{backgroundColor:Fe(w,k)(P),color:Fe(o,s)(P),fontWeight:600,"&:hover":{backgroundColor:Fe(_,_)(P),color:Fe("white",o)(P)}}},rightSection:{width:32,button:{color:Fe(y,s)(P)}}}),...r})})},Er=p.memo(cte);function ute(){const e=Y(o=>o.postprocessing.facetoolType),t=ce(),{t:n}=we(),r=o=>t(x7(o));return i.jsx(Er,{label:n("parameters.type"),data:b7.concat(),value:e,onChange:r})}function dte(){const e=Y(o=>o.system.isGFPGANAvailable),t=Y(o=>o.postprocessing.facetoolStrength),{t:n}=we(),r=ce();return i.jsx(Et,{isDisabled:!e,label:n("parameters.strength"),step:.05,min:0,max:1,onChange:o=>r(Gw(o)),handleReset:()=>r(Gw(.75)),value:t,withReset:!0,withSliderMarks:!0,withInput:!0})}function fte(){const e=Y(o=>o.system.isGFPGANAvailable),t=Y(o=>o.postprocessing.codeformerFidelity),{t:n}=we(),r=ce();return i.jsx(Et,{isDisabled:!e,label:n("parameters.codeformerFidelity"),step:.05,min:0,max:1,onChange:o=>r(qw(o)),handleReset:()=>r(qw(1)),value:t,withReset:!0,withSliderMarks:!0,withInput:!0})}const pte=()=>{const e=Y(t=>t.postprocessing.facetoolType);return i.jsxs(Ar,{gap:2,alignItems:"stretch",children:[i.jsx(ute,{}),i.jsx(dte,{}),e==="codeformer"&&i.jsx(fte,{})]})};function hte(){const e=Y(o=>o.system.isESRGANAvailable),t=Y(o=>o.postprocessing.upscalingDenoising),{t:n}=we(),r=ce();return i.jsx(Et,{label:n("parameters.denoisingStrength"),value:t,min:0,max:1,step:.01,onChange:o=>{r(Yw(o))},handleReset:()=>r(Yw(.75)),withSliderMarks:!0,withInput:!0,withReset:!0,isDisabled:!e})}function mte(){const e=Y(o=>o.system.isESRGANAvailable),t=Y(o=>o.postprocessing.upscalingStrength),{t:n}=we(),r=ce();return i.jsx(Et,{label:`${n("parameters.upscale")} ${n("parameters.strength")}`,value:t,min:0,max:1,step:.05,onChange:o=>r(Kw(o)),handleReset:()=>r(Kw(.75)),withSliderMarks:!0,withInput:!0,withReset:!0,isDisabled:!e})}function gte(){const e=Y(s=>s.system.isESRGANAvailable),t=Y(s=>s.postprocessing.upscalingLevel),{t:n}=we(),r=ce(),o=s=>r(S7(Number(s)));return i.jsx(Er,{disabled:!e,label:n("parameters.scale"),value:String(t),onChange:o,data:w7})}const vte=()=>i.jsxs(Ar,{gap:2,alignItems:"stretch",children:[i.jsx(gte,{}),i.jsx(hte,{}),i.jsx(mte,{})]}),yte=Oe([Bn],({system:e})=>{const{isProcessing:t,isConnected:n}=e;return n&&!t}),bte=e=>{const{onClick:t,isDisabled:n}=e,{t:r}=we(),o=Y(yte);return i.jsx(Ne,{onClick:t,icon:i.jsx(Mo,{}),tooltip:`${r("gallery.deleteImage")} (Del)`,"aria-label":`${r("gallery.deleteImage")} (Del)`,isDisabled:n||!o,colorScheme:"error"})},xte=Oe([Bn,Gr],({gallery:e,system:t,postprocessing:n,ui:r,lightbox:o},s)=>{const{isProcessing:a,isConnected:c,isGFPGANAvailable:d,isESRGANAvailable:f,shouldConfirmOnDelete:h,progressImage:m}=t,{upscalingLevel:v,facetoolStrength:y}=n,{isLightboxOpen:S}=o,{shouldShowImageDetails:x,shouldHidePreview:w,shouldShowProgressInViewer:_}=r,k=e.selection[e.selection.length-1];return{canDeleteImage:c&&!a,shouldConfirmOnDelete:h,isProcessing:a,isConnected:c,isGFPGANAvailable:d,isESRGANAvailable:f,upscalingLevel:v,facetoolStrength:y,shouldDisableToolbarButtons:!!m||!k,shouldShowImageDetails:x,activeTabName:s,isLightboxOpen:S,shouldHidePreview:w,shouldShowProgressInViewer:_,lastSelectedImage:k}},{memoizeOptions:{resultEqualityCheck:en}}),mT=e=>{var te,fe,ae;const t=ce(),{isProcessing:n,isConnected:r,isGFPGANAvailable:o,isESRGANAvailable:s,upscalingLevel:a,facetoolStrength:c,shouldDisableToolbarButtons:d,shouldShowImageDetails:f,isLightboxOpen:h,activeTabName:m,shouldHidePreview:v,lastSelectedImage:y,shouldShowProgressInViewer:S}=Y(xte),x=Jr("lightbox").isFeatureEnabled,w=Jr("unifiedCanvas").isFeatureEnabled,_=Jr("upscaling").isFeatureEnabled,k=Jr("faceRestore").isFeatureEnabled,P=nf(),{t:j}=we(),{recallBothPrompts:I,recallSeed:O,recallAllParameters:T}=yx(),{currentData:R}=xa(y??Ja.skipToken),M=p.useCallback(()=>{const B=(()=>{if(R)return R.image_url.startsWith("http")?R.image_url:window.location.toString()+R.image_url})();if(!B){P({title:j("toast.problemCopyingImageLink"),status:"error",duration:2500,isClosable:!0});return}navigator.clipboard.writeText(B).then(()=>{P({title:j("toast.imageLinkCopied"),status:"success",duration:2500,isClosable:!0})})},[P,j,R]),D=p.useCallback(()=>{T(R)},[R,T]);et("a",()=>{},[R,T]);const A=p.useCallback(()=>{var J;O((J=R==null?void 0:R.metadata)==null?void 0:J.seed)},[R,O]);et("s",A,[R]);const G=p.useCallback(()=>{var J,B;I((J=R==null?void 0:R.metadata)==null?void 0:J.positive_conditioning,(B=R==null?void 0:R.metadata)==null?void 0:B.negative_conditioning)},[R,I]);et("p",G,[R]);const $=p.useCallback(()=>{t(n3()),t(Ch(R))},[t,R]);et("shift+i",$,[R]);const H=p.useCallback(()=>{},[]),U=p.useCallback(()=>{R&&t(Ky(R))},[t,R]);et("Shift+U",()=>{H()},{enabled:()=>!!(_&&s&&!d&&r&&!n&&a)},[_,R,s,d,r,n,a]);const q=p.useCallback(()=>{},[]);et("Shift+R",()=>{q()},{enabled:()=>!!(k&&o&&!d&&r&&!n&&c)},[k,R,o,d,r,n,c]);const z=p.useCallback(()=>t(f3(!f)),[t,f]),L=p.useCallback(()=>{R&&(t(r3()),h&&t(Cd(!1)),t(o3(R)),t(ea()),m!=="unifiedCanvas"&&t(ml("unifiedCanvas")),P({title:j("toast.sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0}))},[R,h,t,m,P,j]);et("i",()=>{R?z():P({title:j("toast.metadataLoadFailed"),status:"error",duration:2500,isClosable:!0})},[R,f,P]);const V=p.useCallback(()=>{t(p3(!S))},[t,S]),W=p.useCallback(()=>{t(Cd(!h))},[t,h]);return i.jsx(i.Fragment,{children:i.jsxs(X,{sx:{flexWrap:"wrap",justifyContent:"center",alignItems:"center",gap:2},...e,children:[i.jsxs(Or,{isAttached:!0,isDisabled:d,children:[i.jsx(Ba,{triggerComponent:i.jsx(Ne,{"aria-label":`${j("parameters.sendTo")}...`,tooltip:`${j("parameters.sendTo")}...`,isDisabled:!R,icon:i.jsx(tU,{})}),children:i.jsxs(X,{sx:{flexDirection:"column",rowGap:2},children:[i.jsx(cn,{size:"sm",onClick:$,leftIcon:i.jsx(Gh,{}),id:"send-to-img2img",children:j("parameters.sendToImg2Img")}),w&&i.jsx(cn,{size:"sm",onClick:L,leftIcon:i.jsx(Gh,{}),id:"send-to-canvas",children:j("parameters.sendToUnifiedCanvas")}),i.jsx(cn,{size:"sm",onClick:M,leftIcon:i.jsx(Cu,{}),children:j("parameters.copyImageToLink")}),i.jsx(wl,{download:!0,href:R==null?void 0:R.image_url,target:"_blank",children:i.jsx(cn,{leftIcon:i.jsx(ux,{}),size:"sm",w:"100%",children:j("parameters.downloadImage")})})]})}),x&&i.jsx(Ne,{icon:i.jsx(dx,{}),tooltip:h?`${j("parameters.closeViewer")} (Z)`:`${j("parameters.openInViewer")} (Z)`,"aria-label":h?`${j("parameters.closeViewer")} (Z)`:`${j("parameters.openInViewer")} (Z)`,isChecked:h,onClick:W,isDisabled:d})]}),i.jsxs(Or,{isAttached:!0,isDisabled:d,children:[i.jsx(Ne,{icon:i.jsx(XW,{}),tooltip:`${j("parameters.usePrompt")} (P)`,"aria-label":`${j("parameters.usePrompt")} (P)`,isDisabled:!((te=R==null?void 0:R.metadata)!=null&&te.positive_conditioning),onClick:G}),i.jsx(Ne,{icon:i.jsx(JW,{}),tooltip:`${j("parameters.useSeed")} (S)`,"aria-label":`${j("parameters.useSeed")} (S)`,isDisabled:!((fe=R==null?void 0:R.metadata)!=null&&fe.seed),onClick:A}),i.jsx(Ne,{icon:i.jsx(TW,{}),tooltip:`${j("parameters.useAll")} (A)`,"aria-label":`${j("parameters.useAll")} (A)`,isDisabled:!["t2l","l2l","inpaint"].includes(String((ae=R==null?void 0:R.metadata)==null?void 0:ae.type)),onClick:D})]}),(_||k)&&i.jsxs(Or,{isAttached:!0,isDisabled:d,children:[k&&i.jsx(Ba,{triggerComponent:i.jsx(Ne,{icon:i.jsx(FW,{}),"aria-label":j("parameters.restoreFaces")}),children:i.jsxs(X,{sx:{flexDirection:"column",rowGap:4},children:[i.jsx(pte,{}),i.jsx(cn,{isDisabled:!o||!R||!(r&&!n)||!c,onClick:q,children:j("parameters.restoreFaces")})]})}),_&&i.jsx(Ba,{triggerComponent:i.jsx(Ne,{icon:i.jsx(zW,{}),"aria-label":j("parameters.upscale")}),children:i.jsxs(X,{sx:{flexDirection:"column",gap:4},children:[i.jsx(vte,{}),i.jsx(cn,{isDisabled:!s||!R||!(r&&!n)||!a,onClick:H,children:j("parameters.upscaleImage")})]})})]}),i.jsx(Or,{isAttached:!0,isDisabled:d,children:i.jsx(Ne,{icon:i.jsx(gE,{}),tooltip:`${j("parameters.info")} (I)`,"aria-label":`${j("parameters.info")} (I)`,isChecked:f,onClick:z})}),i.jsx(Or,{isAttached:!0,isDisabled:d,children:i.jsx(Ne,{"aria-label":j("settings.displayInProgress"),tooltip:j("settings.displayInProgress"),icon:i.jsx(HW,{}),isChecked:S,onClick:V})}),i.jsx(Or,{isAttached:!0,children:i.jsx(bte,{onClick:U,isDisabled:d})})]})})},cs=({label:e,value:t,onClick:n,isLink:r,labelPosition:o,withCopy:s=!1})=>{const{t:a}=we();return t?i.jsxs(X,{gap:2,children:[n&&i.jsx(Wn,{label:`Recall ${e}`,children:i.jsx(Ya,{"aria-label":a("accessibility.useThisParameter"),icon:i.jsx(ph,{}),size:"xs",variant:"ghost",fontSize:20,onClick:n})}),s&&i.jsx(Wn,{label:`Copy ${e}`,children:i.jsx(Ya,{"aria-label":`Copy ${e}`,icon:i.jsx(Cu,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(t.toString())})}),i.jsxs(X,{direction:o?"column":"row",children:[i.jsxs(nt,{fontWeight:"semibold",whiteSpace:"pre-wrap",pr:2,children:[e,":"]}),r?i.jsxs(wl,{href:t.toString(),isExternal:!0,wordBreak:"break-all",children:[t.toString()," ",i.jsx(gx,{mx:"2px"})]}):i.jsx(nt,{overflowY:"scroll",wordBreak:"break-all",children:t.toString()})]})]}):null},wte=({image:e})=>{const t=ce(),{recallBothPrompts:n,recallPositivePrompt:r,recallNegativePrompt:o,recallSeed:s,recallInitialImage:a,recallCfgScale:c,recallModel:d,recallScheduler:f,recallSteps:h,recallWidth:m,recallHeight:v,recallStrength:y,recallAllParameters:S}=yx();et("esc",()=>{t(f3(!1))});const x=e==null?void 0:e.session_id,w=e==null?void 0:e.metadata,{t:_}=we(),k=JSON.stringify(e,null,2);return i.jsxs(X,{sx:{padding:4,gap:1,flexDirection:"column",width:"full",height:"full",backdropFilter:"blur(20px)",bg:"whiteAlpha.600",_dark:{bg:"blackAlpha.600"},overflow:"scroll"},children:[i.jsxs(X,{gap:2,children:[i.jsx(nt,{fontWeight:"semibold",children:"File:"}),i.jsxs(wl,{href:e.image_url,isExternal:!0,maxW:"calc(100% - 3rem)",children:[e.image_name,i.jsx(gx,{mx:"2px"})]})]}),w&&Object.keys(w).length>0?i.jsxs(i.Fragment,{children:[w.type&&i.jsx(cs,{label:"Invocation type",value:w.type}),x&&i.jsx(cs,{label:"Session ID",value:x}),w.positive_conditioning&&i.jsx(cs,{label:"Positive Prompt",labelPosition:"top",value:w.positive_conditioning,onClick:()=>r(w.positive_conditioning)}),w.negative_conditioning&&i.jsx(cs,{label:"Negative Prompt",labelPosition:"top",value:w.negative_conditioning,onClick:()=>o(w.negative_conditioning)}),w.seed!==void 0&&i.jsx(cs,{label:"Seed",value:w.seed,onClick:()=>s(w.seed)}),w.model!==void 0&&i.jsx(cs,{label:"Model",value:w.model,onClick:()=>d(w.model)}),w.width&&i.jsx(cs,{label:"Width",value:w.width,onClick:()=>m(w.width)}),w.height&&i.jsx(cs,{label:"Height",value:w.height,onClick:()=>v(w.height)}),w.scheduler&&i.jsx(cs,{label:"Scheduler",value:w.scheduler,onClick:()=>f(w.scheduler)}),w.steps&&i.jsx(cs,{label:"Steps",value:w.steps,onClick:()=>h(w.steps)}),w.cfg_scale!==void 0&&i.jsx(cs,{label:"CFG scale",value:w.cfg_scale,onClick:()=>c(w.cfg_scale)}),w.strength&&i.jsx(cs,{label:"Image to image strength",value:w.strength,onClick:()=>y(w.strength)})]}):i.jsx(h6,{width:"100%",pt:10,children:i.jsx(nt,{fontSize:"lg",fontWeight:"semibold",children:"No metadata available"})}),i.jsxs(X,{gap:2,direction:"column",overflow:"auto",children:[i.jsxs(X,{gap:2,children:[i.jsx(Wn,{label:"Copy metadata JSON",children:i.jsx(Ya,{"aria-label":_("accessibility.copyMetadataJson"),icon:i.jsx(Cu,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(k)})}),i.jsx(nt,{fontWeight:"semibold",children:"Metadata JSON:"})]}),i.jsx(fE,{defer:!0,children:i.jsx(ut,{sx:{padding:4,borderRadius:"base",bg:"whiteAlpha.500",_dark:{bg:"blackAlpha.500"},w:"full"},children:i.jsx("pre",{children:k})})})]})]})},gT=p.memo(wte),wk={height:"100%",width:"15%",alignItems:"center",pointerEvents:"auto"},Sk={color:"base.100"},Ste=Oe([Bn,l3],(e,t)=>{const n=e.gallery.selection[e.gallery.selection.length-1];if(!n||t.length===0)return{isOnFirstImage:!0,isOnLastImage:!0};const r=t.findIndex(m=>m.image_name===n),o=Ks(r+1,0,t.length-1),s=Ks(r-1,0,t.length-1),a=t[o].image_name,c=t[s].image_name,d=Xw(e,a),f=Xw(e,c),h=t.length;return{isOnFirstImage:r===0,isOnLastImage:!isNaN(r)&&r===h-1,nextImage:d,prevImage:f,nextImageId:a,prevImageId:c}},{memoizeOptions:{resultEqualityCheck:en}}),vT=()=>{const e=ce(),{t}=we(),{isOnFirstImage:n,isOnLastImage:r,nextImageId:o,prevImageId:s}=Y(Ste),[a,c]=p.useState(!1),d=p.useCallback(()=>{c(!0)},[]),f=p.useCallback(()=>{c(!1)},[]),h=p.useCallback(()=>{s&&e(C1(s))},[e,s]),m=p.useCallback(()=>{o&&e(C1(o))},[e,o]);return et("left",()=>{h()},[s]),et("right",()=>{m()},[o]),i.jsxs(X,{sx:{justifyContent:"space-between",height:"100%",width:"100%",pointerEvents:"none"},children:[i.jsx(Ka,{sx:{...wk,justifyContent:"flex-start"},onMouseOver:d,onMouseOut:f,children:a&&!n&&i.jsx(Ya,{"aria-label":t("accessibility.previousImage"),icon:i.jsx(jW,{size:64}),variant:"unstyled",onClick:h,boxSize:16,sx:Sk})}),i.jsx(Ka,{sx:{...wk,justifyContent:"flex-end"},onMouseOver:d,onMouseOut:f,children:a&&!r&&i.jsx(Ya,{"aria-label":t("accessibility.nextImage"),icon:i.jsx(EW,{size:64}),variant:"unstyled",onClick:m,boxSize:16,sx:Sk})})]})};var ys=function(e,t){return Number(e.toFixed(t))},Cte=function(e,t){return typeof e=="number"?e:t},dr=function(e,t,n){n&&typeof n=="function"&&n(e,t)},_te=function(e){return-Math.cos(e*Math.PI)/2+.5},kte=function(e){return e},Pte=function(e){return e*e},jte=function(e){return e*(2-e)},Ete=function(e){return e<.5?2*e*e:-1+(4-2*e)*e},Ite=function(e){return e*e*e},Ote=function(e){return--e*e*e+1},Tte=function(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},Rte=function(e){return e*e*e*e},Mte=function(e){return 1- --e*e*e*e},Dte=function(e){return e<.5?8*e*e*e*e:1-8*--e*e*e*e},Ate=function(e){return e*e*e*e*e},Nte=function(e){return 1+--e*e*e*e*e},zte=function(e){return e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e},yT={easeOut:_te,linear:kte,easeInQuad:Pte,easeOutQuad:jte,easeInOutQuad:Ete,easeInCubic:Ite,easeOutCubic:Ote,easeInOutCubic:Tte,easeInQuart:Rte,easeOutQuart:Mte,easeInOutQuart:Dte,easeInQuint:Ate,easeOutQuint:Nte,easeInOutQuint:zte},bT=function(e){typeof e=="number"&&cancelAnimationFrame(e)},ga=function(e){e.mounted&&(bT(e.animation),e.animate=!1,e.animation=null,e.velocity=null)};function xT(e,t,n,r){if(e.mounted){var o=new Date().getTime(),s=1;ga(e),e.animation=function(){if(!e.mounted)return bT(e.animation);var a=new Date().getTime()-o,c=a/n,d=yT[t],f=d(c);a>=n?(r(s),e.animation=null):e.animation&&(r(f),requestAnimationFrame(e.animation))},requestAnimationFrame(e.animation)}}function $te(e){var t=e.scale,n=e.positionX,r=e.positionY;return!(Number.isNaN(t)||Number.isNaN(n)||Number.isNaN(r))}function Xi(e,t,n,r){var o=$te(t);if(!(!e.mounted||!o)){var s=e.setTransformState,a=e.transformState,c=a.scale,d=a.positionX,f=a.positionY,h=t.scale-c,m=t.positionX-d,v=t.positionY-f;n===0?s(t.scale,t.positionX,t.positionY):xT(e,r,n,function(y){var S=c+h*y,x=d+m*y,w=f+v*y;s(S,x,w)})}}function Lte(e,t,n){var r=e.offsetWidth,o=e.offsetHeight,s=t.offsetWidth,a=t.offsetHeight,c=s*n,d=a*n,f=r-c,h=o-d;return{wrapperWidth:r,wrapperHeight:o,newContentWidth:c,newDiffWidth:f,newContentHeight:d,newDiffHeight:h}}var Bte=function(e,t,n,r,o,s,a){var c=e>t?n*(a?1:.5):0,d=r>o?s*(a?1:.5):0,f=e-t-c,h=c,m=r-o-d,v=d;return{minPositionX:f,maxPositionX:h,minPositionY:m,maxPositionY:v}},Nx=function(e,t){var n=e.wrapperComponent,r=e.contentComponent,o=e.setup.centerZoomedOut;if(!n||!r)throw new Error("Components are not mounted");var s=Lte(n,r,t),a=s.wrapperWidth,c=s.wrapperHeight,d=s.newContentWidth,f=s.newDiffWidth,h=s.newContentHeight,m=s.newDiffHeight,v=Bte(a,d,f,c,h,m,!!o);return v},Ey=function(e,t,n,r){return r?e<t?ys(t,2):e>n?ys(n,2):ys(e,2):ys(e,2)},au=function(e,t){var n=Nx(e,t);return e.bounds=n,n};function Qg(e,t,n,r,o,s,a){var c=n.minPositionX,d=n.minPositionY,f=n.maxPositionX,h=n.maxPositionY,m=0,v=0;a&&(m=o,v=s);var y=Ey(e,c-m,f+m,r),S=Ey(t,d-v,h+v,r);return{x:y,y:S}}function Jg(e,t,n,r,o,s){var a=e.transformState,c=a.scale,d=a.positionX,f=a.positionY,h=r-c;if(typeof t!="number"||typeof n!="number")return console.error("Mouse X and Y position were not provided!"),{x:d,y:f};var m=d-t*h,v=f-n*h,y=Qg(m,v,o,s,0,0,null);return y}function _f(e,t,n,r,o){var s=o?r:0,a=t-s;return!Number.isNaN(n)&&e>=n?n:!Number.isNaN(t)&&e<=a?a:e}var Ck=function(e,t){var n=e.setup.panning.excluded,r=e.isInitialized,o=e.wrapperComponent,s=t.target,a=o==null?void 0:o.contains(s),c=r&&s&&a;if(!c)return!1;var d=ev(s,n);return!d},_k=function(e){var t=e.isInitialized,n=e.isPanning,r=e.setup,o=r.panning.disabled,s=t&&n&&!o;return!!s},Fte=function(e,t){var n=e.transformState,r=n.positionX,o=n.positionY;e.isPanning=!0;var s=t.clientX,a=t.clientY;e.startCoords={x:s-r,y:a-o}},Hte=function(e,t){var n=t.touches,r=e.transformState,o=r.positionX,s=r.positionY;e.isPanning=!0;var a=n.length===1;if(a){var c=n[0].clientX,d=n[0].clientY;e.startCoords={x:c-o,y:d-s}}};function Vte(e){var t=e.transformState,n=t.positionX,r=t.positionY,o=t.scale,s=e.setup,a=s.disabled,c=s.limitToBounds,d=s.centerZoomedOut,f=e.wrapperComponent;if(!(a||!f||!e.bounds)){var h=e.bounds,m=h.maxPositionX,v=h.minPositionX,y=h.maxPositionY,S=h.minPositionY,x=n>m||n<v,w=r>y||r<S,_=n>m?f.offsetWidth:e.setup.minPositionX||0,k=r>y?f.offsetHeight:e.setup.minPositionY||0,P=Jg(e,_,k,o,e.bounds,c||d),j=P.x,I=P.y;return{scale:o,positionX:x?j:n,positionY:w?I:r}}}function Wte(e,t,n,r,o){var s=e.setup.limitToBounds,a=e.wrapperComponent,c=e.bounds,d=e.transformState,f=d.scale,h=d.positionX,m=d.positionY;if(!(a===null||c===null||t===h&&n===m)){var v=Qg(t,n,c,s,r,o,a),y=v.x,S=v.y;e.setTransformState(f,y,S)}}var Ute=function(e,t,n){var r=e.startCoords,o=e.transformState,s=e.setup.panning,a=s.lockAxisX,c=s.lockAxisY,d=o.positionX,f=o.positionY;if(!r)return{x:d,y:f};var h=t-r.x,m=n-r.y,v=a?d:h,y=c?f:m;return{x:v,y}},Wm=function(e,t){var n=e.setup,r=e.transformState,o=r.scale,s=n.minScale,a=n.disablePadding;return t>0&&o>=s&&!a?t:0},Gte=function(e){var t=e.mounted,n=e.setup,r=n.disabled,o=n.velocityAnimation,s=e.transformState.scale,a=o.disabled,c=!a||s>1||!r||t;return!!c},qte=function(e){var t=e.mounted,n=e.velocity,r=e.bounds,o=e.setup,s=o.disabled,a=o.velocityAnimation,c=e.transformState.scale,d=a.disabled,f=!d||c>1||!s||t;return!(!f||!n||!r)};function Yte(e,t){var n=e.setup.velocityAnimation,r=n.equalToMove,o=n.animationTime,s=n.sensitivity;return r?o*t*s:o}function kk(e,t,n,r,o,s,a,c,d,f){if(o){if(t>a&&n>a){var h=a+(e-a)*f;return h>d?d:h<a?a:h}if(t<s&&n<s){var h=s+(e-s)*f;return h<c?c:h>s?s:h}}return r?t:Ey(e,s,a,o)}function Kte(e,t){var n=1;return t?Math.min(n,e.offsetWidth/window.innerWidth):n}function Xte(e,t){var n=Gte(e);if(n){var r=e.lastMousePosition,o=e.velocityTime,s=e.setup,a=e.wrapperComponent,c=s.velocityAnimation.equalToMove,d=Date.now();if(r&&o&&a){var f=Kte(a,c),h=t.x-r.x,m=t.y-r.y,v=h/f,y=m/f,S=d-o,x=h*h+m*m,w=Math.sqrt(x)/S;e.velocity={velocityX:v,velocityY:y,total:w}}e.lastMousePosition=t,e.velocityTime=d}}function Zte(e){var t=e.velocity,n=e.bounds,r=e.setup,o=e.wrapperComponent,s=qte(e);if(!(!s||!t||!n||!o)){var a=t.velocityX,c=t.velocityY,d=t.total,f=n.maxPositionX,h=n.minPositionX,m=n.maxPositionY,v=n.minPositionY,y=r.limitToBounds,S=r.alignmentAnimation,x=r.zoomAnimation,w=r.panning,_=w.lockAxisY,k=w.lockAxisX,P=x.animationType,j=S.sizeX,I=S.sizeY,O=S.velocityAlignmentTime,T=O,R=Yte(e,d),M=Math.max(R,T),D=Wm(e,j),A=Wm(e,I),G=D*o.offsetWidth/100,$=A*o.offsetHeight/100,H=f+G,U=h-G,q=m+$,z=v-$,L=e.transformState,V=new Date().getTime();xT(e,P,M,function(W){var te=e.transformState,fe=te.scale,ae=te.positionX,J=te.positionY,B=new Date().getTime()-V,oe=B/T,le=yT[S.animationType],ge=1-le(Math.min(1,oe)),se=1-W,pe=ae+a*se,ue=J+c*se,be=kk(pe,L.positionX,ae,k,y,h,f,U,H,ge),ke=kk(ue,L.positionY,J,_,y,v,m,z,q,ge);(ae!==pe||J!==ue)&&e.setTransformState(fe,be,ke)})}}function Pk(e,t){var n=e.transformState.scale;ga(e),au(e,n),window.TouchEvent!==void 0&&t instanceof TouchEvent?Hte(e,t):Fte(e,t)}function wT(e){var t=e.transformState.scale,n=e.setup,r=n.minScale,o=n.alignmentAnimation,s=o.disabled,a=o.sizeX,c=o.sizeY,d=o.animationTime,f=o.animationType,h=s||t<r||!a&&!c;if(!h){var m=Vte(e);m&&Xi(e,m,d,f)}}function jk(e,t,n){var r=e.startCoords,o=e.setup,s=o.alignmentAnimation,a=s.sizeX,c=s.sizeY;if(r){var d=Ute(e,t,n),f=d.x,h=d.y,m=Wm(e,a),v=Wm(e,c);Xte(e,{x:f,y:h}),Wte(e,f,h,m,v)}}function Qte(e){if(e.isPanning){var t=e.setup.panning.velocityDisabled,n=e.velocity,r=e.wrapperComponent,o=e.contentComponent;e.isPanning=!1,e.animate=!1,e.animation=null;var s=r==null?void 0:r.getBoundingClientRect(),a=o==null?void 0:o.getBoundingClientRect(),c=(s==null?void 0:s.width)||0,d=(s==null?void 0:s.height)||0,f=(a==null?void 0:a.width)||0,h=(a==null?void 0:a.height)||0,m=c<f||d<h,v=!t&&n&&(n==null?void 0:n.total)>.1&&m;v?Zte(e):wT(e)}}function zx(e,t,n,r){var o=e.setup,s=o.minScale,a=o.maxScale,c=o.limitToBounds,d=_f(ys(t,2),s,a,0,!1),f=au(e,d),h=Jg(e,n,r,d,f,c),m=h.x,v=h.y;return{scale:d,positionX:m,positionY:v}}function ST(e,t,n){var r=e.transformState.scale,o=e.wrapperComponent,s=e.setup,a=s.minScale,c=s.limitToBounds,d=s.zoomAnimation,f=d.disabled,h=d.animationTime,m=d.animationType,v=f||r>=a;if((r>=1||c)&&wT(e),!(v||!o||!e.mounted)){var y=t||o.offsetWidth/2,S=n||o.offsetHeight/2,x=zx(e,a,y,S);x&&Xi(e,x,h,m)}}var Ni=function(){return Ni=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},Ni.apply(this,arguments)};function Ek(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))}var Kp={previousScale:1,scale:1,positionX:0,positionY:0},Ju={disabled:!1,minPositionX:null,maxPositionX:null,minPositionY:null,maxPositionY:null,minScale:1,maxScale:8,limitToBounds:!0,centerZoomedOut:!1,centerOnInit:!1,disablePadding:!1,wheel:{step:.2,disabled:!1,wheelDisabled:!1,touchPadDisabled:!1,activationKeys:[],excluded:[]},panning:{disabled:!1,velocityDisabled:!1,lockAxisX:!1,lockAxisY:!1,activationKeys:[],excluded:[]},pinch:{step:5,disabled:!1,excluded:[]},doubleClick:{disabled:!1,step:.7,mode:"zoomIn",animationType:"easeOut",animationTime:200,excluded:[]},zoomAnimation:{disabled:!1,size:.4,animationTime:200,animationType:"easeOut"},alignmentAnimation:{disabled:!1,sizeX:100,sizeY:100,animationTime:200,velocityAlignmentTime:400,animationType:"easeOut"},velocityAnimation:{disabled:!1,sensitivity:1,animationTime:400,animationType:"easeOut",equalToMove:!0}},CT=function(e){var t,n,r,o;return{previousScale:(t=e.initialScale)!==null&&t!==void 0?t:Kp.scale,scale:(n=e.initialScale)!==null&&n!==void 0?n:Kp.scale,positionX:(r=e.initialPositionX)!==null&&r!==void 0?r:Kp.positionX,positionY:(o=e.initialPositionY)!==null&&o!==void 0?o:Kp.positionY}},Ik=function(e){var t=Ni({},Ju);return Object.keys(e).forEach(function(n){var r=typeof e[n]<"u",o=typeof Ju[n]<"u";if(o&&r){var s=Object.prototype.toString.call(Ju[n]),a=s==="[object Object]",c=s==="[object Array]";a?t[n]=Ni(Ni({},Ju[n]),e[n]):c?t[n]=Ek(Ek([],Ju[n],!0),e[n],!0):t[n]=e[n]}}),t},_T=function(e,t,n){var r=e.transformState.scale,o=e.wrapperComponent,s=e.setup,a=s.maxScale,c=s.minScale,d=s.zoomAnimation,f=d.size;if(!o)throw new Error("Wrapper is not mounted");var h=r+t*n,m=_f(ys(h,3),c,a,f,!1);return m};function kT(e,t,n,r,o){var s=e.wrapperComponent,a=e.transformState,c=a.scale,d=a.positionX,f=a.positionY;if(!s)return console.error("No WrapperComponent found");var h=s.offsetWidth,m=s.offsetHeight,v=(h/2-d)/c,y=(m/2-f)/c,S=_T(e,t,n),x=zx(e,S,v,y);if(!x)return console.error("Error during zoom event. New transformation state was not calculated.");Xi(e,x,r,o)}function PT(e,t,n,r){var o=e.setup,s=e.wrapperComponent,a=o.limitToBounds,c=CT(e.props),d=e.transformState,f=d.scale,h=d.positionX,m=d.positionY;if(s){var v=Nx(e,c.scale),y=Qg(c.positionX,c.positionY,v,a,0,0,s),S={scale:c.scale,positionX:y.x,positionY:y.y};f===c.scale&&h===c.positionX&&m===c.positionY||(r==null||r(),Xi(e,S,t,n))}}function Jte(e,t,n,r){var o=e.getBoundingClientRect(),s=t.getBoundingClientRect(),a=n.getBoundingClientRect(),c=s.x*r.scale,d=s.y*r.scale;return{x:(o.x-a.x+c)/r.scale,y:(o.y-a.y+d)/r.scale}}function ene(e,t,n){var r=e.wrapperComponent,o=e.contentComponent,s=e.transformState,a=e.setup,c=a.limitToBounds,d=a.minScale,f=a.maxScale;if(!r||!o)return s;var h=r.getBoundingClientRect(),m=t.getBoundingClientRect(),v=Jte(t,r,o,s),y=v.x,S=v.y,x=m.width/s.scale,w=m.height/s.scale,_=r.offsetWidth/x,k=r.offsetHeight/w,P=_f(n||Math.min(_,k),d,f,0,!1),j=(h.width-x*P)/2,I=(h.height-w*P)/2,O=(h.left-y)*P+j,T=(h.top-S)*P+I,R=Nx(e,P),M=Qg(O,T,R,c,0,0,r),D=M.x,A=M.y;return{positionX:D,positionY:A,scale:P}}var tne=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),kT(e,1,t,n,r)}},nne=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),kT(e,-1,t,n,r)}},rne=function(e){return function(t,n,r,o,s){o===void 0&&(o=300),s===void 0&&(s="easeOut");var a=e.transformState,c=a.positionX,d=a.positionY,f=a.scale,h=e.wrapperComponent,m=e.contentComponent,v=e.setup.disabled;if(!(v||!h||!m)){var y={positionX:Number.isNaN(t)?c:t,positionY:Number.isNaN(n)?d:n,scale:Number.isNaN(r)?f:r};Xi(e,y,o,s)}}},one=function(e){return function(t,n){t===void 0&&(t=200),n===void 0&&(n="easeOut"),PT(e,t,n)}},sne=function(e){return function(t,n,r){n===void 0&&(n=200),r===void 0&&(r="easeOut");var o=e.transformState,s=e.wrapperComponent,a=e.contentComponent;if(s&&a){var c=jT(t||o.scale,s,a);Xi(e,c,n,r)}}},ane=function(e){return function(t,n,r,o){r===void 0&&(r=600),o===void 0&&(o="easeOut"),ga(e);var s=e.wrapperComponent,a=typeof t=="string"?document.getElementById(t):t;if(s&&a&&s.contains(a)){var c=ene(e,a,n);Xi(e,c,r,o)}}},Iy=function(e){return{instance:e,zoomIn:tne(e),zoomOut:nne(e),setTransform:rne(e),resetTransform:one(e),centerView:sne(e),zoomToElement:ane(e)}},ine=function(e){return{instance:e,state:e.transformState}},Xn=function(e){var t={};return Object.assign(t,ine(e)),Object.assign(t,Iy(e)),t},r1=!1;function o1(){try{var e={get passive(){return r1=!0,!1}};return e}catch{return r1=!1,r1}}var ev=function(e,t){var n=e.tagName.toUpperCase(),r=t.find(function(s){return s.toUpperCase()===n});if(r)return!0;var o=t.find(function(s){return e.classList.contains(s)});return!!o},Oy=function(e){e&&clearTimeout(e)},lne=function(e,t,n){return"translate(".concat(e,"px, ").concat(t,"px) scale(").concat(n,")")},jT=function(e,t,n){var r=n.offsetWidth*e,o=n.offsetHeight*e,s=(t.offsetWidth-r)/2,a=(t.offsetHeight-o)/2;return{scale:e,positionX:s,positionY:a}};function cne(e){return function(t){e.forEach(function(n){typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var une=function(e,t){var n=e.setup.wheel,r=n.disabled,o=n.wheelDisabled,s=n.touchPadDisabled,a=n.excluded,c=e.isInitialized,d=e.isPanning,f=t.target,h=c&&!d&&!r&&f;if(!h||o&&!t.ctrlKey||s&&t.ctrlKey)return!1;var m=ev(f,a);return!m},dne=function(e){return e?e.deltaY<0?1:-1:0};function fne(e,t){var n=dne(e),r=Cte(t,n);return r}function ET(e,t,n){var r=t.getBoundingClientRect(),o=0,s=0;if("clientX"in e)o=(e.clientX-r.left)/n,s=(e.clientY-r.top)/n;else{var a=e.touches[0];o=(a.clientX-r.left)/n,s=(a.clientY-r.top)/n}return(Number.isNaN(o)||Number.isNaN(s))&&console.error("No mouse or touch offset found"),{x:o,y:s}}var pne=function(e,t,n,r,o){var s=e.transformState.scale,a=e.wrapperComponent,c=e.setup,d=c.maxScale,f=c.minScale,h=c.zoomAnimation,m=c.disablePadding,v=h.size,y=h.disabled;if(!a)throw new Error("Wrapper is not mounted");var S=s+t*n;if(o)return S;var x=r?!1:!y,w=_f(ys(S,3),f,d,v,x&&!m);return w},hne=function(e,t){var n=e.previousWheelEvent,r=e.transformState.scale,o=e.setup,s=o.maxScale,a=o.minScale;return n?r<s||r>a||Math.sign(n.deltaY)!==Math.sign(t.deltaY)||n.deltaY>0&&n.deltaY<t.deltaY||n.deltaY<0&&n.deltaY>t.deltaY||Math.sign(n.deltaY)!==Math.sign(t.deltaY):!1},mne=function(e,t){var n=e.setup.pinch,r=n.disabled,o=n.excluded,s=e.isInitialized,a=t.target,c=s&&!r&&a;if(!c)return!1;var d=ev(a,o);return!d},gne=function(e){var t=e.setup.pinch.disabled,n=e.isInitialized,r=e.pinchStartDistance,o=n&&!t&&r;return!!o},vne=function(e,t,n){var r=n.getBoundingClientRect(),o=e.touches,s=ys(o[0].clientX-r.left,5),a=ys(o[0].clientY-r.top,5),c=ys(o[1].clientX-r.left,5),d=ys(o[1].clientY-r.top,5);return{x:(s+c)/2/t,y:(a+d)/2/t}},IT=function(e){return Math.sqrt(Math.pow(e.touches[0].pageX-e.touches[1].pageX,2)+Math.pow(e.touches[0].pageY-e.touches[1].pageY,2))},yne=function(e,t){var n=e.pinchStartScale,r=e.pinchStartDistance,o=e.setup,s=o.maxScale,a=o.minScale,c=o.zoomAnimation,d=o.disablePadding,f=c.size,h=c.disabled;if(!n||r===null||!t)throw new Error("Pinch touches distance was not provided");if(t<0)return e.transformState.scale;var m=t/r,v=m*n;return _f(ys(v,2),a,s,f,!h&&!d)},bne=160,xne=100,wne=function(e,t){var n=e.props,r=n.onWheelStart,o=n.onZoomStart;e.wheelStopEventTimer||(ga(e),dr(Xn(e),t,r),dr(Xn(e),t,o))},Sne=function(e,t){var n=e.props,r=n.onWheel,o=n.onZoom,s=e.contentComponent,a=e.setup,c=e.transformState,d=c.scale,f=a.limitToBounds,h=a.centerZoomedOut,m=a.zoomAnimation,v=a.wheel,y=a.disablePadding,S=m.size,x=m.disabled,w=v.step;if(!s)throw new Error("Component not mounted");t.preventDefault(),t.stopPropagation();var _=fne(t,null),k=pne(e,_,w,!t.ctrlKey);if(d!==k){var P=au(e,k),j=ET(t,s,d),I=x||S===0||h||y,O=f&&I,T=Jg(e,j.x,j.y,k,P,O),R=T.x,M=T.y;e.previousWheelEvent=t,e.setTransformState(k,R,M),dr(Xn(e),t,r),dr(Xn(e),t,o)}},Cne=function(e,t){var n=e.props,r=n.onWheelStop,o=n.onZoomStop;Oy(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout(function(){e.mounted&&(ST(e,t.x,t.y),e.wheelAnimationTimer=null)},xne);var s=hne(e,t);s&&(Oy(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout(function(){e.mounted&&(e.wheelStopEventTimer=null,dr(Xn(e),t,r),dr(Xn(e),t,o))},bne))},_ne=function(e,t){var n=IT(t);e.pinchStartDistance=n,e.lastDistance=n,e.pinchStartScale=e.transformState.scale,e.isPanning=!1,ga(e)},kne=function(e,t){var n=e.contentComponent,r=e.pinchStartDistance,o=e.transformState.scale,s=e.setup,a=s.limitToBounds,c=s.centerZoomedOut,d=s.zoomAnimation,f=d.disabled,h=d.size;if(!(r===null||!n)){var m=vne(t,o,n);if(!(!Number.isFinite(m.x)||!Number.isFinite(m.y))){var v=IT(t),y=yne(e,v);if(y!==o){var S=au(e,y),x=f||h===0||c,w=a&&x,_=Jg(e,m.x,m.y,y,S,w),k=_.x,P=_.y;e.pinchMidpoint=m,e.lastDistance=v,e.setTransformState(y,k,P)}}}},Pne=function(e){var t=e.pinchMidpoint;e.velocity=null,e.lastDistance=null,e.pinchMidpoint=null,e.pinchStartScale=null,e.pinchStartDistance=null,ST(e,t==null?void 0:t.x,t==null?void 0:t.y)},OT=function(e,t){var n=e.props.onZoomStop,r=e.setup.doubleClick.animationTime;Oy(e.doubleClickStopEventTimer),e.doubleClickStopEventTimer=setTimeout(function(){e.doubleClickStopEventTimer=null,dr(Xn(e),t,n)},r)},jne=function(e,t){var n=e.props,r=n.onZoomStart,o=n.onZoom,s=e.setup.doubleClick,a=s.animationTime,c=s.animationType;dr(Xn(e),t,r),PT(e,a,c,function(){return dr(Xn(e),t,o)}),OT(e,t)};function Ene(e,t){var n=e.setup,r=e.doubleClickStopEventTimer,o=e.transformState,s=e.contentComponent,a=o.scale,c=e.props,d=c.onZoomStart,f=c.onZoom,h=n.doubleClick,m=h.disabled,v=h.mode,y=h.step,S=h.animationTime,x=h.animationType;if(!m&&!r){if(v==="reset")return jne(e,t);if(!s)return console.error("No ContentComponent found");var w=v==="zoomOut"?-1:1,_=_T(e,w,y);if(a!==_){dr(Xn(e),t,d);var k=ET(t,s,a),P=zx(e,_,k.x,k.y);if(!P)return console.error("Error during zoom event. New transformation state was not calculated.");dr(Xn(e),t,f),Xi(e,P,S,x),OT(e,t)}}}var Ine=function(e,t){var n=e.isInitialized,r=e.setup,o=e.wrapperComponent,s=r.doubleClick,a=s.disabled,c=s.excluded,d=t.target,f=o==null?void 0:o.contains(d),h=n&&d&&f&&!a;if(!h)return!1;var m=ev(d,c);return!m},One=function(){function e(t){var n=this;this.mounted=!0,this.onChangeCallbacks=new Set,this.onInitCallbacks=new Set,this.wrapperComponent=null,this.contentComponent=null,this.isInitialized=!1,this.bounds=null,this.previousWheelEvent=null,this.wheelStopEventTimer=null,this.wheelAnimationTimer=null,this.isPanning=!1,this.startCoords=null,this.lastTouch=null,this.distance=null,this.lastDistance=null,this.pinchStartDistance=null,this.pinchStartScale=null,this.pinchMidpoint=null,this.doubleClickStopEventTimer=null,this.velocity=null,this.velocityTime=null,this.lastMousePosition=null,this.animate=!1,this.animation=null,this.maxBounds=null,this.pressedKeys={},this.mount=function(){n.initializeWindowEvents()},this.unmount=function(){n.cleanupWindowEvents()},this.update=function(r){au(n,n.transformState.scale),n.setup=Ik(r)},this.initializeWindowEvents=function(){var r,o=o1(),s=(r=n.wrapperComponent)===null||r===void 0?void 0:r.ownerDocument,a=s==null?void 0:s.defaultView;a==null||a.addEventListener("mousedown",n.onPanningStart,o),a==null||a.addEventListener("mousemove",n.onPanning,o),a==null||a.addEventListener("mouseup",n.onPanningStop,o),s==null||s.addEventListener("mouseleave",n.clearPanning,o),a==null||a.addEventListener("keyup",n.setKeyUnPressed,o),a==null||a.addEventListener("keydown",n.setKeyPressed,o)},this.cleanupWindowEvents=function(){var r,o,s=o1(),a=(r=n.wrapperComponent)===null||r===void 0?void 0:r.ownerDocument,c=a==null?void 0:a.defaultView;c==null||c.removeEventListener("mousedown",n.onPanningStart,s),c==null||c.removeEventListener("mousemove",n.onPanning,s),c==null||c.removeEventListener("mouseup",n.onPanningStop,s),a==null||a.removeEventListener("mouseleave",n.clearPanning,s),c==null||c.removeEventListener("keyup",n.setKeyUnPressed,s),c==null||c.removeEventListener("keydown",n.setKeyPressed,s),document.removeEventListener("mouseleave",n.clearPanning,s),ga(n),(o=n.observer)===null||o===void 0||o.disconnect()},this.handleInitializeWrapperEvents=function(r){var o=o1();r.addEventListener("wheel",n.onWheelZoom,o),r.addEventListener("dblclick",n.onDoubleClick,o),r.addEventListener("touchstart",n.onTouchPanningStart,o),r.addEventListener("touchmove",n.onTouchPanning,o),r.addEventListener("touchend",n.onTouchPanningStop,o)},this.handleInitialize=function(r){var o=n.setup.centerOnInit;n.applyTransformation(),n.onInitCallbacks.forEach(function(s){return s(Xn(n))}),o&&(n.setCenter(),n.observer=new ResizeObserver(function(){var s;n.onInitCallbacks.forEach(function(a){return a(Xn(n))}),n.setCenter(),(s=n.observer)===null||s===void 0||s.disconnect()}),n.observer.observe(r))},this.onWheelZoom=function(r){var o=n.setup.disabled;if(!o){var s=une(n,r);if(s){var a=n.isPressingKeys(n.setup.wheel.activationKeys);a&&(wne(n,r),Sne(n,r),Cne(n,r))}}},this.onPanningStart=function(r){var o=n.setup.disabled,s=n.props.onPanningStart;if(!o){var a=Ck(n,r);if(a){var c=n.isPressingKeys(n.setup.panning.activationKeys);c&&(r.preventDefault(),r.stopPropagation(),ga(n),Pk(n,r),dr(Xn(n),r,s))}}},this.onPanning=function(r){var o=n.setup.disabled,s=n.props.onPanning;if(!o){var a=_k(n);if(a){var c=n.isPressingKeys(n.setup.panning.activationKeys);c&&(r.preventDefault(),r.stopPropagation(),jk(n,r.clientX,r.clientY),dr(Xn(n),r,s))}}},this.onPanningStop=function(r){var o=n.props.onPanningStop;n.isPanning&&(Qte(n),dr(Xn(n),r,o))},this.onPinchStart=function(r){var o=n.setup.disabled,s=n.props,a=s.onPinchingStart,c=s.onZoomStart;if(!o){var d=mne(n,r);d&&(_ne(n,r),ga(n),dr(Xn(n),r,a),dr(Xn(n),r,c))}},this.onPinch=function(r){var o=n.setup.disabled,s=n.props,a=s.onPinching,c=s.onZoom;if(!o){var d=gne(n);d&&(r.preventDefault(),r.stopPropagation(),kne(n,r),dr(Xn(n),r,a),dr(Xn(n),r,c))}},this.onPinchStop=function(r){var o=n.props,s=o.onPinchingStop,a=o.onZoomStop;n.pinchStartScale&&(Pne(n),dr(Xn(n),r,s),dr(Xn(n),r,a))},this.onTouchPanningStart=function(r){var o=n.setup.disabled,s=n.props.onPanningStart;if(!o){var a=Ck(n,r);if(a){var c=n.lastTouch&&+new Date-n.lastTouch<200;if(c&&r.touches.length===1)n.onDoubleClick(r);else{n.lastTouch=+new Date,ga(n);var d=r.touches,f=d.length===1,h=d.length===2;f&&(ga(n),Pk(n,r),dr(Xn(n),r,s)),h&&n.onPinchStart(r)}}}},this.onTouchPanning=function(r){var o=n.setup.disabled,s=n.props.onPanning;if(n.isPanning&&r.touches.length===1){if(o)return;var a=_k(n);if(!a)return;r.preventDefault(),r.stopPropagation();var c=r.touches[0];jk(n,c.clientX,c.clientY),dr(Xn(n),r,s)}else r.touches.length>1&&n.onPinch(r)},this.onTouchPanningStop=function(r){n.onPanningStop(r),n.onPinchStop(r)},this.onDoubleClick=function(r){var o=n.setup.disabled;if(!o){var s=Ine(n,r);s&&Ene(n,r)}},this.clearPanning=function(r){n.isPanning&&n.onPanningStop(r)},this.setKeyPressed=function(r){n.pressedKeys[r.key]=!0},this.setKeyUnPressed=function(r){n.pressedKeys[r.key]=!1},this.isPressingKeys=function(r){return r.length?!!r.find(function(o){return n.pressedKeys[o]}):!0},this.setTransformState=function(r,o,s){var a=n.props.onTransformed;if(!Number.isNaN(r)&&!Number.isNaN(o)&&!Number.isNaN(s)){r!==n.transformState.scale&&(n.transformState.previousScale=n.transformState.scale,n.transformState.scale=r),n.transformState.positionX=o,n.transformState.positionY=s,n.applyTransformation();var c=Xn(n);n.onChangeCallbacks.forEach(function(d){return d(c)}),dr(c,{scale:r,positionX:o,positionY:s},a)}else console.error("Detected NaN set state values")},this.setCenter=function(){if(n.wrapperComponent&&n.contentComponent){var r=jT(n.transformState.scale,n.wrapperComponent,n.contentComponent);n.setTransformState(r.scale,r.positionX,r.positionY)}},this.handleTransformStyles=function(r,o,s){return n.props.customTransform?n.props.customTransform(r,o,s):lne(r,o,s)},this.applyTransformation=function(){if(!(!n.mounted||!n.contentComponent)){var r=n.transformState,o=r.scale,s=r.positionX,a=r.positionY,c=n.handleTransformStyles(s,a,o);n.contentComponent.style.transform=c}},this.getContext=function(){return Xn(n)},this.onChange=function(r){return n.onChangeCallbacks.has(r)||n.onChangeCallbacks.add(r),function(){n.onChangeCallbacks.delete(r)}},this.onInit=function(r){return n.onInitCallbacks.has(r)||n.onInitCallbacks.add(r),function(){n.onInitCallbacks.delete(r)}},this.init=function(r,o){n.cleanupWindowEvents(),n.wrapperComponent=r,n.contentComponent=o,au(n,n.transformState.scale),n.handleInitializeWrapperEvents(r),n.handleInitialize(o),n.initializeWindowEvents(),n.isInitialized=!0;var s=Xn(n);dr(s,void 0,n.props.onInit)},this.props=t,this.setup=Ik(this.props),this.transformState=CT(this.props)}return e}(),tv=F.createContext(null),Tne=function(e,t){return typeof e=="function"?e(t):e},Rne=F.forwardRef(function(e,t){var n=p.useRef(new One(e)).current,r=Tne(e.children,Iy(n));return p.useImperativeHandle(t,function(){return Iy(n)},[n]),p.useEffect(function(){n.update(e)},[n,e]),F.createElement(tv.Provider,{value:n},r)});F.forwardRef(function(e,t){var n=p.useRef(null),r=p.useContext(tv);return p.useEffect(function(){return r.onChange(function(o){if(n.current){var s=0,a=0;n.current.style.transform=r.handleTransformStyles(s,a,1/o.instance.transformState.scale)}})},[r]),F.createElement("div",Ni({},e,{ref:cne([n,t])}))});function Mne(e,t){t===void 0&&(t={});var n=t.insertAt;if(!(!e||typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",n==="top"&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}var Dne=`.transform-component-module_wrapper__SPB86 {
position: relative;
width: -moz-fit-content;
width: fit-content;
height: -moz-fit-content;
height: fit-content;
overflow: hidden;
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Safari */
-khtml-user-select: none; /* Konqueror HTML */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none;
margin: 0;
padding: 0;
}
.transform-component-module_content__FBWxo {
display: flex;
flex-wrap: wrap;
width: -moz-fit-content;
width: fit-content;
height: -moz-fit-content;
height: fit-content;
margin: 0;
padding: 0;
transform-origin: 0% 0%;
}
.transform-component-module_content__FBWxo img {
pointer-events: none;
}
`,Ok={wrapper:"transform-component-module_wrapper__SPB86",content:"transform-component-module_content__FBWxo"};Mne(Dne);var Ane=function(e){var t=e.children,n=e.wrapperClass,r=n===void 0?"":n,o=e.contentClass,s=o===void 0?"":o,a=e.wrapperStyle,c=e.contentStyle,d=e.wrapperProps,f=d===void 0?{}:d,h=e.contentProps,m=h===void 0?{}:h,v=p.useContext(tv).init,y=p.useRef(null),S=p.useRef(null);return p.useEffect(function(){var x=y.current,w=S.current;x!==null&&w!==null&&v&&v(x,w)},[]),F.createElement("div",Ni({},f,{ref:y,className:"react-transform-wrapper ".concat(Ok.wrapper," ").concat(r),style:a}),F.createElement("div",Ni({},m,{ref:S,className:"react-transform-component ".concat(Ok.content," ").concat(s),style:c}),t))},TT=function(){var e=p.useContext(tv);if(!e)throw new Error("Transform context must be placed inside TransformWrapper");return e};const Tk=1.5,RT="28rem",Nne=()=>{const[e,t]=p.useState(0),[n,r]=p.useState(1),[o,s]=p.useState(1);return{rotation:e,scaleX:n,scaleY:o,flipHorizontally:()=>{r(n*-1)},flipVertically:()=>{s(o*-1)},rotateCounterClockwise:()=>{t(e===-270?0:e-90)},rotateClockwise:()=>{t(e===270?0:e+90)},reset:()=>{t(0),r(1),s(1)}}};function zne(e){return it({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 $ne(e){return it({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58a.49.49 0 00.12-.61l-1.92-3.32a.488.488 0 00-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.484.484 0 00-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58a.49.49 0 00-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"}}]})(e)}function Lne(e){return it({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 Rk(e){return it({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"}}]})(e)}function Bne(e){return it({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 Fne(e){return it({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 Hne(e){return it({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)}const Vne=({flipHorizontally:e,flipVertically:t,rotateCounterClockwise:n,rotateClockwise:r,reset:o})=>{const{zoomIn:s,zoomOut:a,resetTransform:c}=TT(),{t:d}=we();return i.jsxs(Or,{isAttached:!0,orientation:"vertical",children:[i.jsx(Ne,{icon:i.jsx(tV,{}),"aria-label":d("accessibility.zoomIn"),tooltip:d("accessibility.zoomIn"),onClick:()=>s(),fontSize:20}),i.jsx(Ne,{icon:i.jsx(nV,{}),"aria-label":d("accessibility.zoomOut"),tooltip:d("accessibility.zoomOut"),onClick:()=>a(),fontSize:20}),i.jsx(Ne,{icon:i.jsx(JH,{}),"aria-label":d("accessibility.rotateCounterClockwise"),tooltip:d("accessibility.rotateCounterClockwise"),onClick:n,fontSize:20}),i.jsx(Ne,{icon:i.jsx(eV,{}),"aria-label":d("accessibility.rotateClockwise"),tooltip:d("accessibility.rotateClockwise"),onClick:r,fontSize:20}),i.jsx(Ne,{icon:i.jsx(Rk,{}),"aria-label":d("accessibility.flipHorizontally"),tooltip:d("accessibility.flipHorizontally"),onClick:e,fontSize:20}),i.jsx(Ne,{icon:i.jsx(Rk,{style:{transform:"rotate(90deg)"}}),"aria-label":d("accessibility.flipVertically"),tooltip:d("accessibility.flipVertically"),onClick:t,fontSize:20}),i.jsx(Ne,{icon:i.jsx(Nj,{}),"aria-label":d("accessibility.reset"),tooltip:d("accessibility.reset"),onClick:()=>{c(),o()},fontSize:20})]})};function Wne({image:e,alt:t,ref:n,styleClass:r,rotation:o,scaleX:s,scaleY:a}){const{centerView:c}=TT();return i.jsx(Ane,{wrapperStyle:{width:"100%",height:"100%"},children:i.jsx("img",{style:{transform:`rotate(${o}deg) scaleX(${s}) scaleY(${a})`,width:"100%"},src:e.image_url,alt:t,ref:n,className:r||"",onLoad:()=>c(1,0,"easeOut")})})}const Une=Oe([Rj,ks],(e,t)=>{const{currentImage:n}=e,{shouldShowImageDetails:r}=t;return{viewerImageToDisplay:n,shouldShowImageDetails:r}},{memoizeOptions:{resultEqualityCheck:en}});function Gne(){const e=ce(),t=Y(v=>v.lightbox.isLightboxOpen),{rotation:n,scaleX:r,scaleY:o,flipHorizontally:s,flipVertically:a,rotateCounterClockwise:c,rotateClockwise:d,reset:f}=Nne(),{viewerImageToDisplay:h,shouldShowImageDetails:m}=Y(Une);return et("Esc",()=>{t&&e(Cd(!1))},[t]),i.jsx(Xo,{children:t&&i.jsx(No.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15,ease:"easeInOut"},style:{display:"flex",width:"100vw",height:`calc(100vh - ${Tk*4}px)`,position:"fixed",top:`${Tk*4}px`,background:"var(--invokeai-colors-base-900)",zIndex:99},children:i.jsxs(Rne,{centerOnInit:!0,minScale:.1,initialPositionX:50,initialPositionY:50,children:[i.jsxs(X,{sx:{flexDir:"column",position:"absolute",insetInlineStart:4,gap:4,zIndex:3,top:4},children:[i.jsx(Ne,{icon:i.jsx(QH,{}),"aria-label":"Exit Viewer",className:"lightbox-close-btn",onClick:()=>{e(Cd(!1))},fontSize:20}),i.jsx(Vne,{flipHorizontally:s,flipVertically:a,rotateCounterClockwise:c,rotateClockwise:d,reset:f})]}),i.jsx(X,{sx:{position:"absolute",top:4,zIndex:3,insetInlineStart:"50%",transform:"translate(-50%, 0)"},children:i.jsx(mT,{})}),h&&i.jsxs(i.Fragment,{children:[i.jsx(Wne,{rotation:n,scaleX:r,scaleY:o,image:h,styleClass:"lightbox-image"}),m&&i.jsx(gT,{image:h}),!m&&i.jsx(ut,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"100vw",h:"100vh",px:16,pointerEvents:"none"},children:i.jsx(vT,{})})]})]})},"lightbox")})}function Mk(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.addEventListener&&e.addEventListener.apply(e,t)}function Dk(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.removeEventListener&&e.removeEventListener.apply(e,t)}var qne=function(e,t){return typeof t=="boolean"?t:!e},Yne=function(e){return p.useReducer(qne,e)};const Kne=Yne;var Xne=function(e,t){t===void 0&&(t=!0);var n=p.useState(!1),r=n[0],o=n[1];return p.useEffect(function(){var s=function(){return o(!0)},a=function(){return o(!1)};t&&e&&e.current&&(Mk(e.current,"mouseover",s),Mk(e.current,"mouseout",a));var c=e.current;return function(){t&&c&&(Dk(c,"mouseover",s),Dk(c,"mouseout",a))}},[t,e]),r};const Zne=Xne,Qne=Oe(wo,e=>{const{isConnected:t,isProcessing:n,statusTranslationKey:r,currentIteration:o,totalIterations:s,currentStatusHasSteps:a}=e;return{isConnected:t,isProcessing:n,currentIteration:o,totalIterations:s,statusTranslationKey:r,currentStatusHasSteps:a}},Lt),Ak={ok:"green.400",working:"yellow.400",error:"red.400"},Nk={ok:"green.600",working:"yellow.500",error:"red.500"},Jne=()=>{const{isConnected:e,isProcessing:t,currentIteration:n,totalIterations:r,statusTranslationKey:o}=Y(Qne),{t:s}=we(),a=p.useRef(null),c=p.useMemo(()=>t?"working":e?"ok":"error",[t,e]),d=p.useMemo(()=>{if(n&&r)return` (${n}/${r})`},[n,r]),f=Zne(a);return i.jsxs(X,{ref:a,h:"full",px:2,alignItems:"center",gap:5,children:[i.jsx(Xo,{children:f&&i.jsx(No.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.15}},exit:{opacity:0,transition:{delay:.8}},children:i.jsxs(nt,{sx:{fontSize:"sm",fontWeight:"600",pb:"1px",userSelect:"none",color:Nk[c],_dark:{color:Ak[c]}},children:[s(o),d]})},"statusText")}),i.jsx(io,{as:DW,sx:{boxSize:"0.5rem",color:Nk[c],_dark:{color:Ak[c]}}})]})},ere=()=>{const{colorMode:e,toggleColorMode:t}=zo(),{t:n}=we();return i.jsx(Ne,{"aria-label":n(e==="dark"?"common.lightMode":"common.darkMode"),tooltip:n(e==="dark"?"common.lightMode":"common.darkMode"),size:"sm",icon:e==="dark"?i.jsx(nU,{fontSize:19}):i.jsx(KW,{fontSize:18}),onClick:t,variant:"link"})};function tre(e){const{title:t,hotkey:n,description:r}=e;return i.jsxs(Ka,{sx:{gridTemplateColumns:"auto max-content",justifyContent:"space-between",alignItems:"center"},children:[i.jsxs(Ka,{children:[i.jsx(nt,{fontWeight:600,children:t}),r&&i.jsx(nt,{sx:{fontSize:"sm"},variant:"subtext",children:r})]}),i.jsx(ut,{sx:{fontSize:"sm",fontWeight:600,px:2,py:1},children:n})]})}function nre({children:e}){const{isOpen:t,onOpen:n,onClose:r}=Yc(),{t:o}=we(),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.pinOptions.title"),desc:o("hotkeys.pinOptions.desc"),hotkey:"Shift+O"},{title:o("hotkeys.toggleViewer.title"),desc:o("hotkeys.toggleViewer.desc"),hotkey:"Z"},{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"},{title:o("hotkeys.consoleToggle.title"),desc:o("hotkeys.consoleToggle.desc"),hotkey:"`"}],a=[{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.restoreFaces.title"),desc:o("hotkeys.restoreFaces.desc"),hotkey:"Shift+R"},{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.toggleGalleryPin.title"),desc:o("hotkeys.toggleGalleryPin.desc"),hotkey:"Shift+G"},{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"}],d=[{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"}],f=h=>i.jsx(X,{flexDir:"column",gap:4,children:h.map((m,v)=>i.jsxs(X,{flexDir:"column",px:2,gap:4,children:[i.jsx(tre,{title:m.title,description:m.desc,hotkey:m.hotkey}),v<h.length-1&&i.jsx(ai,{})]},v))});return i.jsxs(i.Fragment,{children:[p.cloneElement(e,{onClick:n}),i.jsxs(Td,{isOpen:t,onClose:r,children:[i.jsx(Li,{}),i.jsxs(Rd,{children:[i.jsx($i,{children:o("hotkeys.keyboardShortcuts")}),i.jsx(zb,{}),i.jsx(Bi,{children:i.jsx(s5,{allowMultiple:!0,children:i.jsxs(X,{flexDir:"column",gap:2,children:[i.jsxs(id,{children:[i.jsx(sd,{children:i.jsxs(X,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[i.jsx("h2",{children:o("hotkeys.appHotkeys")}),i.jsx(ad,{})]})}),i.jsx(ld,{children:f(s)})]}),i.jsxs(id,{children:[i.jsx(sd,{children:i.jsxs(X,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[i.jsx("h2",{children:o("hotkeys.generalHotkeys")}),i.jsx(ad,{})]})}),i.jsx(ld,{children:f(a)})]}),i.jsxs(id,{children:[i.jsx(sd,{children:i.jsxs(X,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[i.jsx("h2",{children:o("hotkeys.galleryHotkeys")}),i.jsx(ad,{})]})}),i.jsx(ld,{children:f(c)})]}),i.jsxs(id,{children:[i.jsx(sd,{children:i.jsxs(X,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[i.jsx("h2",{children:o("hotkeys.unifiedCanvasHotkeys")}),i.jsx(ad,{})]})}),i.jsx(ld,{children:f(d)})]})]})})}),i.jsx(zi,{})]})]})]})}const MT=()=>{const e=Y(t=>t.system.app_version);return i.jsxs(X,{alignItems:"center",gap:3,ps:1,children:[i.jsx(eg,{src:C7,alt:"invoke-ai-logo",sx:{w:"32px",h:"32px",minW:"32px",minH:"32px",userSelect:"none"}}),i.jsxs(X,{sx:{gap:3},children:[i.jsxs(nt,{sx:{fontSize:"xl",userSelect:"none"},children:["invoke ",i.jsx("strong",{children:"ai"})]}),i.jsx(nt,{sx:{fontWeight:300,marginTop:1},variant:"subtext",children:e})]})]})},rre={ar:Mr.t("common.langArabic",{lng:"ar"}),nl:Mr.t("common.langDutch",{lng:"nl"}),en:Mr.t("common.langEnglish",{lng:"en"}),fr:Mr.t("common.langFrench",{lng:"fr"}),de:Mr.t("common.langGerman",{lng:"de"}),he:Mr.t("common.langHebrew",{lng:"he"}),it:Mr.t("common.langItalian",{lng:"it"}),ja:Mr.t("common.langJapanese",{lng:"ja"}),ko:Mr.t("common.langKorean",{lng:"ko"}),pl:Mr.t("common.langPolish",{lng:"pl"}),pt_BR:Mr.t("common.langBrPortuguese",{lng:"pt_BR"}),pt:Mr.t("common.langPortuguese",{lng:"pt"}),ru:Mr.t("common.langRussian",{lng:"ru"}),zh_CN:Mr.t("common.langSimplifiedChinese",{lng:"zh_CN"}),es:Mr.t("common.langSpanish",{lng:"es"}),uk:Mr.t("common.langUkranian",{lng:"ua"})};function ore(){const{t:e}=we(),t=ce(),n=Y(h3);return i.jsxs(dg,{closeOnSelect:!1,children:[i.jsx(Wn,{label:e("common.languagePickerLabel"),hasArrow:!0,children:i.jsx(fg,{as:Ya,icon:i.jsx(uU,{}),variant:"link","aria-label":e("common.languagePickerLabel"),fontSize:22,minWidth:8})}),i.jsx(gf,{children:i.jsx(Nb,{value:n,children:Pa(rre,(r,o)=>i.jsx(Od,{value:o,onClick:()=>t(_7(o)),children:r},o))})})]})}const sre=e=>{const{searchable:t=!0,tooltip:n,...r}=e,{base50:o,base100:s,base200:a,base300:c,base400:d,base500:f,base600:h,base700:m,base800:v,base900:y,accent200:S,accent300:x,accent400:w,accent500:_,accent600:k}=hT(),[P]=Wl("shadows",["dark-lg"]),{colorMode:j}=zo();return i.jsx(Wn,{label:n,placement:"top",hasArrow:!0,children:i.jsx(uT,{searchable:t,styles:()=>({label:{color:Fe(m,c)(j),fontWeight:"normal"},searchInput:{":placeholder":{color:Fe(c,m)(j)}},input:{backgroundColor:Fe(o,y)(j),borderWidth:"2px",borderColor:Fe(a,v)(j),color:Fe(y,s)(j),paddingRight:24,fontWeight:600,"&:hover":{borderColor:Fe(c,h)(j)},"&:focus":{borderColor:Fe(x,k)(j)},"&:is(:focus, :hover)":{borderColor:Fe(d,f)(j)},"&:focus-within":{borderColor:Fe(S,k)(j)},"&[data-disabled]":{backgroundColor:Fe(c,m)(j),color:Fe(h,d)(j)}},value:{backgroundColor:Fe(a,v)(j),color:Fe(y,s)(j),button:{color:Fe(y,s)(j)},"&:hover":{backgroundColor:Fe(c,m)(j),cursor:"pointer"}},dropdown:{backgroundColor:Fe(a,v)(j),borderColor:Fe(a,v)(j),boxShadow:P},item:{backgroundColor:Fe(a,v)(j),color:Fe(v,a)(j),padding:6,"&[data-hovered]":{color:Fe(y,s)(j),backgroundColor:Fe(c,m)(j)},"&[data-active]":{backgroundColor:Fe(c,m)(j),"&:hover":{color:Fe(y,s)(j),backgroundColor:Fe(c,m)(j)}},"&[data-selected]":{backgroundColor:Fe(w,k)(j),color:Fe(o,s)(j),fontWeight:600,"&:hover":{backgroundColor:Fe(_,_)(j),color:Fe("white",o)(j)}}},rightSection:{width:24,padding:20,button:{color:Fe(y,s)(j)}}}),...r})})},$x=p.memo(sre),are=Pa(m3,e=>({value:e,label:g3[e]})).sort((e,t)=>e.label.localeCompare(t.label));function ire(){const e=ce(),{t}=we(),n=Y(o=>o.ui.favoriteSchedulers),r=p.useCallback(o=>{e(k7(o))},[e]);return i.jsx($x,{label:t("settings.favoriteSchedulers"),value:n,data:are,onChange:r,clearable:!0,searchable:!0,maxSelectedValues:99,placeholder:t("settings.favoriteSchedulersPlaceholder")})}const lre=Oe([wo,ks],(e,t)=>{const{shouldConfirmOnDelete:n,shouldDisplayGuides:r,enableImageDebugging:o,consoleLogLevel:s,shouldLogToConsole:a,shouldAntialiasProgressImage:c}=e,{shouldUseCanvasBetaLayout:d,shouldUseSliders:f,shouldShowProgressInViewer:h}=t;return{shouldConfirmOnDelete:n,shouldDisplayGuides:r,enableImageDebugging:o,shouldUseCanvasBetaLayout:d,shouldUseSliders:f,shouldShowProgressInViewer:h,consoleLogLevel:s,shouldLogToConsole:a,shouldAntialiasProgressImage:c}},{memoizeOptions:{resultEqualityCheck:en}}),cre=({children:e,config:t})=>{const n=ce(),{t:r}=we(),o=(t==null?void 0:t.shouldShowBetaLayout)??!0,s=(t==null?void 0:t.shouldShowDeveloperSettings)??!0,a=(t==null?void 0:t.shouldShowResetWebUiText)??!0;p.useEffect(()=>{s||n(Zw(!1))},[s,n]);const{isOpen:c,onOpen:d,onClose:f}=Yc(),{isOpen:h,onOpen:m,onClose:v}=Yc(),{shouldConfirmOnDelete:y,shouldDisplayGuides:S,enableImageDebugging:x,shouldUseCanvasBetaLayout:w,shouldUseSliders:_,shouldShowProgressInViewer:k,consoleLogLevel:P,shouldLogToConsole:j,shouldAntialiasProgressImage:I}=Y(lre),O=p.useCallback(()=>{Object.keys(window.localStorage).forEach(M=>{(P7.includes(M)||M.startsWith(j7))&&localStorage.removeItem(M)}),f(),m()},[f,m]),T=p.useCallback(M=>{n(E7(M))},[n]),R=p.useCallback(M=>{n(Zw(M.target.checked))},[n]);return i.jsxs(i.Fragment,{children:[p.cloneElement(e,{onClick:d}),i.jsxs(Td,{isOpen:c,onClose:f,size:"xl",isCentered:!0,children:[i.jsx(Li,{}),i.jsxs(Rd,{children:[i.jsx($i,{children:r("common.settingsLabel")}),i.jsx(zb,{}),i.jsx(Bi,{children:i.jsxs(X,{sx:{gap:4,flexDirection:"column"},children:[i.jsxs(ed,{children:[i.jsx($a,{size:"sm",children:r("settings.general")}),i.jsx(Zn,{label:r("settings.confirmOnDelete"),isChecked:y,onChange:M=>n(d3(M.target.checked))})]}),i.jsxs(ed,{children:[i.jsx($a,{size:"sm",children:r("settings.generation")}),i.jsx(ire,{})]}),i.jsxs(ed,{children:[i.jsx($a,{size:"sm",children:r("settings.ui")}),i.jsx(Zn,{label:r("settings.displayHelpIcons"),isChecked:S,onChange:M=>n(I7(M.target.checked))}),o&&i.jsx(Zn,{label:r("settings.useCanvasBeta"),isChecked:w,onChange:M=>n(O7(M.target.checked))}),i.jsx(Zn,{label:r("settings.useSlidersForAll"),isChecked:_,onChange:M=>n(T7(M.target.checked))}),i.jsx(Zn,{label:r("settings.showProgressInViewer"),isChecked:k,onChange:M=>n(p3(M.target.checked))}),i.jsx(Zn,{label:r("settings.antialiasProgressImages"),isChecked:I,onChange:M=>n(R7(M.target.checked))})]}),s&&i.jsxs(ed,{children:[i.jsx($a,{size:"sm",children:r("settings.developer")}),i.jsx(Zn,{label:r("settings.shouldLogToConsole"),isChecked:j,onChange:R}),i.jsx(Er,{disabled:!j,label:r("settings.consoleLogLevel"),onChange:T,value:P,data:M7.concat()}),i.jsx(Zn,{label:r("settings.enableImageDebugging"),isChecked:x,onChange:M=>n(D7(M.target.checked))})]}),i.jsxs(ed,{children:[i.jsx($a,{size:"sm",children:r("settings.resetWebUI")}),i.jsx(cn,{colorScheme:"error",onClick:O,children:r("settings.resetWebUI")}),a&&i.jsxs(i.Fragment,{children:[i.jsx(nt,{children:r("settings.resetWebUIDesc1")}),i.jsx(nt,{children:r("settings.resetWebUIDesc2")})]})]})]})}),i.jsx(zi,{children:i.jsx(cn,{onClick:f,children:r("common.close")})})]})]}),i.jsxs(Td,{closeOnOverlayClick:!1,isOpen:h,onClose:v,isCentered:!0,children:[i.jsx(Li,{backdropFilter:"blur(40px)"}),i.jsxs(Rd,{children:[i.jsx($i,{}),i.jsx(Bi,{children:i.jsx(X,{justifyContent:"center",children:i.jsx(nt,{fontSize:"lg",children:i.jsx(nt,{children:r("settings.resetComplete")})})})}),i.jsx(zi,{})]})]})]})},ed=e=>i.jsx(X,{layerStyle:"second",sx:{flexDirection:"column",gap:2,p:4,borderRadius:"base"},children:e.children}),ure=()=>{const{t:e}=we(),t=Jr("localization").isFeatureEnabled,n=Jr("bugLink").isFeatureEnabled,r=Jr("discordLink").isFeatureEnabled,o=Jr("githubLink").isFeatureEnabled;return i.jsxs(X,{sx:{gap:2,alignItems:"center"},children:[i.jsx(MT,{}),i.jsx(ql,{}),i.jsx(Jne,{}),i.jsx(nre,{children:i.jsx(Ne,{"aria-label":e("common.hotkeysLabel"),tooltip:e("common.hotkeysLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:i.jsx(UW,{})})}),t&&i.jsx(ore,{}),n&&i.jsx(wl,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI/issues",marginBottom:"-0.25rem",children:i.jsx(Ne,{"aria-label":e("common.reportBugLabel"),tooltip:e("common.reportBugLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:i.jsx(RW,{})})}),o&&i.jsx(wl,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI",marginBottom:"-0.25rem",children:i.jsx(Ne,{"aria-label":e("common.githubLabel"),tooltip:e("common.githubLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:i.jsx(kW,{})})}),r&&i.jsx(wl,{isExternal:!0,href:"https://discord.gg/ZmtBAhwWhy",marginBottom:"-0.25rem",children:i.jsx(Ne,{"aria-label":e("common.discordLabel"),tooltip:e("common.discordLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:i.jsx(_W,{})})}),i.jsx(ere,{}),i.jsx(cre,{children:i.jsx(Ne,{"aria-label":e("common.settingsLabel"),tooltip:e("common.settingsLabel"),variant:"link","data-variant":"link",fontSize:22,size:"sm",icon:i.jsx($ne,{})})})]})},dre=p.memo(ure),fre=Oe(wo,e=>{const{isUploading:t}=e;let n="";return t&&(n="Uploading..."),{tooltip:n,shouldShow:t}}),pre=()=>{const{shouldShow:e,tooltip:t}=Y(fre);return e?i.jsx(X,{sx:{alignItems:"center",justifyContent:"center",color:"base.600"},children:i.jsx(Wn,{label:t,placement:"right",hasArrow:!0,children:i.jsx(mu,{})})}):null},hre=p.memo(pre),Zi=e=>e.config,{createElement:iu,createContext:mre,forwardRef:DT,useCallback:_i,useContext:AT,useEffect:Ga,useImperativeHandle:NT,useLayoutEffect:gre,useMemo:vre,useRef:ms,useState:xd}=Qy,zk=Qy["useId".toString()],yre=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Um=yre?gre:()=>{},bre=typeof zk=="function"?zk:()=>null;let xre=0;function Lx(e=null){const t=bre(),n=ms(e||t||null);return n.current===null&&(n.current=""+xre++),n.current}const nv=mre(null);nv.displayName="PanelGroupContext";function zT({children:e=null,className:t="",collapsedSize:n=0,collapsible:r=!1,defaultSize:o=null,forwardedRef:s,id:a=null,maxSize:c=100,minSize:d=10,onCollapse:f=null,onResize:h=null,order:m=null,style:v={},tagName:y="div"}){const S=AT(nv);if(S===null)throw Error("Panel components must be rendered within a PanelGroup container");const x=Lx(a),{collapsePanel:w,expandPanel:_,getPanelStyle:k,registerPanel:P,resizePanel:j,unregisterPanel:I}=S,O=ms({onCollapse:f,onResize:h});if(Ga(()=>{O.current.onCollapse=f,O.current.onResize=h}),d<0||d>100)throw Error(`Panel minSize must be between 0 and 100, but was ${d}`);if(c<0||c>100)throw Error(`Panel maxSize must be between 0 and 100, but was ${c}`);if(o!==null){if(o<0||o>100)throw Error(`Panel defaultSize must be between 0 and 100, but was ${o}`);d>o&&!r&&(console.error(`Panel minSize ${d} cannot be greater than defaultSize ${o}`),o=d)}const T=k(x,o),R=ms({size:$k(T)}),M=ms({callbacksRef:O,collapsedSize:n,collapsible:r,defaultSize:o,id:x,maxSize:c,minSize:d,order:m});return Um(()=>{R.current.size=$k(T),M.current.callbacksRef=O,M.current.collapsedSize=n,M.current.collapsible=r,M.current.defaultSize=o,M.current.id=x,M.current.maxSize=c,M.current.minSize=d,M.current.order=m}),Um(()=>(P(x,M),()=>{I(x)}),[m,x,P,I]),NT(s,()=>({collapse:()=>w(x),expand:()=>_(x),getCollapsed(){return R.current.size===0},getSize(){return R.current.size},resize:D=>j(x,D)}),[w,_,x,j]),iu(y,{children:e,className:t,"data-panel":"","data-panel-collapsible":r||void 0,"data-panel-id":x,"data-panel-size":parseFloat(""+T.flexGrow).toFixed(1),id:`data-panel-id-${x}`,style:{...T,...v}})}const Zd=DT((e,t)=>iu(zT,{...e,forwardedRef:t}));zT.displayName="Panel";Zd.displayName="forwardRef(Panel)";function $k(e){const{flexGrow:t}=e;return typeof t=="string"?parseFloat(t):t}const Vl=10;function ud(e,t,n,r,o,s,a,c){const{sizes:d}=c||{},f=d||s;if(o===0)return f;const h=fs(t),m=f.concat();let v=0;{const x=o<0?r:n,w=h.findIndex(j=>j.current.id===x),_=h[w],k=f[w],P=Lk(_,Math.abs(o),k,e);if(k===P)return f;P===0&&k>0&&a.set(x,k),o=o<0?k-P:P-k}let y=o<0?n:r,S=h.findIndex(x=>x.current.id===y);for(;;){const x=h[S],w=f[S],_=Math.abs(o)-Math.abs(v),k=Lk(x,0-_,w,e);if(w!==k&&(k===0&&w>0&&a.set(x.current.id,w),v+=w-k,m[S]=k,v.toPrecision(Vl).localeCompare(Math.abs(o).toPrecision(Vl),void 0,{numeric:!0})>=0))break;if(o<0){if(--S<0)break}else if(++S>=h.length)break}return v===0?f:(y=o<0?r:n,S=h.findIndex(x=>x.current.id===y),m[S]=f[S]+v,m)}function wc(e,t,n){t.forEach((r,o)=>{const{callbacksRef:s,collapsedSize:a,collapsible:c,id:d}=e[o].current,f=n[d];if(f!==r){n[d]=r;const{onCollapse:h,onResize:m}=s.current;m&&m(r,f),c&&h&&((f==null||f===a)&&r!==a?h(!1):f!==a&&r===a&&h(!0))}})}function s1(e,t){if(t.length<2)return[null,null];const n=t.findIndex(a=>a.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 $T(e,t,n){if(e.size===1)return"100";const o=fs(e).findIndex(a=>a.current.id===t),s=n[o];return s==null?"0":s.toPrecision(Vl)}function wre(e){const t=document.querySelector(`[data-panel-id="${e}"]`);return t||null}function Bx(e){const t=document.querySelector(`[data-panel-group-id="${e}"]`);return t||null}function rv(e){const t=document.querySelector(`[data-panel-resize-handle-id="${e}"]`);return t||null}function Sre(e){return LT().findIndex(r=>r.getAttribute("data-panel-resize-handle-id")===e)??null}function LT(){return Array.from(document.querySelectorAll("[data-panel-resize-handle-id]"))}function BT(e){return Array.from(document.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function Fx(e,t,n){var d,f,h,m;const r=rv(t),o=BT(e),s=r?o.indexOf(r):-1,a=((f=(d=n[s])==null?void 0:d.current)==null?void 0:f.id)??null,c=((m=(h=n[s+1])==null?void 0:h.current)==null?void 0:m.id)??null;return[a,c]}function fs(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 Lk(e,t,n,r){var h;const o=n+t,{collapsedSize:s,collapsible:a,maxSize:c,minSize:d}=e.current;if(a){if(n>s){if(o<=d/2+s)return s}else if(!((h=r==null?void 0:r.type)==null?void 0:h.startsWith("key"))&&o<d)return s}return Math.min(c,Math.max(d,o))}function FT(e,t="Assertion failed!"){if(!e)throw console.error(t),Error(t)}function Cre({committedValuesRef:e,groupId:t,panels:n,setSizes:r,sizes:o,panelSizeBeforeCollapse:s}){Ga(()=>{const{direction:a,panels:c}=e.current,d=Bx(t),{height:f,width:h}=d.getBoundingClientRect(),v=BT(t).map(y=>{const S=y.getAttribute("data-panel-resize-handle-id"),x=fs(c),[w,_]=Fx(t,S,x);if(w==null||_==null)return()=>{};let k=0,P=100,j=0,I=0;x.forEach(A=>{A.current.id===w?(P=A.current.maxSize,k=A.current.minSize):(j+=A.current.minSize,I+=A.current.maxSize)});const O=Math.min(P,100-j),T=Math.max(k,(x.length-1)*100-I),R=$T(c,w,o);y.setAttribute("aria-valuemax",""+Math.round(O)),y.setAttribute("aria-valuemin",""+Math.round(T)),y.setAttribute("aria-valuenow",""+Math.round(parseInt(R)));const M=A=>{if(!A.defaultPrevented)switch(A.key){case"Enter":{A.preventDefault();const G=x.findIndex($=>$.current.id===w);if(G>=0){const $=x[G],H=o[G];if(H!=null){let U=0;H.toPrecision(Vl)<=$.current.minSize.toPrecision(Vl)?U=a==="horizontal"?h:f:U=-(a==="horizontal"?h:f);const q=ud(A,c,w,_,U,o,s.current,null);o!==q&&r(q)}}break}}};y.addEventListener("keydown",M);const D=wre(w);return D!=null&&y.setAttribute("aria-controls",D.id),()=>{y.removeAttribute("aria-valuemax"),y.removeAttribute("aria-valuemin"),y.removeAttribute("aria-valuenow"),y.removeEventListener("keydown",M),D!=null&&y.removeAttribute("aria-controls")}});return()=>{v.forEach(y=>y())}},[e,t,n,s,r,o])}function _re({disabled:e,handleId:t,resizeHandler:n}){Ga(()=>{if(e||n==null)return;const r=rv(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 a=LT(),c=Sre(t);FT(c!==null);const d=s.shiftKey?c>0?c-1:a.length-1:c+1<a.length?c+1:0;a[d].focus();break}}};return r.addEventListener("keydown",o),()=>{r.removeEventListener("keydown",o)}},[e,t,n])}function kre(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 HT(e,t,n,r=0,o=null){const s=n==="horizontal";let a=0;if(Ty(e))a=s?e.clientX:e.clientY;else if(Ry(e)){const h=e.touches[0];a=s?h.screenX:h.screenY}else return 0;const c=rv(t),d=o||c.getBoundingClientRect(),f=s?d.left:d.top;return a-f-r}function Pre(e,t,n,r,o,s,a){const{dragOffset:c=0,dragHandleRect:d,sizes:f}=a||{},h=f||s;if(jre(e)){const m=o==="horizontal",y=Bx(t).getBoundingClientRect(),S=m?y.width:y.height,x=e.shiftKey?10:100,w=S/x;let _=0;switch(e.key){case"ArrowDown":_=m?0:w;break;case"ArrowLeft":_=m?-w:0;break;case"ArrowRight":_=m?w:0;break;case"ArrowUp":_=m?0:-w;break;case"End":_=S;break;case"Home":_=-S;break}const[k,P]=Fx(t,n,r),j=_<0?k:P,I=r.findIndex(T=>T.current.id===j),O=r[I];if(O.current.collapsible){const T=h[I];(T===0||T.toPrecision(Vl)===O.current.minSize.toPrecision(Vl))&&(_=_<0?-O.current.minSize*S:O.current.minSize*S)}return _}else return HT(e,n,o,c,d)}function jre(e){return e.type==="keydown"}function Ty(e){return e.type.startsWith("mouse")}function Ry(e){return e.type.startsWith("touch")}let My=null,vl=null;function VT(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 Ere(){vl!==null&&(document.head.removeChild(vl),My=null,vl=null)}function a1(e){if(My===e)return;My=e;const t=VT(e);vl===null&&(vl=document.createElement("style"),document.head.appendChild(vl)),vl.innerHTML=`*{cursor: ${t}!important;}`}function Ire(e,t=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}function WT(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 UT(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 Ore(e,t,n){const r=UT(e,n);if(r){const o=WT(t);return r[o]??null}return null}function Tre(e,t,n,r){const o=WT(t),s=UT(e,r)||{};s[o]=n;try{r.setItem(`PanelGroup:sizes:${e}`,JSON.stringify(s))}catch(a){console.error(a)}}const i1={};function Bk(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 dd={getItem:e=>(Bk(dd),dd.getItem(e)),setItem:(e,t)=>{Bk(dd),dd.setItem(e,t)}};function GT({autoSaveId:e,children:t=null,className:n="",direction:r,disablePointerEventsDuringResize:o=!1,forwardedRef:s,id:a=null,onLayout:c,storage:d=dd,style:f={},tagName:h="div"}){const m=Lx(a),[v,y]=xd(null),[S,x]=xd(new Map),w=ms(null),_=ms({onLayout:c});Ga(()=>{_.current.onLayout=c});const k=ms({}),[P,j]=xd([]),I=ms(new Map),O=ms(0),T=ms({direction:r,panels:S,sizes:P});NT(s,()=>({getLayout:()=>{const{sizes:z}=T.current;return z},setLayout:z=>{const L=z.reduce((fe,ae)=>fe+ae,0);FT(L===100,"Panel sizes must add up to 100%");const{panels:V}=T.current,W=k.current,te=fs(V);j(z),wc(te,z,W)}}),[]),Um(()=>{T.current.direction=r,T.current.panels=S,T.current.sizes=P}),Cre({committedValuesRef:T,groupId:m,panels:S,setSizes:j,sizes:P,panelSizeBeforeCollapse:I}),Ga(()=>{const{onLayout:z}=_.current,{panels:L,sizes:V}=T.current;if(V.length>0){z&&z(V);const W=k.current,te=fs(L);wc(te,V,W)}},[P]),Um(()=>{if(T.current.sizes.length===S.size)return;let L=null;if(e){const V=fs(S);L=Ore(e,V,d)}if(L!=null)j(L);else{const V=fs(S);let W=0,te=0,fe=0;if(V.forEach(ae=>{fe+=ae.current.minSize,ae.current.defaultSize===null?W++:te+=ae.current.defaultSize}),te>100)throw new Error("Default panel sizes cannot exceed 100%");if(V.length>1&&W===0&&te!==100)throw new Error("Invalid default sizes specified for panels");if(fe>100)throw new Error("Minimum panel sizes cannot exceed 100%");j(V.map(ae=>ae.current.defaultSize===null?(100-te)/W:ae.current.defaultSize))}},[e,S,d]),Ga(()=>{if(e){if(P.length===0||P.length!==S.size)return;const z=fs(S);i1[e]||(i1[e]=Ire(Tre,100)),i1[e](e,z,P,d)}},[e,S,P,d]);const R=_i((z,L)=>{const{panels:V}=T.current;return V.size===0?{flexBasis:0,flexGrow:L??void 0,flexShrink:1,overflow:"hidden"}:{flexBasis:0,flexGrow:$T(V,z,P),flexShrink:1,overflow:"hidden",pointerEvents:o&&v!==null?"none":void 0}},[v,o,P]),M=_i((z,L)=>{x(V=>{if(V.has(z))return V;const W=new Map(V);return W.set(z,L),W})},[]),D=_i(z=>V=>{V.preventDefault();const{direction:W,panels:te,sizes:fe}=T.current,ae=fs(te),[J,B]=Fx(m,z,ae);if(J==null||B==null)return;let oe=Pre(V,m,z,ae,W,fe,w.current);if(oe===0)return;const ge=Bx(m).getBoundingClientRect(),se=W==="horizontal";document.dir==="rtl"&&se&&(oe=-oe);const pe=se?ge.width:ge.height,ue=oe/pe*100,be=ud(V,te,J,B,ue,fe,I.current,w.current),ke=!kre(fe,be);if((Ty(V)||Ry(V))&&O.current!=ue&&a1(ke?se?"horizontal":"vertical":se?oe<0?"horizontal-min":"horizontal-max":oe<0?"vertical-min":"vertical-max"),ke){const ie=k.current;j(be),wc(ae,be,ie)}O.current=ue},[m]),A=_i(z=>{x(L=>{if(!L.has(z))return L;const V=new Map(L);return V.delete(z),V})},[]),G=_i(z=>{const{panels:L,sizes:V}=T.current,W=L.get(z);if(W==null)return;const{collapsedSize:te,collapsible:fe}=W.current;if(!fe)return;const ae=fs(L),J=ae.indexOf(W);if(J<0)return;const B=V[J];if(B===te)return;I.current.set(z,B);const[oe,le]=s1(z,ae);if(oe==null||le==null)return;const se=J===ae.length-1?B:te-B,pe=ud(null,L,oe,le,se,V,I.current,null);if(V!==pe){const ue=k.current;j(pe),wc(ae,pe,ue)}},[]),$=_i(z=>{const{panels:L,sizes:V}=T.current,W=L.get(z);if(W==null)return;const{collapsedSize:te,minSize:fe}=W.current,ae=I.current.get(z)||fe;if(!ae)return;const J=fs(L),B=J.indexOf(W);if(B<0||V[B]!==te)return;const[le,ge]=s1(z,J);if(le==null||ge==null)return;const pe=B===J.length-1?te-ae:ae,ue=ud(null,L,le,ge,pe,V,I.current,null);if(V!==ue){const be=k.current;j(ue),wc(J,ue,be)}},[]),H=_i((z,L)=>{const{panels:V,sizes:W}=T.current,te=V.get(z);if(te==null)return;const{collapsedSize:fe,collapsible:ae,maxSize:J,minSize:B}=te.current,oe=fs(V),le=oe.indexOf(te);if(le<0)return;const ge=W[le];if(ge===L)return;ae&&L===fe||(L=Math.min(J,Math.max(B,L)));const[se,pe]=s1(z,oe);if(se==null||pe==null)return;const be=le===oe.length-1?ge-L:L-ge,ke=ud(null,V,se,pe,be,W,I.current,null);if(W!==ke){const ie=k.current;j(ke),wc(oe,ke,ie)}},[]),U=vre(()=>({activeHandleId:v,collapsePanel:G,direction:r,expandPanel:$,getPanelStyle:R,groupId:m,registerPanel:M,registerResizeHandle:D,resizePanel:H,startDragging:(z,L)=>{if(y(z),Ty(L)||Ry(L)){const V=rv(z);w.current={dragHandleRect:V.getBoundingClientRect(),dragOffset:HT(L,z,r),sizes:T.current.sizes}}},stopDragging:()=>{Ere(),y(null),w.current=null},unregisterPanel:A}),[v,G,r,$,R,m,M,D,H,A]),q={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return iu(nv.Provider,{children:iu(h,{children:t,className:n,"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":m,style:{...q,...f}}),value:U})}const Hx=DT((e,t)=>iu(GT,{...e,forwardedRef:t}));GT.displayName="PanelGroup";Hx.displayName="forwardRef(PanelGroup)";function Dy({children:e=null,className:t="",disabled:n=!1,id:r=null,onDragging:o,style:s={},tagName:a="div"}){const c=ms(null),d=ms({onDragging:o});Ga(()=>{d.current.onDragging=o});const f=AT(nv);if(f===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{activeHandleId:h,direction:m,groupId:v,registerResizeHandle:y,startDragging:S,stopDragging:x}=f,w=Lx(r),_=h===w,[k,P]=xd(!1),[j,I]=xd(null),O=_i(()=>{c.current.blur(),x();const{onDragging:M}=d.current;M&&M(!1)},[x]);Ga(()=>{if(n)I(null);else{const R=y(w);I(()=>R)}},[n,w,y]),Ga(()=>{if(n||j==null||!_)return;const R=G=>{j(G)},M=G=>{j(G)},A=c.current.ownerDocument;return A.body.addEventListener("contextmenu",O),A.body.addEventListener("mousemove",R),A.body.addEventListener("touchmove",R),A.body.addEventListener("mouseleave",M),window.addEventListener("mouseup",O),window.addEventListener("touchend",O),()=>{A.body.removeEventListener("contextmenu",O),A.body.removeEventListener("mousemove",R),A.body.removeEventListener("touchmove",R),A.body.removeEventListener("mouseleave",M),window.removeEventListener("mouseup",O),window.removeEventListener("touchend",O)}},[m,n,_,j,O]),_re({disabled:n,handleId:w,resizeHandler:j});const T={cursor:VT(m),touchAction:"none",userSelect:"none"};return iu(a,{children:e,className:t,"data-resize-handle-active":_?"pointer":k?"keyboard":void 0,"data-panel-group-direction":m,"data-panel-group-id":v,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":w,onBlur:()=>P(!1),onFocus:()=>P(!0),onMouseDown:R=>{S(w,R.nativeEvent);const{onDragging:M}=d.current;M&&M(!0)},onMouseUp:O,onTouchCancel:O,onTouchEnd:O,onTouchStart:R=>{S(w,R.nativeEvent);const{onDragging:M}=d.current;M&&M(!0)},ref:c,role:"separator",style:{...T,...s},tabIndex:0})}Dy.displayName="PanelResizeHandle";const Rre=(e,t,n,r="horizontal")=>{const o=p.useRef(null),[s,a]=p.useState(t),c=p.useCallback(()=>{var f,h;const d=(f=o.current)==null?void 0:f.getSize();d!==void 0&&d<s&&((h=o.current)==null||h.resize(s))},[s]);return p.useLayoutEffect(()=>{const d=document.querySelector(`[data-panel-group-id="${n}"]`),f=document.querySelectorAll("[data-panel-resize-handle-id]");if(!d)return;const h=new ResizeObserver(()=>{let m=r==="horizontal"?d.getBoundingClientRect().width:d.getBoundingClientRect().height;f.forEach(v=>{m-=r==="horizontal"?v.getBoundingClientRect().width:v.getBoundingClientRect().height}),a(e/m*100)});return h.observe(d),f.forEach(m=>{h.observe(m)}),window.addEventListener("resize",c),()=>{h.disconnect(),window.removeEventListener("resize",c)}},[n,c,s,e,r]),{ref:o,minSizePct:s}},Mre=Oe([Bn],e=>{const{initialImage:t}=e.generation,{asInitialImage:n,imageNames:r}=e.batch;return{initialImage:t,useBatchAsInitialImage:n,isResetButtonDisabled:n?r.length===0:!t}},Lt),Dre=()=>{const{initialImage:e}=Y(Mre),{currentData:t,isLoading:n,isError:r,isSuccess:o}=xa((e==null?void 0:e.imageName)??Ja.skipToken),s=p.useMemo(()=>{if(t)return{id:"initial-image",payloadType:"IMAGE_DTO",payload:{imageDTO:t}}},[t]),a=p.useMemo(()=>({id:"initial-image",actionType:"SET_INITIAL_IMAGE"}),[]);return i.jsx(Nl,{imageDTO:t,droppableData:a,draggableData:s,isUploadDisabled:!0,fitContainer:!0,dropLabel:"Set as Initial Image",noContentFallback:i.jsx(xf,{label:"No initial image selected"})})},Are=Oe([Bn],e=>{const{initialImage:t}=e.generation,{asInitialImage:n,imageNames:r}=e.batch;return{initialImage:t,useBatchAsInitialImage:n,isResetButtonDisabled:n?r.length===0:!t}},Lt),Nre=()=>{const{initialImage:e,useBatchAsInitialImage:t,isResetButtonDisabled:n}=Y(Are),r=ce(),{openUploader:o}=Ig();xa((e==null?void 0:e.imageName)??Ja.skipToken);const s=p.useMemo(()=>t?{type:"ADD_TO_BATCH"}:{type:"SET_INITIAL_IMAGE"},[t]),{getUploadButtonProps:a,getUploadInputProps:c}=kE({postUploadAction:s}),d=p.useCallback(()=>{r(t?A7():N7())},[r,t]),f=p.useCallback(()=>{o()},[o]);return p.useCallback(()=>{r(z7())},[r]),i.jsxs(X,{layerStyle:"first",sx:{position:"relative",flexDirection:"column",height:"full",width:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",p:4,gap:4},children:[i.jsxs(X,{sx:{w:"full",flexWrap:"wrap",justifyContent:"center",alignItems:"center",gap:2},children:[i.jsx(nt,{sx:{fontWeight:600,userSelect:"none",color:"base.700",_dark:{color:"base.200"}},children:"Initial Image"}),i.jsx(ql,{}),i.jsx(Ne,{tooltip:t?"Upload to Batch":"Upload Initial Image","aria-label":t?"Upload to Batch":"Upload Initial Image",icon:i.jsx(Ng,{}),onClick:f,...a()}),i.jsx(Ne,{tooltip:t?"Reset Batch":"Reset Initial Image","aria-label":t?"Reset Batch":"Reset Initial Image",icon:i.jsx(hx,{}),onClick:d,isDisabled:n})]}),i.jsx(Dre,{}),i.jsx("input",{...c()})]})},qT=e=>{const{sx:t}=e,n=ce(),r=Y(a=>a.ui.shouldPinParametersPanel),{t:o}=we(),s=()=>{n($7(!r)),n(ea())};return i.jsx(Wn,{label:o("common.pinOptionsPanel"),children:i.jsx(Ne,{...e,"aria-label":o("common.pinOptionsPanel"),onClick:s,icon:r?i.jsx(pE,{}):i.jsx(hE,{}),variant:"ghost",size:"sm",sx:{color:"base.700",_hover:{color:"base.550"},_active:{color:"base.500"},...t}})})},zre=Oe(ks,e=>{const{shouldPinParametersPanel:t,shouldShowParametersPanel:n}=e;return{shouldPinParametersPanel:t,shouldShowParametersPanel:n}}),$re=e=>{const{shouldPinParametersPanel:t,shouldShowParametersPanel:n}=Y(zre);return t&&n?i.jsxs(ut,{sx:{position:"relative",h:"full",w:RT,flexShrink:0},children:[i.jsx(X,{sx:{gap:2,flexDirection:"column",h:"full",w:"full",position:"absolute",overflowY:"auto"},children:e.children}),i.jsx(qT,{sx:{position:"absolute",top:0,insetInlineEnd:0}})]}):null},Vx=p.memo($re),Lre=e=>{const{direction:t="horizontal",...n}=e,{colorMode:r}=zo();return t==="horizontal"?i.jsx(Dy,{children:i.jsx(X,{sx:{w:6,h:"full",justifyContent:"center",alignItems:"center"},...n,children:i.jsx(ut,{sx:{w:.5,h:"calc(100% - 4px)",bg:Fe("base.100","base.850")(r)}})})}):i.jsx(Dy,{children:i.jsx(X,{sx:{w:"full",h:6,justifyContent:"center",alignItems:"center"},...n,children:i.jsx(ut,{sx:{w:"calc(100% - 4px)",h:.5,bg:Fe("base.100","base.850")(r)}})})})},YT=p.memo(Lre),Bre=Oe([Bn,L7],({ui:e,system:t},n)=>{const{shouldShowImageDetails:r,shouldHidePreview:o,shouldShowProgressInViewer:s}=e,{progressImage:a,shouldAntialiasProgressImage:c}=t;return{shouldShowImageDetails:r,shouldHidePreview:o,imageName:n,progressImage:a,shouldShowProgressInViewer:s,shouldAntialiasProgressImage:c}},{memoizeOptions:{resultEqualityCheck:en}}),Fre=()=>{const{shouldShowImageDetails:e,imageName:t,progressImage:n,shouldShowProgressInViewer:r,shouldAntialiasProgressImage:o}=Y(Bre),{currentData:s,isLoading:a,isError:c,isSuccess:d}=xa(t??Ja.skipToken),f=p.useMemo(()=>{if(s)return{id:"current-image",payloadType:"IMAGE_DTO",payload:{imageDTO:s}}},[s]),h=p.useMemo(()=>({id:"current-image",actionType:"SET_CURRENT_IMAGE"}),[]);return i.jsxs(X,{sx:{width:"full",height:"full",alignItems:"center",justifyContent:"center",position:"relative"},children:[n&&r?i.jsx(eg,{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"}}):i.jsx(Nl,{imageDTO:s,droppableData:h,draggableData:f,isUploadDisabled:!0,fitContainer:!0,dropLabel:"Set as Current Image"}),e&&s&&i.jsx(ut,{sx:{position:"absolute",top:"0",width:"full",height:"full",borderRadius:"base",overflow:"scroll"},children:i.jsx(gT,{image:s})}),!e&&s&&i.jsx(ut,{sx:{position:"absolute",top:"0",width:"full",height:"full",pointerEvents:"none"},children:i.jsx(vT,{})})]})},Hre=p.memo(Fre),Vre=()=>i.jsxs(X,{sx:{position:"relative",flexDirection:"column",height:"100%",width:"100%",rowGap:4,alignItems:"center",justifyContent:"center"},children:[i.jsx(mT,{}),i.jsx(Hre,{})]}),KT=()=>i.jsx(ut,{layerStyle:"first",sx:{position:"relative",width:"100%",height:"100%",p:4,borderRadius:"base"},children:i.jsx(X,{sx:{width:"100%",height:"100%"},children:i.jsx(Vre,{})})}),Wre=e=>{const{label:t,activeLabel:n,children:r,defaultIsOpen:o=!1}=e,{isOpen:s,onToggle:a}=Yc({defaultIsOpen:o}),{colorMode:c}=zo();return i.jsxs(ut,{children:[i.jsxs(X,{onClick:a,sx:{alignItems:"center",p:2,px:4,gap:2,borderTopRadius:"base",borderBottomRadius:s?0:"base",bg:s?Fe("base.200","base.750")(c):Fe("base.150","base.800")(c),color:Fe("base.900","base.100")(c),_hover:{bg:s?Fe("base.250","base.700")(c):Fe("base.200","base.750")(c)},fontSize:"sm",fontWeight:600,cursor:"pointer",transitionProperty:"common",transitionDuration:"normal",userSelect:"none"},children:[t,i.jsx(Xo,{children:n&&i.jsx(No.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}},children:i.jsx(nt,{sx:{color:"accent.500",_dark:{color:"accent.300"}},children:n})},"statusText")}),i.jsx(ql,{}),i.jsx(vx,{sx:{w:"1rem",h:"1rem",transform:s?"rotate(0deg)":"rotate(180deg)",transitionProperty:"common",transitionDuration:"normal"}})]}),i.jsx(sg,{in:s,animateOpacity:!0,style:{overflow:"unset"},children:i.jsx(ut,{sx:{p:4,borderBottomRadius:"base",bg:Fe("base.100","base.800")(c)},children:r})})]})},Qo=p.memo(Wre),Ure=Oe(Bn,e=>{const{combinatorial:t,isEnabled:n}=e.dynamicPrompts;return{combinatorial:t,isDisabled:!n}},Lt),Gre=()=>{const{combinatorial:e,isDisabled:t}=Y(Ure),n=ce(),r=p.useCallback(()=>{n(B7())},[n]);return i.jsx(Zn,{isDisabled:t,label:"Combinatorial Generation",isChecked:e,onChange:r})},qre=Oe(Bn,e=>{const{isEnabled:t}=e.dynamicPrompts;return{isEnabled:t}},Lt),Yre=()=>{const e=ce(),{isEnabled:t}=Y(qre),n=p.useCallback(()=>{e(F7())},[e]);return i.jsx(Zn,{label:"Enable Dynamic Prompts",isChecked:t,onChange:n})},Kre=Oe(Bn,e=>{const{maxPrompts:t,combinatorial:n,isEnabled:r}=e.dynamicPrompts,{min:o,sliderMax:s,inputMax:a}=e.config.sd.dynamicPrompts.maxPrompts;return{maxPrompts:t,min:o,sliderMax:s,inputMax:a,isDisabled:!r||!n}},Lt),Xre=()=>{const{maxPrompts:e,min:t,sliderMax:n,inputMax:r,isDisabled:o}=Y(Kre),s=ce(),a=p.useCallback(d=>{s(H7(d))},[s]),c=p.useCallback(()=>{s(V7())},[s]);return i.jsx(Et,{label:"Max Prompts",isDisabled:o,min:t,max:n,value:e,onChange:a,sliderNumberInputProps:{max:r},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:c})},Zre=Oe(Bn,e=>{const{isEnabled:t}=e.dynamicPrompts;return{activeLabel:t?"Enabled":void 0}},Lt),Wx=()=>{const{activeLabel:e}=Y(Zre);return i.jsx(Qo,{label:"Dynamic Prompts",activeLabel:e,children:i.jsxs(X,{sx:{gap:2,flexDir:"column"},children:[i.jsx(Yre,{}),i.jsx(Gre,{}),i.jsx(Xre,{})]})})},Qre=e=>{const t=ce(),{lora:n}=e,r=p.useCallback(a=>{t(Qw({id:n.id,weight:a}))},[t,n.id]),o=p.useCallback(()=>{t(Qw({id:n.id,weight:1}))},[t,n.id]),s=p.useCallback(()=>{t(W7(n.id))},[t,n.id]);return i.jsxs(X,{sx:{gap:2.5,alignItems:"flex-end"},children:[i.jsx(Et,{label:n.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]}),i.jsx(Ne,{size:"sm",onClick:s,tooltip:"Remove LoRA","aria-label":"Remove LoRA",icon:i.jsx(Mo,{}),colorScheme:"error"})]})},Jre=p.memo(Qre),eoe=Oe(Bn,({lora:e})=>{const{loras:t}=e;return{loras:t}},Lt),toe=()=>{const{loras:e}=Y(eoe);return Pa(e,t=>i.jsx(Jre,{lora:t},t.name))},Fk=of({sortComparer:(e,t)=>e.name.localeCompare(t.name)}),Hk=of({sortComparer:(e,t)=>e.name.localeCompare(t.name)}),Vk=of({sortComparer:(e,t)=>e.name.localeCompare(t.name)}),Wk=of({sortComparer:(e,t)=>e.name.localeCompare(t.name)}),Uk=of({sortComparer:(e,t)=>e.name.localeCompare(t.name)}),noe=({base_model:e,type:t,name:n})=>`${e}/${t}/${n}`,td=e=>{const t=[];return e.forEach(n=>{const r={...G7(n),id:noe(n)};t.push(r)}),t},roe=U7.injectEndpoints({endpoints:e=>({getMainModels:e.query({query:()=>({url:"models/",params:{model_type:"main"}}),providesTags:(t,n,r)=>{const o=[{id:"MainModel",type:Vu}];return t&&o.push(...t.ids.map(s=>({type:"MainModel",id:s}))),o},transformResponse:(t,n,r)=>{const o=td(t.models);return Fk.setAll(Fk.getInitialState(),o)}}),getLoRAModels:e.query({query:()=>({url:"models/",params:{model_type:"lora"}}),providesTags:(t,n,r)=>{const o=[{id:"LoRAModel",type:Vu}];return t&&o.push(...t.ids.map(s=>({type:"LoRAModel",id:s}))),o},transformResponse:(t,n,r)=>{const o=td(t.models);return Hk.setAll(Hk.getInitialState(),o)}}),getControlNetModels:e.query({query:()=>({url:"models/",params:{model_type:"controlnet"}}),providesTags:(t,n,r)=>{const o=[{id:"ControlNetModel",type:Vu}];return t&&o.push(...t.ids.map(s=>({type:"ControlNetModel",id:s}))),o},transformResponse:(t,n,r)=>{const o=td(t.models);return Vk.setAll(Vk.getInitialState(),o)}}),getVaeModels:e.query({query:()=>({url:"models/",params:{model_type:"vae"}}),providesTags:(t,n,r)=>{const o=[{id:"VaeModel",type:Vu}];return t&&o.push(...t.ids.map(s=>({type:"VaeModel",id:s}))),o},transformResponse:(t,n,r)=>{const o=td(t.models);return Uk.setAll(Uk.getInitialState(),o)}}),getTextualInversionModels:e.query({query:()=>({url:"models/",params:{model_type:"embedding"}}),providesTags:(t,n,r)=>{const o=[{id:"TextualInversionModel",type:Vu}];return t&&o.push(...t.ids.map(s=>({type:"TextualInversionModel",id:s}))),o},transformResponse:(t,n,r)=>{const o=td(t.models);return Wk.setAll(Wk.getInitialState(),o)}})})}),{useGetMainModelsQuery:kf,useGetControlNetModelsQuery:bpe,useGetLoRAModelsQuery:XT,useGetTextualInversionModelsQuery:xpe,useGetVaeModelsQuery:ZT}=roe,ooe=Oe(Bn,({lora:e})=>({loras:e.loras}),Lt),soe=()=>{const e=ce(),{loras:t}=Y(ooe),{data:n}=XT(),r=p.useMemo(()=>{if(!n)return[];const s=[];return Ul(n.entities,(a,c)=>{!a||c in t||s.push({value:c,label:a.name,description:a.description})}),s},[t,n]),o=p.useCallback(s=>{const a=n==null?void 0:n.entities[s[0]];a&&s[0]&&e(q7(a))},[e,n==null?void 0:n.entities]);return i.jsx($x,{placeholder:r.length===0?"All LoRAs added":"Add LoRA",value:[],data:r,maxDropdownHeight:400,nothingFound:"No matching LoRAs",itemComponent:QT,disabled:r.length===0,filter:(s,a,c)=>c.label.toLowerCase().includes(s.toLowerCase().trim())||c.value.toLowerCase().includes(s.toLowerCase().trim()),onChange:o})},QT=p.forwardRef(({label:e,description:t,...n},r)=>i.jsx("div",{ref:r,...n,children:i.jsxs("div",{children:[i.jsx(nt,{children:e}),t&&i.jsx(nt,{size:"xs",color:"base.600",children:t})]})}));QT.displayName="SelectItem";const aoe=Oe(Bn,e=>{const t=Y7(e.lora.loras);return{activeLabel:t>0?`${t} Active`:void 0}},Lt),ioe=()=>{const{activeLabel:e}=Y(aoe);return i.jsx(Qo,{label:"LoRA",activeLabel:e,children:i.jsxs(X,{sx:{flexDir:"column",gap:2},children:[i.jsx(soe,{}),i.jsx(toe,{})]})})},Ux=p.memo(ioe),loe=e=>{const r=e.split(",").map(o=>o.split(":")).map(o=>({seed:Number(o[0]),weight:Number(o[1])}));return Gx(r)?r:!1},Gx=e=>typeof e=="string"?!!loe(e):!!(e.length&&!e.some(t=>{const{seed:n,weight:r}=t,o=!isNaN(parseInt(n.toString(),10)),s=!isNaN(parseInt(r.toString(),10))&&r>=0&&r<=1;return!(o&&s)})),coe=Oe([Bn,Gr],({generation:e,system:t,batch:n},r)=>{const{shouldGenerateVariations:o,seedWeights:s,initialImage:a,seed:c}=e,{isProcessing:d,isConnected:f}=t,{isEnabled:h,asInitialImage:m,imageNames:v}=n;let y=!0;const S=[];return r==="img2img"&&!a&&!(m&&v.length>1)&&(y=!1,S.push("No initial image selected")),d&&(y=!1,S.push("System Busy")),f||(y=!1,S.push("System Disconnected")),o&&(!(Gx(s)||s==="")||c===-1)&&(y=!1,S.push("Seed-Weights badly formatted.")),{isReady:y,reasonsWhyNotReady:S}},Lt),eo=()=>{const{isReady:e}=Y(coe);return e},uoe=Oe(Zi,e=>Pa(K7,n=>({label:n.label,value:n.type})).filter(n=>!e.sd.disabledControlNetModels.includes(n.value))),doe=e=>{const{controlNetId:t,model:n}=e,r=Y(uoe),o=ce(),s=eo(),a=p.useCallback(c=>{o(X7({controlNetId:t,model:c}))},[t,o]);return i.jsx(Er,{data:r,value:n,onChange:a,disabled:!s,tooltip:n})},foe=p.memo(doe),poe=e=>{const{controlNetId:t,weight:n,mini:r=!1}=e,o=ce(),s=p.useCallback(a=>{o(Z7({controlNetId:t,weight:a}))},[t,o]);return i.jsx(Et,{label:"Weight",sliderFormLabelProps:{pb:2},value:n,onChange:s,min:-1,max:1,step:.01,withSliderMarks:!r,sliderMarks:[-1,0,1]})},hoe=p.memo(poe),moe=Oe(v3,e=>{const{pendingControlImages:t}=e;return{pendingControlImages:t}},Lt),goe=e=>{const{height:t}=e,{controlNetId:n,controlImage:r,processedControlImage:o,processorType:s}=e.controlNet,a=ce(),{pendingControlImages:c}=Y(moe),[d,f]=p.useState(!1),{currentData:h,isLoading:m,isError:v,isSuccess:y}=xa(r??Ja.skipToken),{currentData:S,isLoading:x,isError:w,isSuccess:_}=xa(o??Ja.skipToken),k=p.useCallback(()=>{a(Q7({controlNetId:n,controlImage:null}))},[n,a]),P=p.useCallback(()=>{f(!0)},[]),j=p.useCallback(()=>{f(!1)},[]),I=p.useMemo(()=>{if(h)return{id:n,payloadType:"IMAGE_DTO",payload:{imageDTO:h}}},[h,n]),O=p.useMemo(()=>({id:n,actionType:"SET_CONTROLNET_IMAGE",context:{controlNetId:n}}),[n]),T=p.useMemo(()=>({type:"SET_CONTROLNET_IMAGE",controlNetId:n}),[n]),R=h&&S&&!d&&!c.includes(n)&&s!=="none";return i.jsxs(X,{onMouseEnter:P,onMouseLeave:j,sx:{position:"relative",w:"full",h:t,alignItems:"center",justifyContent:"center"},children:[i.jsx(Nl,{draggableData:I,droppableData:O,imageDTO:h,isDropDisabled:R,onClickReset:k,postUploadAction:T,resetTooltip:"Reset Control Image",withResetIcon:!!h}),i.jsx(ut,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",opacity:R?1:0,transitionProperty:"common",transitionDuration:"normal",pointerEvents:"none"},children:i.jsx(Nl,{draggableData:I,droppableData:O,imageDTO:S,isUploadDisabled:!0,onClickReset:k,resetTooltip:"Reset Control Image",withResetIcon:!!h})}),c.includes(n)&&i.jsx(ut,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",objectFit:"contain"},children:i.jsx(_E,{image:h})})]})},Gk=p.memo(goe),ra=()=>{const e=ce();return p.useCallback((n,r)=>{e(J7({controlNetId:n,changes:r}))},[e])};function oa(e){return i.jsx(X,{sx:{flexDirection:"column",gap:2},children:e.children})}const qk=Ps.canny_image_processor.default,voe=e=>{const{controlNetId:t,processorNode:n}=e,{low_threshold:r,high_threshold:o}=n,s=eo(),a=ra(),c=p.useCallback(m=>{a(t,{low_threshold:m})},[t,a]),d=p.useCallback(()=>{a(t,{low_threshold:qk.low_threshold})},[t,a]),f=p.useCallback(m=>{a(t,{high_threshold:m})},[t,a]),h=p.useCallback(()=>{a(t,{high_threshold:qk.high_threshold})},[t,a]);return i.jsxs(oa,{children:[i.jsx(Et,{isDisabled:!s,label:"Low Threshold",value:r,onChange:c,handleReset:d,withReset:!0,min:0,max:255,withInput:!0,withSliderMarks:!0}),i.jsx(Et,{isDisabled:!s,label:"High Threshold",value:o,onChange:f,handleReset:h,withReset:!0,min:0,max:255,withInput:!0,withSliderMarks:!0})]})},yoe=p.memo(voe),Yk=Ps.hed_image_processor.default,boe=e=>{const{controlNetId:t,processorNode:{detect_resolution:n,image_resolution:r,scribble:o}}=e,s=eo(),a=ra(),c=p.useCallback(v=>{a(t,{detect_resolution:v})},[t,a]),d=p.useCallback(v=>{a(t,{image_resolution:v})},[t,a]),f=p.useCallback(v=>{a(t,{scribble:v.target.checked})},[t,a]),h=p.useCallback(()=>{a(t,{detect_resolution:Yk.detect_resolution})},[t,a]),m=p.useCallback(()=>{a(t,{image_resolution:Yk.image_resolution})},[t,a]);return i.jsxs(oa,{children:[i.jsx(Et,{label:"Detect Resolution",value:n,onChange:c,handleReset:h,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!s}),i.jsx(Et,{label:"Image Resolution",value:r,onChange:d,handleReset:m,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!s}),i.jsx(Zn,{label:"Scribble",isChecked:o,onChange:f,isDisabled:!s})]})},xoe=p.memo(boe),Kk=Ps.lineart_image_processor.default,woe=e=>{const{controlNetId:t,processorNode:n}=e,{image_resolution:r,detect_resolution:o,coarse:s}=n,a=ra(),c=eo(),d=p.useCallback(y=>{a(t,{detect_resolution:y})},[t,a]),f=p.useCallback(y=>{a(t,{image_resolution:y})},[t,a]),h=p.useCallback(()=>{a(t,{detect_resolution:Kk.detect_resolution})},[t,a]),m=p.useCallback(()=>{a(t,{image_resolution:Kk.image_resolution})},[t,a]),v=p.useCallback(y=>{a(t,{coarse:y.target.checked})},[t,a]);return i.jsxs(oa,{children:[i.jsx(Et,{label:"Detect Resolution",value:o,onChange:d,handleReset:h,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!c}),i.jsx(Et,{label:"Image Resolution",value:r,onChange:f,handleReset:m,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!c}),i.jsx(Zn,{label:"Coarse",isChecked:s,onChange:v,isDisabled:!c})]})},Soe=p.memo(woe),Xk=Ps.lineart_anime_image_processor.default,Coe=e=>{const{controlNetId:t,processorNode:n}=e,{image_resolution:r,detect_resolution:o}=n,s=ra(),a=eo(),c=p.useCallback(m=>{s(t,{detect_resolution:m})},[t,s]),d=p.useCallback(m=>{s(t,{image_resolution:m})},[t,s]),f=p.useCallback(()=>{s(t,{detect_resolution:Xk.detect_resolution})},[t,s]),h=p.useCallback(()=>{s(t,{image_resolution:Xk.image_resolution})},[t,s]);return i.jsxs(oa,{children:[i.jsx(Et,{label:"Detect Resolution",value:o,onChange:c,handleReset:f,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!a}),i.jsx(Et,{label:"Image Resolution",value:r,onChange:d,handleReset:h,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!a})]})},_oe=p.memo(Coe),nd=Ps.content_shuffle_image_processor.default,koe=e=>{const{controlNetId:t,processorNode:n}=e,{image_resolution:r,detect_resolution:o,w:s,h:a,f:c}=n,d=ra(),f=eo(),h=p.useCallback(j=>{d(t,{detect_resolution:j})},[t,d]),m=p.useCallback(()=>{d(t,{detect_resolution:nd.detect_resolution})},[t,d]),v=p.useCallback(j=>{d(t,{image_resolution:j})},[t,d]),y=p.useCallback(()=>{d(t,{image_resolution:nd.image_resolution})},[t,d]),S=p.useCallback(j=>{d(t,{w:j})},[t,d]),x=p.useCallback(()=>{d(t,{w:nd.w})},[t,d]),w=p.useCallback(j=>{d(t,{h:j})},[t,d]),_=p.useCallback(()=>{d(t,{h:nd.h})},[t,d]),k=p.useCallback(j=>{d(t,{f:j})},[t,d]),P=p.useCallback(()=>{d(t,{f:nd.f})},[t,d]);return i.jsxs(oa,{children:[i.jsx(Et,{label:"Detect Resolution",value:o,onChange:h,handleReset:m,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!f}),i.jsx(Et,{label:"Image Resolution",value:r,onChange:v,handleReset:y,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!f}),i.jsx(Et,{label:"W",value:s,onChange:S,handleReset:x,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!f}),i.jsx(Et,{label:"H",value:a,onChange:w,handleReset:_,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!f}),i.jsx(Et,{label:"F",value:c,onChange:k,handleReset:P,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!f})]})},Poe=p.memo(koe),Zk=Ps.mediapipe_face_processor.default,joe=e=>{const{controlNetId:t,processorNode:n}=e,{max_faces:r,min_confidence:o}=n,s=ra(),a=eo(),c=p.useCallback(m=>{s(t,{max_faces:m})},[t,s]),d=p.useCallback(m=>{s(t,{min_confidence:m})},[t,s]),f=p.useCallback(()=>{s(t,{max_faces:Zk.max_faces})},[t,s]),h=p.useCallback(()=>{s(t,{min_confidence:Zk.min_confidence})},[t,s]);return i.jsxs(oa,{children:[i.jsx(Et,{label:"Max Faces",value:r,onChange:c,handleReset:f,withReset:!0,min:1,max:20,withInput:!0,withSliderMarks:!0,isDisabled:!a}),i.jsx(Et,{label:"Min Confidence",value:o,onChange:d,handleReset:h,withReset:!0,min:0,max:1,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:!a})]})},Eoe=p.memo(joe),Qk=Ps.midas_depth_image_processor.default,Ioe=e=>{const{controlNetId:t,processorNode:n}=e,{a_mult:r,bg_th:o}=n,s=ra(),a=eo(),c=p.useCallback(m=>{s(t,{a_mult:m})},[t,s]),d=p.useCallback(m=>{s(t,{bg_th:m})},[t,s]),f=p.useCallback(()=>{s(t,{a_mult:Qk.a_mult})},[t,s]),h=p.useCallback(()=>{s(t,{bg_th:Qk.bg_th})},[t,s]);return i.jsxs(oa,{children:[i.jsx(Et,{label:"a_mult",value:r,onChange:c,handleReset:f,withReset:!0,min:0,max:20,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:!a}),i.jsx(Et,{label:"bg_th",value:o,onChange:d,handleReset:h,withReset:!0,min:0,max:20,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:!a})]})},Ooe=p.memo(Ioe),Xp=Ps.mlsd_image_processor.default,Toe=e=>{const{controlNetId:t,processorNode:n}=e,{image_resolution:r,detect_resolution:o,thr_d:s,thr_v:a}=n,c=ra(),d=eo(),f=p.useCallback(_=>{c(t,{detect_resolution:_})},[t,c]),h=p.useCallback(_=>{c(t,{image_resolution:_})},[t,c]),m=p.useCallback(_=>{c(t,{thr_d:_})},[t,c]),v=p.useCallback(_=>{c(t,{thr_v:_})},[t,c]),y=p.useCallback(()=>{c(t,{detect_resolution:Xp.detect_resolution})},[t,c]),S=p.useCallback(()=>{c(t,{image_resolution:Xp.image_resolution})},[t,c]),x=p.useCallback(()=>{c(t,{thr_d:Xp.thr_d})},[t,c]),w=p.useCallback(()=>{c(t,{thr_v:Xp.thr_v})},[t,c]);return i.jsxs(oa,{children:[i.jsx(Et,{label:"Detect Resolution",value:o,onChange:f,handleReset:y,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!d}),i.jsx(Et,{label:"Image Resolution",value:r,onChange:h,handleReset:S,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!d}),i.jsx(Et,{label:"W",value:s,onChange:m,handleReset:x,withReset:!0,min:0,max:1,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:!d}),i.jsx(Et,{label:"H",value:a,onChange:v,handleReset:w,withReset:!0,min:0,max:1,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:!d})]})},Roe=p.memo(Toe),Jk=Ps.normalbae_image_processor.default,Moe=e=>{const{controlNetId:t,processorNode:n}=e,{image_resolution:r,detect_resolution:o}=n,s=ra(),a=eo(),c=p.useCallback(m=>{s(t,{detect_resolution:m})},[t,s]),d=p.useCallback(m=>{s(t,{image_resolution:m})},[t,s]),f=p.useCallback(()=>{s(t,{detect_resolution:Jk.detect_resolution})},[t,s]),h=p.useCallback(()=>{s(t,{image_resolution:Jk.image_resolution})},[t,s]);return i.jsxs(oa,{children:[i.jsx(Et,{label:"Detect Resolution",value:o,onChange:c,handleReset:f,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!a}),i.jsx(Et,{label:"Image Resolution",value:r,onChange:d,handleReset:h,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!a})]})},Doe=p.memo(Moe),eP=Ps.openpose_image_processor.default,Aoe=e=>{const{controlNetId:t,processorNode:n}=e,{image_resolution:r,detect_resolution:o,hand_and_face:s}=n,a=ra(),c=eo(),d=p.useCallback(y=>{a(t,{detect_resolution:y})},[t,a]),f=p.useCallback(y=>{a(t,{image_resolution:y})},[t,a]),h=p.useCallback(()=>{a(t,{detect_resolution:eP.detect_resolution})},[t,a]),m=p.useCallback(()=>{a(t,{image_resolution:eP.image_resolution})},[t,a]),v=p.useCallback(y=>{a(t,{hand_and_face:y.target.checked})},[t,a]);return i.jsxs(oa,{children:[i.jsx(Et,{label:"Detect Resolution",value:o,onChange:d,handleReset:h,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!c}),i.jsx(Et,{label:"Image Resolution",value:r,onChange:f,handleReset:m,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!c}),i.jsx(Zn,{label:"Hand and Face",isChecked:s,onChange:v,isDisabled:!c})]})},Noe=p.memo(Aoe),tP=Ps.pidi_image_processor.default,zoe=e=>{const{controlNetId:t,processorNode:n}=e,{image_resolution:r,detect_resolution:o,scribble:s,safe:a}=n,c=ra(),d=eo(),f=p.useCallback(x=>{c(t,{detect_resolution:x})},[t,c]),h=p.useCallback(x=>{c(t,{image_resolution:x})},[t,c]),m=p.useCallback(()=>{c(t,{detect_resolution:tP.detect_resolution})},[t,c]),v=p.useCallback(()=>{c(t,{image_resolution:tP.image_resolution})},[t,c]),y=p.useCallback(x=>{c(t,{scribble:x.target.checked})},[t,c]),S=p.useCallback(x=>{c(t,{safe:x.target.checked})},[t,c]);return i.jsxs(oa,{children:[i.jsx(Et,{label:"Detect Resolution",value:o,onChange:f,handleReset:m,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!d}),i.jsx(Et,{label:"Image Resolution",value:r,onChange:h,handleReset:v,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!d}),i.jsx(Zn,{label:"Scribble",isChecked:s,onChange:y}),i.jsx(Zn,{label:"Safe",isChecked:a,onChange:S,isDisabled:!d})]})},$oe=p.memo(zoe),Loe=e=>null,Boe=p.memo(Loe),Foe=e=>{const{controlNetId:t,processorNode:n}=e;return n.type==="canny_image_processor"?i.jsx(yoe,{controlNetId:t,processorNode:n}):n.type==="hed_image_processor"?i.jsx(xoe,{controlNetId:t,processorNode:n}):n.type==="lineart_image_processor"?i.jsx(Soe,{controlNetId:t,processorNode:n}):n.type==="content_shuffle_image_processor"?i.jsx(Poe,{controlNetId:t,processorNode:n}):n.type==="lineart_anime_image_processor"?i.jsx(_oe,{controlNetId:t,processorNode:n}):n.type==="mediapipe_face_processor"?i.jsx(Eoe,{controlNetId:t,processorNode:n}):n.type==="midas_depth_image_processor"?i.jsx(Ooe,{controlNetId:t,processorNode:n}):n.type==="mlsd_image_processor"?i.jsx(Roe,{controlNetId:t,processorNode:n}):n.type==="normalbae_image_processor"?i.jsx(Doe,{controlNetId:t,processorNode:n}):n.type==="openpose_image_processor"?i.jsx(Noe,{controlNetId:t,processorNode:n}):n.type==="pidi_image_processor"?i.jsx($oe,{controlNetId:t,processorNode:n}):n.type==="zoe_depth_image_processor"?i.jsx(Boe,{controlNetId:t,processorNode:n}):null},Hoe=p.memo(Foe),Voe=e=>{const{controlNetId:t,shouldAutoConfig:n}=e,r=ce(),o=eo(),s=p.useCallback(()=>{r(eM({controlNetId:t}))},[t,r]);return i.jsx(Zn,{label:"Auto configure processor","aria-label":"Auto configure processor",isChecked:n,onChange:s,isDisabled:!o})},Woe=p.memo(Voe),l1={mt:1.5,fontSize:"2xs",fontWeight:"500",color:"base.400"},nP=e=>`${Math.round(e*100)}%`,Uoe=e=>{const{controlNetId:t,beginStepPct:n,mini:r=!1,endStepPct:o}=e,s=ce();we();const a=p.useCallback(c=>{s(Jw({controlNetId:t,beginStepPct:c[0]})),s(eS({controlNetId:t,endStepPct:c[1]}))},[t,s]);return p.useCallback(()=>{s(Jw({controlNetId:t,beginStepPct:0})),s(eS({controlNetId:t,endStepPct:1}))},[t,s]),i.jsxs(ar,{children:[i.jsx(hr,{children:"Begin / End Step Percentage"}),i.jsx(ya,{w:"100%",gap:2,alignItems:"center",children:i.jsxs(aj,{"aria-label":["Begin Step %","End Step %"],value:[n,o],onChange:a,min:0,max:1,step:.01,minStepsBetweenThumbs:5,children:[i.jsx(ij,{children:i.jsx(lj,{})}),i.jsx(Wn,{label:nP(n),placement:"top",hasArrow:!0,children:i.jsx(K1,{index:0})}),i.jsx(Wn,{label:nP(o),placement:"top",hasArrow:!0,children:i.jsx(K1,{index:1})}),!r&&i.jsxs(i.Fragment,{children:[i.jsx(ch,{value:0,sx:{insetInlineStart:"0 !important",insetInlineEnd:"unset !important",...l1},children:"0%"}),i.jsx(ch,{value:.5,sx:{...l1},children:"50%"}),i.jsx(ch,{value:1,sx:{insetInlineStart:"unset !important",insetInlineEnd:"0 !important",...l1},children:"100%"})]})]})})]})},Goe=p.memo(Uoe),qoe=[{label:"Balanced",value:"balanced"},{label:"Prompt",value:"more_prompt"},{label:"Control",value:"more_control"},{label:"Mega Control",value:"unbalanced"}];function Yoe(e){const{controlNetId:t,controlMode:n=!1}=e,r=ce(),{t:o}=we(),s=p.useCallback(a=>{r(tM({controlNetId:t,controlMode:a}))},[t,r]);return i.jsx(Er,{label:o("parameters.controlNetControlMode"),data:qoe,value:String(n),onChange:s})}const Koe=Oe(Zi,e=>Pa(Ps,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)),Lt),Xoe=e=>{const{controlNetId:t,processorNode:n}=e,r=ce(),o=eo(),s=Y(Koe),a=p.useCallback(c=>{r(nM({controlNetId:t,processorType:c}))},[t,r]);return i.jsx(Er,{label:"Processor",value:n.type??"canny_image_processor",data:s,onChange:a,disabled:!o})},Zoe=p.memo(Xoe),Qoe=e=>{const{controlNetId:t,isEnabled:n,model:r,weight:o,beginStepPct:s,endStepPct:a,controlMode:c,controlImage:d,processedControlImage:f,processorNode:h,processorType:m,shouldAutoConfig:v}=e.controlNet,y=ce(),[S,x]=Kne(!1),{colorMode:w}=zo(),_=p.useCallback(()=>{y(rM({controlNetId:t}))},[t,y]),k=p.useCallback(()=>{y(y3({controlNetId:yl(),controlNet:e.controlNet}))},[y,e.controlNet]),P=p.useCallback(()=>{y(oM({controlNetId:t}))},[t,y]);return i.jsxs(X,{sx:{flexDir:"column",gap:2,p:3,bg:Fe("base.200","base.850")(w),borderRadius:"base",position:"relative"},children:[i.jsxs(X,{sx:{gap:2},children:[i.jsx(Zn,{tooltip:"Toggle","aria-label":"Toggle",isChecked:n,onChange:P}),i.jsx(ut,{sx:{w:"full",minW:0,opacity:n?1:.5,pointerEvents:n?"auto":"none",transitionProperty:"common",transitionDuration:"0.1s"},children:i.jsx(foe,{controlNetId:t,model:r})}),i.jsx(Ne,{size:"sm",tooltip:"Duplicate","aria-label":"Duplicate",onClick:k,icon:i.jsx(Cu,{})}),i.jsx(Ne,{size:"sm",tooltip:"Delete","aria-label":"Delete",colorScheme:"error",onClick:_,icon:i.jsx(Mo,{})}),i.jsx(Ne,{size:"sm","aria-label":"Show All Options",onClick:x,variant:"link",icon:i.jsx(vx,{sx:{boxSize:4,color:Fe("base.700","base.300")(w),transform:S?"rotate(0deg)":"rotate(180deg)",transitionProperty:"common",transitionDuration:"normal"}})}),!v&&i.jsx(ut,{sx:{position:"absolute",w:1.5,h:1.5,borderRadius:"full",bg:Fe("error.700","error.200")(w),top:4,insetInlineEnd:4}})]}),n&&i.jsxs(i.Fragment,{children:[i.jsxs(X,{sx:{w:"full",flexDirection:"column"},children:[i.jsxs(X,{sx:{gap:4,w:"full"},children:[i.jsxs(X,{sx:{flexDir:"column",gap:3,w:"full",paddingInlineStart:1,paddingInlineEnd:S?1:0,pb:2,justifyContent:"space-between"},children:[i.jsx(hoe,{controlNetId:t,weight:o,mini:!S}),i.jsx(Goe,{controlNetId:t,beginStepPct:s,endStepPct:a,mini:!S})]}),!S&&i.jsx(X,{sx:{alignItems:"center",justifyContent:"center",h:24,w:24,aspectRatio:"1/1"},children:i.jsx(Gk,{controlNet:e.controlNet,height:24})})]}),i.jsx(Yoe,{controlNetId:t,controlMode:c})]}),S&&i.jsxs(i.Fragment,{children:[i.jsx(ut,{mt:2,children:i.jsx(Gk,{controlNet:e.controlNet,height:96})}),i.jsx(Zoe,{controlNetId:t,processorNode:h}),i.jsx(Hoe,{controlNetId:t,processorNode:h}),i.jsx(Woe,{controlNetId:t,shouldAutoConfig:v})]})]})]})},Joe=p.memo(Qoe),ese=Oe(Bn,e=>{const{isEnabled:t}=e.controlNet;return{isEnabled:t}},Lt),tse=()=>{const{isEnabled:e}=Y(ese),t=ce(),n=p.useCallback(()=>{t(sM())},[t]);return i.jsx(Zn,{label:"Enable ControlNet",isChecked:e,onChange:n})},nse=Oe(v3,e=>{const{controlNets:t,isEnabled:n}=e,r=aM(t),o=n&&r.length>0?`${r.length} Active`:void 0;return{controlNetsArray:Pa(t),activeLabel:o}},Lt),rse=()=>{we();const{controlNetsArray:e,activeLabel:t}=Y(nse),n=Jr("controlNet").isFeatureDisabled,r=ce(),o=p.useCallback(()=>{r(y3({controlNetId:yl()}))},[r]);return n?null:i.jsx(Qo,{label:"ControlNet",activeLabel:t,children:i.jsxs(X,{sx:{flexDir:"column",gap:3},children:[i.jsx(tse,{}),e.map((s,a)=>i.jsxs(p.Fragment,{children:[a>0&&i.jsx(ai,{}),i.jsx(Joe,{controlNet:s})]},s.controlNetId)),i.jsx(cn,{flexGrow:1,onClick:o,children:"Add ControlNet"})]})})},qx=p.memo(rse),Yx=e=>{e.stopPropagation()},ose=ze((e,t)=>i.jsx(mj,{ref:t,onPaste:Yx,...e})),JT=p.memo(ose),Kx=()=>{const e=Y(r=>r.generation.negativePrompt),t=ce(),{t:n}=we();return i.jsx(ar,{children:i.jsx(JT,{id:"negativePrompt",name:"negativePrompt",value:e,onChange:r=>t(nh(r.target.value)),placeholder:n("parameters.negativePromptPlaceholder"),fontSize:"sm",minH:16})})},sse=Oe([e=>e.generation,Gr],(e,t)=>({prompt:e.positivePrompt,activeTabName:t}),{memoizeOptions:{resultEqualityCheck:en}}),Xx=()=>{const e=ce(),{prompt:t,activeTabName:n}=Y(sse),r=eo(),o=p.useRef(null),{t:s}=we(),a=d=>{e(th(d.target.value))};et("alt+a",()=>{var d;(d=o.current)==null||d.focus()},[]);const c=p.useCallback(d=>{d.key==="Enter"&&d.shiftKey===!1&&r&&(d.preventDefault(),e(Jy()),e(eb(n)))},[e,n,r]);return i.jsx(ut,{children:i.jsx(ar,{children:i.jsx(JT,{id:"prompt",name:"prompt",placeholder:s("parameters.positivePromptPlaceholder"),value:t,onChange:a,onKeyDown:c,resize:"vertical",ref:o,minH:32})})})},ase=Oe(Bn,e=>{const{shouldUseNoiseSettings:t,threshold:n}=e.generation;return{isDisabled:!t,threshold:n}},Lt);function ise(){const e=ce(),{threshold:t,isDisabled:n}=Y(ase),{t:r}=we();return i.jsx(Et,{isDisabled:n,label:r("parameters.noiseThreshold"),min:0,max:20,step:.1,onChange:o=>e(tS(o)),handleReset:()=>e(tS(0)),value:t,withInput:!0,withReset:!0,withSliderMarks:!0})}const lse=()=>{const e=ce(),t=Y(r=>r.generation.shouldUseNoiseSettings);we();const n=r=>e(iM(r.target.checked));return i.jsx(Zn,{label:"Enable Noise Settings",isChecked:t,onChange:n})},cse=Oe(Bn,e=>{const{shouldUseNoiseSettings:t,perlin:n}=e.generation;return{isDisabled:!t,perlin:n}},Lt);function use(){const e=ce(),{perlin:t,isDisabled:n}=Y(cse),{t:r}=we();return i.jsx(Et,{isDisabled:n,label:r("parameters.perlinNoise"),min:0,max:1,step:.05,onChange:o=>e(nS(o)),handleReset:()=>e(nS(0)),value:t,withInput:!0,withReset:!0,withSliderMarks:!0})}const dse=Oe(Bn,e=>{const{shouldUseNoiseSettings:t}=e.generation;return{activeLabel:t?"Enabled":void 0}},Lt),fse=()=>{const{t:e}=we(),t=Jr("noise").isFeatureEnabled,{activeLabel:n}=Y(dse);return t?i.jsx(Qo,{label:e("parameters.noiseSettings"),activeLabel:n,children:i.jsxs(X,{sx:{gap:2,flexDirection:"column"},children:[i.jsx(lse,{}),i.jsx(use,{}),i.jsx(ise,{})]})}):null},eR=p.memo(fse),pse=Oe(Zo,e=>{const{seamlessXAxis:t}=e;return{seamlessXAxis:t}},Lt),hse=()=>{const{t:e}=we(),{seamlessXAxis:t}=Y(pse),n=ce(),r=p.useCallback(o=>{n(lM(o.target.checked))},[n]);return i.jsx(Zn,{label:e("parameters.seamlessXAxis"),"aria-label":e("parameters.seamlessXAxis"),isChecked:t,onChange:r})},mse=p.memo(hse),gse=Oe(Zo,e=>{const{seamlessYAxis:t}=e;return{seamlessYAxis:t}},Lt),vse=()=>{const{t:e}=we(),{seamlessYAxis:t}=Y(gse),n=ce(),r=p.useCallback(o=>{n(cM(o.target.checked))},[n]);return i.jsx(Zn,{label:e("parameters.seamlessYAxis"),"aria-label":e("parameters.seamlessYAxis"),isChecked:t,onChange:r})},yse=p.memo(vse),bse=(e,t)=>{if(e&&t)return"X & Y";if(e)return"X";if(t)return"Y"},xse=Oe(Zo,e=>{const{seamlessXAxis:t,seamlessYAxis:n}=e;return{activeLabel:bse(t,n)}},Lt),wse=()=>{const{t:e}=we(),{activeLabel:t}=Y(xse);return Jr("seamless").isFeatureEnabled?i.jsx(Qo,{label:e("parameters.seamlessTiling"),activeLabel:t,children:i.jsxs(X,{sx:{gap:5},children:[i.jsx(ut,{flexGrow:1,children:i.jsx(mse,{})}),i.jsx(ut,{flexGrow:1,children:i.jsx(yse,{})})]})}):null},tR=p.memo(wse);function Sse(){const e=Y(o=>o.generation.horizontalSymmetrySteps),t=Y(o=>o.generation.steps),n=ce(),{t:r}=we();return i.jsx(Et,{label:r("parameters.hSymmetryStep"),value:e,onChange:o=>n(rS(o)),min:0,max:t,step:1,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>n(rS(0))})}function Cse(){const e=Y(o=>o.generation.verticalSymmetrySteps),t=Y(o=>o.generation.steps),n=ce(),{t:r}=we();return i.jsx(Et,{label:r("parameters.vSymmetryStep"),value:e,onChange:o=>n(oS(o)),min:0,max:t,step:1,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>n(oS(0))})}function _se(){const e=Y(n=>n.generation.shouldUseSymmetry),t=ce();return i.jsx(Zn,{label:"Enable Symmetry",isChecked:e,onChange:n=>t(uM(n.target.checked))})}const kse=Oe(Bn,e=>({activeLabel:e.generation.shouldUseSymmetry?"Enabled":void 0}),Lt),Pse=()=>{const{t:e}=we(),{activeLabel:t}=Y(kse);return Jr("symmetry").isFeatureEnabled?i.jsx(Qo,{label:e("parameters.symmetry"),activeLabel:t,children:i.jsxs(X,{sx:{gap:2,flexDirection:"column"},children:[i.jsx(_se,{}),i.jsx(Sse,{}),i.jsx(Cse,{})]})}):null},Zx=p.memo(Pse);function jse(){const e=Y(o=>o.generation.variationAmount),t=Y(o=>o.generation.shouldGenerateVariations),{t:n}=we(),r=ce();return i.jsx(Et,{label:n("parameters.variationAmount"),value:e,step:.01,min:0,max:1,isDisabled:!t,onChange:o=>r(sS(o)),handleReset:()=>r(sS(.1)),withInput:!0,withReset:!0,withSliderMarks:!0})}const Ese=()=>{const e=ce(),t=Y(r=>r.generation.shouldGenerateVariations);we();const n=r=>e(dM(r.target.checked));return i.jsx(Zn,{label:"Enable Variations",isChecked:t,onChange:n})},Ise=e=>{const{label:t="",isDisabled:n=!1,isInvalid:r,formControlProps:o,...s}=e;return i.jsxs(ar,{isInvalid:r,isDisabled:n,...o,children:[t!==""&&i.jsx(hr,{children:t}),i.jsx(df,{...s,onPaste:Yx})]})},Qn=p.memo(Ise);function Ose(){const e=Y(s=>s.generation.seedWeights),t=Y(s=>s.generation.shouldGenerateVariations),{t:n}=we(),r=ce(),o=s=>r(fM(s.target.value));return i.jsx(Qn,{label:n("parameters.seedWeights"),value:e,isInvalid:t&&!(Gx(e)||e===""),isDisabled:!t,onChange:o})}const Tse=Oe(Bn,e=>({activeLabel:e.generation.shouldGenerateVariations?"Enabled":void 0}),Lt),Rse=()=>{const{t:e}=we(),{activeLabel:t}=Y(Tse);return Jr("variation").isFeatureEnabled?i.jsx(Qo,{label:e("parameters.variations"),activeLabel:t,children:i.jsxs(X,{sx:{gap:2,flexDirection:"column"},children:[i.jsx(Ese,{}),i.jsx(jse,{}),i.jsx(Ose,{})]})}):null},Qx=p.memo(Rse),Mse=Oe(wo,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:en}}),Dse=e=>{const t=ce(),{btnGroupWidth:n="auto",...r}=e,{isProcessing:o,isConnected:s,isCancelable:a,cancelType:c,isCancelScheduled:d,sessionId:f}=Y(Mse),h=p.useCallback(()=>{if(f){if(c==="scheduled"){t(pM());return}t(hM({session_id:f}))}},[t,f,c]),{t:m}=we(),v=p.useCallback(x=>{const w=Array.isArray(x)?x[0]:x;t(mM(w))},[t]);et("shift+x",()=>{(s||o)&&a&&h()},[s,o,a]);const y=p.useMemo(()=>m(d?"parameters.cancel.isScheduled":c==="immediate"?"parameters.cancel.immediate":"parameters.cancel.schedule"),[m,c,d]),S=p.useMemo(()=>d?i.jsx(Th,{}):c==="immediate"?i.jsx(Hne,{}):i.jsx(zne,{}),[c,d]);return i.jsxs(Or,{isAttached:!0,width:n,children:[i.jsx(Ne,{icon:S,tooltip:y,"aria-label":y,isDisabled:!s||!o||!a,onClick:h,colorScheme:"error",id:"cancel-button",...r}),i.jsxs(dg,{closeOnSelect:!1,children:[i.jsx(fg,{as:Ne,tooltip:m("parameters.cancel.setType"),"aria-label":m("parameters.cancel.setType"),icon:i.jsx(cU,{w:"1em",h:"1em"}),paddingX:0,paddingY:0,colorScheme:"error",minWidth:5,...r}),i.jsx(gf,{minWidth:"240px",children:i.jsxs(Nb,{value:c,title:"Cancel Type",type:"radio",onChange:v,children:[i.jsx(Od,{value:"immediate",children:m("parameters.cancel.immediate")}),i.jsx(Od,{value:"scheduled",children:m("parameters.cancel.schedule")})]})})]})]})},Jx=p.memo(Dse),Ase=Oe(wo,e=>({isProcessing:e.isProcessing,currentStep:e.currentStep,totalSteps:e.totalSteps,currentStatusHasSteps:e.currentStatusHasSteps}),{memoizeOptions:{resultEqualityCheck:en}}),Nse=()=>{const{t:e}=we(),{isProcessing:t,currentStep:n,totalSteps:r,currentStatusHasSteps:o}=Y(Ase),s=n?Math.round(n*100/r):0;return i.jsx(K6,{value:s,"aria-label":e("accessibility.invokeProgressBar"),isIndeterminate:t&&!o,height:"full",colorScheme:"accent"})},nR=p.memo(Nse),rP={_disabled:{bg:"none",cursor:"not-allowed",_hover:{bg:"none"}}};function e2(e){const{iconButton:t=!1,...n}=e,r=ce(),o=eo(),s=Y(Gr),a=Y(f=>f.system.isProcessing),c=p.useCallback(()=>{r(Jy()),r(eb(s))},[r,s]),{t:d}=we();return et(["ctrl+enter","meta+enter"],c,{enabled:()=>o,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[o,s]),i.jsx(ut,{style:{flexGrow:4},position:"relative",children:i.jsxs(ut,{style:{position:"relative"},children:[!o&&i.jsx(ut,{borderRadius:"base",style:{position:"absolute",bottom:"0",left:"0",right:"0",height:"100%",overflow:"clip"},...n,children:i.jsx(nR,{})}),t?i.jsx(Ne,{"aria-label":d("parameters.invoke"),type:"submit",icon:i.jsx(CE,{}),isDisabled:!o,onClick:c,tooltip:d("parameters.invoke"),tooltipProps:{placement:"top"},colorScheme:"accent",id:"invoke-button",...n,sx:{w:"full",flexGrow:1,...a?rP:{}}}):i.jsx(cn,{"aria-label":d("parameters.invoke"),type:"submit",isDisabled:!o,onClick:c,colorScheme:"accent",id:"invoke-button",...n,sx:{w:"full",flexGrow:1,fontWeight:700,...a?rP:{}},children:"Invoke"})]})})}const t2=()=>i.jsxs(X,{gap:2,children:[i.jsx(e2,{}),i.jsx(Jx,{})]}),oP=/^-?(0\.)?\.?$/,zse=e=>{const{label:t,isDisabled:n=!1,showStepper:r=!0,isInvalid:o,value:s,onChange:a,min:c,max:d,isInteger:f=!0,formControlProps:h,formLabelProps:m,numberInputFieldProps:v,numberInputStepperProps:y,tooltipProps:S,...x}=e,[w,_]=p.useState(String(s));p.useEffect(()=>{!w.match(oP)&&s!==Number(w)&&_(String(s))},[s,w]);const k=j=>{_(j),j.match(oP)||a(f?Math.floor(Number(j)):Number(j))},P=j=>{const I=Ks(f?Math.floor(Number(j.target.value)):Number(j.target.value),c,d);_(String(I)),a(I)};return i.jsx(Wn,{...S,children:i.jsxs(ar,{isDisabled:n,isInvalid:o,...h,children:[t&&i.jsx(hr,{...m,children:t}),i.jsxs(vg,{value:w,min:c,max:d,keepWithinRange:!0,clampValueOnBlur:!1,onChange:k,onBlur:P,...x,onPaste:Yx,children:[i.jsx(bg,{...v}),r&&i.jsxs(yg,{children:[i.jsx(wg,{...y}),i.jsx(xg,{...y})]})]})]})})},lu=p.memo(zse),$se=Oe([Zo,Zi,ks,sf],(e,t,n,r)=>{const{initial:o,min:s,sliderMax:a,inputMax:c}=t.sd.guidance,{cfgScale:d}=e,{shouldUseSliders:f}=n,{shift:h}=r;return{cfgScale:d,initial:o,min:s,sliderMax:a,inputMax:c,shouldUseSliders:f,shift:h}},Lt),Lse=()=>{const{cfgScale:e,initial:t,min:n,sliderMax:r,inputMax:o,shouldUseSliders:s,shift:a}=Y($se),c=ce(),{t:d}=we(),f=p.useCallback(m=>c(yh(m)),[c]),h=p.useCallback(()=>c(yh(t)),[c,t]);return s?i.jsx(Et,{label:d("parameters.cfgScale"),step:a?.1:.5,min:n,max:r,onChange:f,handleReset:h,value:e,sliderNumberInputProps:{max:o},withInput:!0,withReset:!0,withSliderMarks:!0,isInteger:!1}):i.jsx(lu,{label:d("parameters.cfgScale"),step:.5,min:n,max:o,onChange:f,value:e,isInteger:!1,numberInputFieldProps:{textAlign:"center"}})},cu=p.memo(Lse),Bse=Oe([Zo,sf,Zi],(e,t,n)=>{const{initial:r,min:o,sliderMax:s,inputMax:a,fineStep:c,coarseStep:d}=n.sd.height,{height:f}=e,h=t.shift?c:d;return{height:f,initial:r,min:o,sliderMax:s,inputMax:a,step:h}},Lt),Fse=e=>{const{height:t,initial:n,min:r,sliderMax:o,inputMax:s,step:a}=Y(Bse),c=ce(),{t:d}=we(),f=p.useCallback(m=>{c(wh(m))},[c]),h=p.useCallback(()=>{c(wh(n))},[c,n]);return i.jsx(Et,{label:d("parameters.height"),value:t,min:r,step:a,max:o,onChange:f,handleReset:h,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:s},...e})},Gm=p.memo(Fse),Hse=Oe([Bn],e=>{const{initial:t,min:n,sliderMax:r,inputMax:o,fineStep:s,coarseStep:a}=e.config.sd.iterations,{iterations:c}=e.generation,{shouldUseSliders:d}=e.ui,f=e.dynamicPrompts.isEnabled&&e.dynamicPrompts.combinatorial,h=e.hotkeys.shift?s:a;return{iterations:c,initial:t,min:n,sliderMax:r,inputMax:o,step:h,shouldUseSliders:d,isDisabled:f}},Lt),Vse=()=>{const{iterations:e,initial:t,min:n,sliderMax:r,inputMax:o,step:s,shouldUseSliders:a,isDisabled:c}=Y(Hse),d=ce(),{t:f}=we(),h=p.useCallback(v=>{d(aS(v))},[d]),m=p.useCallback(()=>{d(aS(t))},[d,t]);return a?i.jsx(Et,{isDisabled:c,label:f("parameters.images"),step:s,min:n,max:r,onChange:h,handleReset:m,value:e,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:o}}):i.jsx(lu,{isDisabled:c,label:f("parameters.images"),step:s,min:n,max:o,onChange:h,value:e,numberInputFieldProps:{textAlign:"center"}})},uu=p.memo(Vse),Ao={"sd-1":"Stable Diffusion 1.x","sd-2":"Stable Diffusion 2.x"},Wse=()=>{const e=ce(),{t}=we(),n=Y(d=>d.generation.model),{data:r,isLoading:o}=kf(),s=p.useMemo(()=>{if(!r)return[];const d=[];return Ul(r.entities,(f,h)=>{f&&d.push({value:h,label:f.name,group:Ao[f.base_model]})}),d},[r]),a=p.useMemo(()=>r==null?void 0:r.entities[n],[r==null?void 0:r.entities,n]),c=p.useCallback(d=>{d&&e(w1(d))},[e]);return p.useEffect(()=>{if(n&&(r!=null&&r.ids.includes(n)))return;const d=r==null?void 0:r.ids[0];Jm(d)&&c(d)},[c,r==null?void 0:r.ids,n]),o?i.jsx(Er,{label:t("modelManager.model"),placeholder:"Loading...",disabled:!0,data:[]}):i.jsx(Er,{tooltip:a==null?void 0:a.description,label:t("modelManager.model"),value:n,placeholder:s.length>0?"Select a model":"No models detected!",data:s,error:s.length===0,onChange:c})},Use=p.memo(Wse),Gse=()=>{const e=ce(),{t}=we(),{data:n}=ZT(),r=Y(c=>c.generation.vae),o=p.useMemo(()=>{if(!n)return[];const c=[{value:"auto",label:"Automatic",group:"Default"}];return Ul(n.entities,(d,f)=>{d&&c.push({value:f,label:d.name,group:Ao[d.base_model]})}),c},[n]),s=p.useMemo(()=>n==null?void 0:n.entities[r],[n==null?void 0:n.entities,r]),a=p.useCallback(c=>{c&&e(gM(c))},[e]);return p.useEffect(()=>{r&&(n!=null&&n.ids.includes(r))||a("auto")},[a,n==null?void 0:n.ids,r]),i.jsx(Er,{tooltip:s==null?void 0:s.description,label:t("modelManager.vae"),value:r,placeholder:"Pick one",data:o,onChange:a})},qse=p.memo(Gse),Yse=()=>i.jsxs(X,{gap:3,w:"full",children:[i.jsx(ut,{w:"full",children:i.jsx(Use,{})}),i.jsx(ut,{w:"full",children:i.jsx(qse,{})})]}),du=p.memo(Yse),Kse=Oe([ks,Zo],(e,t)=>{const{scheduler:n}=t,{favoriteSchedulers:r}=e,o=m3.map(s=>({value:s,label:g3[s],group:r.includes(s)?"Favorites":void 0})).sort((s,a)=>s.label.localeCompare(a.label));return{scheduler:n,data:o}},Lt),Xse=()=>{const e=ce(),{t}=we(),{scheduler:n,data:r}=Y(Kse),o=p.useCallback(s=>{s&&e(S1(s))},[e]);return i.jsx(Er,{label:t("parameters.scheduler"),value:n,data:r,onChange:o})},n2=p.memo(Xse),Zse=Oe([Zo,Zi,ks,sf],(e,t,n,r)=>{const{initial:o,min:s,sliderMax:a,inputMax:c,fineStep:d,coarseStep:f}=t.sd.steps,{steps:h}=e,{shouldUseSliders:m}=n,v=r.shift?d:f;return{steps:h,initial:o,min:s,sliderMax:a,inputMax:c,step:v,shouldUseSliders:m}},Lt),Qse=()=>{const{steps:e,initial:t,min:n,sliderMax:r,inputMax:o,step:s,shouldUseSliders:a}=Y(Zse),c=ce(),{t:d}=we(),f=p.useCallback(v=>{c(bh(v))},[c]),h=p.useCallback(()=>{c(bh(t))},[c,t]),m=p.useCallback(()=>{c(Jy())},[c]);return a?i.jsx(Et,{label:d("parameters.steps"),min:n,max:r,step:s,onChange:f,handleReset:h,value:e,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:o}}):i.jsx(lu,{label:d("parameters.steps"),min:n,max:o,step:s,onChange:f,value:e,numberInputFieldProps:{textAlign:"center"},onBlur:m})},fu=p.memo(Qse),Jse=Oe([Zo,sf,Zi],(e,t,n)=>{const{initial:r,min:o,sliderMax:s,inputMax:a,fineStep:c,coarseStep:d}=n.sd.width,{width:f}=e,h=t.shift?c:d;return{width:f,initial:r,min:o,sliderMax:s,inputMax:a,step:h}},Lt),eae=e=>{const{width:t,initial:n,min:r,sliderMax:o,inputMax:s,step:a}=Y(Jse),c=ce(),{t:d}=we(),f=p.useCallback(m=>{c(xh(m))},[c]),h=p.useCallback(()=>{c(xh(n))},[c,n]);return i.jsx(Et,{label:d("parameters.width"),value:t,min:r,step:a,max:o,onChange:f,handleReset:h,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:s},...e})},qm=p.memo(eae);function tae(){const e=ce(),t=Y(o=>o.generation.shouldFitToWidthHeight),n=o=>e(vM(o.target.checked)),{t:r}=we();return i.jsx(Zn,{label:r("parameters.imageFit"),isChecked:t,onChange:n})}const nae=Oe([Zo,sf,Zi],(e,t,n)=>{const{initial:r,min:o,sliderMax:s,inputMax:a,fineStep:c,coarseStep:d}=n.sd.img2imgStrength,{img2imgStrength:f}=e,h=t.shift?c:d;return{img2imgStrength:f,initial:r,min:o,sliderMax:s,inputMax:a,step:h}},Lt),rae=()=>{const{img2imgStrength:e,initial:t,min:n,sliderMax:r,inputMax:o,step:s}=Y(nae),a=ce(),{t:c}=we(),d=p.useCallback(h=>a(Sh(h)),[a]),f=p.useCallback(()=>{a(Sh(t))},[a,t]);return i.jsx(Et,{label:`${c("parameters.denoisingStrength")}`,step:s,min:n,max:r,onChange:d,handleReset:f,value:e,isInteger:!1,withInput:!0,withSliderMarks:!0,withReset:!0,sliderNumberInputProps:{max:o}})},rR=p.memo(rae);function oae(){const e=Y(a=>a.generation.seed),t=Y(a=>a.generation.shouldRandomizeSeed),n=Y(a=>a.generation.shouldGenerateVariations),{t:r}=we(),o=ce(),s=a=>o(vh(a));return i.jsx(lu,{label:r("parameters.seed"),step:1,precision:0,flexGrow:1,min:b3,max:Yy,isDisabled:t,isInvalid:e<0&&n,onChange:s,value:e,formControlProps:{display:"flex",alignItems:"center",gap:3}})}const sae=(e,t)=>Math.floor(Math.random()*(t-e+1)+e);function aae(){const e=ce(),t=Y(o=>o.generation.shouldRandomizeSeed),{t:n}=we(),r=()=>e(vh(sae(b3,Yy)));return i.jsx(Ne,{size:"sm",isDisabled:t,"aria-label":n("parameters.shuffle"),tooltip:n("parameters.shuffle"),onClick:r,icon:i.jsx(ZW,{})})}const iae=()=>{const e=ce(),{t}=we(),n=Y(o=>o.generation.shouldRandomizeSeed),r=o=>e(yM(o.target.checked));return i.jsx(Zn,{label:t("common.random"),isChecked:n,onChange:r})},lae=p.memo(iae),cae=()=>i.jsxs(X,{sx:{gap:4,alignItems:"center"},children:[i.jsx(oae,{}),i.jsx(aae,{}),i.jsx(lae,{})]}),pu=p.memo(cae),uae=Oe([ks,Zo],(e,t)=>{const{shouldUseSliders:n}=e,{shouldFitToWidthHeight:r,shouldRandomizeSeed:o}=t;return{shouldUseSliders:n,shouldFitToWidthHeight:r,activeLabel:o?void 0:"Manual Seed"}},Lt),dae=()=>{const{shouldUseSliders:e,shouldFitToWidthHeight:t,activeLabel:n}=Y(uae);return i.jsx(Qo,{label:"General",activeLabel:n,defaultIsOpen:!0,children:i.jsxs(X,{sx:{flexDirection:"column",gap:3},children:[e?i.jsxs(i.Fragment,{children:[i.jsx(du,{}),i.jsx(ut,{pt:2,children:i.jsx(pu,{})}),i.jsx(uu,{}),i.jsx(fu,{}),i.jsx(cu,{}),i.jsx(qm,{isDisabled:!t}),i.jsx(Gm,{isDisabled:!t})]}):i.jsxs(i.Fragment,{children:[i.jsxs(X,{gap:3,children:[i.jsx(uu,{}),i.jsx(fu,{}),i.jsx(cu,{})]}),i.jsx(du,{}),i.jsx(n2,{}),i.jsx(ut,{pt:2,children:i.jsx(pu,{})}),i.jsx(qm,{isDisabled:!t}),i.jsx(Gm,{isDisabled:!t})]}),i.jsx(rR,{}),i.jsx(tae,{})]})})},fae=p.memo(dae),pae=()=>i.jsxs(i.Fragment,{children:[i.jsx(Xx,{}),i.jsx(Kx,{}),i.jsx(t2,{}),i.jsx(fae,{}),i.jsx(Ux,{}),i.jsx(Wx,{}),i.jsx(qx,{}),i.jsx(Qx,{}),i.jsx(eR,{}),i.jsx(Zx,{}),i.jsx(tR,{})]}),oR=p.memo(pae),hae=()=>{const e=ce(),t=p.useRef(null),n=p.useCallback(()=>{t.current&&t.current.setLayout([50,50])},[]);return i.jsxs(X,{sx:{gap:4,w:"full",h:"full"},children:[i.jsx(Vx,{children:i.jsx(oR,{})}),i.jsx(ut,{sx:{w:"full",h:"full"},children:i.jsxs(Hx,{ref:t,autoSaveId:"imageTab.content",direction:"horizontal",style:{height:"100%",width:"100%"},children:[i.jsx(Zd,{id:"imageTab.content.initImage",order:0,defaultSize:50,minSize:25,style:{position:"relative"},children:i.jsx(Nre,{})}),i.jsx(YT,{onDoubleClick:n}),i.jsx(Zd,{id:"imageTab.content.selectedImage",order:1,defaultSize:50,minSize:25,onResize:()=>{e(ea())},children:i.jsx(KT,{})})]})})]})},mae=p.memo(hae);var gae=function(t){return vae(t)&&!yae(t)};function vae(e){return!!e&&typeof e=="object"}function yae(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||wae(e)}var bae=typeof Symbol=="function"&&Symbol.for,xae=bae?Symbol.for("react.element"):60103;function wae(e){return e.$$typeof===xae}function Sae(e){return Array.isArray(e)?[]:{}}function Ym(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Qd(Sae(e),e,t):e}function Cae(e,t,n){return e.concat(t).map(function(r){return Ym(r,n)})}function _ae(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(o){r[o]=Ym(e[o],n)}),Object.keys(t).forEach(function(o){!n.isMergeableObject(t[o])||!e[o]?r[o]=Ym(t[o],n):r[o]=Qd(e[o],t[o],n)}),r}function Qd(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||Cae,n.isMergeableObject=n.isMergeableObject||gae;var r=Array.isArray(t),o=Array.isArray(e),s=r===o;return s?r?n.arrayMerge(e,t,n):_ae(e,t,n):Ym(t,n)}Qd.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,o){return Qd(r,o,n)},{})};var Ay=Qd,sP=Array.isArray,aP=Object.keys,kae=Object.prototype.hasOwnProperty,Pae=typeof Element<"u";function Ny(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=sP(e),r=sP(t),o,s,a;if(n&&r){if(s=e.length,s!=t.length)return!1;for(o=s;o--!==0;)if(!Ny(e[o],t[o]))return!1;return!0}if(n!=r)return!1;var c=e instanceof Date,d=t instanceof Date;if(c!=d)return!1;if(c&&d)return e.getTime()==t.getTime();var f=e instanceof RegExp,h=t instanceof RegExp;if(f!=h)return!1;if(f&&h)return e.toString()==t.toString();var m=aP(e);if(s=m.length,s!==aP(t).length)return!1;for(o=s;o--!==0;)if(!kae.call(t,m[o]))return!1;if(Pae&&e instanceof Element&&t instanceof Element)return e===t;for(o=s;o--!==0;)if(a=m[o],!(a==="_owner"&&e.$$typeof)&&!Ny(e[a],t[a]))return!1;return!0}return e!==e&&t!==t}var jae=function(t,n){try{return Ny(t,n)}catch(r){if(r.message&&r.message.match(/stack|recursion/i)||r.number===-2146828260)return console.warn("Warning: react-fast-compare does not handle circular references.",r.name,r.message),!1;throw r}};const fl=gu(jae);var Eae=!0;function Iae(e,t){if(!Eae){if(e)return;var n="Warning: "+t;typeof console<"u"&&console.warn(n);try{throw Error(n)}catch{}}}function or(){return or=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},or.apply(this,arguments)}function Ec(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 ov=p.createContext(void 0);ov.displayName="FormikContext";var Oae=ov.Provider;ov.Consumer;function sR(){var e=p.useContext(ov);return e||Iae(!1),e}var Go=function(t){return typeof t=="function"},sv=function(t){return t!==null&&typeof t=="object"},Tae=function(t){return String(Math.floor(Number(t)))===t},c1=function(t){return Object.prototype.toString.call(t)==="[object String]"},Rae=function(t){return p.Children.count(t)===0},u1=function(t){return sv(t)&&Go(t.then)};function Uo(e,t,n,r){r===void 0&&(r=0);for(var o=q3(t);e&&r<o.length;)e=e[o[r++]];return r!==o.length&&!e||e===void 0?n:e}function El(e,t,n){for(var r=_S(e),o=r,s=0,a=q3(t);s<a.length-1;s++){var c=a[s],d=Uo(e,a.slice(0,s+1));if(d&&(sv(d)||Array.isArray(d)))o=o[c]=_S(d);else{var f=a[s+1];o=o[c]=Tae(f)&&Number(f)>=0?[]:{}}}return(s===0?e:o)[a[s]]===n?e:(n===void 0?delete o[a[s]]:o[a[s]]=n,s===0&&n===void 0&&delete r[a[s]],r)}function aR(e,t,n,r){n===void 0&&(n=new WeakMap),r===void 0&&(r={});for(var o=0,s=Object.keys(e);o<s.length;o++){var a=s[o],c=e[a];sv(c)?n.get(c)||(n.set(c,!0),r[a]=Array.isArray(c)?[]:{},aR(c,t,n,r[a])):r[a]=t}return r}function Mae(e,t){switch(t.type){case"SET_VALUES":return or({},e,{values:t.payload});case"SET_TOUCHED":return or({},e,{touched:t.payload});case"SET_ERRORS":return fl(e.errors,t.payload)?e:or({},e,{errors:t.payload});case"SET_STATUS":return or({},e,{status:t.payload});case"SET_ISSUBMITTING":return or({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return or({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return or({},e,{values:El(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return or({},e,{touched:El(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return or({},e,{errors:El(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":return or({},e,t.payload);case"SET_FORMIK_STATE":return t.payload(e);case"SUBMIT_ATTEMPT":return or({},e,{touched:aR(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":return or({},e,{isSubmitting:!1});case"SUBMIT_SUCCESS":return or({},e,{isSubmitting:!1});default:return e}}var il={},Zp={};function Dae(e){var t=e.validateOnChange,n=t===void 0?!0:t,r=e.validateOnBlur,o=r===void 0?!0:r,s=e.validateOnMount,a=s===void 0?!1:s,c=e.isInitialValid,d=e.enableReinitialize,f=d===void 0?!1:d,h=e.onSubmit,m=Ec(e,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),v=or({validateOnChange:n,validateOnBlur:o,validateOnMount:a,onSubmit:h},m),y=p.useRef(v.initialValues),S=p.useRef(v.initialErrors||il),x=p.useRef(v.initialTouched||Zp),w=p.useRef(v.initialStatus),_=p.useRef(!1),k=p.useRef({});p.useEffect(function(){return _.current=!0,function(){_.current=!1}},[]);var P=p.useState(0),j=P[1],I=p.useRef({values:v.initialValues,errors:v.initialErrors||il,touched:v.initialTouched||Zp,status:v.initialStatus,isSubmitting:!1,isValidating:!1,submitCount:0}),O=I.current,T=p.useCallback(function(K){var Ce=I.current;I.current=Mae(Ce,K),Ce!==I.current&&j(function(ne){return ne+1})},[]),R=p.useCallback(function(K,Ce){return new Promise(function(ne,me){var Re=v.validate(K,Ce);Re==null?ne(il):u1(Re)?Re.then(function(Ye){ne(Ye||il)},function(Ye){me(Ye)}):ne(Re)})},[v.validate]),M=p.useCallback(function(K,Ce){var ne=v.validationSchema,me=Go(ne)?ne(Ce):ne,Re=Ce&&me.validateAt?me.validateAt(Ce,K):Nae(K,me);return new Promise(function(Ye,ye){Re.then(function(){Ye(il)},function(lt){lt.name==="ValidationError"?Ye(Aae(lt)):ye(lt)})})},[v.validationSchema]),D=p.useCallback(function(K,Ce){return new Promise(function(ne){return ne(k.current[K].validate(Ce))})},[]),A=p.useCallback(function(K){var Ce=Object.keys(k.current).filter(function(me){return Go(k.current[me].validate)}),ne=Ce.length>0?Ce.map(function(me){return D(me,Uo(K,me))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(ne).then(function(me){return me.reduce(function(Re,Ye,ye){return Ye==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||Ye&&(Re=El(Re,Ce[ye],Ye)),Re},{})})},[D]),G=p.useCallback(function(K){return Promise.all([A(K),v.validationSchema?M(K):{},v.validate?R(K):{}]).then(function(Ce){var ne=Ce[0],me=Ce[1],Re=Ce[2],Ye=Ay.all([ne,me,Re],{arrayMerge:zae});return Ye})},[v.validate,v.validationSchema,A,R,M]),$=us(function(K){return K===void 0&&(K=O.values),T({type:"SET_ISVALIDATING",payload:!0}),G(K).then(function(Ce){return _.current&&(T({type:"SET_ISVALIDATING",payload:!1}),T({type:"SET_ERRORS",payload:Ce})),Ce})});p.useEffect(function(){a&&_.current===!0&&fl(y.current,v.initialValues)&&$(y.current)},[a,$]);var H=p.useCallback(function(K){var Ce=K&&K.values?K.values:y.current,ne=K&&K.errors?K.errors:S.current?S.current:v.initialErrors||{},me=K&&K.touched?K.touched:x.current?x.current:v.initialTouched||{},Re=K&&K.status?K.status:w.current?w.current:v.initialStatus;y.current=Ce,S.current=ne,x.current=me,w.current=Re;var Ye=function(){T({type:"RESET_FORM",payload:{isSubmitting:!!K&&!!K.isSubmitting,errors:ne,touched:me,status:Re,values:Ce,isValidating:!!K&&!!K.isValidating,submitCount:K&&K.submitCount&&typeof K.submitCount=="number"?K.submitCount:0}})};if(v.onReset){var ye=v.onReset(O.values,ke);u1(ye)?ye.then(Ye):Ye()}else Ye()},[v.initialErrors,v.initialStatus,v.initialTouched]);p.useEffect(function(){_.current===!0&&!fl(y.current,v.initialValues)&&f&&(y.current=v.initialValues,H(),a&&$(y.current))},[f,v.initialValues,H,a,$]),p.useEffect(function(){f&&_.current===!0&&!fl(S.current,v.initialErrors)&&(S.current=v.initialErrors||il,T({type:"SET_ERRORS",payload:v.initialErrors||il}))},[f,v.initialErrors]),p.useEffect(function(){f&&_.current===!0&&!fl(x.current,v.initialTouched)&&(x.current=v.initialTouched||Zp,T({type:"SET_TOUCHED",payload:v.initialTouched||Zp}))},[f,v.initialTouched]),p.useEffect(function(){f&&_.current===!0&&!fl(w.current,v.initialStatus)&&(w.current=v.initialStatus,T({type:"SET_STATUS",payload:v.initialStatus}))},[f,v.initialStatus,v.initialTouched]);var U=us(function(K){if(k.current[K]&&Go(k.current[K].validate)){var Ce=Uo(O.values,K),ne=k.current[K].validate(Ce);return u1(ne)?(T({type:"SET_ISVALIDATING",payload:!0}),ne.then(function(me){return me}).then(function(me){T({type:"SET_FIELD_ERROR",payload:{field:K,value:me}}),T({type:"SET_ISVALIDATING",payload:!1})})):(T({type:"SET_FIELD_ERROR",payload:{field:K,value:ne}}),Promise.resolve(ne))}else if(v.validationSchema)return T({type:"SET_ISVALIDATING",payload:!0}),M(O.values,K).then(function(me){return me}).then(function(me){T({type:"SET_FIELD_ERROR",payload:{field:K,value:Uo(me,K)}}),T({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),q=p.useCallback(function(K,Ce){var ne=Ce.validate;k.current[K]={validate:ne}},[]),z=p.useCallback(function(K){delete k.current[K]},[]),L=us(function(K,Ce){T({type:"SET_TOUCHED",payload:K});var ne=Ce===void 0?o:Ce;return ne?$(O.values):Promise.resolve()}),V=p.useCallback(function(K){T({type:"SET_ERRORS",payload:K})},[]),W=us(function(K,Ce){var ne=Go(K)?K(O.values):K;T({type:"SET_VALUES",payload:ne});var me=Ce===void 0?n:Ce;return me?$(ne):Promise.resolve()}),te=p.useCallback(function(K,Ce){T({type:"SET_FIELD_ERROR",payload:{field:K,value:Ce}})},[]),fe=us(function(K,Ce,ne){T({type:"SET_FIELD_VALUE",payload:{field:K,value:Ce}});var me=ne===void 0?n:ne;return me?$(El(O.values,K,Ce)):Promise.resolve()}),ae=p.useCallback(function(K,Ce){var ne=Ce,me=K,Re;if(!c1(K)){K.persist&&K.persist();var Ye=K.target?K.target:K.currentTarget,ye=Ye.type,lt=Ye.name,It=Ye.id,Xt=Ye.value,$e=Ye.checked,Ke=Ye.outerHTML,Cn=Ye.options,Ee=Ye.multiple;ne=Ce||lt||It,me=/number|range/.test(ye)?(Re=parseFloat(Xt),isNaN(Re)?"":Re):/checkbox/.test(ye)?Lae(Uo(O.values,ne),$e,Xt):Cn&&Ee?$ae(Cn):Xt}ne&&fe(ne,me)},[fe,O.values]),J=us(function(K){if(c1(K))return function(Ce){return ae(Ce,K)};ae(K)}),B=us(function(K,Ce,ne){Ce===void 0&&(Ce=!0),T({type:"SET_FIELD_TOUCHED",payload:{field:K,value:Ce}});var me=ne===void 0?o:ne;return me?$(O.values):Promise.resolve()}),oe=p.useCallback(function(K,Ce){K.persist&&K.persist();var ne=K.target,me=ne.name,Re=ne.id,Ye=ne.outerHTML,ye=Ce||me||Re;B(ye,!0)},[B]),le=us(function(K){if(c1(K))return function(Ce){return oe(Ce,K)};oe(K)}),ge=p.useCallback(function(K){Go(K)?T({type:"SET_FORMIK_STATE",payload:K}):T({type:"SET_FORMIK_STATE",payload:function(){return K}})},[]),se=p.useCallback(function(K){T({type:"SET_STATUS",payload:K})},[]),pe=p.useCallback(function(K){T({type:"SET_ISSUBMITTING",payload:K})},[]),ue=us(function(){return T({type:"SUBMIT_ATTEMPT"}),$().then(function(K){var Ce=K instanceof Error,ne=!Ce&&Object.keys(K).length===0;if(ne){var me;try{if(me=ie(),me===void 0)return}catch(Re){throw Re}return Promise.resolve(me).then(function(Re){return _.current&&T({type:"SUBMIT_SUCCESS"}),Re}).catch(function(Re){if(_.current)throw T({type:"SUBMIT_FAILURE"}),Re})}else if(_.current&&(T({type:"SUBMIT_FAILURE"}),Ce))throw K})}),be=us(function(K){K&&K.preventDefault&&Go(K.preventDefault)&&K.preventDefault(),K&&K.stopPropagation&&Go(K.stopPropagation)&&K.stopPropagation(),ue().catch(function(Ce){console.warn("Warning: An unhandled error was caught from submitForm()",Ce)})}),ke={resetForm:H,validateForm:$,validateField:U,setErrors:V,setFieldError:te,setFieldTouched:B,setFieldValue:fe,setStatus:se,setSubmitting:pe,setTouched:L,setValues:W,setFormikState:ge,submitForm:ue},ie=us(function(){return h(O.values,ke)}),Pe=us(function(K){K&&K.preventDefault&&Go(K.preventDefault)&&K.preventDefault(),K&&K.stopPropagation&&Go(K.stopPropagation)&&K.stopPropagation(),H()}),Je=p.useCallback(function(K){return{value:Uo(O.values,K),error:Uo(O.errors,K),touched:!!Uo(O.touched,K),initialValue:Uo(y.current,K),initialTouched:!!Uo(x.current,K),initialError:Uo(S.current,K)}},[O.errors,O.touched,O.values]),Ae=p.useCallback(function(K){return{setValue:function(ne,me){return fe(K,ne,me)},setTouched:function(ne,me){return B(K,ne,me)},setError:function(ne){return te(K,ne)}}},[fe,B,te]),Ve=p.useCallback(function(K){var Ce=sv(K),ne=Ce?K.name:K,me=Uo(O.values,ne),Re={name:ne,value:me,onChange:J,onBlur:le};if(Ce){var Ye=K.type,ye=K.value,lt=K.as,It=K.multiple;Ye==="checkbox"?ye===void 0?Re.checked=!!me:(Re.checked=!!(Array.isArray(me)&&~me.indexOf(ye)),Re.value=ye):Ye==="radio"?(Re.checked=me===ye,Re.value=ye):lt==="select"&&It&&(Re.value=Re.value||[],Re.multiple=!0)}return Re},[le,J,O.values]),kt=p.useMemo(function(){return!fl(y.current,O.values)},[y.current,O.values]),ft=p.useMemo(function(){return typeof c<"u"?kt?O.errors&&Object.keys(O.errors).length===0:c!==!1&&Go(c)?c(v):c:O.errors&&Object.keys(O.errors).length===0},[c,kt,O.errors,v]),yn=or({},O,{initialValues:y.current,initialErrors:S.current,initialTouched:x.current,initialStatus:w.current,handleBlur:le,handleChange:J,handleReset:Pe,handleSubmit:be,resetForm:H,setErrors:V,setFormikState:ge,setFieldTouched:B,setFieldValue:fe,setFieldError:te,setStatus:se,setSubmitting:pe,setTouched:L,setValues:W,submitForm:ue,validateForm:$,validateField:U,isValid:ft,dirty:kt,unregisterField:z,registerField:q,getFieldProps:Ve,getFieldMeta:Je,getFieldHelpers:Ae,validateOnBlur:o,validateOnChange:n,validateOnMount:a});return yn}function r2(e){var t=Dae(e),n=e.component,r=e.children,o=e.render,s=e.innerRef;return p.useImperativeHandle(s,function(){return t}),p.createElement(Oae,{value:t},n?p.createElement(n,t):o?o(t):r?Go(r)?r(t):Rae(r)?null:p.Children.only(r):null)}function Aae(e){var t={};if(e.inner){if(e.inner.length===0)return El(t,e.path,e.message);for(var o=e.inner,n=Array.isArray(o),r=0,o=n?o:o[Symbol.iterator]();;){var s;if(n){if(r>=o.length)break;s=o[r++]}else{if(r=o.next(),r.done)break;s=r.value}var a=s;Uo(t,a.path)||(t=El(t,a.path,a.message))}}return t}function Nae(e,t,n,r){n===void 0&&(n=!1);var o=zy(e);return t[n?"validateSync":"validate"](o,{abortEarly:!1,context:r||o})}function zy(e){var t=Array.isArray(e)?[]:{};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=String(n);Array.isArray(e[r])===!0?t[r]=e[r].map(function(o){return Array.isArray(o)===!0||iS(o)?zy(o):o!==""?o:void 0}):iS(e[r])?t[r]=zy(e[r]):t[r]=e[r]!==""?e[r]:void 0}return t}function zae(e,t,n){var r=e.slice();return t.forEach(function(s,a){if(typeof r[a]>"u"){var c=n.clone!==!1,d=c&&n.isMergeableObject(s);r[a]=d?Ay(Array.isArray(s)?[]:{},s,n):s}else n.isMergeableObject(s)?r[a]=Ay(e[a],s,n):e.indexOf(s)===-1&&r.push(s)}),r}function $ae(e){return Array.from(e).filter(function(t){return t.selected}).map(function(t){return t.value})}function Lae(e,t,n){if(typeof e=="boolean")return!!t;var r=[],o=!1,s=-1;if(Array.isArray(e))r=e,s=e.indexOf(n),o=s>=0;else if(!n||n=="true"||n=="false")return!!t;return t&&n&&!o?r.concat(n):o?r.slice(0,s).concat(r.slice(s+1)):r}var Bae=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?p.useLayoutEffect:p.useEffect;function us(e){var t=p.useRef(e);return Bae(function(){t.current=e}),p.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current.apply(void 0,r)},[])}function Io(e){var t=e.validate,n=e.name,r=e.render,o=e.children,s=e.as,a=e.component,c=Ec(e,["validate","name","render","children","as","component"]),d=sR(),f=Ec(d,["validate","validationSchema"]),h=f.registerField,m=f.unregisterField;p.useEffect(function(){return h(n,{validate:t}),function(){m(n)}},[h,m,n,t]);var v=f.getFieldProps(or({name:n},c)),y=f.getFieldMeta(n),S={field:v,form:f};if(r)return r(or({},S,{meta:y}));if(Go(o))return o(or({},S,{meta:y}));if(a){if(typeof a=="string"){var x=c.innerRef,w=Ec(c,["innerRef"]);return p.createElement(a,or({ref:x},v,w),o)}return p.createElement(a,or({field:v,form:f},c),o)}var _=s||"input";if(typeof _=="string"){var k=c.innerRef,P=Ec(c,["innerRef"]);return p.createElement(_,or({ref:k},v,P),o)}return p.createElement(_,or({},v,c),o)}var Fae=p.forwardRef(function(e,t){var n=e.action,r=Ec(e,["action"]),o=n??"#",s=sR(),a=s.handleReset,c=s.handleSubmit;return p.createElement("form",or({onSubmit:c,ref:t,onReset:a,action:o},r))});Fae.displayName="Form";const o2=Ie.form;function Ns({children:e}){return i.jsx(X,{sx:{flexDirection:"column",padding:4,rowGap:4,borderRadius:"base",width:"full",bg:"base.900"},children:e})}const iR=Oe([wo],e=>{const{model_list:t}=e,n=[];return Ul(t,r=>{n.push(r.weights)}),n});function iP({model:e,modelsToAdd:t,setModelsToAdd:n}){const{t:r}=we(),o=Y(iR),s=a=>{t.includes(a.target.value)?n(Y9(t,c=>c!==a.target.value)):n([...t,a.target.value])};return i.jsxs(X,{flexDirection:"column",gap:2,backgroundColor:t.includes(e.name)?"accent.650":"base.800",paddingX:4,paddingY:2,borderRadius:4,children:[i.jsxs(X,{gap:4,alignItems:"center",justifyContent:"space-between",children:[i.jsx(Hn,{value:e.name,label:i.jsx(nt,{fontWeight:500,children:e.name}),isChecked:t.includes(e.name),isDisabled:o.includes(e.location),onChange:s}),o.includes(e.location)&&i.jsx(Kc,{colorScheme:"accent",children:r("modelManager.modelExists")})]}),i.jsx(nt,{fontStyle:"italic",variant:"subtext",children:e.location})]})}function Hae(){const e=ce(),{t}=we(),n=Y(P=>P.system.searchFolder),r=Y(P=>P.system.foundModels),o=Y(iR),s=Y(P=>P.ui.shouldShowExistingModelsInSearch),a=Y(P=>P.system.isProcessing),[c,d]=F.useState([]),[f,h]=F.useState("v1"),[m,v]=F.useState(""),y=()=>{e(xM(null)),e(wM(null)),d([])},S=P=>{e(searchForModels(P.checkpointFolder))},x=()=>{d([]),r&&r.forEach(P=>{o.includes(P.location)||d(j=>[...j,P.name])})},w=()=>{d([])},_=()=>{const P=r==null?void 0:r.filter(I=>c.includes(I.name)),j={v1:"configs/stable-diffusion/v1-inference.yaml",v2_base:"configs/stable-diffusion/v2-inference-v.yaml",v2_768:"configs/stable-diffusion/v2-inference-v.yaml",inpainting:"configs/stable-diffusion/v1-inpainting-inference.yaml",custom:m};P==null||P.forEach(I=>{const O={name:I.name,description:"",config:j[f],weights:I.location,vae:"",width:512,height:512,default:!1,format:"ckpt"};e(addNewModel(O))}),d([])},k=()=>{const P=[],j=[];return r&&r.forEach((I,O)=>{o.includes(I.location)?j.push(i.jsx(iP,{model:I,modelsToAdd:c,setModelsToAdd:d},O)):P.push(i.jsx(iP,{model:I,modelsToAdd:c,setModelsToAdd:d},O))}),i.jsxs(X,{flexDirection:"column",rowGap:4,children:[P,s&&j]})};return i.jsxs(i.Fragment,{children:[n?i.jsxs(X,{sx:{padding:4,gap:2,position:"relative",borderRadius:"base",alignItems:"center",w:"full",bg:"base.900"},children:[i.jsxs(X,{sx:{flexDir:"column",gap:2},children:[i.jsx(nt,{sx:{fontWeight:500},variant:"subtext",children:t("modelManager.checkpointFolder")}),i.jsx(nt,{sx:{fontWeight:500},children:n})]}),i.jsx(ql,{}),i.jsx(Ne,{"aria-label":t("modelManager.scanAgain"),tooltip:t("modelManager.scanAgain"),icon:i.jsx(JC,{}),fontSize:18,disabled:a,onClick:()=>e(searchForModels(n))}),i.jsx(Ne,{"aria-label":t("modelManager.clearCheckpointFolder"),tooltip:t("modelManager.clearCheckpointFolder"),icon:i.jsx(Mo,{}),onClick:y})]}):i.jsx(r2,{initialValues:{checkpointFolder:""},onSubmit:P=>{S(P)},children:({handleSubmit:P})=>i.jsx(o2,{onSubmit:P,width:"100%",children:i.jsxs(ya,{columnGap:2,alignItems:"flex-end",children:[i.jsx(ar,{flexGrow:1,children:i.jsx(Io,{as:Qn,id:"checkpointFolder",name:"checkpointFolder",type:"text",size:"md",label:t("modelManager.checkpointFolder")})}),i.jsx(cn,{leftIcon:i.jsx(JC,{}),"aria-label":t("modelManager.findModels"),tooltip:t("modelManager.findModels"),type:"submit",disabled:a,px:8,children:t("modelManager.findModels")})]})})}),r&&i.jsxs(X,{flexDirection:"column",rowGap:4,width:"full",children:[i.jsxs(X,{justifyContent:"space-between",alignItems:"center",children:[i.jsxs("p",{children:[t("modelManager.modelsFound"),": ",r.length]}),i.jsxs("p",{children:[t("modelManager.selected"),": ",c.length]})]}),i.jsxs(X,{columnGap:2,justifyContent:"space-between",children:[i.jsxs(X,{columnGap:2,children:[i.jsx(cn,{isDisabled:c.length===r.length,onClick:x,children:t("modelManager.selectAll")}),i.jsx(cn,{isDisabled:c.length===0,onClick:w,children:t("modelManager.deselectAll")}),i.jsx(Hn,{label:t("modelManager.showExisting"),isChecked:s,onChange:()=>e(bM(!s))})]}),i.jsx(cn,{isDisabled:c.length===0,onClick:_,colorScheme:"accent",children:t("modelManager.addSelected")})]}),i.jsxs(X,{sx:{flexDirection:"column",padding:4,rowGap:4,borderRadius:"base",width:"full",bg:"base.900"},children:[i.jsxs(X,{gap:4,children:[i.jsx(nt,{fontWeight:500,variant:"subtext",children:t("modelManager.pickModelType")}),i.jsx(Md,{value:f,onChange:P=>h(P),defaultValue:"v1",name:"model_type",children:i.jsxs(X,{gap:4,children:[i.jsx(yo,{value:"v1",children:i.jsx(nt,{fontSize:"sm",children:t("modelManager.v1")})}),i.jsx(yo,{value:"v2_base",children:i.jsx(nt,{fontSize:"sm",children:t("modelManager.v2_base")})}),i.jsx(yo,{value:"v2_768",children:i.jsx(nt,{fontSize:"sm",children:t("modelManager.v2_768")})}),i.jsx(yo,{value:"inpainting",children:i.jsx(nt,{fontSize:"sm",children:t("modelManager.inpainting")})}),i.jsx(yo,{value:"custom",children:i.jsx(nt,{fontSize:"sm",children:t("modelManager.customConfig")})})]})})]}),f==="custom"&&i.jsxs(X,{flexDirection:"column",rowGap:2,children:[i.jsx(nt,{fontWeight:"500",fontSize:"sm",variant:"subtext",children:t("modelManager.pathToCustomConfig")}),i.jsx(Qn,{value:m,onChange:P=>{P.target.value!==""&&v(P.target.value)},width:"full"})]})]}),i.jsx(X,{flexDirection:"column",maxHeight:72,overflowY:"scroll",borderRadius:"sm",gap:2,children:r.length>0?k():i.jsx(nt,{fontWeight:"500",padding:2,borderRadius:"sm",textAlign:"center",variant:"subtext",children:t("modelManager.noModelsFound")})})]})]})}const lP=64,cP=2048;function Vae(){const e=ce(),{t}=we(),n=Y(f=>f.system.isProcessing);function r(f){return/\s/.test(f)}function o(f){let h;return r(f)&&(h=t("modelManager.cannotUseSpaces")),h}const s={name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,format:"ckpt",default:!1},a=f=>{e(addNewModel(f)),e(kh(null))},[c,d]=F.useState(!1);return i.jsxs(Ar,{gap:2,alignItems:"flex-start",children:[i.jsxs(X,{columnGap:4,children:[i.jsx(Hn,{isChecked:!c,label:t("modelManager.scanForModels"),onChange:()=>d(!c)}),i.jsx(Hn,{label:t("modelManager.addManually"),isChecked:c,onChange:()=>d(!c)})]}),c?i.jsx(r2,{initialValues:s,onSubmit:a,children:({handleSubmit:f,errors:h,touched:m})=>i.jsx(o2,{onSubmit:f,sx:{w:"full"},children:i.jsxs(Ar,{rowGap:2,children:[i.jsx(nt,{fontSize:20,fontWeight:"bold",alignSelf:"start",children:t("modelManager.manual")}),i.jsx(Ns,{children:i.jsxs(ar,{isInvalid:!!h.name&&m.name,isRequired:!0,children:[i.jsx(hr,{htmlFor:"name",fontSize:"sm",children:t("modelManager.name")}),i.jsxs(Ar,{alignItems:"start",children:[i.jsx(Io,{as:Qn,id:"name",name:"name",type:"text",validate:o,width:"full"}),h.name&&m.name?i.jsx(Eo,{children:h.name}):i.jsx(jo,{margin:0,children:t("modelManager.nameValidationMsg")})]})]})}),i.jsx(Ns,{children:i.jsxs(ar,{isInvalid:!!h.description&&m.description,isRequired:!0,children:[i.jsx(hr,{htmlFor:"description",fontSize:"sm",children:t("modelManager.description")}),i.jsxs(Ar,{alignItems:"start",children:[i.jsx(Io,{as:Qn,id:"description",name:"description",type:"text",width:"full"}),h.description&&m.description?i.jsx(Eo,{children:h.description}):i.jsx(jo,{margin:0,children:t("modelManager.descriptionValidationMsg")})]})]})}),i.jsx(Ns,{children:i.jsxs(ar,{isInvalid:!!h.config&&m.config,isRequired:!0,children:[i.jsx(hr,{htmlFor:"config",fontSize:"sm",children:t("modelManager.config")}),i.jsxs(Ar,{alignItems:"start",children:[i.jsx(Io,{as:Qn,id:"config",name:"config",type:"text",width:"full"}),h.config&&m.config?i.jsx(Eo,{children:h.config}):i.jsx(jo,{margin:0,children:t("modelManager.configValidationMsg")})]})]})}),i.jsx(Ns,{children:i.jsxs(ar,{isInvalid:!!h.weights&&m.weights,isRequired:!0,children:[i.jsx(hr,{htmlFor:"config",fontSize:"sm",children:t("modelManager.modelLocation")}),i.jsxs(Ar,{alignItems:"start",children:[i.jsx(Io,{as:Qn,id:"weights",name:"weights",type:"text",width:"full"}),h.weights&&m.weights?i.jsx(Eo,{children:h.weights}):i.jsx(jo,{margin:0,children:t("modelManager.modelLocationValidationMsg")})]})]})}),i.jsx(Ns,{children:i.jsxs(ar,{isInvalid:!!h.vae&&m.vae,children:[i.jsx(hr,{htmlFor:"vae",fontSize:"sm",children:t("modelManager.vaeLocation")}),i.jsxs(Ar,{alignItems:"start",children:[i.jsx(Io,{as:Qn,id:"vae",name:"vae",type:"text",width:"full"}),h.vae&&m.vae?i.jsx(Eo,{children:h.vae}):i.jsx(jo,{margin:0,children:t("modelManager.vaeLocationValidationMsg")})]})]})}),i.jsxs(ya,{width:"100%",children:[i.jsx(Ns,{children:i.jsxs(ar,{isInvalid:!!h.width&&m.width,children:[i.jsx(hr,{htmlFor:"width",fontSize:"sm",children:t("modelManager.width")}),i.jsxs(Ar,{alignItems:"start",children:[i.jsx(Io,{id:"width",name:"width",children:({field:v,form:y})=>i.jsx(lu,{id:"width",name:"width",min:lP,max:cP,step:64,value:y.values.width,onChange:S=>y.setFieldValue(v.name,Number(S))})}),h.width&&m.width?i.jsx(Eo,{children:h.width}):i.jsx(jo,{margin:0,children:t("modelManager.widthValidationMsg")})]})]})}),i.jsx(Ns,{children:i.jsxs(ar,{isInvalid:!!h.height&&m.height,children:[i.jsx(hr,{htmlFor:"height",fontSize:"sm",children:t("modelManager.height")}),i.jsxs(Ar,{alignItems:"start",children:[i.jsx(Io,{id:"height",name:"height",children:({field:v,form:y})=>i.jsx(lu,{id:"height",name:"height",min:lP,max:cP,step:64,value:y.values.height,onChange:S=>y.setFieldValue(v.name,Number(S))})}),h.height&&m.height?i.jsx(Eo,{children:h.height}):i.jsx(jo,{margin:0,children:t("modelManager.heightValidationMsg")})]})]})})]}),i.jsx(cn,{type:"submit",className:"modal-close-btn",isLoading:n,children:t("modelManager.addModel")})]})})}):i.jsx(Hae,{})]})}function Wae(){const e=ce(),{t}=we(),n=Y(c=>c.system.isProcessing);function r(c){return/\s/.test(c)}function o(c){let d;return r(c)&&(d=t("modelManager.cannotUseSpaces")),d}const s={name:"",description:"",repo_id:"",path:"",format:"diffusers",default:!1,vae:{repo_id:"",path:""}},a=c=>{const d=c;c.path===""&&delete d.path,c.repo_id===""&&delete d.repo_id,c.vae.path===""&&delete d.vae.path,c.vae.repo_id===""&&delete d.vae.repo_id,e(addNewModel(d)),e(kh(null))};return i.jsx(X,{overflow:"scroll",maxHeight:window.innerHeight-270,children:i.jsx(r2,{initialValues:s,onSubmit:a,children:({handleSubmit:c,errors:d,touched:f})=>{var h,m,v,y,S,x,w,_,k,P;return i.jsx(o2,{onSubmit:c,children:i.jsxs(Ar,{rowGap:2,children:[i.jsx(Ns,{children:i.jsxs(ar,{isInvalid:!!d.name&&f.name,isRequired:!0,children:[i.jsx(hr,{htmlFor:"name",fontSize:"sm",children:t("modelManager.name")}),i.jsxs(Ar,{alignItems:"start",children:[i.jsx(Io,{as:Qn,id:"name",name:"name",type:"text",validate:o,width:"2xl",isRequired:!0}),d.name&&f.name?i.jsx(Eo,{children:d.name}):i.jsx(jo,{margin:0,children:t("modelManager.nameValidationMsg")})]})]})}),i.jsx(Ns,{children:i.jsxs(ar,{isInvalid:!!d.description&&f.description,isRequired:!0,children:[i.jsx(hr,{htmlFor:"description",fontSize:"sm",children:t("modelManager.description")}),i.jsxs(Ar,{alignItems:"start",children:[i.jsx(Io,{as:Qn,id:"description",name:"description",type:"text",width:"2xl",isRequired:!0}),d.description&&f.description?i.jsx(Eo,{children:d.description}):i.jsx(jo,{margin:0,children:t("modelManager.descriptionValidationMsg")})]})]})}),i.jsxs(Ns,{children:[i.jsx(nt,{fontWeight:"bold",fontSize:"sm",children:t("modelManager.formMessageDiffusersModelLocation")}),i.jsx(nt,{sx:{fontSize:"sm",fontStyle:"italic"},variant:"subtext",children:t("modelManager.formMessageDiffusersModelLocationDesc")}),i.jsxs(ar,{isInvalid:!!d.path&&f.path,children:[i.jsx(hr,{htmlFor:"path",fontSize:"sm",children:t("modelManager.modelLocation")}),i.jsxs(Ar,{alignItems:"start",children:[i.jsx(Io,{as:Qn,id:"path",name:"path",type:"text",width:"2xl"}),d.path&&f.path?i.jsx(Eo,{children:d.path}):i.jsx(jo,{margin:0,children:t("modelManager.modelLocationValidationMsg")})]})]}),i.jsxs(ar,{isInvalid:!!d.repo_id&&f.repo_id,children:[i.jsx(hr,{htmlFor:"repo_id",fontSize:"sm",children:t("modelManager.repo_id")}),i.jsxs(Ar,{alignItems:"start",children:[i.jsx(Io,{as:Qn,id:"repo_id",name:"repo_id",type:"text",width:"2xl"}),d.repo_id&&f.repo_id?i.jsx(Eo,{children:d.repo_id}):i.jsx(jo,{margin:0,children:t("modelManager.repoIDValidationMsg")})]})]})]}),i.jsxs(Ns,{children:[i.jsx(nt,{fontWeight:"bold",children:t("modelManager.formMessageDiffusersVAELocation")}),i.jsx(nt,{sx:{fontSize:"sm",fontStyle:"italic"},variant:"subtext",children:t("modelManager.formMessageDiffusersVAELocationDesc")}),i.jsxs(ar,{isInvalid:!!((h=d.vae)!=null&&h.path)&&((m=f.vae)==null?void 0:m.path),children:[i.jsx(hr,{htmlFor:"vae.path",fontSize:"sm",children:t("modelManager.vaeLocation")}),i.jsxs(Ar,{alignItems:"start",children:[i.jsx(Io,{as:Qn,id:"vae.path",name:"vae.path",type:"text",width:"2xl"}),(v=d.vae)!=null&&v.path&&((y=f.vae)!=null&&y.path)?i.jsx(Eo,{children:(S=d.vae)==null?void 0:S.path}):i.jsx(jo,{margin:0,children:t("modelManager.vaeLocationValidationMsg")})]})]}),i.jsxs(ar,{isInvalid:!!((x=d.vae)!=null&&x.repo_id)&&((w=f.vae)==null?void 0:w.repo_id),children:[i.jsx(hr,{htmlFor:"vae.repo_id",fontSize:"sm",children:t("modelManager.vaeRepoID")}),i.jsxs(Ar,{alignItems:"start",children:[i.jsx(Io,{as:Qn,id:"vae.repo_id",name:"vae.repo_id",type:"text",width:"2xl"}),(_=d.vae)!=null&&_.repo_id&&((k=f.vae)!=null&&k.repo_id)?i.jsx(Eo,{children:(P=d.vae)==null?void 0:P.repo_id}):i.jsx(jo,{margin:0,children:t("modelManager.vaeRepoIDValidationMsg")})]})]})]}),i.jsx(cn,{type:"submit",isLoading:n,children:t("modelManager.addModel")})]})})}})})}function Uae(){const e=Y(r=>r.ui.addNewModelUIOption),t=ce(),{t:n}=we();return i.jsxs(X,{flexDirection:"column",gap:4,children:[i.jsxs(X,{columnGap:4,children:[i.jsx(cn,{onClick:()=>t(kh("ckpt")),sx:{backgroundColor:e=="ckpt"?"accent.700":"base.700","&:hover":{backgroundColor:e=="ckpt"?"accent.700":"base.600"}},children:n("modelManager.addCheckpointModel")}),i.jsx(cn,{onClick:()=>t(kh("diffusers")),sx:{backgroundColor:e=="diffusers"?"accent.700":"base.700","&:hover":{backgroundColor:e=="diffusers"?"accent.700":"base.600"}},children:n("modelManager.addDiffuserModel")})]}),i.jsx(ai,{}),e=="ckpt"&&i.jsx(Vae,{}),e=="diffusers"&&i.jsx(Wae,{})]})}function uP(e){const{children:t,value:n}=e,[r,o]=Wl("colors",["base.800","base.200"]);return i.jsx("option",{value:n,style:{background:r,color:o},children:t})}const Gae=e=>{const{label:t,isDisabled:n,validValues:r,tooltip:o,tooltipProps:s,horizontal:a,spaceEvenly:c,...d}=e;return i.jsxs(ar,{isDisabled:n,onClick:f=>{f.stopPropagation(),f.nativeEvent.stopImmediatePropagation(),f.nativeEvent.stopPropagation(),f.nativeEvent.cancelBubble=!0},sx:a?{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:4}:{},children:[t&&i.jsx(hr,{sx:c?{flexBasis:0,flexGrow:1}:{},children:t}),i.jsx(Wn,{label:o,...s,children:i.jsx(Lb,{...d,rootProps:{sx:c?{flexBasis:0,flexGrow:1}:{}},children:r.map(f=>typeof f=="string"||typeof f=="number"?i.jsx(uP,{value:f,children:f},f):i.jsx(uP,{value:f.value,children:f.key},f.value))})})]})},d1=p.memo(Gae);function qae(){const{t:e}=we(),t=ce(),{data:n}=kf(),r=SM(n==null?void 0:n.entities,(A,G)=>(A==null?void 0:A.model_format)==="diffusers"),[o,s]=p.useState(Object.keys(r)[0]),[a,c]=p.useState(Object.keys(r)[1]),[d,f]=p.useState("none"),[h,m]=p.useState(""),[v,y]=p.useState(.5),[S,x]=p.useState("weighted_sum"),[w,_]=p.useState("root"),[k,P]=p.useState(""),[j,I]=p.useState(!1),O=Object.keys(r).filter(A=>A!==a&&A!==d),T=Object.keys(r).filter(A=>A!==o&&A!==d),R=[{key:e("modelManager.none"),value:"none"},...Object.keys(r).filter(A=>A!==o&&A!==a).map(A=>({key:A,value:A}))],M=Y(A=>A.system.isProcessing),D=()=>{let A=[o,a,d];A=A.filter($=>$!=="none");const G={models_to_merge:A,merged_model_name:h!==""?h:A.join("-"),alpha:v,interp:S,model_merge_save_path:w==="root"?null:k,force:j};t(mergeDiffusersModels(G))};return i.jsxs(X,{flexDirection:"column",rowGap:4,children:[i.jsxs(X,{sx:{flexDirection:"column",rowGap:1,bg:"base.900"},children:[i.jsx(nt,{children:e("modelManager.modelMergeHeaderHelp1")}),i.jsx(nt,{fontSize:"sm",variant:"subtext",children:e("modelManager.modelMergeHeaderHelp2")})]}),i.jsxs(X,{columnGap:4,children:[i.jsx(d1,{label:e("modelManager.modelOne"),validValues:O,onChange:A=>s(A.target.value)}),i.jsx(d1,{label:e("modelManager.modelTwo"),validValues:T,onChange:A=>c(A.target.value)}),i.jsx(d1,{label:e("modelManager.modelThree"),validValues:R,onChange:A=>{A.target.value!=="none"?(f(A.target.value),x("add_difference")):(f("none"),x("weighted_sum"))}})]}),i.jsx(Qn,{label:e("modelManager.mergedModelName"),value:h,onChange:A=>m(A.target.value)}),i.jsxs(X,{sx:{flexDirection:"column",padding:4,borderRadius:"base",gap:4,bg:"base.900"},children:[i.jsx(Et,{label:e("modelManager.alpha"),min:.01,max:.99,step:.01,value:v,onChange:A=>y(A),withInput:!0,withReset:!0,handleReset:()=>y(.5),withSliderMarks:!0}),i.jsx(nt,{variant:"subtext",fontSize:"sm",children:e("modelManager.modelMergeAlphaHelp")})]}),i.jsxs(X,{sx:{padding:4,borderRadius:"base",gap:4,bg:"base.900"},children:[i.jsx(nt,{fontWeight:500,fontSize:"sm",variant:"subtext",children:e("modelManager.interpolationType")}),i.jsx(Md,{value:S,onChange:A=>x(A),children:i.jsx(X,{columnGap:4,children:d==="none"?i.jsxs(i.Fragment,{children:[i.jsx(yo,{value:"weighted_sum",children:i.jsx(nt,{fontSize:"sm",children:e("modelManager.weightedSum")})}),i.jsx(yo,{value:"sigmoid",children:i.jsx(nt,{fontSize:"sm",children:e("modelManager.sigmoid")})}),i.jsx(yo,{value:"inv_sigmoid",children:i.jsx(nt,{fontSize:"sm",children:e("modelManager.inverseSigmoid")})})]}):i.jsx(yo,{value:"add_difference",children:i.jsx(Wn,{label:e("modelManager.modelMergeInterpAddDifferenceHelp"),children:i.jsx(nt,{fontSize:"sm",children:e("modelManager.addDifference")})})})})})]}),i.jsxs(X,{sx:{flexDirection:"column",padding:4,borderRadius:"base",gap:4,bg:"base.900"},children:[i.jsxs(X,{columnGap:4,children:[i.jsx(nt,{fontWeight:"500",fontSize:"sm",variant:"subtext",children:e("modelManager.mergedModelSaveLocation")}),i.jsx(Md,{value:w,onChange:A=>_(A),children:i.jsxs(X,{columnGap:4,children:[i.jsx(yo,{value:"root",children:i.jsx(nt,{fontSize:"sm",children:e("modelManager.invokeAIFolder")})}),i.jsx(yo,{value:"custom",children:i.jsx(nt,{fontSize:"sm",children:e("modelManager.custom")})})]})})]}),w==="custom"&&i.jsx(Qn,{label:e("modelManager.mergedModelCustomSaveLocation"),value:k,onChange:A=>P(A.target.value)})]}),i.jsx(Hn,{label:e("modelManager.ignoreMismatch"),isChecked:j,onChange:A=>I(A.target.checked),fontWeight:"500"}),i.jsx(cn,{onClick:D,isLoading:M,isDisabled:w==="custom"&&k==="",children:e("modelManager.merge")})]})}var Yae=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 a=s[o];if(!e(t[a],n[a]))return!1}return!0}return t!==t&&n!==n};const dP=gu(Yae);function $y(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 Kae=Object.defineProperty,fP=Object.getOwnPropertySymbols,Xae=Object.prototype.hasOwnProperty,Zae=Object.prototype.propertyIsEnumerable,pP=(e,t,n)=>t in e?Kae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Qae=(e,t)=>{for(var n in t||(t={}))Xae.call(t,n)&&pP(e,n,t[n]);if(fP)for(var n of fP(t))Zae.call(t,n)&&pP(e,n,t[n]);return e};function lR(e,t){if(t===null||typeof t!="object")return{};const n=Qae({},t);return Object.keys(t).forEach(r=>{r.includes(`${String(e)}.`)&&delete n[r]}),n}const Jae="__MANTINE_FORM_INDEX__";function hP(e,t){return t?typeof t=="boolean"?t:Array.isArray(t)?t.includes(e.replace(/[.][0-9]/g,`.${Jae}`)):!1:!1}function mP(e,t,n){typeof n.value=="object"&&(n.value=Ic(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||t==="__proto__"?Object.defineProperty(e,t,n):e[t]=n.value}function Ic(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(a){o.add(Ic(a))})):s==="[object Map]"?(o=new Map,e.forEach(function(a,c){o.set(Ic(c),Ic(a))})):s==="[object Date]"?o=new Date(+e):s==="[object RegExp]"?o=new RegExp(e.source,e.flags):s==="[object DataView]"?o=new e.constructor(Ic(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++)mP(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]||mP(o,n,Object.getOwnPropertyDescriptor(e,n))}return o||e}function cR(e){return typeof e!="string"?[]:e.split(".")}function av(e,t,n){const r=cR(e);if(r.length===0)return n;const o=Ic(n);if(r.length===1)return o[r[0]]=t,o;let s=o[r[0]];for(let a=1;a<r.length-1;a+=1){if(s===void 0)return o;s=s[r[a]]}return s[r[r.length-1]]=t,o}function La(e,t){const n=cR(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 gP(e){const t=$y(e);return{hasErrors:Object.keys(t).length>0,errors:t}}function Ly(e,t,n="",r={}){return typeof e!="object"||e===null?r:Object.keys(e).reduce((o,s)=>{const a=e[s],c=`${n===""?"":`${n}.`}${s}`,d=La(c,t);let f=!1;return typeof a=="function"&&(o[c]=a(d,t,c)),typeof a=="object"&&Array.isArray(d)&&(f=!0,d.forEach((h,m)=>Ly(a,t,`${c}.${m}`,o))),typeof a=="object"&&typeof d=="object"&&d!==null&&(f||Ly(a,t,c,o)),o},r)}function By(e,t){return gP(typeof e=="function"?e(t):Ly(e,t))}function Qp(e,t,n){if(typeof e!="string")return{hasError:!1,error:null};const r=By(t,n),o=Object.keys(r.errors).find(s=>e.split(".").every((a,c)=>a===s.split(".")[c]));return{hasError:!!o,error:o?r.errors[o]:null}}function eie(e,{from:t,to:n},r){const o=La(e,r);if(!Array.isArray(o))return r;const s=[...o],a=o[t];return s.splice(t,1),s.splice(n,0,a),av(e,s,r)}var tie=Object.defineProperty,vP=Object.getOwnPropertySymbols,nie=Object.prototype.hasOwnProperty,rie=Object.prototype.propertyIsEnumerable,yP=(e,t,n)=>t in e?tie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,oie=(e,t)=>{for(var n in t||(t={}))nie.call(t,n)&&yP(e,n,t[n]);if(vP)for(var n of vP(t))rie.call(t,n)&&yP(e,n,t[n]);return e};function sie(e,{from:t,to:n},r){const o=`${e}.${t}`,s=`${e}.${n}`,a=oie({},r);return Object.keys(r).every(c=>{let d,f;if(c.startsWith(o)&&(d=c,f=c.replace(o,s)),c.startsWith(s)&&(d=c.replace(s,o),f=c),d&&f){const h=a[d],m=a[f];return m===void 0?delete a[d]:a[d]=m,h===void 0?delete a[f]:a[f]=h,!1}return!0}),a}function aie(e,t,n){const r=La(e,n);return Array.isArray(r)?av(e,r.filter((o,s)=>s!==t),n):n}var iie=Object.defineProperty,bP=Object.getOwnPropertySymbols,lie=Object.prototype.hasOwnProperty,cie=Object.prototype.propertyIsEnumerable,xP=(e,t,n)=>t in e?iie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,uie=(e,t)=>{for(var n in t||(t={}))lie.call(t,n)&&xP(e,n,t[n]);if(bP)for(var n of bP(t))cie.call(t,n)&&xP(e,n,t[n]);return e};function wP(e,t){const n=e.substring(t.length+1).split(".")[0];return parseInt(n,10)}function SP(e,t,n,r){if(t===void 0)return n;const o=`${String(e)}`;let s=n;r===-1&&(s=lR(`${o}.${t}`,s));const a=uie({},s),c=new Set;return Object.entries(s).filter(([d])=>{if(!d.startsWith(`${o}.`))return!1;const f=wP(d,o);return Number.isNaN(f)?!1:f>=t}).forEach(([d,f])=>{const h=wP(d,o),m=d.replace(`${o}.${h}`,`${o}.${h+r}`);a[m]=f,c.add(m),c.has(d)||delete a[d]}),a}function die(e,t,n,r){const o=La(e,r);if(!Array.isArray(o))return r;const s=[...o];return s.splice(typeof n=="number"?n:s.length,0,t),av(e,s,r)}function CP(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 fie(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 pie=Object.defineProperty,hie=Object.defineProperties,mie=Object.getOwnPropertyDescriptors,_P=Object.getOwnPropertySymbols,gie=Object.prototype.hasOwnProperty,vie=Object.prototype.propertyIsEnumerable,kP=(e,t,n)=>t in e?pie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Si=(e,t)=>{for(var n in t||(t={}))gie.call(t,n)&&kP(e,n,t[n]);if(_P)for(var n of _P(t))vie.call(t,n)&&kP(e,n,t[n]);return e},f1=(e,t)=>hie(e,mie(t));function uR({initialValues:e={},initialErrors:t={},initialDirty:n={},initialTouched:r={},clearInputErrorOnChange:o=!0,validateInputOnChange:s=!1,validateInputOnBlur:a=!1,transformValues:c=f=>f,validate:d}={}){const[f,h]=p.useState(r),[m,v]=p.useState(n),[y,S]=p.useState(e),[x,w]=p.useState($y(t)),_=p.useRef(e),k=B=>{_.current=B},P=p.useCallback(()=>h({}),[]),j=B=>{const oe=B?Si(Si({},y),B):y;k(oe),v({})},I=p.useCallback(B=>w(oe=>$y(typeof B=="function"?B(oe):B)),[]),O=p.useCallback(()=>w({}),[]),T=p.useCallback(()=>{S(e),O(),k(e),v({}),P()},[]),R=p.useCallback((B,oe)=>I(le=>f1(Si({},le),{[B]:oe})),[]),M=p.useCallback(B=>I(oe=>{if(typeof B!="string")return oe;const le=Si({},oe);return delete le[B],le}),[]),D=p.useCallback(B=>v(oe=>{if(typeof B!="string")return oe;const le=lR(B,oe);return delete le[B],le}),[]),A=p.useCallback((B,oe)=>{const le=hP(B,s);D(B),h(ge=>f1(Si({},ge),{[B]:!0})),S(ge=>{const se=av(B,oe,ge);if(le){const pe=Qp(B,d,se);pe.hasError?R(B,pe.error):M(B)}return se}),!le&&o&&R(B,null)},[]),G=p.useCallback(B=>{S(oe=>{const le=typeof B=="function"?B(oe):B;return Si(Si({},oe),le)}),o&&O()},[]),$=p.useCallback((B,oe)=>{D(B),S(le=>eie(B,oe,le)),w(le=>sie(B,oe,le))},[]),H=p.useCallback((B,oe)=>{D(B),S(le=>aie(B,oe,le)),w(le=>SP(B,oe,le,-1))},[]),U=p.useCallback((B,oe,le)=>{D(B),S(ge=>die(B,oe,le,ge)),w(ge=>SP(B,le,ge,1))},[]),q=p.useCallback(()=>{const B=By(d,y);return w(B.errors),B},[y,d]),z=p.useCallback(B=>{const oe=Qp(B,d,y);return oe.hasError?R(B,oe.error):M(B),oe},[y,d]),L=(B,{type:oe="input",withError:le=!0,withFocus:ge=!0}={})=>{const pe={onChange:fie(ue=>A(B,ue))};return le&&(pe.error=x[B]),oe==="checkbox"?pe.checked=La(B,y):pe.value=La(B,y),ge&&(pe.onFocus=()=>h(ue=>f1(Si({},ue),{[B]:!0})),pe.onBlur=()=>{if(hP(B,a)){const ue=Qp(B,d,y);ue.hasError?R(B,ue.error):M(B)}}),pe},V=(B,oe)=>le=>{le==null||le.preventDefault();const ge=q();ge.hasErrors?oe==null||oe(ge.errors,y,le):B==null||B(c(y),le)},W=B=>c(B||y),te=p.useCallback(B=>{B.preventDefault(),T()},[]),fe=B=>{if(B){const le=La(B,m);if(typeof le=="boolean")return le;const ge=La(B,y),se=La(B,_.current);return!dP(ge,se)}return Object.keys(m).length>0?CP(m):!dP(y,_.current)},ae=p.useCallback(B=>CP(f,B),[f]),J=p.useCallback(B=>B?!Qp(B,d,y).hasError:!By(d,y).hasErrors,[y,d]);return{values:y,errors:x,setValues:G,setErrors:I,setFieldValue:A,setFieldError:R,clearFieldError:M,clearErrors:O,reset:T,validate:q,validateField:z,reorderListItem:$,removeListItem:H,insertListItem:U,getInputProps:L,onSubmit:V,onReset:te,isDirty:fe,isTouched:ae,setTouched:h,setDirty:v,resetTouched:P,resetDirty:j,isValid:J,getTransformedValues:W}}const yie=ze((e,t)=>{const{t:n}=we(),{acceptButtonText:r=n("common.accept"),acceptCallback:o,cancelButtonText:s=n("common.cancel"),cancelCallback:a,children:c,title:d,triggerComponent:f}=e,{isOpen:h,onOpen:m,onClose:v}=Yc(),y=p.useRef(null),S=()=>{o(),v()},x=()=>{a&&a(),v()};return i.jsxs(i.Fragment,{children:[p.cloneElement(f,{onClick:m,ref:t}),i.jsx(hg,{isOpen:h,leastDestructiveRef:y,onClose:v,isCentered:!0,children:i.jsx(Li,{children:i.jsxs(mg,{children:[i.jsx($i,{fontSize:"lg",fontWeight:"bold",children:d}),i.jsx(Bi,{children:c}),i.jsxs(zi,{children:[i.jsx(cn,{ref:y,onClick:x,children:s}),i.jsx(cn,{colorScheme:"error",onClick:S,ml:3,children:r})]})]})})})]})}),s2=p.memo(yie);function bie(e){const{model:t}=e,n=ce(),{t:r}=we(),[o,s]=p.useState("same"),[a,c]=p.useState("");p.useEffect(()=>{s("same")},[t]);const d=()=>{s("same")},f=()=>{const h={model_name:t,save_location:o,custom_location:o==="custom"&&a!==""?a:null};n(convertToDiffusers(h))};return i.jsxs(s2,{title:`${r("modelManager.convert")} ${t.name}`,acceptCallback:f,cancelCallback:d,acceptButtonText:`${r("modelManager.convert")}`,triggerComponent:i.jsxs(cn,{size:"sm","aria-label":r("modelManager.convertToDiffusers"),className:" modal-close-btn",children:["🧨 ",r("modelManager.convertToDiffusers")]}),motionPreset:"slideInBottom",children:[i.jsxs(X,{flexDirection:"column",rowGap:4,children:[i.jsx(nt,{children:r("modelManager.convertToDiffusersHelpText1")}),i.jsxs(cg,{children:[i.jsx(qo,{children:r("modelManager.convertToDiffusersHelpText2")}),i.jsx(qo,{children:r("modelManager.convertToDiffusersHelpText3")}),i.jsx(qo,{children:r("modelManager.convertToDiffusersHelpText4")}),i.jsx(qo,{children:r("modelManager.convertToDiffusersHelpText5")})]}),i.jsx(nt,{children:r("modelManager.convertToDiffusersHelpText6")})]}),i.jsxs(X,{flexDir:"column",gap:4,children:[i.jsxs(X,{marginTop:4,flexDir:"column",gap:2,children:[i.jsx(nt,{fontWeight:"600",children:r("modelManager.convertToDiffusersSaveLocation")}),i.jsx(Md,{value:o,onChange:h=>s(h),children:i.jsxs(X,{gap:4,children:[i.jsx(yo,{value:"same",children:i.jsx(Wn,{label:"Save converted model in the same folder",children:r("modelManager.sameFolder")})}),i.jsx(yo,{value:"root",children:i.jsx(Wn,{label:"Save converted model in the InvokeAI root folder",children:r("modelManager.invokeRoot")})}),i.jsx(yo,{value:"custom",children:i.jsx(Wn,{label:"Save converted model in a custom folder",children:r("modelManager.custom")})})]})})]}),o==="custom"&&i.jsxs(X,{flexDirection:"column",rowGap:2,children:[i.jsx(nt,{fontWeight:"500",fontSize:"sm",variant:"subtext",children:r("modelManager.customSaveLocation")}),i.jsx(Qn,{value:a,onChange:h=>{h.target.value!==""&&c(h.target.value)},width:"full"})]})]})]})}const xie=[{value:"sd-1",label:Ao["sd-1"]},{value:"sd-2",label:Ao["sd-2"]}],wie=[{value:"normal",label:"Normal"},{value:"inpaint",label:"Inpaint"},{value:"depth",label:"Depth"}];function Sie(e){const t=Y(c=>c.system.isProcessing),{modelToEdit:n,retrievedModel:r}=e;ce();const{t:o}=we(),s=uR({initialValues:{name:r.name,base_model:r.base_model,type:"main",path:r.path,description:r.description,model_format:"checkpoint",vae:r.vae,config:r.config,variant:r.variant}}),a=c=>{console.log(c)};return n?i.jsxs(X,{flexDirection:"column",rowGap:4,width:"100%",children:[i.jsxs(X,{justifyContent:"space-between",alignItems:"center",children:[i.jsxs(X,{flexDirection:"column",children:[i.jsx(nt,{fontSize:"lg",fontWeight:"bold",children:r.name}),i.jsxs(nt,{fontSize:"sm",color:"base.400",children:[Ao[r.base_model]," Model"]})]}),i.jsx(bie,{model:r})]}),i.jsx(ai,{}),i.jsx(X,{flexDirection:"column",maxHeight:window.innerHeight-270,overflowY:"scroll",children:i.jsx("form",{onSubmit:s.onSubmit(c=>a(c)),children:i.jsxs(X,{flexDirection:"column",overflowY:"scroll",gap:4,children:[i.jsx(Qn,{label:o("modelManager.name"),...s.getInputProps("name")}),i.jsx(Qn,{label:o("modelManager.description"),...s.getInputProps("description")}),i.jsx(Er,{label:o("modelManager.baseModel"),data:xie,...s.getInputProps("base_model")}),i.jsx(Er,{label:o("modelManager.variant"),data:wie,...s.getInputProps("variant")}),i.jsx(Qn,{label:o("modelManager.modelLocation"),...s.getInputProps("path")}),i.jsx(Qn,{label:o("modelManager.vaeLocation"),...s.getInputProps("vae")}),i.jsx(Qn,{label:o("modelManager.config"),...s.getInputProps("config")}),i.jsx(cn,{disabled:t,type:"submit",children:o("modelManager.updateModel")})]})})})]}):i.jsx(X,{sx:{width:"100%",justifyContent:"center",alignItems:"center",borderRadius:"base",bg:"base.900"},children:i.jsx(nt,{fontWeight:500,children:"Pick A Model To Edit"})})}const Cie=[{value:"sd-1",label:Ao["sd-1"]},{value:"sd-2",label:Ao["sd-2"]}],_ie=[{value:"normal",label:"Normal"},{value:"inpaint",label:"Inpaint"},{value:"depth",label:"Depth"}];function kie(e){const t=Y(c=>c.system.isProcessing),{retrievedModel:n,modelToEdit:r}=e;ce();const{t:o}=we(),s=uR({initialValues:{name:n.name,base_model:n.base_model,type:"main",path:n.path,description:n.description,model_format:"diffusers",vae:n.vae,variant:n.variant}}),a=c=>{console.log(c)};return r?i.jsxs(X,{flexDirection:"column",rowGap:4,width:"100%",children:[i.jsxs(X,{flexDirection:"column",children:[i.jsx(nt,{fontSize:"lg",fontWeight:"bold",children:n.name}),i.jsxs(nt,{fontSize:"sm",color:"base.400",children:[Ao[n.base_model]," Model"]})]}),i.jsx(ai,{}),i.jsx("form",{onSubmit:s.onSubmit(c=>a(c)),children:i.jsxs(X,{flexDirection:"column",overflowY:"scroll",gap:4,children:[i.jsx(Qn,{label:o("modelManager.name"),...s.getInputProps("name")}),i.jsx(Qn,{label:o("modelManager.description"),...s.getInputProps("description")}),i.jsx(Er,{label:o("modelManager.baseModel"),data:Cie,...s.getInputProps("base_model")}),i.jsx(Er,{label:o("modelManager.variant"),data:_ie,...s.getInputProps("variant")}),i.jsx(Qn,{label:o("modelManager.modelLocation"),...s.getInputProps("path")}),i.jsx(Qn,{label:o("modelManager.vaeLocation"),...s.getInputProps("vae")}),i.jsx(cn,{disabled:t,type:"submit",children:o("modelManager.updateModel")})]})})]}):i.jsx(X,{sx:{width:"100%",justifyContent:"center",alignItems:"center",borderRadius:"base",bg:"base.900"},children:i.jsx(nt,{fontWeight:"500",children:"Pick A Model To Edit"})})}function Jp(e){const{isProcessing:t,isConnected:n}=Y(m=>m.system),r=Y(m=>m.system.openModel),{t:o}=we(),s=ce(),{modelKey:a,name:c,description:d}=e,f=()=>{s(lS(a))},h=()=>{s(deleteModel(a)),s(lS(null))};return i.jsxs(X,{alignItems:"center",p:2,borderRadius:"base",sx:a===r?{bg:"accent.750",_hover:{bg:"accent.750"}}:{_hover:{bg:"base.750"}},children:[i.jsx(ut,{onClick:f,cursor:"pointer",children:i.jsx(Wn,{label:d,hasArrow:!0,placement:"bottom",children:i.jsx(nt,{fontWeight:"600",children:c})})}),i.jsx(ql,{onClick:f,cursor:"pointer"}),i.jsxs(X,{gap:2,alignItems:"center",children:[i.jsx(Ne,{icon:i.jsx(aU,{}),size:"sm",onClick:f,"aria-label":o("accessibility.modifyConfig"),isDisabled:status==="active"||t||!n}),i.jsx(s2,{title:o("modelManager.deleteModel"),acceptCallback:h,acceptButtonText:o("modelManager.delete"),triggerComponent:i.jsx(Ne,{icon:i.jsx(lU,{}),size:"sm","aria-label":o("modelManager.deleteConfig"),isDisabled:status==="active"||t||!n,colorScheme:"error"}),children:i.jsxs(X,{rowGap:4,flexDirection:"column",children:[i.jsx("p",{style:{fontWeight:"bold"},children:o("modelManager.deleteMsg1")}),i.jsx("p",{children:o("modelManager.deleteMsg2")})]})})]})]})}function p1({label:e,isActive:t,onClick:n}){return i.jsx(cn,{onClick:n,isActive:t,sx:{_active:{bg:"accent.750"}},size:"sm",children:e})}const Pie=()=>{const{data:e}=kf(),[t,n]=F.useState(!1);F.useEffect(()=>{const v=setTimeout(()=>{n(!0)},200);return()=>clearTimeout(v)},[]);const[r,o]=p.useState(""),[s,a]=p.useState("all"),[c,d]=p.useTransition(),{t:f}=we(),h=v=>{d(()=>{o(v.target.value)})},m=p.useMemo(()=>{const v=[],y=[],S=[],x=[];if(!e)return;const w=e.entities;return Object.keys(w).forEach((_,k)=>{var P,j;w[_].name.toLowerCase().includes(r.toLowerCase())&&(S.push(i.jsx(Jp,{modelKey:_,name:w[_].name,description:w[_].description},k)),((P=w[_])==null?void 0:P.model_format)===s&&x.push(i.jsx(Jp,{modelKey:_,name:w[_].name,description:w[_].description},k))),((j=w[_])==null?void 0:j.model_format)!=="diffusers"?v.push(i.jsx(Jp,{modelKey:_,name:w[_].name,description:w[_].description},k)):y.push(i.jsx(Jp,{modelKey:_,name:w[_].name,description:w[_].description},k))}),r!==""?s==="all"?i.jsx(ut,{marginTop:4,children:S}):i.jsx(ut,{marginTop:4,children:x}):i.jsxs(X,{flexDirection:"column",rowGap:6,children:[s==="all"&&i.jsxs(i.Fragment,{children:[i.jsxs(ut,{children:[i.jsx(nt,{sx:{fontWeight:"500",py:2,px:4,mb:4,borderRadius:"base",width:"max-content",fontSize:"sm",bg:"base.750"},children:f("modelManager.diffusersModels")}),y]}),i.jsxs(ut,{children:[i.jsx(nt,{sx:{fontWeight:"500",py:2,px:4,my:4,mx:0,borderRadius:"base",width:"max-content",fontSize:"sm",bg:"base.750"},children:f("modelManager.checkpointModels")}),v]})]}),s==="diffusers"&&i.jsx(X,{flexDirection:"column",marginTop:4,children:y}),s==="ckpt"&&i.jsx(X,{flexDirection:"column",marginTop:4,children:v})]})},[e,r,f,s]);return i.jsxs(X,{flexDirection:"column",rowGap:4,width:"50%",minWidth:"50%",children:[i.jsx(Qn,{onChange:h,label:f("modelManager.search")}),i.jsxs(X,{flexDirection:"column",gap:4,maxHeight:window.innerHeight-240,overflow:"scroll",paddingInlineEnd:4,children:[i.jsxs(X,{columnGap:2,children:[i.jsx(p1,{label:f("modelManager.allModels"),onClick:()=>a("all"),isActive:s==="all"}),i.jsx(p1,{label:f("modelManager.diffusersModels"),onClick:()=>a("diffusers"),isActive:s==="diffusers"}),i.jsx(p1,{label:f("modelManager.checkpointModels"),onClick:()=>a("ckpt"),isActive:s==="ckpt"})]}),t?m:i.jsx(X,{width:"100%",minHeight:96,justifyContent:"center",alignItems:"center",children:i.jsx(mu,{})})]})]})};function jie(){const{data:e}=kf(),t=Y(r=>r.system.openModel),n=()=>{if(!(!t||!e))return e.entities[t].model_format==="diffusers"?i.jsx(kie,{modelToEdit:t,retrievedModel:e.entities[t]},t):i.jsx(Sie,{modelToEdit:t,retrievedModel:e.entities[t]},t)};return i.jsxs(X,{width:"100%",columnGap:8,children:[i.jsx(Pie,{}),n()]})}const dR=[{id:"modelManager",label:Mr.t("modelManager.modelManager"),content:i.jsx(jie,{})},{id:"addModels",label:Mr.t("modelManager.addModel"),content:i.jsx(Uae,{})},{id:"mergeModels",label:Mr.t("modelManager.mergeModels"),content:i.jsx(qae,{})}],Eie=()=>{const e=[];return dR.forEach(t=>{e.push(i.jsx(Gb,{children:t.label},t.id))}),i.jsx(Vb,{sx:{w:"100%",color:"base.200",flexDirection:"row",borderBottomWidth:2,borderColor:"accent.700"},children:e})},Iie=()=>{const e=[];return dR.forEach(t=>{e.push(i.jsx(Wb,{children:t.content},t.id))}),i.jsx(Ub,{sx:{p:2},children:e})},Oie=()=>i.jsxs(Hb,{isLazy:!0,variant:"invokeAI",sx:{w:"full",h:"full",p:2,gap:4,flexDirection:"column"},children:[Eie(),Iie()]}),Tie=p.memo(Oie);const Rie={position:"absolute",width:"1rem",height:"1rem",borderWidth:0},Mie={left:"-1rem"},Die={right:"-0.5rem"},Aie=e=>{const{field:t,isValidConnection:n,handleType:r,styles:o}=e,{name:s,type:a}=t;return i.jsx(Wn,{label:a,placement:r==="target"?"start":"end",hasArrow:!0,openDelay:x3,children:i.jsx(CM,{type:r,id:s,isValidConnection:n,position:r==="target"?cS.Left:cS.Right,style:{backgroundColor:w3[a].colorCssVar,...o,...Rie,...r==="target"?Mie:Die}})})},fR=p.memo(Aie),pR=()=>{const e=tb();return p.useCallback(({source:n,sourceHandle:r,target:o,targetHandle:s})=>(e.getEdges(),e.getNodes(),!0),[e])};function Nie(e){const{nodeId:t,output:n,template:r,connected:o}=e,s=pR();return i.jsx(ut,{position:"relative",children:i.jsx(ar,{isDisabled:r?o:!0,paddingRight:3,children:r?i.jsxs(i.Fragment,{children:[i.jsx(hr,{textAlign:"end",padding:1,children:r==null?void 0:r.title}),i.jsx(fR,{nodeId:t,field:r,isValidConnection:s,handleType:"source"},n.id)]}):i.jsx(ya,{justifyContent:"space-between",alignItems:"center",children:i.jsxs(hr,{color:"error.400",children:["Unknown Output: ",n.name]})})})})}const zie=e=>{const{nodeId:t,template:n,outputs:r}=e,o=Y(a=>a.nodes.edges);return p.useCallback(()=>{const a=[];return Pa(r).forEach(d=>{const f=n.outputs[d.name],h=!!o.filter(m=>m.source===t&&m.sourceHandle===d.name).length;a.push(i.jsx(Nie,{nodeId:t,output:d,template:f,connected:h},d.id))}),i.jsx(X,{flexDir:"column",children:a})},[o,t,r,n.outputs])()},$ie=p.memo(zie),Lie=e=>i.jsx(GW,{}),Bie=p.memo(Lie),Fie=e=>{const{nodeId:t,field:n}=e,r=ce(),o=s=>{r(Xs({nodeId:t,fieldName:n.name,value:s.target.checked}))};return i.jsx(Fb,{onChange:o,isChecked:n.value})},Hie=p.memo(Fie),Vie=e=>null,Wie=p.memo(Vie);function iv(){return(iv=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 hR(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 Fy(e){var t=p.useRef(e),n=p.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var hu=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e<t?t:e},wd=function(e){return"touches"in e},Hy=function(e){return e&&e.ownerDocument.defaultView||self},PP=function(e,t,n){var r=e.getBoundingClientRect(),o=wd(t)?function(s,a){for(var c=0;c<s.length;c++)if(s[c].identifier===a)return s[c];return s[0]}(t.touches,n):t;return{left:hu((o.pageX-(r.left+Hy(e).pageXOffset))/r.width),top:hu((o.pageY-(r.top+Hy(e).pageYOffset))/r.height)}},jP=function(e){!wd(e)&&e.preventDefault()},a2=F.memo(function(e){var t=e.onMove,n=e.onKey,r=hR(e,["onMove","onKey"]),o=p.useRef(null),s=Fy(t),a=Fy(n),c=p.useRef(null),d=p.useRef(!1),f=p.useMemo(function(){var y=function(w){jP(w),(wd(w)?w.touches.length>0:w.buttons>0)&&o.current?s(PP(o.current,w,c.current)):x(!1)},S=function(){return x(!1)};function x(w){var _=d.current,k=Hy(o.current),P=w?k.addEventListener:k.removeEventListener;P(_?"touchmove":"mousemove",y),P(_?"touchend":"mouseup",S)}return[function(w){var _=w.nativeEvent,k=o.current;if(k&&(jP(_),!function(j,I){return I&&!wd(j)}(_,d.current)&&k)){if(wd(_)){d.current=!0;var P=_.changedTouches||[];P.length&&(c.current=P[0].identifier)}k.focus(),s(PP(k,_,c.current)),x(!0)}},function(w){var _=w.which||w.keyCode;_<37||_>40||(w.preventDefault(),a({left:_===39?.05:_===37?-.05:0,top:_===40?.05:_===38?-.05:0}))},x]},[a,s]),h=f[0],m=f[1],v=f[2];return p.useEffect(function(){return v},[v]),F.createElement("div",iv({},r,{onTouchStart:h,onMouseDown:h,className:"react-colorful__interactive",ref:o,onKeyDown:m,tabIndex:0,role:"slider"}))}),lv=function(e){return e.filter(Boolean).join(" ")},i2=function(e){var t=e.color,n=e.left,r=e.top,o=r===void 0?.5:r,s=lv(["react-colorful__pointer",e.className]);return F.createElement("div",{className:s,style:{top:100*o+"%",left:100*n+"%"}},F.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},bo=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},mR=function(e){var t=e.s,n=e.v,r=e.a,o=(200-t)*n/100;return{h:bo(e.h),s:bo(o>0&&o<200?t*n/100/(o<=100?o:200-o)*100:0),l:bo(o/2),a:bo(r,2)}},Vy=function(e){var t=mR(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},h1=function(e){var t=mR(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},Uie=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),a=r*(1-n),c=r*(1-(t-s)*n),d=r*(1-(1-t+s)*n),f=s%6;return{r:bo(255*[r,c,a,a,d,r][f]),g:bo(255*[d,r,r,c,a,a][f]),b:bo(255*[a,a,d,r,r,c][f]),a:bo(o,2)}},Gie=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,s=Math.max(t,n,r),a=s-Math.min(t,n,r),c=a?s===t?(n-r)/a:s===n?2+(r-t)/a:4+(t-n)/a:0;return{h:bo(60*(c<0?c+6:c)),s:bo(s?a/s*100:0),v:bo(s/255*100),a:o}},qie=F.memo(function(e){var t=e.hue,n=e.onChange,r=lv(["react-colorful__hue",e.className]);return F.createElement("div",{className:r},F.createElement(a2,{onMove:function(o){n({h:360*o.left})},onKey:function(o){n({h:hu(t+360*o.left,0,360)})},"aria-label":"Hue","aria-valuenow":bo(t),"aria-valuemax":"360","aria-valuemin":"0"},F.createElement(i2,{className:"react-colorful__hue-pointer",left:t/360,color:Vy({h:t,s:100,v:100,a:1})})))}),Yie=F.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:Vy({h:t.h,s:100,v:100,a:1})};return F.createElement("div",{className:"react-colorful__saturation",style:r},F.createElement(a2,{onMove:function(o){n({s:100*o.left,v:100-100*o.top})},onKey:function(o){n({s:hu(t.s+100*o.left,0,100),v:hu(t.v-100*o.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+bo(t.s)+"%, Brightness "+bo(t.v)+"%"},F.createElement(i2,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:Vy(t)})))}),gR=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function Kie(e,t,n){var r=Fy(n),o=p.useState(function(){return e.toHsva(t)}),s=o[0],a=o[1],c=p.useRef({color:t,hsva:s});p.useEffect(function(){if(!e.equal(t,c.current.color)){var f=e.toHsva(t);c.current={hsva:f,color:t},a(f)}},[t,e]),p.useEffect(function(){var f;gR(s,c.current.hsva)||e.equal(f=e.fromHsva(s),c.current.color)||(c.current={hsva:s,color:f},r(f))},[s,e,r]);var d=p.useCallback(function(f){a(function(h){return Object.assign({},h,f)})},[]);return[s,d]}var Xie=typeof window<"u"?p.useLayoutEffect:p.useEffect,Zie=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},EP=new Map,Qie=function(e){Xie(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!EP.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}`,EP.set(t,n);var r=Zie();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},Jie=function(e){var t=e.className,n=e.hsva,r=e.onChange,o={backgroundImage:"linear-gradient(90deg, "+h1(Object.assign({},n,{a:0}))+", "+h1(Object.assign({},n,{a:1}))+")"},s=lv(["react-colorful__alpha",t]),a=bo(100*n.a);return F.createElement("div",{className:s},F.createElement("div",{className:"react-colorful__alpha-gradient",style:o}),F.createElement(a2,{onMove:function(c){r({a:c.left})},onKey:function(c){r({a:hu(n.a+c.left)})},"aria-label":"Alpha","aria-valuetext":a+"%","aria-valuenow":a,"aria-valuemin":"0","aria-valuemax":"100"},F.createElement(i2,{className:"react-colorful__alpha-pointer",left:n.a,color:h1(n)})))},ele=function(e){var t=e.className,n=e.colorModel,r=e.color,o=r===void 0?n.defaultColor:r,s=e.onChange,a=hR(e,["className","colorModel","color","onChange"]),c=p.useRef(null);Qie(c);var d=Kie(n,o,s),f=d[0],h=d[1],m=lv(["react-colorful",t]);return F.createElement("div",iv({},a,{ref:c,className:m}),F.createElement(Yie,{hsva:f,onChange:h}),F.createElement(qie,{hue:f.h,onChange:h}),F.createElement(Jie,{hsva:f,onChange:h,className:"react-colorful__last-control"}))},tle={defaultColor:{r:0,g:0,b:0,a:1},toHsva:Gie,fromHsva:Uie,equal:gR},vR=function(e){return F.createElement(ele,iv({},e,{colorModel:tle}))};const nle=e=>{const{nodeId:t,field:n}=e,r=ce(),o=s=>{r(Xs({nodeId:t,fieldName:n.name,value:s}))};return i.jsx(vR,{className:"nodrag",color:n.value,onChange:o})},rle=p.memo(nle),ole=e=>null,sle=p.memo(ole),ale=e=>null,ile=p.memo(ale),lle=e=>{const{nodeId:t,field:n,template:r}=e,o=ce(),s=a=>{o(Xs({nodeId:t,fieldName:n.name,value:a.target.value}))};return i.jsx(Lb,{onChange:s,value:n.value,children:r.options.map(a=>i.jsx("option",{children:a},a))})},cle=p.memo(lle),ule=e=>{var f;const{nodeId:t,field:n}=e,r=ce();p.useCallback(({image_name:h})=>{r(Xs({nodeId:t,fieldName:n.name,value:_M([...n.value??[],{image_name:h}],"image_name")}))},[r,n.name,n.value,t]);const o={id:`node-${t}-${n.name}`,actionType:"SET_MULTI_NODES_IMAGE",context:{nodeId:t,fieldName:n.name}},{isOver:s,setNodeRef:a,active:c,over:d}=rf({id:`node_${t}`,data:o});return p.useCallback(()=>{r(Xs({nodeId:t,fieldName:n.name,value:void 0}))},[r,n.name,t]),i.jsxs(X,{ref:a,sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center",position:"relative",minH:"10rem"},children:[(f=n.value)==null?void 0:f.map(({image_name:h})=>i.jsx(fle,{imageName:h},h)),qc(o,c)&&i.jsx(eu,{isOver:s})]})},dle=p.memo(ule),fle=e=>{const{currentData:t}=xa(e.imageName);return i.jsx(Nl,{imageDTO:t,isDropDisabled:!0,isDragDisabled:!0})},ple=e=>{var v;const{nodeId:t,field:n}=e,r=ce(),{currentData:o,isLoading:s,isError:a,isSuccess:c}=xa(((v=n.value)==null?void 0:v.image_name)??Ja.skipToken),d=p.useCallback(()=>{r(Xs({nodeId:t,fieldName:n.name,value:void 0}))},[r,n.name,t]),f=p.useMemo(()=>{if(o)return{id:`node-${t}-${n.name}`,payloadType:"IMAGE_DTO",payload:{imageDTO:o}}},[n.name,o,t]),h=p.useMemo(()=>({id:`node-${t}-${n.name}`,actionType:"SET_NODES_IMAGE",context:{nodeId:t,fieldName:n.name}}),[n.name,t]),m=p.useMemo(()=>({type:"SET_NODES_IMAGE",nodeId:t,fieldName:n.name}),[t,n.name]);return i.jsx(X,{sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center"},children:i.jsx(Nl,{imageDTO:o,droppableData:h,draggableData:f,onClickReset:d,postUploadAction:m})})},hle=p.memo(ple),mle=e=>i.jsx(PW,{}),IP=p.memo(mle),gle=e=>null,vle=p.memo(gle),yle=e=>{const{nodeId:t,field:n}=e,r=ce();we();const{data:o}=XT(),s=p.useMemo(()=>o==null?void 0:o.entities[n.value??o.ids[0]],[o==null?void 0:o.entities,o==null?void 0:o.ids,n.value]),a=p.useMemo(()=>{if(!o)return[];const d=[];return Ul(o.entities,(f,h)=>{f&&d.push({value:h,label:f.name,group:Ao[f.base_model]})}),d},[o]),c=p.useCallback(d=>{d&&r(Xs({nodeId:t,fieldName:n.name,value:d}))},[r,n.name,t]);return p.useEffect(()=>{if(n.value&&(o!=null&&o.ids.includes(n.value)))return;const d=o==null?void 0:o.ids[0];Jm(d)&&c(d)},[n.value,c,o==null?void 0:o.ids]),i.jsx(Er,{tooltip:s==null?void 0:s.description,label:(s==null?void 0:s.base_model)&&Ao[s==null?void 0:s.base_model],value:n.value,placeholder:"Pick one",data:a,onChange:c})},ble=p.memo(yle),xle=e=>{const{nodeId:t,field:n}=e,r=ce();we();const{data:o}=kf(),s=p.useMemo(()=>{if(!o)return[];const d=[];return Ul(o.entities,(f,h)=>{f&&d.push({value:h,label:f.name,group:Ao[f.base_model]})}),d},[o]),a=p.useMemo(()=>o==null?void 0:o.entities[n.value??o.ids[0]],[o==null?void 0:o.entities,o==null?void 0:o.ids,n.value]),c=p.useCallback(d=>{d&&r(Xs({nodeId:t,fieldName:n.name,value:d}))},[r,n.name,t]);return p.useEffect(()=>{if(n.value&&(o!=null&&o.ids.includes(n.value)))return;const d=o==null?void 0:o.ids[0];Jm(d)&&c(d)},[n.value,c,o==null?void 0:o.ids]),i.jsx(Er,{tooltip:a==null?void 0:a.description,label:(a==null?void 0:a.base_model)&&Ao[a==null?void 0:a.base_model],value:n.value,placeholder:"Pick one",data:s,onChange:c})},wle=p.memo(xle),Sle=e=>{const{nodeId:t,field:n}=e,r=ce(),o=(s,a)=>{r(Xs({nodeId:t,fieldName:n.name,value:a}))};return i.jsxs(vg,{onChange:o,value:n.value,step:e.template.type==="integer"?1:.1,precision:e.template.type==="integer"?0:3,children:[i.jsx(bg,{}),i.jsxs(yg,{children:[i.jsx(wg,{}),i.jsx(xg,{})]})]})},Cle=p.memo(Sle),_le=e=>{const{nodeId:t,field:n}=e,r=ce(),o=s=>{r(Xs({nodeId:t,fieldName:n.name,value:s.target.value}))};return i.jsx(df,{onChange:o,value:n.value})},kle=p.memo(_le),Ple=e=>null,jle=p.memo(Ple),Ele=e=>null,Ile=p.memo(Ele),Ole=e=>{const{nodeId:t,field:n}=e,r=ce();we();const{data:o}=ZT(),s=p.useMemo(()=>o==null?void 0:o.entities[n.value??o.ids[0]],[o==null?void 0:o.entities,o==null?void 0:o.ids,n.value]),a=p.useMemo(()=>{if(!o)return[];const d=[];return Ul(o.entities,(f,h)=>{f&&d.push({value:h,label:f.name,group:Ao[f.base_model]})}),d},[o]),c=p.useCallback(d=>{d&&r(Xs({nodeId:t,fieldName:n.name,value:d}))},[r,n.name,t]);return p.useEffect(()=>{n.value&&(o!=null&&o.ids.includes(n.value))||c("auto")},[n.value,c,o==null?void 0:o.ids]),i.jsx(Er,{tooltip:s==null?void 0:s.description,label:(s==null?void 0:s.base_model)&&Ao[s==null?void 0:s.base_model],value:n.value,placeholder:"Pick one",data:a,onChange:c})},Tle=p.memo(Ole),Rle=e=>{const{nodeId:t,field:n,template:r}=e,{type:o}=n;return o==="string"&&r.type==="string"?i.jsx(kle,{nodeId:t,field:n,template:r}):o==="boolean"&&r.type==="boolean"?i.jsx(Hie,{nodeId:t,field:n,template:r}):o==="integer"&&r.type==="integer"||o==="float"&&r.type==="float"?i.jsx(Cle,{nodeId:t,field:n,template:r}):o==="enum"&&r.type==="enum"?i.jsx(cle,{nodeId:t,field:n,template:r}):o==="image"&&r.type==="image"?i.jsx(hle,{nodeId:t,field:n,template:r}):o==="latents"&&r.type==="latents"?i.jsx(vle,{nodeId:t,field:n,template:r}):o==="conditioning"&&r.type==="conditioning"?i.jsx(sle,{nodeId:t,field:n,template:r}):o==="unet"&&r.type==="unet"?i.jsx(jle,{nodeId:t,field:n,template:r}):o==="clip"&&r.type==="clip"?i.jsx(Wie,{nodeId:t,field:n,template:r}):o==="vae"&&r.type==="vae"?i.jsx(Ile,{nodeId:t,field:n,template:r}):o==="control"&&r.type==="control"?i.jsx(ile,{nodeId:t,field:n,template:r}):o==="model"&&r.type==="model"?i.jsx(wle,{nodeId:t,field:n,template:r}):o==="vae_model"&&r.type==="vae_model"?i.jsx(Tle,{nodeId:t,field:n,template:r}):o==="lora_model"&&r.type==="lora_model"?i.jsx(ble,{nodeId:t,field:n,template:r}):o==="array"&&r.type==="array"?i.jsx(Bie,{nodeId:t,field:n,template:r}):o==="item"&&r.type==="item"?i.jsx(IP,{nodeId:t,field:n,template:r}):o==="color"&&r.type==="color"?i.jsx(rle,{nodeId:t,field:n,template:r}):o==="item"&&r.type==="item"?i.jsx(IP,{nodeId:t,field:n,template:r}):o==="image_collection"&&r.type==="image_collection"?i.jsx(dle,{nodeId:t,field:n,template:r}):i.jsxs(ut,{p:2,children:["Unknown field type: ",o]})},Mle=p.memo(Rle);function Dle(e){const{nodeId:t,input:n,template:r,connected:o}=e,s=pR();return i.jsx(ut,{position:"relative",borderColor:r?!o&&["always","connectionOnly"].includes(String(r==null?void 0:r.inputRequirement))&&n.value===void 0?"warning.400":void 0:"error.400",children:i.jsx(ar,{isDisabled:r?o:!0,pl:2,children:r?i.jsxs(i.Fragment,{children:[i.jsxs(ya,{justifyContent:"space-between",alignItems:"center",children:[i.jsx(ya,{children:i.jsx(Wn,{label:r==null?void 0:r.description,placement:"top",hasArrow:!0,shouldWrapChildren:!0,openDelay:x3,children:i.jsx(hr,{children:r==null?void 0:r.title})})}),i.jsx(Mle,{nodeId:t,field:n,template:r})]}),!["never","directOnly"].includes((r==null?void 0:r.inputRequirement)??"")&&i.jsx(fR,{nodeId:t,field:r,isValidConnection:s,handleType:"target"})]}):i.jsx(ya,{justifyContent:"space-between",alignItems:"center",children:i.jsxs(hr,{children:["Unknown input: ",n.name]})})})})}const Ale=e=>{const{nodeId:t,template:n,inputs:r}=e,o=Y(a=>a.nodes.edges);return p.useCallback(()=>{const a=[],c=Pa(r);return c.forEach((d,f)=>{const h=n.inputs[d.name],m=!!o.filter(v=>v.target===t&&v.targetHandle===d.name).length;f<c.length&&a.push(i.jsx(ai,{},`${d.id}.divider`)),a.push(i.jsx(Dle,{nodeId:t,input:d,template:h,connected:m},d.id))}),i.jsx(X,{flexDir:"column",gap:2,p:2,children:a})},[o,r,t,n.inputs])()},Nle=p.memo(Ale),zle=e=>{const{nodeId:t,template:n}=e;return i.jsxs(X,{sx:{borderTopRadius:"md",alignItems:"center",justifyContent:"space-between",px:2,py:1,bg:"base.300",_dark:{bg:"base.700"}},children:[i.jsx(Wn,{label:t,children:i.jsx($a,{size:"xs",sx:{fontWeight:600,color:"base.900",_dark:{color:"base.100"}},children:n.title})}),i.jsx(Wn,{label:n.description,placement:"top",hasArrow:!0,shouldWrapChildren:!0,children:i.jsx(io,{sx:{h:"min-content",color:"base.700",_dark:{color:"base.300"}},as:WW})})]})},$le=p.memo(zle),Lle=e=>{const{...t}=e;return i.jsx(hD,{style:{position:"absolute",border:"none",background:"transparent",width:15,height:15,bottom:0,right:0},minWidth:S3,...t})},OP=p.memo(Lle),TP=e=>{const[t,n]=Wl("shadows",["nodeSelectedOutline","dark-lg"]);return i.jsx(ut,{sx:{position:"relative",borderRadius:"md",minWidth:S3,shadow:e.selected?`${t}, ${n}`:`${n}`},children:e.children})},Ble=e=>Oe([t=>t.nodes],t=>{const n=t.invocationTemplates[e];if(n)return n},{memoizeOptions:{resultEqualityCheck:(t,n)=>t!==void 0&&n!==void 0&&t.type===n.type}}),yR=p.memo(e=>{const{id:t,data:n,selected:r}=e,{type:o,inputs:s,outputs:a}=n,c=p.useMemo(()=>Ble(o),[o]),d=Y(c);return d?i.jsxs(TP,{selected:r,children:[i.jsx($le,{nodeId:t,template:d}),i.jsxs(X,{sx:{flexDirection:"column",borderBottomRadius:"md",py:2,bg:"base.200",_dark:{bg:"base.800"}},children:[i.jsx($ie,{nodeId:t,outputs:a,template:d}),i.jsx(Nle,{nodeId:t,inputs:s,template:d})]}),i.jsx(OP,{})]}):i.jsx(TP,{selected:r,children:i.jsxs(X,{sx:{alignItems:"center",justifyContent:"center"},children:[i.jsx(io,{as:NW,sx:{boxSize:32,color:"base.600",_dark:{color:"base.400"}}}),i.jsx(OP,{})]})})});yR.displayName="InvocationComponent";const Fle=(e,t)=>{const n={id:e,name:t.name,type:t.type};return t.inputRequirement!=="never"&&(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==="array"&&(n.value=t.default??1),t.type==="image"&&(n.value=void 0),t.type==="image_collection"&&(n.value=[]),t.type==="latents"&&(n.value=void 0),t.type==="conditioning"&&(n.value=void 0),t.type==="unet"&&(n.value=void 0),t.type==="clip"&&(n.value=void 0),t.type==="vae"&&(n.value=void 0),t.type==="control"&&(n.value=void 0),t.type==="model"&&(n.value=void 0),t.type==="vae_model"&&(n.value=void 0),t.type==="lora_model"&&(n.value=void 0)),n},Hle=Oe([e=>e.nodes],e=>e.invocationTemplates),Vle=()=>{const e=Y(Hle),t=tb();return p.useCallback(n=>{const r=e[n];if(r===void 0){console.error(`Unable to find template ${n}.`);return}const o=yl(),s=uS(r.inputs,(h,m,v)=>{const y=yl(),S=Fle(y,m);return h[v]=S,h},{}),a=uS(r.outputs,(h,m,v)=>{const S={id:yl(),name:v,type:m.type};return h[v]=S,h},{}),{x:c,y:d}=t.project({x:window.innerWidth/2.5,y:window.innerHeight/8});return{id:o,type:"invocation",position:{x:c,y:d},data:{id:o,type:n,inputs:s,outputs:a}}},[e,t])},Wle=Oe(kM,e=>({data:Pa(e.invocationTemplates,n=>({label:n.title,value:n.type,description:n.description}))}),Lt),Ule=()=>{const e=ce(),{data:t}=Y(Wle),n=Vle(),r=nf(),o=p.useCallback(s=>{const a=n(s);if(!a){r({status:"error",title:`Unknown Invocation type ${s}`});return}e(PM(a))},[e,n,r]);return i.jsx(X,{sx:{gap:2,alignItems:"center"},children:i.jsx($x,{selectOnBlur:!1,placeholder:"Add Node",value:[],data:t,maxDropdownHeight:400,nothingFound:"No matching nodes",itemComponent:bR,filter:(s,a,c)=>c.label.toLowerCase().includes(s.toLowerCase().trim())||c.value.toLowerCase().includes(s.toLowerCase().trim())||c.description.toLowerCase().includes(s.toLowerCase().trim()),onChange:s=>{s[0]&&o(s[0])},sx:{width:"18rem"}})})},bR=p.forwardRef(({label:e,description:t,...n},r)=>i.jsx("div",{ref:r,...n,children:i.jsxs("div",{children:[i.jsx(nt,{children:e}),i.jsx(nt,{size:"xs",color:"base.600",children:t})]})}));bR.displayName="SelectItem";const Gle=()=>i.jsx(ef,{position:"top-left",children:i.jsx(Ule,{})}),qle=p.memo(Gle),Yle=()=>i.jsx(X,{sx:{gap:2,flexDir:"column"},children:Pa(w3,({title:e,description:t,color:n},r)=>i.jsx(Wn,{label:t,children:i.jsx(Kc,{colorScheme:n,sx:{userSelect:"none"},textAlign:"center",children:e})},r))}),Kle=p.memo(Yle),Xle=()=>{const e=Y(n=>n),t=jM(e);return i.jsx(ut,{as:"pre",sx:{fontFamily:"monospace",position:"absolute",top:2,right:2,opacity:.7,p:2,maxHeight:500,maxWidth:500,overflowY:"scroll",borderRadius:"base",bg:"base.200",_dark:{bg:"base.800"}},children:JSON.stringify(t,null,2)})},Zle=p.memo(Xle),Qle=()=>{const e=Y(t=>t.nodes.shouldShowGraphOverlay);return i.jsxs(ef,{position:"top-right",children:[i.jsx(Kle,{}),e&&i.jsx(Zle,{})]})},Jle=p.memo(Qle);function ece(e){const{iconButton:t=!1,...n}=e,r=ce(),o=Y(Gr),s=eo(),a=p.useCallback(()=>{r(eb("nodes"))},[r]),{t:c}=we();return et(["ctrl+enter","meta+enter"],a,{enabled:()=>s,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[s,o]),i.jsx(ut,{style:{flexGrow:4},position:"relative",children:i.jsxs(ut,{style:{position:"relative"},children:[!s&&i.jsx(ut,{borderRadius:"base",style:{position:"absolute",bottom:"0",left:"0",right:"0",height:"100%",overflow:"clip"},children:i.jsx(nR,{})}),t?i.jsx(Ne,{"aria-label":c("parameters.invoke"),type:"submit",icon:i.jsx(CE,{}),isDisabled:!s,onClick:a,flexGrow:1,w:"100%",tooltip:c("parameters.invoke"),tooltipProps:{placement:"bottom"},colorScheme:"accent",id:"invoke-button",_disabled:{background:"none",_hover:{background:"none"}},...n}):i.jsx(cn,{"aria-label":c("parameters.invoke"),type:"submit",isDisabled:!s,onClick:a,flexGrow:1,w:"100%",colorScheme:"accent",id:"invoke-button",fontWeight:700,_disabled:{background:"none",_hover:{background:"none"}},...n,children:"Invoke"})]})})}const tce=()=>{const e=ce(),t=p.useCallback(()=>{e(EM())},[e]);return i.jsx(ef,{position:"top-center",children:i.jsxs(ya,{children:[i.jsx(ece,{}),i.jsx(cn,{onClick:t,children:"Reload Schema"})]})})},nce=p.memo(tce),rce=()=>{const{zoomIn:e,zoomOut:t,fitView:n}=tb(),r=ce(),o=Y(f=>f.nodes.shouldShowGraphOverlay),s=p.useCallback(()=>{e()},[e]),a=p.useCallback(()=>{t()},[t]),c=p.useCallback(()=>{n()},[n]),d=p.useCallback(()=>{r(IM(!o))},[o,r]);return i.jsxs(Or,{isAttached:!0,orientation:"vertical",children:[i.jsx(Ne,{onClick:s,"aria-label":"Zoom In",icon:i.jsx(Ag,{})}),i.jsx(Ne,{onClick:a,"aria-label":"Zoom Out",icon:i.jsx(YW,{})}),i.jsx(Ne,{onClick:c,"aria-label":"Fit to Viewport",icon:i.jsx(dx,{})}),i.jsx(Ne,{isChecked:o,onClick:d,"aria-label":"Show/Hide Graph",icon:i.jsx(gE,{})})]})},oce=p.memo(rce),sce=()=>i.jsx(ef,{position:"bottom-left",children:i.jsx(oce,{})}),ace=p.memo(sce),ice=()=>{const e=eh({background:"var(--invokeai-colors-base-200)"},{background:"var(--invokeai-colors-base-500)"}),t=eh("var(--invokeai-colors-accent-300)","var(--invokeai-colors-accent-700)"),n=eh("var(--invokeai-colors-blackAlpha-300)","var(--invokeai-colors-blackAlpha-600)");return i.jsx(oD,{nodeStrokeWidth:3,pannable:!0,zoomable:!0,nodeBorderRadius:30,style:e,nodeColor:t,maskColor:n})},lce=p.memo(ice),cce={invocation:yR},uce=()=>{const e=ce(),t=Y(d=>d.nodes.nodes),n=Y(d=>d.nodes.edges),r=p.useCallback(d=>{e(OM(d))},[e]),o=p.useCallback(d=>{e(TM(d))},[e]),s=p.useCallback((d,f)=>{e(RM(f))},[e]),a=p.useCallback(d=>{e(MM(d))},[e]),c=p.useCallback(()=>{e(DM())},[e]);return i.jsxs(AM,{nodeTypes:cce,nodes:t,edges:n,onNodesChange:r,onEdgesChange:o,onConnectStart:s,onConnect:a,onConnectEnd:c,defaultEdgeOptions:{style:{strokeWidth:2}},children:[i.jsx(qle,{}),i.jsx(nce,{}),i.jsx(Jle,{}),i.jsx(ace,{}),i.jsx(uD,{}),i.jsx(lce,{})]})},dce=()=>i.jsx(ut,{layerStyle:"first",sx:{position:"relative",width:"full",height:"full",borderRadius:"base"},children:i.jsx(NM,{children:i.jsx(uce,{})})}),fce=p.memo(dce),pce=()=>i.jsx(fce,{}),hce=p.memo(pce),mce=e=>e.postprocessing,gce=Oe([mce],({hiresFix:e,hiresStrength:t})=>({hiresFix:e,hiresStrength:t}),{memoizeOptions:{resultEqualityCheck:en}}),vce=()=>{const{hiresFix:e,hiresStrength:t}=Y(gce),n=ce(),{t:r}=we(),o=a=>{n(dS(a))},s=()=>{n(dS(.75))};return i.jsx(Et,{label:r("parameters.hiresStrength"),step:.01,min:.01,max:.99,onChange:o,value:t,isInteger:!1,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:s,isDisabled:!e})},yce=()=>{const e=ce(),t=Y(o=>o.postprocessing.hiresFix),{t:n}=we(),r=o=>e(zM(o.target.checked));return i.jsx(Zn,{label:n("parameters.hiresOptim"),isChecked:t,onChange:r})},bce=Oe(Bn,e=>({activeLabel:e.postprocessing.hiresFix?"Enabled":void 0}),Lt),xce=()=>{const{t:e}=we(),{activeLabel:t}=Y(bce);return Jr("hires").isFeatureEnabled?i.jsx(Qo,{label:e("parameters.hiresOptim"),activeLabel:t,children:i.jsxs(X,{sx:{gap:2,flexDirection:"column"},children:[i.jsx(yce,{}),i.jsx(vce,{})]})}):null},wce=p.memo(xce),Sce=Oe(Bn,({ui:e,generation:t})=>{const{shouldUseSliders:n}=e,{shouldRandomizeSeed:r}=t;return{shouldUseSliders:n,activeLabel:r?void 0:"Manual Seed"}},Lt),Cce=()=>{const{shouldUseSliders:e,activeLabel:t}=Y(Sce);return i.jsx(Qo,{label:"General",activeLabel:t,defaultIsOpen:!0,children:i.jsx(X,{sx:{flexDirection:"column",gap:3},children:e?i.jsxs(i.Fragment,{children:[i.jsx(du,{}),i.jsx(ut,{pt:2,children:i.jsx(pu,{})}),i.jsx(uu,{}),i.jsx(fu,{}),i.jsx(cu,{}),i.jsx(qm,{}),i.jsx(Gm,{})]}):i.jsxs(i.Fragment,{children:[i.jsxs(X,{gap:3,children:[i.jsx(uu,{}),i.jsx(fu,{}),i.jsx(cu,{})]}),i.jsx(du,{}),i.jsx(n2,{}),i.jsx(ut,{pt:2,children:i.jsx(pu,{})}),i.jsx(qm,{}),i.jsx(Gm,{})]})})})},_ce=p.memo(Cce),kce=()=>i.jsxs(i.Fragment,{children:[i.jsx(Xx,{}),i.jsx(Kx,{}),i.jsx(t2,{}),i.jsx(_ce,{}),i.jsx(Ux,{}),i.jsx(Wx,{}),i.jsx(qx,{}),i.jsx(Qx,{}),i.jsx(eR,{}),i.jsx(Zx,{}),i.jsx(wce,{}),i.jsx(tR,{})]}),xR=p.memo(kce),Pce=()=>i.jsxs(X,{sx:{gap:4,w:"full",h:"full"},children:[i.jsx(Vx,{children:i.jsx(xR,{})}),i.jsx(KT,{})]}),jce=p.memo(Pce);var Wy={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Konva=void 0;var n=fS;Object.defineProperty(t,"Konva",{enumerable:!0,get:function(){return n.Konva}});const r=fS;e.exports=r.Konva})(Wy,Wy.exports);var Ece=Wy.exports;const Jd=gu(Ece);var wR={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 Ice=function(t){var n={},r=p,o=rh,s=Object.assign;function a(l){for(var u="https://reactjs.org/docs/error-decoder.html?invariant="+l,g=1;g<arguments.length;g++)u+="&args[]="+encodeURIComponent(arguments[g]);return"Minified React error #"+l+"; visit "+u+" 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,d=Symbol.for("react.element"),f=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),y=Symbol.for("react.provider"),S=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),k=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),j=Symbol.for("react.offscreen"),I=Symbol.iterator;function O(l){return l===null||typeof l!="object"?null:(l=I&&l[I]||l["@@iterator"],typeof l=="function"?l:null)}function T(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 f:return"Portal";case v:return"Profiler";case m:return"StrictMode";case w:return"Suspense";case _:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case S:return(l.displayName||"Context")+".Consumer";case y:return(l._context.displayName||"Context")+".Provider";case x:var u=l.render;return l=l.displayName,l||(l=u.displayName||u.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case k:return u=l.displayName||null,u!==null?u:T(l.type)||"Memo";case P:u=l._payload,l=l._init;try{return T(l(u))}catch{}}return null}function R(l){var u=l.type;switch(l.tag){case 24:return"Cache";case 9:return(u.displayName||"Context")+".Consumer";case 10:return(u._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return l=u.render,l=l.displayName||l.name||"",u.displayName||(l!==""?"ForwardRef("+l+")":"ForwardRef");case 7:return"Fragment";case 5:return u;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return T(u);case 8:return u===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 u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u}return null}function M(l){var u=l,g=l;if(l.alternate)for(;u.return;)u=u.return;else{l=u;do u=l,u.flags&4098&&(g=u.return),l=u.return;while(l)}return u.tag===3?g:null}function D(l){if(M(l)!==l)throw Error(a(188))}function A(l){var u=l.alternate;if(!u){if(u=M(l),u===null)throw Error(a(188));return u!==l?null:l}for(var g=l,b=u;;){var C=g.return;if(C===null)break;var E=C.alternate;if(E===null){if(b=C.return,b!==null){g=b;continue}break}if(C.child===E.child){for(E=C.child;E;){if(E===g)return D(C),l;if(E===b)return D(C),u;E=E.sibling}throw Error(a(188))}if(g.return!==b.return)g=C,b=E;else{for(var N=!1,Q=C.child;Q;){if(Q===g){N=!0,g=C,b=E;break}if(Q===b){N=!0,b=C,g=E;break}Q=Q.sibling}if(!N){for(Q=E.child;Q;){if(Q===g){N=!0,g=E,b=C;break}if(Q===b){N=!0,b=E,g=C;break}Q=Q.sibling}if(!N)throw Error(a(189))}}if(g.alternate!==b)throw Error(a(190))}if(g.tag!==3)throw Error(a(188));return g.stateNode.current===g?l:u}function G(l){return l=A(l),l!==null?$(l):null}function $(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){var u=$(l);if(u!==null)return u;l=l.sibling}return null}function H(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){if(l.tag!==4){var u=H(l);if(u!==null)return u}l=l.sibling}return null}var U=Array.isArray,q=t.getPublicInstance,z=t.getRootHostContext,L=t.getChildHostContext,V=t.prepareForCommit,W=t.resetAfterCommit,te=t.createInstance,fe=t.appendInitialChild,ae=t.finalizeInitialChildren,J=t.prepareUpdate,B=t.shouldSetTextContent,oe=t.createTextInstance,le=t.scheduleTimeout,ge=t.cancelTimeout,se=t.noTimeout,pe=t.isPrimaryRenderer,ue=t.supportsMutation,be=t.supportsPersistence,ke=t.supportsHydration,ie=t.getInstanceFromNode,Pe=t.preparePortalMount,Je=t.getCurrentEventPriority,Ae=t.detachDeletedInstance,Ve=t.supportsMicrotasks,kt=t.scheduleMicrotask,ft=t.supportsTestSelectors,yn=t.findFiberRoot,K=t.getBoundingRect,Ce=t.getTextContent,ne=t.isHiddenSubtree,me=t.matchAccessibilityRole,Re=t.setFocusIfFocusable,Ye=t.setupIntersectionObserver,ye=t.appendChild,lt=t.appendChildToContainer,It=t.commitTextUpdate,Xt=t.commitMount,$e=t.commitUpdate,Ke=t.insertBefore,Cn=t.insertInContainerBefore,Ee=t.removeChild,qe=t.removeChildFromContainer,pt=t.resetTextContent,gt=t.hideInstance,Ht=t.hideTextInstance,yr=t.unhideInstance,hn=t.unhideTextInstance,mn=t.clearContainer,Tr=t.cloneInstance,$n=t.createContainerChildSet,Fn=t.appendChildToContainerChildSet,Es=t.finalizeContainerChildren,_n=t.replaceContainerChildren,Jo=t.cloneHiddenInstance,es=t.cloneHiddenTextInstance,er=t.canHydrateInstance,Is=t.canHydrateTextInstance,ci=t.canHydrateSuspenseInstance,$r=t.isSuspenseInstancePending,ts=t.isSuspenseInstanceFallback,Oa=t.getSuspenseInstanceFallbackErrorDetails,ui=t.registerSuspenseInstanceRetry,Os=t.getNextHydratableSibling,Z=t.getFirstHydratableChild,ee=t.getFirstHydratableChildWithinContainer,ve=t.getFirstHydratableChildWithinSuspenseInstance,Se=t.hydrateInstance,_e=t.hydrateTextInstance,rt=t.hydrateSuspenseInstance,St=t.getNextHydratableInstanceAfterSuspenseInstance,Gt=t.commitHydratedContainer,yt=t.commitHydratedSuspenseInstance,Xe=t.clearSuspenseBoundary,tt=t.clearSuspenseBoundaryFromContainer,je=t.shouldDeleteUnhydratedTailInstances,Ze=t.didNotMatchHydratedContainerTextInstance,Ot=t.didNotMatchHydratedTextInstance,Rt;function $t(l){if(Rt===void 0)try{throw Error()}catch(g){var u=g.stack.trim().match(/\n( *(at )?)/);Rt=u&&u[1]||""}return`
`+Rt+l}var Yt=!1;function nn(l,u){if(!l||Yt)return"";Yt=!0;var g=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(u)if(u=function(){throw Error()},Object.defineProperty(u.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(u,[])}catch(Be){var b=Be}Reflect.construct(l,[],u)}else{try{u.call()}catch(Be){b=Be}l.call(u.prototype)}else{try{throw Error()}catch(Be){b=Be}l()}}catch(Be){if(Be&&b&&typeof Be.stack=="string"){for(var C=Be.stack.split(`
`),E=b.stack.split(`
`),N=C.length-1,Q=E.length-1;1<=N&&0<=Q&&C[N]!==E[Q];)Q--;for(;1<=N&&0<=Q;N--,Q--)if(C[N]!==E[Q]){if(N!==1||Q!==1)do if(N--,Q--,0>Q||C[N]!==E[Q]){var he=`
`+C[N].replace(" at new "," at ");return l.displayName&&he.includes("<anonymous>")&&(he=he.replace("<anonymous>",l.displayName)),he}while(1<=N&&0<=Q);break}}}finally{Yt=!1,Error.prepareStackTrace=g}return(l=l?l.displayName||l.name:"")?$t(l):""}var Kt=Object.prototype.hasOwnProperty,Me=[],Ct=-1;function Bt(l){return{current:l}}function Ft(l){0>Ct||(l.current=Me[Ct],Me[Ct]=null,Ct--)}function qt(l,u){Ct++,Me[Ct]=l.current,l.current=u}var kn={},tn=Bt(kn),dn=Bt(!1),Nn=kn;function Lr(l,u){var g=l.type.contextTypes;if(!g)return kn;var b=l.stateNode;if(b&&b.__reactInternalMemoizedUnmaskedChildContext===u)return b.__reactInternalMemoizedMaskedChildContext;var C={},E;for(E in g)C[E]=u[E];return b&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=u,l.__reactInternalMemoizedMaskedChildContext=C),C}function ir(l){return l=l.childContextTypes,l!=null}function Tt(){Ft(dn),Ft(tn)}function Dn(l,u,g){if(tn.current!==kn)throw Error(a(168));qt(tn,u),qt(dn,g)}function Ln(l,u,g){var b=l.stateNode;if(u=u.childContextTypes,typeof b.getChildContext!="function")return g;b=b.getChildContext();for(var C in b)if(!(C in u))throw Error(a(108,R(l)||"Unknown",C));return s({},g,b)}function lr(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||kn,Nn=tn.current,qt(tn,l),qt(dn,dn.current),!0}function _r(l,u,g){var b=l.stateNode;if(!b)throw Error(a(169));g?(l=Ln(l,u,Nn),b.__reactInternalMemoizedMergedChildContext=l,Ft(dn),Ft(tn),qt(tn,l)):Ft(dn),qt(dn,g)}var Un=Math.clz32?Math.clz32:In,Gn=Math.log,bn=Math.LN2;function In(l){return l>>>=0,l===0?32:31-(Gn(l)/bn|0)|0}var An=64,Pn=4194304;function jn(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 Qe(l,u){var g=l.pendingLanes;if(g===0)return 0;var b=0,C=l.suspendedLanes,E=l.pingedLanes,N=g&268435455;if(N!==0){var Q=N&~C;Q!==0?b=jn(Q):(E&=N,E!==0&&(b=jn(E)))}else N=g&~C,N!==0?b=jn(N):E!==0&&(b=jn(E));if(b===0)return 0;if(u!==0&&u!==b&&!(u&C)&&(C=b&-b,E=u&-u,C>=E||C===16&&(E&4194240)!==0))return u;if(b&4&&(b|=g&16),u=l.entangledLanes,u!==0)for(l=l.entanglements,u&=b;0<u;)g=31-Un(u),C=1<<g,b|=l[g],u&=~C;return b}function Mt(l,u){switch(l){case 1:case 2:case 4:return u+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 u+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 Pt(l,u){for(var g=l.suspendedLanes,b=l.pingedLanes,C=l.expirationTimes,E=l.pendingLanes;0<E;){var N=31-Un(E),Q=1<<N,he=C[N];he===-1?(!(Q&g)||Q&b)&&(C[N]=Mt(Q,u)):he<=u&&(l.expiredLanes|=Q),E&=~Q}}function ct(l){return l=l.pendingLanes&-1073741825,l!==0?l:l&1073741824?1073741824:0}function _t(){var l=An;return An<<=1,!(An&4194240)&&(An=64),l}function Vt(l){for(var u=[],g=0;31>g;g++)u.push(l);return u}function xt(l,u,g){l.pendingLanes|=u,u!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,u=31-Un(u),l[u]=g}function at(l,u){var g=l.pendingLanes&~u;l.pendingLanes=u,l.suspendedLanes=0,l.pingedLanes=0,l.expiredLanes&=u,l.mutableReadLanes&=u,l.entangledLanes&=u,u=l.entanglements;var b=l.eventTimes;for(l=l.expirationTimes;0<g;){var C=31-Un(g),E=1<<C;u[C]=0,b[C]=-1,l[C]=-1,g&=~E}}function De(l,u){var g=l.entangledLanes|=u;for(l=l.entanglements;g;){var b=31-Un(g),C=1<<b;C&u|l[b]&u&&(l[b]|=u),g&=~C}}var Te=0;function Le(l){return l&=-l,1<l?4<l?l&268435455?16:536870912:4:1}var We=o.unstable_scheduleCallback,ot=o.unstable_cancelCallback,At=o.unstable_shouldYield,Dt=o.unstable_requestPaint,Ue=o.unstable_now,rn=o.unstable_ImmediatePriority,En=o.unstable_UserBlockingPriority,wn=o.unstable_NormalPriority,kr=o.unstable_IdlePriority,nr=null,Sn=null;function tr(l){if(Sn&&typeof Sn.onCommitFiberRoot=="function")try{Sn.onCommitFiberRoot(nr,l,void 0,(l.current.flags&128)===128)}catch{}}function fo(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var xn=typeof Object.is=="function"?Object.is:fo,qn=null,Xr=!1,Br=!1;function di(l){qn===null?qn=[l]:qn.push(l)}function Pf(l){Xr=!0,di(l)}function Bo(){if(!Br&&qn!==null){Br=!0;var l=0,u=Te;try{var g=qn;for(Te=1;l<g.length;l++){var b=g[l];do b=b(!0);while(b!==null)}qn=null,Xr=!1}catch(C){throw qn!==null&&(qn=qn.slice(l+1)),We(rn,Bo),C}finally{Te=u,Br=!1}}return null}var Ta=[],sa=0,Ra=null,po=0,ho=[],mo=0,ns=null,Fo=1,to="";function Ji(l,u){Ta[sa++]=po,Ta[sa++]=Ra,Ra=l,po=u}function d2(l,u,g){ho[mo++]=Fo,ho[mo++]=to,ho[mo++]=ns,ns=l;var b=Fo;l=to;var C=32-Un(b)-1;b&=~(1<<C),g+=1;var E=32-Un(u)+C;if(30<E){var N=C-C%5;E=(b&(1<<N)-1).toString(32),b>>=N,C-=N,Fo=1<<32-Un(u)+C|g<<C|b,to=E+l}else Fo=1<<E|g<<C|b,to=l}function uv(l){l.return!==null&&(Ji(l,1),d2(l,1,0))}function dv(l){for(;l===Ra;)Ra=Ta[--sa],Ta[sa]=null,po=Ta[--sa],Ta[sa]=null;for(;l===ns;)ns=ho[--mo],ho[mo]=null,to=ho[--mo],ho[mo]=null,Fo=ho[--mo],ho[mo]=null}var Ho=null,rs=null,cr=!1,ju=!1,Ts=null;function f2(l,u){var g=ls(5,null,null,0);g.elementType="DELETED",g.stateNode=u,g.return=l,u=l.deletions,u===null?(l.deletions=[g],l.flags|=16):u.push(g)}function p2(l,u){switch(l.tag){case 5:return u=er(u,l.type,l.pendingProps),u!==null?(l.stateNode=u,Ho=l,rs=Z(u),!0):!1;case 6:return u=Is(u,l.pendingProps),u!==null?(l.stateNode=u,Ho=l,rs=null,!0):!1;case 13:if(u=ci(u),u!==null){var g=ns!==null?{id:Fo,overflow:to}:null;return l.memoizedState={dehydrated:u,treeContext:g,retryLane:1073741824},g=ls(18,null,null,0),g.stateNode=u,g.return=l,l.child=g,Ho=l,rs=null,!0}return!1;default:return!1}}function fv(l){return(l.mode&1)!==0&&(l.flags&128)===0}function pv(l){if(cr){var u=rs;if(u){var g=u;if(!p2(l,u)){if(fv(l))throw Error(a(418));u=Os(g);var b=Ho;u&&p2(l,u)?f2(b,g):(l.flags=l.flags&-4097|2,cr=!1,Ho=l)}}else{if(fv(l))throw Error(a(418));l.flags=l.flags&-4097|2,cr=!1,Ho=l}}}function h2(l){for(l=l.return;l!==null&&l.tag!==5&&l.tag!==3&&l.tag!==13;)l=l.return;Ho=l}function jf(l){if(!ke||l!==Ho)return!1;if(!cr)return h2(l),cr=!0,!1;if(l.tag!==3&&(l.tag!==5||je(l.type)&&!B(l.type,l.memoizedProps))){var u=rs;if(u){if(fv(l))throw m2(),Error(a(418));for(;u;)f2(l,u),u=Os(u)}}if(h2(l),l.tag===13){if(!ke)throw Error(a(316));if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(a(317));rs=St(l)}else rs=Ho?Os(l.stateNode):null;return!0}function m2(){for(var l=rs;l;)l=Os(l)}function Jl(){ke&&(rs=Ho=null,ju=cr=!1)}function hv(l){Ts===null?Ts=[l]:Ts.push(l)}var LR=c.ReactCurrentBatchConfig;function Ef(l,u){if(xn(l,u))return!0;if(typeof l!="object"||l===null||typeof u!="object"||u===null)return!1;var g=Object.keys(l),b=Object.keys(u);if(g.length!==b.length)return!1;for(b=0;b<g.length;b++){var C=g[b];if(!Kt.call(u,C)||!xn(l[C],u[C]))return!1}return!0}function BR(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=nn(l.type,!1),l;case 11:return l=nn(l.type.render,!1),l;case 1:return l=nn(l.type,!0),l;default:return""}}function Rs(l,u){if(l&&l.defaultProps){u=s({},u),l=l.defaultProps;for(var g in l)u[g]===void 0&&(u[g]=l[g]);return u}return u}var If=Bt(null),Of=null,ec=null,mv=null;function gv(){mv=ec=Of=null}function g2(l,u,g){pe?(qt(If,u._currentValue),u._currentValue=g):(qt(If,u._currentValue2),u._currentValue2=g)}function vv(l){var u=If.current;Ft(If),pe?l._currentValue=u:l._currentValue2=u}function yv(l,u,g){for(;l!==null;){var b=l.alternate;if((l.childLanes&u)!==u?(l.childLanes|=u,b!==null&&(b.childLanes|=u)):b!==null&&(b.childLanes&u)!==u&&(b.childLanes|=u),l===g)break;l=l.return}}function tc(l,u){Of=l,mv=ec=null,l=l.dependencies,l!==null&&l.firstContext!==null&&(l.lanes&u&&(So=!0),l.firstContext=null)}function os(l){var u=pe?l._currentValue:l._currentValue2;if(mv!==l)if(l={context:l,memoizedValue:u,next:null},ec===null){if(Of===null)throw Error(a(308));ec=l,Of.dependencies={lanes:0,firstContext:l}}else ec=ec.next=l;return u}var el=null;function bv(l){el===null?el=[l]:el.push(l)}function v2(l,u,g,b){var C=u.interleaved;return C===null?(g.next=g,bv(u)):(g.next=C.next,C.next=g),u.interleaved=g,aa(l,b)}function aa(l,u){l.lanes|=u;var g=l.alternate;for(g!==null&&(g.lanes|=u),g=l,l=l.return;l!==null;)l.childLanes|=u,g=l.alternate,g!==null&&(g.childLanes|=u),g=l,l=l.return;return g.tag===3?g.stateNode:null}var fi=!1;function xv(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function y2(l,u){l=l.updateQueue,u.updateQueue===l&&(u.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,effects:l.effects})}function Ma(l,u){return{eventTime:l,lane:u,tag:0,payload:null,callback:null,next:null}}function pi(l,u,g){var b=l.updateQueue;if(b===null)return null;if(b=b.shared,fn&2){var C=b.pending;return C===null?u.next=u:(u.next=C.next,C.next=u),b.pending=u,aa(l,g)}return C=b.interleaved,C===null?(u.next=u,bv(b)):(u.next=C.next,C.next=u),b.interleaved=u,aa(l,g)}function Tf(l,u,g){if(u=u.updateQueue,u!==null&&(u=u.shared,(g&4194240)!==0)){var b=u.lanes;b&=l.pendingLanes,g|=b,u.lanes=g,De(l,g)}}function b2(l,u){var g=l.updateQueue,b=l.alternate;if(b!==null&&(b=b.updateQueue,g===b)){var C=null,E=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};E===null?C=E=N:E=E.next=N,g=g.next}while(g!==null);E===null?C=E=u:E=E.next=u}else C=E=u;g={baseState:b.baseState,firstBaseUpdate:C,lastBaseUpdate:E,shared:b.shared,effects:b.effects},l.updateQueue=g;return}l=g.lastBaseUpdate,l===null?g.firstBaseUpdate=u:l.next=u,g.lastBaseUpdate=u}function Rf(l,u,g,b){var C=l.updateQueue;fi=!1;var E=C.firstBaseUpdate,N=C.lastBaseUpdate,Q=C.shared.pending;if(Q!==null){C.shared.pending=null;var he=Q,Be=he.next;he.next=null,N===null?E=Be:N.next=Be,N=he;var wt=l.alternate;wt!==null&&(wt=wt.updateQueue,Q=wt.lastBaseUpdate,Q!==N&&(Q===null?wt.firstBaseUpdate=Be:Q.next=Be,wt.lastBaseUpdate=he))}if(E!==null){var Qt=C.baseState;N=0,wt=Be=he=null,Q=E;do{var dt=Q.lane,rr=Q.eventTime;if((b&dt)===dt){wt!==null&&(wt=wt.next={eventTime:rr,lane:0,tag:Q.tag,payload:Q.payload,callback:Q.callback,next:null});e:{var Yn=l,ko=Q;switch(dt=u,rr=g,ko.tag){case 1:if(Yn=ko.payload,typeof Yn=="function"){Qt=Yn.call(rr,Qt,dt);break e}Qt=Yn;break e;case 3:Yn.flags=Yn.flags&-65537|128;case 0:if(Yn=ko.payload,dt=typeof Yn=="function"?Yn.call(rr,Qt,dt):Yn,dt==null)break e;Qt=s({},Qt,dt);break e;case 2:fi=!0}}Q.callback!==null&&Q.lane!==0&&(l.flags|=64,dt=C.effects,dt===null?C.effects=[Q]:dt.push(Q))}else rr={eventTime:rr,lane:dt,tag:Q.tag,payload:Q.payload,callback:Q.callback,next:null},wt===null?(Be=wt=rr,he=Qt):wt=wt.next=rr,N|=dt;if(Q=Q.next,Q===null){if(Q=C.shared.pending,Q===null)break;dt=Q,Q=dt.next,dt.next=null,C.lastBaseUpdate=dt,C.shared.pending=null}}while(1);if(wt===null&&(he=Qt),C.baseState=he,C.firstBaseUpdate=Be,C.lastBaseUpdate=wt,u=C.shared.interleaved,u!==null){C=u;do N|=C.lane,C=C.next;while(C!==u)}else E===null&&(C.shared.lanes=0);nl|=N,l.lanes=N,l.memoizedState=Qt}}function x2(l,u,g){if(l=u.effects,u.effects=null,l!==null)for(u=0;u<l.length;u++){var b=l[u],C=b.callback;if(C!==null){if(b.callback=null,b=g,typeof C!="function")throw Error(a(191,C));C.call(b)}}}var w2=new r.Component().refs;function wv(l,u,g,b){u=l.memoizedState,g=g(b,u),g=g==null?u:s({},u,g),l.memoizedState=g,l.lanes===0&&(l.updateQueue.baseState=g)}var Mf={isMounted:function(l){return(l=l._reactInternals)?M(l)===l:!1},enqueueSetState:function(l,u,g){l=l._reactInternals;var b=so(),C=gi(l),E=Ma(b,C);E.payload=u,g!=null&&(E.callback=g),u=pi(l,E,C),u!==null&&(is(u,l,C,b),Tf(u,l,C))},enqueueReplaceState:function(l,u,g){l=l._reactInternals;var b=so(),C=gi(l),E=Ma(b,C);E.tag=1,E.payload=u,g!=null&&(E.callback=g),u=pi(l,E,C),u!==null&&(is(u,l,C,b),Tf(u,l,C))},enqueueForceUpdate:function(l,u){l=l._reactInternals;var g=so(),b=gi(l),C=Ma(g,b);C.tag=2,u!=null&&(C.callback=u),u=pi(l,C,b),u!==null&&(is(u,l,b,g),Tf(u,l,b))}};function S2(l,u,g,b,C,E,N){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(b,E,N):u.prototype&&u.prototype.isPureReactComponent?!Ef(g,b)||!Ef(C,E):!0}function C2(l,u,g){var b=!1,C=kn,E=u.contextType;return typeof E=="object"&&E!==null?E=os(E):(C=ir(u)?Nn:tn.current,b=u.contextTypes,E=(b=b!=null)?Lr(l,C):kn),u=new u(g,E),l.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=Mf,l.stateNode=u,u._reactInternals=l,b&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=C,l.__reactInternalMemoizedMaskedChildContext=E),u}function _2(l,u,g,b){l=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(g,b),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(g,b),u.state!==l&&Mf.enqueueReplaceState(u,u.state,null)}function Sv(l,u,g,b){var C=l.stateNode;C.props=g,C.state=l.memoizedState,C.refs=w2,xv(l);var E=u.contextType;typeof E=="object"&&E!==null?C.context=os(E):(E=ir(u)?Nn:tn.current,C.context=Lr(l,E)),C.state=l.memoizedState,E=u.getDerivedStateFromProps,typeof E=="function"&&(wv(l,u,E,g),C.state=l.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof C.getSnapshotBeforeUpdate=="function"||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(u=C.state,typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount(),u!==C.state&&Mf.enqueueReplaceState(C,C.state,null),Rf(l,g,C,b),C.state=l.memoizedState),typeof C.componentDidMount=="function"&&(l.flags|=4194308)}function Eu(l,u,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(a(309));var b=g.stateNode}if(!b)throw Error(a(147,l));var C=b,E=""+l;return u!==null&&u.ref!==null&&typeof u.ref=="function"&&u.ref._stringRef===E?u.ref:(u=function(N){var Q=C.refs;Q===w2&&(Q=C.refs={}),N===null?delete Q[E]:Q[E]=N},u._stringRef=E,u)}if(typeof l!="string")throw Error(a(284));if(!g._owner)throw Error(a(290,l))}return l}function Df(l,u){throw l=Object.prototype.toString.call(u),Error(a(31,l==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":l))}function k2(l){var u=l._init;return u(l._payload)}function P2(l){function u(de,re){if(l){var xe=de.deletions;xe===null?(de.deletions=[re],de.flags|=16):xe.push(re)}}function g(de,re){if(!l)return null;for(;re!==null;)u(de,re),re=re.sibling;return null}function b(de,re){for(de=new Map;re!==null;)re.key!==null?de.set(re.key,re):de.set(re.index,re),re=re.sibling;return de}function C(de,re){return de=yi(de,re),de.index=0,de.sibling=null,de}function E(de,re,xe){return de.index=xe,l?(xe=de.alternate,xe!==null?(xe=xe.index,xe<re?(de.flags|=2,re):xe):(de.flags|=2,re)):(de.flags|=1048576,re)}function N(de){return l&&de.alternate===null&&(de.flags|=2),de}function Q(de,re,xe,ht){return re===null||re.tag!==6?(re=c0(xe,de.mode,ht),re.return=de,re):(re=C(re,xe),re.return=de,re)}function he(de,re,xe,ht){var zt=xe.type;return zt===h?wt(de,re,xe.props.children,ht,xe.key):re!==null&&(re.elementType===zt||typeof zt=="object"&&zt!==null&&zt.$$typeof===P&&k2(zt)===re.type)?(ht=C(re,xe.props),ht.ref=Eu(de,re,xe),ht.return=de,ht):(ht=ap(xe.type,xe.key,xe.props,null,de.mode,ht),ht.ref=Eu(de,re,xe),ht.return=de,ht)}function Be(de,re,xe,ht){return re===null||re.tag!==4||re.stateNode.containerInfo!==xe.containerInfo||re.stateNode.implementation!==xe.implementation?(re=u0(xe,de.mode,ht),re.return=de,re):(re=C(re,xe.children||[]),re.return=de,re)}function wt(de,re,xe,ht,zt){return re===null||re.tag!==7?(re=al(xe,de.mode,ht,zt),re.return=de,re):(re=C(re,xe),re.return=de,re)}function Qt(de,re,xe){if(typeof re=="string"&&re!==""||typeof re=="number")return re=c0(""+re,de.mode,xe),re.return=de,re;if(typeof re=="object"&&re!==null){switch(re.$$typeof){case d:return xe=ap(re.type,re.key,re.props,null,de.mode,xe),xe.ref=Eu(de,null,re),xe.return=de,xe;case f:return re=u0(re,de.mode,xe),re.return=de,re;case P:var ht=re._init;return Qt(de,ht(re._payload),xe)}if(U(re)||O(re))return re=al(re,de.mode,xe,null),re.return=de,re;Df(de,re)}return null}function dt(de,re,xe,ht){var zt=re!==null?re.key:null;if(typeof xe=="string"&&xe!==""||typeof xe=="number")return zt!==null?null:Q(de,re,""+xe,ht);if(typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case d:return xe.key===zt?he(de,re,xe,ht):null;case f:return xe.key===zt?Be(de,re,xe,ht):null;case P:return zt=xe._init,dt(de,re,zt(xe._payload),ht)}if(U(xe)||O(xe))return zt!==null?null:wt(de,re,xe,ht,null);Df(de,xe)}return null}function rr(de,re,xe,ht,zt){if(typeof ht=="string"&&ht!==""||typeof ht=="number")return de=de.get(xe)||null,Q(re,de,""+ht,zt);if(typeof ht=="object"&&ht!==null){switch(ht.$$typeof){case d:return de=de.get(ht.key===null?xe:ht.key)||null,he(re,de,ht,zt);case f:return de=de.get(ht.key===null?xe:ht.key)||null,Be(re,de,ht,zt);case P:var ln=ht._init;return rr(de,re,xe,ln(ht._payload),zt)}if(U(ht)||O(ht))return de=de.get(xe)||null,wt(re,de,ht,zt,null);Df(re,ht)}return null}function Yn(de,re,xe,ht){for(var zt=null,ln=null,Jt=re,On=re=0,Kr=null;Jt!==null&&On<xe.length;On++){Jt.index>On?(Kr=Jt,Jt=null):Kr=Jt.sibling;var Tn=dt(de,Jt,xe[On],ht);if(Tn===null){Jt===null&&(Jt=Kr);break}l&&Jt&&Tn.alternate===null&&u(de,Jt),re=E(Tn,re,On),ln===null?zt=Tn:ln.sibling=Tn,ln=Tn,Jt=Kr}if(On===xe.length)return g(de,Jt),cr&&Ji(de,On),zt;if(Jt===null){for(;On<xe.length;On++)Jt=Qt(de,xe[On],ht),Jt!==null&&(re=E(Jt,re,On),ln===null?zt=Jt:ln.sibling=Jt,ln=Jt);return cr&&Ji(de,On),zt}for(Jt=b(de,Jt);On<xe.length;On++)Kr=rr(Jt,de,On,xe[On],ht),Kr!==null&&(l&&Kr.alternate!==null&&Jt.delete(Kr.key===null?On:Kr.key),re=E(Kr,re,On),ln===null?zt=Kr:ln.sibling=Kr,ln=Kr);return l&&Jt.forEach(function(bi){return u(de,bi)}),cr&&Ji(de,On),zt}function ko(de,re,xe,ht){var zt=O(xe);if(typeof zt!="function")throw Error(a(150));if(xe=zt.call(xe),xe==null)throw Error(a(151));for(var ln=zt=null,Jt=re,On=re=0,Kr=null,Tn=xe.next();Jt!==null&&!Tn.done;On++,Tn=xe.next()){Jt.index>On?(Kr=Jt,Jt=null):Kr=Jt.sibling;var bi=dt(de,Jt,Tn.value,ht);if(bi===null){Jt===null&&(Jt=Kr);break}l&&Jt&&bi.alternate===null&&u(de,Jt),re=E(bi,re,On),ln===null?zt=bi:ln.sibling=bi,ln=bi,Jt=Kr}if(Tn.done)return g(de,Jt),cr&&Ji(de,On),zt;if(Jt===null){for(;!Tn.done;On++,Tn=xe.next())Tn=Qt(de,Tn.value,ht),Tn!==null&&(re=E(Tn,re,On),ln===null?zt=Tn:ln.sibling=Tn,ln=Tn);return cr&&Ji(de,On),zt}for(Jt=b(de,Jt);!Tn.done;On++,Tn=xe.next())Tn=rr(Jt,de,On,Tn.value,ht),Tn!==null&&(l&&Tn.alternate!==null&&Jt.delete(Tn.key===null?On:Tn.key),re=E(Tn,re,On),ln===null?zt=Tn:ln.sibling=Tn,ln=Tn);return l&&Jt.forEach(function(g8){return u(de,g8)}),cr&&Ji(de,On),zt}function Na(de,re,xe,ht){if(typeof xe=="object"&&xe!==null&&xe.type===h&&xe.key===null&&(xe=xe.props.children),typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case d:e:{for(var zt=xe.key,ln=re;ln!==null;){if(ln.key===zt){if(zt=xe.type,zt===h){if(ln.tag===7){g(de,ln.sibling),re=C(ln,xe.props.children),re.return=de,de=re;break e}}else if(ln.elementType===zt||typeof zt=="object"&&zt!==null&&zt.$$typeof===P&&k2(zt)===ln.type){g(de,ln.sibling),re=C(ln,xe.props),re.ref=Eu(de,ln,xe),re.return=de,de=re;break e}g(de,ln);break}else u(de,ln);ln=ln.sibling}xe.type===h?(re=al(xe.props.children,de.mode,ht,xe.key),re.return=de,de=re):(ht=ap(xe.type,xe.key,xe.props,null,de.mode,ht),ht.ref=Eu(de,re,xe),ht.return=de,de=ht)}return N(de);case f:e:{for(ln=xe.key;re!==null;){if(re.key===ln)if(re.tag===4&&re.stateNode.containerInfo===xe.containerInfo&&re.stateNode.implementation===xe.implementation){g(de,re.sibling),re=C(re,xe.children||[]),re.return=de,de=re;break e}else{g(de,re);break}else u(de,re);re=re.sibling}re=u0(xe,de.mode,ht),re.return=de,de=re}return N(de);case P:return ln=xe._init,Na(de,re,ln(xe._payload),ht)}if(U(xe))return Yn(de,re,xe,ht);if(O(xe))return ko(de,re,xe,ht);Df(de,xe)}return typeof xe=="string"&&xe!==""||typeof xe=="number"?(xe=""+xe,re!==null&&re.tag===6?(g(de,re.sibling),re=C(re,xe),re.return=de,de=re):(g(de,re),re=c0(xe,de.mode,ht),re.return=de,de=re),N(de)):g(de,re)}return Na}var nc=P2(!0),j2=P2(!1),Iu={},ss=Bt(Iu),Ou=Bt(Iu),rc=Bt(Iu);function ia(l){if(l===Iu)throw Error(a(174));return l}function Cv(l,u){qt(rc,u),qt(Ou,l),qt(ss,Iu),l=z(u),Ft(ss),qt(ss,l)}function oc(){Ft(ss),Ft(Ou),Ft(rc)}function E2(l){var u=ia(rc.current),g=ia(ss.current);u=L(g,l.type,u),g!==u&&(qt(Ou,l),qt(ss,u))}function _v(l){Ou.current===l&&(Ft(ss),Ft(Ou))}var br=Bt(0);function Af(l){for(var u=l;u!==null;){if(u.tag===13){var g=u.memoizedState;if(g!==null&&(g=g.dehydrated,g===null||$r(g)||ts(g)))return u}else if(u.tag===19&&u.memoizedProps.revealOrder!==void 0){if(u.flags&128)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===l)break;for(;u.sibling===null;){if(u.return===null||u.return===l)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}var kv=[];function Pv(){for(var l=0;l<kv.length;l++){var u=kv[l];pe?u._workInProgressVersionPrimary=null:u._workInProgressVersionSecondary=null}kv.length=0}var Nf=c.ReactCurrentDispatcher,jv=c.ReactCurrentBatchConfig,tl=0,xr=null,Fr=null,qr=null,zf=!1,Tu=!1,Ru=0,FR=0;function no(){throw Error(a(321))}function Ev(l,u){if(u===null)return!1;for(var g=0;g<u.length&&g<l.length;g++)if(!xn(l[g],u[g]))return!1;return!0}function Iv(l,u,g,b,C,E){if(tl=E,xr=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,Nf.current=l===null||l.memoizedState===null?UR:GR,l=g(b,C),Tu){E=0;do{if(Tu=!1,Ru=0,25<=E)throw Error(a(301));E+=1,qr=Fr=null,u.updateQueue=null,Nf.current=qR,l=g(b,C)}while(Tu)}if(Nf.current=Bf,u=Fr!==null&&Fr.next!==null,tl=0,qr=Fr=xr=null,zf=!1,u)throw Error(a(300));return l}function Ov(){var l=Ru!==0;return Ru=0,l}function la(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return qr===null?xr.memoizedState=qr=l:qr=qr.next=l,qr}function as(){if(Fr===null){var l=xr.alternate;l=l!==null?l.memoizedState:null}else l=Fr.next;var u=qr===null?xr.memoizedState:qr.next;if(u!==null)qr=u,Fr=l;else{if(l===null)throw Error(a(310));Fr=l,l={memoizedState:Fr.memoizedState,baseState:Fr.baseState,baseQueue:Fr.baseQueue,queue:Fr.queue,next:null},qr===null?xr.memoizedState=qr=l:qr=qr.next=l}return qr}function Mu(l,u){return typeof u=="function"?u(l):u}function Tv(l){var u=as(),g=u.queue;if(g===null)throw Error(a(311));g.lastRenderedReducer=l;var b=Fr,C=b.baseQueue,E=g.pending;if(E!==null){if(C!==null){var N=C.next;C.next=E.next,E.next=N}b.baseQueue=C=E,g.pending=null}if(C!==null){E=C.next,b=b.baseState;var Q=N=null,he=null,Be=E;do{var wt=Be.lane;if((tl&wt)===wt)he!==null&&(he=he.next={lane:0,action:Be.action,hasEagerState:Be.hasEagerState,eagerState:Be.eagerState,next:null}),b=Be.hasEagerState?Be.eagerState:l(b,Be.action);else{var Qt={lane:wt,action:Be.action,hasEagerState:Be.hasEagerState,eagerState:Be.eagerState,next:null};he===null?(Q=he=Qt,N=b):he=he.next=Qt,xr.lanes|=wt,nl|=wt}Be=Be.next}while(Be!==null&&Be!==E);he===null?N=b:he.next=Q,xn(b,u.memoizedState)||(So=!0),u.memoizedState=b,u.baseState=N,u.baseQueue=he,g.lastRenderedState=b}if(l=g.interleaved,l!==null){C=l;do E=C.lane,xr.lanes|=E,nl|=E,C=C.next;while(C!==l)}else C===null&&(g.lanes=0);return[u.memoizedState,g.dispatch]}function Rv(l){var u=as(),g=u.queue;if(g===null)throw Error(a(311));g.lastRenderedReducer=l;var b=g.dispatch,C=g.pending,E=u.memoizedState;if(C!==null){g.pending=null;var N=C=C.next;do E=l(E,N.action),N=N.next;while(N!==C);xn(E,u.memoizedState)||(So=!0),u.memoizedState=E,u.baseQueue===null&&(u.baseState=E),g.lastRenderedState=E}return[E,b]}function I2(){}function O2(l,u){var g=xr,b=as(),C=u(),E=!xn(b.memoizedState,C);if(E&&(b.memoizedState=C,So=!0),b=b.queue,Mv(M2.bind(null,g,b,l),[l]),b.getSnapshot!==u||E||qr!==null&&qr.memoizedState.tag&1){if(g.flags|=2048,Du(9,R2.bind(null,g,b,C,u),void 0,null),Yr===null)throw Error(a(349));tl&30||T2(g,u,C)}return C}function T2(l,u,g){l.flags|=16384,l={getSnapshot:u,value:g},u=xr.updateQueue,u===null?(u={lastEffect:null,stores:null},xr.updateQueue=u,u.stores=[l]):(g=u.stores,g===null?u.stores=[l]:g.push(l))}function R2(l,u,g,b){u.value=g,u.getSnapshot=b,D2(u)&&A2(l)}function M2(l,u,g){return g(function(){D2(u)&&A2(l)})}function D2(l){var u=l.getSnapshot;l=l.value;try{var g=u();return!xn(l,g)}catch{return!0}}function A2(l){var u=aa(l,1);u!==null&&is(u,l,1,-1)}function N2(l){var u=la();return typeof l=="function"&&(l=l()),u.memoizedState=u.baseState=l,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Mu,lastRenderedState:l},u.queue=l,l=l.dispatch=WR.bind(null,xr,l),[u.memoizedState,l]}function Du(l,u,g,b){return l={tag:l,create:u,destroy:g,deps:b,next:null},u=xr.updateQueue,u===null?(u={lastEffect:null,stores:null},xr.updateQueue=u,u.lastEffect=l.next=l):(g=u.lastEffect,g===null?u.lastEffect=l.next=l:(b=g.next,g.next=l,l.next=b,u.lastEffect=l)),l}function z2(){return as().memoizedState}function $f(l,u,g,b){var C=la();xr.flags|=l,C.memoizedState=Du(1|u,g,void 0,b===void 0?null:b)}function Lf(l,u,g,b){var C=as();b=b===void 0?null:b;var E=void 0;if(Fr!==null){var N=Fr.memoizedState;if(E=N.destroy,b!==null&&Ev(b,N.deps)){C.memoizedState=Du(u,g,E,b);return}}xr.flags|=l,C.memoizedState=Du(1|u,g,E,b)}function $2(l,u){return $f(8390656,8,l,u)}function Mv(l,u){return Lf(2048,8,l,u)}function L2(l,u){return Lf(4,2,l,u)}function B2(l,u){return Lf(4,4,l,u)}function F2(l,u){if(typeof u=="function")return l=l(),u(l),function(){u(null)};if(u!=null)return l=l(),u.current=l,function(){u.current=null}}function H2(l,u,g){return g=g!=null?g.concat([l]):null,Lf(4,4,F2.bind(null,u,l),g)}function Dv(){}function V2(l,u){var g=as();u=u===void 0?null:u;var b=g.memoizedState;return b!==null&&u!==null&&Ev(u,b[1])?b[0]:(g.memoizedState=[l,u],l)}function W2(l,u){var g=as();u=u===void 0?null:u;var b=g.memoizedState;return b!==null&&u!==null&&Ev(u,b[1])?b[0]:(l=l(),g.memoizedState=[l,u],l)}function U2(l,u,g){return tl&21?(xn(g,u)||(g=_t(),xr.lanes|=g,nl|=g,l.baseState=!0),u):(l.baseState&&(l.baseState=!1,So=!0),l.memoizedState=g)}function HR(l,u){var g=Te;Te=g!==0&&4>g?g:4,l(!0);var b=jv.transition;jv.transition={};try{l(!1),u()}finally{Te=g,jv.transition=b}}function G2(){return as().memoizedState}function VR(l,u,g){var b=gi(l);if(g={lane:b,action:g,hasEagerState:!1,eagerState:null,next:null},q2(l))Y2(u,g);else if(g=v2(l,u,g,b),g!==null){var C=so();is(g,l,b,C),K2(g,u,b)}}function WR(l,u,g){var b=gi(l),C={lane:b,action:g,hasEagerState:!1,eagerState:null,next:null};if(q2(l))Y2(u,C);else{var E=l.alternate;if(l.lanes===0&&(E===null||E.lanes===0)&&(E=u.lastRenderedReducer,E!==null))try{var N=u.lastRenderedState,Q=E(N,g);if(C.hasEagerState=!0,C.eagerState=Q,xn(Q,N)){var he=u.interleaved;he===null?(C.next=C,bv(u)):(C.next=he.next,he.next=C),u.interleaved=C;return}}catch{}finally{}g=v2(l,u,C,b),g!==null&&(C=so(),is(g,l,b,C),K2(g,u,b))}}function q2(l){var u=l.alternate;return l===xr||u!==null&&u===xr}function Y2(l,u){Tu=zf=!0;var g=l.pending;g===null?u.next=u:(u.next=g.next,g.next=u),l.pending=u}function K2(l,u,g){if(g&4194240){var b=u.lanes;b&=l.pendingLanes,g|=b,u.lanes=g,De(l,g)}}var Bf={readContext:os,useCallback:no,useContext:no,useEffect:no,useImperativeHandle:no,useInsertionEffect:no,useLayoutEffect:no,useMemo:no,useReducer:no,useRef:no,useState:no,useDebugValue:no,useDeferredValue:no,useTransition:no,useMutableSource:no,useSyncExternalStore:no,useId:no,unstable_isNewReconciler:!1},UR={readContext:os,useCallback:function(l,u){return la().memoizedState=[l,u===void 0?null:u],l},useContext:os,useEffect:$2,useImperativeHandle:function(l,u,g){return g=g!=null?g.concat([l]):null,$f(4194308,4,F2.bind(null,u,l),g)},useLayoutEffect:function(l,u){return $f(4194308,4,l,u)},useInsertionEffect:function(l,u){return $f(4,2,l,u)},useMemo:function(l,u){var g=la();return u=u===void 0?null:u,l=l(),g.memoizedState=[l,u],l},useReducer:function(l,u,g){var b=la();return u=g!==void 0?g(u):u,b.memoizedState=b.baseState=u,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:u},b.queue=l,l=l.dispatch=VR.bind(null,xr,l),[b.memoizedState,l]},useRef:function(l){var u=la();return l={current:l},u.memoizedState=l},useState:N2,useDebugValue:Dv,useDeferredValue:function(l){return la().memoizedState=l},useTransition:function(){var l=N2(!1),u=l[0];return l=HR.bind(null,l[1]),la().memoizedState=l,[u,l]},useMutableSource:function(){},useSyncExternalStore:function(l,u,g){var b=xr,C=la();if(cr){if(g===void 0)throw Error(a(407));g=g()}else{if(g=u(),Yr===null)throw Error(a(349));tl&30||T2(b,u,g)}C.memoizedState=g;var E={value:g,getSnapshot:u};return C.queue=E,$2(M2.bind(null,b,E,l),[l]),b.flags|=2048,Du(9,R2.bind(null,b,E,g,u),void 0,null),g},useId:function(){var l=la(),u=Yr.identifierPrefix;if(cr){var g=to,b=Fo;g=(b&~(1<<32-Un(b)-1)).toString(32)+g,u=":"+u+"R"+g,g=Ru++,0<g&&(u+="H"+g.toString(32)),u+=":"}else g=FR++,u=":"+u+"r"+g.toString(32)+":";return l.memoizedState=u},unstable_isNewReconciler:!1},GR={readContext:os,useCallback:V2,useContext:os,useEffect:Mv,useImperativeHandle:H2,useInsertionEffect:L2,useLayoutEffect:B2,useMemo:W2,useReducer:Tv,useRef:z2,useState:function(){return Tv(Mu)},useDebugValue:Dv,useDeferredValue:function(l){var u=as();return U2(u,Fr.memoizedState,l)},useTransition:function(){var l=Tv(Mu)[0],u=as().memoizedState;return[l,u]},useMutableSource:I2,useSyncExternalStore:O2,useId:G2,unstable_isNewReconciler:!1},qR={readContext:os,useCallback:V2,useContext:os,useEffect:Mv,useImperativeHandle:H2,useInsertionEffect:L2,useLayoutEffect:B2,useMemo:W2,useReducer:Rv,useRef:z2,useState:function(){return Rv(Mu)},useDebugValue:Dv,useDeferredValue:function(l){var u=as();return Fr===null?u.memoizedState=l:U2(u,Fr.memoizedState,l)},useTransition:function(){var l=Rv(Mu)[0],u=as().memoizedState;return[l,u]},useMutableSource:I2,useSyncExternalStore:O2,useId:G2,unstable_isNewReconciler:!1};function sc(l,u){try{var g="",b=u;do g+=BR(b),b=b.return;while(b);var C=g}catch(E){C=`
Error generating stack: `+E.message+`
`+E.stack}return{value:l,source:u,stack:C,digest:null}}function Av(l,u,g){return{value:l,source:null,stack:g??null,digest:u??null}}function Nv(l,u){try{console.error(u.value)}catch(g){setTimeout(function(){throw g})}}var YR=typeof WeakMap=="function"?WeakMap:Map;function X2(l,u,g){g=Ma(-1,g),g.tag=3,g.payload={element:null};var b=u.value;return g.callback=function(){ep||(ep=!0,n0=b),Nv(l,u)},g}function Z2(l,u,g){g=Ma(-1,g),g.tag=3;var b=l.type.getDerivedStateFromError;if(typeof b=="function"){var C=u.value;g.payload=function(){return b(C)},g.callback=function(){Nv(l,u)}}var E=l.stateNode;return E!==null&&typeof E.componentDidCatch=="function"&&(g.callback=function(){Nv(l,u),typeof b!="function"&&(hi===null?hi=new Set([this]):hi.add(this));var N=u.stack;this.componentDidCatch(u.value,{componentStack:N!==null?N:""})}),g}function Q2(l,u,g){var b=l.pingCache;if(b===null){b=l.pingCache=new YR;var C=new Set;b.set(u,C)}else C=b.get(u),C===void 0&&(C=new Set,b.set(u,C));C.has(g)||(C.add(g),l=l8.bind(null,l,u,g),u.then(l,l))}function J2(l){do{var u;if((u=l.tag===13)&&(u=l.memoizedState,u=u!==null?u.dehydrated!==null:!0),u)return l;l=l.return}while(l!==null);return null}function ew(l,u,g,b,C){return l.mode&1?(l.flags|=65536,l.lanes=C,l):(l===u?l.flags|=65536:(l.flags|=128,g.flags|=131072,g.flags&=-52805,g.tag===1&&(g.alternate===null?g.tag=17:(u=Ma(-1,1),u.tag=2,pi(g,u,1))),g.lanes|=1),l)}var KR=c.ReactCurrentOwner,So=!1;function go(l,u,g,b){u.child=l===null?j2(u,null,g,b):nc(u,l.child,g,b)}function tw(l,u,g,b,C){g=g.render;var E=u.ref;return tc(u,C),b=Iv(l,u,g,b,E,C),g=Ov(),l!==null&&!So?(u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~C,Da(l,u,C)):(cr&&g&&uv(u),u.flags|=1,go(l,u,b,C),u.child)}function nw(l,u,g,b,C){if(l===null){var E=g.type;return typeof E=="function"&&!l0(E)&&E.defaultProps===void 0&&g.compare===null&&g.defaultProps===void 0?(u.tag=15,u.type=E,rw(l,u,E,b,C)):(l=ap(g.type,null,b,u,u.mode,C),l.ref=u.ref,l.return=u,u.child=l)}if(E=l.child,!(l.lanes&C)){var N=E.memoizedProps;if(g=g.compare,g=g!==null?g:Ef,g(N,b)&&l.ref===u.ref)return Da(l,u,C)}return u.flags|=1,l=yi(E,b),l.ref=u.ref,l.return=u,u.child=l}function rw(l,u,g,b,C){if(l!==null){var E=l.memoizedProps;if(Ef(E,b)&&l.ref===u.ref)if(So=!1,u.pendingProps=b=E,(l.lanes&C)!==0)l.flags&131072&&(So=!0);else return u.lanes=l.lanes,Da(l,u,C)}return zv(l,u,g,b,C)}function ow(l,u,g){var b=u.pendingProps,C=b.children,E=l!==null?l.memoizedState:null;if(b.mode==="hidden")if(!(u.mode&1))u.memoizedState={baseLanes:0,cachePool:null,transitions:null},qt(ic,Vo),Vo|=g;else{if(!(g&1073741824))return l=E!==null?E.baseLanes|g:g,u.lanes=u.childLanes=1073741824,u.memoizedState={baseLanes:l,cachePool:null,transitions:null},u.updateQueue=null,qt(ic,Vo),Vo|=l,null;u.memoizedState={baseLanes:0,cachePool:null,transitions:null},b=E!==null?E.baseLanes:g,qt(ic,Vo),Vo|=b}else E!==null?(b=E.baseLanes|g,u.memoizedState=null):b=g,qt(ic,Vo),Vo|=b;return go(l,u,C,g),u.child}function sw(l,u){var g=u.ref;(l===null&&g!==null||l!==null&&l.ref!==g)&&(u.flags|=512,u.flags|=2097152)}function zv(l,u,g,b,C){var E=ir(g)?Nn:tn.current;return E=Lr(u,E),tc(u,C),g=Iv(l,u,g,b,E,C),b=Ov(),l!==null&&!So?(u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~C,Da(l,u,C)):(cr&&b&&uv(u),u.flags|=1,go(l,u,g,C),u.child)}function aw(l,u,g,b,C){if(ir(g)){var E=!0;lr(u)}else E=!1;if(tc(u,C),u.stateNode===null)Hf(l,u),C2(u,g,b),Sv(u,g,b,C),b=!0;else if(l===null){var N=u.stateNode,Q=u.memoizedProps;N.props=Q;var he=N.context,Be=g.contextType;typeof Be=="object"&&Be!==null?Be=os(Be):(Be=ir(g)?Nn:tn.current,Be=Lr(u,Be));var wt=g.getDerivedStateFromProps,Qt=typeof wt=="function"||typeof N.getSnapshotBeforeUpdate=="function";Qt||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(Q!==b||he!==Be)&&_2(u,N,b,Be),fi=!1;var dt=u.memoizedState;N.state=dt,Rf(u,b,N,C),he=u.memoizedState,Q!==b||dt!==he||dn.current||fi?(typeof wt=="function"&&(wv(u,g,wt,b),he=u.memoizedState),(Q=fi||S2(u,g,Q,b,dt,he,Be))?(Qt||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"&&(u.flags|=4194308)):(typeof N.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=b,u.memoizedState=he),N.props=b,N.state=he,N.context=Be,b=Q):(typeof N.componentDidMount=="function"&&(u.flags|=4194308),b=!1)}else{N=u.stateNode,y2(l,u),Q=u.memoizedProps,Be=u.type===u.elementType?Q:Rs(u.type,Q),N.props=Be,Qt=u.pendingProps,dt=N.context,he=g.contextType,typeof he=="object"&&he!==null?he=os(he):(he=ir(g)?Nn:tn.current,he=Lr(u,he));var rr=g.getDerivedStateFromProps;(wt=typeof rr=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(Q!==Qt||dt!==he)&&_2(u,N,b,he),fi=!1,dt=u.memoizedState,N.state=dt,Rf(u,b,N,C);var Yn=u.memoizedState;Q!==Qt||dt!==Yn||dn.current||fi?(typeof rr=="function"&&(wv(u,g,rr,b),Yn=u.memoizedState),(Be=fi||S2(u,g,Be,b,dt,Yn,he)||!1)?(wt||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(b,Yn,he),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(b,Yn,he)),typeof N.componentDidUpdate=="function"&&(u.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof N.componentDidUpdate!="function"||Q===l.memoizedProps&&dt===l.memoizedState||(u.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||Q===l.memoizedProps&&dt===l.memoizedState||(u.flags|=1024),u.memoizedProps=b,u.memoizedState=Yn),N.props=b,N.state=Yn,N.context=he,b=Be):(typeof N.componentDidUpdate!="function"||Q===l.memoizedProps&&dt===l.memoizedState||(u.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||Q===l.memoizedProps&&dt===l.memoizedState||(u.flags|=1024),b=!1)}return $v(l,u,g,b,E,C)}function $v(l,u,g,b,C,E){sw(l,u);var N=(u.flags&128)!==0;if(!b&&!N)return C&&_r(u,g,!1),Da(l,u,E);b=u.stateNode,KR.current=u;var Q=N&&typeof g.getDerivedStateFromError!="function"?null:b.render();return u.flags|=1,l!==null&&N?(u.child=nc(u,l.child,null,E),u.child=nc(u,null,Q,E)):go(l,u,Q,E),u.memoizedState=b.state,C&&_r(u,g,!0),u.child}function iw(l){var u=l.stateNode;u.pendingContext?Dn(l,u.pendingContext,u.pendingContext!==u.context):u.context&&Dn(l,u.context,!1),Cv(l,u.containerInfo)}function lw(l,u,g,b,C){return Jl(),hv(C),u.flags|=256,go(l,u,g,b),u.child}var Lv={dehydrated:null,treeContext:null,retryLane:0};function Bv(l){return{baseLanes:l,cachePool:null,transitions:null}}function cw(l,u,g){var b=u.pendingProps,C=br.current,E=!1,N=(u.flags&128)!==0,Q;if((Q=N)||(Q=l!==null&&l.memoizedState===null?!1:(C&2)!==0),Q?(E=!0,u.flags&=-129):(l===null||l.memoizedState!==null)&&(C|=1),qt(br,C&1),l===null)return pv(u),l=u.memoizedState,l!==null&&(l=l.dehydrated,l!==null)?(u.mode&1?ts(l)?u.lanes=8:u.lanes=1073741824:u.lanes=1,null):(N=b.children,l=b.fallback,E?(b=u.mode,E=u.child,N={mode:"hidden",children:N},!(b&1)&&E!==null?(E.childLanes=0,E.pendingProps=N):E=ip(N,b,0,null),l=al(l,b,g,null),E.return=u,l.return=u,E.sibling=l,u.child=E,u.child.memoizedState=Bv(g),u.memoizedState=Lv,l):Fv(u,N));if(C=l.memoizedState,C!==null&&(Q=C.dehydrated,Q!==null))return XR(l,u,N,b,Q,C,g);if(E){E=b.fallback,N=u.mode,C=l.child,Q=C.sibling;var he={mode:"hidden",children:b.children};return!(N&1)&&u.child!==C?(b=u.child,b.childLanes=0,b.pendingProps=he,u.deletions=null):(b=yi(C,he),b.subtreeFlags=C.subtreeFlags&14680064),Q!==null?E=yi(Q,E):(E=al(E,N,g,null),E.flags|=2),E.return=u,b.return=u,b.sibling=E,u.child=b,b=E,E=u.child,N=l.child.memoizedState,N=N===null?Bv(g):{baseLanes:N.baseLanes|g,cachePool:null,transitions:N.transitions},E.memoizedState=N,E.childLanes=l.childLanes&~g,u.memoizedState=Lv,b}return E=l.child,l=E.sibling,b=yi(E,{mode:"visible",children:b.children}),!(u.mode&1)&&(b.lanes=g),b.return=u,b.sibling=null,l!==null&&(g=u.deletions,g===null?(u.deletions=[l],u.flags|=16):g.push(l)),u.child=b,u.memoizedState=null,b}function Fv(l,u){return u=ip({mode:"visible",children:u},l.mode,0,null),u.return=l,l.child=u}function Ff(l,u,g,b){return b!==null&&hv(b),nc(u,l.child,null,g),l=Fv(u,u.pendingProps.children),l.flags|=2,u.memoizedState=null,l}function XR(l,u,g,b,C,E,N){if(g)return u.flags&256?(u.flags&=-257,b=Av(Error(a(422))),Ff(l,u,N,b)):u.memoizedState!==null?(u.child=l.child,u.flags|=128,null):(E=b.fallback,C=u.mode,b=ip({mode:"visible",children:b.children},C,0,null),E=al(E,C,N,null),E.flags|=2,b.return=u,E.return=u,b.sibling=E,u.child=b,u.mode&1&&nc(u,l.child,null,N),u.child.memoizedState=Bv(N),u.memoizedState=Lv,E);if(!(u.mode&1))return Ff(l,u,N,null);if(ts(C))return b=Oa(C).digest,E=Error(a(419)),b=Av(E,b,void 0),Ff(l,u,N,b);if(g=(N&l.childLanes)!==0,So||g){if(b=Yr,b!==null){switch(N&-N){case 4:C=2;break;case 16:C=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:C=32;break;case 536870912:C=268435456;break;default:C=0}C=C&(b.suspendedLanes|N)?0:C,C!==0&&C!==E.retryLane&&(E.retryLane=C,aa(l,C),is(b,l,C,-1))}return i0(),b=Av(Error(a(421))),Ff(l,u,N,b)}return $r(C)?(u.flags|=128,u.child=l.child,u=c8.bind(null,l),ui(C,u),null):(l=E.treeContext,ke&&(rs=ve(C),Ho=u,cr=!0,Ts=null,ju=!1,l!==null&&(ho[mo++]=Fo,ho[mo++]=to,ho[mo++]=ns,Fo=l.id,to=l.overflow,ns=u)),u=Fv(u,b.children),u.flags|=4096,u)}function uw(l,u,g){l.lanes|=u;var b=l.alternate;b!==null&&(b.lanes|=u),yv(l.return,u,g)}function Hv(l,u,g,b,C){var E=l.memoizedState;E===null?l.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:b,tail:g,tailMode:C}:(E.isBackwards=u,E.rendering=null,E.renderingStartTime=0,E.last=b,E.tail=g,E.tailMode=C)}function dw(l,u,g){var b=u.pendingProps,C=b.revealOrder,E=b.tail;if(go(l,u,b.children,g),b=br.current,b&2)b=b&1|2,u.flags|=128;else{if(l!==null&&l.flags&128)e:for(l=u.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&uw(l,g,u);else if(l.tag===19)uw(l,g,u);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===u)break e;for(;l.sibling===null;){if(l.return===null||l.return===u)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}b&=1}if(qt(br,b),!(u.mode&1))u.memoizedState=null;else switch(C){case"forwards":for(g=u.child,C=null;g!==null;)l=g.alternate,l!==null&&Af(l)===null&&(C=g),g=g.sibling;g=C,g===null?(C=u.child,u.child=null):(C=g.sibling,g.sibling=null),Hv(u,!1,C,g,E);break;case"backwards":for(g=null,C=u.child,u.child=null;C!==null;){if(l=C.alternate,l!==null&&Af(l)===null){u.child=C;break}l=C.sibling,C.sibling=g,g=C,C=l}Hv(u,!0,g,null,E);break;case"together":Hv(u,!1,null,null,void 0);break;default:u.memoizedState=null}return u.child}function Hf(l,u){!(u.mode&1)&&l!==null&&(l.alternate=null,u.alternate=null,u.flags|=2)}function Da(l,u,g){if(l!==null&&(u.dependencies=l.dependencies),nl|=u.lanes,!(g&u.childLanes))return null;if(l!==null&&u.child!==l.child)throw Error(a(153));if(u.child!==null){for(l=u.child,g=yi(l,l.pendingProps),u.child=g,g.return=u;l.sibling!==null;)l=l.sibling,g=g.sibling=yi(l,l.pendingProps),g.return=u;g.sibling=null}return u.child}function ZR(l,u,g){switch(u.tag){case 3:iw(u),Jl();break;case 5:E2(u);break;case 1:ir(u.type)&&lr(u);break;case 4:Cv(u,u.stateNode.containerInfo);break;case 10:g2(u,u.type._context,u.memoizedProps.value);break;case 13:var b=u.memoizedState;if(b!==null)return b.dehydrated!==null?(qt(br,br.current&1),u.flags|=128,null):g&u.child.childLanes?cw(l,u,g):(qt(br,br.current&1),l=Da(l,u,g),l!==null?l.sibling:null);qt(br,br.current&1);break;case 19:if(b=(g&u.childLanes)!==0,l.flags&128){if(b)return dw(l,u,g);u.flags|=128}var C=u.memoizedState;if(C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),qt(br,br.current),b)break;return null;case 22:case 23:return u.lanes=0,ow(l,u,g)}return Da(l,u,g)}function ca(l){l.flags|=4}function fw(l,u){if(l!==null&&l.child===u.child)return!0;if(u.flags&16)return!1;for(l=u.child;l!==null;){if(l.flags&12854||l.subtreeFlags&12854)return!1;l=l.sibling}return!0}var Au,Nu,Vf,Wf;if(ue)Au=function(l,u){for(var g=u.child;g!==null;){if(g.tag===5||g.tag===6)fe(l,g.stateNode);else if(g.tag!==4&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===u)break;for(;g.sibling===null;){if(g.return===null||g.return===u)return;g=g.return}g.sibling.return=g.return,g=g.sibling}},Nu=function(){},Vf=function(l,u,g,b,C){if(l=l.memoizedProps,l!==b){var E=u.stateNode,N=ia(ss.current);g=J(E,g,l,b,C,N),(u.updateQueue=g)&&ca(u)}},Wf=function(l,u,g,b){g!==b&&ca(u)};else if(be){Au=function(l,u,g,b){for(var C=u.child;C!==null;){if(C.tag===5){var E=C.stateNode;g&&b&&(E=Jo(E,C.type,C.memoizedProps,C)),fe(l,E)}else if(C.tag===6)E=C.stateNode,g&&b&&(E=es(E,C.memoizedProps,C)),fe(l,E);else if(C.tag!==4){if(C.tag===22&&C.memoizedState!==null)E=C.child,E!==null&&(E.return=C),Au(l,C,!0,!0);else if(C.child!==null){C.child.return=C,C=C.child;continue}}if(C===u)break;for(;C.sibling===null;){if(C.return===null||C.return===u)return;C=C.return}C.sibling.return=C.return,C=C.sibling}};var pw=function(l,u,g,b){for(var C=u.child;C!==null;){if(C.tag===5){var E=C.stateNode;g&&b&&(E=Jo(E,C.type,C.memoizedProps,C)),Fn(l,E)}else if(C.tag===6)E=C.stateNode,g&&b&&(E=es(E,C.memoizedProps,C)),Fn(l,E);else if(C.tag!==4){if(C.tag===22&&C.memoizedState!==null)E=C.child,E!==null&&(E.return=C),pw(l,C,!0,!0);else if(C.child!==null){C.child.return=C,C=C.child;continue}}if(C===u)break;for(;C.sibling===null;){if(C.return===null||C.return===u)return;C=C.return}C.sibling.return=C.return,C=C.sibling}};Nu=function(l,u){var g=u.stateNode;if(!fw(l,u)){l=g.containerInfo;var b=$n(l);pw(b,u,!1,!1),g.pendingChildren=b,ca(u),Es(l,b)}},Vf=function(l,u,g,b,C){var E=l.stateNode,N=l.memoizedProps;if((l=fw(l,u))&&N===b)u.stateNode=E;else{var Q=u.stateNode,he=ia(ss.current),Be=null;N!==b&&(Be=J(Q,g,N,b,C,he)),l&&Be===null?u.stateNode=E:(E=Tr(E,Be,g,N,b,u,l,Q),ae(E,g,b,C,he)&&ca(u),u.stateNode=E,l?ca(u):Au(E,u,!1,!1))}},Wf=function(l,u,g,b){g!==b?(l=ia(rc.current),g=ia(ss.current),u.stateNode=oe(b,l,g,u),ca(u)):u.stateNode=l.stateNode}}else Nu=function(){},Vf=function(){},Wf=function(){};function zu(l,u){if(!cr)switch(l.tailMode){case"hidden":u=l.tail;for(var g=null;u!==null;)u.alternate!==null&&(g=u),u=u.sibling;g===null?l.tail=null:g.sibling=null;break;case"collapsed":g=l.tail;for(var b=null;g!==null;)g.alternate!==null&&(b=g),g=g.sibling;b===null?u||l.tail===null?l.tail=null:l.tail.sibling=null:b.sibling=null}}function ro(l){var u=l.alternate!==null&&l.alternate.child===l.child,g=0,b=0;if(u)for(var C=l.child;C!==null;)g|=C.lanes|C.childLanes,b|=C.subtreeFlags&14680064,b|=C.flags&14680064,C.return=l,C=C.sibling;else for(C=l.child;C!==null;)g|=C.lanes|C.childLanes,b|=C.subtreeFlags,b|=C.flags,C.return=l,C=C.sibling;return l.subtreeFlags|=b,l.childLanes=g,u}function QR(l,u,g){var b=u.pendingProps;switch(dv(u),u.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ro(u),null;case 1:return ir(u.type)&&Tt(),ro(u),null;case 3:return g=u.stateNode,oc(),Ft(dn),Ft(tn),Pv(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(l===null||l.child===null)&&(jf(u)?ca(u):l===null||l.memoizedState.isDehydrated&&!(u.flags&256)||(u.flags|=1024,Ts!==null&&(s0(Ts),Ts=null))),Nu(l,u),ro(u),null;case 5:_v(u),g=ia(rc.current);var C=u.type;if(l!==null&&u.stateNode!=null)Vf(l,u,C,b,g),l.ref!==u.ref&&(u.flags|=512,u.flags|=2097152);else{if(!b){if(u.stateNode===null)throw Error(a(166));return ro(u),null}if(l=ia(ss.current),jf(u)){if(!ke)throw Error(a(175));l=Se(u.stateNode,u.type,u.memoizedProps,g,l,u,!ju),u.updateQueue=l,l!==null&&ca(u)}else{var E=te(C,b,g,l,u);Au(E,u,!1,!1),u.stateNode=E,ae(E,C,b,g,l)&&ca(u)}u.ref!==null&&(u.flags|=512,u.flags|=2097152)}return ro(u),null;case 6:if(l&&u.stateNode!=null)Wf(l,u,l.memoizedProps,b);else{if(typeof b!="string"&&u.stateNode===null)throw Error(a(166));if(l=ia(rc.current),g=ia(ss.current),jf(u)){if(!ke)throw Error(a(176));if(l=u.stateNode,g=u.memoizedProps,(b=_e(l,g,u,!ju))&&(C=Ho,C!==null))switch(C.tag){case 3:Ze(C.stateNode.containerInfo,l,g,(C.mode&1)!==0);break;case 5:Ot(C.type,C.memoizedProps,C.stateNode,l,g,(C.mode&1)!==0)}b&&ca(u)}else u.stateNode=oe(b,l,g,u)}return ro(u),null;case 13:if(Ft(br),b=u.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(cr&&rs!==null&&u.mode&1&&!(u.flags&128))m2(),Jl(),u.flags|=98560,C=!1;else if(C=jf(u),b!==null&&b.dehydrated!==null){if(l===null){if(!C)throw Error(a(318));if(!ke)throw Error(a(344));if(C=u.memoizedState,C=C!==null?C.dehydrated:null,!C)throw Error(a(317));rt(C,u)}else Jl(),!(u.flags&128)&&(u.memoizedState=null),u.flags|=4;ro(u),C=!1}else Ts!==null&&(s0(Ts),Ts=null),C=!0;if(!C)return u.flags&65536?u:null}return u.flags&128?(u.lanes=g,u):(g=b!==null,g!==(l!==null&&l.memoizedState!==null)&&g&&(u.child.flags|=8192,u.mode&1&&(l===null||br.current&1?Hr===0&&(Hr=3):i0())),u.updateQueue!==null&&(u.flags|=4),ro(u),null);case 4:return oc(),Nu(l,u),l===null&&Pe(u.stateNode.containerInfo),ro(u),null;case 10:return vv(u.type._context),ro(u),null;case 17:return ir(u.type)&&Tt(),ro(u),null;case 19:if(Ft(br),C=u.memoizedState,C===null)return ro(u),null;if(b=(u.flags&128)!==0,E=C.rendering,E===null)if(b)zu(C,!1);else{if(Hr!==0||l!==null&&l.flags&128)for(l=u.child;l!==null;){if(E=Af(l),E!==null){for(u.flags|=128,zu(C,!1),l=E.updateQueue,l!==null&&(u.updateQueue=l,u.flags|=4),u.subtreeFlags=0,l=g,g=u.child;g!==null;)b=g,C=l,b.flags&=14680066,E=b.alternate,E===null?(b.childLanes=0,b.lanes=C,b.child=null,b.subtreeFlags=0,b.memoizedProps=null,b.memoizedState=null,b.updateQueue=null,b.dependencies=null,b.stateNode=null):(b.childLanes=E.childLanes,b.lanes=E.lanes,b.child=E.child,b.subtreeFlags=0,b.deletions=null,b.memoizedProps=E.memoizedProps,b.memoizedState=E.memoizedState,b.updateQueue=E.updateQueue,b.type=E.type,C=E.dependencies,b.dependencies=C===null?null:{lanes:C.lanes,firstContext:C.firstContext}),g=g.sibling;return qt(br,br.current&1|2),u.child}l=l.sibling}C.tail!==null&&Ue()>t0&&(u.flags|=128,b=!0,zu(C,!1),u.lanes=4194304)}else{if(!b)if(l=Af(E),l!==null){if(u.flags|=128,b=!0,l=l.updateQueue,l!==null&&(u.updateQueue=l,u.flags|=4),zu(C,!0),C.tail===null&&C.tailMode==="hidden"&&!E.alternate&&!cr)return ro(u),null}else 2*Ue()-C.renderingStartTime>t0&&g!==1073741824&&(u.flags|=128,b=!0,zu(C,!1),u.lanes=4194304);C.isBackwards?(E.sibling=u.child,u.child=E):(l=C.last,l!==null?l.sibling=E:u.child=E,C.last=E)}return C.tail!==null?(u=C.tail,C.rendering=u,C.tail=u.sibling,C.renderingStartTime=Ue(),u.sibling=null,l=br.current,qt(br,b?l&1|2:l&1),u):(ro(u),null);case 22:case 23:return a0(),g=u.memoizedState!==null,l!==null&&l.memoizedState!==null!==g&&(u.flags|=8192),g&&u.mode&1?Vo&1073741824&&(ro(u),ue&&u.subtreeFlags&6&&(u.flags|=8192)):ro(u),null;case 24:return null;case 25:return null}throw Error(a(156,u.tag))}function JR(l,u){switch(dv(u),u.tag){case 1:return ir(u.type)&&Tt(),l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 3:return oc(),Ft(dn),Ft(tn),Pv(),l=u.flags,l&65536&&!(l&128)?(u.flags=l&-65537|128,u):null;case 5:return _v(u),null;case 13:if(Ft(br),l=u.memoizedState,l!==null&&l.dehydrated!==null){if(u.alternate===null)throw Error(a(340));Jl()}return l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 19:return Ft(br),null;case 4:return oc(),null;case 10:return vv(u.type._context),null;case 22:case 23:return a0(),null;case 24:return null;default:return null}}var Uf=!1,oo=!1,e8=typeof WeakSet=="function"?WeakSet:Set,bt=null;function ac(l,u){var g=l.ref;if(g!==null)if(typeof g=="function")try{g(null)}catch(b){ur(l,u,b)}else g.current=null}function Vv(l,u,g){try{g()}catch(b){ur(l,u,b)}}var hw=!1;function t8(l,u){for(V(l.containerInfo),bt=u;bt!==null;)if(l=bt,u=l.child,(l.subtreeFlags&1028)!==0&&u!==null)u.return=l,bt=u;else for(;bt!==null;){l=bt;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 b=g.memoizedProps,C=g.memoizedState,E=l.stateNode,N=E.getSnapshotBeforeUpdate(l.elementType===l.type?b:Rs(l.type,b),C);E.__reactInternalSnapshotBeforeUpdate=N}break;case 3:ue&&mn(l.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(a(163))}}catch(Q){ur(l,l.return,Q)}if(u=l.sibling,u!==null){u.return=l.return,bt=u;break}bt=l.return}return g=hw,hw=!1,g}function $u(l,u,g){var b=u.updateQueue;if(b=b!==null?b.lastEffect:null,b!==null){var C=b=b.next;do{if((C.tag&l)===l){var E=C.destroy;C.destroy=void 0,E!==void 0&&Vv(u,g,E)}C=C.next}while(C!==b)}}function Gf(l,u){if(u=u.updateQueue,u=u!==null?u.lastEffect:null,u!==null){var g=u=u.next;do{if((g.tag&l)===l){var b=g.create;g.destroy=b()}g=g.next}while(g!==u)}}function Wv(l){var u=l.ref;if(u!==null){var g=l.stateNode;switch(l.tag){case 5:l=q(g);break;default:l=g}typeof u=="function"?u(l):u.current=l}}function mw(l){var u=l.alternate;u!==null&&(l.alternate=null,mw(u)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(u=l.stateNode,u!==null&&Ae(u)),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 gw(l){return l.tag===5||l.tag===3||l.tag===4}function vw(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||gw(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 Uv(l,u,g){var b=l.tag;if(b===5||b===6)l=l.stateNode,u?Cn(g,l,u):lt(g,l);else if(b!==4&&(l=l.child,l!==null))for(Uv(l,u,g),l=l.sibling;l!==null;)Uv(l,u,g),l=l.sibling}function Gv(l,u,g){var b=l.tag;if(b===5||b===6)l=l.stateNode,u?Ke(g,l,u):ye(g,l);else if(b!==4&&(l=l.child,l!==null))for(Gv(l,u,g),l=l.sibling;l!==null;)Gv(l,u,g),l=l.sibling}var Zr=null,Ms=!1;function ua(l,u,g){for(g=g.child;g!==null;)qv(l,u,g),g=g.sibling}function qv(l,u,g){if(Sn&&typeof Sn.onCommitFiberUnmount=="function")try{Sn.onCommitFiberUnmount(nr,g)}catch{}switch(g.tag){case 5:oo||ac(g,u);case 6:if(ue){var b=Zr,C=Ms;Zr=null,ua(l,u,g),Zr=b,Ms=C,Zr!==null&&(Ms?qe(Zr,g.stateNode):Ee(Zr,g.stateNode))}else ua(l,u,g);break;case 18:ue&&Zr!==null&&(Ms?tt(Zr,g.stateNode):Xe(Zr,g.stateNode));break;case 4:ue?(b=Zr,C=Ms,Zr=g.stateNode.containerInfo,Ms=!0,ua(l,u,g),Zr=b,Ms=C):(be&&(b=g.stateNode.containerInfo,C=$n(b),_n(b,C)),ua(l,u,g));break;case 0:case 11:case 14:case 15:if(!oo&&(b=g.updateQueue,b!==null&&(b=b.lastEffect,b!==null))){C=b=b.next;do{var E=C,N=E.destroy;E=E.tag,N!==void 0&&(E&2||E&4)&&Vv(g,u,N),C=C.next}while(C!==b)}ua(l,u,g);break;case 1:if(!oo&&(ac(g,u),b=g.stateNode,typeof b.componentWillUnmount=="function"))try{b.props=g.memoizedProps,b.state=g.memoizedState,b.componentWillUnmount()}catch(Q){ur(g,u,Q)}ua(l,u,g);break;case 21:ua(l,u,g);break;case 22:g.mode&1?(oo=(b=oo)||g.memoizedState!==null,ua(l,u,g),oo=b):ua(l,u,g);break;default:ua(l,u,g)}}function yw(l){var u=l.updateQueue;if(u!==null){l.updateQueue=null;var g=l.stateNode;g===null&&(g=l.stateNode=new e8),u.forEach(function(b){var C=u8.bind(null,l,b);g.has(b)||(g.add(b),b.then(C,C))})}}function Ds(l,u){var g=u.deletions;if(g!==null)for(var b=0;b<g.length;b++){var C=g[b];try{var E=l,N=u;if(ue){var Q=N;e:for(;Q!==null;){switch(Q.tag){case 5:Zr=Q.stateNode,Ms=!1;break e;case 3:Zr=Q.stateNode.containerInfo,Ms=!0;break e;case 4:Zr=Q.stateNode.containerInfo,Ms=!0;break e}Q=Q.return}if(Zr===null)throw Error(a(160));qv(E,N,C),Zr=null,Ms=!1}else qv(E,N,C);var he=C.alternate;he!==null&&(he.return=null),C.return=null}catch(Be){ur(C,u,Be)}}if(u.subtreeFlags&12854)for(u=u.child;u!==null;)bw(u,l),u=u.sibling}function bw(l,u){var g=l.alternate,b=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:if(Ds(u,l),da(l),b&4){try{$u(3,l,l.return),Gf(3,l)}catch(dt){ur(l,l.return,dt)}try{$u(5,l,l.return)}catch(dt){ur(l,l.return,dt)}}break;case 1:Ds(u,l),da(l),b&512&&g!==null&&ac(g,g.return);break;case 5:if(Ds(u,l),da(l),b&512&&g!==null&&ac(g,g.return),ue){if(l.flags&32){var C=l.stateNode;try{pt(C)}catch(dt){ur(l,l.return,dt)}}if(b&4&&(C=l.stateNode,C!=null)){var E=l.memoizedProps;if(g=g!==null?g.memoizedProps:E,b=l.type,u=l.updateQueue,l.updateQueue=null,u!==null)try{$e(C,u,b,g,E,l)}catch(dt){ur(l,l.return,dt)}}}break;case 6:if(Ds(u,l),da(l),b&4&&ue){if(l.stateNode===null)throw Error(a(162));C=l.stateNode,E=l.memoizedProps,g=g!==null?g.memoizedProps:E;try{It(C,g,E)}catch(dt){ur(l,l.return,dt)}}break;case 3:if(Ds(u,l),da(l),b&4){if(ue&&ke&&g!==null&&g.memoizedState.isDehydrated)try{Gt(u.containerInfo)}catch(dt){ur(l,l.return,dt)}if(be){C=u.containerInfo,E=u.pendingChildren;try{_n(C,E)}catch(dt){ur(l,l.return,dt)}}}break;case 4:if(Ds(u,l),da(l),b&4&&be){E=l.stateNode,C=E.containerInfo,E=E.pendingChildren;try{_n(C,E)}catch(dt){ur(l,l.return,dt)}}break;case 13:Ds(u,l),da(l),C=l.child,C.flags&8192&&(E=C.memoizedState!==null,C.stateNode.isHidden=E,!E||C.alternate!==null&&C.alternate.memoizedState!==null||(e0=Ue())),b&4&&yw(l);break;case 22:var N=g!==null&&g.memoizedState!==null;if(l.mode&1?(oo=(g=oo)||N,Ds(u,l),oo=g):Ds(u,l),da(l),b&8192){if(g=l.memoizedState!==null,(l.stateNode.isHidden=g)&&!N&&l.mode&1)for(bt=l,b=l.child;b!==null;){for(u=bt=b;bt!==null;){N=bt;var Q=N.child;switch(N.tag){case 0:case 11:case 14:case 15:$u(4,N,N.return);break;case 1:ac(N,N.return);var he=N.stateNode;if(typeof he.componentWillUnmount=="function"){var Be=N,wt=N.return;try{var Qt=Be;he.props=Qt.memoizedProps,he.state=Qt.memoizedState,he.componentWillUnmount()}catch(dt){ur(Be,wt,dt)}}break;case 5:ac(N,N.return);break;case 22:if(N.memoizedState!==null){Sw(u);continue}}Q!==null?(Q.return=N,bt=Q):Sw(u)}b=b.sibling}if(ue){e:if(b=null,ue)for(u=l;;){if(u.tag===5){if(b===null){b=u;try{C=u.stateNode,g?gt(C):yr(u.stateNode,u.memoizedProps)}catch(dt){ur(l,l.return,dt)}}}else if(u.tag===6){if(b===null)try{E=u.stateNode,g?Ht(E):hn(E,u.memoizedProps)}catch(dt){ur(l,l.return,dt)}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===l)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===l)break e;for(;u.sibling===null;){if(u.return===null||u.return===l)break e;b===u&&(b=null),u=u.return}b===u&&(b=null),u.sibling.return=u.return,u=u.sibling}}}break;case 19:Ds(u,l),da(l),b&4&&yw(l);break;case 21:break;default:Ds(u,l),da(l)}}function da(l){var u=l.flags;if(u&2){try{if(ue){e:{for(var g=l.return;g!==null;){if(gw(g)){var b=g;break e}g=g.return}throw Error(a(160))}switch(b.tag){case 5:var C=b.stateNode;b.flags&32&&(pt(C),b.flags&=-33);var E=vw(l);Gv(l,E,C);break;case 3:case 4:var N=b.stateNode.containerInfo,Q=vw(l);Uv(l,Q,N);break;default:throw Error(a(161))}}}catch(he){ur(l,l.return,he)}l.flags&=-3}u&4096&&(l.flags&=-4097)}function n8(l,u,g){bt=l,xw(l)}function xw(l,u,g){for(var b=(l.mode&1)!==0;bt!==null;){var C=bt,E=C.child;if(C.tag===22&&b){var N=C.memoizedState!==null||Uf;if(!N){var Q=C.alternate,he=Q!==null&&Q.memoizedState!==null||oo;Q=Uf;var Be=oo;if(Uf=N,(oo=he)&&!Be)for(bt=C;bt!==null;)N=bt,he=N.child,N.tag===22&&N.memoizedState!==null?Cw(C):he!==null?(he.return=N,bt=he):Cw(C);for(;E!==null;)bt=E,xw(E),E=E.sibling;bt=C,Uf=Q,oo=Be}ww(l)}else C.subtreeFlags&8772&&E!==null?(E.return=C,bt=E):ww(l)}}function ww(l){for(;bt!==null;){var u=bt;if(u.flags&8772){var g=u.alternate;try{if(u.flags&8772)switch(u.tag){case 0:case 11:case 15:oo||Gf(5,u);break;case 1:var b=u.stateNode;if(u.flags&4&&!oo)if(g===null)b.componentDidMount();else{var C=u.elementType===u.type?g.memoizedProps:Rs(u.type,g.memoizedProps);b.componentDidUpdate(C,g.memoizedState,b.__reactInternalSnapshotBeforeUpdate)}var E=u.updateQueue;E!==null&&x2(u,E,b);break;case 3:var N=u.updateQueue;if(N!==null){if(g=null,u.child!==null)switch(u.child.tag){case 5:g=q(u.child.stateNode);break;case 1:g=u.child.stateNode}x2(u,N,g)}break;case 5:var Q=u.stateNode;g===null&&u.flags&4&&Xt(Q,u.type,u.memoizedProps,u);break;case 6:break;case 4:break;case 12:break;case 13:if(ke&&u.memoizedState===null){var he=u.alternate;if(he!==null){var Be=he.memoizedState;if(Be!==null){var wt=Be.dehydrated;wt!==null&&yt(wt)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(a(163))}oo||u.flags&512&&Wv(u)}catch(Qt){ur(u,u.return,Qt)}}if(u===l){bt=null;break}if(g=u.sibling,g!==null){g.return=u.return,bt=g;break}bt=u.return}}function Sw(l){for(;bt!==null;){var u=bt;if(u===l){bt=null;break}var g=u.sibling;if(g!==null){g.return=u.return,bt=g;break}bt=u.return}}function Cw(l){for(;bt!==null;){var u=bt;try{switch(u.tag){case 0:case 11:case 15:var g=u.return;try{Gf(4,u)}catch(he){ur(u,g,he)}break;case 1:var b=u.stateNode;if(typeof b.componentDidMount=="function"){var C=u.return;try{b.componentDidMount()}catch(he){ur(u,C,he)}}var E=u.return;try{Wv(u)}catch(he){ur(u,E,he)}break;case 5:var N=u.return;try{Wv(u)}catch(he){ur(u,N,he)}}}catch(he){ur(u,u.return,he)}if(u===l){bt=null;break}var Q=u.sibling;if(Q!==null){Q.return=u.return,bt=Q;break}bt=u.return}}var qf=0,Yf=1,Kf=2,Xf=3,Zf=4;if(typeof Symbol=="function"&&Symbol.for){var Lu=Symbol.for;qf=Lu("selector.component"),Yf=Lu("selector.has_pseudo_class"),Kf=Lu("selector.role"),Xf=Lu("selector.test_id"),Zf=Lu("selector.text")}function Yv(l){var u=ie(l);if(u!=null){if(typeof u.memoizedProps["data-testname"]!="string")throw Error(a(364));return u}if(l=yn(l),l===null)throw Error(a(362));return l.stateNode.current}function Kv(l,u){switch(u.$$typeof){case qf:if(l.type===u.value)return!0;break;case Yf:e:{u=u.value,l=[l,0];for(var g=0;g<l.length;){var b=l[g++],C=l[g++],E=u[C];if(b.tag!==5||!ne(b)){for(;E!=null&&Kv(b,E);)C++,E=u[C];if(C===u.length){u=!0;break e}else for(b=b.child;b!==null;)l.push(b,C),b=b.sibling}}u=!1}return u;case Kf:if(l.tag===5&&me(l.stateNode,u.value))return!0;break;case Zf:if((l.tag===5||l.tag===6)&&(l=Ce(l),l!==null&&0<=l.indexOf(u.value)))return!0;break;case Xf:if(l.tag===5&&(l=l.memoizedProps["data-testname"],typeof l=="string"&&l.toLowerCase()===u.value.toLowerCase()))return!0;break;default:throw Error(a(365))}return!1}function Xv(l){switch(l.$$typeof){case qf:return"<"+(T(l.value)||"Unknown")+">";case Yf:return":has("+(Xv(l)||"")+")";case Kf:return'[role="'+l.value+'"]';case Zf:return'"'+l.value+'"';case Xf:return'[data-testname="'+l.value+'"]';default:throw Error(a(365))}}function _w(l,u){var g=[];l=[l,0];for(var b=0;b<l.length;){var C=l[b++],E=l[b++],N=u[E];if(C.tag!==5||!ne(C)){for(;N!=null&&Kv(C,N);)E++,N=u[E];if(E===u.length)g.push(C);else for(C=C.child;C!==null;)l.push(C,E),C=C.sibling}}return g}function Zv(l,u){if(!ft)throw Error(a(363));l=Yv(l),l=_w(l,u),u=[],l=Array.from(l);for(var g=0;g<l.length;){var b=l[g++];if(b.tag===5)ne(b)||u.push(b.stateNode);else for(b=b.child;b!==null;)l.push(b),b=b.sibling}return u}var r8=Math.ceil,Qf=c.ReactCurrentDispatcher,Qv=c.ReactCurrentOwner,Ir=c.ReactCurrentBatchConfig,fn=0,Yr=null,Rr=null,Qr=0,Vo=0,ic=Bt(0),Hr=0,Bu=null,nl=0,Jf=0,Jv=0,Fu=null,Co=null,e0=0,t0=1/0,Aa=null;function lc(){t0=Ue()+500}var ep=!1,n0=null,hi=null,tp=!1,mi=null,np=0,Hu=0,r0=null,rp=-1,op=0;function so(){return fn&6?Ue():rp!==-1?rp:rp=Ue()}function gi(l){return l.mode&1?fn&2&&Qr!==0?Qr&-Qr:LR.transition!==null?(op===0&&(op=_t()),op):(l=Te,l!==0?l:Je()):1}function is(l,u,g,b){if(50<Hu)throw Hu=0,r0=null,Error(a(185));xt(l,g,b),(!(fn&2)||l!==Yr)&&(l===Yr&&(!(fn&2)&&(Jf|=g),Hr===4&&vi(l,Qr)),_o(l,b),g===1&&fn===0&&!(u.mode&1)&&(lc(),Xr&&Bo()))}function _o(l,u){var g=l.callbackNode;Pt(l,u);var b=Qe(l,l===Yr?Qr:0);if(b===0)g!==null&&ot(g),l.callbackNode=null,l.callbackPriority=0;else if(u=b&-b,l.callbackPriority!==u){if(g!=null&&ot(g),u===1)l.tag===0?Pf(Pw.bind(null,l)):di(Pw.bind(null,l)),Ve?kt(function(){!(fn&6)&&Bo()}):We(rn,Bo),g=null;else{switch(Le(b)){case 1:g=rn;break;case 4:g=En;break;case 16:g=wn;break;case 536870912:g=kr;break;default:g=wn}g=Aw(g,kw.bind(null,l))}l.callbackPriority=u,l.callbackNode=g}}function kw(l,u){if(rp=-1,op=0,fn&6)throw Error(a(327));var g=l.callbackNode;if(sl()&&l.callbackNode!==g)return null;var b=Qe(l,l===Yr?Qr:0);if(b===0)return null;if(b&30||b&l.expiredLanes||u)u=sp(l,b);else{u=b;var C=fn;fn|=2;var E=Iw();(Yr!==l||Qr!==u)&&(Aa=null,lc(),rl(l,u));do try{a8();break}catch(Q){Ew(l,Q)}while(1);gv(),Qf.current=E,fn=C,Rr!==null?u=0:(Yr=null,Qr=0,u=Hr)}if(u!==0){if(u===2&&(C=ct(l),C!==0&&(b=C,u=o0(l,C))),u===1)throw g=Bu,rl(l,0),vi(l,b),_o(l,Ue()),g;if(u===6)vi(l,b);else{if(C=l.current.alternate,!(b&30)&&!o8(C)&&(u=sp(l,b),u===2&&(E=ct(l),E!==0&&(b=E,u=o0(l,E))),u===1))throw g=Bu,rl(l,0),vi(l,b),_o(l,Ue()),g;switch(l.finishedWork=C,l.finishedLanes=b,u){case 0:case 1:throw Error(a(345));case 2:ol(l,Co,Aa);break;case 3:if(vi(l,b),(b&130023424)===b&&(u=e0+500-Ue(),10<u)){if(Qe(l,0)!==0)break;if(C=l.suspendedLanes,(C&b)!==b){so(),l.pingedLanes|=l.suspendedLanes&C;break}l.timeoutHandle=le(ol.bind(null,l,Co,Aa),u);break}ol(l,Co,Aa);break;case 4:if(vi(l,b),(b&4194240)===b)break;for(u=l.eventTimes,C=-1;0<b;){var N=31-Un(b);E=1<<N,N=u[N],N>C&&(C=N),b&=~E}if(b=C,b=Ue()-b,b=(120>b?120:480>b?480:1080>b?1080:1920>b?1920:3e3>b?3e3:4320>b?4320:1960*r8(b/1960))-b,10<b){l.timeoutHandle=le(ol.bind(null,l,Co,Aa),b);break}ol(l,Co,Aa);break;case 5:ol(l,Co,Aa);break;default:throw Error(a(329))}}}return _o(l,Ue()),l.callbackNode===g?kw.bind(null,l):null}function o0(l,u){var g=Fu;return l.current.memoizedState.isDehydrated&&(rl(l,u).flags|=256),l=sp(l,u),l!==2&&(u=Co,Co=g,u!==null&&s0(u)),l}function s0(l){Co===null?Co=l:Co.push.apply(Co,l)}function o8(l){for(var u=l;;){if(u.flags&16384){var g=u.updateQueue;if(g!==null&&(g=g.stores,g!==null))for(var b=0;b<g.length;b++){var C=g[b],E=C.getSnapshot;C=C.value;try{if(!xn(E(),C))return!1}catch{return!1}}}if(g=u.child,u.subtreeFlags&16384&&g!==null)g.return=u,u=g;else{if(u===l)break;for(;u.sibling===null;){if(u.return===null||u.return===l)return!0;u=u.return}u.sibling.return=u.return,u=u.sibling}}return!0}function vi(l,u){for(u&=~Jv,u&=~Jf,l.suspendedLanes|=u,l.pingedLanes&=~u,l=l.expirationTimes;0<u;){var g=31-Un(u),b=1<<g;l[g]=-1,u&=~b}}function Pw(l){if(fn&6)throw Error(a(327));sl();var u=Qe(l,0);if(!(u&1))return _o(l,Ue()),null;var g=sp(l,u);if(l.tag!==0&&g===2){var b=ct(l);b!==0&&(u=b,g=o0(l,b))}if(g===1)throw g=Bu,rl(l,0),vi(l,u),_o(l,Ue()),g;if(g===6)throw Error(a(345));return l.finishedWork=l.current.alternate,l.finishedLanes=u,ol(l,Co,Aa),_o(l,Ue()),null}function jw(l){mi!==null&&mi.tag===0&&!(fn&6)&&sl();var u=fn;fn|=1;var g=Ir.transition,b=Te;try{if(Ir.transition=null,Te=1,l)return l()}finally{Te=b,Ir.transition=g,fn=u,!(fn&6)&&Bo()}}function a0(){Vo=ic.current,Ft(ic)}function rl(l,u){l.finishedWork=null,l.finishedLanes=0;var g=l.timeoutHandle;if(g!==se&&(l.timeoutHandle=se,ge(g)),Rr!==null)for(g=Rr.return;g!==null;){var b=g;switch(dv(b),b.tag){case 1:b=b.type.childContextTypes,b!=null&&Tt();break;case 3:oc(),Ft(dn),Ft(tn),Pv();break;case 5:_v(b);break;case 4:oc();break;case 13:Ft(br);break;case 19:Ft(br);break;case 10:vv(b.type._context);break;case 22:case 23:a0()}g=g.return}if(Yr=l,Rr=l=yi(l.current,null),Qr=Vo=u,Hr=0,Bu=null,Jv=Jf=nl=0,Co=Fu=null,el!==null){for(u=0;u<el.length;u++)if(g=el[u],b=g.interleaved,b!==null){g.interleaved=null;var C=b.next,E=g.pending;if(E!==null){var N=E.next;E.next=C,b.next=N}g.pending=b}el=null}return l}function Ew(l,u){do{var g=Rr;try{if(gv(),Nf.current=Bf,zf){for(var b=xr.memoizedState;b!==null;){var C=b.queue;C!==null&&(C.pending=null),b=b.next}zf=!1}if(tl=0,qr=Fr=xr=null,Tu=!1,Ru=0,Qv.current=null,g===null||g.return===null){Hr=1,Bu=u,Rr=null;break}e:{var E=l,N=g.return,Q=g,he=u;if(u=Qr,Q.flags|=32768,he!==null&&typeof he=="object"&&typeof he.then=="function"){var Be=he,wt=Q,Qt=wt.tag;if(!(wt.mode&1)&&(Qt===0||Qt===11||Qt===15)){var dt=wt.alternate;dt?(wt.updateQueue=dt.updateQueue,wt.memoizedState=dt.memoizedState,wt.lanes=dt.lanes):(wt.updateQueue=null,wt.memoizedState=null)}var rr=J2(N);if(rr!==null){rr.flags&=-257,ew(rr,N,Q,E,u),rr.mode&1&&Q2(E,Be,u),u=rr,he=Be;var Yn=u.updateQueue;if(Yn===null){var ko=new Set;ko.add(he),u.updateQueue=ko}else Yn.add(he);break e}else{if(!(u&1)){Q2(E,Be,u),i0();break e}he=Error(a(426))}}else if(cr&&Q.mode&1){var Na=J2(N);if(Na!==null){!(Na.flags&65536)&&(Na.flags|=256),ew(Na,N,Q,E,u),hv(sc(he,Q));break e}}E=he=sc(he,Q),Hr!==4&&(Hr=2),Fu===null?Fu=[E]:Fu.push(E),E=N;do{switch(E.tag){case 3:E.flags|=65536,u&=-u,E.lanes|=u;var de=X2(E,he,u);b2(E,de);break e;case 1:Q=he;var re=E.type,xe=E.stateNode;if(!(E.flags&128)&&(typeof re.getDerivedStateFromError=="function"||xe!==null&&typeof xe.componentDidCatch=="function"&&(hi===null||!hi.has(xe)))){E.flags|=65536,u&=-u,E.lanes|=u;var ht=Z2(E,Q,u);b2(E,ht);break e}}E=E.return}while(E!==null)}Tw(g)}catch(zt){u=zt,Rr===g&&g!==null&&(Rr=g=g.return);continue}break}while(1)}function Iw(){var l=Qf.current;return Qf.current=Bf,l===null?Bf:l}function i0(){(Hr===0||Hr===3||Hr===2)&&(Hr=4),Yr===null||!(nl&268435455)&&!(Jf&268435455)||vi(Yr,Qr)}function sp(l,u){var g=fn;fn|=2;var b=Iw();(Yr!==l||Qr!==u)&&(Aa=null,rl(l,u));do try{s8();break}catch(C){Ew(l,C)}while(1);if(gv(),fn=g,Qf.current=b,Rr!==null)throw Error(a(261));return Yr=null,Qr=0,Hr}function s8(){for(;Rr!==null;)Ow(Rr)}function a8(){for(;Rr!==null&&!At();)Ow(Rr)}function Ow(l){var u=Dw(l.alternate,l,Vo);l.memoizedProps=l.pendingProps,u===null?Tw(l):Rr=u,Qv.current=null}function Tw(l){var u=l;do{var g=u.alternate;if(l=u.return,u.flags&32768){if(g=JR(g,u),g!==null){g.flags&=32767,Rr=g;return}if(l!==null)l.flags|=32768,l.subtreeFlags=0,l.deletions=null;else{Hr=6,Rr=null;return}}else if(g=QR(g,u,Vo),g!==null){Rr=g;return}if(u=u.sibling,u!==null){Rr=u;return}Rr=u=l}while(u!==null);Hr===0&&(Hr=5)}function ol(l,u,g){var b=Te,C=Ir.transition;try{Ir.transition=null,Te=1,i8(l,u,g,b)}finally{Ir.transition=C,Te=b}return null}function i8(l,u,g,b){do sl();while(mi!==null);if(fn&6)throw Error(a(327));g=l.finishedWork;var C=l.finishedLanes;if(g===null)return null;if(l.finishedWork=null,l.finishedLanes=0,g===l.current)throw Error(a(177));l.callbackNode=null,l.callbackPriority=0;var E=g.lanes|g.childLanes;if(at(l,E),l===Yr&&(Rr=Yr=null,Qr=0),!(g.subtreeFlags&2064)&&!(g.flags&2064)||tp||(tp=!0,Aw(wn,function(){return sl(),null})),E=(g.flags&15990)!==0,g.subtreeFlags&15990||E){E=Ir.transition,Ir.transition=null;var N=Te;Te=1;var Q=fn;fn|=4,Qv.current=null,t8(l,g),bw(g,l),W(l.containerInfo),l.current=g,n8(g),Dt(),fn=Q,Te=N,Ir.transition=E}else l.current=g;if(tp&&(tp=!1,mi=l,np=C),E=l.pendingLanes,E===0&&(hi=null),tr(g.stateNode),_o(l,Ue()),u!==null)for(b=l.onRecoverableError,g=0;g<u.length;g++)C=u[g],b(C.value,{componentStack:C.stack,digest:C.digest});if(ep)throw ep=!1,l=n0,n0=null,l;return np&1&&l.tag!==0&&sl(),E=l.pendingLanes,E&1?l===r0?Hu++:(Hu=0,r0=l):Hu=0,Bo(),null}function sl(){if(mi!==null){var l=Le(np),u=Ir.transition,g=Te;try{if(Ir.transition=null,Te=16>l?16:l,mi===null)var b=!1;else{if(l=mi,mi=null,np=0,fn&6)throw Error(a(331));var C=fn;for(fn|=4,bt=l.current;bt!==null;){var E=bt,N=E.child;if(bt.flags&16){var Q=E.deletions;if(Q!==null){for(var he=0;he<Q.length;he++){var Be=Q[he];for(bt=Be;bt!==null;){var wt=bt;switch(wt.tag){case 0:case 11:case 15:$u(8,wt,E)}var Qt=wt.child;if(Qt!==null)Qt.return=wt,bt=Qt;else for(;bt!==null;){wt=bt;var dt=wt.sibling,rr=wt.return;if(mw(wt),wt===Be){bt=null;break}if(dt!==null){dt.return=rr,bt=dt;break}bt=rr}}}var Yn=E.alternate;if(Yn!==null){var ko=Yn.child;if(ko!==null){Yn.child=null;do{var Na=ko.sibling;ko.sibling=null,ko=Na}while(ko!==null)}}bt=E}}if(E.subtreeFlags&2064&&N!==null)N.return=E,bt=N;else e:for(;bt!==null;){if(E=bt,E.flags&2048)switch(E.tag){case 0:case 11:case 15:$u(9,E,E.return)}var de=E.sibling;if(de!==null){de.return=E.return,bt=de;break e}bt=E.return}}var re=l.current;for(bt=re;bt!==null;){N=bt;var xe=N.child;if(N.subtreeFlags&2064&&xe!==null)xe.return=N,bt=xe;else e:for(N=re;bt!==null;){if(Q=bt,Q.flags&2048)try{switch(Q.tag){case 0:case 11:case 15:Gf(9,Q)}}catch(zt){ur(Q,Q.return,zt)}if(Q===N){bt=null;break e}var ht=Q.sibling;if(ht!==null){ht.return=Q.return,bt=ht;break e}bt=Q.return}}if(fn=C,Bo(),Sn&&typeof Sn.onPostCommitFiberRoot=="function")try{Sn.onPostCommitFiberRoot(nr,l)}catch{}b=!0}return b}finally{Te=g,Ir.transition=u}}return!1}function Rw(l,u,g){u=sc(g,u),u=X2(l,u,1),l=pi(l,u,1),u=so(),l!==null&&(xt(l,1,u),_o(l,u))}function ur(l,u,g){if(l.tag===3)Rw(l,l,g);else for(;u!==null;){if(u.tag===3){Rw(u,l,g);break}else if(u.tag===1){var b=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof b.componentDidCatch=="function"&&(hi===null||!hi.has(b))){l=sc(g,l),l=Z2(u,l,1),u=pi(u,l,1),l=so(),u!==null&&(xt(u,1,l),_o(u,l));break}}u=u.return}}function l8(l,u,g){var b=l.pingCache;b!==null&&b.delete(u),u=so(),l.pingedLanes|=l.suspendedLanes&g,Yr===l&&(Qr&g)===g&&(Hr===4||Hr===3&&(Qr&130023424)===Qr&&500>Ue()-e0?rl(l,0):Jv|=g),_o(l,u)}function Mw(l,u){u===0&&(l.mode&1?(u=Pn,Pn<<=1,!(Pn&130023424)&&(Pn=4194304)):u=1);var g=so();l=aa(l,u),l!==null&&(xt(l,u,g),_o(l,g))}function c8(l){var u=l.memoizedState,g=0;u!==null&&(g=u.retryLane),Mw(l,g)}function u8(l,u){var g=0;switch(l.tag){case 13:var b=l.stateNode,C=l.memoizedState;C!==null&&(g=C.retryLane);break;case 19:b=l.stateNode;break;default:throw Error(a(314))}b!==null&&b.delete(u),Mw(l,g)}var Dw;Dw=function(l,u,g){if(l!==null)if(l.memoizedProps!==u.pendingProps||dn.current)So=!0;else{if(!(l.lanes&g)&&!(u.flags&128))return So=!1,ZR(l,u,g);So=!!(l.flags&131072)}else So=!1,cr&&u.flags&1048576&&d2(u,po,u.index);switch(u.lanes=0,u.tag){case 2:var b=u.type;Hf(l,u),l=u.pendingProps;var C=Lr(u,tn.current);tc(u,g),C=Iv(null,u,b,l,C,g);var E=Ov();return u.flags|=1,typeof C=="object"&&C!==null&&typeof C.render=="function"&&C.$$typeof===void 0?(u.tag=1,u.memoizedState=null,u.updateQueue=null,ir(b)?(E=!0,lr(u)):E=!1,u.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,xv(u),C.updater=Mf,u.stateNode=C,C._reactInternals=u,Sv(u,b,l,g),u=$v(null,u,b,!0,E,g)):(u.tag=0,cr&&E&&uv(u),go(null,u,C,g),u=u.child),u;case 16:b=u.elementType;e:{switch(Hf(l,u),l=u.pendingProps,C=b._init,b=C(b._payload),u.type=b,C=u.tag=f8(b),l=Rs(b,l),C){case 0:u=zv(null,u,b,l,g);break e;case 1:u=aw(null,u,b,l,g);break e;case 11:u=tw(null,u,b,l,g);break e;case 14:u=nw(null,u,b,Rs(b.type,l),g);break e}throw Error(a(306,b,""))}return u;case 0:return b=u.type,C=u.pendingProps,C=u.elementType===b?C:Rs(b,C),zv(l,u,b,C,g);case 1:return b=u.type,C=u.pendingProps,C=u.elementType===b?C:Rs(b,C),aw(l,u,b,C,g);case 3:e:{if(iw(u),l===null)throw Error(a(387));b=u.pendingProps,E=u.memoizedState,C=E.element,y2(l,u),Rf(u,b,null,g);var N=u.memoizedState;if(b=N.element,ke&&E.isDehydrated)if(E={element:b,isDehydrated:!1,cache:N.cache,pendingSuspenseBoundaries:N.pendingSuspenseBoundaries,transitions:N.transitions},u.updateQueue.baseState=E,u.memoizedState=E,u.flags&256){C=sc(Error(a(423)),u),u=lw(l,u,b,g,C);break e}else if(b!==C){C=sc(Error(a(424)),u),u=lw(l,u,b,g,C);break e}else for(ke&&(rs=ee(u.stateNode.containerInfo),Ho=u,cr=!0,Ts=null,ju=!1),g=j2(u,null,b,g),u.child=g;g;)g.flags=g.flags&-3|4096,g=g.sibling;else{if(Jl(),b===C){u=Da(l,u,g);break e}go(l,u,b,g)}u=u.child}return u;case 5:return E2(u),l===null&&pv(u),b=u.type,C=u.pendingProps,E=l!==null?l.memoizedProps:null,N=C.children,B(b,C)?N=null:E!==null&&B(b,E)&&(u.flags|=32),sw(l,u),go(l,u,N,g),u.child;case 6:return l===null&&pv(u),null;case 13:return cw(l,u,g);case 4:return Cv(u,u.stateNode.containerInfo),b=u.pendingProps,l===null?u.child=nc(u,null,b,g):go(l,u,b,g),u.child;case 11:return b=u.type,C=u.pendingProps,C=u.elementType===b?C:Rs(b,C),tw(l,u,b,C,g);case 7:return go(l,u,u.pendingProps,g),u.child;case 8:return go(l,u,u.pendingProps.children,g),u.child;case 12:return go(l,u,u.pendingProps.children,g),u.child;case 10:e:{if(b=u.type._context,C=u.pendingProps,E=u.memoizedProps,N=C.value,g2(u,b,N),E!==null)if(xn(E.value,N)){if(E.children===C.children&&!dn.current){u=Da(l,u,g);break e}}else for(E=u.child,E!==null&&(E.return=u);E!==null;){var Q=E.dependencies;if(Q!==null){N=E.child;for(var he=Q.firstContext;he!==null;){if(he.context===b){if(E.tag===1){he=Ma(-1,g&-g),he.tag=2;var Be=E.updateQueue;if(Be!==null){Be=Be.shared;var wt=Be.pending;wt===null?he.next=he:(he.next=wt.next,wt.next=he),Be.pending=he}}E.lanes|=g,he=E.alternate,he!==null&&(he.lanes|=g),yv(E.return,g,u),Q.lanes|=g;break}he=he.next}}else if(E.tag===10)N=E.type===u.type?null:E.child;else if(E.tag===18){if(N=E.return,N===null)throw Error(a(341));N.lanes|=g,Q=N.alternate,Q!==null&&(Q.lanes|=g),yv(N,g,u),N=E.sibling}else N=E.child;if(N!==null)N.return=E;else for(N=E;N!==null;){if(N===u){N=null;break}if(E=N.sibling,E!==null){E.return=N.return,N=E;break}N=N.return}E=N}go(l,u,C.children,g),u=u.child}return u;case 9:return C=u.type,b=u.pendingProps.children,tc(u,g),C=os(C),b=b(C),u.flags|=1,go(l,u,b,g),u.child;case 14:return b=u.type,C=Rs(b,u.pendingProps),C=Rs(b.type,C),nw(l,u,b,C,g);case 15:return rw(l,u,u.type,u.pendingProps,g);case 17:return b=u.type,C=u.pendingProps,C=u.elementType===b?C:Rs(b,C),Hf(l,u),u.tag=1,ir(b)?(l=!0,lr(u)):l=!1,tc(u,g),C2(u,b,C),Sv(u,b,C,g),$v(null,u,b,!0,l,g);case 19:return dw(l,u,g);case 22:return ow(l,u,g)}throw Error(a(156,u.tag))};function Aw(l,u){return We(l,u)}function d8(l,u,g,b){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=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=b,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ls(l,u,g,b){return new d8(l,u,g,b)}function l0(l){return l=l.prototype,!(!l||!l.isReactComponent)}function f8(l){if(typeof l=="function")return l0(l)?1:0;if(l!=null){if(l=l.$$typeof,l===x)return 11;if(l===k)return 14}return 2}function yi(l,u){var g=l.alternate;return g===null?(g=ls(l.tag,u,l.key,l.mode),g.elementType=l.elementType,g.type=l.type,g.stateNode=l.stateNode,g.alternate=l,l.alternate=g):(g.pendingProps=u,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,u=l.dependencies,g.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},g.sibling=l.sibling,g.index=l.index,g.ref=l.ref,g}function ap(l,u,g,b,C,E){var N=2;if(b=l,typeof l=="function")l0(l)&&(N=1);else if(typeof l=="string")N=5;else e:switch(l){case h:return al(g.children,C,E,u);case m:N=8,C|=8;break;case v:return l=ls(12,g,u,C|2),l.elementType=v,l.lanes=E,l;case w:return l=ls(13,g,u,C),l.elementType=w,l.lanes=E,l;case _:return l=ls(19,g,u,C),l.elementType=_,l.lanes=E,l;case j:return ip(g,C,E,u);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case y:N=10;break e;case S:N=9;break e;case x:N=11;break e;case k:N=14;break e;case P:N=16,b=null;break e}throw Error(a(130,l==null?l:typeof l,""))}return u=ls(N,g,u,C),u.elementType=l,u.type=b,u.lanes=E,u}function al(l,u,g,b){return l=ls(7,l,b,u),l.lanes=g,l}function ip(l,u,g,b){return l=ls(22,l,b,u),l.elementType=j,l.lanes=g,l.stateNode={isHidden:!1},l}function c0(l,u,g){return l=ls(6,l,null,u),l.lanes=g,l}function u0(l,u,g){return u=ls(4,l.children!==null?l.children:[],l.key,u),u.lanes=g,u.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},u}function p8(l,u,g,b,C){this.tag=u,this.containerInfo=l,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=se,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Vt(0),this.expirationTimes=Vt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vt(0),this.identifierPrefix=b,this.onRecoverableError=C,ke&&(this.mutableSourceEagerHydrationData=null)}function Nw(l,u,g,b,C,E,N,Q,he){return l=new p8(l,u,g,Q,he),u===1?(u=1,E===!0&&(u|=8)):u=0,E=ls(3,null,null,u),l.current=E,E.stateNode=l,E.memoizedState={element:b,isDehydrated:g,cache:null,transitions:null,pendingSuspenseBoundaries:null},xv(E),l}function zw(l){if(!l)return kn;l=l._reactInternals;e:{if(M(l)!==l||l.tag!==1)throw Error(a(170));var u=l;do{switch(u.tag){case 3:u=u.stateNode.context;break e;case 1:if(ir(u.type)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break e}}u=u.return}while(u!==null);throw Error(a(171))}if(l.tag===1){var g=l.type;if(ir(g))return Ln(l,g,u)}return u}function $w(l){var u=l._reactInternals;if(u===void 0)throw typeof l.render=="function"?Error(a(188)):(l=Object.keys(l).join(","),Error(a(268,l)));return l=G(u),l===null?null:l.stateNode}function Lw(l,u){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var g=l.retryLane;l.retryLane=g!==0&&g<u?g:u}}function lp(l,u){Lw(l,u),(l=l.alternate)&&Lw(l,u)}function h8(l){return l=G(l),l===null?null:l.stateNode}function m8(){return null}return n.attemptContinuousHydration=function(l){if(l.tag===13){var u=aa(l,134217728);if(u!==null){var g=so();is(u,l,134217728,g)}lp(l,134217728)}},n.attemptDiscreteHydration=function(l){if(l.tag===13){var u=aa(l,1);if(u!==null){var g=so();is(u,l,1,g)}lp(l,1)}},n.attemptHydrationAtCurrentPriority=function(l){if(l.tag===13){var u=gi(l),g=aa(l,u);if(g!==null){var b=so();is(g,l,u,b)}lp(l,u)}},n.attemptSynchronousHydration=function(l){switch(l.tag){case 3:var u=l.stateNode;if(u.current.memoizedState.isDehydrated){var g=jn(u.pendingLanes);g!==0&&(De(u,g|1),_o(u,Ue()),!(fn&6)&&(lc(),Bo()))}break;case 13:jw(function(){var b=aa(l,1);if(b!==null){var C=so();is(b,l,1,C)}}),lp(l,1)}},n.batchedUpdates=function(l,u){var g=fn;fn|=1;try{return l(u)}finally{fn=g,fn===0&&(lc(),Xr&&Bo())}},n.createComponentSelector=function(l){return{$$typeof:qf,value:l}},n.createContainer=function(l,u,g,b,C,E,N){return Nw(l,u,!1,null,g,b,C,E,N)},n.createHasPseudoClassSelector=function(l){return{$$typeof:Yf,value:l}},n.createHydrationContainer=function(l,u,g,b,C,E,N,Q,he){return l=Nw(g,b,!0,l,C,E,N,Q,he),l.context=zw(null),g=l.current,b=so(),C=gi(g),E=Ma(b,C),E.callback=u??null,pi(g,E,C),l.current.lanes=C,xt(l,C,b),_o(l,b),l},n.createPortal=function(l,u,g){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:b==null?null:""+b,children:l,containerInfo:u,implementation:g}},n.createRoleSelector=function(l){return{$$typeof:Kf,value:l}},n.createTestNameSelector=function(l){return{$$typeof:Xf,value:l}},n.createTextSelector=function(l){return{$$typeof:Zf,value:l}},n.deferredUpdates=function(l){var u=Te,g=Ir.transition;try{return Ir.transition=null,Te=16,l()}finally{Te=u,Ir.transition=g}},n.discreteUpdates=function(l,u,g,b,C){var E=Te,N=Ir.transition;try{return Ir.transition=null,Te=1,l(u,g,b,C)}finally{Te=E,Ir.transition=N,fn===0&&lc()}},n.findAllNodes=Zv,n.findBoundingRects=function(l,u){if(!ft)throw Error(a(363));u=Zv(l,u),l=[];for(var g=0;g<u.length;g++)l.push(K(u[g]));for(u=l.length-1;0<u;u--){g=l[u];for(var b=g.x,C=b+g.width,E=g.y,N=E+g.height,Q=u-1;0<=Q;Q--)if(u!==Q){var he=l[Q],Be=he.x,wt=Be+he.width,Qt=he.y,dt=Qt+he.height;if(b>=Be&&E>=Qt&&C<=wt&&N<=dt){l.splice(u,1);break}else if(b!==Be||g.width!==he.width||dt<E||Qt>N){if(!(E!==Qt||g.height!==he.height||wt<b||Be>C)){Be>b&&(he.width+=Be-b,he.x=b),wt<C&&(he.width=C-Be),l.splice(u,1);break}}else{Qt>E&&(he.height+=Qt-E,he.y=E),dt<N&&(he.height=N-Qt),l.splice(u,1);break}}}return l},n.findHostInstance=$w,n.findHostInstanceWithNoPortals=function(l){return l=A(l),l=l!==null?H(l):null,l===null?null:l.stateNode},n.findHostInstanceWithWarning=function(l){return $w(l)},n.flushControlled=function(l){var u=fn;fn|=1;var g=Ir.transition,b=Te;try{Ir.transition=null,Te=1,l()}finally{Te=b,Ir.transition=g,fn=u,fn===0&&(lc(),Bo())}},n.flushPassiveEffects=sl,n.flushSync=jw,n.focusWithin=function(l,u){if(!ft)throw Error(a(363));for(l=Yv(l),u=_w(l,u),u=Array.from(u),l=0;l<u.length;){var g=u[l++];if(!ne(g)){if(g.tag===5&&Re(g.stateNode))return!0;for(g=g.child;g!==null;)u.push(g),g=g.sibling}}return!1},n.getCurrentUpdatePriority=function(){return Te},n.getFindAllNodesFailureDescription=function(l,u){if(!ft)throw Error(a(363));var g=0,b=[];l=[Yv(l),0];for(var C=0;C<l.length;){var E=l[C++],N=l[C++],Q=u[N];if((E.tag!==5||!ne(E))&&(Kv(E,Q)&&(b.push(Xv(Q)),N++,N>g&&(g=N)),N<u.length))for(E=E.child;E!==null;)l.push(E,N),E=E.sibling}if(g<u.length){for(l=[];g<u.length;g++)l.push(Xv(u[g]));return`findAllNodes was able to match part of the selector:
`+(b.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 q(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:h8,findFiberByHostInstance:l.findFiberByHostInstance||m8,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")l=!1;else{var u=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(u.isDisabled||!u.supportsFiber)l=!0;else{try{nr=u.inject(l),Sn=u}catch{}l=!!u.checkDCE}}return l},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(l,u,g,b){if(!ft)throw Error(a(363));l=Zv(l,u);var C=Ye(l,g,b).disconnect;return{disconnect:function(){C()}}},n.registerMutableSourceForHydration=function(l,u){var g=u._getVersion;g=g(u._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[u,g]:l.mutableSourceEagerHydrationData.push(u,g)},n.runWithPriority=function(l,u){var g=Te;try{return Te=l,u()}finally{Te=g}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(l,u,g,b){var C=u.current,E=so(),N=gi(C);return g=zw(g),u.context===null?u.context=g:u.pendingContext=g,u=Ma(E,N),u.payload={element:l},b=b===void 0?null:b,b!==null&&(u.callback=b),l=pi(C,u,N),l!==null&&(is(l,C,N,E),Tf(l,C,N)),N},n};wR.exports=Ice;var Oce=wR.exports;const Tce=gu(Oce);var SR={exports:{}},Ql={};/**
* @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.
*/Ql.ConcurrentRoot=1;Ql.ContinuousEventPriority=4;Ql.DefaultEventPriority=16;Ql.DiscreteEventPriority=1;Ql.IdleEventPriority=536870912;Ql.LegacyRoot=0;SR.exports=Ql;var CR=SR.exports;const RP={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let MP=!1,DP=!1;const l2=".react-konva-event",Rce=`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
`,Mce=`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
`,Dce={};function cv(e,t,n=Dce){if(!MP&&"zIndex"in t&&(console.warn(Mce),MP=!0),!DP&&t.draggable){var r=t.x!==void 0||t.y!==void 0,o=t.onDragEnd||t.onDragMove;r&&!o&&(console.warn(Rce),DP=!0)}for(var s in n)if(!RP[s]){var a=s.slice(0,2)==="on",c=n[s]!==t[s];if(a&&c){var d=s.substr(2).toLowerCase();d.substr(0,7)==="content"&&(d="content"+d.substr(7,1).toUpperCase()+d.substr(8)),e.off(d,n[s])}var f=!t.hasOwnProperty(s);f&&e.setAttr(s,void 0)}var h=t._useStrictMode,m={},v=!1;const y={};for(var s in t)if(!RP[s]){var a=s.slice(0,2)==="on",S=n[s]!==t[s];if(a&&S){var d=s.substr(2).toLowerCase();d.substr(0,7)==="content"&&(d="content"+d.substr(7,1).toUpperCase()+d.substr(8)),t[s]&&(y[d]=t[s])}!a&&(t[s]!==n[s]||h&&t[s]!==e.getAttr(s))&&(v=!0,m[s]=t[s])}v&&(e.setAttrs(m),Qi(e));for(var d in y)e.on(d+l2,y[d])}function Qi(e){if(!$M.Konva.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const _R={},Ace={};Jd.Node.prototype._applyProps=cv;function Nce(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),Qi(e)}function zce(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 a in t){var c=a.slice(0,2)==="on";c?s[a]=t[a]:o[a]=t[a]}const d=new r(o);return cv(d,s),d}function $ce(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function Lce(e,t,n){return!1}function Bce(e){return e}function Fce(){return null}function Hce(){return null}function Vce(e,t,n,r){return Ace}function Wce(){}function Uce(e){}function Gce(e,t){return!1}function qce(){return _R}function Yce(){return _R}const Kce=setTimeout,Xce=clearTimeout,Zce=-1;function Qce(e,t){return!1}const Jce=!1,eue=!0,tue=!0;function nue(e,t){t.parent===e?t.moveToTop():e.add(t),Qi(e)}function rue(e,t){t.parent===e?t.moveToTop():e.add(t),Qi(e)}function kR(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),Qi(e)}function oue(e,t,n){kR(e,t,n)}function sue(e,t){t.destroy(),t.off(l2),Qi(e)}function aue(e,t){t.destroy(),t.off(l2),Qi(e)}function iue(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function lue(e,t,n){}function cue(e,t,n,r,o){cv(e,o,r)}function uue(e){e.hide(),Qi(e)}function due(e){}function fue(e,t){(t.visible==null||t.visible)&&e.show()}function pue(e,t){}function hue(e){}function mue(){}const gue=()=>CR.DefaultEventPriority,vue=Object.freeze(Object.defineProperty({__proto__:null,appendChild:nue,appendChildToContainer:rue,appendInitialChild:Nce,cancelTimeout:Xce,clearContainer:hue,commitMount:lue,commitTextUpdate:iue,commitUpdate:cue,createInstance:zce,createTextInstance:$ce,detachDeletedInstance:mue,finalizeInitialChildren:Lce,getChildHostContext:Yce,getCurrentEventPriority:gue,getPublicInstance:Bce,getRootHostContext:qce,hideInstance:uue,hideTextInstance:due,idlePriority:rh.unstable_IdlePriority,insertBefore:kR,insertInContainerBefore:oue,isPrimaryRenderer:Jce,noTimeout:Zce,now:rh.unstable_now,prepareForCommit:Fce,preparePortalMount:Hce,prepareUpdate:Vce,removeChild:sue,removeChildFromContainer:aue,resetAfterCommit:Wce,resetTextContent:Uce,run:rh.unstable_runWithPriority,scheduleTimeout:Kce,shouldDeprioritizeSubtree:Gce,shouldSetTextContent:Qce,supportsMutation:tue,unhideInstance:fue,unhideTextInstance:pue,warnsIfNotActing:eue},Symbol.toStringTag,{value:"Module"}));var yue=Object.defineProperty,bue=Object.defineProperties,xue=Object.getOwnPropertyDescriptors,AP=Object.getOwnPropertySymbols,wue=Object.prototype.hasOwnProperty,Sue=Object.prototype.propertyIsEnumerable,NP=(e,t,n)=>t in e?yue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zP=(e,t)=>{for(var n in t||(t={}))wue.call(t,n)&&NP(e,n,t[n]);if(AP)for(var n of AP(t))Sue.call(t,n)&&NP(e,n,t[n]);return e},Cue=(e,t)=>bue(e,xue(t));function PR(e,t,n){if(!e)return;if(n(e)===!0)return e;let r=t?e.return:e.child;for(;r;){const o=PR(r,t,n);if(o)return o;r=t?null:r.sibling}}function jR(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const c2=jR(p.createContext(null));class ER extends p.Component{render(){return p.createElement(c2.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:$P,ReactCurrentDispatcher:LP}=p.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _ue(){const e=p.useContext(c2);if(e===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const t=p.useId();return p.useMemo(()=>{for(const r of[$P==null?void 0:$P.current,e,e==null?void 0:e.alternate]){if(!r)continue;const o=PR(r,!1,s=>{let a=s.memoizedState;for(;a;){if(a.memoizedState===t)return!0;a=a.next}});if(o)return o}},[e,t])}function kue(){var e,t;const n=_ue(),[r]=p.useState(()=>new Map);r.clear();let o=n;for(;o;){const s=(e=o.type)==null?void 0:e._context;s&&s!==c2&&!r.has(s)&&r.set(s,(t=LP==null?void 0:LP.current)==null?void 0:t.readContext(jR(s))),o=o.return}return r}function Pue(){const e=kue();return p.useMemo(()=>Array.from(e.keys()).reduce((t,n)=>r=>p.createElement(t,null,p.createElement(n.Provider,Cue(zP({},r),{value:e.get(n)}))),t=>p.createElement(ER,zP({},t))),[e])}function jue(e){const t=F.useRef({});return F.useLayoutEffect(()=>{t.current=e}),F.useLayoutEffect(()=>()=>{t.current={}},[]),t.current}const Eue=e=>{const t=F.useRef(),n=F.useRef(),r=F.useRef(),o=jue(e),s=Pue(),a=c=>{const{forwardedRef:d}=e;d&&(typeof d=="function"?d(c):d.current=c)};return F.useLayoutEffect(()=>(n.current=new Jd.Stage({width:e.width,height:e.height,container:t.current}),a(n.current),r.current=fd.createContainer(n.current,CR.LegacyRoot,!1,null),fd.updateContainer(F.createElement(s,{},e.children),r.current),()=>{Jd.isBrowser&&(a(null),fd.updateContainer(null,r.current,null),n.current.destroy())}),[]),F.useLayoutEffect(()=>{a(n.current),cv(n.current,e,o),fd.updateContainer(F.createElement(s,{},e.children),r.current,null)}),F.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})},rd="Layer",ti="Group",ka="Rect",ll="Circle",Km="Line",IR="Image",Iue="Transformer",fd=Tce(vue);fd.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:F.version,rendererPackageName:"react-konva"});const Oue=F.forwardRef((e,t)=>F.createElement(ER,{},F.createElement(Eue,{...e,forwardedRef:t}))),Tue=Oe([vn,vr],(e,t)=>{const{tool:n,isMovingBoundingBox:r}=e;return{tool:n,isStaging:t,isMovingBoundingBox:r}},{memoizeOptions:{resultEqualityCheck:en}}),Rue=()=>{const e=ce(),{tool:t,isStaging:n,isMovingBoundingBox:r}=Y(Tue);return{handleDragStart:p.useCallback(()=>{(t==="move"||n)&&!r&&e(Ph(!0))},[e,r,n,t]),handleDragMove:p.useCallback(o=>{if(!((t==="move"||n)&&!r))return;const s={x:o.target.x(),y:o.target.y()};e(C3(s))},[e,r,n,t]),handleDragEnd:p.useCallback(()=>{(t==="move"||n)&&!r&&e(Ph(!1))},[e,r,n,t])}},Mue=Oe([vn,Gr,vr],(e,t,n)=>{const{cursorPosition:r,shouldLockBoundingBox:o,shouldShowBoundingBox:s,tool:a,isMaskEnabled:c,shouldSnapToGrid:d}=e;return{activeTabName:t,isCursorOnCanvas:!!r,shouldLockBoundingBox:o,shouldShowBoundingBox:s,tool:a,isStaging:n,isMaskEnabled:c,shouldSnapToGrid:d}},{memoizeOptions:{resultEqualityCheck:en}}),Due=()=>{const e=ce(),{activeTabName:t,shouldShowBoundingBox:n,tool:r,isStaging:o,isMaskEnabled:s,shouldSnapToGrid:a}=Y(Mue),c=p.useRef(null),d=_3(),f=()=>e(nb());et(["shift+c"],()=>{f()},{enabled:()=>!o,preventDefault:!0},[]);const h=()=>e(af(!s));et(["h"],()=>{h()},{enabled:()=>!o,preventDefault:!0},[s]),et(["n"],()=>{e(jh(!a))},{enabled:!0,preventDefault:!0},[a]),et("esc",()=>{e(LM())},{enabled:()=>!0,preventDefault:!0}),et("shift+h",()=>{e(BM(!n))},{enabled:()=>!o,preventDefault:!0},[t,n]),et(["space"],m=>{m.repeat||(d==null||d.container().focus(),r!=="move"&&(c.current=r,e(va("move"))),r==="move"&&c.current&&c.current!=="move"&&(e(va(c.current)),c.current="move"))},{keyup:!0,keydown:!0,preventDefault:!0},[r,c])},u2=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}},OR=()=>{const e=ce(),t=qa(),n=_3();return{updateColorUnderCursor:()=>{if(!n||!t)return;const r=n.getPointerPosition();if(!r)return;const o=FM.pixelRatio,[s,a,c,d]=t.getContext().getImageData(r.x*o,r.y*o,1,1).data;e(HM({r:s,g:a,b:c,a:d}))},commitColorUnderCursor:()=>{e(VM())}}},Aue=Oe([Gr,vn,vr],(e,t,n)=>{const{tool:r}=t;return{tool:r,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:en}}),Nue=e=>{const t=ce(),{tool:n,isStaging:r}=Y(Aue),{commitColorUnderCursor:o}=OR();return p.useCallback(s=>{if(!e.current)return;if(e.current.container().focus(),n==="move"||r){t(Ph(!0));return}if(n==="colorPicker"){o();return}const a=u2(e.current);a&&(s.evt.preventDefault(),t(k3(!0)),t(WM([a.x,a.y])))},[e,n,r,t,o])},zue=Oe([Gr,vn,vr],(e,t,n)=>{const{tool:r,isDrawing:o}=t;return{tool:r,isDrawing:o,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:en}}),$ue=(e,t,n)=>{const r=ce(),{isDrawing:o,tool:s,isStaging:a}=Y(zue),{updateColorUnderCursor:c}=OR();return p.useCallback(()=>{if(!e.current)return;const d=u2(e.current);if(d){if(r(UM(d)),n.current=d,s==="colorPicker"){c();return}!o||s==="move"||a||(t.current=!0,r(P3([d.x,d.y])))}},[t,r,o,a,n,e,s,c])},Lue=()=>{const e=ce();return p.useCallback(()=>{e(GM())},[e])},Bue=Oe([Gr,vn,vr],(e,t,n)=>{const{tool:r,isDrawing:o}=t;return{tool:r,isDrawing:o,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:en}}),Fue=(e,t)=>{const n=ce(),{tool:r,isDrawing:o,isStaging:s}=Y(Bue);return p.useCallback(()=>{if(r==="move"||s){n(Ph(!1));return}if(!t.current&&o&&e.current){const a=u2(e.current);if(!a)return;n(P3([a.x,a.y]))}else t.current=!1;n(k3(!1))},[t,n,o,s,e,r])},Hue=Oe([vn],e=>{const{isMoveStageKeyHeld:t,stageScale:n}=e;return{isMoveStageKeyHeld:t,stageScale:n}},{memoizeOptions:{resultEqualityCheck:en}}),Vue=e=>{const t=ce(),{isMoveStageKeyHeld:n,stageScale:r}=Y(Hue);return p.useCallback(o=>{if(!e.current||n)return;o.evt.preventDefault();const s=e.current.getPointerPosition();if(!s)return;const a={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 d=Ks(r*KM**c,YM,qM),f={x:s.x-a.x*d,y:s.y-a.y*d};t(XM(d)),t(C3(f))},[e,n,r,t])},Wue=Oe(vn,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageDimensions:r,stageScale:o,shouldDarkenOutsideBoundingBox:s,stageCoordinates:a}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,shouldDarkenOutsideBoundingBox:s,stageCoordinates:a,stageDimensions:r,stageScale:o}},{memoizeOptions:{resultEqualityCheck:en}}),Uue=()=>{const{boundingBoxCoordinates:e,boundingBoxDimensions:t,shouldDarkenOutsideBoundingBox:n,stageCoordinates:r,stageDimensions:o,stageScale:s}=Y(Wue);return i.jsxs(ti,{children:[i.jsx(ka,{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}),i.jsx(ka,{x:e.x,y:e.y,width:t.width,height:t.height,fill:"rgb(255,255,255)",listening:!1,visible:n,globalCompositeOperation:"destination-out"})]})},Gue=Oe([vn],e=>{const{stageScale:t,stageCoordinates:n,stageDimensions:r}=e;return{stageScale:t,stageCoordinates:n,stageDimensions:r}},{memoizeOptions:{resultEqualityCheck:en}}),que=()=>{const{stageScale:e,stageCoordinates:t,stageDimensions:n}=Y(Gue),{colorMode:r}=zo(),[o,s]=p.useState([]),[a,c]=Wl("colors",["base.800","base.200"]),d=p.useCallback(f=>f/e,[e]);return p.useLayoutEffect(()=>{const{width:f,height:h}=n,{x:m,y:v}=t,y={x1:0,y1:0,x2:f,y2:h,offset:{x:d(m),y:d(v)}},S={x:Math.ceil(d(m)/64)*64,y:Math.ceil(d(v)/64)*64},x={x1:-S.x,y1:-S.y,x2:d(f)-S.x+64,y2:d(h)-S.y+64},_={x1:Math.min(y.x1,x.x1),y1:Math.min(y.y1,x.y1),x2:Math.max(y.x2,x.x2),y2:Math.max(y.y2,x.y2)},k=_.x2-_.x1,P=_.y2-_.y1,j=Math.round(k/64)+1,I=Math.round(P/64)+1,O=kS(0,j).map(R=>i.jsx(Km,{x:_.x1+R*64,y:_.y1,points:[0,0,0,P],stroke:r==="dark"?a:c,strokeWidth:1},`x_${R}`)),T=kS(0,I).map(R=>i.jsx(Km,{x:_.x1,y:_.y1+R*64,points:[0,0,k,0],stroke:r==="dark"?a:c,strokeWidth:1},`y_${R}`));s(O.concat(T))},[e,t,n,d,r,a,c]),i.jsx(ti,{children:o})},Yue=Oe([wo,vn],(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:en}}),Kue=e=>{const{...t}=e,{progressImage:n,boundingBox:r}=Y(Yue),[o,s]=p.useState(null);return p.useEffect(()=>{if(!n)return;const a=new Image;a.onload=()=>{s(a)},a.src=n.dataURL},[n]),n&&r&&o?i.jsx(IR,{x:r.x,y:r.y,width:r.width,height:r.height,image:o,listening:!1,...t}):null},Il=e=>{const{r:t,g:n,b:r,a:o}=e;return`rgba(${t}, ${n}, ${r}, ${o})`},Xue=Oe(vn,e=>{const{maskColor:t,stageCoordinates:n,stageDimensions:r,stageScale:o}=e;return{stageCoordinates:n,stageDimensions:r,stageScale:o,maskColorString:Il(t)}}),BP=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),Zue=e=>{const{...t}=e,{maskColorString:n,stageCoordinates:r,stageDimensions:o,stageScale:s}=Y(Xue),[a,c]=p.useState(null),[d,f]=p.useState(0),h=p.useRef(null),m=p.useCallback(()=>{f(d+1),setTimeout(m,500)},[d]);return p.useEffect(()=>{if(a)return;const v=new Image;v.onload=()=>{c(v)},v.src=BP(n)},[a,n]),p.useEffect(()=>{a&&(a.src=BP(n))},[a,n]),p.useEffect(()=>{const v=setInterval(()=>f(y=>(y+1)%5),50);return()=>clearInterval(v)},[]),!a||!uc(r.x)||!uc(r.y)||!uc(s)||!uc(o.width)||!uc(o.height)?null:i.jsx(ka,{ref:h,offsetX:r.x/s,offsetY:r.y/s,height:o.height/s,width:o.width/s,fillPatternImage:a,fillPatternOffsetY:uc(d)?d:0,fillPatternRepeat:"repeat",fillPatternScale:{x:1/s,y:1/s},listening:!0,globalCompositeOperation:"source-in",...t})},Que=Oe([vn],e=>({objects:e.layerState.objects}),{memoizeOptions:{resultEqualityCheck:en}}),Jue=e=>{const{...t}=e,{objects:n}=Y(Que);return i.jsx(ti,{listening:!1,...t,children:n.filter(ZM).map((r,o)=>i.jsx(Km,{points:r.points,stroke:"rgb(0,0,0)",strokeWidth:r.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:r.tool==="brush"?"source-over":"destination-out"},o))})};var cl=p,ede=function(t,n,r){const o=cl.useRef("loading"),s=cl.useRef(),[a,c]=cl.useState(0),d=cl.useRef(),f=cl.useRef(),h=cl.useRef();return(d.current!==t||f.current!==n||h.current!==r)&&(o.current="loading",s.current=void 0,d.current=t,f.current=n,h.current=r),cl.useLayoutEffect(function(){if(!t)return;var m=document.createElement("img");function v(){o.current="loaded",s.current=m,c(Math.random())}function y(){o.current="failed",s.current=void 0,c(Math.random())}return m.addEventListener("load",v),m.addEventListener("error",y),n&&(m.crossOrigin=n),r&&(m.referrerPolicy=r),m.src=t,function(){m.removeEventListener("load",v),m.removeEventListener("error",y)}},[t,n,r]),[s.current,o.current]};const tde=gu(ede),TR=e=>{const{width:t,height:n,x:r,y:o,imageName:s}=e.canvasImage,{currentData:a,isError:c}=xa(s??Ja.skipToken),[d]=tde((a==null?void 0:a.image_url)??"",QM.get()?"use-credentials":"anonymous");return c?i.jsx(ka,{x:r,y:o,width:t,height:n,fill:"red"}):i.jsx(IR,{x:r,y:o,image:d,listening:!1})},nde=Oe([vn],e=>{const{layerState:{objects:t}}=e;return{objects:t}},{memoizeOptions:{resultEqualityCheck:en}}),rde=()=>{const{objects:e}=Y(nde);return e?i.jsx(ti,{name:"outpainting-objects",listening:!1,children:e.map((t,n)=>{if(JM(t))return i.jsx(TR,{canvasImage:t},n);if(e9(t)){const r=i.jsx(Km,{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?i.jsx(ti,{clipX:t.clip.x,clipY:t.clip.y,clipWidth:t.clip.width,clipHeight:t.clip.height,children:r},n):r}else{if(t9(t))return i.jsx(ka,{x:t.x,y:t.y,width:t.width,height:t.height,fill:Il(t.color)},n);if(n9(t))return i.jsx(ka,{x:t.x,y:t.y,width:t.width,height:t.height,fill:"rgb(255, 255, 255)",globalCompositeOperation:"destination-out"},n)}})}):null},ode=Oe([vn],e=>{const{layerState:t,shouldShowStagingImage:n,shouldShowStagingOutline:r,boundingBoxCoordinates:{x:o,y:s},boundingBoxDimensions:{width:a,height:c}}=e,{selectedImageIndex:d,images:f}=t.stagingArea;return{currentStagingAreaImage:f.length>0&&d!==void 0?f[d]:void 0,isOnFirstImage:d===0,isOnLastImage:d===f.length-1,shouldShowStagingImage:n,shouldShowStagingOutline:r,x:o,y:s,width:a,height:c}},{memoizeOptions:{resultEqualityCheck:en}}),sde=e=>{const{...t}=e,{currentStagingAreaImage:n,shouldShowStagingImage:r,shouldShowStagingOutline:o,x:s,y:a,width:c,height:d}=Y(ode);return i.jsxs(ti,{...t,children:[r&&n&&i.jsx(TR,{canvasImage:n}),o&&i.jsxs(ti,{children:[i.jsx(ka,{x:s,y:a,width:c,height:d,strokeWidth:1,stroke:"white",strokeScaleEnabled:!1}),i.jsx(ka,{x:s,y:a,width:c,height:d,dash:[4,4],strokeWidth:1,stroke:"black",strokeScaleEnabled:!1})]})]})},ade=Oe([vn],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:en}}),ide=()=>{const e=ce(),{isOnFirstImage:t,isOnLastImage:n,currentStagingAreaImage:r,shouldShowStagingImage:o,sessionId:s}=Y(ade),{t:a}=we(),c=p.useCallback(()=>{e(pS(!0))},[e]),d=p.useCallback(()=>{e(pS(!1))},[e]);et(["left"],()=>{f()},{enabled:()=>!0,preventDefault:!0}),et(["right"],()=>{h()},{enabled:()=>!0,preventDefault:!0}),et(["enter"],()=>{m()},{enabled:()=>!0,preventDefault:!0});const f=p.useCallback(()=>e(r9()),[e]),h=p.useCallback(()=>e(o9()),[e]),m=p.useCallback(()=>e(s9(s)),[e,s]);return r?i.jsx(X,{pos:"absolute",bottom:4,w:"100%",align:"center",justify:"center",filter:"drop-shadow(0 0.5rem 1rem rgba(0,0,0))",onMouseOver:c,onMouseOut:d,children:i.jsxs(Or,{isAttached:!0,children:[i.jsx(Ne,{tooltip:`${a("unifiedCanvas.previous")} (Left)`,"aria-label":`${a("unifiedCanvas.previous")} (Left)`,icon:i.jsx(IW,{}),onClick:f,colorScheme:"accent",isDisabled:t}),i.jsx(Ne,{tooltip:`${a("unifiedCanvas.next")} (Right)`,"aria-label":`${a("unifiedCanvas.next")} (Right)`,icon:i.jsx(OW,{}),onClick:h,colorScheme:"accent",isDisabled:n}),i.jsx(Ne,{tooltip:`${a("unifiedCanvas.accept")} (Enter)`,"aria-label":`${a("unifiedCanvas.accept")} (Enter)`,icon:i.jsx(MW,{}),onClick:m,colorScheme:"accent"}),i.jsx(Ne,{tooltip:a("unifiedCanvas.showHide"),"aria-label":a("unifiedCanvas.showHide"),"data-alert":!o,icon:o?i.jsx(LW,{}):i.jsx($W,{}),onClick:()=>e(a9(!o)),colorScheme:"accent"}),i.jsx(Ne,{tooltip:a("unifiedCanvas.saveToGallery"),"aria-label":a("unifiedCanvas.saveToGallery"),icon:i.jsx(fx,{}),onClick:()=>e(i9({imageName:r.imageName})),colorScheme:"accent"}),i.jsx(Ne,{tooltip:a("unifiedCanvas.discardAll"),"aria-label":a("unifiedCanvas.discardAll"),icon:i.jsx(Ag,{style:{transform:"rotate(45deg)"}}),onClick:()=>e(l9()),colorScheme:"error",fontSize:20})]})}):null},Oc=e=>Math.round(e*100)/100,lde=Oe([vn],e=>{const{cursorPosition:t}=e,{cursorX:n,cursorY:r}=t?{cursorX:t.x,cursorY:t.y}:{cursorX:-1,cursorY:-1};return{cursorCoordinatesString:`(${Oc(n)}, ${Oc(r)})`}},{memoizeOptions:{resultEqualityCheck:en}});function cde(){const{cursorCoordinatesString:e}=Y(lde),{t}=we();return i.jsx(ut,{children:`${t("unifiedCanvas.cursorPosition")}: ${e}`})}const Uy="var(--invokeai-colors-warning-500)",ude=Oe([vn],e=>{const{stageDimensions:{width:t,height:n},stageCoordinates:{x:r,y:o},boundingBoxDimensions:{width:s,height:a},scaledBoundingBoxDimensions:{width:c,height:d},boundingBoxCoordinates:{x:f,y:h},stageScale:m,shouldShowCanvasDebugInfo:v,layer:y,boundingBoxScaleMethod:S,shouldPreserveMaskedArea:x}=e;let w="inherit";return(S==="none"&&(s<512||a<512)||S==="manual"&&c*d<512*512)&&(w=Uy),{activeLayerColor:y==="mask"?Uy:"inherit",activeLayerString:y.charAt(0).toUpperCase()+y.slice(1),boundingBoxColor:w,boundingBoxCoordinatesString:`(${Oc(f)}, ${Oc(h)})`,boundingBoxDimensionsString:`${s}×${a}`,scaledBoundingBoxDimensionsString:`${c}×${d}`,canvasCoordinatesString:`${Oc(r)}×${Oc(o)}`,canvasDimensionsString:`${t}×${n}`,canvasScaleString:Math.round(m*100),shouldShowCanvasDebugInfo:v,shouldShowBoundingBox:S!=="auto",shouldShowScaledBoundingBox:S!=="none",shouldPreserveMaskedArea:x}},{memoizeOptions:{resultEqualityCheck:en}}),dde=()=>{const{activeLayerColor:e,activeLayerString:t,boundingBoxColor:n,boundingBoxCoordinatesString:r,boundingBoxDimensionsString:o,scaledBoundingBoxDimensionsString:s,shouldShowScaledBoundingBox:a,canvasCoordinatesString:c,canvasDimensionsString:d,canvasScaleString:f,shouldShowCanvasDebugInfo:h,shouldShowBoundingBox:m,shouldPreserveMaskedArea:v}=Y(ude),{t:y}=we();return i.jsxs(X,{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:[i.jsx(ut,{style:{color:e},children:`${y("unifiedCanvas.activeLayer")}: ${t}`}),i.jsx(ut,{children:`${y("unifiedCanvas.canvasScale")}: ${f}%`}),v&&i.jsx(ut,{style:{color:Uy},children:"Preserve Masked Area: On"}),m&&i.jsx(ut,{style:{color:n},children:`${y("unifiedCanvas.boundingBox")}: ${o}`}),a&&i.jsx(ut,{style:{color:n},children:`${y("unifiedCanvas.scaledBoundingBox")}: ${s}`}),h&&i.jsxs(i.Fragment,{children:[i.jsx(ut,{children:`${y("unifiedCanvas.boundingBoxPosition")}: ${r}`}),i.jsx(ut,{children:`${y("unifiedCanvas.canvasDimensions")}: ${d}`}),i.jsx(ut,{children:`${y("unifiedCanvas.canvasPosition")}: ${c}`}),i.jsx(cde,{})]})]})},fde=Oe(vn,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageScale:r,isDrawing:o,isTransformingBoundingBox:s,isMovingBoundingBox:a,tool:c,shouldSnapToGrid:d}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,isDrawing:o,isMovingBoundingBox:a,isTransformingBoundingBox:s,stageScale:r,shouldSnapToGrid:d,tool:c,hitStrokeWidth:20/r}},{memoizeOptions:{resultEqualityCheck:en}}),pde=e=>{const{...t}=e,n=ce(),{boundingBoxCoordinates:r,boundingBoxDimensions:o,isDrawing:s,isMovingBoundingBox:a,isTransformingBoundingBox:c,stageScale:d,shouldSnapToGrid:f,tool:h,hitStrokeWidth:m}=Y(fde),v=p.useRef(null),y=p.useRef(null),[S,x]=p.useState(!1);p.useEffect(()=>{var G;!v.current||!y.current||(v.current.nodes([y.current]),(G=v.current.getLayer())==null||G.batchDraw())},[]);const w=64*d,_=p.useCallback(G=>{if(!f){n(d0({x:Math.floor(G.target.x()),y:Math.floor(G.target.y())}));return}const $=G.target.x(),H=G.target.y(),U=hS($,64),q=hS(H,64);G.target.x(U),G.target.y(q),n(d0({x:U,y:q}))},[n,f]),k=p.useCallback(()=>{if(!y.current)return;const G=y.current,$=G.scaleX(),H=G.scaleY(),U=Math.round(G.width()*$),q=Math.round(G.height()*H),z=Math.round(G.x()),L=Math.round(G.y());n(_d({width:U,height:q})),n(d0({x:f?od(z,64):z,y:f?od(L,64):L})),G.scaleX(1),G.scaleY(1)},[n,f]),P=p.useCallback((G,$,H)=>{const U=G.x%w,q=G.y%w;return{x:od($.x,w)+U,y:od($.y,w)+q}},[w]),j=()=>{n(f0(!0))},I=()=>{n(f0(!1)),n(p0(!1)),n(cp(!1)),x(!1)},O=()=>{n(p0(!0))},T=()=>{n(f0(!1)),n(p0(!1)),n(cp(!1)),x(!1)},R=()=>{x(!0)},M=()=>{!c&&!a&&x(!1)},D=()=>{n(cp(!0))},A=()=>{n(cp(!1))};return i.jsxs(ti,{...t,children:[i.jsx(ka,{height:o.height,width:o.width,x:r.x,y:r.y,onMouseEnter:D,onMouseOver:D,onMouseLeave:A,onMouseOut:A}),i.jsx(ka,{draggable:!0,fillEnabled:!1,height:o.height,hitStrokeWidth:m,listening:!s&&h==="move",onDragStart:O,onDragEnd:T,onDragMove:_,onMouseDown:O,onMouseOut:M,onMouseOver:R,onMouseEnter:R,onMouseUp:T,onTransform:k,onTransformEnd:I,ref:y,stroke:S?"rgba(255,255,255,0.7)":"white",strokeWidth:(S?8:1)/d,width:o.width,x:r.x,y:r.y}),i.jsx(Iue,{anchorCornerRadius:3,anchorDragBoundFunc:P,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:O,onDragEnd:T,onMouseDown:j,onMouseUp:I,onTransformEnd:I,ref:v,rotateEnabled:!1})]})},hde=Oe(vn,e=>{const{cursorPosition:t,brushSize:n,colorPickerColor:r,maskColor:o,brushColor:s,tool:a,layer:c,shouldShowBrush:d,isMovingBoundingBox:f,isTransformingBoundingBox:h,stageScale:m,stageDimensions:v,boundingBoxCoordinates:y,boundingBoxDimensions:S,shouldRestrictStrokesToBox:x}=e,w=x?{clipX:y.x,clipY:y.y,clipWidth:S.width,clipHeight:S.height}:{};return{cursorPosition:t,brushX:t?t.x:v.width/2,brushY:t?t.y:v.height/2,radius:n/2,colorPickerOuterRadius:mS/m,colorPickerInnerRadius:(mS-k1+1)/m,maskColorString:Il({...o,a:.5}),brushColorString:Il(s),colorPickerColorString:Il(r),tool:a,layer:c,shouldShowBrush:d,shouldDrawBrushPreview:!(f||h||!t)&&d,strokeWidth:1.5/m,dotRadius:1.5/m,clip:w}},{memoizeOptions:{resultEqualityCheck:en}}),mde=e=>{const{...t}=e,{brushX:n,brushY:r,radius:o,maskColorString:s,tool:a,layer:c,shouldDrawBrushPreview:d,dotRadius:f,strokeWidth:h,brushColorString:m,colorPickerColorString:v,colorPickerInnerRadius:y,colorPickerOuterRadius:S,clip:x}=Y(hde);return d?i.jsxs(ti,{listening:!1,...x,...t,children:[a==="colorPicker"?i.jsxs(i.Fragment,{children:[i.jsx(ll,{x:n,y:r,radius:S,stroke:m,strokeWidth:k1,strokeScaleEnabled:!1}),i.jsx(ll,{x:n,y:r,radius:y,stroke:v,strokeWidth:k1,strokeScaleEnabled:!1})]}):i.jsxs(i.Fragment,{children:[i.jsx(ll,{x:n,y:r,radius:o,fill:c==="mask"?s:m,globalCompositeOperation:a==="eraser"?"destination-out":"source-out"}),i.jsx(ll,{x:n,y:r,radius:o,stroke:"rgba(255,255,255,0.4)",strokeWidth:h*2,strokeEnabled:!0,listening:!1}),i.jsx(ll,{x:n,y:r,radius:o,stroke:"rgba(0,0,0,1)",strokeWidth:h,strokeEnabled:!0,listening:!1})]}),i.jsx(ll,{x:n,y:r,radius:f*2,fill:"rgba(255,255,255,0.4)",listening:!1}),i.jsx(ll,{x:n,y:r,radius:f,fill:"rgba(0,0,0,1)",listening:!1})]}):null},gde=Oe([vn,vr],(e,t)=>{const{isMaskEnabled:n,stageScale:r,shouldShowBoundingBox:o,isTransformingBoundingBox:s,isMouseOverBoundingBox:a,isMovingBoundingBox:c,stageDimensions:d,stageCoordinates:f,tool:h,isMovingStage:m,shouldShowIntermediates:v,shouldShowGrid:y,shouldRestrictStrokesToBox:S,shouldAntialias:x}=e;let w="none";return h==="move"||t?m?w="grabbing":w="grab":s?w=void 0:S&&!a&&(w="default"),{isMaskEnabled:n,isModifyingBoundingBox:s||c,shouldShowBoundingBox:o,shouldShowGrid:y,stageCoordinates:f,stageCursor:w,stageDimensions:d,stageScale:r,tool:h,isStaging:t,shouldShowIntermediates:v,shouldAntialias:x}},Lt),vde=Ie(Oue,{shouldForwardProp:e=>!["sx"].includes(e)}),FP=()=>{const{isMaskEnabled:e,isModifyingBoundingBox:t,shouldShowBoundingBox:n,shouldShowGrid:r,stageCoordinates:o,stageCursor:s,stageDimensions:a,stageScale:c,tool:d,isStaging:f,shouldShowIntermediates:h,shouldAntialias:m}=Y(gde);Due();const v=p.useRef(null),y=p.useRef(null),S=p.useCallback(D=>{u9(D),v.current=D},[]),x=p.useCallback(D=>{c9(D),y.current=D},[]),w=p.useRef({x:0,y:0}),_=p.useRef(!1),k=Vue(v),P=Nue(v),j=Fue(v,_),I=$ue(v,_,w),O=Lue(),{handleDragStart:T,handleDragMove:R,handleDragEnd:M}=Rue();return i.jsx(X,{sx:{position:"relative",height:"100%",width:"100%",borderRadius:"base"},children:i.jsxs(ut,{sx:{position:"relative"},children:[i.jsxs(vde,{tabIndex:-1,ref:S,sx:{outline:"none",overflow:"hidden",cursor:s||void 0,canvas:{outline:"none"}},x:o.x,y:o.y,width:a.width,height:a.height,scale:{x:c,y:c},onTouchStart:P,onTouchMove:I,onTouchEnd:j,onMouseDown:P,onMouseLeave:O,onMouseMove:I,onMouseUp:j,onDragStart:T,onDragMove:R,onDragEnd:M,onContextMenu:D=>D.evt.preventDefault(),onWheel:k,draggable:(d==="move"||f)&&!t,children:[i.jsx(rd,{id:"grid",visible:r,children:i.jsx(que,{})}),i.jsx(rd,{id:"base",ref:x,listening:!1,imageSmoothingEnabled:m,children:i.jsx(rde,{})}),i.jsxs(rd,{id:"mask",visible:e,listening:!1,children:[i.jsx(Jue,{visible:!0,listening:!1}),i.jsx(Zue,{listening:!1})]}),i.jsx(rd,{children:i.jsx(Uue,{})}),i.jsxs(rd,{id:"preview",imageSmoothingEnabled:m,children:[!f&&i.jsx(mde,{visible:d!=="move",listening:!1}),i.jsx(sde,{visible:f}),h&&i.jsx(Kue,{}),i.jsx(pde,{visible:n&&!f})]})]}),i.jsx(dde,{}),i.jsx(ide,{})]})})},yde=Oe(vn,d9,Gr,(e,t,n)=>{const{doesCanvasNeedScaling:r,isCanvasInitialized:o}=e;return{doesCanvasNeedScaling:r,activeTabName:n,initialCanvasImage:t,isCanvasInitialized:o}}),HP=()=>{const e=ce(),{doesCanvasNeedScaling:t,activeTabName:n,initialCanvasImage:r,isCanvasInitialized:o}=Y(yde),s=p.useRef(null);return p.useLayoutEffect(()=>{window.setTimeout(()=>{if(!s.current)return;const{clientWidth:a,clientHeight:c}=s.current;e(f9({width:a,height:c})),e(o?p9():tg()),e(s3(!1))},0)},[e,r,t,n,o]),i.jsx(X,{ref:s,sx:{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:4,width:"100%",height:"100%"},children:i.jsx(mu,{thickness:"2px",size:"xl"})})};function RR(e,t,n=250){const[r,o]=p.useState(0);return p.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 bde=Ie(vR,{baseStyle:{paddingInline:4},shouldForwardProp:e=>!["pickerColor"].includes(e)}),m1={width:6,height:6,borderColor:"base.100"},xde=e=>{const{styleClass:t="",...n}=e;return i.jsx(bde,{sx:{".react-colorful__hue-pointer":m1,".react-colorful__saturation-pointer":m1,".react-colorful__alpha-pointer":m1},className:t,...n})},Xm=p.memo(xde),wde=Oe([vn,vr],(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:en}}),Sde=()=>{const e=ce(),{t}=we(),{layer:n,maskColor:r,isMaskEnabled:o,shouldPreserveMaskedArea:s,isStaging:a}=Y(wde);et(["q"],()=>{c()},{enabled:()=>!a,preventDefault:!0},[n]),et(["shift+c"],()=>{d()},{enabled:()=>!a,preventDefault:!0},[]),et(["h"],()=>{f()},{enabled:()=>!a,preventDefault:!0},[o]);const c=()=>{e(Eh(n==="mask"?"base":"mask"))},d=()=>e(nb()),f=()=>e(af(!o));return i.jsx(Ba,{triggerComponent:i.jsx(Or,{children:i.jsx(Ne,{"aria-label":t("unifiedCanvas.maskingOptions"),tooltip:t("unifiedCanvas.maskingOptions"),icon:i.jsx(qW,{}),isChecked:n==="mask",isDisabled:a})}),children:i.jsxs(X,{direction:"column",gap:2,children:[i.jsx(Hn,{label:`${t("unifiedCanvas.enableMask")} (H)`,isChecked:o,onChange:f}),i.jsx(Hn,{label:t("unifiedCanvas.preserveMaskedArea"),isChecked:s,onChange:h=>e(j3(h.target.checked))}),i.jsx(Xm,{sx:{paddingTop:2,paddingBottom:2},pickerColor:r,onChange:h=>e(E3(h))}),i.jsxs(cn,{size:"sm",leftIcon:i.jsx(Mo,{}),onClick:d,children:[t("unifiedCanvas.clearMask")," (Shift+C)"]})]})})},Cde=Oe([vn,Gr,wo],(e,t,n)=>{const{futureLayerStates:r}=e;return{canRedo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:en}});function MR(){const e=ce(),{canRedo:t,activeTabName:n}=Y(Cde),{t:r}=we(),o=()=>{e(h9())};return et(["meta+shift+z","ctrl+shift+z","control+y","meta+y"],()=>{o()},{enabled:()=>t,preventDefault:!0},[n,t]),i.jsx(Ne,{"aria-label":`${r("unifiedCanvas.redo")} (Ctrl+Shift+Z)`,tooltip:`${r("unifiedCanvas.redo")} (Ctrl+Shift+Z)`,icon:i.jsx(QW,{}),onClick:o,isDisabled:!t})}const DR=()=>{const e=Y(vr),t=ce(),{t:n}=we();return i.jsxs(s2,{title:n("unifiedCanvas.clearCanvasHistory"),acceptCallback:()=>t(m9()),acceptButtonText:n("unifiedCanvas.clearHistory"),triggerComponent:i.jsx(cn,{size:"sm",leftIcon:i.jsx(Mo,{}),isDisabled:e,children:n("unifiedCanvas.clearCanvasHistory")}),children:[i.jsx("p",{children:n("unifiedCanvas.clearCanvasHistoryMessage")}),i.jsx("br",{}),i.jsx("p",{children:n("unifiedCanvas.clearCanvasHistoryConfirm")})]})},_de=Oe([vn],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:o,shouldShowGrid:s,shouldShowIntermediates:a,shouldSnapToGrid:c,shouldRestrictStrokesToBox:d,shouldAntialias:f}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:o,shouldShowGrid:s,shouldShowIntermediates:a,shouldSnapToGrid:c,shouldRestrictStrokesToBox:d,shouldAntialias:f}},{memoizeOptions:{resultEqualityCheck:en}}),kde=()=>{const e=ce(),{t}=we(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldDarkenOutsideBoundingBox:o,shouldShowCanvasDebugInfo:s,shouldShowGrid:a,shouldShowIntermediates:c,shouldSnapToGrid:d,shouldRestrictStrokesToBox:f,shouldAntialias:h}=Y(_de);et(["n"],()=>{e(jh(!d))},{enabled:!0,preventDefault:!0},[d]);const m=v=>e(jh(v.target.checked));return i.jsx(Ba,{isLazy:!1,triggerComponent:i.jsx(Ne,{tooltip:t("unifiedCanvas.canvasSettings"),"aria-label":t("unifiedCanvas.canvasSettings"),icon:i.jsx(mx,{})}),children:i.jsxs(X,{direction:"column",gap:2,children:[i.jsx(Hn,{label:t("unifiedCanvas.showIntermediates"),isChecked:c,onChange:v=>e(I3(v.target.checked))}),i.jsx(Hn,{label:t("unifiedCanvas.showGrid"),isChecked:a,onChange:v=>e(O3(v.target.checked))}),i.jsx(Hn,{label:t("unifiedCanvas.snapToGrid"),isChecked:d,onChange:m}),i.jsx(Hn,{label:t("unifiedCanvas.darkenOutsideSelection"),isChecked:o,onChange:v=>e(T3(v.target.checked))}),i.jsx(Hn,{label:t("unifiedCanvas.autoSaveToGallery"),isChecked:n,onChange:v=>e(R3(v.target.checked))}),i.jsx(Hn,{label:t("unifiedCanvas.saveBoxRegionOnly"),isChecked:r,onChange:v=>e(M3(v.target.checked))}),i.jsx(Hn,{label:t("unifiedCanvas.limitStrokesToBox"),isChecked:f,onChange:v=>e(D3(v.target.checked))}),i.jsx(Hn,{label:t("unifiedCanvas.showCanvasDebugInfo"),isChecked:s,onChange:v=>e(A3(v.target.checked))}),i.jsx(Hn,{label:t("unifiedCanvas.antialiasing"),isChecked:h,onChange:v=>e(N3(v.target.checked))}),i.jsx(DR,{})]})})},Pde=Oe([vn,vr,wo],(e,t,n)=>{const{isProcessing:r}=n,{tool:o,brushColor:s,brushSize:a}=e;return{tool:o,isStaging:t,isProcessing:r,brushColor:s,brushSize:a}},{memoizeOptions:{resultEqualityCheck:en}}),jde=()=>{const e=ce(),{tool:t,brushColor:n,brushSize:r,isStaging:o}=Y(Pde),{t:s}=we();et(["b"],()=>{a()},{enabled:()=>!o,preventDefault:!0},[]),et(["e"],()=>{c()},{enabled:()=>!o,preventDefault:!0},[t]),et(["c"],()=>{d()},{enabled:()=>!o,preventDefault:!0},[t]),et(["shift+f"],()=>{f()},{enabled:()=>!o,preventDefault:!0}),et(["delete","backspace"],()=>{h()},{enabled:()=>!o,preventDefault:!0}),et(["BracketLeft"],()=>{e(Rc(Math.max(r-5,5)))},{enabled:()=>!o,preventDefault:!0},[r]),et(["BracketRight"],()=>{e(Rc(Math.min(r+5,500)))},{enabled:()=>!o,preventDefault:!0},[r]),et(["shift+BracketLeft"],()=>{e(Mc({...n,a:Ks(n.a-.05,.05,1)}))},{enabled:()=>!o,preventDefault:!0},[n]),et(["shift+BracketRight"],()=>{e(Mc({...n,a:Ks(n.a+.05,.05,1)}))},{enabled:()=>!o,preventDefault:!0},[n]);const a=()=>e(va("brush")),c=()=>e(va("eraser")),d=()=>e(va("colorPicker")),f=()=>e(z3()),h=()=>e($3());return i.jsxs(Or,{isAttached:!0,children:[i.jsx(Ne,{"aria-label":`${s("unifiedCanvas.brush")} (B)`,tooltip:`${s("unifiedCanvas.brush")} (B)`,icon:i.jsx(SE,{}),isChecked:t==="brush"&&!o,onClick:a,isDisabled:o}),i.jsx(Ne,{"aria-label":`${s("unifiedCanvas.eraser")} (E)`,tooltip:`${s("unifiedCanvas.eraser")} (E)`,icon:i.jsx(yE,{}),isChecked:t==="eraser"&&!o,isDisabled:o,onClick:c}),i.jsx(Ne,{"aria-label":`${s("unifiedCanvas.fillBoundingBox")} (Shift+F)`,tooltip:`${s("unifiedCanvas.fillBoundingBox")} (Shift+F)`,icon:i.jsx(xE,{}),isDisabled:o,onClick:f}),i.jsx(Ne,{"aria-label":`${s("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,tooltip:`${s("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,icon:i.jsx(Ag,{style:{transform:"rotate(45deg)"}}),isDisabled:o,onClick:h}),i.jsx(Ne,{"aria-label":`${s("unifiedCanvas.colorPicker")} (C)`,tooltip:`${s("unifiedCanvas.colorPicker")} (C)`,icon:i.jsx(bE,{}),isChecked:t==="colorPicker"&&!o,isDisabled:o,onClick:d}),i.jsx(Ba,{triggerComponent:i.jsx(Ne,{"aria-label":s("unifiedCanvas.brushOptions"),tooltip:s("unifiedCanvas.brushOptions"),icon:i.jsx(px,{})}),children:i.jsxs(X,{minWidth:60,direction:"column",gap:4,width:"100%",children:[i.jsx(X,{gap:4,justifyContent:"space-between",children:i.jsx(Et,{label:s("unifiedCanvas.brushSize"),value:r,withInput:!0,onChange:m=>e(Rc(m)),sliderNumberInputProps:{max:500},inputReadOnly:!1})}),i.jsx(Xm,{sx:{width:"100%",paddingTop:2,paddingBottom:2},pickerColor:n,onChange:m=>e(Mc(m))})]})})]})},Ede=Oe([vn,Gr,wo],(e,t,n)=>{const{pastLayerStates:r}=e;return{canUndo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:en}});function AR(){const e=ce(),{t}=we(),{canUndo:n,activeTabName:r}=Y(Ede),o=()=>{e(g9())};return et(["meta+z","ctrl+z"],()=>{o()},{enabled:()=>n,preventDefault:!0},[r,n]),i.jsx(Ne,{"aria-label":`${t("unifiedCanvas.undo")} (Ctrl+Z)`,tooltip:`${t("unifiedCanvas.undo")} (Ctrl+Z)`,icon:i.jsx(hx,{}),onClick:o,isDisabled:!n})}const Ide=Oe([wo,vn,vr],(e,t,n)=>{const{isProcessing:r}=e,{tool:o,shouldCropToBoundingBoxOnSave:s,layer:a,isMaskEnabled:c}=t;return{isProcessing:r,isStaging:n,isMaskEnabled:c,tool:o,layer:a,shouldCropToBoundingBoxOnSave:s}},{memoizeOptions:{resultEqualityCheck:en}}),Ode=()=>{const e=ce(),{isProcessing:t,isStaging:n,isMaskEnabled:r,layer:o,tool:s}=Y(Ide),a=qa(),{t:c}=we(),{openUploader:d}=Ig();et(["v"],()=>{f()},{enabled:()=>!n,preventDefault:!0},[]),et(["r"],()=>{m()},{enabled:()=>!0,preventDefault:!0},[a]),et(["shift+m"],()=>{y()},{enabled:()=>!n,preventDefault:!0},[a,t]),et(["shift+s"],()=>{S()},{enabled:()=>!n,preventDefault:!0},[a,t]),et(["meta+c","ctrl+c"],()=>{x()},{enabled:()=>!n,preventDefault:!0},[a,t]),et(["shift+d"],()=>{w()},{enabled:()=>!n,preventDefault:!0},[a,t]);const f=()=>e(va("move")),h=RR(()=>m(!1),()=>m(!0)),m=(k=!1)=>{const P=qa();if(!P)return;const j=P.getClientRect({skipTransform:!0});e(L3({contentRect:j,shouldScaleTo1:k}))},v=()=>{e(U3()),e(tg())},y=()=>{e(B3())},S=()=>{e(F3())},x=()=>{e(H3())},w=()=>{e(V3())},_=k=>{const P=k;e(Eh(P)),P==="mask"&&!r&&e(af(!0))};return i.jsxs(X,{sx:{alignItems:"center",gap:2,flexWrap:"wrap"},children:[i.jsx(ut,{w:24,children:i.jsx(Er,{tooltip:`${c("unifiedCanvas.layer")} (Q)`,value:o,data:W3,onChange:_,disabled:n})}),i.jsx(Sde,{}),i.jsx(jde,{}),i.jsxs(Or,{isAttached:!0,children:[i.jsx(Ne,{"aria-label":`${c("unifiedCanvas.move")} (V)`,tooltip:`${c("unifiedCanvas.move")} (V)`,icon:i.jsx(mE,{}),isChecked:s==="move"||n,onClick:f}),i.jsx(Ne,{"aria-label":`${c("unifiedCanvas.resetView")} (R)`,tooltip:`${c("unifiedCanvas.resetView")} (R)`,icon:i.jsx(vE,{}),onClick:h})]}),i.jsxs(Or,{isAttached:!0,children:[i.jsx(Ne,{"aria-label":`${c("unifiedCanvas.mergeVisible")} (Shift+M)`,tooltip:`${c("unifiedCanvas.mergeVisible")} (Shift+M)`,icon:i.jsx(wE,{}),onClick:y,isDisabled:n}),i.jsx(Ne,{"aria-label":`${c("unifiedCanvas.saveToGallery")} (Shift+S)`,tooltip:`${c("unifiedCanvas.saveToGallery")} (Shift+S)`,icon:i.jsx(fx,{}),onClick:S,isDisabled:n}),i.jsx(Ne,{"aria-label":`${c("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${c("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,icon:i.jsx(Cu,{}),onClick:x,isDisabled:n}),i.jsx(Ne,{"aria-label":`${c("unifiedCanvas.downloadAsImage")} (Shift+D)`,tooltip:`${c("unifiedCanvas.downloadAsImage")} (Shift+D)`,icon:i.jsx(ux,{}),onClick:w,isDisabled:n})]}),i.jsxs(Or,{isAttached:!0,children:[i.jsx(AR,{}),i.jsx(MR,{})]}),i.jsxs(Or,{isAttached:!0,children:[i.jsx(Ne,{"aria-label":`${c("common.upload")}`,tooltip:`${c("common.upload")}`,icon:i.jsx(Ng,{}),onClick:d,isDisabled:n}),i.jsx(Ne,{"aria-label":`${c("unifiedCanvas.clearCanvas")}`,tooltip:`${c("unifiedCanvas.clearCanvas")}`,icon:i.jsx(Mo,{}),onClick:v,colorScheme:"error",isDisabled:n})]}),i.jsx(Or,{isAttached:!0,children:i.jsx(kde,{})})]})},Tde=Oe([vn],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:o,shouldAntialias:s}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:o,shouldAntialias:s}},{memoizeOptions:{resultEqualityCheck:en}}),Rde=()=>{const e=ce(),{t}=we(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldShowCanvasDebugInfo:o,shouldShowIntermediates:s,shouldAntialias:a}=Y(Tde);return i.jsx(Ba,{isLazy:!1,triggerComponent:i.jsx(Ne,{tooltip:t("unifiedCanvas.canvasSettings"),tooltipProps:{placement:"bottom"},"aria-label":t("unifiedCanvas.canvasSettings"),icon:i.jsx(mx,{})}),children:i.jsxs(X,{direction:"column",gap:2,children:[i.jsx(Hn,{label:t("unifiedCanvas.showIntermediates"),isChecked:s,onChange:c=>e(I3(c.target.checked))}),i.jsx(Hn,{label:t("unifiedCanvas.autoSaveToGallery"),isChecked:n,onChange:c=>e(R3(c.target.checked))}),i.jsx(Hn,{label:t("unifiedCanvas.saveBoxRegionOnly"),isChecked:r,onChange:c=>e(M3(c.target.checked))}),i.jsx(Hn,{label:t("unifiedCanvas.showCanvasDebugInfo"),isChecked:o,onChange:c=>e(A3(c.target.checked))}),i.jsx(Hn,{label:t("unifiedCanvas.antialiasing"),isChecked:a,onChange:c=>e(N3(c.target.checked))}),i.jsx(DR,{})]})})};function Mde(){const e=Y(vr),t=qa(),n=Y(a=>a.system.isProcessing),r=ce(),{t:o}=we();et(["meta+c","ctrl+c"],()=>{s()},{enabled:()=>!e,preventDefault:!0},[t,n]);const s=()=>{r(H3())};return i.jsx(Ne,{"aria-label":`${o("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${o("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,icon:i.jsx(Cu,{}),onClick:s,isDisabled:e})}function Dde(){const e=ce(),{t}=we(),n=qa(),r=Y(vr);et(["shift+d"],()=>{o()},{enabled:()=>!r,preventDefault:!0},[n]);const o=()=>{e(V3())};return i.jsx(Ne,{"aria-label":`${t("unifiedCanvas.downloadAsImage")} (Shift+D)`,tooltip:`${t("unifiedCanvas.downloadAsImage")} (Shift+D)`,icon:i.jsx(ux,{}),onClick:o,isDisabled:r})}function Ade(){const e=Y(vr),{openUploader:t}=Ig(),{t:n}=we();return i.jsx(Ne,{"aria-label":n("common.upload"),tooltip:n("common.upload"),icon:i.jsx(Ng,{}),onClick:t,isDisabled:e})}const Nde=Oe([vn,vr],(e,t)=>{const{layer:n,isMaskEnabled:r}=e;return{layer:n,isMaskEnabled:r,isStaging:t}},{memoizeOptions:{resultEqualityCheck:en}});function zde(){const e=ce(),{t}=we(),{layer:n,isMaskEnabled:r,isStaging:o}=Y(Nde),s=()=>{e(Eh(n==="mask"?"base":"mask"))};et(["q"],()=>{s()},{enabled:()=>!o,preventDefault:!0},[n]);const a=c=>{const d=c;e(Eh(d)),d==="mask"&&!r&&e(af(!0))};return i.jsx(Er,{tooltip:`${t("unifiedCanvas.layer")} (Q)`,"aria-label":`${t("unifiedCanvas.layer")} (Q)`,value:n,data:W3,onChange:a,disabled:o,w:"full"})}function $de(){const e=ce(),{t}=we(),n=qa(),r=Y(vr),o=Y(a=>a.system.isProcessing);et(["shift+m"],()=>{s()},{enabled:()=>!r,preventDefault:!0},[n,o]);const s=()=>{e(B3())};return i.jsx(Ne,{"aria-label":`${t("unifiedCanvas.mergeVisible")} (Shift+M)`,tooltip:`${t("unifiedCanvas.mergeVisible")} (Shift+M)`,icon:i.jsx(wE,{}),onClick:s,isDisabled:r})}function Lde(){const e=Y(s=>s.canvas.tool),t=Y(vr),n=ce(),{t:r}=we();et(["v"],()=>{o()},{enabled:()=>!t,preventDefault:!0},[]);const o=()=>n(va("move"));return i.jsx(Ne,{"aria-label":`${r("unifiedCanvas.move")} (V)`,tooltip:`${r("unifiedCanvas.move")} (V)`,icon:i.jsx(mE,{}),isChecked:e==="move"||t,onClick:o})}function Bde(){const e=Y(s=>s.ui.shouldPinParametersPanel),t=Y(s=>s.ui.shouldShowParametersPanel),n=ce(),{t:r}=we(),o=()=>{n(rb(!0)),e&&n(ea())};return!e||!t?i.jsxs(X,{flexDirection:"column",gap:2,children:[i.jsx(Ne,{tooltip:`${r("parameters.showOptionsPanel")} (O)`,tooltipProps:{placement:"top"},"aria-label":r("parameters.showOptionsPanel"),onClick:o,children:i.jsx(px,{})}),i.jsx(X,{children:i.jsx(e2,{iconButton:!0})}),i.jsx(X,{children:i.jsx(Jx,{width:"100%",height:"40px",btnGroupWidth:"100%"})})]}):null}function Fde(){const e=ce(),{t}=we(),n=Y(vr),r=()=>{e(U3()),e(tg())};return i.jsx(Ne,{"aria-label":t("unifiedCanvas.clearCanvas"),tooltip:t("unifiedCanvas.clearCanvas"),icon:i.jsx(Mo,{}),onClick:r,isDisabled:n,colorScheme:"error"})}function Hde(){const e=qa(),t=ce(),{t:n}=we();et(["r"],()=>{o()},{enabled:()=>!0,preventDefault:!0},[e]);const r=RR(()=>o(!1),()=>o(!0)),o=(s=!1)=>{const a=qa();if(!a)return;const c=a.getClientRect({skipTransform:!0});t(L3({contentRect:c,shouldScaleTo1:s}))};return i.jsx(Ne,{"aria-label":`${n("unifiedCanvas.resetView")} (R)`,tooltip:`${n("unifiedCanvas.resetView")} (R)`,icon:i.jsx(vE,{}),onClick:r})}function Vde(){const e=Y(vr),t=qa(),n=Y(a=>a.system.isProcessing),r=ce(),{t:o}=we();et(["shift+s"],()=>{s()},{enabled:()=>!e,preventDefault:!0},[t,n]);const s=()=>{r(F3())};return i.jsx(Ne,{"aria-label":`${o("unifiedCanvas.saveToGallery")} (Shift+S)`,tooltip:`${o("unifiedCanvas.saveToGallery")} (Shift+S)`,icon:i.jsx(fx,{}),onClick:s,isDisabled:e})}const Wde=Oe([vn,vr,wo],(e,t,n)=>{const{isProcessing:r}=n,{tool:o}=e;return{tool:o,isStaging:t,isProcessing:r}},{memoizeOptions:{resultEqualityCheck:en}}),Ude=()=>{const e=ce(),{t}=we(),{tool:n,isStaging:r}=Y(Wde);et(["b"],()=>{o()},{enabled:()=>!r,preventDefault:!0},[]),et(["e"],()=>{s()},{enabled:()=>!r,preventDefault:!0},[n]),et(["c"],()=>{a()},{enabled:()=>!r,preventDefault:!0},[n]),et(["shift+f"],()=>{c()},{enabled:()=>!r,preventDefault:!0}),et(["delete","backspace"],()=>{d()},{enabled:()=>!r,preventDefault:!0});const o=()=>e(va("brush")),s=()=>e(va("eraser")),a=()=>e(va("colorPicker")),c=()=>e(z3()),d=()=>e($3());return i.jsxs(X,{flexDirection:"column",gap:2,children:[i.jsxs(Or,{children:[i.jsx(Ne,{"aria-label":`${t("unifiedCanvas.brush")} (B)`,tooltip:`${t("unifiedCanvas.brush")} (B)`,icon:i.jsx(SE,{}),isChecked:n==="brush"&&!r,onClick:o,isDisabled:r}),i.jsx(Ne,{"aria-label":`${t("unifiedCanvas.eraser")} (E)`,tooltip:`${t("unifiedCanvas.eraser")} (B)`,icon:i.jsx(yE,{}),isChecked:n==="eraser"&&!r,isDisabled:r,onClick:s})]}),i.jsxs(Or,{children:[i.jsx(Ne,{"aria-label":`${t("unifiedCanvas.fillBoundingBox")} (Shift+F)`,tooltip:`${t("unifiedCanvas.fillBoundingBox")} (Shift+F)`,icon:i.jsx(xE,{}),isDisabled:r,onClick:c}),i.jsx(Ne,{"aria-label":`${t("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,tooltip:`${t("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,icon:i.jsx(Ag,{style:{transform:"rotate(45deg)"}}),isDisabled:r,onClick:d})]}),i.jsx(Ne,{"aria-label":`${t("unifiedCanvas.colorPicker")} (C)`,tooltip:`${t("unifiedCanvas.colorPicker")} (C)`,icon:i.jsx(bE,{}),isChecked:n==="colorPicker"&&!r,isDisabled:r,onClick:a,width:"max-content"})]})},Gde=()=>i.jsxs(X,{flexDirection:"column",rowGap:2,width:"min-content",children:[i.jsx(zde,{}),i.jsx(Ude,{}),i.jsxs(X,{gap:2,children:[i.jsx(Lde,{}),i.jsx(Hde,{})]}),i.jsxs(X,{columnGap:2,children:[i.jsx($de,{}),i.jsx(Vde,{})]}),i.jsxs(X,{columnGap:2,children:[i.jsx(Mde,{}),i.jsx(Dde,{})]}),i.jsxs(X,{gap:2,children:[i.jsx(AR,{}),i.jsx(MR,{})]}),i.jsxs(X,{gap:2,children:[i.jsx(Ade,{}),i.jsx(Fde,{})]}),i.jsx(Rde,{}),i.jsx(Bde,{})]});function qde(){const e=ce(),t=Y(o=>o.canvas.brushSize),{t:n}=we(),r=Y(vr);return et(["BracketLeft"],()=>{e(Rc(Math.max(t-5,5)))},{enabled:()=>!r,preventDefault:!0},[t]),et(["BracketRight"],()=>{e(Rc(Math.min(t+5,500)))},{enabled:()=>!r,preventDefault:!0},[t]),i.jsx(Et,{label:n("unifiedCanvas.brushSize"),value:t,withInput:!0,onChange:o=>e(Rc(o)),sliderNumberInputProps:{max:500},inputReadOnly:!1,isCompact:!0})}const Yde=Oe([vn,vr],(e,t)=>{const{brushColor:n,maskColor:r,layer:o}=e;return{brushColor:n,maskColor:r,layer:o,isStaging:t}},{memoizeOptions:{resultEqualityCheck:en}});function Kde(){const e=ce(),{brushColor:t,maskColor:n,layer:r,isStaging:o}=Y(Yde),s=()=>{if(r==="base")return`rgba(${t.r},${t.g},${t.b},${t.a})`;if(r==="mask")return`rgba(${n.r},${n.g},${n.b},${n.a})`};return et(["shift+BracketLeft"],()=>{e(Mc({...t,a:Ks(t.a-.05,.05,1)}))},{enabled:()=>!o,preventDefault:!0},[t]),et(["shift+BracketRight"],()=>{e(Mc({...t,a:Ks(t.a+.05,.05,1)}))},{enabled:()=>!o,preventDefault:!0},[t]),i.jsx(Ba,{triggerComponent:i.jsx(ut,{sx:{width:7,height:7,minWidth:7,minHeight:7,borderRadius:"full",bg:s(),cursor:"pointer"}}),children:i.jsxs(X,{minWidth:60,direction:"column",gap:4,width:"100%",children:[r==="base"&&i.jsx(Xm,{sx:{width:"100%",paddingTop:2,paddingBottom:2},pickerColor:t,onChange:a=>e(Mc(a))}),r==="mask"&&i.jsx(Xm,{sx:{width:"100%",paddingTop:2,paddingBottom:2},pickerColor:n,onChange:a=>e(E3(a))})]})})}function NR(){return i.jsxs(X,{columnGap:4,alignItems:"center",children:[i.jsx(qde,{}),i.jsx(Kde,{})]})}function Xde(){const e=ce(),t=Y(r=>r.canvas.shouldRestrictStrokesToBox),{t:n}=we();return i.jsx(Hn,{label:n("unifiedCanvas.betaLimitToBox"),isChecked:t,onChange:r=>e(D3(r.target.checked))})}function Zde(){return i.jsxs(X,{gap:4,alignItems:"center",children:[i.jsx(NR,{}),i.jsx(Xde,{})]})}function Qde(){const e=ce(),{t}=we(),n=()=>e(nb());return i.jsx(cn,{size:"sm",leftIcon:i.jsx(Mo,{}),onClick:n,tooltip:`${t("unifiedCanvas.clearMask")} (Shift+C)`,children:t("unifiedCanvas.betaClear")})}function Jde(){const e=Y(o=>o.canvas.isMaskEnabled),t=ce(),{t:n}=we(),r=()=>t(af(!e));return i.jsx(Hn,{label:`${n("unifiedCanvas.enableMask")} (H)`,isChecked:e,onChange:r})}function efe(){const e=ce(),{t}=we(),n=Y(r=>r.canvas.shouldPreserveMaskedArea);return i.jsx(Hn,{label:t("unifiedCanvas.betaPreserveMasked"),isChecked:n,onChange:r=>e(j3(r.target.checked))})}function tfe(){return i.jsxs(X,{gap:4,alignItems:"center",children:[i.jsx(NR,{}),i.jsx(Jde,{}),i.jsx(efe,{}),i.jsx(Qde,{})]})}function nfe(){const e=Y(r=>r.canvas.shouldDarkenOutsideBoundingBox),t=ce(),{t:n}=we();return i.jsx(Hn,{label:n("unifiedCanvas.betaDarkenOutside"),isChecked:e,onChange:r=>t(T3(r.target.checked))})}function rfe(){const e=Y(r=>r.canvas.shouldShowGrid),t=ce(),{t:n}=we();return i.jsx(Hn,{label:n("unifiedCanvas.showGrid"),isChecked:e,onChange:r=>t(O3(r.target.checked))})}function ofe(){const e=Y(o=>o.canvas.shouldSnapToGrid),t=ce(),{t:n}=we(),r=o=>t(jh(o.target.checked));return i.jsx(Hn,{label:`${n("unifiedCanvas.snapToGrid")} (N)`,isChecked:e,onChange:r})}function sfe(){return i.jsxs(X,{alignItems:"center",gap:4,children:[i.jsx(rfe,{}),i.jsx(ofe,{}),i.jsx(nfe,{})]})}const afe=Oe([vn],e=>{const{tool:t,layer:n}=e;return{tool:t,layer:n}},{memoizeOptions:{resultEqualityCheck:en}});function ife(){const{tool:e,layer:t}=Y(afe);return i.jsxs(X,{height:8,minHeight:8,maxHeight:8,alignItems:"center",children:[t=="base"&&["brush","eraser","colorPicker"].includes(e)&&i.jsx(Zde,{}),t=="mask"&&["brush","eraser","colorPicker"].includes(e)&&i.jsx(tfe,{}),e=="move"&&i.jsx(sfe,{})]})}const lfe=Oe([vn,ks],(e,t)=>{const{doesCanvasNeedScaling:n}=e,{shouldUseCanvasBetaLayout:r}=t;return{doesCanvasNeedScaling:n,shouldUseCanvasBetaLayout:r}},Lt),g1={id:"canvas-intial-image",actionType:"SET_CANVAS_INITIAL_IMAGE"},cfe=()=>{const e=ce(),{doesCanvasNeedScaling:t,shouldUseCanvasBetaLayout:n}=Y(lfe),{isOver:r,setNodeRef:o,active:s}=rf({id:"unifiedCanvas",data:g1});return p.useLayoutEffect(()=>{const a=()=>{e(ea())};return window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[e]),n?i.jsx(ut,{layerStyle:"first",ref:o,tabIndex:0,sx:{w:"full",h:"full",p:4,borderRadius:"base"},children:i.jsxs(X,{sx:{w:"full",h:"full",gap:4},children:[i.jsx(Gde,{}),i.jsxs(X,{sx:{flexDir:"column",w:"full",h:"full",gap:4,position:"relative"},children:[i.jsx(ife,{}),i.jsxs(ut,{sx:{w:"full",h:"full",position:"relative"},children:[t?i.jsx(HP,{}):i.jsx(FP,{}),qc(g1,s)&&i.jsx(eu,{isOver:r,label:"Set Canvas Initial Image"})]})]})]})}):i.jsx(ut,{ref:o,tabIndex:-1,sx:{layerStyle:"first",w:"full",h:"full",p:4,borderRadius:"base"},children:i.jsxs(X,{sx:{flexDirection:"column",alignItems:"center",gap:4,w:"full",h:"full"},children:[i.jsx(Ode,{}),i.jsx(X,{sx:{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:4,w:"full",h:"full"},children:i.jsxs(ut,{sx:{w:"full",h:"full",position:"relative"},children:[t?i.jsx(HP,{}):i.jsx(FP,{}),qc(g1,s)&&i.jsx(eu,{isOver:r,label:"Set Canvas Initial Image"})]})})]})})},ufe=p.memo(cfe),dfe=Oe([Zo,wo],(e,t)=>{const{infillMethod:n}=e,{infillMethods:r}=t;return{infillMethod:n,infillMethods:r}},Lt),ffe=()=>{const e=ce(),{infillMethod:t,infillMethods:n}=Y(dfe),{t:r}=we(),o=p.useCallback(s=>{e(v9(s))},[e]);return i.jsx(Er,{label:r("parameters.infillMethod"),value:t,data:n,onChange:o})},pfe=p.memo(ffe),hfe=Oe([Zo],e=>{const{tileSize:t,infillMethod:n}=e;return{tileSize:t,infillMethod:n}},Lt),mfe=()=>{const e=ce(),{tileSize:t,infillMethod:n}=Y(hfe),{t:r}=we(),o=p.useCallback(a=>{e(gS(a))},[e]),s=p.useCallback(()=>{e(gS(32))},[e]);return i.jsx(Et,{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})},gfe=p.memo(mfe),vfe=Oe([vn],e=>{const{boundingBoxScaleMethod:t}=e;return{boundingBoxScale:t}},Lt),yfe=()=>{const e=ce(),{boundingBoxScale:t}=Y(vfe),{t:n}=we(),r=o=>{e(b9(o))};return i.jsx(Er,{label:n("parameters.scaleBeforeProcessing"),data:y9,value:t,onChange:r})},bfe=p.memo(yfe),xfe=Oe([Zo,wo,vn],(e,t,n)=>{const{scaledBoundingBoxDimensions:r,boundingBoxScaleMethod:o}=n;return{scaledBoundingBoxDimensions:r,isManual:o==="manual"}},Lt),wfe=()=>{const e=ce(),{isManual:t,scaledBoundingBoxDimensions:n}=Y(xfe),{t:r}=we(),o=a=>{e(Ih({...n,height:Math.floor(a)}))},s=()=>{e(Ih({...n,height:Math.floor(512)}))};return i.jsx(Et,{isDisabled:!t,label:r("parameters.scaledHeight"),min:64,max:1024,step:64,value:n.height,onChange:o,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:s})},Sfe=p.memo(wfe),Cfe=Oe([vn],e=>{const{boundingBoxScaleMethod:t,scaledBoundingBoxDimensions:n}=e;return{scaledBoundingBoxDimensions:n,isManual:t==="manual"}},Lt),_fe=()=>{const e=ce(),{isManual:t,scaledBoundingBoxDimensions:n}=Y(Cfe),{t:r}=we(),o=a=>{e(Ih({...n,width:Math.floor(a)}))},s=()=>{e(Ih({...n,width:Math.floor(512)}))};return i.jsx(Et,{isDisabled:!t,label:r("parameters.scaledWidth"),min:64,max:1024,step:64,value:n.width,onChange:o,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:s})},kfe=p.memo(_fe),Pfe=()=>{const{t:e}=we();return i.jsx(Qo,{label:e("parameters.infillScalingHeader"),children:i.jsxs(X,{sx:{gap:2,flexDirection:"column"},children:[i.jsx(pfe,{}),i.jsx(gfe,{}),i.jsx(bfe,{}),i.jsx(kfe,{}),i.jsx(Sfe,{})]})})},jfe=p.memo(Pfe);function Efe(){const e=ce(),t=Y(r=>r.generation.seamBlur),{t:n}=we();return i.jsx(Et,{label:n("parameters.seamBlur"),min:0,max:64,sliderNumberInputProps:{max:512},value:t,onChange:r=>{e(vS(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(vS(16))}})}function Ife(){const e=ce(),{t}=we(),n=Y(r=>r.generation.seamSize);return i.jsx(Et,{label:t("parameters.seamSize"),min:1,max:256,sliderNumberInputProps:{max:512},value:n,onChange:r=>{e(yS(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>e(yS(96))})}function Ofe(){const{t:e}=we(),t=Y(r=>r.generation.seamSteps),n=ce();return i.jsx(Et,{label:e("parameters.seamSteps"),min:1,max:100,sliderNumberInputProps:{max:999},value:t,onChange:r=>{n(bS(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{n(bS(30))}})}function Tfe(){const e=ce(),{t}=we(),n=Y(r=>r.generation.seamStrength);return i.jsx(Et,{label:t("parameters.seamStrength"),min:.01,max:.99,step:.01,value:n,onChange:r=>{e(xS(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(xS(.7))}})}const Rfe=()=>{const{t:e}=we();return i.jsxs(Qo,{label:e("parameters.seamCorrectionHeader"),children:[i.jsx(Ife,{}),i.jsx(Efe,{}),i.jsx(Tfe,{}),i.jsx(Ofe,{})]})},Mfe=p.memo(Rfe),Dfe=Oe([vn,vr],(e,t)=>{const{boundingBoxDimensions:n}=e;return{boundingBoxDimensions:n,isStaging:t}},Lt),Afe=()=>{const e=ce(),{boundingBoxDimensions:t,isStaging:n}=Y(Dfe),{t:r}=we(),o=a=>{e(_d({...t,height:Math.floor(a)}))},s=()=>{e(_d({...t,height:Math.floor(512)}))};return i.jsx(Et,{label:r("parameters.boundingBoxHeight"),min:64,max:1024,step:64,value:t.height,onChange:o,isDisabled:n,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:s})},VP=p.memo(Afe),Nfe=Oe([vn,vr],(e,t)=>{const{boundingBoxDimensions:n}=e;return{boundingBoxDimensions:n,isStaging:t}},Lt),zfe=()=>{const e=ce(),{boundingBoxDimensions:t,isStaging:n}=Y(Nfe),{t:r}=we(),o=a=>{e(_d({...t,width:Math.floor(a)}))},s=()=>{e(_d({...t,width:Math.floor(512)}))};return i.jsx(Et,{label:r("parameters.boundingBoxWidth"),min:64,max:1024,step:64,value:t.width,onChange:o,isDisabled:n,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:s})},WP=p.memo(zfe),$fe=Oe(Bn,({ui:e,generation:t})=>{const{shouldUseSliders:n}=e,{shouldRandomizeSeed:r}=t;return{shouldUseSliders:n,activeLabel:r?void 0:"Manual Seed"}},Lt),Lfe=()=>{const{shouldUseSliders:e,activeLabel:t}=Y($fe);return i.jsx(Qo,{label:"General",activeLabel:t,defaultIsOpen:!0,children:i.jsxs(X,{sx:{flexDirection:"column",gap:3},children:[e?i.jsxs(i.Fragment,{children:[i.jsx(du,{}),i.jsx(ut,{pt:2,children:i.jsx(pu,{})}),i.jsx(uu,{}),i.jsx(fu,{}),i.jsx(cu,{}),i.jsx(WP,{}),i.jsx(VP,{})]}):i.jsxs(i.Fragment,{children:[i.jsxs(X,{gap:3,children:[i.jsx(uu,{}),i.jsx(fu,{}),i.jsx(cu,{})]}),i.jsx(du,{}),i.jsx(n2,{}),i.jsx(ut,{pt:2,children:i.jsx(pu,{})}),i.jsx(WP,{}),i.jsx(VP,{})]}),i.jsx(rR,{})]})})},Bfe=p.memo(Lfe),Ffe=()=>i.jsxs(i.Fragment,{children:[i.jsx(Xx,{}),i.jsx(Kx,{}),i.jsx(t2,{}),i.jsx(Bfe,{}),i.jsx(Ux,{}),i.jsx(Wx,{}),i.jsx(qx,{}),i.jsx(Qx,{}),i.jsx(Zx,{}),i.jsx(Mfe,{}),i.jsx(jfe,{})]}),zR=p.memo(Ffe),Hfe=()=>i.jsxs(X,{sx:{gap:4,w:"full",h:"full"},children:[i.jsx(Vx,{children:i.jsx(zR,{})}),i.jsx(ufe,{})]}),Vfe=p.memo(Hfe),Wfe=[{id:"txt2img",icon:i.jsx(io,{as:BW,sx:{boxSize:6,pointerEvents:"none"}}),content:i.jsx(jce,{})},{id:"img2img",icon:i.jsx(io,{as:zd,sx:{boxSize:6,pointerEvents:"none"}}),content:i.jsx(mae,{})},{id:"unifiedCanvas",icon:i.jsx(io,{as:Bne,sx:{boxSize:6,pointerEvents:"none"}}),content:i.jsx(Vfe,{})},{id:"nodes",icon:i.jsx(io,{as:Lne,sx:{boxSize:6,pointerEvents:"none"}}),content:i.jsx(hce,{})},{id:"modelManager",icon:i.jsx(io,{as:AW,sx:{boxSize:6,pointerEvents:"none"}}),content:i.jsx(Tie,{})}],Ufe=Oe(Zi,e=>{const{disabledTabs:t}=e;return Wfe.filter(n=>!t.includes(n.id))},{memoizeOptions:{resultEqualityCheck:en}}),Gfe=300,v1=20,$R=["modelManager"],qfe=()=>{const e=Y(x9),t=Y(Gr),n=Y(Ufe),r=Y(x=>x.lightbox.isLightboxOpen),{shouldPinGallery:o,shouldPinParametersPanel:s,shouldShowGallery:a}=Y(x=>x.ui),{t:c}=we(),d=ce();et("z",()=>{d(Cd(!r))},[r]),et("f",()=>{d(w9()),(o||s)&&d(ea())},[o,s]);const f=p.useCallback(()=>{t==="unifiedCanvas"&&d(ea())},[d,t]),h=p.useCallback(x=>{x.target instanceof HTMLElement&&x.target.blur()},[]),m=p.useMemo(()=>n.map(x=>i.jsx(Wn,{hasArrow:!0,label:String(c(`common.${x.id}`)),placement:"end",children:i.jsxs(Gb,{onClick:h,children:[i.jsx(l5,{children:String(c(`common.${x.id}`))}),x.icon]})},x.id)),[n,c,h]),v=p.useMemo(()=>n.map(x=>i.jsx(Wb,{children:x.content},x.id)),[n]),{ref:y,minSizePct:S}=Rre(Gfe,v1,"app");return i.jsxs(Hb,{defaultIndex:e,index:e,onChange:x=>{d(ml(x))},sx:{flexGrow:1,gap:4},isLazy:!0,children:[i.jsxs(Vb,{sx:{pt:2,gap:4,flexDir:"column"},children:[m,i.jsx(ql,{}),i.jsx(hre,{})]}),i.jsxs(Hx,{id:"app",autoSaveId:"app",direction:"horizontal",style:{height:"100%",width:"100%"},children:[i.jsx(Zd,{id:"main",children:i.jsx(Ub,{style:{height:"100%",width:"100%"},children:v})}),o&&a&&!$R.includes(t)&&i.jsxs(i.Fragment,{children:[i.jsx(YT,{}),i.jsx(Zd,{ref:y,onResize:f,id:"gallery",order:3,defaultSize:S>v1?S:v1,minSize:S,maxSize:50,children:i.jsx(ZE,{})})]})]})]})},Yfe=p.memo(qfe),Kfe=Oe([Gr,ks],(e,t)=>{const{shouldPinGallery:n,shouldShowGallery:r}=t;return{shouldPinGallery:n,shouldShowGalleryButton:$R.includes(e)?!1:!r}},{memoizeOptions:{resultEqualityCheck:en}}),Xfe=()=>{const{t:e}=we(),{shouldPinGallery:t,shouldShowGalleryButton:n}=Y(Kfe),r=ce(),o=()=>{r(_1(!0)),t&&r(ea())};return n?i.jsx(Ne,{tooltip:"Show Gallery (G)",tooltipProps:{placement:"top"},"aria-label":e("accessibility.showGallery"),onClick:o,sx:{pos:"absolute",top:"50%",transform:"translate(0, -50%)",p:0,insetInlineEnd:0,px:3,h:48,w:8,borderStartEndRadius:0,borderEndEndRadius:0,shadow:"2xl"},children:i.jsx(Fne,{})}):null},Zfe=p.memo(Xfe),y1={borderStartStartRadius:0,borderEndStartRadius:0,shadow:"2xl"},Qfe=Oe([ks,Gr],(e,t)=>{const{shouldPinParametersPanel:n,shouldUseCanvasBetaLayout:r,shouldShowParametersPanel:o}=e,s=r&&t==="unifiedCanvas",a=!s&&(!n||!o),c=!s&&!o&&["txt2img","img2img","unifiedCanvas"].includes(t);return{shouldPinParametersPanel:n,shouldShowParametersPanelButton:c,shouldShowProcessButtons:a}},{memoizeOptions:{resultEqualityCheck:en}}),Jfe=()=>{const e=ce(),{t}=we(),{shouldShowProcessButtons:n,shouldShowParametersPanelButton:r,shouldPinParametersPanel:o}=Y(Qfe),s=()=>{e(rb(!0)),o&&e(ea())};return r?i.jsxs(X,{pos:"absolute",transform:"translate(0, -50%)",minW:8,top:"50%",insetInlineStart:"4.5rem",direction:"column",gap:2,children:[i.jsx(Ne,{tooltip:"Show Options Panel (O)",tooltipProps:{placement:"top"},"aria-label":t("accessibility.showOptionsPanel"),onClick:s,sx:y1,children:i.jsx(px,{})}),n&&i.jsxs(i.Fragment,{children:[i.jsx(e2,{iconButton:!0,sx:y1}),i.jsx(Jx,{sx:y1})]})]}):null},epe=p.memo(Jfe),tpe=Oe([ks,Gr,JE],(e,t,n)=>{const{shouldPinParametersPanel:r,shouldShowParametersPanel:o}=e;return{activeTabName:t,shouldPinParametersPanel:r,shouldShowParametersPanel:o}},Lt),npe=()=>{const e=ce(),{shouldPinParametersPanel:t,shouldShowParametersPanel:n,activeTabName:r}=Y(tpe),o=()=>{e(rb(!1))},s=p.useMemo(()=>r==="txt2img"?i.jsx(xR,{}):r==="img2img"?i.jsx(oR,{}):r==="unifiedCanvas"?i.jsx(zR,{}):null,[r]);return t?null:i.jsx(QE,{direction:"left",isResizable:!1,isOpen:n,onClose:o,children:i.jsxs(X,{sx:{flexDir:"column",h:"full",w:RT,gap:2,position:"relative",flexShrink:0,overflowY:"auto"},children:[i.jsxs(X,{paddingTop:1.5,paddingBottom:4,justifyContent:"space-between",alignItems:"center",children:[i.jsx(MT,{}),i.jsx(qT,{})]}),i.jsx(X,{sx:{gap:2,flexDirection:"column",h:"full",w:"full"},children:s})]})})},rpe=p.memo(npe),ope=e=>{const{imagesUsage:t}=e;return!t||!u3(t)?null:i.jsxs(i.Fragment,{children:[i.jsx(nt,{children:"An image from this board is currently in use in the following features:"}),i.jsxs(cg,{sx:{paddingInlineStart:6},children:[t.isInitialImage&&i.jsx(qo,{children:"Image to Image"}),t.isCanvasImage&&i.jsx(qo,{children:"Unified Canvas"}),t.isControlNetImage&&i.jsx(qo,{children:"ControlNet"}),t.isNodesImage&&i.jsx(qo,{children:"Node Editor"})]}),i.jsx(nt,{children:"If you delete images from this board, those features will immediately be reset."})]})},spe=()=>{const{t:e}=we(),{isOpen:t,onClose:n,board:r,handleDeleteBoardImages:o,handleDeleteBoardOnly:s,imagesUsage:a}=p.useContext(a3),c=p.useRef(null);return i.jsx(hg,{isOpen:t,leastDestructiveRef:c,onClose:n,isCentered:!0,children:i.jsx(Li,{children:r&&i.jsxs(mg,{children:[i.jsx($i,{fontSize:"lg",fontWeight:"bold",children:"Delete Board"}),i.jsx(Bi,{children:i.jsxs(X,{direction:"column",gap:3,children:[i.jsx(ope,{imagesUsage:a}),i.jsx(ai,{}),i.jsx(nt,{children:e("common.areYouSure")}),i.jsxs(nt,{fontWeight:"bold",children:["This board has ",r.image_count," image(s) that will be deleted."]})]})}),i.jsxs(zi,{gap:3,children:[i.jsx(cn,{ref:c,onClick:n,children:"Cancel"}),i.jsx(cn,{colorScheme:"warning",onClick:()=>s(r.board_id),children:"Delete Board Only"}),i.jsx(cn,{colorScheme:"error",onClick:()=>o(r.board_id),children:"Delete Board and Images"})]})]})})})},ape=p.memo(spe),ipe=()=>{const{data:e,isFetching:t}=Zy(),{isOpen:n,onClose:r,handleAddToBoard:o,image:s}=p.useContext(t3),[a,c]=p.useState(),d=p.useRef(null),f=e==null?void 0:e.find(h=>h.board_id===(s==null?void 0:s.board_id));return i.jsx(hg,{isOpen:n,leastDestructiveRef:d,onClose:r,isCentered:!0,children:i.jsx(Li,{children:i.jsxs(mg,{children:[i.jsx($i,{fontSize:"lg",fontWeight:"bold",children:f?"Move Image to Board":"Add Image to Board"}),i.jsx(Bi,{children:i.jsx(ut,{children:i.jsxs(X,{direction:"column",gap:3,children:[f&&i.jsxs(nt,{children:["Moving this image from"," ",i.jsx("strong",{children:f.board_name})," to"]}),t?i.jsx(mu,{}):i.jsx(Er,{placeholder:"Select Board",onChange:h=>c(h),value:a,data:(e??[]).map(h=>({label:h.board_name,value:h.board_id}))})]})})}),i.jsxs(zi,{children:[i.jsx(cn,{onClick:r,children:"Cancel"}),i.jsx(cn,{isDisabled:!a,colorScheme:"accent",onClick:()=>{a&&o(a)},ml:3,children:f?"Move":"Add"})]})]})})})},lpe=p.memo(ipe),cpe=Oe(e=>e.hotkeys,e=>{const{shift:t}=e;return{shift:t}},{memoizeOptions:{resultEqualityCheck:en}}),upe=()=>{const e=ce(),{shift:t}=Y(cpe);return et("*",()=>{jj("shift")?!t&&e(wS(!0)):t&&e(wS(!1))},{keyup:!0,keydown:!0},[t]),et("o",()=>{e(S9())}),et(["shift+o"],()=>{e(C9())}),et("g",()=>{e(_9())}),et(["shift+g"],()=>{e(c3())}),et("1",()=>{e(ml("txt2img"))}),et("2",()=>{e(ml("img2img"))}),et("3",()=>{e(ml("unifiedCanvas"))}),et("4",()=>{e(ml("nodes"))}),null},dpe=p.memo(upe),fpe={},ppe=({config:e=fpe,headerComponent:t})=>{const n=Y(h3),r=k9(),o=Jr("lightbox").isFeatureEnabled,s=ce();return p.useEffect(()=>{Mr.changeLanguage(n)},[n]),p.useEffect(()=>{r.info({namespace:"App",data:e},"Received config"),s(P9(e))},[s,e,r]),i.jsxs(i.Fragment,{children:[i.jsxs(Ka,{w:"100vw",h:"100vh",position:"relative",overflow:"hidden",children:[o&&i.jsx(Gne,{}),i.jsx(GH,{children:i.jsxs(Ka,{sx:{gap:4,p:4,gridAutoRows:"min-content auto",w:"full",h:"full"},children:[t||i.jsx(dre,{}),i.jsx(X,{sx:{gap:4,w:"full",h:"full"},children:i.jsx(Yfe,{})})]})}),i.jsx(qq,{}),i.jsx(rpe,{}),i.jsx(Sd,{children:i.jsx(epe,{})}),i.jsx(Sd,{children:i.jsx(Zfe,{})})]}),i.jsx(Jq,{}),i.jsx(lpe,{}),i.jsx(ape,{}),i.jsx(j9,{}),i.jsx(dpe,{})]})},wpe=p.memo(ppe);export{wpe as default};