mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
189 lines
590 KiB
JavaScript
189 lines
590 KiB
JavaScript
import{r as g,f as fe,j as l,u as zS,c as re,a as Ae,b as Ee,w as ts,d as un,o as At,S as Xf,e as go,g as qe,h as Rr,k as Jo,i as yc,_ as Yd,l as RS,m as NS,R as Me,n as Ev,p as FS,q as Kd,s as ea,t as y1,v as x1,x as LS,y as BS,z as ee,A as b1,B as S1,C as xc,D as ns,F as B,E as X,G as HS,H as cd,T as Ce,I as C1,J as WS,K as rs,L as Pv,M as VS,N as US,O as $S,P as Wo,Q as w1,U as Iv,V as GS,W as k1,X as qS,Y as YS,Z as KS,$ as j1,a0 as XS,a1 as QS,a2 as ZS,a3 as JS,a4 as e3,a5 as t3,a6 as n3,a7 as E1,a8 as r3,a9 as o3,aa as ql,ab as i3,ac as a3,ad as Nl,ae as Yl,af as Xd,ag as Qd,ah as Zd,ai as s3,aj as P1,ak as l3,al as I1,am as c3,an as M1,ao as T1,ap as Vo,aq as jn,ar as _1,as as os,at as u3,au as d3,av as D1,aw as Jd,ax as ef,ay as A1,az as tf,aA as nf,aB as Mv,aC as O1,aD as z1,aE as R1,aF as Fl,aG as Ll,aH as f3,aI as rf,aJ as N1,aK as F1,aL as L1,aM as h3,aN as p3,aO as Tv,aP as _v,aQ as m3,aR as v3,aS as g3,aT as B1,aU as H1,aV as y3,aW as x3,aX as W1,aY as Dv,aZ as b3,a_ as Av,a$ as S3,b0 as C3,b1 as V1,b2 as w3,b3 as k3,b4 as j3,b5 as ud,b6 as Ov,b7 as U1,b8 as of,b9 as E3,ba as zv,bb as Bl,bc as P3,bd as I3,be as Va,bf as Kl,bg as $1,bh as Xl,bi as M3,bj as T3,bk as br,bl as G1,bm as Qf,bn as is,bo as _3,bp as D3,bq as A3,br as wr,bs as q1,bt as O3,bu as z3,bv as Y1,bw as R3,bx as N3,by as F3,bz as L3,bA as B3,bB as H3,bC as W3,bD as V3,bE as U3,bF as Rv,bG as $3,bH as G3,bI as q3,bJ as Y3,bK as K3,bL as X3,bM as dd,bN as Oa,bO as pl,bP as Nv,bQ as fd,bR as hd,bS as ml,bT as Fv,bU as af,bV as Q3,bW as Z3,bX as J3,bY as bc,bZ as eC,b_ as tC,b$ as nC,c0 as rC,c1 as vl,c2 as pd,c3 as gl,c4 as Ia,c5 as oC,c6 as iC,c7 as K1,c8 as Ql,c9 as Zf,ca as X1,cb as Q1,cc as Z1,cd as aC,ce as J1,cf as e2,cg as t2,ch as n2,ci as r2,cj as Fi,ck as Li,cl as o2,cm as i2,cn as a2,co as s2,cp as l2,cq as sC,cr as lC,cs as Lv,ct as yl,cu as cC,cv as Bv,cw as Hv,cx as Wv,cy as Vv,cz as uC,cA as dC,cB as sf,cC as fC,cD as Uv,cE as xl,cF as Zl,cG as hC,cH as pC,cI as mC,cJ as vC,cK as c2,cL as gC,cM as yC}from"./index-d64f4654.js";import{I as tn,u as xC,c as bC,a as jt,b as Wt,A as yo,m as ir,d as Bi,e as ei,P as Ua,f as SC,C as CC,g as Y,h as A}from"./storeHooks-0eed8e9f.js";function wC(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 Jl="NOT_FOUND";function kC(e){var t;return{get:function(r){return t&&e(t.key,r)?t.value:Jl},put:function(r,o){t={key:r,value:o}},getEntries:function(){return t?[t]:[]},clear:function(){t=void 0}}}function jC(e,t){var n=[];function r(u){var f=n.findIndex(function(h){return t(u,h.key)});if(f>-1){var p=n[f];return f>0&&(n.splice(f,1),n.unshift(p)),p.value}return Jl}function o(u,f){r(u)===Jl&&(n.unshift({key:u,value:f}),n.length>e&&n.pop())}function s(){return n}function c(){n=[]}return{get:r,put:o,getEntries:s,clear:c}}var EC=function(t,n){return t===n};function PC(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;for(var o=n.length,s=0;s<o;s++)if(!e(n[s],r[s]))return!1;return!0}}function IC(e,t){var n=typeof t=="object"?t:{equalityCheck:t},r=n.equalityCheck,o=r===void 0?EC:r,s=n.maxSize,c=s===void 0?1:s,u=n.resultEqualityCheck,f=PC(o),p=c===1?kC(f):jC(c,f);function h(){var y=p.get(arguments);if(y===Jl){if(y=e.apply(null,arguments),u){var x=p.getEntries(),S=x.find(function(C){return u(C.value,y)});S&&(y=S.value)}p.put(arguments,y)}return y}return h.clearCache=function(){return p.clear()},h}function MC(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every(function(r){return typeof r=="function"})){var n=t.map(function(r){return typeof r=="function"?"function "+(r.name||"unnamed")+"()":typeof r}).join(", ");throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+n+"]")}return t}function TC(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=function(){for(var c=arguments.length,u=new Array(c),f=0;f<c;f++)u[f]=arguments[f];var p=0,h,y={memoizeOptions:void 0},x=u.pop();if(typeof x=="object"&&(y=x,x=u.pop()),typeof x!="function")throw new Error("createSelector expects an output function after the inputs, but received: ["+typeof x+"]");var S=y,C=S.memoizeOptions,k=C===void 0?n:C,w=Array.isArray(k)?k:[k],j=MC(u),I=e.apply(void 0,[function(){return p++,x.apply(null,arguments)}].concat(w)),P=e(function(){for(var T=[],D=j.length,_=0;_<D;_++)T.push(j[_].apply(null,arguments));return h=I.apply(null,T),h});return Object.assign(P,{resultFunc:x,memoizedResultFunc:I,dependencies:j,lastResult:function(){return h},recomputations:function(){return p},resetRecomputations:function(){return p=0}}),P};return o}var me=TC(IC);function _C(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function u2(e){var t;return _C(e)&&(t=e.ownerDocument)!=null?t:document}function DC(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var AC=DC();const d2=1/60*1e3,OC=typeof performance<"u"?()=>performance.now():()=>Date.now(),f2=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(OC()),d2);function zC(e){let t=[],n=[],r=0,o=!1,s=!1;const c=new WeakSet,u={schedule:(f,p=!1,h=!1)=>{const y=h&&o,x=y?t:n;return p&&c.add(f),x.indexOf(f)===-1&&(x.push(f),y&&o&&(r=t.length)),f},cancel:f=>{const p=n.indexOf(f);p!==-1&&n.splice(p,1),c.delete(f)},process:f=>{if(o){s=!0;return}if(o=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let p=0;p<r;p++){const h=t[p];h(f),c.has(h)&&(u.schedule(h),e())}o=!1,s&&(s=!1,u.process(f))}};return u}const RC=40;let lf=!0,$a=!1,cf=!1;const Hi={delta:0,timestamp:0},as=["read","update","preRender","render","postRender"],Sc=as.reduce((e,t)=>(e[t]=zC(()=>$a=!0),e),{}),NC=as.reduce((e,t)=>{const n=Sc[t];return e[t]=(r,o=!1,s=!1)=>($a||BC(),n.schedule(r,o,s)),e},{}),FC=as.reduce((e,t)=>(e[t]=Sc[t].cancel,e),{});as.reduce((e,t)=>(e[t]=()=>Sc[t].process(Hi),e),{});const LC=e=>Sc[e].process(Hi),h2=e=>{$a=!1,Hi.delta=lf?d2:Math.max(Math.min(e-Hi.timestamp,RC),1),Hi.timestamp=e,cf=!0,as.forEach(LC),cf=!1,$a&&(lf=!1,f2(h2))},BC=()=>{$a=!0,lf=!0,cf||f2(h2)},$v=()=>Hi;function Jf(e){const{viewBox:t="0 0 24 24",d:n,displayName:r,defaultProps:o={}}=e,s=g.Children.toArray(e.path),c=fe((u,f)=>l.jsx(tn,{ref:f,viewBox:t,...o,...u,children:s.length?s:l.jsx("path",{fill:"currentColor",d:n})}));return c.displayName=r,c}function ss(e){const{theme:t}=zS(),n=xC();return g.useMemo(()=>bC(t.direction,{...n,...e}),[e,t.direction,n])}var HC=Object.defineProperty,WC=(e,t,n)=>t in e?HC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zt=(e,t,n)=>(WC(e,typeof t!="symbol"?t+"":t,n),n);function Gv(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 VC=e=>typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE;function qv(e,t,n){let r=e+1;return n&&r>=t&&(r=0),r}function Yv(e,t,n){let r=e-1;return n&&r<0&&(r=t),r}var uf=typeof window<"u"?g.useLayoutEffect:g.useEffect,ec=e=>e,UC=class{constructor(){zt(this,"descendants",new Map),zt(this,"register",e=>{if(e!=null)return VC(e)?this.registerNode(e):t=>{this.registerNode(t,e)}}),zt(this,"unregister",e=>{this.descendants.delete(e);const t=Gv(Array.from(this.descendants.keys()));this.assignIndex(t)}),zt(this,"destroy",()=>{this.descendants.clear()}),zt(this,"assignIndex",e=>{this.descendants.forEach(t=>{const n=e.indexOf(t.node);t.index=n,t.node.dataset.index=t.index.toString()})}),zt(this,"count",()=>this.descendants.size),zt(this,"enabledCount",()=>this.enabledValues().length),zt(this,"values",()=>Array.from(this.descendants.values()).sort((t,n)=>t.index-n.index)),zt(this,"enabledValues",()=>this.values().filter(e=>!e.disabled)),zt(this,"item",e=>{if(this.count()!==0)return this.values()[e]}),zt(this,"enabledItem",e=>{if(this.enabledCount()!==0)return this.enabledValues()[e]}),zt(this,"first",()=>this.item(0)),zt(this,"firstEnabled",()=>this.enabledItem(0)),zt(this,"last",()=>this.item(this.descendants.size-1)),zt(this,"lastEnabled",()=>{const e=this.enabledValues().length-1;return this.enabledItem(e)}),zt(this,"indexOf",e=>{var t,n;return e&&(n=(t=this.descendants.get(e))==null?void 0:t.index)!=null?n:-1}),zt(this,"enabledIndexOf",e=>e==null?-1:this.enabledValues().findIndex(t=>t.node.isSameNode(e))),zt(this,"next",(e,t=!0)=>{const n=qv(e,this.count(),t);return this.item(n)}),zt(this,"nextEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),o=qv(r,this.enabledCount(),t);return this.enabledItem(o)}),zt(this,"prev",(e,t=!0)=>{const n=Yv(e,this.count()-1,t);return this.item(n)}),zt(this,"prevEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),o=Yv(r,this.enabledCount()-1,t);return this.enabledItem(o)}),zt(this,"registerNode",(e,t)=>{if(!e||this.descendants.has(e))return;const n=Array.from(this.descendants.keys()).concat(e),r=Gv(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 $C(e,t){if(e!=null){if(typeof e=="function"){e(t);return}try{e.current=t}catch{throw new Error(`Cannot assign value '${t}' to ref '${e}'`)}}}function ct(...e){return t=>{e.forEach(n=>{$C(n,t)})}}function GC(...e){return g.useMemo(()=>ct(...e),e)}function qC(){const e=g.useRef(new UC);return uf(()=>()=>e.current.destroy()),e.current}var[YC,p2]=jt({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});function KC(e){const t=p2(),[n,r]=g.useState(-1),o=g.useRef(null);uf(()=>()=>{o.current&&t.unregister(o.current)},[]),uf(()=>{if(!o.current)return;const c=Number(o.current.dataset.index);n!=c&&!Number.isNaN(c)&&r(c)});const s=ec(e?t.register(e):t.register);return{descendants:t,index:n,enabledIndex:t.enabledIndexOf(o.current),register:ct(s,o)}}function eh(){return[ec(YC),()=>ec(p2()),()=>qC(),o=>KC(o)]}var[XC,Cc]=jt({name:"AccordionStylesContext",hookName:"useAccordionStyles",providerName:"<Accordion />"}),[QC,th]=jt({name:"AccordionItemContext",hookName:"useAccordionItemContext",providerName:"<AccordionItem />"}),[ZC,tL,JC,ew]=eh(),Di=fe(function(t,n){const{getButtonProps:r}=th(),o=r(t,n),c={display:"flex",alignItems:"center",width:"100%",outline:0,...Cc().button};return l.jsx(re.button,{...o,className:Ae("chakra-accordion__button",t.className),__css:c})});Di.displayName="AccordionButton";function nh(e){const{value:t,defaultValue:n,onChange:r,shouldUpdate:o=(x,S)=>x!==S}=e,s=Wt(r),c=Wt(o),[u,f]=g.useState(n),p=t!==void 0,h=p?t:u,y=Wt(x=>{const C=typeof x=="function"?x(h):x;c(h,C)&&(p||f(C),s(C))},[p,s,h,c]);return[h,y]}function tw(e){const{onChange:t,defaultIndex:n,index:r,allowMultiple:o,allowToggle:s,...c}=e;ow(e),iw(e);const u=JC(),[f,p]=g.useState(-1);g.useEffect(()=>()=>{p(-1)},[]);const[h,y]=nh({value:r,defaultValue(){return o?n??[]:n??-1},onChange:t});return{index:h,setIndex:y,htmlProps:c,getAccordionItemProps:S=>{let C=!1;return S!==null&&(C=Array.isArray(h)?h.includes(S):h===S),{isOpen:C,onChange:w=>{if(S!==null)if(o&&Array.isArray(h)){const j=w?h.concat(S):h.filter(I=>I!==S);y(j)}else w?y(S):s&&y(-1)}}},focusedIndex:f,setFocusedIndex:p,descendants:u}}var[nw,rh]=jt({name:"AccordionContext",hookName:"useAccordionContext",providerName:"Accordion"});function rw(e){const{isDisabled:t,isFocusable:n,id:r,...o}=e,{getAccordionItemProps:s,setFocusedIndex:c}=rh(),u=g.useRef(null),f=g.useId(),p=r??f,h=`accordion-button-${p}`,y=`accordion-panel-${p}`;aw(e);const{register:x,index:S,descendants:C}=ew({disabled:t&&!n}),{isOpen:k,onChange:w}=s(S===-1?null:S);sw({isOpen:k,isDisabled:t});const j=()=>{w==null||w(!0)},I=()=>{w==null||w(!1)},P=g.useCallback(()=>{w==null||w(!k),c(S)},[S,c,k,w]),M=g.useCallback(R=>{const F={ArrowDown:()=>{const L=C.nextEnabled(S);L==null||L.node.focus()},ArrowUp:()=>{const L=C.prevEnabled(S);L==null||L.node.focus()},Home:()=>{const L=C.firstEnabled();L==null||L.node.focus()},End:()=>{const L=C.lastEnabled();L==null||L.node.focus()}}[R.key];F&&(R.preventDefault(),F(R))},[C,S]),T=g.useCallback(()=>{c(S)},[c,S]),D=g.useCallback(function(V={},F=null){return{...V,type:"button",ref:ct(x,u,F),id:h,disabled:!!t,"aria-expanded":!!k,"aria-controls":y,onClick:Ee(V.onClick,P),onFocus:Ee(V.onFocus,T),onKeyDown:Ee(V.onKeyDown,M)}},[h,t,k,P,T,M,y,x]),_=g.useCallback(function(V={},F=null){return{...V,ref:F,role:"region",id:y,"aria-labelledby":h,hidden:!k}},[h,k,y]);return{isOpen:k,isDisabled:t,isFocusable:n,onOpen:j,onClose:I,getButtonProps:D,getPanelProps:_,htmlProps:o}}function ow(e){const t=e.index||e.defaultIndex,n=t!=null&&!Array.isArray(t)&&e.allowMultiple;ts({condition:!!n,message:`If 'allowMultiple' is passed, then 'index' or 'defaultIndex' must be an array. You passed: ${typeof t},`})}function iw(e){ts({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 aw(e){ts({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 sw(e){ts({condition:e.isOpen&&!!e.isDisabled,message:"Cannot open a disabled accordion item"})}function Ai(e){const{isOpen:t,isDisabled:n}=th(),{reduceMotion:r}=rh(),o=Ae("chakra-accordion__icon",e.className),s=Cc(),c={opacity:n?.4:1,transform:t?"rotate(-180deg)":void 0,transition:r?void 0:"transform 0.2s",transformOrigin:"center",...s.icon};return l.jsx(tn,{viewBox:"0 0 24 24","aria-hidden":!0,className:o,__css:c,...e,children:l.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})})}Ai.displayName="AccordionIcon";var Oi=fe(function(t,n){const{children:r,className:o}=t,{htmlProps:s,...c}=rw(t),f={...Cc().container,overflowAnchor:"none"},p=g.useMemo(()=>c,[c]);return l.jsx(QC,{value:p,children:l.jsx(re.div,{ref:n,...s,className:Ae("chakra-accordion__item",o),__css:f,children:typeof r=="function"?r({isExpanded:!!c.isOpen,isDisabled:!!c.isDisabled}):r})})});Oi.displayName="AccordionItem";var Bo={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},Ma={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 df(e){var t;switch((t=e==null?void 0:e.direction)!=null?t:"right"){case"right":return Ma.slideRight;case"left":return Ma.slideLeft;case"bottom":return Ma.slideDown;case"top":return Ma.slideUp;default:return Ma.slideRight}}var Uo={enter:{duration:.2,ease:Bo.easeOut},exit:{duration:.1,ease:Bo.easeIn}},nr={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})},lw=e=>e!=null&&parseInt(e.toString(),10)>0,Kv={exit:{height:{duration:.2,ease:Bo.ease},opacity:{duration:.3,ease:Bo.ease}},enter:{height:{duration:.3,ease:Bo.ease},opacity:{duration:.4,ease:Bo.ease}}},cw={exit:({animateOpacity:e,startingHeight:t,transition:n,transitionEnd:r,delay:o})=>{var s;return{...e&&{opacity:lw(t)?1:0},height:t,transitionEnd:r==null?void 0:r.exit,transition:(s=n==null?void 0:n.exit)!=null?s:nr.exit(Kv.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:nr.enter(Kv.enter,o)}}},m2=g.forwardRef((e,t)=>{const{in:n,unmountOnExit:r,animateOpacity:o=!0,startingHeight:s=0,endingHeight:c="auto",style:u,className:f,transition:p,transitionEnd:h,...y}=e,[x,S]=g.useState(!1);g.useEffect(()=>{const I=setTimeout(()=>{S(!0)});return()=>clearTimeout(I)},[]),ts({condition:Boolean(s>0&&r),message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const C=parseFloat(s.toString())>0,k={startingHeight:s,endingHeight:c,animateOpacity:o,transition:x?p:{enter:{duration:0}},transitionEnd:{enter:h==null?void 0:h.enter,exit:r?h==null?void 0:h.exit:{...h==null?void 0:h.exit,display:C?"block":"none"}}},w=r?n:!0,j=n||r?"enter":"exit";return l.jsx(yo,{initial:!1,custom:k,children:w&&l.jsx(ir.div,{ref:t,...y,className:Ae("chakra-collapse",f),style:{overflow:"hidden",display:"block",...u},custom:k,variants:cw,initial:r?"exit":!1,animate:j,exit:"exit"})})});m2.displayName="Collapse";var uw={enter:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:1,transition:(r=e==null?void 0:e.enter)!=null?r:nr.enter(Uo.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:nr.exit(Uo.exit,n),transitionEnd:t==null?void 0:t.exit}}},v2={initial:"exit",animate:"enter",exit:"exit",variants:uw},dw=g.forwardRef(function(t,n){const{unmountOnExit:r,in:o,className:s,transition:c,transitionEnd:u,delay:f,...p}=t,h=o||r?"enter":"exit",y=r?o&&r:!0,x={transition:c,transitionEnd:u,delay:f};return l.jsx(yo,{custom:x,children:y&&l.jsx(ir.div,{ref:n,className:Ae("chakra-fade",s),custom:x,...v2,animate:h,...p})})});dw.displayName="Fade";var fw={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:nr.exit(Uo.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:nr.enter(Uo.enter,n),transitionEnd:e==null?void 0:e.enter}}},g2={initial:"exit",animate:"enter",exit:"exit",variants:fw},hw=g.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:s=!0,initialScale:c=.95,className:u,transition:f,transitionEnd:p,delay:h,...y}=t,x=r?o&&r:!0,S=o||r?"enter":"exit",C={initialScale:c,reverse:s,transition:f,transitionEnd:p,delay:h};return l.jsx(yo,{custom:C,children:x&&l.jsx(ir.div,{ref:n,className:Ae("chakra-offset-slide",u),...g2,animate:S,custom:C,...y})})});hw.displayName="ScaleFade";var pw={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:nr.exit(Uo.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:nr.enter(Uo.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({offsetY:e,offsetX:t,transition:n,transitionEnd:r,reverse:o,delay:s})=>{var c;const u={x:t,y:e};return{opacity:0,transition:(c=n==null?void 0:n.exit)!=null?c:nr.exit(Uo.exit,s),...o?{...u,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{...u,...r==null?void 0:r.exit}}}}},ff={initial:"initial",animate:"enter",exit:"exit",variants:pw},mw=g.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:s=!0,className:c,offsetX:u=0,offsetY:f=8,transition:p,transitionEnd:h,delay:y,...x}=t,S=r?o&&r:!0,C=o||r?"enter":"exit",k={offsetX:u,offsetY:f,reverse:s,transition:p,transitionEnd:h,delay:y};return l.jsx(yo,{custom:k,children:S&&l.jsx(ir.div,{ref:n,className:Ae("chakra-offset-slide",c),custom:k,...ff,animate:C,...x})})});mw.displayName="SlideFade";var Xv={exit:{duration:.15,ease:Bo.easeInOut},enter:{type:"spring",damping:25,stiffness:180}},vw={exit:({direction:e,transition:t,transitionEnd:n,delay:r})=>{var o;const{exit:s}=df({direction:e});return{...s,transition:(o=t==null?void 0:t.exit)!=null?o:nr.exit(Xv.exit,r),transitionEnd:n==null?void 0:n.exit}},enter:({direction:e,transitionEnd:t,transition:n,delay:r})=>{var o;const{enter:s}=df({direction:e});return{...s,transition:(o=n==null?void 0:n.enter)!=null?o:nr.enter(Xv.enter,r),transitionEnd:t==null?void 0:t.enter}}},y2=g.forwardRef(function(t,n){const{direction:r="right",style:o,unmountOnExit:s,in:c,className:u,transition:f,transitionEnd:p,delay:h,motionProps:y,...x}=t,S=df({direction:r}),C=Object.assign({position:"fixed"},S.position,o),k=s?c&&s:!0,w=c||s?"enter":"exit",j={transitionEnd:p,transition:f,direction:r,delay:h};return l.jsx(yo,{custom:j,children:k&&l.jsx(ir.div,{...x,ref:n,initial:"exit",className:Ae("chakra-slide",u),animate:w,exit:"exit",custom:j,variants:vw,style:C,...y})})});y2.displayName="Slide";var zi=fe(function(t,n){const{className:r,motionProps:o,...s}=t,{reduceMotion:c}=rh(),{getPanelProps:u,isOpen:f}=th(),p=u(s,n),h=Ae("chakra-accordion__panel",r),y=Cc();c||delete p.hidden;const x=l.jsx(re.div,{...p,__css:y.panel,className:h});return c?x:l.jsx(m2,{in:f,...o,children:x})});zi.displayName="AccordionPanel";var oh=fe(function({children:t,reduceMotion:n,...r},o){const s=un("Accordion",r),c=At(r),{htmlProps:u,descendants:f,...p}=tw(c),h=g.useMemo(()=>({...p,reduceMotion:!!n}),[p,n]);return l.jsx(ZC,{value:f,children:l.jsx(nw,{value:h,children:l.jsx(XC,{value:s,children:l.jsx(re.div,{ref:o,...u,className:Ae("chakra-accordion",r.className),__css:s.root,children:t})})})})});oh.displayName="Accordion";var hf=fe(function(t,n){const{htmlWidth:r,htmlHeight:o,alt:s,...c}=t;return l.jsx("img",{width:r,height:o,ref:n,alt:s,...c})});hf.displayName="NativeImage";function gw(e){const{loading:t,src:n,srcSet:r,onLoad:o,onError:s,crossOrigin:c,sizes:u,ignoreFallback:f}=e,[p,h]=g.useState("pending");g.useEffect(()=>{h(n?"loading":"pending")},[n]);const y=g.useRef(),x=g.useCallback(()=>{if(!n)return;S();const C=new Image;C.src=n,c&&(C.crossOrigin=c),r&&(C.srcset=r),u&&(C.sizes=u),t&&(C.loading=t),C.onload=k=>{S(),h("loaded"),o==null||o(k)},C.onerror=k=>{S(),h("failed"),s==null||s(k)},y.current=C},[n,c,r,u,o,s,t]),S=()=>{y.current&&(y.current.onload=null,y.current.onerror=null,y.current=null)};return Bi(()=>{if(!f)return p==="loading"&&x(),()=>{S()}},[p,x,f]),f?"loaded":p}var yw=(e,t)=>e!=="loaded"&&t==="beforeLoadOrError"||e==="failed"&&t==="onError";function xw(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var ls=fe(function(t,n){const{fallbackSrc:r,fallback:o,src:s,srcSet:c,align:u,fit:f,loading:p,ignoreFallback:h,crossOrigin:y,fallbackStrategy:x="beforeLoadOrError",referrerPolicy:S,...C}=t,k=r!==void 0||o!==void 0,w=p!=null||h||!k,j=gw({...t,ignoreFallback:w}),I=yw(j,x),P={ref:n,objectFit:f,objectPosition:u,...w?C:xw(C,["onError","onLoad"])};return I?o||l.jsx(re.img,{as:hf,className:"chakra-image__placeholder",src:r,...P}):l.jsx(re.img,{as:hf,src:s,srcSet:c,crossOrigin:y,loading:p,referrerPolicy:S,className:"chakra-image",...P})});ls.displayName="Image";function ih(e){return g.Children.toArray(e).filter(t=>g.isValidElement(t))}var[bw,Sw]=jt({strict:!1,name:"ButtonGroupContext"}),Cw={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}}},ww={horizontal:e=>({"& > *:not(style) ~ *:not(style)":{marginStart:e}}),vertical:e=>({"& > *:not(style) ~ *:not(style)":{marginTop:e}})},Qt=fe(function(t,n){const{size:r,colorScheme:o,variant:s,className:c,spacing:u="0.5rem",isAttached:f,isDisabled:p,orientation:h="horizontal",...y}=t,x=Ae("chakra-button__group",c),S=g.useMemo(()=>({size:r,colorScheme:o,variant:s,isDisabled:p}),[r,o,s,p]);let C={display:"inline-flex",...f?Cw[h]:ww[h](u)};const k=h==="vertical";return l.jsx(bw,{value:S,children:l.jsx(re.div,{ref:n,role:"group",__css:C,className:x,"data-attached":f?"":void 0,"data-orientation":h,flexDir:k?"column":void 0,...y})})});Qt.displayName="ButtonGroup";function kw(e){const[t,n]=g.useState(!e);return{ref:g.useCallback(s=>{s&&n(s.tagName==="BUTTON")},[]),type:t?"button":void 0}}function pf(e){const{children:t,className:n,...r}=e,o=g.isValidElement(t)?g.cloneElement(t,{"aria-hidden":!0,focusable:!1}):t,s=Ae("chakra-button__icon",n);return l.jsx(re.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...r,className:s,children:o})}pf.displayName="ButtonIcon";function tc(e){const{label:t,placement:n,spacing:r="0.5rem",children:o=l.jsx(Xf,{color:"currentColor",width:"1em",height:"1em"}),className:s,__css:c,...u}=e,f=Ae("chakra-button__spinner",s),p=n==="start"?"marginEnd":"marginStart",h=g.useMemo(()=>({display:"flex",alignItems:"center",position:t?"relative":"absolute",[p]:t?r:0,fontSize:"1em",lineHeight:"normal",...c}),[c,t,p,r]);return l.jsx(re.div,{className:f,...u,__css:h,children:o})}tc.displayName="ButtonSpinner";var ti=fe((e,t)=>{const n=Sw(),r=go("Button",{...n,...e}),{isDisabled:o=n==null?void 0:n.isDisabled,isLoading:s,isActive:c,children:u,leftIcon:f,rightIcon:p,loadingText:h,iconSpacing:y="0.5rem",type:x,spinner:S,spinnerPlacement:C="start",className:k,as:w,...j}=At(e),I=g.useMemo(()=>{const D={...r==null?void 0:r._focus,zIndex:1};return{display:"inline-flex",appearance:"none",alignItems:"center",justifyContent:"center",userSelect:"none",position:"relative",whiteSpace:"nowrap",verticalAlign:"middle",outline:"none",...r,...!!n&&{_focus:D}}},[r,n]),{ref:P,type:M}=kw(w),T={rightIcon:p,leftIcon:f,iconSpacing:y,children:u};return l.jsxs(re.button,{ref:GC(t,P),as:w,type:x??M,"data-active":qe(c),"data-loading":qe(s),__css:I,className:Ae("chakra-button",k),...j,disabled:o||s,children:[s&&C==="start"&&l.jsx(tc,{className:"chakra-button__spinner--start",label:h,placement:"start",spacing:y,children:S}),s?h||l.jsx(re.span,{opacity:0,children:l.jsx(Qv,{...T})}):l.jsx(Qv,{...T}),s&&C==="end"&&l.jsx(tc,{className:"chakra-button__spinner--end",label:h,placement:"end",spacing:y,children:S})]})});ti.displayName="Button";function Qv(e){const{leftIcon:t,rightIcon:n,children:r,iconSpacing:o}=e;return l.jsxs(l.Fragment,{children:[t&&l.jsx(pf,{marginEnd:o,children:t}),r,n&&l.jsx(pf,{marginStart:o,children:n})]})}var fo=fe((e,t)=>{const{icon:n,children:r,isRound:o,"aria-label":s,...c}=e,u=n||r,f=g.isValidElement(u)?g.cloneElement(u,{"aria-hidden":!0,focusable:!1}):null;return l.jsx(ti,{padding:"0",borderRadius:o?"full":void 0,ref:t,"aria-label":s,...c,children:f})});fo.displayName="IconButton";var[nL,jw]=jt({name:"CheckboxGroupContext",strict:!1});function Ew(e){return l.jsx(re.svg,{width:"1.2em",viewBox:"0 0 12 10",style:{fill:"none",strokeWidth:2,stroke:"currentColor",strokeDasharray:16},...e,children:l.jsx("polyline",{points:"1.5 6 4.5 9 10.5 1"})})}function Pw(e){return l.jsx(re.svg,{width:"1.2em",viewBox:"0 0 24 24",style:{stroke:"currentColor",strokeWidth:4},...e,children:l.jsx("line",{x1:"21",x2:"3",y1:"12",y2:"12"})})}function Iw(e){const{isIndeterminate:t,isChecked:n,...r}=e,o=t?Pw:Ew;return n||t?l.jsx(re.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:l.jsx(o,{...r})}):null}var[Mw,x2]=jt({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "<FormControl />" `}),[Tw,ni]=jt({strict:!1,name:"FormControlContext"});function _w(e){const{id:t,isRequired:n,isInvalid:r,isDisabled:o,isReadOnly:s,...c}=e,u=g.useId(),f=t||`field-${u}`,p=`${f}-label`,h=`${f}-feedback`,y=`${f}-helptext`,[x,S]=g.useState(!1),[C,k]=g.useState(!1),[w,j]=g.useState(!1),I=g.useCallback((_={},R=null)=>({id:y,..._,ref:ct(R,V=>{V&&k(!0)})}),[y]),P=g.useCallback((_={},R=null)=>{var V,F;return{..._,ref:R,"data-focus":qe(w),"data-disabled":qe(o),"data-invalid":qe(r),"data-readonly":qe(s),id:(V=_.id)!=null?V:p,htmlFor:(F=_.htmlFor)!=null?F:f}},[f,o,w,r,s,p]),M=g.useCallback((_={},R=null)=>({id:h,..._,ref:ct(R,V=>{V&&S(!0)}),"aria-live":"polite"}),[h]),T=g.useCallback((_={},R=null)=>({..._,...c,ref:R,role:"group"}),[c]),D=g.useCallback((_={},R=null)=>({..._,ref:R,role:"presentation","aria-hidden":!0,children:_.children||"*"}),[]);return{isRequired:!!n,isInvalid:!!r,isReadOnly:!!s,isDisabled:!!o,isFocused:!!w,onFocus:()=>j(!0),onBlur:()=>j(!1),hasFeedbackText:x,setHasFeedbackText:S,hasHelpText:C,setHasHelpText:k,id:f,labelId:p,feedbackId:h,helpTextId:y,htmlProps:c,getHelpTextProps:I,getErrorMessageProps:M,getRootProps:T,getLabelProps:P,getRequiredIndicatorProps:D}}var rt=fe(function(t,n){const r=un("Form",t),o=At(t),{getRootProps:s,htmlProps:c,...u}=_w(o),f=Ae("chakra-form-control",t.className);return l.jsx(Tw,{value:u,children:l.jsx(Mw,{value:r,children:l.jsx(re.div,{...s({},n),className:f,__css:r.container})})})});rt.displayName="FormControl";var pn=fe(function(t,n){const r=ni(),o=x2(),s=Ae("chakra-form__helper-text",t.className);return l.jsx(re.div,{...r==null?void 0:r.getHelpTextProps(t,n),__css:o.helperText,className:s})});pn.displayName="FormHelperText";var[Dw,Aw]=jt({name:"FormErrorStylesContext",errorMessage:`useFormErrorStyles returned is 'undefined'. Seems you forgot to wrap the components in "<FormError />" `}),mn=fe((e,t)=>{const n=un("FormError",e),r=At(e),o=ni();return o!=null&&o.isInvalid?l.jsx(Dw,{value:n,children:l.jsx(re.div,{...o==null?void 0:o.getErrorMessageProps(r,t),className:Ae("chakra-form__error-message",e.className),__css:{display:"flex",alignItems:"center",...n.text}})}):null});mn.displayName="FormErrorMessage";var Ow=fe((e,t)=>{const n=Aw(),r=ni();if(!(r!=null&&r.isInvalid))return null;const o=Ae("chakra-form__error-icon",e.className);return l.jsx(tn,{ref:t,"aria-hidden":!0,...e,__css:n.icon,className:o,children:l.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"})})});Ow.displayName="FormErrorIcon";var st=fe(function(t,n){var r;const o=go("FormLabel",t),s=At(t),{className:c,children:u,requiredIndicator:f=l.jsx(b2,{}),optionalIndicator:p=null,...h}=s,y=ni(),x=(r=y==null?void 0:y.getLabelProps(h,n))!=null?r:{ref:n,...h};return l.jsxs(re.label,{...x,className:Ae("chakra-form__label",s.className),__css:{display:"block",textAlign:"start",...o},children:[u,y!=null&&y.isRequired?f:p]})});st.displayName="FormLabel";var b2=fe(function(t,n){const r=ni(),o=x2();if(!(r!=null&&r.isRequired))return null;const s=Ae("chakra-form__required-indicator",t.className);return l.jsx(re.span,{...r==null?void 0:r.getRequiredIndicatorProps(t,n),__css:o.requiredIndicator,className:s})});b2.displayName="RequiredIndicator";function ah(e){const{isDisabled:t,isInvalid:n,isReadOnly:r,isRequired:o,...s}=sh(e);return{...s,disabled:t,readOnly:r,required:o,"aria-invalid":Rr(n),"aria-required":Rr(o),"aria-readonly":Rr(r)}}function sh(e){var t,n,r;const o=ni(),{id:s,disabled:c,readOnly:u,required:f,isRequired:p,isInvalid:h,isReadOnly:y,isDisabled:x,onFocus:S,onBlur:C,...k}=e,w=e["aria-describedby"]?[e["aria-describedby"]]:[];return o!=null&&o.hasFeedbackText&&(o!=null&&o.isInvalid)&&w.push(o.feedbackId),o!=null&&o.hasHelpText&&w.push(o.helpTextId),{...k,"aria-describedby":w.join(" ")||void 0,id:s??(o==null?void 0:o.id),isDisabled:(t=c??x)!=null?t:o==null?void 0:o.isDisabled,isReadOnly:(n=u??y)!=null?n:o==null?void 0:o.isReadOnly,isRequired:(r=f??p)!=null?r:o==null?void 0:o.isRequired,isInvalid:h??(o==null?void 0:o.isInvalid),onFocus:Ee(o==null?void 0:o.onFocus,S),onBlur:Ee(o==null?void 0:o.onBlur,C)}}var lh={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},S2=re("span",{baseStyle:lh});S2.displayName="VisuallyHidden";var zw=re("input",{baseStyle:lh});zw.displayName="VisuallyHiddenInput";var Zv=!1,cs=null,Ko=!1,mf=!1,vf=new Set;function ch(e,t){vf.forEach(n=>n(e,t))}var Rw=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function Nw(e){return!(e.metaKey||!Rw&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function Jv(e){Ko=!0,Nw(e)&&(cs="keyboard",ch("keyboard",e))}function wi(e){if(cs="pointer",e.type==="mousedown"||e.type==="pointerdown"){Ko=!0;const t=e.composedPath?e.composedPath()[0]:e.target;let n=!1;try{n=t.matches(":focus-visible")}catch{}if(n)return;ch("pointer",e)}}function Fw(e){return e.mozInputSource===0&&e.isTrusted?!0:e.detail===0&&!e.pointerType}function Lw(e){Fw(e)&&(Ko=!0,cs="virtual")}function Bw(e){e.target===window||e.target===document||(!Ko&&!mf&&(cs="virtual",ch("virtual",e)),Ko=!1,mf=!1)}function Hw(){Ko=!1,mf=!0}function eg(){return cs!=="pointer"}function Ww(){if(typeof window>"u"||Zv)return;const{focus:e}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...n){Ko=!0,e.apply(this,n)},document.addEventListener("keydown",Jv,!0),document.addEventListener("keyup",Jv,!0),document.addEventListener("click",Lw,!0),window.addEventListener("focus",Bw,!0),window.addEventListener("blur",Hw,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",wi,!0),document.addEventListener("pointermove",wi,!0),document.addEventListener("pointerup",wi,!0)):(document.addEventListener("mousedown",wi,!0),document.addEventListener("mousemove",wi,!0),document.addEventListener("mouseup",wi,!0)),Zv=!0}function C2(e){Ww(),e(eg());const t=()=>e(eg());return vf.add(t),()=>{vf.delete(t)}}function Vw(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function w2(e={}){const t=sh(e),{isDisabled:n,isReadOnly:r,isRequired:o,isInvalid:s,id:c,onBlur:u,onFocus:f,"aria-describedby":p}=t,{defaultChecked:h,isChecked:y,isFocusable:x,onChange:S,isIndeterminate:C,name:k,value:w,tabIndex:j=void 0,"aria-label":I,"aria-labelledby":P,"aria-invalid":M,...T}=e,D=Vw(T,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),_=Wt(S),R=Wt(u),V=Wt(f),[F,L]=g.useState(!1),[Q,U]=g.useState(!1),[K,te]=g.useState(!1),[ne,$]=g.useState(!1);g.useEffect(()=>C2(L),[]);const Z=g.useRef(null),[oe,le]=g.useState(!0),[Re,Ne]=g.useState(!!h),Ie=y!==void 0,pe=Ie?y:Re,ce=g.useCallback(ye=>{if(r||n){ye.preventDefault();return}Ie||Ne(pe?ye.target.checked:C?!0:ye.target.checked),_==null||_(ye)},[r,n,pe,Ie,C,_]);Bi(()=>{Z.current&&(Z.current.indeterminate=Boolean(C))},[C]),ei(()=>{n&&U(!1)},[n,U]),Bi(()=>{const ye=Z.current;ye!=null&&ye.form&&(ye.form.onreset=()=>{Ne(!!h)})},[]);const Fe=n&&!x,Ve=g.useCallback(ye=>{ye.key===" "&&$(!0)},[$]),Ue=g.useCallback(ye=>{ye.key===" "&&$(!1)},[$]);Bi(()=>{if(!Z.current)return;Z.current.checked!==pe&&Ne(Z.current.checked)},[Z.current]);const $e=g.useCallback((ye={},Pe=null)=>{const et=Be=>{Q&&Be.preventDefault(),$(!0)};return{...ye,ref:Pe,"data-active":qe(ne),"data-hover":qe(K),"data-checked":qe(pe),"data-focus":qe(Q),"data-focus-visible":qe(Q&&F),"data-indeterminate":qe(C),"data-disabled":qe(n),"data-invalid":qe(s),"data-readonly":qe(r),"aria-hidden":!0,onMouseDown:Ee(ye.onMouseDown,et),onMouseUp:Ee(ye.onMouseUp,()=>$(!1)),onMouseEnter:Ee(ye.onMouseEnter,()=>te(!0)),onMouseLeave:Ee(ye.onMouseLeave,()=>te(!1))}},[ne,pe,n,Q,F,K,C,s,r]),Qe=g.useCallback((ye={},Pe=null)=>({...D,...ye,ref:ct(Pe,et=>{et&&le(et.tagName==="LABEL")}),onClick:Ee(ye.onClick,()=>{var et;oe||((et=Z.current)==null||et.click(),requestAnimationFrame(()=>{var Be;(Be=Z.current)==null||Be.focus()}))}),"data-disabled":qe(n),"data-checked":qe(pe),"data-invalid":qe(s)}),[D,n,pe,s,oe]),ge=g.useCallback((ye={},Pe=null)=>({...ye,ref:ct(Z,Pe),type:"checkbox",name:k,value:w,id:c,tabIndex:j,onChange:Ee(ye.onChange,ce),onBlur:Ee(ye.onBlur,R,()=>U(!1)),onFocus:Ee(ye.onFocus,V,()=>U(!0)),onKeyDown:Ee(ye.onKeyDown,Ve),onKeyUp:Ee(ye.onKeyUp,Ue),required:o,checked:pe,disabled:Fe,readOnly:r,"aria-label":I,"aria-labelledby":P,"aria-invalid":M?Boolean(M):s,"aria-describedby":p,"aria-disabled":n,style:lh}),[k,w,c,ce,R,V,Ve,Ue,o,pe,Fe,r,I,P,M,s,p,n,j]),Te=g.useCallback((ye={},Pe=null)=>({...ye,ref:Pe,onMouseDown:Ee(ye.onMouseDown,tg),onTouchStart:Ee(ye.onTouchStart,tg),"data-disabled":qe(n),"data-checked":qe(pe),"data-invalid":qe(s)}),[pe,n,s]);return{state:{isInvalid:s,isFocused:Q,isChecked:pe,isActive:ne,isHovered:K,isIndeterminate:C,isDisabled:n,isReadOnly:r,isRequired:o},getRootProps:Qe,getCheckboxProps:$e,getInputProps:ge,getLabelProps:Te,htmlProps:D}}function tg(e){e.preventDefault(),e.stopPropagation()}var Uw={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},$w={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},Gw=Jo({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),qw=Jo({from:{opacity:0},to:{opacity:1}}),Yw=Jo({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),k2=fe(function(t,n){const r=jw(),o={...r,...t},s=un("Checkbox",o),c=At(t),{spacing:u="0.5rem",className:f,children:p,iconColor:h,iconSize:y,icon:x=l.jsx(Iw,{}),isChecked:S,isDisabled:C=r==null?void 0:r.isDisabled,onChange:k,inputProps:w,...j}=c;let I=S;r!=null&&r.value&&c.value&&(I=r.value.includes(c.value));let P=k;r!=null&&r.onChange&&c.value&&(P=yc(r.onChange,k));const{state:M,getInputProps:T,getCheckboxProps:D,getLabelProps:_,getRootProps:R}=w2({...j,isDisabled:C,isChecked:I,onChange:P}),V=g.useMemo(()=>({animation:M.isIndeterminate?`${qw} 20ms linear, ${Yw} 200ms linear`:`${Gw} 200ms linear`,fontSize:y,color:h,...s.icon}),[h,y,,M.isIndeterminate,s.icon]),F=g.cloneElement(x,{__css:V,isIndeterminate:M.isIndeterminate,isChecked:M.isChecked});return l.jsxs(re.label,{__css:{...$w,...s.container},className:Ae("chakra-checkbox",f),...R(),children:[l.jsx("input",{className:"chakra-checkbox__input",...T(w,n)}),l.jsx(re.span,{__css:{...Uw,...s.control},className:"chakra-checkbox__control",...D(),children:F}),p&&l.jsx(re.span,{className:"chakra-checkbox__label",..._(),__css:{marginStart:u,...s.label},children:p})]})});k2.displayName="Checkbox";function Kw(e){const t=parseFloat(e);return typeof t!="number"||Number.isNaN(t)?0:t}function uh(e,t){let n=Kw(e);const r=10**(t??10);return n=Math.round(n*r)/r,t?n.toFixed(t):n.toString()}function gf(e){if(!Number.isFinite(e))return 0;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n+=1;return n}function ng(e,t,n){return(e-t)*100/(n-t)}function Xw(e,t,n){return(n-t)*e+t}function rg(e,t,n){const r=Math.round((e-t)/n)*n+t,o=gf(n);return uh(r,o)}function Hl(e,t,n){return e==null?e:(n<t&&console.warn("clamp: max cannot be less than min"),Math.min(Math.max(e,t),n))}function Qw(e={}){const{onChange:t,precision:n,defaultValue:r,value:o,step:s=1,min:c=Number.MIN_SAFE_INTEGER,max:u=Number.MAX_SAFE_INTEGER,keepWithinRange:f=!0}=e,p=Wt(t),[h,y]=g.useState(()=>{var F;return r==null?"":(F=md(r,s,n))!=null?F:""}),x=typeof o<"u",S=x?o:h,C=j2(oo(S),s),k=n??C,w=g.useCallback(F=>{F!==S&&(x||y(F.toString()),p==null||p(F.toString(),oo(F)))},[p,x,S]),j=g.useCallback(F=>{let L=F;return f&&(L=Hl(L,c,u)),uh(L,k)},[k,f,u,c]),I=g.useCallback((F=s)=>{let L;S===""?L=oo(F):L=oo(S)+F,L=j(L),w(L)},[j,s,w,S]),P=g.useCallback((F=s)=>{let L;S===""?L=oo(-F):L=oo(S)-F,L=j(L),w(L)},[j,s,w,S]),M=g.useCallback(()=>{var F;let L;r==null?L="":L=(F=md(r,s,n))!=null?F:c,w(L)},[r,n,s,w,c]),T=g.useCallback(F=>{var L;const Q=(L=md(F,s,k))!=null?L:c;w(Q)},[k,s,w,c]),D=oo(S);return{isOutOfRange:D>u||D<c,isAtMax:D===u,isAtMin:D===c,precision:k,value:S,valueAsNumber:D,update:w,reset:M,increment:I,decrement:P,clamp:j,cast:T,setValue:y}}function oo(e){return parseFloat(e.toString().replace(/[^\w.-]+/g,""))}function j2(e,t){return Math.max(gf(t),gf(e))}function md(e,t,n){const r=oo(e);if(Number.isNaN(r))return;const o=j2(r,t);return uh(r,n??o)}function $o(e,t,n,r){const o=Wt(n);return g.useEffect(()=>{const s=typeof e=="function"?e():e??document;if(!(!n||!s))return s.addEventListener(t,o,r),()=>{s.removeEventListener(t,o,r)}},[t,e,r,o,n]),()=>{const s=typeof e=="function"?e():e??document;s==null||s.removeEventListener(t,o,r)}}function Zw(e){return"current"in e}var E2=()=>typeof window<"u";function Jw(){var e;const t=navigator.userAgentData;return(e=t==null?void 0:t.platform)!=null?e:navigator.platform}var e5=e=>E2()&&e.test(navigator.vendor),t5=e=>E2()&&e.test(Jw()),n5=()=>t5(/mac|iphone|ipad|ipod/i),r5=()=>n5()&&e5(/apple/i);function o5(e){const{ref:t,elements:n,enabled:r}=e,o=()=>{var s,c;return(c=(s=t.current)==null?void 0:s.ownerDocument)!=null?c:document};$o(o,"pointerdown",s=>{if(!r5()||!r)return;const c=s.target,f=(n??[t]).some(p=>{const h=Zw(p)?p.current:p;return(h==null?void 0:h.contains(c))||h===c});o().activeElement!==c&&f&&(s.preventDefault(),c.focus())})}var lt={},i5={get exports(){return lt},set exports(e){lt=e}},a5="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",s5=a5,l5=s5;function P2(){}function I2(){}I2.resetWarningCache=P2;var c5=function(){function e(r,o,s,c,u,f){if(f!==l5){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:I2,resetWarningCache:P2};return n.PropTypes=n,n};i5.exports=c5();var yf="data-focus-lock",M2="data-focus-lock-disabled",u5="data-no-focus-lock",d5="data-autofocus-inside",f5="data-no-autofocus";function h5(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function p5(e,t){var n=g.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 T2(e,t){return p5(t||null,function(n){return e.forEach(function(r){return h5(r,n)})})}var vd={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"},yr=function(){return yr=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},yr.apply(this,arguments)};function _2(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 ta(e,t,n,r){function o(s){return s instanceof n?s:new n(function(c){c(s)})}return new(n||(n=Promise))(function(s,c){function u(h){try{p(r.next(h))}catch(y){c(y)}}function f(h){try{p(r.throw(h))}catch(y){c(y)}}function p(h){h.done?s(h.value):o(h.value).then(u,f)}p((r=r.apply(e,t||[])).next())})}function na(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,o,s,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(p){return function(h){return f([p,h])}}function f(p){if(r)throw new TypeError("Generator is already executing.");for(;c&&(c=0,p[0]&&(n=0)),n;)try{if(r=1,o&&(s=p[0]&2?o.return:p[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,p[1])).done)return s;switch(o=0,s&&(p=[p[0]&2,s.value]),p[0]){case 0:case 1:s=p;break;case 4:return n.label++,{value:p[1],done:!1};case 5:n.label++,o=p[1],p=[0];continue;case 7:p=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(p[0]===6||p[0]===2)){n=0;continue}if(p[0]===3&&(!s||p[1]>s[0]&&p[1]<s[3])){n.label=p[1];break}if(p[0]===6&&n.label<s[1]){n.label=s[1],s=p;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(p);break}s[2]&&n.ops.pop(),n.trys.pop();continue}p=t.call(e,n)}catch(h){p=[6,h],o=0}finally{r=s=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}}function og(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,s=[],c;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)s.push(o.value)}catch(u){c={error:u}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(c)throw c.error}}return s}function xf(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 D2(e){return e}function A2(e,t){t===void 0&&(t=D2);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 c=t(s,r);return n.push(c),function(){n=n.filter(function(u){return u!==c})}},assignSyncMedium:function(s){for(r=!0;n.length;){var c=n;n=[],c.forEach(s)}n={push:function(u){return s(u)},filter:function(){return n}}},assignMedium:function(s){r=!0;var c=[];if(n.length){var u=n;n=[],u.forEach(s),c=n}var f=function(){var h=c;c=[],h.forEach(s)},p=function(){return Promise.resolve().then(f)};p(),n={push:function(h){c.push(h),p()},filter:function(h){return c=c.filter(h),n}}}};return o}function dh(e,t){return t===void 0&&(t=D2),A2(e,t)}function O2(e){e===void 0&&(e={});var t=A2(null);return t.options=yr({async:!0,ssr:!1},e),t}var z2=function(e){var t=e.sideCar,n=_2(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 g.createElement(r,yr({},n))};z2.isSideCarExport=!0;function m5(e,t){return e.useMedium(t),z2}var R2=dh({},function(e){var t=e.target,n=e.currentTarget;return{target:t,currentTarget:n}}),N2=dh(),v5=dh(),g5=O2({async:!0}),y5=[],fh=g.forwardRef(function(t,n){var r,o=g.useState(),s=o[0],c=o[1],u=g.useRef(),f=g.useRef(!1),p=g.useRef(null),h=t.children,y=t.disabled,x=t.noFocusGuards,S=t.persistentFocus,C=t.crossFrame,k=t.autoFocus;t.allowTextSelection;var w=t.group,j=t.className,I=t.whiteList,P=t.hasPositiveIndices,M=t.shards,T=M===void 0?y5:M,D=t.as,_=D===void 0?"div":D,R=t.lockProps,V=R===void 0?{}:R,F=t.sideCar,L=t.returnFocus,Q=t.focusOptions,U=t.onActivation,K=t.onDeactivation,te=g.useState({}),ne=te[0],$=g.useCallback(function(){p.current=p.current||document&&document.activeElement,u.current&&U&&U(u.current),f.current=!0},[U]),Z=g.useCallback(function(){f.current=!1,K&&K(u.current)},[K]);g.useEffect(function(){y||(p.current=null)},[]);var oe=g.useCallback(function(Ve){var Ue=p.current;if(Ue&&Ue.focus){var $e=typeof L=="function"?L(Ue):L;if($e){var Qe=typeof $e=="object"?$e:void 0;p.current=null,Ve?Promise.resolve().then(function(){return Ue.focus(Qe)}):Ue.focus(Qe)}}},[L]),le=g.useCallback(function(Ve){f.current&&R2.useMedium(Ve)},[]),Re=N2.useMedium,Ne=g.useCallback(function(Ve){u.current!==Ve&&(u.current=Ve,c(Ve))},[]),Ie=Yd((r={},r[M2]=y&&"disabled",r[yf]=w,r),V),pe=x!==!0,ce=pe&&x!=="tail",Fe=T2([n,Ne]);return g.createElement(g.Fragment,null,pe&&[g.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:y?-1:0,style:vd}),P?g.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:y?-1:1,style:vd}):null],!y&&g.createElement(F,{id:ne,sideCar:g5,observed:s,disabled:y,persistentFocus:S,crossFrame:C,autoFocus:k,whiteList:I,shards:T,onActivation:$,onDeactivation:Z,returnFocus:oe,focusOptions:Q}),g.createElement(_,Yd({ref:Fe},Ie,{className:j,onBlur:Re,onFocus:le}),h),ce&&g.createElement("div",{"data-focus-guard":!0,tabIndex:y?-1:0,style:vd}))});fh.propTypes={};fh.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 F2=fh;function x5(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,RS(e,t)}function b5(e,t){function n(r){return r.displayName||r.name||"Component"}return function(o){var s=[],c;function u(){c=e(s.map(function(p){return p.props})),t(c)}var f=function(p){x5(h,p);function h(){return p.apply(this,arguments)||this}h.peek=function(){return c};var y=h.prototype;return y.componentDidMount=function(){s.push(this),u()},y.componentDidUpdate=function(){u()},y.componentWillUnmount=function(){var S=s.indexOf(this);s.splice(S,1),u()},y.render=function(){return Me.createElement(o,this.props)},h}(g.PureComponent);return NS(f,"displayName","SideEffect("+n(o)+")"),f}}var jr=function(e){for(var t=Array(e.length),n=0;n<e.length;++n)t[n]=e[n];return t},nc=function(e){return Array.isArray(e)?e:[e]},L2=function(e){return Array.isArray(e)?e[0]:e},S5=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"},B2=function(e){return e.parentNode&&e.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.parentNode.host:e.parentNode},H2=function(e){return e===document||e&&e.nodeType===Node.DOCUMENT_NODE},C5=function(e,t){return!e||H2(e)||!S5(e)&&t(B2(e))},W2=function(e,t){var n=e.get(t);if(n!==void 0)return n;var r=C5(t,W2.bind(void 0,e));return e.set(t,r),r},w5=function(e,t){return e&&!H2(e)?E5(e)?t(B2(e)):!1:!0},V2=function(e,t){var n=e.get(t);if(n!==void 0)return n;var r=w5(t,V2.bind(void 0,e));return e.set(t,r),r},U2=function(e){return e.dataset},k5=function(e){return e.tagName==="BUTTON"},$2=function(e){return e.tagName==="INPUT"},G2=function(e){return $2(e)&&e.type==="radio"},j5=function(e){return!(($2(e)||k5(e))&&(e.type==="hidden"||e.disabled))},E5=function(e){var t=e.getAttribute(f5);return![!0,"true",""].includes(t)},hh=function(e){var t;return Boolean(e&&((t=U2(e))===null||t===void 0?void 0:t.focusGuard))},rc=function(e){return!hh(e)},P5=function(e){return Boolean(e)},I5=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},q2=function(e,t,n){return jr(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(I5)},M5=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],ph=M5.join(","),T5="".concat(ph,", [data-focus-guard]"),Y2=function(e,t){return jr((e.shadowRoot||e).children).reduce(function(n,r){return n.concat(r.matches(t?T5:ph)?[r]:[],Y2(r))},[])},_5=function(e,t){var n;return e instanceof HTMLIFrameElement&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?wc([e.contentDocument.body],t):[e]},wc=function(e,t){return e.reduce(function(n,r){var o,s=Y2(r,t),c=(o=[]).concat.apply(o,s.map(function(u){return _5(u,t)}));return n.concat(c,r.parentNode?jr(r.parentNode.querySelectorAll(ph)).filter(function(u){return u===r}):[])},[])},D5=function(e){var t=e.querySelectorAll("[".concat(d5,"]"));return jr(t).map(function(n){return wc([n])}).reduce(function(n,r){return n.concat(r)},[])},mh=function(e,t){return jr(e).filter(function(n){return W2(t,n)}).filter(function(n){return j5(n)})},ig=function(e,t){return t===void 0&&(t=new Map),jr(e).filter(function(n){return V2(t,n)})},bf=function(e,t,n){return q2(mh(wc(e,n),t),!0,n)},ag=function(e,t){return q2(mh(wc(e),t),!1)},A5=function(e,t){return mh(D5(e),t)},Wi=function(e,t){return e.shadowRoot?Wi(e.shadowRoot,t):Object.getPrototypeOf(e).contains!==void 0&&Object.getPrototypeOf(e).contains.call(e,t)?!0:jr(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?Wi(o,t):!1}return Wi(n,t)})},O5=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(c,u){return!t.has(u)})},K2=function(e){return e.parentNode?K2(e.parentNode):e},vh=function(e){var t=nc(e);return t.filter(Boolean).reduce(function(n,r){var o=r.getAttribute(yf);return n.push.apply(n,o?O5(jr(K2(r).querySelectorAll("[".concat(yf,'="').concat(o,'"]:not([').concat(M2,'="disabled"])')))):[r]),n},[])},z5=function(e){try{return e()}catch{return}},Ga=function(e){if(e===void 0&&(e=document),!(!e||!e.activeElement)){var t=e.activeElement;return t.shadowRoot?Ga(t.shadowRoot):t instanceof HTMLIFrameElement&&z5(function(){return t.contentWindow.document})?Ga(t.contentWindow.document):t}},R5=function(e,t){return e===t},N5=function(e,t){return Boolean(jr(e.querySelectorAll("iframe")).some(function(n){return R5(n,t)}))},X2=function(e,t){return t===void 0&&(t=Ga(L2(e).ownerDocument)),!t||t.dataset&&t.dataset.focusGuard?!1:vh(e).some(function(n){return Wi(n,t)||N5(n,t)})},F5=function(e){e===void 0&&(e=document);var t=Ga(e);return t?jr(e.querySelectorAll("[".concat(u5,"]"))).some(function(n){return Wi(n,t)}):!1},L5=function(e,t){return t.filter(G2).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},gh=function(e,t){return G2(e)&&e.name?L5(e,t):e},B5=function(e){var t=new Set;return e.forEach(function(n){return t.add(gh(n,e))}),e.filter(function(n){return t.has(n)})},sg=function(e){return e[0]&&e.length>1?gh(e[0],e):e[0]},lg=function(e,t){return e.length>1?e.indexOf(gh(e[t],e)):t},Q2="NEW_FOCUS",H5=function(e,t,n,r){var o=e.length,s=e[0],c=e[o-1],u=hh(n);if(!(n&&e.indexOf(n)>=0)){var f=n!==void 0?t.indexOf(n):-1,p=r?t.indexOf(r):f,h=r?e.indexOf(r):-1,y=f-p,x=t.indexOf(s),S=t.indexOf(c),C=B5(t),k=n!==void 0?C.indexOf(n):-1,w=k-(r?C.indexOf(r):f),j=lg(e,0),I=lg(e,o-1);if(f===-1||h===-1)return Q2;if(!y&&h>=0)return h;if(f<=x&&u&&Math.abs(y)>1)return I;if(f>=S&&u&&Math.abs(y)>1)return j;if(y&&Math.abs(w)>1)return h;if(f<=x)return I;if(f>S)return j;if(y)return Math.abs(y)>1?h:(o+h+y)%o}},W5=function(e){return function(t){var n,r=(n=U2(t))===null||n===void 0?void 0:n.autofocus;return t.autofocus||r!==void 0&&r!=="false"||e.indexOf(t)>=0}},V5=function(e,t,n){var r=e.map(function(s){var c=s.node;return c}),o=ig(r.filter(W5(n)));return o&&o.length?sg(o):sg(ig(t))},Sf=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&Sf(e.parentNode.host||e.parentNode,t),t},gd=function(e,t){for(var n=Sf(e),r=Sf(t),o=0;o<n.length;o+=1){var s=n[o];if(r.indexOf(s)>=0)return s}return!1},Z2=function(e,t,n){var r=nc(e),o=nc(t),s=r[0],c=!1;return o.filter(Boolean).forEach(function(u){c=gd(c||u,u)||c,n.filter(Boolean).forEach(function(f){var p=gd(s,f);p&&(!c||Wi(p,c)?c=p:c=gd(p,c))})}),c},U5=function(e,t){return e.reduce(function(n,r){return n.concat(A5(r,t))},[])},$5=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(P5)},G5=function(e,t){var n=Ga(nc(e).length>0?document:L2(e).ownerDocument),r=vh(e).filter(rc),o=Z2(n||e,e,r),s=new Map,c=ag(r,s),u=bf(r,s).filter(function(S){var C=S.node;return rc(C)});if(!(!u[0]&&(u=c,!u[0]))){var f=ag([o],s).map(function(S){var C=S.node;return C}),p=$5(f,u),h=p.map(function(S){var C=S.node;return C}),y=H5(h,f,n,t);if(y===Q2){var x=V5(c,h,U5(r,s));if(x)return{node:x};console.warn("focus-lock: cannot find any node to move focus into");return}return y===void 0?y:p[y]}},q5=function(e){var t=vh(e).filter(rc),n=Z2(e,e,t),r=new Map,o=bf([n],r,!0),s=bf(t,r).filter(function(c){var u=c.node;return rc(u)}).map(function(c){var u=c.node;return u});return o.map(function(c){var u=c.node,f=c.index;return{node:u,index:f,lockItem:s.indexOf(u)>=0,guard:hh(u)}})},Y5=function(e,t){"focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus()},yd=0,xd=!1,J2=function(e,t,n){n===void 0&&(n={});var r=G5(e,t);if(!xd&&r){if(yd>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),xd=!0,setTimeout(function(){xd=!1},1);return}yd++,Y5(r.node,n.focusOptions),yd--}};function ey(e){var t=window,n=t.setImmediate;typeof n<"u"?n(e):setTimeout(e,1)}var K5=function(){return document&&document.activeElement===document.body},X5=function(){return K5()||F5()},Vi=null,Ri=null,Ui=null,qa=!1,Q5=function(){return!0},Z5=function(t){return(Vi.whiteList||Q5)(t)},J5=function(t,n){Ui={observerNode:t,portaledElement:n}},e6=function(t){return Ui&&Ui.portaledElement===t};function cg(e,t,n,r){var o=null,s=e;do{var c=r[s];if(c.guard)c.node.dataset.focusAutoGuard&&(o=c);else if(c.lockItem){if(s!==e)return;o=null}else break}while((s+=n)!==t);o&&(o.node.tabIndex=0)}var t6=function(t){return t&&"current"in t?t.current:t},n6=function(t){return t?Boolean(qa):qa==="meanwhile"},r6=function e(t,n,r){return n&&(n.host===t&&(!n.activeElement||r.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,r))},o6=function(t,n){return n.some(function(r){return r6(t,r,r)})},oc=function(){var t=!1;if(Vi){var n=Vi,r=n.observed,o=n.persistentFocus,s=n.autoFocus,c=n.shards,u=n.crossFrame,f=n.focusOptions,p=r||Ui&&Ui.portaledElement,h=document&&document.activeElement;if(p){var y=[p].concat(c.map(t6).filter(Boolean));if((!h||Z5(h))&&(o||n6(u)||!X5()||!Ri&&s)&&(p&&!(X2(y)||h&&o6(h,y)||e6(h))&&(document&&!Ri&&h&&!s?(h.blur&&h.blur(),document.body.focus()):(t=J2(y,Ri,{focusOptions:f}),Ui={})),qa=!1,Ri=document&&document.activeElement),document){var x=document&&document.activeElement,S=q5(y),C=S.map(function(k){var w=k.node;return w}).indexOf(x);C>-1&&(S.filter(function(k){var w=k.guard,j=k.node;return w&&j.dataset.focusAutoGuard}).forEach(function(k){var w=k.node;return w.removeAttribute("tabIndex")}),cg(C,S.length,1,S),cg(C,-1,-1,S))}}}return t},ty=function(t){oc()&&t&&(t.stopPropagation(),t.preventDefault())},yh=function(){return ey(oc)},i6=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||J5(r,n)},a6=function(){return null},ny=function(){qa="just",setTimeout(function(){qa="meanwhile"},0)},s6=function(){document.addEventListener("focusin",ty),document.addEventListener("focusout",yh),window.addEventListener("blur",ny)},l6=function(){document.removeEventListener("focusin",ty),document.removeEventListener("focusout",yh),window.removeEventListener("blur",ny)};function c6(e){return e.filter(function(t){var n=t.disabled;return!n})}function u6(e){var t=e.slice(-1)[0];t&&!Vi&&s6();var n=Vi,r=n&&t&&t.id===n.id;Vi=t,n&&!r&&(n.onDeactivation(),e.filter(function(o){var s=o.id;return s===n.id}).length||n.returnFocus(!t)),t?(Ri=null,(!r||n.observed!==t.observed)&&t.onActivation(),oc(),ey(oc)):(l6(),Ri=null)}R2.assignSyncMedium(i6);N2.assignMedium(yh);v5.assignMedium(function(e){return e({moveFocusInside:J2,focusInside:X2})});const d6=b5(c6,u6)(a6);var ry=g.forwardRef(function(t,n){return g.createElement(F2,Yd({sideCar:d6,ref:n},t))}),oy=F2.propTypes||{};oy.sideCar;wC(oy,["sideCar"]);ry.propTypes={};const ug=ry;function iy(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function ay(e){var t;if(!iy(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function f6(e){var t,n;return(n=(t=sy(e))==null?void 0:t.defaultView)!=null?n:window}function sy(e){return iy(e)?e.ownerDocument:document}function h6(e){return sy(e).activeElement}var ly=e=>e.hasAttribute("tabindex"),p6=e=>ly(e)&&e.tabIndex===-1;function m6(e){return Boolean(e.getAttribute("disabled"))===!0||Boolean(e.getAttribute("aria-disabled"))===!0}function cy(e){return e.parentElement&&cy(e.parentElement)?!0:e.hidden}function v6(e){const t=e.getAttribute("contenteditable");return t!=="false"&&t!=null}function uy(e){if(!ay(e)||cy(e)||m6(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]():v6(e)?!0:ly(e)}function g6(e){return e?ay(e)&&uy(e)&&!p6(e):!1}var y6=["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]"],x6=y6.join(),b6=e=>e.offsetWidth>0&&e.offsetHeight>0;function dy(e){const t=Array.from(e.querySelectorAll(x6));return t.unshift(e),t.filter(n=>uy(n)&&b6(n))}var dg,S6=(dg=ug.default)!=null?dg:ug,fy=e=>{const{initialFocusRef:t,finalFocusRef:n,contentRef:r,restoreFocus:o,children:s,isDisabled:c,autoFocus:u,persistentFocus:f,lockFocusAcrossFrames:p}=e,h=g.useCallback(()=>{t!=null&&t.current?t.current.focus():r!=null&&r.current&&dy(r.current).length===0&&requestAnimationFrame(()=>{var C;(C=r.current)==null||C.focus()})},[t,r]),y=g.useCallback(()=>{var S;(S=n==null?void 0:n.current)==null||S.focus()},[n]),x=o&&!n;return l.jsx(S6,{crossFrame:p,persistentFocus:f,autoFocus:u,disabled:c,onActivation:h,onDeactivation:y,returnFocus:x,children:s})};fy.displayName="FocusLock";var C6=AC?g.useLayoutEffect:g.useEffect;function ic(e,t=[]){const n=g.useRef(e);return C6(()=>{n.current=e}),g.useCallback((...r)=>{var o;return(o=n.current)==null?void 0:o.call(n,...r)},t)}function w6(e,t,n,r){const o=ic(t);return g.useEffect(()=>{var s;const c=(s=Ev(n))!=null?s:document;if(t)return c.addEventListener(e,o,r),()=>{c.removeEventListener(e,o,r)}},[e,n,r,o,t]),()=>{var s;((s=Ev(n))!=null?s:document).removeEventListener(e,o,r)}}function k6(e){const{ref:t,handler:n,enabled:r=!0}=e,o=ic(n),c=g.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}).current;g.useEffect(()=>{if(!r)return;const u=y=>{bd(y,t)&&(c.isPointerDown=!0)},f=y=>{if(c.ignoreEmulatedMouseEvents){c.ignoreEmulatedMouseEvents=!1;return}c.isPointerDown&&n&&bd(y,t)&&(c.isPointerDown=!1,o(y))},p=y=>{c.ignoreEmulatedMouseEvents=!0,n&&c.isPointerDown&&bd(y,t)&&(c.isPointerDown=!1,o(y))},h=u2(t.current);return h.addEventListener("mousedown",u,!0),h.addEventListener("mouseup",f,!0),h.addEventListener("touchstart",u,!0),h.addEventListener("touchend",p,!0),()=>{h.removeEventListener("mousedown",u,!0),h.removeEventListener("mouseup",f,!0),h.removeEventListener("touchstart",u,!0),h.removeEventListener("touchend",p,!0)}},[n,t,o,c,r])}function bd(e,t){var n;const r=e.target;return e.button>0||r&&!u2(r).contains(r)?!1:!((n=t.current)!=null&&n.contains(r))}function j6(e,t){const n=g.useId();return g.useMemo(()=>e||[t,n].filter(Boolean).join("-"),[e,t,n])}function E6(e,t){const n=e!==void 0;return[n,n&&typeof e<"u"?e:t]}function ho(e={}){const{onClose:t,onOpen:n,isOpen:r,id:o}=e,s=ic(n),c=ic(t),[u,f]=g.useState(e.defaultIsOpen||!1),[p,h]=E6(r,u),y=j6(o,"disclosure"),x=g.useCallback(()=>{p||f(!1),c==null||c()},[p,c]),S=g.useCallback(()=>{p||f(!0),s==null||s()},[p,s]),C=g.useCallback(()=>{(h?x:S)()},[h,S,x]);return{isOpen:!!h,onOpen:S,onClose:x,onToggle:C,isControlled:p,getButtonProps:(k={})=>({...k,"aria-expanded":h,"aria-controls":y,onClick:FS(k.onClick,C)}),getDisclosureProps:(k={})=>({...k,hidden:!h,id:y})}}var xh=fe(function(t,n){const{htmlSize:r,...o}=t,s=un("Input",o),c=At(o),u=ah(c),f=Ae("chakra-input",t.className);return l.jsx(re.input,{size:r,...u,__css:s.field,ref:n,className:f})});xh.displayName="Input";xh.id="Input";var[P6,hy]=jt({name:"ListStylesContext",errorMessage:`useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "<List />" `}),bh=fe(function(t,n){const r=un("List",t),{children:o,styleType:s="none",stylePosition:c,spacing:u,...f}=At(t),p=ih(o),y=u?{["& > *:not(style) ~ *:not(style)"]:{mt:u}}:{};return l.jsx(P6,{value:r,children:l.jsx(re.ul,{ref:n,listStyleType:s,listStylePosition:c,role:"list",__css:{...r.container,...y},...f,children:p})})});bh.displayName="List";var I6=fe((e,t)=>{const{as:n,...r}=e;return l.jsx(bh,{ref:t,as:"ol",styleType:"decimal",marginStart:"1em",...r})});I6.displayName="OrderedList";var py=fe(function(t,n){const{as:r,...o}=t;return l.jsx(bh,{ref:n,as:"ul",styleType:"initial",marginStart:"1em",...o})});py.displayName="UnorderedList";var za=fe(function(t,n){const r=hy();return l.jsx(re.li,{ref:n,...t,__css:r.item})});za.displayName="ListItem";var M6=fe(function(t,n){const r=hy();return l.jsx(tn,{ref:n,role:"presentation",...t,__css:r.icon})});M6.displayName="ListIcon";var or=fe(function(t,n){const{templateAreas:r,gap:o,rowGap:s,columnGap:c,column:u,row:f,autoFlow:p,autoRows:h,templateRows:y,autoColumns:x,templateColumns:S,...C}=t,k={display:"grid",gridTemplateAreas:r,gridGap:o,gridRowGap:s,gridColumnGap:c,gridAutoColumns:x,gridColumn:u,gridRow:f,gridAutoFlow:p,gridAutoRows:h,gridTemplateRows:y,gridTemplateColumns:S};return l.jsx(re.div,{ref:n,__css:k,...C})});or.displayName="Grid";function my(e,t){return Array.isArray(e)?e.map(n=>n===null?null:t(n)):Kd(e)?Object.keys(e).reduce((n,r)=>(n[r]=t(e[r]),n),{}):e!=null?t(e):null}var kc=re("div",{baseStyle:{flex:1,justifySelf:"stretch",alignSelf:"stretch"}});kc.displayName="Spacer";var vy=e=>l.jsx(re.div,{className:"chakra-stack__item",...e,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...e.__css}});vy.displayName="StackItem";var Cf="& > *:not(style) ~ *:not(style)";function T6(e){const{spacing:t,direction:n}=e,r={column:{marginTop:t,marginEnd:0,marginBottom:0,marginStart:0},row:{marginTop:0,marginEnd:0,marginBottom:0,marginStart:t},"column-reverse":{marginTop:0,marginEnd:0,marginBottom:t,marginStart:0},"row-reverse":{marginTop:0,marginEnd:t,marginBottom:0,marginStart:0}};return{flexDirection:n,[Cf]:my(n,o=>r[o])}}function _6(e){const{spacing:t,direction:n}=e,r={column:{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},"column-reverse":{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},row:{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0},"row-reverse":{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0}};return{"&":my(n,o=>r[o])}}var Sh=fe((e,t)=>{const{isInline:n,direction:r,align:o,justify:s,spacing:c="0.5rem",wrap:u,children:f,divider:p,className:h,shouldWrapChildren:y,...x}=e,S=n?"row":r??"column",C=g.useMemo(()=>T6({direction:S,spacing:c}),[S,c]),k=g.useMemo(()=>_6({spacing:c,direction:S}),[c,S]),w=!!p,j=!y&&!w,I=g.useMemo(()=>{const M=ih(f);return j?M:M.map((T,D)=>{const _=typeof T.key<"u"?T.key:D,R=D+1===M.length,F=y?l.jsx(vy,{children:T},_):T;if(!w)return F;const L=g.cloneElement(p,{__css:k}),Q=R?null:L;return l.jsxs(g.Fragment,{children:[F,Q]},_)})},[p,k,w,j,y,f]),P=Ae("chakra-stack",h);return l.jsx(re.div,{ref:t,display:"flex",alignItems:o,justifyContent:s,flexDirection:C.flexDirection,flexWrap:u,className:P,__css:w?{}:{[Cf]:C[Cf]},...x,children:I})});Sh.displayName="Stack";var ze=fe((e,t)=>l.jsx(Sh,{align:"center",...e,direction:"column",ref:t}));ze.displayName="VStack";var ra=fe((e,t)=>l.jsx(Sh,{align:"center",...e,direction:"row",ref:t}));ra.displayName="HStack";var Wn=fe(function(t,n){const r=go("Heading",t),{className:o,...s}=At(t);return l.jsx(re.h2,{ref:n,className:Ae("chakra-heading",t.className),...s,__css:r})});Wn.displayName="Heading";var Ye=re("div");Ye.displayName="Box";var gy=fe(function(t,n){const{size:r,centerContent:o=!0,...s}=t,c=o?{display:"flex",alignItems:"center",justifyContent:"center"}:{};return l.jsx(Ye,{ref:n,boxSize:r,__css:{...c,flexShrink:0,flexGrow:0},...s})});gy.displayName="Square";var D6=fe(function(t,n){const{size:r,...o}=t;return l.jsx(gy,{size:r,ref:n,borderRadius:"9999px",...o})});D6.displayName="Circle";var Go=fe(function(t,n){const r=go("Link",t),{className:o,isExternal:s,...c}=At(t);return l.jsx(re.a,{target:s?"_blank":void 0,rel:s?"noopener":void 0,ref:n,className:Ae("chakra-link",o),...c,__css:r})});Go.displayName="Link";var yy=fe(function(t,n){const r=go("Badge",t),{className:o,...s}=At(t);return l.jsx(re.span,{ref:n,className:Ae("chakra-badge",t.className),...s,__css:{display:"inline-block",whiteSpace:"nowrap",verticalAlign:"middle",...r}})});yy.displayName="Badge";var xy=re("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center"}});xy.displayName="Center";var A6={horizontal:{insetStart:"50%",transform:"translateX(-50%)"},vertical:{top:"50%",transform:"translateY(-50%)"},both:{insetStart:"50%",top:"50%",transform:"translate(-50%, -50%)"}};fe(function(t,n){const{axis:r="both",...o}=t;return l.jsx(re.div,{ref:n,__css:A6[r],...o,position:"absolute"})});var by=fe(function(t,n){const{borderLeftWidth:r,borderBottomWidth:o,borderTopWidth:s,borderRightWidth:c,borderWidth:u,borderStyle:f,borderColor:p,...h}=go("Divider",t),{className:y,orientation:x="horizontal",__css:S,...C}=At(t),k={vertical:{borderLeftWidth:r||c||u||"1px",height:"100%"},horizontal:{borderBottomWidth:o||s||u||"1px",width:"100%"}};return l.jsx(re.hr,{ref:n,"aria-orientation":x,...C,__css:{...h,border:"0",borderColor:p,borderStyle:f,...k[x],...S},className:Ae("chakra-divider",y)})});by.displayName="Divider";function O6(e){const{key:t}=e;return t.length===1||t.length>1&&/[^a-zA-Z0-9]/.test(t)}function z6(e={}){const{timeout:t=300,preventDefault:n=()=>!0}=e,[r,o]=g.useState([]),s=g.useRef(),c=()=>{s.current&&(clearTimeout(s.current),s.current=null)},u=()=>{c(),s.current=setTimeout(()=>{o([]),s.current=null},t)};g.useEffect(()=>c,[]);function f(p){return h=>{if(h.key==="Backspace"){const y=[...r];y.pop(),o(y);return}if(O6(h)){const y=r.concat(h.key);n(h)&&(h.preventDefault(),h.stopPropagation()),o(y),p(y.join("")),u()}}}return f}function R6(e,t,n,r){if(t==null)return r;if(!r)return e.find(c=>n(c).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 N6(){const e=g.useRef(new Map),t=e.current,n=g.useCallback((o,s,c,u)=>{e.current.set(c,{type:s,el:o,options:u}),o.addEventListener(s,c,u)},[]),r=g.useCallback((o,s,c,u)=>{o.removeEventListener(s,c,u),e.current.delete(c)},[]);return g.useEffect(()=>()=>{t.forEach((o,s)=>{r(o.el,o.type,s,o.options)})},[r,t]),{add:n,remove:r}}function Sd(e){const t=e.target,{tagName:n,isContentEditable:r}=t;return n!=="INPUT"&&n!=="TEXTAREA"&&r!==!0}function Sy(e={}){const{ref:t,isDisabled:n,isFocusable:r,clickOnEnter:o=!0,clickOnSpace:s=!0,onMouseDown:c,onMouseUp:u,onClick:f,onKeyDown:p,onKeyUp:h,tabIndex:y,onMouseOver:x,onMouseLeave:S,...C}=e,[k,w]=g.useState(!0),[j,I]=g.useState(!1),P=N6(),M=$=>{$&&$.tagName!=="BUTTON"&&w(!1)},T=k?y:y||0,D=n&&!r,_=g.useCallback($=>{if(n){$.stopPropagation(),$.preventDefault();return}$.currentTarget.focus(),f==null||f($)},[n,f]),R=g.useCallback($=>{j&&Sd($)&&($.preventDefault(),$.stopPropagation(),I(!1),P.remove(document,"keyup",R,!1))},[j,P]),V=g.useCallback($=>{if(p==null||p($),n||$.defaultPrevented||$.metaKey||!Sd($.nativeEvent)||k)return;const Z=o&&$.key==="Enter";s&&$.key===" "&&($.preventDefault(),I(!0)),Z&&($.preventDefault(),$.currentTarget.click()),P.add(document,"keyup",R,!1)},[n,k,p,o,s,P,R]),F=g.useCallback($=>{if(h==null||h($),n||$.defaultPrevented||$.metaKey||!Sd($.nativeEvent)||k)return;s&&$.key===" "&&($.preventDefault(),I(!1),$.currentTarget.click())},[s,k,n,h]),L=g.useCallback($=>{$.button===0&&(I(!1),P.remove(document,"mouseup",L,!1))},[P]),Q=g.useCallback($=>{if($.button!==0)return;if(n){$.stopPropagation(),$.preventDefault();return}k||I(!0),$.currentTarget.focus({preventScroll:!0}),P.add(document,"mouseup",L,!1),c==null||c($)},[n,k,c,P,L]),U=g.useCallback($=>{$.button===0&&(k||I(!1),u==null||u($))},[u,k]),K=g.useCallback($=>{if(n){$.preventDefault();return}x==null||x($)},[n,x]),te=g.useCallback($=>{j&&($.preventDefault(),I(!1)),S==null||S($)},[j,S]),ne=ct(t,M);return k?{...C,ref:ne,type:"button","aria-disabled":D?void 0:n,disabled:D,onClick:_,onMouseDown:c,onMouseUp:u,onKeyUp:h,onKeyDown:p,onMouseOver:x,onMouseLeave:S}:{...C,ref:ne,role:"button","data-active":qe(j),"aria-disabled":n?"true":void 0,tabIndex:D?void 0:T,onClick:_,onMouseDown:Q,onMouseUp:U,onKeyUp:F,onKeyDown:V,onMouseOver:K,onMouseLeave:te}}function F6(e){const t=e.current;if(!t)return!1;const n=h6(t);return!n||t.contains(n)?!1:!!g6(n)}function Cy(e,t){const{shouldFocus:n,visible:r,focusRef:o}=t,s=n&&!r;ei(()=>{if(!s||F6(e))return;const c=(o==null?void 0:o.current)||e.current;c&&requestAnimationFrame(()=>{c.focus()})},[s,e,o])}var L6={preventScroll:!0,shouldFocus:!1};function B6(e,t=L6){const{focusRef:n,preventScroll:r,shouldFocus:o,visible:s}=t,c=H6(e)?e.current:e,u=o&&s,f=g.useRef(u),p=g.useRef(s);Bi(()=>{!p.current&&s&&(f.current=u),p.current=s},[s,u]);const h=g.useCallback(()=>{if(!(!s||!c||!f.current)&&(f.current=!1,!c.contains(document.activeElement)))if(n!=null&&n.current)requestAnimationFrame(()=>{var y;(y=n.current)==null||y.focus({preventScroll:r})});else{const y=dy(c);y.length>0&&requestAnimationFrame(()=>{y[0].focus({preventScroll:r})})}},[s,r,c,n]);ei(()=>{h()},[h]),$o(c,"transitionend",h)}function H6(e){return"current"in e}var ki=(e,t)=>({var:e,varRef:t?`var(${e}, ${t})`:`var(${e})`}),Ht={arrowShadowColor:ki("--popper-arrow-shadow-color"),arrowSize:ki("--popper-arrow-size","8px"),arrowSizeHalf:ki("--popper-arrow-size-half"),arrowBg:ki("--popper-arrow-bg"),transformOrigin:ki("--popper-transform-origin"),arrowOffset:ki("--popper-arrow-offset")};function W6(e){if(e.includes("top"))return"1px 1px 1px 0 var(--popper-arrow-shadow-color)";if(e.includes("bottom"))return"-1px -1px 1px 0 var(--popper-arrow-shadow-color)";if(e.includes("right"))return"-1px 1px 1px 0 var(--popper-arrow-shadow-color)";if(e.includes("left"))return"1px -1px 1px 0 var(--popper-arrow-shadow-color)"}var V6={top:"bottom center","top-start":"bottom left","top-end":"bottom right",bottom:"top center","bottom-start":"top left","bottom-end":"top right",left:"right center","left-start":"right top","left-end":"right bottom",right:"left center","right-start":"left top","right-end":"left bottom"},U6=e=>V6[e],fg={scroll:!0,resize:!0};function $6(e){let t;return typeof e=="object"?t={enabled:!0,options:{...fg,...e}}:t={enabled:e,options:fg},t}var G6={name:"matchWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:e})=>{e.styles.popper.width=`${e.rects.reference.width}px`},effect:({state:e})=>()=>{const t=e.elements.reference;e.elements.popper.style.width=`${t.offsetWidth}px`}},q6={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:e})=>{hg(e)},effect:({state:e})=>()=>{hg(e)}},hg=e=>{e.elements.popper.style.setProperty(Ht.transformOrigin.var,U6(e.placement))},Y6={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:e})=>{K6(e)}},K6=e=>{var t;if(!e.placement)return;const n=X6(e.placement);if((t=e.elements)!=null&&t.arrow&&n){Object.assign(e.elements.arrow.style,{[n.property]:n.value,width:Ht.arrowSize.varRef,height:Ht.arrowSize.varRef,zIndex:-1});const r={[Ht.arrowSizeHalf.var]:`calc(${Ht.arrowSize.varRef} / 2)`,[Ht.arrowOffset.var]:`calc(${Ht.arrowSizeHalf.varRef} * -1)`};for(const o in r)e.elements.arrow.style.setProperty(o,r[o])}},X6=e=>{if(e.startsWith("top"))return{property:"bottom",value:Ht.arrowOffset.varRef};if(e.startsWith("bottom"))return{property:"top",value:Ht.arrowOffset.varRef};if(e.startsWith("left"))return{property:"right",value:Ht.arrowOffset.varRef};if(e.startsWith("right"))return{property:"left",value:Ht.arrowOffset.varRef}},Q6={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:e})=>{pg(e)},effect:({state:e})=>()=>{pg(e)}},pg=e=>{if(!e.elements.arrow)return;const t=e.elements.arrow.querySelector("[data-popper-arrow-inner]");if(!t)return;const n=W6(e.placement);n&&t.style.setProperty("--popper-arrow-default-shadow",n),Object.assign(t.style,{transform:"rotate(45deg)",background:Ht.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:"var(--popper-arrow-shadow, var(--popper-arrow-default-shadow))"})},Z6={"start-start":{ltr:"left-start",rtl:"right-start"},"start-end":{ltr:"left-end",rtl:"right-end"},"end-start":{ltr:"right-start",rtl:"left-start"},"end-end":{ltr:"right-end",rtl:"left-end"},start:{ltr:"left",rtl:"right"},end:{ltr:"right",rtl:"left"}},J6={"auto-start":"auto-end","auto-end":"auto-start","top-start":"top-end","top-end":"top-start","bottom-start":"bottom-end","bottom-end":"bottom-start"};function ek(e,t="ltr"){var n,r;const o=((n=Z6[e])==null?void 0:n[t])||e;return t==="ltr"?o:(r=J6[e])!=null?r:o}var Pn="top",Un="bottom",$n="right",In="left",Ch="auto",us=[Pn,Un,$n,In],$i="start",Ya="end",tk="clippingParents",wy="viewport",Ta="popper",nk="reference",mg=us.reduce(function(e,t){return e.concat([t+"-"+$i,t+"-"+Ya])},[]),ky=[].concat(us,[Ch]).reduce(function(e,t){return e.concat([t,t+"-"+$i,t+"-"+Ya])},[]),rk="beforeRead",ok="read",ik="afterRead",ak="beforeMain",sk="main",lk="afterMain",ck="beforeWrite",uk="write",dk="afterWrite",fk=[rk,ok,ik,ak,sk,lk,ck,uk,dk];function kr(e){return e?(e.nodeName||"").toLowerCase():null}function Gn(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Xo(e){var t=Gn(e).Element;return e instanceof t||e instanceof Element}function Vn(e){var t=Gn(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function wh(e){if(typeof ShadowRoot>"u")return!1;var t=Gn(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function hk(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},o=t.attributes[n]||{},s=t.elements[n];!Vn(s)||!kr(s)||(Object.assign(s.style,r),Object.keys(o).forEach(function(c){var u=o[c];u===!1?s.removeAttribute(c):s.setAttribute(c,u===!0?"":u)}))})}function pk(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var o=t.elements[r],s=t.attributes[r]||{},c=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),u=c.reduce(function(f,p){return f[p]="",f},{});!Vn(o)||!kr(o)||(Object.assign(o.style,u),Object.keys(s).forEach(function(f){o.removeAttribute(f)}))})}}const mk={name:"applyStyles",enabled:!0,phase:"write",fn:hk,effect:pk,requires:["computeStyles"]};function Sr(e){return e.split("-")[0]}var qo=Math.max,ac=Math.min,Gi=Math.round;function wf(){var e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function jy(){return!/^((?!chrome|android).)*safari/i.test(wf())}function qi(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),o=1,s=1;t&&Vn(e)&&(o=e.offsetWidth>0&&Gi(r.width)/e.offsetWidth||1,s=e.offsetHeight>0&&Gi(r.height)/e.offsetHeight||1);var c=Xo(e)?Gn(e):window,u=c.visualViewport,f=!jy()&&n,p=(r.left+(f&&u?u.offsetLeft:0))/o,h=(r.top+(f&&u?u.offsetTop:0))/s,y=r.width/o,x=r.height/s;return{width:y,height:x,top:h,right:p+y,bottom:h+x,left:p,x:p,y:h}}function kh(e){var t=qi(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function Ey(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&wh(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Nr(e){return Gn(e).getComputedStyle(e)}function vk(e){return["table","td","th"].indexOf(kr(e))>=0}function xo(e){return((Xo(e)?e.ownerDocument:e.document)||window.document).documentElement}function jc(e){return kr(e)==="html"?e:e.assignedSlot||e.parentNode||(wh(e)?e.host:null)||xo(e)}function vg(e){return!Vn(e)||Nr(e).position==="fixed"?null:e.offsetParent}function gk(e){var t=/firefox/i.test(wf()),n=/Trident/i.test(wf());if(n&&Vn(e)){var r=Nr(e);if(r.position==="fixed")return null}var o=jc(e);for(wh(o)&&(o=o.host);Vn(o)&&["html","body"].indexOf(kr(o))<0;){var s=Nr(o);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||t&&s.willChange==="filter"||t&&s.filter&&s.filter!=="none")return o;o=o.parentNode}return null}function ds(e){for(var t=Gn(e),n=vg(e);n&&vk(n)&&Nr(n).position==="static";)n=vg(n);return n&&(kr(n)==="html"||kr(n)==="body"&&Nr(n).position==="static")?t:n||gk(e)||t}function jh(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Na(e,t,n){return qo(e,ac(t,n))}function yk(e,t,n){var r=Na(e,t,n);return r>n?n:r}function Py(){return{top:0,right:0,bottom:0,left:0}}function Iy(e){return Object.assign({},Py(),e)}function My(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var xk=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,Iy(typeof t!="number"?t:My(t,us))};function bk(e){var t,n=e.state,r=e.name,o=e.options,s=n.elements.arrow,c=n.modifiersData.popperOffsets,u=Sr(n.placement),f=jh(u),p=[In,$n].indexOf(u)>=0,h=p?"height":"width";if(!(!s||!c)){var y=xk(o.padding,n),x=kh(s),S=f==="y"?Pn:In,C=f==="y"?Un:$n,k=n.rects.reference[h]+n.rects.reference[f]-c[f]-n.rects.popper[h],w=c[f]-n.rects.reference[f],j=ds(s),I=j?f==="y"?j.clientHeight||0:j.clientWidth||0:0,P=k/2-w/2,M=y[S],T=I-x[h]-y[C],D=I/2-x[h]/2+P,_=Na(M,D,T),R=f;n.modifiersData[r]=(t={},t[R]=_,t.centerOffset=_-D,t)}}function Sk(e){var t=e.state,n=e.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||Ey(t.elements.popper,o)&&(t.elements.arrow=o))}const Ck={name:"arrow",enabled:!0,phase:"main",fn:bk,effect:Sk,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Yi(e){return e.split("-")[1]}var wk={top:"auto",right:"auto",bottom:"auto",left:"auto"};function kk(e){var t=e.x,n=e.y,r=window,o=r.devicePixelRatio||1;return{x:Gi(t*o)/o||0,y:Gi(n*o)/o||0}}function gg(e){var t,n=e.popper,r=e.popperRect,o=e.placement,s=e.variation,c=e.offsets,u=e.position,f=e.gpuAcceleration,p=e.adaptive,h=e.roundOffsets,y=e.isFixed,x=c.x,S=x===void 0?0:x,C=c.y,k=C===void 0?0:C,w=typeof h=="function"?h({x:S,y:k}):{x:S,y:k};S=w.x,k=w.y;var j=c.hasOwnProperty("x"),I=c.hasOwnProperty("y"),P=In,M=Pn,T=window;if(p){var D=ds(n),_="clientHeight",R="clientWidth";if(D===Gn(n)&&(D=xo(n),Nr(D).position!=="static"&&u==="absolute"&&(_="scrollHeight",R="scrollWidth")),D=D,o===Pn||(o===In||o===$n)&&s===Ya){M=Un;var V=y&&D===T&&T.visualViewport?T.visualViewport.height:D[_];k-=V-r.height,k*=f?1:-1}if(o===In||(o===Pn||o===Un)&&s===Ya){P=$n;var F=y&&D===T&&T.visualViewport?T.visualViewport.width:D[R];S-=F-r.width,S*=f?1:-1}}var L=Object.assign({position:u},p&&wk),Q=h===!0?kk({x:S,y:k}):{x:S,y:k};if(S=Q.x,k=Q.y,f){var U;return Object.assign({},L,(U={},U[M]=I?"0":"",U[P]=j?"0":"",U.transform=(T.devicePixelRatio||1)<=1?"translate("+S+"px, "+k+"px)":"translate3d("+S+"px, "+k+"px, 0)",U))}return Object.assign({},L,(t={},t[M]=I?k+"px":"",t[P]=j?S+"px":"",t.transform="",t))}function jk(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=r===void 0?!0:r,s=n.adaptive,c=s===void 0?!0:s,u=n.roundOffsets,f=u===void 0?!0:u,p={placement:Sr(t.placement),variation:Yi(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,gg(Object.assign({},p,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:c,roundOffsets:f})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,gg(Object.assign({},p,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:f})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const Ek={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:jk,data:{}};var bl={passive:!0};function Pk(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,s=o===void 0?!0:o,c=r.resize,u=c===void 0?!0:c,f=Gn(t.elements.popper),p=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&p.forEach(function(h){h.addEventListener("scroll",n.update,bl)}),u&&f.addEventListener("resize",n.update,bl),function(){s&&p.forEach(function(h){h.removeEventListener("scroll",n.update,bl)}),u&&f.removeEventListener("resize",n.update,bl)}}const Ik={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Pk,data:{}};var Mk={left:"right",right:"left",bottom:"top",top:"bottom"};function Wl(e){return e.replace(/left|right|bottom|top/g,function(t){return Mk[t]})}var Tk={start:"end",end:"start"};function yg(e){return e.replace(/start|end/g,function(t){return Tk[t]})}function Eh(e){var t=Gn(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Ph(e){return qi(xo(e)).left+Eh(e).scrollLeft}function _k(e,t){var n=Gn(e),r=xo(e),o=n.visualViewport,s=r.clientWidth,c=r.clientHeight,u=0,f=0;if(o){s=o.width,c=o.height;var p=jy();(p||!p&&t==="fixed")&&(u=o.offsetLeft,f=o.offsetTop)}return{width:s,height:c,x:u+Ph(e),y:f}}function Dk(e){var t,n=xo(e),r=Eh(e),o=(t=e.ownerDocument)==null?void 0:t.body,s=qo(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),c=qo(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),u=-r.scrollLeft+Ph(e),f=-r.scrollTop;return Nr(o||n).direction==="rtl"&&(u+=qo(n.clientWidth,o?o.clientWidth:0)-s),{width:s,height:c,x:u,y:f}}function Ih(e){var t=Nr(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function Ty(e){return["html","body","#document"].indexOf(kr(e))>=0?e.ownerDocument.body:Vn(e)&&Ih(e)?e:Ty(jc(e))}function Fa(e,t){var n;t===void 0&&(t=[]);var r=Ty(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),s=Gn(r),c=o?[s].concat(s.visualViewport||[],Ih(r)?r:[]):r,u=t.concat(c);return o?u:u.concat(Fa(jc(c)))}function kf(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Ak(e,t){var n=qi(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function xg(e,t,n){return t===wy?kf(_k(e,n)):Xo(t)?Ak(t,n):kf(Dk(xo(e)))}function Ok(e){var t=Fa(jc(e)),n=["absolute","fixed"].indexOf(Nr(e).position)>=0,r=n&&Vn(e)?ds(e):e;return Xo(r)?t.filter(function(o){return Xo(o)&&Ey(o,r)&&kr(o)!=="body"}):[]}function zk(e,t,n,r){var o=t==="clippingParents"?Ok(e):[].concat(t),s=[].concat(o,[n]),c=s[0],u=s.reduce(function(f,p){var h=xg(e,p,r);return f.top=qo(h.top,f.top),f.right=ac(h.right,f.right),f.bottom=ac(h.bottom,f.bottom),f.left=qo(h.left,f.left),f},xg(e,c,r));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}function _y(e){var t=e.reference,n=e.element,r=e.placement,o=r?Sr(r):null,s=r?Yi(r):null,c=t.x+t.width/2-n.width/2,u=t.y+t.height/2-n.height/2,f;switch(o){case Pn:f={x:c,y:t.y-n.height};break;case Un:f={x:c,y:t.y+t.height};break;case $n:f={x:t.x+t.width,y:u};break;case In:f={x:t.x-n.width,y:u};break;default:f={x:t.x,y:t.y}}var p=o?jh(o):null;if(p!=null){var h=p==="y"?"height":"width";switch(s){case $i:f[p]=f[p]-(t[h]/2-n[h]/2);break;case Ya:f[p]=f[p]+(t[h]/2-n[h]/2);break}}return f}function Ka(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=r===void 0?e.placement:r,s=n.strategy,c=s===void 0?e.strategy:s,u=n.boundary,f=u===void 0?tk:u,p=n.rootBoundary,h=p===void 0?wy:p,y=n.elementContext,x=y===void 0?Ta:y,S=n.altBoundary,C=S===void 0?!1:S,k=n.padding,w=k===void 0?0:k,j=Iy(typeof w!="number"?w:My(w,us)),I=x===Ta?nk:Ta,P=e.rects.popper,M=e.elements[C?I:x],T=zk(Xo(M)?M:M.contextElement||xo(e.elements.popper),f,h,c),D=qi(e.elements.reference),_=_y({reference:D,element:P,strategy:"absolute",placement:o}),R=kf(Object.assign({},P,_)),V=x===Ta?R:D,F={top:T.top-V.top+j.top,bottom:V.bottom-T.bottom+j.bottom,left:T.left-V.left+j.left,right:V.right-T.right+j.right},L=e.modifiersData.offset;if(x===Ta&&L){var Q=L[o];Object.keys(F).forEach(function(U){var K=[$n,Un].indexOf(U)>=0?1:-1,te=[Pn,Un].indexOf(U)>=0?"y":"x";F[U]+=Q[te]*K})}return F}function Rk(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=n.boundary,s=n.rootBoundary,c=n.padding,u=n.flipVariations,f=n.allowedAutoPlacements,p=f===void 0?ky:f,h=Yi(r),y=h?u?mg:mg.filter(function(C){return Yi(C)===h}):us,x=y.filter(function(C){return p.indexOf(C)>=0});x.length===0&&(x=y);var S=x.reduce(function(C,k){return C[k]=Ka(e,{placement:k,boundary:o,rootBoundary:s,padding:c})[Sr(k)],C},{});return Object.keys(S).sort(function(C,k){return S[C]-S[k]})}function Nk(e){if(Sr(e)===Ch)return[];var t=Wl(e);return[yg(e),t,yg(t)]}function Fk(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,s=o===void 0?!0:o,c=n.altAxis,u=c===void 0?!0:c,f=n.fallbackPlacements,p=n.padding,h=n.boundary,y=n.rootBoundary,x=n.altBoundary,S=n.flipVariations,C=S===void 0?!0:S,k=n.allowedAutoPlacements,w=t.options.placement,j=Sr(w),I=j===w,P=f||(I||!C?[Wl(w)]:Nk(w)),M=[w].concat(P).reduce(function(pe,ce){return pe.concat(Sr(ce)===Ch?Rk(t,{placement:ce,boundary:h,rootBoundary:y,padding:p,flipVariations:C,allowedAutoPlacements:k}):ce)},[]),T=t.rects.reference,D=t.rects.popper,_=new Map,R=!0,V=M[0],F=0;F<M.length;F++){var L=M[F],Q=Sr(L),U=Yi(L)===$i,K=[Pn,Un].indexOf(Q)>=0,te=K?"width":"height",ne=Ka(t,{placement:L,boundary:h,rootBoundary:y,altBoundary:x,padding:p}),$=K?U?$n:In:U?Un:Pn;T[te]>D[te]&&($=Wl($));var Z=Wl($),oe=[];if(s&&oe.push(ne[Q]<=0),u&&oe.push(ne[$]<=0,ne[Z]<=0),oe.every(function(pe){return pe})){V=L,R=!1;break}_.set(L,oe)}if(R)for(var le=C?3:1,Re=function(ce){var Fe=M.find(function(Ve){var Ue=_.get(Ve);if(Ue)return Ue.slice(0,ce).every(function($e){return $e})});if(Fe)return V=Fe,"break"},Ne=le;Ne>0;Ne--){var Ie=Re(Ne);if(Ie==="break")break}t.placement!==V&&(t.modifiersData[r]._skip=!0,t.placement=V,t.reset=!0)}}const Lk={name:"flip",enabled:!0,phase:"main",fn:Fk,requiresIfExists:["offset"],data:{_skip:!1}};function bg(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Sg(e){return[Pn,$n,Un,In].some(function(t){return e[t]>=0})}function Bk(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,s=t.modifiersData.preventOverflow,c=Ka(t,{elementContext:"reference"}),u=Ka(t,{altBoundary:!0}),f=bg(c,r),p=bg(u,o,s),h=Sg(f),y=Sg(p);t.modifiersData[n]={referenceClippingOffsets:f,popperEscapeOffsets:p,isReferenceHidden:h,hasPopperEscaped:y},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":y})}const Hk={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Bk};function Wk(e,t,n){var r=Sr(e),o=[In,Pn].indexOf(r)>=0?-1:1,s=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,c=s[0],u=s[1];return c=c||0,u=(u||0)*o,[In,$n].indexOf(r)>=0?{x:u,y:c}:{x:c,y:u}}function Vk(e){var t=e.state,n=e.options,r=e.name,o=n.offset,s=o===void 0?[0,0]:o,c=ky.reduce(function(h,y){return h[y]=Wk(y,t.rects,s),h},{}),u=c[t.placement],f=u.x,p=u.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=f,t.modifiersData.popperOffsets.y+=p),t.modifiersData[r]=c}const Uk={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Vk};function $k(e){var t=e.state,n=e.name;t.modifiersData[n]=_y({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const Gk={name:"popperOffsets",enabled:!0,phase:"read",fn:$k,data:{}};function qk(e){return e==="x"?"y":"x"}function Yk(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,s=o===void 0?!0:o,c=n.altAxis,u=c===void 0?!1:c,f=n.boundary,p=n.rootBoundary,h=n.altBoundary,y=n.padding,x=n.tether,S=x===void 0?!0:x,C=n.tetherOffset,k=C===void 0?0:C,w=Ka(t,{boundary:f,rootBoundary:p,padding:y,altBoundary:h}),j=Sr(t.placement),I=Yi(t.placement),P=!I,M=jh(j),T=qk(M),D=t.modifiersData.popperOffsets,_=t.rects.reference,R=t.rects.popper,V=typeof k=="function"?k(Object.assign({},t.rects,{placement:t.placement})):k,F=typeof V=="number"?{mainAxis:V,altAxis:V}:Object.assign({mainAxis:0,altAxis:0},V),L=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,Q={x:0,y:0};if(D){if(s){var U,K=M==="y"?Pn:In,te=M==="y"?Un:$n,ne=M==="y"?"height":"width",$=D[M],Z=$+w[K],oe=$-w[te],le=S?-R[ne]/2:0,Re=I===$i?_[ne]:R[ne],Ne=I===$i?-R[ne]:-_[ne],Ie=t.elements.arrow,pe=S&&Ie?kh(Ie):{width:0,height:0},ce=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Py(),Fe=ce[K],Ve=ce[te],Ue=Na(0,_[ne],pe[ne]),$e=P?_[ne]/2-le-Ue-Fe-F.mainAxis:Re-Ue-Fe-F.mainAxis,Qe=P?-_[ne]/2+le+Ue+Ve+F.mainAxis:Ne+Ue+Ve+F.mainAxis,ge=t.elements.arrow&&ds(t.elements.arrow),Te=ge?M==="y"?ge.clientTop||0:ge.clientLeft||0:0,Ge=(U=L==null?void 0:L[M])!=null?U:0,ye=$+$e-Ge-Te,Pe=$+Qe-Ge,et=Na(S?ac(Z,ye):Z,$,S?qo(oe,Pe):oe);D[M]=et,Q[M]=et-$}if(u){var Be,vt=M==="x"?Pn:In,Rt=M==="x"?Un:$n,N=D[T],ue=T==="y"?"height":"width",xe=N+w[vt],ke=N-w[Rt],q=[Pn,In].indexOf(j)!==-1,ae=(Be=L==null?void 0:L[T])!=null?Be:0,Oe=q?xe:N-_[ue]-R[ue]-ae+F.altAxis,Ze=q?N+_[ue]+R[ue]-ae-F.altAxis:ke,J=S&&q?yk(Oe,N,Ze):Na(S?Oe:xe,N,S?Ze:ke);D[T]=J,Q[T]=J-N}t.modifiersData[r]=Q}}const Kk={name:"preventOverflow",enabled:!0,phase:"main",fn:Yk,requiresIfExists:["offset"]};function Xk(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Qk(e){return e===Gn(e)||!Vn(e)?Eh(e):Xk(e)}function Zk(e){var t=e.getBoundingClientRect(),n=Gi(t.width)/e.offsetWidth||1,r=Gi(t.height)/e.offsetHeight||1;return n!==1||r!==1}function Jk(e,t,n){n===void 0&&(n=!1);var r=Vn(t),o=Vn(t)&&Zk(t),s=xo(t),c=qi(e,o,n),u={scrollLeft:0,scrollTop:0},f={x:0,y:0};return(r||!r&&!n)&&((kr(t)!=="body"||Ih(s))&&(u=Qk(t)),Vn(t)?(f=qi(t,!0),f.x+=t.clientLeft,f.y+=t.clientTop):s&&(f.x=Ph(s))),{x:c.left+u.scrollLeft-f.x,y:c.top+u.scrollTop-f.y,width:c.width,height:c.height}}function ej(e){var t=new Map,n=new Set,r=[];e.forEach(function(s){t.set(s.name,s)});function o(s){n.add(s.name);var c=[].concat(s.requires||[],s.requiresIfExists||[]);c.forEach(function(u){if(!n.has(u)){var f=t.get(u);f&&o(f)}}),r.push(s)}return e.forEach(function(s){n.has(s.name)||o(s)}),r}function tj(e){var t=ej(e);return fk.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function nj(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function rj(e){var t=e.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var Cg={placement:"bottom",modifiers:[],strategy:"absolute"};function wg(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function oj(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,o=t.defaultOptions,s=o===void 0?Cg:o;return function(u,f,p){p===void 0&&(p=s);var h={placement:"bottom",orderedModifiers:[],options:Object.assign({},Cg,s),modifiersData:{},elements:{reference:u,popper:f},attributes:{},styles:{}},y=[],x=!1,S={state:h,setOptions:function(j){var I=typeof j=="function"?j(h.options):j;k(),h.options=Object.assign({},s,h.options,I),h.scrollParents={reference:Xo(u)?Fa(u):u.contextElement?Fa(u.contextElement):[],popper:Fa(f)};var P=tj(rj([].concat(r,h.options.modifiers)));return h.orderedModifiers=P.filter(function(M){return M.enabled}),C(),S.update()},forceUpdate:function(){if(!x){var j=h.elements,I=j.reference,P=j.popper;if(wg(I,P)){h.rects={reference:Jk(I,ds(P),h.options.strategy==="fixed"),popper:kh(P)},h.reset=!1,h.placement=h.options.placement,h.orderedModifiers.forEach(function(F){return h.modifiersData[F.name]=Object.assign({},F.data)});for(var M=0;M<h.orderedModifiers.length;M++){if(h.reset===!0){h.reset=!1,M=-1;continue}var T=h.orderedModifiers[M],D=T.fn,_=T.options,R=_===void 0?{}:_,V=T.name;typeof D=="function"&&(h=D({state:h,options:R,name:V,instance:S})||h)}}}},update:nj(function(){return new Promise(function(w){S.forceUpdate(),w(h)})}),destroy:function(){k(),x=!0}};if(!wg(u,f))return S;S.setOptions(p).then(function(w){!x&&p.onFirstUpdate&&p.onFirstUpdate(w)});function C(){h.orderedModifiers.forEach(function(w){var j=w.name,I=w.options,P=I===void 0?{}:I,M=w.effect;if(typeof M=="function"){var T=M({state:h,name:j,instance:S,options:P}),D=function(){};y.push(T||D)}})}function k(){y.forEach(function(w){return w()}),y=[]}return S}}var ij=[Ik,Gk,Ek,mk,Uk,Lk,Kk,Ck,Hk],aj=oj({defaultModifiers:ij});function Mh(e={}){const{enabled:t=!0,modifiers:n,placement:r="bottom",strategy:o="absolute",arrowPadding:s=8,eventListeners:c=!0,offset:u,gutter:f=8,flip:p=!0,boundary:h="clippingParents",preventOverflow:y=!0,matchWidth:x,direction:S="ltr"}=e,C=g.useRef(null),k=g.useRef(null),w=g.useRef(null),j=ek(r,S),I=g.useRef(()=>{}),P=g.useCallback(()=>{var F;!t||!C.current||!k.current||((F=I.current)==null||F.call(I),w.current=aj(C.current,k.current,{placement:j,modifiers:[Q6,Y6,q6,{...G6,enabled:!!x},{name:"eventListeners",...$6(c)},{name:"arrow",options:{padding:s}},{name:"offset",options:{offset:u??[0,f]}},{name:"flip",enabled:!!p,options:{padding:8}},{name:"preventOverflow",enabled:!!y,options:{boundary:h}},...n??[]],strategy:o}),w.current.forceUpdate(),I.current=w.current.destroy)},[j,t,n,x,c,s,u,f,p,y,h,o]);g.useEffect(()=>()=>{var F;!C.current&&!k.current&&((F=w.current)==null||F.destroy(),w.current=null)},[]);const M=g.useCallback(F=>{C.current=F,P()},[P]),T=g.useCallback((F={},L=null)=>({...F,ref:ct(M,L)}),[M]),D=g.useCallback(F=>{k.current=F,P()},[P]),_=g.useCallback((F={},L=null)=>({...F,ref:ct(D,L),style:{...F.style,position:o,minWidth:x?void 0:"max-content",inset:"0 auto auto 0"}}),[o,D,x]),R=g.useCallback((F={},L=null)=>{const{size:Q,shadowColor:U,bg:K,style:te,...ne}=F;return{...ne,ref:L,"data-popper-arrow":"",style:sj(F)}},[]),V=g.useCallback((F={},L=null)=>({...F,ref:L,"data-popper-arrow-inner":""}),[]);return{update(){var F;(F=w.current)==null||F.update()},forceUpdate(){var F;(F=w.current)==null||F.forceUpdate()},transformOrigin:Ht.transformOrigin.varRef,referenceRef:M,popperRef:D,getPopperProps:_,getArrowProps:R,getArrowInnerProps:V,getReferenceProps:T}}function sj(e){const{size:t,shadowColor:n,bg:r,style:o}=e,s={...o,position:"absolute"};return t&&(s["--popper-arrow-size"]=t),n&&(s["--popper-arrow-shadow-color"]=n),r&&(s["--popper-arrow-bg"]=r),s}function Th(e={}){const{onClose:t,onOpen:n,isOpen:r,id:o}=e,s=Wt(n),c=Wt(t),[u,f]=g.useState(e.defaultIsOpen||!1),p=r!==void 0?r:u,h=r!==void 0,y=g.useId(),x=o??`disclosure-${y}`,S=g.useCallback(()=>{h||f(!1),c==null||c()},[h,c]),C=g.useCallback(()=>{h||f(!0),s==null||s()},[h,s]),k=g.useCallback(()=>{p?S():C()},[p,C,S]);function w(I={}){return{...I,"aria-expanded":p,"aria-controls":x,onClick(P){var M;(M=I.onClick)==null||M.call(I,P),k()}}}function j(I={}){return{...I,hidden:!p,id:x}}return{isOpen:p,onOpen:C,onClose:S,onToggle:k,isControlled:h,getButtonProps:w,getDisclosureProps:j}}function lj(e){const{ref:t,handler:n,enabled:r=!0}=e,o=Wt(n),c=g.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}).current;g.useEffect(()=>{if(!r)return;const u=y=>{Cd(y,t)&&(c.isPointerDown=!0)},f=y=>{if(c.ignoreEmulatedMouseEvents){c.ignoreEmulatedMouseEvents=!1;return}c.isPointerDown&&n&&Cd(y,t)&&(c.isPointerDown=!1,o(y))},p=y=>{c.ignoreEmulatedMouseEvents=!0,n&&c.isPointerDown&&Cd(y,t)&&(c.isPointerDown=!1,o(y))},h=Dy(t.current);return h.addEventListener("mousedown",u,!0),h.addEventListener("mouseup",f,!0),h.addEventListener("touchstart",u,!0),h.addEventListener("touchend",p,!0),()=>{h.removeEventListener("mousedown",u,!0),h.removeEventListener("mouseup",f,!0),h.removeEventListener("touchstart",u,!0),h.removeEventListener("touchend",p,!0)}},[n,t,o,c,r])}function Cd(e,t){var n;const r=e.target;return e.button>0||r&&!Dy(r).contains(r)?!1:!((n=t.current)!=null&&n.contains(r))}function Dy(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function Ay(e){const{isOpen:t,ref:n}=e,[r,o]=g.useState(t),[s,c]=g.useState(!1);return g.useEffect(()=>{s||(o(t),c(!0))},[t,s,r]),$o(()=>n.current,"animationend",()=>{o(t)}),{present:!(t?!1:!r),onComplete(){var f;const p=f6(n.current),h=new p.CustomEvent("animationend",{bubbles:!0});(f=n.current)==null||f.dispatchEvent(h)}}}function _h(e){const{wasSelected:t,enabled:n,isSelected:r,mode:o="unmount"}=e;return!!(!n||r||o==="keepMounted"&&t)}var[cj,uj,dj,fj]=eh(),[hj,fs]=jt({strict:!1,name:"MenuContext"});function pj(e,...t){const n=g.useId(),r=e||n;return g.useMemo(()=>t.map(o=>`${o}-${r}`),[r,t])}function Oy(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function kg(e){return Oy(e).activeElement===e}function mj(e={}){const{id:t,closeOnSelect:n=!0,closeOnBlur:r=!0,initialFocusRef:o,autoSelect:s=!0,isLazy:c,isOpen:u,defaultIsOpen:f,onClose:p,onOpen:h,placement:y="bottom-start",lazyBehavior:x="unmount",direction:S,computePositionOnMount:C=!1,...k}=e,w=g.useRef(null),j=g.useRef(null),I=dj(),P=g.useCallback(()=>{requestAnimationFrame(()=>{var Ie;(Ie=w.current)==null||Ie.focus({preventScroll:!1})})},[]),M=g.useCallback(()=>{const Ie=setTimeout(()=>{var pe;if(o)(pe=o.current)==null||pe.focus();else{const ce=I.firstEnabled();ce&&U(ce.index)}});Z.current.add(Ie)},[I,o]),T=g.useCallback(()=>{const Ie=setTimeout(()=>{const pe=I.lastEnabled();pe&&U(pe.index)});Z.current.add(Ie)},[I]),D=g.useCallback(()=>{h==null||h(),s?M():P()},[s,M,P,h]),{isOpen:_,onOpen:R,onClose:V,onToggle:F}=Th({isOpen:u,defaultIsOpen:f,onClose:p,onOpen:D});lj({enabled:_&&r,ref:w,handler:Ie=>{var pe;(pe=j.current)!=null&&pe.contains(Ie.target)||V()}});const L=Mh({...k,enabled:_||C,placement:y,direction:S}),[Q,U]=g.useState(-1);ei(()=>{_||U(-1)},[_]),Cy(w,{focusRef:j,visible:_,shouldFocus:!0});const K=Ay({isOpen:_,ref:w}),[te,ne]=pj(t,"menu-button","menu-list"),$=g.useCallback(()=>{R(),P()},[R,P]),Z=g.useRef(new Set([]));Cj(()=>{Z.current.forEach(Ie=>clearTimeout(Ie)),Z.current.clear()});const oe=g.useCallback(()=>{R(),M()},[M,R]),le=g.useCallback(()=>{R(),T()},[R,T]),Re=g.useCallback(()=>{var Ie,pe;const ce=Oy(w.current),Fe=(Ie=w.current)==null?void 0:Ie.contains(ce.activeElement);if(!(_&&!Fe))return;const Ue=(pe=I.item(Q))==null?void 0:pe.node;Ue==null||Ue.focus()},[_,Q,I]),Ne=g.useRef(null);return{openAndFocusMenu:$,openAndFocusFirstItem:oe,openAndFocusLastItem:le,onTransitionEnd:Re,unstable__animationState:K,descendants:I,popper:L,buttonId:te,menuId:ne,forceUpdate:L.forceUpdate,orientation:"vertical",isOpen:_,onToggle:F,onOpen:R,onClose:V,menuRef:w,buttonRef:j,focusedIndex:Q,closeOnSelect:n,closeOnBlur:r,autoSelect:s,setFocusedIndex:U,isLazy:c,lazyBehavior:x,initialFocusRef:o,rafId:Ne}}function vj(e={},t=null){const n=fs(),{onToggle:r,popper:o,openAndFocusFirstItem:s,openAndFocusLastItem:c}=n,u=g.useCallback(f=>{const p=f.key,y={Enter:s,ArrowDown:s,ArrowUp:c}[p];y&&(f.preventDefault(),f.stopPropagation(),y(f))},[s,c]);return{...e,ref:ct(n.buttonRef,t,o.referenceRef),id:n.buttonId,"data-active":qe(n.isOpen),"aria-expanded":n.isOpen,"aria-haspopup":"menu","aria-controls":n.menuId,onClick:Ee(e.onClick,r),onKeyDown:Ee(e.onKeyDown,u)}}function jf(e){var t;return bj(e)&&!!((t=e==null?void 0:e.getAttribute("role"))!=null&&t.startsWith("menuitem"))}function gj(e={},t=null){const n=fs();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:c,onClose:u,menuId:f,isLazy:p,lazyBehavior:h,unstable__animationState:y}=n,x=uj(),S=z6({preventDefault:j=>j.key!==" "&&jf(j.target)}),C=g.useCallback(j=>{const I=j.key,M={Tab:D=>D.preventDefault(),Escape:u,ArrowDown:()=>{const D=x.nextEnabled(r);D&&o(D.index)},ArrowUp:()=>{const D=x.prevEnabled(r);D&&o(D.index)}}[I];if(M){j.preventDefault(),M(j);return}const T=S(D=>{const _=R6(x.values(),D,R=>{var V,F;return(F=(V=R==null?void 0:R.node)==null?void 0:V.textContent)!=null?F:""},x.item(r));if(_){const R=x.indexOf(_.node);o(R)}});jf(j.target)&&T(j)},[x,r,S,u,o]),k=g.useRef(!1);c&&(k.current=!0);const w=_h({wasSelected:k.current,enabled:p,mode:h,isSelected:y.present});return{...e,ref:ct(s,t),children:w?e.children:null,tabIndex:-1,role:"menu",id:f,style:{...e.style,transformOrigin:"var(--popper-transform-origin)"},"aria-orientation":"vertical",onKeyDown:Ee(e.onKeyDown,C)}}function yj(e={}){const{popper:t,isOpen:n}=fs();return t.getPopperProps({...e,style:{visibility:n?"visible":"hidden",...e.style}})}function xj(e={},t=null){const{onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onClick:s,onFocus:c,isDisabled:u,isFocusable:f,closeOnSelect:p,type:h,...y}=e,x=fs(),{setFocusedIndex:S,focusedIndex:C,closeOnSelect:k,onClose:w,menuRef:j,isOpen:I,menuId:P,rafId:M}=x,T=g.useRef(null),D=`${P}-menuitem-${g.useId()}`,{index:_,register:R}=fj({disabled:u&&!f}),V=g.useCallback($=>{n==null||n($),!u&&S(_)},[S,_,u,n]),F=g.useCallback($=>{r==null||r($),T.current&&!kg(T.current)&&V($)},[V,r]),L=g.useCallback($=>{o==null||o($),!u&&S(-1)},[S,u,o]),Q=g.useCallback($=>{s==null||s($),jf($.currentTarget)&&(p??k)&&w()},[w,s,k,p]),U=g.useCallback($=>{c==null||c($),S(_)},[S,c,_]),K=_===C,te=u&&!f;ei(()=>{I&&(K&&!te&&T.current?(M.current&&cancelAnimationFrame(M.current),M.current=requestAnimationFrame(()=>{var $;($=T.current)==null||$.focus(),M.current=null})):j.current&&!kg(j.current)&&j.current.focus())},[K,te,j,I]);const ne=Sy({onClick:Q,onFocus:U,onMouseEnter:V,onMouseMove:F,onMouseLeave:L,ref:ct(R,T,t),isDisabled:u,isFocusable:f});return{...y,...ne,type:h??ne.type,id:D,role:"menuitem",tabIndex:K?0:-1}}function bj(e){var t;if(!Sj(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function Sj(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Cj(e,t=[]){return g.useEffect(()=>()=>e(),t)}var[wj,Ec]=jt({name:"MenuStylesContext",errorMessage:`useMenuStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Menu />" `}),Dh=e=>{const{children:t}=e,n=un("Menu",e),r=At(e),{direction:o}=ea(),{descendants:s,...c}=mj({...r,direction:o}),u=g.useMemo(()=>c,[c]),{isOpen:f,onClose:p,forceUpdate:h}=u;return l.jsx(cj,{value:s,children:l.jsx(hj,{value:u,children:l.jsx(wj,{value:n,children:y1(t,{isOpen:f,onClose:p,forceUpdate:h})})})})};Dh.displayName="Menu";var zy=fe((e,t)=>{const n=Ec();return l.jsx(re.span,{ref:t,...e,__css:n.command,className:"chakra-menu__command"})});zy.displayName="MenuCommand";var kj=fe((e,t)=>{const{type:n,...r}=e,o=Ec(),s=r.as||n?n??void 0:"button",c=g.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 l.jsx(re.button,{ref:t,type:s,...r,__css:c})}),Ry=e=>{const{className:t,children:n,...r}=e,o=g.Children.only(n),s=g.isValidElement(o)?g.cloneElement(o,{focusable:"false","aria-hidden":!0,className:Ae("chakra-menu__icon",o.props.className)}):null,c=Ae("chakra-menu__icon-wrapper",t);return l.jsx(re.span,{className:c,...r,__css:{flexShrink:0},children:s})};Ry.displayName="MenuIcon";var vr=fe((e,t)=>{const{icon:n,iconSpacing:r="0.75rem",command:o,commandSpacing:s="0.75rem",children:c,...u}=e,f=xj(u,t),h=n||o?l.jsx("span",{style:{pointerEvents:"none",flex:1},children:c}):c;return l.jsxs(kj,{...f,className:Ae("chakra-menu__menuitem",f.className),children:[n&&l.jsx(Ry,{fontSize:"0.8em",marginEnd:r,children:n}),h,o&&l.jsx(zy,{marginStart:s,children:o})]})});vr.displayName="MenuItem";var jj={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"}}},Ej=re(ir.div),Ah=fe(function(t,n){var r,o;const{rootProps:s,motionProps:c,...u}=t,{isOpen:f,onTransitionEnd:p,unstable__animationState:h}=fs(),y=gj(u,n),x=yj(s),S=Ec();return l.jsx(re.div,{...x,__css:{zIndex:(o=t.zIndex)!=null?o:(r=S.list)==null?void 0:r.zIndex},children:l.jsx(Ej,{variants:jj,initial:!1,animate:f?"enter":"exit",__css:{outline:0,...S.list},...c,className:Ae("chakra-menu__menu-list",y.className),...y,onUpdate:p,onAnimationComplete:yc(h.onComplete,y.onAnimationComplete)})})});Ah.displayName="MenuList";var Pj=fe((e,t)=>{const n=Ec();return l.jsx(re.button,{ref:t,...e,__css:{display:"inline-flex",appearance:"none",alignItems:"center",outline:0,...n.button}})}),Oh=fe((e,t)=>{const{children:n,as:r,...o}=e,s=vj(o,t),c=r||Pj;return l.jsx(c,{...s,className:Ae("chakra-menu__menu-button",e.className),children:l.jsx(re.span,{__css:{pointerEvents:"none",flex:"1 1 auto",minW:0},children:e.children})})});Oh.displayName="MenuButton";var Ij={slideInBottom:{...ff,custom:{offsetY:16,reverse:!0}},slideInRight:{...ff,custom:{offsetX:16,reverse:!0}},scale:{...g2,custom:{initialScale:.95,reverse:!0}},none:{}},Mj=re(ir.section),Tj=e=>Ij[e||"none"],Ny=g.forwardRef((e,t)=>{const{preset:n,motionProps:r=Tj(n),...o}=e;return l.jsx(Mj,{ref:t,...r,...o})});Ny.displayName="ModalTransition";var _j=Object.defineProperty,Dj=(e,t,n)=>t in e?_j(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Aj=(e,t,n)=>(Dj(e,typeof t!="symbol"?t+"":t,n),n),Oj=class{constructor(){Aj(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}},Ef=new Oj;function Fy(e,t){const[n,r]=g.useState(0);return g.useEffect(()=>{const o=e.current;if(o){if(t){const s=Ef.add(o);r(s)}return()=>{Ef.remove(o),r(0)}}},[t,e]),n}var zj=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ji=new WeakMap,Sl=new WeakMap,Cl={},wd=0,Ly=function(e){return e&&(e.host||Ly(e.parentNode))},Rj=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Ly(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return Boolean(n)})},Nj=function(e,t,n,r){var o=Rj(t,Array.isArray(e)?e:[e]);Cl[n]||(Cl[n]=new WeakMap);var s=Cl[n],c=[],u=new Set,f=new Set(o),p=function(y){!y||u.has(y)||(u.add(y),p(y.parentNode))};o.forEach(p);var h=function(y){!y||f.has(y)||Array.prototype.forEach.call(y.children,function(x){if(u.has(x))h(x);else{var S=x.getAttribute(r),C=S!==null&&S!=="false",k=(ji.get(x)||0)+1,w=(s.get(x)||0)+1;ji.set(x,k),s.set(x,w),c.push(x),k===1&&C&&Sl.set(x,!0),w===1&&x.setAttribute(n,"true"),C||x.setAttribute(r,"true")}})};return h(t),u.clear(),wd++,function(){c.forEach(function(y){var x=ji.get(y)-1,S=s.get(y)-1;ji.set(y,x),s.set(y,S),x||(Sl.has(y)||y.removeAttribute(r),Sl.delete(y)),S||y.removeAttribute(n)}),wd--,wd||(ji=new WeakMap,ji=new WeakMap,Sl=new WeakMap,Cl={})}},Fj=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||zj(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),Nj(r,o,n,"aria-hidden")):function(){return null}};function Lj(e){const{isOpen:t,onClose:n,id:r,closeOnOverlayClick:o=!0,closeOnEsc:s=!0,useInert:c=!0,onOverlayClick:u,onEsc:f}=e,p=g.useRef(null),h=g.useRef(null),[y,x,S]=Hj(r,"chakra-modal","chakra-modal--header","chakra-modal--body");Bj(p,t&&c),Fy(p,t);const C=g.useRef(null),k=g.useCallback(R=>{C.current=R.target},[]),w=g.useCallback(R=>{R.key==="Escape"&&(R.stopPropagation(),s&&(n==null||n()),f==null||f())},[s,n,f]),[j,I]=g.useState(!1),[P,M]=g.useState(!1),T=g.useCallback((R={},V=null)=>({role:"dialog",...R,ref:ct(V,p),id:y,tabIndex:-1,"aria-modal":!0,"aria-labelledby":j?x:void 0,"aria-describedby":P?S:void 0,onClick:Ee(R.onClick,F=>F.stopPropagation())}),[S,P,y,x,j]),D=g.useCallback(R=>{R.stopPropagation(),C.current===R.target&&Ef.isTopModal(p.current)&&(o&&(n==null||n()),u==null||u())},[n,o,u]),_=g.useCallback((R={},V=null)=>({...R,ref:ct(V,h),onClick:Ee(R.onClick,D),onKeyDown:Ee(R.onKeyDown,w),onMouseDown:Ee(R.onMouseDown,k)}),[w,k,D]);return{isOpen:t,onClose:n,headerId:x,bodyId:S,setBodyMounted:M,setHeaderMounted:I,dialogRef:p,overlayRef:h,getDialogProps:T,getDialogContainerProps:_}}function Bj(e,t){const n=e.current;g.useEffect(()=>{if(!(!e.current||!t))return Fj(e.current)},[t,e,n])}function Hj(e,...t){const n=g.useId(),r=e||n;return g.useMemo(()=>t.map(o=>`${o}-${r}`),[r,t])}var[Wj,oa]=jt({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Modal />" `}),[Vj,Qo]=jt({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in `<Modal />`"}),po=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:c,finalFocusRef:u,returnFocusOnClose:f,blockScrollOnMount:p,allowPinchZoom:h,preserveScrollBarGap:y,motionPreset:x,lockFocusAcrossFrames:S,onCloseComplete:C}=t,k=un("Modal",t),j={...Lj(t),autoFocus:o,trapFocus:s,initialFocusRef:c,finalFocusRef:u,returnFocusOnClose:f,blockScrollOnMount:p,allowPinchZoom:h,preserveScrollBarGap:y,motionPreset:x,lockFocusAcrossFrames:S};return l.jsx(Vj,{value:j,children:l.jsx(Wj,{value:k,children:l.jsx(yo,{onExitComplete:C,children:j.isOpen&&l.jsx(Ua,{...n,children:r})})})})};po.displayName="Modal";var Vl="right-scroll-bar-position",Ul="width-before-scroll-bar",Uj="with-scroll-bars-hidden",$j="--removed-body-scroll-bar-size",By=O2(),kd=function(){},Pc=g.forwardRef(function(e,t){var n=g.useRef(null),r=g.useState({onScrollCapture:kd,onWheelCapture:kd,onTouchMoveCapture:kd}),o=r[0],s=r[1],c=e.forwardProps,u=e.children,f=e.className,p=e.removeScrollBar,h=e.enabled,y=e.shards,x=e.sideCar,S=e.noIsolation,C=e.inert,k=e.allowPinchZoom,w=e.as,j=w===void 0?"div":w,I=_2(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),P=x,M=T2([n,t]),T=yr(yr({},I),o);return g.createElement(g.Fragment,null,h&&g.createElement(P,{sideCar:By,removeScrollBar:p,shards:y,noIsolation:S,inert:C,setCallbacks:s,allowPinchZoom:!!k,lockRef:n}),c?g.cloneElement(g.Children.only(u),yr(yr({},T),{ref:M})):g.createElement(j,yr({},T,{className:f,ref:M}),u))});Pc.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Pc.classNames={fullWidth:Ul,zeroRight:Vl};var jg,Gj=function(){if(jg)return jg;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function qj(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Gj();return t&&e.setAttribute("nonce",t),e}function Yj(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Kj(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Xj=function(){var e=0,t=null;return{add:function(n){e==0&&(t=qj())&&(Yj(t,n),Kj(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Qj=function(){var e=Xj();return function(t,n){g.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Hy=function(){var e=Qj(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Zj={left:0,top:0,right:0,gap:0},jd=function(e){return parseInt(e||"",10)||0},Jj=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[jd(n),jd(r),jd(o)]},e7=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Zj;var t=Jj(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])}},t7=Hy(),n7=function(e,t,n,r){var o=e.left,s=e.top,c=e.right,u=e.gap;return n===void 0&&(n="margin"),`
|
||
.`.concat(Uj,` {
|
||
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(c,`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(Vl,` {
|
||
right: `).concat(u,"px ").concat(r,`;
|
||
}
|
||
|
||
.`).concat(Ul,` {
|
||
margin-right: `).concat(u,"px ").concat(r,`;
|
||
}
|
||
|
||
.`).concat(Vl," .").concat(Vl,` {
|
||
right: 0 `).concat(r,`;
|
||
}
|
||
|
||
.`).concat(Ul," .").concat(Ul,` {
|
||
margin-right: 0 `).concat(r,`;
|
||
}
|
||
|
||
body {
|
||
`).concat($j,": ").concat(u,`px;
|
||
}
|
||
`)},r7=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,s=g.useMemo(function(){return e7(o)},[o]);return g.createElement(t7,{styles:n7(s,!t,o,n?"":"!important")})},Pf=!1;if(typeof window<"u")try{var wl=Object.defineProperty({},"passive",{get:function(){return Pf=!0,!0}});window.addEventListener("test",wl,wl),window.removeEventListener("test",wl,wl)}catch{Pf=!1}var Ei=Pf?{passive:!1}:!1,o7=function(e){return e.tagName==="TEXTAREA"},Wy=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!o7(e)&&n[t]==="visible")},i7=function(e){return Wy(e,"overflowY")},a7=function(e){return Wy(e,"overflowX")},Eg=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=Vy(e,n);if(r){var o=Uy(e,n),s=o[1],c=o[2];if(s>c)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},s7=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},l7=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Vy=function(e,t){return e==="v"?i7(t):a7(t)},Uy=function(e,t){return e==="v"?s7(t):l7(t)},c7=function(e,t){return e==="h"&&t==="rtl"?-1:1},u7=function(e,t,n,r,o){var s=c7(e,window.getComputedStyle(t).direction),c=s*r,u=n.target,f=t.contains(u),p=!1,h=c>0,y=0,x=0;do{var S=Uy(e,u),C=S[0],k=S[1],w=S[2],j=k-w-s*C;(C||j)&&Vy(e,u)&&(y+=j,x+=C),u=u.parentNode}while(!f&&u!==document.body||f&&(t.contains(u)||t===u));return(h&&(o&&y===0||!o&&c>y)||!h&&(o&&x===0||!o&&-c>x))&&(p=!0),p},kl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Pg=function(e){return[e.deltaX,e.deltaY]},Ig=function(e){return e&&"current"in e?e.current:e},d7=function(e,t){return e[0]===t[0]&&e[1]===t[1]},f7=function(e){return`
|
||
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
||
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
||
`)},h7=0,Pi=[];function p7(e){var t=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),o=g.useState(h7++)[0],s=g.useState(function(){return Hy()})[0],c=g.useRef(e);g.useEffect(function(){c.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var k=xf([e.lockRef.current],(e.shards||[]).map(Ig),!0).filter(Boolean);return k.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),k.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var u=g.useCallback(function(k,w){if("touches"in k&&k.touches.length===2)return!c.current.allowPinchZoom;var j=kl(k),I=n.current,P="deltaX"in k?k.deltaX:I[0]-j[0],M="deltaY"in k?k.deltaY:I[1]-j[1],T,D=k.target,_=Math.abs(P)>Math.abs(M)?"h":"v";if("touches"in k&&_==="h"&&D.type==="range")return!1;var R=Eg(_,D);if(!R)return!0;if(R?T=_:(T=_==="v"?"h":"v",R=Eg(_,D)),!R)return!1;if(!r.current&&"changedTouches"in k&&(P||M)&&(r.current=T),!T)return!0;var V=r.current||T;return u7(V,w,k,V==="h"?P:M,!0)},[]),f=g.useCallback(function(k){var w=k;if(!(!Pi.length||Pi[Pi.length-1]!==s)){var j="deltaY"in w?Pg(w):kl(w),I=t.current.filter(function(T){return T.name===w.type&&T.target===w.target&&d7(T.delta,j)})[0];if(I&&I.should){w.cancelable&&w.preventDefault();return}if(!I){var P=(c.current.shards||[]).map(Ig).filter(Boolean).filter(function(T){return T.contains(w.target)}),M=P.length>0?u(w,P[0]):!c.current.noIsolation;M&&w.cancelable&&w.preventDefault()}}},[]),p=g.useCallback(function(k,w,j,I){var P={name:k,delta:w,target:j,should:I};t.current.push(P),setTimeout(function(){t.current=t.current.filter(function(M){return M!==P})},1)},[]),h=g.useCallback(function(k){n.current=kl(k),r.current=void 0},[]),y=g.useCallback(function(k){p(k.type,Pg(k),k.target,u(k,e.lockRef.current))},[]),x=g.useCallback(function(k){p(k.type,kl(k),k.target,u(k,e.lockRef.current))},[]);g.useEffect(function(){return Pi.push(s),e.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:x}),document.addEventListener("wheel",f,Ei),document.addEventListener("touchmove",f,Ei),document.addEventListener("touchstart",h,Ei),function(){Pi=Pi.filter(function(k){return k!==s}),document.removeEventListener("wheel",f,Ei),document.removeEventListener("touchmove",f,Ei),document.removeEventListener("touchstart",h,Ei)}},[]);var S=e.removeScrollBar,C=e.inert;return g.createElement(g.Fragment,null,C?g.createElement(s,{styles:f7(o)}):null,S?g.createElement(r7,{gapMode:"margin"}):null)}const m7=m5(By,p7);var $y=g.forwardRef(function(e,t){return g.createElement(Pc,yr({},e,{ref:t,sideCar:m7}))});$y.classNames=Pc.classNames;const v7=$y;function g7(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:o,blockScrollOnMount:s,allowPinchZoom:c,finalFocusRef:u,returnFocusOnClose:f,preserveScrollBarGap:p,lockFocusAcrossFrames:h,isOpen:y}=Qo(),[x,S]=SC();g.useEffect(()=>{!x&&S&&setTimeout(S)},[x,S]);const C=Fy(r,y);return l.jsx(fy,{autoFocus:t,isDisabled:!n,initialFocusRef:o,finalFocusRef:u,restoreFocus:f,contentRef:r,lockFocusAcrossFrames:h,children:l.jsx(v7,{removeScrollBar:!p,allowPinchZoom:c,enabled:C===1&&s,forwardProps:!0,children:e.children})})}var mo=fe((e,t)=>{const{className:n,children:r,containerProps:o,motionProps:s,...c}=e,{getDialogProps:u,getDialogContainerProps:f}=Qo(),p=u(c,t),h=f(o),y=Ae("chakra-modal__content",n),x=oa(),S={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...x.dialog},C={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...x.dialogContainer},{motionPreset:k}=Qo();return l.jsx(g7,{children:l.jsx(re.div,{...h,className:"chakra-modal__content-container",tabIndex:-1,__css:C,children:l.jsx(Ny,{preset:k,motionProps:s,className:y,...p,__css:S,children:r})})})});mo.displayName="ModalContent";function Gy(e){const{leastDestructiveRef:t,...n}=e;return l.jsx(po,{...n,initialFocusRef:t})}var qy=fe((e,t)=>l.jsx(mo,{ref:t,role:"alertdialog",...e})),Fr=fe((e,t)=>{const{className:n,...r}=e,o=Ae("chakra-modal__footer",n),c={display:"flex",alignItems:"center",justifyContent:"flex-end",...oa().footer};return l.jsx(re.footer,{ref:t,...r,__css:c,className:o})});Fr.displayName="ModalFooter";var Lr=fe((e,t)=>{const{className:n,...r}=e,{headerId:o,setHeaderMounted:s}=Qo();g.useEffect(()=>(s(!0),()=>s(!1)),[s]);const c=Ae("chakra-modal__header",n),f={flex:0,...oa().header};return l.jsx(re.header,{ref:t,className:c,id:o,...r,__css:f})});Lr.displayName="ModalHeader";var y7=re(ir.div),Br=fe((e,t)=>{const{className:n,transition:r,motionProps:o,...s}=e,c=Ae("chakra-modal__overlay",n),f={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...oa().overlay},{motionPreset:p}=Qo(),y=o||(p==="none"?{}:v2);return l.jsx(y7,{...y,__css:f,ref:t,className:c,...s})});Br.displayName="ModalOverlay";var Hr=fe((e,t)=>{const{className:n,...r}=e,{bodyId:o,setBodyMounted:s}=Qo();g.useEffect(()=>(s(!0),()=>s(!1)),[s]);const c=Ae("chakra-modal__body",n),u=oa();return l.jsx(re.div,{ref:t,className:c,id:o,...r,__css:u.body})});Hr.displayName="ModalBody";var ia=fe((e,t)=>{const{onClick:n,className:r,...o}=e,{onClose:s}=Qo(),c=Ae("chakra-modal__close-btn",r),u=oa();return l.jsx(CC,{ref:t,__css:u.closeButton,className:c,onClick:Ee(n,f=>{f.stopPropagation(),s()}),...o})});ia.displayName="ModalCloseButton";var x7=e=>l.jsx(tn,{viewBox:"0 0 24 24",...e,children:l.jsx("path",{fill:"currentColor",d:"M21,5H3C2.621,5,2.275,5.214,2.105,5.553C1.937,5.892,1.973,6.297,2.2,6.6l9,12 c0.188,0.252,0.485,0.4,0.8,0.4s0.611-0.148,0.8-0.4l9-12c0.228-0.303,0.264-0.708,0.095-1.047C21.725,5.214,21.379,5,21,5z"})}),b7=e=>l.jsx(tn,{viewBox:"0 0 24 24",...e,children:l.jsx("path",{fill:"currentColor",d:"M12.8,5.4c-0.377-0.504-1.223-0.504-1.6,0l-9,12c-0.228,0.303-0.264,0.708-0.095,1.047 C2.275,18.786,2.621,19,3,19h18c0.379,0,0.725-0.214,0.895-0.553c0.169-0.339,0.133-0.744-0.095-1.047L12.8,5.4z"})});function Mg(e,t,n,r){g.useEffect(()=>{var o;if(!e.current||!r)return;const s=(o=e.current.ownerDocument.defaultView)!=null?o:window,c=Array.isArray(t)?t:[t],u=new s.MutationObserver(f=>{for(const p of f)p.type==="attributes"&&p.attributeName&&c.includes(p.attributeName)&&n(p)});return u.observe(e.current,{attributes:!0,attributeFilter:c}),()=>u.disconnect()})}function S7(e,t){const n=Wt(e);g.useEffect(()=>{let r=null;const o=()=>n();return t!==null&&(r=window.setInterval(o,t)),()=>{r&&window.clearInterval(r)}},[t,n])}var C7=50,Tg=300;function w7(e,t){const[n,r]=g.useState(!1),[o,s]=g.useState(null),[c,u]=g.useState(!0),f=g.useRef(null),p=()=>clearTimeout(f.current);S7(()=>{o==="increment"&&e(),o==="decrement"&&t()},n?C7:null);const h=g.useCallback(()=>{c&&e(),f.current=setTimeout(()=>{u(!1),r(!0),s("increment")},Tg)},[e,c]),y=g.useCallback(()=>{c&&t(),f.current=setTimeout(()=>{u(!1),r(!0),s("decrement")},Tg)},[t,c]),x=g.useCallback(()=>{u(!0),r(!1),p()},[]);return g.useEffect(()=>()=>p(),[]),{up:h,down:y,stop:x,isSpinning:n}}var k7=/^[Ee0-9+\-.]$/;function j7(e){return k7.test(e)}function E7(e,t){if(e.key==null)return!0;const n=e.ctrlKey||e.altKey||e.metaKey;return!(e.key.length===1)||n?!0:t(e.key)}function P7(e={}){const{focusInputOnChange:t=!0,clampValueOnBlur:n=!0,keepWithinRange:r=!0,min:o=Number.MIN_SAFE_INTEGER,max:s=Number.MAX_SAFE_INTEGER,step:c=1,isReadOnly:u,isDisabled:f,isRequired:p,isInvalid:h,pattern:y="[0-9]*(.[0-9]+)?",inputMode:x="decimal",allowMouseWheel:S,id:C,onChange:k,precision:w,name:j,"aria-describedby":I,"aria-label":P,"aria-labelledby":M,onFocus:T,onBlur:D,onInvalid:_,getAriaValueText:R,isValidCharacter:V,format:F,parse:L,...Q}=e,U=Wt(T),K=Wt(D),te=Wt(_),ne=Wt(V??j7),$=Wt(R),Z=Qw(e),{update:oe,increment:le,decrement:Re}=Z,[Ne,Ie]=g.useState(!1),pe=!(u||f),ce=g.useRef(null),Fe=g.useRef(null),Ve=g.useRef(null),Ue=g.useRef(null),$e=g.useCallback(J=>J.split("").filter(ne).join(""),[ne]),Qe=g.useCallback(J=>{var Le;return(Le=L==null?void 0:L(J))!=null?Le:J},[L]),ge=g.useCallback(J=>{var Le;return((Le=F==null?void 0:F(J))!=null?Le:J).toString()},[F]);ei(()=>{(Z.valueAsNumber>s||Z.valueAsNumber<o)&&(te==null||te("rangeOverflow",ge(Z.value),Z.valueAsNumber))},[Z.valueAsNumber,Z.value,ge,te]),Bi(()=>{if(!ce.current)return;if(ce.current.value!=Z.value){const Le=Qe(ce.current.value);Z.setValue($e(Le))}},[Qe,$e]);const Te=g.useCallback((J=c)=>{pe&&le(J)},[le,pe,c]),Ge=g.useCallback((J=c)=>{pe&&Re(J)},[Re,pe,c]),ye=w7(Te,Ge);Mg(Ve,"disabled",ye.stop,ye.isSpinning),Mg(Ue,"disabled",ye.stop,ye.isSpinning);const Pe=g.useCallback(J=>{if(J.nativeEvent.isComposing)return;const nt=Qe(J.currentTarget.value);oe($e(nt)),Fe.current={start:J.currentTarget.selectionStart,end:J.currentTarget.selectionEnd}},[oe,$e,Qe]),et=g.useCallback(J=>{var Le,nt,Nt;U==null||U(J),Fe.current&&(J.target.selectionStart=(nt=Fe.current.start)!=null?nt:(Le=J.currentTarget.value)==null?void 0:Le.length,J.currentTarget.selectionEnd=(Nt=Fe.current.end)!=null?Nt:J.currentTarget.selectionStart)},[U]),Be=g.useCallback(J=>{if(J.nativeEvent.isComposing)return;E7(J,ne)||J.preventDefault();const Le=vt(J)*c,nt=J.key,he={ArrowUp:()=>Te(Le),ArrowDown:()=>Ge(Le),Home:()=>oe(o),End:()=>oe(s)}[nt];he&&(J.preventDefault(),he(J))},[ne,c,Te,Ge,oe,o,s]),vt=J=>{let Le=1;return(J.metaKey||J.ctrlKey)&&(Le=.1),J.shiftKey&&(Le=10),Le},Rt=g.useMemo(()=>{const J=$==null?void 0:$(Z.value);if(J!=null)return J;const Le=Z.value.toString();return Le||void 0},[Z.value,$]),N=g.useCallback(()=>{let J=Z.value;if(Z.value==="")return;/^[eE]/.test(Z.value.toString())?Z.setValue(""):(Z.valueAsNumber<o&&(J=o),Z.valueAsNumber>s&&(J=s),Z.cast(J))},[Z,s,o]),ue=g.useCallback(()=>{Ie(!1),n&&N()},[n,Ie,N]),xe=g.useCallback(()=>{t&&requestAnimationFrame(()=>{var J;(J=ce.current)==null||J.focus()})},[t]),ke=g.useCallback(J=>{J.preventDefault(),ye.up(),xe()},[xe,ye]),q=g.useCallback(J=>{J.preventDefault(),ye.down(),xe()},[xe,ye]);$o(()=>ce.current,"wheel",J=>{var Le,nt;const he=((nt=(Le=ce.current)==null?void 0:Le.ownerDocument)!=null?nt:document).activeElement===ce.current;if(!S||!he)return;J.preventDefault();const _e=vt(J)*c,dn=Math.sign(J.deltaY);dn===-1?Te(_e):dn===1&&Ge(_e)},{passive:!1});const ae=g.useCallback((J={},Le=null)=>{const nt=f||r&&Z.isAtMax;return{...J,ref:ct(Le,Ve),role:"button",tabIndex:-1,onPointerDown:Ee(J.onPointerDown,Nt=>{Nt.button!==0||nt||ke(Nt)}),onPointerLeave:Ee(J.onPointerLeave,ye.stop),onPointerUp:Ee(J.onPointerUp,ye.stop),disabled:nt,"aria-disabled":Rr(nt)}},[Z.isAtMax,r,ke,ye.stop,f]),Oe=g.useCallback((J={},Le=null)=>{const nt=f||r&&Z.isAtMin;return{...J,ref:ct(Le,Ue),role:"button",tabIndex:-1,onPointerDown:Ee(J.onPointerDown,Nt=>{Nt.button!==0||nt||q(Nt)}),onPointerLeave:Ee(J.onPointerLeave,ye.stop),onPointerUp:Ee(J.onPointerUp,ye.stop),disabled:nt,"aria-disabled":Rr(nt)}},[Z.isAtMin,r,q,ye.stop,f]),Ze=g.useCallback((J={},Le=null)=>{var nt,Nt,he,_e;return{name:j,inputMode:x,type:"text",pattern:y,"aria-labelledby":M,"aria-label":P,"aria-describedby":I,id:C,disabled:f,...J,readOnly:(nt=J.readOnly)!=null?nt:u,"aria-readonly":(Nt=J.readOnly)!=null?Nt:u,"aria-required":(he=J.required)!=null?he:p,required:(_e=J.required)!=null?_e:p,ref:ct(ce,Le),value:ge(Z.value),role:"spinbutton","aria-valuemin":o,"aria-valuemax":s,"aria-valuenow":Number.isNaN(Z.valueAsNumber)?void 0:Z.valueAsNumber,"aria-invalid":Rr(h??Z.isOutOfRange),"aria-valuetext":Rt,autoComplete:"off",autoCorrect:"off",onChange:Ee(J.onChange,Pe),onKeyDown:Ee(J.onKeyDown,Be),onFocus:Ee(J.onFocus,et,()=>Ie(!0)),onBlur:Ee(J.onBlur,K,ue)}},[j,x,y,M,P,ge,I,C,f,p,u,h,Z.value,Z.valueAsNumber,Z.isOutOfRange,o,s,Rt,Pe,Be,et,K,ue]);return{value:ge(Z.value),valueAsNumber:Z.valueAsNumber,isFocused:Ne,isDisabled:f,isReadOnly:u,getIncrementButtonProps:ae,getDecrementButtonProps:Oe,getInputProps:Ze,htmlProps:Q}}var[I7,Ic]=jt({name:"NumberInputStylesContext",errorMessage:`useNumberInputStyles returned is 'undefined'. Seems you forgot to wrap the components in "<NumberInput />" `}),[M7,zh]=jt({name:"NumberInputContext",errorMessage:"useNumberInputContext: `context` is undefined. Seems you forgot to wrap number-input's components within <NumberInput />"}),Rh=fe(function(t,n){const r=un("NumberInput",t),o=At(t),s=sh(o),{htmlProps:c,...u}=P7(s),f=g.useMemo(()=>u,[u]);return l.jsx(M7,{value:f,children:l.jsx(I7,{value:r,children:l.jsx(re.div,{...c,ref:n,className:Ae("chakra-numberinput",t.className),__css:{position:"relative",zIndex:0,...r.root}})})})});Rh.displayName="NumberInput";var Nh=fe(function(t,n){const r=Ic();return l.jsx(re.div,{"aria-hidden":!0,ref:n,...t,__css:{display:"flex",flexDirection:"column",position:"absolute",top:"0",insetEnd:"0px",margin:"1px",height:"calc(100% - 2px)",zIndex:1,...r.stepperGroup}})});Nh.displayName="NumberInputStepper";var Fh=fe(function(t,n){const{getInputProps:r}=zh(),o=r(t,n),s=Ic();return l.jsx(re.input,{...o,className:Ae("chakra-numberinput__field",t.className),__css:{width:"100%",...s.field}})});Fh.displayName="NumberInputField";var Yy=re("div",{baseStyle:{display:"flex",justifyContent:"center",alignItems:"center",flex:1,transitionProperty:"common",transitionDuration:"normal",userSelect:"none",cursor:"pointer",lineHeight:"normal"}}),Lh=fe(function(t,n){var r;const o=Ic(),{getDecrementButtonProps:s}=zh(),c=s(t,n);return l.jsx(Yy,{...c,__css:o.stepper,children:(r=t.children)!=null?r:l.jsx(x7,{})})});Lh.displayName="NumberDecrementStepper";var Bh=fe(function(t,n){var r;const{getIncrementButtonProps:o}=zh(),s=o(t,n),c=Ic();return l.jsx(Yy,{...s,__css:c.stepper,children:(r=t.children)!=null?r:l.jsx(b7,{})})});Bh.displayName="NumberIncrementStepper";var[T7,hs]=jt({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within `<Popover />`"}),[_7,Hh]=jt({name:"PopoverStylesContext",errorMessage:`usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Popover />" `});function Wh(e){const t=g.Children.only(e.children),{getTriggerProps:n}=hs();return g.cloneElement(t,n(t.props,t.ref))}Wh.displayName="PopoverTrigger";var Ii={click:"click",hover:"hover"};function D7(e={}){const{closeOnBlur:t=!0,closeOnEsc:n=!0,initialFocusRef:r,id:o,returnFocusOnClose:s=!0,autoFocus:c=!0,arrowSize:u,arrowShadowColor:f,trigger:p=Ii.click,openDelay:h=200,closeDelay:y=200,isLazy:x,lazyBehavior:S="unmount",computePositionOnMount:C,...k}=e,{isOpen:w,onClose:j,onOpen:I,onToggle:P}=Th(e),M=g.useRef(null),T=g.useRef(null),D=g.useRef(null),_=g.useRef(!1),R=g.useRef(!1);w&&(R.current=!0);const[V,F]=g.useState(!1),[L,Q]=g.useState(!1),U=g.useId(),K=o??U,[te,ne,$,Z]=["popover-trigger","popover-content","popover-header","popover-body"].map(Pe=>`${Pe}-${K}`),{referenceRef:oe,getArrowProps:le,getPopperProps:Re,getArrowInnerProps:Ne,forceUpdate:Ie}=Mh({...k,enabled:w||!!C}),pe=Ay({isOpen:w,ref:D});o5({enabled:w,ref:T}),Cy(D,{focusRef:T,visible:w,shouldFocus:s&&p===Ii.click}),B6(D,{focusRef:r,visible:w,shouldFocus:c&&p===Ii.click});const ce=_h({wasSelected:R.current,enabled:x,mode:S,isSelected:pe.present}),Fe=g.useCallback((Pe={},et=null)=>{const Be={...Pe,style:{...Pe.style,transformOrigin:Ht.transformOrigin.varRef,[Ht.arrowSize.var]:u?`${u}px`:void 0,[Ht.arrowShadowColor.var]:f},ref:ct(D,et),children:ce?Pe.children:null,id:ne,tabIndex:-1,role:"dialog",onKeyDown:Ee(Pe.onKeyDown,vt=>{n&&vt.key==="Escape"&&j()}),onBlur:Ee(Pe.onBlur,vt=>{const Rt=_g(vt),N=Ed(D.current,Rt),ue=Ed(T.current,Rt);w&&t&&(!N&&!ue)&&j()}),"aria-labelledby":V?$:void 0,"aria-describedby":L?Z:void 0};return p===Ii.hover&&(Be.role="tooltip",Be.onMouseEnter=Ee(Pe.onMouseEnter,()=>{_.current=!0}),Be.onMouseLeave=Ee(Pe.onMouseLeave,vt=>{vt.nativeEvent.relatedTarget!==null&&(_.current=!1,setTimeout(()=>j(),y))})),Be},[ce,ne,V,$,L,Z,p,n,j,w,t,y,f,u]),Ve=g.useCallback((Pe={},et=null)=>Re({...Pe,style:{visibility:w?"visible":"hidden",...Pe.style}},et),[w,Re]),Ue=g.useCallback((Pe,et=null)=>({...Pe,ref:ct(et,M,oe)}),[M,oe]),$e=g.useRef(),Qe=g.useRef(),ge=g.useCallback(Pe=>{M.current==null&&oe(Pe)},[oe]),Te=g.useCallback((Pe={},et=null)=>{const Be={...Pe,ref:ct(T,et,ge),id:te,"aria-haspopup":"dialog","aria-expanded":w,"aria-controls":ne};return p===Ii.click&&(Be.onClick=Ee(Pe.onClick,P)),p===Ii.hover&&(Be.onFocus=Ee(Pe.onFocus,()=>{$e.current===void 0&&I()}),Be.onBlur=Ee(Pe.onBlur,vt=>{const Rt=_g(vt),N=!Ed(D.current,Rt);w&&t&&N&&j()}),Be.onKeyDown=Ee(Pe.onKeyDown,vt=>{vt.key==="Escape"&&j()}),Be.onMouseEnter=Ee(Pe.onMouseEnter,()=>{_.current=!0,$e.current=window.setTimeout(()=>I(),h)}),Be.onMouseLeave=Ee(Pe.onMouseLeave,()=>{_.current=!1,$e.current&&(clearTimeout($e.current),$e.current=void 0),Qe.current=window.setTimeout(()=>{_.current===!1&&j()},y)})),Be},[te,w,ne,p,ge,P,I,t,j,h,y]);g.useEffect(()=>()=>{$e.current&&clearTimeout($e.current),Qe.current&&clearTimeout(Qe.current)},[]);const Ge=g.useCallback((Pe={},et=null)=>({...Pe,id:$,ref:ct(et,Be=>{F(!!Be)})}),[$]),ye=g.useCallback((Pe={},et=null)=>({...Pe,id:Z,ref:ct(et,Be=>{Q(!!Be)})}),[Z]);return{forceUpdate:Ie,isOpen:w,onAnimationComplete:pe.onComplete,onClose:j,getAnchorProps:Ue,getArrowProps:le,getArrowInnerProps:Ne,getPopoverPositionerProps:Ve,getPopoverProps:Fe,getTriggerProps:Te,getHeaderProps:Ge,getBodyProps:ye}}function Ed(e,t){return e===t||(e==null?void 0:e.contains(t))}function _g(e){var t;const n=e.currentTarget.ownerDocument.activeElement;return(t=e.relatedTarget)!=null?t:n}function Vh(e){const t=un("Popover",e),{children:n,...r}=At(e),o=ea(),s=D7({...r,direction:o.direction});return l.jsx(T7,{value:s,children:l.jsx(_7,{value:t,children:y1(n,{isOpen:s.isOpen,onClose:s.onClose,forceUpdate:s.forceUpdate})})})}Vh.displayName="Popover";function Uh(e){var t;const{bg:n,bgColor:r,backgroundColor:o,shadow:s,boxShadow:c}=e,{getArrowProps:u,getArrowInnerProps:f}=hs(),p=Hh(),h=(t=n??r)!=null?t:o,y=s??c;return l.jsx(re.div,{...u(),className:"chakra-popover__arrow-positioner",children:l.jsx(re.div,{className:Ae("chakra-popover__arrow",e.className),...f(e),__css:{"--popper-arrow-bg":h?`colors.${h}, ${h}`:void 0,"--popper-arrow-shadow":y?`shadows.${y}, ${y}`:void 0,...p.arrow}})})}Uh.displayName="PopoverArrow";var Ky=fe(function(t,n){const{getBodyProps:r}=hs(),o=Hh();return l.jsx(re.div,{...r(t,n),className:Ae("chakra-popover__body",t.className),__css:o.body})});Ky.displayName="PopoverBody";function A7(e){if(e)return{enter:{...e.enter,visibility:"visible"},exit:{...e.exit,transitionEnd:{visibility:"hidden"}}}}var O7={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]}}},z7=re(ir.section),Xy=fe(function(t,n){const{variants:r=O7,...o}=t,{isOpen:s}=hs();return l.jsx(z7,{ref:n,variants:A7(r),initial:!1,animate:s?"enter":"exit",...o})});Xy.displayName="PopoverTransition";var $h=fe(function(t,n){const{rootProps:r,motionProps:o,...s}=t,{getPopoverProps:c,getPopoverPositionerProps:u,onAnimationComplete:f}=hs(),p=Hh(),h={position:"relative",display:"flex",flexDirection:"column",...p.content};return l.jsx(re.div,{...u(r),__css:p.popper,className:"chakra-popover__popper",children:l.jsx(Xy,{...o,...c(s,n),onAnimationComplete:yc(f,s.onAnimationComplete),className:Ae("chakra-popover__content",t.className),__css:h})})});$h.displayName="PopoverContent";function R7(e,t,n){return(e-t)*100/(n-t)}Jo({"0%":{strokeDasharray:"1, 400",strokeDashoffset:"0"},"50%":{strokeDasharray:"400, 400",strokeDashoffset:"-100"},"100%":{strokeDasharray:"400, 400",strokeDashoffset:"-260"}});Jo({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}});var N7=Jo({"0%":{left:"-40%"},"100%":{left:"100%"}}),F7=Jo({from:{backgroundPosition:"1rem 0"},to:{backgroundPosition:"0 0"}});function L7(e){const{value:t=0,min:n,max:r,valueText:o,getValueText:s,isIndeterminate:c,role:u="progressbar"}=e,f=R7(t,n,r);return{bind:{"data-indeterminate":c?"":void 0,"aria-valuemax":r,"aria-valuemin":n,"aria-valuenow":c?void 0:t,"aria-valuetext":(()=>{if(t!=null)return typeof s=="function"?s(t,f):o})(),role:u},percent:f,value:t}}var[B7,H7]=jt({name:"ProgressStylesContext",errorMessage:`useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Progress />" `}),W7=fe((e,t)=>{const{min:n,max:r,value:o,isIndeterminate:s,role:c,...u}=e,f=L7({value:o,min:n,max:r,isIndeterminate:s,role:c}),h={height:"100%",...H7().filledTrack};return l.jsx(re.div,{ref:t,style:{width:`${f.percent}%`,...u.style},...f.bind,...u,__css:h})}),Qy=fe((e,t)=>{var n;const{value:r,min:o=0,max:s=100,hasStripe:c,isAnimated:u,children:f,borderRadius:p,isIndeterminate:h,"aria-label":y,"aria-labelledby":x,"aria-valuetext":S,title:C,role:k,...w}=At(e),j=un("Progress",e),I=p??((n=j.track)==null?void 0:n.borderRadius),P={animation:`${F7} 1s linear infinite`},D={...!h&&c&&u&&P,...h&&{position:"absolute",willChange:"left",minWidth:"50%",animation:`${N7} 1s ease infinite normal none running`}},_={overflow:"hidden",position:"relative",...j.track};return l.jsx(re.div,{ref:t,borderRadius:I,__css:_,...w,children:l.jsxs(B7,{value:j,children:[l.jsx(W7,{"aria-label":y,"aria-labelledby":x,"aria-valuetext":S,min:o,max:s,value:r,isIndeterminate:h,css:D,borderRadius:I,title:C,role:k}),f]})})});Qy.displayName="Progress";function V7(e){return e&&Kd(e)&&Kd(e.target)}function U7(e={}){const{onChange:t,value:n,defaultValue:r,name:o,isDisabled:s,isFocusable:c,isNative:u,...f}=e,[p,h]=g.useState(r||""),y=typeof n<"u",x=y?n:p,S=g.useRef(null),C=g.useCallback(()=>{const T=S.current;if(!T)return;let D="input:not(:disabled):checked";const _=T.querySelector(D);if(_){_.focus();return}D="input:not(:disabled)";const R=T.querySelector(D);R==null||R.focus()},[]),w=`radio-${g.useId()}`,j=o||w,I=g.useCallback(T=>{const D=V7(T)?T.target.value:T;y||h(D),t==null||t(String(D))},[t,y]),P=g.useCallback((T={},D=null)=>({...T,ref:ct(D,S),role:"radiogroup"}),[]),M=g.useCallback((T={},D=null)=>({...T,ref:D,name:j,[u?"checked":"isChecked"]:x!=null?T.value===x:void 0,onChange(R){I(R)},"data-radiogroup":!0}),[u,j,I,x]);return{getRootProps:P,getRadioProps:M,name:j,ref:S,focus:C,setValue:h,value:x,onChange:I,isDisabled:s,isFocusable:c,htmlProps:f}}var[$7,Zy]=jt({name:"RadioGroupContext",strict:!1}),Xa=fe((e,t)=>{const{colorScheme:n,size:r,variant:o,children:s,className:c,isDisabled:u,isFocusable:f,...p}=e,{value:h,onChange:y,getRootProps:x,name:S,htmlProps:C}=U7(p),k=g.useMemo(()=>({name:S,size:r,onChange:y,colorScheme:n,value:h,variant:o,isDisabled:u,isFocusable:f}),[S,r,y,n,h,o,u,f]);return l.jsx($7,{value:k,children:l.jsx(re.div,{...x(C,t),className:Ae("chakra-radio-group",c),children:s})})});Xa.displayName="RadioGroup";var G7={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};function q7(e={}){const{defaultChecked:t,isChecked:n,isFocusable:r,isDisabled:o,isReadOnly:s,isRequired:c,onChange:u,isInvalid:f,name:p,value:h,id:y,"data-radiogroup":x,"aria-describedby":S,...C}=e,k=`radio-${g.useId()}`,w=ni(),I=!!Zy()||!!x;let M=!!w&&!I?w.id:k;M=y??M;const T=o??(w==null?void 0:w.isDisabled),D=s??(w==null?void 0:w.isReadOnly),_=c??(w==null?void 0:w.isRequired),R=f??(w==null?void 0:w.isInvalid),[V,F]=g.useState(!1),[L,Q]=g.useState(!1),[U,K]=g.useState(!1),[te,ne]=g.useState(!1),[$,Z]=g.useState(Boolean(t)),oe=typeof n<"u",le=oe?n:$;g.useEffect(()=>C2(F),[]);const Re=g.useCallback(ge=>{if(D||T){ge.preventDefault();return}oe||Z(ge.target.checked),u==null||u(ge)},[oe,T,D,u]),Ne=g.useCallback(ge=>{ge.key===" "&&ne(!0)},[ne]),Ie=g.useCallback(ge=>{ge.key===" "&&ne(!1)},[ne]),pe=g.useCallback((ge={},Te=null)=>({...ge,ref:Te,"data-active":qe(te),"data-hover":qe(U),"data-disabled":qe(T),"data-invalid":qe(R),"data-checked":qe(le),"data-focus":qe(L),"data-focus-visible":qe(L&&V),"data-readonly":qe(D),"aria-hidden":!0,onMouseDown:Ee(ge.onMouseDown,()=>ne(!0)),onMouseUp:Ee(ge.onMouseUp,()=>ne(!1)),onMouseEnter:Ee(ge.onMouseEnter,()=>K(!0)),onMouseLeave:Ee(ge.onMouseLeave,()=>K(!1))}),[te,U,T,R,le,L,D,V]),{onFocus:ce,onBlur:Fe}=w??{},Ve=g.useCallback((ge={},Te=null)=>{const Ge=T&&!r;return{...ge,id:M,ref:Te,type:"radio",name:p,value:h,onChange:Ee(ge.onChange,Re),onBlur:Ee(Fe,ge.onBlur,()=>Q(!1)),onFocus:Ee(ce,ge.onFocus,()=>Q(!0)),onKeyDown:Ee(ge.onKeyDown,Ne),onKeyUp:Ee(ge.onKeyUp,Ie),checked:le,disabled:Ge,readOnly:D,required:_,"aria-invalid":Rr(R),"aria-disabled":Rr(Ge),"aria-required":Rr(_),"data-readonly":qe(D),"aria-describedby":S,style:G7}},[T,r,M,p,h,Re,Fe,ce,Ne,Ie,le,D,_,R,S]);return{state:{isInvalid:R,isFocused:L,isChecked:le,isActive:te,isHovered:U,isDisabled:T,isReadOnly:D,isRequired:_},getCheckboxProps:pe,getInputProps:Ve,getLabelProps:(ge={},Te=null)=>({...ge,ref:Te,onMouseDown:Ee(ge.onMouseDown,Dg),onTouchStart:Ee(ge.onTouchStart,Dg),"data-disabled":qe(T),"data-checked":qe(le),"data-invalid":qe(R)}),getRootProps:(ge,Te=null)=>({...ge,ref:Te,"data-disabled":qe(T),"data-checked":qe(le),"data-invalid":qe(R)}),htmlProps:C}}function Dg(e){e.preventDefault(),e.stopPropagation()}function Y7(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 vn=fe((e,t)=>{var n;const r=Zy(),{onChange:o,value:s}=e,c=un("Radio",{...r,...e}),u=At(e),{spacing:f="0.5rem",children:p,isDisabled:h=r==null?void 0:r.isDisabled,isFocusable:y=r==null?void 0:r.isFocusable,inputProps:x,...S}=u;let C=e.isChecked;(r==null?void 0:r.value)!=null&&s!=null&&(C=r.value===s);let k=o;r!=null&&r.onChange&&s!=null&&(k=yc(r.onChange,o));const w=(n=e==null?void 0:e.name)!=null?n:r==null?void 0:r.name,{getInputProps:j,getCheckboxProps:I,getLabelProps:P,getRootProps:M,htmlProps:T}=q7({...S,isChecked:C,isFocusable:y,isDisabled:h,onChange:k,name:w}),[D,_]=Y7(T,x1),R=I(_),V=j(x,t),F=P(),L=Object.assign({},D,M()),Q={display:"inline-flex",alignItems:"center",verticalAlign:"top",cursor:"pointer",position:"relative",...c.container},U={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,...c.control},K={userSelect:"none",marginStart:f,...c.label};return l.jsxs(re.label,{className:"chakra-radio",...L,__css:Q,children:[l.jsx("input",{className:"chakra-radio__input",...V}),l.jsx(re.span,{className:"chakra-radio__control",...R,__css:U}),p&&l.jsx(re.span,{className:"chakra-radio__label",...F,__css:K,children:p})]})});vn.displayName="Radio";var Jy=fe(function(t,n){const{children:r,placeholder:o,className:s,...c}=t;return l.jsxs(re.select,{...c,ref:n,className:Ae("chakra-select",s),children:[o&&l.jsx("option",{value:"",children:o}),r]})});Jy.displayName="SelectField";function K7(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 ex=fe((e,t)=>{var n;const r=un("Select",e),{rootProps:o,placeholder:s,icon:c,color:u,height:f,h:p,minH:h,minHeight:y,iconColor:x,iconSize:S,...C}=At(e),[k,w]=K7(C,x1),j=ah(w),I={width:"100%",height:"fit-content",position:"relative",color:u},P={paddingEnd:"2rem",...r.field,_focus:{zIndex:"unset",...(n=r.field)==null?void 0:n._focus}};return l.jsxs(re.div,{className:"chakra-select__wrapper",__css:I,...k,...o,children:[l.jsx(Jy,{ref:t,height:p??f,minH:h??y,placeholder:s,...j,__css:P,children:e.children}),l.jsx(tx,{"data-disabled":qe(j.disabled),...(x||u)&&{color:x||u},__css:r.icon,...S&&{fontSize:S},children:c})]})});ex.displayName="Select";var X7=e=>l.jsx("svg",{viewBox:"0 0 24 24",...e,children:l.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})}),Q7=re("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),tx=e=>{const{children:t=l.jsx(X7,{}),...n}=e,r=g.cloneElement(t,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return l.jsx(Q7,{...n,className:"chakra-select__icon-wrapper",children:g.isValidElement(t)?r:null})};tx.displayName="SelectIcon";var Mi=e=>e?"":void 0,Pd=e=>e?!0:void 0,ps=(...e)=>e.filter(Boolean).join(" ");function Id(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function jl(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}var $l={width:0,height:0},El=e=>e||$l;function Z7(e){const{orientation:t,thumbPercents:n,thumbRects:r,isReversed:o}=e,s=k=>{var w;const j=(w=r[k])!=null?w:$l;return{position:"absolute",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",touchAction:"none",...jl({orientation:t,vertical:{bottom:`calc(${n[k]}% - ${j.height/2}px)`},horizontal:{left:`calc(${n[k]}% - ${j.width/2}px)`}})}},c=t==="vertical"?r.reduce((k,w)=>El(k).height>El(w).height?k:w,$l):r.reduce((k,w)=>El(k).width>El(w).width?k:w,$l),u={position:"relative",touchAction:"none",WebkitTapHighlightColor:"rgba(0,0,0,0)",userSelect:"none",outline:0,...jl({orientation:t,vertical:c?{paddingLeft:c.width/2,paddingRight:c.width/2}:{},horizontal:c?{paddingTop:c.height/2,paddingBottom:c.height/2}:{}})},f={position:"absolute",...jl({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",height:"100%"},horizontal:{top:"50%",transform:"translateY(-50%)",width:"100%"}})},p=n.length===1,h=[0,o?100-n[0]:n[0]],y=p?h:n;let x=y[0];!p&&o&&(x=100-x);const S=Math.abs(y[y.length-1]-y[0]),C={...f,...jl({orientation:t,vertical:o?{height:`${S}%`,top:`${x}%`}:{height:`${S}%`,bottom:`${x}%`},horizontal:o?{width:`${S}%`,right:`${x}%`}:{width:`${S}%`,left:`${x}%`}})};return{trackStyle:f,innerTrackStyle:C,rootStyle:u,getThumbStyle:s}}function J7(e){const{isReversed:t,direction:n,orientation:r}=e;return n==="ltr"||r==="vertical"?t:!t}function e8(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function t8(e){const t=r8(e);return typeof t.PointerEvent<"u"&&e instanceof t.PointerEvent?e.pointerType==="mouse":e instanceof t.MouseEvent}function nx(e){return!!e.touches}function n8(e){return nx(e)&&e.touches.length>1}function r8(e){var t;return(t=e.view)!=null?t:window}function o8(e,t="page"){const n=e.touches[0]||e.changedTouches[0];return{x:n[`${t}X`],y:n[`${t}Y`]}}function i8(e,t="page"){return{x:e[`${t}X`],y:e[`${t}Y`]}}function rx(e,t="page"){return nx(e)?o8(e,t):i8(e,t)}function a8(e){return t=>{const n=t8(t);(!n||n&&t.button===0)&&e(t)}}function s8(e,t=!1){function n(o){e(o,{point:rx(o)})}return t?a8(n):n}function Gl(e,t,n,r){return e8(e,t,s8(n,t==="pointerdown"),r)}var l8=Object.defineProperty,c8=(e,t,n)=>t in e?l8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Jn=(e,t,n)=>(c8(e,typeof t!="symbol"?t+"":t,n),n),u8=class{constructor(e,t,n){Jn(this,"history",[]),Jn(this,"startEvent",null),Jn(this,"lastEvent",null),Jn(this,"lastEventInfo",null),Jn(this,"handlers",{}),Jn(this,"removeListeners",()=>{}),Jn(this,"threshold",3),Jn(this,"win"),Jn(this,"updatePoint",()=>{if(!(this.lastEvent&&this.lastEventInfo))return;const u=Md(this.lastEventInfo,this.history),f=this.startEvent!==null,p=p8(u.offset,{x:0,y:0})>=this.threshold;if(!f&&!p)return;const{timestamp:h}=$v();this.history.push({...u.point,timestamp:h});const{onStart:y,onMove:x}=this.handlers;f||(y==null||y(this.lastEvent,u),this.startEvent=this.lastEvent),x==null||x(this.lastEvent,u)}),Jn(this,"onPointerMove",(u,f)=>{this.lastEvent=u,this.lastEventInfo=f,NC.update(this.updatePoint,!0)}),Jn(this,"onPointerUp",(u,f)=>{const p=Md(f,this.history),{onEnd:h,onSessionEnd:y}=this.handlers;y==null||y(u,p),this.end(),!(!h||!this.startEvent)&&(h==null||h(u,p))});var r;if(this.win=(r=e.view)!=null?r:window,n8(e))return;this.handlers=t,n&&(this.threshold=n),e.stopPropagation(),e.preventDefault();const o={point:rx(e)},{timestamp:s}=$v();this.history=[{...o.point,timestamp:s}];const{onSessionStart:c}=t;c==null||c(e,Md(o,this.history)),this.removeListeners=h8(Gl(this.win,"pointermove",this.onPointerMove),Gl(this.win,"pointerup",this.onPointerUp),Gl(this.win,"pointercancel",this.onPointerUp))}updateHandlers(e){this.handlers=e}end(){var e;(e=this.removeListeners)==null||e.call(this),FC.update(this.updatePoint)}};function Ag(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Md(e,t){return{point:e.point,delta:Ag(e.point,t[t.length-1]),offset:Ag(e.point,t[0]),velocity:f8(t,.1)}}var d8=e=>e*1e3;function f8(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=e[e.length-1];for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>d8(t)));)n--;if(!r)return{x:0,y:0};const s=(o.timestamp-r.timestamp)/1e3;if(s===0)return{x:0,y:0};const c={x:(o.x-r.x)/s,y:(o.y-r.y)/s};return c.x===1/0&&(c.x=0),c.y===1/0&&(c.y=0),c}function h8(...e){return t=>e.reduce((n,r)=>r(n),t)}function Td(e,t){return Math.abs(e-t)}function Og(e){return"x"in e&&"y"in e}function p8(e,t){if(typeof e=="number"&&typeof t=="number")return Td(e,t);if(Og(e)&&Og(t)){const n=Td(e.x,t.x),r=Td(e.y,t.y);return Math.sqrt(n**2+r**2)}return 0}function ox(e){const t=g.useRef(null);return t.current=e,t}function m8(e,t){const{onPan:n,onPanStart:r,onPanEnd:o,onPanSessionStart:s,onPanSessionEnd:c,threshold:u}=t,f=Boolean(n||r||o||s||c),p=g.useRef(null),h=ox({onSessionStart:s,onSessionEnd:c,onStart:r,onMove:n,onEnd(y,x){p.current=null,o==null||o(y,x)}});g.useEffect(()=>{var y;(y=p.current)==null||y.updateHandlers(h.current)}),g.useEffect(()=>{const y=e.current;if(!y||!f)return;function x(S){p.current=new u8(S,h.current,u)}return Gl(y,"pointerdown",x)},[e,f,h,u]),g.useEffect(()=>()=>{var y;(y=p.current)==null||y.end(),p.current=null},[])}function v8(e,t){var n;if(!e){t(void 0);return}t({width:e.offsetWidth,height:e.offsetHeight});const r=(n=e.ownerDocument.defaultView)!=null?n:window,o=new r.ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const[c]=s;let u,f;if("borderBoxSize"in c){const p=c.borderBoxSize,h=Array.isArray(p)?p[0]:p;u=h.inlineSize,f=h.blockSize}else u=e.offsetWidth,f=e.offsetHeight;t({width:u,height:f})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}var g8=Boolean(globalThis==null?void 0:globalThis.document)?g.useLayoutEffect:g.useEffect;function y8(e,t){var n,r;if(!e||!e.parentElement)return;const o=(r=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?r:window,s=new o.MutationObserver(()=>{t()});return s.observe(e.parentElement,{childList:!0}),()=>{s.disconnect()}}function x8({getNodes:e,observeMutation:t=!0}){const[n,r]=g.useState([]),[o,s]=g.useState(0);return g8(()=>{const c=e(),u=c.map((f,p)=>v8(f,h=>{r(y=>[...y.slice(0,p),h,...y.slice(p+1)])}));if(t){const f=c[0];u.push(y8(f,()=>{s(p=>p+1)}))}return()=>{u.forEach(f=>{f==null||f()})}},[o]),n}function b8(e){return typeof e=="object"&&e!==null&&"current"in e}function S8(e){const[t]=x8({observeMutation:!1,getNodes(){return[b8(e)?e.current:e]}});return t}function C8(e){var t;const{min:n=0,max:r=100,onChange:o,value:s,defaultValue:c,isReversed:u,direction:f="ltr",orientation:p="horizontal",id:h,isDisabled:y,isReadOnly:x,onChangeStart:S,onChangeEnd:C,step:k=1,getAriaValueText:w,"aria-valuetext":j,"aria-label":I,"aria-labelledby":P,name:M,focusThumbOnChange:T=!0,...D}=e,_=Wt(S),R=Wt(C),V=Wt(w),F=J7({isReversed:u,direction:f,orientation:p}),[L,Q]=nh({value:s,defaultValue:c??k8(n,r),onChange:o}),[U,K]=g.useState(!1),[te,ne]=g.useState(!1),$=!(y||x),Z=(r-n)/10,oe=k||(r-n)/100,le=Hl(L,n,r),Re=r-le+n,Ie=ng(F?Re:le,n,r),pe=p==="vertical",ce=ox({min:n,max:r,step:k,isDisabled:y,value:le,isInteractive:$,isReversed:F,isVertical:pe,eventSource:null,focusThumbOnChange:T,orientation:p}),Fe=g.useRef(null),Ve=g.useRef(null),Ue=g.useRef(null),$e=g.useId(),Qe=h??$e,[ge,Te]=[`slider-thumb-${Qe}`,`slider-track-${Qe}`],Ge=g.useCallback(he=>{var _e,dn;if(!Fe.current)return;const Vt=ce.current;Vt.eventSource="pointer";const fn=Fe.current.getBoundingClientRect(),{clientX:ar,clientY:wo}=(dn=(_e=he.touches)==null?void 0:_e[0])!=null?dn:he,sa=pe?fn.bottom-wo:ar-fn.left,Yc=pe?fn.height:fn.width;let la=sa/Yc;F&&(la=1-la);let ko=Xw(la,Vt.min,Vt.max);return Vt.step&&(ko=parseFloat(rg(ko,Vt.min,Vt.step))),ko=Hl(ko,Vt.min,Vt.max),ko},[pe,F,ce]),ye=g.useCallback(he=>{const _e=ce.current;_e.isInteractive&&(he=parseFloat(rg(he,_e.min,oe)),he=Hl(he,_e.min,_e.max),Q(he))},[oe,Q,ce]),Pe=g.useMemo(()=>({stepUp(he=oe){const _e=F?le-he:le+he;ye(_e)},stepDown(he=oe){const _e=F?le+he:le-he;ye(_e)},reset(){ye(c||0)},stepTo(he){ye(he)}}),[ye,F,le,oe,c]),et=g.useCallback(he=>{const _e=ce.current,Vt={ArrowRight:()=>Pe.stepUp(),ArrowUp:()=>Pe.stepUp(),ArrowLeft:()=>Pe.stepDown(),ArrowDown:()=>Pe.stepDown(),PageUp:()=>Pe.stepUp(Z),PageDown:()=>Pe.stepDown(Z),Home:()=>ye(_e.min),End:()=>ye(_e.max)}[he.key];Vt&&(he.preventDefault(),he.stopPropagation(),Vt(he),_e.eventSource="keyboard")},[Pe,ye,Z,ce]),Be=(t=V==null?void 0:V(le))!=null?t:j,vt=S8(Ve),{getThumbStyle:Rt,rootStyle:N,trackStyle:ue,innerTrackStyle:xe}=g.useMemo(()=>{const he=ce.current,_e=vt??{width:0,height:0};return Z7({isReversed:F,orientation:he.orientation,thumbRects:[_e],thumbPercents:[Ie]})},[F,vt,Ie,ce]),ke=g.useCallback(()=>{ce.current.focusThumbOnChange&&setTimeout(()=>{var _e;return(_e=Ve.current)==null?void 0:_e.focus()})},[ce]);ei(()=>{const he=ce.current;ke(),he.eventSource==="keyboard"&&(R==null||R(he.value))},[le,R]);function q(he){const _e=Ge(he);_e!=null&&_e!==ce.current.value&&Q(_e)}m8(Ue,{onPanSessionStart(he){const _e=ce.current;_e.isInteractive&&(K(!0),ke(),q(he),_==null||_(_e.value))},onPanSessionEnd(){const he=ce.current;he.isInteractive&&(K(!1),R==null||R(he.value))},onPan(he){ce.current.isInteractive&&q(he)}});const ae=g.useCallback((he={},_e=null)=>({...he,...D,ref:ct(_e,Ue),tabIndex:-1,"aria-disabled":Pd(y),"data-focused":Mi(te),style:{...he.style,...N}}),[D,y,te,N]),Oe=g.useCallback((he={},_e=null)=>({...he,ref:ct(_e,Fe),id:Te,"data-disabled":Mi(y),style:{...he.style,...ue}}),[y,Te,ue]),Ze=g.useCallback((he={},_e=null)=>({...he,ref:_e,style:{...he.style,...xe}}),[xe]),J=g.useCallback((he={},_e=null)=>({...he,ref:ct(_e,Ve),role:"slider",tabIndex:$?0:void 0,id:ge,"data-active":Mi(U),"aria-valuetext":Be,"aria-valuemin":n,"aria-valuemax":r,"aria-valuenow":le,"aria-orientation":p,"aria-disabled":Pd(y),"aria-readonly":Pd(x),"aria-label":I,"aria-labelledby":I?void 0:P,style:{...he.style,...Rt(0)},onKeyDown:Id(he.onKeyDown,et),onFocus:Id(he.onFocus,()=>ne(!0)),onBlur:Id(he.onBlur,()=>ne(!1))}),[$,ge,U,Be,n,r,le,p,y,x,I,P,Rt,et]),Le=g.useCallback((he,_e=null)=>{const dn=!(he.value<n||he.value>r),Vt=le>=he.value,fn=ng(he.value,n,r),ar={position:"absolute",pointerEvents:"none",...w8({orientation:p,vertical:{bottom:F?`${100-fn}%`:`${fn}%`},horizontal:{left:F?`${100-fn}%`:`${fn}%`}})};return{...he,ref:_e,role:"presentation","aria-hidden":!0,"data-disabled":Mi(y),"data-invalid":Mi(!dn),"data-highlighted":Mi(Vt),style:{...he.style,...ar}}},[y,F,r,n,p,le]),nt=g.useCallback((he={},_e=null)=>({...he,ref:_e,type:"hidden",value:le,name:M}),[M,le]);return{state:{value:le,isFocused:te,isDragging:U},actions:Pe,getRootProps:ae,getTrackProps:Oe,getInnerTrackProps:Ze,getThumbProps:J,getMarkerProps:Le,getInputProps:nt}}function w8(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}function k8(e,t){return t<e?e:e+(t-e)/2}var[j8,Mc]=jt({name:"SliderContext",hookName:"useSliderContext",providerName:"<Slider />"}),[E8,Tc]=jt({name:"SliderStylesContext",hookName:"useSliderStyles",providerName:"<Slider />"}),ix=fe((e,t)=>{const n={orientation:"horizontal",...e},r=un("Slider",n),o=At(n),{direction:s}=ea();o.direction=s;const{getInputProps:c,getRootProps:u,...f}=C8(o),p=u(),h=c({},t);return l.jsx(j8,{value:f,children:l.jsx(E8,{value:r,children:l.jsxs(re.div,{...p,className:ps("chakra-slider",n.className),__css:r.container,children:[n.children,l.jsx("input",{...h})]})})})});ix.displayName="Slider";var ax=fe((e,t)=>{const{getThumbProps:n}=Mc(),r=Tc(),o=n(e,t);return l.jsx(re.div,{...o,className:ps("chakra-slider__thumb",e.className),__css:r.thumb})});ax.displayName="SliderThumb";var sx=fe((e,t)=>{const{getTrackProps:n}=Mc(),r=Tc(),o=n(e,t);return l.jsx(re.div,{...o,className:ps("chakra-slider__track",e.className),__css:r.track})});sx.displayName="SliderTrack";var lx=fe((e,t)=>{const{getInnerTrackProps:n}=Mc(),r=Tc(),o=n(e,t);return l.jsx(re.div,{...o,className:ps("chakra-slider__filled-track",e.className),__css:r.filledTrack})});lx.displayName="SliderFilledTrack";var If=fe((e,t)=>{const{getMarkerProps:n}=Mc(),r=Tc(),o=n(e,t);return l.jsx(re.div,{...o,className:ps("chakra-slider__marker",e.className),__css:r.mark})});If.displayName="SliderMark";var cx=fe(function(t,n){const r=un("Switch",t),{spacing:o="0.5rem",children:s,...c}=At(t),{state:u,getInputProps:f,getCheckboxProps:p,getRootProps:h,getLabelProps:y}=w2(c),x=g.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...r.container}),[r.container]),S=g.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...r.track}),[r.track]),C=g.useMemo(()=>({userSelect:"none",marginStart:o,...r.label}),[o,r.label]);return l.jsxs(re.label,{...h(),className:Ae("chakra-switch",t.className),__css:x,children:[l.jsx("input",{className:"chakra-switch__input",...f({},n)}),l.jsx(re.span,{...p(),className:"chakra-switch__track",__css:S,children:l.jsx(re.span,{__css:r.thumb,className:"chakra-switch__thumb","data-checked":qe(u.isChecked),"data-hover":qe(u.isHovered)})}),s&&l.jsx(re.span,{className:"chakra-switch__label",...y(),__css:C,children:s})]})});cx.displayName="Switch";var[P8,I8,M8,T8]=eh();function _8(e){var t;const{defaultIndex:n,onChange:r,index:o,isManual:s,isLazy:c,lazyBehavior:u="unmount",orientation:f="horizontal",direction:p="ltr",...h}=e,[y,x]=g.useState(n??0),[S,C]=nh({defaultValue:n??0,value:o,onChange:r});g.useEffect(()=>{o!=null&&x(o)},[o]);const k=M8(),w=g.useId();return{id:`tabs-${(t=e.id)!=null?t:w}`,selectedIndex:S,focusedIndex:y,setSelectedIndex:C,setFocusedIndex:x,isManual:s,isLazy:c,lazyBehavior:u,orientation:f,descendants:k,direction:p,htmlProps:h}}var[D8,_c]=jt({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within <Tabs />"});function A8(e){const{focusedIndex:t,orientation:n,direction:r}=_c(),o=I8(),s=g.useCallback(c=>{const u=()=>{var I;const P=o.nextEnabled(t);P&&((I=P.node)==null||I.focus())},f=()=>{var I;const P=o.prevEnabled(t);P&&((I=P.node)==null||I.focus())},p=()=>{var I;const P=o.firstEnabled();P&&((I=P.node)==null||I.focus())},h=()=>{var I;const P=o.lastEnabled();P&&((I=P.node)==null||I.focus())},y=n==="horizontal",x=n==="vertical",S=c.key,C=r==="ltr"?"ArrowLeft":"ArrowRight",k=r==="ltr"?"ArrowRight":"ArrowLeft",j={[C]:()=>y&&f(),[k]:()=>y&&u(),ArrowDown:()=>x&&u(),ArrowUp:()=>x&&f(),Home:p,End:h}[S];j&&(c.preventDefault(),j(c))},[o,t,n,r]);return{...e,role:"tablist","aria-orientation":n,onKeyDown:Ee(e.onKeyDown,s)}}function O8(e){const{isDisabled:t,isFocusable:n,...r}=e,{setSelectedIndex:o,isManual:s,id:c,setFocusedIndex:u,selectedIndex:f}=_c(),{index:p,register:h}=T8({disabled:t&&!n}),y=p===f,x=()=>{o(p)},S=()=>{u(p),!s&&!(t&&n)&&o(p)},C=Sy({...r,ref:ct(h,e.ref),isDisabled:t,isFocusable:n,onClick:Ee(e.onClick,x)}),k="button";return{...C,id:ux(c,p),role:"tab",tabIndex:y?0:-1,type:k,"aria-selected":y,"aria-controls":dx(c,p),onFocus:t?void 0:Ee(e.onFocus,S)}}var[z8,R8]=jt({});function N8(e){const t=_c(),{id:n,selectedIndex:r}=t,s=ih(e.children).map((c,u)=>g.createElement(z8,{key:u,value:{isSelected:u===r,id:dx(n,u),tabId:ux(n,u),selectedIndex:r}},c));return{...e,children:s}}function F8(e){const{children:t,...n}=e,{isLazy:r,lazyBehavior:o}=_c(),{isSelected:s,id:c,tabId:u}=R8(),f=g.useRef(!1);s&&(f.current=!0);const p=_h({wasSelected:f.current,isSelected:s,enabled:r,mode:o});return{tabIndex:0,...n,children:p?t:null,role:"tabpanel","aria-labelledby":u,hidden:!s,id:c}}function ux(e,t){return`${e}--tab-${t}`}function dx(e,t){return`${e}--tabpanel-${t}`}var[L8,Dc]=jt({name:"TabsStylesContext",errorMessage:`useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Tabs />" `}),fx=fe(function(t,n){const r=un("Tabs",t),{children:o,className:s,...c}=At(t),{htmlProps:u,descendants:f,...p}=_8(c),h=g.useMemo(()=>p,[p]),{isFitted:y,...x}=u;return l.jsx(P8,{value:f,children:l.jsx(D8,{value:h,children:l.jsx(L8,{value:r,children:l.jsx(re.div,{className:Ae("chakra-tabs",s),ref:n,...x,__css:r.root,children:o})})})})});fx.displayName="Tabs";var hx=fe(function(t,n){const r=A8({...t,ref:n}),s={display:"flex",...Dc().tablist};return l.jsx(re.div,{...r,className:Ae("chakra-tabs__tablist",t.className),__css:s})});hx.displayName="TabList";var px=fe(function(t,n){const r=F8({...t,ref:n}),o=Dc();return l.jsx(re.div,{outline:"0",...r,className:Ae("chakra-tabs__tab-panel",t.className),__css:o.tabpanel})});px.displayName="TabPanel";var mx=fe(function(t,n){const r=N8(t),o=Dc();return l.jsx(re.div,{...r,width:"100%",ref:n,className:Ae("chakra-tabs__tab-panels",t.className),__css:o.tabpanels})});mx.displayName="TabPanels";var vx=fe(function(t,n){const r=Dc(),o=O8({...t,ref:n}),s={outline:"0",display:"flex",alignItems:"center",justifyContent:"center",...r.tab};return l.jsx(re.button,{...o,className:Ae("chakra-tabs__tab",t.className),__css:s})});vx.displayName="Tab";function B8(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var H8=["h","minH","height","minHeight"],Gh=fe((e,t)=>{const n=go("Textarea",e),{className:r,rows:o,...s}=At(e),c=ah(s),u=o?B8(n,H8):n;return l.jsx(re.textarea,{ref:t,rows:o,...c,className:Ae("chakra-textarea",r),__css:u})});Gh.displayName="Textarea";var W8={exit:{scale:.85,opacity:0,transition:{opacity:{duration:.15,easings:"easeInOut"},scale:{duration:.2,easings:"easeInOut"}}},enter:{scale:1,opacity:1,transition:{opacity:{easings:"easeOut",duration:.2},scale:{duration:.2,ease:[.175,.885,.4,1.1]}}}},sc=e=>{var t;return((t=e.current)==null?void 0:t.ownerDocument)||document},Mf=e=>{var t,n;return((n=(t=e.current)==null?void 0:t.ownerDocument)==null?void 0:n.defaultView)||window};function V8(e={}){const{openDelay:t=0,closeDelay:n=0,closeOnClick:r=!0,closeOnMouseDown:o,closeOnScroll:s,closeOnPointerDown:c=o,closeOnEsc:u=!0,onOpen:f,onClose:p,placement:h,id:y,isOpen:x,defaultIsOpen:S,arrowSize:C=10,arrowShadowColor:k,arrowPadding:w,modifiers:j,isDisabled:I,gutter:P,offset:M,direction:T,...D}=e,{isOpen:_,onOpen:R,onClose:V}=Th({isOpen:x,defaultIsOpen:S,onOpen:f,onClose:p}),{referenceRef:F,getPopperProps:L,getArrowInnerProps:Q,getArrowProps:U}=Mh({enabled:_,placement:h,arrowPadding:w,modifiers:j,gutter:P,offset:M,direction:T}),K=g.useId(),ne=`tooltip-${y??K}`,$=g.useRef(null),Z=g.useRef(),oe=g.useCallback(()=>{Z.current&&(clearTimeout(Z.current),Z.current=void 0)},[]),le=g.useRef(),Re=g.useCallback(()=>{le.current&&(clearTimeout(le.current),le.current=void 0)},[]),Ne=g.useCallback(()=>{Re(),V()},[V,Re]),Ie=U8($,Ne),pe=g.useCallback(()=>{if(!I&&!Z.current){Ie();const Te=Mf($);Z.current=Te.setTimeout(R,t)}},[Ie,I,R,t]),ce=g.useCallback(()=>{oe();const Te=Mf($);le.current=Te.setTimeout(Ne,n)},[n,Ne,oe]),Fe=g.useCallback(()=>{_&&r&&ce()},[r,ce,_]),Ve=g.useCallback(()=>{_&&c&&ce()},[c,ce,_]),Ue=g.useCallback(Te=>{_&&Te.key==="Escape"&&ce()},[_,ce]);$o(()=>sc($),"keydown",u?Ue:void 0),$o(()=>sc($),"scroll",()=>{_&&s&&Ne()}),g.useEffect(()=>{I&&(oe(),_&&V())},[I,_,V,oe]),g.useEffect(()=>()=>{oe(),Re()},[oe,Re]),$o(()=>$.current,"pointerleave",ce);const $e=g.useCallback((Te={},Ge=null)=>({...Te,ref:ct($,Ge,F),onPointerEnter:Ee(Te.onPointerEnter,Pe=>{Pe.pointerType!=="touch"&&pe()}),onClick:Ee(Te.onClick,Fe),onPointerDown:Ee(Te.onPointerDown,Ve),onFocus:Ee(Te.onFocus,pe),onBlur:Ee(Te.onBlur,ce),"aria-describedby":_?ne:void 0}),[pe,ce,Ve,_,ne,Fe,F]),Qe=g.useCallback((Te={},Ge=null)=>L({...Te,style:{...Te.style,[Ht.arrowSize.var]:C?`${C}px`:void 0,[Ht.arrowShadowColor.var]:k}},Ge),[L,C,k]),ge=g.useCallback((Te={},Ge=null)=>{const ye={...Te.style,position:"relative",transformOrigin:Ht.transformOrigin.varRef};return{ref:Ge,...D,...Te,id:ne,role:"tooltip",style:ye}},[D,ne]);return{isOpen:_,show:pe,hide:ce,getTriggerProps:$e,getTooltipProps:ge,getTooltipPositionerProps:Qe,getArrowProps:U,getArrowInnerProps:Q}}var _d="chakra-ui:close-tooltip";function U8(e,t){return g.useEffect(()=>{const n=sc(e);return n.addEventListener(_d,t),()=>n.removeEventListener(_d,t)},[t,e]),()=>{const n=sc(e),r=Mf(e);n.dispatchEvent(new r.CustomEvent(_d))}}function $8(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function G8(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var q8=re(ir.div),Gt=fe((e,t)=>{var n,r;const o=go("Tooltip",e),s=At(e),c=ea(),{children:u,label:f,shouldWrapChildren:p,"aria-label":h,hasArrow:y,bg:x,portalProps:S,background:C,backgroundColor:k,bgColor:w,motionProps:j,...I}=s,P=(r=(n=C??k)!=null?n:x)!=null?r:w;if(P){o.bg=P;const L=LS(c,"colors",P);o[Ht.arrowBg.var]=L}const M=V8({...I,direction:c.direction}),T=typeof u=="string"||p;let D;if(T)D=l.jsx(re.span,{display:"inline-block",tabIndex:0,...M.getTriggerProps(),children:u});else{const L=g.Children.only(u);D=g.cloneElement(L,M.getTriggerProps(L.props,L.ref))}const _=!!h,R=M.getTooltipProps({},t),V=_?$8(R,["role","id"]):R,F=G8(R,["role","id"]);return f?l.jsxs(l.Fragment,{children:[D,l.jsx(yo,{children:M.isOpen&&l.jsx(Ua,{...S,children:l.jsx(re.div,{...M.getTooltipPositionerProps(),__css:{zIndex:o.zIndex,pointerEvents:"none"},children:l.jsxs(q8,{variants:W8,initial:"exit",animate:"enter",exit:"exit",...j,...V,__css:o,children:[f,_&&l.jsx(re.span,{srOnly:!0,...F,children:h}),y&&l.jsx(re.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper",children:l.jsx(re.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:o.bg}})})]})})})})]}):l.jsx(l.Fragment,{children:u})});Gt.displayName="Tooltip";const qh=g.createContext(null);let zg;const Yh=()=>({setOpenUploader:e=>{e&&(zg=e)},openUploader:zg}),bt=me(e=>e.ui,e=>BS[e.activeTab],{memoizeOptions:{equalityCheck:ee.isEqual}}),Y8=me(e=>e.ui,e=>e.activeTab,{memoizeOptions:{equalityCheck:ee.isEqual}}),Er=me(e=>e.ui,e=>e,{memoizeOptions:{equalityCheck:ee.isEqual}}),Rg=e=>async(t,n)=>{const{imageFile:r}=e,o=n(),s=bt(o),c=new FormData;c.append("file",r,r.name),c.append("data",JSON.stringify({kind:"init"}));const f=await(await fetch(`${window.location.origin}/upload`,{method:"POST",body:c})).json(),p={uuid:b1(),category:"user",...f};t(S1({image:p,category:"user"})),s==="unifiedCanvas"?t(xc(p)):s==="img2img"&&t(ns(p))};var K8=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 ms(e,t){var n=X8(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 X8(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),o=K8.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var Q8=[".DS_Store","Thumbs.db"];function Z8(e){return ta(this,void 0,void 0,function(){return na(this,function(t){return lc(e)&&J8(e.dataTransfer)?[2,rE(e.dataTransfer,e.type)]:eE(e)?[2,tE(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,nE(e)]:[2,[]]})})}function J8(e){return lc(e)}function eE(e){return lc(e)&&lc(e.target)}function lc(e){return typeof e=="object"&&e!==null}function tE(e){return Tf(e.target.files).map(function(t){return ms(t)})}function nE(e){return ta(this,void 0,void 0,function(){var t;return na(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 ms(r)})]}})})}function rE(e,t){return ta(this,void 0,void 0,function(){var n,r;return na(this,function(o){switch(o.label){case 0:return e.items?(n=Tf(e.items).filter(function(s){return s.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(oE))]):[3,2];case 1:return r=o.sent(),[2,Ng(gx(r))];case 2:return[2,Ng(Tf(e.files).map(function(s){return ms(s)}))]}})})}function Ng(e){return e.filter(function(t){return Q8.indexOf(t.name)===-1})}function Tf(e){if(e===null)return[];for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r)}return t}function oE(e){if(typeof e.webkitGetAsEntry!="function")return Fg(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?yx(t):Fg(e)}function gx(e){return e.reduce(function(t,n){return xf(xf([],og(t),!1),og(Array.isArray(n)?gx(n):[n]),!1)},[])}function Fg(e){var t=e.getAsFile();if(!t)return Promise.reject("".concat(e," is not a File"));var n=ms(t);return Promise.resolve(n)}function iE(e){return ta(this,void 0,void 0,function(){return na(this,function(t){return[2,e.isDirectory?yx(e):aE(e)]})})}function yx(e){var t=e.createReader();return new Promise(function(n,r){var o=[];function s(){var c=this;t.readEntries(function(u){return ta(c,void 0,void 0,function(){var f,p,h;return na(this,function(y){switch(y.label){case 0:if(u.length)return[3,5];y.label=1;case 1:return y.trys.push([1,3,,4]),[4,Promise.all(o)];case 2:return f=y.sent(),n(f),[3,4];case 3:return p=y.sent(),r(p),[3,4];case 4:return[3,6];case 5:h=Promise.all(u.map(iE)),o.push(h),s(),y.label=6;case 6:return[2]}})})},function(u){r(u)})}s()})}function aE(e){return ta(this,void 0,void 0,function(){return na(this,function(t){return[2,new Promise(function(n,r){e.file(function(o){var s=ms(o,e.fullPath);n(s)},function(o){r(o)})})]})})}var sE=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(c){var u=c.trim().toLowerCase();return u.charAt(0)==="."?r.toLowerCase().endsWith(u):u.endsWith("/*")?s===u.replace(/\/.*$/,""):o===u})}return!0};function Lg(e){return uE(e)||cE(e)||bx(e)||lE()}function lE(){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 cE(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function uE(e){if(Array.isArray(e))return _f(e)}function Bg(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 Hg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Bg(Object(n),!0).forEach(function(r){xx(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bg(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xx(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qa(e,t){return hE(e)||fE(e,t)||bx(e,t)||dE()}function dE(){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 bx(e,t){if(e){if(typeof e=="string")return _f(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 _f(e,t)}}function _f(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 fE(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,s=!1,c,u;try{for(n=n.call(e);!(o=(c=n.next()).done)&&(r.push(c.value),!(t&&r.length===t));o=!0);}catch(f){s=!0,u=f}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw u}}return r}}function hE(e){if(Array.isArray(e))return e}var pE="file-invalid-type",mE="file-too-large",vE="file-too-small",gE="too-many-files",yE=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:pE,message:"File type must be ".concat(n)}},Wg=function(t){return{code:mE,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},Vg=function(t){return{code:vE,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},xE={code:gE,message:"Too many files"};function Sx(e,t){var n=e.type==="application/x-moz-file"||sE(e,t);return[n,n?null:yE(t)]}function Cx(e,t,n){if(Lo(e.size))if(Lo(t)&&Lo(n)){if(e.size>n)return[!1,Wg(n)];if(e.size<t)return[!1,Vg(t)]}else{if(Lo(t)&&e.size<t)return[!1,Vg(t)];if(Lo(n)&&e.size>n)return[!1,Wg(n)]}return[!0,null]}function Lo(e){return e!=null}function bE(e){var t=e.files,n=e.accept,r=e.minSize,o=e.maxSize,s=e.multiple,c=e.maxFiles,u=e.validator;return!s&&t.length>1||s&&c>=1&&t.length>c?!1:t.every(function(f){var p=Sx(f,n),h=Qa(p,1),y=h[0],x=Cx(f,r,o),S=Qa(x,1),C=S[0],k=u?u(f):null;return y&&C&&!k})}function cc(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Pl(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 Ug(e){e.preventDefault()}function SE(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function CE(e){return e.indexOf("Edge/")!==-1}function wE(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return SE(e)||CE(e)}function mr(){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),c=1;c<o;c++)s[c-1]=arguments[c];return t.some(function(u){return!cc(r)&&u&&u.apply(void 0,[r].concat(s)),cc(r)})}}function kE(){return"showOpenFilePicker"in window}function jE(e){if(Lo(e)){var t=Object.entries(e).filter(function(n){var r=Qa(n,2),o=r[0],s=r[1],c=!0;return wx(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.')),c=!1),(!Array.isArray(s)||!s.every(kx))&&(console.warn('Skipped "'.concat(o,'" because an invalid file extension was provided.')),c=!1),c}).reduce(function(n,r){var o=Qa(r,2),s=o[0],c=o[1];return Hg(Hg({},n),{},xx({},s,c))},{});return[{description:"Files",accept:t}]}return e}function EE(e){if(Lo(e))return Object.entries(e).reduce(function(t,n){var r=Qa(n,2),o=r[0],s=r[1];return[].concat(Lg(t),[o],Lg(s))},[]).filter(function(t){return wx(t)||kx(t)}).join(",")}function PE(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function IE(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function wx(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function kx(e){return/^.*\.[\w]+$/.test(e)}var ME=["children"],TE=["open"],_E=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],DE=["refKey","onChange","onClick"];function AE(e){return RE(e)||zE(e)||jx(e)||OE()}function OE(){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 zE(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function RE(e){if(Array.isArray(e))return Df(e)}function Dd(e,t){return LE(e)||FE(e,t)||jx(e,t)||NE()}function NE(){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 jx(e,t){if(e){if(typeof e=="string")return Df(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 Df(e,t)}}function Df(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 FE(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,s=!1,c,u;try{for(n=n.call(e);!(o=(c=n.next()).done)&&(r.push(c.value),!(t&&r.length===t));o=!0);}catch(f){s=!0,u=f}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw u}}return r}}function LE(e){if(Array.isArray(e))return e}function $g(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 Dt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$g(Object(n),!0).forEach(function(r){Af(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$g(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Af(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uc(e,t){if(e==null)return{};var n=BE(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 BE(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 Kh=g.forwardRef(function(e,t){var n=e.children,r=uc(e,ME),o=Px(r),s=o.open,c=uc(o,TE);return g.useImperativeHandle(t,function(){return{open:s}},[s]),Me.createElement(g.Fragment,null,n(Dt(Dt({},c),{},{open:s})))});Kh.displayName="Dropzone";var Ex={disabled:!1,getFilesFromEvent:Z8,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};Kh.defaultProps=Ex;Kh.propTypes={children:lt.func,accept:lt.objectOf(lt.arrayOf(lt.string)),multiple:lt.bool,preventDropOnDocument:lt.bool,noClick:lt.bool,noKeyboard:lt.bool,noDrag:lt.bool,noDragEventsBubbling:lt.bool,minSize:lt.number,maxSize:lt.number,maxFiles:lt.number,disabled:lt.bool,getFilesFromEvent:lt.func,onFileDialogCancel:lt.func,onFileDialogOpen:lt.func,useFsAccessApi:lt.bool,autoFocus:lt.bool,onDragEnter:lt.func,onDragLeave:lt.func,onDragOver:lt.func,onDrop:lt.func,onDropAccepted:lt.func,onDropRejected:lt.func,onError:lt.func,validator:lt.func};var Of={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function Px(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Dt(Dt({},Ex),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,s=t.maxSize,c=t.minSize,u=t.multiple,f=t.maxFiles,p=t.onDragEnter,h=t.onDragLeave,y=t.onDragOver,x=t.onDrop,S=t.onDropAccepted,C=t.onDropRejected,k=t.onFileDialogCancel,w=t.onFileDialogOpen,j=t.useFsAccessApi,I=t.autoFocus,P=t.preventDropOnDocument,M=t.noClick,T=t.noKeyboard,D=t.noDrag,_=t.noDragEventsBubbling,R=t.onError,V=t.validator,F=g.useMemo(function(){return EE(n)},[n]),L=g.useMemo(function(){return jE(n)},[n]),Q=g.useMemo(function(){return typeof w=="function"?w:Gg},[w]),U=g.useMemo(function(){return typeof k=="function"?k:Gg},[k]),K=g.useRef(null),te=g.useRef(null),ne=g.useReducer(HE,Of),$=Dd(ne,2),Z=$[0],oe=$[1],le=Z.isFocused,Re=Z.isFileDialogActive,Ne=g.useRef(typeof window<"u"&&window.isSecureContext&&j&&kE()),Ie=function(){!Ne.current&&Re&&setTimeout(function(){if(te.current){var ae=te.current.files;ae.length||(oe({type:"closeDialog"}),U())}},300)};g.useEffect(function(){return window.addEventListener("focus",Ie,!1),function(){window.removeEventListener("focus",Ie,!1)}},[te,Re,U,Ne]);var pe=g.useRef([]),ce=function(ae){K.current&&K.current.contains(ae.target)||(ae.preventDefault(),pe.current=[])};g.useEffect(function(){return P&&(document.addEventListener("dragover",Ug,!1),document.addEventListener("drop",ce,!1)),function(){P&&(document.removeEventListener("dragover",Ug),document.removeEventListener("drop",ce))}},[K,P]),g.useEffect(function(){return!r&&I&&K.current&&K.current.focus(),function(){}},[K,I,r]);var Fe=g.useCallback(function(q){R?R(q):console.error(q)},[R]),Ve=g.useCallback(function(q){q.preventDefault(),q.persist(),N(q),pe.current=[].concat(AE(pe.current),[q.target]),Pl(q)&&Promise.resolve(o(q)).then(function(ae){if(!(cc(q)&&!_)){var Oe=ae.length,Ze=Oe>0&&bE({files:ae,accept:F,minSize:c,maxSize:s,multiple:u,maxFiles:f,validator:V}),J=Oe>0&&!Ze;oe({isDragAccept:Ze,isDragReject:J,isDragActive:!0,type:"setDraggedFiles"}),p&&p(q)}}).catch(function(ae){return Fe(ae)})},[o,p,Fe,_,F,c,s,u,f,V]),Ue=g.useCallback(function(q){q.preventDefault(),q.persist(),N(q);var ae=Pl(q);if(ae&&q.dataTransfer)try{q.dataTransfer.dropEffect="copy"}catch{}return ae&&y&&y(q),!1},[y,_]),$e=g.useCallback(function(q){q.preventDefault(),q.persist(),N(q);var ae=pe.current.filter(function(Ze){return K.current&&K.current.contains(Ze)}),Oe=ae.indexOf(q.target);Oe!==-1&&ae.splice(Oe,1),pe.current=ae,!(ae.length>0)&&(oe({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Pl(q)&&h&&h(q))},[K,h,_]),Qe=g.useCallback(function(q,ae){var Oe=[],Ze=[];q.forEach(function(J){var Le=Sx(J,F),nt=Dd(Le,2),Nt=nt[0],he=nt[1],_e=Cx(J,c,s),dn=Dd(_e,2),Vt=dn[0],fn=dn[1],ar=V?V(J):null;if(Nt&&Vt&&!ar)Oe.push(J);else{var wo=[he,fn];ar&&(wo=wo.concat(ar)),Ze.push({file:J,errors:wo.filter(function(sa){return sa})})}}),(!u&&Oe.length>1||u&&f>=1&&Oe.length>f)&&(Oe.forEach(function(J){Ze.push({file:J,errors:[xE]})}),Oe.splice(0)),oe({acceptedFiles:Oe,fileRejections:Ze,type:"setFiles"}),x&&x(Oe,Ze,ae),Ze.length>0&&C&&C(Ze,ae),Oe.length>0&&S&&S(Oe,ae)},[oe,u,F,c,s,f,x,S,C,V]),ge=g.useCallback(function(q){q.preventDefault(),q.persist(),N(q),pe.current=[],Pl(q)&&Promise.resolve(o(q)).then(function(ae){cc(q)&&!_||Qe(ae,q)}).catch(function(ae){return Fe(ae)}),oe({type:"reset"})},[o,Qe,Fe,_]),Te=g.useCallback(function(){if(Ne.current){oe({type:"openDialog"}),Q();var q={multiple:u,types:L};window.showOpenFilePicker(q).then(function(ae){return o(ae)}).then(function(ae){Qe(ae,null),oe({type:"closeDialog"})}).catch(function(ae){PE(ae)?(U(ae),oe({type:"closeDialog"})):IE(ae)?(Ne.current=!1,te.current?(te.current.value=null,te.current.click()):Fe(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."))):Fe(ae)});return}te.current&&(oe({type:"openDialog"}),Q(),te.current.value=null,te.current.click())},[oe,Q,U,j,Qe,Fe,L,u]),Ge=g.useCallback(function(q){!K.current||!K.current.isEqualNode(q.target)||(q.key===" "||q.key==="Enter"||q.keyCode===32||q.keyCode===13)&&(q.preventDefault(),Te())},[K,Te]),ye=g.useCallback(function(){oe({type:"focus"})},[]),Pe=g.useCallback(function(){oe({type:"blur"})},[]),et=g.useCallback(function(){M||(wE()?setTimeout(Te,0):Te())},[M,Te]),Be=function(ae){return r?null:ae},vt=function(ae){return T?null:Be(ae)},Rt=function(ae){return D?null:Be(ae)},N=function(ae){_&&ae.stopPropagation()},ue=g.useMemo(function(){return function(){var q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ae=q.refKey,Oe=ae===void 0?"ref":ae,Ze=q.role,J=q.onKeyDown,Le=q.onFocus,nt=q.onBlur,Nt=q.onClick,he=q.onDragEnter,_e=q.onDragOver,dn=q.onDragLeave,Vt=q.onDrop,fn=uc(q,_E);return Dt(Dt(Af({onKeyDown:vt(mr(J,Ge)),onFocus:vt(mr(Le,ye)),onBlur:vt(mr(nt,Pe)),onClick:Be(mr(Nt,et)),onDragEnter:Rt(mr(he,Ve)),onDragOver:Rt(mr(_e,Ue)),onDragLeave:Rt(mr(dn,$e)),onDrop:Rt(mr(Vt,ge)),role:typeof Ze=="string"&&Ze!==""?Ze:"presentation"},Oe,K),!r&&!T?{tabIndex:0}:{}),fn)}},[K,Ge,ye,Pe,et,Ve,Ue,$e,ge,T,D,r]),xe=g.useCallback(function(q){q.stopPropagation()},[]),ke=g.useMemo(function(){return function(){var q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ae=q.refKey,Oe=ae===void 0?"ref":ae,Ze=q.onChange,J=q.onClick,Le=uc(q,DE),nt=Af({accept:F,multiple:u,type:"file",style:{display:"none"},onChange:Be(mr(Ze,ge)),onClick:Be(mr(J,xe)),tabIndex:-1},Oe,te);return Dt(Dt({},nt),Le)}},[te,n,u,ge,r]);return Dt(Dt({},Z),{},{isFocused:le&&!r,getRootProps:ue,getInputProps:ke,rootRef:K,inputRef:te,open:Be(Te)})}function HE(e,t){switch(t.type){case"focus":return Dt(Dt({},e),{},{isFocused:!0});case"blur":return Dt(Dt({},e),{},{isFocused:!1});case"openDialog":return Dt(Dt({},Of),{},{isFileDialogActive:!0});case"closeDialog":return Dt(Dt({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Dt(Dt({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Dt(Dt({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return Dt({},Of);default:return e}}function Gg(){}function zf(){return zf=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},zf.apply(this,arguments)}var Ix=["shift","alt","meta","mod","ctrl"],WE={esc:"escape",return:"enter",".":"period",",":"comma","-":"slash"," ":"space","`":"backquote","#":"backslash","+":"bracketright",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function ao(e){return(WE[e]||e).trim().toLowerCase().replace("key","").replace("digit","").replace("numpad","").replace("arrow","")}function VE(e){return Ix.includes(e)}function Ad(e,t){return t===void 0&&(t=","),typeof e=="string"?e.split(t):e}function Od(e,t){t===void 0&&(t="+");var n=e.toLocaleLowerCase().split(t).map(function(s){return ao(s)}),r={alt:n.includes("alt"),ctrl:n.includes("ctrl")||n.includes("control"),shift:n.includes("shift"),meta:n.includes("meta"),mod:n.includes("mod")},o=n.filter(function(s){return!Ix.includes(s)});return zf({},r,{keys:o})}var so=new Set;function UE(e,t){t===void 0&&(t=",");var n=Array.isArray(e)?e:e.split(t);return n.every(function(r){return so.has(r.trim().toLowerCase())})}function Mx(e){var t=Array.isArray(e)?e:[e];so.has("meta")&&so.forEach(function(n){return!VE(n)&&so.delete(n.toLowerCase())}),t.forEach(function(n){return so.add(n.toLowerCase())})}function Tx(e){var t=Array.isArray(e)?e:[e];e==="meta"?so.clear():t.forEach(function(n){return so.delete(n.toLowerCase())})}(function(){typeof document<"u"&&(document.addEventListener("keydown",function(e){e.key!==void 0&&Mx([ao(e.key),ao(e.code)])}),document.addEventListener("keyup",function(e){e.key!==void 0&&Tx([ao(e.key),ao(e.code)])})),typeof window<"u"&&window.addEventListener("blur",function(){so.clear()})})();function $E(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function GE(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function qE(e){return _x(e,["input","textarea","select"])}function _x(e,t){var n=e.target;t===void 0&&(t=!1);var r=n&&n.tagName;return t instanceof Array?Boolean(r&&t&&t.some(function(o){return o.toLowerCase()===r.toLowerCase()})):Boolean(r&&t&&t===!0)}function YE(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 KE=function(t,n,r){r===void 0&&(r=!1);var o=n.alt,s=n.meta,c=n.mod,u=n.shift,f=n.ctrl,p=n.keys,h=t.key,y=t.code,x=t.ctrlKey,S=t.metaKey,C=t.shiftKey,k=t.altKey,w=ao(y),j=h.toLowerCase();if(!r){if(o===!k&&j!=="alt"||u===!C&&j!=="shift")return!1;if(c){if(!S&&!x)return!1}else if(s===!S&&j!=="meta"||f===!x&&j!=="ctrl")return!1}return p&&p.length===1&&(p.includes(j)||p.includes(w))?!0:p?UE(p):!p},XE=g.createContext(void 0),QE=function(){return g.useContext(XE)};function Dx(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&&Dx(e[r],t[r])},!0):e===t}var ZE=g.createContext({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),JE=function(){return g.useContext(ZE)};function e9(e){var t=g.useRef(void 0);return Dx(t.current,e)||(t.current=e),t.current}var qg=function(t){t.stopPropagation(),t.preventDefault(),t.stopImmediatePropagation()},t9=typeof window<"u"?g.useLayoutEffect:g.useEffect;function de(e,t,n,r){var o=g.useRef(null),s=g.useRef(!1),c=n instanceof Array?r instanceof Array?void 0:r:n,u=n instanceof Array?n:r instanceof Array?r:void 0,f=g.useCallback(t,u??[]),p=g.useRef(f);u?p.current=f:p.current=t;var h=e9(c),y=JE(),x=y.enabledScopes,S=QE();return t9(function(){if(!((h==null?void 0:h.enabled)===!1||!YE(x,h==null?void 0:h.scopes))){var C=function(I,P){var M;if(P===void 0&&(P=!1),!(qE(I)&&!_x(I,h==null?void 0:h.enableOnFormTags))){if(o.current!==null&&document.activeElement!==o.current&&!o.current.contains(document.activeElement)){qg(I);return}(M=I.target)!=null&&M.isContentEditable&&!(h!=null&&h.enableOnContentEditable)||Ad(e,h==null?void 0:h.splitKey).forEach(function(T){var D,_=Od(T,h==null?void 0:h.combinationKey);if(KE(I,_,h==null?void 0:h.ignoreModifiers)||(D=_.keys)!=null&&D.includes("*")){if(P&&s.current)return;if($E(I,_,h==null?void 0:h.preventDefault),!GE(I,_,h==null?void 0:h.enabled)){qg(I);return}p.current(I,_),P||(s.current=!0)}})}},k=function(I){I.key!==void 0&&(Mx(ao(I.code)),((h==null?void 0:h.keydown)===void 0&&(h==null?void 0:h.keyup)!==!0||h!=null&&h.keydown)&&C(I))},w=function(I){I.key!==void 0&&(Tx(ao(I.code)),s.current=!1,h!=null&&h.keyup&&C(I,!0))};return(o.current||(c==null?void 0:c.document)||document).addEventListener("keyup",w),(o.current||(c==null?void 0:c.document)||document).addEventListener("keydown",k),S&&Ad(e,h==null?void 0:h.splitKey).forEach(function(j){return S.addHotkey(Od(j,h==null?void 0:h.combinationKey))}),function(){(o.current||(c==null?void 0:c.document)||document).removeEventListener("keyup",w),(o.current||(c==null?void 0:c.document)||document).removeEventListener("keydown",k),S&&Ad(e,h==null?void 0:h.splitKey).forEach(function(j){return S.removeHotkey(Od(j,h==null?void 0:h.combinationKey))})}}},[e,h,x]),o}const n9=e=>{const{isDragAccept:t,isDragReject:n,overlaySecondaryText:r,setIsHandlingUpload:o}=e;return de("esc",()=>{o(!1)}),l.jsx(Ye,{sx:{position:"absolute",top:0,insetInlineStart:0,width:"100vw",height:"100vh",zIndex:999,backdropFilter:"blur(20px)"},children:l.jsx(B,{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?l.jsxs(Wn,{size:"lg",children:["Upload Image",r]}):l.jsxs(l.Fragment,{children:[l.jsx(Wn,{size:"lg",children:"Invalid Upload"}),l.jsx(Wn,{size:"md",children:"Must be single JPEG or PNG image"})]})})})},r9=e=>{const{children:t}=e,n=Y(),r=A(bt),o=ss({}),{t:s}=X(),[c,u]=g.useState(!1),{setOpenUploader:f}=Yh(),p=g.useCallback(P=>{u(!0);const M=P.errors.reduce((T,D)=>`${T}
|
||
${D.message}`,"");o({title:s("toast.uploadFailed"),description:M,status:"error",isClosable:!0})},[s,o]),h=g.useCallback(async P=>{n(Rg({imageFile:P}))},[n]),y=g.useCallback((P,M)=>{M.forEach(T=>{p(T)}),P.forEach(T=>{h(T)})},[h,p]),{getRootProps:x,getInputProps:S,isDragAccept:C,isDragReject:k,isDragActive:w,open:j}=Px({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},noClick:!0,onDrop:y,onDragOver:()=>u(!0),maxFiles:1});f(j),g.useEffect(()=>{const P=M=>{var R;const T=(R=M.clipboardData)==null?void 0:R.items;if(!T)return;const D=[];for(const V of T)V.kind==="file"&&["image/png","image/jpg"].includes(V.type)&&D.push(V);if(!D.length)return;if(M.stopImmediatePropagation(),D.length>1){o({description:s("toast.uploadFailedMultipleImagesDesc"),status:"error",isClosable:!0});return}const _=D[0].getAsFile();if(!_){o({description:s("toast.uploadFailedUnableToLoadDesc"),status:"error",isClosable:!0});return}n(Rg({imageFile:_}))};return document.addEventListener("paste",P),()=>{document.removeEventListener("paste",P)}},[s,n,o,r]);const I=["img2img","unifiedCanvas"].includes(r)?` to ${String(s(`common.${r}`))}`:"";return l.jsx(qh.Provider,{value:j,children:l.jsxs(Ye,{...x({style:{}}),onKeyDown:P=>{P.key},children:[l.jsx("input",{...S()}),t,w&&c&&l.jsx(n9,{isDragAccept:C,isDragReject:k,overlaySecondaryText:I,setIsHandlingUpload:u})]})})},o9=g.memo(r9),Ax=fe((e,t)=>{const{role:n,tooltip:r="",tooltipProps:o,isChecked:s,...c}=e;return l.jsx(Gt,{label:r,hasArrow:!0,...o,...o!=null&&o.placement?{placement:o.placement}:{placement:"top"},children:l.jsx(fo,{ref:t,role:n,"aria-checked":s!==void 0?s:void 0,...c})})});Ax.displayName="IAIIconButton";const se=g.memo(Ax);var i9=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)}}(),Bt=globalThis&&globalThis.__assign||function(){return Bt=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},Bt.apply(this,arguments)},Yg={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},Kg={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},Il={width:"20px",height:"20px",position:"absolute"},a9={top:Bt(Bt({},Yg),{top:"-5px"}),right:Bt(Bt({},Kg),{left:void 0,right:"-5px"}),bottom:Bt(Bt({},Yg),{top:void 0,bottom:"-5px"}),left:Bt(Bt({},Kg),{left:"-5px"}),topRight:Bt(Bt({},Il),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:Bt(Bt({},Il),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:Bt(Bt({},Il),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:Bt(Bt({},Il),{left:"-10px",top:"-10px",cursor:"nw-resize"})},s9=function(e){i9(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 g.createElement("div",{className:this.props.className||"",style:Bt(Bt({position:"absolute",userSelect:"none"},a9[this.props.direction]),this.props.replaceStyles||{}),onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart},this.props.children)},t}(g.PureComponent),l9=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)}}(),gr=globalThis&&globalThis.__assign||function(){return gr=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},gr.apply(this,arguments)},c9={width:"auto",height:"auto"},Ml=function(e,t,n){return Math.max(Math.min(e,n),t)},Xg=function(e,t){return Math.round(e/t)*t},Ti=function(e,t){return new RegExp(e,"i").test(t)},Tl=function(e){return Boolean(e.touches&&e.touches.length)},u9=function(e){return Boolean((e.clientX||e.clientX===0)&&(e.clientY||e.clientY===0))},Qg=function(e,t,n){n===void 0&&(n=0);var r=t.reduce(function(s,c,u){return Math.abs(c-e)<Math.abs(t[s]-e)?u:s},0),o=Math.abs(t[r]-e);return n===0||o<n?t[r]:e},zd=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"},_l=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},d9=function(e,t,n,r,o,s,c){return r=_l(r,e.width,t,n),o=_l(o,e.height,t,n),s=_l(s,e.width,t,n),c=_l(c,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 c>"u"?void 0:Number(c)}},f9=["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"],Zg="__resizable_base__",Ox=function(e){l9(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(Zg):s.className+=Zg,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||c9},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,c=this.resizable.style.position;c!=="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=c}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 f=n.getParentSize(),p=Number(n.state[u].toString().replace("px","")),h=p/f[u]*100;return h+"%"}return zd(n.state[u])},s=r&&typeof r.width<"u"&&!this.state.isResizing?zd(r.width):o("width"),c=r&&typeof r.height<"u"&&!this.state.isResizing?zd(r.height):o("height");return{width:s,height:c}},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,c=o&&Ti("left",s),u=o&&Ti("top",s),f,p;if(this.props.bounds==="parent"){var h=this.parentNode;h&&(f=c?this.resizableRight-this.parentLeft:h.offsetWidth+(this.parentLeft-this.resizableLeft),p=u?this.resizableBottom-this.parentTop:h.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(f=c?this.resizableRight:this.window.innerWidth-this.resizableLeft,p=u?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(f=c?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),p=u?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return f&&Number.isFinite(f)&&(n=n&&n<f?n:f),p&&Number.isFinite(p)&&(r=r&&r<p?r:p),{maxWidth:n,maxHeight:r}},t.prototype.calculateNewSizeFromDirection=function(n,r){var o=this.props.scale||1,s=this.props.resizeRatio||1,c=this.state,u=c.direction,f=c.original,p=this.props,h=p.lockAspectRatio,y=p.lockAspectRatioExtraHeight,x=p.lockAspectRatioExtraWidth,S=f.width,C=f.height,k=y||0,w=x||0;return Ti("right",u)&&(S=f.width+(n-f.x)*s/o,h&&(C=(S-w)/this.ratio+k)),Ti("left",u)&&(S=f.width-(n-f.x)*s/o,h&&(C=(S-w)/this.ratio+k)),Ti("bottom",u)&&(C=f.height+(r-f.y)*s/o,h&&(S=(C-k)*this.ratio+w)),Ti("top",u)&&(C=f.height-(r-f.y)*s/o,h&&(S=(C-k)*this.ratio+w)),{newWidth:S,newHeight:C}},t.prototype.calculateNewSizeFromAspectRatio=function(n,r,o,s){var c=this.props,u=c.lockAspectRatio,f=c.lockAspectRatioExtraHeight,p=c.lockAspectRatioExtraWidth,h=typeof s.width>"u"?10:s.width,y=typeof o.width>"u"||o.width<0?n:o.width,x=typeof s.height>"u"?10:s.height,S=typeof o.height>"u"||o.height<0?r:o.height,C=f||0,k=p||0;if(u){var w=(x-C)*this.ratio+k,j=(S-C)*this.ratio+k,I=(h-k)/this.ratio+C,P=(y-k)/this.ratio+C,M=Math.max(h,w),T=Math.min(y,j),D=Math.max(x,I),_=Math.min(S,P);n=Ml(n,M,T),r=Ml(r,D,_)}else n=Ml(n,h,y),r=Ml(r,x,S);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(),c=s.left,u=s.top,f=s.right,p=s.bottom;this.resizableLeft=c,this.resizableRight=f,this.resizableTop=u,this.resizableBottom=p}},t.prototype.onResizeStart=function(n,r){if(!(!this.resizable||!this.window)){var o=0,s=0;if(n.nativeEvent&&u9(n.nativeEvent)?(o=n.nativeEvent.clientX,s=n.nativeEvent.clientY):n.nativeEvent&&Tl(n.nativeEvent)&&(o=n.nativeEvent.touches[0].clientX,s=n.nativeEvent.touches[0].clientY),this.props.onResizeStart&&this.resizable){var c=this.props.onResizeStart(n,r,this.resizable);if(c===!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,f=this.window.getComputedStyle(this.resizable);if(f.flexBasis!=="auto"){var p=this.parentNode;if(p){var h=this.window.getComputedStyle(p).flexDirection;this.flexDir=h.startsWith("row")?"row":"column",u=f.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var y={original:{x:o,y:s,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:gr(gr({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(n.target).cursor||"auto"}),direction:r,flexBasis:u};this.setState(y)}},t.prototype.onMouseMove=function(n){var r=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&Tl(n))try{n.preventDefault(),n.stopPropagation()}catch{}var o=this.props,s=o.maxWidth,c=o.maxHeight,u=o.minWidth,f=o.minHeight,p=Tl(n)?n.touches[0].clientX:n.clientX,h=Tl(n)?n.touches[0].clientY:n.clientY,y=this.state,x=y.direction,S=y.original,C=y.width,k=y.height,w=this.getParentSize(),j=d9(w,this.window.innerWidth,this.window.innerHeight,s,c,u,f);s=j.maxWidth,c=j.maxHeight,u=j.minWidth,f=j.minHeight;var I=this.calculateNewSizeFromDirection(p,h),P=I.newHeight,M=I.newWidth,T=this.calculateNewMaxFromBoundary(s,c);this.props.snap&&this.props.snap.x&&(M=Qg(M,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(P=Qg(P,this.props.snap.y,this.props.snapGap));var D=this.calculateNewSizeFromAspectRatio(M,P,{width:T.maxWidth,height:T.maxHeight},{width:u,height:f});if(M=D.newWidth,P=D.newHeight,this.props.grid){var _=Xg(M,this.props.grid[0]),R=Xg(P,this.props.grid[1]),V=this.props.snapGap||0;M=V===0||Math.abs(_-M)<=V?_:M,P=V===0||Math.abs(R-P)<=V?R:P}var F={width:M-S.width,height:P-S.height};if(C&&typeof C=="string"){if(C.endsWith("%")){var L=M/w.width*100;M=L+"%"}else if(C.endsWith("vw")){var Q=M/this.window.innerWidth*100;M=Q+"vw"}else if(C.endsWith("vh")){var U=M/this.window.innerHeight*100;M=U+"vh"}}if(k&&typeof k=="string"){if(k.endsWith("%")){var L=P/w.height*100;P=L+"%"}else if(k.endsWith("vw")){var Q=P/this.window.innerWidth*100;P=Q+"vw"}else if(k.endsWith("vh")){var U=P/this.window.innerHeight*100;P=U+"vh"}}var K={width:this.createSizeForCssProperty(M,"width"),height:this.createSizeForCssProperty(P,"height")};this.flexDir==="row"?K.flexBasis=K.width:this.flexDir==="column"&&(K.flexBasis=K.height),HS.flushSync(function(){r.setState(K)}),this.props.onResize&&this.props.onResize(n,x,this.resizable,F)}},t.prototype.onMouseUp=function(n){var r=this.state,o=r.isResizing,s=r.direction,c=r.original;if(!(!o||!this.resizable)){var u={width:this.size.width-c.width,height:this.size.height-c.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:gr(gr({},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,c=r.handleClasses,u=r.handleWrapperStyle,f=r.handleWrapperClass,p=r.handleComponent;if(!o)return null;var h=Object.keys(o).map(function(y){return o[y]!==!1?g.createElement(s9,{key:y,direction:y,onResizeStart:n.onResizeStart,replaceStyles:s&&s[y],className:c&&c[y]},p&&p[y]?p[y]:null):null});return g.createElement("div",{className:f,style:u},h)},t.prototype.render=function(){var n=this,r=Object.keys(this.props).reduce(function(c,u){return f9.indexOf(u)!==-1||(c[u]=n.props[u]),c},{}),o=gr(gr(gr({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 g.createElement(s,gr({ref:this.ref,style:o,className:this.props.className},r),this.state.isResizing&&g.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}(g.PureComponent),zx={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Jg=Me.createContext&&Me.createContext(zx),co=globalThis&&globalThis.__assign||function(){return co=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},co.apply(this,arguments)},h9=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function Rx(e){return e&&e.map(function(t,n){return Me.createElement(t.tag,co({key:n},t.attr),Rx(t.child))})}function ve(e){return function(t){return Me.createElement(p9,co({attr:co({},e.attr)},t),Rx(e.child))}}function p9(e){var t=function(n){var r=e.attr,o=e.size,s=e.title,c=h9(e,["attr","size","title"]),u=o||n.size||"1em",f;return n.className&&(f=n.className),e.className&&(f=(f?f+" ":"")+e.className),Me.createElement("svg",co({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,c,{className:f,style:co(co({color:e.color||n.color},n.style),e.style),height:u,width:u,xmlns:"http://www.w3.org/2000/svg"}),s&&Me.createElement("title",null,s),e.children)};return Jg!==void 0?Me.createElement(Jg.Consumer,null,function(n){return t(n)}):t(zx)}function m9(e){return ve({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 v9(e){return ve({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 g9(e){return ve({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M143 256.3L7 120.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0L313 86.3c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.4 9.5-24.6 9.5-34 .1zm34 192l136-136c9.4-9.4 9.4-24.6 0-33.9l-22.6-22.6c-9.4-9.4-24.6-9.4-33.9 0L160 352.1l-96.4-96.4c-9.4-9.4-24.6-9.4-33.9 0L7 278.3c-9.4 9.4-9.4 24.6 0 33.9l136 136c9.4 9.5 24.6 9.5 34 .1z"}}]})(e)}function y9(e){return ve({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 x9(e){return ve({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 b9(e){return ve({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 S9(e){return ve({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 Nx(e){return ve({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 C9(e){return ve({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 w9(e){return ve({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 Ac(e){return ve({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 Fx(e){return ve({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 Ki(e){return ve({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 Lx(e){return ve({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 k9(e){return ve({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 Xh(e){return ve({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 Bx(e){return ve({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 j9(e){return ve({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 E9(e){return ve({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 Hx(e){return ve({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 P9(e){return ve({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 I9(e){return ve({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 Wx(e){return ve({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 M9(e){return ve({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 T9(e){return ve({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 _9(e){return ve({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 D9(e){return ve({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M152.1 236.2c-3.5-12.1-7.8-33.2-7.8-33.2h-.5s-4.3 21.1-7.8 33.2l-11.1 37.5H163zM616 96H336v320h280c13.3 0 24-10.7 24-24V120c0-13.3-10.7-24-24-24zm-24 120c0 6.6-5.4 12-12 12h-11.4c-6.9 23.6-21.7 47.4-42.7 69.9 8.4 6.4 17.1 12.5 26.1 18 5.5 3.4 7.3 10.5 4.1 16.2l-7.9 13.9c-3.4 5.9-10.9 7.8-16.7 4.3-12.6-7.8-24.5-16.1-35.4-24.9-10.9 8.7-22.7 17.1-35.4 24.9-5.8 3.5-13.3 1.6-16.7-4.3l-7.9-13.9c-3.2-5.6-1.4-12.8 4.2-16.2 9.3-5.7 18-11.7 26.1-18-7.9-8.4-14.9-17-21-25.7-4-5.7-2.2-13.6 3.7-17.1l6.5-3.9 7.3-4.3c5.4-3.2 12.4-1.7 16 3.4 5 7 10.8 14 17.4 20.9 13.5-14.2 23.8-28.9 30-43.2H412c-6.6 0-12-5.4-12-12v-16c0-6.6 5.4-12 12-12h64v-16c0-6.6 5.4-12 12-12h16c6.6 0 12 5.4 12 12v16h64c6.6 0 12 5.4 12 12zM0 120v272c0 13.3 10.7 24 24 24h280V96H24c-13.3 0-24 10.7-24 24zm58.9 216.1L116.4 167c1.7-4.9 6.2-8.1 11.4-8.1h32.5c5.1 0 9.7 3.3 11.4 8.1l57.5 169.1c2.6 7.8-3.1 15.9-11.4 15.9h-22.9a12 12 0 0 1-11.5-8.6l-9.4-31.9h-60.2l-9.1 31.8c-1.5 5.1-6.2 8.7-11.5 8.7H70.3c-8.2 0-14-8.1-11.4-15.9z"}}]})(e)}function Vx(e){return ve({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 A9(e){return ve({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 O9(e){return ve({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 Ux(e){return ve({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 z9(e){return ve({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M204.3 5C104.9 24.4 24.8 104.3 5.2 203.4c-37 187 131.7 326.4 258.8 306.7 41.2-6.4 61.4-54.6 42.5-91.7-23.1-45.4 9.9-98.4 60.9-98.4h79.7c35.8 0 64.8-29.6 64.9-65.3C511.5 97.1 368.1-26.9 204.3 5zM96 320c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm32-128c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128-64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128 64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z"}}]})(e)}function R9(e){return ve({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 vs(e){return ve({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 N9(e){return ve({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 F9(e){return ve({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M184.561 261.903c3.232 13.997-12.123 24.635-24.068 17.168l-40.736-25.455-50.867 81.402C55.606 356.273 70.96 384 96.012 384H148c6.627 0 12 5.373 12 12v40c0 6.627-5.373 12-12 12H96.115c-75.334 0-121.302-83.048-81.408-146.88l50.822-81.388-40.725-25.448c-12.081-7.547-8.966-25.961 4.879-29.158l110.237-25.45c8.611-1.988 17.201 3.381 19.189 11.99l25.452 110.237zm98.561-182.915l41.289 66.076-40.74 25.457c-12.051 7.528-9 25.953 4.879 29.158l110.237 25.45c8.672 1.999 17.215-3.438 19.189-11.99l25.45-110.237c3.197-13.844-11.99-24.719-24.068-17.168l-40.687 25.424-41.263-66.082c-37.521-60.033-125.209-60.171-162.816 0l-17.963 28.766c-3.51 5.62-1.8 13.021 3.82 16.533l33.919 21.195c5.62 3.512 13.024 1.803 16.536-3.817l17.961-28.743c12.712-20.341 41.973-19.676 54.257-.022zM497.288 301.12l-27.515-44.065c-3.511-5.623-10.916-7.334-16.538-3.821l-33.861 21.159c-5.62 3.512-7.33 10.915-3.818 16.536l27.564 44.112c13.257 21.211-2.057 48.96-27.136 48.96H320V336.02c0-14.213-17.242-21.383-27.313-11.313l-80 79.981c-6.249 6.248-6.249 16.379 0 22.627l80 79.989C302.689 517.308 320 510.3 320 495.989V448h95.88c75.274 0 121.335-82.997 81.408-146.88z"}}]})(e)}function L9(e){return ve({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 Qh(e){return ve({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 B9(e){return ve({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 H9(e){return ve({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 W9(e){return ve({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 e0(e){return ve({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 Zh(e){return ve({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 V9(e){return ve({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 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-16z"}}]})(e)}function ri(e){return ve({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 U9(e){return ve({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 Oc(e){return ve({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 $9(e){return ve({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"}}]})(e)}function Jh(e){return ve({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M507.73 109.1c-2.24-9.03-13.54-12.09-20.12-5.51l-74.36 74.36-67.88-11.31-11.31-67.88 74.36-74.36c6.62-6.62 3.43-17.9-5.66-20.16-47.38-11.74-99.55.91-136.58 37.93-39.64 39.64-50.55 97.1-34.05 147.2L18.74 402.76c-24.99 24.99-24.99 65.51 0 90.5 24.99 24.99 65.51 24.99 90.5 0l213.21-213.21c50.12 16.71 107.47 5.68 147.37-34.22 37.07-37.07 49.7-89.32 37.91-136.73zM64 472c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24z"}}]})(e)}const Et=e=>e.system,G9=e=>e.system.toastQueue,$x=me(Et,e=>{const{model_list:t}=e,n=ee.reduce(t,(r,o,s)=>(o.status==="active"&&(r=s),r),"");return{...t[n],name:n}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),q9=me(Et,e=>{const{model_list:t}=e;return ee.pickBy(t,(r,o)=>{if(r.format==="diffusers")return{name:o,...r}})},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),Y9=me(Et,e=>e.log,{memoizeOptions:{resultEqualityCheck:(e,t)=>e.length===t.length}}),K9=me(Et,e=>({shouldShowLogViewer:e.shouldShowLogViewer,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}),{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),X9=()=>{const e=Y(),{t}=X(),n=A(Y9),{shouldShowLogViewer:r,hasError:o,wasErrorSeen:s}=A(K9),[c,u]=g.useState(!0),f=g.useRef(null);g.useLayoutEffect(()=>{f.current!==null&&c&&(f.current.scrollTop=f.current.scrollHeight)},[c,n,r]);const p=()=>{e(C1()),e(cd(!r))};de("`",()=>{e(cd(!r))},[r]),de("esc",()=>{e(cd(!1))});const h=()=>{f.current&&c&&f.current.scrollTop<f.current.scrollHeight-f.current.clientHeight&&u(!1)};return l.jsxs(l.Fragment,{children:[r&&l.jsx(Ox,{defaultSize:{width:"100%",height:200},style:{display:"flex",position:"fixed",insetInlineStart:0,bottom:0,zIndex:9999},maxHeight:"90vh",children:l.jsx(B,{sx:{flexDirection:"column",width:"100vw",overflow:"auto",direction:"column",fontFamily:"monospace",pt:0,pr:4,pb:4,pl:12,borderTopWidth:5,bg:"base.850",borderColor:"base.700"},ref:f,onScroll:h,children:n.map((y,x)=>{const{timestamp:S,message:C,level:k}=y,w=k==="info"?"base":k;return l.jsxs(B,{sx:{gap:2,color:`${w}.300`},children:[l.jsxs(Ce,{fontWeight:"600",children:[S,":"]}),l.jsx(Ce,{wordBreak:"break-all",children:C})]},x)})})}),r&&l.jsx(Gt,{hasArrow:!0,label:c?"Autoscroll On":"Autoscroll Off",children:l.jsx(se,{size:"sm","aria-label":t("accessibility.toggleAutoscroll"),icon:l.jsx(g9,{}),onClick:()=>u(!c),isChecked:c,sx:{position:"fixed",insetInlineStart:2,bottom:12,zIndex:"10000"}})}),l.jsx(Gt,{hasArrow:!0,label:r?"Hide Console":"Show Console",children:l.jsx(se,{size:"sm","aria-label":t("accessibility.toggleLogViewer"),icon:r?l.jsx(O9,{}):l.jsx(Fx,{}),onClick:p,sx:{position:"fixed",insetInlineStart:2,bottom:2,zIndex:"10000"},colorScheme:o||!s?"error":"base"})})]})},Q9="0px",Gx="calc(70px + 1rem)",dc=1.5,Z9=`calc(100vw - ${Q9})`,J9=`calc(100vh - ${dc*4}px)`,eP=`calc(100vh - ${Gx})`,tP=`calc(100vh - (${Gx} + 4.4rem))`,t0=384,nP=me(Et,e=>({isProcessing:e.isProcessing,currentStep:e.currentStep,totalSteps:e.totalSteps,currentStatusHasSteps:e.currentStatusHasSteps}),{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),rP=()=>{const{t:e}=X(),{isProcessing:t,currentStep:n,totalSteps:r,currentStatusHasSteps:o}=A(nP),s=n?Math.round(n*100/r):0;return l.jsx(Qy,{value:s,"aria-label":e("accessibility.invokeProgressBar"),isIndeterminate:t&&!o,height:dc,zIndex:99})};function oP(e){const{title:t,hotkey:n,description:r}=e;return l.jsxs(or,{sx:{gridTemplateColumns:"auto max-content",justifyContent:"space-between",alignItems:"center"},children:[l.jsxs(or,{children:[l.jsx(Ce,{fontWeight:600,children:t}),r&&l.jsx(Ce,{sx:{fontSize:"sm"},variant:"subtext",children:r})]}),l.jsx(Ye,{sx:{fontSize:"sm",fontWeight:600,px:2,py:1},children:n})]})}function iP({children:e}){const{isOpen:t,onOpen:n,onClose:r}=ho(),{t:o}=X(),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:"`"}],c=[{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"}],f=[{title:o("hotkeys.selectBrush.title"),desc:o("hotkeys.selectBrush.desc"),hotkey:"B"},{title:o("hotkeys.selectEraser.title"),desc:o("hotkeys.selectEraser.desc"),hotkey:"E"},{title:o("hotkeys.decreaseBrushSize.title"),desc:o("hotkeys.decreaseBrushSize.desc"),hotkey:"["},{title:o("hotkeys.increaseBrushSize.title"),desc:o("hotkeys.increaseBrushSize.desc"),hotkey:"]"},{title:o("hotkeys.decreaseBrushOpacity.title"),desc:o("hotkeys.decreaseBrushOpacity.desc"),hotkey:"Shift + ["},{title:o("hotkeys.increaseBrushOpacity.title"),desc:o("hotkeys.increaseBrushOpacity.desc"),hotkey:"Shift + ]"},{title:o("hotkeys.moveTool.title"),desc:o("hotkeys.moveTool.desc"),hotkey:"V"},{title:o("hotkeys.fillBoundingBox.title"),desc:o("hotkeys.fillBoundingBox.desc"),hotkey:"Shift + F"},{title:o("hotkeys.eraseBoundingBox.title"),desc:o("hotkeys.eraseBoundingBox.desc"),hotkey:"Delete / Backspace"},{title:o("hotkeys.colorPicker.title"),desc:o("hotkeys.colorPicker.desc"),hotkey:"C"},{title:o("hotkeys.toggleSnap.title"),desc:o("hotkeys.toggleSnap.desc"),hotkey:"N"},{title:o("hotkeys.quickToggleMove.title"),desc:o("hotkeys.quickToggleMove.desc"),hotkey:"Hold Space"},{title:o("hotkeys.toggleLayer.title"),desc:o("hotkeys.toggleLayer.desc"),hotkey:"Q"},{title:o("hotkeys.clearMask.title"),desc:o("hotkeys.clearMask.desc"),hotkey:"Shift+C"},{title:o("hotkeys.hideMask.title"),desc:o("hotkeys.hideMask.desc"),hotkey:"H"},{title:o("hotkeys.showHideBoundingBox.title"),desc:o("hotkeys.showHideBoundingBox.desc"),hotkey:"Shift+H"},{title:o("hotkeys.mergeVisible.title"),desc:o("hotkeys.mergeVisible.desc"),hotkey:"Shift+M"},{title:o("hotkeys.saveToGallery.title"),desc:o("hotkeys.saveToGallery.desc"),hotkey:"Shift+S"},{title:o("hotkeys.copyToClipboard.title"),desc:o("hotkeys.copyToClipboard.desc"),hotkey:"Ctrl+C"},{title:o("hotkeys.downloadImage.title"),desc:o("hotkeys.downloadImage.desc"),hotkey:"Shift+D"},{title:o("hotkeys.undoStroke.title"),desc:o("hotkeys.undoStroke.desc"),hotkey:"Ctrl+Z"},{title:o("hotkeys.redoStroke.title"),desc:o("hotkeys.redoStroke.desc"),hotkey:"Ctrl+Shift+Z, Ctrl+Y"},{title:o("hotkeys.resetView.title"),desc:o("hotkeys.resetView.desc"),hotkey:"R"},{title:o("hotkeys.previousStagingImage.title"),desc:o("hotkeys.previousStagingImage.desc"),hotkey:"Arrow Left"},{title:o("hotkeys.nextStagingImage.title"),desc:o("hotkeys.nextStagingImage.desc"),hotkey:"Arrow Right"},{title:o("hotkeys.acceptStagingImage.title"),desc:o("hotkeys.acceptStagingImage.desc"),hotkey:"Enter"}],p=h=>l.jsx(B,{flexDir:"column",gap:4,children:h.map((y,x)=>l.jsxs(B,{flexDir:"column",px:2,gap:4,children:[l.jsx(oP,{title:y.title,description:y.desc,hotkey:y.hotkey}),x<h.length-1&&l.jsx(by,{})]},x))});return l.jsxs(l.Fragment,{children:[g.cloneElement(e,{onClick:n}),l.jsxs(po,{isOpen:t,onClose:r,children:[l.jsx(Br,{}),l.jsxs(mo,{children:[l.jsx(Lr,{children:o("hotkeys.keyboardShortcuts")}),l.jsx(ia,{}),l.jsx(Hr,{children:l.jsx(oh,{allowMultiple:!0,children:l.jsxs(B,{flexDir:"column",gap:2,children:[l.jsxs(Oi,{children:[l.jsx(Di,{children:l.jsxs(B,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[l.jsx("h2",{children:o("hotkeys.appHotkeys")}),l.jsx(Ai,{})]})}),l.jsx(zi,{children:p(s)})]}),l.jsxs(Oi,{children:[l.jsx(Di,{children:l.jsxs(B,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[l.jsx("h2",{children:o("hotkeys.generalHotkeys")}),l.jsx(Ai,{})]})}),l.jsx(zi,{children:p(c)})]}),l.jsxs(Oi,{children:[l.jsx(Di,{children:l.jsxs(B,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[l.jsx("h2",{children:o("hotkeys.galleryHotkeys")}),l.jsx(Ai,{})]})}),l.jsx(zi,{children:p(u)})]}),l.jsxs(Oi,{children:[l.jsx(Di,{children:l.jsxs(B,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[l.jsx("h2",{children:o("hotkeys.unifiedCanvasHotkeys")}),l.jsx(Ai,{})]})}),l.jsx(zi,{children:p(f)})]})]})})}),l.jsx(Fr,{})]})]})]})}const aP=fe((e,t)=>{const{children:n,tooltip:r="",tooltipProps:o,isChecked:s,...c}=e;return l.jsx(Gt,{label:r,...o,children:l.jsx(ti,{ref:t,"aria-checked":s,...c,children:n})})}),Je=g.memo(aP),sP=e=>{const{label:t="",isDisabled:n=!1,isInvalid:r,formControlProps:o,...s}=e;return l.jsxs(rt,{isInvalid:r,isDisabled:n,...o,children:[t!==""&&l.jsx(st,{children:t}),l.jsx(xh,{...s})]})},mt=g.memo(sP),n0=/^-?(0\.)?\.?$/,lP=e=>{const{label:t,isDisabled:n=!1,showStepper:r=!0,isInvalid:o,value:s,onChange:c,min:u,max:f,isInteger:p=!0,formControlProps:h,formLabelProps:y,numberInputFieldProps:x,numberInputStepperProps:S,tooltipProps:C,...k}=e,[w,j]=g.useState(String(s));g.useEffect(()=>{!w.match(n0)&&s!==Number(w)&&j(String(s))},[s,w]);const I=M=>{j(M),M.match(n0)||c(p?Math.floor(Number(M)):Number(M))},P=M=>{const T=ee.clamp(p?Math.floor(Number(M.target.value)):Number(M.target.value),u,f);j(String(T)),c(T)};return l.jsx(Gt,{...C,children:l.jsxs(rt,{isDisabled:n,isInvalid:o,...h,children:[t&&l.jsx(st,{...y,children:t}),l.jsxs(Rh,{value:w,min:u,max:f,keepWithinRange:!0,clampValueOnBlur:!1,onChange:I,onBlur:P,...k,children:[l.jsx(Fh,{...x}),r&&l.jsxs(Nh,{children:[l.jsx(Bh,{...S}),l.jsx(Lh,{...S})]})]})]})})},Wr=g.memo(lP);var r0=Array.isArray,o0=Object.keys,cP=Object.prototype.hasOwnProperty,uP=typeof Element<"u";function Rf(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=r0(e),r=r0(t),o,s,c;if(n&&r){if(s=e.length,s!=t.length)return!1;for(o=s;o--!==0;)if(!Rf(e[o],t[o]))return!1;return!0}if(n!=r)return!1;var u=e instanceof Date,f=t instanceof Date;if(u!=f)return!1;if(u&&f)return e.getTime()==t.getTime();var p=e instanceof RegExp,h=t instanceof RegExp;if(p!=h)return!1;if(p&&h)return e.toString()==t.toString();var y=o0(e);if(s=y.length,s!==o0(t).length)return!1;for(o=s;o--!==0;)if(!cP.call(t,y[o]))return!1;if(uP&&e instanceof Element&&t instanceof Element)return e===t;for(o=s;o--!==0;)if(c=y[o],!(c==="_owner"&&e.$$typeof)&&!Rf(e[c],t[c]))return!1;return!0}return e!==e&&t!==t}var io=function(t,n){try{return Rf(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}},dP=function(t){return fP(t)&&!hP(t)};function fP(e){return!!e&&typeof e=="object"}function hP(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||vP(e)}var pP=typeof Symbol=="function"&&Symbol.for,mP=pP?Symbol.for("react.element"):60103;function vP(e){return e.$$typeof===mP}function gP(e){return Array.isArray(e)?[]:{}}function fc(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Za(gP(e),e,t):e}function yP(e,t,n){return e.concat(t).map(function(r){return fc(r,n)})}function xP(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(o){r[o]=fc(e[o],n)}),Object.keys(t).forEach(function(o){!n.isMergeableObject(t[o])||!e[o]?r[o]=fc(t[o],n):r[o]=Za(e[o],t[o],n)}),r}function Za(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||yP,n.isMergeableObject=n.isMergeableObject||dP;var r=Array.isArray(t),o=Array.isArray(e),s=r===o;return s?r?n.arrayMerge(e,t,n):xP(e,t,n):fc(t,n)}Za.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,o){return Za(r,o,n)},{})};var Nf=Za,bP=typeof global=="object"&&global&&global.Object===Object&&global;const qx=bP;var SP=typeof self=="object"&&self&&self.Object===Object&&self,CP=qx||SP||Function("return this")();const Pr=CP;var wP=Pr.Symbol;const vo=wP;var Yx=Object.prototype,kP=Yx.hasOwnProperty,jP=Yx.toString,_a=vo?vo.toStringTag:void 0;function EP(e){var t=kP.call(e,_a),n=e[_a];try{e[_a]=void 0;var r=!0}catch{}var o=jP.call(e);return r&&(t?e[_a]=n:delete e[_a]),o}var PP=Object.prototype,IP=PP.toString;function MP(e){return IP.call(e)}var TP="[object Null]",_P="[object Undefined]",i0=vo?vo.toStringTag:void 0;function oi(e){return e==null?e===void 0?_P:TP:i0&&i0 in Object(e)?EP(e):MP(e)}function Kx(e,t){return function(n){return e(t(n))}}var DP=Kx(Object.getPrototypeOf,Object);const ep=DP;function ii(e){return e!=null&&typeof e=="object"}var AP="[object Object]",OP=Function.prototype,zP=Object.prototype,Xx=OP.toString,RP=zP.hasOwnProperty,NP=Xx.call(Object);function a0(e){if(!ii(e)||oi(e)!=AP)return!1;var t=ep(e);if(t===null)return!0;var n=RP.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Xx.call(n)==NP}function FP(){this.__data__=[],this.size=0}function Qx(e,t){return e===t||e!==e&&t!==t}function zc(e,t){for(var n=e.length;n--;)if(Qx(e[n][0],t))return n;return-1}var LP=Array.prototype,BP=LP.splice;function HP(e){var t=this.__data__,n=zc(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():BP.call(t,n,1),--this.size,!0}function WP(e){var t=this.__data__,n=zc(t,e);return n<0?void 0:t[n][1]}function VP(e){return zc(this.__data__,e)>-1}function UP(e,t){var n=this.__data__,r=zc(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function $r(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}$r.prototype.clear=FP;$r.prototype.delete=HP;$r.prototype.get=WP;$r.prototype.has=VP;$r.prototype.set=UP;function $P(){this.__data__=new $r,this.size=0}function GP(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function qP(e){return this.__data__.get(e)}function YP(e){return this.__data__.has(e)}function gs(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var KP="[object AsyncFunction]",XP="[object Function]",QP="[object GeneratorFunction]",ZP="[object Proxy]";function Zx(e){if(!gs(e))return!1;var t=oi(e);return t==XP||t==QP||t==KP||t==ZP}var JP=Pr["__core-js_shared__"];const Rd=JP;var s0=function(){var e=/[^.]+$/.exec(Rd&&Rd.keys&&Rd.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function eI(e){return!!s0&&s0 in e}var tI=Function.prototype,nI=tI.toString;function ai(e){if(e!=null){try{return nI.call(e)}catch{}try{return e+""}catch{}}return""}var rI=/[\\^$.*+?()[\]{}|]/g,oI=/^\[object .+?Constructor\]$/,iI=Function.prototype,aI=Object.prototype,sI=iI.toString,lI=aI.hasOwnProperty,cI=RegExp("^"+sI.call(lI).replace(rI,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function uI(e){if(!gs(e)||eI(e))return!1;var t=Zx(e)?cI:oI;return t.test(ai(e))}function dI(e,t){return e==null?void 0:e[t]}function si(e,t){var n=dI(e,t);return uI(n)?n:void 0}var fI=si(Pr,"Map");const Ja=fI;var hI=si(Object,"create");const es=hI;function pI(){this.__data__=es?es(null):{},this.size=0}function mI(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var vI="__lodash_hash_undefined__",gI=Object.prototype,yI=gI.hasOwnProperty;function xI(e){var t=this.__data__;if(es){var n=t[e];return n===vI?void 0:n}return yI.call(t,e)?t[e]:void 0}var bI=Object.prototype,SI=bI.hasOwnProperty;function CI(e){var t=this.__data__;return es?t[e]!==void 0:SI.call(t,e)}var wI="__lodash_hash_undefined__";function kI(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=es&&t===void 0?wI:t,this}function Zo(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Zo.prototype.clear=pI;Zo.prototype.delete=mI;Zo.prototype.get=xI;Zo.prototype.has=CI;Zo.prototype.set=kI;function jI(){this.size=0,this.__data__={hash:new Zo,map:new(Ja||$r),string:new Zo}}function EI(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Rc(e,t){var n=e.__data__;return EI(t)?n[typeof t=="string"?"string":"hash"]:n.map}function PI(e){var t=Rc(this,e).delete(e);return this.size-=t?1:0,t}function II(e){return Rc(this,e).get(e)}function MI(e){return Rc(this,e).has(e)}function TI(e,t){var n=Rc(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function bo(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}bo.prototype.clear=jI;bo.prototype.delete=PI;bo.prototype.get=II;bo.prototype.has=MI;bo.prototype.set=TI;var _I=200;function DI(e,t){var n=this.__data__;if(n instanceof $r){var r=n.__data__;if(!Ja||r.length<_I-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new bo(r)}return n.set(e,t),this.size=n.size,this}function aa(e){var t=this.__data__=new $r(e);this.size=t.size}aa.prototype.clear=$P;aa.prototype.delete=GP;aa.prototype.get=qP;aa.prototype.has=YP;aa.prototype.set=DI;function AI(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var OI=function(){try{var e=si(Object,"defineProperty");return e({},"",{}),e}catch{}}();const l0=OI;function Jx(e,t,n){t=="__proto__"&&l0?l0(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var zI=Object.prototype,RI=zI.hasOwnProperty;function e4(e,t,n){var r=e[t];(!(RI.call(e,t)&&Qx(r,n))||n===void 0&&!(t in e))&&Jx(e,t,n)}function Nc(e,t,n,r){var o=!n;n||(n={});for(var s=-1,c=t.length;++s<c;){var u=t[s],f=r?r(n[u],e[u],u,n,e):void 0;f===void 0&&(f=e[u]),o?Jx(n,u,f):e4(n,u,f)}return n}function NI(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var FI="[object Arguments]";function c0(e){return ii(e)&&oi(e)==FI}var t4=Object.prototype,LI=t4.hasOwnProperty,BI=t4.propertyIsEnumerable,HI=c0(function(){return arguments}())?c0:function(e){return ii(e)&&LI.call(e,"callee")&&!BI.call(e,"callee")};const WI=HI;var VI=Array.isArray;const ys=VI;function UI(){return!1}var n4=typeof exports=="object"&&exports&&!exports.nodeType&&exports,u0=n4&&typeof module=="object"&&module&&!module.nodeType&&module,$I=u0&&u0.exports===n4,d0=$I?Pr.Buffer:void 0,GI=d0?d0.isBuffer:void 0,qI=GI||UI;const r4=qI;var YI=9007199254740991,KI=/^(?:0|[1-9]\d*)$/;function XI(e,t){var n=typeof e;return t=t??YI,!!t&&(n=="number"||n!="symbol"&&KI.test(e))&&e>-1&&e%1==0&&e<t}var QI=9007199254740991;function o4(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=QI}var ZI="[object Arguments]",JI="[object Array]",eM="[object Boolean]",tM="[object Date]",nM="[object Error]",rM="[object Function]",oM="[object Map]",iM="[object Number]",aM="[object Object]",sM="[object RegExp]",lM="[object Set]",cM="[object String]",uM="[object WeakMap]",dM="[object ArrayBuffer]",fM="[object DataView]",hM="[object Float32Array]",pM="[object Float64Array]",mM="[object Int8Array]",vM="[object Int16Array]",gM="[object Int32Array]",yM="[object Uint8Array]",xM="[object Uint8ClampedArray]",bM="[object Uint16Array]",SM="[object Uint32Array]",wt={};wt[hM]=wt[pM]=wt[mM]=wt[vM]=wt[gM]=wt[yM]=wt[xM]=wt[bM]=wt[SM]=!0;wt[ZI]=wt[JI]=wt[dM]=wt[eM]=wt[fM]=wt[tM]=wt[nM]=wt[rM]=wt[oM]=wt[iM]=wt[aM]=wt[sM]=wt[lM]=wt[cM]=wt[uM]=!1;function CM(e){return ii(e)&&o4(e.length)&&!!wt[oi(e)]}function tp(e){return function(t){return e(t)}}var i4=typeof exports=="object"&&exports&&!exports.nodeType&&exports,La=i4&&typeof module=="object"&&module&&!module.nodeType&&module,wM=La&&La.exports===i4,Nd=wM&&qx.process,kM=function(){try{var e=La&&La.require&&La.require("util").types;return e||Nd&&Nd.binding&&Nd.binding("util")}catch{}}();const Xi=kM;var f0=Xi&&Xi.isTypedArray,jM=f0?tp(f0):CM;const EM=jM;var PM=Object.prototype,IM=PM.hasOwnProperty;function a4(e,t){var n=ys(e),r=!n&&WI(e),o=!n&&!r&&r4(e),s=!n&&!r&&!o&&EM(e),c=n||r||o||s,u=c?NI(e.length,String):[],f=u.length;for(var p in e)(t||IM.call(e,p))&&!(c&&(p=="length"||o&&(p=="offset"||p=="parent")||s&&(p=="buffer"||p=="byteLength"||p=="byteOffset")||XI(p,f)))&&u.push(p);return u}var MM=Object.prototype;function np(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||MM;return e===n}var TM=Kx(Object.keys,Object);const _M=TM;var DM=Object.prototype,AM=DM.hasOwnProperty;function OM(e){if(!np(e))return _M(e);var t=[];for(var n in Object(e))AM.call(e,n)&&n!="constructor"&&t.push(n);return t}function s4(e){return e!=null&&o4(e.length)&&!Zx(e)}function rp(e){return s4(e)?a4(e):OM(e)}function zM(e,t){return e&&Nc(t,rp(t),e)}function RM(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var NM=Object.prototype,FM=NM.hasOwnProperty;function LM(e){if(!gs(e))return RM(e);var t=np(e),n=[];for(var r in e)r=="constructor"&&(t||!FM.call(e,r))||n.push(r);return n}function op(e){return s4(e)?a4(e,!0):LM(e)}function BM(e,t){return e&&Nc(t,op(t),e)}var l4=typeof exports=="object"&&exports&&!exports.nodeType&&exports,h0=l4&&typeof module=="object"&&module&&!module.nodeType&&module,HM=h0&&h0.exports===l4,p0=HM?Pr.Buffer:void 0,m0=p0?p0.allocUnsafe:void 0;function WM(e,t){if(t)return e.slice();var n=e.length,r=m0?m0(n):new e.constructor(n);return e.copy(r),r}function c4(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}function VM(e,t){for(var n=-1,r=e==null?0:e.length,o=0,s=[];++n<r;){var c=e[n];t(c,n,e)&&(s[o++]=c)}return s}function u4(){return[]}var UM=Object.prototype,$M=UM.propertyIsEnumerable,v0=Object.getOwnPropertySymbols,GM=v0?function(e){return e==null?[]:(e=Object(e),VM(v0(e),function(t){return $M.call(e,t)}))}:u4;const ip=GM;function qM(e,t){return Nc(e,ip(e),t)}function d4(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}var YM=Object.getOwnPropertySymbols,KM=YM?function(e){for(var t=[];e;)d4(t,ip(e)),e=ep(e);return t}:u4;const f4=KM;function XM(e,t){return Nc(e,f4(e),t)}function h4(e,t,n){var r=t(e);return ys(e)?r:d4(r,n(e))}function QM(e){return h4(e,rp,ip)}function ZM(e){return h4(e,op,f4)}var JM=si(Pr,"DataView");const Ff=JM;var eT=si(Pr,"Promise");const Lf=eT;var tT=si(Pr,"Set");const Bf=tT;var nT=si(Pr,"WeakMap");const Hf=nT;var g0="[object Map]",rT="[object Object]",y0="[object Promise]",x0="[object Set]",b0="[object WeakMap]",S0="[object DataView]",oT=ai(Ff),iT=ai(Ja),aT=ai(Lf),sT=ai(Bf),lT=ai(Hf),Fo=oi;(Ff&&Fo(new Ff(new ArrayBuffer(1)))!=S0||Ja&&Fo(new Ja)!=g0||Lf&&Fo(Lf.resolve())!=y0||Bf&&Fo(new Bf)!=x0||Hf&&Fo(new Hf)!=b0)&&(Fo=function(e){var t=oi(e),n=t==rT?e.constructor:void 0,r=n?ai(n):"";if(r)switch(r){case oT:return S0;case iT:return g0;case aT:return y0;case sT:return x0;case lT:return b0}return t});const ap=Fo;var cT=Object.prototype,uT=cT.hasOwnProperty;function dT(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&uT.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var fT=Pr.Uint8Array;const C0=fT;function sp(e){var t=new e.constructor(e.byteLength);return new C0(t).set(new C0(e)),t}function hT(e,t){var n=t?sp(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var pT=/\w*$/;function mT(e){var t=new e.constructor(e.source,pT.exec(e));return t.lastIndex=e.lastIndex,t}var w0=vo?vo.prototype:void 0,k0=w0?w0.valueOf:void 0;function vT(e){return k0?Object(k0.call(e)):{}}function gT(e,t){var n=t?sp(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var yT="[object Boolean]",xT="[object Date]",bT="[object Map]",ST="[object Number]",CT="[object RegExp]",wT="[object Set]",kT="[object String]",jT="[object Symbol]",ET="[object ArrayBuffer]",PT="[object DataView]",IT="[object Float32Array]",MT="[object Float64Array]",TT="[object Int8Array]",_T="[object Int16Array]",DT="[object Int32Array]",AT="[object Uint8Array]",OT="[object Uint8ClampedArray]",zT="[object Uint16Array]",RT="[object Uint32Array]";function NT(e,t,n){var r=e.constructor;switch(t){case ET:return sp(e);case yT:case xT:return new r(+e);case PT:return hT(e,n);case IT:case MT:case TT:case _T:case DT:case AT:case OT:case zT:case RT:return gT(e,n);case bT:return new r;case ST:case kT:return new r(e);case CT:return mT(e);case wT:return new r;case jT:return vT(e)}}var j0=Object.create,FT=function(){function e(){}return function(t){if(!gs(t))return{};if(j0)return j0(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const LT=FT;function BT(e){return typeof e.constructor=="function"&&!np(e)?LT(ep(e)):{}}var HT="[object Map]";function WT(e){return ii(e)&&ap(e)==HT}var E0=Xi&&Xi.isMap,VT=E0?tp(E0):WT;const UT=VT;var $T="[object Set]";function GT(e){return ii(e)&&ap(e)==$T}var P0=Xi&&Xi.isSet,qT=P0?tp(P0):GT;const YT=qT;var KT=1,XT=2,QT=4,p4="[object Arguments]",ZT="[object Array]",JT="[object Boolean]",e_="[object Date]",t_="[object Error]",m4="[object Function]",n_="[object GeneratorFunction]",r_="[object Map]",o_="[object Number]",v4="[object Object]",i_="[object RegExp]",a_="[object Set]",s_="[object String]",l_="[object Symbol]",c_="[object WeakMap]",u_="[object ArrayBuffer]",d_="[object DataView]",f_="[object Float32Array]",h_="[object Float64Array]",p_="[object Int8Array]",m_="[object Int16Array]",v_="[object Int32Array]",g_="[object Uint8Array]",y_="[object Uint8ClampedArray]",x_="[object Uint16Array]",b_="[object Uint32Array]",xt={};xt[p4]=xt[ZT]=xt[u_]=xt[d_]=xt[JT]=xt[e_]=xt[f_]=xt[h_]=xt[p_]=xt[m_]=xt[v_]=xt[r_]=xt[o_]=xt[v4]=xt[i_]=xt[a_]=xt[s_]=xt[l_]=xt[g_]=xt[y_]=xt[x_]=xt[b_]=!0;xt[t_]=xt[m4]=xt[c_]=!1;function Ba(e,t,n,r,o,s){var c,u=t&KT,f=t&XT,p=t&QT;if(n&&(c=o?n(e,r,o,s):n(e)),c!==void 0)return c;if(!gs(e))return e;var h=ys(e);if(h){if(c=dT(e),!u)return c4(e,c)}else{var y=ap(e),x=y==m4||y==n_;if(r4(e))return WM(e,u);if(y==v4||y==p4||x&&!o){if(c=f||x?{}:BT(e),!u)return f?XM(e,BM(c,e)):qM(e,zM(c,e))}else{if(!xt[y])return o?e:{};c=NT(e,y,u)}}s||(s=new aa);var S=s.get(e);if(S)return S;s.set(e,c),YT(e)?e.forEach(function(w){c.add(Ba(w,t,n,w,e,s))}):UT(e)&&e.forEach(function(w,j){c.set(j,Ba(w,t,n,j,e,s))});var C=p?f?ZM:QM:f?op:rp,k=h?void 0:C(e);return AI(k||e,function(w,j){k&&(j=w,w=e[j]),e4(c,j,Ba(w,t,n,j,e,s))}),c}var S_=4;function I0(e){return Ba(e,S_)}function g4(e,t){for(var n=-1,r=e==null?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}var C_="[object Symbol]";function lp(e){return typeof e=="symbol"||ii(e)&&oi(e)==C_}var w_="Expected a function";function cp(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(w_);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],s=n.cache;if(s.has(o))return s.get(o);var c=e.apply(this,r);return n.cache=s.set(o,c)||s,c};return n.cache=new(cp.Cache||bo),n}cp.Cache=bo;var k_=500;function j_(e){var t=cp(e,function(r){return n.size===k_&&n.clear(),r}),n=t.cache;return t}var E_=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,P_=/\\(\\)?/g,I_=j_(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(E_,function(n,r,o,s){t.push(o?s.replace(P_,"$1"):r||n)}),t});const M_=I_;var T_=1/0;function __(e){if(typeof e=="string"||lp(e))return e;var t=e+"";return t=="0"&&1/e==-T_?"-0":t}var D_=1/0,M0=vo?vo.prototype:void 0,T0=M0?M0.toString:void 0;function y4(e){if(typeof e=="string")return e;if(ys(e))return g4(e,y4)+"";if(lp(e))return T0?T0.call(e):"";var t=e+"";return t=="0"&&1/e==-D_?"-0":t}function A_(e){return e==null?"":y4(e)}function x4(e){return ys(e)?g4(e,__):lp(e)?[e]:c4(M_(A_(e)))}var O_=!0;function z_(e,t){if(!O_){if(e)return;var n="Warning: "+t;typeof console<"u"&&console.warn(n);try{throw Error(n)}catch{}}}var R_=1,N_=4;function F_(e){return Ba(e,R_|N_)}function ht(){return ht=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},ht.apply(this,arguments)}function L_(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function Ho(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}function _0(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var D0=function(t){return Array.isArray(t)&&t.length===0},kn=function(t){return typeof t=="function"},Fc=function(t){return t!==null&&typeof t=="object"},B_=function(t){return String(Math.floor(Number(t)))===t},Fd=function(t){return Object.prototype.toString.call(t)==="[object String]"},b4=function(t){return g.Children.count(t)===0},Ld=function(t){return Fc(t)&&kn(t.then)};function en(e,t,n,r){r===void 0&&(r=0);for(var o=x4(t);e&&r<o.length;)e=e[o[r++]];return e===void 0?n:e}function Cr(e,t,n){for(var r=I0(e),o=r,s=0,c=x4(t);s<c.length-1;s++){var u=c[s],f=en(e,c.slice(0,s+1));if(f&&(Fc(f)||Array.isArray(f)))o=o[u]=I0(f);else{var p=c[s+1];o=o[u]=B_(p)&&Number(p)>=0?[]:{}}}return(s===0?e:o)[c[s]]===n?e:(n===void 0?delete o[c[s]]:o[c[s]]=n,s===0&&n===void 0&&delete r[c[s]],r)}function S4(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 c=s[o],u=e[c];Fc(u)?n.get(u)||(n.set(u,!0),r[c]=Array.isArray(u)?[]:{},S4(u,t,n,r[c])):r[c]=t}return r}var Lc=g.createContext(void 0);Lc.displayName="FormikContext";var H_=Lc.Provider;Lc.Consumer;function C4(){var e=g.useContext(Lc);return e||z_(!1),e}function W_(e,t){switch(t.type){case"SET_VALUES":return ht({},e,{values:t.payload});case"SET_TOUCHED":return ht({},e,{touched:t.payload});case"SET_ERRORS":return io(e.errors,t.payload)?e:ht({},e,{errors:t.payload});case"SET_STATUS":return ht({},e,{status:t.payload});case"SET_ISSUBMITTING":return ht({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return ht({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return ht({},e,{values:Cr(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return ht({},e,{touched:Cr(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return ht({},e,{errors:Cr(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":return ht({},e,t.payload);case"SET_FORMIK_STATE":return t.payload(e);case"SUBMIT_ATTEMPT":return ht({},e,{touched:S4(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":return ht({},e,{isSubmitting:!1});case"SUBMIT_SUCCESS":return ht({},e,{isSubmitting:!1});default:return e}}var zo={},Dl={};function V_(e){var t=e.validateOnChange,n=t===void 0?!0:t,r=e.validateOnBlur,o=r===void 0?!0:r,s=e.validateOnMount,c=s===void 0?!1:s,u=e.isInitialValid,f=e.enableReinitialize,p=f===void 0?!1:f,h=e.onSubmit,y=Ho(e,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),x=ht({validateOnChange:n,validateOnBlur:o,validateOnMount:c,onSubmit:h},y),S=g.useRef(x.initialValues),C=g.useRef(x.initialErrors||zo),k=g.useRef(x.initialTouched||Dl),w=g.useRef(x.initialStatus),j=g.useRef(!1),I=g.useRef({});g.useEffect(function(){return j.current=!0,function(){j.current=!1}},[]);var P=g.useReducer(W_,{values:x.initialValues,errors:x.initialErrors||zo,touched:x.initialTouched||Dl,status:x.initialStatus,isSubmitting:!1,isValidating:!1,submitCount:0}),M=P[0],T=P[1],D=g.useCallback(function(N,ue){return new Promise(function(xe,ke){var q=x.validate(N,ue);q==null?xe(zo):Ld(q)?q.then(function(ae){xe(ae||zo)},function(ae){ke(ae)}):xe(q)})},[x.validate]),_=g.useCallback(function(N,ue){var xe=x.validationSchema,ke=kn(xe)?xe(ue):xe,q=ue&&ke.validateAt?ke.validateAt(ue,N):$_(N,ke);return new Promise(function(ae,Oe){q.then(function(){ae(zo)},function(Ze){Ze.name==="ValidationError"?ae(U_(Ze)):Oe(Ze)})})},[x.validationSchema]),R=g.useCallback(function(N,ue){return new Promise(function(xe){return xe(I.current[N].validate(ue))})},[]),V=g.useCallback(function(N){var ue=Object.keys(I.current).filter(function(ke){return kn(I.current[ke].validate)}),xe=ue.length>0?ue.map(function(ke){return R(ke,en(N,ke))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(xe).then(function(ke){return ke.reduce(function(q,ae,Oe){return ae==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||ae&&(q=Cr(q,ue[Oe],ae)),q},{})})},[R]),F=g.useCallback(function(N){return Promise.all([V(N),x.validationSchema?_(N):{},x.validate?D(N):{}]).then(function(ue){var xe=ue[0],ke=ue[1],q=ue[2],ae=Nf.all([xe,ke,q],{arrayMerge:G_});return ae})},[x.validate,x.validationSchema,V,D,_]),L=Bn(function(N){return N===void 0&&(N=M.values),T({type:"SET_ISVALIDATING",payload:!0}),F(N).then(function(ue){return j.current&&(T({type:"SET_ISVALIDATING",payload:!1}),T({type:"SET_ERRORS",payload:ue})),ue})});g.useEffect(function(){c&&j.current===!0&&io(S.current,x.initialValues)&&L(S.current)},[c,L]);var Q=g.useCallback(function(N){var ue=N&&N.values?N.values:S.current,xe=N&&N.errors?N.errors:C.current?C.current:x.initialErrors||{},ke=N&&N.touched?N.touched:k.current?k.current:x.initialTouched||{},q=N&&N.status?N.status:w.current?w.current:x.initialStatus;S.current=ue,C.current=xe,k.current=ke,w.current=q;var ae=function(){T({type:"RESET_FORM",payload:{isSubmitting:!!N&&!!N.isSubmitting,errors:xe,touched:ke,status:q,values:ue,isValidating:!!N&&!!N.isValidating,submitCount:N&&N.submitCount&&typeof N.submitCount=="number"?N.submitCount:0}})};if(x.onReset){var Oe=x.onReset(M.values,ge);Ld(Oe)?Oe.then(ae):ae()}else ae()},[x.initialErrors,x.initialStatus,x.initialTouched]);g.useEffect(function(){j.current===!0&&!io(S.current,x.initialValues)&&(p&&(S.current=x.initialValues,Q()),c&&L(S.current))},[p,x.initialValues,Q,c,L]),g.useEffect(function(){p&&j.current===!0&&!io(C.current,x.initialErrors)&&(C.current=x.initialErrors||zo,T({type:"SET_ERRORS",payload:x.initialErrors||zo}))},[p,x.initialErrors]),g.useEffect(function(){p&&j.current===!0&&!io(k.current,x.initialTouched)&&(k.current=x.initialTouched||Dl,T({type:"SET_TOUCHED",payload:x.initialTouched||Dl}))},[p,x.initialTouched]),g.useEffect(function(){p&&j.current===!0&&!io(w.current,x.initialStatus)&&(w.current=x.initialStatus,T({type:"SET_STATUS",payload:x.initialStatus}))},[p,x.initialStatus,x.initialTouched]);var U=Bn(function(N){if(I.current[N]&&kn(I.current[N].validate)){var ue=en(M.values,N),xe=I.current[N].validate(ue);return Ld(xe)?(T({type:"SET_ISVALIDATING",payload:!0}),xe.then(function(ke){return ke}).then(function(ke){T({type:"SET_FIELD_ERROR",payload:{field:N,value:ke}}),T({type:"SET_ISVALIDATING",payload:!1})})):(T({type:"SET_FIELD_ERROR",payload:{field:N,value:xe}}),Promise.resolve(xe))}else if(x.validationSchema)return T({type:"SET_ISVALIDATING",payload:!0}),_(M.values,N).then(function(ke){return ke}).then(function(ke){T({type:"SET_FIELD_ERROR",payload:{field:N,value:ke[N]}}),T({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),K=g.useCallback(function(N,ue){var xe=ue.validate;I.current[N]={validate:xe}},[]),te=g.useCallback(function(N){delete I.current[N]},[]),ne=Bn(function(N,ue){T({type:"SET_TOUCHED",payload:N});var xe=ue===void 0?o:ue;return xe?L(M.values):Promise.resolve()}),$=g.useCallback(function(N){T({type:"SET_ERRORS",payload:N})},[]),Z=Bn(function(N,ue){var xe=kn(N)?N(M.values):N;T({type:"SET_VALUES",payload:xe});var ke=ue===void 0?n:ue;return ke?L(xe):Promise.resolve()}),oe=g.useCallback(function(N,ue){T({type:"SET_FIELD_ERROR",payload:{field:N,value:ue}})},[]),le=Bn(function(N,ue,xe){T({type:"SET_FIELD_VALUE",payload:{field:N,value:ue}});var ke=xe===void 0?n:xe;return ke?L(Cr(M.values,N,ue)):Promise.resolve()}),Re=g.useCallback(function(N,ue){var xe=ue,ke=N,q;if(!Fd(N)){N.persist&&N.persist();var ae=N.target?N.target:N.currentTarget,Oe=ae.type,Ze=ae.name,J=ae.id,Le=ae.value,nt=ae.checked,Nt=ae.outerHTML,he=ae.options,_e=ae.multiple;xe=ue||Ze||J,ke=/number|range/.test(Oe)?(q=parseFloat(Le),isNaN(q)?"":q):/checkbox/.test(Oe)?Y_(en(M.values,xe),nt,Le):he&&_e?q_(he):Le}xe&&le(xe,ke)},[le,M.values]),Ne=Bn(function(N){if(Fd(N))return function(ue){return Re(ue,N)};Re(N)}),Ie=Bn(function(N,ue,xe){ue===void 0&&(ue=!0),T({type:"SET_FIELD_TOUCHED",payload:{field:N,value:ue}});var ke=xe===void 0?o:xe;return ke?L(M.values):Promise.resolve()}),pe=g.useCallback(function(N,ue){N.persist&&N.persist();var xe=N.target,ke=xe.name,q=xe.id,ae=xe.outerHTML,Oe=ue||ke||q;Ie(Oe,!0)},[Ie]),ce=Bn(function(N){if(Fd(N))return function(ue){return pe(ue,N)};pe(N)}),Fe=g.useCallback(function(N){kn(N)?T({type:"SET_FORMIK_STATE",payload:N}):T({type:"SET_FORMIK_STATE",payload:function(){return N}})},[]),Ve=g.useCallback(function(N){T({type:"SET_STATUS",payload:N})},[]),Ue=g.useCallback(function(N){T({type:"SET_ISSUBMITTING",payload:N})},[]),$e=Bn(function(){return T({type:"SUBMIT_ATTEMPT"}),L().then(function(N){var ue=N instanceof Error,xe=!ue&&Object.keys(N).length===0;if(xe){var ke;try{if(ke=Te(),ke===void 0)return}catch(q){throw q}return Promise.resolve(ke).then(function(q){return j.current&&T({type:"SUBMIT_SUCCESS"}),q}).catch(function(q){if(j.current)throw T({type:"SUBMIT_FAILURE"}),q})}else if(j.current&&(T({type:"SUBMIT_FAILURE"}),ue))throw N})}),Qe=Bn(function(N){N&&N.preventDefault&&kn(N.preventDefault)&&N.preventDefault(),N&&N.stopPropagation&&kn(N.stopPropagation)&&N.stopPropagation(),$e().catch(function(ue){console.warn("Warning: An unhandled error was caught from submitForm()",ue)})}),ge={resetForm:Q,validateForm:L,validateField:U,setErrors:$,setFieldError:oe,setFieldTouched:Ie,setFieldValue:le,setStatus:Ve,setSubmitting:Ue,setTouched:ne,setValues:Z,setFormikState:Fe,submitForm:$e},Te=Bn(function(){return h(M.values,ge)}),Ge=Bn(function(N){N&&N.preventDefault&&kn(N.preventDefault)&&N.preventDefault(),N&&N.stopPropagation&&kn(N.stopPropagation)&&N.stopPropagation(),Q()}),ye=g.useCallback(function(N){return{value:en(M.values,N),error:en(M.errors,N),touched:!!en(M.touched,N),initialValue:en(S.current,N),initialTouched:!!en(k.current,N),initialError:en(C.current,N)}},[M.errors,M.touched,M.values]),Pe=g.useCallback(function(N){return{setValue:function(xe,ke){return le(N,xe,ke)},setTouched:function(xe,ke){return Ie(N,xe,ke)},setError:function(xe){return oe(N,xe)}}},[le,Ie,oe]),et=g.useCallback(function(N){var ue=Fc(N),xe=ue?N.name:N,ke=en(M.values,xe),q={name:xe,value:ke,onChange:Ne,onBlur:ce};if(ue){var ae=N.type,Oe=N.value,Ze=N.as,J=N.multiple;ae==="checkbox"?Oe===void 0?q.checked=!!ke:(q.checked=!!(Array.isArray(ke)&&~ke.indexOf(Oe)),q.value=Oe):ae==="radio"?(q.checked=ke===Oe,q.value=Oe):Ze==="select"&&J&&(q.value=q.value||[],q.multiple=!0)}return q},[ce,Ne,M.values]),Be=g.useMemo(function(){return!io(S.current,M.values)},[S.current,M.values]),vt=g.useMemo(function(){return typeof u<"u"?Be?M.errors&&Object.keys(M.errors).length===0:u!==!1&&kn(u)?u(x):u:M.errors&&Object.keys(M.errors).length===0},[u,Be,M.errors,x]),Rt=ht({},M,{initialValues:S.current,initialErrors:C.current,initialTouched:k.current,initialStatus:w.current,handleBlur:ce,handleChange:Ne,handleReset:Ge,handleSubmit:Qe,resetForm:Q,setErrors:$,setFormikState:Fe,setFieldTouched:Ie,setFieldValue:le,setFieldError:oe,setStatus:Ve,setSubmitting:Ue,setTouched:ne,setValues:Z,submitForm:$e,validateForm:L,validateField:U,isValid:vt,dirty:Be,unregisterField:te,registerField:K,getFieldProps:et,getFieldMeta:ye,getFieldHelpers:Pe,validateOnBlur:o,validateOnChange:n,validateOnMount:c});return Rt}function xs(e){var t=V_(e),n=e.component,r=e.children,o=e.render,s=e.innerRef;return g.useImperativeHandle(s,function(){return t}),g.createElement(H_,{value:t},n?g.createElement(n,t):o?o(t):r?kn(r)?r(t):b4(r)?null:g.Children.only(r):null)}function U_(e){var t={};if(e.inner){if(e.inner.length===0)return Cr(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 c=s;en(t,c.path)||(t=Cr(t,c.path,c.message))}}return t}function $_(e,t,n,r){n===void 0&&(n=!1),r===void 0&&(r={});var o=Wf(e);return t[n?"validateSync":"validate"](o,{abortEarly:!1,context:r})}function Wf(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||a0(o)?Wf(o):o!==""?o:void 0}):a0(e[r])?t[r]=Wf(e[r]):t[r]=e[r]!==""?e[r]:void 0}return t}function G_(e,t,n){var r=e.slice();return t.forEach(function(s,c){if(typeof r[c]>"u"){var u=n.clone!==!1,f=u&&n.isMergeableObject(s);r[c]=f?Nf(Array.isArray(s)?[]:{},s,n):s}else n.isMergeableObject(s)?r[c]=Nf(e[c],s,n):e.indexOf(s)===-1&&r.push(s)}),r}function q_(e){return Array.from(e).filter(function(t){return t.selected}).map(function(t){return t.value})}function Y_(e,t,n){if(typeof e=="boolean")return Boolean(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 Boolean(t);return t&&n&&!o?r.concat(n):o?r.slice(0,s).concat(r.slice(s+1)):r}var K_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?g.useLayoutEffect:g.useEffect;function Bn(e){var t=g.useRef(e);return K_(function(){t.current=e}),g.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 kt(e){var t=e.validate,n=e.name,r=e.render,o=e.children,s=e.as,c=e.component,u=Ho(e,["validate","name","render","children","as","component"]),f=C4(),p=Ho(f,["validate","validationSchema"]),h=p.registerField,y=p.unregisterField;g.useEffect(function(){return h(n,{validate:t}),function(){y(n)}},[h,y,n,t]);var x=p.getFieldProps(ht({name:n},u)),S=p.getFieldMeta(n),C={field:x,form:p};if(r)return r(ht({},C,{meta:S}));if(kn(o))return o(ht({},C,{meta:S}));if(c){if(typeof c=="string"){var k=u.innerRef,w=Ho(u,["innerRef"]);return g.createElement(c,ht({ref:k},x,w),o)}return g.createElement(c,ht({field:x,form:p},u),o)}var j=s||"input";if(typeof j=="string"){var I=u.innerRef,P=Ho(u,["innerRef"]);return g.createElement(j,ht({ref:I},x,P),o)}return g.createElement(j,ht({},x,u),o)}var X_=g.forwardRef(function(e,t){var n=e.action,r=Ho(e,["action"]),o=n??"#",s=C4(),c=s.handleReset,u=s.handleSubmit;return g.createElement("form",Object.assign({onSubmit:u,ref:t,onReset:c,action:o},r))});X_.displayName="Form";var Q_=function(t,n,r){var o=Qi(t),s=o[n];return o.splice(n,1),o.splice(r,0,s),o},Z_=function(t,n,r){var o=Qi(t),s=o[n];return o[n]=o[r],o[r]=s,o},Bd=function(t,n,r){var o=Qi(t);return o.splice(n,0,r),o},J_=function(t,n,r){var o=Qi(t);return o[n]=r,o},Qi=function(t){if(t){if(Array.isArray(t))return[].concat(t);var n=Object.keys(t).map(function(r){return parseInt(r)}).reduce(function(r,o){return o>r?o:r},0);return Array.from(ht({},t,{length:n+1}))}else return[]},eD=function(e){L_(t,e);function t(r){var o;return o=e.call(this,r)||this,o.updateArrayField=function(s,c,u){var f=o.props,p=f.name,h=f.formik.setFormikState;h(function(y){var x=typeof u=="function"?u:s,S=typeof c=="function"?c:s,C=Cr(y.values,p,s(en(y.values,p))),k=u?x(en(y.errors,p)):void 0,w=c?S(en(y.touched,p)):void 0;return D0(k)&&(k=void 0),D0(w)&&(w=void 0),ht({},y,{values:C,errors:u?Cr(y.errors,p,k):y.errors,touched:c?Cr(y.touched,p,w):y.touched})})},o.push=function(s){return o.updateArrayField(function(c){return[].concat(Qi(c),[F_(s)])},!1,!1)},o.handlePush=function(s){return function(){return o.push(s)}},o.swap=function(s,c){return o.updateArrayField(function(u){return Z_(u,s,c)},!0,!0)},o.handleSwap=function(s,c){return function(){return o.swap(s,c)}},o.move=function(s,c){return o.updateArrayField(function(u){return Q_(u,s,c)},!0,!0)},o.handleMove=function(s,c){return function(){return o.move(s,c)}},o.insert=function(s,c){return o.updateArrayField(function(u){return Bd(u,s,c)},function(u){return Bd(u,s,null)},function(u){return Bd(u,s,null)})},o.handleInsert=function(s,c){return function(){return o.insert(s,c)}},o.replace=function(s,c){return o.updateArrayField(function(u){return J_(u,s,c)},!1,!1)},o.handleReplace=function(s,c){return function(){return o.replace(s,c)}},o.unshift=function(s){var c=-1;return o.updateArrayField(function(u){var f=u?[s].concat(u):[s];return c<0&&(c=f.length),f},function(u){var f=u?[null].concat(u):[null];return c<0&&(c=f.length),f},function(u){var f=u?[null].concat(u):[null];return c<0&&(c=f.length),f}),c},o.handleUnshift=function(s){return function(){return o.unshift(s)}},o.handleRemove=function(s){return function(){return o.remove(s)}},o.handlePop=function(){return function(){return o.pop()}},o.remove=o.remove.bind(_0(o)),o.pop=o.pop.bind(_0(o)),o}var n=t.prototype;return n.componentDidUpdate=function(o){this.props.validateOnChange&&this.props.formik.validateOnChange&&!io(en(o.formik.values,o.name),en(this.props.formik.values,this.props.name))&&this.props.formik.validateForm(this.props.formik.values)},n.remove=function(o){var s;return this.updateArrayField(function(c){var u=c?Qi(c):[];return s||(s=u[o]),kn(u.splice)&&u.splice(o,1),u},!0,!0),s},n.pop=function(){var o;return this.updateArrayField(function(s){var c=s;return o||(o=c&&c.pop&&c.pop()),c},!0,!0),o},n.render=function(){var o={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},s=this.props,c=s.component,u=s.render,f=s.children,p=s.name,h=s.formik,y=Ho(h,["validate","validationSchema"]),x=ht({},o,{form:y,name:p});return c?g.createElement(c,x):u?u(x):f?typeof f=="function"?f(x):b4(f)?null:g.Children.only(f):null},t}(g.Component);eD.defaultProps={validateOnChange:!0};const tD=fe((e,t)=>{const{acceptButtonText:n="Accept",acceptCallback:r,cancelButtonText:o="Cancel",cancelCallback:s,children:c,title:u,triggerComponent:f}=e,{isOpen:p,onOpen:h,onClose:y}=ho(),x=g.useRef(null),S=()=>{r(),y()},C=()=>{s&&s(),y()};return l.jsxs(l.Fragment,{children:[g.cloneElement(f,{onClick:h,ref:t}),l.jsx(Gy,{isOpen:p,leastDestructiveRef:x,onClose:y,children:l.jsx(Br,{children:l.jsxs(qy,{children:[l.jsx(Lr,{fontSize:"lg",fontWeight:"bold",children:u}),l.jsx(Hr,{children:c}),l.jsxs(Fr,{children:[l.jsx(Je,{ref:x,onClick:C,children:o}),l.jsx(Je,{colorScheme:"error",onClick:S,ml:3,children:n})]})]})})})]})}),Bc=g.memo(tD);function nD(e){const{model:t}=e,r=A(C=>C.system.model_list)[t],o=Y(),{t:s}=X(),c=A(C=>C.system.isProcessing),u=A(C=>C.system.isConnected),[f,p]=g.useState("same"),[h,y]=g.useState("");g.useEffect(()=>{p("same")},[t]);const x=()=>{p("same")},S=()=>{o(WS({model_name:t,save_location:f,custom_location:f==="custom"&&h!==""?h:null}))};return l.jsxs(Bc,{title:`${s("modelManager.convert")} ${t}`,acceptCallback:S,cancelCallback:x,acceptButtonText:`${s("modelManager.convert")}`,triggerComponent:l.jsxs(Je,{size:"sm","aria-label":s("modelManager.convertToDiffusers"),isDisabled:r.status==="active"||c||!u,className:" modal-close-btn",marginInlineEnd:8,children:["🧨 ",s("modelManager.convertToDiffusers")]}),motionPreset:"slideInBottom",children:[l.jsxs(B,{flexDirection:"column",rowGap:4,children:[l.jsx(Ce,{children:s("modelManager.convertToDiffusersHelpText1")}),l.jsxs(py,{children:[l.jsx(za,{children:s("modelManager.convertToDiffusersHelpText2")}),l.jsx(za,{children:s("modelManager.convertToDiffusersHelpText3")}),l.jsx(za,{children:s("modelManager.convertToDiffusersHelpText4")}),l.jsx(za,{children:s("modelManager.convertToDiffusersHelpText5")})]}),l.jsx(Ce,{children:s("modelManager.convertToDiffusersHelpText6")})]}),l.jsxs(B,{flexDir:"column",gap:4,children:[l.jsxs(B,{marginTop:4,flexDir:"column",gap:2,children:[l.jsx(Ce,{fontWeight:"600",children:s("modelManager.convertToDiffusersSaveLocation")}),l.jsx(Xa,{value:f,onChange:C=>p(C),children:l.jsxs(B,{gap:4,children:[l.jsx(vn,{value:"same",children:l.jsx(Gt,{label:"Save converted model in the same folder",children:s("modelManager.sameFolder")})}),l.jsx(vn,{value:"root",children:l.jsx(Gt,{label:"Save converted model in the InvokeAI root folder",children:s("modelManager.invokeRoot")})}),l.jsx(vn,{value:"custom",children:l.jsx(Gt,{label:"Save converted model in a custom folder",children:s("modelManager.custom")})})]})})]}),f==="custom"&&l.jsxs(B,{flexDirection:"column",rowGap:2,children:[l.jsx(Ce,{fontWeight:"500",fontSize:"sm",variant:"subtext",children:s("modelManager.customSaveLocation")}),l.jsx(mt,{value:h,onChange:C=>{C.target.value!==""&&y(C.target.value)},width:"full"})]})]})]})}function er(e){const{children:t,...n}=e;return l.jsx(pn,{margin:0,color:"base.400",...n,children:t})}function tr(e){const{children:t,...n}=e;return l.jsx(mn,{color:"error.400",...n,children:t})}const rD=me([Et],e=>{const{openModel:t,model_list:n}=e;return{model_list:n,openModel:t}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),A0=64,O0=2048;function oD(){const{openModel:e,model_list:t}=A(rD),n=A(f=>f.system.isProcessing),r=Y(),{t:o}=X(),[s,c]=g.useState({name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,default:!1,format:"ckpt"});g.useEffect(()=>{var f,p,h,y,x,S,C;if(e){const k=ee.pickBy(t,(w,j)=>ee.isEqual(j,e));c({name:e,description:(f=k[e])==null?void 0:f.description,config:(p=k[e])==null?void 0:p.config,weights:(h=k[e])==null?void 0:h.weights,vae:(y=k[e])==null?void 0:y.vae,width:(x=k[e])==null?void 0:x.width,height:(S=k[e])==null?void 0:S.height,default:(C=k[e])==null?void 0:C.default,format:"ckpt"})}},[t,e]);const u=f=>{r(rs({...f,width:Number(f.width),height:Number(f.height)}))};return e?l.jsxs(B,{flexDirection:"column",rowGap:4,width:"100%",children:[l.jsxs(B,{alignItems:"center",gap:4,justifyContent:"space-between",children:[l.jsx(Ce,{fontSize:"lg",fontWeight:"bold",children:e}),l.jsx(nD,{model:e})]}),l.jsx(B,{flexDirection:"column",maxHeight:window.innerHeight-270,overflowY:"scroll",paddingInlineEnd:8,children:l.jsx(xs,{enableReinitialize:!0,initialValues:s,onSubmit:u,children:({handleSubmit:f,errors:p,touched:h})=>l.jsx("form",{onSubmit:f,children:l.jsxs(ze,{rowGap:2,alignItems:"start",children:[l.jsxs(rt,{isInvalid:!!p.description&&h.description,isRequired:!0,children:[l.jsx(st,{htmlFor:"description",fontSize:"sm",children:o("modelManager.description")}),l.jsxs(ze,{alignItems:"start",children:[l.jsx(kt,{as:mt,id:"description",name:"description",type:"text",width:"full"}),p.description&&h.description?l.jsx(tr,{children:p.description}):l.jsx(er,{children:o("modelManager.descriptionValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!p.config&&h.config,isRequired:!0,children:[l.jsx(st,{htmlFor:"config",fontSize:"sm",children:o("modelManager.config")}),l.jsxs(ze,{alignItems:"start",children:[l.jsx(kt,{as:mt,id:"config",name:"config",type:"text",width:"full"}),p.config&&h.config?l.jsx(tr,{children:p.config}):l.jsx(er,{children:o("modelManager.configValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!p.weights&&h.weights,isRequired:!0,children:[l.jsx(st,{htmlFor:"config",fontSize:"sm",children:o("modelManager.modelLocation")}),l.jsxs(ze,{alignItems:"start",children:[l.jsx(kt,{as:mt,id:"weights",name:"weights",type:"text",width:"full"}),p.weights&&h.weights?l.jsx(tr,{children:p.weights}):l.jsx(er,{children:o("modelManager.modelLocationValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!p.vae&&h.vae,children:[l.jsx(st,{htmlFor:"vae",fontSize:"sm",children:o("modelManager.vaeLocation")}),l.jsxs(ze,{alignItems:"start",children:[l.jsx(kt,{as:mt,id:"vae",name:"vae",type:"text",width:"full"}),p.vae&&h.vae?l.jsx(tr,{children:p.vae}):l.jsx(er,{children:o("modelManager.vaeLocationValidationMsg")})]})]}),l.jsxs(ra,{width:"100%",children:[l.jsxs(rt,{isInvalid:!!p.width&&h.width,children:[l.jsx(st,{htmlFor:"width",fontSize:"sm",children:o("modelManager.width")}),l.jsxs(ze,{alignItems:"start",children:[l.jsx(kt,{id:"width",name:"width",children:({field:y,form:x})=>l.jsx(Wr,{id:"width",name:"width",min:A0,max:O0,step:64,value:x.values.width,onChange:S=>x.setFieldValue(y.name,Number(S))})}),p.width&&h.width?l.jsx(tr,{children:p.width}):l.jsx(er,{children:o("modelManager.widthValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!p.height&&h.height,children:[l.jsx(st,{htmlFor:"height",fontSize:"sm",children:o("modelManager.height")}),l.jsxs(ze,{alignItems:"start",children:[l.jsx(kt,{id:"height",name:"height",children:({field:y,form:x})=>l.jsx(Wr,{id:"height",name:"height",min:A0,max:O0,step:64,value:x.values.height,onChange:S=>x.setFieldValue(y.name,Number(S))})}),p.height&&h.height?l.jsx(tr,{children:p.height}):l.jsx(er,{children:o("modelManager.heightValidationMsg")})]})]})]}),l.jsx(Je,{type:"submit",className:"modal-close-btn",isLoading:n,children:o("modelManager.updateModel")})]})})})})]}):l.jsx(B,{sx:{width:"100%",justifyContent:"center",alignItems:"center",borderRadius:"base",bg:"base.900"},children:l.jsx(Ce,{fontWeight:500,children:"Pick A Model To Edit"})})}const iD=me([Et],e=>{const{openModel:t,model_list:n}=e;return{model_list:n,openModel:t}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}});function aD(){const{openModel:e,model_list:t}=A(iD),n=A(f=>f.system.isProcessing),r=Y(),{t:o}=X(),[s,c]=g.useState({name:"",description:"",repo_id:"",path:"",vae:{repo_id:"",path:""},default:!1,format:"diffusers"});g.useEffect(()=>{var f,p,h,y,x,S,C,k,w,j,I,P,M,T,D,_;if(e){const R=ee.pickBy(t,(V,F)=>ee.isEqual(F,e));c({name:e,description:(f=R[e])==null?void 0:f.description,path:(p=R[e])!=null&&p.path&&((h=R[e])==null?void 0:h.path)!=="None"?(y=R[e])==null?void 0:y.path:"",repo_id:(x=R[e])!=null&&x.repo_id&&((S=R[e])==null?void 0:S.repo_id)!=="None"?(C=R[e])==null?void 0:C.repo_id:"",vae:{repo_id:(w=(k=R[e])==null?void 0:k.vae)!=null&&w.repo_id?(I=(j=R[e])==null?void 0:j.vae)==null?void 0:I.repo_id:"",path:(M=(P=R[e])==null?void 0:P.vae)!=null&&M.path?(D=(T=R[e])==null?void 0:T.vae)==null?void 0:D.path:""},default:(_=R[e])==null?void 0:_.default,format:"diffusers"})}},[t,e]);const u=f=>{const p=f;f.path===""&&delete p.path,f.repo_id===""&&delete p.repo_id,f.vae.path===""&&delete p.vae.path,f.vae.repo_id===""&&delete p.vae.repo_id,r(rs(f))};return e?l.jsxs(B,{flexDirection:"column",rowGap:4,width:"100%",children:[l.jsx(B,{alignItems:"center",children:l.jsx(Ce,{fontSize:"lg",fontWeight:"bold",children:e})}),l.jsx(B,{flexDirection:"column",overflowY:"scroll",paddingInlineEnd:8,children:l.jsx(xs,{enableReinitialize:!0,initialValues:s,onSubmit:u,children:({handleSubmit:f,errors:p,touched:h})=>{var y,x,S,C,k,w,j,I,P,M;return l.jsx("form",{onSubmit:f,children:l.jsxs(ze,{rowGap:2,alignItems:"start",children:[l.jsxs(rt,{isInvalid:!!p.description&&h.description,isRequired:!0,children:[l.jsx(st,{htmlFor:"description",fontSize:"sm",children:o("modelManager.description")}),l.jsxs(ze,{alignItems:"start",children:[l.jsx(kt,{as:mt,id:"description",name:"description",type:"text",width:"full"}),p.description&&h.description?l.jsx(tr,{children:p.description}):l.jsx(er,{children:o("modelManager.descriptionValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!p.path&&h.path,isRequired:!0,children:[l.jsx(st,{htmlFor:"path",fontSize:"sm",children:o("modelManager.modelLocation")}),l.jsxs(ze,{alignItems:"start",children:[l.jsx(kt,{as:mt,id:"path",name:"path",type:"text",width:"full"}),p.path&&h.path?l.jsx(tr,{children:p.path}):l.jsx(er,{children:o("modelManager.modelLocationValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!p.repo_id&&h.repo_id,children:[l.jsx(st,{htmlFor:"repo_id",fontSize:"sm",children:o("modelManager.repo_id")}),l.jsxs(ze,{alignItems:"start",children:[l.jsx(kt,{as:mt,id:"repo_id",name:"repo_id",type:"text",width:"full"}),p.repo_id&&h.repo_id?l.jsx(tr,{children:p.repo_id}):l.jsx(er,{children:o("modelManager.repoIDValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!((y=p.vae)!=null&&y.path)&&((x=h.vae)==null?void 0:x.path),children:[l.jsx(st,{htmlFor:"vae.path",fontSize:"sm",children:o("modelManager.vaeLocation")}),l.jsxs(ze,{alignItems:"start",children:[l.jsx(kt,{as:mt,id:"vae.path",name:"vae.path",type:"text",width:"full"}),(S=p.vae)!=null&&S.path&&((C=h.vae)!=null&&C.path)?l.jsx(tr,{children:(k=p.vae)==null?void 0:k.path}):l.jsx(er,{children:o("modelManager.vaeLocationValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!((w=p.vae)!=null&&w.repo_id)&&((j=h.vae)==null?void 0:j.repo_id),children:[l.jsx(st,{htmlFor:"vae.repo_id",fontSize:"sm",children:o("modelManager.vaeRepoID")}),l.jsxs(ze,{alignItems:"start",children:[l.jsx(kt,{as:mt,id:"vae.repo_id",name:"vae.repo_id",type:"text",width:"full"}),(I=p.vae)!=null&&I.repo_id&&((P=h.vae)!=null&&P.repo_id)?l.jsx(tr,{children:(M=p.vae)==null?void 0:M.repo_id}):l.jsx(er,{children:o("modelManager.vaeRepoIDValidationMsg")})]})]}),l.jsx(Je,{type:"submit",className:"modal-close-btn",isLoading:n,children:o("modelManager.updateModel")})]})})}})})]}):l.jsx(B,{sx:{width:"100%",justifyContent:"center",alignItems:"center",borderRadius:"base",bg:"base.900"},children:l.jsx(Ce,{fontWeight:"500",children:"Pick A Model To Edit"})})}const sD=e=>{const{label:t,...n}=e;return l.jsx(k2,{colorScheme:"accent",...n,children:t})},pt=g.memo(sD);function w4(e){return ve({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M21 11H6.414l5.293-5.293-1.414-1.414L2.586 12l7.707 7.707 1.414-1.414L6.414 13H21z"}}]})(e)}function lD(e){return ve({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19.002 3h-14c-1.103 0-2 .897-2 2v4h2V5h14v14h-14v-4h-2v4c0 1.103.897 2 2 2h14c1.103 0 2-.897 2-2V5c0-1.103-.898-2-2-2z"}},{tag:"path",attr:{d:"m11 16 5-4-5-4v3.001H3v2h8z"}}]})(e)}function up(e){return ve({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 16c1.671 0 3-1.331 3-3s-1.329-3-3-3-3 1.331-3 3 1.329 3 3 3z"}},{tag:"path",attr:{d:"M20.817 11.186a8.94 8.94 0 0 0-1.355-3.219 9.053 9.053 0 0 0-2.43-2.43 8.95 8.95 0 0 0-3.219-1.355 9.028 9.028 0 0 0-1.838-.18V2L8 5l3.975 3V6.002c.484-.002.968.044 1.435.14a6.961 6.961 0 0 1 2.502 1.053 7.005 7.005 0 0 1 1.892 1.892A6.967 6.967 0 0 1 19 13a7.032 7.032 0 0 1-.55 2.725 7.11 7.11 0 0 1-.644 1.188 7.2 7.2 0 0 1-.858 1.039 7.028 7.028 0 0 1-3.536 1.907 7.13 7.13 0 0 1-2.822 0 6.961 6.961 0 0 1-2.503-1.054 7.002 7.002 0 0 1-1.89-1.89A6.996 6.996 0 0 1 5 13H3a9.02 9.02 0 0 0 1.539 5.034 9.096 9.096 0 0 0 2.428 2.428A8.95 8.95 0 0 0 12 22a9.09 9.09 0 0 0 1.814-.183 9.014 9.014 0 0 0 3.218-1.355 8.886 8.886 0 0 0 1.331-1.099 9.228 9.228 0 0 0 1.1-1.332A8.952 8.952 0 0 0 21 13a9.09 9.09 0 0 0-.183-1.814z"}}]})(e)}function cD(e){return ve({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M6.758 8.758 5.344 7.344a8.048 8.048 0 0 0-1.841 2.859l1.873.701a6.048 6.048 0 0 1 1.382-2.146zM19 12.999a7.935 7.935 0 0 0-2.344-5.655A7.917 7.917 0 0 0 12 5.069V2L7 6l5 4V7.089a5.944 5.944 0 0 1 3.242 1.669A5.956 5.956 0 0 1 17 13v.002c0 .33-.033.655-.086.977-.007.043-.011.088-.019.131a6.053 6.053 0 0 1-1.138 2.536c-.16.209-.331.412-.516.597a5.954 5.954 0 0 1-.728.613 5.906 5.906 0 0 1-2.277 1.015c-.142.03-.285.05-.43.069-.062.009-.122.021-.184.027a6.104 6.104 0 0 1-1.898-.103L9.3 20.819a8.087 8.087 0 0 0 2.534.136c.069-.007.138-.021.207-.03.205-.026.409-.056.61-.098l.053-.009-.001-.005a7.877 7.877 0 0 0 2.136-.795l.001.001.028-.019a7.906 7.906 0 0 0 1.01-.67c.27-.209.532-.43.777-.675.248-.247.47-.513.681-.785.021-.028.049-.053.07-.081l-.006-.004a7.899 7.899 0 0 0 1.093-1.997l.008.003c.029-.078.05-.158.076-.237.037-.11.075-.221.107-.333.04-.14.073-.281.105-.423.022-.099.048-.195.066-.295.032-.171.056-.344.076-.516.01-.076.023-.15.03-.227.023-.249.037-.5.037-.753.002-.002.002-.004.002-.008zM6.197 16.597l-1.6 1.201a8.045 8.045 0 0 0 2.569 2.225l.961-1.754a6.018 6.018 0 0 1-1.93-1.672zM5 13c0-.145.005-.287.015-.429l-1.994-.143a7.977 7.977 0 0 0 .483 3.372l1.873-.701A5.975 5.975 0 0 1 5 13z"}}]})(e)}function uD(e){return ve({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M16.242 17.242a6.04 6.04 0 0 1-1.37 1.027l.961 1.754a8.068 8.068 0 0 0 2.569-2.225l-1.6-1.201a5.938 5.938 0 0 1-.56.645zm1.743-4.671a5.975 5.975 0 0 1-.362 2.528l1.873.701a7.977 7.977 0 0 0 .483-3.371l-1.994.142zm1.512-2.368a8.048 8.048 0 0 0-1.841-2.859l-1.414 1.414a6.071 6.071 0 0 1 1.382 2.146l1.873-.701zm-8.128 8.763c-.047-.005-.094-.015-.141-.021a6.701 6.701 0 0 1-.468-.075 5.923 5.923 0 0 1-2.421-1.122 5.954 5.954 0 0 1-.583-.506 6.138 6.138 0 0 1-.516-.597 5.91 5.91 0 0 1-.891-1.634 6.086 6.086 0 0 1-.247-.902c-.008-.043-.012-.088-.019-.131A6.332 6.332 0 0 1 6 13.002V13c0-1.603.624-3.109 1.758-4.242A5.944 5.944 0 0 1 11 7.089V10l5-4-5-4v3.069a7.917 7.917 0 0 0-4.656 2.275A7.936 7.936 0 0 0 4 12.999v.009c0 .253.014.504.037.753.007.076.021.15.03.227.021.172.044.345.076.516.019.1.044.196.066.295.032.142.065.283.105.423.032.112.07.223.107.333.026.079.047.159.076.237l.008-.003A7.948 7.948 0 0 0 5.6 17.785l-.007.005c.021.028.049.053.07.081.211.272.433.538.681.785a8.236 8.236 0 0 0 .966.816c.265.192.537.372.821.529l.028.019.001-.001a7.877 7.877 0 0 0 2.136.795l-.001.005.053.009c.201.042.405.071.61.098.069.009.138.023.207.03a8.038 8.038 0 0 0 2.532-.137l-.424-1.955a6.11 6.11 0 0 1-1.904.102z"}}]})(e)}function dD(e){return ve({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M11 6H9v3H6v2h3v3h2v-3h3V9h-3z"}},{tag:"path",attr:{d:"M10 2c-4.411 0-8 3.589-8 8s3.589 8 8 8a7.952 7.952 0 0 0 4.897-1.688l4.396 4.396 1.414-1.414-4.396-4.396A7.952 7.952 0 0 0 18 10c0-4.411-3.589-8-8-8zm0 14c-3.309 0-6-2.691-6-6s2.691-6 6-6 6 2.691 6 6-2.691 6-6 6z"}}]})(e)}function fD(e){return ve({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M6 9h8v2H6z"}},{tag:"path",attr:{d:"M10 18a7.952 7.952 0 0 0 4.897-1.688l4.396 4.396 1.414-1.414-4.396-4.396A7.952 7.952 0 0 0 18 10c0-4.411-3.589-8-8-8s-8 3.589-8 8 3.589 8 8 8zm0-14c3.309 0 6 2.691 6 6s-2.691 6-6 6-6-2.691-6-6 2.691-6 6-6z"}}]})(e)}const k4=me([Et],e=>{const{model_list:t}=e,n=[];return ee.forEach(t,r=>{n.push(r.weights)}),n});function z0({model:e,modelsToAdd:t,setModelsToAdd:n}){const{t:r}=X(),o=A(k4),s=c=>{t.includes(c.target.value)?n(ee.remove(t,u=>u!==c.target.value)):n([...t,c.target.value])};return l.jsx(ze,{children:l.jsxs(B,{flexDirection:"column",gap:2,backgroundColor:t.includes(e.name)?"accent.650":"base.800",paddingX:4,paddingY:2,borderRadius:4,children:[l.jsxs(B,{gap:4,children:[l.jsx(pt,{value:e.name,label:l.jsx(Ce,{fontWeight:500,children:e.name}),isChecked:t.includes(e.name),isDisabled:o.includes(e.location),onChange:s}),o.includes(e.location)&&l.jsx(yy,{colorScheme:"accent",children:r("modelManager.modelExists")})]}),l.jsx(Ce,{fontStyle:"italic",variant:"subtext",children:e.location})]})})}function hD(){const e=Y(),{t}=X(),n=A(P=>P.system.searchFolder),r=A(P=>P.system.foundModels),o=A(k4),s=A(P=>P.ui.shouldShowExistingModelsInSearch),c=A(P=>P.system.isProcessing),[u,f]=Me.useState([]),[p,h]=Me.useState("v1"),[y,x]=Me.useState(""),S=()=>{e(US(null)),e($S(null)),f([])},C=P=>{e(Pv(P.checkpointFolder))},k=()=>{f([]),r&&r.forEach(P=>{o.includes(P.location)||f(M=>[...M,P.name])})},w=()=>{f([])},j=()=>{const P=r==null?void 0:r.filter(T=>u.includes(T.name)),M={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:y};P==null||P.forEach(T=>{const D={name:T.name,description:"",config:M[p],weights:T.location,vae:"",width:512,height:512,default:!1,format:"ckpt"};e(rs(D))}),f([])},I=()=>{const P=[],M=[];return r&&r.forEach((T,D)=>{o.includes(T.location)?M.push(l.jsx(z0,{model:T,modelsToAdd:u,setModelsToAdd:f},D)):P.push(l.jsx(z0,{model:T,modelsToAdd:u,setModelsToAdd:f},D))}),l.jsxs(l.Fragment,{children:[P,s&&M]})};return l.jsxs(l.Fragment,{children:[n?l.jsxs(B,{sx:{padding:4,gap:2,position:"relative",borderRadius:"base",alignItems:"center",w:"full",bg:"base.900"},children:[l.jsxs(B,{sx:{flexDir:"column",gap:2},children:[l.jsx(Ce,{sx:{fontWeight:500,fontSize:"sm"},variant:"subtext",children:t("modelManager.checkpointFolder")}),l.jsx(Ce,{sx:{fontWeight:500,fontSize:"sm"},children:n})]}),l.jsx(kc,{}),l.jsx(se,{"aria-label":t("modelManager.scanAgain"),tooltip:t("modelManager.scanAgain"),icon:l.jsx(up,{}),fontSize:18,disabled:c,onClick:()=>e(Pv(n))}),l.jsx(se,{"aria-label":t("modelManager.clearCheckpointFolder"),icon:l.jsx(vs,{style:{transform:"rotate(45deg)"}}),onClick:S})]}):l.jsx(xs,{initialValues:{checkpointFolder:""},onSubmit:P=>{C(P)},children:({handleSubmit:P})=>l.jsx("form",{onSubmit:P,children:l.jsxs(ra,{columnGap:2,alignItems:"flex-end",width:"100%",children:[l.jsx(rt,{isRequired:!0,width:"lg",children:l.jsx(kt,{as:mt,id:"checkpointFolder",name:"checkpointFolder",type:"text",size:"md",label:t("modelManager.checkpointFolder")})}),l.jsx(Je,{leftIcon:l.jsx(B9,{}),"aria-label":t("modelManager.findModels"),tooltip:t("modelManager.findModels"),type:"submit",disabled:c,paddingX:10,children:t("modelManager.findModels")})]})})}),r&&l.jsxs(B,{flexDirection:"column",rowGap:4,width:"full",children:[l.jsxs(B,{justifyContent:"space-between",alignItems:"center",children:[l.jsxs("p",{children:[t("modelManager.modelsFound"),": ",r.length]}),l.jsxs("p",{children:[t("modelManager.selected"),": ",u.length]})]}),l.jsxs(B,{columnGap:2,justifyContent:"space-between",children:[l.jsxs(B,{columnGap:2,children:[l.jsx(Je,{isDisabled:u.length===r.length,onClick:k,children:t("modelManager.selectAll")}),l.jsx(Je,{isDisabled:u.length===0,onClick:w,children:t("modelManager.deselectAll")}),l.jsx(pt,{label:t("modelManager.showExisting"),isChecked:s,onChange:()=>e(VS(!s))})]}),l.jsx(Je,{isDisabled:u.length===0,onClick:j,colorScheme:"accent",children:t("modelManager.addSelected")})]}),l.jsxs(B,{sx:{flexDirection:"column",padding:4,rowGap:4,borderRadius:"base",width:"full",bg:"base.900"},children:[l.jsxs(B,{gap:4,children:[l.jsx(Ce,{fontWeight:500,variant:"subtext",children:t("modelManager.pickModelType")}),l.jsx(Xa,{value:p,onChange:P=>h(P),defaultValue:"v1",name:"model_type",children:l.jsxs(B,{gap:4,children:[l.jsx(vn,{value:"v1",children:l.jsx(Ce,{fontSize:"sm",children:t("modelManager.v1")})}),l.jsx(vn,{value:"v2_base",children:l.jsx(Ce,{fontSize:"sm",children:t("modelManager.v2_base")})}),l.jsx(vn,{value:"v2_768",children:l.jsx(Ce,{fontSize:"sm",children:t("modelManager.v2_768")})}),l.jsx(vn,{value:"inpainting",children:l.jsx(Ce,{fontSize:"sm",children:t("modelManager.inpainting")})}),l.jsx(vn,{value:"custom",children:l.jsx(Ce,{fontSize:"sm",children:t("modelManager.customConfig")})})]})})]}),p==="custom"&&l.jsxs(B,{flexDirection:"column",rowGap:2,children:[l.jsx(Ce,{fontWeight:"500",fontSize:"sm",variant:"subtext",children:t("modelManager.pathToCustomConfig")}),l.jsx(mt,{value:y,onChange:P=>{P.target.value!==""&&x(P.target.value)},width:"full"})]})]}),l.jsx(B,{flexDirection:"column",maxHeight:72,overflowY:"scroll",borderRadius:"sm",paddingInlineEnd:4,gap:2,children:r.length>0?I():l.jsx(Ce,{fontWeight:"500",padding:2,borderRadius:"sm",textAlign:"center",variant:"subtext",children:t("modelManager.noModelsFound")})})]})]})}const R0=64,N0=2048;function pD(){const e=Y(),{t}=X(),n=A(p=>p.system.isProcessing);function r(p){return/\s/.test(p)}function o(p){let h;return r(p)&&(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},c=p=>{e(rs(p)),e(Wo(null))},[u,f]=Me.useState(!1);return l.jsxs(ze,{gap:2,alignItems:"flex-start",children:[l.jsx(se,{"aria-label":t("common.back"),tooltip:t("common.back"),onClick:()=>e(Wo(null)),width:"max-content",position:"absolute",zIndex:1,size:"sm",insetInlineEnd:12,top:3,icon:l.jsx(w4,{})}),l.jsx(hD,{}),l.jsx(pt,{label:t("modelManager.addManually"),isChecked:u,onChange:()=>f(!u)}),u&&l.jsx(xs,{initialValues:s,onSubmit:c,children:({handleSubmit:p,errors:h,touched:y})=>l.jsx("form",{onSubmit:p,children:l.jsxs(ze,{rowGap:2,children:[l.jsx(Ce,{fontSize:20,fontWeight:"bold",alignSelf:"start",children:t("modelManager.manual")}),l.jsxs(rt,{isInvalid:!!h.name&&y.name,isRequired:!0,children:[l.jsx(st,{htmlFor:"name",fontSize:"sm",children:t("modelManager.name")}),l.jsxs(ze,{alignItems:"start",children:[l.jsx(kt,{as:mt,id:"name",name:"name",type:"text",validate:o,width:"2xl"}),h.name&&y.name?l.jsx(mn,{children:h.name}):l.jsx(pn,{margin:0,children:t("modelManager.nameValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!h.description&&y.description,isRequired:!0,children:[l.jsx(st,{htmlFor:"description",fontSize:"sm",children:t("modelManager.description")}),l.jsxs(ze,{alignItems:"start",children:[l.jsx(kt,{as:mt,id:"description",name:"description",type:"text",width:"2xl"}),h.description&&y.description?l.jsx(mn,{children:h.description}):l.jsx(pn,{margin:0,children:t("modelManager.descriptionValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!h.config&&y.config,isRequired:!0,children:[l.jsx(st,{htmlFor:"config",fontSize:"sm",children:t("modelManager.config")}),l.jsxs(ze,{alignItems:"start",children:[l.jsx(kt,{as:mt,id:"config",name:"config",type:"text",width:"2xl"}),h.config&&y.config?l.jsx(mn,{children:h.config}):l.jsx(pn,{margin:0,children:t("modelManager.configValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!h.weights&&y.weights,isRequired:!0,children:[l.jsx(st,{htmlFor:"config",fontSize:"sm",children:t("modelManager.modelLocation")}),l.jsxs(ze,{alignItems:"start",children:[l.jsx(kt,{as:mt,id:"weights",name:"weights",type:"text",width:"2xl"}),h.weights&&y.weights?l.jsx(mn,{children:h.weights}):l.jsx(pn,{margin:0,children:t("modelManager.modelLocationValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!h.vae&&y.vae,children:[l.jsx(st,{htmlFor:"vae",fontSize:"sm",children:t("modelManager.vaeLocation")}),l.jsxs(ze,{alignItems:"start",children:[l.jsx(kt,{as:mt,id:"vae",name:"vae",type:"text",width:"2xl"}),h.vae&&y.vae?l.jsx(mn,{children:h.vae}):l.jsx(pn,{margin:0,children:t("modelManager.vaeLocationValidationMsg")})]})]}),l.jsxs(ra,{width:"100%",children:[l.jsxs(rt,{isInvalid:!!h.width&&y.width,children:[l.jsx(st,{htmlFor:"width",fontSize:"sm",children:t("modelManager.width")}),l.jsxs(ze,{alignItems:"start",children:[l.jsx(kt,{id:"width",name:"width",children:({field:x,form:S})=>l.jsx(Wr,{id:"width",name:"width",min:R0,max:N0,step:64,width:"90%",value:S.values.width,onChange:C=>S.setFieldValue(x.name,Number(C))})}),h.width&&y.width?l.jsx(mn,{children:h.width}):l.jsx(pn,{margin:0,children:t("modelManager.widthValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!h.height&&y.height,children:[l.jsx(st,{htmlFor:"height",fontSize:"sm",children:t("modelManager.height")}),l.jsxs(ze,{alignItems:"start",children:[l.jsx(kt,{id:"height",name:"height",children:({field:x,form:S})=>l.jsx(Wr,{id:"height",name:"height",min:R0,max:N0,width:"90%",step:64,value:S.values.height,onChange:C=>S.setFieldValue(x.name,Number(C))})}),h.height&&y.height?l.jsx(mn,{children:h.height}):l.jsx(pn,{margin:0,children:t("modelManager.heightValidationMsg")})]})]})]}),l.jsx(Je,{type:"submit",className:"modal-close-btn",isLoading:n,children:t("modelManager.addModel")})]})})})]})}function Al({children:e}){return l.jsx(B,{sx:{flexDirection:"column",padding:4,rowGap:4,borderRadius:"base",width:"full",bg:"base.900"},children:e})}function mD(){const e=Y(),{t}=X(),n=A(u=>u.system.isProcessing);function r(u){return/\s/.test(u)}function o(u){let f;return r(u)&&(f=t("modelManager.cannotUseSpaces")),f}const s={name:"",description:"",repo_id:"",path:"",format:"diffusers",default:!1,vae:{repo_id:"",path:""}},c=u=>{const f=u;u.path===""&&delete f.path,u.repo_id===""&&delete f.repo_id,u.vae.path===""&&delete f.vae.path,u.vae.repo_id===""&&delete f.vae.repo_id,e(rs(f)),e(Wo(null))};return l.jsxs(B,{children:[l.jsx(se,{"aria-label":t("common.back"),tooltip:t("common.back"),onClick:()=>e(Wo(null)),width:"max-content",position:"absolute",zIndex:1,size:"sm",insetInlineEnd:12,top:3,icon:l.jsx(w4,{})}),l.jsx(xs,{initialValues:s,onSubmit:c,children:({handleSubmit:u,errors:f,touched:p})=>{var h,y,x,S,C,k,w,j,I,P;return l.jsx("form",{onSubmit:u,children:l.jsxs(ze,{rowGap:2,children:[l.jsx(Al,{children:l.jsxs(rt,{isInvalid:!!f.name&&p.name,isRequired:!0,children:[l.jsx(st,{htmlFor:"name",fontSize:"sm",children:t("modelManager.name")}),l.jsxs(ze,{alignItems:"start",children:[l.jsx(kt,{as:mt,id:"name",name:"name",type:"text",validate:o,width:"2xl",isRequired:!0}),f.name&&p.name?l.jsx(mn,{children:f.name}):l.jsx(pn,{margin:0,children:t("modelManager.nameValidationMsg")})]})]})}),l.jsx(Al,{children:l.jsxs(rt,{isInvalid:!!f.description&&p.description,isRequired:!0,children:[l.jsx(st,{htmlFor:"description",fontSize:"sm",children:t("modelManager.description")}),l.jsxs(ze,{alignItems:"start",children:[l.jsx(kt,{as:mt,id:"description",name:"description",type:"text",width:"2xl",isRequired:!0}),f.description&&p.description?l.jsx(mn,{children:f.description}):l.jsx(pn,{margin:0,children:t("modelManager.descriptionValidationMsg")})]})]})}),l.jsxs(Al,{children:[l.jsx(Ce,{fontWeight:"bold",fontSize:"sm",children:t("modelManager.formMessageDiffusersModelLocation")}),l.jsx(Ce,{sx:{fontSize:"sm",fontStyle:"italic"},variant:"subtext",children:t("modelManager.formMessageDiffusersModelLocationDesc")}),l.jsxs(rt,{isInvalid:!!f.path&&p.path,children:[l.jsx(st,{htmlFor:"path",fontSize:"sm",children:t("modelManager.modelLocation")}),l.jsxs(ze,{alignItems:"start",children:[l.jsx(kt,{as:mt,id:"path",name:"path",type:"text",width:"2xl"}),f.path&&p.path?l.jsx(mn,{children:f.path}):l.jsx(pn,{margin:0,children:t("modelManager.modelLocationValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!f.repo_id&&p.repo_id,children:[l.jsx(st,{htmlFor:"repo_id",fontSize:"sm",children:t("modelManager.repo_id")}),l.jsxs(ze,{alignItems:"start",children:[l.jsx(kt,{as:mt,id:"repo_id",name:"repo_id",type:"text",width:"2xl"}),f.repo_id&&p.repo_id?l.jsx(mn,{children:f.repo_id}):l.jsx(pn,{margin:0,children:t("modelManager.repoIDValidationMsg")})]})]})]}),l.jsxs(Al,{children:[l.jsx(Ce,{fontWeight:"bold",children:t("modelManager.formMessageDiffusersVAELocation")}),l.jsx(Ce,{sx:{fontSize:"sm",fontStyle:"italic"},variant:"subtext",children:t("modelManager.formMessageDiffusersVAELocationDesc")}),l.jsxs(rt,{isInvalid:!!((h=f.vae)!=null&&h.path)&&((y=p.vae)==null?void 0:y.path),children:[l.jsx(st,{htmlFor:"vae.path",fontSize:"sm",children:t("modelManager.vaeLocation")}),l.jsxs(ze,{alignItems:"start",children:[l.jsx(kt,{as:mt,id:"vae.path",name:"vae.path",type:"text",width:"2xl"}),(x=f.vae)!=null&&x.path&&((S=p.vae)!=null&&S.path)?l.jsx(mn,{children:(C=f.vae)==null?void 0:C.path}):l.jsx(pn,{margin:0,children:t("modelManager.vaeLocationValidationMsg")})]})]}),l.jsxs(rt,{isInvalid:!!((k=f.vae)!=null&&k.repo_id)&&((w=p.vae)==null?void 0:w.repo_id),children:[l.jsx(st,{htmlFor:"vae.repo_id",fontSize:"sm",children:t("modelManager.vaeRepoID")}),l.jsxs(ze,{alignItems:"start",children:[l.jsx(kt,{as:mt,id:"vae.repo_id",name:"vae.repo_id",type:"text",width:"2xl"}),(j=f.vae)!=null&&j.repo_id&&((I=p.vae)!=null&&I.repo_id)?l.jsx(mn,{children:(P=f.vae)==null?void 0:P.repo_id}):l.jsx(pn,{margin:0,children:t("modelManager.vaeRepoIDValidationMsg")})]})]})]}),l.jsx(Je,{type:"submit",isLoading:n,children:t("modelManager.addModel")})]})})}})]})}function F0({text:e,onClick:t}){return l.jsx(B,{position:"relative",width:"50%",height:40,justifyContent:"center",alignItems:"center",onClick:t,as:ti,children:l.jsx(Ce,{fontWeight:"bold",children:e})})}function vD(){const{isOpen:e,onOpen:t,onClose:n}=ho(),r=A(u=>u.ui.addNewModelUIOption),o=Y(),{t:s}=X(),c=()=>{n(),o(Wo(null))};return l.jsxs(l.Fragment,{children:[l.jsx(Je,{"aria-label":s("modelManager.addNewModel"),tooltip:s("modelManager.addNewModel"),onClick:t,size:"sm",children:l.jsxs(B,{columnGap:2,alignItems:"center",children:[l.jsx(vs,{}),s("modelManager.addNew")]})}),l.jsxs(po,{isOpen:e,onClose:c,size:"3xl",closeOnOverlayClick:!1,children:[l.jsx(Br,{}),l.jsxs(mo,{margin:"auto",paddingInlineEnd:4,children:[l.jsx(Lr,{children:s("modelManager.addNewModel")}),l.jsx(ia,{}),l.jsxs(Hr,{children:[r==null&&l.jsxs(B,{columnGap:4,children:[l.jsx(F0,{text:s("modelManager.addCheckpointModel"),onClick:()=>o(Wo("ckpt"))}),l.jsx(F0,{text:s("modelManager.addDiffuserModel"),onClick:()=>o(Wo("diffusers"))})]}),r=="ckpt"&&l.jsx(pD,{}),r=="diffusers"&&l.jsx(mD,{})]}),l.jsx(Fr,{})]})]})]})}var gD=Jf({displayName:"EditIcon",path:l.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[l.jsx("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),l.jsx("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]})}),j4=Jf({displayName:"ExternalLinkIcon",path:l.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[l.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),l.jsx("path",{d:"M15 3h6v6"}),l.jsx("path",{d:"M10 14L21 3"})]})}),yD=Jf({displayName:"DeleteIcon",path:l.jsx("g",{fill:"currentColor",children:l.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"})})});function Ol(e){const{isProcessing:t,isConnected:n}=A(S=>S.system),r=A(S=>S.system.openModel),{t:o}=X(),s=Y(),{name:c,status:u,description:f}=e,p=()=>{s(w1(c))},h=()=>{s(Iv(c))},y=()=>{s(GS(c)),s(Iv(null))},x=()=>{switch(u){case"active":return"ok.500";case"cached":return"warning.500";case"not loaded":return"inherit"}};return l.jsxs(B,{alignItems:"center",p:2,borderRadius:"base",sx:c===r?{bg:"accent.750",_hover:{bg:"accent.750"}}:{_hover:{bg:"base.750"}},children:[l.jsx(Ye,{onClick:h,cursor:"pointer",children:l.jsx(Gt,{label:f,hasArrow:!0,placement:"bottom",children:l.jsx(Ce,{fontWeight:"600",children:c})})}),l.jsx(kc,{onClick:h,cursor:"pointer"}),l.jsxs(B,{gap:2,alignItems:"center",children:[l.jsx(Ce,{color:x(),children:u}),l.jsx(ti,{size:"sm",onClick:p,isDisabled:u==="active"||t||!n,children:o("modelManager.load")}),l.jsx(se,{icon:l.jsx(gD,{}),size:"sm",onClick:h,"aria-label":o("accessibility.modifyConfig"),isDisabled:u==="active"||t||!n}),l.jsx(Bc,{title:o("modelManager.deleteModel"),acceptCallback:y,acceptButtonText:o("modelManager.delete"),triggerComponent:l.jsx(se,{icon:l.jsx(yD,{}),size:"sm","aria-label":o("modelManager.deleteConfig"),isDisabled:u==="active"||t||!n,colorScheme:"error"}),children:l.jsxs(B,{rowGap:4,flexDirection:"column",children:[l.jsx("p",{style:{fontWeight:"bold"},children:o("modelManager.deleteMsg1")}),l.jsx("p",{children:o("modelManager.deleteMsg2")})]})})]})]})}function L0(e){const{children:t,value:n}=e,[r,o]=k1("colors",["base.800","base.200"]);return l.jsx("option",{value:n,style:{background:r,color:o},children:t})}const xD=e=>{const{label:t,isDisabled:n,validValues:r,tooltip:o,tooltipProps:s,...c}=e;return l.jsxs(rt,{isDisabled:n,onClick:u=>{u.stopPropagation(),u.nativeEvent.stopImmediatePropagation(),u.nativeEvent.stopPropagation(),u.nativeEvent.cancelBubble=!0},children:[t&&l.jsx(st,{children:t}),l.jsx(Gt,{label:o,...s,children:l.jsx(ex,{...c,children:r.map(u=>typeof u=="string"||typeof u=="number"?l.jsx(L0,{value:u,children:u},u):l.jsx(L0,{value:u.value,children:u.key},u.value))})})]})},Mn=g.memo(xD),bD=e=>{const[t,n]=g.useState(!1),{label:r,value:o,min:s=1,max:c=100,step:u=1,onChange:f,tooltipSuffix:p="",withSliderMarks:h=!1,withInput:y=!1,isInteger:x=!1,inputWidth:S=16,inputReadOnly:C=!1,withReset:k=!1,hideTooltip:w=!1,isCompact:j=!1,handleReset:I,isResetDisabled:P,isSliderDisabled:M,isInputDisabled:T,sliderFormControlProps:D,sliderFormLabelProps:_,sliderMarkProps:R,sliderTrackProps:V,sliderThumbProps:F,sliderNumberInputProps:L,sliderNumberInputFieldProps:Q,sliderNumberInputStepperProps:U,sliderTooltipProps:K,sliderIAIIconButtonProps:te,...ne}=e,{t:$}=X(),[Z,oe]=g.useState(String(o));g.useEffect(()=>{oe(o)},[o]);const le=g.useMemo(()=>L!=null&&L.max?L.max:c,[c,L==null?void 0:L.max]),Re=ce=>{f(ce)},Ne=ce=>{ce.target.value===""&&(ce.target.value=String(s));const Fe=ee.clamp(x?Math.floor(Number(ce.target.value)):Number(Z),s,le);f(Fe)},Ie=ce=>{oe(ce)},pe=()=>{I&&I()};return l.jsxs(rt,{sx:j?{display:"flex",flexDirection:"row",alignItems:"center",columnGap:4,margin:0,padding:0}:{},...D,children:[l.jsx(st,{..._,mb:-1,children:r}),l.jsxs(ra,{w:"100%",gap:2,alignItems:"center",children:[l.jsxs(ix,{"aria-label":r,value:o,min:s,max:c,step:u,onChange:Re,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),focusThumbOnChange:!1,isDisabled:M,...ne,children:[h&&l.jsxs(l.Fragment,{children:[l.jsx(If,{value:s,sx:{insetInlineStart:"0 !important",insetInlineEnd:"unset !important"},...R,children:s}),l.jsx(If,{value:c,sx:{insetInlineStart:"unset !important",insetInlineEnd:"0 !important"},...R,children:c})]}),l.jsx(sx,{...V,children:l.jsx(lx,{})}),l.jsx(Gt,{hasArrow:!0,placement:"top",isOpen:t,label:`${o}${p}`,hidden:w,...K,children:l.jsx(ax,{...F})})]}),y&&l.jsxs(Rh,{min:s,max:le,step:u,value:Z,onChange:Ie,onBlur:Ne,isDisabled:T,...L,children:[l.jsx(Fh,{readOnly:C,minWidth:S,...Q}),l.jsxs(Nh,{...U,children:[l.jsx(Bh,{onClick:()=>f(Number(Z))}),l.jsx(Lh,{onClick:()=>f(Number(Z))})]})]}),k&&l.jsx(se,{size:"sm","aria-label":$("accessibility.reset"),tooltip:"Reset",icon:l.jsx(up,{}),onClick:pe,isDisabled:P,...te})]})]})},ut=g.memo(bD);function SD(){const e=Y(),{isOpen:t,onOpen:n,onClose:r}=ho(),o=A(q9),{t:s}=X(),[c,u]=g.useState(Object.keys(o)[0]),[f,p]=g.useState(Object.keys(o)[1]),[h,y]=g.useState("none"),[x,S]=g.useState(""),[C,k]=g.useState(.5),[w,j]=g.useState("weighted_sum"),[I,P]=g.useState("root"),[M,T]=g.useState(""),[D,_]=g.useState(!1),R=Object.keys(o).filter(U=>U!==f&&U!==h),V=Object.keys(o).filter(U=>U!==c&&U!==h),F=[{key:s("modelManager.none"),value:"none"},...Object.keys(o).filter(U=>U!==c&&U!==f).map(U=>({key:U,value:U}))],L=A(U=>U.system.isProcessing),Q=()=>{let U=[c,f,h];U=U.filter(te=>te!=="none");const K={models_to_merge:U,merged_model_name:x!==""?x:U.join("-"),alpha:C,interp:w,model_merge_save_path:I==="root"?null:M,force:D};e(qS(K))};return l.jsxs(l.Fragment,{children:[l.jsx(Je,{onClick:n,size:"sm",children:l.jsx(B,{columnGap:2,alignItems:"center",children:s("modelManager.mergeModels")})}),l.jsxs(po,{isOpen:t,onClose:r,size:"4xl",closeOnOverlayClick:!1,children:[l.jsx(Br,{}),l.jsxs(mo,{fontFamily:"Inter",margin:"auto",paddingInlineEnd:4,children:[l.jsx(Lr,{children:s("modelManager.mergeModels")}),l.jsx(ia,{}),l.jsx(Hr,{children:l.jsxs(B,{flexDirection:"column",rowGap:4,children:[l.jsxs(B,{sx:{flexDirection:"column",marginBottom:4,padding:4,borderRadius:"base",rowGap:1,bg:"base.900"},children:[l.jsx(Ce,{children:s("modelManager.modelMergeHeaderHelp1")}),l.jsx(Ce,{fontSize:"sm",variant:"subtext",children:s("modelManager.modelMergeHeaderHelp2")})]}),l.jsxs(B,{columnGap:4,children:[l.jsx(Mn,{label:s("modelManager.modelOne"),validValues:R,onChange:U=>u(U.target.value)}),l.jsx(Mn,{label:s("modelManager.modelTwo"),validValues:V,onChange:U=>p(U.target.value)}),l.jsx(Mn,{label:s("modelManager.modelThree"),validValues:F,onChange:U=>{U.target.value!=="none"?(y(U.target.value),j("add_difference")):(y("none"),j("weighted_sum"))}})]}),l.jsx(mt,{label:s("modelManager.mergedModelName"),value:x,onChange:U=>S(U.target.value)}),l.jsxs(B,{sx:{flexDirection:"column",padding:4,borderRadius:"base",gap:4,bg:"base.900"},children:[l.jsx(ut,{label:s("modelManager.alpha"),min:.01,max:.99,step:.01,value:C,onChange:U=>k(U),withInput:!0,withReset:!0,handleReset:()=>k(.5),withSliderMarks:!0}),l.jsx(Ce,{variant:"subtext",fontSize:"sm",children:s("modelManager.modelMergeAlphaHelp")})]}),l.jsxs(B,{sx:{padding:4,borderRadius:"base",gap:4,bg:"base.900"},children:[l.jsx(Ce,{fontWeight:500,fontSize:"sm",variant:"subtext",children:s("modelManager.interpolationType")}),l.jsx(Xa,{value:w,onChange:U=>j(U),children:l.jsx(B,{columnGap:4,children:h==="none"?l.jsxs(l.Fragment,{children:[l.jsx(vn,{value:"weighted_sum",children:l.jsx(Ce,{fontSize:"sm",children:s("modelManager.weightedSum")})}),l.jsx(vn,{value:"sigmoid",children:l.jsx(Ce,{fontSize:"sm",children:s("modelManager.sigmoid")})}),l.jsx(vn,{value:"inv_sigmoid",children:l.jsx(Ce,{fontSize:"sm",children:s("modelManager.inverseSigmoid")})})]}):l.jsx(vn,{value:"add_difference",children:l.jsx(Gt,{label:s("modelManager.modelMergeInterpAddDifferenceHelp"),children:l.jsx(Ce,{fontSize:"sm",children:s("modelManager.addDifference")})})})})})]}),l.jsxs(B,{sx:{flexDirection:"column",padding:4,borderRadius:"base",gap:4,bg:"base.900"},children:[l.jsxs(B,{columnGap:4,children:[l.jsx(Ce,{fontWeight:"500",fontSize:"sm",variant:"subtext",children:s("modelManager.mergedModelSaveLocation")}),l.jsx(Xa,{value:I,onChange:U=>P(U),children:l.jsxs(B,{columnGap:4,children:[l.jsx(vn,{value:"root",children:l.jsx(Ce,{fontSize:"sm",children:s("modelManager.invokeAIFolder")})}),l.jsx(vn,{value:"custom",children:l.jsx(Ce,{fontSize:"sm",children:s("modelManager.custom")})})]})})]}),I==="custom"&&l.jsx(mt,{label:s("modelManager.mergedModelCustomSaveLocation"),value:M,onChange:U=>T(U.target.value)})]}),l.jsx(pt,{label:s("modelManager.ignoreMismatch"),isChecked:D,onChange:U=>_(U.target.checked),fontWeight:"500"}),l.jsx(Je,{onClick:Q,isLoading:L,isDisabled:I==="custom"&&M==="",children:s("modelManager.merge")})]})}),l.jsx(Fr,{})]})]})]})}const CD=me(Et,e=>ee.map(e.model_list,(n,r)=>({name:r,...n})),{memoizeOptions:{resultEqualityCheck:ee.isEqual}});function Hd({label:e,isActive:t,onClick:n}){return l.jsx(Je,{onClick:n,isActive:t,sx:{_active:{bg:"accent.750"}},size:"sm",children:e})}const wD=()=>{const e=A(CD),[t,n]=Me.useState(!1);Me.useEffect(()=>{const x=setTimeout(()=>{n(!0)},200);return()=>clearTimeout(x)},[]);const[r,o]=g.useState(""),[s,c]=g.useState("all"),[u,f]=g.useTransition(),{t:p}=X(),h=x=>{f(()=>{o(x.target.value)})},y=g.useMemo(()=>{const x=[],S=[],C=[],k=[];return e.forEach((w,j)=>{w.name.toLowerCase().includes(r.toLowerCase())&&(C.push(l.jsx(Ol,{name:w.name,status:w.status,description:w.description},j)),w.format===s&&k.push(l.jsx(Ol,{name:w.name,status:w.status,description:w.description},j))),w.format!=="diffusers"?x.push(l.jsx(Ol,{name:w.name,status:w.status,description:w.description},j)):S.push(l.jsx(Ol,{name:w.name,status:w.status,description:w.description},j))}),r!==""?s==="all"?l.jsx(Ye,{marginTop:4,children:C}):l.jsx(Ye,{marginTop:4,children:k}):l.jsxs(B,{flexDirection:"column",rowGap:6,children:[s==="all"&&l.jsxs(l.Fragment,{children:[l.jsxs(Ye,{children:[l.jsx(Ce,{sx:{fontWeight:"500",py:2,px:4,my:4,mx:0,borderRadius:"base",width:"max-content",fontSize:"sm",bg:"base.750"},children:p("modelManager.checkpointModels")}),x]}),l.jsxs(Ye,{children:[l.jsx(Ce,{sx:{fontWeight:"500",py:2,px:4,mb:4,borderRadius:"base",width:"max-content",fontSize:"sm",bg:"base.750"},children:p("modelManager.diffusersModels")}),S]})]}),s==="ckpt"&&l.jsx(B,{flexDirection:"column",marginTop:4,children:x}),s==="diffusers"&&l.jsx(B,{flexDirection:"column",marginTop:4,children:S})]})},[e,r,p,s]);return l.jsxs(B,{flexDirection:"column",rowGap:4,width:"50%",minWidth:"50%",children:[l.jsxs(B,{justifyContent:"space-between",alignItems:"center",gap:2,children:[l.jsx(Wn,{size:"md",children:p("modelManager.availableModels")}),l.jsx(kc,{}),l.jsx(vD,{}),l.jsx(SD,{})]}),l.jsx(mt,{onChange:h,label:p("modelManager.search")}),l.jsxs(B,{flexDirection:"column",gap:1,maxHeight:window.innerHeight-240,overflow:"scroll",paddingInlineEnd:4,children:[l.jsxs(B,{columnGap:2,children:[l.jsx(Hd,{label:p("modelManager.allModels"),onClick:()=>c("all"),isActive:s==="all"}),l.jsx(Hd,{label:p("modelManager.checkpointModels"),onClick:()=>c("ckpt"),isActive:s==="ckpt"}),l.jsx(Hd,{label:p("modelManager.diffusersModels"),onClick:()=>c("diffusers"),isActive:s==="diffusers"})]}),t?y:l.jsx(B,{width:"100%",minHeight:96,justifyContent:"center",alignItems:"center",children:l.jsx(Xf,{})})]})]})};function kD({children:e}){const{isOpen:t,onOpen:n,onClose:r}=ho(),o=A(u=>u.system.model_list),s=A(u=>u.system.openModel),{t:c}=X();return l.jsxs(l.Fragment,{children:[g.cloneElement(e,{onClick:n}),l.jsxs(po,{isOpen:t,onClose:r,size:"full",children:[l.jsx(Br,{}),l.jsxs(mo,{children:[l.jsx(ia,{}),l.jsx(Lr,{children:c("modelManager.modelManager")}),l.jsx(Hr,{children:l.jsxs(B,{width:"100%",columnGap:8,children:[l.jsx(wD,{}),s&&o[s].format==="diffusers"?l.jsx(aD,{}):l.jsx(oD,{})]})}),l.jsx(Fr,{})]})]})]})}const jD=me([Et],e=>{const{isProcessing:t,model_list:n}=e;return{models:ee.map(n,(o,s)=>s),isProcessing:t}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),ED=()=>{const e=Y(),{t}=X(),{models:n,isProcessing:r}=A(jD),o=A($x),s=c=>{e(w1(c.target.value))};return l.jsx(B,{style:{paddingInlineStart:1.5},children:l.jsx(Mn,{style:{fontSize:"sm"},"aria-label":t("accessibility.modelSelect"),tooltip:o.description,isDisabled:r,value:o.name,validValues:n,onChange:s})})},PD=e=>{const{label:t,isDisabled:n=!1,width:r="auto",formControlProps:o,formLabelProps:s,...c}=e;return l.jsxs(rt,{isDisabled:n,width:r,display:"flex",gap:4,alignItems:"center",justifyContent:"space-between",...o,children:[l.jsx(st,{my:1,...s,children:t}),l.jsx(cx,{...c})]})},En=g.memo(PD),ID=me([Et,Er],(e,t)=>{const{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:o,model_list:s,saveIntermediatesInterval:c,enableImageDebugging:u}=e,{shouldUseCanvasBetaLayout:f,shouldUseSliders:p}=t;return{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:o,models:ee.map(s,(h,y)=>y),saveIntermediatesInterval:c,enableImageDebugging:u,shouldUseCanvasBetaLayout:f,shouldUseSliders:p}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),Wd={flexDirection:"column",gap:2,p:4,bg:"base.900"},MD=({children:e})=>{const t=Y(),{t:n}=X(),r=A(P=>P.generation.steps),{isOpen:o,onOpen:s,onClose:c}=ho(),{isOpen:u,onOpen:f,onClose:p}=ho(),{shouldDisplayInProgressType:h,shouldConfirmOnDelete:y,shouldDisplayGuides:x,saveIntermediatesInterval:S,enableImageDebugging:C,shouldUseCanvasBetaLayout:k,shouldUseSliders:w}=A(ID),j=()=>{e3.purge().then(()=>{c(),f()})},I=P=>{P>r&&(P=r),P<1&&(P=1),t(t3(P))};return l.jsxs(l.Fragment,{children:[g.cloneElement(e,{onClick:s}),l.jsxs(po,{isOpen:o,onClose:c,size:"xl",children:[l.jsx(Br,{}),l.jsxs(mo,{paddingInlineEnd:4,children:[l.jsx(Lr,{children:n("common.settingsLabel")}),l.jsx(ia,{}),l.jsx(Hr,{children:l.jsxs(or,{gap:4,children:[l.jsxs(B,{sx:Wd,children:[l.jsx(Mn,{label:n("settings.displayInProgress"),validValues:YS,value:h,onChange:P=>t(KS(P.target.value))}),h==="full-res"&&l.jsx(Wr,{label:n("settings.saveSteps"),min:1,max:r,step:1,onChange:I,value:S,width:"auto",textAlign:"center"}),l.jsx(En,{label:n("settings.confirmOnDelete"),isChecked:y,onChange:P=>t(j1(P.target.checked))}),l.jsx(En,{label:n("settings.displayHelpIcons"),isChecked:x,onChange:P=>t(XS(P.target.checked))}),l.jsx(En,{label:n("settings.useCanvasBeta"),isChecked:k,onChange:P=>t(QS(P.target.checked))}),l.jsx(En,{label:n("settings.useSlidersForAll"),isChecked:w,onChange:P=>t(ZS(P.target.checked))})]}),l.jsxs(B,{sx:Wd,children:[l.jsx(Wn,{size:"sm",style:{fontWeight:"bold"},children:"Developer"}),l.jsx(En,{label:n("settings.enableImageDebugging"),isChecked:C,onChange:P=>t(JS(P.target.checked))})]}),l.jsxs(B,{sx:Wd,children:[l.jsx(Wn,{size:"sm",children:n("settings.resetWebUI")}),l.jsx(Je,{colorScheme:"error",onClick:j,children:n("settings.resetWebUI")}),l.jsx(Ce,{children:n("settings.resetWebUIDesc1")}),l.jsx(Ce,{children:n("settings.resetWebUIDesc2")})]})]})}),l.jsx(Fr,{children:l.jsx(Je,{onClick:c,children:n("common.close")})})]})]}),l.jsxs(po,{closeOnOverlayClick:!1,isOpen:u,onClose:p,isCentered:!0,children:[l.jsx(Br,{backdropFilter:"blur(40px)"}),l.jsxs(mo,{children:[l.jsx(Lr,{}),l.jsx(Hr,{children:l.jsx(B,{justifyContent:"center",children:l.jsx(Ce,{fontSize:"lg",children:l.jsx(Ce,{children:n("settings.resetComplete")})})})}),l.jsx(Fr,{})]})]})]})},TD=me(Et,e=>({isConnected:e.isConnected,isProcessing:e.isProcessing,currentIteration:e.currentIteration,totalIterations:e.totalIterations,currentStatus:e.currentStatus,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}),{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),_D=()=>{const{isConnected:e,isProcessing:t,currentIteration:n,totalIterations:r,currentStatus:o,hasError:s,wasErrorSeen:c}=A(TD),u=Y(),{t:f}=X();let p;e&&!s?p="ok":p="error";let h=o;t&&(p="working"),h&&t&&r>1&&(h=`${f(h)} (${n}/${r})`);const y=s&&!c?"Click to clear, check logs for details":void 0,x=s&&!c?"pointer":"initial",S=()=>{(s||!c)&&u(C1())};return l.jsx(Gt,{label:y,children:l.jsx(Ce,{cursor:x,onClick:S,sx:{fontSize:"xs",fontWeight:"600",color:`${p}.400`},children:f(h)})})},DD=e=>{const{triggerComponent:t,children:n,hasArrow:r=!0,isLazy:o=!0,...s}=e;return l.jsxs(Vh,{isLazy:o,...s,children:[l.jsx(Wh,{children:t}),l.jsxs($h,{children:[r&&l.jsx(Uh,{}),n]})]})},rr=g.memo(DD);function AD(){const{t:e}=X(),t=Y(),n=A(c=>c.ui.currentTheme),r={dark:e("common.darkTheme"),light:e("common.lightTheme"),green:e("common.greenTheme"),ocean:e("common.oceanTheme")},o=c=>{t(n3(c))},s=()=>{const c=[];return Object.keys(r).forEach(u=>{c.push(l.jsx(Je,{isChecked:n===u,leftIcon:n===u?l.jsx(Ac,{}):void 0,size:"sm",onClick:()=>o(u),children:r[u]},u))}),c};return l.jsx(rr,{trigger:"hover",triggerComponent:l.jsx(se,{"aria-label":e("common.themeLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:l.jsx(z9,{})}),children:l.jsx(ze,{align:"stretch",children:s()})})}function OD(){const{t:e,i18n:t}=X(),n={ar:e("common.langArabic",{lng:"ar"}),nl:e("common.langDutch",{lng:"nl"}),en:e("common.langEnglish",{lng:"en"}),fr:e("common.langFrench",{lng:"fr"}),de:e("common.langGerman",{lng:"de"}),he:e("common.langHebrew",{lng:"he"}),it:e("common.langItalian",{lng:"it"}),ja:e("common.langJapanese",{lng:"ja"}),ko:e("common.langKorean",{lng:"ko"}),pl:e("common.langPolish",{lng:"pl"}),pt_BR:e("common.langBrPortuguese",{lng:"pt_BR"}),pt:e("common.langPortuguese",{lng:"pt"}),ru:e("common.langRussian",{lng:"ru"}),zh_CN:e("common.langSimplifiedChinese",{lng:"zh_CN"}),es:e("common.langSpanish",{lng:"es"}),uk:e("common.langUkranian",{lng:"ua"})},r=()=>{const o=[];return Object.keys(n).forEach(s=>{o.push(l.jsx(Je,{isChecked:localStorage.getItem("i18nextLng")===s,leftIcon:localStorage.getItem("i18nextLng")===s?l.jsx(Ac,{}):void 0,onClick:()=>t.changeLanguage(s),"aria-label":n[s],size:"sm",minWidth:"200px",children:n[s]},s))}),o};return l.jsx(rr,{trigger:"hover",triggerComponent:l.jsx(se,{"aria-label":e("common.languagePickerLabel"),tooltip:e("common.languagePickerLabel"),icon:l.jsx(D9,{}),size:"sm",variant:"link","data-variant":"link",fontSize:26}),children:l.jsx(ze,{children:r()})})}function zD(e){return ve({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 RD(e){return ve({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"}}]})(e)}function ND(e){return ve({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 FD(e){return ve({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M2.5 4v3h5v12h3V7h5V4h-13zm19 5h-9v3h3v7h3v-7h3V9z"}}]})(e)}function LD(e){return ve({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 BD(e){return ve({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M7 2v11h3v9l7-12h-4l4-8z"}}]})(e)}function B0(e){return ve({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 HD(e){return ve({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 WD(e){return ve({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M19.02 10v9H5V5h9V3H5.02c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-9h-2zM17 10l.94-2.06L20 7l-2.06-.94L17 4l-.94 2.06L14 7l2.06.94zm-3.75.75L12 8l-1.25 2.75L8 12l2.75 1.25L12 16l1.25-2.75L16 12z"}}]})(e)}function dp(e){return ve({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 VD(e){return ve({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"}}]})(e)}function UD(e){return ve({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M7 10l5 5 5-5z"}}]})(e)}function $D(e){return ve({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M7 14l5-5 5 5z"}}]})(e)}function GD(e){return ve({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}}]})(e)}const qD=""+new URL("logo-13003d72.png",import.meta.url).href,E4=()=>{const e=A(t=>t.system.app_version);return l.jsxs(B,{alignItems:"center",gap:3,ps:1,children:[l.jsx(ls,{src:qD,alt:"invoke-ai-logo",w:"32px",h:"32px"}),l.jsxs(Ce,{fontSize:"xl",children:["invoke ",l.jsx("strong",{children:"ai"})]}),l.jsx(Ce,{sx:{fontWeight:300,marginTop:1},variant:"subtext",children:e})]})},P4=()=>{const{t:e}=X();return l.jsxs(or,{gridTemplateColumns:"auto max-content",children:[l.jsx(E4,{}),l.jsxs(B,{alignItems:"center",gap:2,children:[l.jsx(_D,{}),l.jsx(ED,{}),l.jsx(kD,{children:l.jsx(se,{"aria-label":e("modelManager.modelManager"),tooltip:e("modelManager.modelManager"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:l.jsx(k9,{})})}),l.jsx(iP,{children:l.jsx(se,{"aria-label":e("common.hotkeysLabel"),tooltip:e("common.hotkeysLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:l.jsx(_9,{})})}),l.jsx(AD,{}),l.jsx(OD,{}),l.jsx(Go,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI/issues",marginBottom:"-0.25rem",children:l.jsx(se,{"aria-label":e("common.reportBugLabel"),tooltip:e("common.reportBugLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:l.jsx(w9,{})})}),l.jsx(Go,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI",marginBottom:"-0.25rem",children:l.jsx(se,{"aria-label":e("common.githubLabel"),tooltip:e("common.githubLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:l.jsx(v9,{})})}),l.jsx(Go,{isExternal:!0,href:"https://discord.gg/ZmtBAhwWhy",marginBottom:"-0.25rem",children:l.jsx(se,{"aria-label":e("common.discordLabel"),tooltip:e("common.discordLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:l.jsx(m9,{})})}),l.jsx(MD,{children:l.jsx(se,{"aria-label":e("common.settingsLabel"),tooltip:e("common.settingsLabel"),variant:"link","data-variant":"link",fontSize:22,size:"sm",icon:l.jsx(ND,{})})})]})]})};P4.displayName="SiteHeader";const fp=e=>{const{children:t}=e;return l.jsx(B,{sx:{width:"100%",height:"100%",bg:"base.850"},children:t})};function YD(){const{t:e}=X();return l.jsx(fp,{children:l.jsxs(B,{sx:{flexDirection:"column",alignItems:"center",justifyContent:"center",w:"100%",h:"100%",gap:4,textAlign:"center"},children:[l.jsx(Wn,{children:e("common.nodes")}),l.jsx(ze,{maxW:"50rem",gap:4,children:l.jsx(Ce,{children:e("common.nodesDesc")})})]})})}const KD=()=>{const{t:e}=X();return l.jsx(fp,{children:l.jsxs(B,{sx:{flexDirection:"column",alignItems:"center",justifyContent:"center",w:"100%",h:"100%",gap:4,textAlign:"center"},children:[l.jsx(Wn,{children:e("common.postProcessing")}),l.jsxs(ze,{maxW:"50rem",gap:4,children:[l.jsx(Ce,{children:e("common.postProcessDesc1")}),l.jsx(Ce,{children:e("common.postProcessDesc2")}),l.jsx(Ce,{children:e("common.postProcessDesc3")})]})]})})};function XD(){const{t:e}=X();return l.jsx(fp,{children:l.jsxs(B,{sx:{flexDirection:"column",alignItems:"center",justifyContent:"center",w:"100%",h:"100%",gap:4,textAlign:"center"},children:[l.jsx(Wn,{children:e("common.training")}),l.jsxs(ze,{maxW:"50rem",gap:4,children:[l.jsx(Ce,{children:e("common.trainingDesc1")}),l.jsx(Ce,{children:e("common.trainingDesc2")})]})]})})}const bs=me(e=>e.lightbox,e=>e,{memoizeOptions:{equalityCheck:ee.isEqual}}),Gr=e=>e.gallery,QD=me([Gr,Er,bs,bt],(e,t,n,r)=>{const{categories:o,currentCategory:s,currentImageUuid:c,galleryImageMinimumWidth:u,galleryImageObjectFit:f,shouldAutoSwitchToNewImages:p,galleryWidth:h,shouldUseSingleGalleryColumn:y}=e,{shouldPinGallery:x}=t,{isLightboxOpen:S}=n;return{currentImageUuid:c,shouldPinGallery:x,galleryImageMinimumWidth:u,galleryImageObjectFit:f,galleryGridTemplateColumns:y?"auto":`repeat(auto-fill, minmax(${u}px, auto))`,shouldAutoSwitchToNewImages:p,currentCategory:s,images:o[s].images,areMoreImagesAvailable:o[s].areMoreImagesAvailable,galleryWidth:h,shouldEnableResize:!(S||r==="unifiedCanvas"&&x),shouldUseSingleGalleryColumn:y}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),ZD=me([Gr,Et,bs,bt],(e,t,n,r)=>({mayDeleteImage:t.isConnected&&!t.isProcessing,galleryImageObjectFit:e.galleryImageObjectFit,galleryImageMinimumWidth:e.galleryImageMinimumWidth,shouldUseSingleGalleryColumn:e.shouldUseSingleGalleryColumn,activeTabName:r,isLightboxOpen:n.isLightboxOpen}),{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),JD=me(Gr,e=>({resultImages:e.categories.result.images,userImages:e.categories.user.images})),eA=()=>{const{resultImages:e,userImages:t}=A(JD);return n=>{const r=e.find(s=>s.uuid===n);if(r)return r;const o=t.find(s=>s.uuid===n);if(o)return o}},tA=({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"}),nA=({direction:e,minWidth:t,maxWidth:n,minHeight:r,maxHeight:o})=>{const s=t??(["left","right"].includes(e)?10:void 0),c=n??(["left","right"].includes(e)?"95vw":void 0),u=r??(["top","bottom"].includes(e)?10:void 0),f=o??(["top","bottom"].includes(e)?"95vh":void 0);return{...s?{minWidth:s}:{},...c?{maxWidth:c}:{},...u?{minHeight:u}:{},...f?{maxHeight:f}:{}}},zr="0.75rem",zl="1rem",rA="2px",oA="5px",iA=({isPinned:e,isResizable:t,direction:n})=>{if(!t)return{containerStyles:{},handleStyles:{}};const r=e?rA:oA,o=`calc((2 * ${zr} + ${r}) / -2)`;return n==="top"?{containerStyles:{borderBottomWidth:r,paddingBottom:zl},handleStyles:{top:{paddingTop:zr,paddingBottom:zr,bottom:o}}}:n==="left"?{containerStyles:{borderInlineEndWidth:r,paddingInlineEnd:zl},handleStyles:{right:{paddingInlineStart:zr,paddingInlineEnd:zr,insetInlineEnd:o}}}:n==="bottom"?{containerStyles:{borderTopWidth:r,paddingTop:zl},handleStyles:{bottom:{paddingTop:zr,paddingBottom:zr,top:o}}}:n==="right"?{containerStyles:{borderInlineStartWidth:r,paddingInlineStart:zl},handleStyles:{left:{paddingInlineStart:zr,paddingInlineEnd:zr,insetInlineStart:o}}}:{containerStyles:{},handleStyles:{}}},aA=(e,t)=>["top","bottom"].includes(e)?e:e==="left"?t==="rtl"?"right":"left":e==="right"?t==="rtl"?"left":"right":"left",ro=(e,t)=>{if(e)return t?e+t:e},sA=re(Ox,{shouldForwardProp:e=>!["sx"].includes(e)}),I4=({direction:e="left",isResizable:t,isPinned:n,isOpen:r,onClose:o,children:s,initialWidth:c,minWidth:u,maxWidth:f,initialHeight:p,minHeight:h,maxHeight:y,onResizeStart:x,onResizeStop:S,onResize:C,sx:k={}})=>{const w=ea().direction,j=g.useRef(null),I=g.useMemo(()=>c??u??(["left","right"].includes(e)?500:"100%"),[c,u,e]),P=g.useMemo(()=>p??h??(["top","bottom"].includes(e)?500:"100%"),[p,h,e]),[M,T]=g.useState(I),[D,_]=g.useState(P);k6({ref:j,handler:()=>{n||o()}});const R=g.useMemo(()=>t?tA({direction:e,langDirection:w}):{},[t,w,e]),V=g.useMemo(()=>nA({direction:e,minWidth:t?ro(u,18):ro(u),maxWidth:t?ro(f,18):ro(f),minHeight:t?ro(h,18):ro(h),maxHeight:t?ro(y,18):ro(y)}),[u,f,h,y,e,t]),{containerStyles:F,handleStyles:L}=g.useMemo(()=>iA({isPinned:n,isResizable:t,direction:e}),[n,t,e]),Q=g.useMemo(()=>aA(e,w),[e,w]);return g.useEffect(()=>{["left","right"].includes(e)&&_(n?"100%":"100vh"),["top","bottom"].includes(e)&&T(n?"100%":"100vw")},[n,e]),l.jsx(y2,{direction:Q,in:r,unmountOnExit:n,motionProps:{initial:n},...n?{style:{position:void 0,left:void 0,right:void 0,top:void 0,bottom:void 0,width:void 0}}:{style:{zIndex:99,width:"full"}},children:l.jsx(Ye,{ref:j,sx:{width:"full",height:"full"},children:l.jsx(sA,{size:{width:t?M:I,height:t?D:P},enable:R,handleStyles:L,...V,sx:{borderColor:"base.800",p:n?0:4,bg:"base.900",height:"full",boxShadow:n?"":"0 0 4rem 0 rgba(0, 0, 0, 0.8)",...F,...k},onResizeStart:(U,K,te)=>{x&&x(U,K,te)},onResize:(U,K,te,ne)=>{C&&C(U,K,te,ne)},onResizeStop:(U,K,te,ne)=>{["left","right"].includes(K)&&T(Number(M)+ne.width),["top","bottom"].includes(K)&&_(Number(D)+ne.height),S&&S(U,K,te,ne)},children:s})})})},H0={position:"absolute",width:"full",height:24,left:0,pointerEvents:"none",transition:"opacity 0.2s ease-in-out"},M4=({children:e})=>{const t=g.useRef(null),n=g.useRef(null),r=g.useRef(null),o=ee.throttle(()=>{if(!t.current||!n.current||!r.current)return;const{scrollTop:s,scrollHeight:c,offsetHeight:u}=t.current;s>0?n.current.style.opacity="1":n.current.style.opacity="0",s>=c-u?r.current.style.opacity="0":r.current.style.opacity="1"},33,{leading:!0});return g.useEffect(()=>{o()},[o]),l.jsxs(Ye,{position:"relative",w:"full",h:"full",children:[l.jsx(Ye,{ref:t,position:"absolute",w:"full",h:"full",overflowY:"scroll",onScroll:o,children:e}),l.jsx(Ye,{ref:r,sx:{...H0,bottom:0,boxShadow:"inset 0 -3.5rem 2rem -2rem var(--invokeai-colors-base-900)"}}),l.jsx(Ye,{ref:n,sx:{...H0,top:0,boxShadow:"inset 0 3.5rem 2rem -2rem var(--invokeai-colors-base-900)"}})]})},lA=ee.debounce(e=>{e(E1(!0))},300),cn=()=>(e,t)=>{bt(t())==="unifiedCanvas"&&lA(e)};function T4(e){return ve({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 _4(e){return ve({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)}const W0=e=>{const{sx:t}=e,n=Y(),r=A(c=>c.ui.shouldPinParametersPanel),{t:o}=X(),s=()=>{n(r3(!r)),n(cn())};return l.jsx(Gt,{label:o("common.pinOptionsPanel"),children:l.jsx(se,{...e,"aria-label":o("common.pinOptionsPanel"),onClick:s,icon:r?l.jsx(T4,{}):l.jsx(_4,{}),variant:"ghost",size:"sm",sx:{color:"base.700",_hover:{color:"base.550"},_active:{color:"base.500"},...t}})})},cA=me([Er,bt,bs],(e,t,n)=>{const{shouldPinParametersPanel:r,shouldShowParametersPanel:o}=e,{isLightboxOpen:s}=n;return{shouldPinParametersPanel:r,shouldShowParametersPanel:o,isResizable:t!=="unifiedCanvas",isLightboxOpen:s}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),uA=({children:e})=>{const t=Y(),{shouldPinParametersPanel:n,shouldShowParametersPanel:r,isResizable:o,isLightboxOpen:s}=A(cA),c=()=>{t(ql(!1))};return de("o",()=>{t(o3()),n&&t(cn())},{enabled:()=>!s},[n,s]),de("esc",()=>{t(ql(!1))},{enabled:()=>!n,preventDefault:!0},[n]),de("shift+o",()=>{t(i3()),t(cn())},[]),l.jsx(I4,{direction:"left",isResizable:o||!n,isOpen:r,onClose:c,isPinned:n||s,sx:{borderColor:"base.700",p:n?0:4,bg:"base.900"},initialWidth:t0,minWidth:t0,children:l.jsxs(B,{flexDir:"column",position:"relative",h:"full",w:"full",children:[!n&&l.jsxs(B,{paddingTop:1.5,paddingBottom:4,justifyContent:"space-between",alignItems:"center",children:[l.jsx(E4,{}),l.jsx(W0,{})]}),l.jsx(M4,{children:e}),n&&l.jsx(W0,{sx:{position:"absolute",top:0,insetInlineEnd:0}})]})})},dA=g.memo(uA),fA=me([Er,bt],(e,t)=>{const{shouldPinParametersPanel:n}=e;return{shouldPinParametersPanel:n,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),hp=e=>{const{parametersPanelContent:t,children:n,...r}=e,o=Y(),{activeTabName:s}=A(fA),c=eA(),u=f=>{const p=f.dataTransfer.getData("invokeai/imageUuid"),h=c(p);h&&(s==="img2img"?o(ns(h)):s==="unifiedCanvas"&&o(xc(h)))};return l.jsxs(B,{...r,pos:"relative",w:"full",h:eP,gap:4,children:[l.jsx(dA,{children:t}),l.jsx(Ye,{pos:"relative",w:"100%",h:"100%",onDrop:u,children:n})]})},hA=e=>{const{styleClass:t}=e,n=g.useContext(qh),r=()=>{n&&n()};return l.jsx(B,{sx:{width:"100%",height:"100%",alignItems:"center",justifyContent:"center"},className:t,children:l.jsxs(B,{onClick:r,sx:{display:"flex",flexDirection:"column",rowGap:8,p:8,borderRadius:"base",alignItems:"center",justifyContent:"center",textAlign:"center",cursor:"pointer",color:"base.600",bg:"base.800",_hover:{bg:"base.700"}},children:[l.jsx(tn,{as:Oc,boxSize:24}),l.jsx(Wn,{size:"md",children:"Click or Drag and Drop"})]})})};function pA(){const e=A(o=>o.postprocessing.facetoolType),t=Y(),{t:n}=X(),r=o=>t(Nl(o.target.value));return l.jsx(Mn,{label:n("parameters.type"),validValues:a3.concat(),value:e,onChange:r})}function mA(){const e=A(o=>o.system.isGFPGANAvailable),t=A(o=>o.postprocessing.facetoolStrength),{t:n}=X(),r=Y();return l.jsx(ut,{isSliderDisabled:!e,isInputDisabled:!e,isResetDisabled:!e,label:n("parameters.strength"),step:.05,min:0,max:1,onChange:o=>r(Yl(o)),handleReset:()=>r(Yl(.75)),value:t,withReset:!0,withSliderMarks:!0,withInput:!0})}function vA(){const e=A(o=>o.system.isGFPGANAvailable),t=A(o=>o.postprocessing.codeformerFidelity),{t:n}=X(),r=Y();return l.jsx(ut,{isSliderDisabled:!e,isInputDisabled:!e,isResetDisabled:!e,label:n("parameters.codeformerFidelity"),step:.05,min:0,max:1,onChange:o=>r(Xd(o)),handleReset:()=>r(Xd(1)),value:t,withReset:!0,withSliderMarks:!0,withInput:!0})}const pp=()=>{const e=A(t=>t.postprocessing.facetoolType);return l.jsxs(ze,{gap:2,alignItems:"stretch",children:[l.jsx(pA,{}),l.jsx(mA,{}),e==="codeformer"&&l.jsx(vA,{})]})};function gA(){const e=A(o=>o.system.isESRGANAvailable),t=A(o=>o.postprocessing.upscalingDenoising),{t:n}=X(),r=Y();return l.jsx(ut,{label:n("parameters.denoisingStrength"),value:t,min:0,max:1,step:.01,onChange:o=>{r(Qd(o))},handleReset:()=>r(Qd(.75)),withSliderMarks:!0,withInput:!0,withReset:!0,isSliderDisabled:!e,isInputDisabled:!e,isResetDisabled:!e})}function yA(){const e=A(o=>o.system.isESRGANAvailable),t=A(o=>o.postprocessing.upscalingStrength),{t:n}=X(),r=Y();return l.jsx(ut,{label:`${n("parameters.upscale")} ${n("parameters.strength")}`,value:t,min:0,max:1,step:.05,onChange:o=>r(Zd(o)),handleReset:()=>r(Zd(.75)),withSliderMarks:!0,withInput:!0,withReset:!0,isSliderDisabled:!e,isInputDisabled:!e,isResetDisabled:!e})}function xA(){const e=A(s=>s.system.isESRGANAvailable),t=A(s=>s.postprocessing.upscalingLevel),{t:n}=X(),r=Y(),o=s=>r(P1(Number(s.target.value)));return l.jsx(Mn,{isDisabled:!e,label:n("parameters.scale"),value:t,onChange:o,validValues:s3})}const mp=()=>l.jsxs(ze,{gap:2,alignItems:"stretch",children:[l.jsx(xA,{}),l.jsx(gA,{}),l.jsx(yA,{})]}),vp=e=>e.postprocessing,bA=me(Et,e=>{const{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}=e;return{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),hc=fe(({image:e,children:t},n)=>{const{isOpen:r,onOpen:o,onClose:s}=ho(),c=Y(),{shouldConfirmOnDelete:u,isConnected:f,isProcessing:p}=A(bA),h=g.useRef(null),y=C=>{C.stopPropagation(),u?o():x()},x=()=>{f&&!p&&e&&c(l3(e)),s()};de("delete",()=>{u?o():x()},[e,u,f,p]);const S=C=>c(j1(!C.target.checked));return l.jsxs(l.Fragment,{children:[g.cloneElement(t,{onClick:e?y:void 0,ref:n}),l.jsx(Gy,{isOpen:r,leastDestructiveRef:h,onClose:s,children:l.jsx(Br,{children:l.jsxs(qy,{children:[l.jsx(Lr,{fontSize:"lg",fontWeight:"bold",children:"Delete image"}),l.jsx(Hr,{children:l.jsxs(B,{direction:"column",gap:5,children:[l.jsx(Ce,{children:"Are you sure? Deleted images will be sent to the Bin. You can restore from there if you wish to."}),l.jsx(En,{label:"Don't ask me again",isChecked:!u,onChange:S})]})}),l.jsxs(Fr,{children:[l.jsx(Je,{ref:h,onClick:s,children:"Cancel"}),l.jsx(Je,{colorScheme:"error",onClick:x,ml:3,children:"Delete"})]})]})})})]})});hc.displayName="DeleteImageModal";const gp=()=>{const e=Y();return t=>{const n=typeof t=="string"?t:I1(t),[r,o]=c3(n);e(M1(r)),e(T1(o))}},SA=me([Et,Gr,vp,Er,bs,bt],(e,t,n,r,o,s)=>{const{isProcessing:c,isConnected:u,isGFPGANAvailable:f,isESRGANAvailable:p}=e,{upscalingLevel:h,facetoolStrength:y}=n,{isLightboxOpen:x}=o,{shouldShowImageDetails:S}=r,{intermediateImage:C,currentImage:k}=t;return{isProcessing:c,isConnected:u,isGFPGANAvailable:f,isESRGANAvailable:p,upscalingLevel:h,facetoolStrength:y,shouldDisableToolbarButtons:Boolean(C)||!k,currentImage:k,shouldShowImageDetails:S,activeTabName:s,isLightboxOpen:x}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),D4=e=>{var L,Q,U,K,te,ne,$,Z;const t=Y(),{isProcessing:n,isConnected:r,isGFPGANAvailable:o,isESRGANAvailable:s,upscalingLevel:c,facetoolStrength:u,shouldDisableToolbarButtons:f,shouldShowImageDetails:p,currentImage:h,isLightboxOpen:y,activeTabName:x}=A(SA),S=ss(),{t:C}=X(),k=gp(),w=()=>{h&&(y&&t(Vo(!1)),t(ns(h)),t(jn("img2img")))},j=async()=>{if(!h)return;const oe=await fetch(h.url).then(Re=>Re.blob()),le=[new ClipboardItem({[oe.type]:oe})];await navigator.clipboard.write(le),S({title:C("toast.imageCopied"),status:"success",duration:2500,isClosable:!0})},I=()=>{navigator.clipboard.writeText(h?window.location.toString()+h.url:"").then(()=>{S({title:C("toast.imageLinkCopied"),status:"success",duration:2500,isClosable:!0})})};de("shift+i",()=>{h?(w(),S({title:C("toast.sentToImageToImage"),status:"success",duration:2500,isClosable:!0})):S({title:C("toast.imageNotLoaded"),description:C("toast.imageNotLoadedDesc"),status:"error",duration:2500,isClosable:!0})},[h]);const P=()=>{var oe,le;h&&(h.metadata&&t(_1(h.metadata)),((oe=h.metadata)==null?void 0:oe.image.type)==="img2img"?t(jn("img2img")):((le=h.metadata)==null?void 0:le.image.type)==="txt2img"&&t(jn("txt2img")))};de("a",()=>{var oe,le;["txt2img","img2img"].includes((le=(oe=h==null?void 0:h.metadata)==null?void 0:oe.image)==null?void 0:le.type)?(P(),S({title:C("toast.parametersSet"),status:"success",duration:2500,isClosable:!0})):S({title:C("toast.parametersNotSet"),description:C("toast.parametersNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[h]);const M=()=>{h!=null&&h.metadata&&t(os(h.metadata.image.seed))};de("s",()=>{var oe,le;(le=(oe=h==null?void 0:h.metadata)==null?void 0:oe.image)!=null&&le.seed?(M(),S({title:C("toast.seedSet"),status:"success",duration:2500,isClosable:!0})):S({title:C("toast.seedNotSet"),description:C("toast.seedNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[h]);const T=g.useCallback(()=>{var oe,le,Re,Ne;(le=(oe=h==null?void 0:h.metadata)==null?void 0:oe.image)!=null&&le.prompt&&k((Ne=(Re=h==null?void 0:h.metadata)==null?void 0:Re.image)==null?void 0:Ne.prompt)},[(Q=(L=h==null?void 0:h.metadata)==null?void 0:L.image)==null?void 0:Q.prompt,k]);de("p",()=>{var oe,le;(le=(oe=h==null?void 0:h.metadata)==null?void 0:oe.image)!=null&&le.prompt?(T(),S({title:C("toast.promptSet"),status:"success",duration:2500,isClosable:!0})):S({title:C("toast.promptNotSet"),description:C("toast.promptNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[h]);const D=()=>{h&&t(u3(h))};de("Shift+U",()=>{s&&!f&&r&&!n&&c?D():S({title:C("toast.upscalingFailed"),status:"error",duration:2500,isClosable:!0})},[h,s,f,r,n,c]);const _=()=>{h&&t(d3(h))};de("Shift+R",()=>{o&&!f&&r&&!n&&u?_():S({title:C("toast.faceRestoreFailed"),status:"error",duration:2500,isClosable:!0})},[h,o,f,r,n,u]);const R=()=>t(D1(!p)),V=()=>{h&&(y&&t(Vo(!1)),t(xc(h)),t(cn()),x!=="unifiedCanvas"&&t(jn("unifiedCanvas")),S({title:C("toast.sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0}))};de("i",()=>{h?R():S({title:C("toast.metadataLoadFailed"),status:"error",duration:2500,isClosable:!0})},[h,p]);const F=()=>{t(Vo(!y))};return l.jsxs(B,{sx:{justifyContent:"center",alignItems:"center",columnGap:"0.5em"},...e,children:[l.jsxs(Qt,{isAttached:!0,children:[l.jsx(rr,{trigger:"hover",triggerComponent:l.jsx(se,{"aria-label":`${C("parameters.sendTo")}...`,icon:l.jsx(W9,{})}),children:l.jsxs(B,{sx:{flexDirection:"column",rowGap:2},children:[l.jsx(Je,{size:"sm",onClick:w,leftIcon:l.jsx(e0,{}),children:C("parameters.sendToImg2Img")}),l.jsx(Je,{size:"sm",onClick:V,leftIcon:l.jsx(e0,{}),children:C("parameters.sendToUnifiedCanvas")}),l.jsx(Je,{size:"sm",onClick:j,leftIcon:l.jsx(Ki,{}),children:C("parameters.copyImage")}),l.jsx(Je,{size:"sm",onClick:I,leftIcon:l.jsx(Ki,{}),children:C("parameters.copyImageToLink")}),l.jsx(Go,{download:!0,href:h==null?void 0:h.url,children:l.jsx(Je,{leftIcon:l.jsx(Xh,{}),size:"sm",w:"100%",children:C("parameters.downloadImage")})})]})}),l.jsx(se,{icon:l.jsx(E9,{}),tooltip:y?`${C("parameters.closeViewer")} (Z)`:`${C("parameters.openInViewer")} (Z)`,"aria-label":y?`${C("parameters.closeViewer")} (Z)`:`${C("parameters.openInViewer")} (Z)`,isChecked:y,onClick:F})]}),l.jsxs(Qt,{isAttached:!0,children:[l.jsx(se,{icon:l.jsx(N9,{}),tooltip:`${C("parameters.usePrompt")} (P)`,"aria-label":`${C("parameters.usePrompt")} (P)`,isDisabled:!((K=(U=h==null?void 0:h.metadata)==null?void 0:U.image)!=null&&K.prompt),onClick:T}),l.jsx(se,{icon:l.jsx(H9,{}),tooltip:`${C("parameters.useSeed")} (S)`,"aria-label":`${C("parameters.useSeed")} (S)`,isDisabled:!((ne=(te=h==null?void 0:h.metadata)==null?void 0:te.image)!=null&&ne.seed),onClick:M}),l.jsx(se,{icon:l.jsx(C9,{}),tooltip:`${C("parameters.useAll")} (A)`,"aria-label":`${C("parameters.useAll")} (A)`,isDisabled:!["txt2img","img2img"].includes((Z=($=h==null?void 0:h.metadata)==null?void 0:$.image)==null?void 0:Z.type),onClick:P})]}),l.jsxs(Qt,{isAttached:!0,children:[l.jsx(rr,{trigger:"hover",triggerComponent:l.jsx(se,{icon:l.jsx(M9,{}),"aria-label":C("parameters.restoreFaces")}),children:l.jsxs(B,{sx:{flexDirection:"column",rowGap:4},children:[l.jsx(pp,{}),l.jsx(Je,{isDisabled:!o||!h||!(r&&!n)||!u,onClick:_,children:C("parameters.restoreFaces")})]})}),l.jsx(rr,{trigger:"hover",triggerComponent:l.jsx(se,{icon:l.jsx(j9,{}),"aria-label":C("parameters.upscale")}),children:l.jsxs(B,{sx:{flexDirection:"column",gap:4},children:[l.jsx(mp,{}),l.jsx(Je,{isDisabled:!s||!h||!(r&&!n)||!c,onClick:D,children:C("parameters.upscaleImage")})]})})]}),l.jsx(Qt,{isAttached:!0,children:l.jsx(se,{icon:l.jsx(Fx,{}),tooltip:`${C("parameters.info")} (I)`,"aria-label":`${C("parameters.info")} (I)`,isChecked:p,onClick:R})}),l.jsx(hc,{image:h,children:l.jsx(se,{icon:l.jsx(ri,{}),tooltip:`${C("parameters.deleteImage")} (Del)`,"aria-label":`${C("parameters.deleteImage")} (Del)`,isDisabled:!h||!r||n,colorScheme:"error"})})]})};function CA(e){return ve({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M245.09 327.74v-37.32c57.07 0 84.51 13.47 108.58 38.68 5.4 5.65 15 1.32 14.29-6.43-5.45-61.45-34.14-117.09-122.87-117.09v-37.32a8.32 8.32 0 00-14.05-6L146.58 242a8.2 8.2 0 000 11.94L231 333.71a8.32 8.32 0 0014.09-5.97z"}},{tag:"path",attr:{fill:"none",strokeMiterlimit:"10",strokeWidth:"32",d:"M256 64C150 64 64 150 64 256s86 192 192 192 192-86 192-192S362 64 256 64z"}}]})(e)}const yt=({label:e,value:t,onClick:n,isLink:r,labelPosition:o,withCopy:s=!1})=>{const{t:c}=X();return l.jsxs(B,{gap:2,children:[n&&l.jsx(Gt,{label:`Recall ${e}`,children:l.jsx(fo,{"aria-label":c("accessibility.useThisParameter"),icon:l.jsx(CA,{}),size:"xs",variant:"ghost",fontSize:20,onClick:n})}),s&&l.jsx(Gt,{label:`Copy ${e}`,children:l.jsx(fo,{"aria-label":`Copy ${e}`,icon:l.jsx(Ki,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(t.toString())})}),l.jsxs(B,{direction:o?"column":"row",children:[l.jsxs(Ce,{fontWeight:"semibold",whiteSpace:"pre-wrap",pr:2,children:[e,":"]}),r?l.jsxs(Go,{href:t.toString(),isExternal:!0,wordBreak:"break-all",children:[t.toString()," ",l.jsx(j4,{mx:"2px"})]}):l.jsx(Ce,{overflowY:"scroll",wordBreak:"break-all",children:t.toString()})]})]})},wA=(e,t)=>e.image.uuid===t.image.uuid,yp=g.memo(({image:e})=>{var F,L;const t=Y(),n=gp();de("esc",()=>{t(D1(!1))});const r=((F=e==null?void 0:e.metadata)==null?void 0:F.image)||{},o=e==null?void 0:e.dreamPrompt,{cfg_scale:s,fit:c,height:u,hires_fix:f,init_image_path:p,mask_image_path:h,orig_path:y,perlin:x,postprocessing:S,prompt:C,sampler:k,seamless:w,seed:j,steps:I,strength:P,threshold:M,type:T,variations:D,width:_}=r,{t:R}=X(),V=JSON.stringify(e.metadata,null,2);return l.jsxs(B,{sx:{padding:4,gap:1,flexDirection:"column",width:"full",height:"full",backdropFilter:"blur(20px)",bg:"whiteAlpha.600",_dark:{bg:"blackAlpha.600"}},children:[l.jsxs(B,{gap:2,children:[l.jsx(Ce,{fontWeight:"semibold",children:"File:"}),l.jsxs(Go,{href:e.url,isExternal:!0,maxW:"calc(100% - 3rem)",children:[e.url.length>64?e.url.substring(0,64).concat("..."):e.url,l.jsx(j4,{mx:"2px"})]})]}),Object.keys(r).length>0?l.jsxs(l.Fragment,{children:[T&&l.jsx(yt,{label:"Generation type",value:T}),((L=e.metadata)==null?void 0:L.model_weights)&&l.jsx(yt,{label:"Model",value:e.metadata.model_weights}),["esrgan","gfpgan"].includes(T)&&l.jsx(yt,{label:"Original image",value:y}),C&&l.jsx(yt,{label:"Prompt",labelPosition:"top",value:typeof C=="string"?C:I1(C),onClick:()=>n(C)}),j!==void 0&&l.jsx(yt,{label:"Seed",value:j,onClick:()=>t(os(j))}),M!==void 0&&l.jsx(yt,{label:"Noise Threshold",value:M,onClick:()=>t(Jd(M))}),x!==void 0&&l.jsx(yt,{label:"Perlin Noise",value:x,onClick:()=>t(ef(x))}),k&&l.jsx(yt,{label:"Sampler",value:k,onClick:()=>t(A1(k))}),I&&l.jsx(yt,{label:"Steps",value:I,onClick:()=>t(tf(I))}),s!==void 0&&l.jsx(yt,{label:"CFG scale",value:s,onClick:()=>t(nf(s))}),D&&D.length>0&&l.jsx(yt,{label:"Seed-weight pairs",value:Mv(D),onClick:()=>t(O1(Mv(D)))}),w&&l.jsx(yt,{label:"Seamless",value:w,onClick:()=>t(z1(w))}),f&&l.jsx(yt,{label:"High Resolution Optimization",value:f,onClick:()=>t(R1(f))}),_&&l.jsx(yt,{label:"Width",value:_,onClick:()=>t(Fl(_))}),u&&l.jsx(yt,{label:"Height",value:u,onClick:()=>t(Ll(u))}),p&&l.jsx(yt,{label:"Initial image",value:p,isLink:!0,onClick:()=>t(ns(p))}),h&&l.jsx(yt,{label:"Mask image",value:h,isLink:!0,onClick:()=>t(f3(h))}),T==="img2img"&&P&&l.jsx(yt,{label:"Image to image strength",value:P,onClick:()=>t(rf(P))}),c&&l.jsx(yt,{label:"Image to image fit",value:c,onClick:()=>t(N1(c))}),S&&S.length>0&&l.jsxs(l.Fragment,{children:[l.jsx(Wn,{size:"sm",children:"Postprocessing"}),S.map((Q,U)=>{if(Q.type==="esrgan"){const{scale:K,strength:te,denoise_str:ne}=Q;return l.jsxs(B,{pl:8,gap:1,direction:"column",children:[l.jsx(Ce,{size:"md",children:`${U+1}: Upscale (ESRGAN)`}),l.jsx(yt,{label:"Scale",value:K,onClick:()=>t(P1(K))}),l.jsx(yt,{label:"Strength",value:te,onClick:()=>t(Zd(te))}),ne!==void 0&&l.jsx(yt,{label:"Denoising strength",value:ne,onClick:()=>t(Qd(ne))})]},U)}else if(Q.type==="gfpgan"){const{strength:K}=Q;return l.jsxs(B,{pl:8,gap:1,direction:"column",children:[l.jsx(Ce,{size:"md",children:`${U+1}: Face restoration (GFPGAN)`}),l.jsx(yt,{label:"Strength",value:K,onClick:()=>{t(Yl(K)),t(Nl("gfpgan"))}})]},U)}else if(Q.type==="codeformer"){const{strength:K,fidelity:te}=Q;return l.jsxs(B,{pl:8,gap:1,direction:"column",children:[l.jsx(Ce,{size:"md",children:`${U+1}: Face restoration (Codeformer)`}),l.jsx(yt,{label:"Strength",value:K,onClick:()=>{t(Yl(K)),t(Nl("codeformer"))}}),te&&l.jsx(yt,{label:"Fidelity",value:te,onClick:()=>{t(Xd(te)),t(Nl("codeformer"))}})]},U)}})]}),o&&l.jsx(yt,{withCopy:!0,label:"Dream Prompt",value:o}),l.jsxs(B,{gap:2,direction:"column",children:[l.jsxs(B,{gap:2,children:[l.jsx(Gt,{label:"Copy metadata JSON",children:l.jsx(fo,{"aria-label":R("accessibility.copyMetadataJson"),icon:l.jsx(Ki,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(V)})}),l.jsx(Ce,{fontWeight:"semibold",children:"Metadata JSON:"})]}),l.jsx(Ye,{sx:{mt:0,mr:2,mb:4,ml:2,padding:4,borderRadius:"base",overflowX:"scroll",wordBreak:"break-all",bg:"whiteAlpha.500",_dark:{bg:"blackAlpha.500"}},children:l.jsx("pre",{children:V})})]})]}):l.jsx(xy,{width:"100%",pt:10,children:l.jsx(Ce,{fontSize:"lg",fontWeight:"semibold",children:"No metadata available"})})]})},wA);yp.displayName="ImageMetadataViewer";const V0={height:"100%",width:"15%",alignItems:"center",pointerEvents:"auto"},U0={color:"base.100"},kA=me(Gr,e=>{const{currentImage:t}=e,n=e.categories[t?t.category:"result"].images,r=n.findIndex(s=>{var c;return s.uuid===((c=e==null?void 0:e.currentImage)==null?void 0:c.uuid)}),o=n.length;return{isOnFirstImage:r===0,isOnLastImage:!isNaN(r)&&r===o-1}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),A4=()=>{const e=Y(),{t}=X(),{isOnFirstImage:n,isOnLastImage:r}=A(kA),[o,s]=g.useState(!1),c=()=>{s(!0)},u=()=>{s(!1)},f=()=>{e(F1())},p=()=>{e(L1())};return l.jsxs(B,{sx:{justifyContent:"space-between",zIndex:1,height:"100%",width:"100%",pointerEvents:"none"},children:[l.jsx(or,{sx:{...V0,justifyContent:"flex-start"},onMouseOver:c,onMouseOut:u,children:o&&!n&&l.jsx(fo,{"aria-label":t("accessibility.previousImage"),icon:l.jsx(y9,{size:64}),variant:"unstyled",onClick:f,boxSize:16,sx:U0})}),l.jsx(or,{sx:{...V0,justifyContent:"flex-end"},onMouseOver:c,onMouseOut:u,children:o&&!r&&l.jsx(fo,{"aria-label":t("accessibility.nextImage"),icon:l.jsx(x9,{size:64}),variant:"unstyled",onClick:p,boxSize:16,sx:U0})})]})},jA=me([Gr,Er],(e,t)=>{const{currentImage:n,intermediateImage:r}=e,{shouldShowImageDetails:o}=t;return{imageToDisplay:r||n,isIntermediate:Boolean(r),shouldShowImageDetails:o}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}});function EA(){const{shouldShowImageDetails:e,imageToDisplay:t,isIntermediate:n}=A(jA);return l.jsxs(B,{sx:{position:"relative",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},children:[t&&l.jsx(ls,{src:t.url,width:t.width,height:t.height,sx:{objectFit:"contain",maxWidth:"100%",maxHeight:"100%",height:"auto",position:"absolute",imageRendering:n?"pixelated":"initial",borderRadius:"base"}}),!e&&l.jsx(A4,{}),e&&t&&l.jsx(Ye,{sx:{position:"absolute",top:"0",width:"100%",height:"100%",borderRadius:"base",overflow:"scroll",maxHeight:tP},children:l.jsx(yp,{image:t})})]})}const PA=me([Gr],e=>{const{currentImage:t,intermediateImage:n}=e;return{hasAnImageToDisplay:t||n}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),O4=()=>{const{hasAnImageToDisplay:e}=A(PA);return l.jsx(B,{sx:{flexDirection:"column",height:"100%",width:"100%",rowGap:4,borderRadius:"base"},children:e?l.jsxs(l.Fragment,{children:[l.jsx(D4,{}),l.jsx(EA,{})]}):l.jsx(B,{sx:{alignItems:"center",justifyContent:"center",width:"100%",height:"100%"},children:l.jsx(tn,{as:VD,sx:{boxSize:24,color:"base.500"}})})})},IA=()=>{const{t:e}=X(),t=g.useContext(qh);return l.jsx(se,{"aria-label":e("accessibility.uploadImage"),tooltip:"Upload Image",icon:l.jsx(Oc,{}),onClick:t||void 0})};function MA(){const e=A(s=>s.generation.initialImage),{t}=X(),n=Y(),r=ss(),o=()=>{r({title:t("toast.parametersFailed"),description:t("toast.parametersFailedDesc"),status:"error",isClosable:!0}),n(h3())};return l.jsxs(l.Fragment,{children:[l.jsxs(B,{sx:{alignItems:"center",justifyContent:"center",w:"100%",gap:4},children:[l.jsx(Ce,{sx:{fontSize:"lg"},variant:"subtext",children:t("parameters.initialImage")}),l.jsx(IA,{})]}),e&&l.jsx(B,{sx:{position:"relative",height:"100%",width:"100%",alignItems:"center",justifyContent:"center"},children:l.jsx(ls,{sx:{fit:"contain",maxWidth:"100%",maxHeight:"100%",borderRadius:"base",objectFit:"contain",position:"absolute"},src:typeof e=="string"?e:e.url,onError:o})})]})}const $0={flexDirection:"column",height:"100%",width:"100%",gap:4,padding:4},TA=()=>{const t=A(n=>n.generation.initialImage)?l.jsx(B,{flexDirection:"column",gap:4,w:"100%",h:"100%",children:l.jsx(MA,{})}):l.jsx(hA,{});return l.jsxs(or,{sx:{w:"100%",h:"100%",gridTemplateColumns:"1fr 1fr",borderRadius:"base",bg:"base.850"},children:[l.jsx(B,{sx:{...$0,paddingInlineEnd:2},children:t}),l.jsx(B,{sx:{...$0,paddingInlineStart:2},children:l.jsx(O4,{})})]})};var ln=(e=>(e[e.PROMPT=0]="PROMPT",e[e.GALLERY=1]="GALLERY",e[e.OTHER=2]="OTHER",e[e.SEED=3]="SEED",e[e.VARIATIONS=4]="VARIATIONS",e[e.UPSCALE=5]="UPSCALE",e[e.FACE_CORRECTION=6]="FACE_CORRECTION",e[e.IMAGE_TO_IMAGE=7]="IMAGE_TO_IMAGE",e[e.BOUNDING_BOX=8]="BOUNDING_BOX",e[e.SEAM_CORRECTION=9]="SEAM_CORRECTION",e[e.INFILL_AND_SCALING=10]="INFILL_AND_SCALING",e))(ln||{});const _A=()=>{const{t:e}=X();return g.useMemo(()=>({[0]:{text:e("tooltip.feature.prompt"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[1]:{text:e("tooltip.feature.gallery"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[2]:{text:e("tooltip.feature.other"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[3]:{text:e("tooltip.feature.seed"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[4]:{text:e("tooltip.feature.variations"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[5]:{text:e("tooltip.feature.upscale"),href:"link/to/docs/feature1.html",guideImage:"asset/path.gif"},[6]:{text:e("tooltip.feature.faceCorrection"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[7]:{text:e("tooltip.feature.imageToImage"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[8]:{text:e("tooltip.feature.boundingBox"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[9]:{text:e("tooltip.feature.seamCorrection"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[10]:{text:e("tooltip.feature.infillAndScaling"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}}),[e])},DA=e=>_A()[e];function z4(){const e=A(o=>o.system.isGFPGANAvailable),t=A(o=>o.postprocessing.shouldRunFacetool),n=Y(),r=o=>n(p3(o.target.checked));return l.jsx(En,{isDisabled:!e,isChecked:t,onChange:r})}const R4=()=>{const e=Y(),t=A(o=>o.generation.seamless),n=o=>e(z1(o.target.checked)),{t:r}=X();return l.jsx(En,{label:r("parameters.seamlessTiling"),fontSize:"md",isChecked:t,onChange:n})},AA=()=>l.jsx(ze,{gap:2,alignItems:"stretch",children:l.jsx(R4,{})});function xp(){const e=A(s=>s.generation.horizontalSymmetrySteps),t=A(s=>s.generation.verticalSymmetrySteps),n=A(s=>s.generation.steps),r=Y(),{t:o}=X();return l.jsxs(ze,{gap:2,alignItems:"stretch",children:[l.jsx(ut,{label:o("parameters.hSymmetryStep"),value:e,onChange:s=>r(Tv(s)),min:0,max:n,step:1,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>r(Tv(0))}),l.jsx(ut,{label:o("parameters.vSymmetryStep"),value:t,onChange:s=>r(_v(s)),min:0,max:n,step:1,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>r(_v(0))})]})}function bp(){const e=A(n=>n.generation.shouldUseSymmetry),t=Y();return l.jsx(En,{isChecked:e,onChange:n=>t(m3(n.target.checked))})}function OA(){const e=Y(),t=A(r=>r.generation.perlin),{t:n}=X();return l.jsx(ut,{label:n("parameters.perlinNoise"),min:0,max:1,step:.05,onChange:r=>e(ef(r)),handleReset:()=>e(ef(0)),value:t,withInput:!0,withReset:!0,withSliderMarks:!0})}function zA(){const e=Y(),{t}=X(),n=A(o=>o.generation.shouldRandomizeSeed),r=o=>e(v3(o.target.checked));return l.jsx(En,{label:t("parameters.randomizeSeed"),isChecked:n,onChange:r})}function RA(){const e=Y(),t=A(o=>o.generation.shouldRandomizeSeed),{t:n}=X(),r=()=>e(os(g3(H1,B1)));return l.jsx(ti,{size:"sm",isDisabled:t,onClick:r,padding:"0 1.5rem",children:l.jsx("p",{children:n("parameters.shuffle")})})}function NA(){const e=A(c=>c.generation.seed),t=A(c=>c.generation.shouldRandomizeSeed),n=A(c=>c.generation.shouldGenerateVariations),{t:r}=X(),o=Y(),s=c=>o(os(c));return l.jsxs(ra,{gap:2,children:[l.jsx(Wr,{label:r("parameters.seed"),step:1,precision:0,flexGrow:1,min:H1,max:B1,isDisabled:t,isInvalid:e<0&&n,onChange:s,value:e,formControlProps:{display:"flex",alignItems:"center",gap:3}}),l.jsx(RA,{})]})}function FA(){const e=Y(),t=A(r=>r.generation.threshold),{t:n}=X();return l.jsx(ut,{label:n("parameters.noiseThreshold"),min:0,max:20,step:.1,onChange:r=>e(Jd(r)),handleReset:()=>e(Jd(0)),value:t,withInput:!0,withReset:!0,withSliderMarks:!0})}const Sp=()=>l.jsxs(ze,{gap:2,alignItems:"stretch",children:[l.jsx(zA,{}),l.jsx(NA,{}),l.jsx(FA,{}),l.jsx(OA,{})]});function N4(){const e=A(o=>o.system.isESRGANAvailable),t=A(o=>o.postprocessing.shouldRunESRGAN),n=Y(),r=o=>n(y3(o.target.checked));return l.jsx(En,{isDisabled:!e,isChecked:t,onChange:r})}function Cp(){const e=A(r=>r.generation.shouldGenerateVariations),t=Y(),n=r=>t(x3(r.target.checked));return l.jsx(En,{isChecked:e,width:"auto",onChange:n})}function LA(){const e=A(s=>s.generation.seedWeights),t=A(s=>s.generation.shouldGenerateVariations),{t:n}=X(),r=Y(),o=s=>r(O1(s.target.value));return l.jsx(mt,{label:n("parameters.seedWeights"),value:e,isInvalid:t&&!(W1(e)||e===""),isDisabled:!t,onChange:o})}function BA(){const e=A(o=>o.generation.variationAmount),t=A(o=>o.generation.shouldGenerateVariations),{t:n}=X(),r=Y();return l.jsx(ut,{label:n("parameters.variationAmount"),value:e,step:.01,min:0,max:1,isSliderDisabled:!t,isInputDisabled:!t,isResetDisabled:!t,onChange:o=>r(Dv(o)),handleReset:()=>r(Dv(.1)),withInput:!0,withReset:!0,withSliderMarks:!0})}const wp=()=>l.jsxs(ze,{gap:2,alignItems:"stretch",children:[l.jsx(BA,{}),l.jsx(LA,{})]});function G0(){const e=Y(),t=A(s=>s.generation.cfgScale),n=A(s=>s.ui.shouldUseSliders),{t:r}=X(),o=s=>e(nf(s));return n?l.jsx(ut,{label:r("parameters.cfgScale"),step:.5,min:1.01,max:30,onChange:o,handleReset:()=>e(nf(7.5)),value:t,sliderNumberInputProps:{max:200},withInput:!0,withReset:!0,withSliderMarks:!0}):l.jsx(Wr,{label:r("parameters.cfgScale"),step:.5,min:1.01,max:200,onChange:o,value:t,isInteger:!1,numberInputFieldProps:{textAlign:"center"}})}function q0(){const e=A(s=>s.generation.height),t=A(s=>s.ui.shouldUseSliders),n=A(bt),r=Y(),{t:o}=X();return t?l.jsx(ut,{isSliderDisabled:n==="unifiedCanvas",isInputDisabled:n==="unifiedCanvas",isResetDisabled:n==="unifiedCanvas",label:o("parameters.height"),value:e,min:64,step:64,max:2048,onChange:s=>r(Ll(s)),handleReset:()=>r(Ll(512)),withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:15360}}):l.jsx(Mn,{isDisabled:n==="unifiedCanvas",label:o("parameters.height"),value:e,flexGrow:1,onChange:s=>r(Ll(Number(s.target.value))),validValues:b3})}function Y0(){const e=A(s=>s.generation.iterations),t=A(s=>s.ui.shouldUseSliders),n=Y(),{t:r}=X(),o=s=>n(Av(s));return t?l.jsx(ut,{label:r("parameters.images"),step:1,min:1,max:16,onChange:o,handleReset:()=>n(Av(1)),value:e,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:9999}}):l.jsx(Wr,{label:r("parameters.images"),step:1,min:1,max:9999,onChange:o,value:e,numberInputFieldProps:{textAlign:"center"}})}function K0(){const e=A(s=>s.generation.sampler),t=A($x),n=Y(),{t:r}=X(),o=s=>n(A1(s.target.value));return l.jsx(Mn,{label:r("parameters.sampler"),value:e,onChange:o,validValues:t.format==="diffusers"?S3:C3,minWidth:36})}function X0(){const e=Y(),t=A(c=>c.generation.steps),n=A(c=>c.ui.shouldUseSliders),{t:r}=X(),o=c=>{e(tf(c))},s=()=>{e(V1())};return n?l.jsx(ut,{label:r("parameters.steps"),min:1,step:1,onChange:o,handleReset:()=>e(tf(20)),value:t,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:9999}}):l.jsx(Wr,{label:r("parameters.steps"),min:1,max:9999,step:1,onChange:o,value:t,numberInputFieldProps:{textAlign:"center"},onBlur:s})}function Q0(){const e=A(s=>s.generation.width),t=A(s=>s.ui.shouldUseSliders),n=A(bt),{t:r}=X(),o=Y();return t?l.jsx(ut,{isSliderDisabled:n==="unifiedCanvas",isInputDisabled:n==="unifiedCanvas",isResetDisabled:n==="unifiedCanvas",label:r("parameters.width"),value:e,min:64,step:64,max:2048,onChange:s=>o(Fl(s)),handleReset:()=>o(Fl(512)),withInput:!0,withReset:!0,withSliderMarks:!0,inputReadOnly:!0,sliderNumberInputProps:{max:15360}}):l.jsx(Mn,{isDisabled:n==="unifiedCanvas",label:r("parameters.width"),value:e,flexGrow:1,onChange:s=>o(Fl(Number(s.target.value))),validValues:w3})}function kp(){return A(t=>t.ui.shouldUseSliders)?l.jsxs(ze,{gap:2,children:[l.jsx(Y0,{}),l.jsx(X0,{}),l.jsx(G0,{}),l.jsx(Q0,{}),l.jsx(q0,{}),l.jsx(K0,{})]}):l.jsxs(B,{rowGap:2,flexDirection:"column",children:[l.jsxs(B,{columnGap:1,children:[l.jsx(Y0,{}),l.jsx(X0,{}),l.jsx(G0,{})]}),l.jsxs(B,{columnGap:1,children:[l.jsx(Q0,{}),l.jsx(q0,{}),l.jsx(K0,{})]})]})}const HA=me(Et,e=>e.shouldDisplayGuides),WA=({children:e,feature:t})=>{const n=A(HA),{text:r}=DA(t);return n?l.jsxs(Vh,{trigger:"hover",isLazy:!0,children:[l.jsx(Wh,{children:l.jsx(Ye,{children:e})}),l.jsxs($h,{maxWidth:"400px",onClick:o=>o.preventDefault(),cursor:"initial",children:[l.jsx(Uh,{}),l.jsx(Ky,{children:r})]})]}):null},VA=g.memo(WA),UA=fe(({feature:e,icon:t=RD},n)=>l.jsx(VA,{feature:e,children:l.jsx(Ye,{ref:n,children:l.jsx(tn,{marginBottom:"-.15rem",as:t})})})),$A=g.memo(UA);function GA(e){const{header:t,feature:n,content:r,additionalHeaderComponents:o}=e;return l.jsxs(Oi,{children:[l.jsx(Di,{children:l.jsxs(B,{width:"100%",gap:2,align:"center",children:[l.jsx(Ye,{flexGrow:1,textAlign:"start",children:t}),o,n&&l.jsx($A,{feature:n}),l.jsx(Ai,{})]})}),l.jsx(zi,{children:r})]})}const jp=e=>{const{accordionInfo:t}=e,n=A(c=>c.system.openAccordions),r=Y(),o=c=>r(k3(c)),s=()=>{const c=[];return t&&Object.keys(t).forEach(u=>{const{header:f,feature:p,content:h,additionalHeaderComponents:y}=t[u];c.push(l.jsx(GA,{header:f,feature:p,content:h,additionalHeaderComponents:y},u))}),c};return l.jsx(oh,{defaultIndex:n,allowMultiple:!0,reduceMotion:!0,onChange:o,sx:{display:"flex",flexDirection:"column",gap:2},children:s()})},qA=e=>{const{menuType:t="icon",iconTooltip:n,buttonText:r,isLazy:o=!0,menuItems:s,menuProps:c,menuButtonProps:u,menuListProps:f,menuItemProps:p}=e,h=()=>{const y=[];return s.forEach((x,S)=>{y.push(l.jsx(vr,{onClick:x.onClick,fontSize:"sm",...p,children:x.item},S))}),y};return l.jsx(Dh,{...c,isLazy:o,children:({isOpen:y})=>l.jsxs(l.Fragment,{children:[l.jsx(Oh,{as:t==="icon"?fo:ti,tooltip:n,"aria-label":n,icon:y?l.jsx($D,{}):l.jsx(UD,{}),paddingX:0,paddingY:t==="regular"?2:0,...u,children:t==="regular"&&r}),l.jsx(Ah,{zIndex:15,padding:0,...f,children:h()})]})})},YA=g.memo(qA),KA=me(Et,e=>({isProcessing:e.isProcessing,isConnected:e.isConnected,isCancelable:e.isCancelable,currentIteration:e.currentIteration,totalIterations:e.totalIterations,cancelType:e.cancelOptions.cancelType,cancelAfter:e.cancelOptions.cancelAfter}),{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),XA=e=>{const t=Y(),{btnGroupWidth:n="auto",...r}=e,{isProcessing:o,isConnected:s,isCancelable:c,currentIteration:u,totalIterations:f,cancelType:p,cancelAfter:h}=A(KA),y=g.useCallback(()=>{t(j3()),t(ud(null))},[t]),{t:x}=X(),S=h!==null;de("shift+x",()=>{(s||o)&&c&&y()},[s,o,c]),g.useEffect(()=>{h!==null&&h<u&&y()},[h,u,y]);const C=[{item:x("parameters.cancel.immediate"),onClick:()=>t(Ov("immediate"))},{item:x("parameters.cancel.schedule"),onClick:()=>t(Ov("scheduled"))}];return l.jsxs(Qt,{isAttached:!0,width:n,children:[p==="immediate"?l.jsx(se,{icon:l.jsx(GD,{}),tooltip:x("parameters.cancel.immediate"),"aria-label":x("parameters.cancel.immediate"),isDisabled:!s||!o||!c,onClick:y,colorScheme:"error",...r}):l.jsx(se,{icon:S?l.jsx(tc,{}):l.jsx(zD,{}),tooltip:x(S?"parameters.cancel.isScheduled":"parameters.cancel.schedule"),"aria-label":x(S?"parameters.cancel.isScheduled":"parameters.cancel.schedule"),isDisabled:!s||!o||!c||u===f,onClick:()=>{t(S?ud(null):ud(u))},colorScheme:"error",...r}),l.jsx(YA,{menuItems:C,iconTooltip:x("parameters.cancel.setType"),menuButtonProps:{colorScheme:"error",minWidth:5}})]})},Ep=g.memo(XA),tt=e=>e.canvas,Ot=me([tt,bt,Et],(e,t,n)=>e.layerState.stagingArea.images.length>0||t==="unifiedCanvas"&&n.isProcessing),F4=e=>e.canvas.layerState.objects.find(U1),Pp=e=>e.generation;me(Pp,({shouldRandomizeSeed:e,shouldGenerateVariations:t})=>e||t,{memoizeOptions:{resultEqualityCheck:ee.isEqual}});const L4=me([Pp,Et,F4,bt],(e,t,n,r)=>{const{prompt:o,shouldGenerateVariations:s,seedWeights:c,initialImage:u,seed:f}=e,{isProcessing:p,isConnected:h}=t;let y=!0;const x=[];return(!o||Boolean(o.match(/^[\s\r\n]+$/)))&&(y=!1,x.push("Missing prompt")),r==="img2img"&&!u&&(y=!1,x.push("No initial image selected")),p&&(y=!1,x.push("System Busy")),h||(y=!1,x.push("System Disconnected")),s&&(!(W1(c)||c==="")||f===-1)&&(y=!1,x.push("Seed-Weights badly formatted.")),{isReady:y,reasonsWhyNotReady:x}},{memoizeOptions:{equalityCheck:ee.isEqual,resultEqualityCheck:ee.isEqual}});function Ip(e){const{iconButton:t=!1,...n}=e,r=Y(),{isReady:o}=A(L4),s=A(bt),c=()=>{r(of(s))},{t:u}=X();return de(["ctrl+enter","meta+enter"],()=>{r(V1()),r(of(s))},{enabled:()=>o,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[o,s]),l.jsx(Ye,{style:{flexGrow:4},children:t?l.jsx(se,{"aria-label":u("parameters.invoke"),type:"submit",icon:l.jsx(R9,{}),isDisabled:!o,onClick:c,flexGrow:1,w:"100%",tooltip:u("parameters.invoke"),tooltipProps:{placement:"bottom"},colorScheme:"accent",...n}):l.jsx(Je,{"aria-label":u("parameters.invoke"),type:"submit",isDisabled:!o,onClick:c,flexGrow:1,w:"100%",colorScheme:"accent",fontWeight:700,...n,children:"Invoke"})})}const QA=me(vp,({shouldLoopback:e})=>e),ZA=()=>{const e=Y(),t=A(QA),{t:n}=X();return l.jsx(se,{"aria-label":n("parameters.toggleLoopback"),tooltip:n("parameters.toggleLoopback"),isChecked:t,icon:l.jsx(F9,{}),onClick:()=>{e(E3(!t))}})},Mp=()=>{const e=A(bt);return l.jsxs(B,{gap:2,children:[l.jsx(Ip,{}),e==="img2img"&&l.jsx(ZA,{}),l.jsx(Ep,{})]})},Tp=()=>{const e=A(r=>r.generation.negativePrompt),t=Y(),{t:n}=X();return l.jsx(rt,{children:l.jsx(Gh,{id:"negativePrompt",name:"negativePrompt",value:e,onChange:r=>t(T1(r.target.value)),placeholder:n("parameters.negativePrompts"),_focusVisible:{borderColor:"error.600"},fontSize:"sm"})})},JA=me([e=>e.generation,bt],(e,t)=>({prompt:e.prompt,activeTabName:t}),{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),_p=()=>{const e=Y(),{prompt:t,activeTabName:n}=A(JA),{isReady:r}=A(L4),o=g.useRef(null),{t:s}=X(),c=f=>{e(M1(f.target.value))};de("alt+a",()=>{var f;(f=o.current)==null||f.focus()},[]);const u=f=>{f.key==="Enter"&&f.shiftKey===!1&&r&&(f.preventDefault(),e(of(n)))};return l.jsx(Ye,{children:l.jsx(rt,{isInvalid:t.length===0||Boolean(t.match(/^[\s\r\n]+$/)),children:l.jsx(Gh,{id:"prompt",name:"prompt",placeholder:s("parameters.promptPlaceholder"),value:t,onChange:c,onKeyDown:u,resize:"vertical",ref:o,minH:40})})})};function eO(){const e=Y(),t=A(o=>o.generation.shouldFitToWidthHeight),n=o=>e(N1(o.target.checked)),{t:r}=X();return l.jsx(En,{label:r("parameters.imageFit"),isChecked:t,onChange:n})}function B4(e){const{t}=X(),{label:n=`${t("parameters.strength")}`}=e,r=A(u=>u.generation.img2imgStrength),o=Y(),s=u=>o(rf(u)),c=()=>{o(rf(.75))};return l.jsx(ut,{label:n,step:.01,min:.01,max:1,onChange:s,value:r,isInteger:!1,withInput:!0,withSliderMarks:!0,inputWidth:22,withReset:!0,handleReset:c})}function tO(){const{t:e}=X();return l.jsxs(ze,{gap:2,alignItems:"stretch",children:[l.jsx(B4,{label:e("parameters.img2imgStrength")}),l.jsx(eO,{})]})}const nO=()=>{const{t:e}=X(),t={general:{header:`${e("parameters.general")}`,feature:void 0,content:l.jsx(kp,{})},imageToImage:{header:`${e("parameters.imageToImage")}`,feature:void 0,content:l.jsx(tO,{})},seed:{header:`${e("parameters.seed")}`,feature:ln.SEED,content:l.jsx(Sp,{})},variations:{header:`${e("parameters.variations")}`,feature:ln.VARIATIONS,content:l.jsx(wp,{}),additionalHeaderComponents:l.jsx(Cp,{})},face_restore:{header:`${e("parameters.faceRestoration")}`,feature:ln.FACE_CORRECTION,content:l.jsx(pp,{}),additionalHeaderComponents:l.jsx(z4,{})},upscale:{header:`${e("parameters.upscaling")}`,feature:ln.UPSCALE,content:l.jsx(mp,{}),additionalHeaderComponents:l.jsx(N4,{})},symmetry:{header:`${e("parameters.symmetry")}`,content:l.jsx(xp,{}),additionalHeaderComponents:l.jsx(bp,{})},other:{header:`${e("parameters.otherOptions")}`,feature:ln.OTHER,content:l.jsx(AA,{})}};return l.jsxs(B,{flexDir:"column",gap:2,position:"relative",children:[l.jsx(_p,{}),l.jsx(Tp,{}),l.jsx(Mp,{}),l.jsx(jp,{accordionInfo:t})]})},rO=g.memo(nO);function oO(){return l.jsx(hp,{parametersPanelContent:l.jsx(rO,{}),children:l.jsx(TA,{})})}const iO=()=>l.jsx(Ye,{sx:{width:"100%",height:"100%",borderRadius:"base",bg:"base.850"},children:l.jsx(B,{sx:{p:4,width:"100%",height:"100%"},children:l.jsx(O4,{})})}),aO=me([vp],({hiresFix:e,hiresStrength:t})=>({hiresFix:e,hiresStrength:t}),{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),sO=()=>{const{hiresFix:e,hiresStrength:t}=A(aO),n=Y(),{t:r}=X(),o=c=>{n(zv(c))},s=()=>{n(zv(.75))};return l.jsx(ut,{label:r("parameters.hiresStrength"),step:.01,min:.01,max:.99,onChange:o,value:t,isInteger:!1,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:s,isSliderDisabled:!e,isInputDisabled:!e,isResetDisabled:!e})},lO=()=>{const e=Y(),t=A(o=>o.postprocessing.hiresFix),{t:n}=X(),r=o=>e(R1(o.target.checked));return l.jsx(En,{label:n("parameters.hiresOptim"),fontSize:"md",isChecked:t,onChange:r})},cO=()=>l.jsxs(ze,{gap:2,alignItems:"stretch",children:[l.jsx(R4,{}),l.jsx(lO,{}),l.jsx(sO,{})]}),uO=()=>{const{t:e}=X(),t={general:{header:`${e("parameters.general")}`,feature:void 0,content:l.jsx(kp,{})},seed:{header:`${e("parameters.seed")}`,feature:ln.SEED,content:l.jsx(Sp,{})},variations:{header:`${e("parameters.variations")}`,feature:ln.VARIATIONS,content:l.jsx(wp,{}),additionalHeaderComponents:l.jsx(Cp,{})},face_restore:{header:`${e("parameters.faceRestoration")}`,feature:ln.FACE_CORRECTION,content:l.jsx(pp,{}),additionalHeaderComponents:l.jsx(z4,{})},upscale:{header:`${e("parameters.upscaling")}`,feature:ln.UPSCALE,content:l.jsx(mp,{}),additionalHeaderComponents:l.jsx(N4,{})},symmetry:{header:`${e("parameters.symmetry")}`,content:l.jsx(xp,{}),additionalHeaderComponents:l.jsx(bp,{})},other:{header:`${e("parameters.otherOptions")}`,feature:ln.OTHER,content:l.jsx(cO,{})}};return l.jsxs(B,{flexDir:"column",gap:2,children:[l.jsx(_p,{}),l.jsx(Tp,{}),l.jsx(Mp,{}),l.jsx(jp,{accordionInfo:t})]})},dO=g.memo(uO);function fO(){return l.jsx(hp,{parametersPanelContent:l.jsx(dO,{}),children:l.jsx(iO,{})})}var Vf={},hO={get exports(){return Vf},set exports(e){Vf=e}};/**
|
||
* @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 pO=function(t){var n={},r=g,o=Bl,s=Object.assign;function c(i){for(var a="https://reactjs.org/docs/error-decoder.html?invariant="+i,d=1;d<arguments.length;d++)a+="&args[]="+encodeURIComponent(arguments[d]);return"Minified React error #"+i+"; visit "+a+" 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,f=Symbol.for("react.element"),p=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),S=Symbol.for("react.provider"),C=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),M=Symbol.for("react.offscreen"),T=Symbol.iterator;function D(i){return i===null||typeof i!="object"?null:(i=T&&i[T]||i["@@iterator"],typeof i=="function"?i:null)}function _(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case h:return"Fragment";case p:return"Portal";case x:return"Profiler";case y:return"StrictMode";case w:return"Suspense";case j:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case C:return(i.displayName||"Context")+".Consumer";case S:return(i._context.displayName||"Context")+".Provider";case k:var a=i.render;return i=i.displayName,i||(i=a.displayName||a.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case I:return a=i.displayName||null,a!==null?a:_(i.type)||"Memo";case P:a=i._payload,i=i._init;try{return _(i(a))}catch{}}return null}function R(i){var a=i.type;switch(i.tag){case 24:return"Cache";case 9:return(a.displayName||"Context")+".Consumer";case 10:return(a._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=a.render,i=i.displayName||i.name||"",a.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return a;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return _(a);case 8:return a===y?"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 a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a}return null}function V(i){var a=i,d=i;if(i.alternate)for(;a.return;)a=a.return;else{i=a;do a=i,a.flags&4098&&(d=a.return),i=a.return;while(i)}return a.tag===3?d:null}function F(i){if(V(i)!==i)throw Error(c(188))}function L(i){var a=i.alternate;if(!a){if(a=V(i),a===null)throw Error(c(188));return a!==i?null:i}for(var d=i,m=a;;){var v=d.return;if(v===null)break;var b=v.alternate;if(b===null){if(m=v.return,m!==null){d=m;continue}break}if(v.child===b.child){for(b=v.child;b;){if(b===d)return F(v),i;if(b===m)return F(v),a;b=b.sibling}throw Error(c(188))}if(d.return!==m.return)d=v,m=b;else{for(var E=!1,O=v.child;O;){if(O===d){E=!0,d=v,m=b;break}if(O===m){E=!0,m=v,d=b;break}O=O.sibling}if(!E){for(O=b.child;O;){if(O===d){E=!0,d=b,m=v;break}if(O===m){E=!0,m=b,d=v;break}O=O.sibling}if(!E)throw Error(c(189))}}if(d.alternate!==m)throw Error(c(190))}if(d.tag!==3)throw Error(c(188));return d.stateNode.current===d?i:a}function Q(i){return i=L(i),i!==null?U(i):null}function U(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){var a=U(i);if(a!==null)return a;i=i.sibling}return null}function K(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){if(i.tag!==4){var a=K(i);if(a!==null)return a}i=i.sibling}return null}var te=Array.isArray,ne=t.getPublicInstance,$=t.getRootHostContext,Z=t.getChildHostContext,oe=t.prepareForCommit,le=t.resetAfterCommit,Re=t.createInstance,Ne=t.appendInitialChild,Ie=t.finalizeInitialChildren,pe=t.prepareUpdate,ce=t.shouldSetTextContent,Fe=t.createTextInstance,Ve=t.scheduleTimeout,Ue=t.cancelTimeout,$e=t.noTimeout,Qe=t.isPrimaryRenderer,ge=t.supportsMutation,Te=t.supportsPersistence,Ge=t.supportsHydration,ye=t.getInstanceFromNode,Pe=t.preparePortalMount,et=t.getCurrentEventPriority,Be=t.detachDeletedInstance,vt=t.supportsMicrotasks,Rt=t.scheduleMicrotask,N=t.supportsTestSelectors,ue=t.findFiberRoot,xe=t.getBoundingRect,ke=t.getTextContent,q=t.isHiddenSubtree,ae=t.matchAccessibilityRole,Oe=t.setFocusIfFocusable,Ze=t.setupIntersectionObserver,J=t.appendChild,Le=t.appendChildToContainer,nt=t.commitTextUpdate,Nt=t.commitMount,he=t.commitUpdate,_e=t.insertBefore,dn=t.insertInContainerBefore,Vt=t.removeChild,fn=t.removeChildFromContainer,ar=t.resetTextContent,wo=t.hideInstance,sa=t.hideTextInstance,Yc=t.unhideInstance,la=t.unhideTextInstance,ko=t.clearContainer,Cb=t.cloneInstance,Lp=t.createContainerChildSet,Bp=t.appendChildToContainerChildSet,wb=t.finalizeContainerChildren,Kc=t.replaceContainerChildren,Hp=t.cloneHiddenInstance,Wp=t.cloneHiddenTextInstance,kb=t.canHydrateInstance,jb=t.canHydrateTextInstance,Eb=t.canHydrateSuspenseInstance,Vp=t.isSuspenseInstancePending,Xc=t.isSuspenseInstanceFallback,Pb=t.getSuspenseInstanceFallbackErrorDetails,Ib=t.registerSuspenseInstanceRetry,Cs=t.getNextHydratableSibling,Mb=t.getFirstHydratableChild,Tb=t.getFirstHydratableChildWithinContainer,_b=t.getFirstHydratableChildWithinSuspenseInstance,Db=t.hydrateInstance,Ab=t.hydrateTextInstance,Ob=t.hydrateSuspenseInstance,zb=t.getNextHydratableInstanceAfterSuspenseInstance,Rb=t.commitHydratedContainer,Nb=t.commitHydratedSuspenseInstance,Fb=t.clearSuspenseBoundary,Lb=t.clearSuspenseBoundaryFromContainer,Bb=t.shouldDeleteUnhydratedTailInstances,Hb=t.didNotMatchHydratedContainerTextInstance,Wb=t.didNotMatchHydratedTextInstance,Qc;function ca(i){if(Qc===void 0)try{throw Error()}catch(d){var a=d.stack.trim().match(/\n( *(at )?)/);Qc=a&&a[1]||""}return`
|
||
`+Qc+i}var Zc=!1;function Jc(i,a){if(!i||Zc)return"";Zc=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(a)if(a=function(){throw Error()},Object.defineProperty(a.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(a,[])}catch(ie){var m=ie}Reflect.construct(i,[],a)}else{try{a.call()}catch(ie){m=ie}i.call(a.prototype)}else{try{throw Error()}catch(ie){m=ie}i()}}catch(ie){if(ie&&m&&typeof ie.stack=="string"){for(var v=ie.stack.split(`
|
||
`),b=m.stack.split(`
|
||
`),E=v.length-1,O=b.length-1;1<=E&&0<=O&&v[E]!==b[O];)O--;for(;1<=E&&0<=O;E--,O--)if(v[E]!==b[O]){if(E!==1||O!==1)do if(E--,O--,0>O||v[E]!==b[O]){var W=`
|
||
`+v[E].replace(" at new "," at ");return i.displayName&&W.includes("<anonymous>")&&(W=W.replace("<anonymous>",i.displayName)),W}while(1<=E&&0<=O);break}}}finally{Zc=!1,Error.prepareStackTrace=d}return(i=i?i.displayName||i.name:"")?ca(i):""}var Vb=Object.prototype.hasOwnProperty,eu=[],ci=-1;function qr(i){return{current:i}}function St(i){0>ci||(i.current=eu[ci],eu[ci]=null,ci--)}function gt(i,a){ci++,eu[ci]=i.current,i.current=a}var Yr={},nn=qr(Yr),yn=qr(!1),jo=Yr;function ui(i,a){var d=i.type.contextTypes;if(!d)return Yr;var m=i.stateNode;if(m&&m.__reactInternalMemoizedUnmaskedChildContext===a)return m.__reactInternalMemoizedMaskedChildContext;var v={},b;for(b in d)v[b]=a[b];return m&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=a,i.__reactInternalMemoizedMaskedChildContext=v),v}function xn(i){return i=i.childContextTypes,i!=null}function ws(){St(yn),St(nn)}function Up(i,a,d){if(nn.current!==Yr)throw Error(c(168));gt(nn,a),gt(yn,d)}function $p(i,a,d){var m=i.stateNode;if(a=a.childContextTypes,typeof m.getChildContext!="function")return d;m=m.getChildContext();for(var v in m)if(!(v in a))throw Error(c(108,R(i)||"Unknown",v));return s({},d,m)}function ks(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||Yr,jo=nn.current,gt(nn,i),gt(yn,yn.current),!0}function Gp(i,a,d){var m=i.stateNode;if(!m)throw Error(c(169));d?(i=$p(i,a,jo),m.__reactInternalMemoizedMergedChildContext=i,St(yn),St(nn),gt(nn,i)):St(yn),gt(yn,d)}var qn=Math.clz32?Math.clz32:Gb,Ub=Math.log,$b=Math.LN2;function Gb(i){return i>>>=0,i===0?32:31-(Ub(i)/$b|0)|0}var js=64,Es=4194304;function ua(i){switch(i&-i){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 i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function Ps(i,a){var d=i.pendingLanes;if(d===0)return 0;var m=0,v=i.suspendedLanes,b=i.pingedLanes,E=d&268435455;if(E!==0){var O=E&~v;O!==0?m=ua(O):(b&=E,b!==0&&(m=ua(b)))}else E=d&~v,E!==0?m=ua(E):b!==0&&(m=ua(b));if(m===0)return 0;if(a!==0&&a!==m&&!(a&v)&&(v=m&-m,b=a&-a,v>=b||v===16&&(b&4194240)!==0))return a;if(m&4&&(m|=d&16),a=i.entangledLanes,a!==0)for(i=i.entanglements,a&=m;0<a;)d=31-qn(a),v=1<<d,m|=i[d],a&=~v;return m}function qb(i,a){switch(i){case 1:case 2:case 4:return a+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 a+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 Yb(i,a){for(var d=i.suspendedLanes,m=i.pingedLanes,v=i.expirationTimes,b=i.pendingLanes;0<b;){var E=31-qn(b),O=1<<E,W=v[E];W===-1?(!(O&d)||O&m)&&(v[E]=qb(O,a)):W<=a&&(i.expiredLanes|=O),b&=~O}}function tu(i){return i=i.pendingLanes&-1073741825,i!==0?i:i&1073741824?1073741824:0}function qp(){var i=js;return js<<=1,!(js&4194240)&&(js=64),i}function nu(i){for(var a=[],d=0;31>d;d++)a.push(i);return a}function da(i,a,d){i.pendingLanes|=a,a!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,a=31-qn(a),i[a]=d}function Kb(i,a){var d=i.pendingLanes&~a;i.pendingLanes=a,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=a,i.mutableReadLanes&=a,i.entangledLanes&=a,a=i.entanglements;var m=i.eventTimes;for(i=i.expirationTimes;0<d;){var v=31-qn(d),b=1<<v;a[v]=0,m[v]=-1,i[v]=-1,d&=~b}}function ru(i,a){var d=i.entangledLanes|=a;for(i=i.entanglements;d;){var m=31-qn(d),v=1<<m;v&a|i[m]&a&&(i[m]|=a),d&=~v}}var ot=0;function Yp(i){return i&=-i,1<i?4<i?i&268435455?16:536870912:4:1}var ou=o.unstable_scheduleCallback,Kp=o.unstable_cancelCallback,Xb=o.unstable_shouldYield,Qb=o.unstable_requestPaint,qt=o.unstable_now,iu=o.unstable_ImmediatePriority,Zb=o.unstable_UserBlockingPriority,au=o.unstable_NormalPriority,Jb=o.unstable_IdlePriority,Is=null,sr=null;function eS(i){if(sr&&typeof sr.onCommitFiberRoot=="function")try{sr.onCommitFiberRoot(Is,i,void 0,(i.current.flags&128)===128)}catch{}}function tS(i,a){return i===a&&(i!==0||1/i===1/a)||i!==i&&a!==a}var Yn=typeof Object.is=="function"?Object.is:tS,Ir=null,Ms=!1,su=!1;function Xp(i){Ir===null?Ir=[i]:Ir.push(i)}function nS(i){Ms=!0,Xp(i)}function lr(){if(!su&&Ir!==null){su=!0;var i=0,a=ot;try{var d=Ir;for(ot=1;i<d.length;i++){var m=d[i];do m=m(!0);while(m!==null)}Ir=null,Ms=!1}catch(v){throw Ir!==null&&(Ir=Ir.slice(i+1)),ou(iu,lr),v}finally{ot=a,su=!1}}return null}var di=[],fi=0,Ts=null,_s=0,Dn=[],An=0,Eo=null,Mr=1,Tr="";function Po(i,a){di[fi++]=_s,di[fi++]=Ts,Ts=i,_s=a}function Qp(i,a,d){Dn[An++]=Mr,Dn[An++]=Tr,Dn[An++]=Eo,Eo=i;var m=Mr;i=Tr;var v=32-qn(m)-1;m&=~(1<<v),d+=1;var b=32-qn(a)+v;if(30<b){var E=v-v%5;b=(m&(1<<E)-1).toString(32),m>>=E,v-=E,Mr=1<<32-qn(a)+v|d<<v|m,Tr=b+i}else Mr=1<<b|d<<v|m,Tr=i}function lu(i){i.return!==null&&(Po(i,1),Qp(i,1,0))}function cu(i){for(;i===Ts;)Ts=di[--fi],di[fi]=null,_s=di[--fi],di[fi]=null;for(;i===Eo;)Eo=Dn[--An],Dn[An]=null,Tr=Dn[--An],Dn[An]=null,Mr=Dn[--An],Dn[An]=null}var Tn=null,On=null,Pt=!1,fa=!1,Kn=null;function Zp(i,a){var d=Ln(5,null,null,0);d.elementType="DELETED",d.stateNode=a,d.return=i,a=i.deletions,a===null?(i.deletions=[d],i.flags|=16):a.push(d)}function Jp(i,a){switch(i.tag){case 5:return a=kb(a,i.type,i.pendingProps),a!==null?(i.stateNode=a,Tn=i,On=Mb(a),!0):!1;case 6:return a=jb(a,i.pendingProps),a!==null?(i.stateNode=a,Tn=i,On=null,!0):!1;case 13:if(a=Eb(a),a!==null){var d=Eo!==null?{id:Mr,overflow:Tr}:null;return i.memoizedState={dehydrated:a,treeContext:d,retryLane:1073741824},d=Ln(18,null,null,0),d.stateNode=a,d.return=i,i.child=d,Tn=i,On=null,!0}return!1;default:return!1}}function uu(i){return(i.mode&1)!==0&&(i.flags&128)===0}function du(i){if(Pt){var a=On;if(a){var d=a;if(!Jp(i,a)){if(uu(i))throw Error(c(418));a=Cs(d);var m=Tn;a&&Jp(i,a)?Zp(m,d):(i.flags=i.flags&-4097|2,Pt=!1,Tn=i)}}else{if(uu(i))throw Error(c(418));i.flags=i.flags&-4097|2,Pt=!1,Tn=i}}}function em(i){for(i=i.return;i!==null&&i.tag!==5&&i.tag!==3&&i.tag!==13;)i=i.return;Tn=i}function Ds(i){if(!Ge||i!==Tn)return!1;if(!Pt)return em(i),Pt=!0,!1;if(i.tag!==3&&(i.tag!==5||Bb(i.type)&&!ce(i.type,i.memoizedProps))){var a=On;if(a){if(uu(i))throw tm(),Error(c(418));for(;a;)Zp(i,a),a=Cs(a)}}if(em(i),i.tag===13){if(!Ge)throw Error(c(316));if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(c(317));On=zb(i)}else On=Tn?Cs(i.stateNode):null;return!0}function tm(){for(var i=On;i;)i=Cs(i)}function hi(){Ge&&(On=Tn=null,fa=Pt=!1)}function fu(i){Kn===null?Kn=[i]:Kn.push(i)}var rS=u.ReactCurrentBatchConfig;function As(i,a){if(Yn(i,a))return!0;if(typeof i!="object"||i===null||typeof a!="object"||a===null)return!1;var d=Object.keys(i),m=Object.keys(a);if(d.length!==m.length)return!1;for(m=0;m<d.length;m++){var v=d[m];if(!Vb.call(a,v)||!Yn(i[v],a[v]))return!1}return!0}function oS(i){switch(i.tag){case 5:return ca(i.type);case 16:return ca("Lazy");case 13:return ca("Suspense");case 19:return ca("SuspenseList");case 0:case 2:case 15:return i=Jc(i.type,!1),i;case 11:return i=Jc(i.type.render,!1),i;case 1:return i=Jc(i.type,!0),i;default:return""}}function Xn(i,a){if(i&&i.defaultProps){a=s({},a),i=i.defaultProps;for(var d in i)a[d]===void 0&&(a[d]=i[d]);return a}return a}var Os=qr(null),zs=null,pi=null,hu=null;function pu(){hu=pi=zs=null}function nm(i,a,d){Qe?(gt(Os,a._currentValue),a._currentValue=d):(gt(Os,a._currentValue2),a._currentValue2=d)}function mu(i){var a=Os.current;St(Os),Qe?i._currentValue=a:i._currentValue2=a}function vu(i,a,d){for(;i!==null;){var m=i.alternate;if((i.childLanes&a)!==a?(i.childLanes|=a,m!==null&&(m.childLanes|=a)):m!==null&&(m.childLanes&a)!==a&&(m.childLanes|=a),i===d)break;i=i.return}}function mi(i,a){zs=i,hu=pi=null,i=i.dependencies,i!==null&&i.firstContext!==null&&(i.lanes&a&&(bn=!0),i.firstContext=null)}function zn(i){var a=Qe?i._currentValue:i._currentValue2;if(hu!==i)if(i={context:i,memoizedValue:a,next:null},pi===null){if(zs===null)throw Error(c(308));pi=i,zs.dependencies={lanes:0,firstContext:i}}else pi=pi.next=i;return a}var Io=null;function gu(i){Io===null?Io=[i]:Io.push(i)}function rm(i,a,d,m){var v=a.interleaved;return v===null?(d.next=d,gu(a)):(d.next=v.next,v.next=d),a.interleaved=d,cr(i,m)}function cr(i,a){i.lanes|=a;var d=i.alternate;for(d!==null&&(d.lanes|=a),d=i,i=i.return;i!==null;)i.childLanes|=a,d=i.alternate,d!==null&&(d.childLanes|=a),d=i,i=i.return;return d.tag===3?d.stateNode:null}var Kr=!1;function yu(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function om(i,a){i=i.updateQueue,a.updateQueue===i&&(a.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function _r(i,a){return{eventTime:i,lane:a,tag:0,payload:null,callback:null,next:null}}function Xr(i,a,d){var m=i.updateQueue;if(m===null)return null;if(m=m.shared,Xe&2){var v=m.pending;return v===null?a.next=a:(a.next=v.next,v.next=a),m.pending=a,cr(i,d)}return v=m.interleaved,v===null?(a.next=a,gu(m)):(a.next=v.next,v.next=a),m.interleaved=a,cr(i,d)}function Rs(i,a,d){if(a=a.updateQueue,a!==null&&(a=a.shared,(d&4194240)!==0)){var m=a.lanes;m&=i.pendingLanes,d|=m,a.lanes=d,ru(i,d)}}function im(i,a){var d=i.updateQueue,m=i.alternate;if(m!==null&&(m=m.updateQueue,d===m)){var v=null,b=null;if(d=d.firstBaseUpdate,d!==null){do{var E={eventTime:d.eventTime,lane:d.lane,tag:d.tag,payload:d.payload,callback:d.callback,next:null};b===null?v=b=E:b=b.next=E,d=d.next}while(d!==null);b===null?v=b=a:b=b.next=a}else v=b=a;d={baseState:m.baseState,firstBaseUpdate:v,lastBaseUpdate:b,shared:m.shared,effects:m.effects},i.updateQueue=d;return}i=d.lastBaseUpdate,i===null?d.firstBaseUpdate=a:i.next=a,d.lastBaseUpdate=a}function Ns(i,a,d,m){var v=i.updateQueue;Kr=!1;var b=v.firstBaseUpdate,E=v.lastBaseUpdate,O=v.shared.pending;if(O!==null){v.shared.pending=null;var W=O,ie=W.next;W.next=null,E===null?b=ie:E.next=ie,E=W;var je=i.alternate;je!==null&&(je=je.updateQueue,O=je.lastBaseUpdate,O!==E&&(O===null?je.firstBaseUpdate=ie:O.next=ie,je.lastBaseUpdate=W))}if(b!==null){var He=v.baseState;E=0,je=ie=W=null,O=b;do{var be=O.lane,Ct=O.eventTime;if((m&be)===be){je!==null&&(je=je.next={eventTime:Ct,lane:0,tag:O.tag,payload:O.payload,callback:O.callback,next:null});e:{var ft=i,wn=O;switch(be=a,Ct=d,wn.tag){case 1:if(ft=wn.payload,typeof ft=="function"){He=ft.call(Ct,He,be);break e}He=ft;break e;case 3:ft.flags=ft.flags&-65537|128;case 0:if(ft=wn.payload,be=typeof ft=="function"?ft.call(Ct,He,be):ft,be==null)break e;He=s({},He,be);break e;case 2:Kr=!0}}O.callback!==null&&O.lane!==0&&(i.flags|=64,be=v.effects,be===null?v.effects=[O]:be.push(O))}else Ct={eventTime:Ct,lane:be,tag:O.tag,payload:O.payload,callback:O.callback,next:null},je===null?(ie=je=Ct,W=He):je=je.next=Ct,E|=be;if(O=O.next,O===null){if(O=v.shared.pending,O===null)break;be=O,O=be.next,be.next=null,v.lastBaseUpdate=be,v.shared.pending=null}}while(1);if(je===null&&(W=He),v.baseState=W,v.firstBaseUpdate=ie,v.lastBaseUpdate=je,a=v.shared.interleaved,a!==null){v=a;do E|=v.lane,v=v.next;while(v!==a)}else b===null&&(v.shared.lanes=0);To|=E,i.lanes=E,i.memoizedState=He}}function am(i,a,d){if(i=a.effects,a.effects=null,i!==null)for(a=0;a<i.length;a++){var m=i[a],v=m.callback;if(v!==null){if(m.callback=null,m=d,typeof v!="function")throw Error(c(191,v));v.call(m)}}}var sm=new r.Component().refs;function xu(i,a,d,m){a=i.memoizedState,d=d(m,a),d=d==null?a:s({},a,d),i.memoizedState=d,i.lanes===0&&(i.updateQueue.baseState=d)}var Fs={isMounted:function(i){return(i=i._reactInternals)?V(i)===i:!1},enqueueSetState:function(i,a,d){i=i._reactInternals;var m=sn(),v=Jr(i),b=_r(m,v);b.payload=a,d!=null&&(b.callback=d),a=Xr(i,b,v),a!==null&&(Fn(a,i,v,m),Rs(a,i,v))},enqueueReplaceState:function(i,a,d){i=i._reactInternals;var m=sn(),v=Jr(i),b=_r(m,v);b.tag=1,b.payload=a,d!=null&&(b.callback=d),a=Xr(i,b,v),a!==null&&(Fn(a,i,v,m),Rs(a,i,v))},enqueueForceUpdate:function(i,a){i=i._reactInternals;var d=sn(),m=Jr(i),v=_r(d,m);v.tag=2,a!=null&&(v.callback=a),a=Xr(i,v,m),a!==null&&(Fn(a,i,m,d),Rs(a,i,m))}};function lm(i,a,d,m,v,b,E){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(m,b,E):a.prototype&&a.prototype.isPureReactComponent?!As(d,m)||!As(v,b):!0}function cm(i,a,d){var m=!1,v=Yr,b=a.contextType;return typeof b=="object"&&b!==null?b=zn(b):(v=xn(a)?jo:nn.current,m=a.contextTypes,b=(m=m!=null)?ui(i,v):Yr),a=new a(d,b),i.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Fs,i.stateNode=a,a._reactInternals=i,m&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=v,i.__reactInternalMemoizedMaskedChildContext=b),a}function um(i,a,d,m){i=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(d,m),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(d,m),a.state!==i&&Fs.enqueueReplaceState(a,a.state,null)}function bu(i,a,d,m){var v=i.stateNode;v.props=d,v.state=i.memoizedState,v.refs=sm,yu(i);var b=a.contextType;typeof b=="object"&&b!==null?v.context=zn(b):(b=xn(a)?jo:nn.current,v.context=ui(i,b)),v.state=i.memoizedState,b=a.getDerivedStateFromProps,typeof b=="function"&&(xu(i,a,b,d),v.state=i.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(a=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),a!==v.state&&Fs.enqueueReplaceState(v,v.state,null),Ns(i,d,v,m),v.state=i.memoizedState),typeof v.componentDidMount=="function"&&(i.flags|=4194308)}function ha(i,a,d){if(i=d.ref,i!==null&&typeof i!="function"&&typeof i!="object"){if(d._owner){if(d=d._owner,d){if(d.tag!==1)throw Error(c(309));var m=d.stateNode}if(!m)throw Error(c(147,i));var v=m,b=""+i;return a!==null&&a.ref!==null&&typeof a.ref=="function"&&a.ref._stringRef===b?a.ref:(a=function(E){var O=v.refs;O===sm&&(O=v.refs={}),E===null?delete O[b]:O[b]=E},a._stringRef=b,a)}if(typeof i!="string")throw Error(c(284));if(!d._owner)throw Error(c(290,i))}return i}function Ls(i,a){throw i=Object.prototype.toString.call(a),Error(c(31,i==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":i))}function dm(i){var a=i._init;return a(i._payload)}function fm(i){function a(H,z){if(i){var G=H.deletions;G===null?(H.deletions=[z],H.flags|=16):G.push(z)}}function d(H,z){if(!i)return null;for(;z!==null;)a(H,z),z=z.sibling;return null}function m(H,z){for(H=new Map;z!==null;)z.key!==null?H.set(z.key,z):H.set(z.index,z),z=z.sibling;return H}function v(H,z){return H=to(H,z),H.index=0,H.sibling=null,H}function b(H,z,G){return H.index=G,i?(G=H.alternate,G!==null?(G=G.index,G<z?(H.flags|=2,z):G):(H.flags|=2,z)):(H.flags|=1048576,z)}function E(H){return i&&H.alternate===null&&(H.flags|=2),H}function O(H,z,G,Se){return z===null||z.tag!==6?(z=sd(G,H.mode,Se),z.return=H,z):(z=v(z,G),z.return=H,z)}function W(H,z,G,Se){var De=G.type;return De===h?je(H,z,G.props.children,Se,G.key):z!==null&&(z.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===P&&dm(De)===z.type)?(Se=v(z,G.props),Se.ref=ha(H,z,G),Se.return=H,Se):(Se=dl(G.type,G.key,G.props,null,H.mode,Se),Se.ref=ha(H,z,G),Se.return=H,Se)}function ie(H,z,G,Se){return z===null||z.tag!==4||z.stateNode.containerInfo!==G.containerInfo||z.stateNode.implementation!==G.implementation?(z=ld(G,H.mode,Se),z.return=H,z):(z=v(z,G.children||[]),z.return=H,z)}function je(H,z,G,Se,De){return z===null||z.tag!==7?(z=Oo(G,H.mode,Se,De),z.return=H,z):(z=v(z,G),z.return=H,z)}function He(H,z,G){if(typeof z=="string"&&z!==""||typeof z=="number")return z=sd(""+z,H.mode,G),z.return=H,z;if(typeof z=="object"&&z!==null){switch(z.$$typeof){case f:return G=dl(z.type,z.key,z.props,null,H.mode,G),G.ref=ha(H,null,z),G.return=H,G;case p:return z=ld(z,H.mode,G),z.return=H,z;case P:var Se=z._init;return He(H,Se(z._payload),G)}if(te(z)||D(z))return z=Oo(z,H.mode,G,null),z.return=H,z;Ls(H,z)}return null}function be(H,z,G,Se){var De=z!==null?z.key:null;if(typeof G=="string"&&G!==""||typeof G=="number")return De!==null?null:O(H,z,""+G,Se);if(typeof G=="object"&&G!==null){switch(G.$$typeof){case f:return G.key===De?W(H,z,G,Se):null;case p:return G.key===De?ie(H,z,G,Se):null;case P:return De=G._init,be(H,z,De(G._payload),Se)}if(te(G)||D(G))return De!==null?null:je(H,z,G,Se,null);Ls(H,G)}return null}function Ct(H,z,G,Se,De){if(typeof Se=="string"&&Se!==""||typeof Se=="number")return H=H.get(G)||null,O(z,H,""+Se,De);if(typeof Se=="object"&&Se!==null){switch(Se.$$typeof){case f:return H=H.get(Se.key===null?G:Se.key)||null,W(z,H,Se,De);case p:return H=H.get(Se.key===null?G:Se.key)||null,ie(z,H,Se,De);case P:var Ke=Se._init;return Ct(H,z,G,Ke(Se._payload),De)}if(te(Se)||D(Se))return H=H.get(G)||null,je(z,H,Se,De,null);Ls(z,Se)}return null}function ft(H,z,G,Se){for(var De=null,Ke=null,We=z,it=z=0,Xt=null;We!==null&&it<G.length;it++){We.index>it?(Xt=We,We=null):Xt=We.sibling;var at=be(H,We,G[it],Se);if(at===null){We===null&&(We=Xt);break}i&&We&&at.alternate===null&&a(H,We),z=b(at,z,it),Ke===null?De=at:Ke.sibling=at,Ke=at,We=Xt}if(it===G.length)return d(H,We),Pt&&Po(H,it),De;if(We===null){for(;it<G.length;it++)We=He(H,G[it],Se),We!==null&&(z=b(We,z,it),Ke===null?De=We:Ke.sibling=We,Ke=We);return Pt&&Po(H,it),De}for(We=m(H,We);it<G.length;it++)Xt=Ct(We,H,it,G[it],Se),Xt!==null&&(i&&Xt.alternate!==null&&We.delete(Xt.key===null?it:Xt.key),z=b(Xt,z,it),Ke===null?De=Xt:Ke.sibling=Xt,Ke=Xt);return i&&We.forEach(function(no){return a(H,no)}),Pt&&Po(H,it),De}function wn(H,z,G,Se){var De=D(G);if(typeof De!="function")throw Error(c(150));if(G=De.call(G),G==null)throw Error(c(151));for(var Ke=De=null,We=z,it=z=0,Xt=null,at=G.next();We!==null&&!at.done;it++,at=G.next()){We.index>it?(Xt=We,We=null):Xt=We.sibling;var no=be(H,We,at.value,Se);if(no===null){We===null&&(We=Xt);break}i&&We&&no.alternate===null&&a(H,We),z=b(no,z,it),Ke===null?De=no:Ke.sibling=no,Ke=no,We=Xt}if(at.done)return d(H,We),Pt&&Po(H,it),De;if(We===null){for(;!at.done;it++,at=G.next())at=He(H,at.value,Se),at!==null&&(z=b(at,z,it),Ke===null?De=at:Ke.sibling=at,Ke=at);return Pt&&Po(H,it),De}for(We=m(H,We);!at.done;it++,at=G.next())at=Ct(We,H,it,at.value,Se),at!==null&&(i&&at.alternate!==null&&We.delete(at.key===null?it:at.key),z=b(at,z,it),Ke===null?De=at:Ke.sibling=at,Ke=at);return i&&We.forEach(function(OS){return a(H,OS)}),Pt&&Po(H,it),De}function Or(H,z,G,Se){if(typeof G=="object"&&G!==null&&G.type===h&&G.key===null&&(G=G.props.children),typeof G=="object"&&G!==null){switch(G.$$typeof){case f:e:{for(var De=G.key,Ke=z;Ke!==null;){if(Ke.key===De){if(De=G.type,De===h){if(Ke.tag===7){d(H,Ke.sibling),z=v(Ke,G.props.children),z.return=H,H=z;break e}}else if(Ke.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===P&&dm(De)===Ke.type){d(H,Ke.sibling),z=v(Ke,G.props),z.ref=ha(H,Ke,G),z.return=H,H=z;break e}d(H,Ke);break}else a(H,Ke);Ke=Ke.sibling}G.type===h?(z=Oo(G.props.children,H.mode,Se,G.key),z.return=H,H=z):(Se=dl(G.type,G.key,G.props,null,H.mode,Se),Se.ref=ha(H,z,G),Se.return=H,H=Se)}return E(H);case p:e:{for(Ke=G.key;z!==null;){if(z.key===Ke)if(z.tag===4&&z.stateNode.containerInfo===G.containerInfo&&z.stateNode.implementation===G.implementation){d(H,z.sibling),z=v(z,G.children||[]),z.return=H,H=z;break e}else{d(H,z);break}else a(H,z);z=z.sibling}z=ld(G,H.mode,Se),z.return=H,H=z}return E(H);case P:return Ke=G._init,Or(H,z,Ke(G._payload),Se)}if(te(G))return ft(H,z,G,Se);if(D(G))return wn(H,z,G,Se);Ls(H,G)}return typeof G=="string"&&G!==""||typeof G=="number"?(G=""+G,z!==null&&z.tag===6?(d(H,z.sibling),z=v(z,G),z.return=H,H=z):(d(H,z),z=sd(G,H.mode,Se),z.return=H,H=z),E(H)):d(H,z)}return Or}var vi=fm(!0),hm=fm(!1),pa={},Rn=qr(pa),ma=qr(pa),gi=qr(pa);function ur(i){if(i===pa)throw Error(c(174));return i}function Su(i,a){gt(gi,a),gt(ma,i),gt(Rn,pa),i=$(a),St(Rn),gt(Rn,i)}function yi(){St(Rn),St(ma),St(gi)}function pm(i){var a=ur(gi.current),d=ur(Rn.current);a=Z(d,i.type,a),d!==a&&(gt(ma,i),gt(Rn,a))}function Cu(i){ma.current===i&&(St(Rn),St(ma))}var Tt=qr(0);function Bs(i){for(var a=i;a!==null;){if(a.tag===13){var d=a.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||Vp(d)||Xc(d)))return a}else if(a.tag===19&&a.memoizedProps.revealOrder!==void 0){if(a.flags&128)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===i)break;for(;a.sibling===null;){if(a.return===null||a.return===i)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var wu=[];function ku(){for(var i=0;i<wu.length;i++){var a=wu[i];Qe?a._workInProgressVersionPrimary=null:a._workInProgressVersionSecondary=null}wu.length=0}var Hs=u.ReactCurrentDispatcher,ju=u.ReactCurrentBatchConfig,Mo=0,_t=null,Ut=null,Yt=null,Ws=!1,va=!1,ga=0,iS=0;function rn(){throw Error(c(321))}function Eu(i,a){if(a===null)return!1;for(var d=0;d<a.length&&d<i.length;d++)if(!Yn(i[d],a[d]))return!1;return!0}function Pu(i,a,d,m,v,b){if(Mo=b,_t=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,Hs.current=i===null||i.memoizedState===null?cS:uS,i=d(m,v),va){b=0;do{if(va=!1,ga=0,25<=b)throw Error(c(301));b+=1,Yt=Ut=null,a.updateQueue=null,Hs.current=dS,i=d(m,v)}while(va)}if(Hs.current=$s,a=Ut!==null&&Ut.next!==null,Mo=0,Yt=Ut=_t=null,Ws=!1,a)throw Error(c(300));return i}function Iu(){var i=ga!==0;return ga=0,i}function dr(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Yt===null?_t.memoizedState=Yt=i:Yt=Yt.next=i,Yt}function Nn(){if(Ut===null){var i=_t.alternate;i=i!==null?i.memoizedState:null}else i=Ut.next;var a=Yt===null?_t.memoizedState:Yt.next;if(a!==null)Yt=a,Ut=i;else{if(i===null)throw Error(c(310));Ut=i,i={memoizedState:Ut.memoizedState,baseState:Ut.baseState,baseQueue:Ut.baseQueue,queue:Ut.queue,next:null},Yt===null?_t.memoizedState=Yt=i:Yt=Yt.next=i}return Yt}function ya(i,a){return typeof a=="function"?a(i):a}function Mu(i){var a=Nn(),d=a.queue;if(d===null)throw Error(c(311));d.lastRenderedReducer=i;var m=Ut,v=m.baseQueue,b=d.pending;if(b!==null){if(v!==null){var E=v.next;v.next=b.next,b.next=E}m.baseQueue=v=b,d.pending=null}if(v!==null){b=v.next,m=m.baseState;var O=E=null,W=null,ie=b;do{var je=ie.lane;if((Mo&je)===je)W!==null&&(W=W.next={lane:0,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),m=ie.hasEagerState?ie.eagerState:i(m,ie.action);else{var He={lane:je,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null};W===null?(O=W=He,E=m):W=W.next=He,_t.lanes|=je,To|=je}ie=ie.next}while(ie!==null&&ie!==b);W===null?E=m:W.next=O,Yn(m,a.memoizedState)||(bn=!0),a.memoizedState=m,a.baseState=E,a.baseQueue=W,d.lastRenderedState=m}if(i=d.interleaved,i!==null){v=i;do b=v.lane,_t.lanes|=b,To|=b,v=v.next;while(v!==i)}else v===null&&(d.lanes=0);return[a.memoizedState,d.dispatch]}function Tu(i){var a=Nn(),d=a.queue;if(d===null)throw Error(c(311));d.lastRenderedReducer=i;var m=d.dispatch,v=d.pending,b=a.memoizedState;if(v!==null){d.pending=null;var E=v=v.next;do b=i(b,E.action),E=E.next;while(E!==v);Yn(b,a.memoizedState)||(bn=!0),a.memoizedState=b,a.baseQueue===null&&(a.baseState=b),d.lastRenderedState=b}return[b,m]}function mm(){}function vm(i,a){var d=_t,m=Nn(),v=a(),b=!Yn(m.memoizedState,v);if(b&&(m.memoizedState=v,bn=!0),m=m.queue,_u(xm.bind(null,d,m,i),[i]),m.getSnapshot!==a||b||Yt!==null&&Yt.memoizedState.tag&1){if(d.flags|=2048,xa(9,ym.bind(null,d,m,v,a),void 0,null),Kt===null)throw Error(c(349));Mo&30||gm(d,a,v)}return v}function gm(i,a,d){i.flags|=16384,i={getSnapshot:a,value:d},a=_t.updateQueue,a===null?(a={lastEffect:null,stores:null},_t.updateQueue=a,a.stores=[i]):(d=a.stores,d===null?a.stores=[i]:d.push(i))}function ym(i,a,d,m){a.value=d,a.getSnapshot=m,bm(a)&&Sm(i)}function xm(i,a,d){return d(function(){bm(a)&&Sm(i)})}function bm(i){var a=i.getSnapshot;i=i.value;try{var d=a();return!Yn(i,d)}catch{return!0}}function Sm(i){var a=cr(i,1);a!==null&&Fn(a,i,1,-1)}function Cm(i){var a=dr();return typeof i=="function"&&(i=i()),a.memoizedState=a.baseState=i,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ya,lastRenderedState:i},a.queue=i,i=i.dispatch=lS.bind(null,_t,i),[a.memoizedState,i]}function xa(i,a,d,m){return i={tag:i,create:a,destroy:d,deps:m,next:null},a=_t.updateQueue,a===null?(a={lastEffect:null,stores:null},_t.updateQueue=a,a.lastEffect=i.next=i):(d=a.lastEffect,d===null?a.lastEffect=i.next=i:(m=d.next,d.next=i,i.next=m,a.lastEffect=i)),i}function wm(){return Nn().memoizedState}function Vs(i,a,d,m){var v=dr();_t.flags|=i,v.memoizedState=xa(1|a,d,void 0,m===void 0?null:m)}function Us(i,a,d,m){var v=Nn();m=m===void 0?null:m;var b=void 0;if(Ut!==null){var E=Ut.memoizedState;if(b=E.destroy,m!==null&&Eu(m,E.deps)){v.memoizedState=xa(a,d,b,m);return}}_t.flags|=i,v.memoizedState=xa(1|a,d,b,m)}function km(i,a){return Vs(8390656,8,i,a)}function _u(i,a){return Us(2048,8,i,a)}function jm(i,a){return Us(4,2,i,a)}function Em(i,a){return Us(4,4,i,a)}function Pm(i,a){if(typeof a=="function")return i=i(),a(i),function(){a(null)};if(a!=null)return i=i(),a.current=i,function(){a.current=null}}function Im(i,a,d){return d=d!=null?d.concat([i]):null,Us(4,4,Pm.bind(null,a,i),d)}function Du(){}function Mm(i,a){var d=Nn();a=a===void 0?null:a;var m=d.memoizedState;return m!==null&&a!==null&&Eu(a,m[1])?m[0]:(d.memoizedState=[i,a],i)}function Tm(i,a){var d=Nn();a=a===void 0?null:a;var m=d.memoizedState;return m!==null&&a!==null&&Eu(a,m[1])?m[0]:(i=i(),d.memoizedState=[i,a],i)}function _m(i,a,d){return Mo&21?(Yn(d,a)||(d=qp(),_t.lanes|=d,To|=d,i.baseState=!0),a):(i.baseState&&(i.baseState=!1,bn=!0),i.memoizedState=d)}function aS(i,a){var d=ot;ot=d!==0&&4>d?d:4,i(!0);var m=ju.transition;ju.transition={};try{i(!1),a()}finally{ot=d,ju.transition=m}}function Dm(){return Nn().memoizedState}function sS(i,a,d){var m=Jr(i);if(d={lane:m,action:d,hasEagerState:!1,eagerState:null,next:null},Am(i))Om(a,d);else if(d=rm(i,a,d,m),d!==null){var v=sn();Fn(d,i,m,v),zm(d,a,m)}}function lS(i,a,d){var m=Jr(i),v={lane:m,action:d,hasEagerState:!1,eagerState:null,next:null};if(Am(i))Om(a,v);else{var b=i.alternate;if(i.lanes===0&&(b===null||b.lanes===0)&&(b=a.lastRenderedReducer,b!==null))try{var E=a.lastRenderedState,O=b(E,d);if(v.hasEagerState=!0,v.eagerState=O,Yn(O,E)){var W=a.interleaved;W===null?(v.next=v,gu(a)):(v.next=W.next,W.next=v),a.interleaved=v;return}}catch{}finally{}d=rm(i,a,v,m),d!==null&&(v=sn(),Fn(d,i,m,v),zm(d,a,m))}}function Am(i){var a=i.alternate;return i===_t||a!==null&&a===_t}function Om(i,a){va=Ws=!0;var d=i.pending;d===null?a.next=a:(a.next=d.next,d.next=a),i.pending=a}function zm(i,a,d){if(d&4194240){var m=a.lanes;m&=i.pendingLanes,d|=m,a.lanes=d,ru(i,d)}}var $s={readContext:zn,useCallback:rn,useContext:rn,useEffect:rn,useImperativeHandle:rn,useInsertionEffect:rn,useLayoutEffect:rn,useMemo:rn,useReducer:rn,useRef:rn,useState:rn,useDebugValue:rn,useDeferredValue:rn,useTransition:rn,useMutableSource:rn,useSyncExternalStore:rn,useId:rn,unstable_isNewReconciler:!1},cS={readContext:zn,useCallback:function(i,a){return dr().memoizedState=[i,a===void 0?null:a],i},useContext:zn,useEffect:km,useImperativeHandle:function(i,a,d){return d=d!=null?d.concat([i]):null,Vs(4194308,4,Pm.bind(null,a,i),d)},useLayoutEffect:function(i,a){return Vs(4194308,4,i,a)},useInsertionEffect:function(i,a){return Vs(4,2,i,a)},useMemo:function(i,a){var d=dr();return a=a===void 0?null:a,i=i(),d.memoizedState=[i,a],i},useReducer:function(i,a,d){var m=dr();return a=d!==void 0?d(a):a,m.memoizedState=m.baseState=a,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:a},m.queue=i,i=i.dispatch=sS.bind(null,_t,i),[m.memoizedState,i]},useRef:function(i){var a=dr();return i={current:i},a.memoizedState=i},useState:Cm,useDebugValue:Du,useDeferredValue:function(i){return dr().memoizedState=i},useTransition:function(){var i=Cm(!1),a=i[0];return i=aS.bind(null,i[1]),dr().memoizedState=i,[a,i]},useMutableSource:function(){},useSyncExternalStore:function(i,a,d){var m=_t,v=dr();if(Pt){if(d===void 0)throw Error(c(407));d=d()}else{if(d=a(),Kt===null)throw Error(c(349));Mo&30||gm(m,a,d)}v.memoizedState=d;var b={value:d,getSnapshot:a};return v.queue=b,km(xm.bind(null,m,b,i),[i]),m.flags|=2048,xa(9,ym.bind(null,m,b,d,a),void 0,null),d},useId:function(){var i=dr(),a=Kt.identifierPrefix;if(Pt){var d=Tr,m=Mr;d=(m&~(1<<32-qn(m)-1)).toString(32)+d,a=":"+a+"R"+d,d=ga++,0<d&&(a+="H"+d.toString(32)),a+=":"}else d=iS++,a=":"+a+"r"+d.toString(32)+":";return i.memoizedState=a},unstable_isNewReconciler:!1},uS={readContext:zn,useCallback:Mm,useContext:zn,useEffect:_u,useImperativeHandle:Im,useInsertionEffect:jm,useLayoutEffect:Em,useMemo:Tm,useReducer:Mu,useRef:wm,useState:function(){return Mu(ya)},useDebugValue:Du,useDeferredValue:function(i){var a=Nn();return _m(a,Ut.memoizedState,i)},useTransition:function(){var i=Mu(ya)[0],a=Nn().memoizedState;return[i,a]},useMutableSource:mm,useSyncExternalStore:vm,useId:Dm,unstable_isNewReconciler:!1},dS={readContext:zn,useCallback:Mm,useContext:zn,useEffect:_u,useImperativeHandle:Im,useInsertionEffect:jm,useLayoutEffect:Em,useMemo:Tm,useReducer:Tu,useRef:wm,useState:function(){return Tu(ya)},useDebugValue:Du,useDeferredValue:function(i){var a=Nn();return Ut===null?a.memoizedState=i:_m(a,Ut.memoizedState,i)},useTransition:function(){var i=Tu(ya)[0],a=Nn().memoizedState;return[i,a]},useMutableSource:mm,useSyncExternalStore:vm,useId:Dm,unstable_isNewReconciler:!1};function xi(i,a){try{var d="",m=a;do d+=oS(m),m=m.return;while(m);var v=d}catch(b){v=`
|
||
Error generating stack: `+b.message+`
|
||
`+b.stack}return{value:i,source:a,stack:v,digest:null}}function Au(i,a,d){return{value:i,source:null,stack:d??null,digest:a??null}}function Ou(i,a){try{console.error(a.value)}catch(d){setTimeout(function(){throw d})}}var fS=typeof WeakMap=="function"?WeakMap:Map;function Rm(i,a,d){d=_r(-1,d),d.tag=3,d.payload={element:null};var m=a.value;return d.callback=function(){il||(il=!0,ed=m),Ou(i,a)},d}function Nm(i,a,d){d=_r(-1,d),d.tag=3;var m=i.type.getDerivedStateFromError;if(typeof m=="function"){var v=a.value;d.payload=function(){return m(v)},d.callback=function(){Ou(i,a)}}var b=i.stateNode;return b!==null&&typeof b.componentDidCatch=="function"&&(d.callback=function(){Ou(i,a),typeof m!="function"&&(Qr===null?Qr=new Set([this]):Qr.add(this));var E=a.stack;this.componentDidCatch(a.value,{componentStack:E!==null?E:""})}),d}function Fm(i,a,d){var m=i.pingCache;if(m===null){m=i.pingCache=new fS;var v=new Set;m.set(a,v)}else v=m.get(a),v===void 0&&(v=new Set,m.set(a,v));v.has(d)||(v.add(d),i=ES.bind(null,i,a,d),a.then(i,i))}function Lm(i){do{var a;if((a=i.tag===13)&&(a=i.memoizedState,a=a!==null?a.dehydrated!==null:!0),a)return i;i=i.return}while(i!==null);return null}function Bm(i,a,d,m,v){return i.mode&1?(i.flags|=65536,i.lanes=v,i):(i===a?i.flags|=65536:(i.flags|=128,d.flags|=131072,d.flags&=-52805,d.tag===1&&(d.alternate===null?d.tag=17:(a=_r(-1,1),a.tag=2,Xr(d,a,1))),d.lanes|=1),i)}var hS=u.ReactCurrentOwner,bn=!1;function hn(i,a,d,m){a.child=i===null?hm(a,null,d,m):vi(a,i.child,d,m)}function Hm(i,a,d,m,v){d=d.render;var b=a.ref;return mi(a,v),m=Pu(i,a,d,m,b,v),d=Iu(),i!==null&&!bn?(a.updateQueue=i.updateQueue,a.flags&=-2053,i.lanes&=~v,Dr(i,a,v)):(Pt&&d&&lu(a),a.flags|=1,hn(i,a,m,v),a.child)}function Wm(i,a,d,m,v){if(i===null){var b=d.type;return typeof b=="function"&&!ad(b)&&b.defaultProps===void 0&&d.compare===null&&d.defaultProps===void 0?(a.tag=15,a.type=b,Vm(i,a,b,m,v)):(i=dl(d.type,null,m,a,a.mode,v),i.ref=a.ref,i.return=a,a.child=i)}if(b=i.child,!(i.lanes&v)){var E=b.memoizedProps;if(d=d.compare,d=d!==null?d:As,d(E,m)&&i.ref===a.ref)return Dr(i,a,v)}return a.flags|=1,i=to(b,m),i.ref=a.ref,i.return=a,a.child=i}function Vm(i,a,d,m,v){if(i!==null){var b=i.memoizedProps;if(As(b,m)&&i.ref===a.ref)if(bn=!1,a.pendingProps=m=b,(i.lanes&v)!==0)i.flags&131072&&(bn=!0);else return a.lanes=i.lanes,Dr(i,a,v)}return zu(i,a,d,m,v)}function Um(i,a,d){var m=a.pendingProps,v=m.children,b=i!==null?i.memoizedState:null;if(m.mode==="hidden")if(!(a.mode&1))a.memoizedState={baseLanes:0,cachePool:null,transitions:null},gt(Si,_n),_n|=d;else{if(!(d&1073741824))return i=b!==null?b.baseLanes|d:d,a.lanes=a.childLanes=1073741824,a.memoizedState={baseLanes:i,cachePool:null,transitions:null},a.updateQueue=null,gt(Si,_n),_n|=i,null;a.memoizedState={baseLanes:0,cachePool:null,transitions:null},m=b!==null?b.baseLanes:d,gt(Si,_n),_n|=m}else b!==null?(m=b.baseLanes|d,a.memoizedState=null):m=d,gt(Si,_n),_n|=m;return hn(i,a,v,d),a.child}function $m(i,a){var d=a.ref;(i===null&&d!==null||i!==null&&i.ref!==d)&&(a.flags|=512,a.flags|=2097152)}function zu(i,a,d,m,v){var b=xn(d)?jo:nn.current;return b=ui(a,b),mi(a,v),d=Pu(i,a,d,m,b,v),m=Iu(),i!==null&&!bn?(a.updateQueue=i.updateQueue,a.flags&=-2053,i.lanes&=~v,Dr(i,a,v)):(Pt&&m&&lu(a),a.flags|=1,hn(i,a,d,v),a.child)}function Gm(i,a,d,m,v){if(xn(d)){var b=!0;ks(a)}else b=!1;if(mi(a,v),a.stateNode===null)qs(i,a),cm(a,d,m),bu(a,d,m,v),m=!0;else if(i===null){var E=a.stateNode,O=a.memoizedProps;E.props=O;var W=E.context,ie=d.contextType;typeof ie=="object"&&ie!==null?ie=zn(ie):(ie=xn(d)?jo:nn.current,ie=ui(a,ie));var je=d.getDerivedStateFromProps,He=typeof je=="function"||typeof E.getSnapshotBeforeUpdate=="function";He||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(O!==m||W!==ie)&&um(a,E,m,ie),Kr=!1;var be=a.memoizedState;E.state=be,Ns(a,m,E,v),W=a.memoizedState,O!==m||be!==W||yn.current||Kr?(typeof je=="function"&&(xu(a,d,je,m),W=a.memoizedState),(O=Kr||lm(a,d,O,m,be,W,ie))?(He||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount()),typeof E.componentDidMount=="function"&&(a.flags|=4194308)):(typeof E.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=m,a.memoizedState=W),E.props=m,E.state=W,E.context=ie,m=O):(typeof E.componentDidMount=="function"&&(a.flags|=4194308),m=!1)}else{E=a.stateNode,om(i,a),O=a.memoizedProps,ie=a.type===a.elementType?O:Xn(a.type,O),E.props=ie,He=a.pendingProps,be=E.context,W=d.contextType,typeof W=="object"&&W!==null?W=zn(W):(W=xn(d)?jo:nn.current,W=ui(a,W));var Ct=d.getDerivedStateFromProps;(je=typeof Ct=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(O!==He||be!==W)&&um(a,E,m,W),Kr=!1,be=a.memoizedState,E.state=be,Ns(a,m,E,v);var ft=a.memoizedState;O!==He||be!==ft||yn.current||Kr?(typeof Ct=="function"&&(xu(a,d,Ct,m),ft=a.memoizedState),(ie=Kr||lm(a,d,ie,m,be,ft,W)||!1)?(je||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(m,ft,W),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(m,ft,W)),typeof E.componentDidUpdate=="function"&&(a.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof E.componentDidUpdate!="function"||O===i.memoizedProps&&be===i.memoizedState||(a.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||O===i.memoizedProps&&be===i.memoizedState||(a.flags|=1024),a.memoizedProps=m,a.memoizedState=ft),E.props=m,E.state=ft,E.context=W,m=ie):(typeof E.componentDidUpdate!="function"||O===i.memoizedProps&&be===i.memoizedState||(a.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||O===i.memoizedProps&&be===i.memoizedState||(a.flags|=1024),m=!1)}return Ru(i,a,d,m,b,v)}function Ru(i,a,d,m,v,b){$m(i,a);var E=(a.flags&128)!==0;if(!m&&!E)return v&&Gp(a,d,!1),Dr(i,a,b);m=a.stateNode,hS.current=a;var O=E&&typeof d.getDerivedStateFromError!="function"?null:m.render();return a.flags|=1,i!==null&&E?(a.child=vi(a,i.child,null,b),a.child=vi(a,null,O,b)):hn(i,a,O,b),a.memoizedState=m.state,v&&Gp(a,d,!0),a.child}function qm(i){var a=i.stateNode;a.pendingContext?Up(i,a.pendingContext,a.pendingContext!==a.context):a.context&&Up(i,a.context,!1),Su(i,a.containerInfo)}function Ym(i,a,d,m,v){return hi(),fu(v),a.flags|=256,hn(i,a,d,m),a.child}var Nu={dehydrated:null,treeContext:null,retryLane:0};function Fu(i){return{baseLanes:i,cachePool:null,transitions:null}}function Km(i,a,d){var m=a.pendingProps,v=Tt.current,b=!1,E=(a.flags&128)!==0,O;if((O=E)||(O=i!==null&&i.memoizedState===null?!1:(v&2)!==0),O?(b=!0,a.flags&=-129):(i===null||i.memoizedState!==null)&&(v|=1),gt(Tt,v&1),i===null)return du(a),i=a.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?(a.mode&1?Xc(i)?a.lanes=8:a.lanes=1073741824:a.lanes=1,null):(E=m.children,i=m.fallback,b?(m=a.mode,b=a.child,E={mode:"hidden",children:E},!(m&1)&&b!==null?(b.childLanes=0,b.pendingProps=E):b=fl(E,m,0,null),i=Oo(i,m,d,null),b.return=a,i.return=a,b.sibling=i,a.child=b,a.child.memoizedState=Fu(d),a.memoizedState=Nu,i):Lu(a,E));if(v=i.memoizedState,v!==null&&(O=v.dehydrated,O!==null))return pS(i,a,E,m,O,v,d);if(b){b=m.fallback,E=a.mode,v=i.child,O=v.sibling;var W={mode:"hidden",children:m.children};return!(E&1)&&a.child!==v?(m=a.child,m.childLanes=0,m.pendingProps=W,a.deletions=null):(m=to(v,W),m.subtreeFlags=v.subtreeFlags&14680064),O!==null?b=to(O,b):(b=Oo(b,E,d,null),b.flags|=2),b.return=a,m.return=a,m.sibling=b,a.child=m,m=b,b=a.child,E=i.child.memoizedState,E=E===null?Fu(d):{baseLanes:E.baseLanes|d,cachePool:null,transitions:E.transitions},b.memoizedState=E,b.childLanes=i.childLanes&~d,a.memoizedState=Nu,m}return b=i.child,i=b.sibling,m=to(b,{mode:"visible",children:m.children}),!(a.mode&1)&&(m.lanes=d),m.return=a,m.sibling=null,i!==null&&(d=a.deletions,d===null?(a.deletions=[i],a.flags|=16):d.push(i)),a.child=m,a.memoizedState=null,m}function Lu(i,a){return a=fl({mode:"visible",children:a},i.mode,0,null),a.return=i,i.child=a}function Gs(i,a,d,m){return m!==null&&fu(m),vi(a,i.child,null,d),i=Lu(a,a.pendingProps.children),i.flags|=2,a.memoizedState=null,i}function pS(i,a,d,m,v,b,E){if(d)return a.flags&256?(a.flags&=-257,m=Au(Error(c(422))),Gs(i,a,E,m)):a.memoizedState!==null?(a.child=i.child,a.flags|=128,null):(b=m.fallback,v=a.mode,m=fl({mode:"visible",children:m.children},v,0,null),b=Oo(b,v,E,null),b.flags|=2,m.return=a,b.return=a,m.sibling=b,a.child=m,a.mode&1&&vi(a,i.child,null,E),a.child.memoizedState=Fu(E),a.memoizedState=Nu,b);if(!(a.mode&1))return Gs(i,a,E,null);if(Xc(v))return m=Pb(v).digest,b=Error(c(419)),m=Au(b,m,void 0),Gs(i,a,E,m);if(d=(E&i.childLanes)!==0,bn||d){if(m=Kt,m!==null){switch(E&-E){case 4:v=2;break;case 16:v=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:v=32;break;case 536870912:v=268435456;break;default:v=0}v=v&(m.suspendedLanes|E)?0:v,v!==0&&v!==b.retryLane&&(b.retryLane=v,cr(i,v),Fn(m,i,v,-1))}return id(),m=Au(Error(c(421))),Gs(i,a,E,m)}return Vp(v)?(a.flags|=128,a.child=i.child,a=PS.bind(null,i),Ib(v,a),null):(i=b.treeContext,Ge&&(On=_b(v),Tn=a,Pt=!0,Kn=null,fa=!1,i!==null&&(Dn[An++]=Mr,Dn[An++]=Tr,Dn[An++]=Eo,Mr=i.id,Tr=i.overflow,Eo=a)),a=Lu(a,m.children),a.flags|=4096,a)}function Xm(i,a,d){i.lanes|=a;var m=i.alternate;m!==null&&(m.lanes|=a),vu(i.return,a,d)}function Bu(i,a,d,m,v){var b=i.memoizedState;b===null?i.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:m,tail:d,tailMode:v}:(b.isBackwards=a,b.rendering=null,b.renderingStartTime=0,b.last=m,b.tail=d,b.tailMode=v)}function Qm(i,a,d){var m=a.pendingProps,v=m.revealOrder,b=m.tail;if(hn(i,a,m.children,d),m=Tt.current,m&2)m=m&1|2,a.flags|=128;else{if(i!==null&&i.flags&128)e:for(i=a.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Xm(i,d,a);else if(i.tag===19)Xm(i,d,a);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===a)break e;for(;i.sibling===null;){if(i.return===null||i.return===a)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}m&=1}if(gt(Tt,m),!(a.mode&1))a.memoizedState=null;else switch(v){case"forwards":for(d=a.child,v=null;d!==null;)i=d.alternate,i!==null&&Bs(i)===null&&(v=d),d=d.sibling;d=v,d===null?(v=a.child,a.child=null):(v=d.sibling,d.sibling=null),Bu(a,!1,v,d,b);break;case"backwards":for(d=null,v=a.child,a.child=null;v!==null;){if(i=v.alternate,i!==null&&Bs(i)===null){a.child=v;break}i=v.sibling,v.sibling=d,d=v,v=i}Bu(a,!0,d,null,b);break;case"together":Bu(a,!1,null,null,void 0);break;default:a.memoizedState=null}return a.child}function qs(i,a){!(a.mode&1)&&i!==null&&(i.alternate=null,a.alternate=null,a.flags|=2)}function Dr(i,a,d){if(i!==null&&(a.dependencies=i.dependencies),To|=a.lanes,!(d&a.childLanes))return null;if(i!==null&&a.child!==i.child)throw Error(c(153));if(a.child!==null){for(i=a.child,d=to(i,i.pendingProps),a.child=d,d.return=a;i.sibling!==null;)i=i.sibling,d=d.sibling=to(i,i.pendingProps),d.return=a;d.sibling=null}return a.child}function mS(i,a,d){switch(a.tag){case 3:qm(a),hi();break;case 5:pm(a);break;case 1:xn(a.type)&&ks(a);break;case 4:Su(a,a.stateNode.containerInfo);break;case 10:nm(a,a.type._context,a.memoizedProps.value);break;case 13:var m=a.memoizedState;if(m!==null)return m.dehydrated!==null?(gt(Tt,Tt.current&1),a.flags|=128,null):d&a.child.childLanes?Km(i,a,d):(gt(Tt,Tt.current&1),i=Dr(i,a,d),i!==null?i.sibling:null);gt(Tt,Tt.current&1);break;case 19:if(m=(d&a.childLanes)!==0,i.flags&128){if(m)return Qm(i,a,d);a.flags|=128}var v=a.memoizedState;if(v!==null&&(v.rendering=null,v.tail=null,v.lastEffect=null),gt(Tt,Tt.current),m)break;return null;case 22:case 23:return a.lanes=0,Um(i,a,d)}return Dr(i,a,d)}function fr(i){i.flags|=4}function Zm(i,a){if(i!==null&&i.child===a.child)return!0;if(a.flags&16)return!1;for(i=a.child;i!==null;){if(i.flags&12854||i.subtreeFlags&12854)return!1;i=i.sibling}return!0}var ba,Sa,Ys,Ks;if(ge)ba=function(i,a){for(var d=a.child;d!==null;){if(d.tag===5||d.tag===6)Ne(i,d.stateNode);else if(d.tag!==4&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===a)break;for(;d.sibling===null;){if(d.return===null||d.return===a)return;d=d.return}d.sibling.return=d.return,d=d.sibling}},Sa=function(){},Ys=function(i,a,d,m,v){if(i=i.memoizedProps,i!==m){var b=a.stateNode,E=ur(Rn.current);d=pe(b,d,i,m,v,E),(a.updateQueue=d)&&fr(a)}},Ks=function(i,a,d,m){d!==m&&fr(a)};else if(Te){ba=function(i,a,d,m){for(var v=a.child;v!==null;){if(v.tag===5){var b=v.stateNode;d&&m&&(b=Hp(b,v.type,v.memoizedProps,v)),Ne(i,b)}else if(v.tag===6)b=v.stateNode,d&&m&&(b=Wp(b,v.memoizedProps,v)),Ne(i,b);else if(v.tag!==4){if(v.tag===22&&v.memoizedState!==null)b=v.child,b!==null&&(b.return=v),ba(i,v,!0,!0);else if(v.child!==null){v.child.return=v,v=v.child;continue}}if(v===a)break;for(;v.sibling===null;){if(v.return===null||v.return===a)return;v=v.return}v.sibling.return=v.return,v=v.sibling}};var Jm=function(i,a,d,m){for(var v=a.child;v!==null;){if(v.tag===5){var b=v.stateNode;d&&m&&(b=Hp(b,v.type,v.memoizedProps,v)),Bp(i,b)}else if(v.tag===6)b=v.stateNode,d&&m&&(b=Wp(b,v.memoizedProps,v)),Bp(i,b);else if(v.tag!==4){if(v.tag===22&&v.memoizedState!==null)b=v.child,b!==null&&(b.return=v),Jm(i,v,!0,!0);else if(v.child!==null){v.child.return=v,v=v.child;continue}}if(v===a)break;for(;v.sibling===null;){if(v.return===null||v.return===a)return;v=v.return}v.sibling.return=v.return,v=v.sibling}};Sa=function(i,a){var d=a.stateNode;if(!Zm(i,a)){i=d.containerInfo;var m=Lp(i);Jm(m,a,!1,!1),d.pendingChildren=m,fr(a),wb(i,m)}},Ys=function(i,a,d,m,v){var b=i.stateNode,E=i.memoizedProps;if((i=Zm(i,a))&&E===m)a.stateNode=b;else{var O=a.stateNode,W=ur(Rn.current),ie=null;E!==m&&(ie=pe(O,d,E,m,v,W)),i&&ie===null?a.stateNode=b:(b=Cb(b,ie,d,E,m,a,i,O),Ie(b,d,m,v,W)&&fr(a),a.stateNode=b,i?fr(a):ba(b,a,!1,!1))}},Ks=function(i,a,d,m){d!==m?(i=ur(gi.current),d=ur(Rn.current),a.stateNode=Fe(m,i,d,a),fr(a)):a.stateNode=i.stateNode}}else Sa=function(){},Ys=function(){},Ks=function(){};function Ca(i,a){if(!Pt)switch(i.tailMode){case"hidden":a=i.tail;for(var d=null;a!==null;)a.alternate!==null&&(d=a),a=a.sibling;d===null?i.tail=null:d.sibling=null;break;case"collapsed":d=i.tail;for(var m=null;d!==null;)d.alternate!==null&&(m=d),d=d.sibling;m===null?a||i.tail===null?i.tail=null:i.tail.sibling=null:m.sibling=null}}function on(i){var a=i.alternate!==null&&i.alternate.child===i.child,d=0,m=0;if(a)for(var v=i.child;v!==null;)d|=v.lanes|v.childLanes,m|=v.subtreeFlags&14680064,m|=v.flags&14680064,v.return=i,v=v.sibling;else for(v=i.child;v!==null;)d|=v.lanes|v.childLanes,m|=v.subtreeFlags,m|=v.flags,v.return=i,v=v.sibling;return i.subtreeFlags|=m,i.childLanes=d,a}function vS(i,a,d){var m=a.pendingProps;switch(cu(a),a.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return on(a),null;case 1:return xn(a.type)&&ws(),on(a),null;case 3:return d=a.stateNode,yi(),St(yn),St(nn),ku(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(i===null||i.child===null)&&(Ds(a)?fr(a):i===null||i.memoizedState.isDehydrated&&!(a.flags&256)||(a.flags|=1024,Kn!==null&&(rd(Kn),Kn=null))),Sa(i,a),on(a),null;case 5:Cu(a),d=ur(gi.current);var v=a.type;if(i!==null&&a.stateNode!=null)Ys(i,a,v,m,d),i.ref!==a.ref&&(a.flags|=512,a.flags|=2097152);else{if(!m){if(a.stateNode===null)throw Error(c(166));return on(a),null}if(i=ur(Rn.current),Ds(a)){if(!Ge)throw Error(c(175));i=Db(a.stateNode,a.type,a.memoizedProps,d,i,a,!fa),a.updateQueue=i,i!==null&&fr(a)}else{var b=Re(v,m,d,i,a);ba(b,a,!1,!1),a.stateNode=b,Ie(b,v,m,d,i)&&fr(a)}a.ref!==null&&(a.flags|=512,a.flags|=2097152)}return on(a),null;case 6:if(i&&a.stateNode!=null)Ks(i,a,i.memoizedProps,m);else{if(typeof m!="string"&&a.stateNode===null)throw Error(c(166));if(i=ur(gi.current),d=ur(Rn.current),Ds(a)){if(!Ge)throw Error(c(176));if(i=a.stateNode,d=a.memoizedProps,(m=Ab(i,d,a,!fa))&&(v=Tn,v!==null))switch(v.tag){case 3:Hb(v.stateNode.containerInfo,i,d,(v.mode&1)!==0);break;case 5:Wb(v.type,v.memoizedProps,v.stateNode,i,d,(v.mode&1)!==0)}m&&fr(a)}else a.stateNode=Fe(m,i,d,a)}return on(a),null;case 13:if(St(Tt),m=a.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(Pt&&On!==null&&a.mode&1&&!(a.flags&128))tm(),hi(),a.flags|=98560,v=!1;else if(v=Ds(a),m!==null&&m.dehydrated!==null){if(i===null){if(!v)throw Error(c(318));if(!Ge)throw Error(c(344));if(v=a.memoizedState,v=v!==null?v.dehydrated:null,!v)throw Error(c(317));Ob(v,a)}else hi(),!(a.flags&128)&&(a.memoizedState=null),a.flags|=4;on(a),v=!1}else Kn!==null&&(rd(Kn),Kn=null),v=!0;if(!v)return a.flags&65536?a:null}return a.flags&128?(a.lanes=d,a):(d=m!==null,d!==(i!==null&&i.memoizedState!==null)&&d&&(a.child.flags|=8192,a.mode&1&&(i===null||Tt.current&1?$t===0&&($t=3):id())),a.updateQueue!==null&&(a.flags|=4),on(a),null);case 4:return yi(),Sa(i,a),i===null&&Pe(a.stateNode.containerInfo),on(a),null;case 10:return mu(a.type._context),on(a),null;case 17:return xn(a.type)&&ws(),on(a),null;case 19:if(St(Tt),v=a.memoizedState,v===null)return on(a),null;if(m=(a.flags&128)!==0,b=v.rendering,b===null)if(m)Ca(v,!1);else{if($t!==0||i!==null&&i.flags&128)for(i=a.child;i!==null;){if(b=Bs(i),b!==null){for(a.flags|=128,Ca(v,!1),i=b.updateQueue,i!==null&&(a.updateQueue=i,a.flags|=4),a.subtreeFlags=0,i=d,d=a.child;d!==null;)m=d,v=i,m.flags&=14680066,b=m.alternate,b===null?(m.childLanes=0,m.lanes=v,m.child=null,m.subtreeFlags=0,m.memoizedProps=null,m.memoizedState=null,m.updateQueue=null,m.dependencies=null,m.stateNode=null):(m.childLanes=b.childLanes,m.lanes=b.lanes,m.child=b.child,m.subtreeFlags=0,m.deletions=null,m.memoizedProps=b.memoizedProps,m.memoizedState=b.memoizedState,m.updateQueue=b.updateQueue,m.type=b.type,v=b.dependencies,m.dependencies=v===null?null:{lanes:v.lanes,firstContext:v.firstContext}),d=d.sibling;return gt(Tt,Tt.current&1|2),a.child}i=i.sibling}v.tail!==null&&qt()>Ju&&(a.flags|=128,m=!0,Ca(v,!1),a.lanes=4194304)}else{if(!m)if(i=Bs(b),i!==null){if(a.flags|=128,m=!0,i=i.updateQueue,i!==null&&(a.updateQueue=i,a.flags|=4),Ca(v,!0),v.tail===null&&v.tailMode==="hidden"&&!b.alternate&&!Pt)return on(a),null}else 2*qt()-v.renderingStartTime>Ju&&d!==1073741824&&(a.flags|=128,m=!0,Ca(v,!1),a.lanes=4194304);v.isBackwards?(b.sibling=a.child,a.child=b):(i=v.last,i!==null?i.sibling=b:a.child=b,v.last=b)}return v.tail!==null?(a=v.tail,v.rendering=a,v.tail=a.sibling,v.renderingStartTime=qt(),a.sibling=null,i=Tt.current,gt(Tt,m?i&1|2:i&1),a):(on(a),null);case 22:case 23:return od(),d=a.memoizedState!==null,i!==null&&i.memoizedState!==null!==d&&(a.flags|=8192),d&&a.mode&1?_n&1073741824&&(on(a),ge&&a.subtreeFlags&6&&(a.flags|=8192)):on(a),null;case 24:return null;case 25:return null}throw Error(c(156,a.tag))}function gS(i,a){switch(cu(a),a.tag){case 1:return xn(a.type)&&ws(),i=a.flags,i&65536?(a.flags=i&-65537|128,a):null;case 3:return yi(),St(yn),St(nn),ku(),i=a.flags,i&65536&&!(i&128)?(a.flags=i&-65537|128,a):null;case 5:return Cu(a),null;case 13:if(St(Tt),i=a.memoizedState,i!==null&&i.dehydrated!==null){if(a.alternate===null)throw Error(c(340));hi()}return i=a.flags,i&65536?(a.flags=i&-65537|128,a):null;case 19:return St(Tt),null;case 4:return yi(),null;case 10:return mu(a.type._context),null;case 22:case 23:return od(),null;case 24:return null;default:return null}}var Xs=!1,an=!1,yS=typeof WeakSet=="function"?WeakSet:Set,we=null;function bi(i,a){var d=i.ref;if(d!==null)if(typeof d=="function")try{d(null)}catch(m){It(i,a,m)}else d.current=null}function Hu(i,a,d){try{d()}catch(m){It(i,a,m)}}var ev=!1;function xS(i,a){for(oe(i.containerInfo),we=a;we!==null;)if(i=we,a=i.child,(i.subtreeFlags&1028)!==0&&a!==null)a.return=i,we=a;else for(;we!==null;){i=we;try{var d=i.alternate;if(i.flags&1024)switch(i.tag){case 0:case 11:case 15:break;case 1:if(d!==null){var m=d.memoizedProps,v=d.memoizedState,b=i.stateNode,E=b.getSnapshotBeforeUpdate(i.elementType===i.type?m:Xn(i.type,m),v);b.__reactInternalSnapshotBeforeUpdate=E}break;case 3:ge&&ko(i.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(c(163))}}catch(O){It(i,i.return,O)}if(a=i.sibling,a!==null){a.return=i.return,we=a;break}we=i.return}return d=ev,ev=!1,d}function wa(i,a,d){var m=a.updateQueue;if(m=m!==null?m.lastEffect:null,m!==null){var v=m=m.next;do{if((v.tag&i)===i){var b=v.destroy;v.destroy=void 0,b!==void 0&&Hu(a,d,b)}v=v.next}while(v!==m)}}function Qs(i,a){if(a=a.updateQueue,a=a!==null?a.lastEffect:null,a!==null){var d=a=a.next;do{if((d.tag&i)===i){var m=d.create;d.destroy=m()}d=d.next}while(d!==a)}}function Wu(i){var a=i.ref;if(a!==null){var d=i.stateNode;switch(i.tag){case 5:i=ne(d);break;default:i=d}typeof a=="function"?a(i):a.current=i}}function tv(i){var a=i.alternate;a!==null&&(i.alternate=null,tv(a)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(a=i.stateNode,a!==null&&Be(a)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function nv(i){return i.tag===5||i.tag===3||i.tag===4}function rv(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||nv(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Vu(i,a,d){var m=i.tag;if(m===5||m===6)i=i.stateNode,a?dn(d,i,a):Le(d,i);else if(m!==4&&(i=i.child,i!==null))for(Vu(i,a,d),i=i.sibling;i!==null;)Vu(i,a,d),i=i.sibling}function Uu(i,a,d){var m=i.tag;if(m===5||m===6)i=i.stateNode,a?_e(d,i,a):J(d,i);else if(m!==4&&(i=i.child,i!==null))for(Uu(i,a,d),i=i.sibling;i!==null;)Uu(i,a,d),i=i.sibling}var Zt=null,Qn=!1;function hr(i,a,d){for(d=d.child;d!==null;)$u(i,a,d),d=d.sibling}function $u(i,a,d){if(sr&&typeof sr.onCommitFiberUnmount=="function")try{sr.onCommitFiberUnmount(Is,d)}catch{}switch(d.tag){case 5:an||bi(d,a);case 6:if(ge){var m=Zt,v=Qn;Zt=null,hr(i,a,d),Zt=m,Qn=v,Zt!==null&&(Qn?fn(Zt,d.stateNode):Vt(Zt,d.stateNode))}else hr(i,a,d);break;case 18:ge&&Zt!==null&&(Qn?Lb(Zt,d.stateNode):Fb(Zt,d.stateNode));break;case 4:ge?(m=Zt,v=Qn,Zt=d.stateNode.containerInfo,Qn=!0,hr(i,a,d),Zt=m,Qn=v):(Te&&(m=d.stateNode.containerInfo,v=Lp(m),Kc(m,v)),hr(i,a,d));break;case 0:case 11:case 14:case 15:if(!an&&(m=d.updateQueue,m!==null&&(m=m.lastEffect,m!==null))){v=m=m.next;do{var b=v,E=b.destroy;b=b.tag,E!==void 0&&(b&2||b&4)&&Hu(d,a,E),v=v.next}while(v!==m)}hr(i,a,d);break;case 1:if(!an&&(bi(d,a),m=d.stateNode,typeof m.componentWillUnmount=="function"))try{m.props=d.memoizedProps,m.state=d.memoizedState,m.componentWillUnmount()}catch(O){It(d,a,O)}hr(i,a,d);break;case 21:hr(i,a,d);break;case 22:d.mode&1?(an=(m=an)||d.memoizedState!==null,hr(i,a,d),an=m):hr(i,a,d);break;default:hr(i,a,d)}}function ov(i){var a=i.updateQueue;if(a!==null){i.updateQueue=null;var d=i.stateNode;d===null&&(d=i.stateNode=new yS),a.forEach(function(m){var v=IS.bind(null,i,m);d.has(m)||(d.add(m),m.then(v,v))})}}function Zn(i,a){var d=a.deletions;if(d!==null)for(var m=0;m<d.length;m++){var v=d[m];try{var b=i,E=a;if(ge){var O=E;e:for(;O!==null;){switch(O.tag){case 5:Zt=O.stateNode,Qn=!1;break e;case 3:Zt=O.stateNode.containerInfo,Qn=!0;break e;case 4:Zt=O.stateNode.containerInfo,Qn=!0;break e}O=O.return}if(Zt===null)throw Error(c(160));$u(b,E,v),Zt=null,Qn=!1}else $u(b,E,v);var W=v.alternate;W!==null&&(W.return=null),v.return=null}catch(ie){It(v,a,ie)}}if(a.subtreeFlags&12854)for(a=a.child;a!==null;)iv(a,i),a=a.sibling}function iv(i,a){var d=i.alternate,m=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(Zn(a,i),pr(i),m&4){try{wa(3,i,i.return),Qs(3,i)}catch(be){It(i,i.return,be)}try{wa(5,i,i.return)}catch(be){It(i,i.return,be)}}break;case 1:Zn(a,i),pr(i),m&512&&d!==null&&bi(d,d.return);break;case 5:if(Zn(a,i),pr(i),m&512&&d!==null&&bi(d,d.return),ge){if(i.flags&32){var v=i.stateNode;try{ar(v)}catch(be){It(i,i.return,be)}}if(m&4&&(v=i.stateNode,v!=null)){var b=i.memoizedProps;if(d=d!==null?d.memoizedProps:b,m=i.type,a=i.updateQueue,i.updateQueue=null,a!==null)try{he(v,a,m,d,b,i)}catch(be){It(i,i.return,be)}}}break;case 6:if(Zn(a,i),pr(i),m&4&&ge){if(i.stateNode===null)throw Error(c(162));v=i.stateNode,b=i.memoizedProps,d=d!==null?d.memoizedProps:b;try{nt(v,d,b)}catch(be){It(i,i.return,be)}}break;case 3:if(Zn(a,i),pr(i),m&4){if(ge&&Ge&&d!==null&&d.memoizedState.isDehydrated)try{Rb(a.containerInfo)}catch(be){It(i,i.return,be)}if(Te){v=a.containerInfo,b=a.pendingChildren;try{Kc(v,b)}catch(be){It(i,i.return,be)}}}break;case 4:if(Zn(a,i),pr(i),m&4&&Te){b=i.stateNode,v=b.containerInfo,b=b.pendingChildren;try{Kc(v,b)}catch(be){It(i,i.return,be)}}break;case 13:Zn(a,i),pr(i),v=i.child,v.flags&8192&&(b=v.memoizedState!==null,v.stateNode.isHidden=b,!b||v.alternate!==null&&v.alternate.memoizedState!==null||(Zu=qt())),m&4&&ov(i);break;case 22:var E=d!==null&&d.memoizedState!==null;if(i.mode&1?(an=(d=an)||E,Zn(a,i),an=d):Zn(a,i),pr(i),m&8192){if(d=i.memoizedState!==null,(i.stateNode.isHidden=d)&&!E&&i.mode&1)for(we=i,m=i.child;m!==null;){for(a=we=m;we!==null;){E=we;var O=E.child;switch(E.tag){case 0:case 11:case 14:case 15:wa(4,E,E.return);break;case 1:bi(E,E.return);var W=E.stateNode;if(typeof W.componentWillUnmount=="function"){var ie=E,je=E.return;try{var He=ie;W.props=He.memoizedProps,W.state=He.memoizedState,W.componentWillUnmount()}catch(be){It(ie,je,be)}}break;case 5:bi(E,E.return);break;case 22:if(E.memoizedState!==null){lv(a);continue}}O!==null?(O.return=E,we=O):lv(a)}m=m.sibling}if(ge){e:if(m=null,ge)for(a=i;;){if(a.tag===5){if(m===null){m=a;try{v=a.stateNode,d?wo(v):Yc(a.stateNode,a.memoizedProps)}catch(be){It(i,i.return,be)}}}else if(a.tag===6){if(m===null)try{b=a.stateNode,d?sa(b):la(b,a.memoizedProps)}catch(be){It(i,i.return,be)}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===i)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===i)break e;for(;a.sibling===null;){if(a.return===null||a.return===i)break e;m===a&&(m=null),a=a.return}m===a&&(m=null),a.sibling.return=a.return,a=a.sibling}}}break;case 19:Zn(a,i),pr(i),m&4&&ov(i);break;case 21:break;default:Zn(a,i),pr(i)}}function pr(i){var a=i.flags;if(a&2){try{if(ge){e:{for(var d=i.return;d!==null;){if(nv(d)){var m=d;break e}d=d.return}throw Error(c(160))}switch(m.tag){case 5:var v=m.stateNode;m.flags&32&&(ar(v),m.flags&=-33);var b=rv(i);Uu(i,b,v);break;case 3:case 4:var E=m.stateNode.containerInfo,O=rv(i);Vu(i,O,E);break;default:throw Error(c(161))}}}catch(W){It(i,i.return,W)}i.flags&=-3}a&4096&&(i.flags&=-4097)}function bS(i,a,d){we=i,av(i)}function av(i,a,d){for(var m=(i.mode&1)!==0;we!==null;){var v=we,b=v.child;if(v.tag===22&&m){var E=v.memoizedState!==null||Xs;if(!E){var O=v.alternate,W=O!==null&&O.memoizedState!==null||an;O=Xs;var ie=an;if(Xs=E,(an=W)&&!ie)for(we=v;we!==null;)E=we,W=E.child,E.tag===22&&E.memoizedState!==null?cv(v):W!==null?(W.return=E,we=W):cv(v);for(;b!==null;)we=b,av(b),b=b.sibling;we=v,Xs=O,an=ie}sv(i)}else v.subtreeFlags&8772&&b!==null?(b.return=v,we=b):sv(i)}}function sv(i){for(;we!==null;){var a=we;if(a.flags&8772){var d=a.alternate;try{if(a.flags&8772)switch(a.tag){case 0:case 11:case 15:an||Qs(5,a);break;case 1:var m=a.stateNode;if(a.flags&4&&!an)if(d===null)m.componentDidMount();else{var v=a.elementType===a.type?d.memoizedProps:Xn(a.type,d.memoizedProps);m.componentDidUpdate(v,d.memoizedState,m.__reactInternalSnapshotBeforeUpdate)}var b=a.updateQueue;b!==null&&am(a,b,m);break;case 3:var E=a.updateQueue;if(E!==null){if(d=null,a.child!==null)switch(a.child.tag){case 5:d=ne(a.child.stateNode);break;case 1:d=a.child.stateNode}am(a,E,d)}break;case 5:var O=a.stateNode;d===null&&a.flags&4&&Nt(O,a.type,a.memoizedProps,a);break;case 6:break;case 4:break;case 12:break;case 13:if(Ge&&a.memoizedState===null){var W=a.alternate;if(W!==null){var ie=W.memoizedState;if(ie!==null){var je=ie.dehydrated;je!==null&&Nb(je)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(c(163))}an||a.flags&512&&Wu(a)}catch(He){It(a,a.return,He)}}if(a===i){we=null;break}if(d=a.sibling,d!==null){d.return=a.return,we=d;break}we=a.return}}function lv(i){for(;we!==null;){var a=we;if(a===i){we=null;break}var d=a.sibling;if(d!==null){d.return=a.return,we=d;break}we=a.return}}function cv(i){for(;we!==null;){var a=we;try{switch(a.tag){case 0:case 11:case 15:var d=a.return;try{Qs(4,a)}catch(W){It(a,d,W)}break;case 1:var m=a.stateNode;if(typeof m.componentDidMount=="function"){var v=a.return;try{m.componentDidMount()}catch(W){It(a,v,W)}}var b=a.return;try{Wu(a)}catch(W){It(a,b,W)}break;case 5:var E=a.return;try{Wu(a)}catch(W){It(a,E,W)}}}catch(W){It(a,a.return,W)}if(a===i){we=null;break}var O=a.sibling;if(O!==null){O.return=a.return,we=O;break}we=a.return}}var Zs=0,Js=1,el=2,tl=3,nl=4;if(typeof Symbol=="function"&&Symbol.for){var ka=Symbol.for;Zs=ka("selector.component"),Js=ka("selector.has_pseudo_class"),el=ka("selector.role"),tl=ka("selector.test_id"),nl=ka("selector.text")}function Gu(i){var a=ye(i);if(a!=null){if(typeof a.memoizedProps["data-testname"]!="string")throw Error(c(364));return a}if(i=ue(i),i===null)throw Error(c(362));return i.stateNode.current}function qu(i,a){switch(a.$$typeof){case Zs:if(i.type===a.value)return!0;break;case Js:e:{a=a.value,i=[i,0];for(var d=0;d<i.length;){var m=i[d++],v=i[d++],b=a[v];if(m.tag!==5||!q(m)){for(;b!=null&&qu(m,b);)v++,b=a[v];if(v===a.length){a=!0;break e}else for(m=m.child;m!==null;)i.push(m,v),m=m.sibling}}a=!1}return a;case el:if(i.tag===5&&ae(i.stateNode,a.value))return!0;break;case nl:if((i.tag===5||i.tag===6)&&(i=ke(i),i!==null&&0<=i.indexOf(a.value)))return!0;break;case tl:if(i.tag===5&&(i=i.memoizedProps["data-testname"],typeof i=="string"&&i.toLowerCase()===a.value.toLowerCase()))return!0;break;default:throw Error(c(365))}return!1}function Yu(i){switch(i.$$typeof){case Zs:return"<"+(_(i.value)||"Unknown")+">";case Js:return":has("+(Yu(i)||"")+")";case el:return'[role="'+i.value+'"]';case nl:return'"'+i.value+'"';case tl:return'[data-testname="'+i.value+'"]';default:throw Error(c(365))}}function uv(i,a){var d=[];i=[i,0];for(var m=0;m<i.length;){var v=i[m++],b=i[m++],E=a[b];if(v.tag!==5||!q(v)){for(;E!=null&&qu(v,E);)b++,E=a[b];if(b===a.length)d.push(v);else for(v=v.child;v!==null;)i.push(v,b),v=v.sibling}}return d}function Ku(i,a){if(!N)throw Error(c(363));i=Gu(i),i=uv(i,a),a=[],i=Array.from(i);for(var d=0;d<i.length;){var m=i[d++];if(m.tag===5)q(m)||a.push(m.stateNode);else for(m=m.child;m!==null;)i.push(m),m=m.sibling}return a}var SS=Math.ceil,rl=u.ReactCurrentDispatcher,Xu=u.ReactCurrentOwner,Ft=u.ReactCurrentBatchConfig,Xe=0,Kt=null,Lt=null,Jt=0,_n=0,Si=qr(0),$t=0,ja=null,To=0,ol=0,Qu=0,Ea=null,Sn=null,Zu=0,Ju=1/0,Ar=null;function Ci(){Ju=qt()+500}var il=!1,ed=null,Qr=null,al=!1,Zr=null,sl=0,Pa=0,td=null,ll=-1,cl=0;function sn(){return Xe&6?qt():ll!==-1?ll:ll=qt()}function Jr(i){return i.mode&1?Xe&2&&Jt!==0?Jt&-Jt:rS.transition!==null?(cl===0&&(cl=qp()),cl):(i=ot,i!==0?i:et()):1}function Fn(i,a,d,m){if(50<Pa)throw Pa=0,td=null,Error(c(185));da(i,d,m),(!(Xe&2)||i!==Kt)&&(i===Kt&&(!(Xe&2)&&(ol|=d),$t===4&&eo(i,Jt)),Cn(i,m),d===1&&Xe===0&&!(a.mode&1)&&(Ci(),Ms&&lr()))}function Cn(i,a){var d=i.callbackNode;Yb(i,a);var m=Ps(i,i===Kt?Jt:0);if(m===0)d!==null&&Kp(d),i.callbackNode=null,i.callbackPriority=0;else if(a=m&-m,i.callbackPriority!==a){if(d!=null&&Kp(d),a===1)i.tag===0?nS(fv.bind(null,i)):Xp(fv.bind(null,i)),vt?Rt(function(){!(Xe&6)&&lr()}):ou(iu,lr),d=null;else{switch(Yp(m)){case 1:d=iu;break;case 4:d=Zb;break;case 16:d=au;break;case 536870912:d=Jb;break;default:d=au}d=Sv(d,dv.bind(null,i))}i.callbackPriority=a,i.callbackNode=d}}function dv(i,a){if(ll=-1,cl=0,Xe&6)throw Error(c(327));var d=i.callbackNode;if(Ao()&&i.callbackNode!==d)return null;var m=Ps(i,i===Kt?Jt:0);if(m===0)return null;if(m&30||m&i.expiredLanes||a)a=ul(i,m);else{a=m;var v=Xe;Xe|=2;var b=mv();(Kt!==i||Jt!==a)&&(Ar=null,Ci(),_o(i,a));do try{kS();break}catch(O){pv(i,O)}while(1);pu(),rl.current=b,Xe=v,Lt!==null?a=0:(Kt=null,Jt=0,a=$t)}if(a!==0){if(a===2&&(v=tu(i),v!==0&&(m=v,a=nd(i,v))),a===1)throw d=ja,_o(i,0),eo(i,m),Cn(i,qt()),d;if(a===6)eo(i,m);else{if(v=i.current.alternate,!(m&30)&&!CS(v)&&(a=ul(i,m),a===2&&(b=tu(i),b!==0&&(m=b,a=nd(i,b))),a===1))throw d=ja,_o(i,0),eo(i,m),Cn(i,qt()),d;switch(i.finishedWork=v,i.finishedLanes=m,a){case 0:case 1:throw Error(c(345));case 2:Do(i,Sn,Ar);break;case 3:if(eo(i,m),(m&130023424)===m&&(a=Zu+500-qt(),10<a)){if(Ps(i,0)!==0)break;if(v=i.suspendedLanes,(v&m)!==m){sn(),i.pingedLanes|=i.suspendedLanes&v;break}i.timeoutHandle=Ve(Do.bind(null,i,Sn,Ar),a);break}Do(i,Sn,Ar);break;case 4:if(eo(i,m),(m&4194240)===m)break;for(a=i.eventTimes,v=-1;0<m;){var E=31-qn(m);b=1<<E,E=a[E],E>v&&(v=E),m&=~b}if(m=v,m=qt()-m,m=(120>m?120:480>m?480:1080>m?1080:1920>m?1920:3e3>m?3e3:4320>m?4320:1960*SS(m/1960))-m,10<m){i.timeoutHandle=Ve(Do.bind(null,i,Sn,Ar),m);break}Do(i,Sn,Ar);break;case 5:Do(i,Sn,Ar);break;default:throw Error(c(329))}}}return Cn(i,qt()),i.callbackNode===d?dv.bind(null,i):null}function nd(i,a){var d=Ea;return i.current.memoizedState.isDehydrated&&(_o(i,a).flags|=256),i=ul(i,a),i!==2&&(a=Sn,Sn=d,a!==null&&rd(a)),i}function rd(i){Sn===null?Sn=i:Sn.push.apply(Sn,i)}function CS(i){for(var a=i;;){if(a.flags&16384){var d=a.updateQueue;if(d!==null&&(d=d.stores,d!==null))for(var m=0;m<d.length;m++){var v=d[m],b=v.getSnapshot;v=v.value;try{if(!Yn(b(),v))return!1}catch{return!1}}}if(d=a.child,a.subtreeFlags&16384&&d!==null)d.return=a,a=d;else{if(a===i)break;for(;a.sibling===null;){if(a.return===null||a.return===i)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function eo(i,a){for(a&=~Qu,a&=~ol,i.suspendedLanes|=a,i.pingedLanes&=~a,i=i.expirationTimes;0<a;){var d=31-qn(a),m=1<<d;i[d]=-1,a&=~m}}function fv(i){if(Xe&6)throw Error(c(327));Ao();var a=Ps(i,0);if(!(a&1))return Cn(i,qt()),null;var d=ul(i,a);if(i.tag!==0&&d===2){var m=tu(i);m!==0&&(a=m,d=nd(i,m))}if(d===1)throw d=ja,_o(i,0),eo(i,a),Cn(i,qt()),d;if(d===6)throw Error(c(345));return i.finishedWork=i.current.alternate,i.finishedLanes=a,Do(i,Sn,Ar),Cn(i,qt()),null}function hv(i){Zr!==null&&Zr.tag===0&&!(Xe&6)&&Ao();var a=Xe;Xe|=1;var d=Ft.transition,m=ot;try{if(Ft.transition=null,ot=1,i)return i()}finally{ot=m,Ft.transition=d,Xe=a,!(Xe&6)&&lr()}}function od(){_n=Si.current,St(Si)}function _o(i,a){i.finishedWork=null,i.finishedLanes=0;var d=i.timeoutHandle;if(d!==$e&&(i.timeoutHandle=$e,Ue(d)),Lt!==null)for(d=Lt.return;d!==null;){var m=d;switch(cu(m),m.tag){case 1:m=m.type.childContextTypes,m!=null&&ws();break;case 3:yi(),St(yn),St(nn),ku();break;case 5:Cu(m);break;case 4:yi();break;case 13:St(Tt);break;case 19:St(Tt);break;case 10:mu(m.type._context);break;case 22:case 23:od()}d=d.return}if(Kt=i,Lt=i=to(i.current,null),Jt=_n=a,$t=0,ja=null,Qu=ol=To=0,Sn=Ea=null,Io!==null){for(a=0;a<Io.length;a++)if(d=Io[a],m=d.interleaved,m!==null){d.interleaved=null;var v=m.next,b=d.pending;if(b!==null){var E=b.next;b.next=v,m.next=E}d.pending=m}Io=null}return i}function pv(i,a){do{var d=Lt;try{if(pu(),Hs.current=$s,Ws){for(var m=_t.memoizedState;m!==null;){var v=m.queue;v!==null&&(v.pending=null),m=m.next}Ws=!1}if(Mo=0,Yt=Ut=_t=null,va=!1,ga=0,Xu.current=null,d===null||d.return===null){$t=1,ja=a,Lt=null;break}e:{var b=i,E=d.return,O=d,W=a;if(a=Jt,O.flags|=32768,W!==null&&typeof W=="object"&&typeof W.then=="function"){var ie=W,je=O,He=je.tag;if(!(je.mode&1)&&(He===0||He===11||He===15)){var be=je.alternate;be?(je.updateQueue=be.updateQueue,je.memoizedState=be.memoizedState,je.lanes=be.lanes):(je.updateQueue=null,je.memoizedState=null)}var Ct=Lm(E);if(Ct!==null){Ct.flags&=-257,Bm(Ct,E,O,b,a),Ct.mode&1&&Fm(b,ie,a),a=Ct,W=ie;var ft=a.updateQueue;if(ft===null){var wn=new Set;wn.add(W),a.updateQueue=wn}else ft.add(W);break e}else{if(!(a&1)){Fm(b,ie,a),id();break e}W=Error(c(426))}}else if(Pt&&O.mode&1){var Or=Lm(E);if(Or!==null){!(Or.flags&65536)&&(Or.flags|=256),Bm(Or,E,O,b,a),fu(xi(W,O));break e}}b=W=xi(W,O),$t!==4&&($t=2),Ea===null?Ea=[b]:Ea.push(b),b=E;do{switch(b.tag){case 3:b.flags|=65536,a&=-a,b.lanes|=a;var H=Rm(b,W,a);im(b,H);break e;case 1:O=W;var z=b.type,G=b.stateNode;if(!(b.flags&128)&&(typeof z.getDerivedStateFromError=="function"||G!==null&&typeof G.componentDidCatch=="function"&&(Qr===null||!Qr.has(G)))){b.flags|=65536,a&=-a,b.lanes|=a;var Se=Nm(b,O,a);im(b,Se);break e}}b=b.return}while(b!==null)}gv(d)}catch(De){a=De,Lt===d&&d!==null&&(Lt=d=d.return);continue}break}while(1)}function mv(){var i=rl.current;return rl.current=$s,i===null?$s:i}function id(){($t===0||$t===3||$t===2)&&($t=4),Kt===null||!(To&268435455)&&!(ol&268435455)||eo(Kt,Jt)}function ul(i,a){var d=Xe;Xe|=2;var m=mv();(Kt!==i||Jt!==a)&&(Ar=null,_o(i,a));do try{wS();break}catch(v){pv(i,v)}while(1);if(pu(),Xe=d,rl.current=m,Lt!==null)throw Error(c(261));return Kt=null,Jt=0,$t}function wS(){for(;Lt!==null;)vv(Lt)}function kS(){for(;Lt!==null&&!Xb();)vv(Lt)}function vv(i){var a=bv(i.alternate,i,_n);i.memoizedProps=i.pendingProps,a===null?gv(i):Lt=a,Xu.current=null}function gv(i){var a=i;do{var d=a.alternate;if(i=a.return,a.flags&32768){if(d=gS(d,a),d!==null){d.flags&=32767,Lt=d;return}if(i!==null)i.flags|=32768,i.subtreeFlags=0,i.deletions=null;else{$t=6,Lt=null;return}}else if(d=vS(d,a,_n),d!==null){Lt=d;return}if(a=a.sibling,a!==null){Lt=a;return}Lt=a=i}while(a!==null);$t===0&&($t=5)}function Do(i,a,d){var m=ot,v=Ft.transition;try{Ft.transition=null,ot=1,jS(i,a,d,m)}finally{Ft.transition=v,ot=m}return null}function jS(i,a,d,m){do Ao();while(Zr!==null);if(Xe&6)throw Error(c(327));d=i.finishedWork;var v=i.finishedLanes;if(d===null)return null;if(i.finishedWork=null,i.finishedLanes=0,d===i.current)throw Error(c(177));i.callbackNode=null,i.callbackPriority=0;var b=d.lanes|d.childLanes;if(Kb(i,b),i===Kt&&(Lt=Kt=null,Jt=0),!(d.subtreeFlags&2064)&&!(d.flags&2064)||al||(al=!0,Sv(au,function(){return Ao(),null})),b=(d.flags&15990)!==0,d.subtreeFlags&15990||b){b=Ft.transition,Ft.transition=null;var E=ot;ot=1;var O=Xe;Xe|=4,Xu.current=null,xS(i,d),iv(d,i),le(i.containerInfo),i.current=d,bS(d),Qb(),Xe=O,ot=E,Ft.transition=b}else i.current=d;if(al&&(al=!1,Zr=i,sl=v),b=i.pendingLanes,b===0&&(Qr=null),eS(d.stateNode),Cn(i,qt()),a!==null)for(m=i.onRecoverableError,d=0;d<a.length;d++)v=a[d],m(v.value,{componentStack:v.stack,digest:v.digest});if(il)throw il=!1,i=ed,ed=null,i;return sl&1&&i.tag!==0&&Ao(),b=i.pendingLanes,b&1?i===td?Pa++:(Pa=0,td=i):Pa=0,lr(),null}function Ao(){if(Zr!==null){var i=Yp(sl),a=Ft.transition,d=ot;try{if(Ft.transition=null,ot=16>i?16:i,Zr===null)var m=!1;else{if(i=Zr,Zr=null,sl=0,Xe&6)throw Error(c(331));var v=Xe;for(Xe|=4,we=i.current;we!==null;){var b=we,E=b.child;if(we.flags&16){var O=b.deletions;if(O!==null){for(var W=0;W<O.length;W++){var ie=O[W];for(we=ie;we!==null;){var je=we;switch(je.tag){case 0:case 11:case 15:wa(8,je,b)}var He=je.child;if(He!==null)He.return=je,we=He;else for(;we!==null;){je=we;var be=je.sibling,Ct=je.return;if(tv(je),je===ie){we=null;break}if(be!==null){be.return=Ct,we=be;break}we=Ct}}}var ft=b.alternate;if(ft!==null){var wn=ft.child;if(wn!==null){ft.child=null;do{var Or=wn.sibling;wn.sibling=null,wn=Or}while(wn!==null)}}we=b}}if(b.subtreeFlags&2064&&E!==null)E.return=b,we=E;else e:for(;we!==null;){if(b=we,b.flags&2048)switch(b.tag){case 0:case 11:case 15:wa(9,b,b.return)}var H=b.sibling;if(H!==null){H.return=b.return,we=H;break e}we=b.return}}var z=i.current;for(we=z;we!==null;){E=we;var G=E.child;if(E.subtreeFlags&2064&&G!==null)G.return=E,we=G;else e:for(E=z;we!==null;){if(O=we,O.flags&2048)try{switch(O.tag){case 0:case 11:case 15:Qs(9,O)}}catch(De){It(O,O.return,De)}if(O===E){we=null;break e}var Se=O.sibling;if(Se!==null){Se.return=O.return,we=Se;break e}we=O.return}}if(Xe=v,lr(),sr&&typeof sr.onPostCommitFiberRoot=="function")try{sr.onPostCommitFiberRoot(Is,i)}catch{}m=!0}return m}finally{ot=d,Ft.transition=a}}return!1}function yv(i,a,d){a=xi(d,a),a=Rm(i,a,1),i=Xr(i,a,1),a=sn(),i!==null&&(da(i,1,a),Cn(i,a))}function It(i,a,d){if(i.tag===3)yv(i,i,d);else for(;a!==null;){if(a.tag===3){yv(a,i,d);break}else if(a.tag===1){var m=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(Qr===null||!Qr.has(m))){i=xi(d,i),i=Nm(a,i,1),a=Xr(a,i,1),i=sn(),a!==null&&(da(a,1,i),Cn(a,i));break}}a=a.return}}function ES(i,a,d){var m=i.pingCache;m!==null&&m.delete(a),a=sn(),i.pingedLanes|=i.suspendedLanes&d,Kt===i&&(Jt&d)===d&&($t===4||$t===3&&(Jt&130023424)===Jt&&500>qt()-Zu?_o(i,0):Qu|=d),Cn(i,a)}function xv(i,a){a===0&&(i.mode&1?(a=Es,Es<<=1,!(Es&130023424)&&(Es=4194304)):a=1);var d=sn();i=cr(i,a),i!==null&&(da(i,a,d),Cn(i,d))}function PS(i){var a=i.memoizedState,d=0;a!==null&&(d=a.retryLane),xv(i,d)}function IS(i,a){var d=0;switch(i.tag){case 13:var m=i.stateNode,v=i.memoizedState;v!==null&&(d=v.retryLane);break;case 19:m=i.stateNode;break;default:throw Error(c(314))}m!==null&&m.delete(a),xv(i,d)}var bv;bv=function(i,a,d){if(i!==null)if(i.memoizedProps!==a.pendingProps||yn.current)bn=!0;else{if(!(i.lanes&d)&&!(a.flags&128))return bn=!1,mS(i,a,d);bn=!!(i.flags&131072)}else bn=!1,Pt&&a.flags&1048576&&Qp(a,_s,a.index);switch(a.lanes=0,a.tag){case 2:var m=a.type;qs(i,a),i=a.pendingProps;var v=ui(a,nn.current);mi(a,d),v=Pu(null,a,m,i,v,d);var b=Iu();return a.flags|=1,typeof v=="object"&&v!==null&&typeof v.render=="function"&&v.$$typeof===void 0?(a.tag=1,a.memoizedState=null,a.updateQueue=null,xn(m)?(b=!0,ks(a)):b=!1,a.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,yu(a),v.updater=Fs,a.stateNode=v,v._reactInternals=a,bu(a,m,i,d),a=Ru(null,a,m,!0,b,d)):(a.tag=0,Pt&&b&&lu(a),hn(null,a,v,d),a=a.child),a;case 16:m=a.elementType;e:{switch(qs(i,a),i=a.pendingProps,v=m._init,m=v(m._payload),a.type=m,v=a.tag=TS(m),i=Xn(m,i),v){case 0:a=zu(null,a,m,i,d);break e;case 1:a=Gm(null,a,m,i,d);break e;case 11:a=Hm(null,a,m,i,d);break e;case 14:a=Wm(null,a,m,Xn(m.type,i),d);break e}throw Error(c(306,m,""))}return a;case 0:return m=a.type,v=a.pendingProps,v=a.elementType===m?v:Xn(m,v),zu(i,a,m,v,d);case 1:return m=a.type,v=a.pendingProps,v=a.elementType===m?v:Xn(m,v),Gm(i,a,m,v,d);case 3:e:{if(qm(a),i===null)throw Error(c(387));m=a.pendingProps,b=a.memoizedState,v=b.element,om(i,a),Ns(a,m,null,d);var E=a.memoizedState;if(m=E.element,Ge&&b.isDehydrated)if(b={element:m,isDehydrated:!1,cache:E.cache,pendingSuspenseBoundaries:E.pendingSuspenseBoundaries,transitions:E.transitions},a.updateQueue.baseState=b,a.memoizedState=b,a.flags&256){v=xi(Error(c(423)),a),a=Ym(i,a,m,d,v);break e}else if(m!==v){v=xi(Error(c(424)),a),a=Ym(i,a,m,d,v);break e}else for(Ge&&(On=Tb(a.stateNode.containerInfo),Tn=a,Pt=!0,Kn=null,fa=!1),d=hm(a,null,m,d),a.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(hi(),m===v){a=Dr(i,a,d);break e}hn(i,a,m,d)}a=a.child}return a;case 5:return pm(a),i===null&&du(a),m=a.type,v=a.pendingProps,b=i!==null?i.memoizedProps:null,E=v.children,ce(m,v)?E=null:b!==null&&ce(m,b)&&(a.flags|=32),$m(i,a),hn(i,a,E,d),a.child;case 6:return i===null&&du(a),null;case 13:return Km(i,a,d);case 4:return Su(a,a.stateNode.containerInfo),m=a.pendingProps,i===null?a.child=vi(a,null,m,d):hn(i,a,m,d),a.child;case 11:return m=a.type,v=a.pendingProps,v=a.elementType===m?v:Xn(m,v),Hm(i,a,m,v,d);case 7:return hn(i,a,a.pendingProps,d),a.child;case 8:return hn(i,a,a.pendingProps.children,d),a.child;case 12:return hn(i,a,a.pendingProps.children,d),a.child;case 10:e:{if(m=a.type._context,v=a.pendingProps,b=a.memoizedProps,E=v.value,nm(a,m,E),b!==null)if(Yn(b.value,E)){if(b.children===v.children&&!yn.current){a=Dr(i,a,d);break e}}else for(b=a.child,b!==null&&(b.return=a);b!==null;){var O=b.dependencies;if(O!==null){E=b.child;for(var W=O.firstContext;W!==null;){if(W.context===m){if(b.tag===1){W=_r(-1,d&-d),W.tag=2;var ie=b.updateQueue;if(ie!==null){ie=ie.shared;var je=ie.pending;je===null?W.next=W:(W.next=je.next,je.next=W),ie.pending=W}}b.lanes|=d,W=b.alternate,W!==null&&(W.lanes|=d),vu(b.return,d,a),O.lanes|=d;break}W=W.next}}else if(b.tag===10)E=b.type===a.type?null:b.child;else if(b.tag===18){if(E=b.return,E===null)throw Error(c(341));E.lanes|=d,O=E.alternate,O!==null&&(O.lanes|=d),vu(E,d,a),E=b.sibling}else E=b.child;if(E!==null)E.return=b;else for(E=b;E!==null;){if(E===a){E=null;break}if(b=E.sibling,b!==null){b.return=E.return,E=b;break}E=E.return}b=E}hn(i,a,v.children,d),a=a.child}return a;case 9:return v=a.type,m=a.pendingProps.children,mi(a,d),v=zn(v),m=m(v),a.flags|=1,hn(i,a,m,d),a.child;case 14:return m=a.type,v=Xn(m,a.pendingProps),v=Xn(m.type,v),Wm(i,a,m,v,d);case 15:return Vm(i,a,a.type,a.pendingProps,d);case 17:return m=a.type,v=a.pendingProps,v=a.elementType===m?v:Xn(m,v),qs(i,a),a.tag=1,xn(m)?(i=!0,ks(a)):i=!1,mi(a,d),cm(a,m,v),bu(a,m,v,d),Ru(null,a,m,!0,i,d);case 19:return Qm(i,a,d);case 22:return Um(i,a,d)}throw Error(c(156,a.tag))};function Sv(i,a){return ou(i,a)}function MS(i,a,d,m){this.tag=i,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ln(i,a,d,m){return new MS(i,a,d,m)}function ad(i){return i=i.prototype,!(!i||!i.isReactComponent)}function TS(i){if(typeof i=="function")return ad(i)?1:0;if(i!=null){if(i=i.$$typeof,i===k)return 11;if(i===I)return 14}return 2}function to(i,a){var d=i.alternate;return d===null?(d=Ln(i.tag,a,i.key,i.mode),d.elementType=i.elementType,d.type=i.type,d.stateNode=i.stateNode,d.alternate=i,i.alternate=d):(d.pendingProps=a,d.type=i.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=i.flags&14680064,d.childLanes=i.childLanes,d.lanes=i.lanes,d.child=i.child,d.memoizedProps=i.memoizedProps,d.memoizedState=i.memoizedState,d.updateQueue=i.updateQueue,a=i.dependencies,d.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},d.sibling=i.sibling,d.index=i.index,d.ref=i.ref,d}function dl(i,a,d,m,v,b){var E=2;if(m=i,typeof i=="function")ad(i)&&(E=1);else if(typeof i=="string")E=5;else e:switch(i){case h:return Oo(d.children,v,b,a);case y:E=8,v|=8;break;case x:return i=Ln(12,d,a,v|2),i.elementType=x,i.lanes=b,i;case w:return i=Ln(13,d,a,v),i.elementType=w,i.lanes=b,i;case j:return i=Ln(19,d,a,v),i.elementType=j,i.lanes=b,i;case M:return fl(d,v,b,a);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case S:E=10;break e;case C:E=9;break e;case k:E=11;break e;case I:E=14;break e;case P:E=16,m=null;break e}throw Error(c(130,i==null?i:typeof i,""))}return a=Ln(E,d,a,v),a.elementType=i,a.type=m,a.lanes=b,a}function Oo(i,a,d,m){return i=Ln(7,i,m,a),i.lanes=d,i}function fl(i,a,d,m){return i=Ln(22,i,m,a),i.elementType=M,i.lanes=d,i.stateNode={isHidden:!1},i}function sd(i,a,d){return i=Ln(6,i,null,a),i.lanes=d,i}function ld(i,a,d){return a=Ln(4,i.children!==null?i.children:[],i.key,a),a.lanes=d,a.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},a}function _S(i,a,d,m,v){this.tag=a,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=$e,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=nu(0),this.expirationTimes=nu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=nu(0),this.identifierPrefix=m,this.onRecoverableError=v,Ge&&(this.mutableSourceEagerHydrationData=null)}function Cv(i,a,d,m,v,b,E,O,W){return i=new _S(i,a,d,O,W),a===1?(a=1,b===!0&&(a|=8)):a=0,b=Ln(3,null,null,a),i.current=b,b.stateNode=i,b.memoizedState={element:m,isDehydrated:d,cache:null,transitions:null,pendingSuspenseBoundaries:null},yu(b),i}function wv(i){if(!i)return Yr;i=i._reactInternals;e:{if(V(i)!==i||i.tag!==1)throw Error(c(170));var a=i;do{switch(a.tag){case 3:a=a.stateNode.context;break e;case 1:if(xn(a.type)){a=a.stateNode.__reactInternalMemoizedMergedChildContext;break e}}a=a.return}while(a!==null);throw Error(c(171))}if(i.tag===1){var d=i.type;if(xn(d))return $p(i,d,a)}return a}function kv(i){var a=i._reactInternals;if(a===void 0)throw typeof i.render=="function"?Error(c(188)):(i=Object.keys(i).join(","),Error(c(268,i)));return i=Q(a),i===null?null:i.stateNode}function jv(i,a){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var d=i.retryLane;i.retryLane=d!==0&&d<a?d:a}}function hl(i,a){jv(i,a),(i=i.alternate)&&jv(i,a)}function DS(i){return i=Q(i),i===null?null:i.stateNode}function AS(){return null}return n.attemptContinuousHydration=function(i){if(i.tag===13){var a=cr(i,134217728);if(a!==null){var d=sn();Fn(a,i,134217728,d)}hl(i,134217728)}},n.attemptDiscreteHydration=function(i){if(i.tag===13){var a=cr(i,1);if(a!==null){var d=sn();Fn(a,i,1,d)}hl(i,1)}},n.attemptHydrationAtCurrentPriority=function(i){if(i.tag===13){var a=Jr(i),d=cr(i,a);if(d!==null){var m=sn();Fn(d,i,a,m)}hl(i,a)}},n.attemptSynchronousHydration=function(i){switch(i.tag){case 3:var a=i.stateNode;if(a.current.memoizedState.isDehydrated){var d=ua(a.pendingLanes);d!==0&&(ru(a,d|1),Cn(a,qt()),!(Xe&6)&&(Ci(),lr()))}break;case 13:hv(function(){var m=cr(i,1);if(m!==null){var v=sn();Fn(m,i,1,v)}}),hl(i,1)}},n.batchedUpdates=function(i,a){var d=Xe;Xe|=1;try{return i(a)}finally{Xe=d,Xe===0&&(Ci(),Ms&&lr())}},n.createComponentSelector=function(i){return{$$typeof:Zs,value:i}},n.createContainer=function(i,a,d,m,v,b,E){return Cv(i,a,!1,null,d,m,v,b,E)},n.createHasPseudoClassSelector=function(i){return{$$typeof:Js,value:i}},n.createHydrationContainer=function(i,a,d,m,v,b,E,O,W){return i=Cv(d,m,!0,i,v,b,E,O,W),i.context=wv(null),d=i.current,m=sn(),v=Jr(d),b=_r(m,v),b.callback=a??null,Xr(d,b,v),i.current.lanes=v,da(i,v,m),Cn(i,m),i},n.createPortal=function(i,a,d){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:p,key:m==null?null:""+m,children:i,containerInfo:a,implementation:d}},n.createRoleSelector=function(i){return{$$typeof:el,value:i}},n.createTestNameSelector=function(i){return{$$typeof:tl,value:i}},n.createTextSelector=function(i){return{$$typeof:nl,value:i}},n.deferredUpdates=function(i){var a=ot,d=Ft.transition;try{return Ft.transition=null,ot=16,i()}finally{ot=a,Ft.transition=d}},n.discreteUpdates=function(i,a,d,m,v){var b=ot,E=Ft.transition;try{return Ft.transition=null,ot=1,i(a,d,m,v)}finally{ot=b,Ft.transition=E,Xe===0&&Ci()}},n.findAllNodes=Ku,n.findBoundingRects=function(i,a){if(!N)throw Error(c(363));a=Ku(i,a),i=[];for(var d=0;d<a.length;d++)i.push(xe(a[d]));for(a=i.length-1;0<a;a--){d=i[a];for(var m=d.x,v=m+d.width,b=d.y,E=b+d.height,O=a-1;0<=O;O--)if(a!==O){var W=i[O],ie=W.x,je=ie+W.width,He=W.y,be=He+W.height;if(m>=ie&&b>=He&&v<=je&&E<=be){i.splice(a,1);break}else if(m!==ie||d.width!==W.width||be<b||He>E){if(!(b!==He||d.height!==W.height||je<m||ie>v)){ie>m&&(W.width+=ie-m,W.x=m),je<v&&(W.width=v-ie),i.splice(a,1);break}}else{He>b&&(W.height+=He-b,W.y=b),be<E&&(W.height=E-He),i.splice(a,1);break}}}return i},n.findHostInstance=kv,n.findHostInstanceWithNoPortals=function(i){return i=L(i),i=i!==null?K(i):null,i===null?null:i.stateNode},n.findHostInstanceWithWarning=function(i){return kv(i)},n.flushControlled=function(i){var a=Xe;Xe|=1;var d=Ft.transition,m=ot;try{Ft.transition=null,ot=1,i()}finally{ot=m,Ft.transition=d,Xe=a,Xe===0&&(Ci(),lr())}},n.flushPassiveEffects=Ao,n.flushSync=hv,n.focusWithin=function(i,a){if(!N)throw Error(c(363));for(i=Gu(i),a=uv(i,a),a=Array.from(a),i=0;i<a.length;){var d=a[i++];if(!q(d)){if(d.tag===5&&Oe(d.stateNode))return!0;for(d=d.child;d!==null;)a.push(d),d=d.sibling}}return!1},n.getCurrentUpdatePriority=function(){return ot},n.getFindAllNodesFailureDescription=function(i,a){if(!N)throw Error(c(363));var d=0,m=[];i=[Gu(i),0];for(var v=0;v<i.length;){var b=i[v++],E=i[v++],O=a[E];if((b.tag!==5||!q(b))&&(qu(b,O)&&(m.push(Yu(O)),E++,E>d&&(d=E)),E<a.length))for(b=b.child;b!==null;)i.push(b,E),b=b.sibling}if(d<a.length){for(i=[];d<a.length;d++)i.push(Yu(a[d]));return`findAllNodes was able to match part of the selector:
|
||
`+(m.join(" > ")+`
|
||
|
||
No matching component was found for:
|
||
`)+i.join(" > ")}return null},n.getPublicRootInstance=function(i){if(i=i.current,!i.child)return null;switch(i.child.tag){case 5:return ne(i.child.stateNode);default:return i.child.stateNode}},n.injectIntoDevTools=function(i){if(i={bundleType:i.bundleType,version:i.version,rendererPackageName:i.rendererPackageName,rendererConfig:i.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:u.ReactCurrentDispatcher,findHostInstanceByFiber:DS,findFiberByHostInstance:i.findFiberByHostInstance||AS,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")i=!1;else{var a=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(a.isDisabled||!a.supportsFiber)i=!0;else{try{Is=a.inject(i),sr=a}catch{}i=!!a.checkDCE}}return i},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(i,a,d,m){if(!N)throw Error(c(363));i=Ku(i,a);var v=Ze(i,d,m).disconnect;return{disconnect:function(){v()}}},n.registerMutableSourceForHydration=function(i,a){var d=a._getVersion;d=d(a._source),i.mutableSourceEagerHydrationData==null?i.mutableSourceEagerHydrationData=[a,d]:i.mutableSourceEagerHydrationData.push(a,d)},n.runWithPriority=function(i,a){var d=ot;try{return ot=i,a()}finally{ot=d}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(i,a,d,m){var v=a.current,b=sn(),E=Jr(v);return d=wv(d),a.context===null?a.context=d:a.pendingContext=d,a=_r(b,E),a.payload={element:i},m=m===void 0?null:m,m!==null&&(a.callback=m),i=Xr(v,a,E),i!==null&&(Fn(i,v,E,b),Rs(i,v,E)),E},n};(function(e){e.exports=pO})(hO);const mO=P3(Vf);var pc={},vO={get exports(){return pc},set exports(e){pc=e}},li={};/**
|
||
* @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.
|
||
*/li.ConcurrentRoot=1;li.ContinuousEventPriority=4;li.DefaultEventPriority=16;li.DiscreteEventPriority=1;li.IdleEventPriority=536870912;li.LegacyRoot=0;(function(e){e.exports=li})(vO);const Z0={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let J0=!1,e1=!1;const Dp=".react-konva-event",gO=`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
|
||
`,yO=`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
|
||
`,xO={};function Hc(e,t,n=xO){if(!J0&&"zIndex"in t&&(console.warn(yO),J0=!0),!e1&&t.draggable){var r=t.x!==void 0||t.y!==void 0,o=t.onDragEnd||t.onDragMove;r&&!o&&(console.warn(gO),e1=!0)}for(var s in n)if(!Z0[s]){var c=s.slice(0,2)==="on",u=n[s]!==t[s];if(c&&u){var f=s.substr(2).toLowerCase();f.substr(0,7)==="content"&&(f="content"+f.substr(7,1).toUpperCase()+f.substr(8)),e.off(f,n[s])}var p=!t.hasOwnProperty(s);p&&e.setAttr(s,void 0)}var h=t._useStrictMode,y={},x=!1;const S={};for(var s in t)if(!Z0[s]){var c=s.slice(0,2)==="on",C=n[s]!==t[s];if(c&&C){var f=s.substr(2).toLowerCase();f.substr(0,7)==="content"&&(f="content"+f.substr(7,1).toUpperCase()+f.substr(8)),t[s]&&(S[f]=t[s])}!c&&(t[s]!==n[s]||h&&t[s]!==e.getAttr(s))&&(x=!0,y[s]=t[s])}x&&(e.setAttrs(y),So(e));for(var f in S)e.on(f+Dp,S[f])}function So(e){if(!I3.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const H4={},bO={};Va.Node.prototype._applyProps=Hc;function SO(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),So(e)}function CO(e,t,n){let r=Va[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=Va.Group);const o={},s={};for(var c in t){var u=c.slice(0,2)==="on";u?s[c]=t[c]:o[c]=t[c]}const f=new r(o);return Hc(f,s),f}function wO(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function kO(e,t,n){return!1}function jO(e){return e}function EO(){return null}function PO(){return null}function IO(e,t,n,r){return bO}function MO(){}function TO(e){}function _O(e,t){return!1}function DO(){return H4}function AO(){return H4}const OO=setTimeout,zO=clearTimeout,RO=-1;function NO(e,t){return!1}const FO=!1,LO=!0,BO=!0;function HO(e,t){t.parent===e?t.moveToTop():e.add(t),So(e)}function WO(e,t){t.parent===e?t.moveToTop():e.add(t),So(e)}function W4(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),So(e)}function VO(e,t,n){W4(e,t,n)}function UO(e,t){t.destroy(),t.off(Dp),So(e)}function $O(e,t){t.destroy(),t.off(Dp),So(e)}function GO(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function qO(e,t,n){}function YO(e,t,n,r,o){Hc(e,o,r)}function KO(e){e.hide(),So(e)}function XO(e){}function QO(e,t){(t.visible==null||t.visible)&&e.show()}function ZO(e,t){}function JO(e){}function ez(){}const tz=()=>pc.DefaultEventPriority,nz=Object.freeze(Object.defineProperty({__proto__:null,appendChild:HO,appendChildToContainer:WO,appendInitialChild:SO,cancelTimeout:zO,clearContainer:JO,commitMount:qO,commitTextUpdate:GO,commitUpdate:YO,createInstance:CO,createTextInstance:wO,detachDeletedInstance:ez,finalizeInitialChildren:kO,getChildHostContext:AO,getCurrentEventPriority:tz,getPublicInstance:jO,getRootHostContext:DO,hideInstance:KO,hideTextInstance:XO,idlePriority:Bl.unstable_IdlePriority,insertBefore:W4,insertInContainerBefore:VO,isPrimaryRenderer:FO,noTimeout:RO,now:Bl.unstable_now,prepareForCommit:EO,preparePortalMount:PO,prepareUpdate:IO,removeChild:UO,removeChildFromContainer:$O,resetAfterCommit:MO,resetTextContent:TO,run:Bl.unstable_runWithPriority,scheduleTimeout:OO,shouldDeprioritizeSubtree:_O,shouldSetTextContent:NO,supportsMutation:BO,unhideInstance:QO,unhideTextInstance:ZO,warnsIfNotActing:LO},Symbol.toStringTag,{value:"Module"}));var rz=Object.defineProperty,oz=Object.defineProperties,iz=Object.getOwnPropertyDescriptors,t1=Object.getOwnPropertySymbols,az=Object.prototype.hasOwnProperty,sz=Object.prototype.propertyIsEnumerable,n1=(e,t,n)=>t in e?rz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,r1=(e,t)=>{for(var n in t||(t={}))az.call(t,n)&&n1(e,n,t[n]);if(t1)for(var n of t1(t))sz.call(t,n)&&n1(e,n,t[n]);return e},lz=(e,t)=>oz(e,iz(t));function V4(e,t,n){if(!e)return;if(n(e)===!0)return e;let r=t?e.return:e.child;for(;r;){const o=V4(r,t,n);if(o)return o;r=t?null:r.sibling}}function U4(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const Ap=U4(g.createContext(null));class $4 extends g.Component{render(){return g.createElement(Ap.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:cz,ReactCurrentDispatcher:uz}=g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function dz(){const e=g.useContext(Ap);if(!e)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const t=g.useId();return g.useMemo(()=>{var r;return(r=cz.current)!=null?r:V4(e,!1,o=>{let s=o.memoizedState;for(;s;){if(s.memoizedState===t)return!0;s=s.next}})},[e,t])}function fz(){var e,t;const n=dz(),[r]=g.useState(()=>new Map);r.clear();let o=n;for(;o;){const s=(e=o.type)==null?void 0:e._context;s&&s!==Ap&&!r.has(s)&&r.set(s,(t=uz.current)==null?void 0:t.readContext(U4(s))),o=o.return}return g.useMemo(()=>Array.from(r.keys()).reduce((s,c)=>u=>g.createElement(s,null,g.createElement(c.Provider,lz(r1({},u),{value:r.get(c)}))),s=>g.createElement($4,r1({},s))),[r])}function hz(e){const t=Me.useRef();return Me.useLayoutEffect(()=>{t.current=e}),t.current}const pz=e=>{const t=Me.useRef(),n=Me.useRef(),r=Me.useRef(),o=hz(e),s=fz(),c=u=>{const{forwardedRef:f}=e;f&&(typeof f=="function"?f(u):f.current=u)};return Me.useLayoutEffect(()=>(n.current=new Va.Stage({width:e.width,height:e.height,container:t.current}),c(n.current),r.current=Ra.createContainer(n.current,pc.LegacyRoot,!1,null),Ra.updateContainer(Me.createElement(s,{},e.children),r.current),()=>{Va.isBrowser&&(c(null),Ra.updateContainer(null,r.current,null),n.current.destroy())}),[]),Me.useLayoutEffect(()=>{c(n.current),Hc(n.current,e,o),Ra.updateContainer(Me.createElement(s,{},e.children),r.current,null)}),Me.createElement("div",{ref:t,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},Da="Layer",Vr="Group",Ur="Rect",Ro="Circle",mc="Line",G4="Image",mz="Transformer",Ra=mO(nz);Ra.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:Me.version,rendererPackageName:"react-konva"});const vz=Me.forwardRef((e,t)=>Me.createElement($4,{},Me.createElement(pz,{...e,forwardedRef:t}))),gz=me([tt,Ot],(e,t)=>{const{tool:n,isMovingBoundingBox:r}=e;return{tool:n,isStaging:t,isMovingBoundingBox:r}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),yz=()=>{const e=Y(),{tool:t,isStaging:n,isMovingBoundingBox:r}=A(gz);return{handleDragStart:g.useCallback(()=>{(t==="move"||n)&&!r&&e(Kl(!0))},[e,r,n,t]),handleDragMove:g.useCallback(o=>{if(!((t==="move"||n)&&!r))return;const s={x:o.target.x(),y:o.target.y()};e($1(s))},[e,r,n,t]),handleDragEnd:g.useCallback(()=>{(t==="move"||n)&&!r&&e(Kl(!1))},[e,r,n,t])}},xz=me([tt,bt,Ot],(e,t,n)=>{const{cursorPosition:r,shouldLockBoundingBox:o,shouldShowBoundingBox:s,tool:c,isMaskEnabled:u,shouldSnapToGrid:f}=e;return{activeTabName:t,isCursorOnCanvas:Boolean(r),shouldLockBoundingBox:o,shouldShowBoundingBox:s,tool:c,isStaging:n,isMaskEnabled:u,shouldSnapToGrid:f}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),bz=()=>{const e=Y(),{activeTabName:t,shouldShowBoundingBox:n,tool:r,isStaging:o,isMaskEnabled:s,shouldSnapToGrid:c}=A(xz),u=g.useRef(null),f=G1(),p=()=>e(Qf());de(["shift+c"],()=>{p()},{enabled:()=>!o,preventDefault:!0},[]);const h=()=>e(is(!s));de(["h"],()=>{h()},{enabled:()=>!o,preventDefault:!0},[s]),de(["n"],()=>{e(Xl(!c))},{enabled:!0,preventDefault:!0},[c]),de("esc",()=>{e(M3())},{enabled:()=>!0,preventDefault:!0}),de("shift+h",()=>{e(T3(!n))},{enabled:()=>!o,preventDefault:!0},[t,n]),de(["space"],y=>{y.repeat||(f==null||f.container().focus(),r!=="move"&&(u.current=r,e(br("move"))),r==="move"&&u.current&&u.current!=="move"&&(e(br(u.current)),u.current="move"))},{keyup:!0,keydown:!0,preventDefault:!0},[r,u])},Op=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}},q4=()=>{const e=Y(),t=wr(),n=G1();return{updateColorUnderCursor:()=>{if(!n||!t)return;const r=n.getPointerPosition();if(!r)return;const o=_3.pixelRatio,[s,c,u,f]=t.getContext().getImageData(r.x*o,r.y*o,1,1).data;e(D3({r:s,g:c,b:u,a:f}))},commitColorUnderCursor:()=>{e(A3())}}},Sz=me([bt,tt,Ot],(e,t,n)=>{const{tool:r}=t;return{tool:r,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),Cz=e=>{const t=Y(),{tool:n,isStaging:r}=A(Sz),{commitColorUnderCursor:o}=q4();return g.useCallback(s=>{if(!e.current)return;if(e.current.container().focus(),n==="move"||r){t(Kl(!0));return}if(n==="colorPicker"){o();return}const c=Op(e.current);c&&(s.evt.preventDefault(),t(q1(!0)),t(O3([c.x,c.y])))},[e,n,r,t,o])},wz=me([bt,tt,Ot],(e,t,n)=>{const{tool:r,isDrawing:o}=t;return{tool:r,isDrawing:o,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),kz=(e,t,n)=>{const r=Y(),{isDrawing:o,tool:s,isStaging:c}=A(wz),{updateColorUnderCursor:u}=q4();return g.useCallback(()=>{if(!e.current)return;const f=Op(e.current);if(f){if(r(z3(f)),n.current=f,s==="colorPicker"){u();return}!o||s==="move"||c||(t.current=!0,r(Y1([f.x,f.y])))}},[t,r,o,c,n,e,s,u])},jz=()=>{const e=Y();return g.useCallback(()=>{e(R3())},[e])},Ez=me([bt,tt,Ot],(e,t,n)=>{const{tool:r,isDrawing:o}=t;return{tool:r,isDrawing:o,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),Pz=(e,t)=>{const n=Y(),{tool:r,isDrawing:o,isStaging:s}=A(Ez);return g.useCallback(()=>{if(r==="move"||s){n(Kl(!1));return}if(!t.current&&o&&e.current){const c=Op(e.current);if(!c)return;n(Y1([c.x,c.y]))}else t.current=!1;n(q1(!1))},[t,n,o,s,e,r])},Iz=me([tt],e=>{const{isMoveStageKeyHeld:t,stageScale:n}=e;return{isMoveStageKeyHeld:t,stageScale:n}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),Mz=e=>{const t=Y(),{isMoveStageKeyHeld:n,stageScale:r}=A(Iz);return g.useCallback(o=>{if(!e.current||n)return;o.evt.preventDefault();const s=e.current.getPointerPosition();if(!s)return;const c={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 f=ee.clamp(r*N3**u,F3,L3),p={x:s.x-c.x*f,y:s.y-c.y*f};t(B3(f)),t($1(p))},[e,n,r,t])},Tz=me(tt,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageDimensions:r,stageScale:o,shouldDarkenOutsideBoundingBox:s,stageCoordinates:c}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,shouldDarkenOutsideBoundingBox:s,stageCoordinates:c,stageDimensions:r,stageScale:o}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),_z=()=>{const{boundingBoxCoordinates:e,boundingBoxDimensions:t,shouldDarkenOutsideBoundingBox:n,stageCoordinates:r,stageDimensions:o,stageScale:s}=A(Tz);return l.jsxs(Vr,{children:[l.jsx(Ur,{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}),l.jsx(Ur,{x:e.x,y:e.y,width:t.width,height:t.height,fill:"rgb(255,255,255)",listening:!1,visible:n,globalCompositeOperation:"destination-out"})]})},Dz=me([tt],e=>{const{stageScale:t,stageCoordinates:n,stageDimensions:r}=e;return{stageScale:t,stageCoordinates:n,stageDimensions:r}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),Az=()=>{const e=A(f=>f.ui.currentTheme),{stageScale:t,stageCoordinates:n,stageDimensions:r}=A(Dz),[o,s]=g.useState([]),[c]=k1("colors",["gridLineColor"]),u=g.useCallback(f=>f/t,[t]);return g.useLayoutEffect(()=>{const{width:f,height:p}=r,{x:h,y}=n,x={x1:0,y1:0,x2:f,y2:p,offset:{x:u(h),y:u(y)}},S={x:Math.ceil(u(h)/64)*64,y:Math.ceil(u(y)/64)*64},C={x1:-S.x,y1:-S.y,x2:u(f)-S.x+64,y2:u(p)-S.y+64},w={x1:Math.min(x.x1,C.x1),y1:Math.min(x.y1,C.y1),x2:Math.max(x.x2,C.x2),y2:Math.max(x.y2,C.y2)},j=w.x2-w.x1,I=w.y2-w.y1,P=Math.round(j/64)+1,M=Math.round(I/64)+1,T=ee.range(0,P).map(_=>l.jsx(mc,{x:w.x1+_*64,y:w.y1,points:[0,0,0,I],stroke:c,strokeWidth:1},`x_${_}`)),D=ee.range(0,M).map(_=>l.jsx(mc,{x:w.x1,y:w.y1+_*64,points:[0,0,j,0],stroke:c,strokeWidth:1},`y_${_}`));s(T.concat(D))},[t,n,r,e,u,c]),l.jsx(Vr,{children:o})},Oz=me([e=>e.gallery],e=>e.intermediateImage?e.intermediateImage:null,{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),zz=e=>{const{...t}=e,n=A(Oz),[r,o]=g.useState(null);if(g.useEffect(()=>{if(!n)return;const p=new Image;p.onload=()=>{o(p)},p.src=n.url},[n]),!(n!=null&&n.boundingBox))return null;const{boundingBox:{x:s,y:c,width:u,height:f}}=n;return r?l.jsx(G4,{x:s,y:c,width:u,height:f,image:r,listening:!1,...t}):null},Yo=e=>{const{r:t,g:n,b:r,a:o}=e;return`rgba(${t}, ${n}, ${r}, ${o})`},Rz=me(tt,e=>{const{maskColor:t,stageCoordinates:n,stageDimensions:r,stageScale:o}=e;return{stageCoordinates:n,stageDimensions:r,stageScale:o,maskColorString:Yo(t)}}),o1=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),Nz=e=>{const{...t}=e,{maskColorString:n,stageCoordinates:r,stageDimensions:o,stageScale:s}=A(Rz),[c,u]=g.useState(null),[f,p]=g.useState(0),h=g.useRef(null),y=g.useCallback(()=>{p(f+1),setTimeout(y,500)},[f]);return g.useEffect(()=>{if(c)return;const x=new Image;x.onload=()=>{u(x)},x.src=o1(n)},[c,n]),g.useEffect(()=>{c&&(c.src=o1(n))},[c,n]),g.useEffect(()=>{const x=setInterval(()=>p(S=>(S+1)%5),50);return()=>clearInterval(x)},[]),!c||!ee.isNumber(r.x)||!ee.isNumber(r.y)||!ee.isNumber(s)||!ee.isNumber(o.width)||!ee.isNumber(o.height)?null:l.jsx(Ur,{ref:h,offsetX:r.x/s,offsetY:r.y/s,height:o.height/s,width:o.width/s,fillPatternImage:c,fillPatternOffsetY:ee.isNumber(f)?f:0,fillPatternRepeat:"repeat",fillPatternScale:{x:1/s,y:1/s},listening:!0,globalCompositeOperation:"source-in",...t})},Fz=me([tt],e=>({objects:e.layerState.objects}),{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),Lz=e=>{const{...t}=e,{objects:n}=A(Fz);return l.jsx(Vr,{listening:!1,...t,children:n.filter(H3).map((r,o)=>l.jsx(mc,{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 No=g,Bz=function(t,n,r){const o=No.useRef("loading"),s=No.useRef(),[c,u]=No.useState(0),f=No.useRef(),p=No.useRef(),h=No.useRef();return(f.current!==t||p.current!==n||h.current!==r)&&(o.current="loading",s.current=void 0,f.current=t,p.current=n,h.current=r),No.useLayoutEffect(function(){if(!t)return;var y=document.createElement("img");function x(){o.current="loaded",s.current=y,u(Math.random())}function S(){o.current="failed",s.current=void 0,u(Math.random())}return y.addEventListener("load",x),y.addEventListener("error",S),n&&(y.crossOrigin=n),r&&(y.referrerpolicy=r),y.src=t,function(){y.removeEventListener("load",x),y.removeEventListener("error",S)}},[t,n,r]),[s.current,o.current]};const Y4=e=>{const{url:t,x:n,y:r}=e,[o]=Bz(t);return l.jsx(G4,{x:n,y:r,image:o,listening:!1})},Hz=me([tt],e=>{const{layerState:{objects:t}}=e;return{objects:t}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),Wz=()=>{const{objects:e}=A(Hz);return e?l.jsx(Vr,{name:"outpainting-objects",listening:!1,children:e.map((t,n)=>{if(U1(t))return l.jsx(Y4,{x:t.x,y:t.y,url:t.image.url},n);if(W3(t)){const r=l.jsx(mc,{points:t.points,stroke:t.color?Yo(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?l.jsx(Vr,{clipX:t.clip.x,clipY:t.clip.y,clipWidth:t.clip.width,clipHeight:t.clip.height,children:r},n):r}else{if(V3(t))return l.jsx(Ur,{x:t.x,y:t.y,width:t.width,height:t.height,fill:Yo(t.color)},n);if(U3(t))return l.jsx(Ur,{x:t.x,y:t.y,width:t.width,height:t.height,fill:"rgb(255, 255, 255)",globalCompositeOperation:"destination-out"},n)}})}):null},Vz=me([tt],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingImage:r,shouldShowStagingOutline:o,boundingBoxCoordinates:{x:s,y:c},boundingBoxDimensions:{width:u,height:f}}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shouldShowStagingImage:r,shouldShowStagingOutline:o,x:s,y:c,width:u,height:f}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),Uz=e=>{const{...t}=e,{currentStagingAreaImage:n,shouldShowStagingImage:r,shouldShowStagingOutline:o,x:s,y:c,width:u,height:f}=A(Vz);return l.jsxs(Vr,{...t,children:[r&&n&&l.jsx(Y4,{url:n.image.url,x:s,y:c}),o&&l.jsxs(Vr,{children:[l.jsx(Ur,{x:s,y:c,width:u,height:f,strokeWidth:1,stroke:"white",strokeScaleEnabled:!1}),l.jsx(Ur,{x:s,y:c,width:u,height:f,dash:[4,4],strokeWidth:1,stroke:"black",strokeScaleEnabled:!1})]})]})},$z=me([tt],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingOutline:r,shouldShowStagingImage:o}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shouldShowStagingImage:o,shouldShowStagingOutline:r}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),Gz=()=>{const e=Y(),{isOnFirstImage:t,isOnLastImage:n,currentStagingAreaImage:r,shouldShowStagingImage:o}=A($z),{t:s}=X(),c=g.useCallback(()=>{e(Rv(!0))},[e]),u=g.useCallback(()=>{e(Rv(!1))},[e]);de(["left"],()=>{f()},{enabled:()=>!0,preventDefault:!0}),de(["right"],()=>{p()},{enabled:()=>!0,preventDefault:!0}),de(["enter"],()=>{h()},{enabled:()=>!0,preventDefault:!0});const f=()=>e($3()),p=()=>e(G3()),h=()=>e(q3());return r?l.jsx(B,{pos:"absolute",bottom:4,w:"100%",align:"center",justify:"center",filter:"drop-shadow(0 0.5rem 1rem rgba(0,0,0))",onMouseOver:c,onMouseOut:u,children:l.jsxs(Qt,{isAttached:!0,children:[l.jsx(se,{tooltip:`${s("unifiedCanvas.previous")} (Left)`,"aria-label":`${s("unifiedCanvas.previous")} (Left)`,icon:l.jsx(b9,{}),onClick:f,colorScheme:"accent",isDisabled:t}),l.jsx(se,{tooltip:`${s("unifiedCanvas.next")} (Right)`,"aria-label":`${s("unifiedCanvas.next")} (Right)`,icon:l.jsx(S9,{}),onClick:p,colorScheme:"accent",isDisabled:n}),l.jsx(se,{tooltip:`${s("unifiedCanvas.accept")} (Enter)`,"aria-label":`${s("unifiedCanvas.accept")} (Enter)`,icon:l.jsx(Ac,{}),onClick:h,colorScheme:"accent"}),l.jsx(se,{tooltip:s("unifiedCanvas.showHide"),"aria-label":s("unifiedCanvas.showHide"),"data-alert":!o,icon:o?l.jsx(I9,{}):l.jsx(P9,{}),onClick:()=>e(Y3(!o)),colorScheme:"accent"}),l.jsx(se,{tooltip:s("unifiedCanvas.saveToGallery"),"aria-label":s("unifiedCanvas.saveToGallery"),icon:l.jsx(Qh,{}),onClick:()=>e(K3(r.image.url)),colorScheme:"accent"}),l.jsx(se,{tooltip:s("unifiedCanvas.discardAll"),"aria-label":s("unifiedCanvas.discardAll"),icon:l.jsx(vs,{style:{transform:"rotate(45deg)"}}),onClick:()=>e(X3()),colorScheme:"error",fontSize:20})]})}):null},Ni=e=>Math.round(e*100)/100,qz=me([tt],e=>{const{cursorPosition:t}=e,{cursorX:n,cursorY:r}=t?{cursorX:t.x,cursorY:t.y}:{cursorX:-1,cursorY:-1};return{cursorCoordinatesString:`(${Ni(n)}, ${Ni(r)})`}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}});function Yz(){const{cursorCoordinatesString:e}=A(qz),{t}=X();return l.jsx(Ye,{children:`${t("unifiedCanvas.cursorPosition")}: ${e}`})}const Uf="var(--invokeai-colors-warning-500)",Kz=me([tt],e=>{const{stageDimensions:{width:t,height:n},stageCoordinates:{x:r,y:o},boundingBoxDimensions:{width:s,height:c},scaledBoundingBoxDimensions:{width:u,height:f},boundingBoxCoordinates:{x:p,y:h},stageScale:y,shouldShowCanvasDebugInfo:x,layer:S,boundingBoxScaleMethod:C,shouldPreserveMaskedArea:k}=e;let w="inherit";return(C==="none"&&(s<512||c<512)||C==="manual"&&u*f<512*512)&&(w=Uf),{activeLayerColor:S==="mask"?Uf:"inherit",activeLayerString:S.charAt(0).toUpperCase()+S.slice(1),boundingBoxColor:w,boundingBoxCoordinatesString:`(${Ni(p)}, ${Ni(h)})`,boundingBoxDimensionsString:`${s}×${c}`,scaledBoundingBoxDimensionsString:`${u}×${f}`,canvasCoordinatesString:`${Ni(r)}×${Ni(o)}`,canvasDimensionsString:`${t}×${n}`,canvasScaleString:Math.round(y*100),shouldShowCanvasDebugInfo:x,shouldShowBoundingBox:C!=="auto",shouldShowScaledBoundingBox:C!=="none",shouldPreserveMaskedArea:k}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),Xz=()=>{const{activeLayerColor:e,activeLayerString:t,boundingBoxColor:n,boundingBoxCoordinatesString:r,boundingBoxDimensionsString:o,scaledBoundingBoxDimensionsString:s,shouldShowScaledBoundingBox:c,canvasCoordinatesString:u,canvasDimensionsString:f,canvasScaleString:p,shouldShowCanvasDebugInfo:h,shouldShowBoundingBox:y,shouldPreserveMaskedArea:x}=A(Kz),{t:S}=X();return l.jsxs(B,{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.800"},children:[l.jsx(Ye,{style:{color:e},children:`${S("unifiedCanvas.activeLayer")}: ${t}`}),l.jsx(Ye,{children:`${S("unifiedCanvas.canvasScale")}: ${p}%`}),x&&l.jsx(Ye,{style:{color:Uf},children:"Preserve Masked Area: On"}),y&&l.jsx(Ye,{style:{color:n},children:`${S("unifiedCanvas.boundingBox")}: ${o}`}),c&&l.jsx(Ye,{style:{color:n},children:`${S("unifiedCanvas.scaledBoundingBox")}: ${s}`}),h&&l.jsxs(l.Fragment,{children:[l.jsx(Ye,{children:`${S("unifiedCanvas.boundingBoxPosition")}: ${r}`}),l.jsx(Ye,{children:`${S("unifiedCanvas.canvasDimensions")}: ${f}`}),l.jsx(Ye,{children:`${S("unifiedCanvas.canvasPosition")}: ${u}`}),l.jsx(Yz,{})]})]})},Qz=me(tt,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageScale:r,isDrawing:o,isTransformingBoundingBox:s,isMovingBoundingBox:c,tool:u,shouldSnapToGrid:f}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,isDrawing:o,isMovingBoundingBox:c,isTransformingBoundingBox:s,stageScale:r,shouldSnapToGrid:f,tool:u,hitStrokeWidth:20/r}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),Zz=e=>{const{...t}=e,n=Y(),{boundingBoxCoordinates:r,boundingBoxDimensions:o,isDrawing:s,isMovingBoundingBox:c,isTransformingBoundingBox:u,stageScale:f,shouldSnapToGrid:p,tool:h,hitStrokeWidth:y}=A(Qz),x=g.useRef(null),S=g.useRef(null),[C,k]=g.useState(!1);g.useEffect(()=>{var Q;!x.current||!S.current||(x.current.nodes([S.current]),(Q=x.current.getLayer())==null||Q.batchDraw())},[]);const w=64*f,j=g.useCallback(Q=>{if(!p){n(dd({x:Math.floor(Q.target.x()),y:Math.floor(Q.target.y())}));return}const U=Q.target.x(),K=Q.target.y(),te=Nv(U,64),ne=Nv(K,64);Q.target.x(te),Q.target.y(ne),n(dd({x:te,y:ne}))},[n,p]),I=g.useCallback(()=>{if(!S.current)return;const Q=S.current,U=Q.scaleX(),K=Q.scaleY(),te=Math.round(Q.width()*U),ne=Math.round(Q.height()*K),$=Math.round(Q.x()),Z=Math.round(Q.y());n(Oa({width:te,height:ne})),n(dd({x:p?pl($,64):$,y:p?pl(Z,64):Z})),Q.scaleX(1),Q.scaleY(1)},[n,p]),P=g.useCallback((Q,U,K)=>{const te=Q.x%w,ne=Q.y%w;return{x:pl(U.x,w)+te,y:pl(U.y,w)+ne}},[w]),M=()=>{n(fd(!0))},T=()=>{n(fd(!1)),n(hd(!1)),n(ml(!1)),k(!1)},D=()=>{n(hd(!0))},_=()=>{n(fd(!1)),n(hd(!1)),n(ml(!1)),k(!1)},R=()=>{k(!0)},V=()=>{!u&&!c&&k(!1)},F=()=>{n(ml(!0))},L=()=>{n(ml(!1))};return l.jsxs(Vr,{...t,children:[l.jsx(Ur,{height:o.height,width:o.width,x:r.x,y:r.y,onMouseEnter:F,onMouseOver:F,onMouseLeave:L,onMouseOut:L}),l.jsx(Ur,{draggable:!0,fillEnabled:!1,height:o.height,hitStrokeWidth:y,listening:!s&&h==="move",onDragStart:D,onDragEnd:_,onDragMove:j,onMouseDown:D,onMouseOut:V,onMouseOver:R,onMouseEnter:R,onMouseUp:_,onTransform:I,onTransformEnd:T,ref:S,stroke:C?"rgba(255,255,255,0.7)":"white",strokeWidth:(C?8:1)/f,width:o.width,x:r.x,y:r.y}),l.jsx(mz,{anchorCornerRadius:3,anchorDragBoundFunc:P,anchorFill:"rgba(212,216,234,1)",anchorSize:15,anchorStroke:"rgb(42,42,42)",borderDash:[4,4],borderEnabled:!0,borderStroke:"black",draggable:!1,enabledAnchors:h==="move"?void 0:[],flipEnabled:!1,ignoreStroke:!0,keepRatio:!1,listening:!s&&h==="move",onDragStart:D,onDragEnd:_,onMouseDown:M,onMouseUp:T,onTransformEnd:T,ref:x,rotateEnabled:!1})]})},Jz=me(tt,e=>{const{cursorPosition:t,brushSize:n,colorPickerColor:r,maskColor:o,brushColor:s,tool:c,layer:u,shouldShowBrush:f,isMovingBoundingBox:p,isTransformingBoundingBox:h,stageScale:y,stageDimensions:x,boundingBoxCoordinates:S,boundingBoxDimensions:C,shouldRestrictStrokesToBox:k}=e,w=k?{clipX:S.x,clipY:S.y,clipWidth:C.width,clipHeight:C.height}:{};return{cursorPosition:t,brushX:t?t.x:x.width/2,brushY:t?t.y:x.height/2,radius:n/2,colorPickerOuterRadius:Fv/y,colorPickerInnerRadius:(Fv-af+1)/y,maskColorString:Yo({...o,a:.5}),brushColorString:Yo(s),colorPickerColorString:Yo(r),tool:c,layer:u,shouldShowBrush:f,shouldDrawBrushPreview:!(p||h||!t)&&f,strokeWidth:1.5/y,dotRadius:1.5/y,clip:w}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),eR=e=>{const{...t}=e,{brushX:n,brushY:r,radius:o,maskColorString:s,tool:c,layer:u,shouldDrawBrushPreview:f,dotRadius:p,strokeWidth:h,brushColorString:y,colorPickerColorString:x,colorPickerInnerRadius:S,colorPickerOuterRadius:C,clip:k}=A(Jz);return f?l.jsxs(Vr,{listening:!1,...k,...t,children:[c==="colorPicker"?l.jsxs(l.Fragment,{children:[l.jsx(Ro,{x:n,y:r,radius:C,stroke:y,strokeWidth:af,strokeScaleEnabled:!1}),l.jsx(Ro,{x:n,y:r,radius:S,stroke:x,strokeWidth:af,strokeScaleEnabled:!1})]}):l.jsxs(l.Fragment,{children:[l.jsx(Ro,{x:n,y:r,radius:o,fill:u==="mask"?s:y,globalCompositeOperation:c==="eraser"?"destination-out":"source-out"}),l.jsx(Ro,{x:n,y:r,radius:o,stroke:"rgba(255,255,255,0.4)",strokeWidth:h*2,strokeEnabled:!0,listening:!1}),l.jsx(Ro,{x:n,y:r,radius:o,stroke:"rgba(0,0,0,1)",strokeWidth:h,strokeEnabled:!0,listening:!1})]}),l.jsx(Ro,{x:n,y:r,radius:p*2,fill:"rgba(255,255,255,0.4)",listening:!1}),l.jsx(Ro,{x:n,y:r,radius:p,fill:"rgba(0,0,0,1)",listening:!1})]}):null},tR=me([tt,Ot],(e,t)=>{const{isMaskEnabled:n,stageScale:r,shouldShowBoundingBox:o,isTransformingBoundingBox:s,isMouseOverBoundingBox:c,isMovingBoundingBox:u,stageDimensions:f,stageCoordinates:p,tool:h,isMovingStage:y,shouldShowIntermediates:x,shouldShowGrid:S,shouldRestrictStrokesToBox:C}=e;let k="none";return h==="move"||t?y?k="grabbing":k="grab":s?k=void 0:C&&!c&&(k="default"),{isMaskEnabled:n,isModifyingBoundingBox:s||u,shouldShowBoundingBox:o,shouldShowGrid:S,stageCoordinates:p,stageCursor:k,stageDimensions:f,stageScale:r,tool:h,isStaging:t,shouldShowIntermediates:x}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),nR=re(vz,{shouldForwardProp:e=>!["sx"].includes(e)}),K4=()=>{const{isMaskEnabled:e,isModifyingBoundingBox:t,shouldShowBoundingBox:n,shouldShowGrid:r,stageCoordinates:o,stageCursor:s,stageDimensions:c,stageScale:u,tool:f,isStaging:p,shouldShowIntermediates:h}=A(tR);bz();const y=g.useRef(null),x=g.useRef(null),S=g.useCallback(V=>{Z3(V),y.current=V},[]),C=g.useCallback(V=>{Q3(V),x.current=V},[]),k=g.useRef({x:0,y:0}),w=g.useRef(!1),j=Mz(y),I=Cz(y),P=Pz(y,w),M=kz(y,w,k),T=jz(),{handleDragStart:D,handleDragMove:_,handleDragEnd:R}=yz();return l.jsx(B,{sx:{position:"relative",height:"100%",width:"100%",borderRadius:"base"},children:l.jsxs(Ye,{sx:{position:"relative"},children:[l.jsxs(nR,{tabIndex:-1,ref:S,sx:{outline:"none",overflow:"hidden",cursor:s||void 0,canvas:{outline:"none"}},x:o.x,y:o.y,width:c.width,height:c.height,scale:{x:u,y:u},onTouchStart:I,onTouchMove:M,onTouchEnd:P,onMouseDown:I,onMouseLeave:T,onMouseMove:M,onMouseUp:P,onDragStart:D,onDragMove:_,onDragEnd:R,onContextMenu:V=>V.evt.preventDefault(),onWheel:j,draggable:(f==="move"||p)&&!t,children:[l.jsx(Da,{id:"grid",visible:r,children:l.jsx(Az,{})}),l.jsx(Da,{id:"base",ref:C,listening:!1,imageSmoothingEnabled:!1,children:l.jsx(Wz,{})}),l.jsxs(Da,{id:"mask",visible:e,listening:!1,children:[l.jsx(Lz,{visible:!0,listening:!1}),l.jsx(Nz,{listening:!1})]}),l.jsx(Da,{children:l.jsx(_z,{})}),l.jsxs(Da,{id:"preview",imageSmoothingEnabled:!1,children:[!p&&l.jsx(eR,{visible:f!=="move",listening:!1}),l.jsx(Uz,{visible:p}),h&&l.jsx(zz,{}),l.jsx(Zz,{visible:n&&!p})]})]}),l.jsx(Xz,{}),l.jsx(Gz,{})]})})},rR=me(tt,F4,bt,(e,t,n)=>{const{doesCanvasNeedScaling:r,isCanvasInitialized:o}=e;return{doesCanvasNeedScaling:r,activeTabName:n,initialCanvasImage:t,isCanvasInitialized:o}}),X4=()=>{const e=Y(),{doesCanvasNeedScaling:t,activeTabName:n,initialCanvasImage:r,isCanvasInitialized:o}=A(rR),s=g.useRef(null);return g.useLayoutEffect(()=>{window.setTimeout(()=>{if(!s.current)return;const{clientWidth:c,clientHeight:u}=s.current;e(J3({width:c,height:u})),e(o?eC():bc()),e(E1(!1))},0)},[e,r,t,n,o]),l.jsx(B,{ref:s,sx:{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:4,width:"100%",height:"100%"},children:l.jsx(Xf,{thickness:"2px",speed:"1s",size:"xl"})})},oR=me([tt,bt,Et],(e,t,n)=>{const{futureLayerStates:r}=e;return{canRedo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}});function Q4(){const e=Y(),{canRedo:t,activeTabName:n}=A(oR),{t:r}=X(),o=()=>{e(tC())};return de(["meta+shift+z","ctrl+shift+z","control+y","meta+y"],()=>{o()},{enabled:()=>t,preventDefault:!0},[n,t]),l.jsx(se,{"aria-label":`${r("unifiedCanvas.redo")} (Ctrl+Shift+Z)`,tooltip:`${r("unifiedCanvas.redo")} (Ctrl+Shift+Z)`,icon:l.jsx(L9,{}),onClick:o,isDisabled:!t})}const iR=me([tt,bt,Et],(e,t,n)=>{const{pastLayerStates:r}=e;return{canUndo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}});function Z4(){const e=Y(),{t}=X(),{canUndo:n,activeTabName:r}=A(iR),o=()=>{e(nC())};return de(["meta+z","ctrl+z"],()=>{o()},{enabled:()=>n,preventDefault:!0},[r,n]),l.jsx(se,{"aria-label":`${t("unifiedCanvas.undo")} (Ctrl+Z)`,tooltip:`${t("unifiedCanvas.undo")} (Ctrl+Z)`,icon:l.jsx(U9,{}),onClick:o,isDisabled:!n})}const aR=(e,t,n)=>{const r=document.createElement("img");r.addEventListener("load",()=>{const o=document.createElement("canvas");o.width=t,o.height=n;const s=o.getContext("2d");s&&(s.drawImage(r,0,0),o.toBlob(c=>{c&&navigator.clipboard.write([new ClipboardItem({[c.type]:c})])}),o.remove(),r.remove())}),r.src=e},sR=e=>{const t=document.createElement("a");t.href=e,t.download="",document.body.appendChild(t),t.click(),document.body.removeChild(t),t.remove()},lR=(e,t,n,r)=>{const o=e.scale(),s=e.getClientRect({relativeTo:e.getParent()});e.scale({x:1/t,y:1/t});const{x:c,y:u,width:f,height:p}=e.getClientRect(),h=r?{x:r.x+n.x,y:r.y+n.y,width:r.width,height:r.height}:{x:c,y:u,width:f,height:p},y=e.toDataURL(h);return e.scale(o),{dataURL:y,boundingBox:{x:s.x,y:s.y,width:f,height:p}}},cR={cropVisible:!1,cropToBoundingBox:!1,shouldSaveToGallery:!1,shouldDownload:!1,shouldCopy:!1,shouldSetAsInitialImage:!0},lo=(e=cR)=>async(t,n)=>{const{cropVisible:r,cropToBoundingBox:o,shouldSaveToGallery:s,shouldDownload:c,shouldCopy:u,shouldSetAsInitialImage:f}=e;t(rC("Exporting Image")),t(vl(!1));const p=n(),{stageScale:h,boundingBoxCoordinates:y,boundingBoxDimensions:x,stageCoordinates:S}=p.canvas,C=wr();if(!C){t(pd(!1)),t(vl(!0));return}const{dataURL:k,boundingBox:w}=lR(C,h,S,o?{...y,...x}:void 0);if(!k){t(pd(!1)),t(vl(!0));return}const j=new FormData;j.append("data",JSON.stringify({dataURL:k,filename:"merged_canvas.png",kind:s?"result":"temp",cropVisible:r}));const P=await(await fetch(`${window.location.origin}/upload`,{method:"POST",body:j})).json(),{url:M,width:T,height:D}=P,_={uuid:b1(),category:s?"result":"user",...P};c&&(sR(M),t(gl({title:Ia.t("toast.downloadImageStarted"),status:"success",duration:2500,isClosable:!0}))),u&&(aR(M,T,D),t(gl({title:Ia.t("toast.imageCopied"),status:"success",duration:2500,isClosable:!0}))),s&&(t(S1({image:_,category:"result"})),t(gl({title:Ia.t("toast.imageSavedToGallery"),status:"success",duration:2500,isClosable:!0}))),f&&(t(oC({kind:"image",layer:"base",...w,image:_})),t(gl({title:Ia.t("toast.canvasMerged"),status:"success",duration:2500,isClosable:!0}))),t(pd(!1)),t(iC(Ia.t("common.statusConnected"))),t(vl(!0))};function uR(){const e=A(Ot),t=wr(),n=A(u=>u.system.isProcessing),r=A(u=>u.canvas.shouldCropToBoundingBoxOnSave),o=Y(),{t:s}=X();de(["meta+c","ctrl+c"],()=>{c()},{enabled:()=>!e,preventDefault:!0},[t,n]);const c=()=>{o(lo({cropVisible:!r,cropToBoundingBox:r,shouldCopy:!0}))};return l.jsx(se,{"aria-label":`${s("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${s("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,icon:l.jsx(Ki,{}),onClick:c,isDisabled:e})}function dR(){const e=Y(),{t}=X(),n=wr(),r=A(Ot),o=A(u=>u.system.isProcessing),s=A(u=>u.canvas.shouldCropToBoundingBoxOnSave);de(["shift+d"],()=>{c()},{enabled:()=>!r,preventDefault:!0},[n,o]);const c=()=>{e(lo({cropVisible:!s,cropToBoundingBox:s,shouldDownload:!0}))};return l.jsx(se,{"aria-label":`${t("unifiedCanvas.downloadAsImage")} (Shift+D)`,tooltip:`${t("unifiedCanvas.downloadAsImage")} (Shift+D)`,icon:l.jsx(Xh,{}),onClick:c,isDisabled:r})}function fR(){const e=A(Ot),{openUploader:t}=Yh(),{t:n}=X();return l.jsx(se,{"aria-label":n("common.upload"),tooltip:n("common.upload"),icon:l.jsx(Oc,{}),onClick:t,isDisabled:e})}const hR=me([tt,Ot],(e,t)=>{const{layer:n,isMaskEnabled:r}=e;return{layer:n,isMaskEnabled:r,isStaging:t}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}});function pR(){const e=Y(),{t}=X(),{layer:n,isMaskEnabled:r,isStaging:o}=A(hR),s=()=>{e(Ql(n==="mask"?"base":"mask"))};de(["q"],()=>{s()},{enabled:()=>!o,preventDefault:!0},[n]);const c=u=>{const f=u.target.value;e(Ql(f)),f==="mask"&&!r&&e(is(!0))};return l.jsx(Mn,{tooltip:`${t("unifiedCanvas.layer")} (Q)`,"aria-label":`${t("unifiedCanvas.layer")} (Q)`,tooltipProps:{hasArrow:!0,placement:"top"},value:n,validValues:K1,onChange:c,isDisabled:o})}function mR(){const e=Y(),{t}=X(),n=wr(),r=A(Ot),o=A(c=>c.system.isProcessing);de(["shift+m"],()=>{s()},{enabled:()=>!r,preventDefault:!0},[n,o]);const s=()=>{e(lo({cropVisible:!1,shouldSetAsInitialImage:!0}))};return l.jsx(se,{"aria-label":`${t("unifiedCanvas.mergeVisible")} (Shift+M)`,tooltip:`${t("unifiedCanvas.mergeVisible")} (Shift+M)`,icon:l.jsx(Vx,{}),onClick:s,isDisabled:r})}function vR(){const e=A(s=>s.canvas.tool),t=A(Ot),n=Y(),{t:r}=X();de(["v"],()=>{o()},{enabled:()=>!t,preventDefault:!0},[]);const o=()=>n(br("move"));return l.jsx(se,{"aria-label":`${r("unifiedCanvas.move")} (V)`,tooltip:`${r("unifiedCanvas.move")} (V)`,icon:l.jsx(Nx,{}),isChecked:e==="move"||t,onClick:o})}function gR(){const e=A(s=>s.ui.shouldPinParametersPanel),t=A(s=>s.ui.shouldShowParametersPanel),n=Y(),{t:r}=X(),o=()=>{n(ql(!0)),e&&n(cn())};return!e||!t?l.jsxs(B,{flexDirection:"column",gap:2,children:[l.jsx(se,{tooltip:`${r("parameters.showOptionsPanel")} (O)`,tooltipProps:{placement:"top"},"aria-label":r("parameters.showOptionsPanel"),onClick:o,children:l.jsx(Zh,{})}),l.jsx(B,{children:l.jsx(Ip,{iconButton:!0})}),l.jsx(B,{children:l.jsx(Ep,{width:"100%",height:"40px",btnGroupWidth:"100%"})})]}):null}function yR(){const e=Y(),{t}=X(),n=A(Ot),r=()=>{e(Zf()),e(bc())};return l.jsx(se,{"aria-label":t("unifiedCanvas.clearCanvas"),tooltip:t("unifiedCanvas.clearCanvas"),icon:l.jsx(ri,{}),onClick:r,isDisabled:n,colorScheme:"error"})}function J4(e,t,n=250){const[r,o]=g.useState(0);return g.useEffect(()=>{const s=setTimeout(()=>{r===1&&e(),o(0)},n);return r===2&&t(),()=>clearTimeout(s)},[r,e,t,n]),()=>o(s=>s+1)}function xR(){const e=wr(),t=Y(),{t:n}=X();de(["r"],()=>{o()},{enabled:()=>!0,preventDefault:!0},[e]);const r=J4(()=>o(!1),()=>o(!0)),o=(s=!1)=>{const c=wr();if(!c)return;const u=c.getClientRect({skipTransform:!0});t(X1({contentRect:u,shouldScaleTo1:s}))};return l.jsx(se,{"aria-label":`${n("unifiedCanvas.resetView")} (R)`,tooltip:`${n("unifiedCanvas.resetView")} (R)`,icon:l.jsx(Lx,{}),onClick:r})}function bR(){const e=A(Ot),t=wr(),n=A(u=>u.system.isProcessing),r=A(u=>u.canvas.shouldCropToBoundingBoxOnSave),o=Y(),{t:s}=X();de(["shift+s"],()=>{c()},{enabled:()=>!e,preventDefault:!0},[t,n]);const c=()=>{o(lo({cropVisible:!r,cropToBoundingBox:r,shouldSaveToGallery:!0}))};return l.jsx(se,{"aria-label":`${s("unifiedCanvas.saveToGallery")} (Shift+S)`,tooltip:`${s("unifiedCanvas.saveToGallery")} (Shift+S)`,icon:l.jsx(Qh,{}),onClick:c,isDisabled:e})}const SR=me([tt,Ot,Et],(e,t,n)=>{const{isProcessing:r}=n,{tool:o}=e;return{tool:o,isStaging:t,isProcessing:r}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),CR=()=>{const e=Y(),{t}=X(),{tool:n,isStaging:r}=A(SR);de(["b"],()=>{o()},{enabled:()=>!r,preventDefault:!0},[]),de(["e"],()=>{s()},{enabled:()=>!r,preventDefault:!0},[n]),de(["c"],()=>{c()},{enabled:()=>!r,preventDefault:!0},[n]),de(["shift+f"],()=>{u()},{enabled:()=>!r,preventDefault:!0}),de(["delete","backspace"],()=>{f()},{enabled:()=>!r,preventDefault:!0});const o=()=>e(br("brush")),s=()=>e(br("eraser")),c=()=>e(br("colorPicker")),u=()=>e(Q1()),f=()=>e(Z1());return l.jsxs(B,{flexDirection:"column",gap:2,children:[l.jsxs(Qt,{children:[l.jsx(se,{"aria-label":`${t("unifiedCanvas.brush")} (B)`,tooltip:`${t("unifiedCanvas.brush")} (B)`,icon:l.jsx(Ux,{}),isChecked:n==="brush"&&!r,onClick:o,isDisabled:r}),l.jsx(se,{"aria-label":`${t("unifiedCanvas.eraser")} (E)`,tooltip:`${t("unifiedCanvas.eraser")} (B)`,icon:l.jsx(Bx,{}),isChecked:n==="eraser"&&!r,isDisabled:r,onClick:s})]}),l.jsxs(Qt,{children:[l.jsx(se,{"aria-label":`${t("unifiedCanvas.fillBoundingBox")} (Shift+F)`,tooltip:`${t("unifiedCanvas.fillBoundingBox")} (Shift+F)`,icon:l.jsx(Wx,{}),isDisabled:r,onClick:u}),l.jsx(se,{"aria-label":`${t("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,tooltip:`${t("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,icon:l.jsx(vs,{style:{transform:"rotate(45deg)"}}),isDisabled:r,onClick:f})]}),l.jsx(se,{"aria-label":`${t("unifiedCanvas.colorPicker")} (C)`,tooltip:`${t("unifiedCanvas.colorPicker")} (C)`,icon:l.jsx(Hx,{}),isChecked:n==="colorPicker"&&!r,isDisabled:r,onClick:c,width:"max-content"})]})},eb=()=>{const e=A(Ot),t=Y(),{t:n}=X(),r=()=>{t(aC()),t(Zf()),t(J1())};return l.jsxs(Bc,{title:n("unifiedCanvas.emptyTempImageFolder"),acceptCallback:r,acceptButtonText:n("unifiedCanvas.emptyFolder"),triggerComponent:l.jsx(Je,{leftIcon:l.jsx(ri,{}),size:"sm",isDisabled:e,children:n("unifiedCanvas.emptyTempImageFolder")}),children:[l.jsx("p",{children:n("unifiedCanvas.emptyTempImagesFolderMessage")}),l.jsx("br",{}),l.jsx("p",{children:n("unifiedCanvas.emptyTempImagesFolderConfirm")})]})},tb=()=>{const e=A(Ot),t=Y(),{t:n}=X();return l.jsxs(Bc,{title:n("unifiedCanvas.clearCanvasHistory"),acceptCallback:()=>t(J1()),acceptButtonText:n("unifiedCanvas.clearHistory"),triggerComponent:l.jsx(Je,{size:"sm",leftIcon:l.jsx(ri,{}),isDisabled:e,children:n("unifiedCanvas.clearCanvasHistory")}),children:[l.jsx("p",{children:n("unifiedCanvas.clearCanvasHistoryMessage")}),l.jsx("br",{}),l.jsx("p",{children:n("unifiedCanvas.clearCanvasHistoryConfirm")})]})},wR=me([tt],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:o}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:o}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),kR=()=>{const e=Y(),{t}=X(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldShowCanvasDebugInfo:o,shouldShowIntermediates:s}=A(wR);return l.jsx(rr,{trigger:"hover",triggerComponent:l.jsx(se,{tooltip:t("unifiedCanvas.canvasSettings"),tooltipProps:{placement:"bottom"},"aria-label":t("unifiedCanvas.canvasSettings"),icon:l.jsx(Jh,{})}),children:l.jsxs(B,{direction:"column",gap:2,children:[l.jsx(pt,{label:t("unifiedCanvas.showIntermediates"),isChecked:s,onChange:c=>e(e2(c.target.checked))}),l.jsx(pt,{label:t("unifiedCanvas.autoSaveToGallery"),isChecked:n,onChange:c=>e(t2(c.target.checked))}),l.jsx(pt,{label:t("unifiedCanvas.saveBoxRegionOnly"),isChecked:r,onChange:c=>e(n2(c.target.checked))}),l.jsx(pt,{label:t("unifiedCanvas.showCanvasDebugInfo"),isChecked:o,onChange:c=>e(r2(c.target.checked))}),l.jsx(tb,{}),l.jsx(eb,{})]})})},jR=()=>l.jsxs(B,{flexDirection:"column",rowGap:2,children:[l.jsx(pR,{}),l.jsx(CR,{}),l.jsxs(B,{gap:2,children:[l.jsx(vR,{}),l.jsx(xR,{})]}),l.jsxs(B,{columnGap:2,children:[l.jsx(mR,{}),l.jsx(bR,{})]}),l.jsxs(B,{columnGap:2,children:[l.jsx(uR,{}),l.jsx(dR,{})]}),l.jsxs(B,{gap:2,children:[l.jsx(Z4,{}),l.jsx(Q4,{})]}),l.jsxs(B,{gap:2,children:[l.jsx(fR,{}),l.jsx(yR,{})]}),l.jsx(kR,{}),l.jsx(gR,{})]});function ER(){const e=Y(),t=A(o=>o.canvas.brushSize),{t:n}=X(),r=A(Ot);return de(["BracketLeft"],()=>{e(Fi(Math.max(t-5,5)))},{enabled:()=>!r,preventDefault:!0},[t]),de(["BracketRight"],()=>{e(Fi(Math.min(t+5,500)))},{enabled:()=>!r,preventDefault:!0},[t]),l.jsx(ut,{label:n("unifiedCanvas.brushSize"),value:t,withInput:!0,onChange:o=>e(Fi(o)),sliderNumberInputProps:{max:500},inputReadOnly:!1,isCompact:!0})}function Wc(){return(Wc=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 nb(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 $f(e){var t=g.useRef(e),n=g.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var Zi=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e<t?t:e},Ha=function(e){return"touches"in e},Gf=function(e){return e&&e.ownerDocument.defaultView||self},i1=function(e,t,n){var r=e.getBoundingClientRect(),o=Ha(t)?function(s,c){for(var u=0;u<s.length;u++)if(s[u].identifier===c)return s[u];return s[0]}(t.touches,n):t;return{left:Zi((o.pageX-(r.left+Gf(e).pageXOffset))/r.width),top:Zi((o.pageY-(r.top+Gf(e).pageYOffset))/r.height)}},a1=function(e){!Ha(e)&&e.preventDefault()},zp=Me.memo(function(e){var t=e.onMove,n=e.onKey,r=nb(e,["onMove","onKey"]),o=g.useRef(null),s=$f(t),c=$f(n),u=g.useRef(null),f=g.useRef(!1),p=g.useMemo(function(){var S=function(w){a1(w),(Ha(w)?w.touches.length>0:w.buttons>0)&&o.current?s(i1(o.current,w,u.current)):k(!1)},C=function(){return k(!1)};function k(w){var j=f.current,I=Gf(o.current),P=w?I.addEventListener:I.removeEventListener;P(j?"touchmove":"mousemove",S),P(j?"touchend":"mouseup",C)}return[function(w){var j=w.nativeEvent,I=o.current;if(I&&(a1(j),!function(M,T){return T&&!Ha(M)}(j,f.current)&&I)){if(Ha(j)){f.current=!0;var P=j.changedTouches||[];P.length&&(u.current=P[0].identifier)}I.focus(),s(i1(I,j,u.current)),k(!0)}},function(w){var j=w.which||w.keyCode;j<37||j>40||(w.preventDefault(),c({left:j===39?.05:j===37?-.05:0,top:j===40?.05:j===38?-.05:0}))},k]},[c,s]),h=p[0],y=p[1],x=p[2];return g.useEffect(function(){return x},[x]),Me.createElement("div",Wc({},r,{onTouchStart:h,onMouseDown:h,className:"react-colorful__interactive",ref:o,onKeyDown:y,tabIndex:0,role:"slider"}))}),Vc=function(e){return e.filter(Boolean).join(" ")},Rp=function(e){var t=e.color,n=e.left,r=e.top,o=r===void 0?.5:r,s=Vc(["react-colorful__pointer",e.className]);return Me.createElement("div",{className:s,style:{top:100*o+"%",left:100*n+"%"}},Me.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},gn=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},rb=function(e){var t=e.s,n=e.v,r=e.a,o=(200-t)*n/100;return{h:gn(e.h),s:gn(o>0&&o<200?t*n/100/(o<=100?o:200-o)*100:0),l:gn(o/2),a:gn(r,2)}},qf=function(e){var t=rb(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},Vd=function(e){var t=rb(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},PR=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),c=r*(1-n),u=r*(1-(t-s)*n),f=r*(1-(1-t+s)*n),p=s%6;return{r:gn(255*[r,u,c,c,f,r][p]),g:gn(255*[f,r,r,u,c,c][p]),b:gn(255*[c,c,f,r,r,u][p]),a:gn(o,2)}},IR=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,s=Math.max(t,n,r),c=s-Math.min(t,n,r),u=c?s===t?(n-r)/c:s===n?2+(r-t)/c:4+(t-n)/c:0;return{h:gn(60*(u<0?u+6:u)),s:gn(s?c/s*100:0),v:gn(s/255*100),a:o}},MR=Me.memo(function(e){var t=e.hue,n=e.onChange,r=Vc(["react-colorful__hue",e.className]);return Me.createElement("div",{className:r},Me.createElement(zp,{onMove:function(o){n({h:360*o.left})},onKey:function(o){n({h:Zi(t+360*o.left,0,360)})},"aria-label":"Hue","aria-valuenow":gn(t),"aria-valuemax":"360","aria-valuemin":"0"},Me.createElement(Rp,{className:"react-colorful__hue-pointer",left:t/360,color:qf({h:t,s:100,v:100,a:1})})))}),TR=Me.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:qf({h:t.h,s:100,v:100,a:1})};return Me.createElement("div",{className:"react-colorful__saturation",style:r},Me.createElement(zp,{onMove:function(o){n({s:100*o.left,v:100-100*o.top})},onKey:function(o){n({s:Zi(t.s+100*o.left,0,100),v:Zi(t.v-100*o.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+gn(t.s)+"%, Brightness "+gn(t.v)+"%"},Me.createElement(Rp,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:qf(t)})))}),ob=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function _R(e,t,n){var r=$f(n),o=g.useState(function(){return e.toHsva(t)}),s=o[0],c=o[1],u=g.useRef({color:t,hsva:s});g.useEffect(function(){if(!e.equal(t,u.current.color)){var p=e.toHsva(t);u.current={hsva:p,color:t},c(p)}},[t,e]),g.useEffect(function(){var p;ob(s,u.current.hsva)||e.equal(p=e.fromHsva(s),u.current.color)||(u.current={hsva:s,color:p},r(p))},[s,e,r]);var f=g.useCallback(function(p){c(function(h){return Object.assign({},h,p)})},[]);return[s,f]}var DR=typeof window<"u"?g.useLayoutEffect:g.useEffect,AR=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},s1=new Map,OR=function(e){DR(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!s1.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}`,s1.set(t,n);var r=AR();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},zR=function(e){var t=e.className,n=e.hsva,r=e.onChange,o={backgroundImage:"linear-gradient(90deg, "+Vd(Object.assign({},n,{a:0}))+", "+Vd(Object.assign({},n,{a:1}))+")"},s=Vc(["react-colorful__alpha",t]),c=gn(100*n.a);return Me.createElement("div",{className:s},Me.createElement("div",{className:"react-colorful__alpha-gradient",style:o}),Me.createElement(zp,{onMove:function(u){r({a:u.left})},onKey:function(u){r({a:Zi(n.a+u.left)})},"aria-label":"Alpha","aria-valuetext":c+"%","aria-valuenow":c,"aria-valuemin":"0","aria-valuemax":"100"},Me.createElement(Rp,{className:"react-colorful__alpha-pointer",left:n.a,color:Vd(n)})))},RR=function(e){var t=e.className,n=e.colorModel,r=e.color,o=r===void 0?n.defaultColor:r,s=e.onChange,c=nb(e,["className","colorModel","color","onChange"]),u=g.useRef(null);OR(u);var f=_R(n,o,s),p=f[0],h=f[1],y=Vc(["react-colorful",t]);return Me.createElement("div",Wc({},c,{ref:u,className:y}),Me.createElement(TR,{hsva:p,onChange:h}),Me.createElement(MR,{hue:p.h,onChange:h}),Me.createElement(zR,{hsva:p,onChange:h,className:"react-colorful__last-control"}))},NR={defaultColor:{r:0,g:0,b:0,a:1},toHsva:IR,fromHsva:PR,equal:ob},FR=function(e){return Me.createElement(RR,Wc({},e,{colorModel:NR}))};const LR=re(FR,{baseStyle:{paddingInline:4},shouldForwardProp:e=>!["pickerColor"].includes(e)}),Ud={width:6,height:6,borderColor:"base.100"},BR=e=>{const{styleClass:t="",...n}=e;return l.jsx(LR,{sx:{".react-colorful__hue-pointer":Ud,".react-colorful__saturation-pointer":Ud,".react-colorful__alpha-pointer":Ud},className:t,...n})},vc=g.memo(BR),HR=me([tt,Ot],(e,t)=>{const{brushColor:n,maskColor:r,layer:o}=e;return{brushColor:n,maskColor:r,layer:o,isStaging:t}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}});function WR(){const e=Y(),{brushColor:t,maskColor:n,layer:r,isStaging:o}=A(HR),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 de(["shift+BracketLeft"],()=>{e(Li({...t,a:ee.clamp(t.a-.05,.05,1)}))},{enabled:()=>!o,preventDefault:!0},[t]),de(["shift+BracketRight"],()=>{e(Li({...t,a:ee.clamp(t.a+.05,.05,1)}))},{enabled:()=>!o,preventDefault:!0},[t]),l.jsx(rr,{trigger:"hover",triggerComponent:l.jsx(Ye,{sx:{width:7,height:7,minWidth:7,minHeight:7,borderRadius:"full",bg:s(),cursor:"pointer"}}),children:l.jsxs(B,{minWidth:60,direction:"column",gap:4,width:"100%",children:[r==="base"&&l.jsx(vc,{sx:{width:"100%",paddingTop:2,paddingBottom:2},pickerColor:t,onChange:c=>e(Li(c))}),r==="mask"&&l.jsx(vc,{sx:{width:"100%",paddingTop:2,paddingBottom:2},pickerColor:n,onChange:c=>e(o2(c))})]})})}function ib(){return l.jsxs(B,{columnGap:4,alignItems:"center",children:[l.jsx(ER,{}),l.jsx(WR,{})]})}function VR(){const e=Y(),t=A(r=>r.canvas.shouldRestrictStrokesToBox),{t:n}=X();return l.jsx(pt,{label:n("unifiedCanvas.betaLimitToBox"),isChecked:t,onChange:r=>e(i2(r.target.checked))})}function UR(){return l.jsxs(B,{gap:4,alignItems:"center",children:[l.jsx(ib,{}),l.jsx(VR,{})]})}function $R(){const e=Y(),{t}=X(),n=()=>e(Qf());return l.jsx(Je,{size:"sm",leftIcon:l.jsx(ri,{}),onClick:n,tooltip:`${t("unifiedCanvas.clearMask")} (Shift+C)`,children:t("unifiedCanvas.betaClear")})}function GR(){const e=A(o=>o.canvas.isMaskEnabled),t=Y(),{t:n}=X(),r=()=>t(is(!e));return l.jsx(pt,{label:`${n("unifiedCanvas.enableMask")} (H)`,isChecked:e,onChange:r})}function qR(){const e=Y(),{t}=X(),n=A(r=>r.canvas.shouldPreserveMaskedArea);return l.jsx(pt,{label:t("unifiedCanvas.betaPreserveMasked"),isChecked:n,onChange:r=>e(a2(r.target.checked))})}function YR(){return l.jsxs(B,{gap:4,alignItems:"center",children:[l.jsx(ib,{}),l.jsx(GR,{}),l.jsx(qR,{}),l.jsx($R,{})]})}function KR(){const e=A(r=>r.canvas.shouldDarkenOutsideBoundingBox),t=Y(),{t:n}=X();return l.jsx(pt,{label:n("unifiedCanvas.betaDarkenOutside"),isChecked:e,onChange:r=>t(s2(r.target.checked))})}function XR(){const e=A(r=>r.canvas.shouldShowGrid),t=Y(),{t:n}=X();return l.jsx(pt,{label:n("unifiedCanvas.showGrid"),isChecked:e,onChange:r=>t(l2(r.target.checked))})}function QR(){const e=A(o=>o.canvas.shouldSnapToGrid),t=Y(),{t:n}=X(),r=o=>t(Xl(o.target.checked));return l.jsx(pt,{label:`${n("unifiedCanvas.snapToGrid")} (N)`,isChecked:e,onChange:r})}function ZR(){return l.jsxs(B,{alignItems:"center",gap:4,children:[l.jsx(XR,{}),l.jsx(QR,{}),l.jsx(KR,{})]})}const JR=me([tt],e=>{const{tool:t,layer:n}=e;return{tool:t,layer:n}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}});function eN(){const{tool:e,layer:t}=A(JR);return l.jsxs(B,{height:8,minHeight:8,maxHeight:8,alignItems:"center",children:[t=="base"&&["brush","eraser","colorPicker"].includes(e)&&l.jsx(UR,{}),t=="mask"&&["brush","eraser","colorPicker"].includes(e)&&l.jsx(YR,{}),e=="move"&&l.jsx(ZR,{})]})}const tN=me([tt],e=>{const{doesCanvasNeedScaling:t}=e;return{doesCanvasNeedScaling:t}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),nN=()=>{const e=Y(),{doesCanvasNeedScaling:t}=A(tN);return g.useLayoutEffect(()=>{e(cn());const n=()=>{e(cn())};return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),l.jsx(Ye,{sx:{width:"100%",height:"100%",borderRadius:"base",bg:"base.850"},children:l.jsxs(B,{flexDirection:"row",width:"100%",height:"100%",columnGap:4,padding:4,children:[l.jsx(jR,{}),l.jsxs(B,{width:"100%",height:"100%",flexDirection:"column",rowGap:4,children:[l.jsx(eN,{}),t?l.jsx(X4,{}):l.jsx(K4,{})]})]})})},rN=me([tt,Ot],(e,t)=>{const{maskColor:n,layer:r,isMaskEnabled:o,shouldPreserveMaskedArea:s}=e;return{layer:r,maskColor:n,maskColorString:Yo(n),isMaskEnabled:o,shouldPreserveMaskedArea:s,isStaging:t}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),oN=()=>{const e=Y(),{t}=X(),{layer:n,maskColor:r,isMaskEnabled:o,shouldPreserveMaskedArea:s,isStaging:c}=A(rN);de(["q"],()=>{u()},{enabled:()=>!c,preventDefault:!0},[n]),de(["shift+c"],()=>{f()},{enabled:()=>!c,preventDefault:!0},[]),de(["h"],()=>{p()},{enabled:()=>!c,preventDefault:!0},[o]);const u=()=>{e(Ql(n==="mask"?"base":"mask"))},f=()=>e(Qf()),p=()=>e(is(!o));return l.jsx(rr,{trigger:"hover",triggerComponent:l.jsx(Qt,{children:l.jsx(se,{"aria-label":t("unifiedCanvas.maskingOptions"),tooltip:t("unifiedCanvas.maskingOptions"),icon:l.jsx(A9,{}),isChecked:n==="mask",isDisabled:c})}),children:l.jsxs(B,{direction:"column",gap:2,children:[l.jsx(pt,{label:`${t("unifiedCanvas.enableMask")} (H)`,isChecked:o,onChange:p}),l.jsx(pt,{label:t("unifiedCanvas.preserveMaskedArea"),isChecked:s,onChange:h=>e(a2(h.target.checked))}),l.jsx(vc,{sx:{paddingTop:2,paddingBottom:2},pickerColor:r,onChange:h=>e(o2(h))}),l.jsxs(Je,{size:"sm",leftIcon:l.jsx(ri,{}),onClick:f,children:[t("unifiedCanvas.clearMask")," (Shift+C)"]})]})})},iN=me([tt],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:o,shouldShowGrid:s,shouldShowIntermediates:c,shouldSnapToGrid:u,shouldRestrictStrokesToBox:f}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:o,shouldShowGrid:s,shouldShowIntermediates:c,shouldSnapToGrid:u,shouldRestrictStrokesToBox:f}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),aN=()=>{const e=Y(),{t}=X(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldDarkenOutsideBoundingBox:o,shouldShowCanvasDebugInfo:s,shouldShowGrid:c,shouldShowIntermediates:u,shouldSnapToGrid:f,shouldRestrictStrokesToBox:p}=A(iN);de(["n"],()=>{e(Xl(!f))},{enabled:!0,preventDefault:!0},[f]);const h=y=>e(Xl(y.target.checked));return l.jsx(rr,{trigger:"hover",triggerComponent:l.jsx(se,{tooltip:t("unifiedCanvas.canvasSettings"),"aria-label":t("unifiedCanvas.canvasSettings"),icon:l.jsx(Jh,{})}),children:l.jsxs(B,{direction:"column",gap:2,children:[l.jsx(pt,{label:t("unifiedCanvas.showIntermediates"),isChecked:u,onChange:y=>e(e2(y.target.checked))}),l.jsx(pt,{label:t("unifiedCanvas.showGrid"),isChecked:c,onChange:y=>e(l2(y.target.checked))}),l.jsx(pt,{label:t("unifiedCanvas.snapToGrid"),isChecked:f,onChange:h}),l.jsx(pt,{label:t("unifiedCanvas.darkenOutsideSelection"),isChecked:o,onChange:y=>e(s2(y.target.checked))}),l.jsx(pt,{label:t("unifiedCanvas.autoSaveToGallery"),isChecked:n,onChange:y=>e(t2(y.target.checked))}),l.jsx(pt,{label:t("unifiedCanvas.saveBoxRegionOnly"),isChecked:r,onChange:y=>e(n2(y.target.checked))}),l.jsx(pt,{label:t("unifiedCanvas.limitStrokesToBox"),isChecked:p,onChange:y=>e(i2(y.target.checked))}),l.jsx(pt,{label:t("unifiedCanvas.showCanvasDebugInfo"),isChecked:s,onChange:y=>e(r2(y.target.checked))}),l.jsx(tb,{}),l.jsx(eb,{})]})})},sN=me([tt,Ot,Et],(e,t,n)=>{const{isProcessing:r}=n,{tool:o,brushColor:s,brushSize:c}=e;return{tool:o,isStaging:t,isProcessing:r,brushColor:s,brushSize:c}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),lN=()=>{const e=Y(),{tool:t,brushColor:n,brushSize:r,isStaging:o}=A(sN),{t:s}=X();de(["b"],()=>{c()},{enabled:()=>!o,preventDefault:!0},[]),de(["e"],()=>{u()},{enabled:()=>!o,preventDefault:!0},[t]),de(["c"],()=>{f()},{enabled:()=>!o,preventDefault:!0},[t]),de(["shift+f"],()=>{p()},{enabled:()=>!o,preventDefault:!0}),de(["delete","backspace"],()=>{h()},{enabled:()=>!o,preventDefault:!0}),de(["BracketLeft"],()=>{e(Fi(Math.max(r-5,5)))},{enabled:()=>!o,preventDefault:!0},[r]),de(["BracketRight"],()=>{e(Fi(Math.min(r+5,500)))},{enabled:()=>!o,preventDefault:!0},[r]),de(["shift+BracketLeft"],()=>{e(Li({...n,a:ee.clamp(n.a-.05,.05,1)}))},{enabled:()=>!o,preventDefault:!0},[n]),de(["shift+BracketRight"],()=>{e(Li({...n,a:ee.clamp(n.a+.05,.05,1)}))},{enabled:()=>!o,preventDefault:!0},[n]);const c=()=>e(br("brush")),u=()=>e(br("eraser")),f=()=>e(br("colorPicker")),p=()=>e(Q1()),h=()=>e(Z1());return l.jsxs(Qt,{isAttached:!0,children:[l.jsx(se,{"aria-label":`${s("unifiedCanvas.brush")} (B)`,tooltip:`${s("unifiedCanvas.brush")} (B)`,icon:l.jsx(Ux,{}),isChecked:t==="brush"&&!o,onClick:c,isDisabled:o}),l.jsx(se,{"aria-label":`${s("unifiedCanvas.eraser")} (E)`,tooltip:`${s("unifiedCanvas.eraser")} (E)`,icon:l.jsx(Bx,{}),isChecked:t==="eraser"&&!o,isDisabled:o,onClick:u}),l.jsx(se,{"aria-label":`${s("unifiedCanvas.fillBoundingBox")} (Shift+F)`,tooltip:`${s("unifiedCanvas.fillBoundingBox")} (Shift+F)`,icon:l.jsx(Wx,{}),isDisabled:o,onClick:p}),l.jsx(se,{"aria-label":`${s("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,tooltip:`${s("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,icon:l.jsx(vs,{style:{transform:"rotate(45deg)"}}),isDisabled:o,onClick:h}),l.jsx(se,{"aria-label":`${s("unifiedCanvas.colorPicker")} (C)`,tooltip:`${s("unifiedCanvas.colorPicker")} (C)`,icon:l.jsx(Hx,{}),isChecked:t==="colorPicker"&&!o,isDisabled:o,onClick:f}),l.jsx(rr,{trigger:"hover",triggerComponent:l.jsx(se,{"aria-label":s("unifiedCanvas.brushOptions"),tooltip:s("unifiedCanvas.brushOptions"),icon:l.jsx(Zh,{})}),children:l.jsxs(B,{minWidth:60,direction:"column",gap:4,width:"100%",children:[l.jsx(B,{gap:4,justifyContent:"space-between",children:l.jsx(ut,{label:s("unifiedCanvas.brushSize"),value:r,withInput:!0,onChange:y=>e(Fi(y)),sliderNumberInputProps:{max:500},inputReadOnly:!1})}),l.jsx(vc,{sx:{width:"100%",paddingTop:2,paddingBottom:2},pickerColor:n,onChange:y=>e(Li(y))})]})})]})},cN=me([Et,tt,Ot],(e,t,n)=>{const{isProcessing:r}=e,{tool:o,shouldCropToBoundingBoxOnSave:s,layer:c,isMaskEnabled:u}=t;return{isProcessing:r,isStaging:n,isMaskEnabled:u,tool:o,layer:c,shouldCropToBoundingBoxOnSave:s}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),uN=()=>{const e=Y(),{isProcessing:t,isStaging:n,isMaskEnabled:r,layer:o,tool:s,shouldCropToBoundingBoxOnSave:c}=A(cN),u=wr(),{t:f}=X(),{openUploader:p}=Yh();de(["v"],()=>{h()},{enabled:()=>!n,preventDefault:!0},[]),de(["r"],()=>{x()},{enabled:()=>!0,preventDefault:!0},[u]),de(["shift+m"],()=>{C()},{enabled:()=>!n,preventDefault:!0},[u,t]),de(["shift+s"],()=>{k()},{enabled:()=>!n,preventDefault:!0},[u,t]),de(["meta+c","ctrl+c"],()=>{w()},{enabled:()=>!n,preventDefault:!0},[u,t]),de(["shift+d"],()=>{j()},{enabled:()=>!n,preventDefault:!0},[u,t]);const h=()=>e(br("move")),y=J4(()=>x(!1),()=>x(!0)),x=(P=!1)=>{const M=wr();if(!M)return;const T=M.getClientRect({skipTransform:!0});e(X1({contentRect:T,shouldScaleTo1:P}))},S=()=>{e(Zf()),e(bc())},C=()=>{e(lo({cropVisible:!1,shouldSetAsInitialImage:!0}))},k=()=>{e(lo({cropVisible:!c,cropToBoundingBox:c,shouldSaveToGallery:!0}))},w=()=>{e(lo({cropVisible:!c,cropToBoundingBox:c,shouldCopy:!0}))},j=()=>{e(lo({cropVisible:!c,cropToBoundingBox:c,shouldDownload:!0}))},I=P=>{const M=P.target.value;e(Ql(M)),M==="mask"&&!r&&e(is(!0))};return l.jsxs(B,{sx:{alignItems:"center",gap:2},children:[l.jsx(Mn,{tooltip:`${f("unifiedCanvas.layer")} (Q)`,tooltipProps:{hasArrow:!0,placement:"top"},value:o,validValues:K1,onChange:I,isDisabled:n}),l.jsx(oN,{}),l.jsx(lN,{}),l.jsxs(Qt,{isAttached:!0,children:[l.jsx(se,{"aria-label":`${f("unifiedCanvas.move")} (V)`,tooltip:`${f("unifiedCanvas.move")} (V)`,icon:l.jsx(Nx,{}),isChecked:s==="move"||n,onClick:h}),l.jsx(se,{"aria-label":`${f("unifiedCanvas.resetView")} (R)`,tooltip:`${f("unifiedCanvas.resetView")} (R)`,icon:l.jsx(Lx,{}),onClick:y})]}),l.jsxs(Qt,{isAttached:!0,children:[l.jsx(se,{"aria-label":`${f("unifiedCanvas.mergeVisible")} (Shift+M)`,tooltip:`${f("unifiedCanvas.mergeVisible")} (Shift+M)`,icon:l.jsx(Vx,{}),onClick:C,isDisabled:n}),l.jsx(se,{"aria-label":`${f("unifiedCanvas.saveToGallery")} (Shift+S)`,tooltip:`${f("unifiedCanvas.saveToGallery")} (Shift+S)`,icon:l.jsx(Qh,{}),onClick:k,isDisabled:n}),l.jsx(se,{"aria-label":`${f("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${f("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,icon:l.jsx(Ki,{}),onClick:w,isDisabled:n}),l.jsx(se,{"aria-label":`${f("unifiedCanvas.downloadAsImage")} (Shift+D)`,tooltip:`${f("unifiedCanvas.downloadAsImage")} (Shift+D)`,icon:l.jsx(Xh,{}),onClick:j,isDisabled:n})]}),l.jsxs(Qt,{isAttached:!0,children:[l.jsx(Z4,{}),l.jsx(Q4,{})]}),l.jsxs(Qt,{isAttached:!0,children:[l.jsx(se,{"aria-label":`${f("common.upload")}`,tooltip:`${f("common.upload")}`,icon:l.jsx(Oc,{}),onClick:p,isDisabled:n}),l.jsx(se,{"aria-label":`${f("unifiedCanvas.clearCanvas")}`,tooltip:`${f("unifiedCanvas.clearCanvas")}`,icon:l.jsx(ri,{}),onClick:S,colorScheme:"error",isDisabled:n})]}),l.jsx(Qt,{isAttached:!0,children:l.jsx(aN,{})})]})},dN=me([tt],e=>{const{doesCanvasNeedScaling:t}=e;return{doesCanvasNeedScaling:t}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),fN=()=>{const e=Y(),{doesCanvasNeedScaling:t}=A(dN);return g.useLayoutEffect(()=>{e(cn());const n=()=>{e(cn())};return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),l.jsx(Ye,{sx:{width:"100%",height:"100%",padding:4,borderRadius:"base",bg:"base.850"},children:l.jsxs(B,{sx:{flexDirection:"column",alignItems:"center",gap:4,width:"100%",height:"100%"},children:[l.jsx(uN,{}),l.jsx(B,{sx:{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:4,width:"100%",height:"100%"},children:t?l.jsx(X4,{}):l.jsx(K4,{})})]})})},hN=me(tt,e=>{const{boundingBoxDimensions:t,boundingBoxScaleMethod:n}=e;return{boundingBoxDimensions:t,boundingBoxScale:n}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),pN=()=>{const e=Y(),{boundingBoxDimensions:t}=A(hN),{t:n}=X(),r=u=>{e(Oa({...t,width:Math.floor(u)}))},o=u=>{e(Oa({...t,height:Math.floor(u)}))},s=()=>{e(Oa({...t,width:Math.floor(512)}))},c=()=>{e(Oa({...t,height:Math.floor(512)}))};return l.jsxs(ze,{gap:2,alignItems:"stretch",children:[l.jsx(ut,{label:n("parameters.width"),min:64,max:1024,step:64,value:t.width,onChange:r,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:s}),l.jsx(ut,{label:n("parameters.height"),min:64,max:1024,step:64,value:t.height,onChange:o,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:c})]})},mN=me([Pp,Et,tt],(e,t,n)=>{const{tileSize:r,infillMethod:o}=e,{infill_methods:s}=t,{boundingBoxScaleMethod:c,scaledBoundingBoxDimensions:u}=n;return{boundingBoxScale:c,scaledBoundingBoxDimensions:u,tileSize:r,infillMethod:o,availableInfillMethods:s,isManual:c==="manual"}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),vN=()=>{const e=Y(),{tileSize:t,infillMethod:n,availableInfillMethods:r,boundingBoxScale:o,isManual:s,scaledBoundingBoxDimensions:c}=A(mN),{t:u}=X(),f=S=>{e(yl({...c,width:Math.floor(S)}))},p=S=>{e(yl({...c,height:Math.floor(S)}))},h=()=>{e(yl({...c,width:Math.floor(512)}))},y=()=>{e(yl({...c,height:Math.floor(512)}))},x=S=>{e(cC(S.target.value))};return l.jsxs(ze,{gap:2,alignItems:"stretch",children:[l.jsx(Mn,{label:u("parameters.scaleBeforeProcessing"),validValues:sC,value:o,onChange:x}),l.jsx(ut,{isInputDisabled:!s,isResetDisabled:!s,isSliderDisabled:!s,label:u("parameters.scaledWidth"),min:64,max:1024,step:64,value:c.width,onChange:f,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:h}),l.jsx(ut,{isInputDisabled:!s,isResetDisabled:!s,isSliderDisabled:!s,label:u("parameters.scaledHeight"),min:64,max:1024,step:64,value:c.height,onChange:p,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:y}),l.jsx(Mn,{label:u("parameters.infillMethod"),value:n,validValues:r,onChange:S=>e(lC(S.target.value))}),l.jsx(ut,{isInputDisabled:n!=="tile",isResetDisabled:n!=="tile",isSliderDisabled:n!=="tile",label:u("parameters.tileSize"),min:16,max:64,sliderNumberInputProps:{max:256},value:t,onChange:S=>{e(Lv(S))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(Lv(32))}})]})};function gN(){const e=Y(),t=A(r=>r.generation.seamBlur),{t:n}=X();return l.jsx(ut,{label:n("parameters.seamBlur"),min:0,max:64,sliderNumberInputProps:{max:512},value:t,onChange:r=>{e(Bv(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(Bv(16))}})}function yN(){const e=Y(),{t}=X(),n=A(r=>r.generation.seamSize);return l.jsx(ut,{label:t("parameters.seamSize"),min:1,max:256,sliderNumberInputProps:{max:512},value:n,onChange:r=>{e(Hv(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>e(Hv(96))})}function xN(){const{t:e}=X(),t=A(r=>r.generation.seamSteps),n=Y();return l.jsx(ut,{label:e("parameters.seamSteps"),min:1,max:100,sliderNumberInputProps:{max:999},value:t,onChange:r=>{n(Wv(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{n(Wv(30))}})}function bN(){const e=Y(),{t}=X(),n=A(r=>r.generation.seamStrength);return l.jsx(ut,{label:t("parameters.seamStrength"),min:.01,max:.99,step:.01,value:n,onChange:r=>{e(Vv(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(Vv(.7))}})}const SN=()=>l.jsxs(ze,{gap:2,alignItems:"stretch",children:[l.jsx(yN,{}),l.jsx(gN,{}),l.jsx(bN,{}),l.jsx(xN,{})]});function CN(){const{t:e}=X(),t={general:{header:`${e("parameters.general")}`,feature:void 0,content:l.jsx(kp,{})},unifiedCanvasImg2Img:{header:`${e("parameters.imageToImage")}`,feature:void 0,content:l.jsx(B4,{label:e("parameters.img2imgStrength")})},seed:{header:`${e("parameters.seed")}`,feature:ln.SEED,content:l.jsx(Sp,{})},boundingBox:{header:`${e("parameters.boundingBoxHeader")}`,feature:ln.BOUNDING_BOX,content:l.jsx(pN,{})},seamCorrection:{header:`${e("parameters.seamCorrectionHeader")}`,feature:ln.SEAM_CORRECTION,content:l.jsx(SN,{})},infillAndScaling:{header:`${e("parameters.infillScalingHeader")}`,feature:ln.INFILL_AND_SCALING,content:l.jsx(vN,{})},variations:{header:`${e("parameters.variations")}`,feature:ln.VARIATIONS,content:l.jsx(wp,{}),additionalHeaderComponents:l.jsx(Cp,{})},symmetry:{header:`${e("parameters.symmetry")}`,content:l.jsx(xp,{}),additionalHeaderComponents:l.jsx(bp,{})}};return l.jsxs(B,{flexDir:"column",gap:2,position:"relative",children:[l.jsx(_p,{}),l.jsx(Tp,{}),l.jsx(Mp,{}),l.jsx(jp,{accordionInfo:t})]})}function wN(){const e=A(n=>n.ui.shouldUseCanvasBetaLayout),t=A(bt);return l.jsx(hp,{parametersPanelContent:l.jsx(CN,{}),children:t==="unifiedCanvas"&&(e?l.jsx(nN,{}):l.jsx(fN,{}))})}const _i={boxSize:6},l1=[{id:"txt2img",icon:l.jsx(tn,{as:FD,sx:_i}),workarea:l.jsx(fO,{})},{id:"img2img",icon:l.jsx(tn,{as:dp,sx:_i}),workarea:l.jsx(oO,{})},{id:"unifiedCanvas",icon:l.jsx(tn,{as:HD,sx:_i}),workarea:l.jsx(wN,{})},{id:"nodes",icon:l.jsx(tn,{as:LD,sx:_i}),workarea:l.jsx(YD,{})},{id:"postprocessing",icon:l.jsx(tn,{as:WD,sx:_i}),workarea:l.jsx(KD,{})},{id:"training",icon:l.jsx(tn,{as:BD,sx:_i}),workarea:l.jsx(XD,{})}];function kN(){const e=A(Y8),t=A(f=>f.lightbox.isLightboxOpen),n=A(f=>f.ui.shouldPinGallery),r=A(f=>f.ui.shouldPinParametersPanel),{t:o}=X(),s=Y();de("1",()=>{s(jn(0))}),de("2",()=>{s(jn(1))}),de("3",()=>{s(jn(2))}),de("4",()=>{s(jn(3))}),de("5",()=>{s(jn(4))}),de("6",()=>{s(jn(5))}),de("z",()=>{s(Vo(!t))},[t]),de("f",()=>{s(uC()),(n||r)&&s(cn())},[n,r]);const c=g.useMemo(()=>l1.map(f=>l.jsx(Gt,{hasArrow:!0,label:String(o(`common.${f.id}`)),placement:"end",children:l.jsxs(vx,{children:[l.jsx(S2,{children:String(o(`common.${f.id}`))}),f.icon]})},f.id)),[o]),u=g.useMemo(()=>l1.map(f=>l.jsx(px,{children:f.workarea},f.id)),[]);return l.jsxs(fx,{isLazy:!0,defaultIndex:e,index:e,onChange:f=>{s(jn(f))},flexGrow:1,children:[l.jsx(hx,{children:c}),l.jsx(mx,{children:u})]})}function jN(){async function e(n=""){return await fetch(n,{method:"GET",cache:"no-cache"})}const t=()=>{const n=document.location;e(n+"/flaskwebgui-keep-server-alive").then(o=>o)};(!{}.NODE_ENV||{}.NODE_ENV==="production")&&document.addEventListener("DOMContentLoaded",()=>{t(),setInterval(t,3e3)})}const EN=()=>{const e=Y(),t=A(G9),n=ss();g.useEffect(()=>{t.forEach(r=>{n(r)}),t.length>0&&e(dC())},[e,n,t])},PN=me([bt,Er],(e,t)=>{const{shouldPinGallery:n,shouldShowGallery:r}=t;return{shouldPinGallery:n,shouldShowGalleryButton:(!n||!r)&&["txt2img","img2img","unifiedCanvas"].includes(e)}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),IN=()=>{const{t:e}=X(),{shouldPinGallery:t,shouldShowGalleryButton:n}=A(PN),r=Y(),o=()=>{r(sf(!0)),t&&r(cn())};return n?l.jsx(se,{tooltip:"Show Gallery (G)",tooltipProps:{placement:"top"},"aria-label":e("accessibility.showGallery"),onClick:o,sx:{pos:"absolute",top:"50%",transform:"translate(0, -50%)",zIndex:31,p:0,insetInlineEnd:0,px:3,h:48,w:8,borderStartEndRadius:0,borderEndEndRadius:0},children:l.jsx(dp,{})}):null},$d={borderStartStartRadius:0,borderEndStartRadius:0},MN=me([Er,bt],(e,t)=>{const{shouldPinParametersPanel:n,shouldUseCanvasBetaLayout:r,shouldShowParametersPanel:o}=e,s=r&&t==="unifiedCanvas",c=!s&&(!n||!o),u=!s&&(!n||!o)&&["txt2img","img2img","unifiedCanvas"].includes(t);return{shouldPinParametersPanel:n,shouldShowParametersPanelButton:u,shouldShowProcessButtons:c}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),TN=()=>{const e=Y(),{t}=X(),{shouldShowProcessButtons:n,shouldShowParametersPanelButton:r,shouldPinParametersPanel:o}=A(MN),s=()=>{e(ql(!0)),o&&e(cn())};return r?l.jsxs(B,{pos:"absolute",transform:"translate(0, -50%)",zIndex:20,minW:8,top:"50%",insetInlineStart:"4.5rem",direction:"column",gap:2,children:[l.jsx(se,{tooltip:"Show Options Panel (O)",tooltipProps:{placement:"top"},"aria-label":t("accessibility.showOptionsPanel"),onClick:s,sx:$d,children:l.jsx(Zh,{})}),n&&l.jsxs(l.Fragment,{children:[l.jsx(Ip,{iconButton:!0,sx:$d}),l.jsx(Ep,{sx:$d})]})]}):null};var Wa=globalThis&&globalThis.__assign||function(){return Wa=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},Wa.apply(this,arguments)};function _N(e){var t,n=g.useState(!1),r=n[0],o=n[1],s=g.useState(!1),c=s[0],u=s[1],f=g.useState(!1),p=f[0],h=f[1],y=g.useState([0,0]),x=y[0],S=y[1],C=g.useRef(null);g.useEffect(function(){if(r)setTimeout(function(){u(!0),setTimeout(function(){h(!0)})});else{h(!1);var w=setTimeout(function(){u(r)},1e3);return function(){return clearTimeout(w)}}},[r]),w6("contextmenu",function(w){var j;!((j=C.current)===null||j===void 0)&&j.contains(w.target)||w.target===C.current?(w.preventDefault(),o(!0),S([w.pageX,w.pageY])):o(!1)});var k=g.useCallback(function(){var w,j;(j=(w=e.menuProps)===null||w===void 0?void 0:w.onClose)===null||j===void 0||j.call(w),o(!1)},[(t=e.menuProps)===null||t===void 0?void 0:t.onClose,o]);return g.createElement(g.Fragment,null,e.children(C),c&&g.createElement(Ua,Wa({},e.portalProps),g.createElement(Dh,Wa({isOpen:p,gutter:0},e.menuProps,{onClose:k}),g.createElement(Oh,Wa({"aria-hidden":!0,w:1,h:1,style:{position:"absolute",left:x[0],top:x[1],cursor:"default"}},e.menuButtonProps)),e.renderMenu())))}const DN=(e,t)=>e.image.uuid===t.image.uuid&&e.isSelected===t.isSelected,ab=g.memo(e=>{const t=Y(),{activeTabName:n,galleryImageObjectFit:r,galleryImageMinimumWidth:o,mayDeleteImage:s,shouldUseSingleGalleryColumn:c}=A(ZD),{image:u,isSelected:f}=e,{url:p,thumbnail:h,uuid:y,metadata:x}=u,[S,C]=g.useState(!1),k=ss(),{direction:w}=ea(),{t:j}=X(),I=gp(),P=()=>C(!0),M=()=>C(!1),T=()=>{var K,te,ne,$;(te=(K=u.metadata)==null?void 0:K.image)!=null&&te.prompt&&I(($=(ne=u.metadata)==null?void 0:ne.image)==null?void 0:$.prompt),k({title:j("toast.promptSet"),status:"success",duration:2500,isClosable:!0})},D=()=>{u.metadata&&t(os(u.metadata.image.seed)),k({title:j("toast.seedSet"),status:"success",duration:2500,isClosable:!0})},_=()=>{t(ns(u)),n!=="img2img"&&t(jn("img2img")),k({title:j("toast.sentToImageToImage"),status:"success",duration:2500,isClosable:!0})},R=()=>{t(xc(u)),t(bc()),n!=="unifiedCanvas"&&t(jn("unifiedCanvas")),k({title:j("toast.sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0})},V=()=>{x&&t(_1(x)),k({title:j("toast.parametersSet"),status:"success",duration:2500,isClosable:!0})},F=async()=>{var K;if((K=x==null?void 0:x.image)!=null&&K.init_image_path&&(await fetch(x.image.init_image_path)).ok){t(jn("img2img")),t(fC(x)),k({title:j("toast.initialImageSet"),status:"success",duration:2500,isClosable:!0});return}k({title:j("toast.initialImageNotSet"),description:j("toast.initialImageNotSetDesc"),status:"error",duration:2500,isClosable:!0})},L=()=>t(Uv(u)),Q=K=>{K.dataTransfer.setData("invokeai/imageUuid",y),K.dataTransfer.effectAllowed="move"},U=()=>{t(Uv(u)),t(Vo(!0))};return l.jsx(_N,{menuProps:{size:"sm",isLazy:!0},renderMenu:()=>{var K,te,ne,$,Z,oe,le,Re;return l.jsxs(Ah,{children:[l.jsx(vr,{onClickCapture:U,children:j("parameters.openInViewer")}),l.jsx(vr,{onClickCapture:T,isDisabled:((te=(K=u==null?void 0:u.metadata)==null?void 0:K.image)==null?void 0:te.prompt)===void 0,children:j("parameters.usePrompt")}),l.jsx(vr,{onClickCapture:D,isDisabled:(($=(ne=u==null?void 0:u.metadata)==null?void 0:ne.image)==null?void 0:$.seed)===void 0,children:j("parameters.useSeed")}),l.jsx(vr,{onClickCapture:V,isDisabled:!["txt2img","img2img"].includes((oe=(Z=u==null?void 0:u.metadata)==null?void 0:Z.image)==null?void 0:oe.type),children:j("parameters.useAll")}),l.jsx(vr,{onClickCapture:F,isDisabled:((Re=(le=u==null?void 0:u.metadata)==null?void 0:le.image)==null?void 0:Re.type)!=="img2img",children:j("parameters.useInitImg")}),l.jsx(vr,{onClickCapture:_,children:j("parameters.sendToImg2Img")}),l.jsx(vr,{onClickCapture:R,children:j("parameters.sendToUnifiedCanvas")}),l.jsx(vr,{"data-warning":!0,children:l.jsx(hc,{image:u,children:l.jsx("p",{children:j("parameters.deleteImage")})})})]})},children:K=>l.jsxs(Ye,{position:"relative",onMouseOver:P,onMouseOut:M,userSelect:"none",draggable:!0,onDragStart:Q,ref:K,sx:{padding:2,display:"flex",justifyContent:"center",transition:"transform 0.2s ease-out",_hover:{cursor:"pointer",zIndex:2},_before:{content:'""',display:"block",paddingBottom:"100%"}},children:[l.jsx(ls,{objectFit:c?"contain":r,rounded:"md",src:h||p,loading:"lazy",sx:{position:"absolute",width:"100%",height:"100%",maxWidth:"100%",maxHeight:"100%",top:"50%",transform:"translate(-50%,-50%)",...w==="rtl"?{insetInlineEnd:"50%"}:{insetInlineStart:"50%"}}}),l.jsx(B,{onClick:L,sx:{position:"absolute",top:"0",insetInlineStart:"0",width:"100%",height:"100%",alignItems:"center",justifyContent:"center"},children:f&&l.jsx(tn,{as:Ac,sx:{width:"50%",height:"50%",fill:"ok.500"}})}),S&&o>=64&&l.jsx(Ye,{sx:{position:"absolute",top:1,insetInlineEnd:1},children:l.jsx(hc,{image:u,children:l.jsx(se,{"aria-label":j("parameters.deleteImage"),icon:l.jsx(V9,{}),size:"xs",fontSize:14,isDisabled:!s})})})]},y)})},DN);ab.displayName="HoverableImage";const AN=290,sb=()=>{const e=Y(),{t}=X(),n=g.useRef(null),[r,o]=g.useState(!0),{images:s,currentCategory:c,currentImageUuid:u,shouldPinGallery:f,galleryImageMinimumWidth:p,galleryGridTemplateColumns:h,galleryImageObjectFit:y,shouldAutoSwitchToNewImages:x,areMoreImagesAvailable:S,shouldUseSingleGalleryColumn:C}=A(QD),k=()=>{e(vC(c))},w=I=>{e(Zl(I))},j=()=>{e(c2()),e(cn())};return g.useEffect(()=>{if(!n.current)return;const I=new ResizeObserver(()=>{if(n.current){if(n.current.clientWidth<AN){o(!0);return}o(!1)}});return I.observe(n.current),()=>I.disconnect()},[]),l.jsxs(B,{flexDirection:"column",w:"full",h:"full",gap:4,children:[l.jsxs(B,{ref:n,alignItems:"center",justifyContent:"space-between",children:[l.jsx(Qt,{size:"sm",isAttached:!0,w:"max-content",justifyContent:"stretch",children:r?l.jsxs(l.Fragment,{children:[l.jsx(se,{"aria-label":t("gallery.showGenerations"),tooltip:t("gallery.showGenerations"),isChecked:c==="result",role:"radio",icon:l.jsx(T9,{}),onClick:()=>e(xl("result"))}),l.jsx(se,{"aria-label":t("gallery.showUploads"),tooltip:t("gallery.showUploads"),role:"radio",isChecked:c==="user",icon:l.jsx($9,{}),onClick:()=>e(xl("user"))})]}):l.jsxs(l.Fragment,{children:[l.jsx(Je,{size:"sm",isChecked:c==="result",onClick:()=>e(xl("result")),flexGrow:1,children:t("gallery.generations")}),l.jsx(Je,{size:"sm",isChecked:c==="user",onClick:()=>e(xl("user")),flexGrow:1,children:t("gallery.uploads")})]})}),l.jsxs(B,{gap:2,children:[l.jsx(rr,{triggerComponent:l.jsx(se,{size:"sm","aria-label":t("gallery.gallerySettings"),icon:l.jsx(Jh,{})}),children:l.jsxs(B,{direction:"column",gap:2,children:[l.jsx(ut,{value:p,onChange:w,min:32,max:256,hideTooltip:!0,label:t("gallery.galleryImageSize"),withReset:!0,handleReset:()=>e(Zl(64))}),l.jsx(pt,{label:t("gallery.maintainAspectRatio"),isChecked:y==="contain",onChange:()=>e(hC(y==="contain"?"cover":"contain"))}),l.jsx(pt,{label:t("gallery.autoSwitchNewImages"),isChecked:x,onChange:I=>e(pC(I.target.checked))}),l.jsx(pt,{label:t("gallery.singleColumnLayout"),isChecked:C,onChange:I=>e(mC(I.target.checked))})]})}),l.jsx(se,{size:"sm","aria-label":t("gallery.pinGallery"),tooltip:`${t("gallery.pinGallery")} (Shift+G)`,onClick:j,icon:f?l.jsx(T4,{}):l.jsx(_4,{})})]})]}),l.jsx(M4,{children:l.jsx(B,{direction:"column",gap:2,h:"full",children:s.length||S?l.jsxs(l.Fragment,{children:[l.jsx(or,{gap:2,style:{gridTemplateColumns:h},children:s.map(I=>{const{uuid:P}=I,M=u===P;return l.jsx(ab,{image:I,isSelected:M},P)})}),l.jsx(Je,{onClick:k,isDisabled:!S,flexShrink:0,children:t(S?"gallery.loadMore":"gallery.allImagesLoaded")})]}):l.jsxs(B,{sx:{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,padding:8,h:"100%",w:"100%",color:"base.500"},children:[l.jsx(tn,{as:dp,sx:{w:16,h:16}}),l.jsx(Ce,{textAlign:"center",children:t("gallery.noImagesInGallery")})]})})})]})};sb.displayName="ImageGalleryContent";const c1={txt2img:{galleryMinWidth:200,galleryMaxWidth:500},img2img:{galleryMinWidth:200,galleryMaxWidth:500},unifiedCanvas:{galleryMinWidth:200,galleryMaxWidth:200},nodes:{galleryMinWidth:200,galleryMaxWidth:500},postprocessing:{galleryMinWidth:200,galleryMaxWidth:500},training:{galleryMinWidth:200,galleryMaxWidth:500}},ON=me([bt,Er,Gr,Ot,bs],(e,t,n,r,o)=>{const{shouldPinGallery:s,shouldShowGallery:c}=t,{galleryImageMinimumWidth:u}=n,{isLightboxOpen:f}=o;return{activeTabName:e,isStaging:r,shouldPinGallery:s,shouldShowGallery:c,galleryImageMinimumWidth:u,isResizable:e!=="unifiedCanvas",isLightboxOpen:f}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}});function zN(){const e=Y(),{shouldPinGallery:t,shouldShowGallery:n,galleryImageMinimumWidth:r,activeTabName:o,isStaging:s,isResizable:c,isLightboxOpen:u}=A(ON),f=()=>{e(c2()),e(cn())},p=()=>{e(gC()),t&&e(cn())},h=()=>{e(sf(!1)),t&&e(cn())};de("g",()=>{p()},[t]),de("left",()=>{e(F1())},{enabled:!s||o!=="unifiedCanvas"},[s,o]),de("right",()=>{e(L1())},{enabled:!s||o!=="unifiedCanvas"},[s,o]),de("shift+g",()=>{f()},[t]),de("esc",()=>{e(sf(!1))},{enabled:()=>!t,preventDefault:!0},[t]);const y=32;return de("shift+up",()=>{if(r<256){const x=ee.clamp(r+y,32,256);e(Zl(x))}},[r]),de("shift+down",()=>{if(r>32){const x=ee.clamp(r-y,32,256);e(Zl(x))}},[r]),l.jsx(I4,{direction:"right",isResizable:c||!t,isOpen:n,onClose:h,isPinned:t&&!u,minWidth:t?c1[o].galleryMinWidth:200,maxWidth:t?c1[o].galleryMaxWidth:void 0,children:l.jsx(sb,{})})}var Hn=function(e,t){return Number(e.toFixed(t))},RN=function(e,t){return typeof e=="number"?e:t},Mt=function(e,t,n){n&&typeof n=="function"&&n(e,t)},NN=function(e){return-Math.cos(e*Math.PI)/2+.5},FN=function(e){return e},LN=function(e){return e*e},BN=function(e){return e*(2-e)},HN=function(e){return e<.5?2*e*e:-1+(4-2*e)*e},WN=function(e){return e*e*e},VN=function(e){return--e*e*e+1},UN=function(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},$N=function(e){return e*e*e*e},GN=function(e){return 1- --e*e*e*e},qN=function(e){return e<.5?8*e*e*e*e:1-8*--e*e*e*e},YN=function(e){return e*e*e*e*e},KN=function(e){return 1+--e*e*e*e*e},XN=function(e){return e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e},lb={easeOut:NN,linear:FN,easeInQuad:LN,easeOutQuad:BN,easeInOutQuad:HN,easeInCubic:WN,easeOutCubic:VN,easeInOutCubic:UN,easeInQuart:$N,easeOutQuart:GN,easeInOutQuart:qN,easeInQuint:YN,easeOutQuint:KN,easeInOutQuint:XN},cb=function(e){typeof e=="number"&&cancelAnimationFrame(e)},xr=function(e){e.mounted&&(cb(e.animation),e.animate=!1,e.animation=null,e.velocity=null)};function ub(e,t,n,r){if(e.mounted){var o=new Date().getTime(),s=1;xr(e),e.animation=function(){if(!e.mounted)return cb(e.animation);var c=new Date().getTime()-o,u=c/n,f=lb[t],p=f(u);c>=n?(r(s),e.animation=null):e.animation&&(r(p),requestAnimationFrame(e.animation))},requestAnimationFrame(e.animation)}}function QN(e){var t=e.scale,n=e.positionX,r=e.positionY;return!(Number.isNaN(t)||Number.isNaN(n)||Number.isNaN(r))}function Co(e,t,n,r){var o=QN(t);if(!(!e.mounted||!o)){var s=e.setTransformState,c=e.transformState,u=c.scale,f=c.positionX,p=c.positionY,h=t.scale-u,y=t.positionX-f,x=t.positionY-p;n===0?s(t.scale,t.positionX,t.positionY):ub(e,r,n,function(S){var C=u+h*S,k=f+y*S,w=p+x*S;s(C,k,w)})}}function ZN(e,t,n){var r=e.offsetWidth,o=e.offsetHeight,s=t.offsetWidth,c=t.offsetHeight,u=s*n,f=c*n,p=r-u,h=o-f;return{wrapperWidth:r,wrapperHeight:o,newContentWidth:u,newDiffWidth:p,newContentHeight:f,newDiffHeight:h}}var JN=function(e,t,n,r,o,s,c){var u=e>t?n*(c?1:.5):0,f=r>o?s*(c?1:.5):0,p=e-t-u,h=u,y=r-o-f,x=f;return{minPositionX:p,maxPositionX:h,minPositionY:y,maxPositionY:x}},Np=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=ZN(n,r,t),c=s.wrapperWidth,u=s.wrapperHeight,f=s.newContentWidth,p=s.newDiffWidth,h=s.newContentHeight,y=s.newDiffHeight,x=JN(c,f,p,u,h,y,Boolean(o));return x},Yf=function(e,t,n,r){return r?e<t?Hn(t,2):e>n?Hn(n,2):Hn(e,2):Hn(e,2)},Ji=function(e,t){var n=Np(e,t);return e.bounds=n,n};function Uc(e,t,n,r,o,s,c){var u=n.minPositionX,f=n.minPositionY,p=n.maxPositionX,h=n.maxPositionY,y=0,x=0;c&&(y=o,x=s);var S=Yf(e,u-y,p+y,r),C=Yf(t,f-x,h+x,r);return{x:S,y:C}}function $c(e,t,n,r,o,s){var c=e.transformState,u=c.scale,f=c.positionX,p=c.positionY,h=r-u;if(typeof t!="number"||typeof n!="number")return console.error("Mouse X and Y position were not provided!"),{x:f,y:p};var y=f-t*h,x=p-n*h,S=Uc(y,x,o,s,0,0,null);return S}function Ss(e,t,n,r,o){var s=o?r:0,c=t-s;return!Number.isNaN(n)&&e>=n?n:!Number.isNaN(t)&&e<=c?c:e}var u1=function(e,t){var n=e.setup.panning.excluded,r=e.isInitialized,o=e.wrapperComponent,s=t.target,c=o==null?void 0:o.contains(s),u=r&&s&&c;if(!u)return!1;var f=Gc(s,n);return!f},d1=function(e){var t=e.isInitialized,n=e.isPanning,r=e.setup,o=r.panning.disabled,s=t&&n&&!o;return!!s},eF=function(e,t){var n=e.transformState,r=n.positionX,o=n.positionY;e.isPanning=!0;var s=t.clientX,c=t.clientY;e.startCoords={x:s-r,y:c-o}},tF=function(e,t){var n=t.touches,r=e.transformState,o=r.positionX,s=r.positionY;e.isPanning=!0;var c=n.length===1;if(c){var u=n[0].clientX,f=n[0].clientY;e.startCoords={x:u-o,y:f-s}}};function nF(e){var t=e.transformState,n=t.positionX,r=t.positionY,o=t.scale,s=e.setup,c=s.disabled,u=s.limitToBounds,f=s.centerZoomedOut,p=e.wrapperComponent;if(!(c||!p||!e.bounds)){var h=e.bounds,y=h.maxPositionX,x=h.minPositionX,S=h.maxPositionY,C=h.minPositionY,k=n>y||n<x,w=r>S||r<C,j=n>y?p.offsetWidth:e.setup.minPositionX||0,I=r>S?p.offsetHeight:e.setup.minPositionY||0,P=$c(e,j,I,o,e.bounds,u||f),M=P.x,T=P.y;return{scale:o,positionX:k?M:n,positionY:w?T:r}}}function rF(e,t,n,r,o){var s=e.setup.limitToBounds,c=e.wrapperComponent,u=e.bounds,f=e.transformState,p=f.scale,h=f.positionX,y=f.positionY;if(!(c===null||u===null||t===h&&n===y)){var x=Uc(t,n,u,s,r,o,c),S=x.x,C=x.y;e.setTransformState(p,S,C)}}var oF=function(e,t,n){var r=e.startCoords,o=e.transformState,s=e.setup.panning,c=s.lockAxisX,u=s.lockAxisY,f=o.positionX,p=o.positionY;if(!r)return{x:f,y:p};var h=t-r.x,y=n-r.y,x=c?f:h,S=u?p:y;return{x,y:S}},gc=function(e,t){var n=e.setup,r=e.transformState,o=r.scale,s=n.minScale,c=n.disablePadding;return t>0&&o>=s&&!c?t:0},iF=function(e){var t=e.mounted,n=e.setup,r=n.disabled,o=n.velocityAnimation,s=e.transformState.scale,c=o.disabled,u=!c||s>1||!r||t;return!!u},aF=function(e){var t=e.mounted,n=e.velocity,r=e.bounds,o=e.setup,s=o.disabled,c=o.velocityAnimation,u=e.transformState.scale,f=c.disabled,p=!f||u>1||!s||t;return!(!p||!n||!r)};function sF(e,t){var n=e.setup.velocityAnimation,r=n.equalToMove,o=n.animationTime,s=n.sensitivity;return r?o*t*s:o}function f1(e,t,n,r,o,s,c,u,f,p){if(o){if(t>c&&n>c){var h=c+(e-c)*p;return h>f?f:h<c?c:h}if(t<s&&n<s){var h=s+(e-s)*p;return h<u?u:h>s?s:h}}return r?t:Yf(e,s,c,o)}function lF(e,t){var n=1;return t?Math.min(n,e.offsetWidth/window.innerWidth):n}function cF(e,t){var n=iF(e);if(n){var r=e.lastMousePosition,o=e.velocityTime,s=e.setup,c=e.wrapperComponent,u=s.velocityAnimation.equalToMove,f=Date.now();if(r&&o&&c){var p=lF(c,u),h=t.x-r.x,y=t.y-r.y,x=h/p,S=y/p,C=f-o,k=h*h+y*y,w=Math.sqrt(k)/C;e.velocity={velocityX:x,velocityY:S,total:w}}e.lastMousePosition=t,e.velocityTime=f}}function uF(e){var t=e.velocity,n=e.bounds,r=e.setup,o=e.wrapperComponent,s=aF(e);if(!(!s||!t||!n||!o)){var c=t.velocityX,u=t.velocityY,f=t.total,p=n.maxPositionX,h=n.minPositionX,y=n.maxPositionY,x=n.minPositionY,S=r.limitToBounds,C=r.alignmentAnimation,k=r.zoomAnimation,w=r.panning,j=w.lockAxisY,I=w.lockAxisX,P=k.animationType,M=C.sizeX,T=C.sizeY,D=C.velocityAlignmentTime,_=D,R=sF(e,f),V=Math.max(R,_),F=gc(e,M),L=gc(e,T),Q=F*o.offsetWidth/100,U=L*o.offsetHeight/100,K=p+Q,te=h-Q,ne=y+U,$=x-U,Z=e.transformState,oe=new Date().getTime();ub(e,P,V,function(le){var Re=e.transformState,Ne=Re.scale,Ie=Re.positionX,pe=Re.positionY,ce=new Date().getTime()-oe,Fe=ce/_,Ve=lb[C.animationType],Ue=1-Ve(Math.min(1,Fe)),$e=1-le,Qe=Ie+c*$e,ge=pe+u*$e,Te=f1(Qe,Z.positionX,Ie,I,S,h,p,te,K,Ue),Ge=f1(ge,Z.positionY,pe,j,S,x,y,$,ne,Ue);(Ie!==Qe||pe!==ge)&&e.setTransformState(Ne,Te,Ge)})}}function h1(e,t){var n=e.transformState.scale;xr(e),Ji(e,n),window.TouchEvent!==void 0&&t instanceof TouchEvent?tF(e,t):eF(e,t)}function db(e){var t=e.transformState.scale,n=e.setup,r=n.minScale,o=n.alignmentAnimation,s=o.disabled,c=o.sizeX,u=o.sizeY,f=o.animationTime,p=o.animationType,h=s||t<r||!c&&!u;if(!h){var y=nF(e);y&&Co(e,y,f,p)}}function p1(e,t,n){var r=e.startCoords,o=e.setup,s=o.alignmentAnimation,c=s.sizeX,u=s.sizeY;if(r){var f=oF(e,t,n),p=f.x,h=f.y,y=gc(e,c),x=gc(e,u);cF(e,{x:p,y:h}),rF(e,p,h,y,x)}}function dF(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(),c=o==null?void 0:o.getBoundingClientRect(),u=(s==null?void 0:s.width)||0,f=(s==null?void 0:s.height)||0,p=(c==null?void 0:c.width)||0,h=(c==null?void 0:c.height)||0,y=u<p||f<h,x=!t&&n&&(n==null?void 0:n.total)>.1&&y;x?uF(e):db(e)}}function Fp(e,t,n,r){var o=e.setup,s=o.minScale,c=o.maxScale,u=o.limitToBounds,f=Ss(Hn(t,2),s,c,0,!1),p=Ji(e,f),h=$c(e,n,r,f,p,u),y=h.x,x=h.y;return{scale:f,positionX:y,positionY:x}}function fb(e,t,n){var r=e.transformState.scale,o=e.wrapperComponent,s=e.setup,c=s.minScale,u=s.limitToBounds,f=s.zoomAnimation,p=f.disabled,h=f.animationTime,y=f.animationType,x=p||r>=c;if((r>=1||u)&&db(e),!(x||!o||!e.mounted)){var S=t||o.offsetWidth/2,C=n||o.offsetHeight/2,k=Fp(e,c,S,C);k&&Co(e,k,h,y)}}var uo=function(){return uo=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},uo.apply(this,arguments)};function m1(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var Rl={previousScale:1,scale:1,positionX:0,positionY:0},Aa={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}},hb=function(e){var t,n,r,o;return{previousScale:(t=e.initialScale)!==null&&t!==void 0?t:Rl.scale,scale:(n=e.initialScale)!==null&&n!==void 0?n:Rl.scale,positionX:(r=e.initialPositionX)!==null&&r!==void 0?r:Rl.positionX,positionY:(o=e.initialPositionY)!==null&&o!==void 0?o:Rl.positionY}},v1=function(e){var t=uo({},Aa);return Object.keys(e).forEach(function(n){var r=typeof e[n]<"u",o=typeof Aa[n]<"u";if(o&&r){var s=Object.prototype.toString.call(Aa[n]),c=s==="[object Object]",u=s==="[object Array]";c?t[n]=uo(uo({},Aa[n]),e[n]):u?t[n]=m1(m1([],Aa[n],!0),e[n],!0):t[n]=e[n]}}),t},pb=function(e,t,n){var r=e.transformState.scale,o=e.wrapperComponent,s=e.setup,c=s.maxScale,u=s.minScale,f=s.zoomAnimation,p=f.size;if(!o)throw new Error("Wrapper is not mounted");var h=r*Math.exp(t*n),y=Ss(Hn(h,3),u,c,p,!1);return y};function mb(e,t,n,r,o){var s=e.wrapperComponent,c=e.transformState,u=c.scale,f=c.positionX,p=c.positionY;if(!s)return console.error("No WrapperComponent found");var h=s.offsetWidth,y=s.offsetHeight,x=(h/2-f)/u,S=(y/2-p)/u,C=pb(e,t,n),k=Fp(e,C,x,S);if(!k)return console.error("Error during zoom event. New transformation state was not calculated.");Co(e,k,r,o)}function vb(e,t,n,r){var o=e.setup,s=e.wrapperComponent,c=o.limitToBounds,u=hb(e.props),f=e.transformState,p=f.scale,h=f.positionX,y=f.positionY;if(s){var x=Np(e,u.scale),S=Uc(u.positionX,u.positionY,x,c,0,0,s),C={scale:u.scale,positionX:S.x,positionY:S.y};p===u.scale&&h===u.positionX&&y===u.positionY||(r==null||r(),Co(e,C,t,n))}}function fF(e,t,n,r){var o=e.getBoundingClientRect(),s=t.getBoundingClientRect(),c=n.getBoundingClientRect(),u=s.x*r.scale,f=s.y*r.scale;return{x:(o.x-c.x+u)/r.scale,y:(o.y-c.y+f)/r.scale}}function hF(e,t,n){var r=e.wrapperComponent,o=e.contentComponent,s=e.transformState,c=e.setup,u=c.limitToBounds,f=c.minScale,p=c.maxScale;if(!r||!o)return s;var h=r.getBoundingClientRect(),y=t.getBoundingClientRect(),x=fF(t,r,o,s),S=x.x,C=x.y,k=y.width/s.scale,w=y.height/s.scale,j=r.offsetWidth/k,I=r.offsetHeight/w,P=Ss(n||Math.min(j,I),f,p,0,!1),M=(h.width-k*P)/2,T=(h.height-w*P)/2,D=(h.left-S)*P+M,_=(h.top-C)*P+T,R=Np(e,P),V=Uc(D,_,R,u,0,0,r),F=V.x,L=V.y;return{positionX:F,positionY:L,scale:P}}var pF=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),mb(e,1,t,n,r)}},mF=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),mb(e,-1,t,n,r)}},vF=function(e){return function(t,n,r,o,s){o===void 0&&(o=300),s===void 0&&(s="easeOut");var c=e.transformState,u=c.positionX,f=c.positionY,p=c.scale,h=e.wrapperComponent,y=e.contentComponent,x=e.setup.disabled;if(!(x||!h||!y)){var S={positionX:Number.isNaN(t)?u:t,positionY:Number.isNaN(n)?f:n,scale:Number.isNaN(r)?p:r};Co(e,S,o,s)}}},gF=function(e){return function(t,n){t===void 0&&(t=200),n===void 0&&(n="easeOut"),vb(e,t,n)}},yF=function(e){return function(t,n,r){n===void 0&&(n=200),r===void 0&&(r="easeOut");var o=e.transformState,s=e.wrapperComponent,c=e.contentComponent;if(s&&c){var u=gb(t||o.scale,s,c);Co(e,u,n,r)}}},xF=function(e){return function(t,n,r,o){r===void 0&&(r=600),o===void 0&&(o="easeOut"),xr(e);var s=e.wrapperComponent,c=typeof t=="string"?document.getElementById(t):t;if(s&&c&&s.contains(c)){var u=hF(e,c,n);Co(e,u,r,o)}}},dt=function(e){return{instance:e,state:e.transformState,zoomIn:pF(e),zoomOut:mF(e),setTransform:vF(e),resetTransform:gF(e),centerView:yF(e),zoomToElement:xF(e)}},Gd=!1;function qd(){try{var e={get passive(){return Gd=!0,!1}};return e}catch{return Gd=!1,Gd}}var Gc=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},Kf=function(e){e&&clearTimeout(e)},bF=function(e,t,n){return"translate(".concat(e,"px, ").concat(t,"px) scale(").concat(n,")")},gb=function(e,t,n){var r=n.offsetWidth*e,o=n.offsetHeight*e,s=(t.offsetWidth-r)/2,c=(t.offsetHeight-o)/2;return{scale:e,positionX:s,positionY:c}};function SF(e){return function(t){e.forEach(function(n){typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var CF=function(e,t){var n=e.setup.wheel,r=n.disabled,o=n.wheelDisabled,s=n.touchPadDisabled,c=n.excluded,u=e.isInitialized,f=e.isPanning,p=t.target,h=u&&!f&&!r&&p;if(!h||o&&!t.ctrlKey||s&&t.ctrlKey)return!1;var y=Gc(p,c);return!y},wF=function(e){return e?e.deltaY<0?1:-1:0};function kF(e,t){var n=wF(e),r=RN(t,n);return r}function yb(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 c=e.touches[0];o=(c.clientX-r.left)/n,s=(c.clientY-r.top)/n}return(Number.isNaN(o)||Number.isNaN(s))&&console.error("No mouse or touch offset found"),{x:o,y:s}}var jF=function(e,t,n,r,o){var s=e.transformState.scale,c=e.wrapperComponent,u=e.setup,f=u.maxScale,p=u.minScale,h=u.zoomAnimation,y=u.disablePadding,x=h.size,S=h.disabled;if(!c)throw new Error("Wrapper is not mounted");var C=s+t*(s-s*n)*n;if(o)return C;var k=r?!1:!S,w=Ss(Hn(C,3),p,f,x,k&&!y);return w},EF=function(e,t){var n=e.previousWheelEvent,r=e.transformState.scale,o=e.setup,s=o.maxScale,c=o.minScale;return n?r<s||r>c||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},PF=function(e,t){var n=e.setup.pinch,r=n.disabled,o=n.excluded,s=e.isInitialized,c=t.target,u=s&&!r&&c;if(!u)return!1;var f=Gc(c,o);return!f},IF=function(e){var t=e.setup.pinch.disabled,n=e.isInitialized,r=e.pinchStartDistance,o=n&&!t&&r;return!!o},MF=function(e,t,n){var r=n.getBoundingClientRect(),o=e.touches,s=Hn(o[0].clientX-r.left,5),c=Hn(o[0].clientY-r.top,5),u=Hn(o[1].clientX-r.left,5),f=Hn(o[1].clientY-r.top,5);return{x:(s+u)/2/t,y:(c+f)/2/t}},xb=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))},TF=function(e,t){var n=e.pinchStartScale,r=e.pinchStartDistance,o=e.setup,s=o.maxScale,c=o.minScale,u=o.zoomAnimation,f=o.disablePadding,p=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 y=t/r,x=y*n;return Ss(Hn(x,2),c,s,p,!h&&!f)},_F=160,DF=100,AF=function(e,t){var n=e.props,r=n.onWheelStart,o=n.onZoomStart;e.wheelStopEventTimer||(xr(e),Mt(dt(e),t,r),Mt(dt(e),t,o))},OF=function(e,t){var n=e.props,r=n.onWheel,o=n.onZoom,s=e.contentComponent,c=e.setup,u=e.transformState,f=u.scale,p=c.limitToBounds,h=c.centerZoomedOut,y=c.zoomAnimation,x=c.wheel,S=c.disablePadding,C=y.size,k=y.disabled,w=x.step;if(!s)throw new Error("Component not mounted");t.preventDefault(),t.stopPropagation();var j=kF(t,null),I=jF(e,j,w,!t.ctrlKey);if(f!==I){var P=Ji(e,I),M=yb(t,s,f),T=k||C===0||h||S,D=p&&T,_=$c(e,M.x,M.y,I,P,D),R=_.x,V=_.y;e.previousWheelEvent=t,e.setTransformState(I,R,V),Mt(dt(e),t,r),Mt(dt(e),t,o)}},zF=function(e,t){var n=e.props,r=n.onWheelStop,o=n.onZoomStop;Kf(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout(function(){e.mounted&&(fb(e,t.x,t.y),e.wheelAnimationTimer=null)},DF);var s=EF(e,t);s&&(Kf(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout(function(){e.mounted&&(e.wheelStopEventTimer=null,Mt(dt(e),t,r),Mt(dt(e),t,o))},_F))},RF=function(e,t){var n=xb(t);e.pinchStartDistance=n,e.lastDistance=n,e.pinchStartScale=e.transformState.scale,e.isPanning=!1,xr(e)},NF=function(e,t){var n=e.contentComponent,r=e.pinchStartDistance,o=e.transformState.scale,s=e.setup,c=s.limitToBounds,u=s.centerZoomedOut,f=s.zoomAnimation,p=f.disabled,h=f.size;if(!(r===null||!n)){var y=MF(t,o,n);if(!(!Number.isFinite(y.x)||!Number.isFinite(y.y))){var x=xb(t),S=TF(e,x);if(S!==o){var C=Ji(e,S),k=p||h===0||u,w=c&&k,j=$c(e,y.x,y.y,S,C,w),I=j.x,P=j.y;e.pinchMidpoint=y,e.lastDistance=x,e.setTransformState(S,I,P)}}}},FF=function(e){var t=e.pinchMidpoint;e.velocity=null,e.lastDistance=null,e.pinchMidpoint=null,e.pinchStartScale=null,e.pinchStartDistance=null,fb(e,t==null?void 0:t.x,t==null?void 0:t.y)},bb=function(e,t){var n=e.props.onZoomStop,r=e.setup.doubleClick.animationTime;Kf(e.doubleClickStopEventTimer),e.doubleClickStopEventTimer=setTimeout(function(){e.doubleClickStopEventTimer=null,Mt(dt(e),t,n)},r)},LF=function(e,t){var n=e.props,r=n.onZoomStart,o=n.onZoom,s=e.setup.doubleClick,c=s.animationTime,u=s.animationType;Mt(dt(e),t,r),vb(e,c,u,function(){return Mt(dt(e),t,o)}),bb(e,t)};function BF(e,t){var n=e.setup,r=e.doubleClickStopEventTimer,o=e.transformState,s=e.contentComponent,c=o.scale,u=e.props,f=u.onZoomStart,p=u.onZoom,h=n.doubleClick,y=h.disabled,x=h.mode,S=h.step,C=h.animationTime,k=h.animationType;if(!y&&!r){if(x==="reset")return LF(e,t);if(!s)return console.error("No ContentComponent found");var w=x==="zoomOut"?-1:1,j=pb(e,w,S);if(c!==j){Mt(dt(e),t,f);var I=yb(t,s,c),P=Fp(e,j,I.x,I.y);if(!P)return console.error("Error during zoom event. New transformation state was not calculated.");Mt(dt(e),t,p),Co(e,P,C,k),bb(e,t)}}}var HF=function(e,t){var n=e.isInitialized,r=e.setup,o=e.wrapperComponent,s=r.doubleClick,c=s.disabled,u=s.excluded,f=t.target,p=o==null?void 0:o.contains(f),h=n&&f&&p&&!c;if(!h)return!1;var y=Gc(f,u);return!y},WF=function(){function e(t){var n=this;this.mounted=!0,this.onChangeCallbacks=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){Ji(n,n.transformState.scale),n.setup=v1(r)},this.initializeWindowEvents=function(){var r,o=qd(),s=(r=n.wrapperComponent)===null||r===void 0?void 0:r.ownerDocument,c=s==null?void 0:s.defaultView;c==null||c.addEventListener("mousedown",n.onPanningStart,o),c==null||c.addEventListener("mousemove",n.onPanning,o),c==null||c.addEventListener("mouseup",n.onPanningStop,o),s==null||s.addEventListener("mouseleave",n.clearPanning,o),c==null||c.addEventListener("keyup",n.setKeyUnPressed,o),c==null||c.addEventListener("keydown",n.setKeyPressed,o)},this.cleanupWindowEvents=function(){var r,o,s=qd(),c=(r=n.wrapperComponent)===null||r===void 0?void 0:r.ownerDocument,u=c==null?void 0:c.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),c==null||c.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),xr(n),(o=n.observer)===null||o===void 0||o.disconnect()},this.handleInitializeWrapperEvents=function(r){var o=qd();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(),o&&(n.setCenter(),n.observer=new ResizeObserver(function(){var s;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=CF(n,r);if(s){var c=n.isPressingKeys(n.setup.wheel.activationKeys);c&&(AF(n,r),OF(n,r),zF(n,r))}}},this.onPanningStart=function(r){var o=n.setup.disabled,s=n.props.onPanningStart;if(!o){var c=u1(n,r);if(c){var u=n.isPressingKeys(n.setup.panning.activationKeys);u&&(r.preventDefault(),r.stopPropagation(),xr(n),h1(n,r),Mt(dt(n),r,s))}}},this.onPanning=function(r){var o=n.setup.disabled,s=n.props.onPanning;if(!o){var c=d1(n);if(c){var u=n.isPressingKeys(n.setup.panning.activationKeys);u&&(r.preventDefault(),r.stopPropagation(),p1(n,r.clientX,r.clientY),Mt(dt(n),r,s))}}},this.onPanningStop=function(r){var o=n.props.onPanningStop;n.isPanning&&(dF(n),Mt(dt(n),r,o))},this.onPinchStart=function(r){var o=n.setup.disabled,s=n.props,c=s.onPinchingStart,u=s.onZoomStart;if(!o){var f=PF(n,r);f&&(RF(n,r),xr(n),Mt(dt(n),r,c),Mt(dt(n),r,u))}},this.onPinch=function(r){var o=n.setup.disabled,s=n.props,c=s.onPinching,u=s.onZoom;if(!o){var f=IF(n);f&&(r.preventDefault(),r.stopPropagation(),NF(n,r),Mt(dt(n),r,c),Mt(dt(n),r,u))}},this.onPinchStop=function(r){var o=n.props,s=o.onPinchingStop,c=o.onZoomStop;n.pinchStartScale&&(FF(n),Mt(dt(n),r,s),Mt(dt(n),r,c))},this.onTouchPanningStart=function(r){var o=n.setup.disabled,s=n.props.onPanningStart;if(!o){var c=u1(n,r);if(c){var u=n.lastTouch&&+new Date-n.lastTouch<200;if(u&&r.touches.length===1)n.onDoubleClick(r);else{n.lastTouch=+new Date,xr(n);var f=r.touches,p=f.length===1,h=f.length===2;p&&(xr(n),h1(n,r),Mt(dt(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 c=d1(n);if(!c)return;r.preventDefault(),r.stopPropagation();var u=r.touches[0];p1(n,u.clientX,u.clientY),Mt(dt(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=HF(n,r);s&&BF(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?Boolean(r.find(function(o){return n.pressedKeys[o]})):!0},this.setTransformState=function(r,o,s){var c=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;var u=dt(n);n.onChangeCallbacks.forEach(function(f){return f(u)}),Mt(u,{scale:r,positionX:o,positionY:s},c),n.applyTransformation()}else console.error("Detected NaN set state values")},this.setCenter=function(){if(n.wrapperComponent&&n.contentComponent){var r=gb(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):bF(r,o,s)},this.applyTransformation=function(){if(!(!n.mounted||!n.contentComponent)){var r=n.transformState,o=r.scale,s=r.positionX,c=r.positionY,u=n.handleTransformStyles(s,c,o);n.contentComponent.style.transform=u}},this.getContext=function(){return dt(n)},this.onChange=function(r){return n.onChangeCallbacks.has(r)||n.onChangeCallbacks.add(r),function(){n.onChangeCallbacks.delete(r)}},this.init=function(r,o){n.cleanupWindowEvents(),n.wrapperComponent=r,n.contentComponent=o,Ji(n,n.transformState.scale),n.handleInitializeWrapperEvents(r),n.handleInitialize(o),n.initializeWindowEvents(),n.isInitialized=!0,Mt(dt(n),void 0,n.props.onInit)},this.props=t,this.setup=v1(this.props),this.transformState=hb(this.props)}return e}(),qc=Me.createContext(null),VF=function(e,t){return typeof e=="function"?e(t):e},UF=Me.forwardRef(function(e,t){var n=g.useState(0),r=n[1],o=e.children,s=g.useRef(new WF(e)).current,c=VF(e.children,dt(s)),u=g.useCallback(function(){typeof o=="function"&&r(function(f){return f+1})},[o]);return g.useImperativeHandle(t,function(){return dt(s)},[s]),g.useEffect(function(){s.update(e)},[s,e]),g.useEffect(function(){return s.onChange(u)},[s,e,u]),Me.createElement(qc.Provider,{value:s},c)});function $F(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 GF=`.transform-component-module_wrapper__7HFJe {
|
||
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__uCDPE {
|
||
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__uCDPE img {
|
||
pointer-events: none;
|
||
}
|
||
`,g1={wrapper:"transform-component-module_wrapper__7HFJe",content:"transform-component-module_content__uCDPE"};$F(GF);var qF=function(e){var t=e.children,n=e.wrapperClass,r=n===void 0?"":n,o=e.contentClass,s=o===void 0?"":o,c=e.wrapperStyle,u=e.contentStyle,f=e.wrapperProps,p=f===void 0?{}:f,h=e.contentProps,y=h===void 0?{}:h,x=g.useContext(qc).init,S=g.useRef(null),C=g.useRef(null);return g.useEffect(function(){var k=S.current,w=C.current;k!==null&&w!==null&&x&&x(k,w)},[]),Me.createElement("div",uo({},p,{ref:S,className:"react-transform-wrapper ".concat(g1.wrapper," ").concat(r),style:c}),Me.createElement("div",uo({},y,{ref:C,className:"react-transform-component ".concat(g1.content," ").concat(s),style:u}),t))},Sb=function(){var e=g.useContext(qc),t=g.useState(dt(e||{})),n=t[0],r=t[1];if(!e)throw new Error("Transform context mus be placed inside TransformWrapper");return g.useEffect(function(){e.onChange(function(o){r(o)})},[e]),n};Me.forwardRef(function(e,t){var n=g.useRef(null),r=g.useContext(qc);return g.useEffect(function(){return r.onChange(function(o){if(n.current){var s=0,c=0;n.current.style.transform=r.handleTransformStyles(s,c,1/o.state.scale)}})},[r]),Me.createElement("div",uo({},e,{ref:SF([n,t])}))});const YF=()=>{const[e,t]=g.useState(0),[n,r]=g.useState(1),[o,s]=g.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)}}},KF=({flipHorizontally:e,flipVertically:t,rotateCounterClockwise:n,rotateClockwise:r,reset:o})=>{const{zoomIn:s,zoomOut:c,resetTransform:u}=Sb(),{t:f}=X();return l.jsxs(Qt,{isAttached:!0,orientation:"vertical",children:[l.jsx(se,{icon:l.jsx(dD,{}),"aria-label":f("accessibility.zoomIn"),tooltip:"Zoom In",onClick:()=>s(),fontSize:20}),l.jsx(se,{icon:l.jsx(fD,{}),"aria-label":f("accessibility.zoomOut"),tooltip:"Zoom Out",onClick:()=>c(),fontSize:20}),l.jsx(se,{icon:l.jsx(cD,{}),"aria-label":f("accessibility.rotateCounterClockwise"),tooltip:"Rotate Counter-Clockwise",onClick:n,fontSize:20}),l.jsx(se,{icon:l.jsx(uD,{}),"aria-label":f("accessibility.rotateClockwise"),tooltip:"Rotate Clockwise",onClick:r,fontSize:20}),l.jsx(se,{icon:l.jsx(B0,{}),"aria-label":f("accessibility.flipHorizontally"),tooltip:"Flip Horizontally",onClick:e,fontSize:20}),l.jsx(se,{icon:l.jsx(B0,{style:{transform:"rotate(90deg)"}}),"aria-label":f("accessibility.flipVertically"),tooltip:"Flip Vertically",onClick:t,fontSize:20}),l.jsx(se,{icon:l.jsx(up,{}),"aria-label":f("accessibility.reset"),tooltip:"Reset",onClick:()=>{u(),o()},fontSize:20})]})};function XF({image:e,alt:t,ref:n,styleClass:r,rotation:o,scaleX:s,scaleY:c}){const{centerView:u}=Sb();return l.jsx(qF,{wrapperStyle:{width:"100%",height:"100%"},children:l.jsx("img",{style:{transform:`rotate(${o}deg) scaleX(${s}) scaleY(${c})`,width:"100%"},src:e.url,alt:t,ref:n,className:r||"",onLoad:()=>u(1,0,"easeOut")})})}const QF=me([Gr,Er],(e,t)=>{const{currentImage:n}=e,{shouldShowImageDetails:r}=t;return{viewerImageToDisplay:n,shouldShowImageDetails:r}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}});function ZF(){const e=Y(),t=A(x=>x.lightbox.isLightboxOpen),{rotation:n,scaleX:r,scaleY:o,flipHorizontally:s,flipVertically:c,rotateCounterClockwise:u,rotateClockwise:f,reset:p}=YF(),{viewerImageToDisplay:h,shouldShowImageDetails:y}=A(QF);return de("Esc",()=>{t&&e(Vo(!1))},[t]),l.jsx(yo,{children:t&&l.jsx(ir.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15,ease:"easeInOut"},style:{display:"flex",width:"100vw",height:`calc(100vh - ${dc*4}px)`,position:"fixed",top:`${dc*4}px`,background:"var(--invokeai-colors-base-900)",zIndex:99},children:l.jsxs(UF,{centerOnInit:!0,minScale:.1,initialPositionX:50,initialPositionY:50,children:[l.jsxs(B,{sx:{flexDir:"column",position:"absolute",insetInlineStart:4,gap:4,zIndex:3,top:4},children:[l.jsx(se,{icon:l.jsx(lD,{}),"aria-label":"Exit Viewer",className:"lightbox-close-btn",onClick:()=>{e(Vo(!1))},fontSize:20}),l.jsx(KF,{flipHorizontally:s,flipVertically:c,rotateCounterClockwise:u,rotateClockwise:f,reset:p})]}),l.jsx(B,{sx:{position:"absolute",top:4,zIndex:3,insetInlineStart:"50%",transform:"translate(-50%, 0)"},children:l.jsx(D4,{})}),h&&l.jsxs(l.Fragment,{children:[l.jsx(XF,{rotation:n,scaleX:r,scaleY:o,image:h,styleClass:"lightbox-image"}),y&&l.jsx(yp,{image:h}),!y&&l.jsx(Ye,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"100vw",h:"100vh",px:16,pointerEvents:"none"},children:l.jsx(A4,{})})]})]})},"lightbox")})}jN();const rL=e=>{EN();const t=A(r=>r.ui.currentTheme),{setColorMode:n}=yC();return g.useEffect(()=>{n(["light"].includes(t)?"light":"dark")},[n,t]),l.jsxs(or,{w:"100vw",h:"100vh",children:[l.jsx(ZF,{}),l.jsxs(o9,{children:[l.jsx(rP,{}),l.jsxs(or,{gap:4,p:4,gridAutoRows:"min-content auto",w:Z9,h:J9,children:[e.children||l.jsx(P4,{}),l.jsxs(B,{gap:4,w:"full",h:"full",children:[l.jsx(kN,{}),l.jsx(zN,{})]})]}),l.jsx(Ye,{children:l.jsx(X9,{})})]}),l.jsx(Ua,{children:l.jsx(TN,{})}),l.jsx(Ua,{children:l.jsx(IN,{})})]})};export{rL as default};
|