InvokeAI/invokeai/frontend/web/dist/assets/App-5917b9c0.js
2023-07-02 22:02:53 -04:00

200 lines
974 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

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

import{t as U1,b as HR,r as VR,i as WR,a as UR,c as GR,d as q3,e as Y3,f as K3,g as qR,h as YR,j as KR,k as XR,l as ZR,m as QR,n as JR,o as eM,s as tM,p as nM,q as h,u as Be,v as i,I as uo,w as Yn,x as Oe,y as Ot,z as _r,A as at,B as _f,C as Co,D as zo,E as to,F as ur,S as Du,G as Si,H as ln,J as Ds,K as Jc,L as Ci,M as pc,N as bg,O as gx,P as kf,_ as Pr,Q as rM,R as B,T as X3,U as nS,V as Z3,W as G1,X as Au,Y as Fd,Z as oM,$ as sM,a0 as Q3,a1 as aM,a2 as wg,a3 as Bh,a4 as iM,a5 as J3,a6 as e5,a7 as lM,a8 as Pf,a9 as vx,aa as cM,ab as uM,ac as dM,ad as fM,ae as pM,af as hM,ag as mM,ah as rS,ai as et,aj as K,ak as Te,al as pr,am as Gr,an as ue,ao as q,ap as jf,aq as t5,ar as fo,as as ma,at as _d,au as Ut,av as gM,aw as yx,ax as _h,ay as kh,az as Fh,aA as Hh,aB as q1,aC as Y1,aD as Vh,aE as Wh,aF as Uh,aG as Gh,aH as vM,aI as qh,aJ as xx,aK as n5,aL as r5,aM as o5,aN as Yh,aO as s5,aP as If,aQ as a5,aR as bx,aS as Sg,aT as Nl,aU as i5,aV as yM,aW as l5,aX as wx,aY as xM,aZ as bM,a_ as wM,a$ as Tc,b0 as Fl,b1 as hc,b2 as c5,b3 as u5,b4 as SM,b5 as CM,b6 as _M,b7 as Cg,b8 as kM,b9 as PM,ba as d5,bb as zn,bc as Sx,bd as oS,be as jM,bf as po,bg as IM,bh as us,bi as sS,bj as EM,bk as aS,bl as OM,bm as Kh,bn as TM,bo as RM,bp as MM,bq as f5,br as _g,bs as jr,bt as K1,bu as DM,bv as AM,bw as NM,bx as zM,by as Cx,bz as $M,bA as LM,bB as iS,bC as lS,bD as cS,bE as uS,bF as BM,bG as FM,bH as p5,bI as h5,bJ as HM,bK as m5,bL as Hd,bM as g5,bN as VM,bO as WM,bP as UM,bQ as co,bR as v5,bS as GM,bT as dS,bU as y5,bV as _x,bW as qM,bX as YM,bY as KM,bZ as qc,b_ as fS,b$ as XM,c0 as x5,c1 as b5,c2 as ZM,c3 as pS,c4 as QM,c5 as JM,c6 as e7,c7 as t7,c8 as n7,c9 as r7,ca as o7,cb as s7,cc as a7,cd as i7,ce as l7,cf as c7,cg as $o,ch as kx,ci as Px,cj as jx,ck as u7,cl as Ix,cm as d7,cn as f7,co as hS,cp as p7,cq as mS,cr as gS,cs as h7,ct as vS,cu as yS,cv as m7,cw as xS,cx as g7,cy as v7,cz as y7,cA as x7,cB as kg,cC as bS,cD as Ef,cE as b7,cF as w7,cG as S7,cH as w5,cI as C7,cJ as _7,cK as k7,cL as P7,cM as S5,cN as wS,cO as j7,cP as Fs,cQ as I7,cR as SS,cS as CS,cT as E7,cU as O7,cV as T7,cW as C5,cX as R7,cY as M7,cZ as D7,c_ as A7,c$ as N7,d0 as z7,d1 as _S,d2 as Ph,d3 as $7,d4 as xn,d5 as Xh,d6 as _5,d7 as Zh,d8 as L7,d9 as B7,da as Ba,db as k5,dc as Ex,dd as Of,de as F7,df as H7,dg as V7,dh as hi,di as P5,dj as W7,dk as U7,dl as j5,dm as G7,dn as q7,dp as Y7,dq as K7,dr as X7,ds as Z7,dt as Q7,du as J7,dv as e9,dw as t9,dx as n9,dy as kS,dz as r9,dA as o9,dB as s9,dC as a9,dD as i9,dE as l9,dF as z0,dG as Vd,dH as PS,dI as $0,dJ as L0,dK as Np,dL as jS,dM as X1,dN as c9,dO as u9,dP as d9,dQ as f9,dR as p9,dS as Qh,dT as I5,dU as E5,dV as h9,dW as m9,dX as O5,dY as T5,dZ as R5,d_ as M5,d$ as D5,e0 as A5,e1 as N5,e2 as z5,e3 as eu,e4 as tu,e5 as $5,e6 as L5,e7 as g9,e8 as B5,e9 as F5,ea as H5,eb as V5,ec as W5,ed as U5,ee as G5,ef as v9,eg as IS,eh as y9,ei as x9,ej as Jh,ek as ES,el as OS,em as TS,en as RS,eo as q5,ep as b9,eq as MS,er as Y5,es as Ox,et as el,eu as K5,ev as DS,ew as w9,ex as S9,ey as C9,ez as _9,eA as k9,eB as B0,eC as P9,eD as j9,eE as I9,eF as E9,eG as O9,eH as T9,eI as R9,eJ as M9,eK as D9,eL as A9,eM as N9,eN as z9,eO as AS,eP as $9,eQ as L9,eR as B9,eS as F9,eT as H9,eU as V9,eV as W9}from"./index-4dfaefdd.js";import{u as Ce,a as X5,b as _i,c as U9,r as qe,f as G9,g as NS,d as Kt,e as qr}from"./MantineProvider-7d837f42.js";function q9(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 zS=1/0,Y9=17976931348623157e292;function F0(e){if(!e)return e===0?e:0;if(e=U1(e),e===zS||e===-zS){var t=e<0?-1:1;return t*Y9}return e===e?e:0}var K9=4;function $S(e){return HR(e,K9)}var X9=function(){return VR.Date.now()};const H0=X9;var Z9="Expected a function",Q9=Math.max,J9=Math.min;function eD(e,t,n){var r,o,s,a,l,u,f=0,p=!1,m=!1,v=!0;if(typeof e!="function")throw new TypeError(Z9);t=U1(t)||0,WR(n)&&(p=!!n.leading,m="maxWait"in n,s=m?Q9(U1(n.maxWait)||0,t):s,v="trailing"in n?!!n.trailing:v);function y(E){var T=r,R=o;return r=o=void 0,f=E,a=e.apply(R,T),a}function S(E){return f=E,l=setTimeout(_,t),p?y(E):a}function x(E){var T=E-u,R=E-f,M=t-T;return m?J9(M,s-R):M}function w(E){var T=E-u,R=E-f;return u===void 0||T>=t||T<0||m&&R>=s}function _(){var E=H0();if(w(E))return k(E);l=setTimeout(_,x(E))}function k(E){return l=void 0,v&&r?y(E):(r=o=void 0,a)}function P(){l!==void 0&&clearTimeout(l),f=0,r=u=o=l=void 0}function I(){return l===void 0?a:k(H0())}function j(){var E=H0(),T=w(E);if(r=arguments,o=this,u=E,T){if(l===void 0)return S(u);if(m)return clearTimeout(l),l=setTimeout(_,t),y(u)}return l===void 0&&(l=setTimeout(_,t)),a}return j.cancel=P,j.flush=I,j}function tD(e,t){var n=-1,r=UR(e)?Array(e.length):[];return GR(e,function(o,s,a){r[++n]=t(o,s,a)}),r}function qa(e,t){var n=q3(e)?Y3:tD;return n(e,K3(t))}var nD="[object Number]";function Rc(e){return typeof e=="number"||qR(e)&&YR(e)==nD}var rD=Array.prototype,oD=rD.splice;function sD(e,t){for(var n=e?t.length:0,r=n-1;n--;){var o=t[n];if(n==r||o!==s){var s=o;KR(o)?oD.call(e,o,1):XR(e,o)}}return e}var aD=Math.ceil,iD=Math.max;function lD(e,t,n,r){for(var o=-1,s=iD(aD((t-e)/(n||1)),0),a=Array(s);s--;)a[r?s:++o]=e,e+=n;return a}function cD(e){return function(t,n,r){return r&&typeof r!="number"&&ZR(t,n,r)&&(n=r=void 0),t=F0(t),n===void 0?(n=t,t=0):n=F0(n),r=r===void 0?t<n?1:-1:F0(r),lD(t,n,r,e)}}var uD=cD();const LS=uD;function dD(e,t){var n=[];if(!(e&&e.length))return n;var r=-1,o=[],s=e.length;for(t=K3(t);++r<s;){var a=e[r];t(a,r,e)&&(n.push(a),o.push(r))}return sD(e,o),n}function Z5(e){return q3(e)?Y3(e,QR):JR(e)?[e]:eM(tM(nM(e)))}const Q5=1/60*1e3,fD=typeof performance<"u"?()=>performance.now():()=>Date.now(),J5=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(fD()),Q5);function pD(e){let t=[],n=[],r=0,o=!1,s=!1;const a=new WeakSet,l={schedule:(u,f=!1,p=!1)=>{const m=p&&o,v=m?t:n;return f&&a.add(u),v.indexOf(u)===-1&&(v.push(u),m&&o&&(r=t.length)),u},cancel:u=>{const f=n.indexOf(u);f!==-1&&n.splice(f,1),a.delete(u)},process:u=>{if(o){s=!0;return}if(o=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let f=0;f<r;f++){const p=t[f];p(u),a.has(p)&&(l.schedule(p),e())}o=!1,s&&(s=!1,l.process(u))}};return l}const hD=40;let Z1=!0,Wd=!1,Q1=!1;const nu={delta:0,timestamp:0},Tf=["read","update","preRender","render","postRender"],Pg=Tf.reduce((e,t)=>(e[t]=pD(()=>Wd=!0),e),{}),mD=Tf.reduce((e,t)=>{const n=Pg[t];return e[t]=(r,o=!1,s=!1)=>(Wd||yD(),n.schedule(r,o,s)),e},{}),gD=Tf.reduce((e,t)=>(e[t]=Pg[t].cancel,e),{});Tf.reduce((e,t)=>(e[t]=()=>Pg[t].process(nu),e),{});const vD=e=>Pg[e].process(nu),eP=e=>{Wd=!1,nu.delta=Z1?Q5:Math.max(Math.min(e-nu.timestamp,hD),1),nu.timestamp=e,Q1=!0,Tf.forEach(vD),Q1=!1,Wd&&(Z1=!1,J5(eP))},yD=()=>{Wd=!0,Z1=!0,Q1||J5(eP)},BS=()=>nu;function tP(e){const t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function Nu(e){const{viewBox:t="0 0 24 24",d:n,displayName:r,defaultProps:o={}}=e,s=h.Children.toArray(e.path),a=Be((l,u)=>i.jsx(uo,{ref:u,viewBox:t,...o,...l,children:s.length?s:i.jsx("path",{fill:"currentColor",d:n})}));return a.displayName=r,a}var xD=Object.defineProperty,bD=(e,t,n)=>t in e?xD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zr=(e,t,n)=>(bD(e,typeof t!="symbol"?t+"":t,n),n);function FS(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 wD=e=>typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE;function HS(e,t,n){let r=e+1;return n&&r>=t&&(r=0),r}function VS(e,t,n){let r=e-1;return n&&r<0&&(r=t),r}var J1=typeof window<"u"?h.useLayoutEffect:h.useEffect,em=e=>e,SD=class{constructor(){zr(this,"descendants",new Map),zr(this,"register",e=>{if(e!=null)return wD(e)?this.registerNode(e):t=>{this.registerNode(t,e)}}),zr(this,"unregister",e=>{this.descendants.delete(e);const t=FS(Array.from(this.descendants.keys()));this.assignIndex(t)}),zr(this,"destroy",()=>{this.descendants.clear()}),zr(this,"assignIndex",e=>{this.descendants.forEach(t=>{const n=e.indexOf(t.node);t.index=n,t.node.dataset.index=t.index.toString()})}),zr(this,"count",()=>this.descendants.size),zr(this,"enabledCount",()=>this.enabledValues().length),zr(this,"values",()=>Array.from(this.descendants.values()).sort((t,n)=>t.index-n.index)),zr(this,"enabledValues",()=>this.values().filter(e=>!e.disabled)),zr(this,"item",e=>{if(this.count()!==0)return this.values()[e]}),zr(this,"enabledItem",e=>{if(this.enabledCount()!==0)return this.enabledValues()[e]}),zr(this,"first",()=>this.item(0)),zr(this,"firstEnabled",()=>this.enabledItem(0)),zr(this,"last",()=>this.item(this.descendants.size-1)),zr(this,"lastEnabled",()=>{const e=this.enabledValues().length-1;return this.enabledItem(e)}),zr(this,"indexOf",e=>{var t,n;return e&&(n=(t=this.descendants.get(e))==null?void 0:t.index)!=null?n:-1}),zr(this,"enabledIndexOf",e=>e==null?-1:this.enabledValues().findIndex(t=>t.node.isSameNode(e))),zr(this,"next",(e,t=!0)=>{const n=HS(e,this.count(),t);return this.item(n)}),zr(this,"nextEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),o=HS(r,this.enabledCount(),t);return this.enabledItem(o)}),zr(this,"prev",(e,t=!0)=>{const n=VS(e,this.count()-1,t);return this.item(n)}),zr(this,"prevEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),o=VS(r,this.enabledCount()-1,t);return this.enabledItem(o)}),zr(this,"registerNode",(e,t)=>{if(!e||this.descendants.has(e))return;const n=Array.from(this.descendants.keys()).concat(e),r=FS(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 CD(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 yn(...e){return t=>{e.forEach(n=>{CD(n,t)})}}function _D(...e){return h.useMemo(()=>yn(...e),e)}function kD(){const e=h.useRef(new SD);return J1(()=>()=>e.current.destroy()),e.current}var[PD,nP]=Yn({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});function jD(e){const t=nP(),[n,r]=h.useState(-1),o=h.useRef(null);J1(()=>()=>{o.current&&t.unregister(o.current)},[]),J1(()=>{if(!o.current)return;const a=Number(o.current.dataset.index);n!=a&&!Number.isNaN(a)&&r(a)});const s=em(e?t.register(e):t.register);return{descendants:t,index:n,enabledIndex:t.enabledIndexOf(o.current),register:yn(s,o)}}function Tx(){return[em(PD),()=>em(nP()),()=>kD(),o=>jD(o)]}var[ID,jg]=Yn({name:"AccordionStylesContext",hookName:"useAccordionStyles",providerName:"<Accordion />"}),[ED,Rx]=Yn({name:"AccordionItemContext",hookName:"useAccordionItemContext",providerName:"<AccordionItem />"}),[OD,Qfe,TD,RD]=Tx(),kd=Be(function(t,n){const{getButtonProps:r}=Rx(),o=r(t,n),a={display:"flex",alignItems:"center",width:"100%",outline:0,...jg().button};return i.jsx(Oe.button,{...o,className:Ot("chakra-accordion__button",t.className),__css:a})});kd.displayName="AccordionButton";function zu(e){const{value:t,defaultValue:n,onChange:r,shouldUpdate:o=(v,y)=>v!==y}=e,s=_r(r),a=_r(o),[l,u]=h.useState(n),f=t!==void 0,p=f?t:l,m=_r(v=>{const S=typeof v=="function"?v(p):v;a(p,S)&&(f||u(S),s(S))},[f,s,p,a]);return[p,m]}function MD(e){const{onChange:t,defaultIndex:n,index:r,allowMultiple:o,allowToggle:s,...a}=e;ND(e),zD(e);const l=TD(),[u,f]=h.useState(-1);h.useEffect(()=>()=>{f(-1)},[]);const[p,m]=zu({value:r,defaultValue(){return o?n??[]:n??-1},onChange:t});return{index:p,setIndex:m,htmlProps:a,getAccordionItemProps:y=>{let S=!1;return y!==null&&(S=Array.isArray(p)?p.includes(y):p===y),{isOpen:S,onChange:w=>{if(y!==null)if(o&&Array.isArray(p)){const _=w?p.concat(y):p.filter(k=>k!==y);m(_)}else w?m(y):s&&m(-1)}}},focusedIndex:u,setFocusedIndex:f,descendants:l}}var[DD,Mx]=Yn({name:"AccordionContext",hookName:"useAccordionContext",providerName:"Accordion"});function AD(e){const{isDisabled:t,isFocusable:n,id:r,...o}=e,{getAccordionItemProps:s,setFocusedIndex:a}=Mx(),l=h.useRef(null),u=h.useId(),f=r??u,p=`accordion-button-${f}`,m=`accordion-panel-${f}`;$D(e);const{register:v,index:y,descendants:S}=RD({disabled:t&&!n}),{isOpen:x,onChange:w}=s(y===-1?null:y);LD({isOpen:x,isDisabled:t});const _=()=>{w==null||w(!0)},k=()=>{w==null||w(!1)},P=h.useCallback(()=>{w==null||w(!x),a(y)},[y,a,x,w]),I=h.useCallback(R=>{const D={ArrowDown:()=>{const N=S.nextEnabled(y);N==null||N.node.focus()},ArrowUp:()=>{const N=S.prevEnabled(y);N==null||N.node.focus()},Home:()=>{const N=S.firstEnabled();N==null||N.node.focus()},End:()=>{const N=S.lastEnabled();N==null||N.node.focus()}}[R.key];D&&(R.preventDefault(),D(R))},[S,y]),j=h.useCallback(()=>{a(y)},[a,y]),E=h.useCallback(function(M={},D=null){return{...M,type:"button",ref:yn(v,l,D),id:p,disabled:!!t,"aria-expanded":!!x,"aria-controls":m,onClick:at(M.onClick,P),onFocus:at(M.onFocus,j),onKeyDown:at(M.onKeyDown,I)}},[p,t,x,P,j,I,m,v]),T=h.useCallback(function(M={},D=null){return{...M,ref:D,role:"region",id:m,"aria-labelledby":p,hidden:!x}},[p,x,m]);return{isOpen:x,isDisabled:t,isFocusable:n,onOpen:_,onClose:k,getButtonProps:E,getPanelProps:T,htmlProps:o}}function ND(e){const t=e.index||e.defaultIndex,n=t!=null&&!Array.isArray(t)&&e.allowMultiple;_f({condition:!!n,message:`If 'allowMultiple' is passed, then 'index' or 'defaultIndex' must be an array. You passed: ${typeof t},`})}function zD(e){_f({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 $D(e){_f({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 LD(e){_f({condition:e.isOpen&&!!e.isDisabled,message:"Cannot open a disabled accordion item"})}function Pd(e){const{isOpen:t,isDisabled:n}=Rx(),{reduceMotion:r}=Mx(),o=Ot("chakra-accordion__icon",e.className),s=jg(),a={opacity:n?.4:1,transform:t?"rotate(-180deg)":void 0,transition:r?void 0:"transform 0.2s",transformOrigin:"center",...s.icon};return i.jsx(uo,{viewBox:"0 0 24 24","aria-hidden":!0,className:o,__css:a,...e,children:i.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})})}Pd.displayName="AccordionIcon";var jd=Be(function(t,n){const{children:r,className:o}=t,{htmlProps:s,...a}=AD(t),u={...jg().container,overflowAnchor:"none"},f=h.useMemo(()=>a,[a]);return i.jsx(ED,{value:f,children:i.jsx(Oe.div,{ref:n,...s,className:Ot("chakra-accordion__item",o),__css:u,children:typeof r=="function"?r({isExpanded:!!a.isOpen,isDisabled:!!a.isDisabled}):r})})});jd.displayName="AccordionItem";var zl={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},dd={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 ey(e){var t;switch((t=e==null?void 0:e.direction)!=null?t:"right"){case"right":return dd.slideRight;case"left":return dd.slideLeft;case"bottom":return dd.slideDown;case"top":return dd.slideUp;default:return dd.slideRight}}var Hl={enter:{duration:.2,ease:zl.easeOut},exit:{duration:.1,ease:zl.easeIn}},sa={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})},BD=e=>e!=null&&parseInt(e.toString(),10)>0,WS={exit:{height:{duration:.2,ease:zl.ease},opacity:{duration:.3,ease:zl.ease}},enter:{height:{duration:.3,ease:zl.ease},opacity:{duration:.4,ease:zl.ease}}},FD={exit:({animateOpacity:e,startingHeight:t,transition:n,transitionEnd:r,delay:o})=>{var s;return{...e&&{opacity:BD(t)?1:0},height:t,transitionEnd:r==null?void 0:r.exit,transition:(s=n==null?void 0:n.exit)!=null?s:sa.exit(WS.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:sa.enter(WS.enter,o)}}},Ig=h.forwardRef((e,t)=>{const{in:n,unmountOnExit:r,animateOpacity:o=!0,startingHeight:s=0,endingHeight:a="auto",style:l,className:u,transition:f,transitionEnd:p,...m}=e,[v,y]=h.useState(!1);h.useEffect(()=>{const k=setTimeout(()=>{y(!0)});return()=>clearTimeout(k)},[]),_f({condition:Number(s)>0&&!!r,message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const S=parseFloat(s.toString())>0,x={startingHeight:s,endingHeight:a,animateOpacity:o,transition:v?f:{enter:{duration:0}},transitionEnd:{enter:p==null?void 0:p.enter,exit:r?p==null?void 0:p.exit:{...p==null?void 0:p.exit,display:S?"block":"none"}}},w=r?n:!0,_=n||r?"enter":"exit";return i.jsx(Co,{initial:!1,custom:x,children:w&&i.jsx(zo.div,{ref:t,...m,className:Ot("chakra-collapse",u),style:{overflow:"hidden",display:"block",...l},custom:x,variants:FD,initial:r?"exit":!1,animate:_,exit:"exit"})})});Ig.displayName="Collapse";var HD={enter:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:1,transition:(r=e==null?void 0:e.enter)!=null?r:sa.enter(Hl.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:sa.exit(Hl.exit,n),transitionEnd:t==null?void 0:t.exit}}},rP={initial:"exit",animate:"enter",exit:"exit",variants:HD},VD=h.forwardRef(function(t,n){const{unmountOnExit:r,in:o,className:s,transition:a,transitionEnd:l,delay:u,...f}=t,p=o||r?"enter":"exit",m=r?o&&r:!0,v={transition:a,transitionEnd:l,delay:u};return i.jsx(Co,{custom:v,children:m&&i.jsx(zo.div,{ref:n,className:Ot("chakra-fade",s),custom:v,...rP,animate:p,...f})})});VD.displayName="Fade";var WD={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:sa.exit(Hl.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:sa.enter(Hl.enter,n),transitionEnd:e==null?void 0:e.enter}}},oP={initial:"exit",animate:"enter",exit:"exit",variants:WD},UD=h.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:s=!0,initialScale:a=.95,className:l,transition:u,transitionEnd:f,delay:p,...m}=t,v=r?o&&r:!0,y=o||r?"enter":"exit",S={initialScale:a,reverse:s,transition:u,transitionEnd:f,delay:p};return i.jsx(Co,{custom:S,children:v&&i.jsx(zo.div,{ref:n,className:Ot("chakra-offset-slide",l),...oP,animate:y,custom:S,...m})})});UD.displayName="ScaleFade";var GD={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:sa.exit(Hl.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:sa.enter(Hl.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({offsetY:e,offsetX:t,transition:n,transitionEnd:r,reverse:o,delay:s})=>{var a;const l={x:t,y:e};return{opacity:0,transition:(a=n==null?void 0:n.exit)!=null?a:sa.exit(Hl.exit,s),...o?{...l,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{...l,...r==null?void 0:r.exit}}}}},ty={initial:"initial",animate:"enter",exit:"exit",variants:GD},qD=h.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:s=!0,className:a,offsetX:l=0,offsetY:u=8,transition:f,transitionEnd:p,delay:m,...v}=t,y=r?o&&r:!0,S=o||r?"enter":"exit",x={offsetX:l,offsetY:u,reverse:s,transition:f,transitionEnd:p,delay:m};return i.jsx(Co,{custom:x,children:y&&i.jsx(zo.div,{ref:n,className:Ot("chakra-offset-slide",a),custom:x,...ty,animate:S,...v})})});qD.displayName="SlideFade";var US={exit:{duration:.15,ease:zl.easeInOut},enter:{type:"spring",damping:25,stiffness:180}},YD={exit:({direction:e,transition:t,transitionEnd:n,delay:r})=>{var o;const{exit:s}=ey({direction:e});return{...s,transition:(o=t==null?void 0:t.exit)!=null?o:sa.exit(US.exit,r),transitionEnd:n==null?void 0:n.exit}},enter:({direction:e,transitionEnd:t,transition:n,delay:r})=>{var o;const{enter:s}=ey({direction:e});return{...s,transition:(o=n==null?void 0:n.enter)!=null?o:sa.enter(US.enter,r),transitionEnd:t==null?void 0:t.enter}}},sP=h.forwardRef(function(t,n){const{direction:r="right",style:o,unmountOnExit:s,in:a,className:l,transition:u,transitionEnd:f,delay:p,motionProps:m,...v}=t,y=ey({direction:r}),S=Object.assign({position:"fixed"},y.position,o),x=s?a&&s:!0,w=a||s?"enter":"exit",_={transitionEnd:f,transition:u,direction:r,delay:p};return i.jsx(Co,{custom:_,children:x&&i.jsx(zo.div,{...v,ref:n,initial:"exit",className:Ot("chakra-slide",l),animate:w,exit:"exit",custom:_,variants:YD,style:S,...m})})});sP.displayName="Slide";var Id=Be(function(t,n){const{className:r,motionProps:o,...s}=t,{reduceMotion:a}=Mx(),{getPanelProps:l,isOpen:u}=Rx(),f=l(s,n),p=Ot("chakra-accordion__panel",r),m=jg();a||delete f.hidden;const v=i.jsx(Oe.div,{...f,__css:m.panel,className:p});return a?v:i.jsx(Ig,{in:u,...o,children:v})});Id.displayName="AccordionPanel";var aP=Be(function({children:t,reduceMotion:n,...r},o){const s=to("Accordion",r),a=ur(r),{htmlProps:l,descendants:u,...f}=MD(a),p=h.useMemo(()=>({...f,reduceMotion:!!n}),[f,n]);return i.jsx(OD,{value:u,children:i.jsx(DD,{value:p,children:i.jsx(ID,{value:s,children:i.jsx(Oe.div,{ref:o,...l,className:Ot("chakra-accordion",r.className),__css:s.root,children:t})})})})});aP.displayName="Accordion";function Rf(e){return h.Children.toArray(e).filter(t=>h.isValidElement(t))}var[KD,XD]=Yn({strict:!1,name:"ButtonGroupContext"}),ZD={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}}},QD={horizontal:e=>({"& > *:not(style) ~ *:not(style)":{marginStart:e}}),vertical:e=>({"& > *:not(style) ~ *:not(style)":{marginTop:e}})},Fr=Be(function(t,n){const{size:r,colorScheme:o,variant:s,className:a,spacing:l="0.5rem",isAttached:u,isDisabled:f,orientation:p="horizontal",...m}=t,v=Ot("chakra-button__group",a),y=h.useMemo(()=>({size:r,colorScheme:o,variant:s,isDisabled:f}),[r,o,s,f]);let S={display:"inline-flex",...u?ZD[p]:QD[p](l)};const x=p==="vertical";return i.jsx(KD,{value:y,children:i.jsx(Oe.div,{ref:n,role:"group",__css:S,className:v,"data-attached":u?"":void 0,"data-orientation":p,flexDir:x?"column":void 0,...m})})});Fr.displayName="ButtonGroup";function JD(e){const[t,n]=h.useState(!e);return{ref:h.useCallback(s=>{s&&n(s.tagName==="BUTTON")},[]),type:t?"button":void 0}}function ny(e){const{children:t,className:n,...r}=e,o=h.isValidElement(t)?h.cloneElement(t,{"aria-hidden":!0,focusable:!1}):t,s=Ot("chakra-button__icon",n);return i.jsx(Oe.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...r,className:s,children:o})}ny.displayName="ButtonIcon";function tm(e){const{label:t,placement:n,spacing:r="0.5rem",children:o=i.jsx(Du,{color:"currentColor",width:"1em",height:"1em"}),className:s,__css:a,...l}=e,u=Ot("chakra-button__spinner",s),f=n==="start"?"marginEnd":"marginStart",p=h.useMemo(()=>({display:"flex",alignItems:"center",position:t?"relative":"absolute",[f]:t?r:0,fontSize:"1em",lineHeight:"normal",...a}),[a,t,f,r]);return i.jsx(Oe.div,{className:u,...l,__css:p,children:o})}tm.displayName="ButtonSpinner";var $u=Be((e,t)=>{const n=XD(),r=Si("Button",{...n,...e}),{isDisabled:o=n==null?void 0:n.isDisabled,isLoading:s,isActive:a,children:l,leftIcon:u,rightIcon:f,loadingText:p,iconSpacing:m="0.5rem",type:v,spinner:y,spinnerPlacement:S="start",className:x,as:w,..._}=ur(e),k=h.useMemo(()=>{const E={...r==null?void 0:r._focus,zIndex:1};return{display:"inline-flex",appearance:"none",alignItems:"center",justifyContent:"center",userSelect:"none",position:"relative",whiteSpace:"nowrap",verticalAlign:"middle",outline:"none",...r,...!!n&&{_focus:E}}},[r,n]),{ref:P,type:I}=JD(w),j={rightIcon:f,leftIcon:u,iconSpacing:m,children:l};return i.jsxs(Oe.button,{ref:_D(t,P),as:w,type:v??I,"data-active":ln(a),"data-loading":ln(s),__css:k,className:Ot("chakra-button",x),..._,disabled:o||s,children:[s&&S==="start"&&i.jsx(tm,{className:"chakra-button__spinner--start",label:p,placement:"start",spacing:m,children:y}),s?p||i.jsx(Oe.span,{opacity:0,children:i.jsx(GS,{...j})}):i.jsx(GS,{...j}),s&&S==="end"&&i.jsx(tm,{className:"chakra-button__spinner--end",label:p,placement:"end",spacing:m,children:y})]})});$u.displayName="Button";function GS(e){const{leftIcon:t,rightIcon:n,children:r,iconSpacing:o}=e;return i.jsxs(i.Fragment,{children:[t&&i.jsx(ny,{marginEnd:o,children:t}),r,n&&i.jsx(ny,{marginStart:o,children:n})]})}var mi=Be((e,t)=>{const{icon:n,children:r,isRound:o,"aria-label":s,...a}=e,l=n||r,u=h.isValidElement(l)?h.cloneElement(l,{"aria-hidden":!0,focusable:!1}):null;return i.jsx($u,{padding:"0",borderRadius:o?"full":void 0,ref:t,"aria-label":s,...a,children:u})});mi.displayName="IconButton";var[Jfe,eA]=Yn({name:"CheckboxGroupContext",strict:!1});function tA(e){const[t,n]=h.useState(e),[r,o]=h.useState(!1);return e!==t&&(o(!0),n(e)),r}function nA(e){return i.jsx(Oe.svg,{width:"1.2em",viewBox:"0 0 12 10",style:{fill:"none",strokeWidth:2,stroke:"currentColor",strokeDasharray:16},...e,children:i.jsx("polyline",{points:"1.5 6 4.5 9 10.5 1"})})}function rA(e){return i.jsx(Oe.svg,{width:"1.2em",viewBox:"0 0 24 24",style:{stroke:"currentColor",strokeWidth:4},...e,children:i.jsx("line",{x1:"21",x2:"3",y1:"12",y2:"12"})})}function oA(e){const{isIndeterminate:t,isChecked:n,...r}=e,o=t?rA:nA;return n||t?i.jsx(Oe.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:i.jsx(o,{...r})}):null}var[sA,iP]=Yn({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "<FormControl />" `}),[aA,mc]=Yn({strict:!1,name:"FormControlContext"});function iA(e){const{id:t,isRequired:n,isInvalid:r,isDisabled:o,isReadOnly:s,...a}=e,l=h.useId(),u=t||`field-${l}`,f=`${u}-label`,p=`${u}-feedback`,m=`${u}-helptext`,[v,y]=h.useState(!1),[S,x]=h.useState(!1),[w,_]=h.useState(!1),k=h.useCallback((T={},R=null)=>({id:m,...T,ref:yn(R,M=>{M&&x(!0)})}),[m]),P=h.useCallback((T={},R=null)=>({...T,ref:R,"data-focus":ln(w),"data-disabled":ln(o),"data-invalid":ln(r),"data-readonly":ln(s),id:T.id!==void 0?T.id:f,htmlFor:T.htmlFor!==void 0?T.htmlFor:u}),[u,o,w,r,s,f]),I=h.useCallback((T={},R=null)=>({id:p,...T,ref:yn(R,M=>{M&&y(!0)}),"aria-live":"polite"}),[p]),j=h.useCallback((T={},R=null)=>({...T,...a,ref:R,role:"group"}),[a]),E=h.useCallback((T={},R=null)=>({...T,ref:R,role:"presentation","aria-hidden":!0,children:T.children||"*"}),[]);return{isRequired:!!n,isInvalid:!!r,isReadOnly:!!s,isDisabled:!!o,isFocused:!!w,onFocus:()=>_(!0),onBlur:()=>_(!1),hasFeedbackText:v,setHasFeedbackText:y,hasHelpText:S,setHasHelpText:x,id:u,labelId:f,feedbackId:p,helpTextId:m,htmlProps:a,getHelpTextProps:k,getErrorMessageProps:I,getRootProps:j,getLabelProps:P,getRequiredIndicatorProps:E}}var _n=Be(function(t,n){const r=to("Form",t),o=ur(t),{getRootProps:s,htmlProps:a,...l}=iA(o),u=Ot("chakra-form-control",t.className);return i.jsx(aA,{value:l,children:i.jsx(sA,{value:r,children:i.jsx(Oe.div,{...s({},n),className:u,__css:r.container})})})});_n.displayName="FormControl";var To=Be(function(t,n){const r=mc(),o=iP(),s=Ot("chakra-form__helper-text",t.className);return i.jsx(Oe.div,{...r==null?void 0:r.getHelpTextProps(t,n),__css:o.helperText,className:s})});To.displayName="FormHelperText";var[lA,cA]=Yn({name:"FormErrorStylesContext",errorMessage:`useFormErrorStyles returned is 'undefined'. Seems you forgot to wrap the components in "<FormError />" `}),Ro=Be((e,t)=>{const n=to("FormError",e),r=ur(e),o=mc();return o!=null&&o.isInvalid?i.jsx(lA,{value:n,children:i.jsx(Oe.div,{...o==null?void 0:o.getErrorMessageProps(r,t),className:Ot("chakra-form__error-message",e.className),__css:{display:"flex",alignItems:"center",...n.text}})}):null});Ro.displayName="FormErrorMessage";var uA=Be((e,t)=>{const n=cA(),r=mc();if(!(r!=null&&r.isInvalid))return null;const o=Ot("chakra-form__error-icon",e.className);return i.jsx(uo,{ref:t,"aria-hidden":!0,...e,__css:n.icon,className:o,children:i.jsx("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"})})});uA.displayName="FormErrorIcon";var jn=Be(function(t,n){var r;const o=Si("FormLabel",t),s=ur(t),{className:a,children:l,requiredIndicator:u=i.jsx(lP,{}),optionalIndicator:f=null,...p}=s,m=mc(),v=(r=m==null?void 0:m.getLabelProps(p,n))!=null?r:{ref:n,...p};return i.jsxs(Oe.label,{...v,className:Ot("chakra-form__label",s.className),__css:{display:"block",textAlign:"start",...o},children:[l,m!=null&&m.isRequired?u:f]})});jn.displayName="FormLabel";var lP=Be(function(t,n){const r=mc(),o=iP();if(!(r!=null&&r.isRequired))return null;const s=Ot("chakra-form__required-indicator",t.className);return i.jsx(Oe.span,{...r==null?void 0:r.getRequiredIndicatorProps(t,n),__css:o.requiredIndicator,className:s})});lP.displayName="RequiredIndicator";function Dx(e){const{isDisabled:t,isInvalid:n,isReadOnly:r,isRequired:o,...s}=Ax(e);return{...s,disabled:t,readOnly:r,required:o,"aria-invalid":Ds(n),"aria-required":Ds(o),"aria-readonly":Ds(r)}}function Ax(e){var t,n,r;const o=mc(),{id:s,disabled:a,readOnly:l,required:u,isRequired:f,isInvalid:p,isReadOnly:m,isDisabled:v,onFocus:y,onBlur:S,...x}=e,w=e["aria-describedby"]?[e["aria-describedby"]]:[];return o!=null&&o.hasFeedbackText&&(o!=null&&o.isInvalid)&&w.push(o.feedbackId),o!=null&&o.hasHelpText&&w.push(o.helpTextId),{...x,"aria-describedby":w.join(" ")||void 0,id:s??(o==null?void 0:o.id),isDisabled:(t=a??v)!=null?t:o==null?void 0:o.isDisabled,isReadOnly:(n=l??m)!=null?n:o==null?void 0:o.isReadOnly,isRequired:(r=u??f)!=null?r:o==null?void 0:o.isRequired,isInvalid:p??(o==null?void 0:o.isInvalid),onFocus:at(o==null?void 0:o.onFocus,y),onBlur:at(o==null?void 0:o.onBlur,S)}}var Nx={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},cP=Oe("span",{baseStyle:Nx});cP.displayName="VisuallyHidden";var dA=Oe("input",{baseStyle:Nx});dA.displayName="VisuallyHiddenInput";var qS=!1,Mf=null,Ql=!1,ry=!1,oy=new Set;function zx(e,t){oy.forEach(n=>n(e,t))}var fA=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function pA(e){return!(e.metaKey||!fA&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function YS(e){Ql=!0,pA(e)&&(Mf="keyboard",zx("keyboard",e))}function Mc(e){if(Mf="pointer",e.type==="mousedown"||e.type==="pointerdown"){Ql=!0;const t=e.composedPath?e.composedPath()[0]:e.target;let n=!1;try{n=t.matches(":focus-visible")}catch{}if(n)return;zx("pointer",e)}}function hA(e){return e.mozInputSource===0&&e.isTrusted?!0:e.detail===0&&!e.pointerType}function mA(e){hA(e)&&(Ql=!0,Mf="virtual")}function gA(e){e.target===window||e.target===document||(!Ql&&!ry&&(Mf="virtual",zx("virtual",e)),Ql=!1,ry=!1)}function vA(){Ql=!1,ry=!0}function KS(){return Mf!=="pointer"}function yA(){if(typeof window>"u"||qS)return;const{focus:e}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...n){Ql=!0,e.apply(this,n)},document.addEventListener("keydown",YS,!0),document.addEventListener("keyup",YS,!0),document.addEventListener("click",mA,!0),window.addEventListener("focus",gA,!0),window.addEventListener("blur",vA,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",Mc,!0),document.addEventListener("pointermove",Mc,!0),document.addEventListener("pointerup",Mc,!0)):(document.addEventListener("mousedown",Mc,!0),document.addEventListener("mousemove",Mc,!0),document.addEventListener("mouseup",Mc,!0)),qS=!0}function uP(e){yA(),e(KS());const t=()=>e(KS());return oy.add(t),()=>{oy.delete(t)}}function xA(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function dP(e={}){const t=Ax(e),{isDisabled:n,isReadOnly:r,isRequired:o,isInvalid:s,id:a,onBlur:l,onFocus:u,"aria-describedby":f}=t,{defaultChecked:p,isChecked:m,isFocusable:v,onChange:y,isIndeterminate:S,name:x,value:w,tabIndex:_=void 0,"aria-label":k,"aria-labelledby":P,"aria-invalid":I,...j}=e,E=xA(j,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),T=_r(y),R=_r(l),M=_r(u),[D,N]=h.useState(!1),[U,z]=h.useState(!1),[F,H]=h.useState(!1),[G,A]=h.useState(!1);h.useEffect(()=>uP(N),[]);const L=h.useRef(null),[W,V]=h.useState(!0),[ee,le]=h.useState(!!p),oe=m!==void 0,X=oe?m:ee,Q=h.useCallback(ae=>{if(r||n){ae.preventDefault();return}oe||le(X?ae.target.checked:S?!0:ae.target.checked),T==null||T(ae)},[r,n,X,oe,S,T]);Jc(()=>{L.current&&(L.current.indeterminate=!!S)},[S]),Ci(()=>{n&&z(!1)},[n,z]),Jc(()=>{const ae=L.current;ae!=null&&ae.form&&(ae.form.onreset=()=>{le(!!p)})},[]);const ie=n&&!v,ve=h.useCallback(ae=>{ae.key===" "&&A(!0)},[A]),ye=h.useCallback(ae=>{ae.key===" "&&A(!1)},[A]);Jc(()=>{if(!L.current)return;L.current.checked!==X&&le(L.current.checked)},[L.current]);const se=h.useCallback((ae={},Pe=null)=>{const tt=ze=>{U&&ze.preventDefault(),A(!0)};return{...ae,ref:Pe,"data-active":ln(G),"data-hover":ln(F),"data-checked":ln(X),"data-focus":ln(U),"data-focus-visible":ln(U&&D),"data-indeterminate":ln(S),"data-disabled":ln(n),"data-invalid":ln(s),"data-readonly":ln(r),"aria-hidden":!0,onMouseDown:at(ae.onMouseDown,tt),onMouseUp:at(ae.onMouseUp,()=>A(!1)),onMouseEnter:at(ae.onMouseEnter,()=>H(!0)),onMouseLeave:at(ae.onMouseLeave,()=>H(!1))}},[G,X,n,U,D,F,S,s,r]),de=h.useCallback((ae={},Pe=null)=>({...E,...ae,ref:yn(Pe,tt=>{tt&&V(tt.tagName==="LABEL")}),onClick:at(ae.onClick,()=>{var tt;W||((tt=L.current)==null||tt.click(),requestAnimationFrame(()=>{var ze;(ze=L.current)==null||ze.focus({preventScroll:!0})}))}),"data-disabled":ln(n),"data-checked":ln(X),"data-invalid":ln(s)}),[E,n,X,s,W]),fe=h.useCallback((ae={},Pe=null)=>({...ae,ref:yn(L,Pe),type:"checkbox",name:x,value:w,id:a,tabIndex:_,onChange:at(ae.onChange,Q),onBlur:at(ae.onBlur,R,()=>z(!1)),onFocus:at(ae.onFocus,M,()=>z(!0)),onKeyDown:at(ae.onKeyDown,ve),onKeyUp:at(ae.onKeyUp,ye),required:o,checked:X,disabled:ie,readOnly:r,"aria-label":k,"aria-labelledby":P,"aria-invalid":I?!!I:s,"aria-describedby":f,"aria-disabled":n,style:Nx}),[x,w,a,Q,R,M,ve,ye,o,X,ie,r,k,P,I,s,f,n,_]),xe=h.useCallback((ae={},Pe=null)=>({...ae,ref:Pe,onMouseDown:at(ae.onMouseDown,bA),"data-disabled":ln(n),"data-checked":ln(X),"data-invalid":ln(s)}),[X,n,s]);return{state:{isInvalid:s,isFocused:U,isChecked:X,isActive:G,isHovered:F,isIndeterminate:S,isDisabled:n,isReadOnly:r,isRequired:o},getRootProps:de,getCheckboxProps:se,getInputProps:fe,getLabelProps:xe,htmlProps:E}}function bA(e){e.preventDefault(),e.stopPropagation()}var wA={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},SA={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},CA=pc({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),_A=pc({from:{opacity:0},to:{opacity:1}}),kA=pc({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),fP=Be(function(t,n){const r=eA(),o={...r,...t},s=to("Checkbox",o),a=ur(t),{spacing:l="0.5rem",className:u,children:f,iconColor:p,iconSize:m,icon:v=i.jsx(oA,{}),isChecked:y,isDisabled:S=r==null?void 0:r.isDisabled,onChange:x,inputProps:w,..._}=a;let k=y;r!=null&&r.value&&a.value&&(k=r.value.includes(a.value));let P=x;r!=null&&r.onChange&&a.value&&(P=bg(r.onChange,x));const{state:I,getInputProps:j,getCheckboxProps:E,getLabelProps:T,getRootProps:R}=dP({..._,isDisabled:S,isChecked:k,onChange:P}),M=tA(I.isChecked),D=h.useMemo(()=>({animation:M?I.isIndeterminate?`${_A} 20ms linear, ${kA} 200ms linear`:`${CA} 200ms linear`:void 0,fontSize:m,color:p,...s.icon}),[p,m,M,I.isIndeterminate,s.icon]),N=h.cloneElement(v,{__css:D,isIndeterminate:I.isIndeterminate,isChecked:I.isChecked});return i.jsxs(Oe.label,{__css:{...SA,...s.container},className:Ot("chakra-checkbox",u),...R(),children:[i.jsx("input",{className:"chakra-checkbox__input",...j(w,n)}),i.jsx(Oe.span,{__css:{...wA,...s.control},className:"chakra-checkbox__control",...E(),children:N}),f&&i.jsx(Oe.span,{className:"chakra-checkbox__label",...T(),__css:{marginStart:l,...s.label},children:f})]})});fP.displayName="Checkbox";function PA(e){const t=parseFloat(e);return typeof t!="number"||Number.isNaN(t)?0:t}function $x(e,t){let n=PA(e);const r=10**(t??10);return n=Math.round(n*r)/r,t?n.toFixed(t):n.toString()}function sy(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 nm(e,t,n){return(e-t)*100/(n-t)}function pP(e,t,n){return(n-t)*e+t}function ay(e,t,n){const r=Math.round((e-t)/n)*n+t,o=sy(n);return $x(r,o)}function ru(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 jA(e={}){const{onChange:t,precision:n,defaultValue:r,value:o,step:s=1,min:a=Number.MIN_SAFE_INTEGER,max:l=Number.MAX_SAFE_INTEGER,keepWithinRange:u=!0}=e,f=_r(t),[p,m]=h.useState(()=>{var D;return r==null?"":(D=V0(r,s,n))!=null?D:""}),v=typeof o<"u",y=v?o:p,S=hP(Bi(y),s),x=n??S,w=h.useCallback(D=>{D!==y&&(v||m(D.toString()),f==null||f(D.toString(),Bi(D)))},[f,v,y]),_=h.useCallback(D=>{let N=D;return u&&(N=ru(N,a,l)),$x(N,x)},[x,u,l,a]),k=h.useCallback((D=s)=>{let N;y===""?N=Bi(D):N=Bi(y)+D,N=_(N),w(N)},[_,s,w,y]),P=h.useCallback((D=s)=>{let N;y===""?N=Bi(-D):N=Bi(y)-D,N=_(N),w(N)},[_,s,w,y]),I=h.useCallback(()=>{var D;let N;r==null?N="":N=(D=V0(r,s,n))!=null?D:a,w(N)},[r,n,s,w,a]),j=h.useCallback(D=>{var N;const U=(N=V0(D,s,x))!=null?N:a;w(U)},[x,s,w,a]),E=Bi(y);return{isOutOfRange:E>l||E<a,isAtMax:E===l,isAtMin:E===a,precision:x,value:y,valueAsNumber:E,update:w,reset:I,increment:k,decrement:P,clamp:_,cast:j,setValue:m}}function Bi(e){return parseFloat(e.toString().replace(/[^\w.-]+/g,""))}function hP(e,t){return Math.max(sy(t),sy(e))}function V0(e,t,n){const r=Bi(e);if(Number.isNaN(r))return;const o=hP(r,t);return $x(r,n??o)}var[IA,mP]=Yn({name:"EditableStylesContext",errorMessage:`useEditableStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Editable />" `}),[EA,gP]=Yn({name:"EditableContext",errorMessage:"useEditableContext: context is undefined. Seems you forgot to wrap the editable components in `<Editable />`"}),vP={fontSize:"inherit",fontWeight:"inherit",textAlign:"inherit",bg:"transparent"},yP=Be(function(t,n){const{getInputProps:r}=gP(),o=mP(),s=r(t,n),a=Ot("chakra-editable__input",t.className);return i.jsx(Oe.input,{...s,__css:{outline:0,...vP,...o.input},className:a})});yP.displayName="EditableInput";var xP=Be(function(t,n){const{getPreviewProps:r}=gP(),o=mP(),s=r(t,n),a=Ot("chakra-editable__preview",t.className);return i.jsx(Oe.span,{...s,__css:{cursor:"text",display:"inline-block",...vP,...o.preview},className:a})});xP.displayName="EditablePreview";function Vl(e,t,n,r){const o=_r(n);return h.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 OA(e){return"current"in e}var bP=()=>typeof window<"u";function TA(){var e;const t=navigator.userAgentData;return(e=t==null?void 0:t.platform)!=null?e:navigator.platform}var RA=e=>bP()&&e.test(navigator.vendor),MA=e=>bP()&&e.test(TA()),DA=()=>MA(/mac|iphone|ipad|ipod/i),AA=()=>DA()&&RA(/apple/i);function wP(e){const{ref:t,elements:n,enabled:r}=e,o=()=>{var s,a;return(a=(s=t.current)==null?void 0:s.ownerDocument)!=null?a:document};Vl(o,"pointerdown",s=>{if(!AA()||!r)return;const a=s.target,u=(n??[t]).some(f=>{const p=OA(f)?f.current:f;return(p==null?void 0:p.contains(a))||p===a});o().activeElement!==a&&u&&(s.preventDefault(),a.focus())})}function XS(e,t){return e?e===t||e.contains(t):!1}function NA(e={}){const{onChange:t,onCancel:n,onSubmit:r,onBlur:o,value:s,isDisabled:a,defaultValue:l,startWithEditView:u,isPreviewFocusable:f=!0,submitOnBlur:p=!0,selectAllOnFocus:m=!0,placeholder:v,onEdit:y,finalFocusRef:S,...x}=e,w=_r(y),_=!!(u&&!a),[k,P]=h.useState(_),[I,j]=zu({defaultValue:l||"",value:s,onChange:t}),[E,T]=h.useState(I),R=h.useRef(null),M=h.useRef(null),D=h.useRef(null),N=h.useRef(null),U=h.useRef(null);wP({ref:R,enabled:k,elements:[N,U]});const z=!k&&!a;Jc(()=>{var se,de;k&&((se=R.current)==null||se.focus(),m&&((de=R.current)==null||de.select()))},[]),Ci(()=>{var se,de,fe,xe;if(!k){S?(se=S.current)==null||se.focus():(de=D.current)==null||de.focus();return}(fe=R.current)==null||fe.focus(),m&&((xe=R.current)==null||xe.select()),w==null||w()},[k,w,m]);const F=h.useCallback(()=>{z&&P(!0)},[z]),H=h.useCallback(()=>{T(I)},[I]),G=h.useCallback(()=>{P(!1),j(E),n==null||n(E),o==null||o(E)},[n,o,j,E]),A=h.useCallback(()=>{P(!1),T(I),r==null||r(I),o==null||o(E)},[I,r,o,E]);h.useEffect(()=>{if(k)return;const se=R.current;(se==null?void 0:se.ownerDocument.activeElement)===se&&(se==null||se.blur())},[k]);const L=h.useCallback(se=>{j(se.currentTarget.value)},[j]),W=h.useCallback(se=>{const de=se.key,xe={Escape:G,Enter:ke=>{!ke.shiftKey&&!ke.metaKey&&A()}}[de];xe&&(se.preventDefault(),xe(se))},[G,A]),V=h.useCallback(se=>{const de=se.key,xe={Escape:G}[de];xe&&(se.preventDefault(),xe(se))},[G]),ee=I.length===0,le=h.useCallback(se=>{var de;if(!k)return;const fe=se.currentTarget.ownerDocument,xe=(de=se.relatedTarget)!=null?de:fe.activeElement,ke=XS(N.current,xe),ae=XS(U.current,xe);!ke&&!ae&&(p?A():G())},[p,A,G,k]),oe=h.useCallback((se={},de=null)=>{const fe=z&&f?0:void 0;return{...se,ref:yn(de,M),children:ee?v:I,hidden:k,"aria-disabled":Ds(a),tabIndex:fe,onFocus:at(se.onFocus,F,H)}},[a,k,z,f,ee,F,H,v,I]),X=h.useCallback((se={},de=null)=>({...se,hidden:!k,placeholder:v,ref:yn(de,R),disabled:a,"aria-disabled":Ds(a),value:I,onBlur:at(se.onBlur,le),onChange:at(se.onChange,L),onKeyDown:at(se.onKeyDown,W),onFocus:at(se.onFocus,H)}),[a,k,le,L,W,H,v,I]),Q=h.useCallback((se={},de=null)=>({...se,hidden:!k,placeholder:v,ref:yn(de,R),disabled:a,"aria-disabled":Ds(a),value:I,onBlur:at(se.onBlur,le),onChange:at(se.onChange,L),onKeyDown:at(se.onKeyDown,V),onFocus:at(se.onFocus,H)}),[a,k,le,L,V,H,v,I]),ie=h.useCallback((se={},de=null)=>({"aria-label":"Edit",...se,type:"button",onClick:at(se.onClick,F),ref:yn(de,D),disabled:a}),[F,a]),ve=h.useCallback((se={},de=null)=>({...se,"aria-label":"Submit",ref:yn(U,de),type:"button",onClick:at(se.onClick,A),disabled:a}),[A,a]),ye=h.useCallback((se={},de=null)=>({"aria-label":"Cancel",id:"cancel",...se,ref:yn(N,de),type:"button",onClick:at(se.onClick,G),disabled:a}),[G,a]);return{isEditing:k,isDisabled:a,isValueEmpty:ee,value:I,onEdit:F,onCancel:G,onSubmit:A,getPreviewProps:oe,getInputProps:X,getTextareaProps:Q,getEditButtonProps:ie,getSubmitButtonProps:ve,getCancelButtonProps:ye,htmlProps:x}}var SP=Be(function(t,n){const r=to("Editable",t),o=ur(t),{htmlProps:s,...a}=NA(o),{isEditing:l,onSubmit:u,onCancel:f,onEdit:p}=a,m=Ot("chakra-editable",t.className),v=gx(t.children,{isEditing:l,onSubmit:u,onCancel:f,onEdit:p});return i.jsx(EA,{value:a,children:i.jsx(IA,{value:r,children:i.jsx(Oe.div,{ref:n,...s,className:m,children:v})})})});SP.displayName="Editable";var CP={exports:{}},zA="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",$A=zA,LA=$A;function _P(){}function kP(){}kP.resetWarningCache=_P;var BA=function(){function e(r,o,s,a,l,u){if(u!==LA){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:kP,resetWarningCache:_P};return n.PropTypes=n,n};CP.exports=BA();var FA=CP.exports;const sr=kf(FA);var iy="data-focus-lock",PP="data-focus-lock-disabled",HA="data-no-focus-lock",VA="data-autofocus-inside",WA="data-no-autofocus";function UA(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function GA(e,t){var n=h.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 jP(e,t){return GA(t||null,function(n){return e.forEach(function(r){return UA(r,n)})})}var W0={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"},za=function(){return za=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},za.apply(this,arguments)};function IP(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 Lu(e,t,n,r){function o(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function l(p){try{f(r.next(p))}catch(m){a(m)}}function u(p){try{f(r.throw(p))}catch(m){a(m)}}function f(p){p.done?s(p.value):o(p.value).then(l,u)}f((r=r.apply(e,t||[])).next())})}function Bu(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,o,s,a;return a={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function l(f){return function(p){return u([f,p])}}function u(f){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,f[0]&&(n=0)),n;)try{if(r=1,o&&(s=f[0]&2?o.return:f[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,f[1])).done)return s;switch(o=0,s&&(f=[f[0]&2,s.value]),f[0]){case 0:case 1:s=f;break;case 4:return n.label++,{value:f[1],done:!1};case 5:n.label++,o=f[1],f=[0];continue;case 7:f=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(f[0]===6||f[0]===2)){n=0;continue}if(f[0]===3&&(!s||f[1]>s[0]&&f[1]<s[3])){n.label=f[1];break}if(f[0]===6&&n.label<s[1]){n.label=s[1],s=f;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(f);break}s[2]&&n.ops.pop(),n.trys.pop();continue}f=t.call(e,n)}catch(p){f=[6,p],o=0}finally{r=s=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function ZS(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,s=[],a;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)s.push(o.value)}catch(l){a={error:l}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return s}function ly(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 EP(e){return e}function OP(e,t){t===void 0&&(t=EP);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var a=t(s,r);return n.push(a),function(){n=n.filter(function(l){return l!==a})}},assignSyncMedium:function(s){for(r=!0;n.length;){var a=n;n=[],a.forEach(s)}n={push:function(l){return s(l)},filter:function(){return n}}},assignMedium:function(s){r=!0;var a=[];if(n.length){var l=n;n=[],l.forEach(s),a=n}var u=function(){var p=a;a=[],p.forEach(s)},f=function(){return Promise.resolve().then(u)};f(),n={push:function(p){a.push(p),f()},filter:function(p){return a=a.filter(p),n}}}};return o}function Lx(e,t){return t===void 0&&(t=EP),OP(e,t)}function TP(e){e===void 0&&(e={});var t=OP(null);return t.options=za({async:!0,ssr:!1},e),t}var RP=function(e){var t=e.sideCar,n=IP(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 h.createElement(r,za({},n))};RP.isSideCarExport=!0;function qA(e,t){return e.useMedium(t),RP}var MP=Lx({},function(e){var t=e.target,n=e.currentTarget;return{target:t,currentTarget:n}}),DP=Lx(),YA=Lx(),KA=TP({async:!0}),XA=[],Bx=h.forwardRef(function(t,n){var r,o=h.useState(),s=o[0],a=o[1],l=h.useRef(),u=h.useRef(!1),f=h.useRef(null),p=t.children,m=t.disabled,v=t.noFocusGuards,y=t.persistentFocus,S=t.crossFrame,x=t.autoFocus;t.allowTextSelection;var w=t.group,_=t.className,k=t.whiteList,P=t.hasPositiveIndices,I=t.shards,j=I===void 0?XA:I,E=t.as,T=E===void 0?"div":E,R=t.lockProps,M=R===void 0?{}:R,D=t.sideCar,N=t.returnFocus,U=t.focusOptions,z=t.onActivation,F=t.onDeactivation,H=h.useState({}),G=H[0],A=h.useCallback(function(){f.current=f.current||document&&document.activeElement,l.current&&z&&z(l.current),u.current=!0},[z]),L=h.useCallback(function(){u.current=!1,F&&F(l.current)},[F]);h.useEffect(function(){m||(f.current=null)},[]);var W=h.useCallback(function(ve){var ye=f.current;if(ye&&ye.focus){var se=typeof N=="function"?N(ye):N;if(se){var de=typeof se=="object"?se:void 0;f.current=null,ve?Promise.resolve().then(function(){return ye.focus(de)}):ye.focus(de)}}},[N]),V=h.useCallback(function(ve){u.current&&MP.useMedium(ve)},[]),ee=DP.useMedium,le=h.useCallback(function(ve){l.current!==ve&&(l.current=ve,a(ve))},[]),oe=Pr((r={},r[PP]=m&&"disabled",r[iy]=w,r),M),X=v!==!0,Q=X&&v!=="tail",ie=jP([n,le]);return h.createElement(h.Fragment,null,X&&[h.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:m?-1:0,style:W0}),P?h.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:m?-1:1,style:W0}):null],!m&&h.createElement(D,{id:G,sideCar:KA,observed:s,disabled:m,persistentFocus:y,crossFrame:S,autoFocus:x,whiteList:k,shards:j,onActivation:A,onDeactivation:L,returnFocus:W,focusOptions:U}),h.createElement(T,Pr({ref:ie},oe,{className:_,onBlur:ee,onFocus:V}),p),Q&&h.createElement("div",{"data-focus-guard":!0,tabIndex:m?-1:0,style:W0}))});Bx.propTypes={};Bx.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 AP=Bx;function cy(e,t){return cy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},cy(e,t)}function ZA(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,cy(e,t)}function QA(e,t){function n(r){return r.displayName||r.name||"Component"}return function(o){var s=[],a;function l(){a=e(s.map(function(f){return f.props})),t(a)}var u=function(f){ZA(p,f);function p(){return f.apply(this,arguments)||this}p.peek=function(){return a};var m=p.prototype;return m.componentDidMount=function(){s.push(this),l()},m.componentDidUpdate=function(){l()},m.componentWillUnmount=function(){var y=s.indexOf(this);s.splice(y,1),l()},m.render=function(){return B.createElement(o,this.props)},p}(h.PureComponent);return rM(u,"displayName","SideEffect("+n(o)+")"),u}}var Ya=function(e){for(var t=Array(e.length),n=0;n<e.length;++n)t[n]=e[n];return t},rm=function(e){return Array.isArray(e)?e:[e]},NP=function(e){return Array.isArray(e)?e[0]:e},JA=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"},zP=function(e){return e.parentNode&&e.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.parentNode.host:e.parentNode},$P=function(e){return e===document||e&&e.nodeType===Node.DOCUMENT_NODE},eN=function(e,t){return!e||$P(e)||!JA(e)&&t(zP(e))},LP=function(e,t){var n=e.get(t);if(n!==void 0)return n;var r=eN(t,LP.bind(void 0,e));return e.set(t,r),r},tN=function(e,t){return e&&!$P(e)?oN(e)?t(zP(e)):!1:!0},BP=function(e,t){var n=e.get(t);if(n!==void 0)return n;var r=tN(t,BP.bind(void 0,e));return e.set(t,r),r},FP=function(e){return e.dataset},nN=function(e){return e.tagName==="BUTTON"},HP=function(e){return e.tagName==="INPUT"},VP=function(e){return HP(e)&&e.type==="radio"},rN=function(e){return!((HP(e)||nN(e))&&(e.type==="hidden"||e.disabled))},oN=function(e){var t=e.getAttribute(WA);return![!0,"true",""].includes(t)},Fx=function(e){var t;return!!(e&&(!((t=FP(e))===null||t===void 0)&&t.focusGuard))},om=function(e){return!Fx(e)},sN=function(e){return!!e},aN=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},WP=function(e,t,n){return Ya(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(aN)},iN=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],Hx=iN.join(","),lN="".concat(Hx,", [data-focus-guard]"),UP=function(e,t){return Ya((e.shadowRoot||e).children).reduce(function(n,r){return n.concat(r.matches(t?lN:Hx)?[r]:[],UP(r))},[])},cN=function(e,t){var n;return e instanceof HTMLIFrameElement&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?Eg([e.contentDocument.body],t):[e]},Eg=function(e,t){return e.reduce(function(n,r){var o,s=UP(r,t),a=(o=[]).concat.apply(o,s.map(function(l){return cN(l,t)}));return n.concat(a,r.parentNode?Ya(r.parentNode.querySelectorAll(Hx)).filter(function(l){return l===r}):[])},[])},uN=function(e){var t=e.querySelectorAll("[".concat(VA,"]"));return Ya(t).map(function(n){return Eg([n])}).reduce(function(n,r){return n.concat(r)},[])},Vx=function(e,t){return Ya(e).filter(function(n){return LP(t,n)}).filter(function(n){return rN(n)})},QS=function(e,t){return t===void 0&&(t=new Map),Ya(e).filter(function(n){return BP(t,n)})},uy=function(e,t,n){return WP(Vx(Eg(e,n),t),!0,n)},JS=function(e,t){return WP(Vx(Eg(e),t),!1)},dN=function(e,t){return Vx(uN(e),t)},ou=function(e,t){return e.shadowRoot?ou(e.shadowRoot,t):Object.getPrototypeOf(e).contains!==void 0&&Object.getPrototypeOf(e).contains.call(e,t)?!0:Ya(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?ou(o,t):!1}return ou(n,t)})},fN=function(e){for(var t=new Set,n=e.length,r=0;r<n;r+=1)for(var o=r+1;o<n;o+=1){var s=e[r].compareDocumentPosition(e[o]);(s&Node.DOCUMENT_POSITION_CONTAINED_BY)>0&&t.add(o),(s&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter(function(a,l){return!t.has(l)})},GP=function(e){return e.parentNode?GP(e.parentNode):e},Wx=function(e){var t=rm(e);return t.filter(Boolean).reduce(function(n,r){var o=r.getAttribute(iy);return n.push.apply(n,o?fN(Ya(GP(r).querySelectorAll("[".concat(iy,'="').concat(o,'"]:not([').concat(PP,'="disabled"])')))):[r]),n},[])},pN=function(e){try{return e()}catch{return}},Ud=function(e){if(e===void 0&&(e=document),!(!e||!e.activeElement)){var t=e.activeElement;return t.shadowRoot?Ud(t.shadowRoot):t instanceof HTMLIFrameElement&&pN(function(){return t.contentWindow.document})?Ud(t.contentWindow.document):t}},hN=function(e,t){return e===t},mN=function(e,t){return!!Ya(e.querySelectorAll("iframe")).some(function(n){return hN(n,t)})},qP=function(e,t){return t===void 0&&(t=Ud(NP(e).ownerDocument)),!t||t.dataset&&t.dataset.focusGuard?!1:Wx(e).some(function(n){return ou(n,t)||mN(n,t)})},gN=function(e){e===void 0&&(e=document);var t=Ud(e);return t?Ya(e.querySelectorAll("[".concat(HA,"]"))).some(function(n){return ou(n,t)}):!1},vN=function(e,t){return t.filter(VP).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},Ux=function(e,t){return VP(e)&&e.name?vN(e,t):e},yN=function(e){var t=new Set;return e.forEach(function(n){return t.add(Ux(n,e))}),e.filter(function(n){return t.has(n)})},eC=function(e){return e[0]&&e.length>1?Ux(e[0],e):e[0]},tC=function(e,t){return e.length>1?e.indexOf(Ux(e[t],e)):t},YP="NEW_FOCUS",xN=function(e,t,n,r){var o=e.length,s=e[0],a=e[o-1],l=Fx(n);if(!(n&&e.indexOf(n)>=0)){var u=n!==void 0?t.indexOf(n):-1,f=r?t.indexOf(r):u,p=r?e.indexOf(r):-1,m=u-f,v=t.indexOf(s),y=t.indexOf(a),S=yN(t),x=n!==void 0?S.indexOf(n):-1,w=x-(r?S.indexOf(r):u),_=tC(e,0),k=tC(e,o-1);if(u===-1||p===-1)return YP;if(!m&&p>=0)return p;if(u<=v&&l&&Math.abs(m)>1)return k;if(u>=y&&l&&Math.abs(m)>1)return _;if(m&&Math.abs(w)>1)return p;if(u<=v)return k;if(u>y)return _;if(m)return Math.abs(m)>1?p:(o+p+m)%o}},bN=function(e){return function(t){var n,r=(n=FP(t))===null||n===void 0?void 0:n.autofocus;return t.autofocus||r!==void 0&&r!=="false"||e.indexOf(t)>=0}},wN=function(e,t,n){var r=e.map(function(s){var a=s.node;return a}),o=QS(r.filter(bN(n)));return o&&o.length?eC(o):eC(QS(t))},dy=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&dy(e.parentNode.host||e.parentNode,t),t},U0=function(e,t){for(var n=dy(e),r=dy(t),o=0;o<n.length;o+=1){var s=n[o];if(r.indexOf(s)>=0)return s}return!1},KP=function(e,t,n){var r=rm(e),o=rm(t),s=r[0],a=!1;return o.filter(Boolean).forEach(function(l){a=U0(a||l,l)||a,n.filter(Boolean).forEach(function(u){var f=U0(s,u);f&&(!a||ou(f,a)?a=f:a=U0(f,a))})}),a},SN=function(e,t){return e.reduce(function(n,r){return n.concat(dN(r,t))},[])},CN=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(sN)},_N=function(e,t){var n=Ud(rm(e).length>0?document:NP(e).ownerDocument),r=Wx(e).filter(om),o=KP(n||e,e,r),s=new Map,a=JS(r,s),l=uy(r,s).filter(function(y){var S=y.node;return om(S)});if(!(!l[0]&&(l=a,!l[0]))){var u=JS([o],s).map(function(y){var S=y.node;return S}),f=CN(u,l),p=f.map(function(y){var S=y.node;return S}),m=xN(p,u,n,t);if(m===YP){var v=wN(a,p,SN(r,s));if(v)return{node:v};console.warn("focus-lock: cannot find any node to move focus into");return}return m===void 0?m:f[m]}},kN=function(e){var t=Wx(e).filter(om),n=KP(e,e,t),r=new Map,o=uy([n],r,!0),s=uy(t,r).filter(function(a){var l=a.node;return om(l)}).map(function(a){var l=a.node;return l});return o.map(function(a){var l=a.node,u=a.index;return{node:l,index:u,lockItem:s.indexOf(l)>=0,guard:Fx(l)}})},PN=function(e,t){"focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus()},G0=0,q0=!1,XP=function(e,t,n){n===void 0&&(n={});var r=_N(e,t);if(!q0&&r){if(G0>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),q0=!0,setTimeout(function(){q0=!1},1);return}G0++,PN(r.node,n.focusOptions),G0--}};function ZP(e){var t=window,n=t.setImmediate;typeof n<"u"?n(e):setTimeout(e,1)}var jN=function(){return document&&document.activeElement===document.body},IN=function(){return jN()||gN()},su=null,Yc=null,au=null,Gd=!1,EN=function(){return!0},ON=function(t){return(su.whiteList||EN)(t)},TN=function(t,n){au={observerNode:t,portaledElement:n}},RN=function(t){return au&&au.portaledElement===t};function nC(e,t,n,r){var o=null,s=e;do{var a=r[s];if(a.guard)a.node.dataset.focusAutoGuard&&(o=a);else if(a.lockItem){if(s!==e)return;o=null}else break}while((s+=n)!==t);o&&(o.node.tabIndex=0)}var MN=function(t){return t&&"current"in t?t.current:t},DN=function(t){return t?!!Gd:Gd==="meanwhile"},AN=function e(t,n,r){return n&&(n.host===t&&(!n.activeElement||r.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,r))},NN=function(t,n){return n.some(function(r){return AN(t,r,r)})},sm=function(){var t=!1;if(su){var n=su,r=n.observed,o=n.persistentFocus,s=n.autoFocus,a=n.shards,l=n.crossFrame,u=n.focusOptions,f=r||au&&au.portaledElement,p=document&&document.activeElement;if(f){var m=[f].concat(a.map(MN).filter(Boolean));if((!p||ON(p))&&(o||DN(l)||!IN()||!Yc&&s)&&(f&&!(qP(m)||p&&NN(p,m)||RN(p))&&(document&&!Yc&&p&&!s?(p.blur&&p.blur(),document.body.focus()):(t=XP(m,Yc,{focusOptions:u}),au={})),Gd=!1,Yc=document&&document.activeElement),document){var v=document&&document.activeElement,y=kN(m),S=y.map(function(x){var w=x.node;return w}).indexOf(v);S>-1&&(y.filter(function(x){var w=x.guard,_=x.node;return w&&_.dataset.focusAutoGuard}).forEach(function(x){var w=x.node;return w.removeAttribute("tabIndex")}),nC(S,y.length,1,y),nC(S,-1,-1,y))}}}return t},QP=function(t){sm()&&t&&(t.stopPropagation(),t.preventDefault())},Gx=function(){return ZP(sm)},zN=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||TN(r,n)},$N=function(){return null},JP=function(){Gd="just",setTimeout(function(){Gd="meanwhile"},0)},LN=function(){document.addEventListener("focusin",QP),document.addEventListener("focusout",Gx),window.addEventListener("blur",JP)},BN=function(){document.removeEventListener("focusin",QP),document.removeEventListener("focusout",Gx),window.removeEventListener("blur",JP)};function FN(e){return e.filter(function(t){var n=t.disabled;return!n})}function HN(e){var t=e.slice(-1)[0];t&&!su&&LN();var n=su,r=n&&t&&t.id===n.id;su=t,n&&!r&&(n.onDeactivation(),e.filter(function(o){var s=o.id;return s===n.id}).length||n.returnFocus(!t)),t?(Yc=null,(!r||n.observed!==t.observed)&&t.onActivation(),sm(),ZP(sm)):(BN(),Yc=null)}MP.assignSyncMedium(zN);DP.assignMedium(Gx);YA.assignMedium(function(e){return e({moveFocusInside:XP,focusInside:qP})});const VN=QA(FN,HN)($N);var e6=h.forwardRef(function(t,n){return h.createElement(AP,Pr({sideCar:VN,ref:n},t))}),t6=AP.propTypes||{};t6.sideCar;q9(t6,["sideCar"]);e6.propTypes={};const rC=e6;function n6(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function qx(e){var t;if(!n6(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function WN(e){var t,n;return(n=(t=r6(e))==null?void 0:t.defaultView)!=null?n:window}function r6(e){return n6(e)?e.ownerDocument:document}function UN(e){return r6(e).activeElement}function GN(e){const t=e.ownerDocument.defaultView||window,{overflow:n,overflowX:r,overflowY:o}=t.getComputedStyle(e);return/auto|scroll|overlay|hidden/.test(n+o+r)}function qN(e){return e.localName==="html"?e:e.assignedSlot||e.parentElement||e.ownerDocument.documentElement}function o6(e){return["html","body","#document"].includes(e.localName)?e.ownerDocument.body:qx(e)&&GN(e)?e:o6(qN(e))}var s6=e=>e.hasAttribute("tabindex"),YN=e=>s6(e)&&e.tabIndex===-1;function KN(e){return!!e.getAttribute("disabled")||!!e.getAttribute("aria-disabled")}function a6(e){return e.parentElement&&a6(e.parentElement)?!0:e.hidden}function XN(e){const t=e.getAttribute("contenteditable");return t!=="false"&&t!=null}function i6(e){if(!qx(e)||a6(e)||KN(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]():XN(e)?!0:s6(e)}function ZN(e){return e?qx(e)&&i6(e)&&!YN(e):!1}var QN=["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]"],JN=QN.join(),ez=e=>e.offsetWidth>0&&e.offsetHeight>0;function l6(e){const t=Array.from(e.querySelectorAll(JN));return t.unshift(e),t.filter(n=>i6(n)&&ez(n))}var oC,tz=(oC=rC.default)!=null?oC:rC,c6=e=>{const{initialFocusRef:t,finalFocusRef:n,contentRef:r,restoreFocus:o,children:s,isDisabled:a,autoFocus:l,persistentFocus:u,lockFocusAcrossFrames:f}=e,p=h.useCallback(()=>{t!=null&&t.current?t.current.focus():r!=null&&r.current&&l6(r.current).length===0&&requestAnimationFrame(()=>{var S;(S=r.current)==null||S.focus()})},[t,r]),m=h.useCallback(()=>{var y;(y=n==null?void 0:n.current)==null||y.focus()},[n]),v=o&&!n;return i.jsx(tz,{crossFrame:f,persistentFocus:u,autoFocus:l,disabled:a,onActivation:p,onDeactivation:m,returnFocus:v,children:s})};c6.displayName="FocusLock";function nz(e,t,n,r){const o=X3(t);return h.useEffect(()=>{var s;const a=(s=nS(n))!=null?s:document;if(t)return a.addEventListener(e,o,r),()=>{a.removeEventListener(e,o,r)}},[e,n,r,o,t]),()=>{var s;((s=nS(n))!=null?s:document).removeEventListener(e,o,r)}}function rz(e){const{ref:t,handler:n,enabled:r=!0}=e,o=X3(n),a=h.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}).current;h.useEffect(()=>{if(!r)return;const l=m=>{Y0(m,t)&&(a.isPointerDown=!0)},u=m=>{if(a.ignoreEmulatedMouseEvents){a.ignoreEmulatedMouseEvents=!1;return}a.isPointerDown&&n&&Y0(m,t)&&(a.isPointerDown=!1,o(m))},f=m=>{a.ignoreEmulatedMouseEvents=!0,n&&a.isPointerDown&&Y0(m,t)&&(a.isPointerDown=!1,o(m))},p=Z3(t.current);return p.addEventListener("mousedown",l,!0),p.addEventListener("mouseup",u,!0),p.addEventListener("touchstart",l,!0),p.addEventListener("touchend",f,!0),()=>{p.removeEventListener("mousedown",l,!0),p.removeEventListener("mouseup",u,!0),p.removeEventListener("touchstart",l,!0),p.removeEventListener("touchend",f,!0)}},[n,t,o,a,r])}function Y0(e,t){var n;const r=e.target;return r&&!Z3(r).contains(r)?!1:!((n=t.current)!=null&&n.contains(r))}var[oz,sz]=Yn({name:"InputGroupStylesContext",errorMessage:`useInputGroupStyles returned is 'undefined'. Seems you forgot to wrap the components in "<InputGroup />" `}),u6=Be(function(t,n){const r=to("Input",t),{children:o,className:s,...a}=ur(t),l=Ot("chakra-input__group",s),u={},f=Rf(o),p=r.field;f.forEach(v=>{var y,S;r&&(p&&v.type.id==="InputLeftElement"&&(u.paddingStart=(y=p.height)!=null?y:p.h),p&&v.type.id==="InputRightElement"&&(u.paddingEnd=(S=p.height)!=null?S:p.h),v.type.id==="InputRightAddon"&&(u.borderEndRadius=0),v.type.id==="InputLeftAddon"&&(u.borderStartRadius=0))});const m=f.map(v=>{var y,S;const x=tP({size:((y=v.props)==null?void 0:y.size)||t.size,variant:((S=v.props)==null?void 0:S.variant)||t.variant});return v.type.id!=="Input"?h.cloneElement(v,x):h.cloneElement(v,Object.assign(x,u,v.props))});return i.jsx(Oe.div,{className:l,ref:n,__css:{width:"100%",display:"flex",position:"relative",isolation:"isolate"},"data-group":!0,...a,children:i.jsx(oz,{value:r,children:m})})});u6.displayName="InputGroup";var az=Oe("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"0",zIndex:2}}),Og=Be(function(t,n){var r,o;const{placement:s="left",...a}=t,l=sz(),u=l.field,p={[s==="left"?"insetStart":"insetEnd"]:"0",width:(r=u==null?void 0:u.height)!=null?r:u==null?void 0:u.h,height:(o=u==null?void 0:u.height)!=null?o:u==null?void 0:u.h,fontSize:u==null?void 0:u.fontSize,...l.element};return i.jsx(az,{ref:n,__css:p,...a})});Og.id="InputElement";Og.displayName="InputElement";var d6=Be(function(t,n){const{className:r,...o}=t,s=Ot("chakra-input__left-element",r);return i.jsx(Og,{ref:n,placement:"left",className:s,...o})});d6.id="InputLeftElement";d6.displayName="InputLeftElement";var Yx=Be(function(t,n){const{className:r,...o}=t,s=Ot("chakra-input__right-element",r);return i.jsx(Og,{ref:n,placement:"right",className:s,...o})});Yx.id="InputRightElement";Yx.displayName="InputRightElement";var Df=Be(function(t,n){const{htmlSize:r,...o}=t,s=to("Input",o),a=ur(o),l=Dx(a),u=Ot("chakra-input",t.className);return i.jsx(Oe.input,{size:r,...l,__css:s.field,ref:n,className:u})});Df.displayName="Input";Df.id="Input";var Wl=Be(function(t,n){const r=Si("Link",t),{className:o,isExternal:s,...a}=ur(t);return i.jsx(Oe.a,{target:s?"_blank":void 0,rel:s?"noopener":void 0,ref:n,className:Ot("chakra-link",o),...a,__css:r})});Wl.displayName="Link";var[iz,f6]=Yn({name:"ListStylesContext",errorMessage:`useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "<List />" `}),Kx=Be(function(t,n){const r=to("List",t),{children:o,styleType:s="none",stylePosition:a,spacing:l,...u}=ur(t),f=Rf(o),m=l?{["& > *:not(style) ~ *:not(style)"]:{mt:l}}:{};return i.jsx(iz,{value:r,children:i.jsx(Oe.ul,{ref:n,listStyleType:s,listStylePosition:a,role:"list",__css:{...r.container,...m},...u,children:f})})});Kx.displayName="List";var lz=Be((e,t)=>{const{as:n,...r}=e;return i.jsx(Kx,{ref:t,as:"ol",styleType:"decimal",marginStart:"1em",...r})});lz.displayName="OrderedList";var Tg=Be(function(t,n){const{as:r,...o}=t;return i.jsx(Kx,{ref:n,as:"ul",styleType:"initial",marginStart:"1em",...o})});Tg.displayName="UnorderedList";var is=Be(function(t,n){const r=f6();return i.jsx(Oe.li,{ref:n,...t,__css:r.item})});is.displayName="ListItem";var cz=Be(function(t,n){const r=f6();return i.jsx(uo,{ref:n,role:"presentation",...t,__css:r.icon})});cz.displayName="ListIcon";var gi=Be(function(t,n){const{templateAreas:r,gap:o,rowGap:s,columnGap:a,column:l,row:u,autoFlow:f,autoRows:p,templateRows:m,autoColumns:v,templateColumns:y,...S}=t,x={display:"grid",gridTemplateAreas:r,gridGap:o,gridRowGap:s,gridColumnGap:a,gridAutoColumns:v,gridColumn:l,gridRow:u,gridAutoFlow:f,gridAutoRows:p,gridTemplateRows:m,gridTemplateColumns:y};return i.jsx(Oe.div,{ref:n,__css:x,...S})});gi.displayName="Grid";function uz(e,t){return Array.isArray(e)?e.map(n=>n===null?null:t(n)):G1(e)?Object.keys(e).reduce((n,r)=>(n[r]=t(e[r]),n),{}):e!=null?t(e):null}var ul=Oe("div",{baseStyle:{flex:1,justifySelf:"stretch",alignSelf:"stretch"}});ul.displayName="Spacer";var lt=Be(function(t,n){const r=Si("Text",t),{className:o,align:s,decoration:a,casing:l,...u}=ur(t),f=tP({textAlign:t.align,textDecoration:t.decoration,textTransform:t.casing});return i.jsx(Oe.p,{ref:n,className:Ot("chakra-text",t.className),...f,...u,__css:r})});lt.displayName="Text";var p6=e=>i.jsx(Oe.div,{className:"chakra-stack__item",...e,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...e.__css}});p6.displayName="StackItem";function dz(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{"&":uz(n,o=>r[o])}}var Xx=Be((e,t)=>{const{isInline:n,direction:r,align:o,justify:s,spacing:a="0.5rem",wrap:l,children:u,divider:f,className:p,shouldWrapChildren:m,...v}=e,y=n?"row":r??"column",S=h.useMemo(()=>dz({spacing:a,direction:y}),[a,y]),x=!!f,w=!m&&!x,_=h.useMemo(()=>{const P=Rf(u);return w?P:P.map((I,j)=>{const E=typeof I.key<"u"?I.key:j,T=j+1===P.length,M=m?i.jsx(p6,{children:I},E):I;if(!x)return M;const D=h.cloneElement(f,{__css:S}),N=T?null:D;return i.jsxs(h.Fragment,{children:[M,N]},E)})},[f,S,x,w,m,u]),k=Ot("chakra-stack",p);return i.jsx(Oe.div,{ref:t,display:"flex",alignItems:o,justifyContent:s,flexDirection:y,flexWrap:l,gap:x?void 0:a,className:k,...v,children:_})});Xx.displayName="Stack";var Nn=Be((e,t)=>i.jsx(Xx,{align:"center",...e,direction:"column",ref:t}));Nn.displayName="VStack";var aa=Be((e,t)=>i.jsx(Xx,{align:"center",...e,direction:"row",ref:t}));aa.displayName="HStack";var ta=Be(function(t,n){const r=Si("Heading",t),{className:o,...s}=ur(t);return i.jsx(Oe.h2,{ref:n,className:Ot("chakra-heading",t.className),...s,__css:r})});ta.displayName="Heading";var mu=Be(function(t,n){const r=Si("Badge",t),{className:o,...s}=ur(t);return i.jsx(Oe.span,{ref:n,className:Ot("chakra-badge",t.className),...s,__css:{display:"inline-block",whiteSpace:"nowrap",verticalAlign:"middle",...r}})});mu.displayName="Badge";var h6=Oe("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center"}});h6.displayName="Center";var fz={horizontal:{insetStart:"50%",transform:"translateX(-50%)"},vertical:{top:"50%",transform:"translateY(-50%)"},both:{insetStart:"50%",top:"50%",transform:"translate(-50%, -50%)"}};Be(function(t,n){const{axis:r="both",...o}=t;return i.jsx(Oe.div,{ref:n,__css:fz[r],...o,position:"absolute"})});var Fu=Be(function(t,n){const{borderLeftWidth:r,borderBottomWidth:o,borderTopWidth:s,borderRightWidth:a,borderWidth:l,borderStyle:u,borderColor:f,...p}=Si("Divider",t),{className:m,orientation:v="horizontal",__css:y,...S}=ur(t),x={vertical:{borderLeftWidth:r||a||l||"1px",height:"100%"},horizontal:{borderBottomWidth:o||s||l||"1px",width:"100%"}};return i.jsx(Oe.hr,{ref:n,"aria-orientation":v,...S,__css:{...p,border:"0",borderColor:f,borderStyle:u,...x[v],...y},className:Ot("chakra-divider",m)})});Fu.displayName="Divider";function pz(e){const{key:t}=e;return t.length===1||t.length>1&&/[^a-zA-Z0-9]/.test(t)}function hz(e={}){const{timeout:t=300,preventDefault:n=()=>!0}=e,[r,o]=h.useState([]),s=h.useRef(),a=()=>{s.current&&(clearTimeout(s.current),s.current=null)},l=()=>{a(),s.current=setTimeout(()=>{o([]),s.current=null},t)};h.useEffect(()=>a,[]);function u(f){return p=>{if(p.key==="Backspace"){const m=[...r];m.pop(),o(m);return}if(pz(p)){const m=r.concat(p.key);n(p)&&(p.preventDefault(),p.stopPropagation()),o(m),f(m.join("")),l()}}}return u}function mz(e,t,n,r){if(t==null)return r;if(!r)return e.find(a=>n(a).toLowerCase().startsWith(t.toLowerCase()));const o=e.filter(s=>n(s).toLowerCase().startsWith(t.toLowerCase()));if(o.length>0){let s;return o.includes(r)?(s=o.indexOf(r)+1,s===o.length&&(s=0),o[s]):(s=e.indexOf(o[0]),e[s])}return r}function gz(){const e=h.useRef(new Map),t=e.current,n=h.useCallback((o,s,a,l)=>{e.current.set(a,{type:s,el:o,options:l}),o.addEventListener(s,a,l)},[]),r=h.useCallback((o,s,a,l)=>{o.removeEventListener(s,a,l),e.current.delete(a)},[]);return h.useEffect(()=>()=>{t.forEach((o,s)=>{r(o.el,o.type,s,o.options)})},[r,t]),{add:n,remove:r}}function K0(e){const t=e.target,{tagName:n,isContentEditable:r}=t;return n!=="INPUT"&&n!=="TEXTAREA"&&r!==!0}function m6(e={}){const{ref:t,isDisabled:n,isFocusable:r,clickOnEnter:o=!0,clickOnSpace:s=!0,onMouseDown:a,onMouseUp:l,onClick:u,onKeyDown:f,onKeyUp:p,tabIndex:m,onMouseOver:v,onMouseLeave:y,...S}=e,[x,w]=h.useState(!0),[_,k]=h.useState(!1),P=gz(),I=A=>{A&&A.tagName!=="BUTTON"&&w(!1)},j=x?m:m||0,E=n&&!r,T=h.useCallback(A=>{if(n){A.stopPropagation(),A.preventDefault();return}A.currentTarget.focus(),u==null||u(A)},[n,u]),R=h.useCallback(A=>{_&&K0(A)&&(A.preventDefault(),A.stopPropagation(),k(!1),P.remove(document,"keyup",R,!1))},[_,P]),M=h.useCallback(A=>{if(f==null||f(A),n||A.defaultPrevented||A.metaKey||!K0(A.nativeEvent)||x)return;const L=o&&A.key==="Enter";s&&A.key===" "&&(A.preventDefault(),k(!0)),L&&(A.preventDefault(),A.currentTarget.click()),P.add(document,"keyup",R,!1)},[n,x,f,o,s,P,R]),D=h.useCallback(A=>{if(p==null||p(A),n||A.defaultPrevented||A.metaKey||!K0(A.nativeEvent)||x)return;s&&A.key===" "&&(A.preventDefault(),k(!1),A.currentTarget.click())},[s,x,n,p]),N=h.useCallback(A=>{A.button===0&&(k(!1),P.remove(document,"mouseup",N,!1))},[P]),U=h.useCallback(A=>{if(A.button!==0)return;if(n){A.stopPropagation(),A.preventDefault();return}x||k(!0),A.currentTarget.focus({preventScroll:!0}),P.add(document,"mouseup",N,!1),a==null||a(A)},[n,x,a,P,N]),z=h.useCallback(A=>{A.button===0&&(x||k(!1),l==null||l(A))},[l,x]),F=h.useCallback(A=>{if(n){A.preventDefault();return}v==null||v(A)},[n,v]),H=h.useCallback(A=>{_&&(A.preventDefault(),k(!1)),y==null||y(A)},[_,y]),G=yn(t,I);return x?{...S,ref:G,type:"button","aria-disabled":E?void 0:n,disabled:E,onClick:T,onMouseDown:a,onMouseUp:l,onKeyUp:p,onKeyDown:f,onMouseOver:v,onMouseLeave:y}:{...S,ref:G,role:"button","data-active":ln(_),"aria-disabled":n?"true":void 0,tabIndex:E?void 0:j,onClick:T,onMouseDown:U,onMouseUp:z,onKeyUp:D,onKeyDown:M,onMouseOver:F,onMouseLeave:H}}function vz(e){const t=e.current;if(!t)return!1;const n=UN(t);return!n||t.contains(n)?!1:!!ZN(n)}function g6(e,t){const{shouldFocus:n,visible:r,focusRef:o}=t,s=n&&!r;Ci(()=>{if(!s||vz(e))return;const a=(o==null?void 0:o.current)||e.current;let l;if(a)return l=requestAnimationFrame(()=>{a.focus({preventScroll:!0})}),()=>{cancelAnimationFrame(l)}},[s,e,o])}var yz={preventScroll:!0,shouldFocus:!1};function xz(e,t=yz){const{focusRef:n,preventScroll:r,shouldFocus:o,visible:s}=t,a=bz(e)?e.current:e,l=o&&s,u=h.useRef(l),f=h.useRef(s);Jc(()=>{!f.current&&s&&(u.current=l),f.current=s},[s,l]);const p=h.useCallback(()=>{if(!(!s||!a||!u.current)&&(u.current=!1,!a.contains(document.activeElement)))if(n!=null&&n.current)requestAnimationFrame(()=>{var m;(m=n.current)==null||m.focus({preventScroll:r})});else{const m=l6(a);m.length>0&&requestAnimationFrame(()=>{m[0].focus({preventScroll:r})})}},[s,r,a,n]);Ci(()=>{p()},[p]),Vl(a,"transitionend",p)}function bz(e){return"current"in e}var Dc=(e,t)=>({var:e,varRef:t?`var(${e}, ${t})`:`var(${e})`}),Ur={arrowShadowColor:Dc("--popper-arrow-shadow-color"),arrowSize:Dc("--popper-arrow-size","8px"),arrowSizeHalf:Dc("--popper-arrow-size-half"),arrowBg:Dc("--popper-arrow-bg"),transformOrigin:Dc("--popper-transform-origin"),arrowOffset:Dc("--popper-arrow-offset")};function wz(e){if(e.includes("top"))return"1px 1px 0px 0 var(--popper-arrow-shadow-color)";if(e.includes("bottom"))return"-1px -1px 0px 0 var(--popper-arrow-shadow-color)";if(e.includes("right"))return"-1px 1px 0px 0 var(--popper-arrow-shadow-color)";if(e.includes("left"))return"1px -1px 0px 0 var(--popper-arrow-shadow-color)"}var Sz={top:"bottom center","top-start":"bottom left","top-end":"bottom right",bottom:"top center","bottom-start":"top left","bottom-end":"top right",left:"right center","left-start":"right top","left-end":"right bottom",right:"left center","right-start":"left top","right-end":"left bottom"},Cz=e=>Sz[e],sC={scroll:!0,resize:!0};function _z(e){let t;return typeof e=="object"?t={enabled:!0,options:{...sC,...e}}:t={enabled:e,options:sC},t}var kz={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`}},Pz={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:e})=>{aC(e)},effect:({state:e})=>()=>{aC(e)}},aC=e=>{e.elements.popper.style.setProperty(Ur.transformOrigin.var,Cz(e.placement))},jz={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:e})=>{Iz(e)}},Iz=e=>{var t;if(!e.placement)return;const n=Ez(e.placement);if((t=e.elements)!=null&&t.arrow&&n){Object.assign(e.elements.arrow.style,{[n.property]:n.value,width:Ur.arrowSize.varRef,height:Ur.arrowSize.varRef,zIndex:-1});const r={[Ur.arrowSizeHalf.var]:`calc(${Ur.arrowSize.varRef} / 2 - 1px)`,[Ur.arrowOffset.var]:`calc(${Ur.arrowSizeHalf.varRef} * -1)`};for(const o in r)e.elements.arrow.style.setProperty(o,r[o])}},Ez=e=>{if(e.startsWith("top"))return{property:"bottom",value:Ur.arrowOffset.varRef};if(e.startsWith("bottom"))return{property:"top",value:Ur.arrowOffset.varRef};if(e.startsWith("left"))return{property:"right",value:Ur.arrowOffset.varRef};if(e.startsWith("right"))return{property:"left",value:Ur.arrowOffset.varRef}},Oz={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:e})=>{iC(e)},effect:({state:e})=>()=>{iC(e)}},iC=e=>{if(!e.elements.arrow)return;const t=e.elements.arrow.querySelector("[data-popper-arrow-inner]");if(!t)return;const n=wz(e.placement);n&&t.style.setProperty("--popper-arrow-default-shadow",n),Object.assign(t.style,{transform:"rotate(45deg)",background:Ur.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:"var(--popper-arrow-shadow, var(--popper-arrow-default-shadow))"})},Tz={"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"}},Rz={"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 Mz(e,t="ltr"){var n,r;const o=((n=Tz[e])==null?void 0:n[t])||e;return t==="ltr"?o:(r=Rz[e])!=null?r:o}var Go="top",zs="bottom",$s="right",qo="left",Zx="auto",Af=[Go,zs,$s,qo],gu="start",qd="end",Dz="clippingParents",v6="viewport",fd="popper",Az="reference",lC=Af.reduce(function(e,t){return e.concat([t+"-"+gu,t+"-"+qd])},[]),y6=[].concat(Af,[Zx]).reduce(function(e,t){return e.concat([t,t+"-"+gu,t+"-"+qd])},[]),Nz="beforeRead",zz="read",$z="afterRead",Lz="beforeMain",Bz="main",Fz="afterMain",Hz="beforeWrite",Vz="write",Wz="afterWrite",Uz=[Nz,zz,$z,Lz,Bz,Fz,Hz,Vz,Wz];function Ha(e){return e?(e.nodeName||"").toLowerCase():null}function ds(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Jl(e){var t=ds(e).Element;return e instanceof t||e instanceof Element}function As(e){var t=ds(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Qx(e){if(typeof ShadowRoot>"u")return!1;var t=ds(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Gz(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];!As(s)||!Ha(s)||(Object.assign(s.style,r),Object.keys(o).forEach(function(a){var l=o[a];l===!1?s.removeAttribute(a):s.setAttribute(a,l===!0?"":l)}))})}function qz(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var o=t.elements[r],s=t.attributes[r]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),l=a.reduce(function(u,f){return u[f]="",u},{});!As(o)||!Ha(o)||(Object.assign(o.style,l),Object.keys(s).forEach(function(u){o.removeAttribute(u)}))})}}const Yz={name:"applyStyles",enabled:!0,phase:"write",fn:Gz,effect:qz,requires:["computeStyles"]};function Fa(e){return e.split("-")[0]}var Ul=Math.max,am=Math.min,vu=Math.round;function fy(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function x6(){return!/^((?!chrome|android).)*safari/i.test(fy())}function yu(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),o=1,s=1;t&&As(e)&&(o=e.offsetWidth>0&&vu(r.width)/e.offsetWidth||1,s=e.offsetHeight>0&&vu(r.height)/e.offsetHeight||1);var a=Jl(e)?ds(e):window,l=a.visualViewport,u=!x6()&&n,f=(r.left+(u&&l?l.offsetLeft:0))/o,p=(r.top+(u&&l?l.offsetTop:0))/s,m=r.width/o,v=r.height/s;return{width:m,height:v,top:p,right:f+m,bottom:p+v,left:f,x:f,y:p}}function Jx(e){var t=yu(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 b6(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Qx(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function vi(e){return ds(e).getComputedStyle(e)}function Kz(e){return["table","td","th"].indexOf(Ha(e))>=0}function dl(e){return((Jl(e)?e.ownerDocument:e.document)||window.document).documentElement}function Rg(e){return Ha(e)==="html"?e:e.assignedSlot||e.parentNode||(Qx(e)?e.host:null)||dl(e)}function cC(e){return!As(e)||vi(e).position==="fixed"?null:e.offsetParent}function Xz(e){var t=/firefox/i.test(fy()),n=/Trident/i.test(fy());if(n&&As(e)){var r=vi(e);if(r.position==="fixed")return null}var o=Rg(e);for(Qx(o)&&(o=o.host);As(o)&&["html","body"].indexOf(Ha(o))<0;){var s=vi(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 Nf(e){for(var t=ds(e),n=cC(e);n&&Kz(n)&&vi(n).position==="static";)n=cC(n);return n&&(Ha(n)==="html"||Ha(n)==="body"&&vi(n).position==="static")?t:n||Xz(e)||t}function eb(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Md(e,t,n){return Ul(e,am(t,n))}function Zz(e,t,n){var r=Md(e,t,n);return r>n?n:r}function w6(){return{top:0,right:0,bottom:0,left:0}}function S6(e){return Object.assign({},w6(),e)}function C6(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var Qz=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,S6(typeof t!="number"?t:C6(t,Af))};function Jz(e){var t,n=e.state,r=e.name,o=e.options,s=n.elements.arrow,a=n.modifiersData.popperOffsets,l=Fa(n.placement),u=eb(l),f=[qo,$s].indexOf(l)>=0,p=f?"height":"width";if(!(!s||!a)){var m=Qz(o.padding,n),v=Jx(s),y=u==="y"?Go:qo,S=u==="y"?zs:$s,x=n.rects.reference[p]+n.rects.reference[u]-a[u]-n.rects.popper[p],w=a[u]-n.rects.reference[u],_=Nf(s),k=_?u==="y"?_.clientHeight||0:_.clientWidth||0:0,P=x/2-w/2,I=m[y],j=k-v[p]-m[S],E=k/2-v[p]/2+P,T=Md(I,E,j),R=u;n.modifiersData[r]=(t={},t[R]=T,t.centerOffset=T-E,t)}}function e$(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)||b6(t.elements.popper,o)&&(t.elements.arrow=o))}const t$={name:"arrow",enabled:!0,phase:"main",fn:Jz,effect:e$,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function xu(e){return e.split("-")[1]}var n$={top:"auto",right:"auto",bottom:"auto",left:"auto"};function r$(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:vu(n*o)/o||0,y:vu(r*o)/o||0}}function uC(e){var t,n=e.popper,r=e.popperRect,o=e.placement,s=e.variation,a=e.offsets,l=e.position,u=e.gpuAcceleration,f=e.adaptive,p=e.roundOffsets,m=e.isFixed,v=a.x,y=v===void 0?0:v,S=a.y,x=S===void 0?0:S,w=typeof p=="function"?p({x:y,y:x}):{x:y,y:x};y=w.x,x=w.y;var _=a.hasOwnProperty("x"),k=a.hasOwnProperty("y"),P=qo,I=Go,j=window;if(f){var E=Nf(n),T="clientHeight",R="clientWidth";if(E===ds(n)&&(E=dl(n),vi(E).position!=="static"&&l==="absolute"&&(T="scrollHeight",R="scrollWidth")),E=E,o===Go||(o===qo||o===$s)&&s===qd){I=zs;var M=m&&E===j&&j.visualViewport?j.visualViewport.height:E[T];x-=M-r.height,x*=u?1:-1}if(o===qo||(o===Go||o===zs)&&s===qd){P=$s;var D=m&&E===j&&j.visualViewport?j.visualViewport.width:E[R];y-=D-r.width,y*=u?1:-1}}var N=Object.assign({position:l},f&&n$),U=p===!0?r$({x:y,y:x},ds(n)):{x:y,y:x};if(y=U.x,x=U.y,u){var z;return Object.assign({},N,(z={},z[I]=k?"0":"",z[P]=_?"0":"",z.transform=(j.devicePixelRatio||1)<=1?"translate("+y+"px, "+x+"px)":"translate3d("+y+"px, "+x+"px, 0)",z))}return Object.assign({},N,(t={},t[I]=k?x+"px":"",t[P]=_?y+"px":"",t.transform="",t))}function o$(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=r===void 0?!0:r,s=n.adaptive,a=s===void 0?!0:s,l=n.roundOffsets,u=l===void 0?!0:l,f={placement:Fa(t.placement),variation:xu(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,uC(Object.assign({},f,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:u})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,uC(Object.assign({},f,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const s$={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:o$,data:{}};var zp={passive:!0};function a$(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,s=o===void 0?!0:o,a=r.resize,l=a===void 0?!0:a,u=ds(t.elements.popper),f=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&f.forEach(function(p){p.addEventListener("scroll",n.update,zp)}),l&&u.addEventListener("resize",n.update,zp),function(){s&&f.forEach(function(p){p.removeEventListener("scroll",n.update,zp)}),l&&u.removeEventListener("resize",n.update,zp)}}const i$={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:a$,data:{}};var l$={left:"right",right:"left",bottom:"top",top:"bottom"};function jh(e){return e.replace(/left|right|bottom|top/g,function(t){return l$[t]})}var c$={start:"end",end:"start"};function dC(e){return e.replace(/start|end/g,function(t){return c$[t]})}function tb(e){var t=ds(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function nb(e){return yu(dl(e)).left+tb(e).scrollLeft}function u$(e,t){var n=ds(e),r=dl(e),o=n.visualViewport,s=r.clientWidth,a=r.clientHeight,l=0,u=0;if(o){s=o.width,a=o.height;var f=x6();(f||!f&&t==="fixed")&&(l=o.offsetLeft,u=o.offsetTop)}return{width:s,height:a,x:l+nb(e),y:u}}function d$(e){var t,n=dl(e),r=tb(e),o=(t=e.ownerDocument)==null?void 0:t.body,s=Ul(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=Ul(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),l=-r.scrollLeft+nb(e),u=-r.scrollTop;return vi(o||n).direction==="rtl"&&(l+=Ul(n.clientWidth,o?o.clientWidth:0)-s),{width:s,height:a,x:l,y:u}}function rb(e){var t=vi(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function _6(e){return["html","body","#document"].indexOf(Ha(e))>=0?e.ownerDocument.body:As(e)&&rb(e)?e:_6(Rg(e))}function Dd(e,t){var n;t===void 0&&(t=[]);var r=_6(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),s=ds(r),a=o?[s].concat(s.visualViewport||[],rb(r)?r:[]):r,l=t.concat(a);return o?l:l.concat(Dd(Rg(a)))}function py(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function f$(e,t){var n=yu(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 fC(e,t,n){return t===v6?py(u$(e,n)):Jl(t)?f$(t,n):py(d$(dl(e)))}function p$(e){var t=Dd(Rg(e)),n=["absolute","fixed"].indexOf(vi(e).position)>=0,r=n&&As(e)?Nf(e):e;return Jl(r)?t.filter(function(o){return Jl(o)&&b6(o,r)&&Ha(o)!=="body"}):[]}function h$(e,t,n,r){var o=t==="clippingParents"?p$(e):[].concat(t),s=[].concat(o,[n]),a=s[0],l=s.reduce(function(u,f){var p=fC(e,f,r);return u.top=Ul(p.top,u.top),u.right=am(p.right,u.right),u.bottom=am(p.bottom,u.bottom),u.left=Ul(p.left,u.left),u},fC(e,a,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function k6(e){var t=e.reference,n=e.element,r=e.placement,o=r?Fa(r):null,s=r?xu(r):null,a=t.x+t.width/2-n.width/2,l=t.y+t.height/2-n.height/2,u;switch(o){case Go:u={x:a,y:t.y-n.height};break;case zs:u={x:a,y:t.y+t.height};break;case $s:u={x:t.x+t.width,y:l};break;case qo:u={x:t.x-n.width,y:l};break;default:u={x:t.x,y:t.y}}var f=o?eb(o):null;if(f!=null){var p=f==="y"?"height":"width";switch(s){case gu:u[f]=u[f]-(t[p]/2-n[p]/2);break;case qd:u[f]=u[f]+(t[p]/2-n[p]/2);break}}return u}function Yd(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=r===void 0?e.placement:r,s=n.strategy,a=s===void 0?e.strategy:s,l=n.boundary,u=l===void 0?Dz:l,f=n.rootBoundary,p=f===void 0?v6:f,m=n.elementContext,v=m===void 0?fd:m,y=n.altBoundary,S=y===void 0?!1:y,x=n.padding,w=x===void 0?0:x,_=S6(typeof w!="number"?w:C6(w,Af)),k=v===fd?Az:fd,P=e.rects.popper,I=e.elements[S?k:v],j=h$(Jl(I)?I:I.contextElement||dl(e.elements.popper),u,p,a),E=yu(e.elements.reference),T=k6({reference:E,element:P,strategy:"absolute",placement:o}),R=py(Object.assign({},P,T)),M=v===fd?R:E,D={top:j.top-M.top+_.top,bottom:M.bottom-j.bottom+_.bottom,left:j.left-M.left+_.left,right:M.right-j.right+_.right},N=e.modifiersData.offset;if(v===fd&&N){var U=N[o];Object.keys(D).forEach(function(z){var F=[$s,zs].indexOf(z)>=0?1:-1,H=[Go,zs].indexOf(z)>=0?"y":"x";D[z]+=U[H]*F})}return D}function m$(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=n.boundary,s=n.rootBoundary,a=n.padding,l=n.flipVariations,u=n.allowedAutoPlacements,f=u===void 0?y6:u,p=xu(r),m=p?l?lC:lC.filter(function(S){return xu(S)===p}):Af,v=m.filter(function(S){return f.indexOf(S)>=0});v.length===0&&(v=m);var y=v.reduce(function(S,x){return S[x]=Yd(e,{placement:x,boundary:o,rootBoundary:s,padding:a})[Fa(x)],S},{});return Object.keys(y).sort(function(S,x){return y[S]-y[x]})}function g$(e){if(Fa(e)===Zx)return[];var t=jh(e);return[dC(e),t,dC(t)]}function v$(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,s=o===void 0?!0:o,a=n.altAxis,l=a===void 0?!0:a,u=n.fallbackPlacements,f=n.padding,p=n.boundary,m=n.rootBoundary,v=n.altBoundary,y=n.flipVariations,S=y===void 0?!0:y,x=n.allowedAutoPlacements,w=t.options.placement,_=Fa(w),k=_===w,P=u||(k||!S?[jh(w)]:g$(w)),I=[w].concat(P).reduce(function(X,Q){return X.concat(Fa(Q)===Zx?m$(t,{placement:Q,boundary:p,rootBoundary:m,padding:f,flipVariations:S,allowedAutoPlacements:x}):Q)},[]),j=t.rects.reference,E=t.rects.popper,T=new Map,R=!0,M=I[0],D=0;D<I.length;D++){var N=I[D],U=Fa(N),z=xu(N)===gu,F=[Go,zs].indexOf(U)>=0,H=F?"width":"height",G=Yd(t,{placement:N,boundary:p,rootBoundary:m,altBoundary:v,padding:f}),A=F?z?$s:qo:z?zs:Go;j[H]>E[H]&&(A=jh(A));var L=jh(A),W=[];if(s&&W.push(G[U]<=0),l&&W.push(G[A]<=0,G[L]<=0),W.every(function(X){return X})){M=N,R=!1;break}T.set(N,W)}if(R)for(var V=S?3:1,ee=function(Q){var ie=I.find(function(ve){var ye=T.get(ve);if(ye)return ye.slice(0,Q).every(function(se){return se})});if(ie)return M=ie,"break"},le=V;le>0;le--){var oe=ee(le);if(oe==="break")break}t.placement!==M&&(t.modifiersData[r]._skip=!0,t.placement=M,t.reset=!0)}}const y$={name:"flip",enabled:!0,phase:"main",fn:v$,requiresIfExists:["offset"],data:{_skip:!1}};function pC(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 hC(e){return[Go,$s,zs,qo].some(function(t){return e[t]>=0})}function x$(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,s=t.modifiersData.preventOverflow,a=Yd(t,{elementContext:"reference"}),l=Yd(t,{altBoundary:!0}),u=pC(a,r),f=pC(l,o,s),p=hC(u),m=hC(f);t.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:f,isReferenceHidden:p,hasPopperEscaped:m},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":m})}const b$={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:x$};function w$(e,t,n){var r=Fa(e),o=[qo,Go].indexOf(r)>=0?-1:1,s=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=s[0],l=s[1];return a=a||0,l=(l||0)*o,[qo,$s].indexOf(r)>=0?{x:l,y:a}:{x:a,y:l}}function S$(e){var t=e.state,n=e.options,r=e.name,o=n.offset,s=o===void 0?[0,0]:o,a=y6.reduce(function(p,m){return p[m]=w$(m,t.rects,s),p},{}),l=a[t.placement],u=l.x,f=l.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=f),t.modifiersData[r]=a}const C$={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:S$};function _$(e){var t=e.state,n=e.name;t.modifiersData[n]=k6({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const k$={name:"popperOffsets",enabled:!0,phase:"read",fn:_$,data:{}};function P$(e){return e==="x"?"y":"x"}function j$(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,s=o===void 0?!0:o,a=n.altAxis,l=a===void 0?!1:a,u=n.boundary,f=n.rootBoundary,p=n.altBoundary,m=n.padding,v=n.tether,y=v===void 0?!0:v,S=n.tetherOffset,x=S===void 0?0:S,w=Yd(t,{boundary:u,rootBoundary:f,padding:m,altBoundary:p}),_=Fa(t.placement),k=xu(t.placement),P=!k,I=eb(_),j=P$(I),E=t.modifiersData.popperOffsets,T=t.rects.reference,R=t.rects.popper,M=typeof x=="function"?x(Object.assign({},t.rects,{placement:t.placement})):x,D=typeof M=="number"?{mainAxis:M,altAxis:M}:Object.assign({mainAxis:0,altAxis:0},M),N=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,U={x:0,y:0};if(E){if(s){var z,F=I==="y"?Go:qo,H=I==="y"?zs:$s,G=I==="y"?"height":"width",A=E[I],L=A+w[F],W=A-w[H],V=y?-R[G]/2:0,ee=k===gu?T[G]:R[G],le=k===gu?-R[G]:-T[G],oe=t.elements.arrow,X=y&&oe?Jx(oe):{width:0,height:0},Q=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:w6(),ie=Q[F],ve=Q[H],ye=Md(0,T[G],X[G]),se=P?T[G]/2-V-ye-ie-D.mainAxis:ee-ye-ie-D.mainAxis,de=P?-T[G]/2+V+ye+ve+D.mainAxis:le+ye+ve+D.mainAxis,fe=t.elements.arrow&&Nf(t.elements.arrow),xe=fe?I==="y"?fe.clientTop||0:fe.clientLeft||0:0,ke=(z=N==null?void 0:N[I])!=null?z:0,ae=A+se-ke-xe,Pe=A+de-ke,tt=Md(y?am(L,ae):L,A,y?Ul(W,Pe):W);E[I]=tt,U[I]=tt-A}if(l){var ze,We=I==="x"?Go:qo,It=I==="x"?zs:$s,pt=E[j],bn=j==="y"?"height":"width",Y=pt+w[We],Se=pt-w[It],ne=[Go,qo].indexOf(_)!==-1,he=(ze=N==null?void 0:N[j])!=null?ze:0,Re=ne?Y:pt-T[bn]-R[bn]-he+D.altAxis,Ke=ne?pt+T[bn]+R[bn]-he-D.altAxis:Se,ge=y&&ne?Zz(Re,pt,Ke):Md(y?Re:Y,pt,y?Ke:Se);E[j]=ge,U[j]=ge-pt}t.modifiersData[r]=U}}const I$={name:"preventOverflow",enabled:!0,phase:"main",fn:j$,requiresIfExists:["offset"]};function E$(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function O$(e){return e===ds(e)||!As(e)?tb(e):E$(e)}function T$(e){var t=e.getBoundingClientRect(),n=vu(t.width)/e.offsetWidth||1,r=vu(t.height)/e.offsetHeight||1;return n!==1||r!==1}function R$(e,t,n){n===void 0&&(n=!1);var r=As(t),o=As(t)&&T$(t),s=dl(t),a=yu(e,o,n),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&((Ha(t)!=="body"||rb(s))&&(l=O$(t)),As(t)?(u=yu(t,!0),u.x+=t.clientLeft,u.y+=t.clientTop):s&&(u.x=nb(s))),{x:a.left+l.scrollLeft-u.x,y:a.top+l.scrollTop-u.y,width:a.width,height:a.height}}function M$(e){var t=new Map,n=new Set,r=[];e.forEach(function(s){t.set(s.name,s)});function o(s){n.add(s.name);var a=[].concat(s.requires||[],s.requiresIfExists||[]);a.forEach(function(l){if(!n.has(l)){var u=t.get(l);u&&o(u)}}),r.push(s)}return e.forEach(function(s){n.has(s.name)||o(s)}),r}function D$(e){var t=M$(e);return Uz.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function A$(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function N$(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 mC={placement:"bottom",modifiers:[],strategy:"absolute"};function gC(){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 z$(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,o=t.defaultOptions,s=o===void 0?mC:o;return function(l,u,f){f===void 0&&(f=s);var p={placement:"bottom",orderedModifiers:[],options:Object.assign({},mC,s),modifiersData:{},elements:{reference:l,popper:u},attributes:{},styles:{}},m=[],v=!1,y={state:p,setOptions:function(_){var k=typeof _=="function"?_(p.options):_;x(),p.options=Object.assign({},s,p.options,k),p.scrollParents={reference:Jl(l)?Dd(l):l.contextElement?Dd(l.contextElement):[],popper:Dd(u)};var P=D$(N$([].concat(r,p.options.modifiers)));return p.orderedModifiers=P.filter(function(I){return I.enabled}),S(),y.update()},forceUpdate:function(){if(!v){var _=p.elements,k=_.reference,P=_.popper;if(gC(k,P)){p.rects={reference:R$(k,Nf(P),p.options.strategy==="fixed"),popper:Jx(P)},p.reset=!1,p.placement=p.options.placement,p.orderedModifiers.forEach(function(D){return p.modifiersData[D.name]=Object.assign({},D.data)});for(var I=0;I<p.orderedModifiers.length;I++){if(p.reset===!0){p.reset=!1,I=-1;continue}var j=p.orderedModifiers[I],E=j.fn,T=j.options,R=T===void 0?{}:T,M=j.name;typeof E=="function"&&(p=E({state:p,options:R,name:M,instance:y})||p)}}}},update:A$(function(){return new Promise(function(w){y.forceUpdate(),w(p)})}),destroy:function(){x(),v=!0}};if(!gC(l,u))return y;y.setOptions(f).then(function(w){!v&&f.onFirstUpdate&&f.onFirstUpdate(w)});function S(){p.orderedModifiers.forEach(function(w){var _=w.name,k=w.options,P=k===void 0?{}:k,I=w.effect;if(typeof I=="function"){var j=I({state:p,name:_,instance:y,options:P}),E=function(){};m.push(j||E)}})}function x(){m.forEach(function(w){return w()}),m=[]}return y}}var $$=[i$,k$,s$,Yz,C$,y$,I$,t$,b$],L$=z$({defaultModifiers:$$});function ob(e={}){const{enabled:t=!0,modifiers:n,placement:r="bottom",strategy:o="absolute",arrowPadding:s=8,eventListeners:a=!0,offset:l,gutter:u=8,flip:f=!0,boundary:p="clippingParents",preventOverflow:m=!0,matchWidth:v,direction:y="ltr"}=e,S=h.useRef(null),x=h.useRef(null),w=h.useRef(null),_=Mz(r,y),k=h.useRef(()=>{}),P=h.useCallback(()=>{var D;!t||!S.current||!x.current||((D=k.current)==null||D.call(k),w.current=L$(S.current,x.current,{placement:_,modifiers:[Oz,jz,Pz,{...kz,enabled:!!v},{name:"eventListeners",..._z(a)},{name:"arrow",options:{padding:s}},{name:"offset",options:{offset:l??[0,u]}},{name:"flip",enabled:!!f,options:{padding:8}},{name:"preventOverflow",enabled:!!m,options:{boundary:p}},...n??[]],strategy:o}),w.current.forceUpdate(),k.current=w.current.destroy)},[_,t,n,v,a,s,l,u,f,m,p,o]);h.useEffect(()=>()=>{var D;!S.current&&!x.current&&((D=w.current)==null||D.destroy(),w.current=null)},[]);const I=h.useCallback(D=>{S.current=D,P()},[P]),j=h.useCallback((D={},N=null)=>({...D,ref:yn(I,N)}),[I]),E=h.useCallback(D=>{x.current=D,P()},[P]),T=h.useCallback((D={},N=null)=>({...D,ref:yn(E,N),style:{...D.style,position:o,minWidth:v?void 0:"max-content",inset:"0 auto auto 0"}}),[o,E,v]),R=h.useCallback((D={},N=null)=>{const{size:U,shadowColor:z,bg:F,style:H,...G}=D;return{...G,ref:N,"data-popper-arrow":"",style:B$(D)}},[]),M=h.useCallback((D={},N=null)=>({...D,ref:N,"data-popper-arrow-inner":""}),[]);return{update(){var D;(D=w.current)==null||D.update()},forceUpdate(){var D;(D=w.current)==null||D.forceUpdate()},transformOrigin:Ur.transformOrigin.varRef,referenceRef:I,popperRef:E,getPopperProps:T,getArrowProps:R,getArrowInnerProps:M,getReferenceProps:j}}function B$(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 sb(e={}){const{onClose:t,onOpen:n,isOpen:r,id:o}=e,s=_r(n),a=_r(t),[l,u]=h.useState(e.defaultIsOpen||!1),f=r!==void 0?r:l,p=r!==void 0,m=h.useId(),v=o??`disclosure-${m}`,y=h.useCallback(()=>{p||u(!1),a==null||a()},[p,a]),S=h.useCallback(()=>{p||u(!0),s==null||s()},[p,s]),x=h.useCallback(()=>{f?y():S()},[f,S,y]);function w(k={}){return{...k,"aria-expanded":f,"aria-controls":v,onClick(P){var I;(I=k.onClick)==null||I.call(k,P),x()}}}function _(k={}){return{...k,hidden:!f,id:v}}return{isOpen:f,onOpen:S,onClose:y,onToggle:x,isControlled:p,getButtonProps:w,getDisclosureProps:_}}function F$(e){const{ref:t,handler:n,enabled:r=!0}=e,o=_r(n),a=h.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}).current;h.useEffect(()=>{if(!r)return;const l=m=>{X0(m,t)&&(a.isPointerDown=!0)},u=m=>{if(a.ignoreEmulatedMouseEvents){a.ignoreEmulatedMouseEvents=!1;return}a.isPointerDown&&n&&X0(m,t)&&(a.isPointerDown=!1,o(m))},f=m=>{a.ignoreEmulatedMouseEvents=!0,n&&a.isPointerDown&&X0(m,t)&&(a.isPointerDown=!1,o(m))},p=P6(t.current);return p.addEventListener("mousedown",l,!0),p.addEventListener("mouseup",u,!0),p.addEventListener("touchstart",l,!0),p.addEventListener("touchend",f,!0),()=>{p.removeEventListener("mousedown",l,!0),p.removeEventListener("mouseup",u,!0),p.removeEventListener("touchstart",l,!0),p.removeEventListener("touchend",f,!0)}},[n,t,o,a,r])}function X0(e,t){var n;const r=e.target;return r&&!P6(r).contains(r)?!1:!((n=t.current)!=null&&n.contains(r))}function P6(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function j6(e){const{isOpen:t,ref:n}=e,[r,o]=h.useState(t),[s,a]=h.useState(!1);return h.useEffect(()=>{s||(o(t),a(!0))},[t,s,r]),Vl(()=>n.current,"animationend",()=>{o(t)}),{present:!(t?!1:!r),onComplete(){var u;const f=WN(n.current),p=new f.CustomEvent("animationend",{bubbles:!0});(u=n.current)==null||u.dispatchEvent(p)}}}function ab(e){const{wasSelected:t,enabled:n,isSelected:r,mode:o="unmount"}=e;return!!(!n||r||o==="keepMounted"&&t)}var[H$,V$,W$,U$]=Tx(),[G$,zf]=Yn({strict:!1,name:"MenuContext"});function q$(e,...t){const n=h.useId(),r=e||n;return h.useMemo(()=>t.map(o=>`${o}-${r}`),[r,t])}function I6(e){var t;return(t=e==null?void 0:e.ownerDocument)!=null?t:document}function vC(e){return I6(e).activeElement===e}function Y$(e={}){const{id:t,closeOnSelect:n=!0,closeOnBlur:r=!0,initialFocusRef:o,autoSelect:s=!0,isLazy:a,isOpen:l,defaultIsOpen:u,onClose:f,onOpen:p,placement:m="bottom-start",lazyBehavior:v="unmount",direction:y,computePositionOnMount:S=!1,...x}=e,w=h.useRef(null),_=h.useRef(null),k=W$(),P=h.useCallback(()=>{requestAnimationFrame(()=>{var oe;(oe=w.current)==null||oe.focus({preventScroll:!1})})},[]),I=h.useCallback(()=>{const oe=setTimeout(()=>{var X;if(o)(X=o.current)==null||X.focus();else{const Q=k.firstEnabled();Q&&z(Q.index)}});L.current.add(oe)},[k,o]),j=h.useCallback(()=>{const oe=setTimeout(()=>{const X=k.lastEnabled();X&&z(X.index)});L.current.add(oe)},[k]),E=h.useCallback(()=>{p==null||p(),s?I():P()},[s,I,P,p]),{isOpen:T,onOpen:R,onClose:M,onToggle:D}=sb({isOpen:l,defaultIsOpen:u,onClose:f,onOpen:E});F$({enabled:T&&r,ref:w,handler:oe=>{var X;(X=_.current)!=null&&X.contains(oe.target)||M()}});const N=ob({...x,enabled:T||S,placement:m,direction:y}),[U,z]=h.useState(-1);Ci(()=>{T||z(-1)},[T]),g6(w,{focusRef:_,visible:T,shouldFocus:!0});const F=j6({isOpen:T,ref:w}),[H,G]=q$(t,"menu-button","menu-list"),A=h.useCallback(()=>{R(),P()},[R,P]),L=h.useRef(new Set([]));nL(()=>{L.current.forEach(oe=>clearTimeout(oe)),L.current.clear()});const W=h.useCallback(()=>{R(),I()},[I,R]),V=h.useCallback(()=>{R(),j()},[R,j]),ee=h.useCallback(()=>{var oe,X;const Q=I6(w.current),ie=(oe=w.current)==null?void 0:oe.contains(Q.activeElement);if(!(T&&!ie))return;const ye=(X=k.item(U))==null?void 0:X.node;ye==null||ye.focus()},[T,U,k]),le=h.useRef(null);return{openAndFocusMenu:A,openAndFocusFirstItem:W,openAndFocusLastItem:V,onTransitionEnd:ee,unstable__animationState:F,descendants:k,popper:N,buttonId:H,menuId:G,forceUpdate:N.forceUpdate,orientation:"vertical",isOpen:T,onToggle:D,onOpen:R,onClose:M,menuRef:w,buttonRef:_,focusedIndex:U,closeOnSelect:n,closeOnBlur:r,autoSelect:s,setFocusedIndex:z,isLazy:a,lazyBehavior:v,initialFocusRef:o,rafId:le}}function K$(e={},t=null){const n=zf(),{onToggle:r,popper:o,openAndFocusFirstItem:s,openAndFocusLastItem:a}=n,l=h.useCallback(u=>{const f=u.key,m={Enter:s,ArrowDown:s,ArrowUp:a}[f];m&&(u.preventDefault(),u.stopPropagation(),m(u))},[s,a]);return{...e,ref:yn(n.buttonRef,t,o.referenceRef),id:n.buttonId,"data-active":ln(n.isOpen),"aria-expanded":n.isOpen,"aria-haspopup":"menu","aria-controls":n.menuId,onClick:at(e.onClick,r),onKeyDown:at(e.onKeyDown,l)}}function hy(e){var t;return eL(e)&&!!((t=e==null?void 0:e.getAttribute("role"))!=null&&t.startsWith("menuitem"))}function X$(e={},t=null){const n=zf();if(!n)throw new Error("useMenuContext: context is undefined. Seems you forgot to wrap component within <Menu>");const{focusedIndex:r,setFocusedIndex:o,menuRef:s,isOpen:a,onClose:l,menuId:u,isLazy:f,lazyBehavior:p,unstable__animationState:m}=n,v=V$(),y=hz({preventDefault:_=>_.key!==" "&&hy(_.target)}),S=h.useCallback(_=>{if(!_.currentTarget.contains(_.target))return;const k=_.key,I={Tab:E=>E.preventDefault(),Escape:l,ArrowDown:()=>{const E=v.nextEnabled(r);E&&o(E.index)},ArrowUp:()=>{const E=v.prevEnabled(r);E&&o(E.index)}}[k];if(I){_.preventDefault(),I(_);return}const j=y(E=>{const T=mz(v.values(),E,R=>{var M,D;return(D=(M=R==null?void 0:R.node)==null?void 0:M.textContent)!=null?D:""},v.item(r));if(T){const R=v.indexOf(T.node);o(R)}});hy(_.target)&&j(_)},[v,r,y,l,o]),x=h.useRef(!1);a&&(x.current=!0);const w=ab({wasSelected:x.current,enabled:f,mode:p,isSelected:m.present});return{...e,ref:yn(s,t),children:w?e.children:null,tabIndex:-1,role:"menu",id:u,style:{...e.style,transformOrigin:"var(--popper-transform-origin)"},"aria-orientation":"vertical",onKeyDown:at(e.onKeyDown,S)}}function Z$(e={}){const{popper:t,isOpen:n}=zf();return t.getPopperProps({...e,style:{visibility:n?"visible":"hidden",...e.style}})}function E6(e={},t=null){const{onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onClick:s,onFocus:a,isDisabled:l,isFocusable:u,closeOnSelect:f,type:p,...m}=e,v=zf(),{setFocusedIndex:y,focusedIndex:S,closeOnSelect:x,onClose:w,menuRef:_,isOpen:k,menuId:P,rafId:I}=v,j=h.useRef(null),E=`${P}-menuitem-${h.useId()}`,{index:T,register:R}=U$({disabled:l&&!u}),M=h.useCallback(A=>{n==null||n(A),!l&&y(T)},[y,T,l,n]),D=h.useCallback(A=>{r==null||r(A),j.current&&!vC(j.current)&&M(A)},[M,r]),N=h.useCallback(A=>{o==null||o(A),!l&&y(-1)},[y,l,o]),U=h.useCallback(A=>{s==null||s(A),hy(A.currentTarget)&&(f??x)&&w()},[w,s,x,f]),z=h.useCallback(A=>{a==null||a(A),y(T)},[y,a,T]),F=T===S,H=l&&!u;Ci(()=>{k&&(F&&!H&&j.current?(I.current&&cancelAnimationFrame(I.current),I.current=requestAnimationFrame(()=>{var A;(A=j.current)==null||A.focus(),I.current=null})):_.current&&!vC(_.current)&&_.current.focus({preventScroll:!0}))},[F,H,_,k]);const G=m6({onClick:U,onFocus:z,onMouseEnter:M,onMouseMove:D,onMouseLeave:N,ref:yn(R,j,t),isDisabled:l,isFocusable:u});return{...m,...G,type:p??G.type,id:E,role:"menuitem",tabIndex:F?0:-1}}function Q$(e={},t=null){const{type:n="radio",isChecked:r,...o}=e;return{...E6(o,t),role:`menuitem${n}`,"aria-checked":r}}function J$(e={}){const{children:t,type:n="radio",value:r,defaultValue:o,onChange:s,...a}=e,u=n==="radio"?"":[],[f,p]=zu({defaultValue:o??u,value:r,onChange:s}),m=h.useCallback(S=>{if(n==="radio"&&typeof f=="string"&&p(S),n==="checkbox"&&Array.isArray(f)){const x=f.includes(S)?f.filter(w=>w!==S):f.concat(S);p(x)}},[f,p,n]),y=Rf(t).map(S=>{if(S.type.id!=="MenuItemOption")return S;const x=_=>{var k,P;m(S.props.value),(P=(k=S.props).onClick)==null||P.call(k,_)},w=n==="radio"?S.props.value===f:f.includes(S.props.value);return h.cloneElement(S,{type:n,onClick:x,isChecked:w})});return{...a,children:y}}function eL(e){var t;if(!tL(e))return!1;const n=(t=e.ownerDocument.defaultView)!=null?t:window;return e instanceof n.HTMLElement}function tL(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function nL(e,t=[]){return h.useEffect(()=>()=>e(),t)}var[rL,$f]=Yn({name:"MenuStylesContext",errorMessage:`useMenuStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Menu />" `}),Mg=e=>{const{children:t}=e,n=to("Menu",e),r=ur(e),{direction:o}=Au(),{descendants:s,...a}=Y$({...r,direction:o}),l=h.useMemo(()=>a,[a]),{isOpen:u,onClose:f,forceUpdate:p}=l;return i.jsx(H$,{value:s,children:i.jsx(G$,{value:l,children:i.jsx(rL,{value:n,children:gx(t,{isOpen:u,onClose:f,forceUpdate:p})})})})};Mg.displayName="Menu";var O6=Be((e,t)=>{const n=$f();return i.jsx(Oe.span,{ref:t,...e,__css:n.command,className:"chakra-menu__command"})});O6.displayName="MenuCommand";var T6=Be((e,t)=>{const{type:n,...r}=e,o=$f(),s=r.as||n?n??void 0:"button",a=h.useMemo(()=>({textDecoration:"none",color:"inherit",userSelect:"none",display:"flex",width:"100%",alignItems:"center",textAlign:"start",flex:"0 0 auto",outline:0,...o.item}),[o.item]);return i.jsx(Oe.button,{ref:t,type:s,...r,__css:a})}),ib=e=>{const{className:t,children:n,...r}=e,o=h.Children.only(n),s=h.isValidElement(o)?h.cloneElement(o,{focusable:"false","aria-hidden":!0,className:Ot("chakra-menu__icon",o.props.className)}):null,a=Ot("chakra-menu__icon-wrapper",t);return i.jsx(Oe.span,{className:a,...r,__css:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:s})};ib.displayName="MenuIcon";var os=Be((e,t)=>{const{icon:n,iconSpacing:r="0.75rem",command:o,commandSpacing:s="0.75rem",children:a,...l}=e,u=E6(l,t),p=n||o?i.jsx("span",{style:{pointerEvents:"none",flex:1},children:a}):a;return i.jsxs(T6,{...u,className:Ot("chakra-menu__menuitem",u.className),children:[n&&i.jsx(ib,{fontSize:"0.8em",marginEnd:r,children:n}),p,o&&i.jsx(O6,{marginStart:s,children:o})]})});os.displayName="MenuItem";var oL={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"}}},sL=Oe(zo.div),Lf=Be(function(t,n){var r,o;const{rootProps:s,motionProps:a,...l}=t,{isOpen:u,onTransitionEnd:f,unstable__animationState:p}=zf(),m=X$(l,n),v=Z$(s),y=$f();return i.jsx(Oe.div,{...v,__css:{zIndex:(o=t.zIndex)!=null?o:(r=y.list)==null?void 0:r.zIndex},children:i.jsx(sL,{variants:oL,initial:!1,animate:u?"enter":"exit",__css:{outline:0,...y.list},...a,className:Ot("chakra-menu__menu-list",m.className),...m,onUpdate:f,onAnimationComplete:bg(p.onComplete,m.onAnimationComplete)})})});Lf.displayName="MenuList";var R6=Be((e,t)=>{const{title:n,children:r,className:o,...s}=e,a=Ot("chakra-menu__group__title",o),l=$f();return i.jsxs("div",{ref:t,className:"chakra-menu__group",role:"group",children:[n&&i.jsx(Oe.p,{className:a,...s,__css:l.groupTitle,children:n}),r]})});R6.displayName="MenuGroup";var lb=e=>{const{className:t,title:n,...r}=e,o=J$(r);return i.jsx(R6,{title:n,className:Ot("chakra-menu__option-group",t),...o})};lb.displayName="MenuOptionGroup";var aL=Be((e,t)=>{const n=$f();return i.jsx(Oe.button,{ref:t,...e,__css:{display:"inline-flex",appearance:"none",alignItems:"center",outline:0,...n.button}})}),Dg=Be((e,t)=>{const{children:n,as:r,...o}=e,s=K$(o,t),a=r||aL;return i.jsx(a,{...s,className:Ot("chakra-menu__menu-button",e.className),children:i.jsx(Oe.span,{__css:{pointerEvents:"none",flex:"1 1 auto",minW:0},children:e.children})})});Dg.displayName="MenuButton";var iL=e=>i.jsx("svg",{viewBox:"0 0 14 14",width:"1em",height:"1em",...e,children:i.jsx("polygon",{fill:"currentColor",points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"})}),Kd=Be((e,t)=>{const{icon:n,iconSpacing:r="0.75rem",...o}=e,s=Q$(o,t);return i.jsxs(T6,{...s,className:Ot("chakra-menu__menuitem-option",o.className),children:[n!==null&&i.jsx(ib,{fontSize:"0.8em",marginEnd:r,opacity:e.isChecked?1:0,children:n||i.jsx(iL,{})}),i.jsx("span",{style:{flex:1},children:s.children})]})});Kd.id="MenuItemOption";Kd.displayName="MenuItemOption";var lL={slideInBottom:{...ty,custom:{offsetY:16,reverse:!0}},slideInRight:{...ty,custom:{offsetX:16,reverse:!0}},scale:{...oP,custom:{initialScale:.95,reverse:!0}},none:{}},cL=Oe(zo.section),uL=e=>lL[e||"none"],M6=h.forwardRef((e,t)=>{const{preset:n,motionProps:r=uL(n),...o}=e;return i.jsx(cL,{ref:t,...r,...o})});M6.displayName="ModalTransition";var dL=Object.defineProperty,fL=(e,t,n)=>t in e?dL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pL=(e,t,n)=>(fL(e,typeof t!="symbol"?t+"":t,n),n),hL=class{constructor(){pL(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}},my=new hL;function D6(e,t){const[n,r]=h.useState(0);return h.useEffect(()=>{const o=e.current;if(o){if(t){const s=my.add(o);r(s)}return()=>{my.remove(o),r(0)}}},[t,e]),n}var mL=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ac=new WeakMap,$p=new WeakMap,Lp={},Z0=0,A6=function(e){return e&&(e.host||A6(e.parentNode))},gL=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=A6(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},vL=function(e,t,n,r){var o=gL(t,Array.isArray(e)?e:[e]);Lp[n]||(Lp[n]=new WeakMap);var s=Lp[n],a=[],l=new Set,u=new Set(o),f=function(m){!m||l.has(m)||(l.add(m),f(m.parentNode))};o.forEach(f);var p=function(m){!m||u.has(m)||Array.prototype.forEach.call(m.children,function(v){if(l.has(v))p(v);else{var y=v.getAttribute(r),S=y!==null&&y!=="false",x=(Ac.get(v)||0)+1,w=(s.get(v)||0)+1;Ac.set(v,x),s.set(v,w),a.push(v),x===1&&S&&$p.set(v,!0),w===1&&v.setAttribute(n,"true"),S||v.setAttribute(r,"true")}})};return p(t),l.clear(),Z0++,function(){a.forEach(function(m){var v=Ac.get(m)-1,y=s.get(m)-1;Ac.set(m,v),s.set(m,y),v||($p.has(m)||m.removeAttribute(r),$p.delete(m)),y||m.removeAttribute(n)}),Z0--,Z0||(Ac=new WeakMap,Ac=new WeakMap,$p=new WeakMap,Lp={})}},yL=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||mL(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),vL(r,o,n,"aria-hidden")):function(){return null}};function xL(e){const{isOpen:t,onClose:n,id:r,closeOnOverlayClick:o=!0,closeOnEsc:s=!0,useInert:a=!0,onOverlayClick:l,onEsc:u}=e,f=h.useRef(null),p=h.useRef(null),[m,v,y]=wL(r,"chakra-modal","chakra-modal--header","chakra-modal--body");bL(f,t&&a);const S=D6(f,t),x=h.useRef(null),w=h.useCallback(M=>{x.current=M.target},[]),_=h.useCallback(M=>{M.key==="Escape"&&(M.stopPropagation(),s&&(n==null||n()),u==null||u())},[s,n,u]),[k,P]=h.useState(!1),[I,j]=h.useState(!1),E=h.useCallback((M={},D=null)=>({role:"dialog",...M,ref:yn(D,f),id:m,tabIndex:-1,"aria-modal":!0,"aria-labelledby":k?v:void 0,"aria-describedby":I?y:void 0,onClick:at(M.onClick,N=>N.stopPropagation())}),[y,I,m,v,k]),T=h.useCallback(M=>{M.stopPropagation(),x.current===M.target&&my.isTopModal(f.current)&&(o&&(n==null||n()),l==null||l())},[n,o,l]),R=h.useCallback((M={},D=null)=>({...M,ref:yn(D,p),onClick:at(M.onClick,T),onKeyDown:at(M.onKeyDown,_),onMouseDown:at(M.onMouseDown,w)}),[_,w,T]);return{isOpen:t,onClose:n,headerId:v,bodyId:y,setBodyMounted:j,setHeaderMounted:P,dialogRef:f,overlayRef:p,getDialogProps:E,getDialogContainerProps:R,index:S}}function bL(e,t){const n=e.current;h.useEffect(()=>{if(!(!e.current||!t))return yL(e.current)},[t,e,n])}function wL(e,...t){const n=h.useId(),r=e||n;return h.useMemo(()=>t.map(o=>`${o}-${r}`),[r,t])}var[SL,Hu]=Yn({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Modal />" `}),[CL,ec]=Yn({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in `<Modal />`"}),tl=e=>{const t={scrollBehavior:"outside",autoFocus:!0,trapFocus:!0,returnFocusOnClose:!0,blockScrollOnMount:!0,allowPinchZoom:!1,motionPreset:"scale",lockFocusAcrossFrames:!0,...e},{portalProps:n,children:r,autoFocus:o,trapFocus:s,initialFocusRef:a,finalFocusRef:l,returnFocusOnClose:u,blockScrollOnMount:f,allowPinchZoom:p,preserveScrollBarGap:m,motionPreset:v,lockFocusAcrossFrames:y,onCloseComplete:S}=t,x=to("Modal",t),_={...xL(t),autoFocus:o,trapFocus:s,initialFocusRef:a,finalFocusRef:l,returnFocusOnClose:u,blockScrollOnMount:f,allowPinchZoom:p,preserveScrollBarGap:m,motionPreset:v,lockFocusAcrossFrames:y};return i.jsx(CL,{value:_,children:i.jsx(SL,{value:x,children:i.jsx(Co,{onExitComplete:S,children:_.isOpen&&i.jsx(Fd,{...n,children:r})})})})};tl.displayName="Modal";var Ih="right-scroll-bar-position",Eh="width-before-scroll-bar",_L="with-scroll-bars-hidden",kL="--removed-body-scroll-bar-size",N6=TP(),Q0=function(){},Ag=h.forwardRef(function(e,t){var n=h.useRef(null),r=h.useState({onScrollCapture:Q0,onWheelCapture:Q0,onTouchMoveCapture:Q0}),o=r[0],s=r[1],a=e.forwardProps,l=e.children,u=e.className,f=e.removeScrollBar,p=e.enabled,m=e.shards,v=e.sideCar,y=e.noIsolation,S=e.inert,x=e.allowPinchZoom,w=e.as,_=w===void 0?"div":w,k=e.gapMode,P=IP(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),I=v,j=jP([n,t]),E=za(za({},P),o);return h.createElement(h.Fragment,null,p&&h.createElement(I,{sideCar:N6,removeScrollBar:f,shards:m,noIsolation:y,inert:S,setCallbacks:s,allowPinchZoom:!!x,lockRef:n,gapMode:k}),a?h.cloneElement(h.Children.only(l),za(za({},E),{ref:j})):h.createElement(_,za({},E,{className:u,ref:j}),l))});Ag.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ag.classNames={fullWidth:Eh,zeroRight:Ih};var yC,PL=function(){if(yC)return yC;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function jL(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=PL();return t&&e.setAttribute("nonce",t),e}function IL(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function EL(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var OL=function(){var e=0,t=null;return{add:function(n){e==0&&(t=jL())&&(IL(t,n),EL(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},TL=function(){var e=OL();return function(t,n){h.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},z6=function(){var e=TL(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},RL={left:0,top:0,right:0,gap:0},J0=function(e){return parseInt(e||"",10)||0},ML=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[J0(n),J0(r),J0(o)]},DL=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return RL;var t=ML(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])}},AL=z6(),NL=function(e,t,n,r){var o=e.left,s=e.top,a=e.right,l=e.gap;return n===void 0&&(n="margin"),`
.`.concat(_L,` {
overflow: hidden `).concat(r,`;
padding-right: `).concat(l,"px ").concat(r,`;
}
body {
overflow: hidden `).concat(r,`;
overscroll-behavior: contain;
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
padding-left: `.concat(o,`px;
padding-top: `).concat(s,`px;
padding-right: `).concat(a,`px;
margin-left:0;
margin-top:0;
margin-right: `).concat(l,"px ").concat(r,`;
`),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
}
.`).concat(Ih,` {
right: `).concat(l,"px ").concat(r,`;
}
.`).concat(Eh,` {
margin-right: `).concat(l,"px ").concat(r,`;
}
.`).concat(Ih," .").concat(Ih,` {
right: 0 `).concat(r,`;
}
.`).concat(Eh," .").concat(Eh,` {
margin-right: 0 `).concat(r,`;
}
body {
`).concat(kL,": ").concat(l,`px;
}
`)},zL=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,s=h.useMemo(function(){return DL(o)},[o]);return h.createElement(AL,{styles:NL(s,!t,o,n?"":"!important")})},gy=!1;if(typeof window<"u")try{var Bp=Object.defineProperty({},"passive",{get:function(){return gy=!0,!0}});window.addEventListener("test",Bp,Bp),window.removeEventListener("test",Bp,Bp)}catch{gy=!1}var Nc=gy?{passive:!1}:!1,$L=function(e){return e.tagName==="TEXTAREA"},$6=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!$L(e)&&n[t]==="visible")},LL=function(e){return $6(e,"overflowY")},BL=function(e){return $6(e,"overflowX")},xC=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=L6(e,r);if(o){var s=B6(e,r),a=s[1],l=s[2];if(a>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},FL=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},HL=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},L6=function(e,t){return e==="v"?LL(t):BL(t)},B6=function(e,t){return e==="v"?FL(t):HL(t)},VL=function(e,t){return e==="h"&&t==="rtl"?-1:1},WL=function(e,t,n,r,o){var s=VL(e,window.getComputedStyle(t).direction),a=s*r,l=n.target,u=t.contains(l),f=!1,p=a>0,m=0,v=0;do{var y=B6(e,l),S=y[0],x=y[1],w=y[2],_=x-w-s*S;(S||_)&&L6(e,l)&&(m+=_,v+=S),l=l.parentNode}while(!u&&l!==document.body||u&&(t.contains(l)||t===l));return(p&&(o&&m===0||!o&&a>m)||!p&&(o&&v===0||!o&&-a>v))&&(f=!0),f},Fp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},bC=function(e){return[e.deltaX,e.deltaY]},wC=function(e){return e&&"current"in e?e.current:e},UL=function(e,t){return e[0]===t[0]&&e[1]===t[1]},GL=function(e){return`
.block-interactivity-`.concat(e,` {pointer-events: none;}
.allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},qL=0,zc=[];function YL(e){var t=h.useRef([]),n=h.useRef([0,0]),r=h.useRef(),o=h.useState(qL++)[0],s=h.useState(z6)[0],a=h.useRef(e);h.useEffect(function(){a.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var x=ly([e.lockRef.current],(e.shards||[]).map(wC),!0).filter(Boolean);return x.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),x.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=h.useCallback(function(x,w){if("touches"in x&&x.touches.length===2)return!a.current.allowPinchZoom;var _=Fp(x),k=n.current,P="deltaX"in x?x.deltaX:k[0]-_[0],I="deltaY"in x?x.deltaY:k[1]-_[1],j,E=x.target,T=Math.abs(P)>Math.abs(I)?"h":"v";if("touches"in x&&T==="h"&&E.type==="range")return!1;var R=xC(T,E);if(!R)return!0;if(R?j=T:(j=T==="v"?"h":"v",R=xC(T,E)),!R)return!1;if(!r.current&&"changedTouches"in x&&(P||I)&&(r.current=j),!j)return!0;var M=r.current||j;return WL(M,w,x,M==="h"?P:I,!0)},[]),u=h.useCallback(function(x){var w=x;if(!(!zc.length||zc[zc.length-1]!==s)){var _="deltaY"in w?bC(w):Fp(w),k=t.current.filter(function(j){return j.name===w.type&&j.target===w.target&&UL(j.delta,_)})[0];if(k&&k.should){w.cancelable&&w.preventDefault();return}if(!k){var P=(a.current.shards||[]).map(wC).filter(Boolean).filter(function(j){return j.contains(w.target)}),I=P.length>0?l(w,P[0]):!a.current.noIsolation;I&&w.cancelable&&w.preventDefault()}}},[]),f=h.useCallback(function(x,w,_,k){var P={name:x,delta:w,target:_,should:k};t.current.push(P),setTimeout(function(){t.current=t.current.filter(function(I){return I!==P})},1)},[]),p=h.useCallback(function(x){n.current=Fp(x),r.current=void 0},[]),m=h.useCallback(function(x){f(x.type,bC(x),x.target,l(x,e.lockRef.current))},[]),v=h.useCallback(function(x){f(x.type,Fp(x),x.target,l(x,e.lockRef.current))},[]);h.useEffect(function(){return zc.push(s),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:v}),document.addEventListener("wheel",u,Nc),document.addEventListener("touchmove",u,Nc),document.addEventListener("touchstart",p,Nc),function(){zc=zc.filter(function(x){return x!==s}),document.removeEventListener("wheel",u,Nc),document.removeEventListener("touchmove",u,Nc),document.removeEventListener("touchstart",p,Nc)}},[]);var y=e.removeScrollBar,S=e.inert;return h.createElement(h.Fragment,null,S?h.createElement(s,{styles:GL(o)}):null,y?h.createElement(zL,{gapMode:e.gapMode}):null)}const KL=qA(N6,YL);var F6=h.forwardRef(function(e,t){return h.createElement(Ag,za({},e,{ref:t,sideCar:KL}))});F6.classNames=Ag.classNames;const XL=F6;function ZL(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:o,blockScrollOnMount:s,allowPinchZoom:a,finalFocusRef:l,returnFocusOnClose:u,preserveScrollBarGap:f,lockFocusAcrossFrames:p,isOpen:m}=ec(),[v,y]=oM();h.useEffect(()=>{!v&&y&&setTimeout(y)},[v,y]);const S=D6(r,m);return i.jsx(c6,{autoFocus:t,isDisabled:!n,initialFocusRef:o,finalFocusRef:l,restoreFocus:u,contentRef:r,lockFocusAcrossFrames:p,children:i.jsx(XL,{removeScrollBar:!f,allowPinchZoom:a,enabled:S===1&&s,forwardProps:!0,children:e.children})})}var nl=Be((e,t)=>{const{className:n,children:r,containerProps:o,motionProps:s,...a}=e,{getDialogProps:l,getDialogContainerProps:u}=ec(),f=l(a,t),p=u(o),m=Ot("chakra-modal__content",n),v=Hu(),y={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...v.dialog},S={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...v.dialogContainer},{motionPreset:x}=ec();return i.jsx(ZL,{children:i.jsx(Oe.div,{...p,className:"chakra-modal__content-container",tabIndex:-1,__css:S,children:i.jsx(M6,{preset:x,motionProps:s,className:m,...f,__css:y,children:r})})})});nl.displayName="ModalContent";function Ng(e){const{leastDestructiveRef:t,...n}=e;return i.jsx(tl,{...n,initialFocusRef:t})}var zg=Be((e,t)=>i.jsx(nl,{ref:t,role:"alertdialog",...e})),ga=Be((e,t)=>{const{className:n,...r}=e,o=Ot("chakra-modal__footer",n),a={display:"flex",alignItems:"center",justifyContent:"flex-end",...Hu().footer};return i.jsx(Oe.footer,{ref:t,...r,__css:a,className:o})});ga.displayName="ModalFooter";var va=Be((e,t)=>{const{className:n,...r}=e,{headerId:o,setHeaderMounted:s}=ec();h.useEffect(()=>(s(!0),()=>s(!1)),[s]);const a=Ot("chakra-modal__header",n),u={flex:0,...Hu().header};return i.jsx(Oe.header,{ref:t,className:a,id:o,...r,__css:u})});va.displayName="ModalHeader";var QL=Oe(zo.div),ya=Be((e,t)=>{const{className:n,transition:r,motionProps:o,...s}=e,a=Ot("chakra-modal__overlay",n),u={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...Hu().overlay},{motionPreset:f}=ec(),m=o||(f==="none"?{}:rP);return i.jsx(QL,{...m,__css:u,ref:t,className:a,...s})});ya.displayName="ModalOverlay";var xa=Be((e,t)=>{const{className:n,...r}=e,{bodyId:o,setBodyMounted:s}=ec();h.useEffect(()=>(s(!0),()=>s(!1)),[s]);const a=Ot("chakra-modal__body",n),l=Hu();return i.jsx(Oe.div,{ref:t,className:a,id:o,...r,__css:l.body})});xa.displayName="ModalBody";var Vu=Be((e,t)=>{const{onClick:n,className:r,...o}=e,{onClose:s}=ec(),a=Ot("chakra-modal__close-btn",r),l=Hu();return i.jsx(sM,{ref:t,__css:l.closeButton,className:a,onClick:at(n,u=>{u.stopPropagation(),s()}),...o})});Vu.displayName="ModalCloseButton";var JL=e=>i.jsx(uo,{viewBox:"0 0 24 24",...e,children:i.jsx("path",{fill:"currentColor",d:"M21,5H3C2.621,5,2.275,5.214,2.105,5.553C1.937,5.892,1.973,6.297,2.2,6.6l9,12 c0.188,0.252,0.485,0.4,0.8,0.4s0.611-0.148,0.8-0.4l9-12c0.228-0.303,0.264-0.708,0.095-1.047C21.725,5.214,21.379,5,21,5z"})}),eB=e=>i.jsx(uo,{viewBox:"0 0 24 24",...e,children:i.jsx("path",{fill:"currentColor",d:"M12.8,5.4c-0.377-0.504-1.223-0.504-1.6,0l-9,12c-0.228,0.303-0.264,0.708-0.095,1.047 C2.275,18.786,2.621,19,3,19h18c0.379,0,0.725-0.214,0.895-0.553c0.169-0.339,0.133-0.744-0.095-1.047L12.8,5.4z"})});function SC(e,t,n,r){h.useEffect(()=>{var o;if(!e.current||!r)return;const s=(o=e.current.ownerDocument.defaultView)!=null?o:window,a=Array.isArray(t)?t:[t],l=new s.MutationObserver(u=>{for(const f of u)f.type==="attributes"&&f.attributeName&&a.includes(f.attributeName)&&n(f)});return l.observe(e.current,{attributes:!0,attributeFilter:a}),()=>l.disconnect()})}function tB(e,t){const n=_r(e);h.useEffect(()=>{let r=null;const o=()=>n();return t!==null&&(r=window.setInterval(o,t)),()=>{r&&window.clearInterval(r)}},[t,n])}var nB=50,CC=300;function rB(e,t){const[n,r]=h.useState(!1),[o,s]=h.useState(null),[a,l]=h.useState(!0),u=h.useRef(null),f=()=>clearTimeout(u.current);tB(()=>{o==="increment"&&e(),o==="decrement"&&t()},n?nB:null);const p=h.useCallback(()=>{a&&e(),u.current=setTimeout(()=>{l(!1),r(!0),s("increment")},CC)},[e,a]),m=h.useCallback(()=>{a&&t(),u.current=setTimeout(()=>{l(!1),r(!0),s("decrement")},CC)},[t,a]),v=h.useCallback(()=>{l(!0),r(!1),f()},[]);return h.useEffect(()=>()=>f(),[]),{up:p,down:m,stop:v,isSpinning:n}}var oB=/^[Ee0-9+\-.]$/;function sB(e){return oB.test(e)}function aB(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 iB(e={}){const{focusInputOnChange:t=!0,clampValueOnBlur:n=!0,keepWithinRange:r=!0,min:o=Number.MIN_SAFE_INTEGER,max:s=Number.MAX_SAFE_INTEGER,step:a=1,isReadOnly:l,isDisabled:u,isRequired:f,isInvalid:p,pattern:m="[0-9]*(.[0-9]+)?",inputMode:v="decimal",allowMouseWheel:y,id:S,onChange:x,precision:w,name:_,"aria-describedby":k,"aria-label":P,"aria-labelledby":I,onFocus:j,onBlur:E,onInvalid:T,getAriaValueText:R,isValidCharacter:M,format:D,parse:N,...U}=e,z=_r(j),F=_r(E),H=_r(T),G=_r(M??sB),A=_r(R),L=jA(e),{update:W,increment:V,decrement:ee}=L,[le,oe]=h.useState(!1),X=!(l||u),Q=h.useRef(null),ie=h.useRef(null),ve=h.useRef(null),ye=h.useRef(null),se=h.useCallback(ge=>ge.split("").filter(G).join(""),[G]),de=h.useCallback(ge=>{var ut;return(ut=N==null?void 0:N(ge))!=null?ut:ge},[N]),fe=h.useCallback(ge=>{var ut;return((ut=D==null?void 0:D(ge))!=null?ut:ge).toString()},[D]);Ci(()=>{(L.valueAsNumber>s||L.valueAsNumber<o)&&(H==null||H("rangeOverflow",fe(L.value),L.valueAsNumber))},[L.valueAsNumber,L.value,fe,H]),Jc(()=>{if(!Q.current)return;if(Q.current.value!=L.value){const ut=de(Q.current.value);L.setValue(se(ut))}},[de,se]);const xe=h.useCallback((ge=a)=>{X&&V(ge)},[V,X,a]),ke=h.useCallback((ge=a)=>{X&&ee(ge)},[ee,X,a]),ae=rB(xe,ke);SC(ve,"disabled",ae.stop,ae.isSpinning),SC(ye,"disabled",ae.stop,ae.isSpinning);const Pe=h.useCallback(ge=>{if(ge.nativeEvent.isComposing)return;const Rt=de(ge.currentTarget.value);W(se(Rt)),ie.current={start:ge.currentTarget.selectionStart,end:ge.currentTarget.selectionEnd}},[W,se,de]),tt=h.useCallback(ge=>{var ut,Rt,en;z==null||z(ge),ie.current&&(ge.target.selectionStart=(Rt=ie.current.start)!=null?Rt:(ut=ge.currentTarget.value)==null?void 0:ut.length,ge.currentTarget.selectionEnd=(en=ie.current.end)!=null?en:ge.currentTarget.selectionStart)},[z]),ze=h.useCallback(ge=>{if(ge.nativeEvent.isComposing)return;aB(ge,G)||ge.preventDefault();const ut=We(ge)*a,Rt=ge.key,$e={ArrowUp:()=>xe(ut),ArrowDown:()=>ke(ut),Home:()=>W(o),End:()=>W(s)}[Rt];$e&&(ge.preventDefault(),$e(ge))},[G,a,xe,ke,W,o,s]),We=ge=>{let ut=1;return(ge.metaKey||ge.ctrlKey)&&(ut=.1),ge.shiftKey&&(ut=10),ut},It=h.useMemo(()=>{const ge=A==null?void 0:A(L.value);if(ge!=null)return ge;const ut=L.value.toString();return ut||void 0},[L.value,A]),pt=h.useCallback(()=>{let ge=L.value;if(L.value==="")return;/^[eE]/.test(L.value.toString())?L.setValue(""):(L.valueAsNumber<o&&(ge=o),L.valueAsNumber>s&&(ge=s),L.cast(ge))},[L,s,o]),bn=h.useCallback(()=>{oe(!1),n&&pt()},[n,oe,pt]),Y=h.useCallback(()=>{t&&requestAnimationFrame(()=>{var ge;(ge=Q.current)==null||ge.focus()})},[t]),Se=h.useCallback(ge=>{ge.preventDefault(),ae.up(),Y()},[Y,ae]),ne=h.useCallback(ge=>{ge.preventDefault(),ae.down(),Y()},[Y,ae]);Vl(()=>Q.current,"wheel",ge=>{var ut,Rt;const $e=((Rt=(ut=Q.current)==null?void 0:ut.ownerDocument)!=null?Rt:document).activeElement===Q.current;if(!y||!$e)return;ge.preventDefault();const Xe=We(ge)*a,On=Math.sign(ge.deltaY);On===-1?xe(Xe):On===1&&ke(Xe)},{passive:!1});const he=h.useCallback((ge={},ut=null)=>{const Rt=u||r&&L.isAtMax;return{...ge,ref:yn(ut,ve),role:"button",tabIndex:-1,onPointerDown:at(ge.onPointerDown,en=>{en.button!==0||Rt||Se(en)}),onPointerLeave:at(ge.onPointerLeave,ae.stop),onPointerUp:at(ge.onPointerUp,ae.stop),disabled:Rt,"aria-disabled":Ds(Rt)}},[L.isAtMax,r,Se,ae.stop,u]),Re=h.useCallback((ge={},ut=null)=>{const Rt=u||r&&L.isAtMin;return{...ge,ref:yn(ut,ye),role:"button",tabIndex:-1,onPointerDown:at(ge.onPointerDown,en=>{en.button!==0||Rt||ne(en)}),onPointerLeave:at(ge.onPointerLeave,ae.stop),onPointerUp:at(ge.onPointerUp,ae.stop),disabled:Rt,"aria-disabled":Ds(Rt)}},[L.isAtMin,r,ne,ae.stop,u]),Ke=h.useCallback((ge={},ut=null)=>{var Rt,en,$e,Xe;return{name:_,inputMode:v,type:"text",pattern:m,"aria-labelledby":I,"aria-label":P,"aria-describedby":k,id:S,disabled:u,...ge,readOnly:(Rt=ge.readOnly)!=null?Rt:l,"aria-readonly":(en=ge.readOnly)!=null?en:l,"aria-required":($e=ge.required)!=null?$e:f,required:(Xe=ge.required)!=null?Xe:f,ref:yn(Q,ut),value:fe(L.value),role:"spinbutton","aria-valuemin":o,"aria-valuemax":s,"aria-valuenow":Number.isNaN(L.valueAsNumber)?void 0:L.valueAsNumber,"aria-invalid":Ds(p??L.isOutOfRange),"aria-valuetext":It,autoComplete:"off",autoCorrect:"off",onChange:at(ge.onChange,Pe),onKeyDown:at(ge.onKeyDown,ze),onFocus:at(ge.onFocus,tt,()=>oe(!0)),onBlur:at(ge.onBlur,F,bn)}},[_,v,m,I,P,fe,k,S,u,f,l,p,L.value,L.valueAsNumber,L.isOutOfRange,o,s,It,Pe,ze,tt,F,bn]);return{value:fe(L.value),valueAsNumber:L.valueAsNumber,isFocused:le,isDisabled:u,isReadOnly:l,getIncrementButtonProps:he,getDecrementButtonProps:Re,getInputProps:Ke,htmlProps:U}}var[lB,$g]=Yn({name:"NumberInputStylesContext",errorMessage:`useNumberInputStyles returned is 'undefined'. Seems you forgot to wrap the components in "<NumberInput />" `}),[cB,cb]=Yn({name:"NumberInputContext",errorMessage:"useNumberInputContext: `context` is undefined. Seems you forgot to wrap number-input's components within <NumberInput />"}),Lg=Be(function(t,n){const r=to("NumberInput",t),o=ur(t),s=Ax(o),{htmlProps:a,...l}=iB(s),u=h.useMemo(()=>l,[l]);return i.jsx(cB,{value:u,children:i.jsx(lB,{value:r,children:i.jsx(Oe.div,{...a,ref:n,className:Ot("chakra-numberinput",t.className),__css:{position:"relative",zIndex:0,...r.root}})})})});Lg.displayName="NumberInput";var Bg=Be(function(t,n){const r=$g();return i.jsx(Oe.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}})});Bg.displayName="NumberInputStepper";var Fg=Be(function(t,n){const{getInputProps:r}=cb(),o=r(t,n),s=$g();return i.jsx(Oe.input,{...o,className:Ot("chakra-numberinput__field",t.className),__css:{width:"100%",...s.field}})});Fg.displayName="NumberInputField";var H6=Oe("div",{baseStyle:{display:"flex",justifyContent:"center",alignItems:"center",flex:1,transitionProperty:"common",transitionDuration:"normal",userSelect:"none",cursor:"pointer",lineHeight:"normal"}}),Hg=Be(function(t,n){var r;const o=$g(),{getDecrementButtonProps:s}=cb(),a=s(t,n);return i.jsx(H6,{...a,__css:o.stepper,children:(r=t.children)!=null?r:i.jsx(JL,{})})});Hg.displayName="NumberDecrementStepper";var Vg=Be(function(t,n){var r;const{getIncrementButtonProps:o}=cb(),s=o(t,n),a=$g();return i.jsx(H6,{...s,__css:a.stepper,children:(r=t.children)!=null?r:i.jsx(eB,{})})});Vg.displayName="NumberIncrementStepper";var[uB,Wg]=Yn({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within `<Popover />`"}),[dB,V6]=Yn({name:"PopoverStylesContext",errorMessage:`usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Popover />" `});function W6(e){const t=h.Children.only(e.children),{getTriggerProps:n}=Wg();return h.cloneElement(t,n(t.props,t.ref))}W6.displayName="PopoverTrigger";var $c={click:"click",hover:"hover"};function fB(e={}){const{closeOnBlur:t=!0,closeOnEsc:n=!0,initialFocusRef:r,id:o,returnFocusOnClose:s=!0,autoFocus:a=!0,arrowSize:l,arrowShadowColor:u,trigger:f=$c.click,openDelay:p=200,closeDelay:m=200,isLazy:v,lazyBehavior:y="unmount",computePositionOnMount:S,...x}=e,{isOpen:w,onClose:_,onOpen:k,onToggle:P}=sb(e),I=h.useRef(null),j=h.useRef(null),E=h.useRef(null),T=h.useRef(!1),R=h.useRef(!1);w&&(R.current=!0);const[M,D]=h.useState(!1),[N,U]=h.useState(!1),z=h.useId(),F=o??z,[H,G,A,L]=["popover-trigger","popover-content","popover-header","popover-body"].map(Pe=>`${Pe}-${F}`),{referenceRef:W,getArrowProps:V,getPopperProps:ee,getArrowInnerProps:le,forceUpdate:oe}=ob({...x,enabled:w||!!S}),X=j6({isOpen:w,ref:E});wP({enabled:w,ref:j}),g6(E,{focusRef:j,visible:w,shouldFocus:s&&f===$c.click}),xz(E,{focusRef:r,visible:w,shouldFocus:a&&f===$c.click});const Q=ab({wasSelected:R.current,enabled:v,mode:y,isSelected:X.present}),ie=h.useCallback((Pe={},tt=null)=>{const ze={...Pe,style:{...Pe.style,transformOrigin:Ur.transformOrigin.varRef,[Ur.arrowSize.var]:l?`${l}px`:void 0,[Ur.arrowShadowColor.var]:u},ref:yn(E,tt),children:Q?Pe.children:null,id:G,tabIndex:-1,role:"dialog",onKeyDown:at(Pe.onKeyDown,We=>{n&&We.key==="Escape"&&_()}),onBlur:at(Pe.onBlur,We=>{const It=_C(We),pt=e1(E.current,It),bn=e1(j.current,It);w&&t&&(!pt&&!bn)&&_()}),"aria-labelledby":M?A:void 0,"aria-describedby":N?L:void 0};return f===$c.hover&&(ze.role="tooltip",ze.onMouseEnter=at(Pe.onMouseEnter,()=>{T.current=!0}),ze.onMouseLeave=at(Pe.onMouseLeave,We=>{We.nativeEvent.relatedTarget!==null&&(T.current=!1,setTimeout(()=>_(),m))})),ze},[Q,G,M,A,N,L,f,n,_,w,t,m,u,l]),ve=h.useCallback((Pe={},tt=null)=>ee({...Pe,style:{visibility:w?"visible":"hidden",...Pe.style}},tt),[w,ee]),ye=h.useCallback((Pe,tt=null)=>({...Pe,ref:yn(tt,I,W)}),[I,W]),se=h.useRef(),de=h.useRef(),fe=h.useCallback(Pe=>{I.current==null&&W(Pe)},[W]),xe=h.useCallback((Pe={},tt=null)=>{const ze={...Pe,ref:yn(j,tt,fe),id:H,"aria-haspopup":"dialog","aria-expanded":w,"aria-controls":G};return f===$c.click&&(ze.onClick=at(Pe.onClick,P)),f===$c.hover&&(ze.onFocus=at(Pe.onFocus,()=>{se.current===void 0&&k()}),ze.onBlur=at(Pe.onBlur,We=>{const It=_C(We),pt=!e1(E.current,It);w&&t&&pt&&_()}),ze.onKeyDown=at(Pe.onKeyDown,We=>{We.key==="Escape"&&_()}),ze.onMouseEnter=at(Pe.onMouseEnter,()=>{T.current=!0,se.current=window.setTimeout(()=>k(),p)}),ze.onMouseLeave=at(Pe.onMouseLeave,()=>{T.current=!1,se.current&&(clearTimeout(se.current),se.current=void 0),de.current=window.setTimeout(()=>{T.current===!1&&_()},m)})),ze},[H,w,G,f,fe,P,k,t,_,p,m]);h.useEffect(()=>()=>{se.current&&clearTimeout(se.current),de.current&&clearTimeout(de.current)},[]);const ke=h.useCallback((Pe={},tt=null)=>({...Pe,id:A,ref:yn(tt,ze=>{D(!!ze)})}),[A]),ae=h.useCallback((Pe={},tt=null)=>({...Pe,id:L,ref:yn(tt,ze=>{U(!!ze)})}),[L]);return{forceUpdate:oe,isOpen:w,onAnimationComplete:X.onComplete,onClose:_,getAnchorProps:ye,getArrowProps:V,getArrowInnerProps:le,getPopoverPositionerProps:ve,getPopoverProps:ie,getTriggerProps:xe,getHeaderProps:ke,getBodyProps:ae}}function e1(e,t){return e===t||(e==null?void 0:e.contains(t))}function _C(e){var t;const n=e.currentTarget.ownerDocument.activeElement;return(t=e.relatedTarget)!=null?t:n}function U6(e){const t=to("Popover",e),{children:n,...r}=ur(e),o=Au(),s=fB({...r,direction:o.direction});return i.jsx(uB,{value:s,children:i.jsx(dB,{value:t,children:gx(n,{isOpen:s.isOpen,onClose:s.onClose,forceUpdate:s.forceUpdate})})})}U6.displayName="Popover";var t1=(e,t)=>t?`${e}.${t}, ${t}`:void 0;function G6(e){var t;const{bg:n,bgColor:r,backgroundColor:o,shadow:s,boxShadow:a,shadowColor:l}=e,{getArrowProps:u,getArrowInnerProps:f}=Wg(),p=V6(),m=(t=n??r)!=null?t:o,v=s??a;return i.jsx(Oe.div,{...u(),className:"chakra-popover__arrow-positioner",children:i.jsx(Oe.div,{className:Ot("chakra-popover__arrow",e.className),...f(e),__css:{"--popper-arrow-shadow-color":t1("colors",l),"--popper-arrow-bg":t1("colors",m),"--popper-arrow-shadow":t1("shadows",v),...p.arrow}})})}G6.displayName="PopoverArrow";function pB(e){if(e)return{enter:{...e.enter,visibility:"visible"},exit:{...e.exit,transitionEnd:{visibility:"hidden"}}}}var hB={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]}}},mB=Oe(zo.section),q6=Be(function(t,n){const{variants:r=hB,...o}=t,{isOpen:s}=Wg();return i.jsx(mB,{ref:n,variants:pB(r),initial:!1,animate:s?"enter":"exit",...o})});q6.displayName="PopoverTransition";var Y6=Be(function(t,n){const{rootProps:r,motionProps:o,...s}=t,{getPopoverProps:a,getPopoverPositionerProps:l,onAnimationComplete:u}=Wg(),f=V6(),p={position:"relative",display:"flex",flexDirection:"column",...f.content};return i.jsx(Oe.div,{...l(r),__css:f.popper,className:"chakra-popover__popper",children:i.jsx(q6,{...o,...a(s,n),onAnimationComplete:bg(u,s.onAnimationComplete),className:Ot("chakra-popover__content",t.className),__css:p})})});Y6.displayName="PopoverContent";function gB(e,t,n){return(e-t)*100/(n-t)}pc({"0%":{strokeDasharray:"1, 400",strokeDashoffset:"0"},"50%":{strokeDasharray:"400, 400",strokeDashoffset:"-100"},"100%":{strokeDasharray:"400, 400",strokeDashoffset:"-260"}});pc({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}});var vB=pc({"0%":{left:"-40%"},"100%":{left:"100%"}}),yB=pc({from:{backgroundPosition:"1rem 0"},to:{backgroundPosition:"0 0"}});function xB(e){const{value:t=0,min:n,max:r,valueText:o,getValueText:s,isIndeterminate:a,role:l="progressbar"}=e,u=gB(t,n,r);return{bind:{"data-indeterminate":a?"":void 0,"aria-valuemax":r,"aria-valuemin":n,"aria-valuenow":a?void 0:t,"aria-valuetext":(()=>{if(t!=null)return typeof s=="function"?s(t,u):o})(),role:l},percent:u,value:t}}var[bB,wB]=Yn({name:"ProgressStylesContext",errorMessage:`useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Progress />" `}),SB=Be((e,t)=>{const{min:n,max:r,value:o,isIndeterminate:s,role:a,...l}=e,u=xB({value:o,min:n,max:r,isIndeterminate:s,role:a}),p={height:"100%",...wB().filledTrack};return i.jsx(Oe.div,{ref:t,style:{width:`${u.percent}%`,...l.style},...u.bind,...l,__css:p})}),K6=Be((e,t)=>{var n;const{value:r,min:o=0,max:s=100,hasStripe:a,isAnimated:l,children:u,borderRadius:f,isIndeterminate:p,"aria-label":m,"aria-labelledby":v,"aria-valuetext":y,title:S,role:x,...w}=ur(e),_=to("Progress",e),k=f??((n=_.track)==null?void 0:n.borderRadius),P={animation:`${yB} 1s linear infinite`},E={...!p&&a&&l&&P,...p&&{position:"absolute",willChange:"left",minWidth:"50%",animation:`${vB} 1s ease infinite normal none running`}},T={overflow:"hidden",position:"relative",..._.track};return i.jsx(Oe.div,{ref:t,borderRadius:k,__css:T,...w,children:i.jsxs(bB,{value:_,children:[i.jsx(SB,{"aria-label":m,"aria-labelledby":v,"aria-valuetext":y,min:o,max:s,value:r,isIndeterminate:p,css:E,borderRadius:k,title:S,role:x}),u]})})});K6.displayName="Progress";function CB(e){return e&&G1(e)&&G1(e.target)}function _B(e={}){const{onChange:t,value:n,defaultValue:r,name:o,isDisabled:s,isFocusable:a,isNative:l,...u}=e,[f,p]=h.useState(r||""),m=typeof n<"u",v=m?n:f,y=h.useRef(null),S=h.useCallback(()=>{const j=y.current;if(!j)return;let E="input:not(:disabled):checked";const T=j.querySelector(E);if(T){T.focus();return}E="input:not(:disabled)";const R=j.querySelector(E);R==null||R.focus()},[]),w=`radio-${h.useId()}`,_=o||w,k=h.useCallback(j=>{const E=CB(j)?j.target.value:j;m||p(E),t==null||t(String(E))},[t,m]),P=h.useCallback((j={},E=null)=>({...j,ref:yn(E,y),role:"radiogroup"}),[]),I=h.useCallback((j={},E=null)=>({...j,ref:E,name:_,[l?"checked":"isChecked"]:v!=null?j.value===v:void 0,onChange(R){k(R)},"data-radiogroup":!0}),[l,_,k,v]);return{getRootProps:P,getRadioProps:I,name:_,ref:y,focus:S,setValue:p,value:v,onChange:k,isDisabled:s,isFocusable:a,htmlProps:u}}var[kB,X6]=Yn({name:"RadioGroupContext",strict:!1}),Xd=Be((e,t)=>{const{colorScheme:n,size:r,variant:o,children:s,className:a,isDisabled:l,isFocusable:u,...f}=e,{value:p,onChange:m,getRootProps:v,name:y,htmlProps:S}=_B(f),x=h.useMemo(()=>({name:y,size:r,onChange:m,colorScheme:n,value:p,variant:o,isDisabled:l,isFocusable:u}),[y,r,m,n,p,o,l,u]);return i.jsx(kB,{value:x,children:i.jsx(Oe.div,{...v(S,t),className:Ot("chakra-radio-group",a),children:s})})});Xd.displayName="RadioGroup";var PB={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};function jB(e={}){const{defaultChecked:t,isChecked:n,isFocusable:r,isDisabled:o,isReadOnly:s,isRequired:a,onChange:l,isInvalid:u,name:f,value:p,id:m,"data-radiogroup":v,"aria-describedby":y,...S}=e,x=`radio-${h.useId()}`,w=mc(),k=!!X6()||!!v;let I=!!w&&!k?w.id:x;I=m??I;const j=o??(w==null?void 0:w.isDisabled),E=s??(w==null?void 0:w.isReadOnly),T=a??(w==null?void 0:w.isRequired),R=u??(w==null?void 0:w.isInvalid),[M,D]=h.useState(!1),[N,U]=h.useState(!1),[z,F]=h.useState(!1),[H,G]=h.useState(!1),[A,L]=h.useState(!!t),W=typeof n<"u",V=W?n:A;h.useEffect(()=>uP(D),[]);const ee=h.useCallback(fe=>{if(E||j){fe.preventDefault();return}W||L(fe.target.checked),l==null||l(fe)},[W,j,E,l]),le=h.useCallback(fe=>{fe.key===" "&&G(!0)},[G]),oe=h.useCallback(fe=>{fe.key===" "&&G(!1)},[G]),X=h.useCallback((fe={},xe=null)=>({...fe,ref:xe,"data-active":ln(H),"data-hover":ln(z),"data-disabled":ln(j),"data-invalid":ln(R),"data-checked":ln(V),"data-focus":ln(N),"data-focus-visible":ln(N&&M),"data-readonly":ln(E),"aria-hidden":!0,onMouseDown:at(fe.onMouseDown,()=>G(!0)),onMouseUp:at(fe.onMouseUp,()=>G(!1)),onMouseEnter:at(fe.onMouseEnter,()=>F(!0)),onMouseLeave:at(fe.onMouseLeave,()=>F(!1))}),[H,z,j,R,V,N,E,M]),{onFocus:Q,onBlur:ie}=w??{},ve=h.useCallback((fe={},xe=null)=>{const ke=j&&!r;return{...fe,id:I,ref:xe,type:"radio",name:f,value:p,onChange:at(fe.onChange,ee),onBlur:at(ie,fe.onBlur,()=>U(!1)),onFocus:at(Q,fe.onFocus,()=>U(!0)),onKeyDown:at(fe.onKeyDown,le),onKeyUp:at(fe.onKeyUp,oe),checked:V,disabled:ke,readOnly:E,required:T,"aria-invalid":Ds(R),"aria-disabled":Ds(ke),"aria-required":Ds(T),"data-readonly":ln(E),"aria-describedby":y,style:PB}},[j,r,I,f,p,ee,ie,Q,le,oe,V,E,T,R,y]);return{state:{isInvalid:R,isFocused:N,isChecked:V,isActive:H,isHovered:z,isDisabled:j,isReadOnly:E,isRequired:T},getCheckboxProps:X,getRadioProps:X,getInputProps:ve,getLabelProps:(fe={},xe=null)=>({...fe,ref:xe,onMouseDown:at(fe.onMouseDown,IB),"data-disabled":ln(j),"data-checked":ln(V),"data-invalid":ln(R)}),getRootProps:(fe,xe=null)=>({...fe,ref:xe,"data-disabled":ln(j),"data-checked":ln(V),"data-invalid":ln(R)}),htmlProps:S}}function IB(e){e.preventDefault(),e.stopPropagation()}function EB(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 Mo=Be((e,t)=>{var n;const r=X6(),{onChange:o,value:s}=e,a=to("Radio",{...r,...e}),l=ur(e),{spacing:u="0.5rem",children:f,isDisabled:p=r==null?void 0:r.isDisabled,isFocusable:m=r==null?void 0:r.isFocusable,inputProps:v,...y}=l;let S=e.isChecked;(r==null?void 0:r.value)!=null&&s!=null&&(S=r.value===s);let x=o;r!=null&&r.onChange&&s!=null&&(x=bg(r.onChange,o));const w=(n=e==null?void 0:e.name)!=null?n:r==null?void 0:r.name,{getInputProps:_,getCheckboxProps:k,getLabelProps:P,getRootProps:I,htmlProps:j}=jB({...y,isChecked:S,isFocusable:m,isDisabled:p,onChange:x,name:w}),[E,T]=EB(j,Q3),R=k(T),M=_(v,t),D=P(),N=Object.assign({},E,I()),U={display:"inline-flex",alignItems:"center",verticalAlign:"top",cursor:"pointer",position:"relative",...a.container},z={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,...a.control},F={userSelect:"none",marginStart:u,...a.label};return i.jsxs(Oe.label,{className:"chakra-radio",...N,__css:U,children:[i.jsx("input",{className:"chakra-radio__input",...M}),i.jsx(Oe.span,{className:"chakra-radio__control",...R,__css:z}),f&&i.jsx(Oe.span,{className:"chakra-radio__label",...D,__css:F,children:f})]})});Mo.displayName="Radio";var Z6=Be(function(t,n){const{children:r,placeholder:o,className:s,...a}=t;return i.jsxs(Oe.select,{...a,ref:n,className:Ot("chakra-select",s),children:[o&&i.jsx("option",{value:"",children:o}),r]})});Z6.displayName="SelectField";function OB(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 ub=Be((e,t)=>{var n;const r=to("Select",e),{rootProps:o,placeholder:s,icon:a,color:l,height:u,h:f,minH:p,minHeight:m,iconColor:v,iconSize:y,...S}=ur(e),[x,w]=OB(S,Q3),_=Dx(w),k={width:"100%",height:"fit-content",position:"relative",color:l},P={paddingEnd:"2rem",...r.field,_focus:{zIndex:"unset",...(n=r.field)==null?void 0:n._focus}};return i.jsxs(Oe.div,{className:"chakra-select__wrapper",__css:k,...x,...o,children:[i.jsx(Z6,{ref:t,height:f??u,minH:p??m,placeholder:s,..._,__css:P,children:e.children}),i.jsx(Q6,{"data-disabled":ln(_.disabled),...(v||l)&&{color:v||l},__css:r.icon,...y&&{fontSize:y},children:a})]})});ub.displayName="Select";var TB=e=>i.jsx("svg",{viewBox:"0 0 24 24",...e,children:i.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})}),RB=Oe("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),Q6=e=>{const{children:t=i.jsx(TB,{}),...n}=e,r=h.cloneElement(t,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return i.jsx(RB,{...n,className:"chakra-select__icon-wrapper",children:h.isValidElement(t)?r:null})};Q6.displayName="SelectIcon";var js=e=>e?"":void 0,iu=e=>e?!0:void 0,fl=(...e)=>e.filter(Boolean).join(" ");function lu(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function MB(e){return{root:`slider-root-${e}`,getThumb:t=>`slider-thumb-${e}-${t}`,getInput:t=>`slider-input-${e}-${t}`,track:`slider-track-${e}`,innerTrack:`slider-filled-track-${e}`,getMarker:t=>`slider-marker-${e}-${t}`,output:`slider-output-${e}`}}function Ed(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}var Oh={width:0,height:0},Hp=e=>e||Oh;function J6(e){const{orientation:t,thumbPercents:n,thumbRects:r,isReversed:o}=e,s=x=>{var w;const _=(w=r[x])!=null?w:Oh;return{position:"absolute",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",touchAction:"none",...Ed({orientation:t,vertical:{bottom:`calc(${n[x]}% - ${_.height/2}px)`},horizontal:{left:`calc(${n[x]}% - ${_.width/2}px)`}})}},a=t==="vertical"?r.reduce((x,w)=>Hp(x).height>Hp(w).height?x:w,Oh):r.reduce((x,w)=>Hp(x).width>Hp(w).width?x:w,Oh),l={position:"relative",touchAction:"none",WebkitTapHighlightColor:"rgba(0,0,0,0)",userSelect:"none",outline:0,...Ed({orientation:t,vertical:a?{paddingLeft:a.width/2,paddingRight:a.width/2}:{},horizontal:a?{paddingTop:a.height/2,paddingBottom:a.height/2}:{}})},u={position:"absolute",...Ed({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",height:"100%"},horizontal:{top:"50%",transform:"translateY(-50%)",width:"100%"}})},f=n.length===1,p=[0,o?100-n[0]:n[0]],m=f?p:n;let v=m[0];!f&&o&&(v=100-v);const y=Math.abs(m[m.length-1]-m[0]),S={...u,...Ed({orientation:t,vertical:o?{height:`${y}%`,top:`${v}%`}:{height:`${y}%`,bottom:`${v}%`},horizontal:o?{width:`${y}%`,right:`${v}%`}:{width:`${y}%`,left:`${v}%`}})};return{trackStyle:u,innerTrackStyle:S,rootStyle:l,getThumbStyle:s}}function ej(e){const{isReversed:t,direction:n,orientation:r}=e;return n==="ltr"||r==="vertical"?t:!t}function DB(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function AB(e){const t=zB(e);return typeof t.PointerEvent<"u"&&e instanceof t.PointerEvent?e.pointerType==="mouse":e instanceof t.MouseEvent}function tj(e){return!!e.touches}function NB(e){return tj(e)&&e.touches.length>1}function zB(e){var t;return(t=e.view)!=null?t:window}function $B(e,t="page"){const n=e.touches[0]||e.changedTouches[0];return{x:n[`${t}X`],y:n[`${t}Y`]}}function LB(e,t="page"){return{x:e[`${t}X`],y:e[`${t}Y`]}}function nj(e,t="page"){return tj(e)?$B(e,t):LB(e,t)}function BB(e){return t=>{const n=AB(t);(!n||n&&t.button===0)&&e(t)}}function FB(e,t=!1){function n(o){e(o,{point:nj(o)})}return t?BB(n):n}function Th(e,t,n,r){return DB(e,t,FB(n,t==="pointerdown"),r)}var HB=Object.defineProperty,VB=(e,t,n)=>t in e?HB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Zs=(e,t,n)=>(VB(e,typeof t!="symbol"?t+"":t,n),n),WB=class{constructor(e,t,n){Zs(this,"history",[]),Zs(this,"startEvent",null),Zs(this,"lastEvent",null),Zs(this,"lastEventInfo",null),Zs(this,"handlers",{}),Zs(this,"removeListeners",()=>{}),Zs(this,"threshold",3),Zs(this,"win"),Zs(this,"updatePoint",()=>{if(!(this.lastEvent&&this.lastEventInfo))return;const l=n1(this.lastEventInfo,this.history),u=this.startEvent!==null,f=YB(l.offset,{x:0,y:0})>=this.threshold;if(!u&&!f)return;const{timestamp:p}=BS();this.history.push({...l.point,timestamp:p});const{onStart:m,onMove:v}=this.handlers;u||(m==null||m(this.lastEvent,l),this.startEvent=this.lastEvent),v==null||v(this.lastEvent,l)}),Zs(this,"onPointerMove",(l,u)=>{this.lastEvent=l,this.lastEventInfo=u,mD.update(this.updatePoint,!0)}),Zs(this,"onPointerUp",(l,u)=>{const f=n1(u,this.history),{onEnd:p,onSessionEnd:m}=this.handlers;m==null||m(l,f),this.end(),!(!p||!this.startEvent)&&(p==null||p(l,f))});var r;if(this.win=(r=e.view)!=null?r:window,NB(e))return;this.handlers=t,n&&(this.threshold=n),e.stopPropagation(),e.preventDefault();const o={point:nj(e)},{timestamp:s}=BS();this.history=[{...o.point,timestamp:s}];const{onSessionStart:a}=t;a==null||a(e,n1(o,this.history)),this.removeListeners=qB(Th(this.win,"pointermove",this.onPointerMove),Th(this.win,"pointerup",this.onPointerUp),Th(this.win,"pointercancel",this.onPointerUp))}updateHandlers(e){this.handlers=e}end(){var e;(e=this.removeListeners)==null||e.call(this),gD.update(this.updatePoint)}};function kC(e,t){return{x:e.x-t.x,y:e.y-t.y}}function n1(e,t){return{point:e.point,delta:kC(e.point,t[t.length-1]),offset:kC(e.point,t[0]),velocity:GB(t,.1)}}var UB=e=>e*1e3;function GB(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>UB(t)));)n--;if(!r)return{x:0,y:0};const s=(o.timestamp-r.timestamp)/1e3;if(s===0)return{x:0,y:0};const a={x:(o.x-r.x)/s,y:(o.y-r.y)/s};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function qB(...e){return t=>e.reduce((n,r)=>r(n),t)}function r1(e,t){return Math.abs(e-t)}function PC(e){return"x"in e&&"y"in e}function YB(e,t){if(typeof e=="number"&&typeof t=="number")return r1(e,t);if(PC(e)&&PC(t)){const n=r1(e.x,t.x),r=r1(e.y,t.y);return Math.sqrt(n**2+r**2)}return 0}function rj(e){const t=h.useRef(null);return t.current=e,t}function oj(e,t){const{onPan:n,onPanStart:r,onPanEnd:o,onPanSessionStart:s,onPanSessionEnd:a,threshold:l}=t,u=!!(n||r||o||s||a),f=h.useRef(null),p=rj({onSessionStart:s,onSessionEnd:a,onStart:r,onMove:n,onEnd(m,v){f.current=null,o==null||o(m,v)}});h.useEffect(()=>{var m;(m=f.current)==null||m.updateHandlers(p.current)}),h.useEffect(()=>{const m=e.current;if(!m||!u)return;function v(y){f.current=new WB(y,p.current,l)}return Th(m,"pointerdown",v)},[e,u,p,l]),h.useEffect(()=>()=>{var m;(m=f.current)==null||m.end(),f.current=null},[])}function KB(e,t){if(!e){t(void 0);return}t({width:e.offsetWidth,height:e.offsetHeight});const n=e.ownerDocument.defaultView??window,r=new n.ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const[s]=o;let a,l;if("borderBoxSize"in s){const u=s.borderBoxSize,f=Array.isArray(u)?u[0]:u;a=f.inlineSize,l=f.blockSize}else a=e.offsetWidth,l=e.offsetHeight;t({width:a,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}var XB=globalThis!=null&&globalThis.document?h.useLayoutEffect:h.useEffect;function ZB(e,t){var n,r;if(!e||!e.parentElement)return;const o=(r=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?r:window,s=new o.MutationObserver(()=>{t()});return s.observe(e.parentElement,{childList:!0}),()=>{s.disconnect()}}function sj({getNodes:e,observeMutation:t=!0}){const[n,r]=h.useState([]),[o,s]=h.useState(0);return XB(()=>{const a=e(),l=a.map((u,f)=>KB(u,p=>{r(m=>[...m.slice(0,f),p,...m.slice(f+1)])}));if(t){const u=a[0];l.push(ZB(u,()=>{s(f=>f+1)}))}return()=>{l.forEach(u=>{u==null||u()})}},[o]),n}function QB(e){return typeof e=="object"&&e!==null&&"current"in e}function JB(e){const[t]=sj({observeMutation:!1,getNodes(){return[QB(e)?e.current:e]}});return t}function eF(e){const{min:t=0,max:n=100,onChange:r,value:o,defaultValue:s,isReversed:a,direction:l="ltr",orientation:u="horizontal",id:f,isDisabled:p,isReadOnly:m,onChangeStart:v,onChangeEnd:y,step:S=1,getAriaValueText:x,"aria-valuetext":w,"aria-label":_,"aria-labelledby":k,name:P,focusThumbOnChange:I=!0,minStepsBetweenThumbs:j=0,...E}=e,T=_r(v),R=_r(y),M=_r(x),D=ej({isReversed:a,direction:l,orientation:u}),[N,U]=zu({value:o,defaultValue:s??[25,75],onChange:r});if(!Array.isArray(N))throw new TypeError(`[range-slider] You passed an invalid value for \`value\` or \`defaultValue\`, expected \`Array\` but got \`${typeof N}\``);const[z,F]=h.useState(!1),[H,G]=h.useState(!1),[A,L]=h.useState(-1),W=!(p||m),V=h.useRef(N),ee=N.map(Ie=>ru(Ie,t,n)),le=j*S,oe=tF(ee,t,n,le),X=h.useRef({eventSource:null,value:[],valueBounds:[]});X.current.value=ee,X.current.valueBounds=oe;const Q=ee.map(Ie=>n-Ie+t),ve=(D?Q:ee).map(Ie=>nm(Ie,t,n)),ye=u==="vertical",se=h.useRef(null),de=h.useRef(null),fe=sj({getNodes(){const Ie=de.current,Ye=Ie==null?void 0:Ie.querySelectorAll("[role=slider]");return Ye?Array.from(Ye):[]}}),xe=h.useId(),ae=MB(f??xe),Pe=h.useCallback(Ie=>{var Ye,ht;if(!se.current)return;X.current.eventSource="pointer";const vt=se.current.getBoundingClientRect(),{clientX:Gt,clientY:Er}=(ht=(Ye=Ie.touches)==null?void 0:Ye[0])!=null?ht:Ie,gn=ye?vt.bottom-Er:Gt-vt.left,vn=ye?vt.height:vt.width;let Hr=gn/vn;return D&&(Hr=1-Hr),pP(Hr,t,n)},[ye,D,n,t]),tt=(n-t)/10,ze=S||(n-t)/100,We=h.useMemo(()=>({setValueAtIndex(Ie,Ye){if(!W)return;const ht=X.current.valueBounds[Ie];Ye=parseFloat(ay(Ye,ht.min,ze)),Ye=ru(Ye,ht.min,ht.max);const vt=[...X.current.value];vt[Ie]=Ye,U(vt)},setActiveIndex:L,stepUp(Ie,Ye=ze){const ht=X.current.value[Ie],vt=D?ht-Ye:ht+Ye;We.setValueAtIndex(Ie,vt)},stepDown(Ie,Ye=ze){const ht=X.current.value[Ie],vt=D?ht+Ye:ht-Ye;We.setValueAtIndex(Ie,vt)},reset(){U(V.current)}}),[ze,D,U,W]),It=h.useCallback(Ie=>{const Ye=Ie.key,vt={ArrowRight:()=>We.stepUp(A),ArrowUp:()=>We.stepUp(A),ArrowLeft:()=>We.stepDown(A),ArrowDown:()=>We.stepDown(A),PageUp:()=>We.stepUp(A,tt),PageDown:()=>We.stepDown(A,tt),Home:()=>{const{min:Gt}=oe[A];We.setValueAtIndex(A,Gt)},End:()=>{const{max:Gt}=oe[A];We.setValueAtIndex(A,Gt)}}[Ye];vt&&(Ie.preventDefault(),Ie.stopPropagation(),vt(Ie),X.current.eventSource="keyboard")},[We,A,tt,oe]),{getThumbStyle:pt,rootStyle:bn,trackStyle:Y,innerTrackStyle:Se}=h.useMemo(()=>J6({isReversed:D,orientation:u,thumbRects:fe,thumbPercents:ve}),[D,u,ve,fe]),ne=h.useCallback(Ie=>{var Ye;const ht=Ie??A;if(ht!==-1&&I){const vt=ae.getThumb(ht),Gt=(Ye=de.current)==null?void 0:Ye.ownerDocument.getElementById(vt);Gt&&setTimeout(()=>Gt.focus())}},[I,A,ae]);Ci(()=>{X.current.eventSource==="keyboard"&&(R==null||R(X.current.value))},[ee,R]);const he=Ie=>{const Ye=Pe(Ie)||0,ht=X.current.value.map(vn=>Math.abs(vn-Ye)),vt=Math.min(...ht);let Gt=ht.indexOf(vt);const Er=ht.filter(vn=>vn===vt);Er.length>1&&Ye>X.current.value[Gt]&&(Gt=Gt+Er.length-1),L(Gt),We.setValueAtIndex(Gt,Ye),ne(Gt)},Re=Ie=>{if(A==-1)return;const Ye=Pe(Ie)||0;L(A),We.setValueAtIndex(A,Ye),ne(A)};oj(de,{onPanSessionStart(Ie){W&&(F(!0),he(Ie),T==null||T(X.current.value))},onPanSessionEnd(){W&&(F(!1),R==null||R(X.current.value))},onPan(Ie){W&&Re(Ie)}});const Ke=h.useCallback((Ie={},Ye=null)=>({...Ie,...E,id:ae.root,ref:yn(Ye,de),tabIndex:-1,"aria-disabled":iu(p),"data-focused":js(H),style:{...Ie.style,...bn}}),[E,p,H,bn,ae]),ge=h.useCallback((Ie={},Ye=null)=>({...Ie,ref:yn(Ye,se),id:ae.track,"data-disabled":js(p),style:{...Ie.style,...Y}}),[p,Y,ae]),ut=h.useCallback((Ie={},Ye=null)=>({...Ie,ref:Ye,id:ae.innerTrack,style:{...Ie.style,...Se}}),[Se,ae]),Rt=h.useCallback((Ie,Ye=null)=>{var ht;const{index:vt,...Gt}=Ie,Er=ee[vt];if(Er==null)throw new TypeError(`[range-slider > thumb] Cannot find value at index \`${vt}\`. The \`value\` or \`defaultValue\` length is : ${ee.length}`);const gn=oe[vt];return{...Gt,ref:Ye,role:"slider",tabIndex:W?0:void 0,id:ae.getThumb(vt),"data-active":js(z&&A===vt),"aria-valuetext":(ht=M==null?void 0:M(Er))!=null?ht:w==null?void 0:w[vt],"aria-valuemin":gn.min,"aria-valuemax":gn.max,"aria-valuenow":Er,"aria-orientation":u,"aria-disabled":iu(p),"aria-readonly":iu(m),"aria-label":_==null?void 0:_[vt],"aria-labelledby":_!=null&&_[vt]||k==null?void 0:k[vt],style:{...Ie.style,...pt(vt)},onKeyDown:lu(Ie.onKeyDown,It),onFocus:lu(Ie.onFocus,()=>{G(!0),L(vt)}),onBlur:lu(Ie.onBlur,()=>{G(!1),L(-1)})}},[ae,ee,oe,W,z,A,M,w,u,p,m,_,k,pt,It,G]),en=h.useCallback((Ie={},Ye=null)=>({...Ie,ref:Ye,id:ae.output,htmlFor:ee.map((ht,vt)=>ae.getThumb(vt)).join(" "),"aria-live":"off"}),[ae,ee]),$e=h.useCallback((Ie,Ye=null)=>{const{value:ht,...vt}=Ie,Gt=!(ht<t||ht>n),Er=ht>=ee[0]&&ht<=ee[ee.length-1];let gn=nm(ht,t,n);gn=D?100-gn:gn;const vn={position:"absolute",pointerEvents:"none",...Ed({orientation:u,vertical:{bottom:`${gn}%`},horizontal:{left:`${gn}%`}})};return{...vt,ref:Ye,id:ae.getMarker(Ie.value),role:"presentation","aria-hidden":!0,"data-disabled":js(p),"data-invalid":js(!Gt),"data-highlighted":js(Er),style:{...Ie.style,...vn}}},[p,D,n,t,u,ee,ae]),Xe=h.useCallback((Ie,Ye=null)=>{const{index:ht,...vt}=Ie;return{...vt,ref:Ye,id:ae.getInput(ht),type:"hidden",value:ee[ht],name:Array.isArray(P)?P[ht]:`${P}-${ht}`}},[P,ee,ae]);return{state:{value:ee,isFocused:H,isDragging:z,getThumbPercent:Ie=>ve[Ie],getThumbMinValue:Ie=>oe[Ie].min,getThumbMaxValue:Ie=>oe[Ie].max},actions:We,getRootProps:Ke,getTrackProps:ge,getInnerTrackProps:ut,getThumbProps:Rt,getMarkerProps:$e,getInputProps:Xe,getOutputProps:en}}function tF(e,t,n,r){return e.map((o,s)=>{const a=s===0?t:e[s-1]+r,l=s===e.length-1?n:e[s+1]-r;return{min:a,max:l}})}var[nF,Ug]=Yn({name:"SliderContext",errorMessage:"useSliderContext: `context` is undefined. Seems you forgot to wrap all slider components within <RangeSlider />"}),[rF,Gg]=Yn({name:"RangeSliderStylesContext",errorMessage:`useRangeSliderStyles returned is 'undefined'. Seems you forgot to wrap the components in "<RangeSlider />" `}),aj=Be(function(t,n){const r={orientation:"horizontal",...t},o=to("Slider",r),s=ur(r),{direction:a}=Au();s.direction=a;const{getRootProps:l,...u}=eF(s),f=h.useMemo(()=>({...u,name:r.name}),[u,r.name]);return i.jsx(nF,{value:f,children:i.jsx(rF,{value:o,children:i.jsx(Oe.div,{...l({},n),className:"chakra-slider",__css:o.container,children:r.children})})})});aj.displayName="RangeSlider";var vy=Be(function(t,n){const{getThumbProps:r,getInputProps:o,name:s}=Ug(),a=Gg(),l=r(t,n);return i.jsxs(Oe.div,{...l,className:fl("chakra-slider__thumb",t.className),__css:a.thumb,children:[l.children,s&&i.jsx("input",{...o({index:t.index})})]})});vy.displayName="RangeSliderThumb";var ij=Be(function(t,n){const{getTrackProps:r}=Ug(),o=Gg(),s=r(t,n);return i.jsx(Oe.div,{...s,className:fl("chakra-slider__track",t.className),__css:o.track,"data-testid":"chakra-range-slider-track"})});ij.displayName="RangeSliderTrack";var lj=Be(function(t,n){const{getInnerTrackProps:r}=Ug(),o=Gg(),s=r(t,n);return i.jsx(Oe.div,{...s,className:"chakra-slider__filled-track",__css:o.filledTrack})});lj.displayName="RangeSliderFilledTrack";var Rh=Be(function(t,n){const{getMarkerProps:r}=Ug(),o=Gg(),s=r(t,n);return i.jsx(Oe.div,{...s,className:fl("chakra-slider__marker",t.className),__css:o.mark})});Rh.displayName="RangeSliderMark";function oF(e){var t;const{min:n=0,max:r=100,onChange:o,value:s,defaultValue:a,isReversed:l,direction:u="ltr",orientation:f="horizontal",id:p,isDisabled:m,isReadOnly:v,onChangeStart:y,onChangeEnd:S,step:x=1,getAriaValueText:w,"aria-valuetext":_,"aria-label":k,"aria-labelledby":P,name:I,focusThumbOnChange:j=!0,...E}=e,T=_r(y),R=_r(S),M=_r(w),D=ej({isReversed:l,direction:u,orientation:f}),[N,U]=zu({value:s,defaultValue:a??aF(n,r),onChange:o}),[z,F]=h.useState(!1),[H,G]=h.useState(!1),A=!(m||v),L=(r-n)/10,W=x||(r-n)/100,V=ru(N,n,r),ee=r-V+n,oe=nm(D?ee:V,n,r),X=f==="vertical",Q=rj({min:n,max:r,step:x,isDisabled:m,value:V,isInteractive:A,isReversed:D,isVertical:X,eventSource:null,focusThumbOnChange:j,orientation:f}),ie=h.useRef(null),ve=h.useRef(null),ye=h.useRef(null),se=h.useId(),de=p??se,[fe,xe]=[`slider-thumb-${de}`,`slider-track-${de}`],ke=h.useCallback($e=>{var Xe,On;if(!ie.current)return;const Ie=Q.current;Ie.eventSource="pointer";const Ye=ie.current.getBoundingClientRect(),{clientX:ht,clientY:vt}=(On=(Xe=$e.touches)==null?void 0:Xe[0])!=null?On:$e,Gt=X?Ye.bottom-vt:ht-Ye.left,Er=X?Ye.height:Ye.width;let gn=Gt/Er;D&&(gn=1-gn);let vn=pP(gn,Ie.min,Ie.max);return Ie.step&&(vn=parseFloat(ay(vn,Ie.min,Ie.step))),vn=ru(vn,Ie.min,Ie.max),vn},[X,D,Q]),ae=h.useCallback($e=>{const Xe=Q.current;Xe.isInteractive&&($e=parseFloat(ay($e,Xe.min,W)),$e=ru($e,Xe.min,Xe.max),U($e))},[W,U,Q]),Pe=h.useMemo(()=>({stepUp($e=W){const Xe=D?V-$e:V+$e;ae(Xe)},stepDown($e=W){const Xe=D?V+$e:V-$e;ae(Xe)},reset(){ae(a||0)},stepTo($e){ae($e)}}),[ae,D,V,W,a]),tt=h.useCallback($e=>{const Xe=Q.current,Ie={ArrowRight:()=>Pe.stepUp(),ArrowUp:()=>Pe.stepUp(),ArrowLeft:()=>Pe.stepDown(),ArrowDown:()=>Pe.stepDown(),PageUp:()=>Pe.stepUp(L),PageDown:()=>Pe.stepDown(L),Home:()=>ae(Xe.min),End:()=>ae(Xe.max)}[$e.key];Ie&&($e.preventDefault(),$e.stopPropagation(),Ie($e),Xe.eventSource="keyboard")},[Pe,ae,L,Q]),ze=(t=M==null?void 0:M(V))!=null?t:_,We=JB(ve),{getThumbStyle:It,rootStyle:pt,trackStyle:bn,innerTrackStyle:Y}=h.useMemo(()=>{const $e=Q.current,Xe=We??{width:0,height:0};return J6({isReversed:D,orientation:$e.orientation,thumbRects:[Xe],thumbPercents:[oe]})},[D,We,oe,Q]),Se=h.useCallback(()=>{Q.current.focusThumbOnChange&&setTimeout(()=>{var Xe;return(Xe=ve.current)==null?void 0:Xe.focus()})},[Q]);Ci(()=>{const $e=Q.current;Se(),$e.eventSource==="keyboard"&&(R==null||R($e.value))},[V,R]);function ne($e){const Xe=ke($e);Xe!=null&&Xe!==Q.current.value&&U(Xe)}oj(ye,{onPanSessionStart($e){const Xe=Q.current;Xe.isInteractive&&(F(!0),Se(),ne($e),T==null||T(Xe.value))},onPanSessionEnd(){const $e=Q.current;$e.isInteractive&&(F(!1),R==null||R($e.value))},onPan($e){Q.current.isInteractive&&ne($e)}});const he=h.useCallback(($e={},Xe=null)=>({...$e,...E,ref:yn(Xe,ye),tabIndex:-1,"aria-disabled":iu(m),"data-focused":js(H),style:{...$e.style,...pt}}),[E,m,H,pt]),Re=h.useCallback(($e={},Xe=null)=>({...$e,ref:yn(Xe,ie),id:xe,"data-disabled":js(m),style:{...$e.style,...bn}}),[m,xe,bn]),Ke=h.useCallback(($e={},Xe=null)=>({...$e,ref:Xe,style:{...$e.style,...Y}}),[Y]),ge=h.useCallback(($e={},Xe=null)=>({...$e,ref:yn(Xe,ve),role:"slider",tabIndex:A?0:void 0,id:fe,"data-active":js(z),"aria-valuetext":ze,"aria-valuemin":n,"aria-valuemax":r,"aria-valuenow":V,"aria-orientation":f,"aria-disabled":iu(m),"aria-readonly":iu(v),"aria-label":k,"aria-labelledby":k?void 0:P,style:{...$e.style,...It(0)},onKeyDown:lu($e.onKeyDown,tt),onFocus:lu($e.onFocus,()=>G(!0)),onBlur:lu($e.onBlur,()=>G(!1))}),[A,fe,z,ze,n,r,V,f,m,v,k,P,It,tt]),ut=h.useCallback(($e,Xe=null)=>{const On=!($e.value<n||$e.value>r),Ie=V>=$e.value,Ye=nm($e.value,n,r),ht={position:"absolute",pointerEvents:"none",...sF({orientation:f,vertical:{bottom:D?`${100-Ye}%`:`${Ye}%`},horizontal:{left:D?`${100-Ye}%`:`${Ye}%`}})};return{...$e,ref:Xe,role:"presentation","aria-hidden":!0,"data-disabled":js(m),"data-invalid":js(!On),"data-highlighted":js(Ie),style:{...$e.style,...ht}}},[m,D,r,n,f,V]),Rt=h.useCallback(($e={},Xe=null)=>({...$e,ref:Xe,type:"hidden",value:V,name:I}),[I,V]);return{state:{value:V,isFocused:H,isDragging:z},actions:Pe,getRootProps:he,getTrackProps:Re,getInnerTrackProps:Ke,getThumbProps:ge,getMarkerProps:ut,getInputProps:Rt}}function sF(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}function aF(e,t){return t<e?e:e+(t-e)/2}var[iF,qg]=Yn({name:"SliderContext",hookName:"useSliderContext",providerName:"<Slider />"}),[lF,Yg]=Yn({name:"SliderStylesContext",hookName:"useSliderStyles",providerName:"<Slider />"}),cj=Be((e,t)=>{var n;const r={...e,orientation:(n=e==null?void 0:e.orientation)!=null?n:"horizontal"},o=to("Slider",r),s=ur(r),{direction:a}=Au();s.direction=a;const{getInputProps:l,getRootProps:u,...f}=oF(s),p=u(),m=l({},t);return i.jsx(iF,{value:f,children:i.jsx(lF,{value:o,children:i.jsxs(Oe.div,{...p,className:fl("chakra-slider",r.className),__css:o.container,children:[r.children,i.jsx("input",{...m})]})})})});cj.displayName="Slider";var uj=Be((e,t)=>{const{getThumbProps:n}=qg(),r=Yg(),o=n(e,t);return i.jsx(Oe.div,{...o,className:fl("chakra-slider__thumb",e.className),__css:r.thumb})});uj.displayName="SliderThumb";var dj=Be((e,t)=>{const{getTrackProps:n}=qg(),r=Yg(),o=n(e,t);return i.jsx(Oe.div,{...o,className:fl("chakra-slider__track",e.className),__css:r.track})});dj.displayName="SliderTrack";var fj=Be((e,t)=>{const{getInnerTrackProps:n}=qg(),r=Yg(),o=n(e,t);return i.jsx(Oe.div,{...o,className:fl("chakra-slider__filled-track",e.className),__css:r.filledTrack})});fj.displayName="SliderFilledTrack";var Wc=Be((e,t)=>{const{getMarkerProps:n}=qg(),r=Yg(),o=n(e,t);return i.jsx(Oe.div,{...o,className:fl("chakra-slider__marker",e.className),__css:r.mark})});Wc.displayName="SliderMark";var Kg=Be(function(t,n){const r=to("Switch",t),{spacing:o="0.5rem",children:s,...a}=ur(t),{state:l,getInputProps:u,getCheckboxProps:f,getRootProps:p,getLabelProps:m}=dP(a),v=h.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...r.container}),[r.container]),y=h.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...r.track}),[r.track]),S=h.useMemo(()=>({userSelect:"none",marginStart:o,...r.label}),[o,r.label]);return i.jsxs(Oe.label,{...p(),className:Ot("chakra-switch",t.className),__css:v,children:[i.jsx("input",{className:"chakra-switch__input",...u({},n)}),i.jsx(Oe.span,{...f(),className:"chakra-switch__track",__css:y,children:i.jsx(Oe.span,{__css:r.thumb,className:"chakra-switch__thumb","data-checked":ln(l.isChecked),"data-hover":ln(l.isHovered)})}),s&&i.jsx(Oe.span,{className:"chakra-switch__label",...m(),__css:S,children:s})]})});Kg.displayName="Switch";var[cF,uF,dF,fF]=Tx();function pF(e){var t;const{defaultIndex:n,onChange:r,index:o,isManual:s,isLazy:a,lazyBehavior:l="unmount",orientation:u="horizontal",direction:f="ltr",...p}=e,[m,v]=h.useState(n??0),[y,S]=zu({defaultValue:n??0,value:o,onChange:r});h.useEffect(()=>{o!=null&&v(o)},[o]);const x=dF(),w=h.useId();return{id:`tabs-${(t=e.id)!=null?t:w}`,selectedIndex:y,focusedIndex:m,setSelectedIndex:S,setFocusedIndex:v,isManual:s,isLazy:a,lazyBehavior:l,orientation:u,descendants:x,direction:f,htmlProps:p}}var[hF,Xg]=Yn({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within <Tabs />"});function mF(e){const{focusedIndex:t,orientation:n,direction:r}=Xg(),o=uF(),s=h.useCallback(a=>{const l=()=>{var k;const P=o.nextEnabled(t);P&&((k=P.node)==null||k.focus())},u=()=>{var k;const P=o.prevEnabled(t);P&&((k=P.node)==null||k.focus())},f=()=>{var k;const P=o.firstEnabled();P&&((k=P.node)==null||k.focus())},p=()=>{var k;const P=o.lastEnabled();P&&((k=P.node)==null||k.focus())},m=n==="horizontal",v=n==="vertical",y=a.key,S=r==="ltr"?"ArrowLeft":"ArrowRight",x=r==="ltr"?"ArrowRight":"ArrowLeft",_={[S]:()=>m&&u(),[x]:()=>m&&l(),ArrowDown:()=>v&&l(),ArrowUp:()=>v&&u(),Home:f,End:p}[y];_&&(a.preventDefault(),_(a))},[o,t,n,r]);return{...e,role:"tablist","aria-orientation":n,onKeyDown:at(e.onKeyDown,s)}}function gF(e){const{isDisabled:t,isFocusable:n,...r}=e,{setSelectedIndex:o,isManual:s,id:a,setFocusedIndex:l,selectedIndex:u}=Xg(),{index:f,register:p}=fF({disabled:t&&!n}),m=f===u,v=()=>{o(f)},y=()=>{l(f),!s&&!(t&&n)&&o(f)},S=m6({...r,ref:yn(p,e.ref),isDisabled:t,isFocusable:n,onClick:at(e.onClick,v)}),x="button";return{...S,id:pj(a,f),role:"tab",tabIndex:m?0:-1,type:x,"aria-selected":m,"aria-controls":hj(a,f),onFocus:t?void 0:at(e.onFocus,y)}}var[vF,yF]=Yn({});function xF(e){const t=Xg(),{id:n,selectedIndex:r}=t,s=Rf(e.children).map((a,l)=>h.createElement(vF,{key:l,value:{isSelected:l===r,id:hj(n,l),tabId:pj(n,l),selectedIndex:r}},a));return{...e,children:s}}function bF(e){const{children:t,...n}=e,{isLazy:r,lazyBehavior:o}=Xg(),{isSelected:s,id:a,tabId:l}=yF(),u=h.useRef(!1);s&&(u.current=!0);const f=ab({wasSelected:u.current,isSelected:s,enabled:r,mode:o});return{tabIndex:0,...n,children:f?t:null,role:"tabpanel","aria-labelledby":l,hidden:!s,id:a}}function pj(e,t){return`${e}--tab-${t}`}function hj(e,t){return`${e}--tabpanel-${t}`}var[wF,Zg]=Yn({name:"TabsStylesContext",errorMessage:`useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in "<Tabs />" `}),mj=Be(function(t,n){const r=to("Tabs",t),{children:o,className:s,...a}=ur(t),{htmlProps:l,descendants:u,...f}=pF(a),p=h.useMemo(()=>f,[f]),{isFitted:m,...v}=l;return i.jsx(cF,{value:u,children:i.jsx(hF,{value:p,children:i.jsx(wF,{value:r,children:i.jsx(Oe.div,{className:Ot("chakra-tabs",s),ref:n,...v,__css:r.root,children:o})})})})});mj.displayName="Tabs";var gj=Be(function(t,n){const r=mF({...t,ref:n}),s={display:"flex",...Zg().tablist};return i.jsx(Oe.div,{...r,className:Ot("chakra-tabs__tablist",t.className),__css:s})});gj.displayName="TabList";var vj=Be(function(t,n){const r=bF({...t,ref:n}),o=Zg();return i.jsx(Oe.div,{outline:"0",...r,className:Ot("chakra-tabs__tab-panel",t.className),__css:o.tabpanel})});vj.displayName="TabPanel";var yj=Be(function(t,n){const r=xF(t),o=Zg();return i.jsx(Oe.div,{...r,width:"100%",ref:n,className:Ot("chakra-tabs__tab-panels",t.className),__css:o.tabpanels})});yj.displayName="TabPanels";var xj=Be(function(t,n){const r=Zg(),o=gF({...t,ref:n}),s={outline:"0",display:"flex",alignItems:"center",justifyContent:"center",...r.tab};return i.jsx(Oe.button,{...o,className:Ot("chakra-tabs__tab",t.className),__css:s})});xj.displayName="Tab";function SF(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var CF=["h","minH","height","minHeight"],bj=Be((e,t)=>{const n=Si("Textarea",e),{className:r,rows:o,...s}=ur(e),a=Dx(s),l=o?SF(n,CF):n;return i.jsx(Oe.textarea,{ref:t,rows:o,...a,className:Ot("chakra-textarea",r),__css:l})});bj.displayName="Textarea";var _F={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]}}}},yy=e=>{var t;return((t=e.current)==null?void 0:t.ownerDocument)||document},Mh=e=>{var t,n;return((n=(t=e.current)==null?void 0:t.ownerDocument)==null?void 0:n.defaultView)||window};function kF(e={}){const{openDelay:t=0,closeDelay:n=0,closeOnClick:r=!0,closeOnMouseDown:o,closeOnScroll:s,closeOnPointerDown:a=o,closeOnEsc:l=!0,onOpen:u,onClose:f,placement:p,id:m,isOpen:v,defaultIsOpen:y,arrowSize:S=10,arrowShadowColor:x,arrowPadding:w,modifiers:_,isDisabled:k,gutter:P,offset:I,direction:j,...E}=e,{isOpen:T,onOpen:R,onClose:M}=sb({isOpen:v,defaultIsOpen:y,onOpen:u,onClose:f}),{referenceRef:D,getPopperProps:N,getArrowInnerProps:U,getArrowProps:z}=ob({enabled:T,placement:p,arrowPadding:w,modifiers:_,gutter:P,offset:I,direction:j}),F=h.useId(),G=`tooltip-${m??F}`,A=h.useRef(null),L=h.useRef(),W=h.useCallback(()=>{L.current&&(clearTimeout(L.current),L.current=void 0)},[]),V=h.useRef(),ee=h.useCallback(()=>{V.current&&(clearTimeout(V.current),V.current=void 0)},[]),le=h.useCallback(()=>{ee(),M()},[M,ee]),oe=PF(A,le),X=h.useCallback(()=>{if(!k&&!L.current){oe();const xe=Mh(A);L.current=xe.setTimeout(R,t)}},[oe,k,R,t]),Q=h.useCallback(()=>{W();const xe=Mh(A);V.current=xe.setTimeout(le,n)},[n,le,W]),ie=h.useCallback(()=>{T&&r&&Q()},[r,Q,T]),ve=h.useCallback(()=>{T&&a&&Q()},[a,Q,T]),ye=h.useCallback(xe=>{T&&xe.key==="Escape"&&Q()},[T,Q]);Vl(()=>yy(A),"keydown",l?ye:void 0),Vl(()=>{const xe=A.current;if(!xe)return null;const ke=o6(xe);return ke.localName==="body"?Mh(A):ke},"scroll",()=>{T&&s&&le()},{passive:!0,capture:!0}),h.useEffect(()=>{k&&(W(),T&&M())},[k,T,M,W]),h.useEffect(()=>()=>{W(),ee()},[W,ee]),Vl(()=>A.current,"pointerleave",Q);const se=h.useCallback((xe={},ke=null)=>({...xe,ref:yn(A,ke,D),onPointerEnter:at(xe.onPointerEnter,Pe=>{Pe.pointerType!=="touch"&&X()}),onClick:at(xe.onClick,ie),onPointerDown:at(xe.onPointerDown,ve),onFocus:at(xe.onFocus,X),onBlur:at(xe.onBlur,Q),"aria-describedby":T?G:void 0}),[X,Q,ve,T,G,ie,D]),de=h.useCallback((xe={},ke=null)=>N({...xe,style:{...xe.style,[Ur.arrowSize.var]:S?`${S}px`:void 0,[Ur.arrowShadowColor.var]:x}},ke),[N,S,x]),fe=h.useCallback((xe={},ke=null)=>{const ae={...xe.style,position:"relative",transformOrigin:Ur.transformOrigin.varRef};return{ref:ke,...E,...xe,id:G,role:"tooltip",style:ae}},[E,G]);return{isOpen:T,show:X,hide:Q,getTriggerProps:se,getTooltipProps:fe,getTooltipPositionerProps:de,getArrowProps:z,getArrowInnerProps:U}}var o1="chakra-ui:close-tooltip";function PF(e,t){return h.useEffect(()=>{const n=yy(e);return n.addEventListener(o1,t),()=>n.removeEventListener(o1,t)},[t,e]),()=>{const n=yy(e),r=Mh(e);n.dispatchEvent(new r.CustomEvent(o1))}}function jF(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function IF(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var EF=Oe(zo.div),er=Be((e,t)=>{var n,r;const o=Si("Tooltip",e),s=ur(e),a=Au(),{children:l,label:u,shouldWrapChildren:f,"aria-label":p,hasArrow:m,bg:v,portalProps:y,background:S,backgroundColor:x,bgColor:w,motionProps:_,...k}=s,P=(r=(n=S??x)!=null?n:v)!=null?r:w;if(P){o.bg=P;const N=aM(a,"colors",P);o[Ur.arrowBg.var]=N}const I=kF({...k,direction:a.direction}),j=typeof l=="string"||f;let E;if(j)E=i.jsx(Oe.span,{display:"inline-block",tabIndex:0,...I.getTriggerProps(),children:l});else{const N=h.Children.only(l);E=h.cloneElement(N,I.getTriggerProps(N.props,N.ref))}const T=!!p,R=I.getTooltipProps({},t),M=T?jF(R,["role","id"]):R,D=IF(R,["role","id"]);return u?i.jsxs(i.Fragment,{children:[E,i.jsx(Co,{children:I.isOpen&&i.jsx(Fd,{...y,children:i.jsx(Oe.div,{...I.getTooltipPositionerProps(),__css:{zIndex:o.zIndex,pointerEvents:"none"},children:i.jsxs(EF,{variants:_F,initial:"exit",animate:"enter",exit:"exit",..._,...M,__css:o,children:[u,T&&i.jsx(Oe.span,{srOnly:!0,...D,children:p}),m&&i.jsx(Oe.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper",children:i.jsx(Oe.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:o.bg}})})]})})})})]}):i.jsx(i.Fragment,{children:l})});er.displayName="Tooltip";const wj=({id:e,x:t,y:n,width:r,height:o,style:s,color:a,strokeColor:l,strokeWidth:u,className:f,borderRadius:p,shapeRendering:m,onClick:v})=>{const{background:y,backgroundColor:S}=s||{},x=a||y||S;return i.jsx("rect",{className:wg(["react-flow__minimap-node",f]),x:t,y:n,rx:p,ry:p,width:r,height:o,fill:x,stroke:l,strokeWidth:u,shapeRendering:m,onClick:v?w=>v(w,e):void 0})};wj.displayName="MiniMapNode";var OF=h.memo(wj);const TF=e=>e.nodeOrigin,RF=e=>e.getNodes().filter(t=>!t.hidden&&t.width&&t.height),s1=e=>e instanceof Function?e:()=>e;function MF({nodeStrokeColor:e="transparent",nodeColor:t="#e2e2e2",nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:o=2,nodeComponent:s=OF,onClick:a}){const l=Bh(RF,vx),u=Bh(TF),f=s1(t),p=s1(e),m=s1(n),v=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return i.jsx(i.Fragment,{children:l.map(y=>{const{x:S,y:x}=iM(y,u).positionAbsolute;return i.jsx(s,{x:S,y:x,width:y.width,height:y.height,style:y.style,className:m(y),color:f(y),borderRadius:r,strokeColor:p(y),strokeWidth:o,shapeRendering:v,onClick:a,id:y.id},y.id)})})}var DF=h.memo(MF);const AF=200,NF=150,zF=e=>{const t=e.getNodes(),n={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:n,boundingRect:t.length>0?dM(fM(t,e.nodeOrigin),n):n,rfId:e.rfId}},$F="react-flow__minimap-desc";function Sj({style:e,className:t,nodeStrokeColor:n="transparent",nodeColor:r="#e2e2e2",nodeClassName:o="",nodeBorderRadius:s=5,nodeStrokeWidth:a=2,nodeComponent:l,maskColor:u="rgb(240, 240, 240, 0.6)",maskStrokeColor:f="none",maskStrokeWidth:p=1,position:m="bottom-right",onClick:v,onNodeClick:y,pannable:S=!1,zoomable:x=!1,ariaLabel:w="React Flow mini map",inversePan:_=!1,zoomStep:k=10}){const P=J3(),I=h.useRef(null),{boundingRect:j,viewBB:E,rfId:T}=Bh(zF,vx),R=(e==null?void 0:e.width)??AF,M=(e==null?void 0:e.height)??NF,D=j.width/R,N=j.height/M,U=Math.max(D,N),z=U*R,F=U*M,H=5*U,G=j.x-(z-j.width)/2-H,A=j.y-(F-j.height)/2-H,L=z+H*2,W=F+H*2,V=`${$F}-${T}`,ee=h.useRef(0);ee.current=U,h.useEffect(()=>{if(I.current){const X=e5(I.current),Q=ye=>{const{transform:se,d3Selection:de,d3Zoom:fe}=P.getState();if(ye.sourceEvent.type!=="wheel"||!de||!fe)return;const xe=-ye.sourceEvent.deltaY*(ye.sourceEvent.deltaMode===1?.05:ye.sourceEvent.deltaMode?1:.002)*k,ke=se[2]*Math.pow(2,xe);fe.scaleTo(de,ke)},ie=ye=>{const{transform:se,d3Selection:de,d3Zoom:fe,translateExtent:xe,width:ke,height:ae}=P.getState();if(ye.sourceEvent.type!=="mousemove"||!de||!fe)return;const Pe=ee.current*Math.max(1,se[2])*(_?-1:1),tt={x:se[0]-ye.sourceEvent.movementX*Pe,y:se[1]-ye.sourceEvent.movementY*Pe},ze=[[0,0],[ke,ae]],We=cM.translate(tt.x,tt.y).scale(se[2]),It=fe.constrain()(We,ze,xe);fe.transform(de,It)},ve=lM().on("zoom",S?ie:null).on("zoom.wheel",x?Q:null);return X.call(ve),()=>{X.on("zoom",null)}}},[S,x,_,k]);const le=v?X=>{const Q=uM(X);v(X,{x:Q[0],y:Q[1]})}:void 0,oe=y?(X,Q)=>{const ie=P.getState().nodeInternals.get(Q);y(X,ie)}:void 0;return i.jsx(Pf,{position:m,style:e,className:wg(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:i.jsxs("svg",{width:R,height:M,viewBox:`${G} ${A} ${L} ${W}`,role:"img","aria-labelledby":V,ref:I,onClick:le,children:[w&&i.jsx("title",{id:V,children:w}),i.jsx(DF,{onClick:oe,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:o,nodeStrokeWidth:a,nodeComponent:l}),i.jsx("path",{className:"react-flow__minimap-mask",d:`M${G-H},${A-H}h${L+H*2}v${W+H*2}h${-L-H*2}z
M${E.x},${E.y}h${E.width}v${E.height}h${-E.width}z`,fill:u,fillRule:"evenodd",stroke:f,strokeWidth:p,pointerEvents:"none"})]})})}Sj.displayName="MiniMap";var LF=h.memo(Sj),ia;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ia||(ia={}));function BF({color:e,dimensions:t,lineWidth:n}){return i.jsx("path",{stroke:e,strokeWidth:n,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function FF({color:e,radius:t}){return i.jsx("circle",{cx:t,cy:t,r:t,fill:e})}const HF={[ia.Dots]:"#91919a",[ia.Lines]:"#eee",[ia.Cross]:"#e2e2e2"},VF={[ia.Dots]:1,[ia.Lines]:1,[ia.Cross]:6},WF=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Cj({id:e,variant:t=ia.Dots,gap:n=20,size:r,lineWidth:o=1,offset:s=2,color:a,style:l,className:u}){const f=h.useRef(null),{transform:p,patternId:m}=Bh(WF,vx),v=a||HF[t],y=r||VF[t],S=t===ia.Dots,x=t===ia.Cross,w=Array.isArray(n)?n:[n,n],_=[w[0]*p[2]||1,w[1]*p[2]||1],k=y*p[2],P=x?[k,k]:_,I=S?[k/s,k/s]:[P[0]/s,P[1]/s];return i.jsxs("svg",{className:wg(["react-flow__background",u]),style:{...l,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:f,"data-testid":"rf__background",children:[i.jsx("pattern",{id:m+e,x:p[0]%_[0],y:p[1]%_[1],width:_[0],height:_[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${I[0]},-${I[1]})`,children:S?i.jsx(FF,{color:v,radius:k/s}):i.jsx(BF,{dimensions:P,color:v,lineWidth:o})}),i.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${m+e})`})]})}Cj.displayName="Background";var UF=h.memo(Cj),Ad;(function(e){e.Line="line",e.Handle="handle"})(Ad||(Ad={}));function GF({width:e,prevWidth:t,height:n,prevHeight:r,invertX:o,invertY:s}){const a=e-t,l=n-r,u=[a>0?1:a<0?-1:0,l>0?1:l<0?-1:0];return a&&o&&(u[0]=u[0]*-1),l&&s&&(u[1]=u[1]*-1),u}const _j={width:0,height:0,x:0,y:0},qF={..._j,pointerX:0,pointerY:0,aspectRatio:1};function YF({nodeId:e,position:t,variant:n=Ad.Handle,className:r,style:o={},children:s,color:a,minWidth:l=10,minHeight:u=10,maxWidth:f=Number.MAX_VALUE,maxHeight:p=Number.MAX_VALUE,keepAspectRatio:m=!1,shouldResize:v,onResizeStart:y,onResize:S,onResizeEnd:x}){const w=pM(),_=typeof e=="string"?e:w,k=J3(),P=h.useRef(null),I=h.useRef(qF),j=h.useRef(_j),E=hM(),T=n===Ad.Line?"right":"bottom-right",R=t??T;h.useEffect(()=>{if(!P.current||!_)return;const U=e5(P.current),z=R.includes("right")||R.includes("left"),F=R.includes("bottom")||R.includes("top"),H=R.includes("left"),G=R.includes("top"),A=mM().on("start",L=>{const W=k.getState().nodeInternals.get(_),{xSnapped:V,ySnapped:ee}=E(L);j.current={width:(W==null?void 0:W.width)??0,height:(W==null?void 0:W.height)??0,x:(W==null?void 0:W.position.x)??0,y:(W==null?void 0:W.position.y)??0},I.current={...j.current,pointerX:V,pointerY:ee,aspectRatio:j.current.width/j.current.height},y==null||y(L,{...j.current})}).on("drag",L=>{const{nodeInternals:W,triggerNodeChanges:V}=k.getState(),{xSnapped:ee,ySnapped:le}=E(L),oe=W.get(_);if(oe){const X=[],{pointerX:Q,pointerY:ie,width:ve,height:ye,x:se,y:de,aspectRatio:fe}=I.current,{x:xe,y:ke,width:ae,height:Pe}=j.current,tt=Math.floor(z?ee-Q:0),ze=Math.floor(F?le-ie:0);let We=rS(ve+(H?-tt:tt),l,f),It=rS(ye+(G?-ze:ze),u,p);if(m){const he=We/It,Re=z&&F,Ke=z&&!F,ge=F&&!z;We=he<=fe&&Re||ge?It*fe:We,It=he>fe&&Re||Ke?We/fe:It,We>=f?(We=f,It=f/fe):We<=l&&(We=l,It=l/fe),It>=p?(It=p,We=p*fe):It<=u&&(It=u,We=u*fe)}const pt=We!==ae,bn=It!==Pe;if(H||G){const he=H?se-(We-ve):se,Re=G?de-(It-ye):de,Ke=he!==xe&&pt,ge=Re!==ke&&bn;if(Ke||ge){const ut={id:oe.id,type:"position",position:{x:Ke?he:xe,y:ge?Re:ke}};X.push(ut),j.current.x=ut.position.x,j.current.y=ut.position.y}}if(pt||bn){const he={id:_,type:"dimensions",updateStyle:!0,resizing:!0,dimensions:{width:We,height:It}};X.push(he),j.current.width=We,j.current.height=It}if(X.length===0)return;const Y=GF({width:j.current.width,prevWidth:ae,height:j.current.height,prevHeight:Pe,invertX:H,invertY:G}),Se={...j.current,direction:Y};if((v==null?void 0:v(L,Se))===!1)return;S==null||S(L,Se),V(X)}}).on("end",L=>{const W={id:_,type:"dimensions",resizing:!1};x==null||x(L,{...j.current}),k.getState().triggerNodeChanges([W])});return U.call(A),()=>{U.on(".drag",null)}},[_,R,l,u,f,p,m,E,y,S,x]);const M=R.split("-"),D=n===Ad.Line?"borderColor":"backgroundColor",N=a?{...o,[D]:a}:o;return i.jsx("div",{className:wg(["react-flow__resize-control","nodrag",...M,n,r]),ref:P,style:N,children:s})}var KF=h.memo(YF);let jC=()=>{};const Qg=()=>({setOpenUploaderFunction:h.useCallback(t=>{t&&(jC=t)},[]),openUploader:jC});var XF=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 Bf(e,t){var n=ZF(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 ZF(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),o=XF.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var QF=[".DS_Store","Thumbs.db"];function JF(e){return Lu(this,void 0,void 0,function(){return Bu(this,function(t){return im(e)&&eH(e.dataTransfer)?[2,oH(e.dataTransfer,e.type)]:tH(e)?[2,nH(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,rH(e)]:[2,[]]})})}function eH(e){return im(e)}function tH(e){return im(e)&&im(e.target)}function im(e){return typeof e=="object"&&e!==null}function nH(e){return xy(e.target.files).map(function(t){return Bf(t)})}function rH(e){return Lu(this,void 0,void 0,function(){var t;return Bu(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 Bf(r)})]}})})}function oH(e,t){return Lu(this,void 0,void 0,function(){var n,r;return Bu(this,function(o){switch(o.label){case 0:return e.items?(n=xy(e.items).filter(function(s){return s.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(sH))]):[3,2];case 1:return r=o.sent(),[2,IC(kj(r))];case 2:return[2,IC(xy(e.files).map(function(s){return Bf(s)}))]}})})}function IC(e){return e.filter(function(t){return QF.indexOf(t.name)===-1})}function xy(e){if(e===null)return[];for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r)}return t}function sH(e){if(typeof e.webkitGetAsEntry!="function")return EC(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?Pj(t):EC(e)}function kj(e){return e.reduce(function(t,n){return ly(ly([],ZS(t),!1),ZS(Array.isArray(n)?kj(n):[n]),!1)},[])}function EC(e){var t=e.getAsFile();if(!t)return Promise.reject("".concat(e," is not a File"));var n=Bf(t);return Promise.resolve(n)}function aH(e){return Lu(this,void 0,void 0,function(){return Bu(this,function(t){return[2,e.isDirectory?Pj(e):iH(e)]})})}function Pj(e){var t=e.createReader();return new Promise(function(n,r){var o=[];function s(){var a=this;t.readEntries(function(l){return Lu(a,void 0,void 0,function(){var u,f,p;return Bu(this,function(m){switch(m.label){case 0:if(l.length)return[3,5];m.label=1;case 1:return m.trys.push([1,3,,4]),[4,Promise.all(o)];case 2:return u=m.sent(),n(u),[3,4];case 3:return f=m.sent(),r(f),[3,4];case 4:return[3,6];case 5:p=Promise.all(l.map(aH)),o.push(p),s(),m.label=6;case 6:return[2]}})})},function(l){r(l)})}s()})}function iH(e){return Lu(this,void 0,void 0,function(){return Bu(this,function(t){return[2,new Promise(function(n,r){e.file(function(o){var s=Bf(o,e.fullPath);n(s)},function(o){r(o)})})]})})}var lH=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(","),r=e.name||"",o=(e.type||"").toLowerCase(),s=o.replace(/\/.*$/,"");return n.some(function(a){var l=a.trim().toLowerCase();return l.charAt(0)==="."?r.toLowerCase().endsWith(l):l.endsWith("/*")?s===l.replace(/\/.*$/,""):o===l})}return!0};function OC(e){return dH(e)||uH(e)||Ij(e)||cH()}function cH(){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 uH(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function dH(e){if(Array.isArray(e))return by(e)}function TC(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 RC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TC(Object(n),!0).forEach(function(r){jj(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jj(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zd(e,t){return hH(e)||pH(e,t)||Ij(e,t)||fH()}function fH(){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 Ij(e,t){if(e){if(typeof e=="string")return by(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 by(e,t)}}function by(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function pH(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,s=!1,a,l;try{for(n=n.call(e);!(o=(a=n.next()).done)&&(r.push(a.value),!(t&&r.length===t));o=!0);}catch(u){s=!0,l=u}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw l}}return r}}function hH(e){if(Array.isArray(e))return e}var mH="file-invalid-type",gH="file-too-large",vH="file-too-small",yH="too-many-files",xH=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:mH,message:"File type must be ".concat(n)}},MC=function(t){return{code:gH,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},DC=function(t){return{code:vH,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},bH={code:yH,message:"Too many files"};function Ej(e,t){var n=e.type==="application/x-moz-file"||lH(e,t);return[n,n?null:xH(t)]}function Oj(e,t,n){if(Ml(e.size))if(Ml(t)&&Ml(n)){if(e.size>n)return[!1,MC(n)];if(e.size<t)return[!1,DC(t)]}else{if(Ml(t)&&e.size<t)return[!1,DC(t)];if(Ml(n)&&e.size>n)return[!1,MC(n)]}return[!0,null]}function Ml(e){return e!=null}function wH(e){var t=e.files,n=e.accept,r=e.minSize,o=e.maxSize,s=e.multiple,a=e.maxFiles,l=e.validator;return!s&&t.length>1||s&&a>=1&&t.length>a?!1:t.every(function(u){var f=Ej(u,n),p=Zd(f,1),m=p[0],v=Oj(u,r,o),y=Zd(v,1),S=y[0],x=l?l(u):null;return m&&S&&!x})}function lm(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Vp(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 AC(e){e.preventDefault()}function SH(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function CH(e){return e.indexOf("Edge/")!==-1}function _H(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return SH(e)||CH(e)}function Da(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var o=arguments.length,s=new Array(o>1?o-1:0),a=1;a<o;a++)s[a-1]=arguments[a];return t.some(function(l){return!lm(r)&&l&&l.apply(void 0,[r].concat(s)),lm(r)})}}function kH(){return"showOpenFilePicker"in window}function PH(e){if(Ml(e)){var t=Object.entries(e).filter(function(n){var r=Zd(n,2),o=r[0],s=r[1],a=!0;return Tj(o)||(console.warn('Skipped "'.concat(o,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),a=!1),(!Array.isArray(s)||!s.every(Rj))&&(console.warn('Skipped "'.concat(o,'" because an invalid file extension was provided.')),a=!1),a}).reduce(function(n,r){var o=Zd(r,2),s=o[0],a=o[1];return RC(RC({},n),{},jj({},s,a))},{});return[{description:"Files",accept:t}]}return e}function jH(e){if(Ml(e))return Object.entries(e).reduce(function(t,n){var r=Zd(n,2),o=r[0],s=r[1];return[].concat(OC(t),[o],OC(s))},[]).filter(function(t){return Tj(t)||Rj(t)}).join(",")}function IH(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function EH(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function Tj(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function Rj(e){return/^.*\.[\w]+$/.test(e)}var OH=["children"],TH=["open"],RH=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],MH=["refKey","onChange","onClick"];function DH(e){return zH(e)||NH(e)||Mj(e)||AH()}function AH(){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 NH(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function zH(e){if(Array.isArray(e))return wy(e)}function a1(e,t){return BH(e)||LH(e,t)||Mj(e,t)||$H()}function $H(){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 Mj(e,t){if(e){if(typeof e=="string")return wy(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 wy(e,t)}}function wy(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 LH(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,s=!1,a,l;try{for(n=n.call(e);!(o=(a=n.next()).done)&&(r.push(a.value),!(t&&r.length===t));o=!0);}catch(u){s=!0,l=u}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw l}}return r}}function BH(e){if(Array.isArray(e))return e}function NC(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 Rr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NC(Object(n),!0).forEach(function(r){Sy(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Sy(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cm(e,t){if(e==null)return{};var n=FH(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 FH(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 db=h.forwardRef(function(e,t){var n=e.children,r=cm(e,OH),o=fb(r),s=o.open,a=cm(o,TH);return h.useImperativeHandle(t,function(){return{open:s}},[s]),B.createElement(h.Fragment,null,n(Rr(Rr({},a),{},{open:s})))});db.displayName="Dropzone";var Dj={disabled:!1,getFilesFromEvent:JF,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};db.defaultProps=Dj;db.propTypes={children:sr.func,accept:sr.objectOf(sr.arrayOf(sr.string)),multiple:sr.bool,preventDropOnDocument:sr.bool,noClick:sr.bool,noKeyboard:sr.bool,noDrag:sr.bool,noDragEventsBubbling:sr.bool,minSize:sr.number,maxSize:sr.number,maxFiles:sr.number,disabled:sr.bool,getFilesFromEvent:sr.func,onFileDialogCancel:sr.func,onFileDialogOpen:sr.func,useFsAccessApi:sr.bool,autoFocus:sr.bool,onDragEnter:sr.func,onDragLeave:sr.func,onDragOver:sr.func,onDrop:sr.func,onDropAccepted:sr.func,onDropRejected:sr.func,onError:sr.func,validator:sr.func};var Cy={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function fb(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Rr(Rr({},Dj),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,s=t.maxSize,a=t.minSize,l=t.multiple,u=t.maxFiles,f=t.onDragEnter,p=t.onDragLeave,m=t.onDragOver,v=t.onDrop,y=t.onDropAccepted,S=t.onDropRejected,x=t.onFileDialogCancel,w=t.onFileDialogOpen,_=t.useFsAccessApi,k=t.autoFocus,P=t.preventDropOnDocument,I=t.noClick,j=t.noKeyboard,E=t.noDrag,T=t.noDragEventsBubbling,R=t.onError,M=t.validator,D=h.useMemo(function(){return jH(n)},[n]),N=h.useMemo(function(){return PH(n)},[n]),U=h.useMemo(function(){return typeof w=="function"?w:zC},[w]),z=h.useMemo(function(){return typeof x=="function"?x:zC},[x]),F=h.useRef(null),H=h.useRef(null),G=h.useReducer(HH,Cy),A=a1(G,2),L=A[0],W=A[1],V=L.isFocused,ee=L.isFileDialogActive,le=h.useRef(typeof window<"u"&&window.isSecureContext&&_&&kH()),oe=function(){!le.current&&ee&&setTimeout(function(){if(H.current){var he=H.current.files;he.length||(W({type:"closeDialog"}),z())}},300)};h.useEffect(function(){return window.addEventListener("focus",oe,!1),function(){window.removeEventListener("focus",oe,!1)}},[H,ee,z,le]);var X=h.useRef([]),Q=function(he){F.current&&F.current.contains(he.target)||(he.preventDefault(),X.current=[])};h.useEffect(function(){return P&&(document.addEventListener("dragover",AC,!1),document.addEventListener("drop",Q,!1)),function(){P&&(document.removeEventListener("dragover",AC),document.removeEventListener("drop",Q))}},[F,P]),h.useEffect(function(){return!r&&k&&F.current&&F.current.focus(),function(){}},[F,k,r]);var ie=h.useCallback(function(ne){R?R(ne):console.error(ne)},[R]),ve=h.useCallback(function(ne){ne.preventDefault(),ne.persist(),pt(ne),X.current=[].concat(DH(X.current),[ne.target]),Vp(ne)&&Promise.resolve(o(ne)).then(function(he){if(!(lm(ne)&&!T)){var Re=he.length,Ke=Re>0&&wH({files:he,accept:D,minSize:a,maxSize:s,multiple:l,maxFiles:u,validator:M}),ge=Re>0&&!Ke;W({isDragAccept:Ke,isDragReject:ge,isDragActive:!0,type:"setDraggedFiles"}),f&&f(ne)}}).catch(function(he){return ie(he)})},[o,f,ie,T,D,a,s,l,u,M]),ye=h.useCallback(function(ne){ne.preventDefault(),ne.persist(),pt(ne);var he=Vp(ne);if(he&&ne.dataTransfer)try{ne.dataTransfer.dropEffect="copy"}catch{}return he&&m&&m(ne),!1},[m,T]),se=h.useCallback(function(ne){ne.preventDefault(),ne.persist(),pt(ne);var he=X.current.filter(function(Ke){return F.current&&F.current.contains(Ke)}),Re=he.indexOf(ne.target);Re!==-1&&he.splice(Re,1),X.current=he,!(he.length>0)&&(W({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Vp(ne)&&p&&p(ne))},[F,p,T]),de=h.useCallback(function(ne,he){var Re=[],Ke=[];ne.forEach(function(ge){var ut=Ej(ge,D),Rt=a1(ut,2),en=Rt[0],$e=Rt[1],Xe=Oj(ge,a,s),On=a1(Xe,2),Ie=On[0],Ye=On[1],ht=M?M(ge):null;if(en&&Ie&&!ht)Re.push(ge);else{var vt=[$e,Ye];ht&&(vt=vt.concat(ht)),Ke.push({file:ge,errors:vt.filter(function(Gt){return Gt})})}}),(!l&&Re.length>1||l&&u>=1&&Re.length>u)&&(Re.forEach(function(ge){Ke.push({file:ge,errors:[bH]})}),Re.splice(0)),W({acceptedFiles:Re,fileRejections:Ke,type:"setFiles"}),v&&v(Re,Ke,he),Ke.length>0&&S&&S(Ke,he),Re.length>0&&y&&y(Re,he)},[W,l,D,a,s,u,v,y,S,M]),fe=h.useCallback(function(ne){ne.preventDefault(),ne.persist(),pt(ne),X.current=[],Vp(ne)&&Promise.resolve(o(ne)).then(function(he){lm(ne)&&!T||de(he,ne)}).catch(function(he){return ie(he)}),W({type:"reset"})},[o,de,ie,T]),xe=h.useCallback(function(){if(le.current){W({type:"openDialog"}),U();var ne={multiple:l,types:N};window.showOpenFilePicker(ne).then(function(he){return o(he)}).then(function(he){de(he,null),W({type:"closeDialog"})}).catch(function(he){IH(he)?(z(he),W({type:"closeDialog"})):EH(he)?(le.current=!1,H.current?(H.current.value=null,H.current.click()):ie(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."))):ie(he)});return}H.current&&(W({type:"openDialog"}),U(),H.current.value=null,H.current.click())},[W,U,z,_,de,ie,N,l]),ke=h.useCallback(function(ne){!F.current||!F.current.isEqualNode(ne.target)||(ne.key===" "||ne.key==="Enter"||ne.keyCode===32||ne.keyCode===13)&&(ne.preventDefault(),xe())},[F,xe]),ae=h.useCallback(function(){W({type:"focus"})},[]),Pe=h.useCallback(function(){W({type:"blur"})},[]),tt=h.useCallback(function(){I||(_H()?setTimeout(xe,0):xe())},[I,xe]),ze=function(he){return r?null:he},We=function(he){return j?null:ze(he)},It=function(he){return E?null:ze(he)},pt=function(he){T&&he.stopPropagation()},bn=h.useMemo(function(){return function(){var ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},he=ne.refKey,Re=he===void 0?"ref":he,Ke=ne.role,ge=ne.onKeyDown,ut=ne.onFocus,Rt=ne.onBlur,en=ne.onClick,$e=ne.onDragEnter,Xe=ne.onDragOver,On=ne.onDragLeave,Ie=ne.onDrop,Ye=cm(ne,RH);return Rr(Rr(Sy({onKeyDown:We(Da(ge,ke)),onFocus:We(Da(ut,ae)),onBlur:We(Da(Rt,Pe)),onClick:ze(Da(en,tt)),onDragEnter:It(Da($e,ve)),onDragOver:It(Da(Xe,ye)),onDragLeave:It(Da(On,se)),onDrop:It(Da(Ie,fe)),role:typeof Ke=="string"&&Ke!==""?Ke:"presentation"},Re,F),!r&&!j?{tabIndex:0}:{}),Ye)}},[F,ke,ae,Pe,tt,ve,ye,se,fe,j,E,r]),Y=h.useCallback(function(ne){ne.stopPropagation()},[]),Se=h.useMemo(function(){return function(){var ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},he=ne.refKey,Re=he===void 0?"ref":he,Ke=ne.onChange,ge=ne.onClick,ut=cm(ne,MH),Rt=Sy({accept:D,multiple:l,type:"file",style:{display:"none"},onChange:ze(Da(Ke,fe)),onClick:ze(Da(ge,Y)),tabIndex:-1},Re,H);return Rr(Rr({},Rt),ut)}},[H,n,l,fe,r]);return Rr(Rr({},L),{},{isFocused:V&&!r,getRootProps:bn,getInputProps:Se,rootRef:F,inputRef:H,open:ze(xe)})}function HH(e,t){switch(t.type){case"focus":return Rr(Rr({},e),{},{isFocused:!0});case"blur":return Rr(Rr({},e),{},{isFocused:!1});case"openDialog":return Rr(Rr({},Cy),{},{isFileDialogActive:!0});case"closeDialog":return Rr(Rr({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Rr(Rr({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Rr(Rr({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return Rr({},Cy);default:return e}}function zC(){}function _y(){return _y=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},_y.apply(this,arguments)}var Aj=["shift","alt","meta","mod","ctrl"],VH={esc:"escape",return:"enter",".":"period",",":"comma","-":"slash"," ":"space","`":"backquote","#":"backslash","+":"bracketright",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function Gi(e){return(VH[e]||e).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function WH(e){return Aj.includes(e)}function i1(e,t){return t===void 0&&(t=","),e.split(t)}function l1(e,t,n){t===void 0&&(t="+");var r=e.toLocaleLowerCase().split(t).map(function(a){return Gi(a)}),o={alt:r.includes("alt"),ctrl:r.includes("ctrl")||r.includes("control"),shift:r.includes("shift"),meta:r.includes("meta"),mod:r.includes("mod")},s=r.filter(function(a){return!Aj.includes(a)});return _y({},o,{keys:s,description:n})}(function(){typeof document<"u"&&(document.addEventListener("keydown",function(e){e.key!==void 0&&zj([Gi(e.key),Gi(e.code)])}),document.addEventListener("keyup",function(e){e.key!==void 0&&$j([Gi(e.key),Gi(e.code)])})),typeof window<"u"&&window.addEventListener("blur",function(){qi.clear()})})();var qi=new Set;function Nj(e,t){t===void 0&&(t=",");var n=Array.isArray(e)?e:e.split(t);return n.every(function(r){return qi.has(r.trim().toLowerCase())})}function zj(e){var t=Array.isArray(e)?e:[e];qi.has("meta")&&qi.forEach(function(n){return!WH(n)&&qi.delete(n.toLowerCase())}),t.forEach(function(n){return qi.add(n.toLowerCase())})}function $j(e){var t=Array.isArray(e)?e:[e];e==="meta"?qi.clear():t.forEach(function(n){return qi.delete(n.toLowerCase())})}function UH(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function GH(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function qH(e){return Lj(e,["input","textarea","select"])}function Lj(e,t){var n=e.target;t===void 0&&(t=!1);var r=n&&n.tagName;return t instanceof Array?!!(r&&t&&t.some(function(o){return o.toLowerCase()===r.toLowerCase()})):!!(r&&t&&t===!0)}function YH(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 KH=function(t,n,r){r===void 0&&(r=!1);var o=n.alt,s=n.meta,a=n.mod,l=n.shift,u=n.ctrl,f=n.keys,p=t.key,m=t.code,v=t.ctrlKey,y=t.metaKey,S=t.shiftKey,x=t.altKey,w=Gi(m),_=p.toLowerCase();if(!r){if(o===!x&&_!=="alt"||l===!S&&_!=="shift")return!1;if(a){if(!y&&!v)return!1}else if(s===!y&&_!=="meta"&&_!=="os"||u===!v&&_!=="ctrl"&&_!=="control")return!1}return f&&f.length===1&&(f.includes(_)||f.includes(w))?!0:f?Nj(f):!f},XH=h.createContext(void 0),ZH=function(){return h.useContext(XH)};function Bj(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&&Bj(e[r],t[r])},!0):e===t}var QH=h.createContext({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),JH=function(){return h.useContext(QH)};function eV(e){var t=h.useRef(void 0);return Bj(t.current,e)||(t.current=e),t.current}var $C=function(t){t.stopPropagation(),t.preventDefault(),t.stopImmediatePropagation()},tV=typeof window<"u"?h.useLayoutEffect:h.useEffect;function nt(e,t,n,r){var o=h.useRef(null),s=h.useRef(!1),a=n instanceof Array?r instanceof Array?void 0:r:n,l=e instanceof Array?e.join(a==null?void 0:a.splitKey):e,u=n instanceof Array?n:r instanceof Array?r:void 0,f=h.useCallback(t,u??[]),p=h.useRef(f);u?p.current=f:p.current=t;var m=eV(a),v=JH(),y=v.enabledScopes,S=ZH();return tV(function(){if(!((m==null?void 0:m.enabled)===!1||!YH(y,m==null?void 0:m.scopes))){var x=function(I,j){var E;if(j===void 0&&(j=!1),!(qH(I)&&!Lj(I,m==null?void 0:m.enableOnFormTags))&&!(m!=null&&m.ignoreEventWhen!=null&&m.ignoreEventWhen(I))){if(o.current!==null&&document.activeElement!==o.current&&!o.current.contains(document.activeElement)){$C(I);return}(E=I.target)!=null&&E.isContentEditable&&!(m!=null&&m.enableOnContentEditable)||i1(l,m==null?void 0:m.splitKey).forEach(function(T){var R,M=l1(T,m==null?void 0:m.combinationKey);if(KH(I,M,m==null?void 0:m.ignoreModifiers)||(R=M.keys)!=null&&R.includes("*")){if(j&&s.current)return;if(UH(I,M,m==null?void 0:m.preventDefault),!GH(I,M,m==null?void 0:m.enabled)){$C(I);return}p.current(I,M),j||(s.current=!0)}})}},w=function(I){I.key!==void 0&&(zj(Gi(I.code)),((m==null?void 0:m.keydown)===void 0&&(m==null?void 0:m.keyup)!==!0||m!=null&&m.keydown)&&x(I))},_=function(I){I.key!==void 0&&($j(Gi(I.code)),s.current=!1,m!=null&&m.keyup&&x(I,!0))},k=o.current||(a==null?void 0:a.document)||document;return k.addEventListener("keyup",_),k.addEventListener("keydown",w),S&&i1(l,m==null?void 0:m.splitKey).forEach(function(P){return S.addHotkey(l1(P,m==null?void 0:m.combinationKey,m==null?void 0:m.description))}),function(){k.removeEventListener("keyup",_),k.removeEventListener("keydown",w),S&&i1(l,m==null?void 0:m.splitKey).forEach(function(P){return S.removeHotkey(l1(P,m==null?void 0:m.combinationKey,m==null?void 0:m.description))})}}},[l,m,y]),o}const nV=e=>{const{isDragAccept:t,isDragReject:n,setIsHandlingUpload:r}=e;return nt("esc",()=>{r(!1)}),i.jsx(et,{sx:{position:"absolute",top:0,insetInlineStart:0,width:"100vw",height:"100vh",zIndex:999,backdropFilter:"blur(20px)"},children:i.jsx(K,{sx:{opacity:.4,width:"100%",height:"100%",flexDirection:"column",rowGap:4,alignItems:"center",justifyContent:"center",bg:"base.900",boxShadow:`inset 0 0 20rem 1rem var(--invokeai-colors-${t?"accent":"error"}-500)`},children:t?i.jsx(ta,{size:"lg",children:"Drop to Upload"}):i.jsxs(i.Fragment,{children:[i.jsx(ta,{size:"lg",children:"Invalid Upload"}),i.jsx(ta,{size:"md",children:"Must be single JPEG or PNG image"})]})})})},rV=Te([pr,Gr],(e,t)=>{const{isConnected:n,isUploading:r}=e;return{isUploaderDisabled:!n||r,activeTabName:t}}),oV=e=>{const{children:t}=e,n=ue(),{isUploaderDisabled:r,activeTabName:o}=q(rV),s=jf(),{t:a}=Ce(),[l,u]=h.useState(!1),{setOpenUploaderFunction:f}=Qg(),p=h.useCallback(I=>{u(!0),s({title:a("toast.uploadFailed"),description:I.errors.map(j=>j.message).join(`
`),status:"error"})},[a,s]),m=h.useCallback(async I=>{n(t5({file:I,image_category:"user",is_intermediate:!1,postUploadAction:{type:"TOAST_UPLOADED"}}))},[n]),v=h.useCallback((I,j)=>{if(j.length>1){s({title:a("toast.uploadFailed"),description:a("toast.uploadFailedInvalidUploadDesc"),status:"error"});return}j.forEach(E=>{p(E)}),I.forEach(E=>{m(E)})},[a,s,m,p]),{getRootProps:y,getInputProps:S,isDragAccept:x,isDragReject:w,isDragActive:_,inputRef:k,open:P}=fb({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},noClick:!0,onDrop:v,onDragOver:()=>u(!0),disabled:r,multiple:!1});return h.useEffect(()=>{const I=async j=>{var E,T;k.current&&(E=j.clipboardData)!=null&&E.files&&(k.current.files=j.clipboardData.files,(T=k.current)==null||T.dispatchEvent(new Event("change",{bubbles:!0})))};return f(P),document.addEventListener("paste",I),()=>{document.removeEventListener("paste",I),f(()=>{})}},[k,P,f]),i.jsxs(et,{...y({style:{}}),onKeyDown:I=>{I.key},children:[i.jsx("input",{...S()}),t,_&&l&&i.jsx(nV,{isDragAccept:x,isDragReject:w,setIsHandlingUpload:u})]})},sV=h.memo(oV),pl=e=>e.gallery;const aV=Be((e,t)=>{const{children:n,tooltip:r="",tooltipProps:o,isChecked:s,...a}=e;return i.jsx(er,{label:r,...o,children:i.jsx($u,{ref:t,"aria-checked":s,...a,children:n})})}),fn=h.memo(aV),Ae=(e,t)=>n=>n==="light"?e:t,iV=e=>{const{label:t,...n}=e,{colorMode:r}=fo();return i.jsx(fP,{colorScheme:"accent",...n,children:i.jsx(lt,{sx:{fontSize:"sm",color:Ae("base.800","base.200")(r)},children:t})})},qn=h.memo(iV),Fj=Be((e,t)=>{const{role:n,tooltip:r="",tooltipProps:o,isChecked:s,...a}=e;return i.jsx(er,{label:r,hasArrow:!0,...o,...o!=null&&o.placement?{placement:o.placement}:{placement:"top"},children:i.jsx(mi,{ref:t,role:n,"aria-checked":s!==void 0?s:void 0,...a})})});Fj.displayName="IAIIconButton";const Me=h.memo(Fj),lV=e=>{const{triggerComponent:t,children:n,hasArrow:r=!0,isLazy:o=!0,...s}=e;return i.jsxs(U6,{isLazy:o,...s,children:[i.jsx(W6,{children:t}),i.jsxs(Y6,{shadow:"dark-lg",children:[r&&i.jsx(G6,{}),n]})]})},ii=h.memo(lV);var Hj={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},LC=B.createContext&&B.createContext(Hj),Xi=globalThis&&globalThis.__assign||function(){return Xi=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},Xi.apply(this,arguments)},cV=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 Vj(e){return e&&e.map(function(t,n){return B.createElement(t.tag,Xi({key:n},t.attr),Vj(t.child))})}function ct(e){return function(t){return B.createElement(uV,Xi({attr:Xi({},e.attr)},t),Vj(e.child))}}function uV(e){var t=function(n){var r=e.attr,o=e.size,s=e.title,a=cV(e,["attr","size","title"]),l=o||n.size||"1em",u;return n.className&&(u=n.className),e.className&&(u=(u?u+" ":"")+e.className),B.createElement("svg",Xi({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,a,{className:u,style:Xi(Xi({color:e.color||n.color},n.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),s&&B.createElement("title",null,s),e.children)};return LC!==void 0?B.createElement(LC.Consumer,null,function(n){return t(n)}):t(Hj)}function dV(e){return ct({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 Wj(e){return ct({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 fV(e){return ct({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 pV(e){return ct({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 hV(e){return ct({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 mV(e){return ct({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 pd={mt:1.5,fontSize:"2xs"},gV=e=>{const[t,n]=h.useState(!1),{label:r,value:o,min:s=1,max:a=100,step:l=1,onChange:u,tooltipSuffix:f="",withSliderMarks:p=!1,withInput:m=!1,isInteger:v=!1,inputWidth:y=16,inputReadOnly:S=!1,withReset:x=!1,hideTooltip:w=!1,isCompact:_=!1,isDisabled:k=!1,sliderMarks:P,handleReset:I,sliderFormControlProps:j,sliderFormLabelProps:E,sliderMarkProps:T,sliderTrackProps:R,sliderThumbProps:M,sliderNumberInputProps:D,sliderNumberInputFieldProps:N,sliderNumberInputStepperProps:U,sliderTooltipProps:z,sliderIAIIconButtonProps:F,...H}=e,{t:G}=Ce(),[A,L]=h.useState(String(o));h.useEffect(()=>{L(o)},[o]);const W=h.useMemo(()=>D!=null&&D.max?D.max:a,[a,D==null?void 0:D.max]),V=h.useCallback(Q=>{u(Q)},[u]),ee=h.useCallback(Q=>{Q.target.value===""&&(Q.target.value=String(s));const ie=ma(v?Math.floor(Number(Q.target.value)):Number(A),s,W),ve=_d(ie,l);u(ve),L(ve)},[v,A,s,W,u,l]),le=h.useCallback(Q=>{L(Q)},[]),oe=h.useCallback(()=>{I&&I()},[I]),X=h.useCallback(Q=>{Q.target instanceof HTMLDivElement&&Q.target.focus()},[]);return i.jsxs(_n,{onClick:X,sx:_?{display:"flex",flexDirection:"row",alignItems:"center",columnGap:4,margin:0,padding:0}:{},isDisabled:k,...j,children:[r&&i.jsx(jn,{...E,mb:-1,children:r}),i.jsxs(aa,{w:"100%",gap:2,alignItems:"center",children:[i.jsxs(cj,{"aria-label":r,value:o,min:s,max:a,step:l,onChange:V,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),focusThumbOnChange:!1,isDisabled:k,...H,children:[p&&!P&&i.jsxs(i.Fragment,{children:[i.jsx(Wc,{value:s,sx:{insetInlineStart:"0 !important",insetInlineEnd:"unset !important",...pd},...T,children:s}),i.jsx(Wc,{value:a,sx:{insetInlineStart:"unset !important",insetInlineEnd:"0 !important",...pd},...T,children:a})]}),p&&P&&i.jsx(i.Fragment,{children:P.map((Q,ie)=>ie===0?i.jsx(Wc,{value:Q,sx:{insetInlineStart:"0 !important",insetInlineEnd:"unset !important",...pd},...T,children:Q},Q):ie===P.length-1?i.jsx(Wc,{value:Q,sx:{insetInlineStart:"unset !important",insetInlineEnd:"0 !important",...pd},...T,children:Q},Q):i.jsx(Wc,{value:Q,sx:{...pd},...T,children:Q},Q))}),i.jsx(dj,{...R,children:i.jsx(fj,{})}),i.jsx(er,{hasArrow:!0,placement:"top",isOpen:t,label:`${o}${f}`,hidden:w,...z,children:i.jsx(uj,{...M,zIndex:0})})]}),m&&i.jsxs(Lg,{min:s,max:W,step:l,value:A,onChange:le,onBlur:ee,focusInputOnChange:!1,...D,children:[i.jsx(Fg,{readOnly:S,minWidth:y,...N}),i.jsxs(Bg,{...U,children:[i.jsx(Vg,{onClick:()=>u(Number(A))}),i.jsx(Hg,{onClick:()=>u(Number(A))})]})]}),x&&i.jsx(Me,{size:"sm","aria-label":G("accessibility.reset"),tooltip:G("accessibility.reset"),icon:i.jsx(Wj,{}),isDisabled:k,onClick:oe,...F})]})]})},Tt=h.memo(gV);/*!
* OverlayScrollbars
* Version: 2.2.0
*
* Copyright (c) Rene Haas | KingSora.
* https://github.com/KingSora
*
* Released under the MIT license.
*/function Hn(e,t){if(ev(e))for(let n=0;n<e.length&&t(e[n],n,e)!==!1;n++);else e&&Hn(Object.keys(e),n=>t(e[n],n,e));return e}function wo(e,t){const n=hl(t);if(wa(t)||n){let o=n?"":{};if(e){const s=window.getComputedStyle(e,null);o=n?VC(e,s,t):t.reduce((a,l)=>(a[l]=VC(e,s,l),a),o)}return o}e&&Hn(fs(t),o=>RV(e,o,t[o]))}const na=(e,t)=>{const{o:n,u:r,_:o}=e;let s=n,a;const l=(p,m)=>{const v=s,y=p,S=m||(r?!r(v,y):v!==y);return(S||o)&&(s=y,a=v),[s,S,a]};return[t?p=>l(t(s,a),p):l,p=>[s,!!p,a]]},Ff=()=>typeof window<"u",Uj=Ff()&&Node.ELEMENT_NODE,{toString:vV,hasOwnProperty:c1}=Object.prototype,ki=e=>e===void 0,Jg=e=>e===null,yV=e=>ki(e)||Jg(e)?`${e}`:vV.call(e).replace(/^\[object (.+)\]$/,"$1").toLowerCase(),Zi=e=>typeof e=="number",hl=e=>typeof e=="string",pb=e=>typeof e=="boolean",ba=e=>typeof e=="function",wa=e=>Array.isArray(e),Qd=e=>typeof e=="object"&&!wa(e)&&!Jg(e),ev=e=>{const t=!!e&&e.length,n=Zi(t)&&t>-1&&t%1==0;return wa(e)||!ba(e)&&n?t>0&&Qd(e)?t-1 in e:!0:!1},ky=e=>{if(!e||!Qd(e)||yV(e)!=="object")return!1;let t;const n="constructor",r=e[n],o=r&&r.prototype,s=c1.call(e,n),a=o&&c1.call(o,"isPrototypeOf");if(r&&!s&&!a)return!1;for(t in e);return ki(t)||c1.call(e,t)},um=e=>{const t=HTMLElement;return e?t?e instanceof t:e.nodeType===Uj:!1},tv=e=>{const t=Element;return e?t?e instanceof t:e.nodeType===Uj:!1},hb=(e,t,n)=>e.indexOf(t,n),Jn=(e,t,n)=>(!n&&!hl(t)&&ev(t)?Array.prototype.push.apply(e,t):e.push(t),e),tc=e=>{const t=Array.from,n=[];return t&&e?t(e):(e instanceof Set?e.forEach(r=>{Jn(n,r)}):Hn(e,r=>{Jn(n,r)}),n)},mb=e=>!!e&&e.length===0,Ka=(e,t,n)=>{Hn(e,o=>o&&o.apply(void 0,t||[])),!n&&(e.length=0)},nv=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),fs=e=>e?Object.keys(e):[],Dr=(e,t,n,r,o,s,a)=>{const l=[t,n,r,o,s,a];return(typeof e!="object"||Jg(e))&&!ba(e)&&(e={}),Hn(l,u=>{Hn(fs(u),f=>{const p=u[f];if(e===p)return!0;const m=wa(p);if(p&&(ky(p)||m)){const v=e[f];let y=v;m&&!wa(v)?y=[]:!m&&!ky(v)&&(y={}),e[f]=Dr(y,p)}else e[f]=p})}),e},gb=e=>{for(const t in e)return!1;return!0},Gj=(e,t,n,r)=>{if(ki(r))return n?n[e]:t;n&&(hl(r)||Zi(r))&&(n[e]=r)},bo=(e,t,n)=>{if(ki(n))return e?e.getAttribute(t):null;e&&e.setAttribute(t,n)},Wo=(e,t)=>{e&&e.removeAttribute(t)},Gl=(e,t,n,r)=>{if(n){const o=bo(e,t)||"",s=new Set(o.split(" "));s[r?"add":"delete"](n);const a=tc(s).join(" ").trim();bo(e,t,a)}},xV=(e,t,n)=>{const r=bo(e,t)||"";return new Set(r.split(" ")).has(n)},la=(e,t)=>Gj("scrollLeft",0,e,t),li=(e,t)=>Gj("scrollTop",0,e,t),Py=Ff()&&Element.prototype,qj=(e,t)=>{const n=[],r=t?tv(t)?t:null:document;return r?Jn(n,r.querySelectorAll(e)):n},bV=(e,t)=>{const n=t?tv(t)?t:null:document;return n?n.querySelector(e):null},dm=(e,t)=>tv(e)?(Py.matches||Py.msMatchesSelector).call(e,t):!1,vb=e=>e?tc(e.childNodes):[],yi=e=>e?e.parentElement:null,Kc=(e,t)=>{if(tv(e)){const n=Py.closest;if(n)return n.call(e,t);do{if(dm(e,t))return e;e=yi(e)}while(e)}return null},wV=(e,t,n)=>{const r=e&&Kc(e,t),o=e&&bV(n,r),s=Kc(o,t)===r;return r&&o?r===e||o===e||s&&Kc(Kc(e,n),t)!==r:!1},yb=(e,t,n)=>{if(n&&e){let r=t,o;ev(n)?(o=document.createDocumentFragment(),Hn(n,s=>{s===r&&(r=s.previousSibling),o.appendChild(s)})):o=n,t&&(r?r!==t&&(r=r.nextSibling):r=e.firstChild),e.insertBefore(o,r||null)}},Os=(e,t)=>{yb(e,null,t)},SV=(e,t)=>{yb(yi(e),e,t)},BC=(e,t)=>{yb(yi(e),e&&e.nextSibling,t)},Va=e=>{if(ev(e))Hn(tc(e),t=>Va(t));else if(e){const t=yi(e);t&&t.removeChild(e)}},ql=e=>{const t=document.createElement("div");return e&&bo(t,"class",e),t},Yj=e=>{const t=ql();return t.innerHTML=e.trim(),Hn(vb(t),n=>Va(n))},jy=e=>e.charAt(0).toUpperCase()+e.slice(1),CV=()=>ql().style,_V=["-webkit-","-moz-","-o-","-ms-"],kV=["WebKit","Moz","O","MS","webkit","moz","o","ms"],u1={},d1={},PV=e=>{let t=d1[e];if(nv(d1,e))return t;const n=jy(e),r=CV();return Hn(_V,o=>{const s=o.replace(/-/g,"");return!(t=[e,o+e,s+n,jy(s)+n].find(l=>r[l]!==void 0))}),d1[e]=t||""},Hf=e=>{if(Ff()){let t=u1[e]||window[e];return nv(u1,e)||(Hn(kV,n=>(t=t||window[n+jy(e)],!t)),u1[e]=t),t}},jV=Hf("MutationObserver"),FC=Hf("IntersectionObserver"),Xc=Hf("ResizeObserver"),Kj=Hf("cancelAnimationFrame"),Xj=Hf("requestAnimationFrame"),fm=Ff()&&window.setTimeout,Iy=Ff()&&window.clearTimeout,IV=/[^\x20\t\r\n\f]+/g,Zj=(e,t,n)=>{const r=e&&e.classList;let o,s=0,a=!1;if(r&&t&&hl(t)){const l=t.match(IV)||[];for(a=l.length>0;o=l[s++];)a=!!n(r,o)&&a}return a},xb=(e,t)=>{Zj(e,t,(n,r)=>n.remove(r))},ci=(e,t)=>(Zj(e,t,(n,r)=>n.add(r)),xb.bind(0,e,t)),rv=(e,t,n,r)=>{if(e&&t){let o=!0;return Hn(n,s=>{const a=r?r(e[s]):e[s],l=r?r(t[s]):t[s];a!==l&&(o=!1)}),o}return!1},Qj=(e,t)=>rv(e,t,["w","h"]),Jj=(e,t)=>rv(e,t,["x","y"]),EV=(e,t)=>rv(e,t,["t","r","b","l"]),HC=(e,t,n)=>rv(e,t,["width","height"],n&&(r=>Math.round(r))),Es=()=>{},Uc=e=>{let t;const n=e?fm:Xj,r=e?Iy:Kj;return[o=>{r(t),t=n(o,ba(e)?e():e)},()=>r(t)]},bb=(e,t)=>{let n,r,o,s=Es;const{v:a,g:l,p:u}=t||{},f=function(S){s(),Iy(n),n=r=void 0,s=Es,e.apply(this,S)},p=y=>u&&r?u(r,y):y,m=()=>{s!==Es&&f(p(o)||o)},v=function(){const S=tc(arguments),x=ba(a)?a():a;if(Zi(x)&&x>=0){const _=ba(l)?l():l,k=Zi(_)&&_>=0,P=x>0?fm:Xj,I=x>0?Iy:Kj,E=p(S)||S,T=f.bind(0,E);s();const R=P(T,x);s=()=>I(R),k&&!n&&(n=fm(m,_)),r=o=E}else f(S)};return v.m=m,v},OV={opacity:1,zindex:1},Wp=(e,t)=>{const n=t?parseFloat(e):parseInt(e,10);return n===n?n:0},TV=(e,t)=>!OV[e.toLowerCase()]&&Zi(t)?`${t}px`:t,VC=(e,t,n)=>t!=null?t[n]||t.getPropertyValue(n):e.style[n],RV=(e,t,n)=>{try{const{style:r}=e;ki(r[t])?r.setProperty(t,n):r[t]=TV(t,n)}catch{}},Jd=e=>wo(e,"direction")==="rtl",WC=(e,t,n)=>{const r=t?`${t}-`:"",o=n?`-${n}`:"",s=`${r}top${o}`,a=`${r}right${o}`,l=`${r}bottom${o}`,u=`${r}left${o}`,f=wo(e,[s,a,l,u]);return{t:Wp(f[s],!0),r:Wp(f[a],!0),b:Wp(f[l],!0),l:Wp(f[u],!0)}},{round:UC}=Math,wb={w:0,h:0},nc=e=>e?{w:e.offsetWidth,h:e.offsetHeight}:wb,Dh=e=>e?{w:e.clientWidth,h:e.clientHeight}:wb,pm=e=>e?{w:e.scrollWidth,h:e.scrollHeight}:wb,hm=e=>{const t=parseFloat(wo(e,"height"))||0,n=parseFloat(wo(e,"width"))||0;return{w:n-UC(n),h:t-UC(t)}},Yi=e=>e.getBoundingClientRect();let Up;const MV=()=>{if(ki(Up)){Up=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get(){Up=!0}}))}catch{}}return Up},eI=e=>e.split(" "),DV=(e,t,n,r)=>{Hn(eI(t),o=>{e.removeEventListener(o,n,r)})},eo=(e,t,n,r)=>{var o;const s=MV(),a=(o=s&&r&&r.S)!=null?o:s,l=r&&r.$||!1,u=r&&r.C||!1,f=[],p=s?{passive:a,capture:l}:l;return Hn(eI(t),m=>{const v=u?y=>{e.removeEventListener(m,v,l),n&&n(y)}:n;Jn(f,DV.bind(null,e,m,v,l)),e.addEventListener(m,v,p)}),Ka.bind(0,f)},tI=e=>e.stopPropagation(),nI=e=>e.preventDefault(),AV={x:0,y:0},f1=e=>{const t=e?Yi(e):0;return t?{x:t.left+window.pageYOffset,y:t.top+window.pageXOffset}:AV},GC=(e,t)=>{Hn(wa(t)?t:[t],e)},Sb=e=>{const t=new Map,n=(s,a)=>{if(s){const l=t.get(s);GC(u=>{l&&l[u?"delete":"clear"](u)},a)}else t.forEach(l=>{l.clear()}),t.clear()},r=(s,a)=>{if(hl(s)){const f=t.get(s)||new Set;return t.set(s,f),GC(p=>{ba(p)&&f.add(p)},a),n.bind(0,s,a)}pb(a)&&a&&n();const l=fs(s),u=[];return Hn(l,f=>{const p=s[f];p&&Jn(u,r(f,p))}),Ka.bind(0,u)},o=(s,a)=>{const l=t.get(s);Hn(tc(l),u=>{a&&!mb(a)?u.apply(0,a):u()})};return r(e||{}),[r,n,o]},qC=e=>JSON.stringify(e,(t,n)=>{if(ba(n))throw new Error;return n}),NV={paddingAbsolute:!1,showNativeOverlaidScrollbars:!1,update:{elementEvents:[["img","load"]],debounce:[0,33],attributes:null,ignoreMutation:null},overflow:{x:"scroll",y:"scroll"},scrollbars:{theme:"os-theme-dark",visibility:"auto",autoHide:"never",autoHideDelay:1300,dragScroll:!0,clickScroll:!1,pointers:["mouse","touch","pen"]}},rI=(e,t)=>{const n={},r=fs(t).concat(fs(e));return Hn(r,o=>{const s=e[o],a=t[o];if(Qd(s)&&Qd(a))Dr(n[o]={},rI(s,a)),gb(n[o])&&delete n[o];else if(nv(t,o)&&a!==s){let l=!0;if(wa(s)||wa(a))try{qC(s)===qC(a)&&(l=!1)}catch{}l&&(n[o]=a)}}),n},oI="os-environment",sI=`${oI}-flexbox-glue`,zV=`${sI}-max`,aI="os-scrollbar-hidden",p1="data-overlayscrollbars-initialize",ra="data-overlayscrollbars",iI=`${ra}-overflow-x`,lI=`${ra}-overflow-y`,cu="overflowVisible",$V="scrollbarHidden",YC="scrollbarPressed",mm="updating",Hi="data-overlayscrollbars-viewport",h1="arrange",cI="scrollbarHidden",uu=cu,Ey="data-overlayscrollbars-padding",LV=uu,KC="data-overlayscrollbars-content",Cb="os-size-observer",BV=`${Cb}-appear`,FV=`${Cb}-listener`,HV="os-trinsic-observer",VV="os-no-css-vars",WV="os-theme-none",Ko="os-scrollbar",UV=`${Ko}-rtl`,GV=`${Ko}-horizontal`,qV=`${Ko}-vertical`,uI=`${Ko}-track`,_b=`${Ko}-handle`,YV=`${Ko}-visible`,KV=`${Ko}-cornerless`,XC=`${Ko}-transitionless`,ZC=`${Ko}-interaction`,QC=`${Ko}-unusable`,JC=`${Ko}-auto-hidden`,e4=`${Ko}-wheel`,XV=`${uI}-interactive`,ZV=`${_b}-interactive`,dI={},rc=()=>dI,QV=e=>{const t=[];return Hn(wa(e)?e:[e],n=>{const r=fs(n);Hn(r,o=>{Jn(t,dI[o]=n[o])})}),t},JV="__osOptionsValidationPlugin",eW="__osSizeObserverPlugin",kb="__osScrollbarsHidingPlugin",tW="__osClickScrollPlugin";let m1;const t4=(e,t,n,r)=>{Os(e,t);const o=Dh(t),s=nc(t),a=hm(n);return r&&Va(t),{x:s.h-o.h+a.h,y:s.w-o.w+a.w}},nW=e=>{let t=!1;const n=ci(e,aI);try{t=wo(e,PV("scrollbar-width"))==="none"||window.getComputedStyle(e,"::-webkit-scrollbar").getPropertyValue("display")==="none"}catch{}return n(),t},rW=(e,t)=>{const n="hidden";wo(e,{overflowX:n,overflowY:n,direction:"rtl"}),la(e,0);const r=f1(e),o=f1(t);la(e,-999);const s=f1(t);return{i:r.x===o.x,n:o.x!==s.x}},oW=(e,t)=>{const n=ci(e,sI),r=Yi(e),o=Yi(t),s=HC(o,r,!0),a=ci(e,zV),l=Yi(e),u=Yi(t),f=HC(u,l,!0);return n(),a(),s&&f},sW=()=>{const{body:e}=document,n=Yj(`<div class="${oI}"><div></div></div>`)[0],r=n.firstChild,[o,,s]=Sb(),[a,l]=na({o:t4(e,n,r),u:Jj},t4.bind(0,e,n,r,!0)),[u]=l(),f=nW(n),p={x:u.x===0,y:u.y===0},m={elements:{host:null,padding:!f,viewport:k=>f&&k===k.ownerDocument.body&&k,content:!1},scrollbars:{slot:!0},cancel:{nativeScrollbarsOverlaid:!1,body:null}},v=Dr({},NV),y=Dr.bind(0,{},v),S=Dr.bind(0,{},m),x={k:u,A:p,I:f,L:wo(n,"zIndex")==="-1",B:rW(n,r),V:oW(n,r),Y:o.bind(0,"z"),j:o.bind(0,"r"),N:S,q:k=>Dr(m,k)&&S(),F:y,G:k=>Dr(v,k)&&y(),X:Dr({},m),U:Dr({},v)},w=window.addEventListener,_=bb(k=>s(k?"z":"r"),{v:33,g:99});if(Wo(n,"style"),Va(n),w("resize",_.bind(0,!1)),!f&&(!p.x||!p.y)){let k;w("resize",()=>{const P=rc()[kb];k=k||P&&P.R(),k&&k(x,a,_.bind(0,!0))})}return x},Xo=()=>(m1||(m1=sW()),m1),Pb=(e,t)=>ba(t)?t.apply(0,e):t,aW=(e,t,n,r)=>{const o=ki(r)?n:r;return Pb(e,o)||t.apply(0,e)},fI=(e,t,n,r)=>{const o=ki(r)?n:r,s=Pb(e,o);return!!s&&(um(s)?s:t.apply(0,e))},iW=(e,t,n)=>{const{nativeScrollbarsOverlaid:r,body:o}=n||{},{A:s,I:a}=Xo(),{nativeScrollbarsOverlaid:l,body:u}=t,f=r??l,p=ki(o)?u:o,m=(s.x||s.y)&&f,v=e&&(Jg(p)?!a:p);return!!m||!!v},jb=new WeakMap,lW=(e,t)=>{jb.set(e,t)},cW=e=>{jb.delete(e)},pI=e=>jb.get(e),n4=(e,t)=>e?t.split(".").reduce((n,r)=>n&&nv(n,r)?n[r]:void 0,e):void 0,Oy=(e,t,n)=>r=>[n4(e,r),n||n4(t,r)!==void 0],hI=e=>{let t=e;return[()=>t,n=>{t=Dr({},t,n)}]},Gp="tabindex",qp=ql.bind(0,""),g1=e=>{Os(yi(e),vb(e)),Va(e)},uW=e=>{const t=Xo(),{N:n,I:r}=t,o=rc()[kb],s=o&&o.T,{elements:a}=n(),{host:l,padding:u,viewport:f,content:p}=a,m=um(e),v=m?{}:e,{elements:y}=v,{host:S,padding:x,viewport:w,content:_}=y||{},k=m?e:v.target,P=dm(k,"textarea"),I=k.ownerDocument,j=I.documentElement,E=k===I.body,T=I.defaultView,R=aW.bind(0,[k]),M=fI.bind(0,[k]),D=Pb.bind(0,[k]),N=R.bind(0,qp,f),U=M.bind(0,qp,p),z=N(w),F=z===k,H=F&&E,G=!F&&U(_),A=!F&&um(z)&&z===G,L=A&&!!D(p),W=L?N():z,V=L?G:U(),le=H?j:A?W:z,oe=P?R(qp,l,S):k,X=H?le:oe,Q=A?V:G,ie=I.activeElement,ve=!F&&T.top===T&&ie===k,ye={W:k,Z:X,J:le,K:!F&&M(qp,u,x),tt:Q,nt:!F&&!r&&s&&s(t),ot:H?j:le,st:H?I:le,et:T,ct:I,rt:P,it:E,lt:m,ut:F,dt:A,ft:(Y,Se)=>xV(le,F?ra:Hi,F?Se:Y),_t:(Y,Se,ne)=>Gl(le,F?ra:Hi,F?Se:Y,ne)},se=fs(ye).reduce((Y,Se)=>{const ne=ye[Se];return Jn(Y,ne&&!yi(ne)?ne:!1)},[]),de=Y=>Y?hb(se,Y)>-1:null,{W:fe,Z:xe,K:ke,J:ae,tt:Pe,nt:tt}=ye,ze=[()=>{Wo(xe,ra),Wo(xe,p1),Wo(fe,p1),E&&(Wo(j,ra),Wo(j,p1))}],We=P&&de(xe);let It=P?fe:vb([Pe,ae,ke,xe,fe].find(Y=>de(Y)===!1));const pt=H?fe:Pe||ae;return[ye,()=>{bo(xe,ra,F?"viewport":"host"),bo(ke,Ey,""),bo(Pe,KC,""),F||bo(ae,Hi,"");const Y=E&&!F?ci(yi(k),aI):Es;if(We&&(BC(fe,xe),Jn(ze,()=>{BC(xe,fe),Va(xe)})),Os(pt,It),Os(xe,ke),Os(ke||xe,!F&&ae),Os(ae,Pe),Jn(ze,()=>{Y(),Wo(ke,Ey),Wo(Pe,KC),Wo(ae,iI),Wo(ae,lI),Wo(ae,Hi),de(Pe)&&g1(Pe),de(ae)&&g1(ae),de(ke)&&g1(ke)}),r&&!F&&(Gl(ae,Hi,cI,!0),Jn(ze,Wo.bind(0,ae,Hi))),tt&&(SV(ae,tt),Jn(ze,Va.bind(0,tt))),ve){const Se=bo(ae,Gp);bo(ae,Gp,"-1"),ae.focus();const ne=()=>Se?bo(ae,Gp,Se):Wo(ae,Gp),he=eo(I,"pointerdown keydown",()=>{ne(),he()});Jn(ze,[ne,he])}else ie&&ie.focus&&ie.focus();It=0},Ka.bind(0,ze)]},dW=(e,t)=>{const{tt:n}=e,[r]=t;return o=>{const{V:s}=Xo(),{ht:a}=r(),{vt:l}=o,u=(n||!s)&&l;return u&&wo(n,{height:a?"":"100%"}),{gt:u,wt:u}}},fW=(e,t)=>{const[n,r]=t,{Z:o,K:s,J:a,ut:l}=e,[u,f]=na({u:EV,o:WC()},WC.bind(0,o,"padding",""));return(p,m,v)=>{let[y,S]=f(v);const{I:x,V:w}=Xo(),{bt:_}=n(),{gt:k,wt:P,yt:I}=p,[j,E]=m("paddingAbsolute");(k||S||!w&&P)&&([y,S]=u(v));const R=!l&&(E||I||S);if(R){const M=!j||!s&&!x,D=y.r+y.l,N=y.t+y.b,U={marginRight:M&&!_?-D:0,marginBottom:M?-N:0,marginLeft:M&&_?-D:0,top:M?-y.t:0,right:M?_?-y.r:"auto":0,left:M?_?"auto":-y.l:0,width:M?`calc(100% + ${D}px)`:""},z={paddingTop:M?y.t:0,paddingRight:M?y.r:0,paddingBottom:M?y.b:0,paddingLeft:M?y.l:0};wo(s||a,U),wo(a,z),r({K:y,St:!M,P:s?z:Dr({},U,z)})}return{xt:R}}},{max:Ty}=Math,Vi=Ty.bind(0,0),mI="visible",r4="hidden",pW=42,Yp={u:Qj,o:{w:0,h:0}},hW={u:Jj,o:{x:r4,y:r4}},mW=(e,t)=>{const n=window.devicePixelRatio%1!==0?1:0,r={w:Vi(e.w-t.w),h:Vi(e.h-t.h)};return{w:r.w>n?r.w:0,h:r.h>n?r.h:0}},Kp=e=>e.indexOf(mI)===0,gW=(e,t)=>{const[n,r]=t,{Z:o,K:s,J:a,nt:l,ut:u,_t:f,it:p,et:m}=e,{k:v,V:y,I:S,A:x}=Xo(),w=rc()[kb],_=!u&&!S&&(x.x||x.y),k=p&&u,[P,I]=na(Yp,hm.bind(0,a)),[j,E]=na(Yp,pm.bind(0,a)),[T,R]=na(Yp),[M,D]=na(Yp),[N]=na(hW),U=(L,W)=>{if(wo(a,{height:""}),W){const{St:V,K:ee}=n(),{$t:le,D:oe}=L,X=hm(o),Q=Dh(o),ie=wo(a,"boxSizing")==="content-box",ve=V||ie?ee.b+ee.t:0,ye=!(x.x&&ie);wo(a,{height:Q.h+X.h+(le.x&&ye?oe.x:0)-ve})}},z=(L,W)=>{const V=!S&&!L?pW:0,ee=(de,fe,xe)=>{const ke=wo(a,de),Pe=(W?W[de]:ke)==="scroll";return[ke,Pe,Pe&&!S?fe?V:xe:0,fe&&!!V]},[le,oe,X,Q]=ee("overflowX",x.x,v.x),[ie,ve,ye,se]=ee("overflowY",x.y,v.y);return{Ct:{x:le,y:ie},$t:{x:oe,y:ve},D:{x:X,y:ye},M:{x:Q,y:se}}},F=(L,W,V,ee)=>{const le=(ve,ye)=>{const se=Kp(ve),de=ye&&se&&ve.replace(`${mI}-`,"")||"";return[ye&&!se?ve:"",Kp(de)?"hidden":de]},[oe,X]=le(V.x,W.x),[Q,ie]=le(V.y,W.y);return ee.overflowX=X&&Q?X:oe,ee.overflowY=ie&&oe?ie:Q,z(L,ee)},H=(L,W,V,ee)=>{const{D:le,M:oe}=L,{x:X,y:Q}=oe,{x:ie,y:ve}=le,{P:ye}=n(),se=W?"marginLeft":"marginRight",de=W?"paddingLeft":"paddingRight",fe=ye[se],xe=ye.marginBottom,ke=ye[de],ae=ye.paddingBottom;ee.width=`calc(100% + ${ve+-1*fe}px)`,ee[se]=-ve+fe,ee.marginBottom=-ie+xe,V&&(ee[de]=ke+(Q?ve:0),ee.paddingBottom=ae+(X?ie:0))},[G,A]=w?w.H(_,y,a,l,n,z,H):[()=>_,()=>[Es]];return(L,W,V)=>{const{gt:ee,Ot:le,wt:oe,xt:X,vt:Q,yt:ie}=L,{ht:ve,bt:ye}=n(),[se,de]=W("showNativeOverlaidScrollbars"),[fe,xe]=W("overflow"),ke=se&&x.x&&x.y,ae=!u&&!y&&(ee||oe||le||de||Q),Pe=Kp(fe.x),tt=Kp(fe.y),ze=Pe||tt;let We=I(V),It=E(V),pt=R(V),bn=D(V),Y;if(de&&S&&f(cI,$V,!ke),ae&&(Y=z(ke),U(Y,ve)),ee||X||oe||ie||de){ze&&f(uu,cu,!1);const[Ie,Ye]=A(ke,ye,Y),[ht,vt]=We=P(V),[Gt,Er]=It=j(V),gn=Dh(a);let vn=Gt,Hr=gn;Ie(),(Er||vt||de)&&Ye&&!ke&&G(Ye,Gt,ht,ye)&&(Hr=Dh(a),vn=pm(a));const Kn={w:Vi(Ty(Gt.w,vn.w)+ht.w),h:Vi(Ty(Gt.h,vn.h)+ht.h)},Qn={w:Vi((k?m.innerWidth:Hr.w+Vi(gn.w-Gt.w))+ht.w),h:Vi((k?m.innerHeight+ht.h:Hr.h+Vi(gn.h-Gt.h))+ht.h)};bn=M(Qn),pt=T(mW(Kn,Qn),V)}const[Se,ne]=bn,[he,Re]=pt,[Ke,ge]=It,[ut,Rt]=We,en={x:he.w>0,y:he.h>0},$e=Pe&&tt&&(en.x||en.y)||Pe&&en.x&&!en.y||tt&&en.y&&!en.x;if(X||ie||Rt||ge||ne||Re||xe||de||ae){const Ie={marginRight:0,marginBottom:0,marginLeft:0,width:"",overflowY:"",overflowX:""},Ye=F(ke,en,fe,Ie),ht=G(Ye,Ke,ut,ye);u||H(Ye,ye,ht,Ie),ae&&U(Ye,ve),u?(bo(o,iI,Ie.overflowX),bo(o,lI,Ie.overflowY)):wo(a,Ie)}Gl(o,ra,cu,$e),Gl(s,Ey,LV,$e),u||Gl(a,Hi,uu,ze);const[Xe,On]=N(z(ke).Ct);return r({Ct:Xe,zt:{x:Se.w,y:Se.h},Tt:{x:he.w,y:he.h},Et:en}),{It:On,At:ne,Lt:Re}}},o4=(e,t,n)=>{const r={},o=t||{},s=fs(e).concat(fs(o));return Hn(s,a=>{const l=e[a],u=o[a];r[a]=!!(n||l||u)}),r},vW=(e,t)=>{const{W:n,J:r,_t:o,ut:s}=e,{I:a,A:l,V:u}=Xo(),f=!a&&(l.x||l.y),p=[dW(e,t),fW(e,t),gW(e,t)];return(m,v,y)=>{const S=o4(Dr({gt:!1,xt:!1,yt:!1,vt:!1,At:!1,Lt:!1,It:!1,Ot:!1,wt:!1},v),{},y),x=f||!u,w=x&&la(r),_=x&&li(r);o("",mm,!0);let k=S;return Hn(p,P=>{k=o4(k,P(k,m,!!y)||{},y)}),la(r,w),li(r,_),o("",mm),s||(la(n,0),li(n,0)),k}},yW=(e,t,n)=>{let r,o=!1;const s=()=>{o=!0},a=l=>{if(n){const u=n.reduce((f,p)=>{if(p){const[m,v]=p,y=v&&m&&(l?l(m):qj(m,e));y&&y.length&&v&&hl(v)&&Jn(f,[y,v.trim()],!0)}return f},[]);Hn(u,f=>Hn(f[0],p=>{const m=f[1],v=r.get(p)||[];if(e.contains(p)){const S=eo(p,m,x=>{o?(S(),r.delete(p)):t(x)});r.set(p,Jn(v,S))}else Ka(v),r.delete(p)}))}};return n&&(r=new WeakMap,a()),[s,a]},s4=(e,t,n,r)=>{let o=!1;const{Ht:s,Pt:a,Dt:l,Mt:u,Rt:f,kt:p}=r||{},m=bb(()=>{o&&n(!0)},{v:33,g:99}),[v,y]=yW(e,m,l),S=s||[],x=a||[],w=S.concat(x),_=(P,I)=>{const j=f||Es,E=p||Es,T=new Set,R=new Set;let M=!1,D=!1;if(Hn(P,N=>{const{attributeName:U,target:z,type:F,oldValue:H,addedNodes:G,removedNodes:A}=N,L=F==="attributes",W=F==="childList",V=e===z,ee=L&&hl(U)?bo(z,U):0,le=ee!==0&&H!==ee,oe=hb(x,U)>-1&&le;if(t&&(W||!V)){const X=!L,Q=L&&le,ie=Q&&u&&dm(z,u),ye=(ie?!j(z,U,H,ee):X||Q)&&!E(N,!!ie,e,r);Hn(G,se=>T.add(se)),Hn(A,se=>T.add(se)),D=D||ye}!t&&V&&le&&!j(z,U,H,ee)&&(R.add(U),M=M||oe)}),T.size>0&&y(N=>tc(T).reduce((U,z)=>(Jn(U,qj(N,z)),dm(z,N)?Jn(U,z):U),[])),t)return!I&&D&&n(!1),[!1];if(R.size>0||M){const N=[tc(R),M];return!I&&n.apply(0,N),N}},k=new jV(P=>_(P));return k.observe(e,{attributes:!0,attributeOldValue:!0,attributeFilter:w,subtree:t,childList:t,characterData:t}),o=!0,[()=>{o&&(v(),k.disconnect(),o=!1)},()=>{if(o){m.m();const P=k.takeRecords();return!mb(P)&&_(P,!0)}}]},Xp=3333333,Zp=e=>e&&(e.height||e.width),gI=(e,t,n)=>{const{Bt:r=!1,Vt:o=!1}=n||{},s=rc()[eW],{B:a}=Xo(),u=Yj(`<div class="${Cb}"><div class="${FV}"></div></div>`)[0],f=u.firstChild,p=Jd.bind(0,e),[m]=na({o:void 0,_:!0,u:(x,w)=>!(!x||!Zp(x)&&Zp(w))}),v=x=>{const w=wa(x)&&x.length>0&&Qd(x[0]),_=!w&&pb(x[0]);let k=!1,P=!1,I=!0;if(w){const[j,,E]=m(x.pop().contentRect),T=Zp(j),R=Zp(E);k=!E||!T,P=!R&&T,I=!k}else _?[,I]=x:P=x===!0;if(r&&I){const j=_?x[0]:Jd(u);la(u,j?a.n?-Xp:a.i?0:Xp:Xp),li(u,Xp)}k||t({gt:!_,Yt:_?x:void 0,Vt:!!P})},y=[];let S=o?v:!1;return[()=>{Ka(y),Va(u)},()=>{if(Xc){const x=new Xc(v);x.observe(f),Jn(y,()=>{x.disconnect()})}else if(s){const[x,w]=s.O(f,v,o);S=x,Jn(y,w)}if(r){const[x]=na({o:void 0},p);Jn(y,eo(u,"scroll",w=>{const _=x(),[k,P,I]=_;P&&(xb(f,"ltr rtl"),k?ci(f,"rtl"):ci(f,"ltr"),v([!!k,P,I])),tI(w)}))}S&&(ci(u,BV),Jn(y,eo(u,"animationstart",S,{C:!!Xc}))),(Xc||s)&&Os(e,u)}]},xW=e=>e.h===0||e.isIntersecting||e.intersectionRatio>0,bW=(e,t)=>{let n;const r=ql(HV),o=[],[s]=na({o:!1}),a=(u,f)=>{if(u){const p=s(xW(u)),[,m]=p;if(m)return!f&&t(p),[p]}},l=(u,f)=>{if(u&&u.length>0)return a(u.pop(),f)};return[()=>{Ka(o),Va(r)},()=>{if(FC)n=new FC(u=>l(u),{root:e}),n.observe(r),Jn(o,()=>{n.disconnect()});else{const u=()=>{const m=nc(r);a(m)},[f,p]=gI(r,u);Jn(o,f),p(),u()}Os(e,r)},()=>{if(n)return l(n.takeRecords(),!0)}]},a4=`[${ra}]`,wW=`[${Hi}]`,v1=["tabindex"],i4=["wrap","cols","rows"],y1=["id","class","style","open"],SW=(e,t,n)=>{let r,o,s;const{Z:a,J:l,tt:u,rt:f,ut:p,ft:m,_t:v}=e,{V:y}=Xo(),[S]=na({u:Qj,o:{w:0,h:0}},()=>{const F=m(uu,cu),H=m(h1,""),G=H&&la(l),A=H&&li(l);v(uu,cu),v(h1,""),v("",mm,!0);const L=pm(u),W=pm(l),V=hm(l);return v(uu,cu,F),v(h1,"",H),v("",mm),la(l,G),li(l,A),{w:W.w+L.w+V.w,h:W.h+L.h+V.h}}),x=f?i4:y1.concat(i4),w=bb(n,{v:()=>r,g:()=>o,p(F,H){const[G]=F,[A]=H;return[fs(G).concat(fs(A)).reduce((L,W)=>(L[W]=G[W]||A[W],L),{})]}}),_=F=>{Hn(F||v1,H=>{if(hb(v1,H)>-1){const G=bo(a,H);hl(G)?bo(l,H,G):Wo(l,H)}})},k=(F,H)=>{const[G,A]=F,L={vt:A};return t({ht:G}),!H&&n(L),L},P=({gt:F,Yt:H,Vt:G})=>{const A=!F||G?n:w;let L=!1;if(H){const[W,V]=H;L=V,t({bt:W})}A({gt:F,yt:L})},I=(F,H)=>{const[,G]=S(),A={wt:G};return G&&!H&&(F?n:w)(A),A},j=(F,H,G)=>{const A={Ot:H};return H?!G&&w(A):p||_(F),A},[E,T,R]=u||!y?bW(a,k):[Es,Es,Es],[M,D]=p?[Es,Es]:gI(a,P,{Vt:!0,Bt:!0}),[N,U]=s4(a,!1,j,{Pt:y1,Ht:y1.concat(v1)}),z=p&&Xc&&new Xc(P.bind(0,{gt:!0}));return z&&z.observe(a),_(),[()=>{E(),M(),s&&s[0](),z&&z.disconnect(),N()},()=>{D(),T()},()=>{const F={},H=U(),G=R(),A=s&&s[1]();return H&&Dr(F,j.apply(0,Jn(H,!0))),G&&Dr(F,k.apply(0,Jn(G,!0))),A&&Dr(F,I.apply(0,Jn(A,!0))),F},F=>{const[H]=F("update.ignoreMutation"),[G,A]=F("update.attributes"),[L,W]=F("update.elementEvents"),[V,ee]=F("update.debounce"),le=W||A,oe=X=>ba(H)&&H(X);if(le&&(s&&(s[1](),s[0]()),s=s4(u||l,!0,I,{Ht:x.concat(G||[]),Dt:L,Mt:a4,kt:(X,Q)=>{const{target:ie,attributeName:ve}=X;return(!Q&&ve&&!p?wV(ie,a4,wW):!1)||!!Kc(ie,`.${Ko}`)||!!oe(X)}})),ee)if(w.m(),wa(V)){const X=V[0],Q=V[1];r=Zi(X)&&X,o=Zi(Q)&&Q}else Zi(V)?(r=V,o=!1):(r=!1,o=!1)}]},l4={x:0,y:0},CW=e=>({K:{t:0,r:0,b:0,l:0},St:!1,P:{marginRight:0,marginBottom:0,marginLeft:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0},zt:l4,Tt:l4,Ct:{x:"hidden",y:"hidden"},Et:{x:!1,y:!1},ht:!1,bt:Jd(e.Z)}),_W=(e,t)=>{const n=Oy(t,{}),[r,o,s]=Sb(),[a,l,u]=uW(e),f=hI(CW(a)),[p,m]=f,v=vW(a,f),y=(P,I,j)=>{const T=fs(P).some(R=>P[R])||!gb(I)||j;return T&&s("u",[P,I,j]),T},[S,x,w,_]=SW(a,m,P=>y(v(n,P),{},!1)),k=p.bind(0);return k.jt=P=>r("u",P),k.Nt=()=>{const{W:P,J:I}=a,j=la(P),E=li(P);x(),l(),la(I,j),li(I,E)},k.qt=a,[(P,I)=>{const j=Oy(t,P,I);return _(j),y(v(j,w(),I),P,!!I)},k,()=>{o(),S(),u()}]},{round:c4}=Math,kW=e=>{const{width:t,height:n}=Yi(e),{w:r,h:o}=nc(e);return{x:c4(t)/r||1,y:c4(n)/o||1}},PW=(e,t,n)=>{const r=t.scrollbars,{button:o,isPrimary:s,pointerType:a}=e,{pointers:l}=r;return o===0&&s&&r[n?"dragScroll":"clickScroll"]&&(l||[]).includes(a)},jW=(e,t)=>eo(e,"mousedown",eo.bind(0,t,"click",tI,{C:!0,$:!0}),{$:!0}),u4="pointerup pointerleave pointercancel lostpointercapture",IW=(e,t,n,r,o,s,a)=>{const{B:l}=Xo(),{Ft:u,Gt:f,Xt:p}=r,m=`scroll${a?"Left":"Top"}`,v=`client${a?"X":"Y"}`,y=a?"width":"height",S=a?"left":"top",x=a?"w":"h",w=a?"x":"y",_=(k,P)=>I=>{const{Tt:j}=s(),E=nc(f)[x]-nc(u)[x],R=P*I/E*j[w],D=Jd(p)&&a?l.n||l.i?1:-1:1;o[m]=k+R*D};return eo(f,"pointerdown",k=>{const P=Kc(k.target,`.${_b}`)===u,I=P?u:f;if(Gl(t,ra,YC,!0),PW(k,e,P)){const j=!P&&k.shiftKey,E=()=>Yi(u),T=()=>Yi(f),R=(W,V)=>(W||E())[S]-(V||T())[S],M=_(o[m]||0,1/kW(o)[w]),D=k[v],N=E(),U=T(),z=N[y],F=R(N,U)+z/2,H=D-U[S],G=P?0:H-F,A=W=>{Ka(L),I.releasePointerCapture(W.pointerId)},L=[Gl.bind(0,t,ra,YC),eo(n,u4,A),eo(n,"selectstart",W=>nI(W),{S:!1}),eo(f,u4,A),eo(f,"pointermove",W=>{const V=W[v]-D;(P||j)&&M(G+V)})];if(j)M(G);else if(!P){const W=rc()[tW];W&&Jn(L,W.O(M,R,G,z,H))}I.setPointerCapture(k.pointerId)}})},EW=(e,t)=>(n,r,o,s,a,l)=>{const{Xt:u}=n,[f,p]=Uc(333),m=!!a.scrollBy;let v=!0;return Ka.bind(0,[eo(u,"pointerenter",()=>{r(ZC,!0)}),eo(u,"pointerleave pointercancel",()=>{r(ZC)}),eo(u,"wheel",y=>{const{deltaX:S,deltaY:x,deltaMode:w}=y;m&&v&&w===0&&yi(u)===s&&a.scrollBy({left:S,top:x,behavior:"smooth"}),v=!1,r(e4,!0),f(()=>{v=!0,r(e4)}),nI(y)},{S:!1,$:!0}),jW(u,o),IW(e,s,o,n,a,t,l),p])},{min:Ry,max:d4,abs:OW,round:TW}=Math,vI=(e,t,n,r)=>{if(r){const l=n?"x":"y",{Tt:u,zt:f}=r,p=f[l],m=u[l];return d4(0,Ry(1,p/(p+m)))}const o=n?"w":"h",s=nc(e)[o],a=nc(t)[o];return d4(0,Ry(1,s/a))},RW=(e,t,n,r,o,s)=>{const{B:a}=Xo(),l=s?"x":"y",u=s?"Left":"Top",{Tt:f}=r,p=TW(f[l]),m=OW(n[`scroll${u}`]),v=s&&o,y=a.i?m:p-m,x=Ry(1,(v?y:m)/p),w=vI(e,t,s);return 1/w*(1-w)*x},MW=(e,t,n)=>{const{N:r,L:o}=Xo(),{scrollbars:s}=r(),{slot:a}=s,{ct:l,W:u,Z:f,J:p,lt:m,ot:v,it:y,ut:S}=t,{scrollbars:x}=m?{}:e,{slot:w}=x||{},_=fI([u,f,p],()=>S&&y?u:f,a,w),k=(G,A,L)=>{const W=L?ci:xb;Hn(G,V=>{W(V.Xt,A)})},P=(G,A)=>{Hn(G,L=>{const[W,V]=A(L);wo(W,V)})},I=(G,A,L)=>{P(G,W=>{const{Ft:V,Gt:ee}=W;return[V,{[L?"width":"height"]:`${(100*vI(V,ee,L,A)).toFixed(3)}%`}]})},j=(G,A,L)=>{const W=L?"X":"Y";P(G,V=>{const{Ft:ee,Gt:le,Xt:oe}=V,X=RW(ee,le,v,A,Jd(oe),L);return[ee,{transform:X===X?`translate${W}(${(100*X).toFixed(3)}%)`:""}]})},E=[],T=[],R=[],M=(G,A,L)=>{const W=pb(L),V=W?L:!0,ee=W?!L:!0;V&&k(T,G,A),ee&&k(R,G,A)},D=G=>{I(T,G,!0),I(R,G)},N=G=>{j(T,G,!0),j(R,G)},U=G=>{const A=G?GV:qV,L=G?T:R,W=mb(L)?XC:"",V=ql(`${Ko} ${A} ${W}`),ee=ql(uI),le=ql(_b),oe={Xt:V,Gt:ee,Ft:le};return o||ci(V,VV),Os(V,ee),Os(ee,le),Jn(L,oe),Jn(E,[Va.bind(0,V),n(oe,M,l,f,v,G)]),oe},z=U.bind(0,!0),F=U.bind(0,!1),H=()=>{Os(_,T[0].Xt),Os(_,R[0].Xt),fm(()=>{M(XC)},300)};return z(),F(),[{Ut:D,Wt:N,Zt:M,Jt:{Kt:T,Qt:z,tn:P.bind(0,T)},nn:{Kt:R,Qt:F,tn:P.bind(0,R)}},H,Ka.bind(0,E)]},DW=(e,t,n,r)=>{let o,s,a,l,u,f=0;const p=hI({}),[m]=p,[v,y]=Uc(),[S,x]=Uc(),[w,_]=Uc(100),[k,P]=Uc(100),[I,j]=Uc(()=>f),[E,T,R]=MW(e,n.qt,EW(t,n)),{Z:M,J:D,ot:N,st:U,ut:z,it:F}=n.qt,{Jt:H,nn:G,Zt:A,Ut:L,Wt:W}=E,{tn:V}=H,{tn:ee}=G,le=ve=>{const{Xt:ye}=ve,se=z&&!F&&yi(ye)===D&&ye;return[se,{transform:se?`translate(${la(N)}px, ${li(N)}px)`:""}]},oe=(ve,ye)=>{if(j(),ve)A(JC);else{const se=()=>A(JC,!0);f>0&&!ye?I(se):se()}},X=()=>{l=s,l&&oe(!0)},Q=[_,j,P,x,y,R,eo(M,"pointerover",X,{C:!0}),eo(M,"pointerenter",X),eo(M,"pointerleave",()=>{l=!1,s&&oe(!1)}),eo(M,"pointermove",()=>{o&&v(()=>{_(),oe(!0),k(()=>{o&&oe(!1)})})}),eo(U,"scroll",ve=>{S(()=>{W(n()),a&&oe(!0),w(()=>{a&&!l&&oe(!1)})}),r(ve),z&&V(le),z&&ee(le)})],ie=m.bind(0);return ie.qt=E,ie.Nt=T,[(ve,ye,se)=>{const{At:de,Lt:fe,It:xe,yt:ke}=se,{A:ae}=Xo(),Pe=Oy(t,ve,ye),tt=n(),{Tt:ze,Ct:We,bt:It}=tt,[pt,bn]=Pe("showNativeOverlaidScrollbars"),[Y,Se]=Pe("scrollbars.theme"),[ne,he]=Pe("scrollbars.visibility"),[Re,Ke]=Pe("scrollbars.autoHide"),[ge]=Pe("scrollbars.autoHideDelay"),[ut,Rt]=Pe("scrollbars.dragScroll"),[en,$e]=Pe("scrollbars.clickScroll"),Xe=de||fe||ke,On=xe||he,Ie=pt&&ae.x&&ae.y,Ye=(ht,vt)=>{const Gt=ne==="visible"||ne==="auto"&&ht==="scroll";return A(YV,Gt,vt),Gt};if(f=ge,bn&&A(WV,Ie),Se&&(A(u),A(Y,!0),u=Y),Ke&&(o=Re==="move",s=Re==="leave",a=Re!=="never",oe(!a,!0)),Rt&&A(ZV,ut),$e&&A(XV,en),On){const ht=Ye(We.x,!0),vt=Ye(We.y,!1);A(KV,!(ht&&vt))}Xe&&(L(tt),W(tt),A(QC,!ze.x,!0),A(QC,!ze.y,!1),A(UV,It&&!F))},ie,Ka.bind(0,Q)]},yI=(e,t,n)=>{ba(e)&&e(t||void 0,n||void 0)},Ki=(e,t,n)=>{const{F:r,N:o,Y:s,j:a}=Xo(),l=rc(),u=um(e),f=u?e:e.target,p=pI(f);if(t&&!p){let m=!1;const v=z=>{const F=rc()[JV],H=F&&F.O;return H?H(z,!0):z},y=Dr({},r(),v(t)),[S,x,w]=Sb(n),[_,k,P]=_W(e,y),[I,j,E]=DW(e,y,k,z=>w("scroll",[U,z])),T=(z,F)=>_(z,!!F),R=T.bind(0,{},!0),M=s(R),D=a(R),N=z=>{cW(f),M(),D(),E(),P(),m=!0,w("destroyed",[U,!!z]),x()},U={options(z,F){if(z){const H=F?r():{},G=rI(y,Dr(H,v(z)));gb(G)||(Dr(y,G),T(G))}return Dr({},y)},on:S,off:(z,F)=>{z&&F&&x(z,F)},state(){const{zt:z,Tt:F,Ct:H,Et:G,K:A,St:L,bt:W}=k();return Dr({},{overflowEdge:z,overflowAmount:F,overflowStyle:H,hasOverflow:G,padding:A,paddingAbsolute:L,directionRTL:W,destroyed:m})},elements(){const{W:z,Z:F,K:H,J:G,tt:A,ot:L,st:W}=k.qt,{Jt:V,nn:ee}=j.qt,le=X=>{const{Ft:Q,Gt:ie,Xt:ve}=X;return{scrollbar:ve,track:ie,handle:Q}},oe=X=>{const{Kt:Q,Qt:ie}=X,ve=le(Q[0]);return Dr({},ve,{clone:()=>{const ye=le(ie());return I({},!0,{}),ye}})};return Dr({},{target:z,host:F,padding:H||G,viewport:G,content:A||G,scrollOffsetElement:L,scrollEventElement:W,scrollbarHorizontal:oe(V),scrollbarVertical:oe(ee)})},update:z=>T({},z),destroy:N.bind(0)};return k.jt((z,F,H)=>{I(F,H,z)}),lW(f,U),Hn(fs(l),z=>yI(l[z],0,U)),iW(k.qt.it,o().cancel,!u&&e.cancel)?(N(!0),U):(k.Nt(),j.Nt(),w("initialized",[U]),k.jt((z,F,H)=>{const{gt:G,yt:A,vt:L,At:W,Lt:V,It:ee,wt:le,Ot:oe}=z;w("updated",[U,{updateHints:{sizeChanged:G,directionChanged:A,heightIntrinsicChanged:L,overflowEdgeChanged:W,overflowAmountChanged:V,overflowStyleChanged:ee,contentMutation:le,hostMutation:oe},changedOptions:F,force:H}])}),U.update(!0),U)}return p};Ki.plugin=e=>{Hn(QV(e),t=>yI(t,Ki))};Ki.valid=e=>{const t=e&&e.elements,n=ba(t)&&t();return ky(n)&&!!pI(n.target)};Ki.env=()=>{const{k:e,A:t,I:n,B:r,V:o,L:s,X:a,U:l,N:u,q:f,F:p,G:m}=Xo();return Dr({},{scrollbarsSize:e,scrollbarsOverlaid:t,scrollbarsHiding:n,rtlScrollBehavior:r,flexboxGlue:o,cssCustomProperties:s,staticDefaultInitialization:a,staticDefaultOptions:l,getDefaultInitialization:u,setDefaultInitialization:f,getDefaultOptions:p,setDefaultOptions:m})};const AW=()=>{if(typeof window>"u"){const f=()=>{};return[f,f]}let e,t;const n=window,r=typeof n.requestIdleCallback=="function",o=n.requestAnimationFrame,s=n.cancelAnimationFrame,a=r?n.requestIdleCallback:o,l=r?n.cancelIdleCallback:s,u=()=>{l(e),s(t)};return[(f,p)=>{u(),e=a(r?()=>{u(),t=o(f)}:f,typeof p=="object"?p:{timeout:2233})},u]},xI=e=>{const{options:t,events:n,defer:r}=e||{},[o,s]=h.useMemo(AW,[]),a=h.useRef(null),l=h.useRef(r),u=h.useRef(t),f=h.useRef(n);return h.useEffect(()=>{l.current=r},[r]),h.useEffect(()=>{const{current:p}=a;u.current=t,Ki.valid(p)&&p.options(t||{},!0)},[t]),h.useEffect(()=>{const{current:p}=a;f.current=n,Ki.valid(p)&&p.on(n||{},!0)},[n]),h.useEffect(()=>()=>{var p;s(),(p=a.current)==null||p.destroy()},[]),h.useMemo(()=>[p=>{const m=a.current;if(Ki.valid(m))return;const v=l.current,y=u.current||{},S=f.current||{},x=()=>a.current=Ki(p,y,S);v?o(x,v):x()},()=>a.current],[])},NW=(e,t)=>{const{element:n="div",options:r,events:o,defer:s,children:a,...l}=e,u=n,f=h.useRef(null),p=h.useRef(null),[m,v]=xI({options:r,events:o,defer:s});return h.useEffect(()=>{const{current:y}=f,{current:S}=p;return y&&S&&m({target:y,elements:{viewport:S,content:S}}),()=>{var x;return(x=v())==null?void 0:x.destroy()}},[m,n]),h.useImperativeHandle(t,()=>({osInstance:v,getElement:()=>f.current}),[]),B.createElement(u,{"data-overlayscrollbars-initialize":"",ref:f,...l},B.createElement("div",{ref:p},a))},Ib=h.forwardRef(NW);function bI(e){return ct({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 wI(e){return ct({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.828.722a.5.5 0 0 1 .354.146l4.95 4.95a.5.5 0 0 1 0 .707c-.48.48-1.072.588-1.503.588-.177 0-.335-.018-.46-.039l-3.134 3.134a5.927 5.927 0 0 1 .16 1.013c.046.702-.032 1.687-.72 2.375a.5.5 0 0 1-.707 0l-2.829-2.828-3.182 3.182c-.195.195-1.219.902-1.414.707-.195-.195.512-1.22.707-1.414l3.182-3.182-2.828-2.829a.5.5 0 0 1 0-.707c.688-.688 1.673-.767 2.375-.72a5.922 5.922 0 0 1 1.013.16l3.134-3.133a2.772 2.772 0 0 1-.04-.461c0-.43.108-1.022.589-1.503a.5.5 0 0 1 .353-.146zm.122 2.112v-.002.002zm0-.002v.002a.5.5 0 0 1-.122.51L6.293 6.878a.5.5 0 0 1-.511.12H5.78l-.014-.004a4.507 4.507 0 0 0-.288-.076 4.922 4.922 0 0 0-.765-.116c-.422-.028-.836.008-1.175.15l5.51 5.509c.141-.34.177-.753.149-1.175a4.924 4.924 0 0 0-.192-1.054l-.004-.013v-.001a.5.5 0 0 1 .12-.512l3.536-3.535a.5.5 0 0 1 .532-.115l.096.022c.087.017.208.034.344.034.114 0 .23-.011.343-.04L9.927 2.028c-.029.113-.04.23-.04.343a1.779 1.779 0 0 0 .062.46z"}}]})(e)}function zW(e){return ct({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 $W(e){return ct({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 LW(e){return ct({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M528 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h480c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zm-352 96c35.3 0 64 28.7 64 64s-28.7 64-64 64-64-28.7-64-64 28.7-64 64-64zm112 236.8c0 10.6-10 19.2-22.4 19.2H86.4C74 384 64 375.4 64 364.8v-19.2c0-31.8 30.1-57.6 67.2-57.6h5c12.3 5.1 25.7 8 39.8 8s27.6-2.9 39.8-8h5c37.1 0 67.2 25.8 67.2 57.6v19.2zM512 312c0 4.4-3.6 8-8 8H360c-4.4 0-8-3.6-8-8v-16c0-4.4 3.6-8 8-8h144c4.4 0 8 3.6 8 8v16zm0-64c0 4.4-3.6 8-8 8H360c-4.4 0-8-3.6-8-8v-16c0-4.4 3.6-8 8-8h144c4.4 0 8 3.6 8 8v16zm0-64c0 4.4-3.6 8-8 8H360c-4.4 0-8-3.6-8-8v-16c0-4.4 3.6-8 8-8h144c4.4 0 8 3.6 8 8v16z"}}]})(e)}function BW(e){return ct({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 FW(e){return ct({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 SI(e){return ct({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 HW(e){return ct({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 CI(e){return ct({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 VW(e){return ct({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 WW(e){return ct({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 _I(e){return ct({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 UW(e){return ct({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z"}}]})(e)}function kI(e){return ct({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 Wu(e){return ct({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 PI(e){return ct({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 GW(e){return ct({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 Eb(e){return ct({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 jI(e){return ct({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 qW(e){return ct({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"}}]})(e)}function YW(e){return ct({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 Ob(e){return ct({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 II(e){return ct({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 KW(e){return ct({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 XW(e){return ct({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 EI(e){return ct({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 My(e){return ct({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M464 128H272l-64-64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V176c0-26.51-21.49-48-48-48z"}}]})(e)}function ZW(e){return ct({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M432 416h-23.41L277.88 53.69A32 32 0 0 0 247.58 32h-47.16a32 32 0 0 0-30.3 21.69L39.41 416H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16h-19.58l23.3-64h152.56l23.3 64H304a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zM176.85 272L224 142.51 271.15 272z"}}]})(e)}function QW(e){return ct({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 JW(e){return ct({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M360 0H24C10.745 0 0 10.745 0 24v16c0 13.255 10.745 24 24 24 0 90.965 51.016 167.734 120.842 192C75.016 280.266 24 357.035 24 448c-13.255 0-24 10.745-24 24v16c0 13.255 10.745 24 24 24h336c13.255 0 24-10.745 24-24v-16c0-13.255-10.745-24-24-24 0-90.965-51.016-167.734-120.842-192C308.984 231.734 360 154.965 360 64c13.255 0 24-10.745 24-24V24c0-13.255-10.745-24-24-24zm-75.078 384H99.08c17.059-46.797 52.096-80 92.92-80 40.821 0 75.862 33.196 92.922 80zm.019-256H99.078C91.988 108.548 88 86.748 88 64h208c0 22.805-3.987 44.587-11.059 64z"}}]})(e)}function Vf(e){return ct({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 eU(e){return ct({tag:"svg",attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M480 416v16c0 26.51-21.49 48-48 48H48c-26.51 0-48-21.49-48-48V176c0-26.51 21.49-48 48-48h16v208c0 44.112 35.888 80 80 80h336zm96-80V80c0-26.51-21.49-48-48-48H144c-26.51 0-48 21.49-48 48v256c0 26.51 21.49 48 48 48h384c26.51 0 48-21.49 48-48zM256 128c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48zm-96 144l55.515-55.515c4.686-4.686 12.284-4.686 16.971 0L272 256l135.515-135.515c4.686-4.686 12.284-4.686 16.971 0L512 208v112H160v-48z"}}]})(e)}function tU(e){return ct({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"}}]})(e)}function nU(e){return ct({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 OI(e){return ct({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 rU(e){return ct({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M80 368H16a16 16 0 0 0-16 16v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16v-64a16 16 0 0 0-16-16zm0-320H16A16 16 0 0 0 0 64v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16V64a16 16 0 0 0-16-16zm0 160H16a16 16 0 0 0-16 16v64a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16v-64a16 16 0 0 0-16-16zm416 176H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0-320H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16V80a16 16 0 0 0-16-16zm0 160H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z"}}]})(e)}function oU(e){return ct({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 sU(e){return ct({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 aU(e){return ct({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M283.211 512c78.962 0 151.079-35.925 198.857-94.792 7.068-8.708-.639-21.43-11.562-19.35-124.203 23.654-238.262-71.576-238.262-196.954 0-72.222 38.662-138.635 101.498-174.394 9.686-5.512 7.25-20.197-3.756-22.23A258.156 258.156 0 0 0 283.211 0c-141.309 0-256 114.511-256 256 0 141.309 114.511 256 256 256z"}}]})(e)}function TI(e){return ct({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 RI(e){return ct({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 Wf(e){return ct({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 iU(e){return ct({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 lU(e){return ct({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M504.971 359.029c9.373 9.373 9.373 24.569 0 33.941l-80 79.984c-15.01 15.01-40.971 4.49-40.971-16.971V416h-58.785a12.004 12.004 0 0 1-8.773-3.812l-70.556-75.596 53.333-57.143L352 336h32v-39.981c0-21.438 25.943-31.998 40.971-16.971l80 79.981zM12 176h84l52.781 56.551 53.333-57.143-70.556-75.596A11.999 11.999 0 0 0 122.785 96H12c-6.627 0-12 5.373-12 12v56c0 6.627 5.373 12 12 12zm372 0v39.984c0 21.46 25.961 31.98 40.971 16.971l80-79.984c9.373-9.373 9.373-24.569 0-33.941l-80-79.981C409.943 24.021 384 34.582 384 56.019V96h-58.785a12.004 12.004 0 0 0-8.773 3.812L96 336H12c-6.627 0-12 5.373-12 12v56c0 6.627 5.373 12 12 12h110.785c3.326 0 6.503-1.381 8.773-3.812L352 176h32z"}}]})(e)}function cU(e){return ct({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 Tb(e){return ct({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 f4(e){return ct({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 uU(e){return ct({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 dU(e){return ct({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M480 160H32c-17.673 0-32-14.327-32-32V64c0-17.673 14.327-32 32-32h448c17.673 0 32 14.327 32 32v64c0 17.673-14.327 32-32 32zm-48-88c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm-64 0c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm112 248H32c-17.673 0-32-14.327-32-32v-64c0-17.673 14.327-32 32-32h448c17.673 0 32 14.327 32 32v64c0 17.673-14.327 32-32 32zm-48-88c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm-64 0c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm112 248H32c-17.673 0-32-14.327-32-32v-64c0-17.673 14.327-32 32-32h448c17.673 0 32 14.327 32 32v64c0 17.673-14.327 32-32 32zm-48-88c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24zm-64 0c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24z"}}]})(e)}function fU(e){return ct({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 gm(e){return ct({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 Rb(e){return ct({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 pU(e){return ct({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 160c-52.9 0-96 43.1-96 96s43.1 96 96 96 96-43.1 96-96-43.1-96-96-96zm246.4 80.5l-94.7-47.3 33.5-100.4c4.5-13.6-8.4-26.5-21.9-21.9l-100.4 33.5-47.4-94.8c-6.4-12.8-24.6-12.8-31 0l-47.3 94.7L92.7 70.8c-13.6-4.5-26.5 8.4-21.9 21.9l33.5 100.4-94.7 47.4c-12.8 6.4-12.8 24.6 0 31l94.7 47.3-33.5 100.5c-4.5 13.6 8.4 26.5 21.9 21.9l100.4-33.5 47.3 94.7c6.4 12.8 24.6 12.8 31 0l47.3-94.7 100.4 33.5c13.6 4.5 26.5-8.4 21.9-21.9l-33.5-100.4 94.7-47.3c13-6.5 13-24.7.2-31.1zm-155.9 106c-49.9 49.9-131.1 49.9-181 0-49.9-49.9-49.9-131.1 0-181 49.9-49.9 131.1-49.9 181 0 49.9 49.9 49.9 131.1 0 181z"}}]})(e)}function Ls(e){return ct({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 ov(e){return ct({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 sv(e){return ct({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 Mb(e){return ct({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)}function hU(e){return ct({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 mU(e){return ct({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 gU(e){return ct({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 p4(e){return ct({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 vU(e){return ct({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 MI(e){return ct({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 yU(e){return ct({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)}var Nd=globalThis&&globalThis.__assign||function(){return Nd=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},Nd.apply(this,arguments)};function DI(e){var t,n=h.useState(!1),r=n[0],o=n[1],s=h.useState(!1),a=s[0],l=s[1],u=h.useState(!1),f=u[0],p=u[1],m=h.useState([0,0]),v=m[0],y=m[1],S=h.useRef(null);h.useEffect(function(){if(r)setTimeout(function(){l(!0),setTimeout(function(){p(!0)})});else{p(!1);var w=setTimeout(function(){l(r)},1e3);return function(){return clearTimeout(w)}}},[r]),nz("contextmenu",function(w){var _;!((_=S.current)===null||_===void 0)&&_.contains(w.target)||w.target===S.current?(w.preventDefault(),o(!0),y([w.pageX,w.pageY])):o(!1)});var x=h.useCallback(function(){var w,_;(_=(w=e.menuProps)===null||w===void 0?void 0:w.onClose)===null||_===void 0||_.call(w),o(!1)},[(t=e.menuProps)===null||t===void 0?void 0:t.onClose,o]);return h.createElement(h.Fragment,null,e.children(S),a&&h.createElement(Fd,Nd({},e.portalProps),h.createElement(Mg,Nd({isOpen:f,gutter:0},e.menuProps,{onClose:x}),h.createElement(Dg,Nd({"aria-hidden":!0,w:1,h:1,style:{position:"absolute",left:v[0],top:v[1],cursor:"default"}},e.menuButtonProps)),e.renderMenu())))}var xU=Nu({displayName:"EditIcon",path:i.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[i.jsx("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),i.jsx("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]})}),Db=Nu({displayName:"ExternalLinkIcon",path:i.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[i.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),i.jsx("path",{d:"M15 3h6v6"}),i.jsx("path",{d:"M10 14L21 3"})]})}),Ab=Nu({d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z",displayName:"ChevronUpIcon"}),bU=Nu({displayName:"CloseIcon",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"}),wU=Nu({displayName:"DeleteIcon",path:i.jsx("g",{fill:"currentColor",children:i.jsx("path",{d:"M19.452 7.5H4.547a.5.5 0 00-.5.545l1.287 14.136A2 2 0 007.326 24h9.347a2 2 0 001.992-1.819L19.95 8.045a.5.5 0 00-.129-.382.5.5 0 00-.369-.163zm-9.2 13a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zm5 0a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zM22 4h-4.75a.25.25 0 01-.25-.25V2.5A2.5 2.5 0 0014.5 0h-5A2.5 2.5 0 007 2.5v1.25a.25.25 0 01-.25.25H2a1 1 0 000 2h20a1 1 0 000-2zM9 3.75V2.5a.5.5 0 01.5-.5h5a.5.5 0 01.5.5v1.25a.25.25 0 01-.25.25h-5.5A.25.25 0 019 3.75z"})})}),SU=Nu({displayName:"ChevronDownIcon",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"});function Ah(e){return ct({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M245.09 327.74v-37.32c57.07 0 84.51 13.47 108.58 38.68 5.4 5.65 15 1.32 14.29-6.43-5.45-61.45-34.14-117.09-122.87-117.09v-37.32a8.32 8.32 0 00-14.05-6L146.58 242a8.2 8.2 0 000 11.94L231 333.71a8.32 8.32 0 0014.09-5.97z"}},{tag:"path",attr:{fill:"none",strokeMiterlimit:"10",strokeWidth:"32",d:"M256 64C150 64 64 150 64 256s86 192 192 192 192-86 192-192S362 64 256 64z"}}]})(e)}function CU(e){return ct({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M478.33 433.6l-90-218a22 22 0 00-40.67 0l-90 218a22 22 0 1040.67 16.79L316.66 406h102.67l18.33 44.39A22 22 0 00458 464a22 22 0 0020.32-30.4zM334.83 362L368 281.65 401.17 362zm-66.99-19.08a22 22 0 00-4.89-30.7c-.2-.15-15-11.13-36.49-34.73 39.65-53.68 62.11-114.75 71.27-143.49H330a22 22 0 000-44H214V70a22 22 0 00-44 0v20H54a22 22 0 000 44h197.25c-9.52 26.95-27.05 69.5-53.79 108.36-31.41-41.68-43.08-68.65-43.17-68.87a22 22 0 00-40.58 17c.58 1.38 14.55 34.23 52.86 83.93.92 1.19 1.83 2.35 2.74 3.51-39.24 44.35-77.74 71.86-93.85 80.74a22 22 0 1021.07 38.63c2.16-1.18 48.6-26.89 101.63-85.59 22.52 24.08 38 35.44 38.93 36.1a22 22 0 0030.75-4.9z"}}]})(e)}const av=Te(e=>e.lightbox,e=>e,{memoizeOptions:{equalityCheck:Ut}}),so=e=>{const t=q(a=>a.config.disabledTabs),n=q(a=>a.config.disabledFeatures),r=q(a=>a.config.disabledSDFeatures),o=h.useMemo(()=>n.includes(e)||r.includes(e)||t.includes(e),[n,r,t,e]),s=h.useMemo(()=>!(n.includes(e)||r.includes(e)||t.includes(e)),[n,r,t,e]);return{isFeatureDisabled:o,isFeatureEnabled:s}};var Fn;(function(e){e.assertEqual=o=>o;function t(o){}e.assertIs=t;function n(o){throw new Error}e.assertNever=n,e.arrayToEnum=o=>{const s={};for(const a of o)s[a]=a;return s},e.getValidEnumValues=o=>{const s=e.objectKeys(o).filter(l=>typeof o[o[l]]!="number"),a={};for(const l of s)a[l]=o[l];return e.objectValues(a)},e.objectValues=o=>e.objectKeys(o).map(function(s){return o[s]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const s=[];for(const a in o)Object.prototype.hasOwnProperty.call(o,a)&&s.push(a);return s},e.find=(o,s)=>{for(const a of o)if(s(a))return a},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&isFinite(o)&&Math.floor(o)===o;function r(o,s=" | "){return o.map(a=>typeof a=="string"?`'${a}'`:a).join(s)}e.joinValues=r,e.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(Fn||(Fn={}));var Dy;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(Dy||(Dy={}));const gt=Fn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ui=e=>{switch(typeof e){case"undefined":return gt.undefined;case"string":return gt.string;case"number":return isNaN(e)?gt.nan:gt.number;case"boolean":return gt.boolean;case"function":return gt.function;case"bigint":return gt.bigint;case"symbol":return gt.symbol;case"object":return Array.isArray(e)?gt.array:e===null?gt.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?gt.promise:typeof Map<"u"&&e instanceof Map?gt.map:typeof Set<"u"&&e instanceof Set?gt.set:typeof Date<"u"&&e instanceof Date?gt.date:gt.object;default:return gt.unknown}},He=Fn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),_U=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class ca extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(s){return s.message},r={_errors:[]},o=s=>{for(const a of s.issues)if(a.code==="invalid_union")a.unionErrors.map(o);else if(a.code==="invalid_return_type")o(a.returnTypeError);else if(a.code==="invalid_arguments")o(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let l=r,u=0;for(;u<a.path.length;){const f=a.path[u];u===a.path.length-1?(l[f]=l[f]||{_errors:[]},l[f]._errors.push(n(a))):l[f]=l[f]||{_errors:[]},l=l[f],u++}}};return o(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,Fn.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const o of this.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}ca.create=e=>new ca(e);const ef=(e,t)=>{let n;switch(e.code){case He.invalid_type:e.received===gt.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case He.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Fn.jsonStringifyReplacer)}`;break;case He.unrecognized_keys:n=`Unrecognized key(s) in object: ${Fn.joinValues(e.keys,", ")}`;break;case He.invalid_union:n="Invalid input";break;case He.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Fn.joinValues(e.options)}`;break;case He.invalid_enum_value:n=`Invalid enum value. Expected ${Fn.joinValues(e.options)}, received '${e.received}'`;break;case He.invalid_arguments:n="Invalid function arguments";break;case He.invalid_return_type:n="Invalid function return type";break;case He.invalid_date:n="Invalid date";break;case He.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Fn.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case He.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case He.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case He.custom:n="Invalid input";break;case He.invalid_intersection_types:n="Intersection results could not be merged";break;case He.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case He.not_finite:n="Number must be finite";break;default:n=t.defaultError,Fn.assertNever(e)}return{message:n}};let AI=ef;function kU(e){AI=e}function vm(){return AI}const ym=e=>{const{data:t,path:n,errorMaps:r,issueData:o}=e,s=[...n,...o.path||[]],a={...o,path:s};let l="";const u=r.filter(f=>!!f).slice().reverse();for(const f of u)l=f(a,{data:t,defaultError:l}).message;return{...o,path:s,message:o.message||l}},PU=[];function yt(e,t){const n=ym({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,vm(),ef].filter(r=>!!r)});e.common.issues.push(n)}class _o{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const o of n){if(o.status==="aborted")return tn;o.status==="dirty"&&t.dirty(),r.push(o.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const o of n)r.push({key:await o.key,value:await o.value});return _o.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const o of n){const{key:s,value:a}=o;if(s.status==="aborted"||a.status==="aborted")return tn;s.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),(typeof a.value<"u"||o.alwaysSet)&&(r[s.value]=a.value)}return{status:t.value,value:r}}}const tn=Object.freeze({status:"aborted"}),NI=e=>({status:"dirty",value:e}),No=e=>({status:"valid",value:e}),Ay=e=>e.status==="aborted",Ny=e=>e.status==="dirty",xm=e=>e.status==="valid",bm=e=>typeof Promise<"u"&&e instanceof Promise;var Lt;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Lt||(Lt={}));class Wa{constructor(t,n,r,o){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=o}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const h4=(e,t)=>{if(xm(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new ca(e.common.issues);return this._error=n,this._error}}};function cn(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:o}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(a,l)=>a.code!=="invalid_type"?{message:l.defaultError}:typeof l.data>"u"?{message:r??l.defaultError}:{message:n??l.defaultError},description:o}}class pn{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Ui(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Ui(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new _o,ctx:{common:t.parent.common,data:t.data,parsedType:Ui(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(bm(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const o={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ui(t)},s=this._parseSync({data:t,path:o.path,parent:o});return h4(o,s)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ui(t)},o=this._parse({data:t,path:r.path,parent:r}),s=await(bm(o)?o:Promise.resolve(o));return h4(r,s)}refine(t,n){const r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,s)=>{const a=t(o),l=()=>s.addIssue({code:He.custom,...r(o)});return typeof Promise<"u"&&a instanceof Promise?a.then(u=>u?!0:(l(),!1)):a?!0:(l(),!1)})}refinement(t,n){return this._refinement((r,o)=>t(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(t){return new Sa({schema:this,typeName:Yt.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return ui.create(this,this._def)}nullable(){return ac.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ua.create(this,this._def)}promise(){return wu.create(this,this._def)}or(t){return of.create([this,t],this._def)}and(t){return sf.create(this,t,this._def)}transform(t){return new Sa({...cn(this._def),schema:this,typeName:Yt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new df({...cn(this._def),innerType:this,defaultValue:n,typeName:Yt.ZodDefault})}brand(){return new $I({typeName:Yt.ZodBranded,type:this,...cn(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new _m({...cn(this._def),innerType:this,catchValue:n,typeName:Yt.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Uf.create(this,t)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const jU=/^c[^\s-]{8,}$/i,IU=/^[a-z][a-z0-9]*$/,EU=/[0-9A-HJKMNP-TV-Z]{26}/,OU=/^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i,TU=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\])|(\[IPv6:(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))\])|([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])*(\.[A-Za-z]{2,})+))$/,RU=/^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u,MU=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,DU=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,AU=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function NU(e,t){return!!((t==="v4"||!t)&&MU.test(e)||(t==="v6"||!t)&&DU.test(e))}class oa extends pn{constructor(){super(...arguments),this._regex=(t,n,r)=>this.refinement(o=>t.test(o),{validation:n,code:He.invalid_string,...Lt.errToObj(r)}),this.nonempty=t=>this.min(1,Lt.errToObj(t)),this.trim=()=>new oa({...this._def,checks:[...this._def.checks,{kind:"trim"}]}),this.toLowerCase=()=>new oa({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]}),this.toUpperCase=()=>new oa({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==gt.string){const s=this._getOrReturnCtx(t);return yt(s,{code:He.invalid_type,expected:gt.string,received:s.parsedType}),tn}const r=new _o;let o;for(const s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(o=this._getOrReturnCtx(t,o),yt(o,{code:He.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")t.data.length>s.value&&(o=this._getOrReturnCtx(t,o),yt(o,{code:He.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const a=t.data.length>s.value,l=t.data.length<s.value;(a||l)&&(o=this._getOrReturnCtx(t,o),a?yt(o,{code:He.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):l&&yt(o,{code:He.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")TU.test(t.data)||(o=this._getOrReturnCtx(t,o),yt(o,{validation:"email",code:He.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")RU.test(t.data)||(o=this._getOrReturnCtx(t,o),yt(o,{validation:"emoji",code:He.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")OU.test(t.data)||(o=this._getOrReturnCtx(t,o),yt(o,{validation:"uuid",code:He.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")jU.test(t.data)||(o=this._getOrReturnCtx(t,o),yt(o,{validation:"cuid",code:He.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")IU.test(t.data)||(o=this._getOrReturnCtx(t,o),yt(o,{validation:"cuid2",code:He.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")EU.test(t.data)||(o=this._getOrReturnCtx(t,o),yt(o,{validation:"ulid",code:He.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),yt(o,{validation:"url",code:He.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),yt(o,{validation:"regex",code:He.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(o=this._getOrReturnCtx(t,o),yt(o,{code:He.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(o=this._getOrReturnCtx(t,o),yt(o,{code:He.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(o=this._getOrReturnCtx(t,o),yt(o,{code:He.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?AU(s).test(t.data)||(o=this._getOrReturnCtx(t,o),yt(o,{code:He.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="ip"?NU(t.data,s.version)||(o=this._getOrReturnCtx(t,o),yt(o,{validation:"ip",code:He.invalid_string,message:s.message}),r.dirty()):Fn.assertNever(s);return{status:r.value,value:t.data}}_addCheck(t){return new oa({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Lt.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Lt.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Lt.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Lt.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Lt.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Lt.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Lt.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Lt.errToObj(t)})}datetime(t){var n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,...Lt.errToObj(t==null?void 0:t.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Lt.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Lt.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Lt.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Lt.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Lt.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Lt.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Lt.errToObj(n)})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}oa.create=e=>{var t;return new oa({checks:[],typeName:Yt.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...cn(e)})};function zU(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,o=n>r?n:r,s=parseInt(e.toFixed(o).replace(".","")),a=parseInt(t.toFixed(o).replace(".",""));return s%a/Math.pow(10,o)}class rl extends pn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==gt.number){const s=this._getOrReturnCtx(t);return yt(s,{code:He.invalid_type,expected:gt.number,received:s.parsedType}),tn}let r;const o=new _o;for(const s of this._def.checks)s.kind==="int"?Fn.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),yt(r,{code:He.invalid_type,expected:"integer",received:"float",message:s.message}),o.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(r=this._getOrReturnCtx(t,r),yt(r,{code:He.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),yt(r,{code:He.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?zU(t.data,s.value)!==0&&(r=this._getOrReturnCtx(t,r),yt(r,{code:He.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),yt(r,{code:He.not_finite,message:s.message}),o.dirty()):Fn.assertNever(s);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Lt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Lt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Lt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Lt.toString(n))}setLimit(t,n,r,o){return new rl({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Lt.toString(o)}]})}_addCheck(t){return new rl({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Lt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Lt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Lt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Lt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Lt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Lt.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Lt.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Lt.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Lt.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Fn.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}rl.create=e=>new rl({checks:[],typeName:Yt.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...cn(e)});class ol extends pn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==gt.bigint){const s=this._getOrReturnCtx(t);return yt(s,{code:He.invalid_type,expected:gt.bigint,received:s.parsedType}),tn}let r;const o=new _o;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(r=this._getOrReturnCtx(t,r),yt(r,{code:He.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),yt(r,{code:He.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),yt(r,{code:He.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):Fn.assertNever(s);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Lt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Lt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Lt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Lt.toString(n))}setLimit(t,n,r,o){return new ol({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Lt.toString(o)}]})}_addCheck(t){return new ol({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Lt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Lt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Lt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Lt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Lt.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}ol.create=e=>{var t;return new ol({checks:[],typeName:Yt.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...cn(e)})};class tf extends pn{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==gt.boolean){const r=this._getOrReturnCtx(t);return yt(r,{code:He.invalid_type,expected:gt.boolean,received:r.parsedType}),tn}return No(t.data)}}tf.create=e=>new tf({typeName:Yt.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...cn(e)});class oc extends pn{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==gt.date){const s=this._getOrReturnCtx(t);return yt(s,{code:He.invalid_type,expected:gt.date,received:s.parsedType}),tn}if(isNaN(t.data.getTime())){const s=this._getOrReturnCtx(t);return yt(s,{code:He.invalid_date}),tn}const r=new _o;let o;for(const s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(o=this._getOrReturnCtx(t,o),yt(o,{code:He.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(o=this._getOrReturnCtx(t,o),yt(o,{code:He.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):Fn.assertNever(s);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new oc({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Lt.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Lt.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}oc.create=e=>new oc({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Yt.ZodDate,...cn(e)});class wm extends pn{_parse(t){if(this._getType(t)!==gt.symbol){const r=this._getOrReturnCtx(t);return yt(r,{code:He.invalid_type,expected:gt.symbol,received:r.parsedType}),tn}return No(t.data)}}wm.create=e=>new wm({typeName:Yt.ZodSymbol,...cn(e)});class nf extends pn{_parse(t){if(this._getType(t)!==gt.undefined){const r=this._getOrReturnCtx(t);return yt(r,{code:He.invalid_type,expected:gt.undefined,received:r.parsedType}),tn}return No(t.data)}}nf.create=e=>new nf({typeName:Yt.ZodUndefined,...cn(e)});class rf extends pn{_parse(t){if(this._getType(t)!==gt.null){const r=this._getOrReturnCtx(t);return yt(r,{code:He.invalid_type,expected:gt.null,received:r.parsedType}),tn}return No(t.data)}}rf.create=e=>new rf({typeName:Yt.ZodNull,...cn(e)});class bu extends pn{constructor(){super(...arguments),this._any=!0}_parse(t){return No(t.data)}}bu.create=e=>new bu({typeName:Yt.ZodAny,...cn(e)});class Yl extends pn{constructor(){super(...arguments),this._unknown=!0}_parse(t){return No(t.data)}}Yl.create=e=>new Yl({typeName:Yt.ZodUnknown,...cn(e)});class xi extends pn{_parse(t){const n=this._getOrReturnCtx(t);return yt(n,{code:He.invalid_type,expected:gt.never,received:n.parsedType}),tn}}xi.create=e=>new xi({typeName:Yt.ZodNever,...cn(e)});class Sm extends pn{_parse(t){if(this._getType(t)!==gt.undefined){const r=this._getOrReturnCtx(t);return yt(r,{code:He.invalid_type,expected:gt.void,received:r.parsedType}),tn}return No(t.data)}}Sm.create=e=>new Sm({typeName:Yt.ZodVoid,...cn(e)});class ua extends pn{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),o=this._def;if(n.parsedType!==gt.array)return yt(n,{code:He.invalid_type,expected:gt.array,received:n.parsedType}),tn;if(o.exactLength!==null){const a=n.data.length>o.exactLength.value,l=n.data.length<o.exactLength.value;(a||l)&&(yt(n,{code:a?He.too_big:He.too_small,minimum:l?o.exactLength.value:void 0,maximum:a?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),r.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(yt(n,{code:He.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),r.dirty()),o.maxLength!==null&&n.data.length>o.maxLength.value&&(yt(n,{code:He.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,l)=>o.type._parseAsync(new Wa(n,a,n.path,l)))).then(a=>_o.mergeArray(r,a));const s=[...n.data].map((a,l)=>o.type._parseSync(new Wa(n,a,n.path,l)));return _o.mergeArray(r,s)}get element(){return this._def.type}min(t,n){return new ua({...this._def,minLength:{value:t,message:Lt.toString(n)}})}max(t,n){return new ua({...this._def,maxLength:{value:t,message:Lt.toString(n)}})}length(t,n){return new ua({...this._def,exactLength:{value:t,message:Lt.toString(n)}})}nonempty(t){return this.min(1,t)}}ua.create=(e,t)=>new ua({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Yt.ZodArray,...cn(t)});function Gc(e){if(e instanceof Mr){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=ui.create(Gc(r))}return new Mr({...e._def,shape:()=>t})}else return e instanceof ua?new ua({...e._def,type:Gc(e.element)}):e instanceof ui?ui.create(Gc(e.unwrap())):e instanceof ac?ac.create(Gc(e.unwrap())):e instanceof Ua?Ua.create(e.items.map(t=>Gc(t))):e}class Mr extends pn{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Fn.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==gt.object){const f=this._getOrReturnCtx(t);return yt(f,{code:He.invalid_type,expected:gt.object,received:f.parsedType}),tn}const{status:r,ctx:o}=this._processInputParams(t),{shape:s,keys:a}=this._getCached(),l=[];if(!(this._def.catchall instanceof xi&&this._def.unknownKeys==="strip"))for(const f in o.data)a.includes(f)||l.push(f);const u=[];for(const f of a){const p=s[f],m=o.data[f];u.push({key:{status:"valid",value:f},value:p._parse(new Wa(o,m,o.path,f)),alwaysSet:f in o.data})}if(this._def.catchall instanceof xi){const f=this._def.unknownKeys;if(f==="passthrough")for(const p of l)u.push({key:{status:"valid",value:p},value:{status:"valid",value:o.data[p]}});else if(f==="strict")l.length>0&&(yt(o,{code:He.unrecognized_keys,keys:l}),r.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const p of l){const m=o.data[p];u.push({key:{status:"valid",value:p},value:f._parse(new Wa(o,m,o.path,p)),alwaysSet:p in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const f=[];for(const p of u){const m=await p.key;f.push({key:m,value:await p.value,alwaysSet:p.alwaysSet})}return f}).then(f=>_o.mergeObjectSync(r,f)):_o.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(t){return Lt.errToObj,new Mr({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var o,s,a,l;const u=(a=(s=(o=this._def).errorMap)===null||s===void 0?void 0:s.call(o,n,r).message)!==null&&a!==void 0?a:r.defaultError;return n.code==="unrecognized_keys"?{message:(l=Lt.errToObj(t).message)!==null&&l!==void 0?l:u}:{message:u}}}:{}})}strip(){return new Mr({...this._def,unknownKeys:"strip"})}passthrough(){return new Mr({...this._def,unknownKeys:"passthrough"})}extend(t){return new Mr({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Mr({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Yt.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Mr({...this._def,catchall:t})}pick(t){const n={};return Fn.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new Mr({...this._def,shape:()=>n})}omit(t){const n={};return Fn.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new Mr({...this._def,shape:()=>n})}deepPartial(){return Gc(this)}partial(t){const n={};return Fn.objectKeys(this.shape).forEach(r=>{const o=this.shape[r];t&&!t[r]?n[r]=o:n[r]=o.optional()}),new Mr({...this._def,shape:()=>n})}required(t){const n={};return Fn.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof ui;)s=s._def.innerType;n[r]=s}}),new Mr({...this._def,shape:()=>n})}keyof(){return zI(Fn.objectKeys(this.shape))}}Mr.create=(e,t)=>new Mr({shape:()=>e,unknownKeys:"strip",catchall:xi.create(),typeName:Yt.ZodObject,...cn(t)});Mr.strictCreate=(e,t)=>new Mr({shape:()=>e,unknownKeys:"strict",catchall:xi.create(),typeName:Yt.ZodObject,...cn(t)});Mr.lazycreate=(e,t)=>new Mr({shape:e,unknownKeys:"strip",catchall:xi.create(),typeName:Yt.ZodObject,...cn(t)});class of extends pn{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function o(s){for(const l of s)if(l.result.status==="valid")return l.result;for(const l of s)if(l.result.status==="dirty")return n.common.issues.push(...l.ctx.common.issues),l.result;const a=s.map(l=>new ca(l.ctx.common.issues));return yt(n,{code:He.invalid_union,unionErrors:a}),tn}if(n.common.async)return Promise.all(r.map(async s=>{const a={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(o);{let s;const a=[];for(const u of r){const f={...n,common:{...n.common,issues:[]},parent:null},p=u._parseSync({data:n.data,path:n.path,parent:f});if(p.status==="valid")return p;p.status==="dirty"&&!s&&(s={result:p,ctx:f}),f.common.issues.length&&a.push(f.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const l=a.map(u=>new ca(u));return yt(n,{code:He.invalid_union,unionErrors:l}),tn}}get options(){return this._def.options}}of.create=(e,t)=>new of({options:e,typeName:Yt.ZodUnion,...cn(t)});const Nh=e=>e instanceof lf?Nh(e.schema):e instanceof Sa?Nh(e.innerType()):e instanceof cf?[e.value]:e instanceof sl?e.options:e instanceof uf?Object.keys(e.enum):e instanceof df?Nh(e._def.innerType):e instanceof nf?[void 0]:e instanceof rf?[null]:null;class iv extends pn{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==gt.object)return yt(n,{code:He.invalid_type,expected:gt.object,received:n.parsedType}),tn;const r=this.discriminator,o=n.data[r],s=this.optionsMap.get(o);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(yt(n,{code:He.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),tn)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const o=new Map;for(const s of n){const a=Nh(s.shape[t]);if(!a)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const l of a){if(o.has(l))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(l)}`);o.set(l,s)}}return new iv({typeName:Yt.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:o,...cn(r)})}}function zy(e,t){const n=Ui(e),r=Ui(t);if(e===t)return{valid:!0,data:e};if(n===gt.object&&r===gt.object){const o=Fn.objectKeys(t),s=Fn.objectKeys(e).filter(l=>o.indexOf(l)!==-1),a={...e,...t};for(const l of s){const u=zy(e[l],t[l]);if(!u.valid)return{valid:!1};a[l]=u.data}return{valid:!0,data:a}}else if(n===gt.array&&r===gt.array){if(e.length!==t.length)return{valid:!1};const o=[];for(let s=0;s<e.length;s++){const a=e[s],l=t[s],u=zy(a,l);if(!u.valid)return{valid:!1};o.push(u.data)}return{valid:!0,data:o}}else return n===gt.date&&r===gt.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class sf extends pn{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),o=(s,a)=>{if(Ay(s)||Ay(a))return tn;const l=zy(s.value,a.value);return l.valid?((Ny(s)||Ny(a))&&n.dirty(),{status:n.value,value:l.data}):(yt(r,{code:He.invalid_intersection_types}),tn)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,a])=>o(s,a)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}sf.create=(e,t,n)=>new sf({left:e,right:t,typeName:Yt.ZodIntersection,...cn(n)});class Ua extends pn{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==gt.array)return yt(r,{code:He.invalid_type,expected:gt.array,received:r.parsedType}),tn;if(r.data.length<this._def.items.length)return yt(r,{code:He.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),tn;!this._def.rest&&r.data.length>this._def.items.length&&(yt(r,{code:He.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((a,l)=>{const u=this._def.items[l]||this._def.rest;return u?u._parse(new Wa(r,a,r.path,l)):null}).filter(a=>!!a);return r.common.async?Promise.all(s).then(a=>_o.mergeArray(n,a)):_o.mergeArray(n,s)}get items(){return this._def.items}rest(t){return new Ua({...this._def,rest:t})}}Ua.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ua({items:e,typeName:Yt.ZodTuple,rest:null,...cn(t)})};class af extends pn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==gt.object)return yt(r,{code:He.invalid_type,expected:gt.object,received:r.parsedType}),tn;const o=[],s=this._def.keyType,a=this._def.valueType;for(const l in r.data)o.push({key:s._parse(new Wa(r,l,r.path,l)),value:a._parse(new Wa(r,r.data[l],r.path,l))});return r.common.async?_o.mergeObjectAsync(n,o):_o.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof pn?new af({keyType:t,valueType:n,typeName:Yt.ZodRecord,...cn(r)}):new af({keyType:oa.create(),valueType:t,typeName:Yt.ZodRecord,...cn(n)})}}class Cm extends pn{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==gt.map)return yt(r,{code:He.invalid_type,expected:gt.map,received:r.parsedType}),tn;const o=this._def.keyType,s=this._def.valueType,a=[...r.data.entries()].map(([l,u],f)=>({key:o._parse(new Wa(r,l,r.path,[f,"key"])),value:s._parse(new Wa(r,u,r.path,[f,"value"]))}));if(r.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const u of a){const f=await u.key,p=await u.value;if(f.status==="aborted"||p.status==="aborted")return tn;(f.status==="dirty"||p.status==="dirty")&&n.dirty(),l.set(f.value,p.value)}return{status:n.value,value:l}})}else{const l=new Map;for(const u of a){const f=u.key,p=u.value;if(f.status==="aborted"||p.status==="aborted")return tn;(f.status==="dirty"||p.status==="dirty")&&n.dirty(),l.set(f.value,p.value)}return{status:n.value,value:l}}}}Cm.create=(e,t,n)=>new Cm({valueType:t,keyType:e,typeName:Yt.ZodMap,...cn(n)});class sc extends pn{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==gt.set)return yt(r,{code:He.invalid_type,expected:gt.set,received:r.parsedType}),tn;const o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(yt(r,{code:He.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()),o.maxSize!==null&&r.data.size>o.maxSize.value&&(yt(r,{code:He.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());const s=this._def.valueType;function a(u){const f=new Set;for(const p of u){if(p.status==="aborted")return tn;p.status==="dirty"&&n.dirty(),f.add(p.value)}return{status:n.value,value:f}}const l=[...r.data.values()].map((u,f)=>s._parse(new Wa(r,u,r.path,f)));return r.common.async?Promise.all(l).then(u=>a(u)):a(l)}min(t,n){return new sc({...this._def,minSize:{value:t,message:Lt.toString(n)}})}max(t,n){return new sc({...this._def,maxSize:{value:t,message:Lt.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}sc.create=(e,t)=>new sc({valueType:e,minSize:null,maxSize:null,typeName:Yt.ZodSet,...cn(t)});class du extends pn{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==gt.function)return yt(n,{code:He.invalid_type,expected:gt.function,received:n.parsedType}),tn;function r(l,u){return ym({data:l,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,vm(),ef].filter(f=>!!f),issueData:{code:He.invalid_arguments,argumentsError:u}})}function o(l,u){return ym({data:l,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,vm(),ef].filter(f=>!!f),issueData:{code:He.invalid_return_type,returnTypeError:u}})}const s={errorMap:n.common.contextualErrorMap},a=n.data;return this._def.returns instanceof wu?No(async(...l)=>{const u=new ca([]),f=await this._def.args.parseAsync(l,s).catch(v=>{throw u.addIssue(r(l,v)),u}),p=await a(...f);return await this._def.returns._def.type.parseAsync(p,s).catch(v=>{throw u.addIssue(o(p,v)),u})}):No((...l)=>{const u=this._def.args.safeParse(l,s);if(!u.success)throw new ca([r(l,u.error)]);const f=a(...u.data),p=this._def.returns.safeParse(f,s);if(!p.success)throw new ca([o(f,p.error)]);return p.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new du({...this._def,args:Ua.create(t).rest(Yl.create())})}returns(t){return new du({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new du({args:t||Ua.create([]).rest(Yl.create()),returns:n||Yl.create(),typeName:Yt.ZodFunction,...cn(r)})}}class lf extends pn{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}lf.create=(e,t)=>new lf({getter:e,typeName:Yt.ZodLazy,...cn(t)});class cf extends pn{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return yt(n,{received:n.data,code:He.invalid_literal,expected:this._def.value}),tn}return{status:"valid",value:t.data}}get value(){return this._def.value}}cf.create=(e,t)=>new cf({value:e,typeName:Yt.ZodLiteral,...cn(t)});function zI(e,t){return new sl({values:e,typeName:Yt.ZodEnum,...cn(t)})}class sl extends pn{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return yt(n,{expected:Fn.joinValues(r),received:n.parsedType,code:He.invalid_type}),tn}if(this._def.values.indexOf(t.data)===-1){const n=this._getOrReturnCtx(t),r=this._def.values;return yt(n,{received:n.data,code:He.invalid_enum_value,options:r}),tn}return No(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t){return sl.create(t)}exclude(t){return sl.create(this.options.filter(n=>!t.includes(n)))}}sl.create=zI;class uf extends pn{_parse(t){const n=Fn.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==gt.string&&r.parsedType!==gt.number){const o=Fn.objectValues(n);return yt(r,{expected:Fn.joinValues(o),received:r.parsedType,code:He.invalid_type}),tn}if(n.indexOf(t.data)===-1){const o=Fn.objectValues(n);return yt(r,{received:r.data,code:He.invalid_enum_value,options:o}),tn}return No(t.data)}get enum(){return this._def.values}}uf.create=(e,t)=>new uf({values:e,typeName:Yt.ZodNativeEnum,...cn(t)});class wu extends pn{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==gt.promise&&n.common.async===!1)return yt(n,{code:He.invalid_type,expected:gt.promise,received:n.parsedType}),tn;const r=n.parsedType===gt.promise?n.data:Promise.resolve(n.data);return No(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}}wu.create=(e,t)=>new wu({type:e,typeName:Yt.ZodPromise,...cn(t)});class Sa extends pn{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Yt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),o=this._def.effect||null;if(o.type==="preprocess"){const a=o.transform(r.data);return r.common.async?Promise.resolve(a).then(l=>this._def.schema._parseAsync({data:l,path:r.path,parent:r})):this._def.schema._parseSync({data:a,path:r.path,parent:r})}const s={addIssue:a=>{yt(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="refinement"){const a=l=>{const u=o.refinement(l,s);if(r.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return l.status==="aborted"?tn:(l.status==="dirty"&&n.dirty(),a(l.value),{status:n.value,value:l.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>l.status==="aborted"?tn:(l.status==="dirty"&&n.dirty(),a(l.value).then(()=>({status:n.value,value:l.value}))))}if(o.type==="transform")if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!xm(a))return a;const l=o.transform(a.value,s);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:l}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>xm(a)?Promise.resolve(o.transform(a.value,s)).then(l=>({status:n.value,value:l})):a);Fn.assertNever(o)}}Sa.create=(e,t,n)=>new Sa({schema:e,typeName:Yt.ZodEffects,effect:t,...cn(n)});Sa.createWithPreprocess=(e,t,n)=>new Sa({schema:t,effect:{type:"preprocess",transform:e},typeName:Yt.ZodEffects,...cn(n)});class ui extends pn{_parse(t){return this._getType(t)===gt.undefined?No(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ui.create=(e,t)=>new ui({innerType:e,typeName:Yt.ZodOptional,...cn(t)});class ac extends pn{_parse(t){return this._getType(t)===gt.null?No(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ac.create=(e,t)=>new ac({innerType:e,typeName:Yt.ZodNullable,...cn(t)});class df extends pn{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===gt.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}df.create=(e,t)=>new df({innerType:e,typeName:Yt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...cn(t)});class _m extends pn{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return bm(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new ca(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new ca(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}_m.create=(e,t)=>new _m({innerType:e,typeName:Yt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...cn(t)});class km extends pn{_parse(t){if(this._getType(t)!==gt.nan){const r=this._getOrReturnCtx(t);return yt(r,{code:He.invalid_type,expected:gt.nan,received:r.parsedType}),tn}return{status:"valid",value:t.data}}}km.create=e=>new km({typeName:Yt.ZodNaN,...cn(e)});const $U=Symbol("zod_brand");class $I extends pn{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Uf extends pn{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?tn:s.status==="dirty"?(n.dirty(),NI(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?tn:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(t,n){return new Uf({in:t,out:n,typeName:Yt.ZodPipeline})}}const LI=(e,t={},n)=>e?bu.create().superRefine((r,o)=>{var s,a;if(!e(r)){const l=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,u=(a=(s=l.fatal)!==null&&s!==void 0?s:n)!==null&&a!==void 0?a:!0,f=typeof l=="string"?{message:l}:l;o.addIssue({code:"custom",...f,fatal:u})}}):bu.create(),LU={object:Mr.lazycreate};var Yt;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline"})(Yt||(Yt={}));const BU=(e,t={message:`Input not instance of ${e.name}`})=>LI(n=>n instanceof e,t),BI=oa.create,FI=rl.create,FU=km.create,HU=ol.create,HI=tf.create,VU=oc.create,WU=wm.create,UU=nf.create,GU=rf.create,qU=bu.create,YU=Yl.create,KU=xi.create,XU=Sm.create,ZU=ua.create,QU=Mr.create,JU=Mr.strictCreate,eG=of.create,tG=iv.create,nG=sf.create,rG=Ua.create,oG=af.create,sG=Cm.create,aG=sc.create,iG=du.create,lG=lf.create,cG=cf.create,uG=sl.create,dG=uf.create,fG=wu.create,m4=Sa.create,pG=ui.create,hG=ac.create,mG=Sa.createWithPreprocess,gG=Uf.create,vG=()=>BI().optional(),yG=()=>FI().optional(),xG=()=>HI().optional(),bG={string:e=>oa.create({...e,coerce:!0}),number:e=>rl.create({...e,coerce:!0}),boolean:e=>tf.create({...e,coerce:!0}),bigint:e=>ol.create({...e,coerce:!0}),date:e=>oc.create({...e,coerce:!0})},wG=tn;var Xa=Object.freeze({__proto__:null,defaultErrorMap:ef,setErrorMap:kU,getErrorMap:vm,makeIssue:ym,EMPTY_PATH:PU,addIssueToContext:yt,ParseStatus:_o,INVALID:tn,DIRTY:NI,OK:No,isAborted:Ay,isDirty:Ny,isValid:xm,isAsync:bm,get util(){return Fn},get objectUtil(){return Dy},ZodParsedType:gt,getParsedType:Ui,ZodType:pn,ZodString:oa,ZodNumber:rl,ZodBigInt:ol,ZodBoolean:tf,ZodDate:oc,ZodSymbol:wm,ZodUndefined:nf,ZodNull:rf,ZodAny:bu,ZodUnknown:Yl,ZodNever:xi,ZodVoid:Sm,ZodArray:ua,ZodObject:Mr,ZodUnion:of,ZodDiscriminatedUnion:iv,ZodIntersection:sf,ZodTuple:Ua,ZodRecord:af,ZodMap:Cm,ZodSet:sc,ZodFunction:du,ZodLazy:lf,ZodLiteral:cf,ZodEnum:sl,ZodNativeEnum:uf,ZodPromise:wu,ZodEffects:Sa,ZodTransformer:Sa,ZodOptional:ui,ZodNullable:ac,ZodDefault:df,ZodCatch:_m,ZodNaN:km,BRAND:$U,ZodBranded:$I,ZodPipeline:Uf,custom:LI,Schema:pn,ZodSchema:pn,late:LU,get ZodFirstPartyTypeKind(){return Yt},coerce:bG,any:qU,array:ZU,bigint:HU,boolean:HI,date:VU,discriminatedUnion:tG,effect:m4,enum:uG,function:iG,instanceof:BU,intersection:nG,lazy:lG,literal:cG,map:sG,nan:FU,nativeEnum:dG,never:KU,null:GU,nullable:hG,number:FI,object:QU,oboolean:xG,onumber:yG,optional:pG,ostring:vG,pipeline:gG,preprocess:mG,promise:fG,record:oG,set:aG,strictObject:JU,string:BI,symbol:WU,transformer:m4,tuple:rG,undefined:UU,union:eG,unknown:YU,void:XU,NEVER:wG,ZodIssueCode:He,quotelessJson:_U,ZodError:ca});const SG=Xa.string(),Qp=e=>SG.safeParse(e).success,CG=Xa.string(),Jp=e=>CG.safeParse(e).success,_G=Xa.number().int().min(1),g4=e=>_G.safeParse(e).success,kG=Xa.number().min(1),v4=e=>kG.safeParse(e).success,PG=Xa.enum(gM),y4=e=>PG.safeParse(e).success,jG=Xa.number().int().min(0).max(yx),x4=e=>jG.safeParse(e).success,IG=Xa.number().multipleOf(8).min(64),b4=e=>IG.safeParse(e).success,EG=Xa.number().multipleOf(8).min(64),w4=e=>EG.safeParse(e).success,OG=Xa.string(),S4=e=>OG.safeParse(e).success,TG=Xa.number().min(0).max(1),C4=e=>TG.safeParse(e).success,Nb=()=>{const e=ue(),t=jf(),{t:n}=Ce(),r=h.useCallback(()=>{t({title:n("toast.parameterSet"),status:"info",duration:2500,isClosable:!0})},[n,t]),o=h.useCallback(()=>{t({title:n("toast.parameterNotSet"),status:"warning",duration:2500,isClosable:!0})},[n,t]),s=h.useCallback(()=>{t({title:n("toast.parametersSet"),status:"info",duration:2500,isClosable:!0})},[n,t]),a=h.useCallback(()=>{t({title:n("toast.parametersNotSet"),status:"warning",duration:2500,isClosable:!0})},[n,t]),l=h.useCallback((j,E)=>{if(Qp(j)||Jp(E)){Qp(j)&&e(_h(j)),Jp(E)&&e(kh(E)),r();return}o()},[e,r,o]),u=h.useCallback(j=>{if(!Qp(j)){o();return}e(_h(j)),r()},[e,r,o]),f=h.useCallback(j=>{if(!Jp(j)){o();return}e(kh(j)),r()},[e,r,o]),p=h.useCallback(j=>{if(!x4(j)){o();return}e(Fh(j)),r()},[e,r,o]),m=h.useCallback(j=>{if(!v4(j)){o();return}e(Hh(j)),r()},[e,r,o]),v=h.useCallback(j=>{if(!S4(j)){o();return}e(q1(j)),r()},[e,r,o]),y=h.useCallback(j=>{if(!y4(j)){o();return}e(Y1(j)),r()},[e,r,o]),S=h.useCallback(j=>{if(!g4(j)){o();return}e(Vh(j)),r()},[e,r,o]),x=h.useCallback(j=>{if(!b4(j)){o();return}e(Wh(j)),r()},[e,r,o]),w=h.useCallback(j=>{if(!w4(j)){o();return}e(Uh(j)),r()},[e,r,o]),_=h.useCallback(j=>{if(!C4(j)){o();return}e(Gh(j)),r()},[e,r,o]),k=h.useCallback(async j=>{if(!vM(j)){o();return}e(qh(j.image_name)),r()},[e,r,o]),P=h.useCallback(j=>{e(qh(j))},[e]),I=h.useCallback(j=>{if(!j||!j.metadata){a();return}const{cfg_scale:E,height:T,model:R,positive_conditioning:M,negative_conditioning:D,scheduler:N,seed:U,steps:z,width:F,strength:H,clip:G,extra:A,latents:L,unet:W,vae:V}=j.metadata;v4(E)&&e(Hh(E)),S4(R)&&e(q1(R)),Qp(M)&&e(_h(M)),Jp(D)&&e(kh(D)),y4(N)&&e(Y1(N)),x4(U)&&e(Fh(U)),g4(z)&&e(Vh(z)),b4(F)&&e(Wh(F)),w4(T)&&e(Uh(T)),C4(H)&&e(Gh(H)),s()},[a,s,e]);return{recallBothPrompts:l,recallPositivePrompt:u,recallNegativePrompt:f,recallSeed:p,recallInitialImage:k,recallCfgScale:m,recallModel:v,recallScheduler:y,recallSteps:S,recallWidth:x,recallHeight:w,recallStrength:_,recallAllParameters:I,sendToImageToImage:P}},RG=Te([pl,pr,av,Gr],(e,t,n,r)=>{const{galleryImageObjectFit:o,galleryImageMinimumWidth:s,shouldUseSingleGalleryColumn:a}=e,{isLightboxOpen:l}=n,{isConnected:u,isProcessing:f,shouldConfirmOnDelete:p}=t;return{canDeleteImage:u&&!f,shouldConfirmOnDelete:p,galleryImageObjectFit:o,galleryImageMinimumWidth:s,shouldUseSingleGalleryColumn:a,activeTabName:r,isLightboxOpen:l}},{memoizeOptions:{resultEqualityCheck:Ut}}),MG=e=>{var X,Q;const t=ue(),{activeTabName:n,galleryImageObjectFit:r,galleryImageMinimumWidth:o,canDeleteImage:s,shouldUseSingleGalleryColumn:a}=q(RG),{image:l,isSelected:u}=e,{image_url:f,thumbnail_url:p,image_name:m}=l,[v,y]=h.useState(!1),S=jf(),{t:x}=Ce(),w=so("lightbox").isFeatureEnabled,_=so("unifiedCanvas").isFeatureEnabled,{onDelete:k}=h.useContext(xx),{onClickAddToBoard:P}=h.useContext(n5),I=h.useCallback(()=>{k(l)},[l,k]),{recallBothPrompts:j,recallSeed:E,recallAllParameters:T}=Nb(),{attributes:R,listeners:M,setNodeRef:D}=r5({id:`galleryImage_${m}`,data:{image:l}}),[N]=o5(),U=()=>y(!0),z=()=>y(!1),F=h.useCallback(()=>{t(Yh(l.image_name))},[l,t]),H=h.useCallback(()=>{var ie,ve;j((ie=l.metadata)==null?void 0:ie.positive_conditioning,(ve=l.metadata)==null?void 0:ve.negative_conditioning)},[(X=l.metadata)==null?void 0:X.negative_conditioning,(Q=l.metadata)==null?void 0:Q.positive_conditioning,j]),G=h.useCallback(()=>{var ie;E((ie=l.metadata)==null?void 0:ie.seed)},[l,E]),A=h.useCallback(()=>{t(s5()),t(qh(l))},[t,l]),L=()=>{t(a5()),t(bx(l)),t(Sg()),n!=="unifiedCanvas"&&t(Nl("unifiedCanvas")),S({title:x("toast.sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0})},W=h.useCallback(()=>{T(l)},[l,T]),V=()=>{},ee=h.useCallback(()=>{P(l)},[l,P]),le=h.useCallback(()=>{l.board_id&&N({board_id:l.board_id,image_name:l.image_name})},[l.board_id,l.image_name,N]),oe=()=>{window.open(l.image_url,"_blank")};return i.jsx(et,{ref:D,...M,...R,sx:{w:"full",h:"full",touchAction:"none"},children:i.jsx(DI,{menuProps:{size:"sm",isLazy:!0},renderMenu:()=>{var ie,ve,ye;return i.jsxs(Lf,{sx:{visibility:"visible !important"},children:[i.jsx(os,{icon:i.jsx(Db,{}),onClickCapture:oe,children:x("common.openInNewTab")}),w&&i.jsx(os,{icon:i.jsx(Ob,{}),onClickCapture:V,children:x("parameters.openInViewer")}),i.jsx(os,{icon:i.jsx(Ah,{}),onClickCapture:H,isDisabled:((ie=l==null?void 0:l.metadata)==null?void 0:ie.positive_conditioning)===void 0,children:x("parameters.usePrompt")}),i.jsx(os,{icon:i.jsx(Ah,{}),onClickCapture:G,isDisabled:((ve=l==null?void 0:l.metadata)==null?void 0:ve.seed)===void 0,children:x("parameters.useSeed")}),i.jsx(os,{icon:i.jsx(Ah,{}),onClickCapture:W,isDisabled:!["t2l","l2l","inpaint"].includes(String((ye=l==null?void 0:l.metadata)==null?void 0:ye.type)),children:x("parameters.useAll")}),i.jsx(os,{icon:i.jsx(gm,{}),onClickCapture:A,id:"send-to-img2img",children:x("parameters.sendToImg2Img")}),_&&i.jsx(os,{icon:i.jsx(gm,{}),onClickCapture:L,id:"send-to-canvas",children:x("parameters.sendToUnifiedCanvas")}),i.jsx(os,{icon:i.jsx(My,{}),onClickCapture:ee,children:l.board_id?"Change Board":"Add to Board"}),l.board_id&&i.jsx(os,{icon:i.jsx(My,{}),onClickCapture:le,children:"Remove from Board"}),i.jsx(os,{sx:{color:"error.300"},icon:i.jsx(Ls,{}),onClickCapture:I,children:x("gallery.deleteImage")})]})},children:ie=>i.jsxs(et,{position:"relative",onMouseOver:U,onMouseOut:z,userSelect:"none",onClick:F,ref:ie,sx:{display:"flex",justifyContent:"center",alignItems:"center",w:"full",h:"full",transition:"transform 0.2s ease-out",aspectRatio:"1/1",cursor:"pointer"},children:[i.jsx(If,{loading:"lazy",objectFit:a?"contain":r,draggable:!1,rounded:"md",src:p||f,fallback:i.jsx(Vf,{}),sx:{width:"100%",height:"100%",maxWidth:"100%",maxHeight:"100%"}}),u&&i.jsx(K,{sx:{position:"absolute",top:"0",insetInlineStart:"0",width:"100%",height:"100%",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:i.jsx(uo,{filter:"drop-shadow(0px 0px 1rem black)",as:_I,sx:{width:"50%",height:"50%",maxWidth:"4rem",maxHeight:"4rem",fill:"ok.500"}})}),v&&o>=100&&i.jsx(et,{sx:{position:"absolute",top:1,insetInlineEnd:1},children:i.jsx(Me,{onClickCapture:I,"aria-label":x("gallery.deleteImage"),icon:i.jsx(Ls,{}),size:"xs",fontSize:14,isDisabled:!s})})]},m)})})},_4=h.memo(MG),DG=eD(e=>{e(i5(!0))},300),Bs=()=>(e,t)=>{Gr(t())==="unifiedCanvas"&&DG(e)},lv=0,ml=1,Uu=2,VI=4;function WI(e,t){return n=>e(t(n))}function AG(e,t){return t(e)}function UI(e,t){return n=>e(t,n)}function k4(e,t){return()=>e(t)}function cv(e,t){return t(e),e}function Ir(...e){return e}function NG(e){e()}function P4(e){return()=>e}function zG(...e){return()=>{e.map(NG)}}function uv(e){return e!==void 0}function Gu(){}function yr(e,t){return e(ml,t)}function ir(e,t){e(lv,t)}function zb(e){e(Uu)}function Ts(e){return e(VI)}function Ht(e,t){return yr(e,UI(t,lv))}function ic(e,t){const n=e(ml,r=>{n(),t(r)});return n}function Un(){const e=[];return(t,n)=>{switch(t){case Uu:e.splice(0,e.length);return;case ml:return e.push(n),()=>{const r=e.indexOf(n);r>-1&&e.splice(r,1)};case lv:e.slice().forEach(r=>{r(n)});return;default:throw new Error(`unrecognized action ${t}`)}}}function xt(e){let t=e;const n=Un();return(r,o)=>{switch(r){case ml:o(t);break;case lv:t=o;break;case VI:return t}return n(r,o)}}function $G(e){let t,n;const r=()=>t&&t();return function(o,s){switch(o){case ml:return s?n===s?void 0:(r(),n=s,t=yr(e,s),t):(r(),Gu);case Uu:r(),n=null;return;default:throw new Error(`unrecognized action ${o}`)}}}function ls(e){return cv(Un(),t=>Ht(e,t))}function Do(e,t){return cv(xt(t),n=>Ht(e,n))}function LG(...e){return t=>e.reduceRight(AG,t)}function Ve(e,...t){const n=LG(...t);return(r,o)=>{switch(r){case ml:return yr(e,n(o));case Uu:zb(e);return}}}function GI(e,t){return e===t}function kr(e=GI){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function dn(e){return t=>n=>{e(n)&&t(n)}}function _t(e){return t=>WI(t,e)}function Wi(e){return t=>()=>t(e)}function La(e,t){return n=>r=>n(t=e(t,r))}function ff(e){return t=>n=>{e>0?e--:t(n)}}function $l(e){let t=null,n;return r=>o=>{t=o,!n&&(n=setTimeout(()=>{n=void 0,r(t)},e))}}function j4(e){let t,n;return r=>o=>{t=o,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function Pn(...e){const t=new Array(e.length);let n=0,r=null;const o=Math.pow(2,e.length)-1;return e.forEach((s,a)=>{const l=Math.pow(2,a);yr(s,u=>{const f=n;n=n|l,t[a]=u,f!==o&&n===o&&r&&(r(),r=null)})}),s=>a=>{const l=()=>s([a].concat(t));n===o?l():r=l}}function I4(...e){return function(t,n){switch(t){case ml:return zG(...e.map(r=>yr(r,n)));case Uu:return;default:throw new Error(`unrecognized action ${t}`)}}}function Cn(e,t=GI){return Ve(e,kr(t))}function So(...e){const t=Un(),n=new Array(e.length);let r=0;const o=Math.pow(2,e.length)-1;return e.forEach((s,a)=>{const l=Math.pow(2,a);yr(s,u=>{n[a]=u,r=r|l,r===o&&ir(t,n)})}),function(s,a){switch(s){case ml:return r===o&&a(n),yr(t,a);case Uu:return zb(t);default:throw new Error(`unrecognized action ${s}`)}}}function Zn(e,t=[],{singleton:n}={singleton:!0}){return{id:BG(),constructor:e,dependencies:t,singleton:n}}const BG=()=>Symbol();function FG(e){const t=new Map,n=({id:r,constructor:o,dependencies:s,singleton:a})=>{if(a&&t.has(r))return t.get(r);const l=o(s.map(u=>n(u)));return a&&t.set(r,l),l};return n(e)}function HG(e,t){const n={},r={};let o=0;const s=e.length;for(;o<s;)r[e[o]]=1,o+=1;for(const a in t)r.hasOwnProperty(a)||(n[a]=t[a]);return n}const eh=typeof document<"u"?B.useLayoutEffect:B.useEffect;function qI(e,t,n){const r=Object.keys(t.required||{}),o=Object.keys(t.optional||{}),s=Object.keys(t.methods||{}),a=Object.keys(t.events||{}),l=B.createContext({});function u(x,w){x.propsReady&&ir(x.propsReady,!1);for(const _ of r){const k=x[t.required[_]];ir(k,w[_])}for(const _ of o)if(_ in w){const k=x[t.optional[_]];ir(k,w[_])}x.propsReady&&ir(x.propsReady,!0)}function f(x){return s.reduce((w,_)=>(w[_]=k=>{const P=x[t.methods[_]];ir(P,k)},w),{})}function p(x){return a.reduce((w,_)=>(w[_]=$G(x[t.events[_]]),w),{})}return{Component:B.forwardRef((x,w)=>{const{children:_,...k}=x,[P]=B.useState(()=>cv(FG(e),j=>u(j,k))),[I]=B.useState(k4(p,P));return eh(()=>{for(const j of a)j in k&&yr(I[j],k[j]);return()=>{Object.values(I).map(zb)}},[k,I,P]),eh(()=>{u(P,k)}),B.useImperativeHandle(w,P4(f(P))),B.createElement(l.Provider,{value:P},n?B.createElement(n,HG([...r,...o,...a],k),_):_)}),usePublisher:x=>B.useCallback(UI(ir,B.useContext(l)[x]),[x]),useEmitterValue:x=>{const _=B.useContext(l)[x],[k,P]=B.useState(k4(Ts,_));return eh(()=>yr(_,I=>{I!==k&&P(P4(I))}),[_,k]),k},useEmitter:(x,w)=>{const k=B.useContext(l)[x];eh(()=>yr(k,w),[w,k])}}}const VG=typeof document<"u"?B.useLayoutEffect:B.useEffect,WG=VG;var cs=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(cs||{});const UG={[0]:"debug",[1]:"log",[2]:"warn",[3]:"error"},GG=()=>typeof globalThis>"u"?window:globalThis,gl=Zn(()=>{const e=xt(3);return{log:xt((n,r,o=1)=>{var s;const a=(s=GG().VIRTUOSO_LOG_LEVEL)!=null?s:Ts(e);o>=a&&console[UG[o]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",n,r)}),logLevel:e}},[],{singleton:!0});function $b(e,t=!0){const n=B.useRef(null);let r=o=>{};if(typeof ResizeObserver<"u"){const o=B.useMemo(()=>new ResizeObserver(s=>{const a=s[0].target;a.offsetParent!==null&&e(a)}),[e]);r=s=>{s&&t?(o.observe(s),n.current=s):(n.current&&o.unobserve(n.current),n.current=null)}}return{ref:n,callbackRef:r}}function gc(e,t=!0){return $b(e,t).callbackRef}function qG(e,t,n,r,o,s,a){const l=B.useCallback(u=>{const f=YG(u.children,t,"offsetHeight",o);let p=u.parentElement;for(;!p.dataset.virtuosoScroller;)p=p.parentElement;const m=p.lastElementChild.dataset.viewportType==="window",v=a?a.scrollTop:m?window.pageYOffset||document.documentElement.scrollTop:p.scrollTop,y=a?a.scrollHeight:m?document.documentElement.scrollHeight:p.scrollHeight,S=a?a.offsetHeight:m?window.innerHeight:p.offsetHeight;r({scrollTop:Math.max(v,0),scrollHeight:y,viewportHeight:S}),s==null||s(KG("row-gap",getComputedStyle(u).rowGap,o)),f!==null&&e(f)},[e,t,o,s,a,r]);return $b(l,n)}function YG(e,t,n,r){const o=e.length;if(o===0)return null;const s=[];for(let a=0;a<o;a++){const l=e.item(a);if(!l||l.dataset.index===void 0)continue;const u=parseInt(l.dataset.index),f=parseFloat(l.dataset.knownSize),p=t(l,n);if(p===0&&r("Zero-sized element, this should not happen",{child:l},cs.ERROR),p===f)continue;const m=s[s.length-1];s.length===0||m.size!==p||m.endIndex!==u-1?s.push({startIndex:u,endIndex:u,size:p}):s[s.length-1].endIndex++}return s}function KG(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,cs.WARN),t==="normal"?0:parseInt(t??"0",10)}function al(e,t){return Math.round(e.getBoundingClientRect()[t])}function YI(e,t){return Math.abs(e-t)<1.01}function KI(e,t,n,r=Gu,o){const s=B.useRef(null),a=B.useRef(null),l=B.useRef(null),u=B.useCallback(m=>{const v=m.target,y=v===window||v===document,S=y?window.pageYOffset||document.documentElement.scrollTop:v.scrollTop,x=y?document.documentElement.scrollHeight:v.scrollHeight,w=y?window.innerHeight:v.offsetHeight,_=()=>{e({scrollTop:Math.max(S,0),scrollHeight:x,viewportHeight:w})};m.suppressFlushSync?_():yM.flushSync(_),a.current!==null&&(S===a.current||S<=0||S===x-w)&&(a.current=null,t(!0),l.current&&(clearTimeout(l.current),l.current=null))},[e,t]);B.useEffect(()=>{const m=o||s.current;return r(o||s.current),u({target:m,suppressFlushSync:!0}),m.addEventListener("scroll",u,{passive:!0}),()=>{r(null),m.removeEventListener("scroll",u)}},[s,u,n,r,o]);function f(m){const v=s.current;if(!v||"offsetHeight"in v&&v.offsetHeight===0)return;const y=m.behavior==="smooth";let S,x,w;v===window?(x=Math.max(al(document.documentElement,"height"),document.documentElement.scrollHeight),S=window.innerHeight,w=document.documentElement.scrollTop):(x=v.scrollHeight,S=al(v,"height"),w=v.scrollTop);const _=x-S;if(m.top=Math.ceil(Math.max(Math.min(_,m.top),0)),YI(S,x)||m.top===w){e({scrollTop:w,scrollHeight:x,viewportHeight:S}),y&&t(!0);return}y?(a.current=m.top,l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{l.current=null,a.current=null,t(!0)},1e3)):a.current=null,v.scrollTo(m)}function p(m){s.current.scrollBy(m)}return{scrollerRef:s,scrollByCallback:p,scrollToCallback:f}}const Lo=Zn(()=>{const e=Un(),t=Un(),n=xt(0),r=Un(),o=xt(0),s=Un(),a=Un(),l=xt(0),u=xt(0),f=xt(0),p=xt(0),m=Un(),v=Un(),y=xt(!1);return Ht(Ve(e,_t(({scrollTop:S})=>S)),t),Ht(Ve(e,_t(({scrollHeight:S})=>S)),a),Ht(t,o),{scrollContainerState:e,scrollTop:t,viewportHeight:s,headerHeight:l,fixedHeaderHeight:u,fixedFooterHeight:f,footerHeight:p,scrollHeight:a,smoothScrollTargetReached:r,scrollTo:m,scrollBy:v,statefulScrollTop:o,deviation:n,scrollingInProgress:y}},[],{singleton:!0}),pf={lvl:0};function XI(e,t,n,r=pf,o=pf){return{k:e,v:t,lvl:n,l:r,r:o}}function cr(e){return e===pf}function fu(){return pf}function $y(e,t){if(cr(e))return pf;const{k:n,l:r,r:o}=e;if(t===n){if(cr(r))return o;if(cr(o))return r;{const[s,a]=ZI(r);return zh(Jr(e,{k:s,v:a,l:QI(r)}))}}else return t<n?zh(Jr(e,{l:$y(r,t)})):zh(Jr(e,{r:$y(o,t)}))}function hf(e,t){if(!cr(e))return t===e.k?e.v:t<e.k?hf(e.l,t):hf(e.r,t)}function Ca(e,t,n="k"){if(cr(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){const r=Ca(e.r,t,n);return r[0]===-1/0?[e.k,e.v]:r}return Ca(e.l,t,n)}function as(e,t,n){return cr(e)?XI(t,n,1):t===e.k?Jr(e,{k:t,v:n}):t<e.k?E4(Jr(e,{l:as(e.l,t,n)})):E4(Jr(e,{r:as(e.r,t,n)}))}function Ly(e,t,n){if(cr(e))return[];const{k:r,v:o,l:s,r:a}=e;let l=[];return r>t&&(l=l.concat(Ly(s,t,n))),r>=t&&r<=n&&l.push({k:r,v:o}),r<=n&&(l=l.concat(Ly(a,t,n))),l}function Ll(e){return cr(e)?[]:[...Ll(e.l),{k:e.k,v:e.v},...Ll(e.r)]}function ZI(e){return cr(e.r)?[e.k,e.v]:ZI(e.r)}function QI(e){return cr(e.r)?e.l:zh(Jr(e,{r:QI(e.r)}))}function Jr(e,t){return XI(t.k!==void 0?t.k:e.k,t.v!==void 0?t.v:e.v,t.lvl!==void 0?t.lvl:e.lvl,t.l!==void 0?t.l:e.l,t.r!==void 0?t.r:e.r)}function x1(e){return cr(e)||e.lvl>e.r.lvl}function E4(e){return By(eE(e))}function zh(e){const{l:t,r:n,lvl:r}=e;if(n.lvl>=r-1&&t.lvl>=r-1)return e;if(r>n.lvl+1){if(x1(t))return eE(Jr(e,{lvl:r-1}));if(!cr(t)&&!cr(t.r))return Jr(t.r,{l:Jr(t,{r:t.r.l}),r:Jr(e,{l:t.r.r,lvl:r-1}),lvl:r});throw new Error("Unexpected empty nodes")}else{if(x1(e))return By(Jr(e,{lvl:r-1}));if(!cr(n)&&!cr(n.l)){const o=n.l,s=x1(o)?n.lvl-1:n.lvl;return Jr(o,{l:Jr(e,{r:o.l,lvl:r-1}),r:By(Jr(n,{l:o.r,lvl:s})),lvl:o.lvl+1})}else throw new Error("Unexpected empty nodes")}}function dv(e,t,n){if(cr(e))return[];const r=Ca(e,t)[0];return XG(Ly(e,r,n))}function JI(e,t){const n=e.length;if(n===0)return[];let{index:r,value:o}=t(e[0]);const s=[];for(let a=1;a<n;a++){const{index:l,value:u}=t(e[a]);s.push({start:r,end:l-1,value:o}),r=l,o=u}return s.push({start:r,end:1/0,value:o}),s}function XG(e){return JI(e,({k:t,v:n})=>({index:t,value:n}))}function By(e){const{r:t,lvl:n}=e;return!cr(t)&&!cr(t.r)&&t.lvl===n&&t.r.lvl===n?Jr(t,{l:Jr(e,{r:t.l}),lvl:n+1}):e}function eE(e){const{l:t}=e;return!cr(t)&&t.lvl===e.lvl?Jr(t,{r:Jr(e,{l:t.r})}):e}function Pm(e,t,n,r=0){let o=e.length-1;for(;r<=o;){const s=Math.floor((r+o)/2),a=e[s],l=n(a,t);if(l===0)return s;if(l===-1){if(o-r<2)return s-1;o=s-1}else{if(o===r)return s;r=s+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function tE(e,t,n){return e[Pm(e,t,n)]}function ZG(e,t,n,r){const o=Pm(e,t,r),s=Pm(e,n,r,o);return e.slice(o,s+1)}const Lb=Zn(()=>({recalcInProgress:xt(!1)}),[],{singleton:!0});function QG(e){const{size:t,startIndex:n,endIndex:r}=e;return o=>o.start===n&&(o.end===r||o.end===1/0)&&o.value===t}function O4(e,t){let n=0,r=0;for(;n<e;)n+=t[r+1]-t[r]-1,r++;return r-(n===e?0:1)}function JG(e,t){let n=cr(e)?0:1/0;for(const r of t){const{size:o,startIndex:s,endIndex:a}=r;if(n=Math.min(n,s),cr(e)){e=as(e,0,o);continue}const l=dv(e,s-1,a+1);if(l.some(QG(r)))continue;let u=!1,f=!1;for(const{start:p,end:m,value:v}of l)u?(a>=p||o===v)&&(e=$y(e,p)):(f=v!==o,u=!0),m>a&&a>=p&&v!==o&&(e=as(e,a+1,v));f&&(e=as(e,s,o))}return[e,n]}function eq(){return{offsetTree:[],sizeTree:fu(),groupOffsetTree:fu(),lastIndex:0,lastOffset:0,lastSize:0,groupIndices:[]}}function Bb({index:e},t){return t===e?0:t<e?-1:1}function tq({offset:e},t){return t===e?0:t<e?-1:1}function nq(e){return{index:e.index,value:e}}function rq(e,t,n,r=0){return r>0&&(t=Math.max(t,tE(e,r,Bb).offset)),JI(ZG(e,t,n,tq),nq)}function Fy(e,t,n,r){let o=e,s=0,a=0,l=0,u=0;if(t!==0){u=Pm(o,t-1,Bb),l=o[u].offset;const p=Ca(n,t-1);s=p[0],a=p[1],o.length&&o[u].size===Ca(n,t)[1]&&(u-=1),o=o.slice(0,u+1)}else o=[];for(const{start:f,value:p}of dv(n,t,1/0)){const m=f-s,v=m*a+l+m*r;o.push({offset:v,size:p,index:f}),s=f,l=v,a=p}return{offsetTree:o,lastIndex:s,lastOffset:l,lastSize:a}}function oq(e,[t,n,r,o]){t.length>0&&r("received item sizes",t,cs.DEBUG);const s=e.sizeTree;let a=s,l=0;if(n.length>0&&cr(s)&&t.length===2){const v=t[0].size,y=t[1].size;a=n.reduce((S,x)=>as(as(S,x,v),x+1,y),a)}else[a,l]=JG(a,t);if(a===s)return e;const{offsetTree:u,lastIndex:f,lastSize:p,lastOffset:m}=Fy(e.offsetTree,l,a,o);return{sizeTree:a,offsetTree:u,lastIndex:f,lastOffset:m,lastSize:p,groupOffsetTree:n.reduce((v,y)=>as(v,y,mf(y,u,o)),fu()),groupIndices:n}}function mf(e,t,n){if(t.length===0)return 0;const{offset:r,index:o,size:s}=tE(t,e,Bb),a=e-o,l=s*a+(a-1)*n+r;return l>0?l+n:l}function sq(e){return typeof e.groupIndex<"u"}function nE(e,t,n){if(sq(e))return t.groupIndices[e.groupIndex]+1;{const r=e.index==="LAST"?n:e.index;let o=rE(r,t);return o=Math.max(0,o,Math.min(n,o)),o}}function rE(e,t){if(!fv(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function fv(e){return!cr(e.groupOffsetTree)}function aq(e){return Ll(e).map(({k:t,v:n},r,o)=>{const s=o[r+1],a=s?s.k-1:1/0;return{startIndex:t,endIndex:a,size:n}})}const iq={offsetHeight:"height",offsetWidth:"width"},Za=Zn(([{log:e},{recalcInProgress:t}])=>{const n=Un(),r=Un(),o=Do(r,0),s=Un(),a=Un(),l=xt(0),u=xt([]),f=xt(void 0),p=xt(void 0),m=xt((j,E)=>al(j,iq[E])),v=xt(void 0),y=xt(0),S=eq(),x=Do(Ve(n,Pn(u,e,y),La(oq,S),kr()),S),w=Do(Ve(u,kr(),La((j,E)=>({prev:j.current,current:E}),{prev:[],current:[]}),_t(({prev:j})=>j)),[]);Ht(Ve(u,dn(j=>j.length>0),Pn(x,y),_t(([j,E,T])=>{const R=j.reduce((M,D,N)=>as(M,D,mf(D,E.offsetTree,T)||N),fu());return{...E,groupIndices:j,groupOffsetTree:R}})),x),Ht(Ve(r,Pn(x),dn(([j,{lastIndex:E}])=>j<E),_t(([j,{lastIndex:E,lastSize:T}])=>[{startIndex:j,endIndex:E,size:T}])),n),Ht(f,p);const _=Do(Ve(f,_t(j=>j===void 0)),!0);Ht(Ve(p,dn(j=>j!==void 0&&cr(Ts(x).sizeTree)),_t(j=>[{startIndex:0,endIndex:0,size:j}])),n);const k=ls(Ve(n,Pn(x),La(({sizes:j},[E,T])=>({changed:T!==j,sizes:T}),{changed:!1,sizes:S}),_t(j=>j.changed)));yr(Ve(l,La((j,E)=>({diff:j.prev-E,prev:E}),{diff:0,prev:0}),_t(j=>j.diff)),j=>{const{groupIndices:E}=Ts(x);if(j>0)ir(t,!0),ir(s,j+O4(j,E));else if(j<0){const T=Ts(w);T.length>0&&(j-=O4(-j,T)),ir(a,j)}}),yr(Ve(l,Pn(e)),([j,E])=>{j<0&&E("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:l},cs.ERROR)});const P=ls(s);Ht(Ve(s,Pn(x),_t(([j,E])=>{const T=E.groupIndices.length>0,R=[],M=E.lastSize;if(T){const D=hf(E.sizeTree,0);let N=0,U=0;for(;N<j;){const H=E.groupIndices[U],G=E.groupIndices.length===U+1?1/0:E.groupIndices[U+1]-H-1;R.push({startIndex:H,endIndex:H,size:D}),R.push({startIndex:H+1,endIndex:H+1+G-1,size:M}),U++,N+=G+1}const z=Ll(E.sizeTree);return N!==j&&z.shift(),z.reduce((H,{k:G,v:A})=>{let L=H.ranges;return H.prevSize!==0&&(L=[...H.ranges,{startIndex:H.prevIndex,endIndex:G+j-1,size:H.prevSize}]),{ranges:L,prevIndex:G+j,prevSize:A}},{ranges:R,prevIndex:j,prevSize:0}).ranges}return Ll(E.sizeTree).reduce((D,{k:N,v:U})=>({ranges:[...D.ranges,{startIndex:D.prevIndex,endIndex:N+j-1,size:D.prevSize}],prevIndex:N+j,prevSize:U}),{ranges:[],prevIndex:0,prevSize:M}).ranges})),n);const I=ls(Ve(a,Pn(x,y),_t(([j,{offsetTree:E},T])=>{const R=-j;return mf(R,E,T)})));return Ht(Ve(a,Pn(x,y),_t(([j,E,T])=>{if(E.groupIndices.length>0){if(cr(E.sizeTree))return E;let M=fu();const D=Ts(w);let N=0,U=0,z=0;for(;N<-j;){z=D[U];const H=D[U+1]-z-1;U++,N+=H+1}if(M=Ll(E.sizeTree).reduce((H,{k:G,v:A})=>as(H,Math.max(0,G+j),A),M),N!==-j){const H=hf(E.sizeTree,z);M=as(M,0,H);const G=Ca(E.sizeTree,-j+1)[1];M=as(M,1,G)}return{...E,sizeTree:M,...Fy(E.offsetTree,0,M,T)}}else{const M=Ll(E.sizeTree).reduce((D,{k:N,v:U})=>as(D,Math.max(0,N+j),U),fu());return{...E,sizeTree:M,...Fy(E.offsetTree,0,M,T)}}})),x),{data:v,totalCount:r,sizeRanges:n,groupIndices:u,defaultItemSize:p,fixedItemSize:f,unshiftWith:s,shiftWith:a,shiftWithOffset:I,beforeUnshiftWith:P,firstItemIndex:l,gap:y,sizes:x,listRefresh:k,statefulTotalCount:o,trackItemSizes:_,itemSize:m}},Ir(gl,Lb),{singleton:!0}),lq=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function oE(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!lq)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const Gf=Zn(([{sizes:e,totalCount:t,listRefresh:n,gap:r},{scrollingInProgress:o,viewportHeight:s,scrollTo:a,smoothScrollTargetReached:l,headerHeight:u,footerHeight:f,fixedHeaderHeight:p,fixedFooterHeight:m},{log:v}])=>{const y=Un(),S=xt(0);let x=null,w=null,_=null;function k(){x&&(x(),x=null),_&&(_(),_=null),w&&(clearTimeout(w),w=null),ir(o,!1)}return Ht(Ve(y,Pn(e,s,t,S,u,f,v),Pn(r,p,m),_t(([[P,I,j,E,T,R,M,D],N,U,z])=>{const F=oE(P),{align:H,behavior:G,offset:A}=F,L=E-1,W=nE(F,I,L);let V=mf(W,I.offsetTree,N)+R;H==="end"?(V+=U+Ca(I.sizeTree,W)[1]-j+z,W===L&&(V+=M)):H==="center"?V+=(U+Ca(I.sizeTree,W)[1]-j+z)/2:V-=T,A&&(V+=A);const ee=le=>{k(),le?(D("retrying to scroll to",{location:P},cs.DEBUG),ir(y,P)):D("list did not change, scroll successful",{},cs.DEBUG)};if(k(),G==="smooth"){let le=!1;_=yr(n,oe=>{le=le||oe}),x=ic(l,()=>{ee(le)})}else x=ic(Ve(n,cq(150)),ee);return w=setTimeout(()=>{k()},1200),ir(o,!0),D("scrolling from index to",{index:W,top:V,behavior:G},cs.DEBUG),{top:V,behavior:G}})),a),{scrollToIndex:y,topListHeight:S}},Ir(Za,Lo,gl),{singleton:!0});function cq(e){return t=>{const n=setTimeout(()=>{t(!1)},e);return r=>{r&&(t(!0),clearTimeout(n))}}}const gf="up",zd="down",uq="none",dq={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},fq=0,qf=Zn(([{scrollContainerState:e,scrollTop:t,viewportHeight:n,headerHeight:r,footerHeight:o,scrollBy:s}])=>{const a=xt(!1),l=xt(!0),u=Un(),f=Un(),p=xt(4),m=xt(fq),v=Do(Ve(I4(Ve(Cn(t),ff(1),Wi(!0)),Ve(Cn(t),ff(1),Wi(!1),j4(100))),kr()),!1),y=Do(Ve(I4(Ve(s,Wi(!0)),Ve(s,Wi(!1),j4(200))),kr()),!1);Ht(Ve(So(Cn(t),Cn(m)),_t(([k,P])=>k<=P),kr()),l),Ht(Ve(l,$l(50)),f);const S=ls(Ve(So(e,Cn(n),Cn(r),Cn(o),Cn(p)),La((k,[{scrollTop:P,scrollHeight:I},j,E,T,R])=>{const M=P+j-I>-R,D={viewportHeight:j,scrollTop:P,scrollHeight:I};if(M){let U,z;return P>k.state.scrollTop?(U="SCROLLED_DOWN",z=k.state.scrollTop-P):(U="SIZE_DECREASED",z=k.state.scrollTop-P||k.scrollTopDelta),{atBottom:!0,state:D,atBottomBecause:U,scrollTopDelta:z}}let N;return D.scrollHeight>k.state.scrollHeight?N="SIZE_INCREASED":j<k.state.viewportHeight?N="VIEWPORT_HEIGHT_DECREASING":P<k.state.scrollTop?N="SCROLLING_UPWARDS":N="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:N,state:D}},dq),kr((k,P)=>k&&k.atBottom===P.atBottom))),x=Do(Ve(e,La((k,{scrollTop:P,scrollHeight:I,viewportHeight:j})=>{if(YI(k.scrollHeight,I))return{scrollTop:P,scrollHeight:I,jump:0,changed:!1};{const E=I-(P+j)<1;return k.scrollTop!==P&&E?{scrollHeight:I,scrollTop:P,jump:k.scrollTop-P,changed:!0}:{scrollHeight:I,scrollTop:P,jump:0,changed:!0}}},{scrollHeight:0,jump:0,scrollTop:0,changed:!1}),dn(k=>k.changed),_t(k=>k.jump)),0);Ht(Ve(S,_t(k=>k.atBottom)),a),Ht(Ve(a,$l(50)),u);const w=xt(zd);Ht(Ve(e,_t(({scrollTop:k})=>k),kr(),La((k,P)=>Ts(y)?{direction:k.direction,prevScrollTop:P}:{direction:P<k.prevScrollTop?gf:zd,prevScrollTop:P},{direction:zd,prevScrollTop:0}),_t(k=>k.direction)),w),Ht(Ve(e,$l(50),Wi(uq)),w);const _=xt(0);return Ht(Ve(v,dn(k=>!k),Wi(0)),_),Ht(Ve(t,$l(100),Pn(v),dn(([k,P])=>!!P),La(([k,P],[I])=>[P,I],[0,0]),_t(([k,P])=>P-k)),_),{isScrolling:v,isAtTop:l,isAtBottom:a,atBottomState:S,atTopStateChange:f,atBottomStateChange:u,scrollDirection:w,atBottomThreshold:p,atTopThreshold:m,scrollVelocity:_,lastJumpDueToItemResize:x}},Ir(Lo)),vl=Zn(([{log:e}])=>{const t=xt(!1),n=ls(Ve(t,dn(r=>r),kr()));return yr(t,r=>{r&&Ts(e)("props updated",{},cs.DEBUG)}),{propsReady:t,didMount:n}},Ir(gl),{singleton:!0});function pq(e,t){const n=t-1;return typeof e=="number"?e:e.index==="LAST"?n:e.index}function sE(e,t){e==0?t():requestAnimationFrame(()=>sE(e-1,t))}const pv=Zn(([{sizes:e,listRefresh:t,defaultItemSize:n},{scrollTop:r},{scrollToIndex:o},{didMount:s}])=>{const a=xt(!0),l=xt(0),u=xt(!1);return Ht(Ve(s,Pn(l),dn(([f,p])=>!!p),Wi(!1)),a),yr(Ve(So(t,s),Pn(a,e,n,u),dn(([[,f],p,{sizeTree:m},v,y])=>f&&(!cr(m)||uv(v))&&!p&&!y),Pn(l)),([,f])=>{ir(u,!0),sE(2,()=>{ic(r,()=>ir(a,!0)),ir(o,f)})}),{scrolledToInitialItem:a,initialTopMostItemIndex:l}},Ir(Za,Lo,Gf,vl),{singleton:!0});function T4(e){return e?e==="smooth"?"smooth":"auto":!1}const hq=(e,t)=>typeof e=="function"?T4(e(t)):t&&T4(e),mq=Zn(([{totalCount:e,listRefresh:t},{isAtBottom:n,atBottomState:r},{scrollToIndex:o},{scrolledToInitialItem:s},{propsReady:a,didMount:l},{log:u},{scrollingInProgress:f}])=>{const p=xt(!1),m=Un();let v=null;function y(x){ir(o,{index:"LAST",align:"end",behavior:x})}yr(Ve(So(Ve(Cn(e),ff(1)),l),Pn(Cn(p),n,s,f),_t(([[x,w],_,k,P,I])=>{let j=w&&P,E="auto";return j&&(E=hq(_,k||I),j=j&&!!E),{totalCount:x,shouldFollow:j,followOutputBehavior:E}}),dn(({shouldFollow:x})=>x)),({totalCount:x,followOutputBehavior:w})=>{v&&(v(),v=null),v=ic(t,()=>{Ts(u)("following output to ",{totalCount:x},cs.DEBUG),y(w),v=null})});function S(x){const w=ic(r,_=>{x&&!_.atBottom&&_.notAtBottomBecause==="SIZE_INCREASED"&&!v&&(Ts(u)("scrolling to bottom due to increased size",{},cs.DEBUG),y("auto"))});setTimeout(w,100)}return yr(Ve(So(Cn(p),e,a),dn(([x,,w])=>x&&w),La(({value:x},[,w])=>({refreshed:x===w,value:w}),{refreshed:!1,value:0}),dn(({refreshed:x})=>x),Pn(p,e)),([,x])=>{S(x!==!1)}),yr(m,()=>{S(Ts(p)!==!1)}),yr(So(Cn(p),r),([x,w])=>{x&&!w.atBottom&&w.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&y("auto")}),{followOutput:p,autoscrollToBottom:m}},Ir(Za,qf,Gf,pv,vl,gl,Lo));function gq(e){return e.reduce((t,n)=>(t.groupIndices.push(t.totalCount),t.totalCount+=n+1,t),{totalCount:0,groupIndices:[]})}const aE=Zn(([{totalCount:e,groupIndices:t,sizes:n},{scrollTop:r,headerHeight:o}])=>{const s=Un(),a=Un(),l=ls(Ve(s,_t(gq)));return Ht(Ve(l,_t(u=>u.totalCount)),e),Ht(Ve(l,_t(u=>u.groupIndices)),t),Ht(Ve(So(r,n,o),dn(([u,f])=>fv(f)),_t(([u,f,p])=>Ca(f.groupOffsetTree,Math.max(u-p,0),"v")[0]),kr(),_t(u=>[u])),a),{groupCounts:s,topItemsIndexes:a}},Ir(Za,Lo));function vf(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}function iE(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}const jm="top",Im="bottom",R4="none";function M4(e,t,n){return typeof e=="number"?n===gf&&t===jm||n===zd&&t===Im?e:0:n===gf?t===jm?e.main:e.reverse:t===Im?e.main:e.reverse}function D4(e,t){return typeof e=="number"?e:e[t]||0}const Fb=Zn(([{scrollTop:e,viewportHeight:t,deviation:n,headerHeight:r,fixedHeaderHeight:o}])=>{const s=Un(),a=xt(0),l=xt(0),u=xt(0),f=Do(Ve(So(Cn(e),Cn(t),Cn(r),Cn(s,vf),Cn(u),Cn(a),Cn(o),Cn(n),Cn(l)),_t(([p,m,v,[y,S],x,w,_,k,P])=>{const I=p-k,j=w+_,E=Math.max(v-I,0);let T=R4;const R=D4(P,jm),M=D4(P,Im);return y-=k,y+=v+_,S+=v+_,S-=k,y>p+j-R&&(T=gf),S<p-E+m+M&&(T=zd),T!==R4?[Math.max(I-v-M4(x,jm,T)-R,0),I-E-_+m+M4(x,Im,T)+M]:null}),dn(p=>p!=null),kr(vf)),[0,0]);return{listBoundary:s,overscan:u,topListHeight:a,increaseViewportBy:l,visibleRange:f}},Ir(Lo),{singleton:!0});function vq(e,t,n){if(fv(t)){const r=rE(e,t);return[{index:Ca(t.groupOffsetTree,r)[0],size:0,offset:0},{index:r,size:0,offset:0,data:n&&n[0]}]}return[{index:e,size:0,offset:0,data:n&&n[0]}]}const A4={items:[],topItems:[],offsetTop:0,offsetBottom:0,top:0,bottom:0,topListHeight:0,totalCount:0,firstItemIndex:0};function N4(e,t,n){if(e.length===0)return[];if(!fv(t))return e.map(f=>({...f,index:f.index+n,originalIndex:f.index}));const r=e[0].index,o=e[e.length-1].index,s=[],a=dv(t.groupOffsetTree,r,o);let l,u=0;for(const f of e){(!l||l.end<f.index)&&(l=a.shift(),u=t.groupIndices.indexOf(l.start));let p;f.index===l.start?p={type:"group",index:u}:p={index:f.index-(u+1)+n,groupIndex:u},s.push({...p,size:f.size,offset:f.offset,originalIndex:f.index,data:f.data})}return s}function $h(e,t,n,r,o,s){const{lastSize:a,lastOffset:l,lastIndex:u}=o;let f=0,p=0;if(e.length>0){f=e[0].offset;const x=e[e.length-1];p=x.offset+x.size}const m=n-u,v=l+m*a+(m-1)*r,y=f,S=v-p;return{items:N4(e,o,s),topItems:N4(t,o,s),topListHeight:t.reduce((x,w)=>w.size+x,0),offsetTop:f,offsetBottom:S,top:y,bottom:p,totalCount:n,firstItemIndex:s}}const vc=Zn(([{sizes:e,totalCount:t,data:n,firstItemIndex:r,gap:o},s,{visibleRange:a,listBoundary:l,topListHeight:u},{scrolledToInitialItem:f,initialTopMostItemIndex:p},{topListHeight:m},v,{didMount:y},{recalcInProgress:S}])=>{const x=xt([]),w=Un();Ht(s.topItemsIndexes,x);const _=Do(Ve(So(y,S,Cn(a,vf),Cn(t),Cn(e),Cn(p),f,Cn(x),Cn(r),Cn(o),n),dn(([j,E,,T,,,,,,,R])=>{const M=R&&R.length!==T;return j&&!E&&!M}),_t(([,,[j,E],T,R,M,D,N,U,z,F])=>{const H=R,{sizeTree:G,offsetTree:A}=H;if(T===0||j===0&&E===0)return{...A4,totalCount:T};if(cr(G))return $h(vq(pq(M,T),H,F),[],T,z,H,U);const L=[];if(N.length>0){const oe=N[0],X=N[N.length-1];let Q=0;for(const ie of dv(G,oe,X)){const ve=ie.value,ye=Math.max(ie.start,oe),se=Math.min(ie.end,X);for(let de=ye;de<=se;de++)L.push({index:de,size:ve,offset:Q,data:F&&F[de]}),Q+=ve}}if(!D)return $h([],L,T,z,H,U);const W=N.length>0?N[N.length-1]+1:0,V=rq(A,j,E,W);if(V.length===0)return null;const ee=T-1,le=cv([],oe=>{for(const X of V){const Q=X.value;let ie=Q.offset,ve=X.start;const ye=Q.size;if(Q.offset<j){ve+=Math.floor((j-Q.offset+z)/(ye+z));const de=ve-X.start;ie+=de*ye+de*z}ve<W&&(ie+=(W-ve)*ye,ve=W);const se=Math.min(X.end,ee);for(let de=ve;de<=se&&!(ie>=E);de++)oe.push({index:de,size:ye,offset:ie,data:F&&F[de]}),ie+=ye+z}});return $h(le,L,T,z,H,U)}),dn(j=>j!==null),kr()),A4);Ht(Ve(n,dn(uv),_t(j=>j==null?void 0:j.length)),t),Ht(Ve(_,_t(j=>j.topListHeight)),m),Ht(m,u),Ht(Ve(_,_t(j=>[j.top,j.bottom])),l),Ht(Ve(_,_t(j=>j.items)),w);const k=ls(Ve(_,dn(({items:j})=>j.length>0),Pn(t,n),dn(([{items:j},E])=>j[j.length-1].originalIndex===E-1),_t(([,j,E])=>[j-1,E]),kr(vf),_t(([j])=>j))),P=ls(Ve(_,$l(200),dn(({items:j,topItems:E})=>j.length>0&&j[0].originalIndex===E.length),_t(({items:j})=>j[0].index),kr())),I=ls(Ve(_,dn(({items:j})=>j.length>0),_t(({items:j})=>{let E=0,T=j.length-1;for(;j[E].type==="group"&&E<T;)E++;for(;j[T].type==="group"&&T>E;)T--;return{startIndex:j[E].index,endIndex:j[T].index}}),kr(iE)));return{listState:_,topItemsIndexes:x,endReached:k,startReached:P,rangeChanged:I,itemsRendered:w,...v}},Ir(Za,aE,Fb,pv,Gf,qf,vl,Lb),{singleton:!0}),yq=Zn(([{sizes:e,firstItemIndex:t,data:n,gap:r},{listState:o},{didMount:s}])=>{const a=xt(0);return Ht(Ve(s,Pn(a),dn(([,l])=>l!==0),Pn(e,t,r,n),_t(([[,l],u,f,p,m=[]])=>{let v=0;if(u.groupIndices.length>0)for(const x of u.groupIndices){if(x-v>=l)break;v++}const y=l+v,S=Array.from({length:y}).map((x,w)=>({index:w,size:0,offset:0,data:m[w]}));return $h(S,[],y,p,u,f)})),o),{initialItemCount:a}},Ir(Za,vc,vl),{singleton:!0}),lE=Zn(([{scrollVelocity:e}])=>{const t=xt(!1),n=Un(),r=xt(!1);return Ht(Ve(e,Pn(r,t,n),dn(([o,s])=>!!s),_t(([o,s,a,l])=>{const{exit:u,enter:f}=s;if(a){if(u(o,l))return!1}else if(f(o,l))return!0;return a}),kr()),t),yr(Ve(So(t,e,n),Pn(r)),([[o,s,a],l])=>o&&l&&l.change&&l.change(s,a)),{isSeeking:t,scrollSeekConfiguration:r,scrollVelocity:e,scrollSeekRangeChanged:n}},Ir(qf),{singleton:!0}),xq=Zn(([{topItemsIndexes:e}])=>{const t=xt(0);return Ht(Ve(t,dn(n=>n>0),_t(n=>Array.from({length:n}).map((r,o)=>o))),e),{topItemCount:t}},Ir(vc)),cE=Zn(([{footerHeight:e,headerHeight:t,fixedHeaderHeight:n,fixedFooterHeight:r},{listState:o}])=>{const s=Un(),a=Do(Ve(So(e,r,t,n,o),_t(([l,u,f,p,m])=>l+u+f+p+m.offsetBottom+m.bottom)),0);return Ht(Cn(a),s),{totalListHeight:a,totalListHeightChanged:s}},Ir(Lo,vc),{singleton:!0});function uE(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}const bq=uE(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),wq=Zn(([{scrollBy:e,scrollTop:t,deviation:n,scrollingInProgress:r},{isScrolling:o,isAtBottom:s,scrollDirection:a,lastJumpDueToItemResize:l},{listState:u},{beforeUnshiftWith:f,shiftWithOffset:p,sizes:m,gap:v},{log:y},{recalcInProgress:S}])=>{const x=ls(Ve(u,Pn(l),La(([,_,k,P],[{items:I,totalCount:j,bottom:E,offsetBottom:T},R])=>{const M=E+T;let D=0;return k===j&&_.length>0&&I.length>0&&(I[0].originalIndex===0&&_[0].originalIndex===0||(D=M-P,D!==0&&(D+=R))),[D,I,j,M]},[0,[],0,0]),dn(([_])=>_!==0),Pn(t,a,r,s,y,S),dn(([,_,k,P,,,I])=>!I&&!P&&_!==0&&k===gf),_t(([[_],,,,,k])=>(k("Upward scrolling compensation",{amount:_},cs.DEBUG),_))));function w(_){_>0?(ir(e,{top:-_,behavior:"auto"}),ir(n,0)):(ir(n,0),ir(e,{top:-_,behavior:"auto"}))}return yr(Ve(x,Pn(n,o)),([_,k,P])=>{P&&bq()?ir(n,k-_):w(-_)}),yr(Ve(So(Do(o,!1),n,S),dn(([_,k,P])=>!_&&!P&&k!==0),_t(([_,k])=>k),$l(1)),w),Ht(Ve(p,_t(_=>({top:-_}))),e),yr(Ve(f,Pn(m,v),_t(([_,{lastSize:k,groupIndices:P,sizeTree:I},j])=>{function E(T){return T*(k+j)}if(P.length===0)return E(_);{let T=0;const R=hf(I,0);let M=0,D=0;for(;M<_;){M++,T+=R;let N=P.length===D+1?1/0:P[D+1]-P[D]-1;M+N>_&&(T-=R,N=_-M+1),M+=N,T+=E(N),D++}return T}})),_=>{ir(n,_),requestAnimationFrame(()=>{ir(e,{top:_}),requestAnimationFrame(()=>{ir(n,0),ir(S,!1)})})}),{deviation:n}},Ir(Lo,qf,vc,Za,gl,Lb)),Sq=Zn(([{didMount:e},{scrollTo:t},{listState:n}])=>{const r=xt(0);return yr(Ve(e,Pn(r),dn(([,o])=>o!==0),_t(([,o])=>({top:o}))),o=>{ic(Ve(n,ff(1),dn(s=>s.items.length>1)),()=>{requestAnimationFrame(()=>{ir(t,o)})})}),{initialScrollTop:r}},Ir(vl,Lo,vc),{singleton:!0}),Cq=Zn(([{viewportHeight:e},{totalListHeight:t}])=>{const n=xt(!1),r=Do(Ve(So(n,e,t),dn(([o])=>o),_t(([,o,s])=>Math.max(0,o-s)),$l(0),kr()),0);return{alignToBottom:n,paddingTopAddition:r}},Ir(Lo,cE),{singleton:!0}),dE=Zn(([{scrollTo:e,scrollContainerState:t}])=>{const n=Un(),r=Un(),o=Un(),s=xt(!1),a=xt(void 0);return Ht(Ve(So(n,r),_t(([{viewportHeight:l,scrollTop:u,scrollHeight:f},{offsetTop:p}])=>({scrollTop:Math.max(0,u-p),scrollHeight:f,viewportHeight:l}))),t),Ht(Ve(e,Pn(r),_t(([l,{offsetTop:u}])=>({...l,top:l.top+u}))),o),{useWindowScroll:s,customScrollParent:a,windowScrollContainerState:n,windowViewportRect:r,windowScrollTo:o}},Ir(Lo)),_q=({itemTop:e,itemBottom:t,viewportTop:n,viewportBottom:r,locationParams:{behavior:o,align:s,...a}})=>e<n?{...a,behavior:o,align:s??"start"}:t>r?{...a,behavior:o,align:s??"end"}:null,kq=Zn(([{sizes:e,totalCount:t,gap:n},{scrollTop:r,viewportHeight:o,headerHeight:s,fixedHeaderHeight:a,fixedFooterHeight:l,scrollingInProgress:u},{scrollToIndex:f}])=>{const p=Un();return Ht(Ve(p,Pn(e,o,t,s,a,l,r),Pn(n),_t(([[m,v,y,S,x,w,_,k],P])=>{const{done:I,behavior:j,align:E,calculateViewLocation:T=_q,...R}=m,M=nE(m,v,S-1),D=mf(M,v.offsetTree,P)+x+w,N=D+Ca(v.sizeTree,M)[1],U=k+w,z=k+y-_,F=T({itemTop:D,itemBottom:N,viewportTop:U,viewportBottom:z,locationParams:{behavior:j,align:E,...R}});return F?I&&ic(Ve(u,dn(H=>H===!1),ff(Ts(u)?1:2)),I):I&&I(),F}),dn(m=>m!==null)),f),{scrollIntoView:p}},Ir(Za,Lo,Gf,vc,gl),{singleton:!0}),Pq=Zn(([{sizes:e,sizeRanges:t},{scrollTop:n},{initialTopMostItemIndex:r},{didMount:o}])=>{const s=Un(),a=xt(void 0);return yr(Ve(s,Pn(e,n)),([l,u,f])=>{const p=aq(u.sizeTree);l({ranges:p,scrollTop:f})}),Ht(Ve(a,dn(uv),_t(jq)),r),Ht(Ve(o,Pn(a),dn(([,l])=>l!==void 0),kr(),_t(([,l])=>l.ranges)),t),{getState:s,restoreStateFrom:a}},Ir(Za,Lo,pv,vl));function jq(e){return{offset:e.scrollTop,index:0,align:"start"}}const Iq=Zn(([e,t,n,r,o,s,a,l,u,f])=>({...e,...t,...n,...r,...o,...s,...a,...l,...u,...f}),Ir(Fb,yq,vl,lE,cE,Sq,Cq,dE,kq,gl)),Eq=Zn(([{totalCount:e,sizeRanges:t,fixedItemSize:n,defaultItemSize:r,trackItemSizes:o,itemSize:s,data:a,firstItemIndex:l,groupIndices:u,statefulTotalCount:f,gap:p,sizes:m},{initialTopMostItemIndex:v,scrolledToInitialItem:y},S,x,w,{listState:_,topItemsIndexes:k,...P},{scrollToIndex:I},j,{topItemCount:E},{groupCounts:T},R])=>(Ht(P.rangeChanged,R.scrollSeekRangeChanged),Ht(Ve(R.windowViewportRect,_t(M=>M.visibleHeight)),S.viewportHeight),{totalCount:e,data:a,firstItemIndex:l,sizeRanges:t,initialTopMostItemIndex:v,scrolledToInitialItem:y,topItemsIndexes:k,topItemCount:E,groupCounts:T,fixedItemHeight:n,defaultItemHeight:r,gap:p,...w,statefulTotalCount:f,listState:_,scrollToIndex:I,trackItemSizes:o,itemSize:s,groupIndices:u,...P,...R,...S,sizes:m,...x}),Ir(Za,pv,Lo,Pq,mq,vc,Gf,wq,xq,aE,Iq)),b1="-webkit-sticky",z4="sticky",fE=uE(()=>{if(typeof document>"u")return z4;const e=document.createElement("div");return e.style.position=b1,e.style.position===b1?b1:z4});function pE(e,t){const n=B.useRef(null),r=B.useCallback(l=>{if(l===null||!l.offsetParent)return;const u=l.getBoundingClientRect(),f=u.width;let p,m;if(t){const v=t.getBoundingClientRect(),y=u.top-v.top;p=v.height-Math.max(0,y),m=y+t.scrollTop}else p=window.innerHeight-Math.max(0,u.top),m=u.top+window.pageYOffset;n.current={offsetTop:m,visibleHeight:p,visibleWidth:f},e(n.current)},[e,t]),{callbackRef:o,ref:s}=$b(r),a=B.useCallback(()=>{r(s.current)},[r,s]);return B.useEffect(()=>{if(t){t.addEventListener("scroll",a);const l=new ResizeObserver(a);return l.observe(t),()=>{t.removeEventListener("scroll",a),l.unobserve(t)}}else return window.addEventListener("scroll",a),window.addEventListener("resize",a),()=>{window.removeEventListener("scroll",a),window.removeEventListener("resize",a)}},[a,t]),o}const hE=B.createContext(void 0),mE=B.createContext(void 0);function gE(e){return e}const Oq=Zn(()=>{const e=xt(u=>`Item ${u}`),t=xt(null),n=xt(u=>`Group ${u}`),r=xt({}),o=xt(gE),s=xt("div"),a=xt(Gu),l=(u,f=null)=>Do(Ve(r,_t(p=>p[u]),kr()),f);return{context:t,itemContent:e,groupContent:n,components:r,computeItemKey:o,headerFooterTag:s,scrollerRef:a,FooterComponent:l("Footer"),HeaderComponent:l("Header"),TopItemListComponent:l("TopItemList"),ListComponent:l("List","div"),ItemComponent:l("Item","div"),GroupComponent:l("Group","div"),ScrollerComponent:l("Scroller","div"),EmptyPlaceholder:l("EmptyPlaceholder"),ScrollSeekPlaceholder:l("ScrollSeekPlaceholder")}}),Tq=Zn(([e,t])=>({...e,...t}),Ir(Eq,Oq)),Rq=({height:e})=>B.createElement("div",{style:{height:e}}),Mq={position:fE(),zIndex:1,overflowAnchor:"none"},Dq={overflowAnchor:"none"},$4=B.memo(function({showTopList:t=!1}){const n=En("listState"),r=Rs("sizeRanges"),o=En("useWindowScroll"),s=En("customScrollParent"),a=Rs("windowScrollContainerState"),l=Rs("scrollContainerState"),u=s||o?a:l,f=En("itemContent"),p=En("context"),m=En("groupContent"),v=En("trackItemSizes"),y=En("itemSize"),S=En("log"),x=Rs("gap"),{callbackRef:w}=qG(r,y,v,t?Gu:u,S,x,s),[_,k]=B.useState(0);Hb("deviation",F=>{_!==F&&k(F)});const P=En("EmptyPlaceholder"),I=En("ScrollSeekPlaceholder")||Rq,j=En("ListComponent"),E=En("ItemComponent"),T=En("GroupComponent"),R=En("computeItemKey"),M=En("isSeeking"),D=En("groupIndices").length>0,N=En("paddingTopAddition"),U=En("scrolledToInitialItem"),z=t?{}:{boxSizing:"border-box",paddingTop:n.offsetTop+N,paddingBottom:n.offsetBottom,marginTop:_,...U?{}:{visibility:"hidden"}};return!t&&n.totalCount===0&&P?B.createElement(P,Uo(P,p)):B.createElement(j,{...Uo(j,p),ref:w,style:z,"data-test-id":t?"virtuoso-top-item-list":"virtuoso-item-list"},(t?n.topItems:n.items).map(F=>{const H=F.originalIndex,G=R(H+n.firstItemIndex,F.data,p);return M?B.createElement(I,{...Uo(I,p),key:G,index:F.index,height:F.size,type:F.type||"item",...F.type==="group"?{}:{groupIndex:F.groupIndex}}):F.type==="group"?B.createElement(T,{...Uo(T,p),key:G,"data-index":H,"data-known-size":F.size,"data-item-index":F.index,style:Mq},m(F.index,p)):B.createElement(E,{...Uo(E,p),key:G,"data-index":H,"data-known-size":F.size,"data-item-index":F.index,"data-item-group-index":F.groupIndex,item:F.data,style:Dq},D?f(F.index,F.groupIndex,F.data,p):f(F.index,F.data,p))}))}),Aq={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},hv={width:"100%",height:"100%",position:"absolute",top:0},Nq={width:"100%",position:fE(),top:0,zIndex:1};function Uo(e,t){if(typeof e!="string")return{context:t}}const zq=B.memo(function(){const t=En("HeaderComponent"),n=Rs("headerHeight"),r=En("headerFooterTag"),o=gc(a=>n(al(a,"height"))),s=En("context");return t?B.createElement(r,{ref:o},B.createElement(t,Uo(t,s))):null}),$q=B.memo(function(){const t=En("FooterComponent"),n=Rs("footerHeight"),r=En("headerFooterTag"),o=gc(a=>n(al(a,"height"))),s=En("context");return t?B.createElement(r,{ref:o},B.createElement(t,Uo(t,s))):null});function vE({usePublisher:e,useEmitter:t,useEmitterValue:n}){return B.memo(function({style:s,children:a,...l}){const u=e("scrollContainerState"),f=n("ScrollerComponent"),p=e("smoothScrollTargetReached"),m=n("scrollerRef"),v=n("context"),{scrollerRef:y,scrollByCallback:S,scrollToCallback:x}=KI(u,p,f,m);return t("scrollTo",x),t("scrollBy",S),B.createElement(f,{ref:y,style:{...Aq,...s},"data-test-id":"virtuoso-scroller","data-virtuoso-scroller":!0,tabIndex:0,...l,...Uo(f,v)},a)})}function yE({usePublisher:e,useEmitter:t,useEmitterValue:n}){return B.memo(function({style:s,children:a,...l}){const u=e("windowScrollContainerState"),f=n("ScrollerComponent"),p=e("smoothScrollTargetReached"),m=n("totalListHeight"),v=n("deviation"),y=n("customScrollParent"),S=n("context"),{scrollerRef:x,scrollByCallback:w,scrollToCallback:_}=KI(u,p,f,Gu,y);return WG(()=>(x.current=y||window,()=>{x.current=null}),[x,y]),t("windowScrollTo",_),t("scrollBy",w),B.createElement(f,{style:{position:"relative",...s,...m!==0?{height:m+v}:{}},"data-virtuoso-scroller":!0,...l,...Uo(f,S)},a)})}const Lq=({children:e})=>{const t=B.useContext(hE),n=Rs("viewportHeight"),r=Rs("fixedItemHeight"),o=gc(WI(n,s=>al(s,"height")));return B.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),B.createElement("div",{style:hv,ref:o,"data-viewport-type":"element"},e)},Bq=({children:e})=>{const t=B.useContext(hE),n=Rs("windowViewportRect"),r=Rs("fixedItemHeight"),o=En("customScrollParent"),s=pE(n,o);return B.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),B.createElement("div",{ref:s,style:hv,"data-viewport-type":"window"},e)},Fq=({children:e})=>{const t=En("TopItemListComponent"),n=En("headerHeight"),r={...Nq,marginTop:`${n}px`},o=En("context");return B.createElement(t||"div",{style:r,context:o},e)},Hq=B.memo(function(t){const n=En("useWindowScroll"),r=En("topItemsIndexes").length>0,o=En("customScrollParent"),s=o||n?Uq:Wq,a=o||n?Bq:Lq;return B.createElement(s,{...t},r&&B.createElement(Fq,null,B.createElement($4,{showTopList:!0})),B.createElement(a,null,B.createElement(zq,null),B.createElement($4,null),B.createElement($q,null)))}),{Component:Vq,usePublisher:Rs,useEmitterValue:En,useEmitter:Hb}=qI(Tq,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},Hq),Wq=vE({usePublisher:Rs,useEmitterValue:En,useEmitter:Hb}),Uq=yE({usePublisher:Rs,useEmitterValue:En,useEmitter:Hb}),Gq=Vq,L4={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},qq={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},{round:B4,ceil:F4,floor:Em,min:w1,max:$d}=Math;function Yq(e){return{...qq,items:e}}function S1(e,t,n){return Array.from({length:t-e+1}).map((r,o)=>({index:o+e,data:n==null?void 0:n[o+e]}))}function Kq(e,t){return e&&e.column===t.column&&e.row===t.row}function H4(e,t){return e&&e.width===t.width&&e.height===t.height}const Xq=Zn(([{overscan:e,visibleRange:t,listBoundary:n},{scrollTop:r,viewportHeight:o,scrollBy:s,scrollTo:a,smoothScrollTargetReached:l,scrollContainerState:u,footerHeight:f,headerHeight:p},m,v,{propsReady:y,didMount:S},{windowViewportRect:x,windowScrollTo:w,useWindowScroll:_,customScrollParent:k,windowScrollContainerState:P},I])=>{const j=xt(0),E=xt(0),T=xt(L4),R=xt({height:0,width:0}),M=xt({height:0,width:0}),D=Un(),N=Un(),U=xt(0),z=xt(void 0),F=xt({row:0,column:0});Ht(Ve(S,Pn(E,z),dn(([V,ee])=>V&&ee!==0),_t(([,V,ee])=>({items:S1(0,V-1,ee),top:0,bottom:0,offsetBottom:0,offsetTop:0,itemHeight:0,itemWidth:0}))),T),Ht(Ve(So(Cn(j),t,Cn(F,Kq),Cn(M,H4),Cn(R,H4),z),_t(([V,[ee,le],oe,X,Q,ie])=>{const{row:ve,column:ye}=oe,{height:se,width:de}=X,{width:fe}=Q;if(V===0||fe===0)return L4;if(de===0)return Yq(S1(0,0,ie));const xe=xE(fe,de,ye);let ke=xe*Em((ee+ve)/(se+ve)),ae=xe*F4((le+ve)/(se+ve))-1;ae=w1(V-1,$d(ae,xe-1)),ke=w1(ae,$d(0,ke));const Pe=S1(ke,ae,ie),{top:tt,bottom:ze}=V4(Q,oe,X,Pe),We=F4(V/xe),pt=We*se+(We-1)*ve-ze;return{items:Pe,offsetTop:tt,offsetBottom:pt,top:tt,bottom:ze,itemHeight:se,itemWidth:de}})),T),Ht(Ve(z,dn(uv),_t(V=>V.length)),j),Ht(Ve(R,_t(({height:V})=>V)),o),Ht(Ve(So(R,M,T,F),_t(([V,ee,{items:le},oe])=>{const{top:X,bottom:Q}=V4(V,oe,ee,le);return[X,Q]}),kr(vf)),n);const H=xt(!1);Ht(Ve(r,Pn(H),_t(([V,ee])=>ee||V!==0)),H);const G=ls(Ve(Cn(T),dn(({items:V})=>V.length>0),Pn(j,H),dn(([{items:V},ee,le])=>le&&V[V.length-1].index===ee-1),_t(([,V])=>V-1),kr())),A=ls(Ve(Cn(T),dn(({items:V})=>V.length>0&&V[0].index===0),Wi(0),kr())),L=ls(Ve(Cn(T),dn(({items:V})=>V.length>0),_t(({items:V})=>({startIndex:V[0].index,endIndex:V[V.length-1].index})),kr(iE)));Ht(L,v.scrollSeekRangeChanged),Ht(Ve(D,Pn(R,M,j,F),_t(([V,ee,le,oe,X])=>{const Q=oE(V),{align:ie,behavior:ve,offset:ye}=Q;let se=Q.index;se==="LAST"&&(se=oe-1),se=$d(0,se,w1(oe-1,se));let de=Hy(ee,X,le,se);return ie==="end"?de=B4(de-ee.height+le.height):ie==="center"&&(de=B4(de-ee.height/2+le.height/2)),ye&&(de+=ye),{top:de,behavior:ve}})),a);const W=Do(Ve(T,_t(V=>V.offsetBottom+V.bottom)),0);return Ht(Ve(x,_t(V=>({width:V.visibleWidth,height:V.visibleHeight}))),R),{data:z,totalCount:j,viewportDimensions:R,itemDimensions:M,scrollTop:r,scrollHeight:N,overscan:e,scrollBy:s,scrollTo:a,scrollToIndex:D,smoothScrollTargetReached:l,windowViewportRect:x,windowScrollTo:w,useWindowScroll:_,customScrollParent:k,windowScrollContainerState:P,deviation:U,scrollContainerState:u,footerHeight:f,headerHeight:p,initialItemCount:E,gap:F,...v,gridState:T,totalListHeight:W,...m,startReached:A,endReached:G,rangeChanged:L,propsReady:y,...I}},Ir(Fb,Lo,qf,lE,vl,dE,gl));function V4(e,t,n,r){const{height:o}=n;if(o===void 0||r.length===0)return{top:0,bottom:0};const s=Hy(e,t,n,r[0].index),a=Hy(e,t,n,r[r.length-1].index)+o;return{top:s,bottom:a}}function Hy(e,t,n,r){const o=xE(e.width,n.width,t.column),s=Em(r/o),a=s*n.height+$d(0,s-1)*t.row;return a>0?a+t.row:a}function xE(e,t,n){return $d(1,Em((e+n)/(Em(t)+n)))}const Zq=Zn(()=>{const e=xt(f=>`Item ${f}`),t=xt({}),n=xt(null),r=xt("virtuoso-grid-item"),o=xt("virtuoso-grid-list"),s=xt(gE),a=xt("div"),l=xt(Gu),u=(f,p=null)=>Do(Ve(t,_t(m=>m[f]),kr()),p);return{context:n,itemContent:e,components:t,computeItemKey:s,itemClassName:r,listClassName:o,headerFooterTag:a,scrollerRef:l,FooterComponent:u("Footer"),HeaderComponent:u("Header"),ListComponent:u("List","div"),ItemComponent:u("Item","div"),ScrollerComponent:u("Scroller","div"),ScrollSeekPlaceholder:u("ScrollSeekPlaceholder","div")}}),Qq=Zn(([e,t])=>({...e,...t}),Ir(Xq,Zq)),Jq=B.memo(function(){const t=$r("gridState"),n=$r("listClassName"),r=$r("itemClassName"),o=$r("itemContent"),s=$r("computeItemKey"),a=$r("isSeeking"),l=da("scrollHeight"),u=$r("ItemComponent"),f=$r("ListComponent"),p=$r("ScrollSeekPlaceholder"),m=$r("context"),v=da("itemDimensions"),y=da("gap"),S=$r("log"),x=gc(w=>{const _=w.parentElement.parentElement.scrollHeight;l(_);const k=w.firstChild;k&&v(k.getBoundingClientRect()),y({row:W4("row-gap",getComputedStyle(w).rowGap,S),column:W4("column-gap",getComputedStyle(w).columnGap,S)})});return B.createElement(f,{ref:x,className:n,...Uo(f,m),style:{paddingTop:t.offsetTop,paddingBottom:t.offsetBottom},"data-test-id":"virtuoso-item-list"},t.items.map(w=>{const _=s(w.index,w.data,m);return a?B.createElement(p,{key:_,...Uo(p,m),index:w.index,height:t.itemHeight,width:t.itemWidth}):B.createElement(u,{...Uo(u,m),className:r,"data-index":w.index,key:_},o(w.index,w.data,m))}))}),eY=B.memo(function(){const t=$r("HeaderComponent"),n=da("headerHeight"),r=$r("headerFooterTag"),o=gc(a=>n(al(a,"height"))),s=$r("context");return t?B.createElement(r,{ref:o},B.createElement(t,Uo(t,s))):null}),tY=B.memo(function(){const t=$r("FooterComponent"),n=da("footerHeight"),r=$r("headerFooterTag"),o=gc(a=>n(al(a,"height"))),s=$r("context");return t?B.createElement(r,{ref:o},B.createElement(t,Uo(t,s))):null}),nY=({children:e})=>{const t=B.useContext(mE),n=da("itemDimensions"),r=da("viewportDimensions"),o=gc(s=>{r(s.getBoundingClientRect())});return B.useEffect(()=>{t&&(r({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,r,n]),B.createElement("div",{style:hv,ref:o},e)},rY=({children:e})=>{const t=B.useContext(mE),n=da("windowViewportRect"),r=da("itemDimensions"),o=$r("customScrollParent"),s=pE(n,o);return B.useEffect(()=>{t&&(r({height:t.itemHeight,width:t.itemWidth}),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,r]),B.createElement("div",{ref:s,style:hv},e)},oY=B.memo(function({...t}){const n=$r("useWindowScroll"),r=$r("customScrollParent"),o=r||n?iY:aY,s=r||n?rY:nY;return B.createElement(o,{...t},B.createElement(s,null,B.createElement(eY,null),B.createElement(Jq,null),B.createElement(tY,null)))}),{Component:sY,usePublisher:da,useEmitterValue:$r,useEmitter:bE}=qI(Qq,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange"}},oY),aY=vE({usePublisher:da,useEmitterValue:$r,useEmitter:bE}),iY=yE({usePublisher:da,useEmitterValue:$r,useEmitter:bE});function W4(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,cs.WARN),t==="normal"?0:parseInt(t??"0",10)}const lY=sY,mv=e=>{const{spinnerProps:t,...n}=e,{sx:r,...o}=n,{colorMode:s}=fo();return i.jsx(K,{sx:{bg:Ae("base.200","base.900")(s),opacity:.7,w:"full",h:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",...r},...o,children:i.jsx(Du,{size:"xl",...t})})},wE=e=>{const{sx:t,...n}=e.flexProps??{sx:{}},{sx:r,...o}=e.iconProps??{sx:{}},{colorMode:s}=fo();return i.jsx(K,{sx:{bg:Ae("base.200","base.900")(s),opacity:.7,w:"full",h:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",...t},...n,children:i.jsx(uo,{as:e.as??Vf,sx:{color:Ae("base.700","base.500")(s),...r},...o})})},cY=l5.injectEndpoints({endpoints:e=>({getImageDTO:e.query({query:t=>({url:`images/${t}/metadata`}),providesTags:(t,n,r)=>{const o=[{type:"Image",id:r}];return t!=null&&t.board_id&&o.push({type:"Board",id:t.board_id}),o},keepUnusedDataFor:86400})})}),{useGetImageDTOQuery:lc}=cY;var SE={exports:{}},CE={};const ns=wx(xM),hd=wx(bM),uY=wx(wM);(function(e){var t,n,r=Tc&&Tc.__generator||function(Z,te){var me,we,_e,ot,kt={label:0,sent:function(){if(1&_e[0])throw _e[1];return _e[1]},trys:[],ops:[]};return ot={next:Xt(0),throw:Xt(1),return:Xt(2)},typeof Symbol=="function"&&(ot[Symbol.iterator]=function(){return this}),ot;function Xt(bt){return function(Ze){return function(rt){if(me)throw new TypeError("Generator is already executing.");for(;kt;)try{if(me=1,we&&(_e=2&rt[0]?we.return:rt[0]?we.throw||((_e=we.return)&&_e.call(we),0):we.next)&&!(_e=_e.call(we,rt[1])).done)return _e;switch(we=0,_e&&(rt=[2&rt[0],_e.value]),rt[0]){case 0:case 1:_e=rt;break;case 4:return kt.label++,{value:rt[1],done:!1};case 5:kt.label++,we=rt[1],rt=[0];continue;case 7:rt=kt.ops.pop(),kt.trys.pop();continue;default:if(!((_e=(_e=kt.trys).length>0&&_e[_e.length-1])||rt[0]!==6&&rt[0]!==2)){kt=0;continue}if(rt[0]===3&&(!_e||rt[1]>_e[0]&&rt[1]<_e[3])){kt.label=rt[1];break}if(rt[0]===6&&kt.label<_e[1]){kt.label=_e[1],_e=rt;break}if(_e&&kt.label<_e[2]){kt.label=_e[2],kt.ops.push(rt);break}_e[2]&&kt.ops.pop(),kt.trys.pop();continue}rt=te.call(Z,kt)}catch(je){rt=[6,je],we=0}finally{me=_e=0}if(5&rt[0])throw rt[1];return{value:rt[0]?rt[1]:void 0,done:!0}}([bt,Ze])}}},o=Tc&&Tc.__spreadArray||function(Z,te){for(var me=0,we=te.length,_e=Z.length;me<we;me++,_e++)Z[_e]=te[me];return Z},s=Object.create,a=Object.defineProperty,l=Object.defineProperties,u=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyDescriptors,p=Object.getOwnPropertyNames,m=Object.getOwnPropertySymbols,v=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable,x=function(Z,te,me){return te in Z?a(Z,te,{enumerable:!0,configurable:!0,writable:!0,value:me}):Z[te]=me},w=function(Z,te){for(var me in te||(te={}))y.call(te,me)&&x(Z,me,te[me]);if(m)for(var we=0,_e=m(te);we<_e.length;we++)S.call(te,me=_e[we])&&x(Z,me,te[me]);return Z},_=function(Z,te){return l(Z,f(te))},k=function(Z){return a(Z,"__esModule",{value:!0})},P=function(Z,te){var me={};for(var we in Z)y.call(Z,we)&&te.indexOf(we)<0&&(me[we]=Z[we]);if(Z!=null&&m)for(var _e=0,ot=m(Z);_e<ot.length;_e++)te.indexOf(we=ot[_e])<0&&S.call(Z,we)&&(me[we]=Z[we]);return me},I=function(Z){return function(te,me,we){if(me&&typeof me=="object"||typeof me=="function")for(var _e=function(Xt){y.call(te,Xt)||Xt==="default"||a(te,Xt,{get:function(){return me[Xt]},enumerable:!(we=u(me,Xt))||we.enumerable})},ot=0,kt=p(me);ot<kt.length;ot++)_e(kt[ot]);return te}(k(a(Z!=null?s(v(Z)):{},"default",Z&&Z.__esModule&&"default"in Z?{get:function(){return Z.default},enumerable:!0}:{value:Z,enumerable:!0})),Z)},j=function(Z,te,me){return new Promise(function(we,_e){var ot=function(bt){try{Xt(me.next(bt))}catch(Ze){_e(Ze)}},kt=function(bt){try{Xt(me.throw(bt))}catch(Ze){_e(Ze)}},Xt=function(bt){return bt.done?we(bt.value):Promise.resolve(bt.value).then(ot,kt)};Xt((me=me.apply(Z,te)).next())})};k(e),function(Z,te){for(var me in te)a(Z,me,{get:te[me],enumerable:!0})}(e,{QueryStatus:function(){return t},buildCreateApi:function(){return ht},copyWithStructuralSharing:function(){return R},coreModule:function(){return Ii},createApi:function(){return Gs},defaultSerializeQueryArgs:function(){return On},fakeBaseQuery:function(){return vt},fetchBaseQuery:function(){return F},retry:function(){return L},setupListeners:function(){return Q},skipSelector:function(){return ge},skipToken:function(){return Ke}}),(n=t||(t={})).uninitialized="uninitialized",n.pending="pending",n.fulfilled="fulfilled",n.rejected="rejected";var E=function(Z){return[].concat.apply([],Z)},T=I(ns).isPlainObject;function R(Z,te){if(Z===te||!(T(Z)&&T(te)||Array.isArray(Z)&&Array.isArray(te)))return te;for(var me=Object.keys(te),we=Object.keys(Z),_e=me.length===we.length,ot=Array.isArray(te)?[]:{},kt=0,Xt=me;kt<Xt.length;kt++){var bt=Xt[kt];ot[bt]=R(Z[bt],te[bt]),_e&&(_e=Z[bt]===ot[bt])}return _e?Z:ot}var M=I(ns),D=function(){for(var Z=[],te=0;te<arguments.length;te++)Z[te]=arguments[te];return fetch.apply(void 0,Z)},N=function(Z){return Z.status>=200&&Z.status<=299},U=function(Z){return/ion\/(vnd\.api\+)?json/.test(Z.get("content-type")||"")};function z(Z){if(!(0,M.isPlainObject)(Z))return Z;for(var te=w({},Z),me=0,we=Object.entries(te);me<we.length;me++){var _e=we[me];_e[1]===void 0&&delete te[_e[0]]}return te}function F(Z){var te=this;Z===void 0&&(Z={});var me=Z.baseUrl,we=Z.prepareHeaders,_e=we===void 0?function(Jt){return Jt}:we,ot=Z.fetchFn,kt=ot===void 0?D:ot,Xt=Z.paramsSerializer,bt=Z.isJsonContentType,Ze=bt===void 0?U:bt,rt=Z.jsonContentType,je=rt===void 0?"application/json":rt,Qe=Z.jsonReplacer,Mt=Z.timeout,At=Z.responseHandler,Ft=Z.validateStatus,Qt=P(Z,["baseUrl","prepareHeaders","fetchFn","paramsSerializer","isJsonContentType","jsonContentType","jsonReplacer","timeout","responseHandler","validateStatus"]);return typeof fetch>"u"&&kt===D&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),function(Jt,De){return j(te,null,function(){var Pt,Vt,Wt,Zt,Rn,on,hn,Gn,Kr,xr,Dt,Vn,Xn,br,Ar,tr,nr,wn,$n,Wn,Mn,Dn,Je,Nt,Et,dt,jt,qt,St,it,Ne,Ee,Le,Ue,st,$t;return r(this,function(zt){switch(zt.label){case 0:return Pt=De.signal,Vt=De.getState,Wt=De.extra,Zt=De.endpoint,Rn=De.forced,on=De.type,Kr=(Gn=typeof Jt=="string"?{url:Jt}:Jt).url,Dt=(xr=Gn.headers)===void 0?new Headers(Qt.headers):xr,Xn=(Vn=Gn.params)===void 0?void 0:Vn,Ar=(br=Gn.responseHandler)===void 0?At??"json":br,nr=(tr=Gn.validateStatus)===void 0?Ft??N:tr,$n=(wn=Gn.timeout)===void 0?Mt:wn,Wn=P(Gn,["url","headers","params","responseHandler","validateStatus","timeout"]),Mn=w(_(w({},Qt),{signal:Pt}),Wn),Dt=new Headers(z(Dt)),Dn=Mn,[4,_e(Dt,{getState:Vt,extra:Wt,endpoint:Zt,forced:Rn,type:on})];case 1:Dn.headers=zt.sent()||Dt,Je=function(Ge){return typeof Ge=="object"&&((0,M.isPlainObject)(Ge)||Array.isArray(Ge)||typeof Ge.toJSON=="function")},!Mn.headers.has("content-type")&&Je(Mn.body)&&Mn.headers.set("content-type",je),Je(Mn.body)&&Ze(Mn.headers)&&(Mn.body=JSON.stringify(Mn.body,Qe)),Xn&&(Nt=~Kr.indexOf("?")?"&":"?",Et=Xt?Xt(Xn):new URLSearchParams(z(Xn)),Kr+=Nt+Et),Kr=function(Ge,an){if(!Ge)return an;if(!an)return Ge;if(function(kn){return new RegExp("(^|:)//").test(kn)}(an))return an;var An=Ge.endsWith("/")||!an.startsWith("?")?"/":"";return Ge=function(kn){return kn.replace(/\/$/,"")}(Ge),""+Ge+An+function(kn){return kn.replace(/^\//,"")}(an)}(me,Kr),dt=new Request(Kr,Mn),jt=dt.clone(),hn={request:jt},St=!1,it=$n&&setTimeout(function(){St=!0,De.abort()},$n),zt.label=2;case 2:return zt.trys.push([2,4,5,6]),[4,kt(dt)];case 3:return qt=zt.sent(),[3,6];case 4:return Ne=zt.sent(),[2,{error:{status:St?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(Ne)},meta:hn}];case 5:return it&&clearTimeout(it),[7];case 6:Ee=qt.clone(),hn.response=Ee,Ue="",zt.label=7;case 7:return zt.trys.push([7,9,,10]),[4,Promise.all([sn(qt,Ar).then(function(Ge){return Le=Ge},function(Ge){return st=Ge}),Ee.text().then(function(Ge){return Ue=Ge},function(){})])];case 8:if(zt.sent(),st)throw st;return[3,10];case 9:return $t=zt.sent(),[2,{error:{status:"PARSING_ERROR",originalStatus:qt.status,data:Ue,error:String($t)},meta:hn}];case 10:return[2,nr(qt,Le)?{data:Le,meta:hn}:{error:{status:qt.status,data:Le},meta:hn}]}})})};function sn(Jt,De){return j(this,null,function(){var Pt;return r(this,function(Vt){switch(Vt.label){case 0:return typeof De=="function"?[2,De(Jt)]:(De==="content-type"&&(De=Ze(Jt.headers)?"json":"text"),De!=="json"?[3,2]:[4,Jt.text()]);case 1:return[2,(Pt=Vt.sent()).length?JSON.parse(Pt):null];case 2:return[2,Jt.text()]}})})}}var H=function(Z,te){te===void 0&&(te=void 0),this.value=Z,this.meta=te};function G(Z,te){return Z===void 0&&(Z=0),te===void 0&&(te=5),j(this,null,function(){var me,we;return r(this,function(_e){switch(_e.label){case 0:return me=Math.min(Z,te),we=~~((Math.random()+.4)*(300<<me)),[4,new Promise(function(ot){return setTimeout(function(kt){return ot(kt)},we)})];case 1:return _e.sent(),[2]}})})}var A={},L=Object.assign(function(Z,te){return function(me,we,_e){return j(void 0,null,function(){var ot,kt,Xt,bt,Ze,rt,je;return r(this,function(Qe){switch(Qe.label){case 0:ot=[5,(te||A).maxRetries,(_e||A).maxRetries].filter(function(Mt){return Mt!==void 0}),kt=ot.slice(-1)[0],Xt=function(Mt,At,Ft){return Ft.attempt<=kt},bt=w(w({maxRetries:kt,backoff:G,retryCondition:Xt},te),_e),Ze=0,Qe.label=1;case 1:Qe.label=2;case 2:return Qe.trys.push([2,4,,6]),[4,Z(me,we,_e)];case 3:if((rt=Qe.sent()).error)throw new H(rt);return[2,rt];case 4:if(je=Qe.sent(),Ze++,je.throwImmediately){if(je instanceof H)return[2,je.value];throw je}return je instanceof H&&!bt.retryCondition(je.value.error,me,{attempt:Ze,baseQueryApi:we,extraOptions:_e})?[2,je.value]:[4,bt.backoff(Ze,bt.maxRetries)];case 5:return Qe.sent(),[3,6];case 6:return[3,1];case 7:return[2]}})})}},{fail:function(Z){throw Object.assign(new H({error:Z}),{throwImmediately:!0})}}),W=I(ns),V=(0,W.createAction)("__rtkq/focused"),ee=(0,W.createAction)("__rtkq/unfocused"),le=(0,W.createAction)("__rtkq/online"),oe=(0,W.createAction)("__rtkq/offline"),X=!1;function Q(Z,te){return te?te(Z,{onFocus:V,onFocusLost:ee,onOffline:oe,onOnline:le}):(me=function(){return Z(V())},we=function(){return Z(le())},_e=function(){return Z(oe())},ot=function(){window.document.visibilityState==="visible"?me():Z(ee())},X||typeof window<"u"&&window.addEventListener&&(window.addEventListener("visibilitychange",ot,!1),window.addEventListener("focus",me,!1),window.addEventListener("online",we,!1),window.addEventListener("offline",_e,!1),X=!0),function(){window.removeEventListener("focus",me),window.removeEventListener("visibilitychange",ot),window.removeEventListener("online",we),window.removeEventListener("offline",_e),X=!1});var me,we,_e,ot}var ie,ve,ye=I(ns);function se(Z){return Z.type===ie.query}function de(Z,te,me,we,_e,ot){return typeof Z=="function"?Z(te,me,we,_e).map(fe).map(ot):Array.isArray(Z)?Z.map(fe).map(ot):[]}function fe(Z){return typeof Z=="string"?{type:Z}:Z}(ve=ie||(ie={})).query="query",ve.mutation="mutation";var xe=I(ns);function ke(Z){return Z!=null}var ae=Symbol("forceQueryFn"),Pe=function(Z){return typeof Z[ae]=="function"},tt=I(ns),ze=I(hd),We=I(ns);function It(Z){return Z}function pt(Z,te,me,we){return de(me[Z.meta.arg.endpointName][te],(0,tt.isFulfilled)(Z)?Z.payload:void 0,(0,tt.isRejectedWithValue)(Z)?Z.payload:void 0,Z.meta.arg.originalArgs,"baseQueryMeta"in Z.meta?Z.meta.baseQueryMeta:void 0,we)}var bn=I(hd),Y=I(hd);function Se(Z,te,me){var we=Z[te];we&&me(we)}function ne(Z){var te;return(te="arg"in Z?Z.arg.fixedCacheKey:Z.fixedCacheKey)!=null?te:Z.requestId}function he(Z,te,me){var we=Z[ne(te)];we&&me(we)}var Re={},Ke=Symbol.for("RTKQ/skipToken"),ge=Ke,ut={status:t.uninitialized},Rt=(0,ye.createNextState)(ut,function(){}),en=(0,ye.createNextState)(ut,function(){}),$e=I(ns),Xe=WeakMap?new WeakMap:void 0,On=function(Z){var te=Z.endpointName,me=Z.queryArgs,we="",_e=Xe==null?void 0:Xe.get(me);if(typeof _e=="string")we=_e;else{var ot=JSON.stringify(me,function(kt,Xt){return(0,$e.isPlainObject)(Xt)?Object.keys(Xt).sort().reduce(function(bt,Ze){return bt[Ze]=Xt[Ze],bt},{}):Xt});(0,$e.isPlainObject)(me)&&(Xe==null||Xe.set(me,ot)),we=ot}return te+"("+we+")"},Ie=I(ns),Ye=I(uY);function ht(){for(var Z=[],te=0;te<arguments.length;te++)Z[te]=arguments[te];return function(me){var we=(0,Ye.defaultMemoize)(function(bt){var Ze,rt;return(rt=me.extractRehydrationInfo)==null?void 0:rt.call(me,bt,{reducerPath:(Ze=me.reducerPath)!=null?Ze:"api"})}),_e=_(w({reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1},me),{extractRehydrationInfo:we,serializeQueryArgs:function(bt){var Ze=On;if("serializeQueryArgs"in bt.endpointDefinition){var rt=bt.endpointDefinition.serializeQueryArgs;Ze=function(je){var Qe=rt(je);return typeof Qe=="string"?Qe:On(_(w({},je),{queryArgs:Qe}))}}else me.serializeQueryArgs&&(Ze=me.serializeQueryArgs);return Ze(bt)},tagTypes:o([],me.tagTypes||[])}),ot={endpointDefinitions:{},batch:function(bt){bt()},apiUid:(0,Ie.nanoid)(),extractRehydrationInfo:we,hasRehydrationInfo:(0,Ye.defaultMemoize)(function(bt){return we(bt)!=null})},kt={injectEndpoints:function(bt){for(var Ze=bt.endpoints({query:function(sn){return _(w({},sn),{type:ie.query})},mutation:function(sn){return _(w({},sn),{type:ie.mutation})}}),rt=0,je=Object.entries(Ze);rt<je.length;rt++){var Qe=je[rt],Mt=Qe[0],At=Qe[1];if(bt.overrideExisting||!(Mt in ot.endpointDefinitions)){ot.endpointDefinitions[Mt]=At;for(var Ft=0,Qt=Xt;Ft<Qt.length;Ft++)Qt[Ft].injectEndpoint(Mt,At)}}return kt},enhanceEndpoints:function(bt){var Ze=bt.addTagTypes,rt=bt.endpoints;if(Ze)for(var je=0,Qe=Ze;je<Qe.length;je++){var Mt=Qe[je];_e.tagTypes.includes(Mt)||_e.tagTypes.push(Mt)}if(rt)for(var At=0,Ft=Object.entries(rt);At<Ft.length;At++){var Qt=Ft[At],sn=Qt[0],Jt=Qt[1];typeof Jt=="function"?Jt(ot.endpointDefinitions[sn]):Object.assign(ot.endpointDefinitions[sn]||{},Jt)}return kt}},Xt=Z.map(function(bt){return bt.init(kt,_e,ot)});return kt.injectEndpoints({endpoints:me.endpoints})}}function vt(){return function(){throw new Error("When using `fakeBaseQuery`, all queries & mutations must use the `queryFn` definition syntax.")}}var Gt,Er=I(ns),gn=function(Z){var te=Z.reducerPath,me=Z.api,we=Z.context,_e=Z.internalState,ot=me.internalActions,kt=ot.removeQueryResult,Xt=ot.unsubscribeQueryResult;function bt(je){var Qe=_e.currentSubscriptions[je];return!!Qe&&!function(Mt){for(var At in Mt)return!1;return!0}(Qe)}var Ze={};function rt(je,Qe,Mt,At){var Ft,Qt=we.endpointDefinitions[Qe],sn=(Ft=Qt==null?void 0:Qt.keepUnusedDataFor)!=null?Ft:At.keepUnusedDataFor;if(sn!==1/0){var Jt=Math.max(0,Math.min(sn,2147482647e-3));if(!bt(je)){var De=Ze[je];De&&clearTimeout(De),Ze[je]=setTimeout(function(){bt(je)||Mt.dispatch(kt({queryCacheKey:je})),delete Ze[je]},1e3*Jt)}}}return function(je,Qe,Mt){var At;if(Xt.match(je)){var Ft=Qe.getState()[te];rt(Rn=je.payload.queryCacheKey,(At=Ft.queries[Rn])==null?void 0:At.endpointName,Qe,Ft.config)}if(me.util.resetApiState.match(je))for(var Qt=0,sn=Object.entries(Ze);Qt<sn.length;Qt++){var Jt=sn[Qt],De=Jt[0],Pt=Jt[1];Pt&&clearTimeout(Pt),delete Ze[De]}if(we.hasRehydrationInfo(je)){Ft=Qe.getState()[te];for(var Vt=we.extractRehydrationInfo(je).queries,Wt=0,Zt=Object.entries(Vt);Wt<Zt.length;Wt++){var Rn,on=Zt[Wt],hn=on[1];rt(Rn=on[0],hn==null?void 0:hn.endpointName,Qe,Ft.config)}}}},vn=I(ns),Hr=function(Z){var te=Z.reducerPath,me=Z.context,we=Z.context.endpointDefinitions,_e=Z.mutationThunk,ot=Z.api,kt=Z.assertTagType,Xt=Z.refetchQuery,bt=ot.internalActions.removeQueryResult,Ze=(0,vn.isAnyOf)((0,vn.isFulfilled)(_e),(0,vn.isRejectedWithValue)(_e));function rt(je,Qe){var Mt=Qe.getState(),At=Mt[te],Ft=ot.util.selectInvalidatedBy(Mt,je);me.batch(function(){for(var Qt,sn=0,Jt=Array.from(Ft.values());sn<Jt.length;sn++){var De=Jt[sn].queryCacheKey,Pt=At.queries[De],Vt=(Qt=At.subscriptions[De])!=null?Qt:{};Pt&&(Object.keys(Vt).length===0?Qe.dispatch(bt({queryCacheKey:De})):Pt.status!==t.uninitialized&&Qe.dispatch(Xt(Pt,De)))}})}return function(je,Qe){Ze(je)&&rt(pt(je,"invalidatesTags",we,kt),Qe),ot.util.invalidateTags.match(je)&&rt(de(je.payload,void 0,void 0,void 0,void 0,kt),Qe)}},Kn=function(Z){var te=Z.reducerPath,me=Z.queryThunk,we=Z.api,_e=Z.refetchQuery,ot=Z.internalState,kt={};function Xt(je,Qe){var Mt=je.queryCacheKey,At=Qe.getState()[te].queries[Mt];if(At&&At.status!==t.uninitialized){var Ft=rt(ot.currentSubscriptions[Mt]);if(Number.isFinite(Ft)){var Qt=kt[Mt];Qt!=null&&Qt.timeout&&(clearTimeout(Qt.timeout),Qt.timeout=void 0);var sn=Date.now()+Ft,Jt=kt[Mt]={nextPollTimestamp:sn,pollingInterval:Ft,timeout:setTimeout(function(){Jt.timeout=void 0,Qe.dispatch(_e(At,Mt))},Ft)}}}}function bt(je,Qe){var Mt=je.queryCacheKey,At=Qe.getState()[te].queries[Mt];if(At&&At.status!==t.uninitialized){var Ft=rt(ot.currentSubscriptions[Mt]);if(Number.isFinite(Ft)){var Qt=kt[Mt],sn=Date.now()+Ft;(!Qt||sn<Qt.nextPollTimestamp)&&Xt({queryCacheKey:Mt},Qe)}else Ze(Mt)}}function Ze(je){var Qe=kt[je];Qe!=null&&Qe.timeout&&clearTimeout(Qe.timeout),delete kt[je]}function rt(je){je===void 0&&(je={});var Qe=Number.POSITIVE_INFINITY;for(var Mt in je)je[Mt].pollingInterval&&(Qe=Math.min(je[Mt].pollingInterval,Qe));return Qe}return function(je,Qe){(we.internalActions.updateSubscriptionOptions.match(je)||we.internalActions.unsubscribeQueryResult.match(je))&&bt(je.payload,Qe),(me.pending.match(je)||me.rejected.match(je)&&je.meta.condition)&&bt(je.meta.arg,Qe),(me.fulfilled.match(je)||me.rejected.match(je)&&!je.meta.condition)&&Xt(je.meta.arg,Qe),we.util.resetApiState.match(je)&&function(){for(var Mt=0,At=Object.keys(kt);Mt<At.length;Mt++)Ze(At[Mt])}()}},Qn=I(ns),Ws=new Error("Promise never resolved before cacheEntryRemoved."),Tn=function(Z){var te=Z.api,me=Z.reducerPath,we=Z.context,_e=Z.queryThunk,ot=Z.mutationThunk,kt=(0,Qn.isAsyncThunkAction)(_e),Xt=(0,Qn.isAsyncThunkAction)(ot),bt=(0,Qn.isFulfilled)(_e,ot),Ze={};function rt(je,Qe,Mt,At,Ft){var Qt=we.endpointDefinitions[je],sn=Qt==null?void 0:Qt.onCacheEntryAdded;if(sn){var Jt={},De=new Promise(function(on){Jt.cacheEntryRemoved=on}),Pt=Promise.race([new Promise(function(on){Jt.valueResolved=on}),De.then(function(){throw Ws})]);Pt.catch(function(){}),Ze[Mt]=Jt;var Vt=te.endpoints[je].select(Qt.type===ie.query?Qe:Mt),Wt=At.dispatch(function(on,hn,Gn){return Gn}),Zt=_(w({},At),{getCacheEntry:function(){return Vt(At.getState())},requestId:Ft,extra:Wt,updateCachedData:Qt.type===ie.query?function(on){return At.dispatch(te.util.updateQueryData(je,Qe,on))}:void 0,cacheDataLoaded:Pt,cacheEntryRemoved:De}),Rn=sn(Qe,Zt);Promise.resolve(Rn).catch(function(on){if(on!==Ws)throw on})}}return function(je,Qe,Mt){var At=function(Vt){return kt(Vt)?Vt.meta.arg.queryCacheKey:Xt(Vt)?Vt.meta.requestId:te.internalActions.removeQueryResult.match(Vt)?Vt.payload.queryCacheKey:te.internalActions.removeMutationResult.match(Vt)?ne(Vt.payload):""}(je);if(_e.pending.match(je)){var Ft=Mt[me].queries[At],Qt=Qe.getState()[me].queries[At];!Ft&&Qt&&rt(je.meta.arg.endpointName,je.meta.arg.originalArgs,At,Qe,je.meta.requestId)}else if(ot.pending.match(je))(Qt=Qe.getState()[me].mutations[At])&&rt(je.meta.arg.endpointName,je.meta.arg.originalArgs,At,Qe,je.meta.requestId);else if(bt(je))(Pt=Ze[At])!=null&&Pt.valueResolved&&(Pt.valueResolved({data:je.payload,meta:je.meta.baseQueryMeta}),delete Pt.valueResolved);else if(te.internalActions.removeQueryResult.match(je)||te.internalActions.removeMutationResult.match(je))(Pt=Ze[At])&&(delete Ze[At],Pt.cacheEntryRemoved());else if(te.util.resetApiState.match(je))for(var sn=0,Jt=Object.entries(Ze);sn<Jt.length;sn++){var De=Jt[sn],Pt=De[1];delete Ze[De[0]],Pt.cacheEntryRemoved()}}},ps=I(ns),hs=function(Z){var te=Z.api,me=Z.context,we=Z.queryThunk,_e=Z.mutationThunk,ot=(0,ps.isPending)(we,_e),kt=(0,ps.isRejected)(we,_e),Xt=(0,ps.isFulfilled)(we,_e),bt={};return function(Ze,rt){var je,Qe,Mt;if(ot(Ze)){var At=Ze.meta,Ft=At.requestId,Qt=At.arg,sn=Qt.endpointName,Jt=Qt.originalArgs,De=me.endpointDefinitions[sn],Pt=De==null?void 0:De.onQueryStarted;if(Pt){var Vt={},Wt=new Promise(function(xr,Dt){Vt.resolve=xr,Vt.reject=Dt});Wt.catch(function(){}),bt[Ft]=Vt;var Zt=te.endpoints[sn].select(De.type===ie.query?Jt:Ft),Rn=rt.dispatch(function(xr,Dt,Vn){return Vn}),on=_(w({},rt),{getCacheEntry:function(){return Zt(rt.getState())},requestId:Ft,extra:Rn,updateCachedData:De.type===ie.query?function(xr){return rt.dispatch(te.util.updateQueryData(sn,Jt,xr))}:void 0,queryFulfilled:Wt});Pt(Jt,on)}}else if(Xt(Ze)){var hn=Ze.meta,Gn=hn.baseQueryMeta;(je=bt[Ft=hn.requestId])==null||je.resolve({data:Ze.payload,meta:Gn}),delete bt[Ft]}else if(kt(Ze)){var Kr=Ze.meta;Gn=Kr.baseQueryMeta,(Mt=bt[Ft=Kr.requestId])==null||Mt.reject({error:(Qe=Ze.payload)!=null?Qe:Ze.error,isUnhandledError:!Kr.rejectedWithValue,meta:Gn}),delete bt[Ft]}}},dr=function(Z){var te=Z.api,me=Z.context.apiUid;return function(we,_e){te.util.resetApiState.match(we)&&_e.dispatch(te.internalActions.middlewareRegistered(me))}},Us=I(hd),ji=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof Tc<"u"?Tc:globalThis):function(Z){return(Gt||(Gt=Promise.resolve())).then(Z).catch(function(te){return setTimeout(function(){throw te},0)})};function Yr(Z){for(var te=[],me=1;me<arguments.length;me++)te[me-1]=arguments[me];Object.assign.apply(Object,o([Z],te))}var ms=I(hd),Ja=Symbol(),Ii=function(){return{name:Ja,init:function(Z,te,me){var we=te.baseQuery,_e=te.reducerPath,ot=te.serializeQueryArgs,kt=te.keepUnusedDataFor,Xt=te.refetchOnMountOrArgChange,bt=te.refetchOnFocus,Ze=te.refetchOnReconnect;(0,ms.enablePatches)();var rt=function(Dt){return Dt};Object.assign(Z,{reducerPath:_e,endpoints:{},internalActions:{onOnline:le,onOffline:oe,onFocus:V,onFocusLost:ee},util:{}});var je=function(Dt){var Vn=this,Xn=Dt.reducerPath,br=Dt.baseQuery,Ar=Dt.context.endpointDefinitions,tr=Dt.serializeQueryArgs,nr=Dt.api,wn=function(Je,Nt){return j(Vn,[Je,Nt],function(Et,dt){var jt,qt,St,it,Ne,Ee,Le,Ue,st,$t,zt,Ge,an,An=dt.signal,kn=dt.abort,Nr=dt.rejectWithValue,hr=dt.fulfillWithValue,In=dt.dispatch,fr=dt.getState,Po=dt.extra;return r(this,function(Sn){switch(Sn.label){case 0:jt=Ar[Et.endpointName],Sn.label=1;case 1:return Sn.trys.push([1,8,,13]),qt=It,St=void 0,it={signal:An,abort:kn,dispatch:In,getState:fr,extra:Po,endpoint:Et.endpointName,type:Et.type,forced:Et.type==="query"?$n(Et,fr()):void 0},(Ne=Et.type==="query"?Et[ae]:void 0)?(St=Ne(),[3,6]):[3,2];case 2:return jt.query?[4,br(jt.query(Et.originalArgs),it,jt.extraOptions)]:[3,4];case 3:return St=Sn.sent(),jt.transformResponse&&(qt=jt.transformResponse),[3,6];case 4:return[4,jt.queryFn(Et.originalArgs,it,jt.extraOptions,function(rr){return br(rr,it,jt.extraOptions)})];case 5:St=Sn.sent(),Sn.label=6;case 6:if(St.error)throw new H(St.error,St.meta);return Ee=hr,[4,qt(St.data,St.meta,Et.originalArgs)];case 7:return[2,Ee.apply(void 0,[Sn.sent(),(Ge={fulfilledTimeStamp:Date.now(),baseQueryMeta:St.meta},Ge[We.SHOULD_AUTOBATCH]=!0,Ge)])];case 8:if(Le=Sn.sent(),!((Ue=Le)instanceof H))return[3,12];st=It,jt.query&&jt.transformErrorResponse&&(st=jt.transformErrorResponse),Sn.label=9;case 9:return Sn.trys.push([9,11,,12]),$t=Nr,[4,st(Ue.value,Ue.meta,Et.originalArgs)];case 10:return[2,$t.apply(void 0,[Sn.sent(),(an={baseQueryMeta:Ue.meta},an[We.SHOULD_AUTOBATCH]=!0,an)])];case 11:return zt=Sn.sent(),Ue=zt,[3,12];case 12:throw console.error(Ue),Ue;case 13:return[2]}})})};function $n(Je,Nt){var Et,dt,jt,qt,St=(dt=(Et=Nt[Xn])==null?void 0:Et.queries)==null?void 0:dt[Je.queryCacheKey],it=(jt=Nt[Xn])==null?void 0:jt.config.refetchOnMountOrArgChange,Ne=St==null?void 0:St.fulfilledTimeStamp,Ee=(qt=Je.forceRefetch)!=null?qt:Je.subscribe&&it;return!!Ee&&(Ee===!0||(Number(new Date)-Number(Ne))/1e3>=Ee)}var Wn=(0,We.createAsyncThunk)(Xn+"/executeQuery",wn,{getPendingMeta:function(){var Je;return(Je={startedTimeStamp:Date.now()})[We.SHOULD_AUTOBATCH]=!0,Je},condition:function(Je,Nt){var Et,dt,jt,qt=(0,Nt.getState)(),St=(dt=(Et=qt[Xn])==null?void 0:Et.queries)==null?void 0:dt[Je.queryCacheKey],it=St==null?void 0:St.fulfilledTimeStamp,Ne=Je.originalArgs,Ee=St==null?void 0:St.originalArgs,Le=Ar[Je.endpointName];return!(!Pe(Je)&&((St==null?void 0:St.status)==="pending"||!$n(Je,qt)&&(!se(Le)||!((jt=Le==null?void 0:Le.forceRefetch)!=null&&jt.call(Le,{currentArg:Ne,previousArg:Ee,endpointState:St,state:qt})))&&it))},dispatchConditionRejection:!0}),Mn=(0,We.createAsyncThunk)(Xn+"/executeMutation",wn,{getPendingMeta:function(){var Je;return(Je={startedTimeStamp:Date.now()})[We.SHOULD_AUTOBATCH]=!0,Je}});function Dn(Je){return function(Nt){var Et,dt;return((dt=(Et=Nt==null?void 0:Nt.meta)==null?void 0:Et.arg)==null?void 0:dt.endpointName)===Je}}return{queryThunk:Wn,mutationThunk:Mn,prefetch:function(Je,Nt,Et){return function(dt,jt){var qt=function(Le){return"force"in Le}(Et)&&Et.force,St=function(Le){return"ifOlderThan"in Le}(Et)&&Et.ifOlderThan,it=function(Le){return Le===void 0&&(Le=!0),nr.endpoints[Je].initiate(Nt,{forceRefetch:Le})},Ne=nr.endpoints[Je].select(Nt)(jt());if(qt)dt(it());else if(St){var Ee=Ne==null?void 0:Ne.fulfilledTimeStamp;if(!Ee)return void dt(it());(Number(new Date)-Number(new Date(Ee)))/1e3>=St&&dt(it())}else dt(it(!1))}},updateQueryData:function(Je,Nt,Et){return function(dt,jt){var qt,St,it=nr.endpoints[Je].select(Nt)(jt()),Ne={patches:[],inversePatches:[],undo:function(){return dt(nr.util.patchQueryData(Je,Nt,Ne.inversePatches))}};if(it.status===t.uninitialized)return Ne;if("data"in it)if((0,ze.isDraftable)(it.data)){var Ee=(0,ze.produceWithPatches)(it.data,Et),Le=Ee[2];(qt=Ne.patches).push.apply(qt,Ee[1]),(St=Ne.inversePatches).push.apply(St,Le)}else{var Ue=Et(it.data);Ne.patches.push({op:"replace",path:[],value:Ue}),Ne.inversePatches.push({op:"replace",path:[],value:it.data})}return dt(nr.util.patchQueryData(Je,Nt,Ne.patches)),Ne}},upsertQueryData:function(Je,Nt,Et){return function(dt){var jt;return dt(nr.endpoints[Je].initiate(Nt,((jt={subscribe:!1,forceRefetch:!0})[ae]=function(){return{data:Et}},jt)))}},patchQueryData:function(Je,Nt,Et){return function(dt){dt(nr.internalActions.queryResultPatched({queryCacheKey:tr({queryArgs:Nt,endpointDefinition:Ar[Je],endpointName:Je}),patches:Et}))}},buildMatchThunkActions:function(Je,Nt){return{matchPending:(0,tt.isAllOf)((0,tt.isPending)(Je),Dn(Nt)),matchFulfilled:(0,tt.isAllOf)((0,tt.isFulfilled)(Je),Dn(Nt)),matchRejected:(0,tt.isAllOf)((0,tt.isRejected)(Je),Dn(Nt))}}}}({baseQuery:we,reducerPath:_e,context:me,api:Z,serializeQueryArgs:ot}),Qe=je.queryThunk,Mt=je.mutationThunk,At=je.patchQueryData,Ft=je.updateQueryData,Qt=je.upsertQueryData,sn=je.prefetch,Jt=je.buildMatchThunkActions,De=function(Dt){var Vn=Dt.reducerPath,Xn=Dt.queryThunk,br=Dt.mutationThunk,Ar=Dt.context,tr=Ar.endpointDefinitions,nr=Ar.apiUid,wn=Ar.extractRehydrationInfo,$n=Ar.hasRehydrationInfo,Wn=Dt.assertTagType,Mn=Dt.config,Dn=(0,xe.createAction)(Vn+"/resetApiState"),Je=(0,xe.createSlice)({name:Vn+"/queries",initialState:Re,reducers:{removeQueryResult:{reducer:function(it,Ne){delete it[Ne.payload.queryCacheKey]},prepare:(0,xe.prepareAutoBatched)()},queryResultPatched:function(it,Ne){var Ee=Ne.payload,Le=Ee.patches;Se(it,Ee.queryCacheKey,function(Ue){Ue.data=(0,Y.applyPatches)(Ue.data,Le.concat())})}},extraReducers:function(it){it.addCase(Xn.pending,function(Ne,Ee){var Le,Ue=Ee.meta,st=Ee.meta.arg,$t=Pe(st);(st.subscribe||$t)&&(Ne[Le=st.queryCacheKey]!=null||(Ne[Le]={status:t.uninitialized,endpointName:st.endpointName})),Se(Ne,st.queryCacheKey,function(zt){zt.status=t.pending,zt.requestId=$t&&zt.requestId?zt.requestId:Ue.requestId,st.originalArgs!==void 0&&(zt.originalArgs=st.originalArgs),zt.startedTimeStamp=Ue.startedTimeStamp})}).addCase(Xn.fulfilled,function(Ne,Ee){var Le=Ee.meta,Ue=Ee.payload;Se(Ne,Le.arg.queryCacheKey,function(st){var $t;if(st.requestId===Le.requestId||Pe(Le.arg)){var zt=tr[Le.arg.endpointName].merge;if(st.status=t.fulfilled,zt)if(st.data!==void 0){var Ge=Le.fulfilledTimeStamp,an=Le.arg,An=Le.baseQueryMeta,kn=Le.requestId,Nr=(0,xe.createNextState)(st.data,function(hr){return zt(hr,Ue,{arg:an.originalArgs,baseQueryMeta:An,fulfilledTimeStamp:Ge,requestId:kn})});st.data=Nr}else st.data=Ue;else st.data=($t=tr[Le.arg.endpointName].structuralSharing)==null||$t?R((0,bn.isDraft)(st.data)?(0,Y.original)(st.data):st.data,Ue):Ue;delete st.error,st.fulfilledTimeStamp=Le.fulfilledTimeStamp}})}).addCase(Xn.rejected,function(Ne,Ee){var Le=Ee.meta,Ue=Le.condition,st=Le.requestId,$t=Ee.error,zt=Ee.payload;Se(Ne,Le.arg.queryCacheKey,function(Ge){if(!Ue){if(Ge.requestId!==st)return;Ge.status=t.rejected,Ge.error=zt??$t}})}).addMatcher($n,function(Ne,Ee){for(var Le=wn(Ee).queries,Ue=0,st=Object.entries(Le);Ue<st.length;Ue++){var $t=st[Ue],zt=$t[1];(zt==null?void 0:zt.status)!==t.fulfilled&&(zt==null?void 0:zt.status)!==t.rejected||(Ne[$t[0]]=zt)}})}}),Nt=(0,xe.createSlice)({name:Vn+"/mutations",initialState:Re,reducers:{removeMutationResult:{reducer:function(it,Ne){var Ee=ne(Ne.payload);Ee in it&&delete it[Ee]},prepare:(0,xe.prepareAutoBatched)()}},extraReducers:function(it){it.addCase(br.pending,function(Ne,Ee){var Le=Ee.meta,Ue=Le.requestId,st=Le.arg,$t=Le.startedTimeStamp;st.track&&(Ne[ne(Ee.meta)]={requestId:Ue,status:t.pending,endpointName:st.endpointName,startedTimeStamp:$t})}).addCase(br.fulfilled,function(Ne,Ee){var Le=Ee.payload,Ue=Ee.meta;Ue.arg.track&&he(Ne,Ue,function(st){st.requestId===Ue.requestId&&(st.status=t.fulfilled,st.data=Le,st.fulfilledTimeStamp=Ue.fulfilledTimeStamp)})}).addCase(br.rejected,function(Ne,Ee){var Le=Ee.payload,Ue=Ee.error,st=Ee.meta;st.arg.track&&he(Ne,st,function($t){$t.requestId===st.requestId&&($t.status=t.rejected,$t.error=Le??Ue)})}).addMatcher($n,function(Ne,Ee){for(var Le=wn(Ee).mutations,Ue=0,st=Object.entries(Le);Ue<st.length;Ue++){var $t=st[Ue],zt=$t[0],Ge=$t[1];(Ge==null?void 0:Ge.status)!==t.fulfilled&&(Ge==null?void 0:Ge.status)!==t.rejected||zt===(Ge==null?void 0:Ge.requestId)||(Ne[zt]=Ge)}})}}),Et=(0,xe.createSlice)({name:Vn+"/invalidation",initialState:Re,reducers:{},extraReducers:function(it){it.addCase(Je.actions.removeQueryResult,function(Ne,Ee){for(var Le=Ee.payload.queryCacheKey,Ue=0,st=Object.values(Ne);Ue<st.length;Ue++)for(var $t=0,zt=Object.values(st[Ue]);$t<zt.length;$t++){var Ge=zt[$t],an=Ge.indexOf(Le);an!==-1&&Ge.splice(an,1)}}).addMatcher($n,function(Ne,Ee){for(var Le,Ue,st,$t,zt=wn(Ee).provided,Ge=0,an=Object.entries(zt);Ge<an.length;Ge++)for(var An=an[Ge],kn=An[0],Nr=0,hr=Object.entries(An[1]);Nr<hr.length;Nr++)for(var In=hr[Nr],fr=In[0],Po=In[1],Sn=($t=(Ue=(Le=Ne[kn])!=null?Le:Ne[kn]={})[st=fr||"__internal_without_id"])!=null?$t:Ue[st]=[],rr=0,ao=Po;rr<ao.length;rr++){var Xr=ao[rr];Sn.includes(Xr)||Sn.push(Xr)}}).addMatcher((0,xe.isAnyOf)((0,xe.isFulfilled)(Xn),(0,xe.isRejectedWithValue)(Xn)),function(Ne,Ee){for(var Le,Ue,st,$t,zt=pt(Ee,"providesTags",tr,Wn),Ge=Ee.meta.arg.queryCacheKey,an=0,An=Object.values(Ne);an<An.length;an++)for(var kn=0,Nr=Object.values(An[an]);kn<Nr.length;kn++){var hr=Nr[kn],In=hr.indexOf(Ge);In!==-1&&hr.splice(In,1)}for(var fr=0,Po=zt;fr<Po.length;fr++){var Sn=Po[fr],rr=Sn.type,ao=Sn.id,Xr=($t=(Ue=(Le=Ne[rr])!=null?Le:Ne[rr]={})[st=ao||"__internal_without_id"])!=null?$t:Ue[st]=[];Xr.includes(Ge)||Xr.push(Ge)}})}}),dt=(0,xe.createSlice)({name:Vn+"/subscriptions",initialState:Re,reducers:{updateSubscriptionOptions:function(it,Ne){},unsubscribeQueryResult:function(it,Ne){},internal_probeSubscription:function(it,Ne){}}}),jt=(0,xe.createSlice)({name:Vn+"/internalSubscriptions",initialState:Re,reducers:{subscriptionsUpdated:{reducer:function(it,Ne){return(0,Y.applyPatches)(it,Ne.payload)},prepare:(0,xe.prepareAutoBatched)()}}}),qt=(0,xe.createSlice)({name:Vn+"/config",initialState:w({online:typeof navigator>"u"||navigator.onLine===void 0||navigator.onLine,focused:typeof document>"u"||document.visibilityState!=="hidden",middlewareRegistered:!1},Mn),reducers:{middlewareRegistered:function(it,Ne){it.middlewareRegistered=it.middlewareRegistered!=="conflict"&&nr===Ne.payload||"conflict"}},extraReducers:function(it){it.addCase(le,function(Ne){Ne.online=!0}).addCase(oe,function(Ne){Ne.online=!1}).addCase(V,function(Ne){Ne.focused=!0}).addCase(ee,function(Ne){Ne.focused=!1}).addMatcher($n,function(Ne){return w({},Ne)})}}),St=(0,xe.combineReducers)({queries:Je.reducer,mutations:Nt.reducer,provided:Et.reducer,subscriptions:jt.reducer,config:qt.reducer});return{reducer:function(it,Ne){return St(Dn.match(Ne)?void 0:it,Ne)},actions:_(w(w(w(w(w({},qt.actions),Je.actions),dt.actions),jt.actions),Nt.actions),{unsubscribeMutationResult:Nt.actions.removeMutationResult,resetApiState:Dn})}}({context:me,queryThunk:Qe,mutationThunk:Mt,reducerPath:_e,assertTagType:rt,config:{refetchOnFocus:bt,refetchOnReconnect:Ze,refetchOnMountOrArgChange:Xt,keepUnusedDataFor:kt,reducerPath:_e}}),Pt=De.reducer,Vt=De.actions;Yr(Z.util,{patchQueryData:At,updateQueryData:Ft,upsertQueryData:Qt,prefetch:sn,resetApiState:Vt.resetApiState}),Yr(Z.internalActions,Vt);var Wt=function(Dt){var Vn=Dt.reducerPath,Xn=Dt.queryThunk,br=Dt.api,Ar=Dt.context,tr=Ar.apiUid,nr={invalidateTags:(0,Er.createAction)(Vn+"/invalidateTags")},wn=[dr,gn,Hr,Kn,Tn,hs];return{middleware:function(Wn){var Mn=!1,Dn=_(w({},Dt),{internalState:{currentSubscriptions:{}},refetchQuery:$n}),Je=wn.map(function(dt){return dt(Dn)}),Nt=function(dt){var jt=dt.api,qt=dt.queryThunk,St=dt.internalState,it=jt.reducerPath+"/subscriptions",Ne=null,Ee=!1,Le=jt.internalActions,Ue=Le.updateSubscriptionOptions,st=Le.unsubscribeQueryResult;return function($t,zt){var Ge,an;if(Ne||(Ne=JSON.parse(JSON.stringify(St.currentSubscriptions))),jt.util.resetApiState.match($t))return Ne=St.currentSubscriptions={},[!0,!1];if(jt.internalActions.internal_probeSubscription.match($t)){var An=$t.payload;return[!1,!!((Ge=St.currentSubscriptions[An.queryCacheKey])!=null&&Ge[An.requestId])]}var kn=function(In,fr){var Po,Sn,rr,ao,Xr,Ei,Jf,Qo,ei;if(Ue.match(fr)){var ja=fr.payload,ti=ja.queryCacheKey,jo=ja.requestId;return(Po=In==null?void 0:In[ti])!=null&&Po[jo]&&(In[ti][jo]=ja.options),!0}if(st.match(fr)){var Io=fr.payload;return jo=Io.requestId,In[ti=Io.queryCacheKey]&&delete In[ti][jo],!0}if(jt.internalActions.removeQueryResult.match(fr))return delete In[fr.payload.queryCacheKey],!0;if(qt.pending.match(fr)){var Eo=fr.meta;if(jo=Eo.requestId,(mo=Eo.arg).subscribe)return(gs=(rr=In[Sn=mo.queryCacheKey])!=null?rr:In[Sn]={})[jo]=(Xr=(ao=mo.subscriptionOptions)!=null?ao:gs[jo])!=null?Xr:{},!0}if(qt.rejected.match(fr)){var gs,Jo=fr.meta,mo=Jo.arg;if(jo=Jo.requestId,Jo.condition&&mo.subscribe)return(gs=(Jf=In[Ei=mo.queryCacheKey])!=null?Jf:In[Ei]={})[jo]=(ei=(Qo=mo.subscriptionOptions)!=null?Qo:gs[jo])!=null?ei:{},!0}return!1}(St.currentSubscriptions,$t);if(kn){Ee||(ji(function(){var In=JSON.parse(JSON.stringify(St.currentSubscriptions)),fr=(0,Us.produceWithPatches)(Ne,function(){return In});zt.next(jt.internalActions.subscriptionsUpdated(fr[1])),Ne=In,Ee=!1}),Ee=!0);var Nr=!!((an=$t.type)!=null&&an.startsWith(it)),hr=qt.rejected.match($t)&&$t.meta.condition&&!!$t.meta.arg.subscribe;return[!Nr&&!hr,!1]}return[!0,!1]}}(Dn),Et=function(dt){var jt=dt.reducerPath,qt=dt.context,St=dt.refetchQuery,it=dt.internalState,Ne=dt.api.internalActions.removeQueryResult;function Ee(Le,Ue){var st=Le.getState()[jt],$t=st.queries,zt=it.currentSubscriptions;qt.batch(function(){for(var Ge=0,an=Object.keys(zt);Ge<an.length;Ge++){var An=an[Ge],kn=$t[An],Nr=zt[An];Nr&&kn&&(Object.values(Nr).some(function(hr){return hr[Ue]===!0})||Object.values(Nr).every(function(hr){return hr[Ue]===void 0})&&st.config[Ue])&&(Object.keys(Nr).length===0?Le.dispatch(Ne({queryCacheKey:An})):kn.status!==t.uninitialized&&Le.dispatch(St(kn,An)))}})}return function(Le,Ue){V.match(Le)&&Ee(Ue,"refetchOnFocus"),le.match(Le)&&Ee(Ue,"refetchOnReconnect")}}(Dn);return function(dt){return function(jt){Mn||(Mn=!0,Wn.dispatch(br.internalActions.middlewareRegistered(tr)));var qt,St=_(w({},Wn),{next:dt}),it=Wn.getState(),Ne=Nt(jt,St,it),Ee=Ne[1];if(qt=Ne[0]?dt(jt):Ee,Wn.getState()[Vn]&&(Et(jt,St,it),function(st){return!!st&&typeof st.type=="string"&&st.type.startsWith(Vn+"/")}(jt)||Ar.hasRehydrationInfo(jt)))for(var Le=0,Ue=Je;Le<Ue.length;Le++)(0,Ue[Le])(jt,St,it);return qt}}},actions:nr};function $n(Wn,Mn,Dn){return Dn===void 0&&(Dn={}),Xn(w({type:"query",endpointName:Wn.endpointName,originalArgs:Wn.originalArgs,subscribe:!1,forceRefetch:!0,queryCacheKey:Mn},Dn))}}({reducerPath:_e,context:me,queryThunk:Qe,mutationThunk:Mt,api:Z,assertTagType:rt}),Zt=Wt.middleware;Yr(Z.util,Wt.actions),Yr(Z,{reducer:Pt,middleware:Zt});var Rn=function(Dt){var Vn=Dt.serializeQueryArgs,Xn=Dt.reducerPath,br=function(wn){return Rt},Ar=function(wn){return en};return{buildQuerySelector:function(wn,$n){return function(Wn){var Mn=Vn({queryArgs:Wn,endpointDefinition:$n,endpointName:wn});return(0,ye.createSelector)(Wn===Ke?br:function(Dn){var Je,Nt,Et;return(Et=(Nt=(Je=nr(Dn))==null?void 0:Je.queries)==null?void 0:Nt[Mn])!=null?Et:Rt},tr)}},buildMutationSelector:function(){return function(wn){var $n,Wn;return Wn=typeof wn=="object"?($n=ne(wn))!=null?$n:Ke:wn,(0,ye.createSelector)(Wn===Ke?Ar:function(Mn){var Dn,Je,Nt;return(Nt=(Je=(Dn=nr(Mn))==null?void 0:Dn.mutations)==null?void 0:Je[Wn])!=null?Nt:en},tr)}},selectInvalidatedBy:function(wn,$n){for(var Wn,Mn=wn[Xn],Dn=new Set,Je=0,Nt=$n.map(fe);Je<Nt.length;Je++){var Et=Nt[Je],dt=Mn.provided[Et.type];if(dt)for(var jt=0,qt=(Wn=Et.id!==void 0?dt[Et.id]:E(Object.values(dt)))!=null?Wn:[];jt<qt.length;jt++)Dn.add(qt[jt])}return E(Array.from(Dn.values()).map(function(St){var it=Mn.queries[St];return it?[{queryCacheKey:St,endpointName:it.endpointName,originalArgs:it.originalArgs}]:[]}))}};function tr(wn){return w(w({},wn),{status:$n=wn.status,isUninitialized:$n===t.uninitialized,isLoading:$n===t.pending,isSuccess:$n===t.fulfilled,isError:$n===t.rejected});var $n}function nr(wn){return wn[Xn]}}({serializeQueryArgs:ot,reducerPath:_e}),on=Rn.buildQuerySelector,hn=Rn.buildMutationSelector;Yr(Z.util,{selectInvalidatedBy:Rn.selectInvalidatedBy});var Gn=function(Dt){var Vn=Dt.serializeQueryArgs,Xn=Dt.queryThunk,br=Dt.mutationThunk,Ar=Dt.api,tr=Dt.context,nr=new Map,wn=new Map,$n=Ar.internalActions,Wn=$n.unsubscribeQueryResult,Mn=$n.removeMutationResult,Dn=$n.updateSubscriptionOptions;return{buildInitiateQuery:function(Je,Nt){var Et=function(dt,jt){var qt=jt===void 0?{}:jt,St=qt.subscribe,it=St===void 0||St,Ne=qt.forceRefetch,Ee=qt.subscriptionOptions,Le=qt[ae];return function(Ue,st){var $t,zt,Ge=Vn({queryArgs:dt,endpointDefinition:Nt,endpointName:Je}),an=Xn((($t={type:"query",subscribe:it,forceRefetch:Ne,subscriptionOptions:Ee,endpointName:Je,originalArgs:dt,queryCacheKey:Ge})[ae]=Le,$t)),An=Ar.endpoints[Je].select(dt),kn=Ue(an),Nr=An(st()),hr=kn.requestId,In=kn.abort,fr=Nr.requestId!==hr,Po=(zt=nr.get(Ue))==null?void 0:zt[Ge],Sn=function(){return An(st())},rr=Object.assign(Le?kn.then(Sn):fr&&!Po?Promise.resolve(Nr):Promise.all([Po,kn]).then(Sn),{arg:dt,requestId:hr,subscriptionOptions:Ee,queryCacheKey:Ge,abort:In,unwrap:function(){return j(this,null,function(){var Xr;return r(this,function(Ei){switch(Ei.label){case 0:return[4,rr];case 1:if((Xr=Ei.sent()).isError)throw Xr.error;return[2,Xr.data]}})})},refetch:function(){return Ue(Et(dt,{subscribe:!1,forceRefetch:!0}))},unsubscribe:function(){it&&Ue(Wn({queryCacheKey:Ge,requestId:hr}))},updateSubscriptionOptions:function(Xr){rr.subscriptionOptions=Xr,Ue(Dn({endpointName:Je,requestId:hr,queryCacheKey:Ge,options:Xr}))}});if(!Po&&!fr&&!Le){var ao=nr.get(Ue)||{};ao[Ge]=rr,nr.set(Ue,ao),rr.then(function(){delete ao[Ge],Object.keys(ao).length||nr.delete(Ue)})}return rr}};return Et},buildInitiateMutation:function(Je){return function(Nt,Et){var dt=Et===void 0?{}:Et,jt=dt.track,qt=jt===void 0||jt,St=dt.fixedCacheKey;return function(it,Ne){var Ee=br({type:"mutation",endpointName:Je,originalArgs:Nt,track:qt,fixedCacheKey:St}),Le=it(Ee),Ue=Le.requestId,st=Le.abort,$t=Le.unwrap,zt=Le.unwrap().then(function(kn){return{data:kn}}).catch(function(kn){return{error:kn}}),Ge=function(){it(Mn({requestId:Ue,fixedCacheKey:St}))},an=Object.assign(zt,{arg:Le.arg,requestId:Ue,abort:st,unwrap:$t,unsubscribe:Ge,reset:Ge}),An=wn.get(it)||{};return wn.set(it,An),An[Ue]=an,an.then(function(){delete An[Ue],Object.keys(An).length||wn.delete(it)}),St&&(An[St]=an,an.then(function(){An[St]===an&&(delete An[St],Object.keys(An).length||wn.delete(it))})),an}}},getRunningQueryThunk:function(Je,Nt){return function(Et){var dt,jt=Vn({queryArgs:Nt,endpointDefinition:tr.endpointDefinitions[Je],endpointName:Je});return(dt=nr.get(Et))==null?void 0:dt[jt]}},getRunningMutationThunk:function(Je,Nt){return function(Et){var dt;return(dt=wn.get(Et))==null?void 0:dt[Nt]}},getRunningQueriesThunk:function(){return function(Je){return Object.values(nr.get(Je)||{}).filter(ke)}},getRunningMutationsThunk:function(){return function(Je){return Object.values(wn.get(Je)||{}).filter(ke)}},getRunningOperationPromises:function(){var Je=function(Nt){return Array.from(Nt.values()).flatMap(function(Et){return Et?Object.values(Et):[]})};return o(o([],Je(nr)),Je(wn)).filter(ke)},removalWarning:function(){throw new Error(`This method had to be removed due to a conceptual bug in RTK.
Please see https://github.com/reduxjs/redux-toolkit/pull/2481 for details.
See https://redux-toolkit.js.org/rtk-query/usage/server-side-rendering for new guidance on SSR.`)}}}({queryThunk:Qe,mutationThunk:Mt,api:Z,serializeQueryArgs:ot,context:me}),Kr=Gn.buildInitiateQuery,xr=Gn.buildInitiateMutation;return Yr(Z.util,{getRunningOperationPromises:Gn.getRunningOperationPromises,getRunningOperationPromise:Gn.removalWarning,getRunningMutationThunk:Gn.getRunningMutationThunk,getRunningMutationsThunk:Gn.getRunningMutationsThunk,getRunningQueryThunk:Gn.getRunningQueryThunk,getRunningQueriesThunk:Gn.getRunningQueriesThunk}),{name:Ja,injectEndpoint:function(Dt,Vn){var Xn,br=Z;(Xn=br.endpoints)[Dt]!=null||(Xn[Dt]={}),se(Vn)?Yr(br.endpoints[Dt],{name:Dt,select:on(Dt,Vn),initiate:Kr(Dt,Vn)},Jt(Qe,Dt)):Vn.type===ie.mutation&&Yr(br.endpoints[Dt],{name:Dt,select:hn(),initiate:xr(Dt)},Jt(Mt,Dt))}}}}},Gs=ht(Ii())})(CE);SE.exports=CE;var cc=SE.exports;const dY=e=>{const{isOver:t,label:n="Drop"}=e,r=h.useRef(Fl()),{colorMode:o}=fo();return i.jsx(zo.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}},children:i.jsxs(K,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full"},children:[i.jsx(K,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",bg:Ae("base.700","base.900")(o),opacity:.7,borderRadius:"base",alignItems:"center",justifyContent:"center",transitionProperty:"common",transitionDuration:"0.1s"}}),i.jsx(K,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",opacity:1,borderWidth:2,borderColor:t?Ae("base.50","base.200")(o):Ae("base.100","base.500")(o),borderRadius:"base",borderStyle:"dashed",transitionProperty:"common",transitionDuration:"0.1s",alignItems:"center",justifyContent:"center"},children:i.jsx(lt,{sx:{fontSize:"2xl",fontWeight:600,transform:t?"scale(1.1)":"scale(1)",color:t?Ae("base.100","base.100")(o):Ae("base.200","base.500")(o),transitionProperty:"common",transitionDuration:"0.1s"},children:n})})]})},r.current)},Su=h.memo(dY),_E=()=>{const[e,t]=hc("colors",["accent.400","accent.500"]),{colorMode:n}=fo();return i.jsx(zo.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.1}},exit:{opacity:0,transition:{duration:.1}},style:{position:"absolute",top:0,insetInlineStart:0,width:"100%",height:"100%",boxShadow:`inset 0px 0px 0px 2px ${Ae(e,t)(n)}`,borderRadius:"var(--invokeai-radii-base)"}})},kE=h.memo(({board:e,isSelected:t})=>{const n=ue(),{currentData:r}=lc(e.cover_image_name??cc.skipToken),{colorMode:o}=fo(),{board_name:s,board_id:a}=e,{onClickDeleteBoardImages:l}=h.useContext(c5),u=h.useCallback(()=>{n(u5(a))},[a,n]),[f,{isLoading:p}]=SM(),[m,{isLoading:v}]=CM(),[y,{isLoading:S}]=_M(),x=E=>{f({board_id:a,changes:{board_name:E}})},w=h.useCallback(()=>{m(a)},[a,m]),_=h.useCallback(()=>{console.log({board:e}),l(e)},[e,l]),k=h.useCallback(E=>{E.board_id!==a&&y({board_id:a,image_name:E.image_name})},[y,a]),{isOver:P,setNodeRef:I,active:j}=Cg({id:`board_droppable_${a}`,data:{handleDrop:k}});return i.jsx(et,{sx:{touchAction:"none"},children:i.jsx(DI,{menuProps:{size:"sm",isLazy:!0},renderMenu:()=>i.jsxs(Lf,{sx:{visibility:"visible !important"},children:[e.image_count>0&&i.jsx(os,{sx:{color:"error.300"},icon:i.jsx(Ls,{}),onClickCapture:_,children:"Delete Board and Images"}),i.jsx(os,{sx:{color:Ae("error.700","error.300")(o)},icon:i.jsx(Ls,{}),onClickCapture:w,children:"Delete Board"})]}),children:E=>i.jsxs(K,{userSelect:"none",ref:E,sx:{flexDir:"column",justifyContent:"space-between",alignItems:"center",cursor:"pointer",w:"full",h:"full"},children:[i.jsxs(K,{ref:I,onClick:u,sx:{position:"relative",justifyContent:"center",alignItems:"center",borderRadius:"base",w:"full",aspectRatio:"1/1",overflow:"hidden"},children:[e.cover_image_name&&(r==null?void 0:r.image_url)&&i.jsx(If,{src:r==null?void 0:r.image_url,draggable:!1}),!(e.cover_image_name&&(r!=null&&r.image_url))&&i.jsx(wE,{iconProps:{boxSize:8},as:My}),i.jsx(K,{sx:{position:"absolute",insetInlineEnd:0,top:0,p:1},children:i.jsx(mu,{variant:"solid",children:e.image_count})}),i.jsx(Co,{children:t&&i.jsx(_E,{})}),i.jsx(Co,{children:j&&i.jsx(Su,{isOver:P})})]}),i.jsx(et,{sx:{width:"full"},children:i.jsxs(SP,{defaultValue:s,submitOnBlur:!1,onSubmit:T=>{x(T)},children:[i.jsx(xP,{sx:{color:t?Ae("base.900","base.50")(o):Ae("base.700","base.200")(o),fontWeight:t?600:void 0,fontSize:"xs",textAlign:"center",p:0},noOfLines:1}),i.jsx(yP,{sx:{color:Ae("base.900","base.50")(o),fontSize:"xs",borderColor:Ae("base.500","base.500")(o),p:0,outline:0}})]})})]},a)})})});kE.displayName="HoverableBoard";const fY="My Board",pY=()=>{const[e,{isLoading:t}]=kM(),n=h.useCallback(()=>{e(fY)},[e]);return i.jsx(fn,{isLoading:t,"aria-label":"Add Board",onClick:n,size:"sm",sx:{px:4},children:"Add Board"})},hY=({isSelected:e})=>{const t=PM(),{colorMode:n}=fo(),r=()=>{t(u5())},[o,{isLoading:s}]=o5(),a=h.useCallback(p=>{p.board_id&&o({board_id:p.board_id,image_name:p.image_name})},[o]),{isOver:l,setNodeRef:u,active:f}=Cg({id:"board_droppable_all_images",data:{handleDrop:a}});return i.jsxs(K,{sx:{flexDir:"column",justifyContent:"space-between",alignItems:"center",cursor:"pointer",w:"full",h:"full",borderRadius:"base"},onClick:r,children:[i.jsxs(K,{ref:u,sx:{position:"relative",justifyContent:"center",alignItems:"center",borderRadius:"base",w:"full",aspectRatio:"1/1"},children:[i.jsx(wE,{iconProps:{boxSize:8},as:eU}),i.jsx(Co,{children:e&&i.jsx(_E,{})}),i.jsx(Co,{children:f&&i.jsx(Su,{isOver:l})})]}),i.jsx(lt,{sx:{color:e?Ae("base.900","base.50")(n):Ae("base.700","base.200")(n),fontWeight:e?600:void 0,fontSize:"xs"},children:"All Images"})]})},mY=Te([d5],e=>{const{selectedBoardId:t,searchText:n}=e;return{selectedBoardId:t,searchText:n}},zn),gY=e=>{const{isOpen:t}=e,n=ue(),{selectedBoardId:r,searchText:o}=q(mY),{data:s}=Sx(),a=o?s==null?void 0:s.filter(m=>m.board_name.toLowerCase().includes(o.toLowerCase())):s,[l,u]=h.useState(!1),f=m=>{u(m.length>0),n(oS(m))},p=()=>{u(!1),n(oS(""))};return i.jsx(Ig,{in:t,animateOpacity:!0,children:i.jsxs(K,{layerStyle:"first",sx:{flexDir:"column",gap:2,p:2,mt:2,borderRadius:"base"},children:[i.jsxs(K,{sx:{gap:2,alignItems:"center"},children:[i.jsxs(u6,{children:[i.jsx(Df,{placeholder:"Search Boards...",value:o,onChange:m=>{f(m.target.value)}}),o&&o.length&&i.jsx(Yx,{children:i.jsx(mi,{onClick:p,size:"xs",variant:"ghost","aria-label":"Clear Search",icon:i.jsx(bU,{boxSize:3})})})]}),i.jsx(pY,{})]}),i.jsx(Ib,{defer:!0,style:{height:"100%",width:"100%"},options:{scrollbars:{visibility:"auto",autoHide:"move",autoHideDelay:1300,theme:"os-theme-dark"}},children:i.jsxs(gi,{className:"list-container",sx:{gap:2,gridTemplateRows:"5.5rem 5.5rem",gridAutoFlow:"column dense",gridAutoColumns:"4rem"},children:[!l&&i.jsx(hY,{isSelected:!r}),a&&a.map(m=>i.jsx(kE,{board:m,isSelected:r===m.board_id},m.board_id))]})})]})})},vY=h.memo(gY),yY=Te([e=>e],e=>{const{categories:t,total:n,isLoading:r}=e.images,{selectedBoardId:o}=e.boards;return{images:jM(e).filter(l=>{const u=t.includes(l.image_category),f=o?l.board_id===o:!0;return u&&f}),allImagesTotal:n,isLoading:r,categories:t,selectedBoardId:o}},zn),xY=Te([pl,po,d5],(e,t,n)=>{const{galleryImageMinimumWidth:r,galleryImageObjectFit:o,shouldAutoSwitchToNewImages:s,shouldUseSingleGalleryColumn:a,selectedImage:l,galleryView:u}=e,{shouldPinGallery:f}=t;return{shouldPinGallery:f,galleryImageMinimumWidth:r,galleryImageObjectFit:o,shouldAutoSwitchToNewImages:s,shouldUseSingleGalleryColumn:a,selectedImage:l,galleryView:u,selectedBoardId:n.selectedBoardId}},zn),bY=()=>{const e=ue(),{t}=Ce(),n=h.useRef(null),r=h.useRef(null),[o,s]=h.useState(null),[a,l]=xI({defer:!0,options:{scrollbars:{visibility:"auto",autoHide:"leave",autoHideDelay:1300,theme:"os-theme-dark"},overflow:{x:"hidden"}}}),{colorMode:u}=fo(),{shouldPinGallery:f,galleryImageMinimumWidth:p,galleryImageObjectFit:m,shouldAutoSwitchToNewImages:v,shouldUseSingleGalleryColumn:y,selectedImage:S,galleryView:x}=q(xY),{images:w,isLoading:_,allImagesTotal:k,categories:P,selectedBoardId:I}=q(yY),{selectedBoard:j}=Sx(void 0,{selectFromResult:({data:A})=>({selectedBoard:A==null?void 0:A.find(L=>L.board_id===I)})}),E=h.useMemo(()=>(j==null?void 0:j.image_count)??k,[k,j==null?void 0:j.image_count]),T=h.useMemo(()=>w.length<E,[w.length,E]),R=h.useCallback(()=>{e(IM({categories:P,board_id:I,is_intermediate:!1}))},[P,e,I]),M=h.useMemo(()=>{if(T&&!_)return R},[T,R,_]),{isOpen:D,onToggle:N}=us(),U=A=>{e(Kh(A))},z=()=>{e(f5()),e(Bs())};h.useEffect(()=>{const{current:A}=r;return o&&A&&a({target:A,elements:{viewport:o}}),()=>{var L;return(L=l())==null?void 0:L.destroy()}},[o,a,l]);const F=h.useCallback(A=>{A instanceof HTMLElement&&s(A)},[]),H=h.useCallback(()=>{e(sS(EM)),e(aS("images"))},[e]),G=h.useCallback(()=>{e(sS(OM)),e(aS("assets"))},[e]);return i.jsxs(Nn,{sx:{flexDirection:"column",h:"full",w:"full",borderRadius:"base"},children:[i.jsxs(et,{sx:{w:"full"},children:[i.jsxs(K,{ref:n,sx:{alignItems:"center",justifyContent:"space-between",gap:2},children:[i.jsxs(Fr,{isAttached:!0,children:[i.jsx(Me,{tooltip:t("gallery.images"),"aria-label":t("gallery.images"),onClick:H,isChecked:x==="images",size:"sm",icon:i.jsx(Vf,{})}),i.jsx(Me,{tooltip:t("gallery.assets"),"aria-label":t("gallery.assets"),onClick:G,isChecked:x==="assets",size:"sm",icon:i.jsx(dU,{})})]}),i.jsxs(K,{as:$u,onClick:N,size:"sm",variant:"ghost",sx:{w:"full",justifyContent:"center",alignItems:"center",px:2,_hover:{bg:Ae("base.100","base.800")(u)}},children:[i.jsx(lt,{noOfLines:1,sx:{w:"full",color:Ae("base.800","base.200")(u),fontWeight:600},children:j?j.board_name:"All Images"}),i.jsx(Ab,{sx:{transform:D?"rotate(0deg)":"rotate(180deg)",transitionProperty:"common",transitionDuration:"normal"}})]}),i.jsx(ii,{triggerComponent:i.jsx(Me,{tooltip:t("gallery.gallerySettings"),"aria-label":t("gallery.gallerySettings"),size:"sm",icon:i.jsx(Mb,{})}),children:i.jsxs(K,{direction:"column",gap:2,children:[i.jsx(Tt,{value:p,onChange:U,min:32,max:256,hideTooltip:!0,label:t("gallery.galleryImageSize"),withReset:!0,handleReset:()=>e(Kh(64))}),i.jsx(qn,{label:t("gallery.maintainAspectRatio"),isChecked:m==="contain",onChange:()=>e(TM(m==="contain"?"cover":"contain"))}),i.jsx(qn,{label:t("gallery.autoSwitchNewImages"),isChecked:v,onChange:A=>e(RM(A.target.checked))}),i.jsx(qn,{label:t("gallery.singleColumnLayout"),isChecked:y,onChange:A=>e(MM(A.target.checked))})]})}),i.jsx(Me,{size:"sm","aria-label":t("gallery.pinGallery"),tooltip:`${t("gallery.pinGallery")} (Shift+G)`,onClick:z,icon:f?i.jsx(bI,{}):i.jsx(wI,{})})]}),i.jsx(et,{children:i.jsx(vY,{isOpen:D})})]}),i.jsx(K,{direction:"column",gap:2,h:"full",w:"full",children:w.length||T?i.jsxs(i.Fragment,{children:[i.jsx(et,{ref:r,"data-overlayscrollbars":"",h:"100%",children:y?i.jsx(Gq,{style:{height:"100%"},data:w,endReached:M,scrollerRef:A=>F(A),itemContent:(A,L)=>i.jsx(K,{sx:{pb:2},children:i.jsx(_4,{image:L,isSelected:S===(L==null?void 0:L.image_name)},`${L.image_name}-${L.thumbnail_url}`)})}):i.jsx(lY,{style:{height:"100%"},data:w,endReached:M,components:{Item:wY,List:SY},scrollerRef:s,itemContent:(A,L)=>i.jsx(_4,{image:L,isSelected:S===(L==null?void 0:L.image_name)},`${L.image_name}-${L.thumbnail_url}`)})}),i.jsx(fn,{onClick:R,isDisabled:!T,isLoading:_,loadingText:"Loading",flexShrink:0,children:t(T?"gallery.loadMore":"gallery.allImagesLoaded")})]}):i.jsxs(K,{sx:{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,padding:8,h:"100%",w:"100%",color:"base.500"},children:[i.jsx(uo,{as:MI,sx:{w:16,h:16}}),i.jsx(lt,{textAlign:"center",children:t("gallery.noImagesInGallery")})]})})]})},wY=Be((e,t)=>i.jsx(et,{className:"item-container",ref:t,children:e.children})),SY=Be((e,t)=>{const n=q(r=>r.gallery.galleryImageMinimumWidth);return i.jsx(gi,{...e,className:"list-container",ref:t,sx:{gap:2,gridTemplateColumns:`repeat(auto-fit, minmax(${n}px, 1fr));`},children:e.children})}),PE=h.memo(bY);var CY=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)}}(),Wr=globalThis&&globalThis.__assign||function(){return Wr=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},Wr.apply(this,arguments)},U4={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},G4={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},th={width:"20px",height:"20px",position:"absolute"},_Y={top:Wr(Wr({},U4),{top:"-5px"}),right:Wr(Wr({},G4),{left:void 0,right:"-5px"}),bottom:Wr(Wr({},U4),{top:void 0,bottom:"-5px"}),left:Wr(Wr({},G4),{left:"-5px"}),topRight:Wr(Wr({},th),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:Wr(Wr({},th),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:Wr(Wr({},th),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:Wr(Wr({},th),{left:"-10px",top:"-10px",cursor:"nw-resize"})},kY=function(e){CY(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 h.createElement("div",{className:this.props.className||"",style:Wr(Wr({position:"absolute",userSelect:"none"},_Y[this.props.direction]),this.props.replaceStyles||{}),onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart},this.props.children)},t}(h.PureComponent),PY=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)}}(),Aa=globalThis&&globalThis.__assign||function(){return Aa=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},Aa.apply(this,arguments)},jY={width:"auto",height:"auto"},nh=function(e,t,n){return Math.max(Math.min(e,n),t)},q4=function(e,t){return Math.round(e/t)*t},Lc=function(e,t){return new RegExp(e,"i").test(t)},rh=function(e){return!!(e.touches&&e.touches.length)},IY=function(e){return!!((e.clientX||e.clientX===0)&&(e.clientY||e.clientY===0))},Y4=function(e,t,n){n===void 0&&(n=0);var r=t.reduce(function(s,a,l){return Math.abs(a-e)<Math.abs(t[s]-e)?l:s},0),o=Math.abs(t[r]-e);return n===0||o<n?t[r]:e},C1=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"},oh=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},EY=function(e,t,n,r,o,s,a){return r=oh(r,e.width,t,n),o=oh(o,e.height,t,n),s=oh(s,e.width,t,n),a=oh(a,e.height,t,n),{maxWidth:typeof r>"u"?void 0:Number(r),maxHeight:typeof o>"u"?void 0:Number(o),minWidth:typeof s>"u"?void 0:Number(s),minHeight:typeof a>"u"?void 0:Number(a)}},OY=["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"],K4="__resizable_base__",TY=function(e){PY(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(K4):s.className+=K4,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||jY},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var n=0,r=0;if(this.resizable&&this.window){var o=this.resizable.offsetWidth,s=this.resizable.offsetHeight,a=this.resizable.style.position;a!=="relative"&&(this.resizable.style.position="relative"),n=this.resizable.style.width!=="auto"?this.resizable.offsetWidth:o,r=this.resizable.style.height!=="auto"?this.resizable.offsetHeight:s,this.resizable.style.position=a}return{width:n,height:r}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var n=this,r=this.props.size,o=function(l){if(typeof n.state[l]>"u"||n.state[l]==="auto")return"auto";if(n.propsSize&&n.propsSize[l]&&n.propsSize[l].toString().endsWith("%")){if(n.state[l].toString().endsWith("%"))return n.state[l].toString();var u=n.getParentSize(),f=Number(n.state[l].toString().replace("px","")),p=f/u[l]*100;return p+"%"}return C1(n.state[l])},s=r&&typeof r.width<"u"&&!this.state.isResizing?C1(r.width):o("width"),a=r&&typeof r.height<"u"&&!this.state.isResizing?C1(r.height):o("height");return{width:s,height:a}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var n=this.appendBase();if(!n)return{width:0,height:0};var r=!1,o=this.parentNode.style.flexWrap;o!=="wrap"&&(r=!0,this.parentNode.style.flexWrap="wrap"),n.style.position="relative",n.style.minWidth="100%",n.style.minHeight="100%";var s={width:n.offsetWidth,height:n.offsetHeight};return r&&(this.parentNode.style.flexWrap=o),this.removeBase(n),s},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},t.prototype.componentDidMount=function(){if(!(!this.resizable||!this.window)){var n=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:n.flexBasis!=="auto"?n.flexBasis:void 0})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(n,r){var o=this.propsSize&&this.propsSize[r];return this.state[r]==="auto"&&this.state.original[r]===n&&(typeof o>"u"||o==="auto")?"auto":n},t.prototype.calculateNewMaxFromBoundary=function(n,r){var o=this.props.boundsByDirection,s=this.state.direction,a=o&&Lc("left",s),l=o&&Lc("top",s),u,f;if(this.props.bounds==="parent"){var p=this.parentNode;p&&(u=a?this.resizableRight-this.parentLeft:p.offsetWidth+(this.parentLeft-this.resizableLeft),f=l?this.resizableBottom-this.parentTop:p.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(u=a?this.resizableRight:this.window.innerWidth-this.resizableLeft,f=l?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(u=a?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),f=l?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return u&&Number.isFinite(u)&&(n=n&&n<u?n:u),f&&Number.isFinite(f)&&(r=r&&r<f?r:f),{maxWidth:n,maxHeight:r}},t.prototype.calculateNewSizeFromDirection=function(n,r){var o=this.props.scale||1,s=this.props.resizeRatio||1,a=this.state,l=a.direction,u=a.original,f=this.props,p=f.lockAspectRatio,m=f.lockAspectRatioExtraHeight,v=f.lockAspectRatioExtraWidth,y=u.width,S=u.height,x=m||0,w=v||0;return Lc("right",l)&&(y=u.width+(n-u.x)*s/o,p&&(S=(y-w)/this.ratio+x)),Lc("left",l)&&(y=u.width-(n-u.x)*s/o,p&&(S=(y-w)/this.ratio+x)),Lc("bottom",l)&&(S=u.height+(r-u.y)*s/o,p&&(y=(S-x)*this.ratio+w)),Lc("top",l)&&(S=u.height-(r-u.y)*s/o,p&&(y=(S-x)*this.ratio+w)),{newWidth:y,newHeight:S}},t.prototype.calculateNewSizeFromAspectRatio=function(n,r,o,s){var a=this.props,l=a.lockAspectRatio,u=a.lockAspectRatioExtraHeight,f=a.lockAspectRatioExtraWidth,p=typeof s.width>"u"?10:s.width,m=typeof o.width>"u"||o.width<0?n:o.width,v=typeof s.height>"u"?10:s.height,y=typeof o.height>"u"||o.height<0?r:o.height,S=u||0,x=f||0;if(l){var w=(v-S)*this.ratio+x,_=(y-S)*this.ratio+x,k=(p-x)/this.ratio+S,P=(m-x)/this.ratio+S,I=Math.max(p,w),j=Math.min(m,_),E=Math.max(v,k),T=Math.min(y,P);n=nh(n,I,j),r=nh(r,E,T)}else n=nh(n,p,m),r=nh(r,v,y);return{newWidth:n,newHeight:r}},t.prototype.setBoundingClientRect=function(){if(this.props.bounds==="parent"){var n=this.parentNode;if(n){var r=n.getBoundingClientRect();this.parentLeft=r.left,this.parentTop=r.top}}if(this.props.bounds&&typeof this.props.bounds!="string"){var o=this.props.bounds.getBoundingClientRect();this.targetLeft=o.left,this.targetTop=o.top}if(this.resizable){var s=this.resizable.getBoundingClientRect(),a=s.left,l=s.top,u=s.right,f=s.bottom;this.resizableLeft=a,this.resizableRight=u,this.resizableTop=l,this.resizableBottom=f}},t.prototype.onResizeStart=function(n,r){if(!(!this.resizable||!this.window)){var o=0,s=0;if(n.nativeEvent&&IY(n.nativeEvent)?(o=n.nativeEvent.clientX,s=n.nativeEvent.clientY):n.nativeEvent&&rh(n.nativeEvent)&&(o=n.nativeEvent.touches[0].clientX,s=n.nativeEvent.touches[0].clientY),this.props.onResizeStart&&this.resizable){var a=this.props.onResizeStart(n,r,this.resizable);if(a===!1)return}this.props.size&&(typeof this.props.size.height<"u"&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),typeof this.props.size.width<"u"&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio=typeof this.props.lockAspectRatio=="number"?this.props.lockAspectRatio:this.size.width/this.size.height;var l,u=this.window.getComputedStyle(this.resizable);if(u.flexBasis!=="auto"){var f=this.parentNode;if(f){var p=this.window.getComputedStyle(f).flexDirection;this.flexDir=p.startsWith("row")?"row":"column",l=u.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var m={original:{x:o,y:s,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:Aa(Aa({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(n.target).cursor||"auto"}),direction:r,flexBasis:l};this.setState(m)}},t.prototype.onMouseMove=function(n){var r=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&rh(n))try{n.preventDefault(),n.stopPropagation()}catch{}var o=this.props,s=o.maxWidth,a=o.maxHeight,l=o.minWidth,u=o.minHeight,f=rh(n)?n.touches[0].clientX:n.clientX,p=rh(n)?n.touches[0].clientY:n.clientY,m=this.state,v=m.direction,y=m.original,S=m.width,x=m.height,w=this.getParentSize(),_=EY(w,this.window.innerWidth,this.window.innerHeight,s,a,l,u);s=_.maxWidth,a=_.maxHeight,l=_.minWidth,u=_.minHeight;var k=this.calculateNewSizeFromDirection(f,p),P=k.newHeight,I=k.newWidth,j=this.calculateNewMaxFromBoundary(s,a);this.props.snap&&this.props.snap.x&&(I=Y4(I,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(P=Y4(P,this.props.snap.y,this.props.snapGap));var E=this.calculateNewSizeFromAspectRatio(I,P,{width:j.maxWidth,height:j.maxHeight},{width:l,height:u});if(I=E.newWidth,P=E.newHeight,this.props.grid){var T=q4(I,this.props.grid[0]),R=q4(P,this.props.grid[1]),M=this.props.snapGap||0;I=M===0||Math.abs(T-I)<=M?T:I,P=M===0||Math.abs(R-P)<=M?R:P}var D={width:I-y.width,height:P-y.height};if(S&&typeof S=="string"){if(S.endsWith("%")){var N=I/w.width*100;I=N+"%"}else if(S.endsWith("vw")){var U=I/this.window.innerWidth*100;I=U+"vw"}else if(S.endsWith("vh")){var z=I/this.window.innerHeight*100;I=z+"vh"}}if(x&&typeof x=="string"){if(x.endsWith("%")){var N=P/w.height*100;P=N+"%"}else if(x.endsWith("vw")){var U=P/this.window.innerWidth*100;P=U+"vw"}else if(x.endsWith("vh")){var z=P/this.window.innerHeight*100;P=z+"vh"}}var F={width:this.createSizeForCssProperty(I,"width"),height:this.createSizeForCssProperty(P,"height")};this.flexDir==="row"?F.flexBasis=F.width:this.flexDir==="column"&&(F.flexBasis=F.height),_g.flushSync(function(){r.setState(F)}),this.props.onResize&&this.props.onResize(n,v,this.resizable,D)}},t.prototype.onMouseUp=function(n){var r=this.state,o=r.isResizing,s=r.direction,a=r.original;if(!(!o||!this.resizable)){var l={width:this.size.width-a.width,height:this.size.height-a.height};this.props.onResizeStop&&this.props.onResizeStop(n,s,this.resizable,l),this.props.size&&this.setState(this.props.size),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:Aa(Aa({},this.state.backgroundStyle),{cursor:"auto"})})}},t.prototype.updateSize=function(n){this.setState({width:n.width,height:n.height})},t.prototype.renderResizer=function(){var n=this,r=this.props,o=r.enable,s=r.handleStyles,a=r.handleClasses,l=r.handleWrapperStyle,u=r.handleWrapperClass,f=r.handleComponent;if(!o)return null;var p=Object.keys(o).map(function(m){return o[m]!==!1?h.createElement(kY,{key:m,direction:m,onResizeStart:n.onResizeStart,replaceStyles:s&&s[m],className:a&&a[m]},f&&f[m]?f[m]:null):null});return h.createElement("div",{className:u,style:l},p)},t.prototype.render=function(){var n=this,r=Object.keys(this.props).reduce(function(a,l){return OY.indexOf(l)!==-1||(a[l]=n.props[l]),a},{}),o=Aa(Aa(Aa({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 h.createElement(s,Aa({ref:this.ref,style:o,className:this.props.className},r),this.state.isResizing&&h.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}(h.PureComponent);const RY=({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"}),MY=({direction:e,minWidth:t,maxWidth:n,minHeight:r,maxHeight:o})=>{const s=t??(["left","right"].includes(e)?10:void 0),a=n??(["left","right"].includes(e)?"95vw":void 0),l=r??(["top","bottom"].includes(e)?10:void 0),u=o??(["top","bottom"].includes(e)?"95vh":void 0);return{...s?{minWidth:s}:{},...a?{maxWidth:a}:{},...l?{minHeight:l}:{},...u?{maxHeight:u}:{}}},ai="0.75rem",sh="1rem",md="5px",DY=({isResizable:e,direction:t})=>{const n=`calc((2 * ${ai} + ${md}) / -2)`;return t==="top"?{containerStyles:{borderBottomWidth:md,paddingBottom:sh},handleStyles:e?{top:{paddingTop:ai,paddingBottom:ai,bottom:n}}:{}}:t==="left"?{containerStyles:{borderInlineEndWidth:md,paddingInlineEnd:sh},handleStyles:e?{right:{paddingInlineStart:ai,paddingInlineEnd:ai,insetInlineEnd:n}}:{}}:t==="bottom"?{containerStyles:{borderTopWidth:md,paddingTop:sh},handleStyles:e?{bottom:{paddingTop:ai,paddingBottom:ai,top:n}}:{}}:t==="right"?{containerStyles:{borderInlineStartWidth:md,paddingInlineStart:sh},handleStyles:e?{left:{paddingInlineStart:ai,paddingInlineEnd:ai,insetInlineStart:n}}:{}}:{containerStyles:{},handleStyles:{}}},AY=(e,t)=>["top","bottom"].includes(e)?e:e==="left"?t==="rtl"?"right":"left":e==="right"?t==="rtl"?"left":"right":"left",NY=Oe(TY,{shouldForwardProp:e=>!["sx"].includes(e)}),jE=({direction:e="left",isResizable:t,isOpen:n,onClose:r,children:o,initialWidth:s,minWidth:a,maxWidth:l,initialHeight:u,minHeight:f,maxHeight:p,onResizeStart:m,onResizeStop:v,onResize:y,sx:S={}})=>{const x=Au().direction,{colorMode:w}=fo(),_=h.useRef(null),k=h.useMemo(()=>s??a??(["left","right"].includes(e)?"auto":"100%"),[s,a,e]),P=h.useMemo(()=>u??f??(["top","bottom"].includes(e)?"auto":"100%"),[u,f,e]),[I,j]=h.useState(k),[E,T]=h.useState(P);rz({ref:_,handler:()=>{r()},enabled:n});const R=h.useMemo(()=>t?RY({direction:e,langDirection:x}):{},[t,x,e]),M=h.useMemo(()=>MY({direction:e,minWidth:a,maxWidth:l,minHeight:f,maxHeight:p}),[a,l,f,p,e]),{containerStyles:D,handleStyles:N}=h.useMemo(()=>DY({isResizable:t,direction:e}),[t,e]),U=h.useMemo(()=>AY(e,x),[e,x]);return h.useEffect(()=>{["left","right"].includes(e)&&T("100vh"),["top","bottom"].includes(e)&&j("100vw")},[e]),i.jsx(sP,{direction:U,in:n,motionProps:{initial:!1},style:{width:"full"},children:i.jsx(et,{ref:_,sx:{width:"full",height:"full"},children:i.jsx(NY,{size:{width:t?I:k,height:t?E:P},enable:R,handleStyles:N,...M,sx:{borderColor:Ae("base.200","base.800")(w),p:4,bg:Ae("base.100","base.900")(w),height:"full",shadow:n?"dark-lg":void 0,...D,...S},onResizeStart:(z,F,H)=>{m&&m(z,F,H)},onResize:(z,F,H,G)=>{y&&y(z,F,H,G)},onResizeStop:(z,F,H,G)=>{["left","right"].includes(F)&&j(Number(I)+G.width),["top","bottom"].includes(F)&&T(Number(E)+G.height),v&&v(z,F,H,G)},children:o})})})},zY=Te([Gr,po,pl,jr,av],(e,t,n,r,o)=>{const{shouldPinGallery:s,shouldShowGallery:a}=t,{galleryImageMinimumWidth:l}=n,{isLightboxOpen:u}=o;return{activeTabName:e,isStaging:r,shouldPinGallery:s,shouldShowGallery:a,galleryImageMinimumWidth:l,isResizable:e!=="unifiedCanvas",isLightboxOpen:u}},{memoizeOptions:{resultEqualityCheck:Ut}}),$Y=()=>{const e=ue(),{shouldPinGallery:t,shouldShowGallery:n,galleryImageMinimumWidth:r}=q(zY),o=()=>{e(K1(!1)),t&&e(Bs())};nt("esc",()=>{e(K1(!1))},{enabled:()=>!t,preventDefault:!0},[t]);const s=32;return nt("shift+up",()=>{if(r<256){const a=ma(r+s,32,256);e(Kh(a))}},[r]),nt("shift+down",()=>{if(r>32){const a=ma(r-s,32,256);e(Kh(a))}},[r]),t?null:i.jsx(jE,{direction:"right",isResizable:!0,isOpen:n,onClose:o,minWidth:337,children:i.jsx(PE,{})})},LY=h.memo($Y),IE=e=>e.postprocessing;function BY(e){const t=h.createContext(null);return[({children:o,value:s})=>B.createElement(t.Provider,{value:s},o),()=>{const o=h.useContext(t);if(o===null)throw new Error(e);return o}]}function EE(e){return Array.isArray(e)?e:[e]}const FY=()=>{};function HY(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||FY:n=>{var r;n.key==="Escape"&&(e(n),(r=t.onTrigger)==null||r.call(t))}}function OE({data:e}){const t=[],n=[],r=e.reduce((o,s,a)=>(s.group?o[s.group]?o[s.group].push(a):o[s.group]=[a]:n.push(a),o),{});return Object.keys(r).forEach(o=>{t.push(...r[o].map(s=>e[s]))}),t.push(...n.map(o=>e[o])),t}function TE(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==B.Fragment:!1}function RE(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=RE(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function ME(){for(var e=0,t,n,r="";e<arguments.length;)(t=arguments[e++])&&(n=RE(t))&&(r&&(r+=" "),r+=n);return r}const VY={app:100,modal:200,popover:300,overlay:400,max:9999};function Vb(e){return VY[e]}function WY(e,t){const n=h.useRef();return(!n.current||t.length!==n.current.prevDeps.length||n.current.prevDeps.map((r,o)=>r===t[o]).indexOf(!1)>=0)&&(n.current={v:e(),prevDeps:[...t]}),n.current.v}const UY=DM({key:"mantine",prepend:!0});function GY(){return X5()||UY}var qY=Object.defineProperty,X4=Object.getOwnPropertySymbols,YY=Object.prototype.hasOwnProperty,KY=Object.prototype.propertyIsEnumerable,Z4=(e,t,n)=>t in e?qY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,XY=(e,t)=>{for(var n in t||(t={}))YY.call(t,n)&&Z4(e,n,t[n]);if(X4)for(var n of X4(t))KY.call(t,n)&&Z4(e,n,t[n]);return e};const _1="ref";function ZY(e){let t;if(e.length!==1)return{args:e,ref:t};const[n]=e;if(!(n instanceof Object))return{args:e,ref:t};if(!(_1 in n))return{args:e,ref:t};t=n[_1];const r=XY({},n);return delete r[_1],{args:[r],ref:t}}const{cssFactory:QY}=(()=>{function e(n,r,o){const s=[],a=zM(n,s,o);return s.length<2?o:a+r(s)}function t(n){const{cache:r}=n,o=(...a)=>{const{ref:l,args:u}=ZY(a),f=AM(u,r.registered);return NM(r,f,!1),`${r.key}-${f.name}${l===void 0?"":` ${l}`}`};return{css:o,cx:(...a)=>e(r.registered,o,ME(a))}}return{cssFactory:t}})();function DE(){const e=GY();return WY(()=>QY({cache:e}),[e])}function JY({cx:e,classes:t,context:n,classNames:r,name:o,cache:s}){const a=n.reduce((l,u)=>(Object.keys(u.classNames).forEach(f=>{typeof l[f]!="string"?l[f]=`${u.classNames[f]}`:l[f]=`${l[f]} ${u.classNames[f]}`}),l),{});return Object.keys(t).reduce((l,u)=>(l[u]=e(t[u],a[u],r!=null&&r[u],Array.isArray(o)?o.filter(Boolean).map(f=>`${(s==null?void 0:s.key)||"mantine"}-${f}-${u}`).join(" "):o?`${(s==null?void 0:s.key)||"mantine"}-${o}-${u}`:null),l),{})}var eK=Object.defineProperty,Q4=Object.getOwnPropertySymbols,tK=Object.prototype.hasOwnProperty,nK=Object.prototype.propertyIsEnumerable,J4=(e,t,n)=>t in e?eK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,k1=(e,t)=>{for(var n in t||(t={}))tK.call(t,n)&&J4(e,n,t[n]);if(Q4)for(var n of Q4(t))nK.call(t,n)&&J4(e,n,t[n]);return e};function Vy(e,t){return t&&Object.keys(t).forEach(n=>{e[n]?e[n]=k1(k1({},e[n]),t[n]):e[n]=k1({},t[n])}),e}function e_(e,t,n,r){const o=s=>typeof s=="function"?s(t,n||{},r):s||{};return Array.isArray(e)?e.map(s=>o(s.styles)).reduce((s,a)=>Vy(s,a),{}):o(e)}function rK({ctx:e,theme:t,params:n,variant:r,size:o}){return e.reduce((s,a)=>(a.variants&&r in a.variants&&Vy(s,a.variants[r](t,n,{variant:r,size:o})),a.sizes&&o in a.sizes&&Vy(s,a.sizes[o](t,n,{variant:r,size:o})),s),{})}function ko(e){const t=typeof e=="function"?e:()=>e;function n(r,o){const s=_i(),a=U9(o==null?void 0:o.name),l=X5(),u={variant:o==null?void 0:o.variant,size:o==null?void 0:o.size},{css:f,cx:p}=DE(),m=t(s,r,u),v=e_(o==null?void 0:o.styles,s,r,u),y=e_(a,s,r,u),S=rK({ctx:a,theme:s,params:r,variant:o==null?void 0:o.variant,size:o==null?void 0:o.size}),x=Object.fromEntries(Object.keys(m).map(w=>{const _=p({[f(m[w])]:!(o!=null&&o.unstyled)},f(S[w]),f(y[w]),f(v[w]));return[w,_]}));return{classes:JY({cx:p,classes:x,context:a,classNames:o==null?void 0:o.classNames,name:o==null?void 0:o.name,cache:l}),cx:p,theme:s}}return n}function t_(e){return`___ref-${e||""}`}var oK=Object.defineProperty,sK=Object.defineProperties,aK=Object.getOwnPropertyDescriptors,n_=Object.getOwnPropertySymbols,iK=Object.prototype.hasOwnProperty,lK=Object.prototype.propertyIsEnumerable,r_=(e,t,n)=>t in e?oK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gd=(e,t)=>{for(var n in t||(t={}))iK.call(t,n)&&r_(e,n,t[n]);if(n_)for(var n of n_(t))lK.call(t,n)&&r_(e,n,t[n]);return e},vd=(e,t)=>sK(e,aK(t));const yd={in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${qe(10)})`},transitionProperty:"transform, opacity"},ah={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},scale:{in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:"scale(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-y":{in:{opacity:1,transform:"scaleY(1)"},out:{opacity:0,transform:"scaleY(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-x":{in:{opacity:1,transform:"scaleX(1)"},out:{opacity:0,transform:"scaleX(0)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"skew-up":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:`translateY(-${qe(20)}) skew(-10deg, -5deg)`},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"skew-down":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:`translateY(${qe(20)}) skew(-10deg, -5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-left":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${qe(20)}) rotate(-5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${qe(20)}) rotate(5deg)`},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-100%)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(100%)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"slide-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(100%)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"slide-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-100%)"},common:{transformOrigin:"right"},transitionProperty:"transform, opacity"},pop:vd(gd({},yd),{common:{transformOrigin:"center center"}}),"pop-bottom-left":vd(gd({},yd),{common:{transformOrigin:"bottom left"}}),"pop-bottom-right":vd(gd({},yd),{common:{transformOrigin:"bottom right"}}),"pop-top-left":vd(gd({},yd),{common:{transformOrigin:"top left"}}),"pop-top-right":vd(gd({},yd),{common:{transformOrigin:"top right"}})},o_=["mousedown","touchstart"];function cK(e,t,n){const r=h.useRef();return h.useEffect(()=>{const o=s=>{const{target:a}=s??{};if(Array.isArray(n)){const l=(a==null?void 0:a.hasAttribute("data-ignore-outside-clicks"))||!document.body.contains(a)&&a.tagName!=="HTML";n.every(f=>!!f&&!s.composedPath().includes(f))&&!l&&e()}else r.current&&!r.current.contains(a)&&e()};return(t||o_).forEach(s=>document.addEventListener(s,o)),()=>{(t||o_).forEach(s=>document.removeEventListener(s,o))}},[r,e,n]),r}function uK(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function dK(e,t){return typeof t=="boolean"?t:typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function fK(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,o]=h.useState(n?t:dK(e,t)),s=h.useRef();return h.useEffect(()=>{if("matchMedia"in window)return s.current=window.matchMedia(e),o(s.current.matches),uK(s.current,a=>o(a.matches))},[e]),r}const AE=typeof document<"u"?h.useLayoutEffect:h.useEffect;function fa(e,t){const n=h.useRef(!1);h.useEffect(()=>()=>{n.current=!1},[]),h.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function pK({opened:e,shouldReturnFocus:t=!0}){const n=h.useRef(),r=()=>{var o;n.current&&"focus"in n.current&&typeof n.current.focus=="function"&&((o=n.current)==null||o.focus({preventScroll:!0}))};return fa(()=>{let o=-1;const s=a=>{a.key==="Tab"&&window.clearTimeout(o)};return document.addEventListener("keydown",s),e?n.current=document.activeElement:t&&(o=window.setTimeout(r,10)),()=>{window.clearTimeout(o),document.removeEventListener("keydown",s)}},[e,t]),r}const hK=/input|select|textarea|button|object/,NE="a, input, select, textarea, button, object, [tabindex]";function mK(e){return e.style.display==="none"}function gK(e){if(e.getAttribute("aria-hidden")||e.getAttribute("hidden")||e.getAttribute("type")==="hidden")return!1;let n=e;for(;n&&!(n===document.body||n.nodeType===11);){if(mK(n))return!1;n=n.parentNode}return!0}function zE(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function Wy(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(zE(e));return(hK.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&gK(e)}function $E(e){const t=zE(e);return(Number.isNaN(t)||t>=0)&&Wy(e)}function vK(e){return Array.from(e.querySelectorAll(NE)).filter($E)}function yK(e,t){const n=vK(e);if(!n.length){t.preventDefault();return}const r=n[t.shiftKey?0:n.length-1],o=e.getRootNode();if(!(r===o.activeElement||e===o.activeElement))return;t.preventDefault();const a=n[t.shiftKey?n.length-1:0];a&&a.focus()}function Wb(){return`mantine-${Math.random().toString(36).slice(2,11)}`}function xK(e,t="body > :not(script)"){const n=Wb(),r=Array.from(document.querySelectorAll(t)).map(o=>{var s;if((s=o==null?void 0:o.shadowRoot)!=null&&s.contains(e)||o.contains(e))return;const a=o.getAttribute("aria-hidden"),l=o.getAttribute("data-hidden"),u=o.getAttribute("data-focus-id");return o.setAttribute("data-focus-id",n),a===null||a==="false"?o.setAttribute("aria-hidden","true"):!l&&!u&&o.setAttribute("data-hidden",a),{node:o,ariaHidden:l||null}});return()=>{r.forEach(o=>{!o||n!==o.node.getAttribute("data-focus-id")||(o.ariaHidden===null?o.node.removeAttribute("aria-hidden"):o.node.setAttribute("aria-hidden",o.ariaHidden),o.node.removeAttribute("data-focus-id"),o.node.removeAttribute("data-hidden"))})}}function bK(e=!0){const t=h.useRef(),n=h.useRef(null),r=s=>{let a=s.querySelector("[data-autofocus]");if(!a){const l=Array.from(s.querySelectorAll(NE));a=l.find($E)||l.find(Wy)||null,!a&&Wy(s)&&(a=s)}a&&a.focus({preventScroll:!0})},o=h.useCallback(s=>{if(e){if(s===null){n.current&&(n.current(),n.current=null);return}n.current=xK(s),t.current!==s&&(s?(setTimeout(()=>{s.getRootNode()&&r(s)}),t.current=s):t.current=null)}},[e]);return h.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>r(t.current));const s=a=>{a.key==="Tab"&&t.current&&yK(t.current,a)};return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s),n.current&&n.current()}},[e]),o}const wK=B["useId".toString()]||(()=>{});function SK(){const e=wK();return e?`mantine-${e.replace(/:/g,"")}`:""}function Ub(e){const t=SK(),[n,r]=h.useState(t);return AE(()=>{r(Wb())},[]),typeof e=="string"?e:typeof window>"u"?t:n}function s_(e,t,n){h.useEffect(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function CK(e,t){typeof e=="function"?e(t):typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function _K(...e){return t=>{e.forEach(n=>CK(n,t))}}function gv(...e){return h.useCallback(_K(...e),e)}function yf({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){const[o,s]=h.useState(t!==void 0?t:n),a=l=>{s(l),r==null||r(l)};return e!==void 0?[e,r,!0]:[o,a,!1]}function LE(e,t){return fK("(prefers-reduced-motion: reduce)",e,t)}const kK=e=>e<.5?2*e*e:-1+(4-2*e)*e,PK=({axis:e,target:t,parent:n,alignment:r,offset:o,isList:s})=>{if(!t||!n&&typeof document>"u")return 0;const a=!!n,u=(n||document.body).getBoundingClientRect(),f=t.getBoundingClientRect(),p=m=>f[m]-u[m];if(e==="y"){const m=p("top");if(m===0)return 0;if(r==="start"){const y=m-o;return y<=f.height*(s?0:1)||!s?y:0}const v=a?u.height:window.innerHeight;if(r==="end"){const y=m+o-v+f.height;return y>=-f.height*(s?0:1)||!s?y:0}return r==="center"?m-v/2+f.height/2:0}if(e==="x"){const m=p("left");if(m===0)return 0;if(r==="start"){const y=m-o;return y<=f.width||!s?y:0}const v=a?u.width:window.innerWidth;if(r==="end"){const y=m+o-v+f.width;return y>=-f.width||!s?y:0}return r==="center"?m-v/2+f.width/2:0}return 0},jK=({axis:e,parent:t})=>{if(!t&&typeof document>"u")return 0;const n=e==="y"?"scrollTop":"scrollLeft";if(t)return t[n];const{body:r,documentElement:o}=document;return r[n]+o[n]},IK=({axis:e,parent:t,distance:n})=>{if(!t&&typeof document>"u")return;const r=e==="y"?"scrollTop":"scrollLeft";if(t)t[r]=n;else{const{body:o,documentElement:s}=document;o[r]=n,s[r]=n}};function BE({duration:e=1250,axis:t="y",onScrollFinish:n,easing:r=kK,offset:o=0,cancelable:s=!0,isList:a=!1}={}){const l=h.useRef(0),u=h.useRef(0),f=h.useRef(!1),p=h.useRef(null),m=h.useRef(null),v=LE(),y=()=>{l.current&&cancelAnimationFrame(l.current)},S=h.useCallback(({alignment:w="start"}={})=>{var _;f.current=!1,l.current&&y();const k=(_=jK({parent:p.current,axis:t}))!=null?_:0,P=PK({parent:p.current,target:m.current,axis:t,alignment:w,offset:o,isList:a})-(p.current?0:k);function I(){u.current===0&&(u.current=performance.now());const E=performance.now()-u.current,T=v||e===0?1:E/e,R=k+P*r(T);IK({parent:p.current,axis:t,distance:R}),!f.current&&T<1?l.current=requestAnimationFrame(I):(typeof n=="function"&&n(),u.current=0,l.current=0,y())}I()},[t,e,r,a,o,n,v]),x=()=>{s&&(f.current=!0)};return s_("wheel",x,{passive:!0}),s_("touchmove",x,{passive:!0}),h.useEffect(()=>y,[]),{scrollableRef:p,targetRef:m,scrollIntoView:S,cancel:y}}var a_=Object.getOwnPropertySymbols,EK=Object.prototype.hasOwnProperty,OK=Object.prototype.propertyIsEnumerable,TK=(e,t)=>{var n={};for(var r in e)EK.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&a_)for(var r of a_(e))t.indexOf(r)<0&&OK.call(e,r)&&(n[r]=e[r]);return n};function vv(e){const t=e,{m:n,mx:r,my:o,mt:s,mb:a,ml:l,mr:u,p:f,px:p,py:m,pt:v,pb:y,pl:S,pr:x,bg:w,c:_,opacity:k,ff:P,fz:I,fw:j,lts:E,ta:T,lh:R,fs:M,tt:D,td:N,w:U,miw:z,maw:F,h:H,mih:G,mah:A,bgsz:L,bgp:W,bgr:V,bga:ee,pos:le,top:oe,left:X,bottom:Q,right:ie,inset:ve,display:ye}=t,se=TK(t,["m","mx","my","mt","mb","ml","mr","p","px","py","pt","pb","pl","pr","bg","c","opacity","ff","fz","fw","lts","ta","lh","fs","tt","td","w","miw","maw","h","mih","mah","bgsz","bgp","bgr","bga","pos","top","left","bottom","right","inset","display"]);return{systemStyles:G9({m:n,mx:r,my:o,mt:s,mb:a,ml:l,mr:u,p:f,px:p,py:m,pt:v,pb:y,pl:S,pr:x,bg:w,c:_,opacity:k,ff:P,fz:I,fw:j,lts:E,ta:T,lh:R,fs:M,tt:D,td:N,w:U,miw:z,maw:F,h:H,mih:G,mah:A,bgsz:L,bgp:W,bgr:V,bga:ee,pos:le,top:oe,left:X,bottom:Q,right:ie,inset:ve,display:ye}),rest:se}}function RK(e,t){const n=Object.keys(e).filter(r=>r!=="base").sort((r,o)=>NS(Kt({size:r,sizes:t.breakpoints}))-NS(Kt({size:o,sizes:t.breakpoints})));return"base"in e?["base",...n]:n}function MK({value:e,theme:t,getValue:n,property:r}){if(e==null)return;if(typeof e=="object")return RK(e,t).reduce((a,l)=>{if(l==="base"&&e.base!==void 0){const f=n(e.base,t);return Array.isArray(r)?(r.forEach(p=>{a[p]=f}),a):(a[r]=f,a)}const u=n(e[l],t);return Array.isArray(r)?(a[t.fn.largerThan(l)]={},r.forEach(f=>{a[t.fn.largerThan(l)][f]=u}),a):(a[t.fn.largerThan(l)]={[r]:u},a)},{});const o=n(e,t);return Array.isArray(r)?r.reduce((s,a)=>(s[a]=o,s),{}):{[r]:o}}function DK(e,t){return e==="dimmed"?t.colorScheme==="dark"?t.colors.dark[2]:t.colors.gray[6]:t.fn.variant({variant:"filled",color:e,primaryFallback:!1}).background}function AK(e){return qe(e)}function NK(e){return e}function zK(e,t){return Kt({size:e,sizes:t.fontSizes})}const $K=["-xs","-sm","-md","-lg","-xl"];function LK(e,t){return $K.includes(e)?`calc(${Kt({size:e.replace("-",""),sizes:t.spacing})} * -1)`:Kt({size:e,sizes:t.spacing})}const BK={identity:NK,color:DK,size:AK,fontSize:zK,spacing:LK},FK={m:{type:"spacing",property:"margin"},mt:{type:"spacing",property:"marginTop"},mb:{type:"spacing",property:"marginBottom"},ml:{type:"spacing",property:"marginLeft"},mr:{type:"spacing",property:"marginRight"},mx:{type:"spacing",property:["marginRight","marginLeft"]},my:{type:"spacing",property:["marginTop","marginBottom"]},p:{type:"spacing",property:"padding"},pt:{type:"spacing",property:"paddingTop"},pb:{type:"spacing",property:"paddingBottom"},pl:{type:"spacing",property:"paddingLeft"},pr:{type:"spacing",property:"paddingRight"},px:{type:"spacing",property:["paddingRight","paddingLeft"]},py:{type:"spacing",property:["paddingTop","paddingBottom"]},bg:{type:"color",property:"background"},c:{type:"color",property:"color"},opacity:{type:"identity",property:"opacity"},ff:{type:"identity",property:"fontFamily"},fz:{type:"fontSize",property:"fontSize"},fw:{type:"identity",property:"fontWeight"},lts:{type:"size",property:"letterSpacing"},ta:{type:"identity",property:"textAlign"},lh:{type:"identity",property:"lineHeight"},fs:{type:"identity",property:"fontStyle"},tt:{type:"identity",property:"textTransform"},td:{type:"identity",property:"textDecoration"},w:{type:"spacing",property:"width"},miw:{type:"spacing",property:"minWidth"},maw:{type:"spacing",property:"maxWidth"},h:{type:"spacing",property:"height"},mih:{type:"spacing",property:"minHeight"},mah:{type:"spacing",property:"maxHeight"},bgsz:{type:"size",property:"backgroundSize"},bgp:{type:"identity",property:"backgroundPosition"},bgr:{type:"identity",property:"backgroundRepeat"},bga:{type:"identity",property:"backgroundAttachment"},pos:{type:"identity",property:"position"},top:{type:"identity",property:"top"},left:{type:"size",property:"left"},bottom:{type:"size",property:"bottom"},right:{type:"size",property:"right"},inset:{type:"size",property:"inset"},display:{type:"identity",property:"display"}};var HK=Object.defineProperty,i_=Object.getOwnPropertySymbols,VK=Object.prototype.hasOwnProperty,WK=Object.prototype.propertyIsEnumerable,l_=(e,t,n)=>t in e?HK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,c_=(e,t)=>{for(var n in t||(t={}))VK.call(t,n)&&l_(e,n,t[n]);if(i_)for(var n of i_(t))WK.call(t,n)&&l_(e,n,t[n]);return e};function u_(e,t,n=FK){return Object.keys(n).reduce((o,s)=>(s in e&&e[s]!==void 0&&o.push(MK({value:e[s],getValue:BK[n[s].type],property:n[s].property,theme:t})),o),[]).reduce((o,s)=>(Object.keys(s).forEach(a=>{typeof s[a]=="object"&&s[a]!==null&&a in o?o[a]=c_(c_({},o[a]),s[a]):o[a]=s[a]}),o),{})}function d_(e,t){return typeof e=="function"?e(t):e}function UK(e,t,n){const r=_i(),{css:o,cx:s}=DE();return Array.isArray(e)?s(n,o(u_(t,r)),e.map(a=>o(d_(a,r)))):s(n,o(d_(e,r)),o(u_(t,r)))}var GK=Object.defineProperty,Om=Object.getOwnPropertySymbols,FE=Object.prototype.hasOwnProperty,HE=Object.prototype.propertyIsEnumerable,f_=(e,t,n)=>t in e?GK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qK=(e,t)=>{for(var n in t||(t={}))FE.call(t,n)&&f_(e,n,t[n]);if(Om)for(var n of Om(t))HE.call(t,n)&&f_(e,n,t[n]);return e},YK=(e,t)=>{var n={};for(var r in e)FE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Om)for(var r of Om(e))t.indexOf(r)<0&&HE.call(e,r)&&(n[r]=e[r]);return n};const VE=h.forwardRef((e,t)=>{var n=e,{className:r,component:o,style:s,sx:a}=n,l=YK(n,["className","component","style","sx"]);const{systemStyles:u,rest:f}=vv(l),p=o||"div";return B.createElement(p,qK({ref:t,className:UK(a,u,r),style:s},f))});VE.displayName="@mantine/core/Box";const Yo=VE;var KK=Object.defineProperty,XK=Object.defineProperties,ZK=Object.getOwnPropertyDescriptors,p_=Object.getOwnPropertySymbols,QK=Object.prototype.hasOwnProperty,JK=Object.prototype.propertyIsEnumerable,h_=(e,t,n)=>t in e?KK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,m_=(e,t)=>{for(var n in t||(t={}))QK.call(t,n)&&h_(e,n,t[n]);if(p_)for(var n of p_(t))JK.call(t,n)&&h_(e,n,t[n]);return e},eX=(e,t)=>XK(e,ZK(t)),tX=ko(e=>({root:eX(m_(m_({},e.fn.focusStyles()),e.fn.fontStyles()),{cursor:"pointer",border:0,padding:0,appearance:"none",fontSize:e.fontSizes.md,backgroundColor:"transparent",textAlign:"left",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,textDecoration:"none",boxSizing:"border-box"})}));const nX=tX;var rX=Object.defineProperty,Tm=Object.getOwnPropertySymbols,WE=Object.prototype.hasOwnProperty,UE=Object.prototype.propertyIsEnumerable,g_=(e,t,n)=>t in e?rX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,oX=(e,t)=>{for(var n in t||(t={}))WE.call(t,n)&&g_(e,n,t[n]);if(Tm)for(var n of Tm(t))UE.call(t,n)&&g_(e,n,t[n]);return e},sX=(e,t)=>{var n={};for(var r in e)WE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Tm)for(var r of Tm(e))t.indexOf(r)<0&&UE.call(e,r)&&(n[r]=e[r]);return n};const GE=h.forwardRef((e,t)=>{const n=qr("UnstyledButton",{},e),{className:r,component:o="button",unstyled:s,variant:a}=n,l=sX(n,["className","component","unstyled","variant"]),{classes:u,cx:f}=nX(null,{name:"UnstyledButton",unstyled:s,variant:a});return B.createElement(Yo,oX({component:o,ref:t,className:f(u.root,r),type:o==="button"?"button":void 0},l))});GE.displayName="@mantine/core/UnstyledButton";const aX=GE;var iX=Object.defineProperty,lX=Object.defineProperties,cX=Object.getOwnPropertyDescriptors,v_=Object.getOwnPropertySymbols,uX=Object.prototype.hasOwnProperty,dX=Object.prototype.propertyIsEnumerable,y_=(e,t,n)=>t in e?iX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Uy=(e,t)=>{for(var n in t||(t={}))uX.call(t,n)&&y_(e,n,t[n]);if(v_)for(var n of v_(t))dX.call(t,n)&&y_(e,n,t[n]);return e},x_=(e,t)=>lX(e,cX(t));const fX=["subtle","filled","outline","light","default","transparent","gradient"],ih={xs:qe(18),sm:qe(22),md:qe(28),lg:qe(34),xl:qe(44)};function pX({variant:e,theme:t,color:n,gradient:r}){const o=t.fn.variant({color:n,variant:e,gradient:r});return e==="gradient"?{border:0,backgroundImage:o.background,color:o.color,"&:hover":t.fn.hover({backgroundSize:"200%"})}:fX.includes(e)?Uy({border:`${qe(1)} solid ${o.border}`,backgroundColor:o.background,color:o.color},t.fn.hover({backgroundColor:o.hover})):null}var hX=ko((e,{radius:t,color:n,gradient:r},{variant:o,size:s})=>({root:x_(Uy({position:"relative",borderRadius:e.fn.radius(t),padding:0,lineHeight:1,display:"flex",alignItems:"center",justifyContent:"center",height:Kt({size:s,sizes:ih}),minHeight:Kt({size:s,sizes:ih}),width:Kt({size:s,sizes:ih}),minWidth:Kt({size:s,sizes:ih})},pX({variant:o,theme:e,color:n,gradient:r})),{"&:active":e.activeStyles,"& [data-action-icon-loader]":{maxWidth:"70%"},"&:disabled, &[data-disabled]":{color:e.colors.gray[e.colorScheme==="dark"?6:4],cursor:"not-allowed",backgroundColor:o==="transparent"?void 0:e.fn.themeColor("gray",e.colorScheme==="dark"?8:1),borderColor:o==="transparent"?void 0:e.fn.themeColor("gray",e.colorScheme==="dark"?8:1),backgroundImage:"none",pointerEvents:"none","&:active":{transform:"none"}},"&[data-loading]":{pointerEvents:"none","&::before":x_(Uy({content:'""'},e.fn.cover(qe(-1))),{backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.colors.dark[7],.5):"rgba(255, 255, 255, .5)",borderRadius:e.fn.radius(t),cursor:"not-allowed"})}})}));const mX=hX;var gX=Object.defineProperty,Rm=Object.getOwnPropertySymbols,qE=Object.prototype.hasOwnProperty,YE=Object.prototype.propertyIsEnumerable,b_=(e,t,n)=>t in e?gX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vX=(e,t)=>{for(var n in t||(t={}))qE.call(t,n)&&b_(e,n,t[n]);if(Rm)for(var n of Rm(t))YE.call(t,n)&&b_(e,n,t[n]);return e},yX=(e,t)=>{var n={};for(var r in e)qE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Rm)for(var r of Rm(e))t.indexOf(r)<0&&YE.call(e,r)&&(n[r]=e[r]);return n};function xX(e){var t=e,{size:n,color:r}=t,o=yX(t,["size","color"]);return B.createElement("svg",vX({viewBox:"0 0 135 140",xmlns:"http://www.w3.org/2000/svg",fill:r,width:n},o),B.createElement("rect",{y:"10",width:"15",height:"120",rx:"6"},B.createElement("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),B.createElement("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),B.createElement("rect",{x:"30",y:"10",width:"15",height:"120",rx:"6"},B.createElement("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),B.createElement("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),B.createElement("rect",{x:"60",width:"15",height:"140",rx:"6"},B.createElement("animate",{attributeName:"height",begin:"0s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),B.createElement("animate",{attributeName:"y",begin:"0s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),B.createElement("rect",{x:"90",y:"10",width:"15",height:"120",rx:"6"},B.createElement("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),B.createElement("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),B.createElement("rect",{x:"120",y:"10",width:"15",height:"120",rx:"6"},B.createElement("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),B.createElement("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})))}var bX=Object.defineProperty,Mm=Object.getOwnPropertySymbols,KE=Object.prototype.hasOwnProperty,XE=Object.prototype.propertyIsEnumerable,w_=(e,t,n)=>t in e?bX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wX=(e,t)=>{for(var n in t||(t={}))KE.call(t,n)&&w_(e,n,t[n]);if(Mm)for(var n of Mm(t))XE.call(t,n)&&w_(e,n,t[n]);return e},SX=(e,t)=>{var n={};for(var r in e)KE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Mm)for(var r of Mm(e))t.indexOf(r)<0&&XE.call(e,r)&&(n[r]=e[r]);return n};function CX(e){var t=e,{size:n,color:r}=t,o=SX(t,["size","color"]);return B.createElement("svg",wX({width:n,height:n,viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:r},o),B.createElement("g",{fill:"none",fillRule:"evenodd"},B.createElement("g",{transform:"translate(2.5 2.5)",strokeWidth:"5"},B.createElement("circle",{strokeOpacity:".5",cx:"16",cy:"16",r:"16"}),B.createElement("path",{d:"M32 16c0-9.94-8.06-16-16-16"},B.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 16 16",to:"360 16 16",dur:"1s",repeatCount:"indefinite"})))))}var _X=Object.defineProperty,Dm=Object.getOwnPropertySymbols,ZE=Object.prototype.hasOwnProperty,QE=Object.prototype.propertyIsEnumerable,S_=(e,t,n)=>t in e?_X(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,kX=(e,t)=>{for(var n in t||(t={}))ZE.call(t,n)&&S_(e,n,t[n]);if(Dm)for(var n of Dm(t))QE.call(t,n)&&S_(e,n,t[n]);return e},PX=(e,t)=>{var n={};for(var r in e)ZE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Dm)for(var r of Dm(e))t.indexOf(r)<0&&QE.call(e,r)&&(n[r]=e[r]);return n};function jX(e){var t=e,{size:n,color:r}=t,o=PX(t,["size","color"]);return B.createElement("svg",kX({width:n,viewBox:"0 0 120 30",xmlns:"http://www.w3.org/2000/svg",fill:r},o),B.createElement("circle",{cx:"15",cy:"15",r:"15"},B.createElement("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),B.createElement("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})),B.createElement("circle",{cx:"60",cy:"15",r:"9",fillOpacity:"0.3"},B.createElement("animate",{attributeName:"r",from:"9",to:"9",begin:"0s",dur:"0.8s",values:"9;15;9",calcMode:"linear",repeatCount:"indefinite"}),B.createElement("animate",{attributeName:"fill-opacity",from:"0.5",to:"0.5",begin:"0s",dur:"0.8s",values:".5;1;.5",calcMode:"linear",repeatCount:"indefinite"})),B.createElement("circle",{cx:"105",cy:"15",r:"15"},B.createElement("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),B.createElement("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})))}var IX=Object.defineProperty,Am=Object.getOwnPropertySymbols,JE=Object.prototype.hasOwnProperty,eO=Object.prototype.propertyIsEnumerable,C_=(e,t,n)=>t in e?IX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,EX=(e,t)=>{for(var n in t||(t={}))JE.call(t,n)&&C_(e,n,t[n]);if(Am)for(var n of Am(t))eO.call(t,n)&&C_(e,n,t[n]);return e},OX=(e,t)=>{var n={};for(var r in e)JE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Am)for(var r of Am(e))t.indexOf(r)<0&&eO.call(e,r)&&(n[r]=e[r]);return n};const P1={bars:xX,oval:CX,dots:jX},TX={xs:qe(18),sm:qe(22),md:qe(36),lg:qe(44),xl:qe(58)},RX={size:"md"};function tO(e){const t=qr("Loader",RX,e),{size:n,color:r,variant:o}=t,s=OX(t,["size","color","variant"]),a=_i(),l=o in P1?o:a.loader;return B.createElement(Yo,EX({role:"presentation",component:P1[l]||P1.bars,size:Kt({size:n,sizes:TX}),color:a.fn.variant({variant:"filled",primaryFallback:!1,color:r||a.primaryColor}).background},s))}tO.displayName="@mantine/core/Loader";var MX=Object.defineProperty,Nm=Object.getOwnPropertySymbols,nO=Object.prototype.hasOwnProperty,rO=Object.prototype.propertyIsEnumerable,__=(e,t,n)=>t in e?MX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,k_=(e,t)=>{for(var n in t||(t={}))nO.call(t,n)&&__(e,n,t[n]);if(Nm)for(var n of Nm(t))rO.call(t,n)&&__(e,n,t[n]);return e},DX=(e,t)=>{var n={};for(var r in e)nO.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Nm)for(var r of Nm(e))t.indexOf(r)<0&&rO.call(e,r)&&(n[r]=e[r]);return n};const AX={color:"gray",size:"md",variant:"subtle"},oO=h.forwardRef((e,t)=>{const n=qr("ActionIcon",AX,e),{className:r,color:o,children:s,radius:a,size:l,variant:u,gradient:f,disabled:p,loaderProps:m,loading:v,unstyled:y,__staticSelector:S}=n,x=DX(n,["className","color","children","radius","size","variant","gradient","disabled","loaderProps","loading","unstyled","__staticSelector"]),{classes:w,cx:_,theme:k}=mX({radius:a,color:o,gradient:f},{name:["ActionIcon",S],unstyled:y,size:l,variant:u}),P=B.createElement(tO,k_({color:k.fn.variant({color:o,variant:u}).color,size:"100%","data-action-icon-loader":!0},m));return B.createElement(aX,k_({className:_(w.root,r),ref:t,disabled:p,"data-disabled":p||void 0,"data-loading":v||void 0,unstyled:y},x),v?P:s)});oO.displayName="@mantine/core/ActionIcon";const NX=oO;var zX=Object.defineProperty,$X=Object.defineProperties,LX=Object.getOwnPropertyDescriptors,zm=Object.getOwnPropertySymbols,sO=Object.prototype.hasOwnProperty,aO=Object.prototype.propertyIsEnumerable,P_=(e,t,n)=>t in e?zX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,BX=(e,t)=>{for(var n in t||(t={}))sO.call(t,n)&&P_(e,n,t[n]);if(zm)for(var n of zm(t))aO.call(t,n)&&P_(e,n,t[n]);return e},FX=(e,t)=>$X(e,LX(t)),HX=(e,t)=>{var n={};for(var r in e)sO.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&zm)for(var r of zm(e))t.indexOf(r)<0&&aO.call(e,r)&&(n[r]=e[r]);return n};function iO(e){const t=qr("Portal",{},e),{children:n,target:r,className:o,innerRef:s}=t,a=HX(t,["children","target","className","innerRef"]),l=_i(),[u,f]=h.useState(!1),p=h.useRef();return AE(()=>(f(!0),p.current=r?typeof r=="string"?document.querySelector(r):r:document.createElement("div"),r||document.body.appendChild(p.current),()=>{!r&&document.body.removeChild(p.current)}),[r]),u?_g.createPortal(B.createElement("div",FX(BX({className:o,dir:l.dir},a),{ref:s}),n),p.current):null}iO.displayName="@mantine/core/Portal";var VX=Object.defineProperty,$m=Object.getOwnPropertySymbols,lO=Object.prototype.hasOwnProperty,cO=Object.prototype.propertyIsEnumerable,j_=(e,t,n)=>t in e?VX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,WX=(e,t)=>{for(var n in t||(t={}))lO.call(t,n)&&j_(e,n,t[n]);if($m)for(var n of $m(t))cO.call(t,n)&&j_(e,n,t[n]);return e},UX=(e,t)=>{var n={};for(var r in e)lO.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&$m)for(var r of $m(e))t.indexOf(r)<0&&cO.call(e,r)&&(n[r]=e[r]);return n};function uO(e){var t=e,{withinPortal:n=!0,children:r}=t,o=UX(t,["withinPortal","children"]);return n?B.createElement(iO,WX({},o),r):B.createElement(B.Fragment,null,r)}uO.displayName="@mantine/core/OptionalPortal";var GX=Object.defineProperty,I_=Object.getOwnPropertySymbols,qX=Object.prototype.hasOwnProperty,YX=Object.prototype.propertyIsEnumerable,E_=(e,t,n)=>t in e?GX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,KX=(e,t)=>{for(var n in t||(t={}))qX.call(t,n)&&E_(e,n,t[n]);if(I_)for(var n of I_(t))YX.call(t,n)&&E_(e,n,t[n]);return e};function dO(e){return B.createElement("svg",KX({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),B.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}dO.displayName="@mantine/core/CloseIcon";var XX=Object.defineProperty,Lm=Object.getOwnPropertySymbols,fO=Object.prototype.hasOwnProperty,pO=Object.prototype.propertyIsEnumerable,O_=(e,t,n)=>t in e?XX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ZX=(e,t)=>{for(var n in t||(t={}))fO.call(t,n)&&O_(e,n,t[n]);if(Lm)for(var n of Lm(t))pO.call(t,n)&&O_(e,n,t[n]);return e},QX=(e,t)=>{var n={};for(var r in e)fO.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Lm)for(var r of Lm(e))t.indexOf(r)<0&&pO.call(e,r)&&(n[r]=e[r]);return n};const JX={xs:qe(12),sm:qe(16),md:qe(20),lg:qe(28),xl:qe(34)},eZ={size:"sm"},hO=h.forwardRef((e,t)=>{const n=qr("CloseButton",eZ,e),{iconSize:r,size:o,children:s}=n,a=QX(n,["iconSize","size","children"]),l=qe(r||JX[o]);return B.createElement(NX,ZX({ref:t,__staticSelector:"CloseButton",size:o},a),s||B.createElement(dO,{width:l,height:l}))});hO.displayName="@mantine/core/CloseButton";const mO=hO;var tZ=Object.defineProperty,nZ=Object.defineProperties,rZ=Object.getOwnPropertyDescriptors,T_=Object.getOwnPropertySymbols,oZ=Object.prototype.hasOwnProperty,sZ=Object.prototype.propertyIsEnumerable,R_=(e,t,n)=>t in e?tZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,lh=(e,t)=>{for(var n in t||(t={}))oZ.call(t,n)&&R_(e,n,t[n]);if(T_)for(var n of T_(t))sZ.call(t,n)&&R_(e,n,t[n]);return e},aZ=(e,t)=>nZ(e,rZ(t));function iZ({underline:e,strikethrough:t}){const n=[];return e&&n.push("underline"),t&&n.push("line-through"),n.length>0?n.join(" "):"none"}function lZ({theme:e,color:t}){return t==="dimmed"?e.fn.dimmed():typeof t=="string"&&(t in e.colors||t.split(".")[0]in e.colors)?e.fn.variant({variant:"filled",color:t}).background:t||"inherit"}function cZ(e){return typeof e=="number"?{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical"}:null}function uZ({theme:e,truncate:t}){return t==="start"?{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",direction:e.dir==="ltr"?"rtl":"ltr",textAlign:e.dir==="ltr"?"right":"left"}:t?{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}:null}var dZ=ko((e,{color:t,lineClamp:n,truncate:r,inline:o,inherit:s,underline:a,gradient:l,weight:u,transform:f,align:p,strikethrough:m,italic:v},{size:y})=>{const S=e.fn.variant({variant:"gradient",gradient:l});return{root:aZ(lh(lh(lh(lh({},e.fn.fontStyles()),e.fn.focusStyles()),cZ(n)),uZ({theme:e,truncate:r})),{color:lZ({color:t,theme:e}),fontFamily:s?"inherit":e.fontFamily,fontSize:s||y===void 0?"inherit":Kt({size:y,sizes:e.fontSizes}),lineHeight:s?"inherit":o?1:e.lineHeight,textDecoration:iZ({underline:a,strikethrough:m}),WebkitTapHighlightColor:"transparent",fontWeight:s?"inherit":u,textTransform:f,textAlign:p,fontStyle:v?"italic":void 0}),gradient:{backgroundImage:S.background,WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"}}});const fZ=dZ;var pZ=Object.defineProperty,Bm=Object.getOwnPropertySymbols,gO=Object.prototype.hasOwnProperty,vO=Object.prototype.propertyIsEnumerable,M_=(e,t,n)=>t in e?pZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hZ=(e,t)=>{for(var n in t||(t={}))gO.call(t,n)&&M_(e,n,t[n]);if(Bm)for(var n of Bm(t))vO.call(t,n)&&M_(e,n,t[n]);return e},mZ=(e,t)=>{var n={};for(var r in e)gO.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Bm)for(var r of Bm(e))t.indexOf(r)<0&&vO.call(e,r)&&(n[r]=e[r]);return n};const gZ={variant:"text"},yO=h.forwardRef((e,t)=>{const n=qr("Text",gZ,e),{className:r,size:o,weight:s,transform:a,color:l,align:u,variant:f,lineClamp:p,truncate:m,gradient:v,inline:y,inherit:S,underline:x,strikethrough:w,italic:_,classNames:k,styles:P,unstyled:I,span:j,__staticSelector:E}=n,T=mZ(n,["className","size","weight","transform","color","align","variant","lineClamp","truncate","gradient","inline","inherit","underline","strikethrough","italic","classNames","styles","unstyled","span","__staticSelector"]),{classes:R,cx:M}=fZ({color:l,lineClamp:p,truncate:m,inline:y,inherit:S,underline:x,strikethrough:w,italic:_,weight:s,transform:a,align:u,gradient:v},{unstyled:I,name:E||"Text",variant:f,size:o});return B.createElement(Yo,hZ({ref:t,className:M(R.root,{[R.gradient]:f==="gradient"},r),component:j?"span":"div"},T))});yO.displayName="@mantine/core/Text";const yv=yO,ch={xs:qe(1),sm:qe(2),md:qe(3),lg:qe(4),xl:qe(5)};function uh(e,t){const n=e.fn.variant({variant:"outline",color:t}).border;return typeof t=="string"&&(t in e.colors||t.split(".")[0]in e.colors)?n:t===void 0?e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]:t}var vZ=ko((e,{color:t},{size:n,variant:r})=>({root:{},withLabel:{borderTop:"0 !important"},left:{"&::before":{display:"none"}},right:{"&::after":{display:"none"}},label:{display:"flex",alignItems:"center","&::before":{content:'""',flex:1,height:qe(1),borderTop:`${Kt({size:n,sizes:ch})} ${r} ${uh(e,t)}`,marginRight:e.spacing.xs},"&::after":{content:'""',flex:1,borderTop:`${Kt({size:n,sizes:ch})} ${r} ${uh(e,t)}`,marginLeft:e.spacing.xs}},labelDefaultStyles:{color:t==="dark"?e.colors.dark[1]:e.fn.themeColor(t,e.colorScheme==="dark"?5:e.fn.primaryShade(),!1)},horizontal:{border:0,borderTopWidth:qe(Kt({size:n,sizes:ch})),borderTopColor:uh(e,t),borderTopStyle:r,margin:0},vertical:{border:0,alignSelf:"stretch",height:"auto",borderLeftWidth:qe(Kt({size:n,sizes:ch})),borderLeftColor:uh(e,t),borderLeftStyle:r}}));const yZ=vZ;var xZ=Object.defineProperty,bZ=Object.defineProperties,wZ=Object.getOwnPropertyDescriptors,Fm=Object.getOwnPropertySymbols,xO=Object.prototype.hasOwnProperty,bO=Object.prototype.propertyIsEnumerable,D_=(e,t,n)=>t in e?xZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,A_=(e,t)=>{for(var n in t||(t={}))xO.call(t,n)&&D_(e,n,t[n]);if(Fm)for(var n of Fm(t))bO.call(t,n)&&D_(e,n,t[n]);return e},SZ=(e,t)=>bZ(e,wZ(t)),CZ=(e,t)=>{var n={};for(var r in e)xO.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Fm)for(var r of Fm(e))t.indexOf(r)<0&&bO.call(e,r)&&(n[r]=e[r]);return n};const _Z={orientation:"horizontal",size:"xs",labelPosition:"left",variant:"solid"},Gy=h.forwardRef((e,t)=>{const n=qr("Divider",_Z,e),{className:r,color:o,orientation:s,size:a,label:l,labelPosition:u,labelProps:f,variant:p,styles:m,classNames:v,unstyled:y}=n,S=CZ(n,["className","color","orientation","size","label","labelPosition","labelProps","variant","styles","classNames","unstyled"]),{classes:x,cx:w}=yZ({color:o},{classNames:v,styles:m,unstyled:y,name:"Divider",variant:p,size:a}),_=s==="vertical",k=s==="horizontal",P=!!l&&k,I=!(f!=null&&f.color);return B.createElement(Yo,A_({ref:t,className:w(x.root,{[x.vertical]:_,[x.horizontal]:k,[x.withLabel]:P},r),role:"separator"},S),P&&B.createElement(yv,SZ(A_({},f),{size:(f==null?void 0:f.size)||"xs",mt:qe(2),className:w(x.label,x[u],{[x.labelDefaultStyles]:I})}),l))});Gy.displayName="@mantine/core/Divider";var kZ=Object.defineProperty,PZ=Object.defineProperties,jZ=Object.getOwnPropertyDescriptors,N_=Object.getOwnPropertySymbols,IZ=Object.prototype.hasOwnProperty,EZ=Object.prototype.propertyIsEnumerable,z_=(e,t,n)=>t in e?kZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$_=(e,t)=>{for(var n in t||(t={}))IZ.call(t,n)&&z_(e,n,t[n]);if(N_)for(var n of N_(t))EZ.call(t,n)&&z_(e,n,t[n]);return e},OZ=(e,t)=>PZ(e,jZ(t)),TZ=ko((e,t,{size:n})=>({item:OZ($_({},e.fn.fontStyles()),{boxSizing:"border-box",wordBreak:"break-all",textAlign:"left",width:"100%",padding:`calc(${Kt({size:n,sizes:e.spacing})} / 1.5) ${Kt({size:n,sizes:e.spacing})}`,cursor:"pointer",fontSize:Kt({size:n,sizes:e.fontSizes}),color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,borderRadius:e.fn.radius(),"&[data-hovered]":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[1]},"&[data-selected]":$_({backgroundColor:e.fn.variant({variant:"filled"}).background,color:e.fn.variant({variant:"filled"}).color},e.fn.hover({backgroundColor:e.fn.variant({variant:"filled"}).hover})),"&[data-disabled]":{cursor:"default",color:e.colors.dark[2]}}),nothingFound:{boxSizing:"border-box",color:e.colors.gray[6],paddingTop:`calc(${Kt({size:n,sizes:e.spacing})} / 2)`,paddingBottom:`calc(${Kt({size:n,sizes:e.spacing})} / 2)`,textAlign:"center"},separator:{boxSizing:"border-box",textAlign:"left",width:"100%",padding:`calc(${Kt({size:n,sizes:e.spacing})} / 1.5) ${Kt({size:n,sizes:e.spacing})}`},separatorLabel:{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]}}));const RZ=TZ;var MZ=Object.defineProperty,L_=Object.getOwnPropertySymbols,DZ=Object.prototype.hasOwnProperty,AZ=Object.prototype.propertyIsEnumerable,B_=(e,t,n)=>t in e?MZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,NZ=(e,t)=>{for(var n in t||(t={}))DZ.call(t,n)&&B_(e,n,t[n]);if(L_)for(var n of L_(t))AZ.call(t,n)&&B_(e,n,t[n]);return e};function Gb({data:e,hovered:t,classNames:n,styles:r,isItemSelected:o,uuid:s,__staticSelector:a,onItemHover:l,onItemSelect:u,itemsRefs:f,itemComponent:p,size:m,nothingFound:v,creatable:y,createLabel:S,unstyled:x,variant:w}){const{classes:_}=RZ(null,{classNames:n,styles:r,unstyled:x,name:a,variant:w,size:m}),k=[],P=[];let I=null;const j=(T,R)=>{const M=typeof o=="function"?o(T.value):!1;return B.createElement(p,NZ({key:T.value,className:_.item,"data-disabled":T.disabled||void 0,"data-hovered":!T.disabled&&t===R||void 0,"data-selected":!T.disabled&&M||void 0,selected:M,onMouseEnter:()=>l(R),id:`${s}-${R}`,role:"option",tabIndex:-1,"aria-selected":t===R,ref:D=>{f&&f.current&&(f.current[T.value]=D)},onMouseDown:T.disabled?null:D=>{D.preventDefault(),u(T)},disabled:T.disabled,variant:w},T))};let E=null;if(e.forEach((T,R)=>{T.creatable?I=R:T.group?(E!==T.group&&(E=T.group,P.push(B.createElement("div",{className:_.separator,key:`__mantine-divider-${R}`},B.createElement(Gy,{classNames:{label:_.separatorLabel},label:T.group})))),P.push(j(T,R))):k.push(j(T,R))}),y){const T=e[I];k.push(B.createElement("div",{key:Wb(),className:_.item,"data-hovered":t===I||void 0,onMouseEnter:()=>l(I),onMouseDown:R=>{R.preventDefault(),u(T)},tabIndex:-1,ref:R=>{f&&f.current&&(f.current[T.value]=R)}},S))}return P.length>0&&k.length>0&&k.unshift(B.createElement("div",{className:_.separator,key:"empty-group-separator"},B.createElement(Gy,null))),P.length>0||k.length>0?B.createElement(B.Fragment,null,P,k):B.createElement(yv,{size:m,unstyled:x,className:_.nothingFound},v)}Gb.displayName="@mantine/core/SelectItems";var zZ=Object.defineProperty,Hm=Object.getOwnPropertySymbols,wO=Object.prototype.hasOwnProperty,SO=Object.prototype.propertyIsEnumerable,F_=(e,t,n)=>t in e?zZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$Z=(e,t)=>{for(var n in t||(t={}))wO.call(t,n)&&F_(e,n,t[n]);if(Hm)for(var n of Hm(t))SO.call(t,n)&&F_(e,n,t[n]);return e},LZ=(e,t)=>{var n={};for(var r in e)wO.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Hm)for(var r of Hm(e))t.indexOf(r)<0&&SO.call(e,r)&&(n[r]=e[r]);return n};const qb=h.forwardRef((e,t)=>{var n=e,{label:r,value:o}=n,s=LZ(n,["label","value"]);return B.createElement("div",$Z({ref:t},s),r||o)});qb.displayName="@mantine/core/DefaultItem";function BZ(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function CO(...e){return t=>e.forEach(n=>BZ(n,t))}function yc(...e){return h.useCallback(CO(...e),e)}const _O=h.forwardRef((e,t)=>{const{children:n,...r}=e,o=h.Children.toArray(n),s=o.find(HZ);if(s){const a=s.props.children,l=o.map(u=>u===s?h.Children.count(a)>1?h.Children.only(null):h.isValidElement(a)?a.props.children:null:u);return h.createElement(qy,Pr({},r,{ref:t}),h.isValidElement(a)?h.cloneElement(a,void 0,l):null)}return h.createElement(qy,Pr({},r,{ref:t}),n)});_O.displayName="Slot";const qy=h.forwardRef((e,t)=>{const{children:n,...r}=e;return h.isValidElement(n)?h.cloneElement(n,{...VZ(r,n.props),ref:CO(t,n.ref)}):h.Children.count(n)>1?h.Children.only(null):null});qy.displayName="SlotClone";const FZ=({children:e})=>h.createElement(h.Fragment,null,e);function HZ(e){return h.isValidElement(e)&&e.type===FZ}function VZ(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...l)=>{s(...l),o(...l)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}const WZ=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],Yf=WZ.reduce((e,t)=>{const n=h.forwardRef((r,o)=>{const{asChild:s,...a}=r,l=s?_O:t;return h.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),h.createElement(l,Pr({},a,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Yy=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{};function UZ(e,t){return h.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const Kf=e=>{const{present:t,children:n}=e,r=GZ(t),o=typeof n=="function"?n({present:r.isPresent}):h.Children.only(n),s=yc(r.ref,o.ref);return typeof n=="function"||r.isPresent?h.cloneElement(o,{ref:s}):null};Kf.displayName="Presence";function GZ(e){const[t,n]=h.useState(),r=h.useRef({}),o=h.useRef(e),s=h.useRef("none"),a=e?"mounted":"unmounted",[l,u]=UZ(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const f=dh(r.current);s.current=l==="mounted"?f:"none"},[l]),Yy(()=>{const f=r.current,p=o.current;if(p!==e){const v=s.current,y=dh(f);e?u("MOUNT"):y==="none"||(f==null?void 0:f.display)==="none"?u("UNMOUNT"):u(p&&v!==y?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),Yy(()=>{if(t){const f=m=>{const y=dh(r.current).includes(m.animationName);m.target===t&&y&&_g.flushSync(()=>u("ANIMATION_END"))},p=m=>{m.target===t&&(s.current=dh(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:h.useCallback(f=>{f&&(r.current=getComputedStyle(f)),n(f)},[])}}function dh(e){return(e==null?void 0:e.animationName)||"none"}function qZ(e,t=[]){let n=[];function r(s,a){const l=h.createContext(a),u=n.length;n=[...n,a];function f(m){const{scope:v,children:y,...S}=m,x=(v==null?void 0:v[e][u])||l,w=h.useMemo(()=>S,Object.values(S));return h.createElement(x.Provider,{value:w},y)}function p(m,v){const y=(v==null?void 0:v[e][u])||l,S=h.useContext(y);if(S)return S;if(a!==void 0)return a;throw new Error(`\`${m}\` must be used within \`${s}\``)}return f.displayName=s+"Provider",[f,p]}const o=()=>{const s=n.map(a=>h.createContext(a));return function(l){const u=(l==null?void 0:l[e])||s;return h.useMemo(()=>({[`__scope${e}`]:{...l,[e]:u}}),[l,u])}};return o.scopeName=e,[r,YZ(o,...t)]}function YZ(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const a=r.reduce((l,{useScope:u,scopeName:f})=>{const m=u(s)[`__scope${f}`];return{...l,...m}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Dl(e){const t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}const KZ=h.createContext(void 0);function XZ(e){const t=h.useContext(KZ);return e||t||"ltr"}function ZZ(e,[t,n]){return Math.min(n,Math.max(t,e))}function Kl(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function QZ(e,t){return h.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const kO="ScrollArea",[PO,epe]=qZ(kO),[JZ,Hs]=PO(kO),eQ=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:s=600,...a}=e,[l,u]=h.useState(null),[f,p]=h.useState(null),[m,v]=h.useState(null),[y,S]=h.useState(null),[x,w]=h.useState(null),[_,k]=h.useState(0),[P,I]=h.useState(0),[j,E]=h.useState(!1),[T,R]=h.useState(!1),M=yc(t,N=>u(N)),D=XZ(o);return h.createElement(JZ,{scope:n,type:r,dir:D,scrollHideDelay:s,scrollArea:l,viewport:f,onViewportChange:p,content:m,onContentChange:v,scrollbarX:y,onScrollbarXChange:S,scrollbarXEnabled:j,onScrollbarXEnabledChange:E,scrollbarY:x,onScrollbarYChange:w,scrollbarYEnabled:T,onScrollbarYEnabledChange:R,onCornerWidthChange:k,onCornerHeightChange:I},h.createElement(Yf.div,Pr({dir:D},a,{ref:M,style:{position:"relative",["--radix-scroll-area-corner-width"]:_+"px",["--radix-scroll-area-corner-height"]:P+"px",...e.style}})))}),tQ="ScrollAreaViewport",nQ=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,...o}=e,s=Hs(tQ,n),a=h.useRef(null),l=yc(t,a,s.onViewportChange);return h.createElement(h.Fragment,null,h.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),h.createElement(Yf.div,Pr({"data-radix-scroll-area-viewport":""},o,{ref:l,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style}}),h.createElement("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"}},r)))}),Pi="ScrollAreaScrollbar",rQ=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Hs(Pi,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:a}=o,l=e.orientation==="horizontal";return h.useEffect(()=>(l?s(!0):a(!0),()=>{l?s(!1):a(!1)}),[l,s,a]),o.type==="hover"?h.createElement(oQ,Pr({},r,{ref:t,forceMount:n})):o.type==="scroll"?h.createElement(sQ,Pr({},r,{ref:t,forceMount:n})):o.type==="auto"?h.createElement(jO,Pr({},r,{ref:t,forceMount:n})):o.type==="always"?h.createElement(Yb,Pr({},r,{ref:t})):null}),oQ=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Hs(Pi,e.__scopeScrollArea),[s,a]=h.useState(!1);return h.useEffect(()=>{const l=o.scrollArea;let u=0;if(l){const f=()=>{window.clearTimeout(u),a(!0)},p=()=>{u=window.setTimeout(()=>a(!1),o.scrollHideDelay)};return l.addEventListener("pointerenter",f),l.addEventListener("pointerleave",p),()=>{window.clearTimeout(u),l.removeEventListener("pointerenter",f),l.removeEventListener("pointerleave",p)}}},[o.scrollArea,o.scrollHideDelay]),h.createElement(Kf,{present:n||s},h.createElement(jO,Pr({"data-state":s?"visible":"hidden"},r,{ref:t})))}),sQ=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Hs(Pi,e.__scopeScrollArea),s=e.orientation==="horizontal",a=bv(()=>u("SCROLL_END"),100),[l,u]=QZ("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return h.useEffect(()=>{if(l==="idle"){const f=window.setTimeout(()=>u("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(f)}},[l,o.scrollHideDelay,u]),h.useEffect(()=>{const f=o.viewport,p=s?"scrollLeft":"scrollTop";if(f){let m=f[p];const v=()=>{const y=f[p];m!==y&&(u("SCROLL"),a()),m=y};return f.addEventListener("scroll",v),()=>f.removeEventListener("scroll",v)}},[o.viewport,s,u,a]),h.createElement(Kf,{present:n||l!=="hidden"},h.createElement(Yb,Pr({"data-state":l==="hidden"?"hidden":"visible"},r,{ref:t,onPointerEnter:Kl(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:Kl(e.onPointerLeave,()=>u("POINTER_LEAVE"))})))}),jO=h.forwardRef((e,t)=>{const n=Hs(Pi,e.__scopeScrollArea),{forceMount:r,...o}=e,[s,a]=h.useState(!1),l=e.orientation==="horizontal",u=bv(()=>{if(n.viewport){const f=n.viewport.offsetWidth<n.viewport.scrollWidth,p=n.viewport.offsetHeight<n.viewport.scrollHeight;a(l?f:p)}},10);return Cu(n.viewport,u),Cu(n.content,u),h.createElement(Kf,{present:r||s},h.createElement(Yb,Pr({"data-state":s?"visible":"hidden"},o,{ref:t})))}),Yb=h.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=Hs(Pi,e.__scopeScrollArea),s=h.useRef(null),a=h.useRef(0),[l,u]=h.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=TO(l.viewport,l.content),p={...r,sizes:l,onSizesChange:u,hasThumb:f>0&&f<1,onThumbChange:v=>s.current=v,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:v=>a.current=v};function m(v,y){return pQ(v,a.current,l,y)}return n==="horizontal"?h.createElement(aQ,Pr({},p,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const v=o.viewport.scrollLeft,y=H_(v,l,o.dir);s.current.style.transform=`translate3d(${y}px, 0, 0)`}},onWheelScroll:v=>{o.viewport&&(o.viewport.scrollLeft=v)},onDragScroll:v=>{o.viewport&&(o.viewport.scrollLeft=m(v,o.dir))}})):n==="vertical"?h.createElement(iQ,Pr({},p,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const v=o.viewport.scrollTop,y=H_(v,l);s.current.style.transform=`translate3d(0, ${y}px, 0)`}},onWheelScroll:v=>{o.viewport&&(o.viewport.scrollTop=v)},onDragScroll:v=>{o.viewport&&(o.viewport.scrollTop=m(v))}})):null}),aQ=h.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=Hs(Pi,e.__scopeScrollArea),[a,l]=h.useState(),u=h.useRef(null),f=yc(t,u,s.onScrollbarXChange);return h.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),h.createElement(EO,Pr({"data-orientation":"horizontal"},o,{ref:f,sizes:n,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,["--radix-scroll-area-thumb-width"]:xv(n)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.x),onDragScroll:p=>e.onDragScroll(p.x),onWheelScroll:(p,m)=>{if(s.viewport){const v=s.viewport.scrollLeft+p.deltaX;e.onWheelScroll(v),MO(v,m)&&p.preventDefault()}},onResize:()=>{u.current&&s.viewport&&a&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:Vm(a.paddingLeft),paddingEnd:Vm(a.paddingRight)}})}}))}),iQ=h.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=Hs(Pi,e.__scopeScrollArea),[a,l]=h.useState(),u=h.useRef(null),f=yc(t,u,s.onScrollbarYChange);return h.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),h.createElement(EO,Pr({"data-orientation":"vertical"},o,{ref:f,sizes:n,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)",["--radix-scroll-area-thumb-height"]:xv(n)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.y),onDragScroll:p=>e.onDragScroll(p.y),onWheelScroll:(p,m)=>{if(s.viewport){const v=s.viewport.scrollTop+p.deltaY;e.onWheelScroll(v),MO(v,m)&&p.preventDefault()}},onResize:()=>{u.current&&s.viewport&&a&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:Vm(a.paddingTop),paddingEnd:Vm(a.paddingBottom)}})}}))}),[lQ,IO]=PO(Pi),EO=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:s,onThumbPointerUp:a,onThumbPointerDown:l,onThumbPositionChange:u,onDragScroll:f,onWheelScroll:p,onResize:m,...v}=e,y=Hs(Pi,n),[S,x]=h.useState(null),w=yc(t,M=>x(M)),_=h.useRef(null),k=h.useRef(""),P=y.viewport,I=r.content-r.viewport,j=Dl(p),E=Dl(u),T=bv(m,10);function R(M){if(_.current){const D=M.clientX-_.current.left,N=M.clientY-_.current.top;f({x:D,y:N})}}return h.useEffect(()=>{const M=D=>{const N=D.target;(S==null?void 0:S.contains(N))&&j(D,I)};return document.addEventListener("wheel",M,{passive:!1}),()=>document.removeEventListener("wheel",M,{passive:!1})},[P,S,I,j]),h.useEffect(E,[r,E]),Cu(S,T),Cu(y.content,T),h.createElement(lQ,{scope:n,scrollbar:S,hasThumb:o,onThumbChange:Dl(s),onThumbPointerUp:Dl(a),onThumbPositionChange:E,onThumbPointerDown:Dl(l)},h.createElement(Yf.div,Pr({},v,{ref:w,style:{position:"absolute",...v.style},onPointerDown:Kl(e.onPointerDown,M=>{M.button===0&&(M.target.setPointerCapture(M.pointerId),_.current=S.getBoundingClientRect(),k.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",R(M))}),onPointerMove:Kl(e.onPointerMove,R),onPointerUp:Kl(e.onPointerUp,M=>{const D=M.target;D.hasPointerCapture(M.pointerId)&&D.releasePointerCapture(M.pointerId),document.body.style.webkitUserSelect=k.current,_.current=null})})))}),Ky="ScrollAreaThumb",cQ=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=IO(Ky,e.__scopeScrollArea);return h.createElement(Kf,{present:n||o.hasThumb},h.createElement(uQ,Pr({ref:t},r)))}),uQ=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,s=Hs(Ky,n),a=IO(Ky,n),{onThumbPositionChange:l}=a,u=yc(t,m=>a.onThumbChange(m)),f=h.useRef(),p=bv(()=>{f.current&&(f.current(),f.current=void 0)},100);return h.useEffect(()=>{const m=s.viewport;if(m){const v=()=>{if(p(),!f.current){const y=hQ(m,l);f.current=y,l()}};return l(),m.addEventListener("scroll",v),()=>m.removeEventListener("scroll",v)}},[s.viewport,p,l]),h.createElement(Yf.div,Pr({"data-state":a.hasThumb?"visible":"hidden"},o,{ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Kl(e.onPointerDownCapture,m=>{const y=m.target.getBoundingClientRect(),S=m.clientX-y.left,x=m.clientY-y.top;a.onThumbPointerDown({x:S,y:x})}),onPointerUp:Kl(e.onPointerUp,a.onThumbPointerUp)}))}),OO="ScrollAreaCorner",dQ=h.forwardRef((e,t)=>{const n=Hs(OO,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?h.createElement(fQ,Pr({},e,{ref:t})):null}),fQ=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=Hs(OO,n),[s,a]=h.useState(0),[l,u]=h.useState(0),f=!!(s&&l);return Cu(o.scrollbarX,()=>{var p;const m=((p=o.scrollbarX)===null||p===void 0?void 0:p.offsetHeight)||0;o.onCornerHeightChange(m),u(m)}),Cu(o.scrollbarY,()=>{var p;const m=((p=o.scrollbarY)===null||p===void 0?void 0:p.offsetWidth)||0;o.onCornerWidthChange(m),a(m)}),f?h.createElement(Yf.div,Pr({},r,{ref:t,style:{width:s,height:l,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}})):null});function Vm(e){return e?parseInt(e,10):0}function TO(e,t){const n=e/t;return isNaN(n)?0:n}function xv(e){const t=TO(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function pQ(e,t,n,r="ltr"){const o=xv(n),s=o/2,a=t||s,l=o-a,u=n.scrollbar.paddingStart+a,f=n.scrollbar.size-n.scrollbar.paddingEnd-l,p=n.content-n.viewport,m=r==="ltr"?[0,p]:[p*-1,0];return RO([u,f],m)(e)}function H_(e,t,n="ltr"){const r=xv(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-o,a=t.content-t.viewport,l=s-r,u=n==="ltr"?[0,a]:[a*-1,0],f=ZZ(e,u);return RO([0,a],[0,l])(f)}function RO(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function MO(e,t){return e>0&&e<t}const hQ=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const s={left:e.scrollLeft,top:e.scrollTop},a=n.left!==s.left,l=n.top!==s.top;(a||l)&&t(),n=s,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function bv(e,t){const n=Dl(e),r=h.useRef(0);return h.useEffect(()=>()=>window.clearTimeout(r.current),[]),h.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Cu(e,t){const n=Dl(t);Yy(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}const mQ=eQ,gQ=nQ,V_=rQ,W_=cQ,vQ=dQ;var yQ=ko((e,{scrollbarSize:t,offsetScrollbars:n,scrollbarHovered:r,hidden:o})=>({root:{overflow:"hidden"},viewport:{width:"100%",height:"100%",paddingRight:n?qe(t):void 0,paddingBottom:n?qe(t):void 0},scrollbar:{display:o?"none":"flex",userSelect:"none",touchAction:"none",boxSizing:"border-box",padding:`calc(${qe(t)} / 5)`,transition:"background-color 150ms ease, opacity 150ms ease","&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[8]:e.colors.gray[0],[`& .${t_("thumb")}`]:{backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.white,.5):e.fn.rgba(e.black,.5)}},'&[data-orientation="vertical"]':{width:qe(t)},'&[data-orientation="horizontal"]':{flexDirection:"column",height:qe(t)},'&[data-state="hidden"]':{display:"none",opacity:0}},thumb:{ref:t_("thumb"),flex:1,backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.white,.4):e.fn.rgba(e.black,.4),borderRadius:qe(t),position:"relative",transition:"background-color 150ms ease",display:o?"none":void 0,overflow:"hidden","&::before":{content:'""',position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",height:"100%",minWidth:qe(44),minHeight:qe(44)}},corner:{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0],transition:"opacity 150ms ease",opacity:r?1:0,display:o?"none":void 0}}));const xQ=yQ;var bQ=Object.defineProperty,wQ=Object.defineProperties,SQ=Object.getOwnPropertyDescriptors,Wm=Object.getOwnPropertySymbols,DO=Object.prototype.hasOwnProperty,AO=Object.prototype.propertyIsEnumerable,U_=(e,t,n)=>t in e?bQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Xy=(e,t)=>{for(var n in t||(t={}))DO.call(t,n)&&U_(e,n,t[n]);if(Wm)for(var n of Wm(t))AO.call(t,n)&&U_(e,n,t[n]);return e},NO=(e,t)=>wQ(e,SQ(t)),zO=(e,t)=>{var n={};for(var r in e)DO.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Wm)for(var r of Wm(e))t.indexOf(r)<0&&AO.call(e,r)&&(n[r]=e[r]);return n};const $O={scrollbarSize:12,scrollHideDelay:1e3,type:"hover",offsetScrollbars:!1},wv=h.forwardRef((e,t)=>{const n=qr("ScrollArea",$O,e),{children:r,className:o,classNames:s,styles:a,scrollbarSize:l,scrollHideDelay:u,type:f,dir:p,offsetScrollbars:m,viewportRef:v,onScrollPositionChange:y,unstyled:S,variant:x,viewportProps:w}=n,_=zO(n,["children","className","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled","variant","viewportProps"]),[k,P]=h.useState(!1),I=_i(),{classes:j,cx:E}=xQ({scrollbarSize:l,offsetScrollbars:m,scrollbarHovered:k,hidden:f==="never"},{name:"ScrollArea",classNames:s,styles:a,unstyled:S,variant:x});return B.createElement(mQ,{type:f==="never"?"always":f,scrollHideDelay:u,dir:p||I.dir,ref:t,asChild:!0},B.createElement(Yo,Xy({className:E(j.root,o)},_),B.createElement(gQ,NO(Xy({},w),{className:j.viewport,ref:v,onScroll:typeof y=="function"?({currentTarget:T})=>y({x:T.scrollLeft,y:T.scrollTop}):void 0}),r),B.createElement(V_,{orientation:"horizontal",className:j.scrollbar,forceMount:!0,onMouseEnter:()=>P(!0),onMouseLeave:()=>P(!1)},B.createElement(W_,{className:j.thumb})),B.createElement(V_,{orientation:"vertical",className:j.scrollbar,forceMount:!0,onMouseEnter:()=>P(!0),onMouseLeave:()=>P(!1)},B.createElement(W_,{className:j.thumb})),B.createElement(vQ,{className:j.corner})))}),LO=h.forwardRef((e,t)=>{const n=qr("ScrollAreaAutosize",$O,e),{children:r,classNames:o,styles:s,scrollbarSize:a,scrollHideDelay:l,type:u,dir:f,offsetScrollbars:p,viewportRef:m,onScrollPositionChange:v,unstyled:y,sx:S,variant:x,viewportProps:w}=n,_=zO(n,["children","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled","sx","variant","viewportProps"]);return B.createElement(Yo,NO(Xy({},_),{ref:t,sx:[{display:"flex"},...EE(S)]}),B.createElement(Yo,{sx:{display:"flex",flexDirection:"column",flex:1}},B.createElement(wv,{classNames:o,styles:s,scrollHideDelay:l,scrollbarSize:a,type:u,dir:f,offsetScrollbars:p,viewportRef:m,onScrollPositionChange:v,unstyled:y,variant:x,viewportProps:w},r)))});LO.displayName="@mantine/core/ScrollAreaAutosize";wv.displayName="@mantine/core/ScrollArea";wv.Autosize=LO;const CQ=wv;var _Q=Object.defineProperty,kQ=Object.defineProperties,PQ=Object.getOwnPropertyDescriptors,Um=Object.getOwnPropertySymbols,BO=Object.prototype.hasOwnProperty,FO=Object.prototype.propertyIsEnumerable,G_=(e,t,n)=>t in e?_Q(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,q_=(e,t)=>{for(var n in t||(t={}))BO.call(t,n)&&G_(e,n,t[n]);if(Um)for(var n of Um(t))FO.call(t,n)&&G_(e,n,t[n]);return e},jQ=(e,t)=>kQ(e,PQ(t)),IQ=(e,t)=>{var n={};for(var r in e)BO.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Um)for(var r of Um(e))t.indexOf(r)<0&&FO.call(e,r)&&(n[r]=e[r]);return n};const Sv=h.forwardRef((e,t)=>{var n=e,{style:r}=n,o=IQ(n,["style"]);return B.createElement(CQ,jQ(q_({},o),{style:q_({width:"100%"},r),viewportProps:{tabIndex:-1},viewportRef:t}),o.children)});Sv.displayName="@mantine/core/SelectScrollArea";var EQ=ko(()=>({dropdown:{},itemsWrapper:{padding:qe(4),display:"flex",width:"100%",boxSizing:"border-box"}}));const OQ=EQ;function qu(e){return e.split("-")[1]}function Kb(e){return e==="y"?"height":"width"}function pa(e){return e.split("-")[0]}function yl(e){return["top","bottom"].includes(pa(e))?"x":"y"}function Y_(e,t,n){let{reference:r,floating:o}=e;const s=r.x+r.width/2-o.width/2,a=r.y+r.height/2-o.height/2,l=yl(t),u=Kb(l),f=r[u]/2-o[u]/2,p=l==="x";let m;switch(pa(t)){case"top":m={x:s,y:r.y-o.height};break;case"bottom":m={x:s,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:a};break;case"left":m={x:r.x-o.width,y:a};break;default:m={x:r.x,y:r.y}}switch(qu(t)){case"start":m[l]-=f*(n&&p?-1:1);break;case"end":m[l]+=f*(n&&p?-1:1)}return m}const TQ=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:a}=n,l=s.filter(Boolean),u=await(a.isRTL==null?void 0:a.isRTL(t));let f=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:p,y:m}=Y_(f,r,u),v=r,y={},S=0;for(let x=0;x<l.length;x++){const{name:w,fn:_}=l[x],{x:k,y:P,data:I,reset:j}=await _({x:p,y:m,initialPlacement:r,placement:v,strategy:o,middlewareData:y,rects:f,platform:a,elements:{reference:e,floating:t}});p=k??p,m=P??m,y={...y,[w]:{...y[w],...I}},j&&S<=50&&(S++,typeof j=="object"&&(j.placement&&(v=j.placement),j.rects&&(f=j.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):j.rects),{x:p,y:m}=Y_(f,v,u)),x=-1)}return{x:p,y:m,placement:v,strategy:o,middlewareData:y}};function bi(e,t){return typeof e=="function"?e(t):e}function Xb(e){return typeof e!="number"?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(e):{top:e,right:e,bottom:e,left:e}}function _u(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function Zb(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:a,elements:l,strategy:u}=e,{boundary:f="clippingAncestors",rootBoundary:p="viewport",elementContext:m="floating",altBoundary:v=!1,padding:y=0}=bi(t,e),S=Xb(y),x=l[v?m==="floating"?"reference":"floating":m],w=_u(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(x)))==null||n?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:f,rootBoundary:p,strategy:u})),_=m==="floating"?{...a.floating,x:r,y:o}:a.reference,k=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),P=await(s.isElement==null?void 0:s.isElement(k))&&await(s.getScale==null?void 0:s.getScale(k))||{x:1,y:1},I=_u(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:_,offsetParent:k,strategy:u}):_);return{top:(w.top-I.top+S.top)/P.y,bottom:(I.bottom-w.bottom+S.bottom)/P.y,left:(w.left-I.left+S.left)/P.x,right:(I.right-w.right+S.right)/P.x}}const il=Math.min,Na=Math.max;function Zy(e,t,n){return Na(e,il(t,n))}const K_=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:a,elements:l}=t,{element:u,padding:f=0}=bi(e,t)||{};if(u==null)return{};const p=Xb(f),m={x:n,y:r},v=yl(o),y=Kb(v),S=await a.getDimensions(u),x=v==="y",w=x?"top":"left",_=x?"bottom":"right",k=x?"clientHeight":"clientWidth",P=s.reference[y]+s.reference[v]-m[v]-s.floating[y],I=m[v]-s.reference[v],j=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let E=j?j[k]:0;E&&await(a.isElement==null?void 0:a.isElement(j))||(E=l.floating[k]||s.floating[y]);const T=P/2-I/2,R=E/2-S[y]/2-1,M=il(p[w],R),D=il(p[_],R),N=M,U=E-S[y]-D,z=E/2-S[y]/2+T,F=Zy(N,z,U),H=qu(o)!=null&&z!=F&&s.reference[y]/2-(z<N?M:D)-S[y]/2<0?z<N?N-z:U-z:0;return{[v]:m[v]-H,data:{[v]:F,centerOffset:z-F+H}}}}),RQ=["top","right","bottom","left"];RQ.reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);const MQ={left:"right",right:"left",bottom:"top",top:"bottom"};function Gm(e){return e.replace(/left|right|bottom|top/g,t=>MQ[t])}function DQ(e,t,n){n===void 0&&(n=!1);const r=qu(e),o=yl(e),s=Kb(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=Gm(a)),{main:a,cross:Gm(a)}}const AQ={start:"end",end:"start"};function j1(e){return e.replace(/start|end/g,t=>AQ[t])}const NQ=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:s,initialPlacement:a,platform:l,elements:u}=t,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:S=!0,...x}=bi(e,t),w=pa(r),_=pa(a)===a,k=await(l.isRTL==null?void 0:l.isRTL(u.floating)),P=m||(_||!S?[Gm(a)]:function(N){const U=Gm(N);return[j1(N),U,j1(U)]}(a));m||y==="none"||P.push(...function(N,U,z,F){const H=qu(N);let G=function(A,L,W){const V=["left","right"],ee=["right","left"],le=["top","bottom"],oe=["bottom","top"];switch(A){case"top":case"bottom":return W?L?ee:V:L?V:ee;case"left":case"right":return L?le:oe;default:return[]}}(pa(N),z==="start",F);return H&&(G=G.map(A=>A+"-"+H),U&&(G=G.concat(G.map(j1)))),G}(a,S,y,k));const I=[a,...P],j=await Zb(t,x),E=[];let T=((n=o.flip)==null?void 0:n.overflows)||[];if(f&&E.push(j[w]),p){const{main:N,cross:U}=DQ(r,s,k);E.push(j[N],j[U])}if(T=[...T,{placement:r,overflows:E}],!E.every(N=>N<=0)){var R,M;const N=(((R=o.flip)==null?void 0:R.index)||0)+1,U=I[N];if(U)return{data:{index:N,overflows:T},reset:{placement:U}};let z=(M=T.filter(F=>F.overflows[0]<=0).sort((F,H)=>F.overflows[1]-H.overflows[1])[0])==null?void 0:M.placement;if(!z)switch(v){case"bestFit":{var D;const F=(D=T.map(H=>[H.placement,H.overflows.filter(G=>G>0).reduce((G,A)=>G+A,0)]).sort((H,G)=>H[1]-G[1])[0])==null?void 0:D[0];F&&(z=F);break}case"initialPlacement":z=a}if(r!==z)return{reset:{placement:z}}}return{}}}};function X_(e){const t=il(...e.map(r=>r.left)),n=il(...e.map(r=>r.top));return{x:t,y:n,width:Na(...e.map(r=>r.right))-t,height:Na(...e.map(r=>r.bottom))-n}}const zQ=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:o,platform:s,strategy:a}=t,{padding:l=2,x:u,y:f}=bi(e,t),p=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(r.reference))||[]),m=function(x){const w=x.slice().sort((P,I)=>P.y-I.y),_=[];let k=null;for(let P=0;P<w.length;P++){const I=w[P];!k||I.y-k.y>k.height/2?_.push([I]):_[_.length-1].push(I),k=I}return _.map(P=>_u(X_(P)))}(p),v=_u(X_(p)),y=Xb(l),S=await s.getElementRects({reference:{getBoundingClientRect:function(){if(m.length===2&&m[0].left>m[1].right&&u!=null&&f!=null)return m.find(x=>u>x.left-y.left&&u<x.right+y.right&&f>x.top-y.top&&f<x.bottom+y.bottom)||v;if(m.length>=2){if(yl(n)==="x"){const j=m[0],E=m[m.length-1],T=pa(n)==="top",R=j.top,M=E.bottom,D=T?j.left:E.left,N=T?j.right:E.right;return{top:R,bottom:M,left:D,right:N,width:N-D,height:M-R,x:D,y:R}}const x=pa(n)==="left",w=Na(...m.map(j=>j.right)),_=il(...m.map(j=>j.left)),k=m.filter(j=>x?j.left===_:j.right===w),P=k[0].top,I=k[k.length-1].bottom;return{top:P,bottom:I,left:_,right:w,width:w-_,height:I-P,x:_,y:P}}return v}},floating:r.floating,strategy:a});return o.reference.x!==S.reference.x||o.reference.y!==S.reference.y||o.reference.width!==S.reference.width||o.reference.height!==S.reference.height?{reset:{rects:S}}:{}}}},$Q=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(s,a){const{placement:l,platform:u,elements:f}=s,p=await(u.isRTL==null?void 0:u.isRTL(f.floating)),m=pa(l),v=qu(l),y=yl(l)==="x",S=["left","top"].includes(m)?-1:1,x=p&&y?-1:1,w=bi(a,s);let{mainAxis:_,crossAxis:k,alignmentAxis:P}=typeof w=="number"?{mainAxis:w,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...w};return v&&typeof P=="number"&&(k=v==="end"?-1*P:P),y?{x:k*x,y:_*S}:{x:_*S,y:k*x}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};function HO(e){return e==="x"?"y":"x"}const LQ=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:w=>{let{x:_,y:k}=w;return{x:_,y:k}}},...u}=bi(e,t),f={x:n,y:r},p=await Zb(t,u),m=yl(pa(o)),v=HO(m);let y=f[m],S=f[v];if(s){const w=m==="y"?"bottom":"right";y=Zy(y+p[m==="y"?"top":"left"],y,y-p[w])}if(a){const w=v==="y"?"bottom":"right";S=Zy(S+p[v==="y"?"top":"left"],S,S-p[w])}const x=l.fn({...t,[m]:y,[v]:S});return{...x,data:{x:x.x-n,y:x.y-r}}}}},BQ=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:a}=t,{offset:l=0,mainAxis:u=!0,crossAxis:f=!0}=bi(e,t),p={x:n,y:r},m=yl(o),v=HO(m);let y=p[m],S=p[v];const x=bi(l,t),w=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(u){const P=m==="y"?"height":"width",I=s.reference[m]-s.floating[P]+w.mainAxis,j=s.reference[m]+s.reference[P]-w.mainAxis;y<I?y=I:y>j&&(y=j)}if(f){var _,k;const P=m==="y"?"width":"height",I=["top","left"].includes(pa(o)),j=s.reference[v]-s.floating[P]+(I&&((_=a.offset)==null?void 0:_[v])||0)+(I?0:w.crossAxis),E=s.reference[v]+s.reference[P]+(I?0:((k=a.offset)==null?void 0:k[v])||0)-(I?w.crossAxis:0);S<j?S=j:S>E&&(S=E)}return{[m]:y,[v]:S}}}},FQ=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:s}=t,{apply:a=()=>{},...l}=bi(e,t),u=await Zb(t,l),f=pa(n),p=qu(n),m=yl(n)==="x",{width:v,height:y}=r.floating;let S,x;f==="top"||f==="bottom"?(S=f,x=p===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(x=f,S=p==="end"?"top":"bottom");const w=y-u[S],_=v-u[x],k=!t.middlewareData.shift;let P=w,I=_;if(m){const E=v-u.left-u.right;I=p||k?il(_,E):E}else{const E=y-u.top-u.bottom;P=p||k?il(w,E):E}if(k&&!p){const E=Na(u.left,0),T=Na(u.right,0),R=Na(u.top,0),M=Na(u.bottom,0);m?I=v-2*(E!==0||T!==0?E+T:Na(u.left,u.right)):P=y-2*(R!==0||M!==0?R+M:Na(u.top,u.bottom))}await a({...t,availableWidth:I,availableHeight:P});const j=await o.getDimensions(s.floating);return v!==j.width||y!==j.height?{reset:{rects:!0}}:{}}}};function Ns(e){var t;return((t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ha(e){return Ns(e).getComputedStyle(e)}function VO(e){return e instanceof Ns(e).Node}function ll(e){return VO(e)?(e.nodeName||"").toLowerCase():"#document"}function _a(e){return e instanceof Ns(e).HTMLElement}function di(e){return e instanceof Ns(e).Element}function Z_(e){return typeof ShadowRoot<"u"&&(e instanceof Ns(e).ShadowRoot||e instanceof ShadowRoot)}function xf(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ha(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function HQ(e){return["table","td","th"].includes(ll(e))}function Qy(e){const t=Qb(),n=ha(e);return n.transform!=="none"||n.perspective!=="none"||!t&&!!n.backdropFilter&&n.backdropFilter!=="none"||!t&&!!n.filter&&n.filter!=="none"||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Qb(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Cv(e){return["html","body","#document"].includes(ll(e))}const Jy=Math.min,pu=Math.max,qm=Math.round,fh=Math.floor,uc=e=>({x:e,y:e});function WO(e){const t=ha(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=_a(e),s=o?e.offsetWidth:n,a=o?e.offsetHeight:r,l=qm(n)!==s||qm(r)!==a;return l&&(n=s,r=a),{width:n,height:r,$:l}}function Jb(e){return di(e)?e:e.contextElement}function hu(e){const t=Jb(e);if(!_a(t))return uc(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=WO(t);let a=(s?qm(n.width):n.width)/r,l=(s?qm(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),l&&Number.isFinite(l)||(l=1),{x:a,y:l}}const Q_=uc(0);function UO(e,t,n){var r,o;if(t===void 0&&(t=!0),!Qb())return Q_;const s=e?Ns(e):window;return!n||t&&n!==s?Q_:{x:((r=s.visualViewport)==null?void 0:r.offsetLeft)||0,y:((o=s.visualViewport)==null?void 0:o.offsetTop)||0}}function dc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Jb(e);let a=uc(1);t&&(r?di(r)&&(a=hu(r)):a=hu(e));const l=UO(s,n,r);let u=(o.left+l.x)/a.x,f=(o.top+l.y)/a.y,p=o.width/a.x,m=o.height/a.y;if(s){const v=Ns(s),y=r&&di(r)?Ns(r):r;let S=v.frameElement;for(;S&&r&&y!==v;){const x=hu(S),w=S.getBoundingClientRect(),_=getComputedStyle(S),k=w.left+(S.clientLeft+parseFloat(_.paddingLeft))*x.x,P=w.top+(S.clientTop+parseFloat(_.paddingTop))*x.y;u*=x.x,f*=x.y,p*=x.x,m*=x.y,u+=k,f+=P,S=Ns(S).frameElement}}return _u({width:p,height:m,x:u,y:f})}function fi(e){return((VO(e)?e.ownerDocument:e.document)||window.document).documentElement}function _v(e){return di(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function GO(e){return dc(fi(e)).left+_v(e).scrollLeft}function ku(e){if(ll(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Z_(e)&&e.host||fi(e);return Z_(t)?t.host:t}function qO(e){const t=ku(e);return Cv(t)?e.ownerDocument?e.ownerDocument.body:e.body:_a(t)&&xf(t)?t:qO(t)}function Ym(e,t){var n;t===void 0&&(t=[]);const r=qO(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),s=Ns(r);return o?t.concat(s,s.visualViewport||[],xf(r)?r:[]):t.concat(r,Ym(r))}function J_(e,t,n){let r;if(t==="viewport")r=function(o,s){const a=Ns(o),l=fi(o),u=a.visualViewport;let f=l.clientWidth,p=l.clientHeight,m=0,v=0;if(u){f=u.width,p=u.height;const y=Qb();(!y||y&&s==="fixed")&&(m=u.offsetLeft,v=u.offsetTop)}return{width:f,height:p,x:m,y:v}}(e,n);else if(t==="document")r=function(o){const s=fi(o),a=_v(o),l=o.ownerDocument.body,u=pu(s.scrollWidth,s.clientWidth,l.scrollWidth,l.clientWidth),f=pu(s.scrollHeight,s.clientHeight,l.scrollHeight,l.clientHeight);let p=-a.scrollLeft+GO(o);const m=-a.scrollTop;return ha(l).direction==="rtl"&&(p+=pu(s.clientWidth,l.clientWidth)-u),{width:u,height:f,x:p,y:m}}(fi(e));else if(di(t))r=function(o,s){const a=dc(o,!0,s==="fixed"),l=a.top+o.clientTop,u=a.left+o.clientLeft,f=_a(o)?hu(o):uc(1);return{width:o.clientWidth*f.x,height:o.clientHeight*f.y,x:u*f.x,y:l*f.y}}(t,n);else{const o=UO(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return _u(r)}function YO(e,t){const n=ku(e);return!(n===t||!di(n)||Cv(n))&&(ha(n).position==="fixed"||YO(n,t))}function ek(e,t){return _a(e)&&ha(e).position!=="fixed"?t?t(e):e.offsetParent:null}function tk(e,t){const n=Ns(e);if(!_a(e))return n;let r=ek(e,t);for(;r&&HQ(r)&&ha(r).position==="static";)r=ek(r,t);return r&&(ll(r)==="html"||ll(r)==="body"&&ha(r).position==="static"&&!Qy(r))?n:r||function(o){let s=ku(o);for(;_a(s)&&!Cv(s);){if(Qy(s))return s;s=ku(s)}return null}(e)||n}function VQ(e,t,n){const r=_a(t),o=fi(t),s=n==="fixed",a=dc(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const u=uc(0);if(r||!r&&!s)if((ll(t)!=="body"||xf(o))&&(l=_v(t)),_a(t)){const f=dc(t,!0,s,t);u.x=f.x+t.clientLeft,u.y=f.y+t.clientTop}else o&&(u.x=GO(o));return{x:a.left+l.scrollLeft-u.x,y:a.top+l.scrollTop-u.y,width:a.width,height:a.height}}const WQ={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=n==="clippingAncestors"?function(f,p){const m=p.get(f);if(m)return m;let v=Ym(f).filter(w=>di(w)&&ll(w)!=="body"),y=null;const S=ha(f).position==="fixed";let x=S?ku(f):f;for(;di(x)&&!Cv(x);){const w=ha(x),_=Qy(x);_||w.position!=="fixed"||(y=null),(S?!_&&!y:!_&&w.position==="static"&&y&&["absolute","fixed"].includes(y.position)||xf(x)&&!_&&YO(f,x))?v=v.filter(k=>k!==x):y=w,x=ku(x)}return p.set(f,v),v}(t,this._c):[].concat(n),a=[...s,r],l=a[0],u=a.reduce((f,p)=>{const m=J_(t,p,o);return f.top=pu(m.top,f.top),f.right=Jy(m.right,f.right),f.bottom=Jy(m.bottom,f.bottom),f.left=pu(m.left,f.left),f},J_(t,l,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=_a(n),s=fi(n);if(n===s)return t;let a={scrollLeft:0,scrollTop:0},l=uc(1);const u=uc(0);if((o||!o&&r!=="fixed")&&((ll(n)!=="body"||xf(s))&&(a=_v(n)),_a(n))){const f=dc(n);l=hu(n),u.x=f.x+n.clientLeft,u.y=f.y+n.clientTop}return{width:t.width*l.x,height:t.height*l.y,x:t.x*l.x-a.scrollLeft*l.x+u.x,y:t.y*l.y-a.scrollTop*l.y+u.y}},isElement:di,getDimensions:function(e){return WO(e)},getOffsetParent:tk,getDocumentElement:fi,getScale:hu,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||tk,s=this.getDimensions;return{reference:VQ(t,await o(n),r),floating:{x:0,y:0,...await s(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>ha(e).direction==="rtl"};function UQ(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:a=!0,layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,f=Jb(e),p=o||s?[...f?Ym(f):[],...Ym(t)]:[];p.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),s&&x.addEventListener("resize",n)});const m=f&&l?function(x,w){let _,k=null;const P=fi(x);function I(){clearTimeout(_),k&&k.disconnect(),k=null}return function j(E,T){E===void 0&&(E=!1),T===void 0&&(T=1),I();const{left:R,top:M,width:D,height:N}=x.getBoundingClientRect();if(E||w(),!D||!N)return;const U=fh(M),z=fh(P.clientWidth-(R+D)),F=fh(P.clientHeight-(M+N)),H=fh(R);let G=!0;k=new IntersectionObserver(A=>{const L=A[0].intersectionRatio;if(L!==T){if(!G)return j();L?j(!1,L):_=setTimeout(()=>{j(!1,1e-7)},100)}G=!1},{rootMargin:-U+"px "+-z+"px "+-F+"px "+-H+"px",threshold:pu(0,Jy(1,T))||1}),k.observe(x)}(!0),I}(f,n):null;let v,y=null;a&&(y=new ResizeObserver(n),f&&!u&&y.observe(f),y.observe(t));let S=u?dc(e):null;return u&&function x(){const w=dc(e);!S||w.x===S.x&&w.y===S.y&&w.width===S.width&&w.height===S.height||n(),S=w,v=requestAnimationFrame(x)}(),n(),()=>{p.forEach(x=>{o&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),m&&m(),y&&y.disconnect(),y=null,u&&cancelAnimationFrame(v)}}const GQ=(e,t,n)=>{const r=new Map,o={platform:WQ,...n},s={...o.platform,_c:r};return TQ(e,t,{...o,platform:s})},qQ=e=>{const{element:t,padding:n}=e;function r(o){return Object.prototype.hasOwnProperty.call(o,"current")}return{name:"arrow",options:e,fn(o){return r(t)?t.current!=null?K_({element:t.current,padding:n}).fn(o):{}:t?K_({element:t,padding:n}).fn(o):{}}}};var Lh=typeof document<"u"?h.useLayoutEffect:h.useEffect;function Km(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!Km(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Km(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function nk(e){const t=h.useRef(e);return Lh(()=>{t.current=e}),t}function YQ(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,whileElementsMounted:s,open:a}=e,[l,u]=h.useState({x:null,y:null,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=h.useState(r);Km(f,r)||p(r);const m=h.useRef(null),v=h.useRef(null),y=h.useRef(l),S=nk(s),x=nk(o),[w,_]=h.useState(null),[k,P]=h.useState(null),I=h.useCallback(D=>{m.current!==D&&(m.current=D,_(D))},[]),j=h.useCallback(D=>{v.current!==D&&(v.current=D,P(D))},[]),E=h.useCallback(()=>{if(!m.current||!v.current)return;const D={placement:t,strategy:n,middleware:f};x.current&&(D.platform=x.current),GQ(m.current,v.current,D).then(N=>{const U={...N,isPositioned:!0};T.current&&!Km(y.current,U)&&(y.current=U,_g.flushSync(()=>{u(U)}))})},[f,t,n,x]);Lh(()=>{a===!1&&y.current.isPositioned&&(y.current.isPositioned=!1,u(D=>({...D,isPositioned:!1})))},[a]);const T=h.useRef(!1);Lh(()=>(T.current=!0,()=>{T.current=!1}),[]),Lh(()=>{if(w&&k){if(S.current)return S.current(w,k,E);E()}},[w,k,E,S]);const R=h.useMemo(()=>({reference:m,floating:v,setReference:I,setFloating:j}),[I,j]),M=h.useMemo(()=>({reference:w,floating:k}),[w,k]);return h.useMemo(()=>({...l,update:E,refs:R,elements:M,reference:I,floating:j}),[l,E,R,M,I,j])}var KQ=typeof document<"u"?h.useLayoutEffect:h.useEffect;function XQ(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){e.set(t,(e.get(t)||[]).filter(r=>r!==n))}}}const ZQ=h.createContext(null),QQ=()=>h.useContext(ZQ);function JQ(e){return(e==null?void 0:e.ownerDocument)||document}function eJ(e){return JQ(e).defaultView||window}function ph(e){return e?e instanceof eJ(e).Element:!1}const tJ=Cx["useInsertionEffect".toString()],nJ=tJ||(e=>e());function rJ(e){const t=h.useRef(()=>{});return nJ(()=>{t.current=e}),h.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function oJ(e){e===void 0&&(e={});const{open:t=!1,onOpenChange:n,nodeId:r}=e,o=YQ(e),s=QQ(),a=h.useRef(null),l=h.useRef({}),u=h.useState(()=>XQ())[0],[f,p]=h.useState(null),m=h.useCallback(_=>{const k=ph(_)?{getBoundingClientRect:()=>_.getBoundingClientRect(),contextElement:_}:_;o.refs.setReference(k)},[o.refs]),v=h.useCallback(_=>{(ph(_)||_===null)&&(a.current=_,p(_)),(ph(o.refs.reference.current)||o.refs.reference.current===null||_!==null&&!ph(_))&&o.refs.setReference(_)},[o.refs]),y=h.useMemo(()=>({...o.refs,setReference:v,setPositionReference:m,domReference:a}),[o.refs,v,m]),S=h.useMemo(()=>({...o.elements,domReference:f}),[o.elements,f]),x=rJ(n),w=h.useMemo(()=>({...o,refs:y,elements:S,dataRef:l,nodeId:r,events:u,open:t,onOpenChange:x}),[o,r,u,t,x,y,S]);return KQ(()=>{const _=s==null?void 0:s.nodesRef.current.find(k=>k.id===r);_&&(_.context=w)}),h.useMemo(()=>({...o,context:w,refs:y,reference:v,positionReference:m}),[o,y,w,v,m])}function sJ({opened:e,floating:t,position:n,positionDependencies:r}){const[o,s]=h.useState(0);h.useEffect(()=>{if(t.refs.reference.current&&t.refs.floating.current)return UQ(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,o,n]),fa(()=>{t.update()},r),fa(()=>{s(a=>a+1)},[e])}function aJ(e){const t=[$Q(e.offset)];return e.middlewares.shift&&t.push(LQ({limiter:BQ()})),e.middlewares.flip&&t.push(NQ()),e.middlewares.inline&&t.push(zQ()),t.push(qQ({element:e.arrowRef,padding:e.arrowOffset})),t}function iJ(e){const[t,n]=yf({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=()=>{var a;(a=e.onClose)==null||a.call(e),n(!1)},o=()=>{var a,l;t?((a=e.onClose)==null||a.call(e),n(!1)):((l=e.onOpen)==null||l.call(e),n(!0))},s=oJ({placement:e.position,middleware:[...aJ(e),...e.width==="target"?[FQ({apply({rects:a}){var l,u;Object.assign((u=(l=s.refs.floating.current)==null?void 0:l.style)!=null?u:{},{width:`${a.reference.width}px`})}})]:[]]});return sJ({opened:e.opened,position:e.position,positionDependencies:e.positionDependencies,floating:s}),fa(()=>{var a;(a=e.onPositionChange)==null||a.call(e,s.placement)},[s.placement]),fa(()=>{var a,l;e.opened?(l=e.onOpen)==null||l.call(e):(a=e.onClose)==null||a.call(e)},[e.opened]),{floating:s,controlled:typeof e.opened=="boolean",opened:t,onClose:r,onToggle:o}}const KO={context:"Popover component was not found in the tree",children:"Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported"},[lJ,XO]=BY(KO.context);var cJ=Object.defineProperty,uJ=Object.defineProperties,dJ=Object.getOwnPropertyDescriptors,Xm=Object.getOwnPropertySymbols,ZO=Object.prototype.hasOwnProperty,QO=Object.prototype.propertyIsEnumerable,rk=(e,t,n)=>t in e?cJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hh=(e,t)=>{for(var n in t||(t={}))ZO.call(t,n)&&rk(e,n,t[n]);if(Xm)for(var n of Xm(t))QO.call(t,n)&&rk(e,n,t[n]);return e},fJ=(e,t)=>uJ(e,dJ(t)),pJ=(e,t)=>{var n={};for(var r in e)ZO.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Xm)for(var r of Xm(e))t.indexOf(r)<0&&QO.call(e,r)&&(n[r]=e[r]);return n};const hJ={refProp:"ref",popupType:"dialog"},JO=h.forwardRef((e,t)=>{const n=qr("PopoverTarget",hJ,e),{children:r,refProp:o,popupType:s}=n,a=pJ(n,["children","refProp","popupType"]);if(!TE(r))throw new Error(KO.children);const l=a,u=XO(),f=gv(u.reference,r.ref,t),p=u.withRoles?{"aria-haspopup":s,"aria-expanded":u.opened,"aria-controls":u.getDropdownId(),id:u.getTargetId()}:{};return h.cloneElement(r,hh(fJ(hh(hh(hh({},l),p),u.targetProps),{className:ME(u.targetProps.className,l.className,r.props.className),[o]:f}),u.controlled?null:{onClick:u.onToggle}))});JO.displayName="@mantine/core/PopoverTarget";var mJ=ko((e,{radius:t,shadow:n})=>({dropdown:{position:"absolute",backgroundColor:e.white,background:e.colorScheme==="dark"?e.colors.dark[6]:e.white,border:`${qe(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`,padding:`${e.spacing.sm} ${e.spacing.md}`,boxShadow:e.shadows[n]||n||"none",borderRadius:e.fn.radius(t),"&:focus":{outline:0}},arrow:{backgroundColor:"inherit",border:`${qe(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`,zIndex:1}}));const gJ=mJ;var vJ=Object.defineProperty,ok=Object.getOwnPropertySymbols,yJ=Object.prototype.hasOwnProperty,xJ=Object.prototype.propertyIsEnumerable,sk=(e,t,n)=>t in e?vJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Bc=(e,t)=>{for(var n in t||(t={}))yJ.call(t,n)&&sk(e,n,t[n]);if(ok)for(var n of ok(t))xJ.call(t,n)&&sk(e,n,t[n]);return e};const ak={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function bJ({transition:e,state:t,duration:n,timingFunction:r}){const o={transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e=="string"?e in ah?Bc(Bc(Bc({transitionProperty:ah[e].transitionProperty},o),ah[e].common),ah[e][ak[t]]):null:Bc(Bc(Bc({transitionProperty:e.transitionProperty},o),e.common),e[ak[t]])}function wJ({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:o,onExit:s,onEntered:a,onExited:l}){const u=_i(),f=LE(),p=u.respectReducedMotion?f:!1,[m,v]=h.useState(p?0:e),[y,S]=h.useState(r?"entered":"exited"),x=h.useRef(-1),w=_=>{const k=_?o:s,P=_?a:l;S(_?"pre-entering":"pre-exiting"),window.clearTimeout(x.current);const I=p?0:_?e:t;if(v(I),I===0)typeof k=="function"&&k(),typeof P=="function"&&P(),S(_?"entered":"exited");else{const j=window.setTimeout(()=>{typeof k=="function"&&k(),S(_?"entering":"exiting")},10);x.current=window.setTimeout(()=>{window.clearTimeout(j),typeof P=="function"&&P(),S(_?"entered":"exited")},I)}};return fa(()=>{w(r)},[r]),h.useEffect(()=>()=>window.clearTimeout(x.current),[]),{transitionDuration:m,transitionStatus:y,transitionTimingFunction:n||u.transitionTimingFunction}}function eT({keepMounted:e,transition:t,duration:n=250,exitDuration:r=n,mounted:o,children:s,timingFunction:a,onExit:l,onEntered:u,onEnter:f,onExited:p}){const{transitionDuration:m,transitionStatus:v,transitionTimingFunction:y}=wJ({mounted:o,exitDuration:r,duration:n,timingFunction:a,onExit:l,onEntered:u,onEnter:f,onExited:p});return m===0?o?B.createElement(B.Fragment,null,s({})):e?s({display:"none"}):null:v==="exited"?e?s({display:"none"}):null:B.createElement(B.Fragment,null,s(bJ({transition:t,duration:m,state:v,timingFunction:y})))}eT.displayName="@mantine/core/Transition";function tT({children:e,active:t=!0,refProp:n="ref"}){const r=bK(t),o=gv(r,e==null?void 0:e.ref);return TE(e)?h.cloneElement(e,{[n]:o}):e}tT.displayName="@mantine/core/FocusTrap";var SJ=Object.defineProperty,CJ=Object.defineProperties,_J=Object.getOwnPropertyDescriptors,ik=Object.getOwnPropertySymbols,kJ=Object.prototype.hasOwnProperty,PJ=Object.prototype.propertyIsEnumerable,lk=(e,t,n)=>t in e?SJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$i=(e,t)=>{for(var n in t||(t={}))kJ.call(t,n)&&lk(e,n,t[n]);if(ik)for(var n of ik(t))PJ.call(t,n)&&lk(e,n,t[n]);return e},mh=(e,t)=>CJ(e,_J(t));function ck(e,t,n,r){return e==="center"||r==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function uk(e,t,n,r,o){return e==="center"||r==="center"?{left:t}:e==="end"?{[o==="ltr"?"right":"left"]:n}:e==="start"?{[o==="ltr"?"left":"right"]:n}:{}}const jJ={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function IJ({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,arrowX:s,arrowY:a,dir:l}){const[u,f="center"]=e.split("-"),p={width:qe(t),height:qe(t),transform:"rotate(45deg)",position:"absolute",[jJ[u]]:qe(r)},m=qe(-t/2);return u==="left"?mh($i($i({},p),ck(f,a,n,o)),{right:m,borderLeftColor:"transparent",borderBottomColor:"transparent"}):u==="right"?mh($i($i({},p),ck(f,a,n,o)),{left:m,borderRightColor:"transparent",borderTopColor:"transparent"}):u==="top"?mh($i($i({},p),uk(f,s,n,o,l)),{bottom:m,borderTopColor:"transparent",borderLeftColor:"transparent"}):u==="bottom"?mh($i($i({},p),uk(f,s,n,o,l)),{top:m,borderBottomColor:"transparent",borderRightColor:"transparent"}):{}}var EJ=Object.defineProperty,OJ=Object.defineProperties,TJ=Object.getOwnPropertyDescriptors,Zm=Object.getOwnPropertySymbols,nT=Object.prototype.hasOwnProperty,rT=Object.prototype.propertyIsEnumerable,dk=(e,t,n)=>t in e?EJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,RJ=(e,t)=>{for(var n in t||(t={}))nT.call(t,n)&&dk(e,n,t[n]);if(Zm)for(var n of Zm(t))rT.call(t,n)&&dk(e,n,t[n]);return e},MJ=(e,t)=>OJ(e,TJ(t)),DJ=(e,t)=>{var n={};for(var r in e)nT.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Zm)for(var r of Zm(e))t.indexOf(r)<0&&rT.call(e,r)&&(n[r]=e[r]);return n};const oT=h.forwardRef((e,t)=>{var n=e,{position:r,arrowSize:o,arrowOffset:s,arrowRadius:a,arrowPosition:l,visible:u,arrowX:f,arrowY:p}=n,m=DJ(n,["position","arrowSize","arrowOffset","arrowRadius","arrowPosition","visible","arrowX","arrowY"]);const v=_i();return u?B.createElement("div",MJ(RJ({},m),{ref:t,style:IJ({position:r,arrowSize:o,arrowOffset:s,arrowRadius:a,arrowPosition:l,dir:v.dir,arrowX:f,arrowY:p})})):null});oT.displayName="@mantine/core/FloatingArrow";var AJ=Object.defineProperty,NJ=Object.defineProperties,zJ=Object.getOwnPropertyDescriptors,Qm=Object.getOwnPropertySymbols,sT=Object.prototype.hasOwnProperty,aT=Object.prototype.propertyIsEnumerable,fk=(e,t,n)=>t in e?AJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Fc=(e,t)=>{for(var n in t||(t={}))sT.call(t,n)&&fk(e,n,t[n]);if(Qm)for(var n of Qm(t))aT.call(t,n)&&fk(e,n,t[n]);return e},gh=(e,t)=>NJ(e,zJ(t)),$J=(e,t)=>{var n={};for(var r in e)sT.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Qm)for(var r of Qm(e))t.indexOf(r)<0&&aT.call(e,r)&&(n[r]=e[r]);return n};const LJ={};function iT(e){var t;const n=qr("PopoverDropdown",LJ,e),{style:r,className:o,children:s,onKeyDownCapture:a}=n,l=$J(n,["style","className","children","onKeyDownCapture"]),u=XO(),{classes:f,cx:p}=gJ({radius:u.radius,shadow:u.shadow},{name:u.__staticSelector,classNames:u.classNames,styles:u.styles,unstyled:u.unstyled,variant:u.variant}),m=pK({opened:u.opened,shouldReturnFocus:u.returnFocus}),v=u.withRoles?{"aria-labelledby":u.getTargetId(),id:u.getDropdownId(),role:"dialog"}:{};return u.disabled?null:B.createElement(uO,gh(Fc({},u.portalProps),{withinPortal:u.withinPortal}),B.createElement(eT,gh(Fc({mounted:u.opened},u.transitionProps),{transition:u.transitionProps.transition||"fade",duration:(t=u.transitionProps.duration)!=null?t:150,keepMounted:u.keepMounted,exitDuration:typeof u.transitionProps.exitDuration=="number"?u.transitionProps.exitDuration:u.transitionProps.duration}),y=>{var S,x;return B.createElement(tT,{active:u.trapFocus},B.createElement(Yo,Fc(gh(Fc({},v),{tabIndex:-1,ref:u.floating,style:gh(Fc(Fc({},r),y),{zIndex:u.zIndex,top:(S=u.y)!=null?S:0,left:(x=u.x)!=null?x:0,width:u.width==="target"?void 0:qe(u.width)}),className:p(f.dropdown,o),onKeyDownCapture:HY(u.onClose,{active:u.closeOnEscape,onTrigger:m,onKeyDown:a}),"data-position":u.placement}),l),s,B.createElement(oT,{ref:u.arrowRef,arrowX:u.arrowX,arrowY:u.arrowY,visible:u.withArrow,position:u.placement,arrowSize:u.arrowSize,arrowRadius:u.arrowRadius,arrowOffset:u.arrowOffset,arrowPosition:u.arrowPosition,className:f.arrow})))}))}iT.displayName="@mantine/core/PopoverDropdown";function BJ(e,t){if(e==="rtl"&&(t.includes("right")||t.includes("left"))){const[n,r]=t.split("-"),o=n==="right"?"left":"right";return r===void 0?o:`${o}-${r}`}return t}var pk=Object.getOwnPropertySymbols,FJ=Object.prototype.hasOwnProperty,HJ=Object.prototype.propertyIsEnumerable,VJ=(e,t)=>{var n={};for(var r in e)FJ.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&pk)for(var r of pk(e))t.indexOf(r)<0&&HJ.call(e,r)&&(n[r]=e[r]);return n};const WJ={position:"bottom",offset:8,positionDependencies:[],transitionProps:{transition:"fade",duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:"side",closeOnClickOutside:!0,withinPortal:!1,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,clickOutsideEvents:["mousedown","touchstart"],zIndex:Vb("popover"),__staticSelector:"Popover",width:"max-content"};function Yu(e){var t,n,r,o,s,a;const l=h.useRef(null),u=qr("Popover",WJ,e),{children:f,position:p,offset:m,onPositionChange:v,positionDependencies:y,opened:S,transitionProps:x,width:w,middlewares:_,withArrow:k,arrowSize:P,arrowOffset:I,arrowRadius:j,arrowPosition:E,unstyled:T,classNames:R,styles:M,closeOnClickOutside:D,withinPortal:N,portalProps:U,closeOnEscape:z,clickOutsideEvents:F,trapFocus:H,onClose:G,onOpen:A,onChange:L,zIndex:W,radius:V,shadow:ee,id:le,defaultOpened:oe,__staticSelector:X,withRoles:Q,disabled:ie,returnFocus:ve,variant:ye,keepMounted:se}=u,de=VJ(u,["children","position","offset","onPositionChange","positionDependencies","opened","transitionProps","width","middlewares","withArrow","arrowSize","arrowOffset","arrowRadius","arrowPosition","unstyled","classNames","styles","closeOnClickOutside","withinPortal","portalProps","closeOnEscape","clickOutsideEvents","trapFocus","onClose","onOpen","onChange","zIndex","radius","shadow","id","defaultOpened","__staticSelector","withRoles","disabled","returnFocus","variant","keepMounted"]),[fe,xe]=h.useState(null),[ke,ae]=h.useState(null),Pe=Ub(le),tt=_i(),ze=iJ({middlewares:_,width:w,position:BJ(tt.dir,p),offset:typeof m=="number"?m+(k?P/2:0):m,arrowRef:l,arrowOffset:I,onPositionChange:v,positionDependencies:y,opened:S,defaultOpened:oe,onChange:L,onOpen:A,onClose:G});cK(()=>ze.opened&&D&&ze.onClose(),F,[fe,ke]);const We=h.useCallback(pt=>{xe(pt),ze.floating.reference(pt)},[ze.floating.reference]),It=h.useCallback(pt=>{ae(pt),ze.floating.floating(pt)},[ze.floating.floating]);return B.createElement(lJ,{value:{returnFocus:ve,disabled:ie,controlled:ze.controlled,reference:We,floating:It,x:ze.floating.x,y:ze.floating.y,arrowX:(r=(n=(t=ze.floating)==null?void 0:t.middlewareData)==null?void 0:n.arrow)==null?void 0:r.x,arrowY:(a=(s=(o=ze.floating)==null?void 0:o.middlewareData)==null?void 0:s.arrow)==null?void 0:a.y,opened:ze.opened,arrowRef:l,transitionProps:x,width:w,withArrow:k,arrowSize:P,arrowOffset:I,arrowRadius:j,arrowPosition:E,placement:ze.floating.placement,trapFocus:H,withinPortal:N,portalProps:U,zIndex:W,radius:V,shadow:ee,closeOnEscape:z,onClose:ze.onClose,onToggle:ze.onToggle,getTargetId:()=>`${Pe}-target`,getDropdownId:()=>`${Pe}-dropdown`,withRoles:Q,targetProps:de,__staticSelector:X,classNames:R,styles:M,unstyled:T,variant:ye,keepMounted:se}},f)}Yu.Target=JO;Yu.Dropdown=iT;Yu.displayName="@mantine/core/Popover";var UJ=Object.defineProperty,Jm=Object.getOwnPropertySymbols,lT=Object.prototype.hasOwnProperty,cT=Object.prototype.propertyIsEnumerable,hk=(e,t,n)=>t in e?UJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,GJ=(e,t)=>{for(var n in t||(t={}))lT.call(t,n)&&hk(e,n,t[n]);if(Jm)for(var n of Jm(t))cT.call(t,n)&&hk(e,n,t[n]);return e},qJ=(e,t)=>{var n={};for(var r in e)lT.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Jm)for(var r of Jm(e))t.indexOf(r)<0&&cT.call(e,r)&&(n[r]=e[r]);return n};function YJ(e){var t=e,{children:n,component:r="div",maxHeight:o=220,direction:s="column",id:a,innerRef:l,__staticSelector:u,styles:f,classNames:p,unstyled:m}=t,v=qJ(t,["children","component","maxHeight","direction","id","innerRef","__staticSelector","styles","classNames","unstyled"]);const{classes:y}=OQ(null,{name:u,styles:f,classNames:p,unstyled:m});return B.createElement(Yu.Dropdown,GJ({p:0,onMouseDown:S=>S.preventDefault()},v),B.createElement("div",{style:{maxHeight:qe(o),display:"flex"}},B.createElement(Yo,{component:r||"div",id:`${a}-items`,"aria-labelledby":`${a}-label`,role:"listbox",onMouseDown:S=>S.preventDefault(),style:{flex:1,overflowY:r!==Sv?"auto":void 0},"data-combobox-popover":!0,tabIndex:-1,ref:l},B.createElement("div",{className:y.itemsWrapper,style:{flexDirection:s}},n))))}function Qi({opened:e,transitionProps:t={transition:"fade",duration:0},shadow:n,withinPortal:r,portalProps:o,children:s,__staticSelector:a,onDirectionChange:l,switchDirectionOnFlip:u,zIndex:f,dropdownPosition:p,positionDependencies:m=[],classNames:v,styles:y,unstyled:S,readOnly:x,variant:w}){return B.createElement(Yu,{unstyled:S,classNames:v,styles:y,width:"target",withRoles:!1,opened:e,middlewares:{flip:p==="flip",shift:!1},position:p==="flip"?"bottom":p,positionDependencies:m,zIndex:f,__staticSelector:a,withinPortal:r,portalProps:o,transitionProps:t,shadow:n,disabled:x,onPositionChange:_=>u&&(l==null?void 0:l(_==="top"?"column-reverse":"column")),variant:w},s)}Qi.Target=Yu.Target;Qi.Dropdown=YJ;var KJ=Object.defineProperty,XJ=Object.defineProperties,ZJ=Object.getOwnPropertyDescriptors,eg=Object.getOwnPropertySymbols,uT=Object.prototype.hasOwnProperty,dT=Object.prototype.propertyIsEnumerable,mk=(e,t,n)=>t in e?KJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vh=(e,t)=>{for(var n in t||(t={}))uT.call(t,n)&&mk(e,n,t[n]);if(eg)for(var n of eg(t))dT.call(t,n)&&mk(e,n,t[n]);return e},QJ=(e,t)=>XJ(e,ZJ(t)),JJ=(e,t)=>{var n={};for(var r in e)uT.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&eg)for(var r of eg(e))t.indexOf(r)<0&&dT.call(e,r)&&(n[r]=e[r]);return n};function eee(e,t,n){const r=qr(e,t,n),{label:o,description:s,error:a,required:l,classNames:u,styles:f,className:p,unstyled:m,__staticSelector:v,sx:y,errorProps:S,labelProps:x,descriptionProps:w,wrapperProps:_,id:k,size:P,style:I,inputContainer:j,inputWrapperOrder:E,withAsterisk:T,variant:R}=r,M=JJ(r,["label","description","error","required","classNames","styles","className","unstyled","__staticSelector","sx","errorProps","labelProps","descriptionProps","wrapperProps","id","size","style","inputContainer","inputWrapperOrder","withAsterisk","variant"]),D=Ub(k),{systemStyles:N,rest:U}=vv(M),z=vh({label:o,description:s,error:a,required:l,classNames:u,className:p,__staticSelector:v,sx:y,errorProps:S,labelProps:x,descriptionProps:w,unstyled:m,styles:f,id:D,size:P,style:I,inputContainer:j,inputWrapperOrder:E,withAsterisk:T,variant:R},_);return QJ(vh({},U),{classNames:u,styles:f,unstyled:m,wrapperProps:vh(vh({},z),N),inputProps:{required:l,classNames:u,styles:f,unstyled:m,id:D,size:P,__staticSelector:v,error:a,variant:R}})}var tee=ko((e,t,{size:n})=>({label:{display:"inline-block",fontSize:Kt({size:n,sizes:e.fontSizes}),fontWeight:500,color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[9],wordBreak:"break-word",cursor:"default",WebkitTapHighlightColor:"transparent"},required:{color:e.fn.variant({variant:"filled",color:"red"}).background}}));const nee=tee;var ree=Object.defineProperty,tg=Object.getOwnPropertySymbols,fT=Object.prototype.hasOwnProperty,pT=Object.prototype.propertyIsEnumerable,gk=(e,t,n)=>t in e?ree(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,oee=(e,t)=>{for(var n in t||(t={}))fT.call(t,n)&&gk(e,n,t[n]);if(tg)for(var n of tg(t))pT.call(t,n)&&gk(e,n,t[n]);return e},see=(e,t)=>{var n={};for(var r in e)fT.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&tg)for(var r of tg(e))t.indexOf(r)<0&&pT.call(e,r)&&(n[r]=e[r]);return n};const aee={labelElement:"label",size:"sm"},e2=h.forwardRef((e,t)=>{const n=qr("InputLabel",aee,e),{labelElement:r,children:o,required:s,size:a,classNames:l,styles:u,unstyled:f,className:p,htmlFor:m,__staticSelector:v,variant:y,onMouseDown:S}=n,x=see(n,["labelElement","children","required","size","classNames","styles","unstyled","className","htmlFor","__staticSelector","variant","onMouseDown"]),{classes:w,cx:_}=nee(null,{name:["InputWrapper",v],classNames:l,styles:u,unstyled:f,variant:y,size:a});return B.createElement(Yo,oee({component:r,ref:t,className:_(w.label,p),htmlFor:r==="label"?m:void 0,onMouseDown:k=>{S==null||S(k),!k.defaultPrevented&&k.detail>1&&k.preventDefault()}},x),o,s&&B.createElement("span",{className:w.required,"aria-hidden":!0}," *"))});e2.displayName="@mantine/core/InputLabel";var iee=ko((e,t,{size:n})=>({error:{wordBreak:"break-word",color:e.fn.variant({variant:"filled",color:"red"}).background,fontSize:`calc(${Kt({size:n,sizes:e.fontSizes})} - ${qe(2)})`,lineHeight:1.2,display:"block"}}));const lee=iee;var cee=Object.defineProperty,ng=Object.getOwnPropertySymbols,hT=Object.prototype.hasOwnProperty,mT=Object.prototype.propertyIsEnumerable,vk=(e,t,n)=>t in e?cee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,uee=(e,t)=>{for(var n in t||(t={}))hT.call(t,n)&&vk(e,n,t[n]);if(ng)for(var n of ng(t))mT.call(t,n)&&vk(e,n,t[n]);return e},dee=(e,t)=>{var n={};for(var r in e)hT.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ng)for(var r of ng(e))t.indexOf(r)<0&&mT.call(e,r)&&(n[r]=e[r]);return n};const fee={size:"sm"},t2=h.forwardRef((e,t)=>{const n=qr("InputError",fee,e),{children:r,className:o,classNames:s,styles:a,unstyled:l,size:u,__staticSelector:f,variant:p}=n,m=dee(n,["children","className","classNames","styles","unstyled","size","__staticSelector","variant"]),{classes:v,cx:y}=lee(null,{name:["InputWrapper",f],classNames:s,styles:a,unstyled:l,variant:p,size:u});return B.createElement(yv,uee({className:y(v.error,o),ref:t},m),r)});t2.displayName="@mantine/core/InputError";var pee=ko((e,t,{size:n})=>({description:{wordBreak:"break-word",color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],fontSize:`calc(${Kt({size:n,sizes:e.fontSizes})} - ${qe(2)})`,lineHeight:1.2,display:"block"}}));const hee=pee;var mee=Object.defineProperty,rg=Object.getOwnPropertySymbols,gT=Object.prototype.hasOwnProperty,vT=Object.prototype.propertyIsEnumerable,yk=(e,t,n)=>t in e?mee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gee=(e,t)=>{for(var n in t||(t={}))gT.call(t,n)&&yk(e,n,t[n]);if(rg)for(var n of rg(t))vT.call(t,n)&&yk(e,n,t[n]);return e},vee=(e,t)=>{var n={};for(var r in e)gT.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&rg)for(var r of rg(e))t.indexOf(r)<0&&vT.call(e,r)&&(n[r]=e[r]);return n};const yee={size:"sm"},n2=h.forwardRef((e,t)=>{const n=qr("InputDescription",yee,e),{children:r,className:o,classNames:s,styles:a,unstyled:l,size:u,__staticSelector:f,variant:p}=n,m=vee(n,["children","className","classNames","styles","unstyled","size","__staticSelector","variant"]),{classes:v,cx:y}=hee(null,{name:["InputWrapper",f],classNames:s,styles:a,unstyled:l,variant:p,size:u});return B.createElement(yv,gee({color:"dimmed",className:y(v.description,o),ref:t,unstyled:l},m),r)});n2.displayName="@mantine/core/InputDescription";const yT=h.createContext({offsetBottom:!1,offsetTop:!1,describedBy:void 0}),xee=yT.Provider,bee=()=>h.useContext(yT);function wee(e,{hasDescription:t,hasError:n}){const r=e.findIndex(u=>u==="input"),o=e[r-1],s=e[r+1];return{offsetBottom:t&&s==="description"||n&&s==="error",offsetTop:t&&o==="description"||n&&o==="error"}}var See=Object.defineProperty,Cee=Object.defineProperties,_ee=Object.getOwnPropertyDescriptors,xk=Object.getOwnPropertySymbols,kee=Object.prototype.hasOwnProperty,Pee=Object.prototype.propertyIsEnumerable,bk=(e,t,n)=>t in e?See(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jee=(e,t)=>{for(var n in t||(t={}))kee.call(t,n)&&bk(e,n,t[n]);if(xk)for(var n of xk(t))Pee.call(t,n)&&bk(e,n,t[n]);return e},Iee=(e,t)=>Cee(e,_ee(t)),Eee=ko(e=>({root:Iee(jee({},e.fn.fontStyles()),{lineHeight:e.lineHeight})}));const Oee=Eee;var Tee=Object.defineProperty,Ree=Object.defineProperties,Mee=Object.getOwnPropertyDescriptors,og=Object.getOwnPropertySymbols,xT=Object.prototype.hasOwnProperty,bT=Object.prototype.propertyIsEnumerable,wk=(e,t,n)=>t in e?Tee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Li=(e,t)=>{for(var n in t||(t={}))xT.call(t,n)&&wk(e,n,t[n]);if(og)for(var n of og(t))bT.call(t,n)&&wk(e,n,t[n]);return e},Sk=(e,t)=>Ree(e,Mee(t)),Dee=(e,t)=>{var n={};for(var r in e)xT.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&og)for(var r of og(e))t.indexOf(r)<0&&bT.call(e,r)&&(n[r]=e[r]);return n};const Aee={labelElement:"label",size:"sm",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},wT=h.forwardRef((e,t)=>{const n=qr("InputWrapper",Aee,e),{className:r,label:o,children:s,required:a,id:l,error:u,description:f,labelElement:p,labelProps:m,descriptionProps:v,errorProps:y,classNames:S,styles:x,size:w,inputContainer:_,__staticSelector:k,unstyled:P,inputWrapperOrder:I,withAsterisk:j,variant:E}=n,T=Dee(n,["className","label","children","required","id","error","description","labelElement","labelProps","descriptionProps","errorProps","classNames","styles","size","inputContainer","__staticSelector","unstyled","inputWrapperOrder","withAsterisk","variant"]),{classes:R,cx:M}=Oee(null,{classNames:S,styles:x,name:["InputWrapper",k],unstyled:P,variant:E,size:w}),D={classNames:S,styles:x,unstyled:P,size:w,variant:E,__staticSelector:k},N=typeof j=="boolean"?j:a,U=l?`${l}-error`:y==null?void 0:y.id,z=l?`${l}-description`:v==null?void 0:v.id,H=`${!!u&&typeof u!="boolean"?U:""} ${f?z:""}`,G=H.trim().length>0?H.trim():void 0,A=o&&B.createElement(e2,Li(Li({key:"label",labelElement:p,id:l?`${l}-label`:void 0,htmlFor:l,required:N},D),m),o),L=f&&B.createElement(n2,Sk(Li(Li({key:"description"},v),D),{size:(v==null?void 0:v.size)||D.size,id:(v==null?void 0:v.id)||z}),f),W=B.createElement(h.Fragment,{key:"input"},_(s)),V=typeof u!="boolean"&&u&&B.createElement(t2,Sk(Li(Li({},y),D),{size:(y==null?void 0:y.size)||D.size,key:"error",id:(y==null?void 0:y.id)||U}),u),ee=I.map(le=>{switch(le){case"label":return A;case"input":return W;case"description":return L;case"error":return V;default:return null}});return B.createElement(xee,{value:Li({describedBy:G},wee(I,{hasDescription:!!L,hasError:!!V}))},B.createElement(Yo,Li({className:M(R.root,r),ref:t},T),ee))});wT.displayName="@mantine/core/InputWrapper";var Nee=Object.defineProperty,sg=Object.getOwnPropertySymbols,ST=Object.prototype.hasOwnProperty,CT=Object.prototype.propertyIsEnumerable,Ck=(e,t,n)=>t in e?Nee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zee=(e,t)=>{for(var n in t||(t={}))ST.call(t,n)&&Ck(e,n,t[n]);if(sg)for(var n of sg(t))CT.call(t,n)&&Ck(e,n,t[n]);return e},$ee=(e,t)=>{var n={};for(var r in e)ST.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&sg)for(var r of sg(e))t.indexOf(r)<0&&CT.call(e,r)&&(n[r]=e[r]);return n};const Lee={},_T=h.forwardRef((e,t)=>{const n=qr("InputPlaceholder",Lee,e),{sx:r}=n,o=$ee(n,["sx"]);return B.createElement(Yo,zee({component:"span",sx:[s=>s.fn.placeholderStyles(),...EE(r)],ref:t},o))});_T.displayName="@mantine/core/InputPlaceholder";var Bee=Object.defineProperty,Fee=Object.defineProperties,Hee=Object.getOwnPropertyDescriptors,_k=Object.getOwnPropertySymbols,Vee=Object.prototype.hasOwnProperty,Wee=Object.prototype.propertyIsEnumerable,kk=(e,t,n)=>t in e?Bee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yh=(e,t)=>{for(var n in t||(t={}))Vee.call(t,n)&&kk(e,n,t[n]);if(_k)for(var n of _k(t))Wee.call(t,n)&&kk(e,n,t[n]);return e},I1=(e,t)=>Fee(e,Hee(t));const ks={xs:qe(30),sm:qe(36),md:qe(42),lg:qe(50),xl:qe(60)},Uee=["default","filled","unstyled"];function Gee({theme:e,variant:t}){return Uee.includes(t)?t==="default"?{border:`${qe(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,transition:"border-color 100ms ease","&:focus, &:focus-within":e.focusRingStyles.inputStyles(e)}:t==="filled"?{border:`${qe(1)} solid transparent`,backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1],"&:focus, &:focus-within":e.focusRingStyles.inputStyles(e)}:{borderWidth:0,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,backgroundColor:"transparent",minHeight:qe(28),outline:0,"&:focus, &:focus-within":{outline:"none",borderColor:"transparent"},"&:disabled":{backgroundColor:"transparent","&:focus, &:focus-within":{outline:"none",borderColor:"transparent"}}}:null}var qee=ko((e,{multiline:t,radius:n,invalid:r,rightSectionWidth:o,withRightSection:s,iconWidth:a,offsetBottom:l,offsetTop:u,pointer:f},{variant:p,size:m})=>{const v=e.fn.variant({variant:"filled",color:"red"}).background,y=p==="default"||p==="filled"?{minHeight:Kt({size:m,sizes:ks}),paddingLeft:`calc(${Kt({size:m,sizes:ks})} / 3)`,paddingRight:s?o||Kt({size:m,sizes:ks}):`calc(${Kt({size:m,sizes:ks})} / 3)`,borderRadius:e.fn.radius(n)}:p==="unstyled"&&s?{paddingRight:o||Kt({size:m,sizes:ks})}:null;return{wrapper:{position:"relative",marginTop:u?`calc(${e.spacing.xs} / 2)`:void 0,marginBottom:l?`calc(${e.spacing.xs} / 2)`:void 0,"&:has(input:disabled)":{"& .mantine-Input-rightSection":{display:"none"}}},input:I1(yh(yh(I1(yh({},e.fn.fontStyles()),{height:t?p==="unstyled"?void 0:"auto":Kt({size:m,sizes:ks}),WebkitTapHighlightColor:"transparent",lineHeight:t?e.lineHeight:`calc(${Kt({size:m,sizes:ks})} - ${qe(2)})`,appearance:"none",resize:"none",boxSizing:"border-box",fontSize:Kt({size:m,sizes:e.fontSizes}),width:"100%",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,display:"block",textAlign:"left",cursor:f?"pointer":void 0}),Gee({theme:e,variant:p})),y),{"&:disabled, &[data-disabled]":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[1],color:e.colors.dark[2],opacity:.6,cursor:"not-allowed",pointerEvents:"none","&::placeholder":{color:e.colors.dark[2]}},"&[data-invalid]":{color:v,borderColor:v,"&::placeholder":{opacity:1,color:v}},"&[data-with-icon]":{paddingLeft:typeof a=="number"?qe(a):Kt({size:m,sizes:ks})},"&::placeholder":I1(yh({},e.fn.placeholderStyles()),{opacity:1}),"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button, &::-webkit-search-decoration, &::-webkit-search-cancel-button, &::-webkit-search-results-button, &::-webkit-search-results-decoration":{appearance:"none"},"&[type=number]":{MozAppearance:"textfield"}}),icon:{pointerEvents:"none",position:"absolute",zIndex:1,left:0,top:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",width:a?qe(a):Kt({size:m,sizes:ks}),color:r?e.colors.red[e.colorScheme==="dark"?6:7]:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[5]},rightSection:{position:"absolute",top:0,bottom:0,right:0,display:"flex",alignItems:"center",justifyContent:"center",width:o||Kt({size:m,sizes:ks})}}});const Yee=qee;var Kee=Object.defineProperty,Xee=Object.defineProperties,Zee=Object.getOwnPropertyDescriptors,ag=Object.getOwnPropertySymbols,kT=Object.prototype.hasOwnProperty,PT=Object.prototype.propertyIsEnumerable,Pk=(e,t,n)=>t in e?Kee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xh=(e,t)=>{for(var n in t||(t={}))kT.call(t,n)&&Pk(e,n,t[n]);if(ag)for(var n of ag(t))PT.call(t,n)&&Pk(e,n,t[n]);return e},jk=(e,t)=>Xee(e,Zee(t)),Qee=(e,t)=>{var n={};for(var r in e)kT.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ag)for(var r of ag(e))t.indexOf(r)<0&&PT.call(e,r)&&(n[r]=e[r]);return n};const Jee={size:"sm",variant:"default"},xc=h.forwardRef((e,t)=>{const n=qr("Input",Jee,e),{className:r,error:o,required:s,disabled:a,variant:l,icon:u,style:f,rightSectionWidth:p,iconWidth:m,rightSection:v,rightSectionProps:y,radius:S,size:x,wrapperProps:w,classNames:_,styles:k,__staticSelector:P,multiline:I,sx:j,unstyled:E,pointer:T}=n,R=Qee(n,["className","error","required","disabled","variant","icon","style","rightSectionWidth","iconWidth","rightSection","rightSectionProps","radius","size","wrapperProps","classNames","styles","__staticSelector","multiline","sx","unstyled","pointer"]),{offsetBottom:M,offsetTop:D,describedBy:N}=bee(),{classes:U,cx:z}=Yee({radius:S,multiline:I,invalid:!!o,rightSectionWidth:p?qe(p):void 0,iconWidth:m,withRightSection:!!v,offsetBottom:M,offsetTop:D,pointer:T},{classNames:_,styles:k,name:["Input",P],unstyled:E,variant:l,size:x}),{systemStyles:F,rest:H}=vv(R);return B.createElement(Yo,xh(xh({className:z(U.wrapper,r),sx:j,style:f},F),w),u&&B.createElement("div",{className:U.icon},u),B.createElement(Yo,jk(xh({component:"input"},H),{ref:t,required:s,"aria-invalid":!!o,"aria-describedby":N,disabled:a,"data-disabled":a||void 0,"data-with-icon":!!u||void 0,"data-invalid":!!o||void 0,className:U.input})),v&&B.createElement("div",jk(xh({},y),{className:U.rightSection}),v))});xc.displayName="@mantine/core/Input";xc.Wrapper=wT;xc.Label=e2;xc.Description=n2;xc.Error=t2;xc.Placeholder=_T;const ig=xc,jT={xs:qe(16),sm:qe(22),md:qe(26),lg:qe(30),xl:qe(36)},ete={xs:qe(10),sm:qe(12),md:qe(14),lg:qe(16),xl:qe(18)};var tte=ko((e,{disabled:t,radius:n,readOnly:r},{size:o,variant:s})=>({defaultValue:{display:"flex",alignItems:"center",backgroundColor:t?e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[3]:e.colorScheme==="dark"?e.colors.dark[7]:s==="filled"?e.white:e.colors.gray[1],color:t?e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7]:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],height:Kt({size:o,sizes:jT}),paddingLeft:`calc(${Kt({size:o,sizes:e.spacing})} / 1.5)`,paddingRight:t||r?Kt({size:o,sizes:e.spacing}):0,fontWeight:500,fontSize:Kt({size:o,sizes:ete}),borderRadius:Kt({size:n,sizes:e.radius}),cursor:t?"not-allowed":"default",userSelect:"none",maxWidth:`calc(100% - ${qe(10)})`},defaultValueRemove:{color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],marginLeft:`calc(${Kt({size:o,sizes:e.spacing})} / 6)`},defaultValueLabel:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}));const nte=tte;var rte=Object.defineProperty,lg=Object.getOwnPropertySymbols,IT=Object.prototype.hasOwnProperty,ET=Object.prototype.propertyIsEnumerable,Ik=(e,t,n)=>t in e?rte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ote=(e,t)=>{for(var n in t||(t={}))IT.call(t,n)&&Ik(e,n,t[n]);if(lg)for(var n of lg(t))ET.call(t,n)&&Ik(e,n,t[n]);return e},ste=(e,t)=>{var n={};for(var r in e)IT.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&lg)for(var r of lg(e))t.indexOf(r)<0&&ET.call(e,r)&&(n[r]=e[r]);return n};const ate={xs:16,sm:22,md:24,lg:26,xl:30};function OT(e){var t=e,{label:n,classNames:r,styles:o,className:s,onRemove:a,disabled:l,readOnly:u,size:f,radius:p="sm",variant:m,unstyled:v}=t,y=ste(t,["label","classNames","styles","className","onRemove","disabled","readOnly","size","radius","variant","unstyled"]);const{classes:S,cx:x}=nte({disabled:l,readOnly:u,radius:p},{name:"MultiSelect",classNames:r,styles:o,unstyled:v,size:f,variant:m});return B.createElement("div",ote({className:x(S.defaultValue,s)},y),B.createElement("span",{className:S.defaultValueLabel},n),!l&&!u&&B.createElement(mO,{"aria-hidden":!0,onMouseDown:a,size:ate[f],radius:2,color:"blue",variant:"transparent",iconSize:"70%",className:S.defaultValueRemove,tabIndex:-1,unstyled:v}))}OT.displayName="@mantine/core/MultiSelect/DefaultValue";function ite({data:e,searchable:t,limit:n,searchValue:r,filter:o,value:s,disableSelectedItemFiltering:a}){if(!t&&s.length===0)return e;if(!t){const u=[];for(let f=0;f<e.length;f+=1)(a||!s.some(p=>p===e[f].value&&!e[f].disabled))&&u.push(e[f]);return u}const l=[];for(let u=0;u<e.length&&(o(r,!a&&s.some(f=>f===e[u].value&&!e[u].disabled),e[u])&&l.push(e[u]),!(l.length>=n));u+=1);return l}var lte=Object.defineProperty,cg=Object.getOwnPropertySymbols,TT=Object.prototype.hasOwnProperty,RT=Object.prototype.propertyIsEnumerable,Ek=(e,t,n)=>t in e?lte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ok=(e,t)=>{for(var n in t||(t={}))TT.call(t,n)&&Ek(e,n,t[n]);if(cg)for(var n of cg(t))RT.call(t,n)&&Ek(e,n,t[n]);return e},cte=(e,t)=>{var n={};for(var r in e)TT.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&cg)for(var r of cg(e))t.indexOf(r)<0&&RT.call(e,r)&&(n[r]=e[r]);return n};const ute={xs:qe(14),sm:qe(18),md:qe(20),lg:qe(24),xl:qe(28)};function dte(e){var t=e,{size:n,error:r,style:o}=t,s=cte(t,["size","error","style"]);const a=_i(),l=Kt({size:n,sizes:ute});return B.createElement("svg",Ok({width:l,height:l,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:Ok({color:r?a.colors.red[6]:a.colors.gray[6]},o),"data-chevron":!0},s),B.createElement("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}var fte=Object.defineProperty,pte=Object.defineProperties,hte=Object.getOwnPropertyDescriptors,Tk=Object.getOwnPropertySymbols,mte=Object.prototype.hasOwnProperty,gte=Object.prototype.propertyIsEnumerable,Rk=(e,t,n)=>t in e?fte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vte=(e,t)=>{for(var n in t||(t={}))mte.call(t,n)&&Rk(e,n,t[n]);if(Tk)for(var n of Tk(t))gte.call(t,n)&&Rk(e,n,t[n]);return e},yte=(e,t)=>pte(e,hte(t));function MT({shouldClear:e,clearButtonProps:t,onClear:n,size:r,error:o}){return e?B.createElement(mO,yte(vte({},t),{variant:"transparent",onClick:n,size:r,onMouseDown:s=>s.preventDefault()})):B.createElement(dte,{error:o,size:r})}MT.displayName="@mantine/core/SelectRightSection";var xte=Object.defineProperty,bte=Object.defineProperties,wte=Object.getOwnPropertyDescriptors,ug=Object.getOwnPropertySymbols,DT=Object.prototype.hasOwnProperty,AT=Object.prototype.propertyIsEnumerable,Mk=(e,t,n)=>t in e?xte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,E1=(e,t)=>{for(var n in t||(t={}))DT.call(t,n)&&Mk(e,n,t[n]);if(ug)for(var n of ug(t))AT.call(t,n)&&Mk(e,n,t[n]);return e},Dk=(e,t)=>bte(e,wte(t)),Ste=(e,t)=>{var n={};for(var r in e)DT.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ug)for(var r of ug(e))t.indexOf(r)<0&&AT.call(e,r)&&(n[r]=e[r]);return n};function NT(e){var t=e,{styles:n,rightSection:r,rightSectionWidth:o,theme:s}=t,a=Ste(t,["styles","rightSection","rightSectionWidth","theme"]);if(r)return{rightSection:r,rightSectionWidth:o,styles:n};const l=typeof n=="function"?n(s):n;return{rightSection:!a.readOnly&&!(a.disabled&&a.shouldClear)&&B.createElement(MT,E1({},a)),styles:Dk(E1({},l),{rightSection:Dk(E1({},l==null?void 0:l.rightSection),{pointerEvents:a.shouldClear?void 0:"none"})})}}var Cte=Object.defineProperty,_te=Object.defineProperties,kte=Object.getOwnPropertyDescriptors,Ak=Object.getOwnPropertySymbols,Pte=Object.prototype.hasOwnProperty,jte=Object.prototype.propertyIsEnumerable,Nk=(e,t,n)=>t in e?Cte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ite=(e,t)=>{for(var n in t||(t={}))Pte.call(t,n)&&Nk(e,n,t[n]);if(Ak)for(var n of Ak(t))jte.call(t,n)&&Nk(e,n,t[n]);return e},Ete=(e,t)=>_te(e,kte(t)),Ote=ko((e,{invalid:t},{size:n})=>({wrapper:{position:"relative","&:has(input:disabled)":{cursor:"not-allowed",pointerEvents:"none","& .mantine-MultiSelect-input":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[1],color:e.colors.dark[2],opacity:.6,"&::placeholder":{color:e.colors.dark[2]}},"& .mantine-MultiSelect-defaultValue":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[3],color:e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7]}}},values:{minHeight:`calc(${Kt({size:n,sizes:ks})} - ${qe(2)})`,display:"flex",alignItems:"center",flexWrap:"wrap",marginLeft:`calc(-${e.spacing.xs} / 2)`,boxSizing:"border-box","&[data-clearable]":{marginRight:Kt({size:n,sizes:ks})}},value:{margin:`calc(${e.spacing.xs} / 2 - ${qe(2)}) calc(${e.spacing.xs} / 2)`},searchInput:Ete(Ite({},e.fn.fontStyles()),{flex:1,minWidth:qe(60),backgroundColor:"transparent",border:0,outline:0,fontSize:Kt({size:n,sizes:e.fontSizes}),padding:0,marginLeft:`calc(${e.spacing.xs} / 2)`,appearance:"none",color:"inherit",maxHeight:Kt({size:n,sizes:jT}),"&::placeholder":{opacity:1,color:t?e.colors.red[e.fn.primaryShade()]:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]},"&:disabled":{cursor:"not-allowed",pointerEvents:"none"}}),searchInputEmpty:{width:"100%"},searchInputInputHidden:{flex:0,width:0,minWidth:0,margin:0,overflow:"hidden"},searchInputPointer:{cursor:"pointer","&:disabled":{cursor:"not-allowed",pointerEvents:"none"}},input:{cursor:"pointer","&:disabled":{cursor:"not-allowed",pointerEvents:"none"}}}));const Tte=Ote;var Rte=Object.defineProperty,Mte=Object.defineProperties,Dte=Object.getOwnPropertyDescriptors,dg=Object.getOwnPropertySymbols,zT=Object.prototype.hasOwnProperty,$T=Object.prototype.propertyIsEnumerable,zk=(e,t,n)=>t in e?Rte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Hc=(e,t)=>{for(var n in t||(t={}))zT.call(t,n)&&zk(e,n,t[n]);if(dg)for(var n of dg(t))$T.call(t,n)&&zk(e,n,t[n]);return e},$k=(e,t)=>Mte(e,Dte(t)),Ate=(e,t)=>{var n={};for(var r in e)zT.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&dg)for(var r of dg(e))t.indexOf(r)<0&&$T.call(e,r)&&(n[r]=e[r]);return n};function Nte(e,t,n){return t?!1:n.label.toLowerCase().trim().includes(e.toLowerCase().trim())}function zte(e,t){return!!e&&!t.some(n=>n.value.toLowerCase()===e.toLowerCase())}function Lk(e,t){if(!Array.isArray(e))return;if(t.length===0)return[];const n=t.map(r=>typeof r=="object"?r.value:r);return e.filter(r=>n.includes(r))}const $te={size:"sm",valueComponent:OT,itemComponent:qb,transitionProps:{transition:"fade",duration:0},maxDropdownHeight:220,shadow:"sm",searchable:!1,filter:Nte,limit:1/0,clearSearchOnChange:!0,clearable:!1,clearSearchOnBlur:!1,disabled:!1,initiallyOpened:!1,creatable:!1,shouldCreate:zte,switchDirectionOnFlip:!1,zIndex:Vb("popover"),selectOnBlur:!1,positionDependencies:[],dropdownPosition:"flip"},LT=h.forwardRef((e,t)=>{const n=qr("MultiSelect",$te,e),{className:r,style:o,required:s,label:a,description:l,size:u,error:f,classNames:p,styles:m,wrapperProps:v,value:y,defaultValue:S,data:x,onChange:w,valueComponent:_,itemComponent:k,id:P,transitionProps:I,maxDropdownHeight:j,shadow:E,nothingFound:T,onFocus:R,onBlur:M,searchable:D,placeholder:N,filter:U,limit:z,clearSearchOnChange:F,clearable:H,clearSearchOnBlur:G,variant:A,onSearchChange:L,searchValue:W,disabled:V,initiallyOpened:ee,radius:le,icon:oe,rightSection:X,rightSectionWidth:Q,creatable:ie,getCreateLabel:ve,shouldCreate:ye,onCreate:se,sx:de,dropdownComponent:fe,onDropdownClose:xe,onDropdownOpen:ke,maxSelectedValues:ae,withinPortal:Pe,switchDirectionOnFlip:tt,zIndex:ze,selectOnBlur:We,name:It,dropdownPosition:pt,errorProps:bn,labelProps:Y,descriptionProps:Se,form:ne,positionDependencies:he,onKeyDown:Re,unstyled:Ke,inputContainer:ge,inputWrapperOrder:ut,readOnly:Rt,withAsterisk:en,clearButtonProps:$e,hoverOnSearchChange:Xe,disableSelectedItemFiltering:On}=n,Ie=Ate(n,["className","style","required","label","description","size","error","classNames","styles","wrapperProps","value","defaultValue","data","onChange","valueComponent","itemComponent","id","transitionProps","maxDropdownHeight","shadow","nothingFound","onFocus","onBlur","searchable","placeholder","filter","limit","clearSearchOnChange","clearable","clearSearchOnBlur","variant","onSearchChange","searchValue","disabled","initiallyOpened","radius","icon","rightSection","rightSectionWidth","creatable","getCreateLabel","shouldCreate","onCreate","sx","dropdownComponent","onDropdownClose","onDropdownOpen","maxSelectedValues","withinPortal","switchDirectionOnFlip","zIndex","selectOnBlur","name","dropdownPosition","errorProps","labelProps","descriptionProps","form","positionDependencies","onKeyDown","unstyled","inputContainer","inputWrapperOrder","readOnly","withAsterisk","clearButtonProps","hoverOnSearchChange","disableSelectedItemFiltering"]),{classes:Ye,cx:ht,theme:vt}=Tte({invalid:!!f},{name:"MultiSelect",classNames:p,styles:m,unstyled:Ke,size:u,variant:A}),{systemStyles:Gt,rest:Er}=vv(Ie),gn=h.useRef(),vn=h.useRef({}),Hr=Ub(P),[Kn,Qn]=h.useState(ee),[Ws,Tn]=h.useState(-1),[ps,hs]=h.useState("column"),[dr,Us]=yf({value:W,defaultValue:"",finalValue:void 0,onChange:L}),[ji,Yr]=h.useState(!1),{scrollIntoView:ms,targetRef:Ja,scrollableRef:Ii}=BE({duration:0,offset:5,cancelable:!1,isList:!0}),Gs=ie&&typeof ve=="function";let Z=null;const te=x.map(De=>typeof De=="string"?{label:De,value:De}:De),me=OE({data:te}),[we,_e]=yf({value:Lk(y,x),defaultValue:Lk(S,x),finalValue:[],onChange:w}),ot=h.useRef(!!ae&&ae<we.length),kt=De=>{if(!Rt){const Pt=we.filter(Vt=>Vt!==De);_e(Pt),ae&&Pt.length<ae&&(ot.current=!1)}},Xt=De=>{Us(De.currentTarget.value),!V&&!ot.current&&D&&Qn(!0)},bt=De=>{typeof R=="function"&&R(De),!V&&!ot.current&&D&&Qn(!0)},Ze=ite({data:me,searchable:D,searchValue:dr,limit:z,filter:U,value:we,disableSelectedItemFiltering:On});Gs&&ye(dr,me)&&(Z=ve(dr),Ze.push({label:dr,value:dr,creatable:!0}));const rt=Math.min(Ws,Ze.length-1),je=(De,Pt,Vt)=>{let Wt=De;for(;Vt(Wt);)if(Wt=Pt(Wt),!Ze[Wt].disabled)return Wt;return De};fa(()=>{Tn(Xe&&dr?0:-1)},[dr,Xe]),fa(()=>{!V&&we.length>x.length&&Qn(!1),ae&&we.length<ae&&(ot.current=!1),ae&&we.length>=ae&&(ot.current=!0,Qn(!1))},[we]);const Qe=De=>{if(!Rt)if(F&&Us(""),we.includes(De.value))kt(De.value);else{if(De.creatable&&typeof se=="function"){const Pt=se(De.value);typeof Pt<"u"&&Pt!==null&&_e(typeof Pt=="string"?[...we,Pt]:[...we,Pt.value])}else _e([...we,De.value]);we.length===ae-1&&(ot.current=!0,Qn(!1)),Ze.length===1&&Qn(!1)}},Mt=De=>{typeof M=="function"&&M(De),We&&Ze[rt]&&Kn&&Qe(Ze[rt]),G&&Us(""),Qn(!1)},At=De=>{if(ji||(Re==null||Re(De),Rt)||De.key!=="Backspace"&&ae&&ot.current)return;const Pt=ps==="column",Vt=()=>{Tn(Zt=>{var Rn;const on=je(Zt,hn=>hn+1,hn=>hn<Ze.length-1);return Kn&&(Ja.current=vn.current[(Rn=Ze[on])==null?void 0:Rn.value],ms({alignment:Pt?"end":"start"})),on})},Wt=()=>{Tn(Zt=>{var Rn;const on=je(Zt,hn=>hn-1,hn=>hn>0);return Kn&&(Ja.current=vn.current[(Rn=Ze[on])==null?void 0:Rn.value],ms({alignment:Pt?"start":"end"})),on})};switch(De.key){case"ArrowUp":{De.preventDefault(),Qn(!0),Pt?Wt():Vt();break}case"ArrowDown":{De.preventDefault(),Qn(!0),Pt?Vt():Wt();break}case"Enter":{De.preventDefault(),Ze[rt]&&Kn?Qe(Ze[rt]):Qn(!0);break}case" ":{D||(De.preventDefault(),Ze[rt]&&Kn?Qe(Ze[rt]):Qn(!0));break}case"Backspace":{we.length>0&&dr.length===0&&(_e(we.slice(0,-1)),Qn(!0),ae&&(ot.current=!1));break}case"Home":{if(!D){De.preventDefault(),Kn||Qn(!0);const Zt=Ze.findIndex(Rn=>!Rn.disabled);Tn(Zt),ms({alignment:Pt?"end":"start"})}break}case"End":{if(!D){De.preventDefault(),Kn||Qn(!0);const Zt=Ze.map(Rn=>!!Rn.disabled).lastIndexOf(!1);Tn(Zt),ms({alignment:Pt?"end":"start"})}break}case"Escape":Qn(!1)}},Ft=we.map(De=>{let Pt=me.find(Vt=>Vt.value===De&&!Vt.disabled);return!Pt&&Gs&&(Pt={value:De,label:De}),Pt}).filter(De=>!!De).map((De,Pt)=>B.createElement(_,$k(Hc({},De),{variant:A,disabled:V,className:Ye.value,readOnly:Rt,onRemove:Vt=>{Vt.preventDefault(),Vt.stopPropagation(),kt(De.value)},key:De.value,size:u,styles:m,classNames:p,radius:le,index:Pt}))),Qt=De=>we.includes(De),sn=()=>{var De;Us(""),_e([]),(De=gn.current)==null||De.focus(),ae&&(ot.current=!1)},Jt=!Rt&&(Ze.length>0?Kn:Kn&&!!T);return fa(()=>{const De=Jt?ke:xe;typeof De=="function"&&De()},[Jt]),B.createElement(ig.Wrapper,Hc(Hc({required:s,id:Hr,label:a,error:f,description:l,size:u,className:r,style:o,classNames:p,styles:m,__staticSelector:"MultiSelect",sx:de,errorProps:bn,descriptionProps:Se,labelProps:Y,inputContainer:ge,inputWrapperOrder:ut,unstyled:Ke,withAsterisk:en,variant:A},Gt),v),B.createElement(Qi,{opened:Jt,transitionProps:I,shadow:"sm",withinPortal:Pe,__staticSelector:"MultiSelect",onDirectionChange:hs,switchDirectionOnFlip:tt,zIndex:ze,dropdownPosition:pt,positionDependencies:[...he,dr],classNames:p,styles:m,unstyled:Ke,variant:A},B.createElement(Qi.Target,null,B.createElement("div",{className:Ye.wrapper,role:"combobox","aria-haspopup":"listbox","aria-owns":Kn&&Jt?`${Hr}-items`:null,"aria-controls":Hr,"aria-expanded":Kn,onMouseLeave:()=>Tn(-1),tabIndex:-1},B.createElement("input",{type:"hidden",name:It,value:we.join(","),form:ne,disabled:V}),B.createElement(ig,Hc({__staticSelector:"MultiSelect",style:{overflow:"hidden"},component:"div",multiline:!0,size:u,variant:A,disabled:V,error:f,required:s,radius:le,icon:oe,unstyled:Ke,onMouseDown:De=>{var Pt;De.preventDefault(),!V&&!ot.current&&Qn(!Kn),(Pt=gn.current)==null||Pt.focus()},classNames:$k(Hc({},p),{input:ht({[Ye.input]:!D},p==null?void 0:p.input)})},NT({theme:vt,rightSection:X,rightSectionWidth:Q,styles:m,size:u,shouldClear:H&&we.length>0,onClear:sn,error:f,disabled:V,clearButtonProps:$e,readOnly:Rt})),B.createElement("div",{className:Ye.values,"data-clearable":H||void 0},Ft,B.createElement("input",Hc({ref:gv(t,gn),type:"search",id:Hr,className:ht(Ye.searchInput,{[Ye.searchInputPointer]:!D,[Ye.searchInputInputHidden]:!Kn&&we.length>0||!D&&we.length>0,[Ye.searchInputEmpty]:we.length===0}),onKeyDown:At,value:dr,onChange:Xt,onFocus:bt,onBlur:Mt,readOnly:!D||ot.current||Rt,placeholder:we.length===0?N:void 0,disabled:V,"data-mantine-stop-propagation":Kn,autoComplete:"off",onCompositionStart:()=>Yr(!0),onCompositionEnd:()=>Yr(!1)},Er)))))),B.createElement(Qi.Dropdown,{component:fe||Sv,maxHeight:j,direction:ps,id:Hr,innerRef:Ii,__staticSelector:"MultiSelect",classNames:p,styles:m},B.createElement(Gb,{data:Ze,hovered:rt,classNames:p,styles:m,uuid:Hr,__staticSelector:"MultiSelect",onItemHover:Tn,onItemSelect:Qe,itemsRefs:vn,itemComponent:k,size:u,nothingFound:T,isItemSelected:Qt,creatable:ie&&!!Z,createLabel:Z,unstyled:Ke,variant:A}))))});LT.displayName="@mantine/core/MultiSelect";function Lte({data:e,searchable:t,limit:n,searchValue:r,filter:o,value:s,filterDataOnExactSearchMatch:a}){if(!t)return e;const l=s!=null&&e.find(f=>f.value===s)||null;if(l&&!a&&(l==null?void 0:l.label)===r){if(n){if(n>=e.length)return e;const f=e.indexOf(l),p=f+n,m=p-e.length;return m>0?e.slice(f-m):e.slice(f,p)}return e}const u=[];for(let f=0;f<e.length&&(o(r,e[f])&&u.push(e[f]),!(u.length>=n));f+=1);return u}var Bte=ko(()=>({input:{"&:not(:disabled)":{cursor:"pointer","&::selection":{backgroundColor:"transparent"}}}}));const Fte=Bte;var Hte=Object.defineProperty,Vte=Object.defineProperties,Wte=Object.getOwnPropertyDescriptors,fg=Object.getOwnPropertySymbols,BT=Object.prototype.hasOwnProperty,FT=Object.prototype.propertyIsEnumerable,Bk=(e,t,n)=>t in e?Hte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xd=(e,t)=>{for(var n in t||(t={}))BT.call(t,n)&&Bk(e,n,t[n]);if(fg)for(var n of fg(t))FT.call(t,n)&&Bk(e,n,t[n]);return e},O1=(e,t)=>Vte(e,Wte(t)),Ute=(e,t)=>{var n={};for(var r in e)BT.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&fg)for(var r of fg(e))t.indexOf(r)<0&&FT.call(e,r)&&(n[r]=e[r]);return n};function Gte(e,t){return t.label.toLowerCase().trim().includes(e.toLowerCase().trim())}function qte(e,t){return!!e&&!t.some(n=>n.label.toLowerCase()===e.toLowerCase())}const Yte={required:!1,size:"sm",shadow:"sm",itemComponent:qb,transitionProps:{transition:"fade",duration:0},initiallyOpened:!1,filter:Gte,maxDropdownHeight:220,searchable:!1,clearable:!1,limit:1/0,disabled:!1,creatable:!1,shouldCreate:qte,selectOnBlur:!1,switchDirectionOnFlip:!1,filterDataOnExactSearchMatch:!1,zIndex:Vb("popover"),positionDependencies:[],dropdownPosition:"flip"},HT=h.forwardRef((e,t)=>{const n=eee("Select",Yte,e),{inputProps:r,wrapperProps:o,shadow:s,data:a,value:l,defaultValue:u,onChange:f,itemComponent:p,onKeyDown:m,onBlur:v,onFocus:y,transitionProps:S,initiallyOpened:x,unstyled:w,classNames:_,styles:k,filter:P,maxDropdownHeight:I,searchable:j,clearable:E,nothingFound:T,limit:R,disabled:M,onSearchChange:D,searchValue:N,rightSection:U,rightSectionWidth:z,creatable:F,getCreateLabel:H,shouldCreate:G,selectOnBlur:A,onCreate:L,dropdownComponent:W,onDropdownClose:V,onDropdownOpen:ee,withinPortal:le,portalProps:oe,switchDirectionOnFlip:X,zIndex:Q,name:ie,dropdownPosition:ve,allowDeselect:ye,placeholder:se,filterDataOnExactSearchMatch:de,form:fe,positionDependencies:xe,readOnly:ke,clearButtonProps:ae,hoverOnSearchChange:Pe}=n,tt=Ute(n,["inputProps","wrapperProps","shadow","data","value","defaultValue","onChange","itemComponent","onKeyDown","onBlur","onFocus","transitionProps","initiallyOpened","unstyled","classNames","styles","filter","maxDropdownHeight","searchable","clearable","nothingFound","limit","disabled","onSearchChange","searchValue","rightSection","rightSectionWidth","creatable","getCreateLabel","shouldCreate","selectOnBlur","onCreate","dropdownComponent","onDropdownClose","onDropdownOpen","withinPortal","portalProps","switchDirectionOnFlip","zIndex","name","dropdownPosition","allowDeselect","placeholder","filterDataOnExactSearchMatch","form","positionDependencies","readOnly","clearButtonProps","hoverOnSearchChange"]),{classes:ze,cx:We,theme:It}=Fte(),[pt,bn]=h.useState(x),[Y,Se]=h.useState(-1),ne=h.useRef(),he=h.useRef({}),[Re,Ke]=h.useState("column"),ge=Re==="column",{scrollIntoView:ut,targetRef:Rt,scrollableRef:en}=BE({duration:0,offset:5,cancelable:!1,isList:!0}),$e=ye===void 0?E:ye,Xe=te=>{if(pt!==te){bn(te);const me=te?ee:V;typeof me=="function"&&me()}},On=F&&typeof H=="function";let Ie=null;const Ye=a.map(te=>typeof te=="string"?{label:te,value:te}:te),ht=OE({data:Ye}),[vt,Gt,Er]=yf({value:l,defaultValue:u,finalValue:null,onChange:f}),gn=ht.find(te=>te.value===vt),[vn,Hr]=yf({value:N,defaultValue:(gn==null?void 0:gn.label)||"",finalValue:void 0,onChange:D}),Kn=te=>{Hr(te),j&&typeof D=="function"&&D(te)},Qn=()=>{var te;ke||(Gt(null),Er||Kn(""),(te=ne.current)==null||te.focus())};h.useEffect(()=>{const te=ht.find(me=>me.value===vt);te?Kn(te.label):(!On||!vt)&&Kn("")},[vt]),h.useEffect(()=>{gn&&(!j||!pt)&&Kn(gn.label)},[gn==null?void 0:gn.label]);const Ws=te=>{if(!ke)if($e&&(gn==null?void 0:gn.value)===te.value)Gt(null),Xe(!1);else{if(te.creatable&&typeof L=="function"){const me=L(te.value);typeof me<"u"&&me!==null&&Gt(typeof me=="string"?me:me.value)}else Gt(te.value);Er||Kn(te.label),Se(-1),Xe(!1),ne.current.focus()}},Tn=Lte({data:ht,searchable:j,limit:R,searchValue:vn,filter:P,filterDataOnExactSearchMatch:de,value:vt});On&&G(vn,Tn)&&(Ie=H(vn),Tn.push({label:vn,value:vn,creatable:!0}));const ps=(te,me,we)=>{let _e=te;for(;we(_e);)if(_e=me(_e),!Tn[_e].disabled)return _e;return te};fa(()=>{Se(Pe&&vn?0:-1)},[vn,Pe]);const hs=vt?Tn.findIndex(te=>te.value===vt):0,dr=!ke&&(Tn.length>0?pt:pt&&!!T),Us=()=>{Se(te=>{var me;const we=ps(te,_e=>_e-1,_e=>_e>0);return Rt.current=he.current[(me=Tn[we])==null?void 0:me.value],dr&&ut({alignment:ge?"start":"end"}),we})},ji=()=>{Se(te=>{var me;const we=ps(te,_e=>_e+1,_e=>_e<Tn.length-1);return Rt.current=he.current[(me=Tn[we])==null?void 0:me.value],dr&&ut({alignment:ge?"end":"start"}),we})},Yr=()=>window.setTimeout(()=>{var te;Rt.current=he.current[(te=Tn[hs])==null?void 0:te.value],ut({alignment:ge?"end":"start"})},50);fa(()=>{dr&&Yr()},[dr]);const ms=te=>{switch(typeof m=="function"&&m(te),te.key){case"ArrowUp":{te.preventDefault(),pt?ge?Us():ji():(Se(hs),Xe(!0),Yr());break}case"ArrowDown":{te.preventDefault(),pt?ge?ji():Us():(Se(hs),Xe(!0),Yr());break}case"Home":{if(!j){te.preventDefault(),pt||Xe(!0);const me=Tn.findIndex(we=>!we.disabled);Se(me),dr&&ut({alignment:ge?"end":"start"})}break}case"End":{if(!j){te.preventDefault(),pt||Xe(!0);const me=Tn.map(we=>!!we.disabled).lastIndexOf(!1);Se(me),dr&&ut({alignment:ge?"end":"start"})}break}case"Escape":{te.preventDefault(),Xe(!1),Se(-1);break}case" ":{j||(te.preventDefault(),Tn[Y]&&pt?Ws(Tn[Y]):(Xe(!0),Se(hs),Yr()));break}case"Enter":j||te.preventDefault(),Tn[Y]&&pt&&(te.preventDefault(),Ws(Tn[Y]))}},Ja=te=>{typeof v=="function"&&v(te);const me=ht.find(we=>we.value===vt);A&&Tn[Y]&&pt&&Ws(Tn[Y]),Kn((me==null?void 0:me.label)||""),Xe(!1)},Ii=te=>{typeof y=="function"&&y(te),j&&Xe(!0)},Gs=te=>{ke||(Kn(te.currentTarget.value),E&&te.currentTarget.value===""&&Gt(null),Se(-1),Xe(!0))},Z=()=>{ke||(Xe(!pt),vt&&!pt&&Se(hs))};return B.createElement(ig.Wrapper,O1(xd({},o),{__staticSelector:"Select"}),B.createElement(Qi,{opened:dr,transitionProps:S,shadow:s,withinPortal:le,portalProps:oe,__staticSelector:"Select",onDirectionChange:Ke,switchDirectionOnFlip:X,zIndex:Q,dropdownPosition:ve,positionDependencies:[...xe,vn],classNames:_,styles:k,unstyled:w,variant:r.variant},B.createElement(Qi.Target,null,B.createElement("div",{role:"combobox","aria-haspopup":"listbox","aria-owns":dr?`${r.id}-items`:null,"aria-controls":r.id,"aria-expanded":dr,onMouseLeave:()=>Se(-1),tabIndex:-1},B.createElement("input",{type:"hidden",name:ie,value:vt||"",form:fe,disabled:M}),B.createElement(ig,xd(O1(xd(xd({autoComplete:"off",type:"search"},r),tt),{ref:gv(t,ne),onKeyDown:ms,__staticSelector:"Select",value:vn,placeholder:se,onChange:Gs,"aria-autocomplete":"list","aria-controls":dr?`${r.id}-items`:null,"aria-activedescendant":Y>=0?`${r.id}-${Y}`:null,onMouseDown:Z,onBlur:Ja,onFocus:Ii,readOnly:!j||ke,disabled:M,"data-mantine-stop-propagation":dr,name:null,classNames:O1(xd({},_),{input:We({[ze.input]:!j},_==null?void 0:_.input)})}),NT({theme:It,rightSection:U,rightSectionWidth:z,styles:k,size:r.size,shouldClear:E&&!!gn,onClear:Qn,error:o.error,clearButtonProps:ae,disabled:M,readOnly:ke}))))),B.createElement(Qi.Dropdown,{component:W||Sv,maxHeight:I,direction:Re,id:r.id,innerRef:en,__staticSelector:"Select",classNames:_,styles:k},B.createElement(Gb,{data:Tn,hovered:Y,classNames:_,styles:k,isItemSelected:te=>te===vt,uuid:r.id,__staticSelector:"Select",onItemHover:Se,onItemSelect:Ws,itemsRefs:he,itemComponent:p,size:r.size,nothingFound:T,creatable:On&&!!Ie,createLabel:Ie,"aria-label":o.label,unstyled:w,variant:r.variant}))))});HT.displayName="@mantine/core/Select";const VT=()=>{const[e,t,n,r,o,s,a,l,u,f,p,m,v,y,S,x,w,_,k,P,I,j,E,T,R,M,D,N,U,z,F,H,G,A,L,W,V,ee]=hc("colors",["base.50","base.100","base.150","base.200","base.250","base.300","base.350","base.400","base.450","base.500","base.550","base.600","base.650","base.700","base.750","base.800","base.850","base.900","base.950","accent.50","accent.100","accent.150","accent.200","accent.250","accent.300","accent.350","accent.400","accent.450","accent.500","accent.550","accent.600","accent.650","accent.700","accent.750","accent.800","accent.850","accent.900","accent.950"]);return{base50:e,base100:t,base150:n,base200:r,base250:o,base300:s,base350:a,base400:l,base450:u,base500:f,base550:p,base600:m,base650:v,base700:y,base750:S,base800:x,base850:w,base900:_,base950:k,accent50:P,accent100:I,accent150:j,accent200:E,accent250:T,accent300:R,accent350:M,accent400:D,accent450:N,accent500:U,accent550:z,accent600:F,accent650:H,accent700:G,accent750:A,accent800:L,accent850:W,accent900:V,accent950:ee}},Kte=e=>{const{searchable:t=!0,tooltip:n,...r}=e,{base50:o,base100:s,base200:a,base300:l,base400:u,base500:f,base600:p,base700:m,base800:v,base900:y,accent200:S,accent300:x,accent400:w,accent500:_,accent600:k}=VT(),{colorMode:P}=fo(),[I]=hc("shadows",["dark-lg"]);return i.jsx(er,{label:n,placement:"top",hasArrow:!0,children:i.jsx(HT,{searchable:t,styles:()=>({label:{color:Ae(m,l)(P),fontWeight:"normal"},input:{backgroundColor:Ae(o,y)(P),borderWidth:"2px",borderColor:Ae(a,v)(P),color:Ae(y,s)(P),paddingRight:24,fontWeight:600,"&:hover":{borderColor:Ae(l,p)(P)},"&:focus":{borderColor:Ae(x,k)(P)},"&:is(:focus, :hover)":{borderColor:Ae(u,f)(P)},"&:focus-within":{borderColor:Ae(S,k)(P)},"&:disabled":{backgroundColor:Ae(l,m)(P),color:Ae(p,u)(P)}},value:{backgroundColor:Ae(s,y)(P),color:Ae(y,s)(P),button:{color:Ae(y,s)(P)},"&:hover":{backgroundColor:Ae(l,m)(P),cursor:"pointer"}},dropdown:{backgroundColor:Ae(a,v)(P),borderColor:Ae(a,v)(P),boxShadow:I},item:{backgroundColor:Ae(a,v)(P),color:Ae(v,a)(P),padding:6,"&[data-hovered]":{color:Ae(y,s)(P),backgroundColor:Ae(l,m)(P)},"&[data-active]":{backgroundColor:Ae(l,m)(P),"&:hover":{color:Ae(y,s)(P),backgroundColor:Ae(l,m)(P)}},"&[data-selected]":{backgroundColor:Ae(w,k)(P),color:Ae(o,s)(P),fontWeight:600,"&:hover":{backgroundColor:Ae(_,_)(P),color:Ae("white",o)(P)}}},rightSection:{width:32,button:{color:Ae(y,s)(P)}}}),...r})})},Zo=h.memo(Kte);function Xte(){const e=q(o=>o.postprocessing.facetoolType),t=ue(),{t:n}=Ce(),r=o=>t(LM(o));return i.jsx(Zo,{label:n("parameters.type"),data:$M.concat(),value:e,onChange:r})}function Zte(){const e=q(o=>o.system.isGFPGANAvailable),t=q(o=>o.postprocessing.facetoolStrength),{t:n}=Ce(),r=ue();return i.jsx(Tt,{isDisabled:!e,label:n("parameters.strength"),step:.05,min:0,max:1,onChange:o=>r(iS(o)),handleReset:()=>r(iS(.75)),value:t,withReset:!0,withSliderMarks:!0,withInput:!0})}function Qte(){const e=q(o=>o.system.isGFPGANAvailable),t=q(o=>o.postprocessing.codeformerFidelity),{t:n}=Ce(),r=ue();return i.jsx(Tt,{isDisabled:!e,label:n("parameters.codeformerFidelity"),step:.05,min:0,max:1,onChange:o=>r(lS(o)),handleReset:()=>r(lS(1)),value:t,withReset:!0,withSliderMarks:!0,withInput:!0})}const Jte=()=>{const e=q(t=>t.postprocessing.facetoolType);return i.jsxs(Nn,{gap:2,alignItems:"stretch",children:[i.jsx(Xte,{}),i.jsx(Zte,{}),e==="codeformer"&&i.jsx(Qte,{})]})};function ene(){const e=q(o=>o.system.isESRGANAvailable),t=q(o=>o.postprocessing.upscalingDenoising),{t:n}=Ce(),r=ue();return i.jsx(Tt,{label:n("parameters.denoisingStrength"),value:t,min:0,max:1,step:.01,onChange:o=>{r(cS(o))},handleReset:()=>r(cS(.75)),withSliderMarks:!0,withInput:!0,withReset:!0,isDisabled:!e})}function tne(){const e=q(o=>o.system.isESRGANAvailable),t=q(o=>o.postprocessing.upscalingStrength),{t:n}=Ce(),r=ue();return i.jsx(Tt,{label:`${n("parameters.upscale")} ${n("parameters.strength")}`,value:t,min:0,max:1,step:.05,onChange:o=>r(uS(o)),handleReset:()=>r(uS(.75)),withSliderMarks:!0,withInput:!0,withReset:!0,isDisabled:!e})}function nne(){const e=q(s=>s.system.isESRGANAvailable),t=q(s=>s.postprocessing.upscalingLevel),{t:n}=Ce(),r=ue(),o=s=>r(FM(Number(s)));return i.jsx(Zo,{disabled:!e,label:n("parameters.scale"),value:String(t),onChange:o,data:BM})}const rne=()=>i.jsxs(Nn,{gap:2,alignItems:"stretch",children:[i.jsx(nne,{}),i.jsx(ene,{}),i.jsx(tne,{})]}),one=e=>{const{label:t,isDisabled:n=!1,width:r="auto",formControlProps:o,formLabelProps:s,tooltip:a,...l}=e;return i.jsx(er,{label:a,hasArrow:!0,placement:"top",isDisabled:!a,children:i.jsxs(_n,{isDisabled:n,width:r,display:"flex",gap:4,alignItems:"center",...o,children:[t&&i.jsx(jn,{my:1,flexGrow:1,sx:{cursor:n?"not-allowed":"pointer",...s==null?void 0:s.sx},...s,children:t}),i.jsx(Kg,{...l})]})})},Br=h.memo(one),Qa=e=>e.config,sne=Te([pr,Qa],(e,t)=>{const{shouldConfirmOnDelete:n}=e,{canRestoreDeletedImagesFromBin:r}=t;return{shouldConfirmOnDelete:n,canRestoreDeletedImagesFromBin:r}},zn),ane=e=>{const{imageUsage:t}=e;return!t||!h5(t)?null:i.jsxs(i.Fragment,{children:[i.jsx(lt,{children:"This image is currently in use in the following features:"}),i.jsxs(Tg,{sx:{paddingInlineStart:6},children:[t.isInitialImage&&i.jsx(is,{children:"Image to Image"}),t.isCanvasImage&&i.jsx(is,{children:"Unified Canvas"}),t.isControlNetImage&&i.jsx(is,{children:"ControlNet"}),t.isNodesImage&&i.jsx(is,{children:"Node Editor"})]}),i.jsx(lt,{children:"If you delete this image, those features will immediately be reset."})]})},ine=()=>{const e=ue(),{t}=Ce(),{isOpen:n,onClose:r,onImmediatelyDelete:o,image:s,imageUsage:a}=h.useContext(xx),{shouldConfirmOnDelete:l,canRestoreDeletedImagesFromBin:u}=q(sne),f=h.useCallback(m=>e(p5(!m.target.checked)),[e]),p=h.useRef(null);return i.jsx(Ng,{isOpen:n,leastDestructiveRef:p,onClose:r,isCentered:!0,children:i.jsx(ya,{children:i.jsxs(zg,{children:[i.jsx(va,{fontSize:"lg",fontWeight:"bold",children:t("gallery.deleteImage")}),i.jsx(xa,{children:i.jsxs(K,{direction:"column",gap:3,children:[i.jsx(ane,{imageUsage:a}),i.jsx(Fu,{}),i.jsx(lt,{children:t(u?"gallery.deleteImageBin":"gallery.deleteImagePermanent")}),i.jsx(lt,{children:t("common.areYouSure")}),i.jsx(Br,{label:t("common.dontAskMeAgain"),isChecked:!l,onChange:f})]})}),i.jsxs(ga,{children:[i.jsx(fn,{ref:p,onClick:r,children:"Cancel"}),i.jsx(fn,{colorScheme:"error",onClick:o,ml:3,children:"Delete"})]})]})})})},lne=h.memo(ine),cne=Te([pr],e=>{const{isProcessing:t,isConnected:n}=e;return n&&!t}),une=e=>{const{onClick:t}=e,{t:n}=Ce(),r=q(cne);return i.jsx(Me,{onClick:t,icon:i.jsx(Ls,{}),tooltip:`${n("gallery.deleteImage")} (Del)`,"aria-label":`${n("gallery.deleteImage")} (Del)`,isDisabled:!r,colorScheme:"error"})},dne=Te([e=>e,pr,pl,IE,po,av,Gr],(e,t,n,r,o,s,a)=>{var j,E,T;const{isProcessing:l,isConnected:u,isGFPGANAvailable:f,isESRGANAvailable:p,shouldConfirmOnDelete:m,progressImage:v}=t,{upscalingLevel:y,facetoolStrength:S}=r,{isLightboxOpen:x}=s,{shouldShowImageDetails:w,shouldHidePreview:_,shouldShowProgressInViewer:k}=o,P=HM(e,n.selectedImage??""),{selectedImage:I}=n;return{canDeleteImage:u&&!l,shouldConfirmOnDelete:m,isProcessing:l,isConnected:u,isGFPGANAvailable:f,isESRGANAvailable:p,upscalingLevel:y,facetoolStrength:S,shouldDisableToolbarButtons:!!v||!I,shouldShowImageDetails:w,activeTabName:a,isLightboxOpen:x,shouldHidePreview:_,image:P,seed:(j=P==null?void 0:P.metadata)==null?void 0:j.seed,prompt:(E=P==null?void 0:P.metadata)==null?void 0:E.positive_conditioning,negativePrompt:(T=P==null?void 0:P.metadata)==null?void 0:T.negative_conditioning,shouldShowProgressInViewer:k}},{memoizeOptions:{resultEqualityCheck:Ut}}),WT=e=>{var ee,le,oe;const t=ue(),{isProcessing:n,isConnected:r,isGFPGANAvailable:o,isESRGANAvailable:s,upscalingLevel:a,facetoolStrength:l,shouldDisableToolbarButtons:u,shouldShowImageDetails:f,isLightboxOpen:p,activeTabName:m,shouldHidePreview:v,image:y,shouldShowProgressInViewer:S}=q(dne),x=so("lightbox").isFeatureEnabled,w=so("unifiedCanvas").isFeatureEnabled,_=so("upscaling").isFeatureEnabled,k=so("faceRestore").isFeatureEnabled,P=jf(),{t:I}=Ce(),{recallBothPrompts:j,recallSeed:E,recallAllParameters:T}=Nb(),{onDelete:R}=h.useContext(xx),M=h.useCallback(()=>{const Q=(()=>{if(y)return y.image_url.startsWith("http")?y.image_url:window.location.toString()+y.image_url})();if(!Q){P({title:I("toast.problemCopyingImageLink"),status:"error",duration:2500,isClosable:!0});return}navigator.clipboard.writeText(Q).then(()=>{P({title:I("toast.imageLinkCopied"),status:"success",duration:2500,isClosable:!0})})},[P,I,y]),D=h.useCallback(()=>{T(y)},[y,T]);nt("a",()=>{},[y,T]);const N=h.useCallback(()=>{var X;E((X=y==null?void 0:y.metadata)==null?void 0:X.seed)},[y,E]);nt("s",N,[y]);const U=h.useCallback(()=>{var X,Q;j((X=y==null?void 0:y.metadata)==null?void 0:X.positive_conditioning,(Q=y==null?void 0:y.metadata)==null?void 0:Q.negative_conditioning)},[y,j]);nt("p",U,[y]);const z=h.useCallback(()=>{t(s5()),t(qh(y))},[t,y]);nt("shift+i",z,[y]);const F=h.useCallback(()=>{},[]),H=h.useCallback(()=>{R(y)},[y,R]);nt("Shift+U",()=>{F()},{enabled:()=>!!(_&&s&&!u&&r&&!n&&a)},[_,y,s,u,r,n,a]);const G=h.useCallback(()=>{},[]);nt("Shift+R",()=>{G()},{enabled:()=>!!(k&&o&&!u&&r&&!n&&l)},[k,y,o,u,r,n,l]);const A=h.useCallback(()=>t(m5(!f)),[t,f]),L=h.useCallback(()=>{y&&(t(a5()),p&&t(Hd(!1)),t(bx(y)),t(Bs()),m!=="unifiedCanvas"&&t(Nl("unifiedCanvas")),P({title:I("toast.sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0}))},[y,p,t,m,P,I]);nt("i",()=>{y?A():P({title:I("toast.metadataLoadFailed"),status:"error",duration:2500,isClosable:!0})},[y,f,P]);const W=h.useCallback(()=>{t(g5(!S))},[t,S]),V=h.useCallback(()=>{t(Hd(!p))},[t,p]);return i.jsx(i.Fragment,{children:i.jsxs(K,{sx:{flexWrap:"wrap",justifyContent:"center",alignItems:"center",gap:2},...e,children:[i.jsxs(Fr,{isAttached:!0,children:[i.jsx(ii,{triggerComponent:i.jsx(Me,{"aria-label":`${I("parameters.sendTo")}...`,tooltip:`${I("parameters.sendTo")}...`,isDisabled:!y,icon:i.jsx(fU,{})}),children:i.jsxs(K,{sx:{flexDirection:"column",rowGap:2},children:[i.jsx(fn,{size:"sm",onClick:z,leftIcon:i.jsx(gm,{}),id:"send-to-img2img",children:I("parameters.sendToImg2Img")}),w&&i.jsx(fn,{size:"sm",onClick:L,leftIcon:i.jsx(gm,{}),id:"send-to-canvas",children:I("parameters.sendToUnifiedCanvas")}),i.jsx(fn,{size:"sm",onClick:M,leftIcon:i.jsx(Wu,{}),children:I("parameters.copyImageToLink")}),i.jsx(Wl,{download:!0,href:y==null?void 0:y.image_url,target:"_blank",children:i.jsx(fn,{leftIcon:i.jsx(Eb,{}),size:"sm",w:"100%",children:I("parameters.downloadImage")})})]})}),x&&i.jsx(Me,{icon:i.jsx(Ob,{}),tooltip:p?`${I("parameters.closeViewer")} (Z)`:`${I("parameters.openInViewer")} (Z)`,"aria-label":p?`${I("parameters.closeViewer")} (Z)`:`${I("parameters.openInViewer")} (Z)`,isChecked:p,onClick:V})]}),i.jsxs(Fr,{isAttached:!0,children:[i.jsx(Me,{icon:i.jsx(iU,{}),tooltip:`${I("parameters.usePrompt")} (P)`,"aria-label":`${I("parameters.usePrompt")} (P)`,isDisabled:!((ee=y==null?void 0:y.metadata)!=null&&ee.positive_conditioning),onClick:U}),i.jsx(Me,{icon:i.jsx(uU,{}),tooltip:`${I("parameters.useSeed")} (S)`,"aria-label":`${I("parameters.useSeed")} (S)`,isDisabled:!((le=y==null?void 0:y.metadata)!=null&&le.seed),onClick:N}),i.jsx(Me,{icon:i.jsx(VW,{}),tooltip:`${I("parameters.useAll")} (A)`,"aria-label":`${I("parameters.useAll")} (A)`,isDisabled:!["t2l","l2l","inpaint"].includes(String((oe=y==null?void 0:y.metadata)==null?void 0:oe.type)),onClick:D})]}),(_||k)&&i.jsxs(Fr,{isAttached:!0,children:[k&&i.jsx(ii,{triggerComponent:i.jsx(Me,{icon:i.jsx(QW,{}),"aria-label":I("parameters.restoreFaces")}),children:i.jsxs(K,{sx:{flexDirection:"column",rowGap:4},children:[i.jsx(Jte,{}),i.jsx(fn,{isDisabled:!o||!y||!(r&&!n)||!l,onClick:G,children:I("parameters.restoreFaces")})]})}),_&&i.jsx(ii,{triggerComponent:i.jsx(Me,{icon:i.jsx(YW,{}),"aria-label":I("parameters.upscale")}),children:i.jsxs(K,{sx:{flexDirection:"column",gap:4},children:[i.jsx(rne,{}),i.jsx(fn,{isDisabled:!s||!y||!(r&&!n)||!a,onClick:F,children:I("parameters.upscaleImage")})]})})]}),i.jsx(Fr,{isAttached:!0,children:i.jsx(Me,{icon:i.jsx(kI,{}),tooltip:`${I("parameters.info")} (I)`,"aria-label":`${I("parameters.info")} (I)`,isChecked:f,onClick:A})}),i.jsx(Fr,{isAttached:!0,children:i.jsx(Me,{"aria-label":I("settings.displayInProgress"),tooltip:I("settings.displayInProgress"),icon:i.jsx(JW,{}),isChecked:S,onClick:W})}),i.jsx(Fr,{isAttached:!0,children:i.jsx(une,{onClick:H})})]})})},Cs=({label:e,value:t,onClick:n,isLink:r,labelPosition:o,withCopy:s=!1})=>{const{t:a}=Ce();return t?i.jsxs(K,{gap:2,children:[n&&i.jsx(er,{label:`Recall ${e}`,children:i.jsx(mi,{"aria-label":a("accessibility.useThisParameter"),icon:i.jsx(Ah,{}),size:"xs",variant:"ghost",fontSize:20,onClick:n})}),s&&i.jsx(er,{label:`Copy ${e}`,children:i.jsx(mi,{"aria-label":`Copy ${e}`,icon:i.jsx(Wu,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(t.toString())})}),i.jsxs(K,{direction:o?"column":"row",children:[i.jsxs(lt,{fontWeight:"semibold",whiteSpace:"pre-wrap",pr:2,children:[e,":"]}),r?i.jsxs(Wl,{href:t.toString(),isExternal:!0,wordBreak:"break-all",children:[t.toString()," ",i.jsx(Db,{mx:"2px"})]}):i.jsx(lt,{overflowY:"scroll",wordBreak:"break-all",children:t.toString()})]})]}):null},fne=({image:e})=>{const t=ue(),{recallBothPrompts:n,recallPositivePrompt:r,recallNegativePrompt:o,recallSeed:s,recallInitialImage:a,recallCfgScale:l,recallModel:u,recallScheduler:f,recallSteps:p,recallWidth:m,recallHeight:v,recallStrength:y,recallAllParameters:S}=Nb();nt("esc",()=>{t(m5(!1))});const x=e==null?void 0:e.session_id,w=e==null?void 0:e.metadata,{t:_}=Ce(),k=JSON.stringify(e,null,2);return i.jsxs(K,{sx:{padding:4,gap:1,flexDirection:"column",width:"full",height:"full",backdropFilter:"blur(20px)",bg:"whiteAlpha.600",_dark:{bg:"blackAlpha.600"},overflow:"scroll"},children:[i.jsxs(K,{gap:2,children:[i.jsx(lt,{fontWeight:"semibold",children:"File:"}),i.jsxs(Wl,{href:e.image_url,isExternal:!0,maxW:"calc(100% - 3rem)",children:[e.image_name,i.jsx(Db,{mx:"2px"})]})]}),w&&Object.keys(w).length>0?i.jsxs(i.Fragment,{children:[w.type&&i.jsx(Cs,{label:"Invocation type",value:w.type}),x&&i.jsx(Cs,{label:"Session ID",value:x}),w.positive_conditioning&&i.jsx(Cs,{label:"Positive Prompt",labelPosition:"top",value:w.positive_conditioning,onClick:()=>r(w.positive_conditioning)}),w.negative_conditioning&&i.jsx(Cs,{label:"Negative Prompt",labelPosition:"top",value:w.negative_conditioning,onClick:()=>o(w.negative_conditioning)}),w.seed!==void 0&&i.jsx(Cs,{label:"Seed",value:w.seed,onClick:()=>s(w.seed)}),w.model!==void 0&&i.jsx(Cs,{label:"Model",value:w.model,onClick:()=>u(w.model)}),w.width&&i.jsx(Cs,{label:"Width",value:w.width,onClick:()=>m(w.width)}),w.height&&i.jsx(Cs,{label:"Height",value:w.height,onClick:()=>v(w.height)}),w.scheduler&&i.jsx(Cs,{label:"Scheduler",value:w.scheduler,onClick:()=>f(w.scheduler)}),w.steps&&i.jsx(Cs,{label:"Steps",value:w.steps,onClick:()=>p(w.steps)}),w.cfg_scale!==void 0&&i.jsx(Cs,{label:"CFG scale",value:w.cfg_scale,onClick:()=>l(w.cfg_scale)}),w.strength&&i.jsx(Cs,{label:"Image to image strength",value:w.strength,onClick:()=>y(w.strength)})]}):i.jsx(h6,{width:"100%",pt:10,children:i.jsx(lt,{fontSize:"lg",fontWeight:"semibold",children:"No metadata available"})}),i.jsxs(K,{gap:2,direction:"column",overflow:"auto",children:[i.jsxs(K,{gap:2,children:[i.jsx(er,{label:"Copy metadata JSON",children:i.jsx(mi,{"aria-label":_("accessibility.copyMetadataJson"),icon:i.jsx(Wu,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(k)})}),i.jsx(lt,{fontWeight:"semibold",children:"Metadata JSON:"})]}),i.jsx(Ib,{defer:!0,children:i.jsx(et,{sx:{padding:4,borderRadius:"base",bg:"whiteAlpha.500",_dark:{bg:"blackAlpha.500"},w:"full"},children:i.jsx("pre",{children:k})})})]})]})},UT=h.memo(fne),Fk={height:"100%",width:"15%",alignItems:"center",pointerEvents:"auto"},Hk={color:"base.100"},pne=Te([e=>e,pl,VM,WM],(e,t,n,r)=>{const{selectedImage:o}=t;if(!o)return{isOnFirstImage:!0,isOnLastImage:!0};const s=r.findIndex(y=>y===o),a=ma(s+1,0,r.length-1),l=ma(s-1,0,r.length-1),u=r[a],f=r[l],p=n[u],m=n[f],v=r.length;return{isOnFirstImage:s===0,isOnLastImage:!isNaN(s)&&s===v-1,nextImage:p,prevImage:m,nextImageId:u,prevImageId:f}},{memoizeOptions:{resultEqualityCheck:Ut}}),GT=()=>{const e=ue(),{t}=Ce(),{isOnFirstImage:n,isOnLastImage:r,nextImageId:o,prevImageId:s}=q(pne),[a,l]=h.useState(!1),u=h.useCallback(()=>{l(!0)},[]),f=h.useCallback(()=>{l(!1)},[]),p=h.useCallback(()=>{e(Yh(s))},[e,s]),m=h.useCallback(()=>{e(Yh(o))},[e,o]);return nt("left",()=>{p()},[s]),nt("right",()=>{m()},[o]),i.jsxs(K,{sx:{justifyContent:"space-between",height:"100%",width:"100%",pointerEvents:"none"},children:[i.jsx(gi,{sx:{...Fk,justifyContent:"flex-start"},onMouseOver:u,onMouseOut:f,children:a&&!n&&i.jsx(mi,{"aria-label":t("accessibility.previousImage"),icon:i.jsx(BW,{size:64}),variant:"unstyled",onClick:p,boxSize:16,sx:Hk})}),i.jsx(gi,{sx:{...Fk,justifyContent:"flex-end"},onMouseOver:u,onMouseOut:f,children:a&&!r&&i.jsx(mi,{"aria-label":t("accessibility.nextImage"),icon:i.jsx(FW,{size:64}),variant:"unstyled",onClick:m,boxSize:16,sx:Hk})})]})};var Ms=function(e,t){return Number(e.toFixed(t))},hne=function(e,t){return typeof e=="number"?e:t},Cr=function(e,t,n){n&&typeof n=="function"&&n(e,t)},mne=function(e){return-Math.cos(e*Math.PI)/2+.5},gne=function(e){return e},vne=function(e){return e*e},yne=function(e){return e*(2-e)},xne=function(e){return e<.5?2*e*e:-1+(4-2*e)*e},bne=function(e){return e*e*e},wne=function(e){return--e*e*e+1},Sne=function(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},Cne=function(e){return e*e*e*e},_ne=function(e){return 1- --e*e*e*e},kne=function(e){return e<.5?8*e*e*e*e:1-8*--e*e*e*e},Pne=function(e){return e*e*e*e*e},jne=function(e){return 1+--e*e*e*e*e},Ine=function(e){return e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e},qT={easeOut:mne,linear:gne,easeInQuad:vne,easeOutQuad:yne,easeInOutQuad:xne,easeInCubic:bne,easeOutCubic:wne,easeInOutCubic:Sne,easeInQuart:Cne,easeOutQuart:_ne,easeInOutQuart:kne,easeInQuint:Pne,easeOutQuint:jne,easeInOutQuint:Ine},YT=function(e){typeof e=="number"&&cancelAnimationFrame(e)},$a=function(e){e.mounted&&(YT(e.animation),e.animate=!1,e.animation=null,e.velocity=null)};function KT(e,t,n,r){if(e.mounted){var o=new Date().getTime(),s=1;$a(e),e.animation=function(){if(!e.mounted)return YT(e.animation);var a=new Date().getTime()-o,l=a/n,u=qT[t],f=u(l);a>=n?(r(s),e.animation=null):e.animation&&(r(f),requestAnimationFrame(e.animation))},requestAnimationFrame(e.animation)}}function Ene(e){var t=e.scale,n=e.positionX,r=e.positionY;return!(Number.isNaN(t)||Number.isNaN(n)||Number.isNaN(r))}function xl(e,t,n,r){var o=Ene(t);if(!(!e.mounted||!o)){var s=e.setTransformState,a=e.transformState,l=a.scale,u=a.positionX,f=a.positionY,p=t.scale-l,m=t.positionX-u,v=t.positionY-f;n===0?s(t.scale,t.positionX,t.positionY):KT(e,r,n,function(y){var S=l+p*y,x=u+m*y,w=f+v*y;s(S,x,w)})}}function One(e,t,n){var r=e.offsetWidth,o=e.offsetHeight,s=t.offsetWidth,a=t.offsetHeight,l=s*n,u=a*n,f=r-l,p=o-u;return{wrapperWidth:r,wrapperHeight:o,newContentWidth:l,newDiffWidth:f,newContentHeight:u,newDiffHeight:p}}var Tne=function(e,t,n,r,o,s,a){var l=e>t?n*(a?1:.5):0,u=r>o?s*(a?1:.5):0,f=e-t-l,p=l,m=r-o-u,v=u;return{minPositionX:f,maxPositionX:p,minPositionY:m,maxPositionY:v}},r2=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=One(n,r,t),a=s.wrapperWidth,l=s.wrapperHeight,u=s.newContentWidth,f=s.newDiffWidth,p=s.newContentHeight,m=s.newDiffHeight,v=Tne(a,u,f,l,p,m,!!o);return v},ex=function(e,t,n,r){return r?e<t?Ms(t,2):e>n?Ms(n,2):Ms(e,2):Ms(e,2)},Pu=function(e,t){var n=r2(e,t);return e.bounds=n,n};function kv(e,t,n,r,o,s,a){var l=n.minPositionX,u=n.minPositionY,f=n.maxPositionX,p=n.maxPositionY,m=0,v=0;a&&(m=o,v=s);var y=ex(e,l-m,f+m,r),S=ex(t,u-v,p+v,r);return{x:y,y:S}}function Pv(e,t,n,r,o,s){var a=e.transformState,l=a.scale,u=a.positionX,f=a.positionY,p=r-l;if(typeof t!="number"||typeof n!="number")return console.error("Mouse X and Y position were not provided!"),{x:u,y:f};var m=u-t*p,v=f-n*p,y=kv(m,v,o,s,0,0,null);return y}function Xf(e,t,n,r,o){var s=o?r:0,a=t-s;return!Number.isNaN(n)&&e>=n?n:!Number.isNaN(t)&&e<=a?a:e}var Vk=function(e,t){var n=e.setup.panning.excluded,r=e.isInitialized,o=e.wrapperComponent,s=t.target,a=o==null?void 0:o.contains(s),l=r&&s&&a;if(!l)return!1;var u=jv(s,n);return!u},Wk=function(e){var t=e.isInitialized,n=e.isPanning,r=e.setup,o=r.panning.disabled,s=t&&n&&!o;return!!s},Rne=function(e,t){var n=e.transformState,r=n.positionX,o=n.positionY;e.isPanning=!0;var s=t.clientX,a=t.clientY;e.startCoords={x:s-r,y:a-o}},Mne=function(e,t){var n=t.touches,r=e.transformState,o=r.positionX,s=r.positionY;e.isPanning=!0;var a=n.length===1;if(a){var l=n[0].clientX,u=n[0].clientY;e.startCoords={x:l-o,y:u-s}}};function Dne(e){var t=e.transformState,n=t.positionX,r=t.positionY,o=t.scale,s=e.setup,a=s.disabled,l=s.limitToBounds,u=s.centerZoomedOut,f=e.wrapperComponent;if(!(a||!f||!e.bounds)){var p=e.bounds,m=p.maxPositionX,v=p.minPositionX,y=p.maxPositionY,S=p.minPositionY,x=n>m||n<v,w=r>y||r<S,_=n>m?f.offsetWidth:e.setup.minPositionX||0,k=r>y?f.offsetHeight:e.setup.minPositionY||0,P=Pv(e,_,k,o,e.bounds,l||u),I=P.x,j=P.y;return{scale:o,positionX:x?I:n,positionY:w?j:r}}}function Ane(e,t,n,r,o){var s=e.setup.limitToBounds,a=e.wrapperComponent,l=e.bounds,u=e.transformState,f=u.scale,p=u.positionX,m=u.positionY;if(!(a===null||l===null||t===p&&n===m)){var v=kv(t,n,l,s,r,o,a),y=v.x,S=v.y;e.setTransformState(f,y,S)}}var Nne=function(e,t,n){var r=e.startCoords,o=e.transformState,s=e.setup.panning,a=s.lockAxisX,l=s.lockAxisY,u=o.positionX,f=o.positionY;if(!r)return{x:u,y:f};var p=t-r.x,m=n-r.y,v=a?u:p,y=l?f:m;return{x:v,y}},pg=function(e,t){var n=e.setup,r=e.transformState,o=r.scale,s=n.minScale,a=n.disablePadding;return t>0&&o>=s&&!a?t:0},zne=function(e){var t=e.mounted,n=e.setup,r=n.disabled,o=n.velocityAnimation,s=e.transformState.scale,a=o.disabled,l=!a||s>1||!r||t;return!!l},$ne=function(e){var t=e.mounted,n=e.velocity,r=e.bounds,o=e.setup,s=o.disabled,a=o.velocityAnimation,l=e.transformState.scale,u=a.disabled,f=!u||l>1||!s||t;return!(!f||!n||!r)};function Lne(e,t){var n=e.setup.velocityAnimation,r=n.equalToMove,o=n.animationTime,s=n.sensitivity;return r?o*t*s:o}function Uk(e,t,n,r,o,s,a,l,u,f){if(o){if(t>a&&n>a){var p=a+(e-a)*f;return p>u?u:p<a?a:p}if(t<s&&n<s){var p=s+(e-s)*f;return p<l?l:p>s?s:p}}return r?t:ex(e,s,a,o)}function Bne(e,t){var n=1;return t?Math.min(n,e.offsetWidth/window.innerWidth):n}function Fne(e,t){var n=zne(e);if(n){var r=e.lastMousePosition,o=e.velocityTime,s=e.setup,a=e.wrapperComponent,l=s.velocityAnimation.equalToMove,u=Date.now();if(r&&o&&a){var f=Bne(a,l),p=t.x-r.x,m=t.y-r.y,v=p/f,y=m/f,S=u-o,x=p*p+m*m,w=Math.sqrt(x)/S;e.velocity={velocityX:v,velocityY:y,total:w}}e.lastMousePosition=t,e.velocityTime=u}}function Hne(e){var t=e.velocity,n=e.bounds,r=e.setup,o=e.wrapperComponent,s=$ne(e);if(!(!s||!t||!n||!o)){var a=t.velocityX,l=t.velocityY,u=t.total,f=n.maxPositionX,p=n.minPositionX,m=n.maxPositionY,v=n.minPositionY,y=r.limitToBounds,S=r.alignmentAnimation,x=r.zoomAnimation,w=r.panning,_=w.lockAxisY,k=w.lockAxisX,P=x.animationType,I=S.sizeX,j=S.sizeY,E=S.velocityAlignmentTime,T=E,R=Lne(e,u),M=Math.max(R,T),D=pg(e,I),N=pg(e,j),U=D*o.offsetWidth/100,z=N*o.offsetHeight/100,F=f+U,H=p-U,G=m+z,A=v-z,L=e.transformState,W=new Date().getTime();KT(e,P,M,function(V){var ee=e.transformState,le=ee.scale,oe=ee.positionX,X=ee.positionY,Q=new Date().getTime()-W,ie=Q/T,ve=qT[S.animationType],ye=1-ve(Math.min(1,ie)),se=1-V,de=oe+a*se,fe=X+l*se,xe=Uk(de,L.positionX,oe,k,y,p,f,H,F,ye),ke=Uk(fe,L.positionY,X,_,y,v,m,A,G,ye);(oe!==de||X!==fe)&&e.setTransformState(le,xe,ke)})}}function Gk(e,t){var n=e.transformState.scale;$a(e),Pu(e,n),window.TouchEvent!==void 0&&t instanceof TouchEvent?Mne(e,t):Rne(e,t)}function XT(e){var t=e.transformState.scale,n=e.setup,r=n.minScale,o=n.alignmentAnimation,s=o.disabled,a=o.sizeX,l=o.sizeY,u=o.animationTime,f=o.animationType,p=s||t<r||!a&&!l;if(!p){var m=Dne(e);m&&xl(e,m,u,f)}}function qk(e,t,n){var r=e.startCoords,o=e.setup,s=o.alignmentAnimation,a=s.sizeX,l=s.sizeY;if(r){var u=Nne(e,t,n),f=u.x,p=u.y,m=pg(e,a),v=pg(e,l);Fne(e,{x:f,y:p}),Ane(e,f,p,m,v)}}function Vne(e){if(e.isPanning){var t=e.setup.panning.velocityDisabled,n=e.velocity,r=e.wrapperComponent,o=e.contentComponent;e.isPanning=!1,e.animate=!1,e.animation=null;var s=r==null?void 0:r.getBoundingClientRect(),a=o==null?void 0:o.getBoundingClientRect(),l=(s==null?void 0:s.width)||0,u=(s==null?void 0:s.height)||0,f=(a==null?void 0:a.width)||0,p=(a==null?void 0:a.height)||0,m=l<f||u<p,v=!t&&n&&(n==null?void 0:n.total)>.1&&m;v?Hne(e):XT(e)}}function o2(e,t,n,r){var o=e.setup,s=o.minScale,a=o.maxScale,l=o.limitToBounds,u=Xf(Ms(t,2),s,a,0,!1),f=Pu(e,u),p=Pv(e,n,r,u,f,l),m=p.x,v=p.y;return{scale:u,positionX:m,positionY:v}}function ZT(e,t,n){var r=e.transformState.scale,o=e.wrapperComponent,s=e.setup,a=s.minScale,l=s.limitToBounds,u=s.zoomAnimation,f=u.disabled,p=u.animationTime,m=u.animationType,v=f||r>=a;if((r>=1||l)&&XT(e),!(v||!o||!e.mounted)){var y=t||o.offsetWidth/2,S=n||o.offsetHeight/2,x=o2(e,a,y,S);x&&xl(e,x,p,m)}}var Ji=function(){return Ji=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},Ji.apply(this,arguments)};function Yk(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 bh={previousScale:1,scale:1,positionX:0,positionY:0},bd={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}},QT=function(e){var t,n,r,o;return{previousScale:(t=e.initialScale)!==null&&t!==void 0?t:bh.scale,scale:(n=e.initialScale)!==null&&n!==void 0?n:bh.scale,positionX:(r=e.initialPositionX)!==null&&r!==void 0?r:bh.positionX,positionY:(o=e.initialPositionY)!==null&&o!==void 0?o:bh.positionY}},Kk=function(e){var t=Ji({},bd);return Object.keys(e).forEach(function(n){var r=typeof e[n]<"u",o=typeof bd[n]<"u";if(o&&r){var s=Object.prototype.toString.call(bd[n]),a=s==="[object Object]",l=s==="[object Array]";a?t[n]=Ji(Ji({},bd[n]),e[n]):l?t[n]=Yk(Yk([],bd[n],!0),e[n],!0):t[n]=e[n]}}),t},JT=function(e,t,n){var r=e.transformState.scale,o=e.wrapperComponent,s=e.setup,a=s.maxScale,l=s.minScale,u=s.zoomAnimation,f=u.size;if(!o)throw new Error("Wrapper is not mounted");var p=r+t*n,m=Xf(Ms(p,3),l,a,f,!1);return m};function e8(e,t,n,r,o){var s=e.wrapperComponent,a=e.transformState,l=a.scale,u=a.positionX,f=a.positionY;if(!s)return console.error("No WrapperComponent found");var p=s.offsetWidth,m=s.offsetHeight,v=(p/2-u)/l,y=(m/2-f)/l,S=JT(e,t,n),x=o2(e,S,v,y);if(!x)return console.error("Error during zoom event. New transformation state was not calculated.");xl(e,x,r,o)}function t8(e,t,n,r){var o=e.setup,s=e.wrapperComponent,a=o.limitToBounds,l=QT(e.props),u=e.transformState,f=u.scale,p=u.positionX,m=u.positionY;if(s){var v=r2(e,l.scale),y=kv(l.positionX,l.positionY,v,a,0,0,s),S={scale:l.scale,positionX:y.x,positionY:y.y};f===l.scale&&p===l.positionX&&m===l.positionY||(r==null||r(),xl(e,S,t,n))}}function Wne(e,t,n,r){var o=e.getBoundingClientRect(),s=t.getBoundingClientRect(),a=n.getBoundingClientRect(),l=s.x*r.scale,u=s.y*r.scale;return{x:(o.x-a.x+l)/r.scale,y:(o.y-a.y+u)/r.scale}}function Une(e,t,n){var r=e.wrapperComponent,o=e.contentComponent,s=e.transformState,a=e.setup,l=a.limitToBounds,u=a.minScale,f=a.maxScale;if(!r||!o)return s;var p=r.getBoundingClientRect(),m=t.getBoundingClientRect(),v=Wne(t,r,o,s),y=v.x,S=v.y,x=m.width/s.scale,w=m.height/s.scale,_=r.offsetWidth/x,k=r.offsetHeight/w,P=Xf(n||Math.min(_,k),u,f,0,!1),I=(p.width-x*P)/2,j=(p.height-w*P)/2,E=(p.left-y)*P+I,T=(p.top-S)*P+j,R=r2(e,P),M=kv(E,T,R,l,0,0,r),D=M.x,N=M.y;return{positionX:D,positionY:N,scale:P}}var Gne=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),e8(e,1,t,n,r)}},qne=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),e8(e,-1,t,n,r)}},Yne=function(e){return function(t,n,r,o,s){o===void 0&&(o=300),s===void 0&&(s="easeOut");var a=e.transformState,l=a.positionX,u=a.positionY,f=a.scale,p=e.wrapperComponent,m=e.contentComponent,v=e.setup.disabled;if(!(v||!p||!m)){var y={positionX:Number.isNaN(t)?l:t,positionY:Number.isNaN(n)?u:n,scale:Number.isNaN(r)?f:r};xl(e,y,o,s)}}},Kne=function(e){return function(t,n){t===void 0&&(t=200),n===void 0&&(n="easeOut"),t8(e,t,n)}},Xne=function(e){return function(t,n,r){n===void 0&&(n=200),r===void 0&&(r="easeOut");var o=e.transformState,s=e.wrapperComponent,a=e.contentComponent;if(s&&a){var l=n8(t||o.scale,s,a);xl(e,l,n,r)}}},Zne=function(e){return function(t,n,r,o){r===void 0&&(r=600),o===void 0&&(o="easeOut"),$a(e);var s=e.wrapperComponent,a=typeof t=="string"?document.getElementById(t):t;if(s&&a&&s.contains(a)){var l=Une(e,a,n);xl(e,l,r,o)}}},tx=function(e){return{instance:e,zoomIn:Gne(e),zoomOut:qne(e),setTransform:Yne(e),resetTransform:Kne(e),centerView:Xne(e),zoomToElement:Zne(e)}},Qne=function(e){return{instance:e,state:e.transformState}},ar=function(e){var t={};return Object.assign(t,Qne(e)),Object.assign(t,tx(e)),t},T1=!1;function R1(){try{var e={get passive(){return T1=!0,!1}};return e}catch{return T1=!1,T1}}var jv=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},nx=function(e){e&&clearTimeout(e)},Jne=function(e,t,n){return"translate(".concat(e,"px, ").concat(t,"px) scale(").concat(n,")")},n8=function(e,t,n){var r=n.offsetWidth*e,o=n.offsetHeight*e,s=(t.offsetWidth-r)/2,a=(t.offsetHeight-o)/2;return{scale:e,positionX:s,positionY:a}};function ere(e){return function(t){e.forEach(function(n){typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var tre=function(e,t){var n=e.setup.wheel,r=n.disabled,o=n.wheelDisabled,s=n.touchPadDisabled,a=n.excluded,l=e.isInitialized,u=e.isPanning,f=t.target,p=l&&!u&&!r&&f;if(!p||o&&!t.ctrlKey||s&&t.ctrlKey)return!1;var m=jv(f,a);return!m},nre=function(e){return e?e.deltaY<0?1:-1:0};function rre(e,t){var n=nre(e),r=hne(t,n);return r}function r8(e,t,n){var r=t.getBoundingClientRect(),o=0,s=0;if("clientX"in e)o=(e.clientX-r.left)/n,s=(e.clientY-r.top)/n;else{var a=e.touches[0];o=(a.clientX-r.left)/n,s=(a.clientY-r.top)/n}return(Number.isNaN(o)||Number.isNaN(s))&&console.error("No mouse or touch offset found"),{x:o,y:s}}var ore=function(e,t,n,r,o){var s=e.transformState.scale,a=e.wrapperComponent,l=e.setup,u=l.maxScale,f=l.minScale,p=l.zoomAnimation,m=l.disablePadding,v=p.size,y=p.disabled;if(!a)throw new Error("Wrapper is not mounted");var S=s+t*n;if(o)return S;var x=r?!1:!y,w=Xf(Ms(S,3),f,u,v,x&&!m);return w},sre=function(e,t){var n=e.previousWheelEvent,r=e.transformState.scale,o=e.setup,s=o.maxScale,a=o.minScale;return n?r<s||r>a||Math.sign(n.deltaY)!==Math.sign(t.deltaY)||n.deltaY>0&&n.deltaY<t.deltaY||n.deltaY<0&&n.deltaY>t.deltaY||Math.sign(n.deltaY)!==Math.sign(t.deltaY):!1},are=function(e,t){var n=e.setup.pinch,r=n.disabled,o=n.excluded,s=e.isInitialized,a=t.target,l=s&&!r&&a;if(!l)return!1;var u=jv(a,o);return!u},ire=function(e){var t=e.setup.pinch.disabled,n=e.isInitialized,r=e.pinchStartDistance,o=n&&!t&&r;return!!o},lre=function(e,t,n){var r=n.getBoundingClientRect(),o=e.touches,s=Ms(o[0].clientX-r.left,5),a=Ms(o[0].clientY-r.top,5),l=Ms(o[1].clientX-r.left,5),u=Ms(o[1].clientY-r.top,5);return{x:(s+l)/2/t,y:(a+u)/2/t}},o8=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))},cre=function(e,t){var n=e.pinchStartScale,r=e.pinchStartDistance,o=e.setup,s=o.maxScale,a=o.minScale,l=o.zoomAnimation,u=o.disablePadding,f=l.size,p=l.disabled;if(!n||r===null||!t)throw new Error("Pinch touches distance was not provided");if(t<0)return e.transformState.scale;var m=t/r,v=m*n;return Xf(Ms(v,2),a,s,f,!p&&!u)},ure=160,dre=100,fre=function(e,t){var n=e.props,r=n.onWheelStart,o=n.onZoomStart;e.wheelStopEventTimer||($a(e),Cr(ar(e),t,r),Cr(ar(e),t,o))},pre=function(e,t){var n=e.props,r=n.onWheel,o=n.onZoom,s=e.contentComponent,a=e.setup,l=e.transformState,u=l.scale,f=a.limitToBounds,p=a.centerZoomedOut,m=a.zoomAnimation,v=a.wheel,y=a.disablePadding,S=m.size,x=m.disabled,w=v.step;if(!s)throw new Error("Component not mounted");t.preventDefault(),t.stopPropagation();var _=rre(t,null),k=ore(e,_,w,!t.ctrlKey);if(u!==k){var P=Pu(e,k),I=r8(t,s,u),j=x||S===0||p||y,E=f&&j,T=Pv(e,I.x,I.y,k,P,E),R=T.x,M=T.y;e.previousWheelEvent=t,e.setTransformState(k,R,M),Cr(ar(e),t,r),Cr(ar(e),t,o)}},hre=function(e,t){var n=e.props,r=n.onWheelStop,o=n.onZoomStop;nx(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout(function(){e.mounted&&(ZT(e,t.x,t.y),e.wheelAnimationTimer=null)},dre);var s=sre(e,t);s&&(nx(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout(function(){e.mounted&&(e.wheelStopEventTimer=null,Cr(ar(e),t,r),Cr(ar(e),t,o))},ure))},mre=function(e,t){var n=o8(t);e.pinchStartDistance=n,e.lastDistance=n,e.pinchStartScale=e.transformState.scale,e.isPanning=!1,$a(e)},gre=function(e,t){var n=e.contentComponent,r=e.pinchStartDistance,o=e.transformState.scale,s=e.setup,a=s.limitToBounds,l=s.centerZoomedOut,u=s.zoomAnimation,f=u.disabled,p=u.size;if(!(r===null||!n)){var m=lre(t,o,n);if(!(!Number.isFinite(m.x)||!Number.isFinite(m.y))){var v=o8(t),y=cre(e,v);if(y!==o){var S=Pu(e,y),x=f||p===0||l,w=a&&x,_=Pv(e,m.x,m.y,y,S,w),k=_.x,P=_.y;e.pinchMidpoint=m,e.lastDistance=v,e.setTransformState(y,k,P)}}}},vre=function(e){var t=e.pinchMidpoint;e.velocity=null,e.lastDistance=null,e.pinchMidpoint=null,e.pinchStartScale=null,e.pinchStartDistance=null,ZT(e,t==null?void 0:t.x,t==null?void 0:t.y)},s8=function(e,t){var n=e.props.onZoomStop,r=e.setup.doubleClick.animationTime;nx(e.doubleClickStopEventTimer),e.doubleClickStopEventTimer=setTimeout(function(){e.doubleClickStopEventTimer=null,Cr(ar(e),t,n)},r)},yre=function(e,t){var n=e.props,r=n.onZoomStart,o=n.onZoom,s=e.setup.doubleClick,a=s.animationTime,l=s.animationType;Cr(ar(e),t,r),t8(e,a,l,function(){return Cr(ar(e),t,o)}),s8(e,t)};function xre(e,t){var n=e.setup,r=e.doubleClickStopEventTimer,o=e.transformState,s=e.contentComponent,a=o.scale,l=e.props,u=l.onZoomStart,f=l.onZoom,p=n.doubleClick,m=p.disabled,v=p.mode,y=p.step,S=p.animationTime,x=p.animationType;if(!m&&!r){if(v==="reset")return yre(e,t);if(!s)return console.error("No ContentComponent found");var w=v==="zoomOut"?-1:1,_=JT(e,w,y);if(a!==_){Cr(ar(e),t,u);var k=r8(t,s,a),P=o2(e,_,k.x,k.y);if(!P)return console.error("Error during zoom event. New transformation state was not calculated.");Cr(ar(e),t,f),xl(e,P,S,x),s8(e,t)}}}var bre=function(e,t){var n=e.isInitialized,r=e.setup,o=e.wrapperComponent,s=r.doubleClick,a=s.disabled,l=s.excluded,u=t.target,f=o==null?void 0:o.contains(u),p=n&&u&&f&&!a;if(!p)return!1;var m=jv(u,l);return!m},wre=function(){function e(t){var n=this;this.mounted=!0,this.onChangeCallbacks=new Set,this.onInitCallbacks=new Set,this.wrapperComponent=null,this.contentComponent=null,this.isInitialized=!1,this.bounds=null,this.previousWheelEvent=null,this.wheelStopEventTimer=null,this.wheelAnimationTimer=null,this.isPanning=!1,this.startCoords=null,this.lastTouch=null,this.distance=null,this.lastDistance=null,this.pinchStartDistance=null,this.pinchStartScale=null,this.pinchMidpoint=null,this.doubleClickStopEventTimer=null,this.velocity=null,this.velocityTime=null,this.lastMousePosition=null,this.animate=!1,this.animation=null,this.maxBounds=null,this.pressedKeys={},this.mount=function(){n.initializeWindowEvents()},this.unmount=function(){n.cleanupWindowEvents()},this.update=function(r){Pu(n,n.transformState.scale),n.setup=Kk(r)},this.initializeWindowEvents=function(){var r,o=R1(),s=(r=n.wrapperComponent)===null||r===void 0?void 0:r.ownerDocument,a=s==null?void 0:s.defaultView;a==null||a.addEventListener("mousedown",n.onPanningStart,o),a==null||a.addEventListener("mousemove",n.onPanning,o),a==null||a.addEventListener("mouseup",n.onPanningStop,o),s==null||s.addEventListener("mouseleave",n.clearPanning,o),a==null||a.addEventListener("keyup",n.setKeyUnPressed,o),a==null||a.addEventListener("keydown",n.setKeyPressed,o)},this.cleanupWindowEvents=function(){var r,o,s=R1(),a=(r=n.wrapperComponent)===null||r===void 0?void 0:r.ownerDocument,l=a==null?void 0:a.defaultView;l==null||l.removeEventListener("mousedown",n.onPanningStart,s),l==null||l.removeEventListener("mousemove",n.onPanning,s),l==null||l.removeEventListener("mouseup",n.onPanningStop,s),a==null||a.removeEventListener("mouseleave",n.clearPanning,s),l==null||l.removeEventListener("keyup",n.setKeyUnPressed,s),l==null||l.removeEventListener("keydown",n.setKeyPressed,s),document.removeEventListener("mouseleave",n.clearPanning,s),$a(n),(o=n.observer)===null||o===void 0||o.disconnect()},this.handleInitializeWrapperEvents=function(r){var o=R1();r.addEventListener("wheel",n.onWheelZoom,o),r.addEventListener("dblclick",n.onDoubleClick,o),r.addEventListener("touchstart",n.onTouchPanningStart,o),r.addEventListener("touchmove",n.onTouchPanning,o),r.addEventListener("touchend",n.onTouchPanningStop,o)},this.handleInitialize=function(r){var o=n.setup.centerOnInit;n.applyTransformation(),n.onInitCallbacks.forEach(function(s){return s(ar(n))}),o&&(n.setCenter(),n.observer=new ResizeObserver(function(){var s;n.onInitCallbacks.forEach(function(a){return a(ar(n))}),n.setCenter(),(s=n.observer)===null||s===void 0||s.disconnect()}),n.observer.observe(r))},this.onWheelZoom=function(r){var o=n.setup.disabled;if(!o){var s=tre(n,r);if(s){var a=n.isPressingKeys(n.setup.wheel.activationKeys);a&&(fre(n,r),pre(n,r),hre(n,r))}}},this.onPanningStart=function(r){var o=n.setup.disabled,s=n.props.onPanningStart;if(!o){var a=Vk(n,r);if(a){var l=n.isPressingKeys(n.setup.panning.activationKeys);l&&(r.preventDefault(),r.stopPropagation(),$a(n),Gk(n,r),Cr(ar(n),r,s))}}},this.onPanning=function(r){var o=n.setup.disabled,s=n.props.onPanning;if(!o){var a=Wk(n);if(a){var l=n.isPressingKeys(n.setup.panning.activationKeys);l&&(r.preventDefault(),r.stopPropagation(),qk(n,r.clientX,r.clientY),Cr(ar(n),r,s))}}},this.onPanningStop=function(r){var o=n.props.onPanningStop;n.isPanning&&(Vne(n),Cr(ar(n),r,o))},this.onPinchStart=function(r){var o=n.setup.disabled,s=n.props,a=s.onPinchingStart,l=s.onZoomStart;if(!o){var u=are(n,r);u&&(mre(n,r),$a(n),Cr(ar(n),r,a),Cr(ar(n),r,l))}},this.onPinch=function(r){var o=n.setup.disabled,s=n.props,a=s.onPinching,l=s.onZoom;if(!o){var u=ire(n);u&&(r.preventDefault(),r.stopPropagation(),gre(n,r),Cr(ar(n),r,a),Cr(ar(n),r,l))}},this.onPinchStop=function(r){var o=n.props,s=o.onPinchingStop,a=o.onZoomStop;n.pinchStartScale&&(vre(n),Cr(ar(n),r,s),Cr(ar(n),r,a))},this.onTouchPanningStart=function(r){var o=n.setup.disabled,s=n.props.onPanningStart;if(!o){var a=Vk(n,r);if(a){var l=n.lastTouch&&+new Date-n.lastTouch<200;if(l&&r.touches.length===1)n.onDoubleClick(r);else{n.lastTouch=+new Date,$a(n);var u=r.touches,f=u.length===1,p=u.length===2;f&&($a(n),Gk(n,r),Cr(ar(n),r,s)),p&&n.onPinchStart(r)}}}},this.onTouchPanning=function(r){var o=n.setup.disabled,s=n.props.onPanning;if(n.isPanning&&r.touches.length===1){if(o)return;var a=Wk(n);if(!a)return;r.preventDefault(),r.stopPropagation();var l=r.touches[0];qk(n,l.clientX,l.clientY),Cr(ar(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=bre(n,r);s&&xre(n,r)}},this.clearPanning=function(r){n.isPanning&&n.onPanningStop(r)},this.setKeyPressed=function(r){n.pressedKeys[r.key]=!0},this.setKeyUnPressed=function(r){n.pressedKeys[r.key]=!1},this.isPressingKeys=function(r){return r.length?!!r.find(function(o){return n.pressedKeys[o]}):!0},this.setTransformState=function(r,o,s){var a=n.props.onTransformed;if(!Number.isNaN(r)&&!Number.isNaN(o)&&!Number.isNaN(s)){r!==n.transformState.scale&&(n.transformState.previousScale=n.transformState.scale,n.transformState.scale=r),n.transformState.positionX=o,n.transformState.positionY=s,n.applyTransformation();var l=ar(n);n.onChangeCallbacks.forEach(function(u){return u(l)}),Cr(l,{scale:r,positionX:o,positionY:s},a)}else console.error("Detected NaN set state values")},this.setCenter=function(){if(n.wrapperComponent&&n.contentComponent){var r=n8(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):Jne(r,o,s)},this.applyTransformation=function(){if(!(!n.mounted||!n.contentComponent)){var r=n.transformState,o=r.scale,s=r.positionX,a=r.positionY,l=n.handleTransformStyles(s,a,o);n.contentComponent.style.transform=l}},this.getContext=function(){return ar(n)},this.onChange=function(r){return n.onChangeCallbacks.has(r)||n.onChangeCallbacks.add(r),function(){n.onChangeCallbacks.delete(r)}},this.onInit=function(r){return n.onInitCallbacks.has(r)||n.onInitCallbacks.add(r),function(){n.onInitCallbacks.delete(r)}},this.init=function(r,o){n.cleanupWindowEvents(),n.wrapperComponent=r,n.contentComponent=o,Pu(n,n.transformState.scale),n.handleInitializeWrapperEvents(r),n.handleInitialize(o),n.initializeWindowEvents(),n.isInitialized=!0;var s=ar(n);Cr(s,void 0,n.props.onInit)},this.props=t,this.setup=Kk(this.props),this.transformState=QT(this.props)}return e}(),Iv=B.createContext(null),Sre=function(e,t){return typeof e=="function"?e(t):e},Cre=B.forwardRef(function(e,t){var n=h.useRef(new wre(e)).current,r=Sre(e.children,tx(n));return h.useImperativeHandle(t,function(){return tx(n)},[n]),h.useEffect(function(){n.update(e)},[n,e]),B.createElement(Iv.Provider,{value:n},r)});B.forwardRef(function(e,t){var n=h.useRef(null),r=h.useContext(Iv);return h.useEffect(function(){return r.onChange(function(o){if(n.current){var s=0,a=0;n.current.style.transform=r.handleTransformStyles(s,a,1/o.instance.transformState.scale)}})},[r]),B.createElement("div",Ji({},e,{ref:ere([n,t])}))});function _re(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 kre=`.transform-component-module_wrapper__SPB86 {
position: relative;
width: -moz-fit-content;
width: fit-content;
height: -moz-fit-content;
height: fit-content;
overflow: hidden;
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Safari */
-khtml-user-select: none; /* Konqueror HTML */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none;
margin: 0;
padding: 0;
}
.transform-component-module_content__FBWxo {
display: flex;
flex-wrap: wrap;
width: -moz-fit-content;
width: fit-content;
height: -moz-fit-content;
height: fit-content;
margin: 0;
padding: 0;
transform-origin: 0% 0%;
}
.transform-component-module_content__FBWxo img {
pointer-events: none;
}
`,Xk={wrapper:"transform-component-module_wrapper__SPB86",content:"transform-component-module_content__FBWxo"};_re(kre);var Pre=function(e){var t=e.children,n=e.wrapperClass,r=n===void 0?"":n,o=e.contentClass,s=o===void 0?"":o,a=e.wrapperStyle,l=e.contentStyle,u=e.wrapperProps,f=u===void 0?{}:u,p=e.contentProps,m=p===void 0?{}:p,v=h.useContext(Iv).init,y=h.useRef(null),S=h.useRef(null);return h.useEffect(function(){var x=y.current,w=S.current;x!==null&&w!==null&&v&&v(x,w)},[]),B.createElement("div",Ji({},f,{ref:y,className:"react-transform-wrapper ".concat(Xk.wrapper," ").concat(r),style:a}),B.createElement("div",Ji({},m,{ref:S,className:"react-transform-component ".concat(Xk.content," ").concat(s),style:l}),t))},a8=function(){var e=h.useContext(Iv);if(!e)throw new Error("Transform context must be placed inside TransformWrapper");return e};const Zk=1.5,i8="28rem",jre=()=>{const[e,t]=h.useState(0),[n,r]=h.useState(1),[o,s]=h.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)}}},Ire=({flipHorizontally:e,flipVertically:t,rotateCounterClockwise:n,rotateClockwise:r,reset:o})=>{const{zoomIn:s,zoomOut:a,resetTransform:l}=a8(),{t:u}=Ce();return i.jsxs(Fr,{isAttached:!0,orientation:"vertical",children:[i.jsx(Me,{icon:i.jsx(hV,{}),"aria-label":u("accessibility.zoomIn"),tooltip:u("accessibility.zoomIn"),onClick:()=>s(),fontSize:20}),i.jsx(Me,{icon:i.jsx(mV,{}),"aria-label":u("accessibility.zoomOut"),tooltip:u("accessibility.zoomOut"),onClick:()=>a(),fontSize:20}),i.jsx(Me,{icon:i.jsx(fV,{}),"aria-label":u("accessibility.rotateCounterClockwise"),tooltip:u("accessibility.rotateCounterClockwise"),onClick:n,fontSize:20}),i.jsx(Me,{icon:i.jsx(pV,{}),"aria-label":u("accessibility.rotateClockwise"),tooltip:u("accessibility.rotateClockwise"),onClick:r,fontSize:20}),i.jsx(Me,{icon:i.jsx(p4,{}),"aria-label":u("accessibility.flipHorizontally"),tooltip:u("accessibility.flipHorizontally"),onClick:e,fontSize:20}),i.jsx(Me,{icon:i.jsx(p4,{style:{transform:"rotate(90deg)"}}),"aria-label":u("accessibility.flipVertically"),tooltip:u("accessibility.flipVertically"),onClick:t,fontSize:20}),i.jsx(Me,{icon:i.jsx(Wj,{}),"aria-label":u("accessibility.reset"),tooltip:u("accessibility.reset"),onClick:()=>{l(),o()},fontSize:20})]})};function Ere({image:e,alt:t,ref:n,styleClass:r,rotation:o,scaleX:s,scaleY:a}){const{centerView:l}=a8();return i.jsx(Pre,{wrapperStyle:{width:"100%",height:"100%"},children:i.jsx("img",{style:{transform:`rotate(${o}deg) scaleX(${s}) scaleY(${a})`,width:"100%"},src:e.image_url,alt:t,ref:n,className:r||"",onLoad:()=>l(1,0,"easeOut")})})}const Ore=Te([pl,po],(e,t)=>{const{currentImage:n}=e,{shouldShowImageDetails:r}=t;return{viewerImageToDisplay:n,shouldShowImageDetails:r}},{memoizeOptions:{resultEqualityCheck:Ut}});function Tre(){const e=ue(),t=q(v=>v.lightbox.isLightboxOpen),{rotation:n,scaleX:r,scaleY:o,flipHorizontally:s,flipVertically:a,rotateCounterClockwise:l,rotateClockwise:u,reset:f}=jre(),{viewerImageToDisplay:p,shouldShowImageDetails:m}=q(Ore);return nt("Esc",()=>{t&&e(Hd(!1))},[t]),i.jsx(Co,{children:t&&i.jsx(zo.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15,ease:"easeInOut"},style:{display:"flex",width:"100vw",height:`calc(100vh - ${Zk*4}px)`,position:"fixed",top:`${Zk*4}px`,background:"var(--invokeai-colors-base-900)",zIndex:99},children:i.jsxs(Cre,{centerOnInit:!0,minScale:.1,initialPositionX:50,initialPositionY:50,children:[i.jsxs(K,{sx:{flexDir:"column",position:"absolute",insetInlineStart:4,gap:4,zIndex:3,top:4},children:[i.jsx(Me,{icon:i.jsx(dV,{}),"aria-label":"Exit Viewer",className:"lightbox-close-btn",onClick:()=>{e(Hd(!1))},fontSize:20}),i.jsx(Ire,{flipHorizontally:s,flipVertically:a,rotateCounterClockwise:l,rotateClockwise:u,reset:f})]}),i.jsx(K,{sx:{position:"absolute",top:4,zIndex:3,insetInlineStart:"50%",transform:"translate(-50%, 0)"},children:i.jsx(WT,{})}),p&&i.jsxs(i.Fragment,{children:[i.jsx(Ere,{rotation:n,scaleX:r,scaleY:o,image:p,styleClass:"lightbox-image"}),m&&i.jsx(UT,{image:p}),!m&&i.jsx(et,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"100vw",h:"100vh",px:16,pointerEvents:"none"},children:i.jsx(GT,{})})]})]})},"lightbox")})}function Qk(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.addEventListener&&e.addEventListener.apply(e,t)}function Jk(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.removeEventListener&&e.removeEventListener.apply(e,t)}var Rre=function(e,t){return typeof t=="boolean"?t:!e},Mre=function(e){return h.useReducer(Rre,e)};const Dre=Mre;var Are=function(e,t){t===void 0&&(t=!0);var n=h.useState(!1),r=n[0],o=n[1];return h.useEffect(function(){var s=function(){return o(!0)},a=function(){return o(!1)};t&&e&&e.current&&(Qk(e.current,"mouseover",s),Qk(e.current,"mouseout",a));var l=e.current;return function(){t&&l&&(Jk(l,"mouseover",s),Jk(l,"mouseout",a))}},[t,e]),r};const Nre=Are,zre=Te(pr,e=>{const{isConnected:t,isProcessing:n,statusTranslationKey:r,currentIteration:o,totalIterations:s,currentStatusHasSteps:a}=e;return{isConnected:t,isProcessing:n,currentIteration:o,totalIterations:s,statusTranslationKey:r,currentStatusHasSteps:a}},zn),e3={ok:"green.400",working:"yellow.400",error:"red.400"},t3={ok:"green.600",working:"yellow.500",error:"red.500"},$re=()=>{const{isConnected:e,isProcessing:t,currentIteration:n,totalIterations:r,statusTranslationKey:o}=q(zre),{t:s}=Ce(),a=h.useRef(null),l=h.useMemo(()=>t?"working":e?"ok":"error",[t,e]),u=h.useMemo(()=>{if(n&&r)return` (${n}/${r})`},[n,r]),f=Nre(a);return i.jsxs(K,{ref:a,h:"full",px:2,alignItems:"center",gap:5,children:[i.jsx(Co,{children:f&&i.jsx(zo.div,{initial:{opacity:0},animate:{opacity:1,transition:{duration:.15}},exit:{opacity:0,transition:{delay:.8}},children:i.jsxs(lt,{sx:{fontSize:"sm",fontWeight:"600",pb:"1px",userSelect:"none",color:t3[l],_dark:{color:e3[l]}},children:[s(o),u]})},"statusText")}),i.jsx(uo,{as:UW,sx:{boxSize:"0.5rem",color:t3[l],_dark:{color:e3[l]}}})]})};function Lre(e){const{title:t,hotkey:n,description:r}=e;return i.jsxs(gi,{sx:{gridTemplateColumns:"auto max-content",justifyContent:"space-between",alignItems:"center"},children:[i.jsxs(gi,{children:[i.jsx(lt,{fontWeight:600,children:t}),r&&i.jsx(lt,{sx:{fontSize:"sm"},variant:"subtext",children:r})]}),i.jsx(et,{sx:{fontSize:"sm",fontWeight:600,px:2,py:1},children:n})]})}function Bre({children:e}){const{isOpen:t,onOpen:n,onClose:r}=us(),{t:o}=Ce(),s=[{title:o("hotkeys.invoke.title"),desc:o("hotkeys.invoke.desc"),hotkey:"Ctrl+Enter"},{title:o("hotkeys.cancel.title"),desc:o("hotkeys.cancel.desc"),hotkey:"Shift+X"},{title:o("hotkeys.focusPrompt.title"),desc:o("hotkeys.focusPrompt.desc"),hotkey:"Alt+A"},{title:o("hotkeys.toggleOptions.title"),desc:o("hotkeys.toggleOptions.desc"),hotkey:"O"},{title:o("hotkeys.pinOptions.title"),desc:o("hotkeys.pinOptions.desc"),hotkey:"Shift+O"},{title:o("hotkeys.toggleViewer.title"),desc:o("hotkeys.toggleViewer.desc"),hotkey:"Z"},{title:o("hotkeys.toggleGallery.title"),desc:o("hotkeys.toggleGallery.desc"),hotkey:"G"},{title:o("hotkeys.maximizeWorkSpace.title"),desc:o("hotkeys.maximizeWorkSpace.desc"),hotkey:"F"},{title:o("hotkeys.changeTabs.title"),desc:o("hotkeys.changeTabs.desc"),hotkey:"1-5"},{title:o("hotkeys.consoleToggle.title"),desc:o("hotkeys.consoleToggle.desc"),hotkey:"`"}],a=[{title:o("hotkeys.setPrompt.title"),desc:o("hotkeys.setPrompt.desc"),hotkey:"P"},{title:o("hotkeys.setSeed.title"),desc:o("hotkeys.setSeed.desc"),hotkey:"S"},{title:o("hotkeys.setParameters.title"),desc:o("hotkeys.setParameters.desc"),hotkey:"A"},{title:o("hotkeys.restoreFaces.title"),desc:o("hotkeys.restoreFaces.desc"),hotkey:"Shift+R"},{title:o("hotkeys.upscale.title"),desc:o("hotkeys.upscale.desc"),hotkey:"Shift+U"},{title:o("hotkeys.showInfo.title"),desc:o("hotkeys.showInfo.desc"),hotkey:"I"},{title:o("hotkeys.sendToImageToImage.title"),desc:o("hotkeys.sendToImageToImage.desc"),hotkey:"Shift+I"},{title:o("hotkeys.deleteImage.title"),desc:o("hotkeys.deleteImage.desc"),hotkey:"Del"},{title:o("hotkeys.closePanels.title"),desc:o("hotkeys.closePanels.desc"),hotkey:"Esc"}],l=[{title:o("hotkeys.previousImage.title"),desc:o("hotkeys.previousImage.desc"),hotkey:"Arrow Left"},{title:o("hotkeys.nextImage.title"),desc:o("hotkeys.nextImage.desc"),hotkey:"Arrow Right"},{title:o("hotkeys.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"}],u=[{title:o("hotkeys.selectBrush.title"),desc:o("hotkeys.selectBrush.desc"),hotkey:"B"},{title:o("hotkeys.selectEraser.title"),desc:o("hotkeys.selectEraser.desc"),hotkey:"E"},{title:o("hotkeys.decreaseBrushSize.title"),desc:o("hotkeys.decreaseBrushSize.desc"),hotkey:"["},{title:o("hotkeys.increaseBrushSize.title"),desc:o("hotkeys.increaseBrushSize.desc"),hotkey:"]"},{title:o("hotkeys.decreaseBrushOpacity.title"),desc:o("hotkeys.decreaseBrushOpacity.desc"),hotkey:"Shift + ["},{title:o("hotkeys.increaseBrushOpacity.title"),desc:o("hotkeys.increaseBrushOpacity.desc"),hotkey:"Shift + ]"},{title:o("hotkeys.moveTool.title"),desc:o("hotkeys.moveTool.desc"),hotkey:"V"},{title:o("hotkeys.fillBoundingBox.title"),desc:o("hotkeys.fillBoundingBox.desc"),hotkey:"Shift + F"},{title:o("hotkeys.eraseBoundingBox.title"),desc:o("hotkeys.eraseBoundingBox.desc"),hotkey:"Delete / Backspace"},{title:o("hotkeys.colorPicker.title"),desc:o("hotkeys.colorPicker.desc"),hotkey:"C"},{title:o("hotkeys.toggleSnap.title"),desc:o("hotkeys.toggleSnap.desc"),hotkey:"N"},{title:o("hotkeys.quickToggleMove.title"),desc:o("hotkeys.quickToggleMove.desc"),hotkey:"Hold Space"},{title:o("hotkeys.toggleLayer.title"),desc:o("hotkeys.toggleLayer.desc"),hotkey:"Q"},{title:o("hotkeys.clearMask.title"),desc:o("hotkeys.clearMask.desc"),hotkey:"Shift+C"},{title:o("hotkeys.hideMask.title"),desc:o("hotkeys.hideMask.desc"),hotkey:"H"},{title:o("hotkeys.showHideBoundingBox.title"),desc:o("hotkeys.showHideBoundingBox.desc"),hotkey:"Shift+H"},{title:o("hotkeys.mergeVisible.title"),desc:o("hotkeys.mergeVisible.desc"),hotkey:"Shift+M"},{title:o("hotkeys.saveToGallery.title"),desc:o("hotkeys.saveToGallery.desc"),hotkey:"Shift+S"},{title:o("hotkeys.copyToClipboard.title"),desc:o("hotkeys.copyToClipboard.desc"),hotkey:"Ctrl+C"},{title:o("hotkeys.downloadImage.title"),desc:o("hotkeys.downloadImage.desc"),hotkey:"Shift+D"},{title:o("hotkeys.undoStroke.title"),desc:o("hotkeys.undoStroke.desc"),hotkey:"Ctrl+Z"},{title:o("hotkeys.redoStroke.title"),desc:o("hotkeys.redoStroke.desc"),hotkey:"Ctrl+Shift+Z, Ctrl+Y"},{title:o("hotkeys.resetView.title"),desc:o("hotkeys.resetView.desc"),hotkey:"R"},{title:o("hotkeys.previousStagingImage.title"),desc:o("hotkeys.previousStagingImage.desc"),hotkey:"Arrow Left"},{title:o("hotkeys.nextStagingImage.title"),desc:o("hotkeys.nextStagingImage.desc"),hotkey:"Arrow Right"},{title:o("hotkeys.acceptStagingImage.title"),desc:o("hotkeys.acceptStagingImage.desc"),hotkey:"Enter"}],f=p=>i.jsx(K,{flexDir:"column",gap:4,children:p.map((m,v)=>i.jsxs(K,{flexDir:"column",px:2,gap:4,children:[i.jsx(Lre,{title:m.title,description:m.desc,hotkey:m.hotkey}),v<p.length-1&&i.jsx(Fu,{})]},v))});return i.jsxs(i.Fragment,{children:[h.cloneElement(e,{onClick:n}),i.jsxs(tl,{isOpen:t,onClose:r,children:[i.jsx(ya,{}),i.jsxs(nl,{children:[i.jsx(va,{children:o("hotkeys.keyboardShortcuts")}),i.jsx(Vu,{}),i.jsx(xa,{children:i.jsx(aP,{allowMultiple:!0,children:i.jsxs(K,{flexDir:"column",gap:2,children:[i.jsxs(jd,{children:[i.jsx(kd,{children:i.jsxs(K,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[i.jsx("h2",{children:o("hotkeys.appHotkeys")}),i.jsx(Pd,{})]})}),i.jsx(Id,{children:f(s)})]}),i.jsxs(jd,{children:[i.jsx(kd,{children:i.jsxs(K,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[i.jsx("h2",{children:o("hotkeys.generalHotkeys")}),i.jsx(Pd,{})]})}),i.jsx(Id,{children:f(a)})]}),i.jsxs(jd,{children:[i.jsx(kd,{children:i.jsxs(K,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[i.jsx("h2",{children:o("hotkeys.galleryHotkeys")}),i.jsx(Pd,{})]})}),i.jsx(Id,{children:f(l)})]}),i.jsxs(jd,{children:[i.jsx(kd,{children:i.jsxs(K,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[i.jsx("h2",{children:o("hotkeys.unifiedCanvasHotkeys")}),i.jsx(Pd,{})]})}),i.jsx(Id,{children:f(u)})]})]})})}),i.jsx(ga,{})]})]})]})}const l8=()=>{const e=q(t=>t.system.app_version);return i.jsxs(K,{alignItems:"center",gap:3,ps:1,children:[i.jsx(If,{src:UM,alt:"invoke-ai-logo",sx:{w:"32px",h:"32px",minW:"32px",minH:"32px",userSelect:"none"}}),i.jsxs(K,{sx:{gap:3},children:[i.jsxs(lt,{sx:{fontSize:"xl",userSelect:"none"},children:["invoke ",i.jsx("strong",{children:"ai"})]}),i.jsx(lt,{sx:{fontWeight:300,marginTop:1},variant:"subtext",children:e})]})]})},Fre={ar:co.t("common.langArabic",{lng:"ar"}),nl:co.t("common.langDutch",{lng:"nl"}),en:co.t("common.langEnglish",{lng:"en"}),fr:co.t("common.langFrench",{lng:"fr"}),de:co.t("common.langGerman",{lng:"de"}),he:co.t("common.langHebrew",{lng:"he"}),it:co.t("common.langItalian",{lng:"it"}),ja:co.t("common.langJapanese",{lng:"ja"}),ko:co.t("common.langKorean",{lng:"ko"}),pl:co.t("common.langPolish",{lng:"pl"}),pt_BR:co.t("common.langBrPortuguese",{lng:"pt_BR"}),pt:co.t("common.langPortuguese",{lng:"pt"}),ru:co.t("common.langRussian",{lng:"ru"}),zh_CN:co.t("common.langSimplifiedChinese",{lng:"zh_CN"}),es:co.t("common.langSpanish",{lng:"es"}),uk:co.t("common.langUkranian",{lng:"ua"})};function Hre(){const{t:e}=Ce(),t=ue(),n=q(v5);return i.jsxs(Mg,{closeOnSelect:!1,children:[i.jsx(er,{label:e("common.languagePickerLabel"),hasArrow:!0,children:i.jsx(Dg,{as:mi,icon:i.jsx(CU,{}),variant:"link","aria-label":e("common.languagePickerLabel"),fontSize:22,minWidth:8})}),i.jsx(Lf,{children:i.jsx(lb,{value:n,children:qa(Fre,(r,o)=>i.jsx(Kd,{value:o,onClick:()=>t(GM(o)),children:r},o))})})]})}const s2=e=>{e.stopPropagation()},Vre=e=>{const{label:t="",isDisabled:n=!1,isInvalid:r,formControlProps:o,...s}=e;return i.jsxs(_n,{isInvalid:r,isDisabled:n,...o,children:[t!==""&&i.jsx(jn,{children:t}),i.jsx(Df,{...s,onPaste:s2})]})},lr=h.memo(Vre),n3=/^-?(0\.)?\.?$/,Wre=e=>{const{label:t,isDisabled:n=!1,showStepper:r=!0,isInvalid:o,value:s,onChange:a,min:l,max:u,isInteger:f=!0,formControlProps:p,formLabelProps:m,numberInputFieldProps:v,numberInputStepperProps:y,tooltipProps:S,...x}=e,[w,_]=h.useState(String(s));h.useEffect(()=>{!w.match(n3)&&s!==Number(w)&&_(String(s))},[s,w]);const k=I=>{_(I),I.match(n3)||a(f?Math.floor(Number(I)):Number(I))},P=I=>{const j=ma(f?Math.floor(Number(I.target.value)):Number(I.target.value),l,u);_(String(j)),a(j)};return i.jsx(er,{...S,children:i.jsxs(_n,{isDisabled:n,isInvalid:o,...p,children:[t&&i.jsx(jn,{...m,children:t}),i.jsxs(Lg,{value:w,min:l,max:u,keepWithinRange:!0,clampValueOnBlur:!1,onChange:k,onBlur:P,...x,onPaste:s2,children:[i.jsx(Fg,{...v}),r&&i.jsxs(Bg,{children:[i.jsx(Vg,{...y}),i.jsx(Hg,{...y})]})]})]})})},cl=h.memo(Wre);var Ure=function(t){return Gre(t)&&!qre(t)};function Gre(e){return!!e&&typeof e=="object"}function qre(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||Xre(e)}var Yre=typeof Symbol=="function"&&Symbol.for,Kre=Yre?Symbol.for("react.element"):60103;function Xre(e){return e.$$typeof===Kre}function Zre(e){return Array.isArray(e)?[]:{}}function hg(e,t){return t.clone!==!1&&t.isMergeableObject(e)?bf(Zre(e),e,t):e}function Qre(e,t,n){return e.concat(t).map(function(r){return hg(r,n)})}function Jre(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(o){r[o]=hg(e[o],n)}),Object.keys(t).forEach(function(o){!n.isMergeableObject(t[o])||!e[o]?r[o]=hg(t[o],n):r[o]=bf(e[o],t[o],n)}),r}function bf(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||Qre,n.isMergeableObject=n.isMergeableObject||Ure;var r=Array.isArray(t),o=Array.isArray(e),s=r===o;return s?r?n.arrayMerge(e,t,n):Jre(e,t,n):hg(t,n)}bf.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,o){return bf(r,o,n)},{})};var rx=bf,r3=Array.isArray,o3=Object.keys,eoe=Object.prototype.hasOwnProperty,toe=typeof Element<"u";function ox(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=r3(e),r=r3(t),o,s,a;if(n&&r){if(s=e.length,s!=t.length)return!1;for(o=s;o--!==0;)if(!ox(e[o],t[o]))return!1;return!0}if(n!=r)return!1;var l=e instanceof Date,u=t instanceof Date;if(l!=u)return!1;if(l&&u)return e.getTime()==t.getTime();var f=e instanceof RegExp,p=t instanceof RegExp;if(f!=p)return!1;if(f&&p)return e.toString()==t.toString();var m=o3(e);if(s=m.length,s!==o3(t).length)return!1;for(o=s;o--!==0;)if(!eoe.call(t,m[o]))return!1;if(toe&&e instanceof Element&&t instanceof Element)return e===t;for(o=s;o--!==0;)if(a=m[o],!(a==="_owner"&&e.$$typeof)&&!ox(e[a],t[a]))return!1;return!0}return e!==e&&t!==t}var noe=function(t,n){try{return ox(t,n)}catch(r){if(r.message&&r.message.match(/stack|recursion/i)||r.number===-2146828260)return console.warn("Warning: react-fast-compare does not handle circular references.",r.name,r.message),!1;throw r}};const Rl=kf(noe);var roe=!0;function ooe(e,t){if(!roe){if(e)return;var n="Warning: "+t;typeof console<"u"&&console.warn(n);try{throw Error(n)}catch{}}}function gr(){return gr=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},gr.apply(this,arguments)}function Zc(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 Ev=h.createContext(void 0);Ev.displayName="FormikContext";var soe=Ev.Provider;Ev.Consumer;function c8(){var e=h.useContext(Ev);return e||ooe(!1),e}var ss=function(t){return typeof t=="function"},Ov=function(t){return t!==null&&typeof t=="object"},aoe=function(t){return String(Math.floor(Number(t)))===t},M1=function(t){return Object.prototype.toString.call(t)==="[object String]"},ioe=function(t){return h.Children.count(t)===0},D1=function(t){return Ov(t)&&ss(t.then)};function rs(e,t,n,r){r===void 0&&(r=0);for(var o=Z5(t);e&&r<o.length;)e=e[o[r++]];return r!==o.length&&!e||e===void 0?n:e}function Xl(e,t,n){for(var r=$S(e),o=r,s=0,a=Z5(t);s<a.length-1;s++){var l=a[s],u=rs(e,a.slice(0,s+1));if(u&&(Ov(u)||Array.isArray(u)))o=o[l]=$S(u);else{var f=a[s+1];o=o[l]=aoe(f)&&Number(f)>=0?[]:{}}}return(s===0?e:o)[a[s]]===n?e:(n===void 0?delete o[a[s]]:o[a[s]]=n,s===0&&n===void 0&&delete r[a[s]],r)}function u8(e,t,n,r){n===void 0&&(n=new WeakMap),r===void 0&&(r={});for(var o=0,s=Object.keys(e);o<s.length;o++){var a=s[o],l=e[a];Ov(l)?n.get(l)||(n.set(l,!0),r[a]=Array.isArray(l)?[]:{},u8(l,t,n,r[a])):r[a]=t}return r}function loe(e,t){switch(t.type){case"SET_VALUES":return gr({},e,{values:t.payload});case"SET_TOUCHED":return gr({},e,{touched:t.payload});case"SET_ERRORS":return Rl(e.errors,t.payload)?e:gr({},e,{errors:t.payload});case"SET_STATUS":return gr({},e,{status:t.payload});case"SET_ISSUBMITTING":return gr({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return gr({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return gr({},e,{values:Xl(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return gr({},e,{touched:Xl(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return gr({},e,{errors:Xl(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":return gr({},e,t.payload);case"SET_FORMIK_STATE":return t.payload(e);case"SUBMIT_ATTEMPT":return gr({},e,{touched:u8(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":return gr({},e,{isSubmitting:!1});case"SUBMIT_SUCCESS":return gr({},e,{isSubmitting:!1});default:return e}}var El={},wh={};function coe(e){var t=e.validateOnChange,n=t===void 0?!0:t,r=e.validateOnBlur,o=r===void 0?!0:r,s=e.validateOnMount,a=s===void 0?!1:s,l=e.isInitialValid,u=e.enableReinitialize,f=u===void 0?!1:u,p=e.onSubmit,m=Zc(e,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),v=gr({validateOnChange:n,validateOnBlur:o,validateOnMount:a,onSubmit:p},m),y=h.useRef(v.initialValues),S=h.useRef(v.initialErrors||El),x=h.useRef(v.initialTouched||wh),w=h.useRef(v.initialStatus),_=h.useRef(!1),k=h.useRef({});h.useEffect(function(){return _.current=!0,function(){_.current=!1}},[]);var P=h.useState(0),I=P[1],j=h.useRef({values:v.initialValues,errors:v.initialErrors||El,touched:v.initialTouched||wh,status:v.initialStatus,isSubmitting:!1,isValidating:!1,submitCount:0}),E=j.current,T=h.useCallback(function(Y){var Se=j.current;j.current=loe(Se,Y),Se!==j.current&&I(function(ne){return ne+1})},[]),R=h.useCallback(function(Y,Se){return new Promise(function(ne,he){var Re=v.validate(Y,Se);Re==null?ne(El):D1(Re)?Re.then(function(Ke){ne(Ke||El)},function(Ke){he(Ke)}):ne(Re)})},[v.validate]),M=h.useCallback(function(Y,Se){var ne=v.validationSchema,he=ss(ne)?ne(Se):ne,Re=Se&&he.validateAt?he.validateAt(Se,Y):doe(Y,he);return new Promise(function(Ke,ge){Re.then(function(){Ke(El)},function(ut){ut.name==="ValidationError"?Ke(uoe(ut)):ge(ut)})})},[v.validationSchema]),D=h.useCallback(function(Y,Se){return new Promise(function(ne){return ne(k.current[Y].validate(Se))})},[]),N=h.useCallback(function(Y){var Se=Object.keys(k.current).filter(function(he){return ss(k.current[he].validate)}),ne=Se.length>0?Se.map(function(he){return D(he,rs(Y,he))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(ne).then(function(he){return he.reduce(function(Re,Ke,ge){return Ke==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||Ke&&(Re=Xl(Re,Se[ge],Ke)),Re},{})})},[D]),U=h.useCallback(function(Y){return Promise.all([N(Y),v.validationSchema?M(Y):{},v.validate?R(Y):{}]).then(function(Se){var ne=Se[0],he=Se[1],Re=Se[2],Ke=rx.all([ne,he,Re],{arrayMerge:foe});return Ke})},[v.validate,v.validationSchema,N,R,M]),z=_s(function(Y){return Y===void 0&&(Y=E.values),T({type:"SET_ISVALIDATING",payload:!0}),U(Y).then(function(Se){return _.current&&(T({type:"SET_ISVALIDATING",payload:!1}),T({type:"SET_ERRORS",payload:Se})),Se})});h.useEffect(function(){a&&_.current===!0&&Rl(y.current,v.initialValues)&&z(y.current)},[a,z]);var F=h.useCallback(function(Y){var Se=Y&&Y.values?Y.values:y.current,ne=Y&&Y.errors?Y.errors:S.current?S.current:v.initialErrors||{},he=Y&&Y.touched?Y.touched:x.current?x.current:v.initialTouched||{},Re=Y&&Y.status?Y.status:w.current?w.current:v.initialStatus;y.current=Se,S.current=ne,x.current=he,w.current=Re;var Ke=function(){T({type:"RESET_FORM",payload:{isSubmitting:!!Y&&!!Y.isSubmitting,errors:ne,touched:he,status:Re,values:Se,isValidating:!!Y&&!!Y.isValidating,submitCount:Y&&Y.submitCount&&typeof Y.submitCount=="number"?Y.submitCount:0}})};if(v.onReset){var ge=v.onReset(E.values,ke);D1(ge)?ge.then(Ke):Ke()}else Ke()},[v.initialErrors,v.initialStatus,v.initialTouched]);h.useEffect(function(){_.current===!0&&!Rl(y.current,v.initialValues)&&f&&(y.current=v.initialValues,F(),a&&z(y.current))},[f,v.initialValues,F,a,z]),h.useEffect(function(){f&&_.current===!0&&!Rl(S.current,v.initialErrors)&&(S.current=v.initialErrors||El,T({type:"SET_ERRORS",payload:v.initialErrors||El}))},[f,v.initialErrors]),h.useEffect(function(){f&&_.current===!0&&!Rl(x.current,v.initialTouched)&&(x.current=v.initialTouched||wh,T({type:"SET_TOUCHED",payload:v.initialTouched||wh}))},[f,v.initialTouched]),h.useEffect(function(){f&&_.current===!0&&!Rl(w.current,v.initialStatus)&&(w.current=v.initialStatus,T({type:"SET_STATUS",payload:v.initialStatus}))},[f,v.initialStatus,v.initialTouched]);var H=_s(function(Y){if(k.current[Y]&&ss(k.current[Y].validate)){var Se=rs(E.values,Y),ne=k.current[Y].validate(Se);return D1(ne)?(T({type:"SET_ISVALIDATING",payload:!0}),ne.then(function(he){return he}).then(function(he){T({type:"SET_FIELD_ERROR",payload:{field:Y,value:he}}),T({type:"SET_ISVALIDATING",payload:!1})})):(T({type:"SET_FIELD_ERROR",payload:{field:Y,value:ne}}),Promise.resolve(ne))}else if(v.validationSchema)return T({type:"SET_ISVALIDATING",payload:!0}),M(E.values,Y).then(function(he){return he}).then(function(he){T({type:"SET_FIELD_ERROR",payload:{field:Y,value:rs(he,Y)}}),T({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),G=h.useCallback(function(Y,Se){var ne=Se.validate;k.current[Y]={validate:ne}},[]),A=h.useCallback(function(Y){delete k.current[Y]},[]),L=_s(function(Y,Se){T({type:"SET_TOUCHED",payload:Y});var ne=Se===void 0?o:Se;return ne?z(E.values):Promise.resolve()}),W=h.useCallback(function(Y){T({type:"SET_ERRORS",payload:Y})},[]),V=_s(function(Y,Se){var ne=ss(Y)?Y(E.values):Y;T({type:"SET_VALUES",payload:ne});var he=Se===void 0?n:Se;return he?z(ne):Promise.resolve()}),ee=h.useCallback(function(Y,Se){T({type:"SET_FIELD_ERROR",payload:{field:Y,value:Se}})},[]),le=_s(function(Y,Se,ne){T({type:"SET_FIELD_VALUE",payload:{field:Y,value:Se}});var he=ne===void 0?n:ne;return he?z(Xl(E.values,Y,Se)):Promise.resolve()}),oe=h.useCallback(function(Y,Se){var ne=Se,he=Y,Re;if(!M1(Y)){Y.persist&&Y.persist();var Ke=Y.target?Y.target:Y.currentTarget,ge=Ke.type,ut=Ke.name,Rt=Ke.id,en=Ke.value,$e=Ke.checked,Xe=Ke.outerHTML,On=Ke.options,Ie=Ke.multiple;ne=Se||ut||Rt,he=/number|range/.test(ge)?(Re=parseFloat(en),isNaN(Re)?"":Re):/checkbox/.test(ge)?hoe(rs(E.values,ne),$e,en):On&&Ie?poe(On):en}ne&&le(ne,he)},[le,E.values]),X=_s(function(Y){if(M1(Y))return function(Se){return oe(Se,Y)};oe(Y)}),Q=_s(function(Y,Se,ne){Se===void 0&&(Se=!0),T({type:"SET_FIELD_TOUCHED",payload:{field:Y,value:Se}});var he=ne===void 0?o:ne;return he?z(E.values):Promise.resolve()}),ie=h.useCallback(function(Y,Se){Y.persist&&Y.persist();var ne=Y.target,he=ne.name,Re=ne.id,Ke=ne.outerHTML,ge=Se||he||Re;Q(ge,!0)},[Q]),ve=_s(function(Y){if(M1(Y))return function(Se){return ie(Se,Y)};ie(Y)}),ye=h.useCallback(function(Y){ss(Y)?T({type:"SET_FORMIK_STATE",payload:Y}):T({type:"SET_FORMIK_STATE",payload:function(){return Y}})},[]),se=h.useCallback(function(Y){T({type:"SET_STATUS",payload:Y})},[]),de=h.useCallback(function(Y){T({type:"SET_ISSUBMITTING",payload:Y})},[]),fe=_s(function(){return T({type:"SUBMIT_ATTEMPT"}),z().then(function(Y){var Se=Y instanceof Error,ne=!Se&&Object.keys(Y).length===0;if(ne){var he;try{if(he=ae(),he===void 0)return}catch(Re){throw Re}return Promise.resolve(he).then(function(Re){return _.current&&T({type:"SUBMIT_SUCCESS"}),Re}).catch(function(Re){if(_.current)throw T({type:"SUBMIT_FAILURE"}),Re})}else if(_.current&&(T({type:"SUBMIT_FAILURE"}),Se))throw Y})}),xe=_s(function(Y){Y&&Y.preventDefault&&ss(Y.preventDefault)&&Y.preventDefault(),Y&&Y.stopPropagation&&ss(Y.stopPropagation)&&Y.stopPropagation(),fe().catch(function(Se){console.warn("Warning: An unhandled error was caught from submitForm()",Se)})}),ke={resetForm:F,validateForm:z,validateField:H,setErrors:W,setFieldError:ee,setFieldTouched:Q,setFieldValue:le,setStatus:se,setSubmitting:de,setTouched:L,setValues:V,setFormikState:ye,submitForm:fe},ae=_s(function(){return p(E.values,ke)}),Pe=_s(function(Y){Y&&Y.preventDefault&&ss(Y.preventDefault)&&Y.preventDefault(),Y&&Y.stopPropagation&&ss(Y.stopPropagation)&&Y.stopPropagation(),F()}),tt=h.useCallback(function(Y){return{value:rs(E.values,Y),error:rs(E.errors,Y),touched:!!rs(E.touched,Y),initialValue:rs(y.current,Y),initialTouched:!!rs(x.current,Y),initialError:rs(S.current,Y)}},[E.errors,E.touched,E.values]),ze=h.useCallback(function(Y){return{setValue:function(ne,he){return le(Y,ne,he)},setTouched:function(ne,he){return Q(Y,ne,he)},setError:function(ne){return ee(Y,ne)}}},[le,Q,ee]),We=h.useCallback(function(Y){var Se=Ov(Y),ne=Se?Y.name:Y,he=rs(E.values,ne),Re={name:ne,value:he,onChange:X,onBlur:ve};if(Se){var Ke=Y.type,ge=Y.value,ut=Y.as,Rt=Y.multiple;Ke==="checkbox"?ge===void 0?Re.checked=!!he:(Re.checked=!!(Array.isArray(he)&&~he.indexOf(ge)),Re.value=ge):Ke==="radio"?(Re.checked=he===ge,Re.value=ge):ut==="select"&&Rt&&(Re.value=Re.value||[],Re.multiple=!0)}return Re},[ve,X,E.values]),It=h.useMemo(function(){return!Rl(y.current,E.values)},[y.current,E.values]),pt=h.useMemo(function(){return typeof l<"u"?It?E.errors&&Object.keys(E.errors).length===0:l!==!1&&ss(l)?l(v):l:E.errors&&Object.keys(E.errors).length===0},[l,It,E.errors,v]),bn=gr({},E,{initialValues:y.current,initialErrors:S.current,initialTouched:x.current,initialStatus:w.current,handleBlur:ve,handleChange:X,handleReset:Pe,handleSubmit:xe,resetForm:F,setErrors:W,setFormikState:ye,setFieldTouched:Q,setFieldValue:le,setFieldError:ee,setStatus:se,setSubmitting:de,setTouched:L,setValues:V,submitForm:fe,validateForm:z,validateField:H,isValid:pt,dirty:It,unregisterField:A,registerField:G,getFieldProps:We,getFieldMeta:tt,getFieldHelpers:ze,validateOnBlur:o,validateOnChange:n,validateOnMount:a});return bn}function Zf(e){var t=coe(e),n=e.component,r=e.children,o=e.render,s=e.innerRef;return h.useImperativeHandle(s,function(){return t}),h.createElement(soe,{value:t},n?h.createElement(n,t):o?o(t):r?ss(r)?r(t):ioe(r)?null:h.Children.only(r):null)}function uoe(e){var t={};if(e.inner){if(e.inner.length===0)return Xl(t,e.path,e.message);for(var o=e.inner,n=Array.isArray(o),r=0,o=n?o:o[Symbol.iterator]();;){var s;if(n){if(r>=o.length)break;s=o[r++]}else{if(r=o.next(),r.done)break;s=r.value}var a=s;rs(t,a.path)||(t=Xl(t,a.path,a.message))}}return t}function doe(e,t,n,r){n===void 0&&(n=!1);var o=sx(e);return t[n?"validateSync":"validate"](o,{abortEarly:!1,context:r||o})}function sx(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||dS(o)?sx(o):o!==""?o:void 0}):dS(e[r])?t[r]=sx(e[r]):t[r]=e[r]!==""?e[r]:void 0}return t}function foe(e,t,n){var r=e.slice();return t.forEach(function(s,a){if(typeof r[a]>"u"){var l=n.clone!==!1,u=l&&n.isMergeableObject(s);r[a]=u?rx(Array.isArray(s)?[]:{},s,n):s}else n.isMergeableObject(s)?r[a]=rx(e[a],s,n):e.indexOf(s)===-1&&r.push(s)}),r}function poe(e){return Array.from(e).filter(function(t){return t.selected}).map(function(t){return t.value})}function hoe(e,t,n){if(typeof e=="boolean")return!!t;var r=[],o=!1,s=-1;if(Array.isArray(e))r=e,s=e.indexOf(n),o=s>=0;else if(!n||n=="true"||n=="false")return!!t;return t&&n&&!o?r.concat(n):o?r.slice(0,s).concat(r.slice(s+1)):r}var moe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?h.useLayoutEffect:h.useEffect;function _s(e){var t=h.useRef(e);return moe(function(){t.current=e}),h.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 vr(e){var t=e.validate,n=e.name,r=e.render,o=e.children,s=e.as,a=e.component,l=Zc(e,["validate","name","render","children","as","component"]),u=c8(),f=Zc(u,["validate","validationSchema"]),p=f.registerField,m=f.unregisterField;h.useEffect(function(){return p(n,{validate:t}),function(){m(n)}},[p,m,n,t]);var v=f.getFieldProps(gr({name:n},l)),y=f.getFieldMeta(n),S={field:v,form:f};if(r)return r(gr({},S,{meta:y}));if(ss(o))return o(gr({},S,{meta:y}));if(a){if(typeof a=="string"){var x=l.innerRef,w=Zc(l,["innerRef"]);return h.createElement(a,gr({ref:x},v,w),o)}return h.createElement(a,gr({field:v,form:f},l),o)}var _=s||"input";if(typeof _=="string"){var k=l.innerRef,P=Zc(l,["innerRef"]);return h.createElement(_,gr({ref:k},v,P),o)}return h.createElement(_,gr({},v,l),o)}var goe=h.forwardRef(function(e,t){var n=e.action,r=Zc(e,["action"]),o=n??"#",s=c8(),a=s.handleReset,l=s.handleSubmit;return h.createElement("form",gr({onSubmit:l,ref:t,onReset:a,action:o},r))});goe.displayName="Form";const voe=Be((e,t)=>{const{t:n}=Ce(),{acceptButtonText:r=n("common.accept"),acceptCallback:o,cancelButtonText:s=n("common.cancel"),cancelCallback:a,children:l,title:u,triggerComponent:f}=e,{isOpen:p,onOpen:m,onClose:v}=us(),y=h.useRef(null),S=()=>{o(),v()},x=()=>{a&&a(),v()};return i.jsxs(i.Fragment,{children:[h.cloneElement(f,{onClick:m,ref:t}),i.jsx(Ng,{isOpen:p,leastDestructiveRef:y,onClose:v,isCentered:!0,children:i.jsx(ya,{children:i.jsxs(zg,{children:[i.jsx(va,{fontSize:"lg",fontWeight:"bold",children:u}),i.jsx(xa,{children:l}),i.jsxs(ga,{children:[i.jsx(fn,{ref:y,onClick:x,children:s}),i.jsx(fn,{colorScheme:"error",onClick:S,ml:3,children:r})]})]})})})]})}),a2=h.memo(voe);function yoe(e){const{model:t}=e,r=q(S=>S.system.model_list)[t],o=ue(),{t:s}=Ce(),a=q(S=>S.system.isProcessing),l=q(S=>S.system.isConnected),[u,f]=h.useState("same"),[p,m]=h.useState("");h.useEffect(()=>{f("same")},[t]);const v=()=>{f("same")},y=()=>{const S={model_name:t,save_location:u,custom_location:u==="custom"&&p!==""?p:null};o(convertToDiffusers(S))};return i.jsxs(a2,{title:`${s("modelManager.convert")} ${t}`,acceptCallback:y,cancelCallback:v,acceptButtonText:`${s("modelManager.convert")}`,triggerComponent:i.jsxs(fn,{size:"sm","aria-label":s("modelManager.convertToDiffusers"),isDisabled:r.status==="active"||a||!l,className:" modal-close-btn",marginInlineEnd:8,children:["🧨 ",s("modelManager.convertToDiffusers")]}),motionPreset:"slideInBottom",children:[i.jsxs(K,{flexDirection:"column",rowGap:4,children:[i.jsx(lt,{children:s("modelManager.convertToDiffusersHelpText1")}),i.jsxs(Tg,{children:[i.jsx(is,{children:s("modelManager.convertToDiffusersHelpText2")}),i.jsx(is,{children:s("modelManager.convertToDiffusersHelpText3")}),i.jsx(is,{children:s("modelManager.convertToDiffusersHelpText4")}),i.jsx(is,{children:s("modelManager.convertToDiffusersHelpText5")})]}),i.jsx(lt,{children:s("modelManager.convertToDiffusersHelpText6")})]}),i.jsxs(K,{flexDir:"column",gap:4,children:[i.jsxs(K,{marginTop:4,flexDir:"column",gap:2,children:[i.jsx(lt,{fontWeight:"600",children:s("modelManager.convertToDiffusersSaveLocation")}),i.jsx(Xd,{value:u,onChange:S=>f(S),children:i.jsxs(K,{gap:4,children:[i.jsx(Mo,{value:"same",children:i.jsx(er,{label:"Save converted model in the same folder",children:s("modelManager.sameFolder")})}),i.jsx(Mo,{value:"root",children:i.jsx(er,{label:"Save converted model in the InvokeAI root folder",children:s("modelManager.invokeRoot")})}),i.jsx(Mo,{value:"custom",children:i.jsx(er,{label:"Save converted model in a custom folder",children:s("modelManager.custom")})})]})})]}),u==="custom"&&i.jsxs(K,{flexDirection:"column",rowGap:2,children:[i.jsx(lt,{fontWeight:"500",fontSize:"sm",variant:"subtext",children:s("modelManager.customSaveLocation")}),i.jsx(lr,{value:p,onChange:S=>{S.target.value!==""&&m(S.target.value)},width:"full"})]})]})]})}function Js(e){const{children:t,...n}=e;return i.jsx(To,{margin:0,color:"base.400",...n,children:t})}function ea(e){const{children:t,...n}=e;return i.jsx(Ro,{color:"error.400",...n,children:t})}const Qf=Oe.form,xoe=Te([pr],e=>{const{openModel:t,model_list:n}=e;return{model_list:n,openModel:t}},{memoizeOptions:{resultEqualityCheck:Ut}}),s3=64,a3=2048;function boe(){const{openModel:e,model_list:t}=q(xoe),n=q(u=>u.system.isProcessing),r=ue(),{t:o}=Ce(),[s,a]=h.useState({name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,default:!1,format:"ckpt"});h.useEffect(()=>{var u,f,p,m,v,y,S;if(e){const x=y5(t,(w,_)=>Ut(_,e));a({name:e,description:(u=x[e])==null?void 0:u.description,config:(f=x[e])==null?void 0:f.config,weights:(p=x[e])==null?void 0:p.weights,vae:(m=x[e])==null?void 0:m.vae,width:(v=x[e])==null?void 0:v.width,height:(y=x[e])==null?void 0:y.height,default:(S=x[e])==null?void 0:S.default,format:"ckpt"})}},[t,e]);const l=u=>{r(addNewModel({...u,width:Number(u.width),height:Number(u.height)}))};return e?i.jsxs(K,{flexDirection:"column",rowGap:4,width:"100%",children:[i.jsxs(K,{alignItems:"center",gap:4,justifyContent:"space-between",children:[i.jsx(lt,{fontSize:"lg",fontWeight:"bold",children:e}),i.jsx(yoe,{model:e})]}),i.jsx(K,{flexDirection:"column",maxHeight:window.innerHeight-270,overflowY:"scroll",paddingInlineEnd:8,children:i.jsx(Zf,{enableReinitialize:!0,initialValues:s,onSubmit:l,children:({handleSubmit:u,errors:f,touched:p})=>i.jsx(Qf,{onSubmit:u,children:i.jsxs(Nn,{rowGap:2,alignItems:"start",children:[i.jsxs(_n,{isInvalid:!!f.description&&p.description,isRequired:!0,children:[i.jsx(jn,{htmlFor:"description",fontSize:"sm",children:o("modelManager.description")}),i.jsxs(Nn,{alignItems:"start",children:[i.jsx(vr,{as:lr,id:"description",name:"description",type:"text",width:"full"}),f.description&&p.description?i.jsx(ea,{children:f.description}):i.jsx(Js,{children:o("modelManager.descriptionValidationMsg")})]})]}),i.jsxs(_n,{isInvalid:!!f.config&&p.config,isRequired:!0,children:[i.jsx(jn,{htmlFor:"config",fontSize:"sm",children:o("modelManager.config")}),i.jsxs(Nn,{alignItems:"start",children:[i.jsx(vr,{as:lr,id:"config",name:"config",type:"text",width:"full"}),f.config&&p.config?i.jsx(ea,{children:f.config}):i.jsx(Js,{children:o("modelManager.configValidationMsg")})]})]}),i.jsxs(_n,{isInvalid:!!f.weights&&p.weights,isRequired:!0,children:[i.jsx(jn,{htmlFor:"config",fontSize:"sm",children:o("modelManager.modelLocation")}),i.jsxs(Nn,{alignItems:"start",children:[i.jsx(vr,{as:lr,id:"weights",name:"weights",type:"text",width:"full"}),f.weights&&p.weights?i.jsx(ea,{children:f.weights}):i.jsx(Js,{children:o("modelManager.modelLocationValidationMsg")})]})]}),i.jsxs(_n,{isInvalid:!!f.vae&&p.vae,children:[i.jsx(jn,{htmlFor:"vae",fontSize:"sm",children:o("modelManager.vaeLocation")}),i.jsxs(Nn,{alignItems:"start",children:[i.jsx(vr,{as:lr,id:"vae",name:"vae",type:"text",width:"full"}),f.vae&&p.vae?i.jsx(ea,{children:f.vae}):i.jsx(Js,{children:o("modelManager.vaeLocationValidationMsg")})]})]}),i.jsxs(aa,{width:"100%",children:[i.jsxs(_n,{isInvalid:!!f.width&&p.width,children:[i.jsx(jn,{htmlFor:"width",fontSize:"sm",children:o("modelManager.width")}),i.jsxs(Nn,{alignItems:"start",children:[i.jsx(vr,{id:"width",name:"width",children:({field:m,form:v})=>i.jsx(cl,{id:"width",name:"width",min:s3,max:a3,step:64,value:v.values.width,onChange:y=>v.setFieldValue(m.name,Number(y))})}),f.width&&p.width?i.jsx(ea,{children:f.width}):i.jsx(Js,{children:o("modelManager.widthValidationMsg")})]})]}),i.jsxs(_n,{isInvalid:!!f.height&&p.height,children:[i.jsx(jn,{htmlFor:"height",fontSize:"sm",children:o("modelManager.height")}),i.jsxs(Nn,{alignItems:"start",children:[i.jsx(vr,{id:"height",name:"height",children:({field:m,form:v})=>i.jsx(cl,{id:"height",name:"height",min:s3,max:a3,step:64,value:v.values.height,onChange:y=>v.setFieldValue(m.name,Number(y))})}),f.height&&p.height?i.jsx(ea,{children:f.height}):i.jsx(Js,{children:o("modelManager.heightValidationMsg")})]})]})]}),i.jsx(fn,{type:"submit",className:"modal-close-btn",isLoading:n,children:o("modelManager.updateModel")})]})})})})]}):i.jsx(K,{sx:{width:"100%",justifyContent:"center",alignItems:"center",borderRadius:"base",bg:"base.900"},children:i.jsx(lt,{fontWeight:500,children:"Pick A Model To Edit"})})}const woe=Te([pr],e=>{const{openModel:t,model_list:n}=e;return{model_list:n,openModel:t}},{memoizeOptions:{resultEqualityCheck:Ut}});function Soe(){const{openModel:e,model_list:t}=q(woe),n=q(u=>u.system.isProcessing),r=ue(),{t:o}=Ce(),[s,a]=h.useState({name:"",description:"",repo_id:"",path:"",vae:{repo_id:"",path:""},default:!1,format:"diffusers"});h.useEffect(()=>{var u,f,p,m,v,y,S,x,w,_,k,P,I,j,E,T;if(e){const R=y5(t,(M,D)=>Ut(D,e));a({name:e,description:(u=R[e])==null?void 0:u.description,path:(f=R[e])!=null&&f.path&&((p=R[e])==null?void 0:p.path)!=="None"?(m=R[e])==null?void 0:m.path:"",repo_id:(v=R[e])!=null&&v.repo_id&&((y=R[e])==null?void 0:y.repo_id)!=="None"?(S=R[e])==null?void 0:S.repo_id:"",vae:{repo_id:(w=(x=R[e])==null?void 0:x.vae)!=null&&w.repo_id?(k=(_=R[e])==null?void 0:_.vae)==null?void 0:k.repo_id:"",path:(I=(P=R[e])==null?void 0:P.vae)!=null&&I.path?(E=(j=R[e])==null?void 0:j.vae)==null?void 0:E.path:""},default:(T=R[e])==null?void 0:T.default,format:"diffusers"})}},[t,e]);const l=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,r(addNewModel(u))};return e?i.jsxs(K,{flexDirection:"column",rowGap:4,width:"100%",children:[i.jsx(K,{alignItems:"center",children:i.jsx(lt,{fontSize:"lg",fontWeight:"bold",children:e})}),i.jsx(K,{flexDirection:"column",overflowY:"scroll",paddingInlineEnd:8,children:i.jsx(Zf,{enableReinitialize:!0,initialValues:s,onSubmit:l,children:({handleSubmit:u,errors:f,touched:p})=>{var m,v,y,S,x,w,_,k,P,I;return i.jsx(Qf,{onSubmit:u,children:i.jsxs(Nn,{rowGap:2,alignItems:"start",children:[i.jsxs(_n,{isInvalid:!!f.description&&p.description,isRequired:!0,children:[i.jsx(jn,{htmlFor:"description",fontSize:"sm",children:o("modelManager.description")}),i.jsxs(Nn,{alignItems:"start",children:[i.jsx(vr,{as:lr,id:"description",name:"description",type:"text",width:"full"}),f.description&&p.description?i.jsx(ea,{children:f.description}):i.jsx(Js,{children:o("modelManager.descriptionValidationMsg")})]})]}),i.jsxs(_n,{isInvalid:!!f.path&&p.path,isRequired:!0,children:[i.jsx(jn,{htmlFor:"path",fontSize:"sm",children:o("modelManager.modelLocation")}),i.jsxs(Nn,{alignItems:"start",children:[i.jsx(vr,{as:lr,id:"path",name:"path",type:"text",width:"full"}),f.path&&p.path?i.jsx(ea,{children:f.path}):i.jsx(Js,{children:o("modelManager.modelLocationValidationMsg")})]})]}),i.jsxs(_n,{isInvalid:!!f.repo_id&&p.repo_id,children:[i.jsx(jn,{htmlFor:"repo_id",fontSize:"sm",children:o("modelManager.repo_id")}),i.jsxs(Nn,{alignItems:"start",children:[i.jsx(vr,{as:lr,id:"repo_id",name:"repo_id",type:"text",width:"full"}),f.repo_id&&p.repo_id?i.jsx(ea,{children:f.repo_id}):i.jsx(Js,{children:o("modelManager.repoIDValidationMsg")})]})]}),i.jsxs(_n,{isInvalid:!!((m=f.vae)!=null&&m.path)&&((v=p.vae)==null?void 0:v.path),children:[i.jsx(jn,{htmlFor:"vae.path",fontSize:"sm",children:o("modelManager.vaeLocation")}),i.jsxs(Nn,{alignItems:"start",children:[i.jsx(vr,{as:lr,id:"vae.path",name:"vae.path",type:"text",width:"full"}),(y=f.vae)!=null&&y.path&&((S=p.vae)!=null&&S.path)?i.jsx(ea,{children:(x=f.vae)==null?void 0:x.path}):i.jsx(Js,{children:o("modelManager.vaeLocationValidationMsg")})]})]}),i.jsxs(_n,{isInvalid:!!((w=f.vae)!=null&&w.repo_id)&&((_=p.vae)==null?void 0:_.repo_id),children:[i.jsx(jn,{htmlFor:"vae.repo_id",fontSize:"sm",children:o("modelManager.vaeRepoID")}),i.jsxs(Nn,{alignItems:"start",children:[i.jsx(vr,{as:lr,id:"vae.repo_id",name:"vae.repo_id",type:"text",width:"full"}),(k=f.vae)!=null&&k.repo_id&&((P=p.vae)!=null&&P.repo_id)?i.jsx(ea,{children:(I=f.vae)==null?void 0:I.repo_id}):i.jsx(Js,{children:o("modelManager.vaeRepoIDValidationMsg")})]})]}),i.jsx(fn,{type:"submit",className:"modal-close-btn",isLoading:n,children:o("modelManager.updateModel")})]})})}})})]}):i.jsx(K,{sx:{width:"100%",justifyContent:"center",alignItems:"center",borderRadius:"base",bg:"base.900"},children:i.jsx(lt,{fontWeight:"500",children:"Pick A Model To Edit"})})}const d8=Te([pr],e=>{const{model_list:t}=e,n=[];return _x(t,r=>{n.push(r.weights)}),n});function i3({model:e,modelsToAdd:t,setModelsToAdd:n}){const{t:r}=Ce(),o=q(d8),s=a=>{t.includes(a.target.value)?n(dD(t,l=>l!==a.target.value)):n([...t,a.target.value])};return i.jsxs(K,{flexDirection:"column",gap:2,backgroundColor:t.includes(e.name)?"accent.650":"base.800",paddingX:4,paddingY:2,borderRadius:4,children:[i.jsxs(K,{gap:4,alignItems:"center",justifyContent:"space-between",children:[i.jsx(qn,{value:e.name,label:i.jsx(lt,{fontWeight:500,children:e.name}),isChecked:t.includes(e.name),isDisabled:o.includes(e.location),onChange:s}),o.includes(e.location)&&i.jsx(mu,{colorScheme:"accent",children:r("modelManager.modelExists")})]}),i.jsx(lt,{fontStyle:"italic",variant:"subtext",children:e.location})]})}function Coe(){const e=ue(),{t}=Ce(),n=q(P=>P.system.searchFolder),r=q(P=>P.system.foundModels),o=q(d8),s=q(P=>P.ui.shouldShowExistingModelsInSearch),a=q(P=>P.system.isProcessing),[l,u]=B.useState([]),[f,p]=B.useState("v1"),[m,v]=B.useState(""),y=()=>{e(YM(null)),e(KM(null)),u([])},S=P=>{e(searchForModels(P.checkpointFolder))},x=()=>{u([]),r&&r.forEach(P=>{o.includes(P.location)||u(I=>[...I,P.name])})},w=()=>{u([])},_=()=>{const P=r==null?void 0:r.filter(j=>l.includes(j.name)),I={v1:"configs/stable-diffusion/v1-inference.yaml",v2_base:"configs/stable-diffusion/v2-inference-v.yaml",v2_768:"configs/stable-diffusion/v2-inference-v.yaml",inpainting:"configs/stable-diffusion/v1-inpainting-inference.yaml",custom:m};P==null||P.forEach(j=>{const E={name:j.name,description:"",config:I[f],weights:j.location,vae:"",width:512,height:512,default:!1,format:"ckpt"};e(addNewModel(E))}),u([])},k=()=>{const P=[],I=[];return r&&r.forEach((j,E)=>{o.includes(j.location)?I.push(i.jsx(i3,{model:j,modelsToAdd:l,setModelsToAdd:u},E)):P.push(i.jsx(i3,{model:j,modelsToAdd:l,setModelsToAdd:u},E))}),i.jsxs(K,{flexDirection:"column",rowGap:4,children:[P,s&&I]})};return i.jsxs(i.Fragment,{children:[n?i.jsxs(K,{sx:{padding:4,gap:2,position:"relative",borderRadius:"base",alignItems:"center",w:"full",bg:"base.900"},children:[i.jsxs(K,{sx:{flexDir:"column",gap:2},children:[i.jsx(lt,{sx:{fontWeight:500},variant:"subtext",children:t("modelManager.checkpointFolder")}),i.jsx(lt,{sx:{fontWeight:500},children:n})]}),i.jsx(ul,{}),i.jsx(Me,{"aria-label":t("modelManager.scanAgain"),tooltip:t("modelManager.scanAgain"),icon:i.jsx(f4,{}),fontSize:18,disabled:a,onClick:()=>e(searchForModels(n))}),i.jsx(Me,{"aria-label":t("modelManager.clearCheckpointFolder"),tooltip:t("modelManager.clearCheckpointFolder"),icon:i.jsx(Ls,{}),onClick:y})]}):i.jsx(Zf,{initialValues:{checkpointFolder:""},onSubmit:P=>{S(P)},children:({handleSubmit:P})=>i.jsx(Qf,{onSubmit:P,width:"100%",children:i.jsxs(aa,{columnGap:2,alignItems:"flex-end",children:[i.jsx(_n,{flexGrow:1,children:i.jsx(vr,{as:lr,id:"checkpointFolder",name:"checkpointFolder",type:"text",size:"md",label:t("modelManager.checkpointFolder")})}),i.jsx(fn,{leftIcon:i.jsx(f4,{}),"aria-label":t("modelManager.findModels"),tooltip:t("modelManager.findModels"),type:"submit",disabled:a,px:8,children:t("modelManager.findModels")})]})})}),r&&i.jsxs(K,{flexDirection:"column",rowGap:4,width:"full",children:[i.jsxs(K,{justifyContent:"space-between",alignItems:"center",children:[i.jsxs("p",{children:[t("modelManager.modelsFound"),": ",r.length]}),i.jsxs("p",{children:[t("modelManager.selected"),": ",l.length]})]}),i.jsxs(K,{columnGap:2,justifyContent:"space-between",children:[i.jsxs(K,{columnGap:2,children:[i.jsx(fn,{isDisabled:l.length===r.length,onClick:x,children:t("modelManager.selectAll")}),i.jsx(fn,{isDisabled:l.length===0,onClick:w,children:t("modelManager.deselectAll")}),i.jsx(qn,{label:t("modelManager.showExisting"),isChecked:s,onChange:()=>e(qM(!s))})]}),i.jsx(fn,{isDisabled:l.length===0,onClick:_,colorScheme:"accent",children:t("modelManager.addSelected")})]}),i.jsxs(K,{sx:{flexDirection:"column",padding:4,rowGap:4,borderRadius:"base",width:"full",bg:"base.900"},children:[i.jsxs(K,{gap:4,children:[i.jsx(lt,{fontWeight:500,variant:"subtext",children:t("modelManager.pickModelType")}),i.jsx(Xd,{value:f,onChange:P=>p(P),defaultValue:"v1",name:"model_type",children:i.jsxs(K,{gap:4,children:[i.jsx(Mo,{value:"v1",children:i.jsx(lt,{fontSize:"sm",children:t("modelManager.v1")})}),i.jsx(Mo,{value:"v2_base",children:i.jsx(lt,{fontSize:"sm",children:t("modelManager.v2_base")})}),i.jsx(Mo,{value:"v2_768",children:i.jsx(lt,{fontSize:"sm",children:t("modelManager.v2_768")})}),i.jsx(Mo,{value:"inpainting",children:i.jsx(lt,{fontSize:"sm",children:t("modelManager.inpainting")})}),i.jsx(Mo,{value:"custom",children:i.jsx(lt,{fontSize:"sm",children:t("modelManager.customConfig")})})]})})]}),f==="custom"&&i.jsxs(K,{flexDirection:"column",rowGap:2,children:[i.jsx(lt,{fontWeight:"500",fontSize:"sm",variant:"subtext",children:t("modelManager.pathToCustomConfig")}),i.jsx(lr,{value:m,onChange:P=>{P.target.value!==""&&v(P.target.value)},width:"full"})]})]}),i.jsx(K,{flexDirection:"column",maxHeight:72,overflowY:"scroll",borderRadius:"sm",gap:2,children:r.length>0?k():i.jsx(lt,{fontWeight:"500",padding:2,borderRadius:"sm",textAlign:"center",variant:"subtext",children:t("modelManager.noModelsFound")})})]})]})}function Qs({children:e}){return i.jsx(K,{sx:{flexDirection:"column",padding:4,rowGap:4,borderRadius:"base",width:"full",bg:"base.900"},children:e})}const l3=64,c3=2048;function _oe(){const e=ue(),{t}=Ce(),n=q(f=>f.system.isProcessing);function r(f){return/\s/.test(f)}function o(f){let p;return r(f)&&(p=t("modelManager.cannotUseSpaces")),p}const s={name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,format:"ckpt",default:!1},a=f=>{e(addNewModel(f)),e(qc(null))},[l,u]=B.useState(!1);return i.jsxs(Nn,{gap:2,alignItems:"flex-start",children:[i.jsxs(K,{columnGap:4,children:[i.jsx(qn,{isChecked:!l,label:t("modelManager.scanForModels"),onChange:()=>u(!l)}),i.jsx(qn,{label:t("modelManager.addManually"),isChecked:l,onChange:()=>u(!l)})]}),l?i.jsx(Zf,{initialValues:s,onSubmit:a,children:({handleSubmit:f,errors:p,touched:m})=>i.jsx(Qf,{onSubmit:f,sx:{w:"full"},children:i.jsxs(Nn,{rowGap:2,children:[i.jsx(lt,{fontSize:20,fontWeight:"bold",alignSelf:"start",children:t("modelManager.manual")}),i.jsx(Qs,{children:i.jsxs(_n,{isInvalid:!!p.name&&m.name,isRequired:!0,children:[i.jsx(jn,{htmlFor:"name",fontSize:"sm",children:t("modelManager.name")}),i.jsxs(Nn,{alignItems:"start",children:[i.jsx(vr,{as:lr,id:"name",name:"name",type:"text",validate:o,width:"full"}),p.name&&m.name?i.jsx(Ro,{children:p.name}):i.jsx(To,{margin:0,children:t("modelManager.nameValidationMsg")})]})]})}),i.jsx(Qs,{children:i.jsxs(_n,{isInvalid:!!p.description&&m.description,isRequired:!0,children:[i.jsx(jn,{htmlFor:"description",fontSize:"sm",children:t("modelManager.description")}),i.jsxs(Nn,{alignItems:"start",children:[i.jsx(vr,{as:lr,id:"description",name:"description",type:"text",width:"full"}),p.description&&m.description?i.jsx(Ro,{children:p.description}):i.jsx(To,{margin:0,children:t("modelManager.descriptionValidationMsg")})]})]})}),i.jsx(Qs,{children:i.jsxs(_n,{isInvalid:!!p.config&&m.config,isRequired:!0,children:[i.jsx(jn,{htmlFor:"config",fontSize:"sm",children:t("modelManager.config")}),i.jsxs(Nn,{alignItems:"start",children:[i.jsx(vr,{as:lr,id:"config",name:"config",type:"text",width:"full"}),p.config&&m.config?i.jsx(Ro,{children:p.config}):i.jsx(To,{margin:0,children:t("modelManager.configValidationMsg")})]})]})}),i.jsx(Qs,{children:i.jsxs(_n,{isInvalid:!!p.weights&&m.weights,isRequired:!0,children:[i.jsx(jn,{htmlFor:"config",fontSize:"sm",children:t("modelManager.modelLocation")}),i.jsxs(Nn,{alignItems:"start",children:[i.jsx(vr,{as:lr,id:"weights",name:"weights",type:"text",width:"full"}),p.weights&&m.weights?i.jsx(Ro,{children:p.weights}):i.jsx(To,{margin:0,children:t("modelManager.modelLocationValidationMsg")})]})]})}),i.jsx(Qs,{children:i.jsxs(_n,{isInvalid:!!p.vae&&m.vae,children:[i.jsx(jn,{htmlFor:"vae",fontSize:"sm",children:t("modelManager.vaeLocation")}),i.jsxs(Nn,{alignItems:"start",children:[i.jsx(vr,{as:lr,id:"vae",name:"vae",type:"text",width:"full"}),p.vae&&m.vae?i.jsx(Ro,{children:p.vae}):i.jsx(To,{margin:0,children:t("modelManager.vaeLocationValidationMsg")})]})]})}),i.jsxs(aa,{width:"100%",children:[i.jsx(Qs,{children:i.jsxs(_n,{isInvalid:!!p.width&&m.width,children:[i.jsx(jn,{htmlFor:"width",fontSize:"sm",children:t("modelManager.width")}),i.jsxs(Nn,{alignItems:"start",children:[i.jsx(vr,{id:"width",name:"width",children:({field:v,form:y})=>i.jsx(cl,{id:"width",name:"width",min:l3,max:c3,step:64,value:y.values.width,onChange:S=>y.setFieldValue(v.name,Number(S))})}),p.width&&m.width?i.jsx(Ro,{children:p.width}):i.jsx(To,{margin:0,children:t("modelManager.widthValidationMsg")})]})]})}),i.jsx(Qs,{children:i.jsxs(_n,{isInvalid:!!p.height&&m.height,children:[i.jsx(jn,{htmlFor:"height",fontSize:"sm",children:t("modelManager.height")}),i.jsxs(Nn,{alignItems:"start",children:[i.jsx(vr,{id:"height",name:"height",children:({field:v,form:y})=>i.jsx(cl,{id:"height",name:"height",min:l3,max:c3,step:64,value:y.values.height,onChange:S=>y.setFieldValue(v.name,Number(S))})}),p.height&&m.height?i.jsx(Ro,{children:p.height}):i.jsx(To,{margin:0,children:t("modelManager.heightValidationMsg")})]})]})})]}),i.jsx(fn,{type:"submit",className:"modal-close-btn",isLoading:n,children:t("modelManager.addModel")})]})})}):i.jsx(Coe,{})]})}function koe(){const e=ue(),{t}=Ce(),n=q(l=>l.system.isProcessing);function r(l){return/\s/.test(l)}function o(l){let u;return r(l)&&(u=t("modelManager.cannotUseSpaces")),u}const s={name:"",description:"",repo_id:"",path:"",format:"diffusers",default:!1,vae:{repo_id:"",path:""}},a=l=>{const u=l;l.path===""&&delete u.path,l.repo_id===""&&delete u.repo_id,l.vae.path===""&&delete u.vae.path,l.vae.repo_id===""&&delete u.vae.repo_id,e(addNewModel(u)),e(qc(null))};return i.jsx(K,{children:i.jsx(Zf,{initialValues:s,onSubmit:a,children:({handleSubmit:l,errors:u,touched:f})=>{var p,m,v,y,S,x,w,_,k,P;return i.jsx(Qf,{onSubmit:l,children:i.jsxs(Nn,{rowGap:2,children:[i.jsx(Qs,{children:i.jsxs(_n,{isInvalid:!!u.name&&f.name,isRequired:!0,children:[i.jsx(jn,{htmlFor:"name",fontSize:"sm",children:t("modelManager.name")}),i.jsxs(Nn,{alignItems:"start",children:[i.jsx(vr,{as:lr,id:"name",name:"name",type:"text",validate:o,width:"2xl",isRequired:!0}),u.name&&f.name?i.jsx(Ro,{children:u.name}):i.jsx(To,{margin:0,children:t("modelManager.nameValidationMsg")})]})]})}),i.jsx(Qs,{children:i.jsxs(_n,{isInvalid:!!u.description&&f.description,isRequired:!0,children:[i.jsx(jn,{htmlFor:"description",fontSize:"sm",children:t("modelManager.description")}),i.jsxs(Nn,{alignItems:"start",children:[i.jsx(vr,{as:lr,id:"description",name:"description",type:"text",width:"2xl",isRequired:!0}),u.description&&f.description?i.jsx(Ro,{children:u.description}):i.jsx(To,{margin:0,children:t("modelManager.descriptionValidationMsg")})]})]})}),i.jsxs(Qs,{children:[i.jsx(lt,{fontWeight:"bold",fontSize:"sm",children:t("modelManager.formMessageDiffusersModelLocation")}),i.jsx(lt,{sx:{fontSize:"sm",fontStyle:"italic"},variant:"subtext",children:t("modelManager.formMessageDiffusersModelLocationDesc")}),i.jsxs(_n,{isInvalid:!!u.path&&f.path,children:[i.jsx(jn,{htmlFor:"path",fontSize:"sm",children:t("modelManager.modelLocation")}),i.jsxs(Nn,{alignItems:"start",children:[i.jsx(vr,{as:lr,id:"path",name:"path",type:"text",width:"2xl"}),u.path&&f.path?i.jsx(Ro,{children:u.path}):i.jsx(To,{margin:0,children:t("modelManager.modelLocationValidationMsg")})]})]}),i.jsxs(_n,{isInvalid:!!u.repo_id&&f.repo_id,children:[i.jsx(jn,{htmlFor:"repo_id",fontSize:"sm",children:t("modelManager.repo_id")}),i.jsxs(Nn,{alignItems:"start",children:[i.jsx(vr,{as:lr,id:"repo_id",name:"repo_id",type:"text",width:"2xl"}),u.repo_id&&f.repo_id?i.jsx(Ro,{children:u.repo_id}):i.jsx(To,{margin:0,children:t("modelManager.repoIDValidationMsg")})]})]})]}),i.jsxs(Qs,{children:[i.jsx(lt,{fontWeight:"bold",children:t("modelManager.formMessageDiffusersVAELocation")}),i.jsx(lt,{sx:{fontSize:"sm",fontStyle:"italic"},variant:"subtext",children:t("modelManager.formMessageDiffusersVAELocationDesc")}),i.jsxs(_n,{isInvalid:!!((p=u.vae)!=null&&p.path)&&((m=f.vae)==null?void 0:m.path),children:[i.jsx(jn,{htmlFor:"vae.path",fontSize:"sm",children:t("modelManager.vaeLocation")}),i.jsxs(Nn,{alignItems:"start",children:[i.jsx(vr,{as:lr,id:"vae.path",name:"vae.path",type:"text",width:"2xl"}),(v=u.vae)!=null&&v.path&&((y=f.vae)!=null&&y.path)?i.jsx(Ro,{children:(S=u.vae)==null?void 0:S.path}):i.jsx(To,{margin:0,children:t("modelManager.vaeLocationValidationMsg")})]})]}),i.jsxs(_n,{isInvalid:!!((x=u.vae)!=null&&x.repo_id)&&((w=f.vae)==null?void 0:w.repo_id),children:[i.jsx(jn,{htmlFor:"vae.repo_id",fontSize:"sm",children:t("modelManager.vaeRepoID")}),i.jsxs(Nn,{alignItems:"start",children:[i.jsx(vr,{as:lr,id:"vae.repo_id",name:"vae.repo_id",type:"text",width:"2xl"}),(_=u.vae)!=null&&_.repo_id&&((k=f.vae)!=null&&k.repo_id)?i.jsx(Ro,{children:(P=u.vae)==null?void 0:P.repo_id}):i.jsx(To,{margin:0,children:t("modelManager.vaeRepoIDValidationMsg")})]})]})]}),i.jsx(fn,{type:"submit",isLoading:n,children:t("modelManager.addModel")})]})})}})})}function u3({text:e,onClick:t}){return i.jsx(K,{position:"relative",width:"50%",height:40,justifyContent:"center",alignItems:"center",onClick:t,as:$u,children:i.jsx(lt,{fontWeight:"bold",children:e})})}function Poe(){const{isOpen:e,onOpen:t,onClose:n}=us(),r=q(l=>l.ui.addNewModelUIOption),o=ue(),{t:s}=Ce(),a=()=>{n(),o(qc(null))};return i.jsxs(i.Fragment,{children:[i.jsx(fn,{"aria-label":s("modelManager.addNewModel"),tooltip:s("modelManager.addNewModel"),onClick:t,size:"sm",children:i.jsxs(K,{columnGap:2,alignItems:"center",children:[i.jsx(Wf,{}),s("modelManager.addNew")]})}),i.jsxs(tl,{isOpen:e,onClose:a,size:"3xl",closeOnOverlayClick:!1,children:[i.jsx(ya,{}),i.jsxs(nl,{margin:"auto",children:[i.jsxs(va,{children:[s("modelManager.addNewModel")," "]}),r!==null&&i.jsx(Me,{"aria-label":s("common.back"),tooltip:s("common.back"),onClick:()=>o(qc(null)),position:"absolute",variant:"ghost",zIndex:1,size:"sm",insetInlineEnd:12,top:2,icon:i.jsx(SI,{})}),i.jsx(Vu,{}),i.jsxs(xa,{children:[r==null&&i.jsxs(K,{columnGap:4,children:[i.jsx(u3,{text:s("modelManager.addCheckpointModel"),onClick:()=>o(qc("ckpt"))}),i.jsx(u3,{text:s("modelManager.addDiffuserModel"),onClick:()=>o(qc("diffusers"))})]}),r=="ckpt"&&i.jsx(_oe,{}),r=="diffusers"&&i.jsx(koe,{})]}),i.jsx(ga,{})]})]})]})}function Sh(e){const{isProcessing:t,isConnected:n}=q(y=>y.system),r=q(y=>y.system.openModel),{t:o}=Ce(),s=ue(),{name:a,status:l,description:u}=e,f=()=>{s(requestModelChange(a))},p=()=>{s(fS(a))},m=()=>{s(deleteModel(a)),s(fS(null))},v=()=>{switch(l){case"active":return"ok.500";case"cached":return"warning.500";case"not loaded":return"inherit"}};return i.jsxs(K,{alignItems:"center",p:2,borderRadius:"base",sx:a===r?{bg:"accent.750",_hover:{bg:"accent.750"}}:{_hover:{bg:"base.750"}},children:[i.jsx(et,{onClick:p,cursor:"pointer",children:i.jsx(er,{label:u,hasArrow:!0,placement:"bottom",children:i.jsx(lt,{fontWeight:"600",children:a})})}),i.jsx(ul,{onClick:p,cursor:"pointer"}),i.jsxs(K,{gap:2,alignItems:"center",children:[i.jsx(lt,{color:v(),children:l}),i.jsx($u,{size:"sm",onClick:f,isDisabled:l==="active"||t||!n,children:o("modelManager.load")}),i.jsx(Me,{icon:i.jsx(xU,{}),size:"sm",onClick:p,"aria-label":o("accessibility.modifyConfig"),isDisabled:l==="active"||t||!n}),i.jsx(a2,{title:o("modelManager.deleteModel"),acceptCallback:m,acceptButtonText:o("modelManager.delete"),triggerComponent:i.jsx(Me,{icon:i.jsx(wU,{}),size:"sm","aria-label":o("modelManager.deleteConfig"),isDisabled:l==="active"||t||!n,colorScheme:"error"}),children:i.jsxs(K,{rowGap:4,flexDirection:"column",children:[i.jsx("p",{style:{fontWeight:"bold"},children:o("modelManager.deleteMsg1")}),i.jsx("p",{children:o("modelManager.deleteMsg2")})]})})]})]})}function d3(e){const{children:t,value:n}=e,[r,o]=hc("colors",["base.800","base.200"]);return i.jsx("option",{value:n,style:{background:r,color:o},children:t})}const joe=e=>{const{label:t,isDisabled:n,validValues:r,tooltip:o,tooltipProps:s,horizontal:a,spaceEvenly:l,...u}=e;return i.jsxs(_n,{isDisabled:n,onClick:f=>{f.stopPropagation(),f.nativeEvent.stopImmediatePropagation(),f.nativeEvent.stopPropagation(),f.nativeEvent.cancelBubble=!0},sx:a?{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:4}:{},children:[t&&i.jsx(jn,{sx:l?{flexBasis:0,flexGrow:1}:{},children:t}),i.jsx(er,{label:o,...s,children:i.jsx(ub,{...u,rootProps:{sx:l?{flexBasis:0,flexGrow:1}:{}},children:r.map(f=>typeof f=="string"||typeof f=="number"?i.jsx(d3,{value:f,children:f},f):i.jsx(d3,{value:f.value,children:f.key},f.value))})})]})},A1=h.memo(joe);function Ioe(){const e=ue(),{isOpen:t,onOpen:n,onClose:r}=us(),o=q(XM),{t:s}=Ce(),[a,l]=h.useState(Object.keys(o)[0]),[u,f]=h.useState(Object.keys(o)[1]),[p,m]=h.useState("none"),[v,y]=h.useState(""),[S,x]=h.useState(.5),[w,_]=h.useState("weighted_sum"),[k,P]=h.useState("root"),[I,j]=h.useState(""),[E,T]=h.useState(!1),R=Object.keys(o).filter(z=>z!==u&&z!==p),M=Object.keys(o).filter(z=>z!==a&&z!==p),D=[{key:s("modelManager.none"),value:"none"},...Object.keys(o).filter(z=>z!==a&&z!==u).map(z=>({key:z,value:z}))],N=q(z=>z.system.isProcessing),U=()=>{let z=[a,u,p];z=z.filter(H=>H!=="none");const F={models_to_merge:z,merged_model_name:v!==""?v:z.join("-"),alpha:S,interp:w,model_merge_save_path:k==="root"?null:I,force:E};e(mergeDiffusersModels(F))};return i.jsxs(i.Fragment,{children:[i.jsx(fn,{onClick:n,size:"sm",children:i.jsx(K,{columnGap:2,alignItems:"center",children:s("modelManager.mergeModels")})}),i.jsxs(tl,{isOpen:t,onClose:r,size:"4xl",closeOnOverlayClick:!1,children:[i.jsx(ya,{}),i.jsxs(nl,{fontFamily:"Inter",margin:"auto",paddingInlineEnd:4,children:[i.jsx(va,{children:s("modelManager.mergeModels")}),i.jsx(Vu,{}),i.jsx(xa,{children:i.jsxs(K,{flexDirection:"column",rowGap:4,children:[i.jsxs(K,{sx:{flexDirection:"column",marginBottom:4,padding:4,borderRadius:"base",rowGap:1,bg:"base.900"},children:[i.jsx(lt,{children:s("modelManager.modelMergeHeaderHelp1")}),i.jsx(lt,{fontSize:"sm",variant:"subtext",children:s("modelManager.modelMergeHeaderHelp2")})]}),i.jsxs(K,{columnGap:4,children:[i.jsx(A1,{label:s("modelManager.modelOne"),validValues:R,onChange:z=>l(z.target.value)}),i.jsx(A1,{label:s("modelManager.modelTwo"),validValues:M,onChange:z=>f(z.target.value)}),i.jsx(A1,{label:s("modelManager.modelThree"),validValues:D,onChange:z=>{z.target.value!=="none"?(m(z.target.value),_("add_difference")):(m("none"),_("weighted_sum"))}})]}),i.jsx(lr,{label:s("modelManager.mergedModelName"),value:v,onChange:z=>y(z.target.value)}),i.jsxs(K,{sx:{flexDirection:"column",padding:4,borderRadius:"base",gap:4,bg:"base.900"},children:[i.jsx(Tt,{label:s("modelManager.alpha"),min:.01,max:.99,step:.01,value:S,onChange:z=>x(z),withInput:!0,withReset:!0,handleReset:()=>x(.5),withSliderMarks:!0}),i.jsx(lt,{variant:"subtext",fontSize:"sm",children:s("modelManager.modelMergeAlphaHelp")})]}),i.jsxs(K,{sx:{padding:4,borderRadius:"base",gap:4,bg:"base.900"},children:[i.jsx(lt,{fontWeight:500,fontSize:"sm",variant:"subtext",children:s("modelManager.interpolationType")}),i.jsx(Xd,{value:w,onChange:z=>_(z),children:i.jsx(K,{columnGap:4,children:p==="none"?i.jsxs(i.Fragment,{children:[i.jsx(Mo,{value:"weighted_sum",children:i.jsx(lt,{fontSize:"sm",children:s("modelManager.weightedSum")})}),i.jsx(Mo,{value:"sigmoid",children:i.jsx(lt,{fontSize:"sm",children:s("modelManager.sigmoid")})}),i.jsx(Mo,{value:"inv_sigmoid",children:i.jsx(lt,{fontSize:"sm",children:s("modelManager.inverseSigmoid")})})]}):i.jsx(Mo,{value:"add_difference",children:i.jsx(er,{label:s("modelManager.modelMergeInterpAddDifferenceHelp"),children:i.jsx(lt,{fontSize:"sm",children:s("modelManager.addDifference")})})})})})]}),i.jsxs(K,{sx:{flexDirection:"column",padding:4,borderRadius:"base",gap:4,bg:"base.900"},children:[i.jsxs(K,{columnGap:4,children:[i.jsx(lt,{fontWeight:"500",fontSize:"sm",variant:"subtext",children:s("modelManager.mergedModelSaveLocation")}),i.jsx(Xd,{value:k,onChange:z=>P(z),children:i.jsxs(K,{columnGap:4,children:[i.jsx(Mo,{value:"root",children:i.jsx(lt,{fontSize:"sm",children:s("modelManager.invokeAIFolder")})}),i.jsx(Mo,{value:"custom",children:i.jsx(lt,{fontSize:"sm",children:s("modelManager.custom")})})]})})]}),k==="custom"&&i.jsx(lr,{label:s("modelManager.mergedModelCustomSaveLocation"),value:I,onChange:z=>j(z.target.value)})]}),i.jsx(qn,{label:s("modelManager.ignoreMismatch"),isChecked:E,onChange:z=>T(z.target.checked),fontWeight:"500"}),i.jsx(fn,{onClick:U,isLoading:N,isDisabled:k==="custom"&&I==="",children:s("modelManager.merge")})]})}),i.jsx(ga,{})]})]})]})}const Eoe=Te(pr,e=>qa(e.model_list,(n,r)=>({name:r,...n})),{memoizeOptions:{resultEqualityCheck:Ut}});function N1({label:e,isActive:t,onClick:n}){return i.jsx(fn,{onClick:n,isActive:t,sx:{_active:{bg:"accent.750"}},size:"sm",children:e})}const Ooe=()=>{const e=q(Eoe),[t,n]=B.useState(!1);B.useEffect(()=>{const v=setTimeout(()=>{n(!0)},200);return()=>clearTimeout(v)},[]);const[r,o]=h.useState(""),[s,a]=h.useState("all"),[l,u]=h.useTransition(),{t:f}=Ce(),p=v=>{u(()=>{o(v.target.value)})},m=h.useMemo(()=>{const v=[],y=[],S=[],x=[];return e.forEach((w,_)=>{w.name.toLowerCase().includes(r.toLowerCase())&&(S.push(i.jsx(Sh,{name:w.name,status:w.status,description:w.description},_)),w.format===s&&x.push(i.jsx(Sh,{name:w.name,status:w.status,description:w.description},_))),w.format!=="diffusers"?v.push(i.jsx(Sh,{name:w.name,status:w.status,description:w.description},_)):y.push(i.jsx(Sh,{name:w.name,status:w.status,description:w.description},_))}),r!==""?s==="all"?i.jsx(et,{marginTop:4,children:S}):i.jsx(et,{marginTop:4,children:x}):i.jsxs(K,{flexDirection:"column",rowGap:6,children:[s==="all"&&i.jsxs(i.Fragment,{children:[i.jsxs(et,{children:[i.jsx(lt,{sx:{fontWeight:"500",py:2,px:4,my:4,mx:0,borderRadius:"base",width:"max-content",fontSize:"sm",bg:"base.750"},children:f("modelManager.checkpointModels")}),v]}),i.jsxs(et,{children:[i.jsx(lt,{sx:{fontWeight:"500",py:2,px:4,mb:4,borderRadius:"base",width:"max-content",fontSize:"sm",bg:"base.750"},children:f("modelManager.diffusersModels")}),y]})]}),s==="ckpt"&&i.jsx(K,{flexDirection:"column",marginTop:4,children:v}),s==="diffusers"&&i.jsx(K,{flexDirection:"column",marginTop:4,children:y})]})},[e,r,f,s]);return i.jsxs(K,{flexDirection:"column",rowGap:4,width:"50%",minWidth:"50%",children:[i.jsxs(K,{justifyContent:"space-between",alignItems:"center",gap:2,children:[i.jsx(ta,{size:"md",children:f("modelManager.availableModels")}),i.jsx(ul,{}),i.jsx(Poe,{}),i.jsx(Ioe,{})]}),i.jsx(lr,{onChange:p,label:f("modelManager.search")}),i.jsxs(K,{flexDirection:"column",gap:1,maxHeight:window.innerHeight-240,overflow:"scroll",paddingInlineEnd:4,children:[i.jsxs(K,{columnGap:2,children:[i.jsx(N1,{label:f("modelManager.allModels"),onClick:()=>a("all"),isActive:s==="all"}),i.jsx(N1,{label:f("modelManager.checkpointModels"),onClick:()=>a("ckpt"),isActive:s==="ckpt"}),i.jsx(N1,{label:f("modelManager.diffusersModels"),onClick:()=>a("diffusers"),isActive:s==="diffusers"})]}),t?m:i.jsx(K,{width:"100%",minHeight:96,justifyContent:"center",alignItems:"center",children:i.jsx(Du,{})})]})]})};function Toe({children:e}){const{isOpen:t,onOpen:n,onClose:r}=us(),o=q(l=>l.system.model_list),s=q(l=>l.system.openModel),{t:a}=Ce();return i.jsxs(i.Fragment,{children:[h.cloneElement(e,{onClick:n}),i.jsxs(tl,{isOpen:t,onClose:r,size:"full",children:[i.jsx(ya,{}),i.jsxs(nl,{children:[i.jsx(Vu,{}),i.jsx(va,{children:a("modelManager.modelManager")}),i.jsx(xa,{children:i.jsxs(K,{width:"100%",columnGap:8,children:[i.jsx(Ooe,{}),s&&o[s].format==="diffusers"?i.jsx(Soe,{}):i.jsx(boe,{})]})}),i.jsx(ga,{})]})]})]})}const Roe=e=>{const{searchable:t=!0,tooltip:n,...r}=e,{base50:o,base100:s,base200:a,base300:l,base400:u,base500:f,base600:p,base700:m,base800:v,base900:y,accent200:S,accent300:x,accent400:w,accent500:_,accent600:k}=VT(),[P]=hc("shadows",["dark-lg"]),{colorMode:I}=fo();return i.jsx(er,{label:n,placement:"top",hasArrow:!0,children:i.jsx(LT,{searchable:t,styles:()=>({label:{color:Ae(m,l)(I),fontWeight:"normal"},searchInput:{":placeholder":{color:Ae(l,m)(I)}},input:{backgroundColor:Ae(o,y)(I),borderWidth:"2px",borderColor:Ae(a,v)(I),color:Ae(y,s)(I),paddingRight:24,fontWeight:600,"&:hover":{borderColor:Ae(l,p)(I)},"&:focus":{borderColor:Ae(x,k)(I)},"&:is(:focus, :hover)":{borderColor:Ae(u,f)(I)},"&:focus-within":{borderColor:Ae(S,k)(I)},"&:disabled":{backgroundColor:Ae(l,m)(I),color:Ae(p,u)(I)}},value:{backgroundColor:Ae(a,v)(I),color:Ae(y,s)(I),button:{color:Ae(y,s)(I)},"&:hover":{backgroundColor:Ae(l,m)(I),cursor:"pointer"}},dropdown:{backgroundColor:Ae(a,v)(I),borderColor:Ae(a,v)(I),boxShadow:P},item:{backgroundColor:Ae(a,v)(I),color:Ae(v,a)(I),padding:6,"&[data-hovered]":{color:Ae(y,s)(I),backgroundColor:Ae(l,m)(I)},"&[data-active]":{backgroundColor:Ae(l,m)(I),"&:hover":{color:Ae(y,s)(I),backgroundColor:Ae(l,m)(I)}},"&[data-selected]":{backgroundColor:Ae(w,k)(I),color:Ae(o,s)(I),fontWeight:600,"&:hover":{backgroundColor:Ae(_,_)(I),color:Ae("white",o)(I)}}},rightSection:{width:24,padding:20,button:{color:Ae(y,s)(I)}}}),...r})})},f8=h.memo(Roe),Moe=qa(x5,e=>({value:e,label:b5[e]})).sort((e,t)=>e.label.localeCompare(t.label));function Doe(){const e=ue(),{t}=Ce(),n=q(o=>o.ui.favoriteSchedulers),r=h.useCallback(o=>{e(ZM(o))},[e]);return i.jsx(f8,{label:t("settings.favoriteSchedulers"),value:n,data:Moe,onChange:r,clearable:!0,searchable:!0,maxSelectedValues:99,placeholder:t("settings.favoriteSchedulersPlaceholder")})}const Aoe=Te([pr,po],(e,t)=>{const{shouldConfirmOnDelete:n,shouldDisplayGuides:r,enableImageDebugging:o,consoleLogLevel:s,shouldLogToConsole:a,shouldAntialiasProgressImage:l}=e,{shouldUseCanvasBetaLayout:u,shouldUseSliders:f,shouldShowProgressInViewer:p}=t;return{shouldConfirmOnDelete:n,shouldDisplayGuides:r,enableImageDebugging:o,shouldUseCanvasBetaLayout:u,shouldUseSliders:f,shouldShowProgressInViewer:p,consoleLogLevel:s,shouldLogToConsole:a,shouldAntialiasProgressImage:l}},{memoizeOptions:{resultEqualityCheck:Ut}}),Noe=({children:e,config:t})=>{const n=ue(),{t:r}=Ce(),o=(t==null?void 0:t.shouldShowBetaLayout)??!0,s=(t==null?void 0:t.shouldShowDeveloperSettings)??!0,a=(t==null?void 0:t.shouldShowResetWebUiText)??!0;h.useEffect(()=>{s||n(pS(!1))},[s,n]);const{isOpen:l,onOpen:u,onClose:f}=us(),{isOpen:p,onOpen:m,onClose:v}=us(),{shouldConfirmOnDelete:y,shouldDisplayGuides:S,enableImageDebugging:x,shouldUseCanvasBetaLayout:w,shouldUseSliders:_,shouldShowProgressInViewer:k,consoleLogLevel:P,shouldLogToConsole:I,shouldAntialiasProgressImage:j}=q(Aoe),E=h.useCallback(()=>{Object.keys(window.localStorage).forEach(M=>{(QM.includes(M)||M.startsWith(JM))&&localStorage.removeItem(M)}),f(),m()},[f,m]),T=h.useCallback(M=>{n(e7(M))},[n]),R=h.useCallback(M=>{n(pS(M.target.checked))},[n]);return i.jsxs(i.Fragment,{children:[h.cloneElement(e,{onClick:u}),i.jsxs(tl,{isOpen:l,onClose:f,size:"xl",isCentered:!0,children:[i.jsx(ya,{}),i.jsxs(nl,{children:[i.jsx(va,{children:r("common.settingsLabel")}),i.jsx(Vu,{}),i.jsx(xa,{children:i.jsxs(K,{sx:{gap:4,flexDirection:"column"},children:[i.jsxs(wd,{children:[i.jsx(ta,{size:"sm",children:r("settings.general")}),i.jsx(Br,{label:r("settings.confirmOnDelete"),isChecked:y,onChange:M=>n(p5(M.target.checked))})]}),i.jsxs(wd,{children:[i.jsx(ta,{size:"sm",children:r("settings.generation")}),i.jsx(Doe,{})]}),i.jsxs(wd,{children:[i.jsx(ta,{size:"sm",children:r("settings.ui")}),i.jsx(Br,{label:r("settings.displayHelpIcons"),isChecked:S,onChange:M=>n(t7(M.target.checked))}),o&&i.jsx(Br,{label:r("settings.useCanvasBeta"),isChecked:w,onChange:M=>n(n7(M.target.checked))}),i.jsx(Br,{label:r("settings.useSlidersForAll"),isChecked:_,onChange:M=>n(r7(M.target.checked))}),i.jsx(Br,{label:r("settings.showProgressInViewer"),isChecked:k,onChange:M=>n(g5(M.target.checked))}),i.jsx(Br,{label:r("settings.antialiasProgressImages"),isChecked:j,onChange:M=>n(o7(M.target.checked))})]}),s&&i.jsxs(wd,{children:[i.jsx(ta,{size:"sm",children:r("settings.developer")}),i.jsx(Br,{label:r("settings.shouldLogToConsole"),isChecked:I,onChange:R}),i.jsx(Zo,{disabled:!I,label:r("settings.consoleLogLevel"),onChange:T,value:P,data:s7.concat()}),i.jsx(Br,{label:r("settings.enableImageDebugging"),isChecked:x,onChange:M=>n(a7(M.target.checked))})]}),i.jsxs(wd,{children:[i.jsx(ta,{size:"sm",children:r("settings.resetWebUI")}),i.jsx(fn,{colorScheme:"error",onClick:E,children:r("settings.resetWebUI")}),a&&i.jsxs(i.Fragment,{children:[i.jsx(lt,{children:r("settings.resetWebUIDesc1")}),i.jsx(lt,{children:r("settings.resetWebUIDesc2")})]})]})]})}),i.jsx(ga,{children:i.jsx(fn,{onClick:f,children:r("common.close")})})]})]}),i.jsxs(tl,{closeOnOverlayClick:!1,isOpen:p,onClose:v,isCentered:!0,children:[i.jsx(ya,{backdropFilter:"blur(40px)"}),i.jsxs(nl,{children:[i.jsx(va,{}),i.jsx(xa,{children:i.jsx(K,{justifyContent:"center",children:i.jsx(lt,{fontSize:"lg",children:i.jsx(lt,{children:r("settings.resetComplete")})})})}),i.jsx(ga,{})]})]})]})},wd=e=>i.jsx(K,{layerStyle:"second",sx:{flexDirection:"column",gap:2,p:4,borderRadius:"base"},children:e.children}),zoe=()=>{const{colorMode:e,toggleColorMode:t}=fo(),{t:n}=Ce();return i.jsx(Me,{"aria-label":n(e==="dark"?"common.lightMode":"common.darkMode"),tooltip:n(e==="dark"?"common.lightMode":"common.darkMode"),size:"sm",icon:e==="dark"?i.jsx(pU,{fontSize:19}):i.jsx(aU,{fontSize:18}),onClick:t,variant:"link"})},$oe=()=>{const{t:e}=Ce(),t=so("modelManager").isFeatureEnabled,n=so("localization").isFeatureEnabled,r=so("bugLink").isFeatureEnabled,o=so("discordLink").isFeatureEnabled,s=so("githubLink").isFeatureEnabled;return i.jsxs(K,{sx:{gap:2,alignItems:"center"},children:[i.jsx(l8,{}),i.jsx(ul,{}),i.jsx($re,{}),t&&i.jsx(Toe,{children:i.jsx(Me,{"aria-label":e("modelManager.modelManager"),tooltip:e("modelManager.modelManager"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:i.jsx(GW,{})})}),i.jsx(Bre,{children:i.jsx(Me,{"aria-label":e("common.hotkeysLabel"),tooltip:e("common.hotkeysLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:i.jsx(nU,{})})}),n&&i.jsx(Hre,{}),r&&i.jsx(Wl,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI/issues",marginBottom:"-0.25rem",children:i.jsx(Me,{"aria-label":e("common.reportBugLabel"),tooltip:e("common.reportBugLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:i.jsx(WW,{})})}),s&&i.jsx(Wl,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI",marginBottom:"-0.25rem",children:i.jsx(Me,{"aria-label":e("common.githubLabel"),tooltip:e("common.githubLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:i.jsx($W,{})})}),o&&i.jsx(Wl,{isExternal:!0,href:"https://discord.gg/ZmtBAhwWhy",marginBottom:"-0.25rem",children:i.jsx(Me,{"aria-label":e("common.discordLabel"),tooltip:e("common.discordLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:i.jsx(zW,{})})}),i.jsx(zoe,{}),i.jsx(Noe,{children:i.jsx(Me,{"aria-label":e("common.settingsLabel"),tooltip:e("common.settingsLabel"),variant:"link","data-variant":"link",fontSize:22,size:"sm",icon:i.jsx(mU,{})})})]})},Loe=h.memo($oe),Boe=Te([pr,Qa],(e,t)=>{const{wasSchemaParsed:n}=e,{disabledTabs:r}=t;return{disabledTabs:r,wasSchemaParsed:n}}),Foe=()=>{const{disabledTabs:e,wasSchemaParsed:t}=q(Boe);return h.useMemo(()=>!(!e.includes("nodes")&&!t),[e,t])},Hoe=Te([Gr,po],(e,t)=>{const{shouldPinGallery:n,shouldShowGallery:r}=t;return{shouldPinGallery:n,shouldShowGalleryButton:!r}},{memoizeOptions:{resultEqualityCheck:Ut}}),Voe=()=>{const{t:e}=Ce(),{shouldPinGallery:t,shouldShowGalleryButton:n}=q(Hoe),r=ue(),o=()=>{r(K1(!0)),t&&r(Bs())};return n?i.jsx(Me,{tooltip:"Show Gallery (G)",tooltipProps:{placement:"top"},"aria-label":e("accessibility.showGallery"),onClick:o,sx:{pos:"absolute",top:"50%",transform:"translate(0, -50%)",p:0,insetInlineEnd:0,px:3,h:48,w:8,borderStartEndRadius:0,borderEndEndRadius:0,shadow:"2xl"},children:i.jsx(MI,{})}):null},Woe=h.memo(Voe),Uoe=Te(pr,e=>({isProcessing:e.isProcessing,isConnected:e.isConnected,isCancelable:e.isCancelable,currentIteration:e.currentIteration,totalIterations:e.totalIterations,sessionId:e.sessionId,cancelType:e.cancelType,isCancelScheduled:e.isCancelScheduled}),{memoizeOptions:{resultEqualityCheck:Ut}}),Goe=e=>{const t=ue(),{btnGroupWidth:n="auto",...r}=e,{isProcessing:o,isConnected:s,isCancelable:a,cancelType:l,isCancelScheduled:u,sessionId:f}=q(Uoe),p=h.useCallback(()=>{if(f){if(l==="scheduled"){t(i7());return}t(l7({session_id:f}))}},[t,f,l]),{t:m}=Ce(),v=h.useCallback(x=>{const w=Array.isArray(x)?x[0]:x;t(c7(w))},[t]);nt("shift+x",()=>{(s||o)&&a&&p()},[s,o,a]);const y=h.useMemo(()=>m(u?"parameters.cancel.isScheduled":l==="immediate"?"parameters.cancel.immediate":"parameters.cancel.schedule"),[m,l,u]),S=h.useMemo(()=>u?i.jsx(tm,{}):l==="immediate"?i.jsx(yU,{}):i.jsx(hU,{}),[l,u]);return i.jsxs(Fr,{isAttached:!0,width:n,children:[i.jsx(Me,{icon:S,tooltip:y,"aria-label":y,isDisabled:!s||!o||!a,onClick:p,colorScheme:"error",id:"cancel-button",...r}),i.jsxs(Mg,{closeOnSelect:!1,children:[i.jsx(Dg,{as:Me,tooltip:m("parameters.cancel.setType"),"aria-label":m("parameters.cancel.setType"),icon:i.jsx(SU,{w:"1em",h:"1em"}),paddingX:0,paddingY:0,colorScheme:"error",minWidth:5,...r}),i.jsx(Lf,{minWidth:"240px",children:i.jsxs(lb,{value:l,title:"Cancel Type",type:"radio",onChange:v,children:[i.jsx(Kd,{value:"immediate",children:m("parameters.cancel.immediate")}),i.jsx(Kd,{value:"scheduled",children:m("parameters.cancel.schedule")})]})})]})]})},i2=h.memo(Goe),qoe=e=>{const r=e.split(",").map(o=>o.split(":")).map(o=>({seed:Number(o[0]),weight:Number(o[1])}));return l2(r)?r:!1},l2=e=>typeof e=="string"?!!qoe(e):!!(e.length&&!e.some(t=>{const{seed:n,weight:r}=t,o=!isNaN(parseInt(n.toString(),10)),s=!isNaN(parseInt(r.toString(),10))&&r>=0&&r<=1;return!(o&&s)})),Yoe=Te([$o,pr,Gr],(e,t,n)=>{const{shouldGenerateVariations:r,seedWeights:o,initialImage:s,seed:a}=e,{isProcessing:l,isConnected:u}=t;let f=!0;const p=[];return n==="img2img"&&!s&&(f=!1,p.push("No initial image selected")),l&&(f=!1,p.push("System Busy")),u||(f=!1,p.push("System Disconnected")),r&&(!(l2(o)||o==="")||a===-1)&&(f=!1,p.push("Seed-Weights badly formatted.")),{isReady:f,reasonsWhyNotReady:p}},zn),ho=()=>{const{isReady:e}=q(Yoe);return e},Koe=Te(pr,e=>({isProcessing:e.isProcessing,currentStep:e.currentStep,totalSteps:e.totalSteps,currentStatusHasSteps:e.currentStatusHasSteps}),{memoizeOptions:{resultEqualityCheck:Ut}}),Xoe=()=>{const{t:e}=Ce(),{isProcessing:t,currentStep:n,totalSteps:r,currentStatusHasSteps:o}=q(Koe),s=n?Math.round(n*100/r):0;return i.jsx(K6,{value:s,"aria-label":e("accessibility.invokeProgressBar"),isIndeterminate:t&&!o,height:"full"})},p8=h.memo(Xoe);function c2(e){const{iconButton:t=!1,...n}=e,r=ue(),o=ho(),s=q(Gr),a=h.useCallback(()=>{r(kx()),r(Px(s))},[r,s]),{t:l}=Ce();return nt(["ctrl+enter","meta+enter"],a,{enabled:()=>o,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[o,s]),i.jsx(et,{style:{flexGrow:4},position:"relative",children:i.jsxs(et,{style:{position:"relative"},children:[!o&&i.jsx(et,{style:{position:"absolute",bottom:"0",left:"0",right:"0",height:"100%",overflow:"clip",borderRadius:4},children:i.jsx(p8,{})}),t?i.jsx(Me,{"aria-label":l("parameters.invoke"),type:"submit",icon:i.jsx(RI,{}),isDisabled:!o,onClick:a,flexGrow:1,w:"100%",tooltip:l("parameters.invoke"),tooltipProps:{placement:"top"},colorScheme:"accent",id:"invoke-button",...n}):i.jsx(fn,{"aria-label":l("parameters.invoke"),type:"submit",isDisabled:!o,onClick:a,flexGrow:1,w:"100%",colorScheme:"accent",id:"invoke-button",fontWeight:700,...n,children:"Invoke"})]})})}const z1={borderStartStartRadius:0,borderEndStartRadius:0,shadow:"2xl"},Zoe=Te([po,Gr],(e,t)=>{const{shouldPinParametersPanel:n,shouldUseCanvasBetaLayout:r,shouldShowParametersPanel:o}=e,s=r&&t==="unifiedCanvas",a=!s&&(!n||!o),l=!s&&!o&&["txt2img","img2img","unifiedCanvas"].includes(t);return{shouldPinParametersPanel:n,shouldShowParametersPanelButton:l,shouldShowProcessButtons:a}},{memoizeOptions:{resultEqualityCheck:Ut}}),Qoe=()=>{const e=ue(),{t}=Ce(),{shouldShowProcessButtons:n,shouldShowParametersPanelButton:r,shouldPinParametersPanel:o}=q(Zoe),s=()=>{e(jx(!0)),o&&e(Bs())};return r?i.jsxs(K,{pos:"absolute",transform:"translate(0, -50%)",minW:8,top:"50%",insetInlineStart:"4.5rem",direction:"column",gap:2,children:[i.jsx(Me,{tooltip:"Show Options Panel (O)",tooltipProps:{placement:"top"},"aria-label":t("accessibility.showOptionsPanel"),onClick:s,sx:z1,children:i.jsx(Rb,{})}),n&&i.jsxs(i.Fragment,{children:[i.jsx(c2,{iconButton:!0,sx:z1}),i.jsx(i2,{sx:z1})]})]}):null},Joe=h.memo(Qoe),{createElement:ju,createContext:ese,forwardRef:h8,useCallback:Fi,useContext:m8,useEffect:pi,useImperativeHandle:g8,useLayoutEffect:tse,useMemo:nse,useRef:Is,useState:Ld}=Cx,f3=Cx["useId".toString()],rse=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",mg=rse?tse:()=>{},ose=typeof f3=="function"?f3:()=>null;let sse=0;function u2(e=null){const t=ose(),n=Is(e||t||null);return n.current===null&&(n.current=""+sse++),n.current}const Tv=ese(null);Tv.displayName="PanelGroupContext";function v8({children:e=null,className:t="",collapsedSize:n=0,collapsible:r=!1,defaultSize:o=null,forwardedRef:s,id:a=null,maxSize:l=100,minSize:u=10,onCollapse:f=null,onResize:p=null,order:m=null,style:v={},tagName:y="div"}){const S=m8(Tv);if(S===null)throw Error("Panel components must be rendered within a PanelGroup container");const x=u2(a),{collapsePanel:w,expandPanel:_,getPanelStyle:k,registerPanel:P,resizePanel:I,unregisterPanel:j}=S,E=Is({onCollapse:f,onResize:p});if(pi(()=>{E.current.onCollapse=f,E.current.onResize=p}),u<0||u>100)throw Error(`Panel minSize must be between 0 and 100, but was ${u}`);if(l<0||l>100)throw Error(`Panel maxSize must be between 0 and 100, but was ${l}`);if(o!==null){if(o<0||o>100)throw Error(`Panel defaultSize must be between 0 and 100, but was ${o}`);u>o&&!r&&(console.error(`Panel minSize ${u} cannot be greater than defaultSize ${o}`),o=u)}const T=k(x,o),R=Is({size:p3(T)}),M=Is({callbacksRef:E,collapsedSize:n,collapsible:r,defaultSize:o,id:x,maxSize:l,minSize:u,order:m});return mg(()=>{R.current.size=p3(T),M.current.callbacksRef=E,M.current.collapsedSize=n,M.current.collapsible=r,M.current.defaultSize=o,M.current.id=x,M.current.maxSize=l,M.current.minSize=u,M.current.order=m}),mg(()=>(P(x,M),()=>{j(x)}),[m,x,P,j]),g8(s,()=>({collapse:()=>w(x),expand:()=>_(x),getCollapsed(){return R.current.size===0},getSize(){return R.current.size},resize:D=>I(x,D)}),[w,_,x,I]),ju(y,{children:e,className:t,"data-panel":"","data-panel-collapsible":r||void 0,"data-panel-id":x,"data-panel-size":parseFloat(""+T.flexGrow).toFixed(1),id:`data-panel-id-${x}`,style:{...T,...v}})}const wf=h8((e,t)=>ju(v8,{...e,forwardedRef:t}));v8.displayName="Panel";wf.displayName="forwardRef(Panel)";function p3(e){const{flexGrow:t}=e;return typeof t=="string"?parseFloat(t):t}const fc=10;function Od(e,t,n,r,o,s,a,l){const{sizes:u}=l||{},f=u||s;if(o===0)return f;const p=Ps(t),m=f.concat();let v=0;{const x=o<0?r:n,w=p.findIndex(I=>I.current.id===x),_=p[w],k=f[w],P=h3(_,Math.abs(o),k,e);if(k===P)return f;P===0&&k>0&&a.set(x,k),o=o<0?k-P:P-k}let y=o<0?n:r,S=p.findIndex(x=>x.current.id===y);for(;;){const x=p[S],w=f[S],_=Math.abs(o)-Math.abs(v),k=h3(x,0-_,w,e);if(w!==k&&(k===0&&w>0&&a.set(x.current.id,w),v+=w-k,m[S]=k,v.toPrecision(fc).localeCompare(Math.abs(o).toPrecision(fc),void 0,{numeric:!0})>=0))break;if(o<0){if(--S<0)break}else if(++S>=p.length)break}return v===0?f:(y=o<0?r:n,S=p.findIndex(x=>x.current.id===y),m[S]=f[S]+v,m)}function Vc(e,t,n){t.forEach((r,o)=>{const{callbacksRef:s,collapsedSize:a,collapsible:l,id:u}=e[o].current,f=n[u];if(f!==r){n[u]=r;const{onCollapse:p,onResize:m}=s.current;m&&m(r,f),l&&p&&((f==null||f===a)&&r!==a?p(!1):f!==a&&r===a&&p(!0))}})}function $1(e,t){if(t.length<2)return[null,null];const n=t.findIndex(a=>a.current.id===e);if(n<0)return[null,null];const r=n===t.length-1,o=r?t[n-1].current.id:e,s=r?e:t[n+1].current.id;return[o,s]}function y8(e,t,n){if(e.size===1)return"100";const o=Ps(e).findIndex(a=>a.current.id===t),s=n[o];return s==null?"0":s.toPrecision(fc)}function ase(e){const t=document.querySelector(`[data-panel-id="${e}"]`);return t||null}function d2(e){const t=document.querySelector(`[data-panel-group-id="${e}"]`);return t||null}function Rv(e){const t=document.querySelector(`[data-panel-resize-handle-id="${e}"]`);return t||null}function ise(e){return x8().findIndex(r=>r.getAttribute("data-panel-resize-handle-id")===e)??null}function x8(){return Array.from(document.querySelectorAll("[data-panel-resize-handle-id]"))}function b8(e){return Array.from(document.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function f2(e,t,n){var u,f,p,m;const r=Rv(t),o=b8(e),s=r?o.indexOf(r):-1,a=((f=(u=n[s])==null?void 0:u.current)==null?void 0:f.id)??null,l=((m=(p=n[s+1])==null?void 0:p.current)==null?void 0:m.id)??null;return[a,l]}function Ps(e){return Array.from(e.values()).sort((t,n)=>{const r=t.current.order,o=n.current.order;return r==null&&o==null?0:r==null?-1:o==null?1:r-o})}function h3(e,t,n,r){var p;const o=n+t,{collapsedSize:s,collapsible:a,maxSize:l,minSize:u}=e.current;if(a){if(n>s){if(o<=u/2+s)return s}else if(!((p=r==null?void 0:r.type)==null?void 0:p.startsWith("key"))&&o<u)return s}return Math.min(l,Math.max(u,o))}function w8(e,t="Assertion failed!"){if(!e)throw console.error(t),Error(t)}function lse({committedValuesRef:e,groupId:t,panels:n,setSizes:r,sizes:o,panelSizeBeforeCollapse:s}){pi(()=>{const{direction:a,panels:l}=e.current,u=d2(t),{height:f,width:p}=u.getBoundingClientRect(),v=b8(t).map(y=>{const S=y.getAttribute("data-panel-resize-handle-id"),x=Ps(l),[w,_]=f2(t,S,x);if(w==null||_==null)return()=>{};let k=0,P=100,I=0,j=0;x.forEach(N=>{N.current.id===w?(P=N.current.maxSize,k=N.current.minSize):(I+=N.current.minSize,j+=N.current.maxSize)});const E=Math.min(P,100-I),T=Math.max(k,(x.length-1)*100-j),R=y8(l,w,o);y.setAttribute("aria-valuemax",""+Math.round(E)),y.setAttribute("aria-valuemin",""+Math.round(T)),y.setAttribute("aria-valuenow",""+Math.round(parseInt(R)));const M=N=>{if(!N.defaultPrevented)switch(N.key){case"Enter":{N.preventDefault();const U=x.findIndex(z=>z.current.id===w);if(U>=0){const z=x[U],F=o[U];if(F!=null){let H=0;F.toPrecision(fc)<=z.current.minSize.toPrecision(fc)?H=a==="horizontal"?p:f:H=-(a==="horizontal"?p:f);const G=Od(N,l,w,_,H,o,s.current,null);o!==G&&r(G)}}break}}};y.addEventListener("keydown",M);const D=ase(w);return D!=null&&y.setAttribute("aria-controls",D.id),()=>{y.removeAttribute("aria-valuemax"),y.removeAttribute("aria-valuemin"),y.removeAttribute("aria-valuenow"),y.removeEventListener("keydown",M),D!=null&&y.removeAttribute("aria-controls")}});return()=>{v.forEach(y=>y())}},[e,t,n,s,r,o])}function cse({disabled:e,handleId:t,resizeHandler:n}){pi(()=>{if(e||n==null)return;const r=Rv(t);if(r==null)return;const o=s=>{if(!s.defaultPrevented)switch(s.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{s.preventDefault(),n(s);break}case"F6":{s.preventDefault();const a=x8(),l=ise(t);w8(l!==null);const u=s.shiftKey?l>0?l-1:a.length-1:l+1<a.length?l+1:0;a[u].focus();break}}};return r.addEventListener("keydown",o),()=>{r.removeEventListener("keydown",o)}},[e,t,n])}function use(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function S8(e,t,n,r=0,o=null){const s=n==="horizontal";let a=0;if(ax(e))a=s?e.clientX:e.clientY;else if(ix(e)){const p=e.touches[0];a=s?p.screenX:p.screenY}else return 0;const l=Rv(t),u=o||l.getBoundingClientRect(),f=s?u.left:u.top;return a-f-r}function dse(e,t,n,r,o,s,a){const{dragOffset:l=0,dragHandleRect:u,sizes:f}=a||{},p=f||s;if(fse(e)){const m=o==="horizontal",y=d2(t).getBoundingClientRect(),S=m?y.width:y.height,x=e.shiftKey?10:100,w=S/x;let _=0;switch(e.key){case"ArrowDown":_=m?0:w;break;case"ArrowLeft":_=m?-w:0;break;case"ArrowRight":_=m?w:0;break;case"ArrowUp":_=m?0:-w;break;case"End":_=S;break;case"Home":_=-S;break}const[k,P]=f2(t,n,r),I=_<0?k:P,j=r.findIndex(T=>T.current.id===I),E=r[j];if(E.current.collapsible){const T=p[j];(T===0||T.toPrecision(fc)===E.current.minSize.toPrecision(fc))&&(_=_<0?-E.current.minSize*S:E.current.minSize*S)}return _}else return S8(e,n,o,l,u)}function fse(e){return e.type==="keydown"}function ax(e){return e.type.startsWith("mouse")}function ix(e){return e.type.startsWith("touch")}let lx=null,Bl=null;function C8(e){switch(e){case"horizontal":return"ew-resize";case"horizontal-max":return"w-resize";case"horizontal-min":return"e-resize";case"vertical":return"ns-resize";case"vertical-max":return"n-resize";case"vertical-min":return"s-resize"}}function pse(){Bl!==null&&(document.head.removeChild(Bl),lx=null,Bl=null)}function L1(e){if(lx===e)return;lx=e;const t=C8(e);Bl===null&&(Bl=document.createElement("style"),document.head.appendChild(Bl)),Bl.innerHTML=`*{cursor: ${t}!important;}`}function hse(e,t=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}function _8(e){return e.map(t=>{const{minSize:n,order:r}=t.current;return r?`${r}:${n}`:`${n}`}).sort((t,n)=>t.localeCompare(n)).join(",")}function k8(e,t){try{const n=t.getItem(`PanelGroup:sizes:${e}`);if(n){const r=JSON.parse(n);if(typeof r=="object"&&r!=null)return r}}catch{}return null}function mse(e,t,n){const r=k8(e,n);if(r){const o=_8(t);return r[o]??null}return null}function gse(e,t,n,r){const o=_8(t),s=k8(e,r)||{};s[o]=n;try{r.setItem(`PanelGroup:sizes:${e}`,JSON.stringify(s))}catch(a){console.error(a)}}const B1={};function m3(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}const Td={getItem:e=>(m3(Td),Td.getItem(e)),setItem:(e,t)=>{m3(Td),Td.setItem(e,t)}};function P8({autoSaveId:e,children:t=null,className:n="",direction:r,disablePointerEventsDuringResize:o=!1,forwardedRef:s,id:a=null,onLayout:l,storage:u=Td,style:f={},tagName:p="div"}){const m=u2(a),[v,y]=Ld(null),[S,x]=Ld(new Map),w=Is(null),_=Is({onLayout:l});pi(()=>{_.current.onLayout=l});const k=Is({}),[P,I]=Ld([]),j=Is(new Map),E=Is(0),T=Is({direction:r,panels:S,sizes:P});g8(s,()=>({getLayout:()=>{const{sizes:A}=T.current;return A},setLayout:A=>{const L=A.reduce((le,oe)=>le+oe,0);w8(L===100,"Panel sizes must add up to 100%");const{panels:W}=T.current,V=k.current,ee=Ps(W);I(A),Vc(ee,A,V)}}),[]),mg(()=>{T.current.direction=r,T.current.panels=S,T.current.sizes=P}),lse({committedValuesRef:T,groupId:m,panels:S,setSizes:I,sizes:P,panelSizeBeforeCollapse:j}),pi(()=>{const{onLayout:A}=_.current,{panels:L,sizes:W}=T.current;if(W.length>0){A&&A(W);const V=k.current,ee=Ps(L);Vc(ee,W,V)}},[P]),mg(()=>{if(T.current.sizes.length===S.size)return;let L=null;if(e){const W=Ps(S);L=mse(e,W,u)}if(L!=null)I(L);else{const W=Ps(S);let V=0,ee=0,le=0;if(W.forEach(oe=>{le+=oe.current.minSize,oe.current.defaultSize===null?V++:ee+=oe.current.defaultSize}),ee>100)throw new Error("Default panel sizes cannot exceed 100%");if(W.length>1&&V===0&&ee!==100)throw new Error("Invalid default sizes specified for panels");if(le>100)throw new Error("Minimum panel sizes cannot exceed 100%");I(W.map(oe=>oe.current.defaultSize===null?(100-ee)/V:oe.current.defaultSize))}},[e,S,u]),pi(()=>{if(e){if(P.length===0||P.length!==S.size)return;const A=Ps(S);B1[e]||(B1[e]=hse(gse,100)),B1[e](e,A,P,u)}},[e,S,P,u]);const R=Fi((A,L)=>{const{panels:W}=T.current;return W.size===0?{flexBasis:0,flexGrow:L??void 0,flexShrink:1,overflow:"hidden"}:{flexBasis:0,flexGrow:y8(W,A,P),flexShrink:1,overflow:"hidden",pointerEvents:o&&v!==null?"none":void 0}},[v,o,P]),M=Fi((A,L)=>{x(W=>{if(W.has(A))return W;const V=new Map(W);return V.set(A,L),V})},[]),D=Fi(A=>W=>{W.preventDefault();const{direction:V,panels:ee,sizes:le}=T.current,oe=Ps(ee),[X,Q]=f2(m,A,oe);if(X==null||Q==null)return;let ie=dse(W,m,A,oe,V,le,w.current);if(ie===0)return;const ye=d2(m).getBoundingClientRect(),se=V==="horizontal";document.dir==="rtl"&&se&&(ie=-ie);const de=se?ye.width:ye.height,fe=ie/de*100,xe=Od(W,ee,X,Q,fe,le,j.current,w.current),ke=!use(le,xe);if((ax(W)||ix(W))&&E.current!=fe&&L1(ke?se?"horizontal":"vertical":se?ie<0?"horizontal-min":"horizontal-max":ie<0?"vertical-min":"vertical-max"),ke){const ae=k.current;I(xe),Vc(oe,xe,ae)}E.current=fe},[m]),N=Fi(A=>{x(L=>{if(!L.has(A))return L;const W=new Map(L);return W.delete(A),W})},[]),U=Fi(A=>{const{panels:L,sizes:W}=T.current,V=L.get(A);if(V==null)return;const{collapsedSize:ee,collapsible:le}=V.current;if(!le)return;const oe=Ps(L),X=oe.indexOf(V);if(X<0)return;const Q=W[X];if(Q===ee)return;j.current.set(A,Q);const[ie,ve]=$1(A,oe);if(ie==null||ve==null)return;const se=X===oe.length-1?Q:ee-Q,de=Od(null,L,ie,ve,se,W,j.current,null);if(W!==de){const fe=k.current;I(de),Vc(oe,de,fe)}},[]),z=Fi(A=>{const{panels:L,sizes:W}=T.current,V=L.get(A);if(V==null)return;const{collapsedSize:ee,minSize:le}=V.current,oe=j.current.get(A)||le;if(!oe)return;const X=Ps(L),Q=X.indexOf(V);if(Q<0||W[Q]!==ee)return;const[ve,ye]=$1(A,X);if(ve==null||ye==null)return;const de=Q===X.length-1?ee-oe:oe,fe=Od(null,L,ve,ye,de,W,j.current,null);if(W!==fe){const xe=k.current;I(fe),Vc(X,fe,xe)}},[]),F=Fi((A,L)=>{const{panels:W,sizes:V}=T.current,ee=W.get(A);if(ee==null)return;const{collapsedSize:le,collapsible:oe,maxSize:X,minSize:Q}=ee.current,ie=Ps(W),ve=ie.indexOf(ee);if(ve<0)return;const ye=V[ve];if(ye===L)return;oe&&L===le||(L=Math.min(X,Math.max(Q,L)));const[se,de]=$1(A,ie);if(se==null||de==null)return;const xe=ve===ie.length-1?ye-L:L-ye,ke=Od(null,W,se,de,xe,V,j.current,null);if(V!==ke){const ae=k.current;I(ke),Vc(ie,ke,ae)}},[]),H=nse(()=>({activeHandleId:v,collapsePanel:U,direction:r,expandPanel:z,getPanelStyle:R,groupId:m,registerPanel:M,registerResizeHandle:D,resizePanel:F,startDragging:(A,L)=>{if(y(A),ax(L)||ix(L)){const W=Rv(A);w.current={dragHandleRect:W.getBoundingClientRect(),dragOffset:S8(L,A,r),sizes:T.current.sizes}}},stopDragging:()=>{pse(),y(null),w.current=null},unregisterPanel:N}),[v,U,r,z,R,m,M,D,F,N]),G={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return ju(Tv.Provider,{children:ju(p,{children:t,className:n,"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":m,style:{...G,...f}}),value:H})}const p2=h8((e,t)=>ju(P8,{...e,forwardedRef:t}));P8.displayName="PanelGroup";p2.displayName="forwardRef(PanelGroup)";function cx({children:e=null,className:t="",disabled:n=!1,id:r=null,onDragging:o,style:s={},tagName:a="div"}){const l=Is(null),u=Is({onDragging:o});pi(()=>{u.current.onDragging=o});const f=m8(Tv);if(f===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{activeHandleId:p,direction:m,groupId:v,registerResizeHandle:y,startDragging:S,stopDragging:x}=f,w=u2(r),_=p===w,[k,P]=Ld(!1),[I,j]=Ld(null),E=Fi(()=>{l.current.blur(),x();const{onDragging:M}=u.current;M&&M(!1)},[x]);pi(()=>{if(n)j(null);else{const R=y(w);j(()=>R)}},[n,w,y]),pi(()=>{if(n||I==null||!_)return;const R=U=>{I(U)},M=U=>{I(U)},N=l.current.ownerDocument;return N.body.addEventListener("contextmenu",E),N.body.addEventListener("mousemove",R),N.body.addEventListener("touchmove",R),N.body.addEventListener("mouseleave",M),window.addEventListener("mouseup",E),window.addEventListener("touchend",E),()=>{N.body.removeEventListener("contextmenu",E),N.body.removeEventListener("mousemove",R),N.body.removeEventListener("touchmove",R),N.body.removeEventListener("mouseleave",M),window.removeEventListener("mouseup",E),window.removeEventListener("touchend",E)}},[m,n,_,I,E]),cse({disabled:n,handleId:w,resizeHandler:I});const T={cursor:C8(m),touchAction:"none",userSelect:"none"};return ju(a,{children:e,className:t,"data-resize-handle-active":_?"pointer":k?"keyboard":void 0,"data-panel-group-direction":m,"data-panel-group-id":v,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":w,onBlur:()=>P(!1),onFocus:()=>P(!0),onMouseDown:R=>{S(w,R.nativeEvent);const{onDragging:M}=u.current;M&&M(!0)},onMouseUp:E,onTouchCancel:E,onTouchEnd:E,onTouchStart:R=>{S(w,R.nativeEvent);const{onDragging:M}=u.current;M&&M(!0)},ref:l,role:"separator",style:{...T,...s},tabIndex:0})}cx.displayName="PanelResizeHandle";const j8=e=>{const{sx:t}=e,n=ue(),r=q(a=>a.ui.shouldPinParametersPanel),{t:o}=Ce(),s=()=>{n(u7(!r)),n(Bs())};return i.jsx(er,{label:o("common.pinOptionsPanel"),children:i.jsx(Me,{...e,"aria-label":o("common.pinOptionsPanel"),onClick:s,icon:r?i.jsx(bI,{}):i.jsx(wI,{}),variant:"ghost",size:"sm",sx:{color:"base.700",_hover:{color:"base.550"},_active:{color:"base.500"},...t}})})},vse=e=>i.jsx(Ib,{defer:!0,style:{height:"100%",width:"100%"},options:{scrollbars:{visibility:"auto",autoHide:"move",autoHideDelay:1300,theme:"os-theme-dark"},overflow:{x:"hidden"}},children:e.children}),I8=h.memo(vse),yse=Te(po,e=>{const{shouldPinParametersPanel:t,shouldShowParametersPanel:n}=e;return{shouldPinParametersPanel:t,shouldShowParametersPanel:n}}),xse=e=>{const{shouldPinParametersPanel:t,shouldShowParametersPanel:n}=q(yse);return t&&n?i.jsxs(et,{sx:{position:"relative",h:"full",w:i8,flexShrink:0},children:[i.jsx(K,{sx:{gap:2,flexDirection:"column",h:"full",w:"full",position:"absolute"},children:i.jsx(I8,{children:i.jsx(K,{sx:{flexDirection:"column",gap:2},children:e.children})})}),i.jsx(j8,{sx:{position:"absolute",top:0,insetInlineEnd:0}})]}):null},h2=h.memo(xse),bse=({image:e})=>{const t=h.useMemo(()=>{var n,r;if(Ix((n=e.metadata)==null?void 0:n.model))return(r=e.metadata)==null?void 0:r.model},[e.metadata]);return i.jsxs(K,{sx:{pointerEvents:"none",flexDirection:"column",position:"absolute",top:0,insetInlineStart:0,p:2,alignItems:"flex-start",gap:2},children:[i.jsxs(mu,{variant:"solid",colorScheme:"base",children:[e.width," × ",e.height]}),t&&i.jsx(mu,{variant:"solid",colorScheme:"base",children:t})]})},E8=({postUploadAction:e,isDisabled:t})=>{const n=ue(),r=h.useCallback(l=>{const u=l[0];u&&n(t5({file:u,image_category:"user",is_intermediate:!1,postUploadAction:e}))},[n,e]),{getRootProps:o,getInputProps:s,open:a}=fb({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},onDropAccepted:r,disabled:t,noDrag:!0,multiple:!1});return{getUploadButtonProps:o,getUploadInputProps:s,openUploader:a}},wse=e=>{const{image:t,onDrop:n,onReset:r,onError:o,resetIconSize:s="md",withResetIcon:a=!1,withMetadataOverlay:l=!1,isDropDisabled:u=!1,isDragDisabled:f=!1,isUploadDisabled:p=!1,fallback:m=i.jsx(mv,{}),payloadImage:v,minSize:y=24,postUploadAction:S,imageSx:x,fitContainer:w=!1}=e,_=h.useRef(Fl()),{colorMode:k}=fo(),{isOver:P,setNodeRef:I,active:j}=Cg({id:_.current,disabled:u,data:{handleDrop:n}}),{attributes:E,listeners:T,setNodeRef:R,isDragging:M}=r5({id:_.current,data:{image:v||t},disabled:f||!t}),{getUploadButtonProps:D,getUploadInputProps:N}=E8({postUploadAction:S,isDisabled:p}),U=d7(I,R),z=p?{}:{cursor:"pointer",bg:Ae("base.200","base.800")(k),_hover:{bg:Ae("base.300","base.650")(k),color:Ae("base.500","base.300")(k)}};return i.jsxs(K,{sx:{width:"full",height:"full",alignItems:"center",justifyContent:"center",position:"relative",minW:y,minH:y,userSelect:"none",cursor:f||!t?"auto":"grab"},...E,...T,ref:U,children:[t&&i.jsxs(K,{sx:{w:"full",h:"full",position:w?"absolute":"relative",alignItems:"center",justifyContent:"center"},children:[i.jsx(If,{src:t.image_url,fallback:m,onError:o,objectFit:"contain",draggable:!1,sx:{maxW:"full",maxH:"full",borderRadius:"base",...x}}),l&&i.jsx(bse,{image:t}),r&&a&&i.jsx(et,{sx:{position:"absolute",top:0,right:0},children:i.jsx(Me,{size:s,tooltip:"Reset Image","aria-label":"Reset Image",icon:i.jsx(ov,{}),onClick:r})}),i.jsx(Co,{children:j&&i.jsx(Su,{isOver:P})})]}),!t&&i.jsxs(i.Fragment,{children:[i.jsxs(K,{sx:{minH:y,w:"full",h:"full",alignItems:"center",justifyContent:"center",borderRadius:"base",transitionProperty:"common",transitionDuration:"0.1s",color:Ae("base.500","base.500")(k),...z},...D(),children:[i.jsx("input",{...N()}),i.jsx(uo,{as:p?Vf:sv,sx:{boxSize:12}})]}),i.jsx(Co,{children:j&&i.jsx(Su,{isOver:P})})]})]})},Sf=h.memo(wse),Sse=Te([po,pl,pr],(e,t,n)=>{const{shouldShowImageDetails:r,shouldHidePreview:o,shouldShowProgressInViewer:s}=e,{selectedImage:a}=t,{progressImage:l,shouldAntialiasProgressImage:u}=n;return{shouldShowImageDetails:r,shouldHidePreview:o,selectedImage:a,progressImage:l,shouldShowProgressInViewer:s,shouldAntialiasProgressImage:u}},{memoizeOptions:{resultEqualityCheck:Ut}}),Cse=()=>{const{shouldShowImageDetails:e,selectedImage:t,progressImage:n,shouldShowProgressInViewer:r,shouldAntialiasProgressImage:o}=q(Sse),{currentData:s,isLoading:a,isError:l,isSuccess:u}=lc(t??cc.skipToken),f=ue(),p=h.useCallback(m=>{m.image_name!==(s==null?void 0:s.image_name)&&f(Yh(m.image_name))},[f,s==null?void 0:s.image_name]);return i.jsxs(K,{sx:{width:"full",height:"full",alignItems:"center",justifyContent:"center",position:"relative"},children:[n&&r?i.jsx(If,{src:n.dataURL,width:n.width,height:n.height,draggable:!1,sx:{objectFit:"contain",maxWidth:"full",maxHeight:"full",height:"auto",position:"absolute",borderRadius:"base",imageRendering:o?"auto":"pixelated"}}):i.jsx(Sf,{image:s,onDrop:p,fallback:i.jsx(mv,{sx:{bg:"none"}}),isUploadDisabled:!0,fitContainer:!0}),e&&s&&i.jsx(et,{sx:{position:"absolute",top:"0",width:"full",height:"full",borderRadius:"base",overflow:"scroll"},children:i.jsx(UT,{image:s})}),!e&&s&&i.jsx(et,{sx:{position:"absolute",top:"0",width:"full",height:"full",pointerEvents:"none"},children:i.jsx(GT,{})})]})},_se=h.memo(Cse),kse=Te([pr,pl],(e,t)=>{const{progressImage:n}=e;return{hasSelectedImage:!!t.selectedImage,hasProgressImage:!!n}},zn),Pse=()=>{const{hasSelectedImage:e}=q(kse);return i.jsxs(K,{sx:{position:"relative",flexDirection:"column",height:"100%",width:"100%",rowGap:4,alignItems:"center",justifyContent:"center"},children:[e&&i.jsx(WT,{}),i.jsx(_se,{})]})},O8=()=>i.jsx(et,{layerStyle:"first",sx:{position:"relative",width:"100%",height:"100%",p:4,borderRadius:"base"},children:i.jsx(K,{sx:{width:"100%",height:"100%"},children:i.jsx(Pse,{})})}),m2=()=>i.jsxs(K,{gap:2,children:[i.jsx(c2,{}),i.jsx(i2,{})]}),jse=Be((e,t)=>i.jsx(bj,{ref:t,onPaste:s2,...e})),T8=h.memo(jse),Ise=Te([e=>e.generation,Gr],(e,t)=>({prompt:e.positivePrompt,activeTabName:t}),{memoizeOptions:{resultEqualityCheck:Ut}}),g2=()=>{const e=ue(),{prompt:t,activeTabName:n}=q(Ise),r=ho(),o=h.useRef(null),{t:s}=Ce(),a=u=>{e(_h(u.target.value))};nt("alt+a",()=>{var u;(u=o.current)==null||u.focus()},[]);const l=h.useCallback(u=>{u.key==="Enter"&&u.shiftKey===!1&&r&&(u.preventDefault(),e(kx()),e(Px(n)))},[e,n,r]);return i.jsx(et,{children:i.jsx(_n,{children:i.jsx(T8,{id:"prompt",name:"prompt",placeholder:s("parameters.positivePromptPlaceholder"),value:t,onChange:a,onKeyDown:l,resize:"vertical",ref:o,minH:32})})})},v2=()=>{const e=q(r=>r.generation.negativePrompt),t=ue(),{t:n}=Ce();return i.jsx(_n,{children:i.jsx(T8,{id:"negativePrompt",name:"negativePrompt",value:e,onChange:r=>t(kh(r.target.value)),placeholder:n("parameters.negativePromptPlaceholder"),fontSize:"sm",minH:16})})};function Ese(){const e=q(s=>s.generation.seedWeights),t=q(s=>s.generation.shouldGenerateVariations),{t:n}=Ce(),r=ue(),o=s=>r(f7(s.target.value));return i.jsx(lr,{label:n("parameters.seedWeights"),value:e,isInvalid:t&&!(l2(e)||e===""),isDisabled:!t,onChange:o})}function Ose(){const e=q(o=>o.generation.variationAmount),t=q(o=>o.generation.shouldGenerateVariations),{t:n}=Ce(),r=ue();return i.jsx(Tt,{label:n("parameters.variationAmount"),value:e,step:.01,min:0,max:1,isDisabled:!t,onChange:o=>r(hS(o)),handleReset:()=>r(hS(.1)),withInput:!0,withReset:!0,withSliderMarks:!0})}const Tse=e=>{const{label:t,isOpen:n,onToggle:r,children:o,withSwitch:s=!1}=e,{colorMode:a}=fo();return i.jsxs(et,{children:[i.jsxs(K,{onClick:r,sx:{alignItems:"center",p:2,px:4,borderTopRadius:"base",borderBottomRadius:n?0:"base",bg:n?Ae("base.200","base.750")(a):Ae("base.150","base.800")(a),color:Ae("base.900","base.100")(a),_hover:{bg:n?Ae("base.250","base.700")(a):Ae("base.200","base.750")(a)},fontSize:"sm",fontWeight:600,cursor:"pointer",transitionProperty:"common",transitionDuration:"normal",userSelect:"none"},children:[t,i.jsx(ul,{}),s&&i.jsx(Kg,{isChecked:n,pointerEvents:"none"}),!s&&i.jsx(Ab,{sx:{w:"1rem",h:"1rem",transform:n?"rotate(0deg)":"rotate(180deg)",transitionProperty:"common",transitionDuration:"normal"}})]}),i.jsx(Ig,{in:n,animateOpacity:!0,style:{overflow:"unset"},children:i.jsx(et,{sx:{p:4,borderBottomRadius:"base",bg:Ae("base.100","base.800")(a)},children:o})})]})},Vs=h.memo(Tse),Rse=()=>{const{t:e}=Ce(),t=q(s=>s.generation.shouldGenerateVariations),n=so("variation").isFeatureEnabled,r=ue(),o=()=>r(p7(!t));return n?i.jsx(Vs,{label:e("parameters.variations"),isOpen:t,onToggle:o,withSwitch:!0,children:i.jsxs(K,{sx:{gap:2,flexDirection:"column"},children:[i.jsx(Ose,{}),i.jsx(Ese,{})]})}):null},y2=h.memo(Rse);function Mse(){const e=ue(),t=q(r=>r.generation.perlin),{t:n}=Ce();return i.jsx(Tt,{label:n("parameters.perlinNoise"),min:0,max:1,step:.05,onChange:r=>e(mS(r)),handleReset:()=>e(mS(0)),value:t,withInput:!0,withReset:!0,withSliderMarks:!0})}function Dse(){const e=ue(),t=q(r=>r.generation.threshold),{t:n}=Ce();return i.jsx(Tt,{label:n("parameters.noiseThreshold"),min:0,max:20,step:.1,onChange:r=>e(gS(r)),handleReset:()=>e(gS(0)),value:t,withInput:!0,withReset:!0,withSliderMarks:!0})}const Ase=()=>{const{t:e}=Ce(),t=so("noise").isFeatureEnabled,n=q(s=>s.generation.shouldUseNoiseSettings),r=ue(),o=()=>r(h7(!n));return t?i.jsx(Vs,{label:e("parameters.noiseSettings"),isOpen:n,onToggle:o,withSwitch:!0,children:i.jsxs(K,{sx:{gap:2,flexDirection:"column"},children:[i.jsx(Mse,{}),i.jsx(Dse,{})]})}):null},R8=h.memo(Ase);function Nse(){const e=q(o=>o.generation.horizontalSymmetrySteps),t=q(o=>o.generation.steps),n=ue(),{t:r}=Ce();return i.jsx(Tt,{label:r("parameters.hSymmetryStep"),value:e,onChange:o=>n(vS(o)),min:0,max:t,step:1,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>n(vS(0))})}function zse(){const e=q(o=>o.generation.verticalSymmetrySteps),t=q(o=>o.generation.steps),n=ue(),{t:r}=Ce();return i.jsx(Tt,{label:r("parameters.vSymmetryStep"),value:e,onChange:o=>n(yS(o)),min:0,max:t,step:1,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>n(yS(0))})}const $se=()=>{const{t:e}=Ce(),t=q(s=>s.generation.shouldUseSymmetry),n=so("symmetry").isFeatureEnabled,r=ue(),o=()=>r(m7(!t));return n?i.jsx(Vs,{label:e("parameters.symmetry"),isOpen:t,onToggle:o,withSwitch:!0,children:i.jsxs(K,{sx:{gap:2,flexDirection:"column"},children:[i.jsx(Nse,{}),i.jsx(zse,{})]})}):null},x2=h.memo($se),Lse=Te([IE],({hiresFix:e,hiresStrength:t})=>({hiresFix:e,hiresStrength:t}),{memoizeOptions:{resultEqualityCheck:Ut}}),Bse=()=>{const{hiresFix:e,hiresStrength:t}=q(Lse),n=ue(),{t:r}=Ce(),o=a=>{n(xS(a))},s=()=>{n(xS(.75))};return i.jsx(Tt,{label:r("parameters.hiresStrength"),step:.01,min:.01,max:.99,onChange:o,value:t,isInteger:!1,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:s,isDisabled:!e})},Fse=()=>{const{t:e}=Ce(),t=q(s=>s.postprocessing.hiresFix),n=so("hires").isFeatureEnabled,r=ue(),o=()=>r(g7(!t));return n?i.jsx(Vs,{label:e("parameters.hiresOptim"),isOpen:t,onToggle:o,withSwitch:!0,children:i.jsx(K,{sx:{gap:2,flexDirection:"column"},children:i.jsx(Bse,{})})}):null},Hse=h.memo(Fse),Vse=Te($o,e=>{const{seamlessXAxis:t}=e;return{seamlessXAxis:t}},zn),Wse=()=>{const{t:e}=Ce(),{seamlessXAxis:t}=q(Vse),n=ue(),r=h.useCallback(o=>{n(v7(o.target.checked))},[n]);return i.jsx(Br,{label:e("parameters.seamlessXAxis"),"aria-label":e("parameters.seamlessXAxis"),isChecked:t,onChange:r})},Use=h.memo(Wse),Gse=Te($o,e=>{const{seamlessYAxis:t}=e;return{seamlessYAxis:t}},zn),qse=()=>{const{t:e}=Ce(),{seamlessYAxis:t}=q(Gse),n=ue(),r=h.useCallback(o=>{n(y7(o.target.checked))},[n]);return i.jsx(Br,{label:e("parameters.seamlessYAxis"),"aria-label":e("parameters.seamlessYAxis"),isChecked:t,onChange:r})},Yse=h.memo(qse),Kse=Te($o,e=>{const{shouldUseSeamless:t,seamlessXAxis:n,seamlessYAxis:r}=e;return{shouldUseSeamless:t,seamlessXAxis:n,seamlessYAxis:r}},zn),Xse=()=>{const{t:e}=Ce(),{shouldUseSeamless:t}=q(Kse),n=so("seamless").isFeatureEnabled,r=ue(),o=()=>r(x7(!t));return n?i.jsx(Vs,{label:e("parameters.seamlessTiling"),isOpen:t,onToggle:o,withSwitch:!0,children:i.jsxs(K,{sx:{gap:5},children:[i.jsx(et,{flexGrow:1,children:i.jsx(Use,{})}),i.jsx(et,{flexGrow:1,children:i.jsx(Yse,{})})]})}):null},M8=h.memo(Xse),Zse=Te([kg],e=>{const{initial:t,min:n,sliderMax:r,inputMax:o,fineStep:s,coarseStep:a}=e.config.sd.iterations,{iterations:l}=e.generation,{shouldUseSliders:u}=e.ui,f=e.dynamicPrompts.isEnabled&&e.dynamicPrompts.combinatorial,p=e.hotkeys.shift?s:a;return{iterations:l,initial:t,min:n,sliderMax:r,inputMax:o,step:p,shouldUseSliders:u,isDisabled:f}}),Qse=()=>{const{iterations:e,initial:t,min:n,sliderMax:r,inputMax:o,step:s,shouldUseSliders:a,isDisabled:l}=q(Zse),u=ue(),{t:f}=Ce(),p=h.useCallback(v=>{u(bS(v))},[u]),m=h.useCallback(()=>{u(bS(t))},[u,t]);return a?i.jsx(Tt,{isDisabled:l,label:f("parameters.images"),step:s,min:n,max:r,onChange:p,handleReset:m,value:e,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:o}}):i.jsx(cl,{isDisabled:l,label:f("parameters.images"),step:s,min:n,max:o,onChange:p,value:e,numberInputFieldProps:{textAlign:"center"}})},Iu=h.memo(Qse),Jse=Te([$o,Qa,po,Ef],(e,t,n,r)=>{const{initial:o,min:s,sliderMax:a,inputMax:l,fineStep:u,coarseStep:f}=t.sd.steps,{steps:p}=e,{shouldUseSliders:m}=n,v=r.shift?u:f;return{steps:p,initial:o,min:s,sliderMax:a,inputMax:l,step:v,shouldUseSliders:m}}),eae=()=>{const{steps:e,initial:t,min:n,sliderMax:r,inputMax:o,step:s,shouldUseSliders:a}=q(Jse),l=ue(),{t:u}=Ce(),f=h.useCallback(v=>{l(Vh(v))},[l]),p=h.useCallback(()=>{l(Vh(t))},[l,t]),m=h.useCallback(()=>{l(kx())},[l]);return a?i.jsx(Tt,{label:u("parameters.steps"),min:n,max:r,step:s,onChange:f,handleReset:p,value:e,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:o}}):i.jsx(cl,{label:u("parameters.steps"),min:n,max:o,step:s,onChange:f,value:e,numberInputFieldProps:{textAlign:"center"},onBlur:m})},Eu=h.memo(eae),tae=Te([$o,Qa,po,Ef],(e,t,n,r)=>{const{initial:o,min:s,sliderMax:a,inputMax:l}=t.sd.guidance,{cfgScale:u}=e,{shouldUseSliders:f}=n,{shift:p}=r;return{cfgScale:u,initial:o,min:s,sliderMax:a,inputMax:l,shouldUseSliders:f,shift:p}}),nae=()=>{const{cfgScale:e,initial:t,min:n,sliderMax:r,inputMax:o,shouldUseSliders:s,shift:a}=q(tae),l=ue(),{t:u}=Ce(),f=h.useCallback(m=>l(Hh(m)),[l]),p=h.useCallback(()=>l(Hh(t)),[l,t]);return s?i.jsx(Tt,{label:u("parameters.cfgScale"),step:a?.1:.5,min:n,max:r,onChange:f,handleReset:p,value:e,sliderNumberInputProps:{max:o},withInput:!0,withReset:!0,withSliderMarks:!0,isInteger:!1}):i.jsx(cl,{label:u("parameters.cfgScale"),step:.5,min:n,max:o,onChange:f,value:e,isInteger:!1,numberInputFieldProps:{textAlign:"center"}})},Ou=h.memo(nae),rae=Te([$o,Ef,Qa],(e,t,n)=>{const{initial:r,min:o,sliderMax:s,inputMax:a,fineStep:l,coarseStep:u}=n.sd.width,{width:f}=e,p=t.shift?l:u;return{width:f,initial:r,min:o,sliderMax:s,inputMax:a,step:p}}),oae=e=>{const{width:t,initial:n,min:r,sliderMax:o,inputMax:s,step:a}=q(rae),l=ue(),{t:u}=Ce(),f=h.useCallback(m=>{l(Wh(m))},[l]),p=h.useCallback(()=>{l(Wh(n))},[l,n]);return i.jsx(Tt,{label:u("parameters.width"),value:t,min:r,step:a,max:o,onChange:f,handleReset:p,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:s},...e})},gg=h.memo(oae),sae=Te([$o,Ef,Qa],(e,t,n)=>{const{initial:r,min:o,sliderMax:s,inputMax:a,fineStep:l,coarseStep:u}=n.sd.height,{height:f}=e,p=t.shift?l:u;return{height:f,initial:r,min:o,sliderMax:s,inputMax:a,step:p}}),aae=e=>{const{height:t,initial:n,min:r,sliderMax:o,inputMax:s,step:a}=q(sae),l=ue(),{t:u}=Ce(),f=h.useCallback(m=>{l(Uh(m))},[l]),p=h.useCallback(()=>{l(Uh(n))},[l,n]);return i.jsx(Tt,{label:u("parameters.height"),value:t,min:r,step:a,max:o,onChange:f,handleReset:p,withInput:!0,withReset:!0,withSliderMarks:!0,sliderNumberInputProps:{max:s},...e})},vg=h.memo(aae),g3=b7({selectId:e=>D8(e),sortComparer:(e,t)=>e.name.localeCompare(t.name)}),D8=({base_model:e,type:t,name:n})=>`${e}/${t}/${n}`,iae=l5.injectEndpoints({endpoints:e=>({listModels:e.query({query:t=>({url:"models/",params:t}),providesTags:(t,n,r)=>{const o=[{id:"Model",type:S7}];return t&&o.push(...t.ids.map(s=>({type:"Model",id:s}))),o},transformResponse:(t,n,r)=>g3.setAll(g3.getInitialState(),w7(t.models,D8))})})}),{useListModelsQuery:Al}=iae,ux={"sd-1":"Stable Diffusion 1.x","sd-2":"Stable Diffusion 2.x"},lae=()=>{const e=ue(),{t}=Ce(),n=q(l=>l.generation.model),{data:r}=Al({model_type:"main"}),o=h.useMemo(()=>{if(!r)return[];const l=[];return _x(r.entities,(u,f)=>{u&&l.push({value:f,label:u.name,group:ux[u.base_model]})}),l},[r]),s=h.useMemo(()=>r==null?void 0:r.entities[n],[r==null?void 0:r.entities,n]),a=h.useCallback(l=>{l&&e(q1(l))},[e]);return h.useEffect(()=>{if(n&&(r!=null&&r.ids.includes(n)))return;const l=r==null?void 0:r.ids[0];Ix(l)&&a(l)},[a,r==null?void 0:r.ids,n]),i.jsx(Zo,{tooltip:s==null?void 0:s.description,label:t("modelManager.model"),value:n,placeholder:"Pick one",data:o,onChange:a})},cae=h.memo(lae),uae=Te([po,$o],(e,t)=>{const{scheduler:n}=t,{favoriteSchedulers:r}=e,o=x5.map(s=>({value:s,label:b5[s],group:r.includes(s)?"Favorites":void 0})).sort((s,a)=>s.label.localeCompare(a.label));return{scheduler:n,data:o}},zn),dae=()=>{const e=ue(),{t}=Ce(),{scheduler:n,data:r}=q(uae),o=h.useCallback(s=>{s&&e(Y1(s))},[e]);return i.jsx(Zo,{label:t("parameters.scheduler"),value:n,data:r,onChange:o})},fae=h.memo(dae),pae=()=>i.jsxs(K,{gap:3,w:"full",children:[i.jsx(et,{w:"25rem",children:i.jsx(fae,{})}),i.jsx(et,{w:"full",children:i.jsx(cae,{})})]}),Tu=h.memo(pae);function hae(){const e=q(a=>a.generation.seed),t=q(a=>a.generation.shouldRandomizeSeed),n=q(a=>a.generation.shouldGenerateVariations),{t:r}=Ce(),o=ue(),s=a=>o(Fh(a));return i.jsx(cl,{label:r("parameters.seed"),step:1,precision:0,flexGrow:1,min:w5,max:yx,isDisabled:t,isInvalid:e<0&&n,onChange:s,value:e,formControlProps:{display:"flex",alignItems:"center",gap:3}})}const mae=(e,t)=>Math.floor(Math.random()*(t-e+1)+e);function gae(){const e=ue(),t=q(o=>o.generation.shouldRandomizeSeed),{t:n}=Ce(),r=()=>e(Fh(mae(w5,yx)));return i.jsx(Me,{size:"sm",isDisabled:t,"aria-label":n("parameters.shuffle"),tooltip:n("parameters.shuffle"),onClick:r,icon:i.jsx(lU,{})})}const vae=()=>{const e=ue(),{t}=Ce(),n=q(o=>o.generation.shouldRandomizeSeed),r=o=>e(C7(o.target.checked));return i.jsx(Br,{label:t("common.random"),isChecked:n,onChange:r})},yae=h.memo(vae),xae=()=>i.jsxs(K,{sx:{gap:4,alignItems:"center"},children:[i.jsx(hae,{}),i.jsx(gae,{}),i.jsx(yae,{})]}),Ru=h.memo(xae),bae=Te(po,e=>{const{shouldUseSliders:t}=e;return{shouldUseSliders:t}},zn),wae=()=>{const{shouldUseSliders:e}=q(bae),{isOpen:t,onToggle:n}=us({defaultIsOpen:!0});return i.jsx(Vs,{label:"General",isOpen:t,onToggle:n,children:i.jsx(K,{sx:{flexDirection:"column",gap:3},children:e?i.jsxs(i.Fragment,{children:[i.jsx(Tu,{}),i.jsx(et,{pt:2,children:i.jsx(Ru,{})}),i.jsx(Iu,{}),i.jsx(Eu,{}),i.jsx(Ou,{}),i.jsx(gg,{}),i.jsx(vg,{})]}):i.jsxs(i.Fragment,{children:[i.jsxs(K,{gap:3,children:[i.jsx(Iu,{}),i.jsx(Eu,{}),i.jsx(Ou,{})]}),i.jsx(Tu,{}),i.jsx(et,{pt:2,children:i.jsx(Ru,{})}),i.jsx(gg,{}),i.jsx(vg,{})]})})})},Sae=h.memo(wae),Cae=Te(Qa,e=>qa(_7,n=>({label:n.label,value:n.type})).filter(n=>!e.sd.disabledControlNetModels.includes(n.value))),_ae=e=>{const{controlNetId:t,model:n}=e,r=q(Cae),o=ue(),s=ho(),a=h.useCallback(l=>{o(k7({controlNetId:t,model:l}))},[t,o]);return i.jsx(Zo,{data:r,value:n,onChange:a,disabled:!s,tooltip:n})},kae=h.memo(_ae),Pae=e=>{const{controlNetId:t,weight:n,mini:r=!1}=e,o=ue(),s=h.useCallback(a=>{o(P7({controlNetId:t,weight:a}))},[t,o]);return i.jsx(Tt,{label:"Weight",sliderFormLabelProps:{pb:2},value:n,onChange:s,min:-1,max:1,step:.01,withSliderMarks:!r,sliderMarks:[-1,0,1]})},jae=h.memo(Pae),Iae=Te(S5,e=>{const{pendingControlImages:t}=e;return{pendingControlImages:t}},zn),Eae=e=>{const{height:t}=e,{controlNetId:n,controlImage:r,processedControlImage:o,processorType:s}=e.controlNet,a=ue(),{pendingControlImages:l}=q(Iae),[u,f]=h.useState(!1),{currentData:p,isLoading:m,isError:v,isSuccess:y}=lc(r??cc.skipToken),{currentData:S,isLoading:x,isError:w,isSuccess:_}=lc(o??cc.skipToken),k=h.useCallback(T=>{r!==T.image_name&&(f(!1),a(wS({controlNetId:n,controlImage:T.image_name})))},[r,n,a]),P=h.useCallback(()=>{a(wS({controlNetId:n,controlImage:null}))},[n,a]),I=h.useCallback(()=>{f(!0)},[]),j=h.useCallback(()=>{f(!1)},[]),E=p&&S&&!u&&!l.includes(n)&&s!=="none";return i.jsxs(K,{onMouseEnter:I,onMouseLeave:j,sx:{position:"relative",w:"full",h:t,alignItems:"center",justifyContent:"center"},children:[i.jsx(Sf,{image:p,onDrop:k,isDropDisabled:E,postUploadAction:{type:"SET_CONTROLNET_IMAGE",controlNetId:n},imageSx:{w:"full",h:"full"}}),i.jsx(et,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full",opacity:E?1:0,transitionProperty:"common",transitionDuration:"normal",pointerEvents:"none"},children:i.jsx(Sf,{image:S,onDrop:k,payloadImage:p,isUploadDisabled:!0,imageSx:{w:"full",h:"full"}})}),l.includes(n)&&i.jsx(et,{sx:{position:"absolute",top:0,insetInlineStart:0,w:"full",h:"full"},children:i.jsx(mv,{})}),p&&i.jsx(K,{sx:{position:"absolute",top:0,insetInlineEnd:0},children:i.jsx(Me,{"aria-label":"Reset Control Image",tooltip:"Reset Control Image",size:"sm",onClick:P,icon:i.jsx(ov,{}),variant:"link",sx:{p:2,color:"base.50"}})})]})},v3=h.memo(Eae),ka=()=>{const e=ue();return h.useCallback((n,r)=>{e(j7({controlNetId:n,changes:r}))},[e])};function Pa(e){return i.jsx(K,{sx:{flexDirection:"column",gap:2},children:e.children})}const y3=Fs.canny_image_processor.default,Oae=e=>{const{controlNetId:t,processorNode:n}=e,{low_threshold:r,high_threshold:o}=n,s=ho(),a=ka(),l=h.useCallback(m=>{a(t,{low_threshold:m})},[t,a]),u=h.useCallback(()=>{a(t,{low_threshold:y3.low_threshold})},[t,a]),f=h.useCallback(m=>{a(t,{high_threshold:m})},[t,a]),p=h.useCallback(()=>{a(t,{high_threshold:y3.high_threshold})},[t,a]);return i.jsxs(Pa,{children:[i.jsx(Tt,{isDisabled:!s,label:"Low Threshold",value:r,onChange:l,handleReset:u,withReset:!0,min:0,max:255,withInput:!0,withSliderMarks:!0}),i.jsx(Tt,{isDisabled:!s,label:"High Threshold",value:o,onChange:f,handleReset:p,withReset:!0,min:0,max:255,withInput:!0,withSliderMarks:!0})]})},Tae=h.memo(Oae),x3=Fs.hed_image_processor.default,Rae=e=>{const{controlNetId:t,processorNode:{detect_resolution:n,image_resolution:r,scribble:o}}=e,s=ho(),a=ka(),l=h.useCallback(v=>{a(t,{detect_resolution:v})},[t,a]),u=h.useCallback(v=>{a(t,{image_resolution:v})},[t,a]),f=h.useCallback(v=>{a(t,{scribble:v.target.checked})},[t,a]),p=h.useCallback(()=>{a(t,{detect_resolution:x3.detect_resolution})},[t,a]),m=h.useCallback(()=>{a(t,{image_resolution:x3.image_resolution})},[t,a]);return i.jsxs(Pa,{children:[i.jsx(Tt,{label:"Detect Resolution",value:n,onChange:l,handleReset:p,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!s}),i.jsx(Tt,{label:"Image Resolution",value:r,onChange:u,handleReset:m,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!s}),i.jsx(Br,{label:"Scribble",isChecked:o,onChange:f,isDisabled:!s})]})},Mae=h.memo(Rae),b3=Fs.lineart_image_processor.default,Dae=e=>{const{controlNetId:t,processorNode:n}=e,{image_resolution:r,detect_resolution:o,coarse:s}=n,a=ka(),l=ho(),u=h.useCallback(y=>{a(t,{detect_resolution:y})},[t,a]),f=h.useCallback(y=>{a(t,{image_resolution:y})},[t,a]),p=h.useCallback(()=>{a(t,{detect_resolution:b3.detect_resolution})},[t,a]),m=h.useCallback(()=>{a(t,{image_resolution:b3.image_resolution})},[t,a]),v=h.useCallback(y=>{a(t,{coarse:y.target.checked})},[t,a]);return i.jsxs(Pa,{children:[i.jsx(Tt,{label:"Detect Resolution",value:o,onChange:u,handleReset:p,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!l}),i.jsx(Tt,{label:"Image Resolution",value:r,onChange:f,handleReset:m,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!l}),i.jsx(Br,{label:"Coarse",isChecked:s,onChange:v,isDisabled:!l})]})},Aae=h.memo(Dae),w3=Fs.lineart_anime_image_processor.default,Nae=e=>{const{controlNetId:t,processorNode:n}=e,{image_resolution:r,detect_resolution:o}=n,s=ka(),a=ho(),l=h.useCallback(m=>{s(t,{detect_resolution:m})},[t,s]),u=h.useCallback(m=>{s(t,{image_resolution:m})},[t,s]),f=h.useCallback(()=>{s(t,{detect_resolution:w3.detect_resolution})},[t,s]),p=h.useCallback(()=>{s(t,{image_resolution:w3.image_resolution})},[t,s]);return i.jsxs(Pa,{children:[i.jsx(Tt,{label:"Detect Resolution",value:o,onChange:l,handleReset:f,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!a}),i.jsx(Tt,{label:"Image Resolution",value:r,onChange:u,handleReset:p,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!a})]})},zae=h.memo(Nae),Sd=Fs.content_shuffle_image_processor.default,$ae=e=>{const{controlNetId:t,processorNode:n}=e,{image_resolution:r,detect_resolution:o,w:s,h:a,f:l}=n,u=ka(),f=ho(),p=h.useCallback(I=>{u(t,{detect_resolution:I})},[t,u]),m=h.useCallback(()=>{u(t,{detect_resolution:Sd.detect_resolution})},[t,u]),v=h.useCallback(I=>{u(t,{image_resolution:I})},[t,u]),y=h.useCallback(()=>{u(t,{image_resolution:Sd.image_resolution})},[t,u]),S=h.useCallback(I=>{u(t,{w:I})},[t,u]),x=h.useCallback(()=>{u(t,{w:Sd.w})},[t,u]),w=h.useCallback(I=>{u(t,{h:I})},[t,u]),_=h.useCallback(()=>{u(t,{h:Sd.h})},[t,u]),k=h.useCallback(I=>{u(t,{f:I})},[t,u]),P=h.useCallback(()=>{u(t,{f:Sd.f})},[t,u]);return i.jsxs(Pa,{children:[i.jsx(Tt,{label:"Detect Resolution",value:o,onChange:p,handleReset:m,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!f}),i.jsx(Tt,{label:"Image Resolution",value:r,onChange:v,handleReset:y,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!f}),i.jsx(Tt,{label:"W",value:s,onChange:S,handleReset:x,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!f}),i.jsx(Tt,{label:"H",value:a,onChange:w,handleReset:_,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!f}),i.jsx(Tt,{label:"F",value:l,onChange:k,handleReset:P,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!f})]})},Lae=h.memo($ae),S3=Fs.mediapipe_face_processor.default,Bae=e=>{const{controlNetId:t,processorNode:n}=e,{max_faces:r,min_confidence:o}=n,s=ka(),a=ho(),l=h.useCallback(m=>{s(t,{max_faces:m})},[t,s]),u=h.useCallback(m=>{s(t,{min_confidence:m})},[t,s]),f=h.useCallback(()=>{s(t,{max_faces:S3.max_faces})},[t,s]),p=h.useCallback(()=>{s(t,{min_confidence:S3.min_confidence})},[t,s]);return i.jsxs(Pa,{children:[i.jsx(Tt,{label:"Max Faces",value:r,onChange:l,handleReset:f,withReset:!0,min:1,max:20,withInput:!0,withSliderMarks:!0,isDisabled:!a}),i.jsx(Tt,{label:"Min Confidence",value:o,onChange:u,handleReset:p,withReset:!0,min:0,max:1,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:!a})]})},Fae=h.memo(Bae),C3=Fs.midas_depth_image_processor.default,Hae=e=>{const{controlNetId:t,processorNode:n}=e,{a_mult:r,bg_th:o}=n,s=ka(),a=ho(),l=h.useCallback(m=>{s(t,{a_mult:m})},[t,s]),u=h.useCallback(m=>{s(t,{bg_th:m})},[t,s]),f=h.useCallback(()=>{s(t,{a_mult:C3.a_mult})},[t,s]),p=h.useCallback(()=>{s(t,{bg_th:C3.bg_th})},[t,s]);return i.jsxs(Pa,{children:[i.jsx(Tt,{label:"a_mult",value:r,onChange:l,handleReset:f,withReset:!0,min:0,max:20,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:!a}),i.jsx(Tt,{label:"bg_th",value:o,onChange:u,handleReset:p,withReset:!0,min:0,max:20,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:!a})]})},Vae=h.memo(Hae),Ch=Fs.mlsd_image_processor.default,Wae=e=>{const{controlNetId:t,processorNode:n}=e,{image_resolution:r,detect_resolution:o,thr_d:s,thr_v:a}=n,l=ka(),u=ho(),f=h.useCallback(_=>{l(t,{detect_resolution:_})},[t,l]),p=h.useCallback(_=>{l(t,{image_resolution:_})},[t,l]),m=h.useCallback(_=>{l(t,{thr_d:_})},[t,l]),v=h.useCallback(_=>{l(t,{thr_v:_})},[t,l]),y=h.useCallback(()=>{l(t,{detect_resolution:Ch.detect_resolution})},[t,l]),S=h.useCallback(()=>{l(t,{image_resolution:Ch.image_resolution})},[t,l]),x=h.useCallback(()=>{l(t,{thr_d:Ch.thr_d})},[t,l]),w=h.useCallback(()=>{l(t,{thr_v:Ch.thr_v})},[t,l]);return i.jsxs(Pa,{children:[i.jsx(Tt,{label:"Detect Resolution",value:o,onChange:f,handleReset:y,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!u}),i.jsx(Tt,{label:"Image Resolution",value:r,onChange:p,handleReset:S,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!u}),i.jsx(Tt,{label:"W",value:s,onChange:m,handleReset:x,withReset:!0,min:0,max:1,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:!u}),i.jsx(Tt,{label:"H",value:a,onChange:v,handleReset:w,withReset:!0,min:0,max:1,step:.01,withInput:!0,withSliderMarks:!0,isDisabled:!u})]})},Uae=h.memo(Wae),_3=Fs.normalbae_image_processor.default,Gae=e=>{const{controlNetId:t,processorNode:n}=e,{image_resolution:r,detect_resolution:o}=n,s=ka(),a=ho(),l=h.useCallback(m=>{s(t,{detect_resolution:m})},[t,s]),u=h.useCallback(m=>{s(t,{image_resolution:m})},[t,s]),f=h.useCallback(()=>{s(t,{detect_resolution:_3.detect_resolution})},[t,s]),p=h.useCallback(()=>{s(t,{image_resolution:_3.image_resolution})},[t,s]);return i.jsxs(Pa,{children:[i.jsx(Tt,{label:"Detect Resolution",value:o,onChange:l,handleReset:f,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!a}),i.jsx(Tt,{label:"Image Resolution",value:r,onChange:u,handleReset:p,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!a})]})},qae=h.memo(Gae),k3=Fs.openpose_image_processor.default,Yae=e=>{const{controlNetId:t,processorNode:n}=e,{image_resolution:r,detect_resolution:o,hand_and_face:s}=n,a=ka(),l=ho(),u=h.useCallback(y=>{a(t,{detect_resolution:y})},[t,a]),f=h.useCallback(y=>{a(t,{image_resolution:y})},[t,a]),p=h.useCallback(()=>{a(t,{detect_resolution:k3.detect_resolution})},[t,a]),m=h.useCallback(()=>{a(t,{image_resolution:k3.image_resolution})},[t,a]),v=h.useCallback(y=>{a(t,{hand_and_face:y.target.checked})},[t,a]);return i.jsxs(Pa,{children:[i.jsx(Tt,{label:"Detect Resolution",value:o,onChange:u,handleReset:p,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!l}),i.jsx(Tt,{label:"Image Resolution",value:r,onChange:f,handleReset:m,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!l}),i.jsx(Br,{label:"Hand and Face",isChecked:s,onChange:v,isDisabled:!l})]})},Kae=h.memo(Yae),P3=Fs.pidi_image_processor.default,Xae=e=>{const{controlNetId:t,processorNode:n}=e,{image_resolution:r,detect_resolution:o,scribble:s,safe:a}=n,l=ka(),u=ho(),f=h.useCallback(x=>{l(t,{detect_resolution:x})},[t,l]),p=h.useCallback(x=>{l(t,{image_resolution:x})},[t,l]),m=h.useCallback(()=>{l(t,{detect_resolution:P3.detect_resolution})},[t,l]),v=h.useCallback(()=>{l(t,{image_resolution:P3.image_resolution})},[t,l]),y=h.useCallback(x=>{l(t,{scribble:x.target.checked})},[t,l]),S=h.useCallback(x=>{l(t,{safe:x.target.checked})},[t,l]);return i.jsxs(Pa,{children:[i.jsx(Tt,{label:"Detect Resolution",value:o,onChange:f,handleReset:m,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!u}),i.jsx(Tt,{label:"Image Resolution",value:r,onChange:p,handleReset:v,withReset:!0,min:0,max:4096,withInput:!0,withSliderMarks:!0,isDisabled:!u}),i.jsx(Br,{label:"Scribble",isChecked:s,onChange:y}),i.jsx(Br,{label:"Safe",isChecked:a,onChange:S,isDisabled:!u})]})},Zae=h.memo(Xae),Qae=e=>null,Jae=h.memo(Qae),eie=e=>{const{controlNetId:t,processorNode:n}=e;return n.type==="canny_image_processor"?i.jsx(Tae,{controlNetId:t,processorNode:n}):n.type==="hed_image_processor"?i.jsx(Mae,{controlNetId:t,processorNode:n}):n.type==="lineart_image_processor"?i.jsx(Aae,{controlNetId:t,processorNode:n}):n.type==="content_shuffle_image_processor"?i.jsx(Lae,{controlNetId:t,processorNode:n}):n.type==="lineart_anime_image_processor"?i.jsx(zae,{controlNetId:t,processorNode:n}):n.type==="mediapipe_face_processor"?i.jsx(Fae,{controlNetId:t,processorNode:n}):n.type==="midas_depth_image_processor"?i.jsx(Vae,{controlNetId:t,processorNode:n}):n.type==="mlsd_image_processor"?i.jsx(Uae,{controlNetId:t,processorNode:n}):n.type==="normalbae_image_processor"?i.jsx(qae,{controlNetId:t,processorNode:n}):n.type==="openpose_image_processor"?i.jsx(Kae,{controlNetId:t,processorNode:n}):n.type==="pidi_image_processor"?i.jsx(Zae,{controlNetId:t,processorNode:n}):n.type==="zoe_depth_image_processor"?i.jsx(Jae,{controlNetId:t,processorNode:n}):null},tie=h.memo(eie),nie=e=>{const{controlNetId:t,shouldAutoConfig:n}=e,r=ue(),o=ho(),s=h.useCallback(()=>{r(I7({controlNetId:t}))},[t,r]);return i.jsx(Br,{label:"Auto configure processor","aria-label":"Auto configure processor",isChecked:n,onChange:s,isDisabled:!o})},rie=h.memo(nie),F1={mt:1.5,fontSize:"2xs",fontWeight:"500",color:"base.400"},j3=e=>`${Math.round(e*100)}%`,oie=e=>{const{controlNetId:t,beginStepPct:n,mini:r=!1,endStepPct:o}=e,s=ue();Ce();const a=h.useCallback(l=>{s(SS({controlNetId:t,beginStepPct:l[0]})),s(CS({controlNetId:t,endStepPct:l[1]}))},[t,s]);return h.useCallback(()=>{s(SS({controlNetId:t,beginStepPct:0})),s(CS({controlNetId:t,endStepPct:1}))},[t,s]),i.jsxs(_n,{children:[i.jsx(jn,{children:"Begin / End Step Percentage"}),i.jsx(aa,{w:"100%",gap:2,alignItems:"center",children:i.jsxs(aj,{"aria-label":["Begin Step %","End Step %"],value:[n,o],onChange:a,min:0,max:1,step:.01,minStepsBetweenThumbs:5,children:[i.jsx(ij,{children:i.jsx(lj,{})}),i.jsx(er,{label:j3(n),placement:"top",hasArrow:!0,children:i.jsx(vy,{index:0})}),i.jsx(er,{label:j3(o),placement:"top",hasArrow:!0,children:i.jsx(vy,{index:1})}),!r&&i.jsxs(i.Fragment,{children:[i.jsx(Rh,{value:0,sx:{insetInlineStart:"0 !important",insetInlineEnd:"unset !important",...F1},children:"0%"}),i.jsx(Rh,{value:.5,sx:{...F1},children:"50%"}),i.jsx(Rh,{value:1,sx:{insetInlineStart:"unset !important",insetInlineEnd:"0 !important",...F1},children:"100%"})]})]})})]})},sie=h.memo(oie),aie=[{label:"Balanced",value:"balanced"},{label:"Prompt",value:"more_prompt"},{label:"Control",value:"more_control"},{label:"Mega Control",value:"unbalanced"}];function iie(e){const{controlNetId:t,controlMode:n=!1}=e,r=ue(),{t:o}=Ce(),s=h.useCallback(a=>{r(E7({controlNetId:t,controlMode:a}))},[t,r]);return i.jsx(Zo,{label:o("parameters.controlNetControlMode"),data:aie,value:String(n),onChange:s})}const lie=Te(Qa,e=>qa(Fs,n=>({value:n.type,label:n.label})).sort((n,r)=>n.value==="none"?-1:r.value==="none"?1:n.label.localeCompare(r.label)).filter(n=>!e.sd.disabledControlNetProcessors.includes(n.value)),zn),cie=e=>{const{controlNetId:t,processorNode:n}=e,r=ue(),o=ho(),s=q(lie),a=h.useCallback(l=>{r(O7({controlNetId:t,processorType:l}))},[t,r]);return i.jsx(Zo,{label:"Processor",value:n.type??"canny_image_processor",data:s,onChange:a,disabled:!o})},uie=h.memo(cie),die=e=>{const{controlNetId:t,isEnabled:n,model:r,weight:o,beginStepPct:s,endStepPct:a,controlMode:l,controlImage:u,processedControlImage:f,processorNode:p,processorType:m,shouldAutoConfig:v}=e.controlNet,y=ue(),[S,x]=Dre(!1),{colorMode:w}=fo(),_=h.useCallback(()=>{y(T7({controlNetId:t}))},[t,y]),k=h.useCallback(()=>{y(C5({controlNetId:Fl(),controlNet:e.controlNet}))},[y,e.controlNet]),P=h.useCallback(()=>{y(R7({controlNetId:t}))},[t,y]);return i.jsxs(K,{sx:{flexDir:"column",gap:2,p:3,bg:Ae("base.200","base.850")(w),borderRadius:"base",position:"relative"},children:[i.jsxs(K,{sx:{gap:2},children:[i.jsx(Br,{tooltip:"Toggle","aria-label":"Toggle",isChecked:n,onChange:P}),i.jsx(et,{sx:{w:"full",minW:0,opacity:n?1:.5,pointerEvents:n?"auto":"none",transitionProperty:"common",transitionDuration:"0.1s"},children:i.jsx(kae,{controlNetId:t,model:r})}),i.jsx(Me,{size:"sm",tooltip:"Duplicate","aria-label":"Duplicate",onClick:k,icon:i.jsx(Wu,{})}),i.jsx(Me,{size:"sm",tooltip:"Delete","aria-label":"Delete",colorScheme:"error",onClick:_,icon:i.jsx(Ls,{})}),i.jsx(Me,{size:"sm","aria-label":"Show All Options",onClick:x,variant:"link",icon:i.jsx(Ab,{sx:{boxSize:4,color:Ae("base.700","base.300")(w),transform:S?"rotate(0deg)":"rotate(180deg)",transitionProperty:"common",transitionDuration:"normal"}})}),!v&&i.jsx(et,{sx:{position:"absolute",w:1.5,h:1.5,borderRadius:"full",bg:Ae("error.700","error.200")(w),top:4,insetInlineEnd:4}})]}),n&&i.jsxs(i.Fragment,{children:[i.jsxs(K,{sx:{w:"full",flexDirection:"column"},children:[i.jsxs(K,{sx:{gap:4,w:"full"},children:[i.jsxs(K,{sx:{flexDir:"column",gap:3,w:"full",paddingInlineStart:1,paddingInlineEnd:S?1:0,pb:2,justifyContent:"space-between"},children:[i.jsx(jae,{controlNetId:t,weight:o,mini:!S}),i.jsx(sie,{controlNetId:t,beginStepPct:s,endStepPct:a,mini:!S})]}),!S&&i.jsx(K,{sx:{alignItems:"center",justifyContent:"center",h:24,w:24,aspectRatio:"1/1"},children:i.jsx(v3,{controlNet:e.controlNet,height:24})})]}),i.jsx(iie,{controlNetId:t,controlMode:l})]}),S&&i.jsxs(i.Fragment,{children:[i.jsx(et,{mt:2,children:i.jsx(v3,{controlNet:e.controlNet,height:96})}),i.jsx(uie,{controlNetId:t,processorNode:p}),i.jsx(tie,{controlNetId:t,processorNode:p}),i.jsx(rie,{controlNetId:t,shouldAutoConfig:v})]})]})]})},fie=h.memo(die),pie=Te(S5,e=>{const{controlNets:t,isEnabled:n}=e;return{controlNetsArray:qa(t),isEnabled:n}},zn),hie=()=>{Ce();const{controlNetsArray:e,isEnabled:t}=q(pie),n=so("controlNet").isFeatureDisabled,r=ue(),o=h.useCallback(()=>{r(M7())},[r]),s=h.useCallback(()=>{r(C5({controlNetId:Fl()}))},[r]);return n?null:i.jsx(Vs,{label:"ControlNet",isOpen:t,onToggle:o,withSwitch:!0,children:i.jsxs(K,{sx:{flexDir:"column",gap:3},children:[e.map((a,l)=>i.jsxs(h.Fragment,{children:[l>0&&i.jsx(Fu,{}),i.jsx(fie,{controlNet:a})]},a.controlNetId)),i.jsx(fn,{flexGrow:1,onClick:s,children:"Add ControlNet"})]})})},b2=h.memo(hie),mie=Te(kg,e=>{const{maxPrompts:t,combinatorial:n}=e.dynamicPrompts,{min:r,sliderMax:o,inputMax:s}=e.config.sd.dynamicPrompts.maxPrompts;return{maxPrompts:t,min:r,sliderMax:o,inputMax:s,combinatorial:n}},zn),gie=()=>{const{maxPrompts:e,min:t,sliderMax:n,inputMax:r,combinatorial:o}=q(mie),s=ue(),a=h.useCallback(u=>{s(D7(u))},[s]),l=h.useCallback(()=>{s(A7())},[s]);return i.jsx(Tt,{label:"Max Prompts",isDisabled:!o,min:t,max:n,value:e,onChange:a,sliderNumberInputProps:{max:r},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:l})},vie=Te(kg,e=>{const{combinatorial:t}=e.dynamicPrompts;return{combinatorial:t}},zn),yie=()=>{const{combinatorial:e}=q(vie),t=ue(),n=h.useCallback(()=>{t(N7())},[t]);return i.jsx(Br,{label:"Combinatorial Generation",isChecked:e,onChange:n})},xie=Te(kg,e=>{const{isEnabled:t}=e.dynamicPrompts;return{isEnabled:t}},zn),w2=()=>{const e=ue(),{isEnabled:t}=q(xie),n=h.useCallback(()=>{e(z7())},[e]);return i.jsx(Vs,{isOpen:t,onToggle:n,label:"Dynamic Prompts",withSwitch:!0,children:i.jsxs(K,{sx:{gap:2,flexDir:"column"},children:[i.jsx(yie,{}),i.jsx(gie,{})]})})},bie=()=>i.jsxs(i.Fragment,{children:[i.jsx(g2,{}),i.jsx(v2,{}),i.jsx(m2,{}),i.jsx(Sae,{}),i.jsx(w2,{}),i.jsx(b2,{}),i.jsx(y2,{}),i.jsx(R8,{}),i.jsx(x2,{}),i.jsx(Hse,{}),i.jsx(M8,{})]}),A8=h.memo(bie),wie=()=>i.jsxs(K,{sx:{gap:4,w:"full",h:"full"},children:[i.jsx(h2,{children:i.jsx(A8,{})}),i.jsx(O8,{})]}),Sie=h.memo(wie);var dx={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Konva=void 0;var n=_S;Object.defineProperty(t,"Konva",{enumerable:!0,get:function(){return n.Konva}});const r=_S;e.exports=r.Konva})(dx,dx.exports);var Cie=dx.exports;const Cf=kf(Cie);var N8={exports:{}};/**
* @license React
* react-reconciler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var _ie=function(t){var n={},r=h,o=Ph,s=Object.assign;function a(c){for(var d="https://reactjs.org/docs/error-decoder.html?invariant="+c,g=1;g<arguments.length;g++)d+="&args[]="+encodeURIComponent(arguments[g]);return"Minified React error #"+c+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var l=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,u=Symbol.for("react.element"),f=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),y=Symbol.for("react.provider"),S=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),k=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),I=Symbol.for("react.offscreen"),j=Symbol.iterator;function E(c){return c===null||typeof c!="object"?null:(c=j&&c[j]||c["@@iterator"],typeof c=="function"?c:null)}function T(c){if(c==null)return null;if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case p:return"Fragment";case f:return"Portal";case v:return"Profiler";case m:return"StrictMode";case w:return"Suspense";case _:return"SuspenseList"}if(typeof c=="object")switch(c.$$typeof){case S:return(c.displayName||"Context")+".Consumer";case y:return(c._context.displayName||"Context")+".Provider";case x:var d=c.render;return c=c.displayName,c||(c=d.displayName||d.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case k:return d=c.displayName||null,d!==null?d:T(c.type)||"Memo";case P:d=c._payload,c=c._init;try{return T(c(d))}catch{}}return null}function R(c){var d=c.type;switch(c.tag){case 24:return"Cache";case 9:return(d.displayName||"Context")+".Consumer";case 10:return(d._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return c=d.render,c=c.displayName||c.name||"",d.displayName||(c!==""?"ForwardRef("+c+")":"ForwardRef");case 7:return"Fragment";case 5:return d;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return T(d);case 8:return d===m?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof d=="function")return d.displayName||d.name||null;if(typeof d=="string")return d}return null}function M(c){var d=c,g=c;if(c.alternate)for(;d.return;)d=d.return;else{c=d;do d=c,d.flags&4098&&(g=d.return),c=d.return;while(c)}return d.tag===3?g:null}function D(c){if(M(c)!==c)throw Error(a(188))}function N(c){var d=c.alternate;if(!d){if(d=M(c),d===null)throw Error(a(188));return d!==c?null:c}for(var g=c,b=d;;){var C=g.return;if(C===null)break;var O=C.alternate;if(O===null){if(b=C.return,b!==null){g=b;continue}break}if(C.child===O.child){for(O=C.child;O;){if(O===g)return D(C),c;if(O===b)return D(C),d;O=O.sibling}throw Error(a(188))}if(g.return!==b.return)g=C,b=O;else{for(var $=!1,J=C.child;J;){if(J===g){$=!0,g=C,b=O;break}if(J===b){$=!0,b=C,g=O;break}J=J.sibling}if(!$){for(J=O.child;J;){if(J===g){$=!0,g=O,b=C;break}if(J===b){$=!0,b=O,g=C;break}J=J.sibling}if(!$)throw Error(a(189))}}if(g.alternate!==b)throw Error(a(190))}if(g.tag!==3)throw Error(a(188));return g.stateNode.current===g?c:d}function U(c){return c=N(c),c!==null?z(c):null}function z(c){if(c.tag===5||c.tag===6)return c;for(c=c.child;c!==null;){var d=z(c);if(d!==null)return d;c=c.sibling}return null}function F(c){if(c.tag===5||c.tag===6)return c;for(c=c.child;c!==null;){if(c.tag!==4){var d=F(c);if(d!==null)return d}c=c.sibling}return null}var H=Array.isArray,G=t.getPublicInstance,A=t.getRootHostContext,L=t.getChildHostContext,W=t.prepareForCommit,V=t.resetAfterCommit,ee=t.createInstance,le=t.appendInitialChild,oe=t.finalizeInitialChildren,X=t.prepareUpdate,Q=t.shouldSetTextContent,ie=t.createTextInstance,ve=t.scheduleTimeout,ye=t.cancelTimeout,se=t.noTimeout,de=t.isPrimaryRenderer,fe=t.supportsMutation,xe=t.supportsPersistence,ke=t.supportsHydration,ae=t.getInstanceFromNode,Pe=t.preparePortalMount,tt=t.getCurrentEventPriority,ze=t.detachDeletedInstance,We=t.supportsMicrotasks,It=t.scheduleMicrotask,pt=t.supportsTestSelectors,bn=t.findFiberRoot,Y=t.getBoundingRect,Se=t.getTextContent,ne=t.isHiddenSubtree,he=t.matchAccessibilityRole,Re=t.setFocusIfFocusable,Ke=t.setupIntersectionObserver,ge=t.appendChild,ut=t.appendChildToContainer,Rt=t.commitTextUpdate,en=t.commitMount,$e=t.commitUpdate,Xe=t.insertBefore,On=t.insertInContainerBefore,Ie=t.removeChild,Ye=t.removeChildFromContainer,ht=t.resetTextContent,vt=t.hideInstance,Gt=t.hideTextInstance,Er=t.unhideInstance,gn=t.unhideTextInstance,vn=t.clearContainer,Hr=t.cloneInstance,Kn=t.createContainerChildSet,Qn=t.appendChildToContainerChildSet,Ws=t.finalizeContainerChildren,Tn=t.replaceContainerChildren,ps=t.cloneHiddenInstance,hs=t.cloneHiddenTextInstance,dr=t.canHydrateInstance,Us=t.canHydrateTextInstance,ji=t.canHydrateSuspenseInstance,Yr=t.isSuspenseInstancePending,ms=t.isSuspenseInstanceFallback,Ja=t.getSuspenseInstanceFallbackErrorDetails,Ii=t.registerSuspenseInstanceRetry,Gs=t.getNextHydratableSibling,Z=t.getFirstHydratableChild,te=t.getFirstHydratableChildWithinContainer,me=t.getFirstHydratableChildWithinSuspenseInstance,we=t.hydrateInstance,_e=t.hydrateTextInstance,ot=t.hydrateSuspenseInstance,kt=t.getNextHydratableInstanceAfterSuspenseInstance,Xt=t.commitHydratedContainer,bt=t.commitHydratedSuspenseInstance,Ze=t.clearSuspenseBoundary,rt=t.clearSuspenseBoundaryFromContainer,je=t.shouldDeleteUnhydratedTailInstances,Qe=t.didNotMatchHydratedContainerTextInstance,Mt=t.didNotMatchHydratedTextInstance,At;function Ft(c){if(At===void 0)try{throw Error()}catch(g){var d=g.stack.trim().match(/\n( *(at )?)/);At=d&&d[1]||""}return`
`+At+c}var Qt=!1;function sn(c,d){if(!c||Qt)return"";Qt=!0;var g=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(d)if(d=function(){throw Error()},Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(Fe){var b=Fe}Reflect.construct(c,[],d)}else{try{d.call()}catch(Fe){b=Fe}c.call(d.prototype)}else{try{throw Error()}catch(Fe){b=Fe}c()}}catch(Fe){if(Fe&&b&&typeof Fe.stack=="string"){for(var C=Fe.stack.split(`
`),O=b.stack.split(`
`),$=C.length-1,J=O.length-1;1<=$&&0<=J&&C[$]!==O[J];)J--;for(;1<=$&&0<=J;$--,J--)if(C[$]!==O[J]){if($!==1||J!==1)do if($--,J--,0>J||C[$]!==O[J]){var pe=`
`+C[$].replace(" at new "," at ");return c.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",c.displayName)),pe}while(1<=$&&0<=J);break}}}finally{Qt=!1,Error.prepareStackTrace=g}return(c=c?c.displayName||c.name:"")?Ft(c):""}var Jt=Object.prototype.hasOwnProperty,De=[],Pt=-1;function Vt(c){return{current:c}}function Wt(c){0>Pt||(c.current=De[Pt],De[Pt]=null,Pt--)}function Zt(c,d){Pt++,De[Pt]=c.current,c.current=d}var Rn={},on=Vt(Rn),hn=Vt(!1),Gn=Rn;function Kr(c,d){var g=c.type.contextTypes;if(!g)return Rn;var b=c.stateNode;if(b&&b.__reactInternalMemoizedUnmaskedChildContext===d)return b.__reactInternalMemoizedMaskedChildContext;var C={},O;for(O in g)C[O]=d[O];return b&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=d,c.__reactInternalMemoizedMaskedChildContext=C),C}function xr(c){return c=c.childContextTypes,c!=null}function Dt(){Wt(hn),Wt(on)}function Vn(c,d,g){if(on.current!==Rn)throw Error(a(168));Zt(on,d),Zt(hn,g)}function Xn(c,d,g){var b=c.stateNode;if(d=d.childContextTypes,typeof b.getChildContext!="function")return g;b=b.getChildContext();for(var C in b)if(!(C in d))throw Error(a(108,R(c)||"Unknown",C));return s({},g,b)}function br(c){return c=(c=c.stateNode)&&c.__reactInternalMemoizedMergedChildContext||Rn,Gn=on.current,Zt(on,c),Zt(hn,hn.current),!0}function Ar(c,d,g){var b=c.stateNode;if(!b)throw Error(a(169));g?(c=Xn(c,d,Gn),b.__reactInternalMemoizedMergedChildContext=c,Wt(hn),Wt(on),Zt(on,c)):Wt(hn),Zt(hn,g)}var tr=Math.clz32?Math.clz32:$n,nr=Math.log,wn=Math.LN2;function $n(c){return c>>>=0,c===0?32:31-(nr(c)/wn|0)|0}var Wn=64,Mn=4194304;function Dn(c){switch(c&-c){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return c&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return c}}function Je(c,d){var g=c.pendingLanes;if(g===0)return 0;var b=0,C=c.suspendedLanes,O=c.pingedLanes,$=g&268435455;if($!==0){var J=$&~C;J!==0?b=Dn(J):(O&=$,O!==0&&(b=Dn(O)))}else $=g&~C,$!==0?b=Dn($):O!==0&&(b=Dn(O));if(b===0)return 0;if(d!==0&&d!==b&&!(d&C)&&(C=b&-b,O=d&-d,C>=O||C===16&&(O&4194240)!==0))return d;if(b&4&&(b|=g&16),d=c.entangledLanes,d!==0)for(c=c.entanglements,d&=b;0<d;)g=31-tr(d),C=1<<g,b|=c[g],d&=~C;return b}function Nt(c,d){switch(c){case 1:case 2:case 4:return d+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return d+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Et(c,d){for(var g=c.suspendedLanes,b=c.pingedLanes,C=c.expirationTimes,O=c.pendingLanes;0<O;){var $=31-tr(O),J=1<<$,pe=C[$];pe===-1?(!(J&g)||J&b)&&(C[$]=Nt(J,d)):pe<=d&&(c.expiredLanes|=J),O&=~J}}function dt(c){return c=c.pendingLanes&-1073741825,c!==0?c:c&1073741824?1073741824:0}function jt(){var c=Wn;return Wn<<=1,!(Wn&4194240)&&(Wn=64),c}function qt(c){for(var d=[],g=0;31>g;g++)d.push(c);return d}function St(c,d,g){c.pendingLanes|=d,d!==536870912&&(c.suspendedLanes=0,c.pingedLanes=0),c=c.eventTimes,d=31-tr(d),c[d]=g}function it(c,d){var g=c.pendingLanes&~d;c.pendingLanes=d,c.suspendedLanes=0,c.pingedLanes=0,c.expiredLanes&=d,c.mutableReadLanes&=d,c.entangledLanes&=d,d=c.entanglements;var b=c.eventTimes;for(c=c.expirationTimes;0<g;){var C=31-tr(g),O=1<<C;d[C]=0,b[C]=-1,c[C]=-1,g&=~O}}function Ne(c,d){var g=c.entangledLanes|=d;for(c=c.entanglements;g;){var b=31-tr(g),C=1<<b;C&d|c[b]&d&&(c[b]|=d),g&=~C}}var Ee=0;function Le(c){return c&=-c,1<c?4<c?c&268435455?16:536870912:4:1}var Ue=o.unstable_scheduleCallback,st=o.unstable_cancelCallback,$t=o.unstable_shouldYield,zt=o.unstable_requestPaint,Ge=o.unstable_now,an=o.unstable_ImmediatePriority,An=o.unstable_UserBlockingPriority,kn=o.unstable_NormalPriority,Nr=o.unstable_IdlePriority,hr=null,In=null;function fr(c){if(In&&typeof In.onCommitFiberRoot=="function")try{In.onCommitFiberRoot(hr,c,void 0,(c.current.flags&128)===128)}catch{}}function Po(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}var Sn=typeof Object.is=="function"?Object.is:Po,rr=null,ao=!1,Xr=!1;function Ei(c){rr===null?rr=[c]:rr.push(c)}function Jf(c){ao=!0,Ei(c)}function Qo(){if(!Xr&&rr!==null){Xr=!0;var c=0,d=Ee;try{var g=rr;for(Ee=1;c<g.length;c++){var b=g[c];do b=b(!0);while(b!==null)}rr=null,ao=!1}catch(C){throw rr!==null&&(rr=rr.slice(c+1)),Ue(an,Qo),C}finally{Ee=d,Xr=!1}}return null}var ei=[],ja=0,ti=null,jo=0,Io=[],Eo=0,gs=null,Jo=1,mo="";function wl(c,d){ei[ja++]=jo,ei[ja++]=ti,ti=c,jo=d}function j2(c,d,g){Io[Eo++]=Jo,Io[Eo++]=mo,Io[Eo++]=gs,gs=c;var b=Jo;c=mo;var C=32-tr(b)-1;b&=~(1<<C),g+=1;var O=32-tr(d)+C;if(30<O){var $=C-C%5;O=(b&(1<<$)-1).toString(32),b>>=$,C-=$,Jo=1<<32-tr(d)+C|g<<C|b,mo=O+c}else Jo=1<<O|g<<C|b,mo=c}function Nv(c){c.return!==null&&(wl(c,1),j2(c,1,0))}function zv(c){for(;c===ti;)ti=ei[--ja],ei[ja]=null,jo=ei[--ja],ei[ja]=null;for(;c===gs;)gs=Io[--Eo],Io[Eo]=null,mo=Io[--Eo],Io[Eo]=null,Jo=Io[--Eo],Io[Eo]=null}var es=null,vs=null,wr=!1,Ku=!1,qs=null;function I2(c,d){var g=Ss(5,null,null,0);g.elementType="DELETED",g.stateNode=d,g.return=c,d=c.deletions,d===null?(c.deletions=[g],c.flags|=16):d.push(g)}function E2(c,d){switch(c.tag){case 5:return d=dr(d,c.type,c.pendingProps),d!==null?(c.stateNode=d,es=c,vs=Z(d),!0):!1;case 6:return d=Us(d,c.pendingProps),d!==null?(c.stateNode=d,es=c,vs=null,!0):!1;case 13:if(d=ji(d),d!==null){var g=gs!==null?{id:Jo,overflow:mo}:null;return c.memoizedState={dehydrated:d,treeContext:g,retryLane:1073741824},g=Ss(18,null,null,0),g.stateNode=d,g.return=c,c.child=g,es=c,vs=null,!0}return!1;default:return!1}}function $v(c){return(c.mode&1)!==0&&(c.flags&128)===0}function Lv(c){if(wr){var d=vs;if(d){var g=d;if(!E2(c,d)){if($v(c))throw Error(a(418));d=Gs(g);var b=es;d&&E2(c,d)?I2(b,g):(c.flags=c.flags&-4097|2,wr=!1,es=c)}}else{if($v(c))throw Error(a(418));c.flags=c.flags&-4097|2,wr=!1,es=c}}}function O2(c){for(c=c.return;c!==null&&c.tag!==5&&c.tag!==3&&c.tag!==13;)c=c.return;es=c}function ep(c){if(!ke||c!==es)return!1;if(!wr)return O2(c),wr=!0,!1;if(c.tag!==3&&(c.tag!==5||je(c.type)&&!Q(c.type,c.memoizedProps))){var d=vs;if(d){if($v(c))throw T2(),Error(a(418));for(;d;)I2(c,d),d=Gs(d)}}if(O2(c),c.tag===13){if(!ke)throw Error(a(316));if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(a(317));vs=kt(c)}else vs=es?Gs(c.stateNode):null;return!0}function T2(){for(var c=vs;c;)c=Gs(c)}function wc(){ke&&(vs=es=null,Ku=wr=!1)}function Bv(c){qs===null?qs=[c]:qs.push(c)}var uR=l.ReactCurrentBatchConfig;function tp(c,d){if(Sn(c,d))return!0;if(typeof c!="object"||c===null||typeof d!="object"||d===null)return!1;var g=Object.keys(c),b=Object.keys(d);if(g.length!==b.length)return!1;for(b=0;b<g.length;b++){var C=g[b];if(!Jt.call(d,C)||!Sn(c[C],d[C]))return!1}return!0}function dR(c){switch(c.tag){case 5:return Ft(c.type);case 16:return Ft("Lazy");case 13:return Ft("Suspense");case 19:return Ft("SuspenseList");case 0:case 2:case 15:return c=sn(c.type,!1),c;case 11:return c=sn(c.type.render,!1),c;case 1:return c=sn(c.type,!0),c;default:return""}}function Ys(c,d){if(c&&c.defaultProps){d=s({},d),c=c.defaultProps;for(var g in c)d[g]===void 0&&(d[g]=c[g]);return d}return d}var np=Vt(null),rp=null,Sc=null,Fv=null;function Hv(){Fv=Sc=rp=null}function R2(c,d,g){de?(Zt(np,d._currentValue),d._currentValue=g):(Zt(np,d._currentValue2),d._currentValue2=g)}function Vv(c){var d=np.current;Wt(np),de?c._currentValue=d:c._currentValue2=d}function Wv(c,d,g){for(;c!==null;){var b=c.alternate;if((c.childLanes&d)!==d?(c.childLanes|=d,b!==null&&(b.childLanes|=d)):b!==null&&(b.childLanes&d)!==d&&(b.childLanes|=d),c===g)break;c=c.return}}function Cc(c,d){rp=c,Fv=Sc=null,c=c.dependencies,c!==null&&c.firstContext!==null&&(c.lanes&d&&(Bo=!0),c.firstContext=null)}function ys(c){var d=de?c._currentValue:c._currentValue2;if(Fv!==c)if(c={context:c,memoizedValue:d,next:null},Sc===null){if(rp===null)throw Error(a(308));Sc=c,rp.dependencies={lanes:0,firstContext:c}}else Sc=Sc.next=c;return d}var Sl=null;function Uv(c){Sl===null?Sl=[c]:Sl.push(c)}function M2(c,d,g,b){var C=d.interleaved;return C===null?(g.next=g,Uv(d)):(g.next=C.next,C.next=g),d.interleaved=g,Ia(c,b)}function Ia(c,d){c.lanes|=d;var g=c.alternate;for(g!==null&&(g.lanes|=d),g=c,c=c.return;c!==null;)c.childLanes|=d,g=c.alternate,g!==null&&(g.childLanes|=d),g=c,c=c.return;return g.tag===3?g.stateNode:null}var Oi=!1;function Gv(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function D2(c,d){c=c.updateQueue,d.updateQueue===c&&(d.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,effects:c.effects})}function ni(c,d){return{eventTime:c,lane:d,tag:0,payload:null,callback:null,next:null}}function Ti(c,d,g){var b=c.updateQueue;if(b===null)return null;if(b=b.shared,mn&2){var C=b.pending;return C===null?d.next=d:(d.next=C.next,C.next=d),b.pending=d,Ia(c,g)}return C=b.interleaved,C===null?(d.next=d,Uv(b)):(d.next=C.next,C.next=d),b.interleaved=d,Ia(c,g)}function op(c,d,g){if(d=d.updateQueue,d!==null&&(d=d.shared,(g&4194240)!==0)){var b=d.lanes;b&=c.pendingLanes,g|=b,d.lanes=g,Ne(c,g)}}function A2(c,d){var g=c.updateQueue,b=c.alternate;if(b!==null&&(b=b.updateQueue,g===b)){var C=null,O=null;if(g=g.firstBaseUpdate,g!==null){do{var $={eventTime:g.eventTime,lane:g.lane,tag:g.tag,payload:g.payload,callback:g.callback,next:null};O===null?C=O=$:O=O.next=$,g=g.next}while(g!==null);O===null?C=O=d:O=O.next=d}else C=O=d;g={baseState:b.baseState,firstBaseUpdate:C,lastBaseUpdate:O,shared:b.shared,effects:b.effects},c.updateQueue=g;return}c=g.lastBaseUpdate,c===null?g.firstBaseUpdate=d:c.next=d,g.lastBaseUpdate=d}function sp(c,d,g,b){var C=c.updateQueue;Oi=!1;var O=C.firstBaseUpdate,$=C.lastBaseUpdate,J=C.shared.pending;if(J!==null){C.shared.pending=null;var pe=J,Fe=pe.next;pe.next=null,$===null?O=Fe:$.next=Fe,$=pe;var Ct=c.alternate;Ct!==null&&(Ct=Ct.updateQueue,J=Ct.lastBaseUpdate,J!==$&&(J===null?Ct.firstBaseUpdate=Fe:J.next=Fe,Ct.lastBaseUpdate=pe))}if(O!==null){var nn=C.baseState;$=0,Ct=Fe=pe=null,J=O;do{var ft=J.lane,mr=J.eventTime;if((b&ft)===ft){Ct!==null&&(Ct=Ct.next={eventTime:mr,lane:0,tag:J.tag,payload:J.payload,callback:J.callback,next:null});e:{var or=c,Vo=J;switch(ft=d,mr=g,Vo.tag){case 1:if(or=Vo.payload,typeof or=="function"){nn=or.call(mr,nn,ft);break e}nn=or;break e;case 3:or.flags=or.flags&-65537|128;case 0:if(or=Vo.payload,ft=typeof or=="function"?or.call(mr,nn,ft):or,ft==null)break e;nn=s({},nn,ft);break e;case 2:Oi=!0}}J.callback!==null&&J.lane!==0&&(c.flags|=64,ft=C.effects,ft===null?C.effects=[J]:ft.push(J))}else mr={eventTime:mr,lane:ft,tag:J.tag,payload:J.payload,callback:J.callback,next:null},Ct===null?(Fe=Ct=mr,pe=nn):Ct=Ct.next=mr,$|=ft;if(J=J.next,J===null){if(J=C.shared.pending,J===null)break;ft=J,J=ft.next,ft.next=null,C.lastBaseUpdate=ft,C.shared.pending=null}}while(1);if(Ct===null&&(pe=nn),C.baseState=pe,C.firstBaseUpdate=Fe,C.lastBaseUpdate=Ct,d=C.shared.interleaved,d!==null){C=d;do $|=C.lane,C=C.next;while(C!==d)}else O===null&&(C.shared.lanes=0);_l|=$,c.lanes=$,c.memoizedState=nn}}function N2(c,d,g){if(c=d.effects,d.effects=null,c!==null)for(d=0;d<c.length;d++){var b=c[d],C=b.callback;if(C!==null){if(b.callback=null,b=g,typeof C!="function")throw Error(a(191,C));C.call(b)}}}var z2=new r.Component().refs;function qv(c,d,g,b){d=c.memoizedState,g=g(b,d),g=g==null?d:s({},d,g),c.memoizedState=g,c.lanes===0&&(c.updateQueue.baseState=g)}var ap={isMounted:function(c){return(c=c._reactInternals)?M(c)===c:!1},enqueueSetState:function(c,d,g){c=c._reactInternals;var b=xo(),C=Di(c),O=ni(b,C);O.payload=d,g!=null&&(O.callback=g),d=Ti(c,O,C),d!==null&&(ws(d,c,C,b),op(d,c,C))},enqueueReplaceState:function(c,d,g){c=c._reactInternals;var b=xo(),C=Di(c),O=ni(b,C);O.tag=1,O.payload=d,g!=null&&(O.callback=g),d=Ti(c,O,C),d!==null&&(ws(d,c,C,b),op(d,c,C))},enqueueForceUpdate:function(c,d){c=c._reactInternals;var g=xo(),b=Di(c),C=ni(g,b);C.tag=2,d!=null&&(C.callback=d),d=Ti(c,C,b),d!==null&&(ws(d,c,b,g),op(d,c,b))}};function $2(c,d,g,b,C,O,$){return c=c.stateNode,typeof c.shouldComponentUpdate=="function"?c.shouldComponentUpdate(b,O,$):d.prototype&&d.prototype.isPureReactComponent?!tp(g,b)||!tp(C,O):!0}function L2(c,d,g){var b=!1,C=Rn,O=d.contextType;return typeof O=="object"&&O!==null?O=ys(O):(C=xr(d)?Gn:on.current,b=d.contextTypes,O=(b=b!=null)?Kr(c,C):Rn),d=new d(g,O),c.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=ap,c.stateNode=d,d._reactInternals=c,b&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=C,c.__reactInternalMemoizedMaskedChildContext=O),d}function B2(c,d,g,b){c=d.state,typeof d.componentWillReceiveProps=="function"&&d.componentWillReceiveProps(g,b),typeof d.UNSAFE_componentWillReceiveProps=="function"&&d.UNSAFE_componentWillReceiveProps(g,b),d.state!==c&&ap.enqueueReplaceState(d,d.state,null)}function Yv(c,d,g,b){var C=c.stateNode;C.props=g,C.state=c.memoizedState,C.refs=z2,Gv(c);var O=d.contextType;typeof O=="object"&&O!==null?C.context=ys(O):(O=xr(d)?Gn:on.current,C.context=Kr(c,O)),C.state=c.memoizedState,O=d.getDerivedStateFromProps,typeof O=="function"&&(qv(c,d,O,g),C.state=c.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof C.getSnapshotBeforeUpdate=="function"||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(d=C.state,typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount(),d!==C.state&&ap.enqueueReplaceState(C,C.state,null),sp(c,g,C,b),C.state=c.memoizedState),typeof C.componentDidMount=="function"&&(c.flags|=4194308)}function Xu(c,d,g){if(c=g.ref,c!==null&&typeof c!="function"&&typeof c!="object"){if(g._owner){if(g=g._owner,g){if(g.tag!==1)throw Error(a(309));var b=g.stateNode}if(!b)throw Error(a(147,c));var C=b,O=""+c;return d!==null&&d.ref!==null&&typeof d.ref=="function"&&d.ref._stringRef===O?d.ref:(d=function($){var J=C.refs;J===z2&&(J=C.refs={}),$===null?delete J[O]:J[O]=$},d._stringRef=O,d)}if(typeof c!="string")throw Error(a(284));if(!g._owner)throw Error(a(290,c))}return c}function ip(c,d){throw c=Object.prototype.toString.call(d),Error(a(31,c==="[object Object]"?"object with keys {"+Object.keys(d).join(", ")+"}":c))}function F2(c){var d=c._init;return d(c._payload)}function H2(c){function d(ce,re){if(c){var be=ce.deletions;be===null?(ce.deletions=[re],ce.flags|=16):be.push(re)}}function g(ce,re){if(!c)return null;for(;re!==null;)d(ce,re),re=re.sibling;return null}function b(ce,re){for(ce=new Map;re!==null;)re.key!==null?ce.set(re.key,re):ce.set(re.index,re),re=re.sibling;return ce}function C(ce,re){return ce=Ni(ce,re),ce.index=0,ce.sibling=null,ce}function O(ce,re,be){return ce.index=be,c?(be=ce.alternate,be!==null?(be=be.index,be<re?(ce.flags|=2,re):be):(ce.flags|=2,re)):(ce.flags|=1048576,re)}function $(ce){return c&&ce.alternate===null&&(ce.flags|=2),ce}function J(ce,re,be,mt){return re===null||re.tag!==6?(re=A0(be,ce.mode,mt),re.return=ce,re):(re=C(re,be),re.return=ce,re)}function pe(ce,re,be,mt){var Bt=be.type;return Bt===p?Ct(ce,re,be.props.children,mt,be.key):re!==null&&(re.elementType===Bt||typeof Bt=="object"&&Bt!==null&&Bt.$$typeof===P&&F2(Bt)===re.type)?(mt=C(re,be.props),mt.ref=Xu(ce,re,be),mt.return=ce,mt):(mt=Mp(be.type,be.key,be.props,null,ce.mode,mt),mt.ref=Xu(ce,re,be),mt.return=ce,mt)}function Fe(ce,re,be,mt){return re===null||re.tag!==4||re.stateNode.containerInfo!==be.containerInfo||re.stateNode.implementation!==be.implementation?(re=N0(be,ce.mode,mt),re.return=ce,re):(re=C(re,be.children||[]),re.return=ce,re)}function Ct(ce,re,be,mt,Bt){return re===null||re.tag!==7?(re=Il(be,ce.mode,mt,Bt),re.return=ce,re):(re=C(re,be),re.return=ce,re)}function nn(ce,re,be){if(typeof re=="string"&&re!==""||typeof re=="number")return re=A0(""+re,ce.mode,be),re.return=ce,re;if(typeof re=="object"&&re!==null){switch(re.$$typeof){case u:return be=Mp(re.type,re.key,re.props,null,ce.mode,be),be.ref=Xu(ce,null,re),be.return=ce,be;case f:return re=N0(re,ce.mode,be),re.return=ce,re;case P:var mt=re._init;return nn(ce,mt(re._payload),be)}if(H(re)||E(re))return re=Il(re,ce.mode,be,null),re.return=ce,re;ip(ce,re)}return null}function ft(ce,re,be,mt){var Bt=re!==null?re.key:null;if(typeof be=="string"&&be!==""||typeof be=="number")return Bt!==null?null:J(ce,re,""+be,mt);if(typeof be=="object"&&be!==null){switch(be.$$typeof){case u:return be.key===Bt?pe(ce,re,be,mt):null;case f:return be.key===Bt?Fe(ce,re,be,mt):null;case P:return Bt=be._init,ft(ce,re,Bt(be._payload),mt)}if(H(be)||E(be))return Bt!==null?null:Ct(ce,re,be,mt,null);ip(ce,be)}return null}function mr(ce,re,be,mt,Bt){if(typeof mt=="string"&&mt!==""||typeof mt=="number")return ce=ce.get(be)||null,J(re,ce,""+mt,Bt);if(typeof mt=="object"&&mt!==null){switch(mt.$$typeof){case u:return ce=ce.get(mt.key===null?be:mt.key)||null,pe(re,ce,mt,Bt);case f:return ce=ce.get(mt.key===null?be:mt.key)||null,Fe(re,ce,mt,Bt);case P:var un=mt._init;return mr(ce,re,be,un(mt._payload),Bt)}if(H(mt)||E(mt))return ce=ce.get(be)||null,Ct(re,ce,mt,Bt,null);ip(re,mt)}return null}function or(ce,re,be,mt){for(var Bt=null,un=null,rn=re,Ln=re=0,oo=null;rn!==null&&Ln<be.length;Ln++){rn.index>Ln?(oo=rn,rn=null):oo=rn.sibling;var Bn=ft(ce,rn,be[Ln],mt);if(Bn===null){rn===null&&(rn=oo);break}c&&rn&&Bn.alternate===null&&d(ce,rn),re=O(Bn,re,Ln),un===null?Bt=Bn:un.sibling=Bn,un=Bn,rn=oo}if(Ln===be.length)return g(ce,rn),wr&&wl(ce,Ln),Bt;if(rn===null){for(;Ln<be.length;Ln++)rn=nn(ce,be[Ln],mt),rn!==null&&(re=O(rn,re,Ln),un===null?Bt=rn:un.sibling=rn,un=rn);return wr&&wl(ce,Ln),Bt}for(rn=b(ce,rn);Ln<be.length;Ln++)oo=mr(rn,ce,Ln,be[Ln],mt),oo!==null&&(c&&oo.alternate!==null&&rn.delete(oo.key===null?Ln:oo.key),re=O(oo,re,Ln),un===null?Bt=oo:un.sibling=oo,un=oo);return c&&rn.forEach(function(zi){return d(ce,zi)}),wr&&wl(ce,Ln),Bt}function Vo(ce,re,be,mt){var Bt=E(be);if(typeof Bt!="function")throw Error(a(150));if(be=Bt.call(be),be==null)throw Error(a(151));for(var un=Bt=null,rn=re,Ln=re=0,oo=null,Bn=be.next();rn!==null&&!Bn.done;Ln++,Bn=be.next()){rn.index>Ln?(oo=rn,rn=null):oo=rn.sibling;var zi=ft(ce,rn,Bn.value,mt);if(zi===null){rn===null&&(rn=oo);break}c&&rn&&zi.alternate===null&&d(ce,rn),re=O(zi,re,Ln),un===null?Bt=zi:un.sibling=zi,un=zi,rn=oo}if(Bn.done)return g(ce,rn),wr&&wl(ce,Ln),Bt;if(rn===null){for(;!Bn.done;Ln++,Bn=be.next())Bn=nn(ce,Bn.value,mt),Bn!==null&&(re=O(Bn,re,Ln),un===null?Bt=Bn:un.sibling=Bn,un=Bn);return wr&&wl(ce,Ln),Bt}for(rn=b(ce,rn);!Bn.done;Ln++,Bn=be.next())Bn=mr(rn,ce,Ln,Bn.value,mt),Bn!==null&&(c&&Bn.alternate!==null&&rn.delete(Bn.key===null?Ln:Bn.key),re=O(Bn,re,Ln),un===null?Bt=Bn:un.sibling=Bn,un=Bn);return c&&rn.forEach(function(FR){return d(ce,FR)}),wr&&wl(ce,Ln),Bt}function si(ce,re,be,mt){if(typeof be=="object"&&be!==null&&be.type===p&&be.key===null&&(be=be.props.children),typeof be=="object"&&be!==null){switch(be.$$typeof){case u:e:{for(var Bt=be.key,un=re;un!==null;){if(un.key===Bt){if(Bt=be.type,Bt===p){if(un.tag===7){g(ce,un.sibling),re=C(un,be.props.children),re.return=ce,ce=re;break e}}else if(un.elementType===Bt||typeof Bt=="object"&&Bt!==null&&Bt.$$typeof===P&&F2(Bt)===un.type){g(ce,un.sibling),re=C(un,be.props),re.ref=Xu(ce,un,be),re.return=ce,ce=re;break e}g(ce,un);break}else d(ce,un);un=un.sibling}be.type===p?(re=Il(be.props.children,ce.mode,mt,be.key),re.return=ce,ce=re):(mt=Mp(be.type,be.key,be.props,null,ce.mode,mt),mt.ref=Xu(ce,re,be),mt.return=ce,ce=mt)}return $(ce);case f:e:{for(un=be.key;re!==null;){if(re.key===un)if(re.tag===4&&re.stateNode.containerInfo===be.containerInfo&&re.stateNode.implementation===be.implementation){g(ce,re.sibling),re=C(re,be.children||[]),re.return=ce,ce=re;break e}else{g(ce,re);break}else d(ce,re);re=re.sibling}re=N0(be,ce.mode,mt),re.return=ce,ce=re}return $(ce);case P:return un=be._init,si(ce,re,un(be._payload),mt)}if(H(be))return or(ce,re,be,mt);if(E(be))return Vo(ce,re,be,mt);ip(ce,be)}return typeof be=="string"&&be!==""||typeof be=="number"?(be=""+be,re!==null&&re.tag===6?(g(ce,re.sibling),re=C(re,be),re.return=ce,ce=re):(g(ce,re),re=A0(be,ce.mode,mt),re.return=ce,ce=re),$(ce)):g(ce,re)}return si}var _c=H2(!0),V2=H2(!1),Zu={},xs=Vt(Zu),Qu=Vt(Zu),kc=Vt(Zu);function Ea(c){if(c===Zu)throw Error(a(174));return c}function Kv(c,d){Zt(kc,d),Zt(Qu,c),Zt(xs,Zu),c=A(d),Wt(xs),Zt(xs,c)}function Pc(){Wt(xs),Wt(Qu),Wt(kc)}function W2(c){var d=Ea(kc.current),g=Ea(xs.current);d=L(g,c.type,d),g!==d&&(Zt(Qu,c),Zt(xs,d))}function Xv(c){Qu.current===c&&(Wt(xs),Wt(Qu))}var Or=Vt(0);function lp(c){for(var d=c;d!==null;){if(d.tag===13){var g=d.memoizedState;if(g!==null&&(g=g.dehydrated,g===null||Yr(g)||ms(g)))return d}else if(d.tag===19&&d.memoizedProps.revealOrder!==void 0){if(d.flags&128)return d}else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===c)break;for(;d.sibling===null;){if(d.return===null||d.return===c)return null;d=d.return}d.sibling.return=d.return,d=d.sibling}return null}var Zv=[];function Qv(){for(var c=0;c<Zv.length;c++){var d=Zv[c];de?d._workInProgressVersionPrimary=null:d._workInProgressVersionSecondary=null}Zv.length=0}var cp=l.ReactCurrentDispatcher,Jv=l.ReactCurrentBatchConfig,Cl=0,Tr=null,Zr=null,no=null,up=!1,Ju=!1,ed=0,fR=0;function go(){throw Error(a(321))}function e0(c,d){if(d===null)return!1;for(var g=0;g<d.length&&g<c.length;g++)if(!Sn(c[g],d[g]))return!1;return!0}function t0(c,d,g,b,C,O){if(Cl=O,Tr=d,d.memoizedState=null,d.updateQueue=null,d.lanes=0,cp.current=c===null||c.memoizedState===null?gR:vR,c=g(b,C),Ju){O=0;do{if(Ju=!1,ed=0,25<=O)throw Error(a(301));O+=1,no=Zr=null,d.updateQueue=null,cp.current=yR,c=g(b,C)}while(Ju)}if(cp.current=pp,d=Zr!==null&&Zr.next!==null,Cl=0,no=Zr=Tr=null,up=!1,d)throw Error(a(300));return c}function n0(){var c=ed!==0;return ed=0,c}function Oa(){var c={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return no===null?Tr.memoizedState=no=c:no=no.next=c,no}function bs(){if(Zr===null){var c=Tr.alternate;c=c!==null?c.memoizedState:null}else c=Zr.next;var d=no===null?Tr.memoizedState:no.next;if(d!==null)no=d,Zr=c;else{if(c===null)throw Error(a(310));Zr=c,c={memoizedState:Zr.memoizedState,baseState:Zr.baseState,baseQueue:Zr.baseQueue,queue:Zr.queue,next:null},no===null?Tr.memoizedState=no=c:no=no.next=c}return no}function td(c,d){return typeof d=="function"?d(c):d}function r0(c){var d=bs(),g=d.queue;if(g===null)throw Error(a(311));g.lastRenderedReducer=c;var b=Zr,C=b.baseQueue,O=g.pending;if(O!==null){if(C!==null){var $=C.next;C.next=O.next,O.next=$}b.baseQueue=C=O,g.pending=null}if(C!==null){O=C.next,b=b.baseState;var J=$=null,pe=null,Fe=O;do{var Ct=Fe.lane;if((Cl&Ct)===Ct)pe!==null&&(pe=pe.next={lane:0,action:Fe.action,hasEagerState:Fe.hasEagerState,eagerState:Fe.eagerState,next:null}),b=Fe.hasEagerState?Fe.eagerState:c(b,Fe.action);else{var nn={lane:Ct,action:Fe.action,hasEagerState:Fe.hasEagerState,eagerState:Fe.eagerState,next:null};pe===null?(J=pe=nn,$=b):pe=pe.next=nn,Tr.lanes|=Ct,_l|=Ct}Fe=Fe.next}while(Fe!==null&&Fe!==O);pe===null?$=b:pe.next=J,Sn(b,d.memoizedState)||(Bo=!0),d.memoizedState=b,d.baseState=$,d.baseQueue=pe,g.lastRenderedState=b}if(c=g.interleaved,c!==null){C=c;do O=C.lane,Tr.lanes|=O,_l|=O,C=C.next;while(C!==c)}else C===null&&(g.lanes=0);return[d.memoizedState,g.dispatch]}function o0(c){var d=bs(),g=d.queue;if(g===null)throw Error(a(311));g.lastRenderedReducer=c;var b=g.dispatch,C=g.pending,O=d.memoizedState;if(C!==null){g.pending=null;var $=C=C.next;do O=c(O,$.action),$=$.next;while($!==C);Sn(O,d.memoizedState)||(Bo=!0),d.memoizedState=O,d.baseQueue===null&&(d.baseState=O),g.lastRenderedState=O}return[O,b]}function U2(){}function G2(c,d){var g=Tr,b=bs(),C=d(),O=!Sn(b.memoizedState,C);if(O&&(b.memoizedState=C,Bo=!0),b=b.queue,s0(K2.bind(null,g,b,c),[c]),b.getSnapshot!==d||O||no!==null&&no.memoizedState.tag&1){if(g.flags|=2048,nd(9,Y2.bind(null,g,b,C,d),void 0,null),ro===null)throw Error(a(349));Cl&30||q2(g,d,C)}return C}function q2(c,d,g){c.flags|=16384,c={getSnapshot:d,value:g},d=Tr.updateQueue,d===null?(d={lastEffect:null,stores:null},Tr.updateQueue=d,d.stores=[c]):(g=d.stores,g===null?d.stores=[c]:g.push(c))}function Y2(c,d,g,b){d.value=g,d.getSnapshot=b,X2(d)&&Z2(c)}function K2(c,d,g){return g(function(){X2(d)&&Z2(c)})}function X2(c){var d=c.getSnapshot;c=c.value;try{var g=d();return!Sn(c,g)}catch{return!0}}function Z2(c){var d=Ia(c,1);d!==null&&ws(d,c,1,-1)}function Q2(c){var d=Oa();return typeof c=="function"&&(c=c()),d.memoizedState=d.baseState=c,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:td,lastRenderedState:c},d.queue=c,c=c.dispatch=mR.bind(null,Tr,c),[d.memoizedState,c]}function nd(c,d,g,b){return c={tag:c,create:d,destroy:g,deps:b,next:null},d=Tr.updateQueue,d===null?(d={lastEffect:null,stores:null},Tr.updateQueue=d,d.lastEffect=c.next=c):(g=d.lastEffect,g===null?d.lastEffect=c.next=c:(b=g.next,g.next=c,c.next=b,d.lastEffect=c)),c}function J2(){return bs().memoizedState}function dp(c,d,g,b){var C=Oa();Tr.flags|=c,C.memoizedState=nd(1|d,g,void 0,b===void 0?null:b)}function fp(c,d,g,b){var C=bs();b=b===void 0?null:b;var O=void 0;if(Zr!==null){var $=Zr.memoizedState;if(O=$.destroy,b!==null&&e0(b,$.deps)){C.memoizedState=nd(d,g,O,b);return}}Tr.flags|=c,C.memoizedState=nd(1|d,g,O,b)}function ew(c,d){return dp(8390656,8,c,d)}function s0(c,d){return fp(2048,8,c,d)}function tw(c,d){return fp(4,2,c,d)}function nw(c,d){return fp(4,4,c,d)}function rw(c,d){if(typeof d=="function")return c=c(),d(c),function(){d(null)};if(d!=null)return c=c(),d.current=c,function(){d.current=null}}function ow(c,d,g){return g=g!=null?g.concat([c]):null,fp(4,4,rw.bind(null,d,c),g)}function a0(){}function sw(c,d){var g=bs();d=d===void 0?null:d;var b=g.memoizedState;return b!==null&&d!==null&&e0(d,b[1])?b[0]:(g.memoizedState=[c,d],c)}function aw(c,d){var g=bs();d=d===void 0?null:d;var b=g.memoizedState;return b!==null&&d!==null&&e0(d,b[1])?b[0]:(c=c(),g.memoizedState=[c,d],c)}function iw(c,d,g){return Cl&21?(Sn(g,d)||(g=jt(),Tr.lanes|=g,_l|=g,c.baseState=!0),d):(c.baseState&&(c.baseState=!1,Bo=!0),c.memoizedState=g)}function pR(c,d){var g=Ee;Ee=g!==0&&4>g?g:4,c(!0);var b=Jv.transition;Jv.transition={};try{c(!1),d()}finally{Ee=g,Jv.transition=b}}function lw(){return bs().memoizedState}function hR(c,d,g){var b=Di(c);if(g={lane:b,action:g,hasEagerState:!1,eagerState:null,next:null},cw(c))uw(d,g);else if(g=M2(c,d,g,b),g!==null){var C=xo();ws(g,c,b,C),dw(g,d,b)}}function mR(c,d,g){var b=Di(c),C={lane:b,action:g,hasEagerState:!1,eagerState:null,next:null};if(cw(c))uw(d,C);else{var O=c.alternate;if(c.lanes===0&&(O===null||O.lanes===0)&&(O=d.lastRenderedReducer,O!==null))try{var $=d.lastRenderedState,J=O($,g);if(C.hasEagerState=!0,C.eagerState=J,Sn(J,$)){var pe=d.interleaved;pe===null?(C.next=C,Uv(d)):(C.next=pe.next,pe.next=C),d.interleaved=C;return}}catch{}finally{}g=M2(c,d,C,b),g!==null&&(C=xo(),ws(g,c,b,C),dw(g,d,b))}}function cw(c){var d=c.alternate;return c===Tr||d!==null&&d===Tr}function uw(c,d){Ju=up=!0;var g=c.pending;g===null?d.next=d:(d.next=g.next,g.next=d),c.pending=d}function dw(c,d,g){if(g&4194240){var b=d.lanes;b&=c.pendingLanes,g|=b,d.lanes=g,Ne(c,g)}}var pp={readContext:ys,useCallback:go,useContext:go,useEffect:go,useImperativeHandle:go,useInsertionEffect:go,useLayoutEffect:go,useMemo:go,useReducer:go,useRef:go,useState:go,useDebugValue:go,useDeferredValue:go,useTransition:go,useMutableSource:go,useSyncExternalStore:go,useId:go,unstable_isNewReconciler:!1},gR={readContext:ys,useCallback:function(c,d){return Oa().memoizedState=[c,d===void 0?null:d],c},useContext:ys,useEffect:ew,useImperativeHandle:function(c,d,g){return g=g!=null?g.concat([c]):null,dp(4194308,4,rw.bind(null,d,c),g)},useLayoutEffect:function(c,d){return dp(4194308,4,c,d)},useInsertionEffect:function(c,d){return dp(4,2,c,d)},useMemo:function(c,d){var g=Oa();return d=d===void 0?null:d,c=c(),g.memoizedState=[c,d],c},useReducer:function(c,d,g){var b=Oa();return d=g!==void 0?g(d):d,b.memoizedState=b.baseState=d,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:d},b.queue=c,c=c.dispatch=hR.bind(null,Tr,c),[b.memoizedState,c]},useRef:function(c){var d=Oa();return c={current:c},d.memoizedState=c},useState:Q2,useDebugValue:a0,useDeferredValue:function(c){return Oa().memoizedState=c},useTransition:function(){var c=Q2(!1),d=c[0];return c=pR.bind(null,c[1]),Oa().memoizedState=c,[d,c]},useMutableSource:function(){},useSyncExternalStore:function(c,d,g){var b=Tr,C=Oa();if(wr){if(g===void 0)throw Error(a(407));g=g()}else{if(g=d(),ro===null)throw Error(a(349));Cl&30||q2(b,d,g)}C.memoizedState=g;var O={value:g,getSnapshot:d};return C.queue=O,ew(K2.bind(null,b,O,c),[c]),b.flags|=2048,nd(9,Y2.bind(null,b,O,g,d),void 0,null),g},useId:function(){var c=Oa(),d=ro.identifierPrefix;if(wr){var g=mo,b=Jo;g=(b&~(1<<32-tr(b)-1)).toString(32)+g,d=":"+d+"R"+g,g=ed++,0<g&&(d+="H"+g.toString(32)),d+=":"}else g=fR++,d=":"+d+"r"+g.toString(32)+":";return c.memoizedState=d},unstable_isNewReconciler:!1},vR={readContext:ys,useCallback:sw,useContext:ys,useEffect:s0,useImperativeHandle:ow,useInsertionEffect:tw,useLayoutEffect:nw,useMemo:aw,useReducer:r0,useRef:J2,useState:function(){return r0(td)},useDebugValue:a0,useDeferredValue:function(c){var d=bs();return iw(d,Zr.memoizedState,c)},useTransition:function(){var c=r0(td)[0],d=bs().memoizedState;return[c,d]},useMutableSource:U2,useSyncExternalStore:G2,useId:lw,unstable_isNewReconciler:!1},yR={readContext:ys,useCallback:sw,useContext:ys,useEffect:s0,useImperativeHandle:ow,useInsertionEffect:tw,useLayoutEffect:nw,useMemo:aw,useReducer:o0,useRef:J2,useState:function(){return o0(td)},useDebugValue:a0,useDeferredValue:function(c){var d=bs();return Zr===null?d.memoizedState=c:iw(d,Zr.memoizedState,c)},useTransition:function(){var c=o0(td)[0],d=bs().memoizedState;return[c,d]},useMutableSource:U2,useSyncExternalStore:G2,useId:lw,unstable_isNewReconciler:!1};function jc(c,d){try{var g="",b=d;do g+=dR(b),b=b.return;while(b);var C=g}catch(O){C=`
Error generating stack: `+O.message+`
`+O.stack}return{value:c,source:d,stack:C,digest:null}}function i0(c,d,g){return{value:c,source:null,stack:g??null,digest:d??null}}function l0(c,d){try{console.error(d.value)}catch(g){setTimeout(function(){throw g})}}var xR=typeof WeakMap=="function"?WeakMap:Map;function fw(c,d,g){g=ni(-1,g),g.tag=3,g.payload={element:null};var b=d.value;return g.callback=function(){jp||(jp=!0,I0=b),l0(c,d)},g}function pw(c,d,g){g=ni(-1,g),g.tag=3;var b=c.type.getDerivedStateFromError;if(typeof b=="function"){var C=d.value;g.payload=function(){return b(C)},g.callback=function(){l0(c,d)}}var O=c.stateNode;return O!==null&&typeof O.componentDidCatch=="function"&&(g.callback=function(){l0(c,d),typeof b!="function"&&(Ri===null?Ri=new Set([this]):Ri.add(this));var $=d.stack;this.componentDidCatch(d.value,{componentStack:$!==null?$:""})}),g}function hw(c,d,g){var b=c.pingCache;if(b===null){b=c.pingCache=new xR;var C=new Set;b.set(d,C)}else C=b.get(d),C===void 0&&(C=new Set,b.set(d,C));C.has(g)||(C.add(g),c=MR.bind(null,c,d,g),d.then(c,c))}function mw(c){do{var d;if((d=c.tag===13)&&(d=c.memoizedState,d=d!==null?d.dehydrated!==null:!0),d)return c;c=c.return}while(c!==null);return null}function gw(c,d,g,b,C){return c.mode&1?(c.flags|=65536,c.lanes=C,c):(c===d?c.flags|=65536:(c.flags|=128,g.flags|=131072,g.flags&=-52805,g.tag===1&&(g.alternate===null?g.tag=17:(d=ni(-1,1),d.tag=2,Ti(g,d,1))),g.lanes|=1),c)}var bR=l.ReactCurrentOwner,Bo=!1;function Oo(c,d,g,b){d.child=c===null?V2(d,null,g,b):_c(d,c.child,g,b)}function vw(c,d,g,b,C){g=g.render;var O=d.ref;return Cc(d,C),b=t0(c,d,g,b,O,C),g=n0(),c!==null&&!Bo?(d.updateQueue=c.updateQueue,d.flags&=-2053,c.lanes&=~C,ri(c,d,C)):(wr&&g&&Nv(d),d.flags|=1,Oo(c,d,b,C),d.child)}function yw(c,d,g,b,C){if(c===null){var O=g.type;return typeof O=="function"&&!D0(O)&&O.defaultProps===void 0&&g.compare===null&&g.defaultProps===void 0?(d.tag=15,d.type=O,xw(c,d,O,b,C)):(c=Mp(g.type,null,b,d,d.mode,C),c.ref=d.ref,c.return=d,d.child=c)}if(O=c.child,!(c.lanes&C)){var $=O.memoizedProps;if(g=g.compare,g=g!==null?g:tp,g($,b)&&c.ref===d.ref)return ri(c,d,C)}return d.flags|=1,c=Ni(O,b),c.ref=d.ref,c.return=d,d.child=c}function xw(c,d,g,b,C){if(c!==null){var O=c.memoizedProps;if(tp(O,b)&&c.ref===d.ref)if(Bo=!1,d.pendingProps=b=O,(c.lanes&C)!==0)c.flags&131072&&(Bo=!0);else return d.lanes=c.lanes,ri(c,d,C)}return c0(c,d,g,b,C)}function bw(c,d,g){var b=d.pendingProps,C=b.children,O=c!==null?c.memoizedState:null;if(b.mode==="hidden")if(!(d.mode&1))d.memoizedState={baseLanes:0,cachePool:null,transitions:null},Zt(Ec,ts),ts|=g;else{if(!(g&1073741824))return c=O!==null?O.baseLanes|g:g,d.lanes=d.childLanes=1073741824,d.memoizedState={baseLanes:c,cachePool:null,transitions:null},d.updateQueue=null,Zt(Ec,ts),ts|=c,null;d.memoizedState={baseLanes:0,cachePool:null,transitions:null},b=O!==null?O.baseLanes:g,Zt(Ec,ts),ts|=b}else O!==null?(b=O.baseLanes|g,d.memoizedState=null):b=g,Zt(Ec,ts),ts|=b;return Oo(c,d,C,g),d.child}function ww(c,d){var g=d.ref;(c===null&&g!==null||c!==null&&c.ref!==g)&&(d.flags|=512,d.flags|=2097152)}function c0(c,d,g,b,C){var O=xr(g)?Gn:on.current;return O=Kr(d,O),Cc(d,C),g=t0(c,d,g,b,O,C),b=n0(),c!==null&&!Bo?(d.updateQueue=c.updateQueue,d.flags&=-2053,c.lanes&=~C,ri(c,d,C)):(wr&&b&&Nv(d),d.flags|=1,Oo(c,d,g,C),d.child)}function Sw(c,d,g,b,C){if(xr(g)){var O=!0;br(d)}else O=!1;if(Cc(d,C),d.stateNode===null)mp(c,d),L2(d,g,b),Yv(d,g,b,C),b=!0;else if(c===null){var $=d.stateNode,J=d.memoizedProps;$.props=J;var pe=$.context,Fe=g.contextType;typeof Fe=="object"&&Fe!==null?Fe=ys(Fe):(Fe=xr(g)?Gn:on.current,Fe=Kr(d,Fe));var Ct=g.getDerivedStateFromProps,nn=typeof Ct=="function"||typeof $.getSnapshotBeforeUpdate=="function";nn||typeof $.UNSAFE_componentWillReceiveProps!="function"&&typeof $.componentWillReceiveProps!="function"||(J!==b||pe!==Fe)&&B2(d,$,b,Fe),Oi=!1;var ft=d.memoizedState;$.state=ft,sp(d,b,$,C),pe=d.memoizedState,J!==b||ft!==pe||hn.current||Oi?(typeof Ct=="function"&&(qv(d,g,Ct,b),pe=d.memoizedState),(J=Oi||$2(d,g,J,b,ft,pe,Fe))?(nn||typeof $.UNSAFE_componentWillMount!="function"&&typeof $.componentWillMount!="function"||(typeof $.componentWillMount=="function"&&$.componentWillMount(),typeof $.UNSAFE_componentWillMount=="function"&&$.UNSAFE_componentWillMount()),typeof $.componentDidMount=="function"&&(d.flags|=4194308)):(typeof $.componentDidMount=="function"&&(d.flags|=4194308),d.memoizedProps=b,d.memoizedState=pe),$.props=b,$.state=pe,$.context=Fe,b=J):(typeof $.componentDidMount=="function"&&(d.flags|=4194308),b=!1)}else{$=d.stateNode,D2(c,d),J=d.memoizedProps,Fe=d.type===d.elementType?J:Ys(d.type,J),$.props=Fe,nn=d.pendingProps,ft=$.context,pe=g.contextType,typeof pe=="object"&&pe!==null?pe=ys(pe):(pe=xr(g)?Gn:on.current,pe=Kr(d,pe));var mr=g.getDerivedStateFromProps;(Ct=typeof mr=="function"||typeof $.getSnapshotBeforeUpdate=="function")||typeof $.UNSAFE_componentWillReceiveProps!="function"&&typeof $.componentWillReceiveProps!="function"||(J!==nn||ft!==pe)&&B2(d,$,b,pe),Oi=!1,ft=d.memoizedState,$.state=ft,sp(d,b,$,C);var or=d.memoizedState;J!==nn||ft!==or||hn.current||Oi?(typeof mr=="function"&&(qv(d,g,mr,b),or=d.memoizedState),(Fe=Oi||$2(d,g,Fe,b,ft,or,pe)||!1)?(Ct||typeof $.UNSAFE_componentWillUpdate!="function"&&typeof $.componentWillUpdate!="function"||(typeof $.componentWillUpdate=="function"&&$.componentWillUpdate(b,or,pe),typeof $.UNSAFE_componentWillUpdate=="function"&&$.UNSAFE_componentWillUpdate(b,or,pe)),typeof $.componentDidUpdate=="function"&&(d.flags|=4),typeof $.getSnapshotBeforeUpdate=="function"&&(d.flags|=1024)):(typeof $.componentDidUpdate!="function"||J===c.memoizedProps&&ft===c.memoizedState||(d.flags|=4),typeof $.getSnapshotBeforeUpdate!="function"||J===c.memoizedProps&&ft===c.memoizedState||(d.flags|=1024),d.memoizedProps=b,d.memoizedState=or),$.props=b,$.state=or,$.context=pe,b=Fe):(typeof $.componentDidUpdate!="function"||J===c.memoizedProps&&ft===c.memoizedState||(d.flags|=4),typeof $.getSnapshotBeforeUpdate!="function"||J===c.memoizedProps&&ft===c.memoizedState||(d.flags|=1024),b=!1)}return u0(c,d,g,b,O,C)}function u0(c,d,g,b,C,O){ww(c,d);var $=(d.flags&128)!==0;if(!b&&!$)return C&&Ar(d,g,!1),ri(c,d,O);b=d.stateNode,bR.current=d;var J=$&&typeof g.getDerivedStateFromError!="function"?null:b.render();return d.flags|=1,c!==null&&$?(d.child=_c(d,c.child,null,O),d.child=_c(d,null,J,O)):Oo(c,d,J,O),d.memoizedState=b.state,C&&Ar(d,g,!0),d.child}function Cw(c){var d=c.stateNode;d.pendingContext?Vn(c,d.pendingContext,d.pendingContext!==d.context):d.context&&Vn(c,d.context,!1),Kv(c,d.containerInfo)}function _w(c,d,g,b,C){return wc(),Bv(C),d.flags|=256,Oo(c,d,g,b),d.child}var d0={dehydrated:null,treeContext:null,retryLane:0};function f0(c){return{baseLanes:c,cachePool:null,transitions:null}}function kw(c,d,g){var b=d.pendingProps,C=Or.current,O=!1,$=(d.flags&128)!==0,J;if((J=$)||(J=c!==null&&c.memoizedState===null?!1:(C&2)!==0),J?(O=!0,d.flags&=-129):(c===null||c.memoizedState!==null)&&(C|=1),Zt(Or,C&1),c===null)return Lv(d),c=d.memoizedState,c!==null&&(c=c.dehydrated,c!==null)?(d.mode&1?ms(c)?d.lanes=8:d.lanes=1073741824:d.lanes=1,null):($=b.children,c=b.fallback,O?(b=d.mode,O=d.child,$={mode:"hidden",children:$},!(b&1)&&O!==null?(O.childLanes=0,O.pendingProps=$):O=Dp($,b,0,null),c=Il(c,b,g,null),O.return=d,c.return=d,O.sibling=c,d.child=O,d.child.memoizedState=f0(g),d.memoizedState=d0,c):p0(d,$));if(C=c.memoizedState,C!==null&&(J=C.dehydrated,J!==null))return wR(c,d,$,b,J,C,g);if(O){O=b.fallback,$=d.mode,C=c.child,J=C.sibling;var pe={mode:"hidden",children:b.children};return!($&1)&&d.child!==C?(b=d.child,b.childLanes=0,b.pendingProps=pe,d.deletions=null):(b=Ni(C,pe),b.subtreeFlags=C.subtreeFlags&14680064),J!==null?O=Ni(J,O):(O=Il(O,$,g,null),O.flags|=2),O.return=d,b.return=d,b.sibling=O,d.child=b,b=O,O=d.child,$=c.child.memoizedState,$=$===null?f0(g):{baseLanes:$.baseLanes|g,cachePool:null,transitions:$.transitions},O.memoizedState=$,O.childLanes=c.childLanes&~g,d.memoizedState=d0,b}return O=c.child,c=O.sibling,b=Ni(O,{mode:"visible",children:b.children}),!(d.mode&1)&&(b.lanes=g),b.return=d,b.sibling=null,c!==null&&(g=d.deletions,g===null?(d.deletions=[c],d.flags|=16):g.push(c)),d.child=b,d.memoizedState=null,b}function p0(c,d){return d=Dp({mode:"visible",children:d},c.mode,0,null),d.return=c,c.child=d}function hp(c,d,g,b){return b!==null&&Bv(b),_c(d,c.child,null,g),c=p0(d,d.pendingProps.children),c.flags|=2,d.memoizedState=null,c}function wR(c,d,g,b,C,O,$){if(g)return d.flags&256?(d.flags&=-257,b=i0(Error(a(422))),hp(c,d,$,b)):d.memoizedState!==null?(d.child=c.child,d.flags|=128,null):(O=b.fallback,C=d.mode,b=Dp({mode:"visible",children:b.children},C,0,null),O=Il(O,C,$,null),O.flags|=2,b.return=d,O.return=d,b.sibling=O,d.child=b,d.mode&1&&_c(d,c.child,null,$),d.child.memoizedState=f0($),d.memoizedState=d0,O);if(!(d.mode&1))return hp(c,d,$,null);if(ms(C))return b=Ja(C).digest,O=Error(a(419)),b=i0(O,b,void 0),hp(c,d,$,b);if(g=($&c.childLanes)!==0,Bo||g){if(b=ro,b!==null){switch($&-$){case 4:C=2;break;case 16:C=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:C=32;break;case 536870912:C=268435456;break;default:C=0}C=C&(b.suspendedLanes|$)?0:C,C!==0&&C!==O.retryLane&&(O.retryLane=C,Ia(c,C),ws(b,c,C,-1))}return M0(),b=i0(Error(a(421))),hp(c,d,$,b)}return Yr(C)?(d.flags|=128,d.child=c.child,d=DR.bind(null,c),Ii(C,d),null):(c=O.treeContext,ke&&(vs=me(C),es=d,wr=!0,qs=null,Ku=!1,c!==null&&(Io[Eo++]=Jo,Io[Eo++]=mo,Io[Eo++]=gs,Jo=c.id,mo=c.overflow,gs=d)),d=p0(d,b.children),d.flags|=4096,d)}function Pw(c,d,g){c.lanes|=d;var b=c.alternate;b!==null&&(b.lanes|=d),Wv(c.return,d,g)}function h0(c,d,g,b,C){var O=c.memoizedState;O===null?c.memoizedState={isBackwards:d,rendering:null,renderingStartTime:0,last:b,tail:g,tailMode:C}:(O.isBackwards=d,O.rendering=null,O.renderingStartTime=0,O.last=b,O.tail=g,O.tailMode=C)}function jw(c,d,g){var b=d.pendingProps,C=b.revealOrder,O=b.tail;if(Oo(c,d,b.children,g),b=Or.current,b&2)b=b&1|2,d.flags|=128;else{if(c!==null&&c.flags&128)e:for(c=d.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&Pw(c,g,d);else if(c.tag===19)Pw(c,g,d);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===d)break e;for(;c.sibling===null;){if(c.return===null||c.return===d)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}b&=1}if(Zt(Or,b),!(d.mode&1))d.memoizedState=null;else switch(C){case"forwards":for(g=d.child,C=null;g!==null;)c=g.alternate,c!==null&&lp(c)===null&&(C=g),g=g.sibling;g=C,g===null?(C=d.child,d.child=null):(C=g.sibling,g.sibling=null),h0(d,!1,C,g,O);break;case"backwards":for(g=null,C=d.child,d.child=null;C!==null;){if(c=C.alternate,c!==null&&lp(c)===null){d.child=C;break}c=C.sibling,C.sibling=g,g=C,C=c}h0(d,!0,g,null,O);break;case"together":h0(d,!1,null,null,void 0);break;default:d.memoizedState=null}return d.child}function mp(c,d){!(d.mode&1)&&c!==null&&(c.alternate=null,d.alternate=null,d.flags|=2)}function ri(c,d,g){if(c!==null&&(d.dependencies=c.dependencies),_l|=d.lanes,!(g&d.childLanes))return null;if(c!==null&&d.child!==c.child)throw Error(a(153));if(d.child!==null){for(c=d.child,g=Ni(c,c.pendingProps),d.child=g,g.return=d;c.sibling!==null;)c=c.sibling,g=g.sibling=Ni(c,c.pendingProps),g.return=d;g.sibling=null}return d.child}function SR(c,d,g){switch(d.tag){case 3:Cw(d),wc();break;case 5:W2(d);break;case 1:xr(d.type)&&br(d);break;case 4:Kv(d,d.stateNode.containerInfo);break;case 10:R2(d,d.type._context,d.memoizedProps.value);break;case 13:var b=d.memoizedState;if(b!==null)return b.dehydrated!==null?(Zt(Or,Or.current&1),d.flags|=128,null):g&d.child.childLanes?kw(c,d,g):(Zt(Or,Or.current&1),c=ri(c,d,g),c!==null?c.sibling:null);Zt(Or,Or.current&1);break;case 19:if(b=(g&d.childLanes)!==0,c.flags&128){if(b)return jw(c,d,g);d.flags|=128}var C=d.memoizedState;if(C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),Zt(Or,Or.current),b)break;return null;case 22:case 23:return d.lanes=0,bw(c,d,g)}return ri(c,d,g)}function Ta(c){c.flags|=4}function Iw(c,d){if(c!==null&&c.child===d.child)return!0;if(d.flags&16)return!1;for(c=d.child;c!==null;){if(c.flags&12854||c.subtreeFlags&12854)return!1;c=c.sibling}return!0}var rd,od,gp,vp;if(fe)rd=function(c,d){for(var g=d.child;g!==null;){if(g.tag===5||g.tag===6)le(c,g.stateNode);else if(g.tag!==4&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===d)break;for(;g.sibling===null;){if(g.return===null||g.return===d)return;g=g.return}g.sibling.return=g.return,g=g.sibling}},od=function(){},gp=function(c,d,g,b,C){if(c=c.memoizedProps,c!==b){var O=d.stateNode,$=Ea(xs.current);g=X(O,g,c,b,C,$),(d.updateQueue=g)&&Ta(d)}},vp=function(c,d,g,b){g!==b&&Ta(d)};else if(xe){rd=function(c,d,g,b){for(var C=d.child;C!==null;){if(C.tag===5){var O=C.stateNode;g&&b&&(O=ps(O,C.type,C.memoizedProps,C)),le(c,O)}else if(C.tag===6)O=C.stateNode,g&&b&&(O=hs(O,C.memoizedProps,C)),le(c,O);else if(C.tag!==4){if(C.tag===22&&C.memoizedState!==null)O=C.child,O!==null&&(O.return=C),rd(c,C,!0,!0);else if(C.child!==null){C.child.return=C,C=C.child;continue}}if(C===d)break;for(;C.sibling===null;){if(C.return===null||C.return===d)return;C=C.return}C.sibling.return=C.return,C=C.sibling}};var Ew=function(c,d,g,b){for(var C=d.child;C!==null;){if(C.tag===5){var O=C.stateNode;g&&b&&(O=ps(O,C.type,C.memoizedProps,C)),Qn(c,O)}else if(C.tag===6)O=C.stateNode,g&&b&&(O=hs(O,C.memoizedProps,C)),Qn(c,O);else if(C.tag!==4){if(C.tag===22&&C.memoizedState!==null)O=C.child,O!==null&&(O.return=C),Ew(c,C,!0,!0);else if(C.child!==null){C.child.return=C,C=C.child;continue}}if(C===d)break;for(;C.sibling===null;){if(C.return===null||C.return===d)return;C=C.return}C.sibling.return=C.return,C=C.sibling}};od=function(c,d){var g=d.stateNode;if(!Iw(c,d)){c=g.containerInfo;var b=Kn(c);Ew(b,d,!1,!1),g.pendingChildren=b,Ta(d),Ws(c,b)}},gp=function(c,d,g,b,C){var O=c.stateNode,$=c.memoizedProps;if((c=Iw(c,d))&&$===b)d.stateNode=O;else{var J=d.stateNode,pe=Ea(xs.current),Fe=null;$!==b&&(Fe=X(J,g,$,b,C,pe)),c&&Fe===null?d.stateNode=O:(O=Hr(O,Fe,g,$,b,d,c,J),oe(O,g,b,C,pe)&&Ta(d),d.stateNode=O,c?Ta(d):rd(O,d,!1,!1))}},vp=function(c,d,g,b){g!==b?(c=Ea(kc.current),g=Ea(xs.current),d.stateNode=ie(b,c,g,d),Ta(d)):d.stateNode=c.stateNode}}else od=function(){},gp=function(){},vp=function(){};function sd(c,d){if(!wr)switch(c.tailMode){case"hidden":d=c.tail;for(var g=null;d!==null;)d.alternate!==null&&(g=d),d=d.sibling;g===null?c.tail=null:g.sibling=null;break;case"collapsed":g=c.tail;for(var b=null;g!==null;)g.alternate!==null&&(b=g),g=g.sibling;b===null?d||c.tail===null?c.tail=null:c.tail.sibling=null:b.sibling=null}}function vo(c){var d=c.alternate!==null&&c.alternate.child===c.child,g=0,b=0;if(d)for(var C=c.child;C!==null;)g|=C.lanes|C.childLanes,b|=C.subtreeFlags&14680064,b|=C.flags&14680064,C.return=c,C=C.sibling;else for(C=c.child;C!==null;)g|=C.lanes|C.childLanes,b|=C.subtreeFlags,b|=C.flags,C.return=c,C=C.sibling;return c.subtreeFlags|=b,c.childLanes=g,d}function CR(c,d,g){var b=d.pendingProps;switch(zv(d),d.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vo(d),null;case 1:return xr(d.type)&&Dt(),vo(d),null;case 3:return g=d.stateNode,Pc(),Wt(hn),Wt(on),Qv(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(c===null||c.child===null)&&(ep(d)?Ta(d):c===null||c.memoizedState.isDehydrated&&!(d.flags&256)||(d.flags|=1024,qs!==null&&(T0(qs),qs=null))),od(c,d),vo(d),null;case 5:Xv(d),g=Ea(kc.current);var C=d.type;if(c!==null&&d.stateNode!=null)gp(c,d,C,b,g),c.ref!==d.ref&&(d.flags|=512,d.flags|=2097152);else{if(!b){if(d.stateNode===null)throw Error(a(166));return vo(d),null}if(c=Ea(xs.current),ep(d)){if(!ke)throw Error(a(175));c=we(d.stateNode,d.type,d.memoizedProps,g,c,d,!Ku),d.updateQueue=c,c!==null&&Ta(d)}else{var O=ee(C,b,g,c,d);rd(O,d,!1,!1),d.stateNode=O,oe(O,C,b,g,c)&&Ta(d)}d.ref!==null&&(d.flags|=512,d.flags|=2097152)}return vo(d),null;case 6:if(c&&d.stateNode!=null)vp(c,d,c.memoizedProps,b);else{if(typeof b!="string"&&d.stateNode===null)throw Error(a(166));if(c=Ea(kc.current),g=Ea(xs.current),ep(d)){if(!ke)throw Error(a(176));if(c=d.stateNode,g=d.memoizedProps,(b=_e(c,g,d,!Ku))&&(C=es,C!==null))switch(C.tag){case 3:Qe(C.stateNode.containerInfo,c,g,(C.mode&1)!==0);break;case 5:Mt(C.type,C.memoizedProps,C.stateNode,c,g,(C.mode&1)!==0)}b&&Ta(d)}else d.stateNode=ie(b,c,g,d)}return vo(d),null;case 13:if(Wt(Or),b=d.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(wr&&vs!==null&&d.mode&1&&!(d.flags&128))T2(),wc(),d.flags|=98560,C=!1;else if(C=ep(d),b!==null&&b.dehydrated!==null){if(c===null){if(!C)throw Error(a(318));if(!ke)throw Error(a(344));if(C=d.memoizedState,C=C!==null?C.dehydrated:null,!C)throw Error(a(317));ot(C,d)}else wc(),!(d.flags&128)&&(d.memoizedState=null),d.flags|=4;vo(d),C=!1}else qs!==null&&(T0(qs),qs=null),C=!0;if(!C)return d.flags&65536?d:null}return d.flags&128?(d.lanes=g,d):(g=b!==null,g!==(c!==null&&c.memoizedState!==null)&&g&&(d.child.flags|=8192,d.mode&1&&(c===null||Or.current&1?Qr===0&&(Qr=3):M0())),d.updateQueue!==null&&(d.flags|=4),vo(d),null);case 4:return Pc(),od(c,d),c===null&&Pe(d.stateNode.containerInfo),vo(d),null;case 10:return Vv(d.type._context),vo(d),null;case 17:return xr(d.type)&&Dt(),vo(d),null;case 19:if(Wt(Or),C=d.memoizedState,C===null)return vo(d),null;if(b=(d.flags&128)!==0,O=C.rendering,O===null)if(b)sd(C,!1);else{if(Qr!==0||c!==null&&c.flags&128)for(c=d.child;c!==null;){if(O=lp(c),O!==null){for(d.flags|=128,sd(C,!1),c=O.updateQueue,c!==null&&(d.updateQueue=c,d.flags|=4),d.subtreeFlags=0,c=g,g=d.child;g!==null;)b=g,C=c,b.flags&=14680066,O=b.alternate,O===null?(b.childLanes=0,b.lanes=C,b.child=null,b.subtreeFlags=0,b.memoizedProps=null,b.memoizedState=null,b.updateQueue=null,b.dependencies=null,b.stateNode=null):(b.childLanes=O.childLanes,b.lanes=O.lanes,b.child=O.child,b.subtreeFlags=0,b.deletions=null,b.memoizedProps=O.memoizedProps,b.memoizedState=O.memoizedState,b.updateQueue=O.updateQueue,b.type=O.type,C=O.dependencies,b.dependencies=C===null?null:{lanes:C.lanes,firstContext:C.firstContext}),g=g.sibling;return Zt(Or,Or.current&1|2),d.child}c=c.sibling}C.tail!==null&&Ge()>j0&&(d.flags|=128,b=!0,sd(C,!1),d.lanes=4194304)}else{if(!b)if(c=lp(O),c!==null){if(d.flags|=128,b=!0,c=c.updateQueue,c!==null&&(d.updateQueue=c,d.flags|=4),sd(C,!0),C.tail===null&&C.tailMode==="hidden"&&!O.alternate&&!wr)return vo(d),null}else 2*Ge()-C.renderingStartTime>j0&&g!==1073741824&&(d.flags|=128,b=!0,sd(C,!1),d.lanes=4194304);C.isBackwards?(O.sibling=d.child,d.child=O):(c=C.last,c!==null?c.sibling=O:d.child=O,C.last=O)}return C.tail!==null?(d=C.tail,C.rendering=d,C.tail=d.sibling,C.renderingStartTime=Ge(),d.sibling=null,c=Or.current,Zt(Or,b?c&1|2:c&1),d):(vo(d),null);case 22:case 23:return R0(),g=d.memoizedState!==null,c!==null&&c.memoizedState!==null!==g&&(d.flags|=8192),g&&d.mode&1?ts&1073741824&&(vo(d),fe&&d.subtreeFlags&6&&(d.flags|=8192)):vo(d),null;case 24:return null;case 25:return null}throw Error(a(156,d.tag))}function _R(c,d){switch(zv(d),d.tag){case 1:return xr(d.type)&&Dt(),c=d.flags,c&65536?(d.flags=c&-65537|128,d):null;case 3:return Pc(),Wt(hn),Wt(on),Qv(),c=d.flags,c&65536&&!(c&128)?(d.flags=c&-65537|128,d):null;case 5:return Xv(d),null;case 13:if(Wt(Or),c=d.memoizedState,c!==null&&c.dehydrated!==null){if(d.alternate===null)throw Error(a(340));wc()}return c=d.flags,c&65536?(d.flags=c&-65537|128,d):null;case 19:return Wt(Or),null;case 4:return Pc(),null;case 10:return Vv(d.type._context),null;case 22:case 23:return R0(),null;case 24:return null;default:return null}}var yp=!1,yo=!1,kR=typeof WeakSet=="function"?WeakSet:Set,wt=null;function Ic(c,d){var g=c.ref;if(g!==null)if(typeof g=="function")try{g(null)}catch(b){Sr(c,d,b)}else g.current=null}function m0(c,d,g){try{g()}catch(b){Sr(c,d,b)}}var Ow=!1;function PR(c,d){for(W(c.containerInfo),wt=d;wt!==null;)if(c=wt,d=c.child,(c.subtreeFlags&1028)!==0&&d!==null)d.return=c,wt=d;else for(;wt!==null;){c=wt;try{var g=c.alternate;if(c.flags&1024)switch(c.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var b=g.memoizedProps,C=g.memoizedState,O=c.stateNode,$=O.getSnapshotBeforeUpdate(c.elementType===c.type?b:Ys(c.type,b),C);O.__reactInternalSnapshotBeforeUpdate=$}break;case 3:fe&&vn(c.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(a(163))}}catch(J){Sr(c,c.return,J)}if(d=c.sibling,d!==null){d.return=c.return,wt=d;break}wt=c.return}return g=Ow,Ow=!1,g}function ad(c,d,g){var b=d.updateQueue;if(b=b!==null?b.lastEffect:null,b!==null){var C=b=b.next;do{if((C.tag&c)===c){var O=C.destroy;C.destroy=void 0,O!==void 0&&m0(d,g,O)}C=C.next}while(C!==b)}}function xp(c,d){if(d=d.updateQueue,d=d!==null?d.lastEffect:null,d!==null){var g=d=d.next;do{if((g.tag&c)===c){var b=g.create;g.destroy=b()}g=g.next}while(g!==d)}}function g0(c){var d=c.ref;if(d!==null){var g=c.stateNode;switch(c.tag){case 5:c=G(g);break;default:c=g}typeof d=="function"?d(c):d.current=c}}function Tw(c){var d=c.alternate;d!==null&&(c.alternate=null,Tw(d)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(d=c.stateNode,d!==null&&ze(d)),c.stateNode=null,c.return=null,c.dependencies=null,c.memoizedProps=null,c.memoizedState=null,c.pendingProps=null,c.stateNode=null,c.updateQueue=null}function Rw(c){return c.tag===5||c.tag===3||c.tag===4}function Mw(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||Rw(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function v0(c,d,g){var b=c.tag;if(b===5||b===6)c=c.stateNode,d?On(g,c,d):ut(g,c);else if(b!==4&&(c=c.child,c!==null))for(v0(c,d,g),c=c.sibling;c!==null;)v0(c,d,g),c=c.sibling}function y0(c,d,g){var b=c.tag;if(b===5||b===6)c=c.stateNode,d?Xe(g,c,d):ge(g,c);else if(b!==4&&(c=c.child,c!==null))for(y0(c,d,g),c=c.sibling;c!==null;)y0(c,d,g),c=c.sibling}var io=null,Ks=!1;function Ra(c,d,g){for(g=g.child;g!==null;)x0(c,d,g),g=g.sibling}function x0(c,d,g){if(In&&typeof In.onCommitFiberUnmount=="function")try{In.onCommitFiberUnmount(hr,g)}catch{}switch(g.tag){case 5:yo||Ic(g,d);case 6:if(fe){var b=io,C=Ks;io=null,Ra(c,d,g),io=b,Ks=C,io!==null&&(Ks?Ye(io,g.stateNode):Ie(io,g.stateNode))}else Ra(c,d,g);break;case 18:fe&&io!==null&&(Ks?rt(io,g.stateNode):Ze(io,g.stateNode));break;case 4:fe?(b=io,C=Ks,io=g.stateNode.containerInfo,Ks=!0,Ra(c,d,g),io=b,Ks=C):(xe&&(b=g.stateNode.containerInfo,C=Kn(b),Tn(b,C)),Ra(c,d,g));break;case 0:case 11:case 14:case 15:if(!yo&&(b=g.updateQueue,b!==null&&(b=b.lastEffect,b!==null))){C=b=b.next;do{var O=C,$=O.destroy;O=O.tag,$!==void 0&&(O&2||O&4)&&m0(g,d,$),C=C.next}while(C!==b)}Ra(c,d,g);break;case 1:if(!yo&&(Ic(g,d),b=g.stateNode,typeof b.componentWillUnmount=="function"))try{b.props=g.memoizedProps,b.state=g.memoizedState,b.componentWillUnmount()}catch(J){Sr(g,d,J)}Ra(c,d,g);break;case 21:Ra(c,d,g);break;case 22:g.mode&1?(yo=(b=yo)||g.memoizedState!==null,Ra(c,d,g),yo=b):Ra(c,d,g);break;default:Ra(c,d,g)}}function Dw(c){var d=c.updateQueue;if(d!==null){c.updateQueue=null;var g=c.stateNode;g===null&&(g=c.stateNode=new kR),d.forEach(function(b){var C=AR.bind(null,c,b);g.has(b)||(g.add(b),b.then(C,C))})}}function Xs(c,d){var g=d.deletions;if(g!==null)for(var b=0;b<g.length;b++){var C=g[b];try{var O=c,$=d;if(fe){var J=$;e:for(;J!==null;){switch(J.tag){case 5:io=J.stateNode,Ks=!1;break e;case 3:io=J.stateNode.containerInfo,Ks=!0;break e;case 4:io=J.stateNode.containerInfo,Ks=!0;break e}J=J.return}if(io===null)throw Error(a(160));x0(O,$,C),io=null,Ks=!1}else x0(O,$,C);var pe=C.alternate;pe!==null&&(pe.return=null),C.return=null}catch(Fe){Sr(C,d,Fe)}}if(d.subtreeFlags&12854)for(d=d.child;d!==null;)Aw(d,c),d=d.sibling}function Aw(c,d){var g=c.alternate,b=c.flags;switch(c.tag){case 0:case 11:case 14:case 15:if(Xs(d,c),Ma(c),b&4){try{ad(3,c,c.return),xp(3,c)}catch(ft){Sr(c,c.return,ft)}try{ad(5,c,c.return)}catch(ft){Sr(c,c.return,ft)}}break;case 1:Xs(d,c),Ma(c),b&512&&g!==null&&Ic(g,g.return);break;case 5:if(Xs(d,c),Ma(c),b&512&&g!==null&&Ic(g,g.return),fe){if(c.flags&32){var C=c.stateNode;try{ht(C)}catch(ft){Sr(c,c.return,ft)}}if(b&4&&(C=c.stateNode,C!=null)){var O=c.memoizedProps;if(g=g!==null?g.memoizedProps:O,b=c.type,d=c.updateQueue,c.updateQueue=null,d!==null)try{$e(C,d,b,g,O,c)}catch(ft){Sr(c,c.return,ft)}}}break;case 6:if(Xs(d,c),Ma(c),b&4&&fe){if(c.stateNode===null)throw Error(a(162));C=c.stateNode,O=c.memoizedProps,g=g!==null?g.memoizedProps:O;try{Rt(C,g,O)}catch(ft){Sr(c,c.return,ft)}}break;case 3:if(Xs(d,c),Ma(c),b&4){if(fe&&ke&&g!==null&&g.memoizedState.isDehydrated)try{Xt(d.containerInfo)}catch(ft){Sr(c,c.return,ft)}if(xe){C=d.containerInfo,O=d.pendingChildren;try{Tn(C,O)}catch(ft){Sr(c,c.return,ft)}}}break;case 4:if(Xs(d,c),Ma(c),b&4&&xe){O=c.stateNode,C=O.containerInfo,O=O.pendingChildren;try{Tn(C,O)}catch(ft){Sr(c,c.return,ft)}}break;case 13:Xs(d,c),Ma(c),C=c.child,C.flags&8192&&(O=C.memoizedState!==null,C.stateNode.isHidden=O,!O||C.alternate!==null&&C.alternate.memoizedState!==null||(P0=Ge())),b&4&&Dw(c);break;case 22:var $=g!==null&&g.memoizedState!==null;if(c.mode&1?(yo=(g=yo)||$,Xs(d,c),yo=g):Xs(d,c),Ma(c),b&8192){if(g=c.memoizedState!==null,(c.stateNode.isHidden=g)&&!$&&c.mode&1)for(wt=c,b=c.child;b!==null;){for(d=wt=b;wt!==null;){$=wt;var J=$.child;switch($.tag){case 0:case 11:case 14:case 15:ad(4,$,$.return);break;case 1:Ic($,$.return);var pe=$.stateNode;if(typeof pe.componentWillUnmount=="function"){var Fe=$,Ct=$.return;try{var nn=Fe;pe.props=nn.memoizedProps,pe.state=nn.memoizedState,pe.componentWillUnmount()}catch(ft){Sr(Fe,Ct,ft)}}break;case 5:Ic($,$.return);break;case 22:if($.memoizedState!==null){$w(d);continue}}J!==null?(J.return=$,wt=J):$w(d)}b=b.sibling}if(fe){e:if(b=null,fe)for(d=c;;){if(d.tag===5){if(b===null){b=d;try{C=d.stateNode,g?vt(C):Er(d.stateNode,d.memoizedProps)}catch(ft){Sr(c,c.return,ft)}}}else if(d.tag===6){if(b===null)try{O=d.stateNode,g?Gt(O):gn(O,d.memoizedProps)}catch(ft){Sr(c,c.return,ft)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===c)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===c)break e;for(;d.sibling===null;){if(d.return===null||d.return===c)break e;b===d&&(b=null),d=d.return}b===d&&(b=null),d.sibling.return=d.return,d=d.sibling}}}break;case 19:Xs(d,c),Ma(c),b&4&&Dw(c);break;case 21:break;default:Xs(d,c),Ma(c)}}function Ma(c){var d=c.flags;if(d&2){try{if(fe){e:{for(var g=c.return;g!==null;){if(Rw(g)){var b=g;break e}g=g.return}throw Error(a(160))}switch(b.tag){case 5:var C=b.stateNode;b.flags&32&&(ht(C),b.flags&=-33);var O=Mw(c);y0(c,O,C);break;case 3:case 4:var $=b.stateNode.containerInfo,J=Mw(c);v0(c,J,$);break;default:throw Error(a(161))}}}catch(pe){Sr(c,c.return,pe)}c.flags&=-3}d&4096&&(c.flags&=-4097)}function jR(c,d,g){wt=c,Nw(c)}function Nw(c,d,g){for(var b=(c.mode&1)!==0;wt!==null;){var C=wt,O=C.child;if(C.tag===22&&b){var $=C.memoizedState!==null||yp;if(!$){var J=C.alternate,pe=J!==null&&J.memoizedState!==null||yo;J=yp;var Fe=yo;if(yp=$,(yo=pe)&&!Fe)for(wt=C;wt!==null;)$=wt,pe=$.child,$.tag===22&&$.memoizedState!==null?Lw(C):pe!==null?(pe.return=$,wt=pe):Lw(C);for(;O!==null;)wt=O,Nw(O),O=O.sibling;wt=C,yp=J,yo=Fe}zw(c)}else C.subtreeFlags&8772&&O!==null?(O.return=C,wt=O):zw(c)}}function zw(c){for(;wt!==null;){var d=wt;if(d.flags&8772){var g=d.alternate;try{if(d.flags&8772)switch(d.tag){case 0:case 11:case 15:yo||xp(5,d);break;case 1:var b=d.stateNode;if(d.flags&4&&!yo)if(g===null)b.componentDidMount();else{var C=d.elementType===d.type?g.memoizedProps:Ys(d.type,g.memoizedProps);b.componentDidUpdate(C,g.memoizedState,b.__reactInternalSnapshotBeforeUpdate)}var O=d.updateQueue;O!==null&&N2(d,O,b);break;case 3:var $=d.updateQueue;if($!==null){if(g=null,d.child!==null)switch(d.child.tag){case 5:g=G(d.child.stateNode);break;case 1:g=d.child.stateNode}N2(d,$,g)}break;case 5:var J=d.stateNode;g===null&&d.flags&4&&en(J,d.type,d.memoizedProps,d);break;case 6:break;case 4:break;case 12:break;case 13:if(ke&&d.memoizedState===null){var pe=d.alternate;if(pe!==null){var Fe=pe.memoizedState;if(Fe!==null){var Ct=Fe.dehydrated;Ct!==null&&bt(Ct)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(a(163))}yo||d.flags&512&&g0(d)}catch(nn){Sr(d,d.return,nn)}}if(d===c){wt=null;break}if(g=d.sibling,g!==null){g.return=d.return,wt=g;break}wt=d.return}}function $w(c){for(;wt!==null;){var d=wt;if(d===c){wt=null;break}var g=d.sibling;if(g!==null){g.return=d.return,wt=g;break}wt=d.return}}function Lw(c){for(;wt!==null;){var d=wt;try{switch(d.tag){case 0:case 11:case 15:var g=d.return;try{xp(4,d)}catch(pe){Sr(d,g,pe)}break;case 1:var b=d.stateNode;if(typeof b.componentDidMount=="function"){var C=d.return;try{b.componentDidMount()}catch(pe){Sr(d,C,pe)}}var O=d.return;try{g0(d)}catch(pe){Sr(d,O,pe)}break;case 5:var $=d.return;try{g0(d)}catch(pe){Sr(d,$,pe)}}}catch(pe){Sr(d,d.return,pe)}if(d===c){wt=null;break}var J=d.sibling;if(J!==null){J.return=d.return,wt=J;break}wt=d.return}}var bp=0,wp=1,Sp=2,Cp=3,_p=4;if(typeof Symbol=="function"&&Symbol.for){var id=Symbol.for;bp=id("selector.component"),wp=id("selector.has_pseudo_class"),Sp=id("selector.role"),Cp=id("selector.test_id"),_p=id("selector.text")}function b0(c){var d=ae(c);if(d!=null){if(typeof d.memoizedProps["data-testname"]!="string")throw Error(a(364));return d}if(c=bn(c),c===null)throw Error(a(362));return c.stateNode.current}function w0(c,d){switch(d.$$typeof){case bp:if(c.type===d.value)return!0;break;case wp:e:{d=d.value,c=[c,0];for(var g=0;g<c.length;){var b=c[g++],C=c[g++],O=d[C];if(b.tag!==5||!ne(b)){for(;O!=null&&w0(b,O);)C++,O=d[C];if(C===d.length){d=!0;break e}else for(b=b.child;b!==null;)c.push(b,C),b=b.sibling}}d=!1}return d;case Sp:if(c.tag===5&&he(c.stateNode,d.value))return!0;break;case _p:if((c.tag===5||c.tag===6)&&(c=Se(c),c!==null&&0<=c.indexOf(d.value)))return!0;break;case Cp:if(c.tag===5&&(c=c.memoizedProps["data-testname"],typeof c=="string"&&c.toLowerCase()===d.value.toLowerCase()))return!0;break;default:throw Error(a(365))}return!1}function S0(c){switch(c.$$typeof){case bp:return"<"+(T(c.value)||"Unknown")+">";case wp:return":has("+(S0(c)||"")+")";case Sp:return'[role="'+c.value+'"]';case _p:return'"'+c.value+'"';case Cp:return'[data-testname="'+c.value+'"]';default:throw Error(a(365))}}function Bw(c,d){var g=[];c=[c,0];for(var b=0;b<c.length;){var C=c[b++],O=c[b++],$=d[O];if(C.tag!==5||!ne(C)){for(;$!=null&&w0(C,$);)O++,$=d[O];if(O===d.length)g.push(C);else for(C=C.child;C!==null;)c.push(C,O),C=C.sibling}}return g}function C0(c,d){if(!pt)throw Error(a(363));c=b0(c),c=Bw(c,d),d=[],c=Array.from(c);for(var g=0;g<c.length;){var b=c[g++];if(b.tag===5)ne(b)||d.push(b.stateNode);else for(b=b.child;b!==null;)c.push(b),b=b.sibling}return d}var IR=Math.ceil,kp=l.ReactCurrentDispatcher,_0=l.ReactCurrentOwner,Lr=l.ReactCurrentBatchConfig,mn=0,ro=null,Vr=null,lo=0,ts=0,Ec=Vt(0),Qr=0,ld=null,_l=0,Pp=0,k0=0,cd=null,Fo=null,P0=0,j0=1/0,oi=null;function Oc(){j0=Ge()+500}var jp=!1,I0=null,Ri=null,Ip=!1,Mi=null,Ep=0,ud=0,E0=null,Op=-1,Tp=0;function xo(){return mn&6?Ge():Op!==-1?Op:Op=Ge()}function Di(c){return c.mode&1?mn&2&&lo!==0?lo&-lo:uR.transition!==null?(Tp===0&&(Tp=jt()),Tp):(c=Ee,c!==0?c:tt()):1}function ws(c,d,g,b){if(50<ud)throw ud=0,E0=null,Error(a(185));St(c,g,b),(!(mn&2)||c!==ro)&&(c===ro&&(!(mn&2)&&(Pp|=g),Qr===4&&Ai(c,lo)),Ho(c,b),g===1&&mn===0&&!(d.mode&1)&&(Oc(),ao&&Qo()))}function Ho(c,d){var g=c.callbackNode;Et(c,d);var b=Je(c,c===ro?lo:0);if(b===0)g!==null&&st(g),c.callbackNode=null,c.callbackPriority=0;else if(d=b&-b,c.callbackPriority!==d){if(g!=null&&st(g),d===1)c.tag===0?Jf(Hw.bind(null,c)):Ei(Hw.bind(null,c)),We?It(function(){!(mn&6)&&Qo()}):Ue(an,Qo),g=null;else{switch(Le(b)){case 1:g=an;break;case 4:g=An;break;case 16:g=kn;break;case 536870912:g=Nr;break;default:g=kn}g=Zw(g,Fw.bind(null,c))}c.callbackPriority=d,c.callbackNode=g}}function Fw(c,d){if(Op=-1,Tp=0,mn&6)throw Error(a(327));var g=c.callbackNode;if(jl()&&c.callbackNode!==g)return null;var b=Je(c,c===ro?lo:0);if(b===0)return null;if(b&30||b&c.expiredLanes||d)d=Rp(c,b);else{d=b;var C=mn;mn|=2;var O=Uw();(ro!==c||lo!==d)&&(oi=null,Oc(),kl(c,d));do try{TR();break}catch(J){Ww(c,J)}while(1);Hv(),kp.current=O,mn=C,Vr!==null?d=0:(ro=null,lo=0,d=Qr)}if(d!==0){if(d===2&&(C=dt(c),C!==0&&(b=C,d=O0(c,C))),d===1)throw g=ld,kl(c,0),Ai(c,b),Ho(c,Ge()),g;if(d===6)Ai(c,b);else{if(C=c.current.alternate,!(b&30)&&!ER(C)&&(d=Rp(c,b),d===2&&(O=dt(c),O!==0&&(b=O,d=O0(c,O))),d===1))throw g=ld,kl(c,0),Ai(c,b),Ho(c,Ge()),g;switch(c.finishedWork=C,c.finishedLanes=b,d){case 0:case 1:throw Error(a(345));case 2:Pl(c,Fo,oi);break;case 3:if(Ai(c,b),(b&130023424)===b&&(d=P0+500-Ge(),10<d)){if(Je(c,0)!==0)break;if(C=c.suspendedLanes,(C&b)!==b){xo(),c.pingedLanes|=c.suspendedLanes&C;break}c.timeoutHandle=ve(Pl.bind(null,c,Fo,oi),d);break}Pl(c,Fo,oi);break;case 4:if(Ai(c,b),(b&4194240)===b)break;for(d=c.eventTimes,C=-1;0<b;){var $=31-tr(b);O=1<<$,$=d[$],$>C&&(C=$),b&=~O}if(b=C,b=Ge()-b,b=(120>b?120:480>b?480:1080>b?1080:1920>b?1920:3e3>b?3e3:4320>b?4320:1960*IR(b/1960))-b,10<b){c.timeoutHandle=ve(Pl.bind(null,c,Fo,oi),b);break}Pl(c,Fo,oi);break;case 5:Pl(c,Fo,oi);break;default:throw Error(a(329))}}}return Ho(c,Ge()),c.callbackNode===g?Fw.bind(null,c):null}function O0(c,d){var g=cd;return c.current.memoizedState.isDehydrated&&(kl(c,d).flags|=256),c=Rp(c,d),c!==2&&(d=Fo,Fo=g,d!==null&&T0(d)),c}function T0(c){Fo===null?Fo=c:Fo.push.apply(Fo,c)}function ER(c){for(var d=c;;){if(d.flags&16384){var g=d.updateQueue;if(g!==null&&(g=g.stores,g!==null))for(var b=0;b<g.length;b++){var C=g[b],O=C.getSnapshot;C=C.value;try{if(!Sn(O(),C))return!1}catch{return!1}}}if(g=d.child,d.subtreeFlags&16384&&g!==null)g.return=d,d=g;else{if(d===c)break;for(;d.sibling===null;){if(d.return===null||d.return===c)return!0;d=d.return}d.sibling.return=d.return,d=d.sibling}}return!0}function Ai(c,d){for(d&=~k0,d&=~Pp,c.suspendedLanes|=d,c.pingedLanes&=~d,c=c.expirationTimes;0<d;){var g=31-tr(d),b=1<<g;c[g]=-1,d&=~b}}function Hw(c){if(mn&6)throw Error(a(327));jl();var d=Je(c,0);if(!(d&1))return Ho(c,Ge()),null;var g=Rp(c,d);if(c.tag!==0&&g===2){var b=dt(c);b!==0&&(d=b,g=O0(c,b))}if(g===1)throw g=ld,kl(c,0),Ai(c,d),Ho(c,Ge()),g;if(g===6)throw Error(a(345));return c.finishedWork=c.current.alternate,c.finishedLanes=d,Pl(c,Fo,oi),Ho(c,Ge()),null}function Vw(c){Mi!==null&&Mi.tag===0&&!(mn&6)&&jl();var d=mn;mn|=1;var g=Lr.transition,b=Ee;try{if(Lr.transition=null,Ee=1,c)return c()}finally{Ee=b,Lr.transition=g,mn=d,!(mn&6)&&Qo()}}function R0(){ts=Ec.current,Wt(Ec)}function kl(c,d){c.finishedWork=null,c.finishedLanes=0;var g=c.timeoutHandle;if(g!==se&&(c.timeoutHandle=se,ye(g)),Vr!==null)for(g=Vr.return;g!==null;){var b=g;switch(zv(b),b.tag){case 1:b=b.type.childContextTypes,b!=null&&Dt();break;case 3:Pc(),Wt(hn),Wt(on),Qv();break;case 5:Xv(b);break;case 4:Pc();break;case 13:Wt(Or);break;case 19:Wt(Or);break;case 10:Vv(b.type._context);break;case 22:case 23:R0()}g=g.return}if(ro=c,Vr=c=Ni(c.current,null),lo=ts=d,Qr=0,ld=null,k0=Pp=_l=0,Fo=cd=null,Sl!==null){for(d=0;d<Sl.length;d++)if(g=Sl[d],b=g.interleaved,b!==null){g.interleaved=null;var C=b.next,O=g.pending;if(O!==null){var $=O.next;O.next=C,b.next=$}g.pending=b}Sl=null}return c}function Ww(c,d){do{var g=Vr;try{if(Hv(),cp.current=pp,up){for(var b=Tr.memoizedState;b!==null;){var C=b.queue;C!==null&&(C.pending=null),b=b.next}up=!1}if(Cl=0,no=Zr=Tr=null,Ju=!1,ed=0,_0.current=null,g===null||g.return===null){Qr=1,ld=d,Vr=null;break}e:{var O=c,$=g.return,J=g,pe=d;if(d=lo,J.flags|=32768,pe!==null&&typeof pe=="object"&&typeof pe.then=="function"){var Fe=pe,Ct=J,nn=Ct.tag;if(!(Ct.mode&1)&&(nn===0||nn===11||nn===15)){var ft=Ct.alternate;ft?(Ct.updateQueue=ft.updateQueue,Ct.memoizedState=ft.memoizedState,Ct.lanes=ft.lanes):(Ct.updateQueue=null,Ct.memoizedState=null)}var mr=mw($);if(mr!==null){mr.flags&=-257,gw(mr,$,J,O,d),mr.mode&1&&hw(O,Fe,d),d=mr,pe=Fe;var or=d.updateQueue;if(or===null){var Vo=new Set;Vo.add(pe),d.updateQueue=Vo}else or.add(pe);break e}else{if(!(d&1)){hw(O,Fe,d),M0();break e}pe=Error(a(426))}}else if(wr&&J.mode&1){var si=mw($);if(si!==null){!(si.flags&65536)&&(si.flags|=256),gw(si,$,J,O,d),Bv(jc(pe,J));break e}}O=pe=jc(pe,J),Qr!==4&&(Qr=2),cd===null?cd=[O]:cd.push(O),O=$;do{switch(O.tag){case 3:O.flags|=65536,d&=-d,O.lanes|=d;var ce=fw(O,pe,d);A2(O,ce);break e;case 1:J=pe;var re=O.type,be=O.stateNode;if(!(O.flags&128)&&(typeof re.getDerivedStateFromError=="function"||be!==null&&typeof be.componentDidCatch=="function"&&(Ri===null||!Ri.has(be)))){O.flags|=65536,d&=-d,O.lanes|=d;var mt=pw(O,J,d);A2(O,mt);break e}}O=O.return}while(O!==null)}qw(g)}catch(Bt){d=Bt,Vr===g&&g!==null&&(Vr=g=g.return);continue}break}while(1)}function Uw(){var c=kp.current;return kp.current=pp,c===null?pp:c}function M0(){(Qr===0||Qr===3||Qr===2)&&(Qr=4),ro===null||!(_l&268435455)&&!(Pp&268435455)||Ai(ro,lo)}function Rp(c,d){var g=mn;mn|=2;var b=Uw();(ro!==c||lo!==d)&&(oi=null,kl(c,d));do try{OR();break}catch(C){Ww(c,C)}while(1);if(Hv(),mn=g,kp.current=b,Vr!==null)throw Error(a(261));return ro=null,lo=0,Qr}function OR(){for(;Vr!==null;)Gw(Vr)}function TR(){for(;Vr!==null&&!$t();)Gw(Vr)}function Gw(c){var d=Xw(c.alternate,c,ts);c.memoizedProps=c.pendingProps,d===null?qw(c):Vr=d,_0.current=null}function qw(c){var d=c;do{var g=d.alternate;if(c=d.return,d.flags&32768){if(g=_R(g,d),g!==null){g.flags&=32767,Vr=g;return}if(c!==null)c.flags|=32768,c.subtreeFlags=0,c.deletions=null;else{Qr=6,Vr=null;return}}else if(g=CR(g,d,ts),g!==null){Vr=g;return}if(d=d.sibling,d!==null){Vr=d;return}Vr=d=c}while(d!==null);Qr===0&&(Qr=5)}function Pl(c,d,g){var b=Ee,C=Lr.transition;try{Lr.transition=null,Ee=1,RR(c,d,g,b)}finally{Lr.transition=C,Ee=b}return null}function RR(c,d,g,b){do jl();while(Mi!==null);if(mn&6)throw Error(a(327));g=c.finishedWork;var C=c.finishedLanes;if(g===null)return null;if(c.finishedWork=null,c.finishedLanes=0,g===c.current)throw Error(a(177));c.callbackNode=null,c.callbackPriority=0;var O=g.lanes|g.childLanes;if(it(c,O),c===ro&&(Vr=ro=null,lo=0),!(g.subtreeFlags&2064)&&!(g.flags&2064)||Ip||(Ip=!0,Zw(kn,function(){return jl(),null})),O=(g.flags&15990)!==0,g.subtreeFlags&15990||O){O=Lr.transition,Lr.transition=null;var $=Ee;Ee=1;var J=mn;mn|=4,_0.current=null,PR(c,g),Aw(g,c),V(c.containerInfo),c.current=g,jR(g),zt(),mn=J,Ee=$,Lr.transition=O}else c.current=g;if(Ip&&(Ip=!1,Mi=c,Ep=C),O=c.pendingLanes,O===0&&(Ri=null),fr(g.stateNode),Ho(c,Ge()),d!==null)for(b=c.onRecoverableError,g=0;g<d.length;g++)C=d[g],b(C.value,{componentStack:C.stack,digest:C.digest});if(jp)throw jp=!1,c=I0,I0=null,c;return Ep&1&&c.tag!==0&&jl(),O=c.pendingLanes,O&1?c===E0?ud++:(ud=0,E0=c):ud=0,Qo(),null}function jl(){if(Mi!==null){var c=Le(Ep),d=Lr.transition,g=Ee;try{if(Lr.transition=null,Ee=16>c?16:c,Mi===null)var b=!1;else{if(c=Mi,Mi=null,Ep=0,mn&6)throw Error(a(331));var C=mn;for(mn|=4,wt=c.current;wt!==null;){var O=wt,$=O.child;if(wt.flags&16){var J=O.deletions;if(J!==null){for(var pe=0;pe<J.length;pe++){var Fe=J[pe];for(wt=Fe;wt!==null;){var Ct=wt;switch(Ct.tag){case 0:case 11:case 15:ad(8,Ct,O)}var nn=Ct.child;if(nn!==null)nn.return=Ct,wt=nn;else for(;wt!==null;){Ct=wt;var ft=Ct.sibling,mr=Ct.return;if(Tw(Ct),Ct===Fe){wt=null;break}if(ft!==null){ft.return=mr,wt=ft;break}wt=mr}}}var or=O.alternate;if(or!==null){var Vo=or.child;if(Vo!==null){or.child=null;do{var si=Vo.sibling;Vo.sibling=null,Vo=si}while(Vo!==null)}}wt=O}}if(O.subtreeFlags&2064&&$!==null)$.return=O,wt=$;else e:for(;wt!==null;){if(O=wt,O.flags&2048)switch(O.tag){case 0:case 11:case 15:ad(9,O,O.return)}var ce=O.sibling;if(ce!==null){ce.return=O.return,wt=ce;break e}wt=O.return}}var re=c.current;for(wt=re;wt!==null;){$=wt;var be=$.child;if($.subtreeFlags&2064&&be!==null)be.return=$,wt=be;else e:for($=re;wt!==null;){if(J=wt,J.flags&2048)try{switch(J.tag){case 0:case 11:case 15:xp(9,J)}}catch(Bt){Sr(J,J.return,Bt)}if(J===$){wt=null;break e}var mt=J.sibling;if(mt!==null){mt.return=J.return,wt=mt;break e}wt=J.return}}if(mn=C,Qo(),In&&typeof In.onPostCommitFiberRoot=="function")try{In.onPostCommitFiberRoot(hr,c)}catch{}b=!0}return b}finally{Ee=g,Lr.transition=d}}return!1}function Yw(c,d,g){d=jc(g,d),d=fw(c,d,1),c=Ti(c,d,1),d=xo(),c!==null&&(St(c,1,d),Ho(c,d))}function Sr(c,d,g){if(c.tag===3)Yw(c,c,g);else for(;d!==null;){if(d.tag===3){Yw(d,c,g);break}else if(d.tag===1){var b=d.stateNode;if(typeof d.type.getDerivedStateFromError=="function"||typeof b.componentDidCatch=="function"&&(Ri===null||!Ri.has(b))){c=jc(g,c),c=pw(d,c,1),d=Ti(d,c,1),c=xo(),d!==null&&(St(d,1,c),Ho(d,c));break}}d=d.return}}function MR(c,d,g){var b=c.pingCache;b!==null&&b.delete(d),d=xo(),c.pingedLanes|=c.suspendedLanes&g,ro===c&&(lo&g)===g&&(Qr===4||Qr===3&&(lo&130023424)===lo&&500>Ge()-P0?kl(c,0):k0|=g),Ho(c,d)}function Kw(c,d){d===0&&(c.mode&1?(d=Mn,Mn<<=1,!(Mn&130023424)&&(Mn=4194304)):d=1);var g=xo();c=Ia(c,d),c!==null&&(St(c,d,g),Ho(c,g))}function DR(c){var d=c.memoizedState,g=0;d!==null&&(g=d.retryLane),Kw(c,g)}function AR(c,d){var g=0;switch(c.tag){case 13:var b=c.stateNode,C=c.memoizedState;C!==null&&(g=C.retryLane);break;case 19:b=c.stateNode;break;default:throw Error(a(314))}b!==null&&b.delete(d),Kw(c,g)}var Xw;Xw=function(c,d,g){if(c!==null)if(c.memoizedProps!==d.pendingProps||hn.current)Bo=!0;else{if(!(c.lanes&g)&&!(d.flags&128))return Bo=!1,SR(c,d,g);Bo=!!(c.flags&131072)}else Bo=!1,wr&&d.flags&1048576&&j2(d,jo,d.index);switch(d.lanes=0,d.tag){case 2:var b=d.type;mp(c,d),c=d.pendingProps;var C=Kr(d,on.current);Cc(d,g),C=t0(null,d,b,c,C,g);var O=n0();return d.flags|=1,typeof C=="object"&&C!==null&&typeof C.render=="function"&&C.$$typeof===void 0?(d.tag=1,d.memoizedState=null,d.updateQueue=null,xr(b)?(O=!0,br(d)):O=!1,d.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,Gv(d),C.updater=ap,d.stateNode=C,C._reactInternals=d,Yv(d,b,c,g),d=u0(null,d,b,!0,O,g)):(d.tag=0,wr&&O&&Nv(d),Oo(null,d,C,g),d=d.child),d;case 16:b=d.elementType;e:{switch(mp(c,d),c=d.pendingProps,C=b._init,b=C(b._payload),d.type=b,C=d.tag=zR(b),c=Ys(b,c),C){case 0:d=c0(null,d,b,c,g);break e;case 1:d=Sw(null,d,b,c,g);break e;case 11:d=vw(null,d,b,c,g);break e;case 14:d=yw(null,d,b,Ys(b.type,c),g);break e}throw Error(a(306,b,""))}return d;case 0:return b=d.type,C=d.pendingProps,C=d.elementType===b?C:Ys(b,C),c0(c,d,b,C,g);case 1:return b=d.type,C=d.pendingProps,C=d.elementType===b?C:Ys(b,C),Sw(c,d,b,C,g);case 3:e:{if(Cw(d),c===null)throw Error(a(387));b=d.pendingProps,O=d.memoizedState,C=O.element,D2(c,d),sp(d,b,null,g);var $=d.memoizedState;if(b=$.element,ke&&O.isDehydrated)if(O={element:b,isDehydrated:!1,cache:$.cache,pendingSuspenseBoundaries:$.pendingSuspenseBoundaries,transitions:$.transitions},d.updateQueue.baseState=O,d.memoizedState=O,d.flags&256){C=jc(Error(a(423)),d),d=_w(c,d,b,g,C);break e}else if(b!==C){C=jc(Error(a(424)),d),d=_w(c,d,b,g,C);break e}else for(ke&&(vs=te(d.stateNode.containerInfo),es=d,wr=!0,qs=null,Ku=!1),g=V2(d,null,b,g),d.child=g;g;)g.flags=g.flags&-3|4096,g=g.sibling;else{if(wc(),b===C){d=ri(c,d,g);break e}Oo(c,d,b,g)}d=d.child}return d;case 5:return W2(d),c===null&&Lv(d),b=d.type,C=d.pendingProps,O=c!==null?c.memoizedProps:null,$=C.children,Q(b,C)?$=null:O!==null&&Q(b,O)&&(d.flags|=32),ww(c,d),Oo(c,d,$,g),d.child;case 6:return c===null&&Lv(d),null;case 13:return kw(c,d,g);case 4:return Kv(d,d.stateNode.containerInfo),b=d.pendingProps,c===null?d.child=_c(d,null,b,g):Oo(c,d,b,g),d.child;case 11:return b=d.type,C=d.pendingProps,C=d.elementType===b?C:Ys(b,C),vw(c,d,b,C,g);case 7:return Oo(c,d,d.pendingProps,g),d.child;case 8:return Oo(c,d,d.pendingProps.children,g),d.child;case 12:return Oo(c,d,d.pendingProps.children,g),d.child;case 10:e:{if(b=d.type._context,C=d.pendingProps,O=d.memoizedProps,$=C.value,R2(d,b,$),O!==null)if(Sn(O.value,$)){if(O.children===C.children&&!hn.current){d=ri(c,d,g);break e}}else for(O=d.child,O!==null&&(O.return=d);O!==null;){var J=O.dependencies;if(J!==null){$=O.child;for(var pe=J.firstContext;pe!==null;){if(pe.context===b){if(O.tag===1){pe=ni(-1,g&-g),pe.tag=2;var Fe=O.updateQueue;if(Fe!==null){Fe=Fe.shared;var Ct=Fe.pending;Ct===null?pe.next=pe:(pe.next=Ct.next,Ct.next=pe),Fe.pending=pe}}O.lanes|=g,pe=O.alternate,pe!==null&&(pe.lanes|=g),Wv(O.return,g,d),J.lanes|=g;break}pe=pe.next}}else if(O.tag===10)$=O.type===d.type?null:O.child;else if(O.tag===18){if($=O.return,$===null)throw Error(a(341));$.lanes|=g,J=$.alternate,J!==null&&(J.lanes|=g),Wv($,g,d),$=O.sibling}else $=O.child;if($!==null)$.return=O;else for($=O;$!==null;){if($===d){$=null;break}if(O=$.sibling,O!==null){O.return=$.return,$=O;break}$=$.return}O=$}Oo(c,d,C.children,g),d=d.child}return d;case 9:return C=d.type,b=d.pendingProps.children,Cc(d,g),C=ys(C),b=b(C),d.flags|=1,Oo(c,d,b,g),d.child;case 14:return b=d.type,C=Ys(b,d.pendingProps),C=Ys(b.type,C),yw(c,d,b,C,g);case 15:return xw(c,d,d.type,d.pendingProps,g);case 17:return b=d.type,C=d.pendingProps,C=d.elementType===b?C:Ys(b,C),mp(c,d),d.tag=1,xr(b)?(c=!0,br(d)):c=!1,Cc(d,g),L2(d,b,C),Yv(d,b,C,g),u0(null,d,b,!0,c,g);case 19:return jw(c,d,g);case 22:return bw(c,d,g)}throw Error(a(156,d.tag))};function Zw(c,d){return Ue(c,d)}function NR(c,d,g,b){this.tag=c,this.key=g,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=d,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=b,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ss(c,d,g,b){return new NR(c,d,g,b)}function D0(c){return c=c.prototype,!(!c||!c.isReactComponent)}function zR(c){if(typeof c=="function")return D0(c)?1:0;if(c!=null){if(c=c.$$typeof,c===x)return 11;if(c===k)return 14}return 2}function Ni(c,d){var g=c.alternate;return g===null?(g=Ss(c.tag,d,c.key,c.mode),g.elementType=c.elementType,g.type=c.type,g.stateNode=c.stateNode,g.alternate=c,c.alternate=g):(g.pendingProps=d,g.type=c.type,g.flags=0,g.subtreeFlags=0,g.deletions=null),g.flags=c.flags&14680064,g.childLanes=c.childLanes,g.lanes=c.lanes,g.child=c.child,g.memoizedProps=c.memoizedProps,g.memoizedState=c.memoizedState,g.updateQueue=c.updateQueue,d=c.dependencies,g.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext},g.sibling=c.sibling,g.index=c.index,g.ref=c.ref,g}function Mp(c,d,g,b,C,O){var $=2;if(b=c,typeof c=="function")D0(c)&&($=1);else if(typeof c=="string")$=5;else e:switch(c){case p:return Il(g.children,C,O,d);case m:$=8,C|=8;break;case v:return c=Ss(12,g,d,C|2),c.elementType=v,c.lanes=O,c;case w:return c=Ss(13,g,d,C),c.elementType=w,c.lanes=O,c;case _:return c=Ss(19,g,d,C),c.elementType=_,c.lanes=O,c;case I:return Dp(g,C,O,d);default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case y:$=10;break e;case S:$=9;break e;case x:$=11;break e;case k:$=14;break e;case P:$=16,b=null;break e}throw Error(a(130,c==null?c:typeof c,""))}return d=Ss($,g,d,C),d.elementType=c,d.type=b,d.lanes=O,d}function Il(c,d,g,b){return c=Ss(7,c,b,d),c.lanes=g,c}function Dp(c,d,g,b){return c=Ss(22,c,b,d),c.elementType=I,c.lanes=g,c.stateNode={isHidden:!1},c}function A0(c,d,g){return c=Ss(6,c,null,d),c.lanes=g,c}function N0(c,d,g){return d=Ss(4,c.children!==null?c.children:[],c.key,d),d.lanes=g,d.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},d}function $R(c,d,g,b,C){this.tag=d,this.containerInfo=c,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=se,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=qt(0),this.expirationTimes=qt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=qt(0),this.identifierPrefix=b,this.onRecoverableError=C,ke&&(this.mutableSourceEagerHydrationData=null)}function Qw(c,d,g,b,C,O,$,J,pe){return c=new $R(c,d,g,J,pe),d===1?(d=1,O===!0&&(d|=8)):d=0,O=Ss(3,null,null,d),c.current=O,O.stateNode=c,O.memoizedState={element:b,isDehydrated:g,cache:null,transitions:null,pendingSuspenseBoundaries:null},Gv(O),c}function Jw(c){if(!c)return Rn;c=c._reactInternals;e:{if(M(c)!==c||c.tag!==1)throw Error(a(170));var d=c;do{switch(d.tag){case 3:d=d.stateNode.context;break e;case 1:if(xr(d.type)){d=d.stateNode.__reactInternalMemoizedMergedChildContext;break e}}d=d.return}while(d!==null);throw Error(a(171))}if(c.tag===1){var g=c.type;if(xr(g))return Xn(c,g,d)}return d}function eS(c){var d=c._reactInternals;if(d===void 0)throw typeof c.render=="function"?Error(a(188)):(c=Object.keys(c).join(","),Error(a(268,c)));return c=U(d),c===null?null:c.stateNode}function tS(c,d){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var g=c.retryLane;c.retryLane=g!==0&&g<d?g:d}}function Ap(c,d){tS(c,d),(c=c.alternate)&&tS(c,d)}function LR(c){return c=U(c),c===null?null:c.stateNode}function BR(){return null}return n.attemptContinuousHydration=function(c){if(c.tag===13){var d=Ia(c,134217728);if(d!==null){var g=xo();ws(d,c,134217728,g)}Ap(c,134217728)}},n.attemptDiscreteHydration=function(c){if(c.tag===13){var d=Ia(c,1);if(d!==null){var g=xo();ws(d,c,1,g)}Ap(c,1)}},n.attemptHydrationAtCurrentPriority=function(c){if(c.tag===13){var d=Di(c),g=Ia(c,d);if(g!==null){var b=xo();ws(g,c,d,b)}Ap(c,d)}},n.attemptSynchronousHydration=function(c){switch(c.tag){case 3:var d=c.stateNode;if(d.current.memoizedState.isDehydrated){var g=Dn(d.pendingLanes);g!==0&&(Ne(d,g|1),Ho(d,Ge()),!(mn&6)&&(Oc(),Qo()))}break;case 13:Vw(function(){var b=Ia(c,1);if(b!==null){var C=xo();ws(b,c,1,C)}}),Ap(c,1)}},n.batchedUpdates=function(c,d){var g=mn;mn|=1;try{return c(d)}finally{mn=g,mn===0&&(Oc(),ao&&Qo())}},n.createComponentSelector=function(c){return{$$typeof:bp,value:c}},n.createContainer=function(c,d,g,b,C,O,$){return Qw(c,d,!1,null,g,b,C,O,$)},n.createHasPseudoClassSelector=function(c){return{$$typeof:wp,value:c}},n.createHydrationContainer=function(c,d,g,b,C,O,$,J,pe){return c=Qw(g,b,!0,c,C,O,$,J,pe),c.context=Jw(null),g=c.current,b=xo(),C=Di(g),O=ni(b,C),O.callback=d??null,Ti(g,O,C),c.current.lanes=C,St(c,C,b),Ho(c,b),c},n.createPortal=function(c,d,g){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:b==null?null:""+b,children:c,containerInfo:d,implementation:g}},n.createRoleSelector=function(c){return{$$typeof:Sp,value:c}},n.createTestNameSelector=function(c){return{$$typeof:Cp,value:c}},n.createTextSelector=function(c){return{$$typeof:_p,value:c}},n.deferredUpdates=function(c){var d=Ee,g=Lr.transition;try{return Lr.transition=null,Ee=16,c()}finally{Ee=d,Lr.transition=g}},n.discreteUpdates=function(c,d,g,b,C){var O=Ee,$=Lr.transition;try{return Lr.transition=null,Ee=1,c(d,g,b,C)}finally{Ee=O,Lr.transition=$,mn===0&&Oc()}},n.findAllNodes=C0,n.findBoundingRects=function(c,d){if(!pt)throw Error(a(363));d=C0(c,d),c=[];for(var g=0;g<d.length;g++)c.push(Y(d[g]));for(d=c.length-1;0<d;d--){g=c[d];for(var b=g.x,C=b+g.width,O=g.y,$=O+g.height,J=d-1;0<=J;J--)if(d!==J){var pe=c[J],Fe=pe.x,Ct=Fe+pe.width,nn=pe.y,ft=nn+pe.height;if(b>=Fe&&O>=nn&&C<=Ct&&$<=ft){c.splice(d,1);break}else if(b!==Fe||g.width!==pe.width||ft<O||nn>$){if(!(O!==nn||g.height!==pe.height||Ct<b||Fe>C)){Fe>b&&(pe.width+=Fe-b,pe.x=b),Ct<C&&(pe.width=C-Fe),c.splice(d,1);break}}else{nn>O&&(pe.height+=nn-O,pe.y=O),ft<$&&(pe.height=$-nn),c.splice(d,1);break}}}return c},n.findHostInstance=eS,n.findHostInstanceWithNoPortals=function(c){return c=N(c),c=c!==null?F(c):null,c===null?null:c.stateNode},n.findHostInstanceWithWarning=function(c){return eS(c)},n.flushControlled=function(c){var d=mn;mn|=1;var g=Lr.transition,b=Ee;try{Lr.transition=null,Ee=1,c()}finally{Ee=b,Lr.transition=g,mn=d,mn===0&&(Oc(),Qo())}},n.flushPassiveEffects=jl,n.flushSync=Vw,n.focusWithin=function(c,d){if(!pt)throw Error(a(363));for(c=b0(c),d=Bw(c,d),d=Array.from(d),c=0;c<d.length;){var g=d[c++];if(!ne(g)){if(g.tag===5&&Re(g.stateNode))return!0;for(g=g.child;g!==null;)d.push(g),g=g.sibling}}return!1},n.getCurrentUpdatePriority=function(){return Ee},n.getFindAllNodesFailureDescription=function(c,d){if(!pt)throw Error(a(363));var g=0,b=[];c=[b0(c),0];for(var C=0;C<c.length;){var O=c[C++],$=c[C++],J=d[$];if((O.tag!==5||!ne(O))&&(w0(O,J)&&(b.push(S0(J)),$++,$>g&&(g=$)),$<d.length))for(O=O.child;O!==null;)c.push(O,$),O=O.sibling}if(g<d.length){for(c=[];g<d.length;g++)c.push(S0(d[g]));return`findAllNodes was able to match part of the selector:
`+(b.join(" > ")+`
No matching component was found for:
`)+c.join(" > ")}return null},n.getPublicRootInstance=function(c){if(c=c.current,!c.child)return null;switch(c.child.tag){case 5:return G(c.child.stateNode);default:return c.child.stateNode}},n.injectIntoDevTools=function(c){if(c={bundleType:c.bundleType,version:c.version,rendererPackageName:c.rendererPackageName,rendererConfig:c.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:l.ReactCurrentDispatcher,findHostInstanceByFiber:LR,findFiberByHostInstance:c.findFiberByHostInstance||BR,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")c=!1;else{var d=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(d.isDisabled||!d.supportsFiber)c=!0;else{try{hr=d.inject(c),In=d}catch{}c=!!d.checkDCE}}return c},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(c,d,g,b){if(!pt)throw Error(a(363));c=C0(c,d);var C=Ke(c,g,b).disconnect;return{disconnect:function(){C()}}},n.registerMutableSourceForHydration=function(c,d){var g=d._getVersion;g=g(d._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[d,g]:c.mutableSourceEagerHydrationData.push(d,g)},n.runWithPriority=function(c,d){var g=Ee;try{return Ee=c,d()}finally{Ee=g}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(c,d,g,b){var C=d.current,O=xo(),$=Di(C);return g=Jw(g),d.context===null?d.context=g:d.pendingContext=g,d=ni(O,$),d.payload={element:c},b=b===void 0?null:b,b!==null&&(d.callback=b),c=Ti(C,d,$),c!==null&&(ws(c,C,$,O),op(c,C,$)),$},n};N8.exports=_ie;var kie=N8.exports;const Pie=kf(kie);var z8={exports:{}},bc={};/**
* @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.
*/bc.ConcurrentRoot=1;bc.ContinuousEventPriority=4;bc.DefaultEventPriority=16;bc.DiscreteEventPriority=1;bc.IdleEventPriority=536870912;bc.LegacyRoot=0;z8.exports=bc;var $8=z8.exports;const I3={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let E3=!1,O3=!1;const S2=".react-konva-event",jie=`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
`,Iie=`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
`,Eie={};function Mv(e,t,n=Eie){if(!E3&&"zIndex"in t&&(console.warn(Iie),E3=!0),!O3&&t.draggable){var r=t.x!==void 0||t.y!==void 0,o=t.onDragEnd||t.onDragMove;r&&!o&&(console.warn(jie),O3=!0)}for(var s in n)if(!I3[s]){var a=s.slice(0,2)==="on",l=n[s]!==t[s];if(a&&l){var u=s.substr(2).toLowerCase();u.substr(0,7)==="content"&&(u="content"+u.substr(7,1).toUpperCase()+u.substr(8)),e.off(u,n[s])}var f=!t.hasOwnProperty(s);f&&e.setAttr(s,void 0)}var p=t._useStrictMode,m={},v=!1;const y={};for(var s in t)if(!I3[s]){var a=s.slice(0,2)==="on",S=n[s]!==t[s];if(a&&S){var u=s.substr(2).toLowerCase();u.substr(0,7)==="content"&&(u="content"+u.substr(7,1).toUpperCase()+u.substr(8)),t[s]&&(y[u]=t[s])}!a&&(t[s]!==n[s]||p&&t[s]!==e.getAttr(s))&&(v=!0,m[s]=t[s])}v&&(e.setAttrs(m),bl(e));for(var u in y)e.on(u+S2,y[u])}function bl(e){if(!$7.Konva.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const L8={},Oie={};Cf.Node.prototype._applyProps=Mv;function Tie(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),bl(e)}function Rie(e,t,n){let r=Cf[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=Cf.Group);const o={},s={};for(var a in t){var l=a.slice(0,2)==="on";l?s[a]=t[a]:o[a]=t[a]}const u=new r(o);return Mv(u,s),u}function Mie(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function Die(e,t,n){return!1}function Aie(e){return e}function Nie(){return null}function zie(){return null}function $ie(e,t,n,r){return Oie}function Lie(){}function Bie(e){}function Fie(e,t){return!1}function Hie(){return L8}function Vie(){return L8}const Wie=setTimeout,Uie=clearTimeout,Gie=-1;function qie(e,t){return!1}const Yie=!1,Kie=!0,Xie=!0;function Zie(e,t){t.parent===e?t.moveToTop():e.add(t),bl(e)}function Qie(e,t){t.parent===e?t.moveToTop():e.add(t),bl(e)}function B8(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),bl(e)}function Jie(e,t,n){B8(e,t,n)}function ele(e,t){t.destroy(),t.off(S2),bl(e)}function tle(e,t){t.destroy(),t.off(S2),bl(e)}function nle(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function rle(e,t,n){}function ole(e,t,n,r,o){Mv(e,o,r)}function sle(e){e.hide(),bl(e)}function ale(e){}function ile(e,t){(t.visible==null||t.visible)&&e.show()}function lle(e,t){}function cle(e){}function ule(){}const dle=()=>$8.DefaultEventPriority,fle=Object.freeze(Object.defineProperty({__proto__:null,appendChild:Zie,appendChildToContainer:Qie,appendInitialChild:Tie,cancelTimeout:Uie,clearContainer:cle,commitMount:rle,commitTextUpdate:nle,commitUpdate:ole,createInstance:Rie,createTextInstance:Mie,detachDeletedInstance:ule,finalizeInitialChildren:Die,getChildHostContext:Vie,getCurrentEventPriority:dle,getPublicInstance:Aie,getRootHostContext:Hie,hideInstance:sle,hideTextInstance:ale,idlePriority:Ph.unstable_IdlePriority,insertBefore:B8,insertInContainerBefore:Jie,isPrimaryRenderer:Yie,noTimeout:Gie,now:Ph.unstable_now,prepareForCommit:Nie,preparePortalMount:zie,prepareUpdate:$ie,removeChild:ele,removeChildFromContainer:tle,resetAfterCommit:Lie,resetTextContent:Bie,run:Ph.unstable_runWithPriority,scheduleTimeout:Wie,shouldDeprioritizeSubtree:Fie,shouldSetTextContent:qie,supportsMutation:Xie,unhideInstance:ile,unhideTextInstance:lle,warnsIfNotActing:Kie},Symbol.toStringTag,{value:"Module"}));var ple=Object.defineProperty,hle=Object.defineProperties,mle=Object.getOwnPropertyDescriptors,T3=Object.getOwnPropertySymbols,gle=Object.prototype.hasOwnProperty,vle=Object.prototype.propertyIsEnumerable,R3=(e,t,n)=>t in e?ple(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,M3=(e,t)=>{for(var n in t||(t={}))gle.call(t,n)&&R3(e,n,t[n]);if(T3)for(var n of T3(t))vle.call(t,n)&&R3(e,n,t[n]);return e},yle=(e,t)=>hle(e,mle(t));function F8(e,t,n){if(!e)return;if(n(e)===!0)return e;let r=t?e.return:e.child;for(;r;){const o=F8(r,t,n);if(o)return o;r=t?null:r.sibling}}function H8(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const C2=H8(h.createContext(null));class V8 extends h.Component{render(){return h.createElement(C2.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:D3,ReactCurrentDispatcher:A3}=h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function xle(){const e=h.useContext(C2);if(e===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const t=h.useId();return h.useMemo(()=>{for(const r of[D3==null?void 0:D3.current,e,e==null?void 0:e.alternate]){if(!r)continue;const o=F8(r,!1,s=>{let a=s.memoizedState;for(;a;){if(a.memoizedState===t)return!0;a=a.next}});if(o)return o}},[e,t])}function ble(){var e,t;const n=xle(),[r]=h.useState(()=>new Map);r.clear();let o=n;for(;o;){const s=(e=o.type)==null?void 0:e._context;s&&s!==C2&&!r.has(s)&&r.set(s,(t=A3==null?void 0:A3.current)==null?void 0:t.readContext(H8(s))),o=o.return}return r}function wle(){const e=ble();return h.useMemo(()=>Array.from(e.keys()).reduce((t,n)=>r=>h.createElement(t,null,h.createElement(n.Provider,yle(M3({},r),{value:e.get(n)}))),t=>h.createElement(V8,M3({},t))),[e])}function Sle(e){const t=B.useRef({});return B.useLayoutEffect(()=>{t.current=e}),B.useLayoutEffect(()=>()=>{t.current={}},[]),t.current}const Cle=e=>{const t=B.useRef(),n=B.useRef(),r=B.useRef(),o=Sle(e),s=wle(),a=l=>{const{forwardedRef:u}=e;u&&(typeof u=="function"?u(l):u.current=l)};return B.useLayoutEffect(()=>(n.current=new Cf.Stage({width:e.width,height:e.height,container:t.current}),a(n.current),r.current=Rd.createContainer(n.current,$8.LegacyRoot,!1,null),Rd.updateContainer(B.createElement(s,{},e.children),r.current),()=>{Cf.isBrowser&&(a(null),Rd.updateContainer(null,r.current,null),n.current.destroy())}),[]),B.useLayoutEffect(()=>{a(n.current),Mv(n.current,e,o),Rd.updateContainer(B.createElement(s,{},e.children),r.current,null)}),B.createElement("div",{ref:t,id:e.id,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},Cd="Layer",wi="Group",Ga="Rect",Ol="Circle",yg="Line",W8="Image",_le="Transformer",Rd=Pie(fle);Rd.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:B.version,rendererPackageName:"react-konva"});const kle=B.forwardRef((e,t)=>B.createElement(V8,{},B.createElement(Cle,{...e,forwardedRef:t}))),Ple=Te([xn,jr],(e,t)=>{const{tool:n,isMovingBoundingBox:r}=e;return{tool:n,isStaging:t,isMovingBoundingBox:r}},{memoizeOptions:{resultEqualityCheck:Ut}}),jle=()=>{const e=ue(),{tool:t,isStaging:n,isMovingBoundingBox:r}=q(Ple);return{handleDragStart:h.useCallback(()=>{(t==="move"||n)&&!r&&e(Xh(!0))},[e,r,n,t]),handleDragMove:h.useCallback(o=>{if(!((t==="move"||n)&&!r))return;const s={x:o.target.x(),y:o.target.y()};e(_5(s))},[e,r,n,t]),handleDragEnd:h.useCallback(()=>{(t==="move"||n)&&!r&&e(Xh(!1))},[e,r,n,t])}},Ile=Te([xn,Gr,jr],(e,t,n)=>{const{cursorPosition:r,shouldLockBoundingBox:o,shouldShowBoundingBox:s,tool:a,isMaskEnabled:l,shouldSnapToGrid:u}=e;return{activeTabName:t,isCursorOnCanvas:!!r,shouldLockBoundingBox:o,shouldShowBoundingBox:s,tool:a,isStaging:n,isMaskEnabled:l,shouldSnapToGrid:u}},{memoizeOptions:{resultEqualityCheck:Ut}}),Ele=()=>{const e=ue(),{activeTabName:t,shouldShowBoundingBox:n,tool:r,isStaging:o,isMaskEnabled:s,shouldSnapToGrid:a}=q(Ile),l=h.useRef(null),u=k5(),f=()=>e(Ex());nt(["shift+c"],()=>{f()},{enabled:()=>!o,preventDefault:!0},[]);const p=()=>e(Of(!s));nt(["h"],()=>{p()},{enabled:()=>!o,preventDefault:!0},[s]),nt(["n"],()=>{e(Zh(!a))},{enabled:!0,preventDefault:!0},[a]),nt("esc",()=>{e(L7())},{enabled:()=>!0,preventDefault:!0}),nt("shift+h",()=>{e(B7(!n))},{enabled:()=>!o,preventDefault:!0},[t,n]),nt(["space"],m=>{m.repeat||(u==null||u.container().focus(),r!=="move"&&(l.current=r,e(Ba("move"))),r==="move"&&l.current&&l.current!=="move"&&(e(Ba(l.current)),l.current="move"))},{keyup:!0,keydown:!0,preventDefault:!0},[r,l])},_2=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}},U8=()=>{const e=ue(),t=hi(),n=k5();return{updateColorUnderCursor:()=>{if(!n||!t)return;const r=n.getPointerPosition();if(!r)return;const o=F7.pixelRatio,[s,a,l,u]=t.getContext().getImageData(r.x*o,r.y*o,1,1).data;e(H7({r:s,g:a,b:l,a:u}))},commitColorUnderCursor:()=>{e(V7())}}},Ole=Te([Gr,xn,jr],(e,t,n)=>{const{tool:r}=t;return{tool:r,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:Ut}}),Tle=e=>{const t=ue(),{tool:n,isStaging:r}=q(Ole),{commitColorUnderCursor:o}=U8();return h.useCallback(s=>{if(!e.current)return;if(e.current.container().focus(),n==="move"||r){t(Xh(!0));return}if(n==="colorPicker"){o();return}const a=_2(e.current);a&&(s.evt.preventDefault(),t(P5(!0)),t(W7([a.x,a.y])))},[e,n,r,t,o])},Rle=Te([Gr,xn,jr],(e,t,n)=>{const{tool:r,isDrawing:o}=t;return{tool:r,isDrawing:o,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:Ut}}),Mle=(e,t,n)=>{const r=ue(),{isDrawing:o,tool:s,isStaging:a}=q(Rle),{updateColorUnderCursor:l}=U8();return h.useCallback(()=>{if(!e.current)return;const u=_2(e.current);if(u){if(r(U7(u)),n.current=u,s==="colorPicker"){l();return}!o||s==="move"||a||(t.current=!0,r(j5([u.x,u.y])))}},[t,r,o,a,n,e,s,l])},Dle=()=>{const e=ue();return h.useCallback(()=>{e(G7())},[e])},Ale=Te([Gr,xn,jr],(e,t,n)=>{const{tool:r,isDrawing:o}=t;return{tool:r,isDrawing:o,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:Ut}}),Nle=(e,t)=>{const n=ue(),{tool:r,isDrawing:o,isStaging:s}=q(Ale);return h.useCallback(()=>{if(r==="move"||s){n(Xh(!1));return}if(!t.current&&o&&e.current){const a=_2(e.current);if(!a)return;n(j5([a.x,a.y]))}else t.current=!1;n(P5(!1))},[t,n,o,s,e,r])},zle=Te([xn],e=>{const{isMoveStageKeyHeld:t,stageScale:n}=e;return{isMoveStageKeyHeld:t,stageScale:n}},{memoizeOptions:{resultEqualityCheck:Ut}}),$le=e=>{const t=ue(),{isMoveStageKeyHeld:n,stageScale:r}=q(zle);return h.useCallback(o=>{if(!e.current||n)return;o.evt.preventDefault();const s=e.current.getPointerPosition();if(!s)return;const a={x:(s.x-e.current.x())/r,y:(s.y-e.current.y())/r};let l=o.evt.deltaY;o.evt.ctrlKey&&(l=-l);const u=ma(r*K7**l,Y7,q7),f={x:s.x-a.x*u,y:s.y-a.y*u};t(X7(u)),t(_5(f))},[e,n,r,t])},Lle=Te(xn,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageDimensions:r,stageScale:o,shouldDarkenOutsideBoundingBox:s,stageCoordinates:a}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,shouldDarkenOutsideBoundingBox:s,stageCoordinates:a,stageDimensions:r,stageScale:o}},{memoizeOptions:{resultEqualityCheck:Ut}}),Ble=()=>{const{boundingBoxCoordinates:e,boundingBoxDimensions:t,shouldDarkenOutsideBoundingBox:n,stageCoordinates:r,stageDimensions:o,stageScale:s}=q(Lle);return i.jsxs(wi,{children:[i.jsx(Ga,{offsetX:r.x/s,offsetY:r.y/s,height:o.height/s,width:o.width/s,fill:"rgba(0,0,0,0.4)",listening:!1,visible:n}),i.jsx(Ga,{x:e.x,y:e.y,width:t.width,height:t.height,fill:"rgb(255,255,255)",listening:!1,visible:n,globalCompositeOperation:"destination-out"})]})},Fle=Te([xn],e=>{const{stageScale:t,stageCoordinates:n,stageDimensions:r}=e;return{stageScale:t,stageCoordinates:n,stageDimensions:r}},{memoizeOptions:{resultEqualityCheck:Ut}}),Hle=()=>{const{stageScale:e,stageCoordinates:t,stageDimensions:n}=q(Fle),{colorMode:r}=fo(),[o,s]=h.useState([]),[a,l]=hc("colors",["base.800","base.200"]),u=h.useCallback(f=>f/e,[e]);return h.useLayoutEffect(()=>{const{width:f,height:p}=n,{x:m,y:v}=t,y={x1:0,y1:0,x2:f,y2:p,offset:{x:u(m),y:u(v)}},S={x:Math.ceil(u(m)/64)*64,y:Math.ceil(u(v)/64)*64},x={x1:-S.x,y1:-S.y,x2:u(f)-S.x+64,y2:u(p)-S.y+64},_={x1:Math.min(y.x1,x.x1),y1:Math.min(y.y1,x.y1),x2:Math.max(y.x2,x.x2),y2:Math.max(y.y2,x.y2)},k=_.x2-_.x1,P=_.y2-_.y1,I=Math.round(k/64)+1,j=Math.round(P/64)+1,E=LS(0,I).map(R=>i.jsx(yg,{x:_.x1+R*64,y:_.y1,points:[0,0,0,P],stroke:r==="dark"?a:l,strokeWidth:1},`x_${R}`)),T=LS(0,j).map(R=>i.jsx(yg,{x:_.x1,y:_.y1+R*64,points:[0,0,k,0],stroke:r==="dark"?a:l,strokeWidth:1},`y_${R}`));s(E.concat(T))},[e,t,n,u,r,a,l]),i.jsx(wi,{children:o})},Vle=Te([pr,xn],(e,t)=>{const{progressImage:n,sessionId:r}=e,{sessionId:o,boundingBox:s}=t.layerState.stagingArea;return{boundingBox:s,progressImage:r===o?n:void 0}},{memoizeOptions:{resultEqualityCheck:Ut}}),Wle=e=>{const{...t}=e,{progressImage:n,boundingBox:r}=q(Vle),[o,s]=h.useState(null);return h.useEffect(()=>{if(!n)return;const a=new Image;a.onload=()=>{s(a)},a.src=n.dataURL},[n]),n&&r&&o?i.jsx(W8,{x:r.x,y:r.y,width:r.width,height:r.height,image:o,listening:!1,...t}):null},Zl=e=>{const{r:t,g:n,b:r,a:o}=e;return`rgba(${t}, ${n}, ${r}, ${o})`},Ule=Te(xn,e=>{const{maskColor:t,stageCoordinates:n,stageDimensions:r,stageScale:o}=e;return{stageCoordinates:n,stageDimensions:r,stageScale:o,maskColorString:Zl(t)}}),N3=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),Gle=e=>{const{...t}=e,{maskColorString:n,stageCoordinates:r,stageDimensions:o,stageScale:s}=q(Ule),[a,l]=h.useState(null),[u,f]=h.useState(0),p=h.useRef(null),m=h.useCallback(()=>{f(u+1),setTimeout(m,500)},[u]);return h.useEffect(()=>{if(a)return;const v=new Image;v.onload=()=>{l(v)},v.src=N3(n)},[a,n]),h.useEffect(()=>{a&&(a.src=N3(n))},[a,n]),h.useEffect(()=>{const v=setInterval(()=>f(y=>(y+1)%5),50);return()=>clearInterval(v)},[]),!a||!Rc(r.x)||!Rc(r.y)||!Rc(s)||!Rc(o.width)||!Rc(o.height)?null:i.jsx(Ga,{ref:p,offsetX:r.x/s,offsetY:r.y/s,height:o.height/s,width:o.width/s,fillPatternImage:a,fillPatternOffsetY:Rc(u)?u:0,fillPatternRepeat:"repeat",fillPatternScale:{x:1/s,y:1/s},listening:!0,globalCompositeOperation:"source-in",...t})},qle=Te([xn],e=>({objects:e.layerState.objects}),{memoizeOptions:{resultEqualityCheck:Ut}}),Yle=e=>{const{...t}=e,{objects:n}=q(qle);return i.jsx(wi,{listening:!1,...t,children:n.filter(Z7).map((r,o)=>i.jsx(yg,{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 Tl=h,Kle=function(t,n,r){const o=Tl.useRef("loading"),s=Tl.useRef(),[a,l]=Tl.useState(0),u=Tl.useRef(),f=Tl.useRef(),p=Tl.useRef();return(u.current!==t||f.current!==n||p.current!==r)&&(o.current="loading",s.current=void 0,u.current=t,f.current=n,p.current=r),Tl.useLayoutEffect(function(){if(!t)return;var m=document.createElement("img");function v(){o.current="loaded",s.current=m,l(Math.random())}function y(){o.current="failed",s.current=void 0,l(Math.random())}return m.addEventListener("load",v),m.addEventListener("error",y),n&&(m.crossOrigin=n),r&&(m.referrerPolicy=r),m.src=t,function(){m.removeEventListener("load",v),m.removeEventListener("error",y)}},[t,n,r]),[s.current,o.current]};const Xle=kf(Kle),G8=e=>{const{width:t,height:n,x:r,y:o,imageName:s}=e.canvasImage,{currentData:a,isError:l}=lc(s??cc.skipToken),[u]=Xle((a==null?void 0:a.image_url)??"",Q7.get()?"use-credentials":"anonymous");return l?i.jsx(Ga,{x:r,y:o,width:t,height:n,fill:"red"}):i.jsx(W8,{x:r,y:o,image:u,listening:!1})},Zle=Te([xn],e=>{const{layerState:{objects:t}}=e;return{objects:t}},{memoizeOptions:{resultEqualityCheck:Ut}}),Qle=()=>{const{objects:e}=q(Zle);return e?i.jsx(wi,{name:"outpainting-objects",listening:!1,children:e.map((t,n)=>{if(J7(t))return i.jsx(G8,{canvasImage:t},n);if(e9(t)){const r=i.jsx(yg,{points:t.points,stroke:t.color?Zl(t.color):"rgb(0,0,0)",strokeWidth:t.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:t.tool==="brush"?"source-over":"destination-out"},n);return t.clip?i.jsx(wi,{clipX:t.clip.x,clipY:t.clip.y,clipWidth:t.clip.width,clipHeight:t.clip.height,children:r},n):r}else{if(t9(t))return i.jsx(Ga,{x:t.x,y:t.y,width:t.width,height:t.height,fill:Zl(t.color)},n);if(n9(t))return i.jsx(Ga,{x:t.x,y:t.y,width:t.width,height:t.height,fill:"rgb(255, 255, 255)",globalCompositeOperation:"destination-out"},n)}})}):null},Jle=Te([xn],e=>{const{layerState:t,shouldShowStagingImage:n,shouldShowStagingOutline:r,boundingBoxCoordinates:{x:o,y:s},boundingBoxDimensions:{width:a,height:l}}=e,{selectedImageIndex:u,images:f}=t.stagingArea;return{currentStagingAreaImage:f.length>0&&u!==void 0?f[u]:void 0,isOnFirstImage:u===0,isOnLastImage:u===f.length-1,shouldShowStagingImage:n,shouldShowStagingOutline:r,x:o,y:s,width:a,height:l}},{memoizeOptions:{resultEqualityCheck:Ut}}),ece=e=>{const{...t}=e,{currentStagingAreaImage:n,shouldShowStagingImage:r,shouldShowStagingOutline:o,x:s,y:a,width:l,height:u}=q(Jle);return i.jsxs(wi,{...t,children:[r&&n&&i.jsx(G8,{canvasImage:n}),o&&i.jsxs(wi,{children:[i.jsx(Ga,{x:s,y:a,width:l,height:u,strokeWidth:1,stroke:"white",strokeScaleEnabled:!1}),i.jsx(Ga,{x:s,y:a,width:l,height:u,dash:[4,4],strokeWidth:1,stroke:"black",strokeScaleEnabled:!1})]})]})},tce=Te([xn],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n,sessionId:r}},shouldShowStagingOutline:o,shouldShowStagingImage:s}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shouldShowStagingImage:s,shouldShowStagingOutline:o,sessionId:r}},{memoizeOptions:{resultEqualityCheck:Ut}}),nce=()=>{const e=ue(),{isOnFirstImage:t,isOnLastImage:n,currentStagingAreaImage:r,shouldShowStagingImage:o,sessionId:s}=q(tce),{t:a}=Ce(),l=h.useCallback(()=>{e(kS(!0))},[e]),u=h.useCallback(()=>{e(kS(!1))},[e]);nt(["left"],()=>{f()},{enabled:()=>!0,preventDefault:!0}),nt(["right"],()=>{p()},{enabled:()=>!0,preventDefault:!0}),nt(["enter"],()=>{m()},{enabled:()=>!0,preventDefault:!0});const f=h.useCallback(()=>e(r9()),[e]),p=h.useCallback(()=>e(o9()),[e]),m=h.useCallback(()=>e(s9(s)),[e,s]);return r?i.jsx(K,{pos:"absolute",bottom:4,w:"100%",align:"center",justify:"center",filter:"drop-shadow(0 0.5rem 1rem rgba(0,0,0))",onMouseOver:l,onMouseOut:u,children:i.jsxs(Fr,{isAttached:!0,children:[i.jsx(Me,{tooltip:`${a("unifiedCanvas.previous")} (Left)`,"aria-label":`${a("unifiedCanvas.previous")} (Left)`,icon:i.jsx(SI,{}),onClick:f,colorScheme:"accent",isDisabled:t}),i.jsx(Me,{tooltip:`${a("unifiedCanvas.next")} (Right)`,"aria-label":`${a("unifiedCanvas.next")} (Right)`,icon:i.jsx(HW,{}),onClick:p,colorScheme:"accent",isDisabled:n}),i.jsx(Me,{tooltip:`${a("unifiedCanvas.accept")} (Enter)`,"aria-label":`${a("unifiedCanvas.accept")} (Enter)`,icon:i.jsx(_I,{}),onClick:m,colorScheme:"accent"}),i.jsx(Me,{tooltip:a("unifiedCanvas.showHide"),"aria-label":a("unifiedCanvas.showHide"),"data-alert":!o,icon:o?i.jsx(XW,{}):i.jsx(KW,{}),onClick:()=>e(a9(!o)),colorScheme:"accent"}),i.jsx(Me,{tooltip:a("unifiedCanvas.saveToGallery"),"aria-label":a("unifiedCanvas.saveToGallery"),icon:i.jsx(Tb,{}),onClick:()=>e(i9({imageName:r.imageName})),colorScheme:"accent"}),i.jsx(Me,{tooltip:a("unifiedCanvas.discardAll"),"aria-label":a("unifiedCanvas.discardAll"),icon:i.jsx(Wf,{style:{transform:"rotate(45deg)"}}),onClick:()=>e(l9()),colorScheme:"error",fontSize:20})]})}):null},Qc=e=>Math.round(e*100)/100,rce=Te([xn],e=>{const{cursorPosition:t}=e,{cursorX:n,cursorY:r}=t?{cursorX:t.x,cursorY:t.y}:{cursorX:-1,cursorY:-1};return{cursorCoordinatesString:`(${Qc(n)}, ${Qc(r)})`}},{memoizeOptions:{resultEqualityCheck:Ut}});function oce(){const{cursorCoordinatesString:e}=q(rce),{t}=Ce();return i.jsx(et,{children:`${t("unifiedCanvas.cursorPosition")}: ${e}`})}const fx="var(--invokeai-colors-warning-500)",sce=Te([xn],e=>{const{stageDimensions:{width:t,height:n},stageCoordinates:{x:r,y:o},boundingBoxDimensions:{width:s,height:a},scaledBoundingBoxDimensions:{width:l,height:u},boundingBoxCoordinates:{x:f,y:p},stageScale:m,shouldShowCanvasDebugInfo:v,layer:y,boundingBoxScaleMethod:S,shouldPreserveMaskedArea:x}=e;let w="inherit";return(S==="none"&&(s<512||a<512)||S==="manual"&&l*u<512*512)&&(w=fx),{activeLayerColor:y==="mask"?fx:"inherit",activeLayerString:y.charAt(0).toUpperCase()+y.slice(1),boundingBoxColor:w,boundingBoxCoordinatesString:`(${Qc(f)}, ${Qc(p)})`,boundingBoxDimensionsString:`${s}×${a}`,scaledBoundingBoxDimensionsString:`${l}×${u}`,canvasCoordinatesString:`${Qc(r)}×${Qc(o)}`,canvasDimensionsString:`${t}×${n}`,canvasScaleString:Math.round(m*100),shouldShowCanvasDebugInfo:v,shouldShowBoundingBox:S!=="auto",shouldShowScaledBoundingBox:S!=="none",shouldPreserveMaskedArea:x}},{memoizeOptions:{resultEqualityCheck:Ut}}),ace=()=>{const{activeLayerColor:e,activeLayerString:t,boundingBoxColor:n,boundingBoxCoordinatesString:r,boundingBoxDimensionsString:o,scaledBoundingBoxDimensionsString:s,shouldShowScaledBoundingBox:a,canvasCoordinatesString:l,canvasDimensionsString:u,canvasScaleString:f,shouldShowCanvasDebugInfo:p,shouldShowBoundingBox:m,shouldPreserveMaskedArea:v}=q(sce),{t:y}=Ce();return i.jsxs(K,{sx:{flexDirection:"column",position:"absolute",top:0,insetInlineStart:0,opacity:.65,display:"flex",fontSize:"sm",padding:1,px:2,minWidth:48,margin:1,borderRadius:"base",pointerEvents:"none",bg:"base.200",_dark:{bg:"base.800"}},children:[i.jsx(et,{style:{color:e},children:`${y("unifiedCanvas.activeLayer")}: ${t}`}),i.jsx(et,{children:`${y("unifiedCanvas.canvasScale")}: ${f}%`}),v&&i.jsx(et,{style:{color:fx},children:"Preserve Masked Area: On"}),m&&i.jsx(et,{style:{color:n},children:`${y("unifiedCanvas.boundingBox")}: ${o}`}),a&&i.jsx(et,{style:{color:n},children:`${y("unifiedCanvas.scaledBoundingBox")}: ${s}`}),p&&i.jsxs(i.Fragment,{children:[i.jsx(et,{children:`${y("unifiedCanvas.boundingBoxPosition")}: ${r}`}),i.jsx(et,{children:`${y("unifiedCanvas.canvasDimensions")}: ${u}`}),i.jsx(et,{children:`${y("unifiedCanvas.canvasPosition")}: ${l}`}),i.jsx(oce,{})]})]})},ice=Te(xn,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageScale:r,isDrawing:o,isTransformingBoundingBox:s,isMovingBoundingBox:a,tool:l,shouldSnapToGrid:u}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,isDrawing:o,isMovingBoundingBox:a,isTransformingBoundingBox:s,stageScale:r,shouldSnapToGrid:u,tool:l,hitStrokeWidth:20/r}},{memoizeOptions:{resultEqualityCheck:Ut}}),lce=e=>{const{...t}=e,n=ue(),{boundingBoxCoordinates:r,boundingBoxDimensions:o,isDrawing:s,isMovingBoundingBox:a,isTransformingBoundingBox:l,stageScale:u,shouldSnapToGrid:f,tool:p,hitStrokeWidth:m}=q(ice),v=h.useRef(null),y=h.useRef(null),[S,x]=h.useState(!1);h.useEffect(()=>{var U;!v.current||!y.current||(v.current.nodes([y.current]),(U=v.current.getLayer())==null||U.batchDraw())},[]);const w=64*u,_=h.useCallback(U=>{if(!f){n(z0({x:Math.floor(U.target.x()),y:Math.floor(U.target.y())}));return}const z=U.target.x(),F=U.target.y(),H=PS(z,64),G=PS(F,64);U.target.x(H),U.target.y(G),n(z0({x:H,y:G}))},[n,f]),k=h.useCallback(()=>{if(!y.current)return;const U=y.current,z=U.scaleX(),F=U.scaleY(),H=Math.round(U.width()*z),G=Math.round(U.height()*F),A=Math.round(U.x()),L=Math.round(U.y());n(Vd({width:H,height:G})),n(z0({x:f?_d(A,64):A,y:f?_d(L,64):L})),U.scaleX(1),U.scaleY(1)},[n,f]),P=h.useCallback((U,z,F)=>{const H=U.x%w,G=U.y%w;return{x:_d(z.x,w)+H,y:_d(z.y,w)+G}},[w]),I=()=>{n($0(!0))},j=()=>{n($0(!1)),n(L0(!1)),n(Np(!1)),x(!1)},E=()=>{n(L0(!0))},T=()=>{n($0(!1)),n(L0(!1)),n(Np(!1)),x(!1)},R=()=>{x(!0)},M=()=>{!l&&!a&&x(!1)},D=()=>{n(Np(!0))},N=()=>{n(Np(!1))};return i.jsxs(wi,{...t,children:[i.jsx(Ga,{height:o.height,width:o.width,x:r.x,y:r.y,onMouseEnter:D,onMouseOver:D,onMouseLeave:N,onMouseOut:N}),i.jsx(Ga,{draggable:!0,fillEnabled:!1,height:o.height,hitStrokeWidth:m,listening:!s&&p==="move",onDragStart:E,onDragEnd:T,onDragMove:_,onMouseDown:E,onMouseOut:M,onMouseOver:R,onMouseEnter:R,onMouseUp:T,onTransform:k,onTransformEnd:j,ref:y,stroke:S?"rgba(255,255,255,0.7)":"white",strokeWidth:(S?8:1)/u,width:o.width,x:r.x,y:r.y}),i.jsx(_le,{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:p==="move"?void 0:[],flipEnabled:!1,ignoreStroke:!0,keepRatio:!1,listening:!s&&p==="move",onDragStart:E,onDragEnd:T,onMouseDown:I,onMouseUp:j,onTransformEnd:j,ref:v,rotateEnabled:!1})]})},cce=Te(xn,e=>{const{cursorPosition:t,brushSize:n,colorPickerColor:r,maskColor:o,brushColor:s,tool:a,layer:l,shouldShowBrush:u,isMovingBoundingBox:f,isTransformingBoundingBox:p,stageScale:m,stageDimensions:v,boundingBoxCoordinates:y,boundingBoxDimensions:S,shouldRestrictStrokesToBox:x}=e,w=x?{clipX:y.x,clipY:y.y,clipWidth:S.width,clipHeight:S.height}:{};return{cursorPosition:t,brushX:t?t.x:v.width/2,brushY:t?t.y:v.height/2,radius:n/2,colorPickerOuterRadius:jS/m,colorPickerInnerRadius:(jS-X1+1)/m,maskColorString:Zl({...o,a:.5}),brushColorString:Zl(s),colorPickerColorString:Zl(r),tool:a,layer:l,shouldShowBrush:u,shouldDrawBrushPreview:!(f||p||!t)&&u,strokeWidth:1.5/m,dotRadius:1.5/m,clip:w}},{memoizeOptions:{resultEqualityCheck:Ut}}),uce=e=>{const{...t}=e,{brushX:n,brushY:r,radius:o,maskColorString:s,tool:a,layer:l,shouldDrawBrushPreview:u,dotRadius:f,strokeWidth:p,brushColorString:m,colorPickerColorString:v,colorPickerInnerRadius:y,colorPickerOuterRadius:S,clip:x}=q(cce);return u?i.jsxs(wi,{listening:!1,...x,...t,children:[a==="colorPicker"?i.jsxs(i.Fragment,{children:[i.jsx(Ol,{x:n,y:r,radius:S,stroke:m,strokeWidth:X1,strokeScaleEnabled:!1}),i.jsx(Ol,{x:n,y:r,radius:y,stroke:v,strokeWidth:X1,strokeScaleEnabled:!1})]}):i.jsxs(i.Fragment,{children:[i.jsx(Ol,{x:n,y:r,radius:o,fill:l==="mask"?s:m,globalCompositeOperation:a==="eraser"?"destination-out":"source-out"}),i.jsx(Ol,{x:n,y:r,radius:o,stroke:"rgba(255,255,255,0.4)",strokeWidth:p*2,strokeEnabled:!0,listening:!1}),i.jsx(Ol,{x:n,y:r,radius:o,stroke:"rgba(0,0,0,1)",strokeWidth:p,strokeEnabled:!0,listening:!1})]}),i.jsx(Ol,{x:n,y:r,radius:f*2,fill:"rgba(255,255,255,0.4)",listening:!1}),i.jsx(Ol,{x:n,y:r,radius:f,fill:"rgba(0,0,0,1)",listening:!1})]}):null},dce=Te([xn,jr],(e,t)=>{const{isMaskEnabled:n,stageScale:r,shouldShowBoundingBox:o,isTransformingBoundingBox:s,isMouseOverBoundingBox:a,isMovingBoundingBox:l,stageDimensions:u,stageCoordinates:f,tool:p,isMovingStage:m,shouldShowIntermediates:v,shouldShowGrid:y,shouldRestrictStrokesToBox:S,shouldAntialias:x}=e;let w="none";return p==="move"||t?m?w="grabbing":w="grab":s?w=void 0:S&&!a&&(w="default"),{isMaskEnabled:n,isModifyingBoundingBox:s||l,shouldShowBoundingBox:o,shouldShowGrid:y,stageCoordinates:f,stageCursor:w,stageDimensions:u,stageScale:r,tool:p,isStaging:t,shouldShowIntermediates:v,shouldAntialias:x}},zn),fce=Oe(kle,{shouldForwardProp:e=>!["sx"].includes(e)}),z3=()=>{const{isMaskEnabled:e,isModifyingBoundingBox:t,shouldShowBoundingBox:n,shouldShowGrid:r,stageCoordinates:o,stageCursor:s,stageDimensions:a,stageScale:l,tool:u,isStaging:f,shouldShowIntermediates:p,shouldAntialias:m}=q(dce);Ele();const v=h.useRef(null),y=h.useRef(null),S=h.useCallback(D=>{u9(D),v.current=D},[]),x=h.useCallback(D=>{c9(D),y.current=D},[]),w=h.useRef({x:0,y:0}),_=h.useRef(!1),k=$le(v),P=Tle(v),I=Nle(v,_),j=Mle(v,_,w),E=Dle(),{handleDragStart:T,handleDragMove:R,handleDragEnd:M}=jle();return i.jsx(K,{sx:{position:"relative",height:"100%",width:"100%",borderRadius:"base"},children:i.jsxs(et,{sx:{position:"relative"},children:[i.jsxs(fce,{tabIndex:-1,ref:S,sx:{outline:"none",overflow:"hidden",cursor:s||void 0,canvas:{outline:"none"}},x:o.x,y:o.y,width:a.width,height:a.height,scale:{x:l,y:l},onTouchStart:P,onTouchMove:j,onTouchEnd:I,onMouseDown:P,onMouseLeave:E,onMouseMove:j,onMouseUp:I,onDragStart:T,onDragMove:R,onDragEnd:M,onContextMenu:D=>D.evt.preventDefault(),onWheel:k,draggable:(u==="move"||f)&&!t,children:[i.jsx(Cd,{id:"grid",visible:r,children:i.jsx(Hle,{})}),i.jsx(Cd,{id:"base",ref:x,listening:!1,imageSmoothingEnabled:m,children:i.jsx(Qle,{})}),i.jsxs(Cd,{id:"mask",visible:e,listening:!1,children:[i.jsx(Yle,{visible:!0,listening:!1}),i.jsx(Gle,{listening:!1})]}),i.jsx(Cd,{children:i.jsx(Ble,{})}),i.jsxs(Cd,{id:"preview",imageSmoothingEnabled:m,children:[!f&&i.jsx(uce,{visible:u!=="move",listening:!1}),i.jsx(ece,{visible:f}),p&&i.jsx(Wle,{}),i.jsx(lce,{visible:n&&!f})]})]}),i.jsx(ace,{}),i.jsx(nce,{})]})})},pce=Te(xn,d9,Gr,(e,t,n)=>{const{doesCanvasNeedScaling:r,isCanvasInitialized:o}=e;return{doesCanvasNeedScaling:r,activeTabName:n,initialCanvasImage:t,isCanvasInitialized:o}}),$3=()=>{const e=ue(),{doesCanvasNeedScaling:t,activeTabName:n,initialCanvasImage:r,isCanvasInitialized:o}=q(pce),s=h.useRef(null);return h.useLayoutEffect(()=>{window.setTimeout(()=>{if(!s.current)return;const{clientWidth:a,clientHeight:l}=s.current;e(f9({width:a,height:l})),e(o?p9():Sg()),e(i5(!1))},0)},[e,r,t,n,o]),i.jsx(K,{ref:s,sx:{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:4,width:"100%",height:"100%"},children:i.jsx(Du,{thickness:"2px",size:"xl"})})};function q8(e,t,n=250){const[r,o]=h.useState(0);return h.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 Dv(){return(Dv=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 Y8(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 px(e){var t=h.useRef(e),n=h.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var Mu=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e<t?t:e},Bd=function(e){return"touches"in e},hx=function(e){return e&&e.ownerDocument.defaultView||self},L3=function(e,t,n){var r=e.getBoundingClientRect(),o=Bd(t)?function(s,a){for(var l=0;l<s.length;l++)if(s[l].identifier===a)return s[l];return s[0]}(t.touches,n):t;return{left:Mu((o.pageX-(r.left+hx(e).pageXOffset))/r.width),top:Mu((o.pageY-(r.top+hx(e).pageYOffset))/r.height)}},B3=function(e){!Bd(e)&&e.preventDefault()},k2=B.memo(function(e){var t=e.onMove,n=e.onKey,r=Y8(e,["onMove","onKey"]),o=h.useRef(null),s=px(t),a=px(n),l=h.useRef(null),u=h.useRef(!1),f=h.useMemo(function(){var y=function(w){B3(w),(Bd(w)?w.touches.length>0:w.buttons>0)&&o.current?s(L3(o.current,w,l.current)):x(!1)},S=function(){return x(!1)};function x(w){var _=u.current,k=hx(o.current),P=w?k.addEventListener:k.removeEventListener;P(_?"touchmove":"mousemove",y),P(_?"touchend":"mouseup",S)}return[function(w){var _=w.nativeEvent,k=o.current;if(k&&(B3(_),!function(I,j){return j&&!Bd(I)}(_,u.current)&&k)){if(Bd(_)){u.current=!0;var P=_.changedTouches||[];P.length&&(l.current=P[0].identifier)}k.focus(),s(L3(k,_,l.current)),x(!0)}},function(w){var _=w.which||w.keyCode;_<37||_>40||(w.preventDefault(),a({left:_===39?.05:_===37?-.05:0,top:_===40?.05:_===38?-.05:0}))},x]},[a,s]),p=f[0],m=f[1],v=f[2];return h.useEffect(function(){return v},[v]),B.createElement("div",Dv({},r,{onTouchStart:p,onMouseDown:p,className:"react-colorful__interactive",ref:o,onKeyDown:m,tabIndex:0,role:"slider"}))}),Av=function(e){return e.filter(Boolean).join(" ")},P2=function(e){var t=e.color,n=e.left,r=e.top,o=r===void 0?.5:r,s=Av(["react-colorful__pointer",e.className]);return B.createElement("div",{className:s,style:{top:100*o+"%",left:100*n+"%"}},B.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},Ao=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},K8=function(e){var t=e.s,n=e.v,r=e.a,o=(200-t)*n/100;return{h:Ao(e.h),s:Ao(o>0&&o<200?t*n/100/(o<=100?o:200-o)*100:0),l:Ao(o/2),a:Ao(r,2)}},mx=function(e){var t=K8(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},H1=function(e){var t=K8(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},hce=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var s=Math.floor(t),a=r*(1-n),l=r*(1-(t-s)*n),u=r*(1-(1-t+s)*n),f=s%6;return{r:Ao(255*[r,l,a,a,u,r][f]),g:Ao(255*[u,r,r,l,a,a][f]),b:Ao(255*[a,a,u,r,r,l][f]),a:Ao(o,2)}},mce=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,s=Math.max(t,n,r),a=s-Math.min(t,n,r),l=a?s===t?(n-r)/a:s===n?2+(r-t)/a:4+(t-n)/a:0;return{h:Ao(60*(l<0?l+6:l)),s:Ao(s?a/s*100:0),v:Ao(s/255*100),a:o}},gce=B.memo(function(e){var t=e.hue,n=e.onChange,r=Av(["react-colorful__hue",e.className]);return B.createElement("div",{className:r},B.createElement(k2,{onMove:function(o){n({h:360*o.left})},onKey:function(o){n({h:Mu(t+360*o.left,0,360)})},"aria-label":"Hue","aria-valuenow":Ao(t),"aria-valuemax":"360","aria-valuemin":"0"},B.createElement(P2,{className:"react-colorful__hue-pointer",left:t/360,color:mx({h:t,s:100,v:100,a:1})})))}),vce=B.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:mx({h:t.h,s:100,v:100,a:1})};return B.createElement("div",{className:"react-colorful__saturation",style:r},B.createElement(k2,{onMove:function(o){n({s:100*o.left,v:100-100*o.top})},onKey:function(o){n({s:Mu(t.s+100*o.left,0,100),v:Mu(t.v-100*o.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+Ao(t.s)+"%, Brightness "+Ao(t.v)+"%"},B.createElement(P2,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:mx(t)})))}),X8=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function yce(e,t,n){var r=px(n),o=h.useState(function(){return e.toHsva(t)}),s=o[0],a=o[1],l=h.useRef({color:t,hsva:s});h.useEffect(function(){if(!e.equal(t,l.current.color)){var f=e.toHsva(t);l.current={hsva:f,color:t},a(f)}},[t,e]),h.useEffect(function(){var f;X8(s,l.current.hsva)||e.equal(f=e.fromHsva(s),l.current.color)||(l.current={hsva:s,color:f},r(f))},[s,e,r]);var u=h.useCallback(function(f){a(function(p){return Object.assign({},p,f)})},[]);return[s,u]}var xce=typeof window<"u"?h.useLayoutEffect:h.useEffect,bce=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},F3=new Map,wce=function(e){xce(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!F3.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}`,F3.set(t,n);var r=bce();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},Sce=function(e){var t=e.className,n=e.hsva,r=e.onChange,o={backgroundImage:"linear-gradient(90deg, "+H1(Object.assign({},n,{a:0}))+", "+H1(Object.assign({},n,{a:1}))+")"},s=Av(["react-colorful__alpha",t]),a=Ao(100*n.a);return B.createElement("div",{className:s},B.createElement("div",{className:"react-colorful__alpha-gradient",style:o}),B.createElement(k2,{onMove:function(l){r({a:l.left})},onKey:function(l){r({a:Mu(n.a+l.left)})},"aria-label":"Alpha","aria-valuetext":a+"%","aria-valuenow":a,"aria-valuemin":"0","aria-valuemax":"100"},B.createElement(P2,{className:"react-colorful__alpha-pointer",left:n.a,color:H1(n)})))},Cce=function(e){var t=e.className,n=e.colorModel,r=e.color,o=r===void 0?n.defaultColor:r,s=e.onChange,a=Y8(e,["className","colorModel","color","onChange"]),l=h.useRef(null);wce(l);var u=yce(n,o,s),f=u[0],p=u[1],m=Av(["react-colorful",t]);return B.createElement("div",Dv({},a,{ref:l,className:m}),B.createElement(vce,{hsva:f,onChange:p}),B.createElement(gce,{hue:f.h,onChange:p}),B.createElement(Sce,{hsva:f,onChange:p,className:"react-colorful__last-control"}))},_ce={defaultColor:{r:0,g:0,b:0,a:1},toHsva:mce,fromHsva:hce,equal:X8},Z8=function(e){return B.createElement(Cce,Dv({},e,{colorModel:_ce}))};const kce=Oe(Z8,{baseStyle:{paddingInline:4},shouldForwardProp:e=>!["pickerColor"].includes(e)}),V1={width:6,height:6,borderColor:"base.100"},Pce=e=>{const{styleClass:t="",...n}=e;return i.jsx(kce,{sx:{".react-colorful__hue-pointer":V1,".react-colorful__saturation-pointer":V1,".react-colorful__alpha-pointer":V1},className:t,...n})},xg=h.memo(Pce),jce=Te([xn,jr],(e,t)=>{const{maskColor:n,layer:r,isMaskEnabled:o,shouldPreserveMaskedArea:s}=e;return{layer:r,maskColor:n,maskColorString:Zl(n),isMaskEnabled:o,shouldPreserveMaskedArea:s,isStaging:t}},{memoizeOptions:{resultEqualityCheck:Ut}}),Ice=()=>{const e=ue(),{t}=Ce(),{layer:n,maskColor:r,isMaskEnabled:o,shouldPreserveMaskedArea:s,isStaging:a}=q(jce);nt(["q"],()=>{l()},{enabled:()=>!a,preventDefault:!0},[n]),nt(["shift+c"],()=>{u()},{enabled:()=>!a,preventDefault:!0},[]),nt(["h"],()=>{f()},{enabled:()=>!a,preventDefault:!0},[o]);const l=()=>{e(Qh(n==="mask"?"base":"mask"))},u=()=>e(Ex()),f=()=>e(Of(!o));return i.jsx(ii,{triggerComponent:i.jsx(Fr,{children:i.jsx(Me,{"aria-label":t("unifiedCanvas.maskingOptions"),tooltip:t("unifiedCanvas.maskingOptions"),icon:i.jsx(oU,{}),isChecked:n==="mask",isDisabled:a})}),children:i.jsxs(K,{direction:"column",gap:2,children:[i.jsx(qn,{label:`${t("unifiedCanvas.enableMask")} (H)`,isChecked:o,onChange:f}),i.jsx(qn,{label:t("unifiedCanvas.preserveMaskedArea"),isChecked:s,onChange:p=>e(I5(p.target.checked))}),i.jsx(xg,{sx:{paddingTop:2,paddingBottom:2},pickerColor:r,onChange:p=>e(E5(p))}),i.jsxs(fn,{size:"sm",leftIcon:i.jsx(Ls,{}),onClick:u,children:[t("unifiedCanvas.clearMask")," (Shift+C)"]})]})})},Ece=Te([xn,Gr,pr],(e,t,n)=>{const{futureLayerStates:r}=e;return{canRedo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:Ut}});function Q8(){const e=ue(),{canRedo:t,activeTabName:n}=q(Ece),{t:r}=Ce(),o=()=>{e(h9())};return nt(["meta+shift+z","ctrl+shift+z","control+y","meta+y"],()=>{o()},{enabled:()=>t,preventDefault:!0},[n,t]),i.jsx(Me,{"aria-label":`${r("unifiedCanvas.redo")} (Ctrl+Shift+Z)`,tooltip:`${r("unifiedCanvas.redo")} (Ctrl+Shift+Z)`,icon:i.jsx(cU,{}),onClick:o,isDisabled:!t})}const J8=()=>{const e=q(jr),t=ue(),{t:n}=Ce();return i.jsxs(a2,{title:n("unifiedCanvas.clearCanvasHistory"),acceptCallback:()=>t(m9()),acceptButtonText:n("unifiedCanvas.clearHistory"),triggerComponent:i.jsx(fn,{size:"sm",leftIcon:i.jsx(Ls,{}),isDisabled:e,children:n("unifiedCanvas.clearCanvasHistory")}),children:[i.jsx("p",{children:n("unifiedCanvas.clearCanvasHistoryMessage")}),i.jsx("br",{}),i.jsx("p",{children:n("unifiedCanvas.clearCanvasHistoryConfirm")})]})},Oce=Te([xn],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:o,shouldShowGrid:s,shouldShowIntermediates:a,shouldSnapToGrid:l,shouldRestrictStrokesToBox:u,shouldAntialias:f}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:o,shouldShowGrid:s,shouldShowIntermediates:a,shouldSnapToGrid:l,shouldRestrictStrokesToBox:u,shouldAntialias:f}},{memoizeOptions:{resultEqualityCheck:Ut}}),Tce=()=>{const e=ue(),{t}=Ce(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldDarkenOutsideBoundingBox:o,shouldShowCanvasDebugInfo:s,shouldShowGrid:a,shouldShowIntermediates:l,shouldSnapToGrid:u,shouldRestrictStrokesToBox:f,shouldAntialias:p}=q(Oce);nt(["n"],()=>{e(Zh(!u))},{enabled:!0,preventDefault:!0},[u]);const m=v=>e(Zh(v.target.checked));return i.jsx(ii,{isLazy:!1,triggerComponent:i.jsx(Me,{tooltip:t("unifiedCanvas.canvasSettings"),"aria-label":t("unifiedCanvas.canvasSettings"),icon:i.jsx(Mb,{})}),children:i.jsxs(K,{direction:"column",gap:2,children:[i.jsx(qn,{label:t("unifiedCanvas.showIntermediates"),isChecked:l,onChange:v=>e(O5(v.target.checked))}),i.jsx(qn,{label:t("unifiedCanvas.showGrid"),isChecked:a,onChange:v=>e(T5(v.target.checked))}),i.jsx(qn,{label:t("unifiedCanvas.snapToGrid"),isChecked:u,onChange:m}),i.jsx(qn,{label:t("unifiedCanvas.darkenOutsideSelection"),isChecked:o,onChange:v=>e(R5(v.target.checked))}),i.jsx(qn,{label:t("unifiedCanvas.autoSaveToGallery"),isChecked:n,onChange:v=>e(M5(v.target.checked))}),i.jsx(qn,{label:t("unifiedCanvas.saveBoxRegionOnly"),isChecked:r,onChange:v=>e(D5(v.target.checked))}),i.jsx(qn,{label:t("unifiedCanvas.limitStrokesToBox"),isChecked:f,onChange:v=>e(A5(v.target.checked))}),i.jsx(qn,{label:t("unifiedCanvas.showCanvasDebugInfo"),isChecked:s,onChange:v=>e(N5(v.target.checked))}),i.jsx(qn,{label:t("unifiedCanvas.antialiasing"),isChecked:p,onChange:v=>e(z5(v.target.checked))}),i.jsx(J8,{})]})})},Rce=Te([xn,jr,pr],(e,t,n)=>{const{isProcessing:r}=n,{tool:o,brushColor:s,brushSize:a}=e;return{tool:o,isStaging:t,isProcessing:r,brushColor:s,brushSize:a}},{memoizeOptions:{resultEqualityCheck:Ut}}),Mce=()=>{const e=ue(),{tool:t,brushColor:n,brushSize:r,isStaging:o}=q(Rce),{t:s}=Ce();nt(["b"],()=>{a()},{enabled:()=>!o,preventDefault:!0},[]),nt(["e"],()=>{l()},{enabled:()=>!o,preventDefault:!0},[t]),nt(["c"],()=>{u()},{enabled:()=>!o,preventDefault:!0},[t]),nt(["shift+f"],()=>{f()},{enabled:()=>!o,preventDefault:!0}),nt(["delete","backspace"],()=>{p()},{enabled:()=>!o,preventDefault:!0}),nt(["BracketLeft"],()=>{e(eu(Math.max(r-5,5)))},{enabled:()=>!o,preventDefault:!0},[r]),nt(["BracketRight"],()=>{e(eu(Math.min(r+5,500)))},{enabled:()=>!o,preventDefault:!0},[r]),nt(["shift+BracketLeft"],()=>{e(tu({...n,a:ma(n.a-.05,.05,1)}))},{enabled:()=>!o,preventDefault:!0},[n]),nt(["shift+BracketRight"],()=>{e(tu({...n,a:ma(n.a+.05,.05,1)}))},{enabled:()=>!o,preventDefault:!0},[n]);const a=()=>e(Ba("brush")),l=()=>e(Ba("eraser")),u=()=>e(Ba("colorPicker")),f=()=>e($5()),p=()=>e(L5());return i.jsxs(Fr,{isAttached:!0,children:[i.jsx(Me,{"aria-label":`${s("unifiedCanvas.brush")} (B)`,tooltip:`${s("unifiedCanvas.brush")} (B)`,icon:i.jsx(TI,{}),isChecked:t==="brush"&&!o,onClick:a,isDisabled:o}),i.jsx(Me,{"aria-label":`${s("unifiedCanvas.eraser")} (E)`,tooltip:`${s("unifiedCanvas.eraser")} (E)`,icon:i.jsx(jI,{}),isChecked:t==="eraser"&&!o,isDisabled:o,onClick:l}),i.jsx(Me,{"aria-label":`${s("unifiedCanvas.fillBoundingBox")} (Shift+F)`,tooltip:`${s("unifiedCanvas.fillBoundingBox")} (Shift+F)`,icon:i.jsx(EI,{}),isDisabled:o,onClick:f}),i.jsx(Me,{"aria-label":`${s("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,tooltip:`${s("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,icon:i.jsx(Wf,{style:{transform:"rotate(45deg)"}}),isDisabled:o,onClick:p}),i.jsx(Me,{"aria-label":`${s("unifiedCanvas.colorPicker")} (C)`,tooltip:`${s("unifiedCanvas.colorPicker")} (C)`,icon:i.jsx(II,{}),isChecked:t==="colorPicker"&&!o,isDisabled:o,onClick:u}),i.jsx(ii,{triggerComponent:i.jsx(Me,{"aria-label":s("unifiedCanvas.brushOptions"),tooltip:s("unifiedCanvas.brushOptions"),icon:i.jsx(Rb,{})}),children:i.jsxs(K,{minWidth:60,direction:"column",gap:4,width:"100%",children:[i.jsx(K,{gap:4,justifyContent:"space-between",children:i.jsx(Tt,{label:s("unifiedCanvas.brushSize"),value:r,withInput:!0,onChange:m=>e(eu(m)),sliderNumberInputProps:{max:500},inputReadOnly:!1})}),i.jsx(xg,{sx:{width:"100%",paddingTop:2,paddingBottom:2},pickerColor:n,onChange:m=>e(tu(m))})]})})]})},Dce=Te([xn,Gr,pr],(e,t,n)=>{const{pastLayerStates:r}=e;return{canUndo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:Ut}});function eR(){const e=ue(),{t}=Ce(),{canUndo:n,activeTabName:r}=q(Dce),o=()=>{e(g9())};return nt(["meta+z","ctrl+z"],()=>{o()},{enabled:()=>n,preventDefault:!0},[r,n]),i.jsx(Me,{"aria-label":`${t("unifiedCanvas.undo")} (Ctrl+Z)`,tooltip:`${t("unifiedCanvas.undo")} (Ctrl+Z)`,icon:i.jsx(ov,{}),onClick:o,isDisabled:!n})}const Ace=Te([pr,xn,jr],(e,t,n)=>{const{isProcessing:r}=e,{tool:o,shouldCropToBoundingBoxOnSave:s,layer:a,isMaskEnabled:l}=t;return{isProcessing:r,isStaging:n,isMaskEnabled:l,tool:o,layer:a,shouldCropToBoundingBoxOnSave:s}},{memoizeOptions:{resultEqualityCheck:Ut}}),Nce=()=>{const e=ue(),{isProcessing:t,isStaging:n,isMaskEnabled:r,layer:o,tool:s}=q(Ace),a=hi(),{t:l}=Ce(),{openUploader:u}=Qg();nt(["v"],()=>{f()},{enabled:()=>!n,preventDefault:!0},[]),nt(["r"],()=>{m()},{enabled:()=>!0,preventDefault:!0},[a]),nt(["shift+m"],()=>{y()},{enabled:()=>!n,preventDefault:!0},[a,t]),nt(["shift+s"],()=>{S()},{enabled:()=>!n,preventDefault:!0},[a,t]),nt(["meta+c","ctrl+c"],()=>{x()},{enabled:()=>!n,preventDefault:!0},[a,t]),nt(["shift+d"],()=>{w()},{enabled:()=>!n,preventDefault:!0},[a,t]);const f=()=>e(Ba("move")),p=q8(()=>m(!1),()=>m(!0)),m=(k=!1)=>{const P=hi();if(!P)return;const I=P.getClientRect({skipTransform:!0});e(B5({contentRect:I,shouldScaleTo1:k}))},v=()=>{e(G5()),e(Sg())},y=()=>{e(F5())},S=()=>{e(H5())},x=()=>{e(V5())},w=()=>{e(W5())},_=k=>{const P=k;e(Qh(P)),P==="mask"&&!r&&e(Of(!0))};return i.jsxs(K,{sx:{alignItems:"center",gap:2,flexWrap:"wrap"},children:[i.jsx(et,{w:24,children:i.jsx(Zo,{tooltip:`${l("unifiedCanvas.layer")} (Q)`,value:o,data:U5,onChange:_,disabled:n})}),i.jsx(Ice,{}),i.jsx(Mce,{}),i.jsxs(Fr,{isAttached:!0,children:[i.jsx(Me,{"aria-label":`${l("unifiedCanvas.move")} (V)`,tooltip:`${l("unifiedCanvas.move")} (V)`,icon:i.jsx(CI,{}),isChecked:s==="move"||n,onClick:f}),i.jsx(Me,{"aria-label":`${l("unifiedCanvas.resetView")} (R)`,tooltip:`${l("unifiedCanvas.resetView")} (R)`,icon:i.jsx(PI,{}),onClick:p})]}),i.jsxs(Fr,{isAttached:!0,children:[i.jsx(Me,{"aria-label":`${l("unifiedCanvas.mergeVisible")} (Shift+M)`,tooltip:`${l("unifiedCanvas.mergeVisible")} (Shift+M)`,icon:i.jsx(OI,{}),onClick:y,isDisabled:n}),i.jsx(Me,{"aria-label":`${l("unifiedCanvas.saveToGallery")} (Shift+S)`,tooltip:`${l("unifiedCanvas.saveToGallery")} (Shift+S)`,icon:i.jsx(Tb,{}),onClick:S,isDisabled:n}),i.jsx(Me,{"aria-label":`${l("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${l("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,icon:i.jsx(Wu,{}),onClick:x,isDisabled:n}),i.jsx(Me,{"aria-label":`${l("unifiedCanvas.downloadAsImage")} (Shift+D)`,tooltip:`${l("unifiedCanvas.downloadAsImage")} (Shift+D)`,icon:i.jsx(Eb,{}),onClick:w,isDisabled:n})]}),i.jsxs(Fr,{isAttached:!0,children:[i.jsx(eR,{}),i.jsx(Q8,{})]}),i.jsxs(Fr,{isAttached:!0,children:[i.jsx(Me,{"aria-label":`${l("common.upload")}`,tooltip:`${l("common.upload")}`,icon:i.jsx(sv,{}),onClick:u,isDisabled:n}),i.jsx(Me,{"aria-label":`${l("unifiedCanvas.clearCanvas")}`,tooltip:`${l("unifiedCanvas.clearCanvas")}`,icon:i.jsx(Ls,{}),onClick:v,colorScheme:"error",isDisabled:n})]}),i.jsx(Fr,{isAttached:!0,children:i.jsx(Tce,{})})]})},zce=Te([xn],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:o,shouldAntialias:s}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:o,shouldAntialias:s}},{memoizeOptions:{resultEqualityCheck:Ut}}),$ce=()=>{const e=ue(),{t}=Ce(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldShowCanvasDebugInfo:o,shouldShowIntermediates:s,shouldAntialias:a}=q(zce);return i.jsx(ii,{isLazy:!1,triggerComponent:i.jsx(Me,{tooltip:t("unifiedCanvas.canvasSettings"),tooltipProps:{placement:"bottom"},"aria-label":t("unifiedCanvas.canvasSettings"),icon:i.jsx(Mb,{})}),children:i.jsxs(K,{direction:"column",gap:2,children:[i.jsx(qn,{label:t("unifiedCanvas.showIntermediates"),isChecked:s,onChange:l=>e(O5(l.target.checked))}),i.jsx(qn,{label:t("unifiedCanvas.autoSaveToGallery"),isChecked:n,onChange:l=>e(M5(l.target.checked))}),i.jsx(qn,{label:t("unifiedCanvas.saveBoxRegionOnly"),isChecked:r,onChange:l=>e(D5(l.target.checked))}),i.jsx(qn,{label:t("unifiedCanvas.showCanvasDebugInfo"),isChecked:o,onChange:l=>e(N5(l.target.checked))}),i.jsx(qn,{label:t("unifiedCanvas.antialiasing"),isChecked:a,onChange:l=>e(z5(l.target.checked))}),i.jsx(J8,{})]})})};function Lce(){const e=q(jr),t=hi(),n=q(a=>a.system.isProcessing),r=ue(),{t:o}=Ce();nt(["meta+c","ctrl+c"],()=>{s()},{enabled:()=>!e,preventDefault:!0},[t,n]);const s=()=>{r(V5())};return i.jsx(Me,{"aria-label":`${o("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${o("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`,icon:i.jsx(Wu,{}),onClick:s,isDisabled:e})}function Bce(){const e=ue(),{t}=Ce(),n=hi(),r=q(jr);nt(["shift+d"],()=>{o()},{enabled:()=>!r,preventDefault:!0},[n]);const o=()=>{e(W5())};return i.jsx(Me,{"aria-label":`${t("unifiedCanvas.downloadAsImage")} (Shift+D)`,tooltip:`${t("unifiedCanvas.downloadAsImage")} (Shift+D)`,icon:i.jsx(Eb,{}),onClick:o,isDisabled:r})}function Fce(){const e=q(jr),{openUploader:t}=Qg(),{t:n}=Ce();return i.jsx(Me,{"aria-label":n("common.upload"),tooltip:n("common.upload"),icon:i.jsx(sv,{}),onClick:t,isDisabled:e})}const Hce=Te([xn,jr],(e,t)=>{const{layer:n,isMaskEnabled:r}=e;return{layer:n,isMaskEnabled:r,isStaging:t}},{memoizeOptions:{resultEqualityCheck:Ut}});function Vce(){const e=ue(),{t}=Ce(),{layer:n,isMaskEnabled:r,isStaging:o}=q(Hce),s=()=>{e(Qh(n==="mask"?"base":"mask"))};nt(["q"],()=>{s()},{enabled:()=>!o,preventDefault:!0},[n]);const a=l=>{const u=l;e(Qh(u)),u==="mask"&&!r&&e(Of(!0))};return i.jsx(Zo,{tooltip:`${t("unifiedCanvas.layer")} (Q)`,"aria-label":`${t("unifiedCanvas.layer")} (Q)`,value:n,data:U5,onChange:a,disabled:o,w:"full"})}function Wce(){const e=ue(),{t}=Ce(),n=hi(),r=q(jr),o=q(a=>a.system.isProcessing);nt(["shift+m"],()=>{s()},{enabled:()=>!r,preventDefault:!0},[n,o]);const s=()=>{e(F5())};return i.jsx(Me,{"aria-label":`${t("unifiedCanvas.mergeVisible")} (Shift+M)`,tooltip:`${t("unifiedCanvas.mergeVisible")} (Shift+M)`,icon:i.jsx(OI,{}),onClick:s,isDisabled:r})}function Uce(){const e=q(s=>s.canvas.tool),t=q(jr),n=ue(),{t:r}=Ce();nt(["v"],()=>{o()},{enabled:()=>!t,preventDefault:!0},[]);const o=()=>n(Ba("move"));return i.jsx(Me,{"aria-label":`${r("unifiedCanvas.move")} (V)`,tooltip:`${r("unifiedCanvas.move")} (V)`,icon:i.jsx(CI,{}),isChecked:e==="move"||t,onClick:o})}function Gce(){const e=q(s=>s.ui.shouldPinParametersPanel),t=q(s=>s.ui.shouldShowParametersPanel),n=ue(),{t:r}=Ce(),o=()=>{n(jx(!0)),e&&n(Bs())};return!e||!t?i.jsxs(K,{flexDirection:"column",gap:2,children:[i.jsx(Me,{tooltip:`${r("parameters.showOptionsPanel")} (O)`,tooltipProps:{placement:"top"},"aria-label":r("parameters.showOptionsPanel"),onClick:o,children:i.jsx(Rb,{})}),i.jsx(K,{children:i.jsx(c2,{iconButton:!0})}),i.jsx(K,{children:i.jsx(i2,{width:"100%",height:"40px",btnGroupWidth:"100%"})})]}):null}function qce(){const e=ue(),{t}=Ce(),n=q(jr),r=()=>{e(G5()),e(Sg())};return i.jsx(Me,{"aria-label":t("unifiedCanvas.clearCanvas"),tooltip:t("unifiedCanvas.clearCanvas"),icon:i.jsx(Ls,{}),onClick:r,isDisabled:n,colorScheme:"error"})}function Yce(){const e=hi(),t=ue(),{t:n}=Ce();nt(["r"],()=>{o()},{enabled:()=>!0,preventDefault:!0},[e]);const r=q8(()=>o(!1),()=>o(!0)),o=(s=!1)=>{const a=hi();if(!a)return;const l=a.getClientRect({skipTransform:!0});t(B5({contentRect:l,shouldScaleTo1:s}))};return i.jsx(Me,{"aria-label":`${n("unifiedCanvas.resetView")} (R)`,tooltip:`${n("unifiedCanvas.resetView")} (R)`,icon:i.jsx(PI,{}),onClick:r})}function Kce(){const e=q(jr),t=hi(),n=q(a=>a.system.isProcessing),r=ue(),{t:o}=Ce();nt(["shift+s"],()=>{s()},{enabled:()=>!e,preventDefault:!0},[t,n]);const s=()=>{r(H5())};return i.jsx(Me,{"aria-label":`${o("unifiedCanvas.saveToGallery")} (Shift+S)`,tooltip:`${o("unifiedCanvas.saveToGallery")} (Shift+S)`,icon:i.jsx(Tb,{}),onClick:s,isDisabled:e})}const Xce=Te([xn,jr,pr],(e,t,n)=>{const{isProcessing:r}=n,{tool:o}=e;return{tool:o,isStaging:t,isProcessing:r}},{memoizeOptions:{resultEqualityCheck:Ut}}),Zce=()=>{const e=ue(),{t}=Ce(),{tool:n,isStaging:r}=q(Xce);nt(["b"],()=>{o()},{enabled:()=>!r,preventDefault:!0},[]),nt(["e"],()=>{s()},{enabled:()=>!r,preventDefault:!0},[n]),nt(["c"],()=>{a()},{enabled:()=>!r,preventDefault:!0},[n]),nt(["shift+f"],()=>{l()},{enabled:()=>!r,preventDefault:!0}),nt(["delete","backspace"],()=>{u()},{enabled:()=>!r,preventDefault:!0});const o=()=>e(Ba("brush")),s=()=>e(Ba("eraser")),a=()=>e(Ba("colorPicker")),l=()=>e($5()),u=()=>e(L5());return i.jsxs(K,{flexDirection:"column",gap:2,children:[i.jsxs(Fr,{children:[i.jsx(Me,{"aria-label":`${t("unifiedCanvas.brush")} (B)`,tooltip:`${t("unifiedCanvas.brush")} (B)`,icon:i.jsx(TI,{}),isChecked:n==="brush"&&!r,onClick:o,isDisabled:r}),i.jsx(Me,{"aria-label":`${t("unifiedCanvas.eraser")} (E)`,tooltip:`${t("unifiedCanvas.eraser")} (B)`,icon:i.jsx(jI,{}),isChecked:n==="eraser"&&!r,isDisabled:r,onClick:s})]}),i.jsxs(Fr,{children:[i.jsx(Me,{"aria-label":`${t("unifiedCanvas.fillBoundingBox")} (Shift+F)`,tooltip:`${t("unifiedCanvas.fillBoundingBox")} (Shift+F)`,icon:i.jsx(EI,{}),isDisabled:r,onClick:l}),i.jsx(Me,{"aria-label":`${t("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,tooltip:`${t("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`,icon:i.jsx(Wf,{style:{transform:"rotate(45deg)"}}),isDisabled:r,onClick:u})]}),i.jsx(Me,{"aria-label":`${t("unifiedCanvas.colorPicker")} (C)`,tooltip:`${t("unifiedCanvas.colorPicker")} (C)`,icon:i.jsx(II,{}),isChecked:n==="colorPicker"&&!r,isDisabled:r,onClick:a,width:"max-content"})]})},Qce=()=>i.jsxs(K,{flexDirection:"column",rowGap:2,width:"min-content",children:[i.jsx(Vce,{}),i.jsx(Zce,{}),i.jsxs(K,{gap:2,children:[i.jsx(Uce,{}),i.jsx(Yce,{})]}),i.jsxs(K,{columnGap:2,children:[i.jsx(Wce,{}),i.jsx(Kce,{})]}),i.jsxs(K,{columnGap:2,children:[i.jsx(Lce,{}),i.jsx(Bce,{})]}),i.jsxs(K,{gap:2,children:[i.jsx(eR,{}),i.jsx(Q8,{})]}),i.jsxs(K,{gap:2,children:[i.jsx(Fce,{}),i.jsx(qce,{})]}),i.jsx($ce,{}),i.jsx(Gce,{})]});function Jce(){const e=ue(),t=q(o=>o.canvas.brushSize),{t:n}=Ce(),r=q(jr);return nt(["BracketLeft"],()=>{e(eu(Math.max(t-5,5)))},{enabled:()=>!r,preventDefault:!0},[t]),nt(["BracketRight"],()=>{e(eu(Math.min(t+5,500)))},{enabled:()=>!r,preventDefault:!0},[t]),i.jsx(Tt,{label:n("unifiedCanvas.brushSize"),value:t,withInput:!0,onChange:o=>e(eu(o)),sliderNumberInputProps:{max:500},inputReadOnly:!1,isCompact:!0})}const eue=Te([xn,jr],(e,t)=>{const{brushColor:n,maskColor:r,layer:o}=e;return{brushColor:n,maskColor:r,layer:o,isStaging:t}},{memoizeOptions:{resultEqualityCheck:Ut}});function tue(){const e=ue(),{brushColor:t,maskColor:n,layer:r,isStaging:o}=q(eue),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 nt(["shift+BracketLeft"],()=>{e(tu({...t,a:ma(t.a-.05,.05,1)}))},{enabled:()=>!o,preventDefault:!0},[t]),nt(["shift+BracketRight"],()=>{e(tu({...t,a:ma(t.a+.05,.05,1)}))},{enabled:()=>!o,preventDefault:!0},[t]),i.jsx(ii,{triggerComponent:i.jsx(et,{sx:{width:7,height:7,minWidth:7,minHeight:7,borderRadius:"full",bg:s(),cursor:"pointer"}}),children:i.jsxs(K,{minWidth:60,direction:"column",gap:4,width:"100%",children:[r==="base"&&i.jsx(xg,{sx:{width:"100%",paddingTop:2,paddingBottom:2},pickerColor:t,onChange:a=>e(tu(a))}),r==="mask"&&i.jsx(xg,{sx:{width:"100%",paddingTop:2,paddingBottom:2},pickerColor:n,onChange:a=>e(E5(a))})]})})}function tR(){return i.jsxs(K,{columnGap:4,alignItems:"center",children:[i.jsx(Jce,{}),i.jsx(tue,{})]})}function nue(){const e=ue(),t=q(r=>r.canvas.shouldRestrictStrokesToBox),{t:n}=Ce();return i.jsx(qn,{label:n("unifiedCanvas.betaLimitToBox"),isChecked:t,onChange:r=>e(A5(r.target.checked))})}function rue(){return i.jsxs(K,{gap:4,alignItems:"center",children:[i.jsx(tR,{}),i.jsx(nue,{})]})}function oue(){const e=ue(),{t}=Ce(),n=()=>e(Ex());return i.jsx(fn,{size:"sm",leftIcon:i.jsx(Ls,{}),onClick:n,tooltip:`${t("unifiedCanvas.clearMask")} (Shift+C)`,children:t("unifiedCanvas.betaClear")})}function sue(){const e=q(o=>o.canvas.isMaskEnabled),t=ue(),{t:n}=Ce(),r=()=>t(Of(!e));return i.jsx(qn,{label:`${n("unifiedCanvas.enableMask")} (H)`,isChecked:e,onChange:r})}function aue(){const e=ue(),{t}=Ce(),n=q(r=>r.canvas.shouldPreserveMaskedArea);return i.jsx(qn,{label:t("unifiedCanvas.betaPreserveMasked"),isChecked:n,onChange:r=>e(I5(r.target.checked))})}function iue(){return i.jsxs(K,{gap:4,alignItems:"center",children:[i.jsx(tR,{}),i.jsx(sue,{}),i.jsx(aue,{}),i.jsx(oue,{})]})}function lue(){const e=q(r=>r.canvas.shouldDarkenOutsideBoundingBox),t=ue(),{t:n}=Ce();return i.jsx(qn,{label:n("unifiedCanvas.betaDarkenOutside"),isChecked:e,onChange:r=>t(R5(r.target.checked))})}function cue(){const e=q(r=>r.canvas.shouldShowGrid),t=ue(),{t:n}=Ce();return i.jsx(qn,{label:n("unifiedCanvas.showGrid"),isChecked:e,onChange:r=>t(T5(r.target.checked))})}function uue(){const e=q(o=>o.canvas.shouldSnapToGrid),t=ue(),{t:n}=Ce(),r=o=>t(Zh(o.target.checked));return i.jsx(qn,{label:`${n("unifiedCanvas.snapToGrid")} (N)`,isChecked:e,onChange:r})}function due(){return i.jsxs(K,{alignItems:"center",gap:4,children:[i.jsx(cue,{}),i.jsx(uue,{}),i.jsx(lue,{})]})}const fue=Te([xn],e=>{const{tool:t,layer:n}=e;return{tool:t,layer:n}},{memoizeOptions:{resultEqualityCheck:Ut}});function pue(){const{tool:e,layer:t}=q(fue);return i.jsxs(K,{height:8,minHeight:8,maxHeight:8,alignItems:"center",children:[t=="base"&&["brush","eraser","colorPicker"].includes(e)&&i.jsx(rue,{}),t=="mask"&&["brush","eraser","colorPicker"].includes(e)&&i.jsx(iue,{}),e=="move"&&i.jsx(due,{})]})}const hue=Te([xn,po],(e,t)=>{const{doesCanvasNeedScaling:n}=e,{shouldUseCanvasBetaLayout:r}=t;return{doesCanvasNeedScaling:n,shouldUseCanvasBetaLayout:r}},zn),mue=()=>{const e=ue(),{doesCanvasNeedScaling:t,shouldUseCanvasBetaLayout:n}=q(hue),r=h.useCallback(l=>{e(bx(l))},[e]),{isOver:o,setNodeRef:s,active:a}=Cg({id:"unifiedCanvas",data:{handleDrop:r}});return h.useLayoutEffect(()=>{const l=()=>{e(Bs())};return window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)},[e]),n?i.jsx(et,{layerStyle:"first",ref:s,tabIndex:0,sx:{w:"full",h:"full",p:4,borderRadius:"base"},children:i.jsxs(K,{sx:{w:"full",h:"full",gap:4},children:[i.jsx(Qce,{}),i.jsxs(K,{sx:{flexDir:"column",w:"full",h:"full",gap:4,position:"relative"},children:[i.jsx(pue,{}),i.jsxs(et,{sx:{w:"full",h:"full",position:"relative"},children:[t?i.jsx($3,{}):i.jsx(z3,{}),a&&i.jsx(Su,{isOver:o})]})]})]})}):i.jsx(et,{ref:s,tabIndex:-1,sx:{layerStyle:"first",w:"full",h:"full",p:4,borderRadius:"base"},children:i.jsxs(K,{sx:{flexDirection:"column",alignItems:"center",gap:4,w:"full",h:"full"},children:[i.jsx(Nce,{}),i.jsx(K,{sx:{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:4,w:"full",h:"full"},children:i.jsxs(et,{sx:{w:"full",h:"full",position:"relative"},children:[t?i.jsx($3,{}):i.jsx(z3,{}),a&&i.jsx(Su,{isOver:o})]})})]})})},gue=h.memo(mue),vue=Te([$o,pr],(e,t)=>{const{infillMethod:n}=e,{infillMethods:r}=t;return{infillMethod:n,infillMethods:r}},zn),yue=()=>{const e=ue(),{infillMethod:t,infillMethods:n}=q(vue),{t:r}=Ce(),o=h.useCallback(s=>{e(v9(s))},[e]);return i.jsx(Zo,{label:r("parameters.infillMethod"),value:t,data:n,onChange:o})},xue=h.memo(yue),bue=Te([$o],e=>{const{tileSize:t,infillMethod:n}=e;return{tileSize:t,infillMethod:n}},zn),wue=()=>{const e=ue(),{tileSize:t,infillMethod:n}=q(bue),{t:r}=Ce(),o=h.useCallback(a=>{e(IS(a))},[e]),s=h.useCallback(()=>{e(IS(32))},[e]);return i.jsx(Tt,{isDisabled:n!=="tile",label:r("parameters.tileSize"),min:16,max:64,sliderNumberInputProps:{max:256},value:t,onChange:o,withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:s})},Sue=h.memo(wue),Cue=Te([xn],e=>{const{boundingBoxScaleMethod:t}=e;return{boundingBoxScale:t}},zn),_ue=()=>{const e=ue(),{boundingBoxScale:t}=q(Cue),{t:n}=Ce(),r=o=>{e(x9(o))};return i.jsx(Zo,{label:n("parameters.scaleBeforeProcessing"),data:y9,value:t,onChange:r})},kue=h.memo(_ue),Pue=Te([xn],e=>{const{boundingBoxScaleMethod:t,scaledBoundingBoxDimensions:n}=e;return{scaledBoundingBoxDimensions:n,isManual:t==="manual"}},zn),jue=()=>{const e=ue(),{isManual:t,scaledBoundingBoxDimensions:n}=q(Pue),{t:r}=Ce(),o=a=>{e(Jh({...n,width:Math.floor(a)}))},s=()=>{e(Jh({...n,width:Math.floor(512)}))};return i.jsx(Tt,{isDisabled:!t,label:r("parameters.scaledWidth"),min:64,max:1024,step:64,value:n.width,onChange:o,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:s})},Iue=h.memo(jue),Eue=Te([$o,pr,xn],(e,t,n)=>{const{scaledBoundingBoxDimensions:r,boundingBoxScaleMethod:o}=n;return{scaledBoundingBoxDimensions:r,isManual:o==="manual"}},zn),Oue=()=>{const e=ue(),{isManual:t,scaledBoundingBoxDimensions:n}=q(Eue),{t:r}=Ce(),o=a=>{e(Jh({...n,height:Math.floor(a)}))},s=()=>{e(Jh({...n,height:Math.floor(512)}))};return i.jsx(Tt,{isDisabled:!t,label:r("parameters.scaledHeight"),min:64,max:1024,step:64,value:n.height,onChange:o,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:s})},Tue=h.memo(Oue),Rue=()=>{const{t:e}=Ce(),{isOpen:t,onToggle:n}=us();return i.jsx(Vs,{label:e("parameters.infillScalingHeader"),isOpen:t,onToggle:n,children:i.jsxs(K,{sx:{gap:2,flexDirection:"column"},children:[i.jsx(xue,{}),i.jsx(Sue,{}),i.jsx(kue,{}),i.jsx(Iue,{}),i.jsx(Tue,{})]})})},Mue=h.memo(Rue);function Due(){const e=ue(),t=q(r=>r.generation.seamBlur),{t:n}=Ce();return i.jsx(Tt,{label:n("parameters.seamBlur"),min:0,max:64,sliderNumberInputProps:{max:512},value:t,onChange:r=>{e(ES(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(ES(16))}})}function Aue(){const e=ue(),{t}=Ce(),n=q(r=>r.generation.seamSize);return i.jsx(Tt,{label:t("parameters.seamSize"),min:1,max:256,sliderNumberInputProps:{max:512},value:n,onChange:r=>{e(OS(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>e(OS(96))})}function Nue(){const{t:e}=Ce(),t=q(r=>r.generation.seamSteps),n=ue();return i.jsx(Tt,{label:e("parameters.seamSteps"),min:1,max:100,sliderNumberInputProps:{max:999},value:t,onChange:r=>{n(TS(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{n(TS(30))}})}function zue(){const e=ue(),{t}=Ce(),n=q(r=>r.generation.seamStrength);return i.jsx(Tt,{label:t("parameters.seamStrength"),min:.01,max:.99,step:.01,value:n,onChange:r=>{e(RS(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(RS(.7))}})}const $ue=()=>{const{t:e}=Ce(),{isOpen:t,onToggle:n}=us();return i.jsxs(Vs,{label:e("parameters.seamCorrectionHeader"),isOpen:t,onToggle:n,children:[i.jsx(Aue,{}),i.jsx(Due,{}),i.jsx(zue,{}),i.jsx(Nue,{})]})},Lue=h.memo($ue),Bue=Te([$o,Ef,Qa],(e,t,n)=>{const{initial:r,min:o,sliderMax:s,inputMax:a,fineStep:l,coarseStep:u}=n.sd.img2imgStrength,{img2imgStrength:f}=e,p=t.shift?l:u;return{img2imgStrength:f,initial:r,min:o,sliderMax:s,inputMax:a,step:p}},zn),Fue=()=>{const{img2imgStrength:e,initial:t,min:n,sliderMax:r,inputMax:o,step:s}=q(Bue),a=ue(),{t:l}=Ce(),u=h.useCallback(p=>a(Gh(p)),[a]),f=h.useCallback(()=>{a(Gh(t))},[a,t]);return i.jsx(Tt,{label:`${l("parameters.denoisingStrength")}`,step:s,min:n,max:r,onChange:u,handleReset:f,value:e,isInteger:!1,withInput:!0,withSliderMarks:!0,withReset:!0,sliderNumberInputProps:{max:o}})},nR=h.memo(Fue),Hue=Te([xn,jr],(e,t)=>{const{boundingBoxDimensions:n}=e;return{boundingBoxDimensions:n,isStaging:t}},zn),Vue=()=>{const e=ue(),{boundingBoxDimensions:t,isStaging:n}=q(Hue),{t:r}=Ce(),o=a=>{e(Vd({...t,width:Math.floor(a)}))},s=()=>{e(Vd({...t,width:Math.floor(512)}))};return i.jsx(Tt,{label:r("parameters.boundingBoxWidth"),min:64,max:1024,step:64,value:t.width,onChange:o,isDisabled:n,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:s})},H3=h.memo(Vue),Wue=Te([xn,jr],(e,t)=>{const{boundingBoxDimensions:n}=e;return{boundingBoxDimensions:n,isStaging:t}},zn),Uue=()=>{const e=ue(),{boundingBoxDimensions:t,isStaging:n}=q(Wue),{t:r}=Ce(),o=a=>{e(Vd({...t,height:Math.floor(a)}))},s=()=>{e(Vd({...t,height:Math.floor(512)}))};return i.jsx(Tt,{label:r("parameters.boundingBoxHeight"),min:64,max:1024,step:64,value:t.height,onChange:o,isDisabled:n,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:s})},V3=h.memo(Uue),Gue=Te(po,e=>{const{shouldUseSliders:t}=e;return{shouldUseSliders:t}},zn),que=()=>{const{shouldUseSliders:e}=q(Gue),{isOpen:t,onToggle:n}=us({defaultIsOpen:!0});return i.jsx(Vs,{label:"General",isOpen:t,onToggle:n,children:i.jsxs(K,{sx:{flexDirection:"column",gap:3},children:[e?i.jsxs(i.Fragment,{children:[i.jsx(Tu,{}),i.jsx(et,{pt:2,children:i.jsx(Ru,{})}),i.jsx(Iu,{}),i.jsx(Eu,{}),i.jsx(Ou,{}),i.jsx(H3,{}),i.jsx(V3,{})]}):i.jsxs(i.Fragment,{children:[i.jsxs(K,{gap:3,children:[i.jsx(Iu,{}),i.jsx(Eu,{}),i.jsx(Ou,{})]}),i.jsx(Tu,{}),i.jsx(et,{pt:2,children:i.jsx(Ru,{})}),i.jsx(H3,{}),i.jsx(V3,{})]}),i.jsx(nR,{})]})})},Yue=h.memo(que),Kue=()=>i.jsxs(i.Fragment,{children:[i.jsx(g2,{}),i.jsx(v2,{}),i.jsx(m2,{}),i.jsx(Yue,{}),i.jsx(w2,{}),i.jsx(b2,{}),i.jsx(y2,{}),i.jsx(x2,{}),i.jsx(Lue,{}),i.jsx(Mue,{})]}),rR=h.memo(Kue),Xue=()=>i.jsxs(K,{sx:{gap:4,w:"full",h:"full"},children:[i.jsx(h2,{children:i.jsx(rR,{})}),i.jsx(gue,{})]}),Zue=h.memo(Xue);const Que={position:"absolute",width:"1rem",height:"1rem",borderWidth:0},Jue={left:"-1rem"},ede={right:"-0.5rem"},tde=e=>{const{field:t,isValidConnection:n,handleType:r,styles:o}=e,{name:s,type:a}=t;return i.jsx(er,{label:a,placement:r==="target"?"start":"end",hasArrow:!0,openDelay:q5,children:i.jsx(b9,{type:r,id:s,isValidConnection:n,position:r==="target"?MS.Left:MS.Right,style:{backgroundColor:Y5[a].colorCssVar,...o,...Que,...r==="target"?Jue:ede}})})},oR=h.memo(tde),sR=()=>{const e=Ox();return h.useCallback(({source:n,sourceHandle:r,target:o,targetHandle:s})=>(e.getEdges(),e.getNodes(),!0),[e])};function nde(e){const{nodeId:t,output:n,template:r,connected:o}=e,s=sR();return i.jsx(et,{position:"relative",children:i.jsx(_n,{isDisabled:r?o:!0,paddingRight:3,children:r?i.jsxs(i.Fragment,{children:[i.jsx(jn,{textAlign:"end",padding:1,children:r==null?void 0:r.title}),i.jsx(oR,{nodeId:t,field:r,isValidConnection:s,handleType:"source"},n.id)]}):i.jsx(aa,{justifyContent:"space-between",alignItems:"center",children:i.jsxs(jn,{color:"error.400",children:["Unknown Output: ",n.name]})})})})}const rde=e=>{const{nodeId:t,template:n,outputs:r}=e,o=q(a=>a.nodes.edges);return h.useCallback(()=>{const a=[];return qa(r).forEach(u=>{const f=n.outputs[u.name],p=!!o.filter(m=>m.source===t&&m.sourceHandle===u.name).length;a.push(i.jsx(nde,{nodeId:t,output:u,template:f,connected:p},u.id))}),i.jsx(K,{flexDir:"column",children:a})},[o,t,r,n.outputs])()},ode=h.memo(rde),sde=e=>i.jsx(rU,{}),ade=h.memo(sde),ide=e=>{const{nodeId:t,field:n}=e,r=ue(),o=s=>{r(el({nodeId:t,fieldName:n.name,value:s.target.checked}))};return i.jsx(Kg,{onChange:o,isChecked:n.value})},lde=h.memo(ide),cde=e=>{const{nodeId:t,field:n,template:r}=e,o=ue(),s=a=>{o(el({nodeId:t,fieldName:n.name,value:a.target.value}))};return i.jsx(ub,{onChange:s,value:n.value,children:r.options.map(a=>i.jsx("option",{children:a},a))})},ude=h.memo(cde),dde=e=>{var p;const{nodeId:t,field:n}=e,r=ue(),{currentData:o,isLoading:s,isError:a,isSuccess:l}=lc(((p=n.value)==null?void 0:p.image_name)??cc.skipToken),u=h.useCallback(({image_name:m})=>{var v;((v=n.value)==null?void 0:v.image_name)!==m&&r(el({nodeId:t,fieldName:n.name,value:{image_name:m}}))},[r,n.name,n.value,t]),f=h.useCallback(()=>{r(el({nodeId:t,fieldName:n.name,value:void 0}))},[r,n.name,t]);return i.jsx(K,{sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center"},children:i.jsx(Sf,{image:o,onDrop:u,onReset:f,resetIconSize:"sm",postUploadAction:{type:"SET_NODES_IMAGE",nodeId:t,fieldName:n.name}})})},fde=h.memo(dde),pde=e=>null,hde=h.memo(pde),mde=e=>null,gde=h.memo(mde),vde=e=>null,yde=h.memo(vde),xde=e=>null,bde=h.memo(xde),wde=e=>null,Sde=h.memo(wde),Cde=e=>null,_de=h.memo(Cde),kde=e=>{const{nodeId:t,field:n}=e,r=ue();Ce();const{data:o}=Al({model_type:"main"}),s=h.useMemo(()=>{if(!o)return[];const u=[];return _x(o.entities,(f,p)=>{f&&u.push({value:p,label:f.name,group:ux[f.base_model]})}),u},[o]),a=h.useMemo(()=>o==null?void 0:o.entities[n.value??o.ids[0]],[o==null?void 0:o.entities,o==null?void 0:o.ids,n.value]),l=h.useCallback(u=>{u&&r(el({nodeId:t,fieldName:n.name,value:u}))},[r,n.name,t]);return h.useEffect(()=>{if(n.value&&(o!=null&&o.ids.includes(n.value)))return;const u=o==null?void 0:o.ids[0];Ix(u)&&l(u)},[n.value,l,o==null?void 0:o.ids]),i.jsx(Zo,{tooltip:a==null?void 0:a.description,label:(a==null?void 0:a.base_model)&&ux[a==null?void 0:a.base_model],value:n.value,placeholder:"Pick one",data:s,onChange:l})},Pde=h.memo(kde),jde=e=>{const{nodeId:t,field:n}=e,r=ue(),o=(s,a)=>{r(el({nodeId:t,fieldName:n.name,value:a}))};return i.jsxs(Lg,{onChange:o,value:n.value,step:e.template.type==="integer"?1:.1,precision:e.template.type==="integer"?0:3,children:[i.jsx(Fg,{}),i.jsxs(Bg,{children:[i.jsx(Vg,{}),i.jsx(Hg,{})]})]})},Ide=h.memo(jde),Ede=e=>{const{nodeId:t,field:n}=e,r=ue(),o=s=>{r(el({nodeId:t,fieldName:n.name,value:s.target.value}))};return i.jsx(Df,{onChange:o,value:n.value})},Ode=h.memo(Ede),Tde=e=>{const{nodeId:t,field:n}=e,r=ue(),o=s=>{r(el({nodeId:t,fieldName:n.name,value:s}))};return i.jsx(Z8,{className:"nodrag",color:n.value,onChange:o})},Rde=h.memo(Tde),Mde=e=>i.jsx(LW,{}),W3=h.memo(Mde),Dde=e=>{const{nodeId:t,field:n,template:r}=e,{type:o}=n;return o==="string"&&r.type==="string"?i.jsx(Ode,{nodeId:t,field:n,template:r}):o==="boolean"&&r.type==="boolean"?i.jsx(lde,{nodeId:t,field:n,template:r}):o==="integer"&&r.type==="integer"||o==="float"&&r.type==="float"?i.jsx(Ide,{nodeId:t,field:n,template:r}):o==="enum"&&r.type==="enum"?i.jsx(ude,{nodeId:t,field:n,template:r}):o==="image"&&r.type==="image"?i.jsx(fde,{nodeId:t,field:n,template:r}):o==="latents"&&r.type==="latents"?i.jsx(hde,{nodeId:t,field:n,template:r}):o==="conditioning"&&r.type==="conditioning"?i.jsx(gde,{nodeId:t,field:n,template:r}):o==="unet"&&r.type==="unet"?i.jsx(yde,{nodeId:t,field:n,template:r}):o==="clip"&&r.type==="clip"?i.jsx(bde,{nodeId:t,field:n,template:r}):o==="vae"&&r.type==="vae"?i.jsx(Sde,{nodeId:t,field:n,template:r}):o==="control"&&r.type==="control"?i.jsx(_de,{nodeId:t,field:n,template:r}):o==="model"&&r.type==="model"?i.jsx(Pde,{nodeId:t,field:n,template:r}):o==="array"&&r.type==="array"?i.jsx(ade,{nodeId:t,field:n,template:r}):o==="item"&&r.type==="item"?i.jsx(W3,{nodeId:t,field:n,template:r}):o==="color"&&r.type==="color"?i.jsx(Rde,{nodeId:t,field:n,template:r}):o==="item"&&r.type==="item"?i.jsx(W3,{nodeId:t,field:n,template:r}):i.jsxs(et,{p:2,children:["Unknown field type: ",o]})},Ade=h.memo(Dde);function Nde(e){const{nodeId:t,input:n,template:r,connected:o}=e,s=sR();return i.jsx(et,{position:"relative",borderColor:r?!o&&["always","connectionOnly"].includes(String(r==null?void 0:r.inputRequirement))&&n.value===void 0?"warning.400":void 0:"error.400",children:i.jsx(_n,{isDisabled:r?o:!0,pl:2,children:r?i.jsxs(i.Fragment,{children:[i.jsxs(aa,{justifyContent:"space-between",alignItems:"center",children:[i.jsx(aa,{children:i.jsx(er,{label:r==null?void 0:r.description,placement:"top",hasArrow:!0,shouldWrapChildren:!0,openDelay:q5,children:i.jsx(jn,{children:r==null?void 0:r.title})})}),i.jsx(Ade,{nodeId:t,field:n,template:r})]}),!["never","directOnly"].includes((r==null?void 0:r.inputRequirement)??"")&&i.jsx(oR,{nodeId:t,field:r,isValidConnection:s,handleType:"target"})]}):i.jsx(aa,{justifyContent:"space-between",alignItems:"center",children:i.jsxs(jn,{children:["Unknown input: ",n.name]})})})})}const zde=e=>{const{nodeId:t,template:n,inputs:r}=e,o=q(a=>a.nodes.edges);return h.useCallback(()=>{const a=[],l=qa(r);return l.forEach((u,f)=>{const p=n.inputs[u.name],m=!!o.filter(v=>v.target===t&&v.targetHandle===u.name).length;f<l.length&&a.push(i.jsx(Fu,{},`${u.id}.divider`)),a.push(i.jsx(Nde,{nodeId:t,input:u,template:p,connected:m},u.id))}),i.jsx(K,{flexDir:"column",gap:2,p:2,children:a})},[o,r,t,n.inputs])()},$de=h.memo(zde),Lde=e=>{const{nodeId:t,template:n}=e;return i.jsxs(K,{sx:{borderTopRadius:"md",alignItems:"center",justifyContent:"space-between",px:2,py:1,bg:"base.300",_dark:{bg:"base.700"}},children:[i.jsx(er,{label:t,children:i.jsx(ta,{size:"xs",sx:{fontWeight:600,color:"base.900",_dark:{color:"base.100"}},children:n.title})}),i.jsx(er,{label:n.description,placement:"top",hasArrow:!0,shouldWrapChildren:!0,children:i.jsx(uo,{sx:{h:"min-content",color:"base.700",_dark:{color:"base.300"}},as:tU})})]})},Bde=h.memo(Lde),Fde=e=>{const{...t}=e;return i.jsx(KF,{style:{position:"absolute",border:"none",background:"transparent",width:15,height:15,bottom:0,right:0},minWidth:K5,...t})},U3=h.memo(Fde),G3=e=>{const[t,n]=hc("shadows",["nodeSelectedOutline","dark-lg"]);return i.jsx(et,{sx:{position:"relative",borderRadius:"md",minWidth:K5,boxShadow:e.selected?`${t}, ${n}`:`${n}`},children:e.children})},Hde=e=>Te([t=>t.nodes],t=>{const n=t.invocationTemplates[e];if(n)return n},{memoizeOptions:{resultEqualityCheck:(t,n)=>t!==void 0&&n!==void 0&&t.type===n.type}}),aR=h.memo(e=>{const{id:t,data:n,selected:r}=e,{type:o,inputs:s,outputs:a}=n,l=h.useMemo(()=>Hde(o),[o]),u=q(l);return u?i.jsxs(G3,{selected:r,children:[i.jsx(Bde,{nodeId:t,template:u}),i.jsxs(K,{sx:{flexDirection:"column",borderBottomRadius:"md",py:2,bg:"base.200",_dark:{bg:"base.800"}},children:[i.jsx(ode,{nodeId:t,outputs:a,template:u}),i.jsx($de,{nodeId:t,inputs:s,template:u})]}),i.jsx(U3,{})]}):i.jsx(G3,{selected:r,children:i.jsxs(K,{sx:{alignItems:"center",justifyContent:"center"},children:[i.jsx(uo,{as:qW,sx:{boxSize:32,color:"base.600",_dark:{color:"base.400"}}}),i.jsx(U3,{})]})})});aR.displayName="InvocationComponent";const Vde=(e,t)=>{const n={id:e,name:t.name,type:t.type};return t.inputRequirement!=="never"&&(t.type==="string"&&(n.value=t.default??""),t.type==="integer"&&(n.value=t.default??0),t.type==="float"&&(n.value=t.default??0),t.type==="boolean"&&(n.value=t.default??!1),t.type==="enum"&&(t.enumType==="number"&&(n.value=t.default??0),t.enumType==="string"&&(n.value=t.default??"")),t.type==="array"&&(n.value=t.default??1),t.type==="image"&&(n.value=void 0),t.type==="latents"&&(n.value=void 0),t.type==="conditioning"&&(n.value=void 0),t.type==="unet"&&(n.value=void 0),t.type==="clip"&&(n.value=void 0),t.type==="vae"&&(n.value=void 0),t.type==="control"&&(n.value=void 0),t.type==="model"&&(n.value=void 0)),n},Wde=Te([e=>e.nodes],e=>e.invocationTemplates),Ude=()=>{const e=q(Wde),t=Ox();return h.useCallback(n=>{const r=e[n];if(r===void 0){console.error(`Unable to find template ${n}.`);return}const o=Fl(),s=DS(r.inputs,(p,m,v)=>{const y=Fl(),S=Vde(y,m);return p[v]=S,p},{}),a=DS(r.outputs,(p,m,v)=>{const S={id:Fl(),name:v,type:m.type};return p[v]=S,p},{}),{x:l,y:u}=t.project({x:window.innerWidth/2.5,y:window.innerHeight/8});return{id:o,type:"invocation",position:{x:l,y:u},data:{id:o,type:n,inputs:s,outputs:a}}},[e,t])},Gde=Te(w9,e=>({data:qa(e.invocationTemplates,n=>({label:n.title,value:n.type,description:n.description}))}),zn),qde=()=>{const e=ue(),{data:t}=q(Gde),n=Ude(),r=jf(),o=h.useCallback(s=>{const a=n(s);if(!a){r({status:"error",title:`Unknown Invocation type ${s}`});return}e(S9(a))},[e,n,r]);return i.jsx(K,{sx:{gap:2,alignItems:"center"},children:i.jsx(f8,{selectOnBlur:!1,placeholder:"Add Node",value:[],data:t,maxDropdownHeight:400,nothingFound:"No matching nodes",itemComponent:iR,filter:(s,a,l)=>l.label.toLowerCase().includes(s.toLowerCase().trim())||l.value.toLowerCase().includes(s.toLowerCase().trim())||l.description.toLowerCase().includes(s.toLowerCase().trim()),onChange:s=>{s[0]&&o(s[0])},sx:{width:"18rem"}})})},iR=h.forwardRef(({label:e,description:t,...n},r)=>i.jsx("div",{ref:r,...n,children:i.jsxs("div",{children:[i.jsx(lt,{children:e}),i.jsx(lt,{size:"xs",color:"base.600",children:t})]})}));iR.displayName="SelectItem";const Yde=()=>i.jsx(Pf,{position:"top-left",children:i.jsx(qde,{})}),Kde=h.memo(Yde),Xde=()=>i.jsx(K,{sx:{gap:2,flexDir:"column"},children:qa(Y5,({title:e,description:t,color:n},r)=>i.jsx(er,{label:t,children:i.jsx(mu,{colorScheme:n,sx:{userSelect:"none"},textAlign:"center",children:e})},r))}),Zde=h.memo(Xde),Qde=()=>{const e=q(n=>n),t=C9(e);return i.jsx(et,{as:"pre",sx:{fontFamily:"monospace",position:"absolute",top:2,right:2,opacity:.7,p:2,maxHeight:500,maxWidth:500,overflowY:"scroll",borderRadius:"base",bg:"base.200",_dark:{bg:"base.800"}},children:JSON.stringify(t,null,2)})},Jde=h.memo(Qde),efe=()=>{const e=q(t=>t.nodes.shouldShowGraphOverlay);return i.jsxs(Pf,{position:"top-right",children:[i.jsx(Zde,{}),e&&i.jsx(Jde,{})]})},tfe=h.memo(efe);function nfe(e){const{iconButton:t=!1,...n}=e,r=ue(),o=q(Gr),s=ho(),a=h.useCallback(()=>{r(Px("nodes"))},[r]),{t:l}=Ce();return nt(["ctrl+enter","meta+enter"],a,{enabled:()=>s,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[s,o]),i.jsx(et,{style:{flexGrow:4},position:"relative",children:i.jsxs(et,{style:{position:"relative"},children:[!s&&i.jsx(et,{style:{position:"absolute",bottom:"0",left:"0",right:"0",height:"100%",overflow:"clip",borderRadius:4},children:i.jsx(p8,{})}),t?i.jsx(Me,{"aria-label":l("parameters.invoke"),type:"submit",icon:i.jsx(RI,{}),isDisabled:!s,onClick:a,flexGrow:1,w:"100%",tooltip:l("parameters.invoke"),tooltipProps:{placement:"bottom"},colorScheme:"accent",id:"invoke-button",...n}):i.jsx(fn,{"aria-label":l("parameters.invoke"),type:"submit",isDisabled:!s,onClick:a,flexGrow:1,w:"100%",colorScheme:"accent",id:"invoke-button",fontWeight:700,...n,children:"Invoke"})]})})}const rfe=()=>{const e=ue(),t=h.useCallback(()=>{e(_9())},[e]);return i.jsx(Pf,{position:"top-center",children:i.jsxs(aa,{children:[i.jsx(nfe,{}),i.jsx(fn,{onClick:t,children:"Reload Schema"})]})})},ofe=h.memo(rfe),sfe=()=>{const{zoomIn:e,zoomOut:t,fitView:n}=Ox(),r=ue(),o=q(f=>f.nodes.shouldShowGraphOverlay),s=h.useCallback(()=>{e()},[e]),a=h.useCallback(()=>{t()},[t]),l=h.useCallback(()=>{n()},[n]),u=h.useCallback(()=>{r(k9(!o))},[o,r]);return i.jsxs(Fr,{isAttached:!0,orientation:"vertical",children:[i.jsx(Me,{onClick:s,"aria-label":"Zoom In",icon:i.jsx(Wf,{})}),i.jsx(Me,{onClick:a,"aria-label":"Zoom Out",icon:i.jsx(sU,{})}),i.jsx(Me,{onClick:l,"aria-label":"Fit to Viewport",icon:i.jsx(Ob,{})}),i.jsx(Me,{isChecked:o,onClick:u,"aria-label":"Show/Hide Graph",icon:i.jsx(kI,{})})]})},afe=h.memo(sfe),ife=()=>i.jsx(Pf,{position:"bottom-left",children:i.jsx(afe,{})}),lfe=h.memo(ife),cfe=()=>{const e=B0({background:"var(--invokeai-colors-base-200)"},{background:"var(--invokeai-colors-base-500)"}),t=B0("var(--invokeai-colors-accent-300)","var(--invokeai-colors-accent-700)"),n=B0("var(--invokeai-colors-blackAlpha-300)","var(--invokeai-colors-blackAlpha-600)");return i.jsx(LF,{nodeStrokeWidth:3,pannable:!0,zoomable:!0,nodeBorderRadius:30,style:e,nodeColor:t,maskColor:n})},ufe=h.memo(cfe),dfe={invocation:aR},ffe=()=>{const e=ue(),t=q(u=>u.nodes.nodes),n=q(u=>u.nodes.edges),r=h.useCallback(u=>{e(P9(u))},[e]),o=h.useCallback(u=>{e(j9(u))},[e]),s=h.useCallback((u,f)=>{e(I9(f))},[e]),a=h.useCallback(u=>{e(E9(u))},[e]),l=h.useCallback(()=>{e(O9())},[e]);return i.jsxs(T9,{nodeTypes:dfe,nodes:t,edges:n,onNodesChange:r,onEdgesChange:o,onConnectStart:s,onConnect:a,onConnectEnd:l,defaultEdgeOptions:{style:{strokeWidth:2}},children:[i.jsx(Kde,{}),i.jsx(ofe,{}),i.jsx(tfe,{}),i.jsx(lfe,{}),i.jsx(UF,{}),i.jsx(ufe,{})]})},pfe=()=>i.jsx(et,{layerStyle:"first",sx:{position:"relative",width:"full",height:"full",borderRadius:"base"},children:i.jsx(R9,{children:i.jsx(ffe,{})})}),hfe=h.memo(pfe),mfe=()=>i.jsx(hfe,{}),gfe=h.memo(mfe),vfe=e=>{const{direction:t="horizontal",...n}=e,{colorMode:r}=fo();return t==="horizontal"?i.jsx(cx,{children:i.jsx(K,{sx:{w:6,h:"full",justifyContent:"center",alignItems:"center"},...n,children:i.jsx(et,{sx:{w:.5,h:"calc(100% - 4px)",bg:Ae("base.100","base.850")(r)}})})}):i.jsx(cx,{children:i.jsx(K,{sx:{w:"full",h:6,justifyContent:"center",alignItems:"center"},...n,children:i.jsx(et,{sx:{w:"calc(100% - 4px)",h:.5,bg:Ae("base.100","base.850")(r)}})})})},lR=h.memo(vfe),yfe=Te([$o],e=>{const{initialImage:t}=e;return{initialImage:t}},zn),xfe=()=>{const{initialImage:e}=q(yfe),t=ue(),{openUploader:n}=Qg(),{currentData:r,isLoading:o,isError:s,isSuccess:a}=lc((e==null?void 0:e.imageName)??cc.skipToken),{getUploadButtonProps:l,getUploadInputProps:u}=E8({postUploadAction:{type:"SET_INITIAL_IMAGE"}}),f=h.useCallback(v=>{v.image_name!==(e==null?void 0:e.imageName)&&t(M9(v))},[t,e]),p=h.useCallback(()=>{t(D9())},[t]),m=h.useCallback(()=>{n()},[n]);return i.jsxs(K,{sx:{flexDir:"column",width:"full",height:"full",position:"absolute",alignItems:"center",justifyContent:"center",p:4,gap:4},children:[i.jsxs(K,{sx:{w:"full",flexWrap:"wrap",justifyContent:"center",alignItems:"center",gap:2},children:[i.jsx(lt,{sx:{color:"base.200",fontWeight:600,fontSize:"sm",userSelect:"none"},children:"Initial Image"}),i.jsx(ul,{}),i.jsx(Me,{tooltip:"Upload Initial Image","aria-label":"Upload Initial Image",icon:i.jsx(sv,{}),onClick:m,...l()}),i.jsx(Me,{tooltip:"Reset Initial Image","aria-label":"Reset Initial Image",icon:i.jsx(ov,{}),onClick:p,isDisabled:!e})]}),i.jsx(Sf,{image:r,onDrop:f,fallback:i.jsx(mv,{sx:{bg:"none"}}),isUploadDisabled:!0,fitContainer:!0}),i.jsx("input",{...u()})]})},bfe=()=>i.jsx(K,{layerStyle:"first",sx:{position:"relative",flexDirection:"column",height:"100%",width:"100%",rowGap:4,alignItems:"center",justifyContent:"center",p:4,borderRadius:"base"},children:i.jsx(K,{flexDirection:"column",sx:{w:"full",h:"full",alignItems:"center",justifyContent:"center",gap:4},children:i.jsx(xfe,{})})});function wfe(){const e=ue(),t=q(o=>o.generation.shouldFitToWidthHeight),n=o=>e(A9(o.target.checked)),{t:r}=Ce();return i.jsx(Br,{label:r("parameters.imageFit"),isChecked:t,onChange:n})}const Sfe=Te([po,$o],(e,t)=>{const{shouldUseSliders:n}=e,{shouldFitToWidthHeight:r}=t;return{shouldUseSliders:n,shouldFitToWidthHeight:r}},zn),Cfe=()=>{const{shouldUseSliders:e,shouldFitToWidthHeight:t}=q(Sfe),{isOpen:n,onToggle:r}=us({defaultIsOpen:!0});return i.jsx(Vs,{label:"General",isOpen:n,onToggle:r,children:i.jsxs(K,{sx:{flexDirection:"column",gap:3},children:[e?i.jsxs(i.Fragment,{children:[i.jsx(Tu,{}),i.jsx(et,{pt:2,children:i.jsx(Ru,{})}),i.jsx(Iu,{}),i.jsx(Eu,{}),i.jsx(Ou,{}),i.jsx(gg,{isDisabled:!t}),i.jsx(vg,{isDisabled:!t})]}):i.jsxs(i.Fragment,{children:[i.jsxs(K,{gap:3,children:[i.jsx(Iu,{}),i.jsx(Eu,{}),i.jsx(Ou,{})]}),i.jsx(Tu,{}),i.jsx(et,{pt:2,children:i.jsx(Ru,{})}),i.jsx(gg,{isDisabled:!t}),i.jsx(vg,{isDisabled:!t})]}),i.jsx(nR,{}),i.jsx(wfe,{})]})})},_fe=h.memo(Cfe),kfe=()=>i.jsxs(i.Fragment,{children:[i.jsx(g2,{}),i.jsx(v2,{}),i.jsx(m2,{}),i.jsx(_fe,{}),i.jsx(w2,{}),i.jsx(b2,{}),i.jsx(y2,{}),i.jsx(R8,{}),i.jsx(x2,{}),i.jsx(M8,{})]}),cR=h.memo(kfe),Pfe=()=>{const e=ue(),t=h.useRef(null),n=h.useCallback(()=>{t.current&&t.current.setLayout([50,50])},[]);return i.jsxs(K,{sx:{gap:4,w:"full",h:"full"},children:[i.jsx(h2,{children:i.jsx(cR,{})}),i.jsx(et,{sx:{w:"full",h:"full"},children:i.jsxs(p2,{ref:t,autoSaveId:"imageTab.content",direction:"horizontal",style:{height:"100%",width:"100%"},children:[i.jsx(wf,{id:"imageTab.content.initImage",order:0,defaultSize:50,minSize:25,style:{position:"relative"},children:i.jsx(bfe,{})}),i.jsx(lR,{onDoubleClick:n}),i.jsx(wf,{id:"imageTab.content.selectedImage",order:1,defaultSize:50,minSize:25,onResize:()=>{e(Bs())},children:i.jsx(O8,{})})]})})]})},jfe=h.memo(Pfe),Ife=Te(pr,e=>{const{isUploading:t}=e;let n="";return t&&(n="Uploading..."),{tooltip:n,shouldShow:t}}),Efe=()=>{const{shouldShow:e,tooltip:t}=q(Ife);return e?i.jsx(K,{sx:{alignItems:"center",justifyContent:"center",color:"base.600"},children:i.jsx(er,{label:t,placement:"right",hasArrow:!0,children:i.jsx(Du,{})})}):null},Ofe=h.memo(Efe),Tfe=(e,t,n,r="horizontal")=>{const o=h.useRef(null),[s,a]=h.useState(t),l=h.useCallback(()=>{var f,p;const u=(f=o.current)==null?void 0:f.getSize();u!==void 0&&u<s&&((p=o.current)==null||p.resize(s))},[s]);return h.useLayoutEffect(()=>{const u=document.querySelector(`[data-panel-group-id="${n}"]`),f=document.querySelectorAll("[data-panel-resize-handle-id]");if(!u)return;const p=new ResizeObserver(()=>{let m=r==="horizontal"?u.getBoundingClientRect().width:u.getBoundingClientRect().height;f.forEach(v=>{m-=r==="horizontal"?v.getBoundingClientRect().width:v.getBoundingClientRect().height}),a(e/m*100)});return p.observe(u),f.forEach(m=>{p.observe(m)}),window.addEventListener("resize",l),()=>{p.disconnect(),window.removeEventListener("resize",l)}},[n,l,s,e,r]),{ref:o,minSizePct:s}},Rfe=[{id:"txt2img",icon:i.jsx(uo,{as:ZW,sx:{boxSize:6,pointerEvents:"none"}}),content:i.jsx(Sie,{})},{id:"img2img",icon:i.jsx(uo,{as:Vf,sx:{boxSize:6,pointerEvents:"none"}}),content:i.jsx(jfe,{})},{id:"unifiedCanvas",icon:i.jsx(uo,{as:vU,sx:{boxSize:6,pointerEvents:"none"}}),content:i.jsx(Zue,{})},{id:"nodes",icon:i.jsx(uo,{as:gU,sx:{boxSize:6,pointerEvents:"none"}}),content:i.jsx(gfe,{})}],Mfe=Te(Qa,e=>{const{disabledTabs:t}=e;return Rfe.filter(n=>!t.includes(n.id))},{memoizeOptions:{resultEqualityCheck:Ut}}),Dfe=300,W1=20,Afe=()=>{const e=q(N9),t=q(Gr),n=q(Mfe),r=q(x=>x.lightbox.isLightboxOpen),{shouldPinGallery:o,shouldPinParametersPanel:s,shouldShowGallery:a}=q(x=>x.ui),{t:l}=Ce(),u=ue();nt("z",()=>{u(Hd(!r))},[r]),nt("f",()=>{u(z9()),(o||s)&&u(Bs())},[o,s]);const f=h.useCallback(()=>{t==="unifiedCanvas"&&u(Bs())},[u,t]),p=h.useCallback(x=>{x.target instanceof HTMLElement&&x.target.blur()},[]),m=h.useMemo(()=>n.map(x=>i.jsx(er,{hasArrow:!0,label:String(l(`common.${x.id}`)),placement:"end",children:i.jsxs(xj,{onClick:p,children:[i.jsx(cP,{children:String(l(`common.${x.id}`))}),x.icon]})},x.id)),[n,l,p]),v=h.useMemo(()=>n.map(x=>i.jsx(vj,{children:x.content},x.id)),[n]),{ref:y,minSizePct:S}=Tfe(Dfe,W1,"app");return i.jsxs(mj,{defaultIndex:e,index:e,onChange:x=>{u(Nl(x))},sx:{flexGrow:1,gap:4},isLazy:!0,children:[i.jsxs(gj,{sx:{pt:2,gap:4,flexDir:"column"},children:[m,i.jsx(ul,{}),i.jsx(Ofe,{})]}),i.jsxs(p2,{id:"app",autoSaveId:"app",direction:"horizontal",style:{height:"100%",width:"100%"},children:[i.jsx(wf,{id:"main",children:i.jsx(yj,{style:{height:"100%",width:"100%"},children:v})}),o&&a&&i.jsxs(i.Fragment,{children:[i.jsx(lR,{}),i.jsx(wf,{ref:y,onResize:f,id:"gallery",order:3,defaultSize:S>W1?S:W1,minSize:S,maxSize:50,children:i.jsx(PE,{})})]})]})]})},Nfe=h.memo(Afe),zfe=Te([po,Gr,av],(e,t,n)=>{const{shouldPinParametersPanel:r,shouldShowParametersPanel:o}=e;return{activeTabName:t,shouldPinParametersPanel:r,shouldShowParametersPanel:o}},zn),$fe=()=>{const e=ue(),{shouldPinParametersPanel:t,shouldShowParametersPanel:n,activeTabName:r}=q(zfe),o=()=>{e(jx(!1))},s=h.useMemo(()=>r==="txt2img"?i.jsx(A8,{}):r==="img2img"?i.jsx(cR,{}):r==="unifiedCanvas"?i.jsx(rR,{}):null,[r]);return t?null:i.jsx(jE,{direction:"left",isResizable:!1,isOpen:n,onClose:o,children:i.jsxs(K,{sx:{flexDir:"column",h:"full",w:i8,gap:2},children:[i.jsxs(K,{paddingTop:1.5,paddingBottom:4,justifyContent:"space-between",alignItems:"center",children:[i.jsx(l8,{}),i.jsx(j8,{})]}),i.jsx(I8,{children:i.jsx(K,{sx:{flexDir:"column",gap:2},children:s})})]})})},Lfe=h.memo($fe),Bfe=Te(e=>e.hotkeys,e=>{const{shift:t}=e;return{shift:t}},{memoizeOptions:{resultEqualityCheck:Ut}}),Ffe=()=>{const e=ue(),{shift:t}=q(Bfe);return nt("*",()=>{Nj("shift")?!t&&e(AS(!0)):t&&e(AS(!1))},{keyup:!0,keydown:!0},[t]),nt("o",()=>{e($9())}),nt(["shift+o"],()=>{e(L9())}),nt("g",()=>{e(B9())}),nt(["shift+g"],()=>{e(f5())}),nt("1",()=>{e(Nl("txt2img"))}),nt("2",()=>{e(Nl("img2img"))}),nt("3",()=>{e(Nl("unifiedCanvas"))}),nt("4",()=>{e(Nl("nodes"))}),null},Hfe=h.memo(Ffe),Vfe=()=>{const{data:e,isFetching:t}=Sx(),{isOpen:n,onClose:r,handleAddToBoard:o,image:s}=h.useContext(n5),[a,l]=h.useState(),u=h.useRef(null),f=e==null?void 0:e.find(p=>p.board_id===(s==null?void 0:s.board_id));return i.jsx(Ng,{isOpen:n,leastDestructiveRef:u,onClose:r,isCentered:!0,children:i.jsx(ya,{children:i.jsxs(zg,{children:[i.jsx(va,{fontSize:"lg",fontWeight:"bold",children:f?"Move Image to Board":"Add Image to Board"}),i.jsx(xa,{children:i.jsx(et,{children:i.jsxs(K,{direction:"column",gap:3,children:[f&&i.jsxs(lt,{children:["Moving this image from"," ",i.jsx("strong",{children:f.board_name})," to"]}),t?i.jsx(Du,{}):i.jsx(Zo,{placeholder:"Select Board",onChange:p=>l(p),value:a,data:(e??[]).map(p=>({label:p.board_name,value:p.board_id}))})]})})}),i.jsxs(ga,{children:[i.jsx(fn,{onClick:r,children:"Cancel"}),i.jsx(fn,{isDisabled:!a,colorScheme:"accent",onClick:()=>{a&&o(a)},ml:3,children:f?"Move":"Add"})]})]})})})},Wfe=h.memo(Vfe),Ufe=e=>{const{imagesUsage:t}=e;return!t||!h5(t)?null:i.jsxs(i.Fragment,{children:[i.jsx(lt,{children:"An image from this board is currently in use in the following features:"}),i.jsxs(Tg,{sx:{paddingInlineStart:6},children:[t.isInitialImage&&i.jsx(is,{children:"Image to Image"}),t.isCanvasImage&&i.jsx(is,{children:"Unified Canvas"}),t.isControlNetImage&&i.jsx(is,{children:"ControlNet"}),t.isNodesImage&&i.jsx(is,{children:"Node Editor"})]}),i.jsx(lt,{children:"If you delete images from this board, those features will immediately be reset."})]})},Gfe=()=>{const{t:e}=Ce(),{isOpen:t,onClose:n,board:r,handleDeleteBoardImages:o,handleDeleteBoardOnly:s,imagesUsage:a}=h.useContext(c5),l=h.useRef(null);return i.jsx(Ng,{isOpen:t,leastDestructiveRef:l,onClose:n,isCentered:!0,children:i.jsx(ya,{children:r&&i.jsxs(zg,{children:[i.jsx(va,{fontSize:"lg",fontWeight:"bold",children:"Delete Board"}),i.jsx(xa,{children:i.jsxs(K,{direction:"column",gap:3,children:[i.jsx(Ufe,{imagesUsage:a}),i.jsx(Fu,{}),i.jsx(lt,{children:e("common.areYouSure")}),i.jsxs(lt,{fontWeight:"bold",children:["This board has ",r.image_count," image(s) that will be deleted."]})]})}),i.jsxs(ga,{gap:3,children:[i.jsx(fn,{ref:l,onClick:n,children:"Cancel"}),i.jsx(fn,{colorScheme:"warning",onClick:()=>s(r.board_id),children:"Delete Board Only"}),i.jsx(fn,{colorScheme:"error",onClick:()=>o(r.board_id),children:"Delete Board and Images"})]})]})})})},qfe=h.memo(Gfe),Yfe={},Kfe=({config:e=Yfe,headerComponent:t,setIsReady:n})=>{const r=q(v5),o=F9(),s=so("lightbox").isFeatureEnabled,a=Foe();Al({model_type:"main"}),Al({model_type:"controlnet"}),Al({model_type:"vae"}),Al({model_type:"lora"}),Al({model_type:"embedding"});const[l,u]=h.useState(!1),f=ue();h.useEffect(()=>{co.changeLanguage(r)},[r]),h.useEffect(()=>{o.info({namespace:"App",data:e},"Received config"),f(H9(e))},[f,e,o]);const p=h.useCallback(()=>{u(!0)},[]);return h.useEffect(()=>(a&&n&&n(!0),a&&setTimeout(()=>{f(Bs())},200),()=>{n&&n(!1)}),[f,a,n]),i.jsxs(i.Fragment,{children:[i.jsxs(gi,{w:"100vw",h:"100vh",position:"relative",overflow:"hidden",children:[s&&i.jsx(Tre,{}),i.jsx(sV,{children:i.jsxs(gi,{sx:{gap:4,p:4,gridAutoRows:"min-content auto",w:"full",h:"full"},children:[t||i.jsx(Loe,{}),i.jsx(K,{sx:{gap:4,w:"full",h:"full"},children:i.jsx(Nfe,{})})]})}),i.jsx(LY,{}),i.jsx(Lfe,{}),i.jsx(Co,{children:!a&&!l&&i.jsxs(zo.div,{initial:{opacity:1},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},style:{zIndex:3},children:[i.jsx(et,{position:"absolute",top:0,left:0,w:"100vw",h:"100vh",children:i.jsx(V9,{})}),i.jsx(et,{onClick:p,position:"absolute",top:0,right:0,cursor:"pointer",w:"2rem",h:"2rem"})]},"loading")}),i.jsx(Fd,{children:i.jsx(Joe,{})}),i.jsx(Fd,{children:i.jsx(Woe,{})})]}),i.jsx(lne,{}),i.jsx(Wfe,{}),i.jsx(qfe,{}),i.jsx(W9,{}),i.jsx(Hfe,{})]})},tpe=h.memo(Kfe);export{tpe as default};