mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
200 lines
855 KiB
JavaScript
200 lines
855 KiB
JavaScript
import{t as Sv,b as qI,r as KI,i as YI,a as XI,c as QI,d as Z4,e as J4,f as e3,g as ZI,h as JI,j as eO,k as tO,l as nO,m as rO,n as oO,o as sO,s as aO,p as iO,q as p,u as rt,v as a,I as go,w as ur,x as Un,y as Ve,z as Ot,A as Ou,B as bt,C as Ru,D as No,E as bo,F as Zr,G as xr,H as lO,J as L0,K as cO,L as ni,M as ou,N as el,O as sn,P as Ea,Q as ih,R as F0,S as zl,T as B0,U as fc,_ as rr,V as uO,W as L,X as t3,Y as n3,Z as xx,$ as r3,a0 as lh,a1 as H0,a2 as pc,a3 as dO,a4 as fO,a5 as pO,a6 as hO,a7 as o3,a8 as s3,a9 as ch,aa as $f,ab as mO,ac as gO,ad as fg,ae as Sx,af as a3,ag as i3,ah as tl,ai as wx,aj as Cx,ak as vO,al as yO,am as bO,an as xO,ao as SO,ap as pg,aq as vl,ar as hg,as as wO,at as CO,au as kO,av as W0,aw as uh,ax as Lf,ay as PO,az as l3,aA as c3,aB as _O,aC as Tu,aD as V0,aE as jO,aF as EO,aG as IO,aH as OO,aI as RO,aJ as TO,aK as MO,aL as kx,aM as Ge,aN as H,aO as ua,aP as Ce,aQ as xo,aR as Sr,aS as ne,aT as F,aU as Mu,aV as pe,aW as u3,aX as So,aY as st,aZ as d3,a_ as ui,a$ as U0,b0 as DO,b1 as AO,b2 as NO,b3 as yl,b4 as Ai,b5 as Ks,b6 as f3,b7 as p3,b8 as zO,b9 as $O,ba as Du,bb as Au,bc as Kl,bd as qn,be as Ff,bf as LO,bg as FO,bh as rn,bi as Ct,bj as dh,bk as ri,bl as Px,bm as G0,bn as BO,bo as HO,bp as Of,bq as je,br as Ld,bs as Fd,bt as su,bu as au,bv as _x,bw as Bf,bx as jx,by as Hf,bz as Ex,bA as wv,bB as Ix,bC as Cv,bD as Ox,bE as Wf,bF as Rx,bG as Yl,bH as Tx,bI as Xl,bJ as Mx,bK as Vf,bL as WO,bM as Uf,bN as q0,bO as fh,bP as K0,bQ as VO,bR as h3,bS as UO,bT as m3,bU as g3,bV as ph,bW as Ti,bX as kv,bY as GO,bZ as v3,b_ as qO,b$ as y3,c0 as ya,c1 as Dx,c2 as KO,c3 as Ax,c4 as YO,c5 as vt,c6 as Gf,c7 as XO,c8 as b3,c9 as hc,ca as Wt,cb as Hr,cc as or,cd as Pv,ce as Ys,cf as lr,cg as mr,ch as x3,ci as QO,cj as S3,ck as Nx,cl as ZO,cm as JO,cn as e8,co as t8,cp as n8,cq as r8,cr as Y0,cs as rs,ct as o8,cu as s8,cv as zx,cw as $x,cx as Lx,cy as Fx,cz as a8,cA as i8,cB as l8,cC as mu,cD as w3,cE as Bx,cF as c8,cG as u8,cH as d8,cI as f8,cJ as p8,cK as h8,cL as m8,cM as g8,cN as Pr,cO as C3,cP as v8,cQ as k3,cR as P3,cS as y8,cT as Hx,cU as b8,cV as x8,cW as S8,cX as w8,cY as C8,cZ as k8,c_ as P8,c$ as _8,d0 as j8,d1 as E8,d2 as I8,d3 as O8,d4 as R8,d5 as T8,d6 as M8,d7 as D8,d8 as A8,d9 as N8,da as z8,db as $8,dc as L8,dd as F8,de as Nu,df as _3,dg as Xs,dh as B8,di as j3,dj as H8,dk as W8,dl as V8,dm as U8,dn as G8,dp as q8,dq as K8,dr as E3,ds as Y8,dt as X8,du as os,dv as Q8,dw as Wx,dx as Vx,dy as oi,dz as Z8,dA as J8,dB as e7,dC as I3,dD as t7,dE as n7,dF as r7,dG as o7,dH as X0,dI as Q0,dJ as s7,dK as Ux,dL as a7,dM as Gx,dN as ss,dO as i7,dP as l7,dQ as qx,dR as Kx,dS as c7,dT as Yx,dU as u7,dV as d7,dW as f7,dX as p7,dY as h7,dZ as m7,d_ as O3,d$ as R3,e0 as T3,e1 as M3,e2 as D3,e3 as zu,e4 as Xx,e5 as A3,e6 as mg,e7 as g7,e8 as v7,e9 as ys,ea as y7,eb as b7,ec as N3,ed as z3,ee as x7,ef as Qx,eg as S7,eh as w7,ei as C7,ej as To,ek as qf,el as k7,em as Zx,en as $3,eo as P7,ep as Jx,eq as L3,er as hh,es as _s,et as _7,eu as F3,ev as j7,ew as _v,ex as jv,ey as E7,ez as I7,eA as O7,eB as R7,eC as T7,eD as e2,eE as M7,eF as D7,eG as A7,eH as N7,eI as z7,eJ as $7,eK as L7,eL as F7,eM as B7,eN as H7,eO as W7,eP as t2,eQ as V7,eR as n2,eS as Rf,eT as U7,eU as en,eV as Kf,eW as B3,eX as Yf,eY as G7,eZ as q7,e_ as qs,e$ as H3,f0 as Z0,f1 as $u,f2 as K7,f3 as Y7,f4 as X7,f5 as ba,f6 as W3,f7 as Q7,f8 as Z7,f9 as V3,fa as J7,fb as eR,fc as tR,fd as nR,fe as rR,ff as oR,fg as sR,fh as aR,fi as iR,fj as lR,fk as cR,fl as r2,fm as uR,fn as dR,fo as fR,fp as pR,fq as hR,fr as mR,fs as gg,ft as Gs,fu as Bd,fv as vg,fw as yg,fx as Hd,fy as o2,fz as Ev,fA as gR,fB as vR,fC as yR,fD as bR,fE as xR,fF as Xf,fG as U3,fH as G3,fI as SR,fJ as wR,fK as q3,fL as K3,fM as Y3,fN as X3,fO as Q3,fP as Z3,fQ as J3,fR as e5,fS as $l,fT as Ll,fU as t5,fV as n5,fW as CR,fX as r5,fY as o5,fZ as s5,f_ as a5,f$ as i5,g0 as l5,g1 as c5,g2 as J0,g3 as kR,g4 as PR,g5 as s2,g6 as _R,g7 as jR,g8 as Qf,g9 as a2,ga as i2,gb as l2,gc as c2,gd as ER,ge as IR,gf as OR,gg as RR,gh as TR,gi as MR,gj as DR,gk as AR,gl as NR,gm as zR}from"./index-63d3e2f4.js";import{u as u5,a as Ia,b as $R,r as Le,f as LR,g as u2,c as At,d as wr}from"./MantineProvider-ffc3d7ba.js";function FR(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 d2=1/0,BR=17976931348623157e292;function bg(e){if(!e)return e===0?e:0;if(e=Sv(e),e===d2||e===-d2){var t=e<0?-1:1;return t*BR}return e===e?e:0}var HR=4;function f2(e){return qI(e,HR)}var WR=function(){return KI.Date.now()};const xg=WR;var VR="Expected a function",UR=Math.max,GR=Math.min;function qR(e,t,n){var r,o,s,i,u,d,f=0,h=!1,m=!1,v=!0;if(typeof e!="function")throw new TypeError(VR);t=Sv(t)||0,YI(n)&&(h=!!n.leading,m="maxWait"in n,s=m?UR(Sv(n.maxWait)||0,t):s,v="trailing"in n?!!n.trailing:v);function y(I){var R=r,T=o;return r=o=void 0,f=I,i=e.apply(T,R),i}function S(I){return f=I,u=setTimeout(k,t),h?y(I):i}function w(I){var R=I-d,T=I-f,D=t-R;return m?GR(D,s-T):D}function C(I){var R=I-d,T=I-f;return d===void 0||R>=t||R<0||m&&T>=s}function k(){var I=xg();if(C(I))return P(I);u=setTimeout(k,w(I))}function P(I){return u=void 0,v&&r?y(I):(r=o=void 0,i)}function j(){u!==void 0&&clearTimeout(u),f=0,r=d=o=u=void 0}function E(){return u===void 0?i:P(xg())}function O(){var I=xg(),R=C(I);if(r=arguments,o=this,d=I,R){if(u===void 0)return S(d);if(m)return clearTimeout(u),u=setTimeout(k,t),y(d)}return u===void 0&&(u=setTimeout(k,t)),i}return O.cancel=j,O.flush=E,O}function KR(e,t){var n=-1,r=XI(e)?Array(e.length):[];return QI(e,function(o,s,i){r[++n]=t(o,s,i)}),r}function Rs(e,t){var n=Z4(e)?J4:KR;return n(e,e3(t))}var YR="[object Number]";function bl(e){return typeof e=="number"||ZI(e)&&JI(e)==YR}var XR=Array.prototype,QR=XR.splice;function ZR(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;eO(o)?QR.call(e,o,1):tO(e,o)}}return e}var JR=Math.ceil,eT=Math.max;function tT(e,t,n,r){for(var o=-1,s=eT(JR((t-e)/(n||1)),0),i=Array(s);s--;)i[r?s:++o]=e,e+=n;return i}function nT(e){return function(t,n,r){return r&&typeof r!="number"&&nO(t,n,r)&&(n=r=void 0),t=bg(t),n===void 0?(n=t,t=0):n=bg(n),r=r===void 0?t<n?1:-1:bg(r),tT(t,n,r,e)}}var rT=nT();const p2=rT;function oT(e,t){var n=[];if(!(e&&e.length))return n;var r=-1,o=[],s=e.length;for(t=e3(t);++r<s;){var i=e[r];t(i,r,e)&&(n.push(i),o.push(r))}return ZR(e,o),n}function d5(e){return Z4(e)?J4(e,rO):oO(e)?[e]:sO(aO(iO(e)))}function e1(e){const t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function mc(e){const{viewBox:t="0 0 24 24",d:n,displayName:r,defaultProps:o={}}=e,s=p.Children.toArray(e.path),i=rt((u,d)=>a.jsx(go,{ref:d,viewBox:t,...o,...u,children:s.length?s:a.jsx("path",{fill:"currentColor",d:n})}));return i.displayName=r,i}var sT=Object.defineProperty,aT=(e,t,n)=>t in e?sT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pr=(e,t,n)=>(aT(e,typeof t!="symbol"?t+"":t,n),n);function h2(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 iT=e=>typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE;function m2(e,t,n){let r=e+1;return n&&r>=t&&(r=0),r}function g2(e,t,n){let r=e-1;return n&&r<0&&(r=t),r}var Iv=typeof window<"u"?p.useLayoutEffect:p.useEffect,Zf=e=>e,lT=class{constructor(){pr(this,"descendants",new Map),pr(this,"register",e=>{if(e!=null)return iT(e)?this.registerNode(e):t=>{this.registerNode(t,e)}}),pr(this,"unregister",e=>{this.descendants.delete(e);const t=h2(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=m2(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=m2(r,this.enabledCount(),t);return this.enabledItem(o)}),pr(this,"prev",(e,t=!0)=>{const n=g2(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=g2(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=h2(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 cT(){const e=p.useRef(new lT);return Iv(()=>()=>e.current.destroy()),e.current}var[uT,f5]=ur({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});function dT(e){const t=f5(),[n,r]=p.useState(-1),o=p.useRef(null);Iv(()=>()=>{o.current&&t.unregister(o.current)},[]),Iv(()=>{if(!o.current)return;const i=Number(o.current.dataset.index);n!=i&&!Number.isNaN(i)&&r(i)});const s=Zf(e?t.register(e):t.register);return{descendants:t,index:n,enabledIndex:t.enabledIndexOf(o.current),register:Un(s,o)}}function t1(){return[Zf(uT),()=>Zf(f5()),()=>cT(),o=>dT(o)]}var[fT,mh]=ur({name:"AccordionStylesContext",hookName:"useAccordionStyles",providerName:"<Accordion />"}),[pT,n1]=ur({name:"AccordionItemContext",hookName:"useAccordionItemContext",providerName:"<AccordionItem />"}),[hT,lie,mT,gT]=t1(),Qc=rt(function(t,n){const{getButtonProps:r}=n1(),o=r(t,n),i={display:"flex",alignItems:"center",width:"100%",outline:0,...mh().button};return a.jsx(Ve.button,{...o,className:Ot("chakra-accordion__button",t.className),__css:i})});Qc.displayName="AccordionButton";function vT(e){const{onChange:t,defaultIndex:n,index:r,allowMultiple:o,allowToggle:s,...i}=e;xT(e),ST(e);const u=mT(),[d,f]=p.useState(-1);p.useEffect(()=>()=>{f(-1)},[]);const[h,m]=Ou({value:r,defaultValue(){return o?n??[]:n??-1},onChange:t});return{index:h,setIndex:m,htmlProps:i,getAccordionItemProps:y=>{let S=!1;return y!==null&&(S=Array.isArray(h)?h.includes(y):h===y),{isOpen:S,onChange:C=>{if(y!==null)if(o&&Array.isArray(h)){const k=C?h.concat(y):h.filter(P=>P!==y);m(k)}else C?m(y):s&&m(-1)}}},focusedIndex:d,setFocusedIndex:f,descendants:u}}var[yT,r1]=ur({name:"AccordionContext",hookName:"useAccordionContext",providerName:"Accordion"});function bT(e){const{isDisabled:t,isFocusable:n,id:r,...o}=e,{getAccordionItemProps:s,setFocusedIndex:i}=r1(),u=p.useRef(null),d=p.useId(),f=r??d,h=`accordion-button-${f}`,m=`accordion-panel-${f}`;wT(e);const{register:v,index:y,descendants:S}=gT({disabled:t&&!n}),{isOpen:w,onChange:C}=s(y===-1?null:y);CT({isOpen:w,isDisabled:t});const k=()=>{C==null||C(!0)},P=()=>{C==null||C(!1)},j=p.useCallback(()=>{C==null||C(!w),i(y)},[y,i,w,C]),E=p.useCallback(T=>{const $={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()}}[T.key];$&&(T.preventDefault(),$(T))},[S,y]),O=p.useCallback(()=>{i(y)},[i,y]),I=p.useCallback(function(D={},$=null){return{...D,type:"button",ref:Un(v,u,$),id:h,disabled:!!t,"aria-expanded":!!w,"aria-controls":m,onClick:bt(D.onClick,j),onFocus:bt(D.onFocus,O),onKeyDown:bt(D.onKeyDown,E)}},[h,t,w,j,O,E,m,v]),R=p.useCallback(function(D={},$=null){return{...D,ref:$,role:"region",id:m,"aria-labelledby":h,hidden:!w}},[h,w,m]);return{isOpen:w,isDisabled:t,isFocusable:n,onOpen:k,onClose:P,getButtonProps:I,getPanelProps:R,htmlProps:o}}function xT(e){const t=e.index||e.defaultIndex,n=t!=null&&!Array.isArray(t)&&e.allowMultiple;Ru({condition:!!n,message:`If 'allowMultiple' is passed, then 'index' or 'defaultIndex' must be an array. You passed: ${typeof t},`})}function ST(e){Ru({condition:!!(e.allowMultiple&&e.allowToggle),message:"If 'allowMultiple' is passed, 'allowToggle' will be ignored. Either remove 'allowToggle' or 'allowMultiple' depending on whether you want multiple accordions visible or not"})}function wT(e){Ru({condition:!!(e.isFocusable&&!e.isDisabled),message:`Using only 'isFocusable', this prop is reserved for situations where you pass 'isDisabled' but you still want the element to receive focus (A11y). Either remove it or pass 'isDisabled' as well.
|
||
`})}function CT(e){Ru({condition:e.isOpen&&!!e.isDisabled,message:"Cannot open a disabled accordion item"})}function Zc(e){const{isOpen:t,isDisabled:n}=n1(),{reduceMotion:r}=r1(),o=Ot("chakra-accordion__icon",e.className),s=mh(),i={opacity:n?.4:1,transform:t?"rotate(-180deg)":void 0,transition:r?void 0:"transform 0.2s",transformOrigin:"center",...s.icon};return a.jsx(go,{viewBox:"0 0 24 24","aria-hidden":!0,className:o,__css:i,...e,children:a.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})})}Zc.displayName="AccordionIcon";var Jc=rt(function(t,n){const{children:r,className:o}=t,{htmlProps:s,...i}=bT(t),d={...mh().container,overflowAnchor:"none"},f=p.useMemo(()=>i,[i]);return a.jsx(pT,{value:f,children:a.jsx(Ve.div,{ref:n,...s,className:Ot("chakra-accordion__item",o),__css:d,children:typeof r=="function"?r({isExpanded:!!i.isOpen,isDisabled:!!i.isDisabled}):r})})});Jc.displayName="AccordionItem";var Mi={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},Fc={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 Ov(e){var t;switch((t=e==null?void 0:e.direction)!=null?t:"right"){case"right":return Fc.slideRight;case"left":return Fc.slideLeft;case"bottom":return Fc.slideDown;case"top":return Fc.slideUp;default:return Fc.slideRight}}var Ni={enter:{duration:.2,ease:Mi.easeOut},exit:{duration:.1,ease:Mi.easeIn}},bs={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})},kT=e=>e!=null&&parseInt(e.toString(),10)>0,v2={exit:{height:{duration:.2,ease:Mi.ease},opacity:{duration:.3,ease:Mi.ease}},enter:{height:{duration:.3,ease:Mi.ease},opacity:{duration:.4,ease:Mi.ease}}},PT={exit:({animateOpacity:e,startingHeight:t,transition:n,transitionEnd:r,delay:o})=>{var s;return{...e&&{opacity:kT(t)?1:0},height:t,transitionEnd:r==null?void 0:r.exit,transition:(s=n==null?void 0:n.exit)!=null?s:bs.exit(v2.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:bs.enter(v2.enter,o)}}},gh=p.forwardRef((e,t)=>{const{in:n,unmountOnExit:r,animateOpacity:o=!0,startingHeight:s=0,endingHeight:i="auto",style:u,className:d,transition:f,transitionEnd:h,...m}=e,[v,y]=p.useState(!1);p.useEffect(()=>{const P=setTimeout(()=>{y(!0)});return()=>clearTimeout(P)},[]),Ru({condition:Number(s)>0&&!!r,message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const S=parseFloat(s.toString())>0,w={startingHeight:s,endingHeight:i,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"}}},C=r?n:!0,k=n||r?"enter":"exit";return a.jsx(No,{initial:!1,custom:w,children:C&&a.jsx(bo.div,{ref:t,...m,className:Ot("chakra-collapse",d),style:{overflow:"hidden",display:"block",...u},custom:w,variants:PT,initial:r?"exit":!1,animate:k,exit:"exit"})})});gh.displayName="Collapse";var _T={enter:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:1,transition:(r=e==null?void 0:e.enter)!=null?r:bs.enter(Ni.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:bs.exit(Ni.exit,n),transitionEnd:t==null?void 0:t.exit}}},p5={initial:"exit",animate:"enter",exit:"exit",variants:_T},jT=p.forwardRef(function(t,n){const{unmountOnExit:r,in:o,className:s,transition:i,transitionEnd:u,delay:d,...f}=t,h=o||r?"enter":"exit",m=r?o&&r:!0,v={transition:i,transitionEnd:u,delay:d};return a.jsx(No,{custom:v,children:m&&a.jsx(bo.div,{ref:n,className:Ot("chakra-fade",s),custom:v,...p5,animate:h,...f})})});jT.displayName="Fade";var ET={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:bs.exit(Ni.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:bs.enter(Ni.enter,n),transitionEnd:e==null?void 0:e.enter}}},h5={initial:"exit",animate:"enter",exit:"exit",variants:ET},IT=p.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:s=!0,initialScale:i=.95,className:u,transition:d,transitionEnd:f,delay:h,...m}=t,v=r?o&&r:!0,y=o||r?"enter":"exit",S={initialScale:i,reverse:s,transition:d,transitionEnd:f,delay:h};return a.jsx(No,{custom:S,children:v&&a.jsx(bo.div,{ref:n,className:Ot("chakra-offset-slide",u),...h5,animate:y,custom:S,...m})})});IT.displayName="ScaleFade";var OT={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:bs.exit(Ni.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:bs.enter(Ni.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({offsetY:e,offsetX:t,transition:n,transitionEnd:r,reverse:o,delay:s})=>{var i;const u={x:t,y:e};return{opacity:0,transition:(i=n==null?void 0:n.exit)!=null?i:bs.exit(Ni.exit,s),...o?{...u,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{...u,...r==null?void 0:r.exit}}}}},Rv={initial:"initial",animate:"enter",exit:"exit",variants:OT},RT=p.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:s=!0,className:i,offsetX:u=0,offsetY:d=8,transition:f,transitionEnd:h,delay:m,...v}=t,y=r?o&&r:!0,S=o||r?"enter":"exit",w={offsetX:u,offsetY:d,reverse:s,transition:f,transitionEnd:h,delay:m};return a.jsx(No,{custom:w,children:y&&a.jsx(bo.div,{ref:n,className:Ot("chakra-offset-slide",i),custom:w,...Rv,animate:S,...v})})});RT.displayName="SlideFade";var y2={exit:{duration:.15,ease:Mi.easeInOut},enter:{type:"spring",damping:25,stiffness:180}},TT={exit:({direction:e,transition:t,transitionEnd:n,delay:r})=>{var o;const{exit:s}=Ov({direction:e});return{...s,transition:(o=t==null?void 0:t.exit)!=null?o:bs.exit(y2.exit,r),transitionEnd:n==null?void 0:n.exit}},enter:({direction:e,transitionEnd:t,transition:n,delay:r})=>{var o;const{enter:s}=Ov({direction:e});return{...s,transition:(o=n==null?void 0:n.enter)!=null?o:bs.enter(y2.enter,r),transitionEnd:t==null?void 0:t.enter}}},m5=p.forwardRef(function(t,n){const{direction:r="right",style:o,unmountOnExit:s,in:i,className:u,transition:d,transitionEnd:f,delay:h,motionProps:m,...v}=t,y=Ov({direction:r}),S=Object.assign({position:"fixed"},y.position,o),w=s?i&&s:!0,C=i||s?"enter":"exit",k={transitionEnd:f,transition:d,direction:r,delay:h};return a.jsx(No,{custom:k,children:w&&a.jsx(bo.div,{...v,ref:n,initial:"exit",className:Ot("chakra-slide",u),animate:C,exit:"exit",custom:k,variants:TT,style:S,...m})})});m5.displayName="Slide";var eu=rt(function(t,n){const{className:r,motionProps:o,...s}=t,{reduceMotion:i}=r1(),{getPanelProps:u,isOpen:d}=n1(),f=u(s,n),h=Ot("chakra-accordion__panel",r),m=mh();i||delete f.hidden;const v=a.jsx(Ve.div,{...f,__css:m.panel,className:h});return i?v:a.jsx(gh,{in:d,...o,children:v})});eu.displayName="AccordionPanel";var g5=rt(function({children:t,reduceMotion:n,...r},o){const s=Zr("Accordion",r),i=xr(r),{htmlProps:u,descendants:d,...f}=vT(i),h=p.useMemo(()=>({...f,reduceMotion:!!n}),[f,n]);return a.jsx(hT,{value:d,children:a.jsx(yT,{value:h,children:a.jsx(fT,{value:s,children:a.jsx(Ve.div,{ref:o,...u,className:Ot("chakra-accordion",r.className),__css:s.root,children:t})})})})});g5.displayName="Accordion";var MT={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}}},DT={horizontal:e=>({"& > *:not(style) ~ *:not(style)":{marginStart:e}}),vertical:e=>({"& > *:not(style) ~ *:not(style)":{marginTop:e}})},gr=rt(function(t,n){const{size:r,colorScheme:o,variant:s,className:i,spacing:u="0.5rem",isAttached:d,isDisabled:f,orientation:h="horizontal",...m}=t,v=Ot("chakra-button__group",i),y=p.useMemo(()=>({size:r,colorScheme:o,variant:s,isDisabled:f}),[r,o,s,f]);let S={display:"inline-flex",...d?MT[h]:DT[h](u)};const w=h==="vertical";return a.jsx(lO,{value:y,children:a.jsx(Ve.div,{ref:n,role:"group",__css:S,className:v,"data-attached":d?"":void 0,"data-orientation":h,flexDir:w?"column":void 0,...m})})});gr.displayName="ButtonGroup";var[cie,AT]=ur({name:"CheckboxGroupContext",strict:!1});function NT(e){const[t,n]=p.useState(e),[r,o]=p.useState(!1);return e!==t&&(o(!0),n(e)),r}function zT(e){return a.jsx(Ve.svg,{width:"1.2em",viewBox:"0 0 12 10",style:{fill:"none",strokeWidth:2,stroke:"currentColor",strokeDasharray:16},...e,children:a.jsx("polyline",{points:"1.5 6 4.5 9 10.5 1"})})}function $T(e){return a.jsx(Ve.svg,{width:"1.2em",viewBox:"0 0 24 24",style:{stroke:"currentColor",strokeWidth:4},...e,children:a.jsx("line",{x1:"21",x2:"3",y1:"12",y2:"12"})})}function LT(e){const{isIndeterminate:t,isChecked:n,...r}=e,o=t?$T:zT;return n||t?a.jsx(Ve.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:a.jsx(o,{...r})}):null}var[FT,BT]=ur({name:"FormErrorStylesContext",errorMessage:`useFormErrorStyles returned is 'undefined'. Seems you forgot to wrap the components in "<FormError />" `}),ho=rt((e,t)=>{const n=Zr("FormError",e),r=xr(e),o=L0();return o!=null&&o.isInvalid?a.jsx(FT,{value:n,children:a.jsx(Ve.div,{...o==null?void 0:o.getErrorMessageProps(r,t),className:Ot("chakra-form__error-message",e.className),__css:{display:"flex",alignItems:"center",...n.text}})}):null});ho.displayName="FormErrorMessage";var HT=rt((e,t)=>{const n=BT(),r=L0();if(!(r!=null&&r.isInvalid))return null;const o=Ot("chakra-form__error-icon",e.className);return a.jsx(go,{ref:t,"aria-hidden":!0,...e,__css:n.icon,className:o,children:a.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"})})});HT.displayName="FormErrorIcon";var o1={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},v5=Ve("span",{baseStyle:o1});v5.displayName="VisuallyHidden";var WT=Ve("input",{baseStyle:o1});WT.displayName="VisuallyHiddenInput";var b2=!1,Lu=null,Vi=!1,Tv=!1,Mv=new Set;function s1(e,t){Mv.forEach(n=>n(e,t))}var VT=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function UT(e){return!(e.metaKey||!VT&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function x2(e){Vi=!0,UT(e)&&(Lu="keyboard",s1("keyboard",e))}function xl(e){if(Lu="pointer",e.type==="mousedown"||e.type==="pointerdown"){Vi=!0;const t=e.composedPath?e.composedPath()[0]:e.target;let n=!1;try{n=t.matches(":focus-visible")}catch{}if(n)return;s1("pointer",e)}}function GT(e){return e.mozInputSource===0&&e.isTrusted?!0:e.detail===0&&!e.pointerType}function qT(e){GT(e)&&(Vi=!0,Lu="virtual")}function KT(e){e.target===window||e.target===document||(!Vi&&!Tv&&(Lu="virtual",s1("virtual",e)),Vi=!1,Tv=!1)}function YT(){Vi=!1,Tv=!0}function S2(){return Lu!=="pointer"}function XT(){if(typeof window>"u"||b2)return;const{focus:e}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...n){Vi=!0,e.apply(this,n)},document.addEventListener("keydown",x2,!0),document.addEventListener("keyup",x2,!0),document.addEventListener("click",qT,!0),window.addEventListener("focus",KT,!0),window.addEventListener("blur",YT,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",xl,!0),document.addEventListener("pointermove",xl,!0),document.addEventListener("pointerup",xl,!0)):(document.addEventListener("mousedown",xl,!0),document.addEventListener("mousemove",xl,!0),document.addEventListener("mouseup",xl,!0)),b2=!0}function y5(e){XT(),e(S2());const t=()=>e(S2());return Mv.add(t),()=>{Mv.delete(t)}}function QT(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function b5(e={}){const t=cO(e),{isDisabled:n,isReadOnly:r,isRequired:o,isInvalid:s,id:i,onBlur:u,onFocus:d,"aria-describedby":f}=t,{defaultChecked:h,isChecked:m,isFocusable:v,onChange:y,isIndeterminate:S,name:w,value:C,tabIndex:k=void 0,"aria-label":P,"aria-labelledby":j,"aria-invalid":E,...O}=e,I=QT(O,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),R=ni(y),T=ni(u),D=ni(d),[$,A]=p.useState(!1),[J,z]=p.useState(!1),[B,G]=p.useState(!1),[K,N]=p.useState(!1);p.useEffect(()=>y5(A),[]);const V=p.useRef(null),[W,U]=p.useState(!0),[re,ve]=p.useState(!!h),le=m!==void 0,se=le?m:re,Y=p.useCallback(ye=>{if(r||n){ye.preventDefault();return}le||ve(se?ye.target.checked:S?!0:ye.target.checked),R==null||R(ye)},[r,n,se,le,S,R]);ou(()=>{V.current&&(V.current.indeterminate=!!S)},[S]),el(()=>{n&&z(!1)},[n,z]),ou(()=>{const ye=V.current;ye!=null&&ye.form&&(ye.form.onreset=()=>{ve(!!h)})},[]);const ae=n&&!v,ue=p.useCallback(ye=>{ye.key===" "&&N(!0)},[N]),xe=p.useCallback(ye=>{ye.key===" "&&N(!1)},[N]);ou(()=>{if(!V.current)return;V.current.checked!==se&&ve(V.current.checked)},[V.current]);const oe=p.useCallback((ye={},Oe=null)=>{const at=Fe=>{J&&Fe.preventDefault(),N(!0)};return{...ye,ref:Oe,"data-active":sn(K),"data-hover":sn(B),"data-checked":sn(se),"data-focus":sn(J),"data-focus-visible":sn(J&&$),"data-indeterminate":sn(S),"data-disabled":sn(n),"data-invalid":sn(s),"data-readonly":sn(r),"aria-hidden":!0,onMouseDown:bt(ye.onMouseDown,at),onMouseUp:bt(ye.onMouseUp,()=>N(!1)),onMouseEnter:bt(ye.onMouseEnter,()=>G(!0)),onMouseLeave:bt(ye.onMouseLeave,()=>G(!1))}},[K,se,n,J,$,B,S,s,r]),ge=p.useCallback((ye={},Oe=null)=>({...I,...ye,ref:Un(Oe,at=>{at&&U(at.tagName==="LABEL")}),onClick:bt(ye.onClick,()=>{var at;W||((at=V.current)==null||at.click(),requestAnimationFrame(()=>{var Fe;(Fe=V.current)==null||Fe.focus({preventScroll:!0})}))}),"data-disabled":sn(n),"data-checked":sn(se),"data-invalid":sn(s)}),[I,n,se,s,W]),fe=p.useCallback((ye={},Oe=null)=>({...ye,ref:Un(V,Oe),type:"checkbox",name:w,value:C,id:i,tabIndex:k,onChange:bt(ye.onChange,Y),onBlur:bt(ye.onBlur,T,()=>z(!1)),onFocus:bt(ye.onFocus,D,()=>z(!0)),onKeyDown:bt(ye.onKeyDown,ue),onKeyUp:bt(ye.onKeyUp,xe),required:o,checked:se,disabled:ae,readOnly:r,"aria-label":P,"aria-labelledby":j,"aria-invalid":E?!!E:s,"aria-describedby":f,"aria-disabled":n,style:o1}),[w,C,i,Y,T,D,ue,xe,o,se,ae,r,P,j,E,s,f,n,k]),Pe=p.useCallback((ye={},Oe=null)=>({...ye,ref:Oe,onMouseDown:bt(ye.onMouseDown,ZT),"data-disabled":sn(n),"data-checked":sn(se),"data-invalid":sn(s)}),[se,n,s]);return{state:{isInvalid:s,isFocused:J,isChecked:se,isActive:K,isHovered:B,isIndeterminate:S,isDisabled:n,isReadOnly:r,isRequired:o},getRootProps:ge,getCheckboxProps:oe,getInputProps:fe,getLabelProps:Pe,htmlProps:I}}function ZT(e){e.preventDefault(),e.stopPropagation()}var JT={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},eM={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},tM=Ea({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),nM=Ea({from:{opacity:0},to:{opacity:1}}),rM=Ea({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),x5=rt(function(t,n){const r=AT(),o={...r,...t},s=Zr("Checkbox",o),i=xr(t),{spacing:u="0.5rem",className:d,children:f,iconColor:h,iconSize:m,icon:v=a.jsx(LT,{}),isChecked:y,isDisabled:S=r==null?void 0:r.isDisabled,onChange:w,inputProps:C,...k}=i;let P=y;r!=null&&r.value&&i.value&&(P=r.value.includes(i.value));let j=w;r!=null&&r.onChange&&i.value&&(j=ih(r.onChange,w));const{state:E,getInputProps:O,getCheckboxProps:I,getLabelProps:R,getRootProps:T}=b5({...k,isDisabled:S,isChecked:P,onChange:j}),D=NT(E.isChecked),$=p.useMemo(()=>({animation:D?E.isIndeterminate?`${nM} 20ms linear, ${rM} 200ms linear`:`${tM} 200ms linear`:void 0,fontSize:m,color:h,...s.icon}),[h,m,D,E.isIndeterminate,s.icon]),A=p.cloneElement(v,{__css:$,isIndeterminate:E.isIndeterminate,isChecked:E.isChecked});return a.jsxs(Ve.label,{__css:{...eM,...s.container},className:Ot("chakra-checkbox",d),...T(),children:[a.jsx("input",{className:"chakra-checkbox__input",...O(C,n)}),a.jsx(Ve.span,{__css:{...JT,...s.control},className:"chakra-checkbox__control",...I(),children:A}),f&&a.jsx(Ve.span,{className:"chakra-checkbox__label",...R(),__css:{marginStart:u,...s.label},children:f})]})});x5.displayName="Checkbox";var[oM,S5]=ur({name:"EditableStylesContext",errorMessage:`useEditableStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Editable />" `}),[sM,w5]=ur({name:"EditableContext",errorMessage:"useEditableContext: context is undefined. Seems you forgot to wrap the editable components in `<Editable />`"}),C5={fontSize:"inherit",fontWeight:"inherit",textAlign:"inherit",bg:"transparent"},k5=rt(function(t,n){const{getInputProps:r}=w5(),o=S5(),s=r(t,n),i=Ot("chakra-editable__input",t.className);return a.jsx(Ve.input,{...s,__css:{outline:0,...C5,...o.input},className:i})});k5.displayName="EditableInput";var P5=rt(function(t,n){const{getPreviewProps:r}=w5(),o=S5(),s=r(t,n),i=Ot("chakra-editable__preview",t.className);return a.jsx(Ve.span,{...s,__css:{cursor:"text",display:"inline-block",...C5,...o.preview},className:i})});P5.displayName="EditablePreview";function aM(e){return"current"in e}var _5=()=>typeof window<"u";function iM(){var e;const t=navigator.userAgentData;return(e=t==null?void 0:t.platform)!=null?e:navigator.platform}var lM=e=>_5()&&e.test(navigator.vendor),cM=e=>_5()&&e.test(iM()),uM=()=>cM(/mac|iphone|ipad|ipod/i),dM=()=>uM()&&lM(/apple/i);function j5(e){const{ref:t,elements:n,enabled:r}=e,o=()=>{var s,i;return(i=(s=t.current)==null?void 0:s.ownerDocument)!=null?i:document};F0(o,"pointerdown",s=>{if(!dM()||!r)return;const i=s.target,d=(n??[t]).some(f=>{const h=aM(f)?f.current:f;return(h==null?void 0:h.contains(i))||h===i});o().activeElement!==i&&d&&(s.preventDefault(),i.focus())})}function w2(e,t){return e?e===t||e.contains(t):!1}function fM(e={}){const{onChange:t,onCancel:n,onSubmit:r,onBlur:o,value:s,isDisabled:i,defaultValue:u,startWithEditView:d,isPreviewFocusable:f=!0,submitOnBlur:h=!0,selectAllOnFocus:m=!0,placeholder:v,onEdit:y,finalFocusRef:S,...w}=e,C=ni(y),k=!!(d&&!i),[P,j]=p.useState(k),[E,O]=Ou({defaultValue:u||"",value:s,onChange:t}),[I,R]=p.useState(E),T=p.useRef(null),D=p.useRef(null),$=p.useRef(null),A=p.useRef(null),J=p.useRef(null);j5({ref:T,enabled:P,elements:[A,J]});const z=!P&&!i;ou(()=>{var oe,ge;P&&((oe=T.current)==null||oe.focus(),m&&((ge=T.current)==null||ge.select()))},[]),el(()=>{var oe,ge,fe,Pe;if(!P){S?(oe=S.current)==null||oe.focus():(ge=$.current)==null||ge.focus();return}(fe=T.current)==null||fe.focus(),m&&((Pe=T.current)==null||Pe.select()),C==null||C()},[P,C,m]);const B=p.useCallback(()=>{z&&j(!0)},[z]),G=p.useCallback(()=>{R(E)},[E]),K=p.useCallback(()=>{j(!1),O(I),n==null||n(I),o==null||o(I)},[n,o,O,I]),N=p.useCallback(()=>{j(!1),R(E),r==null||r(E),o==null||o(I)},[E,r,o,I]);p.useEffect(()=>{if(P)return;const oe=T.current;(oe==null?void 0:oe.ownerDocument.activeElement)===oe&&(oe==null||oe.blur())},[P]);const V=p.useCallback(oe=>{O(oe.currentTarget.value)},[O]),W=p.useCallback(oe=>{const ge=oe.key,Pe={Escape:K,Enter:Ae=>{!Ae.shiftKey&&!Ae.metaKey&&N()}}[ge];Pe&&(oe.preventDefault(),Pe(oe))},[K,N]),U=p.useCallback(oe=>{const ge=oe.key,Pe={Escape:K}[ge];Pe&&(oe.preventDefault(),Pe(oe))},[K]),re=E.length===0,ve=p.useCallback(oe=>{var ge;if(!P)return;const fe=oe.currentTarget.ownerDocument,Pe=(ge=oe.relatedTarget)!=null?ge:fe.activeElement,Ae=w2(A.current,Pe),ye=w2(J.current,Pe);!Ae&&!ye&&(h?N():K())},[h,N,K,P]),le=p.useCallback((oe={},ge=null)=>{const fe=z&&f?0:void 0;return{...oe,ref:Un(ge,D),children:re?v:E,hidden:P,"aria-disabled":zl(i),tabIndex:fe,onFocus:bt(oe.onFocus,B,G)}},[i,P,z,f,re,B,G,v,E]),se=p.useCallback((oe={},ge=null)=>({...oe,hidden:!P,placeholder:v,ref:Un(ge,T),disabled:i,"aria-disabled":zl(i),value:E,onBlur:bt(oe.onBlur,ve),onChange:bt(oe.onChange,V),onKeyDown:bt(oe.onKeyDown,W),onFocus:bt(oe.onFocus,G)}),[i,P,ve,V,W,G,v,E]),Y=p.useCallback((oe={},ge=null)=>({...oe,hidden:!P,placeholder:v,ref:Un(ge,T),disabled:i,"aria-disabled":zl(i),value:E,onBlur:bt(oe.onBlur,ve),onChange:bt(oe.onChange,V),onKeyDown:bt(oe.onKeyDown,U),onFocus:bt(oe.onFocus,G)}),[i,P,ve,V,U,G,v,E]),ae=p.useCallback((oe={},ge=null)=>({"aria-label":"Edit",...oe,type:"button",onClick:bt(oe.onClick,B),ref:Un(ge,$),disabled:i}),[B,i]),ue=p.useCallback((oe={},ge=null)=>({...oe,"aria-label":"Submit",ref:Un(J,ge),type:"button",onClick:bt(oe.onClick,N),disabled:i}),[N,i]),xe=p.useCallback((oe={},ge=null)=>({"aria-label":"Cancel",id:"cancel",...oe,ref:Un(A,ge),type:"button",onClick:bt(oe.onClick,K),disabled:i}),[K,i]);return{isEditing:P,isDisabled:i,isValueEmpty:re,value:E,onEdit:B,onCancel:K,onSubmit:N,getPreviewProps:le,getInputProps:se,getTextareaProps:Y,getEditButtonProps:ae,getSubmitButtonProps:ue,getCancelButtonProps:xe,htmlProps:w}}var E5=rt(function(t,n){const r=Zr("Editable",t),o=xr(t),{htmlProps:s,...i}=fM(o),{isEditing:u,onSubmit:d,onCancel:f,onEdit:h}=i,m=Ot("chakra-editable",t.className),v=B0(t.children,{isEditing:u,onSubmit:d,onCancel:f,onEdit:h});return a.jsx(sM,{value:i,children:a.jsx(oM,{value:r,children:a.jsx(Ve.div,{ref:n,...s,className:m,children:v})})})});E5.displayName="Editable";var I5={exports:{}},pM="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",hM=pM,mM=hM;function O5(){}function R5(){}R5.resetWarningCache=O5;var gM=function(){function e(r,o,s,i,u,d){if(d!==mM){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:R5,resetWarningCache:O5};return n.PropTypes=n,n};I5.exports=gM();var vM=I5.exports;const An=fc(vM);var Dv="data-focus-lock",T5="data-focus-lock-disabled",yM="data-no-focus-lock",bM="data-autofocus-inside",xM="data-no-autofocus";function SM(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function wM(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 M5(e,t){return wM(t||null,function(n){return e.forEach(function(r){return SM(r,n)})})}var Sg={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"},Vs=function(){return Vs=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},Vs.apply(this,arguments)};function D5(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 gc(e,t,n,r){function o(s){return s instanceof n?s:new n(function(i){i(s)})}return new(n||(n=Promise))(function(s,i){function u(h){try{f(r.next(h))}catch(m){i(m)}}function d(h){try{f(r.throw(h))}catch(m){i(m)}}function f(h){h.done?s(h.value):o(h.value).then(u,d)}f((r=r.apply(e,t||[])).next())})}function vc(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,o,s,i;return i={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function u(f){return function(h){return d([f,h])}}function d(f){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=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 C2(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,s=[],i;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)s.push(o.value)}catch(u){i={error:u}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return s}function Av(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 A5(e){return e}function N5(e,t){t===void 0&&(t=A5);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(u){return u!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(u){return s(u)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var u=n;n=[],u.forEach(s),i=n}var d=function(){var h=i;i=[],h.forEach(s)},f=function(){return Promise.resolve().then(d)};f(),n={push:function(h){i.push(h),f()},filter:function(h){return i=i.filter(h),n}}}};return o}function a1(e,t){return t===void 0&&(t=A5),N5(e,t)}function z5(e){e===void 0&&(e={});var t=N5(null);return t.options=Vs({async:!0,ssr:!1},e),t}var $5=function(e){var t=e.sideCar,n=D5(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,Vs({},n))};$5.isSideCarExport=!0;function CM(e,t){return e.useMedium(t),$5}var L5=a1({},function(e){var t=e.target,n=e.currentTarget;return{target:t,currentTarget:n}}),F5=a1(),kM=a1(),PM=z5({async:!0}),_M=[],i1=p.forwardRef(function(t,n){var r,o=p.useState(),s=o[0],i=o[1],u=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,w=t.autoFocus;t.allowTextSelection;var C=t.group,k=t.className,P=t.whiteList,j=t.hasPositiveIndices,E=t.shards,O=E===void 0?_M:E,I=t.as,R=I===void 0?"div":I,T=t.lockProps,D=T===void 0?{}:T,$=t.sideCar,A=t.returnFocus,J=t.focusOptions,z=t.onActivation,B=t.onDeactivation,G=p.useState({}),K=G[0],N=p.useCallback(function(){f.current=f.current||document&&document.activeElement,u.current&&z&&z(u.current),d.current=!0},[z]),V=p.useCallback(function(){d.current=!1,B&&B(u.current)},[B]);p.useEffect(function(){m||(f.current=null)},[]);var W=p.useCallback(function(ue){var xe=f.current;if(xe&&xe.focus){var oe=typeof A=="function"?A(xe):A;if(oe){var ge=typeof oe=="object"?oe:void 0;f.current=null,ue?Promise.resolve().then(function(){return xe.focus(ge)}):xe.focus(ge)}}},[A]),U=p.useCallback(function(ue){d.current&&L5.useMedium(ue)},[]),re=F5.useMedium,ve=p.useCallback(function(ue){u.current!==ue&&(u.current=ue,i(ue))},[]),le=rr((r={},r[T5]=m&&"disabled",r[Dv]=C,r),D),se=v!==!0,Y=se&&v!=="tail",ae=M5([n,ve]);return p.createElement(p.Fragment,null,se&&[p.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:m?-1:0,style:Sg}),j?p.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:m?-1:1,style:Sg}):null],!m&&p.createElement($,{id:K,sideCar:PM,observed:s,disabled:m,persistentFocus:y,crossFrame:S,autoFocus:w,whiteList:P,shards:O,onActivation:N,onDeactivation:V,returnFocus:W,focusOptions:J}),p.createElement(R,rr({ref:ae},le,{className:k,onBlur:re,onFocus:U}),h),Y&&p.createElement("div",{"data-focus-guard":!0,tabIndex:m?-1:0,style:Sg}))});i1.propTypes={};i1.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 B5=i1;function Nv(e,t){return Nv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Nv(e,t)}function jM(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Nv(e,t)}function EM(e,t){function n(r){return r.displayName||r.name||"Component"}return function(o){var s=[],i;function u(){i=e(s.map(function(f){return f.props})),t(i)}var d=function(f){jM(h,f);function h(){return f.apply(this,arguments)||this}h.peek=function(){return i};var m=h.prototype;return m.componentDidMount=function(){s.push(this),u()},m.componentDidUpdate=function(){u()},m.componentWillUnmount=function(){var y=s.indexOf(this);s.splice(y,1),u()},m.render=function(){return L.createElement(o,this.props)},h}(p.PureComponent);return uO(d,"displayName","SideEffect("+n(o)+")"),d}}var Js=function(e){for(var t=Array(e.length),n=0;n<e.length;++n)t[n]=e[n];return t},Jf=function(e){return Array.isArray(e)?e:[e]},H5=function(e){return Array.isArray(e)?e[0]:e},IM=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"},W5=function(e){return e.parentNode&&e.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.parentNode.host:e.parentNode},V5=function(e){return e===document||e&&e.nodeType===Node.DOCUMENT_NODE},OM=function(e,t){return!e||V5(e)||!IM(e)&&t(W5(e))},U5=function(e,t){var n=e.get(t);if(n!==void 0)return n;var r=OM(t,U5.bind(void 0,e));return e.set(t,r),r},RM=function(e,t){return e&&!V5(e)?DM(e)?t(W5(e)):!1:!0},G5=function(e,t){var n=e.get(t);if(n!==void 0)return n;var r=RM(t,G5.bind(void 0,e));return e.set(t,r),r},q5=function(e){return e.dataset},TM=function(e){return e.tagName==="BUTTON"},K5=function(e){return e.tagName==="INPUT"},Y5=function(e){return K5(e)&&e.type==="radio"},MM=function(e){return!((K5(e)||TM(e))&&(e.type==="hidden"||e.disabled))},DM=function(e){var t=e.getAttribute(xM);return![!0,"true",""].includes(t)},l1=function(e){var t;return!!(e&&(!((t=q5(e))===null||t===void 0)&&t.focusGuard))},ep=function(e){return!l1(e)},AM=function(e){return!!e},NM=function(e,t){var n=e.tabIndex-t.tabIndex,r=e.index-t.index;if(n){if(!e.tabIndex)return 1;if(!t.tabIndex)return-1}return n||r},X5=function(e,t,n){return Js(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(NM)},zM=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],c1=zM.join(","),$M="".concat(c1,", [data-focus-guard]"),Q5=function(e,t){return Js((e.shadowRoot||e).children).reduce(function(n,r){return n.concat(r.matches(t?$M:c1)?[r]:[],Q5(r))},[])},LM=function(e,t){var n;return e instanceof HTMLIFrameElement&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?vh([e.contentDocument.body],t):[e]},vh=function(e,t){return e.reduce(function(n,r){var o,s=Q5(r,t),i=(o=[]).concat.apply(o,s.map(function(u){return LM(u,t)}));return n.concat(i,r.parentNode?Js(r.parentNode.querySelectorAll(c1)).filter(function(u){return u===r}):[])},[])},FM=function(e){var t=e.querySelectorAll("[".concat(bM,"]"));return Js(t).map(function(n){return vh([n])}).reduce(function(n,r){return n.concat(r)},[])},u1=function(e,t){return Js(e).filter(function(n){return U5(t,n)}).filter(function(n){return MM(n)})},k2=function(e,t){return t===void 0&&(t=new Map),Js(e).filter(function(n){return G5(t,n)})},zv=function(e,t,n){return X5(u1(vh(e,n),t),!0,n)},P2=function(e,t){return X5(u1(vh(e),t),!1)},BM=function(e,t){return u1(FM(e),t)},Fl=function(e,t){return e.shadowRoot?Fl(e.shadowRoot,t):Object.getPrototypeOf(e).contains!==void 0&&Object.getPrototypeOf(e).contains.call(e,t)?!0:Js(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?Fl(o,t):!1}return Fl(n,t)})},HM=function(e){for(var t=new Set,n=e.length,r=0;r<n;r+=1)for(var o=r+1;o<n;o+=1){var s=e[r].compareDocumentPosition(e[o]);(s&Node.DOCUMENT_POSITION_CONTAINED_BY)>0&&t.add(o),(s&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter(function(i,u){return!t.has(u)})},Z5=function(e){return e.parentNode?Z5(e.parentNode):e},d1=function(e){var t=Jf(e);return t.filter(Boolean).reduce(function(n,r){var o=r.getAttribute(Dv);return n.push.apply(n,o?HM(Js(Z5(r).querySelectorAll("[".concat(Dv,'="').concat(o,'"]:not([').concat(T5,'="disabled"])')))):[r]),n},[])},WM=function(e){try{return e()}catch{return}},gu=function(e){if(e===void 0&&(e=document),!(!e||!e.activeElement)){var t=e.activeElement;return t.shadowRoot?gu(t.shadowRoot):t instanceof HTMLIFrameElement&&WM(function(){return t.contentWindow.document})?gu(t.contentWindow.document):t}},VM=function(e,t){return e===t},UM=function(e,t){return!!Js(e.querySelectorAll("iframe")).some(function(n){return VM(n,t)})},J5=function(e,t){return t===void 0&&(t=gu(H5(e).ownerDocument)),!t||t.dataset&&t.dataset.focusGuard?!1:d1(e).some(function(n){return Fl(n,t)||UM(n,t)})},GM=function(e){e===void 0&&(e=document);var t=gu(e);return t?Js(e.querySelectorAll("[".concat(yM,"]"))).some(function(n){return Fl(n,t)}):!1},qM=function(e,t){return t.filter(Y5).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},f1=function(e,t){return Y5(e)&&e.name?qM(e,t):e},KM=function(e){var t=new Set;return e.forEach(function(n){return t.add(f1(n,e))}),e.filter(function(n){return t.has(n)})},_2=function(e){return e[0]&&e.length>1?f1(e[0],e):e[0]},j2=function(e,t){return e.length>1?e.indexOf(f1(e[t],e)):t},e6="NEW_FOCUS",YM=function(e,t,n,r){var o=e.length,s=e[0],i=e[o-1],u=l1(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(i),S=KM(t),w=n!==void 0?S.indexOf(n):-1,C=w-(r?S.indexOf(r):d),k=j2(e,0),P=j2(e,o-1);if(d===-1||h===-1)return e6;if(!m&&h>=0)return h;if(d<=v&&u&&Math.abs(m)>1)return P;if(d>=y&&u&&Math.abs(m)>1)return k;if(m&&Math.abs(C)>1)return h;if(d<=v)return P;if(d>y)return k;if(m)return Math.abs(m)>1?h:(o+h+m)%o}},XM=function(e){return function(t){var n,r=(n=q5(t))===null||n===void 0?void 0:n.autofocus;return t.autofocus||r!==void 0&&r!=="false"||e.indexOf(t)>=0}},QM=function(e,t,n){var r=e.map(function(s){var i=s.node;return i}),o=k2(r.filter(XM(n)));return o&&o.length?_2(o):_2(k2(t))},$v=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&$v(e.parentNode.host||e.parentNode,t),t},wg=function(e,t){for(var n=$v(e),r=$v(t),o=0;o<n.length;o+=1){var s=n[o];if(r.indexOf(s)>=0)return s}return!1},t6=function(e,t,n){var r=Jf(e),o=Jf(t),s=r[0],i=!1;return o.filter(Boolean).forEach(function(u){i=wg(i||u,u)||i,n.filter(Boolean).forEach(function(d){var f=wg(s,d);f&&(!i||Fl(f,i)?i=f:i=wg(f,i))})}),i},ZM=function(e,t){return e.reduce(function(n,r){return n.concat(BM(r,t))},[])},JM=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(AM)},eD=function(e,t){var n=gu(Jf(e).length>0?document:H5(e).ownerDocument),r=d1(e).filter(ep),o=t6(n||e,e,r),s=new Map,i=P2(r,s),u=zv(r,s).filter(function(y){var S=y.node;return ep(S)});if(!(!u[0]&&(u=i,!u[0]))){var d=P2([o],s).map(function(y){var S=y.node;return S}),f=JM(d,u),h=f.map(function(y){var S=y.node;return S}),m=YM(h,d,n,t);if(m===e6){var v=QM(i,h,ZM(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]}},tD=function(e){var t=d1(e).filter(ep),n=t6(e,e,t),r=new Map,o=zv([n],r,!0),s=zv(t,r).filter(function(i){var u=i.node;return ep(u)}).map(function(i){var u=i.node;return u});return o.map(function(i){var u=i.node,d=i.index;return{node:u,index:d,lockItem:s.indexOf(u)>=0,guard:l1(u)}})},nD=function(e,t){"focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus()},Cg=0,kg=!1,n6=function(e,t,n){n===void 0&&(n={});var r=eD(e,t);if(!kg&&r){if(Cg>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),kg=!0,setTimeout(function(){kg=!1},1);return}Cg++,nD(r.node,n.focusOptions),Cg--}};function r6(e){var t=window,n=t.setImmediate;typeof n<"u"?n(e):setTimeout(e,1)}var rD=function(){return document&&document.activeElement===document.body},oD=function(){return rD()||GM()},Bl=null,Rl=null,Hl=null,vu=!1,sD=function(){return!0},aD=function(t){return(Bl.whiteList||sD)(t)},iD=function(t,n){Hl={observerNode:t,portaledElement:n}},lD=function(t){return Hl&&Hl.portaledElement===t};function E2(e,t,n,r){var o=null,s=e;do{var i=r[s];if(i.guard)i.node.dataset.focusAutoGuard&&(o=i);else if(i.lockItem){if(s!==e)return;o=null}else break}while((s+=n)!==t);o&&(o.node.tabIndex=0)}var cD=function(t){return t&&"current"in t?t.current:t},uD=function(t){return t?!!vu:vu==="meanwhile"},dD=function e(t,n,r){return n&&(n.host===t&&(!n.activeElement||r.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,r))},fD=function(t,n){return n.some(function(r){return dD(t,r,r)})},tp=function(){var t=!1;if(Bl){var n=Bl,r=n.observed,o=n.persistentFocus,s=n.autoFocus,i=n.shards,u=n.crossFrame,d=n.focusOptions,f=r||Hl&&Hl.portaledElement,h=document&&document.activeElement;if(f){var m=[f].concat(i.map(cD).filter(Boolean));if((!h||aD(h))&&(o||uD(u)||!oD()||!Rl&&s)&&(f&&!(J5(m)||h&&fD(h,m)||lD(h))&&(document&&!Rl&&h&&!s?(h.blur&&h.blur(),document.body.focus()):(t=n6(m,Rl,{focusOptions:d}),Hl={})),vu=!1,Rl=document&&document.activeElement),document){var v=document&&document.activeElement,y=tD(m),S=y.map(function(w){var C=w.node;return C}).indexOf(v);S>-1&&(y.filter(function(w){var C=w.guard,k=w.node;return C&&k.dataset.focusAutoGuard}).forEach(function(w){var C=w.node;return C.removeAttribute("tabIndex")}),E2(S,y.length,1,y),E2(S,-1,-1,y))}}}return t},o6=function(t){tp()&&t&&(t.stopPropagation(),t.preventDefault())},p1=function(){return r6(tp)},pD=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||iD(r,n)},hD=function(){return null},s6=function(){vu="just",setTimeout(function(){vu="meanwhile"},0)},mD=function(){document.addEventListener("focusin",o6),document.addEventListener("focusout",p1),window.addEventListener("blur",s6)},gD=function(){document.removeEventListener("focusin",o6),document.removeEventListener("focusout",p1),window.removeEventListener("blur",s6)};function vD(e){return e.filter(function(t){var n=t.disabled;return!n})}function yD(e){var t=e.slice(-1)[0];t&&!Bl&&mD();var n=Bl,r=n&&t&&t.id===n.id;Bl=t,n&&!r&&(n.onDeactivation(),e.filter(function(o){var s=o.id;return s===n.id}).length||n.returnFocus(!t)),t?(Rl=null,(!r||n.observed!==t.observed)&&t.onActivation(),tp(),r6(tp)):(gD(),Rl=null)}L5.assignSyncMedium(pD);F5.assignMedium(p1);kM.assignMedium(function(e){return e({moveFocusInside:n6,focusInside:J5})});const bD=EM(vD,yD)(hD);var a6=p.forwardRef(function(t,n){return p.createElement(B5,rr({sideCar:bD,ref:n},t))}),i6=B5.propTypes||{};i6.sideCar;FR(i6,["sideCar"]);a6.propTypes={};const I2=a6;var l6=e=>e.hasAttribute("tabindex"),xD=e=>l6(e)&&e.tabIndex===-1;function SD(e){return!!e.getAttribute("disabled")||!!e.getAttribute("aria-disabled")}function c6(e){return e.parentElement&&c6(e.parentElement)?!0:e.hidden}function wD(e){const t=e.getAttribute("contenteditable");return t!=="false"&&t!=null}function u6(e){if(!t3(e)||c6(e)||SD(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]():wD(e)?!0:l6(e)}function CD(e){return e?t3(e)&&u6(e)&&!xD(e):!1}var kD=["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]"],PD=kD.join(),_D=e=>e.offsetWidth>0&&e.offsetHeight>0;function d6(e){const t=Array.from(e.querySelectorAll(PD));return t.unshift(e),t.filter(n=>u6(n)&&_D(n))}var O2,jD=(O2=I2.default)!=null?O2:I2,f6=e=>{const{initialFocusRef:t,finalFocusRef:n,contentRef:r,restoreFocus:o,children:s,isDisabled:i,autoFocus:u,persistentFocus:d,lockFocusAcrossFrames:f}=e,h=p.useCallback(()=>{t!=null&&t.current?t.current.focus():r!=null&&r.current&&d6(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 a.jsx(jD,{crossFrame:f,persistentFocus:d,autoFocus:u,disabled:i,onActivation:h,onDeactivation:m,returnFocus:v,children:s})};f6.displayName="FocusLock";function ED(e,t,n,r){const o=n3(t);return p.useEffect(()=>{var s;const i=(s=xx(n))!=null?s:document;if(t)return i.addEventListener(e,o,r),()=>{i.removeEventListener(e,o,r)}},[e,n,r,o,t]),()=>{var s;((s=xx(n))!=null?s:document).removeEventListener(e,o,r)}}function ID(e){const{ref:t,handler:n,enabled:r=!0}=e,o=n3(n),i=p.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}).current;p.useEffect(()=>{if(!r)return;const u=m=>{Pg(m,t)&&(i.isPointerDown=!0)},d=m=>{if(i.ignoreEmulatedMouseEvents){i.ignoreEmulatedMouseEvents=!1;return}i.isPointerDown&&n&&Pg(m,t)&&(i.isPointerDown=!1,o(m))},f=m=>{i.ignoreEmulatedMouseEvents=!0,n&&i.isPointerDown&&Pg(m,t)&&(i.isPointerDown=!1,o(m))},h=r3(t.current);return h.addEventListener("mousedown",u,!0),h.addEventListener("mouseup",d,!0),h.addEventListener("touchstart",u,!0),h.addEventListener("touchend",f,!0),()=>{h.removeEventListener("mousedown",u,!0),h.removeEventListener("mouseup",d,!0),h.removeEventListener("touchstart",u,!0),h.removeEventListener("touchend",f,!0)}},[n,t,o,i,r])}function Pg(e,t){var n;const r=e.target;return r&&!r3(r).contains(r)?!1:!((n=t.current)!=null&&n.contains(r))}var[OD,RD]=ur({name:"InputGroupStylesContext",errorMessage:`useInputGroupStyles returned is 'undefined'. Seems you forgot to wrap the components in "<InputGroup />" `}),p6=rt(function(t,n){const r=Zr("Input",t),{children:o,className:s,...i}=xr(t),u=Ot("chakra-input__group",s),d={},f=lh(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 w=e1({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,w):p.cloneElement(v,Object.assign(w,d,v.props))});return a.jsx(Ve.div,{className:u,ref:n,__css:{width:"100%",display:"flex",position:"relative",isolation:"isolate"},"data-group":!0,...i,children:a.jsx(OD,{value:r,children:m})})});p6.displayName="InputGroup";var TD=Ve("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"0",zIndex:2}}),yh=rt(function(t,n){var r,o;const{placement:s="left",...i}=t,u=RD(),d=u.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,...u.element};return a.jsx(TD,{ref:n,__css:h,...i})});yh.id="InputElement";yh.displayName="InputElement";var h6=rt(function(t,n){const{className:r,...o}=t,s=Ot("chakra-input__left-element",r);return a.jsx(yh,{ref:n,placement:"left",className:s,...o})});h6.id="InputLeftElement";h6.displayName="InputLeftElement";var h1=rt(function(t,n){const{className:r,...o}=t,s=Ot("chakra-input__right-element",r);return a.jsx(yh,{ref:n,placement:"right",className:s,...o})});h1.id="InputRightElement";h1.displayName="InputRightElement";var Fu=rt(function(t,n){const{htmlSize:r,...o}=t,s=Zr("Input",o),i=xr(o),u=H0(i),d=Ot("chakra-input",t.className);return a.jsx(Ve.input,{size:r,...u,__css:s.field,ref:n,className:d})});Fu.displayName="Input";Fu.id="Input";var zi=rt(function(t,n){const r=pc("Link",t),{className:o,isExternal:s,...i}=xr(t);return a.jsx(Ve.a,{target:s?"_blank":void 0,rel:s?"noopener":void 0,ref:n,className:Ot("chakra-link",o),...i,__css:r})});zi.displayName="Link";var[MD,m6]=ur({name:"ListStylesContext",errorMessage:`useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "<List />" `}),m1=rt(function(t,n){const r=Zr("List",t),{children:o,styleType:s="none",stylePosition:i,spacing:u,...d}=xr(t),f=lh(o),m=u?{["& > *:not(style) ~ *:not(style)"]:{mt:u}}:{};return a.jsx(MD,{value:r,children:a.jsx(Ve.ul,{ref:n,listStyleType:s,listStylePosition:i,role:"list",__css:{...r.container,...m},...d,children:f})})});m1.displayName="List";var DD=rt((e,t)=>{const{as:n,...r}=e;return a.jsx(m1,{ref:t,as:"ol",styleType:"decimal",marginStart:"1em",...r})});DD.displayName="OrderedList";var bh=rt(function(t,n){const{as:r,...o}=t;return a.jsx(m1,{ref:n,as:"ul",styleType:"initial",marginStart:"1em",...o})});bh.displayName="UnorderedList";var Mo=rt(function(t,n){const r=m6();return a.jsx(Ve.li,{ref:n,...t,__css:r.item})});Mo.displayName="ListItem";var AD=rt(function(t,n){const r=m6();return a.jsx(go,{ref:n,role:"presentation",...t,__css:r.icon})});AD.displayName="ListIcon";var xa=rt(function(t,n){const{templateAreas:r,gap:o,rowGap:s,columnGap:i,column:u,row:d,autoFlow:f,autoRows:h,templateRows:m,autoColumns:v,templateColumns:y,...S}=t,w={display:"grid",gridTemplateAreas:r,gridGap:o,gridRowGap:s,gridColumnGap:i,gridAutoColumns:v,gridColumn:u,gridRow:d,gridAutoFlow:f,gridAutoRows:h,gridTemplateRows:m,gridTemplateColumns:y};return a.jsx(Ve.div,{ref:n,__css:w,...S})});xa.displayName="Grid";var Oa=Ve("div",{baseStyle:{flex:1,justifySelf:"stretch",alignSelf:"stretch"}});Oa.displayName="Spacer";var Ue=rt(function(t,n){const r=pc("Text",t),{className:o,align:s,decoration:i,casing:u,...d}=xr(t),f=e1({textAlign:t.align,textDecoration:t.decoration,textTransform:t.casing});return a.jsx(Ve.p,{ref:n,className:Ot("chakra-text",t.className),...f,...d,__css:r})});Ue.displayName="Text";var jr=rt((e,t)=>a.jsx(dO,{align:"center",...e,direction:"column",ref:t}));jr.displayName="VStack";function R2(e){return fO(e,t=>t==="auto"?"auto":`span ${t}/span ${t}`)}var Lv=rt(function(t,n){const{area:r,colSpan:o,colStart:s,colEnd:i,rowEnd:u,rowSpan:d,rowStart:f,...h}=t,m=e1({gridArea:r,gridColumn:R2(o),gridRow:R2(d),gridColumnStart:s,gridColumnEnd:i,gridRowStart:f,gridRowEnd:u});return a.jsx(Ve.div,{ref:n,__css:m,...h})});Lv.displayName="GridItem";var Ql=rt(function(t,n){const r=pc("Badge",t),{className:o,...s}=xr(t);return a.jsx(Ve.span,{ref:n,className:Ot("chakra-badge",t.className),...s,__css:{display:"inline-block",whiteSpace:"nowrap",verticalAlign:"middle",...r}})});Ql.displayName="Badge";var Ra=rt(function(t,n){const{borderLeftWidth:r,borderBottomWidth:o,borderTopWidth:s,borderRightWidth:i,borderWidth:u,borderStyle:d,borderColor:f,...h}=pc("Divider",t),{className:m,orientation:v="horizontal",__css:y,...S}=xr(t),w={vertical:{borderLeftWidth:r||i||u||"1px",height:"100%"},horizontal:{borderBottomWidth:o||s||u||"1px",width:"100%"}};return a.jsx(Ve.hr,{ref:n,"aria-orientation":v,...S,__css:{...h,border:"0",borderColor:f,borderStyle:d,...w[v],...y},className:Ot("chakra-divider",m)})});Ra.displayName="Divider";function ND(e){const{key:t}=e;return t.length===1||t.length>1&&/[^a-zA-Z0-9]/.test(t)}function zD(e={}){const{timeout:t=300,preventDefault:n=()=>!0}=e,[r,o]=p.useState([]),s=p.useRef(),i=()=>{s.current&&(clearTimeout(s.current),s.current=null)},u=()=>{i(),s.current=setTimeout(()=>{o([]),s.current=null},t)};p.useEffect(()=>i,[]);function d(f){return h=>{if(h.key==="Backspace"){const m=[...r];m.pop(),o(m);return}if(ND(h)){const m=r.concat(h.key);n(h)&&(h.preventDefault(),h.stopPropagation()),o(m),f(m.join("")),u()}}}return d}function $D(e,t,n,r){if(t==null)return r;if(!r)return e.find(i=>n(i).toLowerCase().startsWith(t.toLowerCase()));const o=e.filter(s=>n(s).toLowerCase().startsWith(t.toLowerCase()));if(o.length>0){let s;return o.includes(r)?(s=o.indexOf(r)+1,s===o.length&&(s=0),o[s]):(s=e.indexOf(o[0]),e[s])}return r}function LD(){const e=p.useRef(new Map),t=e.current,n=p.useCallback((o,s,i,u)=>{e.current.set(i,{type:s,el:o,options:u}),o.addEventListener(s,i,u)},[]),r=p.useCallback((o,s,i,u)=>{o.removeEventListener(s,i,u),e.current.delete(i)},[]);return p.useEffect(()=>()=>{t.forEach((o,s)=>{r(o.el,o.type,s,o.options)})},[r,t]),{add:n,remove:r}}function _g(e){const t=e.target,{tagName:n,isContentEditable:r}=t;return n!=="INPUT"&&n!=="TEXTAREA"&&r!==!0}function g6(e={}){const{ref:t,isDisabled:n,isFocusable:r,clickOnEnter:o=!0,clickOnSpace:s=!0,onMouseDown:i,onMouseUp:u,onClick:d,onKeyDown:f,onKeyUp:h,tabIndex:m,onMouseOver:v,onMouseLeave:y,...S}=e,[w,C]=p.useState(!0),[k,P]=p.useState(!1),j=LD(),E=N=>{N&&N.tagName!=="BUTTON"&&C(!1)},O=w?m:m||0,I=n&&!r,R=p.useCallback(N=>{if(n){N.stopPropagation(),N.preventDefault();return}N.currentTarget.focus(),d==null||d(N)},[n,d]),T=p.useCallback(N=>{k&&_g(N)&&(N.preventDefault(),N.stopPropagation(),P(!1),j.remove(document,"keyup",T,!1))},[k,j]),D=p.useCallback(N=>{if(f==null||f(N),n||N.defaultPrevented||N.metaKey||!_g(N.nativeEvent)||w)return;const V=o&&N.key==="Enter";s&&N.key===" "&&(N.preventDefault(),P(!0)),V&&(N.preventDefault(),N.currentTarget.click()),j.add(document,"keyup",T,!1)},[n,w,f,o,s,j,T]),$=p.useCallback(N=>{if(h==null||h(N),n||N.defaultPrevented||N.metaKey||!_g(N.nativeEvent)||w)return;s&&N.key===" "&&(N.preventDefault(),P(!1),N.currentTarget.click())},[s,w,n,h]),A=p.useCallback(N=>{N.button===0&&(P(!1),j.remove(document,"mouseup",A,!1))},[j]),J=p.useCallback(N=>{if(N.button!==0)return;if(n){N.stopPropagation(),N.preventDefault();return}w||P(!0),N.currentTarget.focus({preventScroll:!0}),j.add(document,"mouseup",A,!1),i==null||i(N)},[n,w,i,j,A]),z=p.useCallback(N=>{N.button===0&&(w||P(!1),u==null||u(N))},[u,w]),B=p.useCallback(N=>{if(n){N.preventDefault();return}v==null||v(N)},[n,v]),G=p.useCallback(N=>{k&&(N.preventDefault(),P(!1)),y==null||y(N)},[k,y]),K=Un(t,E);return w?{...S,ref:K,type:"button","aria-disabled":I?void 0:n,disabled:I,onClick:R,onMouseDown:i,onMouseUp:u,onKeyUp:h,onKeyDown:f,onMouseOver:v,onMouseLeave:y}:{...S,ref:K,role:"button","data-active":sn(k),"aria-disabled":n?"true":void 0,tabIndex:I?void 0:O,onClick:R,onMouseDown:J,onMouseUp:z,onKeyUp:$,onKeyDown:D,onMouseOver:B,onMouseLeave:G}}function FD(e){const t=e.current;if(!t)return!1;const n=pO(t);return!n||t.contains(n)?!1:!!CD(n)}function v6(e,t){const{shouldFocus:n,visible:r,focusRef:o}=t,s=n&&!r;el(()=>{if(!s||FD(e))return;const i=(o==null?void 0:o.current)||e.current;let u;if(i)return u=requestAnimationFrame(()=>{i.focus({preventScroll:!0})}),()=>{cancelAnimationFrame(u)}},[s,e,o])}var BD={preventScroll:!0,shouldFocus:!1};function HD(e,t=BD){const{focusRef:n,preventScroll:r,shouldFocus:o,visible:s}=t,i=WD(e)?e.current:e,u=o&&s,d=p.useRef(u),f=p.useRef(s);ou(()=>{!f.current&&s&&(d.current=u),f.current=s},[s,u]);const h=p.useCallback(()=>{if(!(!s||!i||!d.current)&&(d.current=!1,!i.contains(document.activeElement)))if(n!=null&&n.current)requestAnimationFrame(()=>{var m;(m=n.current)==null||m.focus({preventScroll:r})});else{const m=d6(i);m.length>0&&requestAnimationFrame(()=>{m[0].focus({preventScroll:r})})}},[s,r,i,n]);el(()=>{h()},[h]),F0(i,"transitionend",h)}function WD(e){return"current"in e}function VD(e){const{ref:t,handler:n,enabled:r=!0}=e,o=ni(n),i=p.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}).current;p.useEffect(()=>{if(!r)return;const u=m=>{jg(m,t)&&(i.isPointerDown=!0)},d=m=>{if(i.ignoreEmulatedMouseEvents){i.ignoreEmulatedMouseEvents=!1;return}i.isPointerDown&&n&&jg(m,t)&&(i.isPointerDown=!1,o(m))},f=m=>{i.ignoreEmulatedMouseEvents=!0,n&&i.isPointerDown&&jg(m,t)&&(i.isPointerDown=!1,o(m))},h=y6(t.current);return h.addEventListener("mousedown",u,!0),h.addEventListener("mouseup",d,!0),h.addEventListener("touchstart",u,!0),h.addEventListener("touchend",f,!0),()=>{h.removeEventListener("mousedown",u,!0),h.removeEventListener("mouseup",d,!0),h.removeEventListener("touchstart",u,!0),h.removeEventListener("touchend",f,!0)}},[n,t,o,i,r])}function jg(e,t){var n;const r=e.target;return r&&!y6(r).contains(r)?!1:!((n=t.current)!=null&&n.contains(r))}function y6(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function b6(e){const{isOpen:t,ref:n}=e,[r,o]=p.useState(t),[s,i]=p.useState(!1);return p.useEffect(()=>{s||(o(t),i(!0))},[t,s,r]),F0(()=>n.current,"animationend",()=>{o(t)}),{present:!(t?!1:!r),onComplete(){var d;const f=hO(n.current),h=new f.CustomEvent("animationend",{bubbles:!0});(d=n.current)==null||d.dispatchEvent(h)}}}function g1(e){const{wasSelected:t,enabled:n,isSelected:r,mode:o="unmount"}=e;return!!(!n||r||o==="keepMounted"&&t)}var[UD,GD,qD,KD]=t1(),[YD,Bu]=ur({strict:!1,name:"MenuContext"});function XD(e,...t){const n=p.useId(),r=e||n;return p.useMemo(()=>t.map(o=>`${o}-${r}`),[r,t])}function x6(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function T2(e){return x6(e).activeElement===e}function QD(e={}){const{id:t,closeOnSelect:n=!0,closeOnBlur:r=!0,initialFocusRef:o,autoSelect:s=!0,isLazy:i,isOpen:u,defaultIsOpen:d,onClose:f,onOpen:h,placement:m="bottom-start",lazyBehavior:v="unmount",direction:y,computePositionOnMount:S=!1,...w}=e,C=p.useRef(null),k=p.useRef(null),P=qD(),j=p.useCallback(()=>{requestAnimationFrame(()=>{var le;(le=C.current)==null||le.focus({preventScroll:!1})})},[]),E=p.useCallback(()=>{const le=setTimeout(()=>{var se;if(o)(se=o.current)==null||se.focus();else{const Y=P.firstEnabled();Y&&z(Y.index)}});V.current.add(le)},[P,o]),O=p.useCallback(()=>{const le=setTimeout(()=>{const se=P.lastEnabled();se&&z(se.index)});V.current.add(le)},[P]),I=p.useCallback(()=>{h==null||h(),s?E():j()},[s,E,j,h]),{isOpen:R,onOpen:T,onClose:D,onToggle:$}=o3({isOpen:u,defaultIsOpen:d,onClose:f,onOpen:I});VD({enabled:R&&r,ref:C,handler:le=>{var se;(se=k.current)!=null&&se.contains(le.target)||D()}});const A=s3({...w,enabled:R||S,placement:m,direction:y}),[J,z]=p.useState(-1);el(()=>{R||z(-1)},[R]),v6(C,{focusRef:k,visible:R,shouldFocus:!0});const B=b6({isOpen:R,ref:C}),[G,K]=XD(t,"menu-button","menu-list"),N=p.useCallback(()=>{T(),j()},[T,j]),V=p.useRef(new Set([]));s9(()=>{V.current.forEach(le=>clearTimeout(le)),V.current.clear()});const W=p.useCallback(()=>{T(),E()},[E,T]),U=p.useCallback(()=>{T(),O()},[T,O]),re=p.useCallback(()=>{var le,se;const Y=x6(C.current),ae=(le=C.current)==null?void 0:le.contains(Y.activeElement);if(!(R&&!ae))return;const xe=(se=P.item(J))==null?void 0:se.node;xe==null||xe.focus()},[R,J,P]),ve=p.useRef(null);return{openAndFocusMenu:N,openAndFocusFirstItem:W,openAndFocusLastItem:U,onTransitionEnd:re,unstable__animationState:B,descendants:P,popper:A,buttonId:G,menuId:K,forceUpdate:A.forceUpdate,orientation:"vertical",isOpen:R,onToggle:$,onOpen:T,onClose:D,menuRef:C,buttonRef:k,focusedIndex:J,closeOnSelect:n,closeOnBlur:r,autoSelect:s,setFocusedIndex:z,isLazy:i,lazyBehavior:v,initialFocusRef:o,rafId:ve}}function ZD(e={},t=null){const n=Bu(),{onToggle:r,popper:o,openAndFocusFirstItem:s,openAndFocusLastItem:i}=n,u=p.useCallback(d=>{const f=d.key,m={Enter:s,ArrowDown:s,ArrowUp:i}[f];m&&(d.preventDefault(),d.stopPropagation(),m(d))},[s,i]);return{...e,ref:Un(n.buttonRef,t,o.referenceRef),id:n.buttonId,"data-active":sn(n.isOpen),"aria-expanded":n.isOpen,"aria-haspopup":"menu","aria-controls":n.menuId,onClick:bt(e.onClick,r),onKeyDown:bt(e.onKeyDown,u)}}function Fv(e){var t;return r9(e)&&!!((t=e==null?void 0:e.getAttribute("role"))!=null&&t.startsWith("menuitem"))}function JD(e={},t=null){const n=Bu();if(!n)throw new Error("useMenuContext: context is undefined. Seems you forgot to wrap component within <Menu>");const{focusedIndex:r,setFocusedIndex:o,menuRef:s,isOpen:i,onClose:u,menuId:d,isLazy:f,lazyBehavior:h,unstable__animationState:m}=n,v=GD(),y=zD({preventDefault:k=>k.key!==" "&&Fv(k.target)}),S=p.useCallback(k=>{if(!k.currentTarget.contains(k.target))return;const P=k.key,E={Tab:I=>I.preventDefault(),Escape:u,ArrowDown:()=>{const I=v.nextEnabled(r);I&&o(I.index)},ArrowUp:()=>{const I=v.prevEnabled(r);I&&o(I.index)}}[P];if(E){k.preventDefault(),E(k);return}const O=y(I=>{const R=$D(v.values(),I,T=>{var D,$;return($=(D=T==null?void 0:T.node)==null?void 0:D.textContent)!=null?$:""},v.item(r));if(R){const T=v.indexOf(R.node);o(T)}});Fv(k.target)&&O(k)},[v,r,y,u,o]),w=p.useRef(!1);i&&(w.current=!0);const C=g1({wasSelected:w.current,enabled:f,mode:h,isSelected:m.present});return{...e,ref:Un(s,t),children:C?e.children:null,tabIndex:-1,role:"menu",id:d,style:{...e.style,transformOrigin:"var(--popper-transform-origin)"},"aria-orientation":"vertical",onKeyDown:bt(e.onKeyDown,S)}}function e9(e={}){const{popper:t,isOpen:n}=Bu();return t.getPopperProps({...e,style:{visibility:n?"visible":"hidden",...e.style}})}function S6(e={},t=null){const{onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onClick:s,onFocus:i,isDisabled:u,isFocusable:d,closeOnSelect:f,type:h,...m}=e,v=Bu(),{setFocusedIndex:y,focusedIndex:S,closeOnSelect:w,onClose:C,menuRef:k,isOpen:P,menuId:j,rafId:E}=v,O=p.useRef(null),I=`${j}-menuitem-${p.useId()}`,{index:R,register:T}=KD({disabled:u&&!d}),D=p.useCallback(N=>{n==null||n(N),!u&&y(R)},[y,R,u,n]),$=p.useCallback(N=>{r==null||r(N),O.current&&!T2(O.current)&&D(N)},[D,r]),A=p.useCallback(N=>{o==null||o(N),!u&&y(-1)},[y,u,o]),J=p.useCallback(N=>{s==null||s(N),Fv(N.currentTarget)&&(f??w)&&C()},[C,s,w,f]),z=p.useCallback(N=>{i==null||i(N),y(R)},[y,i,R]),B=R===S,G=u&&!d;el(()=>{P&&(B&&!G&&O.current?(E.current&&cancelAnimationFrame(E.current),E.current=requestAnimationFrame(()=>{var N;(N=O.current)==null||N.focus(),E.current=null})):k.current&&!T2(k.current)&&k.current.focus({preventScroll:!0}))},[B,G,k,P]);const K=g6({onClick:J,onFocus:z,onMouseEnter:D,onMouseMove:$,onMouseLeave:A,ref:Un(T,O,t),isDisabled:u,isFocusable:d});return{...m,...K,type:h??K.type,id:I,role:"menuitem",tabIndex:B?0:-1}}function t9(e={},t=null){const{type:n="radio",isChecked:r,...o}=e;return{...S6(o,t),role:`menuitem${n}`,"aria-checked":r}}function n9(e={}){const{children:t,type:n="radio",value:r,defaultValue:o,onChange:s,...i}=e,d=n==="radio"?"":[],[f,h]=Ou({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 w=f.includes(S)?f.filter(C=>C!==S):f.concat(S);h(w)}},[f,h,n]),y=lh(t).map(S=>{if(S.type.id!=="MenuItemOption")return S;const w=k=>{var P,j;m(S.props.value),(j=(P=S.props).onClick)==null||j.call(P,k)},C=n==="radio"?S.props.value===f:f.includes(S.props.value);return p.cloneElement(S,{type:n,onClick:w,isChecked:C})});return{...i,children:y}}function r9(e){var t;if(!o9(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function o9(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function s9(e,t=[]){return p.useEffect(()=>()=>e(),t)}var[a9,Hu]=ur({name:"MenuStylesContext",errorMessage:`useMenuStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Menu />" `}),xh=e=>{const{children:t}=e,n=Zr("Menu",e),r=xr(e),{direction:o}=ch(),{descendants:s,...i}=QD({...r,direction:o}),u=p.useMemo(()=>i,[i]),{isOpen:d,onClose:f,forceUpdate:h}=u;return a.jsx(UD,{value:s,children:a.jsx(YD,{value:u,children:a.jsx(a9,{value:n,children:B0(t,{isOpen:d,onClose:f,forceUpdate:h})})})})};xh.displayName="Menu";var w6=rt((e,t)=>{const n=Hu();return a.jsx(Ve.span,{ref:t,...e,__css:n.command,className:"chakra-menu__command"})});w6.displayName="MenuCommand";var C6=rt((e,t)=>{const{type:n,...r}=e,o=Hu(),s=r.as||n?n??void 0:"button",i=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 a.jsx(Ve.button,{ref:t,type:s,...r,__css:i})}),v1=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:Ot("chakra-menu__icon",o.props.className)}):null,i=Ot("chakra-menu__icon-wrapper",t);return a.jsx(Ve.span,{className:i,...r,__css:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:s})};v1.displayName="MenuIcon";var Yr=rt((e,t)=>{const{icon:n,iconSpacing:r="0.75rem",command:o,commandSpacing:s="0.75rem",children:i,...u}=e,d=S6(u,t),h=n||o?a.jsx("span",{style:{pointerEvents:"none",flex:1},children:i}):i;return a.jsxs(C6,{...d,className:Ot("chakra-menu__menuitem",d.className),children:[n&&a.jsx(v1,{fontSize:"0.8em",marginEnd:r,children:n}),h,o&&a.jsx(w6,{marginStart:s,children:o})]})});Yr.displayName="MenuItem";var i9={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"}}},l9=Ve(bo.div),Wu=rt(function(t,n){var r,o;const{rootProps:s,motionProps:i,...u}=t,{isOpen:d,onTransitionEnd:f,unstable__animationState:h}=Bu(),m=JD(u,n),v=e9(s),y=Hu();return a.jsx(Ve.div,{...v,__css:{zIndex:(o=t.zIndex)!=null?o:(r=y.list)==null?void 0:r.zIndex},children:a.jsx(l9,{variants:i9,initial:!1,animate:d?"enter":"exit",__css:{outline:0,...y.list},...i,className:Ot("chakra-menu__menu-list",m.className),...m,onUpdate:f,onAnimationComplete:ih(h.onComplete,m.onAnimationComplete)})})});Wu.displayName="MenuList";var k6=rt((e,t)=>{const{title:n,children:r,className:o,...s}=e,i=Ot("chakra-menu__group__title",o),u=Hu();return a.jsxs("div",{ref:t,className:"chakra-menu__group",role:"group",children:[n&&a.jsx(Ve.p,{className:i,...s,__css:u.groupTitle,children:n}),r]})});k6.displayName="MenuGroup";var y1=e=>{const{className:t,title:n,...r}=e,o=n9(r);return a.jsx(k6,{title:n,className:Ot("chakra-menu__option-group",t),...o})};y1.displayName="MenuOptionGroup";var c9=rt((e,t)=>{const n=Hu();return a.jsx(Ve.button,{ref:t,...e,__css:{display:"inline-flex",appearance:"none",alignItems:"center",outline:0,...n.button}})}),Sh=rt((e,t)=>{const{children:n,as:r,...o}=e,s=ZD(o,t),i=r||c9;return a.jsx(i,{...s,className:Ot("chakra-menu__menu-button",e.className),children:a.jsx(Ve.span,{__css:{pointerEvents:"none",flex:"1 1 auto",minW:0},children:e.children})})});Sh.displayName="MenuButton";var u9=e=>a.jsx("svg",{viewBox:"0 0 14 14",width:"1em",height:"1em",...e,children:a.jsx("polygon",{fill:"currentColor",points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"})}),yu=rt((e,t)=>{const{icon:n,iconSpacing:r="0.75rem",...o}=e,s=t9(o,t);return a.jsxs(C6,{...s,className:Ot("chakra-menu__menuitem-option",o.className),children:[n!==null&&a.jsx(v1,{fontSize:"0.8em",marginEnd:r,opacity:e.isChecked?1:0,children:n||a.jsx(u9,{})}),a.jsx("span",{style:{flex:1},children:s.children})]})});yu.id="MenuItemOption";yu.displayName="MenuItemOption";var d9={slideInBottom:{...Rv,custom:{offsetY:16,reverse:!0}},slideInRight:{...Rv,custom:{offsetX:16,reverse:!0}},scale:{...h5,custom:{initialScale:.95,reverse:!0}},none:{}},f9=Ve(bo.section),p9=e=>d9[e||"none"],P6=p.forwardRef((e,t)=>{const{preset:n,motionProps:r=p9(n),...o}=e;return a.jsx(f9,{ref:t,...r,...o})});P6.displayName="ModalTransition";var h9=Object.defineProperty,m9=(e,t,n)=>t in e?h9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,g9=(e,t,n)=>(m9(e,typeof t!="symbol"?t+"":t,n),n),v9=class{constructor(){g9(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}},Bv=new v9;function _6(e,t){const[n,r]=p.useState(0);return p.useEffect(()=>{const o=e.current;if(o){if(t){const s=Bv.add(o);r(s)}return()=>{Bv.remove(o),r(0)}}},[t,e]),n}var y9=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Sl=new WeakMap,Wd=new WeakMap,Vd={},Eg=0,j6=function(e){return e&&(e.host||j6(e.parentNode))},b9=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=j6(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})},x9=function(e,t,n,r){var o=b9(t,Array.isArray(e)?e:[e]);Vd[n]||(Vd[n]=new WeakMap);var s=Vd[n],i=[],u=new Set,d=new Set(o),f=function(m){!m||u.has(m)||(u.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(u.has(v))h(v);else{var y=v.getAttribute(r),S=y!==null&&y!=="false",w=(Sl.get(v)||0)+1,C=(s.get(v)||0)+1;Sl.set(v,w),s.set(v,C),i.push(v),w===1&&S&&Wd.set(v,!0),C===1&&v.setAttribute(n,"true"),S||v.setAttribute(r,"true")}})};return h(t),u.clear(),Eg++,function(){i.forEach(function(m){var v=Sl.get(m)-1,y=s.get(m)-1;Sl.set(m,v),s.set(m,y),v||(Wd.has(m)||m.removeAttribute(r),Wd.delete(m)),y||m.removeAttribute(n)}),Eg--,Eg||(Sl=new WeakMap,Sl=new WeakMap,Wd=new WeakMap,Vd={})}},S9=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||y9(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),x9(r,o,n,"aria-hidden")):function(){return null}};function w9(e){const{isOpen:t,onClose:n,id:r,closeOnOverlayClick:o=!0,closeOnEsc:s=!0,useInert:i=!0,onOverlayClick:u,onEsc:d}=e,f=p.useRef(null),h=p.useRef(null),[m,v,y]=k9(r,"chakra-modal","chakra-modal--header","chakra-modal--body");C9(f,t&&i);const S=_6(f,t),w=p.useRef(null),C=p.useCallback(D=>{w.current=D.target},[]),k=p.useCallback(D=>{D.key==="Escape"&&(D.stopPropagation(),s&&(n==null||n()),d==null||d())},[s,n,d]),[P,j]=p.useState(!1),[E,O]=p.useState(!1),I=p.useCallback((D={},$=null)=>({role:"dialog",...D,ref:Un($,f),id:m,tabIndex:-1,"aria-modal":!0,"aria-labelledby":P?v:void 0,"aria-describedby":E?y:void 0,onClick:bt(D.onClick,A=>A.stopPropagation())}),[y,E,m,v,P]),R=p.useCallback(D=>{D.stopPropagation(),w.current===D.target&&Bv.isTopModal(f.current)&&(o&&(n==null||n()),u==null||u())},[n,o,u]),T=p.useCallback((D={},$=null)=>({...D,ref:Un($,h),onClick:bt(D.onClick,R),onKeyDown:bt(D.onKeyDown,k),onMouseDown:bt(D.onMouseDown,C)}),[k,C,R]);return{isOpen:t,onClose:n,headerId:v,bodyId:y,setBodyMounted:O,setHeaderMounted:j,dialogRef:f,overlayRef:h,getDialogProps:I,getDialogContainerProps:T,index:S}}function C9(e,t){const n=e.current;p.useEffect(()=>{if(!(!e.current||!t))return S9(e.current)},[t,e,n])}function k9(e,...t){const n=p.useId(),r=e||n;return p.useMemo(()=>t.map(o=>`${o}-${r}`),[r,t])}var[P9,yc]=ur({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Modal />" `}),[_9,Ui]=ur({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in `<Modal />`"}),bu=e=>{const t={scrollBehavior:"outside",autoFocus:!0,trapFocus:!0,returnFocusOnClose:!0,blockScrollOnMount:!0,allowPinchZoom:!1,motionPreset:"scale",lockFocusAcrossFrames:!0,...e},{portalProps:n,children:r,autoFocus:o,trapFocus:s,initialFocusRef:i,finalFocusRef:u,returnFocusOnClose:d,blockScrollOnMount:f,allowPinchZoom:h,preserveScrollBarGap:m,motionPreset:v,lockFocusAcrossFrames:y,onCloseComplete:S}=t,w=Zr("Modal",t),k={...w9(t),autoFocus:o,trapFocus:s,initialFocusRef:i,finalFocusRef:u,returnFocusOnClose:d,blockScrollOnMount:f,allowPinchZoom:h,preserveScrollBarGap:m,motionPreset:v,lockFocusAcrossFrames:y};return a.jsx(_9,{value:k,children:a.jsx(P9,{value:w,children:a.jsx(No,{onExitComplete:S,children:k.isOpen&&a.jsx($f,{...n,children:r})})})})};bu.displayName="Modal";var Tf="right-scroll-bar-position",Mf="width-before-scroll-bar",j9="with-scroll-bars-hidden",E9="--removed-body-scroll-bar-size",E6=z5(),Ig=function(){},wh=p.forwardRef(function(e,t){var n=p.useRef(null),r=p.useState({onScrollCapture:Ig,onWheelCapture:Ig,onTouchMoveCapture:Ig}),o=r[0],s=r[1],i=e.forwardProps,u=e.children,d=e.className,f=e.removeScrollBar,h=e.enabled,m=e.shards,v=e.sideCar,y=e.noIsolation,S=e.inert,w=e.allowPinchZoom,C=e.as,k=C===void 0?"div":C,P=e.gapMode,j=D5(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=v,O=M5([n,t]),I=Vs(Vs({},j),o);return p.createElement(p.Fragment,null,h&&p.createElement(E,{sideCar:E6,removeScrollBar:f,shards:m,noIsolation:y,inert:S,setCallbacks:s,allowPinchZoom:!!w,lockRef:n,gapMode:P}),i?p.cloneElement(p.Children.only(u),Vs(Vs({},I),{ref:O})):p.createElement(k,Vs({},I,{className:d,ref:O}),u))});wh.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};wh.classNames={fullWidth:Mf,zeroRight:Tf};var M2,I9=function(){if(M2)return M2;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function O9(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=I9();return t&&e.setAttribute("nonce",t),e}function R9(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function T9(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var M9=function(){var e=0,t=null;return{add:function(n){e==0&&(t=O9())&&(R9(t,n),T9(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},D9=function(){var e=M9();return function(t,n){p.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},I6=function(){var e=D9(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},A9={left:0,top:0,right:0,gap:0},Og=function(e){return parseInt(e||"",10)||0},N9=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[Og(n),Og(r),Og(o)]},z9=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return A9;var t=N9(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])}},$9=I6(),L9=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,u=e.gap;return n===void 0&&(n="margin"),`
|
||
.`.concat(j9,` {
|
||
overflow: hidden `).concat(r,`;
|
||
padding-right: `).concat(u,"px ").concat(r,`;
|
||
}
|
||
body {
|
||
overflow: hidden `).concat(r,`;
|
||
overscroll-behavior: contain;
|
||
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
||
padding-left: `.concat(o,`px;
|
||
padding-top: `).concat(s,`px;
|
||
padding-right: `).concat(i,`px;
|
||
margin-left:0;
|
||
margin-top:0;
|
||
margin-right: `).concat(u,"px ").concat(r,`;
|
||
`),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
|
||
}
|
||
|
||
.`).concat(Tf,` {
|
||
right: `).concat(u,"px ").concat(r,`;
|
||
}
|
||
|
||
.`).concat(Mf,` {
|
||
margin-right: `).concat(u,"px ").concat(r,`;
|
||
}
|
||
|
||
.`).concat(Tf," .").concat(Tf,` {
|
||
right: 0 `).concat(r,`;
|
||
}
|
||
|
||
.`).concat(Mf," .").concat(Mf,` {
|
||
margin-right: 0 `).concat(r,`;
|
||
}
|
||
|
||
body {
|
||
`).concat(E9,": ").concat(u,`px;
|
||
}
|
||
`)},F9=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,s=p.useMemo(function(){return z9(o)},[o]);return p.createElement($9,{styles:L9(s,!t,o,n?"":"!important")})},Hv=!1;if(typeof window<"u")try{var Ud=Object.defineProperty({},"passive",{get:function(){return Hv=!0,!0}});window.addEventListener("test",Ud,Ud),window.removeEventListener("test",Ud,Ud)}catch{Hv=!1}var wl=Hv?{passive:!1}:!1,B9=function(e){return e.tagName==="TEXTAREA"},O6=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!B9(e)&&n[t]==="visible")},H9=function(e){return O6(e,"overflowY")},W9=function(e){return O6(e,"overflowX")},D2=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=R6(e,r);if(o){var s=T6(e,r),i=s[1],u=s[2];if(i>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},V9=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},U9=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},R6=function(e,t){return e==="v"?H9(t):W9(t)},T6=function(e,t){return e==="v"?V9(t):U9(t)},G9=function(e,t){return e==="h"&&t==="rtl"?-1:1},q9=function(e,t,n,r,o){var s=G9(e,window.getComputedStyle(t).direction),i=s*r,u=n.target,d=t.contains(u),f=!1,h=i>0,m=0,v=0;do{var y=T6(e,u),S=y[0],w=y[1],C=y[2],k=w-C-s*S;(S||k)&&R6(e,u)&&(m+=k,v+=S),u=u.parentNode}while(!d&&u!==document.body||d&&(t.contains(u)||t===u));return(h&&(o&&m===0||!o&&i>m)||!h&&(o&&v===0||!o&&-i>v))&&(f=!0),f},Gd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},A2=function(e){return[e.deltaX,e.deltaY]},N2=function(e){return e&&"current"in e?e.current:e},K9=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Y9=function(e){return`
|
||
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
||
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
||
`)},X9=0,Cl=[];function Q9(e){var t=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),o=p.useState(X9++)[0],s=p.useState(I6)[0],i=p.useRef(e);p.useEffect(function(){i.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var w=Av([e.lockRef.current],(e.shards||[]).map(N2),!0).filter(Boolean);return w.forEach(function(C){return C.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),w.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var u=p.useCallback(function(w,C){if("touches"in w&&w.touches.length===2)return!i.current.allowPinchZoom;var k=Gd(w),P=n.current,j="deltaX"in w?w.deltaX:P[0]-k[0],E="deltaY"in w?w.deltaY:P[1]-k[1],O,I=w.target,R=Math.abs(j)>Math.abs(E)?"h":"v";if("touches"in w&&R==="h"&&I.type==="range")return!1;var T=D2(R,I);if(!T)return!0;if(T?O=R:(O=R==="v"?"h":"v",T=D2(R,I)),!T)return!1;if(!r.current&&"changedTouches"in w&&(j||E)&&(r.current=O),!O)return!0;var D=r.current||O;return q9(D,C,w,D==="h"?j:E,!0)},[]),d=p.useCallback(function(w){var C=w;if(!(!Cl.length||Cl[Cl.length-1]!==s)){var k="deltaY"in C?A2(C):Gd(C),P=t.current.filter(function(O){return O.name===C.type&&O.target===C.target&&K9(O.delta,k)})[0];if(P&&P.should){C.cancelable&&C.preventDefault();return}if(!P){var j=(i.current.shards||[]).map(N2).filter(Boolean).filter(function(O){return O.contains(C.target)}),E=j.length>0?u(C,j[0]):!i.current.noIsolation;E&&C.cancelable&&C.preventDefault()}}},[]),f=p.useCallback(function(w,C,k,P){var j={name:w,delta:C,target:k,should:P};t.current.push(j),setTimeout(function(){t.current=t.current.filter(function(E){return E!==j})},1)},[]),h=p.useCallback(function(w){n.current=Gd(w),r.current=void 0},[]),m=p.useCallback(function(w){f(w.type,A2(w),w.target,u(w,e.lockRef.current))},[]),v=p.useCallback(function(w){f(w.type,Gd(w),w.target,u(w,e.lockRef.current))},[]);p.useEffect(function(){return Cl.push(s),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:v}),document.addEventListener("wheel",d,wl),document.addEventListener("touchmove",d,wl),document.addEventListener("touchstart",h,wl),function(){Cl=Cl.filter(function(w){return w!==s}),document.removeEventListener("wheel",d,wl),document.removeEventListener("touchmove",d,wl),document.removeEventListener("touchstart",h,wl)}},[]);var y=e.removeScrollBar,S=e.inert;return p.createElement(p.Fragment,null,S?p.createElement(s,{styles:Y9(o)}):null,y?p.createElement(F9,{gapMode:e.gapMode}):null)}const Z9=CM(E6,Q9);var M6=p.forwardRef(function(e,t){return p.createElement(wh,Vs({},e,{ref:t,sideCar:Z9}))});M6.classNames=wh.classNames;const J9=M6;function eA(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:o,blockScrollOnMount:s,allowPinchZoom:i,finalFocusRef:u,returnFocusOnClose:d,preserveScrollBarGap:f,lockFocusAcrossFrames:h,isOpen:m}=Ui(),[v,y]=mO();p.useEffect(()=>{!v&&y&&setTimeout(y)},[v,y]);const S=_6(r,m);return a.jsx(f6,{autoFocus:t,isDisabled:!n,initialFocusRef:o,finalFocusRef:u,restoreFocus:d,contentRef:r,lockFocusAcrossFrames:h,children:a.jsx(J9,{removeScrollBar:!f,allowPinchZoom:i,enabled:S===1&&s,forwardProps:!0,children:e.children})})}var xu=rt((e,t)=>{const{className:n,children:r,containerProps:o,motionProps:s,...i}=e,{getDialogProps:u,getDialogContainerProps:d}=Ui(),f=u(i,t),h=d(o),m=Ot("chakra-modal__content",n),v=yc(),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:w}=Ui();return a.jsx(eA,{children:a.jsx(Ve.div,{...h,className:"chakra-modal__content-container",tabIndex:-1,__css:S,children:a.jsx(P6,{preset:w,motionProps:s,className:m,...f,__css:y,children:r})})})});xu.displayName="ModalContent";function Vu(e){const{leastDestructiveRef:t,...n}=e;return a.jsx(bu,{...n,initialFocusRef:t})}var Uu=rt((e,t)=>a.jsx(xu,{ref:t,role:"alertdialog",...e})),Sa=rt((e,t)=>{const{className:n,...r}=e,o=Ot("chakra-modal__footer",n),i={display:"flex",alignItems:"center",justifyContent:"flex-end",...yc().footer};return a.jsx(Ve.footer,{ref:t,...r,__css:i,className:o})});Sa.displayName="ModalFooter";var wa=rt((e,t)=>{const{className:n,...r}=e,{headerId:o,setHeaderMounted:s}=Ui();p.useEffect(()=>(s(!0),()=>s(!1)),[s]);const i=Ot("chakra-modal__header",n),d={flex:0,...yc().header};return a.jsx(Ve.header,{ref:t,className:i,id:o,...r,__css:d})});wa.displayName="ModalHeader";var tA=Ve(bo.div),Ca=rt((e,t)=>{const{className:n,transition:r,motionProps:o,...s}=e,i=Ot("chakra-modal__overlay",n),d={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...yc().overlay},{motionPreset:f}=Ui(),m=o||(f==="none"?{}:p5);return a.jsx(tA,{...m,__css:d,ref:t,className:i,...s})});Ca.displayName="ModalOverlay";var ka=rt((e,t)=>{const{className:n,...r}=e,{bodyId:o,setBodyMounted:s}=Ui();p.useEffect(()=>(s(!0),()=>s(!1)),[s]);const i=Ot("chakra-modal__body",n),u=yc();return a.jsx(Ve.div,{ref:t,className:i,id:o,...r,__css:u.body})});ka.displayName="ModalBody";var b1=rt((e,t)=>{const{onClick:n,className:r,...o}=e,{onClose:s}=Ui(),i=Ot("chakra-modal__close-btn",r),u=yc();return a.jsx(gO,{ref:t,__css:u.closeButton,className:i,onClick:bt(n,d=>{d.stopPropagation(),s()}),...o})});b1.displayName="ModalCloseButton";var[nA,Gu]=ur({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within `<Popover />`"}),[rA,x1]=ur({name:"PopoverStylesContext",errorMessage:`usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Popover />" `});function S1(e){const t=p.Children.only(e.children),{getTriggerProps:n}=Gu();return p.cloneElement(t,n(t.props,t.ref))}S1.displayName="PopoverTrigger";var kl={click:"click",hover:"hover"};function oA(e={}){const{closeOnBlur:t=!0,closeOnEsc:n=!0,initialFocusRef:r,id:o,returnFocusOnClose:s=!0,autoFocus:i=!0,arrowSize:u,arrowShadowColor:d,trigger:f=kl.click,openDelay:h=200,closeDelay:m=200,isLazy:v,lazyBehavior:y="unmount",computePositionOnMount:S,...w}=e,{isOpen:C,onClose:k,onOpen:P,onToggle:j}=o3(e),E=p.useRef(null),O=p.useRef(null),I=p.useRef(null),R=p.useRef(!1),T=p.useRef(!1);C&&(T.current=!0);const[D,$]=p.useState(!1),[A,J]=p.useState(!1),z=p.useId(),B=o??z,[G,K,N,V]=["popover-trigger","popover-content","popover-header","popover-body"].map(Oe=>`${Oe}-${B}`),{referenceRef:W,getArrowProps:U,getPopperProps:re,getArrowInnerProps:ve,forceUpdate:le}=s3({...w,enabled:C||!!S}),se=b6({isOpen:C,ref:I});j5({enabled:C,ref:O}),v6(I,{focusRef:O,visible:C,shouldFocus:s&&f===kl.click}),HD(I,{focusRef:r,visible:C,shouldFocus:i&&f===kl.click});const Y=g1({wasSelected:T.current,enabled:v,mode:y,isSelected:se.present}),ae=p.useCallback((Oe={},at=null)=>{const Fe={...Oe,style:{...Oe.style,transformOrigin:fg.transformOrigin.varRef,[fg.arrowSize.var]:u?`${u}px`:void 0,[fg.arrowShadowColor.var]:d},ref:Un(I,at),children:Y?Oe.children:null,id:K,tabIndex:-1,role:"dialog",onKeyDown:bt(Oe.onKeyDown,Ye=>{n&&Ye.key==="Escape"&&k()}),onBlur:bt(Oe.onBlur,Ye=>{const jt=z2(Ye),xt=Rg(I.current,jt),Fn=Rg(O.current,jt);C&&t&&(!xt&&!Fn)&&k()}),"aria-labelledby":D?N:void 0,"aria-describedby":A?V:void 0};return f===kl.hover&&(Fe.role="tooltip",Fe.onMouseEnter=bt(Oe.onMouseEnter,()=>{R.current=!0}),Fe.onMouseLeave=bt(Oe.onMouseLeave,Ye=>{Ye.nativeEvent.relatedTarget!==null&&(R.current=!1,setTimeout(()=>k(),m))})),Fe},[Y,K,D,N,A,V,f,n,k,C,t,m,d,u]),ue=p.useCallback((Oe={},at=null)=>re({...Oe,style:{visibility:C?"visible":"hidden",...Oe.style}},at),[C,re]),xe=p.useCallback((Oe,at=null)=>({...Oe,ref:Un(at,E,W)}),[E,W]),oe=p.useRef(),ge=p.useRef(),fe=p.useCallback(Oe=>{E.current==null&&W(Oe)},[W]),Pe=p.useCallback((Oe={},at=null)=>{const Fe={...Oe,ref:Un(O,at,fe),id:G,"aria-haspopup":"dialog","aria-expanded":C,"aria-controls":K};return f===kl.click&&(Fe.onClick=bt(Oe.onClick,j)),f===kl.hover&&(Fe.onFocus=bt(Oe.onFocus,()=>{oe.current===void 0&&P()}),Fe.onBlur=bt(Oe.onBlur,Ye=>{const jt=z2(Ye),xt=!Rg(I.current,jt);C&&t&&xt&&k()}),Fe.onKeyDown=bt(Oe.onKeyDown,Ye=>{Ye.key==="Escape"&&k()}),Fe.onMouseEnter=bt(Oe.onMouseEnter,()=>{R.current=!0,oe.current=window.setTimeout(()=>P(),h)}),Fe.onMouseLeave=bt(Oe.onMouseLeave,()=>{R.current=!1,oe.current&&(clearTimeout(oe.current),oe.current=void 0),ge.current=window.setTimeout(()=>{R.current===!1&&k()},m)})),Fe},[G,C,K,f,fe,j,P,t,k,h,m]);p.useEffect(()=>()=>{oe.current&&clearTimeout(oe.current),ge.current&&clearTimeout(ge.current)},[]);const Ae=p.useCallback((Oe={},at=null)=>({...Oe,id:N,ref:Un(at,Fe=>{$(!!Fe)})}),[N]),ye=p.useCallback((Oe={},at=null)=>({...Oe,id:V,ref:Un(at,Fe=>{J(!!Fe)})}),[V]);return{forceUpdate:le,isOpen:C,onAnimationComplete:se.onComplete,onClose:k,getAnchorProps:xe,getArrowProps:U,getArrowInnerProps:ve,getPopoverPositionerProps:ue,getPopoverProps:ae,getTriggerProps:Pe,getHeaderProps:Ae,getBodyProps:ye}}function Rg(e,t){return e===t||(e==null?void 0:e.contains(t))}function z2(e){var t;const n=e.currentTarget.ownerDocument.activeElement;return(t=e.relatedTarget)!=null?t:n}function w1(e){const t=Zr("Popover",e),{children:n,...r}=xr(e),o=ch(),s=oA({...r,direction:o.direction});return a.jsx(nA,{value:s,children:a.jsx(rA,{value:t,children:B0(n,{isOpen:s.isOpen,onClose:s.onClose,forceUpdate:s.forceUpdate})})})}w1.displayName="Popover";var Tg=(e,t)=>t?`${e}.${t}, ${t}`:void 0;function D6(e){var t;const{bg:n,bgColor:r,backgroundColor:o,shadow:s,boxShadow:i,shadowColor:u}=e,{getArrowProps:d,getArrowInnerProps:f}=Gu(),h=x1(),m=(t=n??r)!=null?t:o,v=s??i;return a.jsx(Ve.div,{...d(),className:"chakra-popover__arrow-positioner",children:a.jsx(Ve.div,{className:Ot("chakra-popover__arrow",e.className),...f(e),__css:{"--popper-arrow-shadow-color":Tg("colors",u),"--popper-arrow-bg":Tg("colors",m),"--popper-arrow-shadow":Tg("shadows",v),...h.arrow}})})}D6.displayName="PopoverArrow";var A6=rt(function(t,n){const{getBodyProps:r}=Gu(),o=x1();return a.jsx(Ve.div,{...r(t,n),className:Ot("chakra-popover__body",t.className),__css:o.body})});A6.displayName="PopoverBody";function sA(e){if(e)return{enter:{...e.enter,visibility:"visible"},exit:{...e.exit,transitionEnd:{visibility:"hidden"}}}}var aA={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]}}},iA=Ve(bo.section),N6=rt(function(t,n){const{variants:r=aA,...o}=t,{isOpen:s}=Gu();return a.jsx(iA,{ref:n,variants:sA(r),initial:!1,animate:s?"enter":"exit",...o})});N6.displayName="PopoverTransition";var C1=rt(function(t,n){const{rootProps:r,motionProps:o,...s}=t,{getPopoverProps:i,getPopoverPositionerProps:u,onAnimationComplete:d}=Gu(),f=x1(),h={position:"relative",display:"flex",flexDirection:"column",...f.content};return a.jsx(Ve.div,{...u(r),__css:f.popper,className:"chakra-popover__popper",children:a.jsx(N6,{...o,...i(s,n),onAnimationComplete:ih(d,s.onAnimationComplete),className:Ot("chakra-popover__content",t.className),__css:h})})});C1.displayName="PopoverContent";function lA(e,t,n){return(e-t)*100/(n-t)}Ea({"0%":{strokeDasharray:"1, 400",strokeDashoffset:"0"},"50%":{strokeDasharray:"400, 400",strokeDashoffset:"-100"},"100%":{strokeDasharray:"400, 400",strokeDashoffset:"-260"}});Ea({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}});var cA=Ea({"0%":{left:"-40%"},"100%":{left:"100%"}}),uA=Ea({from:{backgroundPosition:"1rem 0"},to:{backgroundPosition:"0 0"}});function dA(e){const{value:t=0,min:n,max:r,valueText:o,getValueText:s,isIndeterminate:i,role:u="progressbar"}=e,d=lA(t,n,r);return{bind:{"data-indeterminate":i?"":void 0,"aria-valuemax":r,"aria-valuemin":n,"aria-valuenow":i?void 0:t,"aria-valuetext":(()=>{if(t!=null)return typeof s=="function"?s(t,d):o})(),role:u},percent:d,value:t}}var[fA,pA]=ur({name:"ProgressStylesContext",errorMessage:`useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Progress />" `}),hA=rt((e,t)=>{const{min:n,max:r,value:o,isIndeterminate:s,role:i,...u}=e,d=dA({value:o,min:n,max:r,isIndeterminate:s,role:i}),h={height:"100%",...pA().filledTrack};return a.jsx(Ve.div,{ref:t,style:{width:`${d.percent}%`,...u.style},...d.bind,...u,__css:h})}),z6=rt((e,t)=>{var n;const{value:r,min:o=0,max:s=100,hasStripe:i,isAnimated:u,children:d,borderRadius:f,isIndeterminate:h,"aria-label":m,"aria-labelledby":v,"aria-valuetext":y,title:S,role:w,...C}=xr(e),k=Zr("Progress",e),P=f??((n=k.track)==null?void 0:n.borderRadius),j={animation:`${uA} 1s linear infinite`},I={...!h&&i&&u&&j,...h&&{position:"absolute",willChange:"left",minWidth:"50%",animation:`${cA} 1s ease infinite normal none running`}},R={overflow:"hidden",position:"relative",...k.track};return a.jsx(Ve.div,{ref:t,borderRadius:P,__css:R,...C,children:a.jsxs(fA,{value:k,children:[a.jsx(hA,{"aria-label":m,"aria-labelledby":v,"aria-valuetext":y,min:o,max:s,value:r,isIndeterminate:h,css:I,borderRadius:P,title:S,role:w}),d]})})});z6.displayName="Progress";function mA(e){return e&&Sx(e)&&Sx(e.target)}function gA(e={}){const{onChange:t,value:n,defaultValue:r,name:o,isDisabled:s,isFocusable:i,isNative:u,...d}=e,[f,h]=p.useState(r||""),m=typeof n<"u",v=m?n:f,y=p.useRef(null),S=p.useCallback(()=>{const O=y.current;if(!O)return;let I="input:not(:disabled):checked";const R=O.querySelector(I);if(R){R.focus();return}I="input:not(:disabled)";const T=O.querySelector(I);T==null||T.focus()},[]),C=`radio-${p.useId()}`,k=o||C,P=p.useCallback(O=>{const I=mA(O)?O.target.value:O;m||h(I),t==null||t(String(I))},[t,m]),j=p.useCallback((O={},I=null)=>({...O,ref:Un(I,y),role:"radiogroup"}),[]),E=p.useCallback((O={},I=null)=>({...O,ref:I,name:k,[u?"checked":"isChecked"]:v!=null?O.value===v:void 0,onChange(T){P(T)},"data-radiogroup":!0}),[u,k,P,v]);return{getRootProps:j,getRadioProps:E,name:k,ref:y,focus:S,setValue:h,value:v,onChange:P,isDisabled:s,isFocusable:i,htmlProps:d}}var[vA,$6]=ur({name:"RadioGroupContext",strict:!1}),Su=rt((e,t)=>{const{colorScheme:n,size:r,variant:o,children:s,className:i,isDisabled:u,isFocusable:d,...f}=e,{value:h,onChange:m,getRootProps:v,name:y,htmlProps:S}=gA(f),w=p.useMemo(()=>({name:y,size:r,onChange:m,colorScheme:n,value:h,variant:o,isDisabled:u,isFocusable:d}),[y,r,m,n,h,o,u,d]);return a.jsx(vA,{value:w,children:a.jsx(Ve.div,{...v(S,t),className:Ot("chakra-radio-group",i),children:s})})});Su.displayName="RadioGroup";var yA={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};function bA(e={}){const{defaultChecked:t,isChecked:n,isFocusable:r,isDisabled:o,isReadOnly:s,isRequired:i,onChange:u,isInvalid:d,name:f,value:h,id:m,"data-radiogroup":v,"aria-describedby":y,...S}=e,w=`radio-${p.useId()}`,C=L0(),P=!!$6()||!!v;let E=!!C&&!P?C.id:w;E=m??E;const O=o??(C==null?void 0:C.isDisabled),I=s??(C==null?void 0:C.isReadOnly),R=i??(C==null?void 0:C.isRequired),T=d??(C==null?void 0:C.isInvalid),[D,$]=p.useState(!1),[A,J]=p.useState(!1),[z,B]=p.useState(!1),[G,K]=p.useState(!1),[N,V]=p.useState(!!t),W=typeof n<"u",U=W?n:N;p.useEffect(()=>y5($),[]);const re=p.useCallback(fe=>{if(I||O){fe.preventDefault();return}W||V(fe.target.checked),u==null||u(fe)},[W,O,I,u]),ve=p.useCallback(fe=>{fe.key===" "&&K(!0)},[K]),le=p.useCallback(fe=>{fe.key===" "&&K(!1)},[K]),se=p.useCallback((fe={},Pe=null)=>({...fe,ref:Pe,"data-active":sn(G),"data-hover":sn(z),"data-disabled":sn(O),"data-invalid":sn(T),"data-checked":sn(U),"data-focus":sn(A),"data-focus-visible":sn(A&&D),"data-readonly":sn(I),"aria-hidden":!0,onMouseDown:bt(fe.onMouseDown,()=>K(!0)),onMouseUp:bt(fe.onMouseUp,()=>K(!1)),onMouseEnter:bt(fe.onMouseEnter,()=>B(!0)),onMouseLeave:bt(fe.onMouseLeave,()=>B(!1))}),[G,z,O,T,U,A,I,D]),{onFocus:Y,onBlur:ae}=C??{},ue=p.useCallback((fe={},Pe=null)=>{const Ae=O&&!r;return{...fe,id:E,ref:Pe,type:"radio",name:f,value:h,onChange:bt(fe.onChange,re),onBlur:bt(ae,fe.onBlur,()=>J(!1)),onFocus:bt(Y,fe.onFocus,()=>J(!0)),onKeyDown:bt(fe.onKeyDown,ve),onKeyUp:bt(fe.onKeyUp,le),checked:U,disabled:Ae,readOnly:I,required:R,"aria-invalid":zl(T),"aria-disabled":zl(Ae),"aria-required":zl(R),"data-readonly":sn(I),"aria-describedby":y,style:yA}},[O,r,E,f,h,re,ae,Y,ve,le,U,I,R,T,y]);return{state:{isInvalid:T,isFocused:A,isChecked:U,isActive:G,isHovered:z,isDisabled:O,isReadOnly:I,isRequired:R},getCheckboxProps:se,getRadioProps:se,getInputProps:ue,getLabelProps:(fe={},Pe=null)=>({...fe,ref:Pe,onMouseDown:bt(fe.onMouseDown,xA),"data-disabled":sn(O),"data-checked":sn(U),"data-invalid":sn(T)}),getRootProps:(fe,Pe=null)=>({...fe,ref:Pe,"data-disabled":sn(O),"data-checked":sn(U),"data-invalid":sn(T)}),htmlProps:S}}function xA(e){e.preventDefault(),e.stopPropagation()}function SA(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 so=rt((e,t)=>{var n;const r=$6(),{onChange:o,value:s}=e,i=Zr("Radio",{...r,...e}),u=xr(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}=u;let S=e.isChecked;(r==null?void 0:r.value)!=null&&s!=null&&(S=r.value===s);let w=o;r!=null&&r.onChange&&s!=null&&(w=ih(r.onChange,o));const C=(n=e==null?void 0:e.name)!=null?n:r==null?void 0:r.name,{getInputProps:k,getCheckboxProps:P,getLabelProps:j,getRootProps:E,htmlProps:O}=bA({...y,isChecked:S,isFocusable:m,isDisabled:h,onChange:w,name:C}),[I,R]=SA(O,a3),T=P(R),D=k(v,t),$=j(),A=Object.assign({},I,E()),J={display:"inline-flex",alignItems:"center",verticalAlign:"top",cursor:"pointer",position:"relative",...i.container},z={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,...i.control},B={userSelect:"none",marginStart:d,...i.label};return a.jsxs(Ve.label,{className:"chakra-radio",...A,__css:J,children:[a.jsx("input",{className:"chakra-radio__input",...D}),a.jsx(Ve.span,{className:"chakra-radio__control",...T,__css:z}),f&&a.jsx(Ve.span,{className:"chakra-radio__label",...$,__css:B,children:f})]})});so.displayName="Radio";var L6=rt(function(t,n){const{children:r,placeholder:o,className:s,...i}=t;return a.jsxs(Ve.select,{...i,ref:n,className:Ot("chakra-select",s),children:[o&&a.jsx("option",{value:"",children:o}),r]})});L6.displayName="SelectField";function wA(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 k1=rt((e,t)=>{var n;const r=Zr("Select",e),{rootProps:o,placeholder:s,icon:i,color:u,height:d,h:f,minH:h,minHeight:m,iconColor:v,iconSize:y,...S}=xr(e),[w,C]=wA(S,a3),k=H0(C),P={width:"100%",height:"fit-content",position:"relative",color:u},j={paddingEnd:"2rem",...r.field,_focus:{zIndex:"unset",...(n=r.field)==null?void 0:n._focus}};return a.jsxs(Ve.div,{className:"chakra-select__wrapper",__css:P,...w,...o,children:[a.jsx(L6,{ref:t,height:f??d,minH:h??m,placeholder:s,...k,__css:j,children:e.children}),a.jsx(F6,{"data-disabled":sn(k.disabled),...(v||u)&&{color:v||u},__css:r.icon,...y&&{fontSize:y},children:i})]})});k1.displayName="Select";var CA=e=>a.jsx("svg",{viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})}),kA=Ve("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),F6=e=>{const{children:t=a.jsx(CA,{}),...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 a.jsx(kA,{...n,className:"chakra-select__icon-wrapper",children:p.isValidElement(t)?r:null})};F6.displayName="SelectIcon";function PA(){const e=p.useRef(!0);return p.useEffect(()=>{e.current=!1},[]),e.current}function _A(e){const t=p.useRef();return p.useEffect(()=>{t.current=e},[e]),t.current}var jA=Ve("div",{baseStyle:{boxShadow:"none",backgroundClip:"padding-box",cursor:"default",color:"transparent",pointerEvents:"none",userSelect:"none","&::before, &::after, *":{visibility:"hidden"}}}),Wv=i3("skeleton-start-color"),Vv=i3("skeleton-end-color"),EA=Ea({from:{opacity:0},to:{opacity:1}}),IA=Ea({from:{borderColor:Wv.reference,background:Wv.reference},to:{borderColor:Vv.reference,background:Vv.reference}}),P1=rt((e,t)=>{const n={...e,fadeDuration:typeof e.fadeDuration=="number"?e.fadeDuration:.4,speed:typeof e.speed=="number"?e.speed:.8},r=pc("Skeleton",n),o=PA(),{startColor:s="",endColor:i="",isLoaded:u,fadeDuration:d,speed:f,className:h,fitContent:m,...v}=xr(n),[y,S]=tl("colors",[s,i]),w=_A(u),C=Ot("chakra-skeleton",h),k={...y&&{[Wv.variable]:y},...S&&{[Vv.variable]:S}};if(u){const P=o||w?"none":`${EA} ${d}s`;return a.jsx(Ve.div,{ref:t,className:C,__css:{animation:P},...v})}return a.jsx(jA,{ref:t,className:C,...v,__css:{width:m?"fit-content":void 0,...r,...k,_dark:{...r._dark,...k},animation:`${f}s linear infinite alternate ${IA}`}})});P1.displayName="Skeleton";function OA(e){const{min:t=0,max:n=100,onChange:r,value:o,defaultValue:s,isReversed:i,direction:u="ltr",orientation:d="horizontal",id:f,isDisabled:h,isReadOnly:m,onChangeStart:v,onChangeEnd:y,step:S=1,getAriaValueText:w,"aria-valuetext":C,"aria-label":k,"aria-labelledby":P,name:j,focusThumbOnChange:E=!0,minStepsBetweenThumbs:O=0,...I}=e,R=ni(v),T=ni(y),D=ni(w),$=CO({isReversed:i,direction:u,orientation:d}),[A,J]=Ou({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[z,B]=p.useState(!1),[G,K]=p.useState(!1),[N,V]=p.useState(-1),W=!(h||m),U=p.useRef(A),re=A.map(Re=>wx(Re,t,n)),ve=O*S,le=RA(re,t,n,ve),se=p.useRef({eventSource:null,value:[],valueBounds:[]});se.current.value=re,se.current.valueBounds=le;const Y=re.map(Re=>n-Re+t),ue=($?Y:re).map(Re=>Cx(Re,t,n)),xe=d==="vertical",oe=p.useRef(null),ge=p.useRef(null),fe=vO({getNodes(){const Re=ge.current,et=Re==null?void 0:Re.querySelectorAll("[role=slider]");return et?Array.from(et):[]}}),Pe=p.useId(),ye=kO(f??Pe),Oe=p.useCallback(Re=>{var et,it;if(!oe.current)return;se.current.eventSource="pointer";const ut=oe.current.getBoundingClientRect(),{clientX:Nt,clientY:yr}=(it=(et=Re.touches)==null?void 0:et[0])!=null?it:Re,un=xe?ut.bottom-yr:Nt-ut.left,xn=xe?ut.height:ut.width;let Cr=un/xn;return $&&(Cr=1-Cr),yO(Cr,t,n)},[xe,$,n,t]),at=(n-t)/10,Fe=S||(n-t)/100,Ye=p.useMemo(()=>({setValueAtIndex(Re,et){if(!W)return;const it=se.current.valueBounds[Re];et=parseFloat(bO(et,it.min,Fe)),et=wx(et,it.min,it.max);const ut=[...se.current.value];ut[Re]=et,J(ut)},setActiveIndex:V,stepUp(Re,et=Fe){const it=se.current.value[Re],ut=$?it-et:it+et;Ye.setValueAtIndex(Re,ut)},stepDown(Re,et=Fe){const it=se.current.value[Re],ut=$?it+et:it-et;Ye.setValueAtIndex(Re,ut)},reset(){J(U.current)}}),[Fe,$,J,W]),jt=p.useCallback(Re=>{const et=Re.key,ut={ArrowRight:()=>Ye.stepUp(N),ArrowUp:()=>Ye.stepUp(N),ArrowLeft:()=>Ye.stepDown(N),ArrowDown:()=>Ye.stepDown(N),PageUp:()=>Ye.stepUp(N,at),PageDown:()=>Ye.stepDown(N,at),Home:()=>{const{min:Nt}=le[N];Ye.setValueAtIndex(N,Nt)},End:()=>{const{max:Nt}=le[N];Ye.setValueAtIndex(N,Nt)}}[et];ut&&(Re.preventDefault(),Re.stopPropagation(),ut(Re),se.current.eventSource="keyboard")},[Ye,N,at,le]),{getThumbStyle:xt,rootStyle:Fn,trackStyle:X,innerTrackStyle:we}=p.useMemo(()=>xO({isReversed:$,orientation:d,thumbRects:fe,thumbPercents:ue}),[$,d,ue,fe]),te=p.useCallback(Re=>{var et;const it=Re??N;if(it!==-1&&E){const ut=ye.getThumb(it),Nt=(et=ge.current)==null?void 0:et.ownerDocument.getElementById(ut);Nt&&setTimeout(()=>Nt.focus())}},[E,N,ye]);el(()=>{se.current.eventSource==="keyboard"&&(T==null||T(se.current.value))},[re,T]);const he=Re=>{const et=Oe(Re)||0,it=se.current.value.map(xn=>Math.abs(xn-et)),ut=Math.min(...it);let Nt=it.indexOf(ut);const yr=it.filter(xn=>xn===ut);yr.length>1&&et>se.current.value[Nt]&&(Nt=Nt+yr.length-1),V(Nt),Ye.setValueAtIndex(Nt,et),te(Nt)},Ne=Re=>{if(N==-1)return;const et=Oe(Re)||0;V(N),Ye.setValueAtIndex(N,et),te(N)};SO(ge,{onPanSessionStart(Re){W&&(B(!0),he(Re),R==null||R(se.current.value))},onPanSessionEnd(){W&&(B(!1),T==null||T(se.current.value))},onPan(Re){W&&Ne(Re)}});const Xe=p.useCallback((Re={},et=null)=>({...Re,...I,id:ye.root,ref:Un(et,ge),tabIndex:-1,"aria-disabled":pg(h),"data-focused":vl(G),style:{...Re.style,...Fn}}),[I,h,G,Fn,ye]),yt=p.useCallback((Re={},et=null)=>({...Re,ref:Un(et,oe),id:ye.track,"data-disabled":vl(h),style:{...Re.style,...X}}),[h,X,ye]),Xt=p.useCallback((Re={},et=null)=>({...Re,ref:et,id:ye.innerTrack,style:{...Re.style,...we}}),[we,ye]),ln=p.useCallback((Re,et=null)=>{var it;const{index:ut,...Nt}=Re,yr=re[ut];if(yr==null)throw new TypeError(`[range-slider > thumb] Cannot find value at index \`${ut}\`. The \`value\` or \`defaultValue\` length is : ${re.length}`);const un=le[ut];return{...Nt,ref:et,role:"slider",tabIndex:W?0:void 0,id:ye.getThumb(ut),"data-active":vl(z&&N===ut),"aria-valuetext":(it=D==null?void 0:D(yr))!=null?it:C==null?void 0:C[ut],"aria-valuemin":un.min,"aria-valuemax":un.max,"aria-valuenow":yr,"aria-orientation":d,"aria-disabled":pg(h),"aria-readonly":pg(m),"aria-label":k==null?void 0:k[ut],"aria-labelledby":k!=null&&k[ut]||P==null?void 0:P[ut],style:{...Re.style,...xt(ut)},onKeyDown:hg(Re.onKeyDown,jt),onFocus:hg(Re.onFocus,()=>{K(!0),V(ut)}),onBlur:hg(Re.onBlur,()=>{K(!1),V(-1)})}},[ye,re,le,W,z,N,D,C,d,h,m,k,P,xt,jt,K]),kn=p.useCallback((Re={},et=null)=>({...Re,ref:et,id:ye.output,htmlFor:re.map((it,ut)=>ye.getThumb(ut)).join(" "),"aria-live":"off"}),[ye,re]),vr=p.useCallback((Re,et=null)=>{const{value:it,...ut}=Re,Nt=!(it<t||it>n),yr=it>=re[0]&&it<=re[re.length-1];let un=Cx(it,t,n);un=$?100-un:un;const xn={position:"absolute",pointerEvents:"none",...wO({orientation:d,vertical:{bottom:`${un}%`},horizontal:{left:`${un}%`}})};return{...ut,ref:et,id:ye.getMarker(Re.value),role:"presentation","aria-hidden":!0,"data-disabled":vl(h),"data-invalid":vl(!Nt),"data-highlighted":vl(yr),style:{...Re.style,...xn}}},[h,$,n,t,d,re,ye]),cn=p.useCallback((Re,et=null)=>{const{index:it,...ut}=Re;return{...ut,ref:et,id:ye.getInput(it),type:"hidden",value:re[it],name:Array.isArray(j)?j[it]:`${j}-${it}`}},[j,re,ye]);return{state:{value:re,isFocused:G,isDragging:z,getThumbPercent:Re=>ue[Re],getThumbMinValue:Re=>le[Re].min,getThumbMaxValue:Re=>le[Re].max},actions:Ye,getRootProps:Xe,getTrackProps:yt,getInnerTrackProps:Xt,getThumbProps:ln,getMarkerProps:vr,getInputProps:cn,getOutputProps:kn}}function RA(e,t,n,r){return e.map((o,s)=>{const i=s===0?t:e[s-1]+r,u=s===e.length-1?n:e[s+1]-r;return{min:i,max:u}})}var[TA,Ch]=ur({name:"SliderContext",errorMessage:"useSliderContext: `context` is undefined. Seems you forgot to wrap all slider components within <RangeSlider />"}),[MA,kh]=ur({name:"RangeSliderStylesContext",errorMessage:`useRangeSliderStyles returned is 'undefined'. Seems you forgot to wrap the components in "<RangeSlider />" `}),B6=rt(function(t,n){const r={orientation:"horizontal",...t},o=Zr("Slider",r),s=xr(r),{direction:i}=ch();s.direction=i;const{getRootProps:u,...d}=OA(s),f=p.useMemo(()=>({...d,name:r.name}),[d,r.name]);return a.jsx(TA,{value:f,children:a.jsx(MA,{value:o,children:a.jsx(Ve.div,{...u({},n),className:"chakra-slider",__css:o.container,children:r.children})})})});B6.displayName="RangeSlider";var Uv=rt(function(t,n){const{getThumbProps:r,getInputProps:o,name:s}=Ch(),i=kh(),u=r(t,n);return a.jsxs(Ve.div,{...u,className:W0("chakra-slider__thumb",t.className),__css:i.thumb,children:[u.children,s&&a.jsx("input",{...o({index:t.index})})]})});Uv.displayName="RangeSliderThumb";var H6=rt(function(t,n){const{getTrackProps:r}=Ch(),o=kh(),s=r(t,n);return a.jsx(Ve.div,{...s,className:W0("chakra-slider__track",t.className),__css:o.track,"data-testid":"chakra-range-slider-track"})});H6.displayName="RangeSliderTrack";var W6=rt(function(t,n){const{getInnerTrackProps:r}=Ch(),o=kh(),s=r(t,n);return a.jsx(Ve.div,{...s,className:"chakra-slider__filled-track",__css:o.filledTrack})});W6.displayName="RangeSliderFilledTrack";var Df=rt(function(t,n){const{getMarkerProps:r}=Ch(),o=kh(),s=r(t,n);return a.jsx(Ve.div,{...s,className:W0("chakra-slider__marker",t.className),__css:o.mark})});Df.displayName="RangeSliderMark";var _1=rt(function(t,n){const r=Zr("Switch",t),{spacing:o="0.5rem",children:s,...i}=xr(t),{state:u,getInputProps:d,getCheckboxProps:f,getRootProps:h,getLabelProps:m}=b5(i),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 a.jsxs(Ve.label,{...h(),className:Ot("chakra-switch",t.className),__css:v,children:[a.jsx("input",{className:"chakra-switch__input",...d({},n)}),a.jsx(Ve.span,{...f(),className:"chakra-switch__track",__css:y,children:a.jsx(Ve.span,{__css:r.thumb,className:"chakra-switch__thumb","data-checked":sn(u.isChecked),"data-hover":sn(u.isHovered)})}),s&&a.jsx(Ve.span,{className:"chakra-switch__label",...m(),__css:S,children:s})]})});_1.displayName="Switch";var[DA,AA,NA,zA]=t1();function $A(e){var t;const{defaultIndex:n,onChange:r,index:o,isManual:s,isLazy:i,lazyBehavior:u="unmount",orientation:d="horizontal",direction:f="ltr",...h}=e,[m,v]=p.useState(n??0),[y,S]=Ou({defaultValue:n??0,value:o,onChange:r});p.useEffect(()=>{o!=null&&v(o)},[o]);const w=NA(),C=p.useId();return{id:`tabs-${(t=e.id)!=null?t:C}`,selectedIndex:y,focusedIndex:m,setSelectedIndex:S,setFocusedIndex:v,isManual:s,isLazy:i,lazyBehavior:u,orientation:d,descendants:w,direction:f,htmlProps:h}}var[LA,Ph]=ur({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within <Tabs />"});function FA(e){const{focusedIndex:t,orientation:n,direction:r}=Ph(),o=AA(),s=p.useCallback(i=>{const u=()=>{var P;const j=o.nextEnabled(t);j&&((P=j.node)==null||P.focus())},d=()=>{var P;const j=o.prevEnabled(t);j&&((P=j.node)==null||P.focus())},f=()=>{var P;const j=o.firstEnabled();j&&((P=j.node)==null||P.focus())},h=()=>{var P;const j=o.lastEnabled();j&&((P=j.node)==null||P.focus())},m=n==="horizontal",v=n==="vertical",y=i.key,S=r==="ltr"?"ArrowLeft":"ArrowRight",w=r==="ltr"?"ArrowRight":"ArrowLeft",k={[S]:()=>m&&d(),[w]:()=>m&&u(),ArrowDown:()=>v&&u(),ArrowUp:()=>v&&d(),Home:f,End:h}[y];k&&(i.preventDefault(),k(i))},[o,t,n,r]);return{...e,role:"tablist","aria-orientation":n,onKeyDown:bt(e.onKeyDown,s)}}function BA(e){const{isDisabled:t,isFocusable:n,...r}=e,{setSelectedIndex:o,isManual:s,id:i,setFocusedIndex:u,selectedIndex:d}=Ph(),{index:f,register:h}=zA({disabled:t&&!n}),m=f===d,v=()=>{o(f)},y=()=>{u(f),!s&&!(t&&n)&&o(f)},S=g6({...r,ref:Un(h,e.ref),isDisabled:t,isFocusable:n,onClick:bt(e.onClick,v)}),w="button";return{...S,id:V6(i,f),role:"tab",tabIndex:m?0:-1,type:w,"aria-selected":m,"aria-controls":U6(i,f),onFocus:t?void 0:bt(e.onFocus,y)}}var[HA,WA]=ur({});function VA(e){const t=Ph(),{id:n,selectedIndex:r}=t,s=lh(e.children).map((i,u)=>p.createElement(HA,{key:u,value:{isSelected:u===r,id:U6(n,u),tabId:V6(n,u),selectedIndex:r}},i));return{...e,children:s}}function UA(e){const{children:t,...n}=e,{isLazy:r,lazyBehavior:o}=Ph(),{isSelected:s,id:i,tabId:u}=WA(),d=p.useRef(!1);s&&(d.current=!0);const f=g1({wasSelected:d.current,isSelected:s,enabled:r,mode:o});return{tabIndex:0,...n,children:f?t:null,role:"tabpanel","aria-labelledby":u,hidden:!s,id:i}}function V6(e,t){return`${e}--tab-${t}`}function U6(e,t){return`${e}--tabpanel-${t}`}var[GA,_h]=ur({name:"TabsStylesContext",errorMessage:`useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Tabs />" `}),jh=rt(function(t,n){const r=Zr("Tabs",t),{children:o,className:s,...i}=xr(t),{htmlProps:u,descendants:d,...f}=$A(i),h=p.useMemo(()=>f,[f]),{isFitted:m,...v}=u;return a.jsx(DA,{value:d,children:a.jsx(LA,{value:h,children:a.jsx(GA,{value:r,children:a.jsx(Ve.div,{className:Ot("chakra-tabs",s),ref:n,...v,__css:r.root,children:o})})})})});jh.displayName="Tabs";var Eh=rt(function(t,n){const r=FA({...t,ref:n}),s={display:"flex",..._h().tablist};return a.jsx(Ve.div,{...r,className:Ot("chakra-tabs__tablist",t.className),__css:s})});Eh.displayName="TabList";var Ih=rt(function(t,n){const r=UA({...t,ref:n}),o=_h();return a.jsx(Ve.div,{outline:"0",...r,className:Ot("chakra-tabs__tab-panel",t.className),__css:o.tabpanel})});Ih.displayName="TabPanel";var Oh=rt(function(t,n){const r=VA(t),o=_h();return a.jsx(Ve.div,{...r,width:"100%",ref:n,className:Ot("chakra-tabs__tab-panels",t.className),__css:o.tabpanels})});Oh.displayName="TabPanels";var Rh=rt(function(t,n){const r=_h(),o=BA({...t,ref:n}),s={outline:"0",display:"flex",alignItems:"center",justifyContent:"center",...r.tab};return a.jsx(Ve.button,{...o,className:Ot("chakra-tabs__tab",t.className),__css:s})});Rh.displayName="Tab";function qA(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var KA=["h","minH","height","minHeight"],G6=rt((e,t)=>{const n=pc("Textarea",e),{className:r,rows:o,...s}=xr(e),i=H0(s),u=o?qA(n,KA):n;return a.jsx(Ve.textarea,{ref:t,rows:o,...i,className:Ot("chakra-textarea",r),__css:u})});G6.displayName="Textarea";const q6=({id:e,x:t,y:n,width:r,height:o,style:s,color:i,strokeColor:u,strokeWidth:d,className:f,borderRadius:h,shapeRendering:m,onClick:v})=>{const{background:y,backgroundColor:S}=s||{},w=i||y||S;return a.jsx("rect",{className:uh(["react-flow__minimap-node",f]),x:t,y:n,rx:h,ry:h,width:r,height:o,fill:w,stroke:u,strokeWidth:d,shapeRendering:m,onClick:v?C=>v(C,e):void 0})};q6.displayName="MiniMapNode";var YA=p.memo(q6);const XA=e=>e.nodeOrigin,QA=e=>e.getNodes().filter(t=>!t.hidden&&t.width&&t.height),Mg=e=>e instanceof Function?e:()=>e;function ZA({nodeStrokeColor:e="transparent",nodeColor:t="#e2e2e2",nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:o=2,nodeComponent:s=YA,onClick:i}){const u=Lf(QA,V0),d=Lf(XA),f=Mg(t),h=Mg(e),m=Mg(n),v=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return a.jsx(a.Fragment,{children:u.map(y=>{const{x:S,y:w}=PO(y,d).positionAbsolute;return a.jsx(s,{x:S,y:w,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:i,id:y.id},y.id)})})}var JA=p.memo(ZA);const eN=200,tN=150,nN=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?IO(OO(t,e.nodeOrigin),n):n,rfId:e.rfId}},rN="react-flow__minimap-desc";function K6({style:e,className:t,nodeStrokeColor:n="transparent",nodeColor:r="#e2e2e2",nodeClassName:o="",nodeBorderRadius:s=5,nodeStrokeWidth:i=2,nodeComponent:u,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:w=!1,ariaLabel:C="React Flow mini map",inversePan:k=!1,zoomStep:P=10}){const j=l3(),E=p.useRef(null),{boundingRect:O,viewBB:I,rfId:R}=Lf(nN,V0),T=(e==null?void 0:e.width)??eN,D=(e==null?void 0:e.height)??tN,$=O.width/T,A=O.height/D,J=Math.max($,A),z=J*T,B=J*D,G=5*J,K=O.x-(z-O.width)/2-G,N=O.y-(B-O.height)/2-G,V=z+G*2,W=B+G*2,U=`${rN}-${R}`,re=p.useRef(0);re.current=J,p.useEffect(()=>{if(E.current){const se=c3(E.current),Y=xe=>{const{transform:oe,d3Selection:ge,d3Zoom:fe}=j.getState();if(xe.sourceEvent.type!=="wheel"||!ge||!fe)return;const Pe=-xe.sourceEvent.deltaY*(xe.sourceEvent.deltaMode===1?.05:xe.sourceEvent.deltaMode?1:.002)*P,Ae=oe[2]*Math.pow(2,Pe);fe.scaleTo(ge,Ae)},ae=xe=>{const{transform:oe,d3Selection:ge,d3Zoom:fe,translateExtent:Pe,width:Ae,height:ye}=j.getState();if(xe.sourceEvent.type!=="mousemove"||!ge||!fe)return;const Oe=re.current*Math.max(1,oe[2])*(k?-1:1),at={x:oe[0]-xe.sourceEvent.movementX*Oe,y:oe[1]-xe.sourceEvent.movementY*Oe},Fe=[[0,0],[Ae,ye]],Ye=jO.translate(at.x,at.y).scale(oe[2]),jt=fe.constrain()(Ye,Fe,Pe);fe.transform(ge,jt)},ue=_O().on("zoom",S?ae:null).on("zoom.wheel",w?Y:null);return se.call(ue),()=>{se.on("zoom",null)}}},[S,w,k,P]);const ve=v?se=>{const Y=EO(se);v(se,{x:Y[0],y:Y[1]})}:void 0,le=y?(se,Y)=>{const ae=j.getState().nodeInternals.get(Y);y(se,ae)}:void 0;return a.jsx(Tu,{position:m,style:e,className:uh(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:a.jsxs("svg",{width:T,height:D,viewBox:`${K} ${N} ${V} ${W}`,role:"img","aria-labelledby":U,ref:E,onClick:ve,children:[C&&a.jsx("title",{id:U,children:C}),a.jsx(JA,{onClick:le,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:o,nodeStrokeWidth:i,nodeComponent:u}),a.jsx("path",{className:"react-flow__minimap-mask",d:`M${K-G},${N-G}h${V+G*2}v${W+G*2}h${-V-G*2}z
|
||
M${I.x},${I.y}h${I.width}v${I.height}h${-I.width}z`,fill:d,fillRule:"evenodd",stroke:f,strokeWidth:h,pointerEvents:"none"})]})})}K6.displayName="MiniMap";var oN=p.memo(K6),xs;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(xs||(xs={}));function sN({color:e,dimensions:t,lineWidth:n}){return a.jsx("path",{stroke:e,strokeWidth:n,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function aN({color:e,radius:t}){return a.jsx("circle",{cx:t,cy:t,r:t,fill:e})}const iN={[xs.Dots]:"#91919a",[xs.Lines]:"#eee",[xs.Cross]:"#e2e2e2"},lN={[xs.Dots]:1,[xs.Lines]:1,[xs.Cross]:6},cN=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Y6({id:e,variant:t=xs.Dots,gap:n=20,size:r,lineWidth:o=1,offset:s=2,color:i,style:u,className:d}){const f=p.useRef(null),{transform:h,patternId:m}=Lf(cN,V0),v=i||iN[t],y=r||lN[t],S=t===xs.Dots,w=t===xs.Cross,C=Array.isArray(n)?n:[n,n],k=[C[0]*h[2]||1,C[1]*h[2]||1],P=y*h[2],j=w?[P,P]:k,E=S?[P/s,P/s]:[j[0]/s,j[1]/s];return a.jsxs("svg",{className:uh(["react-flow__background",d]),style:{...u,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:f,"data-testid":"rf__background",children:[a.jsx("pattern",{id:m+e,x:h[0]%k[0],y:h[1]%k[1],width:k[0],height:k[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${E[0]},-${E[1]})`,children:S?a.jsx(aN,{color:v,radius:P/s}):a.jsx(sN,{dimensions:j,color:v,lineWidth:o})}),a.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${m+e})`})]})}Y6.displayName="Background";var uN=p.memo(Y6),iu;(function(e){e.Line="line",e.Handle="handle"})(iu||(iu={}));function dN({width:e,prevWidth:t,height:n,prevHeight:r,invertX:o,invertY:s}){const i=e-t,u=n-r,d=[i>0?1:i<0?-1:0,u>0?1:u<0?-1:0];return i&&o&&(d[0]=d[0]*-1),u&&s&&(d[1]=d[1]*-1),d}const X6={width:0,height:0,x:0,y:0},fN={...X6,pointerX:0,pointerY:0,aspectRatio:1};function pN({nodeId:e,position:t,variant:n=iu.Handle,className:r,style:o={},children:s,color:i,minWidth:u=10,minHeight:d=10,maxWidth:f=Number.MAX_VALUE,maxHeight:h=Number.MAX_VALUE,keepAspectRatio:m=!1,shouldResize:v,onResizeStart:y,onResize:S,onResizeEnd:w}){const C=RO(),k=typeof e=="string"?e:C,P=l3(),j=p.useRef(null),E=p.useRef(fN),O=p.useRef(X6),I=TO(),R=n===iu.Line?"right":"bottom-right",T=t??R;p.useEffect(()=>{if(!j.current||!k)return;const J=c3(j.current),z=T.includes("right")||T.includes("left"),B=T.includes("bottom")||T.includes("top"),G=T.includes("left"),K=T.includes("top"),N=MO().on("start",V=>{const W=P.getState().nodeInternals.get(k),{xSnapped:U,ySnapped:re}=I(V);O.current={width:(W==null?void 0:W.width)??0,height:(W==null?void 0:W.height)??0,x:(W==null?void 0:W.position.x)??0,y:(W==null?void 0:W.position.y)??0},E.current={...O.current,pointerX:U,pointerY:re,aspectRatio:O.current.width/O.current.height},y==null||y(V,{...O.current})}).on("drag",V=>{const{nodeInternals:W,triggerNodeChanges:U}=P.getState(),{xSnapped:re,ySnapped:ve}=I(V),le=W.get(k);if(le){const se=[],{pointerX:Y,pointerY:ae,width:ue,height:xe,x:oe,y:ge,aspectRatio:fe}=E.current,{x:Pe,y:Ae,width:ye,height:Oe}=O.current,at=Math.floor(z?re-Y:0),Fe=Math.floor(B?ve-ae:0);let Ye=kx(ue+(G?-at:at),u,f),jt=kx(xe+(K?-Fe:Fe),d,h);if(m){const he=Ye/jt,Ne=z&&B,Xe=z&&!B,yt=B&&!z;Ye=he<=fe&&Ne||yt?jt*fe:Ye,jt=he>fe&&Ne||Xe?Ye/fe:jt,Ye>=f?(Ye=f,jt=f/fe):Ye<=u&&(Ye=u,jt=u/fe),jt>=h?(jt=h,Ye=h*fe):jt<=d&&(jt=d,Ye=d*fe)}const xt=Ye!==ye,Fn=jt!==Oe;if(G||K){const he=G?oe-(Ye-ue):oe,Ne=K?ge-(jt-xe):ge,Xe=he!==Pe&&xt,yt=Ne!==Ae&&Fn;if(Xe||yt){const Xt={id:le.id,type:"position",position:{x:Xe?he:Pe,y:yt?Ne:Ae}};se.push(Xt),O.current.x=Xt.position.x,O.current.y=Xt.position.y}}if(xt||Fn){const he={id:k,type:"dimensions",updateStyle:!0,resizing:!0,dimensions:{width:Ye,height:jt}};se.push(he),O.current.width=Ye,O.current.height=jt}if(se.length===0)return;const X=dN({width:O.current.width,prevWidth:ye,height:O.current.height,prevHeight:Oe,invertX:G,invertY:K}),we={...O.current,direction:X};if((v==null?void 0:v(V,we))===!1)return;S==null||S(V,we),U(se)}}).on("end",V=>{const W={id:k,type:"dimensions",resizing:!1};w==null||w(V,{...O.current}),P.getState().triggerNodeChanges([W])});return J.call(N),()=>{J.on(".drag",null)}},[k,T,u,d,f,h,m,I,y,S,w]);const D=T.split("-"),$=n===iu.Line?"borderColor":"backgroundColor",A=i?{...o,[$]:i}:o;return a.jsx("div",{className:uh(["react-flow__resize-control","nodrag",...D,n,r]),ref:j,style:A,children:s})}var hN=p.memo(pN);let $2=()=>{};const Th=()=>({setOpenUploaderFunction:p.useCallback(t=>{t&&($2=t)},[]),openUploader:$2});var mN=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 qu(e,t){var n=gN(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 gN(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),o=mN.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var vN=[".DS_Store","Thumbs.db"];function yN(e){return gc(this,void 0,void 0,function(){return vc(this,function(t){return np(e)&&bN(e.dataTransfer)?[2,CN(e.dataTransfer,e.type)]:xN(e)?[2,SN(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,wN(e)]:[2,[]]})})}function bN(e){return np(e)}function xN(e){return np(e)&&np(e.target)}function np(e){return typeof e=="object"&&e!==null}function SN(e){return Gv(e.target.files).map(function(t){return qu(t)})}function wN(e){return gc(this,void 0,void 0,function(){var t;return vc(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 qu(r)})]}})})}function CN(e,t){return gc(this,void 0,void 0,function(){var n,r;return vc(this,function(o){switch(o.label){case 0:return e.items?(n=Gv(e.items).filter(function(s){return s.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(kN))]):[3,2];case 1:return r=o.sent(),[2,L2(Q6(r))];case 2:return[2,L2(Gv(e.files).map(function(s){return qu(s)}))]}})})}function L2(e){return e.filter(function(t){return vN.indexOf(t.name)===-1})}function Gv(e){if(e===null)return[];for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r)}return t}function kN(e){if(typeof e.webkitGetAsEntry!="function")return F2(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?Z6(t):F2(e)}function Q6(e){return e.reduce(function(t,n){return Av(Av([],C2(t),!1),C2(Array.isArray(n)?Q6(n):[n]),!1)},[])}function F2(e){var t=e.getAsFile();if(!t)return Promise.reject("".concat(e," is not a File"));var n=qu(t);return Promise.resolve(n)}function PN(e){return gc(this,void 0,void 0,function(){return vc(this,function(t){return[2,e.isDirectory?Z6(e):_N(e)]})})}function Z6(e){var t=e.createReader();return new Promise(function(n,r){var o=[];function s(){var i=this;t.readEntries(function(u){return gc(i,void 0,void 0,function(){var d,f,h;return vc(this,function(m){switch(m.label){case 0:if(u.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(u.map(PN)),o.push(h),s(),m.label=6;case 6:return[2]}})})},function(u){r(u)})}s()})}function _N(e){return gc(this,void 0,void 0,function(){return vc(this,function(t){return[2,new Promise(function(n,r){e.file(function(o){var s=qu(o,e.fullPath);n(s)},function(o){r(o)})})]})})}var jN=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(","),r=e.name||"",o=(e.type||"").toLowerCase(),s=o.replace(/\/.*$/,"");return n.some(function(i){var u=i.trim().toLowerCase();return u.charAt(0)==="."?r.toLowerCase().endsWith(u):u.endsWith("/*")?s===u.replace(/\/.*$/,""):o===u})}return!0};function B2(e){return ON(e)||IN(e)||ek(e)||EN()}function EN(){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 IN(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ON(e){if(Array.isArray(e))return qv(e)}function H2(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 W2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?H2(Object(n),!0).forEach(function(r){J6(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):H2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function J6(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wu(e,t){return MN(e)||TN(e,t)||ek(e,t)||RN()}function RN(){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 ek(e,t){if(e){if(typeof e=="string")return qv(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 qv(e,t)}}function qv(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 TN(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,s=!1,i,u;try{for(n=n.call(e);!(o=(i=n.next()).done)&&(r.push(i.value),!(t&&r.length===t));o=!0);}catch(d){s=!0,u=d}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw u}}return r}}function MN(e){if(Array.isArray(e))return e}var DN="file-invalid-type",AN="file-too-large",NN="file-too-small",zN="too-many-files",$N=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:DN,message:"File type must be ".concat(n)}},V2=function(t){return{code:AN,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},U2=function(t){return{code:NN,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},LN={code:zN,message:"Too many files"};function tk(e,t){var n=e.type==="application/x-moz-file"||jN(e,t);return[n,n?null:$N(t)]}function nk(e,t,n){if(Oi(e.size))if(Oi(t)&&Oi(n)){if(e.size>n)return[!1,V2(n)];if(e.size<t)return[!1,U2(t)]}else{if(Oi(t)&&e.size<t)return[!1,U2(t)];if(Oi(n)&&e.size>n)return[!1,V2(n)]}return[!0,null]}function Oi(e){return e!=null}function FN(e){var t=e.files,n=e.accept,r=e.minSize,o=e.maxSize,s=e.multiple,i=e.maxFiles,u=e.validator;return!s&&t.length>1||s&&i>=1&&t.length>i?!1:t.every(function(d){var f=tk(d,n),h=wu(f,1),m=h[0],v=nk(d,r,o),y=wu(v,1),S=y[0],w=u?u(d):null;return m&&S&&!w})}function rp(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function qd(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 G2(e){e.preventDefault()}function BN(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function HN(e){return e.indexOf("Edge/")!==-1}function WN(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return BN(e)||HN(e)}function Bs(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var o=arguments.length,s=new Array(o>1?o-1:0),i=1;i<o;i++)s[i-1]=arguments[i];return t.some(function(u){return!rp(r)&&u&&u.apply(void 0,[r].concat(s)),rp(r)})}}function VN(){return"showOpenFilePicker"in window}function UN(e){if(Oi(e)){var t=Object.entries(e).filter(function(n){var r=wu(n,2),o=r[0],s=r[1],i=!0;return rk(o)||(console.warn('Skipped "'.concat(o,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),i=!1),(!Array.isArray(s)||!s.every(ok))&&(console.warn('Skipped "'.concat(o,'" because an invalid file extension was provided.')),i=!1),i}).reduce(function(n,r){var o=wu(r,2),s=o[0],i=o[1];return W2(W2({},n),{},J6({},s,i))},{});return[{description:"Files",accept:t}]}return e}function GN(e){if(Oi(e))return Object.entries(e).reduce(function(t,n){var r=wu(n,2),o=r[0],s=r[1];return[].concat(B2(t),[o],B2(s))},[]).filter(function(t){return rk(t)||ok(t)}).join(",")}function qN(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function KN(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function rk(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function ok(e){return/^.*\.[\w]+$/.test(e)}var YN=["children"],XN=["open"],QN=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],ZN=["refKey","onChange","onClick"];function JN(e){return nz(e)||tz(e)||sk(e)||ez()}function ez(){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 tz(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function nz(e){if(Array.isArray(e))return Kv(e)}function Dg(e,t){return sz(e)||oz(e,t)||sk(e,t)||rz()}function rz(){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 sk(e,t){if(e){if(typeof e=="string")return Kv(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 Kv(e,t)}}function Kv(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 oz(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,s=!1,i,u;try{for(n=n.call(e);!(o=(i=n.next()).done)&&(r.push(i.value),!(t&&r.length===t));o=!0);}catch(d){s=!0,u=d}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw u}}return r}}function sz(e){if(Array.isArray(e))return e}function q2(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 ir(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?q2(Object(n),!0).forEach(function(r){Yv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Yv(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function op(e,t){if(e==null)return{};var n=az(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 az(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 j1=p.forwardRef(function(e,t){var n=e.children,r=op(e,YN),o=E1(r),s=o.open,i=op(o,XN);return p.useImperativeHandle(t,function(){return{open:s}},[s]),L.createElement(p.Fragment,null,n(ir(ir({},i),{},{open:s})))});j1.displayName="Dropzone";var ak={disabled:!1,getFilesFromEvent:yN,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};j1.defaultProps=ak;j1.propTypes={children:An.func,accept:An.objectOf(An.arrayOf(An.string)),multiple:An.bool,preventDropOnDocument:An.bool,noClick:An.bool,noKeyboard:An.bool,noDrag:An.bool,noDragEventsBubbling:An.bool,minSize:An.number,maxSize:An.number,maxFiles:An.number,disabled:An.bool,getFilesFromEvent:An.func,onFileDialogCancel:An.func,onFileDialogOpen:An.func,useFsAccessApi:An.bool,autoFocus:An.bool,onDragEnter:An.func,onDragLeave:An.func,onDragOver:An.func,onDrop:An.func,onDropAccepted:An.func,onDropRejected:An.func,onError:An.func,validator:An.func};var Xv={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function E1(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=ir(ir({},ak),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,s=t.maxSize,i=t.minSize,u=t.multiple,d=t.maxFiles,f=t.onDragEnter,h=t.onDragLeave,m=t.onDragOver,v=t.onDrop,y=t.onDropAccepted,S=t.onDropRejected,w=t.onFileDialogCancel,C=t.onFileDialogOpen,k=t.useFsAccessApi,P=t.autoFocus,j=t.preventDropOnDocument,E=t.noClick,O=t.noKeyboard,I=t.noDrag,R=t.noDragEventsBubbling,T=t.onError,D=t.validator,$=p.useMemo(function(){return GN(n)},[n]),A=p.useMemo(function(){return UN(n)},[n]),J=p.useMemo(function(){return typeof C=="function"?C:K2},[C]),z=p.useMemo(function(){return typeof w=="function"?w:K2},[w]),B=p.useRef(null),G=p.useRef(null),K=p.useReducer(iz,Xv),N=Dg(K,2),V=N[0],W=N[1],U=V.isFocused,re=V.isFileDialogActive,ve=p.useRef(typeof window<"u"&&window.isSecureContext&&k&&VN()),le=function(){!ve.current&&re&&setTimeout(function(){if(G.current){var he=G.current.files;he.length||(W({type:"closeDialog"}),z())}},300)};p.useEffect(function(){return window.addEventListener("focus",le,!1),function(){window.removeEventListener("focus",le,!1)}},[G,re,z,ve]);var se=p.useRef([]),Y=function(he){B.current&&B.current.contains(he.target)||(he.preventDefault(),se.current=[])};p.useEffect(function(){return j&&(document.addEventListener("dragover",G2,!1),document.addEventListener("drop",Y,!1)),function(){j&&(document.removeEventListener("dragover",G2),document.removeEventListener("drop",Y))}},[B,j]),p.useEffect(function(){return!r&&P&&B.current&&B.current.focus(),function(){}},[B,P,r]);var ae=p.useCallback(function(te){T?T(te):console.error(te)},[T]),ue=p.useCallback(function(te){te.preventDefault(),te.persist(),xt(te),se.current=[].concat(JN(se.current),[te.target]),qd(te)&&Promise.resolve(o(te)).then(function(he){if(!(rp(te)&&!R)){var Ne=he.length,Xe=Ne>0&&FN({files:he,accept:$,minSize:i,maxSize:s,multiple:u,maxFiles:d,validator:D}),yt=Ne>0&&!Xe;W({isDragAccept:Xe,isDragReject:yt,isDragActive:!0,type:"setDraggedFiles"}),f&&f(te)}}).catch(function(he){return ae(he)})},[o,f,ae,R,$,i,s,u,d,D]),xe=p.useCallback(function(te){te.preventDefault(),te.persist(),xt(te);var he=qd(te);if(he&&te.dataTransfer)try{te.dataTransfer.dropEffect="copy"}catch{}return he&&m&&m(te),!1},[m,R]),oe=p.useCallback(function(te){te.preventDefault(),te.persist(),xt(te);var he=se.current.filter(function(Xe){return B.current&&B.current.contains(Xe)}),Ne=he.indexOf(te.target);Ne!==-1&&he.splice(Ne,1),se.current=he,!(he.length>0)&&(W({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),qd(te)&&h&&h(te))},[B,h,R]),ge=p.useCallback(function(te,he){var Ne=[],Xe=[];te.forEach(function(yt){var Xt=tk(yt,$),ln=Dg(Xt,2),kn=ln[0],vr=ln[1],cn=nk(yt,i,s),Yn=Dg(cn,2),Re=Yn[0],et=Yn[1],it=D?D(yt):null;if(kn&&Re&&!it)Ne.push(yt);else{var ut=[vr,et];it&&(ut=ut.concat(it)),Xe.push({file:yt,errors:ut.filter(function(Nt){return Nt})})}}),(!u&&Ne.length>1||u&&d>=1&&Ne.length>d)&&(Ne.forEach(function(yt){Xe.push({file:yt,errors:[LN]})}),Ne.splice(0)),W({acceptedFiles:Ne,fileRejections:Xe,type:"setFiles"}),v&&v(Ne,Xe,he),Xe.length>0&&S&&S(Xe,he),Ne.length>0&&y&&y(Ne,he)},[W,u,$,i,s,d,v,y,S,D]),fe=p.useCallback(function(te){te.preventDefault(),te.persist(),xt(te),se.current=[],qd(te)&&Promise.resolve(o(te)).then(function(he){rp(te)&&!R||ge(he,te)}).catch(function(he){return ae(he)}),W({type:"reset"})},[o,ge,ae,R]),Pe=p.useCallback(function(){if(ve.current){W({type:"openDialog"}),J();var te={multiple:u,types:A};window.showOpenFilePicker(te).then(function(he){return o(he)}).then(function(he){ge(he,null),W({type:"closeDialog"})}).catch(function(he){qN(he)?(z(he),W({type:"closeDialog"})):KN(he)?(ve.current=!1,G.current?(G.current.value=null,G.current.click()):ae(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."))):ae(he)});return}G.current&&(W({type:"openDialog"}),J(),G.current.value=null,G.current.click())},[W,J,z,k,ge,ae,A,u]),Ae=p.useCallback(function(te){!B.current||!B.current.isEqualNode(te.target)||(te.key===" "||te.key==="Enter"||te.keyCode===32||te.keyCode===13)&&(te.preventDefault(),Pe())},[B,Pe]),ye=p.useCallback(function(){W({type:"focus"})},[]),Oe=p.useCallback(function(){W({type:"blur"})},[]),at=p.useCallback(function(){E||(WN()?setTimeout(Pe,0):Pe())},[E,Pe]),Fe=function(he){return r?null:he},Ye=function(he){return O?null:Fe(he)},jt=function(he){return I?null:Fe(he)},xt=function(he){R&&he.stopPropagation()},Fn=p.useMemo(function(){return function(){var te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},he=te.refKey,Ne=he===void 0?"ref":he,Xe=te.role,yt=te.onKeyDown,Xt=te.onFocus,ln=te.onBlur,kn=te.onClick,vr=te.onDragEnter,cn=te.onDragOver,Yn=te.onDragLeave,Re=te.onDrop,et=op(te,QN);return ir(ir(Yv({onKeyDown:Ye(Bs(yt,Ae)),onFocus:Ye(Bs(Xt,ye)),onBlur:Ye(Bs(ln,Oe)),onClick:Fe(Bs(kn,at)),onDragEnter:jt(Bs(vr,ue)),onDragOver:jt(Bs(cn,xe)),onDragLeave:jt(Bs(Yn,oe)),onDrop:jt(Bs(Re,fe)),role:typeof Xe=="string"&&Xe!==""?Xe:"presentation"},Ne,B),!r&&!O?{tabIndex:0}:{}),et)}},[B,Ae,ye,Oe,at,ue,xe,oe,fe,O,I,r]),X=p.useCallback(function(te){te.stopPropagation()},[]),we=p.useMemo(function(){return function(){var te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},he=te.refKey,Ne=he===void 0?"ref":he,Xe=te.onChange,yt=te.onClick,Xt=op(te,ZN),ln=Yv({accept:$,multiple:u,type:"file",style:{display:"none"},onChange:Fe(Bs(Xe,fe)),onClick:Fe(Bs(yt,X)),tabIndex:-1},Ne,G);return ir(ir({},ln),Xt)}},[G,n,u,fe,r]);return ir(ir({},V),{},{isFocused:U&&!r,getRootProps:Fn,getInputProps:we,rootRef:B,inputRef:G,open:Fe(Pe)})}function iz(e,t){switch(t.type){case"focus":return ir(ir({},e),{},{isFocused:!0});case"blur":return ir(ir({},e),{},{isFocused:!1});case"openDialog":return ir(ir({},Xv),{},{isFileDialogActive:!0});case"closeDialog":return ir(ir({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return ir(ir({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return ir(ir({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return ir({},Xv);default:return e}}function K2(){}function Qv(){return Qv=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},Qv.apply(this,arguments)}var ik=["shift","alt","meta","mod","ctrl"],lz={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 Qa(e){return(lz[e]||e).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function cz(e){return ik.includes(e)}function Ag(e,t){return t===void 0&&(t=","),e.split(t)}function Ng(e,t,n){t===void 0&&(t="+");var r=e.toLocaleLowerCase().split(t).map(function(i){return Qa(i)}),o={alt:r.includes("alt"),ctrl:r.includes("ctrl")||r.includes("control"),shift:r.includes("shift"),meta:r.includes("meta"),mod:r.includes("mod")},s=r.filter(function(i){return!ik.includes(i)});return Qv({},o,{keys:s,description:n})}(function(){typeof document<"u"&&(document.addEventListener("keydown",function(e){e.key!==void 0&&ck([Qa(e.key),Qa(e.code)])}),document.addEventListener("keyup",function(e){e.key!==void 0&&uk([Qa(e.key),Qa(e.code)])})),typeof window<"u"&&window.addEventListener("blur",function(){Za.clear()})})();var Za=new Set;function lk(e,t){t===void 0&&(t=",");var n=Array.isArray(e)?e:e.split(t);return n.every(function(r){return Za.has(r.trim().toLowerCase())})}function ck(e){var t=Array.isArray(e)?e:[e];Za.has("meta")&&Za.forEach(function(n){return!cz(n)&&Za.delete(n.toLowerCase())}),t.forEach(function(n){return Za.add(n.toLowerCase())})}function uk(e){var t=Array.isArray(e)?e:[e];e==="meta"?Za.clear():t.forEach(function(n){return Za.delete(n.toLowerCase())})}function uz(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function dz(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function fz(e){return dk(e,["input","textarea","select"])}function dk(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 pz(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 hz=function(t,n,r){r===void 0&&(r=!1);var o=n.alt,s=n.meta,i=n.mod,u=n.shift,d=n.ctrl,f=n.keys,h=t.key,m=t.code,v=t.ctrlKey,y=t.metaKey,S=t.shiftKey,w=t.altKey,C=Qa(m),k=h.toLowerCase();if(!r){if(o===!w&&k!=="alt"||u===!S&&k!=="shift")return!1;if(i){if(!y&&!v)return!1}else if(s===!y&&k!=="meta"&&k!=="os"||d===!v&&k!=="ctrl"&&k!=="control")return!1}return f&&f.length===1&&(f.includes(k)||f.includes(C))?!0:f?lk(f):!f},mz=p.createContext(void 0),gz=function(){return p.useContext(mz)};function fk(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&&fk(e[r],t[r])},!0):e===t}var vz=p.createContext({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),yz=function(){return p.useContext(vz)};function bz(e){var t=p.useRef(void 0);return fk(t.current,e)||(t.current=e),t.current}var Y2=function(t){t.stopPropagation(),t.preventDefault(),t.stopImmediatePropagation()},xz=typeof window<"u"?p.useLayoutEffect:p.useEffect;function Ke(e,t,n,r){var o=p.useRef(null),s=p.useRef(!1),i=n instanceof Array?r instanceof Array?void 0:r:n,u=e instanceof Array?e.join(i==null?void 0:i.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=bz(i),v=yz(),y=v.enabledScopes,S=gz();return xz(function(){if(!((m==null?void 0:m.enabled)===!1||!pz(y,m==null?void 0:m.scopes))){var w=function(E,O){var I;if(O===void 0&&(O=!1),!(fz(E)&&!dk(E,m==null?void 0:m.enableOnFormTags))&&!(m!=null&&m.ignoreEventWhen!=null&&m.ignoreEventWhen(E))){if(o.current!==null&&document.activeElement!==o.current&&!o.current.contains(document.activeElement)){Y2(E);return}(I=E.target)!=null&&I.isContentEditable&&!(m!=null&&m.enableOnContentEditable)||Ag(u,m==null?void 0:m.splitKey).forEach(function(R){var T,D=Ng(R,m==null?void 0:m.combinationKey);if(hz(E,D,m==null?void 0:m.ignoreModifiers)||(T=D.keys)!=null&&T.includes("*")){if(O&&s.current)return;if(uz(E,D,m==null?void 0:m.preventDefault),!dz(E,D,m==null?void 0:m.enabled)){Y2(E);return}h.current(E,D),O||(s.current=!0)}})}},C=function(E){E.key!==void 0&&(ck(Qa(E.code)),((m==null?void 0:m.keydown)===void 0&&(m==null?void 0:m.keyup)!==!0||m!=null&&m.keydown)&&w(E))},k=function(E){E.key!==void 0&&(uk(Qa(E.code)),s.current=!1,m!=null&&m.keyup&&w(E,!0))},P=o.current||(i==null?void 0:i.document)||document;return P.addEventListener("keyup",k),P.addEventListener("keydown",C),S&&Ag(u,m==null?void 0:m.splitKey).forEach(function(j){return S.addHotkey(Ng(j,m==null?void 0:m.combinationKey,m==null?void 0:m.description))}),function(){P.removeEventListener("keyup",k),P.removeEventListener("keydown",C),S&&Ag(u,m==null?void 0:m.splitKey).forEach(function(j){return S.removeHotkey(Ng(j,m==null?void 0:m.combinationKey,m==null?void 0:m.description))})}}},[u,m,y]),o}const Sz=e=>{const{isDragAccept:t,isDragReject:n,setIsHandlingUpload:r}=e;return Ke("esc",()=>{r(!1)}),a.jsx(Ge,{sx:{position:"absolute",top:0,insetInlineStart:0,width:"100vw",height:"100vh",zIndex:999,backdropFilter:"blur(20px)"},children:a.jsx(H,{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?a.jsx(ua,{size:"lg",children:"Drop to Upload"}):a.jsxs(a.Fragment,{children:[a.jsx(ua,{size:"lg",children:"Invalid Upload"}),a.jsx(ua,{size:"md",children:"Must be single JPEG or PNG image"})]})})})},wz=Ce([xo,Sr],(e,t)=>{const{isConnected:n,isUploading:r}=e;return{isUploaderDisabled:!n||r,activeTabName:t}}),Cz=e=>{const{children:t}=e,n=ne(),{isUploaderDisabled:r,activeTabName:o}=F(wz),s=Mu(),{t:i}=pe(),[u,d]=p.useState(!1),{setOpenUploaderFunction:f}=Th(),h=p.useCallback(E=>{d(!0),s({title:i("toast.uploadFailed"),description:E.errors.map(O=>O.message).join(`
|
||
`),status:"error"})},[i,s]),m=p.useCallback(async E=>{n(u3({file:E,image_category:"user",is_intermediate:!1,postUploadAction:{type:"TOAST_UPLOADED"}}))},[n]),v=p.useCallback((E,O)=>{if(O.length>1){s({title:i("toast.uploadFailed"),description:i("toast.uploadFailedInvalidUploadDesc"),status:"error"});return}O.forEach(I=>{h(I)}),E.forEach(I=>{m(I)})},[i,s,m,h]),{getRootProps:y,getInputProps:S,isDragAccept:w,isDragReject:C,isDragActive:k,inputRef:P,open:j}=E1({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},noClick:!0,onDrop:v,onDragOver:()=>d(!0),disabled:r,multiple:!1});return p.useEffect(()=>{const E=async O=>{var I,R;P.current&&(I=O.clipboardData)!=null&&I.files&&(P.current.files=O.clipboardData.files,(R=P.current)==null||R.dispatchEvent(new Event("change",{bubbles:!0})))};return f(j),document.addEventListener("paste",E),()=>{document.removeEventListener("paste",E),f(()=>{})}},[P,j,f]),a.jsxs(Ge,{...y({style:{}}),onKeyDown:E=>{E.key},children:[a.jsx("input",{...S()}),t,k&&u&&a.jsx(Sz,{isDragAccept:w,isDragReject:C,setIsHandlingUpload:d})]})},kz=p.memo(Cz),pk=e=>e.gallery;const Pz=e=>{const{triggerComponent:t,children:n,hasArrow:r=!0,isLazy:o=!0,...s}=e;return a.jsxs(w1,{isLazy:o,...s,children:[a.jsx(S1,{children:t}),a.jsxs(C1,{shadow:"dark-lg",children:[r&&a.jsx(D6,{}),n]})]})},fa=p.memo(Pz),Te=(e,t)=>n=>n==="light"?e:t,_z=e=>{const{label:t,...n}=e,{colorMode:r}=So();return a.jsx(x5,{colorScheme:"accent",...n,children:a.jsx(Ue,{sx:{fontSize:"sm",color:Te("base.800","base.200")(r)},children:t})})},In=p.memo(_z);function hk(e){return st({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 mk(e){return st({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 jz(e){return st({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 Ez(e){return st({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 Iz(e){return st({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 Oz(e){return st({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34zm192-34l-136-136c-9.4-9.4-24.6-9.4-33.9 0l-22.6 22.6c-9.4 9.4-9.4 24.6 0 33.9l96.4 96.4-96.4 96.4c-9.4 9.4-9.4 24.6 0 33.9l22.6 22.6c9.4 9.4 24.6 9.4 33.9 0l136-136c9.4-9.2 9.4-24.4 0-33.8z"}}]})(e)}function Rz(e){return st({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 Tz(e){return st({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 Mz(e){return st({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 Dz(e){return st({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 gk(e){return st({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 Az(e){return st({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 Nz(e){return st({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 zz(e){return st({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"}}]})(e)}function $z(e){return st({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 I1(e){return st({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 bc(e){return st({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 vk(e){return st({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 Lz(e){return st({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 O1(e){return st({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 yk(e){return st({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 Fz(e){return st({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 Bz(e){return st({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 R1(e){return st({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 bk(e){return st({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 Hz(e){return st({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 Wz(e){return st({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 xk(e){return st({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 lu(e){return st({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 Vz(e){return st({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 Uz(e){return st({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 Gz(e){return st({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 Ku(e){return st({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 qz(e){return st({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 Kz(e){return st({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 Yz(e){return st({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 Sk(e){return st({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 Xz(e){return st({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 Qz(e){return st({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 Zz(e){return st({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 Jz(e){return st({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 wk(e){return st({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 Ck(e){return st({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 Mh(e){return st({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 e$(e){return st({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 t$(e){return st({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 n$(e){return st({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 Dh(e){return st({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 X2(e){return st({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 r$(e){return st({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 o$(e){return st({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 s$(e){return st({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 sp(e){return st({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 T1(e){return st({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 a$(e){return st({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 i$(e){return st({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M370.72 133.28C339.458 104.008 298.888 87.962 255.848 88c-77.458.068-144.328 53.178-162.791 126.85-1.344 5.363-6.122 9.15-11.651 9.15H24.103c-7.498 0-13.194-6.807-11.807-14.176C33.933 94.924 134.813 8 256 8c66.448 0 126.791 26.136 171.315 68.685L463.03 40.97C478.149 25.851 504 36.559 504 57.941V192c0 13.255-10.745 24-24 24H345.941c-21.382 0-32.09-25.851-16.971-40.971l41.75-41.749zM32 296h134.059c21.382 0 32.09 25.851 16.971 40.971l-41.75 41.75c31.262 29.273 71.835 45.319 114.876 45.28 77.418-.07 144.315-53.144 162.787-126.849 1.344-5.363 6.122-9.15 11.651-9.15h57.304c7.498 0 13.194 6.807 11.807 14.176C478.067 417.076 377.187 504 256 504c-66.448 0-126.791-26.136-171.315-68.685L48.97 471.03C33.851 486.149 8 475.441 8 454.059V320c0-13.255 10.745-24 24-24z"}}]})(e)}function io(e){return st({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 M1(e){return st({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 Yu(e){return st({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 D1(e){return st({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)}var l$=mc({displayName:"EditIcon",path:a.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[a.jsx("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),a.jsx("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]})}),A1=mc({displayName:"ExternalLinkIcon",path:a.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[a.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),a.jsx("path",{d:"M15 3h6v6"}),a.jsx("path",{d:"M10 14L21 3"})]})}),N1=mc({d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z",displayName:"ChevronUpIcon"}),c$=mc({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"}),u$=mc({displayName:"DeleteIcon",path:a.jsx("g",{fill:"currentColor",children:a.jsx("path",{d:"M19.452 7.5H4.547a.5.5 0 00-.5.545l1.287 14.136A2 2 0 007.326 24h9.347a2 2 0 001.992-1.819L19.95 8.045a.5.5 0 00-.129-.382.5.5 0 00-.369-.163zm-9.2 13a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zm5 0a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zM22 4h-4.75a.25.25 0 01-.25-.25V2.5A2.5 2.5 0 0014.5 0h-5A2.5 2.5 0 007 2.5v1.25a.25.25 0 01-.25.25H2a1 1 0 000 2h20a1 1 0 000-2zM9 3.75V2.5a.5.5 0 01.5-.5h5a.5.5 0 01.5.5v1.25a.25.25 0 01-.25.25h-5.5A.25.25 0 019 3.75z"})})}),d$=mc({displayName:"ChevronDownIcon",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"});const f$=qR(e=>{e(d3(!0))},300),js=()=>(e,t)=>{Sr(t())==="unifiedCanvas"&&f$(e)};var cu=globalThis&&globalThis.__assign||function(){return cu=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},cu.apply(this,arguments)};function kk(e){var t,n=p.useState(!1),r=n[0],o=n[1],s=p.useState(!1),i=s[0],u=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(){u(!0),setTimeout(function(){h(!0)})});else{h(!1);var C=setTimeout(function(){u(r)},1e3);return function(){return clearTimeout(C)}}},[r]),ED("contextmenu",function(C){var k;!((k=S.current)===null||k===void 0)&&k.contains(C.target)||C.target===S.current?(C.preventDefault(),o(!0),y([C.pageX,C.pageY])):o(!1)});var w=p.useCallback(function(){var C,k;(k=(C=e.menuProps)===null||C===void 0?void 0:C.onClose)===null||k===void 0||k.call(C),o(!1)},[(t=e.menuProps)===null||t===void 0?void 0:t.onClose,o]);return p.createElement(p.Fragment,null,e.children(S),i&&p.createElement($f,cu({},e.portalProps),p.createElement(xh,cu({isOpen:f,gutter:0},e.menuProps,{onClose:w}),p.createElement(Sh,cu({"aria-hidden":!0,w:1,h:1,style:{position:"absolute",left:v[0],top:v[1],cursor:"default"}},e.menuButtonProps)),e.renderMenu())))}const p$=e=>e.image?a.jsx(P1,{sx:{w:`${e.image.width}px`,h:"auto",objectFit:"contain",aspectRatio:`${e.image.width}/${e.image.height}`}}):a.jsx(H,{sx:{opacity:.7,w:"full",h:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",bg:"base.200",_dark:{bg:"base.900"}},children:a.jsx(ui,{size:"xl"})}),xc=e=>{const{icon:t=Ku,boxSize:n=16}=e;return a.jsxs(H,{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:[a.jsx(go,{as:t,boxSize:n,opacity:.7}),e.label&&a.jsx(Ue,{textAlign:"center",children:e.label})]})};var Pk={exports:{}},_k={};const Io=U0(DO),Bc=U0(AO),h$=U0(NO);(function(e){var t,n,r=yl&&yl.__generator||function(q,Z){var de,be,Se,Qe,pt={label:0,sent:function(){if(1&Se[0])throw Se[1];return Se[1]},trys:[],ops:[]};return Qe={next:zt(0),throw:zt(1),return:zt(2)},typeof Symbol=="function"&&(Qe[Symbol.iterator]=function(){return this}),Qe;function zt(lt){return function(Be){return function(qe){if(de)throw new TypeError("Generator is already executing.");for(;pt;)try{if(de=1,be&&(Se=2&qe[0]?be.return:qe[0]?be.throw||((Se=be.return)&&Se.call(be),0):be.next)&&!(Se=Se.call(be,qe[1])).done)return Se;switch(be=0,Se&&(qe=[2&qe[0],Se.value]),qe[0]){case 0:case 1:Se=qe;break;case 4:return pt.label++,{value:qe[1],done:!1};case 5:pt.label++,be=qe[1],qe=[0];continue;case 7:qe=pt.ops.pop(),pt.trys.pop();continue;default:if(!((Se=(Se=pt.trys).length>0&&Se[Se.length-1])||qe[0]!==6&&qe[0]!==2)){pt=0;continue}if(qe[0]===3&&(!Se||qe[1]>Se[0]&&qe[1]<Se[3])){pt.label=qe[1];break}if(qe[0]===6&&pt.label<Se[1]){pt.label=Se[1],Se=qe;break}if(Se&&pt.label<Se[2]){pt.label=Se[2],pt.ops.push(qe);break}Se[2]&&pt.ops.pop(),pt.trys.pop();continue}qe=Z.call(q,pt)}catch(ke){qe=[6,ke],be=0}finally{de=Se=0}if(5&qe[0])throw qe[1];return{value:qe[0]?qe[1]:void 0,done:!0}}([lt,Be])}}},o=yl&&yl.__spreadArray||function(q,Z){for(var de=0,be=Z.length,Se=q.length;de<be;de++,Se++)q[Se]=Z[de];return q},s=Object.create,i=Object.defineProperty,u=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,w=function(q,Z,de){return Z in q?i(q,Z,{enumerable:!0,configurable:!0,writable:!0,value:de}):q[Z]=de},C=function(q,Z){for(var de in Z||(Z={}))y.call(Z,de)&&w(q,de,Z[de]);if(m)for(var be=0,Se=m(Z);be<Se.length;be++)S.call(Z,de=Se[be])&&w(q,de,Z[de]);return q},k=function(q,Z){return u(q,f(Z))},P=function(q){return i(q,"__esModule",{value:!0})},j=function(q,Z){var de={};for(var be in q)y.call(q,be)&&Z.indexOf(be)<0&&(de[be]=q[be]);if(q!=null&&m)for(var Se=0,Qe=m(q);Se<Qe.length;Se++)Z.indexOf(be=Qe[Se])<0&&S.call(q,be)&&(de[be]=q[be]);return de},E=function(q){return function(Z,de,be){if(de&&typeof de=="object"||typeof de=="function")for(var Se=function(zt){y.call(Z,zt)||zt==="default"||i(Z,zt,{get:function(){return de[zt]},enumerable:!(be=d(de,zt))||be.enumerable})},Qe=0,pt=h(de);Qe<pt.length;Qe++)Se(pt[Qe]);return Z}(P(i(q!=null?s(v(q)):{},"default",q&&q.__esModule&&"default"in q?{get:function(){return q.default},enumerable:!0}:{value:q,enumerable:!0})),q)},O=function(q,Z,de){return new Promise(function(be,Se){var Qe=function(lt){try{zt(de.next(lt))}catch(Be){Se(Be)}},pt=function(lt){try{zt(de.throw(lt))}catch(Be){Se(Be)}},zt=function(lt){return lt.done?be(lt.value):Promise.resolve(lt.value).then(Qe,pt)};zt((de=de.apply(q,Z)).next())})};P(e),function(q,Z){for(var de in Z)i(q,de,{get:Z[de],enumerable:!0})}(e,{QueryStatus:function(){return t},buildCreateApi:function(){return it},copyWithStructuralSharing:function(){return T},coreModule:function(){return Aa},createApi:function(){return cs},defaultSerializeQueryArgs:function(){return Yn},fakeBaseQuery:function(){return ut},fetchBaseQuery:function(){return B},retry:function(){return V},setupListeners:function(){return Y},skipSelector:function(){return yt},skipToken:function(){return Xe}}),(n=t||(t={})).uninitialized="uninitialized",n.pending="pending",n.fulfilled="fulfilled",n.rejected="rejected";var I=function(q){return[].concat.apply([],q)},R=E(Io).isPlainObject;function T(q,Z){if(q===Z||!(R(q)&&R(Z)||Array.isArray(q)&&Array.isArray(Z)))return Z;for(var de=Object.keys(Z),be=Object.keys(q),Se=de.length===be.length,Qe=Array.isArray(Z)?[]:{},pt=0,zt=de;pt<zt.length;pt++){var lt=zt[pt];Qe[lt]=T(q[lt],Z[lt]),Se&&(Se=q[lt]===Qe[lt])}return Se?q:Qe}var D=E(Io),$=function(){for(var q=[],Z=0;Z<arguments.length;Z++)q[Z]=arguments[Z];return fetch.apply(void 0,q)},A=function(q){return q.status>=200&&q.status<=299},J=function(q){return/ion\/(vnd\.api\+)?json/.test(q.get("content-type")||"")};function z(q){if(!(0,D.isPlainObject)(q))return q;for(var Z=C({},q),de=0,be=Object.entries(Z);de<be.length;de++){var Se=be[de];Se[1]===void 0&&delete Z[Se[0]]}return Z}function B(q){var Z=this;q===void 0&&(q={});var de=q.baseUrl,be=q.prepareHeaders,Se=be===void 0?function(Ft){return Ft}:be,Qe=q.fetchFn,pt=Qe===void 0?$:Qe,zt=q.paramsSerializer,lt=q.isJsonContentType,Be=lt===void 0?J:lt,qe=q.jsonContentType,ke=qe===void 0?"application/json":qe,He=q.jsonReplacer,St=q.timeout,kt=q.responseHandler,Rt=q.validateStatus,Lt=j(q,["baseUrl","prepareHeaders","fetchFn","paramsSerializer","isJsonContentType","jsonContentType","jsonReplacer","timeout","responseHandler","validateStatus"]);return typeof fetch>"u"&&pt===$&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),function(Ft,Ee){return O(Z,null,function(){var ht,Tt,Mt,$t,fn,Vt,Qt,Cn,Ir,Xn,wt,Sn,_n,Qn,dr,Rn,Tn,tn,gn,wn,pn,hn,We,Pt,gt,tt,mt,Dt,dt,Je,Ie,_e,Me,ze,Ze,Et;return r(this,function(_t){switch(_t.label){case 0:return ht=Ee.signal,Tt=Ee.getState,Mt=Ee.extra,$t=Ee.endpoint,fn=Ee.forced,Vt=Ee.type,Ir=(Cn=typeof Ft=="string"?{url:Ft}:Ft).url,wt=(Xn=Cn.headers)===void 0?new Headers(Lt.headers):Xn,_n=(Sn=Cn.params)===void 0?void 0:Sn,dr=(Qn=Cn.responseHandler)===void 0?kt??"json":Qn,Tn=(Rn=Cn.validateStatus)===void 0?Rt??A:Rn,gn=(tn=Cn.timeout)===void 0?St:tn,wn=j(Cn,["url","headers","params","responseHandler","validateStatus","timeout"]),pn=C(k(C({},Lt),{signal:ht}),wn),wt=new Headers(z(wt)),hn=pn,[4,Se(wt,{getState:Tt,extra:Mt,endpoint:$t,forced:fn,type:Vt})];case 1:hn.headers=_t.sent()||wt,We=function($e){return typeof $e=="object"&&((0,D.isPlainObject)($e)||Array.isArray($e)||typeof $e.toJSON=="function")},!pn.headers.has("content-type")&&We(pn.body)&&pn.headers.set("content-type",ke),We(pn.body)&&Be(pn.headers)&&(pn.body=JSON.stringify(pn.body,He)),_n&&(Pt=~Ir.indexOf("?")?"&":"?",gt=zt?zt(_n):new URLSearchParams(z(_n)),Ir+=Pt+gt),Ir=function($e,Gt){if(!$e)return Gt;if(!Gt)return $e;if(function(on){return new RegExp("(^|:)//").test(on)}(Gt))return Gt;var mn=$e.endsWith("/")||!Gt.startsWith("?")?"/":"";return $e=function(on){return on.replace(/\/$/,"")}($e),""+$e+mn+function(on){return on.replace(/^\//,"")}(Gt)}(de,Ir),tt=new Request(Ir,pn),mt=tt.clone(),Qt={request:mt},dt=!1,Je=gn&&setTimeout(function(){dt=!0,Ee.abort()},gn),_t.label=2;case 2:return _t.trys.push([2,4,5,6]),[4,pt(tt)];case 3:return Dt=_t.sent(),[3,6];case 4:return Ie=_t.sent(),[2,{error:{status:dt?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(Ie)},meta:Qt}];case 5:return Je&&clearTimeout(Je),[7];case 6:_e=Dt.clone(),Qt.response=_e,ze="",_t.label=7;case 7:return _t.trys.push([7,9,,10]),[4,Promise.all([Ut(Dt,dr).then(function($e){return Me=$e},function($e){return Ze=$e}),_e.text().then(function($e){return ze=$e},function(){})])];case 8:if(_t.sent(),Ze)throw Ze;return[3,10];case 9:return Et=_t.sent(),[2,{error:{status:"PARSING_ERROR",originalStatus:Dt.status,data:ze,error:String(Et)},meta:Qt}];case 10:return[2,Tn(Dt,Me)?{data:Me,meta:Qt}:{error:{status:Dt.status,data:Me},meta:Qt}]}})})};function Ut(Ft,Ee){return O(this,null,function(){var ht;return r(this,function(Tt){switch(Tt.label){case 0:return typeof Ee=="function"?[2,Ee(Ft)]:(Ee==="content-type"&&(Ee=Be(Ft.headers)?"json":"text"),Ee!=="json"?[3,2]:[4,Ft.text()]);case 1:return[2,(ht=Tt.sent()).length?JSON.parse(ht):null];case 2:return[2,Ft.text()]}})})}}var G=function(q,Z){Z===void 0&&(Z=void 0),this.value=q,this.meta=Z};function K(q,Z){return q===void 0&&(q=0),Z===void 0&&(Z=5),O(this,null,function(){var de,be;return r(this,function(Se){switch(Se.label){case 0:return de=Math.min(q,Z),be=~~((Math.random()+.4)*(300<<de)),[4,new Promise(function(Qe){return setTimeout(function(pt){return Qe(pt)},be)})];case 1:return Se.sent(),[2]}})})}var N={},V=Object.assign(function(q,Z){return function(de,be,Se){return O(void 0,null,function(){var Qe,pt,zt,lt,Be,qe,ke;return r(this,function(He){switch(He.label){case 0:Qe=[5,(Z||N).maxRetries,(Se||N).maxRetries].filter(function(St){return St!==void 0}),pt=Qe.slice(-1)[0],zt=function(St,kt,Rt){return Rt.attempt<=pt},lt=C(C({maxRetries:pt,backoff:K,retryCondition:zt},Z),Se),Be=0,He.label=1;case 1:He.label=2;case 2:return He.trys.push([2,4,,6]),[4,q(de,be,Se)];case 3:if((qe=He.sent()).error)throw new G(qe);return[2,qe];case 4:if(ke=He.sent(),Be++,ke.throwImmediately){if(ke instanceof G)return[2,ke.value];throw ke}return ke instanceof G&&!lt.retryCondition(ke.value.error,de,{attempt:Be,baseQueryApi:be,extraOptions:Se})?[2,ke.value]:[4,lt.backoff(Be,lt.maxRetries)];case 5:return He.sent(),[3,6];case 6:return[3,1];case 7:return[2]}})})}},{fail:function(q){throw Object.assign(new G({error:q}),{throwImmediately:!0})}}),W=E(Io),U=(0,W.createAction)("__rtkq/focused"),re=(0,W.createAction)("__rtkq/unfocused"),ve=(0,W.createAction)("__rtkq/online"),le=(0,W.createAction)("__rtkq/offline"),se=!1;function Y(q,Z){return Z?Z(q,{onFocus:U,onFocusLost:re,onOffline:le,onOnline:ve}):(de=function(){return q(U())},be=function(){return q(ve())},Se=function(){return q(le())},Qe=function(){window.document.visibilityState==="visible"?de():q(re())},se||typeof window<"u"&&window.addEventListener&&(window.addEventListener("visibilitychange",Qe,!1),window.addEventListener("focus",de,!1),window.addEventListener("online",be,!1),window.addEventListener("offline",Se,!1),se=!0),function(){window.removeEventListener("focus",de),window.removeEventListener("visibilitychange",Qe),window.removeEventListener("online",be),window.removeEventListener("offline",Se),se=!1});var de,be,Se,Qe}var ae,ue,xe=E(Io);function oe(q){return q.type===ae.query}function ge(q,Z,de,be,Se,Qe){return typeof q=="function"?q(Z,de,be,Se).map(fe).map(Qe):Array.isArray(q)?q.map(fe).map(Qe):[]}function fe(q){return typeof q=="string"?{type:q}:q}(ue=ae||(ae={})).query="query",ue.mutation="mutation";var Pe=E(Io);function Ae(q){return q!=null}var ye=Symbol("forceQueryFn"),Oe=function(q){return typeof q[ye]=="function"},at=E(Io),Fe=E(Bc),Ye=E(Io);function jt(q){return q}function xt(q,Z,de,be){return ge(de[q.meta.arg.endpointName][Z],(0,at.isFulfilled)(q)?q.payload:void 0,(0,at.isRejectedWithValue)(q)?q.payload:void 0,q.meta.arg.originalArgs,"baseQueryMeta"in q.meta?q.meta.baseQueryMeta:void 0,be)}var Fn=E(Bc),X=E(Bc);function we(q,Z,de){var be=q[Z];be&&de(be)}function te(q){var Z;return(Z="arg"in q?q.arg.fixedCacheKey:q.fixedCacheKey)!=null?Z:q.requestId}function he(q,Z,de){var be=q[te(Z)];be&&de(be)}var Ne={},Xe=Symbol.for("RTKQ/skipToken"),yt=Xe,Xt={status:t.uninitialized},ln=(0,xe.createNextState)(Xt,function(){}),kn=(0,xe.createNextState)(Xt,function(){}),vr=E(Io),cn=WeakMap?new WeakMap:void 0,Yn=function(q){var Z=q.endpointName,de=q.queryArgs,be="",Se=cn==null?void 0:cn.get(de);if(typeof Se=="string")be=Se;else{var Qe=JSON.stringify(de,function(pt,zt){return(0,vr.isPlainObject)(zt)?Object.keys(zt).sort().reduce(function(lt,Be){return lt[Be]=zt[Be],lt},{}):zt});(0,vr.isPlainObject)(de)&&(cn==null||cn.set(de,Qe)),be=Qe}return Z+"("+be+")"},Re=E(Io),et=E(h$);function it(){for(var q=[],Z=0;Z<arguments.length;Z++)q[Z]=arguments[Z];return function(de){var be=(0,et.defaultMemoize)(function(lt){var Be,qe;return(qe=de.extractRehydrationInfo)==null?void 0:qe.call(de,lt,{reducerPath:(Be=de.reducerPath)!=null?Be:"api"})}),Se=k(C({reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1},de),{extractRehydrationInfo:be,serializeQueryArgs:function(lt){var Be=Yn;if("serializeQueryArgs"in lt.endpointDefinition){var qe=lt.endpointDefinition.serializeQueryArgs;Be=function(ke){var He=qe(ke);return typeof He=="string"?He:Yn(k(C({},ke),{queryArgs:He}))}}else de.serializeQueryArgs&&(Be=de.serializeQueryArgs);return Be(lt)},tagTypes:o([],de.tagTypes||[])}),Qe={endpointDefinitions:{},batch:function(lt){lt()},apiUid:(0,Re.nanoid)(),extractRehydrationInfo:be,hasRehydrationInfo:(0,et.defaultMemoize)(function(lt){return be(lt)!=null})},pt={injectEndpoints:function(lt){for(var Be=lt.endpoints({query:function(Ut){return k(C({},Ut),{type:ae.query})},mutation:function(Ut){return k(C({},Ut),{type:ae.mutation})}}),qe=0,ke=Object.entries(Be);qe<ke.length;qe++){var He=ke[qe],St=He[0],kt=He[1];if(lt.overrideExisting||!(St in Qe.endpointDefinitions)){Qe.endpointDefinitions[St]=kt;for(var Rt=0,Lt=zt;Rt<Lt.length;Rt++)Lt[Rt].injectEndpoint(St,kt)}}return pt},enhanceEndpoints:function(lt){var Be=lt.addTagTypes,qe=lt.endpoints;if(Be)for(var ke=0,He=Be;ke<He.length;ke++){var St=He[ke];Se.tagTypes.includes(St)||Se.tagTypes.push(St)}if(qe)for(var kt=0,Rt=Object.entries(qe);kt<Rt.length;kt++){var Lt=Rt[kt],Ut=Lt[0],Ft=Lt[1];typeof Ft=="function"?Ft(Qe.endpointDefinitions[Ut]):Object.assign(Qe.endpointDefinitions[Ut]||{},Ft)}return pt}},zt=q.map(function(lt){return lt.init(pt,Se,Qe)});return pt.injectEndpoints({endpoints:de.endpoints})}}function ut(){return function(){throw new Error("When using `fakeBaseQuery`, all queries & mutations must use the `queryFn` definition syntax.")}}var Nt,yr=E(Io),un=function(q){var Z=q.reducerPath,de=q.api,be=q.context,Se=q.internalState,Qe=de.internalActions,pt=Qe.removeQueryResult,zt=Qe.unsubscribeQueryResult;function lt(ke){var He=Se.currentSubscriptions[ke];return!!He&&!function(St){for(var kt in St)return!1;return!0}(He)}var Be={};function qe(ke,He,St,kt){var Rt,Lt=be.endpointDefinitions[He],Ut=(Rt=Lt==null?void 0:Lt.keepUnusedDataFor)!=null?Rt:kt.keepUnusedDataFor;if(Ut!==1/0){var Ft=Math.max(0,Math.min(Ut,2147482647e-3));if(!lt(ke)){var Ee=Be[ke];Ee&&clearTimeout(Ee),Be[ke]=setTimeout(function(){lt(ke)||St.dispatch(pt({queryCacheKey:ke})),delete Be[ke]},1e3*Ft)}}}return function(ke,He,St){var kt;if(zt.match(ke)){var Rt=He.getState()[Z];qe(fn=ke.payload.queryCacheKey,(kt=Rt.queries[fn])==null?void 0:kt.endpointName,He,Rt.config)}if(de.util.resetApiState.match(ke))for(var Lt=0,Ut=Object.entries(Be);Lt<Ut.length;Lt++){var Ft=Ut[Lt],Ee=Ft[0],ht=Ft[1];ht&&clearTimeout(ht),delete Be[Ee]}if(be.hasRehydrationInfo(ke)){Rt=He.getState()[Z];for(var Tt=be.extractRehydrationInfo(ke).queries,Mt=0,$t=Object.entries(Tt);Mt<$t.length;Mt++){var fn,Vt=$t[Mt],Qt=Vt[1];qe(fn=Vt[0],Qt==null?void 0:Qt.endpointName,He,Rt.config)}}}},xn=E(Io),Cr=function(q){var Z=q.reducerPath,de=q.context,be=q.context.endpointDefinitions,Se=q.mutationThunk,Qe=q.api,pt=q.assertTagType,zt=q.refetchQuery,lt=Qe.internalActions.removeQueryResult,Be=(0,xn.isAnyOf)((0,xn.isFulfilled)(Se),(0,xn.isRejectedWithValue)(Se));function qe(ke,He){var St=He.getState(),kt=St[Z],Rt=Qe.util.selectInvalidatedBy(St,ke);de.batch(function(){for(var Lt,Ut=0,Ft=Array.from(Rt.values());Ut<Ft.length;Ut++){var Ee=Ft[Ut].queryCacheKey,ht=kt.queries[Ee],Tt=(Lt=kt.subscriptions[Ee])!=null?Lt:{};ht&&(Object.keys(Tt).length===0?He.dispatch(lt({queryCacheKey:Ee})):ht.status!==t.uninitialized&&He.dispatch(zt(ht,Ee)))}})}return function(ke,He){Be(ke)&&qe(xt(ke,"invalidatesTags",be,pt),He),Qe.util.invalidateTags.match(ke)&&qe(ge(ke.payload,void 0,void 0,void 0,void 0,pt),He)}},Pn=function(q){var Z=q.reducerPath,de=q.queryThunk,be=q.api,Se=q.refetchQuery,Qe=q.internalState,pt={};function zt(ke,He){var St=ke.queryCacheKey,kt=He.getState()[Z].queries[St];if(kt&&kt.status!==t.uninitialized){var Rt=qe(Qe.currentSubscriptions[St]);if(Number.isFinite(Rt)){var Lt=pt[St];Lt!=null&&Lt.timeout&&(clearTimeout(Lt.timeout),Lt.timeout=void 0);var Ut=Date.now()+Rt,Ft=pt[St]={nextPollTimestamp:Ut,pollingInterval:Rt,timeout:setTimeout(function(){Ft.timeout=void 0,He.dispatch(Se(kt,St))},Rt)}}}}function lt(ke,He){var St=ke.queryCacheKey,kt=He.getState()[Z].queries[St];if(kt&&kt.status!==t.uninitialized){var Rt=qe(Qe.currentSubscriptions[St]);if(Number.isFinite(Rt)){var Lt=pt[St],Ut=Date.now()+Rt;(!Lt||Ut<Lt.nextPollTimestamp)&&zt({queryCacheKey:St},He)}else Be(St)}}function Be(ke){var He=pt[ke];He!=null&&He.timeout&&clearTimeout(He.timeout),delete pt[ke]}function qe(ke){ke===void 0&&(ke={});var He=Number.POSITIVE_INFINITY;for(var St in ke)ke[St].pollingInterval&&(He=Math.min(ke[St].pollingInterval,He));return He}return function(ke,He){(be.internalActions.updateSubscriptionOptions.match(ke)||be.internalActions.unsubscribeQueryResult.match(ke))&<(ke.payload,He),(de.pending.match(ke)||de.rejected.match(ke)&&ke.meta.condition)&<(ke.meta.arg,He),(de.fulfilled.match(ke)||de.rejected.match(ke)&&!ke.meta.condition)&&zt(ke.meta.arg,He),be.util.resetApiState.match(ke)&&function(){for(var St=0,kt=Object.keys(pt);St<kt.length;St++)Be(kt[St])}()}},En=E(Io),is=new Error("Promise never resolved before cacheEntryRemoved."),dn=function(q){var Z=q.api,de=q.reducerPath,be=q.context,Se=q.queryThunk,Qe=q.mutationThunk,pt=(0,En.isAsyncThunkAction)(Se),zt=(0,En.isAsyncThunkAction)(Qe),lt=(0,En.isFulfilled)(Se,Qe),Be={};function qe(ke,He,St,kt,Rt){var Lt=be.endpointDefinitions[ke],Ut=Lt==null?void 0:Lt.onCacheEntryAdded;if(Ut){var Ft={},Ee=new Promise(function(Vt){Ft.cacheEntryRemoved=Vt}),ht=Promise.race([new Promise(function(Vt){Ft.valueResolved=Vt}),Ee.then(function(){throw is})]);ht.catch(function(){}),Be[St]=Ft;var Tt=Z.endpoints[ke].select(Lt.type===ae.query?He:St),Mt=kt.dispatch(function(Vt,Qt,Cn){return Cn}),$t=k(C({},kt),{getCacheEntry:function(){return Tt(kt.getState())},requestId:Rt,extra:Mt,updateCachedData:Lt.type===ae.query?function(Vt){return kt.dispatch(Z.util.updateQueryData(ke,He,Vt))}:void 0,cacheDataLoaded:ht,cacheEntryRemoved:Ee}),fn=Ut(He,$t);Promise.resolve(fn).catch(function(Vt){if(Vt!==is)throw Vt})}}return function(ke,He,St){var kt=function(Tt){return pt(Tt)?Tt.meta.arg.queryCacheKey:zt(Tt)?Tt.meta.requestId:Z.internalActions.removeQueryResult.match(Tt)?Tt.payload.queryCacheKey:Z.internalActions.removeMutationResult.match(Tt)?te(Tt.payload):""}(ke);if(Se.pending.match(ke)){var Rt=St[de].queries[kt],Lt=He.getState()[de].queries[kt];!Rt&&Lt&&qe(ke.meta.arg.endpointName,ke.meta.arg.originalArgs,kt,He,ke.meta.requestId)}else if(Qe.pending.match(ke))(Lt=He.getState()[de].mutations[kt])&&qe(ke.meta.arg.endpointName,ke.meta.arg.originalArgs,kt,He,ke.meta.requestId);else if(lt(ke))(ht=Be[kt])!=null&&ht.valueResolved&&(ht.valueResolved({data:ke.payload,meta:ke.meta.baseQueryMeta}),delete ht.valueResolved);else if(Z.internalActions.removeQueryResult.match(ke)||Z.internalActions.removeMutationResult.match(ke))(ht=Be[kt])&&(delete Be[kt],ht.cacheEntryRemoved());else if(Z.util.resetApiState.match(ke))for(var Ut=0,Ft=Object.entries(Be);Ut<Ft.length;Ut++){var Ee=Ft[Ut],ht=Ee[1];delete Be[Ee[0]],ht.cacheEntryRemoved()}}},zo=E(Io),$o=function(q){var Z=q.api,de=q.context,be=q.queryThunk,Se=q.mutationThunk,Qe=(0,zo.isPending)(be,Se),pt=(0,zo.isRejected)(be,Se),zt=(0,zo.isFulfilled)(be,Se),lt={};return function(Be,qe){var ke,He,St;if(Qe(Be)){var kt=Be.meta,Rt=kt.requestId,Lt=kt.arg,Ut=Lt.endpointName,Ft=Lt.originalArgs,Ee=de.endpointDefinitions[Ut],ht=Ee==null?void 0:Ee.onQueryStarted;if(ht){var Tt={},Mt=new Promise(function(Xn,wt){Tt.resolve=Xn,Tt.reject=wt});Mt.catch(function(){}),lt[Rt]=Tt;var $t=Z.endpoints[Ut].select(Ee.type===ae.query?Ft:Rt),fn=qe.dispatch(function(Xn,wt,Sn){return Sn}),Vt=k(C({},qe),{getCacheEntry:function(){return $t(qe.getState())},requestId:Rt,extra:fn,updateCachedData:Ee.type===ae.query?function(Xn){return qe.dispatch(Z.util.updateQueryData(Ut,Ft,Xn))}:void 0,queryFulfilled:Mt});ht(Ft,Vt)}}else if(zt(Be)){var Qt=Be.meta,Cn=Qt.baseQueryMeta;(ke=lt[Rt=Qt.requestId])==null||ke.resolve({data:Be.payload,meta:Cn}),delete lt[Rt]}else if(pt(Be)){var Ir=Be.meta;Cn=Ir.baseQueryMeta,(St=lt[Rt=Ir.requestId])==null||St.reject({error:(He=Be.payload)!=null?He:Be.error,isUnhandledError:!Ir.rejectedWithValue,meta:Cn}),delete lt[Rt]}}},$n=function(q){var Z=q.api,de=q.context.apiUid;return function(be,Se){Z.util.resetApiState.match(be)&&Se.dispatch(Z.internalActions.middlewareRegistered(de))}},ls=E(Bc),Da=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof yl<"u"?yl:globalThis):function(q){return(Nt||(Nt=Promise.resolve())).then(q).catch(function(Z){return setTimeout(function(){throw Z},0)})};function Er(q){for(var Z=[],de=1;de<arguments.length;de++)Z[de-1]=arguments[de];Object.assign.apply(Object,o([q],Z))}var Lo=E(Bc),na=Symbol(),Aa=function(){return{name:na,init:function(q,Z,de){var be=Z.baseQuery,Se=Z.reducerPath,Qe=Z.serializeQueryArgs,pt=Z.keepUnusedDataFor,zt=Z.refetchOnMountOrArgChange,lt=Z.refetchOnFocus,Be=Z.refetchOnReconnect;(0,Lo.enablePatches)();var qe=function(wt){return wt};Object.assign(q,{reducerPath:Se,endpoints:{},internalActions:{onOnline:ve,onOffline:le,onFocus:U,onFocusLost:re},util:{}});var ke=function(wt){var Sn=this,_n=wt.reducerPath,Qn=wt.baseQuery,dr=wt.context.endpointDefinitions,Rn=wt.serializeQueryArgs,Tn=wt.api,tn=function(We,Pt){return O(Sn,[We,Pt],function(gt,tt){var mt,Dt,dt,Je,Ie,_e,Me,ze,Ze,Et,_t,$e,Gt,mn=tt.signal,on=tt.abort,fr=tt.rejectWithValue,Bn=tt.fulfillWithValue,an=tt.dispatch,Ln=tt.getState,eo=tt.extra;return r(this,function(nn){switch(nn.label){case 0:mt=dr[gt.endpointName],nn.label=1;case 1:return nn.trys.push([1,8,,13]),Dt=jt,dt=void 0,Je={signal:mn,abort:on,dispatch:an,getState:Ln,extra:eo,endpoint:gt.endpointName,type:gt.type,forced:gt.type==="query"?gn(gt,Ln()):void 0},(Ie=gt.type==="query"?gt[ye]:void 0)?(dt=Ie(),[3,6]):[3,2];case 2:return mt.query?[4,Qn(mt.query(gt.originalArgs),Je,mt.extraOptions)]:[3,4];case 3:return dt=nn.sent(),mt.transformResponse&&(Dt=mt.transformResponse),[3,6];case 4:return[4,mt.queryFn(gt.originalArgs,Je,mt.extraOptions,function(Mn){return Qn(Mn,Je,mt.extraOptions)})];case 5:dt=nn.sent(),nn.label=6;case 6:if(dt.error)throw new G(dt.error,dt.meta);return _e=Bn,[4,Dt(dt.data,dt.meta,gt.originalArgs)];case 7:return[2,_e.apply(void 0,[nn.sent(),($e={fulfilledTimeStamp:Date.now(),baseQueryMeta:dt.meta},$e[Ye.SHOULD_AUTOBATCH]=!0,$e)])];case 8:if(Me=nn.sent(),!((ze=Me)instanceof G))return[3,12];Ze=jt,mt.query&&mt.transformErrorResponse&&(Ze=mt.transformErrorResponse),nn.label=9;case 9:return nn.trys.push([9,11,,12]),Et=fr,[4,Ze(ze.value,ze.meta,gt.originalArgs)];case 10:return[2,Et.apply(void 0,[nn.sent(),(Gt={baseQueryMeta:ze.meta},Gt[Ye.SHOULD_AUTOBATCH]=!0,Gt)])];case 11:return _t=nn.sent(),ze=_t,[3,12];case 12:throw console.error(ze),ze;case 13:return[2]}})})};function gn(We,Pt){var gt,tt,mt,Dt,dt=(tt=(gt=Pt[_n])==null?void 0:gt.queries)==null?void 0:tt[We.queryCacheKey],Je=(mt=Pt[_n])==null?void 0:mt.config.refetchOnMountOrArgChange,Ie=dt==null?void 0:dt.fulfilledTimeStamp,_e=(Dt=We.forceRefetch)!=null?Dt:We.subscribe&&Je;return!!_e&&(_e===!0||(Number(new Date)-Number(Ie))/1e3>=_e)}var wn=(0,Ye.createAsyncThunk)(_n+"/executeQuery",tn,{getPendingMeta:function(){var We;return(We={startedTimeStamp:Date.now()})[Ye.SHOULD_AUTOBATCH]=!0,We},condition:function(We,Pt){var gt,tt,mt,Dt=(0,Pt.getState)(),dt=(tt=(gt=Dt[_n])==null?void 0:gt.queries)==null?void 0:tt[We.queryCacheKey],Je=dt==null?void 0:dt.fulfilledTimeStamp,Ie=We.originalArgs,_e=dt==null?void 0:dt.originalArgs,Me=dr[We.endpointName];return!(!Oe(We)&&((dt==null?void 0:dt.status)==="pending"||!gn(We,Dt)&&(!oe(Me)||!((mt=Me==null?void 0:Me.forceRefetch)!=null&&mt.call(Me,{currentArg:Ie,previousArg:_e,endpointState:dt,state:Dt})))&&Je))},dispatchConditionRejection:!0}),pn=(0,Ye.createAsyncThunk)(_n+"/executeMutation",tn,{getPendingMeta:function(){var We;return(We={startedTimeStamp:Date.now()})[Ye.SHOULD_AUTOBATCH]=!0,We}});function hn(We){return function(Pt){var gt,tt;return((tt=(gt=Pt==null?void 0:Pt.meta)==null?void 0:gt.arg)==null?void 0:tt.endpointName)===We}}return{queryThunk:wn,mutationThunk:pn,prefetch:function(We,Pt,gt){return function(tt,mt){var Dt=function(Me){return"force"in Me}(gt)&>.force,dt=function(Me){return"ifOlderThan"in Me}(gt)&>.ifOlderThan,Je=function(Me){return Me===void 0&&(Me=!0),Tn.endpoints[We].initiate(Pt,{forceRefetch:Me})},Ie=Tn.endpoints[We].select(Pt)(mt());if(Dt)tt(Je());else if(dt){var _e=Ie==null?void 0:Ie.fulfilledTimeStamp;if(!_e)return void tt(Je());(Number(new Date)-Number(new Date(_e)))/1e3>=dt&&tt(Je())}else tt(Je(!1))}},updateQueryData:function(We,Pt,gt){return function(tt,mt){var Dt,dt,Je=Tn.endpoints[We].select(Pt)(mt()),Ie={patches:[],inversePatches:[],undo:function(){return tt(Tn.util.patchQueryData(We,Pt,Ie.inversePatches))}};if(Je.status===t.uninitialized)return Ie;if("data"in Je)if((0,Fe.isDraftable)(Je.data)){var _e=(0,Fe.produceWithPatches)(Je.data,gt),Me=_e[2];(Dt=Ie.patches).push.apply(Dt,_e[1]),(dt=Ie.inversePatches).push.apply(dt,Me)}else{var ze=gt(Je.data);Ie.patches.push({op:"replace",path:[],value:ze}),Ie.inversePatches.push({op:"replace",path:[],value:Je.data})}return tt(Tn.util.patchQueryData(We,Pt,Ie.patches)),Ie}},upsertQueryData:function(We,Pt,gt){return function(tt){var mt;return tt(Tn.endpoints[We].initiate(Pt,((mt={subscribe:!1,forceRefetch:!0})[ye]=function(){return{data:gt}},mt)))}},patchQueryData:function(We,Pt,gt){return function(tt){tt(Tn.internalActions.queryResultPatched({queryCacheKey:Rn({queryArgs:Pt,endpointDefinition:dr[We],endpointName:We}),patches:gt}))}},buildMatchThunkActions:function(We,Pt){return{matchPending:(0,at.isAllOf)((0,at.isPending)(We),hn(Pt)),matchFulfilled:(0,at.isAllOf)((0,at.isFulfilled)(We),hn(Pt)),matchRejected:(0,at.isAllOf)((0,at.isRejected)(We),hn(Pt))}}}}({baseQuery:be,reducerPath:Se,context:de,api:q,serializeQueryArgs:Qe}),He=ke.queryThunk,St=ke.mutationThunk,kt=ke.patchQueryData,Rt=ke.updateQueryData,Lt=ke.upsertQueryData,Ut=ke.prefetch,Ft=ke.buildMatchThunkActions,Ee=function(wt){var Sn=wt.reducerPath,_n=wt.queryThunk,Qn=wt.mutationThunk,dr=wt.context,Rn=dr.endpointDefinitions,Tn=dr.apiUid,tn=dr.extractRehydrationInfo,gn=dr.hasRehydrationInfo,wn=wt.assertTagType,pn=wt.config,hn=(0,Pe.createAction)(Sn+"/resetApiState"),We=(0,Pe.createSlice)({name:Sn+"/queries",initialState:Ne,reducers:{removeQueryResult:{reducer:function(Je,Ie){delete Je[Ie.payload.queryCacheKey]},prepare:(0,Pe.prepareAutoBatched)()},queryResultPatched:function(Je,Ie){var _e=Ie.payload,Me=_e.patches;we(Je,_e.queryCacheKey,function(ze){ze.data=(0,X.applyPatches)(ze.data,Me.concat())})}},extraReducers:function(Je){Je.addCase(_n.pending,function(Ie,_e){var Me,ze=_e.meta,Ze=_e.meta.arg,Et=Oe(Ze);(Ze.subscribe||Et)&&(Ie[Me=Ze.queryCacheKey]!=null||(Ie[Me]={status:t.uninitialized,endpointName:Ze.endpointName})),we(Ie,Ze.queryCacheKey,function(_t){_t.status=t.pending,_t.requestId=Et&&_t.requestId?_t.requestId:ze.requestId,Ze.originalArgs!==void 0&&(_t.originalArgs=Ze.originalArgs),_t.startedTimeStamp=ze.startedTimeStamp})}).addCase(_n.fulfilled,function(Ie,_e){var Me=_e.meta,ze=_e.payload;we(Ie,Me.arg.queryCacheKey,function(Ze){var Et;if(Ze.requestId===Me.requestId||Oe(Me.arg)){var _t=Rn[Me.arg.endpointName].merge;if(Ze.status=t.fulfilled,_t)if(Ze.data!==void 0){var $e=Me.fulfilledTimeStamp,Gt=Me.arg,mn=Me.baseQueryMeta,on=Me.requestId,fr=(0,Pe.createNextState)(Ze.data,function(Bn){return _t(Bn,ze,{arg:Gt.originalArgs,baseQueryMeta:mn,fulfilledTimeStamp:$e,requestId:on})});Ze.data=fr}else Ze.data=ze;else Ze.data=(Et=Rn[Me.arg.endpointName].structuralSharing)==null||Et?T((0,Fn.isDraft)(Ze.data)?(0,X.original)(Ze.data):Ze.data,ze):ze;delete Ze.error,Ze.fulfilledTimeStamp=Me.fulfilledTimeStamp}})}).addCase(_n.rejected,function(Ie,_e){var Me=_e.meta,ze=Me.condition,Ze=Me.requestId,Et=_e.error,_t=_e.payload;we(Ie,Me.arg.queryCacheKey,function($e){if(!ze){if($e.requestId!==Ze)return;$e.status=t.rejected,$e.error=_t??Et}})}).addMatcher(gn,function(Ie,_e){for(var Me=tn(_e).queries,ze=0,Ze=Object.entries(Me);ze<Ze.length;ze++){var Et=Ze[ze],_t=Et[1];(_t==null?void 0:_t.status)!==t.fulfilled&&(_t==null?void 0:_t.status)!==t.rejected||(Ie[Et[0]]=_t)}})}}),Pt=(0,Pe.createSlice)({name:Sn+"/mutations",initialState:Ne,reducers:{removeMutationResult:{reducer:function(Je,Ie){var _e=te(Ie.payload);_e in Je&&delete Je[_e]},prepare:(0,Pe.prepareAutoBatched)()}},extraReducers:function(Je){Je.addCase(Qn.pending,function(Ie,_e){var Me=_e.meta,ze=Me.requestId,Ze=Me.arg,Et=Me.startedTimeStamp;Ze.track&&(Ie[te(_e.meta)]={requestId:ze,status:t.pending,endpointName:Ze.endpointName,startedTimeStamp:Et})}).addCase(Qn.fulfilled,function(Ie,_e){var Me=_e.payload,ze=_e.meta;ze.arg.track&&he(Ie,ze,function(Ze){Ze.requestId===ze.requestId&&(Ze.status=t.fulfilled,Ze.data=Me,Ze.fulfilledTimeStamp=ze.fulfilledTimeStamp)})}).addCase(Qn.rejected,function(Ie,_e){var Me=_e.payload,ze=_e.error,Ze=_e.meta;Ze.arg.track&&he(Ie,Ze,function(Et){Et.requestId===Ze.requestId&&(Et.status=t.rejected,Et.error=Me??ze)})}).addMatcher(gn,function(Ie,_e){for(var Me=tn(_e).mutations,ze=0,Ze=Object.entries(Me);ze<Ze.length;ze++){var Et=Ze[ze],_t=Et[0],$e=Et[1];($e==null?void 0:$e.status)!==t.fulfilled&&($e==null?void 0:$e.status)!==t.rejected||_t===($e==null?void 0:$e.requestId)||(Ie[_t]=$e)}})}}),gt=(0,Pe.createSlice)({name:Sn+"/invalidation",initialState:Ne,reducers:{},extraReducers:function(Je){Je.addCase(We.actions.removeQueryResult,function(Ie,_e){for(var Me=_e.payload.queryCacheKey,ze=0,Ze=Object.values(Ie);ze<Ze.length;ze++)for(var Et=0,_t=Object.values(Ze[ze]);Et<_t.length;Et++){var $e=_t[Et],Gt=$e.indexOf(Me);Gt!==-1&&$e.splice(Gt,1)}}).addMatcher(gn,function(Ie,_e){for(var Me,ze,Ze,Et,_t=tn(_e).provided,$e=0,Gt=Object.entries(_t);$e<Gt.length;$e++)for(var mn=Gt[$e],on=mn[0],fr=0,Bn=Object.entries(mn[1]);fr<Bn.length;fr++)for(var an=Bn[fr],Ln=an[0],eo=an[1],nn=(Et=(ze=(Me=Ie[on])!=null?Me:Ie[on]={})[Ze=Ln||"__internal_without_id"])!=null?Et:ze[Ze]=[],Mn=0,Lr=eo;Mn<Lr.length;Mn++){var Or=Lr[Mn];nn.includes(Or)||nn.push(Or)}}).addMatcher((0,Pe.isAnyOf)((0,Pe.isFulfilled)(_n),(0,Pe.isRejectedWithValue)(_n)),function(Ie,_e){for(var Me,ze,Ze,Et,_t=xt(_e,"providesTags",Rn,wn),$e=_e.meta.arg.queryCacheKey,Gt=0,mn=Object.values(Ie);Gt<mn.length;Gt++)for(var on=0,fr=Object.values(mn[Gt]);on<fr.length;on++){var Bn=fr[on],an=Bn.indexOf($e);an!==-1&&Bn.splice(an,1)}for(var Ln=0,eo=_t;Ln<eo.length;Ln++){var nn=eo[Ln],Mn=nn.type,Lr=nn.id,Or=(Et=(ze=(Me=Ie[Mn])!=null?Me:Ie[Mn]={})[Ze=Lr||"__internal_without_id"])!=null?Et:ze[Ze]=[];Or.includes($e)||Or.push($e)}})}}),tt=(0,Pe.createSlice)({name:Sn+"/subscriptions",initialState:Ne,reducers:{updateSubscriptionOptions:function(Je,Ie){},unsubscribeQueryResult:function(Je,Ie){},internal_probeSubscription:function(Je,Ie){}}}),mt=(0,Pe.createSlice)({name:Sn+"/internalSubscriptions",initialState:Ne,reducers:{subscriptionsUpdated:{reducer:function(Je,Ie){return(0,X.applyPatches)(Je,Ie.payload)},prepare:(0,Pe.prepareAutoBatched)()}}}),Dt=(0,Pe.createSlice)({name:Sn+"/config",initialState:C({online:typeof navigator>"u"||navigator.onLine===void 0||navigator.onLine,focused:typeof document>"u"||document.visibilityState!=="hidden",middlewareRegistered:!1},pn),reducers:{middlewareRegistered:function(Je,Ie){Je.middlewareRegistered=Je.middlewareRegistered!=="conflict"&&Tn===Ie.payload||"conflict"}},extraReducers:function(Je){Je.addCase(ve,function(Ie){Ie.online=!0}).addCase(le,function(Ie){Ie.online=!1}).addCase(U,function(Ie){Ie.focused=!0}).addCase(re,function(Ie){Ie.focused=!1}).addMatcher(gn,function(Ie){return C({},Ie)})}}),dt=(0,Pe.combineReducers)({queries:We.reducer,mutations:Pt.reducer,provided:gt.reducer,subscriptions:mt.reducer,config:Dt.reducer});return{reducer:function(Je,Ie){return dt(hn.match(Ie)?void 0:Je,Ie)},actions:k(C(C(C(C(C({},Dt.actions),We.actions),tt.actions),mt.actions),Pt.actions),{unsubscribeMutationResult:Pt.actions.removeMutationResult,resetApiState:hn})}}({context:de,queryThunk:He,mutationThunk:St,reducerPath:Se,assertTagType:qe,config:{refetchOnFocus:lt,refetchOnReconnect:Be,refetchOnMountOrArgChange:zt,keepUnusedDataFor:pt,reducerPath:Se}}),ht=Ee.reducer,Tt=Ee.actions;Er(q.util,{patchQueryData:kt,updateQueryData:Rt,upsertQueryData:Lt,prefetch:Ut,resetApiState:Tt.resetApiState}),Er(q.internalActions,Tt);var Mt=function(wt){var Sn=wt.reducerPath,_n=wt.queryThunk,Qn=wt.api,dr=wt.context,Rn=dr.apiUid,Tn={invalidateTags:(0,yr.createAction)(Sn+"/invalidateTags")},tn=[$n,un,Cr,Pn,dn,$o];return{middleware:function(wn){var pn=!1,hn=k(C({},wt),{internalState:{currentSubscriptions:{}},refetchQuery:gn}),We=tn.map(function(tt){return tt(hn)}),Pt=function(tt){var mt=tt.api,Dt=tt.queryThunk,dt=tt.internalState,Je=mt.reducerPath+"/subscriptions",Ie=null,_e=!1,Me=mt.internalActions,ze=Me.updateSubscriptionOptions,Ze=Me.unsubscribeQueryResult;return function(Et,_t){var $e,Gt;if(Ie||(Ie=JSON.parse(JSON.stringify(dt.currentSubscriptions))),mt.util.resetApiState.match(Et))return Ie=dt.currentSubscriptions={},[!0,!1];if(mt.internalActions.internal_probeSubscription.match(Et)){var mn=Et.payload;return[!1,!!(($e=dt.currentSubscriptions[mn.queryCacheKey])!=null&&$e[mn.requestId])]}var on=function(an,Ln){var eo,nn,Mn,Lr,Or,Na,nd,Po,ra;if(ze.match(Ln)){var Ds=Ln.payload,oa=Ds.queryCacheKey,to=Ds.requestId;return(eo=an==null?void 0:an[oa])!=null&&eo[to]&&(an[oa][to]=Ds.options),!0}if(Ze.match(Ln)){var no=Ln.payload;return to=no.requestId,an[oa=no.queryCacheKey]&&delete an[oa][to],!0}if(mt.internalActions.removeQueryResult.match(Ln))return delete an[Ln.payload.queryCacheKey],!0;if(Dt.pending.match(Ln)){var ro=Ln.meta;if(to=ro.requestId,(Vr=ro.arg).subscribe)return(Fo=(Mn=an[nn=Vr.queryCacheKey])!=null?Mn:an[nn]={})[to]=(Or=(Lr=Vr.subscriptionOptions)!=null?Lr:Fo[to])!=null?Or:{},!0}if(Dt.rejected.match(Ln)){var Fo,_o=Ln.meta,Vr=_o.arg;if(to=_o.requestId,_o.condition&&Vr.subscribe)return(Fo=(nd=an[Na=Vr.queryCacheKey])!=null?nd:an[Na]={})[to]=(ra=(Po=Vr.subscriptionOptions)!=null?Po:Fo[to])!=null?ra:{},!0}return!1}(dt.currentSubscriptions,Et);if(on){_e||(Da(function(){var an=JSON.parse(JSON.stringify(dt.currentSubscriptions)),Ln=(0,ls.produceWithPatches)(Ie,function(){return an});_t.next(mt.internalActions.subscriptionsUpdated(Ln[1])),Ie=an,_e=!1}),_e=!0);var fr=!!((Gt=Et.type)!=null&&Gt.startsWith(Je)),Bn=Dt.rejected.match(Et)&&Et.meta.condition&&!!Et.meta.arg.subscribe;return[!fr&&!Bn,!1]}return[!0,!1]}}(hn),gt=function(tt){var mt=tt.reducerPath,Dt=tt.context,dt=tt.refetchQuery,Je=tt.internalState,Ie=tt.api.internalActions.removeQueryResult;function _e(Me,ze){var Ze=Me.getState()[mt],Et=Ze.queries,_t=Je.currentSubscriptions;Dt.batch(function(){for(var $e=0,Gt=Object.keys(_t);$e<Gt.length;$e++){var mn=Gt[$e],on=Et[mn],fr=_t[mn];fr&&on&&(Object.values(fr).some(function(Bn){return Bn[ze]===!0})||Object.values(fr).every(function(Bn){return Bn[ze]===void 0})&&Ze.config[ze])&&(Object.keys(fr).length===0?Me.dispatch(Ie({queryCacheKey:mn})):on.status!==t.uninitialized&&Me.dispatch(dt(on,mn)))}})}return function(Me,ze){U.match(Me)&&_e(ze,"refetchOnFocus"),ve.match(Me)&&_e(ze,"refetchOnReconnect")}}(hn);return function(tt){return function(mt){pn||(pn=!0,wn.dispatch(Qn.internalActions.middlewareRegistered(Rn)));var Dt,dt=k(C({},wn),{next:tt}),Je=wn.getState(),Ie=Pt(mt,dt,Je),_e=Ie[1];if(Dt=Ie[0]?tt(mt):_e,wn.getState()[Sn]&&(gt(mt,dt,Je),function(Ze){return!!Ze&&typeof Ze.type=="string"&&Ze.type.startsWith(Sn+"/")}(mt)||dr.hasRehydrationInfo(mt)))for(var Me=0,ze=We;Me<ze.length;Me++)(0,ze[Me])(mt,dt,Je);return Dt}}},actions:Tn};function gn(wn,pn,hn){return hn===void 0&&(hn={}),_n(C({type:"query",endpointName:wn.endpointName,originalArgs:wn.originalArgs,subscribe:!1,forceRefetch:!0,queryCacheKey:pn},hn))}}({reducerPath:Se,context:de,queryThunk:He,mutationThunk:St,api:q,assertTagType:qe}),$t=Mt.middleware;Er(q.util,Mt.actions),Er(q,{reducer:ht,middleware:$t});var fn=function(wt){var Sn=wt.serializeQueryArgs,_n=wt.reducerPath,Qn=function(tn){return ln},dr=function(tn){return kn};return{buildQuerySelector:function(tn,gn){return function(wn){var pn=Sn({queryArgs:wn,endpointDefinition:gn,endpointName:tn});return(0,xe.createSelector)(wn===Xe?Qn:function(hn){var We,Pt,gt;return(gt=(Pt=(We=Tn(hn))==null?void 0:We.queries)==null?void 0:Pt[pn])!=null?gt:ln},Rn)}},buildMutationSelector:function(){return function(tn){var gn,wn;return wn=typeof tn=="object"?(gn=te(tn))!=null?gn:Xe:tn,(0,xe.createSelector)(wn===Xe?dr:function(pn){var hn,We,Pt;return(Pt=(We=(hn=Tn(pn))==null?void 0:hn.mutations)==null?void 0:We[wn])!=null?Pt:kn},Rn)}},selectInvalidatedBy:function(tn,gn){for(var wn,pn=tn[_n],hn=new Set,We=0,Pt=gn.map(fe);We<Pt.length;We++){var gt=Pt[We],tt=pn.provided[gt.type];if(tt)for(var mt=0,Dt=(wn=gt.id!==void 0?tt[gt.id]:I(Object.values(tt)))!=null?wn:[];mt<Dt.length;mt++)hn.add(Dt[mt])}return I(Array.from(hn.values()).map(function(dt){var Je=pn.queries[dt];return Je?[{queryCacheKey:dt,endpointName:Je.endpointName,originalArgs:Je.originalArgs}]:[]}))}};function Rn(tn){return C(C({},tn),{status:gn=tn.status,isUninitialized:gn===t.uninitialized,isLoading:gn===t.pending,isSuccess:gn===t.fulfilled,isError:gn===t.rejected});var gn}function Tn(tn){return tn[_n]}}({serializeQueryArgs:Qe,reducerPath:Se}),Vt=fn.buildQuerySelector,Qt=fn.buildMutationSelector;Er(q.util,{selectInvalidatedBy:fn.selectInvalidatedBy});var Cn=function(wt){var Sn=wt.serializeQueryArgs,_n=wt.queryThunk,Qn=wt.mutationThunk,dr=wt.api,Rn=wt.context,Tn=new Map,tn=new Map,gn=dr.internalActions,wn=gn.unsubscribeQueryResult,pn=gn.removeMutationResult,hn=gn.updateSubscriptionOptions;return{buildInitiateQuery:function(We,Pt){var gt=function(tt,mt){var Dt=mt===void 0?{}:mt,dt=Dt.subscribe,Je=dt===void 0||dt,Ie=Dt.forceRefetch,_e=Dt.subscriptionOptions,Me=Dt[ye];return function(ze,Ze){var Et,_t,$e=Sn({queryArgs:tt,endpointDefinition:Pt,endpointName:We}),Gt=_n(((Et={type:"query",subscribe:Je,forceRefetch:Ie,subscriptionOptions:_e,endpointName:We,originalArgs:tt,queryCacheKey:$e})[ye]=Me,Et)),mn=dr.endpoints[We].select(tt),on=ze(Gt),fr=mn(Ze()),Bn=on.requestId,an=on.abort,Ln=fr.requestId!==Bn,eo=(_t=Tn.get(ze))==null?void 0:_t[$e],nn=function(){return mn(Ze())},Mn=Object.assign(Me?on.then(nn):Ln&&!eo?Promise.resolve(fr):Promise.all([eo,on]).then(nn),{arg:tt,requestId:Bn,subscriptionOptions:_e,queryCacheKey:$e,abort:an,unwrap:function(){return O(this,null,function(){var Or;return r(this,function(Na){switch(Na.label){case 0:return[4,Mn];case 1:if((Or=Na.sent()).isError)throw Or.error;return[2,Or.data]}})})},refetch:function(){return ze(gt(tt,{subscribe:!1,forceRefetch:!0}))},unsubscribe:function(){Je&&ze(wn({queryCacheKey:$e,requestId:Bn}))},updateSubscriptionOptions:function(Or){Mn.subscriptionOptions=Or,ze(hn({endpointName:We,requestId:Bn,queryCacheKey:$e,options:Or}))}});if(!eo&&!Ln&&!Me){var Lr=Tn.get(ze)||{};Lr[$e]=Mn,Tn.set(ze,Lr),Mn.then(function(){delete Lr[$e],Object.keys(Lr).length||Tn.delete(ze)})}return Mn}};return gt},buildInitiateMutation:function(We){return function(Pt,gt){var tt=gt===void 0?{}:gt,mt=tt.track,Dt=mt===void 0||mt,dt=tt.fixedCacheKey;return function(Je,Ie){var _e=Qn({type:"mutation",endpointName:We,originalArgs:Pt,track:Dt,fixedCacheKey:dt}),Me=Je(_e),ze=Me.requestId,Ze=Me.abort,Et=Me.unwrap,_t=Me.unwrap().then(function(on){return{data:on}}).catch(function(on){return{error:on}}),$e=function(){Je(pn({requestId:ze,fixedCacheKey:dt}))},Gt=Object.assign(_t,{arg:Me.arg,requestId:ze,abort:Ze,unwrap:Et,unsubscribe:$e,reset:$e}),mn=tn.get(Je)||{};return tn.set(Je,mn),mn[ze]=Gt,Gt.then(function(){delete mn[ze],Object.keys(mn).length||tn.delete(Je)}),dt&&(mn[dt]=Gt,Gt.then(function(){mn[dt]===Gt&&(delete mn[dt],Object.keys(mn).length||tn.delete(Je))})),Gt}}},getRunningQueryThunk:function(We,Pt){return function(gt){var tt,mt=Sn({queryArgs:Pt,endpointDefinition:Rn.endpointDefinitions[We],endpointName:We});return(tt=Tn.get(gt))==null?void 0:tt[mt]}},getRunningMutationThunk:function(We,Pt){return function(gt){var tt;return(tt=tn.get(gt))==null?void 0:tt[Pt]}},getRunningQueriesThunk:function(){return function(We){return Object.values(Tn.get(We)||{}).filter(Ae)}},getRunningMutationsThunk:function(){return function(We){return Object.values(tn.get(We)||{}).filter(Ae)}},getRunningOperationPromises:function(){var We=function(Pt){return Array.from(Pt.values()).flatMap(function(gt){return gt?Object.values(gt):[]})};return o(o([],We(Tn)),We(tn)).filter(Ae)},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:He,mutationThunk:St,api:q,serializeQueryArgs:Qe,context:de}),Ir=Cn.buildInitiateQuery,Xn=Cn.buildInitiateMutation;return Er(q.util,{getRunningOperationPromises:Cn.getRunningOperationPromises,getRunningOperationPromise:Cn.removalWarning,getRunningMutationThunk:Cn.getRunningMutationThunk,getRunningMutationsThunk:Cn.getRunningMutationsThunk,getRunningQueryThunk:Cn.getRunningQueryThunk,getRunningQueriesThunk:Cn.getRunningQueriesThunk}),{name:na,injectEndpoint:function(wt,Sn){var _n,Qn=q;(_n=Qn.endpoints)[wt]!=null||(_n[wt]={}),oe(Sn)?Er(Qn.endpoints[wt],{name:wt,select:Vt(wt,Sn),initiate:Ir(wt,Sn)},Ft(He,wt)):Sn.type===ae.mutation&&Er(Qn.endpoints[wt],{name:wt,select:Qt(),initiate:Xn(wt)},Ft(St,wt))}}}}},cs=it(Aa())})(_k);Pk.exports=_k;var Do=Pk.exports;const m$=e=>{const{isOver:t,label:n="Drop"}=e,r=p.useRef(Ai()),{colorMode:o}=So();return a.jsx(bo.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}},children:a.jsxs(H,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full"},children:[a.jsx(H,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",bg:Te("base.700","base.900")(o),opacity:.7,borderRadius:"base",alignItems:"center",justifyContent:"center",transitionProperty:"common",transitionDuration:"0.1s"}}),a.jsx(H,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",opacity:1,borderWidth:3,borderColor:t?Te("base.50","base.200")(o):Te("base.100","base.500")(o),borderRadius:"base",borderStyle:"dashed",transitionProperty:"common",transitionDuration:"0.1s",alignItems:"center",justifyContent:"center"},children:a.jsx(Ue,{sx:{fontSize:"2xl",fontWeight:600,transform:t?"scale(1.02)":"scale(1)",color:t?Te("base.50","base.50")(o):Te("base.100","base.200")(o),transitionProperty:"common",transitionDuration:"0.1s"},children:n})})]})},r.current)},Zl=p.memo(m$),jk=p.memo(({board:e,isSelected:t})=>{const n=ne(),{currentData:r}=Ks(e.cover_image_name??Do.skipToken),{colorMode:o}=So(),{board_name:s,board_id:i}=e,{onClickDeleteBoardImages:u}=p.useContext(f3),d=p.useCallback(()=>{n(p3(i))},[i,n]),[f,{isLoading:h}]=zO(),[m,{isLoading:v}]=$O(),y=E=>{f({board_id:i,changes:{board_name:E}})},S=p.useCallback(()=>{m(i)},[i,m]),w=p.useCallback(()=>{console.log({board:e}),u(e)},[e,u]),C={id:i,actionType:"MOVE_BOARD",context:{boardId:i}},{isOver:k,setNodeRef:P,active:j}=Du({id:`board_droppable_${i}`,data:C});return a.jsx(Ge,{sx:{touchAction:"none",height:"full"},children:a.jsx(kk,{menuProps:{size:"sm",isLazy:!0},renderMenu:()=>a.jsxs(Wu,{sx:{visibility:"visible !important"},children:[e.image_count>0&&a.jsx(Yr,{sx:{color:"error.300"},icon:a.jsx(io,{}),onClickCapture:w,children:"Delete Board and Images"}),a.jsx(Yr,{sx:{color:Te("error.700","error.300")(o)},icon:a.jsx(io,{}),onClickCapture:S,children:"Delete Board"})]}),children:E=>a.jsxs(H,{userSelect:"none",ref:E,sx:{flexDir:"column",justifyContent:"space-between",alignItems:"center",cursor:"pointer",w:"full",h:"full"},children:[a.jsxs(H,{ref:P,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)&&a.jsx(Au,{src:r==null?void 0:r.image_url,draggable:!1}),!(e.cover_image_name&&(r!=null&&r.image_url))&&a.jsx(xc,{boxSize:8,icon:lu,sx:{border:"2px solid var(--invokeai-colors-base-200)",_dark:{border:"2px solid var(--invokeai-colors-base-800)"}}}),a.jsx(H,{sx:{position:"absolute",insetInlineEnd:0,top:0,p:1},children:a.jsx(Ql,{variant:"solid",children:e.image_count})}),a.jsx(No,{children:Kl(C,j)&&a.jsx(Zl,{isOver:k})})]}),a.jsx(H,{sx:{width:"full",height:"full",justifyContent:"center",alignItems:"center"},children:a.jsxs(E5,{defaultValue:s,submitOnBlur:!1,onSubmit:O=>{y(O)},children:[a.jsx(P5,{sx:{color:t?Te("base.900","base.50")(o):Te("base.700","base.200")(o),fontWeight:t?600:void 0,fontSize:"xs",textAlign:"center",p:0},noOfLines:1}),a.jsx(k5,{sx:{color:Te("base.900","base.50")(o),fontSize:"xs",borderColor:Te("base.500","base.500")(o),p:0,outline:0}})]})})]},i)})})});jk.displayName="HoverableBoard";/*!
|
||
* OverlayScrollbars
|
||
* Version: 2.2.0
|
||
*
|
||
* Copyright (c) Rene Haas | KingSora.
|
||
* https://github.com/KingSora
|
||
*
|
||
* Released under the MIT license.
|
||
*/function bn(e,t){if(Nh(e))for(let n=0;n<e.length&&t(e[n],n,e)!==!1;n++);else e&&bn(Object.keys(e),n=>t(e[n],n,e));return e}function Qr(e,t){const n=di(t);if(Is(t)||n){let o=n?"":{};if(e){const s=window.getComputedStyle(e,null);o=n?eS(e,s,t):t.reduce((i,u)=>(i[u]=eS(e,s,u),i),o)}return o}e&&bn(Ao(t),o=>R$(e,o,t[o]))}const gs=(e,t)=>{const{o:n,u:r,_:o}=e;let s=n,i;const u=(h,m)=>{const v=s,y=h,S=m||(r?!r(v,y):v!==y);return(S||o)&&(s=y,i=v),[s,S,i]};return[t?h=>u(t(s,i),h):u,h=>[s,!!h,i]]},Xu=()=>typeof window<"u",Ek=Xu()&&Node.ELEMENT_NODE,{toString:g$,hasOwnProperty:zg}=Object.prototype,Ta=e=>e===void 0,Ah=e=>e===null,v$=e=>Ta(e)||Ah(e)?`${e}`:g$.call(e).replace(/^\[object (.+)\]$/,"$1").toLowerCase(),si=e=>typeof e=="number",di=e=>typeof e=="string",z1=e=>typeof e=="boolean",Es=e=>typeof e=="function",Is=e=>Array.isArray(e),Cu=e=>typeof e=="object"&&!Is(e)&&!Ah(e),Nh=e=>{const t=!!e&&e.length,n=si(t)&&t>-1&&t%1==0;return Is(e)||!Es(e)&&n?t>0&&Cu(e)?t-1 in e:!0:!1},Zv=e=>{if(!e||!Cu(e)||v$(e)!=="object")return!1;let t;const n="constructor",r=e[n],o=r&&r.prototype,s=zg.call(e,n),i=o&&zg.call(o,"isPrototypeOf");if(r&&!s&&!i)return!1;for(t in e);return Ta(t)||zg.call(e,t)},ap=e=>{const t=HTMLElement;return e?t?e instanceof t:e.nodeType===Ek:!1},zh=e=>{const t=Element;return e?t?e instanceof t:e.nodeType===Ek:!1},$1=(e,t,n)=>e.indexOf(t,n),On=(e,t,n)=>(!n&&!di(t)&&Nh(t)?Array.prototype.push.apply(e,t):e.push(t),e),Gi=e=>{const t=Array.from,n=[];return t&&e?t(e):(e instanceof Set?e.forEach(r=>{On(n,r)}):bn(e,r=>{On(n,r)}),n)},L1=e=>!!e&&e.length===0,ea=(e,t,n)=>{bn(e,o=>o&&o.apply(void 0,t||[])),!n&&(e.length=0)},$h=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Ao=e=>e?Object.keys(e):[],cr=(e,t,n,r,o,s,i)=>{const u=[t,n,r,o,s,i];return(typeof e!="object"||Ah(e))&&!Es(e)&&(e={}),bn(u,d=>{bn(Ao(d),f=>{const h=d[f];if(e===h)return!0;const m=Is(h);if(h&&(Zv(h)||m)){const v=e[f];let y=v;m&&!Is(v)?y=[]:!m&&!Zv(v)&&(y={}),e[f]=cr(y,h)}else e[f]=h})}),e},F1=e=>{for(const t in e)return!1;return!0},Ik=(e,t,n,r)=>{if(Ta(r))return n?n[e]:t;n&&(di(r)||si(r))&&(n[e]=r)},Xr=(e,t,n)=>{if(Ta(n))return e?e.getAttribute(t):null;e&&e.setAttribute(t,n)},po=(e,t)=>{e&&e.removeAttribute(t)},$i=(e,t,n,r)=>{if(n){const o=Xr(e,t)||"",s=new Set(o.split(" "));s[r?"add":"delete"](n);const i=Gi(s).join(" ").trim();Xr(e,t,i)}},y$=(e,t,n)=>{const r=Xr(e,t)||"";return new Set(r.split(" ")).has(n)},Ss=(e,t)=>Ik("scrollLeft",0,e,t),pa=(e,t)=>Ik("scrollTop",0,e,t),Jv=Xu()&&Element.prototype,Ok=(e,t)=>{const n=[],r=t?zh(t)?t:null:document;return r?On(n,r.querySelectorAll(e)):n},b$=(e,t)=>{const n=t?zh(t)?t:null:document;return n?n.querySelector(e):null},ip=(e,t)=>zh(e)?(Jv.matches||Jv.msMatchesSelector).call(e,t):!1,B1=e=>e?Gi(e.childNodes):[],Pa=e=>e?e.parentElement:null,Tl=(e,t)=>{if(zh(e)){const n=Jv.closest;if(n)return n.call(e,t);do{if(ip(e,t))return e;e=Pa(e)}while(e)}return null},x$=(e,t,n)=>{const r=e&&Tl(e,t),o=e&&b$(n,r),s=Tl(o,t)===r;return r&&o?r===e||o===e||s&&Tl(Tl(e,n),t)!==r:!1},H1=(e,t,n)=>{if(n&&e){let r=t,o;Nh(n)?(o=document.createDocumentFragment(),bn(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)}},Jo=(e,t)=>{H1(e,null,t)},S$=(e,t)=>{H1(Pa(e),e,t)},Q2=(e,t)=>{H1(Pa(e),e&&e.nextSibling,t)},Qs=e=>{if(Nh(e))bn(Gi(e),t=>Qs(t));else if(e){const t=Pa(e);t&&t.removeChild(e)}},Li=e=>{const t=document.createElement("div");return e&&Xr(t,"class",e),t},Rk=e=>{const t=Li();return t.innerHTML=e.trim(),bn(B1(t),n=>Qs(n))},e0=e=>e.charAt(0).toUpperCase()+e.slice(1),w$=()=>Li().style,C$=["-webkit-","-moz-","-o-","-ms-"],k$=["WebKit","Moz","O","MS","webkit","moz","o","ms"],$g={},Lg={},P$=e=>{let t=Lg[e];if($h(Lg,e))return t;const n=e0(e),r=w$();return bn(C$,o=>{const s=o.replace(/-/g,"");return!(t=[e,o+e,s+n,e0(s)+n].find(u=>r[u]!==void 0))}),Lg[e]=t||""},Qu=e=>{if(Xu()){let t=$g[e]||window[e];return $h($g,e)||(bn(k$,n=>(t=t||window[n+e0(e)],!t)),$g[e]=t),t}},_$=Qu("MutationObserver"),Z2=Qu("IntersectionObserver"),Ml=Qu("ResizeObserver"),Tk=Qu("cancelAnimationFrame"),Mk=Qu("requestAnimationFrame"),lp=Xu()&&window.setTimeout,t0=Xu()&&window.clearTimeout,j$=/[^\x20\t\r\n\f]+/g,Dk=(e,t,n)=>{const r=e&&e.classList;let o,s=0,i=!1;if(r&&t&&di(t)){const u=t.match(j$)||[];for(i=u.length>0;o=u[s++];)i=!!n(r,o)&&i}return i},W1=(e,t)=>{Dk(e,t,(n,r)=>n.remove(r))},ha=(e,t)=>(Dk(e,t,(n,r)=>n.add(r)),W1.bind(0,e,t)),Lh=(e,t,n,r)=>{if(e&&t){let o=!0;return bn(n,s=>{const i=r?r(e[s]):e[s],u=r?r(t[s]):t[s];i!==u&&(o=!1)}),o}return!1},Ak=(e,t)=>Lh(e,t,["w","h"]),Nk=(e,t)=>Lh(e,t,["x","y"]),E$=(e,t)=>Lh(e,t,["t","r","b","l"]),J2=(e,t,n)=>Lh(e,t,["width","height"],n&&(r=>Math.round(r))),Zo=()=>{},Ol=e=>{let t;const n=e?lp:Mk,r=e?t0:Tk;return[o=>{r(t),t=n(o,Es(e)?e():e)},()=>r(t)]},V1=(e,t)=>{let n,r,o,s=Zo;const{v:i,g:u,p:d}=t||{},f=function(S){s(),t0(n),n=r=void 0,s=Zo,e.apply(this,S)},h=y=>d&&r?d(r,y):y,m=()=>{s!==Zo&&f(h(o)||o)},v=function(){const S=Gi(arguments),w=Es(i)?i():i;if(si(w)&&w>=0){const k=Es(u)?u():u,P=si(k)&&k>=0,j=w>0?lp:Mk,E=w>0?t0:Tk,I=h(S)||S,R=f.bind(0,I);s();const T=j(R,w);s=()=>E(T),P&&!n&&(n=lp(m,k)),r=o=I}else f(S)};return v.m=m,v},I$={opacity:1,zindex:1},Kd=(e,t)=>{const n=t?parseFloat(e):parseInt(e,10);return n===n?n:0},O$=(e,t)=>!I$[e.toLowerCase()]&&si(t)?`${t}px`:t,eS=(e,t,n)=>t!=null?t[n]||t.getPropertyValue(n):e.style[n],R$=(e,t,n)=>{try{const{style:r}=e;Ta(r[t])?r.setProperty(t,n):r[t]=O$(t,n)}catch{}},ku=e=>Qr(e,"direction")==="rtl",tS=(e,t,n)=>{const r=t?`${t}-`:"",o=n?`-${n}`:"",s=`${r}top${o}`,i=`${r}right${o}`,u=`${r}bottom${o}`,d=`${r}left${o}`,f=Qr(e,[s,i,u,d]);return{t:Kd(f[s],!0),r:Kd(f[i],!0),b:Kd(f[u],!0),l:Kd(f[d],!0)}},{round:nS}=Math,U1={w:0,h:0},qi=e=>e?{w:e.offsetWidth,h:e.offsetHeight}:U1,Af=e=>e?{w:e.clientWidth,h:e.clientHeight}:U1,cp=e=>e?{w:e.scrollWidth,h:e.scrollHeight}:U1,up=e=>{const t=parseFloat(Qr(e,"height"))||0,n=parseFloat(Qr(e,"width"))||0;return{w:n-nS(n),h:t-nS(t)}},Ja=e=>e.getBoundingClientRect();let Yd;const T$=()=>{if(Ta(Yd)){Yd=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get(){Yd=!0}}))}catch{}}return Yd},zk=e=>e.split(" "),M$=(e,t,n,r)=>{bn(zk(t),o=>{e.removeEventListener(o,n,r)})},Dr=(e,t,n,r)=>{var o;const s=T$(),i=(o=s&&r&&r.S)!=null?o:s,u=r&&r.$||!1,d=r&&r.C||!1,f=[],h=s?{passive:i,capture:u}:u;return bn(zk(t),m=>{const v=d?y=>{e.removeEventListener(m,v,u),n&&n(y)}:n;On(f,M$.bind(null,e,m,v,u)),e.addEventListener(m,v,h)}),ea.bind(0,f)},$k=e=>e.stopPropagation(),Lk=e=>e.preventDefault(),D$={x:0,y:0},Fg=e=>{const t=e?Ja(e):0;return t?{x:t.left+window.pageYOffset,y:t.top+window.pageXOffset}:D$},rS=(e,t)=>{bn(Is(t)?t:[t],e)},G1=e=>{const t=new Map,n=(s,i)=>{if(s){const u=t.get(s);rS(d=>{u&&u[d?"delete":"clear"](d)},i)}else t.forEach(u=>{u.clear()}),t.clear()},r=(s,i)=>{if(di(s)){const f=t.get(s)||new Set;return t.set(s,f),rS(h=>{Es(h)&&f.add(h)},i),n.bind(0,s,i)}z1(i)&&i&&n();const u=Ao(s),d=[];return bn(u,f=>{const h=s[f];h&&On(d,r(f,h))}),ea.bind(0,d)},o=(s,i)=>{const u=t.get(s);bn(Gi(u),d=>{i&&!L1(i)?d.apply(0,i):d()})};return r(e||{}),[r,n,o]},oS=e=>JSON.stringify(e,(t,n)=>{if(Es(n))throw new Error;return n}),A$={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"]}},Fk=(e,t)=>{const n={},r=Ao(t).concat(Ao(e));return bn(r,o=>{const s=e[o],i=t[o];if(Cu(s)&&Cu(i))cr(n[o]={},Fk(s,i)),F1(n[o])&&delete n[o];else if($h(t,o)&&i!==s){let u=!0;if(Is(s)||Is(i))try{oS(s)===oS(i)&&(u=!1)}catch{}u&&(n[o]=i)}}),n},Bk="os-environment",Hk=`${Bk}-flexbox-glue`,N$=`${Hk}-max`,Wk="os-scrollbar-hidden",Bg="data-overlayscrollbars-initialize",vs="data-overlayscrollbars",Vk=`${vs}-overflow-x`,Uk=`${vs}-overflow-y`,Wl="overflowVisible",z$="scrollbarHidden",sS="scrollbarPressed",dp="updating",Ya="data-overlayscrollbars-viewport",Hg="arrange",Gk="scrollbarHidden",Vl=Wl,n0="data-overlayscrollbars-padding",$$=Vl,aS="data-overlayscrollbars-content",q1="os-size-observer",L$=`${q1}-appear`,F$=`${q1}-listener`,B$="os-trinsic-observer",H$="os-no-css-vars",W$="os-theme-none",wo="os-scrollbar",V$=`${wo}-rtl`,U$=`${wo}-horizontal`,G$=`${wo}-vertical`,qk=`${wo}-track`,K1=`${wo}-handle`,q$=`${wo}-visible`,K$=`${wo}-cornerless`,iS=`${wo}-transitionless`,lS=`${wo}-interaction`,cS=`${wo}-unusable`,uS=`${wo}-auto-hidden`,dS=`${wo}-wheel`,Y$=`${qk}-interactive`,X$=`${K1}-interactive`,Kk={},Ki=()=>Kk,Q$=e=>{const t=[];return bn(Is(e)?e:[e],n=>{const r=Ao(n);bn(r,o=>{On(t,Kk[o]=n[o])})}),t},Z$="__osOptionsValidationPlugin",J$="__osSizeObserverPlugin",Y1="__osScrollbarsHidingPlugin",eL="__osClickScrollPlugin";let Wg;const fS=(e,t,n,r)=>{Jo(e,t);const o=Af(t),s=qi(t),i=up(n);return r&&Qs(t),{x:s.h-o.h+i.h,y:s.w-o.w+i.w}},tL=e=>{let t=!1;const n=ha(e,Wk);try{t=Qr(e,P$("scrollbar-width"))==="none"||window.getComputedStyle(e,"::-webkit-scrollbar").getPropertyValue("display")==="none"}catch{}return n(),t},nL=(e,t)=>{const n="hidden";Qr(e,{overflowX:n,overflowY:n,direction:"rtl"}),Ss(e,0);const r=Fg(e),o=Fg(t);Ss(e,-999);const s=Fg(t);return{i:r.x===o.x,n:o.x!==s.x}},rL=(e,t)=>{const n=ha(e,Hk),r=Ja(e),o=Ja(t),s=J2(o,r,!0),i=ha(e,N$),u=Ja(e),d=Ja(t),f=J2(d,u,!0);return n(),i(),s&&f},oL=()=>{const{body:e}=document,n=Rk(`<div class="${Bk}"><div></div></div>`)[0],r=n.firstChild,[o,,s]=G1(),[i,u]=gs({o:fS(e,n,r),u:Nk},fS.bind(0,e,n,r,!0)),[d]=u(),f=tL(n),h={x:d.x===0,y:d.y===0},m={elements:{host:null,padding:!f,viewport:P=>f&&P===P.ownerDocument.body&&P,content:!1},scrollbars:{slot:!0},cancel:{nativeScrollbarsOverlaid:!1,body:null}},v=cr({},A$),y=cr.bind(0,{},v),S=cr.bind(0,{},m),w={k:d,A:h,I:f,L:Qr(n,"zIndex")==="-1",B:nL(n,r),V:rL(n,r),Y:o.bind(0,"z"),j:o.bind(0,"r"),N:S,q:P=>cr(m,P)&&S(),F:y,G:P=>cr(v,P)&&y(),X:cr({},m),U:cr({},v)},C=window.addEventListener,k=V1(P=>s(P?"z":"r"),{v:33,g:99});if(po(n,"style"),Qs(n),C("resize",k.bind(0,!1)),!f&&(!h.x||!h.y)){let P;C("resize",()=>{const j=Ki()[Y1];P=P||j&&j.R(),P&&P(w,i,k.bind(0,!0))})}return w},Co=()=>(Wg||(Wg=oL()),Wg),X1=(e,t)=>Es(t)?t.apply(0,e):t,sL=(e,t,n,r)=>{const o=Ta(r)?n:r;return X1(e,o)||t.apply(0,e)},Yk=(e,t,n,r)=>{const o=Ta(r)?n:r,s=X1(e,o);return!!s&&(ap(s)?s:t.apply(0,e))},aL=(e,t,n)=>{const{nativeScrollbarsOverlaid:r,body:o}=n||{},{A:s,I:i}=Co(),{nativeScrollbarsOverlaid:u,body:d}=t,f=r??u,h=Ta(o)?d:o,m=(s.x||s.y)&&f,v=e&&(Ah(h)?!i:h);return!!m||!!v},Q1=new WeakMap,iL=(e,t)=>{Q1.set(e,t)},lL=e=>{Q1.delete(e)},Xk=e=>Q1.get(e),pS=(e,t)=>e?t.split(".").reduce((n,r)=>n&&$h(n,r)?n[r]:void 0,e):void 0,r0=(e,t,n)=>r=>[pS(e,r),n||pS(t,r)!==void 0],Qk=e=>{let t=e;return[()=>t,n=>{t=cr({},t,n)}]},Xd="tabindex",Qd=Li.bind(0,""),Vg=e=>{Jo(Pa(e),B1(e)),Qs(e)},cL=e=>{const t=Co(),{N:n,I:r}=t,o=Ki()[Y1],s=o&&o.T,{elements:i}=n(),{host:u,padding:d,viewport:f,content:h}=i,m=ap(e),v=m?{}:e,{elements:y}=v,{host:S,padding:w,viewport:C,content:k}=y||{},P=m?e:v.target,j=ip(P,"textarea"),E=P.ownerDocument,O=E.documentElement,I=P===E.body,R=E.defaultView,T=sL.bind(0,[P]),D=Yk.bind(0,[P]),$=X1.bind(0,[P]),A=T.bind(0,Qd,f),J=D.bind(0,Qd,h),z=A(C),B=z===P,G=B&&I,K=!B&&J(k),N=!B&&ap(z)&&z===K,V=N&&!!$(h),W=V?A():z,U=V?K:J(),ve=G?O:N?W:z,le=j?T(Qd,u,S):P,se=G?ve:le,Y=N?U:K,ae=E.activeElement,ue=!B&&R.top===R&&ae===P,xe={W:P,Z:se,J:ve,K:!B&&D(Qd,d,w),tt:Y,nt:!B&&!r&&s&&s(t),ot:G?O:ve,st:G?E:ve,et:R,ct:E,rt:j,it:I,lt:m,ut:B,dt:N,ft:(X,we)=>y$(ve,B?vs:Ya,B?we:X),_t:(X,we,te)=>$i(ve,B?vs:Ya,B?we:X,te)},oe=Ao(xe).reduce((X,we)=>{const te=xe[we];return On(X,te&&!Pa(te)?te:!1)},[]),ge=X=>X?$1(oe,X)>-1:null,{W:fe,Z:Pe,K:Ae,J:ye,tt:Oe,nt:at}=xe,Fe=[()=>{po(Pe,vs),po(Pe,Bg),po(fe,Bg),I&&(po(O,vs),po(O,Bg))}],Ye=j&&ge(Pe);let jt=j?fe:B1([Oe,ye,Ae,Pe,fe].find(X=>ge(X)===!1));const xt=G?fe:Oe||ye;return[xe,()=>{Xr(Pe,vs,B?"viewport":"host"),Xr(Ae,n0,""),Xr(Oe,aS,""),B||Xr(ye,Ya,"");const X=I&&!B?ha(Pa(P),Wk):Zo;if(Ye&&(Q2(fe,Pe),On(Fe,()=>{Q2(Pe,fe),Qs(Pe)})),Jo(xt,jt),Jo(Pe,Ae),Jo(Ae||Pe,!B&&ye),Jo(ye,Oe),On(Fe,()=>{X(),po(Ae,n0),po(Oe,aS),po(ye,Vk),po(ye,Uk),po(ye,Ya),ge(Oe)&&Vg(Oe),ge(ye)&&Vg(ye),ge(Ae)&&Vg(Ae)}),r&&!B&&($i(ye,Ya,Gk,!0),On(Fe,po.bind(0,ye,Ya))),at&&(S$(ye,at),On(Fe,Qs.bind(0,at))),ue){const we=Xr(ye,Xd);Xr(ye,Xd,"-1"),ye.focus();const te=()=>we?Xr(ye,Xd,we):po(ye,Xd),he=Dr(E,"pointerdown keydown",()=>{te(),he()});On(Fe,[te,he])}else ae&&ae.focus&&ae.focus();jt=0},ea.bind(0,Fe)]},uL=(e,t)=>{const{tt:n}=e,[r]=t;return o=>{const{V:s}=Co(),{ht:i}=r(),{vt:u}=o,d=(n||!s)&&u;return d&&Qr(n,{height:i?"":"100%"}),{gt:d,wt:d}}},dL=(e,t)=>{const[n,r]=t,{Z:o,K:s,J:i,ut:u}=e,[d,f]=gs({u:E$,o:tS()},tS.bind(0,o,"padding",""));return(h,m,v)=>{let[y,S]=f(v);const{I:w,V:C}=Co(),{bt:k}=n(),{gt:P,wt:j,yt:E}=h,[O,I]=m("paddingAbsolute");(P||S||!C&&j)&&([y,S]=d(v));const T=!u&&(I||E||S);if(T){const D=!O||!s&&!w,$=y.r+y.l,A=y.t+y.b,J={marginRight:D&&!k?-$:0,marginBottom:D?-A:0,marginLeft:D&&k?-$:0,top:D?-y.t:0,right:D?k?-y.r:"auto":0,left:D?k?"auto":-y.l:0,width:D?`calc(100% + ${$}px)`:""},z={paddingTop:D?y.t:0,paddingRight:D?y.r:0,paddingBottom:D?y.b:0,paddingLeft:D?y.l:0};Qr(s||i,J),Qr(i,z),r({K:y,St:!D,P:s?z:cr({},J,z)})}return{xt:T}}},{max:o0}=Math,Xa=o0.bind(0,0),Zk="visible",hS="hidden",fL=42,Zd={u:Ak,o:{w:0,h:0}},pL={u:Nk,o:{x:hS,y:hS}},hL=(e,t)=>{const n=window.devicePixelRatio%1!==0?1:0,r={w:Xa(e.w-t.w),h:Xa(e.h-t.h)};return{w:r.w>n?r.w:0,h:r.h>n?r.h:0}},Jd=e=>e.indexOf(Zk)===0,mL=(e,t)=>{const[n,r]=t,{Z:o,K:s,J:i,nt:u,ut:d,_t:f,it:h,et:m}=e,{k:v,V:y,I:S,A:w}=Co(),C=Ki()[Y1],k=!d&&!S&&(w.x||w.y),P=h&&d,[j,E]=gs(Zd,up.bind(0,i)),[O,I]=gs(Zd,cp.bind(0,i)),[R,T]=gs(Zd),[D,$]=gs(Zd),[A]=gs(pL),J=(V,W)=>{if(Qr(i,{height:""}),W){const{St:U,K:re}=n(),{$t:ve,D:le}=V,se=up(o),Y=Af(o),ae=Qr(i,"boxSizing")==="content-box",ue=U||ae?re.b+re.t:0,xe=!(w.x&&ae);Qr(i,{height:Y.h+se.h+(ve.x&&xe?le.x:0)-ue})}},z=(V,W)=>{const U=!S&&!V?fL:0,re=(ge,fe,Pe)=>{const Ae=Qr(i,ge),Oe=(W?W[ge]:Ae)==="scroll";return[Ae,Oe,Oe&&!S?fe?U:Pe:0,fe&&!!U]},[ve,le,se,Y]=re("overflowX",w.x,v.x),[ae,ue,xe,oe]=re("overflowY",w.y,v.y);return{Ct:{x:ve,y:ae},$t:{x:le,y:ue},D:{x:se,y:xe},M:{x:Y,y:oe}}},B=(V,W,U,re)=>{const ve=(ue,xe)=>{const oe=Jd(ue),ge=xe&&oe&&ue.replace(`${Zk}-`,"")||"";return[xe&&!oe?ue:"",Jd(ge)?"hidden":ge]},[le,se]=ve(U.x,W.x),[Y,ae]=ve(U.y,W.y);return re.overflowX=se&&Y?se:le,re.overflowY=ae&&le?ae:Y,z(V,re)},G=(V,W,U,re)=>{const{D:ve,M:le}=V,{x:se,y:Y}=le,{x:ae,y:ue}=ve,{P:xe}=n(),oe=W?"marginLeft":"marginRight",ge=W?"paddingLeft":"paddingRight",fe=xe[oe],Pe=xe.marginBottom,Ae=xe[ge],ye=xe.paddingBottom;re.width=`calc(100% + ${ue+-1*fe}px)`,re[oe]=-ue+fe,re.marginBottom=-ae+Pe,U&&(re[ge]=Ae+(Y?ue:0),re.paddingBottom=ye+(se?ae:0))},[K,N]=C?C.H(k,y,i,u,n,z,G):[()=>k,()=>[Zo]];return(V,W,U)=>{const{gt:re,Ot:ve,wt:le,xt:se,vt:Y,yt:ae}=V,{ht:ue,bt:xe}=n(),[oe,ge]=W("showNativeOverlaidScrollbars"),[fe,Pe]=W("overflow"),Ae=oe&&w.x&&w.y,ye=!d&&!y&&(re||le||ve||ge||Y),Oe=Jd(fe.x),at=Jd(fe.y),Fe=Oe||at;let Ye=E(U),jt=I(U),xt=T(U),Fn=$(U),X;if(ge&&S&&f(Gk,z$,!Ae),ye&&(X=z(Ae),J(X,ue)),re||se||le||ae||ge){Fe&&f(Vl,Wl,!1);const[Re,et]=N(Ae,xe,X),[it,ut]=Ye=j(U),[Nt,yr]=jt=O(U),un=Af(i);let xn=Nt,Cr=un;Re(),(yr||ut||ge)&&et&&!Ae&&K(et,Nt,it,xe)&&(Cr=Af(i),xn=cp(i));const Pn={w:Xa(o0(Nt.w,xn.w)+it.w),h:Xa(o0(Nt.h,xn.h)+it.h)},En={w:Xa((P?m.innerWidth:Cr.w+Xa(un.w-Nt.w))+it.w),h:Xa((P?m.innerHeight+it.h:Cr.h+Xa(un.h-Nt.h))+it.h)};Fn=D(En),xt=R(hL(Pn,En),U)}const[we,te]=Fn,[he,Ne]=xt,[Xe,yt]=jt,[Xt,ln]=Ye,kn={x:he.w>0,y:he.h>0},vr=Oe&&at&&(kn.x||kn.y)||Oe&&kn.x&&!kn.y||at&&kn.y&&!kn.x;if(se||ae||ln||yt||te||Ne||Pe||ge||ye){const Re={marginRight:0,marginBottom:0,marginLeft:0,width:"",overflowY:"",overflowX:""},et=B(Ae,kn,fe,Re),it=K(et,Xe,Xt,xe);d||G(et,xe,it,Re),ye&&J(et,ue),d?(Xr(o,Vk,Re.overflowX),Xr(o,Uk,Re.overflowY)):Qr(i,Re)}$i(o,vs,Wl,vr),$i(s,n0,$$,vr),d||$i(i,Ya,Vl,Fe);const[cn,Yn]=A(z(Ae).Ct);return r({Ct:cn,zt:{x:we.w,y:we.h},Tt:{x:he.w,y:he.h},Et:kn}),{It:Yn,At:te,Lt:Ne}}},mS=(e,t,n)=>{const r={},o=t||{},s=Ao(e).concat(Ao(o));return bn(s,i=>{const u=e[i],d=o[i];r[i]=!!(n||u||d)}),r},gL=(e,t)=>{const{W:n,J:r,_t:o,ut:s}=e,{I:i,A:u,V:d}=Co(),f=!i&&(u.x||u.y),h=[uL(e,t),dL(e,t),mL(e,t)];return(m,v,y)=>{const S=mS(cr({gt:!1,xt:!1,yt:!1,vt:!1,At:!1,Lt:!1,It:!1,Ot:!1,wt:!1},v),{},y),w=f||!d,C=w&&Ss(r),k=w&&pa(r);o("",dp,!0);let P=S;return bn(h,j=>{P=mS(P,j(P,m,!!y)||{},y)}),Ss(r,C),pa(r,k),o("",dp),s||(Ss(n,0),pa(n,0)),P}},vL=(e,t,n)=>{let r,o=!1;const s=()=>{o=!0},i=u=>{if(n){const d=n.reduce((f,h)=>{if(h){const[m,v]=h,y=v&&m&&(u?u(m):Ok(m,e));y&&y.length&&v&&di(v)&&On(f,[y,v.trim()],!0)}return f},[]);bn(d,f=>bn(f[0],h=>{const m=f[1],v=r.get(h)||[];if(e.contains(h)){const S=Dr(h,m,w=>{o?(S(),r.delete(h)):t(w)});r.set(h,On(v,S))}else ea(v),r.delete(h)}))}};return n&&(r=new WeakMap,i()),[s,i]},gS=(e,t,n,r)=>{let o=!1;const{Ht:s,Pt:i,Dt:u,Mt:d,Rt:f,kt:h}=r||{},m=V1(()=>{o&&n(!0)},{v:33,g:99}),[v,y]=vL(e,m,u),S=s||[],w=i||[],C=S.concat(w),k=(j,E)=>{const O=f||Zo,I=h||Zo,R=new Set,T=new Set;let D=!1,$=!1;if(bn(j,A=>{const{attributeName:J,target:z,type:B,oldValue:G,addedNodes:K,removedNodes:N}=A,V=B==="attributes",W=B==="childList",U=e===z,re=V&&di(J)?Xr(z,J):0,ve=re!==0&&G!==re,le=$1(w,J)>-1&&ve;if(t&&(W||!U)){const se=!V,Y=V&&ve,ae=Y&&d&&ip(z,d),xe=(ae?!O(z,J,G,re):se||Y)&&!I(A,!!ae,e,r);bn(K,oe=>R.add(oe)),bn(N,oe=>R.add(oe)),$=$||xe}!t&&U&&ve&&!O(z,J,G,re)&&(T.add(J),D=D||le)}),R.size>0&&y(A=>Gi(R).reduce((J,z)=>(On(J,Ok(A,z)),ip(z,A)?On(J,z):J),[])),t)return!E&&$&&n(!1),[!1];if(T.size>0||D){const A=[Gi(T),D];return!E&&n.apply(0,A),A}},P=new _$(j=>k(j));return P.observe(e,{attributes:!0,attributeOldValue:!0,attributeFilter:C,subtree:t,childList:t,characterData:t}),o=!0,[()=>{o&&(v(),P.disconnect(),o=!1)},()=>{if(o){m.m();const j=P.takeRecords();return!L1(j)&&k(j,!0)}}]},ef=3333333,tf=e=>e&&(e.height||e.width),Jk=(e,t,n)=>{const{Bt:r=!1,Vt:o=!1}=n||{},s=Ki()[J$],{B:i}=Co(),d=Rk(`<div class="${q1}"><div class="${F$}"></div></div>`)[0],f=d.firstChild,h=ku.bind(0,e),[m]=gs({o:void 0,_:!0,u:(w,C)=>!(!w||!tf(w)&&tf(C))}),v=w=>{const C=Is(w)&&w.length>0&&Cu(w[0]),k=!C&&z1(w[0]);let P=!1,j=!1,E=!0;if(C){const[O,,I]=m(w.pop().contentRect),R=tf(O),T=tf(I);P=!I||!R,j=!T&&R,E=!P}else k?[,E]=w:j=w===!0;if(r&&E){const O=k?w[0]:ku(d);Ss(d,O?i.n?-ef:i.i?0:ef:ef),pa(d,ef)}P||t({gt:!k,Yt:k?w:void 0,Vt:!!j})},y=[];let S=o?v:!1;return[()=>{ea(y),Qs(d)},()=>{if(Ml){const w=new Ml(v);w.observe(f),On(y,()=>{w.disconnect()})}else if(s){const[w,C]=s.O(f,v,o);S=w,On(y,C)}if(r){const[w]=gs({o:void 0},h);On(y,Dr(d,"scroll",C=>{const k=w(),[P,j,E]=k;j&&(W1(f,"ltr rtl"),P?ha(f,"rtl"):ha(f,"ltr"),v([!!P,j,E])),$k(C)}))}S&&(ha(d,L$),On(y,Dr(d,"animationstart",S,{C:!!Ml}))),(Ml||s)&&Jo(e,d)}]},yL=e=>e.h===0||e.isIntersecting||e.intersectionRatio>0,bL=(e,t)=>{let n;const r=Li(B$),o=[],[s]=gs({o:!1}),i=(d,f)=>{if(d){const h=s(yL(d)),[,m]=h;if(m)return!f&&t(h),[h]}},u=(d,f)=>{if(d&&d.length>0)return i(d.pop(),f)};return[()=>{ea(o),Qs(r)},()=>{if(Z2)n=new Z2(d=>u(d),{root:e}),n.observe(r),On(o,()=>{n.disconnect()});else{const d=()=>{const m=qi(r);i(m)},[f,h]=Jk(r,d);On(o,f),h(),d()}Jo(e,r)},()=>{if(n)return u(n.takeRecords(),!0)}]},vS=`[${vs}]`,xL=`[${Ya}]`,Ug=["tabindex"],yS=["wrap","cols","rows"],Gg=["id","class","style","open"],SL=(e,t,n)=>{let r,o,s;const{Z:i,J:u,tt:d,rt:f,ut:h,ft:m,_t:v}=e,{V:y}=Co(),[S]=gs({u:Ak,o:{w:0,h:0}},()=>{const B=m(Vl,Wl),G=m(Hg,""),K=G&&Ss(u),N=G&&pa(u);v(Vl,Wl),v(Hg,""),v("",dp,!0);const V=cp(d),W=cp(u),U=up(u);return v(Vl,Wl,B),v(Hg,"",G),v("",dp),Ss(u,K),pa(u,N),{w:W.w+V.w+U.w,h:W.h+V.h+U.h}}),w=f?yS:Gg.concat(yS),C=V1(n,{v:()=>r,g:()=>o,p(B,G){const[K]=B,[N]=G;return[Ao(K).concat(Ao(N)).reduce((V,W)=>(V[W]=K[W]||N[W],V),{})]}}),k=B=>{bn(B||Ug,G=>{if($1(Ug,G)>-1){const K=Xr(i,G);di(K)?Xr(u,G,K):po(u,G)}})},P=(B,G)=>{const[K,N]=B,V={vt:N};return t({ht:K}),!G&&n(V),V},j=({gt:B,Yt:G,Vt:K})=>{const N=!B||K?n:C;let V=!1;if(G){const[W,U]=G;V=U,t({bt:W})}N({gt:B,yt:V})},E=(B,G)=>{const[,K]=S(),N={wt:K};return K&&!G&&(B?n:C)(N),N},O=(B,G,K)=>{const N={Ot:G};return G?!K&&C(N):h||k(B),N},[I,R,T]=d||!y?bL(i,P):[Zo,Zo,Zo],[D,$]=h?[Zo,Zo]:Jk(i,j,{Vt:!0,Bt:!0}),[A,J]=gS(i,!1,O,{Pt:Gg,Ht:Gg.concat(Ug)}),z=h&&Ml&&new Ml(j.bind(0,{gt:!0}));return z&&z.observe(i),k(),[()=>{I(),D(),s&&s[0](),z&&z.disconnect(),A()},()=>{$(),R()},()=>{const B={},G=J(),K=T(),N=s&&s[1]();return G&&cr(B,O.apply(0,On(G,!0))),K&&cr(B,P.apply(0,On(K,!0))),N&&cr(B,E.apply(0,On(N,!0))),B},B=>{const[G]=B("update.ignoreMutation"),[K,N]=B("update.attributes"),[V,W]=B("update.elementEvents"),[U,re]=B("update.debounce"),ve=W||N,le=se=>Es(G)&&G(se);if(ve&&(s&&(s[1](),s[0]()),s=gS(d||u,!0,E,{Ht:w.concat(K||[]),Dt:V,Mt:vS,kt:(se,Y)=>{const{target:ae,attributeName:ue}=se;return(!Y&&ue&&!h?x$(ae,vS,xL):!1)||!!Tl(ae,`.${wo}`)||!!le(se)}})),re)if(C.m(),Is(U)){const se=U[0],Y=U[1];r=si(se)&&se,o=si(Y)&&Y}else si(U)?(r=U,o=!1):(r=!1,o=!1)}]},bS={x:0,y:0},wL=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:bS,Tt:bS,Ct:{x:"hidden",y:"hidden"},Et:{x:!1,y:!1},ht:!1,bt:ku(e.Z)}),CL=(e,t)=>{const n=r0(t,{}),[r,o,s]=G1(),[i,u,d]=cL(e),f=Qk(wL(i)),[h,m]=f,v=gL(i,f),y=(j,E,O)=>{const R=Ao(j).some(T=>j[T])||!F1(E)||O;return R&&s("u",[j,E,O]),R},[S,w,C,k]=SL(i,m,j=>y(v(n,j),{},!1)),P=h.bind(0);return P.jt=j=>r("u",j),P.Nt=()=>{const{W:j,J:E}=i,O=Ss(j),I=pa(j);w(),u(),Ss(E,O),pa(E,I)},P.qt=i,[(j,E)=>{const O=r0(t,j,E);return k(O),y(v(O,C(),E),j,!!E)},P,()=>{o(),S(),d()}]},{round:xS}=Math,kL=e=>{const{width:t,height:n}=Ja(e),{w:r,h:o}=qi(e);return{x:xS(t)/r||1,y:xS(n)/o||1}},PL=(e,t,n)=>{const r=t.scrollbars,{button:o,isPrimary:s,pointerType:i}=e,{pointers:u}=r;return o===0&&s&&r[n?"dragScroll":"clickScroll"]&&(u||[]).includes(i)},_L=(e,t)=>Dr(e,"mousedown",Dr.bind(0,t,"click",$k,{C:!0,$:!0}),{$:!0}),SS="pointerup pointerleave pointercancel lostpointercapture",jL=(e,t,n,r,o,s,i)=>{const{B:u}=Co(),{Ft:d,Gt:f,Xt:h}=r,m=`scroll${i?"Left":"Top"}`,v=`client${i?"X":"Y"}`,y=i?"width":"height",S=i?"left":"top",w=i?"w":"h",C=i?"x":"y",k=(P,j)=>E=>{const{Tt:O}=s(),I=qi(f)[w]-qi(d)[w],T=j*E/I*O[C],$=ku(h)&&i?u.n||u.i?1:-1:1;o[m]=P+T*$};return Dr(f,"pointerdown",P=>{const j=Tl(P.target,`.${K1}`)===d,E=j?d:f;if($i(t,vs,sS,!0),PL(P,e,j)){const O=!j&&P.shiftKey,I=()=>Ja(d),R=()=>Ja(f),T=(W,U)=>(W||I())[S]-(U||R())[S],D=k(o[m]||0,1/kL(o)[C]),$=P[v],A=I(),J=R(),z=A[y],B=T(A,J)+z/2,G=$-J[S],K=j?0:G-B,N=W=>{ea(V),E.releasePointerCapture(W.pointerId)},V=[$i.bind(0,t,vs,sS),Dr(n,SS,N),Dr(n,"selectstart",W=>Lk(W),{S:!1}),Dr(f,SS,N),Dr(f,"pointermove",W=>{const U=W[v]-$;(j||O)&&D(K+U)})];if(O)D(K);else if(!j){const W=Ki()[eL];W&&On(V,W.O(D,T,K,z,G))}E.setPointerCapture(P.pointerId)}})},EL=(e,t)=>(n,r,o,s,i,u)=>{const{Xt:d}=n,[f,h]=Ol(333),m=!!i.scrollBy;let v=!0;return ea.bind(0,[Dr(d,"pointerenter",()=>{r(lS,!0)}),Dr(d,"pointerleave pointercancel",()=>{r(lS)}),Dr(d,"wheel",y=>{const{deltaX:S,deltaY:w,deltaMode:C}=y;m&&v&&C===0&&Pa(d)===s&&i.scrollBy({left:S,top:w,behavior:"smooth"}),v=!1,r(dS,!0),f(()=>{v=!0,r(dS)}),Lk(y)},{S:!1,$:!0}),_L(d,o),jL(e,s,o,n,i,t,u),h])},{min:s0,max:wS,abs:IL,round:OL}=Math,eP=(e,t,n,r)=>{if(r){const u=n?"x":"y",{Tt:d,zt:f}=r,h=f[u],m=d[u];return wS(0,s0(1,h/(h+m)))}const o=n?"w":"h",s=qi(e)[o],i=qi(t)[o];return wS(0,s0(1,s/i))},RL=(e,t,n,r,o,s)=>{const{B:i}=Co(),u=s?"x":"y",d=s?"Left":"Top",{Tt:f}=r,h=OL(f[u]),m=IL(n[`scroll${d}`]),v=s&&o,y=i.i?m:h-m,w=s0(1,(v?y:m)/h),C=eP(e,t,s);return 1/C*(1-C)*w},TL=(e,t,n)=>{const{N:r,L:o}=Co(),{scrollbars:s}=r(),{slot:i}=s,{ct:u,W:d,Z:f,J:h,lt:m,ot:v,it:y,ut:S}=t,{scrollbars:w}=m?{}:e,{slot:C}=w||{},k=Yk([d,f,h],()=>S&&y?d:f,i,C),P=(K,N,V)=>{const W=V?ha:W1;bn(K,U=>{W(U.Xt,N)})},j=(K,N)=>{bn(K,V=>{const[W,U]=N(V);Qr(W,U)})},E=(K,N,V)=>{j(K,W=>{const{Ft:U,Gt:re}=W;return[U,{[V?"width":"height"]:`${(100*eP(U,re,V,N)).toFixed(3)}%`}]})},O=(K,N,V)=>{const W=V?"X":"Y";j(K,U=>{const{Ft:re,Gt:ve,Xt:le}=U,se=RL(re,ve,v,N,ku(le),V);return[re,{transform:se===se?`translate${W}(${(100*se).toFixed(3)}%)`:""}]})},I=[],R=[],T=[],D=(K,N,V)=>{const W=z1(V),U=W?V:!0,re=W?!V:!0;U&&P(R,K,N),re&&P(T,K,N)},$=K=>{E(R,K,!0),E(T,K)},A=K=>{O(R,K,!0),O(T,K)},J=K=>{const N=K?U$:G$,V=K?R:T,W=L1(V)?iS:"",U=Li(`${wo} ${N} ${W}`),re=Li(qk),ve=Li(K1),le={Xt:U,Gt:re,Ft:ve};return o||ha(U,H$),Jo(U,re),Jo(re,ve),On(V,le),On(I,[Qs.bind(0,U),n(le,D,u,f,v,K)]),le},z=J.bind(0,!0),B=J.bind(0,!1),G=()=>{Jo(k,R[0].Xt),Jo(k,T[0].Xt),lp(()=>{D(iS)},300)};return z(),B(),[{Ut:$,Wt:A,Zt:D,Jt:{Kt:R,Qt:z,tn:j.bind(0,R)},nn:{Kt:T,Qt:B,tn:j.bind(0,T)}},G,ea.bind(0,I)]},ML=(e,t,n,r)=>{let o,s,i,u,d,f=0;const h=Qk({}),[m]=h,[v,y]=Ol(),[S,w]=Ol(),[C,k]=Ol(100),[P,j]=Ol(100),[E,O]=Ol(()=>f),[I,R,T]=TL(e,n.qt,EL(t,n)),{Z:D,J:$,ot:A,st:J,ut:z,it:B}=n.qt,{Jt:G,nn:K,Zt:N,Ut:V,Wt:W}=I,{tn:U}=G,{tn:re}=K,ve=ue=>{const{Xt:xe}=ue,oe=z&&!B&&Pa(xe)===$&&xe;return[oe,{transform:oe?`translate(${Ss(A)}px, ${pa(A)}px)`:""}]},le=(ue,xe)=>{if(O(),ue)N(uS);else{const oe=()=>N(uS,!0);f>0&&!xe?E(oe):oe()}},se=()=>{u=s,u&&le(!0)},Y=[k,O,j,w,y,T,Dr(D,"pointerover",se,{C:!0}),Dr(D,"pointerenter",se),Dr(D,"pointerleave",()=>{u=!1,s&&le(!1)}),Dr(D,"pointermove",()=>{o&&v(()=>{k(),le(!0),P(()=>{o&&le(!1)})})}),Dr(J,"scroll",ue=>{S(()=>{W(n()),i&&le(!0),C(()=>{i&&!u&&le(!1)})}),r(ue),z&&U(ve),z&&re(ve)})],ae=m.bind(0);return ae.qt=I,ae.Nt=R,[(ue,xe,oe)=>{const{At:ge,Lt:fe,It:Pe,yt:Ae}=oe,{A:ye}=Co(),Oe=r0(t,ue,xe),at=n(),{Tt:Fe,Ct:Ye,bt:jt}=at,[xt,Fn]=Oe("showNativeOverlaidScrollbars"),[X,we]=Oe("scrollbars.theme"),[te,he]=Oe("scrollbars.visibility"),[Ne,Xe]=Oe("scrollbars.autoHide"),[yt]=Oe("scrollbars.autoHideDelay"),[Xt,ln]=Oe("scrollbars.dragScroll"),[kn,vr]=Oe("scrollbars.clickScroll"),cn=ge||fe||Ae,Yn=Pe||he,Re=xt&&ye.x&&ye.y,et=(it,ut)=>{const Nt=te==="visible"||te==="auto"&&it==="scroll";return N(q$,Nt,ut),Nt};if(f=yt,Fn&&N(W$,Re),we&&(N(d),N(X,!0),d=X),Xe&&(o=Ne==="move",s=Ne==="leave",i=Ne!=="never",le(!i,!0)),ln&&N(X$,Xt),vr&&N(Y$,kn),Yn){const it=et(Ye.x,!0),ut=et(Ye.y,!1);N(K$,!(it&&ut))}cn&&(V(at),W(at),N(cS,!Fe.x,!0),N(cS,!Fe.y,!1),N(V$,jt&&!B))},ae,ea.bind(0,Y)]},tP=(e,t,n)=>{Es(e)&&e(t||void 0,n||void 0)},ei=(e,t,n)=>{const{F:r,N:o,Y:s,j:i}=Co(),u=Ki(),d=ap(e),f=d?e:e.target,h=Xk(f);if(t&&!h){let m=!1;const v=z=>{const B=Ki()[Z$],G=B&&B.O;return G?G(z,!0):z},y=cr({},r(),v(t)),[S,w,C]=G1(n),[k,P,j]=CL(e,y),[E,O,I]=ML(e,y,P,z=>C("scroll",[J,z])),R=(z,B)=>k(z,!!B),T=R.bind(0,{},!0),D=s(T),$=i(T),A=z=>{lL(f),D(),$(),I(),j(),m=!0,C("destroyed",[J,!!z]),w()},J={options(z,B){if(z){const G=B?r():{},K=Fk(y,cr(G,v(z)));F1(K)||(cr(y,K),R(K))}return cr({},y)},on:S,off:(z,B)=>{z&&B&&w(z,B)},state(){const{zt:z,Tt:B,Ct:G,Et:K,K:N,St:V,bt:W}=P();return cr({},{overflowEdge:z,overflowAmount:B,overflowStyle:G,hasOverflow:K,padding:N,paddingAbsolute:V,directionRTL:W,destroyed:m})},elements(){const{W:z,Z:B,K:G,J:K,tt:N,ot:V,st:W}=P.qt,{Jt:U,nn:re}=O.qt,ve=se=>{const{Ft:Y,Gt:ae,Xt:ue}=se;return{scrollbar:ue,track:ae,handle:Y}},le=se=>{const{Kt:Y,Qt:ae}=se,ue=ve(Y[0]);return cr({},ue,{clone:()=>{const xe=ve(ae());return E({},!0,{}),xe}})};return cr({},{target:z,host:B,padding:G||K,viewport:K,content:N||K,scrollOffsetElement:V,scrollEventElement:W,scrollbarHorizontal:le(U),scrollbarVertical:le(re)})},update:z=>R({},z),destroy:A.bind(0)};return P.jt((z,B,G)=>{E(B,G,z)}),iL(f,J),bn(Ao(u),z=>tP(u[z],0,J)),aL(P.qt.it,o().cancel,!d&&e.cancel)?(A(!0),J):(P.Nt(),O.Nt(),C("initialized",[J]),P.jt((z,B,G)=>{const{gt:K,yt:N,vt:V,At:W,Lt:U,It:re,wt:ve,Ot:le}=z;C("updated",[J,{updateHints:{sizeChanged:K,directionChanged:N,heightIntrinsicChanged:V,overflowEdgeChanged:W,overflowAmountChanged:U,overflowStyleChanged:re,contentMutation:ve,hostMutation:le},changedOptions:B,force:G}])}),J.update(!0),J)}return h};ei.plugin=e=>{bn(Q$(e),t=>tP(t,ei))};ei.valid=e=>{const t=e&&e.elements,n=Es(t)&&t();return Zv(n)&&!!Xk(n.target)};ei.env=()=>{const{k:e,A:t,I:n,B:r,V:o,L:s,X:i,U:u,N:d,q:f,F:h,G:m}=Co();return cr({},{scrollbarsSize:e,scrollbarsOverlaid:t,scrollbarsHiding:n,rtlScrollBehavior:r,flexboxGlue:o,cssCustomProperties:s,staticDefaultInitialization:i,staticDefaultOptions:u,getDefaultInitialization:d,setDefaultInitialization:f,getDefaultOptions:h,setDefaultOptions:m})};const DL=()=>{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,i=r?n.requestIdleCallback:o,u=r?n.cancelIdleCallback:s,d=()=>{u(e),s(t)};return[(f,h)=>{d(),e=i(r?()=>{d(),t=o(f)}:f,typeof h=="object"?h:{timeout:2233})},d]},nP=e=>{const{options:t,events:n,defer:r}=e||{},[o,s]=p.useMemo(DL,[]),i=p.useRef(null),u=p.useRef(r),d=p.useRef(t),f=p.useRef(n);return p.useEffect(()=>{u.current=r},[r]),p.useEffect(()=>{const{current:h}=i;d.current=t,ei.valid(h)&&h.options(t||{},!0)},[t]),p.useEffect(()=>{const{current:h}=i;f.current=n,ei.valid(h)&&h.on(n||{},!0)},[n]),p.useEffect(()=>()=>{var h;s(),(h=i.current)==null||h.destroy()},[]),p.useMemo(()=>[h=>{const m=i.current;if(ei.valid(m))return;const v=u.current,y=d.current||{},S=f.current||{},w=()=>i.current=ei(h,y,S);v?o(w,v):w()},()=>i.current],[])},AL=(e,t)=>{const{element:n="div",options:r,events:o,defer:s,children:i,...u}=e,d=n,f=p.useRef(null),h=p.useRef(null),[m,v]=nP({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 w;return(w=v())==null?void 0:w.destroy()}},[m,n]),p.useImperativeHandle(t,()=>({osInstance:v,getElement:()=>f.current}),[]),L.createElement(d,{"data-overlayscrollbars-initialize":"",ref:f,...u},L.createElement("div",{ref:h},i))},rP=p.forwardRef(AL),NL=rt((e,t)=>{const{children:n,tooltip:r="",tooltipProps:{placement:o="top",hasArrow:s=!0,...i}={},isChecked:u,...d}=e;return a.jsx(qn,{label:r,placement:o,hasArrow:s,...i,children:a.jsx(Ff,{ref:t,colorScheme:u?"accent":"base",...d,children:n})})}),Yt=p.memo(NL),zL="My Board",$L=()=>{const[e,{isLoading:t}]=LO(),n=p.useCallback(()=>{e(zL)},[e]);return a.jsx(Yt,{isLoading:t,"aria-label":"Add Board",onClick:n,size:"sm",sx:{px:4},children:"Add Board"})},LL=({isSelected:e})=>{const t=FO(),{colorMode:n}=So(),r=()=>{t(p3())},o={id:"all-images-board",actionType:"MOVE_BOARD",context:{boardId:null}},{isOver:s,setNodeRef:i,active:u}=Du({id:"board_droppable_all_images",data:o});return a.jsxs(H,{sx:{flexDir:"column",justifyContent:"space-between",alignItems:"center",cursor:"pointer",w:"full",h:"full",borderRadius:"base"},children:[a.jsxs(H,{ref:i,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:[a.jsx(xc,{boxSize:8,icon:qz,sx:{border:"2px solid var(--invokeai-colors-base-200)",_dark:{border:"2px solid var(--invokeai-colors-base-800)"}}}),a.jsx(No,{children:Kl(o,u)&&a.jsx(Zl,{isOver:s})})]}),a.jsx(H,{sx:{h:"full",alignItems:"center",color:e?Te("base.900","base.50")(n):Te("base.700","base.200")(n),fontWeight:e?600:void 0,fontSize:"xs"},children:"All Images"})]})},FL=Ce([rn],({boards:e,gallery:t})=>{const{searchText:n}=e,{selectedBoardId:r}=t;return{selectedBoardId:r,searchText:n}},Ct),BL=e=>{const{isOpen:t}=e,n=ne(),{selectedBoardId:r,searchText:o}=F(FL),{data:s}=dh(),i=o?s==null?void 0:s.filter(m=>m.board_name.toLowerCase().includes(o.toLowerCase())):s,[u,d]=p.useState(!1),f=m=>{d(m.length>0),n(Px(m))},h=()=>{d(!1),n(Px(""))};return a.jsx(gh,{in:t,animateOpacity:!0,children:a.jsxs(H,{layerStyle:"first",sx:{flexDir:"column",gap:2,p:2,mt:2,borderRadius:"base"},children:[a.jsxs(H,{sx:{gap:2,alignItems:"center"},children:[a.jsxs(p6,{children:[a.jsx(Fu,{placeholder:"Search Boards...",value:o,onChange:m=>{f(m.target.value)}}),o&&o.length&&a.jsx(h1,{children:a.jsx(ri,{onClick:h,size:"xs",variant:"ghost","aria-label":"Clear Search",icon:a.jsx(c$,{boxSize:3})})})]}),a.jsx($L,{})]}),a.jsx(rP,{defer:!0,style:{height:"100%",width:"100%"},options:{scrollbars:{visibility:"auto",autoHide:"move",autoHideDelay:1300,theme:"os-theme-dark"}},children:a.jsxs(xa,{className:"list-container",sx:{gridTemplateRows:"6.5rem 6.5rem",gridAutoFlow:"column dense",gridAutoColumns:"5rem"},children:[!u&&a.jsx(Lv,{sx:{p:1.5},children:a.jsx(LL,{isSelected:!r})}),i&&i.map(m=>a.jsx(Lv,{sx:{p:1.5},children:a.jsx(jk,{board:m,isSelected:r===m.board_id})},m.board_id))]})})]})})},HL=p.memo(BL),WL=({image:e})=>{const t=p.useMemo(()=>{var n,r;if(G0((n=e.metadata)==null?void 0:n.model))return(r=e.metadata)==null?void 0:r.model},[e.metadata]);return a.jsxs(H,{sx:{pointerEvents:"none",flexDirection:"column",position:"absolute",top:0,insetInlineStart:0,p:2,alignItems:"flex-start",gap:2},children:[a.jsxs(Ql,{variant:"solid",colorScheme:"base",children:[e.width," × ",e.height]}),t&&a.jsx(Ql,{variant:"solid",colorScheme:"base",children:t})]})},oP=({postUploadAction:e,isDisabled:t})=>{const n=ne(),r=p.useCallback(u=>{const d=u[0];d&&n(u3({file:d,image_category:"user",is_intermediate:!1,postUploadAction:e}))},[n,e]),{getRootProps:o,getInputProps:s,open:i}=E1({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},onDropAccepted:r,disabled:t,noDrag:!0,multiple:!1});return{getUploadButtonProps:o,getUploadInputProps:s,openUploader:i}},VL=e=>{const{imageDTO:t,onClickReset:n,onError:r,onClick:o,withResetIcon:s=!1,withMetadataOverlay:i=!1,isDropDisabled:u=!1,isDragDisabled:d=!1,isUploadDisabled:f=!1,minSize:h=24,postUploadAction:m,imageSx:v,fitContainer:y=!1,droppableData:S,draggableData:w,dropLabel:C,isSelected:k=!1,thumbnail:P=!1,resetTooltip:j="Reset",resetIcon:E=a.jsx(M1,{}),noContentFallback:O=a.jsx(xc,{icon:Ku})}=e,{colorMode:I}=So(),R=p.useRef(Ai()),{attributes:T,listeners:D,setNodeRef:$,isDragging:A,active:J}=BO({id:R.current,disabled:d||!t,data:w}),{isOver:z,setNodeRef:B}=Du({id:R.current,disabled:u,data:S}),G=HO(B,$),{getUploadButtonProps:K,getUploadInputProps:N}=oP({postUploadAction:m,isDisabled:f}),V=Of("drop-shadow(0px 0px 0.1rem var(--invokeai-colors-base-600))","drop-shadow(0px 0px 0.1rem var(--invokeai-colors-base-800))"),W=f?{}:{cursor:"pointer",bg:Te("base.200","base.800")(I),_hover:{bg:Te("base.300","base.650")(I),color:Te("base.500","base.300")(I)}};return a.jsxs(H,{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"},...T,...D,ref:G,children:[t&&a.jsxs(H,{sx:{w:"full",h:"full",position:y?"absolute":"relative",alignItems:"center",justifyContent:"center"},children:[a.jsx(Au,{onClick:o,src:P?t.thumbnail_url:t.image_url,fallbackStrategy:"beforeLoadOrError",fallback:a.jsx(p$,{image:t}),onError:r,draggable:!1,sx:{objectFit:"contain",maxW:"full",maxH:"full",borderRadius:"base",shadow:k?"selected.light":void 0,_dark:{shadow:k?"selected.dark":void 0},...v}}),i&&a.jsx(WL,{image:t}),n&&s&&a.jsx(je,{onClick:n,"aria-label":j,tooltip:j,icon:E,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:V}}})]}),!t&&!f&&a.jsx(a.Fragment,{children:a.jsxs(H,{sx:{minH:h,w:"full",h:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",transitionProperty:"common",transitionDuration:"0.1s",color:Te("base.500","base.500")(I),...W},...K(),children:[a.jsx("input",{...N()}),a.jsx(go,{as:Yu,sx:{boxSize:16}})]})}),!t&&f&&O,a.jsx(No,{children:Kl(S,J)&&!A&&a.jsx(Zl,{isOver:z,label:C})})]})},Yi=p.memo(VL),Z1=()=>{const e=ne(),t=Mu(),{t:n}=pe(),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]),i=p.useCallback(()=>{t({title:n("toast.parametersNotSet"),status:"warning",duration:2500,isClosable:!0})},[n,t]),u=p.useCallback((O,I)=>{if(Ld(O)||Fd(I)){Ld(O)&&e(su(O)),Fd(I)&&e(au(I)),r();return}o()},[e,r,o]),d=p.useCallback(O=>{if(!Ld(O)){o();return}e(su(O)),r()},[e,r,o]),f=p.useCallback(O=>{if(!Fd(O)){o();return}e(au(O)),r()},[e,r,o]),h=p.useCallback(O=>{if(!_x(O)){o();return}e(Bf(O)),r()},[e,r,o]),m=p.useCallback(O=>{if(!jx(O)){o();return}e(Hf(O)),r()},[e,r,o]),v=p.useCallback(O=>{if(!Ex(O)){o();return}e(wv(O)),r()},[e,r,o]),y=p.useCallback(O=>{if(!Ix(O)){o();return}e(Cv(O)),r()},[e,r,o]),S=p.useCallback(O=>{if(!Ox(O)){o();return}e(Wf(O)),r()},[e,r,o]),w=p.useCallback(O=>{if(!Rx(O)){o();return}e(Yl(O)),r()},[e,r,o]),C=p.useCallback(O=>{if(!Tx(O)){o();return}e(Xl(O)),r()},[e,r,o]),k=p.useCallback(O=>{if(!Mx(O)){o();return}e(Vf(O)),r()},[e,r,o]),P=p.useCallback(async O=>{if(!WO(O)){o();return}e(Uf(O.image_name)),r()},[e,r,o]),j=p.useCallback(O=>{e(Uf(O))},[e]),E=p.useCallback(O=>{if(!O){i();return}const{cfg_scale:I,height:R,model:T,positive_prompt:D,negative_prompt:$,scheduler:A,seed:J,steps:z,width:B,strength:G}=O;jx(I)&&e(Hf(I)),Ex(T)&&e(wv(T)),Ld(D)&&e(su(D)),Fd($)&&e(au($)),Ix(A)&&e(Cv(A)),_x(J)&&e(Bf(J)),Ox(z)&&e(Wf(z)),Rx(B)&&e(Yl(B)),Tx(R)&&e(Xl(R)),Mx(G)&&e(Vf(G)),s()},[i,s,e]);return{recallBothPrompts:u,recallPositivePrompt:d,recallNegativePrompt:f,recallSeed:h,recallInitialImage:P,recallCfgScale:m,recallModel:v,recallScheduler:y,recallSteps:S,recallWidth:w,recallHeight:C,recallStrength:k,recallAllParameters:E,sendToImageToImage:j}},Gn=e=>{const t=F(i=>i.config.disabledTabs),n=F(i=>i.config.disabledFeatures),r=F(i=>i.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}};function Nf(e){return st({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 UL(e){return st({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 GL=({image:e,children:t})=>{const n=p.useMemo(()=>Ce([rn],({gallery:d})=>({selectionCount:d.selection.length}),Ct),[]),{selectionCount:r}=F(n),o=ne(),{onClickAddToBoard:s}=p.useContext(q0),i=p.useCallback(()=>{e&&o(fh(e))},[o,e]),u=p.useCallback(()=>{s(e)},[e,s]);return a.jsx(kk,{menuProps:{size:"sm",isLazy:!0},renderMenu:()=>a.jsx(Wu,{sx:{visibility:"visible !important"},children:r===1?a.jsx(KL,{image:e}):a.jsxs(a.Fragment,{children:[a.jsx(Yr,{isDisabled:!0,icon:a.jsx(lu,{}),onClickCapture:u,children:"Move Selection to Board"}),a.jsx(Yr,{sx:{color:"error.600",_dark:{color:"error.300"}},icon:a.jsx(io,{}),onClickCapture:i,children:"Delete Selection"})]})}),children:t})},qL=p.memo(GL),KL=e=>{const{image:t}=e,n=p.useMemo(()=>Ce([rn],({batch:A})=>({isInBatch:A.imageNames.includes(t.image_name)}),Ct),[t.image_name]),{isInBatch:r}=F(n),o=ne(),{t:s}=pe(),i=Mu(),u=Gn("lightbox").isFeatureEnabled,d=Gn("unifiedCanvas").isFeatureEnabled,{onClickAddToBoard:f}=p.useContext(q0),{currentData:h}=K0(t.image_name),m=h==null?void 0:h.metadata,v=p.useCallback(()=>{t&&o(fh(t))},[o,t]),{recallBothPrompts:y,recallSeed:S,recallAllParameters:w}=Z1(),[C]=VO(),k=p.useCallback(()=>{y(m==null?void 0:m.positive_prompt,m==null?void 0:m.negative_prompt)},[m==null?void 0:m.negative_prompt,m==null?void 0:m.positive_prompt,y]),P=p.useCallback(()=>{S(m==null?void 0:m.seed)},[m==null?void 0:m.seed,S]),j=p.useCallback(()=>{o(h3()),o(Uf(t))},[o,t]),E=()=>{o(m3()),o(g3(t)),o(ph()),o(Ti("unifiedCanvas")),i({title:s("toast.sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0})},O=p.useCallback(()=>{console.log(m),w(m)},[m,w]),I=()=>{},R=p.useCallback(()=>{f(t)},[t,f]),T=p.useCallback(()=>{t.board_id&&C({board_id:t.board_id,image_name:t.image_name})},[t.board_id,t.image_name,C]),D=()=>{window.open(t.image_url,"_blank")},$=p.useCallback(()=>{o(UO([t.image_name]))},[o,t.image_name]);return a.jsxs(a.Fragment,{children:[a.jsx(Yr,{icon:a.jsx(A1,{}),onClickCapture:D,children:s("common.openInNewTab")}),u&&a.jsx(Yr,{icon:a.jsx(R1,{}),onClickCapture:I,children:s("parameters.openInViewer")}),a.jsx(Yr,{icon:a.jsx(Nf,{}),onClickCapture:k,isDisabled:(m==null?void 0:m.positive_prompt)===void 0&&(m==null?void 0:m.negative_prompt)===void 0,children:s("parameters.usePrompt")}),a.jsx(Yr,{icon:a.jsx(Nf,{}),onClickCapture:P,isDisabled:(m==null?void 0:m.seed)===void 0,children:s("parameters.useSeed")}),a.jsx(Yr,{icon:a.jsx(Nf,{}),onClickCapture:O,isDisabled:!m,children:s("parameters.useAll")}),a.jsx(Yr,{icon:a.jsx(sp,{}),onClickCapture:j,id:"send-to-img2img",children:s("parameters.sendToImg2Img")}),d&&a.jsx(Yr,{icon:a.jsx(sp,{}),onClickCapture:E,id:"send-to-canvas",children:s("parameters.sendToUnifiedCanvas")}),a.jsx(Yr,{icon:a.jsx(lu,{}),isDisabled:r,onClickCapture:$,children:"Add to Batch"}),a.jsx(Yr,{icon:a.jsx(lu,{}),onClickCapture:R,children:t.board_id?"Change Board":"Add to Board"}),t.board_id&&a.jsx(Yr,{icon:a.jsx(lu,{}),onClickCapture:T,children:"Remove from Board"}),a.jsx(Yr,{sx:{color:"error.600",_dark:{color:"error.300"}},icon:a.jsx(io,{}),onClickCapture:v,children:s("gallery.deleteImage")})]})},YL=e=>Ce([rn],({gallery:t})=>{const n=t.selection.includes(e),r=t.selection.length;return{isSelected:n,selectionCount:r}},Ct),XL=e=>{const{imageDTO:t}=e,{image_url:n,thumbnail_url:r,image_name:o}=t,s=p.useMemo(()=>YL(o),[o]),{isSelected:i,selectionCount:u}=F(s),d=ne();pe();const f=p.useCallback(v=>{d(kv(e.imageDTO.image_name))},[d,e.imageDTO.image_name]),h=p.useCallback(v=>{v.stopPropagation(),t&&d(fh(t))},[d,t]),m=p.useMemo(()=>{if(u>1)return{id:"gallery-image",payloadType:"GALLERY_SELECTION"};if(t)return{id:"gallery-image",payloadType:"IMAGE_DTO",payload:{imageDTO:t}}},[t,u]);return a.jsx(Ge,{sx:{w:"full",h:"full",touchAction:"none"},children:a.jsx(qL,{image:t,children:v=>a.jsx(Ge,{position:"relative",userSelect:"none",ref:v,sx:{display:"flex",justifyContent:"center",alignItems:"center",aspectRatio:"1/1"},children:a.jsx(Yi,{onClick:f,imageDTO:t,draggableData:m,isSelected:i,minSize:0,onClickReset:h,resetIcon:a.jsx(io,{}),resetTooltip:"Delete image",imageSx:{w:"full",h:"full"},isDropDisabled:!0,isUploadDisabled:!0,thumbnail:!0})},o)})})},QL=p.memo(XL),Fh=0,nl=1,Sc=2,sP=4;function ZL(e,t){return n=>e(t(n))}function JL(e,t){return t(e)}function aP(e,t){return n=>e(t,n)}function CS(e,t){return()=>e(t)}function J1(e,t){return t(e),e}function rl(...e){return e}function eF(e){e()}function kS(e){return()=>e}function tF(...e){return()=>{e.map(eF)}}function nF(e){return e!==void 0}function Bh(){}function ts(e,t){return e(nl,t)}function ji(e,t){e(Fh,t)}function ey(e){e(Sc)}function Hh(e){return e(sP)}function Vn(e,t){return ts(e,aP(t,Fh))}function Mr(){const e=[];return(t,n)=>{switch(t){case Sc:e.splice(0,e.length);return;case nl:return e.push(n),()=>{const r=e.indexOf(n);r>-1&&e.splice(r,1)};case Fh:e.slice().forEach(r=>{r(n)});return;default:throw new Error(`unrecognized action ${t}`)}}}function qt(e){let t=e;const n=Mr();return(r,o)=>{switch(r){case nl:o(t);break;case Fh:t=o;break;case sP:return t}return n(r,o)}}function rF(e){let t,n;const r=()=>t&&t();return function(o,s){switch(o){case nl:return s?n===s?void 0:(r(),n=s,t=ts(e,s),t):(r(),Bh);case Sc:r(),n=null;return;default:throw new Error(`unrecognized action ${o}`)}}}function uu(e){return J1(Mr(),t=>Vn(e,t))}function Ul(e,t){return J1(qt(t),n=>Vn(e,n))}function oF(...e){return t=>e.reduceRight(JL,t)}function Jt(e,...t){const n=oF(...t);return(r,o)=>{switch(r){case nl:return ts(e,n(o));case Sc:ey(e);return}}}function iP(e,t){return e===t}function vo(e=iP){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function Xo(e){return t=>n=>{e(n)&&t(n)}}function tr(e){return t=>ZL(t,e)}function Ei(e){return t=>()=>t(e)}function nf(e,t){return n=>r=>n(t=e(t,r))}function PS(e){return t=>n=>{e>0?e--:t(n)}}function rf(e){let t=null,n;return r=>o=>{t=o,!n&&(n=setTimeout(()=>{n=void 0,r(t)},e))}}function _S(e){let t,n;return r=>o=>{t=o,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function ti(...e){const t=new Array(e.length);let n=0,r=null;const o=Math.pow(2,e.length)-1;return e.forEach((s,i)=>{const u=Math.pow(2,i);ts(s,d=>{const f=n;n=n|u,t[i]=d,f!==o&&n===o&&r&&(r(),r=null)})}),s=>i=>{const u=()=>s([i].concat(t));n===o?u():r=u}}function jS(...e){return function(t,n){switch(t){case nl:return tF(...e.map(r=>ts(r,n)));case Sc:return;default:throw new Error(`unrecognized action ${t}`)}}}function nr(e,t=iP){return Jt(e,vo(t))}function Xi(...e){const t=Mr(),n=new Array(e.length);let r=0;const o=Math.pow(2,e.length)-1;return e.forEach((s,i)=>{const u=Math.pow(2,i);ts(s,d=>{n[i]=d,r=r|u,r===o&&ji(t,n)})}),function(s,i){switch(s){case nl:return r===o&&i(n),ts(t,i);case Sc:return ey(t);default:throw new Error(`unrecognized action ${s}`)}}}function ta(e,t=[],{singleton:n}={singleton:!0}){return{id:sF(),constructor:e,dependencies:t,singleton:n}}const sF=()=>Symbol();function aF(e){const t=new Map,n=({id:r,constructor:o,dependencies:s,singleton:i})=>{if(i&&t.has(r))return t.get(r);const u=o(s.map(d=>n(d)));return i&&t.set(r,u),u};return n(e)}function iF(e,t){const n={},r={};let o=0;const s=e.length;for(;o<s;)r[e[o]]=1,o+=1;for(const i in t)r.hasOwnProperty(i)||(n[i]=t[i]);return n}const of=typeof document<"u"?L.useLayoutEffect:L.useEffect;function lF(e,t,n){const r=Object.keys(t.required||{}),o=Object.keys(t.optional||{}),s=Object.keys(t.methods||{}),i=Object.keys(t.events||{}),u=L.createContext({});function d(w,C){w.propsReady&&ji(w.propsReady,!1);for(const k of r){const P=w[t.required[k]];ji(P,C[k])}for(const k of o)if(k in C){const P=w[t.optional[k]];ji(P,C[k])}w.propsReady&&ji(w.propsReady,!0)}function f(w){return s.reduce((C,k)=>(C[k]=P=>{const j=w[t.methods[k]];ji(j,P)},C),{})}function h(w){return i.reduce((C,k)=>(C[k]=rF(w[t.events[k]]),C),{})}return{Component:L.forwardRef((w,C)=>{const{children:k,...P}=w,[j]=L.useState(()=>J1(aF(e),O=>d(O,P))),[E]=L.useState(CS(h,j));return of(()=>{for(const O of i)O in P&&ts(E[O],P[O]);return()=>{Object.values(E).map(ey)}},[P,E,j]),of(()=>{d(j,P)}),L.useImperativeHandle(C,kS(f(j))),L.createElement(u.Provider,{value:j},n?L.createElement(n,iF([...r,...o,...i],P),k):k)}),usePublisher:w=>L.useCallback(aP(ji,L.useContext(u)[w]),[w]),useEmitterValue:w=>{const k=L.useContext(u)[w],[P,j]=L.useState(CS(Hh,k));return of(()=>ts(k,E=>{E!==P&&j(kS(E))}),[k,P]),P},useEmitter:(w,C)=>{const P=L.useContext(u)[w];of(()=>ts(P,C),[C,P])}}}const cF=typeof document<"u"?L.useLayoutEffect:L.useEffect,uF=cF;var ty=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(ty||{});const dF={[0]:"debug",[1]:"log",[2]:"warn",[3]:"error"},fF=()=>typeof globalThis>"u"?window:globalThis,lP=ta(()=>{const e=qt(3);return{log:qt((n,r,o=1)=>{var s;const i=(s=fF().VIRTUOSO_LOG_LEVEL)!=null?s:Hh(e);o>=i&&console[dF[o]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",n,r)}),logLevel:e}},[],{singleton:!0});function cP(e,t=!0){const n=L.useRef(null);let r=o=>{};if(typeof ResizeObserver<"u"){const o=L.useMemo(()=>new ResizeObserver(s=>{const i=s[0].target;i.offsetParent!==null&&e(i)}),[e]);r=s=>{s&&t?(o.observe(s),n.current=s):(n.current&&o.unobserve(n.current),n.current=null)}}return{ref:n,callbackRef:r}}function Wh(e,t=!0){return cP(e,t).callbackRef}function fp(e,t){return Math.round(e.getBoundingClientRect()[t])}function uP(e,t){return Math.abs(e-t)<1.01}function dP(e,t,n,r=Bh,o){const s=L.useRef(null),i=L.useRef(null),u=L.useRef(null),d=L.useCallback(m=>{const v=m.target,y=v===window||v===document,S=y?window.pageYOffset||document.documentElement.scrollTop:v.scrollTop,w=y?document.documentElement.scrollHeight:v.scrollHeight,C=y?window.innerHeight:v.offsetHeight,k=()=>{e({scrollTop:Math.max(S,0),scrollHeight:w,viewportHeight:C})};m.suppressFlushSync?k():GO.flushSync(k),i.current!==null&&(S===i.current||S<=0||S===w-C)&&(i.current=null,t(!0),u.current&&(clearTimeout(u.current),u.current=null))},[e,t]);L.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,w,C;v===window?(w=Math.max(fp(document.documentElement,"height"),document.documentElement.scrollHeight),S=window.innerHeight,C=document.documentElement.scrollTop):(w=v.scrollHeight,S=fp(v,"height"),C=v.scrollTop);const k=w-S;if(m.top=Math.ceil(Math.max(Math.min(k,m.top),0)),uP(S,w)||m.top===C){e({scrollTop:C,scrollHeight:w,viewportHeight:S}),y&&t(!0);return}y?(i.current=m.top,u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{u.current=null,i.current=null,t(!0)},1e3)):i.current=null,v.scrollTo(m)}function h(m){s.current.scrollBy(m)}return{scrollerRef:s,scrollByCallback:h,scrollToCallback:f}}const Vh=ta(()=>{const e=Mr(),t=Mr(),n=qt(0),r=Mr(),o=qt(0),s=Mr(),i=Mr(),u=qt(0),d=qt(0),f=qt(0),h=qt(0),m=Mr(),v=Mr(),y=qt(!1);return Vn(Jt(e,tr(({scrollTop:S})=>S)),t),Vn(Jt(e,tr(({scrollHeight:S})=>S)),i),Vn(t,o),{scrollContainerState:e,scrollTop:t,viewportHeight:s,headerHeight:u,fixedHeaderHeight:d,fixedFooterHeight:f,footerHeight:h,scrollHeight:i,smoothScrollTargetReached:r,scrollTo:m,scrollBy:v,statefulScrollTop:o,deviation:n,scrollingInProgress:y}},[],{singleton:!0}),pF=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function hF(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!pF)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const pp="up",du="down",mF="none",gF={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},vF=0,fP=ta(([{scrollContainerState:e,scrollTop:t,viewportHeight:n,headerHeight:r,footerHeight:o,scrollBy:s}])=>{const i=qt(!1),u=qt(!0),d=Mr(),f=Mr(),h=qt(4),m=qt(vF),v=Ul(Jt(jS(Jt(nr(t),PS(1),Ei(!0)),Jt(nr(t),PS(1),Ei(!1),_S(100))),vo()),!1),y=Ul(Jt(jS(Jt(s,Ei(!0)),Jt(s,Ei(!1),_S(200))),vo()),!1);Vn(Jt(Xi(nr(t),nr(m)),tr(([P,j])=>P<=j),vo()),u),Vn(Jt(u,rf(50)),f);const S=uu(Jt(Xi(e,nr(n),nr(r),nr(o),nr(h)),nf((P,[{scrollTop:j,scrollHeight:E},O,I,R,T])=>{const D=j+O-E>-T,$={viewportHeight:O,scrollTop:j,scrollHeight:E};if(D){let J,z;return j>P.state.scrollTop?(J="SCROLLED_DOWN",z=P.state.scrollTop-j):(J="SIZE_DECREASED",z=P.state.scrollTop-j||P.scrollTopDelta),{atBottom:!0,state:$,atBottomBecause:J,scrollTopDelta:z}}let A;return $.scrollHeight>P.state.scrollHeight?A="SIZE_INCREASED":O<P.state.viewportHeight?A="VIEWPORT_HEIGHT_DECREASING":j<P.state.scrollTop?A="SCROLLING_UPWARDS":A="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:A,state:$}},gF),vo((P,j)=>P&&P.atBottom===j.atBottom))),w=Ul(Jt(e,nf((P,{scrollTop:j,scrollHeight:E,viewportHeight:O})=>{if(uP(P.scrollHeight,E))return{scrollTop:j,scrollHeight:E,jump:0,changed:!1};{const I=E-(j+O)<1;return P.scrollTop!==j&&I?{scrollHeight:E,scrollTop:j,jump:P.scrollTop-j,changed:!0}:{scrollHeight:E,scrollTop:j,jump:0,changed:!0}}},{scrollHeight:0,jump:0,scrollTop:0,changed:!1}),Xo(P=>P.changed),tr(P=>P.jump)),0);Vn(Jt(S,tr(P=>P.atBottom)),i),Vn(Jt(i,rf(50)),d);const C=qt(du);Vn(Jt(e,tr(({scrollTop:P})=>P),vo(),nf((P,j)=>Hh(y)?{direction:P.direction,prevScrollTop:j}:{direction:j<P.prevScrollTop?pp:du,prevScrollTop:j},{direction:du,prevScrollTop:0}),tr(P=>P.direction)),C),Vn(Jt(e,rf(50),Ei(mF)),C);const k=qt(0);return Vn(Jt(v,Xo(P=>!P),Ei(0)),k),Vn(Jt(t,rf(100),ti(v),Xo(([P,j])=>!!j),nf(([P,j],[E])=>[j,E],[0,0]),tr(([P,j])=>j-P)),k),{isScrolling:v,isAtTop:u,isAtBottom:i,atBottomState:S,atTopStateChange:f,atBottomStateChange:d,scrollDirection:C,atBottomThreshold:h,atTopThreshold:m,scrollVelocity:k,lastJumpDueToItemResize:w}},rl(Vh)),yF=ta(([{log:e}])=>{const t=qt(!1),n=uu(Jt(t,Xo(r=>r),vo()));return ts(t,r=>{r&&Hh(e)("props updated",{},ty.DEBUG)}),{propsReady:t,didMount:n}},rl(lP),{singleton:!0});function a0(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}function bF(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}const hp="top",mp="bottom",ES="none";function IS(e,t,n){return typeof e=="number"?n===pp&&t===hp||n===du&&t===mp?e:0:n===pp?t===hp?e.main:e.reverse:t===mp?e.main:e.reverse}function OS(e,t){return typeof e=="number"?e:e[t]||0}const xF=ta(([{scrollTop:e,viewportHeight:t,deviation:n,headerHeight:r,fixedHeaderHeight:o}])=>{const s=Mr(),i=qt(0),u=qt(0),d=qt(0),f=Ul(Jt(Xi(nr(e),nr(t),nr(r),nr(s,a0),nr(d),nr(i),nr(o),nr(n),nr(u)),tr(([h,m,v,[y,S],w,C,k,P,j])=>{const E=h-P,O=C+k,I=Math.max(v-E,0);let R=ES;const T=OS(j,hp),D=OS(j,mp);return y-=P,y+=v+k,S+=v+k,S-=P,y>h+O-T&&(R=pp),S<h-I+m+D&&(R=du),R!==ES?[Math.max(E-v-IS(w,hp,R)-T,0),E-I-k+m+IS(w,mp,R)+D]:null}),Xo(h=>h!=null),vo(a0)),[0,0]);return{listBoundary:s,overscan:d,topListHeight:i,increaseViewportBy:u,visibleRange:f}},rl(Vh),{singleton:!0}),SF=ta(([{scrollVelocity:e}])=>{const t=qt(!1),n=Mr(),r=qt(!1);return Vn(Jt(e,ti(r,t,n),Xo(([o,s])=>!!s),tr(([o,s,i,u])=>{const{exit:d,enter:f}=s;if(i){if(d(o,u))return!1}else if(f(o,u))return!0;return i}),vo()),t),ts(Jt(Xi(t,e,n),ti(r)),([[o,s,i],u])=>o&&u&&u.change&&u.change(s,i)),{isSeeking:t,scrollSeekConfiguration:r,scrollVelocity:e,scrollSeekRangeChanged:n}},rl(fP),{singleton:!0});function wF(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}const CF=ta(([{scrollTo:e,scrollContainerState:t}])=>{const n=Mr(),r=Mr(),o=Mr(),s=qt(!1),i=qt(void 0);return Vn(Jt(Xi(n,r),tr(([{viewportHeight:u,scrollTop:d,scrollHeight:f},{offsetTop:h}])=>({scrollTop:Math.max(0,d-h),scrollHeight:f,viewportHeight:u}))),t),Vn(Jt(e,ti(r),tr(([u,{offsetTop:d}])=>({...u,top:u.top+d}))),o),{useWindowScroll:s,customScrollParent:i,windowScrollContainerState:n,windowViewportRect:r,windowScrollTo:o}},rl(Vh)),qg="-webkit-sticky",RS="sticky",pP=wF(()=>{if(typeof document>"u")return RS;const e=document.createElement("div");return e.style.position=qg,e.style.position===qg?qg:RS});function kF(e,t){const n=L.useRef(null),r=L.useCallback(u=>{if(u===null||!u.offsetParent)return;const d=u.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}=cP(r),i=L.useCallback(()=>{r(s.current)},[r,s]);return L.useEffect(()=>{if(t){t.addEventListener("scroll",i);const u=new ResizeObserver(i);return u.observe(t),()=>{t.removeEventListener("scroll",i),u.unobserve(t)}}else return window.addEventListener("scroll",i),window.addEventListener("resize",i),()=>{window.removeEventListener("scroll",i),window.removeEventListener("resize",i)}},[i,t]),o}L.createContext(void 0);const hP=L.createContext(void 0);function PF(e){return e}pP();const _F={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},mP={width:"100%",height:"100%",position:"absolute",top:0};pP();function Fi(e,t){if(typeof e!="string")return{context:t}}function jF({usePublisher:e,useEmitter:t,useEmitterValue:n}){return L.memo(function({style:s,children:i,...u}){const d=e("scrollContainerState"),f=n("ScrollerComponent"),h=e("smoothScrollTargetReached"),m=n("scrollerRef"),v=n("context"),{scrollerRef:y,scrollByCallback:S,scrollToCallback:w}=dP(d,h,f,m);return t("scrollTo",w),t("scrollBy",S),L.createElement(f,{ref:y,style:{..._F,...s},"data-test-id":"virtuoso-scroller","data-virtuoso-scroller":!0,tabIndex:0,...u,...Fi(f,v)},i)})}function EF({usePublisher:e,useEmitter:t,useEmitterValue:n}){return L.memo(function({style:s,children:i,...u}){const d=e("windowScrollContainerState"),f=n("ScrollerComponent"),h=e("smoothScrollTargetReached"),m=n("totalListHeight"),v=n("deviation"),y=n("customScrollParent"),S=n("context"),{scrollerRef:w,scrollByCallback:C,scrollToCallback:k}=dP(d,h,f,Bh,y);return uF(()=>(w.current=y||window,()=>{w.current=null}),[w,y]),t("windowScrollTo",k),t("scrollBy",C),L.createElement(f,{style:{position:"relative",...s,...m!==0?{height:m+v}:{}},"data-virtuoso-scroller":!0,...u,...Fi(f,S)},i)})}const TS={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},IF={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},{round:MS,ceil:DS,floor:gp,min:Kg,max:fu}=Math;function OF(e){return{...IF,items:e}}function Yg(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 RF(e,t){return e&&e.column===t.column&&e.row===t.row}function AS(e,t){return e&&e.width===t.width&&e.height===t.height}const TF=ta(([{overscan:e,visibleRange:t,listBoundary:n},{scrollTop:r,viewportHeight:o,scrollBy:s,scrollTo:i,smoothScrollTargetReached:u,scrollContainerState:d,footerHeight:f,headerHeight:h},m,v,{propsReady:y,didMount:S},{windowViewportRect:w,windowScrollTo:C,useWindowScroll:k,customScrollParent:P,windowScrollContainerState:j},E])=>{const O=qt(0),I=qt(0),R=qt(TS),T=qt({height:0,width:0}),D=qt({height:0,width:0}),$=Mr(),A=Mr(),J=qt(0),z=qt(void 0),B=qt({row:0,column:0});Vn(Jt(S,ti(I,z),Xo(([U,re])=>U&&re!==0),tr(([,U,re])=>({items:Yg(0,U-1,re),top:0,bottom:0,offsetBottom:0,offsetTop:0,itemHeight:0,itemWidth:0}))),R),Vn(Jt(Xi(nr(O),t,nr(B,RF),nr(D,AS),nr(T,AS),z),tr(([U,[re,ve],le,se,Y,ae])=>{const{row:ue,column:xe}=le,{height:oe,width:ge}=se,{width:fe}=Y;if(U===0||fe===0)return TS;if(ge===0)return OF(Yg(0,0,ae));const Pe=gP(fe,ge,xe);let Ae=Pe*gp((re+ue)/(oe+ue)),ye=Pe*DS((ve+ue)/(oe+ue))-1;ye=Kg(U-1,fu(ye,Pe-1)),Ae=Kg(ye,fu(0,Ae));const Oe=Yg(Ae,ye,ae),{top:at,bottom:Fe}=NS(Y,le,se,Oe),Ye=DS(U/Pe),xt=Ye*oe+(Ye-1)*ue-Fe;return{items:Oe,offsetTop:at,offsetBottom:xt,top:at,bottom:Fe,itemHeight:oe,itemWidth:ge}})),R),Vn(Jt(z,Xo(nF),tr(U=>U.length)),O),Vn(Jt(T,tr(({height:U})=>U)),o),Vn(Jt(Xi(T,D,R,B),tr(([U,re,{items:ve},le])=>{const{top:se,bottom:Y}=NS(U,le,re,ve);return[se,Y]}),vo(a0)),n);const G=qt(!1);Vn(Jt(r,ti(G),tr(([U,re])=>re||U!==0)),G);const K=uu(Jt(nr(R),Xo(({items:U})=>U.length>0),ti(O,G),Xo(([{items:U},re,ve])=>ve&&U[U.length-1].index===re-1),tr(([,U])=>U-1),vo())),N=uu(Jt(nr(R),Xo(({items:U})=>U.length>0&&U[0].index===0),Ei(0),vo())),V=uu(Jt(nr(R),Xo(({items:U})=>U.length>0),tr(({items:U})=>({startIndex:U[0].index,endIndex:U[U.length-1].index})),vo(bF)));Vn(V,v.scrollSeekRangeChanged),Vn(Jt($,ti(T,D,O,B),tr(([U,re,ve,le,se])=>{const Y=hF(U),{align:ae,behavior:ue,offset:xe}=Y;let oe=Y.index;oe==="LAST"&&(oe=le-1),oe=fu(0,oe,Kg(le-1,oe));let ge=i0(re,se,ve,oe);return ae==="end"?ge=MS(ge-re.height+ve.height):ae==="center"&&(ge=MS(ge-re.height/2+ve.height/2)),xe&&(ge+=xe),{top:ge,behavior:ue}})),i);const W=Ul(Jt(R,tr(U=>U.offsetBottom+U.bottom)),0);return Vn(Jt(w,tr(U=>({width:U.visibleWidth,height:U.visibleHeight}))),T),{data:z,totalCount:O,viewportDimensions:T,itemDimensions:D,scrollTop:r,scrollHeight:A,overscan:e,scrollBy:s,scrollTo:i,scrollToIndex:$,smoothScrollTargetReached:u,windowViewportRect:w,windowScrollTo:C,useWindowScroll:k,customScrollParent:P,windowScrollContainerState:j,deviation:J,scrollContainerState:d,footerHeight:f,headerHeight:h,initialItemCount:I,gap:B,...v,gridState:R,totalListHeight:W,...m,startReached:N,endReached:K,rangeChanged:V,propsReady:y,...E}},rl(xF,Vh,fP,SF,yF,CF,lP));function NS(e,t,n,r){const{height:o}=n;if(o===void 0||r.length===0)return{top:0,bottom:0};const s=i0(e,t,n,r[0].index),i=i0(e,t,n,r[r.length-1].index)+o;return{top:s,bottom:i}}function i0(e,t,n,r){const o=gP(e.width,n.width,t.column),s=gp(r/o),i=s*n.height+fu(0,s-1)*t.row;return i>0?i+t.row:i}function gP(e,t,n){return fu(1,gp((e+n)/(gp(t)+n)))}const MF=ta(()=>{const e=qt(f=>`Item ${f}`),t=qt({}),n=qt(null),r=qt("virtuoso-grid-item"),o=qt("virtuoso-grid-list"),s=qt(PF),i=qt("div"),u=qt(Bh),d=(f,h=null)=>Ul(Jt(t,tr(m=>m[f]),vo()),h);return{context:n,itemContent:e,components:t,computeItemKey:s,itemClassName:r,listClassName:o,headerFooterTag:i,scrollerRef:u,FooterComponent:d("Footer"),HeaderComponent:d("Header"),ListComponent:d("List","div"),ItemComponent:d("Item","div"),ScrollerComponent:d("Scroller","div"),ScrollSeekPlaceholder:d("ScrollSeekPlaceholder","div")}}),DF=ta(([e,t])=>({...e,...t}),rl(TF,MF)),AF=L.memo(function(){const t=hr("gridState"),n=hr("listClassName"),r=hr("itemClassName"),o=hr("itemContent"),s=hr("computeItemKey"),i=hr("isSeeking"),u=ws("scrollHeight"),d=hr("ItemComponent"),f=hr("ListComponent"),h=hr("ScrollSeekPlaceholder"),m=hr("context"),v=ws("itemDimensions"),y=ws("gap"),S=hr("log"),w=Wh(C=>{const k=C.parentElement.parentElement.scrollHeight;u(k);const P=C.firstChild;P&&v(P.getBoundingClientRect()),y({row:zS("row-gap",getComputedStyle(C).rowGap,S),column:zS("column-gap",getComputedStyle(C).columnGap,S)})});return L.createElement(f,{ref:w,className:n,...Fi(f,m),style:{paddingTop:t.offsetTop,paddingBottom:t.offsetBottom},"data-test-id":"virtuoso-item-list"},t.items.map(C=>{const k=s(C.index,C.data,m);return i?L.createElement(h,{key:k,...Fi(h,m),index:C.index,height:t.itemHeight,width:t.itemWidth}):L.createElement(d,{...Fi(d,m),className:r,"data-index":C.index,key:k},o(C.index,C.data,m))}))}),NF=L.memo(function(){const t=hr("HeaderComponent"),n=ws("headerHeight"),r=hr("headerFooterTag"),o=Wh(i=>n(fp(i,"height"))),s=hr("context");return t?L.createElement(r,{ref:o},L.createElement(t,Fi(t,s))):null}),zF=L.memo(function(){const t=hr("FooterComponent"),n=ws("footerHeight"),r=hr("headerFooterTag"),o=Wh(i=>n(fp(i,"height"))),s=hr("context");return t?L.createElement(r,{ref:o},L.createElement(t,Fi(t,s))):null}),$F=({children:e})=>{const t=L.useContext(hP),n=ws("itemDimensions"),r=ws("viewportDimensions"),o=Wh(s=>{r(s.getBoundingClientRect())});return L.useEffect(()=>{t&&(r({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,r,n]),L.createElement("div",{style:mP,ref:o},e)},LF=({children:e})=>{const t=L.useContext(hP),n=ws("windowViewportRect"),r=ws("itemDimensions"),o=hr("customScrollParent"),s=kF(n,o);return L.useEffect(()=>{t&&(r({height:t.itemHeight,width:t.itemWidth}),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,r]),L.createElement("div",{ref:s,style:mP},e)},FF=L.memo(function({...t}){const n=hr("useWindowScroll"),r=hr("customScrollParent"),o=r||n?WF:HF,s=r||n?LF:$F;return L.createElement(o,{...t},L.createElement(s,null,L.createElement(NF,null),L.createElement(AF,null),L.createElement(zF,null)))}),{Component:BF,usePublisher:ws,useEmitterValue:hr,useEmitter:vP}=lF(DF,{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"}},FF),HF=jF({usePublisher:ws,useEmitterValue:hr,useEmitter:vP}),WF=EF({usePublisher:ws,useEmitterValue:hr,useEmitter:vP});function zS(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,ty.WARN),t==="normal"?0:parseInt(t??"0",10)}const VF=BF,UF=Ce([rn,v3],(e,t)=>{const{categories:n,total:r,isLoading:o,isFetching:s,selectedBoardId:i}=e.gallery;let u=t;return!o&&s&&(u=u.concat(Array(qO).fill("loading"))),{images:u,allImagesTotal:r,isLoading:o,isFetching:s,categories:n,selectedBoardId:i}},Ct),GF=()=>{const e=ne(),{t}=pe(),n=p.useRef(null),[r,o]=p.useState(null),[s,i]=nP({defer:!0,options:{scrollbars:{visibility:"auto",autoHide:"leave",autoHideDelay:1300,theme:"os-theme-dark"},overflow:{x:"hidden"}}}),{images:u,isLoading:d,isFetching:f,allImagesTotal:h,categories:m,selectedBoardId:v}=F(UF),{selectedBoard:y}=dh(void 0,{selectFromResult:({data:P})=>({selectedBoard:P==null?void 0:P.find(j=>j.board_id===v)})}),S=p.useMemo(()=>(y==null?void 0:y.image_count)??h,[h,y==null?void 0:y.image_count]),w=p.useMemo(()=>u.length<S,[u.length,S]),C=p.useCallback(()=>{e(y3({categories:m,board_id:v,is_intermediate:!1}))},[m,e,v]),k=p.useMemo(()=>{if(w&&!d)return C},[w,C,d]);return p.useEffect(()=>{const{current:P}=n;return r&&P&&s({target:P,elements:{viewport:r}}),()=>{var j;return(j=i())==null?void 0:j.destroy()}},[r,s,i]),d?a.jsx(H,{sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center"},children:a.jsx(ui,{size:"xl",sx:{color:"base.300",_dark:{color:"base.700"}}})}):u.length?a.jsxs(a.Fragment,{children:[a.jsx(Ge,{ref:n,"data-overlayscrollbars":"",h:"100%",children:a.jsx(VF,{style:{height:"100%"},data:u,endReached:k,components:{Item:qF,List:KF},scrollerRef:o,itemContent:(P,j)=>typeof j=="string"?a.jsx(P1,{sx:{w:"full",h:"full",aspectRatio:"1/1"}}):a.jsx(QL,{imageDTO:j},`${j.image_name}-${j.thumbnail_url}`)})}),a.jsx(Yt,{onClick:C,isDisabled:!w,isLoading:f,loadingText:"Loading",flexShrink:0,children:t(w?"gallery.loadMore":"gallery.allImagesLoaded")})]}):a.jsx(xc,{label:t("gallery.noImagesInGallery"),icon:Ku})},qF=rt((e,t)=>a.jsx(Ge,{className:"item-container",ref:t,p:1.5,children:e.children})),KF=rt((e,t)=>{const n=F(r=>r.gallery.galleryImageMinimumWidth);return a.jsx(xa,{...e,className:"list-container",ref:t,sx:{gridTemplateColumns:`repeat(auto-fill, minmax(${n}px, 1fr));`},children:e.children})}),YF=p.memo(GF),XF=Ce([rn],e=>{const{selectedBoardId:t,galleryImageMinimumWidth:n,galleryView:r,shouldAutoSwitch:o}=e.gallery,{shouldPinGallery:s}=e.ui;return{selectedBoardId:t,shouldPinGallery:s,galleryImageMinimumWidth:n,shouldAutoSwitch:o,galleryView:r}},Ct),QF=()=>{const e=ne(),{t}=pe(),n=p.useRef(null),{colorMode:r}=So(),{selectedBoardId:o,shouldPinGallery:s,galleryImageMinimumWidth:i,shouldAutoSwitch:u,galleryView:d}=F(XF),{selectedBoard:f}=dh(void 0,{selectFromResult:({data:C})=>({selectedBoard:C==null?void 0:C.find(k=>k.board_id===o)})}),{isOpen:h,onToggle:m}=ya(),v=C=>{e(Gf(C))},y=()=>{e(b3()),e(js())},S=p.useCallback(()=>{e(Dx(KO)),e(Ax("images"))},[e]),w=p.useCallback(()=>{e(Dx(YO)),e(Ax("assets"))},[e]);return a.jsxs(jr,{sx:{flexDirection:"column",h:"full",w:"full",borderRadius:"base"},children:[a.jsxs(Ge,{sx:{w:"full"},children:[a.jsxs(H,{ref:n,sx:{alignItems:"center",justifyContent:"space-between",gap:2},children:[a.jsxs(gr,{isAttached:!0,children:[a.jsx(je,{tooltip:t("gallery.images"),"aria-label":t("gallery.images"),onClick:S,isChecked:d==="images",size:"sm",icon:a.jsx(Ku,{})}),a.jsx(je,{tooltip:t("gallery.assets"),"aria-label":t("gallery.assets"),onClick:w,isChecked:d==="assets",size:"sm",icon:a.jsx(o$,{})})]}),a.jsxs(H,{as:Ff,onClick:m,size:"sm",variant:"ghost",sx:{w:"full",justifyContent:"center",alignItems:"center",px:2,_hover:{bg:Te("base.100","base.800")(r)}},children:[a.jsx(Ue,{noOfLines:1,sx:{w:"full",color:Te("base.800","base.200")(r),fontWeight:600},children:f?f.board_name:"All Images"}),a.jsx(N1,{sx:{transform:h?"rotate(0deg)":"rotate(180deg)",transitionProperty:"common",transitionDuration:"normal"}})]}),a.jsx(fa,{triggerComponent:a.jsx(je,{tooltip:t("gallery.gallerySettings"),"aria-label":t("gallery.gallerySettings"),size:"sm",icon:a.jsx(D1,{})}),children:a.jsxs(H,{direction:"column",gap:2,children:[a.jsx(vt,{value:i,onChange:v,min:32,max:256,hideTooltip:!0,label:t("gallery.galleryImageSize"),withReset:!0,handleReset:()=>e(Gf(64))}),a.jsx(In,{label:t("gallery.autoSwitchNewImages"),isChecked:u,onChange:C=>e(XO(C.target.checked))})]})}),a.jsx(je,{size:"sm","aria-label":t("gallery.pinGallery"),tooltip:`${t("gallery.pinGallery")} (Shift+G)`,onClick:y,icon:s?a.jsx(hk,{}):a.jsx(mk,{})})]}),a.jsx(Ge,{children:a.jsx(HL,{isOpen:h})})]}),a.jsx(H,{direction:"column",gap:2,h:"full",w:"full",children:a.jsx(YF,{})})]})},yP=p.memo(QF);var ZF=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)}}(),_r=globalThis&&globalThis.__assign||function(){return _r=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},_r.apply(this,arguments)},$S={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},LS={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},sf={width:"20px",height:"20px",position:"absolute"},JF={top:_r(_r({},$S),{top:"-5px"}),right:_r(_r({},LS),{left:void 0,right:"-5px"}),bottom:_r(_r({},$S),{top:void 0,bottom:"-5px"}),left:_r(_r({},LS),{left:"-5px"}),topRight:_r(_r({},sf),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:_r(_r({},sf),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:_r(_r({},sf),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:_r(_r({},sf),{left:"-10px",top:"-10px",cursor:"nw-resize"})},eB=function(e){ZF(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:_r(_r({position:"absolute",userSelect:"none"},JF[this.props.direction]),this.props.replaceStyles||{}),onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart},this.props.children)},t}(p.PureComponent),tB=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)}}(),Hs=globalThis&&globalThis.__assign||function(){return Hs=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},Hs.apply(this,arguments)},nB={width:"auto",height:"auto"},af=function(e,t,n){return Math.max(Math.min(e,n),t)},FS=function(e,t){return Math.round(e/t)*t},Pl=function(e,t){return new RegExp(e,"i").test(t)},lf=function(e){return!!(e.touches&&e.touches.length)},rB=function(e){return!!((e.clientX||e.clientX===0)&&(e.clientY||e.clientY===0))},BS=function(e,t,n){n===void 0&&(n=0);var r=t.reduce(function(s,i,u){return Math.abs(i-e)<Math.abs(t[s]-e)?u:s},0),o=Math.abs(t[r]-e);return n===0||o<n?t[r]:e},Xg=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"},cf=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},oB=function(e,t,n,r,o,s,i){return r=cf(r,e.width,t,n),o=cf(o,e.height,t,n),s=cf(s,e.width,t,n),i=cf(i,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 i>"u"?void 0:Number(i)}},sB=["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"],HS="__resizable_base__",aB=function(e){tB(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(HS):s.className+=HS,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||nB},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,i=this.resizable.style.position;i!=="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=i}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(u){if(typeof n.state[u]>"u"||n.state[u]==="auto")return"auto";if(n.propsSize&&n.propsSize[u]&&n.propsSize[u].toString().endsWith("%")){if(n.state[u].toString().endsWith("%"))return n.state[u].toString();var d=n.getParentSize(),f=Number(n.state[u].toString().replace("px","")),h=f/d[u]*100;return h+"%"}return Xg(n.state[u])},s=r&&typeof r.width<"u"&&!this.state.isResizing?Xg(r.width):o("width"),i=r&&typeof r.height<"u"&&!this.state.isResizing?Xg(r.height):o("height");return{width:s,height:i}},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,i=o&&Pl("left",s),u=o&&Pl("top",s),d,f;if(this.props.bounds==="parent"){var h=this.parentNode;h&&(d=i?this.resizableRight-this.parentLeft:h.offsetWidth+(this.parentLeft-this.resizableLeft),f=u?this.resizableBottom-this.parentTop:h.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(d=i?this.resizableRight:this.window.innerWidth-this.resizableLeft,f=u?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(d=i?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),f=u?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,i=this.state,u=i.direction,d=i.original,f=this.props,h=f.lockAspectRatio,m=f.lockAspectRatioExtraHeight,v=f.lockAspectRatioExtraWidth,y=d.width,S=d.height,w=m||0,C=v||0;return Pl("right",u)&&(y=d.width+(n-d.x)*s/o,h&&(S=(y-C)/this.ratio+w)),Pl("left",u)&&(y=d.width-(n-d.x)*s/o,h&&(S=(y-C)/this.ratio+w)),Pl("bottom",u)&&(S=d.height+(r-d.y)*s/o,h&&(y=(S-w)*this.ratio+C)),Pl("top",u)&&(S=d.height-(r-d.y)*s/o,h&&(y=(S-w)*this.ratio+C)),{newWidth:y,newHeight:S}},t.prototype.calculateNewSizeFromAspectRatio=function(n,r,o,s){var i=this.props,u=i.lockAspectRatio,d=i.lockAspectRatioExtraHeight,f=i.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,w=f||0;if(u){var C=(v-S)*this.ratio+w,k=(y-S)*this.ratio+w,P=(h-w)/this.ratio+S,j=(m-w)/this.ratio+S,E=Math.max(h,C),O=Math.min(m,k),I=Math.max(v,P),R=Math.min(y,j);n=af(n,E,O),r=af(r,I,R)}else n=af(n,h,m),r=af(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(),i=s.left,u=s.top,d=s.right,f=s.bottom;this.resizableLeft=i,this.resizableRight=d,this.resizableTop=u,this.resizableBottom=f}},t.prototype.onResizeStart=function(n,r){if(!(!this.resizable||!this.window)){var o=0,s=0;if(n.nativeEvent&&rB(n.nativeEvent)?(o=n.nativeEvent.clientX,s=n.nativeEvent.clientY):n.nativeEvent&&lf(n.nativeEvent)&&(o=n.nativeEvent.touches[0].clientX,s=n.nativeEvent.touches[0].clientY),this.props.onResizeStart&&this.resizable){var i=this.props.onResizeStart(n,r,this.resizable);if(i===!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 u,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",u=d.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var m={original:{x:o,y:s,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:Hs(Hs({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(n.target).cursor||"auto"}),direction:r,flexBasis:u};this.setState(m)}},t.prototype.onMouseMove=function(n){var r=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&lf(n))try{n.preventDefault(),n.stopPropagation()}catch{}var o=this.props,s=o.maxWidth,i=o.maxHeight,u=o.minWidth,d=o.minHeight,f=lf(n)?n.touches[0].clientX:n.clientX,h=lf(n)?n.touches[0].clientY:n.clientY,m=this.state,v=m.direction,y=m.original,S=m.width,w=m.height,C=this.getParentSize(),k=oB(C,this.window.innerWidth,this.window.innerHeight,s,i,u,d);s=k.maxWidth,i=k.maxHeight,u=k.minWidth,d=k.minHeight;var P=this.calculateNewSizeFromDirection(f,h),j=P.newHeight,E=P.newWidth,O=this.calculateNewMaxFromBoundary(s,i);this.props.snap&&this.props.snap.x&&(E=BS(E,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(j=BS(j,this.props.snap.y,this.props.snapGap));var I=this.calculateNewSizeFromAspectRatio(E,j,{width:O.maxWidth,height:O.maxHeight},{width:u,height:d});if(E=I.newWidth,j=I.newHeight,this.props.grid){var R=FS(E,this.props.grid[0]),T=FS(j,this.props.grid[1]),D=this.props.snapGap||0;E=D===0||Math.abs(R-E)<=D?R:E,j=D===0||Math.abs(T-j)<=D?T:j}var $={width:E-y.width,height:j-y.height};if(S&&typeof S=="string"){if(S.endsWith("%")){var A=E/C.width*100;E=A+"%"}else if(S.endsWith("vw")){var J=E/this.window.innerWidth*100;E=J+"vw"}else if(S.endsWith("vh")){var z=E/this.window.innerHeight*100;E=z+"vh"}}if(w&&typeof w=="string"){if(w.endsWith("%")){var A=j/C.height*100;j=A+"%"}else if(w.endsWith("vw")){var J=j/this.window.innerWidth*100;j=J+"vw"}else if(w.endsWith("vh")){var z=j/this.window.innerHeight*100;j=z+"vh"}}var B={width:this.createSizeForCssProperty(E,"width"),height:this.createSizeForCssProperty(j,"height")};this.flexDir==="row"?B.flexBasis=B.width:this.flexDir==="column"&&(B.flexBasis=B.height),hc.flushSync(function(){r.setState(B)}),this.props.onResize&&this.props.onResize(n,v,this.resizable,$)}},t.prototype.onMouseUp=function(n){var r=this.state,o=r.isResizing,s=r.direction,i=r.original;if(!(!o||!this.resizable)){var u={width:this.size.width-i.width,height:this.size.height-i.height};this.props.onResizeStop&&this.props.onResizeStop(n,s,this.resizable,u),this.props.size&&this.setState(this.props.size),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:Hs(Hs({},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,i=r.handleClasses,u=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(eB,{key:m,direction:m,onResizeStart:n.onResizeStart,replaceStyles:s&&s[m],className:i&&i[m]},f&&f[m]?f[m]:null):null});return p.createElement("div",{className:d,style:u},h)},t.prototype.render=function(){var n=this,r=Object.keys(this.props).reduce(function(i,u){return sB.indexOf(u)!==-1||(i[u]=n.props[u]),i},{}),o=Hs(Hs(Hs({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,Hs({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 iB=({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"}),lB=({direction:e,minWidth:t,maxWidth:n,minHeight:r,maxHeight:o})=>{const s=t??(["left","right"].includes(e)?10:void 0),i=n??(["left","right"].includes(e)?"95vw":void 0),u=r??(["top","bottom"].includes(e)?10:void 0),d=o??(["top","bottom"].includes(e)?"95vh":void 0);return{...s?{minWidth:s}:{},...i?{maxWidth:i}:{},...u?{minHeight:u}:{},...d?{maxHeight:d}:{}}},ca="0.75rem",uf="1rem",Hc="5px",cB=({isResizable:e,direction:t})=>{const n=`calc((2 * ${ca} + ${Hc}) / -2)`;return t==="top"?{containerStyles:{borderBottomWidth:Hc,paddingBottom:uf},handleStyles:e?{top:{paddingTop:ca,paddingBottom:ca,bottom:n}}:{}}:t==="left"?{containerStyles:{borderInlineEndWidth:Hc,paddingInlineEnd:uf},handleStyles:e?{right:{paddingInlineStart:ca,paddingInlineEnd:ca,insetInlineEnd:n}}:{}}:t==="bottom"?{containerStyles:{borderTopWidth:Hc,paddingTop:uf},handleStyles:e?{bottom:{paddingTop:ca,paddingBottom:ca,top:n}}:{}}:t==="right"?{containerStyles:{borderInlineStartWidth:Hc,paddingInlineStart:uf},handleStyles:e?{left:{paddingInlineStart:ca,paddingInlineEnd:ca,insetInlineStart:n}}:{}}:{containerStyles:{},handleStyles:{}}},uB=(e,t)=>["top","bottom"].includes(e)?e:e==="left"?t==="rtl"?"right":"left":e==="right"?t==="rtl"?"left":"right":"left",dB=Ve(aB,{shouldForwardProp:e=>!["sx"].includes(e)}),bP=({direction:e="left",isResizable:t,isOpen:n,onClose:r,children:o,initialWidth:s,minWidth:i,maxWidth:u,initialHeight:d,minHeight:f,maxHeight:h,onResizeStart:m,onResizeStop:v,onResize:y,sx:S={}})=>{const w=ch().direction,{colorMode:C}=So(),k=p.useRef(null),P=p.useMemo(()=>s??i??(["left","right"].includes(e)?"auto":"100%"),[s,i,e]),j=p.useMemo(()=>d??f??(["top","bottom"].includes(e)?"auto":"100%"),[d,f,e]),[E,O]=p.useState(P),[I,R]=p.useState(j);ID({ref:k,handler:()=>{r()},enabled:n});const T=p.useMemo(()=>t?iB({direction:e,langDirection:w}):{},[t,w,e]),D=p.useMemo(()=>lB({direction:e,minWidth:i,maxWidth:u,minHeight:f,maxHeight:h}),[i,u,f,h,e]),{containerStyles:$,handleStyles:A}=p.useMemo(()=>cB({isResizable:t,direction:e}),[t,e]),J=p.useMemo(()=>uB(e,w),[e,w]);return p.useEffect(()=>{["left","right"].includes(e)&&R("100vh"),["top","bottom"].includes(e)&&O("100vw")},[e]),a.jsx(m5,{direction:J,in:n,motionProps:{initial:!1},style:{width:"full"},children:a.jsx(Ge,{ref:k,sx:{width:"full",height:"full"},children:a.jsx(dB,{size:{width:t?E:P,height:t?I:j},enable:T,handleStyles:A,...D,sx:{borderColor:Te("base.200","base.800")(C),p:4,bg:Te("base.100","base.900")(C),height:"full",shadow:n?"dark-lg":void 0,...$,...S},onResizeStart:(z,B,G)=>{m&&m(z,B,G)},onResize:(z,B,G,K)=>{y&&y(z,B,G,K)},onResizeStop:(z,B,G,K)=>{["left","right"].includes(B)&&O(Number(E)+K.width),["top","bottom"].includes(B)&&R(Number(I)+K.height),v&&v(z,B,G,K)},children:o})})})},xP=Ce(e=>e.lightbox,e=>e,{memoizeOptions:{equalityCheck:Wt}}),fB=Ce([Sr,Hr,pk,or,xP],(e,t,n,r,o)=>{const{shouldPinGallery:s,shouldShowGallery:i}=t,{galleryImageMinimumWidth:u}=n,{isLightboxOpen:d}=o;return{activeTabName:e,isStaging:r,shouldPinGallery:s,shouldShowGallery:i,galleryImageMinimumWidth:u,isResizable:e!=="unifiedCanvas",isLightboxOpen:d}},{memoizeOptions:{resultEqualityCheck:Wt}}),pB=()=>{const e=ne(),{shouldPinGallery:t,shouldShowGallery:n,galleryImageMinimumWidth:r}=F(fB),o=()=>{e(Pv(!1)),t&&e(js())};Ke("esc",()=>{e(Pv(!1))},{enabled:()=>!t,preventDefault:!0},[t]);const s=32;return Ke("shift+up",()=>{if(r<256){const i=Ys(r+s,32,256);e(Gf(i))}},[r]),Ke("shift+down",()=>{if(r>32){const i=Ys(r-s,32,256);e(Gf(i))}},[r]),t?null:a.jsx(bP,{direction:"right",isResizable:!0,isOpen:n,onClose:o,minWidth:337,children:a.jsx(yP,{})})},hB=p.memo(pB),mB=e=>{const{label:t,isDisabled:n=!1,width:r="auto",formControlProps:o,formLabelProps:s,tooltip:i,...u}=e;return a.jsx(qn,{label:i,hasArrow:!0,placement:"top",isDisabled:!i,children:a.jsxs(lr,{isDisabled:n,width:r,display:"flex",alignItems:"center",...o,children:[t&&a.jsx(mr,{my:1,flexGrow:1,sx:{cursor:n?"not-allowed":"pointer",...s==null?void 0:s.sx,pe:4},...s,children:t}),a.jsx(_1,{...u})]})})},jn=p.memo(mB),gB=e=>{const{imageUsage:t}=e;return!t||!x3(t)?null:a.jsxs(a.Fragment,{children:[a.jsx(Ue,{children:"This image is currently in use in the following features:"}),a.jsxs(bh,{sx:{paddingInlineStart:6},children:[t.isInitialImage&&a.jsx(Mo,{children:"Image to Image"}),t.isCanvasImage&&a.jsx(Mo,{children:"Unified Canvas"}),t.isControlNetImage&&a.jsx(Mo,{children:"ControlNet"}),t.isNodesImage&&a.jsx(Mo,{children:"Node Editor"})]}),a.jsx(Ue,{children:"If you delete this image, those features will immediately be reset."})]})},vB=p.memo(gB),yB=Ce([rn,QO],({system:e,config:t,imageDeletion:n},r)=>{const{shouldConfirmOnDelete:o}=e,{canRestoreDeletedImagesFromBin:s}=t,{imageToDelete:i,isModalOpen:u}=n;return{shouldConfirmOnDelete:o,canRestoreDeletedImagesFromBin:s,imageToDelete:i,imageUsage:r,isModalOpen:u}},Ct),bB=()=>{const e=ne(),{t}=pe(),{shouldConfirmOnDelete:n,canRestoreDeletedImagesFromBin:r,imageToDelete:o,imageUsage:s,isModalOpen:i}=F(yB),u=p.useCallback(m=>e(S3(!m.target.checked)),[e]),d=p.useCallback(()=>{e(Nx()),e(ZO(!1))},[e]),f=p.useCallback(()=>{!o||!s||(e(Nx()),e(JO({imageDTO:o,imageUsage:s})))},[e,o,s]),h=p.useRef(null);return a.jsx(Vu,{isOpen:i,onClose:d,leastDestructiveRef:h,isCentered:!0,children:a.jsx(Ca,{children:a.jsxs(Uu,{children:[a.jsx(wa,{fontSize:"lg",fontWeight:"bold",children:t("gallery.deleteImage")}),a.jsx(ka,{children:a.jsxs(H,{direction:"column",gap:3,children:[a.jsx(vB,{imageUsage:s}),a.jsx(Ra,{}),a.jsx(Ue,{children:t(r?"gallery.deleteImageBin":"gallery.deleteImagePermanent")}),a.jsx(Ue,{children:t("common.areYouSure")}),a.jsx(jn,{label:t("common.dontAskMeAgain"),isChecked:!n,onChange:u})]})}),a.jsxs(Sa,{children:[a.jsx(Yt,{ref:h,onClick:d,children:"Cancel"}),a.jsx(Yt,{colorScheme:"error",onClick:f,ml:3,children:"Delete"})]})]})})})},xB=p.memo(bB),SB=Ce([rn],({system:e})=>{const{isProcessing:t,isConnected:n}=e;return n&&!t}),wB=e=>{const{onClick:t,isDisabled:n}=e,{t:r}=pe(),o=F(SB);return a.jsx(je,{onClick:t,icon:a.jsx(io,{}),tooltip:`${r("gallery.deleteImage")} (Del)`,"aria-label":`${r("gallery.deleteImage")} (Del)`,isDisabled:n||!o,colorScheme:"error"})};function CB(e){const t=p.createContext(null);return[({children:o,value:s})=>L.createElement(t.Provider,{value:s},o),()=>{const o=p.useContext(t);if(o===null)throw new Error(e);return o}]}function SP(e){return Array.isArray(e)?e:[e]}const kB=()=>{};function PB(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||kB:n=>{var r;n.key==="Escape"&&(e(n),(r=t.onTrigger)==null||r.call(t))}}function wP({data:e}){const t=[],n=[],r=e.reduce((o,s,i)=>(s.group?o[s.group]?o[s.group].push(i):o[s.group]=[i]:n.push(i),o),{});return Object.keys(r).forEach(o=>{t.push(...r[o].map(s=>e[s]))}),t.push(...n.map(o=>e[o])),t}function CP(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==L.Fragment:!1}function kP(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=kP(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function PP(){for(var e=0,t,n,r="";e<arguments.length;)(t=arguments[e++])&&(n=kP(t))&&(r&&(r+=" "),r+=n);return r}const _B={app:100,modal:200,popover:300,overlay:400,max:9999};function ny(e){return _B[e]}function jB(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 EB=e8({key:"mantine",prepend:!0});function IB(){return u5()||EB}var OB=Object.defineProperty,WS=Object.getOwnPropertySymbols,RB=Object.prototype.hasOwnProperty,TB=Object.prototype.propertyIsEnumerable,VS=(e,t,n)=>t in e?OB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,MB=(e,t)=>{for(var n in t||(t={}))RB.call(t,n)&&VS(e,n,t[n]);if(WS)for(var n of WS(t))TB.call(t,n)&&VS(e,n,t[n]);return e};const Qg="ref";function DB(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(!(Qg in n))return{args:e,ref:t};t=n[Qg];const r=MB({},n);return delete r[Qg],{args:[r],ref:t}}const{cssFactory:AB}=(()=>{function e(n,r,o){const s=[],i=r8(n,s,o);return s.length<2?o:i+r(s)}function t(n){const{cache:r}=n,o=(...i)=>{const{ref:u,args:d}=DB(i),f=t8(d,r.registered);return n8(r,f,!1),`${r.key}-${f.name}${u===void 0?"":` ${u}`}`};return{css:o,cx:(...i)=>e(r.registered,o,PP(i))}}return{cssFactory:t}})();function _P(){const e=IB();return jB(()=>AB({cache:e}),[e])}function NB({cx:e,classes:t,context:n,classNames:r,name:o,cache:s}){const i=n.reduce((u,d)=>(Object.keys(d.classNames).forEach(f=>{typeof u[f]!="string"?u[f]=`${d.classNames[f]}`:u[f]=`${u[f]} ${d.classNames[f]}`}),u),{});return Object.keys(t).reduce((u,d)=>(u[d]=e(t[d],i[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),u),{})}var zB=Object.defineProperty,US=Object.getOwnPropertySymbols,$B=Object.prototype.hasOwnProperty,LB=Object.prototype.propertyIsEnumerable,GS=(e,t,n)=>t in e?zB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Zg=(e,t)=>{for(var n in t||(t={}))$B.call(t,n)&&GS(e,n,t[n]);if(US)for(var n of US(t))LB.call(t,n)&&GS(e,n,t[n]);return e};function l0(e,t){return t&&Object.keys(t).forEach(n=>{e[n]?e[n]=Zg(Zg({},e[n]),t[n]):e[n]=Zg({},t[n])}),e}function qS(e,t,n,r){const o=s=>typeof s=="function"?s(t,n||{},r):s||{};return Array.isArray(e)?e.map(s=>o(s.styles)).reduce((s,i)=>l0(s,i),{}):o(e)}function FB({ctx:e,theme:t,params:n,variant:r,size:o}){return e.reduce((s,i)=>(i.variants&&r in i.variants&&l0(s,i.variants[r](t,n,{variant:r,size:o})),i.sizes&&o in i.sizes&&l0(s,i.sizes[o](t,n,{variant:r,size:o})),s),{})}function Jr(e){const t=typeof e=="function"?e:()=>e;function n(r,o){const s=Ia(),i=$R(o==null?void 0:o.name),u=u5(),d={variant:o==null?void 0:o.variant,size:o==null?void 0:o.size},{css:f,cx:h}=_P(),m=t(s,r,d),v=qS(o==null?void 0:o.styles,s,r,d),y=qS(i,s,r,d),S=FB({ctx:i,theme:s,params:r,variant:o==null?void 0:o.variant,size:o==null?void 0:o.size}),w=Object.fromEntries(Object.keys(m).map(C=>{const k=h({[f(m[C])]:!(o!=null&&o.unstyled)},f(S[C]),f(y[C]),f(v[C]));return[C,k]}));return{classes:NB({cx:h,classes:w,context:i,classNames:o==null?void 0:o.classNames,name:o==null?void 0:o.name,cache:u}),cx:h,theme:s}}return n}function KS(e){return`___ref-${e||""}`}var BB=Object.defineProperty,HB=Object.defineProperties,WB=Object.getOwnPropertyDescriptors,YS=Object.getOwnPropertySymbols,VB=Object.prototype.hasOwnProperty,UB=Object.prototype.propertyIsEnumerable,XS=(e,t,n)=>t in e?BB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Wc=(e,t)=>{for(var n in t||(t={}))VB.call(t,n)&&XS(e,n,t[n]);if(YS)for(var n of YS(t))UB.call(t,n)&&XS(e,n,t[n]);return e},Vc=(e,t)=>HB(e,WB(t));const Uc={in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${Le(10)})`},transitionProperty:"transform, opacity"},df={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(-${Le(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(${Le(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(${Le(20)}) rotate(-5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${Le(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:Vc(Wc({},Uc),{common:{transformOrigin:"center center"}}),"pop-bottom-left":Vc(Wc({},Uc),{common:{transformOrigin:"bottom left"}}),"pop-bottom-right":Vc(Wc({},Uc),{common:{transformOrigin:"bottom right"}}),"pop-top-left":Vc(Wc({},Uc),{common:{transformOrigin:"top left"}}),"pop-top-right":Vc(Wc({},Uc),{common:{transformOrigin:"top right"}})},QS=["mousedown","touchstart"];function GB(e,t,n){const r=p.useRef();return p.useEffect(()=>{const o=s=>{const{target:i}=s??{};if(Array.isArray(n)){const u=(i==null?void 0:i.hasAttribute("data-ignore-outside-clicks"))||!document.body.contains(i)&&i.tagName!=="HTML";n.every(f=>!!f&&!s.composedPath().includes(f))&&!u&&e()}else r.current&&!r.current.contains(i)&&e()};return(t||QS).forEach(s=>document.addEventListener(s,o)),()=>{(t||QS).forEach(s=>document.removeEventListener(s,o))}},[r,e,n]),r}function qB(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function KB(e,t){return typeof t=="boolean"?t:typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function YB(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,o]=p.useState(n?t:KB(e,t)),s=p.useRef();return p.useEffect(()=>{if("matchMedia"in window)return s.current=window.matchMedia(e),o(s.current.matches),qB(s.current,i=>o(i.matches))},[e]),r}const jP=typeof document<"u"?p.useLayoutEffect:p.useEffect;function Cs(e,t){const n=p.useRef(!1);p.useEffect(()=>()=>{n.current=!1},[]),p.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function XB({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 Cs(()=>{let o=-1;const s=i=>{i.key==="Tab"&&window.clearTimeout(o)};return document.addEventListener("keydown",s),e?n.current=document.activeElement:t&&(o=window.setTimeout(r,10)),()=>{window.clearTimeout(o),document.removeEventListener("keydown",s)}},[e,t]),r}const QB=/input|select|textarea|button|object/,EP="a, input, select, textarea, button, object, [tabindex]";function ZB(e){return e.style.display==="none"}function JB(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(ZB(n))return!1;n=n.parentNode}return!0}function IP(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function c0(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(IP(e));return(QB.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&JB(e)}function OP(e){const t=IP(e);return(Number.isNaN(t)||t>=0)&&c0(e)}function eH(e){return Array.from(e.querySelectorAll(EP)).filter(OP)}function tH(e,t){const n=eH(e);if(!n.length){t.preventDefault();return}const r=n[t.shiftKey?0:n.length-1],o=e.getRootNode();if(!(r===o.activeElement||e===o.activeElement))return;t.preventDefault();const i=n[t.shiftKey?n.length-1:0];i&&i.focus()}function ry(){return`mantine-${Math.random().toString(36).slice(2,11)}`}function nH(e,t="body > :not(script)"){const n=ry(),r=Array.from(document.querySelectorAll(t)).map(o=>{var s;if((s=o==null?void 0:o.shadowRoot)!=null&&s.contains(e)||o.contains(e))return;const i=o.getAttribute("aria-hidden"),u=o.getAttribute("data-hidden"),d=o.getAttribute("data-focus-id");return o.setAttribute("data-focus-id",n),i===null||i==="false"?o.setAttribute("aria-hidden","true"):!u&&!d&&o.setAttribute("data-hidden",i),{node:o,ariaHidden:u||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 rH(e=!0){const t=p.useRef(),n=p.useRef(null),r=s=>{let i=s.querySelector("[data-autofocus]");if(!i){const u=Array.from(s.querySelectorAll(EP));i=u.find(OP)||u.find(c0)||null,!i&&c0(s)&&(i=s)}i&&i.focus({preventScroll:!0})},o=p.useCallback(s=>{if(e){if(s===null){n.current&&(n.current(),n.current=null);return}n.current=nH(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=i=>{i.key==="Tab"&&t.current&&tH(t.current,i)};return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s),n.current&&n.current()}},[e]),o}const oH=L["useId".toString()]||(()=>{});function sH(){const e=oH();return e?`mantine-${e.replace(/:/g,"")}`:""}function oy(e){const t=sH(),[n,r]=p.useState(t);return jP(()=>{r(ry())},[]),typeof e=="string"?e:typeof window>"u"?t:n}function ZS(e,t,n){p.useEffect(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function RP(e,t){typeof e=="function"?e(t):typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function aH(...e){return t=>{e.forEach(n=>RP(n,t))}}function Zu(...e){return p.useCallback(aH(...e),e)}function Pu({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){const[o,s]=p.useState(t!==void 0?t:n),i=u=>{s(u),r==null||r(u)};return e!==void 0?[e,r,!0]:[o,i,!1]}function TP(e,t){return YB("(prefers-reduced-motion: reduce)",e,t)}const iH=e=>e<.5?2*e*e:-1+(4-2*e)*e,lH=({axis:e,target:t,parent:n,alignment:r,offset:o,isList:s})=>{if(!t||!n&&typeof document>"u")return 0;const i=!!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=i?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=i?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},cH=({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]},uH=({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 MP({duration:e=1250,axis:t="y",onScrollFinish:n,easing:r=iH,offset:o=0,cancelable:s=!0,isList:i=!1}={}){const u=p.useRef(0),d=p.useRef(0),f=p.useRef(!1),h=p.useRef(null),m=p.useRef(null),v=TP(),y=()=>{u.current&&cancelAnimationFrame(u.current)},S=p.useCallback(({alignment:C="start"}={})=>{var k;f.current=!1,u.current&&y();const P=(k=cH({parent:h.current,axis:t}))!=null?k:0,j=lH({parent:h.current,target:m.current,axis:t,alignment:C,offset:o,isList:i})-(h.current?0:P);function E(){d.current===0&&(d.current=performance.now());const I=performance.now()-d.current,R=v||e===0?1:I/e,T=P+j*r(R);uH({parent:h.current,axis:t,distance:T}),!f.current&&R<1?u.current=requestAnimationFrame(E):(typeof n=="function"&&n(),d.current=0,u.current=0,y())}E()},[t,e,r,i,o,n,v]),w=()=>{s&&(f.current=!0)};return ZS("wheel",w,{passive:!0}),ZS("touchmove",w,{passive:!0}),p.useEffect(()=>y,[]),{scrollableRef:h,targetRef:m,scrollIntoView:S,cancel:y}}var JS=Object.getOwnPropertySymbols,dH=Object.prototype.hasOwnProperty,fH=Object.prototype.propertyIsEnumerable,pH=(e,t)=>{var n={};for(var r in e)dH.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&JS)for(var r of JS(e))t.indexOf(r)<0&&fH.call(e,r)&&(n[r]=e[r]);return n};function Uh(e){const t=e,{m:n,mx:r,my:o,mt:s,mb:i,ml:u,mr:d,p:f,px:h,py:m,pt:v,pb:y,pl:S,pr:w,bg:C,c:k,opacity:P,ff:j,fz:E,fw:O,lts:I,ta:R,lh:T,fs:D,tt:$,td:A,w:J,miw:z,maw:B,h:G,mih:K,mah:N,bgsz:V,bgp:W,bgr:U,bga:re,pos:ve,top:le,left:se,bottom:Y,right:ae,inset:ue,display:xe}=t,oe=pH(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:LR({m:n,mx:r,my:o,mt:s,mb:i,ml:u,mr:d,p:f,px:h,py:m,pt:v,pb:y,pl:S,pr:w,bg:C,c:k,opacity:P,ff:j,fz:E,fw:O,lts:I,ta:R,lh:T,fs:D,tt:$,td:A,w:J,miw:z,maw:B,h:G,mih:K,mah:N,bgsz:V,bgp:W,bgr:U,bga:re,pos:ve,top:le,left:se,bottom:Y,right:ae,inset:ue,display:xe}),rest:oe}}function hH(e,t){const n=Object.keys(e).filter(r=>r!=="base").sort((r,o)=>u2(At({size:r,sizes:t.breakpoints}))-u2(At({size:o,sizes:t.breakpoints})));return"base"in e?["base",...n]:n}function mH({value:e,theme:t,getValue:n,property:r}){if(e==null)return;if(typeof e=="object")return hH(e,t).reduce((i,u)=>{if(u==="base"&&e.base!==void 0){const f=n(e.base,t);return Array.isArray(r)?(r.forEach(h=>{i[h]=f}),i):(i[r]=f,i)}const d=n(e[u],t);return Array.isArray(r)?(i[t.fn.largerThan(u)]={},r.forEach(f=>{i[t.fn.largerThan(u)][f]=d}),i):(i[t.fn.largerThan(u)]={[r]:d},i)},{});const o=n(e,t);return Array.isArray(r)?r.reduce((s,i)=>(s[i]=o,s),{}):{[r]:o}}function gH(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 vH(e){return Le(e)}function yH(e){return e}function bH(e,t){return At({size:e,sizes:t.fontSizes})}const xH=["-xs","-sm","-md","-lg","-xl"];function SH(e,t){return xH.includes(e)?`calc(${At({size:e.replace("-",""),sizes:t.spacing})} * -1)`:At({size:e,sizes:t.spacing})}const wH={identity:yH,color:gH,size:vH,fontSize:bH,spacing:SH},CH={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 kH=Object.defineProperty,ew=Object.getOwnPropertySymbols,PH=Object.prototype.hasOwnProperty,_H=Object.prototype.propertyIsEnumerable,tw=(e,t,n)=>t in e?kH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nw=(e,t)=>{for(var n in t||(t={}))PH.call(t,n)&&tw(e,n,t[n]);if(ew)for(var n of ew(t))_H.call(t,n)&&tw(e,n,t[n]);return e};function rw(e,t,n=CH){return Object.keys(n).reduce((o,s)=>(s in e&&e[s]!==void 0&&o.push(mH({value:e[s],getValue:wH[n[s].type],property:n[s].property,theme:t})),o),[]).reduce((o,s)=>(Object.keys(s).forEach(i=>{typeof s[i]=="object"&&s[i]!==null&&i in o?o[i]=nw(nw({},o[i]),s[i]):o[i]=s[i]}),o),{})}function ow(e,t){return typeof e=="function"?e(t):e}function jH(e,t,n){const r=Ia(),{css:o,cx:s}=_P();return Array.isArray(e)?s(n,o(rw(t,r)),e.map(i=>o(ow(i,r)))):s(n,o(ow(e,r)),o(rw(t,r)))}var EH=Object.defineProperty,vp=Object.getOwnPropertySymbols,DP=Object.prototype.hasOwnProperty,AP=Object.prototype.propertyIsEnumerable,sw=(e,t,n)=>t in e?EH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,IH=(e,t)=>{for(var n in t||(t={}))DP.call(t,n)&&sw(e,n,t[n]);if(vp)for(var n of vp(t))AP.call(t,n)&&sw(e,n,t[n]);return e},OH=(e,t)=>{var n={};for(var r in e)DP.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&vp)for(var r of vp(e))t.indexOf(r)<0&&AP.call(e,r)&&(n[r]=e[r]);return n};const NP=p.forwardRef((e,t)=>{var n=e,{className:r,component:o,style:s,sx:i}=n,u=OH(n,["className","component","style","sx"]);const{systemStyles:d,rest:f}=Uh(u),h=o||"div";return L.createElement(h,IH({ref:t,className:jH(i,d,r),style:s},f))});NP.displayName="@mantine/core/Box";const yo=NP;var RH=Object.defineProperty,TH=Object.defineProperties,MH=Object.getOwnPropertyDescriptors,aw=Object.getOwnPropertySymbols,DH=Object.prototype.hasOwnProperty,AH=Object.prototype.propertyIsEnumerable,iw=(e,t,n)=>t in e?RH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lw=(e,t)=>{for(var n in t||(t={}))DH.call(t,n)&&iw(e,n,t[n]);if(aw)for(var n of aw(t))AH.call(t,n)&&iw(e,n,t[n]);return e},NH=(e,t)=>TH(e,MH(t)),zH=Jr(e=>({root:NH(lw(lw({},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 $H=zH;var LH=Object.defineProperty,yp=Object.getOwnPropertySymbols,zP=Object.prototype.hasOwnProperty,$P=Object.prototype.propertyIsEnumerable,cw=(e,t,n)=>t in e?LH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,FH=(e,t)=>{for(var n in t||(t={}))zP.call(t,n)&&cw(e,n,t[n]);if(yp)for(var n of yp(t))$P.call(t,n)&&cw(e,n,t[n]);return e},BH=(e,t)=>{var n={};for(var r in e)zP.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&yp)for(var r of yp(e))t.indexOf(r)<0&&$P.call(e,r)&&(n[r]=e[r]);return n};const LP=p.forwardRef((e,t)=>{const n=wr("UnstyledButton",{},e),{className:r,component:o="button",unstyled:s,variant:i}=n,u=BH(n,["className","component","unstyled","variant"]),{classes:d,cx:f}=$H(null,{name:"UnstyledButton",unstyled:s,variant:i});return L.createElement(yo,FH({component:o,ref:t,className:f(d.root,r),type:o==="button"?"button":void 0},u))});LP.displayName="@mantine/core/UnstyledButton";const HH=LP;var WH=Object.defineProperty,VH=Object.defineProperties,UH=Object.getOwnPropertyDescriptors,uw=Object.getOwnPropertySymbols,GH=Object.prototype.hasOwnProperty,qH=Object.prototype.propertyIsEnumerable,dw=(e,t,n)=>t in e?WH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,u0=(e,t)=>{for(var n in t||(t={}))GH.call(t,n)&&dw(e,n,t[n]);if(uw)for(var n of uw(t))qH.call(t,n)&&dw(e,n,t[n]);return e},fw=(e,t)=>VH(e,UH(t));const KH=["subtle","filled","outline","light","default","transparent","gradient"],ff={xs:Le(18),sm:Le(22),md:Le(28),lg:Le(34),xl:Le(44)};function YH({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%"})}:KH.includes(e)?u0({border:`${Le(1)} solid ${o.border}`,backgroundColor:o.background,color:o.color},t.fn.hover({backgroundColor:o.hover})):null}var XH=Jr((e,{radius:t,color:n,gradient:r},{variant:o,size:s})=>({root:fw(u0({position:"relative",borderRadius:e.fn.radius(t),padding:0,lineHeight:1,display:"flex",alignItems:"center",justifyContent:"center",height:At({size:s,sizes:ff}),minHeight:At({size:s,sizes:ff}),width:At({size:s,sizes:ff}),minWidth:At({size:s,sizes:ff})},YH({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":fw(u0({content:'""'},e.fn.cover(Le(-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 QH=XH;var ZH=Object.defineProperty,bp=Object.getOwnPropertySymbols,FP=Object.prototype.hasOwnProperty,BP=Object.prototype.propertyIsEnumerable,pw=(e,t,n)=>t in e?ZH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,JH=(e,t)=>{for(var n in t||(t={}))FP.call(t,n)&&pw(e,n,t[n]);if(bp)for(var n of bp(t))BP.call(t,n)&&pw(e,n,t[n]);return e},eW=(e,t)=>{var n={};for(var r in e)FP.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&bp)for(var r of bp(e))t.indexOf(r)<0&&BP.call(e,r)&&(n[r]=e[r]);return n};function tW(e){var t=e,{size:n,color:r}=t,o=eW(t,["size","color"]);return L.createElement("svg",JH({viewBox:"0 0 135 140",xmlns:"http://www.w3.org/2000/svg",fill:r,width:n},o),L.createElement("rect",{y:"10",width:"15",height:"120",rx:"6"},L.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"}),L.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"})),L.createElement("rect",{x:"30",y:"10",width:"15",height:"120",rx:"6"},L.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"}),L.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"})),L.createElement("rect",{x:"60",width:"15",height:"140",rx:"6"},L.createElement("animate",{attributeName:"height",begin:"0s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),L.createElement("animate",{attributeName:"y",begin:"0s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),L.createElement("rect",{x:"90",y:"10",width:"15",height:"120",rx:"6"},L.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"}),L.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"})),L.createElement("rect",{x:"120",y:"10",width:"15",height:"120",rx:"6"},L.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"}),L.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 nW=Object.defineProperty,xp=Object.getOwnPropertySymbols,HP=Object.prototype.hasOwnProperty,WP=Object.prototype.propertyIsEnumerable,hw=(e,t,n)=>t in e?nW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,rW=(e,t)=>{for(var n in t||(t={}))HP.call(t,n)&&hw(e,n,t[n]);if(xp)for(var n of xp(t))WP.call(t,n)&&hw(e,n,t[n]);return e},oW=(e,t)=>{var n={};for(var r in e)HP.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&xp)for(var r of xp(e))t.indexOf(r)<0&&WP.call(e,r)&&(n[r]=e[r]);return n};function sW(e){var t=e,{size:n,color:r}=t,o=oW(t,["size","color"]);return L.createElement("svg",rW({width:n,height:n,viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:r},o),L.createElement("g",{fill:"none",fillRule:"evenodd"},L.createElement("g",{transform:"translate(2.5 2.5)",strokeWidth:"5"},L.createElement("circle",{strokeOpacity:".5",cx:"16",cy:"16",r:"16"}),L.createElement("path",{d:"M32 16c0-9.94-8.06-16-16-16"},L.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 16 16",to:"360 16 16",dur:"1s",repeatCount:"indefinite"})))))}var aW=Object.defineProperty,Sp=Object.getOwnPropertySymbols,VP=Object.prototype.hasOwnProperty,UP=Object.prototype.propertyIsEnumerable,mw=(e,t,n)=>t in e?aW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,iW=(e,t)=>{for(var n in t||(t={}))VP.call(t,n)&&mw(e,n,t[n]);if(Sp)for(var n of Sp(t))UP.call(t,n)&&mw(e,n,t[n]);return e},lW=(e,t)=>{var n={};for(var r in e)VP.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Sp)for(var r of Sp(e))t.indexOf(r)<0&&UP.call(e,r)&&(n[r]=e[r]);return n};function cW(e){var t=e,{size:n,color:r}=t,o=lW(t,["size","color"]);return L.createElement("svg",iW({width:n,viewBox:"0 0 120 30",xmlns:"http://www.w3.org/2000/svg",fill:r},o),L.createElement("circle",{cx:"15",cy:"15",r:"15"},L.createElement("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),L.createElement("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})),L.createElement("circle",{cx:"60",cy:"15",r:"9",fillOpacity:"0.3"},L.createElement("animate",{attributeName:"r",from:"9",to:"9",begin:"0s",dur:"0.8s",values:"9;15;9",calcMode:"linear",repeatCount:"indefinite"}),L.createElement("animate",{attributeName:"fill-opacity",from:"0.5",to:"0.5",begin:"0s",dur:"0.8s",values:".5;1;.5",calcMode:"linear",repeatCount:"indefinite"})),L.createElement("circle",{cx:"105",cy:"15",r:"15"},L.createElement("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),L.createElement("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})))}var uW=Object.defineProperty,wp=Object.getOwnPropertySymbols,GP=Object.prototype.hasOwnProperty,qP=Object.prototype.propertyIsEnumerable,gw=(e,t,n)=>t in e?uW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dW=(e,t)=>{for(var n in t||(t={}))GP.call(t,n)&&gw(e,n,t[n]);if(wp)for(var n of wp(t))qP.call(t,n)&&gw(e,n,t[n]);return e},fW=(e,t)=>{var n={};for(var r in e)GP.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&wp)for(var r of wp(e))t.indexOf(r)<0&&qP.call(e,r)&&(n[r]=e[r]);return n};const Jg={bars:tW,oval:sW,dots:cW},pW={xs:Le(18),sm:Le(22),md:Le(36),lg:Le(44),xl:Le(58)},hW={size:"md"};function KP(e){const t=wr("Loader",hW,e),{size:n,color:r,variant:o}=t,s=fW(t,["size","color","variant"]),i=Ia(),u=o in Jg?o:i.loader;return L.createElement(yo,dW({role:"presentation",component:Jg[u]||Jg.bars,size:At({size:n,sizes:pW}),color:i.fn.variant({variant:"filled",primaryFallback:!1,color:r||i.primaryColor}).background},s))}KP.displayName="@mantine/core/Loader";var mW=Object.defineProperty,Cp=Object.getOwnPropertySymbols,YP=Object.prototype.hasOwnProperty,XP=Object.prototype.propertyIsEnumerable,vw=(e,t,n)=>t in e?mW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yw=(e,t)=>{for(var n in t||(t={}))YP.call(t,n)&&vw(e,n,t[n]);if(Cp)for(var n of Cp(t))XP.call(t,n)&&vw(e,n,t[n]);return e},gW=(e,t)=>{var n={};for(var r in e)YP.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Cp)for(var r of Cp(e))t.indexOf(r)<0&&XP.call(e,r)&&(n[r]=e[r]);return n};const vW={color:"gray",size:"md",variant:"subtle"},QP=p.forwardRef((e,t)=>{const n=wr("ActionIcon",vW,e),{className:r,color:o,children:s,radius:i,size:u,variant:d,gradient:f,disabled:h,loaderProps:m,loading:v,unstyled:y,__staticSelector:S}=n,w=gW(n,["className","color","children","radius","size","variant","gradient","disabled","loaderProps","loading","unstyled","__staticSelector"]),{classes:C,cx:k,theme:P}=QH({radius:i,color:o,gradient:f},{name:["ActionIcon",S],unstyled:y,size:u,variant:d}),j=L.createElement(KP,yw({color:P.fn.variant({color:o,variant:d}).color,size:"100%","data-action-icon-loader":!0},m));return L.createElement(HH,yw({className:k(C.root,r),ref:t,disabled:h,"data-disabled":h||void 0,"data-loading":v||void 0,unstyled:y},w),v?j:s)});QP.displayName="@mantine/core/ActionIcon";const yW=QP;var bW=Object.defineProperty,xW=Object.defineProperties,SW=Object.getOwnPropertyDescriptors,kp=Object.getOwnPropertySymbols,ZP=Object.prototype.hasOwnProperty,JP=Object.prototype.propertyIsEnumerable,bw=(e,t,n)=>t in e?bW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wW=(e,t)=>{for(var n in t||(t={}))ZP.call(t,n)&&bw(e,n,t[n]);if(kp)for(var n of kp(t))JP.call(t,n)&&bw(e,n,t[n]);return e},CW=(e,t)=>xW(e,SW(t)),kW=(e,t)=>{var n={};for(var r in e)ZP.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&kp)for(var r of kp(e))t.indexOf(r)<0&&JP.call(e,r)&&(n[r]=e[r]);return n};function e_(e){const t=wr("Portal",{},e),{children:n,target:r,className:o,innerRef:s}=t,i=kW(t,["children","target","className","innerRef"]),u=Ia(),[d,f]=p.useState(!1),h=p.useRef();return jP(()=>(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?hc.createPortal(L.createElement("div",CW(wW({className:o,dir:u.dir},i),{ref:s}),n),h.current):null}e_.displayName="@mantine/core/Portal";var PW=Object.defineProperty,Pp=Object.getOwnPropertySymbols,t_=Object.prototype.hasOwnProperty,n_=Object.prototype.propertyIsEnumerable,xw=(e,t,n)=>t in e?PW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_W=(e,t)=>{for(var n in t||(t={}))t_.call(t,n)&&xw(e,n,t[n]);if(Pp)for(var n of Pp(t))n_.call(t,n)&&xw(e,n,t[n]);return e},jW=(e,t)=>{var n={};for(var r in e)t_.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Pp)for(var r of Pp(e))t.indexOf(r)<0&&n_.call(e,r)&&(n[r]=e[r]);return n};function r_(e){var t=e,{withinPortal:n=!0,children:r}=t,o=jW(t,["withinPortal","children"]);return n?L.createElement(e_,_W({},o),r):L.createElement(L.Fragment,null,r)}r_.displayName="@mantine/core/OptionalPortal";var EW=Object.defineProperty,Sw=Object.getOwnPropertySymbols,IW=Object.prototype.hasOwnProperty,OW=Object.prototype.propertyIsEnumerable,ww=(e,t,n)=>t in e?EW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,RW=(e,t)=>{for(var n in t||(t={}))IW.call(t,n)&&ww(e,n,t[n]);if(Sw)for(var n of Sw(t))OW.call(t,n)&&ww(e,n,t[n]);return e};function o_(e){return L.createElement("svg",RW({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),L.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"}))}o_.displayName="@mantine/core/CloseIcon";var TW=Object.defineProperty,_p=Object.getOwnPropertySymbols,s_=Object.prototype.hasOwnProperty,a_=Object.prototype.propertyIsEnumerable,Cw=(e,t,n)=>t in e?TW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,MW=(e,t)=>{for(var n in t||(t={}))s_.call(t,n)&&Cw(e,n,t[n]);if(_p)for(var n of _p(t))a_.call(t,n)&&Cw(e,n,t[n]);return e},DW=(e,t)=>{var n={};for(var r in e)s_.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&_p)for(var r of _p(e))t.indexOf(r)<0&&a_.call(e,r)&&(n[r]=e[r]);return n};const AW={xs:Le(12),sm:Le(16),md:Le(20),lg:Le(28),xl:Le(34)},NW={size:"sm"},i_=p.forwardRef((e,t)=>{const n=wr("CloseButton",NW,e),{iconSize:r,size:o,children:s}=n,i=DW(n,["iconSize","size","children"]),u=Le(r||AW[o]);return L.createElement(yW,MW({ref:t,__staticSelector:"CloseButton",size:o},i),s||L.createElement(o_,{width:u,height:u}))});i_.displayName="@mantine/core/CloseButton";const l_=i_;var zW=Object.defineProperty,$W=Object.defineProperties,LW=Object.getOwnPropertyDescriptors,kw=Object.getOwnPropertySymbols,FW=Object.prototype.hasOwnProperty,BW=Object.prototype.propertyIsEnumerable,Pw=(e,t,n)=>t in e?zW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pf=(e,t)=>{for(var n in t||(t={}))FW.call(t,n)&&Pw(e,n,t[n]);if(kw)for(var n of kw(t))BW.call(t,n)&&Pw(e,n,t[n]);return e},HW=(e,t)=>$W(e,LW(t));function WW({underline:e,strikethrough:t}){const n=[];return e&&n.push("underline"),t&&n.push("line-through"),n.length>0?n.join(" "):"none"}function VW({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 UW(e){return typeof e=="number"?{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical"}:null}function GW({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 qW=Jr((e,{color:t,lineClamp:n,truncate:r,inline:o,inherit:s,underline:i,gradient:u,weight:d,transform:f,align:h,strikethrough:m,italic:v},{size:y})=>{const S=e.fn.variant({variant:"gradient",gradient:u});return{root:HW(pf(pf(pf(pf({},e.fn.fontStyles()),e.fn.focusStyles()),UW(n)),GW({theme:e,truncate:r})),{color:VW({color:t,theme:e}),fontFamily:s?"inherit":e.fontFamily,fontSize:s||y===void 0?"inherit":At({size:y,sizes:e.fontSizes}),lineHeight:s?"inherit":o?1:e.lineHeight,textDecoration:WW({underline:i,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 KW=qW;var YW=Object.defineProperty,jp=Object.getOwnPropertySymbols,c_=Object.prototype.hasOwnProperty,u_=Object.prototype.propertyIsEnumerable,_w=(e,t,n)=>t in e?YW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,XW=(e,t)=>{for(var n in t||(t={}))c_.call(t,n)&&_w(e,n,t[n]);if(jp)for(var n of jp(t))u_.call(t,n)&&_w(e,n,t[n]);return e},QW=(e,t)=>{var n={};for(var r in e)c_.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&jp)for(var r of jp(e))t.indexOf(r)<0&&u_.call(e,r)&&(n[r]=e[r]);return n};const ZW={variant:"text"},d_=p.forwardRef((e,t)=>{const n=wr("Text",ZW,e),{className:r,size:o,weight:s,transform:i,color:u,align:d,variant:f,lineClamp:h,truncate:m,gradient:v,inline:y,inherit:S,underline:w,strikethrough:C,italic:k,classNames:P,styles:j,unstyled:E,span:O,__staticSelector:I}=n,R=QW(n,["className","size","weight","transform","color","align","variant","lineClamp","truncate","gradient","inline","inherit","underline","strikethrough","italic","classNames","styles","unstyled","span","__staticSelector"]),{classes:T,cx:D}=KW({color:u,lineClamp:h,truncate:m,inline:y,inherit:S,underline:w,strikethrough:C,italic:k,weight:s,transform:i,align:d,gradient:v},{unstyled:E,name:I||"Text",variant:f,size:o});return L.createElement(yo,XW({ref:t,className:D(T.root,{[T.gradient]:f==="gradient"},r),component:O?"span":"div"},R))});d_.displayName="@mantine/core/Text";const Jl=d_,hf={xs:Le(1),sm:Le(2),md:Le(3),lg:Le(4),xl:Le(5)};function mf(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 JW=Jr((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:Le(1),borderTop:`${At({size:n,sizes:hf})} ${r} ${mf(e,t)}`,marginRight:e.spacing.xs},"&::after":{content:'""',flex:1,borderTop:`${At({size:n,sizes:hf})} ${r} ${mf(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:Le(At({size:n,sizes:hf})),borderTopColor:mf(e,t),borderTopStyle:r,margin:0},vertical:{border:0,alignSelf:"stretch",height:"auto",borderLeftWidth:Le(At({size:n,sizes:hf})),borderLeftColor:mf(e,t),borderLeftStyle:r}}));const eV=JW;var tV=Object.defineProperty,nV=Object.defineProperties,rV=Object.getOwnPropertyDescriptors,Ep=Object.getOwnPropertySymbols,f_=Object.prototype.hasOwnProperty,p_=Object.prototype.propertyIsEnumerable,jw=(e,t,n)=>t in e?tV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ew=(e,t)=>{for(var n in t||(t={}))f_.call(t,n)&&jw(e,n,t[n]);if(Ep)for(var n of Ep(t))p_.call(t,n)&&jw(e,n,t[n]);return e},oV=(e,t)=>nV(e,rV(t)),sV=(e,t)=>{var n={};for(var r in e)f_.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ep)for(var r of Ep(e))t.indexOf(r)<0&&p_.call(e,r)&&(n[r]=e[r]);return n};const aV={orientation:"horizontal",size:"xs",labelPosition:"left",variant:"solid"},d0=p.forwardRef((e,t)=>{const n=wr("Divider",aV,e),{className:r,color:o,orientation:s,size:i,label:u,labelPosition:d,labelProps:f,variant:h,styles:m,classNames:v,unstyled:y}=n,S=sV(n,["className","color","orientation","size","label","labelPosition","labelProps","variant","styles","classNames","unstyled"]),{classes:w,cx:C}=eV({color:o},{classNames:v,styles:m,unstyled:y,name:"Divider",variant:h,size:i}),k=s==="vertical",P=s==="horizontal",j=!!u&&P,E=!(f!=null&&f.color);return L.createElement(yo,Ew({ref:t,className:C(w.root,{[w.vertical]:k,[w.horizontal]:P,[w.withLabel]:j},r),role:"separator"},S),j&&L.createElement(Jl,oV(Ew({},f),{size:(f==null?void 0:f.size)||"xs",mt:Le(2),className:C(w.label,w[d],{[w.labelDefaultStyles]:E})}),u))});d0.displayName="@mantine/core/Divider";var iV=Object.defineProperty,lV=Object.defineProperties,cV=Object.getOwnPropertyDescriptors,Iw=Object.getOwnPropertySymbols,uV=Object.prototype.hasOwnProperty,dV=Object.prototype.propertyIsEnumerable,Ow=(e,t,n)=>t in e?iV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Rw=(e,t)=>{for(var n in t||(t={}))uV.call(t,n)&&Ow(e,n,t[n]);if(Iw)for(var n of Iw(t))dV.call(t,n)&&Ow(e,n,t[n]);return e},fV=(e,t)=>lV(e,cV(t)),pV=Jr((e,t,{size:n})=>({item:fV(Rw({},e.fn.fontStyles()),{boxSizing:"border-box",wordBreak:"break-all",textAlign:"left",width:"100%",padding:`calc(${At({size:n,sizes:e.spacing})} / 1.5) ${At({size:n,sizes:e.spacing})}`,cursor:"pointer",fontSize:At({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]":Rw({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(${At({size:n,sizes:e.spacing})} / 2)`,paddingBottom:`calc(${At({size:n,sizes:e.spacing})} / 2)`,textAlign:"center"},separator:{boxSizing:"border-box",textAlign:"left",width:"100%",padding:`calc(${At({size:n,sizes:e.spacing})} / 1.5) ${At({size:n,sizes:e.spacing})}`},separatorLabel:{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]}}));const hV=pV;var mV=Object.defineProperty,Tw=Object.getOwnPropertySymbols,gV=Object.prototype.hasOwnProperty,vV=Object.prototype.propertyIsEnumerable,Mw=(e,t,n)=>t in e?mV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yV=(e,t)=>{for(var n in t||(t={}))gV.call(t,n)&&Mw(e,n,t[n]);if(Tw)for(var n of Tw(t))vV.call(t,n)&&Mw(e,n,t[n]);return e};function sy({data:e,hovered:t,classNames:n,styles:r,isItemSelected:o,uuid:s,__staticSelector:i,onItemHover:u,onItemSelect:d,itemsRefs:f,itemComponent:h,size:m,nothingFound:v,creatable:y,createLabel:S,unstyled:w,variant:C}){const{classes:k}=hV(null,{classNames:n,styles:r,unstyled:w,name:i,variant:C,size:m}),P=[],j=[];let E=null;const O=(R,T)=>{const D=typeof o=="function"?o(R.value):!1;return L.createElement(h,yV({key:R.value,className:k.item,"data-disabled":R.disabled||void 0,"data-hovered":!R.disabled&&t===T||void 0,"data-selected":!R.disabled&&D||void 0,selected:D,onMouseEnter:()=>u(T),id:`${s}-${T}`,role:"option",tabIndex:-1,"aria-selected":t===T,ref:$=>{f&&f.current&&(f.current[R.value]=$)},onMouseDown:R.disabled?null:$=>{$.preventDefault(),d(R)},disabled:R.disabled,variant:C},R))};let I=null;if(e.forEach((R,T)=>{R.creatable?E=T:R.group?(I!==R.group&&(I=R.group,j.push(L.createElement("div",{className:k.separator,key:`__mantine-divider-${T}`},L.createElement(d0,{classNames:{label:k.separatorLabel},label:R.group})))),j.push(O(R,T))):P.push(O(R,T))}),y){const R=e[E];P.push(L.createElement("div",{key:ry(),className:k.item,"data-hovered":t===E||void 0,onMouseEnter:()=>u(E),onMouseDown:T=>{T.preventDefault(),d(R)},tabIndex:-1,ref:T=>{f&&f.current&&(f.current[R.value]=T)}},S))}return j.length>0&&P.length>0&&P.unshift(L.createElement("div",{className:k.separator,key:"empty-group-separator"},L.createElement(d0,null))),j.length>0||P.length>0?L.createElement(L.Fragment,null,j,P):L.createElement(Jl,{size:m,unstyled:w,className:k.nothingFound},v)}sy.displayName="@mantine/core/SelectItems";var bV=Object.defineProperty,Ip=Object.getOwnPropertySymbols,h_=Object.prototype.hasOwnProperty,m_=Object.prototype.propertyIsEnumerable,Dw=(e,t,n)=>t in e?bV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xV=(e,t)=>{for(var n in t||(t={}))h_.call(t,n)&&Dw(e,n,t[n]);if(Ip)for(var n of Ip(t))m_.call(t,n)&&Dw(e,n,t[n]);return e},SV=(e,t)=>{var n={};for(var r in e)h_.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ip)for(var r of Ip(e))t.indexOf(r)<0&&m_.call(e,r)&&(n[r]=e[r]);return n};const ay=p.forwardRef((e,t)=>{var n=e,{label:r,value:o}=n,s=SV(n,["label","value"]);return L.createElement("div",xV({ref:t},s),r||o)});ay.displayName="@mantine/core/DefaultItem";function wV(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function g_(...e){return t=>e.forEach(n=>wV(n,t))}function ol(...e){return p.useCallback(g_(...e),e)}const v_=p.forwardRef((e,t)=>{const{children:n,...r}=e,o=p.Children.toArray(n),s=o.find(kV);if(s){const i=s.props.children,u=o.map(d=>d===s?p.Children.count(i)>1?p.Children.only(null):p.isValidElement(i)?i.props.children:null:d);return p.createElement(f0,rr({},r,{ref:t}),p.isValidElement(i)?p.cloneElement(i,void 0,u):null)}return p.createElement(f0,rr({},r,{ref:t}),n)});v_.displayName="Slot";const f0=p.forwardRef((e,t)=>{const{children:n,...r}=e;return p.isValidElement(n)?p.cloneElement(n,{...PV(r,n.props),ref:g_(t,n.ref)}):p.Children.count(n)>1?p.Children.only(null):null});f0.displayName="SlotClone";const CV=({children:e})=>p.createElement(p.Fragment,null,e);function kV(e){return p.isValidElement(e)&&e.type===CV}function PV(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]=(...u)=>{s(...u),o(...u)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}const _V=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],Ju=_V.reduce((e,t)=>{const n=p.forwardRef((r,o)=>{const{asChild:s,...i}=r,u=s?v_:t;return p.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),p.createElement(u,rr({},i,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),p0=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{};function jV(e,t){return p.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const ed=e=>{const{present:t,children:n}=e,r=EV(t),o=typeof n=="function"?n({present:r.isPresent}):p.Children.only(n),s=ol(r.ref,o.ref);return typeof n=="function"||r.isPresent?p.cloneElement(o,{ref:s}):null};ed.displayName="Presence";function EV(e){const[t,n]=p.useState(),r=p.useRef({}),o=p.useRef(e),s=p.useRef("none"),i=e?"mounted":"unmounted",[u,d]=jV(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const f=gf(r.current);s.current=u==="mounted"?f:"none"},[u]),p0(()=>{const f=r.current,h=o.current;if(h!==e){const v=s.current,y=gf(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]),p0(()=>{if(t){const f=m=>{const y=gf(r.current).includes(m.animationName);m.target===t&&y&&hc.flushSync(()=>d("ANIMATION_END"))},h=m=>{m.target===t&&(s.current=gf(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(u),ref:p.useCallback(f=>{f&&(r.current=getComputedStyle(f)),n(f)},[])}}function gf(e){return(e==null?void 0:e.animationName)||"none"}function IV(e,t=[]){let n=[];function r(s,i){const u=p.createContext(i),d=n.length;n=[...n,i];function f(m){const{scope:v,children:y,...S}=m,w=(v==null?void 0:v[e][d])||u,C=p.useMemo(()=>S,Object.values(S));return p.createElement(w.Provider,{value:C},y)}function h(m,v){const y=(v==null?void 0:v[e][d])||u,S=p.useContext(y);if(S)return S;if(i!==void 0)return i;throw new Error(`\`${m}\` must be used within \`${s}\``)}return f.displayName=s+"Provider",[f,h]}const o=()=>{const s=n.map(i=>p.createContext(i));return function(u){const d=(u==null?void 0:u[e])||s;return p.useMemo(()=>({[`__scope${e}`]:{...u,[e]:d}}),[u,d])}};return o.scopeName=e,[r,OV(o,...t)]}function OV(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((u,{useScope:d,scopeName:f})=>{const m=d(s)[`__scope${f}`];return{...u,...m}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function Ri(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 RV=p.createContext(void 0);function TV(e){const t=p.useContext(RV);return e||t||"ltr"}function MV(e,[t,n]){return Math.min(n,Math.max(t,e))}function Bi(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 DV(e,t){return p.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const y_="ScrollArea",[b_,uie]=IV(y_),[AV,as]=b_(y_),NV=p.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:s=600,...i}=e,[u,d]=p.useState(null),[f,h]=p.useState(null),[m,v]=p.useState(null),[y,S]=p.useState(null),[w,C]=p.useState(null),[k,P]=p.useState(0),[j,E]=p.useState(0),[O,I]=p.useState(!1),[R,T]=p.useState(!1),D=ol(t,A=>d(A)),$=TV(o);return p.createElement(AV,{scope:n,type:r,dir:$,scrollHideDelay:s,scrollArea:u,viewport:f,onViewportChange:h,content:m,onContentChange:v,scrollbarX:y,onScrollbarXChange:S,scrollbarXEnabled:O,onScrollbarXEnabledChange:I,scrollbarY:w,onScrollbarYChange:C,scrollbarYEnabled:R,onScrollbarYEnabledChange:T,onCornerWidthChange:P,onCornerHeightChange:E},p.createElement(Ju.div,rr({dir:$},i,{ref:D,style:{position:"relative",["--radix-scroll-area-corner-width"]:k+"px",["--radix-scroll-area-corner-height"]:j+"px",...e.style}})))}),zV="ScrollAreaViewport",$V=p.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,...o}=e,s=as(zV,n),i=p.useRef(null),u=ol(t,i,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(Ju.div,rr({"data-radix-scroll-area-viewport":""},o,{ref:u,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)))}),Ma="ScrollAreaScrollbar",LV=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=as(Ma,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:i}=o,u=e.orientation==="horizontal";return p.useEffect(()=>(u?s(!0):i(!0),()=>{u?s(!1):i(!1)}),[u,s,i]),o.type==="hover"?p.createElement(FV,rr({},r,{ref:t,forceMount:n})):o.type==="scroll"?p.createElement(BV,rr({},r,{ref:t,forceMount:n})):o.type==="auto"?p.createElement(x_,rr({},r,{ref:t,forceMount:n})):o.type==="always"?p.createElement(iy,rr({},r,{ref:t})):null}),FV=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=as(Ma,e.__scopeScrollArea),[s,i]=p.useState(!1);return p.useEffect(()=>{const u=o.scrollArea;let d=0;if(u){const f=()=>{window.clearTimeout(d),i(!0)},h=()=>{d=window.setTimeout(()=>i(!1),o.scrollHideDelay)};return u.addEventListener("pointerenter",f),u.addEventListener("pointerleave",h),()=>{window.clearTimeout(d),u.removeEventListener("pointerenter",f),u.removeEventListener("pointerleave",h)}}},[o.scrollArea,o.scrollHideDelay]),p.createElement(ed,{present:n||s},p.createElement(x_,rr({"data-state":s?"visible":"hidden"},r,{ref:t})))}),BV=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=as(Ma,e.__scopeScrollArea),s=e.orientation==="horizontal",i=qh(()=>d("SCROLL_END"),100),[u,d]=DV("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(u==="idle"){const f=window.setTimeout(()=>d("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(f)}},[u,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"),i()),m=y};return f.addEventListener("scroll",v),()=>f.removeEventListener("scroll",v)}},[o.viewport,s,d,i]),p.createElement(ed,{present:n||u!=="hidden"},p.createElement(iy,rr({"data-state":u==="hidden"?"hidden":"visible"},r,{ref:t,onPointerEnter:Bi(e.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:Bi(e.onPointerLeave,()=>d("POINTER_LEAVE"))})))}),x_=p.forwardRef((e,t)=>{const n=as(Ma,e.__scopeScrollArea),{forceMount:r,...o}=e,[s,i]=p.useState(!1),u=e.orientation==="horizontal",d=qh(()=>{if(n.viewport){const f=n.viewport.offsetWidth<n.viewport.scrollWidth,h=n.viewport.offsetHeight<n.viewport.scrollHeight;i(u?f:h)}},10);return ec(n.viewport,d),ec(n.content,d),p.createElement(ed,{present:r||s},p.createElement(iy,rr({"data-state":s?"visible":"hidden"},o,{ref:t})))}),iy=p.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=as(Ma,e.__scopeScrollArea),s=p.useRef(null),i=p.useRef(0),[u,d]=p.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=k_(u.viewport,u.content),h={...r,sizes:u,onSizesChange:d,hasThumb:f>0&&f<1,onThumbChange:v=>s.current=v,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:v=>i.current=v};function m(v,y){return YV(v,i.current,u,y)}return n==="horizontal"?p.createElement(HV,rr({},h,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const v=o.viewport.scrollLeft,y=Aw(v,u,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(WV,rr({},h,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const v=o.viewport.scrollTop,y=Aw(v,u);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}),HV=p.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=as(Ma,e.__scopeScrollArea),[i,u]=p.useState(),d=p.useRef(null),f=ol(t,d,s.onScrollbarXChange);return p.useEffect(()=>{d.current&&u(getComputedStyle(d.current))},[d]),p.createElement(w_,rr({"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"]:Gh(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),__(v,m)&&h.preventDefault()}},onResize:()=>{d.current&&s.viewport&&i&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:Op(i.paddingLeft),paddingEnd:Op(i.paddingRight)}})}}))}),WV=p.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=as(Ma,e.__scopeScrollArea),[i,u]=p.useState(),d=p.useRef(null),f=ol(t,d,s.onScrollbarYChange);return p.useEffect(()=>{d.current&&u(getComputedStyle(d.current))},[d]),p.createElement(w_,rr({"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"]:Gh(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),__(v,m)&&h.preventDefault()}},onResize:()=>{d.current&&s.viewport&&i&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:Op(i.paddingTop),paddingEnd:Op(i.paddingBottom)}})}}))}),[VV,S_]=b_(Ma),w_=p.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:s,onThumbPointerUp:i,onThumbPointerDown:u,onThumbPositionChange:d,onDragScroll:f,onWheelScroll:h,onResize:m,...v}=e,y=as(Ma,n),[S,w]=p.useState(null),C=ol(t,D=>w(D)),k=p.useRef(null),P=p.useRef(""),j=y.viewport,E=r.content-r.viewport,O=Ri(h),I=Ri(d),R=qh(m,10);function T(D){if(k.current){const $=D.clientX-k.current.left,A=D.clientY-k.current.top;f({x:$,y:A})}}return p.useEffect(()=>{const D=$=>{const A=$.target;(S==null?void 0:S.contains(A))&&O($,E)};return document.addEventListener("wheel",D,{passive:!1}),()=>document.removeEventListener("wheel",D,{passive:!1})},[j,S,E,O]),p.useEffect(I,[r,I]),ec(S,R),ec(y.content,R),p.createElement(VV,{scope:n,scrollbar:S,hasThumb:o,onThumbChange:Ri(s),onThumbPointerUp:Ri(i),onThumbPositionChange:I,onThumbPointerDown:Ri(u)},p.createElement(Ju.div,rr({},v,{ref:C,style:{position:"absolute",...v.style},onPointerDown:Bi(e.onPointerDown,D=>{D.button===0&&(D.target.setPointerCapture(D.pointerId),k.current=S.getBoundingClientRect(),P.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",T(D))}),onPointerMove:Bi(e.onPointerMove,T),onPointerUp:Bi(e.onPointerUp,D=>{const $=D.target;$.hasPointerCapture(D.pointerId)&&$.releasePointerCapture(D.pointerId),document.body.style.webkitUserSelect=P.current,k.current=null})})))}),h0="ScrollAreaThumb",UV=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=S_(h0,e.__scopeScrollArea);return p.createElement(ed,{present:n||o.hasThumb},p.createElement(GV,rr({ref:t},r)))}),GV=p.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,s=as(h0,n),i=S_(h0,n),{onThumbPositionChange:u}=i,d=ol(t,m=>i.onThumbChange(m)),f=p.useRef(),h=qh(()=>{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=XV(m,u);f.current=y,u()}};return u(),m.addEventListener("scroll",v),()=>m.removeEventListener("scroll",v)}},[s.viewport,h,u]),p.createElement(Ju.div,rr({"data-state":i.hasThumb?"visible":"hidden"},o,{ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Bi(e.onPointerDownCapture,m=>{const y=m.target.getBoundingClientRect(),S=m.clientX-y.left,w=m.clientY-y.top;i.onThumbPointerDown({x:S,y:w})}),onPointerUp:Bi(e.onPointerUp,i.onThumbPointerUp)}))}),C_="ScrollAreaCorner",qV=p.forwardRef((e,t)=>{const n=as(C_,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?p.createElement(KV,rr({},e,{ref:t})):null}),KV=p.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=as(C_,n),[s,i]=p.useState(0),[u,d]=p.useState(0),f=!!(s&&u);return ec(o.scrollbarX,()=>{var h;const m=((h=o.scrollbarX)===null||h===void 0?void 0:h.offsetHeight)||0;o.onCornerHeightChange(m),d(m)}),ec(o.scrollbarY,()=>{var h;const m=((h=o.scrollbarY)===null||h===void 0?void 0:h.offsetWidth)||0;o.onCornerWidthChange(m),i(m)}),f?p.createElement(Ju.div,rr({},r,{ref:t,style:{width:s,height:u,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}})):null});function Op(e){return e?parseInt(e,10):0}function k_(e,t){const n=e/t;return isNaN(n)?0:n}function Gh(e){const t=k_(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function YV(e,t,n,r="ltr"){const o=Gh(n),s=o/2,i=t||s,u=o-i,d=n.scrollbar.paddingStart+i,f=n.scrollbar.size-n.scrollbar.paddingEnd-u,h=n.content-n.viewport,m=r==="ltr"?[0,h]:[h*-1,0];return P_([d,f],m)(e)}function Aw(e,t,n="ltr"){const r=Gh(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-o,i=t.content-t.viewport,u=s-r,d=n==="ltr"?[0,i]:[i*-1,0],f=MV(e,d);return P_([0,i],[0,u])(f)}function P_(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 __(e,t){return e>0&&e<t}const XV=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const s={left:e.scrollLeft,top:e.scrollTop},i=n.left!==s.left,u=n.top!==s.top;(i||u)&&t(),n=s,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function qh(e,t){const n=Ri(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 ec(e,t){const n=Ri(t);p0(()=>{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 QV=NV,ZV=$V,Nw=LV,zw=UV,JV=qV;var eU=Jr((e,{scrollbarSize:t,offsetScrollbars:n,scrollbarHovered:r,hidden:o})=>({root:{overflow:"hidden"},viewport:{width:"100%",height:"100%",paddingRight:n?Le(t):void 0,paddingBottom:n?Le(t):void 0},scrollbar:{display:o?"none":"flex",userSelect:"none",touchAction:"none",boxSizing:"border-box",padding:`calc(${Le(t)} / 5)`,transition:"background-color 150ms ease, opacity 150ms ease","&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[8]:e.colors.gray[0],[`& .${KS("thumb")}`]:{backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.white,.5):e.fn.rgba(e.black,.5)}},'&[data-orientation="vertical"]':{width:Le(t)},'&[data-orientation="horizontal"]':{flexDirection:"column",height:Le(t)},'&[data-state="hidden"]':{display:"none",opacity:0}},thumb:{ref:KS("thumb"),flex:1,backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.white,.4):e.fn.rgba(e.black,.4),borderRadius:Le(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:Le(44),minHeight:Le(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 tU=eU;var nU=Object.defineProperty,rU=Object.defineProperties,oU=Object.getOwnPropertyDescriptors,Rp=Object.getOwnPropertySymbols,j_=Object.prototype.hasOwnProperty,E_=Object.prototype.propertyIsEnumerable,$w=(e,t,n)=>t in e?nU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,m0=(e,t)=>{for(var n in t||(t={}))j_.call(t,n)&&$w(e,n,t[n]);if(Rp)for(var n of Rp(t))E_.call(t,n)&&$w(e,n,t[n]);return e},I_=(e,t)=>rU(e,oU(t)),O_=(e,t)=>{var n={};for(var r in e)j_.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Rp)for(var r of Rp(e))t.indexOf(r)<0&&E_.call(e,r)&&(n[r]=e[r]);return n};const R_={scrollbarSize:12,scrollHideDelay:1e3,type:"hover",offsetScrollbars:!1},Kh=p.forwardRef((e,t)=>{const n=wr("ScrollArea",R_,e),{children:r,className:o,classNames:s,styles:i,scrollbarSize:u,scrollHideDelay:d,type:f,dir:h,offsetScrollbars:m,viewportRef:v,onScrollPositionChange:y,unstyled:S,variant:w,viewportProps:C}=n,k=O_(n,["children","className","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled","variant","viewportProps"]),[P,j]=p.useState(!1),E=Ia(),{classes:O,cx:I}=tU({scrollbarSize:u,offsetScrollbars:m,scrollbarHovered:P,hidden:f==="never"},{name:"ScrollArea",classNames:s,styles:i,unstyled:S,variant:w});return L.createElement(QV,{type:f==="never"?"always":f,scrollHideDelay:d,dir:h||E.dir,ref:t,asChild:!0},L.createElement(yo,m0({className:I(O.root,o)},k),L.createElement(ZV,I_(m0({},C),{className:O.viewport,ref:v,onScroll:typeof y=="function"?({currentTarget:R})=>y({x:R.scrollLeft,y:R.scrollTop}):void 0}),r),L.createElement(Nw,{orientation:"horizontal",className:O.scrollbar,forceMount:!0,onMouseEnter:()=>j(!0),onMouseLeave:()=>j(!1)},L.createElement(zw,{className:O.thumb})),L.createElement(Nw,{orientation:"vertical",className:O.scrollbar,forceMount:!0,onMouseEnter:()=>j(!0),onMouseLeave:()=>j(!1)},L.createElement(zw,{className:O.thumb})),L.createElement(JV,{className:O.corner})))}),T_=p.forwardRef((e,t)=>{const n=wr("ScrollAreaAutosize",R_,e),{children:r,classNames:o,styles:s,scrollbarSize:i,scrollHideDelay:u,type:d,dir:f,offsetScrollbars:h,viewportRef:m,onScrollPositionChange:v,unstyled:y,sx:S,variant:w,viewportProps:C}=n,k=O_(n,["children","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled","sx","variant","viewportProps"]);return L.createElement(yo,I_(m0({},k),{ref:t,sx:[{display:"flex"},...SP(S)]}),L.createElement(yo,{sx:{display:"flex",flexDirection:"column",flex:1}},L.createElement(Kh,{classNames:o,styles:s,scrollHideDelay:u,scrollbarSize:i,type:d,dir:f,offsetScrollbars:h,viewportRef:m,onScrollPositionChange:v,unstyled:y,variant:w,viewportProps:C},r)))});T_.displayName="@mantine/core/ScrollAreaAutosize";Kh.displayName="@mantine/core/ScrollArea";Kh.Autosize=T_;const sU=Kh;var aU=Object.defineProperty,iU=Object.defineProperties,lU=Object.getOwnPropertyDescriptors,Tp=Object.getOwnPropertySymbols,M_=Object.prototype.hasOwnProperty,D_=Object.prototype.propertyIsEnumerable,Lw=(e,t,n)=>t in e?aU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Fw=(e,t)=>{for(var n in t||(t={}))M_.call(t,n)&&Lw(e,n,t[n]);if(Tp)for(var n of Tp(t))D_.call(t,n)&&Lw(e,n,t[n]);return e},cU=(e,t)=>iU(e,lU(t)),uU=(e,t)=>{var n={};for(var r in e)M_.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Tp)for(var r of Tp(e))t.indexOf(r)<0&&D_.call(e,r)&&(n[r]=e[r]);return n};const Yh=p.forwardRef((e,t)=>{var n=e,{style:r}=n,o=uU(n,["style"]);return L.createElement(sU,cU(Fw({},o),{style:Fw({width:"100%"},r),viewportProps:{tabIndex:-1},viewportRef:t}),o.children)});Yh.displayName="@mantine/core/SelectScrollArea";var dU=Jr(()=>({dropdown:{},itemsWrapper:{padding:Le(4),display:"flex",width:"100%",boxSizing:"border-box"}}));const fU=dU;function wc(e){return e.split("-")[1]}function ly(e){return e==="y"?"height":"width"}function ks(e){return e.split("-")[0]}function fi(e){return["top","bottom"].includes(ks(e))?"x":"y"}function Bw(e,t,n){let{reference:r,floating:o}=e;const s=r.x+r.width/2-o.width/2,i=r.y+r.height/2-o.height/2,u=fi(t),d=ly(u),f=r[d]/2-o[d]/2,h=u==="x";let m;switch(ks(t)){case"top":m={x:s,y:r.y-o.height};break;case"bottom":m={x:s,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:i};break;case"left":m={x:r.x-o.width,y:i};break;default:m={x:r.x,y:r.y}}switch(wc(t)){case"start":m[u]-=f*(n&&h?-1:1);break;case"end":m[u]+=f*(n&&h?-1:1)}return m}const pU=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,u=s.filter(Boolean),d=await(i.isRTL==null?void 0:i.isRTL(t));let f=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:h,y:m}=Bw(f,r,d),v=r,y={},S=0;for(let w=0;w<u.length;w++){const{name:C,fn:k}=u[w],{x:P,y:j,data:E,reset:O}=await k({x:h,y:m,initialPlacement:r,placement:v,strategy:o,middlewareData:y,rects:f,platform:i,elements:{reference:e,floating:t}});h=P??h,m=j??m,y={...y,[C]:{...y[C],...E}},O&&S<=50&&(S++,typeof O=="object"&&(O.placement&&(v=O.placement),O.rects&&(f=O.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):O.rects),{x:h,y:m}=Bw(f,v,d)),w=-1)}return{x:h,y:m,placement:v,strategy:o,middlewareData:y}};function _a(e,t){return typeof e=="function"?e(t):e}function cy(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 tc(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function uy(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:u,strategy:d}=e,{boundary:f="clippingAncestors",rootBoundary:h="viewport",elementContext:m="floating",altBoundary:v=!1,padding:y=0}=_a(t,e),S=cy(y),w=u[v?m==="floating"?"reference":"floating":m],C=tc(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(u.floating)),boundary:f,rootBoundary:h,strategy:d})),k=m==="floating"?{...i.floating,x:r,y:o}:i.reference,P=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u.floating)),j=await(s.isElement==null?void 0:s.isElement(P))&&await(s.getScale==null?void 0:s.getScale(P))||{x:1,y:1},E=tc(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:k,offsetParent:P,strategy:d}):k);return{top:(C.top-E.top+S.top)/j.y,bottom:(E.bottom-C.bottom+S.bottom)/j.y,left:(C.left-E.left+S.left)/j.x,right:(E.right-C.right+S.right)/j.x}}const li=Math.min,Ws=Math.max;function g0(e,t,n){return Ws(e,li(t,n))}const Hw=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:u}=t,{element:d,padding:f=0}=_a(e,t)||{};if(d==null)return{};const h=cy(f),m={x:n,y:r},v=fi(o),y=ly(v),S=await i.getDimensions(d),w=v==="y",C=w?"top":"left",k=w?"bottom":"right",P=w?"clientHeight":"clientWidth",j=s.reference[y]+s.reference[v]-m[v]-s.floating[y],E=m[v]-s.reference[v],O=await(i.getOffsetParent==null?void 0:i.getOffsetParent(d));let I=O?O[P]:0;I&&await(i.isElement==null?void 0:i.isElement(O))||(I=u.floating[P]||s.floating[y]);const R=j/2-E/2,T=I/2-S[y]/2-1,D=li(h[C],T),$=li(h[k],T),A=D,J=I-S[y]-$,z=I/2-S[y]/2+R,B=g0(A,z,J),G=wc(o)!=null&&z!=B&&s.reference[y]/2-(z<A?D:$)-S[y]/2<0?z<A?A-z:J-z:0;return{[v]:m[v]-G,data:{[v]:B,centerOffset:z-B+G}}}}),hU=["top","right","bottom","left"];hU.reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);const mU={left:"right",right:"left",bottom:"top",top:"bottom"};function Mp(e){return e.replace(/left|right|bottom|top/g,t=>mU[t])}function gU(e,t,n){n===void 0&&(n=!1);const r=wc(e),o=fi(e),s=ly(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Mp(i)),{main:i,cross:Mp(i)}}const vU={start:"end",end:"start"};function ev(e){return e.replace(/start|end/g,t=>vU[t])}const yU=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:s,initialPlacement:i,platform:u,elements:d}=t,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:S=!0,...w}=_a(e,t),C=ks(r),k=ks(i)===i,P=await(u.isRTL==null?void 0:u.isRTL(d.floating)),j=m||(k||!S?[Mp(i)]:function(A){const J=Mp(A);return[ev(A),J,ev(J)]}(i));m||y==="none"||j.push(...function(A,J,z,B){const G=wc(A);let K=function(N,V,W){const U=["left","right"],re=["right","left"],ve=["top","bottom"],le=["bottom","top"];switch(N){case"top":case"bottom":return W?V?re:U:V?U:re;case"left":case"right":return V?ve:le;default:return[]}}(ks(A),z==="start",B);return G&&(K=K.map(N=>N+"-"+G),J&&(K=K.concat(K.map(ev)))),K}(i,S,y,P));const E=[i,...j],O=await uy(t,w),I=[];let R=((n=o.flip)==null?void 0:n.overflows)||[];if(f&&I.push(O[C]),h){const{main:A,cross:J}=gU(r,s,P);I.push(O[A],O[J])}if(R=[...R,{placement:r,overflows:I}],!I.every(A=>A<=0)){var T,D;const A=(((T=o.flip)==null?void 0:T.index)||0)+1,J=E[A];if(J)return{data:{index:A,overflows:R},reset:{placement:J}};let z=(D=R.filter(B=>B.overflows[0]<=0).sort((B,G)=>B.overflows[1]-G.overflows[1])[0])==null?void 0:D.placement;if(!z)switch(v){case"bestFit":{var $;const B=($=R.map(G=>[G.placement,G.overflows.filter(K=>K>0).reduce((K,N)=>K+N,0)]).sort((G,K)=>G[1]-K[1])[0])==null?void 0:$[0];B&&(z=B);break}case"initialPlacement":z=i}if(r!==z)return{reset:{placement:z}}}return{}}}};function Ww(e){const t=li(...e.map(r=>r.left)),n=li(...e.map(r=>r.top));return{x:t,y:n,width:Ws(...e.map(r=>r.right))-t,height:Ws(...e.map(r=>r.bottom))-n}}const bU=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:o,platform:s,strategy:i}=t,{padding:u=2,x:d,y:f}=_a(e,t),h=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(r.reference))||[]),m=function(w){const C=w.slice().sort((j,E)=>j.y-E.y),k=[];let P=null;for(let j=0;j<C.length;j++){const E=C[j];!P||E.y-P.y>P.height/2?k.push([E]):k[k.length-1].push(E),P=E}return k.map(j=>tc(Ww(j)))}(h),v=tc(Ww(h)),y=cy(u),S=await s.getElementRects({reference:{getBoundingClientRect:function(){if(m.length===2&&m[0].left>m[1].right&&d!=null&&f!=null)return m.find(w=>d>w.left-y.left&&d<w.right+y.right&&f>w.top-y.top&&f<w.bottom+y.bottom)||v;if(m.length>=2){if(fi(n)==="x"){const O=m[0],I=m[m.length-1],R=ks(n)==="top",T=O.top,D=I.bottom,$=R?O.left:I.left,A=R?O.right:I.right;return{top:T,bottom:D,left:$,right:A,width:A-$,height:D-T,x:$,y:T}}const w=ks(n)==="left",C=Ws(...m.map(O=>O.right)),k=li(...m.map(O=>O.left)),P=m.filter(O=>w?O.left===k:O.right===C),j=P[0].top,E=P[P.length-1].bottom;return{top:j,bottom:E,left:k,right:C,width:C-k,height:E-j,x:k,y:j}}return v}},floating:r.floating,strategy:i});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}}:{}}}},xU=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(s,i){const{placement:u,platform:d,elements:f}=s,h=await(d.isRTL==null?void 0:d.isRTL(f.floating)),m=ks(u),v=wc(u),y=fi(u)==="x",S=["left","top"].includes(m)?-1:1,w=h&&y?-1:1,C=_a(i,s);let{mainAxis:k,crossAxis:P,alignmentAxis:j}=typeof C=="number"?{mainAxis:C,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...C};return v&&typeof j=="number"&&(P=v==="end"?-1*j:j),y?{x:P*w,y:k*S}:{x:k*S,y:P*w}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};function A_(e){return e==="x"?"y":"x"}const SU=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:u={fn:C=>{let{x:k,y:P}=C;return{x:k,y:P}}},...d}=_a(e,t),f={x:n,y:r},h=await uy(t,d),m=fi(ks(o)),v=A_(m);let y=f[m],S=f[v];if(s){const C=m==="y"?"bottom":"right";y=g0(y+h[m==="y"?"top":"left"],y,y-h[C])}if(i){const C=v==="y"?"bottom":"right";S=g0(S+h[v==="y"?"top":"left"],S,S-h[C])}const w=u.fn({...t,[m]:y,[v]:S});return{...w,data:{x:w.x-n,y:w.y-r}}}}},wU=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:u=0,mainAxis:d=!0,crossAxis:f=!0}=_a(e,t),h={x:n,y:r},m=fi(o),v=A_(m);let y=h[m],S=h[v];const w=_a(u,t),C=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(d){const j=m==="y"?"height":"width",E=s.reference[m]-s.floating[j]+C.mainAxis,O=s.reference[m]+s.reference[j]-C.mainAxis;y<E?y=E:y>O&&(y=O)}if(f){var k,P;const j=m==="y"?"width":"height",E=["top","left"].includes(ks(o)),O=s.reference[v]-s.floating[j]+(E&&((k=i.offset)==null?void 0:k[v])||0)+(E?0:C.crossAxis),I=s.reference[v]+s.reference[j]+(E?0:((P=i.offset)==null?void 0:P[v])||0)-(E?C.crossAxis:0);S<O?S=O:S>I&&(S=I)}return{[m]:y,[v]:S}}}},CU=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:s}=t,{apply:i=()=>{},...u}=_a(e,t),d=await uy(t,u),f=ks(n),h=wc(n),m=fi(n)==="x",{width:v,height:y}=r.floating;let S,w;f==="top"||f==="bottom"?(S=f,w=h===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(w=f,S=h==="end"?"top":"bottom");const C=y-d[S],k=v-d[w],P=!t.middlewareData.shift;let j=C,E=k;if(m){const I=v-d.left-d.right;E=h||P?li(k,I):I}else{const I=y-d.top-d.bottom;j=h||P?li(C,I):I}if(P&&!h){const I=Ws(d.left,0),R=Ws(d.right,0),T=Ws(d.top,0),D=Ws(d.bottom,0);m?E=v-2*(I!==0||R!==0?I+R:Ws(d.left,d.right)):j=y-2*(T!==0||D!==0?T+D:Ws(d.top,d.bottom))}await i({...t,availableWidth:E,availableHeight:j});const O=await o.getDimensions(s.floating);return v!==O.width||y!==O.height?{reset:{rects:!0}}:{}}}};function ns(e){var t;return((t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ps(e){return ns(e).getComputedStyle(e)}function N_(e){return e instanceof ns(e).Node}function ci(e){return N_(e)?(e.nodeName||"").toLowerCase():"#document"}function Os(e){return e instanceof ns(e).HTMLElement}function ma(e){return e instanceof ns(e).Element}function Vw(e){return typeof ShadowRoot<"u"&&(e instanceof ns(e).ShadowRoot||e instanceof ShadowRoot)}function _u(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ps(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function kU(e){return["table","td","th"].includes(ci(e))}function v0(e){const t=dy(),n=Ps(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 dy(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Xh(e){return["html","body","#document"].includes(ci(e))}const y0=Math.min,Gl=Math.max,Dp=Math.round,vf=Math.floor,Qi=e=>({x:e,y:e});function z_(e){const t=Ps(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Os(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,u=Dp(n)!==s||Dp(r)!==i;return u&&(n=s,r=i),{width:n,height:r,$:u}}function fy(e){return ma(e)?e:e.contextElement}function ql(e){const t=fy(e);if(!Os(t))return Qi(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=z_(t);let i=(s?Dp(n.width):n.width)/r,u=(s?Dp(n.height):n.height)/o;return i&&Number.isFinite(i)||(i=1),u&&Number.isFinite(u)||(u=1),{x:i,y:u}}const Uw=Qi(0);function $_(e,t,n){var r,o;if(t===void 0&&(t=!0),!dy())return Uw;const s=e?ns(e):window;return!n||t&&n!==s?Uw:{x:((r=s.visualViewport)==null?void 0:r.offsetLeft)||0,y:((o=s.visualViewport)==null?void 0:o.offsetTop)||0}}function Zi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=fy(e);let i=Qi(1);t&&(r?ma(r)&&(i=ql(r)):i=ql(e));const u=$_(s,n,r);let d=(o.left+u.x)/i.x,f=(o.top+u.y)/i.y,h=o.width/i.x,m=o.height/i.y;if(s){const v=ns(s),y=r&&ma(r)?ns(r):r;let S=v.frameElement;for(;S&&r&&y!==v;){const w=ql(S),C=S.getBoundingClientRect(),k=getComputedStyle(S),P=C.left+(S.clientLeft+parseFloat(k.paddingLeft))*w.x,j=C.top+(S.clientTop+parseFloat(k.paddingTop))*w.y;d*=w.x,f*=w.y,h*=w.x,m*=w.y,d+=P,f+=j,S=ns(S).frameElement}}return tc({width:h,height:m,x:d,y:f})}function ga(e){return((N_(e)?e.ownerDocument:e.document)||window.document).documentElement}function Qh(e){return ma(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function L_(e){return Zi(ga(e)).left+Qh(e).scrollLeft}function nc(e){if(ci(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Vw(e)&&e.host||ga(e);return Vw(t)?t.host:t}function F_(e){const t=nc(e);return Xh(t)?e.ownerDocument?e.ownerDocument.body:e.body:Os(t)&&_u(t)?t:F_(t)}function Ap(e,t){var n;t===void 0&&(t=[]);const r=F_(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),s=ns(r);return o?t.concat(s,s.visualViewport||[],_u(r)?r:[]):t.concat(r,Ap(r))}function Gw(e,t,n){let r;if(t==="viewport")r=function(o,s){const i=ns(o),u=ga(o),d=i.visualViewport;let f=u.clientWidth,h=u.clientHeight,m=0,v=0;if(d){f=d.width,h=d.height;const y=dy();(!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=ga(o),i=Qh(o),u=o.ownerDocument.body,d=Gl(s.scrollWidth,s.clientWidth,u.scrollWidth,u.clientWidth),f=Gl(s.scrollHeight,s.clientHeight,u.scrollHeight,u.clientHeight);let h=-i.scrollLeft+L_(o);const m=-i.scrollTop;return Ps(u).direction==="rtl"&&(h+=Gl(s.clientWidth,u.clientWidth)-d),{width:d,height:f,x:h,y:m}}(ga(e));else if(ma(t))r=function(o,s){const i=Zi(o,!0,s==="fixed"),u=i.top+o.clientTop,d=i.left+o.clientLeft,f=Os(o)?ql(o):Qi(1);return{width:o.clientWidth*f.x,height:o.clientHeight*f.y,x:d*f.x,y:u*f.y}}(t,n);else{const o=$_(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return tc(r)}function B_(e,t){const n=nc(e);return!(n===t||!ma(n)||Xh(n))&&(Ps(n).position==="fixed"||B_(n,t))}function qw(e,t){return Os(e)&&Ps(e).position!=="fixed"?t?t(e):e.offsetParent:null}function Kw(e,t){const n=ns(e);if(!Os(e))return n;let r=qw(e,t);for(;r&&kU(r)&&Ps(r).position==="static";)r=qw(r,t);return r&&(ci(r)==="html"||ci(r)==="body"&&Ps(r).position==="static"&&!v0(r))?n:r||function(o){let s=nc(o);for(;Os(s)&&!Xh(s);){if(v0(s))return s;s=nc(s)}return null}(e)||n}function PU(e,t,n){const r=Os(t),o=ga(t),s=n==="fixed",i=Zi(e,!0,s,t);let u={scrollLeft:0,scrollTop:0};const d=Qi(0);if(r||!r&&!s)if((ci(t)!=="body"||_u(o))&&(u=Qh(t)),Os(t)){const f=Zi(t,!0,s,t);d.x=f.x+t.clientLeft,d.y=f.y+t.clientTop}else o&&(d.x=L_(o));return{x:i.left+u.scrollLeft-d.x,y:i.top+u.scrollTop-d.y,width:i.width,height:i.height}}const _U={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=Ap(f).filter(C=>ma(C)&&ci(C)!=="body"),y=null;const S=Ps(f).position==="fixed";let w=S?nc(f):f;for(;ma(w)&&!Xh(w);){const C=Ps(w),k=v0(w);k||C.position!=="fixed"||(y=null),(S?!k&&!y:!k&&C.position==="static"&&y&&["absolute","fixed"].includes(y.position)||_u(w)&&!k&&B_(f,w))?v=v.filter(P=>P!==w):y=C,w=nc(w)}return h.set(f,v),v}(t,this._c):[].concat(n),i=[...s,r],u=i[0],d=i.reduce((f,h)=>{const m=Gw(t,h,o);return f.top=Gl(m.top,f.top),f.right=y0(m.right,f.right),f.bottom=y0(m.bottom,f.bottom),f.left=Gl(m.left,f.left),f},Gw(t,u,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=Os(n),s=ga(n);if(n===s)return t;let i={scrollLeft:0,scrollTop:0},u=Qi(1);const d=Qi(0);if((o||!o&&r!=="fixed")&&((ci(n)!=="body"||_u(s))&&(i=Qh(n)),Os(n))){const f=Zi(n);u=ql(n),d.x=f.x+n.clientLeft,d.y=f.y+n.clientTop}return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-i.scrollLeft*u.x+d.x,y:t.y*u.y-i.scrollTop*u.y+d.y}},isElement:ma,getDimensions:function(e){return z_(e)},getOffsetParent:Kw,getDocumentElement:ga,getScale:ql,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||Kw,s=this.getDimensions;return{reference:PU(t,await o(n),r),floating:{x:0,y:0,...await s(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>Ps(e).direction==="rtl"};function jU(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=!0,layoutShift:u=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,f=fy(e),h=o||s?[...f?Ap(f):[],...Ap(t)]:[];h.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),s&&w.addEventListener("resize",n)});const m=f&&u?function(w,C){let k,P=null;const j=ga(w);function E(){clearTimeout(k),P&&P.disconnect(),P=null}return function O(I,R){I===void 0&&(I=!1),R===void 0&&(R=1),E();const{left:T,top:D,width:$,height:A}=w.getBoundingClientRect();if(I||C(),!$||!A)return;const J=vf(D),z=vf(j.clientWidth-(T+$)),B=vf(j.clientHeight-(D+A)),G=vf(T);let K=!0;P=new IntersectionObserver(N=>{const V=N[0].intersectionRatio;if(V!==R){if(!K)return O();V?O(!1,V):k=setTimeout(()=>{O(!1,1e-7)},100)}K=!1},{rootMargin:-J+"px "+-z+"px "+-B+"px "+-G+"px",threshold:Gl(0,y0(1,R))||1}),P.observe(w)}(!0),E}(f,n):null;let v,y=null;i&&(y=new ResizeObserver(n),f&&!d&&y.observe(f),y.observe(t));let S=d?Zi(e):null;return d&&function w(){const C=Zi(e);!S||C.x===S.x&&C.y===S.y&&C.width===S.width&&C.height===S.height||n(),S=C,v=requestAnimationFrame(w)}(),n(),()=>{h.forEach(w=>{o&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),m&&m(),y&&y.disconnect(),y=null,d&&cancelAnimationFrame(v)}}const EU=(e,t,n)=>{const r=new Map,o={platform:_U,...n},s={...o.platform,_c:r};return pU(e,t,{...o,platform:s})},IU=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?Hw({element:t.current,padding:n}).fn(o):{}:t?Hw({element:t,padding:n}).fn(o):{}}}};var zf=typeof document<"u"?p.useLayoutEffect:p.useEffect;function Np(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(!Np(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)&&!Np(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Yw(e){const t=p.useRef(e);return zf(()=>{t.current=e}),t}function OU(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,whileElementsMounted:s,open:i}=e,[u,d]=p.useState({x:null,y:null,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,h]=p.useState(r);Np(f,r)||h(r);const m=p.useRef(null),v=p.useRef(null),y=p.useRef(u),S=Yw(s),w=Yw(o),[C,k]=p.useState(null),[P,j]=p.useState(null),E=p.useCallback($=>{m.current!==$&&(m.current=$,k($))},[]),O=p.useCallback($=>{v.current!==$&&(v.current=$,j($))},[]),I=p.useCallback(()=>{if(!m.current||!v.current)return;const $={placement:t,strategy:n,middleware:f};w.current&&($.platform=w.current),EU(m.current,v.current,$).then(A=>{const J={...A,isPositioned:!0};R.current&&!Np(y.current,J)&&(y.current=J,hc.flushSync(()=>{d(J)}))})},[f,t,n,w]);zf(()=>{i===!1&&y.current.isPositioned&&(y.current.isPositioned=!1,d($=>({...$,isPositioned:!1})))},[i]);const R=p.useRef(!1);zf(()=>(R.current=!0,()=>{R.current=!1}),[]),zf(()=>{if(C&&P){if(S.current)return S.current(C,P,I);I()}},[C,P,I,S]);const T=p.useMemo(()=>({reference:m,floating:v,setReference:E,setFloating:O}),[E,O]),D=p.useMemo(()=>({reference:C,floating:P}),[C,P]);return p.useMemo(()=>({...u,update:I,refs:T,elements:D,reference:E,floating:O}),[u,I,T,D,E,O])}var RU=typeof document<"u"?p.useLayoutEffect:p.useEffect;function TU(){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 MU=p.createContext(null),DU=()=>p.useContext(MU);function AU(e){return(e==null?void 0:e.ownerDocument)||document}function NU(e){return AU(e).defaultView||window}function yf(e){return e?e instanceof NU(e).Element:!1}const zU=Y0["useInsertionEffect".toString()],$U=zU||(e=>e());function LU(e){const t=p.useRef(()=>{});return $U(()=>{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 FU(e){e===void 0&&(e={});const{open:t=!1,onOpenChange:n,nodeId:r}=e,o=OU(e),s=DU(),i=p.useRef(null),u=p.useRef({}),d=p.useState(()=>TU())[0],[f,h]=p.useState(null),m=p.useCallback(k=>{const P=yf(k)?{getBoundingClientRect:()=>k.getBoundingClientRect(),contextElement:k}:k;o.refs.setReference(P)},[o.refs]),v=p.useCallback(k=>{(yf(k)||k===null)&&(i.current=k,h(k)),(yf(o.refs.reference.current)||o.refs.reference.current===null||k!==null&&!yf(k))&&o.refs.setReference(k)},[o.refs]),y=p.useMemo(()=>({...o.refs,setReference:v,setPositionReference:m,domReference:i}),[o.refs,v,m]),S=p.useMemo(()=>({...o.elements,domReference:f}),[o.elements,f]),w=LU(n),C=p.useMemo(()=>({...o,refs:y,elements:S,dataRef:u,nodeId:r,events:d,open:t,onOpenChange:w}),[o,r,d,t,w,y,S]);return RU(()=>{const k=s==null?void 0:s.nodesRef.current.find(P=>P.id===r);k&&(k.context=C)}),p.useMemo(()=>({...o,context:C,refs:y,reference:v,positionReference:m}),[o,y,C,v,m])}function BU({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 jU(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,o,n]),Cs(()=>{t.update()},r),Cs(()=>{s(i=>i+1)},[e])}function HU(e){const t=[xU(e.offset)];return e.middlewares.shift&&t.push(SU({limiter:wU()})),e.middlewares.flip&&t.push(yU()),e.middlewares.inline&&t.push(bU()),t.push(IU({element:e.arrowRef,padding:e.arrowOffset})),t}function WU(e){const[t,n]=Pu({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=()=>{var i;(i=e.onClose)==null||i.call(e),n(!1)},o=()=>{var i,u;t?((i=e.onClose)==null||i.call(e),n(!1)):((u=e.onOpen)==null||u.call(e),n(!0))},s=FU({placement:e.position,middleware:[...HU(e),...e.width==="target"?[CU({apply({rects:i}){var u,d;Object.assign((d=(u=s.refs.floating.current)==null?void 0:u.style)!=null?d:{},{width:`${i.reference.width}px`})}})]:[]]});return BU({opened:e.opened,position:e.position,positionDependencies:e.positionDependencies,floating:s}),Cs(()=>{var i;(i=e.onPositionChange)==null||i.call(e,s.placement)},[s.placement]),Cs(()=>{var i,u;e.opened?(u=e.onOpen)==null||u.call(e):(i=e.onClose)==null||i.call(e)},[e.opened]),{floating:s,controlled:typeof e.opened=="boolean",opened:t,onClose:r,onToggle:o}}const H_={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"},[VU,W_]=CB(H_.context);var UU=Object.defineProperty,GU=Object.defineProperties,qU=Object.getOwnPropertyDescriptors,zp=Object.getOwnPropertySymbols,V_=Object.prototype.hasOwnProperty,U_=Object.prototype.propertyIsEnumerable,Xw=(e,t,n)=>t in e?UU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,bf=(e,t)=>{for(var n in t||(t={}))V_.call(t,n)&&Xw(e,n,t[n]);if(zp)for(var n of zp(t))U_.call(t,n)&&Xw(e,n,t[n]);return e},KU=(e,t)=>GU(e,qU(t)),YU=(e,t)=>{var n={};for(var r in e)V_.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&zp)for(var r of zp(e))t.indexOf(r)<0&&U_.call(e,r)&&(n[r]=e[r]);return n};const XU={refProp:"ref",popupType:"dialog"},G_=p.forwardRef((e,t)=>{const n=wr("PopoverTarget",XU,e),{children:r,refProp:o,popupType:s}=n,i=YU(n,["children","refProp","popupType"]);if(!CP(r))throw new Error(H_.children);const u=i,d=W_(),f=Zu(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,bf(KU(bf(bf(bf({},u),h),d.targetProps),{className:PP(d.targetProps.className,u.className,r.props.className),[o]:f}),d.controlled?null:{onClick:d.onToggle}))});G_.displayName="@mantine/core/PopoverTarget";var QU=Jr((e,{radius:t,shadow:n})=>({dropdown:{position:"absolute",backgroundColor:e.white,background:e.colorScheme==="dark"?e.colors.dark[6]:e.white,border:`${Le(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:`${Le(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`,zIndex:1}}));const ZU=QU;var JU=Object.defineProperty,Qw=Object.getOwnPropertySymbols,eG=Object.prototype.hasOwnProperty,tG=Object.prototype.propertyIsEnumerable,Zw=(e,t,n)=>t in e?JU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_l=(e,t)=>{for(var n in t||(t={}))eG.call(t,n)&&Zw(e,n,t[n]);if(Qw)for(var n of Qw(t))tG.call(t,n)&&Zw(e,n,t[n]);return e};const Jw={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function nG({transition:e,state:t,duration:n,timingFunction:r}){const o={transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e=="string"?e in df?_l(_l(_l({transitionProperty:df[e].transitionProperty},o),df[e].common),df[e][Jw[t]]):null:_l(_l(_l({transitionProperty:e.transitionProperty},o),e.common),e[Jw[t]])}function rG({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:o,onExit:s,onEntered:i,onExited:u}){const d=Ia(),f=TP(),h=d.respectReducedMotion?f:!1,[m,v]=p.useState(h?0:e),[y,S]=p.useState(r?"entered":"exited"),w=p.useRef(-1),C=k=>{const P=k?o:s,j=k?i:u;S(k?"pre-entering":"pre-exiting"),window.clearTimeout(w.current);const E=h?0:k?e:t;if(v(E),E===0)typeof P=="function"&&P(),typeof j=="function"&&j(),S(k?"entered":"exited");else{const O=window.setTimeout(()=>{typeof P=="function"&&P(),S(k?"entering":"exiting")},10);w.current=window.setTimeout(()=>{window.clearTimeout(O),typeof j=="function"&&j(),S(k?"entered":"exited")},E)}};return Cs(()=>{C(r)},[r]),p.useEffect(()=>()=>window.clearTimeout(w.current),[]),{transitionDuration:m,transitionStatus:y,transitionTimingFunction:n||d.transitionTimingFunction}}function q_({keepMounted:e,transition:t,duration:n=250,exitDuration:r=n,mounted:o,children:s,timingFunction:i,onExit:u,onEntered:d,onEnter:f,onExited:h}){const{transitionDuration:m,transitionStatus:v,transitionTimingFunction:y}=rG({mounted:o,exitDuration:r,duration:n,timingFunction:i,onExit:u,onEntered:d,onEnter:f,onExited:h});return m===0?o?L.createElement(L.Fragment,null,s({})):e?s({display:"none"}):null:v==="exited"?e?s({display:"none"}):null:L.createElement(L.Fragment,null,s(nG({transition:t,duration:m,state:v,timingFunction:y})))}q_.displayName="@mantine/core/Transition";function K_({children:e,active:t=!0,refProp:n="ref"}){const r=rH(t),o=Zu(r,e==null?void 0:e.ref);return CP(e)?p.cloneElement(e,{[n]:o}):e}K_.displayName="@mantine/core/FocusTrap";var oG=Object.defineProperty,sG=Object.defineProperties,aG=Object.getOwnPropertyDescriptors,eC=Object.getOwnPropertySymbols,iG=Object.prototype.hasOwnProperty,lG=Object.prototype.propertyIsEnumerable,tC=(e,t,n)=>t in e?oG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ua=(e,t)=>{for(var n in t||(t={}))iG.call(t,n)&&tC(e,n,t[n]);if(eC)for(var n of eC(t))lG.call(t,n)&&tC(e,n,t[n]);return e},xf=(e,t)=>sG(e,aG(t));function nC(e,t,n,r){return e==="center"||r==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function rC(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 cG={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function uG({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,arrowX:s,arrowY:i,dir:u}){const[d,f="center"]=e.split("-"),h={width:Le(t),height:Le(t),transform:"rotate(45deg)",position:"absolute",[cG[d]]:Le(r)},m=Le(-t/2);return d==="left"?xf(Ua(Ua({},h),nC(f,i,n,o)),{right:m,borderLeftColor:"transparent",borderBottomColor:"transparent"}):d==="right"?xf(Ua(Ua({},h),nC(f,i,n,o)),{left:m,borderRightColor:"transparent",borderTopColor:"transparent"}):d==="top"?xf(Ua(Ua({},h),rC(f,s,n,o,u)),{bottom:m,borderTopColor:"transparent",borderLeftColor:"transparent"}):d==="bottom"?xf(Ua(Ua({},h),rC(f,s,n,o,u)),{top:m,borderBottomColor:"transparent",borderRightColor:"transparent"}):{}}var dG=Object.defineProperty,fG=Object.defineProperties,pG=Object.getOwnPropertyDescriptors,$p=Object.getOwnPropertySymbols,Y_=Object.prototype.hasOwnProperty,X_=Object.prototype.propertyIsEnumerable,oC=(e,t,n)=>t in e?dG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hG=(e,t)=>{for(var n in t||(t={}))Y_.call(t,n)&&oC(e,n,t[n]);if($p)for(var n of $p(t))X_.call(t,n)&&oC(e,n,t[n]);return e},mG=(e,t)=>fG(e,pG(t)),gG=(e,t)=>{var n={};for(var r in e)Y_.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&$p)for(var r of $p(e))t.indexOf(r)<0&&X_.call(e,r)&&(n[r]=e[r]);return n};const Q_=p.forwardRef((e,t)=>{var n=e,{position:r,arrowSize:o,arrowOffset:s,arrowRadius:i,arrowPosition:u,visible:d,arrowX:f,arrowY:h}=n,m=gG(n,["position","arrowSize","arrowOffset","arrowRadius","arrowPosition","visible","arrowX","arrowY"]);const v=Ia();return d?L.createElement("div",mG(hG({},m),{ref:t,style:uG({position:r,arrowSize:o,arrowOffset:s,arrowRadius:i,arrowPosition:u,dir:v.dir,arrowX:f,arrowY:h})})):null});Q_.displayName="@mantine/core/FloatingArrow";var vG=Object.defineProperty,yG=Object.defineProperties,bG=Object.getOwnPropertyDescriptors,Lp=Object.getOwnPropertySymbols,Z_=Object.prototype.hasOwnProperty,J_=Object.prototype.propertyIsEnumerable,sC=(e,t,n)=>t in e?vG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jl=(e,t)=>{for(var n in t||(t={}))Z_.call(t,n)&&sC(e,n,t[n]);if(Lp)for(var n of Lp(t))J_.call(t,n)&&sC(e,n,t[n]);return e},Sf=(e,t)=>yG(e,bG(t)),xG=(e,t)=>{var n={};for(var r in e)Z_.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Lp)for(var r of Lp(e))t.indexOf(r)<0&&J_.call(e,r)&&(n[r]=e[r]);return n};const SG={};function ej(e){var t;const n=wr("PopoverDropdown",SG,e),{style:r,className:o,children:s,onKeyDownCapture:i}=n,u=xG(n,["style","className","children","onKeyDownCapture"]),d=W_(),{classes:f,cx:h}=ZU({radius:d.radius,shadow:d.shadow},{name:d.__staticSelector,classNames:d.classNames,styles:d.styles,unstyled:d.unstyled,variant:d.variant}),m=XB({opened:d.opened,shouldReturnFocus:d.returnFocus}),v=d.withRoles?{"aria-labelledby":d.getTargetId(),id:d.getDropdownId(),role:"dialog"}:{};return d.disabled?null:L.createElement(r_,Sf(jl({},d.portalProps),{withinPortal:d.withinPortal}),L.createElement(q_,Sf(jl({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,w;return L.createElement(K_,{active:d.trapFocus},L.createElement(yo,jl(Sf(jl({},v),{tabIndex:-1,ref:d.floating,style:Sf(jl(jl({},r),y),{zIndex:d.zIndex,top:(S=d.y)!=null?S:0,left:(w=d.x)!=null?w:0,width:d.width==="target"?void 0:Le(d.width)}),className:h(f.dropdown,o),onKeyDownCapture:PB(d.onClose,{active:d.closeOnEscape,onTrigger:m,onKeyDown:i}),"data-position":d.placement}),u),s,L.createElement(Q_,{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})))}))}ej.displayName="@mantine/core/PopoverDropdown";function wG(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 aC=Object.getOwnPropertySymbols,CG=Object.prototype.hasOwnProperty,kG=Object.prototype.propertyIsEnumerable,PG=(e,t)=>{var n={};for(var r in e)CG.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&aC)for(var r of aC(e))t.indexOf(r)<0&&kG.call(e,r)&&(n[r]=e[r]);return n};const _G={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:ny("popover"),__staticSelector:"Popover",width:"max-content"};function Cc(e){var t,n,r,o,s,i;const u=p.useRef(null),d=wr("Popover",_G,e),{children:f,position:h,offset:m,onPositionChange:v,positionDependencies:y,opened:S,transitionProps:w,width:C,middlewares:k,withArrow:P,arrowSize:j,arrowOffset:E,arrowRadius:O,arrowPosition:I,unstyled:R,classNames:T,styles:D,closeOnClickOutside:$,withinPortal:A,portalProps:J,closeOnEscape:z,clickOutsideEvents:B,trapFocus:G,onClose:K,onOpen:N,onChange:V,zIndex:W,radius:U,shadow:re,id:ve,defaultOpened:le,__staticSelector:se,withRoles:Y,disabled:ae,returnFocus:ue,variant:xe,keepMounted:oe}=d,ge=PG(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"]),[fe,Pe]=p.useState(null),[Ae,ye]=p.useState(null),Oe=oy(ve),at=Ia(),Fe=WU({middlewares:k,width:C,position:wG(at.dir,h),offset:typeof m=="number"?m+(P?j/2:0):m,arrowRef:u,arrowOffset:E,onPositionChange:v,positionDependencies:y,opened:S,defaultOpened:le,onChange:V,onOpen:N,onClose:K});GB(()=>Fe.opened&&$&&Fe.onClose(),B,[fe,Ae]);const Ye=p.useCallback(xt=>{Pe(xt),Fe.floating.reference(xt)},[Fe.floating.reference]),jt=p.useCallback(xt=>{ye(xt),Fe.floating.floating(xt)},[Fe.floating.floating]);return L.createElement(VU,{value:{returnFocus:ue,disabled:ae,controlled:Fe.controlled,reference:Ye,floating:jt,x:Fe.floating.x,y:Fe.floating.y,arrowX:(r=(n=(t=Fe.floating)==null?void 0:t.middlewareData)==null?void 0:n.arrow)==null?void 0:r.x,arrowY:(i=(s=(o=Fe.floating)==null?void 0:o.middlewareData)==null?void 0:s.arrow)==null?void 0:i.y,opened:Fe.opened,arrowRef:u,transitionProps:w,width:C,withArrow:P,arrowSize:j,arrowOffset:E,arrowRadius:O,arrowPosition:I,placement:Fe.floating.placement,trapFocus:G,withinPortal:A,portalProps:J,zIndex:W,radius:U,shadow:re,closeOnEscape:z,onClose:Fe.onClose,onToggle:Fe.onToggle,getTargetId:()=>`${Oe}-target`,getDropdownId:()=>`${Oe}-dropdown`,withRoles:Y,targetProps:ge,__staticSelector:se,classNames:T,styles:D,unstyled:R,variant:xe,keepMounted:oe}},f)}Cc.Target=G_;Cc.Dropdown=ej;Cc.displayName="@mantine/core/Popover";var jG=Object.defineProperty,Fp=Object.getOwnPropertySymbols,tj=Object.prototype.hasOwnProperty,nj=Object.prototype.propertyIsEnumerable,iC=(e,t,n)=>t in e?jG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,EG=(e,t)=>{for(var n in t||(t={}))tj.call(t,n)&&iC(e,n,t[n]);if(Fp)for(var n of Fp(t))nj.call(t,n)&&iC(e,n,t[n]);return e},IG=(e,t)=>{var n={};for(var r in e)tj.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Fp)for(var r of Fp(e))t.indexOf(r)<0&&nj.call(e,r)&&(n[r]=e[r]);return n};function OG(e){var t=e,{children:n,component:r="div",maxHeight:o=220,direction:s="column",id:i,innerRef:u,__staticSelector:d,styles:f,classNames:h,unstyled:m}=t,v=IG(t,["children","component","maxHeight","direction","id","innerRef","__staticSelector","styles","classNames","unstyled"]);const{classes:y}=fU(null,{name:d,styles:f,classNames:h,unstyled:m});return L.createElement(Cc.Dropdown,EG({p:0,onMouseDown:S=>S.preventDefault()},v),L.createElement("div",{style:{maxHeight:Le(o),display:"flex"}},L.createElement(yo,{component:r||"div",id:`${i}-items`,"aria-labelledby":`${i}-label`,role:"listbox",onMouseDown:S=>S.preventDefault(),style:{flex:1,overflowY:r!==Yh?"auto":void 0},"data-combobox-popover":!0,tabIndex:-1,ref:u},L.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:i,onDirectionChange:u,switchDirectionOnFlip:d,zIndex:f,dropdownPosition:h,positionDependencies:m=[],classNames:v,styles:y,unstyled:S,readOnly:w,variant:C}){return L.createElement(Cc,{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:i,withinPortal:r,portalProps:o,transitionProps:t,shadow:n,disabled:w,onPositionChange:k=>d&&(u==null?void 0:u(k==="top"?"column-reverse":"column")),variant:C},s)}ai.Target=Cc.Target;ai.Dropdown=OG;var RG=Object.defineProperty,TG=Object.defineProperties,MG=Object.getOwnPropertyDescriptors,Bp=Object.getOwnPropertySymbols,rj=Object.prototype.hasOwnProperty,oj=Object.prototype.propertyIsEnumerable,lC=(e,t,n)=>t in e?RG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wf=(e,t)=>{for(var n in t||(t={}))rj.call(t,n)&&lC(e,n,t[n]);if(Bp)for(var n of Bp(t))oj.call(t,n)&&lC(e,n,t[n]);return e},DG=(e,t)=>TG(e,MG(t)),AG=(e,t)=>{var n={};for(var r in e)rj.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Bp)for(var r of Bp(e))t.indexOf(r)<0&&oj.call(e,r)&&(n[r]=e[r]);return n};function NG(e,t,n){const r=wr(e,t,n),{label:o,description:s,error:i,required:u,classNames:d,styles:f,className:h,unstyled:m,__staticSelector:v,sx:y,errorProps:S,labelProps:w,descriptionProps:C,wrapperProps:k,id:P,size:j,style:E,inputContainer:O,inputWrapperOrder:I,withAsterisk:R,variant:T}=r,D=AG(r,["label","description","error","required","classNames","styles","className","unstyled","__staticSelector","sx","errorProps","labelProps","descriptionProps","wrapperProps","id","size","style","inputContainer","inputWrapperOrder","withAsterisk","variant"]),$=oy(P),{systemStyles:A,rest:J}=Uh(D),z=wf({label:o,description:s,error:i,required:u,classNames:d,className:h,__staticSelector:v,sx:y,errorProps:S,labelProps:w,descriptionProps:C,unstyled:m,styles:f,id:$,size:j,style:E,inputContainer:O,inputWrapperOrder:I,withAsterisk:R,variant:T},k);return DG(wf({},J),{classNames:d,styles:f,unstyled:m,wrapperProps:wf(wf({},z),A),inputProps:{required:u,classNames:d,styles:f,unstyled:m,id:$,size:j,__staticSelector:v,error:i,variant:T}})}var zG=Jr((e,t,{size:n})=>({label:{display:"inline-block",fontSize:At({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 $G=zG;var LG=Object.defineProperty,Hp=Object.getOwnPropertySymbols,sj=Object.prototype.hasOwnProperty,aj=Object.prototype.propertyIsEnumerable,cC=(e,t,n)=>t in e?LG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,FG=(e,t)=>{for(var n in t||(t={}))sj.call(t,n)&&cC(e,n,t[n]);if(Hp)for(var n of Hp(t))aj.call(t,n)&&cC(e,n,t[n]);return e},BG=(e,t)=>{var n={};for(var r in e)sj.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Hp)for(var r of Hp(e))t.indexOf(r)<0&&aj.call(e,r)&&(n[r]=e[r]);return n};const HG={labelElement:"label",size:"sm"},py=p.forwardRef((e,t)=>{const n=wr("InputLabel",HG,e),{labelElement:r,children:o,required:s,size:i,classNames:u,styles:d,unstyled:f,className:h,htmlFor:m,__staticSelector:v,variant:y,onMouseDown:S}=n,w=BG(n,["labelElement","children","required","size","classNames","styles","unstyled","className","htmlFor","__staticSelector","variant","onMouseDown"]),{classes:C,cx:k}=$G(null,{name:["InputWrapper",v],classNames:u,styles:d,unstyled:f,variant:y,size:i});return L.createElement(yo,FG({component:r,ref:t,className:k(C.label,h),htmlFor:r==="label"?m:void 0,onMouseDown:P=>{S==null||S(P),!P.defaultPrevented&&P.detail>1&&P.preventDefault()}},w),o,s&&L.createElement("span",{className:C.required,"aria-hidden":!0}," *"))});py.displayName="@mantine/core/InputLabel";var WG=Jr((e,t,{size:n})=>({error:{wordBreak:"break-word",color:e.fn.variant({variant:"filled",color:"red"}).background,fontSize:`calc(${At({size:n,sizes:e.fontSizes})} - ${Le(2)})`,lineHeight:1.2,display:"block"}}));const VG=WG;var UG=Object.defineProperty,Wp=Object.getOwnPropertySymbols,ij=Object.prototype.hasOwnProperty,lj=Object.prototype.propertyIsEnumerable,uC=(e,t,n)=>t in e?UG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,GG=(e,t)=>{for(var n in t||(t={}))ij.call(t,n)&&uC(e,n,t[n]);if(Wp)for(var n of Wp(t))lj.call(t,n)&&uC(e,n,t[n]);return e},qG=(e,t)=>{var n={};for(var r in e)ij.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Wp)for(var r of Wp(e))t.indexOf(r)<0&&lj.call(e,r)&&(n[r]=e[r]);return n};const KG={size:"sm"},hy=p.forwardRef((e,t)=>{const n=wr("InputError",KG,e),{children:r,className:o,classNames:s,styles:i,unstyled:u,size:d,__staticSelector:f,variant:h}=n,m=qG(n,["children","className","classNames","styles","unstyled","size","__staticSelector","variant"]),{classes:v,cx:y}=VG(null,{name:["InputWrapper",f],classNames:s,styles:i,unstyled:u,variant:h,size:d});return L.createElement(Jl,GG({className:y(v.error,o),ref:t},m),r)});hy.displayName="@mantine/core/InputError";var YG=Jr((e,t,{size:n})=>({description:{wordBreak:"break-word",color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],fontSize:`calc(${At({size:n,sizes:e.fontSizes})} - ${Le(2)})`,lineHeight:1.2,display:"block"}}));const XG=YG;var QG=Object.defineProperty,Vp=Object.getOwnPropertySymbols,cj=Object.prototype.hasOwnProperty,uj=Object.prototype.propertyIsEnumerable,dC=(e,t,n)=>t in e?QG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ZG=(e,t)=>{for(var n in t||(t={}))cj.call(t,n)&&dC(e,n,t[n]);if(Vp)for(var n of Vp(t))uj.call(t,n)&&dC(e,n,t[n]);return e},JG=(e,t)=>{var n={};for(var r in e)cj.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Vp)for(var r of Vp(e))t.indexOf(r)<0&&uj.call(e,r)&&(n[r]=e[r]);return n};const eq={size:"sm"},my=p.forwardRef((e,t)=>{const n=wr("InputDescription",eq,e),{children:r,className:o,classNames:s,styles:i,unstyled:u,size:d,__staticSelector:f,variant:h}=n,m=JG(n,["children","className","classNames","styles","unstyled","size","__staticSelector","variant"]),{classes:v,cx:y}=XG(null,{name:["InputWrapper",f],classNames:s,styles:i,unstyled:u,variant:h,size:d});return L.createElement(Jl,ZG({color:"dimmed",className:y(v.description,o),ref:t,unstyled:u},m),r)});my.displayName="@mantine/core/InputDescription";const dj=p.createContext({offsetBottom:!1,offsetTop:!1,describedBy:void 0}),tq=dj.Provider,nq=()=>p.useContext(dj);function rq(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 oq=Object.defineProperty,sq=Object.defineProperties,aq=Object.getOwnPropertyDescriptors,fC=Object.getOwnPropertySymbols,iq=Object.prototype.hasOwnProperty,lq=Object.prototype.propertyIsEnumerable,pC=(e,t,n)=>t in e?oq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,cq=(e,t)=>{for(var n in t||(t={}))iq.call(t,n)&&pC(e,n,t[n]);if(fC)for(var n of fC(t))lq.call(t,n)&&pC(e,n,t[n]);return e},uq=(e,t)=>sq(e,aq(t)),dq=Jr(e=>({root:uq(cq({},e.fn.fontStyles()),{lineHeight:e.lineHeight})}));const fq=dq;var pq=Object.defineProperty,hq=Object.defineProperties,mq=Object.getOwnPropertyDescriptors,Up=Object.getOwnPropertySymbols,fj=Object.prototype.hasOwnProperty,pj=Object.prototype.propertyIsEnumerable,hC=(e,t,n)=>t in e?pq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ga=(e,t)=>{for(var n in t||(t={}))fj.call(t,n)&&hC(e,n,t[n]);if(Up)for(var n of Up(t))pj.call(t,n)&&hC(e,n,t[n]);return e},mC=(e,t)=>hq(e,mq(t)),gq=(e,t)=>{var n={};for(var r in e)fj.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Up)for(var r of Up(e))t.indexOf(r)<0&&pj.call(e,r)&&(n[r]=e[r]);return n};const vq={labelElement:"label",size:"sm",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},hj=p.forwardRef((e,t)=>{const n=wr("InputWrapper",vq,e),{className:r,label:o,children:s,required:i,id:u,error:d,description:f,labelElement:h,labelProps:m,descriptionProps:v,errorProps:y,classNames:S,styles:w,size:C,inputContainer:k,__staticSelector:P,unstyled:j,inputWrapperOrder:E,withAsterisk:O,variant:I}=n,R=gq(n,["className","label","children","required","id","error","description","labelElement","labelProps","descriptionProps","errorProps","classNames","styles","size","inputContainer","__staticSelector","unstyled","inputWrapperOrder","withAsterisk","variant"]),{classes:T,cx:D}=fq(null,{classNames:S,styles:w,name:["InputWrapper",P],unstyled:j,variant:I,size:C}),$={classNames:S,styles:w,unstyled:j,size:C,variant:I,__staticSelector:P},A=typeof O=="boolean"?O:i,J=u?`${u}-error`:y==null?void 0:y.id,z=u?`${u}-description`:v==null?void 0:v.id,G=`${!!d&&typeof d!="boolean"?J:""} ${f?z:""}`,K=G.trim().length>0?G.trim():void 0,N=o&&L.createElement(py,Ga(Ga({key:"label",labelElement:h,id:u?`${u}-label`:void 0,htmlFor:u,required:A},$),m),o),V=f&&L.createElement(my,mC(Ga(Ga({key:"description"},v),$),{size:(v==null?void 0:v.size)||$.size,id:(v==null?void 0:v.id)||z}),f),W=L.createElement(p.Fragment,{key:"input"},k(s)),U=typeof d!="boolean"&&d&&L.createElement(hy,mC(Ga(Ga({},y),$),{size:(y==null?void 0:y.size)||$.size,key:"error",id:(y==null?void 0:y.id)||J}),d),re=E.map(ve=>{switch(ve){case"label":return N;case"input":return W;case"description":return V;case"error":return U;default:return null}});return L.createElement(tq,{value:Ga({describedBy:K},rq(E,{hasDescription:!!V,hasError:!!U}))},L.createElement(yo,Ga({className:D(T.root,r),ref:t},R),re))});hj.displayName="@mantine/core/InputWrapper";var yq=Object.defineProperty,Gp=Object.getOwnPropertySymbols,mj=Object.prototype.hasOwnProperty,gj=Object.prototype.propertyIsEnumerable,gC=(e,t,n)=>t in e?yq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,bq=(e,t)=>{for(var n in t||(t={}))mj.call(t,n)&&gC(e,n,t[n]);if(Gp)for(var n of Gp(t))gj.call(t,n)&&gC(e,n,t[n]);return e},xq=(e,t)=>{var n={};for(var r in e)mj.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Gp)for(var r of Gp(e))t.indexOf(r)<0&&gj.call(e,r)&&(n[r]=e[r]);return n};const Sq={},vj=p.forwardRef((e,t)=>{const n=wr("InputPlaceholder",Sq,e),{sx:r}=n,o=xq(n,["sx"]);return L.createElement(yo,bq({component:"span",sx:[s=>s.fn.placeholderStyles(),...SP(r)],ref:t},o))});vj.displayName="@mantine/core/InputPlaceholder";var wq=Object.defineProperty,Cq=Object.defineProperties,kq=Object.getOwnPropertyDescriptors,vC=Object.getOwnPropertySymbols,Pq=Object.prototype.hasOwnProperty,_q=Object.prototype.propertyIsEnumerable,yC=(e,t,n)=>t in e?wq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Cf=(e,t)=>{for(var n in t||(t={}))Pq.call(t,n)&&yC(e,n,t[n]);if(vC)for(var n of vC(t))_q.call(t,n)&&yC(e,n,t[n]);return e},tv=(e,t)=>Cq(e,kq(t));const Ko={xs:Le(30),sm:Le(36),md:Le(42),lg:Le(50),xl:Le(60)},jq=["default","filled","unstyled"];function Eq({theme:e,variant:t}){return jq.includes(t)?t==="default"?{border:`${Le(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:`${Le(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:Le(28),outline:0,"&:focus, &:focus-within":{outline:"none",borderColor:"transparent"},"&:disabled":{backgroundColor:"transparent","&:focus, &:focus-within":{outline:"none",borderColor:"transparent"}}}:null}var Iq=Jr((e,{multiline:t,radius:n,invalid:r,rightSectionWidth:o,withRightSection:s,iconWidth:i,offsetBottom:u,offsetTop:d,pointer:f},{variant:h,size:m})=>{const v=e.fn.variant({variant:"filled",color:"red"}).background,y=h==="default"||h==="filled"?{minHeight:At({size:m,sizes:Ko}),paddingLeft:`calc(${At({size:m,sizes:Ko})} / 3)`,paddingRight:s?o||At({size:m,sizes:Ko}):`calc(${At({size:m,sizes:Ko})} / 3)`,borderRadius:e.fn.radius(n)}:h==="unstyled"&&s?{paddingRight:o||At({size:m,sizes:Ko})}:null;return{wrapper:{position:"relative",marginTop:d?`calc(${e.spacing.xs} / 2)`:void 0,marginBottom:u?`calc(${e.spacing.xs} / 2)`:void 0,"&:has(input:disabled)":{"& .mantine-Input-rightSection":{display:"none"}}},input:tv(Cf(Cf(tv(Cf({},e.fn.fontStyles()),{height:t?h==="unstyled"?void 0:"auto":At({size:m,sizes:Ko}),WebkitTapHighlightColor:"transparent",lineHeight:t?e.lineHeight:`calc(${At({size:m,sizes:Ko})} - ${Le(2)})`,appearance:"none",resize:"none",boxSizing:"border-box",fontSize:At({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}),Eq({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 i=="number"?Le(i):At({size:m,sizes:Ko})},"&::placeholder":tv(Cf({},e.fn.placeholderStyles()),{opacity:1}),"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button, &::-webkit-search-decoration, &::-webkit-search-cancel-button, &::-webkit-search-results-button, &::-webkit-search-results-decoration":{appearance:"none"},"&[type=number]":{MozAppearance:"textfield"}}),icon:{pointerEvents:"none",position:"absolute",zIndex:1,left:0,top:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",width:i?Le(i):At({size:m,sizes:Ko}),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||At({size:m,sizes:Ko})}}});const Oq=Iq;var Rq=Object.defineProperty,Tq=Object.defineProperties,Mq=Object.getOwnPropertyDescriptors,qp=Object.getOwnPropertySymbols,yj=Object.prototype.hasOwnProperty,bj=Object.prototype.propertyIsEnumerable,bC=(e,t,n)=>t in e?Rq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,kf=(e,t)=>{for(var n in t||(t={}))yj.call(t,n)&&bC(e,n,t[n]);if(qp)for(var n of qp(t))bj.call(t,n)&&bC(e,n,t[n]);return e},xC=(e,t)=>Tq(e,Mq(t)),Dq=(e,t)=>{var n={};for(var r in e)yj.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&qp)for(var r of qp(e))t.indexOf(r)<0&&bj.call(e,r)&&(n[r]=e[r]);return n};const Aq={size:"sm",variant:"default"},sl=p.forwardRef((e,t)=>{const n=wr("Input",Aq,e),{className:r,error:o,required:s,disabled:i,variant:u,icon:d,style:f,rightSectionWidth:h,iconWidth:m,rightSection:v,rightSectionProps:y,radius:S,size:w,wrapperProps:C,classNames:k,styles:P,__staticSelector:j,multiline:E,sx:O,unstyled:I,pointer:R}=n,T=Dq(n,["className","error","required","disabled","variant","icon","style","rightSectionWidth","iconWidth","rightSection","rightSectionProps","radius","size","wrapperProps","classNames","styles","__staticSelector","multiline","sx","unstyled","pointer"]),{offsetBottom:D,offsetTop:$,describedBy:A}=nq(),{classes:J,cx:z}=Oq({radius:S,multiline:E,invalid:!!o,rightSectionWidth:h?Le(h):void 0,iconWidth:m,withRightSection:!!v,offsetBottom:D,offsetTop:$,pointer:R},{classNames:k,styles:P,name:["Input",j],unstyled:I,variant:u,size:w}),{systemStyles:B,rest:G}=Uh(T);return L.createElement(yo,kf(kf({className:z(J.wrapper,r),sx:O,style:f},B),C),d&&L.createElement("div",{className:J.icon},d),L.createElement(yo,xC(kf({component:"input"},G),{ref:t,required:s,"aria-invalid":!!o,"aria-describedby":A,disabled:i,"data-disabled":i||void 0,"data-with-icon":!!d||void 0,"data-invalid":!!o||void 0,className:J.input})),v&&L.createElement("div",xC(kf({},y),{className:J.rightSection}),v))});sl.displayName="@mantine/core/Input";sl.Wrapper=hj;sl.Label=py;sl.Description=my;sl.Error=hy;sl.Placeholder=vj;const Kp=sl;var Nq=Object.defineProperty,Yp=Object.getOwnPropertySymbols,xj=Object.prototype.hasOwnProperty,Sj=Object.prototype.propertyIsEnumerable,SC=(e,t,n)=>t in e?Nq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wC=(e,t)=>{for(var n in t||(t={}))xj.call(t,n)&&SC(e,n,t[n]);if(Yp)for(var n of Yp(t))Sj.call(t,n)&&SC(e,n,t[n]);return e},zq=(e,t)=>{var n={};for(var r in e)xj.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Yp)for(var r of Yp(e))t.indexOf(r)<0&&Sj.call(e,r)&&(n[r]=e[r]);return n};const $q={multiple:!1},wj=p.forwardRef((e,t)=>{const n=wr("FileButton",$q,e),{onChange:r,children:o,multiple:s,accept:i,name:u,form:d,resetRef:f,disabled:h,capture:m,inputProps:v}=n,y=zq(n,["onChange","children","multiple","accept","name","form","resetRef","disabled","capture","inputProps"]),S=p.useRef(),w=()=>{!h&&S.current.click()},C=P=>{r(s?Array.from(P.currentTarget.files):P.currentTarget.files[0]||null)};return RP(f,()=>{S.current.value=""}),L.createElement(L.Fragment,null,o(wC({onClick:w},y)),L.createElement("input",wC({style:{display:"none"},type:"file",accept:i,multiple:s,onChange:C,ref:Zu(t,S),name:u,form:d,capture:m},v)))});wj.displayName="@mantine/core/FileButton";const Cj={xs:Le(16),sm:Le(22),md:Le(26),lg:Le(30),xl:Le(36)},Lq={xs:Le(10),sm:Le(12),md:Le(14),lg:Le(16),xl:Le(18)};var Fq=Jr((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:At({size:o,sizes:Cj}),paddingLeft:`calc(${At({size:o,sizes:e.spacing})} / 1.5)`,paddingRight:t||r?At({size:o,sizes:e.spacing}):0,fontWeight:500,fontSize:At({size:o,sizes:Lq}),borderRadius:At({size:n,sizes:e.radius}),cursor:t?"not-allowed":"default",userSelect:"none",maxWidth:`calc(100% - ${Le(10)})`},defaultValueRemove:{color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],marginLeft:`calc(${At({size:o,sizes:e.spacing})} / 6)`},defaultValueLabel:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}));const Bq=Fq;var Hq=Object.defineProperty,Xp=Object.getOwnPropertySymbols,kj=Object.prototype.hasOwnProperty,Pj=Object.prototype.propertyIsEnumerable,CC=(e,t,n)=>t in e?Hq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Wq=(e,t)=>{for(var n in t||(t={}))kj.call(t,n)&&CC(e,n,t[n]);if(Xp)for(var n of Xp(t))Pj.call(t,n)&&CC(e,n,t[n]);return e},Vq=(e,t)=>{var n={};for(var r in e)kj.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Xp)for(var r of Xp(e))t.indexOf(r)<0&&Pj.call(e,r)&&(n[r]=e[r]);return n};const Uq={xs:16,sm:22,md:24,lg:26,xl:30};function _j(e){var t=e,{label:n,classNames:r,styles:o,className:s,onRemove:i,disabled:u,readOnly:d,size:f,radius:h="sm",variant:m,unstyled:v}=t,y=Vq(t,["label","classNames","styles","className","onRemove","disabled","readOnly","size","radius","variant","unstyled"]);const{classes:S,cx:w}=Bq({disabled:u,readOnly:d,radius:h},{name:"MultiSelect",classNames:r,styles:o,unstyled:v,size:f,variant:m});return L.createElement("div",Wq({className:w(S.defaultValue,s)},y),L.createElement("span",{className:S.defaultValueLabel},n),!u&&!d&&L.createElement(l_,{"aria-hidden":!0,onMouseDown:i,size:Uq[f],radius:2,color:"blue",variant:"transparent",iconSize:"70%",className:S.defaultValueRemove,tabIndex:-1,unstyled:v}))}_j.displayName="@mantine/core/MultiSelect/DefaultValue";function Gq({data:e,searchable:t,limit:n,searchValue:r,filter:o,value:s,disableSelectedItemFiltering:i}){if(!t&&s.length===0)return e;if(!t){const d=[];for(let f=0;f<e.length;f+=1)(i||!s.some(h=>h===e[f].value&&!e[f].disabled))&&d.push(e[f]);return d}const u=[];for(let d=0;d<e.length&&(o(r,!i&&s.some(f=>f===e[d].value&&!e[d].disabled),e[d])&&u.push(e[d]),!(u.length>=n));d+=1);return u}var qq=Object.defineProperty,Qp=Object.getOwnPropertySymbols,jj=Object.prototype.hasOwnProperty,Ej=Object.prototype.propertyIsEnumerable,kC=(e,t,n)=>t in e?qq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,PC=(e,t)=>{for(var n in t||(t={}))jj.call(t,n)&&kC(e,n,t[n]);if(Qp)for(var n of Qp(t))Ej.call(t,n)&&kC(e,n,t[n]);return e},Kq=(e,t)=>{var n={};for(var r in e)jj.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Qp)for(var r of Qp(e))t.indexOf(r)<0&&Ej.call(e,r)&&(n[r]=e[r]);return n};const Yq={xs:Le(14),sm:Le(18),md:Le(20),lg:Le(24),xl:Le(28)};function Xq(e){var t=e,{size:n,error:r,style:o}=t,s=Kq(t,["size","error","style"]);const i=Ia(),u=At({size:n,sizes:Yq});return L.createElement("svg",PC({width:u,height:u,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:PC({color:r?i.colors.red[6]:i.colors.gray[6]},o),"data-chevron":!0},s),L.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 Qq=Object.defineProperty,Zq=Object.defineProperties,Jq=Object.getOwnPropertyDescriptors,_C=Object.getOwnPropertySymbols,eK=Object.prototype.hasOwnProperty,tK=Object.prototype.propertyIsEnumerable,jC=(e,t,n)=>t in e?Qq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nK=(e,t)=>{for(var n in t||(t={}))eK.call(t,n)&&jC(e,n,t[n]);if(_C)for(var n of _C(t))tK.call(t,n)&&jC(e,n,t[n]);return e},rK=(e,t)=>Zq(e,Jq(t));function Ij({shouldClear:e,clearButtonProps:t,onClear:n,size:r,error:o}){return e?L.createElement(l_,rK(nK({},t),{variant:"transparent",onClick:n,size:r,onMouseDown:s=>s.preventDefault()})):L.createElement(Xq,{error:o,size:r})}Ij.displayName="@mantine/core/SelectRightSection";var oK=Object.defineProperty,sK=Object.defineProperties,aK=Object.getOwnPropertyDescriptors,Zp=Object.getOwnPropertySymbols,Oj=Object.prototype.hasOwnProperty,Rj=Object.prototype.propertyIsEnumerable,EC=(e,t,n)=>t in e?oK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nv=(e,t)=>{for(var n in t||(t={}))Oj.call(t,n)&&EC(e,n,t[n]);if(Zp)for(var n of Zp(t))Rj.call(t,n)&&EC(e,n,t[n]);return e},IC=(e,t)=>sK(e,aK(t)),iK=(e,t)=>{var n={};for(var r in e)Oj.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Zp)for(var r of Zp(e))t.indexOf(r)<0&&Rj.call(e,r)&&(n[r]=e[r]);return n};function Tj(e){var t=e,{styles:n,rightSection:r,rightSectionWidth:o,theme:s}=t,i=iK(t,["styles","rightSection","rightSectionWidth","theme"]);if(r)return{rightSection:r,rightSectionWidth:o,styles:n};const u=typeof n=="function"?n(s):n;return{rightSection:!i.readOnly&&!(i.disabled&&i.shouldClear)&&L.createElement(Ij,nv({},i)),styles:IC(nv({},u),{rightSection:IC(nv({},u==null?void 0:u.rightSection),{pointerEvents:i.shouldClear?void 0:"none"})})}}var lK=Object.defineProperty,cK=Object.defineProperties,uK=Object.getOwnPropertyDescriptors,OC=Object.getOwnPropertySymbols,dK=Object.prototype.hasOwnProperty,fK=Object.prototype.propertyIsEnumerable,RC=(e,t,n)=>t in e?lK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pK=(e,t)=>{for(var n in t||(t={}))dK.call(t,n)&&RC(e,n,t[n]);if(OC)for(var n of OC(t))fK.call(t,n)&&RC(e,n,t[n]);return e},hK=(e,t)=>cK(e,uK(t)),mK=Jr((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(${At({size:n,sizes:Ko})} - ${Le(2)})`,display:"flex",alignItems:"center",flexWrap:"wrap",marginLeft:`calc(-${e.spacing.xs} / 2)`,boxSizing:"border-box","&[data-clearable]":{marginRight:At({size:n,sizes:Ko})}},value:{margin:`calc(${e.spacing.xs} / 2 - ${Le(2)}) calc(${e.spacing.xs} / 2)`},searchInput:hK(pK({},e.fn.fontStyles()),{flex:1,minWidth:Le(60),backgroundColor:"transparent",border:0,outline:0,fontSize:At({size:n,sizes:e.fontSizes}),padding:0,marginLeft:`calc(${e.spacing.xs} / 2)`,appearance:"none",color:"inherit",maxHeight:At({size:n,sizes:Cj}),"&::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 gK=mK;var vK=Object.defineProperty,yK=Object.defineProperties,bK=Object.getOwnPropertyDescriptors,Jp=Object.getOwnPropertySymbols,Mj=Object.prototype.hasOwnProperty,Dj=Object.prototype.propertyIsEnumerable,TC=(e,t,n)=>t in e?vK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,El=(e,t)=>{for(var n in t||(t={}))Mj.call(t,n)&&TC(e,n,t[n]);if(Jp)for(var n of Jp(t))Dj.call(t,n)&&TC(e,n,t[n]);return e},MC=(e,t)=>yK(e,bK(t)),xK=(e,t)=>{var n={};for(var r in e)Mj.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Jp)for(var r of Jp(e))t.indexOf(r)<0&&Dj.call(e,r)&&(n[r]=e[r]);return n};function SK(e,t,n){return t?!1:n.label.toLowerCase().trim().includes(e.toLowerCase().trim())}function wK(e,t){return!!e&&!t.some(n=>n.value.toLowerCase()===e.toLowerCase())}function DC(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 CK={size:"sm",valueComponent:_j,itemComponent:ay,transitionProps:{transition:"fade",duration:0},maxDropdownHeight:220,shadow:"sm",searchable:!1,filter:SK,limit:1/0,clearSearchOnChange:!0,clearable:!1,clearSearchOnBlur:!1,disabled:!1,initiallyOpened:!1,creatable:!1,shouldCreate:wK,switchDirectionOnFlip:!1,zIndex:ny("popover"),selectOnBlur:!1,positionDependencies:[],dropdownPosition:"flip"},Aj=p.forwardRef((e,t)=>{const n=wr("MultiSelect",CK,e),{className:r,style:o,required:s,label:i,description:u,size:d,error:f,classNames:h,styles:m,wrapperProps:v,value:y,defaultValue:S,data:w,onChange:C,valueComponent:k,itemComponent:P,id:j,transitionProps:E,maxDropdownHeight:O,shadow:I,nothingFound:R,onFocus:T,onBlur:D,searchable:$,placeholder:A,filter:J,limit:z,clearSearchOnChange:B,clearable:G,clearSearchOnBlur:K,variant:N,onSearchChange:V,searchValue:W,disabled:U,initiallyOpened:re,radius:ve,icon:le,rightSection:se,rightSectionWidth:Y,creatable:ae,getCreateLabel:ue,shouldCreate:xe,onCreate:oe,sx:ge,dropdownComponent:fe,onDropdownClose:Pe,onDropdownOpen:Ae,maxSelectedValues:ye,withinPortal:Oe,switchDirectionOnFlip:at,zIndex:Fe,selectOnBlur:Ye,name:jt,dropdownPosition:xt,errorProps:Fn,labelProps:X,descriptionProps:we,form:te,positionDependencies:he,onKeyDown:Ne,unstyled:Xe,inputContainer:yt,inputWrapperOrder:Xt,readOnly:ln,withAsterisk:kn,clearButtonProps:vr,hoverOnSearchChange:cn,disableSelectedItemFiltering:Yn}=n,Re=xK(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:et,cx:it,theme:ut}=gK({invalid:!!f},{name:"MultiSelect",classNames:h,styles:m,unstyled:Xe,size:d,variant:N}),{systemStyles:Nt,rest:yr}=Uh(Re),un=p.useRef(),xn=p.useRef({}),Cr=oy(j),[Pn,En]=p.useState(re),[is,dn]=p.useState(-1),[zo,$o]=p.useState("column"),[$n,ls]=Pu({value:W,defaultValue:"",finalValue:void 0,onChange:V}),[Da,Er]=p.useState(!1),{scrollIntoView:Lo,targetRef:na,scrollableRef:Aa}=MP({duration:0,offset:5,cancelable:!1,isList:!0}),cs=ae&&typeof ue=="function";let q=null;const Z=w.map(Ee=>typeof Ee=="string"?{label:Ee,value:Ee}:Ee),de=wP({data:Z}),[be,Se]=Pu({value:DC(y,w),defaultValue:DC(S,w),finalValue:[],onChange:C}),Qe=p.useRef(!!ye&&ye<be.length),pt=Ee=>{if(!ln){const ht=be.filter(Tt=>Tt!==Ee);Se(ht),ye&&ht.length<ye&&(Qe.current=!1)}},zt=Ee=>{ls(Ee.currentTarget.value),!U&&!Qe.current&&$&&En(!0)},lt=Ee=>{typeof T=="function"&&T(Ee),!U&&!Qe.current&&$&&En(!0)},Be=Gq({data:de,searchable:$,searchValue:$n,limit:z,filter:J,value:be,disableSelectedItemFiltering:Yn});cs&&xe($n,de)&&(q=ue($n),Be.push({label:$n,value:$n,creatable:!0}));const qe=Math.min(is,Be.length-1),ke=(Ee,ht,Tt)=>{let Mt=Ee;for(;Tt(Mt);)if(Mt=ht(Mt),!Be[Mt].disabled)return Mt;return Ee};Cs(()=>{dn(cn&&$n?0:-1)},[$n,cn]),Cs(()=>{!U&&be.length>w.length&&En(!1),ye&&be.length<ye&&(Qe.current=!1),ye&&be.length>=ye&&(Qe.current=!0,En(!1))},[be]);const He=Ee=>{if(!ln)if(B&&ls(""),be.includes(Ee.value))pt(Ee.value);else{if(Ee.creatable&&typeof oe=="function"){const ht=oe(Ee.value);typeof ht<"u"&&ht!==null&&Se(typeof ht=="string"?[...be,ht]:[...be,ht.value])}else Se([...be,Ee.value]);be.length===ye-1&&(Qe.current=!0,En(!1)),Be.length===1&&En(!1)}},St=Ee=>{typeof D=="function"&&D(Ee),Ye&&Be[qe]&&Pn&&He(Be[qe]),K&&ls(""),En(!1)},kt=Ee=>{if(Da||(Ne==null||Ne(Ee),ln)||Ee.key!=="Backspace"&&ye&&Qe.current)return;const ht=zo==="column",Tt=()=>{dn($t=>{var fn;const Vt=ke($t,Qt=>Qt+1,Qt=>Qt<Be.length-1);return Pn&&(na.current=xn.current[(fn=Be[Vt])==null?void 0:fn.value],Lo({alignment:ht?"end":"start"})),Vt})},Mt=()=>{dn($t=>{var fn;const Vt=ke($t,Qt=>Qt-1,Qt=>Qt>0);return Pn&&(na.current=xn.current[(fn=Be[Vt])==null?void 0:fn.value],Lo({alignment:ht?"start":"end"})),Vt})};switch(Ee.key){case"ArrowUp":{Ee.preventDefault(),En(!0),ht?Mt():Tt();break}case"ArrowDown":{Ee.preventDefault(),En(!0),ht?Tt():Mt();break}case"Enter":{Ee.preventDefault(),Be[qe]&&Pn?He(Be[qe]):En(!0);break}case" ":{$||(Ee.preventDefault(),Be[qe]&&Pn?He(Be[qe]):En(!0));break}case"Backspace":{be.length>0&&$n.length===0&&(Se(be.slice(0,-1)),En(!0),ye&&(Qe.current=!1));break}case"Home":{if(!$){Ee.preventDefault(),Pn||En(!0);const $t=Be.findIndex(fn=>!fn.disabled);dn($t),Lo({alignment:ht?"end":"start"})}break}case"End":{if(!$){Ee.preventDefault(),Pn||En(!0);const $t=Be.map(fn=>!!fn.disabled).lastIndexOf(!1);dn($t),Lo({alignment:ht?"end":"start"})}break}case"Escape":En(!1)}},Rt=be.map(Ee=>{let ht=de.find(Tt=>Tt.value===Ee&&!Tt.disabled);return!ht&&cs&&(ht={value:Ee,label:Ee}),ht}).filter(Ee=>!!Ee).map((Ee,ht)=>L.createElement(k,MC(El({},Ee),{variant:N,disabled:U,className:et.value,readOnly:ln,onRemove:Tt=>{Tt.preventDefault(),Tt.stopPropagation(),pt(Ee.value)},key:Ee.value,size:d,styles:m,classNames:h,radius:ve,index:ht}))),Lt=Ee=>be.includes(Ee),Ut=()=>{var Ee;ls(""),Se([]),(Ee=un.current)==null||Ee.focus(),ye&&(Qe.current=!1)},Ft=!ln&&(Be.length>0?Pn:Pn&&!!R);return Cs(()=>{const Ee=Ft?Ae:Pe;typeof Ee=="function"&&Ee()},[Ft]),L.createElement(Kp.Wrapper,El(El({required:s,id:Cr,label:i,error:f,description:u,size:d,className:r,style:o,classNames:h,styles:m,__staticSelector:"MultiSelect",sx:ge,errorProps:Fn,descriptionProps:we,labelProps:X,inputContainer:yt,inputWrapperOrder:Xt,unstyled:Xe,withAsterisk:kn,variant:N},Nt),v),L.createElement(ai,{opened:Ft,transitionProps:E,shadow:"sm",withinPortal:Oe,__staticSelector:"MultiSelect",onDirectionChange:$o,switchDirectionOnFlip:at,zIndex:Fe,dropdownPosition:xt,positionDependencies:[...he,$n],classNames:h,styles:m,unstyled:Xe,variant:N},L.createElement(ai.Target,null,L.createElement("div",{className:et.wrapper,role:"combobox","aria-haspopup":"listbox","aria-owns":Pn&&Ft?`${Cr}-items`:null,"aria-controls":Cr,"aria-expanded":Pn,onMouseLeave:()=>dn(-1),tabIndex:-1},L.createElement("input",{type:"hidden",name:jt,value:be.join(","),form:te,disabled:U}),L.createElement(Kp,El({__staticSelector:"MultiSelect",style:{overflow:"hidden"},component:"div",multiline:!0,size:d,variant:N,disabled:U,error:f,required:s,radius:ve,icon:le,unstyled:Xe,onMouseDown:Ee=>{var ht;Ee.preventDefault(),!U&&!Qe.current&&En(!Pn),(ht=un.current)==null||ht.focus()},classNames:MC(El({},h),{input:it({[et.input]:!$},h==null?void 0:h.input)})},Tj({theme:ut,rightSection:se,rightSectionWidth:Y,styles:m,size:d,shouldClear:G&&be.length>0,onClear:Ut,error:f,disabled:U,clearButtonProps:vr,readOnly:ln})),L.createElement("div",{className:et.values,"data-clearable":G||void 0},Rt,L.createElement("input",El({ref:Zu(t,un),type:"search",id:Cr,className:it(et.searchInput,{[et.searchInputPointer]:!$,[et.searchInputInputHidden]:!Pn&&be.length>0||!$&&be.length>0,[et.searchInputEmpty]:be.length===0}),onKeyDown:kt,value:$n,onChange:zt,onFocus:lt,onBlur:St,readOnly:!$||Qe.current||ln,placeholder:be.length===0?A:void 0,disabled:U,"data-mantine-stop-propagation":Pn,autoComplete:"off",onCompositionStart:()=>Er(!0),onCompositionEnd:()=>Er(!1)},yr)))))),L.createElement(ai.Dropdown,{component:fe||Yh,maxHeight:O,direction:zo,id:Cr,innerRef:Aa,__staticSelector:"MultiSelect",classNames:h,styles:m},L.createElement(sy,{data:Be,hovered:qe,classNames:h,styles:m,uuid:Cr,__staticSelector:"MultiSelect",onItemHover:dn,onItemSelect:He,itemsRefs:xn,itemComponent:P,size:d,nothingFound:R,isItemSelected:Lt,creatable:ae&&!!q,createLabel:q,unstyled:Xe,variant:N}))))});Aj.displayName="@mantine/core/MultiSelect";function kK({data:e,searchable:t,limit:n,searchValue:r,filter:o,value:s,filterDataOnExactSearchMatch:i}){if(!t)return e;const u=s!=null&&e.find(f=>f.value===s)||null;if(u&&!i&&(u==null?void 0:u.label)===r){if(n){if(n>=e.length)return e;const f=e.indexOf(u),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 PK=Jr(()=>({input:{"&:not(:disabled)":{cursor:"pointer","&::selection":{backgroundColor:"transparent"}}}}));const _K=PK;var jK=Object.defineProperty,EK=Object.defineProperties,IK=Object.getOwnPropertyDescriptors,eh=Object.getOwnPropertySymbols,Nj=Object.prototype.hasOwnProperty,zj=Object.prototype.propertyIsEnumerable,AC=(e,t,n)=>t in e?jK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Gc=(e,t)=>{for(var n in t||(t={}))Nj.call(t,n)&&AC(e,n,t[n]);if(eh)for(var n of eh(t))zj.call(t,n)&&AC(e,n,t[n]);return e},rv=(e,t)=>EK(e,IK(t)),OK=(e,t)=>{var n={};for(var r in e)Nj.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&eh)for(var r of eh(e))t.indexOf(r)<0&&zj.call(e,r)&&(n[r]=e[r]);return n};function RK(e,t){return t.label.toLowerCase().trim().includes(e.toLowerCase().trim())}function TK(e,t){return!!e&&!t.some(n=>n.label.toLowerCase()===e.toLowerCase())}const MK={required:!1,size:"sm",shadow:"sm",itemComponent:ay,transitionProps:{transition:"fade",duration:0},initiallyOpened:!1,filter:RK,maxDropdownHeight:220,searchable:!1,clearable:!1,limit:1/0,disabled:!1,creatable:!1,shouldCreate:TK,selectOnBlur:!1,switchDirectionOnFlip:!1,filterDataOnExactSearchMatch:!1,zIndex:ny("popover"),positionDependencies:[],dropdownPosition:"flip"},$j=p.forwardRef((e,t)=>{const n=NG("Select",MK,e),{inputProps:r,wrapperProps:o,shadow:s,data:i,value:u,defaultValue:d,onChange:f,itemComponent:h,onKeyDown:m,onBlur:v,onFocus:y,transitionProps:S,initiallyOpened:w,unstyled:C,classNames:k,styles:P,filter:j,maxDropdownHeight:E,searchable:O,clearable:I,nothingFound:R,limit:T,disabled:D,onSearchChange:$,searchValue:A,rightSection:J,rightSectionWidth:z,creatable:B,getCreateLabel:G,shouldCreate:K,selectOnBlur:N,onCreate:V,dropdownComponent:W,onDropdownClose:U,onDropdownOpen:re,withinPortal:ve,portalProps:le,switchDirectionOnFlip:se,zIndex:Y,name:ae,dropdownPosition:ue,allowDeselect:xe,placeholder:oe,filterDataOnExactSearchMatch:ge,form:fe,positionDependencies:Pe,readOnly:Ae,clearButtonProps:ye,hoverOnSearchChange:Oe}=n,at=OK(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:Fe,cx:Ye,theme:jt}=_K(),[xt,Fn]=p.useState(w),[X,we]=p.useState(-1),te=p.useRef(),he=p.useRef({}),[Ne,Xe]=p.useState("column"),yt=Ne==="column",{scrollIntoView:Xt,targetRef:ln,scrollableRef:kn}=MP({duration:0,offset:5,cancelable:!1,isList:!0}),vr=xe===void 0?I:xe,cn=Z=>{if(xt!==Z){Fn(Z);const de=Z?re:U;typeof de=="function"&&de()}},Yn=B&&typeof G=="function";let Re=null;const et=i.map(Z=>typeof Z=="string"?{label:Z,value:Z}:Z),it=wP({data:et}),[ut,Nt,yr]=Pu({value:u,defaultValue:d,finalValue:null,onChange:f}),un=it.find(Z=>Z.value===ut),[xn,Cr]=Pu({value:A,defaultValue:(un==null?void 0:un.label)||"",finalValue:void 0,onChange:$}),Pn=Z=>{Cr(Z),O&&typeof $=="function"&&$(Z)},En=()=>{var Z;Ae||(Nt(null),yr||Pn(""),(Z=te.current)==null||Z.focus())};p.useEffect(()=>{const Z=it.find(de=>de.value===ut);Z?Pn(Z.label):(!Yn||!ut)&&Pn("")},[ut]),p.useEffect(()=>{un&&(!O||!xt)&&Pn(un.label)},[un==null?void 0:un.label]);const is=Z=>{if(!Ae)if(vr&&(un==null?void 0:un.value)===Z.value)Nt(null),cn(!1);else{if(Z.creatable&&typeof V=="function"){const de=V(Z.value);typeof de<"u"&&de!==null&&Nt(typeof de=="string"?de:de.value)}else Nt(Z.value);yr||Pn(Z.label),we(-1),cn(!1),te.current.focus()}},dn=kK({data:it,searchable:O,limit:T,searchValue:xn,filter:j,filterDataOnExactSearchMatch:ge,value:ut});Yn&&K(xn,dn)&&(Re=G(xn),dn.push({label:xn,value:xn,creatable:!0}));const zo=(Z,de,be)=>{let Se=Z;for(;be(Se);)if(Se=de(Se),!dn[Se].disabled)return Se;return Z};Cs(()=>{we(Oe&&xn?0:-1)},[xn,Oe]);const $o=ut?dn.findIndex(Z=>Z.value===ut):0,$n=!Ae&&(dn.length>0?xt:xt&&!!R),ls=()=>{we(Z=>{var de;const be=zo(Z,Se=>Se-1,Se=>Se>0);return ln.current=he.current[(de=dn[be])==null?void 0:de.value],$n&&Xt({alignment:yt?"start":"end"}),be})},Da=()=>{we(Z=>{var de;const be=zo(Z,Se=>Se+1,Se=>Se<dn.length-1);return ln.current=he.current[(de=dn[be])==null?void 0:de.value],$n&&Xt({alignment:yt?"end":"start"}),be})},Er=()=>window.setTimeout(()=>{var Z;ln.current=he.current[(Z=dn[$o])==null?void 0:Z.value],Xt({alignment:yt?"end":"start"})},50);Cs(()=>{$n&&Er()},[$n]);const Lo=Z=>{switch(typeof m=="function"&&m(Z),Z.key){case"ArrowUp":{Z.preventDefault(),xt?yt?ls():Da():(we($o),cn(!0),Er());break}case"ArrowDown":{Z.preventDefault(),xt?yt?Da():ls():(we($o),cn(!0),Er());break}case"Home":{if(!O){Z.preventDefault(),xt||cn(!0);const de=dn.findIndex(be=>!be.disabled);we(de),$n&&Xt({alignment:yt?"end":"start"})}break}case"End":{if(!O){Z.preventDefault(),xt||cn(!0);const de=dn.map(be=>!!be.disabled).lastIndexOf(!1);we(de),$n&&Xt({alignment:yt?"end":"start"})}break}case"Escape":{Z.preventDefault(),cn(!1),we(-1);break}case" ":{O||(Z.preventDefault(),dn[X]&&xt?is(dn[X]):(cn(!0),we($o),Er()));break}case"Enter":O||Z.preventDefault(),dn[X]&&xt&&(Z.preventDefault(),is(dn[X]))}},na=Z=>{typeof v=="function"&&v(Z);const de=it.find(be=>be.value===ut);N&&dn[X]&&xt&&is(dn[X]),Pn((de==null?void 0:de.label)||""),cn(!1)},Aa=Z=>{typeof y=="function"&&y(Z),O&&cn(!0)},cs=Z=>{Ae||(Pn(Z.currentTarget.value),I&&Z.currentTarget.value===""&&Nt(null),we(-1),cn(!0))},q=()=>{Ae||(cn(!xt),ut&&!xt&&we($o))};return L.createElement(Kp.Wrapper,rv(Gc({},o),{__staticSelector:"Select"}),L.createElement(ai,{opened:$n,transitionProps:S,shadow:s,withinPortal:ve,portalProps:le,__staticSelector:"Select",onDirectionChange:Xe,switchDirectionOnFlip:se,zIndex:Y,dropdownPosition:ue,positionDependencies:[...Pe,xn],classNames:k,styles:P,unstyled:C,variant:r.variant},L.createElement(ai.Target,null,L.createElement("div",{role:"combobox","aria-haspopup":"listbox","aria-owns":$n?`${r.id}-items`:null,"aria-controls":r.id,"aria-expanded":$n,onMouseLeave:()=>we(-1),tabIndex:-1},L.createElement("input",{type:"hidden",name:ae,value:ut||"",form:fe,disabled:D}),L.createElement(Kp,Gc(rv(Gc(Gc({autoComplete:"off",type:"search"},r),at),{ref:Zu(t,te),onKeyDown:Lo,__staticSelector:"Select",value:xn,placeholder:oe,onChange:cs,"aria-autocomplete":"list","aria-controls":$n?`${r.id}-items`:null,"aria-activedescendant":X>=0?`${r.id}-${X}`:null,onMouseDown:q,onBlur:na,onFocus:Aa,readOnly:!O||Ae,disabled:D,"data-mantine-stop-propagation":$n,name:null,classNames:rv(Gc({},k),{input:Ye({[Fe.input]:!O},k==null?void 0:k.input)})}),Tj({theme:jt,rightSection:J,rightSectionWidth:z,styles:P,size:r.size,shouldClear:I&&!!un,onClear:En,error:o.error,clearButtonProps:ye,disabled:D,readOnly:Ae}))))),L.createElement(ai.Dropdown,{component:W||Yh,maxHeight:E,direction:Ne,id:r.id,innerRef:kn,__staticSelector:"Select",classNames:k,styles:P},L.createElement(sy,{data:dn,hovered:X,classNames:k,styles:P,isItemSelected:Z=>Z===ut,uuid:r.id,__staticSelector:"Select",onItemHover:we,onItemSelect:is,itemsRefs:he,itemComponent:h,size:r.size,nothingFound:R,creatable:Yn&&!!Re,createLabel:Re,"aria-label":o.label,unstyled:C,variant:r.variant}))))});$j.displayName="@mantine/core/Select";const Lj=()=>{const[e,t,n,r,o,s,i,u,d,f,h,m,v,y,S,w,C,k,P,j,E,O,I,R,T,D,$,A,J,z,B,G,K,N,V,W,U,re]=tl("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:i,base400:u,base450:d,base500:f,base550:h,base600:m,base650:v,base700:y,base750:S,base800:w,base850:C,base900:k,base950:P,accent50:j,accent100:E,accent150:O,accent200:I,accent250:R,accent300:T,accent350:D,accent400:$,accent450:A,accent500:J,accent550:z,accent600:B,accent650:G,accent700:K,accent750:N,accent800:V,accent850:W,accent900:U,accent950:re}},DK=e=>{const{searchable:t=!0,tooltip:n,inputRef:r,onChange:o,...s}=e,i=ne(),{base50:u,base100:d,base200:f,base300:h,base400:m,base500:v,base600:y,base700:S,base800:w,base900:C,accent200:k,accent300:P,accent400:j,accent500:E,accent600:O}=Lj(),{colorMode:I}=So(),[R,T]=p.useState(""),D=p.useCallback(z=>{z.shiftKey&&i(rs(!0))},[i]),$=p.useCallback(z=>{z.shiftKey||i(rs(!1))},[i]),A=p.useCallback(z=>{T(""),o&&o(z)},[o]),[J]=tl("shadows",["dark-lg"]);return a.jsx(qn,{label:n,placement:"top",hasArrow:!0,children:a.jsx($j,{ref:r,searchValue:R,onSearchChange:T,onChange:A,onKeyDown:D,onKeyUp:$,searchable:t,maxDropdownHeight:300,styles:()=>({label:{color:Te(S,h)(I),fontWeight:"normal"},input:{backgroundColor:Te(u,C)(I),borderWidth:"2px",borderColor:Te(f,w)(I),color:Te(C,d)(I),paddingRight:24,fontWeight:600,"&:hover":{borderColor:Te(h,y)(I)},"&:focus":{borderColor:Te(P,O)(I)},"&:is(:focus, :hover)":{borderColor:Te(m,v)(I)},"&:focus-within":{borderColor:Te(k,O)(I)},"&[data-disabled]":{backgroundColor:Te(h,S)(I),color:Te(y,m)(I),cursor:"not-allowed"}},value:{backgroundColor:Te(d,C)(I),color:Te(C,d)(I),button:{color:Te(C,d)(I)},"&:hover":{backgroundColor:Te(h,S)(I),cursor:"pointer"}},dropdown:{backgroundColor:Te(f,w)(I),borderColor:Te(f,w)(I),boxShadow:J},item:{backgroundColor:Te(f,w)(I),color:Te(w,f)(I),padding:6,"&[data-hovered]":{color:Te(C,d)(I),backgroundColor:Te(h,S)(I)},"&[data-active]":{backgroundColor:Te(h,S)(I),"&:hover":{color:Te(C,d)(I),backgroundColor:Te(h,S)(I)}},"&[data-selected]":{backgroundColor:Te(j,O)(I),color:Te(u,d)(I),fontWeight:600,"&:hover":{backgroundColor:Te(E,E)(I),color:Te("white",u)(I)}},"&[data-disabled]":{color:Te(v,y)(I),cursor:"not-allowed"}},rightSection:{width:32,button:{color:Te(C,d)(I)}}}),...s})})},Kn=p.memo(DK);function AK(){const e=F(o=>o.postprocessing.facetoolType),t=ne(),{t:n}=pe(),r=o=>t(s8(o));return a.jsx(Kn,{label:n("parameters.type"),data:o8.concat(),value:e,onChange:r})}function NK(){const e=F(o=>o.system.isGFPGANAvailable),t=F(o=>o.postprocessing.facetoolStrength),{t:n}=pe(),r=ne();return a.jsx(vt,{isDisabled:!e,label:n("parameters.strength"),step:.05,min:0,max:1,onChange:o=>r(zx(o)),handleReset:()=>r(zx(.75)),value:t,withReset:!0,withSliderMarks:!0,withInput:!0})}function zK(){const e=F(o=>o.system.isGFPGANAvailable),t=F(o=>o.postprocessing.codeformerFidelity),{t:n}=pe(),r=ne();return a.jsx(vt,{isDisabled:!e,label:n("parameters.codeformerFidelity"),step:.05,min:0,max:1,onChange:o=>r($x(o)),handleReset:()=>r($x(1)),value:t,withReset:!0,withSliderMarks:!0,withInput:!0})}const $K=()=>{const e=F(t=>t.postprocessing.facetoolType);return a.jsxs(jr,{gap:2,alignItems:"stretch",children:[a.jsx(AK,{}),a.jsx(NK,{}),e==="codeformer"&&a.jsx(zK,{})]})};function LK(){const e=F(o=>o.system.isESRGANAvailable),t=F(o=>o.postprocessing.upscalingDenoising),{t:n}=pe(),r=ne();return a.jsx(vt,{label:n("parameters.denoisingStrength"),value:t,min:0,max:1,step:.01,onChange:o=>{r(Lx(o))},handleReset:()=>r(Lx(.75)),withSliderMarks:!0,withInput:!0,withReset:!0,isDisabled:!e})}function FK(){const e=F(o=>o.system.isESRGANAvailable),t=F(o=>o.postprocessing.upscalingStrength),{t:n}=pe(),r=ne();return a.jsx(vt,{label:`${n("parameters.upscale")} ${n("parameters.strength")}`,value:t,min:0,max:1,step:.05,onChange:o=>r(Fx(o)),handleReset:()=>r(Fx(.75)),withSliderMarks:!0,withInput:!0,withReset:!0,isDisabled:!e})}function BK(){const e=F(s=>s.system.isESRGANAvailable),t=F(s=>s.postprocessing.upscalingLevel),{t:n}=pe(),r=ne(),o=s=>r(i8(Number(s)));return a.jsx(Kn,{disabled:!e,label:n("parameters.scale"),value:String(t),onChange:o,data:a8})}const HK=()=>a.jsxs(jr,{gap:2,alignItems:"stretch",children:[a.jsx(BK,{}),a.jsx(LK,{}),a.jsx(FK,{})]});function WK(e,t,n){var r=this,o=p.useRef(null),s=p.useRef(0),i=p.useRef(null),u=p.useRef([]),d=p.useRef(),f=p.useRef(),h=p.useRef(e),m=p.useRef(!0);p.useEffect(function(){h.current=e},[e]);var v=!t&&t!==0&&typeof window<"u";if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var y=!!(n=n||{}).leading,S=!("trailing"in n)||!!n.trailing,w="maxWait"in n,C=w?Math.max(+n.maxWait||0,t):null;p.useEffect(function(){return m.current=!0,function(){m.current=!1}},[]);var k=p.useMemo(function(){var P=function(T){var D=u.current,$=d.current;return u.current=d.current=null,s.current=T,f.current=h.current.apply($,D)},j=function(T,D){v&&cancelAnimationFrame(i.current),i.current=v?requestAnimationFrame(T):setTimeout(T,D)},E=function(T){if(!m.current)return!1;var D=T-o.current;return!o.current||D>=t||D<0||w&&T-s.current>=C},O=function(T){return i.current=null,S&&u.current?P(T):(u.current=d.current=null,f.current)},I=function T(){var D=Date.now();if(E(D))return O(D);if(m.current){var $=t-(D-o.current),A=w?Math.min($,C-(D-s.current)):$;j(T,A)}},R=function(){var T=Date.now(),D=E(T);if(u.current=[].slice.call(arguments),d.current=r,o.current=T,D){if(!i.current&&m.current)return s.current=o.current,j(I,t),y?P(o.current):f.current;if(w)return j(I,t),P(o.current)}return i.current||j(I,t),f.current};return R.cancel=function(){i.current&&(v?cancelAnimationFrame(i.current):clearTimeout(i.current)),s.current=0,u.current=o.current=d.current=i.current=null},R.isPending=function(){return!!i.current},R.flush=function(){return i.current?O(Date.now()):f.current},R},[y,w,t,C,S,v]);return k}function VK(e,t){return e===t}function NC(e){return typeof e=="function"?function(){return e}:e}function Fj(e,t,n){var r,o,s=n&&n.equalityFn||VK,i=(r=p.useState(NC(e)),o=r[1],[r[0],p.useCallback(function(m){return o(NC(m))},[])]),u=i[0],d=i[1],f=WK(p.useCallback(function(m){return d(m)},[d]),t,n),h=p.useRef(e);return s(h.current,e)||(f(e),h.current=e),[u,f]}const UK=Ce([rn,Sr],({gallery:e,system:t,postprocessing:n,ui:r,lightbox:o},s)=>{const{isProcessing:i,isConnected:u,isGFPGANAvailable:d,isESRGANAvailable:f,shouldConfirmOnDelete:h,progressImage:m}=t,{upscalingLevel:v,facetoolStrength:y}=n,{isLightboxOpen:S}=o,{shouldShowImageDetails:w,shouldHidePreview:C,shouldShowProgressInViewer:k}=r,P=e.selection[e.selection.length-1];return{canDeleteImage:u&&!i,shouldConfirmOnDelete:h,isProcessing:i,isConnected:u,isGFPGANAvailable:d,isESRGANAvailable:f,upscalingLevel:v,facetoolStrength:y,shouldDisableToolbarButtons:!!m||!P,shouldShowImageDetails:w,activeTabName:s,isLightboxOpen:S,shouldHidePreview:C,shouldShowProgressInViewer:k,lastSelectedImage:P}},{memoizeOptions:{resultEqualityCheck:Wt}}),Bj=e=>{const t=ne(),{isProcessing:n,isConnected:r,isGFPGANAvailable:o,isESRGANAvailable:s,upscalingLevel:i,facetoolStrength:u,shouldDisableToolbarButtons:d,shouldShowImageDetails:f,isLightboxOpen:h,activeTabName:m,shouldHidePreview:v,lastSelectedImage:y,shouldShowProgressInViewer:S}=F(UK),w=Gn("lightbox").isFeatureEnabled,C=Gn("unifiedCanvas").isFeatureEnabled,k=Gn("upscaling").isFeatureEnabled,P=Gn("faceRestore").isFeatureEnabled,j=Mu(),{t:E}=pe(),{recallBothPrompts:O,recallSeed:I,recallAllParameters:R}=Z1(),[T,D]=Fj(y,500),{currentData:$,isFetching:A}=Ks(y??Do.skipToken),{currentData:J}=K0(D.isPending()?Do.skipToken:T??Do.skipToken),z=J==null?void 0:J.metadata,B=p.useCallback(()=>{const ue=(()=>{if($)return $.image_url.startsWith("http")?$.image_url:window.location.toString()+$.image_url})();if(!ue){j({title:E("toast.problemCopyingImageLink"),status:"error",duration:2500,isClosable:!0});return}navigator.clipboard.writeText(ue).then(()=>{j({title:E("toast.imageLinkCopied"),status:"success",duration:2500,isClosable:!0})})},[j,E,$]),G=p.useCallback(()=>{R(z)},[z,R]);Ke("a",()=>{},[z,R]);const K=p.useCallback(()=>{I(z==null?void 0:z.seed)},[z==null?void 0:z.seed,I]);Ke("s",K,[$]);const N=p.useCallback(()=>{O(z==null?void 0:z.positive_prompt,z==null?void 0:z.negative_prompt)},[z==null?void 0:z.negative_prompt,z==null?void 0:z.positive_prompt,O]);Ke("p",N,[$]);const V=p.useCallback(()=>{t(h3()),t(Uf($))},[t,$]);Ke("shift+i",V,[$]);const W=p.useCallback(()=>{},[]),U=p.useCallback(()=>{$&&t(fh($))},[t,$]);Ke("Shift+U",()=>{W()},{enabled:()=>!!(k&&s&&!d&&r&&!n&&i)},[k,$,s,d,r,n,i]);const re=p.useCallback(()=>{},[]);Ke("Shift+R",()=>{re()},{enabled:()=>!!(P&&o&&!d&&r&&!n&&u)},[P,$,o,d,r,n,u]);const ve=p.useCallback(()=>t(l8(!f)),[t,f]),le=p.useCallback(()=>{$&&(t(m3()),h&&t(mu(!1)),t(g3($)),t(js()),m!=="unifiedCanvas"&&t(Ti("unifiedCanvas")),j({title:E("toast.sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0}))},[$,h,t,m,j,E]);Ke("i",()=>{$?ve():j({title:E("toast.metadataLoadFailed"),status:"error",duration:2500,isClosable:!0})},[$,f,j]);const se=p.useCallback(()=>{t(w3(!S))},[t,S]),Y=p.useCallback(()=>{t(mu(!h))},[t,h]);return a.jsx(a.Fragment,{children:a.jsxs(H,{sx:{flexWrap:"wrap",justifyContent:"center",alignItems:"center",gap:2},...e,children:[a.jsxs(gr,{isAttached:!0,isDisabled:d,children:[a.jsx(fa,{triggerComponent:a.jsx(je,{"aria-label":`${E("parameters.sendTo")}...`,tooltip:`${E("parameters.sendTo")}...`,isDisabled:!$,icon:a.jsx(s$,{})}),children:a.jsxs(H,{sx:{flexDirection:"column",rowGap:2},children:[a.jsx(Yt,{size:"sm",onClick:V,leftIcon:a.jsx(sp,{}),id:"send-to-img2img",children:E("parameters.sendToImg2Img")}),C&&a.jsx(Yt,{size:"sm",onClick:le,leftIcon:a.jsx(sp,{}),id:"send-to-canvas",children:E("parameters.sendToUnifiedCanvas")}),a.jsx(Yt,{size:"sm",onClick:B,leftIcon:a.jsx(bc,{}),children:E("parameters.copyImageToLink")}),a.jsx(zi,{download:!0,href:$==null?void 0:$.image_url,target:"_blank",children:a.jsx(Yt,{leftIcon:a.jsx(O1,{}),size:"sm",w:"100%",children:E("parameters.downloadImage")})})]})}),w&&a.jsx(je,{icon:a.jsx(R1,{}),tooltip:h?`${E("parameters.closeViewer")} (Z)`:`${E("parameters.openInViewer")} (Z)`,"aria-label":h?`${E("parameters.closeViewer")} (Z)`:`${E("parameters.openInViewer")} (Z)`,isChecked:h,onClick:Y,isDisabled:d})]}),a.jsxs(gr,{isAttached:!0,isDisabled:d,children:[a.jsx(je,{icon:a.jsx(e$,{}),tooltip:`${E("parameters.usePrompt")} (P)`,"aria-label":`${E("parameters.usePrompt")} (P)`,isDisabled:!(z!=null&&z.positive_prompt),onClick:N}),a.jsx(je,{icon:a.jsx(r$,{}),tooltip:`${E("parameters.useSeed")} (S)`,"aria-label":`${E("parameters.useSeed")} (S)`,isDisabled:!(z!=null&&z.seed),onClick:K}),a.jsx(je,{icon:a.jsx(Az,{}),tooltip:`${E("parameters.useAll")} (A)`,"aria-label":`${E("parameters.useAll")} (A)`,isDisabled:!z,onClick:G})]}),(k||P)&&a.jsxs(gr,{isAttached:!0,isDisabled:d,children:[P&&a.jsx(fa,{triggerComponent:a.jsx(je,{icon:a.jsx(Uz,{}),"aria-label":E("parameters.restoreFaces")}),children:a.jsxs(H,{sx:{flexDirection:"column",rowGap:4},children:[a.jsx($K,{}),a.jsx(Yt,{isDisabled:!o||!$||!(r&&!n)||!u,onClick:re,children:E("parameters.restoreFaces")})]})}),k&&a.jsx(fa,{triggerComponent:a.jsx(je,{icon:a.jsx(Bz,{}),"aria-label":E("parameters.upscale")}),children:a.jsxs(H,{sx:{flexDirection:"column",gap:4},children:[a.jsx(HK,{}),a.jsx(Yt,{isDisabled:!s||!$||!(r&&!n)||!i,onClick:W,children:E("parameters.upscaleImage")})]})})]}),a.jsx(gr,{isAttached:!0,isDisabled:d,children:a.jsx(je,{icon:a.jsx(I1,{}),tooltip:`${E("parameters.info")} (I)`,"aria-label":`${E("parameters.info")} (I)`,isChecked:f,onClick:ve})}),a.jsx(gr,{isAttached:!0,children:a.jsx(je,{"aria-label":E("settings.displayInProgress"),tooltip:E("settings.displayInProgress"),icon:a.jsx(Gz,{}),isChecked:S,onClick:se})}),a.jsx(gr,{isAttached:!0,children:a.jsx(wB,{onClick:U,isDisabled:d})})]})})},hs=({label:e,value:t,onClick:n,isLink:r,labelPosition:o,withCopy:s=!1})=>{const{t:i}=pe();return t?a.jsxs(H,{gap:2,children:[n&&a.jsx(qn,{label:`Recall ${e}`,children:a.jsx(ri,{"aria-label":i("accessibility.useThisParameter"),icon:a.jsx(Nf,{}),size:"xs",variant:"ghost",fontSize:20,onClick:n})}),s&&a.jsx(qn,{label:`Copy ${e}`,children:a.jsx(ri,{"aria-label":`Copy ${e}`,icon:a.jsx(bc,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(t.toString())})}),a.jsxs(H,{direction:o?"column":"row",children:[a.jsxs(Ue,{fontWeight:"semibold",whiteSpace:"pre-wrap",pr:2,children:[e,":"]}),r?a.jsxs(zi,{href:t.toString(),isExternal:!0,wordBreak:"break-all",children:[t.toString()," ",a.jsx(A1,{mx:"2px"})]}):a.jsx(Ue,{overflowY:"scroll",wordBreak:"break-all",children:t.toString()})]})]}):null},GK=e=>{const{metadata:t}=e,{recallBothPrompts:n,recallPositivePrompt:r,recallNegativePrompt:o,recallSeed:s,recallInitialImage:i,recallCfgScale:u,recallModel:d,recallScheduler:f,recallSteps:h,recallWidth:m,recallHeight:v,recallStrength:y,recallAllParameters:S}=Z1(),w=p.useCallback(()=>{r(t==null?void 0:t.positive_prompt)},[t==null?void 0:t.positive_prompt,r]),C=p.useCallback(()=>{o(t==null?void 0:t.negative_prompt)},[t==null?void 0:t.negative_prompt,o]),k=p.useCallback(()=>{s(t==null?void 0:t.seed)},[t==null?void 0:t.seed,s]),P=p.useCallback(()=>{d(t==null?void 0:t.model)},[t==null?void 0:t.model,d]),j=p.useCallback(()=>{m(t==null?void 0:t.width)},[t==null?void 0:t.width,m]),E=p.useCallback(()=>{v(t==null?void 0:t.height)},[t==null?void 0:t.height,v]),O=p.useCallback(()=>{f(t==null?void 0:t.scheduler)},[t==null?void 0:t.scheduler,f]),I=p.useCallback(()=>{h(t==null?void 0:t.steps)},[t==null?void 0:t.steps,h]),R=p.useCallback(()=>{u(t==null?void 0:t.cfg_scale)},[t==null?void 0:t.cfg_scale,u]),T=p.useCallback(()=>{y(t==null?void 0:t.strength)},[t==null?void 0:t.strength,y]);return!t||Object.keys(t).length===0?null:a.jsxs(a.Fragment,{children:[t.generation_mode&&a.jsx(hs,{label:"Generation Mode",value:t.generation_mode}),t.positive_prompt&&a.jsx(hs,{label:"Positive Prompt",labelPosition:"top",value:t.positive_prompt,onClick:w}),t.negative_prompt&&a.jsx(hs,{label:"Negative Prompt",labelPosition:"top",value:t.negative_prompt,onClick:C}),t.seed!==void 0&&a.jsx(hs,{label:"Seed",value:t.seed,onClick:k}),t.model!==void 0&&a.jsx(hs,{label:"Model",value:t.model.model_name,onClick:P}),t.width&&a.jsx(hs,{label:"Width",value:t.width,onClick:j}),t.height&&a.jsx(hs,{label:"Height",value:t.height,onClick:E}),t.scheduler&&a.jsx(hs,{label:"Scheduler",value:t.scheduler,onClick:O}),t.steps&&a.jsx(hs,{label:"Steps",value:t.steps,onClick:I}),t.cfg_scale!==void 0&&a.jsx(hs,{label:"CFG scale",value:t.cfg_scale,onClick:R}),t.strength&&a.jsx(hs,{label:"Image to image strength",value:t.strength,onClick:T})]})},qK=e=>{const{copyTooltip:t,jsonObject:n}=e,r=p.useMemo(()=>JSON.stringify(n,null,2),[n]);return a.jsxs(H,{sx:{borderRadius:"base",bg:"whiteAlpha.500",_dark:{bg:"blackAlpha.500"},flexGrow:1,w:"full",h:"full",position:"relative"},children:[a.jsx(Ge,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"auto",p:4},children:a.jsx(rP,{defer:!0,style:{height:"100%",width:"100%"},options:{scrollbars:{visibility:"auto",autoHide:"move",autoHideDelay:1300,theme:"os-theme-dark"}},children:a.jsx("pre",{children:r})})}),a.jsx(H,{sx:{position:"absolute",top:0,insetInlineEnd:0,p:2},children:a.jsx(qn,{label:t,children:a.jsx(ri,{"aria-label":t,icon:a.jsx(bc,{}),variant:"ghost",onClick:()=>navigator.clipboard.writeText(r)})})})]})},KK=({image:e})=>{const[t,n]=Fj(e.image_name,500),{currentData:r}=K0(n.isPending()?Do.skipToken:t??Do.skipToken),o=r==null?void 0:r.metadata,s=r==null?void 0:r.graph,i=p.useMemo(()=>{const u=[];return o&&u.push({label:"Core Metadata",data:o,copyTooltip:"Copy Core Metadata JSON"}),e&&u.push({label:"Image Details",data:e,copyTooltip:"Copy Image Details JSON"}),s&&u.push({label:"Graph",data:s,copyTooltip:"Copy Graph JSON"}),u},[o,s,e]);return a.jsxs(H,{sx:{padding:4,gap:1,flexDirection:"column",width:"full",height:"full",backdropFilter:"blur(20px)",bg:"baseAlpha.200",_dark:{bg:"blackAlpha.600"},borderRadius:"base",position:"absolute",overflow:"hidden"},children:[a.jsxs(H,{gap:2,children:[a.jsx(Ue,{fontWeight:"semibold",children:"File:"}),a.jsxs(zi,{href:e.image_url,isExternal:!0,maxW:"calc(100% - 3rem)",children:[e.image_name,a.jsx(A1,{mx:"2px"})]})]}),a.jsx(GK,{metadata:o}),a.jsxs(jh,{variant:"line",sx:{display:"flex",flexDir:"column",w:"full",h:"full"},children:[a.jsx(Eh,{children:i.map(u=>a.jsx(Rh,{sx:{borderTopRadius:"base"},children:a.jsx(Ue,{sx:{color:"base.700",_dark:{color:"base.300"}},children:u.label})},u.label))}),a.jsx(Oh,{sx:{w:"full",h:"full"},children:i.map(u=>a.jsx(Ih,{sx:{w:"full",h:"full",p:0,pt:4},children:a.jsx(qK,{jsonObject:u.data,copyTooltip:u.copyTooltip})},u.label))})]})]})},Hj=p.memo(KK),YK=Ce([rn,v3],(e,t)=>{const{total:n,isFetching:r}=e.gallery,o=e.gallery.selection[e.gallery.selection.length-1];if(!o||t.length===0)return{isOnFirstImage:!0,isOnLastImage:!0};const s=t.findIndex(y=>y.image_name===o),i=Ys(s+1,0,t.length-1),u=Ys(s-1,0,t.length-1),d=t[i].image_name,f=t[u].image_name,h=Bx(e,d),m=Bx(e,f),v=t.length;return{isOnFirstImage:s===0,isOnLastImage:!isNaN(s)&&s===v-1,areMoreImagesAvailable:n>v,isFetching:r,nextImage:h,prevImage:m,nextImageId:d,prevImageId:f}},{memoizeOptions:{resultEqualityCheck:Wt}}),Wj=()=>{const e=ne(),{isOnFirstImage:t,isOnLastImage:n,nextImageId:r,prevImageId:o,areMoreImagesAvailable:s,isFetching:i}=F(YK),u=p.useCallback(()=>{o&&e(kv(o))},[e,o]),d=p.useCallback(()=>{r&&e(kv(r))},[e,r]),f=p.useCallback(()=>{e(y3({is_intermediate:!1}))},[e]);return{handlePrevImage:u,handleNextImage:d,isOnFirstImage:t,isOnLastImage:n,nextImageId:r,prevImageId:o,areMoreImagesAvailable:s,handleLoadMoreImages:f,isFetching:i}},zC={height:"100%",width:"15%",alignItems:"center",pointerEvents:"auto"},ov={color:"base.100"},XK=()=>{const{t:e}=pe(),{handlePrevImage:t,handleNextImage:n,isOnFirstImage:r,isOnLastImage:o,handleLoadMoreImages:s,areMoreImagesAvailable:i,isFetching:u}=Wj(),[d,f]=p.useState(!1),h=p.useCallback(()=>{f(!0)},[]),m=p.useCallback(()=>{f(!1)},[]);return a.jsxs(H,{sx:{justifyContent:"space-between",height:"100%",width:"100%",pointerEvents:"none"},children:[a.jsx(xa,{sx:{...zC,justifyContent:"flex-start"},onMouseOver:h,onMouseOut:m,children:d&&!r&&a.jsx(ri,{"aria-label":e("accessibility.previousImage"),icon:a.jsx(Rz,{size:64}),variant:"unstyled",onClick:t,boxSize:16,sx:ov})}),a.jsxs(xa,{sx:{...zC,justifyContent:"flex-end"},onMouseOver:h,onMouseOut:m,children:[d&&!o&&a.jsx(ri,{"aria-label":e("accessibility.nextImage"),icon:a.jsx(Tz,{size:64}),variant:"unstyled",onClick:n,boxSize:16,sx:ov}),d&&o&&i&&!u&&a.jsx(ri,{"aria-label":e("accessibility.loadMore"),icon:a.jsx(Oz,{size:64}),variant:"unstyled",onClick:s,boxSize:16,sx:ov}),d&&o&&i&&u&&a.jsx(H,{sx:{w:16,h:16,alignItems:"center",justifyContent:"center"},children:a.jsx(ui,{opacity:.5,size:"xl"})})]})]})},Vj=p.memo(XK);var es=function(e,t){return Number(e.toFixed(t))},QK=function(e,t){return typeof e=="number"?e:t},er=function(e,t,n){n&&typeof n=="function"&&n(e,t)},ZK=function(e){return-Math.cos(e*Math.PI)/2+.5},JK=function(e){return e},eY=function(e){return e*e},tY=function(e){return e*(2-e)},nY=function(e){return e<.5?2*e*e:-1+(4-2*e)*e},rY=function(e){return e*e*e},oY=function(e){return--e*e*e+1},sY=function(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},aY=function(e){return e*e*e*e},iY=function(e){return 1- --e*e*e*e},lY=function(e){return e<.5?8*e*e*e*e:1-8*--e*e*e*e},cY=function(e){return e*e*e*e*e},uY=function(e){return 1+--e*e*e*e*e},dY=function(e){return e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e},Uj={easeOut:ZK,linear:JK,easeInQuad:eY,easeOutQuad:tY,easeInOutQuad:nY,easeInCubic:rY,easeOutCubic:oY,easeInOutCubic:sY,easeInQuart:aY,easeOutQuart:iY,easeInOutQuart:lY,easeInQuint:cY,easeOutQuint:uY,easeInOutQuint:dY},Gj=function(e){typeof e=="number"&&cancelAnimationFrame(e)},Us=function(e){e.mounted&&(Gj(e.animation),e.animate=!1,e.animation=null,e.velocity=null)};function qj(e,t,n,r){if(e.mounted){var o=new Date().getTime(),s=1;Us(e),e.animation=function(){if(!e.mounted)return Gj(e.animation);var i=new Date().getTime()-o,u=i/n,d=Uj[t],f=d(u);i>=n?(r(s),e.animation=null):e.animation&&(r(f),requestAnimationFrame(e.animation))},requestAnimationFrame(e.animation)}}function fY(e){var t=e.scale,n=e.positionX,r=e.positionY;return!(Number.isNaN(t)||Number.isNaN(n)||Number.isNaN(r))}function pi(e,t,n,r){var o=fY(t);if(!(!e.mounted||!o)){var s=e.setTransformState,i=e.transformState,u=i.scale,d=i.positionX,f=i.positionY,h=t.scale-u,m=t.positionX-d,v=t.positionY-f;n===0?s(t.scale,t.positionX,t.positionY):qj(e,r,n,function(y){var S=u+h*y,w=d+m*y,C=f+v*y;s(S,w,C)})}}function pY(e,t,n){var r=e.offsetWidth,o=e.offsetHeight,s=t.offsetWidth,i=t.offsetHeight,u=s*n,d=i*n,f=r-u,h=o-d;return{wrapperWidth:r,wrapperHeight:o,newContentWidth:u,newDiffWidth:f,newContentHeight:d,newDiffHeight:h}}var hY=function(e,t,n,r,o,s,i){var u=e>t?n*(i?1:.5):0,d=r>o?s*(i?1:.5):0,f=e-t-u,h=u,m=r-o-d,v=d;return{minPositionX:f,maxPositionX:h,minPositionY:m,maxPositionY:v}},gy=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=pY(n,r,t),i=s.wrapperWidth,u=s.wrapperHeight,d=s.newContentWidth,f=s.newDiffWidth,h=s.newContentHeight,m=s.newDiffHeight,v=hY(i,d,f,u,h,m,!!o);return v},b0=function(e,t,n,r){return r?e<t?es(t,2):e>n?es(n,2):es(e,2):es(e,2)},rc=function(e,t){var n=gy(e,t);return e.bounds=n,n};function Zh(e,t,n,r,o,s,i){var u=n.minPositionX,d=n.minPositionY,f=n.maxPositionX,h=n.maxPositionY,m=0,v=0;i&&(m=o,v=s);var y=b0(e,u-m,f+m,r),S=b0(t,d-v,h+v,r);return{x:y,y:S}}function Jh(e,t,n,r,o,s){var i=e.transformState,u=i.scale,d=i.positionX,f=i.positionY,h=r-u;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=Zh(m,v,o,s,0,0,null);return y}function td(e,t,n,r,o){var s=o?r:0,i=t-s;return!Number.isNaN(n)&&e>=n?n:!Number.isNaN(t)&&e<=i?i:e}var $C=function(e,t){var n=e.setup.panning.excluded,r=e.isInitialized,o=e.wrapperComponent,s=t.target,i=o==null?void 0:o.contains(s),u=r&&s&&i;if(!u)return!1;var d=em(s,n);return!d},LC=function(e){var t=e.isInitialized,n=e.isPanning,r=e.setup,o=r.panning.disabled,s=t&&n&&!o;return!!s},mY=function(e,t){var n=e.transformState,r=n.positionX,o=n.positionY;e.isPanning=!0;var s=t.clientX,i=t.clientY;e.startCoords={x:s-r,y:i-o}},gY=function(e,t){var n=t.touches,r=e.transformState,o=r.positionX,s=r.positionY;e.isPanning=!0;var i=n.length===1;if(i){var u=n[0].clientX,d=n[0].clientY;e.startCoords={x:u-o,y:d-s}}};function vY(e){var t=e.transformState,n=t.positionX,r=t.positionY,o=t.scale,s=e.setup,i=s.disabled,u=s.limitToBounds,d=s.centerZoomedOut,f=e.wrapperComponent;if(!(i||!f||!e.bounds)){var h=e.bounds,m=h.maxPositionX,v=h.minPositionX,y=h.maxPositionY,S=h.minPositionY,w=n>m||n<v,C=r>y||r<S,k=n>m?f.offsetWidth:e.setup.minPositionX||0,P=r>y?f.offsetHeight:e.setup.minPositionY||0,j=Jh(e,k,P,o,e.bounds,u||d),E=j.x,O=j.y;return{scale:o,positionX:w?E:n,positionY:C?O:r}}}function yY(e,t,n,r,o){var s=e.setup.limitToBounds,i=e.wrapperComponent,u=e.bounds,d=e.transformState,f=d.scale,h=d.positionX,m=d.positionY;if(!(i===null||u===null||t===h&&n===m)){var v=Zh(t,n,u,s,r,o,i),y=v.x,S=v.y;e.setTransformState(f,y,S)}}var bY=function(e,t,n){var r=e.startCoords,o=e.transformState,s=e.setup.panning,i=s.lockAxisX,u=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=i?d:h,y=u?f:m;return{x:v,y}},th=function(e,t){var n=e.setup,r=e.transformState,o=r.scale,s=n.minScale,i=n.disablePadding;return t>0&&o>=s&&!i?t:0},xY=function(e){var t=e.mounted,n=e.setup,r=n.disabled,o=n.velocityAnimation,s=e.transformState.scale,i=o.disabled,u=!i||s>1||!r||t;return!!u},SY=function(e){var t=e.mounted,n=e.velocity,r=e.bounds,o=e.setup,s=o.disabled,i=o.velocityAnimation,u=e.transformState.scale,d=i.disabled,f=!d||u>1||!s||t;return!(!f||!n||!r)};function wY(e,t){var n=e.setup.velocityAnimation,r=n.equalToMove,o=n.animationTime,s=n.sensitivity;return r?o*t*s:o}function FC(e,t,n,r,o,s,i,u,d,f){if(o){if(t>i&&n>i){var h=i+(e-i)*f;return h>d?d:h<i?i:h}if(t<s&&n<s){var h=s+(e-s)*f;return h<u?u:h>s?s:h}}return r?t:b0(e,s,i,o)}function CY(e,t){var n=1;return t?Math.min(n,e.offsetWidth/window.innerWidth):n}function kY(e,t){var n=xY(e);if(n){var r=e.lastMousePosition,o=e.velocityTime,s=e.setup,i=e.wrapperComponent,u=s.velocityAnimation.equalToMove,d=Date.now();if(r&&o&&i){var f=CY(i,u),h=t.x-r.x,m=t.y-r.y,v=h/f,y=m/f,S=d-o,w=h*h+m*m,C=Math.sqrt(w)/S;e.velocity={velocityX:v,velocityY:y,total:C}}e.lastMousePosition=t,e.velocityTime=d}}function PY(e){var t=e.velocity,n=e.bounds,r=e.setup,o=e.wrapperComponent,s=SY(e);if(!(!s||!t||!n||!o)){var i=t.velocityX,u=t.velocityY,d=t.total,f=n.maxPositionX,h=n.minPositionX,m=n.maxPositionY,v=n.minPositionY,y=r.limitToBounds,S=r.alignmentAnimation,w=r.zoomAnimation,C=r.panning,k=C.lockAxisY,P=C.lockAxisX,j=w.animationType,E=S.sizeX,O=S.sizeY,I=S.velocityAlignmentTime,R=I,T=wY(e,d),D=Math.max(T,R),$=th(e,E),A=th(e,O),J=$*o.offsetWidth/100,z=A*o.offsetHeight/100,B=f+J,G=h-J,K=m+z,N=v-z,V=e.transformState,W=new Date().getTime();qj(e,j,D,function(U){var re=e.transformState,ve=re.scale,le=re.positionX,se=re.positionY,Y=new Date().getTime()-W,ae=Y/R,ue=Uj[S.animationType],xe=1-ue(Math.min(1,ae)),oe=1-U,ge=le+i*oe,fe=se+u*oe,Pe=FC(ge,V.positionX,le,P,y,h,f,G,B,xe),Ae=FC(fe,V.positionY,se,k,y,v,m,N,K,xe);(le!==ge||se!==fe)&&e.setTransformState(ve,Pe,Ae)})}}function BC(e,t){var n=e.transformState.scale;Us(e),rc(e,n),window.TouchEvent!==void 0&&t instanceof TouchEvent?gY(e,t):mY(e,t)}function Kj(e){var t=e.transformState.scale,n=e.setup,r=n.minScale,o=n.alignmentAnimation,s=o.disabled,i=o.sizeX,u=o.sizeY,d=o.animationTime,f=o.animationType,h=s||t<r||!i&&!u;if(!h){var m=vY(e);m&&pi(e,m,d,f)}}function HC(e,t,n){var r=e.startCoords,o=e.setup,s=o.alignmentAnimation,i=s.sizeX,u=s.sizeY;if(r){var d=bY(e,t,n),f=d.x,h=d.y,m=th(e,i),v=th(e,u);kY(e,{x:f,y:h}),yY(e,f,h,m,v)}}function _Y(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(),i=o==null?void 0:o.getBoundingClientRect(),u=(s==null?void 0:s.width)||0,d=(s==null?void 0:s.height)||0,f=(i==null?void 0:i.width)||0,h=(i==null?void 0:i.height)||0,m=u<f||d<h,v=!t&&n&&(n==null?void 0:n.total)>.1&&m;v?PY(e):Kj(e)}}function vy(e,t,n,r){var o=e.setup,s=o.minScale,i=o.maxScale,u=o.limitToBounds,d=td(es(t,2),s,i,0,!1),f=rc(e,d),h=Jh(e,n,r,d,f,u),m=h.x,v=h.y;return{scale:d,positionX:m,positionY:v}}function Yj(e,t,n){var r=e.transformState.scale,o=e.wrapperComponent,s=e.setup,i=s.minScale,u=s.limitToBounds,d=s.zoomAnimation,f=d.disabled,h=d.animationTime,m=d.animationType,v=f||r>=i;if((r>=1||u)&&Kj(e),!(v||!o||!e.mounted)){var y=t||o.offsetWidth/2,S=n||o.offsetHeight/2,w=vy(e,i,y,S);w&&pi(e,w,h,m)}}var ii=function(){return ii=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},ii.apply(this,arguments)};function WC(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 Pf={previousScale:1,scale:1,positionX:0,positionY:0},qc={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}},Xj=function(e){var t,n,r,o;return{previousScale:(t=e.initialScale)!==null&&t!==void 0?t:Pf.scale,scale:(n=e.initialScale)!==null&&n!==void 0?n:Pf.scale,positionX:(r=e.initialPositionX)!==null&&r!==void 0?r:Pf.positionX,positionY:(o=e.initialPositionY)!==null&&o!==void 0?o:Pf.positionY}},VC=function(e){var t=ii({},qc);return Object.keys(e).forEach(function(n){var r=typeof e[n]<"u",o=typeof qc[n]<"u";if(o&&r){var s=Object.prototype.toString.call(qc[n]),i=s==="[object Object]",u=s==="[object Array]";i?t[n]=ii(ii({},qc[n]),e[n]):u?t[n]=WC(WC([],qc[n],!0),e[n],!0):t[n]=e[n]}}),t},Qj=function(e,t,n){var r=e.transformState.scale,o=e.wrapperComponent,s=e.setup,i=s.maxScale,u=s.minScale,d=s.zoomAnimation,f=d.size;if(!o)throw new Error("Wrapper is not mounted");var h=r+t*n,m=td(es(h,3),u,i,f,!1);return m};function Zj(e,t,n,r,o){var s=e.wrapperComponent,i=e.transformState,u=i.scale,d=i.positionX,f=i.positionY;if(!s)return console.error("No WrapperComponent found");var h=s.offsetWidth,m=s.offsetHeight,v=(h/2-d)/u,y=(m/2-f)/u,S=Qj(e,t,n),w=vy(e,S,v,y);if(!w)return console.error("Error during zoom event. New transformation state was not calculated.");pi(e,w,r,o)}function Jj(e,t,n,r){var o=e.setup,s=e.wrapperComponent,i=o.limitToBounds,u=Xj(e.props),d=e.transformState,f=d.scale,h=d.positionX,m=d.positionY;if(s){var v=gy(e,u.scale),y=Zh(u.positionX,u.positionY,v,i,0,0,s),S={scale:u.scale,positionX:y.x,positionY:y.y};f===u.scale&&h===u.positionX&&m===u.positionY||(r==null||r(),pi(e,S,t,n))}}function jY(e,t,n,r){var o=e.getBoundingClientRect(),s=t.getBoundingClientRect(),i=n.getBoundingClientRect(),u=s.x*r.scale,d=s.y*r.scale;return{x:(o.x-i.x+u)/r.scale,y:(o.y-i.y+d)/r.scale}}function EY(e,t,n){var r=e.wrapperComponent,o=e.contentComponent,s=e.transformState,i=e.setup,u=i.limitToBounds,d=i.minScale,f=i.maxScale;if(!r||!o)return s;var h=r.getBoundingClientRect(),m=t.getBoundingClientRect(),v=jY(t,r,o,s),y=v.x,S=v.y,w=m.width/s.scale,C=m.height/s.scale,k=r.offsetWidth/w,P=r.offsetHeight/C,j=td(n||Math.min(k,P),d,f,0,!1),E=(h.width-w*j)/2,O=(h.height-C*j)/2,I=(h.left-y)*j+E,R=(h.top-S)*j+O,T=gy(e,j),D=Zh(I,R,T,u,0,0,r),$=D.x,A=D.y;return{positionX:$,positionY:A,scale:j}}var IY=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),Zj(e,1,t,n,r)}},OY=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),Zj(e,-1,t,n,r)}},RY=function(e){return function(t,n,r,o,s){o===void 0&&(o=300),s===void 0&&(s="easeOut");var i=e.transformState,u=i.positionX,d=i.positionY,f=i.scale,h=e.wrapperComponent,m=e.contentComponent,v=e.setup.disabled;if(!(v||!h||!m)){var y={positionX:Number.isNaN(t)?u:t,positionY:Number.isNaN(n)?d:n,scale:Number.isNaN(r)?f:r};pi(e,y,o,s)}}},TY=function(e){return function(t,n){t===void 0&&(t=200),n===void 0&&(n="easeOut"),Jj(e,t,n)}},MY=function(e){return function(t,n,r){n===void 0&&(n=200),r===void 0&&(r="easeOut");var o=e.transformState,s=e.wrapperComponent,i=e.contentComponent;if(s&&i){var u=eE(t||o.scale,s,i);pi(e,u,n,r)}}},DY=function(e){return function(t,n,r,o){r===void 0&&(r=600),o===void 0&&(o="easeOut"),Us(e);var s=e.wrapperComponent,i=typeof t=="string"?document.getElementById(t):t;if(s&&i&&s.contains(i)){var u=EY(e,i,n);pi(e,u,r,o)}}},x0=function(e){return{instance:e,zoomIn:IY(e),zoomOut:OY(e),setTransform:RY(e),resetTransform:TY(e),centerView:MY(e),zoomToElement:DY(e)}},AY=function(e){return{instance:e,state:e.transformState}},Nn=function(e){var t={};return Object.assign(t,AY(e)),Object.assign(t,x0(e)),t},sv=!1;function av(){try{var e={get passive(){return sv=!0,!1}};return e}catch{return sv=!1,sv}}var em=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},S0=function(e){e&&clearTimeout(e)},NY=function(e,t,n){return"translate(".concat(e,"px, ").concat(t,"px) scale(").concat(n,")")},eE=function(e,t,n){var r=n.offsetWidth*e,o=n.offsetHeight*e,s=(t.offsetWidth-r)/2,i=(t.offsetHeight-o)/2;return{scale:e,positionX:s,positionY:i}};function zY(e){return function(t){e.forEach(function(n){typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var $Y=function(e,t){var n=e.setup.wheel,r=n.disabled,o=n.wheelDisabled,s=n.touchPadDisabled,i=n.excluded,u=e.isInitialized,d=e.isPanning,f=t.target,h=u&&!d&&!r&&f;if(!h||o&&!t.ctrlKey||s&&t.ctrlKey)return!1;var m=em(f,i);return!m},LY=function(e){return e?e.deltaY<0?1:-1:0};function FY(e,t){var n=LY(e),r=QK(t,n);return r}function tE(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 i=e.touches[0];o=(i.clientX-r.left)/n,s=(i.clientY-r.top)/n}return(Number.isNaN(o)||Number.isNaN(s))&&console.error("No mouse or touch offset found"),{x:o,y:s}}var BY=function(e,t,n,r,o){var s=e.transformState.scale,i=e.wrapperComponent,u=e.setup,d=u.maxScale,f=u.minScale,h=u.zoomAnimation,m=u.disablePadding,v=h.size,y=h.disabled;if(!i)throw new Error("Wrapper is not mounted");var S=s+t*n;if(o)return S;var w=r?!1:!y,C=td(es(S,3),f,d,v,w&&!m);return C},HY=function(e,t){var n=e.previousWheelEvent,r=e.transformState.scale,o=e.setup,s=o.maxScale,i=o.minScale;return n?r<s||r>i||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},WY=function(e,t){var n=e.setup.pinch,r=n.disabled,o=n.excluded,s=e.isInitialized,i=t.target,u=s&&!r&&i;if(!u)return!1;var d=em(i,o);return!d},VY=function(e){var t=e.setup.pinch.disabled,n=e.isInitialized,r=e.pinchStartDistance,o=n&&!t&&r;return!!o},UY=function(e,t,n){var r=n.getBoundingClientRect(),o=e.touches,s=es(o[0].clientX-r.left,5),i=es(o[0].clientY-r.top,5),u=es(o[1].clientX-r.left,5),d=es(o[1].clientY-r.top,5);return{x:(s+u)/2/t,y:(i+d)/2/t}},nE=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))},GY=function(e,t){var n=e.pinchStartScale,r=e.pinchStartDistance,o=e.setup,s=o.maxScale,i=o.minScale,u=o.zoomAnimation,d=o.disablePadding,f=u.size,h=u.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 td(es(v,2),i,s,f,!h&&!d)},qY=160,KY=100,YY=function(e,t){var n=e.props,r=n.onWheelStart,o=n.onZoomStart;e.wheelStopEventTimer||(Us(e),er(Nn(e),t,r),er(Nn(e),t,o))},XY=function(e,t){var n=e.props,r=n.onWheel,o=n.onZoom,s=e.contentComponent,i=e.setup,u=e.transformState,d=u.scale,f=i.limitToBounds,h=i.centerZoomedOut,m=i.zoomAnimation,v=i.wheel,y=i.disablePadding,S=m.size,w=m.disabled,C=v.step;if(!s)throw new Error("Component not mounted");t.preventDefault(),t.stopPropagation();var k=FY(t,null),P=BY(e,k,C,!t.ctrlKey);if(d!==P){var j=rc(e,P),E=tE(t,s,d),O=w||S===0||h||y,I=f&&O,R=Jh(e,E.x,E.y,P,j,I),T=R.x,D=R.y;e.previousWheelEvent=t,e.setTransformState(P,T,D),er(Nn(e),t,r),er(Nn(e),t,o)}},QY=function(e,t){var n=e.props,r=n.onWheelStop,o=n.onZoomStop;S0(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout(function(){e.mounted&&(Yj(e,t.x,t.y),e.wheelAnimationTimer=null)},KY);var s=HY(e,t);s&&(S0(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout(function(){e.mounted&&(e.wheelStopEventTimer=null,er(Nn(e),t,r),er(Nn(e),t,o))},qY))},ZY=function(e,t){var n=nE(t);e.pinchStartDistance=n,e.lastDistance=n,e.pinchStartScale=e.transformState.scale,e.isPanning=!1,Us(e)},JY=function(e,t){var n=e.contentComponent,r=e.pinchStartDistance,o=e.transformState.scale,s=e.setup,i=s.limitToBounds,u=s.centerZoomedOut,d=s.zoomAnimation,f=d.disabled,h=d.size;if(!(r===null||!n)){var m=UY(t,o,n);if(!(!Number.isFinite(m.x)||!Number.isFinite(m.y))){var v=nE(t),y=GY(e,v);if(y!==o){var S=rc(e,y),w=f||h===0||u,C=i&&w,k=Jh(e,m.x,m.y,y,S,C),P=k.x,j=k.y;e.pinchMidpoint=m,e.lastDistance=v,e.setTransformState(y,P,j)}}}},eX=function(e){var t=e.pinchMidpoint;e.velocity=null,e.lastDistance=null,e.pinchMidpoint=null,e.pinchStartScale=null,e.pinchStartDistance=null,Yj(e,t==null?void 0:t.x,t==null?void 0:t.y)},rE=function(e,t){var n=e.props.onZoomStop,r=e.setup.doubleClick.animationTime;S0(e.doubleClickStopEventTimer),e.doubleClickStopEventTimer=setTimeout(function(){e.doubleClickStopEventTimer=null,er(Nn(e),t,n)},r)},tX=function(e,t){var n=e.props,r=n.onZoomStart,o=n.onZoom,s=e.setup.doubleClick,i=s.animationTime,u=s.animationType;er(Nn(e),t,r),Jj(e,i,u,function(){return er(Nn(e),t,o)}),rE(e,t)};function nX(e,t){var n=e.setup,r=e.doubleClickStopEventTimer,o=e.transformState,s=e.contentComponent,i=o.scale,u=e.props,d=u.onZoomStart,f=u.onZoom,h=n.doubleClick,m=h.disabled,v=h.mode,y=h.step,S=h.animationTime,w=h.animationType;if(!m&&!r){if(v==="reset")return tX(e,t);if(!s)return console.error("No ContentComponent found");var C=v==="zoomOut"?-1:1,k=Qj(e,C,y);if(i!==k){er(Nn(e),t,d);var P=tE(t,s,i),j=vy(e,k,P.x,P.y);if(!j)return console.error("Error during zoom event. New transformation state was not calculated.");er(Nn(e),t,f),pi(e,j,S,w),rE(e,t)}}}var rX=function(e,t){var n=e.isInitialized,r=e.setup,o=e.wrapperComponent,s=r.doubleClick,i=s.disabled,u=s.excluded,d=t.target,f=o==null?void 0:o.contains(d),h=n&&d&&f&&!i;if(!h)return!1;var m=em(d,u);return!m},oX=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){rc(n,n.transformState.scale),n.setup=VC(r)},this.initializeWindowEvents=function(){var r,o=av(),s=(r=n.wrapperComponent)===null||r===void 0?void 0:r.ownerDocument,i=s==null?void 0:s.defaultView;i==null||i.addEventListener("mousedown",n.onPanningStart,o),i==null||i.addEventListener("mousemove",n.onPanning,o),i==null||i.addEventListener("mouseup",n.onPanningStop,o),s==null||s.addEventListener("mouseleave",n.clearPanning,o),i==null||i.addEventListener("keyup",n.setKeyUnPressed,o),i==null||i.addEventListener("keydown",n.setKeyPressed,o)},this.cleanupWindowEvents=function(){var r,o,s=av(),i=(r=n.wrapperComponent)===null||r===void 0?void 0:r.ownerDocument,u=i==null?void 0:i.defaultView;u==null||u.removeEventListener("mousedown",n.onPanningStart,s),u==null||u.removeEventListener("mousemove",n.onPanning,s),u==null||u.removeEventListener("mouseup",n.onPanningStop,s),i==null||i.removeEventListener("mouseleave",n.clearPanning,s),u==null||u.removeEventListener("keyup",n.setKeyUnPressed,s),u==null||u.removeEventListener("keydown",n.setKeyPressed,s),document.removeEventListener("mouseleave",n.clearPanning,s),Us(n),(o=n.observer)===null||o===void 0||o.disconnect()},this.handleInitializeWrapperEvents=function(r){var o=av();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(Nn(n))}),o&&(n.setCenter(),n.observer=new ResizeObserver(function(){var s;n.onInitCallbacks.forEach(function(i){return i(Nn(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=$Y(n,r);if(s){var i=n.isPressingKeys(n.setup.wheel.activationKeys);i&&(YY(n,r),XY(n,r),QY(n,r))}}},this.onPanningStart=function(r){var o=n.setup.disabled,s=n.props.onPanningStart;if(!o){var i=$C(n,r);if(i){var u=n.isPressingKeys(n.setup.panning.activationKeys);u&&(r.preventDefault(),r.stopPropagation(),Us(n),BC(n,r),er(Nn(n),r,s))}}},this.onPanning=function(r){var o=n.setup.disabled,s=n.props.onPanning;if(!o){var i=LC(n);if(i){var u=n.isPressingKeys(n.setup.panning.activationKeys);u&&(r.preventDefault(),r.stopPropagation(),HC(n,r.clientX,r.clientY),er(Nn(n),r,s))}}},this.onPanningStop=function(r){var o=n.props.onPanningStop;n.isPanning&&(_Y(n),er(Nn(n),r,o))},this.onPinchStart=function(r){var o=n.setup.disabled,s=n.props,i=s.onPinchingStart,u=s.onZoomStart;if(!o){var d=WY(n,r);d&&(ZY(n,r),Us(n),er(Nn(n),r,i),er(Nn(n),r,u))}},this.onPinch=function(r){var o=n.setup.disabled,s=n.props,i=s.onPinching,u=s.onZoom;if(!o){var d=VY(n);d&&(r.preventDefault(),r.stopPropagation(),JY(n,r),er(Nn(n),r,i),er(Nn(n),r,u))}},this.onPinchStop=function(r){var o=n.props,s=o.onPinchingStop,i=o.onZoomStop;n.pinchStartScale&&(eX(n),er(Nn(n),r,s),er(Nn(n),r,i))},this.onTouchPanningStart=function(r){var o=n.setup.disabled,s=n.props.onPanningStart;if(!o){var i=$C(n,r);if(i){var u=n.lastTouch&&+new Date-n.lastTouch<200;if(u&&r.touches.length===1)n.onDoubleClick(r);else{n.lastTouch=+new Date,Us(n);var d=r.touches,f=d.length===1,h=d.length===2;f&&(Us(n),BC(n,r),er(Nn(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 i=LC(n);if(!i)return;r.preventDefault(),r.stopPropagation();var u=r.touches[0];HC(n,u.clientX,u.clientY),er(Nn(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=rX(n,r);s&&nX(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 i=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 u=Nn(n);n.onChangeCallbacks.forEach(function(d){return d(u)}),er(u,{scale:r,positionX:o,positionY:s},i)}else console.error("Detected NaN set state values")},this.setCenter=function(){if(n.wrapperComponent&&n.contentComponent){var r=eE(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):NY(r,o,s)},this.applyTransformation=function(){if(!(!n.mounted||!n.contentComponent)){var r=n.transformState,o=r.scale,s=r.positionX,i=r.positionY,u=n.handleTransformStyles(s,i,o);n.contentComponent.style.transform=u}},this.getContext=function(){return Nn(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,rc(n,n.transformState.scale),n.handleInitializeWrapperEvents(r),n.handleInitialize(o),n.initializeWindowEvents(),n.isInitialized=!0;var s=Nn(n);er(s,void 0,n.props.onInit)},this.props=t,this.setup=VC(this.props),this.transformState=Xj(this.props)}return e}(),tm=L.createContext(null),sX=function(e,t){return typeof e=="function"?e(t):e},aX=L.forwardRef(function(e,t){var n=p.useRef(new oX(e)).current,r=sX(e.children,x0(n));return p.useImperativeHandle(t,function(){return x0(n)},[n]),p.useEffect(function(){n.update(e)},[n,e]),L.createElement(tm.Provider,{value:n},r)});L.forwardRef(function(e,t){var n=p.useRef(null),r=p.useContext(tm);return p.useEffect(function(){return r.onChange(function(o){if(n.current){var s=0,i=0;n.current.style.transform=r.handleTransformStyles(s,i,1/o.instance.transformState.scale)}})},[r]),L.createElement("div",ii({},e,{ref:zY([n,t])}))});function iX(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 lX=`.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;
|
||
}
|
||
`,UC={wrapper:"transform-component-module_wrapper__SPB86",content:"transform-component-module_content__FBWxo"};iX(lX);var cX=function(e){var t=e.children,n=e.wrapperClass,r=n===void 0?"":n,o=e.contentClass,s=o===void 0?"":o,i=e.wrapperStyle,u=e.contentStyle,d=e.wrapperProps,f=d===void 0?{}:d,h=e.contentProps,m=h===void 0?{}:h,v=p.useContext(tm).init,y=p.useRef(null),S=p.useRef(null);return p.useEffect(function(){var w=y.current,C=S.current;w!==null&&C!==null&&v&&v(w,C)},[]),L.createElement("div",ii({},f,{ref:y,className:"react-transform-wrapper ".concat(UC.wrapper," ").concat(r),style:i}),L.createElement("div",ii({},m,{ref:S,className:"react-transform-component ".concat(UC.content," ").concat(s),style:u}),t))},oE=function(){var e=p.useContext(tm);if(!e)throw new Error("Transform context must be placed inside TransformWrapper");return e};const GC=1.5,yy="28rem",uX=()=>{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 dX(e){return st({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 fX(e){return st({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 pX(e){return st({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 qC(e){return st({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 hX(e){return st({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 mX(e){return st({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 gX(e){return st({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}}]})(e)}function sE(e){return st({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M16 17.01V10h-2v7.01h-3L15 21l4-3.99h-3zM9 3L5 6.99h3V14h2V6.99h3L9 3zm7 14.01V10h-2v7.01h-3L15 21l4-3.99h-3zM9 3L5 6.99h3V14h2V6.99h3L9 3z"}}]})(e)}const vX=({flipHorizontally:e,flipVertically:t,rotateCounterClockwise:n,rotateClockwise:r,reset:o})=>{const{zoomIn:s,zoomOut:i,resetTransform:u}=oE(),{t:d}=pe();return a.jsxs(gr,{isAttached:!0,orientation:"vertical",children:[a.jsx(je,{icon:a.jsx(c8,{}),"aria-label":d("accessibility.zoomIn"),tooltip:d("accessibility.zoomIn"),onClick:()=>s(),fontSize:20}),a.jsx(je,{icon:a.jsx(u8,{}),"aria-label":d("accessibility.zoomOut"),tooltip:d("accessibility.zoomOut"),onClick:()=>i(),fontSize:20}),a.jsx(je,{icon:a.jsx(d8,{}),"aria-label":d("accessibility.rotateCounterClockwise"),tooltip:d("accessibility.rotateCounterClockwise"),onClick:n,fontSize:20}),a.jsx(je,{icon:a.jsx(f8,{}),"aria-label":d("accessibility.rotateClockwise"),tooltip:d("accessibility.rotateClockwise"),onClick:r,fontSize:20}),a.jsx(je,{icon:a.jsx(qC,{}),"aria-label":d("accessibility.flipHorizontally"),tooltip:d("accessibility.flipHorizontally"),onClick:e,fontSize:20}),a.jsx(je,{icon:a.jsx(qC,{style:{transform:"rotate(90deg)"}}),"aria-label":d("accessibility.flipVertically"),tooltip:d("accessibility.flipVertically"),onClick:t,fontSize:20}),a.jsx(je,{icon:a.jsx(p8,{}),"aria-label":d("accessibility.reset"),tooltip:d("accessibility.reset"),onClick:()=>{u(),o()},fontSize:20})]})};function yX({image:e,alt:t,ref:n,styleClass:r,rotation:o,scaleX:s,scaleY:i}){const{centerView:u}=oE();return a.jsx(cX,{wrapperStyle:{width:"100%",height:"100%"},children:a.jsx("img",{style:{transform:`rotate(${o}deg) scaleX(${s}) scaleY(${i})`,width:"100%"},src:e.image_url,alt:t,ref:n,className:r||"",onLoad:()=>u(1,0,"easeOut")})})}const bX=Ce([pk,Hr],(e,t)=>{const{currentImage:n}=e,{shouldShowImageDetails:r}=t;return{viewerImageToDisplay:n,shouldShowImageDetails:r}},{memoizeOptions:{resultEqualityCheck:Wt}});function xX(){const e=ne(),t=F(v=>v.lightbox.isLightboxOpen),{rotation:n,scaleX:r,scaleY:o,flipHorizontally:s,flipVertically:i,rotateCounterClockwise:u,rotateClockwise:d,reset:f}=uX(),{viewerImageToDisplay:h,shouldShowImageDetails:m}=F(bX);return Ke("Esc",()=>{t&&e(mu(!1))},[t]),a.jsx(No,{children:t&&a.jsx(bo.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15,ease:"easeInOut"},style:{display:"flex",width:"100vw",height:`calc(100vh - ${GC*4}px)`,position:"fixed",top:`${GC*4}px`,background:"var(--invokeai-colors-base-900)",zIndex:99},children:a.jsxs(aX,{centerOnInit:!0,minScale:.1,initialPositionX:50,initialPositionY:50,children:[a.jsxs(H,{sx:{flexDir:"column",position:"absolute",insetInlineStart:4,gap:4,zIndex:3,top:4},children:[a.jsx(je,{icon:a.jsx(h8,{}),"aria-label":"Exit Viewer",className:"lightbox-close-btn",onClick:()=>{e(mu(!1))},fontSize:20}),a.jsx(vX,{flipHorizontally:s,flipVertically:i,rotateCounterClockwise:u,rotateClockwise:d,reset:f})]}),a.jsx(H,{sx:{position:"absolute",top:4,zIndex:3,insetInlineStart:"50%",transform:"translate(-50%, 0)"},children:a.jsx(Bj,{})}),h&&a.jsxs(a.Fragment,{children:[a.jsx(yX,{rotation:n,scaleX:r,scaleY:o,image:h,styleClass:"lightbox-image"}),m&&a.jsx(Hj,{image:h}),!m&&a.jsx(Ge,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"100vw",h:"100vh",px:16,pointerEvents:"none"},children:a.jsx(Vj,{})})]})]})},"lightbox")})}function KC(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.addEventListener&&e.addEventListener.apply(e,t)}function YC(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.removeEventListener&&e.removeEventListener.apply(e,t)}var SX=function(e,t){return typeof t=="boolean"?t:!e},wX=function(e){return p.useReducer(SX,e)};const CX=wX;var kX=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)},i=function(){return o(!1)};t&&e&&e.current&&(KC(e.current,"mouseover",s),KC(e.current,"mouseout",i));var u=e.current;return function(){t&&u&&(YC(u,"mouseover",s),YC(u,"mouseout",i))}},[t,e]),r};const aE=kX,PX=Ce(xo,e=>{const{isConnected:t,isProcessing:n,statusTranslationKey:r,currentIteration:o,totalIterations:s,currentStatusHasSteps:i}=e;return{isConnected:t,isProcessing:n,currentIteration:o,totalIterations:s,statusTranslationKey:r,currentStatusHasSteps:i}},Ct),XC={ok:"green.400",working:"yellow.400",error:"red.400"},QC={ok:"green.600",working:"yellow.500",error:"red.500"},_X=()=>{const{isConnected:e,isProcessing:t,currentIteration:n,totalIterations:r,statusTranslationKey:o}=F(PX),{t:s}=pe(),i=p.useRef(null),u=p.useMemo(()=>t?"working":e?"ok":"error",[t,e]),d=p.useMemo(()=>{if(n&&r)return` (${n}/${r})`},[n,r]),f=aE(i);return a.jsxs(H,{ref:i,h:"full",px:2,alignItems:"center",gap:5,children:[a.jsx(No,{children:f&&a.jsx(bo.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.15}},exit:{opacity:0,transition:{delay:.8}},children:a.jsxs(Ue,{sx:{fontSize:"sm",fontWeight:"600",pb:"1px",userSelect:"none",color:QC[u],_dark:{color:XC[u]}},children:[s(o),d]})},"statusText")}),a.jsx(go,{as:$z,sx:{boxSize:"0.5rem",color:QC[u],_dark:{color:XC[u]}}})]})},jX=()=>{const{colorMode:e,toggleColorMode:t}=So(),{t:n}=pe();return a.jsx(je,{"aria-label":n(e==="dark"?"common.lightMode":"common.darkMode"),tooltip:n(e==="dark"?"common.lightMode":"common.darkMode"),size:"sm",icon:e==="dark"?a.jsx(a$,{fontSize:19}):a.jsx(Jz,{fontSize:18}),onClick:t,variant:"link"})};function EX(e){const{title:t,hotkey:n,description:r}=e;return a.jsxs(xa,{sx:{gridTemplateColumns:"auto max-content",justifyContent:"space-between",alignItems:"center"},children:[a.jsxs(xa,{children:[a.jsx(Ue,{fontWeight:600,children:t}),r&&a.jsx(Ue,{sx:{fontSize:"sm"},variant:"subtext",children:r})]}),a.jsx(Ge,{sx:{fontSize:"sm",fontWeight:600,px:2,py:1},children:n})]})}function IX({children:e}){const{isOpen:t,onOpen:n,onClose:r}=ya(),{t:o}=pe(),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:"`"}],i=[{title:o("hotkeys.setPrompt.title"),desc:o("hotkeys.setPrompt.desc"),hotkey:"P"},{title:o("hotkeys.setSeed.title"),desc:o("hotkeys.setSeed.desc"),hotkey:"S"},{title:o("hotkeys.setParameters.title"),desc:o("hotkeys.setParameters.desc"),hotkey:"A"},{title:o("hotkeys.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"}],u=[{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=>a.jsx(H,{flexDir:"column",gap:4,children:h.map((m,v)=>a.jsxs(H,{flexDir:"column",px:2,gap:4,children:[a.jsx(EX,{title:m.title,description:m.desc,hotkey:m.hotkey}),v<h.length-1&&a.jsx(Ra,{})]},v))});return a.jsxs(a.Fragment,{children:[p.cloneElement(e,{onClick:n}),a.jsxs(bu,{isOpen:t,onClose:r,children:[a.jsx(Ca,{}),a.jsxs(xu,{children:[a.jsx(wa,{children:o("hotkeys.keyboardShortcuts")}),a.jsx(b1,{}),a.jsx(ka,{children:a.jsx(g5,{allowMultiple:!0,children:a.jsxs(H,{flexDir:"column",gap:2,children:[a.jsxs(Jc,{children:[a.jsx(Qc,{children:a.jsxs(H,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.appHotkeys")}),a.jsx(Zc,{})]})}),a.jsx(eu,{children:f(s)})]}),a.jsxs(Jc,{children:[a.jsx(Qc,{children:a.jsxs(H,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.generalHotkeys")}),a.jsx(Zc,{})]})}),a.jsx(eu,{children:f(i)})]}),a.jsxs(Jc,{children:[a.jsx(Qc,{children:a.jsxs(H,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.galleryHotkeys")}),a.jsx(Zc,{})]})}),a.jsx(eu,{children:f(u)})]}),a.jsxs(Jc,{children:[a.jsx(Qc,{children:a.jsxs(H,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[a.jsx("h2",{children:o("hotkeys.unifiedCanvasHotkeys")}),a.jsx(Zc,{})]})}),a.jsx(eu,{children:f(d)})]})]})})}),a.jsx(Sa,{})]})]})]})}const iE=()=>{const{data:e}=m8(),t=p.useRef(null),n=aE(t);return a.jsxs(H,{alignItems:"center",gap:3,ps:1,ref:t,children:[a.jsx(Au,{src:g8,alt:"invoke-ai-logo",sx:{w:"32px",h:"32px",minW:"32px",minH:"32px",userSelect:"none"}}),a.jsxs(H,{sx:{gap:3,alignItems:"center"},children:[a.jsxs(Ue,{sx:{fontSize:"xl",userSelect:"none"},children:["invoke ",a.jsx("strong",{children:"ai"})]}),a.jsx(No,{children:n&&e&&a.jsx(bo.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.15}},exit:{opacity:0,transition:{delay:.8}},children:a.jsx(Ue,{sx:{fontWeight:600,marginTop:1,color:"base.300",fontSize:14},variant:"subtext",children:e.version})},"statusText")})]})]})},OX={ar:Pr.t("common.langArabic",{lng:"ar"}),nl:Pr.t("common.langDutch",{lng:"nl"}),en:Pr.t("common.langEnglish",{lng:"en"}),fr:Pr.t("common.langFrench",{lng:"fr"}),de:Pr.t("common.langGerman",{lng:"de"}),he:Pr.t("common.langHebrew",{lng:"he"}),it:Pr.t("common.langItalian",{lng:"it"}),ja:Pr.t("common.langJapanese",{lng:"ja"}),ko:Pr.t("common.langKorean",{lng:"ko"}),pl:Pr.t("common.langPolish",{lng:"pl"}),pt_BR:Pr.t("common.langBrPortuguese",{lng:"pt_BR"}),pt:Pr.t("common.langPortuguese",{lng:"pt"}),ru:Pr.t("common.langRussian",{lng:"ru"}),zh_CN:Pr.t("common.langSimplifiedChinese",{lng:"zh_CN"}),es:Pr.t("common.langSpanish",{lng:"es"}),uk:Pr.t("common.langUkranian",{lng:"ua"})};function RX(){const{t:e}=pe(),t=ne(),n=F(C3);return a.jsxs(xh,{closeOnSelect:!1,children:[a.jsx(qn,{label:e("common.languagePickerLabel"),hasArrow:!0,children:a.jsx(Sh,{as:ri,icon:a.jsx(UL,{}),variant:"link","aria-label":e("common.languagePickerLabel"),fontSize:22,minWidth:8})}),a.jsx(Wu,{children:a.jsx(y1,{value:n,children:Rs(OX,(r,o)=>a.jsx(yu,{value:o,onClick:()=>t(v8(o)),children:r},o))})})]})}const TX=e=>{const{searchable:t=!0,tooltip:n,inputRef:r,...o}=e,s=ne(),{base50:i,base100:u,base200:d,base300:f,base400:h,base500:m,base600:v,base700:y,base800:S,base900:w,accent200:C,accent300:k,accent400:P,accent500:j,accent600:E}=Lj(),[O]=tl("shadows",["dark-lg"]),{colorMode:I}=So(),R=p.useCallback(D=>{D.shiftKey&&s(rs(!0))},[s]),T=p.useCallback(D=>{D.shiftKey||s(rs(!1))},[s]);return a.jsx(qn,{label:n,placement:"top",hasArrow:!0,isOpen:!0,children:a.jsx(Aj,{ref:r,onKeyDown:R,onKeyUp:T,searchable:t,maxDropdownHeight:300,styles:()=>({label:{color:Te(y,f)(I),fontWeight:"normal"},searchInput:{":placeholder":{color:Te(f,y)(I)}},input:{backgroundColor:Te(i,w)(I),borderWidth:"2px",borderColor:Te(d,S)(I),color:Te(w,u)(I),paddingRight:24,fontWeight:600,"&:hover":{borderColor:Te(f,v)(I)},"&:focus":{borderColor:Te(k,E)(I)},"&:is(:focus, :hover)":{borderColor:Te(h,m)(I)},"&:focus-within":{borderColor:Te(C,E)(I)},"&[data-disabled]":{backgroundColor:Te(f,y)(I),color:Te(v,h)(I),cursor:"not-allowed"}},value:{backgroundColor:Te(d,S)(I),color:Te(w,u)(I),button:{color:Te(w,u)(I)},"&:hover":{backgroundColor:Te(f,y)(I),cursor:"pointer"}},dropdown:{backgroundColor:Te(d,S)(I),borderColor:Te(d,S)(I),boxShadow:O},item:{backgroundColor:Te(d,S)(I),color:Te(S,d)(I),padding:6,"&[data-hovered]":{color:Te(w,u)(I),backgroundColor:Te(f,y)(I)},"&[data-active]":{backgroundColor:Te(f,y)(I),"&:hover":{color:Te(w,u)(I),backgroundColor:Te(f,y)(I)}},"&[data-selected]":{backgroundColor:Te(P,E)(I),color:Te(i,u)(I),fontWeight:600,"&:hover":{backgroundColor:Te(j,j)(I),color:Te("white",i)(I)}},"&[data-disabled]":{color:Te(m,v)(I),cursor:"not-allowed"}},rightSection:{width:24,padding:20,button:{color:Te(w,u)(I)}}}),...o})})},MX=p.memo(TX),DX=Rs(k3,e=>({value:e,label:P3[e]})).sort((e,t)=>e.label.localeCompare(t.label));function AX(){const e=ne(),{t}=pe(),n=F(o=>o.ui.favoriteSchedulers),r=p.useCallback(o=>{e(y8(o))},[e]);return a.jsx(MX,{label:t("settings.favoriteSchedulers"),value:n,data:DX,onChange:r,clearable:!0,searchable:!0,maxSelectedValues:99,placeholder:t("settings.favoriteSchedulersPlaceholder")})}const NX=Ce([xo,Hr],(e,t)=>{const{shouldConfirmOnDelete:n,shouldDisplayGuides:r,enableImageDebugging:o,consoleLogLevel:s,shouldLogToConsole:i,shouldAntialiasProgressImage:u}=e,{shouldUseCanvasBetaLayout:d,shouldUseSliders:f,shouldShowProgressInViewer:h,shouldShowAdvancedOptions:m}=t;return{shouldConfirmOnDelete:n,shouldDisplayGuides:r,enableImageDebugging:o,shouldUseCanvasBetaLayout:d,shouldUseSliders:f,shouldShowProgressInViewer:h,consoleLogLevel:s,shouldLogToConsole:i,shouldAntialiasProgressImage:u,shouldShowAdvancedOptions:m}},{memoizeOptions:{resultEqualityCheck:Wt}}),zX=({children:e,config:t})=>{const n=ne(),{t:r}=pe(),o=(t==null?void 0:t.shouldShowBetaLayout)??!0,s=(t==null?void 0:t.shouldShowDeveloperSettings)??!0,i=(t==null?void 0:t.shouldShowResetWebUiText)??!0,u=(t==null?void 0:t.shouldShowAdvancedOptionsSettings)??!0;p.useEffect(()=>{s||n(Hx(!1))},[s,n]);const{isOpen:d,onOpen:f,onClose:h}=ya(),{isOpen:m,onOpen:v,onClose:y}=ya(),{shouldConfirmOnDelete:S,shouldDisplayGuides:w,enableImageDebugging:C,shouldUseCanvasBetaLayout:k,shouldUseSliders:P,shouldShowProgressInViewer:j,consoleLogLevel:E,shouldLogToConsole:O,shouldAntialiasProgressImage:I,shouldShowAdvancedOptions:R}=F(NX),T=p.useCallback(()=>{Object.keys(window.localStorage).forEach(A=>{(b8.includes(A)||A.startsWith(x8))&&localStorage.removeItem(A)}),h(),v()},[h,v]),D=p.useCallback(A=>{n(S8(A))},[n]),$=p.useCallback(A=>{n(Hx(A.target.checked))},[n]);return a.jsxs(a.Fragment,{children:[p.cloneElement(e,{onClick:f}),a.jsxs(bu,{isOpen:d,onClose:h,size:"xl",isCentered:!0,children:[a.jsx(Ca,{}),a.jsxs(xu,{children:[a.jsx(wa,{children:r("common.settingsLabel")}),a.jsx(b1,{}),a.jsx(ka,{children:a.jsxs(H,{sx:{gap:4,flexDirection:"column"},children:[a.jsxs(Kc,{children:[a.jsx(ua,{size:"sm",children:r("settings.general")}),a.jsx(jn,{label:r("settings.confirmOnDelete"),isChecked:S,onChange:A=>n(S3(A.target.checked))}),u&&a.jsx(jn,{label:r("settings.showAdvancedOptions"),isChecked:R,onChange:A=>n(w8(A.target.checked))})]}),a.jsxs(Kc,{children:[a.jsx(ua,{size:"sm",children:r("settings.generation")}),a.jsx(AX,{})]}),a.jsxs(Kc,{children:[a.jsx(ua,{size:"sm",children:r("settings.ui")}),a.jsx(jn,{label:r("settings.displayHelpIcons"),isChecked:w,onChange:A=>n(C8(A.target.checked))}),o&&a.jsx(jn,{label:r("settings.useCanvasBeta"),isChecked:k,onChange:A=>n(k8(A.target.checked))}),a.jsx(jn,{label:r("settings.useSlidersForAll"),isChecked:P,onChange:A=>n(P8(A.target.checked))}),a.jsx(jn,{label:r("settings.showProgressInViewer"),isChecked:j,onChange:A=>n(w3(A.target.checked))}),a.jsx(jn,{label:r("settings.antialiasProgressImages"),isChecked:I,onChange:A=>n(_8(A.target.checked))})]}),s&&a.jsxs(Kc,{children:[a.jsx(ua,{size:"sm",children:r("settings.developer")}),a.jsx(jn,{label:r("settings.shouldLogToConsole"),isChecked:O,onChange:$}),a.jsx(Kn,{disabled:!O,label:r("settings.consoleLogLevel"),onChange:D,value:E,data:j8.concat()}),a.jsx(jn,{label:r("settings.enableImageDebugging"),isChecked:C,onChange:A=>n(E8(A.target.checked))})]}),a.jsxs(Kc,{children:[a.jsx(ua,{size:"sm",children:r("settings.resetWebUI")}),a.jsx(Yt,{colorScheme:"error",onClick:T,children:r("settings.resetWebUI")}),i&&a.jsxs(a.Fragment,{children:[a.jsx(Ue,{children:r("settings.resetWebUIDesc1")}),a.jsx(Ue,{children:r("settings.resetWebUIDesc2")})]})]})]})}),a.jsx(Sa,{children:a.jsx(Yt,{onClick:h,children:r("common.close")})})]})]}),a.jsxs(bu,{closeOnOverlayClick:!1,isOpen:m,onClose:y,isCentered:!0,children:[a.jsx(Ca,{backdropFilter:"blur(40px)"}),a.jsxs(xu,{children:[a.jsx(wa,{}),a.jsx(ka,{children:a.jsx(H,{justifyContent:"center",children:a.jsx(Ue,{fontSize:"lg",children:a.jsx(Ue,{children:r("settings.resetComplete")})})})}),a.jsx(Sa,{})]})]})]})},Kc=e=>a.jsx(H,{layerStyle:"second",sx:{flexDirection:"column",gap:2,p:4,borderRadius:"base"},children:e.children}),$X=()=>{const{t:e}=pe(),t=Gn("localization").isFeatureEnabled,n=Gn("bugLink").isFeatureEnabled,r=Gn("discordLink").isFeatureEnabled,o=Gn("githubLink").isFeatureEnabled;return a.jsxs(H,{sx:{gap:2,alignItems:"center"},children:[a.jsx(iE,{}),a.jsx(Oa,{}),a.jsx(_X,{}),a.jsx(IX,{children:a.jsx(je,{"aria-label":e("common.hotkeysLabel"),tooltip:e("common.hotkeysLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:a.jsx(Yz,{})})}),t&&a.jsx(RX,{}),n&&a.jsx(zi,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI/issues",marginBottom:"-0.25rem",children:a.jsx(je,{"aria-label":e("common.reportBugLabel"),tooltip:e("common.reportBugLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:a.jsx(Nz,{})})}),o&&a.jsx(zi,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI",marginBottom:"-0.25rem",children:a.jsx(je,{"aria-label":e("common.githubLabel"),tooltip:e("common.githubLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:a.jsx(Ez,{})})}),r&&a.jsx(zi,{isExternal:!0,href:"https://discord.gg/ZmtBAhwWhy",marginBottom:"-0.25rem",children:a.jsx(je,{"aria-label":e("common.discordLabel"),tooltip:e("common.discordLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:a.jsx(jz,{})})}),a.jsx(jX,{}),a.jsx(zX,{children:a.jsx(je,{"aria-label":e("common.settingsLabel"),tooltip:e("common.settingsLabel"),variant:"link","data-variant":"link",fontSize:22,size:"sm",icon:a.jsx(fX,{})})})]})},LX=p.memo($X),FX=Ce(xo,e=>{const{isUploading:t}=e;let n="";return t&&(n="Uploading..."),{tooltip:n,shouldShow:t}}),BX=()=>{const{shouldShow:e,tooltip:t}=F(FX);return e?a.jsx(H,{sx:{alignItems:"center",justifyContent:"center",color:"base.600"},children:a.jsx(qn,{label:t,placement:"right",hasArrow:!0,children:a.jsx(ui,{})})}):null},HX=p.memo(BX),hi=e=>e.config,{createElement:oc,createContext:WX,forwardRef:lE,useCallback:Ka,useContext:cE,useEffect:va,useImperativeHandle:uE,useLayoutEffect:VX,useMemo:UX,useRef:Qo,useState:pu}=Y0,ZC=Y0["useId".toString()],GX=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",nh=GX?VX:()=>{},qX=typeof ZC=="function"?ZC:()=>null;let KX=0;function by(e=null){const t=qX(),n=Qo(e||t||null);return n.current===null&&(n.current=""+KX++),n.current}const nm=WX(null);nm.displayName="PanelGroupContext";function dE({children:e=null,className:t="",collapsedSize:n=0,collapsible:r=!1,defaultSize:o=null,forwardedRef:s,id:i=null,maxSize:u=100,minSize:d=10,onCollapse:f=null,onResize:h=null,order:m=null,style:v={},tagName:y="div"}){const S=cE(nm);if(S===null)throw Error("Panel components must be rendered within a PanelGroup container");const w=by(i),{collapsePanel:C,expandPanel:k,getPanelStyle:P,registerPanel:j,resizePanel:E,unregisterPanel:O}=S,I=Qo({onCollapse:f,onResize:h});if(va(()=>{I.current.onCollapse=f,I.current.onResize=h}),d<0||d>100)throw Error(`Panel minSize must be between 0 and 100, but was ${d}`);if(u<0||u>100)throw Error(`Panel maxSize must be between 0 and 100, but was ${u}`);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 R=P(w,o),T=Qo({size:JC(R)}),D=Qo({callbacksRef:I,collapsedSize:n,collapsible:r,defaultSize:o,id:w,maxSize:u,minSize:d,order:m});return nh(()=>{T.current.size=JC(R),D.current.callbacksRef=I,D.current.collapsedSize=n,D.current.collapsible=r,D.current.defaultSize=o,D.current.id=w,D.current.maxSize=u,D.current.minSize=d,D.current.order=m}),nh(()=>(j(w,D),()=>{O(w)}),[m,w,j,O]),uE(s,()=>({collapse:()=>C(w),expand:()=>k(w),getCollapsed(){return T.current.size===0},getSize(){return T.current.size},resize:$=>E(w,$)}),[C,k,w,E]),oc(y,{children:e,className:t,"data-panel":"","data-panel-collapsible":r||void 0,"data-panel-id":w,"data-panel-size":parseFloat(""+R.flexGrow).toFixed(1),id:`data-panel-id-${w}`,style:{...R,...v}})}const ju=lE((e,t)=>oc(dE,{...e,forwardedRef:t}));dE.displayName="Panel";ju.displayName="forwardRef(Panel)";function JC(e){const{flexGrow:t}=e;return typeof t=="string"?parseFloat(t):t}const Ji=10;function tu(e,t,n,r,o,s,i,u){const{sizes:d}=u||{},f=d||s;if(o===0)return f;const h=Yo(t),m=f.concat();let v=0;{const w=o<0?r:n,C=h.findIndex(E=>E.current.id===w),k=h[C],P=f[C],j=e4(k,Math.abs(o),P,e);if(P===j)return f;j===0&&P>0&&i.set(w,P),o=o<0?P-j:j-P}let y=o<0?n:r,S=h.findIndex(w=>w.current.id===y);for(;;){const w=h[S],C=f[S],k=Math.abs(o)-Math.abs(v),P=e4(w,0-k,C,e);if(C!==P&&(P===0&&C>0&&i.set(w.current.id,C),v+=C-P,m[S]=P,v.toPrecision(Ji).localeCompare(Math.abs(o).toPrecision(Ji),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(w=>w.current.id===y),m[S]=f[S]+v,m)}function Il(e,t,n){t.forEach((r,o)=>{const{callbacksRef:s,collapsedSize:i,collapsible:u,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),u&&h&&((f==null||f===i)&&r!==i?h(!1):f!==i&&r===i&&h(!0))}})}function iv(e,t){if(t.length<2)return[null,null];const n=t.findIndex(i=>i.current.id===e);if(n<0)return[null,null];const r=n===t.length-1,o=r?t[n-1].current.id:e,s=r?e:t[n+1].current.id;return[o,s]}function fE(e,t,n){if(e.size===1)return"100";const o=Yo(e).findIndex(i=>i.current.id===t),s=n[o];return s==null?"0":s.toPrecision(Ji)}function YX(e){const t=document.querySelector(`[data-panel-id="${e}"]`);return t||null}function xy(e){const t=document.querySelector(`[data-panel-group-id="${e}"]`);return t||null}function rm(e){const t=document.querySelector(`[data-panel-resize-handle-id="${e}"]`);return t||null}function XX(e){return pE().findIndex(r=>r.getAttribute("data-panel-resize-handle-id")===e)??null}function pE(){return Array.from(document.querySelectorAll("[data-panel-resize-handle-id]"))}function hE(e){return Array.from(document.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function Sy(e,t,n){var d,f,h,m;const r=rm(t),o=hE(e),s=r?o.indexOf(r):-1,i=((f=(d=n[s])==null?void 0:d.current)==null?void 0:f.id)??null,u=((m=(h=n[s+1])==null?void 0:h.current)==null?void 0:m.id)??null;return[i,u]}function Yo(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 e4(e,t,n,r){var h;const o=n+t,{collapsedSize:s,collapsible:i,maxSize:u,minSize:d}=e.current;if(i){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(u,Math.max(d,o))}function mE(e,t="Assertion failed!"){if(!e)throw console.error(t),Error(t)}function QX({committedValuesRef:e,groupId:t,panels:n,setSizes:r,sizes:o,panelSizeBeforeCollapse:s}){va(()=>{const{direction:i,panels:u}=e.current,d=xy(t),{height:f,width:h}=d.getBoundingClientRect(),v=hE(t).map(y=>{const S=y.getAttribute("data-panel-resize-handle-id"),w=Yo(u),[C,k]=Sy(t,S,w);if(C==null||k==null)return()=>{};let P=0,j=100,E=0,O=0;w.forEach(A=>{A.current.id===C?(j=A.current.maxSize,P=A.current.minSize):(E+=A.current.minSize,O+=A.current.maxSize)});const I=Math.min(j,100-E),R=Math.max(P,(w.length-1)*100-O),T=fE(u,C,o);y.setAttribute("aria-valuemax",""+Math.round(I)),y.setAttribute("aria-valuemin",""+Math.round(R)),y.setAttribute("aria-valuenow",""+Math.round(parseInt(T)));const D=A=>{if(!A.defaultPrevented)switch(A.key){case"Enter":{A.preventDefault();const J=w.findIndex(z=>z.current.id===C);if(J>=0){const z=w[J],B=o[J];if(B!=null){let G=0;B.toPrecision(Ji)<=z.current.minSize.toPrecision(Ji)?G=i==="horizontal"?h:f:G=-(i==="horizontal"?h:f);const K=tu(A,u,C,k,G,o,s.current,null);o!==K&&r(K)}}break}}};y.addEventListener("keydown",D);const $=YX(C);return $!=null&&y.setAttribute("aria-controls",$.id),()=>{y.removeAttribute("aria-valuemax"),y.removeAttribute("aria-valuemin"),y.removeAttribute("aria-valuenow"),y.removeEventListener("keydown",D),$!=null&&y.removeAttribute("aria-controls")}});return()=>{v.forEach(y=>y())}},[e,t,n,s,r,o])}function ZX({disabled:e,handleId:t,resizeHandler:n}){va(()=>{if(e||n==null)return;const r=rm(t);if(r==null)return;const o=s=>{if(!s.defaultPrevented)switch(s.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{s.preventDefault(),n(s);break}case"F6":{s.preventDefault();const i=pE(),u=XX(t);mE(u!==null);const d=s.shiftKey?u>0?u-1:i.length-1:u+1<i.length?u+1:0;i[d].focus();break}}};return r.addEventListener("keydown",o),()=>{r.removeEventListener("keydown",o)}},[e,t,n])}function JX(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 gE(e,t,n,r=0,o=null){const s=n==="horizontal";let i=0;if(w0(e))i=s?e.clientX:e.clientY;else if(C0(e)){const h=e.touches[0];i=s?h.screenX:h.screenY}else return 0;const u=rm(t),d=o||u.getBoundingClientRect(),f=s?d.left:d.top;return i-f-r}function eQ(e,t,n,r,o,s,i){const{dragOffset:u=0,dragHandleRect:d,sizes:f}=i||{},h=f||s;if(tQ(e)){const m=o==="horizontal",y=xy(t).getBoundingClientRect(),S=m?y.width:y.height,w=e.shiftKey?10:100,C=S/w;let k=0;switch(e.key){case"ArrowDown":k=m?0:C;break;case"ArrowLeft":k=m?-C:0;break;case"ArrowRight":k=m?C:0;break;case"ArrowUp":k=m?0:-C;break;case"End":k=S;break;case"Home":k=-S;break}const[P,j]=Sy(t,n,r),E=k<0?P:j,O=r.findIndex(R=>R.current.id===E),I=r[O];if(I.current.collapsible){const R=h[O];(R===0||R.toPrecision(Ji)===I.current.minSize.toPrecision(Ji))&&(k=k<0?-I.current.minSize*S:I.current.minSize*S)}return k}else return gE(e,n,o,u,d)}function tQ(e){return e.type==="keydown"}function w0(e){return e.type.startsWith("mouse")}function C0(e){return e.type.startsWith("touch")}let k0=null,Di=null;function vE(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 nQ(){Di!==null&&(document.head.removeChild(Di),k0=null,Di=null)}function lv(e){if(k0===e)return;k0=e;const t=vE(e);Di===null&&(Di=document.createElement("style"),document.head.appendChild(Di)),Di.innerHTML=`*{cursor: ${t}!important;}`}function rQ(e,t=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}function yE(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 bE(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 oQ(e,t,n){const r=bE(e,n);if(r){const o=yE(t);return r[o]??null}return null}function sQ(e,t,n,r){const o=yE(t),s=bE(e,r)||{};s[o]=n;try{r.setItem(`PanelGroup:sizes:${e}`,JSON.stringify(s))}catch(i){console.error(i)}}const cv={};function t4(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}const nu={getItem:e=>(t4(nu),nu.getItem(e)),setItem:(e,t)=>{t4(nu),nu.setItem(e,t)}};function xE({autoSaveId:e,children:t=null,className:n="",direction:r,disablePointerEventsDuringResize:o=!1,forwardedRef:s,id:i=null,onLayout:u,storage:d=nu,style:f={},tagName:h="div"}){const m=by(i),[v,y]=pu(null),[S,w]=pu(new Map),C=Qo(null),k=Qo({onLayout:u});va(()=>{k.current.onLayout=u});const P=Qo({}),[j,E]=pu([]),O=Qo(new Map),I=Qo(0),R=Qo({direction:r,panels:S,sizes:j});uE(s,()=>({getLayout:()=>{const{sizes:N}=R.current;return N},setLayout:N=>{const V=N.reduce((ve,le)=>ve+le,0);mE(V===100,"Panel sizes must add up to 100%");const{panels:W}=R.current,U=P.current,re=Yo(W);E(N),Il(re,N,U)}}),[]),nh(()=>{R.current.direction=r,R.current.panels=S,R.current.sizes=j}),QX({committedValuesRef:R,groupId:m,panels:S,setSizes:E,sizes:j,panelSizeBeforeCollapse:O}),va(()=>{const{onLayout:N}=k.current,{panels:V,sizes:W}=R.current;if(W.length>0){N&&N(W);const U=P.current,re=Yo(V);Il(re,W,U)}},[j]),nh(()=>{if(R.current.sizes.length===S.size)return;let V=null;if(e){const W=Yo(S);V=oQ(e,W,d)}if(V!=null)E(V);else{const W=Yo(S);let U=0,re=0,ve=0;if(W.forEach(le=>{ve+=le.current.minSize,le.current.defaultSize===null?U++:re+=le.current.defaultSize}),re>100)throw new Error("Default panel sizes cannot exceed 100%");if(W.length>1&&U===0&&re!==100)throw new Error("Invalid default sizes specified for panels");if(ve>100)throw new Error("Minimum panel sizes cannot exceed 100%");E(W.map(le=>le.current.defaultSize===null?(100-re)/U:le.current.defaultSize))}},[e,S,d]),va(()=>{if(e){if(j.length===0||j.length!==S.size)return;const N=Yo(S);cv[e]||(cv[e]=rQ(sQ,100)),cv[e](e,N,j,d)}},[e,S,j,d]);const T=Ka((N,V)=>{const{panels:W}=R.current;return W.size===0?{flexBasis:0,flexGrow:V??void 0,flexShrink:1,overflow:"hidden"}:{flexBasis:0,flexGrow:fE(W,N,j),flexShrink:1,overflow:"hidden",pointerEvents:o&&v!==null?"none":void 0}},[v,o,j]),D=Ka((N,V)=>{w(W=>{if(W.has(N))return W;const U=new Map(W);return U.set(N,V),U})},[]),$=Ka(N=>W=>{W.preventDefault();const{direction:U,panels:re,sizes:ve}=R.current,le=Yo(re),[se,Y]=Sy(m,N,le);if(se==null||Y==null)return;let ae=eQ(W,m,N,le,U,ve,C.current);if(ae===0)return;const xe=xy(m).getBoundingClientRect(),oe=U==="horizontal";document.dir==="rtl"&&oe&&(ae=-ae);const ge=oe?xe.width:xe.height,fe=ae/ge*100,Pe=tu(W,re,se,Y,fe,ve,O.current,C.current),Ae=!JX(ve,Pe);if((w0(W)||C0(W))&&I.current!=fe&&lv(Ae?oe?"horizontal":"vertical":oe?ae<0?"horizontal-min":"horizontal-max":ae<0?"vertical-min":"vertical-max"),Ae){const ye=P.current;E(Pe),Il(le,Pe,ye)}I.current=fe},[m]),A=Ka(N=>{w(V=>{if(!V.has(N))return V;const W=new Map(V);return W.delete(N),W})},[]),J=Ka(N=>{const{panels:V,sizes:W}=R.current,U=V.get(N);if(U==null)return;const{collapsedSize:re,collapsible:ve}=U.current;if(!ve)return;const le=Yo(V),se=le.indexOf(U);if(se<0)return;const Y=W[se];if(Y===re)return;O.current.set(N,Y);const[ae,ue]=iv(N,le);if(ae==null||ue==null)return;const oe=se===le.length-1?Y:re-Y,ge=tu(null,V,ae,ue,oe,W,O.current,null);if(W!==ge){const fe=P.current;E(ge),Il(le,ge,fe)}},[]),z=Ka(N=>{const{panels:V,sizes:W}=R.current,U=V.get(N);if(U==null)return;const{collapsedSize:re,minSize:ve}=U.current,le=O.current.get(N)||ve;if(!le)return;const se=Yo(V),Y=se.indexOf(U);if(Y<0||W[Y]!==re)return;const[ue,xe]=iv(N,se);if(ue==null||xe==null)return;const ge=Y===se.length-1?re-le:le,fe=tu(null,V,ue,xe,ge,W,O.current,null);if(W!==fe){const Pe=P.current;E(fe),Il(se,fe,Pe)}},[]),B=Ka((N,V)=>{const{panels:W,sizes:U}=R.current,re=W.get(N);if(re==null)return;const{collapsedSize:ve,collapsible:le,maxSize:se,minSize:Y}=re.current,ae=Yo(W),ue=ae.indexOf(re);if(ue<0)return;const xe=U[ue];if(xe===V)return;le&&V===ve||(V=Math.min(se,Math.max(Y,V)));const[oe,ge]=iv(N,ae);if(oe==null||ge==null)return;const Pe=ue===ae.length-1?xe-V:V-xe,Ae=tu(null,W,oe,ge,Pe,U,O.current,null);if(U!==Ae){const ye=P.current;E(Ae),Il(ae,Ae,ye)}},[]),G=UX(()=>({activeHandleId:v,collapsePanel:J,direction:r,expandPanel:z,getPanelStyle:T,groupId:m,registerPanel:D,registerResizeHandle:$,resizePanel:B,startDragging:(N,V)=>{if(y(N),w0(V)||C0(V)){const W=rm(N);C.current={dragHandleRect:W.getBoundingClientRect(),dragOffset:gE(V,N,r),sizes:R.current.sizes}}},stopDragging:()=>{nQ(),y(null),C.current=null},unregisterPanel:A}),[v,J,r,z,T,m,D,$,B,A]),K={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return oc(nm.Provider,{children:oc(h,{children:t,className:n,"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":m,style:{...K,...f}}),value:G})}const wy=lE((e,t)=>oc(xE,{...e,forwardedRef:t}));xE.displayName="PanelGroup";wy.displayName="forwardRef(PanelGroup)";function P0({children:e=null,className:t="",disabled:n=!1,id:r=null,onDragging:o,style:s={},tagName:i="div"}){const u=Qo(null),d=Qo({onDragging:o});va(()=>{d.current.onDragging=o});const f=cE(nm);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:w}=f,C=by(r),k=h===C,[P,j]=pu(!1),[E,O]=pu(null),I=Ka(()=>{u.current.blur(),w();const{onDragging:D}=d.current;D&&D(!1)},[w]);va(()=>{if(n)O(null);else{const T=y(C);O(()=>T)}},[n,C,y]),va(()=>{if(n||E==null||!k)return;const T=J=>{E(J)},D=J=>{E(J)},A=u.current.ownerDocument;return A.body.addEventListener("contextmenu",I),A.body.addEventListener("mousemove",T),A.body.addEventListener("touchmove",T),A.body.addEventListener("mouseleave",D),window.addEventListener("mouseup",I),window.addEventListener("touchend",I),()=>{A.body.removeEventListener("contextmenu",I),A.body.removeEventListener("mousemove",T),A.body.removeEventListener("touchmove",T),A.body.removeEventListener("mouseleave",D),window.removeEventListener("mouseup",I),window.removeEventListener("touchend",I)}},[m,n,k,E,I]),ZX({disabled:n,handleId:C,resizeHandler:E});const R={cursor:vE(m),touchAction:"none",userSelect:"none"};return oc(i,{children:e,className:t,"data-resize-handle-active":k?"pointer":P?"keyboard":void 0,"data-panel-group-direction":m,"data-panel-group-id":v,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":C,onBlur:()=>j(!1),onFocus:()=>j(!0),onMouseDown:T=>{S(C,T.nativeEvent);const{onDragging:D}=d.current;D&&D(!0)},onMouseUp:I,onTouchCancel:I,onTouchEnd:I,onTouchStart:T=>{S(C,T.nativeEvent);const{onDragging:D}=d.current;D&&D(!0)},ref:u,role:"separator",style:{...R,...s},tabIndex:0})}P0.displayName="PanelResizeHandle";const aQ=(e,t,n,r="horizontal")=>{const o=p.useRef(null),[s,i]=p.useState(t),u=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}),i(e/m*100)});return h.observe(d),f.forEach(m=>{h.observe(m)}),window.addEventListener("resize",u),()=>{h.disconnect(),window.removeEventListener("resize",u)}},[n,u,s,e,r]),{ref:o,minSizePct:s}},iQ=Ce([rn],e=>{const{initialImage:t}=e.generation,{asInitialImage:n,imageNames:r}=e.batch;return{initialImage:t,useBatchAsInitialImage:n,isResetButtonDisabled:n?r.length===0:!t}},Ct),lQ=()=>{const{initialImage:e}=F(iQ),{currentData:t,isLoading:n,isError:r,isSuccess:o}=Ks((e==null?void 0:e.imageName)??Do.skipToken),s=p.useMemo(()=>{if(t)return{id:"initial-image",payloadType:"IMAGE_DTO",payload:{imageDTO:t}}},[t]),i=p.useMemo(()=>({id:"initial-image",actionType:"SET_INITIAL_IMAGE"}),[]);return a.jsx(Yi,{imageDTO:t,droppableData:i,draggableData:s,isUploadDisabled:!0,fitContainer:!0,dropLabel:"Set as Initial Image",noContentFallback:a.jsx(xc,{label:"No initial image selected"})})},cQ=Ce([rn],e=>{const{initialImage:t}=e.generation,{asInitialImage:n,imageNames:r}=e.batch;return{initialImage:t,useBatchAsInitialImage:n,isResetButtonDisabled:n?r.length===0:!t}},Ct),uQ=()=>{const{initialImage:e,useBatchAsInitialImage:t,isResetButtonDisabled:n}=F(cQ),r=ne(),{openUploader:o}=Th();Ks((e==null?void 0:e.imageName)??Do.skipToken);const s=p.useMemo(()=>t?{type:"ADD_TO_BATCH"}:{type:"SET_INITIAL_IMAGE"},[t]),{getUploadButtonProps:i,getUploadInputProps:u}=oP({postUploadAction:s}),d=p.useCallback(()=>{r(t?I8():O8())},[r,t]),f=p.useCallback(()=>{o()},[o]);return p.useCallback(()=>{r(R8())},[r]),a.jsxs(H,{layerStyle:"first",sx:{position:"relative",flexDirection:"column",height:"full",width:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",p:4,gap:4},children:[a.jsxs(H,{sx:{w:"full",flexWrap:"wrap",justifyContent:"center",alignItems:"center",gap:2},children:[a.jsx(Ue,{sx:{fontWeight:600,userSelect:"none",color:"base.700",_dark:{color:"base.200"}},children:"Initial Image"}),a.jsx(Oa,{}),a.jsx(je,{tooltip:t?"Upload to Batch":"Upload Initial Image","aria-label":t?"Upload to Batch":"Upload Initial Image",icon:a.jsx(Yu,{}),onClick:f,...i()}),a.jsx(je,{tooltip:t?"Reset Batch":"Reset Initial Image","aria-label":t?"Reset Batch":"Reset Initial Image",icon:a.jsx(M1,{}),onClick:d,isDisabled:n})]}),a.jsx(lQ,{}),a.jsx("input",{...u()})]})},SE=e=>{const{sx:t}=e,n=ne(),r=F(i=>i.ui.shouldPinParametersPanel),{t:o}=pe(),s=()=>{n(T8(!r)),n(js())};return a.jsx(je,{...e,tooltip:o("common.pinOptionsPanel"),"aria-label":o("common.pinOptionsPanel"),onClick:s,icon:r?a.jsx(hk,{}):a.jsx(mk,{}),variant:"ghost",size:"sm",sx:{color:"base.500",_hover:{color:"base.600"},_active:{color:"base.700"},_dark:{color:"base.500",_hover:{color:"base.400"},_active:{color:"base.300"}},...t}})},dQ=Ce(Hr,e=>{const{shouldPinParametersPanel:t,shouldShowParametersPanel:n}=e;return{shouldPinParametersPanel:t,shouldShowParametersPanel:n}}),fQ=e=>{const{shouldPinParametersPanel:t,shouldShowParametersPanel:n}=F(dQ);return t&&n?a.jsxs(Ge,{sx:{position:"relative",h:"full",w:yy,flexShrink:0},children:[a.jsx(H,{sx:{gap:2,flexDirection:"column",h:"full",w:"full",position:"absolute",overflowY:"auto"},children:e.children}),a.jsx(SE,{sx:{position:"absolute",top:0,insetInlineEnd:0}})]}):null},Cy=p.memo(fQ),pQ=e=>{const{direction:t="horizontal",...n}=e,{colorMode:r}=So();return t==="horizontal"?a.jsx(P0,{children:a.jsx(H,{sx:{w:6,h:"full",justifyContent:"center",alignItems:"center"},...n,children:a.jsx(Ge,{sx:{w:.5,h:"calc(100% - 4px)",bg:Te("base.100","base.850")(r)}})})}):a.jsx(P0,{children:a.jsx(H,{sx:{w:"full",h:6,justifyContent:"center",alignItems:"center"},...n,children:a.jsx(Ge,{sx:{w:"calc(100% - 4px)",h:.5,bg:Te("base.100","base.850")(r)}})})})},wE=p.memo(pQ),hQ=Ce([rn,M8],({ui:e,system:t},n)=>{const{shouldShowImageDetails:r,shouldHidePreview:o,shouldShowProgressInViewer:s}=e,{progressImage:i,shouldAntialiasProgressImage:u}=t;return{shouldShowImageDetails:r,shouldHidePreview:o,imageName:n,progressImage:i,shouldShowProgressInViewer:s,shouldAntialiasProgressImage:u}},{memoizeOptions:{resultEqualityCheck:Wt}}),mQ=()=>{const{shouldShowImageDetails:e,imageName:t,progressImage:n,shouldShowProgressInViewer:r,shouldAntialiasProgressImage:o}=F(hQ),{handlePrevImage:s,handleNextImage:i,prevImageId:u,nextImageId:d,isOnLastImage:f,handleLoadMoreImages:h,areMoreImagesAvailable:m,isFetching:v}=Wj();Ke("left",()=>{s()},[u]),Ke("right",()=>{if(f&&m&&!v){h();return}f||i()},[d,f,m,h,v]);const{currentData:y,isLoading:S,isError:w,isSuccess:C}=Ks(t??Do.skipToken),k=p.useMemo(()=>{if(y)return{id:"current-image",payloadType:"IMAGE_DTO",payload:{imageDTO:y}}},[y]),P=p.useMemo(()=>({id:"current-image",actionType:"SET_CURRENT_IMAGE"}),[]);return a.jsxs(H,{sx:{width:"full",height:"full",alignItems:"center",justifyContent:"center",position:"relative"},children:[n&&r?a.jsx(Au,{src:n.dataURL,width:n.width,height:n.height,draggable:!1,sx:{objectFit:"contain",maxWidth:"full",maxHeight:"full",height:"auto",position:"absolute",borderRadius:"base",imageRendering:o?"auto":"pixelated"}}):a.jsx(Yi,{imageDTO:y,droppableData:P,draggableData:k,isUploadDisabled:!0,fitContainer:!0,dropLabel:"Set as Current Image"}),e&&y&&a.jsx(Ge,{sx:{position:"absolute",top:"0",width:"full",height:"full",borderRadius:"base"},children:a.jsx(Hj,{image:y})}),!e&&y&&a.jsx(Ge,{sx:{position:"absolute",top:"0",width:"full",height:"full",pointerEvents:"none"},children:a.jsx(Vj,{})})]})},gQ=p.memo(mQ),vQ=()=>a.jsxs(H,{sx:{position:"relative",flexDirection:"column",height:"100%",width:"100%",rowGap:4,alignItems:"center",justifyContent:"center"},children:[a.jsx(Bj,{}),a.jsx(gQ,{})]}),CE=()=>a.jsx(Ge,{layerStyle:"first",sx:{position:"relative",width:"100%",height:"100%",p:4,borderRadius:"base"},children:a.jsx(H,{sx:{width:"100%",height:"100%"},children:a.jsx(vQ,{})})}),yQ=e=>{const{label:t,activeLabel:n,children:r,defaultIsOpen:o=!1}=e,{isOpen:s,onToggle:i}=ya({defaultIsOpen:o}),{colorMode:u}=So();return a.jsxs(Ge,{children:[a.jsxs(H,{onClick:i,sx:{alignItems:"center",p:2,px:4,gap:2,borderTopRadius:"base",borderBottomRadius:s?0:"base",bg:s?Te("base.200","base.750")(u):Te("base.150","base.800")(u),color:Te("base.900","base.100")(u),_hover:{bg:s?Te("base.250","base.700")(u):Te("base.200","base.750")(u)},fontSize:"sm",fontWeight:600,cursor:"pointer",transitionProperty:"common",transitionDuration:"normal",userSelect:"none"},children:[t,a.jsx(No,{children:n&&a.jsx(bo.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}},children:a.jsx(Ue,{sx:{color:"accent.500",_dark:{color:"accent.300"}},children:n})},"statusText")}),a.jsx(Oa,{}),a.jsx(N1,{sx:{w:"1rem",h:"1rem",transform:s?"rotate(0deg)":"rotate(180deg)",transitionProperty:"common",transitionDuration:"normal"}})]}),a.jsx(gh,{in:s,animateOpacity:!0,style:{overflow:"unset"},children:a.jsx(Ge,{sx:{p:4,borderBottomRadius:"base",bg:Te("base.100","base.800")(u)},children:r})})]})},ko=p.memo(yQ),bQ=Ce(rn,e=>{const{combinatorial:t,isEnabled:n}=e.dynamicPrompts;return{combinatorial:t,isDisabled:!n}},Ct),xQ=()=>{const{combinatorial:e,isDisabled:t}=F(bQ),n=ne(),r=p.useCallback(()=>{n(D8())},[n]);return a.jsx(jn,{isDisabled:t,label:"Combinatorial Generation",isChecked:e,onChange:r})},SQ=Ce(rn,e=>{const{isEnabled:t}=e.dynamicPrompts;return{isEnabled:t}},Ct),wQ=()=>{const e=ne(),{isEnabled:t}=F(SQ),n=p.useCallback(()=>{e(A8())},[e]);return a.jsx(jn,{label:"Enable Dynamic Prompts",isChecked:t,onChange:n})},CQ=Ce(rn,e=>{const{maxPrompts:t,combinatorial:n,isEnabled:r}=e.dynamicPrompts,{min:o,sliderMax:s,inputMax:i}=e.config.sd.dynamicPrompts.maxPrompts;return{maxPrompts:t,min:o,sliderMax:s,inputMax:i,isDisabled:!r||!n}},Ct),kQ=()=>{const{maxPrompts:e,min:t,sliderMax:n,inputMax:r,isDisabled:o}=F(CQ),s=ne(),i=p.useCallback(d=>{s(N8(d))},[s]),u=p.useCallback(()=>{s(z8())},[s]);return a.jsx(vt,{label:"Max Prompts",isDisabled:o,min:t,max:n,value:e,onChange:i,sliderNumberInputProps:{max:r},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:u})},PQ=Ce(rn,e=>{const{isEnabled:t}=e.dynamicPrompts;return{activeLabel:t?"Enabled":void 0}},Ct),ky=()=>{const{activeLabel:e}=F(PQ);return Gn("dynamicPrompting").isFeatureEnabled?a.jsx(ko,{label:"Dynamic Prompts",activeLabel:e,children:a.jsxs(H,{sx:{gap:2,flexDir:"column"},children:[a.jsx(wQ,{}),a.jsx(xQ,{}),a.jsx(kQ,{})]})}):null},_Q=e=>{const t=ne(),{lora:n}=e,r=p.useCallback(i=>{t($8({id:n.id,weight:i}))},[t,n.id]),o=p.useCallback(()=>{t(L8(n.id))},[t,n.id]),s=p.useCallback(()=>{t(F8(n.id))},[t,n.id]);return a.jsxs(H,{sx:{gap:2.5,alignItems:"flex-end"},children:[a.jsx(vt,{label:n.model_name,value:n.weight,onChange:r,min:-1,max:2,step:.01,withInput:!0,withReset:!0,handleReset:o,withSliderMarks:!0,sliderMarks:[-1,0,1,2]}),a.jsx(je,{size:"sm",onClick:s,tooltip:"Remove LoRA","aria-label":"Remove LoRA",icon:a.jsx(io,{}),colorScheme:"error"})]})},jQ=p.memo(_Q),EQ=Ce(rn,({lora:e})=>{const{loras:t}=e;return{loras:t}},Ct),IQ=()=>{const{loras:e}=F(EQ);return Rs(e,t=>a.jsx(jQ,{lora:t},t.model_name))},kE=p.forwardRef(({label:e,tooltip:t,description:n,disabled:r,...o},s)=>a.jsx(qn,{label:t,placement:"top",hasArrow:!0,children:a.jsx(Ge,{ref:s,...o,children:a.jsxs(Ge,{children:[a.jsx(Jl,{children:e}),n&&a.jsx(Jl,{size:"xs",color:"base.600",children:n})]})})}));kE.displayName="IAIMantineSelectItemWithTooltip";const Py=p.memo(kE),OQ=e=>{const[t,n,r]=e.split("/");return{base_model:t,model_name:r}},$r={"sd-1":"Stable Diffusion 1.x","sd-2":"Stable Diffusion 2.x"},RQ=Ce(rn,e=>({currentModel:e.generation.model}),Ct),TQ=()=>{const e=ne(),{t}=pe(),{currentModel:n}=F(RQ),{data:r,isLoading:o}=Nu(),{data:s,isLoading:i}=_3(),u=p.useMemo(()=>{if(!r)return[];const h=[];return Xs(r.entities,(m,v)=>{m&&h.push({value:v,label:m.model_name,group:$r[m.base_model]})}),Xs(s==null?void 0:s.entities,(m,v)=>{m&&h.push({value:v,label:m.model_name,group:$r[m.base_model]})}),h},[r,s]),d=p.useMemo(()=>(r==null?void 0:r.entities[`${n==null?void 0:n.base_model}/main/${n==null?void 0:n.model_name}`])||(s==null?void 0:s.entities[`${n==null?void 0:n.base_model}/onnx/${n==null?void 0:n.model_name}`]),[r==null?void 0:r.entities,s==null?void 0:s.entities,n]),f=p.useCallback(h=>{if(!h)return;let m=B8(h);h.includes("onnx")&&(m=OQ(h)),e(wv(m))},[e]);return o||i?a.jsx(Kn,{label:t("modelManager.model"),placeholder:"Loading...",disabled:!0,data:[]}):a.jsx(Kn,{tooltip:d==null?void 0:d.description,label:t("modelManager.model"),value:d==null?void 0:d.id,placeholder:u.length>0?"Select a model":"No models available",data:u,error:u.length===0,disabled:u.length===0,onChange:f})},MQ=p.memo(TQ),DQ=Ce(rn,({lora:e})=>({loras:e.loras}),Ct),AQ=()=>{const e=ne(),{loras:t}=F(DQ),{data:n}=j3(),r=F(i=>i.generation.model),o=p.useMemo(()=>{if(!n)return[];const i=[];return Xs(n.entities,(u,d)=>{if(!u||d in t)return;const f=(r==null?void 0:r.base_model)!==u.base_model;i.push({value:d,label:u.model_name,disabled:f,group:$r[u.base_model],tooltip:f?`Incompatible base model: ${u.base_model}`:void 0})}),i.sort((u,d)=>u.disabled&&!d.disabled?1:-1)},[t,n,r==null?void 0:r.base_model]),s=p.useCallback(i=>{if(!i)return;const u=n==null?void 0:n.entities[i];u&&e(H8(u))},[e,n==null?void 0:n.entities]);return(n==null?void 0:n.ids.length)===0?a.jsx(H,{sx:{justifyContent:"center",p:2},children:a.jsx(Ue,{sx:{fontSize:"sm",color:"base.500",_dark:"base.700"},children:"No LoRAs Loaded"})}):a.jsx(Kn,{placeholder:o.length===0?"All LoRAs added":"Add LoRA",value:null,data:o,nothingFound:"No matching LoRAs",itemComponent:Py,disabled:o.length===0,filter:(i,u)=>{var d;return((d=u.label)==null?void 0:d.toLowerCase().includes(i.toLowerCase().trim()))||u.value.toLowerCase().includes(i.toLowerCase().trim())},onChange:s})},NQ=Ce(rn,e=>{const t=W8(e.lora.loras);return{activeLabel:t>0?`${t} Active`:void 0}},Ct),zQ=()=>{const{activeLabel:e}=F(NQ);return Gn("lora").isFeatureEnabled?a.jsx(ko,{label:"LoRA",activeLabel:e,children:a.jsxs(H,{sx:{flexDir:"column",gap:2},children:[a.jsx(AQ,{}),a.jsx(IQ,{})]})}):null},_y=p.memo(zQ),$Q=Ce(rn,e=>({activeLabel:e.generation.clipSkip>0?"Clip Skip":void 0}),Ct);function jy(){const{activeLabel:e}=F($Q);return F(n=>n.ui.shouldShowAdvancedOptions)&&a.jsx(ko,{label:"Advanced",activeLabel:e,children:a.jsx(H,{sx:{flexDir:"column",gap:2},children:a.jsx(V8,{})})})}const LQ=e=>{const r=e.split(",").map(o=>o.split(":")).map(o=>({seed:Number(o[0]),weight:Number(o[1])}));return Ey(r)?r:!1},Ey=e=>typeof e=="string"?!!LQ(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)})),FQ=Ce([rn,Sr],(e,t)=>{const{generation:n,system:r,batch:o}=e,{shouldGenerateVariations:s,seedWeights:i,initialImage:u,seed:d}=n,{isProcessing:f,isConnected:h}=r,{isEnabled:m,asInitialImage:v,imageNames:y}=o;let S=!0;const w=[];t==="img2img"&&!u&&!(v&&y.length>1)&&(S=!1,w.push("No initial image selected"));const{isSuccess:C}=U8.endpoints.getMainModels.select()(e);return C||(S=!1,w.push("Models are not loaded")),f&&(S=!1,w.push("System Busy")),h||(S=!1,w.push("System Disconnected")),s&&(!(Ey(i)||i==="")||d===-1)&&(S=!1,w.push("Seed-Weights badly formatted.")),{isReady:S,reasonsWhyNotReady:w}},Ct),Wr=()=>{const{isReady:e}=F(FQ);return e},BQ=Ce(hi,e=>Rs(G8,n=>({label:n.label,value:n.type})).filter(n=>!e.sd.disabledControlNetModels.includes(n.value))),HQ=e=>{const{controlNetId:t,model:n}=e,r=F(BQ),o=ne(),s=Wr(),i=p.useCallback(u=>{o(q8({controlNetId:t,model:u}))},[t,o]);return a.jsx(Kn,{data:r,value:n,onChange:i,disabled:!s,tooltip:n})},WQ=p.memo(HQ),VQ=e=>{const{controlNetId:t,weight:n,mini:r=!1}=e,o=ne(),s=p.useCallback(i=>{o(K8({controlNetId:t,weight:i}))},[t,o]);return a.jsx(vt,{label:"Weight",sliderFormLabelProps:{pb:2},value:n,onChange:s,min:-1,max:1,step:.01,withSliderMarks:!r,sliderMarks:[-1,0,1]})},UQ=p.memo(VQ),GQ=Ce(E3,e=>{const{pendingControlImages:t}=e;return{pendingControlImages:t}},Ct),qQ=e=>{const{height:t}=e,{controlNetId:n,controlImage:r,processedControlImage:o,processorType:s}=e.controlNet,i=ne(),{pendingControlImages:u}=F(GQ),[d,f]=p.useState(!1),{currentData:h,isLoading:m,isError:v,isSuccess:y}=Ks(r??Do.skipToken),{currentData:S,isLoading:w,isError:C,isSuccess:k}=Ks(o??Do.skipToken),P=p.useCallback(()=>{i(Y8({controlNetId:n,controlImage:null}))},[n,i]),j=p.useCallback(()=>{f(!0)},[]),E=p.useCallback(()=>{f(!1)},[]),O=p.useMemo(()=>{if(h)return{id:n,payloadType:"IMAGE_DTO",payload:{imageDTO:h}}},[h,n]),I=p.useMemo(()=>({id:n,actionType:"SET_CONTROLNET_IMAGE",context:{controlNetId:n}}),[n]),R=p.useMemo(()=>({type:"SET_CONTROLNET_IMAGE",controlNetId:n}),[n]),T=h&&S&&!d&&!u.includes(n)&&s!=="none";return a.jsxs(H,{onMouseEnter:j,onMouseLeave:E,sx:{position:"relative",w:"full",h:t,alignItems:"center",justifyContent:"center"},children:[a.jsx(Yi,{draggableData:O,droppableData:I,imageDTO:h,isDropDisabled:T,onClickReset:P,postUploadAction:R,resetTooltip:"Reset Control Image",withResetIcon:!!h}),a.jsx(Ge,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",opacity:T?1:0,transitionProperty:"common",transitionDuration:"normal",pointerEvents:"none"},children:a.jsx(Yi,{draggableData:O,droppableData:I,imageDTO:S,isUploadDisabled:!0,onClickReset:P,resetTooltip:"Reset Control Image",withResetIcon:!!h})}),u.includes(n)&&a.jsx(H,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",alignItems:"center",justifyContent:"center",opacity:.8,borderRadius:"base",bg:"base.400",_dark:{bg:"base.900"}},children:a.jsx(ui,{size:"xl",sx:{color:"base.100",_dark:{color:"base.400"}}})})]})},n4=p.memo(qQ),Ts=()=>{const e=ne();return p.useCallback((n,r)=>{e(X8({controlNetId:n,changes:r}))},[e])};function Ms(e){return a.jsx(H,{sx:{flexDirection:"column",gap:2},children:e.children})}const r4=os.canny_image_processor.default,KQ=e=>{const{controlNetId:t,processorNode:n}=e,{low_threshold:r,high_threshold:o}=n,s=Wr(),i=Ts(),u=p.useCallback(m=>{i(t,{low_threshold:m})},[t,i]),d=p.useCallback(()=>{i(t,{low_threshold:r4.low_threshold})},[t,i]),f=p.useCallback(m=>{i(t,{high_threshold:m})},[t,i]),h=p.useCallback(()=>{i(t,{high_threshold:r4.high_threshold})},[t,i]);return a.jsxs(Ms,{children:[a.jsx(vt,{isDisabled:!s,label:"Low Threshold",value:r,onChange:u,handleReset:d,withReset:!0,min:0,max:255,withInput:!0,withSliderMarks:!0}),a.jsx(vt,{isDisabled:!s,label:"High Threshold",value:o,onChange:f,handleReset:h,withReset:!0,min:0,max:255,withInput:!0,withSliderMarks:!0})]})},YQ=p.memo(KQ),o4=os.hed_image_processor.default,XQ=e=>{const{controlNetId:t,processorNode:{detect_resolution:n,image_resolution:r,scribble:o}}=e,s=Wr(),i=Ts(),u=p.useCallback(v=>{i(t,{detect_resolution:v})},[t,i]),d=p.useCallback(v=>{i(t,{image_resolution:v})},[t,i]),f=p.useCallback(v=>{i(t,{scribble:v.target.checked})},[t,i]),h=p.useCallback(()=>{i(t,{detect_resolution:o4.detect_resolution})},[t,i]),m=p.useCallback(()=>{i(t,{image_resolution:o4.image_resolution})},[t,i]);return a.jsxs(Ms,{children:[a.jsx(vt,{label:"Detect Resolution",value:n,onChange:u,handleReset:h,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!s}),a.jsx(vt,{label:"Image Resolution",value:r,onChange:d,handleReset:m,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!s}),a.jsx(jn,{label:"Scribble",isChecked:o,onChange:f,isDisabled:!s})]})},QQ=p.memo(XQ),s4=os.lineart_image_processor.default,ZQ=e=>{const{controlNetId:t,processorNode:n}=e,{image_resolution:r,detect_resolution:o,coarse:s}=n,i=Ts(),u=Wr(),d=p.useCallback(y=>{i(t,{detect_resolution:y})},[t,i]),f=p.useCallback(y=>{i(t,{image_resolution:y})},[t,i]),h=p.useCallback(()=>{i(t,{detect_resolution:s4.detect_resolution})},[t,i]),m=p.useCallback(()=>{i(t,{image_resolution:s4.image_resolution})},[t,i]),v=p.useCallback(y=>{i(t,{coarse:y.target.checked})},[t,i]);return a.jsxs(Ms,{children:[a.jsx(vt,{label:"Detect Resolution",value:o,onChange:d,handleReset:h,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!u}),a.jsx(vt,{label:"Image Resolution",value:r,onChange:f,handleReset:m,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!u}),a.jsx(jn,{label:"Coarse",isChecked:s,onChange:v,isDisabled:!u})]})},JQ=p.memo(ZQ),a4=os.lineart_anime_image_processor.default,eZ=e=>{const{controlNetId:t,processorNode:n}=e,{image_resolution:r,detect_resolution:o}=n,s=Ts(),i=Wr(),u=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:a4.detect_resolution})},[t,s]),h=p.useCallback(()=>{s(t,{image_resolution:a4.image_resolution})},[t,s]);return a.jsxs(Ms,{children:[a.jsx(vt,{label:"Detect Resolution",value:o,onChange:u,handleReset:f,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!i}),a.jsx(vt,{label:"Image Resolution",value:r,onChange:d,handleReset:h,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!i})]})},tZ=p.memo(eZ),Yc=os.content_shuffle_image_processor.default,nZ=e=>{const{controlNetId:t,processorNode:n}=e,{image_resolution:r,detect_resolution:o,w:s,h:i,f:u}=n,d=Ts(),f=Wr(),h=p.useCallback(E=>{d(t,{detect_resolution:E})},[t,d]),m=p.useCallback(()=>{d(t,{detect_resolution:Yc.detect_resolution})},[t,d]),v=p.useCallback(E=>{d(t,{image_resolution:E})},[t,d]),y=p.useCallback(()=>{d(t,{image_resolution:Yc.image_resolution})},[t,d]),S=p.useCallback(E=>{d(t,{w:E})},[t,d]),w=p.useCallback(()=>{d(t,{w:Yc.w})},[t,d]),C=p.useCallback(E=>{d(t,{h:E})},[t,d]),k=p.useCallback(()=>{d(t,{h:Yc.h})},[t,d]),P=p.useCallback(E=>{d(t,{f:E})},[t,d]),j=p.useCallback(()=>{d(t,{f:Yc.f})},[t,d]);return a.jsxs(Ms,{children:[a.jsx(vt,{label:"Detect Resolution",value:o,onChange:h,handleReset:m,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!f}),a.jsx(vt,{label:"Image Resolution",value:r,onChange:v,handleReset:y,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!f}),a.jsx(vt,{label:"W",value:s,onChange:S,handleReset:w,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!f}),a.jsx(vt,{label:"H",value:i,onChange:C,handleReset:k,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!f}),a.jsx(vt,{label:"F",value:u,onChange:P,handleReset:j,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!f})]})},rZ=p.memo(nZ),i4=os.mediapipe_face_processor.default,oZ=e=>{const{controlNetId:t,processorNode:n}=e,{max_faces:r,min_confidence:o}=n,s=Ts(),i=Wr(),u=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:i4.max_faces})},[t,s]),h=p.useCallback(()=>{s(t,{min_confidence:i4.min_confidence})},[t,s]);return a.jsxs(Ms,{children:[a.jsx(vt,{label:"Max Faces",value:r,onChange:u,handleReset:f,withReset:!0,min:1,max:20,withInput:!0,withSliderMarks:!0,isDisabled:!i}),a.jsx(vt,{label:"Min Confidence",value:o,onChange:d,handleReset:h,withReset:!0,min:0,max:1,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:!i})]})},sZ=p.memo(oZ),l4=os.midas_depth_image_processor.default,aZ=e=>{const{controlNetId:t,processorNode:n}=e,{a_mult:r,bg_th:o}=n,s=Ts(),i=Wr(),u=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:l4.a_mult})},[t,s]),h=p.useCallback(()=>{s(t,{bg_th:l4.bg_th})},[t,s]);return a.jsxs(Ms,{children:[a.jsx(vt,{label:"a_mult",value:r,onChange:u,handleReset:f,withReset:!0,min:0,max:20,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:!i}),a.jsx(vt,{label:"bg_th",value:o,onChange:d,handleReset:h,withReset:!0,min:0,max:20,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:!i})]})},iZ=p.memo(aZ),_f=os.mlsd_image_processor.default,lZ=e=>{const{controlNetId:t,processorNode:n}=e,{image_resolution:r,detect_resolution:o,thr_d:s,thr_v:i}=n,u=Ts(),d=Wr(),f=p.useCallback(k=>{u(t,{detect_resolution:k})},[t,u]),h=p.useCallback(k=>{u(t,{image_resolution:k})},[t,u]),m=p.useCallback(k=>{u(t,{thr_d:k})},[t,u]),v=p.useCallback(k=>{u(t,{thr_v:k})},[t,u]),y=p.useCallback(()=>{u(t,{detect_resolution:_f.detect_resolution})},[t,u]),S=p.useCallback(()=>{u(t,{image_resolution:_f.image_resolution})},[t,u]),w=p.useCallback(()=>{u(t,{thr_d:_f.thr_d})},[t,u]),C=p.useCallback(()=>{u(t,{thr_v:_f.thr_v})},[t,u]);return a.jsxs(Ms,{children:[a.jsx(vt,{label:"Detect Resolution",value:o,onChange:f,handleReset:y,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!d}),a.jsx(vt,{label:"Image Resolution",value:r,onChange:h,handleReset:S,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!d}),a.jsx(vt,{label:"W",value:s,onChange:m,handleReset:w,withReset:!0,min:0,max:1,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:!d}),a.jsx(vt,{label:"H",value:i,onChange:v,handleReset:C,withReset:!0,min:0,max:1,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:!d})]})},cZ=p.memo(lZ),c4=os.normalbae_image_processor.default,uZ=e=>{const{controlNetId:t,processorNode:n}=e,{image_resolution:r,detect_resolution:o}=n,s=Ts(),i=Wr(),u=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:c4.detect_resolution})},[t,s]),h=p.useCallback(()=>{s(t,{image_resolution:c4.image_resolution})},[t,s]);return a.jsxs(Ms,{children:[a.jsx(vt,{label:"Detect Resolution",value:o,onChange:u,handleReset:f,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!i}),a.jsx(vt,{label:"Image Resolution",value:r,onChange:d,handleReset:h,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!i})]})},dZ=p.memo(uZ),u4=os.openpose_image_processor.default,fZ=e=>{const{controlNetId:t,processorNode:n}=e,{image_resolution:r,detect_resolution:o,hand_and_face:s}=n,i=Ts(),u=Wr(),d=p.useCallback(y=>{i(t,{detect_resolution:y})},[t,i]),f=p.useCallback(y=>{i(t,{image_resolution:y})},[t,i]),h=p.useCallback(()=>{i(t,{detect_resolution:u4.detect_resolution})},[t,i]),m=p.useCallback(()=>{i(t,{image_resolution:u4.image_resolution})},[t,i]),v=p.useCallback(y=>{i(t,{hand_and_face:y.target.checked})},[t,i]);return a.jsxs(Ms,{children:[a.jsx(vt,{label:"Detect Resolution",value:o,onChange:d,handleReset:h,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!u}),a.jsx(vt,{label:"Image Resolution",value:r,onChange:f,handleReset:m,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!u}),a.jsx(jn,{label:"Hand and Face",isChecked:s,onChange:v,isDisabled:!u})]})},pZ=p.memo(fZ),d4=os.pidi_image_processor.default,hZ=e=>{const{controlNetId:t,processorNode:n}=e,{image_resolution:r,detect_resolution:o,scribble:s,safe:i}=n,u=Ts(),d=Wr(),f=p.useCallback(w=>{u(t,{detect_resolution:w})},[t,u]),h=p.useCallback(w=>{u(t,{image_resolution:w})},[t,u]),m=p.useCallback(()=>{u(t,{detect_resolution:d4.detect_resolution})},[t,u]),v=p.useCallback(()=>{u(t,{image_resolution:d4.image_resolution})},[t,u]),y=p.useCallback(w=>{u(t,{scribble:w.target.checked})},[t,u]),S=p.useCallback(w=>{u(t,{safe:w.target.checked})},[t,u]);return a.jsxs(Ms,{children:[a.jsx(vt,{label:"Detect Resolution",value:o,onChange:f,handleReset:m,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!d}),a.jsx(vt,{label:"Image Resolution",value:r,onChange:h,handleReset:v,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!d}),a.jsx(jn,{label:"Scribble",isChecked:s,onChange:y}),a.jsx(jn,{label:"Safe",isChecked:i,onChange:S,isDisabled:!d})]})},mZ=p.memo(hZ),gZ=e=>null,vZ=p.memo(gZ),yZ=e=>{const{controlNetId:t,processorNode:n}=e;return n.type==="canny_image_processor"?a.jsx(YQ,{controlNetId:t,processorNode:n}):n.type==="hed_image_processor"?a.jsx(QQ,{controlNetId:t,processorNode:n}):n.type==="lineart_image_processor"?a.jsx(JQ,{controlNetId:t,processorNode:n}):n.type==="content_shuffle_image_processor"?a.jsx(rZ,{controlNetId:t,processorNode:n}):n.type==="lineart_anime_image_processor"?a.jsx(tZ,{controlNetId:t,processorNode:n}):n.type==="mediapipe_face_processor"?a.jsx(sZ,{controlNetId:t,processorNode:n}):n.type==="midas_depth_image_processor"?a.jsx(iZ,{controlNetId:t,processorNode:n}):n.type==="mlsd_image_processor"?a.jsx(cZ,{controlNetId:t,processorNode:n}):n.type==="normalbae_image_processor"?a.jsx(dZ,{controlNetId:t,processorNode:n}):n.type==="openpose_image_processor"?a.jsx(pZ,{controlNetId:t,processorNode:n}):n.type==="pidi_image_processor"?a.jsx(mZ,{controlNetId:t,processorNode:n}):n.type==="zoe_depth_image_processor"?a.jsx(vZ,{controlNetId:t,processorNode:n}):null},bZ=p.memo(yZ),xZ=e=>{const{controlNetId:t,shouldAutoConfig:n}=e,r=ne(),o=Wr(),s=p.useCallback(()=>{r(Q8({controlNetId:t}))},[t,r]);return a.jsx(jn,{label:"Auto configure processor","aria-label":"Auto configure processor",isChecked:n,onChange:s,isDisabled:!o})},SZ=p.memo(xZ),uv={mt:1.5,fontSize:"2xs",fontWeight:"500",color:"base.400"},f4=e=>`${Math.round(e*100)}%`,wZ=e=>{const{controlNetId:t,beginStepPct:n,mini:r=!1,endStepPct:o}=e,s=ne();pe();const i=p.useCallback(u=>{s(Wx({controlNetId:t,beginStepPct:u[0]})),s(Vx({controlNetId:t,endStepPct:u[1]}))},[t,s]);return p.useCallback(()=>{s(Wx({controlNetId:t,beginStepPct:0})),s(Vx({controlNetId:t,endStepPct:1}))},[t,s]),a.jsxs(lr,{children:[a.jsx(mr,{children:"Begin / End Step Percentage"}),a.jsx(oi,{w:"100%",gap:2,alignItems:"center",children:a.jsxs(B6,{"aria-label":["Begin Step %","End Step %"],value:[n,o],onChange:i,min:0,max:1,step:.01,minStepsBetweenThumbs:5,children:[a.jsx(H6,{children:a.jsx(W6,{})}),a.jsx(qn,{label:f4(n),placement:"top",hasArrow:!0,children:a.jsx(Uv,{index:0})}),a.jsx(qn,{label:f4(o),placement:"top",hasArrow:!0,children:a.jsx(Uv,{index:1})}),!r&&a.jsxs(a.Fragment,{children:[a.jsx(Df,{value:0,sx:{insetInlineStart:"0 !important",insetInlineEnd:"unset !important",...uv},children:"0%"}),a.jsx(Df,{value:.5,sx:{...uv},children:"50%"}),a.jsx(Df,{value:1,sx:{insetInlineStart:"unset !important",insetInlineEnd:"0 !important",...uv},children:"100%"})]})]})})]})},CZ=p.memo(wZ),kZ=[{label:"Balanced",value:"balanced"},{label:"Prompt",value:"more_prompt"},{label:"Control",value:"more_control"},{label:"Mega Control",value:"unbalanced"}];function PZ(e){const{controlNetId:t,controlMode:n=!1}=e,r=ne(),{t:o}=pe(),s=p.useCallback(i=>{r(Z8({controlNetId:t,controlMode:i}))},[t,r]);return a.jsx(Kn,{label:o("parameters.controlNetControlMode"),data:kZ,value:String(n),onChange:s})}const _Z=Ce(hi,e=>Rs(os,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)),Ct),jZ=e=>{const{controlNetId:t,processorNode:n}=e,r=ne(),o=Wr(),s=F(_Z),i=p.useCallback(u=>{r(J8({controlNetId:t,processorType:u}))},[t,r]);return a.jsx(Kn,{label:"Processor",value:n.type??"canny_image_processor",data:s,onChange:i,disabled:!o})},EZ=p.memo(jZ),IZ=e=>{const{controlNetId:t,isEnabled:n,model:r,weight:o,beginStepPct:s,endStepPct:i,controlMode:u,controlImage:d,processedControlImage:f,processorNode:h,processorType:m,shouldAutoConfig:v}=e.controlNet,y=ne(),[S,w]=CX(!1),{colorMode:C}=So(),k=p.useCallback(()=>{y(e7({controlNetId:t}))},[t,y]),P=p.useCallback(()=>{y(I3({controlNetId:Ai(),controlNet:e.controlNet}))},[y,e.controlNet]),j=p.useCallback(()=>{y(t7({controlNetId:t}))},[t,y]);return a.jsxs(H,{sx:{flexDir:"column",gap:2,p:3,bg:Te("base.200","base.850")(C),borderRadius:"base",position:"relative"},children:[a.jsxs(H,{sx:{gap:2},children:[a.jsx(jn,{tooltip:"Toggle","aria-label":"Toggle",isChecked:n,onChange:j}),a.jsx(Ge,{sx:{w:"full",minW:0,opacity:n?1:.5,pointerEvents:n?"auto":"none",transitionProperty:"common",transitionDuration:"0.1s"},children:a.jsx(WQ,{controlNetId:t,model:r})}),a.jsx(je,{size:"sm",tooltip:"Duplicate","aria-label":"Duplicate",onClick:P,icon:a.jsx(bc,{})}),a.jsx(je,{size:"sm",tooltip:"Delete","aria-label":"Delete",colorScheme:"error",onClick:k,icon:a.jsx(io,{})}),a.jsx(je,{size:"sm","aria-label":"Show All Options",onClick:w,variant:"link",icon:a.jsx(N1,{sx:{boxSize:4,color:Te("base.700","base.300")(C),transform:S?"rotate(0deg)":"rotate(180deg)",transitionProperty:"common",transitionDuration:"normal"}})}),!v&&a.jsx(Ge,{sx:{position:"absolute",w:1.5,h:1.5,borderRadius:"full",bg:Te("error.700","error.200")(C),top:4,insetInlineEnd:4}})]}),n&&a.jsxs(a.Fragment,{children:[a.jsxs(H,{sx:{w:"full",flexDirection:"column"},children:[a.jsxs(H,{sx:{gap:4,w:"full"},children:[a.jsxs(H,{sx:{flexDir:"column",gap:3,w:"full",paddingInlineStart:1,paddingInlineEnd:S?1:0,pb:2,justifyContent:"space-between"},children:[a.jsx(UQ,{controlNetId:t,weight:o,mini:!S}),a.jsx(CZ,{controlNetId:t,beginStepPct:s,endStepPct:i,mini:!S})]}),!S&&a.jsx(H,{sx:{alignItems:"center",justifyContent:"center",h:24,w:24,aspectRatio:"1/1"},children:a.jsx(n4,{controlNet:e.controlNet,height:24})})]}),a.jsx(PZ,{controlNetId:t,controlMode:u})]}),S&&a.jsxs(a.Fragment,{children:[a.jsx(Ge,{mt:2,children:a.jsx(n4,{controlNet:e.controlNet,height:96})}),a.jsx(EZ,{controlNetId:t,processorNode:h}),a.jsx(bZ,{controlNetId:t,processorNode:h}),a.jsx(SZ,{controlNetId:t,shouldAutoConfig:v})]})]})]})},OZ=p.memo(IZ),RZ=Ce(rn,e=>{const{isEnabled:t}=e.controlNet;return{isEnabled:t}},Ct),TZ=()=>{const{isEnabled:e}=F(RZ),t=ne(),n=p.useCallback(()=>{t(n7())},[t]);return a.jsx(jn,{label:"Enable ControlNet",isChecked:e,onChange:n})},MZ=Ce(E3,e=>{const{controlNets:t,isEnabled:n}=e,r=r7(t),o=n&&r.length>0?`${r.length} Active`:void 0;return{controlNetsArray:Rs(t),activeLabel:o}},Ct),DZ=()=>{pe();const{controlNetsArray:e,activeLabel:t}=F(MZ),n=Gn("controlNet").isFeatureDisabled,r=ne(),o=p.useCallback(()=>{r(I3({controlNetId:Ai()}))},[r]);return n?null:a.jsx(ko,{label:"ControlNet",activeLabel:t,children:a.jsxs(H,{sx:{flexDir:"column",gap:3},children:[a.jsx(TZ,{}),e.map((s,i)=>a.jsxs(p.Fragment,{children:[i>0&&a.jsx(Ra,{}),a.jsx(OZ,{controlNet:s})]},s.controlNetId)),a.jsx(Yt,{flexGrow:1,onClick:o,children:"Add ControlNet"})]})})},Iy=p.memo(DZ),Oy=e=>{e.stopPropagation()},AZ=rt((e,t)=>{const n=ne(),r=p.useCallback(s=>{s.shiftKey&&n(rs(!0))},[n]),o=p.useCallback(s=>{s.shiftKey||n(rs(!1))},[n]);return a.jsx(G6,{ref:t,onPaste:Oy,onKeyDown:r,onKeyUp:o,...e})}),PE=p.memo(AZ),NZ=e=>{const{onClick:t}=e;return a.jsx(je,{size:"sm","aria-label":"Add Embedding",tooltip:"Add Embedding",icon:a.jsx(I1,{}),sx:{p:2,color:"base.500",_hover:{color:"base.600"},_active:{color:"base.700"},_dark:{color:"base.500",_hover:{color:"base.400"},_active:{color:"base.300"}}},variant:"link",onClick:t})},_E=p.memo(NZ),jE=e=>{const{onSelect:t,isOpen:n,onClose:r,children:o}=e,{data:s}=o7(),i=p.useRef(null),u=F(h=>h.generation.model),d=p.useMemo(()=>{if(!s)return[];const h=[];return Xs(s.entities,(m,v)=>{if(!m)return;const y=(u==null?void 0:u.base_model)!==m.base_model;h.push({value:m.model_name,label:m.model_name,group:$r[m.base_model],disabled:y,tooltip:y?`Incompatible base model: ${m.base_model}`:void 0})}),h.sort((m,v)=>m.disabled&&!v.disabled?1:-1)},[s,u==null?void 0:u.base_model]),f=p.useCallback(h=>{h&&t(h)},[t]);return a.jsxs(w1,{initialFocusRef:i,isOpen:n,onClose:r,placement:"bottom",openDelay:0,closeDelay:0,closeOnBlur:!0,returnFocusOnClose:!0,children:[a.jsx(S1,{children:o}),a.jsx(C1,{sx:{p:0,top:-1,shadow:"dark-lg",borderColor:"accent.300",borderWidth:"2px",borderStyle:"solid",_dark:{borderColor:"accent.400"}},children:a.jsx(A6,{sx:{p:0,w:`calc(${yy} - 2rem )`},children:d.length===0?a.jsx(H,{sx:{justifyContent:"center",p:2},children:a.jsx(Ue,{sx:{fontSize:"sm",color:"base.500",_dark:"base.700"},children:"No Embeddings Loaded"})}):a.jsx(Kn,{inputRef:i,autoFocus:!0,placeholder:"Add Embedding",value:null,data:d,nothingFound:"No matching Embeddings",itemComponent:Py,disabled:d.length===0,onDropdownClose:r,filter:(h,m)=>{var v;return((v=m.label)==null?void 0:v.toLowerCase().includes(h.toLowerCase().trim()))||m.value.toLowerCase().includes(h.toLowerCase().trim())},onChange:f})})})]})},Ry=()=>{const e=F(m=>m.generation.negativePrompt),t=p.useRef(null),{isOpen:n,onClose:r,onOpen:o}=ya(),s=ne(),{t:i}=pe(),u=p.useCallback(m=>{s(au(m.target.value))},[s]),d=p.useCallback(m=>{m.key==="<"&&o()},[o]),f=p.useCallback(m=>{if(!t.current)return;const v=t.current.selectionStart;if(v===void 0)return;let y=e.slice(0,v);y[y.length-1]!=="<"&&(y+="<"),y+=`${m}>`;const S=y.length;y+=e.slice(v),hc.flushSync(()=>{s(au(y))}),t.current.selectionEnd=S,r()},[s,r,e]),h=Gn("embedding").isFeatureEnabled;return a.jsxs(lr,{children:[a.jsx(jE,{isOpen:n,onClose:r,onSelect:f,children:a.jsx(PE,{id:"negativePrompt",name:"negativePrompt",ref:t,value:e,placeholder:i("parameters.negativePromptPlaceholder"),onChange:u,resize:"vertical",fontSize:"sm",minH:16,...h&&{onKeyDown:d}})}),!n&&h&&a.jsx(Ge,{sx:{position:"absolute",top:0,insetInlineEnd:0},children:a.jsx(_E,{onClick:o})})]})},zZ=Ce([rn,Sr],({generation:e,ui:t},n)=>({shouldPinParametersPanel:t.shouldPinParametersPanel,prompt:e.positivePrompt,activeTabName:n}),{memoizeOptions:{resultEqualityCheck:Wt}}),Ty=()=>{const e=ne(),{prompt:t,shouldPinParametersPanel:n,activeTabName:r}=F(zZ),o=Wr(),s=p.useRef(null),{isOpen:i,onClose:u,onOpen:d}=ya(),{t:f}=pe(),h=p.useCallback(S=>{e(su(S.target.value))},[e]);Ke("alt+a",()=>{var S;(S=s.current)==null||S.focus()},[]);const m=p.useCallback(S=>{if(!s.current)return;const w=s.current.selectionStart;if(w===void 0)return;let C=t.slice(0,w);C[C.length-1]!=="<"&&(C+="<"),C+=`${S}>`;const k=C.length;C+=t.slice(w),hc.flushSync(()=>{e(su(C))}),s.current.selectionStart=k,s.current.selectionEnd=k,u()},[e,u,t]),v=Gn("embedding").isFeatureEnabled,y=p.useCallback(S=>{S.key==="Enter"&&S.shiftKey===!1&&o&&(S.preventDefault(),e(X0()),e(Q0(r))),v&&S.key==="<"&&d()},[o,e,r,d,v]);return a.jsxs(Ge,{position:"relative",children:[a.jsx(lr,{children:a.jsx(jE,{isOpen:i,onClose:u,onSelect:m,children:a.jsx(PE,{id:"prompt",name:"prompt",ref:s,value:t,placeholder:f("parameters.positivePromptPlaceholder"),onChange:h,onKeyDown:y,resize:"vertical",minH:32})})}),!i&&v&&a.jsx(Ge,{sx:{position:"absolute",top:n?6:0,insetInlineEnd:0},children:a.jsx(_E,{onClick:d})})]})},$Z=Ce(rn,e=>{const{shouldUseNoiseSettings:t,shouldUseCpuNoise:n}=e.generation;return{isDisabled:!t,shouldUseCpuNoise:n}},Ct),LZ=()=>{const e=ne(),{isDisabled:t,shouldUseCpuNoise:n}=F($Z);pe();const r=o=>e(s7(o.target.checked));return a.jsx(jn,{isDisabled:t,label:"Use CPU Noise",isChecked:n,onChange:r})},FZ=Ce(rn,e=>{const{shouldUseNoiseSettings:t,threshold:n}=e.generation;return{isDisabled:!t,threshold:n}},Ct);function BZ(){const e=ne(),{threshold:t,isDisabled:n}=F(FZ),{t:r}=pe();return a.jsx(vt,{isDisabled:n,label:r("parameters.noiseThreshold"),min:0,max:20,step:.1,onChange:o=>e(Ux(o)),handleReset:()=>e(Ux(0)),value:t,withInput:!0,withReset:!0,withSliderMarks:!0})}const HZ=()=>{const e=ne(),t=F(r=>r.generation.shouldUseNoiseSettings);pe();const n=r=>e(a7(r.target.checked));return a.jsx(jn,{label:"Enable Noise Settings",isChecked:t,onChange:n})},WZ=Ce(rn,e=>{const{shouldUseNoiseSettings:t,perlin:n}=e.generation;return{isDisabled:!t,perlin:n}},Ct);function VZ(){const e=ne(),{perlin:t,isDisabled:n}=F(WZ),{t:r}=pe();return a.jsx(vt,{isDisabled:n,label:r("parameters.perlinNoise"),min:0,max:1,step:.05,onChange:o=>e(Gx(o)),handleReset:()=>e(Gx(0)),value:t,withInput:!0,withReset:!0,withSliderMarks:!0})}const UZ=Ce(rn,e=>{const{shouldUseNoiseSettings:t}=e.generation;return{activeLabel:t?"Enabled":void 0}},Ct),GZ=()=>{const{t:e}=pe(),t=Gn("noise").isFeatureEnabled,n=Gn("perlinNoise").isFeatureEnabled,r=Gn("noiseThreshold").isFeatureEnabled,{activeLabel:o}=F(UZ);return t?a.jsx(ko,{label:e("parameters.noiseSettings"),activeLabel:o,children:a.jsxs(H,{sx:{gap:2,flexDirection:"column"},children:[a.jsx(HZ,{}),a.jsx(LZ,{}),n&&a.jsx(VZ,{}),r&&a.jsx(BZ,{})]})}):null},EE=p.memo(GZ),qZ=Ce(ss,e=>{const{seamlessXAxis:t}=e;return{seamlessXAxis:t}},Ct),KZ=()=>{const{t:e}=pe(),{seamlessXAxis:t}=F(qZ),n=ne(),r=p.useCallback(o=>{n(i7(o.target.checked))},[n]);return a.jsx(jn,{label:e("parameters.seamlessXAxis"),"aria-label":e("parameters.seamlessXAxis"),isChecked:t,onChange:r})},YZ=p.memo(KZ),XZ=Ce(ss,e=>{const{seamlessYAxis:t}=e;return{seamlessYAxis:t}},Ct),QZ=()=>{const{t:e}=pe(),{seamlessYAxis:t}=F(XZ),n=ne(),r=p.useCallback(o=>{n(l7(o.target.checked))},[n]);return a.jsx(jn,{label:e("parameters.seamlessYAxis"),"aria-label":e("parameters.seamlessYAxis"),isChecked:t,onChange:r})},ZZ=p.memo(QZ),JZ=(e,t)=>{if(e&&t)return"X & Y";if(e)return"X";if(t)return"Y"},eJ=Ce(ss,e=>{const{seamlessXAxis:t,seamlessYAxis:n}=e;return{activeLabel:JZ(t,n)}},Ct),tJ=()=>{const{t:e}=pe(),{activeLabel:t}=F(eJ);return Gn("seamless").isFeatureEnabled?a.jsx(ko,{label:e("parameters.seamlessTiling"),activeLabel:t,children:a.jsxs(H,{sx:{gap:5},children:[a.jsx(Ge,{flexGrow:1,children:a.jsx(YZ,{})}),a.jsx(Ge,{flexGrow:1,children:a.jsx(ZZ,{})})]})}):null},IE=p.memo(tJ);function nJ(){const e=F(o=>o.generation.horizontalSymmetrySteps),t=F(o=>o.generation.steps),n=ne(),{t:r}=pe();return a.jsx(vt,{label:r("parameters.hSymmetryStep"),value:e,onChange:o=>n(qx(o)),min:0,max:t,step:1,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>n(qx(0))})}function rJ(){const e=F(o=>o.generation.verticalSymmetrySteps),t=F(o=>o.generation.steps),n=ne(),{t:r}=pe();return a.jsx(vt,{label:r("parameters.vSymmetryStep"),value:e,onChange:o=>n(Kx(o)),min:0,max:t,step:1,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>n(Kx(0))})}function oJ(){const e=F(n=>n.generation.shouldUseSymmetry),t=ne();return a.jsx(jn,{label:"Enable Symmetry",isChecked:e,onChange:n=>t(c7(n.target.checked))})}const sJ=Ce(rn,e=>({activeLabel:e.generation.shouldUseSymmetry?"Enabled":void 0}),Ct),aJ=()=>{const{t:e}=pe(),{activeLabel:t}=F(sJ);return Gn("symmetry").isFeatureEnabled?a.jsx(ko,{label:e("parameters.symmetry"),activeLabel:t,children:a.jsxs(H,{sx:{gap:2,flexDirection:"column"},children:[a.jsx(oJ,{}),a.jsx(nJ,{}),a.jsx(rJ,{})]})}):null},My=p.memo(aJ);function iJ(){const e=F(o=>o.generation.variationAmount),t=F(o=>o.generation.shouldGenerateVariations),{t:n}=pe(),r=ne();return a.jsx(vt,{label:n("parameters.variationAmount"),value:e,step:.01,min:0,max:1,isDisabled:!t,onChange:o=>r(Yx(o)),handleReset:()=>r(Yx(.1)),withInput:!0,withReset:!0,withSliderMarks:!0})}const lJ=()=>{const e=ne(),t=F(r=>r.generation.shouldGenerateVariations);pe();const n=r=>e(u7(r.target.checked));return a.jsx(jn,{label:"Enable Variations",isChecked:t,onChange:n})},cJ=e=>{const{label:t="",isDisabled:n=!1,isInvalid:r,formControlProps:o,...s}=e,i=ne(),u=p.useCallback(f=>{f.shiftKey&&i(rs(!0))},[i]),d=p.useCallback(f=>{f.shiftKey||i(rs(!1))},[i]);return a.jsxs(lr,{isInvalid:r,isDisabled:n,...o,children:[t!==""&&a.jsx(mr,{children:t}),a.jsx(Fu,{...s,onPaste:Oy,onKeyDown:u,onKeyUp:d})]})},zn=p.memo(cJ);function uJ(){const e=F(s=>s.generation.seedWeights),t=F(s=>s.generation.shouldGenerateVariations),{t:n}=pe(),r=ne(),o=s=>r(d7(s.target.value));return a.jsx(zn,{label:n("parameters.seedWeights"),value:e,isInvalid:t&&!(Ey(e)||e===""),isDisabled:!t,onChange:o})}const dJ=Ce(rn,e=>({activeLabel:e.generation.shouldGenerateVariations?"Enabled":void 0}),Ct),fJ=()=>{const{t:e}=pe(),{activeLabel:t}=F(dJ);return Gn("variation").isFeatureEnabled?a.jsx(ko,{label:e("parameters.variations"),activeLabel:t,children:a.jsxs(H,{sx:{gap:2,flexDirection:"column"},children:[a.jsx(lJ,{}),a.jsx(iJ,{}),a.jsx(uJ,{})]})}):null},Dy=p.memo(fJ),pJ=Ce(xo,e=>({isProcessing:e.isProcessing,isConnected:e.isConnected,isCancelable:e.isCancelable,currentIteration:e.currentIteration,totalIterations:e.totalIterations,sessionId:e.sessionId,cancelType:e.cancelType,isCancelScheduled:e.isCancelScheduled}),{memoizeOptions:{resultEqualityCheck:Wt}}),hJ=e=>{const t=ne(),{btnGroupWidth:n="auto",...r}=e,{isProcessing:o,isConnected:s,isCancelable:i,cancelType:u,isCancelScheduled:d,sessionId:f}=F(pJ),h=p.useCallback(()=>{if(f){if(u==="scheduled"){t(f7());return}t(p7({session_id:f}))}},[t,f,u]),{t:m}=pe(),v=p.useCallback(w=>{const C=Array.isArray(w)?w[0]:w;t(h7(C))},[t]);Ke("shift+x",()=>{(s||o)&&i&&h()},[s,o,i]);const y=p.useMemo(()=>m(d?"parameters.cancel.isScheduled":u==="immediate"?"parameters.cancel.immediate":"parameters.cancel.schedule"),[m,u,d]),S=p.useMemo(()=>d?a.jsx(m7,{}):u==="immediate"?a.jsx(gX,{}):a.jsx(dX,{}),[u,d]);return a.jsxs(gr,{isAttached:!0,width:n,children:[a.jsx(je,{icon:S,tooltip:y,"aria-label":y,isDisabled:!s||!o||!i,onClick:h,colorScheme:"error",id:"cancel-button",...r}),a.jsxs(xh,{closeOnSelect:!1,children:[a.jsx(Sh,{as:je,tooltip:m("parameters.cancel.setType"),"aria-label":m("parameters.cancel.setType"),icon:a.jsx(d$,{w:"1em",h:"1em"}),paddingX:0,paddingY:0,colorScheme:"error",minWidth:5,...r}),a.jsx(Wu,{minWidth:"240px",children:a.jsxs(y1,{value:u,title:"Cancel Type",type:"radio",onChange:v,children:[a.jsx(yu,{value:"immediate",children:m("parameters.cancel.immediate")}),a.jsx(yu,{value:"scheduled",children:m("parameters.cancel.schedule")})]})})]})]})},om=p.memo(hJ),mJ=Ce(xo,e=>({isProcessing:e.isProcessing,currentStep:e.currentStep,totalSteps:e.totalSteps,currentStatusHasSteps:e.currentStatusHasSteps}),{memoizeOptions:{resultEqualityCheck:Wt}}),gJ=()=>{const{t:e}=pe(),{isProcessing:t,currentStep:n,totalSteps:r,currentStatusHasSteps:o}=F(mJ),s=n?Math.round(n*100/r):0;return a.jsx(z6,{value:s,"aria-label":e("accessibility.invokeProgressBar"),isIndeterminate:t&&!o,height:"full",colorScheme:"accent"})},OE=p.memo(gJ),p4={_disabled:{bg:"none",cursor:"not-allowed",_hover:{bg:"none"}}};function Ay(e){const{iconButton:t=!1,...n}=e,r=ne(),o=Wr(),s=F(Sr),i=F(f=>f.system.isProcessing),u=p.useCallback(()=>{r(X0()),r(Q0(s))},[r,s]),{t:d}=pe();return Ke(["ctrl+enter","meta+enter"],u,{enabled:()=>o,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[o,s]),a.jsx(Ge,{style:{flexGrow:4},position:"relative",children:a.jsxs(Ge,{style:{position:"relative"},children:[!o&&a.jsx(Ge,{borderRadius:"base",style:{position:"absolute",bottom:"0",left:"0",right:"0",height:"100%",overflow:"clip"},...n,children:a.jsx(OE,{})}),t?a.jsx(je,{"aria-label":d("parameters.invoke"),type:"submit",icon:a.jsx(Ck,{}),isDisabled:!o||i,onClick:u,tooltip:d("parameters.invoke"),tooltipProps:{placement:"top"},colorScheme:"accent",id:"invoke-button",...n,sx:{w:"full",flexGrow:1,...i?p4:{}}}):a.jsx(Yt,{"aria-label":d("parameters.invoke"),type:"submit",isDisabled:!o||i,onClick:u,colorScheme:"accent",id:"invoke-button",...n,sx:{w:"full",flexGrow:1,fontWeight:700,...i?p4:{}},children:"Invoke"})]})})}const Ny=()=>a.jsxs(H,{gap:2,children:[a.jsx(Ay,{}),a.jsx(om,{})]}),h4=/^-?(0\.)?\.?$/,vJ=e=>{const{label:t,isDisabled:n=!1,showStepper:r=!0,isInvalid:o,value:s,onChange:i,min:u,max:d,isInteger:f=!0,formControlProps:h,formLabelProps:m,numberInputFieldProps:v,numberInputStepperProps:y,tooltipProps:S,...w}=e,C=ne(),[k,P]=p.useState(String(s));p.useEffect(()=>{!k.match(h4)&&s!==Number(k)&&P(String(s))},[s,k]);const j=R=>{P(R),R.match(h4)||i(f?Math.floor(Number(R)):Number(R))},E=R=>{const T=Ys(f?Math.floor(Number(R.target.value)):Number(R.target.value),u,d);P(String(T)),i(T)},O=p.useCallback(R=>{R.shiftKey&&C(rs(!0))},[C]),I=p.useCallback(R=>{R.shiftKey||C(rs(!1))},[C]);return a.jsx(qn,{...S,children:a.jsxs(lr,{isDisabled:n,isInvalid:o,...h,children:[t&&a.jsx(mr,{...m,children:t}),a.jsxs(O3,{value:k,min:u,max:d,keepWithinRange:!0,clampValueOnBlur:!1,onChange:j,onBlur:E,...w,onPaste:Oy,children:[a.jsx(R3,{...v,onKeyDown:O,onKeyUp:I}),r&&a.jsxs(T3,{children:[a.jsx(M3,{...y}),a.jsx(D3,{...y})]})]})]})})},sc=p.memo(vJ),yJ=Ce([ss,hi,Hr,zu],(e,t,n,r)=>{const{initial:o,min:s,sliderMax:i,inputMax:u}=t.sd.guidance,{cfgScale:d}=e,{shouldUseSliders:f}=n,{shift:h}=r;return{cfgScale:d,initial:o,min:s,sliderMax:i,inputMax:u,shouldUseSliders:f,shift:h}},Ct),bJ=()=>{const{cfgScale:e,initial:t,min:n,sliderMax:r,inputMax:o,shouldUseSliders:s,shift:i}=F(yJ),u=ne(),{t:d}=pe(),f=p.useCallback(m=>u(Hf(m)),[u]),h=p.useCallback(()=>u(Hf(t)),[u,t]);return s?a.jsx(vt,{label:d("parameters.cfgScale"),step:i?.1:.5,min:n,max:r,onChange:f,handleReset:h,value:e,sliderNumberInputProps:{max:o},withInput:!0,withReset:!0,withSliderMarks:!0,isInteger:!1}):a.jsx(sc,{label:d("parameters.cfgScale"),step:.5,min:n,max:o,onChange:f,value:e,isInteger:!1,numberInputFieldProps:{textAlign:"center"}})},ac=p.memo(bJ),xJ=Ce([rn],e=>{const{initial:t,min:n,sliderMax:r,inputMax:o,fineStep:s,coarseStep:i}=e.config.sd.iterations,{iterations:u}=e.generation,{shouldUseSliders:d}=e.ui,f=e.dynamicPrompts.isEnabled&&e.dynamicPrompts.combinatorial,h=e.hotkeys.shift?s:i;return{iterations:u,initial:t,min:n,sliderMax:r,inputMax:o,step:h,shouldUseSliders:d,isDisabled:f}},Ct),SJ=()=>{const{iterations:e,initial:t,min:n,sliderMax:r,inputMax:o,step:s,shouldUseSliders:i,isDisabled:u}=F(xJ),d=ne(),{t:f}=pe(),h=p.useCallback(v=>{d(Xx(v))},[d]),m=p.useCallback(()=>{d(Xx(t))},[d,t]);return i?a.jsx(vt,{isDisabled:u,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}}):a.jsx(sc,{isDisabled:u,label:f("parameters.images"),step:s,min:n,max:o,onChange:h,value:e,numberInputFieldProps:{textAlign:"center"}})},ic=p.memo(SJ),wJ=()=>{const e=ne(),{t}=pe(),{data:n}=A3(),r=F(d=>d.generation.model),o=F(d=>d.generation.vae),s=p.useMemo(()=>{if(!n)return[];const d=[{value:"default",label:"Default",group:"Default"}];return Xs(n.entities,(f,h)=>{if(!f)return;const m=(r==null?void 0:r.base_model)!==f.base_model;d.push({value:h,label:f.model_name,group:$r[f.base_model],disabled:m,tooltip:m?`Incompatible base model: ${f.base_model}`:void 0})}),d.sort((f,h)=>f.disabled&&!h.disabled?1:-1)},[n,r==null?void 0:r.base_model]),i=p.useMemo(()=>o!=null&&o.id?n==null?void 0:n.entities[o==null?void 0:o.id]:null,[n==null?void 0:n.entities,o]),u=p.useCallback(d=>{if(!d||d==="default"){e(mg(null));return}const[f,h,m]=d.split("/"),v=g7.parse({id:d,name:m,base_model:f});e(mg(v))},[e]);return p.useEffect(()=>{o&&(n!=null&&n.ids.includes(o.id))||e(mg(null))},[u,n==null?void 0:n.ids,o,e]),a.jsx(Kn,{itemComponent:Py,tooltip:i==null?void 0:i.description,label:t("modelManager.vae"),value:(o==null?void 0:o.id)??"default",placeholder:"Default",data:s,onChange:u,disabled:s.length===0,clearable:!0})},CJ=p.memo(wJ),kJ=Ce([Hr,ss],(e,t)=>{const{scheduler:n}=t,{favoriteSchedulers:r}=e,o=k3.map(s=>({value:s,label:P3[s],group:r.includes(s)?"Favorites":void 0})).sort((s,i)=>s.label.localeCompare(i.label));return{scheduler:n,data:o}},Ct),PJ=()=>{const e=ne(),{t}=pe(),{scheduler:n,data:r}=F(kJ),o=p.useCallback(s=>{s&&e(Cv(s))},[e]);return a.jsx(Kn,{label:t("parameters.scheduler"),value:n,data:r,onChange:o})},_J=p.memo(PJ),jJ=()=>{const e=Gn("vae").isFeatureEnabled;return a.jsxs(H,{gap:3,w:"full",flexWrap:e?"wrap":"nowrap",children:[a.jsx(Ge,{w:"full",children:a.jsx(MQ,{})}),a.jsxs(H,{gap:3,w:"full",children:[e&&a.jsx(Ge,{w:"full",children:a.jsx(CJ,{})}),a.jsx(Ge,{w:"full",children:a.jsx(_J,{})})]})]})},lc=p.memo(jJ),EJ=[{name:"Free",value:null},{name:"Portrait",value:.67/1},{name:"Wide",value:16/9},{name:"Square",value:1/1}];function RE(){const e=F(o=>o.ui.aspectRatio),t=ne(),n=F(o=>o.generation.shouldFitToWidthHeight),r=F(Sr);return a.jsx(H,{gap:2,flexGrow:1,children:a.jsx(gr,{isAttached:!0,children:EJ.map(o=>a.jsx(Yt,{size:"sm",isChecked:e===o.value,isDisabled:r==="img2img"?!n:!1,onClick:()=>t(v7(o.value)),children:o.name},o.name))})})}const IJ=Ce([ss,zu,hi,Hr],(e,t,n,r)=>{const{initial:o,min:s,sliderMax:i,inputMax:u,fineStep:d,coarseStep:f}=n.sd.height,{height:h}=e,{aspectRatio:m}=r,v=t.shift?d:f;return{height:h,initial:o,min:s,sliderMax:i,inputMax:u,step:v,aspectRatio:m}},Ct),OJ=e=>{const{height:t,initial:n,min:r,sliderMax:o,inputMax:s,step:i,aspectRatio:u}=F(IJ),d=ne(),{t:f}=pe(),h=p.useCallback(v=>{if(d(Xl(v)),u){const y=ys(v*u,8);d(Yl(y))}},[d,u]),m=p.useCallback(()=>{if(d(Xl(n)),u){const v=ys(n*u,8);d(Yl(v))}},[d,n,u]);return a.jsx(vt,{label:f("parameters.height"),value:t,min:r,step:i,max:o,onChange:h,handleReset:m,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:s},...e})},RJ=p.memo(OJ),TJ=Ce([ss,zu,hi,Hr],(e,t,n,r)=>{const{initial:o,min:s,sliderMax:i,inputMax:u,fineStep:d,coarseStep:f}=n.sd.width,{width:h}=e,{aspectRatio:m}=r,v=t.shift?d:f;return{width:h,initial:o,min:s,sliderMax:i,inputMax:u,step:v,aspectRatio:m}},Ct),MJ=e=>{const{width:t,initial:n,min:r,sliderMax:o,inputMax:s,step:i,aspectRatio:u}=F(TJ),d=ne(),{t:f}=pe(),h=p.useCallback(v=>{if(d(Yl(v)),u){const y=ys(v/u,8);d(Xl(y))}},[d,u]),m=p.useCallback(()=>{if(d(Yl(n)),u){const v=ys(n/u,8);d(Xl(v))}},[d,n,u]);return a.jsx(vt,{label:f("parameters.width"),value:t,min:r,step:i,max:o,onChange:h,handleReset:m,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:s},...e})},DJ=p.memo(MJ);function rh(){const{t:e}=pe(),t=ne(),n=F(o=>o.generation.shouldFitToWidthHeight),r=F(Sr);return a.jsxs(H,{sx:{gap:2,p:4,borderRadius:4,flexDirection:"column",w:"full",bg:"base.150",_dark:{bg:"base.750"}},children:[a.jsxs(H,{alignItems:"center",gap:2,children:[a.jsx(Ue,{sx:{fontSize:"sm",width:"full",color:"base.700",_dark:{color:"base.300"}},children:e("parameters.aspectRatio")}),a.jsx(Oa,{}),a.jsx(RE,{}),a.jsx(je,{tooltip:e("ui.swapSizes"),"aria-label":e("ui.swapSizes"),size:"sm",icon:a.jsx(sE,{}),fontSize:20,isDisabled:r==="img2img"?!n:!1,onClick:()=>t(y7())})]}),a.jsx(H,{gap:2,alignItems:"center",children:a.jsxs(H,{gap:2,flexDirection:"column",width:"full",children:[a.jsx(DJ,{isDisabled:r==="img2img"?!n:!1}),a.jsx(RJ,{isDisabled:r==="img2img"?!n:!1})]})})]})}const AJ=Ce([ss,hi,Hr,zu],(e,t,n,r)=>{const{initial:o,min:s,sliderMax:i,inputMax:u,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:i,inputMax:u,step:v,shouldUseSliders:m}},Ct),NJ=()=>{const{steps:e,initial:t,min:n,sliderMax:r,inputMax:o,step:s,shouldUseSliders:i}=F(AJ),u=ne(),{t:d}=pe(),f=p.useCallback(v=>{u(Wf(v))},[u]),h=p.useCallback(()=>{u(Wf(t))},[u,t]),m=p.useCallback(()=>{u(X0())},[u]);return i?a.jsx(vt,{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}}):a.jsx(sc,{label:d("parameters.steps"),min:n,max:o,step:s,onChange:f,value:e,numberInputFieldProps:{textAlign:"center"},onBlur:m})},cc=p.memo(NJ);function zJ(){const e=ne(),t=F(o=>o.generation.shouldFitToWidthHeight),n=o=>e(b7(o.target.checked)),{t:r}=pe();return a.jsx(jn,{label:r("parameters.imageFit"),isChecked:t,onChange:n})}const $J=Ce([ss,zu,hi],(e,t,n)=>{const{initial:r,min:o,sliderMax:s,inputMax:i,fineStep:u,coarseStep:d}=n.sd.img2imgStrength,{img2imgStrength:f}=e,h=t.shift?u:d;return{img2imgStrength:f,initial:r,min:o,sliderMax:s,inputMax:i,step:h}},Ct),LJ=()=>{const{img2imgStrength:e,initial:t,min:n,sliderMax:r,inputMax:o,step:s}=F($J),i=ne(),{t:u}=pe(),d=p.useCallback(h=>i(Vf(h)),[i]),f=p.useCallback(()=>{i(Vf(t))},[i,t]);return a.jsx(vt,{label:`${u("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}})},TE=p.memo(LJ);function FJ(){const e=F(i=>i.generation.seed),t=F(i=>i.generation.shouldRandomizeSeed),n=F(i=>i.generation.shouldGenerateVariations),{t:r}=pe(),o=ne(),s=i=>o(Bf(i));return a.jsx(sc,{label:r("parameters.seed"),step:1,precision:0,flexGrow:1,min:N3,max:z3,isDisabled:t,isInvalid:e<0&&n,onChange:s,value:e,formControlProps:{display:"flex",alignItems:"center",gap:3}})}const BJ=(e,t)=>Math.floor(Math.random()*(t-e+1)+e);function HJ(){const e=ne(),t=F(o=>o.generation.shouldRandomizeSeed),{t:n}=pe(),r=()=>e(Bf(BJ(N3,z3)));return a.jsx(je,{size:"sm",isDisabled:t,"aria-label":n("parameters.shuffle"),tooltip:n("parameters.shuffle"),onClick:r,icon:a.jsx(t$,{})})}const WJ=()=>{const e=ne(),{t}=pe(),n=F(o=>o.generation.shouldRandomizeSeed),r=o=>e(x7(o.target.checked));return a.jsx(jn,{label:t("common.random"),isChecked:n,onChange:r})},VJ=p.memo(WJ),UJ=()=>a.jsxs(H,{sx:{gap:4,alignItems:"center"},children:[a.jsx(FJ,{}),a.jsx(HJ,{}),a.jsx(VJ,{})]}),uc=p.memo(UJ),GJ=Ce([Hr,ss],(e,t)=>{const{shouldUseSliders:n}=e,{shouldFitToWidthHeight:r,shouldRandomizeSeed:o}=t;return{shouldUseSliders:n,shouldFitToWidthHeight:r,activeLabel:o?void 0:"Manual Seed"}},Ct),qJ=()=>{const{shouldUseSliders:e,shouldFitToWidthHeight:t,activeLabel:n}=F(GJ);return a.jsx(ko,{label:"General",activeLabel:n,defaultIsOpen:!0,children:a.jsxs(H,{sx:{flexDirection:"column",gap:3},children:[e?a.jsxs(a.Fragment,{children:[a.jsx(ic,{}),a.jsx(cc,{}),a.jsx(ac,{}),a.jsx(lc,{}),a.jsx(Ge,{pt:2,children:a.jsx(uc,{})}),a.jsx(rh,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs(H,{gap:3,children:[a.jsx(ic,{}),a.jsx(cc,{}),a.jsx(ac,{})]}),a.jsx(lc,{}),a.jsx(Ge,{pt:2,children:a.jsx(uc,{})}),a.jsx(rh,{})]}),a.jsx(TE,{}),a.jsx(zJ,{})]})})},KJ=p.memo(qJ),YJ=()=>a.jsxs(a.Fragment,{children:[a.jsx(Ty,{}),a.jsx(Ry,{}),a.jsx(Ny,{}),a.jsx(KJ,{}),a.jsx(_y,{}),a.jsx(ky,{}),a.jsx(Iy,{}),a.jsx(Dy,{}),a.jsx(EE,{}),a.jsx(My,{}),a.jsx(IE,{}),a.jsx(jy,{})]}),ME=p.memo(YJ),XJ=()=>{const e=ne(),t=p.useRef(null),n=p.useCallback(()=>{t.current&&t.current.setLayout([50,50])},[]);return a.jsxs(H,{sx:{gap:4,w:"full",h:"full"},children:[a.jsx(Cy,{children:a.jsx(ME,{})}),a.jsx(Ge,{sx:{w:"full",h:"full"},children:a.jsxs(wy,{ref:t,autoSaveId:"imageTab.content",direction:"horizontal",style:{height:"100%",width:"100%"},children:[a.jsx(ju,{id:"imageTab.content.initImage",order:0,defaultSize:50,minSize:25,style:{position:"relative"},children:a.jsx(uQ,{})}),a.jsx(wE,{onDoubleClick:n}),a.jsx(ju,{id:"imageTab.content.selectedImage",order:1,defaultSize:50,minSize:25,onResize:()=>{e(js())},children:a.jsx(CE,{})})]})})]})},QJ=p.memo(XJ);var ZJ=function(t){return JJ(t)&&!eee(t)};function JJ(e){return!!e&&typeof e=="object"}function eee(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||ree(e)}var tee=typeof Symbol=="function"&&Symbol.for,nee=tee?Symbol.for("react.element"):60103;function ree(e){return e.$$typeof===nee}function oee(e){return Array.isArray(e)?[]:{}}function oh(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Eu(oee(e),e,t):e}function see(e,t,n){return e.concat(t).map(function(r){return oh(r,n)})}function aee(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(o){r[o]=oh(e[o],n)}),Object.keys(t).forEach(function(o){!n.isMergeableObject(t[o])||!e[o]?r[o]=oh(t[o],n):r[o]=Eu(e[o],t[o],n)}),r}function Eu(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||see,n.isMergeableObject=n.isMergeableObject||ZJ;var r=Array.isArray(t),o=Array.isArray(e),s=r===o;return s?r?n.arrayMerge(e,t,n):aee(e,t,n):oh(t,n)}Eu.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,o){return Eu(r,o,n)},{})};var _0=Eu,m4=Array.isArray,g4=Object.keys,iee=Object.prototype.hasOwnProperty,lee=typeof Element<"u";function j0(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=m4(e),r=m4(t),o,s,i;if(n&&r){if(s=e.length,s!=t.length)return!1;for(o=s;o--!==0;)if(!j0(e[o],t[o]))return!1;return!0}if(n!=r)return!1;var u=e instanceof Date,d=t instanceof Date;if(u!=d)return!1;if(u&&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=g4(e);if(s=m.length,s!==g4(t).length)return!1;for(o=s;o--!==0;)if(!iee.call(t,m[o]))return!1;if(lee&&e instanceof Element&&t instanceof Element)return e===t;for(o=s;o--!==0;)if(i=m[o],!(i==="_owner"&&e.$$typeof)&&!j0(e[i],t[i]))return!1;return!0}return e!==e&&t!==t}var cee=function(t,n){try{return j0(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 Ii=fc(cee);var uee=!0;function dee(e,t){if(!uee){if(e)return;var n="Warning: "+t;typeof console<"u"&&console.warn(n);try{throw Error(n)}catch{}}}function Wn(){return Wn=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},Wn.apply(this,arguments)}function Dl(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 sm=p.createContext(void 0);sm.displayName="FormikContext";var fee=sm.Provider;sm.Consumer;function DE(){var e=p.useContext(sm);return e||dee(!1),e}var Ro=function(t){return typeof t=="function"},am=function(t){return t!==null&&typeof t=="object"},pee=function(t){return String(Math.floor(Number(t)))===t},dv=function(t){return Object.prototype.toString.call(t)==="[object String]"},hee=function(t){return p.Children.count(t)===0},fv=function(t){return am(t)&&Ro(t.then)};function Oo(e,t,n,r){r===void 0&&(r=0);for(var o=d5(t);e&&r<o.length;)e=e[o[r++]];return r!==o.length&&!e||e===void 0?n:e}function Hi(e,t,n){for(var r=f2(e),o=r,s=0,i=d5(t);s<i.length-1;s++){var u=i[s],d=Oo(e,i.slice(0,s+1));if(d&&(am(d)||Array.isArray(d)))o=o[u]=f2(d);else{var f=i[s+1];o=o[u]=pee(f)&&Number(f)>=0?[]:{}}}return(s===0?e:o)[i[s]]===n?e:(n===void 0?delete o[i[s]]:o[i[s]]=n,s===0&&n===void 0&&delete r[i[s]],r)}function AE(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 i=s[o],u=e[i];am(u)?n.get(u)||(n.set(u,!0),r[i]=Array.isArray(u)?[]:{},AE(u,t,n,r[i])):r[i]=t}return r}function mee(e,t){switch(t.type){case"SET_VALUES":return Wn({},e,{values:t.payload});case"SET_TOUCHED":return Wn({},e,{touched:t.payload});case"SET_ERRORS":return Ii(e.errors,t.payload)?e:Wn({},e,{errors:t.payload});case"SET_STATUS":return Wn({},e,{status:t.payload});case"SET_ISSUBMITTING":return Wn({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return Wn({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return Wn({},e,{values:Hi(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return Wn({},e,{touched:Hi(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return Wn({},e,{errors:Hi(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":return Wn({},e,t.payload);case"SET_FORMIK_STATE":return t.payload(e);case"SUBMIT_ATTEMPT":return Wn({},e,{touched:AE(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":return Wn({},e,{isSubmitting:!1});case"SUBMIT_SUCCESS":return Wn({},e,{isSubmitting:!1});default:return e}}var ki={},jf={};function gee(e){var t=e.validateOnChange,n=t===void 0?!0:t,r=e.validateOnBlur,o=r===void 0?!0:r,s=e.validateOnMount,i=s===void 0?!1:s,u=e.isInitialValid,d=e.enableReinitialize,f=d===void 0?!1:d,h=e.onSubmit,m=Dl(e,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),v=Wn({validateOnChange:n,validateOnBlur:o,validateOnMount:i,onSubmit:h},m),y=p.useRef(v.initialValues),S=p.useRef(v.initialErrors||ki),w=p.useRef(v.initialTouched||jf),C=p.useRef(v.initialStatus),k=p.useRef(!1),P=p.useRef({});p.useEffect(function(){return k.current=!0,function(){k.current=!1}},[]);var j=p.useState(0),E=j[1],O=p.useRef({values:v.initialValues,errors:v.initialErrors||ki,touched:v.initialTouched||jf,status:v.initialStatus,isSubmitting:!1,isValidating:!1,submitCount:0}),I=O.current,R=p.useCallback(function(X){var we=O.current;O.current=mee(we,X),we!==O.current&&E(function(te){return te+1})},[]),T=p.useCallback(function(X,we){return new Promise(function(te,he){var Ne=v.validate(X,we);Ne==null?te(ki):fv(Ne)?Ne.then(function(Xe){te(Xe||ki)},function(Xe){he(Xe)}):te(Ne)})},[v.validate]),D=p.useCallback(function(X,we){var te=v.validationSchema,he=Ro(te)?te(we):te,Ne=we&&he.validateAt?he.validateAt(we,X):yee(X,he);return new Promise(function(Xe,yt){Ne.then(function(){Xe(ki)},function(Xt){Xt.name==="ValidationError"?Xe(vee(Xt)):yt(Xt)})})},[v.validationSchema]),$=p.useCallback(function(X,we){return new Promise(function(te){return te(P.current[X].validate(we))})},[]),A=p.useCallback(function(X){var we=Object.keys(P.current).filter(function(he){return Ro(P.current[he].validate)}),te=we.length>0?we.map(function(he){return $(he,Oo(X,he))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(te).then(function(he){return he.reduce(function(Ne,Xe,yt){return Xe==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||Xe&&(Ne=Hi(Ne,we[yt],Xe)),Ne},{})})},[$]),J=p.useCallback(function(X){return Promise.all([A(X),v.validationSchema?D(X):{},v.validate?T(X):{}]).then(function(we){var te=we[0],he=we[1],Ne=we[2],Xe=_0.all([te,he,Ne],{arrayMerge:bee});return Xe})},[v.validate,v.validationSchema,A,T,D]),z=qo(function(X){return X===void 0&&(X=I.values),R({type:"SET_ISVALIDATING",payload:!0}),J(X).then(function(we){return k.current&&(R({type:"SET_ISVALIDATING",payload:!1}),R({type:"SET_ERRORS",payload:we})),we})});p.useEffect(function(){i&&k.current===!0&&Ii(y.current,v.initialValues)&&z(y.current)},[i,z]);var B=p.useCallback(function(X){var we=X&&X.values?X.values:y.current,te=X&&X.errors?X.errors:S.current?S.current:v.initialErrors||{},he=X&&X.touched?X.touched:w.current?w.current:v.initialTouched||{},Ne=X&&X.status?X.status:C.current?C.current:v.initialStatus;y.current=we,S.current=te,w.current=he,C.current=Ne;var Xe=function(){R({type:"RESET_FORM",payload:{isSubmitting:!!X&&!!X.isSubmitting,errors:te,touched:he,status:Ne,values:we,isValidating:!!X&&!!X.isValidating,submitCount:X&&X.submitCount&&typeof X.submitCount=="number"?X.submitCount:0}})};if(v.onReset){var yt=v.onReset(I.values,Ae);fv(yt)?yt.then(Xe):Xe()}else Xe()},[v.initialErrors,v.initialStatus,v.initialTouched]);p.useEffect(function(){k.current===!0&&!Ii(y.current,v.initialValues)&&f&&(y.current=v.initialValues,B(),i&&z(y.current))},[f,v.initialValues,B,i,z]),p.useEffect(function(){f&&k.current===!0&&!Ii(S.current,v.initialErrors)&&(S.current=v.initialErrors||ki,R({type:"SET_ERRORS",payload:v.initialErrors||ki}))},[f,v.initialErrors]),p.useEffect(function(){f&&k.current===!0&&!Ii(w.current,v.initialTouched)&&(w.current=v.initialTouched||jf,R({type:"SET_TOUCHED",payload:v.initialTouched||jf}))},[f,v.initialTouched]),p.useEffect(function(){f&&k.current===!0&&!Ii(C.current,v.initialStatus)&&(C.current=v.initialStatus,R({type:"SET_STATUS",payload:v.initialStatus}))},[f,v.initialStatus,v.initialTouched]);var G=qo(function(X){if(P.current[X]&&Ro(P.current[X].validate)){var we=Oo(I.values,X),te=P.current[X].validate(we);return fv(te)?(R({type:"SET_ISVALIDATING",payload:!0}),te.then(function(he){return he}).then(function(he){R({type:"SET_FIELD_ERROR",payload:{field:X,value:he}}),R({type:"SET_ISVALIDATING",payload:!1})})):(R({type:"SET_FIELD_ERROR",payload:{field:X,value:te}}),Promise.resolve(te))}else if(v.validationSchema)return R({type:"SET_ISVALIDATING",payload:!0}),D(I.values,X).then(function(he){return he}).then(function(he){R({type:"SET_FIELD_ERROR",payload:{field:X,value:Oo(he,X)}}),R({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),K=p.useCallback(function(X,we){var te=we.validate;P.current[X]={validate:te}},[]),N=p.useCallback(function(X){delete P.current[X]},[]),V=qo(function(X,we){R({type:"SET_TOUCHED",payload:X});var te=we===void 0?o:we;return te?z(I.values):Promise.resolve()}),W=p.useCallback(function(X){R({type:"SET_ERRORS",payload:X})},[]),U=qo(function(X,we){var te=Ro(X)?X(I.values):X;R({type:"SET_VALUES",payload:te});var he=we===void 0?n:we;return he?z(te):Promise.resolve()}),re=p.useCallback(function(X,we){R({type:"SET_FIELD_ERROR",payload:{field:X,value:we}})},[]),ve=qo(function(X,we,te){R({type:"SET_FIELD_VALUE",payload:{field:X,value:we}});var he=te===void 0?n:te;return he?z(Hi(I.values,X,we)):Promise.resolve()}),le=p.useCallback(function(X,we){var te=we,he=X,Ne;if(!dv(X)){X.persist&&X.persist();var Xe=X.target?X.target:X.currentTarget,yt=Xe.type,Xt=Xe.name,ln=Xe.id,kn=Xe.value,vr=Xe.checked,cn=Xe.outerHTML,Yn=Xe.options,Re=Xe.multiple;te=we||Xt||ln,he=/number|range/.test(yt)?(Ne=parseFloat(kn),isNaN(Ne)?"":Ne):/checkbox/.test(yt)?See(Oo(I.values,te),vr,kn):Yn&&Re?xee(Yn):kn}te&&ve(te,he)},[ve,I.values]),se=qo(function(X){if(dv(X))return function(we){return le(we,X)};le(X)}),Y=qo(function(X,we,te){we===void 0&&(we=!0),R({type:"SET_FIELD_TOUCHED",payload:{field:X,value:we}});var he=te===void 0?o:te;return he?z(I.values):Promise.resolve()}),ae=p.useCallback(function(X,we){X.persist&&X.persist();var te=X.target,he=te.name,Ne=te.id,Xe=te.outerHTML,yt=we||he||Ne;Y(yt,!0)},[Y]),ue=qo(function(X){if(dv(X))return function(we){return ae(we,X)};ae(X)}),xe=p.useCallback(function(X){Ro(X)?R({type:"SET_FORMIK_STATE",payload:X}):R({type:"SET_FORMIK_STATE",payload:function(){return X}})},[]),oe=p.useCallback(function(X){R({type:"SET_STATUS",payload:X})},[]),ge=p.useCallback(function(X){R({type:"SET_ISSUBMITTING",payload:X})},[]),fe=qo(function(){return R({type:"SUBMIT_ATTEMPT"}),z().then(function(X){var we=X instanceof Error,te=!we&&Object.keys(X).length===0;if(te){var he;try{if(he=ye(),he===void 0)return}catch(Ne){throw Ne}return Promise.resolve(he).then(function(Ne){return k.current&&R({type:"SUBMIT_SUCCESS"}),Ne}).catch(function(Ne){if(k.current)throw R({type:"SUBMIT_FAILURE"}),Ne})}else if(k.current&&(R({type:"SUBMIT_FAILURE"}),we))throw X})}),Pe=qo(function(X){X&&X.preventDefault&&Ro(X.preventDefault)&&X.preventDefault(),X&&X.stopPropagation&&Ro(X.stopPropagation)&&X.stopPropagation(),fe().catch(function(we){console.warn("Warning: An unhandled error was caught from submitForm()",we)})}),Ae={resetForm:B,validateForm:z,validateField:G,setErrors:W,setFieldError:re,setFieldTouched:Y,setFieldValue:ve,setStatus:oe,setSubmitting:ge,setTouched:V,setValues:U,setFormikState:xe,submitForm:fe},ye=qo(function(){return h(I.values,Ae)}),Oe=qo(function(X){X&&X.preventDefault&&Ro(X.preventDefault)&&X.preventDefault(),X&&X.stopPropagation&&Ro(X.stopPropagation)&&X.stopPropagation(),B()}),at=p.useCallback(function(X){return{value:Oo(I.values,X),error:Oo(I.errors,X),touched:!!Oo(I.touched,X),initialValue:Oo(y.current,X),initialTouched:!!Oo(w.current,X),initialError:Oo(S.current,X)}},[I.errors,I.touched,I.values]),Fe=p.useCallback(function(X){return{setValue:function(te,he){return ve(X,te,he)},setTouched:function(te,he){return Y(X,te,he)},setError:function(te){return re(X,te)}}},[ve,Y,re]),Ye=p.useCallback(function(X){var we=am(X),te=we?X.name:X,he=Oo(I.values,te),Ne={name:te,value:he,onChange:se,onBlur:ue};if(we){var Xe=X.type,yt=X.value,Xt=X.as,ln=X.multiple;Xe==="checkbox"?yt===void 0?Ne.checked=!!he:(Ne.checked=!!(Array.isArray(he)&&~he.indexOf(yt)),Ne.value=yt):Xe==="radio"?(Ne.checked=he===yt,Ne.value=yt):Xt==="select"&&ln&&(Ne.value=Ne.value||[],Ne.multiple=!0)}return Ne},[ue,se,I.values]),jt=p.useMemo(function(){return!Ii(y.current,I.values)},[y.current,I.values]),xt=p.useMemo(function(){return typeof u<"u"?jt?I.errors&&Object.keys(I.errors).length===0:u!==!1&&Ro(u)?u(v):u:I.errors&&Object.keys(I.errors).length===0},[u,jt,I.errors,v]),Fn=Wn({},I,{initialValues:y.current,initialErrors:S.current,initialTouched:w.current,initialStatus:C.current,handleBlur:ue,handleChange:se,handleReset:Oe,handleSubmit:Pe,resetForm:B,setErrors:W,setFormikState:xe,setFieldTouched:Y,setFieldValue:ve,setFieldError:re,setStatus:oe,setSubmitting:ge,setTouched:V,setValues:U,submitForm:fe,validateForm:z,validateField:G,isValid:xt,dirty:jt,unregisterField:N,registerField:K,getFieldProps:Ye,getFieldMeta:at,getFieldHelpers:Fe,validateOnBlur:o,validateOnChange:n,validateOnMount:i});return Fn}function zy(e){var t=gee(e),n=e.component,r=e.children,o=e.render,s=e.innerRef;return p.useImperativeHandle(s,function(){return t}),p.createElement(fee,{value:t},n?p.createElement(n,t):o?o(t):r?Ro(r)?r(t):hee(r)?null:p.Children.only(r):null)}function vee(e){var t={};if(e.inner){if(e.inner.length===0)return Hi(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 i=s;Oo(t,i.path)||(t=Hi(t,i.path,i.message))}}return t}function yee(e,t,n,r){n===void 0&&(n=!1);var o=E0(e);return t[n?"validateSync":"validate"](o,{abortEarly:!1,context:r||o})}function E0(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||Qx(o)?E0(o):o!==""?o:void 0}):Qx(e[r])?t[r]=E0(e[r]):t[r]=e[r]!==""?e[r]:void 0}return t}function bee(e,t,n){var r=e.slice();return t.forEach(function(s,i){if(typeof r[i]>"u"){var u=n.clone!==!1,d=u&&n.isMergeableObject(s);r[i]=d?_0(Array.isArray(s)?[]:{},s,n):s}else n.isMergeableObject(s)?r[i]=_0(e[i],s,n):e.indexOf(s)===-1&&r.push(s)}),r}function xee(e){return Array.from(e).filter(function(t){return t.selected}).map(function(t){return t.value})}function See(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 wee=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?p.useLayoutEffect:p.useEffect;function qo(e){var t=p.useRef(e);return wee(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 mo(e){var t=e.validate,n=e.name,r=e.render,o=e.children,s=e.as,i=e.component,u=Dl(e,["validate","name","render","children","as","component"]),d=DE(),f=Dl(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(Wn({name:n},u)),y=f.getFieldMeta(n),S={field:v,form:f};if(r)return r(Wn({},S,{meta:y}));if(Ro(o))return o(Wn({},S,{meta:y}));if(i){if(typeof i=="string"){var w=u.innerRef,C=Dl(u,["innerRef"]);return p.createElement(i,Wn({ref:w},v,C),o)}return p.createElement(i,Wn({field:v,form:f},u),o)}var k=s||"input";if(typeof k=="string"){var P=u.innerRef,j=Dl(u,["innerRef"]);return p.createElement(k,Wn({ref:P},v,j),o)}return p.createElement(k,Wn({},v,u),o)}var Cee=p.forwardRef(function(e,t){var n=e.action,r=Dl(e,["action"]),o=n??"#",s=DE(),i=s.handleReset,u=s.handleSubmit;return p.createElement("form",Wn({onSubmit:u,ref:t,onReset:i,action:o},r))});Cee.displayName="Form";const $y=Ve.form;function ms({children:e}){return a.jsx(H,{sx:{flexDirection:"column",padding:4,rowGap:4,borderRadius:"base",width:"full",bg:"base.900"},children:e})}const NE=Ce([xo],e=>{const{model_list:t}=e,n=[];return Xs(t,r=>{n.push(r.weights)}),n});function v4({model:e,modelsToAdd:t,setModelsToAdd:n}){const{t:r}=pe(),o=F(NE),s=i=>{t.includes(i.target.value)?n(oT(t,u=>u!==i.target.value)):n([...t,i.target.value])};return a.jsxs(H,{flexDirection:"column",gap:2,backgroundColor:t.includes(e.name)?"accent.650":"base.800",paddingX:4,paddingY:2,borderRadius:4,children:[a.jsxs(H,{gap:4,alignItems:"center",justifyContent:"space-between",children:[a.jsx(In,{value:e.name,label:a.jsx(Ue,{fontWeight:500,children:e.name}),isChecked:t.includes(e.name),isDisabled:o.includes(e.location),onChange:s}),o.includes(e.location)&&a.jsx(Ql,{colorScheme:"accent",children:r("modelManager.modelExists")})]}),a.jsx(Ue,{fontStyle:"italic",variant:"subtext",children:e.location})]})}function kee(){const e=ne(),{t}=pe(),n=F(j=>j.system.searchFolder),r=F(j=>j.system.foundModels),o=F(NE),s=F(j=>j.ui.shouldShowExistingModelsInSearch),i=F(j=>j.system.isProcessing),[u,d]=L.useState([]),[f,h]=L.useState("v1"),[m,v]=L.useState(""),y=()=>{e(w7(null)),e(C7(null)),d([])},S=j=>{e(searchForModels(j.checkpointFolder))},w=()=>{d([]),r&&r.forEach(j=>{o.includes(j.location)||d(E=>[...E,j.name])})},C=()=>{d([])},k=()=>{const j=r==null?void 0:r.filter(O=>u.includes(O.name)),E={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};j==null||j.forEach(O=>{const I={name:O.name,description:"",config:E[f],weights:O.location,vae:"",width:512,height:512,default:!1,format:"ckpt"};e(addNewModel(I))}),d([])},P=()=>{const j=[],E=[];return r&&r.forEach((O,I)=>{o.includes(O.location)?E.push(a.jsx(v4,{model:O,modelsToAdd:u,setModelsToAdd:d},I)):j.push(a.jsx(v4,{model:O,modelsToAdd:u,setModelsToAdd:d},I))}),a.jsxs(H,{flexDirection:"column",rowGap:4,children:[j,s&&E]})};return a.jsxs(a.Fragment,{children:[n?a.jsxs(H,{sx:{padding:4,gap:2,position:"relative",borderRadius:"base",alignItems:"center",w:"full",bg:"base.900"},children:[a.jsxs(H,{sx:{flexDir:"column",gap:2},children:[a.jsx(Ue,{sx:{fontWeight:500},variant:"subtext",children:t("modelManager.checkpointFolder")}),a.jsx(Ue,{sx:{fontWeight:500},children:n})]}),a.jsx(Oa,{}),a.jsx(je,{"aria-label":t("modelManager.scanAgain"),tooltip:t("modelManager.scanAgain"),icon:a.jsx(X2,{}),fontSize:18,disabled:i,onClick:()=>e(searchForModels(n))}),a.jsx(je,{"aria-label":t("modelManager.clearCheckpointFolder"),tooltip:t("modelManager.clearCheckpointFolder"),icon:a.jsx(io,{}),onClick:y})]}):a.jsx(zy,{initialValues:{checkpointFolder:""},onSubmit:j=>{S(j)},children:({handleSubmit:j})=>a.jsx($y,{onSubmit:j,width:"100%",children:a.jsxs(oi,{columnGap:2,alignItems:"flex-end",children:[a.jsx(lr,{flexGrow:1,children:a.jsx(mo,{as:zn,id:"checkpointFolder",name:"checkpointFolder",type:"text",size:"md",label:t("modelManager.checkpointFolder")})}),a.jsx(Yt,{leftIcon:a.jsx(X2,{}),"aria-label":t("modelManager.findModels"),tooltip:t("modelManager.findModels"),type:"submit",disabled:i,px:8,children:t("modelManager.findModels")})]})})}),r&&a.jsxs(H,{flexDirection:"column",rowGap:4,width:"full",children:[a.jsxs(H,{justifyContent:"space-between",alignItems:"center",children:[a.jsxs("p",{children:[t("modelManager.modelsFound"),": ",r.length]}),a.jsxs("p",{children:[t("modelManager.selected"),": ",u.length]})]}),a.jsxs(H,{columnGap:2,justifyContent:"space-between",children:[a.jsxs(H,{columnGap:2,children:[a.jsx(Yt,{isDisabled:u.length===r.length,onClick:w,children:t("modelManager.selectAll")}),a.jsx(Yt,{isDisabled:u.length===0,onClick:C,children:t("modelManager.deselectAll")}),a.jsx(In,{label:t("modelManager.showExisting"),isChecked:s,onChange:()=>e(S7(!s))})]}),a.jsx(Yt,{isDisabled:u.length===0,onClick:k,colorScheme:"accent",children:t("modelManager.addSelected")})]}),a.jsxs(H,{sx:{flexDirection:"column",padding:4,rowGap:4,borderRadius:"base",width:"full",bg:"base.900"},children:[a.jsxs(H,{gap:4,children:[a.jsx(Ue,{fontWeight:500,variant:"subtext",children:t("modelManager.pickModelType")}),a.jsx(Su,{value:f,onChange:j=>h(j),defaultValue:"v1",name:"model_type",children:a.jsxs(H,{gap:4,children:[a.jsx(so,{value:"v1",children:a.jsx(Ue,{fontSize:"sm",children:t("modelManager.v1")})}),a.jsx(so,{value:"v2_base",children:a.jsx(Ue,{fontSize:"sm",children:t("modelManager.v2_base")})}),a.jsx(so,{value:"v2_768",children:a.jsx(Ue,{fontSize:"sm",children:t("modelManager.v2_768")})}),a.jsx(so,{value:"inpainting",children:a.jsx(Ue,{fontSize:"sm",children:t("modelManager.inpainting")})}),a.jsx(so,{value:"custom",children:a.jsx(Ue,{fontSize:"sm",children:t("modelManager.customConfig")})})]})})]}),f==="custom"&&a.jsxs(H,{flexDirection:"column",rowGap:2,children:[a.jsx(Ue,{fontWeight:"500",fontSize:"sm",variant:"subtext",children:t("modelManager.pathToCustomConfig")}),a.jsx(zn,{value:m,onChange:j=>{j.target.value!==""&&v(j.target.value)},width:"full"})]})]}),a.jsx(H,{flexDirection:"column",maxHeight:72,overflowY:"scroll",borderRadius:"sm",gap:2,children:r.length>0?P():a.jsx(Ue,{fontWeight:"500",padding:2,borderRadius:"sm",textAlign:"center",variant:"subtext",children:t("modelManager.noModelsFound")})})]})]})}const y4=64,b4=2048;function Pee(){const e=ne(),{t}=pe(),n=F(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},i=f=>{e(addNewModel(f)),e(qf(null))},[u,d]=L.useState(!1);return a.jsxs(jr,{gap:2,alignItems:"flex-start",children:[a.jsxs(H,{columnGap:4,children:[a.jsx(In,{isChecked:!u,label:t("modelManager.scanForModels"),onChange:()=>d(!u)}),a.jsx(In,{label:t("modelManager.addManually"),isChecked:u,onChange:()=>d(!u)})]}),u?a.jsx(zy,{initialValues:s,onSubmit:i,children:({handleSubmit:f,errors:h,touched:m})=>a.jsx($y,{onSubmit:f,sx:{w:"full"},children:a.jsxs(jr,{rowGap:2,children:[a.jsx(Ue,{fontSize:20,fontWeight:"bold",alignSelf:"start",children:t("modelManager.manual")}),a.jsx(ms,{children:a.jsxs(lr,{isInvalid:!!h.name&&m.name,isRequired:!0,children:[a.jsx(mr,{htmlFor:"name",fontSize:"sm",children:t("modelManager.name")}),a.jsxs(jr,{alignItems:"start",children:[a.jsx(mo,{as:zn,id:"name",name:"name",type:"text",validate:o,width:"full"}),h.name&&m.name?a.jsx(ho,{children:h.name}):a.jsx(To,{margin:0,children:t("modelManager.nameValidationMsg")})]})]})}),a.jsx(ms,{children:a.jsxs(lr,{isInvalid:!!h.description&&m.description,isRequired:!0,children:[a.jsx(mr,{htmlFor:"description",fontSize:"sm",children:t("modelManager.description")}),a.jsxs(jr,{alignItems:"start",children:[a.jsx(mo,{as:zn,id:"description",name:"description",type:"text",width:"full"}),h.description&&m.description?a.jsx(ho,{children:h.description}):a.jsx(To,{margin:0,children:t("modelManager.descriptionValidationMsg")})]})]})}),a.jsx(ms,{children:a.jsxs(lr,{isInvalid:!!h.config&&m.config,isRequired:!0,children:[a.jsx(mr,{htmlFor:"config",fontSize:"sm",children:t("modelManager.config")}),a.jsxs(jr,{alignItems:"start",children:[a.jsx(mo,{as:zn,id:"config",name:"config",type:"text",width:"full"}),h.config&&m.config?a.jsx(ho,{children:h.config}):a.jsx(To,{margin:0,children:t("modelManager.configValidationMsg")})]})]})}),a.jsx(ms,{children:a.jsxs(lr,{isInvalid:!!h.weights&&m.weights,isRequired:!0,children:[a.jsx(mr,{htmlFor:"config",fontSize:"sm",children:t("modelManager.modelLocation")}),a.jsxs(jr,{alignItems:"start",children:[a.jsx(mo,{as:zn,id:"weights",name:"weights",type:"text",width:"full"}),h.weights&&m.weights?a.jsx(ho,{children:h.weights}):a.jsx(To,{margin:0,children:t("modelManager.modelLocationValidationMsg")})]})]})}),a.jsx(ms,{children:a.jsxs(lr,{isInvalid:!!h.vae&&m.vae,children:[a.jsx(mr,{htmlFor:"vae",fontSize:"sm",children:t("modelManager.vaeLocation")}),a.jsxs(jr,{alignItems:"start",children:[a.jsx(mo,{as:zn,id:"vae",name:"vae",type:"text",width:"full"}),h.vae&&m.vae?a.jsx(ho,{children:h.vae}):a.jsx(To,{margin:0,children:t("modelManager.vaeLocationValidationMsg")})]})]})}),a.jsxs(oi,{width:"100%",children:[a.jsx(ms,{children:a.jsxs(lr,{isInvalid:!!h.width&&m.width,children:[a.jsx(mr,{htmlFor:"width",fontSize:"sm",children:t("modelManager.width")}),a.jsxs(jr,{alignItems:"start",children:[a.jsx(mo,{id:"width",name:"width",children:({field:v,form:y})=>a.jsx(sc,{id:"width",name:"width",min:y4,max:b4,step:64,value:y.values.width,onChange:S=>y.setFieldValue(v.name,Number(S))})}),h.width&&m.width?a.jsx(ho,{children:h.width}):a.jsx(To,{margin:0,children:t("modelManager.widthValidationMsg")})]})]})}),a.jsx(ms,{children:a.jsxs(lr,{isInvalid:!!h.height&&m.height,children:[a.jsx(mr,{htmlFor:"height",fontSize:"sm",children:t("modelManager.height")}),a.jsxs(jr,{alignItems:"start",children:[a.jsx(mo,{id:"height",name:"height",children:({field:v,form:y})=>a.jsx(sc,{id:"height",name:"height",min:y4,max:b4,step:64,value:y.values.height,onChange:S=>y.setFieldValue(v.name,Number(S))})}),h.height&&m.height?a.jsx(ho,{children:h.height}):a.jsx(To,{margin:0,children:t("modelManager.heightValidationMsg")})]})]})})]}),a.jsx(Yt,{type:"submit",className:"modal-close-btn",isLoading:n,children:t("modelManager.addModel")})]})})}):a.jsx(kee,{})]})}function _ee(){const e=ne(),{t}=pe(),n=F(u=>u.system.isProcessing);function r(u){return/\s/.test(u)}function o(u){let d;return r(u)&&(d=t("modelManager.cannotUseSpaces")),d}const s={name:"",description:"",repo_id:"",path:"",format:"diffusers",default:!1,vae:{repo_id:"",path:""}},i=u=>{const d=u;u.path===""&&delete d.path,u.repo_id===""&&delete d.repo_id,u.vae.path===""&&delete d.vae.path,u.vae.repo_id===""&&delete d.vae.repo_id,e(addNewModel(d)),e(qf(null))};return a.jsx(H,{overflow:"scroll",maxHeight:window.innerHeight-270,children:a.jsx(zy,{initialValues:s,onSubmit:i,children:({handleSubmit:u,errors:d,touched:f})=>{var h,m,v,y,S,w,C,k,P,j;return a.jsx($y,{onSubmit:u,children:a.jsxs(jr,{rowGap:2,children:[a.jsx(ms,{children:a.jsxs(lr,{isInvalid:!!d.name&&f.name,isRequired:!0,children:[a.jsx(mr,{htmlFor:"name",fontSize:"sm",children:t("modelManager.name")}),a.jsxs(jr,{alignItems:"start",children:[a.jsx(mo,{as:zn,id:"name",name:"name",type:"text",validate:o,width:"2xl",isRequired:!0}),d.name&&f.name?a.jsx(ho,{children:d.name}):a.jsx(To,{margin:0,children:t("modelManager.nameValidationMsg")})]})]})}),a.jsx(ms,{children:a.jsxs(lr,{isInvalid:!!d.description&&f.description,isRequired:!0,children:[a.jsx(mr,{htmlFor:"description",fontSize:"sm",children:t("modelManager.description")}),a.jsxs(jr,{alignItems:"start",children:[a.jsx(mo,{as:zn,id:"description",name:"description",type:"text",width:"2xl",isRequired:!0}),d.description&&f.description?a.jsx(ho,{children:d.description}):a.jsx(To,{margin:0,children:t("modelManager.descriptionValidationMsg")})]})]})}),a.jsxs(ms,{children:[a.jsx(Ue,{fontWeight:"bold",fontSize:"sm",children:t("modelManager.formMessageDiffusersModelLocation")}),a.jsx(Ue,{sx:{fontSize:"sm",fontStyle:"italic"},variant:"subtext",children:t("modelManager.formMessageDiffusersModelLocationDesc")}),a.jsxs(lr,{isInvalid:!!d.path&&f.path,children:[a.jsx(mr,{htmlFor:"path",fontSize:"sm",children:t("modelManager.modelLocation")}),a.jsxs(jr,{alignItems:"start",children:[a.jsx(mo,{as:zn,id:"path",name:"path",type:"text",width:"2xl"}),d.path&&f.path?a.jsx(ho,{children:d.path}):a.jsx(To,{margin:0,children:t("modelManager.modelLocationValidationMsg")})]})]}),a.jsxs(lr,{isInvalid:!!d.repo_id&&f.repo_id,children:[a.jsx(mr,{htmlFor:"repo_id",fontSize:"sm",children:t("modelManager.repo_id")}),a.jsxs(jr,{alignItems:"start",children:[a.jsx(mo,{as:zn,id:"repo_id",name:"repo_id",type:"text",width:"2xl"}),d.repo_id&&f.repo_id?a.jsx(ho,{children:d.repo_id}):a.jsx(To,{margin:0,children:t("modelManager.repoIDValidationMsg")})]})]})]}),a.jsxs(ms,{children:[a.jsx(Ue,{fontWeight:"bold",children:t("modelManager.formMessageDiffusersVAELocation")}),a.jsx(Ue,{sx:{fontSize:"sm",fontStyle:"italic"},variant:"subtext",children:t("modelManager.formMessageDiffusersVAELocationDesc")}),a.jsxs(lr,{isInvalid:!!((h=d.vae)!=null&&h.path)&&((m=f.vae)==null?void 0:m.path),children:[a.jsx(mr,{htmlFor:"vae.path",fontSize:"sm",children:t("modelManager.vaeLocation")}),a.jsxs(jr,{alignItems:"start",children:[a.jsx(mo,{as:zn,id:"vae.path",name:"vae.path",type:"text",width:"2xl"}),(v=d.vae)!=null&&v.path&&((y=f.vae)!=null&&y.path)?a.jsx(ho,{children:(S=d.vae)==null?void 0:S.path}):a.jsx(To,{margin:0,children:t("modelManager.vaeLocationValidationMsg")})]})]}),a.jsxs(lr,{isInvalid:!!((w=d.vae)!=null&&w.repo_id)&&((C=f.vae)==null?void 0:C.repo_id),children:[a.jsx(mr,{htmlFor:"vae.repo_id",fontSize:"sm",children:t("modelManager.vaeRepoID")}),a.jsxs(jr,{alignItems:"start",children:[a.jsx(mo,{as:zn,id:"vae.repo_id",name:"vae.repo_id",type:"text",width:"2xl"}),(k=d.vae)!=null&&k.repo_id&&((P=f.vae)!=null&&P.repo_id)?a.jsx(ho,{children:(j=d.vae)==null?void 0:j.repo_id}):a.jsx(To,{margin:0,children:t("modelManager.vaeRepoIDValidationMsg")})]})]})]}),a.jsx(Yt,{type:"submit",isLoading:n,children:t("modelManager.addModel")})]})})}})})}function jee(){const e=F(r=>r.ui.addNewModelUIOption),t=ne(),{t:n}=pe();return a.jsxs(H,{flexDirection:"column",gap:4,children:[a.jsxs(H,{columnGap:4,children:[a.jsx(Yt,{onClick:()=>t(qf("ckpt")),sx:{backgroundColor:e=="ckpt"?"accent.700":"base.700","&:hover":{backgroundColor:e=="ckpt"?"accent.700":"base.600"}},children:n("modelManager.addCheckpointModel")}),a.jsx(Yt,{onClick:()=>t(qf("diffusers")),sx:{backgroundColor:e=="diffusers"?"accent.700":"base.700","&:hover":{backgroundColor:e=="diffusers"?"accent.700":"base.600"}},children:n("modelManager.addDiffuserModel")})]}),a.jsx(Ra,{}),e=="ckpt"&&a.jsx(Pee,{}),e=="diffusers"&&a.jsx(_ee,{})]})}function x4(e){const{children:t,value:n}=e,[r,o]=tl("colors",["base.800","base.200"]);return a.jsx("option",{value:n,style:{background:r,color:o},children:t})}const Eee=e=>{const{label:t,isDisabled:n,validValues:r,tooltip:o,tooltipProps:s,horizontal:i,spaceEvenly:u,...d}=e;return a.jsxs(lr,{isDisabled:n,onClick:f=>{f.stopPropagation(),f.nativeEvent.stopImmediatePropagation(),f.nativeEvent.stopPropagation(),f.nativeEvent.cancelBubble=!0},sx:i?{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:4}:{},children:[t&&a.jsx(mr,{sx:u?{flexBasis:0,flexGrow:1}:{},children:t}),a.jsx(qn,{label:o,...s,children:a.jsx(k1,{...d,rootProps:{sx:u?{flexBasis:0,flexGrow:1}:{}},children:r.map(f=>typeof f=="string"||typeof f=="number"?a.jsx(x4,{value:f,children:f},f):a.jsx(x4,{value:f.value,children:f.key},f.value))})})]})},pv=p.memo(Eee);function Iee(){const{t:e}=pe(),t=ne(),{data:n}=Nu(),r=k7(n==null?void 0:n.entities,(A,J)=>(A==null?void 0:A.model_format)==="diffusers"),[o,s]=p.useState(Object.keys(r)[0]),[i,u]=p.useState(Object.keys(r)[1]),[d,f]=p.useState("none"),[h,m]=p.useState(""),[v,y]=p.useState(.5),[S,w]=p.useState("weighted_sum"),[C,k]=p.useState("root"),[P,j]=p.useState(""),[E,O]=p.useState(!1),I=Object.keys(r).filter(A=>A!==i&&A!==d),R=Object.keys(r).filter(A=>A!==o&&A!==d),T=[{key:e("modelManager.none"),value:"none"},...Object.keys(r).filter(A=>A!==o&&A!==i).map(A=>({key:A,value:A}))],D=F(A=>A.system.isProcessing),$=()=>{let A=[o,i,d];A=A.filter(z=>z!=="none");const J={models_to_merge:A,merged_model_name:h!==""?h:A.join("-"),alpha:v,interp:S,model_merge_save_path:C==="root"?null:P,force:E};t(mergeDiffusersModels(J))};return a.jsxs(H,{flexDirection:"column",rowGap:4,children:[a.jsxs(H,{sx:{flexDirection:"column",rowGap:1,bg:"base.900"},children:[a.jsx(Ue,{children:e("modelManager.modelMergeHeaderHelp1")}),a.jsx(Ue,{fontSize:"sm",variant:"subtext",children:e("modelManager.modelMergeHeaderHelp2")})]}),a.jsxs(H,{columnGap:4,children:[a.jsx(pv,{label:e("modelManager.modelOne"),validValues:I,onChange:A=>s(A.target.value)}),a.jsx(pv,{label:e("modelManager.modelTwo"),validValues:R,onChange:A=>u(A.target.value)}),a.jsx(pv,{label:e("modelManager.modelThree"),validValues:T,onChange:A=>{A.target.value!=="none"?(f(A.target.value),w("add_difference")):(f("none"),w("weighted_sum"))}})]}),a.jsx(zn,{label:e("modelManager.mergedModelName"),value:h,onChange:A=>m(A.target.value)}),a.jsxs(H,{sx:{flexDirection:"column",padding:4,borderRadius:"base",gap:4,bg:"base.900"},children:[a.jsx(vt,{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}),a.jsx(Ue,{variant:"subtext",fontSize:"sm",children:e("modelManager.modelMergeAlphaHelp")})]}),a.jsxs(H,{sx:{padding:4,borderRadius:"base",gap:4,bg:"base.900"},children:[a.jsx(Ue,{fontWeight:500,fontSize:"sm",variant:"subtext",children:e("modelManager.interpolationType")}),a.jsx(Su,{value:S,onChange:A=>w(A),children:a.jsx(H,{columnGap:4,children:d==="none"?a.jsxs(a.Fragment,{children:[a.jsx(so,{value:"weighted_sum",children:a.jsx(Ue,{fontSize:"sm",children:e("modelManager.weightedSum")})}),a.jsx(so,{value:"sigmoid",children:a.jsx(Ue,{fontSize:"sm",children:e("modelManager.sigmoid")})}),a.jsx(so,{value:"inv_sigmoid",children:a.jsx(Ue,{fontSize:"sm",children:e("modelManager.inverseSigmoid")})})]}):a.jsx(so,{value:"add_difference",children:a.jsx(qn,{label:e("modelManager.modelMergeInterpAddDifferenceHelp"),children:a.jsx(Ue,{fontSize:"sm",children:e("modelManager.addDifference")})})})})})]}),a.jsxs(H,{sx:{flexDirection:"column",padding:4,borderRadius:"base",gap:4,bg:"base.900"},children:[a.jsxs(H,{columnGap:4,children:[a.jsx(Ue,{fontWeight:"500",fontSize:"sm",variant:"subtext",children:e("modelManager.mergedModelSaveLocation")}),a.jsx(Su,{value:C,onChange:A=>k(A),children:a.jsxs(H,{columnGap:4,children:[a.jsx(so,{value:"root",children:a.jsx(Ue,{fontSize:"sm",children:e("modelManager.invokeAIFolder")})}),a.jsx(so,{value:"custom",children:a.jsx(Ue,{fontSize:"sm",children:e("modelManager.custom")})})]})})]}),C==="custom"&&a.jsx(zn,{label:e("modelManager.mergedModelCustomSaveLocation"),value:P,onChange:A=>j(A.target.value)})]}),a.jsx(In,{label:e("modelManager.ignoreMismatch"),isChecked:E,onChange:A=>O(A.target.checked),fontWeight:"500"}),a.jsx(Yt,{onClick:$,isLoading:D,isDisabled:C==="custom"&&P==="",children:e("modelManager.merge")})]})}var Oee=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,o,s;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(o=r;o--!==0;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(s=Object.keys(t),r=s.length,r!==Object.keys(n).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[o]))return!1;for(o=r;o--!==0;){var i=s[o];if(!e(t[i],n[i]))return!1}return!0}return t!==t&&n!==n};const S4=fc(Oee);function I0(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 Ree=Object.defineProperty,w4=Object.getOwnPropertySymbols,Tee=Object.prototype.hasOwnProperty,Mee=Object.prototype.propertyIsEnumerable,C4=(e,t,n)=>t in e?Ree(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Dee=(e,t)=>{for(var n in t||(t={}))Tee.call(t,n)&&C4(e,n,t[n]);if(w4)for(var n of w4(t))Mee.call(t,n)&&C4(e,n,t[n]);return e};function zE(e,t){if(t===null||typeof t!="object")return{};const n=Dee({},t);return Object.keys(t).forEach(r=>{r.includes(`${String(e)}.`)&&delete n[r]}),n}const Aee="__MANTINE_FORM_INDEX__";function k4(e,t){return t?typeof t=="boolean"?t:Array.isArray(t)?t.includes(e.replace(/[.][0-9]/g,`.${Aee}`)):!1:!1}function P4(e,t,n){typeof n.value=="object"&&(n.value=Al(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||t==="__proto__"?Object.defineProperty(e,t,n):e[t]=n.value}function Al(e){if(typeof e!="object")return e;var t=0,n,r,o,s=Object.prototype.toString.call(e);if(s==="[object Object]"?o=Object.create(e.__proto__||null):s==="[object Array]"?o=Array(e.length):s==="[object Set]"?(o=new Set,e.forEach(function(i){o.add(Al(i))})):s==="[object Map]"?(o=new Map,e.forEach(function(i,u){o.set(Al(u),Al(i))})):s==="[object Date]"?o=new Date(+e):s==="[object RegExp]"?o=new RegExp(e.source,e.flags):s==="[object DataView]"?o=new e.constructor(Al(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++)P4(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]||P4(o,n,Object.getOwnPropertyDescriptor(e,n))}return o||e}function $E(e){return typeof e!="string"?[]:e.split(".")}function im(e,t,n){const r=$E(e);if(r.length===0)return n;const o=Al(n);if(r.length===1)return o[r[0]]=t,o;let s=o[r[0]];for(let i=1;i<r.length-1;i+=1){if(s===void 0)return o;s=s[r[i]]}return s[r[r.length-1]]=t,o}function da(e,t){const n=$E(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 _4(e){const t=I0(e);return{hasErrors:Object.keys(t).length>0,errors:t}}function O0(e,t,n="",r={}){return typeof e!="object"||e===null?r:Object.keys(e).reduce((o,s)=>{const i=e[s],u=`${n===""?"":`${n}.`}${s}`,d=da(u,t);let f=!1;return typeof i=="function"&&(o[u]=i(d,t,u)),typeof i=="object"&&Array.isArray(d)&&(f=!0,d.forEach((h,m)=>O0(i,t,`${u}.${m}`,o))),typeof i=="object"&&typeof d=="object"&&d!==null&&(f||O0(i,t,u,o)),o},r)}function R0(e,t){return _4(typeof e=="function"?e(t):O0(e,t))}function Ef(e,t,n){if(typeof e!="string")return{hasError:!1,error:null};const r=R0(t,n),o=Object.keys(r.errors).find(s=>e.split(".").every((i,u)=>i===s.split(".")[u]));return{hasError:!!o,error:o?r.errors[o]:null}}function Nee(e,{from:t,to:n},r){const o=da(e,r);if(!Array.isArray(o))return r;const s=[...o],i=o[t];return s.splice(t,1),s.splice(n,0,i),im(e,s,r)}var zee=Object.defineProperty,j4=Object.getOwnPropertySymbols,$ee=Object.prototype.hasOwnProperty,Lee=Object.prototype.propertyIsEnumerable,E4=(e,t,n)=>t in e?zee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Fee=(e,t)=>{for(var n in t||(t={}))$ee.call(t,n)&&E4(e,n,t[n]);if(j4)for(var n of j4(t))Lee.call(t,n)&&E4(e,n,t[n]);return e};function Bee(e,{from:t,to:n},r){const o=`${e}.${t}`,s=`${e}.${n}`,i=Fee({},r);return Object.keys(r).every(u=>{let d,f;if(u.startsWith(o)&&(d=u,f=u.replace(o,s)),u.startsWith(s)&&(d=u.replace(s,o),f=u),d&&f){const h=i[d],m=i[f];return m===void 0?delete i[d]:i[d]=m,h===void 0?delete i[f]:i[f]=h,!1}return!0}),i}function Hee(e,t,n){const r=da(e,n);return Array.isArray(r)?im(e,r.filter((o,s)=>s!==t),n):n}var Wee=Object.defineProperty,I4=Object.getOwnPropertySymbols,Vee=Object.prototype.hasOwnProperty,Uee=Object.prototype.propertyIsEnumerable,O4=(e,t,n)=>t in e?Wee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Gee=(e,t)=>{for(var n in t||(t={}))Vee.call(t,n)&&O4(e,n,t[n]);if(I4)for(var n of I4(t))Uee.call(t,n)&&O4(e,n,t[n]);return e};function R4(e,t){const n=e.substring(t.length+1).split(".")[0];return parseInt(n,10)}function T4(e,t,n,r){if(t===void 0)return n;const o=`${String(e)}`;let s=n;r===-1&&(s=zE(`${o}.${t}`,s));const i=Gee({},s),u=new Set;return Object.entries(s).filter(([d])=>{if(!d.startsWith(`${o}.`))return!1;const f=R4(d,o);return Number.isNaN(f)?!1:f>=t}).forEach(([d,f])=>{const h=R4(d,o),m=d.replace(`${o}.${h}`,`${o}.${h+r}`);i[m]=f,u.add(m),u.has(d)||delete i[d]}),i}function qee(e,t,n,r){const o=da(e,r);if(!Array.isArray(o))return r;const s=[...o];return s.splice(typeof n=="number"?n:s.length,0,t),im(e,s,r)}function M4(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 Kee(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 Yee=Object.defineProperty,Xee=Object.defineProperties,Qee=Object.getOwnPropertyDescriptors,D4=Object.getOwnPropertySymbols,Zee=Object.prototype.hasOwnProperty,Jee=Object.prototype.propertyIsEnumerable,A4=(e,t,n)=>t in e?Yee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qa=(e,t)=>{for(var n in t||(t={}))Zee.call(t,n)&&A4(e,n,t[n]);if(D4)for(var n of D4(t))Jee.call(t,n)&&A4(e,n,t[n]);return e},hv=(e,t)=>Xee(e,Qee(t));function LE({initialValues:e={},initialErrors:t={},initialDirty:n={},initialTouched:r={},clearInputErrorOnChange:o=!0,validateInputOnChange:s=!1,validateInputOnBlur:i=!1,transformValues:u=f=>f,validate:d}={}){const[f,h]=p.useState(r),[m,v]=p.useState(n),[y,S]=p.useState(e),[w,C]=p.useState(I0(t)),k=p.useRef(e),P=Y=>{k.current=Y},j=p.useCallback(()=>h({}),[]),E=Y=>{const ae=Y?qa(qa({},y),Y):y;P(ae),v({})},O=p.useCallback(Y=>C(ae=>I0(typeof Y=="function"?Y(ae):Y)),[]),I=p.useCallback(()=>C({}),[]),R=p.useCallback(()=>{S(e),I(),P(e),v({}),j()},[]),T=p.useCallback((Y,ae)=>O(ue=>hv(qa({},ue),{[Y]:ae})),[]),D=p.useCallback(Y=>O(ae=>{if(typeof Y!="string")return ae;const ue=qa({},ae);return delete ue[Y],ue}),[]),$=p.useCallback(Y=>v(ae=>{if(typeof Y!="string")return ae;const ue=zE(Y,ae);return delete ue[Y],ue}),[]),A=p.useCallback((Y,ae)=>{const ue=k4(Y,s);$(Y),h(xe=>hv(qa({},xe),{[Y]:!0})),S(xe=>{const oe=im(Y,ae,xe);if(ue){const ge=Ef(Y,d,oe);ge.hasError?T(Y,ge.error):D(Y)}return oe}),!ue&&o&&T(Y,null)},[]),J=p.useCallback(Y=>{S(ae=>{const ue=typeof Y=="function"?Y(ae):Y;return qa(qa({},ae),ue)}),o&&I()},[]),z=p.useCallback((Y,ae)=>{$(Y),S(ue=>Nee(Y,ae,ue)),C(ue=>Bee(Y,ae,ue))},[]),B=p.useCallback((Y,ae)=>{$(Y),S(ue=>Hee(Y,ae,ue)),C(ue=>T4(Y,ae,ue,-1))},[]),G=p.useCallback((Y,ae,ue)=>{$(Y),S(xe=>qee(Y,ae,ue,xe)),C(xe=>T4(Y,ue,xe,1))},[]),K=p.useCallback(()=>{const Y=R0(d,y);return C(Y.errors),Y},[y,d]),N=p.useCallback(Y=>{const ae=Ef(Y,d,y);return ae.hasError?T(Y,ae.error):D(Y),ae},[y,d]),V=(Y,{type:ae="input",withError:ue=!0,withFocus:xe=!0}={})=>{const ge={onChange:Kee(fe=>A(Y,fe))};return ue&&(ge.error=w[Y]),ae==="checkbox"?ge.checked=da(Y,y):ge.value=da(Y,y),xe&&(ge.onFocus=()=>h(fe=>hv(qa({},fe),{[Y]:!0})),ge.onBlur=()=>{if(k4(Y,i)){const fe=Ef(Y,d,y);fe.hasError?T(Y,fe.error):D(Y)}}),ge},W=(Y,ae)=>ue=>{ue==null||ue.preventDefault();const xe=K();xe.hasErrors?ae==null||ae(xe.errors,y,ue):Y==null||Y(u(y),ue)},U=Y=>u(Y||y),re=p.useCallback(Y=>{Y.preventDefault(),R()},[]),ve=Y=>{if(Y){const ue=da(Y,m);if(typeof ue=="boolean")return ue;const xe=da(Y,y),oe=da(Y,k.current);return!S4(xe,oe)}return Object.keys(m).length>0?M4(m):!S4(y,k.current)},le=p.useCallback(Y=>M4(f,Y),[f]),se=p.useCallback(Y=>Y?!Ef(Y,d,y).hasError:!R0(d,y).hasErrors,[y,d]);return{values:y,errors:w,setValues:J,setErrors:O,setFieldValue:A,setFieldError:T,clearFieldError:D,clearErrors:I,reset:R,validate:K,validateField:N,reorderListItem:z,removeListItem:B,insertListItem:G,getInputProps:V,onSubmit:W,onReset:re,isDirty:ve,isTouched:le,setTouched:h,setDirty:v,resetTouched:j,resetDirty:E,isValid:se,getTransformedValues:U}}const ete=rt((e,t)=>{const{t:n}=pe(),{acceptButtonText:r=n("common.accept"),acceptCallback:o,cancelButtonText:s=n("common.cancel"),cancelCallback:i,children:u,title:d,triggerComponent:f}=e,{isOpen:h,onOpen:m,onClose:v}=ya(),y=p.useRef(null),S=()=>{o(),v()},w=()=>{i&&i(),v()};return a.jsxs(a.Fragment,{children:[p.cloneElement(f,{onClick:m,ref:t}),a.jsx(Vu,{isOpen:h,leastDestructiveRef:y,onClose:v,isCentered:!0,children:a.jsx(Ca,{children:a.jsxs(Uu,{children:[a.jsx(wa,{fontSize:"lg",fontWeight:"bold",children:d}),a.jsx(ka,{children:u}),a.jsxs(Sa,{children:[a.jsx(Yt,{ref:y,onClick:w,children:s}),a.jsx(Yt,{colorScheme:"error",onClick:S,ml:3,children:r})]})]})})})]})}),Ly=p.memo(ete);function tte(e){const{model:t}=e,n=ne(),{t:r}=pe(),[o,s]=p.useState("same"),[i,u]=p.useState("");p.useEffect(()=>{s("same")},[t]);const d=()=>{s("same")},f=()=>{const h={model_name:t,save_location:o,custom_location:o==="custom"&&i!==""?i:null};n(convertToDiffusers(h))};return a.jsxs(Ly,{title:`${r("modelManager.convert")} ${t.name}`,acceptCallback:f,cancelCallback:d,acceptButtonText:`${r("modelManager.convert")}`,triggerComponent:a.jsxs(Yt,{size:"sm","aria-label":r("modelManager.convertToDiffusers"),className:" modal-close-btn",children:["🧨 ",r("modelManager.convertToDiffusers")]}),motionPreset:"slideInBottom",children:[a.jsxs(H,{flexDirection:"column",rowGap:4,children:[a.jsx(Ue,{children:r("modelManager.convertToDiffusersHelpText1")}),a.jsxs(bh,{children:[a.jsx(Mo,{children:r("modelManager.convertToDiffusersHelpText2")}),a.jsx(Mo,{children:r("modelManager.convertToDiffusersHelpText3")}),a.jsx(Mo,{children:r("modelManager.convertToDiffusersHelpText4")}),a.jsx(Mo,{children:r("modelManager.convertToDiffusersHelpText5")})]}),a.jsx(Ue,{children:r("modelManager.convertToDiffusersHelpText6")})]}),a.jsxs(H,{flexDir:"column",gap:4,children:[a.jsxs(H,{marginTop:4,flexDir:"column",gap:2,children:[a.jsx(Ue,{fontWeight:"600",children:r("modelManager.convertToDiffusersSaveLocation")}),a.jsx(Su,{value:o,onChange:h=>s(h),children:a.jsxs(H,{gap:4,children:[a.jsx(so,{value:"same",children:a.jsx(qn,{label:"Save converted model in the same folder",children:r("modelManager.sameFolder")})}),a.jsx(so,{value:"root",children:a.jsx(qn,{label:"Save converted model in the InvokeAI root folder",children:r("modelManager.invokeRoot")})}),a.jsx(so,{value:"custom",children:a.jsx(qn,{label:"Save converted model in a custom folder",children:r("modelManager.custom")})})]})})]}),o==="custom"&&a.jsxs(H,{flexDirection:"column",rowGap:2,children:[a.jsx(Ue,{fontWeight:"500",fontSize:"sm",variant:"subtext",children:r("modelManager.customSaveLocation")}),a.jsx(zn,{value:i,onChange:h=>{h.target.value!==""&&u(h.target.value)},width:"full"})]})]})]})}const nte=[{value:"sd-1",label:$r["sd-1"]},{value:"sd-2",label:$r["sd-2"]}],rte=[{value:"normal",label:"Normal"},{value:"inpaint",label:"Inpaint"},{value:"depth",label:"Depth"}];function ote(e){const t=F(u=>u.system.isProcessing),{modelToEdit:n,retrievedModel:r}=e;ne();const{t:o}=pe(),s=LE({initialValues:{name:r.model_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}}),i=u=>{console.log(u)};return n?a.jsxs(H,{flexDirection:"column",rowGap:4,width:"100%",children:[a.jsxs(H,{justifyContent:"space-between",alignItems:"center",children:[a.jsxs(H,{flexDirection:"column",children:[a.jsx(Ue,{fontSize:"lg",fontWeight:"bold",children:r.model_name}),a.jsxs(Ue,{fontSize:"sm",color:"base.400",children:[$r[r.base_model]," Model"]})]}),a.jsx(tte,{model:r})]}),a.jsx(Ra,{}),a.jsx(H,{flexDirection:"column",maxHeight:window.innerHeight-270,overflowY:"scroll",children:a.jsx("form",{onSubmit:s.onSubmit(u=>i(u)),children:a.jsxs(H,{flexDirection:"column",overflowY:"scroll",gap:4,children:[a.jsx(zn,{label:o("modelManager.name"),...s.getInputProps("name")}),a.jsx(zn,{label:o("modelManager.description"),...s.getInputProps("description")}),a.jsx(Kn,{label:o("modelManager.baseModel"),data:nte,...s.getInputProps("base_model")}),a.jsx(Kn,{label:o("modelManager.variant"),data:rte,...s.getInputProps("variant")}),a.jsx(zn,{label:o("modelManager.modelLocation"),...s.getInputProps("path")}),a.jsx(zn,{label:o("modelManager.vaeLocation"),...s.getInputProps("vae")}),a.jsx(zn,{label:o("modelManager.config"),...s.getInputProps("config")}),a.jsx(Yt,{disabled:t,type:"submit",children:o("modelManager.updateModel")})]})})})]}):a.jsx(H,{sx:{width:"100%",justifyContent:"center",alignItems:"center",borderRadius:"base",bg:"base.900"},children:a.jsx(Ue,{fontWeight:500,children:"Pick A Model To Edit"})})}const ste=[{value:"sd-1",label:$r["sd-1"]},{value:"sd-2",label:$r["sd-2"]}],ate=[{value:"normal",label:"Normal"},{value:"inpaint",label:"Inpaint"},{value:"depth",label:"Depth"}];function ite(e){const t=F(u=>u.system.isProcessing),{retrievedModel:n,modelToEdit:r}=e;ne();const{t:o}=pe(),s=LE({initialValues:{name:n.model_name,base_model:n.base_model,type:"main",path:n.path,description:n.description,model_format:"diffusers",vae:n.vae,variant:n.variant}}),i=u=>{console.log(u)};return r?a.jsxs(H,{flexDirection:"column",rowGap:4,width:"100%",children:[a.jsxs(H,{flexDirection:"column",children:[a.jsx(Ue,{fontSize:"lg",fontWeight:"bold",children:n.model_name}),a.jsxs(Ue,{fontSize:"sm",color:"base.400",children:[$r[n.base_model]," Model"]})]}),a.jsx(Ra,{}),a.jsx("form",{onSubmit:s.onSubmit(u=>i(u)),children:a.jsxs(H,{flexDirection:"column",overflowY:"scroll",gap:4,children:[a.jsx(zn,{label:o("modelManager.name"),...s.getInputProps("name")}),a.jsx(zn,{label:o("modelManager.description"),...s.getInputProps("description")}),a.jsx(Kn,{label:o("modelManager.baseModel"),data:ste,...s.getInputProps("base_model")}),a.jsx(Kn,{label:o("modelManager.variant"),data:ate,...s.getInputProps("variant")}),a.jsx(zn,{label:o("modelManager.modelLocation"),...s.getInputProps("path")}),a.jsx(zn,{label:o("modelManager.vaeLocation"),...s.getInputProps("vae")}),a.jsx(Yt,{disabled:t,type:"submit",children:o("modelManager.updateModel")})]})})]}):a.jsx(H,{sx:{width:"100%",justifyContent:"center",alignItems:"center",borderRadius:"base",bg:"base.900"},children:a.jsx(Ue,{fontWeight:"500",children:"Pick A Model To Edit"})})}function If(e){const{isProcessing:t,isConnected:n}=F(m=>m.system),r=F(m=>m.system.openModel),{t:o}=pe(),s=ne(),{modelKey:i,name:u,description:d}=e,f=()=>{s(Zx(i))},h=()=>{s(deleteModel(i)),s(Zx(null))};return a.jsxs(H,{alignItems:"center",p:2,borderRadius:"base",sx:i===r?{bg:"accent.750",_hover:{bg:"accent.750"}}:{_hover:{bg:"base.750"}},children:[a.jsx(Ge,{onClick:f,cursor:"pointer",children:a.jsx(qn,{label:d,hasArrow:!0,placement:"bottom",children:a.jsx(Ue,{fontWeight:"600",children:u})})}),a.jsx(Oa,{onClick:f,cursor:"pointer"}),a.jsxs(H,{gap:2,alignItems:"center",children:[a.jsx(je,{icon:a.jsx(l$,{}),size:"sm",onClick:f,"aria-label":o("accessibility.modifyConfig"),isDisabled:status==="active"||t||!n}),a.jsx(Ly,{title:o("modelManager.deleteModel"),acceptCallback:h,acceptButtonText:o("modelManager.delete"),triggerComponent:a.jsx(je,{icon:a.jsx(u$,{}),size:"sm","aria-label":o("modelManager.deleteConfig"),isDisabled:status==="active"||t||!n,colorScheme:"error"}),children:a.jsxs(H,{rowGap:4,flexDirection:"column",children:[a.jsx("p",{style:{fontWeight:"bold"},children:o("modelManager.deleteMsg1")}),a.jsx("p",{children:o("modelManager.deleteMsg2")})]})})]})]})}function mv({label:e,isActive:t,onClick:n}){return a.jsx(Yt,{onClick:n,isActive:t,sx:{_active:{bg:"accent.750"}},size:"sm",children:e})}const lte=()=>{const{data:e}=Nu(),[t,n]=L.useState(!1);L.useEffect(()=>{const v=setTimeout(()=>{n(!0)},200);return()=>clearTimeout(v)},[]);const[r,o]=p.useState(""),[s,i]=p.useState("all"),[u,d]=p.useTransition(),{t:f}=pe(),h=v=>{d(()=>{o(v.target.value)})},m=p.useMemo(()=>{const v=[],y=[],S=[],w=[];if(!e)return;const C=e.entities;return Object.keys(C).forEach((k,P)=>{var j,E,O,I,R,T,D;(j=C[k])!=null&&j.model_name.toLowerCase().includes(r.toLowerCase())&&(S.push(a.jsx(If,{modelKey:k,name:(E=C[k])==null?void 0:E.model_name,description:C[k].description},P)),((O=C[k])==null?void 0:O.model_format)===s&&w.push(a.jsx(If,{modelKey:k,name:(I=C[k])==null?void 0:I.model_name,description:C[k].description},P))),((R=C[k])==null?void 0:R.model_format)!=="diffusers"?v.push(a.jsx(If,{modelKey:k,name:(T=C[k])==null?void 0:T.model_name,description:C[k].description},P)):y.push(a.jsx(If,{modelKey:k,name:(D=C[k])==null?void 0:D.model_name,description:C[k].description},P))}),r!==""?s==="all"?a.jsx(Ge,{marginTop:4,children:S}):a.jsx(Ge,{marginTop:4,children:w}):a.jsxs(H,{flexDirection:"column",rowGap:6,children:[s==="all"&&a.jsxs(a.Fragment,{children:[a.jsxs(Ge,{children:[a.jsx(Ue,{sx:{fontWeight:"500",py:2,px:4,mb:4,borderRadius:"base",width:"max-content",fontSize:"sm",bg:"base.750"},children:f("modelManager.diffusersModels")}),y]}),a.jsxs(Ge,{children:[a.jsx(Ue,{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"&&a.jsx(H,{flexDirection:"column",marginTop:4,children:y}),s==="ckpt"&&a.jsx(H,{flexDirection:"column",marginTop:4,children:v})]})},[e,r,f,s]);return a.jsxs(H,{flexDirection:"column",rowGap:4,width:"50%",minWidth:"50%",children:[a.jsx(zn,{onChange:h,label:f("modelManager.search")}),a.jsxs(H,{flexDirection:"column",gap:4,maxHeight:window.innerHeight-240,overflow:"scroll",paddingInlineEnd:4,children:[a.jsxs(H,{columnGap:2,children:[a.jsx(mv,{label:f("modelManager.allModels"),onClick:()=>i("all"),isActive:s==="all"}),a.jsx(mv,{label:f("modelManager.diffusersModels"),onClick:()=>i("diffusers"),isActive:s==="diffusers"}),a.jsx(mv,{label:f("modelManager.checkpointModels"),onClick:()=>i("ckpt"),isActive:s==="ckpt"})]}),t?m:a.jsx(H,{width:"100%",minHeight:96,justifyContent:"center",alignItems:"center",children:a.jsx(ui,{})})]})]})};function cte(){const{data:e}=Nu(),t=F(r=>r.system.openModel),n=()=>{if(!(!t||!e))return e.entities[t].model_format==="diffusers"?a.jsx(ite,{modelToEdit:t,retrievedModel:e.entities[t]},t):a.jsx(ote,{modelToEdit:t,retrievedModel:e.entities[t]},t)};return a.jsxs(H,{width:"100%",columnGap:8,children:[a.jsx(lte,{}),n()]})}const FE=[{id:"modelManager",label:Pr.t("modelManager.modelManager"),content:a.jsx(cte,{})},{id:"addModels",label:Pr.t("modelManager.addModel"),content:a.jsx(jee,{})},{id:"mergeModels",label:Pr.t("modelManager.mergeModels"),content:a.jsx(Iee,{})}],ute=()=>{const e=[];return FE.forEach(t=>{e.push(a.jsx(Rh,{children:t.label},t.id))}),a.jsx(Eh,{sx:{w:"100%",color:"base.200",flexDirection:"row",borderBottomWidth:2,borderColor:"accent.700"},children:e})},dte=()=>{const e=[];return FE.forEach(t=>{e.push(a.jsx(Ih,{children:t.content},t.id))}),a.jsx(Oh,{sx:{p:2},children:e})},fte=()=>a.jsxs(jh,{isLazy:!0,variant:"invokeAI",sx:{w:"full",h:"full",p:2,gap:4,flexDirection:"column"},children:[ute(),dte()]}),pte=p.memo(fte);const hte=e=>Ce([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}}),mte=e=>{const{nodeId:t,title:n,description:r}=e;return a.jsxs(H,{sx:{borderTopRadius:"md",alignItems:"center",justifyContent:"space-between",px:2,py:1,bg:"base.300",_dark:{bg:"base.700"}},children:[a.jsx(qn,{label:t,children:a.jsx(ua,{size:"xs",sx:{fontWeight:600,color:"base.900",_dark:{color:"base.100"}},children:n})}),a.jsx(qn,{label:r,placement:"top",hasArrow:!0,shouldWrapChildren:!0,children:a.jsx(go,{sx:{h:"min-content",color:"base.700",_dark:{color:"base.300"}},as:Kz})})]})},BE=p.memo(mte),gte={position:"absolute",width:"1rem",height:"1rem",borderWidth:0},vte={left:"-1rem"},yte={right:"-0.5rem"},bte=e=>{const{field:t,isValidConnection:n,handleType:r,styles:o}=e,{name:s,type:i}=t;return a.jsx(qn,{label:i,placement:r==="target"?"start":"end",hasArrow:!0,openDelay:$3,children:a.jsx(P7,{type:r,id:s,isValidConnection:n,position:r==="target"?Jx.Left:Jx.Right,style:{backgroundColor:L3[i].colorCssVar,...o,...gte,...r==="target"?vte:yte}})})},HE=p.memo(bte),WE=()=>{const e=hh();return p.useCallback(({source:n,sourceHandle:r,target:o,targetHandle:s})=>(e.getEdges(),e.getNodes(),!0),[e])},xte=e=>a.jsx(Xz,{}),Ste=p.memo(xte),wte=e=>{const{nodeId:t,field:n}=e,r=ne(),o=s=>{r(_s({nodeId:t,fieldName:n.name,value:s.target.checked}))};return a.jsx(_1,{onChange:o,isChecked:n.value})},Cte=p.memo(wte),kte=e=>null,Pte=p.memo(kte);function lm(){return(lm=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 VE(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 T0(e){var t=p.useRef(e),n=p.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var dc=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e<t?t:e},hu=function(e){return"touches"in e},M0=function(e){return e&&e.ownerDocument.defaultView||self},N4=function(e,t,n){var r=e.getBoundingClientRect(),o=hu(t)?function(s,i){for(var u=0;u<s.length;u++)if(s[u].identifier===i)return s[u];return s[0]}(t.touches,n):t;return{left:dc((o.pageX-(r.left+M0(e).pageXOffset))/r.width),top:dc((o.pageY-(r.top+M0(e).pageYOffset))/r.height)}},z4=function(e){!hu(e)&&e.preventDefault()},Fy=L.memo(function(e){var t=e.onMove,n=e.onKey,r=VE(e,["onMove","onKey"]),o=p.useRef(null),s=T0(t),i=T0(n),u=p.useRef(null),d=p.useRef(!1),f=p.useMemo(function(){var y=function(C){z4(C),(hu(C)?C.touches.length>0:C.buttons>0)&&o.current?s(N4(o.current,C,u.current)):w(!1)},S=function(){return w(!1)};function w(C){var k=d.current,P=M0(o.current),j=C?P.addEventListener:P.removeEventListener;j(k?"touchmove":"mousemove",y),j(k?"touchend":"mouseup",S)}return[function(C){var k=C.nativeEvent,P=o.current;if(P&&(z4(k),!function(E,O){return O&&!hu(E)}(k,d.current)&&P)){if(hu(k)){d.current=!0;var j=k.changedTouches||[];j.length&&(u.current=j[0].identifier)}P.focus(),s(N4(P,k,u.current)),w(!0)}},function(C){var k=C.which||C.keyCode;k<37||k>40||(C.preventDefault(),i({left:k===39?.05:k===37?-.05:0,top:k===40?.05:k===38?-.05:0}))},w]},[i,s]),h=f[0],m=f[1],v=f[2];return p.useEffect(function(){return v},[v]),L.createElement("div",lm({},r,{onTouchStart:h,onMouseDown:h,className:"react-colorful__interactive",ref:o,onKeyDown:m,tabIndex:0,role:"slider"}))}),cm=function(e){return e.filter(Boolean).join(" ")},By=function(e){var t=e.color,n=e.left,r=e.top,o=r===void 0?.5:r,s=cm(["react-colorful__pointer",e.className]);return L.createElement("div",{className:s,style:{top:100*o+"%",left:100*n+"%"}},L.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},ao=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},UE=function(e){var t=e.s,n=e.v,r=e.a,o=(200-t)*n/100;return{h:ao(e.h),s:ao(o>0&&o<200?t*n/100/(o<=100?o:200-o)*100:0),l:ao(o/2),a:ao(r,2)}},D0=function(e){var t=UE(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},gv=function(e){var t=UE(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},_te=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var s=Math.floor(t),i=r*(1-n),u=r*(1-(t-s)*n),d=r*(1-(1-t+s)*n),f=s%6;return{r:ao(255*[r,u,i,i,d,r][f]),g:ao(255*[d,r,r,u,i,i][f]),b:ao(255*[i,i,d,r,r,u][f]),a:ao(o,2)}},jte=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,s=Math.max(t,n,r),i=s-Math.min(t,n,r),u=i?s===t?(n-r)/i:s===n?2+(r-t)/i:4+(t-n)/i:0;return{h:ao(60*(u<0?u+6:u)),s:ao(s?i/s*100:0),v:ao(s/255*100),a:o}},Ete=L.memo(function(e){var t=e.hue,n=e.onChange,r=cm(["react-colorful__hue",e.className]);return L.createElement("div",{className:r},L.createElement(Fy,{onMove:function(o){n({h:360*o.left})},onKey:function(o){n({h:dc(t+360*o.left,0,360)})},"aria-label":"Hue","aria-valuenow":ao(t),"aria-valuemax":"360","aria-valuemin":"0"},L.createElement(By,{className:"react-colorful__hue-pointer",left:t/360,color:D0({h:t,s:100,v:100,a:1})})))}),Ite=L.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:D0({h:t.h,s:100,v:100,a:1})};return L.createElement("div",{className:"react-colorful__saturation",style:r},L.createElement(Fy,{onMove:function(o){n({s:100*o.left,v:100-100*o.top})},onKey:function(o){n({s:dc(t.s+100*o.left,0,100),v:dc(t.v-100*o.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+ao(t.s)+"%, Brightness "+ao(t.v)+"%"},L.createElement(By,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:D0(t)})))}),GE=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function Ote(e,t,n){var r=T0(n),o=p.useState(function(){return e.toHsva(t)}),s=o[0],i=o[1],u=p.useRef({color:t,hsva:s});p.useEffect(function(){if(!e.equal(t,u.current.color)){var f=e.toHsva(t);u.current={hsva:f,color:t},i(f)}},[t,e]),p.useEffect(function(){var f;GE(s,u.current.hsva)||e.equal(f=e.fromHsva(s),u.current.color)||(u.current={hsva:s,color:f},r(f))},[s,e,r]);var d=p.useCallback(function(f){i(function(h){return Object.assign({},h,f)})},[]);return[s,d]}var Rte=typeof window<"u"?p.useLayoutEffect:p.useEffect,Tte=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},$4=new Map,Mte=function(e){Rte(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!$4.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}`,$4.set(t,n);var r=Tte();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},Dte=function(e){var t=e.className,n=e.hsva,r=e.onChange,o={backgroundImage:"linear-gradient(90deg, "+gv(Object.assign({},n,{a:0}))+", "+gv(Object.assign({},n,{a:1}))+")"},s=cm(["react-colorful__alpha",t]),i=ao(100*n.a);return L.createElement("div",{className:s},L.createElement("div",{className:"react-colorful__alpha-gradient",style:o}),L.createElement(Fy,{onMove:function(u){r({a:u.left})},onKey:function(u){r({a:dc(n.a+u.left)})},"aria-label":"Alpha","aria-valuetext":i+"%","aria-valuenow":i,"aria-valuemin":"0","aria-valuemax":"100"},L.createElement(By,{className:"react-colorful__alpha-pointer",left:n.a,color:gv(n)})))},Ate=function(e){var t=e.className,n=e.colorModel,r=e.color,o=r===void 0?n.defaultColor:r,s=e.onChange,i=VE(e,["className","colorModel","color","onChange"]),u=p.useRef(null);Mte(u);var d=Ote(n,o,s),f=d[0],h=d[1],m=cm(["react-colorful",t]);return L.createElement("div",lm({},i,{ref:u,className:m}),L.createElement(Ite,{hsva:f,onChange:h}),L.createElement(Ete,{hue:f.h,onChange:h}),L.createElement(Dte,{hsva:f,onChange:h,className:"react-colorful__last-control"}))},Nte={defaultColor:{r:0,g:0,b:0,a:1},toHsva:jte,fromHsva:_te,equal:GE},qE=function(e){return L.createElement(Ate,lm({},e,{colorModel:Nte}))};const zte=e=>{const{nodeId:t,field:n}=e,r=ne(),o=s=>{r(_s({nodeId:t,fieldName:n.name,value:s}))};return a.jsx(qE,{className:"nodrag",color:n.value,onChange:o})},$te=p.memo(zte),Lte=e=>null,Fte=p.memo(Lte),Bte=e=>null,Hte=p.memo(Bte),Wte=e=>{const{nodeId:t,field:n,template:r}=e,o=ne(),s=i=>{o(_s({nodeId:t,fieldName:n.name,value:i.target.value}))};return a.jsx(k1,{onChange:s,value:n.value,children:r.options.map(i=>a.jsx("option",{children:i},i))})},Vte=p.memo(Wte),Ute=e=>{var f;const{nodeId:t,field:n}=e,r=ne();p.useCallback(({image_name:h})=>{r(_s({nodeId:t,fieldName:n.name,value:_7([...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:i,active:u,over:d}=Du({id:`node_${t}`,data:o});return p.useCallback(()=>{r(_s({nodeId:t,fieldName:n.name,value:void 0}))},[r,n.name,t]),a.jsxs(H,{ref:i,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})=>a.jsx(qte,{imageName:h},h)),Kl(o,u)&&a.jsx(Zl,{isOver:s})]})},Gte=p.memo(Ute),qte=e=>{const{currentData:t}=Ks(e.imageName);return a.jsx(Yi,{imageDTO:t,isDropDisabled:!0,isDragDisabled:!0})},Kte=e=>{var v;const{nodeId:t,field:n}=e,r=ne(),{currentData:o,isLoading:s,isError:i,isSuccess:u}=Ks(((v=n.value)==null?void 0:v.image_name)??Do.skipToken),d=p.useCallback(()=>{r(_s({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 a.jsx(H,{sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center"},children:a.jsx(Yi,{imageDTO:o,droppableData:h,draggableData:f,onClickReset:d,postUploadAction:m})})},Yte=p.memo(Kte),Xte=e=>a.jsx(Iz,{}),L4=p.memo(Xte),Qte=e=>null,Zte=p.memo(Qte),Jte=e=>{const{nodeId:t,field:n}=e,r=ne();pe();const{data:o}=j3(),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]),i=p.useMemo(()=>{if(!o)return[];const d=[];return Xs(o.entities,(f,h)=>{f&&d.push({value:h,label:f.model_name,group:$r[f.base_model]})}),d},[o]),u=p.useCallback(d=>{d&&r(_s({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];G0(d)&&u(d)},[n.value,u,o==null?void 0:o.ids]),a.jsx(Kn,{tooltip:s==null?void 0:s.description,label:(s==null?void 0:s.base_model)&&$r[s==null?void 0:s.base_model],value:n.value,placeholder:"Pick one",data:i,onChange:u})},ene=p.memo(Jte),tne=e=>{const{nodeId:t,field:n}=e,r=ne();pe();const{data:o}=Nu(),{data:s}=_3(),i=p.useMemo(()=>{if(!o)return[];const f=[];return Xs(o.entities,(h,m)=>{h&&f.push({value:m,label:h.model_name,group:$r[h.base_model]})}),s&&Xs(s.entities,(h,m)=>{h&&f.push({value:m,label:h.model_name,group:$r[h.base_model]})}),f},[o,s]),u=p.useMemo(()=>(o==null?void 0:o.entities[n.value??o.ids[0]])||(s==null?void 0:s.entities[n.value??s.ids[0]]),[o==null?void 0:o.entities,o==null?void 0:o.ids,s==null?void 0:s.entities,s==null?void 0:s.ids,n.value]),d=p.useCallback(f=>{f&&r(_s({nodeId:t,fieldName:n.name,value:f}))},[r,n.name,t]);return p.useEffect(()=>{if(n.value&&(o!=null&&o.ids.includes(n.value)||s!=null&&s.ids.includes(n.value)))return;const f=(o==null?void 0:o.ids[0])||(s==null?void 0:s.ids[0]);G0(f)&&d(f)},[n.value,d,o==null?void 0:o.ids,s==null?void 0:s.ids]),a.jsx(Kn,{tooltip:u==null?void 0:u.description,label:(u==null?void 0:u.base_model)&&$r[u==null?void 0:u.base_model],value:n.value,placeholder:"Pick one",data:i,onChange:d})},nne=p.memo(tne),rne=e=>{const{nodeId:t,field:n}=e,r=ne(),o=(s,i)=>{r(_s({nodeId:t,fieldName:n.name,value:i}))};return a.jsxs(O3,{onChange:o,value:n.value,step:e.template.type==="integer"?1:.1,precision:e.template.type==="integer"?0:3,children:[a.jsx(R3,{}),a.jsxs(T3,{children:[a.jsx(M3,{}),a.jsx(D3,{})]})]})},one=p.memo(rne),sne=e=>{const{nodeId:t,field:n}=e,r=ne(),o=s=>{r(_s({nodeId:t,fieldName:n.name,value:s.target.value}))};return a.jsx(Fu,{onChange:o,value:n.value})},ane=p.memo(sne),ine=e=>null,lne=p.memo(ine),cne=e=>null,une=p.memo(cne),dne=e=>{const{nodeId:t,field:n}=e,r=ne();pe();const{data:o}=A3(),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]),i=p.useMemo(()=>{if(!o)return[];const d=[];return Xs(o.entities,(f,h)=>{f&&d.push({value:h,label:f.model_name,group:$r[f.base_model]})}),d},[o]),u=p.useCallback(d=>{d&&r(_s({nodeId:t,fieldName:n.name,value:d}))},[r,n.name,t]);return p.useEffect(()=>{n.value&&(o!=null&&o.ids.includes(n.value))||u("auto")},[n.value,u,o==null?void 0:o.ids]),a.jsx(Kn,{tooltip:s==null?void 0:s.description,label:(s==null?void 0:s.base_model)&&$r[s==null?void 0:s.base_model],value:n.value,placeholder:"Pick one",data:i,onChange:u})},fne=p.memo(dne),pne=e=>{const{nodeId:t,field:n,template:r}=e,{type:o}=n;return o==="string"&&r.type==="string"?a.jsx(ane,{nodeId:t,field:n,template:r}):o==="boolean"&&r.type==="boolean"?a.jsx(Cte,{nodeId:t,field:n,template:r}):o==="integer"&&r.type==="integer"||o==="float"&&r.type==="float"?a.jsx(one,{nodeId:t,field:n,template:r}):o==="enum"&&r.type==="enum"?a.jsx(Vte,{nodeId:t,field:n,template:r}):o==="image"&&r.type==="image"?a.jsx(Yte,{nodeId:t,field:n,template:r}):o==="latents"&&r.type==="latents"?a.jsx(Zte,{nodeId:t,field:n,template:r}):o==="conditioning"&&r.type==="conditioning"?a.jsx(Fte,{nodeId:t,field:n,template:r}):o==="unet"&&r.type==="unet"?a.jsx(lne,{nodeId:t,field:n,template:r}):o==="clip"&&r.type==="clip"?a.jsx(Pte,{nodeId:t,field:n,template:r}):o==="vae"&&r.type==="vae"?a.jsx(une,{nodeId:t,field:n,template:r}):o==="control"&&r.type==="control"?a.jsx(Hte,{nodeId:t,field:n,template:r}):o==="model"&&r.type==="model"?a.jsx(nne,{nodeId:t,field:n,template:r}):o==="vae_model"&&r.type==="vae_model"?a.jsx(fne,{nodeId:t,field:n,template:r}):o==="lora_model"&&r.type==="lora_model"?a.jsx(ene,{nodeId:t,field:n,template:r}):o==="array"&&r.type==="array"?a.jsx(Ste,{nodeId:t,field:n,template:r}):o==="item"&&r.type==="item"?a.jsx(L4,{nodeId:t,field:n,template:r}):o==="color"&&r.type==="color"?a.jsx($te,{nodeId:t,field:n,template:r}):o==="item"&&r.type==="item"?a.jsx(L4,{nodeId:t,field:n,template:r}):o==="image_collection"&&r.type==="image_collection"?a.jsx(Gte,{nodeId:t,field:n,template:r}):a.jsxs(Ge,{p:2,children:["Unknown field type: ",o]})},hne=p.memo(pne);function mne(e){const{nodeId:t,input:n,template:r,connected:o}=e,s=WE();return a.jsx(Ge,{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:a.jsx(lr,{isDisabled:r?o:!0,pl:2,children:r?a.jsxs(a.Fragment,{children:[a.jsxs(oi,{justifyContent:"space-between",alignItems:"center",children:[a.jsx(oi,{children:a.jsx(qn,{label:r==null?void 0:r.description,placement:"top",hasArrow:!0,shouldWrapChildren:!0,openDelay:$3,children:a.jsx(mr,{children:r==null?void 0:r.title})})}),a.jsx(hne,{nodeId:t,field:n,template:r})]}),!["never","directOnly"].includes((r==null?void 0:r.inputRequirement)??"")&&a.jsx(HE,{nodeId:t,field:r,isValidConnection:s,handleType:"target"})]}):a.jsx(oi,{justifyContent:"space-between",alignItems:"center",children:a.jsxs(mr,{children:["Unknown input: ",n.name]})})})})}const gne=e=>{const{nodeId:t,template:n,inputs:r}=e,o=F(i=>i.nodes.edges);return p.useCallback(()=>{const i=[],u=Rs(r);return u.forEach((d,f)=>{const h=n.inputs[d.name],m=!!o.filter(v=>v.target===t&&v.targetHandle===d.name).length;f<u.length&&i.push(a.jsx(Ra,{},`${d.id}.divider`)),i.push(a.jsx(mne,{nodeId:t,input:d,template:h,connected:m},d.id))}),a.jsx(H,{flexDir:"column",gap:2,p:2,children:i})},[o,r,t,n.inputs])()},vne=p.memo(gne);function yne(e){const{nodeId:t,output:n,template:r,connected:o}=e,s=WE();return a.jsx(Ge,{position:"relative",children:a.jsx(lr,{isDisabled:r?o:!0,paddingRight:3,children:r?a.jsxs(a.Fragment,{children:[a.jsx(mr,{textAlign:"end",padding:1,children:r==null?void 0:r.title}),a.jsx(HE,{nodeId:t,field:r,isValidConnection:s,handleType:"source"},n.id)]}):a.jsx(oi,{justifyContent:"space-between",alignItems:"center",children:a.jsxs(mr,{color:"error.400",children:["Unknown Output: ",n.name]})})})})}const bne=e=>{const{nodeId:t,template:n,outputs:r}=e,o=F(i=>i.nodes.edges);return p.useCallback(()=>{const i=[];return Rs(r).forEach(d=>{const f=n.outputs[d.name],h=!!o.filter(m=>m.source===t&&m.sourceHandle===d.name).length;i.push(a.jsx(yne,{nodeId:t,output:d,template:f,connected:h},d.id))}),a.jsx(H,{flexDir:"column",children:i})},[o,t,r,n.outputs])()},xne=p.memo(bne),Sne=e=>{const{...t}=e;return a.jsx(hN,{style:{position:"absolute",border:"none",background:"transparent",width:15,height:15,bottom:0,right:0},minWidth:F3,...t})},A0=p.memo(Sne),N0=e=>{const[t,n]=tl("shadows",["nodeSelectedOutline","dark-lg"]);return a.jsx(Ge,{sx:{position:"relative",borderRadius:"md",minWidth:F3,shadow:e.selected?`${t}, ${n}`:`${n}`},children:e.children})},KE=p.memo(e=>{const{id:t,data:n,selected:r}=e,{type:o,inputs:s,outputs:i}=n,u=p.useMemo(()=>hte(o),[o]),d=F(u);return d?a.jsxs(N0,{selected:r,children:[a.jsx(BE,{nodeId:t,title:d.title,description:d.description}),a.jsxs(H,{sx:{flexDirection:"column",borderBottomRadius:"md",py:2,bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsx(xne,{nodeId:t,outputs:i,template:d}),a.jsx(vne,{nodeId:t,inputs:s,template:d})]}),a.jsx(A0,{})]}):a.jsx(N0,{selected:r,children:a.jsxs(H,{sx:{alignItems:"center",justifyContent:"center"},children:[a.jsx(go,{as:Fz,sx:{boxSize:32,color:"base.600",_dark:{color:"base.400"}}}),a.jsx(A0,{})]})})});KE.displayName="InvocationComponent";const wne=e=>{const t=F(r=>r.system.progressImage),{selected:n}=e;return a.jsxs(N0,{selected:n,children:[a.jsx(BE,{title:"Progress Image",description:"Displays the progress image in the Node Editor"}),a.jsx(H,{sx:{flexDirection:"column",borderBottomRadius:"md",p:2,bg:"base.200",_dark:{bg:"base.800"}},children:t?a.jsx(Au,{src:t.dataURL,sx:{w:"full",h:"full",objectFit:"contain"}}):a.jsx(H,{sx:{w:"full",h:"full",minW:32,minH:32,alignItems:"center",justifyContent:"center"},children:a.jsx(xc,{})})}),a.jsx(A0,{maxHeight:(t==null?void 0:t.height)??512,maxWidth:(t==null?void 0:t.width)??512})]})},Cne=p.memo(wne),kne=()=>{const{zoomIn:e,zoomOut:t,fitView:n}=hh(),r=ne(),o=F(f=>f.nodes.shouldShowGraphOverlay),s=p.useCallback(()=>{e()},[e]),i=p.useCallback(()=>{t()},[t]),u=p.useCallback(()=>{n()},[n]),d=p.useCallback(()=>{r(j7(!o))},[o,r]);return a.jsxs(gr,{isAttached:!0,orientation:"vertical",children:[a.jsx(je,{onClick:s,"aria-label":"Zoom In",icon:a.jsx(Mh,{})}),a.jsx(je,{onClick:i,"aria-label":"Zoom Out",icon:a.jsx(Zz,{})}),a.jsx(je,{onClick:u,"aria-label":"Fit to Viewport",icon:a.jsx(R1,{})}),a.jsx(je,{isChecked:o,onClick:d,"aria-label":"Show/Hide Graph",icon:a.jsx(I1,{})})]})},Pne=p.memo(kne),_ne=()=>a.jsx(Tu,{position:"bottom-left",children:a.jsx(Pne,{})}),jne=p.memo(_ne),Ene=()=>{const e=Of({background:"var(--invokeai-colors-base-200)"},{background:"var(--invokeai-colors-base-500)"}),t=Of("var(--invokeai-colors-accent-300)","var(--invokeai-colors-accent-700)"),n=Of("var(--invokeai-colors-blackAlpha-300)","var(--invokeai-colors-blackAlpha-600)");return a.jsx(oN,{nodeStrokeWidth:3,pannable:!0,zoomable:!0,nodeBorderRadius:30,style:e,nodeColor:t,maskColor:n})},Ine=p.memo(Ene),One=()=>{const{t:e}=pe(),t=ne(),{fitView:n}=hh(),r=p.useRef(null),o=p.useCallback(s=>{var u;if(!s)return;const i=new FileReader;i.onload=async()=>{const d=i.result,f=await JSON.parse(String(d));f||t(_v(jv({title:e("toast.nodesLoadedFailed"),status:"error"}))),f&&(t(E7(f.nodes)),t(I7(f.edges)),n(),t(_v(jv({title:e("toast.nodesLoaded"),status:"success"})))),i.abort()},i.readAsText(s),(u=r.current)==null||u.call(r)},[n,t,e]);return a.jsx(wj,{resetRef:r,accept:"application/json",onChange:o,children:s=>a.jsx(je,{icon:a.jsx(Yu,{}),tooltip:e("nodes.loadNodes"),"aria-label":e("nodes.loadNodes"),...s})})},Rne=p.memo(One);function Tne(e){const{iconButton:t=!1,...n}=e,r=ne(),o=F(Sr),s=Wr(),i=p.useCallback(()=>{r(Q0("nodes"))},[r]),{t:u}=pe();return Ke(["ctrl+enter","meta+enter"],i,{enabled:()=>s,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[s,o]),a.jsx(Ge,{style:{flexGrow:4},position:"relative",children:a.jsxs(Ge,{style:{position:"relative"},children:[!s&&a.jsx(Ge,{borderRadius:"base",style:{position:"absolute",bottom:"0",left:"0",right:"0",height:"100%",overflow:"clip"},children:a.jsx(OE,{})}),t?a.jsx(je,{"aria-label":u("parameters.invoke"),type:"submit",icon:a.jsx(Ck,{}),isDisabled:!s,onClick:i,flexGrow:1,w:"100%",tooltip:u("parameters.invoke"),tooltipProps:{placement:"bottom"},colorScheme:"accent",id:"invoke-button",_disabled:{background:"none",_hover:{background:"none"}},...n}):a.jsx(Yt,{"aria-label":u("parameters.invoke"),type:"submit",isDisabled:!s,onClick:i,flexGrow:1,w:"100%",colorScheme:"accent",id:"invoke-button",fontWeight:700,_disabled:{background:"none",_hover:{background:"none"}},...n,children:"Invoke"})]})})}function Mne(){const{t:e}=pe(),t=ne(),n=p.useCallback(()=>{t(O7())},[t]);return a.jsx(je,{icon:a.jsx(i$,{}),tooltip:e("nodes.reloadSchema"),"aria-label":e("nodes.reloadSchema"),onClick:n})}const Dne=()=>{const{t:e}=pe(),t=F(o=>o.nodes.editorInstance),n=F(o=>o.nodes.nodes),r=p.useCallback(()=>{if(t){const o=t.toObject();o.edges=Rs(o.edges,u=>R7(u,["style"]));const s=new Blob([JSON.stringify(o)]),i=document.createElement("a");i.href=URL.createObjectURL(s),i.download="MyNodes.json",document.body.appendChild(i),i.click(),i.remove()}},[t]);return a.jsx(je,{icon:a.jsx(Dh,{}),fontSize:18,tooltip:e("nodes.saveNodes"),"aria-label":e("nodes.saveNodes"),onClick:r,isDisabled:n.length===0})},Ane=p.memo(Dne),Nne=()=>{const{t:e}=pe(),t=ne(),{isOpen:n,onOpen:r,onClose:o}=ya(),s=p.useRef(null),i=F(d=>d.nodes.nodes),u=p.useCallback(()=>{t(T7()),t(_v(jv({title:e("toast.nodesCleared"),status:"success"}))),o()},[t,e,o]);return a.jsxs(a.Fragment,{children:[a.jsx(je,{icon:a.jsx(io,{}),tooltip:e("nodes.clearNodes"),"aria-label":e("nodes.clearNodes"),onClick:r,isDisabled:i.length===0}),a.jsxs(Vu,{isOpen:n,onClose:o,leastDestructiveRef:s,isCentered:!0,children:[a.jsx(Ca,{}),a.jsxs(Uu,{children:[a.jsx(wa,{fontSize:"lg",fontWeight:"bold",children:e("nodes.clearNodes")}),a.jsx(ka,{children:a.jsx(Ue,{children:e("common.clearNodes")})}),a.jsxs(Sa,{children:[a.jsx(Ff,{ref:s,onClick:o,children:e("common.cancel")}),a.jsx(Ff,{colorScheme:"red",ml:3,onClick:u,children:e("common.accept")})]})]})]})]})},zne=p.memo(Nne),$ne=()=>a.jsx(Tu,{position:"top-center",children:a.jsxs(oi,{children:[a.jsx(Tne,{}),a.jsx(om,{}),a.jsx(Mne,{}),a.jsx(Ane,{}),a.jsx(Rne,{}),a.jsx(zne,{})]})}),Lne=p.memo($ne),Fne=(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},Bne=Ce([e=>e.nodes],e=>e.invocationTemplates),Hne=()=>{const e=F(Bne),t=hh();return p.useCallback(n=>{if(n==="progress_image"){const{x:h,y:m}=t.project({x:window.innerWidth/2.5,y:window.innerHeight/8});return{id:"progress_image",type:"progress_image",position:{x:h,y:m},data:{}}}const r=e[n];if(r===void 0){console.error(`Unable to find template ${n}.`);return}const o=Ai(),s=e2(r.inputs,(h,m,v)=>{const y=Ai(),S=Fne(y,m);return h[v]=S,h},{}),i=e2(r.outputs,(h,m,v)=>{const S={id:Ai(),name:v,type:m.type};return h[v]=S,h},{}),{x:u,y:d}=t.project({x:window.innerWidth/2.5,y:window.innerHeight/8});return{id:o,type:"invocation",position:{x:u,y:d},data:{id:o,type:n,inputs:s,outputs:i}}},[e,t])},Wne=Ce(M7,e=>{const t=Rs(e.invocationTemplates,n=>({label:n.title,value:n.type,description:n.description}));return t.push({label:"Progress Image",value:"progress_image",description:"Displays the progress image in the Node Editor"}),{data:t}},Ct),Vne=()=>{const e=ne(),{data:t}=F(Wne),n=Hne(),r=Mu(),o=p.useCallback(i=>{const u=n(i);if(!u){r({status:"error",title:`Unknown Invocation type ${i}`});return}e(D7(u))},[e,n,r]),s=p.useCallback(i=>{i&&o(i)},[o]);return a.jsx(H,{sx:{gap:2,alignItems:"center"},children:a.jsx(Kn,{selectOnBlur:!1,placeholder:"Add Node",value:null,data:t,maxDropdownHeight:400,nothingFound:"No matching nodes",itemComponent:YE,filter:(i,u)=>u.label.toLowerCase().includes(i.toLowerCase().trim())||u.value.toLowerCase().includes(i.toLowerCase().trim())||u.description.toLowerCase().includes(i.toLowerCase().trim()),onChange:s,sx:{width:"18rem"}})})},YE=p.forwardRef(({label:e,description:t,...n},r)=>a.jsx("div",{ref:r,...n,children:a.jsxs("div",{children:[a.jsx(Ue,{children:e}),a.jsx(Ue,{size:"xs",color:"base.600",children:t})]})}));YE.displayName="SelectItem";const Une=()=>a.jsx(Tu,{position:"top-left",children:a.jsx(Vne,{})}),Gne=p.memo(Une),qne=()=>a.jsx(H,{sx:{gap:2,flexDir:"column"},children:Rs(L3,({title:e,description:t,color:n},r)=>a.jsx(qn,{label:t,children:a.jsx(Ql,{colorScheme:n,sx:{userSelect:"none"},textAlign:"center",children:e})},r))}),Kne=p.memo(qne),Yne=()=>{const e=F(n=>n),t=A7(e);return a.jsx(Ge,{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)})},Xne=p.memo(Yne),Qne=()=>{const e=F(t=>t.nodes.shouldShowGraphOverlay);return a.jsxs(Tu,{position:"top-right",children:[a.jsx(Kne,{}),e&&a.jsx(Xne,{})]})},Zne=p.memo(Qne),Jne={invocation:KE,progress_image:Cne},ere=()=>{const e=ne(),t=F(f=>f.nodes.nodes),n=F(f=>f.nodes.edges),r=p.useCallback(f=>{e(N7(f))},[e]),o=p.useCallback(f=>{e(z7(f))},[e]),s=p.useCallback((f,h)=>{e($7(h))},[e]),i=p.useCallback(f=>{e(L7(f))},[e]),u=p.useCallback(()=>{e(F7())},[e]),d=p.useCallback(f=>{e(B7(f)),f&&f.fitView()},[e]);return a.jsxs(H7,{nodeTypes:Jne,nodes:t,edges:n,onNodesChange:r,onEdgesChange:o,onConnectStart:s,onConnect:i,onConnectEnd:u,onInit:d,defaultEdgeOptions:{style:{strokeWidth:2}},children:[a.jsx(Gne,{}),a.jsx(Lne,{}),a.jsx(Zne,{}),a.jsx(jne,{}),a.jsx(uN,{}),a.jsx(Ine,{})]})},tre=()=>a.jsx(Ge,{layerStyle:"first",sx:{position:"relative",width:"full",height:"full",borderRadius:"base"},children:a.jsx(W7,{children:a.jsx(ere,{})})}),nre=p.memo(tre),rre=()=>a.jsx(nre,{}),ore=p.memo(rre),sre=e=>e.postprocessing,are=Ce([sre],({hiresFix:e,hiresStrength:t})=>({hiresFix:e,hiresStrength:t}),{memoizeOptions:{resultEqualityCheck:Wt}}),ire=()=>{const{hiresFix:e,hiresStrength:t}=F(are),n=ne(),{t:r}=pe(),o=i=>{n(t2(i))},s=()=>{n(t2(.75))};return a.jsx(vt,{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})},lre=()=>{const e=ne(),t=F(o=>o.postprocessing.hiresFix),{t:n}=pe(),r=o=>e(V7(o.target.checked));return a.jsx(jn,{label:n("parameters.hiresOptim"),isChecked:t,onChange:r})},cre=Ce(rn,e=>({activeLabel:e.postprocessing.hiresFix?"Enabled":void 0}),Ct),ure=()=>{const{t:e}=pe(),{activeLabel:t}=F(cre);return Gn("hires").isFeatureEnabled?a.jsx(ko,{label:e("parameters.hiresOptim"),activeLabel:t,children:a.jsxs(H,{sx:{gap:2,flexDirection:"column"},children:[a.jsx(lre,{}),a.jsx(ire,{})]})}):null},dre=p.memo(ure),fre=Ce(rn,({ui:e,generation:t})=>{const{shouldUseSliders:n}=e,{shouldRandomizeSeed:r}=t;return{shouldUseSliders:n,activeLabel:r?void 0:"Manual Seed"}},Ct),pre=()=>{const{shouldUseSliders:e,activeLabel:t}=F(fre);return a.jsx(ko,{label:"General",activeLabel:t,defaultIsOpen:!0,children:a.jsx(H,{sx:{flexDirection:"column",gap:3},children:e?a.jsxs(a.Fragment,{children:[a.jsx(ic,{}),a.jsx(cc,{}),a.jsx(ac,{}),a.jsx(lc,{}),a.jsx(Ge,{pt:2,children:a.jsx(uc,{})}),a.jsx(rh,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs(H,{gap:3,children:[a.jsx(ic,{}),a.jsx(cc,{}),a.jsx(ac,{})]}),a.jsx(lc,{}),a.jsx(Ge,{pt:2,children:a.jsx(uc,{})}),a.jsx(rh,{})]})})})},hre=p.memo(pre),mre=()=>a.jsxs(a.Fragment,{children:[a.jsx(Ty,{}),a.jsx(Ry,{}),a.jsx(Ny,{}),a.jsx(hre,{}),a.jsx(_y,{}),a.jsx(ky,{}),a.jsx(Iy,{}),a.jsx(Dy,{}),a.jsx(EE,{}),a.jsx(My,{}),a.jsx(dre,{}),a.jsx(IE,{}),a.jsx(jy,{})]}),XE=p.memo(mre),gre=()=>a.jsxs(H,{sx:{gap:4,w:"full",h:"full"},children:[a.jsx(Cy,{children:a.jsx(XE,{})}),a.jsx(CE,{})]}),vre=p.memo(gre);var z0={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Konva=void 0;var n=n2;Object.defineProperty(t,"Konva",{enumerable:!0,get:function(){return n.Konva}});const r=n2;e.exports=r.Konva})(z0,z0.exports);var yre=z0.exports;const Iu=fc(yre);var QE={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 bre=function(t){var n={},r=p,o=Rf,s=Object.assign;function i(l){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+l,g=1;g<arguments.length;g++)c+="&args[]="+encodeURIComponent(arguments[g]);return"Minified React error #"+l+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var u=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,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"),w=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),E=Symbol.for("react.offscreen"),O=Symbol.iterator;function I(l){return l===null||typeof l!="object"?null:(l=O&&l[O]||l["@@iterator"],typeof l=="function"?l:null)}function R(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 C:return"Suspense";case k: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 w:var c=l.render;return l=l.displayName,l||(l=c.displayName||c.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case P:return c=l.displayName||null,c!==null?c:R(l.type)||"Memo";case j:c=l._payload,l=l._init;try{return R(l(c))}catch{}}return null}function T(l){var c=l.type;switch(l.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return l=c.render,l=l.displayName||l.name||"",c.displayName||(l!==""?"ForwardRef("+l+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return R(c);case 8:return c===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 c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function D(l){var c=l,g=l;if(l.alternate)for(;c.return;)c=c.return;else{l=c;do c=l,c.flags&4098&&(g=c.return),l=c.return;while(l)}return c.tag===3?g:null}function $(l){if(D(l)!==l)throw Error(i(188))}function A(l){var c=l.alternate;if(!c){if(c=D(l),c===null)throw Error(i(188));return c!==l?null:l}for(var g=l,b=c;;){var x=g.return;if(x===null)break;var _=x.alternate;if(_===null){if(b=x.return,b!==null){g=b;continue}break}if(x.child===_.child){for(_=x.child;_;){if(_===g)return $(x),l;if(_===b)return $(x),c;_=_.sibling}throw Error(i(188))}if(g.return!==b.return)g=x,b=_;else{for(var M=!1,Q=x.child;Q;){if(Q===g){M=!0,g=x,b=_;break}if(Q===b){M=!0,b=x,g=_;break}Q=Q.sibling}if(!M){for(Q=_.child;Q;){if(Q===g){M=!0,g=_,b=x;break}if(Q===b){M=!0,b=_,g=x;break}Q=Q.sibling}if(!M)throw Error(i(189))}}if(g.alternate!==b)throw Error(i(190))}if(g.tag!==3)throw Error(i(188));return g.stateNode.current===g?l:c}function J(l){return l=A(l),l!==null?z(l):null}function z(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){var c=z(l);if(c!==null)return c;l=l.sibling}return null}function B(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){if(l.tag!==4){var c=B(l);if(c!==null)return c}l=l.sibling}return null}var G=Array.isArray,K=t.getPublicInstance,N=t.getRootHostContext,V=t.getChildHostContext,W=t.prepareForCommit,U=t.resetAfterCommit,re=t.createInstance,ve=t.appendInitialChild,le=t.finalizeInitialChildren,se=t.prepareUpdate,Y=t.shouldSetTextContent,ae=t.createTextInstance,ue=t.scheduleTimeout,xe=t.cancelTimeout,oe=t.noTimeout,ge=t.isPrimaryRenderer,fe=t.supportsMutation,Pe=t.supportsPersistence,Ae=t.supportsHydration,ye=t.getInstanceFromNode,Oe=t.preparePortalMount,at=t.getCurrentEventPriority,Fe=t.detachDeletedInstance,Ye=t.supportsMicrotasks,jt=t.scheduleMicrotask,xt=t.supportsTestSelectors,Fn=t.findFiberRoot,X=t.getBoundingRect,we=t.getTextContent,te=t.isHiddenSubtree,he=t.matchAccessibilityRole,Ne=t.setFocusIfFocusable,Xe=t.setupIntersectionObserver,yt=t.appendChild,Xt=t.appendChildToContainer,ln=t.commitTextUpdate,kn=t.commitMount,vr=t.commitUpdate,cn=t.insertBefore,Yn=t.insertInContainerBefore,Re=t.removeChild,et=t.removeChildFromContainer,it=t.resetTextContent,ut=t.hideInstance,Nt=t.hideTextInstance,yr=t.unhideInstance,un=t.unhideTextInstance,xn=t.clearContainer,Cr=t.cloneInstance,Pn=t.createContainerChildSet,En=t.appendChildToContainerChildSet,is=t.finalizeContainerChildren,dn=t.replaceContainerChildren,zo=t.cloneHiddenInstance,$o=t.cloneHiddenTextInstance,$n=t.canHydrateInstance,ls=t.canHydrateTextInstance,Da=t.canHydrateSuspenseInstance,Er=t.isSuspenseInstancePending,Lo=t.isSuspenseInstanceFallback,na=t.getSuspenseInstanceFallbackErrorDetails,Aa=t.registerSuspenseInstanceRetry,cs=t.getNextHydratableSibling,q=t.getFirstHydratableChild,Z=t.getFirstHydratableChildWithinContainer,de=t.getFirstHydratableChildWithinSuspenseInstance,be=t.hydrateInstance,Se=t.hydrateTextInstance,Qe=t.hydrateSuspenseInstance,pt=t.getNextHydratableInstanceAfterSuspenseInstance,zt=t.commitHydratedContainer,lt=t.commitHydratedSuspenseInstance,Be=t.clearSuspenseBoundary,qe=t.clearSuspenseBoundaryFromContainer,ke=t.shouldDeleteUnhydratedTailInstances,He=t.didNotMatchHydratedContainerTextInstance,St=t.didNotMatchHydratedTextInstance,kt;function Rt(l){if(kt===void 0)try{throw Error()}catch(g){var c=g.stack.trim().match(/\n( *(at )?)/);kt=c&&c[1]||""}return`
|
||
`+kt+l}var Lt=!1;function Ut(l,c){if(!l||Lt)return"";Lt=!0;var g=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(c)if(c=function(){throw Error()},Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(De){var b=De}Reflect.construct(l,[],c)}else{try{c.call()}catch(De){b=De}l.call(c.prototype)}else{try{throw Error()}catch(De){b=De}l()}}catch(De){if(De&&b&&typeof De.stack=="string"){for(var x=De.stack.split(`
|
||
`),_=b.stack.split(`
|
||
`),M=x.length-1,Q=_.length-1;1<=M&&0<=Q&&x[M]!==_[Q];)Q--;for(;1<=M&&0<=Q;M--,Q--)if(x[M]!==_[Q]){if(M!==1||Q!==1)do if(M--,Q--,0>Q||x[M]!==_[Q]){var ce=`
|
||
`+x[M].replace(" at new "," at ");return l.displayName&&ce.includes("<anonymous>")&&(ce=ce.replace("<anonymous>",l.displayName)),ce}while(1<=M&&0<=Q);break}}}finally{Lt=!1,Error.prepareStackTrace=g}return(l=l?l.displayName||l.name:"")?Rt(l):""}var Ft=Object.prototype.hasOwnProperty,Ee=[],ht=-1;function Tt(l){return{current:l}}function Mt(l){0>ht||(l.current=Ee[ht],Ee[ht]=null,ht--)}function $t(l,c){ht++,Ee[ht]=l.current,l.current=c}var fn={},Vt=Tt(fn),Qt=Tt(!1),Cn=fn;function Ir(l,c){var g=l.type.contextTypes;if(!g)return fn;var b=l.stateNode;if(b&&b.__reactInternalMemoizedUnmaskedChildContext===c)return b.__reactInternalMemoizedMaskedChildContext;var x={},_;for(_ in g)x[_]=c[_];return b&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=c,l.__reactInternalMemoizedMaskedChildContext=x),x}function Xn(l){return l=l.childContextTypes,l!=null}function wt(){Mt(Qt),Mt(Vt)}function Sn(l,c,g){if(Vt.current!==fn)throw Error(i(168));$t(Vt,c),$t(Qt,g)}function _n(l,c,g){var b=l.stateNode;if(c=c.childContextTypes,typeof b.getChildContext!="function")return g;b=b.getChildContext();for(var x in b)if(!(x in c))throw Error(i(108,T(l)||"Unknown",x));return s({},g,b)}function Qn(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||fn,Cn=Vt.current,$t(Vt,l),$t(Qt,Qt.current),!0}function dr(l,c,g){var b=l.stateNode;if(!b)throw Error(i(169));g?(l=_n(l,c,Cn),b.__reactInternalMemoizedMergedChildContext=l,Mt(Qt),Mt(Vt),$t(Vt,l)):Mt(Qt),$t(Qt,g)}var Rn=Math.clz32?Math.clz32:gn,Tn=Math.log,tn=Math.LN2;function gn(l){return l>>>=0,l===0?32:31-(Tn(l)/tn|0)|0}var wn=64,pn=4194304;function hn(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 We(l,c){var g=l.pendingLanes;if(g===0)return 0;var b=0,x=l.suspendedLanes,_=l.pingedLanes,M=g&268435455;if(M!==0){var Q=M&~x;Q!==0?b=hn(Q):(_&=M,_!==0&&(b=hn(_)))}else M=g&~x,M!==0?b=hn(M):_!==0&&(b=hn(_));if(b===0)return 0;if(c!==0&&c!==b&&!(c&x)&&(x=b&-b,_=c&-c,x>=_||x===16&&(_&4194240)!==0))return c;if(b&4&&(b|=g&16),c=l.entangledLanes,c!==0)for(l=l.entanglements,c&=b;0<c;)g=31-Rn(c),x=1<<g,b|=l[g],c&=~x;return b}function Pt(l,c){switch(l){case 1:case 2:case 4:return c+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 c+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 gt(l,c){for(var g=l.suspendedLanes,b=l.pingedLanes,x=l.expirationTimes,_=l.pendingLanes;0<_;){var M=31-Rn(_),Q=1<<M,ce=x[M];ce===-1?(!(Q&g)||Q&b)&&(x[M]=Pt(Q,c)):ce<=c&&(l.expiredLanes|=Q),_&=~Q}}function tt(l){return l=l.pendingLanes&-1073741825,l!==0?l:l&1073741824?1073741824:0}function mt(){var l=wn;return wn<<=1,!(wn&4194240)&&(wn=64),l}function Dt(l){for(var c=[],g=0;31>g;g++)c.push(l);return c}function dt(l,c,g){l.pendingLanes|=c,c!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,c=31-Rn(c),l[c]=g}function Je(l,c){var g=l.pendingLanes&~c;l.pendingLanes=c,l.suspendedLanes=0,l.pingedLanes=0,l.expiredLanes&=c,l.mutableReadLanes&=c,l.entangledLanes&=c,c=l.entanglements;var b=l.eventTimes;for(l=l.expirationTimes;0<g;){var x=31-Rn(g),_=1<<x;c[x]=0,b[x]=-1,l[x]=-1,g&=~_}}function Ie(l,c){var g=l.entangledLanes|=c;for(l=l.entanglements;g;){var b=31-Rn(g),x=1<<b;x&c|l[b]&c&&(l[b]|=c),g&=~x}}var _e=0;function Me(l){return l&=-l,1<l?4<l?l&268435455?16:536870912:4:1}var ze=o.unstable_scheduleCallback,Ze=o.unstable_cancelCallback,Et=o.unstable_shouldYield,_t=o.unstable_requestPaint,$e=o.unstable_now,Gt=o.unstable_ImmediatePriority,mn=o.unstable_UserBlockingPriority,on=o.unstable_NormalPriority,fr=o.unstable_IdlePriority,Bn=null,an=null;function Ln(l){if(an&&typeof an.onCommitFiberRoot=="function")try{an.onCommitFiberRoot(Bn,l,void 0,(l.current.flags&128)===128)}catch{}}function eo(l,c){return l===c&&(l!==0||1/l===1/c)||l!==l&&c!==c}var nn=typeof Object.is=="function"?Object.is:eo,Mn=null,Lr=!1,Or=!1;function Na(l){Mn===null?Mn=[l]:Mn.push(l)}function nd(l){Lr=!0,Na(l)}function Po(){if(!Or&&Mn!==null){Or=!0;var l=0,c=_e;try{var g=Mn;for(_e=1;l<g.length;l++){var b=g[l];do b=b(!0);while(b!==null)}Mn=null,Lr=!1}catch(x){throw Mn!==null&&(Mn=Mn.slice(l+1)),ze(Gt,Po),x}finally{_e=c,Or=!1}}return null}var ra=[],Ds=0,oa=null,to=0,no=[],ro=0,Fo=null,_o=1,Vr="";function gi(l,c){ra[Ds++]=to,ra[Ds++]=oa,oa=l,to=c}function Uy(l,c,g){no[ro++]=_o,no[ro++]=Vr,no[ro++]=Fo,Fo=l;var b=_o;l=Vr;var x=32-Rn(b)-1;b&=~(1<<x),g+=1;var _=32-Rn(c)+x;if(30<_){var M=x-x%5;_=(b&(1<<M)-1).toString(32),b>>=M,x-=M,_o=1<<32-Rn(c)+x|g<<x|b,Vr=_+l}else _o=1<<_|g<<x|b,Vr=l}function dm(l){l.return!==null&&(gi(l,1),Uy(l,1,0))}function fm(l){for(;l===oa;)oa=ra[--Ds],ra[Ds]=null,to=ra[--Ds],ra[Ds]=null;for(;l===Fo;)Fo=no[--ro],no[ro]=null,Vr=no[--ro],no[ro]=null,_o=no[--ro],no[ro]=null}var jo=null,Bo=null,Zn=!1,kc=!1,us=null;function Gy(l,c){var g=Go(5,null,null,0);g.elementType="DELETED",g.stateNode=c,g.return=l,c=l.deletions,c===null?(l.deletions=[g],l.flags|=16):c.push(g)}function qy(l,c){switch(l.tag){case 5:return c=$n(c,l.type,l.pendingProps),c!==null?(l.stateNode=c,jo=l,Bo=q(c),!0):!1;case 6:return c=ls(c,l.pendingProps),c!==null?(l.stateNode=c,jo=l,Bo=null,!0):!1;case 13:if(c=Da(c),c!==null){var g=Fo!==null?{id:_o,overflow:Vr}:null;return l.memoizedState={dehydrated:c,treeContext:g,retryLane:1073741824},g=Go(18,null,null,0),g.stateNode=c,g.return=l,l.child=g,jo=l,Bo=null,!0}return!1;default:return!1}}function pm(l){return(l.mode&1)!==0&&(l.flags&128)===0}function hm(l){if(Zn){var c=Bo;if(c){var g=c;if(!qy(l,c)){if(pm(l))throw Error(i(418));c=cs(g);var b=jo;c&&qy(l,c)?Gy(b,g):(l.flags=l.flags&-4097|2,Zn=!1,jo=l)}}else{if(pm(l))throw Error(i(418));l.flags=l.flags&-4097|2,Zn=!1,jo=l}}}function Ky(l){for(l=l.return;l!==null&&l.tag!==5&&l.tag!==3&&l.tag!==13;)l=l.return;jo=l}function rd(l){if(!Ae||l!==jo)return!1;if(!Zn)return Ky(l),Zn=!0,!1;if(l.tag!==3&&(l.tag!==5||ke(l.type)&&!Y(l.type,l.memoizedProps))){var c=Bo;if(c){if(pm(l))throw Yy(),Error(i(418));for(;c;)Gy(l,c),c=cs(c)}}if(Ky(l),l.tag===13){if(!Ae)throw Error(i(316));if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(i(317));Bo=pt(l)}else Bo=jo?cs(l.stateNode):null;return!0}function Yy(){for(var l=Bo;l;)l=cs(l)}function il(){Ae&&(Bo=jo=null,kc=Zn=!1)}function mm(l){us===null?us=[l]:us.push(l)}var mI=u.ReactCurrentBatchConfig;function od(l,c){if(nn(l,c))return!0;if(typeof l!="object"||l===null||typeof c!="object"||c===null)return!1;var g=Object.keys(l),b=Object.keys(c);if(g.length!==b.length)return!1;for(b=0;b<g.length;b++){var x=g[b];if(!Ft.call(c,x)||!nn(l[x],c[x]))return!1}return!0}function gI(l){switch(l.tag){case 5:return Rt(l.type);case 16:return Rt("Lazy");case 13:return Rt("Suspense");case 19:return Rt("SuspenseList");case 0:case 2:case 15:return l=Ut(l.type,!1),l;case 11:return l=Ut(l.type.render,!1),l;case 1:return l=Ut(l.type,!0),l;default:return""}}function ds(l,c){if(l&&l.defaultProps){c=s({},c),l=l.defaultProps;for(var g in l)c[g]===void 0&&(c[g]=l[g]);return c}return c}var sd=Tt(null),ad=null,ll=null,gm=null;function vm(){gm=ll=ad=null}function Xy(l,c,g){ge?($t(sd,c._currentValue),c._currentValue=g):($t(sd,c._currentValue2),c._currentValue2=g)}function ym(l){var c=sd.current;Mt(sd),ge?l._currentValue=c:l._currentValue2=c}function bm(l,c,g){for(;l!==null;){var b=l.alternate;if((l.childLanes&c)!==c?(l.childLanes|=c,b!==null&&(b.childLanes|=c)):b!==null&&(b.childLanes&c)!==c&&(b.childLanes|=c),l===g)break;l=l.return}}function cl(l,c){ad=l,gm=ll=null,l=l.dependencies,l!==null&&l.firstContext!==null&&(l.lanes&c&&(lo=!0),l.firstContext=null)}function Ho(l){var c=ge?l._currentValue:l._currentValue2;if(gm!==l)if(l={context:l,memoizedValue:c,next:null},ll===null){if(ad===null)throw Error(i(308));ll=l,ad.dependencies={lanes:0,firstContext:l}}else ll=ll.next=l;return c}var vi=null;function xm(l){vi===null?vi=[l]:vi.push(l)}function Qy(l,c,g,b){var x=c.interleaved;return x===null?(g.next=g,xm(c)):(g.next=x.next,x.next=g),c.interleaved=g,As(l,b)}function As(l,c){l.lanes|=c;var g=l.alternate;for(g!==null&&(g.lanes|=c),g=l,l=l.return;l!==null;)l.childLanes|=c,g=l.alternate,g!==null&&(g.childLanes|=c),g=l,l=l.return;return g.tag===3?g.stateNode:null}var za=!1;function Sm(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Zy(l,c){l=l.updateQueue,c.updateQueue===l&&(c.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,effects:l.effects})}function sa(l,c){return{eventTime:l,lane:c,tag:0,payload:null,callback:null,next:null}}function $a(l,c,g){var b=l.updateQueue;if(b===null)return null;if(b=b.shared,Zt&2){var x=b.pending;return x===null?c.next=c:(c.next=x.next,x.next=c),b.pending=c,As(l,g)}return x=b.interleaved,x===null?(c.next=c,xm(b)):(c.next=x.next,x.next=c),b.interleaved=c,As(l,g)}function id(l,c,g){if(c=c.updateQueue,c!==null&&(c=c.shared,(g&4194240)!==0)){var b=c.lanes;b&=l.pendingLanes,g|=b,c.lanes=g,Ie(l,g)}}function Jy(l,c){var g=l.updateQueue,b=l.alternate;if(b!==null&&(b=b.updateQueue,g===b)){var x=null,_=null;if(g=g.firstBaseUpdate,g!==null){do{var M={eventTime:g.eventTime,lane:g.lane,tag:g.tag,payload:g.payload,callback:g.callback,next:null};_===null?x=_=M:_=_.next=M,g=g.next}while(g!==null);_===null?x=_=c:_=_.next=c}else x=_=c;g={baseState:b.baseState,firstBaseUpdate:x,lastBaseUpdate:_,shared:b.shared,effects:b.effects},l.updateQueue=g;return}l=g.lastBaseUpdate,l===null?g.firstBaseUpdate=c:l.next=c,g.lastBaseUpdate=c}function ld(l,c,g,b){var x=l.updateQueue;za=!1;var _=x.firstBaseUpdate,M=x.lastBaseUpdate,Q=x.shared.pending;if(Q!==null){x.shared.pending=null;var ce=Q,De=ce.next;ce.next=null,M===null?_=De:M.next=De,M=ce;var ft=l.alternate;ft!==null&&(ft=ft.updateQueue,Q=ft.lastBaseUpdate,Q!==M&&(Q===null?ft.firstBaseUpdate=De:Q.next=De,ft.lastBaseUpdate=ce))}if(_!==null){var Bt=x.baseState;M=0,ft=De=ce=null,Q=_;do{var nt=Q.lane,Hn=Q.eventTime;if((b&nt)===nt){ft!==null&&(ft=ft.next={eventTime:Hn,lane:0,tag:Q.tag,payload:Q.payload,callback:Q.callback,next:null});e:{var Dn=l,fo=Q;switch(nt=c,Hn=g,fo.tag){case 1:if(Dn=fo.payload,typeof Dn=="function"){Bt=Dn.call(Hn,Bt,nt);break e}Bt=Dn;break e;case 3:Dn.flags=Dn.flags&-65537|128;case 0:if(Dn=fo.payload,nt=typeof Dn=="function"?Dn.call(Hn,Bt,nt):Dn,nt==null)break e;Bt=s({},Bt,nt);break e;case 2:za=!0}}Q.callback!==null&&Q.lane!==0&&(l.flags|=64,nt=x.effects,nt===null?x.effects=[Q]:nt.push(Q))}else Hn={eventTime:Hn,lane:nt,tag:Q.tag,payload:Q.payload,callback:Q.callback,next:null},ft===null?(De=ft=Hn,ce=Bt):ft=ft.next=Hn,M|=nt;if(Q=Q.next,Q===null){if(Q=x.shared.pending,Q===null)break;nt=Q,Q=nt.next,nt.next=null,x.lastBaseUpdate=nt,x.shared.pending=null}}while(1);if(ft===null&&(ce=Bt),x.baseState=ce,x.firstBaseUpdate=De,x.lastBaseUpdate=ft,c=x.shared.interleaved,c!==null){x=c;do M|=x.lane,x=x.next;while(x!==c)}else _===null&&(x.shared.lanes=0);bi|=M,l.lanes=M,l.memoizedState=Bt}}function eb(l,c,g){if(l=c.effects,c.effects=null,l!==null)for(c=0;c<l.length;c++){var b=l[c],x=b.callback;if(x!==null){if(b.callback=null,b=g,typeof x!="function")throw Error(i(191,x));x.call(b)}}}var tb=new r.Component().refs;function wm(l,c,g,b){c=l.memoizedState,g=g(b,c),g=g==null?c:s({},c,g),l.memoizedState=g,l.lanes===0&&(l.updateQueue.baseState=g)}var cd={isMounted:function(l){return(l=l._reactInternals)?D(l)===l:!1},enqueueSetState:function(l,c,g){l=l._reactInternals;var b=Kr(),x=Ba(l),_=sa(b,x);_.payload=c,g!=null&&(_.callback=g),c=$a(l,_,x),c!==null&&(Uo(c,l,x,b),id(c,l,x))},enqueueReplaceState:function(l,c,g){l=l._reactInternals;var b=Kr(),x=Ba(l),_=sa(b,x);_.tag=1,_.payload=c,g!=null&&(_.callback=g),c=$a(l,_,x),c!==null&&(Uo(c,l,x,b),id(c,l,x))},enqueueForceUpdate:function(l,c){l=l._reactInternals;var g=Kr(),b=Ba(l),x=sa(g,b);x.tag=2,c!=null&&(x.callback=c),c=$a(l,x,b),c!==null&&(Uo(c,l,b,g),id(c,l,b))}};function nb(l,c,g,b,x,_,M){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(b,_,M):c.prototype&&c.prototype.isPureReactComponent?!od(g,b)||!od(x,_):!0}function rb(l,c,g){var b=!1,x=fn,_=c.contextType;return typeof _=="object"&&_!==null?_=Ho(_):(x=Xn(c)?Cn:Vt.current,b=c.contextTypes,_=(b=b!=null)?Ir(l,x):fn),c=new c(g,_),l.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=cd,l.stateNode=c,c._reactInternals=l,b&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=x,l.__reactInternalMemoizedMaskedChildContext=_),c}function ob(l,c,g,b){l=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(g,b),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(g,b),c.state!==l&&cd.enqueueReplaceState(c,c.state,null)}function Cm(l,c,g,b){var x=l.stateNode;x.props=g,x.state=l.memoizedState,x.refs=tb,Sm(l);var _=c.contextType;typeof _=="object"&&_!==null?x.context=Ho(_):(_=Xn(c)?Cn:Vt.current,x.context=Ir(l,_)),x.state=l.memoizedState,_=c.getDerivedStateFromProps,typeof _=="function"&&(wm(l,c,_,g),x.state=l.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(c=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),c!==x.state&&cd.enqueueReplaceState(x,x.state,null),ld(l,g,x,b),x.state=l.memoizedState),typeof x.componentDidMount=="function"&&(l.flags|=4194308)}function Pc(l,c,g){if(l=g.ref,l!==null&&typeof l!="function"&&typeof l!="object"){if(g._owner){if(g=g._owner,g){if(g.tag!==1)throw Error(i(309));var b=g.stateNode}if(!b)throw Error(i(147,l));var x=b,_=""+l;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===_?c.ref:(c=function(M){var Q=x.refs;Q===tb&&(Q=x.refs={}),M===null?delete Q[_]:Q[_]=M},c._stringRef=_,c)}if(typeof l!="string")throw Error(i(284));if(!g._owner)throw Error(i(290,l))}return l}function ud(l,c){throw l=Object.prototype.toString.call(c),Error(i(31,l==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":l))}function sb(l){var c=l._init;return c(l._payload)}function ab(l){function c(ie,ee){if(l){var me=ie.deletions;me===null?(ie.deletions=[ee],ie.flags|=16):me.push(ee)}}function g(ie,ee){if(!l)return null;for(;ee!==null;)c(ie,ee),ee=ee.sibling;return null}function b(ie,ee){for(ie=new Map;ee!==null;)ee.key!==null?ie.set(ee.key,ee):ie.set(ee.index,ee),ee=ee.sibling;return ie}function x(ie,ee){return ie=Wa(ie,ee),ie.index=0,ie.sibling=null,ie}function _(ie,ee,me){return ie.index=me,l?(me=ie.alternate,me!==null?(me=me.index,me<ee?(ie.flags|=2,ee):me):(ie.flags|=2,ee)):(ie.flags|=1048576,ee)}function M(ie){return l&&ie.alternate===null&&(ie.flags|=2),ie}function Q(ie,ee,me,ot){return ee===null||ee.tag!==6?(ee=ug(me,ie.mode,ot),ee.return=ie,ee):(ee=x(ee,me),ee.return=ie,ee)}function ce(ie,ee,me,ot){var It=me.type;return It===h?ft(ie,ee,me.props.children,ot,me.key):ee!==null&&(ee.elementType===It||typeof It=="object"&&It!==null&&It.$$typeof===j&&sb(It)===ee.type)?(ot=x(ee,me.props),ot.ref=Pc(ie,ee,me),ot.return=ie,ot):(ot=Nd(me.type,me.key,me.props,null,ie.mode,ot),ot.ref=Pc(ie,ee,me),ot.return=ie,ot)}function De(ie,ee,me,ot){return ee===null||ee.tag!==4||ee.stateNode.containerInfo!==me.containerInfo||ee.stateNode.implementation!==me.implementation?(ee=dg(me,ie.mode,ot),ee.return=ie,ee):(ee=x(ee,me.children||[]),ee.return=ie,ee)}function ft(ie,ee,me,ot,It){return ee===null||ee.tag!==7?(ee=Ci(me,ie.mode,ot,It),ee.return=ie,ee):(ee=x(ee,me),ee.return=ie,ee)}function Bt(ie,ee,me){if(typeof ee=="string"&&ee!==""||typeof ee=="number")return ee=ug(""+ee,ie.mode,me),ee.return=ie,ee;if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case d:return me=Nd(ee.type,ee.key,ee.props,null,ie.mode,me),me.ref=Pc(ie,null,ee),me.return=ie,me;case f:return ee=dg(ee,ie.mode,me),ee.return=ie,ee;case j:var ot=ee._init;return Bt(ie,ot(ee._payload),me)}if(G(ee)||I(ee))return ee=Ci(ee,ie.mode,me,null),ee.return=ie,ee;ud(ie,ee)}return null}function nt(ie,ee,me,ot){var It=ee!==null?ee.key:null;if(typeof me=="string"&&me!==""||typeof me=="number")return It!==null?null:Q(ie,ee,""+me,ot);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case d:return me.key===It?ce(ie,ee,me,ot):null;case f:return me.key===It?De(ie,ee,me,ot):null;case j:return It=me._init,nt(ie,ee,It(me._payload),ot)}if(G(me)||I(me))return It!==null?null:ft(ie,ee,me,ot,null);ud(ie,me)}return null}function Hn(ie,ee,me,ot,It){if(typeof ot=="string"&&ot!==""||typeof ot=="number")return ie=ie.get(me)||null,Q(ee,ie,""+ot,It);if(typeof ot=="object"&&ot!==null){switch(ot.$$typeof){case d:return ie=ie.get(ot.key===null?me:ot.key)||null,ce(ee,ie,ot,It);case f:return ie=ie.get(ot.key===null?me:ot.key)||null,De(ee,ie,ot,It);case j:var Kt=ot._init;return Hn(ie,ee,me,Kt(ot._payload),It)}if(G(ot)||I(ot))return ie=ie.get(me)||null,ft(ee,ie,ot,It,null);ud(ee,ot)}return null}function Dn(ie,ee,me,ot){for(var It=null,Kt=null,Ht=ee,vn=ee=0,zr=null;Ht!==null&&vn<me.length;vn++){Ht.index>vn?(zr=Ht,Ht=null):zr=Ht.sibling;var yn=nt(ie,Ht,me[vn],ot);if(yn===null){Ht===null&&(Ht=zr);break}l&&Ht&&yn.alternate===null&&c(ie,Ht),ee=_(yn,ee,vn),Kt===null?It=yn:Kt.sibling=yn,Kt=yn,Ht=zr}if(vn===me.length)return g(ie,Ht),Zn&&gi(ie,vn),It;if(Ht===null){for(;vn<me.length;vn++)Ht=Bt(ie,me[vn],ot),Ht!==null&&(ee=_(Ht,ee,vn),Kt===null?It=Ht:Kt.sibling=Ht,Kt=Ht);return Zn&&gi(ie,vn),It}for(Ht=b(ie,Ht);vn<me.length;vn++)zr=Hn(Ht,ie,vn,me[vn],ot),zr!==null&&(l&&zr.alternate!==null&&Ht.delete(zr.key===null?vn:zr.key),ee=_(zr,ee,vn),Kt===null?It=zr:Kt.sibling=zr,Kt=zr);return l&&Ht.forEach(function(Va){return c(ie,Va)}),Zn&&gi(ie,vn),It}function fo(ie,ee,me,ot){var It=I(me);if(typeof It!="function")throw Error(i(150));if(me=It.call(me),me==null)throw Error(i(151));for(var Kt=It=null,Ht=ee,vn=ee=0,zr=null,yn=me.next();Ht!==null&&!yn.done;vn++,yn=me.next()){Ht.index>vn?(zr=Ht,Ht=null):zr=Ht.sibling;var Va=nt(ie,Ht,yn.value,ot);if(Va===null){Ht===null&&(Ht=zr);break}l&&Ht&&Va.alternate===null&&c(ie,Ht),ee=_(Va,ee,vn),Kt===null?It=Va:Kt.sibling=Va,Kt=Va,Ht=zr}if(yn.done)return g(ie,Ht),Zn&&gi(ie,vn),It;if(Ht===null){for(;!yn.done;vn++,yn=me.next())yn=Bt(ie,yn.value,ot),yn!==null&&(ee=_(yn,ee,vn),Kt===null?It=yn:Kt.sibling=yn,Kt=yn);return Zn&&gi(ie,vn),It}for(Ht=b(ie,Ht);!yn.done;vn++,yn=me.next())yn=Hn(Ht,ie,vn,yn.value,ot),yn!==null&&(l&&yn.alternate!==null&&Ht.delete(yn.key===null?vn:yn.key),ee=_(yn,ee,vn),Kt===null?It=yn:Kt.sibling=yn,Kt=yn);return l&&Ht.forEach(function(GI){return c(ie,GI)}),Zn&&gi(ie,vn),It}function la(ie,ee,me,ot){if(typeof me=="object"&&me!==null&&me.type===h&&me.key===null&&(me=me.props.children),typeof me=="object"&&me!==null){switch(me.$$typeof){case d:e:{for(var It=me.key,Kt=ee;Kt!==null;){if(Kt.key===It){if(It=me.type,It===h){if(Kt.tag===7){g(ie,Kt.sibling),ee=x(Kt,me.props.children),ee.return=ie,ie=ee;break e}}else if(Kt.elementType===It||typeof It=="object"&&It!==null&&It.$$typeof===j&&sb(It)===Kt.type){g(ie,Kt.sibling),ee=x(Kt,me.props),ee.ref=Pc(ie,Kt,me),ee.return=ie,ie=ee;break e}g(ie,Kt);break}else c(ie,Kt);Kt=Kt.sibling}me.type===h?(ee=Ci(me.props.children,ie.mode,ot,me.key),ee.return=ie,ie=ee):(ot=Nd(me.type,me.key,me.props,null,ie.mode,ot),ot.ref=Pc(ie,ee,me),ot.return=ie,ie=ot)}return M(ie);case f:e:{for(Kt=me.key;ee!==null;){if(ee.key===Kt)if(ee.tag===4&&ee.stateNode.containerInfo===me.containerInfo&&ee.stateNode.implementation===me.implementation){g(ie,ee.sibling),ee=x(ee,me.children||[]),ee.return=ie,ie=ee;break e}else{g(ie,ee);break}else c(ie,ee);ee=ee.sibling}ee=dg(me,ie.mode,ot),ee.return=ie,ie=ee}return M(ie);case j:return Kt=me._init,la(ie,ee,Kt(me._payload),ot)}if(G(me))return Dn(ie,ee,me,ot);if(I(me))return fo(ie,ee,me,ot);ud(ie,me)}return typeof me=="string"&&me!==""||typeof me=="number"?(me=""+me,ee!==null&&ee.tag===6?(g(ie,ee.sibling),ee=x(ee,me),ee.return=ie,ie=ee):(g(ie,ee),ee=ug(me,ie.mode,ot),ee.return=ie,ie=ee),M(ie)):g(ie,ee)}return la}var ul=ab(!0),ib=ab(!1),_c={},Wo=Tt(_c),jc=Tt(_c),dl=Tt(_c);function Ns(l){if(l===_c)throw Error(i(174));return l}function km(l,c){$t(dl,c),$t(jc,l),$t(Wo,_c),l=N(c),Mt(Wo),$t(Wo,l)}function fl(){Mt(Wo),Mt(jc),Mt(dl)}function lb(l){var c=Ns(dl.current),g=Ns(Wo.current);c=V(g,l.type,c),g!==c&&($t(jc,l),$t(Wo,c))}function Pm(l){jc.current===l&&(Mt(Wo),Mt(jc))}var sr=Tt(0);function dd(l){for(var c=l;c!==null;){if(c.tag===13){var g=c.memoizedState;if(g!==null&&(g=g.dehydrated,g===null||Er(g)||Lo(g)))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if(c.flags&128)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===l)break;for(;c.sibling===null;){if(c.return===null||c.return===l)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var _m=[];function jm(){for(var l=0;l<_m.length;l++){var c=_m[l];ge?c._workInProgressVersionPrimary=null:c._workInProgressVersionSecondary=null}_m.length=0}var fd=u.ReactCurrentDispatcher,Em=u.ReactCurrentBatchConfig,yi=0,ar=null,Rr=null,Ar=null,pd=!1,Ec=!1,Ic=0,vI=0;function Ur(){throw Error(i(321))}function Im(l,c){if(c===null)return!1;for(var g=0;g<c.length&&g<l.length;g++)if(!nn(l[g],c[g]))return!1;return!0}function Om(l,c,g,b,x,_){if(yi=_,ar=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,fd.current=l===null||l.memoizedState===null?SI:wI,l=g(b,x),Ec){_=0;do{if(Ec=!1,Ic=0,25<=_)throw Error(i(301));_+=1,Ar=Rr=null,c.updateQueue=null,fd.current=CI,l=g(b,x)}while(Ec)}if(fd.current=gd,c=Rr!==null&&Rr.next!==null,yi=0,Ar=Rr=ar=null,pd=!1,c)throw Error(i(300));return l}function Rm(){var l=Ic!==0;return Ic=0,l}function zs(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ar===null?ar.memoizedState=Ar=l:Ar=Ar.next=l,Ar}function Vo(){if(Rr===null){var l=ar.alternate;l=l!==null?l.memoizedState:null}else l=Rr.next;var c=Ar===null?ar.memoizedState:Ar.next;if(c!==null)Ar=c,Rr=l;else{if(l===null)throw Error(i(310));Rr=l,l={memoizedState:Rr.memoizedState,baseState:Rr.baseState,baseQueue:Rr.baseQueue,queue:Rr.queue,next:null},Ar===null?ar.memoizedState=Ar=l:Ar=Ar.next=l}return Ar}function Oc(l,c){return typeof c=="function"?c(l):c}function Tm(l){var c=Vo(),g=c.queue;if(g===null)throw Error(i(311));g.lastRenderedReducer=l;var b=Rr,x=b.baseQueue,_=g.pending;if(_!==null){if(x!==null){var M=x.next;x.next=_.next,_.next=M}b.baseQueue=x=_,g.pending=null}if(x!==null){_=x.next,b=b.baseState;var Q=M=null,ce=null,De=_;do{var ft=De.lane;if((yi&ft)===ft)ce!==null&&(ce=ce.next={lane:0,action:De.action,hasEagerState:De.hasEagerState,eagerState:De.eagerState,next:null}),b=De.hasEagerState?De.eagerState:l(b,De.action);else{var Bt={lane:ft,action:De.action,hasEagerState:De.hasEagerState,eagerState:De.eagerState,next:null};ce===null?(Q=ce=Bt,M=b):ce=ce.next=Bt,ar.lanes|=ft,bi|=ft}De=De.next}while(De!==null&&De!==_);ce===null?M=b:ce.next=Q,nn(b,c.memoizedState)||(lo=!0),c.memoizedState=b,c.baseState=M,c.baseQueue=ce,g.lastRenderedState=b}if(l=g.interleaved,l!==null){x=l;do _=x.lane,ar.lanes|=_,bi|=_,x=x.next;while(x!==l)}else x===null&&(g.lanes=0);return[c.memoizedState,g.dispatch]}function Mm(l){var c=Vo(),g=c.queue;if(g===null)throw Error(i(311));g.lastRenderedReducer=l;var b=g.dispatch,x=g.pending,_=c.memoizedState;if(x!==null){g.pending=null;var M=x=x.next;do _=l(_,M.action),M=M.next;while(M!==x);nn(_,c.memoizedState)||(lo=!0),c.memoizedState=_,c.baseQueue===null&&(c.baseState=_),g.lastRenderedState=_}return[_,b]}function cb(){}function ub(l,c){var g=ar,b=Vo(),x=c(),_=!nn(b.memoizedState,x);if(_&&(b.memoizedState=x,lo=!0),b=b.queue,Dm(pb.bind(null,g,b,l),[l]),b.getSnapshot!==c||_||Ar!==null&&Ar.memoizedState.tag&1){if(g.flags|=2048,Rc(9,fb.bind(null,g,b,x,c),void 0,null),Nr===null)throw Error(i(349));yi&30||db(g,c,x)}return x}function db(l,c,g){l.flags|=16384,l={getSnapshot:c,value:g},c=ar.updateQueue,c===null?(c={lastEffect:null,stores:null},ar.updateQueue=c,c.stores=[l]):(g=c.stores,g===null?c.stores=[l]:g.push(l))}function fb(l,c,g,b){c.value=g,c.getSnapshot=b,hb(c)&&mb(l)}function pb(l,c,g){return g(function(){hb(c)&&mb(l)})}function hb(l){var c=l.getSnapshot;l=l.value;try{var g=c();return!nn(l,g)}catch{return!0}}function mb(l){var c=As(l,1);c!==null&&Uo(c,l,1,-1)}function gb(l){var c=zs();return typeof l=="function"&&(l=l()),c.memoizedState=c.baseState=l,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Oc,lastRenderedState:l},c.queue=l,l=l.dispatch=xI.bind(null,ar,l),[c.memoizedState,l]}function Rc(l,c,g,b){return l={tag:l,create:c,destroy:g,deps:b,next:null},c=ar.updateQueue,c===null?(c={lastEffect:null,stores:null},ar.updateQueue=c,c.lastEffect=l.next=l):(g=c.lastEffect,g===null?c.lastEffect=l.next=l:(b=g.next,g.next=l,l.next=b,c.lastEffect=l)),l}function vb(){return Vo().memoizedState}function hd(l,c,g,b){var x=zs();ar.flags|=l,x.memoizedState=Rc(1|c,g,void 0,b===void 0?null:b)}function md(l,c,g,b){var x=Vo();b=b===void 0?null:b;var _=void 0;if(Rr!==null){var M=Rr.memoizedState;if(_=M.destroy,b!==null&&Im(b,M.deps)){x.memoizedState=Rc(c,g,_,b);return}}ar.flags|=l,x.memoizedState=Rc(1|c,g,_,b)}function yb(l,c){return hd(8390656,8,l,c)}function Dm(l,c){return md(2048,8,l,c)}function bb(l,c){return md(4,2,l,c)}function xb(l,c){return md(4,4,l,c)}function Sb(l,c){if(typeof c=="function")return l=l(),c(l),function(){c(null)};if(c!=null)return l=l(),c.current=l,function(){c.current=null}}function wb(l,c,g){return g=g!=null?g.concat([l]):null,md(4,4,Sb.bind(null,c,l),g)}function Am(){}function Cb(l,c){var g=Vo();c=c===void 0?null:c;var b=g.memoizedState;return b!==null&&c!==null&&Im(c,b[1])?b[0]:(g.memoizedState=[l,c],l)}function kb(l,c){var g=Vo();c=c===void 0?null:c;var b=g.memoizedState;return b!==null&&c!==null&&Im(c,b[1])?b[0]:(l=l(),g.memoizedState=[l,c],l)}function Pb(l,c,g){return yi&21?(nn(g,c)||(g=mt(),ar.lanes|=g,bi|=g,l.baseState=!0),c):(l.baseState&&(l.baseState=!1,lo=!0),l.memoizedState=g)}function yI(l,c){var g=_e;_e=g!==0&&4>g?g:4,l(!0);var b=Em.transition;Em.transition={};try{l(!1),c()}finally{_e=g,Em.transition=b}}function _b(){return Vo().memoizedState}function bI(l,c,g){var b=Ba(l);if(g={lane:b,action:g,hasEagerState:!1,eagerState:null,next:null},jb(l))Eb(c,g);else if(g=Qy(l,c,g,b),g!==null){var x=Kr();Uo(g,l,b,x),Ib(g,c,b)}}function xI(l,c,g){var b=Ba(l),x={lane:b,action:g,hasEagerState:!1,eagerState:null,next:null};if(jb(l))Eb(c,x);else{var _=l.alternate;if(l.lanes===0&&(_===null||_.lanes===0)&&(_=c.lastRenderedReducer,_!==null))try{var M=c.lastRenderedState,Q=_(M,g);if(x.hasEagerState=!0,x.eagerState=Q,nn(Q,M)){var ce=c.interleaved;ce===null?(x.next=x,xm(c)):(x.next=ce.next,ce.next=x),c.interleaved=x;return}}catch{}finally{}g=Qy(l,c,x,b),g!==null&&(x=Kr(),Uo(g,l,b,x),Ib(g,c,b))}}function jb(l){var c=l.alternate;return l===ar||c!==null&&c===ar}function Eb(l,c){Ec=pd=!0;var g=l.pending;g===null?c.next=c:(c.next=g.next,g.next=c),l.pending=c}function Ib(l,c,g){if(g&4194240){var b=c.lanes;b&=l.pendingLanes,g|=b,c.lanes=g,Ie(l,g)}}var gd={readContext:Ho,useCallback:Ur,useContext:Ur,useEffect:Ur,useImperativeHandle:Ur,useInsertionEffect:Ur,useLayoutEffect:Ur,useMemo:Ur,useReducer:Ur,useRef:Ur,useState:Ur,useDebugValue:Ur,useDeferredValue:Ur,useTransition:Ur,useMutableSource:Ur,useSyncExternalStore:Ur,useId:Ur,unstable_isNewReconciler:!1},SI={readContext:Ho,useCallback:function(l,c){return zs().memoizedState=[l,c===void 0?null:c],l},useContext:Ho,useEffect:yb,useImperativeHandle:function(l,c,g){return g=g!=null?g.concat([l]):null,hd(4194308,4,Sb.bind(null,c,l),g)},useLayoutEffect:function(l,c){return hd(4194308,4,l,c)},useInsertionEffect:function(l,c){return hd(4,2,l,c)},useMemo:function(l,c){var g=zs();return c=c===void 0?null:c,l=l(),g.memoizedState=[l,c],l},useReducer:function(l,c,g){var b=zs();return c=g!==void 0?g(c):c,b.memoizedState=b.baseState=c,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:c},b.queue=l,l=l.dispatch=bI.bind(null,ar,l),[b.memoizedState,l]},useRef:function(l){var c=zs();return l={current:l},c.memoizedState=l},useState:gb,useDebugValue:Am,useDeferredValue:function(l){return zs().memoizedState=l},useTransition:function(){var l=gb(!1),c=l[0];return l=yI.bind(null,l[1]),zs().memoizedState=l,[c,l]},useMutableSource:function(){},useSyncExternalStore:function(l,c,g){var b=ar,x=zs();if(Zn){if(g===void 0)throw Error(i(407));g=g()}else{if(g=c(),Nr===null)throw Error(i(349));yi&30||db(b,c,g)}x.memoizedState=g;var _={value:g,getSnapshot:c};return x.queue=_,yb(pb.bind(null,b,_,l),[l]),b.flags|=2048,Rc(9,fb.bind(null,b,_,g,c),void 0,null),g},useId:function(){var l=zs(),c=Nr.identifierPrefix;if(Zn){var g=Vr,b=_o;g=(b&~(1<<32-Rn(b)-1)).toString(32)+g,c=":"+c+"R"+g,g=Ic++,0<g&&(c+="H"+g.toString(32)),c+=":"}else g=vI++,c=":"+c+"r"+g.toString(32)+":";return l.memoizedState=c},unstable_isNewReconciler:!1},wI={readContext:Ho,useCallback:Cb,useContext:Ho,useEffect:Dm,useImperativeHandle:wb,useInsertionEffect:bb,useLayoutEffect:xb,useMemo:kb,useReducer:Tm,useRef:vb,useState:function(){return Tm(Oc)},useDebugValue:Am,useDeferredValue:function(l){var c=Vo();return Pb(c,Rr.memoizedState,l)},useTransition:function(){var l=Tm(Oc)[0],c=Vo().memoizedState;return[l,c]},useMutableSource:cb,useSyncExternalStore:ub,useId:_b,unstable_isNewReconciler:!1},CI={readContext:Ho,useCallback:Cb,useContext:Ho,useEffect:Dm,useImperativeHandle:wb,useInsertionEffect:bb,useLayoutEffect:xb,useMemo:kb,useReducer:Mm,useRef:vb,useState:function(){return Mm(Oc)},useDebugValue:Am,useDeferredValue:function(l){var c=Vo();return Rr===null?c.memoizedState=l:Pb(c,Rr.memoizedState,l)},useTransition:function(){var l=Mm(Oc)[0],c=Vo().memoizedState;return[l,c]},useMutableSource:cb,useSyncExternalStore:ub,useId:_b,unstable_isNewReconciler:!1};function pl(l,c){try{var g="",b=c;do g+=gI(b),b=b.return;while(b);var x=g}catch(_){x=`
|
||
Error generating stack: `+_.message+`
|
||
`+_.stack}return{value:l,source:c,stack:x,digest:null}}function Nm(l,c,g){return{value:l,source:null,stack:g??null,digest:c??null}}function zm(l,c){try{console.error(c.value)}catch(g){setTimeout(function(){throw g})}}var kI=typeof WeakMap=="function"?WeakMap:Map;function Ob(l,c,g){g=sa(-1,g),g.tag=3,g.payload={element:null};var b=c.value;return g.callback=function(){Od||(Od=!0,rg=b),zm(l,c)},g}function Rb(l,c,g){g=sa(-1,g),g.tag=3;var b=l.type.getDerivedStateFromError;if(typeof b=="function"){var x=c.value;g.payload=function(){return b(x)},g.callback=function(){zm(l,c)}}var _=l.stateNode;return _!==null&&typeof _.componentDidCatch=="function"&&(g.callback=function(){zm(l,c),typeof b!="function"&&(La===null?La=new Set([this]):La.add(this));var M=c.stack;this.componentDidCatch(c.value,{componentStack:M!==null?M:""})}),g}function Tb(l,c,g){var b=l.pingCache;if(b===null){b=l.pingCache=new kI;var x=new Set;b.set(c,x)}else x=b.get(c),x===void 0&&(x=new Set,b.set(c,x));x.has(g)||(x.add(g),l=$I.bind(null,l,c,g),c.then(l,l))}function Mb(l){do{var c;if((c=l.tag===13)&&(c=l.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return l;l=l.return}while(l!==null);return null}function Db(l,c,g,b,x){return l.mode&1?(l.flags|=65536,l.lanes=x,l):(l===c?l.flags|=65536:(l.flags|=128,g.flags|=131072,g.flags&=-52805,g.tag===1&&(g.alternate===null?g.tag=17:(c=sa(-1,1),c.tag=2,$a(g,c,1))),g.lanes|=1),l)}var PI=u.ReactCurrentOwner,lo=!1;function oo(l,c,g,b){c.child=l===null?ib(c,null,g,b):ul(c,l.child,g,b)}function Ab(l,c,g,b,x){g=g.render;var _=c.ref;return cl(c,x),b=Om(l,c,g,b,_,x),g=Rm(),l!==null&&!lo?(c.updateQueue=l.updateQueue,c.flags&=-2053,l.lanes&=~x,aa(l,c,x)):(Zn&&g&&dm(c),c.flags|=1,oo(l,c,b,x),c.child)}function Nb(l,c,g,b,x){if(l===null){var _=g.type;return typeof _=="function"&&!cg(_)&&_.defaultProps===void 0&&g.compare===null&&g.defaultProps===void 0?(c.tag=15,c.type=_,zb(l,c,_,b,x)):(l=Nd(g.type,null,b,c,c.mode,x),l.ref=c.ref,l.return=c,c.child=l)}if(_=l.child,!(l.lanes&x)){var M=_.memoizedProps;if(g=g.compare,g=g!==null?g:od,g(M,b)&&l.ref===c.ref)return aa(l,c,x)}return c.flags|=1,l=Wa(_,b),l.ref=c.ref,l.return=c,c.child=l}function zb(l,c,g,b,x){if(l!==null){var _=l.memoizedProps;if(od(_,b)&&l.ref===c.ref)if(lo=!1,c.pendingProps=b=_,(l.lanes&x)!==0)l.flags&131072&&(lo=!0);else return c.lanes=l.lanes,aa(l,c,x)}return $m(l,c,g,b,x)}function $b(l,c,g){var b=c.pendingProps,x=b.children,_=l!==null?l.memoizedState:null;if(b.mode==="hidden")if(!(c.mode&1))c.memoizedState={baseLanes:0,cachePool:null,transitions:null},$t(ml,Eo),Eo|=g;else{if(!(g&1073741824))return l=_!==null?_.baseLanes|g:g,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:l,cachePool:null,transitions:null},c.updateQueue=null,$t(ml,Eo),Eo|=l,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},b=_!==null?_.baseLanes:g,$t(ml,Eo),Eo|=b}else _!==null?(b=_.baseLanes|g,c.memoizedState=null):b=g,$t(ml,Eo),Eo|=b;return oo(l,c,x,g),c.child}function Lb(l,c){var g=c.ref;(l===null&&g!==null||l!==null&&l.ref!==g)&&(c.flags|=512,c.flags|=2097152)}function $m(l,c,g,b,x){var _=Xn(g)?Cn:Vt.current;return _=Ir(c,_),cl(c,x),g=Om(l,c,g,b,_,x),b=Rm(),l!==null&&!lo?(c.updateQueue=l.updateQueue,c.flags&=-2053,l.lanes&=~x,aa(l,c,x)):(Zn&&b&&dm(c),c.flags|=1,oo(l,c,g,x),c.child)}function Fb(l,c,g,b,x){if(Xn(g)){var _=!0;Qn(c)}else _=!1;if(cl(c,x),c.stateNode===null)yd(l,c),rb(c,g,b),Cm(c,g,b,x),b=!0;else if(l===null){var M=c.stateNode,Q=c.memoizedProps;M.props=Q;var ce=M.context,De=g.contextType;typeof De=="object"&&De!==null?De=Ho(De):(De=Xn(g)?Cn:Vt.current,De=Ir(c,De));var ft=g.getDerivedStateFromProps,Bt=typeof ft=="function"||typeof M.getSnapshotBeforeUpdate=="function";Bt||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(Q!==b||ce!==De)&&ob(c,M,b,De),za=!1;var nt=c.memoizedState;M.state=nt,ld(c,b,M,x),ce=c.memoizedState,Q!==b||nt!==ce||Qt.current||za?(typeof ft=="function"&&(wm(c,g,ft,b),ce=c.memoizedState),(Q=za||nb(c,g,Q,b,nt,ce,De))?(Bt||typeof M.UNSAFE_componentWillMount!="function"&&typeof M.componentWillMount!="function"||(typeof M.componentWillMount=="function"&&M.componentWillMount(),typeof M.UNSAFE_componentWillMount=="function"&&M.UNSAFE_componentWillMount()),typeof M.componentDidMount=="function"&&(c.flags|=4194308)):(typeof M.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=b,c.memoizedState=ce),M.props=b,M.state=ce,M.context=De,b=Q):(typeof M.componentDidMount=="function"&&(c.flags|=4194308),b=!1)}else{M=c.stateNode,Zy(l,c),Q=c.memoizedProps,De=c.type===c.elementType?Q:ds(c.type,Q),M.props=De,Bt=c.pendingProps,nt=M.context,ce=g.contextType,typeof ce=="object"&&ce!==null?ce=Ho(ce):(ce=Xn(g)?Cn:Vt.current,ce=Ir(c,ce));var Hn=g.getDerivedStateFromProps;(ft=typeof Hn=="function"||typeof M.getSnapshotBeforeUpdate=="function")||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(Q!==Bt||nt!==ce)&&ob(c,M,b,ce),za=!1,nt=c.memoizedState,M.state=nt,ld(c,b,M,x);var Dn=c.memoizedState;Q!==Bt||nt!==Dn||Qt.current||za?(typeof Hn=="function"&&(wm(c,g,Hn,b),Dn=c.memoizedState),(De=za||nb(c,g,De,b,nt,Dn,ce)||!1)?(ft||typeof M.UNSAFE_componentWillUpdate!="function"&&typeof M.componentWillUpdate!="function"||(typeof M.componentWillUpdate=="function"&&M.componentWillUpdate(b,Dn,ce),typeof M.UNSAFE_componentWillUpdate=="function"&&M.UNSAFE_componentWillUpdate(b,Dn,ce)),typeof M.componentDidUpdate=="function"&&(c.flags|=4),typeof M.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof M.componentDidUpdate!="function"||Q===l.memoizedProps&&nt===l.memoizedState||(c.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||Q===l.memoizedProps&&nt===l.memoizedState||(c.flags|=1024),c.memoizedProps=b,c.memoizedState=Dn),M.props=b,M.state=Dn,M.context=ce,b=De):(typeof M.componentDidUpdate!="function"||Q===l.memoizedProps&&nt===l.memoizedState||(c.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||Q===l.memoizedProps&&nt===l.memoizedState||(c.flags|=1024),b=!1)}return Lm(l,c,g,b,_,x)}function Lm(l,c,g,b,x,_){Lb(l,c);var M=(c.flags&128)!==0;if(!b&&!M)return x&&dr(c,g,!1),aa(l,c,_);b=c.stateNode,PI.current=c;var Q=M&&typeof g.getDerivedStateFromError!="function"?null:b.render();return c.flags|=1,l!==null&&M?(c.child=ul(c,l.child,null,_),c.child=ul(c,null,Q,_)):oo(l,c,Q,_),c.memoizedState=b.state,x&&dr(c,g,!0),c.child}function Bb(l){var c=l.stateNode;c.pendingContext?Sn(l,c.pendingContext,c.pendingContext!==c.context):c.context&&Sn(l,c.context,!1),km(l,c.containerInfo)}function Hb(l,c,g,b,x){return il(),mm(x),c.flags|=256,oo(l,c,g,b),c.child}var Fm={dehydrated:null,treeContext:null,retryLane:0};function Bm(l){return{baseLanes:l,cachePool:null,transitions:null}}function Wb(l,c,g){var b=c.pendingProps,x=sr.current,_=!1,M=(c.flags&128)!==0,Q;if((Q=M)||(Q=l!==null&&l.memoizedState===null?!1:(x&2)!==0),Q?(_=!0,c.flags&=-129):(l===null||l.memoizedState!==null)&&(x|=1),$t(sr,x&1),l===null)return hm(c),l=c.memoizedState,l!==null&&(l=l.dehydrated,l!==null)?(c.mode&1?Lo(l)?c.lanes=8:c.lanes=1073741824:c.lanes=1,null):(M=b.children,l=b.fallback,_?(b=c.mode,_=c.child,M={mode:"hidden",children:M},!(b&1)&&_!==null?(_.childLanes=0,_.pendingProps=M):_=zd(M,b,0,null),l=Ci(l,b,g,null),_.return=c,l.return=c,_.sibling=l,c.child=_,c.child.memoizedState=Bm(g),c.memoizedState=Fm,l):Hm(c,M));if(x=l.memoizedState,x!==null&&(Q=x.dehydrated,Q!==null))return _I(l,c,M,b,Q,x,g);if(_){_=b.fallback,M=c.mode,x=l.child,Q=x.sibling;var ce={mode:"hidden",children:b.children};return!(M&1)&&c.child!==x?(b=c.child,b.childLanes=0,b.pendingProps=ce,c.deletions=null):(b=Wa(x,ce),b.subtreeFlags=x.subtreeFlags&14680064),Q!==null?_=Wa(Q,_):(_=Ci(_,M,g,null),_.flags|=2),_.return=c,b.return=c,b.sibling=_,c.child=b,b=_,_=c.child,M=l.child.memoizedState,M=M===null?Bm(g):{baseLanes:M.baseLanes|g,cachePool:null,transitions:M.transitions},_.memoizedState=M,_.childLanes=l.childLanes&~g,c.memoizedState=Fm,b}return _=l.child,l=_.sibling,b=Wa(_,{mode:"visible",children:b.children}),!(c.mode&1)&&(b.lanes=g),b.return=c,b.sibling=null,l!==null&&(g=c.deletions,g===null?(c.deletions=[l],c.flags|=16):g.push(l)),c.child=b,c.memoizedState=null,b}function Hm(l,c){return c=zd({mode:"visible",children:c},l.mode,0,null),c.return=l,l.child=c}function vd(l,c,g,b){return b!==null&&mm(b),ul(c,l.child,null,g),l=Hm(c,c.pendingProps.children),l.flags|=2,c.memoizedState=null,l}function _I(l,c,g,b,x,_,M){if(g)return c.flags&256?(c.flags&=-257,b=Nm(Error(i(422))),vd(l,c,M,b)):c.memoizedState!==null?(c.child=l.child,c.flags|=128,null):(_=b.fallback,x=c.mode,b=zd({mode:"visible",children:b.children},x,0,null),_=Ci(_,x,M,null),_.flags|=2,b.return=c,_.return=c,b.sibling=_,c.child=b,c.mode&1&&ul(c,l.child,null,M),c.child.memoizedState=Bm(M),c.memoizedState=Fm,_);if(!(c.mode&1))return vd(l,c,M,null);if(Lo(x))return b=na(x).digest,_=Error(i(419)),b=Nm(_,b,void 0),vd(l,c,M,b);if(g=(M&l.childLanes)!==0,lo||g){if(b=Nr,b!==null){switch(M&-M){case 4:x=2;break;case 16:x=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:x=32;break;case 536870912:x=268435456;break;default:x=0}x=x&(b.suspendedLanes|M)?0:x,x!==0&&x!==_.retryLane&&(_.retryLane=x,As(l,x),Uo(b,l,x,-1))}return lg(),b=Nm(Error(i(421))),vd(l,c,M,b)}return Er(x)?(c.flags|=128,c.child=l.child,c=LI.bind(null,l),Aa(x,c),null):(l=_.treeContext,Ae&&(Bo=de(x),jo=c,Zn=!0,us=null,kc=!1,l!==null&&(no[ro++]=_o,no[ro++]=Vr,no[ro++]=Fo,_o=l.id,Vr=l.overflow,Fo=c)),c=Hm(c,b.children),c.flags|=4096,c)}function Vb(l,c,g){l.lanes|=c;var b=l.alternate;b!==null&&(b.lanes|=c),bm(l.return,c,g)}function Wm(l,c,g,b,x){var _=l.memoizedState;_===null?l.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:b,tail:g,tailMode:x}:(_.isBackwards=c,_.rendering=null,_.renderingStartTime=0,_.last=b,_.tail=g,_.tailMode=x)}function Ub(l,c,g){var b=c.pendingProps,x=b.revealOrder,_=b.tail;if(oo(l,c,b.children,g),b=sr.current,b&2)b=b&1|2,c.flags|=128;else{if(l!==null&&l.flags&128)e:for(l=c.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&Vb(l,g,c);else if(l.tag===19)Vb(l,g,c);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===c)break e;for(;l.sibling===null;){if(l.return===null||l.return===c)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}b&=1}if($t(sr,b),!(c.mode&1))c.memoizedState=null;else switch(x){case"forwards":for(g=c.child,x=null;g!==null;)l=g.alternate,l!==null&&dd(l)===null&&(x=g),g=g.sibling;g=x,g===null?(x=c.child,c.child=null):(x=g.sibling,g.sibling=null),Wm(c,!1,x,g,_);break;case"backwards":for(g=null,x=c.child,c.child=null;x!==null;){if(l=x.alternate,l!==null&&dd(l)===null){c.child=x;break}l=x.sibling,x.sibling=g,g=x,x=l}Wm(c,!0,g,null,_);break;case"together":Wm(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function yd(l,c){!(c.mode&1)&&l!==null&&(l.alternate=null,c.alternate=null,c.flags|=2)}function aa(l,c,g){if(l!==null&&(c.dependencies=l.dependencies),bi|=c.lanes,!(g&c.childLanes))return null;if(l!==null&&c.child!==l.child)throw Error(i(153));if(c.child!==null){for(l=c.child,g=Wa(l,l.pendingProps),c.child=g,g.return=c;l.sibling!==null;)l=l.sibling,g=g.sibling=Wa(l,l.pendingProps),g.return=c;g.sibling=null}return c.child}function jI(l,c,g){switch(c.tag){case 3:Bb(c),il();break;case 5:lb(c);break;case 1:Xn(c.type)&&Qn(c);break;case 4:km(c,c.stateNode.containerInfo);break;case 10:Xy(c,c.type._context,c.memoizedProps.value);break;case 13:var b=c.memoizedState;if(b!==null)return b.dehydrated!==null?($t(sr,sr.current&1),c.flags|=128,null):g&c.child.childLanes?Wb(l,c,g):($t(sr,sr.current&1),l=aa(l,c,g),l!==null?l.sibling:null);$t(sr,sr.current&1);break;case 19:if(b=(g&c.childLanes)!==0,l.flags&128){if(b)return Ub(l,c,g);c.flags|=128}var x=c.memoizedState;if(x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),$t(sr,sr.current),b)break;return null;case 22:case 23:return c.lanes=0,$b(l,c,g)}return aa(l,c,g)}function $s(l){l.flags|=4}function Gb(l,c){if(l!==null&&l.child===c.child)return!0;if(c.flags&16)return!1;for(l=c.child;l!==null;){if(l.flags&12854||l.subtreeFlags&12854)return!1;l=l.sibling}return!0}var Tc,Mc,bd,xd;if(fe)Tc=function(l,c){for(var g=c.child;g!==null;){if(g.tag===5||g.tag===6)ve(l,g.stateNode);else if(g.tag!==4&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===c)break;for(;g.sibling===null;){if(g.return===null||g.return===c)return;g=g.return}g.sibling.return=g.return,g=g.sibling}},Mc=function(){},bd=function(l,c,g,b,x){if(l=l.memoizedProps,l!==b){var _=c.stateNode,M=Ns(Wo.current);g=se(_,g,l,b,x,M),(c.updateQueue=g)&&$s(c)}},xd=function(l,c,g,b){g!==b&&$s(c)};else if(Pe){Tc=function(l,c,g,b){for(var x=c.child;x!==null;){if(x.tag===5){var _=x.stateNode;g&&b&&(_=zo(_,x.type,x.memoizedProps,x)),ve(l,_)}else if(x.tag===6)_=x.stateNode,g&&b&&(_=$o(_,x.memoizedProps,x)),ve(l,_);else if(x.tag!==4){if(x.tag===22&&x.memoizedState!==null)_=x.child,_!==null&&(_.return=x),Tc(l,x,!0,!0);else if(x.child!==null){x.child.return=x,x=x.child;continue}}if(x===c)break;for(;x.sibling===null;){if(x.return===null||x.return===c)return;x=x.return}x.sibling.return=x.return,x=x.sibling}};var qb=function(l,c,g,b){for(var x=c.child;x!==null;){if(x.tag===5){var _=x.stateNode;g&&b&&(_=zo(_,x.type,x.memoizedProps,x)),En(l,_)}else if(x.tag===6)_=x.stateNode,g&&b&&(_=$o(_,x.memoizedProps,x)),En(l,_);else if(x.tag!==4){if(x.tag===22&&x.memoizedState!==null)_=x.child,_!==null&&(_.return=x),qb(l,x,!0,!0);else if(x.child!==null){x.child.return=x,x=x.child;continue}}if(x===c)break;for(;x.sibling===null;){if(x.return===null||x.return===c)return;x=x.return}x.sibling.return=x.return,x=x.sibling}};Mc=function(l,c){var g=c.stateNode;if(!Gb(l,c)){l=g.containerInfo;var b=Pn(l);qb(b,c,!1,!1),g.pendingChildren=b,$s(c),is(l,b)}},bd=function(l,c,g,b,x){var _=l.stateNode,M=l.memoizedProps;if((l=Gb(l,c))&&M===b)c.stateNode=_;else{var Q=c.stateNode,ce=Ns(Wo.current),De=null;M!==b&&(De=se(Q,g,M,b,x,ce)),l&&De===null?c.stateNode=_:(_=Cr(_,De,g,M,b,c,l,Q),le(_,g,b,x,ce)&&$s(c),c.stateNode=_,l?$s(c):Tc(_,c,!1,!1))}},xd=function(l,c,g,b){g!==b?(l=Ns(dl.current),g=Ns(Wo.current),c.stateNode=ae(b,l,g,c),$s(c)):c.stateNode=l.stateNode}}else Mc=function(){},bd=function(){},xd=function(){};function Dc(l,c){if(!Zn)switch(l.tailMode){case"hidden":c=l.tail;for(var g=null;c!==null;)c.alternate!==null&&(g=c),c=c.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?c||l.tail===null?l.tail=null:l.tail.sibling=null:b.sibling=null}}function Gr(l){var c=l.alternate!==null&&l.alternate.child===l.child,g=0,b=0;if(c)for(var x=l.child;x!==null;)g|=x.lanes|x.childLanes,b|=x.subtreeFlags&14680064,b|=x.flags&14680064,x.return=l,x=x.sibling;else for(x=l.child;x!==null;)g|=x.lanes|x.childLanes,b|=x.subtreeFlags,b|=x.flags,x.return=l,x=x.sibling;return l.subtreeFlags|=b,l.childLanes=g,c}function EI(l,c,g){var b=c.pendingProps;switch(fm(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Gr(c),null;case 1:return Xn(c.type)&&wt(),Gr(c),null;case 3:return g=c.stateNode,fl(),Mt(Qt),Mt(Vt),jm(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(l===null||l.child===null)&&(rd(c)?$s(c):l===null||l.memoizedState.isDehydrated&&!(c.flags&256)||(c.flags|=1024,us!==null&&(ag(us),us=null))),Mc(l,c),Gr(c),null;case 5:Pm(c),g=Ns(dl.current);var x=c.type;if(l!==null&&c.stateNode!=null)bd(l,c,x,b,g),l.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!b){if(c.stateNode===null)throw Error(i(166));return Gr(c),null}if(l=Ns(Wo.current),rd(c)){if(!Ae)throw Error(i(175));l=be(c.stateNode,c.type,c.memoizedProps,g,l,c,!kc),c.updateQueue=l,l!==null&&$s(c)}else{var _=re(x,b,g,l,c);Tc(_,c,!1,!1),c.stateNode=_,le(_,x,b,g,l)&&$s(c)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return Gr(c),null;case 6:if(l&&c.stateNode!=null)xd(l,c,l.memoizedProps,b);else{if(typeof b!="string"&&c.stateNode===null)throw Error(i(166));if(l=Ns(dl.current),g=Ns(Wo.current),rd(c)){if(!Ae)throw Error(i(176));if(l=c.stateNode,g=c.memoizedProps,(b=Se(l,g,c,!kc))&&(x=jo,x!==null))switch(x.tag){case 3:He(x.stateNode.containerInfo,l,g,(x.mode&1)!==0);break;case 5:St(x.type,x.memoizedProps,x.stateNode,l,g,(x.mode&1)!==0)}b&&$s(c)}else c.stateNode=ae(b,l,g,c)}return Gr(c),null;case 13:if(Mt(sr),b=c.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(Zn&&Bo!==null&&c.mode&1&&!(c.flags&128))Yy(),il(),c.flags|=98560,x=!1;else if(x=rd(c),b!==null&&b.dehydrated!==null){if(l===null){if(!x)throw Error(i(318));if(!Ae)throw Error(i(344));if(x=c.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(i(317));Qe(x,c)}else il(),!(c.flags&128)&&(c.memoizedState=null),c.flags|=4;Gr(c),x=!1}else us!==null&&(ag(us),us=null),x=!0;if(!x)return c.flags&65536?c:null}return c.flags&128?(c.lanes=g,c):(g=b!==null,g!==(l!==null&&l.memoizedState!==null)&&g&&(c.child.flags|=8192,c.mode&1&&(l===null||sr.current&1?Tr===0&&(Tr=3):lg())),c.updateQueue!==null&&(c.flags|=4),Gr(c),null);case 4:return fl(),Mc(l,c),l===null&&Oe(c.stateNode.containerInfo),Gr(c),null;case 10:return ym(c.type._context),Gr(c),null;case 17:return Xn(c.type)&&wt(),Gr(c),null;case 19:if(Mt(sr),x=c.memoizedState,x===null)return Gr(c),null;if(b=(c.flags&128)!==0,_=x.rendering,_===null)if(b)Dc(x,!1);else{if(Tr!==0||l!==null&&l.flags&128)for(l=c.child;l!==null;){if(_=dd(l),_!==null){for(c.flags|=128,Dc(x,!1),l=_.updateQueue,l!==null&&(c.updateQueue=l,c.flags|=4),c.subtreeFlags=0,l=g,g=c.child;g!==null;)b=g,x=l,b.flags&=14680066,_=b.alternate,_===null?(b.childLanes=0,b.lanes=x,b.child=null,b.subtreeFlags=0,b.memoizedProps=null,b.memoizedState=null,b.updateQueue=null,b.dependencies=null,b.stateNode=null):(b.childLanes=_.childLanes,b.lanes=_.lanes,b.child=_.child,b.subtreeFlags=0,b.deletions=null,b.memoizedProps=_.memoizedProps,b.memoizedState=_.memoizedState,b.updateQueue=_.updateQueue,b.type=_.type,x=_.dependencies,b.dependencies=x===null?null:{lanes:x.lanes,firstContext:x.firstContext}),g=g.sibling;return $t(sr,sr.current&1|2),c.child}l=l.sibling}x.tail!==null&&$e()>ng&&(c.flags|=128,b=!0,Dc(x,!1),c.lanes=4194304)}else{if(!b)if(l=dd(_),l!==null){if(c.flags|=128,b=!0,l=l.updateQueue,l!==null&&(c.updateQueue=l,c.flags|=4),Dc(x,!0),x.tail===null&&x.tailMode==="hidden"&&!_.alternate&&!Zn)return Gr(c),null}else 2*$e()-x.renderingStartTime>ng&&g!==1073741824&&(c.flags|=128,b=!0,Dc(x,!1),c.lanes=4194304);x.isBackwards?(_.sibling=c.child,c.child=_):(l=x.last,l!==null?l.sibling=_:c.child=_,x.last=_)}return x.tail!==null?(c=x.tail,x.rendering=c,x.tail=c.sibling,x.renderingStartTime=$e(),c.sibling=null,l=sr.current,$t(sr,b?l&1|2:l&1),c):(Gr(c),null);case 22:case 23:return ig(),g=c.memoizedState!==null,l!==null&&l.memoizedState!==null!==g&&(c.flags|=8192),g&&c.mode&1?Eo&1073741824&&(Gr(c),fe&&c.subtreeFlags&6&&(c.flags|=8192)):Gr(c),null;case 24:return null;case 25:return null}throw Error(i(156,c.tag))}function II(l,c){switch(fm(c),c.tag){case 1:return Xn(c.type)&&wt(),l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 3:return fl(),Mt(Qt),Mt(Vt),jm(),l=c.flags,l&65536&&!(l&128)?(c.flags=l&-65537|128,c):null;case 5:return Pm(c),null;case 13:if(Mt(sr),l=c.memoizedState,l!==null&&l.dehydrated!==null){if(c.alternate===null)throw Error(i(340));il()}return l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 19:return Mt(sr),null;case 4:return fl(),null;case 10:return ym(c.type._context),null;case 22:case 23:return ig(),null;case 24:return null;default:return null}}var Sd=!1,qr=!1,OI=typeof WeakSet=="function"?WeakSet:Set,ct=null;function hl(l,c){var g=l.ref;if(g!==null)if(typeof g=="function")try{g(null)}catch(b){Jn(l,c,b)}else g.current=null}function Vm(l,c,g){try{g()}catch(b){Jn(l,c,b)}}var Kb=!1;function RI(l,c){for(W(l.containerInfo),ct=c;ct!==null;)if(l=ct,c=l.child,(l.subtreeFlags&1028)!==0&&c!==null)c.return=l,ct=c;else for(;ct!==null;){l=ct;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,x=g.memoizedState,_=l.stateNode,M=_.getSnapshotBeforeUpdate(l.elementType===l.type?b:ds(l.type,b),x);_.__reactInternalSnapshotBeforeUpdate=M}break;case 3:fe&&xn(l.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(Q){Jn(l,l.return,Q)}if(c=l.sibling,c!==null){c.return=l.return,ct=c;break}ct=l.return}return g=Kb,Kb=!1,g}function Ac(l,c,g){var b=c.updateQueue;if(b=b!==null?b.lastEffect:null,b!==null){var x=b=b.next;do{if((x.tag&l)===l){var _=x.destroy;x.destroy=void 0,_!==void 0&&Vm(c,g,_)}x=x.next}while(x!==b)}}function wd(l,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var g=c=c.next;do{if((g.tag&l)===l){var b=g.create;g.destroy=b()}g=g.next}while(g!==c)}}function Um(l){var c=l.ref;if(c!==null){var g=l.stateNode;switch(l.tag){case 5:l=K(g);break;default:l=g}typeof c=="function"?c(l):c.current=l}}function Yb(l){var c=l.alternate;c!==null&&(l.alternate=null,Yb(c)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(c=l.stateNode,c!==null&&Fe(c)),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 Xb(l){return l.tag===5||l.tag===3||l.tag===4}function Qb(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||Xb(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 Gm(l,c,g){var b=l.tag;if(b===5||b===6)l=l.stateNode,c?Yn(g,l,c):Xt(g,l);else if(b!==4&&(l=l.child,l!==null))for(Gm(l,c,g),l=l.sibling;l!==null;)Gm(l,c,g),l=l.sibling}function qm(l,c,g){var b=l.tag;if(b===5||b===6)l=l.stateNode,c?cn(g,l,c):yt(g,l);else if(b!==4&&(l=l.child,l!==null))for(qm(l,c,g),l=l.sibling;l!==null;)qm(l,c,g),l=l.sibling}var Fr=null,fs=!1;function Ls(l,c,g){for(g=g.child;g!==null;)Km(l,c,g),g=g.sibling}function Km(l,c,g){if(an&&typeof an.onCommitFiberUnmount=="function")try{an.onCommitFiberUnmount(Bn,g)}catch{}switch(g.tag){case 5:qr||hl(g,c);case 6:if(fe){var b=Fr,x=fs;Fr=null,Ls(l,c,g),Fr=b,fs=x,Fr!==null&&(fs?et(Fr,g.stateNode):Re(Fr,g.stateNode))}else Ls(l,c,g);break;case 18:fe&&Fr!==null&&(fs?qe(Fr,g.stateNode):Be(Fr,g.stateNode));break;case 4:fe?(b=Fr,x=fs,Fr=g.stateNode.containerInfo,fs=!0,Ls(l,c,g),Fr=b,fs=x):(Pe&&(b=g.stateNode.containerInfo,x=Pn(b),dn(b,x)),Ls(l,c,g));break;case 0:case 11:case 14:case 15:if(!qr&&(b=g.updateQueue,b!==null&&(b=b.lastEffect,b!==null))){x=b=b.next;do{var _=x,M=_.destroy;_=_.tag,M!==void 0&&(_&2||_&4)&&Vm(g,c,M),x=x.next}while(x!==b)}Ls(l,c,g);break;case 1:if(!qr&&(hl(g,c),b=g.stateNode,typeof b.componentWillUnmount=="function"))try{b.props=g.memoizedProps,b.state=g.memoizedState,b.componentWillUnmount()}catch(Q){Jn(g,c,Q)}Ls(l,c,g);break;case 21:Ls(l,c,g);break;case 22:g.mode&1?(qr=(b=qr)||g.memoizedState!==null,Ls(l,c,g),qr=b):Ls(l,c,g);break;default:Ls(l,c,g)}}function Zb(l){var c=l.updateQueue;if(c!==null){l.updateQueue=null;var g=l.stateNode;g===null&&(g=l.stateNode=new OI),c.forEach(function(b){var x=FI.bind(null,l,b);g.has(b)||(g.add(b),b.then(x,x))})}}function ps(l,c){var g=c.deletions;if(g!==null)for(var b=0;b<g.length;b++){var x=g[b];try{var _=l,M=c;if(fe){var Q=M;e:for(;Q!==null;){switch(Q.tag){case 5:Fr=Q.stateNode,fs=!1;break e;case 3:Fr=Q.stateNode.containerInfo,fs=!0;break e;case 4:Fr=Q.stateNode.containerInfo,fs=!0;break e}Q=Q.return}if(Fr===null)throw Error(i(160));Km(_,M,x),Fr=null,fs=!1}else Km(_,M,x);var ce=x.alternate;ce!==null&&(ce.return=null),x.return=null}catch(De){Jn(x,c,De)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)Jb(c,l),c=c.sibling}function Jb(l,c){var g=l.alternate,b=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:if(ps(c,l),Fs(l),b&4){try{Ac(3,l,l.return),wd(3,l)}catch(nt){Jn(l,l.return,nt)}try{Ac(5,l,l.return)}catch(nt){Jn(l,l.return,nt)}}break;case 1:ps(c,l),Fs(l),b&512&&g!==null&&hl(g,g.return);break;case 5:if(ps(c,l),Fs(l),b&512&&g!==null&&hl(g,g.return),fe){if(l.flags&32){var x=l.stateNode;try{it(x)}catch(nt){Jn(l,l.return,nt)}}if(b&4&&(x=l.stateNode,x!=null)){var _=l.memoizedProps;if(g=g!==null?g.memoizedProps:_,b=l.type,c=l.updateQueue,l.updateQueue=null,c!==null)try{vr(x,c,b,g,_,l)}catch(nt){Jn(l,l.return,nt)}}}break;case 6:if(ps(c,l),Fs(l),b&4&&fe){if(l.stateNode===null)throw Error(i(162));x=l.stateNode,_=l.memoizedProps,g=g!==null?g.memoizedProps:_;try{ln(x,g,_)}catch(nt){Jn(l,l.return,nt)}}break;case 3:if(ps(c,l),Fs(l),b&4){if(fe&&Ae&&g!==null&&g.memoizedState.isDehydrated)try{zt(c.containerInfo)}catch(nt){Jn(l,l.return,nt)}if(Pe){x=c.containerInfo,_=c.pendingChildren;try{dn(x,_)}catch(nt){Jn(l,l.return,nt)}}}break;case 4:if(ps(c,l),Fs(l),b&4&&Pe){_=l.stateNode,x=_.containerInfo,_=_.pendingChildren;try{dn(x,_)}catch(nt){Jn(l,l.return,nt)}}break;case 13:ps(c,l),Fs(l),x=l.child,x.flags&8192&&(_=x.memoizedState!==null,x.stateNode.isHidden=_,!_||x.alternate!==null&&x.alternate.memoizedState!==null||(tg=$e())),b&4&&Zb(l);break;case 22:var M=g!==null&&g.memoizedState!==null;if(l.mode&1?(qr=(g=qr)||M,ps(c,l),qr=g):ps(c,l),Fs(l),b&8192){if(g=l.memoizedState!==null,(l.stateNode.isHidden=g)&&!M&&l.mode&1)for(ct=l,b=l.child;b!==null;){for(c=ct=b;ct!==null;){M=ct;var Q=M.child;switch(M.tag){case 0:case 11:case 14:case 15:Ac(4,M,M.return);break;case 1:hl(M,M.return);var ce=M.stateNode;if(typeof ce.componentWillUnmount=="function"){var De=M,ft=M.return;try{var Bt=De;ce.props=Bt.memoizedProps,ce.state=Bt.memoizedState,ce.componentWillUnmount()}catch(nt){Jn(De,ft,nt)}}break;case 5:hl(M,M.return);break;case 22:if(M.memoizedState!==null){nx(c);continue}}Q!==null?(Q.return=M,ct=Q):nx(c)}b=b.sibling}if(fe){e:if(b=null,fe)for(c=l;;){if(c.tag===5){if(b===null){b=c;try{x=c.stateNode,g?ut(x):yr(c.stateNode,c.memoizedProps)}catch(nt){Jn(l,l.return,nt)}}}else if(c.tag===6){if(b===null)try{_=c.stateNode,g?Nt(_):un(_,c.memoizedProps)}catch(nt){Jn(l,l.return,nt)}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===l)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===l)break e;for(;c.sibling===null;){if(c.return===null||c.return===l)break e;b===c&&(b=null),c=c.return}b===c&&(b=null),c.sibling.return=c.return,c=c.sibling}}}break;case 19:ps(c,l),Fs(l),b&4&&Zb(l);break;case 21:break;default:ps(c,l),Fs(l)}}function Fs(l){var c=l.flags;if(c&2){try{if(fe){e:{for(var g=l.return;g!==null;){if(Xb(g)){var b=g;break e}g=g.return}throw Error(i(160))}switch(b.tag){case 5:var x=b.stateNode;b.flags&32&&(it(x),b.flags&=-33);var _=Qb(l);qm(l,_,x);break;case 3:case 4:var M=b.stateNode.containerInfo,Q=Qb(l);Gm(l,Q,M);break;default:throw Error(i(161))}}}catch(ce){Jn(l,l.return,ce)}l.flags&=-3}c&4096&&(l.flags&=-4097)}function TI(l,c,g){ct=l,ex(l)}function ex(l,c,g){for(var b=(l.mode&1)!==0;ct!==null;){var x=ct,_=x.child;if(x.tag===22&&b){var M=x.memoizedState!==null||Sd;if(!M){var Q=x.alternate,ce=Q!==null&&Q.memoizedState!==null||qr;Q=Sd;var De=qr;if(Sd=M,(qr=ce)&&!De)for(ct=x;ct!==null;)M=ct,ce=M.child,M.tag===22&&M.memoizedState!==null?rx(x):ce!==null?(ce.return=M,ct=ce):rx(x);for(;_!==null;)ct=_,ex(_),_=_.sibling;ct=x,Sd=Q,qr=De}tx(l)}else x.subtreeFlags&8772&&_!==null?(_.return=x,ct=_):tx(l)}}function tx(l){for(;ct!==null;){var c=ct;if(c.flags&8772){var g=c.alternate;try{if(c.flags&8772)switch(c.tag){case 0:case 11:case 15:qr||wd(5,c);break;case 1:var b=c.stateNode;if(c.flags&4&&!qr)if(g===null)b.componentDidMount();else{var x=c.elementType===c.type?g.memoizedProps:ds(c.type,g.memoizedProps);b.componentDidUpdate(x,g.memoizedState,b.__reactInternalSnapshotBeforeUpdate)}var _=c.updateQueue;_!==null&&eb(c,_,b);break;case 3:var M=c.updateQueue;if(M!==null){if(g=null,c.child!==null)switch(c.child.tag){case 5:g=K(c.child.stateNode);break;case 1:g=c.child.stateNode}eb(c,M,g)}break;case 5:var Q=c.stateNode;g===null&&c.flags&4&&kn(Q,c.type,c.memoizedProps,c);break;case 6:break;case 4:break;case 12:break;case 13:if(Ae&&c.memoizedState===null){var ce=c.alternate;if(ce!==null){var De=ce.memoizedState;if(De!==null){var ft=De.dehydrated;ft!==null&<(ft)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(i(163))}qr||c.flags&512&&Um(c)}catch(Bt){Jn(c,c.return,Bt)}}if(c===l){ct=null;break}if(g=c.sibling,g!==null){g.return=c.return,ct=g;break}ct=c.return}}function nx(l){for(;ct!==null;){var c=ct;if(c===l){ct=null;break}var g=c.sibling;if(g!==null){g.return=c.return,ct=g;break}ct=c.return}}function rx(l){for(;ct!==null;){var c=ct;try{switch(c.tag){case 0:case 11:case 15:var g=c.return;try{wd(4,c)}catch(ce){Jn(c,g,ce)}break;case 1:var b=c.stateNode;if(typeof b.componentDidMount=="function"){var x=c.return;try{b.componentDidMount()}catch(ce){Jn(c,x,ce)}}var _=c.return;try{Um(c)}catch(ce){Jn(c,_,ce)}break;case 5:var M=c.return;try{Um(c)}catch(ce){Jn(c,M,ce)}}}catch(ce){Jn(c,c.return,ce)}if(c===l){ct=null;break}var Q=c.sibling;if(Q!==null){Q.return=c.return,ct=Q;break}ct=c.return}}var Cd=0,kd=1,Pd=2,_d=3,jd=4;if(typeof Symbol=="function"&&Symbol.for){var Nc=Symbol.for;Cd=Nc("selector.component"),kd=Nc("selector.has_pseudo_class"),Pd=Nc("selector.role"),_d=Nc("selector.test_id"),jd=Nc("selector.text")}function Ym(l){var c=ye(l);if(c!=null){if(typeof c.memoizedProps["data-testname"]!="string")throw Error(i(364));return c}if(l=Fn(l),l===null)throw Error(i(362));return l.stateNode.current}function Xm(l,c){switch(c.$$typeof){case Cd:if(l.type===c.value)return!0;break;case kd:e:{c=c.value,l=[l,0];for(var g=0;g<l.length;){var b=l[g++],x=l[g++],_=c[x];if(b.tag!==5||!te(b)){for(;_!=null&&Xm(b,_);)x++,_=c[x];if(x===c.length){c=!0;break e}else for(b=b.child;b!==null;)l.push(b,x),b=b.sibling}}c=!1}return c;case Pd:if(l.tag===5&&he(l.stateNode,c.value))return!0;break;case jd:if((l.tag===5||l.tag===6)&&(l=we(l),l!==null&&0<=l.indexOf(c.value)))return!0;break;case _d:if(l.tag===5&&(l=l.memoizedProps["data-testname"],typeof l=="string"&&l.toLowerCase()===c.value.toLowerCase()))return!0;break;default:throw Error(i(365))}return!1}function Qm(l){switch(l.$$typeof){case Cd:return"<"+(R(l.value)||"Unknown")+">";case kd:return":has("+(Qm(l)||"")+")";case Pd:return'[role="'+l.value+'"]';case jd:return'"'+l.value+'"';case _d:return'[data-testname="'+l.value+'"]';default:throw Error(i(365))}}function ox(l,c){var g=[];l=[l,0];for(var b=0;b<l.length;){var x=l[b++],_=l[b++],M=c[_];if(x.tag!==5||!te(x)){for(;M!=null&&Xm(x,M);)_++,M=c[_];if(_===c.length)g.push(x);else for(x=x.child;x!==null;)l.push(x,_),x=x.sibling}}return g}function Zm(l,c){if(!xt)throw Error(i(363));l=Ym(l),l=ox(l,c),c=[],l=Array.from(l);for(var g=0;g<l.length;){var b=l[g++];if(b.tag===5)te(b)||c.push(b.stateNode);else for(b=b.child;b!==null;)l.push(b),b=b.sibling}return c}var MI=Math.ceil,Ed=u.ReactCurrentDispatcher,Jm=u.ReactCurrentOwner,br=u.ReactCurrentBatchConfig,Zt=0,Nr=null,kr=null,Br=0,Eo=0,ml=Tt(0),Tr=0,zc=null,bi=0,Id=0,eg=0,$c=null,co=null,tg=0,ng=1/0,ia=null;function gl(){ng=$e()+500}var Od=!1,rg=null,La=null,Rd=!1,Fa=null,Td=0,Lc=0,og=null,Md=-1,Dd=0;function Kr(){return Zt&6?$e():Md!==-1?Md:Md=$e()}function Ba(l){return l.mode&1?Zt&2&&Br!==0?Br&-Br:mI.transition!==null?(Dd===0&&(Dd=mt()),Dd):(l=_e,l!==0?l:at()):1}function Uo(l,c,g,b){if(50<Lc)throw Lc=0,og=null,Error(i(185));dt(l,g,b),(!(Zt&2)||l!==Nr)&&(l===Nr&&(!(Zt&2)&&(Id|=g),Tr===4&&Ha(l,Br)),uo(l,b),g===1&&Zt===0&&!(c.mode&1)&&(gl(),Lr&&Po()))}function uo(l,c){var g=l.callbackNode;gt(l,c);var b=We(l,l===Nr?Br:0);if(b===0)g!==null&&Ze(g),l.callbackNode=null,l.callbackPriority=0;else if(c=b&-b,l.callbackPriority!==c){if(g!=null&&Ze(g),c===1)l.tag===0?nd(ax.bind(null,l)):Na(ax.bind(null,l)),Ye?jt(function(){!(Zt&6)&&Po()}):ze(Gt,Po),g=null;else{switch(Me(b)){case 1:g=Gt;break;case 4:g=mn;break;case 16:g=on;break;case 536870912:g=fr;break;default:g=on}g=mx(g,sx.bind(null,l))}l.callbackPriority=c,l.callbackNode=g}}function sx(l,c){if(Md=-1,Dd=0,Zt&6)throw Error(i(327));var g=l.callbackNode;if(wi()&&l.callbackNode!==g)return null;var b=We(l,l===Nr?Br:0);if(b===0)return null;if(b&30||b&l.expiredLanes||c)c=Ad(l,b);else{c=b;var x=Zt;Zt|=2;var _=cx();(Nr!==l||Br!==c)&&(ia=null,gl(),xi(l,c));do try{NI();break}catch(Q){lx(l,Q)}while(1);vm(),Ed.current=_,Zt=x,kr!==null?c=0:(Nr=null,Br=0,c=Tr)}if(c!==0){if(c===2&&(x=tt(l),x!==0&&(b=x,c=sg(l,x))),c===1)throw g=zc,xi(l,0),Ha(l,b),uo(l,$e()),g;if(c===6)Ha(l,b);else{if(x=l.current.alternate,!(b&30)&&!DI(x)&&(c=Ad(l,b),c===2&&(_=tt(l),_!==0&&(b=_,c=sg(l,_))),c===1))throw g=zc,xi(l,0),Ha(l,b),uo(l,$e()),g;switch(l.finishedWork=x,l.finishedLanes=b,c){case 0:case 1:throw Error(i(345));case 2:Si(l,co,ia);break;case 3:if(Ha(l,b),(b&130023424)===b&&(c=tg+500-$e(),10<c)){if(We(l,0)!==0)break;if(x=l.suspendedLanes,(x&b)!==b){Kr(),l.pingedLanes|=l.suspendedLanes&x;break}l.timeoutHandle=ue(Si.bind(null,l,co,ia),c);break}Si(l,co,ia);break;case 4:if(Ha(l,b),(b&4194240)===b)break;for(c=l.eventTimes,x=-1;0<b;){var M=31-Rn(b);_=1<<M,M=c[M],M>x&&(x=M),b&=~_}if(b=x,b=$e()-b,b=(120>b?120:480>b?480:1080>b?1080:1920>b?1920:3e3>b?3e3:4320>b?4320:1960*MI(b/1960))-b,10<b){l.timeoutHandle=ue(Si.bind(null,l,co,ia),b);break}Si(l,co,ia);break;case 5:Si(l,co,ia);break;default:throw Error(i(329))}}}return uo(l,$e()),l.callbackNode===g?sx.bind(null,l):null}function sg(l,c){var g=$c;return l.current.memoizedState.isDehydrated&&(xi(l,c).flags|=256),l=Ad(l,c),l!==2&&(c=co,co=g,c!==null&&ag(c)),l}function ag(l){co===null?co=l:co.push.apply(co,l)}function DI(l){for(var c=l;;){if(c.flags&16384){var g=c.updateQueue;if(g!==null&&(g=g.stores,g!==null))for(var b=0;b<g.length;b++){var x=g[b],_=x.getSnapshot;x=x.value;try{if(!nn(_(),x))return!1}catch{return!1}}}if(g=c.child,c.subtreeFlags&16384&&g!==null)g.return=c,c=g;else{if(c===l)break;for(;c.sibling===null;){if(c.return===null||c.return===l)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function Ha(l,c){for(c&=~eg,c&=~Id,l.suspendedLanes|=c,l.pingedLanes&=~c,l=l.expirationTimes;0<c;){var g=31-Rn(c),b=1<<g;l[g]=-1,c&=~b}}function ax(l){if(Zt&6)throw Error(i(327));wi();var c=We(l,0);if(!(c&1))return uo(l,$e()),null;var g=Ad(l,c);if(l.tag!==0&&g===2){var b=tt(l);b!==0&&(c=b,g=sg(l,b))}if(g===1)throw g=zc,xi(l,0),Ha(l,c),uo(l,$e()),g;if(g===6)throw Error(i(345));return l.finishedWork=l.current.alternate,l.finishedLanes=c,Si(l,co,ia),uo(l,$e()),null}function ix(l){Fa!==null&&Fa.tag===0&&!(Zt&6)&&wi();var c=Zt;Zt|=1;var g=br.transition,b=_e;try{if(br.transition=null,_e=1,l)return l()}finally{_e=b,br.transition=g,Zt=c,!(Zt&6)&&Po()}}function ig(){Eo=ml.current,Mt(ml)}function xi(l,c){l.finishedWork=null,l.finishedLanes=0;var g=l.timeoutHandle;if(g!==oe&&(l.timeoutHandle=oe,xe(g)),kr!==null)for(g=kr.return;g!==null;){var b=g;switch(fm(b),b.tag){case 1:b=b.type.childContextTypes,b!=null&&wt();break;case 3:fl(),Mt(Qt),Mt(Vt),jm();break;case 5:Pm(b);break;case 4:fl();break;case 13:Mt(sr);break;case 19:Mt(sr);break;case 10:ym(b.type._context);break;case 22:case 23:ig()}g=g.return}if(Nr=l,kr=l=Wa(l.current,null),Br=Eo=c,Tr=0,zc=null,eg=Id=bi=0,co=$c=null,vi!==null){for(c=0;c<vi.length;c++)if(g=vi[c],b=g.interleaved,b!==null){g.interleaved=null;var x=b.next,_=g.pending;if(_!==null){var M=_.next;_.next=x,b.next=M}g.pending=b}vi=null}return l}function lx(l,c){do{var g=kr;try{if(vm(),fd.current=gd,pd){for(var b=ar.memoizedState;b!==null;){var x=b.queue;x!==null&&(x.pending=null),b=b.next}pd=!1}if(yi=0,Ar=Rr=ar=null,Ec=!1,Ic=0,Jm.current=null,g===null||g.return===null){Tr=1,zc=c,kr=null;break}e:{var _=l,M=g.return,Q=g,ce=c;if(c=Br,Q.flags|=32768,ce!==null&&typeof ce=="object"&&typeof ce.then=="function"){var De=ce,ft=Q,Bt=ft.tag;if(!(ft.mode&1)&&(Bt===0||Bt===11||Bt===15)){var nt=ft.alternate;nt?(ft.updateQueue=nt.updateQueue,ft.memoizedState=nt.memoizedState,ft.lanes=nt.lanes):(ft.updateQueue=null,ft.memoizedState=null)}var Hn=Mb(M);if(Hn!==null){Hn.flags&=-257,Db(Hn,M,Q,_,c),Hn.mode&1&&Tb(_,De,c),c=Hn,ce=De;var Dn=c.updateQueue;if(Dn===null){var fo=new Set;fo.add(ce),c.updateQueue=fo}else Dn.add(ce);break e}else{if(!(c&1)){Tb(_,De,c),lg();break e}ce=Error(i(426))}}else if(Zn&&Q.mode&1){var la=Mb(M);if(la!==null){!(la.flags&65536)&&(la.flags|=256),Db(la,M,Q,_,c),mm(pl(ce,Q));break e}}_=ce=pl(ce,Q),Tr!==4&&(Tr=2),$c===null?$c=[_]:$c.push(_),_=M;do{switch(_.tag){case 3:_.flags|=65536,c&=-c,_.lanes|=c;var ie=Ob(_,ce,c);Jy(_,ie);break e;case 1:Q=ce;var ee=_.type,me=_.stateNode;if(!(_.flags&128)&&(typeof ee.getDerivedStateFromError=="function"||me!==null&&typeof me.componentDidCatch=="function"&&(La===null||!La.has(me)))){_.flags|=65536,c&=-c,_.lanes|=c;var ot=Rb(_,Q,c);Jy(_,ot);break e}}_=_.return}while(_!==null)}dx(g)}catch(It){c=It,kr===g&&g!==null&&(kr=g=g.return);continue}break}while(1)}function cx(){var l=Ed.current;return Ed.current=gd,l===null?gd:l}function lg(){(Tr===0||Tr===3||Tr===2)&&(Tr=4),Nr===null||!(bi&268435455)&&!(Id&268435455)||Ha(Nr,Br)}function Ad(l,c){var g=Zt;Zt|=2;var b=cx();(Nr!==l||Br!==c)&&(ia=null,xi(l,c));do try{AI();break}catch(x){lx(l,x)}while(1);if(vm(),Zt=g,Ed.current=b,kr!==null)throw Error(i(261));return Nr=null,Br=0,Tr}function AI(){for(;kr!==null;)ux(kr)}function NI(){for(;kr!==null&&!Et();)ux(kr)}function ux(l){var c=hx(l.alternate,l,Eo);l.memoizedProps=l.pendingProps,c===null?dx(l):kr=c,Jm.current=null}function dx(l){var c=l;do{var g=c.alternate;if(l=c.return,c.flags&32768){if(g=II(g,c),g!==null){g.flags&=32767,kr=g;return}if(l!==null)l.flags|=32768,l.subtreeFlags=0,l.deletions=null;else{Tr=6,kr=null;return}}else if(g=EI(g,c,Eo),g!==null){kr=g;return}if(c=c.sibling,c!==null){kr=c;return}kr=c=l}while(c!==null);Tr===0&&(Tr=5)}function Si(l,c,g){var b=_e,x=br.transition;try{br.transition=null,_e=1,zI(l,c,g,b)}finally{br.transition=x,_e=b}return null}function zI(l,c,g,b){do wi();while(Fa!==null);if(Zt&6)throw Error(i(327));g=l.finishedWork;var x=l.finishedLanes;if(g===null)return null;if(l.finishedWork=null,l.finishedLanes=0,g===l.current)throw Error(i(177));l.callbackNode=null,l.callbackPriority=0;var _=g.lanes|g.childLanes;if(Je(l,_),l===Nr&&(kr=Nr=null,Br=0),!(g.subtreeFlags&2064)&&!(g.flags&2064)||Rd||(Rd=!0,mx(on,function(){return wi(),null})),_=(g.flags&15990)!==0,g.subtreeFlags&15990||_){_=br.transition,br.transition=null;var M=_e;_e=1;var Q=Zt;Zt|=4,Jm.current=null,RI(l,g),Jb(g,l),U(l.containerInfo),l.current=g,TI(g),_t(),Zt=Q,_e=M,br.transition=_}else l.current=g;if(Rd&&(Rd=!1,Fa=l,Td=x),_=l.pendingLanes,_===0&&(La=null),Ln(g.stateNode),uo(l,$e()),c!==null)for(b=l.onRecoverableError,g=0;g<c.length;g++)x=c[g],b(x.value,{componentStack:x.stack,digest:x.digest});if(Od)throw Od=!1,l=rg,rg=null,l;return Td&1&&l.tag!==0&&wi(),_=l.pendingLanes,_&1?l===og?Lc++:(Lc=0,og=l):Lc=0,Po(),null}function wi(){if(Fa!==null){var l=Me(Td),c=br.transition,g=_e;try{if(br.transition=null,_e=16>l?16:l,Fa===null)var b=!1;else{if(l=Fa,Fa=null,Td=0,Zt&6)throw Error(i(331));var x=Zt;for(Zt|=4,ct=l.current;ct!==null;){var _=ct,M=_.child;if(ct.flags&16){var Q=_.deletions;if(Q!==null){for(var ce=0;ce<Q.length;ce++){var De=Q[ce];for(ct=De;ct!==null;){var ft=ct;switch(ft.tag){case 0:case 11:case 15:Ac(8,ft,_)}var Bt=ft.child;if(Bt!==null)Bt.return=ft,ct=Bt;else for(;ct!==null;){ft=ct;var nt=ft.sibling,Hn=ft.return;if(Yb(ft),ft===De){ct=null;break}if(nt!==null){nt.return=Hn,ct=nt;break}ct=Hn}}}var Dn=_.alternate;if(Dn!==null){var fo=Dn.child;if(fo!==null){Dn.child=null;do{var la=fo.sibling;fo.sibling=null,fo=la}while(fo!==null)}}ct=_}}if(_.subtreeFlags&2064&&M!==null)M.return=_,ct=M;else e:for(;ct!==null;){if(_=ct,_.flags&2048)switch(_.tag){case 0:case 11:case 15:Ac(9,_,_.return)}var ie=_.sibling;if(ie!==null){ie.return=_.return,ct=ie;break e}ct=_.return}}var ee=l.current;for(ct=ee;ct!==null;){M=ct;var me=M.child;if(M.subtreeFlags&2064&&me!==null)me.return=M,ct=me;else e:for(M=ee;ct!==null;){if(Q=ct,Q.flags&2048)try{switch(Q.tag){case 0:case 11:case 15:wd(9,Q)}}catch(It){Jn(Q,Q.return,It)}if(Q===M){ct=null;break e}var ot=Q.sibling;if(ot!==null){ot.return=Q.return,ct=ot;break e}ct=Q.return}}if(Zt=x,Po(),an&&typeof an.onPostCommitFiberRoot=="function")try{an.onPostCommitFiberRoot(Bn,l)}catch{}b=!0}return b}finally{_e=g,br.transition=c}}return!1}function fx(l,c,g){c=pl(g,c),c=Ob(l,c,1),l=$a(l,c,1),c=Kr(),l!==null&&(dt(l,1,c),uo(l,c))}function Jn(l,c,g){if(l.tag===3)fx(l,l,g);else for(;c!==null;){if(c.tag===3){fx(c,l,g);break}else if(c.tag===1){var b=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof b.componentDidCatch=="function"&&(La===null||!La.has(b))){l=pl(g,l),l=Rb(c,l,1),c=$a(c,l,1),l=Kr(),c!==null&&(dt(c,1,l),uo(c,l));break}}c=c.return}}function $I(l,c,g){var b=l.pingCache;b!==null&&b.delete(c),c=Kr(),l.pingedLanes|=l.suspendedLanes&g,Nr===l&&(Br&g)===g&&(Tr===4||Tr===3&&(Br&130023424)===Br&&500>$e()-tg?xi(l,0):eg|=g),uo(l,c)}function px(l,c){c===0&&(l.mode&1?(c=pn,pn<<=1,!(pn&130023424)&&(pn=4194304)):c=1);var g=Kr();l=As(l,c),l!==null&&(dt(l,c,g),uo(l,g))}function LI(l){var c=l.memoizedState,g=0;c!==null&&(g=c.retryLane),px(l,g)}function FI(l,c){var g=0;switch(l.tag){case 13:var b=l.stateNode,x=l.memoizedState;x!==null&&(g=x.retryLane);break;case 19:b=l.stateNode;break;default:throw Error(i(314))}b!==null&&b.delete(c),px(l,g)}var hx;hx=function(l,c,g){if(l!==null)if(l.memoizedProps!==c.pendingProps||Qt.current)lo=!0;else{if(!(l.lanes&g)&&!(c.flags&128))return lo=!1,jI(l,c,g);lo=!!(l.flags&131072)}else lo=!1,Zn&&c.flags&1048576&&Uy(c,to,c.index);switch(c.lanes=0,c.tag){case 2:var b=c.type;yd(l,c),l=c.pendingProps;var x=Ir(c,Vt.current);cl(c,g),x=Om(null,c,b,l,x,g);var _=Rm();return c.flags|=1,typeof x=="object"&&x!==null&&typeof x.render=="function"&&x.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,Xn(b)?(_=!0,Qn(c)):_=!1,c.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,Sm(c),x.updater=cd,c.stateNode=x,x._reactInternals=c,Cm(c,b,l,g),c=Lm(null,c,b,!0,_,g)):(c.tag=0,Zn&&_&&dm(c),oo(null,c,x,g),c=c.child),c;case 16:b=c.elementType;e:{switch(yd(l,c),l=c.pendingProps,x=b._init,b=x(b._payload),c.type=b,x=c.tag=HI(b),l=ds(b,l),x){case 0:c=$m(null,c,b,l,g);break e;case 1:c=Fb(null,c,b,l,g);break e;case 11:c=Ab(null,c,b,l,g);break e;case 14:c=Nb(null,c,b,ds(b.type,l),g);break e}throw Error(i(306,b,""))}return c;case 0:return b=c.type,x=c.pendingProps,x=c.elementType===b?x:ds(b,x),$m(l,c,b,x,g);case 1:return b=c.type,x=c.pendingProps,x=c.elementType===b?x:ds(b,x),Fb(l,c,b,x,g);case 3:e:{if(Bb(c),l===null)throw Error(i(387));b=c.pendingProps,_=c.memoizedState,x=_.element,Zy(l,c),ld(c,b,null,g);var M=c.memoizedState;if(b=M.element,Ae&&_.isDehydrated)if(_={element:b,isDehydrated:!1,cache:M.cache,pendingSuspenseBoundaries:M.pendingSuspenseBoundaries,transitions:M.transitions},c.updateQueue.baseState=_,c.memoizedState=_,c.flags&256){x=pl(Error(i(423)),c),c=Hb(l,c,b,g,x);break e}else if(b!==x){x=pl(Error(i(424)),c),c=Hb(l,c,b,g,x);break e}else for(Ae&&(Bo=Z(c.stateNode.containerInfo),jo=c,Zn=!0,us=null,kc=!1),g=ib(c,null,b,g),c.child=g;g;)g.flags=g.flags&-3|4096,g=g.sibling;else{if(il(),b===x){c=aa(l,c,g);break e}oo(l,c,b,g)}c=c.child}return c;case 5:return lb(c),l===null&&hm(c),b=c.type,x=c.pendingProps,_=l!==null?l.memoizedProps:null,M=x.children,Y(b,x)?M=null:_!==null&&Y(b,_)&&(c.flags|=32),Lb(l,c),oo(l,c,M,g),c.child;case 6:return l===null&&hm(c),null;case 13:return Wb(l,c,g);case 4:return km(c,c.stateNode.containerInfo),b=c.pendingProps,l===null?c.child=ul(c,null,b,g):oo(l,c,b,g),c.child;case 11:return b=c.type,x=c.pendingProps,x=c.elementType===b?x:ds(b,x),Ab(l,c,b,x,g);case 7:return oo(l,c,c.pendingProps,g),c.child;case 8:return oo(l,c,c.pendingProps.children,g),c.child;case 12:return oo(l,c,c.pendingProps.children,g),c.child;case 10:e:{if(b=c.type._context,x=c.pendingProps,_=c.memoizedProps,M=x.value,Xy(c,b,M),_!==null)if(nn(_.value,M)){if(_.children===x.children&&!Qt.current){c=aa(l,c,g);break e}}else for(_=c.child,_!==null&&(_.return=c);_!==null;){var Q=_.dependencies;if(Q!==null){M=_.child;for(var ce=Q.firstContext;ce!==null;){if(ce.context===b){if(_.tag===1){ce=sa(-1,g&-g),ce.tag=2;var De=_.updateQueue;if(De!==null){De=De.shared;var ft=De.pending;ft===null?ce.next=ce:(ce.next=ft.next,ft.next=ce),De.pending=ce}}_.lanes|=g,ce=_.alternate,ce!==null&&(ce.lanes|=g),bm(_.return,g,c),Q.lanes|=g;break}ce=ce.next}}else if(_.tag===10)M=_.type===c.type?null:_.child;else if(_.tag===18){if(M=_.return,M===null)throw Error(i(341));M.lanes|=g,Q=M.alternate,Q!==null&&(Q.lanes|=g),bm(M,g,c),M=_.sibling}else M=_.child;if(M!==null)M.return=_;else for(M=_;M!==null;){if(M===c){M=null;break}if(_=M.sibling,_!==null){_.return=M.return,M=_;break}M=M.return}_=M}oo(l,c,x.children,g),c=c.child}return c;case 9:return x=c.type,b=c.pendingProps.children,cl(c,g),x=Ho(x),b=b(x),c.flags|=1,oo(l,c,b,g),c.child;case 14:return b=c.type,x=ds(b,c.pendingProps),x=ds(b.type,x),Nb(l,c,b,x,g);case 15:return zb(l,c,c.type,c.pendingProps,g);case 17:return b=c.type,x=c.pendingProps,x=c.elementType===b?x:ds(b,x),yd(l,c),c.tag=1,Xn(b)?(l=!0,Qn(c)):l=!1,cl(c,g),rb(c,b,x),Cm(c,b,x,g),Lm(null,c,b,!0,l,g);case 19:return Ub(l,c,g);case 22:return $b(l,c,g)}throw Error(i(156,c.tag))};function mx(l,c){return ze(l,c)}function BI(l,c,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=c,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 Go(l,c,g,b){return new BI(l,c,g,b)}function cg(l){return l=l.prototype,!(!l||!l.isReactComponent)}function HI(l){if(typeof l=="function")return cg(l)?1:0;if(l!=null){if(l=l.$$typeof,l===w)return 11;if(l===P)return 14}return 2}function Wa(l,c){var g=l.alternate;return g===null?(g=Go(l.tag,c,l.key,l.mode),g.elementType=l.elementType,g.type=l.type,g.stateNode=l.stateNode,g.alternate=l,l.alternate=g):(g.pendingProps=c,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,c=l.dependencies,g.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},g.sibling=l.sibling,g.index=l.index,g.ref=l.ref,g}function Nd(l,c,g,b,x,_){var M=2;if(b=l,typeof l=="function")cg(l)&&(M=1);else if(typeof l=="string")M=5;else e:switch(l){case h:return Ci(g.children,x,_,c);case m:M=8,x|=8;break;case v:return l=Go(12,g,c,x|2),l.elementType=v,l.lanes=_,l;case C:return l=Go(13,g,c,x),l.elementType=C,l.lanes=_,l;case k:return l=Go(19,g,c,x),l.elementType=k,l.lanes=_,l;case E:return zd(g,x,_,c);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case y:M=10;break e;case S:M=9;break e;case w:M=11;break e;case P:M=14;break e;case j:M=16,b=null;break e}throw Error(i(130,l==null?l:typeof l,""))}return c=Go(M,g,c,x),c.elementType=l,c.type=b,c.lanes=_,c}function Ci(l,c,g,b){return l=Go(7,l,b,c),l.lanes=g,l}function zd(l,c,g,b){return l=Go(22,l,b,c),l.elementType=E,l.lanes=g,l.stateNode={isHidden:!1},l}function ug(l,c,g){return l=Go(6,l,null,c),l.lanes=g,l}function dg(l,c,g){return c=Go(4,l.children!==null?l.children:[],l.key,c),c.lanes=g,c.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},c}function WI(l,c,g,b,x){this.tag=c,this.containerInfo=l,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=oe,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Dt(0),this.expirationTimes=Dt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Dt(0),this.identifierPrefix=b,this.onRecoverableError=x,Ae&&(this.mutableSourceEagerHydrationData=null)}function gx(l,c,g,b,x,_,M,Q,ce){return l=new WI(l,c,g,Q,ce),c===1?(c=1,_===!0&&(c|=8)):c=0,_=Go(3,null,null,c),l.current=_,_.stateNode=l,_.memoizedState={element:b,isDehydrated:g,cache:null,transitions:null,pendingSuspenseBoundaries:null},Sm(_),l}function vx(l){if(!l)return fn;l=l._reactInternals;e:{if(D(l)!==l||l.tag!==1)throw Error(i(170));var c=l;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(Xn(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(i(171))}if(l.tag===1){var g=l.type;if(Xn(g))return _n(l,g,c)}return c}function yx(l){var c=l._reactInternals;if(c===void 0)throw typeof l.render=="function"?Error(i(188)):(l=Object.keys(l).join(","),Error(i(268,l)));return l=J(c),l===null?null:l.stateNode}function bx(l,c){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var g=l.retryLane;l.retryLane=g!==0&&g<c?g:c}}function $d(l,c){bx(l,c),(l=l.alternate)&&bx(l,c)}function VI(l){return l=J(l),l===null?null:l.stateNode}function UI(){return null}return n.attemptContinuousHydration=function(l){if(l.tag===13){var c=As(l,134217728);if(c!==null){var g=Kr();Uo(c,l,134217728,g)}$d(l,134217728)}},n.attemptDiscreteHydration=function(l){if(l.tag===13){var c=As(l,1);if(c!==null){var g=Kr();Uo(c,l,1,g)}$d(l,1)}},n.attemptHydrationAtCurrentPriority=function(l){if(l.tag===13){var c=Ba(l),g=As(l,c);if(g!==null){var b=Kr();Uo(g,l,c,b)}$d(l,c)}},n.attemptSynchronousHydration=function(l){switch(l.tag){case 3:var c=l.stateNode;if(c.current.memoizedState.isDehydrated){var g=hn(c.pendingLanes);g!==0&&(Ie(c,g|1),uo(c,$e()),!(Zt&6)&&(gl(),Po()))}break;case 13:ix(function(){var b=As(l,1);if(b!==null){var x=Kr();Uo(b,l,1,x)}}),$d(l,1)}},n.batchedUpdates=function(l,c){var g=Zt;Zt|=1;try{return l(c)}finally{Zt=g,Zt===0&&(gl(),Lr&&Po())}},n.createComponentSelector=function(l){return{$$typeof:Cd,value:l}},n.createContainer=function(l,c,g,b,x,_,M){return gx(l,c,!1,null,g,b,x,_,M)},n.createHasPseudoClassSelector=function(l){return{$$typeof:kd,value:l}},n.createHydrationContainer=function(l,c,g,b,x,_,M,Q,ce){return l=gx(g,b,!0,l,x,_,M,Q,ce),l.context=vx(null),g=l.current,b=Kr(),x=Ba(g),_=sa(b,x),_.callback=c??null,$a(g,_,x),l.current.lanes=x,dt(l,x,b),uo(l,b),l},n.createPortal=function(l,c,g){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:b==null?null:""+b,children:l,containerInfo:c,implementation:g}},n.createRoleSelector=function(l){return{$$typeof:Pd,value:l}},n.createTestNameSelector=function(l){return{$$typeof:_d,value:l}},n.createTextSelector=function(l){return{$$typeof:jd,value:l}},n.deferredUpdates=function(l){var c=_e,g=br.transition;try{return br.transition=null,_e=16,l()}finally{_e=c,br.transition=g}},n.discreteUpdates=function(l,c,g,b,x){var _=_e,M=br.transition;try{return br.transition=null,_e=1,l(c,g,b,x)}finally{_e=_,br.transition=M,Zt===0&&gl()}},n.findAllNodes=Zm,n.findBoundingRects=function(l,c){if(!xt)throw Error(i(363));c=Zm(l,c),l=[];for(var g=0;g<c.length;g++)l.push(X(c[g]));for(c=l.length-1;0<c;c--){g=l[c];for(var b=g.x,x=b+g.width,_=g.y,M=_+g.height,Q=c-1;0<=Q;Q--)if(c!==Q){var ce=l[Q],De=ce.x,ft=De+ce.width,Bt=ce.y,nt=Bt+ce.height;if(b>=De&&_>=Bt&&x<=ft&&M<=nt){l.splice(c,1);break}else if(b!==De||g.width!==ce.width||nt<_||Bt>M){if(!(_!==Bt||g.height!==ce.height||ft<b||De>x)){De>b&&(ce.width+=De-b,ce.x=b),ft<x&&(ce.width=x-De),l.splice(c,1);break}}else{Bt>_&&(ce.height+=Bt-_,ce.y=_),nt<M&&(ce.height=M-Bt),l.splice(c,1);break}}}return l},n.findHostInstance=yx,n.findHostInstanceWithNoPortals=function(l){return l=A(l),l=l!==null?B(l):null,l===null?null:l.stateNode},n.findHostInstanceWithWarning=function(l){return yx(l)},n.flushControlled=function(l){var c=Zt;Zt|=1;var g=br.transition,b=_e;try{br.transition=null,_e=1,l()}finally{_e=b,br.transition=g,Zt=c,Zt===0&&(gl(),Po())}},n.flushPassiveEffects=wi,n.flushSync=ix,n.focusWithin=function(l,c){if(!xt)throw Error(i(363));for(l=Ym(l),c=ox(l,c),c=Array.from(c),l=0;l<c.length;){var g=c[l++];if(!te(g)){if(g.tag===5&&Ne(g.stateNode))return!0;for(g=g.child;g!==null;)c.push(g),g=g.sibling}}return!1},n.getCurrentUpdatePriority=function(){return _e},n.getFindAllNodesFailureDescription=function(l,c){if(!xt)throw Error(i(363));var g=0,b=[];l=[Ym(l),0];for(var x=0;x<l.length;){var _=l[x++],M=l[x++],Q=c[M];if((_.tag!==5||!te(_))&&(Xm(_,Q)&&(b.push(Qm(Q)),M++,M>g&&(g=M)),M<c.length))for(_=_.child;_!==null;)l.push(_,M),_=_.sibling}if(g<c.length){for(l=[];g<c.length;g++)l.push(Qm(c[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 K(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:u.ReactCurrentDispatcher,findHostInstanceByFiber:VI,findFiberByHostInstance:l.findFiberByHostInstance||UI,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")l=!1;else{var c=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(c.isDisabled||!c.supportsFiber)l=!0;else{try{Bn=c.inject(l),an=c}catch{}l=!!c.checkDCE}}return l},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(l,c,g,b){if(!xt)throw Error(i(363));l=Zm(l,c);var x=Xe(l,g,b).disconnect;return{disconnect:function(){x()}}},n.registerMutableSourceForHydration=function(l,c){var g=c._getVersion;g=g(c._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[c,g]:l.mutableSourceEagerHydrationData.push(c,g)},n.runWithPriority=function(l,c){var g=_e;try{return _e=l,c()}finally{_e=g}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(l,c,g,b){var x=c.current,_=Kr(),M=Ba(x);return g=vx(g),c.context===null?c.context=g:c.pendingContext=g,c=sa(_,M),c.payload={element:l},b=b===void 0?null:b,b!==null&&(c.callback=b),l=$a(x,c,M),l!==null&&(Uo(l,x,M,_),id(l,x,M)),M},n};QE.exports=bre;var xre=QE.exports;const Sre=fc(xre);var ZE={exports:{}},al={};/**
|
||
* @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.
|
||
*/al.ConcurrentRoot=1;al.ContinuousEventPriority=4;al.DefaultEventPriority=16;al.DiscreteEventPriority=1;al.IdleEventPriority=536870912;al.LegacyRoot=0;ZE.exports=al;var JE=ZE.exports;const F4={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let B4=!1,H4=!1;const Hy=".react-konva-event",wre=`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
|
||
`,Cre=`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
|
||
`,kre={};function um(e,t,n=kre){if(!B4&&"zIndex"in t&&(console.warn(Cre),B4=!0),!H4&&t.draggable){var r=t.x!==void 0||t.y!==void 0,o=t.onDragEnd||t.onDragMove;r&&!o&&(console.warn(wre),H4=!0)}for(var s in n)if(!F4[s]){var i=s.slice(0,2)==="on",u=n[s]!==t[s];if(i&&u){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(!F4[s]){var i=s.slice(0,2)==="on",S=n[s]!==t[s];if(i&&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])}!i&&(t[s]!==n[s]||h&&t[s]!==e.getAttr(s))&&(v=!0,m[s]=t[s])}v&&(e.setAttrs(m),mi(e));for(var d in y)e.on(d+Hy,y[d])}function mi(e){if(!U7.Konva.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const eI={},Pre={};Iu.Node.prototype._applyProps=um;function _re(e,t){if(typeof t=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${t}`);return}e.add(t),mi(e)}function jre(e,t,n){let r=Iu[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=Iu.Group);const o={},s={};for(var i in t){var u=i.slice(0,2)==="on";u?s[i]=t[i]:o[i]=t[i]}const d=new r(o);return um(d,s),d}function Ere(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function Ire(e,t,n){return!1}function Ore(e){return e}function Rre(){return null}function Tre(){return null}function Mre(e,t,n,r){return Pre}function Dre(){}function Are(e){}function Nre(e,t){return!1}function zre(){return eI}function $re(){return eI}const Lre=setTimeout,Fre=clearTimeout,Bre=-1;function Hre(e,t){return!1}const Wre=!1,Vre=!0,Ure=!0;function Gre(e,t){t.parent===e?t.moveToTop():e.add(t),mi(e)}function qre(e,t){t.parent===e?t.moveToTop():e.add(t),mi(e)}function tI(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),mi(e)}function Kre(e,t,n){tI(e,t,n)}function Yre(e,t){t.destroy(),t.off(Hy),mi(e)}function Xre(e,t){t.destroy(),t.off(Hy),mi(e)}function Qre(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function Zre(e,t,n){}function Jre(e,t,n,r,o){um(e,o,r)}function eoe(e){e.hide(),mi(e)}function toe(e){}function noe(e,t){(t.visible==null||t.visible)&&e.show()}function roe(e,t){}function ooe(e){}function soe(){}const aoe=()=>JE.DefaultEventPriority,ioe=Object.freeze(Object.defineProperty({__proto__:null,appendChild:Gre,appendChildToContainer:qre,appendInitialChild:_re,cancelTimeout:Fre,clearContainer:ooe,commitMount:Zre,commitTextUpdate:Qre,commitUpdate:Jre,createInstance:jre,createTextInstance:Ere,detachDeletedInstance:soe,finalizeInitialChildren:Ire,getChildHostContext:$re,getCurrentEventPriority:aoe,getPublicInstance:Ore,getRootHostContext:zre,hideInstance:eoe,hideTextInstance:toe,idlePriority:Rf.unstable_IdlePriority,insertBefore:tI,insertInContainerBefore:Kre,isPrimaryRenderer:Wre,noTimeout:Bre,now:Rf.unstable_now,prepareForCommit:Rre,preparePortalMount:Tre,prepareUpdate:Mre,removeChild:Yre,removeChildFromContainer:Xre,resetAfterCommit:Dre,resetTextContent:Are,run:Rf.unstable_runWithPriority,scheduleTimeout:Lre,shouldDeprioritizeSubtree:Nre,shouldSetTextContent:Hre,supportsMutation:Ure,unhideInstance:noe,unhideTextInstance:roe,warnsIfNotActing:Vre},Symbol.toStringTag,{value:"Module"}));var loe=Object.defineProperty,coe=Object.defineProperties,uoe=Object.getOwnPropertyDescriptors,W4=Object.getOwnPropertySymbols,doe=Object.prototype.hasOwnProperty,foe=Object.prototype.propertyIsEnumerable,V4=(e,t,n)=>t in e?loe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,U4=(e,t)=>{for(var n in t||(t={}))doe.call(t,n)&&V4(e,n,t[n]);if(W4)for(var n of W4(t))foe.call(t,n)&&V4(e,n,t[n]);return e},poe=(e,t)=>coe(e,uoe(t));function nI(e,t,n){if(!e)return;if(n(e)===!0)return e;let r=t?e.return:e.child;for(;r;){const o=nI(r,t,n);if(o)return o;r=t?null:r.sibling}}function rI(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const Wy=rI(p.createContext(null));class oI extends p.Component{render(){return p.createElement(Wy.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:G4,ReactCurrentDispatcher:q4}=p.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function hoe(){const e=p.useContext(Wy);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[G4==null?void 0:G4.current,e,e==null?void 0:e.alternate]){if(!r)continue;const o=nI(r,!1,s=>{let i=s.memoizedState;for(;i;){if(i.memoizedState===t)return!0;i=i.next}});if(o)return o}},[e,t])}function moe(){var e,t;const n=hoe(),[r]=p.useState(()=>new Map);r.clear();let o=n;for(;o;){const s=(e=o.type)==null?void 0:e._context;s&&s!==Wy&&!r.has(s)&&r.set(s,(t=q4==null?void 0:q4.current)==null?void 0:t.readContext(rI(s))),o=o.return}return r}function goe(){const e=moe();return p.useMemo(()=>Array.from(e.keys()).reduce((t,n)=>r=>p.createElement(t,null,p.createElement(n.Provider,poe(U4({},r),{value:e.get(n)}))),t=>p.createElement(oI,U4({},t))),[e])}function voe(e){const t=L.useRef({});return L.useLayoutEffect(()=>{t.current=e}),L.useLayoutEffect(()=>()=>{t.current={}},[]),t.current}const yoe=e=>{const t=L.useRef(),n=L.useRef(),r=L.useRef(),o=voe(e),s=goe(),i=u=>{const{forwardedRef:d}=e;d&&(typeof d=="function"?d(u):d.current=u)};return L.useLayoutEffect(()=>(n.current=new Iu.Stage({width:e.width,height:e.height,container:t.current}),i(n.current),r.current=ru.createContainer(n.current,JE.LegacyRoot,!1,null),ru.updateContainer(L.createElement(s,{},e.children),r.current),()=>{Iu.isBrowser&&(i(null),ru.updateContainer(null,r.current,null),n.current.destroy())}),[]),L.useLayoutEffect(()=>{i(n.current),um(n.current,e,o),ru.updateContainer(L.createElement(s,{},e.children),r.current,null)}),L.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})},Xc="Layer",ja="Group",Zs="Rect",Pi="Circle",sh="Line",sI="Image",boe="Transformer",ru=Sre(ioe);ru.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:L.version,rendererPackageName:"react-konva"});const xoe=L.forwardRef((e,t)=>L.createElement(oI,{},L.createElement(yoe,{...e,forwardedRef:t}))),Soe=Ce([en,or],(e,t)=>{const{tool:n,isMovingBoundingBox:r}=e;return{tool:n,isStaging:t,isMovingBoundingBox:r}},{memoizeOptions:{resultEqualityCheck:Wt}}),woe=()=>{const e=ne(),{tool:t,isStaging:n,isMovingBoundingBox:r}=F(Soe);return{handleDragStart:p.useCallback(()=>{(t==="move"||n)&&!r&&e(Kf(!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(B3(s))},[e,r,n,t]),handleDragEnd:p.useCallback(()=>{(t==="move"||n)&&!r&&e(Kf(!1))},[e,r,n,t])}},Coe=Ce([en,Sr,or],(e,t,n)=>{const{cursorPosition:r,shouldLockBoundingBox:o,shouldShowBoundingBox:s,tool:i,isMaskEnabled:u,shouldSnapToGrid:d}=e;return{activeTabName:t,isCursorOnCanvas:!!r,shouldLockBoundingBox:o,shouldShowBoundingBox:s,tool:i,isStaging:n,isMaskEnabled:u,shouldSnapToGrid:d}},{memoizeOptions:{resultEqualityCheck:Wt}}),koe=()=>{const e=ne(),{activeTabName:t,shouldShowBoundingBox:n,tool:r,isStaging:o,isMaskEnabled:s,shouldSnapToGrid:i}=F(Coe),u=p.useRef(null),d=H3(),f=()=>e(Z0());Ke(["shift+c"],()=>{f()},{enabled:()=>!o,preventDefault:!0},[]);const h=()=>e($u(!s));Ke(["h"],()=>{h()},{enabled:()=>!o,preventDefault:!0},[s]),Ke(["n"],()=>{e(Yf(!i))},{enabled:!0,preventDefault:!0},[i]),Ke("esc",()=>{e(G7())},{enabled:()=>!0,preventDefault:!0}),Ke("shift+h",()=>{e(q7(!n))},{enabled:()=>!o,preventDefault:!0},[t,n]),Ke(["space"],m=>{m.repeat||(d==null||d.container().focus(),r!=="move"&&(u.current=r,e(qs("move"))),r==="move"&&u.current&&u.current!=="move"&&(e(qs(u.current)),u.current="move"))},{keyup:!0,keydown:!0,preventDefault:!0},[r,u])},Vy=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}},aI=()=>{const e=ne(),t=ba(),n=H3();return{updateColorUnderCursor:()=>{if(!n||!t)return;const r=n.getPointerPosition();if(!r)return;const o=K7.pixelRatio,[s,i,u,d]=t.getContext().getImageData(r.x*o,r.y*o,1,1).data;e(Y7({r:s,g:i,b:u,a:d}))},commitColorUnderCursor:()=>{e(X7())}}},Poe=Ce([Sr,en,or],(e,t,n)=>{const{tool:r}=t;return{tool:r,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:Wt}}),_oe=e=>{const t=ne(),{tool:n,isStaging:r}=F(Poe),{commitColorUnderCursor:o}=aI();return p.useCallback(s=>{if(!e.current)return;if(e.current.container().focus(),n==="move"||r){t(Kf(!0));return}if(n==="colorPicker"){o();return}const i=Vy(e.current);i&&(s.evt.preventDefault(),t(W3(!0)),t(Q7([i.x,i.y])))},[e,n,r,t,o])},joe=Ce([Sr,en,or],(e,t,n)=>{const{tool:r,isDrawing:o}=t;return{tool:r,isDrawing:o,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:Wt}}),Eoe=(e,t,n)=>{const r=ne(),{isDrawing:o,tool:s,isStaging:i}=F(joe),{updateColorUnderCursor:u}=aI();return p.useCallback(()=>{if(!e.current)return;const d=Vy(e.current);if(d){if(r(Z7(d)),n.current=d,s==="colorPicker"){u();return}!o||s==="move"||i||(t.current=!0,r(V3([d.x,d.y])))}},[t,r,o,i,n,e,s,u])},Ioe=()=>{const e=ne();return p.useCallback(()=>{e(J7())},[e])},Ooe=Ce([Sr,en,or],(e,t,n)=>{const{tool:r,isDrawing:o}=t;return{tool:r,isDrawing:o,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:Wt}}),Roe=(e,t)=>{const n=ne(),{tool:r,isDrawing:o,isStaging:s}=F(Ooe);return p.useCallback(()=>{if(r==="move"||s){n(Kf(!1));return}if(!t.current&&o&&e.current){const i=Vy(e.current);if(!i)return;n(V3([i.x,i.y]))}else t.current=!1;n(W3(!1))},[t,n,o,s,e,r])},Toe=Ce([en],e=>{const{isMoveStageKeyHeld:t,stageScale:n}=e;return{isMoveStageKeyHeld:t,stageScale:n}},{memoizeOptions:{resultEqualityCheck:Wt}}),Moe=e=>{const t=ne(),{isMoveStageKeyHeld:n,stageScale:r}=F(Toe);return p.useCallback(o=>{if(!e.current||n)return;o.evt.preventDefault();const s=e.current.getPointerPosition();if(!s)return;const i={x:(s.x-e.current.x())/r,y:(s.y-e.current.y())/r};let u=o.evt.deltaY;o.evt.ctrlKey&&(u=-u);const d=Ys(r*nR**u,tR,eR),f={x:s.x-i.x*d,y:s.y-i.y*d};t(rR(d)),t(B3(f))},[e,n,r,t])},Doe=Ce(en,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageDimensions:r,stageScale:o,shouldDarkenOutsideBoundingBox:s,stageCoordinates:i}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,shouldDarkenOutsideBoundingBox:s,stageCoordinates:i,stageDimensions:r,stageScale:o}},{memoizeOptions:{resultEqualityCheck:Wt}}),Aoe=()=>{const{boundingBoxCoordinates:e,boundingBoxDimensions:t,shouldDarkenOutsideBoundingBox:n,stageCoordinates:r,stageDimensions:o,stageScale:s}=F(Doe);return a.jsxs(ja,{children:[a.jsx(Zs,{offsetX:r.x/s,offsetY:r.y/s,height:o.height/s,width:o.width/s,fill:"rgba(0,0,0,0.4)",listening:!1,visible:n}),a.jsx(Zs,{x:e.x,y:e.y,width:t.width,height:t.height,fill:"rgb(255,255,255)",listening:!1,visible:n,globalCompositeOperation:"destination-out"})]})},Noe=Ce([en],e=>{const{stageScale:t,stageCoordinates:n,stageDimensions:r}=e;return{stageScale:t,stageCoordinates:n,stageDimensions:r}},{memoizeOptions:{resultEqualityCheck:Wt}}),zoe=()=>{const{stageScale:e,stageCoordinates:t,stageDimensions:n}=F(Noe),{colorMode:r}=So(),[o,s]=p.useState([]),[i,u]=tl("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},w={x1:-S.x,y1:-S.y,x2:d(f)-S.x+64,y2:d(h)-S.y+64},k={x1:Math.min(y.x1,w.x1),y1:Math.min(y.y1,w.y1),x2:Math.max(y.x2,w.x2),y2:Math.max(y.y2,w.y2)},P=k.x2-k.x1,j=k.y2-k.y1,E=Math.round(P/64)+1,O=Math.round(j/64)+1,I=p2(0,E).map(T=>a.jsx(sh,{x:k.x1+T*64,y:k.y1,points:[0,0,0,j],stroke:r==="dark"?i:u,strokeWidth:1},`x_${T}`)),R=p2(0,O).map(T=>a.jsx(sh,{x:k.x1,y:k.y1+T*64,points:[0,0,P,0],stroke:r==="dark"?i:u,strokeWidth:1},`y_${T}`));s(I.concat(R))},[e,t,n,d,r,i,u]),a.jsx(ja,{children:o})},$oe=Ce([xo,en],(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:Wt}}),Loe=e=>{const{...t}=e,{progressImage:n,boundingBox:r}=F($oe),[o,s]=p.useState(null);return p.useEffect(()=>{if(!n)return;const i=new Image;i.onload=()=>{s(i)},i.src=n.dataURL},[n]),n&&r&&o?a.jsx(sI,{x:r.x,y:r.y,width:r.width,height:r.height,image:o,listening:!1,...t}):null},Wi=e=>{const{r:t,g:n,b:r,a:o}=e;return`rgba(${t}, ${n}, ${r}, ${o})`},Foe=Ce(en,e=>{const{maskColor:t,stageCoordinates:n,stageDimensions:r,stageScale:o}=e;return{stageCoordinates:n,stageDimensions:r,stageScale:o,maskColorString:Wi(t)}}),K4=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),Boe=e=>{const{...t}=e,{maskColorString:n,stageCoordinates:r,stageDimensions:o,stageScale:s}=F(Foe),[i,u]=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(i)return;const v=new Image;v.onload=()=>{u(v)},v.src=K4(n)},[i,n]),p.useEffect(()=>{i&&(i.src=K4(n))},[i,n]),p.useEffect(()=>{const v=setInterval(()=>f(y=>(y+1)%5),50);return()=>clearInterval(v)},[]),!i||!bl(r.x)||!bl(r.y)||!bl(s)||!bl(o.width)||!bl(o.height)?null:a.jsx(Zs,{ref:h,offsetX:r.x/s,offsetY:r.y/s,height:o.height/s,width:o.width/s,fillPatternImage:i,fillPatternOffsetY:bl(d)?d:0,fillPatternRepeat:"repeat",fillPatternScale:{x:1/s,y:1/s},listening:!0,globalCompositeOperation:"source-in",...t})},Hoe=Ce([en],e=>({objects:e.layerState.objects}),{memoizeOptions:{resultEqualityCheck:Wt}}),Woe=e=>{const{...t}=e,{objects:n}=F(Hoe);return a.jsx(ja,{listening:!1,...t,children:n.filter(oR).map((r,o)=>a.jsx(sh,{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 _i=p,Voe=function(t,n,r){const o=_i.useRef("loading"),s=_i.useRef(),[i,u]=_i.useState(0),d=_i.useRef(),f=_i.useRef(),h=_i.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),_i.useLayoutEffect(function(){if(!t)return;var m=document.createElement("img");function v(){o.current="loaded",s.current=m,u(Math.random())}function y(){o.current="failed",s.current=void 0,u(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 Uoe=fc(Voe),iI=e=>{const{width:t,height:n,x:r,y:o,imageName:s}=e.canvasImage,{currentData:i,isError:u}=Ks(s??Do.skipToken),[d]=Uoe((i==null?void 0:i.image_url)??"",sR.get()?"use-credentials":"anonymous");return u?a.jsx(Zs,{x:r,y:o,width:t,height:n,fill:"red"}):a.jsx(sI,{x:r,y:o,image:d,listening:!1})},Goe=Ce([en],e=>{const{layerState:{objects:t}}=e;return{objects:t}},{memoizeOptions:{resultEqualityCheck:Wt}}),qoe=()=>{const{objects:e}=F(Goe);return e?a.jsx(ja,{name:"outpainting-objects",listening:!1,children:e.map((t,n)=>{if(aR(t))return a.jsx(iI,{canvasImage:t},n);if(iR(t)){const r=a.jsx(sh,{points:t.points,stroke:t.color?Wi(t.color):"rgb(0,0,0)",strokeWidth:t.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:t.tool==="brush"?"source-over":"destination-out"},n);return t.clip?a.jsx(ja,{clipX:t.clip.x,clipY:t.clip.y,clipWidth:t.clip.width,clipHeight:t.clip.height,children:r},n):r}else{if(lR(t))return a.jsx(Zs,{x:t.x,y:t.y,width:t.width,height:t.height,fill:Wi(t.color)},n);if(cR(t))return a.jsx(Zs,{x:t.x,y:t.y,width:t.width,height:t.height,fill:"rgb(255, 255, 255)",globalCompositeOperation:"destination-out"},n)}})}):null},Koe=Ce([en],e=>{const{layerState:t,shouldShowStagingImage:n,shouldShowStagingOutline:r,boundingBoxCoordinates:{x:o,y:s},boundingBoxDimensions:{width:i,height:u}}=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:i,height:u}},{memoizeOptions:{resultEqualityCheck:Wt}}),Yoe=e=>{const{...t}=e,{currentStagingAreaImage:n,shouldShowStagingImage:r,shouldShowStagingOutline:o,x:s,y:i,width:u,height:d}=F(Koe);return a.jsxs(ja,{...t,children:[r&&n&&a.jsx(iI,{canvasImage:n}),o&&a.jsxs(ja,{children:[a.jsx(Zs,{x:s,y:i,width:u,height:d,strokeWidth:1,stroke:"white",strokeScaleEnabled:!1}),a.jsx(Zs,{x:s,y:i,width:u,height:d,dash:[4,4],strokeWidth:1,stroke:"black",strokeScaleEnabled:!1})]})]})},Xoe=Ce([en],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:Wt}}),Qoe=()=>{const e=ne(),{isOnFirstImage:t,isOnLastImage:n,currentStagingAreaImage:r,shouldShowStagingImage:o,sessionId:s}=F(Xoe),{t:i}=pe(),u=p.useCallback(()=>{e(r2(!0))},[e]),d=p.useCallback(()=>{e(r2(!1))},[e]);Ke(["left"],()=>{f()},{enabled:()=>!0,preventDefault:!0}),Ke(["right"],()=>{h()},{enabled:()=>!0,preventDefault:!0}),Ke(["enter"],()=>{m()},{enabled:()=>!0,preventDefault:!0});const f=p.useCallback(()=>e(uR()),[e]),h=p.useCallback(()=>e(dR()),[e]),m=p.useCallback(()=>e(fR(s)),[e,s]);return r?a.jsx(H,{pos:"absolute",bottom:4,w:"100%",align:"center",justify:"center",filter:"drop-shadow(0 0.5rem 1rem rgba(0,0,0))",onMouseOver:u,onMouseOut:d,children:a.jsxs(gr,{isAttached:!0,children:[a.jsx(je,{tooltip:`${i("unifiedCanvas.previous")} (Left)`,"aria-label":`${i("unifiedCanvas.previous")} (Left)`,icon:a.jsx(Mz,{}),onClick:f,colorScheme:"accent",isDisabled:t}),a.jsx(je,{tooltip:`${i("unifiedCanvas.next")} (Right)`,"aria-label":`${i("unifiedCanvas.next")} (Right)`,icon:a.jsx(Dz,{}),onClick:h,colorScheme:"accent",isDisabled:n}),a.jsx(je,{tooltip:`${i("unifiedCanvas.accept")} (Enter)`,"aria-label":`${i("unifiedCanvas.accept")} (Enter)`,icon:a.jsx(zz,{}),onClick:m,colorScheme:"accent"}),a.jsx(je,{tooltip:i("unifiedCanvas.showHide"),"aria-label":i("unifiedCanvas.showHide"),"data-alert":!o,icon:o?a.jsx(Wz,{}):a.jsx(Hz,{}),onClick:()=>e(pR(!o)),colorScheme:"accent"}),a.jsx(je,{tooltip:i("unifiedCanvas.saveToGallery"),"aria-label":i("unifiedCanvas.saveToGallery"),icon:a.jsx(Dh,{}),onClick:()=>e(hR({imageName:r.imageName})),colorScheme:"accent"}),a.jsx(je,{tooltip:i("unifiedCanvas.discardAll"),"aria-label":i("unifiedCanvas.discardAll"),icon:a.jsx(Mh,{style:{transform:"rotate(45deg)"}}),onClick:()=>e(mR()),colorScheme:"error",fontSize:20})]})}):null},Nl=e=>Math.round(e*100)/100,Zoe=Ce([en],e=>{const{cursorPosition:t}=e,{cursorX:n,cursorY:r}=t?{cursorX:t.x,cursorY:t.y}:{cursorX:-1,cursorY:-1};return{cursorCoordinatesString:`(${Nl(n)}, ${Nl(r)})`}},{memoizeOptions:{resultEqualityCheck:Wt}});function Joe(){const{cursorCoordinatesString:e}=F(Zoe),{t}=pe();return a.jsx(Ge,{children:`${t("unifiedCanvas.cursorPosition")}: ${e}`})}const $0="var(--invokeai-colors-warning-500)",ese=Ce([en],e=>{const{stageDimensions:{width:t,height:n},stageCoordinates:{x:r,y:o},boundingBoxDimensions:{width:s,height:i},scaledBoundingBoxDimensions:{width:u,height:d},boundingBoxCoordinates:{x:f,y:h},stageScale:m,shouldShowCanvasDebugInfo:v,layer:y,boundingBoxScaleMethod:S,shouldPreserveMaskedArea:w}=e;let C="inherit";return(S==="none"&&(s<512||i<512)||S==="manual"&&u*d<512*512)&&(C=$0),{activeLayerColor:y==="mask"?$0:"inherit",activeLayerString:y.charAt(0).toUpperCase()+y.slice(1),boundingBoxColor:C,boundingBoxCoordinatesString:`(${Nl(f)}, ${Nl(h)})`,boundingBoxDimensionsString:`${s}×${i}`,scaledBoundingBoxDimensionsString:`${u}×${d}`,canvasCoordinatesString:`${Nl(r)}×${Nl(o)}`,canvasDimensionsString:`${t}×${n}`,canvasScaleString:Math.round(m*100),shouldShowCanvasDebugInfo:v,shouldShowBoundingBox:S!=="auto",shouldShowScaledBoundingBox:S!=="none",shouldPreserveMaskedArea:w}},{memoizeOptions:{resultEqualityCheck:Wt}}),tse=()=>{const{activeLayerColor:e,activeLayerString:t,boundingBoxColor:n,boundingBoxCoordinatesString:r,boundingBoxDimensionsString:o,scaledBoundingBoxDimensionsString:s,shouldShowScaledBoundingBox:i,canvasCoordinatesString:u,canvasDimensionsString:d,canvasScaleString:f,shouldShowCanvasDebugInfo:h,shouldShowBoundingBox:m,shouldPreserveMaskedArea:v}=F(ese),{t:y}=pe();return a.jsxs(H,{sx:{flexDirection:"column",position:"absolute",top:0,insetInlineStart:0,opacity:.65,display:"flex",fontSize:"sm",padding:1,px:2,minWidth:48,margin:1,borderRadius:"base",pointerEvents:"none",bg:"base.200",_dark:{bg:"base.800"}},children:[a.jsx(Ge,{style:{color:e},children:`${y("unifiedCanvas.activeLayer")}: ${t}`}),a.jsx(Ge,{children:`${y("unifiedCanvas.canvasScale")}: ${f}%`}),v&&a.jsx(Ge,{style:{color:$0},children:"Preserve Masked Area: On"}),m&&a.jsx(Ge,{style:{color:n},children:`${y("unifiedCanvas.boundingBox")}: ${o}`}),i&&a.jsx(Ge,{style:{color:n},children:`${y("unifiedCanvas.scaledBoundingBox")}: ${s}`}),h&&a.jsxs(a.Fragment,{children:[a.jsx(Ge,{children:`${y("unifiedCanvas.boundingBoxPosition")}: ${r}`}),a.jsx(Ge,{children:`${y("unifiedCanvas.canvasDimensions")}: ${d}`}),a.jsx(Ge,{children:`${y("unifiedCanvas.canvasPosition")}: ${u}`}),a.jsx(Joe,{})]})]})},nse=Ce([en,Hr],(e,t)=>{const{boundingBoxCoordinates:n,boundingBoxDimensions:r,stageScale:o,isDrawing:s,isTransformingBoundingBox:i,isMovingBoundingBox:u,tool:d,shouldSnapToGrid:f}=e,{aspectRatio:h}=t;return{boundingBoxCoordinates:n,boundingBoxDimensions:r,isDrawing:s,isMovingBoundingBox:u,isTransformingBoundingBox:i,stageScale:o,shouldSnapToGrid:f,tool:d,hitStrokeWidth:20/o,aspectRatio:h}},{memoizeOptions:{resultEqualityCheck:Wt}}),rse=e=>{const{...t}=e,n=ne(),{boundingBoxCoordinates:r,boundingBoxDimensions:o,isDrawing:s,isMovingBoundingBox:i,isTransformingBoundingBox:u,stageScale:d,shouldSnapToGrid:f,tool:h,hitStrokeWidth:m,aspectRatio:v}=F(nse),y=p.useRef(null),S=p.useRef(null),[w,C]=p.useState(!1);p.useEffect(()=>{var z;!y.current||!S.current||(y.current.nodes([S.current]),(z=y.current.getLayer())==null||z.batchDraw())},[]);const k=64*d,P=p.useCallback(z=>{if(!f){n(gg({x:Math.floor(z.target.x()),y:Math.floor(z.target.y())}));return}const B=z.target.x(),G=z.target.y(),K=ys(B,64),N=ys(G,64);z.target.x(K),z.target.y(N),n(gg({x:K,y:N}))},[n,f]),j=p.useCallback(()=>{if(!S.current)return;const z=S.current,B=z.scaleX(),G=z.scaleY(),K=Math.round(z.width()*B),N=Math.round(z.height()*G),V=Math.round(z.x()),W=Math.round(z.y());if(v){const U=ys(K/v,64);n(Gs({width:K,height:U}))}else n(Gs({width:K,height:N}));n(gg({x:f?Bd(V,64):V,y:f?Bd(W,64):W})),z.scaleX(1),z.scaleY(1)},[n,f,v]),E=p.useCallback((z,B,G)=>{const K=z.x%k,N=z.y%k;return{x:Bd(B.x,k)+K,y:Bd(B.y,k)+N}},[k]),O=()=>{n(vg(!0))},I=()=>{n(vg(!1)),n(yg(!1)),n(Hd(!1)),C(!1)},R=()=>{n(yg(!0))},T=()=>{n(vg(!1)),n(yg(!1)),n(Hd(!1)),C(!1)},D=()=>{C(!0)},$=()=>{!u&&!i&&C(!1)},A=()=>{n(Hd(!0))},J=()=>{n(Hd(!1))};return a.jsxs(ja,{...t,children:[a.jsx(Zs,{height:o.height,width:o.width,x:r.x,y:r.y,onMouseEnter:A,onMouseOver:A,onMouseLeave:J,onMouseOut:J}),a.jsx(Zs,{draggable:!0,fillEnabled:!1,height:o.height,hitStrokeWidth:m,listening:!s&&h==="move",onDragStart:R,onDragEnd:T,onDragMove:P,onMouseDown:R,onMouseOut:$,onMouseOver:D,onMouseEnter:D,onMouseUp:T,onTransform:j,onTransformEnd:I,ref:S,stroke:w?"rgba(255,255,255,0.7)":"white",strokeWidth:(w?8:1)/d,width:o.width,x:r.x,y:r.y}),a.jsx(boe,{anchorCornerRadius:3,anchorDragBoundFunc:E,anchorFill:"rgba(212,216,234,1)",anchorSize:15,anchorStroke:"rgb(42,42,42)",borderDash:[4,4],borderEnabled:!0,borderStroke:"black",draggable:!1,enabledAnchors:h==="move"?void 0:[],flipEnabled:!1,ignoreStroke:!0,keepRatio:!1,listening:!s&&h==="move",onDragStart:R,onDragEnd:T,onMouseDown:O,onMouseUp:I,onTransformEnd:I,ref:y,rotateEnabled:!1})]})},ose=Ce(en,e=>{const{cursorPosition:t,brushSize:n,colorPickerColor:r,maskColor:o,brushColor:s,tool:i,layer:u,shouldShowBrush:d,isMovingBoundingBox:f,isTransformingBoundingBox:h,stageScale:m,stageDimensions:v,boundingBoxCoordinates:y,boundingBoxDimensions:S,shouldRestrictStrokesToBox:w}=e,C=w?{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:o2/m,colorPickerInnerRadius:(o2-Ev+1)/m,maskColorString:Wi({...o,a:.5}),brushColorString:Wi(s),colorPickerColorString:Wi(r),tool:i,layer:u,shouldShowBrush:d,shouldDrawBrushPreview:!(f||h||!t)&&d,strokeWidth:1.5/m,dotRadius:1.5/m,clip:C}},{memoizeOptions:{resultEqualityCheck:Wt}}),sse=e=>{const{...t}=e,{brushX:n,brushY:r,radius:o,maskColorString:s,tool:i,layer:u,shouldDrawBrushPreview:d,dotRadius:f,strokeWidth:h,brushColorString:m,colorPickerColorString:v,colorPickerInnerRadius:y,colorPickerOuterRadius:S,clip:w}=F(ose);return d?a.jsxs(ja,{listening:!1,...w,...t,children:[i==="colorPicker"?a.jsxs(a.Fragment,{children:[a.jsx(Pi,{x:n,y:r,radius:S,stroke:m,strokeWidth:Ev,strokeScaleEnabled:!1}),a.jsx(Pi,{x:n,y:r,radius:y,stroke:v,strokeWidth:Ev,strokeScaleEnabled:!1})]}):a.jsxs(a.Fragment,{children:[a.jsx(Pi,{x:n,y:r,radius:o,fill:u==="mask"?s:m,globalCompositeOperation:i==="eraser"?"destination-out":"source-out"}),a.jsx(Pi,{x:n,y:r,radius:o,stroke:"rgba(255,255,255,0.4)",strokeWidth:h*2,strokeEnabled:!0,listening:!1}),a.jsx(Pi,{x:n,y:r,radius:o,stroke:"rgba(0,0,0,1)",strokeWidth:h,strokeEnabled:!0,listening:!1})]}),a.jsx(Pi,{x:n,y:r,radius:f*2,fill:"rgba(255,255,255,0.4)",listening:!1}),a.jsx(Pi,{x:n,y:r,radius:f,fill:"rgba(0,0,0,1)",listening:!1})]}):null},ase=Ce([en,or],(e,t)=>{const{isMaskEnabled:n,stageScale:r,shouldShowBoundingBox:o,isTransformingBoundingBox:s,isMouseOverBoundingBox:i,isMovingBoundingBox:u,stageDimensions:d,stageCoordinates:f,tool:h,isMovingStage:m,shouldShowIntermediates:v,shouldShowGrid:y,shouldRestrictStrokesToBox:S,shouldAntialias:w}=e;let C="none";return h==="move"||t?m?C="grabbing":C="grab":s?C=void 0:S&&!i&&(C="default"),{isMaskEnabled:n,isModifyingBoundingBox:s||u,shouldShowBoundingBox:o,shouldShowGrid:y,stageCoordinates:f,stageCursor:C,stageDimensions:d,stageScale:r,tool:h,isStaging:t,shouldShowIntermediates:v,shouldAntialias:w}},Ct),ise=Ve(xoe,{shouldForwardProp:e=>!["sx"].includes(e)}),Y4=()=>{const{isMaskEnabled:e,isModifyingBoundingBox:t,shouldShowBoundingBox:n,shouldShowGrid:r,stageCoordinates:o,stageCursor:s,stageDimensions:i,stageScale:u,tool:d,isStaging:f,shouldShowIntermediates:h,shouldAntialias:m}=F(ase);koe();const v=p.useRef(null),y=p.useRef(null),S=p.useCallback($=>{vR($),v.current=$},[]),w=p.useCallback($=>{gR($),y.current=$},[]),C=p.useRef({x:0,y:0}),k=p.useRef(!1),P=Moe(v),j=_oe(v),E=Roe(v,k),O=Eoe(v,k,C),I=Ioe(),{handleDragStart:R,handleDragMove:T,handleDragEnd:D}=woe();return a.jsx(H,{sx:{position:"relative",height:"100%",width:"100%",borderRadius:"base"},children:a.jsxs(Ge,{sx:{position:"relative"},children:[a.jsxs(ise,{tabIndex:-1,ref:S,sx:{outline:"none",overflow:"hidden",cursor:s||void 0,canvas:{outline:"none"}},x:o.x,y:o.y,width:i.width,height:i.height,scale:{x:u,y:u},onTouchStart:j,onTouchMove:O,onTouchEnd:E,onMouseDown:j,onMouseLeave:I,onMouseMove:O,onMouseUp:E,onDragStart:R,onDragMove:T,onDragEnd:D,onContextMenu:$=>$.evt.preventDefault(),onWheel:P,draggable:(d==="move"||f)&&!t,children:[a.jsx(Xc,{id:"grid",visible:r,children:a.jsx(zoe,{})}),a.jsx(Xc,{id:"base",ref:w,listening:!1,imageSmoothingEnabled:m,children:a.jsx(qoe,{})}),a.jsxs(Xc,{id:"mask",visible:e,listening:!1,children:[a.jsx(Woe,{visible:!0,listening:!1}),a.jsx(Boe,{listening:!1})]}),a.jsx(Xc,{children:a.jsx(Aoe,{})}),a.jsxs(Xc,{id:"preview",imageSmoothingEnabled:m,children:[!f&&a.jsx(sse,{visible:d!=="move",listening:!1}),a.jsx(Yoe,{visible:f}),h&&a.jsx(Loe,{}),a.jsx(rse,{visible:n&&!f})]})]}),a.jsx(tse,{}),a.jsx(Qoe,{})]})})},lse=Ce(en,yR,Sr,(e,t,n)=>{const{doesCanvasNeedScaling:r,isCanvasInitialized:o}=e;return{doesCanvasNeedScaling:r,activeTabName:n,initialCanvasImage:t,isCanvasInitialized:o}}),X4=()=>{const e=ne(),{doesCanvasNeedScaling:t,activeTabName:n,initialCanvasImage:r,isCanvasInitialized:o}=F(lse),s=p.useRef(null);return p.useLayoutEffect(()=>{window.setTimeout(()=>{if(!s.current)return;const{clientWidth:i,clientHeight:u}=s.current;e(bR({width:i,height:u})),e(o?xR():ph()),e(d3(!1))},0)},[e,r,t,n,o]),a.jsx(H,{ref:s,sx:{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:4,width:"100%",height:"100%"},children:a.jsx(ui,{thickness:"2px",size:"xl"})})};function lI(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 cse=Ve(qE,{baseStyle:{paddingInline:4},shouldForwardProp:e=>!["pickerColor"].includes(e)}),vv={width:6,height:6,borderColor:"base.100"},use=e=>{const{styleClass:t="",...n}=e;return a.jsx(cse,{sx:{".react-colorful__hue-pointer":vv,".react-colorful__saturation-pointer":vv,".react-colorful__alpha-pointer":vv},className:t,...n})},ah=p.memo(use),dse=Ce([en,or],(e,t)=>{const{maskColor:n,layer:r,isMaskEnabled:o,shouldPreserveMaskedArea:s}=e;return{layer:r,maskColor:n,maskColorString:Wi(n),isMaskEnabled:o,shouldPreserveMaskedArea:s,isStaging:t}},{memoizeOptions:{resultEqualityCheck:Wt}}),fse=()=>{const e=ne(),{t}=pe(),{layer:n,maskColor:r,isMaskEnabled:o,shouldPreserveMaskedArea:s,isStaging:i}=F(dse);Ke(["q"],()=>{u()},{enabled:()=>!i,preventDefault:!0},[n]),Ke(["shift+c"],()=>{d()},{enabled:()=>!i,preventDefault:!0},[]),Ke(["h"],()=>{f()},{enabled:()=>!i,preventDefault:!0},[o]);const u=()=>{e(Xf(n==="mask"?"base":"mask"))},d=()=>e(Z0()),f=()=>e($u(!o));return a.jsx(fa,{triggerComponent:a.jsx(gr,{children:a.jsx(je,{"aria-label":t("unifiedCanvas.maskingOptions"),tooltip:t("unifiedCanvas.maskingOptions"),icon:a.jsx(Qz,{}),isChecked:n==="mask",isDisabled:i})}),children:a.jsxs(H,{direction:"column",gap:2,children:[a.jsx(In,{label:`${t("unifiedCanvas.enableMask")} (H)`,isChecked:o,onChange:f}),a.jsx(In,{label:t("unifiedCanvas.preserveMaskedArea"),isChecked:s,onChange:h=>e(U3(h.target.checked))}),a.jsx(ah,{sx:{paddingTop:2,paddingBottom:2},pickerColor:r,onChange:h=>e(G3(h))}),a.jsxs(Yt,{size:"sm",leftIcon:a.jsx(io,{}),onClick:d,children:[t("unifiedCanvas.clearMask")," (Shift+C)"]})]})})},pse=Ce([en,Sr,xo],(e,t,n)=>{const{futureLayerStates:r}=e;return{canRedo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:Wt}});function cI(){const e=ne(),{canRedo:t,activeTabName:n}=F(pse),{t:r}=pe(),o=()=>{e(SR())};return Ke(["meta+shift+z","ctrl+shift+z","control+y","meta+y"],()=>{o()},{enabled:()=>t,preventDefault:!0},[n,t]),a.jsx(je,{"aria-label":`${r("unifiedCanvas.redo")} (Ctrl+Shift+Z)`,tooltip:`${r("unifiedCanvas.redo")} (Ctrl+Shift+Z)`,icon:a.jsx(n$,{}),onClick:o,isDisabled:!t})}const uI=()=>{const e=F(or),t=ne(),{t:n}=pe();return a.jsxs(Ly,{title:n("unifiedCanvas.clearCanvasHistory"),acceptCallback:()=>t(wR()),acceptButtonText:n("unifiedCanvas.clearHistory"),triggerComponent:a.jsx(Yt,{size:"sm",leftIcon:a.jsx(io,{}),isDisabled:e,children:n("unifiedCanvas.clearCanvasHistory")}),children:[a.jsx("p",{children:n("unifiedCanvas.clearCanvasHistoryMessage")}),a.jsx("br",{}),a.jsx("p",{children:n("unifiedCanvas.clearCanvasHistoryConfirm")})]})},hse=Ce([en],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:o,shouldShowGrid:s,shouldShowIntermediates:i,shouldSnapToGrid:u,shouldRestrictStrokesToBox:d,shouldAntialias:f}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:o,shouldShowGrid:s,shouldShowIntermediates:i,shouldSnapToGrid:u,shouldRestrictStrokesToBox:d,shouldAntialias:f}},{memoizeOptions:{resultEqualityCheck:Wt}}),mse=()=>{const e=ne(),{t}=pe(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldDarkenOutsideBoundingBox:o,shouldShowCanvasDebugInfo:s,shouldShowGrid:i,shouldShowIntermediates:u,shouldSnapToGrid:d,shouldRestrictStrokesToBox:f,shouldAntialias:h}=F(hse);Ke(["n"],()=>{e(Yf(!d))},{enabled:!0,preventDefault:!0},[d]);const m=v=>e(Yf(v.target.checked));return a.jsx(fa,{isLazy:!1,triggerComponent:a.jsx(je,{tooltip:t("unifiedCanvas.canvasSettings"),"aria-label":t("unifiedCanvas.canvasSettings"),icon:a.jsx(D1,{})}),children:a.jsxs(H,{direction:"column",gap:2,children:[a.jsx(In,{label:t("unifiedCanvas.showIntermediates"),isChecked:u,onChange:v=>e(q3(v.target.checked))}),a.jsx(In,{label:t("unifiedCanvas.showGrid"),isChecked:i,onChange:v=>e(K3(v.target.checked))}),a.jsx(In,{label:t("unifiedCanvas.snapToGrid"),isChecked:d,onChange:m}),a.jsx(In,{label:t("unifiedCanvas.darkenOutsideSelection"),isChecked:o,onChange:v=>e(Y3(v.target.checked))}),a.jsx(In,{label:t("unifiedCanvas.autoSaveToGallery"),isChecked:n,onChange:v=>e(X3(v.target.checked))}),a.jsx(In,{label:t("unifiedCanvas.saveBoxRegionOnly"),isChecked:r,onChange:v=>e(Q3(v.target.checked))}),a.jsx(In,{label:t("unifiedCanvas.limitStrokesToBox"),isChecked:f,onChange:v=>e(Z3(v.target.checked))}),a.jsx(In,{label:t("unifiedCanvas.showCanvasDebugInfo"),isChecked:s,onChange:v=>e(J3(v.target.checked))}),a.jsx(In,{label:t("unifiedCanvas.antialiasing"),isChecked:h,onChange:v=>e(e5(v.target.checked))}),a.jsx(uI,{})]})})},gse=Ce([en,or,xo],(e,t,n)=>{const{isProcessing:r}=n,{tool:o,brushColor:s,brushSize:i}=e;return{tool:o,isStaging:t,isProcessing:r,brushColor:s,brushSize:i}},{memoizeOptions:{resultEqualityCheck:Wt}}),vse=()=>{const e=ne(),{tool:t,brushColor:n,brushSize:r,isStaging:o}=F(gse),{t:s}=pe();Ke(["b"],()=>{i()},{enabled:()=>!o,preventDefault:!0},[]),Ke(["e"],()=>{u()},{enabled:()=>!o,preventDefault:!0},[t]),Ke(["c"],()=>{d()},{enabled:()=>!o,preventDefault:!0},[t]),Ke(["shift+f"],()=>{f()},{enabled:()=>!o,preventDefault:!0}),Ke(["delete","backspace"],()=>{h()},{enabled:()=>!o,preventDefault:!0}),Ke(["BracketLeft"],()=>{e($l(Math.max(r-5,5)))},{enabled:()=>!o,preventDefault:!0},[r]),Ke(["BracketRight"],()=>{e($l(Math.min(r+5,500)))},{enabled:()=>!o,preventDefault:!0},[r]),Ke(["shift+BracketLeft"],()=>{e(Ll({...n,a:Ys(n.a-.05,.05,1)}))},{enabled:()=>!o,preventDefault:!0},[n]),Ke(["shift+BracketRight"],()=>{e(Ll({...n,a:Ys(n.a+.05,.05,1)}))},{enabled:()=>!o,preventDefault:!0},[n]);const i=()=>e(qs("brush")),u=()=>e(qs("eraser")),d=()=>e(qs("colorPicker")),f=()=>e(t5()),h=()=>e(n5());return a.jsxs(gr,{isAttached:!0,children:[a.jsx(je,{"aria-label":`${s("unifiedCanvas.brush")} (B)`,tooltip:`${s("unifiedCanvas.brush")} (B)`,icon:a.jsx(wk,{}),isChecked:t==="brush"&&!o,onClick:i,isDisabled:o}),a.jsx(je,{"aria-label":`${s("unifiedCanvas.eraser")} (E)`,tooltip:`${s("unifiedCanvas.eraser")} (E)`,icon:a.jsx(yk,{}),isChecked:t==="eraser"&&!o,isDisabled:o,onClick:u}),a.jsx(je,{"aria-label":`${s("unifiedCanvas.fillBoundingBox")} (Shift+F)`,tooltip:`${s("unifiedCanvas.fillBoundingBox")} (Shift+F)`,icon:a.jsx(xk,{}),isDisabled:o,onClick:f}),a.jsx(je,{"aria-label":`${s("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,tooltip:`${s("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,icon:a.jsx(Mh,{style:{transform:"rotate(45deg)"}}),isDisabled:o,onClick:h}),a.jsx(je,{"aria-label":`${s("unifiedCanvas.colorPicker")} (C)`,tooltip:`${s("unifiedCanvas.colorPicker")} (C)`,icon:a.jsx(bk,{}),isChecked:t==="colorPicker"&&!o,isDisabled:o,onClick:d}),a.jsx(fa,{triggerComponent:a.jsx(je,{"aria-label":s("unifiedCanvas.brushOptions"),tooltip:s("unifiedCanvas.brushOptions"),icon:a.jsx(T1,{})}),children:a.jsxs(H,{minWidth:60,direction:"column",gap:4,width:"100%",children:[a.jsx(H,{gap:4,justifyContent:"space-between",children:a.jsx(vt,{label:s("unifiedCanvas.brushSize"),value:r,withInput:!0,onChange:m=>e($l(m)),sliderNumberInputProps:{max:500}})}),a.jsx(ah,{sx:{width:"100%",paddingTop:2,paddingBottom:2},pickerColor:n,onChange:m=>e(Ll(m))})]})})]})},yse=Ce([en,Sr,xo],(e,t,n)=>{const{pastLayerStates:r}=e;return{canUndo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:Wt}});function dI(){const e=ne(),{t}=pe(),{canUndo:n,activeTabName:r}=F(yse),o=()=>{e(CR())};return Ke(["meta+z","ctrl+z"],()=>{o()},{enabled:()=>n,preventDefault:!0},[r,n]),a.jsx(je,{"aria-label":`${t("unifiedCanvas.undo")} (Ctrl+Z)`,tooltip:`${t("unifiedCanvas.undo")} (Ctrl+Z)`,icon:a.jsx(M1,{}),onClick:o,isDisabled:!n})}const bse=Ce([xo,en,or],(e,t,n)=>{const{isProcessing:r}=e,{tool:o,shouldCropToBoundingBoxOnSave:s,layer:i,isMaskEnabled:u}=t;return{isProcessing:r,isStaging:n,isMaskEnabled:u,tool:o,layer:i,shouldCropToBoundingBoxOnSave:s}},{memoizeOptions:{resultEqualityCheck:Wt}}),xse=()=>{const e=ne(),{isProcessing:t,isStaging:n,isMaskEnabled:r,layer:o,tool:s}=F(bse),i=ba(),{t:u}=pe(),{openUploader:d}=Th();Ke(["v"],()=>{f()},{enabled:()=>!n,preventDefault:!0},[]),Ke(["r"],()=>{m()},{enabled:()=>!0,preventDefault:!0},[i]),Ke(["shift+m"],()=>{y()},{enabled:()=>!n,preventDefault:!0},[i,t]),Ke(["shift+s"],()=>{S()},{enabled:()=>!n,preventDefault:!0},[i,t]),Ke(["meta+c","ctrl+c"],()=>{w()},{enabled:()=>!n,preventDefault:!0},[i,t]),Ke(["shift+d"],()=>{C()},{enabled:()=>!n,preventDefault:!0},[i,t]);const f=()=>e(qs("move")),h=lI(()=>m(!1),()=>m(!0)),m=(P=!1)=>{const j=ba();if(!j)return;const E=j.getClientRect({skipTransform:!0});e(r5({contentRect:E,shouldScaleTo1:P}))},v=()=>{e(c5()),e(ph())},y=()=>{e(o5())},S=()=>{e(s5())},w=()=>{e(a5())},C=()=>{e(i5())},k=P=>{const j=P;e(Xf(j)),j==="mask"&&!r&&e($u(!0))};return a.jsxs(H,{sx:{alignItems:"center",gap:2,flexWrap:"wrap"},children:[a.jsx(Ge,{w:24,children:a.jsx(Kn,{tooltip:`${u("unifiedCanvas.layer")} (Q)`,value:o,data:l5,onChange:k,disabled:n})}),a.jsx(fse,{}),a.jsx(vse,{}),a.jsxs(gr,{isAttached:!0,children:[a.jsx(je,{"aria-label":`${u("unifiedCanvas.move")} (V)`,tooltip:`${u("unifiedCanvas.move")} (V)`,icon:a.jsx(gk,{}),isChecked:s==="move"||n,onClick:f}),a.jsx(je,{"aria-label":`${u("unifiedCanvas.resetView")} (R)`,tooltip:`${u("unifiedCanvas.resetView")} (R)`,icon:a.jsx(vk,{}),onClick:h})]}),a.jsxs(gr,{isAttached:!0,children:[a.jsx(je,{"aria-label":`${u("unifiedCanvas.mergeVisible")} (Shift+M)`,tooltip:`${u("unifiedCanvas.mergeVisible")} (Shift+M)`,icon:a.jsx(Sk,{}),onClick:y,isDisabled:n}),a.jsx(je,{"aria-label":`${u("unifiedCanvas.saveToGallery")} (Shift+S)`,tooltip:`${u("unifiedCanvas.saveToGallery")} (Shift+S)`,icon:a.jsx(Dh,{}),onClick:S,isDisabled:n}),a.jsx(je,{"aria-label":`${u("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${u("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,icon:a.jsx(bc,{}),onClick:w,isDisabled:n}),a.jsx(je,{"aria-label":`${u("unifiedCanvas.downloadAsImage")} (Shift+D)`,tooltip:`${u("unifiedCanvas.downloadAsImage")} (Shift+D)`,icon:a.jsx(O1,{}),onClick:C,isDisabled:n})]}),a.jsxs(gr,{isAttached:!0,children:[a.jsx(dI,{}),a.jsx(cI,{})]}),a.jsxs(gr,{isAttached:!0,children:[a.jsx(je,{"aria-label":`${u("common.upload")}`,tooltip:`${u("common.upload")}`,icon:a.jsx(Yu,{}),onClick:d,isDisabled:n}),a.jsx(je,{"aria-label":`${u("unifiedCanvas.clearCanvas")}`,tooltip:`${u("unifiedCanvas.clearCanvas")}`,icon:a.jsx(io,{}),onClick:v,colorScheme:"error",isDisabled:n})]}),a.jsx(gr,{isAttached:!0,children:a.jsx(mse,{})})]})},Sse=Ce([en],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:Wt}}),wse=()=>{const e=ne(),{t}=pe(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldShowCanvasDebugInfo:o,shouldShowIntermediates:s,shouldAntialias:i}=F(Sse);return a.jsx(fa,{isLazy:!1,triggerComponent:a.jsx(je,{tooltip:t("unifiedCanvas.canvasSettings"),tooltipProps:{placement:"bottom"},"aria-label":t("unifiedCanvas.canvasSettings"),icon:a.jsx(D1,{})}),children:a.jsxs(H,{direction:"column",gap:2,children:[a.jsx(In,{label:t("unifiedCanvas.showIntermediates"),isChecked:s,onChange:u=>e(q3(u.target.checked))}),a.jsx(In,{label:t("unifiedCanvas.autoSaveToGallery"),isChecked:n,onChange:u=>e(X3(u.target.checked))}),a.jsx(In,{label:t("unifiedCanvas.saveBoxRegionOnly"),isChecked:r,onChange:u=>e(Q3(u.target.checked))}),a.jsx(In,{label:t("unifiedCanvas.showCanvasDebugInfo"),isChecked:o,onChange:u=>e(J3(u.target.checked))}),a.jsx(In,{label:t("unifiedCanvas.antialiasing"),isChecked:i,onChange:u=>e(e5(u.target.checked))}),a.jsx(uI,{})]})})};function Cse(){const e=F(or),t=ba(),n=F(i=>i.system.isProcessing),r=ne(),{t:o}=pe();Ke(["meta+c","ctrl+c"],()=>{s()},{enabled:()=>!e,preventDefault:!0},[t,n]);const s=()=>{r(a5())};return a.jsx(je,{"aria-label":`${o("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${o("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,icon:a.jsx(bc,{}),onClick:s,isDisabled:e})}function kse(){const e=ne(),{t}=pe(),n=ba(),r=F(or);Ke(["shift+d"],()=>{o()},{enabled:()=>!r,preventDefault:!0},[n]);const o=()=>{e(i5())};return a.jsx(je,{"aria-label":`${t("unifiedCanvas.downloadAsImage")} (Shift+D)`,tooltip:`${t("unifiedCanvas.downloadAsImage")} (Shift+D)`,icon:a.jsx(O1,{}),onClick:o,isDisabled:r})}function Pse(){const e=F(or),{openUploader:t}=Th(),{t:n}=pe();return a.jsx(je,{"aria-label":n("common.upload"),tooltip:n("common.upload"),icon:a.jsx(Yu,{}),onClick:t,isDisabled:e})}const _se=Ce([en,or],(e,t)=>{const{layer:n,isMaskEnabled:r}=e;return{layer:n,isMaskEnabled:r,isStaging:t}},{memoizeOptions:{resultEqualityCheck:Wt}});function jse(){const e=ne(),{t}=pe(),{layer:n,isMaskEnabled:r,isStaging:o}=F(_se),s=()=>{e(Xf(n==="mask"?"base":"mask"))};Ke(["q"],()=>{s()},{enabled:()=>!o,preventDefault:!0},[n]);const i=u=>{const d=u;e(Xf(d)),d==="mask"&&!r&&e($u(!0))};return a.jsx(Kn,{tooltip:`${t("unifiedCanvas.layer")} (Q)`,"aria-label":`${t("unifiedCanvas.layer")} (Q)`,value:n,data:l5,onChange:i,disabled:o,w:"full"})}function Ese(){const e=ne(),{t}=pe(),n=ba(),r=F(or),o=F(i=>i.system.isProcessing);Ke(["shift+m"],()=>{s()},{enabled:()=>!r,preventDefault:!0},[n,o]);const s=()=>{e(o5())};return a.jsx(je,{"aria-label":`${t("unifiedCanvas.mergeVisible")} (Shift+M)`,tooltip:`${t("unifiedCanvas.mergeVisible")} (Shift+M)`,icon:a.jsx(Sk,{}),onClick:s,isDisabled:r})}function Ise(){const e=F(s=>s.canvas.tool),t=F(or),n=ne(),{t:r}=pe();Ke(["v"],()=>{o()},{enabled:()=>!t,preventDefault:!0},[]);const o=()=>n(qs("move"));return a.jsx(je,{"aria-label":`${r("unifiedCanvas.move")} (V)`,tooltip:`${r("unifiedCanvas.move")} (V)`,icon:a.jsx(gk,{}),isChecked:e==="move"||t,onClick:o})}function Ose(){const e=F(s=>s.ui.shouldPinParametersPanel),t=F(s=>s.ui.shouldShowParametersPanel),n=ne(),{t:r}=pe(),o=()=>{n(J0(!0)),e&&n(js())};return!e||!t?a.jsxs(H,{flexDirection:"column",gap:2,children:[a.jsx(je,{tooltip:`${r("parameters.showOptionsPanel")} (O)`,tooltipProps:{placement:"top"},"aria-label":r("parameters.showOptionsPanel"),onClick:o,children:a.jsx(T1,{})}),a.jsx(H,{children:a.jsx(Ay,{iconButton:!0})}),a.jsx(H,{children:a.jsx(om,{width:"100%",height:"40px",btnGroupWidth:"100%"})})]}):null}function Rse(){const e=ne(),{t}=pe(),n=F(or),r=()=>{e(c5()),e(ph())};return a.jsx(je,{"aria-label":t("unifiedCanvas.clearCanvas"),tooltip:t("unifiedCanvas.clearCanvas"),icon:a.jsx(io,{}),onClick:r,isDisabled:n,colorScheme:"error"})}function Tse(){const e=ba(),t=ne(),{t:n}=pe();Ke(["r"],()=>{o()},{enabled:()=>!0,preventDefault:!0},[e]);const r=lI(()=>o(!1),()=>o(!0)),o=(s=!1)=>{const i=ba();if(!i)return;const u=i.getClientRect({skipTransform:!0});t(r5({contentRect:u,shouldScaleTo1:s}))};return a.jsx(je,{"aria-label":`${n("unifiedCanvas.resetView")} (R)`,tooltip:`${n("unifiedCanvas.resetView")} (R)`,icon:a.jsx(vk,{}),onClick:r})}function Mse(){const e=F(or),t=ba(),n=F(i=>i.system.isProcessing),r=ne(),{t:o}=pe();Ke(["shift+s"],()=>{s()},{enabled:()=>!e,preventDefault:!0},[t,n]);const s=()=>{r(s5())};return a.jsx(je,{"aria-label":`${o("unifiedCanvas.saveToGallery")} (Shift+S)`,tooltip:`${o("unifiedCanvas.saveToGallery")} (Shift+S)`,icon:a.jsx(Dh,{}),onClick:s,isDisabled:e})}const Dse=Ce([en,or,xo],(e,t,n)=>{const{isProcessing:r}=n,{tool:o}=e;return{tool:o,isStaging:t,isProcessing:r}},{memoizeOptions:{resultEqualityCheck:Wt}}),Ase=()=>{const e=ne(),{t}=pe(),{tool:n,isStaging:r}=F(Dse);Ke(["b"],()=>{o()},{enabled:()=>!r,preventDefault:!0},[]),Ke(["e"],()=>{s()},{enabled:()=>!r,preventDefault:!0},[n]),Ke(["c"],()=>{i()},{enabled:()=>!r,preventDefault:!0},[n]),Ke(["shift+f"],()=>{u()},{enabled:()=>!r,preventDefault:!0}),Ke(["delete","backspace"],()=>{d()},{enabled:()=>!r,preventDefault:!0});const o=()=>e(qs("brush")),s=()=>e(qs("eraser")),i=()=>e(qs("colorPicker")),u=()=>e(t5()),d=()=>e(n5());return a.jsxs(H,{flexDirection:"column",gap:2,children:[a.jsxs(gr,{children:[a.jsx(je,{"aria-label":`${t("unifiedCanvas.brush")} (B)`,tooltip:`${t("unifiedCanvas.brush")} (B)`,icon:a.jsx(wk,{}),isChecked:n==="brush"&&!r,onClick:o,isDisabled:r}),a.jsx(je,{"aria-label":`${t("unifiedCanvas.eraser")} (E)`,tooltip:`${t("unifiedCanvas.eraser")} (B)`,icon:a.jsx(yk,{}),isChecked:n==="eraser"&&!r,isDisabled:r,onClick:s})]}),a.jsxs(gr,{children:[a.jsx(je,{"aria-label":`${t("unifiedCanvas.fillBoundingBox")} (Shift+F)`,tooltip:`${t("unifiedCanvas.fillBoundingBox")} (Shift+F)`,icon:a.jsx(xk,{}),isDisabled:r,onClick:u}),a.jsx(je,{"aria-label":`${t("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,tooltip:`${t("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,icon:a.jsx(Mh,{style:{transform:"rotate(45deg)"}}),isDisabled:r,onClick:d})]}),a.jsx(je,{"aria-label":`${t("unifiedCanvas.colorPicker")} (C)`,tooltip:`${t("unifiedCanvas.colorPicker")} (C)`,icon:a.jsx(bk,{}),isChecked:n==="colorPicker"&&!r,isDisabled:r,onClick:i,width:"max-content"})]})},Nse=()=>a.jsxs(H,{flexDirection:"column",rowGap:2,width:"min-content",children:[a.jsx(jse,{}),a.jsx(Ase,{}),a.jsxs(H,{gap:2,children:[a.jsx(Ise,{}),a.jsx(Tse,{})]}),a.jsxs(H,{columnGap:2,children:[a.jsx(Ese,{}),a.jsx(Mse,{})]}),a.jsxs(H,{columnGap:2,children:[a.jsx(Cse,{}),a.jsx(kse,{})]}),a.jsxs(H,{gap:2,children:[a.jsx(dI,{}),a.jsx(cI,{})]}),a.jsxs(H,{gap:2,children:[a.jsx(Pse,{}),a.jsx(Rse,{})]}),a.jsx(wse,{}),a.jsx(Ose,{})]});function zse(){const e=ne(),t=F(o=>o.canvas.brushSize),{t:n}=pe(),r=F(or);return Ke(["BracketLeft"],()=>{e($l(Math.max(t-5,5)))},{enabled:()=>!r,preventDefault:!0},[t]),Ke(["BracketRight"],()=>{e($l(Math.min(t+5,500)))},{enabled:()=>!r,preventDefault:!0},[t]),a.jsx(vt,{label:n("unifiedCanvas.brushSize"),value:t,withInput:!0,onChange:o=>e($l(o)),sliderNumberInputProps:{max:500},isCompact:!0})}const $se=Ce([en,or],(e,t)=>{const{brushColor:n,maskColor:r,layer:o}=e;return{brushColor:n,maskColor:r,layer:o,isStaging:t}},{memoizeOptions:{resultEqualityCheck:Wt}});function Lse(){const e=ne(),{brushColor:t,maskColor:n,layer:r,isStaging:o}=F($se),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 Ke(["shift+BracketLeft"],()=>{e(Ll({...t,a:Ys(t.a-.05,.05,1)}))},{enabled:()=>!o,preventDefault:!0},[t]),Ke(["shift+BracketRight"],()=>{e(Ll({...t,a:Ys(t.a+.05,.05,1)}))},{enabled:()=>!o,preventDefault:!0},[t]),a.jsx(fa,{triggerComponent:a.jsx(Ge,{sx:{width:7,height:7,minWidth:7,minHeight:7,borderRadius:"full",bg:s(),cursor:"pointer"}}),children:a.jsxs(H,{minWidth:60,direction:"column",gap:4,width:"100%",children:[r==="base"&&a.jsx(ah,{sx:{width:"100%",paddingTop:2,paddingBottom:2},pickerColor:t,onChange:i=>e(Ll(i))}),r==="mask"&&a.jsx(ah,{sx:{width:"100%",paddingTop:2,paddingBottom:2},pickerColor:n,onChange:i=>e(G3(i))})]})})}function fI(){return a.jsxs(H,{columnGap:4,alignItems:"center",children:[a.jsx(zse,{}),a.jsx(Lse,{})]})}function Fse(){const e=ne(),t=F(r=>r.canvas.shouldRestrictStrokesToBox),{t:n}=pe();return a.jsx(In,{label:n("unifiedCanvas.betaLimitToBox"),isChecked:t,onChange:r=>e(Z3(r.target.checked))})}function Bse(){return a.jsxs(H,{gap:4,alignItems:"center",children:[a.jsx(fI,{}),a.jsx(Fse,{})]})}function Hse(){const e=ne(),{t}=pe(),n=()=>e(Z0());return a.jsx(Yt,{size:"sm",leftIcon:a.jsx(io,{}),onClick:n,tooltip:`${t("unifiedCanvas.clearMask")} (Shift+C)`,children:t("unifiedCanvas.betaClear")})}function Wse(){const e=F(o=>o.canvas.isMaskEnabled),t=ne(),{t:n}=pe(),r=()=>t($u(!e));return a.jsx(In,{label:`${n("unifiedCanvas.enableMask")} (H)`,isChecked:e,onChange:r})}function Vse(){const e=ne(),{t}=pe(),n=F(r=>r.canvas.shouldPreserveMaskedArea);return a.jsx(In,{label:t("unifiedCanvas.betaPreserveMasked"),isChecked:n,onChange:r=>e(U3(r.target.checked))})}function Use(){return a.jsxs(H,{gap:4,alignItems:"center",children:[a.jsx(fI,{}),a.jsx(Wse,{}),a.jsx(Vse,{}),a.jsx(Hse,{})]})}function Gse(){const e=F(r=>r.canvas.shouldDarkenOutsideBoundingBox),t=ne(),{t:n}=pe();return a.jsx(In,{label:n("unifiedCanvas.betaDarkenOutside"),isChecked:e,onChange:r=>t(Y3(r.target.checked))})}function qse(){const e=F(r=>r.canvas.shouldShowGrid),t=ne(),{t:n}=pe();return a.jsx(In,{label:n("unifiedCanvas.showGrid"),isChecked:e,onChange:r=>t(K3(r.target.checked))})}function Kse(){const e=F(o=>o.canvas.shouldSnapToGrid),t=ne(),{t:n}=pe(),r=o=>t(Yf(o.target.checked));return a.jsx(In,{label:`${n("unifiedCanvas.snapToGrid")} (N)`,isChecked:e,onChange:r})}function Yse(){return a.jsxs(H,{alignItems:"center",gap:4,children:[a.jsx(qse,{}),a.jsx(Kse,{}),a.jsx(Gse,{})]})}const Xse=Ce([en],e=>{const{tool:t,layer:n}=e;return{tool:t,layer:n}},{memoizeOptions:{resultEqualityCheck:Wt}});function Qse(){const{tool:e,layer:t}=F(Xse);return a.jsxs(H,{height:8,minHeight:8,maxHeight:8,alignItems:"center",children:[t=="base"&&["brush","eraser","colorPicker"].includes(e)&&a.jsx(Bse,{}),t=="mask"&&["brush","eraser","colorPicker"].includes(e)&&a.jsx(Use,{}),e=="move"&&a.jsx(Yse,{})]})}const Zse=Ce([en,Hr],(e,t)=>{const{doesCanvasNeedScaling:n}=e,{shouldUseCanvasBetaLayout:r}=t;return{doesCanvasNeedScaling:n,shouldUseCanvasBetaLayout:r}},Ct),yv={id:"canvas-intial-image",actionType:"SET_CANVAS_INITIAL_IMAGE"},Jse=()=>{const e=ne(),{doesCanvasNeedScaling:t,shouldUseCanvasBetaLayout:n}=F(Zse),{isOver:r,setNodeRef:o,active:s}=Du({id:"unifiedCanvas",data:yv});return p.useLayoutEffect(()=>{const i=()=>{e(js())};return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[e]),n?a.jsx(Ge,{layerStyle:"first",ref:o,tabIndex:0,sx:{w:"full",h:"full",p:4,borderRadius:"base"},children:a.jsxs(H,{sx:{w:"full",h:"full",gap:4},children:[a.jsx(Nse,{}),a.jsxs(H,{sx:{flexDir:"column",w:"full",h:"full",gap:4,position:"relative"},children:[a.jsx(Qse,{}),a.jsxs(Ge,{sx:{w:"full",h:"full",position:"relative"},children:[t?a.jsx(X4,{}):a.jsx(Y4,{}),Kl(yv,s)&&a.jsx(Zl,{isOver:r,label:"Set Canvas Initial Image"})]})]})]})}):a.jsx(Ge,{ref:o,tabIndex:-1,sx:{layerStyle:"first",w:"full",h:"full",p:4,borderRadius:"base"},children:a.jsxs(H,{sx:{flexDirection:"column",alignItems:"center",gap:4,w:"full",h:"full"},children:[a.jsx(xse,{}),a.jsx(H,{sx:{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:4,w:"full",h:"full"},children:a.jsxs(Ge,{sx:{w:"full",h:"full",position:"relative"},children:[t?a.jsx(X4,{}):a.jsx(Y4,{}),Kl(yv,s)&&a.jsx(Zl,{isOver:r,label:"Set Canvas Initial Image"})]})})]})})},eae=p.memo(Jse),tae=Ce([rn],({generation:e})=>{const{infillMethod:t}=e;return{infillMethod:t}},Ct),nae=()=>{const e=ne(),{infillMethod:t}=F(tae),{data:n,isLoading:r}=kR(),o=n==null?void 0:n.infill_methods,{t:s}=pe(),i=p.useCallback(u=>{e(PR(u))},[e]);return a.jsx(Kn,{disabled:(o==null?void 0:o.length)===0,placeholder:r?"Loading...":void 0,label:s("parameters.infillMethod"),value:t,data:o??[],onChange:i})},rae=p.memo(nae),oae=Ce([ss],e=>{const{tileSize:t,infillMethod:n}=e;return{tileSize:t,infillMethod:n}},Ct),sae=()=>{const e=ne(),{tileSize:t,infillMethod:n}=F(oae),{t:r}=pe(),o=p.useCallback(i=>{e(s2(i))},[e]),s=p.useCallback(()=>{e(s2(32))},[e]);return a.jsx(vt,{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})},aae=p.memo(sae),iae=Ce([en],e=>{const{boundingBoxScaleMethod:t}=e;return{boundingBoxScale:t}},Ct),lae=()=>{const e=ne(),{boundingBoxScale:t}=F(iae),{t:n}=pe(),r=o=>{e(jR(o))};return a.jsx(Kn,{label:n("parameters.scaleBeforeProcessing"),data:_R,value:t,onChange:r})},cae=p.memo(lae),uae=Ce([ss,xo,en],(e,t,n)=>{const{scaledBoundingBoxDimensions:r,boundingBoxScaleMethod:o}=n;return{scaledBoundingBoxDimensions:r,isManual:o==="manual"}},Ct),dae=()=>{const e=ne(),{isManual:t,scaledBoundingBoxDimensions:n}=F(uae),{t:r}=pe(),o=i=>{e(Qf({...n,height:Math.floor(i)}))},s=()=>{e(Qf({...n,height:Math.floor(512)}))};return a.jsx(vt,{isDisabled:!t,label:r("parameters.scaledHeight"),min:64,max:1024,step:64,value:n.height,onChange:o,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:s})},fae=p.memo(dae),pae=Ce([en],e=>{const{boundingBoxScaleMethod:t,scaledBoundingBoxDimensions:n}=e;return{scaledBoundingBoxDimensions:n,isManual:t==="manual"}},Ct),hae=()=>{const e=ne(),{isManual:t,scaledBoundingBoxDimensions:n}=F(pae),{t:r}=pe(),o=i=>{e(Qf({...n,width:Math.floor(i)}))},s=()=>{e(Qf({...n,width:Math.floor(512)}))};return a.jsx(vt,{isDisabled:!t,label:r("parameters.scaledWidth"),min:64,max:1024,step:64,value:n.width,onChange:o,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:s})},mae=p.memo(hae),gae=()=>{const{t:e}=pe();return a.jsx(ko,{label:e("parameters.infillScalingHeader"),children:a.jsxs(H,{sx:{gap:2,flexDirection:"column"},children:[a.jsx(rae,{}),a.jsx(aae,{}),a.jsx(cae,{}),a.jsx(mae,{}),a.jsx(fae,{})]})})},vae=p.memo(gae);function yae(){const e=ne(),t=F(r=>r.generation.seamBlur),{t:n}=pe();return a.jsx(vt,{label:n("parameters.seamBlur"),min:0,max:64,sliderNumberInputProps:{max:512},value:t,onChange:r=>{e(a2(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(a2(16))}})}function bae(){const e=ne(),{t}=pe(),n=F(r=>r.generation.seamSize);return a.jsx(vt,{label:t("parameters.seamSize"),min:1,max:256,sliderNumberInputProps:{max:512},value:n,onChange:r=>{e(i2(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>e(i2(96))})}function xae(){const{t:e}=pe(),t=F(r=>r.generation.seamSteps),n=ne();return a.jsx(vt,{label:e("parameters.seamSteps"),min:1,max:100,sliderNumberInputProps:{max:999},value:t,onChange:r=>{n(l2(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{n(l2(30))}})}function Sae(){const e=ne(),{t}=pe(),n=F(r=>r.generation.seamStrength);return a.jsx(vt,{label:t("parameters.seamStrength"),min:.01,max:.99,step:.01,value:n,onChange:r=>{e(c2(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(c2(.7))}})}const wae=()=>{const{t:e}=pe();return a.jsxs(ko,{label:e("parameters.seamCorrectionHeader"),children:[a.jsx(bae,{}),a.jsx(yae,{}),a.jsx(Sae,{}),a.jsx(xae,{})]})},Cae=p.memo(wae),kae=Ce([en,or,Hr],(e,t,n)=>{const{boundingBoxDimensions:r}=e,{aspectRatio:o}=n;return{boundingBoxDimensions:r,isStaging:t,aspectRatio:o}},Ct),Pae=()=>{const e=ne(),{boundingBoxDimensions:t,isStaging:n,aspectRatio:r}=F(kae),{t:o}=pe(),s=u=>{if(e(Gs({...t,height:Math.floor(u)})),r){const d=ys(u*r,64);e(Gs({width:d,height:Math.floor(u)}))}},i=()=>{if(e(Gs({...t,height:Math.floor(512)})),r){const u=ys(512*r,64);e(Gs({width:u,height:Math.floor(512)}))}};return a.jsx(vt,{label:o("parameters.boundingBoxHeight"),min:64,max:1024,step:64,value:t.height,onChange:s,isDisabled:n,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:i})},_ae=p.memo(Pae),jae=Ce([en,or,Hr],(e,t,n)=>{const{boundingBoxDimensions:r}=e,{aspectRatio:o}=n;return{boundingBoxDimensions:r,isStaging:t,aspectRatio:o}},Ct),Eae=()=>{const e=ne(),{boundingBoxDimensions:t,isStaging:n,aspectRatio:r}=F(jae),{t:o}=pe(),s=u=>{if(e(Gs({...t,width:Math.floor(u)})),r){const d=ys(u/r,64);e(Gs({width:Math.floor(u),height:d}))}},i=()=>{if(e(Gs({...t,width:Math.floor(512)})),r){const u=ys(512/r,64);e(Gs({width:Math.floor(512),height:u}))}};return a.jsx(vt,{label:o("parameters.boundingBoxWidth"),min:64,max:1024,step:64,value:t.width,onChange:s,isDisabled:n,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,withReset:!0,handleReset:i})},Iae=p.memo(Eae);function Q4(){const e=ne(),{t}=pe();return a.jsxs(H,{sx:{gap:2,p:4,borderRadius:4,flexDirection:"column",w:"full",bg:"base.150",_dark:{bg:"base.750"}},children:[a.jsxs(H,{alignItems:"center",gap:2,children:[a.jsx(Ue,{sx:{fontSize:"sm",width:"full",color:"base.700",_dark:{color:"base.300"}},children:t("parameters.aspectRatio")}),a.jsx(Oa,{}),a.jsx(RE,{}),a.jsx(je,{tooltip:t("ui.swapSizes"),"aria-label":t("ui.swapSizes"),size:"sm",icon:a.jsx(sE,{}),fontSize:20,onClick:()=>e(ER())})]}),a.jsx(Iae,{}),a.jsx(_ae,{})]})}const Oae=Ce(rn,({ui:e,generation:t})=>{const{shouldUseSliders:n}=e,{shouldRandomizeSeed:r}=t;return{shouldUseSliders:n,activeLabel:r?void 0:"Manual Seed"}},Ct),Rae=()=>{const{shouldUseSliders:e,activeLabel:t}=F(Oae);return a.jsx(ko,{label:"General",activeLabel:t,defaultIsOpen:!0,children:a.jsxs(H,{sx:{flexDirection:"column",gap:3},children:[e?a.jsxs(a.Fragment,{children:[a.jsx(ic,{}),a.jsx(cc,{}),a.jsx(ac,{}),a.jsx(lc,{}),a.jsx(Ge,{pt:2,children:a.jsx(uc,{})}),a.jsx(Q4,{})]}):a.jsxs(a.Fragment,{children:[a.jsxs(H,{gap:3,children:[a.jsx(ic,{}),a.jsx(cc,{}),a.jsx(ac,{})]}),a.jsx(lc,{}),a.jsx(Ge,{pt:2,children:a.jsx(uc,{})}),a.jsx(Q4,{})]}),a.jsx(TE,{})]})})},Tae=p.memo(Rae),Mae=()=>a.jsxs(a.Fragment,{children:[a.jsx(Ty,{}),a.jsx(Ry,{}),a.jsx(Ny,{}),a.jsx(Tae,{}),a.jsx(_y,{}),a.jsx(ky,{}),a.jsx(Iy,{}),a.jsx(Dy,{}),a.jsx(My,{}),a.jsx(Cae,{}),a.jsx(vae,{}),a.jsx(jy,{})]}),pI=p.memo(Mae),Dae=()=>a.jsxs(H,{sx:{gap:4,w:"full",h:"full"},children:[a.jsx(Cy,{children:a.jsx(pI,{})}),a.jsx(eae,{})]}),Aae=p.memo(Dae),Nae=[{id:"txt2img",translationKey:"common.txt2img",icon:a.jsx(go,{as:Vz,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(vre,{})},{id:"img2img",translationKey:"common.img2img",icon:a.jsx(go,{as:Ku,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(QJ,{})},{id:"unifiedCanvas",translationKey:"common.unifiedCanvas",icon:a.jsx(go,{as:hX,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(Aae,{})},{id:"nodes",translationKey:"common.nodes",icon:a.jsx(go,{as:pX,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(ore,{})},{id:"modelManager",translationKey:"modelManager.modelManager",icon:a.jsx(go,{as:Lz,sx:{boxSize:6,pointerEvents:"none"}}),content:a.jsx(pte,{})}],zae=Ce(hi,e=>{const{disabledTabs:t}=e;return Nae.filter(n=>!t.includes(n.id))},{memoizeOptions:{resultEqualityCheck:Wt}}),$ae=300,bv=20,hI=["modelManager"],Lae=()=>{const e=F(IR),t=F(Sr),n=F(zae),r=F(C=>C.lightbox.isLightboxOpen),o=Gn("lightbox").isFeatureEnabled,{shouldPinGallery:s,shouldPinParametersPanel:i,shouldShowGallery:u}=F(C=>C.ui),{t:d}=pe(),f=ne();Ke("z",()=>{o&&f(mu(!r))},[r]),Ke("f",()=>{f(OR()),(s||i)&&f(js())},[s,i]);const h=p.useCallback(()=>{t==="unifiedCanvas"&&f(js())},[f,t]),m=p.useCallback(C=>{C.target instanceof HTMLElement&&C.target.blur()},[]),v=p.useMemo(()=>n.map(C=>a.jsx(qn,{hasArrow:!0,label:String(d(C.translationKey)),placement:"end",children:a.jsxs(Rh,{onClick:m,children:[a.jsx(v5,{children:String(d(C.translationKey))}),C.icon]})},C.id)),[n,d,m]),y=p.useMemo(()=>n.map(C=>a.jsx(Ih,{children:C.content},C.id)),[n]),{ref:S,minSizePct:w}=aQ($ae,bv,"app");return a.jsxs(jh,{defaultIndex:e,index:e,onChange:C=>{f(Ti(C))},sx:{flexGrow:1,gap:4},isLazy:!0,children:[a.jsxs(Eh,{sx:{pt:2,gap:4,flexDir:"column"},children:[v,a.jsx(Oa,{}),a.jsx(HX,{})]}),a.jsxs(wy,{id:"app",autoSaveId:"app",direction:"horizontal",style:{height:"100%",width:"100%"},children:[a.jsx(ju,{id:"main",children:a.jsx(Oh,{style:{height:"100%",width:"100%"},children:y})}),s&&u&&!hI.includes(t)&&a.jsxs(a.Fragment,{children:[a.jsx(wE,{}),a.jsx(ju,{ref:S,onResize:h,id:"gallery",order:3,defaultSize:w>bv?w:bv,minSize:w,maxSize:50,children:a.jsx(yP,{})})]})]})]})},Fae=p.memo(Lae),Bae=Ce([Sr,Hr],(e,t)=>{const{shouldPinGallery:n,shouldShowGallery:r}=t;return{shouldPinGallery:n,shouldShowGalleryButton:hI.includes(e)?!1:!r}},{memoizeOptions:{resultEqualityCheck:Wt}}),Hae=()=>{const{t:e}=pe(),{shouldPinGallery:t,shouldShowGalleryButton:n}=F(Bae),r=ne(),o=()=>{r(Pv(!0)),t&&r(js())};return n?a.jsx(je,{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:a.jsx(mX,{})}):null},Wae=p.memo(Hae),xv={borderStartStartRadius:0,borderEndStartRadius:0,shadow:"2xl"},Vae=Ce([Hr,Sr],(e,t)=>{const{shouldPinParametersPanel:n,shouldUseCanvasBetaLayout:r,shouldShowParametersPanel:o}=e,s=r&&t==="unifiedCanvas",i=!s&&(!n||!o),u=!s&&!o&&["txt2img","img2img","unifiedCanvas"].includes(t);return{shouldPinParametersPanel:n,shouldShowParametersPanelButton:u,shouldShowProcessButtons:i}},{memoizeOptions:{resultEqualityCheck:Wt}}),Uae=()=>{const e=ne(),{t}=pe(),{shouldShowProcessButtons:n,shouldShowParametersPanelButton:r,shouldPinParametersPanel:o}=F(Vae),s=()=>{e(J0(!0)),o&&e(js())};return r?a.jsxs(H,{pos:"absolute",transform:"translate(0, -50%)",minW:8,top:"50%",insetInlineStart:"4.5rem",direction:"column",gap:2,children:[a.jsx(je,{tooltip:"Show Options Panel (O)",tooltipProps:{placement:"top"},"aria-label":t("accessibility.showOptionsPanel"),onClick:s,sx:xv,children:a.jsx(T1,{})}),n&&a.jsxs(a.Fragment,{children:[a.jsx(Ay,{iconButton:!0,sx:xv}),a.jsx(om,{sx:xv})]})]}):null},Gae=p.memo(Uae),qae=Ce([Hr,Sr,xP],(e,t,n)=>{const{shouldPinParametersPanel:r,shouldShowParametersPanel:o}=e;return{activeTabName:t,shouldPinParametersPanel:r,shouldShowParametersPanel:o}},Ct),Kae=()=>{const e=ne(),{shouldPinParametersPanel:t,shouldShowParametersPanel:n,activeTabName:r}=F(qae),o=()=>{e(J0(!1))},s=p.useMemo(()=>r==="txt2img"?a.jsx(XE,{}):r==="img2img"?a.jsx(ME,{}):r==="unifiedCanvas"?a.jsx(pI,{}):null,[r]);return t?null:a.jsx(bP,{direction:"left",isResizable:!1,isOpen:n,onClose:o,children:a.jsxs(H,{sx:{flexDir:"column",h:"full",w:yy,gap:2,position:"relative",flexShrink:0,overflowY:"auto"},children:[a.jsxs(H,{paddingTop:1.5,paddingBottom:4,justifyContent:"space-between",alignItems:"center",children:[a.jsx(iE,{}),a.jsx(SE,{})]}),a.jsx(H,{sx:{gap:2,flexDirection:"column",h:"full",w:"full"},children:s})]})})},Yae=p.memo(Kae),Xae=e=>{const{imagesUsage:t}=e;return!t||!x3(t)?null:a.jsxs(a.Fragment,{children:[a.jsx(Ue,{children:"An image from this board is currently in use in the following features:"}),a.jsxs(bh,{sx:{paddingInlineStart:6},children:[t.isInitialImage&&a.jsx(Mo,{children:"Image to Image"}),t.isCanvasImage&&a.jsx(Mo,{children:"Unified Canvas"}),t.isControlNetImage&&a.jsx(Mo,{children:"ControlNet"}),t.isNodesImage&&a.jsx(Mo,{children:"Node Editor"})]}),a.jsx(Ue,{children:"If you delete images from this board, those features will immediately be reset."})]})},Qae=()=>{const{t:e}=pe(),{isOpen:t,onClose:n,board:r,handleDeleteBoardImages:o,handleDeleteBoardOnly:s,imagesUsage:i}=p.useContext(f3),u=p.useRef(null);return a.jsx(Vu,{isOpen:t,leastDestructiveRef:u,onClose:n,isCentered:!0,children:a.jsx(Ca,{children:r&&a.jsxs(Uu,{children:[a.jsx(wa,{fontSize:"lg",fontWeight:"bold",children:"Delete Board"}),a.jsx(ka,{children:a.jsxs(H,{direction:"column",gap:3,children:[a.jsx(Xae,{imagesUsage:i}),a.jsx(Ra,{}),a.jsx(Ue,{children:e("common.areYouSure")}),a.jsxs(Ue,{fontWeight:"bold",children:["This board has ",r.image_count," image(s) that will be deleted."]})]})}),a.jsxs(Sa,{gap:3,children:[a.jsx(Yt,{ref:u,onClick:n,children:"Cancel"}),a.jsx(Yt,{colorScheme:"warning",onClick:()=>s(r.board_id),children:"Delete Board Only"}),a.jsx(Yt,{colorScheme:"error",onClick:()=>o(r.board_id),children:"Delete Board and Images"})]})]})})})},Zae=p.memo(Qae),Jae=()=>{const{data:e,isFetching:t}=dh(),{isOpen:n,onClose:r,handleAddToBoard:o,image:s}=p.useContext(q0),[i,u]=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 a.jsx(Vu,{isOpen:n,leastDestructiveRef:d,onClose:r,isCentered:!0,children:a.jsx(Ca,{children:a.jsxs(Uu,{children:[a.jsx(wa,{fontSize:"lg",fontWeight:"bold",children:f?"Move Image to Board":"Add Image to Board"}),a.jsx(ka,{children:a.jsx(Ge,{children:a.jsxs(H,{direction:"column",gap:3,children:[f&&a.jsxs(Ue,{children:["Moving this image from"," ",a.jsx("strong",{children:f.board_name})," to"]}),t?a.jsx(ui,{}):a.jsx(Kn,{placeholder:"Select Board",onChange:h=>u(h),value:i,data:(e??[]).map(h=>({label:h.board_name,value:h.board_id}))})]})})}),a.jsxs(Sa,{children:[a.jsx(Yt,{onClick:r,children:"Cancel"}),a.jsx(Yt,{isDisabled:!i,colorScheme:"accent",onClick:()=>{i&&o(i)},ml:3,children:f?"Move":"Add"})]})]})})})},eie=p.memo(Jae),tie=Ce(e=>e.hotkeys,e=>{const{shift:t}=e;return{shift:t}},{memoizeOptions:{resultEqualityCheck:Wt}}),nie=()=>{const e=ne(),{shift:t}=F(tie);return Ke("*",()=>{lk("shift")?!t&&e(rs(!0)):t&&e(rs(!1))},{keyup:!0,keydown:!0},[t]),Ke("o",()=>{e(RR())}),Ke(["shift+o"],()=>{e(TR())}),Ke("g",()=>{e(MR())}),Ke(["shift+g"],()=>{e(b3())}),Ke("1",()=>{e(Ti("txt2img"))}),Ke("2",()=>{e(Ti("img2img"))}),Ke("3",()=>{e(Ti("unifiedCanvas"))}),Ke("4",()=>{e(Ti("nodes"))}),null},rie=p.memo(nie),oie={},sie=({config:e=oie,headerComponent:t})=>{const n=F(C3),r=DR(),o=Gn("lightbox").isFeatureEnabled,s=ne();return p.useEffect(()=>{Pr.changeLanguage(n)},[n]),p.useEffect(()=>{r.info({namespace:"App",data:e},"Received config"),s(AR(e))},[s,e,r]),p.useEffect(()=>{s(NR())},[s]),a.jsxs(a.Fragment,{children:[a.jsxs(xa,{w:"100vw",h:"100vh",position:"relative",overflow:"hidden",children:[o&&a.jsx(xX,{}),a.jsx(kz,{children:a.jsxs(xa,{sx:{gap:4,p:4,gridAutoRows:"min-content auto",w:"full",h:"full"},children:[t||a.jsx(LX,{}),a.jsx(H,{sx:{gap:4,w:"full",h:"full"},children:a.jsx(Fae,{})})]})}),a.jsx(hB,{}),a.jsx(Yae,{}),a.jsx($f,{children:a.jsx(Gae,{})}),a.jsx($f,{children:a.jsx(Wae,{})})]}),a.jsx(xB,{}),a.jsx(eie,{}),a.jsx(Zae,{}),a.jsx(zR,{}),a.jsx(rie,{})]})},die=p.memo(sie);export{die as default};
|