From 6ab364b16a36035453db6ce5260a8c08ca9f7233 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Tue, 7 Feb 2023 23:27:12 +1100 Subject: [PATCH] build frontend --- .../frontend/dist/assets/index-34c8aef8.js | 638 ++++++++++++++++++ .../frontend/dist/assets/index-9240ae24.js | 612 ----------------- .../dist/assets/index-legacy-3b86d684.js | 45 -- .../dist/assets/polyfills-db6c30c5.js | 1 - .../dist/assets/polyfills-legacy-70c7b801.js | 1 - invokeai/frontend/dist/index.html | 9 +- invokeai/frontend/stats.html | 2 +- 7 files changed, 640 insertions(+), 668 deletions(-) create mode 100644 invokeai/frontend/dist/assets/index-34c8aef8.js delete mode 100644 invokeai/frontend/dist/assets/index-9240ae24.js delete mode 100644 invokeai/frontend/dist/assets/index-legacy-3b86d684.js delete mode 100644 invokeai/frontend/dist/assets/polyfills-db6c30c5.js delete mode 100644 invokeai/frontend/dist/assets/polyfills-legacy-70c7b801.js diff --git a/invokeai/frontend/dist/assets/index-34c8aef8.js b/invokeai/frontend/dist/assets/index-34c8aef8.js new file mode 100644 index 0000000000..39e218a97d --- /dev/null +++ b/invokeai/frontend/dist/assets/index-34c8aef8.js @@ -0,0 +1,638 @@ +var uee=Object.defineProperty;var cee=(e,t,n)=>t in e?uee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var sn=(e,t,n)=>(cee(e,typeof t!="symbol"?t+"":t,n),n);function rj(e,t){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerpolicy&&(o.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?o.credentials="include":i.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var wo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function d_(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var v={},dee={get exports(){return v},set exports(e){v=e}},mS={},w={},fee={get exports(){return w},set exports(e){w=e}},tn={};/** + * @license React + * react.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 cy=Symbol.for("react.element"),hee=Symbol.for("react.portal"),pee=Symbol.for("react.fragment"),gee=Symbol.for("react.strict_mode"),mee=Symbol.for("react.profiler"),vee=Symbol.for("react.provider"),yee=Symbol.for("react.context"),bee=Symbol.for("react.forward_ref"),See=Symbol.for("react.suspense"),xee=Symbol.for("react.memo"),wee=Symbol.for("react.lazy"),cL=Symbol.iterator;function Cee(e){return e===null||typeof e!="object"?null:(e=cL&&e[cL]||e["@@iterator"],typeof e=="function"?e:null)}var ij={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},oj=Object.assign,aj={};function d0(e,t,n){this.props=e,this.context=t,this.refs=aj,this.updater=n||ij}d0.prototype.isReactComponent={};d0.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};d0.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function sj(){}sj.prototype=d0.prototype;function f_(e,t,n){this.props=e,this.context=t,this.refs=aj,this.updater=n||ij}var h_=f_.prototype=new sj;h_.constructor=f_;oj(h_,d0.prototype);h_.isPureReactComponent=!0;var dL=Array.isArray,lj=Object.prototype.hasOwnProperty,p_={current:null},uj={key:!0,ref:!0,__self:!0,__source:!0};function cj(e,t,n){var r,i={},o=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(o=""+t.key),t)lj.call(t,r)&&!uj.hasOwnProperty(r)&&(i[r]=t[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1{const i=t?n.preventTransition():void 0;document.documentElement.dataset.theme=r,document.documentElement.style.colorScheme=r,i==null||i()},setClassName(r){document.body.classList.add(r?j3.dark:j3.light),document.body.classList.remove(r?j3.light:j3.dark)},query(){return window.matchMedia("(prefers-color-scheme: dark)")},getSystemTheme(r){return n.query().matches??r==="dark"?"dark":"light"},addListener(r){const i=n.query(),o=a=>{r(a.matches?"dark":"light")};return typeof i.addListener=="function"?i.addListener(o):i.addEventListener("change",o),()=>{typeof i.removeListener=="function"?i.removeListener(o):i.removeEventListener("change",o)}},preventTransition(){const r=document.createElement("style");return r.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(r),()=>{window.getComputedStyle(document.body),requestAnimationFrame(()=>{requestAnimationFrame(()=>{document.head.removeChild(r)})})}}};return n}var Dee="chakra-ui-color-mode";function Nee(e){return{ssr:!1,type:"localStorage",get(t){if(!(globalThis!=null&&globalThis.document))return t;let n;try{n=localStorage.getItem(e)||t}catch{}return n||t},set(t){try{localStorage.setItem(e,t)}catch{}}}}var jee=Nee(Dee),hL=()=>{};function pL(e,t){return e.type==="cookie"&&e.ssr?e.get(t):t}function fj(e){const{value:t,children:n,options:{useSystemColorMode:r,initialColorMode:i,disableTransitionOnChange:o}={},colorModeManager:a=jee}=e,s=i==="dark"?"dark":"light",[l,u]=w.useState(()=>pL(a,s)),[d,h]=w.useState(()=>pL(a)),{getSystemTheme:m,setClassName:y,setDataset:b,addListener:S}=w.useMemo(()=>Ree({preventTransition:o}),[o]),E=i==="system"&&!l?d:l,k=w.useCallback(A=>{const I=A==="system"?m():A;u(I),y(I==="dark"),b(I),a.set(I)},[a,m,y,b]);Ws(()=>{i==="system"&&h(m())},[]),w.useEffect(()=>{const A=a.get();if(A){k(A);return}if(i==="system"){k("system");return}k(s)},[a,s,i,k]);const _=w.useCallback(()=>{k(E==="dark"?"light":"dark")},[E,k]);w.useEffect(()=>{if(r)return S(k)},[r,S,k]);const T=w.useMemo(()=>({colorMode:t??E,toggleColorMode:t?hL:_,setColorMode:t?hL:k,forced:t!==void 0}),[E,_,k,t]);return N.createElement(m_.Provider,{value:T},n)}fj.displayName="ColorModeProvider";var H4={},Bee={get exports(){return H4},set exports(e){H4=e}};(function(e,t){var n=200,r="__lodash_hash_undefined__",i=800,o=16,a=9007199254740991,s="[object Arguments]",l="[object Array]",u="[object AsyncFunction]",d="[object Boolean]",h="[object Date]",m="[object Error]",y="[object Function]",b="[object GeneratorFunction]",S="[object Map]",E="[object Number]",k="[object Null]",_="[object Object]",T="[object Proxy]",A="[object RegExp]",I="[object Set]",R="[object String]",D="[object Undefined]",j="[object WeakMap]",z="[object ArrayBuffer]",V="[object DataView]",K="[object Float32Array]",te="[object Float64Array]",q="[object Int8Array]",F="[object Int16Array]",U="[object Int32Array]",X="[object Uint8Array]",Z="[object Uint8ClampedArray]",W="[object Uint16Array]",Q="[object Uint32Array]",ie=/[\\^$.*+?()[\]{}|]/g,fe=/^\[object .+?Constructor\]$/,Se=/^(?:0|[1-9]\d*)$/,Te={};Te[K]=Te[te]=Te[q]=Te[F]=Te[U]=Te[X]=Te[Z]=Te[W]=Te[Q]=!0,Te[s]=Te[l]=Te[z]=Te[d]=Te[V]=Te[h]=Te[m]=Te[y]=Te[S]=Te[E]=Te[_]=Te[A]=Te[I]=Te[R]=Te[j]=!1;var ye=typeof wo=="object"&&wo&&wo.Object===Object&&wo,He=typeof self=="object"&&self&&self.Object===Object&&self,Ne=ye||He||Function("return this")(),tt=t&&!t.nodeType&&t,_e=tt&&!0&&e&&!e.nodeType&&e,lt=_e&&_e.exports===tt,wt=lt&&ye.process,ct=function(){try{var Y=_e&&_e.require&&_e.require("util").types;return Y||wt&&wt.binding&&wt.binding("util")}catch{}}(),mt=ct&&ct.isTypedArray;function St(Y,re,ge){switch(ge.length){case 0:return Y.call(re);case 1:return Y.call(re,ge[0]);case 2:return Y.call(re,ge[0],ge[1]);case 3:return Y.call(re,ge[0],ge[1],ge[2])}return Y.apply(re,ge)}function Ae(Y,re){for(var ge=-1,it=Array(Y);++ge-1}function N0(Y,re){var ge=this.__data__,it=ms(ge,Y);return it<0?(++this.size,ge.push([Y,re])):ge[it][1]=re,this}ia.prototype.clear=vf,ia.prototype.delete=D0,ia.prototype.get=bc,ia.prototype.has=yf,ia.prototype.set=N0;function il(Y){var re=-1,ge=Y==null?0:Y.length;for(this.clear();++re1?ge[Wt-1]:void 0,kt=Wt>2?ge[2]:void 0;for(Sn=Y.length>3&&typeof Sn=="function"?(Wt--,Sn):void 0,kt&&Ap(ge[0],ge[1],kt)&&(Sn=Wt<3?void 0:Sn,Wt=1),re=Object(re);++it-1&&Y%1==0&&Y0){if(++re>=i)return arguments[0]}else re=0;return Y.apply(void 0,arguments)}}function _c(Y){if(Y!=null){try{return Ue.call(Y)}catch{}try{return Y+""}catch{}}return""}function Fa(Y,re){return Y===re||Y!==Y&&re!==re}var Cf=bu(function(){return arguments}())?bu:function(Y){return Xn(Y)&&Ye.call(Y,"callee")&&!Ke.call(Y,"callee")},wu=Array.isArray;function Yt(Y){return Y!=null&&Mp(Y.length)&&!Ec(Y)}function Op(Y){return Xn(Y)&&Yt(Y)}var kc=rn||K0;function Ec(Y){if(!la(Y))return!1;var re=al(Y);return re==y||re==b||re==u||re==T}function Mp(Y){return typeof Y=="number"&&Y>-1&&Y%1==0&&Y<=a}function la(Y){var re=typeof Y;return Y!=null&&(re=="object"||re=="function")}function Xn(Y){return Y!=null&&typeof Y=="object"}function _f(Y){if(!Xn(Y)||al(Y)!=_)return!1;var re=nn(Y);if(re===null)return!0;var ge=Ye.call(re,"constructor")&&re.constructor;return typeof ge=="function"&&ge instanceof ge&&Ue.call(ge)==_t}var Ip=mt?ut(mt):xc;function kf(Y){return ui(Y,Rp(Y))}function Rp(Y){return Yt(Y)?G0(Y,!0):sl(Y)}var gn=vs(function(Y,re,ge,it){oa(Y,re,ge,it)});function Kt(Y){return function(){return Y}}function Dp(Y){return Y}function K0(){return!1}e.exports=gn})(Bee,H4);const Wl=H4;function Us(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}function xh(e,...t){return Fee(e)?e(...t):e}var Fee=e=>typeof e=="function",$ee=e=>/!(important)?$/.test(e),gL=e=>typeof e=="string"?e.replace(/!(important)?$/,"").trim():e,QC=(e,t)=>n=>{const r=String(t),i=$ee(r),o=gL(r),a=e?`${e}.${o}`:o;let s=Us(n.__cssMap)&&a in n.__cssMap?n.__cssMap[a].varRef:t;return s=gL(s),i?`${s} !important`:s};function p2(e){const{scale:t,transform:n,compose:r}=e;return(o,a)=>{const s=QC(t,o)(a);let l=(n==null?void 0:n(s,a))??s;return r&&(l=r(l,a)),l}}var B3=(...e)=>t=>e.reduce((n,r)=>r(n),t);function As(e,t){return n=>{const r={property:n,scale:e};return r.transform=p2({scale:e,transform:t}),r}}var zee=({rtl:e,ltr:t})=>n=>n.direction==="rtl"?e:t;function Hee(e){const{property:t,scale:n,transform:r}=e;return{scale:n,property:zee(t),transform:n?p2({scale:n,compose:r}):r}}var hj=["rotate(var(--chakra-rotate, 0))","scaleX(var(--chakra-scale-x, 1))","scaleY(var(--chakra-scale-y, 1))","skewX(var(--chakra-skew-x, 0))","skewY(var(--chakra-skew-y, 0))"];function Vee(){return["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...hj].join(" ")}function Wee(){return["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...hj].join(" ")}var Uee={"--chakra-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-sepia":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-drop-shadow":"var(--chakra-empty,/*!*/ /*!*/)",filter:["var(--chakra-blur)","var(--chakra-brightness)","var(--chakra-contrast)","var(--chakra-grayscale)","var(--chakra-hue-rotate)","var(--chakra-invert)","var(--chakra-saturate)","var(--chakra-sepia)","var(--chakra-drop-shadow)"].join(" ")},Gee={backdropFilter:["var(--chakra-backdrop-blur)","var(--chakra-backdrop-brightness)","var(--chakra-backdrop-contrast)","var(--chakra-backdrop-grayscale)","var(--chakra-backdrop-hue-rotate)","var(--chakra-backdrop-invert)","var(--chakra-backdrop-opacity)","var(--chakra-backdrop-saturate)","var(--chakra-backdrop-sepia)"].join(" "),"--chakra-backdrop-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-opacity":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-sepia":"var(--chakra-empty,/*!*/ /*!*/)"};function qee(e){return{"--chakra-ring-offset-shadow":"var(--chakra-ring-inset) 0 0 0 var(--chakra-ring-offset-width) var(--chakra-ring-offset-color)","--chakra-ring-shadow":"var(--chakra-ring-inset) 0 0 0 calc(var(--chakra-ring-width) + var(--chakra-ring-offset-width)) var(--chakra-ring-color)","--chakra-ring-width":e,boxShadow:["var(--chakra-ring-offset-shadow)","var(--chakra-ring-shadow)","var(--chakra-shadow, 0 0 #0000)"].join(", ")}}var Yee={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},pj="& > :not(style) ~ :not(style)",Kee={[pj]:{marginInlineStart:"calc(var(--chakra-space-x) * calc(1 - var(--chakra-space-x-reverse)))",marginInlineEnd:"calc(var(--chakra-space-x) * var(--chakra-space-x-reverse))"}},Xee={[pj]:{marginTop:"calc(var(--chakra-space-y) * calc(1 - var(--chakra-space-y-reverse)))",marginBottom:"calc(var(--chakra-space-y) * var(--chakra-space-y-reverse))"}},JC={"to-t":"to top","to-tr":"to top right","to-r":"to right","to-br":"to bottom right","to-b":"to bottom","to-bl":"to bottom left","to-l":"to left","to-tl":"to top left"},Zee=new Set(Object.values(JC)),gj=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),Qee=e=>e.trim();function Jee(e,t){var n;if(e==null||gj.has(e))return e;const r=/(?^[a-z-A-Z]+)\((?(.*))\)/g,{type:i,values:o}=((n=r.exec(e))==null?void 0:n.groups)??{};if(!i||!o)return e;const a=i.includes("-gradient")?i:`${i}-gradient`,[s,...l]=o.split(",").map(Qee).filter(Boolean);if((l==null?void 0:l.length)===0)return e;const u=s in JC?JC[s]:s;l.unshift(u);const d=l.map(h=>{if(Zee.has(h))return h;const m=h.indexOf(" "),[y,b]=m!==-1?[h.substr(0,m),h.substr(m+1)]:[h],S=mj(b)?b:b&&b.split(" "),E=`colors.${y}`,k=E in t.__cssMap?t.__cssMap[E].varRef:y;return S?[k,...Array.isArray(S)?S:[S]].join(" "):k});return`${a}(${d.join(", ")})`}var mj=e=>typeof e=="string"&&e.includes("(")&&e.includes(")"),ete=(e,t)=>Jee(e,t??{});function tte(e){return/^var\(--.+\)$/.test(e)}var nte=e=>{const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}},Tl=e=>t=>`${e}(${t})`,hn={filter(e){return e!=="auto"?e:Uee},backdropFilter(e){return e!=="auto"?e:Gee},ring(e){return qee(hn.px(e))},bgClip(e){return e==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:e}},transform(e){return e==="auto"?Vee():e==="auto-gpu"?Wee():e},vh(e){return e==="$100vh"?"var(--chakra-vh)":e},px(e){if(e==null)return e;const{unitless:t}=nte(e);return t||typeof e=="number"?`${e}px`:e},fraction(e){return typeof e!="number"||e>1?e:`${e*100}%`},float(e,t){const n={left:"right",right:"left"};return t.direction==="rtl"?n[e]:e},degree(e){if(tte(e)||e==null)return e;const t=typeof e=="string"&&!e.endsWith("deg");return typeof e=="number"||t?`${e}deg`:e},gradient:ete,blur:Tl("blur"),opacity:Tl("opacity"),brightness:Tl("brightness"),contrast:Tl("contrast"),dropShadow:Tl("drop-shadow"),grayscale:Tl("grayscale"),hueRotate:Tl("hue-rotate"),invert:Tl("invert"),saturate:Tl("saturate"),sepia:Tl("sepia"),bgImage(e){return e==null||mj(e)||gj.has(e)?e:`url(${e})`},outline(e){const t=String(e)==="0"||String(e)==="none";return e!==null&&t?{outline:"2px solid transparent",outlineOffset:"2px"}:{outline:e}},flexDirection(e){const{space:t,divide:n}=Yee[e]??{},r={flexDirection:e};return t&&(r[t]=1),n&&(r[n]=1),r}},ae={borderWidths:As("borderWidths"),borderStyles:As("borderStyles"),colors:As("colors"),borders:As("borders"),radii:As("radii",hn.px),space:As("space",B3(hn.vh,hn.px)),spaceT:As("space",B3(hn.vh,hn.px)),degreeT(e){return{property:e,transform:hn.degree}},prop(e,t,n){return{property:e,scale:t,...t&&{transform:p2({scale:t,transform:n})}}},propT(e,t){return{property:e,transform:t}},sizes:As("sizes",B3(hn.vh,hn.px)),sizesT:As("sizes",B3(hn.vh,hn.fraction)),shadows:As("shadows"),logical:Hee,blur:As("blur",hn.blur)},n4={background:ae.colors("background"),backgroundColor:ae.colors("backgroundColor"),backgroundImage:ae.propT("backgroundImage",hn.bgImage),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:hn.bgClip},bgSize:ae.prop("backgroundSize"),bgPosition:ae.prop("backgroundPosition"),bg:ae.colors("background"),bgColor:ae.colors("backgroundColor"),bgPos:ae.prop("backgroundPosition"),bgRepeat:ae.prop("backgroundRepeat"),bgAttachment:ae.prop("backgroundAttachment"),bgGradient:ae.propT("backgroundImage",hn.gradient),bgClip:{transform:hn.bgClip}};Object.assign(n4,{bgImage:n4.backgroundImage,bgImg:n4.backgroundImage});var wn={border:ae.borders("border"),borderWidth:ae.borderWidths("borderWidth"),borderStyle:ae.borderStyles("borderStyle"),borderColor:ae.colors("borderColor"),borderRadius:ae.radii("borderRadius"),borderTop:ae.borders("borderTop"),borderBlockStart:ae.borders("borderBlockStart"),borderTopLeftRadius:ae.radii("borderTopLeftRadius"),borderStartStartRadius:ae.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:ae.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:ae.radii("borderTopRightRadius"),borderStartEndRadius:ae.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:ae.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:ae.borders("borderRight"),borderInlineEnd:ae.borders("borderInlineEnd"),borderBottom:ae.borders("borderBottom"),borderBlockEnd:ae.borders("borderBlockEnd"),borderBottomLeftRadius:ae.radii("borderBottomLeftRadius"),borderBottomRightRadius:ae.radii("borderBottomRightRadius"),borderLeft:ae.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:ae.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:ae.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:ae.borders(["borderLeft","borderRight"]),borderInline:ae.borders("borderInline"),borderY:ae.borders(["borderTop","borderBottom"]),borderBlock:ae.borders("borderBlock"),borderTopWidth:ae.borderWidths("borderTopWidth"),borderBlockStartWidth:ae.borderWidths("borderBlockStartWidth"),borderTopColor:ae.colors("borderTopColor"),borderBlockStartColor:ae.colors("borderBlockStartColor"),borderTopStyle:ae.borderStyles("borderTopStyle"),borderBlockStartStyle:ae.borderStyles("borderBlockStartStyle"),borderBottomWidth:ae.borderWidths("borderBottomWidth"),borderBlockEndWidth:ae.borderWidths("borderBlockEndWidth"),borderBottomColor:ae.colors("borderBottomColor"),borderBlockEndColor:ae.colors("borderBlockEndColor"),borderBottomStyle:ae.borderStyles("borderBottomStyle"),borderBlockEndStyle:ae.borderStyles("borderBlockEndStyle"),borderLeftWidth:ae.borderWidths("borderLeftWidth"),borderInlineStartWidth:ae.borderWidths("borderInlineStartWidth"),borderLeftColor:ae.colors("borderLeftColor"),borderInlineStartColor:ae.colors("borderInlineStartColor"),borderLeftStyle:ae.borderStyles("borderLeftStyle"),borderInlineStartStyle:ae.borderStyles("borderInlineStartStyle"),borderRightWidth:ae.borderWidths("borderRightWidth"),borderInlineEndWidth:ae.borderWidths("borderInlineEndWidth"),borderRightColor:ae.colors("borderRightColor"),borderInlineEndColor:ae.colors("borderInlineEndColor"),borderRightStyle:ae.borderStyles("borderRightStyle"),borderInlineEndStyle:ae.borderStyles("borderInlineEndStyle"),borderTopRadius:ae.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:ae.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:ae.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:ae.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(wn,{rounded:wn.borderRadius,roundedTop:wn.borderTopRadius,roundedTopLeft:wn.borderTopLeftRadius,roundedTopRight:wn.borderTopRightRadius,roundedTopStart:wn.borderStartStartRadius,roundedTopEnd:wn.borderStartEndRadius,roundedBottom:wn.borderBottomRadius,roundedBottomLeft:wn.borderBottomLeftRadius,roundedBottomRight:wn.borderBottomRightRadius,roundedBottomStart:wn.borderEndStartRadius,roundedBottomEnd:wn.borderEndEndRadius,roundedLeft:wn.borderLeftRadius,roundedRight:wn.borderRightRadius,roundedStart:wn.borderInlineStartRadius,roundedEnd:wn.borderInlineEndRadius,borderStart:wn.borderInlineStart,borderEnd:wn.borderInlineEnd,borderTopStartRadius:wn.borderStartStartRadius,borderTopEndRadius:wn.borderStartEndRadius,borderBottomStartRadius:wn.borderEndStartRadius,borderBottomEndRadius:wn.borderEndEndRadius,borderStartRadius:wn.borderInlineStartRadius,borderEndRadius:wn.borderInlineEndRadius,borderStartWidth:wn.borderInlineStartWidth,borderEndWidth:wn.borderInlineEndWidth,borderStartColor:wn.borderInlineStartColor,borderEndColor:wn.borderInlineEndColor,borderStartStyle:wn.borderInlineStartStyle,borderEndStyle:wn.borderInlineEndStyle});var rte={color:ae.colors("color"),textColor:ae.colors("color"),fill:ae.colors("fill"),stroke:ae.colors("stroke")},e7={boxShadow:ae.shadows("boxShadow"),mixBlendMode:!0,blendMode:ae.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:ae.prop("backgroundBlendMode"),opacity:!0};Object.assign(e7,{shadow:e7.boxShadow});var ite={filter:{transform:hn.filter},blur:ae.blur("--chakra-blur"),brightness:ae.propT("--chakra-brightness",hn.brightness),contrast:ae.propT("--chakra-contrast",hn.contrast),hueRotate:ae.degreeT("--chakra-hue-rotate"),invert:ae.propT("--chakra-invert",hn.invert),saturate:ae.propT("--chakra-saturate",hn.saturate),dropShadow:ae.propT("--chakra-drop-shadow",hn.dropShadow),backdropFilter:{transform:hn.backdropFilter},backdropBlur:ae.blur("--chakra-backdrop-blur"),backdropBrightness:ae.propT("--chakra-backdrop-brightness",hn.brightness),backdropContrast:ae.propT("--chakra-backdrop-contrast",hn.contrast),backdropHueRotate:ae.degreeT("--chakra-backdrop-hue-rotate"),backdropInvert:ae.propT("--chakra-backdrop-invert",hn.invert),backdropSaturate:ae.propT("--chakra-backdrop-saturate",hn.saturate)},V4={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:hn.flexDirection},experimental_spaceX:{static:Kee,transform:p2({scale:"space",transform:e=>e!==null?{"--chakra-space-x":e}:null})},experimental_spaceY:{static:Xee,transform:p2({scale:"space",transform:e=>e!=null?{"--chakra-space-y":e}:null})},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:ae.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:ae.space("gap"),rowGap:ae.space("rowGap"),columnGap:ae.space("columnGap")};Object.assign(V4,{flexDir:V4.flexDirection});var vj={gridGap:ae.space("gridGap"),gridColumnGap:ae.space("gridColumnGap"),gridRowGap:ae.space("gridRowGap"),gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridColumnStart:!0,gridColumnEnd:!0,gridRowStart:!0,gridRowEnd:!0,gridAutoRows:!0,gridTemplate:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0},ote={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:hn.outline},outlineOffset:!0,outlineColor:ae.colors("outlineColor")},Xa={width:ae.sizesT("width"),inlineSize:ae.sizesT("inlineSize"),height:ae.sizes("height"),blockSize:ae.sizes("blockSize"),boxSize:ae.sizes(["width","height"]),minWidth:ae.sizes("minWidth"),minInlineSize:ae.sizes("minInlineSize"),minHeight:ae.sizes("minHeight"),minBlockSize:ae.sizes("minBlockSize"),maxWidth:ae.sizes("maxWidth"),maxInlineSize:ae.sizes("maxInlineSize"),maxHeight:ae.sizes("maxHeight"),maxBlockSize:ae.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:ae.propT("float",hn.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(Xa,{w:Xa.width,h:Xa.height,minW:Xa.minWidth,maxW:Xa.maxWidth,minH:Xa.minHeight,maxH:Xa.maxHeight,overscroll:Xa.overscrollBehavior,overscrollX:Xa.overscrollBehaviorX,overscrollY:Xa.overscrollBehaviorY});var ate={listStyleType:!0,listStylePosition:!0,listStylePos:ae.prop("listStylePosition"),listStyleImage:!0,listStyleImg:ae.prop("listStyleImage")};function ste(e,t,n,r){const i=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,i,o,a)=>{if(typeof r>"u")return e(r,i,o);t.has(r)||t.set(r,new Map);const s=t.get(r);if(s.has(i))return s.get(i);const l=e(r,i,o,a);return s.set(i,l),l}},ute=lte(ste),cte={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},dte={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},Gw=(e,t,n)=>{const r={},i=ute(e,t,{});for(const o in i)o in n&&n[o]!=null||(r[o]=i[o]);return r},fte={srOnly:{transform(e){return e===!0?cte:e==="focusable"?dte:{}}},layerStyle:{processResult:!0,transform:(e,t,n)=>Gw(t,`layerStyles.${e}`,n)},textStyle:{processResult:!0,transform:(e,t,n)=>Gw(t,`textStyles.${e}`,n)},apply:{processResult:!0,transform:(e,t,n)=>Gw(t,e,n)}},Rv={position:!0,pos:ae.prop("position"),zIndex:ae.prop("zIndex","zIndices"),inset:ae.spaceT("inset"),insetX:ae.spaceT(["left","right"]),insetInline:ae.spaceT("insetInline"),insetY:ae.spaceT(["top","bottom"]),insetBlock:ae.spaceT("insetBlock"),top:ae.spaceT("top"),insetBlockStart:ae.spaceT("insetBlockStart"),bottom:ae.spaceT("bottom"),insetBlockEnd:ae.spaceT("insetBlockEnd"),left:ae.spaceT("left"),insetInlineStart:ae.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:ae.spaceT("right"),insetInlineEnd:ae.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign(Rv,{insetStart:Rv.insetInlineStart,insetEnd:Rv.insetInlineEnd});var hte={ring:{transform:hn.ring},ringColor:ae.colors("--chakra-ring-color"),ringOffset:ae.prop("--chakra-ring-offset-width"),ringOffsetColor:ae.colors("--chakra-ring-offset-color"),ringInset:ae.prop("--chakra-ring-inset")},ar={margin:ae.spaceT("margin"),marginTop:ae.spaceT("marginTop"),marginBlockStart:ae.spaceT("marginBlockStart"),marginRight:ae.spaceT("marginRight"),marginInlineEnd:ae.spaceT("marginInlineEnd"),marginBottom:ae.spaceT("marginBottom"),marginBlockEnd:ae.spaceT("marginBlockEnd"),marginLeft:ae.spaceT("marginLeft"),marginInlineStart:ae.spaceT("marginInlineStart"),marginX:ae.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:ae.spaceT("marginInline"),marginY:ae.spaceT(["marginTop","marginBottom"]),marginBlock:ae.spaceT("marginBlock"),padding:ae.space("padding"),paddingTop:ae.space("paddingTop"),paddingBlockStart:ae.space("paddingBlockStart"),paddingRight:ae.space("paddingRight"),paddingBottom:ae.space("paddingBottom"),paddingBlockEnd:ae.space("paddingBlockEnd"),paddingLeft:ae.space("paddingLeft"),paddingInlineStart:ae.space("paddingInlineStart"),paddingInlineEnd:ae.space("paddingInlineEnd"),paddingX:ae.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:ae.space("paddingInline"),paddingY:ae.space(["paddingTop","paddingBottom"]),paddingBlock:ae.space("paddingBlock")};Object.assign(ar,{m:ar.margin,mt:ar.marginTop,mr:ar.marginRight,me:ar.marginInlineEnd,marginEnd:ar.marginInlineEnd,mb:ar.marginBottom,ml:ar.marginLeft,ms:ar.marginInlineStart,marginStart:ar.marginInlineStart,mx:ar.marginX,my:ar.marginY,p:ar.padding,pt:ar.paddingTop,py:ar.paddingY,px:ar.paddingX,pb:ar.paddingBottom,pl:ar.paddingLeft,ps:ar.paddingInlineStart,paddingStart:ar.paddingInlineStart,pr:ar.paddingRight,pe:ar.paddingInlineEnd,paddingEnd:ar.paddingInlineEnd});var pte={textDecorationColor:ae.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:ae.shadows("textShadow")},gte={clipPath:!0,transform:ae.propT("transform",hn.transform),transformOrigin:!0,translateX:ae.spaceT("--chakra-translate-x"),translateY:ae.spaceT("--chakra-translate-y"),skewX:ae.degreeT("--chakra-skew-x"),skewY:ae.degreeT("--chakra-skew-y"),scaleX:ae.prop("--chakra-scale-x"),scaleY:ae.prop("--chakra-scale-y"),scale:ae.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:ae.degreeT("--chakra-rotate")},mte={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:ae.prop("transitionDuration","transition.duration"),transitionProperty:ae.prop("transitionProperty","transition.property"),transitionTimingFunction:ae.prop("transitionTimingFunction","transition.easing")},vte={fontFamily:ae.prop("fontFamily","fonts"),fontSize:ae.prop("fontSize","fontSizes",hn.px),fontWeight:ae.prop("fontWeight","fontWeights"),lineHeight:ae.prop("lineHeight","lineHeights"),letterSpacing:ae.prop("letterSpacing","letterSpacings"),textAlign:!0,fontStyle:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,noOfLines:{static:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"var(--chakra-line-clamp)"},property:"--chakra-line-clamp"}},yte={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:ae.spaceT("scrollMargin"),scrollMarginTop:ae.spaceT("scrollMarginTop"),scrollMarginBottom:ae.spaceT("scrollMarginBottom"),scrollMarginLeft:ae.spaceT("scrollMarginLeft"),scrollMarginRight:ae.spaceT("scrollMarginRight"),scrollMarginX:ae.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:ae.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:ae.spaceT("scrollPadding"),scrollPaddingTop:ae.spaceT("scrollPaddingTop"),scrollPaddingBottom:ae.spaceT("scrollPaddingBottom"),scrollPaddingLeft:ae.spaceT("scrollPaddingLeft"),scrollPaddingRight:ae.spaceT("scrollPaddingRight"),scrollPaddingX:ae.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:ae.spaceT(["scrollPaddingTop","scrollPaddingBottom"])};function yj(e){return Us(e)&&e.reference?e.reference:String(e)}var vS=(e,...t)=>t.map(yj).join(` ${e} `).replace(/calc/g,""),mL=(...e)=>`calc(${vS("+",...e)})`,vL=(...e)=>`calc(${vS("-",...e)})`,t7=(...e)=>`calc(${vS("*",...e)})`,yL=(...e)=>`calc(${vS("/",...e)})`,bL=e=>{const t=yj(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:t7(t,-1)},yh=Object.assign(e=>({add:(...t)=>yh(mL(e,...t)),subtract:(...t)=>yh(vL(e,...t)),multiply:(...t)=>yh(t7(e,...t)),divide:(...t)=>yh(yL(e,...t)),negate:()=>yh(bL(e)),toString:()=>e.toString()}),{add:mL,subtract:vL,multiply:t7,divide:yL,negate:bL});function bte(e,t="-"){return e.replace(/\s+/g,t)}function Ste(e){const t=bte(e.toString());return wte(xte(t))}function xte(e){return e.includes("\\.")?e:!Number.isInteger(parseFloat(e.toString()))?e.replace(".","\\."):e}function wte(e){return e.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}function Cte(e,t=""){return[t,e].filter(Boolean).join("-")}function _te(e,t){return`var(${e}${t?`, ${t}`:""})`}function kte(e,t=""){return Ste(`--${Cte(e,t)}`)}function Vn(e,t,n){const r=kte(e,n);return{variable:r,reference:_te(r,t)}}function Ete(e){const t=e==null?0:e.length;return t?e[t-1]:void 0}function Pte(e){const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}}function n7(e){if(e==null)return e;const{unitless:t}=Pte(e);return t||typeof e=="number"?`${e}px`:e}var bj=(e,t)=>parseInt(e[1],10)>parseInt(t[1],10)?1:-1,v_=e=>Object.fromEntries(Object.entries(e).sort(bj));function SL(e){const t=v_(e);return Object.assign(Object.values(t),t)}function Tte(e){const t=Object.keys(v_(e));return new Set(t)}function xL(e){if(!e)return e;e=n7(e)??e;const t=e.endsWith("px")?-1:-.0625;return typeof e=="number"?`${e+t}`:e.replace(/(\d+\.?\d*)/u,n=>`${parseFloat(n)+t}`)}function mv(e,t){const n=["@media screen"];return e&&n.push("and",`(min-width: ${n7(e)})`),t&&n.push("and",`(max-width: ${n7(t)})`),n.join(" ")}function Lte(e){if(!e)return null;e.base=e.base??"0px";const t=SL(e),n=Object.entries(e).sort(bj).map(([o,a],s,l)=>{let[,u]=l[s+1]??[];return u=parseFloat(u)>0?xL(u):void 0,{_minW:xL(a),breakpoint:o,minW:a,maxW:u,maxWQuery:mv(null,u),minWQuery:mv(a),minMaxQuery:mv(a,u)}}),r=Tte(e),i=Array.from(r.values());return{keys:r,normalized:t,isResponsive(o){const a=Object.keys(o);return a.length>0&&a.every(s=>r.has(s))},asObject:v_(e),asArray:SL(e),details:n,media:[null,...t.map(o=>mv(o)).slice(1)],toArrayValue(o){if(!Us(o))throw new Error("toArrayValue: value must be an object");const a=i.map(s=>o[s]??null);for(;Ete(a)===null;)a.pop();return a},toObjectValue(o){if(!Array.isArray(o))throw new Error("toObjectValue: value must be an array");return o.reduce((a,s,l)=>{const u=i[l];return u!=null&&s!=null&&(a[u]=s),a},{})}}}var $i={hover:(e,t)=>`${e}:hover ${t}, ${e}[data-hover] ${t}`,focus:(e,t)=>`${e}:focus ${t}, ${e}[data-focus] ${t}`,focusVisible:(e,t)=>`${e}:focus-visible ${t}`,focusWithin:(e,t)=>`${e}:focus-within ${t}`,active:(e,t)=>`${e}:active ${t}, ${e}[data-active] ${t}`,disabled:(e,t)=>`${e}:disabled ${t}, ${e}[data-disabled] ${t}`,invalid:(e,t)=>`${e}:invalid ${t}, ${e}[data-invalid] ${t}`,checked:(e,t)=>`${e}:checked ${t}, ${e}[data-checked] ${t}`,indeterminate:(e,t)=>`${e}:indeterminate ${t}, ${e}[aria-checked=mixed] ${t}, ${e}[data-indeterminate] ${t}`,readOnly:(e,t)=>`${e}:read-only ${t}, ${e}[readonly] ${t}, ${e}[data-read-only] ${t}`,expanded:(e,t)=>`${e}:read-only ${t}, ${e}[aria-expanded=true] ${t}, ${e}[data-expanded] ${t}`,placeholderShown:(e,t)=>`${e}:placeholder-shown ${t}`},id=e=>Sj(t=>e(t,"&"),"[role=group]","[data-group]",".group"),Nu=e=>Sj(t=>e(t,"~ &"),"[data-peer]",".peer"),Sj=(e,...t)=>t.map(e).join(", "),yS={_hover:"&:hover, &[data-hover]",_active:"&:active, &[data-active]",_focus:"&:focus, &[data-focus]",_highlighted:"&[data-highlighted]",_focusWithin:"&:focus-within",_focusVisible:"&:focus-visible, &[data-focus-visible]",_disabled:"&:disabled, &[disabled], &[aria-disabled=true], &[data-disabled]",_readOnly:"&[aria-readonly=true], &[readonly], &[data-readonly]",_before:"&::before",_after:"&::after",_empty:"&:empty",_expanded:"&[aria-expanded=true], &[data-expanded]",_checked:"&[aria-checked=true], &[data-checked]",_grabbed:"&[aria-grabbed=true], &[data-grabbed]",_pressed:"&[aria-pressed=true], &[data-pressed]",_invalid:"&[aria-invalid=true], &[data-invalid]",_valid:"&[data-valid], &[data-state=valid]",_loading:"&[data-loading], &[aria-busy=true]",_selected:"&[aria-selected=true], &[data-selected]",_hidden:"&[hidden], &[data-hidden]",_autofill:"&:-webkit-autofill",_even:"&:nth-of-type(even)",_odd:"&:nth-of-type(odd)",_first:"&:first-of-type",_last:"&:last-of-type",_notFirst:"&:not(:first-of-type)",_notLast:"&:not(:last-of-type)",_visited:"&:visited",_activeLink:"&[aria-current=page]",_activeStep:"&[aria-current=step]",_indeterminate:"&:indeterminate, &[aria-checked=mixed], &[data-indeterminate]",_groupHover:id($i.hover),_peerHover:Nu($i.hover),_groupFocus:id($i.focus),_peerFocus:Nu($i.focus),_groupFocusVisible:id($i.focusVisible),_peerFocusVisible:Nu($i.focusVisible),_groupActive:id($i.active),_peerActive:Nu($i.active),_groupDisabled:id($i.disabled),_peerDisabled:Nu($i.disabled),_groupInvalid:id($i.invalid),_peerInvalid:Nu($i.invalid),_groupChecked:id($i.checked),_peerChecked:Nu($i.checked),_groupFocusWithin:id($i.focusWithin),_peerFocusWithin:Nu($i.focusWithin),_peerPlaceholderShown:Nu($i.placeholderShown),_placeholder:"&::placeholder",_placeholderShown:"&:placeholder-shown",_fullScreen:"&:fullscreen",_selection:"&::selection",_rtl:"[dir=rtl] &, &[dir=rtl]",_ltr:"[dir=ltr] &, &[dir=ltr]",_mediaDark:"@media (prefers-color-scheme: dark)",_mediaReduceMotion:"@media (prefers-reduced-motion: reduce)",_dark:".chakra-ui-dark &:not([data-theme]),[data-theme=dark] &:not([data-theme]),&[data-theme=dark]",_light:".chakra-ui-light &:not([data-theme]),[data-theme=light] &:not([data-theme]),&[data-theme=light]"},Ate=Object.keys(yS);function wL(e,t){return Vn(String(e).replace(/\./g,"-"),void 0,t)}function Ote(e,t){let n={};const r={};for(const[i,o]of Object.entries(e)){const{isSemantic:a,value:s}=o,{variable:l,reference:u}=wL(i,t==null?void 0:t.cssVarPrefix);if(!a){if(i.startsWith("space")){const m=i.split("."),[y,...b]=m,S=`${y}.-${b.join(".")}`,E=yh.negate(s),k=yh.negate(u);r[S]={value:E,var:l,varRef:k}}n[l]=s,r[i]={value:s,var:l,varRef:u};continue}const d=m=>{const b=[String(i).split(".")[0],m].join(".");if(!e[b])return m;const{reference:E}=wL(b,t==null?void 0:t.cssVarPrefix);return E},h=Us(s)?s:{default:s};n=Wl(n,Object.entries(h).reduce((m,[y,b])=>{var S;const E=d(b);if(y==="default")return m[l]=E,m;const k=((S=yS)==null?void 0:S[y])??y;return m[k]={[l]:E},m},{})),r[i]={value:u,var:l,varRef:u}}return{cssVars:n,cssMap:r}}function Mte(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function Ite(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var Rte=["colors","borders","borderWidths","borderStyles","fonts","fontSizes","fontWeights","letterSpacings","lineHeights","radii","space","shadows","sizes","zIndices","transition","blur"];function Dte(e){return Ite(e,Rte)}function Nte(e){return e.semanticTokens}function jte(e){const{__cssMap:t,__cssVars:n,__breakpoints:r,...i}=e;return i}function Bte({tokens:e,semanticTokens:t}){const n=Object.entries(r7(e)??{}).map(([i,o])=>[i,{isSemantic:!1,value:o}]),r=Object.entries(r7(t,1)??{}).map(([i,o])=>[i,{isSemantic:!0,value:o}]);return Object.fromEntries([...n,...r])}function r7(e,t=1/0){return!Us(e)&&!Array.isArray(e)||!t?e:Object.entries(e).reduce((n,[r,i])=>(Us(i)||Array.isArray(i)?Object.entries(r7(i,t-1)).forEach(([o,a])=>{n[`${r}.${o}`]=a}):n[r]=i,n),{})}function Fte(e){var t;const n=jte(e),r=Dte(n),i=Nte(n),o=Bte({tokens:r,semanticTokens:i}),a=(t=n.config)==null?void 0:t.cssVarPrefix,{cssMap:s,cssVars:l}=Ote(o,{cssVarPrefix:a});return Object.assign(n,{__cssVars:{...{"--chakra-ring-inset":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-ring-offset-width":"0px","--chakra-ring-offset-color":"#fff","--chakra-ring-color":"rgba(66, 153, 225, 0.6)","--chakra-ring-offset-shadow":"0 0 #0000","--chakra-ring-shadow":"0 0 #0000","--chakra-space-x-reverse":"0","--chakra-space-y-reverse":"0"},...l},__cssMap:s,__breakpoints:Lte(n.breakpoints)}),n}var y_=Wl({},n4,wn,rte,V4,Xa,ite,hte,ote,vj,fte,Rv,e7,ar,yte,vte,pte,gte,ate,mte),$te=Object.assign({},ar,Xa,V4,vj,Rv),zte=Object.keys($te),Hte=[...Object.keys(y_),...Ate],Vte={...y_,...yS},Wte=e=>e in Vte,Ute=e=>t=>{if(!t.__breakpoints)return e;const{isResponsive:n,toArrayValue:r,media:i}=t.__breakpoints,o={};for(const a in e){let s=xh(e[a],t);if(s==null)continue;if(s=Us(s)&&n(s)?r(s):s,!Array.isArray(s)){o[a]=s;continue}const l=s.slice(0,i.length).length;for(let u=0;ue.startsWith("--")&&typeof t=="string"&&!qte(t),Kte=(e,t)=>{if(t==null)return t;const n=a=>{var s,l;return(l=(s=e.__cssMap)==null?void 0:s[a])==null?void 0:l.varRef},r=a=>n(a)??a,[i,o]=Gte(t);return t=n(i)??r(o)??r(t),t};function Xte(e){const{configs:t={},pseudos:n={},theme:r}=e,i=(o,a=!1)=>{var s;const l=xh(o,r),u=Ute(l)(r);let d={};for(let h in u){const m=u[h];let y=xh(m,r);h in n&&(h=n[h]),Yte(h,y)&&(y=Kte(r,y));let b=t[h];if(b===!0&&(b={property:h}),Us(y)){d[h]=d[h]??{},d[h]=Wl({},d[h],i(y,!0));continue}let S=((s=b==null?void 0:b.transform)==null?void 0:s.call(b,y,r,l))??y;S=b!=null&&b.processResult?i(S,!0):S;const E=xh(b==null?void 0:b.property,r);if(!a&&(b!=null&&b.static)){const k=xh(b.static,r);d=Wl({},d,k)}if(E&&Array.isArray(E)){for(const k of E)d[k]=S;continue}if(E){E==="&"&&Us(S)?d=Wl({},d,S):d[E]=S;continue}if(Us(S)){d=Wl({},d,S);continue}d[h]=S}return d};return i}var xj=e=>t=>Xte({theme:t,pseudos:yS,configs:y_})(e);function hr(e){return{definePartsStyle(t){return t},defineMultiStyleConfig(t){return{parts:e,...t}}}}function Zte(e,t){if(Array.isArray(e))return e;if(Us(e))return t(e);if(e!=null)return[e]}function Qte(e,t){for(let n=t+1;n{Wl(u,{[T]:m?_[T]:{[k]:_[T]}})});continue}if(!y){m?Wl(u,_):u[k]=_;continue}u[k]=_}}return u}}function ene(e){return t=>{const{variant:n,size:r,theme:i}=t,o=Jte(i);return Wl({},xh(e.baseStyle??{},t),o(e,"sizes",r,t),o(e,"variants",n,t))}}function tne(e,t,n){var r,i;return((i=(r=e.__cssMap)==null?void 0:r[`${t}.${n}`])==null?void 0:i.varRef)??n}function En(e){return Mte(e,["styleConfig","size","variant","colorScheme"])}function nne(e){if(e.sheet)return e.sheet;for(var t=0;t0?Wi(f0,--ra):0,zm--,ii===10&&(zm=1,SS--),ii}function Pa(){return ii=ra2||m2(ii)>3?"":" "}function pne(e,t){for(;--t&&Pa()&&!(ii<48||ii>102||ii>57&&ii<65||ii>70&&ii<97););return fy(e,r4()+(t<6&&Yl()==32&&Pa()==32))}function o7(e){for(;Pa();)switch(ii){case e:return ra;case 34:case 39:e!==34&&e!==39&&o7(ii);break;case 40:e===41&&o7(e);break;case 92:Pa();break}return ra}function gne(e,t){for(;Pa()&&e+ii!==47+10;)if(e+ii===42+42&&Yl()===47)break;return"/*"+fy(t,ra-1)+"*"+bS(e===47?e:Pa())}function mne(e){for(;!m2(Yl());)Pa();return fy(e,ra)}function vne(e){return Pj(o4("",null,null,null,[""],e=Ej(e),0,[0],e))}function o4(e,t,n,r,i,o,a,s,l){for(var u=0,d=0,h=a,m=0,y=0,b=0,S=1,E=1,k=1,_=0,T="",A=i,I=o,R=r,D=T;E;)switch(b=_,_=Pa()){case 40:if(b!=108&&Wi(D,h-1)==58){i7(D+=An(i4(_),"&","&\f"),"&\f")!=-1&&(k=-1);break}case 34:case 39:case 91:D+=i4(_);break;case 9:case 10:case 13:case 32:D+=hne(b);break;case 92:D+=pne(r4()-1,7);continue;case 47:switch(Yl()){case 42:case 47:F3(yne(gne(Pa(),r4()),t,n),l);break;default:D+="/"}break;case 123*S:s[u++]=Bl(D)*k;case 125*S:case 59:case 0:switch(_){case 0:case 125:E=0;case 59+d:y>0&&Bl(D)-h&&F3(y>32?_L(D+";",r,n,h-1):_L(An(D," ","")+";",r,n,h-2),l);break;case 59:D+=";";default:if(F3(R=CL(D,t,n,u,d,i,s,T,A=[],I=[],h),o),_===123)if(d===0)o4(D,t,R,R,A,o,h,s,I);else switch(m===99&&Wi(D,3)===110?100:m){case 100:case 109:case 115:o4(e,R,R,r&&F3(CL(e,R,R,0,0,i,s,T,i,A=[],h),I),i,I,h,s,r?A:I);break;default:o4(D,R,R,R,[""],I,0,s,I)}}u=d=y=0,S=k=1,T=D="",h=a;break;case 58:h=1+Bl(D),y=b;default:if(S<1){if(_==123)--S;else if(_==125&&S++==0&&fne()==125)continue}switch(D+=bS(_),_*S){case 38:k=d>0?1:(D+="\f",-1);break;case 44:s[u++]=(Bl(D)-1)*k,k=1;break;case 64:Yl()===45&&(D+=i4(Pa())),m=Yl(),d=h=Bl(T=D+=mne(r4())),_++;break;case 45:b===45&&Bl(D)==2&&(S=0)}}return o}function CL(e,t,n,r,i,o,a,s,l,u,d){for(var h=i-1,m=i===0?o:[""],y=x_(m),b=0,S=0,E=0;b0?m[k]+" "+_:An(_,/&\f/g,m[k])))&&(l[E++]=T);return xS(e,t,n,i===0?b_:s,l,u,d)}function yne(e,t,n){return xS(e,t,n,wj,bS(dne()),g2(e,2,-2),0)}function _L(e,t,n,r){return xS(e,t,n,S_,g2(e,0,r),g2(e,r+1,-1),r)}function hm(e,t){for(var n="",r=x_(e),i=0;i6)switch(Wi(e,t+1)){case 109:if(Wi(e,t+4)!==45)break;case 102:return An(e,/(.+:)(.+)-([^]+)/,"$1"+Cn+"$2-$3$1"+W4+(Wi(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~i7(e,"stretch")?Lj(An(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Wi(e,t+1)!==115)break;case 6444:switch(Wi(e,Bl(e)-3-(~i7(e,"!important")&&10))){case 107:return An(e,":",":"+Cn)+e;case 101:return An(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Cn+(Wi(e,14)===45?"inline-":"")+"box$3$1"+Cn+"$2$3$1"+eo+"$2box$3")+e}break;case 5936:switch(Wi(e,t+11)){case 114:return Cn+e+eo+An(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Cn+e+eo+An(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Cn+e+eo+An(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Cn+e+eo+e+e}return e}var Pne=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case S_:t.return=Lj(t.value,t.length);break;case Cj:return hm([$1(t,{value:An(t.value,"@","@"+Cn)})],i);case b_:if(t.length)return cne(t.props,function(o){switch(une(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return hm([$1(t,{props:[An(o,/:(read-\w+)/,":"+W4+"$1")]})],i);case"::placeholder":return hm([$1(t,{props:[An(o,/:(plac\w+)/,":"+Cn+"input-$1")]}),$1(t,{props:[An(o,/:(plac\w+)/,":"+W4+"$1")]}),$1(t,{props:[An(o,/:(plac\w+)/,eo+"input-$1")]})],i)}return""})}},Tne=[Pne],Aj=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(S){var E=S.getAttribute("data-emotion");E.indexOf(" ")!==-1&&(document.head.appendChild(S),S.setAttribute("data-s",""))})}var i=t.stylisPlugins||Tne,o={},a,s=[];a=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(S){for(var E=S.getAttribute("data-emotion").split(" "),k=1;k=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var $ne={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},zne=/[A-Z]|^ms/g,Hne=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Nj=function(t){return t.charCodeAt(1)===45},PL=function(t){return t!=null&&typeof t!="boolean"},qw=Tj(function(e){return Nj(e)?e:e.replace(zne,"-$&").toLowerCase()}),TL=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(Hne,function(r,i,o){return Fl={name:i,styles:o,next:Fl},i})}return $ne[t]!==1&&!Nj(t)&&typeof n=="number"&&n!==0?n+"px":n};function v2(e,t,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return Fl={name:n.name,styles:n.styles,next:Fl},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)Fl={name:r.name,styles:r.styles,next:Fl},r=r.next;var i=n.styles+";";return i}return Vne(e,t,n)}case"function":{if(e!==void 0){var o=Fl,a=n(e);return Fl=o,v2(e,t,a)}break}}if(t==null)return n;var s=t[n];return s!==void 0?s:n}function Vne(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i{t.includes(r)||(n[r]=e[r])}),n}function are(e,t,n,r){const i=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,i,o,a)=>{if(typeof r>"u")return e(r,i,o);t.has(r)||t.set(r,new Map);const s=t.get(r);if(s.has(i))return s.get(i);const l=e(r,i,o,a);return s.set(i,l),l}},Vj=sre(are);function Wj(e,t){const n={};return Object.keys(e).forEach(r=>{const i=e[r];t(i,r,e)&&(n[r]=i)}),n}var Uj=e=>Wj(e,t=>t!=null);function lre(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var ure=lre();function Gj(e,...t){return ire(e)?e(...t):e}function cre(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function dre(e={}){const{strict:t=!0,errorMessage:n="useContext: `context` is undefined. Seems you forgot to wrap component within the Provider",name:r}=e,i=w.createContext(void 0);i.displayName=r;function o(){var a;const s=w.useContext(i);if(!s&&t){const l=new Error(n);throw l.name="ContextError",(a=Error.captureStackTrace)==null||a.call(Error,l,o),l}return s}return[i.Provider,o,i]}var fre=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,hre=Tj(function(e){return fre.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),pre=hre,gre=function(t){return t!=="theme"},ML=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?pre:gre},IL=function(t,n,r){var i;if(n){var o=n.shouldForwardProp;i=t.__emotion_forwardProp&&o?function(a){return t.__emotion_forwardProp(a)&&o(a)}:o}return typeof i!="function"&&r&&(i=t.__emotion_forwardProp),i},mre=function(t){var n=t.cache,r=t.serialized,i=t.isStringTag;return Rj(n,r,i),Une(function(){return Dj(n,r,i)}),null},vre=function e(t,n){var r=t.__emotion_real===t,i=r&&t.__emotion_base||t,o,a;n!==void 0&&(o=n.label,a=n.target);var s=IL(t,n,r),l=s||ML(i),u=!l("as");return function(){var d=arguments,h=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(o!==void 0&&h.push("label:"+o+";"),d[0]==null||d[0].raw===void 0)h.push.apply(h,d);else{h.push(d[0][0]);for(var m=d.length,y=1;y[h,m.selector]))}function s(){return Object.fromEntries(Object.entries(t).map(([h,m])=>[h,m.className]))}function l(d){const y=`chakra-${(["container","root"].includes(d??"")?[e]:[e,d]).filter(Boolean).join("__")}`;return{className:y,selector:`.${y}`,toString:()=>d}}return{parts:i,toPart:l,extend:o,selectors:a,classnames:s,get keys(){return Object.keys(t)},__type:{}}}var bre=On("accordion").parts("root","container","button","panel").extend("icon"),Sre=On("alert").parts("title","description","container").extend("icon","spinner"),xre=On("avatar").parts("label","badge","container").extend("excessLabel","group"),wre=On("breadcrumb").parts("link","item","container").extend("separator");On("button").parts();var Cre=On("checkbox").parts("control","icon","container").extend("label");On("progress").parts("track","filledTrack").extend("label");var _re=On("drawer").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),kre=On("editable").parts("preview","input","textarea"),Ere=On("form").parts("container","requiredIndicator","helperText"),Pre=On("formError").parts("text","icon"),Tre=On("input").parts("addon","field","element"),Lre=On("list").parts("container","item","icon"),Are=On("menu").parts("button","list","item").extend("groupTitle","command","divider"),Ore=On("modal").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),Mre=On("numberinput").parts("root","field","stepperGroup","stepper");On("pininput").parts("field");var Ire=On("popover").parts("content","header","body","footer").extend("popper","arrow","closeButton"),Rre=On("progress").parts("label","filledTrack","track"),Dre=On("radio").parts("container","control","label"),Nre=On("select").parts("field","icon"),jre=On("slider").parts("container","track","thumb","filledTrack","mark"),Bre=On("stat").parts("container","label","helpText","number","icon"),Fre=On("switch").parts("container","track","thumb"),$re=On("table").parts("table","thead","tbody","tr","th","td","tfoot","caption"),zre=On("tabs").parts("root","tab","tablist","tabpanel","tabpanels","indicator"),Hre=On("tag").parts("container","label","closeButton"),Vre=On("card").parts("container","header","body","footer");function Ui(e,t){Wre(e)&&(e="100%");var n=Ure(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/parseFloat(String(t)):e=e%t/parseFloat(String(t)),e)}function $3(e){return Math.min(1,Math.max(0,e))}function Wre(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function Ure(e){return typeof e=="string"&&e.indexOf("%")!==-1}function qj(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function z3(e){return e<=1?"".concat(Number(e)*100,"%"):e}function wh(e){return e.length===1?"0"+e:String(e)}function Gre(e,t,n){return{r:Ui(e,255)*255,g:Ui(t,255)*255,b:Ui(n,255)*255}}function RL(e,t,n){e=Ui(e,255),t=Ui(t,255),n=Ui(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),o=0,a=0,s=(r+i)/2;if(r===i)a=0,o=0;else{var l=r-i;switch(a=s>.5?l/(2-r-i):l/(r+i),r){case e:o=(t-n)/l+(t1&&(n-=1),n<1/6?e+(t-e)*(6*n):n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function qre(e,t,n){var r,i,o;if(e=Ui(e,360),t=Ui(t,100),n=Ui(n,100),t===0)i=n,o=n,r=n;else{var a=n<.5?n*(1+t):n+t-n*t,s=2*n-a;r=Yw(s,a,e+1/3),i=Yw(s,a,e),o=Yw(s,a,e-1/3)}return{r:r*255,g:i*255,b:o*255}}function DL(e,t,n){e=Ui(e,255),t=Ui(t,255),n=Ui(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),o=0,a=r,s=r-i,l=r===0?0:s/r;if(r===i)o=0;else{switch(r){case e:o=(t-n)/s+(t>16,g:(e&65280)>>8,b:e&255}}var c7={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function Qre(e){var t={r:0,g:0,b:0},n=1,r=null,i=null,o=null,a=!1,s=!1;return typeof e=="string"&&(e=tie(e)),typeof e=="object"&&(ju(e.r)&&ju(e.g)&&ju(e.b)?(t=Gre(e.r,e.g,e.b),a=!0,s=String(e.r).substr(-1)==="%"?"prgb":"rgb"):ju(e.h)&&ju(e.s)&&ju(e.v)?(r=z3(e.s),i=z3(e.v),t=Yre(e.h,r,i),a=!0,s="hsv"):ju(e.h)&&ju(e.s)&&ju(e.l)&&(r=z3(e.s),o=z3(e.l),t=qre(e.h,r,o),a=!0,s="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=qj(n),{ok:a,format:e.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}var Jre="[-\\+]?\\d+%?",eie="[-\\+]?\\d*\\.\\d+%?",xd="(?:".concat(eie,")|(?:").concat(Jre,")"),Kw="[\\s|\\(]+(".concat(xd,")[,|\\s]+(").concat(xd,")[,|\\s]+(").concat(xd,")\\s*\\)?"),Xw="[\\s|\\(]+(".concat(xd,")[,|\\s]+(").concat(xd,")[,|\\s]+(").concat(xd,")[,|\\s]+(").concat(xd,")\\s*\\)?"),Ds={CSS_UNIT:new RegExp(xd),rgb:new RegExp("rgb"+Kw),rgba:new RegExp("rgba"+Xw),hsl:new RegExp("hsl"+Kw),hsla:new RegExp("hsla"+Xw),hsv:new RegExp("hsv"+Kw),hsva:new RegExp("hsva"+Xw),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function tie(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(c7[e])e=c7[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n=Ds.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=Ds.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=Ds.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=Ds.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=Ds.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=Ds.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=Ds.hex8.exec(e),n?{r:Ca(n[1]),g:Ca(n[2]),b:Ca(n[3]),a:jL(n[4]),format:t?"name":"hex8"}:(n=Ds.hex6.exec(e),n?{r:Ca(n[1]),g:Ca(n[2]),b:Ca(n[3]),format:t?"name":"hex"}:(n=Ds.hex4.exec(e),n?{r:Ca(n[1]+n[1]),g:Ca(n[2]+n[2]),b:Ca(n[3]+n[3]),a:jL(n[4]+n[4]),format:t?"name":"hex8"}:(n=Ds.hex3.exec(e),n?{r:Ca(n[1]+n[1]),g:Ca(n[2]+n[2]),b:Ca(n[3]+n[3]),format:t?"name":"hex"}:!1)))))))))}function ju(e){return Boolean(Ds.CSS_UNIT.exec(String(e)))}var hy=function(){function e(t,n){t===void 0&&(t=""),n===void 0&&(n={});var r;if(t instanceof e)return t;typeof t=="number"&&(t=Zre(t)),this.originalInput=t;var i=Qre(t);this.originalInput=t,this.r=i.r,this.g=i.g,this.b=i.b,this.a=i.a,this.roundA=Math.round(100*this.a)/100,this.format=(r=n.format)!==null&&r!==void 0?r:i.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=i.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},e.prototype.getLuminance=function(){var t=this.toRgb(),n,r,i,o=t.r/255,a=t.g/255,s=t.b/255;return o<=.03928?n=o/12.92:n=Math.pow((o+.055)/1.055,2.4),a<=.03928?r=a/12.92:r=Math.pow((a+.055)/1.055,2.4),s<=.03928?i=s/12.92:i=Math.pow((s+.055)/1.055,2.4),.2126*n+.7152*r+.0722*i},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(t){return this.a=qj(t),this.roundA=Math.round(100*this.a)/100,this},e.prototype.toHsv=function(){var t=DL(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}},e.prototype.toHsvString=function(){var t=DL(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),i=Math.round(t.v*100);return this.a===1?"hsv(".concat(n,", ").concat(r,"%, ").concat(i,"%)"):"hsva(".concat(n,", ").concat(r,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var t=RL(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}},e.prototype.toHslString=function(){var t=RL(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),i=Math.round(t.l*100);return this.a===1?"hsl(".concat(n,", ").concat(r,"%, ").concat(i,"%)"):"hsla(".concat(n,", ").concat(r,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(t){return t===void 0&&(t=!1),NL(this.r,this.g,this.b,t)},e.prototype.toHexString=function(t){return t===void 0&&(t=!1),"#"+this.toHex(t)},e.prototype.toHex8=function(t){return t===void 0&&(t=!1),Kre(this.r,this.g,this.b,this.a,t)},e.prototype.toHex8String=function(t){return t===void 0&&(t=!1),"#"+this.toHex8(t)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var t=Math.round(this.r),n=Math.round(this.g),r=Math.round(this.b);return this.a===1?"rgb(".concat(t,", ").concat(n,", ").concat(r,")"):"rgba(".concat(t,", ").concat(n,", ").concat(r,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var t=function(n){return"".concat(Math.round(Ui(n,255)*100),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var t=function(n){return Math.round(Ui(n,255)*100)};return this.a===1?"rgb(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%)"):"rgba(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var t="#"+NL(this.r,this.g,this.b,!1),n=0,r=Object.entries(c7);n=0,o=!n&&i&&(t.startsWith("hex")||t==="name");return o?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l+=t/100,n.l=$3(n.l),new e(n)},e.prototype.brighten=function(t){t===void 0&&(t=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),new e(n)},e.prototype.darken=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l-=t/100,n.l=$3(n.l),new e(n)},e.prototype.tint=function(t){return t===void 0&&(t=10),this.mix("white",t)},e.prototype.shade=function(t){return t===void 0&&(t=10),this.mix("black",t)},e.prototype.desaturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s-=t/100,n.s=$3(n.s),new e(n)},e.prototype.saturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s+=t/100,n.s=$3(n.s),new e(n)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var n=this.toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,new e(n)},e.prototype.mix=function(t,n){n===void 0&&(n=50);var r=this.toRgb(),i=new e(t).toRgb(),o=n/100,a={r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a};return new e(a)},e.prototype.analogous=function(t,n){t===void 0&&(t=6),n===void 0&&(n=30);var r=this.toHsl(),i=360/n,o=[this];for(r.h=(r.h-(i*t>>1)+720)%360;--t;)r.h=(r.h+i)%360,o.push(new e(r));return o},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){t===void 0&&(t=6);for(var n=this.toHsv(),r=n.h,i=n.s,o=n.v,a=[],s=1/t;t--;)a.push(new e({h:r,s:i,v:o})),o=(o+s)%1;return a},e.prototype.splitcomplement=function(){var t=this.toHsl(),n=t.h;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var n=this.toRgb(),r=new e(t).toRgb();return new e({r:r.r+(n.r-r.r)*n.a,g:r.g+(n.g-r.g)*n.a,b:r.b+(n.b-r.b)*n.a})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var n=this.toHsl(),r=n.h,i=[this],o=360/t,a=1;an.length;)e.count=null,e.seed&&(e.seed+=1),n.push(Yj(e));return e.count=t,n}var r=nie(e.hue,e.seed),i=rie(r,e),o=iie(r,i,e),a={h:r,s:i,v:o};return e.alpha!==void 0&&(a.a=e.alpha),new hy(a)}function nie(e,t){var n=aie(e),r=U4(n,t);return r<0&&(r=360+r),r}function rie(e,t){if(t.hue==="monochrome")return 0;if(t.luminosity==="random")return U4([0,100],t.seed);var n=Kj(e).saturationRange,r=n[0],i=n[1];switch(t.luminosity){case"bright":r=55;break;case"dark":r=i-10;break;case"light":i=55;break}return U4([r,i],t.seed)}function iie(e,t,n){var r=oie(e,t),i=100;switch(n.luminosity){case"dark":i=r+20;break;case"light":r=(i+r)/2;break;case"random":r=0,i=100;break}return U4([r,i],n.seed)}function oie(e,t){for(var n=Kj(e).lowerBounds,r=0;r=i&&t<=a){var l=(s-o)/(a-i),u=o-l*i;return l*t+u}}return 0}function aie(e){var t=parseInt(e,10);if(!Number.isNaN(t)&&t<360&&t>0)return[t,t];if(typeof e=="string"){var n=Zj.find(function(a){return a.name===e});if(n){var r=Xj(n);if(r.hueRange)return r.hueRange}var i=new hy(e);if(i.isValid){var o=i.toHsv().h;return[o,o]}}return[0,360]}function Kj(e){e>=334&&e<=360&&(e-=360);for(var t=0,n=Zj;t=i.hueRange[0]&&e<=i.hueRange[1])return i}throw Error("Color not found")}function U4(e,t){if(t===void 0)return Math.floor(e[0]+Math.random()*(e[1]+1-e[0]));var n=e[1]||1,r=e[0]||0;t=(t*9301+49297)%233280;var i=t/233280;return Math.floor(r+i*(n-r))}function Xj(e){var t=e.lowerBounds[0][0],n=e.lowerBounds[e.lowerBounds.length-1][0],r=e.lowerBounds[e.lowerBounds.length-1][1],i=e.lowerBounds[0][1];return{name:e.name,hueRange:e.hueRange,lowerBounds:e.lowerBounds,saturationRange:[t,n],brightnessRange:[r,i]}}var Zj=[{name:"monochrome",hueRange:null,lowerBounds:[[0,0],[100,0]]},{name:"red",hueRange:[-26,18],lowerBounds:[[20,100],[30,92],[40,89],[50,85],[60,78],[70,70],[80,60],[90,55],[100,50]]},{name:"orange",hueRange:[19,46],lowerBounds:[[20,100],[30,93],[40,88],[50,86],[60,85],[70,70],[100,70]]},{name:"yellow",hueRange:[47,62],lowerBounds:[[25,100],[40,94],[50,89],[60,86],[70,84],[80,82],[90,80],[100,75]]},{name:"green",hueRange:[63,178],lowerBounds:[[30,100],[40,90],[50,85],[60,81],[70,74],[80,64],[90,50],[100,40]]},{name:"blue",hueRange:[179,257],lowerBounds:[[20,100],[30,86],[40,80],[50,74],[60,60],[70,52],[80,44],[90,39],[100,35]]},{name:"purple",hueRange:[258,282],lowerBounds:[[20,100],[30,87],[40,79],[50,70],[60,65],[70,59],[80,52],[90,45],[100,42]]},{name:"pink",hueRange:[283,334],lowerBounds:[[20,100],[30,90],[40,86],[60,84],[80,80],[90,75],[100,73]]}];function sie(e,t,n,r,i){for(t=t.split?t.split("."):t,r=0;rObject.keys(e).length===0,Co=(e,t,n)=>{const r=sie(e,`colors.${t}`,t),{isValid:i}=new hy(r);return i?r:n},uie=e=>t=>{const n=Co(t,e);return new hy(n).isDark()?"dark":"light"},cie=e=>t=>uie(e)(t)==="dark",Hm=(e,t)=>n=>{const r=Co(n,e);return new hy(r).setAlpha(t).toRgbString()};function BL(e="1rem",t="rgba(255, 255, 255, 0.15)"){return{backgroundImage:`linear-gradient( + 45deg, + ${t} 25%, + transparent 25%, + transparent 50%, + ${t} 50%, + ${t} 75%, + transparent 75%, + transparent + )`,backgroundSize:`${e} ${e}`}}function die(e){const t=Yj().toHexString();return!e||lie(e)?t:e.string&&e.colors?hie(e.string,e.colors):e.string&&!e.colors?fie(e.string):e.colors&&!e.string?pie(e.colors):t}function fie(e){let t=0;if(e.length===0)return t.toString();for(let r=0;r>r*8&255;n+=`00${i.toString(16)}`.substr(-2)}return n}function hie(e,t){let n=0;if(e.length===0)return t[0];for(let r=0;rn.colorMode==="dark"?t:e}function P_(e){const{orientation:t,vertical:n,horizontal:r}=e;return t?t==="vertical"?n:r:{}}function gie(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}function Qj(e){return gie(e)&&e.reference?e.reference:String(e)}var RS=(e,...t)=>t.map(Qj).join(` ${e} `).replace(/calc/g,""),FL=(...e)=>`calc(${RS("+",...e)})`,$L=(...e)=>`calc(${RS("-",...e)})`,d7=(...e)=>`calc(${RS("*",...e)})`,zL=(...e)=>`calc(${RS("/",...e)})`,HL=e=>{const t=Qj(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:d7(t,-1)},Vu=Object.assign(e=>({add:(...t)=>Vu(FL(e,...t)),subtract:(...t)=>Vu($L(e,...t)),multiply:(...t)=>Vu(d7(e,...t)),divide:(...t)=>Vu(zL(e,...t)),negate:()=>Vu(HL(e)),toString:()=>e.toString()}),{add:FL,subtract:$L,multiply:d7,divide:zL,negate:HL});function mie(e){return!Number.isInteger(parseFloat(e.toString()))}function vie(e,t="-"){return e.replace(/\s+/g,t)}function Jj(e){const t=vie(e.toString());return t.includes("\\.")?e:mie(e)?t.replace(".","\\."):e}function yie(e,t=""){return[t,Jj(e)].filter(Boolean).join("-")}function bie(e,t){return`var(${Jj(e)}${t?`, ${t}`:""})`}function Sie(e,t=""){return`--${yie(e,t)}`}function yi(e,t){const n=Sie(e,t==null?void 0:t.prefix);return{variable:n,reference:bie(n,xie(t==null?void 0:t.fallback))}}function xie(e){return typeof e=="string"?e:e==null?void 0:e.reference}var{definePartsStyle:wie,defineMultiStyleConfig:Cie}=hr(bre.keys),_ie={borderTopWidth:"1px",borderColor:"inherit",_last:{borderBottomWidth:"1px"}},kie={transitionProperty:"common",transitionDuration:"normal",fontSize:"md",_focusVisible:{boxShadow:"outline"},_hover:{bg:"blackAlpha.50"},_disabled:{opacity:.4,cursor:"not-allowed"},px:"4",py:"2"},Eie={pt:"2",px:"4",pb:"5"},Pie={fontSize:"1.25em"},Tie=wie({container:_ie,button:kie,panel:Eie,icon:Pie}),Lie=Cie({baseStyle:Tie}),{definePartsStyle:py,defineMultiStyleConfig:Aie}=hr(Sre.keys),Ta=Vn("alert-fg"),Qu=Vn("alert-bg"),Oie=py({container:{bg:Qu.reference,px:"4",py:"3"},title:{fontWeight:"bold",lineHeight:"6",marginEnd:"2"},description:{lineHeight:"6"},icon:{color:Ta.reference,flexShrink:0,marginEnd:"3",w:"5",h:"6"},spinner:{color:Ta.reference,flexShrink:0,marginEnd:"3",w:"5",h:"5"}});function T_(e){const{theme:t,colorScheme:n}=e,r=Hm(`${n}.200`,.16)(t);return{light:`colors.${n}.100`,dark:r}}var Mie=py(e=>{const{colorScheme:t}=e,n=T_(e);return{container:{[Ta.variable]:`colors.${t}.500`,[Qu.variable]:n.light,_dark:{[Ta.variable]:`colors.${t}.200`,[Qu.variable]:n.dark}}}}),Iie=py(e=>{const{colorScheme:t}=e,n=T_(e);return{container:{[Ta.variable]:`colors.${t}.500`,[Qu.variable]:n.light,_dark:{[Ta.variable]:`colors.${t}.200`,[Qu.variable]:n.dark},paddingStart:"3",borderStartWidth:"4px",borderStartColor:Ta.reference}}}),Rie=py(e=>{const{colorScheme:t}=e,n=T_(e);return{container:{[Ta.variable]:`colors.${t}.500`,[Qu.variable]:n.light,_dark:{[Ta.variable]:`colors.${t}.200`,[Qu.variable]:n.dark},pt:"2",borderTopWidth:"4px",borderTopColor:Ta.reference}}}),Die=py(e=>{const{colorScheme:t}=e;return{container:{[Ta.variable]:"colors.white",[Qu.variable]:`colors.${t}.500`,_dark:{[Ta.variable]:"colors.gray.900",[Qu.variable]:`colors.${t}.200`},color:Ta.reference}}}),Nie={subtle:Mie,"left-accent":Iie,"top-accent":Rie,solid:Die},jie=Aie({baseStyle:Oie,variants:Nie,defaultProps:{variant:"subtle",colorScheme:"blue"}}),eB={px:"1px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},Bie={max:"max-content",min:"min-content",full:"100%","3xs":"14rem","2xs":"16rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem","8xl":"90rem",prose:"60ch"},Fie={sm:"640px",md:"768px",lg:"1024px",xl:"1280px"},$ie={...eB,...Bie,container:Fie},tB=$ie,zie=e=>typeof e=="function";function Eo(e,...t){return zie(e)?e(...t):e}var{definePartsStyle:nB,defineMultiStyleConfig:Hie}=hr(xre.keys),pm=Vn("avatar-border-color"),Zw=Vn("avatar-bg"),Vie={borderRadius:"full",border:"0.2em solid",[pm.variable]:"white",_dark:{[pm.variable]:"colors.gray.800"},borderColor:pm.reference},Wie={[Zw.variable]:"colors.gray.200",_dark:{[Zw.variable]:"colors.whiteAlpha.400"},bgColor:Zw.reference},VL=Vn("avatar-background"),Uie=e=>{const{name:t,theme:n}=e,r=t?die({string:t}):"colors.gray.400",i=cie(r)(n);let o="white";return i||(o="gray.800"),{bg:VL.reference,"&:not([data-loaded])":{[VL.variable]:r},color:o,[pm.variable]:"colors.white",_dark:{[pm.variable]:"colors.gray.800"},borderColor:pm.reference,verticalAlign:"top"}},Gie=nB(e=>({badge:Eo(Vie,e),excessLabel:Eo(Wie,e),container:Eo(Uie,e)}));function od(e){const t=e!=="100%"?tB[e]:void 0;return nB({container:{width:e,height:e,fontSize:`calc(${t??e} / 2.5)`},excessLabel:{width:e,height:e},label:{fontSize:`calc(${t??e} / 2.5)`,lineHeight:e!=="100%"?t??e:void 0}})}var qie={"2xs":od(4),xs:od(6),sm:od(8),md:od(12),lg:od(16),xl:od(24),"2xl":od(32),full:od("100%")},Yie=Hie({baseStyle:Gie,sizes:qie,defaultProps:{size:"md"}}),Kie={px:1,textTransform:"uppercase",fontSize:"xs",borderRadius:"sm",fontWeight:"bold"},gm=Vn("badge-bg"),Ul=Vn("badge-color"),Xie=e=>{const{colorScheme:t,theme:n}=e,r=Hm(`${t}.500`,.6)(n);return{[gm.variable]:`colors.${t}.500`,[Ul.variable]:"colors.white",_dark:{[gm.variable]:r,[Ul.variable]:"colors.whiteAlpha.800"},bg:gm.reference,color:Ul.reference}},Zie=e=>{const{colorScheme:t,theme:n}=e,r=Hm(`${t}.200`,.16)(n);return{[gm.variable]:`colors.${t}.100`,[Ul.variable]:`colors.${t}.800`,_dark:{[gm.variable]:r,[Ul.variable]:`colors.${t}.200`},bg:gm.reference,color:Ul.reference}},Qie=e=>{const{colorScheme:t,theme:n}=e,r=Hm(`${t}.200`,.8)(n);return{[Ul.variable]:`colors.${t}.500`,_dark:{[Ul.variable]:r},color:Ul.reference,boxShadow:`inset 0 0 0px 1px ${Ul.reference}`}},Jie={solid:Xie,subtle:Zie,outline:Qie},Nv={baseStyle:Kie,variants:Jie,defaultProps:{variant:"subtle",colorScheme:"gray"}},{defineMultiStyleConfig:eoe,definePartsStyle:toe}=hr(wre.keys),noe={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},roe=toe({link:noe}),ioe=eoe({baseStyle:roe}),ooe={lineHeight:"1.2",borderRadius:"md",fontWeight:"semibold",transitionProperty:"common",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{_disabled:{bg:"initial"}}},rB=e=>{const{colorScheme:t,theme:n}=e;if(t==="gray")return{color:Et("inherit","whiteAlpha.900")(e),_hover:{bg:Et("gray.100","whiteAlpha.200")(e)},_active:{bg:Et("gray.200","whiteAlpha.300")(e)}};const r=Hm(`${t}.200`,.12)(n),i=Hm(`${t}.200`,.24)(n);return{color:Et(`${t}.600`,`${t}.200`)(e),bg:"transparent",_hover:{bg:Et(`${t}.50`,r)(e)},_active:{bg:Et(`${t}.100`,i)(e)}}},aoe=e=>{const{colorScheme:t}=e,n=Et("gray.200","whiteAlpha.300")(e);return{border:"1px solid",borderColor:t==="gray"?n:"currentColor",".chakra-button__group[data-attached] > &:not(:last-of-type)":{marginEnd:"-1px"},...Eo(rB,e)}},soe={yellow:{bg:"yellow.400",color:"black",hoverBg:"yellow.500",activeBg:"yellow.600"},cyan:{bg:"cyan.400",color:"black",hoverBg:"cyan.500",activeBg:"cyan.600"}},loe=e=>{const{colorScheme:t}=e;if(t==="gray"){const s=Et("gray.100","whiteAlpha.200")(e);return{bg:s,_hover:{bg:Et("gray.200","whiteAlpha.300")(e),_disabled:{bg:s}},_active:{bg:Et("gray.300","whiteAlpha.400")(e)}}}const{bg:n=`${t}.500`,color:r="white",hoverBg:i=`${t}.600`,activeBg:o=`${t}.700`}=soe[t]??{},a=Et(n,`${t}.200`)(e);return{bg:a,color:Et(r,"gray.800")(e),_hover:{bg:Et(i,`${t}.300`)(e),_disabled:{bg:a}},_active:{bg:Et(o,`${t}.400`)(e)}}},uoe=e=>{const{colorScheme:t}=e;return{padding:0,height:"auto",lineHeight:"normal",verticalAlign:"baseline",color:Et(`${t}.500`,`${t}.200`)(e),_hover:{textDecoration:"underline",_disabled:{textDecoration:"none"}},_active:{color:Et(`${t}.700`,`${t}.500`)(e)}}},coe={bg:"none",color:"inherit",display:"inline",lineHeight:"inherit",m:"0",p:"0"},doe={ghost:rB,outline:aoe,solid:loe,link:uoe,unstyled:coe},foe={lg:{h:"12",minW:"12",fontSize:"lg",px:"6"},md:{h:"10",minW:"10",fontSize:"md",px:"4"},sm:{h:"8",minW:"8",fontSize:"sm",px:"3"},xs:{h:"6",minW:"6",fontSize:"xs",px:"2"}},hoe={baseStyle:ooe,variants:doe,sizes:foe,defaultProps:{variant:"solid",size:"md",colorScheme:"gray"}},{definePartsStyle:Ah,defineMultiStyleConfig:poe}=hr(Vre.keys),G4=Vn("card-bg"),mm=Vn("card-padding"),goe=Ah({container:{[G4.variable]:"chakra-body-bg",backgroundColor:G4.reference,color:"chakra-body-text"},body:{padding:mm.reference,flex:"1 1 0%"},header:{padding:mm.reference},footer:{padding:mm.reference}}),moe={sm:Ah({container:{borderRadius:"base",[mm.variable]:"space.3"}}),md:Ah({container:{borderRadius:"md",[mm.variable]:"space.5"}}),lg:Ah({container:{borderRadius:"xl",[mm.variable]:"space.7"}})},voe={elevated:Ah({container:{boxShadow:"base",_dark:{[G4.variable]:"colors.gray.700"}}}),outline:Ah({container:{borderWidth:"1px",borderColor:"chakra-border-color"}}),filled:Ah({container:{[G4.variable]:"colors.chakra-subtle-bg"}}),unstyled:{body:{padding:0},header:{padding:0},footer:{padding:0}}},yoe=poe({baseStyle:goe,variants:voe,sizes:moe,defaultProps:{variant:"elevated",size:"md"}}),{definePartsStyle:a4,defineMultiStyleConfig:boe}=hr(Cre.keys),jv=Vn("checkbox-size"),Soe=e=>{const{colorScheme:t}=e;return{w:jv.reference,h:jv.reference,transitionProperty:"box-shadow",transitionDuration:"normal",border:"2px solid",borderRadius:"sm",borderColor:"inherit",color:"white",_checked:{bg:Et(`${t}.500`,`${t}.200`)(e),borderColor:Et(`${t}.500`,`${t}.200`)(e),color:Et("white","gray.900")(e),_hover:{bg:Et(`${t}.600`,`${t}.300`)(e),borderColor:Et(`${t}.600`,`${t}.300`)(e)},_disabled:{borderColor:Et("gray.200","transparent")(e),bg:Et("gray.200","whiteAlpha.300")(e),color:Et("gray.500","whiteAlpha.500")(e)}},_indeterminate:{bg:Et(`${t}.500`,`${t}.200`)(e),borderColor:Et(`${t}.500`,`${t}.200`)(e),color:Et("white","gray.900")(e)},_disabled:{bg:Et("gray.100","whiteAlpha.100")(e),borderColor:Et("gray.100","transparent")(e)},_focusVisible:{boxShadow:"outline"},_invalid:{borderColor:Et("red.500","red.300")(e)}}},xoe={_disabled:{cursor:"not-allowed"}},woe={userSelect:"none",_disabled:{opacity:.4}},Coe={transitionProperty:"transform",transitionDuration:"normal"},_oe=a4(e=>({icon:Coe,container:xoe,control:Eo(Soe,e),label:woe})),koe={sm:a4({control:{[jv.variable]:"sizes.3"},label:{fontSize:"sm"},icon:{fontSize:"3xs"}}),md:a4({control:{[jv.variable]:"sizes.4"},label:{fontSize:"md"},icon:{fontSize:"2xs"}}),lg:a4({control:{[jv.variable]:"sizes.5"},label:{fontSize:"lg"},icon:{fontSize:"2xs"}})},q4=boe({baseStyle:_oe,sizes:koe,defaultProps:{size:"md",colorScheme:"blue"}}),Bv=yi("close-button-size"),z1=yi("close-button-bg"),Eoe={w:[Bv.reference],h:[Bv.reference],borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{[z1.variable]:"colors.blackAlpha.100",_dark:{[z1.variable]:"colors.whiteAlpha.100"}},_active:{[z1.variable]:"colors.blackAlpha.200",_dark:{[z1.variable]:"colors.whiteAlpha.200"}},_focusVisible:{boxShadow:"outline"},bg:z1.reference},Poe={lg:{[Bv.variable]:"sizes.10",fontSize:"md"},md:{[Bv.variable]:"sizes.8",fontSize:"xs"},sm:{[Bv.variable]:"sizes.6",fontSize:"2xs"}},Toe={baseStyle:Eoe,sizes:Poe,defaultProps:{size:"md"}},{variants:Loe,defaultProps:Aoe}=Nv,Ooe={fontFamily:"mono",fontSize:"sm",px:"0.2em",borderRadius:"sm"},Moe={baseStyle:Ooe,variants:Loe,defaultProps:Aoe},Ioe={w:"100%",mx:"auto",maxW:"prose",px:"4"},Roe={baseStyle:Ioe},Doe={opacity:.6,borderColor:"inherit"},Noe={borderStyle:"solid"},joe={borderStyle:"dashed"},Boe={solid:Noe,dashed:joe},Foe={baseStyle:Doe,variants:Boe,defaultProps:{variant:"solid"}},{definePartsStyle:f7,defineMultiStyleConfig:$oe}=hr(_re.keys),Qw=Vn("drawer-bg"),Jw=Vn("drawer-box-shadow");function xg(e){return f7(e==="full"?{dialog:{maxW:"100vw",h:"100vh"}}:{dialog:{maxW:e}})}var zoe={bg:"blackAlpha.600",zIndex:"overlay"},Hoe={display:"flex",zIndex:"modal",justifyContent:"center"},Voe=e=>{const{isFullHeight:t}=e;return{...t&&{height:"100vh"},zIndex:"modal",maxH:"100vh",color:"inherit",[Qw.variable]:"colors.white",[Jw.variable]:"shadows.lg",_dark:{[Qw.variable]:"colors.gray.700",[Jw.variable]:"shadows.dark-lg"},bg:Qw.reference,boxShadow:Jw.reference}},Woe={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},Uoe={position:"absolute",top:"2",insetEnd:"3"},Goe={px:"6",py:"2",flex:"1",overflow:"auto"},qoe={px:"6",py:"4"},Yoe=f7(e=>({overlay:zoe,dialogContainer:Hoe,dialog:Eo(Voe,e),header:Woe,closeButton:Uoe,body:Goe,footer:qoe})),Koe={xs:xg("xs"),sm:xg("md"),md:xg("lg"),lg:xg("2xl"),xl:xg("4xl"),full:xg("full")},Xoe=$oe({baseStyle:Yoe,sizes:Koe,defaultProps:{size:"xs"}}),{definePartsStyle:Zoe,defineMultiStyleConfig:Qoe}=hr(kre.keys),Joe={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal"},eae={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},tae={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},nae=Zoe({preview:Joe,input:eae,textarea:tae}),rae=Qoe({baseStyle:nae}),{definePartsStyle:iae,defineMultiStyleConfig:oae}=hr(Ere.keys),vm=Vn("form-control-color"),aae={marginStart:"1",[vm.variable]:"colors.red.500",_dark:{[vm.variable]:"colors.red.300"},color:vm.reference},sae={mt:"2",[vm.variable]:"colors.gray.600",_dark:{[vm.variable]:"colors.whiteAlpha.600"},color:vm.reference,lineHeight:"normal",fontSize:"sm"},lae=iae({container:{width:"100%",position:"relative"},requiredIndicator:aae,helperText:sae}),uae=oae({baseStyle:lae}),{definePartsStyle:cae,defineMultiStyleConfig:dae}=hr(Pre.keys),ym=Vn("form-error-color"),fae={[ym.variable]:"colors.red.500",_dark:{[ym.variable]:"colors.red.300"},color:ym.reference,mt:"2",fontSize:"sm",lineHeight:"normal"},hae={marginEnd:"0.5em",[ym.variable]:"colors.red.500",_dark:{[ym.variable]:"colors.red.300"},color:ym.reference},pae=cae({text:fae,icon:hae}),gae=dae({baseStyle:pae}),mae={fontSize:"md",marginEnd:"3",mb:"2",fontWeight:"medium",transitionProperty:"common",transitionDuration:"normal",opacity:1,_disabled:{opacity:.4}},vae={baseStyle:mae},yae={fontFamily:"heading",fontWeight:"bold"},bae={"4xl":{fontSize:["6xl",null,"7xl"],lineHeight:1},"3xl":{fontSize:["5xl",null,"6xl"],lineHeight:1},"2xl":{fontSize:["4xl",null,"5xl"],lineHeight:[1.2,null,1]},xl:{fontSize:["3xl",null,"4xl"],lineHeight:[1.33,null,1.2]},lg:{fontSize:["2xl",null,"3xl"],lineHeight:[1.33,null,1.2]},md:{fontSize:"xl",lineHeight:1.2},sm:{fontSize:"md",lineHeight:1.2},xs:{fontSize:"sm",lineHeight:1.2}},Sae={baseStyle:yae,sizes:bae,defaultProps:{size:"xl"}},{definePartsStyle:Wu,defineMultiStyleConfig:xae}=hr(Tre.keys),wae=Wu({field:{width:"100%",minWidth:0,outline:0,position:"relative",appearance:"none",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed"}}}),ad={lg:{fontSize:"lg",px:"4",h:"12",borderRadius:"md"},md:{fontSize:"md",px:"4",h:"10",borderRadius:"md"},sm:{fontSize:"sm",px:"3",h:"8",borderRadius:"sm"},xs:{fontSize:"xs",px:"2",h:"6",borderRadius:"sm"}},Cae={lg:Wu({field:ad.lg,addon:ad.lg}),md:Wu({field:ad.md,addon:ad.md}),sm:Wu({field:ad.sm,addon:ad.sm}),xs:Wu({field:ad.xs,addon:ad.xs})};function L_(e){const{focusBorderColor:t,errorBorderColor:n}=e;return{focusBorderColor:t||Et("blue.500","blue.300")(e),errorBorderColor:n||Et("red.500","red.300")(e)}}var _ae=Wu(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=L_(e);return{field:{border:"1px solid",borderColor:"inherit",bg:"inherit",_hover:{borderColor:Et("gray.300","whiteAlpha.400")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:Co(t,r),boxShadow:`0 0 0 1px ${Co(t,r)}`},_focusVisible:{zIndex:1,borderColor:Co(t,n),boxShadow:`0 0 0 1px ${Co(t,n)}`}},addon:{border:"1px solid",borderColor:Et("inherit","whiteAlpha.50")(e),bg:Et("gray.100","whiteAlpha.300")(e)}}}),kae=Wu(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=L_(e);return{field:{border:"2px solid",borderColor:"transparent",bg:Et("gray.100","whiteAlpha.50")(e),_hover:{bg:Et("gray.200","whiteAlpha.100")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:Co(t,r)},_focusVisible:{bg:"transparent",borderColor:Co(t,n)}},addon:{border:"2px solid",borderColor:"transparent",bg:Et("gray.100","whiteAlpha.50")(e)}}}),Eae=Wu(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=L_(e);return{field:{borderBottom:"1px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent",_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:Co(t,r),boxShadow:`0px 1px 0px 0px ${Co(t,r)}`},_focusVisible:{borderColor:Co(t,n),boxShadow:`0px 1px 0px 0px ${Co(t,n)}`}},addon:{borderBottom:"2px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent"}}}),Pae=Wu({field:{bg:"transparent",px:"0",height:"auto"},addon:{bg:"transparent",px:"0",height:"auto"}}),Tae={outline:_ae,filled:kae,flushed:Eae,unstyled:Pae},_n=xae({baseStyle:wae,sizes:Cae,variants:Tae,defaultProps:{size:"md",variant:"outline"}}),e6=Vn("kbd-bg"),Lae={[e6.variable]:"colors.gray.100",_dark:{[e6.variable]:"colors.whiteAlpha.100"},bg:e6.reference,borderRadius:"md",borderWidth:"1px",borderBottomWidth:"3px",fontSize:"0.8em",fontWeight:"bold",lineHeight:"normal",px:"0.4em",whiteSpace:"nowrap"},Aae={baseStyle:Lae},Oae={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},Mae={baseStyle:Oae},{defineMultiStyleConfig:Iae,definePartsStyle:Rae}=hr(Lre.keys),Dae={marginEnd:"2",display:"inline",verticalAlign:"text-bottom"},Nae=Rae({icon:Dae}),jae=Iae({baseStyle:Nae}),{defineMultiStyleConfig:Bae,definePartsStyle:Fae}=hr(Are.keys),jl=Vn("menu-bg"),t6=Vn("menu-shadow"),$ae={[jl.variable]:"#fff",[t6.variable]:"shadows.sm",_dark:{[jl.variable]:"colors.gray.700",[t6.variable]:"shadows.dark-lg"},color:"inherit",minW:"3xs",py:"2",zIndex:1,borderRadius:"md",borderWidth:"1px",bg:jl.reference,boxShadow:t6.reference},zae={py:"1.5",px:"3",transitionProperty:"background",transitionDuration:"ultra-fast",transitionTimingFunction:"ease-in",_focus:{[jl.variable]:"colors.gray.100",_dark:{[jl.variable]:"colors.whiteAlpha.100"}},_active:{[jl.variable]:"colors.gray.200",_dark:{[jl.variable]:"colors.whiteAlpha.200"}},_expanded:{[jl.variable]:"colors.gray.100",_dark:{[jl.variable]:"colors.whiteAlpha.100"}},_disabled:{opacity:.4,cursor:"not-allowed"},bg:jl.reference},Hae={mx:4,my:2,fontWeight:"semibold",fontSize:"sm"},Vae={opacity:.6},Wae={border:0,borderBottom:"1px solid",borderColor:"inherit",my:"2",opacity:.6},Uae={transitionProperty:"common",transitionDuration:"normal"},Gae=Fae({button:Uae,list:$ae,item:zae,groupTitle:Hae,command:Vae,divider:Wae}),qae=Bae({baseStyle:Gae}),{defineMultiStyleConfig:Yae,definePartsStyle:h7}=hr(Ore.keys),Kae={bg:"blackAlpha.600",zIndex:"modal"},Xae=e=>{const{isCentered:t,scrollBehavior:n}=e;return{display:"flex",zIndex:"modal",justifyContent:"center",alignItems:t?"center":"flex-start",overflow:n==="inside"?"hidden":"auto"}},Zae=e=>{const{scrollBehavior:t}=e;return{borderRadius:"md",bg:Et("white","gray.700")(e),color:"inherit",my:"16",zIndex:"modal",maxH:t==="inside"?"calc(100% - 7.5rem)":void 0,boxShadow:Et("lg","dark-lg")(e)}},Qae={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},Jae={position:"absolute",top:"2",insetEnd:"3"},ese=e=>{const{scrollBehavior:t}=e;return{px:"6",py:"2",flex:"1",overflow:t==="inside"?"auto":void 0}},tse={px:"6",py:"4"},nse=h7(e=>({overlay:Kae,dialogContainer:Eo(Xae,e),dialog:Eo(Zae,e),header:Qae,closeButton:Jae,body:Eo(ese,e),footer:tse}));function Os(e){return h7(e==="full"?{dialog:{maxW:"100vw",minH:"$100vh",my:"0",borderRadius:"0"}}:{dialog:{maxW:e}})}var rse={xs:Os("xs"),sm:Os("sm"),md:Os("md"),lg:Os("lg"),xl:Os("xl"),"2xl":Os("2xl"),"3xl":Os("3xl"),"4xl":Os("4xl"),"5xl":Os("5xl"),"6xl":Os("6xl"),full:Os("full")},ise=Yae({baseStyle:nse,sizes:rse,defaultProps:{size:"md"}}),ose={letterSpacings:{tighter:"-0.05em",tight:"-0.025em",normal:"0",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeights:{normal:"normal",none:1,shorter:1.25,short:1.375,base:1.5,tall:1.625,taller:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},fontWeights:{hairline:100,thin:200,light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800,black:900},fonts:{heading:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',body:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',mono:'SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'},fontSizes:{"3xs":"0.45rem","2xs":"0.625rem",xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem","7xl":"4.5rem","8xl":"6rem","9xl":"8rem"}},iB=ose,{defineMultiStyleConfig:ase,definePartsStyle:oB}=hr(Mre.keys),A_=yi("number-input-stepper-width"),aB=yi("number-input-input-padding"),sse=Vu(A_).add("0.5rem").toString(),n6=yi("number-input-bg"),r6=yi("number-input-color"),i6=yi("number-input-border-color"),lse={[A_.variable]:"sizes.6",[aB.variable]:sse},use=e=>{var t;return((t=Eo(_n.baseStyle,e))==null?void 0:t.field)??{}},cse={width:A_.reference},dse={borderStart:"1px solid",borderStartColor:i6.reference,color:r6.reference,bg:n6.reference,[r6.variable]:"colors.chakra-body-text",[i6.variable]:"colors.chakra-border-color",_dark:{[r6.variable]:"colors.whiteAlpha.800",[i6.variable]:"colors.whiteAlpha.300"},_active:{[n6.variable]:"colors.gray.200",_dark:{[n6.variable]:"colors.whiteAlpha.300"}},_disabled:{opacity:.4,cursor:"not-allowed"}},fse=oB(e=>({root:lse,field:Eo(use,e)??{},stepperGroup:cse,stepper:dse}));function H3(e){var t,n;const r=(t=_n.sizes)==null?void 0:t[e],i={lg:"md",md:"md",sm:"sm",xs:"sm"},o=((n=r.field)==null?void 0:n.fontSize)??"md",a=iB.fontSizes[o];return oB({field:{...r.field,paddingInlineEnd:aB.reference,verticalAlign:"top"},stepper:{fontSize:Vu(a).multiply(.75).toString(),_first:{borderTopEndRadius:i[e]},_last:{borderBottomEndRadius:i[e],mt:"-1px",borderTopWidth:1}}})}var hse={xs:H3("xs"),sm:H3("sm"),md:H3("md"),lg:H3("lg")},pse=ase({baseStyle:fse,sizes:hse,variants:_n.variants,defaultProps:_n.defaultProps}),WL,gse={...(WL=_n.baseStyle)==null?void 0:WL.field,textAlign:"center"},mse={lg:{fontSize:"lg",w:12,h:12,borderRadius:"md"},md:{fontSize:"md",w:10,h:10,borderRadius:"md"},sm:{fontSize:"sm",w:8,h:8,borderRadius:"sm"},xs:{fontSize:"xs",w:6,h:6,borderRadius:"sm"}},UL,vse={outline:e=>{var t,n;return((n=Eo((t=_n.variants)==null?void 0:t.outline,e))==null?void 0:n.field)??{}},flushed:e=>{var t,n;return((n=Eo((t=_n.variants)==null?void 0:t.flushed,e))==null?void 0:n.field)??{}},filled:e=>{var t,n;return((n=Eo((t=_n.variants)==null?void 0:t.filled,e))==null?void 0:n.field)??{}},unstyled:((UL=_n.variants)==null?void 0:UL.unstyled.field)??{}},yse={baseStyle:gse,sizes:mse,variants:vse,defaultProps:_n.defaultProps},{defineMultiStyleConfig:bse,definePartsStyle:Sse}=hr(Ire.keys),V3=yi("popper-bg"),xse=yi("popper-arrow-bg"),GL=yi("popper-arrow-shadow-color"),wse={zIndex:10},Cse={[V3.variable]:"colors.white",bg:V3.reference,[xse.variable]:V3.reference,[GL.variable]:"colors.gray.200",_dark:{[V3.variable]:"colors.gray.700",[GL.variable]:"colors.whiteAlpha.300"},width:"xs",border:"1px solid",borderColor:"inherit",borderRadius:"md",boxShadow:"sm",zIndex:"inherit",_focusVisible:{outline:0,boxShadow:"outline"}},_se={px:3,py:2,borderBottomWidth:"1px"},kse={px:3,py:2},Ese={px:3,py:2,borderTopWidth:"1px"},Pse={position:"absolute",borderRadius:"md",top:1,insetEnd:2,padding:2},Tse=Sse({popper:wse,content:Cse,header:_se,body:kse,footer:Ese,closeButton:Pse}),Lse=bse({baseStyle:Tse}),{defineMultiStyleConfig:Ase,definePartsStyle:vv}=hr(Rre.keys),Ose=e=>{const{colorScheme:t,theme:n,isIndeterminate:r,hasStripe:i}=e,o=Et(BL(),BL("1rem","rgba(0,0,0,0.1)"))(e),a=Et(`${t}.500`,`${t}.200`)(e),s=`linear-gradient( + to right, + transparent 0%, + ${Co(n,a)} 50%, + transparent 100% + )`;return{...!r&&i&&o,...r?{bgImage:s}:{bgColor:a}}},Mse={lineHeight:"1",fontSize:"0.25em",fontWeight:"bold",color:"white"},Ise=e=>({bg:Et("gray.100","whiteAlpha.300")(e)}),Rse=e=>({transitionProperty:"common",transitionDuration:"slow",...Ose(e)}),Dse=vv(e=>({label:Mse,filledTrack:Rse(e),track:Ise(e)})),Nse={xs:vv({track:{h:"1"}}),sm:vv({track:{h:"2"}}),md:vv({track:{h:"3"}}),lg:vv({track:{h:"4"}})},jse=Ase({sizes:Nse,baseStyle:Dse,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:Bse,definePartsStyle:s4}=hr(Dre.keys),Fse=e=>{var t;const n=(t=Eo(q4.baseStyle,e))==null?void 0:t.control;return{...n,borderRadius:"full",_checked:{...n==null?void 0:n._checked,_before:{content:'""',display:"inline-block",pos:"relative",w:"50%",h:"50%",borderRadius:"50%",bg:"currentColor"}}}},$se=s4(e=>{var t,n,r,i;return{label:(n=(t=q4).baseStyle)==null?void 0:n.call(t,e).label,container:(i=(r=q4).baseStyle)==null?void 0:i.call(r,e).container,control:Fse(e)}}),zse={md:s4({control:{w:"4",h:"4"},label:{fontSize:"md"}}),lg:s4({control:{w:"5",h:"5"},label:{fontSize:"lg"}}),sm:s4({control:{width:"3",height:"3"},label:{fontSize:"sm"}})},Hse=Bse({baseStyle:$se,sizes:zse,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:Vse,definePartsStyle:Wse}=hr(Nre.keys),W3=Vn("select-bg"),qL,Use={...(qL=_n.baseStyle)==null?void 0:qL.field,appearance:"none",paddingBottom:"1px",lineHeight:"normal",bg:W3.reference,[W3.variable]:"colors.white",_dark:{[W3.variable]:"colors.gray.700"},"> option, > optgroup":{bg:W3.reference}},Gse={width:"6",height:"100%",insetEnd:"2",position:"relative",color:"currentColor",fontSize:"xl",_disabled:{opacity:.5}},qse=Wse({field:Use,icon:Gse}),U3={paddingInlineEnd:"8"},YL,KL,XL,ZL,QL,JL,eA,tA,Yse={lg:{...(YL=_n.sizes)==null?void 0:YL.lg,field:{...(KL=_n.sizes)==null?void 0:KL.lg.field,...U3}},md:{...(XL=_n.sizes)==null?void 0:XL.md,field:{...(ZL=_n.sizes)==null?void 0:ZL.md.field,...U3}},sm:{...(QL=_n.sizes)==null?void 0:QL.sm,field:{...(JL=_n.sizes)==null?void 0:JL.sm.field,...U3}},xs:{...(eA=_n.sizes)==null?void 0:eA.xs,field:{...(tA=_n.sizes)==null?void 0:tA.xs.field,...U3},icon:{insetEnd:"1"}}},Kse=Vse({baseStyle:qse,sizes:Yse,variants:_n.variants,defaultProps:_n.defaultProps}),o6=Vn("skeleton-start-color"),a6=Vn("skeleton-end-color"),Xse={[o6.variable]:"colors.gray.100",[a6.variable]:"colors.gray.400",_dark:{[o6.variable]:"colors.gray.800",[a6.variable]:"colors.gray.600"},background:o6.reference,borderColor:a6.reference,opacity:.7,borderRadius:"sm"},Zse={baseStyle:Xse},s6=Vn("skip-link-bg"),Qse={borderRadius:"md",fontWeight:"semibold",_focusVisible:{boxShadow:"outline",padding:"4",position:"fixed",top:"6",insetStart:"6",[s6.variable]:"colors.white",_dark:{[s6.variable]:"colors.gray.700"},bg:s6.reference}},Jse={baseStyle:Qse},{defineMultiStyleConfig:ele,definePartsStyle:DS}=hr(jre.keys),S2=Vn("slider-thumb-size"),x2=Vn("slider-track-size"),vd=Vn("slider-bg"),tle=e=>{const{orientation:t}=e;return{display:"inline-block",position:"relative",cursor:"pointer",_disabled:{opacity:.6,cursor:"default",pointerEvents:"none"},...P_({orientation:t,vertical:{h:"100%"},horizontal:{w:"100%"}})}},nle=e=>({...P_({orientation:e.orientation,horizontal:{h:x2.reference},vertical:{w:x2.reference}}),overflow:"hidden",borderRadius:"sm",[vd.variable]:"colors.gray.200",_dark:{[vd.variable]:"colors.whiteAlpha.200"},_disabled:{[vd.variable]:"colors.gray.300",_dark:{[vd.variable]:"colors.whiteAlpha.300"}},bg:vd.reference}),rle=e=>{const{orientation:t}=e;return{...P_({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",_active:{transform:"translateX(-50%) scale(1.15)"}},horizontal:{top:"50%",transform:"translateY(-50%)",_active:{transform:"translateY(-50%) scale(1.15)"}}}),w:S2.reference,h:S2.reference,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",outline:0,zIndex:1,borderRadius:"full",bg:"white",boxShadow:"base",border:"1px solid",borderColor:"transparent",transitionProperty:"transform",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{bg:"gray.300"}}},ile=e=>{const{colorScheme:t}=e;return{width:"inherit",height:"inherit",[vd.variable]:`colors.${t}.500`,_dark:{[vd.variable]:`colors.${t}.200`},bg:vd.reference}},ole=DS(e=>({container:tle(e),track:nle(e),thumb:rle(e),filledTrack:ile(e)})),ale=DS({container:{[S2.variable]:"sizes.4",[x2.variable]:"sizes.1"}}),sle=DS({container:{[S2.variable]:"sizes.3.5",[x2.variable]:"sizes.1"}}),lle=DS({container:{[S2.variable]:"sizes.2.5",[x2.variable]:"sizes.0.5"}}),ule={lg:ale,md:sle,sm:lle},cle=ele({baseStyle:ole,sizes:ule,defaultProps:{size:"md",colorScheme:"blue"}}),bh=yi("spinner-size"),dle={width:[bh.reference],height:[bh.reference]},fle={xs:{[bh.variable]:"sizes.3"},sm:{[bh.variable]:"sizes.4"},md:{[bh.variable]:"sizes.6"},lg:{[bh.variable]:"sizes.8"},xl:{[bh.variable]:"sizes.12"}},hle={baseStyle:dle,sizes:fle,defaultProps:{size:"md"}},{defineMultiStyleConfig:ple,definePartsStyle:sB}=hr(Bre.keys),gle={fontWeight:"medium"},mle={opacity:.8,marginBottom:"2"},vle={verticalAlign:"baseline",fontWeight:"semibold"},yle={marginEnd:1,w:"3.5",h:"3.5",verticalAlign:"middle"},ble=sB({container:{},label:gle,helpText:mle,number:vle,icon:yle}),Sle={md:sB({label:{fontSize:"sm"},helpText:{fontSize:"sm"},number:{fontSize:"2xl"}})},xle=ple({baseStyle:ble,sizes:Sle,defaultProps:{size:"md"}}),{defineMultiStyleConfig:wle,definePartsStyle:l4}=hr(Fre.keys),Fv=yi("switch-track-width"),Oh=yi("switch-track-height"),l6=yi("switch-track-diff"),Cle=Vu.subtract(Fv,Oh),p7=yi("switch-thumb-x"),H1=yi("switch-bg"),_le=e=>{const{colorScheme:t}=e;return{borderRadius:"full",p:"0.5",width:[Fv.reference],height:[Oh.reference],transitionProperty:"common",transitionDuration:"fast",[H1.variable]:"colors.gray.300",_dark:{[H1.variable]:"colors.whiteAlpha.400"},_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed"},_checked:{[H1.variable]:`colors.${t}.500`,_dark:{[H1.variable]:`colors.${t}.200`}},bg:H1.reference}},kle={bg:"white",transitionProperty:"transform",transitionDuration:"normal",borderRadius:"inherit",width:[Oh.reference],height:[Oh.reference],_checked:{transform:`translateX(${p7.reference})`}},Ele=l4(e=>({container:{[l6.variable]:Cle,[p7.variable]:l6.reference,_rtl:{[p7.variable]:Vu(l6).negate().toString()}},track:_le(e),thumb:kle})),Ple={sm:l4({container:{[Fv.variable]:"1.375rem",[Oh.variable]:"sizes.3"}}),md:l4({container:{[Fv.variable]:"1.875rem",[Oh.variable]:"sizes.4"}}),lg:l4({container:{[Fv.variable]:"2.875rem",[Oh.variable]:"sizes.6"}})},Tle=wle({baseStyle:Ele,sizes:Ple,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:Lle,definePartsStyle:bm}=hr($re.keys),Ale=bm({table:{fontVariantNumeric:"lining-nums tabular-nums",borderCollapse:"collapse",width:"full"},th:{fontFamily:"heading",fontWeight:"bold",textTransform:"uppercase",letterSpacing:"wider",textAlign:"start"},td:{textAlign:"start"},caption:{mt:4,fontFamily:"heading",textAlign:"center",fontWeight:"medium"}}),Y4={"&[data-is-numeric=true]":{textAlign:"end"}},Ole=bm(e=>{const{colorScheme:t}=e;return{th:{color:Et("gray.600","gray.400")(e),borderBottom:"1px",borderColor:Et(`${t}.100`,`${t}.700`)(e),...Y4},td:{borderBottom:"1px",borderColor:Et(`${t}.100`,`${t}.700`)(e),...Y4},caption:{color:Et("gray.600","gray.100")(e)},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),Mle=bm(e=>{const{colorScheme:t}=e;return{th:{color:Et("gray.600","gray.400")(e),borderBottom:"1px",borderColor:Et(`${t}.100`,`${t}.700`)(e),...Y4},td:{borderBottom:"1px",borderColor:Et(`${t}.100`,`${t}.700`)(e),...Y4},caption:{color:Et("gray.600","gray.100")(e)},tbody:{tr:{"&:nth-of-type(odd)":{"th, td":{borderBottomWidth:"1px",borderColor:Et(`${t}.100`,`${t}.700`)(e)},td:{background:Et(`${t}.100`,`${t}.700`)(e)}}}},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),Ile={simple:Ole,striped:Mle,unstyled:{}},Rle={sm:bm({th:{px:"4",py:"1",lineHeight:"4",fontSize:"xs"},td:{px:"4",py:"2",fontSize:"sm",lineHeight:"4"},caption:{px:"4",py:"2",fontSize:"xs"}}),md:bm({th:{px:"6",py:"3",lineHeight:"4",fontSize:"xs"},td:{px:"6",py:"4",lineHeight:"5"},caption:{px:"6",py:"2",fontSize:"sm"}}),lg:bm({th:{px:"8",py:"4",lineHeight:"5",fontSize:"sm"},td:{px:"8",py:"5",lineHeight:"6"},caption:{px:"6",py:"2",fontSize:"md"}})},Dle=Lle({baseStyle:Ale,variants:Ile,sizes:Rle,defaultProps:{variant:"simple",size:"md",colorScheme:"gray"}}),Ko=Vn("tabs-color"),$s=Vn("tabs-bg"),G3=Vn("tabs-border-color"),{defineMultiStyleConfig:Nle,definePartsStyle:Kl}=hr(zre.keys),jle=e=>{const{orientation:t}=e;return{display:t==="vertical"?"flex":"block"}},Ble=e=>{const{isFitted:t}=e;return{flex:t?1:void 0,transitionProperty:"common",transitionDuration:"normal",_focusVisible:{zIndex:1,boxShadow:"outline"},_disabled:{cursor:"not-allowed",opacity:.4}}},Fle=e=>{const{align:t="start",orientation:n}=e;return{justifyContent:{end:"flex-end",center:"center",start:"flex-start"}[t],flexDirection:n==="vertical"?"column":"row"}},$le={p:4},zle=Kl(e=>({root:jle(e),tab:Ble(e),tablist:Fle(e),tabpanel:$le})),Hle={sm:Kl({tab:{py:1,px:4,fontSize:"sm"}}),md:Kl({tab:{fontSize:"md",py:2,px:4}}),lg:Kl({tab:{fontSize:"lg",py:3,px:4}})},Vle=Kl(e=>{const{colorScheme:t,orientation:n}=e,r=n==="vertical",i=n==="vertical"?"borderStart":"borderBottom",o=r?"marginStart":"marginBottom";return{tablist:{[i]:"2px solid",borderColor:"inherit"},tab:{[i]:"2px solid",borderColor:"transparent",[o]:"-2px",_selected:{[Ko.variable]:`colors.${t}.600`,_dark:{[Ko.variable]:`colors.${t}.300`},borderColor:"currentColor"},_active:{[$s.variable]:"colors.gray.200",_dark:{[$s.variable]:"colors.whiteAlpha.300"}},_disabled:{_active:{bg:"none"}},color:Ko.reference,bg:$s.reference}}}),Wle=Kl(e=>{const{colorScheme:t}=e;return{tab:{borderTopRadius:"md",border:"1px solid",borderColor:"transparent",mb:"-1px",[G3.reference]:"transparent",_selected:{[Ko.variable]:`colors.${t}.600`,[G3.variable]:"colors.white",_dark:{[Ko.variable]:`colors.${t}.300`,[G3.variable]:"colors.gray.800"},borderColor:"inherit",borderBottomColor:G3.reference},color:Ko.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),Ule=Kl(e=>{const{colorScheme:t}=e;return{tab:{border:"1px solid",borderColor:"inherit",[$s.variable]:"colors.gray.50",_dark:{[$s.variable]:"colors.whiteAlpha.50"},mb:"-1px",_notLast:{marginEnd:"-1px"},_selected:{[$s.variable]:"colors.white",[Ko.variable]:`colors.${t}.600`,_dark:{[$s.variable]:"colors.gray.800",[Ko.variable]:`colors.${t}.300`},borderColor:"inherit",borderTopColor:"currentColor",borderBottomColor:"transparent"},color:Ko.reference,bg:$s.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),Gle=Kl(e=>{const{colorScheme:t,theme:n}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",color:"gray.600",_selected:{color:Co(n,`${t}.700`),bg:Co(n,`${t}.100`)}}}}),qle=Kl(e=>{const{colorScheme:t}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",[Ko.variable]:"colors.gray.600",_dark:{[Ko.variable]:"inherit"},_selected:{[Ko.variable]:"colors.white",[$s.variable]:`colors.${t}.600`,_dark:{[Ko.variable]:"colors.gray.800",[$s.variable]:`colors.${t}.300`}},color:Ko.reference,bg:$s.reference}}}),Yle=Kl({}),Kle={line:Vle,enclosed:Wle,"enclosed-colored":Ule,"soft-rounded":Gle,"solid-rounded":qle,unstyled:Yle},Xle=Nle({baseStyle:zle,sizes:Hle,variants:Kle,defaultProps:{size:"md",variant:"line",colorScheme:"blue"}}),{defineMultiStyleConfig:Zle,definePartsStyle:Mh}=hr(Hre.keys),Qle={fontWeight:"medium",lineHeight:1.2,outline:0,borderRadius:"md",_focusVisible:{boxShadow:"outline"}},Jle={lineHeight:1.2,overflow:"visible"},eue={fontSize:"lg",w:"5",h:"5",transitionProperty:"common",transitionDuration:"normal",borderRadius:"full",marginStart:"1.5",marginEnd:"-1",opacity:.5,_disabled:{opacity:.4},_focusVisible:{boxShadow:"outline",bg:"rgba(0, 0, 0, 0.14)"},_hover:{opacity:.8},_active:{opacity:1}},tue=Mh({container:Qle,label:Jle,closeButton:eue}),nue={sm:Mh({container:{minH:"5",minW:"5",fontSize:"xs",px:"2"},closeButton:{marginEnd:"-2px",marginStart:"0.35rem"}}),md:Mh({container:{minH:"6",minW:"6",fontSize:"sm",px:"2"}}),lg:Mh({container:{minH:"8",minW:"8",fontSize:"md",px:"3"}})},rue={subtle:Mh(e=>{var t;return{container:(t=Nv.variants)==null?void 0:t.subtle(e)}}),solid:Mh(e=>{var t;return{container:(t=Nv.variants)==null?void 0:t.solid(e)}}),outline:Mh(e=>{var t;return{container:(t=Nv.variants)==null?void 0:t.outline(e)}})},iue=Zle({variants:rue,baseStyle:tue,sizes:nue,defaultProps:{size:"md",variant:"subtle",colorScheme:"gray"}}),nA,oue={...(nA=_n.baseStyle)==null?void 0:nA.field,paddingY:"2",minHeight:"20",lineHeight:"short",verticalAlign:"top"},rA,aue={outline:e=>{var t;return((t=_n.variants)==null?void 0:t.outline(e).field)??{}},flushed:e=>{var t;return((t=_n.variants)==null?void 0:t.flushed(e).field)??{}},filled:e=>{var t;return((t=_n.variants)==null?void 0:t.filled(e).field)??{}},unstyled:((rA=_n.variants)==null?void 0:rA.unstyled.field)??{}},iA,oA,aA,sA,sue={xs:((iA=_n.sizes)==null?void 0:iA.xs.field)??{},sm:((oA=_n.sizes)==null?void 0:oA.sm.field)??{},md:((aA=_n.sizes)==null?void 0:aA.md.field)??{},lg:((sA=_n.sizes)==null?void 0:sA.lg.field)??{}},lue={baseStyle:oue,sizes:sue,variants:aue,defaultProps:{size:"md",variant:"outline"}},q3=yi("tooltip-bg"),u6=yi("tooltip-fg"),uue=yi("popper-arrow-bg"),cue={bg:q3.reference,color:u6.reference,[q3.variable]:"colors.gray.700",[u6.variable]:"colors.whiteAlpha.900",_dark:{[q3.variable]:"colors.gray.300",[u6.variable]:"colors.gray.900"},[uue.variable]:q3.reference,px:"2",py:"0.5",borderRadius:"sm",fontWeight:"medium",fontSize:"sm",boxShadow:"md",maxW:"xs",zIndex:"tooltip"},due={baseStyle:cue},fue={Accordion:Lie,Alert:jie,Avatar:Yie,Badge:Nv,Breadcrumb:ioe,Button:hoe,Checkbox:q4,CloseButton:Toe,Code:Moe,Container:Roe,Divider:Foe,Drawer:Xoe,Editable:rae,Form:uae,FormError:gae,FormLabel:vae,Heading:Sae,Input:_n,Kbd:Aae,Link:Mae,List:jae,Menu:qae,Modal:ise,NumberInput:pse,PinInput:yse,Popover:Lse,Progress:jse,Radio:Hse,Select:Kse,Skeleton:Zse,SkipLink:Jse,Slider:cle,Spinner:hle,Stat:xle,Switch:Tle,Table:Dle,Tabs:Xle,Tag:iue,Textarea:lue,Tooltip:due,Card:yoe},hue={none:0,"1px":"1px solid","2px":"2px solid","4px":"4px solid","8px":"8px solid"},pue=hue,gue={base:"0em",sm:"30em",md:"48em",lg:"62em",xl:"80em","2xl":"96em"},mue=gue,vue={transparent:"transparent",current:"currentColor",black:"#000000",white:"#FFFFFF",whiteAlpha:{50:"rgba(255, 255, 255, 0.04)",100:"rgba(255, 255, 255, 0.06)",200:"rgba(255, 255, 255, 0.08)",300:"rgba(255, 255, 255, 0.16)",400:"rgba(255, 255, 255, 0.24)",500:"rgba(255, 255, 255, 0.36)",600:"rgba(255, 255, 255, 0.48)",700:"rgba(255, 255, 255, 0.64)",800:"rgba(255, 255, 255, 0.80)",900:"rgba(255, 255, 255, 0.92)"},blackAlpha:{50:"rgba(0, 0, 0, 0.04)",100:"rgba(0, 0, 0, 0.06)",200:"rgba(0, 0, 0, 0.08)",300:"rgba(0, 0, 0, 0.16)",400:"rgba(0, 0, 0, 0.24)",500:"rgba(0, 0, 0, 0.36)",600:"rgba(0, 0, 0, 0.48)",700:"rgba(0, 0, 0, 0.64)",800:"rgba(0, 0, 0, 0.80)",900:"rgba(0, 0, 0, 0.92)"},gray:{50:"#F7FAFC",100:"#EDF2F7",200:"#E2E8F0",300:"#CBD5E0",400:"#A0AEC0",500:"#718096",600:"#4A5568",700:"#2D3748",800:"#1A202C",900:"#171923"},red:{50:"#FFF5F5",100:"#FED7D7",200:"#FEB2B2",300:"#FC8181",400:"#F56565",500:"#E53E3E",600:"#C53030",700:"#9B2C2C",800:"#822727",900:"#63171B"},orange:{50:"#FFFAF0",100:"#FEEBC8",200:"#FBD38D",300:"#F6AD55",400:"#ED8936",500:"#DD6B20",600:"#C05621",700:"#9C4221",800:"#7B341E",900:"#652B19"},yellow:{50:"#FFFFF0",100:"#FEFCBF",200:"#FAF089",300:"#F6E05E",400:"#ECC94B",500:"#D69E2E",600:"#B7791F",700:"#975A16",800:"#744210",900:"#5F370E"},green:{50:"#F0FFF4",100:"#C6F6D5",200:"#9AE6B4",300:"#68D391",400:"#48BB78",500:"#38A169",600:"#2F855A",700:"#276749",800:"#22543D",900:"#1C4532"},teal:{50:"#E6FFFA",100:"#B2F5EA",200:"#81E6D9",300:"#4FD1C5",400:"#38B2AC",500:"#319795",600:"#2C7A7B",700:"#285E61",800:"#234E52",900:"#1D4044"},blue:{50:"#ebf8ff",100:"#bee3f8",200:"#90cdf4",300:"#63b3ed",400:"#4299e1",500:"#3182ce",600:"#2b6cb0",700:"#2c5282",800:"#2a4365",900:"#1A365D"},cyan:{50:"#EDFDFD",100:"#C4F1F9",200:"#9DECF9",300:"#76E4F7",400:"#0BC5EA",500:"#00B5D8",600:"#00A3C4",700:"#0987A0",800:"#086F83",900:"#065666"},purple:{50:"#FAF5FF",100:"#E9D8FD",200:"#D6BCFA",300:"#B794F4",400:"#9F7AEA",500:"#805AD5",600:"#6B46C1",700:"#553C9A",800:"#44337A",900:"#322659"},pink:{50:"#FFF5F7",100:"#FED7E2",200:"#FBB6CE",300:"#F687B3",400:"#ED64A6",500:"#D53F8C",600:"#B83280",700:"#97266D",800:"#702459",900:"#521B41"},linkedin:{50:"#E8F4F9",100:"#CFEDFB",200:"#9BDAF3",300:"#68C7EC",400:"#34B3E4",500:"#00A0DC",600:"#008CC9",700:"#0077B5",800:"#005E93",900:"#004471"},facebook:{50:"#E8F4F9",100:"#D9DEE9",200:"#B7C2DA",300:"#6482C0",400:"#4267B2",500:"#385898",600:"#314E89",700:"#29487D",800:"#223B67",900:"#1E355B"},messenger:{50:"#D0E6FF",100:"#B9DAFF",200:"#A2CDFF",300:"#7AB8FF",400:"#2E90FF",500:"#0078FF",600:"#0063D1",700:"#0052AC",800:"#003C7E",900:"#002C5C"},whatsapp:{50:"#dffeec",100:"#b9f5d0",200:"#90edb3",300:"#65e495",400:"#3cdd78",500:"#22c35e",600:"#179848",700:"#0c6c33",800:"#01421c",900:"#001803"},twitter:{50:"#E5F4FD",100:"#C8E9FB",200:"#A8DCFA",300:"#83CDF7",400:"#57BBF5",500:"#1DA1F2",600:"#1A94DA",700:"#1681BF",800:"#136B9E",900:"#0D4D71"},telegram:{50:"#E3F2F9",100:"#C5E4F3",200:"#A2D4EC",300:"#7AC1E4",400:"#47A9DA",500:"#0088CC",600:"#007AB8",700:"#006BA1",800:"#005885",900:"#003F5E"}},yue=vue,bue={none:"0",sm:"0.125rem",base:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},Sue=bue,xue={xs:"0 0 0 1px rgba(0, 0, 0, 0.05)",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",base:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",outline:"0 0 0 3px rgba(66, 153, 225, 0.6)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.06)",none:"none","dark-lg":"rgba(0, 0, 0, 0.1) 0px 0px 0px 1px, rgba(0, 0, 0, 0.2) 0px 5px 10px, rgba(0, 0, 0, 0.4) 0px 15px 40px"},wue=xue,Cue={common:"background-color, border-color, color, fill, stroke, opacity, box-shadow, transform",colors:"background-color, border-color, color, fill, stroke",dimensions:"width, height",position:"left, right, top, bottom",background:"background-color, background-image, background-position"},_ue={"ease-in":"cubic-bezier(0.4, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.2, 1)","ease-in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},kue={"ultra-fast":"50ms",faster:"100ms",fast:"150ms",normal:"200ms",slow:"300ms",slower:"400ms","ultra-slow":"500ms"},Eue={property:Cue,easing:_ue,duration:kue},Pue=Eue,Tue={hide:-1,auto:"auto",base:0,docked:10,dropdown:1e3,sticky:1100,banner:1200,overlay:1300,modal:1400,popover:1500,skipLink:1600,toast:1700,tooltip:1800},Lue=Tue,Aue={none:0,sm:"4px",base:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},Oue=Aue,Mue={breakpoints:mue,zIndices:Lue,radii:Sue,blur:Oue,colors:yue,...iB,sizes:tB,shadows:wue,space:eB,borders:pue,transition:Pue},Iue={colors:{"chakra-body-text":{_light:"gray.800",_dark:"whiteAlpha.900"},"chakra-body-bg":{_light:"white",_dark:"gray.800"},"chakra-border-color":{_light:"gray.200",_dark:"whiteAlpha.300"},"chakra-subtle-bg":{_light:"gray.100",_dark:"gray.700"},"chakra-placeholder-color":{_light:"gray.500",_dark:"whiteAlpha.400"}}},Rue={global:{body:{fontFamily:"body",color:"chakra-body-text",bg:"chakra-body-bg",transitionProperty:"background-color",transitionDuration:"normal",lineHeight:"base"},"*::placeholder":{color:"chakra-placeholder-color"},"*, *::before, &::after":{borderColor:"chakra-border-color",wordWrap:"break-word"}}},Due="ltr",Nue={useSystemColorMode:!1,initialColorMode:"light",cssVarPrefix:"chakra"},jue={semanticTokens:Iue,direction:Due,...Mue,components:fue,styles:Rue,config:Nue},Bue=typeof Element<"u",Fue=typeof Map=="function",$ue=typeof Set=="function",zue=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function u4(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!u4(e[r],t[r]))return!1;return!0}var o;if(Fue&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;for(o=e.entries();!(r=o.next()).done;)if(!u4(r.value[1],t.get(r.value[0])))return!1;return!0}if($ue&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(zue&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;if(Bue&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((i[r]==="_owner"||i[r]==="__v"||i[r]==="__o")&&e.$$typeof)&&!u4(e[i[r]],t[i[r]]))return!1;return!0}return e!==e&&t!==t}var Hue=function(t,n){try{return u4(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};function h0(){const e=w.useContext(y2);if(!e)throw Error("useTheme: `theme` is undefined. Seems you forgot to wrap your app in `` or ``");return e}function lB(){const e=dy(),t=h0();return{...e,theme:t}}function Vue(e,t,n){if(t==null)return t;const r=i=>{var o,a;return(a=(o=e.__breakpoints)==null?void 0:o.asArray)==null?void 0:a[i]};return r(t)??r(n)??n}function Wue(e,t,n){if(t==null)return t;const r=i=>{var o,a;return(a=(o=e.__cssMap)==null?void 0:o[i])==null?void 0:a.value};return r(t)??r(n)??n}function Uue(e,t,n){const r=Array.isArray(t)?t:[t],i=Array.isArray(n)?n:[n];return o=>{const a=i.filter(Boolean),s=r.map((l,u)=>{if(e==="breakpoints")return Vue(o,l,a[u]??l);const d=`${e}.${l}`;return Wue(o,d,a[u]??l)});return Array.isArray(t)?s:s[0]}}function Gue(e){const{cssVarsRoot:t,theme:n,children:r}=e,i=w.useMemo(()=>Fte(n),[n]);return N.createElement(Kne,{theme:i},N.createElement(que,{root:t}),r)}function que({root:e=":host, :root"}){const t=[e,"[data-theme]"].join(",");return N.createElement(MS,{styles:n=>({[t]:n.__cssVars})})}dre({name:"StylesContext",errorMessage:"useStyles: `styles` is undefined. Seems you forgot to wrap the components in `` "});function Yue(){const{colorMode:e}=dy();return N.createElement(MS,{styles:t=>{const n=Vj(t,"styles.global"),r=Gj(n,{theme:t,colorMode:e});return r?xj(r)(t):void 0}})}var Kue=new Set([...Hte,"textStyle","layerStyle","apply","noOfLines","focusBorderColor","errorBorderColor","as","__css","css","sx"]),Xue=new Set(["htmlWidth","htmlHeight","htmlSize"]);function Zue(e){return Xue.has(e)||!Kue.has(e)}var Que=({baseStyle:e})=>t=>{const{theme:n,css:r,__css:i,sx:o,...a}=t,s=Wj(a,(h,m)=>Wte(m)),l=Gj(e,t),u=Object.assign({},i,l,Uj(s),o),d=xj(u)(t.theme);return r?[d,r]:d};function c6(e,t){const{baseStyle:n,...r}=t??{};r.shouldForwardProp||(r.shouldForwardProp=Zue);const i=Que({baseStyle:n}),o=u7(e,r)(i);return N.forwardRef(function(l,u){const{colorMode:d,forced:h}=dy();return N.createElement(o,{ref:u,"data-theme":h?d:void 0,...l})})}function Oe(e){return w.forwardRef(e)}function uB(e,t={}){const{styleConfig:n,...r}=t,{theme:i,colorMode:o}=lB(),a=e?Vj(i,`components.${e}`):void 0,s=n||a,l=Wl({theme:i,colorMode:o},(s==null?void 0:s.defaultProps)??{},Uj(ore(r,["children"]))),u=w.useRef({});if(s){const h=ene(s)(l);Hue(u.current,h)||(u.current=h)}return u.current}function Ao(e,t={}){return uB(e,t)}function Yi(e,t={}){return uB(e,t)}function Jue(){const e=new Map;return new Proxy(c6,{apply(t,n,r){return c6(...r)},get(t,n){return e.has(n)||e.set(n,c6(n)),e.get(n)}})}var Ce=Jue();function ece(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function Mn(e={}){const{name:t,strict:n=!0,hookName:r="useContext",providerName:i="Provider",errorMessage:o}=e,a=w.createContext(void 0);a.displayName=t;function s(){var l;const u=w.useContext(a);if(!u&&n){const d=new Error(o??ece(r,i));throw d.name="ContextError",(l=Error.captureStackTrace)==null||l.call(Error,d,s),d}return u}return[a.Provider,s,a]}function tce(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=>{tce(n,t)})}}function nce(...e){return w.useMemo(()=>Yn(...e),e)}function lA(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 rce=e=>typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE;function uA(e,t,n){let r=e+1;return n&&r>=t&&(r=0),r}function cA(e,t,n){let r=e-1;return n&&r<0&&(r=t),r}var g7=typeof window<"u"?w.useLayoutEffect:w.useEffect,K4=e=>e,ice=class{constructor(){sn(this,"descendants",new Map);sn(this,"register",e=>{if(e!=null)return rce(e)?this.registerNode(e):t=>{this.registerNode(t,e)}});sn(this,"unregister",e=>{this.descendants.delete(e);const t=lA(Array.from(this.descendants.keys()));this.assignIndex(t)});sn(this,"destroy",()=>{this.descendants.clear()});sn(this,"assignIndex",e=>{this.descendants.forEach(t=>{const n=e.indexOf(t.node);t.index=n,t.node.dataset.index=t.index.toString()})});sn(this,"count",()=>this.descendants.size);sn(this,"enabledCount",()=>this.enabledValues().length);sn(this,"values",()=>Array.from(this.descendants.values()).sort((t,n)=>t.index-n.index));sn(this,"enabledValues",()=>this.values().filter(e=>!e.disabled));sn(this,"item",e=>{if(this.count()!==0)return this.values()[e]});sn(this,"enabledItem",e=>{if(this.enabledCount()!==0)return this.enabledValues()[e]});sn(this,"first",()=>this.item(0));sn(this,"firstEnabled",()=>this.enabledItem(0));sn(this,"last",()=>this.item(this.descendants.size-1));sn(this,"lastEnabled",()=>{const e=this.enabledValues().length-1;return this.enabledItem(e)});sn(this,"indexOf",e=>{var t;return e?((t=this.descendants.get(e))==null?void 0:t.index)??-1:-1});sn(this,"enabledIndexOf",e=>e==null?-1:this.enabledValues().findIndex(t=>t.node.isSameNode(e)));sn(this,"next",(e,t=!0)=>{const n=uA(e,this.count(),t);return this.item(n)});sn(this,"nextEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),i=uA(r,this.enabledCount(),t);return this.enabledItem(i)});sn(this,"prev",(e,t=!0)=>{const n=cA(e,this.count()-1,t);return this.item(n)});sn(this,"prevEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),i=cA(r,this.enabledCount()-1,t);return this.enabledItem(i)});sn(this,"registerNode",(e,t)=>{if(!e||this.descendants.has(e))return;const n=Array.from(this.descendants.keys()).concat(e),r=lA(n);t!=null&&t.disabled&&(t.disabled=!!t.disabled);const i={node:e,index:-1,...t};this.descendants.set(e,i),this.assignIndex(r)})}};function oce(){const e=w.useRef(new ice);return g7(()=>()=>e.current.destroy()),e.current}var[ace,cB]=Mn({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});function sce(e){const t=cB(),[n,r]=w.useState(-1),i=w.useRef(null);g7(()=>()=>{i.current&&t.unregister(i.current)},[]),g7(()=>{if(!i.current)return;const a=Number(i.current.dataset.index);n!=a&&!Number.isNaN(a)&&r(a)});const o=K4(e?t.register(e):t.register);return{descendants:t,index:n,enabledIndex:t.enabledIndexOf(i.current),register:Yn(o,i)}}function dB(){return[K4(ace),()=>K4(cB()),()=>oce(),i=>sce(i)]}var Qr=(...e)=>e.filter(Boolean).join(" "),dA={path:N.createElement("g",{stroke:"currentColor",strokeWidth:"1.5"},N.createElement("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),N.createElement("path",{fill:"currentColor",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),N.createElement("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})),viewBox:"0 0 24 24"},Da=Oe((e,t)=>{const{as:n,viewBox:r,color:i="currentColor",focusable:o=!1,children:a,className:s,__css:l,...u}=e,d=Qr("chakra-icon",s),h={w:"1em",h:"1em",display:"inline-block",lineHeight:"1em",flexShrink:0,color:i,...l},m={ref:t,focusable:o,className:d,__css:h},y=r??dA.viewBox;if(n&&typeof n!="string")return N.createElement(Ce.svg,{as:n,...m,...u});const b=a??dA.path;return N.createElement(Ce.svg,{verticalAlign:"middle",viewBox:y,...m,...u},b)});Da.displayName="Icon";function yt(e){const{viewBox:t="0 0 24 24",d:n,displayName:r,defaultProps:i={}}=e,o=w.Children.toArray(e.path),a=Oe((s,l)=>N.createElement(Da,{ref:l,viewBox:t,...i,...s},o.length?o:N.createElement("path",{fill:"currentColor",d:n})));return a.displayName=r,a}function Er(e,t=[]){const n=w.useRef(e);return w.useEffect(()=>{n.current=e}),w.useCallback((...r)=>{var i;return(i=n.current)==null?void 0:i.call(n,...r)},t)}function NS(e){const{value:t,defaultValue:n,onChange:r,shouldUpdate:i=(m,y)=>m!==y}=e,o=Er(r),a=Er(i),[s,l]=w.useState(n),u=t!==void 0,d=u?t:s,h=Er(m=>{const b=typeof m=="function"?m(d):m;a(d,b)&&(u||l(b),o(b))},[u,o,d,a]);return[d,h]}const O_=w.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),jS=w.createContext({});function lce(){return w.useContext(jS).visualElement}const p0=w.createContext(null),np=typeof document<"u",X4=np?w.useLayoutEffect:w.useEffect,fB=w.createContext({strict:!1});function uce(e,t,n,r){const i=lce(),o=w.useContext(fB),a=w.useContext(p0),s=w.useContext(O_).reducedMotion,l=w.useRef();r=r||o.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:i,props:n,presenceId:a?a.id:void 0,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:s}));const u=l.current;return X4(()=>{u&&u.render()}),w.useEffect(()=>{u&&u.animationState&&u.animationState.animateChanges()}),X4(()=>()=>u&&u.notify("Unmount"),[]),u}function Hg(e){return typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function cce(e,t,n){return w.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Hg(n)&&(n.current=r))},[t])}function w2(e){return typeof e=="string"||Array.isArray(e)}function BS(e){return typeof e=="object"&&typeof e.start=="function"}const dce=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function FS(e){return BS(e.animate)||dce.some(t=>w2(e[t]))}function hB(e){return Boolean(FS(e)||e.variants)}function fce(e,t){if(FS(e)){const{initial:n,animate:r}=e;return{initial:n===!1||w2(n)?n:void 0,animate:w2(r)?r:void 0}}return e.inherit!==!1?t:{}}function hce(e){const{initial:t,animate:n}=fce(e,w.useContext(jS));return w.useMemo(()=>({initial:t,animate:n}),[fA(t),fA(n)])}function fA(e){return Array.isArray(e)?e.join(" "):e}const Bu=e=>({isEnabled:t=>e.some(n=>!!t[n])}),C2={measureLayout:Bu(["layout","layoutId","drag"]),animation:Bu(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:Bu(["exit"]),drag:Bu(["drag","dragControls"]),focus:Bu(["whileFocus"]),hover:Bu(["whileHover","onHoverStart","onHoverEnd"]),tap:Bu(["whileTap","onTap","onTapStart","onTapCancel"]),pan:Bu(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:Bu(["whileInView","onViewportEnter","onViewportLeave"])};function pce(e){for(const t in e)t==="projectionNodeConstructor"?C2.projectionNodeConstructor=e[t]:C2[t].Component=e[t]}function $S(e){const t=w.useRef(null);return t.current===null&&(t.current=e()),t.current}const $v={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let gce=1;function mce(){return $S(()=>{if($v.hasEverUpdated)return gce++})}const M_=w.createContext({});class vce extends N.Component{getSnapshotBeforeUpdate(){const{visualElement:t,props:n}=this.props;return t&&t.setProps(n),null}componentDidUpdate(){}render(){return this.props.children}}const pB=w.createContext({}),yce=Symbol.for("motionComponentSymbol");function bce({preloadedFeatures:e,createVisualElement:t,projectionNodeConstructor:n,useRender:r,useVisualState:i,Component:o}){e&&pce(e);function a(l,u){const d={...w.useContext(O_),...l,layoutId:Sce(l)},{isStatic:h}=d;let m=null;const y=hce(l),b=h?void 0:mce(),S=i(l,h);if(!h&&np){y.visualElement=uce(o,S,d,t);const E=w.useContext(fB).strict,k=w.useContext(pB);y.visualElement&&(m=y.visualElement.loadFeatures(d,E,e,b,n||C2.projectionNodeConstructor,k))}return w.createElement(vce,{visualElement:y.visualElement,props:d},m,w.createElement(jS.Provider,{value:y},r(o,l,b,cce(S,y.visualElement,u),S,h,y.visualElement)))}const s=w.forwardRef(a);return s[yce]=o,s}function Sce({layoutId:e}){const t=w.useContext(M_).id;return t&&e!==void 0?t+"-"+e:e}function xce(e){function t(r,i={}){return bce(e(r,i))}if(typeof Proxy>"u")return t;const n=new Map;return new Proxy(t,{get:(r,i)=>(n.has(i)||n.set(i,t(i)),n.get(i))})}const wce=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];function I_(e){return typeof e!="string"||e.includes("-")?!1:!!(wce.indexOf(e)>-1||/[A-Z]/.test(e))}const Z4={};function Cce(e){Object.assign(Z4,e)}const Q4=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],g0=new Set(Q4);function gB(e,{layout:t,layoutId:n}){return g0.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Z4[e]||e==="opacity")}const ou=e=>!!(e!=null&&e.getVelocity),_ce={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},kce=(e,t)=>Q4.indexOf(e)-Q4.indexOf(t);function Ece({transform:e,transformKeys:t},{enableHardwareAcceleration:n=!0,allowTransformNone:r=!0},i,o){let a="";t.sort(kce);for(const s of t)a+=`${_ce[s]||s}(${e[s]}) `;return n&&!e.z&&(a+="translateZ(0)"),a=a.trim(),o?a=o(e,i?"":a):r&&i&&(a="none"),a}function mB(e){return e.startsWith("--")}const Pce=(e,t)=>t&&typeof e=="number"?t.transform(e):e,vB=(e,t)=>n=>Math.max(Math.min(n,t),e),zv=e=>e%1?Number(e.toFixed(5)):e,_2=/(-)?([\d]*\.?[\d])+/g,m7=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,Tce=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function gy(e){return typeof e=="string"}const rp={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Hv=Object.assign(Object.assign({},rp),{transform:vB(0,1)}),Y3=Object.assign(Object.assign({},rp),{default:1}),my=e=>({test:t=>gy(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),cd=my("deg"),Xl=my("%"),Lt=my("px"),Lce=my("vh"),Ace=my("vw"),hA=Object.assign(Object.assign({},Xl),{parse:e=>Xl.parse(e)/100,transform:e=>Xl.transform(e*100)}),R_=(e,t)=>n=>Boolean(gy(n)&&Tce.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),yB=(e,t,n)=>r=>{if(!gy(r))return r;const[i,o,a,s]=r.match(_2);return{[e]:parseFloat(i),[t]:parseFloat(o),[n]:parseFloat(a),alpha:s!==void 0?parseFloat(s):1}},Ch={test:R_("hsl","hue"),parse:yB("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Xl.transform(zv(t))+", "+Xl.transform(zv(n))+", "+zv(Hv.transform(r))+")"},Oce=vB(0,255),d6=Object.assign(Object.assign({},rp),{transform:e=>Math.round(Oce(e))}),wd={test:R_("rgb","red"),parse:yB("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+d6.transform(e)+", "+d6.transform(t)+", "+d6.transform(n)+", "+zv(Hv.transform(r))+")"};function Mce(e){let t="",n="",r="",i="";return e.length>5?(t=e.substr(1,2),n=e.substr(3,2),r=e.substr(5,2),i=e.substr(7,2)):(t=e.substr(1,1),n=e.substr(2,1),r=e.substr(3,1),i=e.substr(4,1),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const v7={test:R_("#"),parse:Mce,transform:wd.transform},So={test:e=>wd.test(e)||v7.test(e)||Ch.test(e),parse:e=>wd.test(e)?wd.parse(e):Ch.test(e)?Ch.parse(e):v7.parse(e),transform:e=>gy(e)?e:e.hasOwnProperty("red")?wd.transform(e):Ch.transform(e)},bB="${c}",SB="${n}";function Ice(e){var t,n,r,i;return isNaN(e)&&gy(e)&&((n=(t=e.match(_2))===null||t===void 0?void 0:t.length)!==null&&n!==void 0?n:0)+((i=(r=e.match(m7))===null||r===void 0?void 0:r.length)!==null&&i!==void 0?i:0)>0}function xB(e){typeof e=="number"&&(e=`${e}`);const t=[];let n=0;const r=e.match(m7);r&&(n=r.length,e=e.replace(m7,bB),t.push(...r.map(So.parse)));const i=e.match(_2);return i&&(e=e.replace(_2,SB),t.push(...i.map(rp.parse))),{values:t,numColors:n,tokenised:e}}function wB(e){return xB(e).values}function CB(e){const{values:t,numColors:n,tokenised:r}=xB(e),i=t.length;return o=>{let a=r;for(let s=0;stypeof e=="number"?0:e;function Dce(e){const t=wB(e);return CB(e)(t.map(Rce))}const Ju={test:Ice,parse:wB,createTransformer:CB,getAnimatableNone:Dce},Nce=new Set(["brightness","contrast","saturate","opacity"]);function jce(e){let[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(_2)||[];if(!r)return e;const i=n.replace(r,"");let o=Nce.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+i+")"}const Bce=/([a-z-]*)\(.*?\)/g,y7=Object.assign(Object.assign({},Ju),{getAnimatableNone:e=>{const t=e.match(Bce);return t?t.map(jce).join(" "):e}}),pA={...rp,transform:Math.round},_B={borderWidth:Lt,borderTopWidth:Lt,borderRightWidth:Lt,borderBottomWidth:Lt,borderLeftWidth:Lt,borderRadius:Lt,radius:Lt,borderTopLeftRadius:Lt,borderTopRightRadius:Lt,borderBottomRightRadius:Lt,borderBottomLeftRadius:Lt,width:Lt,maxWidth:Lt,height:Lt,maxHeight:Lt,size:Lt,top:Lt,right:Lt,bottom:Lt,left:Lt,padding:Lt,paddingTop:Lt,paddingRight:Lt,paddingBottom:Lt,paddingLeft:Lt,margin:Lt,marginTop:Lt,marginRight:Lt,marginBottom:Lt,marginLeft:Lt,rotate:cd,rotateX:cd,rotateY:cd,rotateZ:cd,scale:Y3,scaleX:Y3,scaleY:Y3,scaleZ:Y3,skew:cd,skewX:cd,skewY:cd,distance:Lt,translateX:Lt,translateY:Lt,translateZ:Lt,x:Lt,y:Lt,z:Lt,perspective:Lt,transformPerspective:Lt,opacity:Hv,originX:hA,originY:hA,originZ:Lt,zIndex:pA,fillOpacity:Hv,strokeOpacity:Hv,numOctaves:pA};function D_(e,t,n,r){const{style:i,vars:o,transform:a,transformKeys:s,transformOrigin:l}=e;s.length=0;let u=!1,d=!1,h=!0;for(const m in t){const y=t[m];if(mB(m)){o[m]=y;continue}const b=_B[m],S=Pce(y,b);if(g0.has(m)){if(u=!0,a[m]=S,s.push(m),!h)continue;y!==(b.default||0)&&(h=!1)}else m.startsWith("origin")?(d=!0,l[m]=S):i[m]=S}if(t.transform||(u||r?i.transform=Ece(e,n,h,r):i.transform&&(i.transform="none")),d){const{originX:m="50%",originY:y="50%",originZ:b=0}=l;i.transformOrigin=`${m} ${y} ${b}`}}const N_=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function kB(e,t,n){for(const r in t)!ou(t[r])&&!gB(r,n)&&(e[r]=t[r])}function Fce({transformTemplate:e},t,n){return w.useMemo(()=>{const r=N_();return D_(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)},[t])}function $ce(e,t,n){const r=e.style||{},i={};return kB(i,r,e),Object.assign(i,Fce(e,t,n)),e.transformValues?e.transformValues(i):i}function zce(e,t,n){const r={},i=$ce(e,t,n);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),r.style=i,r}const Hce=["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"],Vce=["whileTap","onTap","onTapStart","onTapCancel"],Wce=["onPan","onPanStart","onPanSessionStart","onPanEnd"],Uce=["whileInView","onViewportEnter","onViewportLeave","viewport"],Gce=new Set(["initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","layoutDependency","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","dragSnapToOrigin","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","onHoverStart","onHoverEnd","layoutScroll",...Uce,...Vce,...Hce,...Wce]);function J4(e){return Gce.has(e)}let EB=e=>!J4(e);function qce(e){e&&(EB=t=>t.startsWith("on")?!J4(t):e(t))}try{qce(require("@emotion/is-prop-valid").default)}catch{}function Yce(e,t,n){const r={};for(const i in e)(EB(i)||n===!0&&J4(i)||!t&&!J4(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function gA(e,t,n){return typeof e=="string"?e:Lt.transform(t+n*e)}function Kce(e,t,n){const r=gA(t,e.x,e.width),i=gA(n,e.y,e.height);return`${r} ${i}`}const Xce={offset:"stroke-dashoffset",array:"stroke-dasharray"},Zce={offset:"strokeDashoffset",array:"strokeDasharray"};function Qce(e,t,n=1,r=0,i=!0){e.pathLength=1;const o=i?Xce:Zce;e[o.offset]=Lt.transform(-r);const a=Lt.transform(t),s=Lt.transform(n);e[o.array]=`${a} ${s}`}function j_(e,{attrX:t,attrY:n,originX:r,originY:i,pathLength:o,pathSpacing:a=1,pathOffset:s=0,...l},u,d){D_(e,l,u,d),e.attrs=e.style,e.style={};const{attrs:h,style:m,dimensions:y}=e;h.transform&&(y&&(m.transform=h.transform),delete h.transform),y&&(r!==void 0||i!==void 0||m.transform)&&(m.transformOrigin=Kce(y,r!==void 0?r:.5,i!==void 0?i:.5)),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),o!==void 0&&Qce(h,o,a,s,!1)}const PB=()=>({...N_(),attrs:{}});function Jce(e,t){const n=w.useMemo(()=>{const r=PB();return j_(r,t,{enableHardwareAcceleration:!1},e.transformTemplate),{...r.attrs,style:{...r.style}}},[t]);if(e.style){const r={};kB(r,e.style,e),n.style={...r,...n.style}}return n}function ede(e=!1){return(n,r,i,o,{latestValues:a},s)=>{const u=(I_(n)?Jce:zce)(r,a,s),h={...Yce(r,typeof n=="string",e),...u,ref:o};return i&&(h["data-projection-id"]=i),w.createElement(n,h)}}const TB=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function LB(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const o in n)e.style.setProperty(o,n[o])}const AB=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength"]);function OB(e,t,n,r){LB(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(AB.has(i)?i:TB(i),t.attrs[i])}function B_(e){const{style:t}=e,n={};for(const r in t)(ou(t[r])||gB(r,e))&&(n[r]=t[r]);return n}function MB(e){const t=B_(e);for(const n in e)if(ou(e[n])){const r=n==="x"||n==="y"?"attr"+n.toUpperCase():n;t[r]=e[n]}return t}function F_(e,t,n,r={},i={}){return typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,i)),typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,i)),t}const k2=e=>Array.isArray(e),tde=e=>Boolean(e&&typeof e=="object"&&e.mix&&e.toValue),IB=e=>k2(e)?e[e.length-1]||0:e;function c4(e){const t=ou(e)?e.get():e;return tde(t)?t.toValue():t}function nde({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,i,o){const a={latestValues:rde(r,i,o,e),renderState:t()};return n&&(a.mount=s=>n(r,s,a)),a}const RB=e=>(t,n)=>{const r=w.useContext(jS),i=w.useContext(p0),o=()=>nde(e,t,r,i);return n?o():$S(o)};function rde(e,t,n,r){const i={},o=r(e);for(const m in o)i[m]=c4(o[m]);let{initial:a,animate:s}=e;const l=FS(e),u=hB(e);t&&u&&!l&&e.inherit!==!1&&(a===void 0&&(a=t.initial),s===void 0&&(s=t.animate));let d=n?n.initial===!1:!1;d=d||a===!1;const h=d?s:a;return h&&typeof h!="boolean"&&!BS(h)&&(Array.isArray(h)?h:[h]).forEach(y=>{const b=F_(e,y);if(!b)return;const{transitionEnd:S,transition:E,...k}=b;for(const _ in k){let T=k[_];if(Array.isArray(T)){const A=d?T.length-1:0;T=T[A]}T!==null&&(i[_]=T)}for(const _ in S)i[_]=S[_]}),i}const ide={useVisualState:RB({scrapeMotionValuesFromProps:MB,createRenderState:PB,onMount:(e,t,{renderState:n,latestValues:r})=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}j_(n,r,{enableHardwareAcceleration:!1},e.transformTemplate),OB(t,n)}})},ode={useVisualState:RB({scrapeMotionValuesFromProps:B_,createRenderState:N_})};function ade(e,{forwardMotionProps:t=!1},n,r,i){return{...I_(e)?ide:ode,preloadedFeatures:n,useRender:ede(t),createVisualElement:r,projectionNodeConstructor:i,Component:e}}var tr;(function(e){e.Animate="animate",e.Hover="whileHover",e.Tap="whileTap",e.Drag="whileDrag",e.Focus="whileFocus",e.InView="whileInView",e.Exit="exit"})(tr||(tr={}));function zS(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function b7(e,t,n,r){w.useEffect(()=>{const i=e.current;if(n&&i)return zS(i,t,n,r)},[e,t,n,r])}function sde({whileFocus:e,visualElement:t}){const{animationState:n}=t,r=()=>{n&&n.setActive(tr.Focus,!0)},i=()=>{n&&n.setActive(tr.Focus,!1)};b7(t,"focus",e?r:void 0),b7(t,"blur",e?i:void 0)}function DB(e){return typeof PointerEvent<"u"&&e instanceof PointerEvent?e.pointerType==="mouse":e instanceof MouseEvent}function NB(e){return!!e.touches}function lde(e){return t=>{const n=t instanceof MouseEvent;(!n||n&&t.button===0)&&e(t)}}const ude={pageX:0,pageY:0};function cde(e,t="page"){const r=e.touches[0]||e.changedTouches[0]||ude;return{x:r[t+"X"],y:r[t+"Y"]}}function dde(e,t="page"){return{x:e[t+"X"],y:e[t+"Y"]}}function $_(e,t="page"){return{point:NB(e)?cde(e,t):dde(e,t)}}const jB=(e,t=!1)=>{const n=r=>e(r,$_(r));return t?lde(n):n},fde=()=>np&&window.onpointerdown===null,hde=()=>np&&window.ontouchstart===null,pde=()=>np&&window.onmousedown===null,gde={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},mde={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function BB(e){return fde()?e:hde()?mde[e]:pde()?gde[e]:e}function Sm(e,t,n,r){return zS(e,BB(t),jB(n,t==="pointerdown"),r)}function e5(e,t,n,r){return b7(e,BB(t),n&&jB(n,t==="pointerdown"),r)}function FB(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const mA=FB("dragHorizontal"),vA=FB("dragVertical");function $B(e){let t=!1;if(e==="y")t=vA();else if(e==="x")t=mA();else{const n=mA(),r=vA();n&&r?t=()=>{n(),r()}:(n&&n(),r&&r())}return t}function zB(){const e=$B(!0);return e?(e(),!1):!0}function yA(e,t,n){return(r,i)=>{!DB(r)||zB()||(e.animationState&&e.animationState.setActive(tr.Hover,t),n&&n(r,i))}}function vde({onHoverStart:e,onHoverEnd:t,whileHover:n,visualElement:r}){e5(r,"pointerenter",e||n?yA(r,!0,e):void 0,{passive:!e}),e5(r,"pointerleave",t||n?yA(r,!1,t):void 0,{passive:!t})}const HB=(e,t)=>t?e===t?!0:HB(e,t.parentElement):!1;function z_(e){return w.useEffect(()=>()=>e(),[])}function VB(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 i=0,r=Object.getOwnPropertySymbols(e);iMath.min(Math.max(n,e),t),f6=.001,bde=.01,bA=10,Sde=.05,xde=1;function wde({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let i,o;yde(e<=bA*1e3);let a=1-t;a=n5(Sde,xde,a),e=n5(bde,bA,e/1e3),a<1?(i=u=>{const d=u*a,h=d*e,m=d-n,y=S7(u,a),b=Math.exp(-h);return f6-m/y*b},o=u=>{const h=u*a*e,m=h*n+n,y=Math.pow(a,2)*Math.pow(u,2)*e,b=Math.exp(-h),S=S7(Math.pow(u,2),a);return(-i(u)+f6>0?-1:1)*((m-y)*b)/S}):(i=u=>{const d=Math.exp(-u*e),h=(u-n)*e+1;return-f6+d*h},o=u=>{const d=Math.exp(-u*e),h=(n-u)*(e*e);return d*h});const s=5/e,l=_de(i,o,s);if(e=e*1e3,isNaN(l))return{stiffness:100,damping:10,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:a*2*Math.sqrt(r*u),duration:e}}}const Cde=12;function _de(e,t,n){let r=n;for(let i=1;ie[n]!==void 0)}function Pde(e){let t=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},e);if(!SA(e,Ede)&&SA(e,kde)){const n=wde(e);t=Object.assign(Object.assign(Object.assign({},t),n),{velocity:0,mass:1}),t.isResolvedFromDuration=!0}return t}function H_(e){var{from:t=0,to:n=1,restSpeed:r=2,restDelta:i}=e,o=VB(e,["from","to","restSpeed","restDelta"]);const a={done:!1,value:t};let{stiffness:s,damping:l,mass:u,velocity:d,duration:h,isResolvedFromDuration:m}=Pde(o),y=xA,b=xA;function S(){const E=d?-(d/1e3):0,k=n-t,_=l/(2*Math.sqrt(s*u)),T=Math.sqrt(s/u)/1e3;if(i===void 0&&(i=Math.min(Math.abs(n-t)/100,.4)),_<1){const A=S7(T,_);y=I=>{const R=Math.exp(-_*T*I);return n-R*((E+_*T*k)/A*Math.sin(A*I)+k*Math.cos(A*I))},b=I=>{const R=Math.exp(-_*T*I);return _*T*R*(Math.sin(A*I)*(E+_*T*k)/A+k*Math.cos(A*I))-R*(Math.cos(A*I)*(E+_*T*k)-A*k*Math.sin(A*I))}}else if(_===1)y=A=>n-Math.exp(-T*A)*(k+(E+T*k)*A);else{const A=T*Math.sqrt(_*_-1);y=I=>{const R=Math.exp(-_*T*I),D=Math.min(A*I,300);return n-R*((E+_*T*k)*Math.sinh(D)+A*k*Math.cosh(D))/A}}}return S(),{next:E=>{const k=y(E);if(m)a.done=E>=h;else{const _=b(E)*1e3,T=Math.abs(_)<=r,A=Math.abs(n-k)<=i;a.done=T&&A}return a.value=a.done?n:k,a},flipTarget:()=>{d=-d,[t,n]=[n,t],S()}}}H_.needsInterpolation=(e,t)=>typeof e=="string"||typeof t=="string";const xA=e=>0,E2=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},$r=(e,t,n)=>-n*e+n*t+e;function h6(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function wA({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,o=0,a=0;if(!t)i=o=a=n;else{const s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;i=h6(l,s,e+1/3),o=h6(l,s,e),a=h6(l,s,e-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(a*255),alpha:r}}const Tde=(e,t,n)=>{const r=e*e,i=t*t;return Math.sqrt(Math.max(0,n*(i-r)+r))},Lde=[v7,wd,Ch],CA=e=>Lde.find(t=>t.test(e)),WB=(e,t)=>{let n=CA(e),r=CA(t),i=n.parse(e),o=r.parse(t);n===Ch&&(i=wA(i),n=wd),r===Ch&&(o=wA(o),r=wd);const a=Object.assign({},i);return s=>{for(const l in a)l!=="alpha"&&(a[l]=Tde(i[l],o[l],s));return a.alpha=$r(i.alpha,o.alpha,s),n.transform(a)}},x7=e=>typeof e=="number",Ade=(e,t)=>n=>t(e(n)),HS=(...e)=>e.reduce(Ade);function UB(e,t){return x7(e)?n=>$r(e,t,n):So.test(e)?WB(e,t):qB(e,t)}const GB=(e,t)=>{const n=[...e],r=n.length,i=e.map((o,a)=>UB(o,t[a]));return o=>{for(let a=0;a{const n=Object.assign(Object.assign({},e),t),r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=UB(e[i],t[i]));return i=>{for(const o in r)n[o]=r[o](i);return n}};function _A(e){const t=Ju.parse(e),n=t.length;let r=0,i=0,o=0;for(let a=0;a{const n=Ju.createTransformer(t),r=_A(e),i=_A(t);return r.numHSL===i.numHSL&&r.numRGB===i.numRGB&&r.numNumbers>=i.numNumbers?HS(GB(r.parsed,i.parsed),n):a=>`${a>0?t:e}`},Mde=(e,t)=>n=>$r(e,t,n);function Ide(e){if(typeof e=="number")return Mde;if(typeof e=="string")return So.test(e)?WB:qB;if(Array.isArray(e))return GB;if(typeof e=="object")return Ode}function Rde(e,t,n){const r=[],i=n||Ide(e[0]),o=e.length-1;for(let a=0;an(E2(e,t,r))}function Nde(e,t){const n=e.length,r=n-1;return i=>{let o=0,a=!1;if(i<=e[0]?a=!0:i>=e[r]&&(o=r-1,a=!0),!a){let l=1;for(;li||l===r);l++);o=l-1}const s=E2(e[o],e[o+1],i);return t[o](s)}}function YB(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const o=e.length;t5(o===t.length),t5(!r||!Array.isArray(r)||r.length===o-1),e[0]>e[o-1]&&(e=[].concat(e),t=[].concat(t),e.reverse(),t.reverse());const a=Rde(t,r,i),s=o===2?Dde(e,a):Nde(e,a);return n?l=>s(n5(e[0],e[o-1],l)):s}const VS=e=>t=>1-e(1-t),V_=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,jde=e=>t=>Math.pow(t,e),KB=e=>t=>t*t*((e+1)*t-e),Bde=e=>{const t=KB(e);return n=>(n*=2)<1?.5*t(n):.5*(2-Math.pow(2,-10*(n-1)))},XB=1.525,Fde=4/11,$de=8/11,zde=9/10,W_=e=>e,U_=jde(2),Hde=VS(U_),ZB=V_(U_),QB=e=>1-Math.sin(Math.acos(e)),G_=VS(QB),Vde=V_(G_),q_=KB(XB),Wde=VS(q_),Ude=V_(q_),Gde=Bde(XB),qde=4356/361,Yde=35442/1805,Kde=16061/1805,r5=e=>{if(e===1||e===0)return e;const t=e*e;return ee<.5?.5*(1-r5(1-e*2)):.5*r5(e*2-1)+.5;function Qde(e,t){return e.map(()=>t||ZB).splice(0,e.length-1)}function Jde(e){const t=e.length;return e.map((n,r)=>r!==0?r/(t-1):0)}function efe(e,t){return e.map(n=>n*t)}function d4({from:e=0,to:t=1,ease:n,offset:r,duration:i=300}){const o={done:!1,value:e},a=Array.isArray(t)?t:[e,t],s=efe(r&&r.length===a.length?r:Jde(a),i);function l(){return YB(s,a,{ease:Array.isArray(n)?n:Qde(a,n)})}let u=l();return{next:d=>(o.value=u(d),o.done=d>=i,o),flipTarget:()=>{a.reverse(),u=l()}}}function tfe({velocity:e=0,from:t=0,power:n=.8,timeConstant:r=350,restDelta:i=.5,modifyTarget:o}){const a={done:!1,value:t};let s=n*e;const l=t+s,u=o===void 0?l:o(l);return u!==l&&(s=u-t),{next:d=>{const h=-s*Math.exp(-d/r);return a.done=!(h>i||h<-i),a.value=a.done?u:u+h,a},flipTarget:()=>{}}}const kA={keyframes:d4,spring:H_,decay:tfe};function nfe(e){if(Array.isArray(e.to))return d4;if(kA[e.type])return kA[e.type];const t=new Set(Object.keys(e));return t.has("ease")||t.has("duration")&&!t.has("dampingRatio")?d4:t.has("dampingRatio")||t.has("stiffness")||t.has("mass")||t.has("damping")||t.has("restSpeed")||t.has("restDelta")?H_:d4}const JB=1/60*1e3,rfe=typeof performance<"u"?()=>performance.now():()=>Date.now(),eF=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(rfe()),JB);function ife(e){let t=[],n=[],r=0,i=!1,o=!1;const a=new WeakSet,s={schedule:(l,u=!1,d=!1)=>{const h=d&&i,m=h?t:n;return u&&a.add(l),m.indexOf(l)===-1&&(m.push(l),h&&i&&(r=t.length)),l},cancel:l=>{const u=n.indexOf(l);u!==-1&&n.splice(u,1),a.delete(l)},process:l=>{if(i){o=!0;return}if(i=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let u=0;u(e[t]=ife(()=>P2=!0),e),{}),afe=vy.reduce((e,t)=>{const n=WS[t];return e[t]=(r,i=!1,o=!1)=>(P2||ufe(),n.schedule(r,i,o)),e},{}),sfe=vy.reduce((e,t)=>(e[t]=WS[t].cancel,e),{});vy.reduce((e,t)=>(e[t]=()=>WS[t].process(xm),e),{});const lfe=e=>WS[e].process(xm),tF=e=>{P2=!1,xm.delta=w7?JB:Math.max(Math.min(e-xm.timestamp,ofe),1),xm.timestamp=e,C7=!0,vy.forEach(lfe),C7=!1,P2&&(w7=!1,eF(tF))},ufe=()=>{P2=!0,w7=!0,C7||eF(tF)},cfe=()=>xm;function nF(e,t,n=0){return e-t-n}function dfe(e,t,n=0,r=!0){return r?nF(t+-e,t,n):t-(e-t)+n}function ffe(e,t,n,r){return r?e>=t+n:e<=-n}const hfe=e=>{const t=({delta:n})=>e(n);return{start:()=>afe.update(t,!0),stop:()=>sfe.update(t)}};function rF(e){var t,n,{from:r,autoplay:i=!0,driver:o=hfe,elapsed:a=0,repeat:s=0,repeatType:l="loop",repeatDelay:u=0,onPlay:d,onStop:h,onComplete:m,onRepeat:y,onUpdate:b}=e,S=VB(e,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:E}=S,k,_=0,T=S.duration,A,I=!1,R=!0,D;const j=nfe(S);!((n=(t=j).needsInterpolation)===null||n===void 0)&&n.call(t,r,E)&&(D=YB([0,100],[r,E],{clamp:!1}),r=0,E=100);const z=j(Object.assign(Object.assign({},S),{from:r,to:E}));function V(){_++,l==="reverse"?(R=_%2===0,a=dfe(a,T,u,R)):(a=nF(a,T,u),l==="mirror"&&z.flipTarget()),I=!1,y&&y()}function K(){k.stop(),m&&m()}function te(F){if(R||(F=-F),a+=F,!I){const U=z.next(Math.max(0,a));A=U.value,D&&(A=D(A)),I=R?U.done:a<=0}b==null||b(A),I&&(_===0&&(T??(T=a)),_{h==null||h(),k.stop()}}}function iF(e,t){return t?e*(1e3/t):0}function pfe({from:e=0,velocity:t=0,min:n,max:r,power:i=.8,timeConstant:o=750,bounceStiffness:a=500,bounceDamping:s=10,restDelta:l=1,modifyTarget:u,driver:d,onUpdate:h,onComplete:m,onStop:y}){let b;function S(T){return n!==void 0&&Tr}function E(T){return n===void 0?r:r===void 0||Math.abs(n-T){var I;h==null||h(A),(I=T.onUpdate)===null||I===void 0||I.call(T,A)},onComplete:m,onStop:y}))}function _(T){k(Object.assign({type:"spring",stiffness:a,damping:s,restDelta:l},T))}if(S(e))_({from:e,velocity:t,to:E(e)});else{let T=i*t+e;typeof u<"u"&&(T=u(T));const A=E(T),I=A===n?-1:1;let R,D;const j=z=>{R=D,D=z,t=iF(z-R,cfe().delta),(I===1&&z>A||I===-1&&zb==null?void 0:b.stop()}}const _7=e=>e.hasOwnProperty("x")&&e.hasOwnProperty("y"),EA=e=>_7(e)&&e.hasOwnProperty("z"),K3=(e,t)=>Math.abs(e-t);function Y_(e,t){if(x7(e)&&x7(t))return K3(e,t);if(_7(e)&&_7(t)){const n=K3(e.x,t.x),r=K3(e.y,t.y),i=EA(e)&&EA(t)?K3(e.z,t.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(r,2)+Math.pow(i,2))}}const oF=(e,t)=>1-3*t+3*e,aF=(e,t)=>3*t-6*e,sF=e=>3*e,i5=(e,t,n)=>((oF(t,n)*e+aF(t,n))*e+sF(t))*e,lF=(e,t,n)=>3*oF(t,n)*e*e+2*aF(t,n)*e+sF(t),gfe=1e-7,mfe=10;function vfe(e,t,n,r,i){let o,a,s=0;do a=t+(n-t)/2,o=i5(a,r,i)-e,o>0?n=a:t=a;while(Math.abs(o)>gfe&&++s=bfe?Sfe(a,h,e,n):m===0?h:vfe(a,s,s+X3,e,n)}return a=>a===0||a===1?a:i5(o(a),t,r)}function wfe({onTap:e,onTapStart:t,onTapCancel:n,whileTap:r,visualElement:i}){const o=e||t||n||r,a=w.useRef(!1),s=w.useRef(null),l={passive:!(t||e||n||y)};function u(){s.current&&s.current(),s.current=null}function d(){return u(),a.current=!1,i.animationState&&i.animationState.setActive(tr.Tap,!1),!zB()}function h(b,S){d()&&(HB(i.current,b.target)?e&&e(b,S):n&&n(b,S))}function m(b,S){d()&&n&&n(b,S)}function y(b,S){u(),!a.current&&(a.current=!0,s.current=HS(Sm(window,"pointerup",h,l),Sm(window,"pointercancel",m,l)),i.animationState&&i.animationState.setActive(tr.Tap,!0),t&&t(b,S))}e5(i,"pointerdown",o?y:void 0,l),z_(u)}const Cfe="production",uF=typeof process>"u"||process.env===void 0?Cfe:"production",PA=new Set;function cF(e,t,n){e||PA.has(t)||(console.warn(t),n&&console.warn(n),PA.add(t))}const k7=new WeakMap,p6=new WeakMap,_fe=e=>{const t=k7.get(e.target);t&&t(e)},kfe=e=>{e.forEach(_fe)};function Efe({root:e,...t}){const n=e||document;p6.has(n)||p6.set(n,{});const r=p6.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(kfe,{root:e,...t})),r[i]}function Pfe(e,t,n){const r=Efe(t);return k7.set(e,n),r.observe(e),()=>{k7.delete(e),r.unobserve(e)}}function Tfe({visualElement:e,whileInView:t,onViewportEnter:n,onViewportLeave:r,viewport:i={}}){const o=w.useRef({hasEnteredView:!1,isInView:!1});let a=Boolean(t||n||r);i.once&&o.current.hasEnteredView&&(a=!1),(typeof IntersectionObserver>"u"?Ofe:Afe)(a,o.current,e,i)}const Lfe={some:0,all:1};function Afe(e,t,n,{root:r,margin:i,amount:o="some",once:a}){w.useEffect(()=>{if(!e||!n.current)return;const s={root:r==null?void 0:r.current,rootMargin:i,threshold:typeof o=="number"?o:Lfe[o]},l=u=>{const{isIntersecting:d}=u;if(t.isInView===d||(t.isInView=d,a&&!d&&t.hasEnteredView))return;d&&(t.hasEnteredView=!0),n.animationState&&n.animationState.setActive(tr.InView,d);const h=n.getProps(),m=d?h.onViewportEnter:h.onViewportLeave;m&&m(u)};return Pfe(n.current,s,l)},[e,r,i,o])}function Ofe(e,t,n,{fallback:r=!0}){w.useEffect(()=>{!e||!r||(uF!=="production"&&cF(!1,"IntersectionObserver not available on this device. whileInView animations will trigger on mount."),requestAnimationFrame(()=>{t.hasEnteredView=!0;const{onViewportEnter:i}=n.getProps();i&&i(null),n.animationState&&n.animationState.setActive(tr.InView,!0)}))},[e])}const Cd=e=>t=>(e(t),null),Mfe={inView:Cd(Tfe),tap:Cd(wfe),focus:Cd(sde),hover:Cd(vde)};function K_(){const e=w.useContext(p0);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,i=w.useId();return w.useEffect(()=>r(i),[]),!t&&n?[!1,()=>n&&n(i)]:[!0]}function Ife(){return Rfe(w.useContext(p0))}function Rfe(e){return e===null?!0:e.isPresent}function dF(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;re*1e3,Dfe={linear:W_,easeIn:U_,easeInOut:ZB,easeOut:Hde,circIn:QB,circInOut:Vde,circOut:G_,backIn:q_,backInOut:Ude,backOut:Wde,anticipate:Gde,bounceIn:Xde,bounceInOut:Zde,bounceOut:r5},TA=e=>{if(Array.isArray(e)){t5(e.length===4);const[t,n,r,i]=e;return xfe(t,n,r,i)}else if(typeof e=="string")return Dfe[e];return e},Nfe=e=>Array.isArray(e)&&typeof e[0]!="number",LA=(e,t)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&Ju.test(t)&&!t.startsWith("url(")),rh=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),Z3=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),g6=()=>({type:"keyframes",ease:"linear",duration:.3}),jfe=e=>({type:"keyframes",duration:.8,values:e}),AA={x:rh,y:rh,z:rh,rotate:rh,rotateX:rh,rotateY:rh,rotateZ:rh,scaleX:Z3,scaleY:Z3,scale:Z3,opacity:g6,backgroundColor:g6,color:g6,default:Z3},Bfe=(e,t)=>{let n;return k2(t)?n=jfe:n=AA[e]||AA.default,{to:t,...n(t)}},Ffe={..._B,color:So,backgroundColor:So,outlineColor:So,fill:So,stroke:So,borderColor:So,borderTopColor:So,borderRightColor:So,borderBottomColor:So,borderLeftColor:So,filter:y7,WebkitFilter:y7},X_=e=>Ffe[e];function Z_(e,t){var n;let r=X_(e);return r!==y7&&(r=Ju),(n=r.getAnimatableNone)===null||n===void 0?void 0:n.call(r,t)}const $fe={current:!1},fF=1/60*1e3,zfe=typeof performance<"u"?()=>performance.now():()=>Date.now(),hF=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(zfe()),fF);function Hfe(e){let t=[],n=[],r=0,i=!1,o=!1;const a=new WeakSet,s={schedule:(l,u=!1,d=!1)=>{const h=d&&i,m=h?t:n;return u&&a.add(l),m.indexOf(l)===-1&&(m.push(l),h&&i&&(r=t.length)),l},cancel:l=>{const u=n.indexOf(l);u!==-1&&n.splice(u,1),a.delete(l)},process:l=>{if(i){o=!0;return}if(i=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let u=0;u(e[t]=Hfe(()=>T2=!0),e),{}),Gs=yy.reduce((e,t)=>{const n=US[t];return e[t]=(r,i=!1,o=!1)=>(T2||Ufe(),n.schedule(r,i,o)),e},{}),Vh=yy.reduce((e,t)=>(e[t]=US[t].cancel,e),{}),m6=yy.reduce((e,t)=>(e[t]=()=>US[t].process(wm),e),{}),Wfe=e=>US[e].process(wm),pF=e=>{T2=!1,wm.delta=E7?fF:Math.max(Math.min(e-wm.timestamp,Vfe),1),wm.timestamp=e,P7=!0,yy.forEach(Wfe),P7=!1,T2&&(E7=!1,hF(pF))},Ufe=()=>{T2=!0,E7=!0,P7||hF(pF)},T7=()=>wm;function gF(e,t){const n=performance.now(),r=({timestamp:i})=>{const o=i-n;o>=t&&(Vh.read(r),e(o-t))};return Gs.read(r,!0),()=>Vh.read(r)}function Gfe({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:o,repeatType:a,repeatDelay:s,from:l,...u}){return!!Object.keys(u).length}function qfe({ease:e,times:t,yoyo:n,flip:r,loop:i,...o}){const a={...o};return t&&(a.offset=t),o.duration&&(a.duration=o5(o.duration)),o.repeatDelay&&(a.repeatDelay=o5(o.repeatDelay)),e&&(a.ease=Nfe(e)?e.map(TA):TA(e)),o.type==="tween"&&(a.type="keyframes"),(n||i||r)&&(n?a.repeatType="reverse":i?a.repeatType="loop":r&&(a.repeatType="mirror"),a.repeat=i||n||r||o.repeat),o.type!=="spring"&&(a.type="keyframes"),a}function Yfe(e,t){var n,r;return(r=(n=(Q_(e,t)||{}).delay)!==null&&n!==void 0?n:e.delay)!==null&&r!==void 0?r:0}function Kfe(e){return Array.isArray(e.to)&&e.to[0]===null&&(e.to=[...e.to],e.to[0]=e.from),e}function Xfe(e,t,n){return Array.isArray(t.to)&&e.duration===void 0&&(e.duration=.8),Kfe(t),Gfe(e)||(e={...e,...Bfe(n,t.to)}),{...t,...qfe(e)}}function Zfe(e,t,n,r,i){const o=Q_(r,e)||{};let a=o.from!==void 0?o.from:t.get();const s=LA(e,n);a==="none"&&s&&typeof n=="string"?a=Z_(e,n):OA(a)&&typeof n=="string"?a=MA(n):!Array.isArray(n)&&OA(n)&&typeof a=="string"&&(n=MA(a));const l=LA(e,a);function u(){const h={from:a,to:n,velocity:t.getVelocity(),onComplete:i,onUpdate:m=>t.set(m)};return o.type==="inertia"||o.type==="decay"?pfe({...h,...o}):rF({...Xfe(o,h,e),onUpdate:m=>{h.onUpdate(m),o.onUpdate&&o.onUpdate(m)},onComplete:()=>{h.onComplete(),o.onComplete&&o.onComplete()}})}function d(){const h=IB(n);return t.set(h),i(),o.onUpdate&&o.onUpdate(h),o.onComplete&&o.onComplete(),{stop:()=>{}}}return!l||!s||o.type===!1?d:u}function OA(e){return e===0||typeof e=="string"&&parseFloat(e)===0&&e.indexOf(" ")===-1}function MA(e){return typeof e=="number"?0:Z_("",e)}function Q_(e,t){return e[t]||e.default||e}function J_(e,t,n,r={}){return $fe.current&&(r={type:!1}),t.start(i=>{let o;const a=Zfe(e,t,n,r,i),s=Yfe(r,e),l=()=>o=a();let u;return s?u=gF(l,o5(s)):l(),()=>{u&&u(),o&&o.stop()}})}const Qfe=e=>/^\-?\d*\.?\d+$/.test(e),Jfe=e=>/^0[^.\s]+$/.test(e);function ek(e,t){e.indexOf(t)===-1&&e.push(t)}function tk(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Vv{constructor(){this.subscriptions=[]}add(t){return ek(this.subscriptions,t),()=>tk(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let o=0;o!isNaN(parseFloat(e));class the{constructor(t){this.version="7.6.9",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new Vv,this.velocityUpdateSubscribers=new Vv,this.renderSubscribers=new Vv,this.canTrackVelocity=!1,this.updateAndNotify=(n,r=!0)=>{this.prev=this.current,this.current=n;const{delta:i,timestamp:o}=T7();this.lastUpdated!==o&&(this.timeDelta=i,this.lastUpdated=o,Gs.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.updateSubscribers.notify(this.current),this.velocityUpdateSubscribers.getSize()&&this.velocityUpdateSubscribers.notify(this.getVelocity()),r&&this.renderSubscribers.notify(this.current)},this.scheduleVelocityCheck=()=>Gs.postRender(this.velocityCheck),this.velocityCheck=({timestamp:n})=>{n!==this.lastUpdated&&(this.prev=this.current,this.velocityUpdateSubscribers.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=ehe(this.current)}onChange(t){return this.updateSubscribers.add(t)}clearListeners(){this.updateSubscribers.clear()}onRenderRequest(t){return t(this.get()),this.renderSubscribers.add(t)}attach(t){this.passiveEffect=t}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?iF(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.stopAnimation=t(n)}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()}}function Vm(e){return new the(e)}const mF=e=>t=>t.test(e),nhe={test:e=>e==="auto",parse:e=>e},vF=[rp,Lt,Xl,cd,Ace,Lce,nhe],V1=e=>vF.find(mF(e)),rhe=[...vF,So,Ju],ihe=e=>rhe.find(mF(e));function ohe(e){const t={};return e.values.forEach((n,r)=>t[r]=n.get()),t}function ahe(e){const t={};return e.values.forEach((n,r)=>t[r]=n.getVelocity()),t}function GS(e,t,n){const r=e.getProps();return F_(r,t,n!==void 0?n:r.custom,ohe(e),ahe(e))}function she(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Vm(n))}function lhe(e,t){const n=GS(e,t);let{transitionEnd:r={},transition:i={},...o}=n?e.makeTargetAnimatable(n,!1):{};o={...o,...r};for(const a in o){const s=IB(o[a]);she(e,a,s)}}function uhe(e,t,n){var r,i;const o=Object.keys(t).filter(s=>!e.hasValue(s)),a=o.length;if(a)for(let s=0;sL7(e,o,n));r=Promise.all(i)}else if(typeof t=="string")r=L7(e,t,n);else{const i=typeof t=="function"?GS(e,t,n.custom):t;r=yF(e,i,n)}return r.then(()=>e.notify("AnimationComplete",t))}function L7(e,t,n={}){var r;const i=GS(e,t,n.custom);let{transition:o=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(o=n.transitionOverride);const a=i?()=>yF(e,i,n):()=>Promise.resolve(),s=!((r=e.variantChildren)===null||r===void 0)&&r.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:h,staggerDirection:m}=o;return hhe(e,t,d+u,h,m,n)}:()=>Promise.resolve(),{when:l}=o;if(l){const[u,d]=l==="beforeChildren"?[a,s]:[s,a];return u().then(d)}else return Promise.all([a(),s(n.delay)])}function yF(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var o;let{transition:a=e.getDefaultTransition(),transitionEnd:s,...l}=e.makeTargetAnimatable(t);const u=e.getValue("willChange");r&&(a=r);const d=[],h=i&&((o=e.animationState)===null||o===void 0?void 0:o.getState()[i]);for(const m in l){const y=e.getValue(m),b=l[m];if(!y||b===void 0||h&&ghe(h,m))continue;let S={delay:n,...a};e.shouldReduceMotion&&g0.has(m)&&(S={...S,type:!1,delay:0});let E=J_(m,y,b,S);a5(u)&&(u.add(m),E=E.then(()=>u.remove(m))),d.push(E)}return Promise.all(d).then(()=>{s&&lhe(e,s)})}function hhe(e,t,n=0,r=0,i=1,o){const a=[],s=(e.variantChildren.size-1)*r,l=i===1?(u=0)=>u*r:(u=0)=>s-u*r;return Array.from(e.variantChildren).sort(phe).forEach((u,d)=>{a.push(L7(u,t,{...o,delay:n+l(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function phe(e,t){return e.sortNodePosition(t)}function ghe({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}const nk=[tr.Animate,tr.InView,tr.Focus,tr.Hover,tr.Tap,tr.Drag,tr.Exit],mhe=[...nk].reverse(),vhe=nk.length;function yhe(e){return t=>Promise.all(t.map(({animation:n,options:r})=>fhe(e,n,r)))}function bhe(e){let t=yhe(e);const n=xhe();let r=!0;const i=(l,u)=>{const d=GS(e,u);if(d){const{transition:h,transitionEnd:m,...y}=d;l={...l,...y,...m}}return l};function o(l){t=l(e)}function a(l,u){var d;const h=e.getProps(),m=e.getVariantContext(!0)||{},y=[],b=new Set;let S={},E=1/0;for(let _=0;_E&&R;const K=Array.isArray(I)?I:[I];let te=K.reduce(i,{});D===!1&&(te={});const{prevResolvedValues:q={}}=A,F={...q,...te},U=X=>{V=!0,b.delete(X),A.needsAnimating[X]=!0};for(const X in F){const Z=te[X],W=q[X];S.hasOwnProperty(X)||(Z!==W?k2(Z)&&k2(W)?!dF(Z,W)||z?U(X):A.protectedKeys[X]=!0:Z!==void 0?U(X):b.add(X):Z!==void 0&&b.has(X)?U(X):A.protectedKeys[X]=!0)}A.prevProp=I,A.prevResolvedValues=te,A.isActive&&(S={...S,...te}),r&&e.blockInitialAnimation&&(V=!1),V&&!j&&y.push(...K.map(X=>({animation:X,options:{type:T,...l}})))}if(b.size){const _={};b.forEach(T=>{const A=e.getBaseTarget(T);A!==void 0&&(_[T]=A)}),y.push({animation:_})}let k=Boolean(y.length);return r&&h.initial===!1&&!e.manuallyAnimateOnMount&&(k=!1),r=!1,k?t(y):Promise.resolve()}function s(l,u,d){var h;if(n[l].isActive===u)return Promise.resolve();(h=e.variantChildren)===null||h===void 0||h.forEach(y=>{var b;return(b=y.animationState)===null||b===void 0?void 0:b.setActive(l,u)}),n[l].isActive=u;const m=a(d,l);for(const y in n)n[y].protectedKeys={};return m}return{animateChanges:a,setActive:s,setAnimateFunction:o,getState:()=>n}}function She(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!dF(t,e):!1}function ih(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function xhe(){return{[tr.Animate]:ih(!0),[tr.InView]:ih(),[tr.Hover]:ih(),[tr.Tap]:ih(),[tr.Drag]:ih(),[tr.Focus]:ih(),[tr.Exit]:ih()}}const whe={animation:Cd(({visualElement:e,animate:t})=>{e.animationState||(e.animationState=bhe(e)),BS(t)&&w.useEffect(()=>t.subscribe(e),[t])}),exit:Cd(e=>{const{custom:t,visualElement:n}=e,[r,i]=K_(),o=w.useContext(p0);w.useEffect(()=>{n.isPresent=r;const a=n.animationState&&n.animationState.setActive(tr.Exit,!r,{custom:o&&o.custom||t});a&&!r&&a.then(i)},[r])})};class bF{constructor(t,n,{transformPagePoint:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=y6(this.lastMoveEventInfo,this.history),d=this.startEvent!==null,h=Y_(u.offset,{x:0,y:0})>=3;if(!d&&!h)return;const{point:m}=u,{timestamp:y}=T7();this.history.push({...m,timestamp:y});const{onStart:b,onMove:S}=this.handlers;d||(b&&b(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),S&&S(this.lastMoveEvent,u)},this.handlePointerMove=(u,d)=>{if(this.lastMoveEvent=u,this.lastMoveEventInfo=v6(d,this.transformPagePoint),DB(u)&&u.buttons===0){this.handlePointerUp(u,d);return}Gs.update(this.updatePoint,!0)},this.handlePointerUp=(u,d)=>{this.end();const{onEnd:h,onSessionEnd:m}=this.handlers,y=y6(v6(d,this.transformPagePoint),this.history);this.startEvent&&h&&h(u,y),m&&m(u,y)},NB(t)&&t.touches.length>1)return;this.handlers=n,this.transformPagePoint=r;const i=$_(t),o=v6(i,this.transformPagePoint),{point:a}=o,{timestamp:s}=T7();this.history=[{...a,timestamp:s}];const{onSessionStart:l}=n;l&&l(t,y6(o,this.history)),this.removeListeners=HS(Sm(window,"pointermove",this.handlePointerMove),Sm(window,"pointerup",this.handlePointerUp),Sm(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Vh.update(this.updatePoint)}}function v6(e,t){return t?{point:t(e.point)}:e}function IA(e,t){return{x:e.x-t.x,y:e.y-t.y}}function y6({point:e},t){return{point:e,delta:IA(e,SF(t)),offset:IA(e,Che(t)),velocity:_he(t,.1)}}function Che(e){return e[0]}function SF(e){return e[e.length-1]}function _he(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=SF(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>o5(t)));)n--;if(!r)return{x:0,y:0};const o=(i.timestamp-r.timestamp)/1e3;if(o===0)return{x:0,y:0};const a={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function Oa(e){return e.max-e.min}function RA(e,t=0,n=.01){return Y_(e,t)n&&(e=r?$r(n,e,r.max):Math.min(e,n)),e}function BA(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function Phe(e,{top:t,left:n,bottom:r,right:i}){return{x:BA(e.x,n,i),y:BA(e.y,t,r)}}function FA(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=E2(t.min,t.max-r,e.min):r>i&&(n=E2(e.min,e.max-i,t.min)),n5(0,1,n)}function Ahe(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const A7=.35;function Ohe(e=A7){return e===!1?e=0:e===!0&&(e=A7),{x:$A(e,"left","right"),y:$A(e,"top","bottom")}}function $A(e,t,n){return{min:zA(e,t),max:zA(e,n)}}function zA(e,t){var n;return typeof e=="number"?e:(n=e[t])!==null&&n!==void 0?n:0}const HA=()=>({translate:0,scale:1,origin:0,originPoint:0}),Gv=()=>({x:HA(),y:HA()}),VA=()=>({min:0,max:0}),pi=()=>({x:VA(),y:VA()});function Rl(e){return[e("x"),e("y")]}function xF({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Mhe({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Ihe(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function b6(e){return e===void 0||e===1}function O7({scale:e,scaleX:t,scaleY:n}){return!b6(e)||!b6(t)||!b6(n)}function ch(e){return O7(e)||wF(e)||e.z||e.rotate||e.rotateX||e.rotateY}function wF(e){return WA(e.x)||WA(e.y)}function WA(e){return e&&e!=="0%"}function s5(e,t,n){const r=e-n,i=t*r;return n+i}function UA(e,t,n,r,i){return i!==void 0&&(e=s5(e,i,r)),s5(e,n,r)+t}function M7(e,t=0,n=1,r,i){e.min=UA(e.min,t,n,r,i),e.max=UA(e.max,t,n,r,i)}function CF(e,{x:t,y:n}){M7(e.x,t.translate,t.scale,t.originPoint),M7(e.y,n.translate,n.scale,n.originPoint)}function Rhe(e,t,n,r=!1){var i,o;const a=n.length;if(!a)return;t.x=t.y=1;let s,l;for(let u=0;u{this.stopAnimation(),n&&this.snapToCursor($_(s,"page").point)},i=(s,l)=>{var u;const{drag:d,dragPropagation:h,onDragStart:m}=this.getProps();d&&!h&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=$B(d),!this.openGlobalLock)||(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Rl(y=>{var b,S;let E=this.getAxisMotionValue(y).get()||0;if(Xl.test(E)){const k=(S=(b=this.visualElement.projection)===null||b===void 0?void 0:b.layout)===null||S===void 0?void 0:S.layoutBox[y];k&&(E=Oa(k)*(parseFloat(E)/100))}this.originPoint[y]=E}),m==null||m(s,l),(u=this.visualElement.animationState)===null||u===void 0||u.setActive(tr.Drag,!0))},o=(s,l)=>{const{dragPropagation:u,dragDirectionLock:d,onDirectionLock:h,onDrag:m}=this.getProps();if(!u&&!this.openGlobalLock)return;const{offset:y}=l;if(d&&this.currentDirection===null){this.currentDirection=$he(y),this.currentDirection!==null&&(h==null||h(this.currentDirection));return}this.updateAxis("x",l.point,y),this.updateAxis("y",l.point,y),this.visualElement.render(),m==null||m(s,l)},a=(s,l)=>this.stop(s,l);this.panSession=new bF(t,{onSessionStart:r,onStart:i,onMove:o,onSessionEnd:a},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:o}=this.getProps();o==null||o(t,n)}cancel(){var t,n;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),(t=this.panSession)===null||t===void 0||t.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),(n=this.visualElement.animationState)===null||n===void 0||n.setActive(tr.Drag,!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!Q3(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=Ehe(a,this.constraints[t],this.elastic[t])),o.set(a)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),{layout:r}=this.visualElement.projection||{},i=this.constraints;t&&Hg(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=Phe(r.layoutBox,t):this.constraints=!1,this.elastic=Ohe(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Rl(o=>{this.getAxisMotionValue(o)&&(this.constraints[o]=Ahe(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Hg(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=jhe(r,i.root,this.visualElement.getTransformPagePoint());let a=The(i.layout.layoutBox,o);if(n){const s=n(Mhe(a));this.hasMutatedConstraints=!!s,s&&(a=xF(s))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:o,dragSnapToOrigin:a,onDragTransitionEnd:s}=this.getProps(),l=this.constraints||{},u=Rl(d=>{var h;if(!Q3(d,n,this.currentDirection))return;let m=(h=l==null?void 0:l[d])!==null&&h!==void 0?h:{};a&&(m={min:0,max:0});const y=i?200:1e6,b=i?40:1e7,S={type:"inertia",velocity:r?t[d]:0,bounceStiffness:y,bounceDamping:b,timeConstant:750,restDelta:1,restSpeed:10,...o,...m};return this.startAxisValueAnimation(d,S)});return Promise.all(u).then(s)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return J_(t,r,0,n)}stopAnimation(){Rl(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){var n,r;const i="_drag"+t.toUpperCase(),o=this.visualElement.getProps()[i];return o||this.visualElement.getValue(t,(r=(n=this.visualElement.getProps().initial)===null||n===void 0?void 0:n[t])!==null&&r!==void 0?r:0)}snapToCursor(t){Rl(n=>{const{drag:r}=this.getProps();if(!Q3(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:a,max:s}=i.layout.layoutBox[n];o.set(t[n]-$r(a,s,.5))}})}scalePositionWithinConstraints(){var t;if(!this.visualElement.current)return;const{drag:n,dragConstraints:r}=this.getProps(),{projection:i}=this.visualElement;if(!Hg(r)||!i||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Rl(s=>{const l=this.getAxisMotionValue(s);if(l){const u=l.get();o[s]=Lhe({min:u,max:u},this.constraints[s])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",(t=i.root)===null||t===void 0||t.updateScroll(),i.updateLayout(),this.resolveConstraints(),Rl(s=>{if(!Q3(s,n,null))return;const l=this.getAxisMotionValue(s),{min:u,max:d}=this.constraints[s];l.set($r(u,d,o[s]))})}addListeners(){var t;if(!this.visualElement.current)return;Bhe.set(this.visualElement,this);const n=this.visualElement.current,r=Sm(n,"pointerdown",u=>{const{drag:d,dragListener:h=!0}=this.getProps();d&&h&&this.start(u)}),i=()=>{const{dragConstraints:u}=this.getProps();Hg(u)&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,a=o.addEventListener("measure",i);o&&!o.layout&&((t=o.root)===null||t===void 0||t.updateScroll(),o.updateLayout()),i();const s=zS(window,"resize",()=>this.scalePositionWithinConstraints()),l=o.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d})=>{this.isDragging&&d&&(Rl(h=>{const m=this.getAxisMotionValue(h);m&&(this.originPoint[h]+=u[h].translate,m.set(m.get()+u[h].translate))}),this.visualElement.render())});return()=>{s(),r(),a(),l==null||l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:a=A7,dragMomentum:s=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:o,dragElastic:a,dragMomentum:s}}}function Q3(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function $he(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}function zhe(e){const{dragControls:t,visualElement:n}=e,r=$S(()=>new Fhe(n));w.useEffect(()=>t&&t.subscribe(r),[r,t]),w.useEffect(()=>r.addListeners(),[r])}function Hhe({onPan:e,onPanStart:t,onPanEnd:n,onPanSessionStart:r,visualElement:i}){const o=e||t||n||r,a=w.useRef(null),{transformPagePoint:s}=w.useContext(O_),l={onSessionStart:r,onStart:t,onMove:e,onEnd:(d,h)=>{a.current=null,n&&n(d,h)}};w.useEffect(()=>{a.current!==null&&a.current.updateHandlers(l)});function u(d){a.current=new bF(d,l,{transformPagePoint:s})}e5(i,"pointerdown",o&&u),z_(()=>a.current&&a.current.end())}const Vhe={pan:Cd(Hhe),drag:Cd(zhe)};function I7(e){return typeof e=="string"&&e.startsWith("var(--")}const kF=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Whe(e){const t=kF.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]}function R7(e,t,n=1){const[r,i]=Whe(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);return o?o.trim():I7(i)?R7(i,t,n+1):i}function Uhe(e,{...t},n){const r=e.current;if(!(r instanceof Element))return{target:t,transitionEnd:n};n&&(n={...n}),e.values.forEach(i=>{const o=i.get();if(!I7(o))return;const a=R7(o,r);a&&i.set(a)});for(const i in t){const o=t[i];if(!I7(o))continue;const a=R7(o,r);a&&(t[i]=a,n&&n[i]===void 0&&(n[i]=o))}return{target:t,transitionEnd:n}}const Ghe=new Set(["width","height","top","left","right","bottom","x","y"]),EF=e=>Ghe.has(e),qhe=e=>Object.keys(e).some(EF),PF=(e,t)=>{e.set(t,!1),e.set(t)},qA=e=>e===rp||e===Lt;var YA;(function(e){e.width="width",e.height="height",e.left="left",e.right="right",e.top="top",e.bottom="bottom"})(YA||(YA={}));const KA=(e,t)=>parseFloat(e.split(", ")[t]),XA=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/);if(i)return KA(i[1],t);{const o=r.match(/^matrix\((.+)\)$/);return o?KA(o[1],e):0}},Yhe=new Set(["x","y","z"]),Khe=Q4.filter(e=>!Yhe.has(e));function Xhe(e){const t=[];return Khe.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t.length&&e.render(),t}const ZA={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:XA(4,13),y:XA(5,14)},Zhe=(e,t,n)=>{const r=t.measureViewportBox(),i=t.current,o=getComputedStyle(i),{display:a}=o,s={};a==="none"&&t.setStaticValue("display",e.display||"block"),n.forEach(u=>{s[u]=ZA[u](r,o)}),t.render();const l=t.measureViewportBox();return n.forEach(u=>{const d=t.getValue(u);PF(d,s[u]),e[u]=ZA[u](l,o)}),e},Qhe=(e,t,n={},r={})=>{t={...t},r={...r};const i=Object.keys(t).filter(EF);let o=[],a=!1;const s=[];if(i.forEach(l=>{const u=e.getValue(l);if(!e.hasValue(l))return;let d=n[l],h=V1(d);const m=t[l];let y;if(k2(m)){const b=m.length,S=m[0]===null?1:0;d=m[S],h=V1(d);for(let E=S;E=0?window.pageYOffset:null,u=Zhe(t,e,s);return o.length&&o.forEach(([d,h])=>{e.getValue(d).set(h)}),e.render(),np&&l!==null&&window.scrollTo({top:l}),{target:u,transitionEnd:r}}else return{target:t,transitionEnd:r}};function Jhe(e,t,n,r){return qhe(t)?Qhe(e,t,n,r):{target:t,transitionEnd:r}}const epe=(e,t,n,r)=>{const i=Uhe(e,t,r);return t=i.target,r=i.transitionEnd,Jhe(e,t,n,r)},D7={current:null},TF={current:!1};function tpe(){if(TF.current=!0,!!np)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>D7.current=e.matches;e.addListener(t),t()}else D7.current=!1}function npe(e,t,n){const{willChange:r}=t;for(const i in t){const o=t[i],a=n[i];if(ou(o))e.addValue(i,o),a5(r)&&r.add(i);else if(ou(a))e.addValue(i,Vm(o)),a5(r)&&r.remove(i);else if(a!==o)if(e.hasValue(i)){const s=e.getValue(i);!s.hasAnimated&&s.set(o)}else{const s=e.getStaticValue(i);e.addValue(i,Vm(s!==void 0?s:o))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const LF=Object.keys(C2),rpe=LF.length,QA=["AnimationStart","AnimationComplete","Update","Unmount","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class ipe{constructor({parent:t,props:n,reducedMotionConfig:r,visualState:i},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.isPresent=!0,this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>Gs.render(this.render,!1,!0);const{latestValues:a,renderState:s}=i;this.latestValues=a,this.baseTarget={...a},this.initialValues=n.initial?{...a}:{},this.renderState=s,this.parent=t,this.props=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=r,this.options=o,this.isControllingVariants=FS(n),this.isVariantNode=hB(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:l,...u}=this.scrapeMotionValuesFromProps(n);for(const d in u){const h=u[d];a[d]!==void 0&&ou(h)&&(h.set(a[d],!1),a5(l)&&l.add(d))}}scrapeMotionValuesFromProps(t){return{}}mount(t){var n;this.current=t,this.projection&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=(n=this.parent)===null||n===void 0?void 0:n.addVariantChild(this)),this.values.forEach((r,i)=>this.bindToMotionValue(i,r)),TF.current||tpe(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:D7.current,this.parent&&this.parent.children.add(this),this.setProps(this.props)}unmount(){var t,n,r;(t=this.projection)===null||t===void 0||t.unmount(),Vh.update(this.notifyUpdate),Vh.render(this.render),this.valueSubscriptions.forEach(i=>i()),(n=this.removeFromVariantTree)===null||n===void 0||n.call(this),(r=this.parent)===null||r===void 0||r.children.delete(this);for(const i in this.events)this.events[i].clear();this.current=null}bindToMotionValue(t,n){const r=g0.has(t),i=n.onChange(a=>{this.latestValues[t]=a,this.props.onUpdate&&Gs.update(this.notifyUpdate,!1,!0),r&&this.projection&&(this.projection.isProjectionDirty=!0)}),o=n.onRenderRequest(this.scheduleRender);this.valueSubscriptions.set(t,()=>{i(),o()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}loadFeatures(t,n,r,i,o,a){const s=[];for(let l=0;lthis.scheduleRender(),animationType:typeof u=="string"?u:"both",initialPromotionConfig:a,layoutScroll:m})}return s}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):pi()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}makeTargetAnimatable(t,n=!0){return this.makeTargetAnimatableFromInstance(t,this.props,n)}setProps(t){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.props=t;for(let n=0;nr.variantChildren.delete(t)}addValue(t,n){this.hasValue(t)&&this.removeValue(t),this.values.set(t,n),this.latestValues[t]=n.get(),this.bindToMotionValue(t,n)}removeValue(t){var n;this.values.delete(t),(n=this.valueSubscriptions.get(t))===null||n===void 0||n(),this.valueSubscriptions.delete(t),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Vm(n),this.addValue(t,r)),r}readValue(t){return this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.readValueFromInstance(this.current,t,this.options)}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props,i=typeof r=="string"||typeof r=="object"?(n=F_(this.props,r))===null||n===void 0?void 0:n[t]:void 0;if(r&&i!==void 0)return i;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!ou(o)?o:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Vv),this.events[t].add(n)}notify(t,...n){var r;(r=this.events[t])===null||r===void 0||r.notify(...n)}}const AF=["initial",...nk],ope=AF.length;class OF extends ipe{sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){var r;return(r=t.style)===null||r===void 0?void 0:r[n]}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:n,...r},{transformValues:i},o){let a=dhe(r,t||{},this);if(i&&(n&&(n=i(n)),r&&(r=i(r)),a&&(a=i(a))),o){uhe(this,r,a);const s=epe(this,r,a,n);n=s.transitionEnd,r=s.target}return{transition:t,transitionEnd:n,...r}}}function ape(e){return window.getComputedStyle(e)}class spe extends OF{readValueFromInstance(t,n){if(g0.has(n)){const r=X_(n);return r&&r.default||0}else{const r=ape(t),i=(mB(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return _F(t,n)}build(t,n,r,i){D_(t,n,r,i.transformTemplate)}scrapeMotionValuesFromProps(t){return B_(t)}renderInstance(t,n,r,i){LB(t,n,r,i)}}class lpe extends OF{getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){var r;return g0.has(n)?((r=X_(n))===null||r===void 0?void 0:r.default)||0:(n=AB.has(n)?n:TB(n),t.getAttribute(n))}measureInstanceViewportBox(){return pi()}scrapeMotionValuesFromProps(t){return MB(t)}build(t,n,r,i){j_(t,n,r,i.transformTemplate)}renderInstance(t,n,r,i){OB(t,n,r,i)}}const upe=(e,t)=>I_(e)?new lpe(t,{enableHardwareAcceleration:!1}):new spe(t,{enableHardwareAcceleration:!0});function JA(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const W1={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Lt.test(e))e=parseFloat(e);else return e;const n=JA(e,t.target.x),r=JA(e,t.target.y);return`${n}% ${r}%`}},eO="_$css",cpe={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=e.includes("var("),o=[];i&&(e=e.replace(kF,y=>(o.push(y),eO)));const a=Ju.parse(e);if(a.length>5)return r;const s=Ju.createTransformer(e),l=typeof a[0]!="number"?1:0,u=n.x.scale*t.x,d=n.y.scale*t.y;a[0+l]/=u,a[1+l]/=d;const h=$r(u,d,.5);typeof a[2+l]=="number"&&(a[2+l]/=h),typeof a[3+l]=="number"&&(a[3+l]/=h);let m=s(a);if(i){let y=0;m=m.replace(eO,()=>{const b=o[y];return y++,b})}return m}};class dpe extends N.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:o}=t;Cce(hpe),o&&(n.group&&n.group.add(o),r&&r.register&&i&&r.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),$v.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:o}=this.props,a=r.projection;return a&&(a.isPresent=o,i||t.layoutDependency!==n||n===void 0?a.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?a.promote():a.relegate()||Gs.postRender(()=>{var s;!((s=a.getStack())===null||s===void 0)&&s.members.length||this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),!t.currentAnimation&&t.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n!=null&&n.group&&n.group.remove(i),r!=null&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t==null||t()}render(){return null}}function fpe(e){const[t,n]=K_(),r=w.useContext(M_);return N.createElement(dpe,{...e,layoutGroup:r,switchLayoutGroup:w.useContext(pB),isPresent:t,safeToRemove:n})}const hpe={borderRadius:{...W1,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:W1,borderTopRightRadius:W1,borderBottomLeftRadius:W1,borderBottomRightRadius:W1,boxShadow:cpe},ppe={measureLayout:fpe};function gpe(e,t,n={}){const r=ou(e)?e:Vm(e);return J_("",r,t,n),{stop:()=>r.stop(),isAnimating:()=>r.isAnimating()}}const MF=["TopLeft","TopRight","BottomLeft","BottomRight"],mpe=MF.length,tO=e=>typeof e=="string"?parseFloat(e):e,nO=e=>typeof e=="number"||Lt.test(e);function vpe(e,t,n,r,i,o){var a,s,l,u;i?(e.opacity=$r(0,(a=n.opacity)!==null&&a!==void 0?a:1,ype(r)),e.opacityExit=$r((s=t.opacity)!==null&&s!==void 0?s:1,0,bpe(r))):o&&(e.opacity=$r((l=t.opacity)!==null&&l!==void 0?l:1,(u=n.opacity)!==null&&u!==void 0?u:1,r));for(let d=0;drt?1:n(E2(e,t,r))}function iO(e,t){e.min=t.min,e.max=t.max}function Ms(e,t){iO(e.x,t.x),iO(e.y,t.y)}function oO(e,t,n,r,i){return e-=t,e=s5(e,1/n,r),i!==void 0&&(e=s5(e,1/i,r)),e}function Spe(e,t=0,n=1,r=.5,i,o=e,a=e){if(Xl.test(t)&&(t=parseFloat(t),t=$r(a.min,a.max,t/100)-a.min),typeof t!="number")return;let s=$r(o.min,o.max,r);e===o&&(s-=t),e.min=oO(e.min,t,n,s,i),e.max=oO(e.max,t,n,s,i)}function aO(e,t,[n,r,i],o,a){Spe(e,t[n],t[r],t[i],t.scale,o,a)}const xpe=["x","scaleX","originX"],wpe=["y","scaleY","originY"];function sO(e,t,n,r){aO(e.x,t,xpe,n==null?void 0:n.x,r==null?void 0:r.x),aO(e.y,t,wpe,n==null?void 0:n.y,r==null?void 0:r.y)}function lO(e){return e.translate===0&&e.scale===1}function RF(e){return lO(e.x)&&lO(e.y)}function DF(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}function uO(e){return Oa(e.x)/Oa(e.y)}function Cpe(e,t,n=.1){return Y_(e,t)<=n}class _pe{constructor(){this.members=[]}add(t){ek(this.members,t),t.scheduleRender()}remove(t){if(tk(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){r=o;break}}return r?(this.promote(r),!0):!1}promote(t,n){var r;const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,n&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),!((r=t.root)===null||r===void 0)&&r.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,r,i,o,a;(r=(n=t.options).onExitComplete)===null||r===void 0||r.call(n),(a=(i=t.resumingFrom)===null||i===void 0?void 0:(o=i.options).onExitComplete)===null||a===void 0||a.call(o)})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function cO(e,t,n){let r="";const i=e.x.translate/t.x,o=e.y.translate/t.y;if((i||o)&&(r=`translate3d(${i}px, ${o}px, 0) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{rotate:l,rotateX:u,rotateY:d}=n;l&&(r+=`rotate(${l}deg) `),u&&(r+=`rotateX(${u}deg) `),d&&(r+=`rotateY(${d}deg) `)}const a=e.x.scale*t.x,s=e.y.scale*t.y;return(a!==1||s!==1)&&(r+=`scale(${a}, ${s})`),r||"none"}const kpe=(e,t)=>e.depth-t.depth;class Epe{constructor(){this.children=[],this.isDirty=!1}add(t){ek(this.children,t),this.isDirty=!0}remove(t){tk(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(kpe),this.isDirty=!1,this.children.forEach(t)}}const dO=["","X","Y","Z"],fO=1e3;let Ppe=0;function NF({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(a,s={},l=t==null?void 0:t()){this.id=Ppe++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.nodes.forEach(Mpe),this.nodes.forEach(Ipe)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.elementId=a,this.latestValues=s,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0,a&&this.root.registerPotentialNode(a,this);for(let u=0;uthis.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,m&&m(),m=gF(y,250),$v.hasAnimatedSinceResize&&($v.hasAnimatedSinceResize=!1,this.nodes.forEach(pO))})}u&&this.root.registerSharedNode(u,this),this.options.animate!==!1&&h&&(u||d)&&this.addEventListener("didUpdate",({delta:m,hasLayoutChanged:y,hasRelativeTargetChanged:b,layout:S})=>{var E,k,_,T,A;if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const I=(k=(E=this.options.transition)!==null&&E!==void 0?E:h.getDefaultTransition())!==null&&k!==void 0?k:Bpe,{onLayoutAnimationStart:R,onLayoutAnimationComplete:D}=h.getProps(),j=!this.targetLayout||!DF(this.targetLayout,S)||b,z=!y&&b;if(!((_=this.resumeFrom)===null||_===void 0)&&_.instance||z||y&&(j||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(m,z);const V={...Q_(I,"layout"),onPlay:R,onComplete:D};h.shouldReduceMotion&&(V.delay=0,V.type=!1),this.startAnimation(V)}else!y&&this.animationProgress===0&&pO(this),this.isLead()&&((A=(T=this.options).onExitComplete)===null||A===void 0||A.call(T));this.targetLayout=S})}unmount(){var a,s;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),(a=this.getStack())===null||a===void 0||a.remove(this),(s=this.parent)===null||s===void 0||s.children.delete(this),this.instance=void 0,Vh.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){var a;return this.isAnimationBlocked||((a=this.parent)===null||a===void 0?void 0:a.isTreeAnimationBlocked())||!1}startUpdate(){var a;this.isUpdateBlocked()||(this.isUpdating=!0,(a=this.nodes)===null||a===void 0||a.forEach(Rpe),this.animationId++)}willUpdate(a=!0){var s,l,u;if(this.root.isUpdateBlocked()){(l=(s=this.options).onExitComplete)===null||l===void 0||l.call(s);return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let y=0;y{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){var a;if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{var T;const A=_/1e3;gO(y.x,a.x,A),gO(y.y,a.y,A),this.setTargetDelta(y),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&(!((T=this.relativeParent)===null||T===void 0)&&T.layout)&&(Uv(b,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Npe(this.relativeTarget,this.relativeTargetOrigin,b,A)),S&&(this.animationValues=m,vpe(m,h,this.latestValues,A,k,E)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=A},this.mixTargetDelta(0)}startAnimation(a){var s,l;this.notifyListeners("animationStart"),(s=this.currentAnimation)===null||s===void 0||s.stop(),this.resumingFrom&&((l=this.resumingFrom.currentAnimation)===null||l===void 0||l.stop()),this.pendingAnimation&&(Vh.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Gs.update(()=>{$v.hasAnimatedSinceResize=!0,this.currentAnimation=gpe(0,fO,{...a,onUpdate:u=>{var d;this.mixTargetDelta(u),(d=a.onUpdate)===null||d===void 0||d.call(a,u)},onComplete:()=>{var u;(u=a.onComplete)===null||u===void 0||u.call(a),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){var a;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),(a=this.getStack())===null||a===void 0||a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){var a;this.currentAnimation&&((a=this.mixTargetDelta)===null||a===void 0||a.call(this,fO),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:s,target:l,layout:u,latestValues:d}=a;if(!(!s||!l||!u)){if(this!==a&&this.layout&&u&&jF(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||pi();const h=Oa(this.layout.layoutBox.x);l.x.min=a.target.x.min,l.x.max=l.x.min+h;const m=Oa(this.layout.layoutBox.y);l.y.min=a.target.y.min,l.y.max=l.y.min+m}Ms(s,l),Vg(s,d),Wv(this.projectionDeltaWithTransform,this.layoutCorrected,s,d)}}registerSharedNode(a,s){var l,u,d;this.sharedNodes.has(a)||this.sharedNodes.set(a,new _pe),this.sharedNodes.get(a).add(s),s.promote({transition:(l=s.options.initialPromotionConfig)===null||l===void 0?void 0:l.transition,preserveFollowOpacity:(d=(u=s.options.initialPromotionConfig)===null||u===void 0?void 0:u.shouldPreserveFollowOpacity)===null||d===void 0?void 0:d.call(u,s)})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var a;const{layoutId:s}=this.options;return s?((a=this.getStack())===null||a===void 0?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:s}=this.options;return s?(a=this.getStack())===null||a===void 0?void 0:a.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:s,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),a&&(this.projectionDelta=void 0,this.needsReset=!0),s&&this.setOptions({transition:s})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetRotation(){const{visualElement:a}=this.options;if(!a)return;let s=!1;const{latestValues:l}=a;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(s=!0),!s)return;const u={};for(let d=0;d{var s;return(s=a.currentAnimation)===null||s===void 0?void 0:s.stop()}),this.root.nodes.forEach(hO),this.root.sharedNodes.clear()}}}function Tpe(e){e.updateLayout()}function Lpe(e){var t,n,r;const i=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&i&&e.hasListeners("didUpdate")){const{layoutBox:o,measuredBox:a}=e.layout,{animationType:s}=e.options,l=i.source!==e.layout.source;s==="size"?Rl(y=>{const b=l?i.measuredBox[y]:i.layoutBox[y],S=Oa(b);b.min=o[y].min,b.max=b.min+S}):jF(s,i.layoutBox,o)&&Rl(y=>{const b=l?i.measuredBox[y]:i.layoutBox[y],S=Oa(o[y]);b.max=b.min+S});const u=Gv();Wv(u,o,i.layoutBox);const d=Gv();l?Wv(d,e.applyTransform(a,!0),i.measuredBox):Wv(d,o,i.layoutBox);const h=!RF(u);let m=!1;if(!e.resumeFrom){const y=e.getClosestProjectingParent();if(y&&!y.resumeFrom){const{snapshot:b,layout:S}=y;if(b&&S){const E=pi();Uv(E,i.layoutBox,b.layoutBox);const k=pi();Uv(k,o,S.layoutBox),DF(E,k)||(m=!0)}}}e.notifyListeners("didUpdate",{layout:o,snapshot:i,delta:d,layoutDelta:u,hasLayoutChanged:h,hasRelativeTargetChanged:m})}else e.isLead()&&((r=(n=e.options).onExitComplete)===null||r===void 0||r.call(n));e.options.transition=void 0}function Ape(e){e.clearSnapshot()}function hO(e){e.clearMeasurements()}function Ope(e){const{visualElement:t}=e.options;t!=null&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function pO(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0}function Mpe(e){e.resolveTargetDelta()}function Ipe(e){e.calcProjection()}function Rpe(e){e.resetRotation()}function Dpe(e){e.removeLeadSnapshot()}function gO(e,t,n){e.translate=$r(t.translate,0,n),e.scale=$r(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function mO(e,t,n,r){e.min=$r(t.min,n.min,r),e.max=$r(t.max,n.max,r)}function Npe(e,t,n,r){mO(e.x,t.x,n.x,r),mO(e.y,t.y,n.y,r)}function jpe(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Bpe={duration:.45,ease:[.4,0,.1,1]};function Fpe(e,t){let n=e.root;for(let o=e.path.length-1;o>=0;o--)if(Boolean(e.path[o].instance)){n=e.path[o];break}const i=(n&&n!==e.root?n.instance:document).querySelector(`[data-projection-id="${t}"]`);i&&e.mount(i,!0)}function vO(e){e.min=Math.round(e.min),e.max=Math.round(e.max)}function $pe(e){vO(e.x),vO(e.y)}function jF(e,t,n){return e==="position"||e==="preserve-aspect"&&!Cpe(uO(t),uO(n),.2)}const zpe=NF({attachResizeListener:(e,t)=>zS(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),S6={current:void 0},Hpe=NF({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!S6.current){const e=new zpe(0,{});e.mount(window),e.setOptions({layoutScroll:!0}),S6.current=e}return S6.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>Boolean(window.getComputedStyle(e).position==="fixed")}),Vpe={...whe,...Mfe,...Vhe,...ppe},du=xce((e,t)=>ade(e,t,Vpe,upe,Hpe));function BF(){const e=w.useRef(!1);return X4(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function Wpe(){const e=BF(),[t,n]=w.useState(0),r=w.useCallback(()=>{e.current&&n(t+1)},[t]);return[w.useCallback(()=>Gs.postRender(r),[r]),t]}class Upe extends w.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function Gpe({children:e,isPresent:t}){const n=w.useId(),r=w.useRef(null),i=w.useRef({width:0,height:0,top:0,left:0});return w.useInsertionEffect(()=>{const{width:o,height:a,top:s,left:l}=i.current;if(t||!r.current||!o||!a)return;r.current.dataset.motionPopId=n;const u=document.createElement("style");return document.head.appendChild(u),u.sheet&&u.sheet.insertRule(` + [data-motion-pop-id="${n}"] { + position: absolute !important; + width: ${o}px !important; + height: ${a}px !important; + top: ${s}px !important; + left: ${l}px !important; + } + `),()=>{document.head.removeChild(u)}},[t]),w.createElement(Upe,{isPresent:t,childRef:r,sizeRef:i},w.cloneElement(e,{ref:r}))}const x6=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:o,mode:a})=>{const s=$S(qpe),l=w.useId(),u=w.useMemo(()=>({id:l,initial:t,isPresent:n,custom:i,onExitComplete:d=>{s.set(d,!0);for(const h of s.values())if(!h)return;r&&r()},register:d=>(s.set(d,!1),()=>s.delete(d))}),o?void 0:[n]);return w.useMemo(()=>{s.forEach((d,h)=>s.set(h,!1))},[n]),w.useEffect(()=>{!n&&!s.size&&r&&r()},[n]),a==="popLayout"&&(e=w.createElement(Gpe,{isPresent:n},e)),w.createElement(p0.Provider,{value:u},e)};function qpe(){return new Map}const Bg=e=>e.key||"";function Ype(e,t){e.forEach(n=>{const r=Bg(n);t.set(r,n)})}function Kpe(e){const t=[];return w.Children.forEach(e,n=>{w.isValidElement(n)&&t.push(n)}),t}const nf=({children:e,custom:t,initial:n=!0,onExitComplete:r,exitBeforeEnter:i,presenceAffectsLayout:o=!0,mode:a="sync"})=>{i&&(a="wait",cF(!1,"Replace exitBeforeEnter with mode='wait'"));let[s]=Wpe();const l=w.useContext(M_).forceRender;l&&(s=l);const u=BF(),d=Kpe(e);let h=d;const m=new Set,y=w.useRef(h),b=w.useRef(new Map).current,S=w.useRef(!0);if(X4(()=>{S.current=!1,Ype(d,b),y.current=h}),z_(()=>{S.current=!0,b.clear(),m.clear()}),S.current)return w.createElement(w.Fragment,null,h.map(T=>w.createElement(x6,{key:Bg(T),isPresent:!0,initial:n?void 0:!1,presenceAffectsLayout:o,mode:a},T)));h=[...h];const E=y.current.map(Bg),k=d.map(Bg),_=E.length;for(let T=0;T<_;T++){const A=E[T];k.indexOf(A)===-1&&m.add(A)}return a==="wait"&&m.size&&(h=[]),m.forEach(T=>{if(k.indexOf(T)!==-1)return;const A=b.get(T);if(!A)return;const I=E.indexOf(T),R=()=>{b.delete(T),m.delete(T);const D=y.current.findIndex(j=>j.key===T);if(y.current.splice(D,1),!m.size){if(y.current=d,u.current===!1)return;s(),r&&r()}};h.splice(I,0,w.createElement(x6,{key:Bg(A),isPresent:!1,onExitComplete:R,custom:t,presenceAffectsLayout:o,mode:a},A))}),h=h.map(T=>{const A=T.key;return m.has(A)?T:w.createElement(x6,{key:Bg(T),isPresent:!0,presenceAffectsLayout:o,mode:a},T)}),uF!=="production"&&a==="wait"&&h.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`),w.createElement(w.Fragment,null,m.size?h:h.map(T=>w.cloneElement(T)))};var $l=function(){return $l=Object.assign||function(t){for(var n,r=1,i=arguments.length;r0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function N7(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;re.filter(Boolean).join(" ");function Xpe(){return!1}var Zpe=e=>{const{condition:t,message:n}=e;t&&Xpe()&&console.warn(n)},_h={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},U1={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 j7(e){switch((e==null?void 0:e.direction)??"right"){case"right":return U1.slideRight;case"left":return U1.slideLeft;case"bottom":return U1.slideDown;case"top":return U1.slideUp;default:return U1.slideRight}}var Ih={enter:{duration:.2,ease:_h.easeOut},exit:{duration:.1,ease:_h.easeIn}},qs={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})},Qpe=e=>e!=null&&parseInt(e.toString(),10)>0,bO={exit:{height:{duration:.2,ease:_h.ease},opacity:{duration:.3,ease:_h.ease}},enter:{height:{duration:.3,ease:_h.ease},opacity:{duration:.4,ease:_h.ease}}},Jpe={exit:({animateOpacity:e,startingHeight:t,transition:n,transitionEnd:r,delay:i})=>({...e&&{opacity:Qpe(t)?1:0},height:t,transitionEnd:r==null?void 0:r.exit,transition:(n==null?void 0:n.exit)??qs.exit(bO.exit,i)}),enter:({animateOpacity:e,endingHeight:t,transition:n,transitionEnd:r,delay:i})=>({...e&&{opacity:1},height:t,transitionEnd:r==null?void 0:r.enter,transition:(n==null?void 0:n.enter)??qs.enter(bO.enter,i)})},$F=w.forwardRef((e,t)=>{const{in:n,unmountOnExit:r,animateOpacity:i=!0,startingHeight:o=0,endingHeight:a="auto",style:s,className:l,transition:u,transitionEnd:d,...h}=e,[m,y]=w.useState(!1);w.useEffect(()=>{const _=setTimeout(()=>{y(!0)});return()=>clearTimeout(_)},[]),Zpe({condition:Boolean(o>0&&r),message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const b=parseFloat(o.toString())>0,S={startingHeight:o,endingHeight:a,animateOpacity:i,transition:m?u:{enter:{duration:0}},transitionEnd:{enter:d==null?void 0:d.enter,exit:r?d==null?void 0:d.exit:{...d==null?void 0:d.exit,display:b?"block":"none"}}},E=r?n:!0,k=n||r?"enter":"exit";return N.createElement(nf,{initial:!1,custom:S},E&&N.createElement(du.div,{ref:t,...h,className:by("chakra-collapse",l),style:{overflow:"hidden",display:"block",...s},custom:S,variants:Jpe,initial:r?"exit":!1,animate:k,exit:"exit"}))});$F.displayName="Collapse";var ege={enter:({transition:e,transitionEnd:t,delay:n}={})=>({opacity:1,transition:(e==null?void 0:e.enter)??qs.enter(Ih.enter,n),transitionEnd:t==null?void 0:t.enter}),exit:({transition:e,transitionEnd:t,delay:n}={})=>({opacity:0,transition:(e==null?void 0:e.exit)??qs.exit(Ih.exit,n),transitionEnd:t==null?void 0:t.exit})},zF={initial:"exit",animate:"enter",exit:"exit",variants:ege},tge=w.forwardRef(function(t,n){const{unmountOnExit:r,in:i,className:o,transition:a,transitionEnd:s,delay:l,...u}=t,d=i||r?"enter":"exit",h=r?i&&r:!0,m={transition:a,transitionEnd:s,delay:l};return N.createElement(nf,{custom:m},h&&N.createElement(du.div,{ref:n,className:by("chakra-fade",o),custom:m,...zF,animate:d,...u}))});tge.displayName="Fade";var nge={exit:({reverse:e,initialScale:t,transition:n,transitionEnd:r,delay:i})=>({opacity:0,...e?{scale:t,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{scale:t,...r==null?void 0:r.exit}},transition:(n==null?void 0:n.exit)??qs.exit(Ih.exit,i)}),enter:({transitionEnd:e,transition:t,delay:n})=>({opacity:1,scale:1,transition:(t==null?void 0:t.enter)??qs.enter(Ih.enter,n),transitionEnd:e==null?void 0:e.enter})},HF={initial:"exit",animate:"enter",exit:"exit",variants:nge},rge=w.forwardRef(function(t,n){const{unmountOnExit:r,in:i,reverse:o=!0,initialScale:a=.95,className:s,transition:l,transitionEnd:u,delay:d,...h}=t,m=r?i&&r:!0,y=i||r?"enter":"exit",b={initialScale:a,reverse:o,transition:l,transitionEnd:u,delay:d};return N.createElement(nf,{custom:b},m&&N.createElement(du.div,{ref:n,className:by("chakra-offset-slide",s),...HF,animate:y,custom:b,...h}))});rge.displayName="ScaleFade";var SO={exit:{duration:.15,ease:_h.easeInOut},enter:{type:"spring",damping:25,stiffness:180}},ige={exit:({direction:e,transition:t,transitionEnd:n,delay:r})=>{const{exit:i}=j7({direction:e});return{...i,transition:(t==null?void 0:t.exit)??qs.exit(SO.exit,r),transitionEnd:n==null?void 0:n.exit}},enter:({direction:e,transitionEnd:t,transition:n,delay:r})=>{const{enter:i}=j7({direction:e});return{...i,transition:(n==null?void 0:n.enter)??qs.enter(SO.enter,r),transitionEnd:t==null?void 0:t.enter}}},VF=w.forwardRef(function(t,n){const{direction:r="right",style:i,unmountOnExit:o,in:a,className:s,transition:l,transitionEnd:u,delay:d,motionProps:h,...m}=t,y=j7({direction:r}),b=Object.assign({position:"fixed"},y.position,i),S=o?a&&o:!0,E=a||o?"enter":"exit",k={transitionEnd:u,transition:l,direction:r,delay:d};return N.createElement(nf,{custom:k},S&&N.createElement(du.div,{...m,ref:n,initial:"exit",className:by("chakra-slide",s),animate:E,exit:"exit",custom:k,variants:ige,style:b,...h}))});VF.displayName="Slide";var oge={initial:({offsetX:e,offsetY:t,transition:n,transitionEnd:r,delay:i})=>({opacity:0,x:e,y:t,transition:(n==null?void 0:n.exit)??qs.exit(Ih.exit,i),transitionEnd:r==null?void 0:r.exit}),enter:({transition:e,transitionEnd:t,delay:n})=>({opacity:1,x:0,y:0,transition:(e==null?void 0:e.enter)??qs.enter(Ih.enter,n),transitionEnd:t==null?void 0:t.enter}),exit:({offsetY:e,offsetX:t,transition:n,transitionEnd:r,reverse:i,delay:o})=>{const a={x:t,y:e};return{opacity:0,transition:(n==null?void 0:n.exit)??qs.exit(Ih.exit,o),...i?{...a,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{...a,...r==null?void 0:r.exit}}}}},B7={initial:"initial",animate:"enter",exit:"exit",variants:oge},age=w.forwardRef(function(t,n){const{unmountOnExit:r,in:i,reverse:o=!0,className:a,offsetX:s=0,offsetY:l=8,transition:u,transitionEnd:d,delay:h,...m}=t,y=r?i&&r:!0,b=i||r?"enter":"exit",S={offsetX:s,offsetY:l,reverse:o,transition:u,transitionEnd:d,delay:h};return N.createElement(nf,{custom:S},y&&N.createElement(du.div,{ref:n,className:by("chakra-offset-slide",a),custom:S,...B7,animate:b,...m}))});age.displayName="SlideFade";var Sy=(...e)=>e.filter(Boolean).join(" ");function sge(){return!1}var qS=e=>{const{condition:t,message:n}=e;t&&sge()&&console.warn(n)};function w6(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var[lge,YS]=Mn({name:"AccordionStylesContext",hookName:"useAccordionStyles",providerName:""}),[uge,rk]=Mn({name:"AccordionItemContext",hookName:"useAccordionItemContext",providerName:""}),[cge,K$e,dge,fge]=dB(),Wg=Oe(function(t,n){const{getButtonProps:r}=rk(),i=r(t,n),a={display:"flex",alignItems:"center",width:"100%",outline:0,...YS().button};return N.createElement(Ce.button,{...i,className:Sy("chakra-accordion__button",t.className),__css:a})});Wg.displayName="AccordionButton";function hge(e){const{onChange:t,defaultIndex:n,index:r,allowMultiple:i,allowToggle:o,...a}=e;mge(e),vge(e);const s=dge(),[l,u]=w.useState(-1);w.useEffect(()=>()=>{u(-1)},[]);const[d,h]=NS({value:r,defaultValue(){return i?n??[]:n??-1},onChange:t});return{index:d,setIndex:h,htmlProps:a,getAccordionItemProps:y=>{let b=!1;return y!==null&&(b=Array.isArray(d)?d.includes(y):d===y),{isOpen:b,onChange:E=>{if(y!==null)if(i&&Array.isArray(d)){const k=E?d.concat(y):d.filter(_=>_!==y);h(k)}else E?h(y):o&&h(-1)}}},focusedIndex:l,setFocusedIndex:u,descendants:s}}var[pge,ik]=Mn({name:"AccordionContext",hookName:"useAccordionContext",providerName:"Accordion"});function gge(e){const{isDisabled:t,isFocusable:n,id:r,...i}=e,{getAccordionItemProps:o,setFocusedIndex:a}=ik(),s=w.useRef(null),l=w.useId(),u=r??l,d=`accordion-button-${u}`,h=`accordion-panel-${u}`;yge(e);const{register:m,index:y,descendants:b}=fge({disabled:t&&!n}),{isOpen:S,onChange:E}=o(y===-1?null:y);bge({isOpen:S,isDisabled:t});const k=()=>{E==null||E(!0)},_=()=>{E==null||E(!1)},T=w.useCallback(()=>{E==null||E(!S),a(y)},[y,a,S,E]),A=w.useCallback(j=>{const V={ArrowDown:()=>{const K=b.nextEnabled(y);K==null||K.node.focus()},ArrowUp:()=>{const K=b.prevEnabled(y);K==null||K.node.focus()},Home:()=>{const K=b.firstEnabled();K==null||K.node.focus()},End:()=>{const K=b.lastEnabled();K==null||K.node.focus()}}[j.key];V&&(j.preventDefault(),V(j))},[b,y]),I=w.useCallback(()=>{a(y)},[a,y]),R=w.useCallback(function(z={},V=null){return{...z,type:"button",ref:Yn(m,s,V),id:d,disabled:!!t,"aria-expanded":!!S,"aria-controls":h,onClick:w6(z.onClick,T),onFocus:w6(z.onFocus,I),onKeyDown:w6(z.onKeyDown,A)}},[d,t,S,T,I,A,h,m]),D=w.useCallback(function(z={},V=null){return{...z,ref:V,role:"region",id:h,"aria-labelledby":d,hidden:!S}},[d,S,h]);return{isOpen:S,isDisabled:t,isFocusable:n,onOpen:k,onClose:_,getButtonProps:R,getPanelProps:D,htmlProps:i}}function mge(e){const t=e.index||e.defaultIndex,n=t!=null&&!Array.isArray(t)&&e.allowMultiple;qS({condition:!!n,message:`If 'allowMultiple' is passed, then 'index' or 'defaultIndex' must be an array. You passed: ${typeof t},`})}function vge(e){qS({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 yge(e){qS({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 bge(e){qS({condition:e.isOpen&&!!e.isDisabled,message:"Cannot open a disabled accordion item"})}function Ug(e){const{isOpen:t,isDisabled:n}=rk(),{reduceMotion:r}=ik(),i=Sy("chakra-accordion__icon",e.className),o=YS(),a={opacity:n?.4:1,transform:t?"rotate(-180deg)":void 0,transition:r?void 0:"transform 0.2s",transformOrigin:"center",...o.icon};return N.createElement(Da,{viewBox:"0 0 24 24","aria-hidden":!0,className:i,__css:a,...e},N.createElement("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"}))}Ug.displayName="AccordionIcon";var Gg=Oe(function(t,n){const{children:r,className:i}=t,{htmlProps:o,...a}=gge(t),l={...YS().container,overflowAnchor:"none"},u=w.useMemo(()=>a,[a]);return N.createElement(uge,{value:u},N.createElement(Ce.div,{ref:n,...o,className:Sy("chakra-accordion__item",i),__css:l},typeof r=="function"?r({isExpanded:!!a.isOpen,isDisabled:!!a.isDisabled}):r))});Gg.displayName="AccordionItem";var qg=Oe(function(t,n){const{className:r,motionProps:i,...o}=t,{reduceMotion:a}=ik(),{getPanelProps:s,isOpen:l}=rk(),u=s(o,n),d=Sy("chakra-accordion__panel",r),h=YS();a||delete u.hidden;const m=N.createElement(Ce.div,{...u,__css:h.panel,className:d});return a?m:N.createElement($F,{in:l,...i},m)});qg.displayName="AccordionPanel";var ok=Oe(function({children:t,reduceMotion:n,...r},i){const o=Yi("Accordion",r),a=En(r),{htmlProps:s,descendants:l,...u}=hge(a),d=w.useMemo(()=>({...u,reduceMotion:!!n}),[u,n]);return N.createElement(cge,{value:l},N.createElement(pge,{value:d},N.createElement(lge,{value:o},N.createElement(Ce.div,{ref:i,...s,className:Sy("chakra-accordion",r.className),__css:o.root},t))))});ok.displayName="Accordion";var Sge=(...e)=>e.filter(Boolean).join(" "),xge=tf({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),xy=Oe((e,t)=>{const n=Ao("Spinner",e),{label:r="Loading...",thickness:i="2px",speed:o="0.45s",emptyColor:a="transparent",className:s,...l}=En(e),u=Sge("chakra-spinner",s),d={display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:i,borderBottomColor:a,borderLeftColor:a,animation:`${xge} ${o} linear infinite`,...n};return N.createElement(Ce.div,{ref:t,__css:d,className:u,...l},r&&N.createElement(Ce.span,{srOnly:!0},r))});xy.displayName="Spinner";var KS=(...e)=>e.filter(Boolean).join(" ");function wge(e){return N.createElement(Da,{viewBox:"0 0 24 24",...e},N.createElement("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"}))}function Cge(e){return N.createElement(Da,{viewBox:"0 0 24 24",...e},N.createElement("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"}))}function xO(e){return N.createElement(Da,{viewBox:"0 0 24 24",...e},N.createElement("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"}))}var[_ge,kge]=Mn({name:"AlertContext",hookName:"useAlertContext",providerName:""}),[Ege,ak]=Mn({name:"AlertStylesContext",hookName:"useAlertStyles",providerName:""}),WF={info:{icon:Cge,colorScheme:"blue"},warning:{icon:xO,colorScheme:"orange"},success:{icon:wge,colorScheme:"green"},error:{icon:xO,colorScheme:"red"},loading:{icon:xy,colorScheme:"blue"}};function Pge(e){return WF[e].colorScheme}function Tge(e){return WF[e].icon}var UF=Oe(function(t,n){const{status:r="info",addRole:i=!0,...o}=En(t),a=t.colorScheme??Pge(r),s=Yi("Alert",{...t,colorScheme:a}),l={width:"100%",display:"flex",alignItems:"center",position:"relative",overflow:"hidden",...s.container};return N.createElement(_ge,{value:{status:r}},N.createElement(Ege,{value:s},N.createElement(Ce.div,{role:i?"alert":void 0,ref:n,...o,className:KS("chakra-alert",t.className),__css:l})))});UF.displayName="Alert";var GF=Oe(function(t,n){const i={display:"inline",...ak().description};return N.createElement(Ce.div,{ref:n,...t,className:KS("chakra-alert__desc",t.className),__css:i})});GF.displayName="AlertDescription";function qF(e){const{status:t}=kge(),n=Tge(t),r=ak(),i=t==="loading"?r.spinner:r.icon;return N.createElement(Ce.span,{display:"inherit",...e,className:KS("chakra-alert__icon",e.className),__css:i},e.children||N.createElement(n,{h:"100%",w:"100%"}))}qF.displayName="AlertIcon";var YF=Oe(function(t,n){const r=ak();return N.createElement(Ce.div,{ref:n,...t,className:KS("chakra-alert__title",t.className),__css:r.title})});YF.displayName="AlertTitle";function Lge(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function Age(e){const{loading:t,src:n,srcSet:r,onLoad:i,onError:o,crossOrigin:a,sizes:s,ignoreFallback:l}=e,[u,d]=w.useState("pending");w.useEffect(()=>{d(n?"loading":"pending")},[n]);const h=w.useRef(),m=w.useCallback(()=>{if(!n)return;y();const b=new Image;b.src=n,a&&(b.crossOrigin=a),r&&(b.srcset=r),s&&(b.sizes=s),t&&(b.loading=t),b.onload=S=>{y(),d("loaded"),i==null||i(S)},b.onerror=S=>{y(),d("failed"),o==null||o(S)},h.current=b},[n,a,r,s,i,o,t]),y=()=>{h.current&&(h.current.onload=null,h.current.onerror=null,h.current=null)};return Ws(()=>{if(!l)return u==="loading"&&m(),()=>{y()}},[u,m,l]),l?"loaded":u}var Oge=(e,t)=>e!=="loaded"&&t==="beforeLoadOrError"||e==="failed"&&t==="onError",l5=Oe(function(t,n){const{htmlWidth:r,htmlHeight:i,alt:o,...a}=t;return N.createElement("img",{width:r,height:i,ref:n,alt:o,...a})});l5.displayName="NativeImage";var XS=Oe(function(t,n){const{fallbackSrc:r,fallback:i,src:o,srcSet:a,align:s,fit:l,loading:u,ignoreFallback:d,crossOrigin:h,fallbackStrategy:m="beforeLoadOrError",referrerPolicy:y,...b}=t,S=r!==void 0||i!==void 0,E=u!=null||d||!S,k=Age({...t,ignoreFallback:E}),_=Oge(k,m),T={ref:n,objectFit:l,objectPosition:s,...E?b:Lge(b,["onError","onLoad"])};return _?i||N.createElement(Ce.img,{as:l5,className:"chakra-image__placeholder",src:r,...T}):N.createElement(Ce.img,{as:l5,src:o,srcSet:a,crossOrigin:h,loading:u,referrerPolicy:y,className:"chakra-image",...T})});XS.displayName="Image";Oe((e,t)=>N.createElement(Ce.img,{ref:t,as:l5,className:"chakra-image",...e}));function ZS(e){return w.Children.toArray(e).filter(t=>w.isValidElement(t))}var QS=(...e)=>e.filter(Boolean).join(" "),wO=e=>e?"":void 0,[Mge,Ige]=Mn({strict:!1,name:"ButtonGroupContext"});function F7(e){const{children:t,className:n,...r}=e,i=w.isValidElement(t)?w.cloneElement(t,{"aria-hidden":!0,focusable:!1}):t,o=QS("chakra-button__icon",n);return N.createElement(Ce.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...r,className:o},i)}F7.displayName="ButtonIcon";function $7(e){const{label:t,placement:n,spacing:r="0.5rem",children:i=N.createElement(xy,{color:"currentColor",width:"1em",height:"1em"}),className:o,__css:a,...s}=e,l=QS("chakra-button__spinner",o),u=n==="start"?"marginEnd":"marginStart",d=w.useMemo(()=>({display:"flex",alignItems:"center",position:t?"relative":"absolute",[u]:t?r:0,fontSize:"1em",lineHeight:"normal",...a}),[a,t,u,r]);return N.createElement(Ce.div,{className:l,...s,__css:d},i)}$7.displayName="ButtonSpinner";function Rge(e){const[t,n]=w.useState(!e);return{ref:w.useCallback(o=>{o&&n(o.tagName==="BUTTON")},[]),type:t?"button":void 0}}var as=Oe((e,t)=>{const n=Ige(),r=Ao("Button",{...n,...e}),{isDisabled:i=n==null?void 0:n.isDisabled,isLoading:o,isActive:a,children:s,leftIcon:l,rightIcon:u,loadingText:d,iconSpacing:h="0.5rem",type:m,spinner:y,spinnerPlacement:b="start",className:S,as:E,...k}=En(e),_=w.useMemo(()=>{const R={...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:R}}},[r,n]),{ref:T,type:A}=Rge(E),I={rightIcon:u,leftIcon:l,iconSpacing:h,children:s};return N.createElement(Ce.button,{disabled:i||o,ref:nce(t,T),as:E,type:m??A,"data-active":wO(a),"data-loading":wO(o),__css:_,className:QS("chakra-button",S),...k},o&&b==="start"&&N.createElement($7,{className:"chakra-button__spinner--start",label:d,placement:"start",spacing:h},y),o?d||N.createElement(Ce.span,{opacity:0},N.createElement(CO,{...I})):N.createElement(CO,{...I}),o&&b==="end"&&N.createElement($7,{className:"chakra-button__spinner--end",label:d,placement:"end",spacing:h},y))});as.displayName="Button";function CO(e){const{leftIcon:t,rightIcon:n,children:r,iconSpacing:i}=e;return N.createElement(N.Fragment,null,t&&N.createElement(F7,{marginEnd:i},t),r,n&&N.createElement(F7,{marginStart:i},n))}var oo=Oe(function(t,n){const{size:r,colorScheme:i,variant:o,className:a,spacing:s="0.5rem",isAttached:l,isDisabled:u,...d}=t,h=QS("chakra-button__group",a),m=w.useMemo(()=>({size:r,colorScheme:i,variant:o,isDisabled:u}),[r,i,o,u]);let y={display:"inline-flex"};return l?y={...y,"> *: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}}:y={...y,"& > *:not(style) ~ *:not(style)":{marginStart:s}},N.createElement(Mge,{value:m},N.createElement(Ce.div,{ref:n,role:"group",__css:y,className:h,"data-attached":l?"":void 0,...d}))});oo.displayName="ButtonGroup";var ss=Oe((e,t)=>{const{icon:n,children:r,isRound:i,"aria-label":o,...a}=e,s=n||r,l=w.isValidElement(s)?w.cloneElement(s,{"aria-hidden":!0,focusable:!1}):null;return N.createElement(as,{padding:"0",borderRadius:i?"full":void 0,ref:t,"aria-label":o,...a},l)});ss.displayName="IconButton";var y0=(...e)=>e.filter(Boolean).join(" "),J3=e=>e?"":void 0,C6=e=>e?!0:void 0;function _O(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var[Dge,KF]=Mn({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[Nge,b0]=Mn({strict:!1,name:"FormControlContext"});function jge(e){const{id:t,isRequired:n,isInvalid:r,isDisabled:i,isReadOnly:o,...a}=e,s=w.useId(),l=t||`field-${s}`,u=`${l}-label`,d=`${l}-feedback`,h=`${l}-helptext`,[m,y]=w.useState(!1),[b,S]=w.useState(!1),[E,k]=w.useState(!1),_=w.useCallback((D={},j=null)=>({id:h,...D,ref:Yn(j,z=>{z&&S(!0)})}),[h]),T=w.useCallback((D={},j=null)=>({...D,ref:j,"data-focus":J3(E),"data-disabled":J3(i),"data-invalid":J3(r),"data-readonly":J3(o),id:D.id??u,htmlFor:D.htmlFor??l}),[l,i,E,r,o,u]),A=w.useCallback((D={},j=null)=>({id:d,...D,ref:Yn(j,z=>{z&&y(!0)}),"aria-live":"polite"}),[d]),I=w.useCallback((D={},j=null)=>({...D,...a,ref:j,role:"group"}),[a]),R=w.useCallback((D={},j=null)=>({...D,ref:j,role:"presentation","aria-hidden":!0,children:D.children||"*"}),[]);return{isRequired:!!n,isInvalid:!!r,isReadOnly:!!o,isDisabled:!!i,isFocused:!!E,onFocus:()=>k(!0),onBlur:()=>k(!1),hasFeedbackText:m,setHasFeedbackText:y,hasHelpText:b,setHasHelpText:S,id:l,labelId:u,feedbackId:d,helpTextId:h,htmlProps:a,getHelpTextProps:_,getErrorMessageProps:A,getRootProps:I,getLabelProps:T,getRequiredIndicatorProps:R}}var dn=Oe(function(t,n){const r=Yi("Form",t),i=En(t),{getRootProps:o,htmlProps:a,...s}=jge(i),l=y0("chakra-form-control",t.className);return N.createElement(Nge,{value:s},N.createElement(Dge,{value:r},N.createElement(Ce.div,{...o({},n),className:l,__css:r.container})))});dn.displayName="FormControl";var lr=Oe(function(t,n){const r=b0(),i=KF(),o=y0("chakra-form__helper-text",t.className);return N.createElement(Ce.div,{...r==null?void 0:r.getHelpTextProps(t,n),__css:i.helperText,className:o})});lr.displayName="FormHelperText";function sk(e){const{isDisabled:t,isInvalid:n,isReadOnly:r,isRequired:i,...o}=lk(e);return{...o,disabled:t,readOnly:r,required:i,"aria-invalid":C6(n),"aria-required":C6(i),"aria-readonly":C6(r)}}function lk(e){const t=b0(),{id:n,disabled:r,readOnly:i,required:o,isRequired:a,isInvalid:s,isReadOnly:l,isDisabled:u,onFocus:d,onBlur:h,...m}=e,y=e["aria-describedby"]?[e["aria-describedby"]]:[];return t!=null&&t.hasFeedbackText&&(t!=null&&t.isInvalid)&&y.push(t.feedbackId),t!=null&&t.hasHelpText&&y.push(t.helpTextId),{...m,"aria-describedby":y.join(" ")||void 0,id:n??(t==null?void 0:t.id),isDisabled:r??u??(t==null?void 0:t.isDisabled),isReadOnly:i??l??(t==null?void 0:t.isReadOnly),isRequired:o??a??(t==null?void 0:t.isRequired),isInvalid:s??(t==null?void 0:t.isInvalid),onFocus:_O(t==null?void 0:t.onFocus,d),onBlur:_O(t==null?void 0:t.onBlur,h)}}var[Bge,Fge]=Mn({name:"FormErrorStylesContext",errorMessage:`useFormErrorStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),ur=Oe((e,t)=>{const n=Yi("FormError",e),r=En(e),i=b0();return i!=null&&i.isInvalid?N.createElement(Bge,{value:n},N.createElement(Ce.div,{...i==null?void 0:i.getErrorMessageProps(r,t),className:y0("chakra-form__error-message",e.className),__css:{display:"flex",alignItems:"center",...n.text}})):null});ur.displayName="FormErrorMessage";var $ge=Oe((e,t)=>{const n=Fge(),r=b0();if(!(r!=null&&r.isInvalid))return null;const i=y0("chakra-form__error-icon",e.className);return N.createElement(Da,{ref:t,"aria-hidden":!0,...e,__css:n.icon,className:i},N.createElement("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"}))});$ge.displayName="FormErrorIcon";var kn=Oe(function(t,n){const r=Ao("FormLabel",t),i=En(t),{className:o,children:a,requiredIndicator:s=N.createElement(XF,null),optionalIndicator:l=null,...u}=i,d=b0(),h=(d==null?void 0:d.getLabelProps(u,n))??{ref:n,...u};return N.createElement(Ce.label,{...h,className:y0("chakra-form__label",i.className),__css:{display:"block",textAlign:"start",...r}},a,d!=null&&d.isRequired?s:l)});kn.displayName="FormLabel";var XF=Oe(function(t,n){const r=b0(),i=KF();if(!(r!=null&&r.isRequired))return null;const o=y0("chakra-form__required-indicator",t.className);return N.createElement(Ce.span,{...r==null?void 0:r.getRequiredIndicatorProps(t,n),__css:i.requiredIndicator,className:o})});XF.displayName="RequiredIndicator";function Vd(e,t){const n=w.useRef(!1),r=w.useRef(!1);w.useEffect(()=>{if(n.current&&r.current)return e();r.current=!0},t),w.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])}var uk={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},zge=Ce("span",{baseStyle:uk});zge.displayName="VisuallyHidden";var Hge=Ce("input",{baseStyle:uk});Hge.displayName="VisuallyHiddenInput";var kO=!1,JS=null,Wm=!1,z7=new Set,Vge=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function Wge(e){return!(e.metaKey||!Vge&&e.altKey||e.ctrlKey)}function ck(e,t){z7.forEach(n=>n(e,t))}function EO(e){Wm=!0,Wge(e)&&(JS="keyboard",ck("keyboard",e))}function wg(e){JS="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(Wm=!0,ck("pointer",e))}function Uge(e){e.target===window||e.target===document||(Wm||(JS="keyboard",ck("keyboard",e)),Wm=!1)}function Gge(){Wm=!1}function PO(){return JS!=="pointer"}function qge(){if(typeof window>"u"||kO)return;const{focus:e}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...n){Wm=!0,e.apply(this,n)},document.addEventListener("keydown",EO,!0),document.addEventListener("keyup",EO,!0),window.addEventListener("focus",Uge,!0),window.addEventListener("blur",Gge,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",wg,!0),document.addEventListener("pointermove",wg,!0),document.addEventListener("pointerup",wg,!0)):(document.addEventListener("mousedown",wg,!0),document.addEventListener("mousemove",wg,!0),document.addEventListener("mouseup",wg,!0)),kO=!0}function Yge(e){qge(),e(PO());const t=()=>e(PO());return z7.add(t),()=>{z7.delete(t)}}var[X$e,Kge]=Mn({name:"CheckboxGroupContext",strict:!1}),Xge=(...e)=>e.filter(Boolean).join(" "),yo=e=>e?"":void 0;function Ya(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function Zge(...e){return function(n){e.forEach(r=>{r==null||r(n)})}}function Qge(e){return N.createElement(Ce.svg,{width:"1.2em",viewBox:"0 0 12 10",style:{fill:"none",strokeWidth:2,stroke:"currentColor",strokeDasharray:16},...e},N.createElement("polyline",{points:"1.5 6 4.5 9 10.5 1"}))}function Jge(e){return N.createElement(Ce.svg,{width:"1.2em",viewBox:"0 0 24 24",style:{stroke:"currentColor",strokeWidth:4},...e},N.createElement("line",{x1:"21",x2:"3",y1:"12",y2:"12"}))}function eme(e){const{isIndeterminate:t,isChecked:n,...r}=e,i=t?Jge:Qge;return n||t?N.createElement(Ce.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"}},N.createElement(i,{...r})):null}function tme(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function ZF(e={}){const t=lk(e),{isDisabled:n,isReadOnly:r,isRequired:i,isInvalid:o,id:a,onBlur:s,onFocus:l,"aria-describedby":u}=t,{defaultChecked:d,isChecked:h,isFocusable:m,onChange:y,isIndeterminate:b,name:S,value:E,tabIndex:k=void 0,"aria-label":_,"aria-labelledby":T,"aria-invalid":A,...I}=e,R=tme(I,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),D=Er(y),j=Er(s),z=Er(l),[V,K]=w.useState(!1),[te,q]=w.useState(!1),[F,U]=w.useState(!1),[X,Z]=w.useState(!1);w.useEffect(()=>Yge(K),[]);const W=w.useRef(null),[Q,ie]=w.useState(!0),[fe,Se]=w.useState(!!d),Te=h!==void 0,ye=Te?h:fe,He=w.useCallback(Ae=>{if(r||n){Ae.preventDefault();return}Te||Se(ye?Ae.target.checked:b?!0:Ae.target.checked),D==null||D(Ae)},[r,n,ye,Te,b,D]);Ws(()=>{W.current&&(W.current.indeterminate=Boolean(b))},[b]),Vd(()=>{n&&q(!1)},[n,q]),Ws(()=>{const Ae=W.current;Ae!=null&&Ae.form&&(Ae.form.onreset=()=>{Se(!!d)})},[]);const Ne=n&&!m,tt=w.useCallback(Ae=>{Ae.key===" "&&Z(!0)},[Z]),_e=w.useCallback(Ae=>{Ae.key===" "&&Z(!1)},[Z]);Ws(()=>{if(!W.current)return;W.current.checked!==ye&&Se(W.current.checked)},[W.current]);const lt=w.useCallback((Ae={},ut=null)=>{const Mt=at=>{te&&at.preventDefault(),Z(!0)};return{...Ae,ref:ut,"data-active":yo(X),"data-hover":yo(F),"data-checked":yo(ye),"data-focus":yo(te),"data-focus-visible":yo(te&&V),"data-indeterminate":yo(b),"data-disabled":yo(n),"data-invalid":yo(o),"data-readonly":yo(r),"aria-hidden":!0,onMouseDown:Ya(Ae.onMouseDown,Mt),onMouseUp:Ya(Ae.onMouseUp,()=>Z(!1)),onMouseEnter:Ya(Ae.onMouseEnter,()=>U(!0)),onMouseLeave:Ya(Ae.onMouseLeave,()=>U(!1))}},[X,ye,n,te,V,F,b,o,r]),wt=w.useCallback((Ae={},ut=null)=>({...R,...Ae,ref:Yn(ut,Mt=>{Mt&&ie(Mt.tagName==="LABEL")}),onClick:Ya(Ae.onClick,()=>{var Mt;Q||((Mt=W.current)==null||Mt.click(),requestAnimationFrame(()=>{var at;(at=W.current)==null||at.focus()}))}),"data-disabled":yo(n),"data-checked":yo(ye),"data-invalid":yo(o)}),[R,n,ye,o,Q]),ct=w.useCallback((Ae={},ut=null)=>({...Ae,ref:Yn(W,ut),type:"checkbox",name:S,value:E,id:a,tabIndex:k,onChange:Ya(Ae.onChange,He),onBlur:Ya(Ae.onBlur,j,()=>q(!1)),onFocus:Ya(Ae.onFocus,z,()=>q(!0)),onKeyDown:Ya(Ae.onKeyDown,tt),onKeyUp:Ya(Ae.onKeyUp,_e),required:i,checked:ye,disabled:Ne,readOnly:r,"aria-label":_,"aria-labelledby":T,"aria-invalid":A?Boolean(A):o,"aria-describedby":u,"aria-disabled":n,style:uk}),[S,E,a,He,j,z,tt,_e,i,ye,Ne,r,_,T,A,o,u,n,k]),mt=w.useCallback((Ae={},ut=null)=>({...Ae,ref:ut,onMouseDown:Ya(Ae.onMouseDown,TO),onTouchStart:Ya(Ae.onTouchStart,TO),"data-disabled":yo(n),"data-checked":yo(ye),"data-invalid":yo(o)}),[ye,n,o]);return{state:{isInvalid:o,isFocused:te,isChecked:ye,isActive:X,isHovered:F,isIndeterminate:b,isDisabled:n,isReadOnly:r,isRequired:i},getRootProps:wt,getCheckboxProps:lt,getInputProps:ct,getLabelProps:mt,htmlProps:R}}function TO(e){e.preventDefault(),e.stopPropagation()}var nme={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},rme={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},ime=tf({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),ome=tf({from:{opacity:0},to:{opacity:1}}),ame=tf({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),QF=Oe(function(t,n){const r=Kge(),i={...r,...t},o=Yi("Checkbox",i),a=En(t),{spacing:s="0.5rem",className:l,children:u,iconColor:d,iconSize:h,icon:m=N.createElement(eme,null),isChecked:y,isDisabled:b=r==null?void 0:r.isDisabled,onChange:S,inputProps:E,...k}=a;let _=y;r!=null&&r.value&&a.value&&(_=r.value.includes(a.value));let T=S;r!=null&&r.onChange&&a.value&&(T=Zge(r.onChange,S));const{state:A,getInputProps:I,getCheckboxProps:R,getLabelProps:D,getRootProps:j}=ZF({...k,isDisabled:b,isChecked:_,onChange:T}),z=w.useMemo(()=>({animation:A.isIndeterminate?`${ome} 20ms linear, ${ame} 200ms linear`:`${ime} 200ms linear`,fontSize:h,color:d,...o.icon}),[d,h,,A.isIndeterminate,o.icon]),V=w.cloneElement(m,{__css:z,isIndeterminate:A.isIndeterminate,isChecked:A.isChecked});return N.createElement(Ce.label,{__css:{...rme,...o.container},className:Xge("chakra-checkbox",l),...j()},N.createElement("input",{className:"chakra-checkbox__input",...I(E,n)}),N.createElement(Ce.span,{__css:{...nme,...o.control},className:"chakra-checkbox__control",...R()},V),u&&N.createElement(Ce.span,{className:"chakra-checkbox__label",...D(),__css:{marginStart:s,...o.label}},u))});QF.displayName="Checkbox";function sme(e){return N.createElement(Da,{focusable:"false","aria-hidden":!0,...e},N.createElement("path",{fill:"currentColor",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"}))}var ex=Oe(function(t,n){const r=Ao("CloseButton",t),{children:i,isDisabled:o,__css:a,...s}=En(t),l={outline:0,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return N.createElement(Ce.button,{type:"button","aria-label":"Close",ref:n,disabled:o,__css:{...l,...r,...a},...s},i||N.createElement(sme,{width:"1em",height:"1em"}))});ex.displayName="CloseButton";function lme(e){const t=parseFloat(e);return typeof t!="number"||Number.isNaN(t)?0:t}function dk(e,t){let n=lme(e);const r=10**(t??10);return n=Math.round(n*r)/r,t?n.toFixed(t):n.toString()}function H7(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 u5(e,t,n){return(e-t)*100/(n-t)}function JF(e,t,n){return(n-t)*e+t}function V7(e,t,n){const r=Math.round((e-t)/n)*n+t,i=H7(n);return dk(r,i)}function Cm(e,t,n){return e==null?e:(nr==null?"":_6(r,o,n)??""),m=typeof i<"u",y=m?i:d,b=e$(dd(y),o),S=n??b,E=w.useCallback(V=>{V!==y&&(m||h(V.toString()),u==null||u(V.toString(),dd(V)))},[u,m,y]),k=w.useCallback(V=>{let K=V;return l&&(K=Cm(K,a,s)),dk(K,S)},[S,l,s,a]),_=w.useCallback((V=o)=>{let K;y===""?K=dd(V):K=dd(y)+V,K=k(K),E(K)},[k,o,E,y]),T=w.useCallback((V=o)=>{let K;y===""?K=dd(-V):K=dd(y)-V,K=k(K),E(K)},[k,o,E,y]),A=w.useCallback(()=>{let V;r==null?V="":V=_6(r,o,n)??a,E(V)},[r,n,o,E,a]),I=w.useCallback(V=>{const K=_6(V,o,S)??a;E(K)},[S,o,E,a]),R=dd(y);return{isOutOfRange:R>s||RN.createElement(MS,{styles:t$}),dme=()=>N.createElement(MS,{styles:` + html { + line-height: 1.5; + -webkit-text-size-adjust: 100%; + font-family: system-ui, sans-serif; + -webkit-font-smoothing: antialiased; + text-rendering: optimizeLegibility; + -moz-osx-font-smoothing: grayscale; + touch-action: manipulation; + } + + body { + position: relative; + min-height: 100%; + font-feature-settings: 'kern'; + } + + *, + *::before, + *::after { + border-width: 0; + border-style: solid; + box-sizing: border-box; + } + + main { + display: block; + } + + hr { + border-top-width: 1px; + box-sizing: content-box; + height: 0; + overflow: visible; + } + + pre, + code, + kbd, + samp { + font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; + font-size: 1em; + } + + a { + background-color: transparent; + color: inherit; + text-decoration: inherit; + } + + abbr[title] { + border-bottom: none; + text-decoration: underline; + -webkit-text-decoration: underline dotted; + text-decoration: underline dotted; + } + + b, + strong { + font-weight: bold; + } + + small { + font-size: 80%; + } + + sub, + sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; + } + + sub { + bottom: -0.25em; + } + + sup { + top: -0.5em; + } + + img { + border-style: none; + } + + button, + input, + optgroup, + select, + textarea { + font-family: inherit; + font-size: 100%; + line-height: 1.15; + margin: 0; + } + + button, + input { + overflow: visible; + } + + button, + select { + text-transform: none; + } + + button::-moz-focus-inner, + [type="button"]::-moz-focus-inner, + [type="reset"]::-moz-focus-inner, + [type="submit"]::-moz-focus-inner { + border-style: none; + padding: 0; + } + + fieldset { + padding: 0.35em 0.75em 0.625em; + } + + legend { + box-sizing: border-box; + color: inherit; + display: table; + max-width: 100%; + padding: 0; + white-space: normal; + } + + progress { + vertical-align: baseline; + } + + textarea { + overflow: auto; + } + + [type="checkbox"], + [type="radio"] { + box-sizing: border-box; + padding: 0; + } + + [type="number"]::-webkit-inner-spin-button, + [type="number"]::-webkit-outer-spin-button { + -webkit-appearance: none !important; + } + + input[type="number"] { + -moz-appearance: textfield; + } + + [type="search"] { + -webkit-appearance: textfield; + outline-offset: -2px; + } + + [type="search"]::-webkit-search-decoration { + -webkit-appearance: none !important; + } + + ::-webkit-file-upload-button { + -webkit-appearance: button; + font: inherit; + } + + details { + display: block; + } + + summary { + display: list-item; + } + + template { + display: none; + } + + [hidden] { + display: none !important; + } + + body, + blockquote, + dl, + dd, + h1, + h2, + h3, + h4, + h5, + h6, + hr, + figure, + p, + pre { + margin: 0; + } + + button { + background: transparent; + padding: 0; + } + + fieldset { + margin: 0; + padding: 0; + } + + ol, + ul { + margin: 0; + padding: 0; + } + + textarea { + resize: vertical; + } + + button, + [role="button"] { + cursor: pointer; + } + + button::-moz-focus-inner { + border: 0 !important; + } + + table { + border-collapse: collapse; + } + + h1, + h2, + h3, + h4, + h5, + h6 { + font-size: inherit; + font-weight: inherit; + } + + button, + input, + optgroup, + select, + textarea { + padding: 0; + line-height: inherit; + color: inherit; + } + + img, + svg, + video, + canvas, + audio, + iframe, + embed, + object { + display: block; + } + + img, + video { + max-width: 100%; + height: auto; + } + + [data-js-focus-visible] :focus:not([data-focus-visible-added]):not([data-focus-visible-disabled]) { + outline: none; + box-shadow: none; + } + + select::-ms-expand { + display: none; + } + + ${t$} + `});function Rh(e,t,n,r){const i=Er(n);return w.useEffect(()=>{const o=typeof e=="function"?e():e??document;if(!(!n||!o))return o.addEventListener(t,i,r),()=>{o.removeEventListener(t,i,r)}},[t,e,r,i,n]),()=>{const o=typeof e=="function"?e():e??document;o==null||o.removeEventListener(t,i,r)}}function fme(e){return"current"in e}var n$=()=>typeof window<"u";function hme(){const e=navigator.userAgentData;return(e==null?void 0:e.platform)??navigator.platform}var pme=e=>n$()&&e.test(navigator.vendor),gme=e=>n$()&&e.test(hme()),mme=()=>gme(/mac|iphone|ipad|ipod/i),vme=()=>mme()&&pme(/apple/i);function yme(e){const{ref:t,elements:n,enabled:r}=e,i=()=>{var o;return((o=t.current)==null?void 0:o.ownerDocument)??document};Rh(i,"pointerdown",o=>{if(!vme()||!r)return;const a=o.target,l=(n??[t]).some(u=>{const d=fme(u)?u.current:u;return(d==null?void 0:d.contains(a))||d===a});i().activeElement!==a&&l&&(o.preventDefault(),a.focus())})}var bme=ure?w.useLayoutEffect:w.useEffect;function LO(e,t=[]){const n=w.useRef(e);return bme(()=>{n.current=e}),w.useCallback((...r)=>{var i;return(i=n.current)==null?void 0:i.call(n,...r)},t)}function Sme(e,t){const n=e!==void 0;return[n,n&&typeof e<"u"?e:t]}function xme(e,t){const n=w.useId();return w.useMemo(()=>e||[t,n].filter(Boolean).join("-"),[e,t,n])}function Wh(e={}){const{onClose:t,onOpen:n,isOpen:r,id:i}=e,o=LO(n),a=LO(t),[s,l]=w.useState(e.defaultIsOpen||!1),[u,d]=Sme(r,s),h=xme(i,"disclosure"),m=w.useCallback(()=>{u||l(!1),a==null||a()},[u,a]),y=w.useCallback(()=>{u||l(!0),o==null||o()},[u,o]),b=w.useCallback(()=>{(d?m:y)()},[d,y,m]);return{isOpen:!!d,onOpen:y,onClose:m,onToggle:b,isControlled:u,getButtonProps:(S={})=>({...S,"aria-expanded":d,"aria-controls":h,onClick:cre(S.onClick,b)}),getDisclosureProps:(S={})=>({...S,hidden:!d,id:h})}}function fk(e){const t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}var hk=Oe(function(t,n){const{htmlSize:r,...i}=t,o=Yi("Input",i),a=En(i),s=sk(a),l=Qr("chakra-input",t.className);return N.createElement(Ce.input,{size:r,...s,__css:o.field,ref:n,className:l})});hk.displayName="Input";hk.id="Input";var[wme,r$]=Mn({name:"InputGroupStylesContext",errorMessage:`useInputGroupStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Cme=Oe(function(t,n){const r=Yi("Input",t),{children:i,className:o,...a}=En(t),s=Qr("chakra-input__group",o),l={},u=ZS(i),d=r.field;u.forEach(m=>{r&&(d&&m.type.id==="InputLeftElement"&&(l.paddingStart=d.height??d.h),d&&m.type.id==="InputRightElement"&&(l.paddingEnd=d.height??d.h),m.type.id==="InputRightAddon"&&(l.borderEndRadius=0),m.type.id==="InputLeftAddon"&&(l.borderStartRadius=0))});const h=u.map(m=>{var y,b;const S=fk({size:((y=m.props)==null?void 0:y.size)||t.size,variant:((b=m.props)==null?void 0:b.variant)||t.variant});return m.type.id!=="Input"?w.cloneElement(m,S):w.cloneElement(m,Object.assign(S,l,m.props))});return N.createElement(Ce.div,{className:s,ref:n,__css:{width:"100%",display:"flex",position:"relative"},...a},N.createElement(wme,{value:r},h))});Cme.displayName="InputGroup";var _me={left:{marginEnd:"-1px",borderEndRadius:0,borderEndColor:"transparent"},right:{marginStart:"-1px",borderStartRadius:0,borderStartColor:"transparent"}},kme=Ce("div",{baseStyle:{flex:"0 0 auto",width:"auto",display:"flex",alignItems:"center",whiteSpace:"nowrap"}}),pk=Oe(function(t,n){const{placement:r="left",...i}=t,o=_me[r]??{},a=r$();return N.createElement(kme,{ref:n,...i,__css:{...a.addon,...o}})});pk.displayName="InputAddon";var i$=Oe(function(t,n){return N.createElement(pk,{ref:n,placement:"left",...t,className:Qr("chakra-input__left-addon",t.className)})});i$.displayName="InputLeftAddon";i$.id="InputLeftAddon";var o$=Oe(function(t,n){return N.createElement(pk,{ref:n,placement:"right",...t,className:Qr("chakra-input__right-addon",t.className)})});o$.displayName="InputRightAddon";o$.id="InputRightAddon";var Eme=Ce("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"0",zIndex:2}}),tx=Oe(function(t,n){const{placement:r="left",...i}=t,o=r$(),a=o.field,l={[r==="left"?"insetStart":"insetEnd"]:"0",width:(a==null?void 0:a.height)??(a==null?void 0:a.h),height:(a==null?void 0:a.height)??(a==null?void 0:a.h),fontSize:a==null?void 0:a.fontSize,...o.element};return N.createElement(Eme,{ref:n,__css:l,...i})});tx.id="InputElement";tx.displayName="InputElement";var a$=Oe(function(t,n){const{className:r,...i}=t,o=Qr("chakra-input__left-element",r);return N.createElement(tx,{ref:n,placement:"left",className:o,...i})});a$.id="InputLeftElement";a$.displayName="InputLeftElement";var s$=Oe(function(t,n){const{className:r,...i}=t,o=Qr("chakra-input__right-element",r);return N.createElement(tx,{ref:n,placement:"right",className:o,...i})});s$.id="InputRightElement";s$.displayName="InputRightElement";function Pme(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}function Wd(e,t){return Array.isArray(e)?e.map(n=>n===null?null:t(n)):Pme(e)?Object.keys(e).reduce((n,r)=>(n[r]=t(e[r]),n),{}):e!=null?t(e):null}var Tme=Oe(function(e,t){const{ratio:n=4/3,children:r,className:i,...o}=e,a=w.Children.only(r),s=Qr("chakra-aspect-ratio",i);return N.createElement(Ce.div,{ref:t,position:"relative",className:s,_before:{height:0,content:'""',display:"block",paddingBottom:Wd(n,l=>`${1/l*100}%`)},__css:{"& > *:not(style)":{overflow:"hidden",position:"absolute",top:"0",right:"0",bottom:"0",left:"0",display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},"& > img, & > video":{objectFit:"cover"}},...o},a)});Tme.displayName="AspectRatio";var Lme=Oe(function(t,n){const r=Ao("Badge",t),{className:i,...o}=En(t);return N.createElement(Ce.span,{ref:n,className:Qr("chakra-badge",t.className),...o,__css:{display:"inline-block",whiteSpace:"nowrap",verticalAlign:"middle",...r}})});Lme.displayName="Badge";var _o=Ce("div");_o.displayName="Box";var l$=Oe(function(t,n){const{size:r,centerContent:i=!0,...o}=t,a=i?{display:"flex",alignItems:"center",justifyContent:"center"}:{};return N.createElement(_o,{ref:n,boxSize:r,__css:{...a,flexShrink:0,flexGrow:0},...o})});l$.displayName="Square";var Ame=Oe(function(t,n){const{size:r,...i}=t;return N.createElement(l$,{size:r,ref:n,borderRadius:"9999px",...i})});Ame.displayName="Circle";var u$=Ce("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center"}});u$.displayName="Center";var Ome={horizontal:{insetStart:"50%",transform:"translateX(-50%)"},vertical:{top:"50%",transform:"translateY(-50%)"},both:{insetStart:"50%",top:"50%",transform:"translate(-50%, -50%)"}};Oe(function(t,n){const{axis:r="both",...i}=t;return N.createElement(Ce.div,{ref:n,__css:Ome[r],...i,position:"absolute"})});var Mme=Oe(function(t,n){const r=Ao("Code",t),{className:i,...o}=En(t);return N.createElement(Ce.code,{ref:n,className:Qr("chakra-code",t.className),...o,__css:{display:"inline-block",...r}})});Mme.displayName="Code";var Ime=Oe(function(t,n){const{className:r,centerContent:i,...o}=En(t),a=Ao("Container",t);return N.createElement(Ce.div,{ref:n,className:Qr("chakra-container",r),...o,__css:{...a,...i&&{display:"flex",flexDirection:"column",alignItems:"center"}}})});Ime.displayName="Container";var Rme=Oe(function(t,n){const{borderLeftWidth:r,borderBottomWidth:i,borderTopWidth:o,borderRightWidth:a,borderWidth:s,borderStyle:l,borderColor:u,...d}=Ao("Divider",t),{className:h,orientation:m="horizontal",__css:y,...b}=En(t),S={vertical:{borderLeftWidth:r||a||s||"1px",height:"100%"},horizontal:{borderBottomWidth:i||o||s||"1px",width:"100%"}};return N.createElement(Ce.hr,{ref:n,"aria-orientation":m,...b,__css:{...d,border:"0",borderColor:u,borderStyle:l,...S[m],...y},className:Qr("chakra-divider",h)})});Rme.displayName="Divider";var qe=Oe(function(t,n){const{direction:r,align:i,justify:o,wrap:a,basis:s,grow:l,shrink:u,...d}=t,h={display:"flex",flexDirection:r,alignItems:i,justifyContent:o,flexWrap:a,flexBasis:s,flexGrow:l,flexShrink:u};return N.createElement(Ce.div,{ref:n,__css:h,...d})});qe.displayName="Flex";var c$=Oe(function(t,n){const{templateAreas:r,gap:i,rowGap:o,columnGap:a,column:s,row:l,autoFlow:u,autoRows:d,templateRows:h,autoColumns:m,templateColumns:y,...b}=t,S={display:"grid",gridTemplateAreas:r,gridGap:i,gridRowGap:o,gridColumnGap:a,gridAutoColumns:m,gridColumn:s,gridRow:l,gridAutoFlow:u,gridAutoRows:d,gridTemplateRows:h,gridTemplateColumns:y};return N.createElement(Ce.div,{ref:n,__css:S,...b})});c$.displayName="Grid";function AO(e){return Wd(e,t=>t==="auto"?"auto":`span ${t}/span ${t}`)}var Dme=Oe(function(t,n){const{area:r,colSpan:i,colStart:o,colEnd:a,rowEnd:s,rowSpan:l,rowStart:u,...d}=t,h=fk({gridArea:r,gridColumn:AO(i),gridRow:AO(l),gridColumnStart:o,gridColumnEnd:a,gridRowStart:u,gridRowEnd:s});return N.createElement(Ce.div,{ref:n,__css:h,...d})});Dme.displayName="GridItem";var Dh=Oe(function(t,n){const r=Ao("Heading",t),{className:i,...o}=En(t);return N.createElement(Ce.h2,{ref:n,className:Qr("chakra-heading",t.className),...o,__css:r})});Dh.displayName="Heading";Oe(function(t,n){const r=Ao("Mark",t),i=En(t);return N.createElement(_o,{ref:n,...i,as:"mark",__css:{bg:"transparent",whiteSpace:"nowrap",...r}})});var Nme=Oe(function(t,n){const r=Ao("Kbd",t),{className:i,...o}=En(t);return N.createElement(Ce.kbd,{ref:n,className:Qr("chakra-kbd",i),...o,__css:{fontFamily:"mono",...r}})});Nme.displayName="Kbd";var Nh=Oe(function(t,n){const r=Ao("Link",t),{className:i,isExternal:o,...a}=En(t);return N.createElement(Ce.a,{target:o?"_blank":void 0,rel:o?"noopener":void 0,ref:n,className:Qr("chakra-link",i),...a,__css:r})});Nh.displayName="Link";Oe(function(t,n){const{isExternal:r,target:i,rel:o,className:a,...s}=t;return N.createElement(Ce.a,{...s,ref:n,className:Qr("chakra-linkbox__overlay",a),rel:r?"noopener noreferrer":o,target:r?"_blank":i,__css:{position:"static","&::before":{content:"''",cursor:"inherit",display:"block",position:"absolute",top:0,left:0,zIndex:0,width:"100%",height:"100%"}}})});Oe(function(t,n){const{className:r,...i}=t;return N.createElement(Ce.div,{ref:n,position:"relative",...i,className:Qr("chakra-linkbox",r),__css:{"a[href]:not(.chakra-linkbox__overlay), abbr[title]":{position:"relative",zIndex:1}}})});var[jme,d$]=Mn({name:"ListStylesContext",errorMessage:`useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),gk=Oe(function(t,n){const r=Yi("List",t),{children:i,styleType:o="none",stylePosition:a,spacing:s,...l}=En(t),u=ZS(i),h=s?{["& > *:not(style) ~ *:not(style)"]:{mt:s}}:{};return N.createElement(jme,{value:r},N.createElement(Ce.ul,{ref:n,listStyleType:o,listStylePosition:a,role:"list",__css:{...r.container,...h},...l},u))});gk.displayName="List";var Bme=Oe((e,t)=>{const{as:n,...r}=e;return N.createElement(gk,{ref:t,as:"ol",styleType:"decimal",marginStart:"1em",...r})});Bme.displayName="OrderedList";var Fme=Oe(function(t,n){const{as:r,...i}=t;return N.createElement(gk,{ref:n,as:"ul",styleType:"initial",marginStart:"1em",...i})});Fme.displayName="UnorderedList";var $me=Oe(function(t,n){const r=d$();return N.createElement(Ce.li,{ref:n,...t,__css:r.item})});$me.displayName="ListItem";var zme=Oe(function(t,n){const r=d$();return N.createElement(Da,{ref:n,role:"presentation",...t,__css:r.icon})});zme.displayName="ListIcon";var Hme=Oe(function(t,n){const{columns:r,spacingX:i,spacingY:o,spacing:a,minChildWidth:s,...l}=t,u=h0(),d=s?Wme(s,u):Ume(r);return N.createElement(c$,{ref:n,gap:a,columnGap:i,rowGap:o,templateColumns:d,...l})});Hme.displayName="SimpleGrid";function Vme(e){return typeof e=="number"?`${e}px`:e}function Wme(e,t){return Wd(e,n=>{const r=Uue("sizes",n,Vme(n))(t);return n===null?null:`repeat(auto-fit, minmax(${r}, 1fr))`})}function Ume(e){return Wd(e,t=>t===null?null:`repeat(${t}, minmax(0, 1fr))`)}var f$=Ce("div",{baseStyle:{flex:1,justifySelf:"stretch",alignSelf:"stretch"}});f$.displayName="Spacer";var W7="& > *:not(style) ~ *:not(style)";function Gme(e){const{spacing:t,direction:n}=e,r={column:{marginTop:t,marginEnd:0,marginBottom:0,marginStart:0},row:{marginTop:0,marginEnd:0,marginBottom:0,marginStart:t},"column-reverse":{marginTop:0,marginEnd:0,marginBottom:t,marginStart:0},"row-reverse":{marginTop:0,marginEnd:t,marginBottom:0,marginStart:0}};return{flexDirection:n,[W7]:Wd(n,i=>r[i])}}function qme(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{"&":Wd(n,i=>r[i])}}var h$=e=>N.createElement(Ce.div,{className:"chakra-stack__item",...e,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...e.__css}});h$.displayName="StackItem";var mk=Oe((e,t)=>{const{isInline:n,direction:r,align:i,justify:o,spacing:a="0.5rem",wrap:s,children:l,divider:u,className:d,shouldWrapChildren:h,...m}=e,y=n?"row":r??"column",b=w.useMemo(()=>Gme({direction:y,spacing:a}),[y,a]),S=w.useMemo(()=>qme({spacing:a,direction:y}),[a,y]),E=!!u,k=!h&&!E,_=w.useMemo(()=>{const A=ZS(l);return k?A:A.map((I,R)=>{const D=typeof I.key<"u"?I.key:R,j=R+1===A.length,V=h?N.createElement(h$,{key:D},I):I;if(!E)return V;const K=w.cloneElement(u,{__css:S}),te=j?null:K;return N.createElement(w.Fragment,{key:D},V,te)})},[u,S,E,k,h,l]),T=Qr("chakra-stack",d);return N.createElement(Ce.div,{ref:t,display:"flex",alignItems:i,justifyContent:o,flexDirection:b.flexDirection,flexWrap:s,className:T,__css:E?{}:{[W7]:b[W7]},...m},_)});mk.displayName="Stack";var wy=Oe((e,t)=>N.createElement(mk,{align:"center",...e,direction:"row",ref:t}));wy.displayName="HStack";var yn=Oe((e,t)=>N.createElement(mk,{align:"center",...e,direction:"column",ref:t}));yn.displayName="VStack";var fn=Oe(function(t,n){const r=Ao("Text",t),{className:i,align:o,decoration:a,casing:s,...l}=En(t),u=fk({textAlign:t.align,textDecoration:t.decoration,textTransform:t.casing});return N.createElement(Ce.p,{ref:n,className:Qr("chakra-text",t.className),...u,...l,__css:r})});fn.displayName="Text";function OO(e){return typeof e=="number"?`${e}px`:e}var Yme=Oe(function(t,n){const{spacing:r="0.5rem",spacingX:i,spacingY:o,children:a,justify:s,direction:l,align:u,className:d,shouldWrapChildren:h,...m}=t,y=w.useMemo(()=>{const{spacingX:S=r,spacingY:E=r}={spacingX:i,spacingY:o};return{"--chakra-wrap-x-spacing":k=>Wd(S,_=>OO(QC("space",_)(k))),"--chakra-wrap-y-spacing":k=>Wd(E,_=>OO(QC("space",_)(k))),"--wrap-x-spacing":"calc(var(--chakra-wrap-x-spacing) / 2)","--wrap-y-spacing":"calc(var(--chakra-wrap-y-spacing) / 2)",display:"flex",flexWrap:"wrap",justifyContent:s,alignItems:u,flexDirection:l,listStyleType:"none",padding:"0",margin:"calc(var(--wrap-y-spacing) * -1) calc(var(--wrap-x-spacing) * -1)","& > *:not(style)":{margin:"var(--wrap-y-spacing) var(--wrap-x-spacing)"}}},[r,i,o,s,u,l]),b=w.useMemo(()=>h?w.Children.map(a,(S,E)=>N.createElement(p$,{key:E},S)):a,[a,h]);return N.createElement(Ce.div,{ref:n,className:Qr("chakra-wrap",d),overflow:"hidden",...m},N.createElement(Ce.ul,{className:"chakra-wrap__list",__css:y},b))});Yme.displayName="Wrap";var p$=Oe(function(t,n){const{className:r,...i}=t;return N.createElement(Ce.li,{ref:n,__css:{display:"flex",alignItems:"flex-start"},className:Qr("chakra-wrap__listitem",r),...i})});p$.displayName="WrapItem";var Kme={body:{classList:{add(){},remove(){}}},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector(){return null},querySelectorAll(){return[]},getElementById(){return null},createEvent(){return{initEvent(){}}},createElement(){return{children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName(){return[]}}}},g$=Kme,Cg=()=>{},Xme={document:g$,navigator:{userAgent:""},CustomEvent:function(){return this},addEventListener:Cg,removeEventListener:Cg,getComputedStyle(){return{getPropertyValue(){return""}}},matchMedia(){return{matches:!1,addListener:Cg,removeListener:Cg}},requestAnimationFrame(e){return typeof setTimeout>"u"?(e(),null):setTimeout(e,0)},cancelAnimationFrame(e){typeof setTimeout>"u"||clearTimeout(e)},setTimeout:()=>0,clearTimeout:Cg,setInterval:()=>0,clearInterval:Cg},Zme=Xme,Qme={window:Zme,document:g$},m$=typeof window<"u"?{window,document}:Qme,v$=w.createContext(m$);v$.displayName="EnvironmentContext";function y$(e){const{children:t,environment:n}=e,[r,i]=w.useState(null),[o,a]=w.useState(!1);w.useEffect(()=>a(!0),[]);const s=w.useMemo(()=>{if(n)return n;const l=r==null?void 0:r.ownerDocument,u=r==null?void 0:r.ownerDocument.defaultView;return l?{document:l,window:u}:m$},[r,n]);return N.createElement(v$.Provider,{value:s},t,!n&&o&&N.createElement("span",{id:"__chakra_env",hidden:!0,ref:l=>{w.startTransition(()=>{l&&i(l)})}}))}y$.displayName="EnvironmentProvider";var Jme=e=>e?"":void 0;function e0e(){const e=w.useRef(new Map),t=e.current,n=w.useCallback((i,o,a,s)=>{e.current.set(a,{type:o,el:i,options:s}),i.addEventListener(o,a,s)},[]),r=w.useCallback((i,o,a,s)=>{i.removeEventListener(o,a,s),e.current.delete(a)},[]);return w.useEffect(()=>()=>{t.forEach((i,o)=>{r(i.el,i.type,o,i.options)})},[r,t]),{add:n,remove:r}}function k6(e){const t=e.target,{tagName:n,isContentEditable:r}=t;return n!=="INPUT"&&n!=="TEXTAREA"&&r!==!0}function t0e(e={}){const{ref:t,isDisabled:n,isFocusable:r,clickOnEnter:i=!0,clickOnSpace:o=!0,onMouseDown:a,onMouseUp:s,onClick:l,onKeyDown:u,onKeyUp:d,tabIndex:h,onMouseOver:m,onMouseLeave:y,...b}=e,[S,E]=w.useState(!0),[k,_]=w.useState(!1),T=e0e(),A=Z=>{Z&&Z.tagName!=="BUTTON"&&E(!1)},I=S?h:h||0,R=n&&!r,D=w.useCallback(Z=>{if(n){Z.stopPropagation(),Z.preventDefault();return}Z.currentTarget.focus(),l==null||l(Z)},[n,l]),j=w.useCallback(Z=>{k&&k6(Z)&&(Z.preventDefault(),Z.stopPropagation(),_(!1),T.remove(document,"keyup",j,!1))},[k,T]),z=w.useCallback(Z=>{if(u==null||u(Z),n||Z.defaultPrevented||Z.metaKey||!k6(Z.nativeEvent)||S)return;const W=i&&Z.key==="Enter";o&&Z.key===" "&&(Z.preventDefault(),_(!0)),W&&(Z.preventDefault(),Z.currentTarget.click()),T.add(document,"keyup",j,!1)},[n,S,u,i,o,T,j]),V=w.useCallback(Z=>{if(d==null||d(Z),n||Z.defaultPrevented||Z.metaKey||!k6(Z.nativeEvent)||S)return;o&&Z.key===" "&&(Z.preventDefault(),_(!1),Z.currentTarget.click())},[o,S,n,d]),K=w.useCallback(Z=>{Z.button===0&&(_(!1),T.remove(document,"mouseup",K,!1))},[T]),te=w.useCallback(Z=>{if(Z.button!==0)return;if(n){Z.stopPropagation(),Z.preventDefault();return}S||_(!0),Z.currentTarget.focus({preventScroll:!0}),T.add(document,"mouseup",K,!1),a==null||a(Z)},[n,S,a,T,K]),q=w.useCallback(Z=>{Z.button===0&&(S||_(!1),s==null||s(Z))},[s,S]),F=w.useCallback(Z=>{if(n){Z.preventDefault();return}m==null||m(Z)},[n,m]),U=w.useCallback(Z=>{k&&(Z.preventDefault(),_(!1)),y==null||y(Z)},[k,y]),X=Yn(t,A);return S?{...b,ref:X,type:"button","aria-disabled":R?void 0:n,disabled:R,onClick:D,onMouseDown:a,onMouseUp:s,onKeyUp:d,onKeyDown:u,onMouseOver:m,onMouseLeave:y}:{...b,ref:X,role:"button","data-active":Jme(k),"aria-disabled":n?"true":void 0,tabIndex:R?void 0:I,onClick:D,onMouseDown:te,onMouseUp:q,onKeyUp:V,onKeyDown:z,onMouseOver:F,onMouseLeave:U}}function b$(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function S$(e){if(!b$(e))return!1;const t=e.ownerDocument.defaultView??window;return e instanceof t.HTMLElement}function n0e(e){var t;return((t=x$(e))==null?void 0:t.defaultView)??window}function x$(e){return b$(e)?e.ownerDocument:document}function r0e(e){return x$(e).activeElement}var w$=e=>e.hasAttribute("tabindex"),i0e=e=>w$(e)&&e.tabIndex===-1;function o0e(e){return Boolean(e.getAttribute("disabled"))===!0||Boolean(e.getAttribute("aria-disabled"))===!0}function C$(e){return e.parentElement&&C$(e.parentElement)?!0:e.hidden}function a0e(e){const t=e.getAttribute("contenteditable");return t!=="false"&&t!=null}function _$(e){if(!S$(e)||C$(e)||o0e(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]():a0e(e)?!0:w$(e)}function s0e(e){return e?S$(e)&&_$(e)&&!i0e(e):!1}var l0e=["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]"],u0e=l0e.join(),c0e=e=>e.offsetWidth>0&&e.offsetHeight>0;function k$(e){const t=Array.from(e.querySelectorAll(u0e));return t.unshift(e),t.filter(n=>_$(n)&&c0e(n))}function d0e(e){const t=e.current;if(!t)return!1;const n=r0e(t);return!n||t.contains(n)?!1:!!s0e(n)}function f0e(e,t){const{shouldFocus:n,visible:r,focusRef:i}=t,o=n&&!r;Vd(()=>{if(!o||d0e(e))return;const a=(i==null?void 0:i.current)||e.current;a&&requestAnimationFrame(()=>{a.focus()})},[o,e,i])}var h0e={preventScroll:!0,shouldFocus:!1};function p0e(e,t=h0e){const{focusRef:n,preventScroll:r,shouldFocus:i,visible:o}=t,a=g0e(e)?e.current:e,s=i&&o,l=w.useRef(s),u=w.useRef(o);Ws(()=>{!u.current&&o&&(l.current=s),u.current=o},[o,s]);const d=w.useCallback(()=>{if(!(!o||!a||!l.current)&&(l.current=!1,!a.contains(document.activeElement)))if(n!=null&&n.current)requestAnimationFrame(()=>{var h;(h=n.current)==null||h.focus({preventScroll:r})});else{const h=k$(a);h.length>0&&requestAnimationFrame(()=>{h[0].focus({preventScroll:r})})}},[o,r,a,n]);Vd(()=>{d()},[d]),Rh(a,"transitionend",d)}function g0e(e){return"current"in e}var Zo="top",ls="bottom",us="right",Qo="left",vk="auto",Cy=[Zo,ls,us,Qo],Um="start",L2="end",m0e="clippingParents",E$="viewport",G1="popper",v0e="reference",MO=Cy.reduce(function(e,t){return e.concat([t+"-"+Um,t+"-"+L2])},[]),P$=[].concat(Cy,[vk]).reduce(function(e,t){return e.concat([t,t+"-"+Um,t+"-"+L2])},[]),y0e="beforeRead",b0e="read",S0e="afterRead",x0e="beforeMain",w0e="main",C0e="afterMain",_0e="beforeWrite",k0e="write",E0e="afterWrite",P0e=[y0e,b0e,S0e,x0e,w0e,C0e,_0e,k0e,E0e];function au(e){return e?(e.nodeName||"").toLowerCase():null}function hs(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Uh(e){var t=hs(e).Element;return e instanceof t||e instanceof Element}function is(e){var t=hs(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function yk(e){if(typeof ShadowRoot>"u")return!1;var t=hs(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function T0e(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},o=t.elements[n];!is(o)||!au(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(a){var s=i[a];s===!1?o.removeAttribute(a):o.setAttribute(a,s===!0?"":s)}))})}function L0e(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 i=t.elements[r],o=t.attributes[r]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),s=a.reduce(function(l,u){return l[u]="",l},{});!is(i)||!au(i)||(Object.assign(i.style,s),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const A0e={name:"applyStyles",enabled:!0,phase:"write",fn:T0e,effect:L0e,requires:["computeStyles"]};function Zl(e){return e.split("-")[0]}var jh=Math.max,c5=Math.min,Gm=Math.round;function U7(){var e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function T$(){return!/^((?!chrome|android).)*safari/i.test(U7())}function qm(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&is(e)&&(i=e.offsetWidth>0&&Gm(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&Gm(r.height)/e.offsetHeight||1);var a=Uh(e)?hs(e):window,s=a.visualViewport,l=!T$()&&n,u=(r.left+(l&&s?s.offsetLeft:0))/i,d=(r.top+(l&&s?s.offsetTop:0))/o,h=r.width/i,m=r.height/o;return{width:h,height:m,top:d,right:u+h,bottom:d+m,left:u,x:u,y:d}}function bk(e){var t=qm(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 L$(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&yk(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ec(e){return hs(e).getComputedStyle(e)}function O0e(e){return["table","td","th"].indexOf(au(e))>=0}function rf(e){return((Uh(e)?e.ownerDocument:e.document)||window.document).documentElement}function nx(e){return au(e)==="html"?e:e.assignedSlot||e.parentNode||(yk(e)?e.host:null)||rf(e)}function IO(e){return!is(e)||ec(e).position==="fixed"?null:e.offsetParent}function M0e(e){var t=/firefox/i.test(U7()),n=/Trident/i.test(U7());if(n&&is(e)){var r=ec(e);if(r.position==="fixed")return null}var i=nx(e);for(yk(i)&&(i=i.host);is(i)&&["html","body"].indexOf(au(i))<0;){var o=ec(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function _y(e){for(var t=hs(e),n=IO(e);n&&O0e(n)&&ec(n).position==="static";)n=IO(n);return n&&(au(n)==="html"||au(n)==="body"&&ec(n).position==="static")?t:n||M0e(e)||t}function Sk(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function qv(e,t,n){return jh(e,c5(t,n))}function I0e(e,t,n){var r=qv(e,t,n);return r>n?n:r}function A$(){return{top:0,right:0,bottom:0,left:0}}function O$(e){return Object.assign({},A$(),e)}function M$(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var R0e=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,O$(typeof t!="number"?t:M$(t,Cy))};function D0e(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Zl(n.placement),l=Sk(s),u=[Qo,us].indexOf(s)>=0,d=u?"height":"width";if(!(!o||!a)){var h=R0e(i.padding,n),m=bk(o),y=l==="y"?Zo:Qo,b=l==="y"?ls:us,S=n.rects.reference[d]+n.rects.reference[l]-a[l]-n.rects.popper[d],E=a[l]-n.rects.reference[l],k=_y(o),_=k?l==="y"?k.clientHeight||0:k.clientWidth||0:0,T=S/2-E/2,A=h[y],I=_-m[d]-h[b],R=_/2-m[d]/2+T,D=qv(A,R,I),j=l;n.modifiersData[r]=(t={},t[j]=D,t.centerOffset=D-R,t)}}function N0e(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||L$(t.elements.popper,i)&&(t.elements.arrow=i))}const j0e={name:"arrow",enabled:!0,phase:"main",fn:D0e,effect:N0e,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ym(e){return e.split("-")[1]}var B0e={top:"auto",right:"auto",bottom:"auto",left:"auto"};function F0e(e){var t=e.x,n=e.y,r=window,i=r.devicePixelRatio||1;return{x:Gm(t*i)/i||0,y:Gm(n*i)/i||0}}function RO(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,u=e.adaptive,d=e.roundOffsets,h=e.isFixed,m=a.x,y=m===void 0?0:m,b=a.y,S=b===void 0?0:b,E=typeof d=="function"?d({x:y,y:S}):{x:y,y:S};y=E.x,S=E.y;var k=a.hasOwnProperty("x"),_=a.hasOwnProperty("y"),T=Qo,A=Zo,I=window;if(u){var R=_y(n),D="clientHeight",j="clientWidth";if(R===hs(n)&&(R=rf(n),ec(R).position!=="static"&&s==="absolute"&&(D="scrollHeight",j="scrollWidth")),R=R,i===Zo||(i===Qo||i===us)&&o===L2){A=ls;var z=h&&R===I&&I.visualViewport?I.visualViewport.height:R[D];S-=z-r.height,S*=l?1:-1}if(i===Qo||(i===Zo||i===ls)&&o===L2){T=us;var V=h&&R===I&&I.visualViewport?I.visualViewport.width:R[j];y-=V-r.width,y*=l?1:-1}}var K=Object.assign({position:s},u&&B0e),te=d===!0?F0e({x:y,y:S}):{x:y,y:S};if(y=te.x,S=te.y,l){var q;return Object.assign({},K,(q={},q[A]=_?"0":"",q[T]=k?"0":"",q.transform=(I.devicePixelRatio||1)<=1?"translate("+y+"px, "+S+"px)":"translate3d("+y+"px, "+S+"px, 0)",q))}return Object.assign({},K,(t={},t[A]=_?S+"px":"",t[T]=k?y+"px":"",t.transform="",t))}function $0e(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,a=o===void 0?!0:o,s=n.roundOffsets,l=s===void 0?!0:s,u={placement:Zl(t.placement),variation:Ym(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,RO(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,RO(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const z0e={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:$0e,data:{}};var eb={passive:!0};function H0e(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=i===void 0?!0:i,a=r.resize,s=a===void 0?!0:a,l=hs(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&u.forEach(function(d){d.addEventListener("scroll",n.update,eb)}),s&&l.addEventListener("resize",n.update,eb),function(){o&&u.forEach(function(d){d.removeEventListener("scroll",n.update,eb)}),s&&l.removeEventListener("resize",n.update,eb)}}const V0e={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:H0e,data:{}};var W0e={left:"right",right:"left",bottom:"top",top:"bottom"};function h4(e){return e.replace(/left|right|bottom|top/g,function(t){return W0e[t]})}var U0e={start:"end",end:"start"};function DO(e){return e.replace(/start|end/g,function(t){return U0e[t]})}function xk(e){var t=hs(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function wk(e){return qm(rf(e)).left+xk(e).scrollLeft}function G0e(e,t){var n=hs(e),r=rf(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;var u=T$();(u||!u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s+wk(e),y:l}}function q0e(e){var t,n=rf(e),r=xk(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=jh(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=jh(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+wk(e),l=-r.scrollTop;return ec(i||n).direction==="rtl"&&(s+=jh(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}function Ck(e){var t=ec(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function I$(e){return["html","body","#document"].indexOf(au(e))>=0?e.ownerDocument.body:is(e)&&Ck(e)?e:I$(nx(e))}function Yv(e,t){var n;t===void 0&&(t=[]);var r=I$(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=hs(r),a=i?[o].concat(o.visualViewport||[],Ck(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(Yv(nx(a)))}function G7(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Y0e(e,t){var n=qm(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 NO(e,t,n){return t===E$?G7(G0e(e,n)):Uh(t)?Y0e(t,n):G7(q0e(rf(e)))}function K0e(e){var t=Yv(nx(e)),n=["absolute","fixed"].indexOf(ec(e).position)>=0,r=n&&is(e)?_y(e):e;return Uh(r)?t.filter(function(i){return Uh(i)&&L$(i,r)&&au(i)!=="body"}):[]}function X0e(e,t,n,r){var i=t==="clippingParents"?K0e(e):[].concat(t),o=[].concat(i,[n]),a=o[0],s=o.reduce(function(l,u){var d=NO(e,u,r);return l.top=jh(d.top,l.top),l.right=c5(d.right,l.right),l.bottom=c5(d.bottom,l.bottom),l.left=jh(d.left,l.left),l},NO(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function R$(e){var t=e.reference,n=e.element,r=e.placement,i=r?Zl(r):null,o=r?Ym(r):null,a=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,l;switch(i){case Zo:l={x:a,y:t.y-n.height};break;case ls:l={x:a,y:t.y+t.height};break;case us:l={x:t.x+t.width,y:s};break;case Qo:l={x:t.x-n.width,y:s};break;default:l={x:t.x,y:t.y}}var u=i?Sk(i):null;if(u!=null){var d=u==="y"?"height":"width";switch(o){case Um:l[u]=l[u]-(t[d]/2-n[d]/2);break;case L2:l[u]=l[u]+(t[d]/2-n[d]/2);break}}return l}function A2(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,o=n.strategy,a=o===void 0?e.strategy:o,s=n.boundary,l=s===void 0?m0e:s,u=n.rootBoundary,d=u===void 0?E$:u,h=n.elementContext,m=h===void 0?G1:h,y=n.altBoundary,b=y===void 0?!1:y,S=n.padding,E=S===void 0?0:S,k=O$(typeof E!="number"?E:M$(E,Cy)),_=m===G1?v0e:G1,T=e.rects.popper,A=e.elements[b?_:m],I=X0e(Uh(A)?A:A.contextElement||rf(e.elements.popper),l,d,a),R=qm(e.elements.reference),D=R$({reference:R,element:T,strategy:"absolute",placement:i}),j=G7(Object.assign({},T,D)),z=m===G1?j:R,V={top:I.top-z.top+k.top,bottom:z.bottom-I.bottom+k.bottom,left:I.left-z.left+k.left,right:z.right-I.right+k.right},K=e.modifiersData.offset;if(m===G1&&K){var te=K[i];Object.keys(V).forEach(function(q){var F=[us,ls].indexOf(q)>=0?1:-1,U=[Zo,ls].indexOf(q)>=0?"y":"x";V[q]+=te[U]*F})}return V}function Z0e(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?P$:l,d=Ym(r),h=d?s?MO:MO.filter(function(b){return Ym(b)===d}):Cy,m=h.filter(function(b){return u.indexOf(b)>=0});m.length===0&&(m=h);var y=m.reduce(function(b,S){return b[S]=A2(e,{placement:S,boundary:i,rootBoundary:o,padding:a})[Zl(S)],b},{});return Object.keys(y).sort(function(b,S){return y[b]-y[S]})}function Q0e(e){if(Zl(e)===vk)return[];var t=h4(e);return[DO(e),t,DO(t)]}function J0e(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!0:a,l=n.fallbackPlacements,u=n.padding,d=n.boundary,h=n.rootBoundary,m=n.altBoundary,y=n.flipVariations,b=y===void 0?!0:y,S=n.allowedAutoPlacements,E=t.options.placement,k=Zl(E),_=k===E,T=l||(_||!b?[h4(E)]:Q0e(E)),A=[E].concat(T).reduce(function(ye,He){return ye.concat(Zl(He)===vk?Z0e(t,{placement:He,boundary:d,rootBoundary:h,padding:u,flipVariations:b,allowedAutoPlacements:S}):He)},[]),I=t.rects.reference,R=t.rects.popper,D=new Map,j=!0,z=A[0],V=0;V=0,U=F?"width":"height",X=A2(t,{placement:K,boundary:d,rootBoundary:h,altBoundary:m,padding:u}),Z=F?q?us:Qo:q?ls:Zo;I[U]>R[U]&&(Z=h4(Z));var W=h4(Z),Q=[];if(o&&Q.push(X[te]<=0),s&&Q.push(X[Z]<=0,X[W]<=0),Q.every(function(ye){return ye})){z=K,j=!1;break}D.set(K,Q)}if(j)for(var ie=b?3:1,fe=function(He){var Ne=A.find(function(tt){var _e=D.get(tt);if(_e)return _e.slice(0,He).every(function(lt){return lt})});if(Ne)return z=Ne,"break"},Se=ie;Se>0;Se--){var Te=fe(Se);if(Te==="break")break}t.placement!==z&&(t.modifiersData[r]._skip=!0,t.placement=z,t.reset=!0)}}const e1e={name:"flip",enabled:!0,phase:"main",fn:J0e,requiresIfExists:["offset"],data:{_skip:!1}};function jO(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 BO(e){return[Zo,us,ls,Qo].some(function(t){return e[t]>=0})}function t1e(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=A2(t,{elementContext:"reference"}),s=A2(t,{altBoundary:!0}),l=jO(a,r),u=jO(s,i,o),d=BO(l),h=BO(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:d,hasPopperEscaped:h},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":h})}const n1e={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:t1e};function r1e(e,t,n){var r=Zl(e),i=[Qo,Zo].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[Qo,us].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function i1e(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,a=P$.reduce(function(d,h){return d[h]=r1e(h,t.rects,o),d},{}),s=a[t.placement],l=s.x,u=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=a}const o1e={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:i1e};function a1e(e){var t=e.state,n=e.name;t.modifiersData[n]=R$({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const s1e={name:"popperOffsets",enabled:!0,phase:"read",fn:a1e,data:{}};function l1e(e){return e==="x"?"y":"x"}function u1e(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!1:a,l=n.boundary,u=n.rootBoundary,d=n.altBoundary,h=n.padding,m=n.tether,y=m===void 0?!0:m,b=n.tetherOffset,S=b===void 0?0:b,E=A2(t,{boundary:l,rootBoundary:u,padding:h,altBoundary:d}),k=Zl(t.placement),_=Ym(t.placement),T=!_,A=Sk(k),I=l1e(A),R=t.modifiersData.popperOffsets,D=t.rects.reference,j=t.rects.popper,z=typeof S=="function"?S(Object.assign({},t.rects,{placement:t.placement})):S,V=typeof z=="number"?{mainAxis:z,altAxis:z}:Object.assign({mainAxis:0,altAxis:0},z),K=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,te={x:0,y:0};if(R){if(o){var q,F=A==="y"?Zo:Qo,U=A==="y"?ls:us,X=A==="y"?"height":"width",Z=R[A],W=Z+E[F],Q=Z-E[U],ie=y?-j[X]/2:0,fe=_===Um?D[X]:j[X],Se=_===Um?-j[X]:-D[X],Te=t.elements.arrow,ye=y&&Te?bk(Te):{width:0,height:0},He=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:A$(),Ne=He[F],tt=He[U],_e=qv(0,D[X],ye[X]),lt=T?D[X]/2-ie-_e-Ne-V.mainAxis:fe-_e-Ne-V.mainAxis,wt=T?-D[X]/2+ie+_e+tt+V.mainAxis:Se+_e+tt+V.mainAxis,ct=t.elements.arrow&&_y(t.elements.arrow),mt=ct?A==="y"?ct.clientTop||0:ct.clientLeft||0:0,St=(q=K==null?void 0:K[A])!=null?q:0,Ae=Z+lt-St-mt,ut=Z+wt-St,Mt=qv(y?c5(W,Ae):W,Z,y?jh(Q,ut):Q);R[A]=Mt,te[A]=Mt-Z}if(s){var at,Ct=A==="x"?Zo:Qo,Zt=A==="x"?ls:us,le=R[I],De=I==="y"?"height":"width",Ue=le+E[Ct],Ye=le-E[Zt],we=[Zo,Qo].indexOf(k)!==-1,je=(at=K==null?void 0:K[I])!=null?at:0,_t=we?Ue:le-D[De]-j[De]-je+V.altAxis,Dt=we?le+D[De]+j[De]-je-V.altAxis:Ye,Le=y&&we?I0e(_t,le,Dt):qv(y?_t:Ue,le,y?Dt:Ye);R[I]=Le,te[I]=Le-le}t.modifiersData[r]=te}}const c1e={name:"preventOverflow",enabled:!0,phase:"main",fn:u1e,requiresIfExists:["offset"]};function d1e(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function f1e(e){return e===hs(e)||!is(e)?xk(e):d1e(e)}function h1e(e){var t=e.getBoundingClientRect(),n=Gm(t.width)/e.offsetWidth||1,r=Gm(t.height)/e.offsetHeight||1;return n!==1||r!==1}function p1e(e,t,n){n===void 0&&(n=!1);var r=is(t),i=is(t)&&h1e(t),o=rf(t),a=qm(e,i,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((au(t)!=="body"||Ck(o))&&(s=f1e(t)),is(t)?(l=qm(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):o&&(l.x=wk(o))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function g1e(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function i(o){n.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(s){if(!n.has(s)){var l=t.get(s);l&&i(l)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||i(o)}),r}function m1e(e){var t=g1e(e);return P0e.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function v1e(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function y1e(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var FO={placement:"bottom",modifiers:[],strategy:"absolute"};function $O(){for(var e=arguments.length,t=new Array(e),n=0;n({var:e,varRef:t?`var(${e}, ${t})`:`var(${e})`}),oi={arrowShadowColor:_g("--popper-arrow-shadow-color"),arrowSize:_g("--popper-arrow-size","8px"),arrowSizeHalf:_g("--popper-arrow-size-half"),arrowBg:_g("--popper-arrow-bg"),transformOrigin:_g("--popper-transform-origin"),arrowOffset:_g("--popper-arrow-offset")};function w1e(e){if(e.includes("top"))return"1px 1px 1px 0 var(--popper-arrow-shadow-color)";if(e.includes("bottom"))return"-1px -1px 1px 0 var(--popper-arrow-shadow-color)";if(e.includes("right"))return"-1px 1px 1px 0 var(--popper-arrow-shadow-color)";if(e.includes("left"))return"1px -1px 1px 0 var(--popper-arrow-shadow-color)"}var C1e={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"},_1e=e=>C1e[e],zO={scroll:!0,resize:!0};function k1e(e){let t;return typeof e=="object"?t={enabled:!0,options:{...zO,...e}}:t={enabled:e,options:zO},t}var E1e={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`}},P1e={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:e})=>{HO(e)},effect:({state:e})=>()=>{HO(e)}},HO=e=>{e.elements.popper.style.setProperty(oi.transformOrigin.var,_1e(e.placement))},T1e={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:e})=>{L1e(e)}},L1e=e=>{var t;if(!e.placement)return;const n=A1e(e.placement);if((t=e.elements)!=null&&t.arrow&&n){Object.assign(e.elements.arrow.style,{[n.property]:n.value,width:oi.arrowSize.varRef,height:oi.arrowSize.varRef,zIndex:-1});const r={[oi.arrowSizeHalf.var]:`calc(${oi.arrowSize.varRef} / 2)`,[oi.arrowOffset.var]:`calc(${oi.arrowSizeHalf.varRef} * -1)`};for(const i in r)e.elements.arrow.style.setProperty(i,r[i])}},A1e=e=>{if(e.startsWith("top"))return{property:"bottom",value:oi.arrowOffset.varRef};if(e.startsWith("bottom"))return{property:"top",value:oi.arrowOffset.varRef};if(e.startsWith("left"))return{property:"right",value:oi.arrowOffset.varRef};if(e.startsWith("right"))return{property:"left",value:oi.arrowOffset.varRef}},O1e={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:e})=>{VO(e)},effect:({state:e})=>()=>{VO(e)}},VO=e=>{if(!e.elements.arrow)return;const t=e.elements.arrow.querySelector("[data-popper-arrow-inner]");t&&Object.assign(t.style,{transform:"rotate(45deg)",background:oi.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:w1e(e.placement)})},M1e={"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"}},I1e={"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 R1e(e,t="ltr"){var n;const r=((n=M1e[e])==null?void 0:n[t])||e;return t==="ltr"?r:I1e[e]??r}function D$(e={}){const{enabled:t=!0,modifiers:n,placement:r="bottom",strategy:i="absolute",arrowPadding:o=8,eventListeners:a=!0,offset:s,gutter:l=8,flip:u=!0,boundary:d="clippingParents",preventOverflow:h=!0,matchWidth:m,direction:y="ltr"}=e,b=w.useRef(null),S=w.useRef(null),E=w.useRef(null),k=R1e(r,y),_=w.useRef(()=>{}),T=w.useCallback(()=>{var V;!t||!b.current||!S.current||((V=_.current)==null||V.call(_),E.current=x1e(b.current,S.current,{placement:k,modifiers:[O1e,T1e,P1e,{...E1e,enabled:!!m},{name:"eventListeners",...k1e(a)},{name:"arrow",options:{padding:o}},{name:"offset",options:{offset:s??[0,l]}},{name:"flip",enabled:!!u,options:{padding:8}},{name:"preventOverflow",enabled:!!h,options:{boundary:d}},...n??[]],strategy:i}),E.current.forceUpdate(),_.current=E.current.destroy)},[k,t,n,m,a,o,s,l,u,h,d,i]);w.useEffect(()=>()=>{var V;!b.current&&!S.current&&((V=E.current)==null||V.destroy(),E.current=null)},[]);const A=w.useCallback(V=>{b.current=V,T()},[T]),I=w.useCallback((V={},K=null)=>({...V,ref:Yn(A,K)}),[A]),R=w.useCallback(V=>{S.current=V,T()},[T]),D=w.useCallback((V={},K=null)=>({...V,ref:Yn(R,K),style:{...V.style,position:i,minWidth:m?void 0:"max-content",inset:"0 auto auto 0"}}),[i,R,m]),j=w.useCallback((V={},K=null)=>{const{size:te,shadowColor:q,bg:F,style:U,...X}=V;return{...X,ref:K,"data-popper-arrow":"",style:D1e(V)}},[]),z=w.useCallback((V={},K=null)=>({...V,ref:K,"data-popper-arrow-inner":""}),[]);return{update(){var V;(V=E.current)==null||V.update()},forceUpdate(){var V;(V=E.current)==null||V.forceUpdate()},transformOrigin:oi.transformOrigin.varRef,referenceRef:A,popperRef:R,getPopperProps:D,getArrowProps:j,getArrowInnerProps:z,getReferenceProps:I}}function D1e(e){const{size:t,shadowColor:n,bg:r,style:i}=e,o={...i,position:"absolute"};return t&&(o["--popper-arrow-size"]=t),n&&(o["--popper-arrow-shadow-color"]=n),r&&(o["--popper-arrow-bg"]=r),o}function N$(e={}){const{onClose:t,onOpen:n,isOpen:r,id:i}=e,o=Er(n),a=Er(t),[s,l]=w.useState(e.defaultIsOpen||!1),u=r!==void 0?r:s,d=r!==void 0,h=w.useId(),m=i??`disclosure-${h}`,y=w.useCallback(()=>{d||l(!1),a==null||a()},[d,a]),b=w.useCallback(()=>{d||l(!0),o==null||o()},[d,o]),S=w.useCallback(()=>{u?y():b()},[u,b,y]);function E(_={}){return{..._,"aria-expanded":u,"aria-controls":m,onClick(T){var A;(A=_.onClick)==null||A.call(_,T),S()}}}function k(_={}){return{..._,hidden:!u,id:m}}return{isOpen:u,onOpen:b,onClose:y,onToggle:S,isControlled:d,getButtonProps:E,getDisclosureProps:k}}function N1e(e){const{isOpen:t,ref:n}=e,[r,i]=w.useState(t),[o,a]=w.useState(!1);return w.useEffect(()=>{o||(i(t),a(!0))},[t,o,r]),Rh(()=>n.current,"animationend",()=>{i(t)}),{present:!(t?!1:!r),onComplete(){var l;const u=n0e(n.current),d=new u.CustomEvent("animationend",{bubbles:!0});(l=n.current)==null||l.dispatchEvent(d)}}}function j$(e){const{wasSelected:t,enabled:n,isSelected:r,mode:i="unmount"}=e;return!!(!n||r||i==="keepMounted"&&t)}var Qs={},j1e={get exports(){return Qs},set exports(e){Qs=e}},Na={},Bh={},B1e={get exports(){return Bh},set exports(e){Bh=e}},B$={};/** + * @license React + * scheduler.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. + */(function(e){function t(W,Q){var ie=W.length;W.push(Q);e:for(;0>>1,Se=W[fe];if(0>>1;fei(He,ie))Nei(tt,He)?(W[fe]=tt,W[Ne]=ie,fe=Ne):(W[fe]=He,W[ye]=ie,fe=ye);else if(Nei(tt,ie))W[fe]=tt,W[Ne]=ie,fe=Ne;else break e}}return Q}function i(W,Q){var ie=W.sortIndex-Q.sortIndex;return ie!==0?ie:W.id-Q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],u=[],d=1,h=null,m=3,y=!1,b=!1,S=!1,E=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function T(W){for(var Q=n(u);Q!==null;){if(Q.callback===null)r(u);else if(Q.startTime<=W)r(u),Q.sortIndex=Q.expirationTime,t(l,Q);else break;Q=n(u)}}function A(W){if(S=!1,T(W),!b)if(n(l)!==null)b=!0,X(I);else{var Q=n(u);Q!==null&&Z(A,Q.startTime-W)}}function I(W,Q){b=!1,S&&(S=!1,k(j),j=-1),y=!0;var ie=m;try{for(T(Q),h=n(l);h!==null&&(!(h.expirationTime>Q)||W&&!K());){var fe=h.callback;if(typeof fe=="function"){h.callback=null,m=h.priorityLevel;var Se=fe(h.expirationTime<=Q);Q=e.unstable_now(),typeof Se=="function"?h.callback=Se:h===n(l)&&r(l),T(Q)}else r(l);h=n(l)}if(h!==null)var Te=!0;else{var ye=n(u);ye!==null&&Z(A,ye.startTime-Q),Te=!1}return Te}finally{h=null,m=ie,y=!1}}var R=!1,D=null,j=-1,z=5,V=-1;function K(){return!(e.unstable_now()-VW||125fe?(W.sortIndex=ie,t(u,W),n(l)===null&&W===n(u)&&(S?(k(j),j=-1):S=!0,Z(A,ie-fe))):(W.sortIndex=Se,t(l,W),b||y||(b=!0,X(I))),W},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(W){var Q=m;return function(){var ie=m;m=Q;try{return W.apply(this,arguments)}finally{m=ie}}}})(B$);(function(e){e.exports=B$})(B1e);/** + * @license React + * react-dom.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 F$=w,Ma=Bh;function $e(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),q7=Object.prototype.hasOwnProperty,F1e=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,WO={},UO={};function $1e(e){return q7.call(UO,e)?!0:q7.call(WO,e)?!1:F1e.test(e)?UO[e]=!0:(WO[e]=!0,!1)}function z1e(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function H1e(e,t,n,r){if(t===null||typeof t>"u"||z1e(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Oo(e,t,n,r,i,o,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var qi={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){qi[e]=new Oo(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];qi[t]=new Oo(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){qi[e]=new Oo(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){qi[e]=new Oo(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){qi[e]=new Oo(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){qi[e]=new Oo(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){qi[e]=new Oo(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){qi[e]=new Oo(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){qi[e]=new Oo(e,5,!1,e.toLowerCase(),null,!1,!1)});var _k=/[\-:]([a-z])/g;function kk(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(_k,kk);qi[t]=new Oo(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(_k,kk);qi[t]=new Oo(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(_k,kk);qi[t]=new Oo(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){qi[e]=new Oo(e,1,!1,e.toLowerCase(),null,!1,!1)});qi.xlinkHref=new Oo("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){qi[e]=new Oo(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ek(e,t,n,r){var i=qi.hasOwnProperty(t)?qi[t]:null;(i!==null?i.type!==0:r||!(2s||i[a]!==o[s]){var l=` +`+i[a].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=a&&0<=s);break}}}finally{P6=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?yv(e):""}function V1e(e){switch(e.tag){case 5:return yv(e.type);case 16:return yv("Lazy");case 13:return yv("Suspense");case 19:return yv("SuspenseList");case 0:case 2:case 15:return e=T6(e.type,!1),e;case 11:return e=T6(e.type.render,!1),e;case 1:return e=T6(e.type,!0),e;default:return""}}function Z7(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Kg:return"Fragment";case Yg:return"Portal";case Y7:return"Profiler";case Pk:return"StrictMode";case K7:return"Suspense";case X7:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case H$:return(e.displayName||"Context")+".Consumer";case z$:return(e._context.displayName||"Context")+".Provider";case Tk:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Lk:return t=e.displayName||null,t!==null?t:Z7(e.type)||"Memo";case pd:t=e._payload,e=e._init;try{return Z7(e(t))}catch{}}return null}function W1e(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Z7(t);case 8:return t===Pk?"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 t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Ud(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function W$(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function U1e(e){var t=W$(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,o.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function nb(e){e._valueTracker||(e._valueTracker=U1e(e))}function U$(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=W$(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function d5(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Q7(e,t){var n=t.checked;return Tr({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function qO(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ud(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function G$(e,t){t=t.checked,t!=null&&Ek(e,"checked",t,!1)}function J7(e,t){G$(e,t);var n=Ud(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?e9(e,t.type,n):t.hasOwnProperty("defaultValue")&&e9(e,t.type,Ud(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function YO(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function e9(e,t,n){(t!=="number"||d5(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var bv=Array.isArray;function _m(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=rb.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function M2(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Kv={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},G1e=["Webkit","ms","Moz","O"];Object.keys(Kv).forEach(function(e){G1e.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Kv[t]=Kv[e]})});function X$(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Kv.hasOwnProperty(e)&&Kv[e]?(""+t).trim():t+"px"}function Z$(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=X$(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var q1e=Tr({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function r9(e,t){if(t){if(q1e[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error($e(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error($e(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error($e(61))}if(t.style!=null&&typeof t.style!="object")throw Error($e(62))}}function i9(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var o9=null;function Ak(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var a9=null,km=null,Em=null;function ZO(e){if(e=Py(e)){if(typeof a9!="function")throw Error($e(280));var t=e.stateNode;t&&(t=sx(t),a9(e.stateNode,e.type,t))}}function Q$(e){km?Em?Em.push(e):Em=[e]:km=e}function J$(){if(km){var e=km,t=Em;if(Em=km=null,ZO(e),t)for(e=0;e>>=0,e===0?32:31-(ive(e)/ove|0)|0}var ib=64,ob=4194304;function Sv(e){switch(e&-e){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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function g5(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,a=n&268435455;if(a!==0){var s=a&~i;s!==0?r=Sv(s):(o&=a,o!==0&&(r=Sv(o)))}else a=n&~i,a!==0?r=Sv(a):o!==0&&(r=Sv(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function ky(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ys(t),e[t]=n}function uve(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Zv),aM=String.fromCharCode(32),sM=!1;function bz(e,t){switch(e){case"keyup":return jve.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Sz(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Xg=!1;function Fve(e,t){switch(e){case"compositionend":return Sz(t);case"keypress":return t.which!==32?null:(sM=!0,aM);case"textInput":return e=t.data,e===aM&&sM?null:e;default:return null}}function $ve(e,t){if(Xg)return e==="compositionend"||!Bk&&bz(e,t)?(e=vz(),g4=Dk=_d=null,Xg=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=dM(n)}}function _z(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?_z(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function kz(){for(var e=window,t=d5();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=d5(e.document)}return t}function Fk(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Kve(e){var t=kz(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&_z(n.ownerDocument.documentElement,n)){if(r!==null&&Fk(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=fM(n,o);var a=fM(n,r);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Zg=null,f9=null,Jv=null,h9=!1;function hM(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;h9||Zg==null||Zg!==d5(r)||(r=Zg,"selectionStart"in r&&Fk(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Jv&&B2(Jv,r)||(Jv=r,r=y5(f9,"onSelect"),0em||(e.current=b9[em],b9[em]=null,em--)}function nr(e,t){em++,b9[em]=e.current,e.current=t}var Gd={},so=af(Gd),Jo=af(!1),Gh=Gd;function Xm(e,t){var n=e.type.contextTypes;if(!n)return Gd;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function ea(e){return e=e.childContextTypes,e!=null}function S5(){fr(Jo),fr(so)}function SM(e,t,n){if(so.current!==Gd)throw Error($e(168));nr(so,t),nr(Jo,n)}function Rz(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error($e(108,W1e(e)||"Unknown",i));return Tr({},n,r)}function x5(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Gd,Gh=so.current,nr(so,e),nr(Jo,Jo.current),!0}function xM(e,t,n){var r=e.stateNode;if(!r)throw Error($e(169));n?(e=Rz(e,t,Gh),r.__reactInternalMemoizedMergedChildContext=e,fr(Jo),fr(so),nr(so,e)):fr(Jo),nr(Jo,n)}var Hu=null,lx=!1,H6=!1;function Dz(e){Hu===null?Hu=[e]:Hu.push(e)}function s2e(e){lx=!0,Dz(e)}function sf(){if(!H6&&Hu!==null){H6=!0;var e=0,t=Bn;try{var n=Hu;for(Bn=1;e>=a,i-=a,Uu=1<<32-Ys(t)+i|n<j?(z=D,D=null):z=D.sibling;var V=m(k,D,T[j],A);if(V===null){D===null&&(D=z);break}e&&D&&V.alternate===null&&t(k,D),_=o(V,_,j),R===null?I=V:R.sibling=V,R=V,D=z}if(j===T.length)return n(k,D),yr&&dh(k,j),I;if(D===null){for(;jj?(z=D,D=null):z=D.sibling;var K=m(k,D,V.value,A);if(K===null){D===null&&(D=z);break}e&&D&&K.alternate===null&&t(k,D),_=o(K,_,j),R===null?I=K:R.sibling=K,R=K,D=z}if(V.done)return n(k,D),yr&&dh(k,j),I;if(D===null){for(;!V.done;j++,V=T.next())V=h(k,V.value,A),V!==null&&(_=o(V,_,j),R===null?I=V:R.sibling=V,R=V);return yr&&dh(k,j),I}for(D=r(k,D);!V.done;j++,V=T.next())V=y(D,k,j,V.value,A),V!==null&&(e&&V.alternate!==null&&D.delete(V.key===null?j:V.key),_=o(V,_,j),R===null?I=V:R.sibling=V,R=V);return e&&D.forEach(function(te){return t(k,te)}),yr&&dh(k,j),I}function E(k,_,T,A){if(typeof T=="object"&&T!==null&&T.type===Kg&&T.key===null&&(T=T.props.children),typeof T=="object"&&T!==null){switch(T.$$typeof){case tb:e:{for(var I=T.key,R=_;R!==null;){if(R.key===I){if(I=T.type,I===Kg){if(R.tag===7){n(k,R.sibling),_=i(R,T.props.children),_.return=k,k=_;break e}}else if(R.elementType===I||typeof I=="object"&&I!==null&&I.$$typeof===pd&&TM(I)===R.type){n(k,R.sibling),_=i(R,T.props),_.ref=Q1(k,R,T),_.return=k,k=_;break e}n(k,R);break}else t(k,R);R=R.sibling}T.type===Kg?(_=$h(T.props.children,k.mode,A,T.key),_.return=k,k=_):(A=C4(T.type,T.key,T.props,null,k.mode,A),A.ref=Q1(k,_,T),A.return=k,k=A)}return a(k);case Yg:e:{for(R=T.key;_!==null;){if(_.key===R)if(_.tag===4&&_.stateNode.containerInfo===T.containerInfo&&_.stateNode.implementation===T.implementation){n(k,_.sibling),_=i(_,T.children||[]),_.return=k,k=_;break e}else{n(k,_);break}else t(k,_);_=_.sibling}_=X6(T,k.mode,A),_.return=k,k=_}return a(k);case pd:return R=T._init,E(k,_,R(T._payload),A)}if(bv(T))return b(k,_,T,A);if(q1(T))return S(k,_,T,A);fb(k,T)}return typeof T=="string"&&T!==""||typeof T=="number"?(T=""+T,_!==null&&_.tag===6?(n(k,_.sibling),_=i(_,T),_.return=k,k=_):(n(k,_),_=K6(T,k.mode,A),_.return=k,k=_),a(k)):n(k,_)}return E}var Qm=Vz(!0),Wz=Vz(!1),Ty={},Jl=af(Ty),H2=af(Ty),V2=af(Ty);function Ph(e){if(e===Ty)throw Error($e(174));return e}function Yk(e,t){switch(nr(V2,t),nr(H2,e),nr(Jl,Ty),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:n9(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=n9(t,e)}fr(Jl),nr(Jl,t)}function Jm(){fr(Jl),fr(H2),fr(V2)}function Uz(e){Ph(V2.current);var t=Ph(Jl.current),n=n9(t,e.type);t!==n&&(nr(H2,e),nr(Jl,n))}function Kk(e){H2.current===e&&(fr(Jl),fr(H2))}var _r=af(0);function P5(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var V6=[];function Xk(){for(var e=0;en?n:4,e(!0);var r=W6.transition;W6.transition={};try{e(!1),t()}finally{Bn=n,W6.transition=r}}function sH(){return ds().memoizedState}function d2e(e,t,n){var r=Dd(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},lH(e))uH(t,n);else if(n=Fz(e,t,n,r),n!==null){var i=Po();Ks(n,e,r,i),cH(n,t,r)}}function f2e(e,t,n){var r=Dd(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(lH(e))uH(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var a=t.lastRenderedState,s=o(a,n);if(i.hasEagerState=!0,i.eagerState=s,Js(s,a)){var l=t.interleaved;l===null?(i.next=i,Gk(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=Fz(e,t,i,r),n!==null&&(i=Po(),Ks(n,e,r,i),cH(n,t,r))}}function lH(e){var t=e.alternate;return e===Pr||t!==null&&t===Pr}function uH(e,t){e2=T5=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function cH(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Mk(e,n)}}var L5={readContext:cs,useCallback:Qi,useContext:Qi,useEffect:Qi,useImperativeHandle:Qi,useInsertionEffect:Qi,useLayoutEffect:Qi,useMemo:Qi,useReducer:Qi,useRef:Qi,useState:Qi,useDebugValue:Qi,useDeferredValue:Qi,useTransition:Qi,useMutableSource:Qi,useSyncExternalStore:Qi,useId:Qi,unstable_isNewReconciler:!1},h2e={readContext:cs,useCallback:function(e,t){return Dl().memoizedState=[e,t===void 0?null:t],e},useContext:cs,useEffect:AM,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,b4(4194308,4,nH.bind(null,t,e),n)},useLayoutEffect:function(e,t){return b4(4194308,4,e,t)},useInsertionEffect:function(e,t){return b4(4,2,e,t)},useMemo:function(e,t){var n=Dl();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Dl();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=d2e.bind(null,Pr,e),[r.memoizedState,e]},useRef:function(e){var t=Dl();return e={current:e},t.memoizedState=e},useState:LM,useDebugValue:tE,useDeferredValue:function(e){return Dl().memoizedState=e},useTransition:function(){var e=LM(!1),t=e[0];return e=c2e.bind(null,e[1]),Dl().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Pr,i=Dl();if(yr){if(n===void 0)throw Error($e(407));n=n()}else{if(n=t(),Li===null)throw Error($e(349));Yh&30||Yz(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,AM(Xz.bind(null,r,o,e),[e]),r.flags|=2048,G2(9,Kz.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Dl(),t=Li.identifierPrefix;if(yr){var n=Gu,r=Uu;n=(r&~(1<<32-Ys(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=W2++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[zl]=t,e[z2]=r,bH(e,t,!1,!1),t.stateNode=e;e:{switch(a=i9(n,r),n){case"dialog":or("cancel",e),or("close",e),i=r;break;case"iframe":case"object":case"embed":or("load",e),i=r;break;case"video":case"audio":for(i=0;it0&&(t.flags|=128,r=!0,J1(o,!1),t.lanes=4194304)}else{if(!r)if(e=P5(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),J1(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!yr)return Ji(t),null}else 2*Zr()-o.renderingStartTime>t0&&n!==1073741824&&(t.flags|=128,r=!0,J1(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(n=o.last,n!==null?n.sibling=a:t.child=a,o.last=a)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Zr(),t.sibling=null,n=_r.current,nr(_r,r?n&1|2:n&1),t):(Ji(t),null);case 22:case 23:return sE(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?_a&1073741824&&(Ji(t),t.subtreeFlags&6&&(t.flags|=8192)):Ji(t),null;case 24:return null;case 25:return null}throw Error($e(156,t.tag))}function x2e(e,t){switch(zk(t),t.tag){case 1:return ea(t.type)&&S5(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Jm(),fr(Jo),fr(so),Xk(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Kk(t),null;case 13:if(fr(_r),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error($e(340));Zm()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return fr(_r),null;case 4:return Jm(),null;case 10:return Uk(t.type._context),null;case 22:case 23:return sE(),null;case 24:return null;default:return null}}var pb=!1,io=!1,w2e=typeof WeakSet=="function"?WeakSet:Set,ht=null;function im(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Fr(e,t,r)}else n.current=null}function O9(e,t,n){try{n()}catch(r){Fr(e,t,r)}}var FM=!1;function C2e(e,t){if(p9=m5,e=kz(),Fk(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var a=0,s=-1,l=-1,u=0,d=0,h=e,m=null;t:for(;;){for(var y;h!==n||i!==0&&h.nodeType!==3||(s=a+i),h!==o||r!==0&&h.nodeType!==3||(l=a+r),h.nodeType===3&&(a+=h.nodeValue.length),(y=h.firstChild)!==null;)m=h,h=y;for(;;){if(h===e)break t;if(m===n&&++u===i&&(s=a),m===o&&++d===r&&(l=a),(y=h.nextSibling)!==null)break;h=m,m=h.parentNode}h=y}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(g9={focusedElem:e,selectionRange:n},m5=!1,ht=t;ht!==null;)if(t=ht,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ht=e;else for(;ht!==null;){t=ht;try{var b=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(b!==null){var S=b.memoizedProps,E=b.memoizedState,k=t.stateNode,_=k.getSnapshotBeforeUpdate(t.elementType===t.type?S:Ns(t.type,S),E);k.__reactInternalSnapshotBeforeUpdate=_}break;case 3:var T=t.stateNode.containerInfo;T.nodeType===1?T.textContent="":T.nodeType===9&&T.documentElement&&T.removeChild(T.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error($e(163))}}catch(A){Fr(t,t.return,A)}if(e=t.sibling,e!==null){e.return=t.return,ht=e;break}ht=t.return}return b=FM,FM=!1,b}function t2(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&O9(t,n,o)}i=i.next}while(i!==r)}}function dx(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function M9(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function wH(e){var t=e.alternate;t!==null&&(e.alternate=null,wH(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[zl],delete t[z2],delete t[y9],delete t[o2e],delete t[a2e])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function CH(e){return e.tag===5||e.tag===3||e.tag===4}function $M(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||CH(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function I9(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=b5));else if(r!==4&&(e=e.child,e!==null))for(I9(e,t,n),e=e.sibling;e!==null;)I9(e,t,n),e=e.sibling}function R9(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(R9(e,t,n),e=e.sibling;e!==null;)R9(e,t,n),e=e.sibling}var Hi=null,js=!1;function sd(e,t,n){for(n=n.child;n!==null;)_H(e,t,n),n=n.sibling}function _H(e,t,n){if(Ql&&typeof Ql.onCommitFiberUnmount=="function")try{Ql.onCommitFiberUnmount(rx,n)}catch{}switch(n.tag){case 5:io||im(n,t);case 6:var r=Hi,i=js;Hi=null,sd(e,t,n),Hi=r,js=i,Hi!==null&&(js?(e=Hi,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Hi.removeChild(n.stateNode));break;case 18:Hi!==null&&(js?(e=Hi,n=n.stateNode,e.nodeType===8?z6(e.parentNode,n):e.nodeType===1&&z6(e,n),N2(e)):z6(Hi,n.stateNode));break;case 4:r=Hi,i=js,Hi=n.stateNode.containerInfo,js=!0,sd(e,t,n),Hi=r,js=i;break;case 0:case 11:case 14:case 15:if(!io&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&O9(n,t,a),i=i.next}while(i!==r)}sd(e,t,n);break;case 1:if(!io&&(im(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Fr(n,t,s)}sd(e,t,n);break;case 21:sd(e,t,n);break;case 22:n.mode&1?(io=(r=io)||n.memoizedState!==null,sd(e,t,n),io=r):sd(e,t,n);break;default:sd(e,t,n)}}function zM(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new w2e),t.forEach(function(r){var i=M2e.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Is(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=a),r&=~o}if(r=i,r=Zr()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*k2e(r/1960))-r,10e?16:e,kd===null)var r=!1;else{if(e=kd,kd=null,M5=0,pn&6)throw Error($e(331));var i=pn;for(pn|=4,ht=e.current;ht!==null;){var o=ht,a=o.child;if(ht.flags&16){var s=o.deletions;if(s!==null){for(var l=0;lZr()-oE?Fh(e,0):iE|=n),ta(e,t)}function MH(e,t){t===0&&(e.mode&1?(t=ob,ob<<=1,!(ob&130023424)&&(ob=4194304)):t=1);var n=Po();e=rc(e,t),e!==null&&(ky(e,t,n),ta(e,n))}function O2e(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),MH(e,n)}function M2e(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error($e(314))}r!==null&&r.delete(t),MH(e,n)}var IH;IH=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Jo.current)Xo=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Xo=!1,b2e(e,t,n);Xo=!!(e.flags&131072)}else Xo=!1,yr&&t.flags&1048576&&Nz(t,C5,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;S4(e,t),e=t.pendingProps;var i=Xm(t,so.current);Tm(t,n),i=Qk(null,t,r,e,i,n);var o=Jk();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ea(r)?(o=!0,x5(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,qk(t),i.updater=ux,t.stateNode=i,i._reactInternals=t,_9(t,r,e,n),t=P9(null,t,r,!0,o,n)):(t.tag=0,yr&&o&&$k(t),xo(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(S4(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=R2e(r),e=Ns(r,e),i){case 0:t=E9(null,t,r,e,n);break e;case 1:t=NM(null,t,r,e,n);break e;case 11:t=RM(null,t,r,e,n);break e;case 14:t=DM(null,t,r,Ns(r.type,e),n);break e}throw Error($e(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ns(r,i),E9(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ns(r,i),NM(e,t,r,i,n);case 3:e:{if(mH(t),e===null)throw Error($e(387));r=t.pendingProps,o=t.memoizedState,i=o.element,$z(e,t),E5(t,r,null,n);var a=t.memoizedState;if(r=a.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=e0(Error($e(423)),t),t=jM(e,t,r,n,i);break e}else if(r!==i){i=e0(Error($e(424)),t),t=jM(e,t,r,n,i);break e}else for(Ea=Md(t.stateNode.containerInfo.firstChild),La=t,yr=!0,Fs=null,n=Wz(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Zm(),r===i){t=ic(e,t,n);break e}xo(e,t,r,n)}t=t.child}return t;case 5:return Uz(t),e===null&&x9(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,a=i.children,m9(r,i)?a=null:o!==null&&m9(r,o)&&(t.flags|=32),gH(e,t),xo(e,t,a,n),t.child;case 6:return e===null&&x9(t),null;case 13:return vH(e,t,n);case 4:return Yk(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Qm(t,null,r,n):xo(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ns(r,i),RM(e,t,r,i,n);case 7:return xo(e,t,t.pendingProps,n),t.child;case 8:return xo(e,t,t.pendingProps.children,n),t.child;case 12:return xo(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,a=i.value,nr(_5,r._currentValue),r._currentValue=a,o!==null)if(Js(o.value,a)){if(o.children===i.children&&!Jo.current){t=ic(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var s=o.dependencies;if(s!==null){a=o.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=qu(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),w9(o.return,n,t),s.lanes|=n;break}l=l.next}}else if(o.tag===10)a=o.type===t.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error($e(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),w9(a,n,t),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}xo(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Tm(t,n),i=cs(i),r=r(i),t.flags|=1,xo(e,t,r,n),t.child;case 14:return r=t.type,i=Ns(r,t.pendingProps),i=Ns(r.type,i),DM(e,t,r,i,n);case 15:return hH(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ns(r,i),S4(e,t),t.tag=1,ea(r)?(e=!0,x5(t)):e=!1,Tm(t,n),Hz(t,r,i),_9(t,r,i,n),P9(null,t,r,!0,e,n);case 19:return yH(e,t,n);case 22:return pH(e,t,n)}throw Error($e(156,t.tag))};function RH(e,t){return az(e,t)}function I2e(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ns(e,t,n,r){return new I2e(e,t,n,r)}function uE(e){return e=e.prototype,!(!e||!e.isReactComponent)}function R2e(e){if(typeof e=="function")return uE(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Tk)return 11;if(e===Lk)return 14}return 2}function Nd(e,t){var n=e.alternate;return n===null?(n=ns(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function C4(e,t,n,r,i,o){var a=2;if(r=e,typeof e=="function")uE(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Kg:return $h(n.children,i,o,t);case Pk:a=8,i|=8;break;case Y7:return e=ns(12,n,t,i|2),e.elementType=Y7,e.lanes=o,e;case K7:return e=ns(13,n,t,i),e.elementType=K7,e.lanes=o,e;case X7:return e=ns(19,n,t,i),e.elementType=X7,e.lanes=o,e;case V$:return hx(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case z$:a=10;break e;case H$:a=9;break e;case Tk:a=11;break e;case Lk:a=14;break e;case pd:a=16,r=null;break e}throw Error($e(130,e==null?e:typeof e,""))}return t=ns(a,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function $h(e,t,n,r){return e=ns(7,e,r,t),e.lanes=n,e}function hx(e,t,n,r){return e=ns(22,e,r,t),e.elementType=V$,e.lanes=n,e.stateNode={isHidden:!1},e}function K6(e,t,n){return e=ns(6,e,null,t),e.lanes=n,e}function X6(e,t,n){return t=ns(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function D2e(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=A6(0),this.expirationTimes=A6(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=A6(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function cE(e,t,n,r,i,o,a,s,l){return e=new D2e(e,t,n,s,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=ns(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},qk(o),e}function N2e(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}t(),e.exports=Na})(j1e);const vb=d_(Qs);var[z2e,H2e]=Mn({strict:!1,name:"PortalManagerContext"});function BH(e){const{children:t,zIndex:n}=e;return N.createElement(z2e,{value:{zIndex:n}},t)}BH.displayName="PortalManager";var[FH,V2e]=Mn({strict:!1,name:"PortalContext"}),pE="chakra-portal",W2e=".chakra-portal",U2e=e=>N.createElement("div",{className:"chakra-portal-zIndex",style:{position:"absolute",zIndex:e.zIndex,top:0,left:0,right:0}},e.children),G2e=e=>{const{appendToParentPortal:t,children:n}=e,[r,i]=w.useState(null),o=w.useRef(null),[,a]=w.useState({});w.useEffect(()=>a({}),[]);const s=V2e(),l=H2e();Ws(()=>{if(!r)return;const d=r.ownerDocument,h=t?s??d.body:d.body;if(!h)return;o.current=d.createElement("div"),o.current.className=pE,h.appendChild(o.current),a({});const m=o.current;return()=>{h.contains(m)&&h.removeChild(m)}},[r]);const u=l!=null&&l.zIndex?N.createElement(U2e,{zIndex:l==null?void 0:l.zIndex},n):n;return o.current?Qs.createPortal(N.createElement(FH,{value:o.current},u),o.current):N.createElement("span",{ref:d=>{d&&i(d)}})},q2e=e=>{const{children:t,containerRef:n,appendToParentPortal:r}=e,i=n.current,o=i??(typeof window<"u"?document.body:void 0),a=w.useMemo(()=>{const l=i==null?void 0:i.ownerDocument.createElement("div");return l&&(l.className=pE),l},[i]),[,s]=w.useState({});return Ws(()=>s({}),[]),Ws(()=>{if(!(!a||!o))return o.appendChild(a),()=>{o.removeChild(a)}},[a,o]),o&&a?Qs.createPortal(N.createElement(FH,{value:r?a:null},t),a):null};function ap(e){const{containerRef:t,...n}=e;return t?N.createElement(q2e,{containerRef:t,...n}):N.createElement(G2e,{...n})}ap.defaultProps={appendToParentPortal:!0};ap.className=pE;ap.selector=W2e;ap.displayName="Portal";var Y2e=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Eg=new WeakMap,yb=new WeakMap,bb={},Z6=0,$H=function(e){return e&&(e.host||$H(e.parentNode))},K2e=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=$H(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return Boolean(n)})},X2e=function(e,t,n,r){var i=K2e(t,Array.isArray(e)?e:[e]);bb[n]||(bb[n]=new WeakMap);var o=bb[n],a=[],s=new Set,l=new Set(i),u=function(h){!h||s.has(h)||(s.add(h),u(h.parentNode))};i.forEach(u);var d=function(h){!h||l.has(h)||Array.prototype.forEach.call(h.children,function(m){if(s.has(m))d(m);else{var y=m.getAttribute(r),b=y!==null&&y!=="false",S=(Eg.get(m)||0)+1,E=(o.get(m)||0)+1;Eg.set(m,S),o.set(m,E),a.push(m),S===1&&b&&yb.set(m,!0),E===1&&m.setAttribute(n,"true"),b||m.setAttribute(r,"true")}})};return d(t),s.clear(),Z6++,function(){a.forEach(function(h){var m=Eg.get(h)-1,y=o.get(h)-1;Eg.set(h,m),o.set(h,y),m||(yb.has(h)||h.removeAttribute(r),yb.delete(h)),y||h.removeAttribute(n)}),Z6--,Z6||(Eg=new WeakMap,Eg=new WeakMap,yb=new WeakMap,bb={})}},zH=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||Y2e(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),X2e(r,i,n,"aria-hidden")):function(){return null}};function gE(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var jn={},Z2e={get exports(){return jn},set exports(e){jn=e}},Q2e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",J2e=Q2e,eye=J2e;function HH(){}function VH(){}VH.resetWarningCache=HH;var tye=function(){function e(r,i,o,a,s,l){if(l!==eye){var u=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 u.name="Invariant Violation",u}}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:VH,resetWarningCache:HH};return n.PropTypes=n,n};Z2e.exports=tye();var F9="data-focus-lock",WH="data-focus-lock-disabled",nye="data-no-focus-lock",rye="data-autofocus-inside",iye="data-no-autofocus";function oye(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function aye(e,t){var n=w.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}function UH(e,t){return aye(t||null,function(n){return e.forEach(function(r){return oye(r,n)})})}var Q6={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"};function GH(e){return e}function qH(e,t){t===void 0&&(t=GH);var n=[],r=!1,i={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(o){var a=t(o,r);return n.push(a),function(){n=n.filter(function(s){return s!==a})}},assignSyncMedium:function(o){for(r=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(s){return o(s)},filter:function(){return n}}},assignMedium:function(o){r=!0;var a=[];if(n.length){var s=n;n=[],s.forEach(o),a=n}var l=function(){var d=a;a=[],d.forEach(o)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(d){a.push(d),u()},filter:function(d){return a=a.filter(d),n}}}};return i}function mE(e,t){return t===void 0&&(t=GH),qH(e,t)}function YH(e){e===void 0&&(e={});var t=qH(null);return t.options=$l({async:!0,ssr:!1},e),t}var KH=function(e){var t=e.sideCar,n=FF(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 w.createElement(r,$l({},n))};KH.isSideCarExport=!0;function sye(e,t){return e.useMedium(t),KH}var XH=mE({},function(e){var t=e.target,n=e.currentTarget;return{target:t,currentTarget:n}}),ZH=mE(),lye=mE(),uye=YH({async:!0}),cye=[],vE=w.forwardRef(function(t,n){var r,i=w.useState(),o=i[0],a=i[1],s=w.useRef(),l=w.useRef(!1),u=w.useRef(null),d=t.children,h=t.disabled,m=t.noFocusGuards,y=t.persistentFocus,b=t.crossFrame,S=t.autoFocus;t.allowTextSelection;var E=t.group,k=t.className,_=t.whiteList,T=t.hasPositiveIndices,A=t.shards,I=A===void 0?cye:A,R=t.as,D=R===void 0?"div":R,j=t.lockProps,z=j===void 0?{}:j,V=t.sideCar,K=t.returnFocus,te=t.focusOptions,q=t.onActivation,F=t.onDeactivation,U=w.useState({}),X=U[0],Z=w.useCallback(function(){u.current=u.current||document&&document.activeElement,s.current&&q&&q(s.current),l.current=!0},[q]),W=w.useCallback(function(){l.current=!1,F&&F(s.current)},[F]);w.useEffect(function(){h||(u.current=null)},[]);var Q=w.useCallback(function(tt){var _e=u.current;if(_e&&_e.focus){var lt=typeof K=="function"?K(_e):K;if(lt){var wt=typeof lt=="object"?lt:void 0;u.current=null,tt?Promise.resolve().then(function(){return _e.focus(wt)}):_e.focus(wt)}}},[K]),ie=w.useCallback(function(tt){l.current&&XH.useMedium(tt)},[]),fe=ZH.useMedium,Se=w.useCallback(function(tt){s.current!==tt&&(s.current=tt,a(tt))},[]),Te=bn((r={},r[WH]=h&&"disabled",r[F9]=E,r),z),ye=m!==!0,He=ye&&m!=="tail",Ne=UH([n,Se]);return w.createElement(w.Fragment,null,ye&&[w.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:h?-1:0,style:Q6}),T?w.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:h?-1:1,style:Q6}):null],!h&&w.createElement(V,{id:X,sideCar:uye,observed:o,disabled:h,persistentFocus:y,crossFrame:b,autoFocus:S,whiteList:_,shards:I,onActivation:Z,onDeactivation:W,returnFocus:Q,focusOptions:te}),w.createElement(D,bn({ref:Ne},Te,{className:k,onBlur:fe,onFocus:ie}),d),He&&w.createElement("div",{"data-focus-guard":!0,tabIndex:h?-1:0,style:Q6}))});vE.propTypes={};vE.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 QH=vE;function $9(e,t){return $9=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},$9(e,t)}function yE(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,$9(e,t)}function JH(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dye(e,t){function n(r){return r.displayName||r.name||"Component"}return function(i){var o=[],a;function s(){a=e(o.map(function(u){return u.props})),t(a)}var l=function(u){yE(d,u);function d(){return u.apply(this,arguments)||this}d.peek=function(){return a};var h=d.prototype;return h.componentDidMount=function(){o.push(this),s()},h.componentDidUpdate=function(){s()},h.componentWillUnmount=function(){var y=o.indexOf(this);o.splice(y,1),s()},h.render=function(){return N.createElement(i,this.props)},d}(w.PureComponent);return JH(l,"displayName","SideEffect("+n(i)+")"),l}}var fu=function(e){for(var t=Array(e.length),n=0;n=0}).sort(bye)},Sye=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],SE=Sye.join(","),xye="".concat(SE,", [data-focus-guard]"),lV=function(e,t){var n;return fu(((n=e.shadowRoot)===null||n===void 0?void 0:n.children)||e.children).reduce(function(r,i){return r.concat(i.matches(t?xye:SE)?[i]:[],lV(i))},[])},xE=function(e,t){return e.reduce(function(n,r){return n.concat(lV(r,t),r.parentNode?fu(r.parentNode.querySelectorAll(SE)).filter(function(i){return i===r}):[])},[])},wye=function(e){var t=e.querySelectorAll("[".concat(rye,"]"));return fu(t).map(function(n){return xE([n])}).reduce(function(n,r){return n.concat(r)},[])},wE=function(e,t){return fu(e).filter(function(n){return nV(t,n)}).filter(function(n){return mye(n)})},KM=function(e,t){return t===void 0&&(t=new Map),fu(e).filter(function(n){return rV(t,n)})},H9=function(e,t,n){return sV(wE(xE(e,n),t),!0,n)},XM=function(e,t){return sV(wE(xE(e),t),!1)},Cye=function(e,t){return wE(wye(e),t)},Y2=function(e,t){return e.shadowRoot?Y2(e.shadowRoot,t):Object.getPrototypeOf(e).contains!==void 0&&Object.getPrototypeOf(e).contains.call(e,t)?!0:fu(e.children).some(function(n){return Y2(n,t)})},_ye=function(e){for(var t=new Set,n=e.length,r=0;r0&&t.add(i),(o&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter(function(a,s){return!t.has(s)})},uV=function(e){return e.parentNode?uV(e.parentNode):e},CE=function(e){var t=z9(e);return t.filter(Boolean).reduce(function(n,r){var i=r.getAttribute(F9);return n.push.apply(n,i?_ye(fu(uV(r).querySelectorAll("[".concat(F9,'="').concat(i,'"]:not([').concat(WH,'="disabled"])')))):[r]),n},[])},cV=function(e){return e.activeElement?e.activeElement.shadowRoot?cV(e.activeElement.shadowRoot):e.activeElement:void 0},_E=function(){return document.activeElement?document.activeElement.shadowRoot?cV(document.activeElement.shadowRoot):document.activeElement:void 0},kye=function(e){return e===document.activeElement},Eye=function(e){return Boolean(fu(e.querySelectorAll("iframe")).some(function(t){return kye(t)}))},dV=function(e){var t=document&&_E();return!t||t.dataset&&t.dataset.focusGuard?!1:CE(e).some(function(n){return Y2(n,t)||Eye(n)})},Pye=function(){var e=document&&_E();return e?fu(document.querySelectorAll("[".concat(nye,"]"))).some(function(t){return Y2(t,e)}):!1},Tye=function(e,t){return t.filter(aV).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},kE=function(e,t){return aV(e)&&e.name?Tye(e,t):e},Lye=function(e){var t=new Set;return e.forEach(function(n){return t.add(kE(n,e))}),e.filter(function(n){return t.has(n)})},ZM=function(e){return e[0]&&e.length>1?kE(e[0],e):e[0]},QM=function(e,t){return e.length>1?e.indexOf(kE(e[t],e)):t},fV="NEW_FOCUS",Aye=function(e,t,n,r){var i=e.length,o=e[0],a=e[i-1],s=bE(n);if(!(n&&e.indexOf(n)>=0)){var l=n!==void 0?t.indexOf(n):-1,u=r?t.indexOf(r):l,d=r?e.indexOf(r):-1,h=l-u,m=t.indexOf(o),y=t.indexOf(a),b=Lye(t),S=n!==void 0?b.indexOf(n):-1,E=S-(r?b.indexOf(r):l),k=QM(e,0),_=QM(e,i-1);if(l===-1||d===-1)return fV;if(!h&&d>=0)return d;if(l<=m&&s&&Math.abs(h)>1)return _;if(l>=y&&s&&Math.abs(h)>1)return k;if(h&&Math.abs(E)>1)return d;if(l<=m)return _;if(l>y)return k;if(h)return Math.abs(h)>1?d:(i+d+h)%i}},Oye=function(e){return function(t){var n,r=(n=iV(t))===null||n===void 0?void 0:n.autofocus;return t.autofocus||r!==void 0&&r!=="false"||e.indexOf(t)>=0}},Mye=function(e,t,n){var r=e.map(function(o){var a=o.node;return a}),i=KM(r.filter(Oye(n)));return i&&i.length?ZM(i):ZM(KM(t))},V9=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&V9(e.parentNode.host||e.parentNode,t),t},J6=function(e,t){for(var n=V9(e),r=V9(t),i=0;i=0)return o}return!1},hV=function(e,t,n){var r=z9(e),i=z9(t),o=r[0],a=!1;return i.filter(Boolean).forEach(function(s){a=J6(a||s,s)||a,n.filter(Boolean).forEach(function(l){var u=J6(o,l);u&&(!a||Y2(u,a)?a=u:a=J6(u,a))})}),a},Iye=function(e,t){return e.reduce(function(n,r){return n.concat(Cye(r,t))},[])},Rye=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(yye)},Dye=function(e,t){var n=document&&_E(),r=CE(e).filter(D5),i=hV(n||e,e,r),o=new Map,a=XM(r,o),s=H9(r,o).filter(function(m){var y=m.node;return D5(y)});if(!(!s[0]&&(s=a,!s[0]))){var l=XM([i],o).map(function(m){var y=m.node;return y}),u=Rye(l,s),d=u.map(function(m){var y=m.node;return y}),h=Aye(d,l,n,t);return h===fV?{node:Mye(a,d,Iye(r,o))}:h===void 0?h:u[h]}},Nye=function(e){var t=CE(e).filter(D5),n=hV(e,e,t),r=new Map,i=H9([n],r,!0),o=H9(t,r).filter(function(a){var s=a.node;return D5(s)}).map(function(a){var s=a.node;return s});return i.map(function(a){var s=a.node,l=a.index;return{node:s,index:l,lockItem:o.indexOf(s)>=0,guard:bE(s)}})},jye=function(e,t){"focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus()},eC=0,tC=!1,Bye=function(e,t,n){n===void 0&&(n={});var r=Dye(e,t);if(!tC&&r){if(eC>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),tC=!0,setTimeout(function(){tC=!1},1);return}eC++,jye(r.node,n.focusOptions),eC--}};const pV=Bye;function gV(e){var t=window,n=t.setImmediate;typeof n<"u"?n(e):setTimeout(e,1)}var Fye=function(){return document&&document.activeElement===document.body},$ye=function(){return Fye()||Pye()},Am=null,am=null,Om=null,K2=!1,zye=function(){return!0},Hye=function(t){return(Am.whiteList||zye)(t)},Vye=function(t,n){Om={observerNode:t,portaledElement:n}},Wye=function(t){return Om&&Om.portaledElement===t};function JM(e,t,n,r){var i=null,o=e;do{var a=r[o];if(a.guard)a.node.dataset.focusAutoGuard&&(i=a);else if(a.lockItem){if(o!==e)return;i=null}else break}while((o+=n)!==t);i&&(i.node.tabIndex=0)}var Uye=function(t){return t&&"current"in t?t.current:t},Gye=function(t){return t?Boolean(K2):K2==="meanwhile"},qye=function e(t,n,r){return n&&(n.host===t&&(!n.activeElement||r.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,r))},Yye=function(t,n){return n.some(function(r){return qye(t,r,r)})},N5=function(){var t=!1;if(Am){var n=Am,r=n.observed,i=n.persistentFocus,o=n.autoFocus,a=n.shards,s=n.crossFrame,l=n.focusOptions,u=r||Om&&Om.portaledElement,d=document&&document.activeElement;if(u){var h=[u].concat(a.map(Uye).filter(Boolean));if((!d||Hye(d))&&(i||Gye(s)||!$ye()||!am&&o)&&(u&&!(dV(h)||d&&Yye(d,h)||Wye(d))&&(document&&!am&&d&&!o?(d.blur&&d.blur(),document.body.focus()):(t=pV(h,am,{focusOptions:l}),Om={})),K2=!1,am=document&&document.activeElement),document){var m=document&&document.activeElement,y=Nye(h),b=y.map(function(S){var E=S.node;return E}).indexOf(m);b>-1&&(y.filter(function(S){var E=S.guard,k=S.node;return E&&k.dataset.focusAutoGuard}).forEach(function(S){var E=S.node;return E.removeAttribute("tabIndex")}),JM(b,y.length,1,y),JM(b,-1,-1,y))}}}return t},mV=function(t){N5()&&t&&(t.stopPropagation(),t.preventDefault())},EE=function(){return gV(N5)},Kye=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||Vye(r,n)},Xye=function(){return null},vV=function(){K2="just",setTimeout(function(){K2="meanwhile"},0)},Zye=function(){document.addEventListener("focusin",mV),document.addEventListener("focusout",EE),window.addEventListener("blur",vV)},Qye=function(){document.removeEventListener("focusin",mV),document.removeEventListener("focusout",EE),window.removeEventListener("blur",vV)};function Jye(e){return e.filter(function(t){var n=t.disabled;return!n})}function e3e(e){var t=e.slice(-1)[0];t&&!Am&&Zye();var n=Am,r=n&&t&&t.id===n.id;Am=t,n&&!r&&(n.onDeactivation(),e.filter(function(i){var o=i.id;return o===n.id}).length||n.returnFocus(!t)),t?(am=null,(!r||n.observed!==t.observed)&&t.onActivation(),N5(),gV(N5)):(Qye(),am=null)}XH.assignSyncMedium(Kye);ZH.assignMedium(EE);lye.assignMedium(function(e){return e({moveFocusInside:pV,focusInside:dV})});const t3e=dye(Jye,e3e)(Xye);var yV=w.forwardRef(function(t,n){return w.createElement(QH,bn({sideCar:t3e,ref:n},t))}),bV=QH.propTypes||{};bV.sideCar;gE(bV,["sideCar"]);yV.propTypes={};const n3e=yV;var SV=e=>{const{initialFocusRef:t,finalFocusRef:n,contentRef:r,restoreFocus:i,children:o,isDisabled:a,autoFocus:s,persistentFocus:l,lockFocusAcrossFrames:u}=e,d=w.useCallback(()=>{t!=null&&t.current?t.current.focus():r!=null&&r.current&&k$(r.current).length===0&&requestAnimationFrame(()=>{var b;(b=r.current)==null||b.focus()})},[t,r]),h=w.useCallback(()=>{var y;(y=n==null?void 0:n.current)==null||y.focus()},[n]),m=i&&!n;return N.createElement(n3e,{crossFrame:u,persistentFocus:l,autoFocus:s,disabled:a,onActivation:d,onDeactivation:h,returnFocus:m},o)};SV.displayName="FocusLock";var _4="right-scroll-bar-position",k4="width-before-scroll-bar",r3e="with-scroll-bars-hidden",i3e="--removed-body-scroll-bar-size",xV=YH(),nC=function(){},yx=w.forwardRef(function(e,t){var n=w.useRef(null),r=w.useState({onScrollCapture:nC,onWheelCapture:nC,onTouchMoveCapture:nC}),i=r[0],o=r[1],a=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,h=e.shards,m=e.sideCar,y=e.noIsolation,b=e.inert,S=e.allowPinchZoom,E=e.as,k=E===void 0?"div":E,_=FF(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),T=m,A=UH([n,t]),I=$l($l({},_),i);return w.createElement(w.Fragment,null,d&&w.createElement(T,{sideCar:xV,removeScrollBar:u,shards:h,noIsolation:y,inert:b,setCallbacks:o,allowPinchZoom:!!S,lockRef:n}),a?w.cloneElement(w.Children.only(s),$l($l({},I),{ref:A})):w.createElement(k,$l({},I,{className:l,ref:A}),s))});yx.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};yx.classNames={fullWidth:k4,zeroRight:_4};var o3e=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function a3e(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=o3e();return t&&e.setAttribute("nonce",t),e}function s3e(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function l3e(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var u3e=function(){var e=0,t=null;return{add:function(n){e==0&&(t=a3e())&&(s3e(t,n),l3e(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},c3e=function(){var e=u3e();return function(t,n){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},wV=function(){var e=c3e(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},d3e={left:0,top:0,right:0,gap:0},rC=function(e){return parseInt(e||"",10)||0},f3e=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[rC(n),rC(r),rC(i)]},h3e=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return d3e;var t=f3e(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])}},p3e=wV(),g3e=function(e,t,n,r){var i=e.left,o=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),` + .`.concat(r3e,` { + overflow: hidden `).concat(r,`; + padding-right: `).concat(s,"px ").concat(r,`; + } + body { + overflow: hidden `).concat(r,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` + padding-left: `.concat(i,`px; + padding-top: `).concat(o,`px; + padding-right: `).concat(a,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(s,"px ").concat(r,`; + `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),` + } + + .`).concat(_4,` { + right: `).concat(s,"px ").concat(r,`; + } + + .`).concat(k4,` { + margin-right: `).concat(s,"px ").concat(r,`; + } + + .`).concat(_4," .").concat(_4,` { + right: 0 `).concat(r,`; + } + + .`).concat(k4," .").concat(k4,` { + margin-right: 0 `).concat(r,`; + } + + body { + `).concat(i3e,": ").concat(s,`px; + } +`)},m3e=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r,o=w.useMemo(function(){return h3e(i)},[i]);return w.createElement(p3e,{styles:g3e(o,!t,i,n?"":"!important")})},W9=!1;if(typeof window<"u")try{var Sb=Object.defineProperty({},"passive",{get:function(){return W9=!0,!0}});window.addEventListener("test",Sb,Sb),window.removeEventListener("test",Sb,Sb)}catch{W9=!1}var Pg=W9?{passive:!1}:!1,v3e=function(e){return e.tagName==="TEXTAREA"},CV=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!v3e(e)&&n[t]==="visible")},y3e=function(e){return CV(e,"overflowY")},b3e=function(e){return CV(e,"overflowX")},eI=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=_V(e,n);if(r){var i=kV(e,n),o=i[1],a=i[2];if(o>a)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},S3e=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},x3e=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},_V=function(e,t){return e==="v"?y3e(t):b3e(t)},kV=function(e,t){return e==="v"?S3e(t):x3e(t)},w3e=function(e,t){return e==="h"&&t==="rtl"?-1:1},C3e=function(e,t,n,r,i){var o=w3e(e,window.getComputedStyle(t).direction),a=o*r,s=n.target,l=t.contains(s),u=!1,d=a>0,h=0,m=0;do{var y=kV(e,s),b=y[0],S=y[1],E=y[2],k=S-E-o*b;(b||k)&&_V(e,s)&&(h+=k,m+=b),s=s.parentNode}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(d&&(i&&h===0||!i&&a>h)||!d&&(i&&m===0||!i&&-a>m))&&(u=!0),u},xb=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},tI=function(e){return[e.deltaX,e.deltaY]},nI=function(e){return e&&"current"in e?e.current:e},_3e=function(e,t){return e[0]===t[0]&&e[1]===t[1]},k3e=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},E3e=0,Tg=[];function P3e(e){var t=w.useRef([]),n=w.useRef([0,0]),r=w.useRef(),i=w.useState(E3e++)[0],o=w.useState(function(){return wV()})[0],a=w.useRef(e);w.useEffect(function(){a.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var S=N7([e.lockRef.current],(e.shards||[]).map(nI),!0).filter(Boolean);return S.forEach(function(E){return E.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),S.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=w.useCallback(function(S,E){if("touches"in S&&S.touches.length===2)return!a.current.allowPinchZoom;var k=xb(S),_=n.current,T="deltaX"in S?S.deltaX:_[0]-k[0],A="deltaY"in S?S.deltaY:_[1]-k[1],I,R=S.target,D=Math.abs(T)>Math.abs(A)?"h":"v";if("touches"in S&&D==="h"&&R.type==="range")return!1;var j=eI(D,R);if(!j)return!0;if(j?I=D:(I=D==="v"?"h":"v",j=eI(D,R)),!j)return!1;if(!r.current&&"changedTouches"in S&&(T||A)&&(r.current=I),!I)return!0;var z=r.current||I;return C3e(z,E,S,z==="h"?T:A,!0)},[]),l=w.useCallback(function(S){var E=S;if(!(!Tg.length||Tg[Tg.length-1]!==o)){var k="deltaY"in E?tI(E):xb(E),_=t.current.filter(function(I){return I.name===E.type&&I.target===E.target&&_3e(I.delta,k)})[0];if(_&&_.should){E.cancelable&&E.preventDefault();return}if(!_){var T=(a.current.shards||[]).map(nI).filter(Boolean).filter(function(I){return I.contains(E.target)}),A=T.length>0?s(E,T[0]):!a.current.noIsolation;A&&E.cancelable&&E.preventDefault()}}},[]),u=w.useCallback(function(S,E,k,_){var T={name:S,delta:E,target:k,should:_};t.current.push(T),setTimeout(function(){t.current=t.current.filter(function(A){return A!==T})},1)},[]),d=w.useCallback(function(S){n.current=xb(S),r.current=void 0},[]),h=w.useCallback(function(S){u(S.type,tI(S),S.target,s(S,e.lockRef.current))},[]),m=w.useCallback(function(S){u(S.type,xb(S),S.target,s(S,e.lockRef.current))},[]);w.useEffect(function(){return Tg.push(o),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:m}),document.addEventListener("wheel",l,Pg),document.addEventListener("touchmove",l,Pg),document.addEventListener("touchstart",d,Pg),function(){Tg=Tg.filter(function(S){return S!==o}),document.removeEventListener("wheel",l,Pg),document.removeEventListener("touchmove",l,Pg),document.removeEventListener("touchstart",d,Pg)}},[]);var y=e.removeScrollBar,b=e.inert;return w.createElement(w.Fragment,null,b?w.createElement(o,{styles:k3e(i)}):null,y?w.createElement(m3e,{gapMode:"margin"}):null)}const T3e=sye(xV,P3e);var EV=w.forwardRef(function(e,t){return w.createElement(yx,$l({},e,{ref:t,sideCar:T3e}))});EV.classNames=yx.classNames;const PV=EV;var sp=(...e)=>e.filter(Boolean).join(" ");function wv(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var L3e=class{constructor(){sn(this,"modals");this.modals=[]}add(e){this.modals.push(e)}remove(e){this.modals=this.modals.filter(t=>t!==e)}isTopModal(e){return this.modals[this.modals.length-1]===e}},U9=new L3e;function A3e(e,t){w.useEffect(()=>(t&&U9.add(e),()=>{U9.remove(e)}),[t,e])}function O3e(e){const{isOpen:t,onClose:n,id:r,closeOnOverlayClick:i=!0,closeOnEsc:o=!0,useInert:a=!0,onOverlayClick:s,onEsc:l}=e,u=w.useRef(null),d=w.useRef(null),[h,m,y]=I3e(r,"chakra-modal","chakra-modal--header","chakra-modal--body");M3e(u,t&&a),A3e(u,t);const b=w.useRef(null),S=w.useCallback(j=>{b.current=j.target},[]),E=w.useCallback(j=>{j.key==="Escape"&&(j.stopPropagation(),o&&(n==null||n()),l==null||l())},[o,n,l]),[k,_]=w.useState(!1),[T,A]=w.useState(!1),I=w.useCallback((j={},z=null)=>({role:"dialog",...j,ref:Yn(z,u),id:h,tabIndex:-1,"aria-modal":!0,"aria-labelledby":k?m:void 0,"aria-describedby":T?y:void 0,onClick:wv(j.onClick,V=>V.stopPropagation())}),[y,T,h,m,k]),R=w.useCallback(j=>{j.stopPropagation(),b.current===j.target&&U9.isTopModal(u)&&(i&&(n==null||n()),s==null||s())},[n,i,s]),D=w.useCallback((j={},z=null)=>({...j,ref:Yn(z,d),onClick:wv(j.onClick,R),onKeyDown:wv(j.onKeyDown,E),onMouseDown:wv(j.onMouseDown,S)}),[E,S,R]);return{isOpen:t,onClose:n,headerId:m,bodyId:y,setBodyMounted:A,setHeaderMounted:_,dialogRef:u,overlayRef:d,getDialogProps:I,getDialogContainerProps:D}}function M3e(e,t){const n=e.current;w.useEffect(()=>{if(!(!e.current||!t))return zH(e.current)},[t,e,n])}function I3e(e,...t){const n=w.useId(),r=e||n;return w.useMemo(()=>t.map(i=>`${i}-${r}`),[r,t])}var[R3e,lp]=Mn({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[D3e,qd]=Mn({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in ``"}),Yd=e=>{const{portalProps:t,children:n,autoFocus:r,trapFocus:i,initialFocusRef:o,finalFocusRef:a,returnFocusOnClose:s,blockScrollOnMount:l,allowPinchZoom:u,preserveScrollBarGap:d,motionPreset:h,lockFocusAcrossFrames:m,onCloseComplete:y}=e,b=Yi("Modal",e),E={...O3e(e),autoFocus:r,trapFocus:i,initialFocusRef:o,finalFocusRef:a,returnFocusOnClose:s,blockScrollOnMount:l,allowPinchZoom:u,preserveScrollBarGap:d,motionPreset:h,lockFocusAcrossFrames:m};return N.createElement(D3e,{value:E},N.createElement(R3e,{value:b},N.createElement(nf,{onExitComplete:y},E.isOpen&&N.createElement(ap,{...t},n))))};Yd.defaultProps={lockFocusAcrossFrames:!0,returnFocusOnClose:!0,scrollBehavior:"outside",trapFocus:!0,autoFocus:!0,blockScrollOnMount:!0,allowPinchZoom:!1,motionPreset:"scale"};Yd.displayName="Modal";var n0=Oe((e,t)=>{const{className:n,...r}=e,{bodyId:i,setBodyMounted:o}=qd();w.useEffect(()=>(o(!0),()=>o(!1)),[o]);const a=sp("chakra-modal__body",n),s=lp();return N.createElement(Ce.div,{ref:t,className:a,id:i,...r,__css:s.body})});n0.displayName="ModalBody";var Ly=Oe((e,t)=>{const{onClick:n,className:r,...i}=e,{onClose:o}=qd(),a=sp("chakra-modal__close-btn",r),s=lp();return N.createElement(ex,{ref:t,__css:s.closeButton,className:a,onClick:wv(n,l=>{l.stopPropagation(),o()}),...i})});Ly.displayName="ModalCloseButton";function TV(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:i,blockScrollOnMount:o,allowPinchZoom:a,finalFocusRef:s,returnFocusOnClose:l,preserveScrollBarGap:u,lockFocusAcrossFrames:d}=qd(),[h,m]=K_();return w.useEffect(()=>{!h&&m&&setTimeout(m)},[h,m]),N.createElement(SV,{autoFocus:t,isDisabled:!n,initialFocusRef:i,finalFocusRef:s,restoreFocus:l,contentRef:r,lockFocusAcrossFrames:d},N.createElement(PV,{removeScrollBar:!u,allowPinchZoom:a,enabled:o,forwardProps:!0},e.children))}var N3e={slideInBottom:{...B7,custom:{offsetY:16,reverse:!0}},slideInRight:{...B7,custom:{offsetX:16,reverse:!0}},scale:{...HF,custom:{initialScale:.95,reverse:!0}},none:{}},j3e=Ce(du.section),B3e=e=>N3e[e||"none"],LV=w.forwardRef((e,t)=>{const{preset:n,motionProps:r=B3e(n),...i}=e;return N.createElement(j3e,{ref:t,...r,...i})});LV.displayName="ModalTransition";var Zh=Oe((e,t)=>{const{className:n,children:r,containerProps:i,motionProps:o,...a}=e,{getDialogProps:s,getDialogContainerProps:l}=qd(),u=s(a,t),d=l(i),h=sp("chakra-modal__content",n),m=lp(),y={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...m.dialog},b={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...m.dialogContainer},{motionPreset:S}=qd();return N.createElement(TV,null,N.createElement(Ce.div,{...d,className:"chakra-modal__content-container",tabIndex:-1,__css:b},N.createElement(LV,{preset:S,motionProps:o,className:h,...u,__css:y},r)))});Zh.displayName="ModalContent";var bx=Oe((e,t)=>{const{className:n,...r}=e,i=sp("chakra-modal__footer",n),a={display:"flex",alignItems:"center",justifyContent:"flex-end",...lp().footer};return N.createElement(Ce.footer,{ref:t,...r,__css:a,className:i})});bx.displayName="ModalFooter";var w0=Oe((e,t)=>{const{className:n,...r}=e,{headerId:i,setHeaderMounted:o}=qd();w.useEffect(()=>(o(!0),()=>o(!1)),[o]);const a=sp("chakra-modal__header",n),l={flex:0,...lp().header};return N.createElement(Ce.header,{ref:t,className:a,id:i,...r,__css:l})});w0.displayName="ModalHeader";var F3e=Ce(du.div),Kd=Oe((e,t)=>{const{className:n,transition:r,motionProps:i,...o}=e,a=sp("chakra-modal__overlay",n),l={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...lp().overlay},{motionPreset:u}=qd(),h=i||(u==="none"?{}:zF);return N.createElement(F3e,{...h,__css:l,ref:t,className:a,...o})});Kd.displayName="ModalOverlay";function AV(e){const{leastDestructiveRef:t,...n}=e;return N.createElement(Yd,{...n,initialFocusRef:t})}var OV=Oe((e,t)=>N.createElement(Zh,{ref:t,role:"alertdialog",...e})),[Z$e,$3e]=Mn(),z3e=Ce(VF),H3e=Oe((e,t)=>{const{className:n,children:r,motionProps:i,containerProps:o,...a}=e,{getDialogProps:s,getDialogContainerProps:l,isOpen:u}=qd(),d=s(a,t),h=l(o),m=sp("chakra-modal__content",n),y=lp(),b={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...y.dialog},S={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...y.dialogContainer},{placement:E}=$3e();return N.createElement(TV,null,N.createElement(Ce.div,{...h,className:"chakra-modal__content-container",__css:S},N.createElement(z3e,{motionProps:i,direction:E,in:u,className:m,...d,__css:b},r)))});H3e.displayName="DrawerContent";function V3e(e,t){const n=Er(e);w.useEffect(()=>{let r=null;const i=()=>n();return t!==null&&(r=window.setInterval(i,t)),()=>{r&&window.clearInterval(r)}},[t,n])}var MV=(...e)=>e.filter(Boolean).join(" "),iC=e=>e?!0:void 0;function Al(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var W3e=e=>N.createElement(Da,{viewBox:"0 0 24 24",...e},N.createElement("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"})),U3e=e=>N.createElement(Da,{viewBox:"0 0 24 24",...e},N.createElement("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 rI(e,t,n,r){w.useEffect(()=>{if(!e.current||!r)return;const i=e.current.ownerDocument.defaultView??window,o=Array.isArray(t)?t:[t],a=new i.MutationObserver(s=>{for(const l of s)l.type==="attributes"&&l.attributeName&&o.includes(l.attributeName)&&n(l)});return a.observe(e.current,{attributes:!0,attributeFilter:o}),()=>a.disconnect()})}var G3e=50,iI=300;function q3e(e,t){const[n,r]=w.useState(!1),[i,o]=w.useState(null),[a,s]=w.useState(!0),l=w.useRef(null),u=()=>clearTimeout(l.current);V3e(()=>{i==="increment"&&e(),i==="decrement"&&t()},n?G3e:null);const d=w.useCallback(()=>{a&&e(),l.current=setTimeout(()=>{s(!1),r(!0),o("increment")},iI)},[e,a]),h=w.useCallback(()=>{a&&t(),l.current=setTimeout(()=>{s(!1),r(!0),o("decrement")},iI)},[t,a]),m=w.useCallback(()=>{s(!0),r(!1),u()},[]);return w.useEffect(()=>()=>u(),[]),{up:d,down:h,stop:m,isSpinning:n}}var Y3e=/^[Ee0-9+\-.]$/;function K3e(e){return Y3e.test(e)}function X3e(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 Z3e(e={}){const{focusInputOnChange:t=!0,clampValueOnBlur:n=!0,keepWithinRange:r=!0,min:i=Number.MIN_SAFE_INTEGER,max:o=Number.MAX_SAFE_INTEGER,step:a=1,isReadOnly:s,isDisabled:l,isRequired:u,isInvalid:d,pattern:h="[0-9]*(.[0-9]+)?",inputMode:m="decimal",allowMouseWheel:y,id:b,onChange:S,precision:E,name:k,"aria-describedby":_,"aria-label":T,"aria-labelledby":A,onFocus:I,onBlur:R,onInvalid:D,getAriaValueText:j,isValidCharacter:z,format:V,parse:K,...te}=e,q=Er(I),F=Er(R),U=Er(D),X=Er(z??K3e),Z=Er(j),W=ume(e),{update:Q,increment:ie,decrement:fe}=W,[Se,Te]=w.useState(!1),ye=!(s||l),He=w.useRef(null),Ne=w.useRef(null),tt=w.useRef(null),_e=w.useRef(null),lt=w.useCallback(Le=>Le.split("").filter(X).join(""),[X]),wt=w.useCallback(Le=>(K==null?void 0:K(Le))??Le,[K]),ct=w.useCallback(Le=>((V==null?void 0:V(Le))??Le).toString(),[V]);Vd(()=>{(W.valueAsNumber>o||W.valueAsNumber{if(!He.current)return;if(He.current.value!=W.value){const At=wt(He.current.value);W.setValue(lt(At))}},[wt,lt]);const mt=w.useCallback((Le=a)=>{ye&&ie(Le)},[ie,ye,a]),St=w.useCallback((Le=a)=>{ye&&fe(Le)},[fe,ye,a]),Ae=q3e(mt,St);rI(tt,"disabled",Ae.stop,Ae.isSpinning),rI(_e,"disabled",Ae.stop,Ae.isSpinning);const ut=w.useCallback(Le=>{if(Le.nativeEvent.isComposing)return;const Fe=wt(Le.currentTarget.value);Q(lt(Fe)),Ne.current={start:Le.currentTarget.selectionStart,end:Le.currentTarget.selectionEnd}},[Q,lt,wt]),Mt=w.useCallback(Le=>{var At;q==null||q(Le),Ne.current&&(Le.target.selectionStart=Ne.current.start??((At=Le.currentTarget.value)==null?void 0:At.length),Le.currentTarget.selectionEnd=Ne.current.end??Le.currentTarget.selectionStart)},[q]),at=w.useCallback(Le=>{if(Le.nativeEvent.isComposing)return;X3e(Le,X)||Le.preventDefault();const At=Ct(Le)*a,Fe=Le.key,nn={ArrowUp:()=>mt(At),ArrowDown:()=>St(At),Home:()=>Q(i),End:()=>Q(o)}[Fe];nn&&(Le.preventDefault(),nn(Le))},[X,a,mt,St,Q,i,o]),Ct=Le=>{let At=1;return(Le.metaKey||Le.ctrlKey)&&(At=.1),Le.shiftKey&&(At=10),At},Zt=w.useMemo(()=>{const Le=Z==null?void 0:Z(W.value);if(Le!=null)return Le;const At=W.value.toString();return At||void 0},[W.value,Z]),le=w.useCallback(()=>{let Le=W.value;if(W.value==="")return;/^[eE]/.test(W.value.toString())?W.setValue(""):(W.valueAsNumbero&&(Le=o),W.cast(Le))},[W,o,i]),De=w.useCallback(()=>{Te(!1),n&&le()},[n,Te,le]),Ue=w.useCallback(()=>{t&&requestAnimationFrame(()=>{var Le;(Le=He.current)==null||Le.focus()})},[t]),Ye=w.useCallback(Le=>{Le.preventDefault(),Ae.up(),Ue()},[Ue,Ae]),we=w.useCallback(Le=>{Le.preventDefault(),Ae.down(),Ue()},[Ue,Ae]);Rh(()=>He.current,"wheel",Le=>{var At;const vt=(((At=He.current)==null?void 0:At.ownerDocument)??document).activeElement===He.current;if(!y||!vt)return;Le.preventDefault();const nn=Ct(Le)*a,Rn=Math.sign(Le.deltaY);Rn===-1?mt(nn):Rn===1&&St(nn)},{passive:!1});const je=w.useCallback((Le={},At=null)=>{const Fe=l||r&&W.isAtMax;return{...Le,ref:Yn(At,tt),role:"button",tabIndex:-1,onPointerDown:Al(Le.onPointerDown,vt=>{vt.button!==0||Fe||Ye(vt)}),onPointerLeave:Al(Le.onPointerLeave,Ae.stop),onPointerUp:Al(Le.onPointerUp,Ae.stop),disabled:Fe,"aria-disabled":iC(Fe)}},[W.isAtMax,r,Ye,Ae.stop,l]),_t=w.useCallback((Le={},At=null)=>{const Fe=l||r&&W.isAtMin;return{...Le,ref:Yn(At,_e),role:"button",tabIndex:-1,onPointerDown:Al(Le.onPointerDown,vt=>{vt.button!==0||Fe||we(vt)}),onPointerLeave:Al(Le.onPointerLeave,Ae.stop),onPointerUp:Al(Le.onPointerUp,Ae.stop),disabled:Fe,"aria-disabled":iC(Fe)}},[W.isAtMin,r,we,Ae.stop,l]),Dt=w.useCallback((Le={},At=null)=>({name:k,inputMode:m,type:"text",pattern:h,"aria-labelledby":A,"aria-label":T,"aria-describedby":_,id:b,disabled:l,...Le,readOnly:Le.readOnly??s,"aria-readonly":Le.readOnly??s,"aria-required":Le.required??u,required:Le.required??u,ref:Yn(He,At),value:ct(W.value),role:"spinbutton","aria-valuemin":i,"aria-valuemax":o,"aria-valuenow":Number.isNaN(W.valueAsNumber)?void 0:W.valueAsNumber,"aria-invalid":iC(d??W.isOutOfRange),"aria-valuetext":Zt,autoComplete:"off",autoCorrect:"off",onChange:Al(Le.onChange,ut),onKeyDown:Al(Le.onKeyDown,at),onFocus:Al(Le.onFocus,Mt,()=>Te(!0)),onBlur:Al(Le.onBlur,F,De)}),[k,m,h,A,T,ct,_,b,l,u,s,d,W.value,W.valueAsNumber,W.isOutOfRange,i,o,Zt,ut,at,Mt,F,De]);return{value:ct(W.value),valueAsNumber:W.valueAsNumber,isFocused:Se,isDisabled:l,isReadOnly:s,getIncrementButtonProps:je,getDecrementButtonProps:_t,getInputProps:Dt,htmlProps:te}}var[Q3e,Sx]=Mn({name:"NumberInputStylesContext",errorMessage:`useNumberInputStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[J3e,PE]=Mn({name:"NumberInputContext",errorMessage:"useNumberInputContext: `context` is undefined. Seems you forgot to wrap number-input's components within "}),TE=Oe(function(t,n){const r=Yi("NumberInput",t),i=En(t),o=lk(i),{htmlProps:a,...s}=Z3e(o),l=w.useMemo(()=>s,[s]);return N.createElement(J3e,{value:l},N.createElement(Q3e,{value:r},N.createElement(Ce.div,{...a,ref:n,className:MV("chakra-numberinput",t.className),__css:{position:"relative",zIndex:0,...r.root}})))});TE.displayName="NumberInput";var IV=Oe(function(t,n){const r=Sx();return N.createElement(Ce.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}})});IV.displayName="NumberInputStepper";var LE=Oe(function(t,n){const{getInputProps:r}=PE(),i=r(t,n),o=Sx();return N.createElement(Ce.input,{...i,className:MV("chakra-numberinput__field",t.className),__css:{width:"100%",...o.field}})});LE.displayName="NumberInputField";var RV=Ce("div",{baseStyle:{display:"flex",justifyContent:"center",alignItems:"center",flex:1,transitionProperty:"common",transitionDuration:"normal",userSelect:"none",cursor:"pointer",lineHeight:"normal"}}),AE=Oe(function(t,n){const r=Sx(),{getDecrementButtonProps:i}=PE(),o=i(t,n);return N.createElement(RV,{...o,__css:r.stepper},t.children??N.createElement(W3e,null))});AE.displayName="NumberDecrementStepper";var OE=Oe(function(t,n){const{getIncrementButtonProps:r}=PE(),i=r(t,n),o=Sx();return N.createElement(RV,{...i,__css:o.stepper},t.children??N.createElement(U3e,null))});OE.displayName="NumberIncrementStepper";var Ay=(...e)=>e.filter(Boolean).join(" ");function ebe(e,...t){return tbe(e)?e(...t):e}var tbe=e=>typeof e=="function";function Ol(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function nbe(...e){return function(n){e.forEach(r=>{r==null||r(n)})}}var[rbe,up]=Mn({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within ``"}),[ibe,Oy]=Mn({name:"PopoverStylesContext",errorMessage:`usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Lg={click:"click",hover:"hover"};function obe(e={}){const{closeOnBlur:t=!0,closeOnEsc:n=!0,initialFocusRef:r,id:i,returnFocusOnClose:o=!0,autoFocus:a=!0,arrowSize:s,arrowShadowColor:l,trigger:u=Lg.click,openDelay:d=200,closeDelay:h=200,isLazy:m,lazyBehavior:y="unmount",computePositionOnMount:b,...S}=e,{isOpen:E,onClose:k,onOpen:_,onToggle:T}=N$(e),A=w.useRef(null),I=w.useRef(null),R=w.useRef(null),D=w.useRef(!1),j=w.useRef(!1);E&&(j.current=!0);const[z,V]=w.useState(!1),[K,te]=w.useState(!1),q=w.useId(),F=i??q,[U,X,Z,W]=["popover-trigger","popover-content","popover-header","popover-body"].map(ut=>`${ut}-${F}`),{referenceRef:Q,getArrowProps:ie,getPopperProps:fe,getArrowInnerProps:Se,forceUpdate:Te}=D$({...S,enabled:E||!!b}),ye=N1e({isOpen:E,ref:R});yme({enabled:E,ref:I}),f0e(R,{focusRef:I,visible:E,shouldFocus:o&&u===Lg.click}),p0e(R,{focusRef:r,visible:E,shouldFocus:a&&u===Lg.click});const He=j$({wasSelected:j.current,enabled:m,mode:y,isSelected:ye.present}),Ne=w.useCallback((ut={},Mt=null)=>{const at={...ut,style:{...ut.style,transformOrigin:oi.transformOrigin.varRef,[oi.arrowSize.var]:s?`${s}px`:void 0,[oi.arrowShadowColor.var]:l},ref:Yn(R,Mt),children:He?ut.children:null,id:X,tabIndex:-1,role:"dialog",onKeyDown:Ol(ut.onKeyDown,Ct=>{n&&Ct.key==="Escape"&&k()}),onBlur:Ol(ut.onBlur,Ct=>{const Zt=oI(Ct),le=oC(R.current,Zt),De=oC(I.current,Zt);E&&t&&(!le&&!De)&&k()}),"aria-labelledby":z?Z:void 0,"aria-describedby":K?W:void 0};return u===Lg.hover&&(at.role="tooltip",at.onMouseEnter=Ol(ut.onMouseEnter,()=>{D.current=!0}),at.onMouseLeave=Ol(ut.onMouseLeave,Ct=>{Ct.nativeEvent.relatedTarget!==null&&(D.current=!1,setTimeout(()=>k(),h))})),at},[He,X,z,Z,K,W,u,n,k,E,t,h,l,s]),tt=w.useCallback((ut={},Mt=null)=>fe({...ut,style:{visibility:E?"visible":"hidden",...ut.style}},Mt),[E,fe]),_e=w.useCallback((ut,Mt=null)=>({...ut,ref:Yn(Mt,A,Q)}),[A,Q]),lt=w.useRef(),wt=w.useRef(),ct=w.useCallback(ut=>{A.current==null&&Q(ut)},[Q]),mt=w.useCallback((ut={},Mt=null)=>{const at={...ut,ref:Yn(I,Mt,ct),id:U,"aria-haspopup":"dialog","aria-expanded":E,"aria-controls":X};return u===Lg.click&&(at.onClick=Ol(ut.onClick,T)),u===Lg.hover&&(at.onFocus=Ol(ut.onFocus,()=>{lt.current===void 0&&_()}),at.onBlur=Ol(ut.onBlur,Ct=>{const Zt=oI(Ct),le=!oC(R.current,Zt);E&&t&&le&&k()}),at.onKeyDown=Ol(ut.onKeyDown,Ct=>{Ct.key==="Escape"&&k()}),at.onMouseEnter=Ol(ut.onMouseEnter,()=>{D.current=!0,lt.current=window.setTimeout(()=>_(),d)}),at.onMouseLeave=Ol(ut.onMouseLeave,()=>{D.current=!1,lt.current&&(clearTimeout(lt.current),lt.current=void 0),wt.current=window.setTimeout(()=>{D.current===!1&&k()},h)})),at},[U,E,X,u,ct,T,_,t,k,d,h]);w.useEffect(()=>()=>{lt.current&&clearTimeout(lt.current),wt.current&&clearTimeout(wt.current)},[]);const St=w.useCallback((ut={},Mt=null)=>({...ut,id:Z,ref:Yn(Mt,at=>{V(!!at)})}),[Z]),Ae=w.useCallback((ut={},Mt=null)=>({...ut,id:W,ref:Yn(Mt,at=>{te(!!at)})}),[W]);return{forceUpdate:Te,isOpen:E,onAnimationComplete:ye.onComplete,onClose:k,getAnchorProps:_e,getArrowProps:ie,getArrowInnerProps:Se,getPopoverPositionerProps:tt,getPopoverProps:Ne,getTriggerProps:mt,getHeaderProps:St,getBodyProps:Ae}}function oC(e,t){return e===t||(e==null?void 0:e.contains(t))}function oI(e){const t=e.currentTarget.ownerDocument.activeElement;return e.relatedTarget??t}function ME(e){const t=Yi("Popover",e),{children:n,...r}=En(e),i=h0(),o=obe({...r,direction:i.direction});return N.createElement(rbe,{value:o},N.createElement(ibe,{value:t},ebe(n,{isOpen:o.isOpen,onClose:o.onClose,forceUpdate:o.forceUpdate})))}ME.displayName="Popover";function IE(e){const{bg:t,bgColor:n,backgroundColor:r}=e,{getArrowProps:i,getArrowInnerProps:o}=up(),a=Oy(),s=t??n??r;return N.createElement(Ce.div,{...i(),className:"chakra-popover__arrow-positioner"},N.createElement(Ce.div,{className:Ay("chakra-popover__arrow",e.className),...o(e),__css:{...a.arrow,"--popper-arrow-bg":s?`colors.${s}, ${s}`:void 0}}))}IE.displayName="PopoverArrow";var abe=Oe(function(t,n){const{getBodyProps:r}=up(),i=Oy();return N.createElement(Ce.div,{...r(t,n),className:Ay("chakra-popover__body",t.className),__css:i.body})});abe.displayName="PopoverBody";var sbe=Oe(function(t,n){const{onClose:r}=up(),i=Oy();return N.createElement(ex,{size:"sm",onClick:r,className:Ay("chakra-popover__close-btn",t.className),__css:i.closeButton,ref:n,...t})});sbe.displayName="PopoverCloseButton";function lbe(e){if(e)return{enter:{...e.enter,visibility:"visible"},exit:{...e.exit,transitionEnd:{visibility:"hidden"}}}}var ube={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]}}},cbe=Ce(du.section),DV=Oe(function(t,n){const{variants:r=ube,...i}=t,{isOpen:o}=up();return N.createElement(cbe,{ref:n,variants:lbe(r),initial:!1,animate:o?"enter":"exit",...i})});DV.displayName="PopoverTransition";var RE=Oe(function(t,n){const{rootProps:r,motionProps:i,...o}=t,{getPopoverProps:a,getPopoverPositionerProps:s,onAnimationComplete:l}=up(),u=Oy(),d={position:"relative",display:"flex",flexDirection:"column",...u.content};return N.createElement(Ce.div,{...s(r),__css:u.popper,className:"chakra-popover__popper"},N.createElement(DV,{...i,...a(o,n),onAnimationComplete:nbe(l,o.onAnimationComplete),className:Ay("chakra-popover__content",t.className),__css:d}))});RE.displayName="PopoverContent";var dbe=Oe(function(t,n){const{getHeaderProps:r}=up(),i=Oy();return N.createElement(Ce.header,{...r(t,n),className:Ay("chakra-popover__header",t.className),__css:i.header})});dbe.displayName="PopoverHeader";function DE(e){const t=w.Children.only(e.children),{getTriggerProps:n}=up();return w.cloneElement(t,n(t.props,t.ref))}DE.displayName="PopoverTrigger";function fbe(e,t,n){return(e-t)*100/(n-t)}var hbe=tf({"0%":{strokeDasharray:"1, 400",strokeDashoffset:"0"},"50%":{strokeDasharray:"400, 400",strokeDashoffset:"-100"},"100%":{strokeDasharray:"400, 400",strokeDashoffset:"-260"}}),pbe=tf({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),gbe=tf({"0%":{left:"-40%"},"100%":{left:"100%"}}),mbe=tf({from:{backgroundPosition:"1rem 0"},to:{backgroundPosition:"0 0"}});function NV(e){const{value:t=0,min:n,max:r,valueText:i,getValueText:o,isIndeterminate:a,role:s="progressbar"}=e,l=fbe(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 o=="function"?o(t,l):i})(),role:s},percent:l,value:t}}var jV=e=>{const{size:t,isIndeterminate:n,...r}=e;return N.createElement(Ce.svg,{viewBox:"0 0 100 100",__css:{width:t,height:t,animation:n?`${pbe} 2s linear infinite`:void 0},...r})};jV.displayName="Shape";var G9=e=>N.createElement(Ce.circle,{cx:50,cy:50,r:42,fill:"transparent",...e});G9.displayName="Circle";var vbe=Oe((e,t)=>{const{size:n="48px",max:r=100,min:i=0,valueText:o,getValueText:a,value:s,capIsRound:l,children:u,thickness:d="10px",color:h="#0078d4",trackColor:m="#edebe9",isIndeterminate:y,...b}=e,S=NV({min:i,max:r,value:s,valueText:o,getValueText:a,isIndeterminate:y}),E=y?void 0:(S.percent??0)*2.64,k=E==null?void 0:`${E} ${264-E}`,_=y?{css:{animation:`${hbe} 1.5s linear infinite`}}:{strokeDashoffset:66,strokeDasharray:k,transitionProperty:"stroke-dasharray, stroke",transitionDuration:"0.6s",transitionTimingFunction:"ease"},T={display:"inline-block",position:"relative",verticalAlign:"middle",fontSize:n};return N.createElement(Ce.div,{ref:t,className:"chakra-progress",...S.bind,...b,__css:T},N.createElement(jV,{size:n,isIndeterminate:y},N.createElement(G9,{stroke:m,strokeWidth:d,className:"chakra-progress__track"}),N.createElement(G9,{stroke:h,strokeWidth:d,className:"chakra-progress__indicator",strokeLinecap:l?"round":void 0,opacity:S.value===0&&!y?0:void 0,..._})),u)});vbe.displayName="CircularProgress";var[ybe,bbe]=Mn({name:"ProgressStylesContext",errorMessage:`useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Sbe=Oe((e,t)=>{const{min:n,max:r,value:i,isIndeterminate:o,role:a,...s}=e,l=NV({value:i,min:n,max:r,isIndeterminate:o,role:a}),d={height:"100%",...bbe().filledTrack};return N.createElement(Ce.div,{ref:t,style:{width:`${l.percent}%`,...s.style},...l.bind,...s,__css:d})}),BV=Oe((e,t)=>{var n;const{value:r,min:i=0,max:o=100,hasStripe:a,isAnimated:s,children:l,borderRadius:u,isIndeterminate:d,"aria-label":h,"aria-labelledby":m,title:y,role:b,...S}=En(e),E=Yi("Progress",e),k=u??((n=E.track)==null?void 0:n.borderRadius),_={animation:`${mbe} 1s linear infinite`},I={...!d&&a&&s&&_,...d&&{position:"absolute",willChange:"left",minWidth:"50%",animation:`${gbe} 1s ease infinite normal none running`}},R={overflow:"hidden",position:"relative",...E.track};return N.createElement(Ce.div,{ref:t,borderRadius:k,__css:R,...S},N.createElement(ybe,{value:E},N.createElement(Sbe,{"aria-label":h,"aria-labelledby":m,min:i,max:o,value:r,isIndeterminate:d,css:I,borderRadius:k,title:y,role:b}),l))});BV.displayName="Progress";var xbe=Ce("div",{baseStyle:{fontSize:"0.24em",top:"50%",left:"50%",width:"100%",textAlign:"center",position:"absolute",transform:"translate(-50%, -50%)"}});xbe.displayName="CircularProgressLabel";var wbe=(...e)=>e.filter(Boolean).join(" "),Cbe=e=>e?"":void 0;function _be(e,t){const n={},r={};for(const[i,o]of Object.entries(e))t.includes(i)?n[i]=o:r[i]=o;return[n,r]}var FV=Oe(function(t,n){const{children:r,placeholder:i,className:o,...a}=t;return N.createElement(Ce.select,{...a,ref:n,className:wbe("chakra-select",o)},i&&N.createElement("option",{value:""},i),r)});FV.displayName="SelectField";var $V=Oe((e,t)=>{var n;const r=Yi("Select",e),{rootProps:i,placeholder:o,icon:a,color:s,height:l,h:u,minH:d,minHeight:h,iconColor:m,iconSize:y,...b}=En(e),[S,E]=_be(b,zte),k=sk(E),_={width:"100%",height:"fit-content",position:"relative",color:s},T={paddingEnd:"2rem",...r.field,_focus:{zIndex:"unset",...(n=r.field)==null?void 0:n._focus}};return N.createElement(Ce.div,{className:"chakra-select__wrapper",__css:_,...S,...i},N.createElement(FV,{ref:t,height:u??l,minH:d??h,placeholder:o,...k,__css:T},e.children),N.createElement(zV,{"data-disabled":Cbe(k.disabled),...(m||s)&&{color:m||s},__css:r.icon,...y&&{fontSize:y}},a))});$V.displayName="Select";var kbe=e=>N.createElement("svg",{viewBox:"0 0 24 24",...e},N.createElement("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})),Ebe=Ce("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),zV=e=>{const{children:t=N.createElement(kbe,null),...n}=e,r=w.cloneElement(t,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return N.createElement(Ebe,{...n,className:"chakra-select__icon-wrapper"},w.isValidElement(t)?r:null)};zV.displayName="SelectIcon";function Pbe(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Tbe(e){const t=Abe(e);return typeof t.PointerEvent<"u"&&e instanceof t.PointerEvent?e.pointerType==="mouse":e instanceof t.MouseEvent}function HV(e){return!!e.touches}function Lbe(e){return HV(e)&&e.touches.length>1}function Abe(e){return e.view??window}function Obe(e,t="page"){const n=e.touches[0]||e.changedTouches[0];return{x:n[`${t}X`],y:n[`${t}Y`]}}function Mbe(e,t="page"){return{x:e[`${t}X`],y:e[`${t}Y`]}}function VV(e,t="page"){return HV(e)?Obe(e,t):Mbe(e,t)}function Ibe(e){return t=>{const n=Tbe(t);(!n||n&&t.button===0)&&e(t)}}function Rbe(e,t=!1){function n(i){e(i,{point:VV(i)})}return t?Ibe(n):n}function E4(e,t,n,r){return Pbe(e,t,Rbe(n,t==="pointerdown"),r)}function WV(e){const t=w.useRef(null);return t.current=e,t}var Dbe=class{constructor(e,t,n){sn(this,"history",[]);sn(this,"startEvent",null);sn(this,"lastEvent",null);sn(this,"lastEventInfo",null);sn(this,"handlers",{});sn(this,"removeListeners",()=>{});sn(this,"threshold",3);sn(this,"win");sn(this,"updatePoint",()=>{if(!(this.lastEvent&&this.lastEventInfo))return;const e=aC(this.lastEventInfo,this.history),t=this.startEvent!==null,n=Fbe(e.offset,{x:0,y:0})>=this.threshold;if(!t&&!n)return;const{timestamp:r}=OL();this.history.push({...e.point,timestamp:r});const{onStart:i,onMove:o}=this.handlers;t||(i==null||i(this.lastEvent,e),this.startEvent=this.lastEvent),o==null||o(this.lastEvent,e)});sn(this,"onPointerMove",(e,t)=>{this.lastEvent=e,this.lastEventInfo=t,ere.update(this.updatePoint,!0)});sn(this,"onPointerUp",(e,t)=>{const n=aC(t,this.history),{onEnd:r,onSessionEnd:i}=this.handlers;i==null||i(e,n),this.end(),!(!r||!this.startEvent)&&(r==null||r(e,n))});if(this.win=e.view??window,Lbe(e))return;this.handlers=t,n&&(this.threshold=n),e.stopPropagation(),e.preventDefault();const r={point:VV(e)},{timestamp:i}=OL();this.history=[{...r.point,timestamp:i}];const{onSessionStart:o}=t;o==null||o(e,aC(r,this.history)),this.removeListeners=Bbe(E4(this.win,"pointermove",this.onPointerMove),E4(this.win,"pointerup",this.onPointerUp),E4(this.win,"pointercancel",this.onPointerUp))}updateHandlers(e){this.handlers=e}end(){var e;(e=this.removeListeners)==null||e.call(this),tre.update(this.updatePoint)}};function aI(e,t){return{x:e.x-t.x,y:e.y-t.y}}function aC(e,t){return{point:e.point,delta:aI(e.point,t[t.length-1]),offset:aI(e.point,t[0]),velocity:jbe(t,.1)}}var Nbe=e=>e*1e3;function jbe(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=e[e.length-1];for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Nbe(t)));)n--;if(!r)return{x:0,y:0};const o=(i.timestamp-r.timestamp)/1e3;if(o===0)return{x:0,y:0};const a={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function Bbe(...e){return t=>e.reduce((n,r)=>r(n),t)}function sC(e,t){return Math.abs(e-t)}function sI(e){return"x"in e&&"y"in e}function Fbe(e,t){if(typeof e=="number"&&typeof t=="number")return sC(e,t);if(sI(e)&&sI(t)){const n=sC(e.x,t.x),r=sC(e.y,t.y);return Math.sqrt(n**2+r**2)}return 0}function UV(e,t){const{onPan:n,onPanStart:r,onPanEnd:i,onPanSessionStart:o,onPanSessionEnd:a,threshold:s}=t,l=Boolean(n||r||i||o||a),u=w.useRef(null),d=WV({onSessionStart:o,onSessionEnd:a,onStart:r,onMove:n,onEnd(h,m){u.current=null,i==null||i(h,m)}});w.useEffect(()=>{var h;(h=u.current)==null||h.updateHandlers(d.current)}),w.useEffect(()=>{const h=e.current;if(!h||!l)return;function m(y){u.current=new Dbe(y,d.current,s)}return E4(h,"pointerdown",m)},[e,l,d,s]),w.useEffect(()=>()=>{var h;(h=u.current)==null||h.end(),u.current=null},[])}function $be(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(i=>{if(!Array.isArray(i)||!i.length)return;const[o]=i;let a,s;if("borderBoxSize"in o){const l=o.borderBoxSize,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,s=u.blockSize}else a=e.offsetWidth,s=e.offsetHeight;t({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}var zbe=Boolean(globalThis==null?void 0:globalThis.document)?w.useLayoutEffect:w.useEffect;function Hbe(e,t){var n;if(!e||!e.parentElement)return;const r=((n=e.ownerDocument)==null?void 0:n.defaultView)??window,i=new r.MutationObserver(()=>{t()});return i.observe(e.parentElement,{childList:!0}),()=>{i.disconnect()}}function GV({getNodes:e,observeMutation:t=!0}){const[n,r]=w.useState([]),[i,o]=w.useState(0);return zbe(()=>{const a=e(),s=a.map((l,u)=>$be(l,d=>{r(h=>[...h.slice(0,u),d,...h.slice(u+1)])}));if(t){const l=a[0];s.push(Hbe(l,()=>{o(u=>u+1)}))}return()=>{s.forEach(l=>{l==null||l()})}},[i]),n}function Vbe(e){return typeof e=="object"&&e!==null&&"current"in e}function Wbe(e){const[t]=GV({observeMutation:!1,getNodes(){return[Vbe(e)?e.current:e]}});return t}var Ube=Object.getOwnPropertyNames,Gbe=(e,t)=>function(){return e&&(t=(0,e[Ube(e)[0]])(e=0)),t},lf=Gbe({"../../../react-shim.js"(){}});lf();lf();lf();var Ja=e=>e?"":void 0,Mm=e=>e?!0:void 0,uf=(...e)=>e.filter(Boolean).join(" ");lf();function Im(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}lf();lf();function qbe(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 Cv(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}var P4={width:0,height:0},wb=e=>e||P4;function qV(e){const{orientation:t,thumbPercents:n,thumbRects:r,isReversed:i}=e,o=S=>{const E=r[S]??P4;return{position:"absolute",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",touchAction:"none",...Cv({orientation:t,vertical:{bottom:`calc(${n[S]}% - ${E.height/2}px)`},horizontal:{left:`calc(${n[S]}% - ${E.width/2}px)`}})}},a=t==="vertical"?r.reduce((S,E)=>wb(S).height>wb(E).height?S:E,P4):r.reduce((S,E)=>wb(S).width>wb(E).width?S:E,P4),s={position:"relative",touchAction:"none",WebkitTapHighlightColor:"rgba(0,0,0,0)",userSelect:"none",outline:0,...Cv({orientation:t,vertical:a?{paddingLeft:a.width/2,paddingRight:a.width/2}:{},horizontal:a?{paddingTop:a.height/2,paddingBottom:a.height/2}:{}})},l={position:"absolute",...Cv({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",height:"100%"},horizontal:{top:"50%",transform:"translateY(-50%)",width:"100%"}})},u=n.length===1,d=[0,i?100-n[0]:n[0]],h=u?d:n;let m=h[0];!u&&i&&(m=100-m);const y=Math.abs(h[h.length-1]-h[0]),b={...l,...Cv({orientation:t,vertical:i?{height:`${y}%`,top:`${m}%`}:{height:`${y}%`,bottom:`${m}%`},horizontal:i?{width:`${y}%`,right:`${m}%`}:{width:`${y}%`,left:`${m}%`}})};return{trackStyle:l,innerTrackStyle:b,rootStyle:s,getThumbStyle:o}}function YV(e){const{isReversed:t,direction:n,orientation:r}=e;return n==="ltr"||r==="vertical"?t:!t}function Ybe(e){const{min:t=0,max:n=100,onChange:r,value:i,defaultValue:o,isReversed:a,direction:s="ltr",orientation:l="horizontal",id:u,isDisabled:d,isReadOnly:h,onChangeStart:m,onChangeEnd:y,step:b=1,getAriaValueText:S,"aria-valuetext":E,"aria-label":k,"aria-labelledby":_,name:T,focusThumbOnChange:A=!0,minStepsBetweenThumbs:I=0,...R}=e,D=Er(m),j=Er(y),z=Er(S),V=YV({isReversed:a,direction:s,orientation:l}),[K,te]=NS({value:i,defaultValue:o??[25,75],onChange:r});if(!Array.isArray(K))throw new TypeError(`[range-slider] You passed an invalid value for \`value\` or \`defaultValue\`, expected \`Array\` but got \`${typeof K}\``);const[q,F]=w.useState(!1),[U,X]=w.useState(!1),[Z,W]=w.useState(-1),Q=!(d||h),ie=w.useRef(K),fe=K.map(Ke=>Cm(Ke,t,n)),Se=I*b,Te=Kbe(fe,t,n,Se),ye=w.useRef({eventSource:null,value:[],valueBounds:[]});ye.current.value=fe,ye.current.valueBounds=Te;const He=fe.map(Ke=>n-Ke+t),tt=(V?He:fe).map(Ke=>u5(Ke,t,n)),_e=l==="vertical",lt=w.useRef(null),wt=w.useRef(null),ct=GV({getNodes(){const Ke=wt.current,xt=Ke==null?void 0:Ke.querySelectorAll("[role=slider]");return xt?Array.from(xt):[]}}),mt=w.useId(),Ae=qbe(u??mt),ut=w.useCallback(Ke=>{var xt;if(!lt.current)return;ye.current.eventSource="pointer";const ft=lt.current.getBoundingClientRect(),{clientX:Ht,clientY:rn}=((xt=Ke.touches)==null?void 0:xt[0])??Ke,pr=_e?ft.bottom-rn:Ht-ft.left,Mo=_e?ft.height:ft.width;let Oi=pr/Mo;return V&&(Oi=1-Oi),JF(Oi,t,n)},[_e,V,n,t]),Mt=(n-t)/10,at=b||(n-t)/100,Ct=w.useMemo(()=>({setValueAtIndex(Ke,xt){if(!Q)return;const ft=ye.current.valueBounds[Ke];xt=parseFloat(V7(xt,ft.min,at)),xt=Cm(xt,ft.min,ft.max);const Ht=[...ye.current.value];Ht[Ke]=xt,te(Ht)},setActiveIndex:W,stepUp(Ke,xt=at){const ft=ye.current.value[Ke],Ht=V?ft-xt:ft+xt;Ct.setValueAtIndex(Ke,Ht)},stepDown(Ke,xt=at){const ft=ye.current.value[Ke],Ht=V?ft+xt:ft-xt;Ct.setValueAtIndex(Ke,Ht)},reset(){te(ie.current)}}),[at,V,te,Q]),Zt=w.useCallback(Ke=>{const xt=Ke.key,Ht={ArrowRight:()=>Ct.stepUp(Z),ArrowUp:()=>Ct.stepUp(Z),ArrowLeft:()=>Ct.stepDown(Z),ArrowDown:()=>Ct.stepDown(Z),PageUp:()=>Ct.stepUp(Z,Mt),PageDown:()=>Ct.stepDown(Z,Mt),Home:()=>{const{min:rn}=Te[Z];Ct.setValueAtIndex(Z,rn)},End:()=>{const{max:rn}=Te[Z];Ct.setValueAtIndex(Z,rn)}}[xt];Ht&&(Ke.preventDefault(),Ke.stopPropagation(),Ht(Ke),ye.current.eventSource="keyboard")},[Ct,Z,Mt,Te]),{getThumbStyle:le,rootStyle:De,trackStyle:Ue,innerTrackStyle:Ye}=w.useMemo(()=>qV({isReversed:V,orientation:l,thumbRects:ct,thumbPercents:tt}),[V,l,tt,ct]),we=w.useCallback(Ke=>{var xt;const ft=Ke??Z;if(ft!==-1&&A){const Ht=Ae.getThumb(ft),rn=(xt=wt.current)==null?void 0:xt.ownerDocument.getElementById(Ht);rn&&setTimeout(()=>rn.focus())}},[A,Z,Ae]);Vd(()=>{ye.current.eventSource==="keyboard"&&(j==null||j(ye.current.value))},[fe,j]);const je=Ke=>{const xt=ut(Ke)||0,ft=ye.current.value.map(Oi=>Math.abs(Oi-xt)),Ht=Math.min(...ft);let rn=ft.indexOf(Ht);const pr=ft.filter(Oi=>Oi===Ht);pr.length>1&&xt>ye.current.value[rn]&&(rn=rn+pr.length-1),W(rn),Ct.setValueAtIndex(rn,xt),we(rn)},_t=Ke=>{if(Z==-1)return;const xt=ut(Ke)||0;W(Z),Ct.setValueAtIndex(Z,xt),we(Z)};UV(wt,{onPanSessionStart(Ke){Q&&(F(!0),je(Ke),D==null||D(ye.current.value))},onPanSessionEnd(){Q&&(F(!1),j==null||j(ye.current.value))},onPan(Ke){Q&&_t(Ke)}});const Dt=w.useCallback((Ke={},xt=null)=>({...Ke,...R,id:Ae.root,ref:Yn(xt,wt),tabIndex:-1,"aria-disabled":Mm(d),"data-focused":Ja(U),style:{...Ke.style,...De}}),[R,d,U,De,Ae]),Le=w.useCallback((Ke={},xt=null)=>({...Ke,ref:Yn(xt,lt),id:Ae.track,"data-disabled":Ja(d),style:{...Ke.style,...Ue}}),[d,Ue,Ae]),At=w.useCallback((Ke={},xt=null)=>({...Ke,ref:xt,id:Ae.innerTrack,style:{...Ke.style,...Ye}}),[Ye,Ae]),Fe=w.useCallback((Ke,xt=null)=>{const{index:ft,...Ht}=Ke,rn=fe[ft];if(rn==null)throw new TypeError(`[range-slider > thumb] Cannot find value at index \`${ft}\`. The \`value\` or \`defaultValue\` length is : ${fe.length}`);const pr=Te[ft];return{...Ht,ref:xt,role:"slider",tabIndex:Q?0:void 0,id:Ae.getThumb(ft),"data-active":Ja(q&&Z===ft),"aria-valuetext":(z==null?void 0:z(rn))??(E==null?void 0:E[ft]),"aria-valuemin":pr.min,"aria-valuemax":pr.max,"aria-valuenow":rn,"aria-orientation":l,"aria-disabled":Mm(d),"aria-readonly":Mm(h),"aria-label":k==null?void 0:k[ft],"aria-labelledby":k!=null&&k[ft]||_==null?void 0:_[ft],style:{...Ke.style,...le(ft)},onKeyDown:Im(Ke.onKeyDown,Zt),onFocus:Im(Ke.onFocus,()=>{X(!0),W(ft)}),onBlur:Im(Ke.onBlur,()=>{X(!1),W(-1)})}},[Ae,fe,Te,Q,q,Z,z,E,l,d,h,k,_,le,Zt,X]),vt=w.useCallback((Ke={},xt=null)=>({...Ke,ref:xt,id:Ae.output,htmlFor:fe.map((ft,Ht)=>Ae.getThumb(Ht)).join(" "),"aria-live":"off"}),[Ae,fe]),nn=w.useCallback((Ke,xt=null)=>{const{value:ft,...Ht}=Ke,rn=!(ftn),pr=ft>=fe[0]&&ft<=fe[fe.length-1];let Mo=u5(ft,t,n);Mo=V?100-Mo:Mo;const Oi={position:"absolute",pointerEvents:"none",...Cv({orientation:l,vertical:{bottom:`${Mo}%`},horizontal:{left:`${Mo}%`}})};return{...Ht,ref:xt,id:Ae.getMarker(Ke.value),role:"presentation","aria-hidden":!0,"data-disabled":Ja(d),"data-invalid":Ja(!rn),"data-highlighted":Ja(pr),style:{...Ke.style,...Oi}}},[d,V,n,t,l,fe,Ae]),Rn=w.useCallback((Ke,xt=null)=>{const{index:ft,...Ht}=Ke;return{...Ht,ref:xt,id:Ae.getInput(ft),type:"hidden",value:fe[ft],name:Array.isArray(T)?T[ft]:`${T}-${ft}`}},[T,fe,Ae]);return{state:{value:fe,isFocused:U,isDragging:q,getThumbPercent:Ke=>tt[Ke],getThumbMinValue:Ke=>Te[Ke].min,getThumbMaxValue:Ke=>Te[Ke].max},actions:Ct,getRootProps:Dt,getTrackProps:Le,getInnerTrackProps:At,getThumbProps:Fe,getMarkerProps:nn,getInputProps:Rn,getOutputProps:vt}}function Kbe(e,t,n,r){return e.map((i,o)=>{const a=o===0?t:e[o-1]+r,s=o===e.length-1?n:e[o+1]-r;return{min:a,max:s}})}var[Xbe,xx]=Mn({name:"SliderContext",errorMessage:"useSliderContext: `context` is undefined. Seems you forgot to wrap all slider components within "}),[Zbe,NE]=Mn({name:"RangeSliderStylesContext",errorMessage:`useRangeSliderStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),KV=Oe(function(t,n){const r=Yi("Slider",t),i=En(t),{direction:o}=h0();i.direction=o;const{getRootProps:a,...s}=Ybe(i),l=w.useMemo(()=>({...s,name:t.name}),[s,t.name]);return N.createElement(Xbe,{value:l},N.createElement(Zbe,{value:r},N.createElement(Ce.div,{...a({},n),className:"chakra-slider",__css:r.container},t.children)))});KV.defaultProps={orientation:"horizontal"};KV.displayName="RangeSlider";var Qbe=Oe(function(t,n){const{getThumbProps:r,getInputProps:i,name:o}=xx(),a=NE(),s=r(t,n);return N.createElement(Ce.div,{...s,className:uf("chakra-slider__thumb",t.className),__css:a.thumb},s.children,o&&N.createElement("input",{...i({index:t.index})}))});Qbe.displayName="RangeSliderThumb";var Jbe=Oe(function(t,n){const{getTrackProps:r}=xx(),i=NE(),o=r(t,n);return N.createElement(Ce.div,{...o,className:uf("chakra-slider__track",t.className),__css:i.track,"data-testid":"chakra-range-slider-track"})});Jbe.displayName="RangeSliderTrack";var e4e=Oe(function(t,n){const{getInnerTrackProps:r}=xx(),i=NE(),o=r(t,n);return N.createElement(Ce.div,{...o,className:"chakra-slider__filled-track",__css:i.filledTrack})});e4e.displayName="RangeSliderFilledTrack";var t4e=Oe(function(t,n){const{getMarkerProps:r}=xx(),i=r(t,n);return N.createElement(Ce.div,{...i,className:uf("chakra-slider__marker",t.className)})});t4e.displayName="RangeSliderMark";lf();lf();function n4e(e){const{min:t=0,max:n=100,onChange:r,value:i,defaultValue:o,isReversed:a,direction:s="ltr",orientation:l="horizontal",id:u,isDisabled:d,isReadOnly:h,onChangeStart:m,onChangeEnd:y,step:b=1,getAriaValueText:S,"aria-valuetext":E,"aria-label":k,"aria-labelledby":_,name:T,focusThumbOnChange:A=!0,...I}=e,R=Er(m),D=Er(y),j=Er(S),z=YV({isReversed:a,direction:s,orientation:l}),[V,K]=NS({value:i,defaultValue:o??i4e(t,n),onChange:r}),[te,q]=w.useState(!1),[F,U]=w.useState(!1),X=!(d||h),Z=(n-t)/10,W=b||(n-t)/100,Q=Cm(V,t,n),ie=n-Q+t,Se=u5(z?ie:Q,t,n),Te=l==="vertical",ye=WV({min:t,max:n,step:b,isDisabled:d,value:Q,isInteractive:X,isReversed:z,isVertical:Te,eventSource:null,focusThumbOnChange:A,orientation:l}),He=w.useRef(null),Ne=w.useRef(null),tt=w.useRef(null),_e=w.useId(),lt=u??_e,[wt,ct]=[`slider-thumb-${lt}`,`slider-track-${lt}`],mt=w.useCallback(Fe=>{var vt;if(!He.current)return;const nn=ye.current;nn.eventSource="pointer";const Rn=He.current.getBoundingClientRect(),{clientX:Ke,clientY:xt}=((vt=Fe.touches)==null?void 0:vt[0])??Fe,ft=Te?Rn.bottom-xt:Ke-Rn.left,Ht=Te?Rn.height:Rn.width;let rn=ft/Ht;z&&(rn=1-rn);let pr=JF(rn,nn.min,nn.max);return nn.step&&(pr=parseFloat(V7(pr,nn.min,nn.step))),pr=Cm(pr,nn.min,nn.max),pr},[Te,z,ye]),St=w.useCallback(Fe=>{const vt=ye.current;vt.isInteractive&&(Fe=parseFloat(V7(Fe,vt.min,W)),Fe=Cm(Fe,vt.min,vt.max),K(Fe))},[W,K,ye]),Ae=w.useMemo(()=>({stepUp(Fe=W){const vt=z?Q-Fe:Q+Fe;St(vt)},stepDown(Fe=W){const vt=z?Q+Fe:Q-Fe;St(vt)},reset(){St(o||0)},stepTo(Fe){St(Fe)}}),[St,z,Q,W,o]),ut=w.useCallback(Fe=>{const vt=ye.current,Rn={ArrowRight:()=>Ae.stepUp(),ArrowUp:()=>Ae.stepUp(),ArrowLeft:()=>Ae.stepDown(),ArrowDown:()=>Ae.stepDown(),PageUp:()=>Ae.stepUp(Z),PageDown:()=>Ae.stepDown(Z),Home:()=>St(vt.min),End:()=>St(vt.max)}[Fe.key];Rn&&(Fe.preventDefault(),Fe.stopPropagation(),Rn(Fe),vt.eventSource="keyboard")},[Ae,St,Z,ye]),Mt=(j==null?void 0:j(Q))??E,at=Wbe(Ne),{getThumbStyle:Ct,rootStyle:Zt,trackStyle:le,innerTrackStyle:De}=w.useMemo(()=>{const Fe=ye.current,vt=at??{width:0,height:0};return qV({isReversed:z,orientation:Fe.orientation,thumbRects:[vt],thumbPercents:[Se]})},[z,at,Se,ye]),Ue=w.useCallback(()=>{ye.current.focusThumbOnChange&&setTimeout(()=>{var vt;return(vt=Ne.current)==null?void 0:vt.focus()})},[ye]);Vd(()=>{const Fe=ye.current;Ue(),Fe.eventSource==="keyboard"&&(D==null||D(Fe.value))},[Q,D]);function Ye(Fe){const vt=mt(Fe);vt!=null&&vt!==ye.current.value&&K(vt)}UV(tt,{onPanSessionStart(Fe){const vt=ye.current;vt.isInteractive&&(q(!0),Ue(),Ye(Fe),R==null||R(vt.value))},onPanSessionEnd(){const Fe=ye.current;Fe.isInteractive&&(q(!1),D==null||D(Fe.value))},onPan(Fe){ye.current.isInteractive&&Ye(Fe)}});const we=w.useCallback((Fe={},vt=null)=>({...Fe,...I,ref:Yn(vt,tt),tabIndex:-1,"aria-disabled":Mm(d),"data-focused":Ja(F),style:{...Fe.style,...Zt}}),[I,d,F,Zt]),je=w.useCallback((Fe={},vt=null)=>({...Fe,ref:Yn(vt,He),id:ct,"data-disabled":Ja(d),style:{...Fe.style,...le}}),[d,ct,le]),_t=w.useCallback((Fe={},vt=null)=>({...Fe,ref:vt,style:{...Fe.style,...De}}),[De]),Dt=w.useCallback((Fe={},vt=null)=>({...Fe,ref:Yn(vt,Ne),role:"slider",tabIndex:X?0:void 0,id:wt,"data-active":Ja(te),"aria-valuetext":Mt,"aria-valuemin":t,"aria-valuemax":n,"aria-valuenow":Q,"aria-orientation":l,"aria-disabled":Mm(d),"aria-readonly":Mm(h),"aria-label":k,"aria-labelledby":k?void 0:_,style:{...Fe.style,...Ct(0)},onKeyDown:Im(Fe.onKeyDown,ut),onFocus:Im(Fe.onFocus,()=>U(!0)),onBlur:Im(Fe.onBlur,()=>U(!1))}),[X,wt,te,Mt,t,n,Q,l,d,h,k,_,Ct,ut]),Le=w.useCallback((Fe,vt=null)=>{const nn=!(Fe.valuen),Rn=Q>=Fe.value,Ke=u5(Fe.value,t,n),xt={position:"absolute",pointerEvents:"none",...r4e({orientation:l,vertical:{bottom:z?`${100-Ke}%`:`${Ke}%`},horizontal:{left:z?`${100-Ke}%`:`${Ke}%`}})};return{...Fe,ref:vt,role:"presentation","aria-hidden":!0,"data-disabled":Ja(d),"data-invalid":Ja(!nn),"data-highlighted":Ja(Rn),style:{...Fe.style,...xt}}},[d,z,n,t,l,Q]),At=w.useCallback((Fe={},vt=null)=>({...Fe,ref:vt,type:"hidden",value:Q,name:T}),[T,Q]);return{state:{value:Q,isFocused:F,isDragging:te},actions:Ae,getRootProps:we,getTrackProps:je,getInnerTrackProps:_t,getThumbProps:Dt,getMarkerProps:Le,getInputProps:At}}function r4e(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}function i4e(e,t){return t"}),[a4e,Cx]=Mn({name:"SliderStylesContext",hookName:"useSliderStyles",providerName:""}),jE=Oe((e,t)=>{const n=Yi("Slider",e),r=En(e),{direction:i}=h0();r.direction=i;const{getInputProps:o,getRootProps:a,...s}=n4e(r),l=a(),u=o({},t);return N.createElement(o4e,{value:s},N.createElement(a4e,{value:n},N.createElement(Ce.div,{...l,className:uf("chakra-slider",e.className),__css:n.container},e.children,N.createElement("input",{...u}))))});jE.defaultProps={orientation:"horizontal"};jE.displayName="Slider";var XV=Oe((e,t)=>{const{getThumbProps:n}=wx(),r=Cx(),i=n(e,t);return N.createElement(Ce.div,{...i,className:uf("chakra-slider__thumb",e.className),__css:r.thumb})});XV.displayName="SliderThumb";var ZV=Oe((e,t)=>{const{getTrackProps:n}=wx(),r=Cx(),i=n(e,t);return N.createElement(Ce.div,{...i,className:uf("chakra-slider__track",e.className),__css:r.track})});ZV.displayName="SliderTrack";var QV=Oe((e,t)=>{const{getInnerTrackProps:n}=wx(),r=Cx(),i=n(e,t);return N.createElement(Ce.div,{...i,className:uf("chakra-slider__filled-track",e.className),__css:r.filledTrack})});QV.displayName="SliderFilledTrack";var q9=Oe((e,t)=>{const{getMarkerProps:n}=wx(),r=Cx(),i=n(e,t);return N.createElement(Ce.div,{...i,className:uf("chakra-slider__marker",e.className),__css:r.mark})});q9.displayName="SliderMark";var s4e=(...e)=>e.filter(Boolean).join(" "),lI=e=>e?"":void 0,BE=Oe(function(t,n){const r=Yi("Switch",t),{spacing:i="0.5rem",children:o,...a}=En(t),{state:s,getInputProps:l,getCheckboxProps:u,getRootProps:d,getLabelProps:h}=ZF(a),m=w.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...r.container}),[r.container]),y=w.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...r.track}),[r.track]),b=w.useMemo(()=>({userSelect:"none",marginStart:i,...r.label}),[i,r.label]);return N.createElement(Ce.label,{...d(),className:s4e("chakra-switch",t.className),__css:m},N.createElement("input",{className:"chakra-switch__input",...l({},n)}),N.createElement(Ce.span,{...u(),className:"chakra-switch__track",__css:y},N.createElement(Ce.span,{__css:r.thumb,className:"chakra-switch__thumb","data-checked":lI(s.isChecked),"data-hover":lI(s.isHovered)})),o&&N.createElement(Ce.span,{className:"chakra-switch__label",...h(),__css:b},o))});BE.displayName="Switch";var C0=(...e)=>e.filter(Boolean).join(" ");function Y9(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var[l4e,JV,u4e,c4e]=dB();function d4e(e){const{defaultIndex:t,onChange:n,index:r,isManual:i,isLazy:o,lazyBehavior:a="unmount",orientation:s="horizontal",direction:l="ltr",...u}=e,[d,h]=w.useState(t??0),[m,y]=NS({defaultValue:t??0,value:r,onChange:n});w.useEffect(()=>{r!=null&&h(r)},[r]);const b=u4e(),S=w.useId();return{id:`tabs-${e.id??S}`,selectedIndex:m,focusedIndex:d,setSelectedIndex:y,setFocusedIndex:h,isManual:i,isLazy:o,lazyBehavior:a,orientation:s,descendants:b,direction:l,htmlProps:u}}var[f4e,My]=Mn({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within "});function h4e(e){const{focusedIndex:t,orientation:n,direction:r}=My(),i=JV(),o=w.useCallback(a=>{const s=()=>{var _;const T=i.nextEnabled(t);T&&((_=T.node)==null||_.focus())},l=()=>{var _;const T=i.prevEnabled(t);T&&((_=T.node)==null||_.focus())},u=()=>{var _;const T=i.firstEnabled();T&&((_=T.node)==null||_.focus())},d=()=>{var _;const T=i.lastEnabled();T&&((_=T.node)==null||_.focus())},h=n==="horizontal",m=n==="vertical",y=a.key,b=r==="ltr"?"ArrowLeft":"ArrowRight",S=r==="ltr"?"ArrowRight":"ArrowLeft",k={[b]:()=>h&&l(),[S]:()=>h&&s(),ArrowDown:()=>m&&s(),ArrowUp:()=>m&&l(),Home:u,End:d}[y];k&&(a.preventDefault(),k(a))},[i,t,n,r]);return{...e,role:"tablist","aria-orientation":n,onKeyDown:Y9(e.onKeyDown,o)}}function p4e(e){const{isDisabled:t,isFocusable:n,...r}=e,{setSelectedIndex:i,isManual:o,id:a,setFocusedIndex:s,selectedIndex:l}=My(),{index:u,register:d}=c4e({disabled:t&&!n}),h=u===l,m=()=>{i(u)},y=()=>{s(u),!o&&!(t&&n)&&i(u)},b=t0e({...r,ref:Yn(d,e.ref),isDisabled:t,isFocusable:n,onClick:Y9(e.onClick,m)}),S="button";return{...b,id:eW(a,u),role:"tab",tabIndex:h?0:-1,type:S,"aria-selected":h,"aria-controls":tW(a,u),onFocus:t?void 0:Y9(e.onFocus,y)}}var[g4e,m4e]=Mn({});function v4e(e){const t=My(),{id:n,selectedIndex:r}=t,o=ZS(e.children).map((a,s)=>w.createElement(g4e,{key:s,value:{isSelected:s===r,id:tW(n,s),tabId:eW(n,s),selectedIndex:r}},a));return{...e,children:o}}function y4e(e){const{children:t,...n}=e,{isLazy:r,lazyBehavior:i}=My(),{isSelected:o,id:a,tabId:s}=m4e(),l=w.useRef(!1);o&&(l.current=!0);const u=j$({wasSelected:l.current,isSelected:o,enabled:r,mode:i});return{tabIndex:0,...n,children:u?t:null,role:"tabpanel","aria-labelledby":s,hidden:!o,id:a}}function b4e(){const e=My(),t=JV(),{selectedIndex:n,orientation:r}=e,i=r==="horizontal",o=r==="vertical",[a,s]=w.useState(()=>{if(i)return{left:0,width:0};if(o)return{top:0,height:0}}),[l,u]=w.useState(!1);return Ws(()=>{if(n==null)return;const d=t.item(n);if(d==null)return;i&&s({left:d.node.offsetLeft,width:d.node.offsetWidth}),o&&s({top:d.node.offsetTop,height:d.node.offsetHeight});const h=requestAnimationFrame(()=>{u(!0)});return()=>{h&&cancelAnimationFrame(h)}},[n,i,o,t]),{position:"absolute",transitionProperty:"left, right, top, bottom, height, width",transitionDuration:l?"200ms":"0ms",transitionTimingFunction:"cubic-bezier(0, 0, 0.2, 1)",...a}}function eW(e,t){return`${e}--tab-${t}`}function tW(e,t){return`${e}--tabpanel-${t}`}var[S4e,Iy]=Mn({name:"TabsStylesContext",errorMessage:`useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),nW=Oe(function(t,n){const r=Yi("Tabs",t),{children:i,className:o,...a}=En(t),{htmlProps:s,descendants:l,...u}=d4e(a),d=w.useMemo(()=>u,[u]),{isFitted:h,...m}=s;return N.createElement(l4e,{value:l},N.createElement(f4e,{value:d},N.createElement(S4e,{value:r},N.createElement(Ce.div,{className:C0("chakra-tabs",o),ref:n,...m,__css:r.root},i))))});nW.displayName="Tabs";var x4e=Oe(function(t,n){const r=b4e(),i={...t.style,...r},o=Iy();return N.createElement(Ce.div,{ref:n,...t,className:C0("chakra-tabs__tab-indicator",t.className),style:i,__css:o.indicator})});x4e.displayName="TabIndicator";var w4e=Oe(function(t,n){const r=h4e({...t,ref:n}),o={display:"flex",...Iy().tablist};return N.createElement(Ce.div,{...r,className:C0("chakra-tabs__tablist",t.className),__css:o})});w4e.displayName="TabList";var rW=Oe(function(t,n){const r=y4e({...t,ref:n}),i=Iy();return N.createElement(Ce.div,{outline:"0",...r,className:C0("chakra-tabs__tab-panel",t.className),__css:i.tabpanel})});rW.displayName="TabPanel";var iW=Oe(function(t,n){const r=v4e(t),i=Iy();return N.createElement(Ce.div,{...r,width:"100%",ref:n,className:C0("chakra-tabs__tab-panels",t.className),__css:i.tabpanels})});iW.displayName="TabPanels";var oW=Oe(function(t,n){const r=Iy(),i=p4e({...t,ref:n}),o={outline:"0",display:"flex",alignItems:"center",justifyContent:"center",...r.tab};return N.createElement(Ce.button,{...i,className:C0("chakra-tabs__tab",t.className),__css:o})});oW.displayName="Tab";var C4e=(...e)=>e.filter(Boolean).join(" ");function _4e(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var k4e=["h","minH","height","minHeight"],FE=Oe((e,t)=>{const n=Ao("Textarea",e),{className:r,rows:i,...o}=En(e),a=sk(o),s=i?_4e(n,k4e):n;return N.createElement(Ce.textarea,{ref:t,rows:i,...a,className:C4e("chakra-textarea",r),__css:s})});FE.displayName="Textarea";function E4e(e,t){const n=Er(e);w.useEffect(()=>{if(t==null)return;let r=null;return r=window.setTimeout(()=>{n()},t),()=>{r&&window.clearTimeout(r)}},[t,n])}function K9(e,...t){return P4e(e)?e(...t):e}var P4e=e=>typeof e=="function";function T4e(e,t){const n=e??"bottom",i={"top-start":{ltr:"top-left",rtl:"top-right"},"top-end":{ltr:"top-right",rtl:"top-left"},"bottom-start":{ltr:"bottom-left",rtl:"bottom-right"},"bottom-end":{ltr:"bottom-right",rtl:"bottom-left"}}[n];return(i==null?void 0:i[t])??n}var L4e=(e,t)=>e.find(n=>n.id===t);function uI(e,t){const n=aW(e,t),r=n?e[n].findIndex(i=>i.id===t):-1;return{position:n,index:r}}function aW(e,t){for(const[n,r]of Object.entries(e))if(L4e(r,t))return n}function A4e(e){const t=e.includes("right"),n=e.includes("left");let r="center";return t&&(r="flex-end"),n&&(r="flex-start"),{display:"flex",flexDirection:"column",alignItems:r}}function O4e(e){const n=e==="top"||e==="bottom"?"0 auto":void 0,r=e.includes("top")?"env(safe-area-inset-top, 0px)":void 0,i=e.includes("bottom")?"env(safe-area-inset-bottom, 0px)":void 0,o=e.includes("left")?void 0:"env(safe-area-inset-right, 0px)",a=e.includes("right")?void 0:"env(safe-area-inset-left, 0px)";return{position:"fixed",zIndex:5500,pointerEvents:"none",display:"flex",flexDirection:"column",margin:n,top:r,bottom:i,right:o,left:a}}var M4e={top:[],"top-left":[],"top-right":[],"bottom-left":[],bottom:[],"bottom-right":[]},Hl=I4e(M4e);function I4e(e){let t=e;const n=new Set,r=i=>{t=i(t),n.forEach(o=>o())};return{getState:()=>t,subscribe:i=>(n.add(i),()=>{r(()=>e),n.delete(i)}),removeToast:(i,o)=>{r(a=>({...a,[o]:a[o].filter(s=>s.id!=i)}))},notify:(i,o)=>{const a=R4e(i,o),{position:s,id:l}=a;return r(u=>{const h=s.includes("top")?[a,...u[s]??[]]:[...u[s]??[],a];return{...u,[s]:h}}),l},update:(i,o)=>{i&&r(a=>{const s={...a},{position:l,index:u}=uI(s,i);return l&&u!==-1&&(s[l][u]={...s[l][u],...o,message:sW(o)}),s})},closeAll:({positions:i}={})=>{r(o=>(i??["bottom","bottom-right","bottom-left","top","top-left","top-right"]).reduce((l,u)=>(l[u]=o[u].map(d=>({...d,requestClose:!0})),l),{...o}))},close:i=>{r(o=>{const a=aW(o,i);return a?{...o,[a]:o[a].map(s=>s.id==i?{...s,requestClose:!0}:s)}:o})},isActive:i=>Boolean(uI(Hl.getState(),i).position)}}var cI=0;function R4e(e,t={}){cI+=1;const n=t.id??cI,r=t.position??"bottom";return{id:n,message:e,position:r,duration:t.duration,onCloseComplete:t.onCloseComplete,onRequestRemove:()=>Hl.removeToast(String(n),r),status:t.status,requestClose:!1,containerStyle:t.containerStyle}}var D4e=e=>{const{status:t,variant:n="solid",id:r,title:i,isClosable:o,onClose:a,description:s,icon:l}=e,u=r?{root:`toast-${r}`,title:`toast-${r}-title`,description:`toast-${r}-description`}:void 0;return N.createElement(UF,{addRole:!1,status:t,variant:n,id:u==null?void 0:u.root,alignItems:"start",borderRadius:"md",boxShadow:"lg",paddingEnd:8,textAlign:"start",width:"auto"},N.createElement(qF,null,l),N.createElement(Ce.div,{flex:"1",maxWidth:"100%"},i&&N.createElement(YF,{id:u==null?void 0:u.title},i),s&&N.createElement(GF,{id:u==null?void 0:u.description,display:"block"},s)),o&&N.createElement(ex,{size:"sm",onClick:a,position:"absolute",insetEnd:1,top:1}))};function sW(e={}){const{render:t,toastComponent:n=D4e}=e;return i=>typeof t=="function"?t({...i,...e}):N.createElement(n,{...i,...e})}function N4e(e,t){const n=i=>({...t,...i,position:T4e((i==null?void 0:i.position)??(t==null?void 0:t.position),e)}),r=i=>{const o=n(i),a=sW(o);return Hl.notify(a,o)};return r.update=(i,o)=>{Hl.update(i,n(o))},r.promise=(i,o)=>{const a=r({...o.loading,status:"loading",duration:null});i.then(s=>r.update(a,{status:"success",duration:5e3,...K9(o.success,s)})).catch(s=>r.update(a,{status:"error",duration:5e3,...K9(o.error,s)}))},r.closeAll=Hl.closeAll,r.close=Hl.close,r.isActive=Hl.isActive,r}function Ry(e){const{theme:t}=lB();return w.useMemo(()=>N4e(t.direction,e),[e,t.direction])}var j4e={initial:e=>{const{position:t}=e,n=["top","bottom"].includes(t)?"y":"x";let r=["top-right","bottom-right"].includes(t)?1:-1;return t==="bottom"&&(r=1),{opacity:0,[n]:r*24}},animate:{opacity:1,y:0,x:0,scale:1,transition:{duration:.4,ease:[.4,0,.2,1]}},exit:{opacity:0,scale:.85,transition:{duration:.2,ease:[.4,0,1,1]}}},lW=w.memo(e=>{const{id:t,message:n,onCloseComplete:r,onRequestRemove:i,requestClose:o=!1,position:a="bottom",duration:s=5e3,containerStyle:l,motionVariants:u=j4e,toastSpacing:d="0.5rem"}=e,[h,m]=w.useState(s),y=Ife();Vd(()=>{y||r==null||r()},[y]),Vd(()=>{m(s)},[s]);const b=()=>m(null),S=()=>m(s),E=()=>{y&&i()};w.useEffect(()=>{y&&o&&i()},[y,o,i]),E4e(E,h);const k=w.useMemo(()=>({pointerEvents:"auto",maxWidth:560,minWidth:300,margin:d,...l}),[l,d]),_=w.useMemo(()=>A4e(a),[a]);return N.createElement(du.li,{layout:!0,className:"chakra-toast",variants:u,initial:"initial",animate:"animate",exit:"exit",onHoverStart:b,onHoverEnd:S,custom:{position:a},style:_},N.createElement(Ce.div,{role:"status","aria-atomic":"true",className:"chakra-toast__inner",__css:k},K9(n,{id:t,onClose:E})))});lW.displayName="ToastComponent";var B4e=e=>{const t=w.useSyncExternalStore(Hl.subscribe,Hl.getState,Hl.getState),{children:n,motionVariants:r,component:i=lW,portalProps:o}=e,s=Object.keys(t).map(l=>{const u=t[l];return N.createElement("ul",{role:"region","aria-live":"polite",key:l,id:`chakra-toast-manager-${l}`,style:O4e(l)},N.createElement(nf,{initial:!1},u.map(d=>N.createElement(i,{key:d.id,motionVariants:r,...d}))))});return N.createElement(N.Fragment,null,n,N.createElement(ap,{...o},s))};function F4e(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function $4e(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var z4e={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]}}}};function tv(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var j5=e=>{var t;return((t=e.current)==null?void 0:t.ownerDocument)||document},X9=e=>{var t,n;return((n=(t=e.current)==null?void 0:t.ownerDocument)==null?void 0:n.defaultView)||window};function H4e(e={}){const{openDelay:t=0,closeDelay:n=0,closeOnClick:r=!0,closeOnMouseDown:i,closeOnScroll:o,closeOnPointerDown:a=i,closeOnEsc:s=!0,onOpen:l,onClose:u,placement:d,id:h,isOpen:m,defaultIsOpen:y,arrowSize:b=10,arrowShadowColor:S,arrowPadding:E,modifiers:k,isDisabled:_,gutter:T,offset:A,direction:I,...R}=e,{isOpen:D,onOpen:j,onClose:z}=N$({isOpen:m,defaultIsOpen:y,onOpen:l,onClose:u}),{referenceRef:V,getPopperProps:K,getArrowInnerProps:te,getArrowProps:q}=D$({enabled:D,placement:d,arrowPadding:E,modifiers:k,gutter:T,offset:A,direction:I}),F=w.useId(),X=`tooltip-${h??F}`,Z=w.useRef(null),W=w.useRef(),Q=w.useCallback(()=>{W.current&&(clearTimeout(W.current),W.current=void 0)},[]),ie=w.useRef(),fe=w.useCallback(()=>{ie.current&&(clearTimeout(ie.current),ie.current=void 0)},[]),Se=w.useCallback(()=>{fe(),z()},[z,fe]),Te=V4e(Z,Se),ye=w.useCallback(()=>{if(!_&&!W.current){Te();const mt=X9(Z);W.current=mt.setTimeout(j,t)}},[Te,_,j,t]),He=w.useCallback(()=>{Q();const mt=X9(Z);ie.current=mt.setTimeout(Se,n)},[n,Se,Q]),Ne=w.useCallback(()=>{D&&r&&He()},[r,He,D]),tt=w.useCallback(()=>{D&&a&&He()},[a,He,D]),_e=w.useCallback(mt=>{D&&mt.key==="Escape"&&He()},[D,He]);Rh(()=>j5(Z),"keydown",s?_e:void 0),Rh(()=>j5(Z),"scroll",()=>{D&&o&&Se()}),w.useEffect(()=>{_&&(Q(),D&&z())},[_,D,z,Q]),w.useEffect(()=>()=>{Q(),fe()},[Q,fe]),Rh(()=>Z.current,"pointerleave",He);const lt=w.useCallback((mt={},St=null)=>({...mt,ref:Yn(Z,St,V),onPointerEnter:tv(mt.onPointerEnter,ut=>{ut.pointerType!=="touch"&&ye()}),onClick:tv(mt.onClick,Ne),onPointerDown:tv(mt.onPointerDown,tt),onFocus:tv(mt.onFocus,ye),onBlur:tv(mt.onBlur,He),"aria-describedby":D?X:void 0}),[ye,He,tt,D,X,Ne,V]),wt=w.useCallback((mt={},St=null)=>K({...mt,style:{...mt.style,[oi.arrowSize.var]:b?`${b}px`:void 0,[oi.arrowShadowColor.var]:S}},St),[K,b,S]),ct=w.useCallback((mt={},St=null)=>{const Ae={...mt.style,position:"relative",transformOrigin:oi.transformOrigin.varRef};return{ref:St,...R,...mt,id:X,role:"tooltip",style:Ae}},[R,X]);return{isOpen:D,show:ye,hide:He,getTriggerProps:lt,getTooltipProps:ct,getTooltipPositionerProps:wt,getArrowProps:q,getArrowInnerProps:te}}var lC="chakra-ui:close-tooltip";function V4e(e,t){return w.useEffect(()=>{const n=j5(e);return n.addEventListener(lC,t),()=>n.removeEventListener(lC,t)},[t,e]),()=>{const n=j5(e),r=X9(e);n.dispatchEvent(new r.CustomEvent(lC))}}var W4e=Ce(du.div),lo=Oe((e,t)=>{const n=Ao("Tooltip",e),r=En(e),i=h0(),{children:o,label:a,shouldWrapChildren:s,"aria-label":l,hasArrow:u,bg:d,portalProps:h,background:m,backgroundColor:y,bgColor:b,motionProps:S,...E}=r,k=m??y??d??b;if(k){n.bg=k;const z=tne(i,"colors",k);n[oi.arrowBg.var]=z}const _=H4e({...E,direction:i.direction}),T=typeof o=="string"||s;let A;if(T)A=N.createElement(Ce.span,{display:"inline-block",tabIndex:0,..._.getTriggerProps()},o);else{const z=w.Children.only(o);A=w.cloneElement(z,_.getTriggerProps(z.props,z.ref))}const I=!!l,R=_.getTooltipProps({},t),D=I?F4e(R,["role","id"]):R,j=$4e(R,["role","id"]);return a?N.createElement(N.Fragment,null,A,N.createElement(nf,null,_.isOpen&&N.createElement(ap,{...h},N.createElement(Ce.div,{..._.getTooltipPositionerProps(),__css:{zIndex:n.zIndex,pointerEvents:"none"}},N.createElement(W4e,{variants:z4e,initial:"exit",animate:"enter",exit:"exit",...S,...D,__css:n},a,I&&N.createElement(Ce.span,{srOnly:!0,...j},l),u&&N.createElement(Ce.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper"},N.createElement(Ce.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:n.bg}}))))))):N.createElement(N.Fragment,null,o)});lo.displayName="Tooltip";var U4e=e=>{const{children:t,colorModeManager:n,portalZIndex:r,resetCSS:i=!0,theme:o={},environment:a,cssVarsRoot:s}=e,l=N.createElement(y$,{environment:a},t);return N.createElement(Gue,{theme:o,cssVarsRoot:s},N.createElement(fj,{colorModeManager:n,options:o.config},i?N.createElement(dme,null):N.createElement(cme,null),N.createElement(Yue,null),r?N.createElement(BH,{zIndex:r},l):l))};function G4e({children:e,theme:t=jue,toastOptions:n,...r}){return N.createElement(U4e,{theme:t,...r},e,N.createElement(B4e,{...n}))}var Z9={},dI=Qs;Z9.createRoot=dI.createRoot,Z9.hydrateRoot=dI.hydrateRoot;var Q9={},q4e={get exports(){return Q9},set exports(e){Q9=e}},uW={};/** + * @license React + * use-sync-external-store-shim.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 r0=w;function Y4e(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var K4e=typeof Object.is=="function"?Object.is:Y4e,X4e=r0.useState,Z4e=r0.useEffect,Q4e=r0.useLayoutEffect,J4e=r0.useDebugValue;function e5e(e,t){var n=t(),r=X4e({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return Q4e(function(){i.value=n,i.getSnapshot=t,uC(i)&&o({inst:i})},[e,n,t]),Z4e(function(){return uC(i)&&o({inst:i}),e(function(){uC(i)&&o({inst:i})})},[e]),J4e(n),n}function uC(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!K4e(e,n)}catch{return!0}}function t5e(e,t){return t()}var n5e=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?t5e:e5e;uW.useSyncExternalStore=r0.useSyncExternalStore!==void 0?r0.useSyncExternalStore:n5e;(function(e){e.exports=uW})(q4e);var J9={},r5e={get exports(){return J9},set exports(e){J9=e}},cW={};/** + * @license React + * use-sync-external-store-shim/with-selector.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 _x=w,i5e=Q9;function o5e(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var a5e=typeof Object.is=="function"?Object.is:o5e,s5e=i5e.useSyncExternalStore,l5e=_x.useRef,u5e=_x.useEffect,c5e=_x.useMemo,d5e=_x.useDebugValue;cW.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=l5e(null);if(o.current===null){var a={hasValue:!1,value:null};o.current=a}else a=o.current;o=c5e(function(){function l(y){if(!u){if(u=!0,d=y,y=r(y),i!==void 0&&a.hasValue){var b=a.value;if(i(b,y))return h=b}return h=y}if(b=h,a5e(d,y))return b;var S=r(y);return i!==void 0&&i(b,S)?b:(d=y,h=S)}var u=!1,d,h,m=n===void 0?null:n;return[function(){return l(t())},m===null?void 0:function(){return l(m())}]},[t,n,r,i]);var s=s5e(e,o[0],o[1]);return u5e(function(){a.hasValue=!0,a.value=s},[s]),d5e(s),s};(function(e){e.exports=cW})(r5e);function f5e(e){e()}let dW=f5e;const h5e=e=>dW=e,p5e=()=>dW,Xd=w.createContext(null);function fW(){return w.useContext(Xd)}const g5e=()=>{throw new Error("uSES not initialized!")};let hW=g5e;const m5e=e=>{hW=e},v5e=(e,t)=>e===t;function y5e(e=Xd){const t=e===Xd?fW:()=>w.useContext(e);return function(r,i=v5e){const{store:o,subscription:a,getServerState:s}=t(),l=hW(a.addNestedSub,o.getState,s||o.getState,r,i);return w.useDebugValue(l),l}}const b5e=y5e();var fI={},S5e={get exports(){return fI},set exports(e){fI=e}},$n={};/** + * @license React + * react-is.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 $E=Symbol.for("react.element"),zE=Symbol.for("react.portal"),kx=Symbol.for("react.fragment"),Ex=Symbol.for("react.strict_mode"),Px=Symbol.for("react.profiler"),Tx=Symbol.for("react.provider"),Lx=Symbol.for("react.context"),x5e=Symbol.for("react.server_context"),Ax=Symbol.for("react.forward_ref"),Ox=Symbol.for("react.suspense"),Mx=Symbol.for("react.suspense_list"),Ix=Symbol.for("react.memo"),Rx=Symbol.for("react.lazy"),w5e=Symbol.for("react.offscreen"),pW;pW=Symbol.for("react.module.reference");function ps(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case $E:switch(e=e.type,e){case kx:case Px:case Ex:case Ox:case Mx:return e;default:switch(e=e&&e.$$typeof,e){case x5e:case Lx:case Ax:case Rx:case Ix:case Tx:return e;default:return t}}case zE:return t}}}$n.ContextConsumer=Lx;$n.ContextProvider=Tx;$n.Element=$E;$n.ForwardRef=Ax;$n.Fragment=kx;$n.Lazy=Rx;$n.Memo=Ix;$n.Portal=zE;$n.Profiler=Px;$n.StrictMode=Ex;$n.Suspense=Ox;$n.SuspenseList=Mx;$n.isAsyncMode=function(){return!1};$n.isConcurrentMode=function(){return!1};$n.isContextConsumer=function(e){return ps(e)===Lx};$n.isContextProvider=function(e){return ps(e)===Tx};$n.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===$E};$n.isForwardRef=function(e){return ps(e)===Ax};$n.isFragment=function(e){return ps(e)===kx};$n.isLazy=function(e){return ps(e)===Rx};$n.isMemo=function(e){return ps(e)===Ix};$n.isPortal=function(e){return ps(e)===zE};$n.isProfiler=function(e){return ps(e)===Px};$n.isStrictMode=function(e){return ps(e)===Ex};$n.isSuspense=function(e){return ps(e)===Ox};$n.isSuspenseList=function(e){return ps(e)===Mx};$n.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===kx||e===Px||e===Ex||e===Ox||e===Mx||e===w5e||typeof e=="object"&&e!==null&&(e.$$typeof===Rx||e.$$typeof===Ix||e.$$typeof===Tx||e.$$typeof===Lx||e.$$typeof===Ax||e.$$typeof===pW||e.getModuleId!==void 0)};$n.typeOf=ps;(function(e){e.exports=$n})(S5e);function C5e(){const e=p5e();let t=null,n=null;return{clear(){t=null,n=null},notify(){e(()=>{let r=t;for(;r;)r.callback(),r=r.next})},get(){let r=[],i=t;for(;i;)r.push(i),i=i.next;return r},subscribe(r){let i=!0,o=n={callback:r,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){!i||t===null||(i=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}const hI={notify(){},get:()=>[]};function _5e(e,t){let n,r=hI;function i(h){return l(),r.subscribe(h)}function o(){r.notify()}function a(){d.onStateChange&&d.onStateChange()}function s(){return Boolean(n)}function l(){n||(n=t?t.addNestedSub(a):e.subscribe(a),r=C5e())}function u(){n&&(n(),n=void 0,r.clear(),r=hI)}const d={addNestedSub:i,notifyNestedSubs:o,handleChangeWrapper:a,isSubscribed:s,trySubscribe:l,tryUnsubscribe:u,getListeners:()=>r};return d}const k5e=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",E5e=k5e?w.useLayoutEffect:w.useEffect;function P5e({store:e,context:t,children:n,serverState:r}){const i=w.useMemo(()=>{const s=_5e(e);return{store:e,subscription:s,getServerState:r?()=>r:void 0}},[e,r]),o=w.useMemo(()=>e.getState(),[e]);E5e(()=>{const{subscription:s}=i;return s.onStateChange=s.notifyNestedSubs,s.trySubscribe(),o!==e.getState()&&s.notifyNestedSubs(),()=>{s.tryUnsubscribe(),s.onStateChange=void 0}},[i,o]);const a=t||Xd;return N.createElement(a.Provider,{value:i},n)}function gW(e=Xd){const t=e===Xd?fW:()=>w.useContext(e);return function(){const{store:r}=t();return r}}const T5e=gW();function L5e(e=Xd){const t=e===Xd?T5e:gW(e);return function(){return t().dispatch}}const A5e=L5e();m5e(J9.useSyncExternalStoreWithSelector);h5e(Qs.unstable_batchedUpdates);function T4(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?T4=function(n){return typeof n}:T4=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},T4(e)}function O5e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pI(e,t){for(var n=0;n1?t-1:0),r=1;r3?t.i-4:t.i:Array.isArray(e)?1:HE(e)?2:VE(e)?3:0}function Rm(e,t){return _0(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function D5e(e,t){return _0(e)===2?e.get(t):e[t]}function vW(e,t,n){var r=_0(e);r===2?e.set(t,n):r===3?(e.delete(t),e.add(n)):e[t]=n}function yW(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function HE(e){return z5e&&e instanceof Map}function VE(e){return H5e&&e instanceof Set}function hh(e){return e.o||e.t}function WE(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=SW(e);delete t[vr];for(var n=Dm(t),r=0;r1&&(e.set=e.add=e.clear=e.delete=N5e),Object.freeze(e),t&&Qh(e,function(n,r){return UE(r,!0)},!0)),e}function N5e(){zs(2)}function GE(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function eu(e){var t=o8[e];return t||zs(18,e),t}function j5e(e,t){o8[e]||(o8[e]=t)}function n8(){return X2}function cC(e,t){t&&(eu("Patches"),e.u=[],e.s=[],e.v=t)}function B5(e){r8(e),e.p.forEach(B5e),e.p=null}function r8(e){e===X2&&(X2=e.l)}function gI(e){return X2={p:[],l:X2,h:e,m:!0,_:0}}function B5e(e){var t=e[vr];t.i===0||t.i===1?t.j():t.O=!0}function dC(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.g||eu("ES5").S(t,e,r),r?(n[vr].P&&(B5(t),zs(4)),oc(e)&&(e=F5(t,e),t.l||$5(t,e)),t.u&&eu("Patches").M(n[vr].t,e,t.u,t.s)):e=F5(t,n,[]),B5(t),t.u&&t.v(t.u,t.s),e!==bW?e:void 0}function F5(e,t,n){if(GE(t))return t;var r=t[vr];if(!r)return Qh(t,function(o,a){return mI(e,r,t,o,a,n)},!0),t;if(r.A!==e)return t;if(!r.P)return $5(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var i=r.i===4||r.i===5?r.o=WE(r.k):r.o;Qh(r.i===3?new Set(i):i,function(o,a){return mI(e,r,i,o,a,n)}),$5(e,i,!1),n&&e.u&&eu("Patches").R(r,n,e.u,e.s)}return r.o}function mI(e,t,n,r,i,o){if(Zd(i)){var a=F5(e,i,o&&t&&t.i!==3&&!Rm(t.D,r)?o.concat(r):void 0);if(vW(n,r,a),!Zd(a))return;e.m=!1}if(oc(i)&&!GE(i)){if(!e.h.F&&e._<1)return;F5(e,i),t&&t.A.l||$5(e,i)}}function $5(e,t,n){n===void 0&&(n=!1),e.h.F&&e.m&&UE(t,n)}function fC(e,t){var n=e[vr];return(n?hh(n):e)[t]}function vI(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function Sd(e){e.P||(e.P=!0,e.l&&Sd(e.l))}function hC(e){e.o||(e.o=WE(e.t))}function i8(e,t,n){var r=HE(t)?eu("MapSet").N(t,n):VE(t)?eu("MapSet").T(t,n):e.g?function(i,o){var a=Array.isArray(i),s={i:a?1:0,A:o?o.A:n8(),P:!1,I:!1,D:{},l:o,t:i,k:null,o:null,j:null,C:!1},l=s,u=Z2;a&&(l=[s],u=_v);var d=Proxy.revocable(l,u),h=d.revoke,m=d.proxy;return s.k=m,s.j=h,m}(t,n):eu("ES5").J(t,n);return(n?n.A:n8()).p.push(r),r}function F5e(e){return Zd(e)||zs(22,e),function t(n){if(!oc(n))return n;var r,i=n[vr],o=_0(n);if(i){if(!i.P&&(i.i<4||!eu("ES5").K(i)))return i.t;i.I=!0,r=yI(n,o),i.I=!1}else r=yI(n,o);return Qh(r,function(a,s){i&&D5e(i.t,a)===s||vW(r,a,t(s))}),o===3?new Set(r):r}(e)}function yI(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return WE(e)}function $5e(){function e(o,a){var s=i[o];return s?s.enumerable=a:i[o]=s={configurable:!0,enumerable:a,get:function(){var l=this[vr];return Z2.get(l,o)},set:function(l){var u=this[vr];Z2.set(u,o,l)}},s}function t(o){for(var a=o.length-1;a>=0;a--){var s=o[a][vr];if(!s.P)switch(s.i){case 5:r(s)&&Sd(s);break;case 4:n(s)&&Sd(s)}}}function n(o){for(var a=o.t,s=o.k,l=Dm(s),u=l.length-1;u>=0;u--){var d=l[u];if(d!==vr){var h=a[d];if(h===void 0&&!Rm(a,d))return!0;var m=s[d],y=m&&m[vr];if(y?y.t!==h:!yW(m,h))return!0}}var b=!!a[vr];return l.length!==Dm(a).length+(b?0:1)}function r(o){var a=o.k;if(a.length!==o.t.length)return!0;var s=Object.getOwnPropertyDescriptor(a,a.length-1);if(s&&!s.get)return!0;for(var l=0;l1?k-1:0),T=1;T1?d-1:0),m=1;m=0;i--){var o=r[i];if(o.path.length===0&&o.op==="replace"){n=o.value;break}}i>-1&&(r=r.slice(i+1));var a=eu("Patches").$;return Zd(n)?a(n,r):this.produce(n,function(s){return a(s,r)})},e}(),Ia=new W5e,xW=Ia.produce;Ia.produceWithPatches.bind(Ia);Ia.setAutoFreeze.bind(Ia);Ia.setUseProxies.bind(Ia);Ia.applyPatches.bind(Ia);Ia.createDraft.bind(Ia);Ia.finishDraft.bind(Ia);function wI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function CI(e){for(var t=1;t"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(ro(1));return n(YE)(e,t)}if(typeof e!="function")throw new Error(ro(2));var i=e,o=t,a=[],s=a,l=!1;function u(){s===a&&(s=a.slice())}function d(){if(l)throw new Error(ro(3));return o}function h(S){if(typeof S!="function")throw new Error(ro(4));if(l)throw new Error(ro(5));var E=!0;return u(),s.push(S),function(){if(E){if(l)throw new Error(ro(6));E=!1,u();var _=s.indexOf(S);s.splice(_,1),a=null}}}function m(S){if(!U5e(S))throw new Error(ro(7));if(typeof S.type>"u")throw new Error(ro(8));if(l)throw new Error(ro(9));try{l=!0,o=i(o,S)}finally{l=!1}for(var E=a=s,k=0;k"u")throw new Error(ro(12));if(typeof n(void 0,{type:z5.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ro(13))})}function wW(e){for(var t=Object.keys(e),n={},r=0;r"u")throw u&&u.type,new Error(ro(14));h[y]=E,d=d||E!==S}return d=d||o.length!==Object.keys(l).length,d?h:l}}function H5(){for(var e=arguments.length,t=new Array(e),n=0;n-1){var u=n[l];return l>0&&(n.splice(l,1),n.unshift(u)),u.value}return V5}function i(s,l){r(s)===V5&&(n.unshift({key:s,value:l}),n.length>e&&n.pop())}function o(){return n}function a(){n=[]}return{get:r,put:i,getEntries:o,clear:a}}var X5e=function(t,n){return t===n};function Z5e(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;for(var i=n.length,o=0;o1?t-1:0),r=1;r0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]{Object.keys(R).forEach(function(D){T(D)&&d[D]!==R[D]&&m.indexOf(D)===-1&&m.push(D)}),Object.keys(d).forEach(function(D){R[D]===void 0&&T(D)&&m.indexOf(D)===-1&&d[D]!==void 0&&m.push(D)}),y===null&&(y=setInterval(k,i)),d=R},o)}function k(){if(m.length===0){y&&clearInterval(y),y=null;return}var R=m.shift(),D=r.reduce(function(j,z){return z.in(j,R,d)},d[R]);if(D!==void 0)try{h[R]=l(D)}catch(j){console.error("redux-persist/createPersistoid: error serializing state",j)}else delete h[R];m.length===0&&_()}function _(){Object.keys(h).forEach(function(R){d[R]===void 0&&delete h[R]}),b=s.setItem(a,l(h)).catch(A)}function T(R){return!(n&&n.indexOf(R)===-1&&R!=="_persist"||t&&t.indexOf(R)!==-1)}function A(R){u&&u(R)}var I=function(){for(;m.length!==0;)k();return b||Promise.resolve()};return{update:E,flush:I}}function OSe(e){return JSON.stringify(e)}function MSe(e){var t=e.transforms||[],n="".concat(e.keyPrefix!==void 0?e.keyPrefix:XE).concat(e.key),r=e.storage;e.debug;var i;return e.deserialize===!1?i=function(a){return a}:typeof e.deserialize=="function"?i=e.deserialize:i=ISe,r.getItem(n).then(function(o){if(o)try{var a={},s=i(o);return Object.keys(s).forEach(function(l){a[l]=t.reduceRight(function(u,d){return d.out(u,l,s)},i(s[l]))}),a}catch(l){throw l}else return})}function ISe(e){return JSON.parse(e)}function RSe(e){var t=e.storage,n="".concat(e.keyPrefix!==void 0?e.keyPrefix:XE).concat(e.key);return t.removeItem(n,DSe)}function DSe(e){}function OI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Fu(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function BSe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var FSe=5e3;function $Se(e,t){var n=e.version!==void 0?e.version:ESe;e.debug;var r=e.stateReconciler===void 0?LSe:e.stateReconciler,i=e.getStoredState||MSe,o=e.timeout!==void 0?e.timeout:FSe,a=null,s=!1,l=!0,u=function(h){return h._persist.rehydrated&&a&&!l&&a.update(h),h};return function(d,h){var m=d||{},y=m._persist,b=jSe(m,["_persist"]),S=b;if(h.type===TW){var E=!1,k=function(j,z){E||(h.rehydrate(e.key,j,z),E=!0)};if(o&&setTimeout(function(){!E&&k(void 0,new Error('redux-persist: persist timed out for persist key "'.concat(e.key,'"')))},o),l=!1,a||(a=ASe(e)),y)return Fu({},t(S,h),{_persist:y});if(typeof h.rehydrate!="function"||typeof h.register!="function")throw new Error("redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.");return h.register(e.key),i(e).then(function(D){var j=e.migrate||function(z,V){return Promise.resolve(z)};j(D,n).then(function(z){k(z)},function(z){k(void 0,z)})},function(D){k(void 0,D)}),Fu({},t(S,h),{_persist:{version:n,rehydrated:!1}})}else{if(h.type===LW)return s=!0,h.result(RSe(e)),Fu({},t(S,h),{_persist:y});if(h.type===EW)return h.result(a&&a.flush()),Fu({},t(S,h),{_persist:y});if(h.type===PW)l=!0;else if(h.type===ZE){if(s)return Fu({},S,{_persist:Fu({},y,{rehydrated:!0})});if(h.key===e.key){var _=t(S,h),T=h.payload,A=r!==!1&&T!==void 0?r(T,d,_,e):_,I=Fu({},A,{_persist:Fu({},y,{rehydrated:!0})});return u(I)}}}if(!y)return t(d,h);var R=t(S,h);return R===S?d:u(Fu({},R,{_persist:y}))}}function MI(e){return VSe(e)||HSe(e)||zSe()}function zSe(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function HSe(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)}function VSe(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0&&arguments[0]!==void 0?arguments[0]:OW,n=arguments.length>1?arguments[1]:void 0;switch(n.type){case AW:return s8({},t,{registry:[].concat(MI(t.registry),[n.key])});case ZE:var r=t.registry.indexOf(n.key),i=MI(t.registry);return i.splice(r,1),s8({},t,{registry:i,bootstrapped:i.length===0});default:return t}};function GSe(e,t,n){var r=n||!1,i=YE(USe,OW,t&&t.enhancer?t.enhancer:void 0),o=function(u){i.dispatch({type:AW,key:u})},a=function(u,d,h){var m={type:ZE,payload:d,err:h,key:u};e.dispatch(m),i.dispatch(m),r&&s.getState().bootstrapped&&(r(),r=!1)},s=s8({},i,{purge:function(){var u=[];return e.dispatch({type:LW,result:function(h){u.push(h)}}),Promise.all(u)},flush:function(){var u=[];return e.dispatch({type:EW,result:function(h){u.push(h)}}),Promise.all(u)},pause:function(){e.dispatch({type:PW})},persist:function(){e.dispatch({type:TW,register:o,rehydrate:a})}});return t&&t.manualPersist||s.persist(),s}var QE={},JE={};JE.__esModule=!0;JE.default=KSe;function M4(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?M4=function(n){return typeof n}:M4=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},M4(e)}function vC(){}var qSe={getItem:vC,setItem:vC,removeItem:vC};function YSe(e){if((typeof self>"u"?"undefined":M4(self))!=="object"||!(e in self))return!1;try{var t=self[e],n="redux-persist ".concat(e," test");t.setItem(n,"test"),t.getItem(n),t.removeItem(n)}catch{return!1}return!0}function KSe(e){var t="".concat(e,"Storage");return YSe(t)?self[t]:qSe}QE.__esModule=!0;QE.default=QSe;var XSe=ZSe(JE);function ZSe(e){return e&&e.__esModule?e:{default:e}}function QSe(e){var t=(0,XSe.default)(e);return{getItem:function(r){return new Promise(function(i,o){i(t.getItem(r))})},setItem:function(r,i){return new Promise(function(o,a){o(t.setItem(r,i))})},removeItem:function(r){return new Promise(function(i,o){i(t.removeItem(r))})}}}var MW=void 0,JSe=exe(QE);function exe(e){return e&&e.__esModule?e:{default:e}}var txe=(0,JSe.default)("local");MW=txe;var IW={},RW={},Jh={};Object.defineProperty(Jh,"__esModule",{value:!0});Jh.PLACEHOLDER_UNDEFINED=Jh.PACKAGE_NAME=void 0;Jh.PACKAGE_NAME="redux-deep-persist";Jh.PLACEHOLDER_UNDEFINED="@@placeholder/undefined";var eP={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigType=void 0,function(t){t[t.WHITELIST=0]="WHITELIST",t[t.BLACKLIST=1]="BLACKLIST"}(e.ConfigType||(e.ConfigType={}))})(eP);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getRootKeysGroup=e.throwError=e.configValidator=e.transformsValidator=e.singleTransformValidator=e.findDuplicatesAndSubsets=e.unique=e.preserveUndefined=e.mergeDeep=e.dissocPath=e.assocPath=e.path=e.difference=e.cloneDeep=e._cloneDeep=e.getCircularPath=e.isEmpty=e.isDate=e.isString=e.isIntegerString=e.isPlainObject=e.isArray=e.isLength=e.isObjectLike=void 0;const t=Jh,n=eP,r=function(q){return typeof q=="object"&&q!==null};e.isObjectLike=r;const i=function(q){return typeof q=="number"&&q>-1&&q%1==0&&q<=Number.MAX_SAFE_INTEGER};e.isLength=i,e.isArray=Array.isArray||function(q){return(0,e.isLength)(q&&q.length)&&Object.prototype.toString.call(q)==="[object Array]"};const o=function(q){return!!q&&typeof q=="object"&&!(0,e.isArray)(q)};e.isPlainObject=o;const a=function(q){return String(~~q)===q&&Number(q)>=0};e.isIntegerString=a;const s=function(q){return Object.prototype.toString.call(q)==="[object String]"};e.isString=s;const l=function(q){return Object.prototype.toString.call(q)==="[object Date]"};e.isDate=l;const u=function(q){return Object.keys(q).length===0};e.isEmpty=u;const d=Object.prototype.hasOwnProperty,h=function(q,F,U){U||(U=new Set([q])),F||(F="");for(const X in q){const Z=F?`${F}.${X}`:X,W=q[X];if((0,e.isObjectLike)(W))return U.has(W)?`${F}.${X}:`:(U.add(W),(0,e.getCircularPath)(W,Z,U))}return null};e.getCircularPath=h;const m=function(q){if(!(0,e.isObjectLike)(q))return q;if((0,e.isDate)(q))return new Date(+q);const F=(0,e.isArray)(q)?[]:{};for(const U in q){const X=q[U];F[U]=(0,e._cloneDeep)(X)}return F};e._cloneDeep=m;const y=function(q){const F=(0,e.getCircularPath)(q);if(F)throw new Error(`${t.PACKAGE_NAME}: circular dependency detected under the path '${F}' of object you're trying to persist: ${q}`);return(0,e._cloneDeep)(q)};e.cloneDeep=y;const b=function(q,F){if(q===F)return{};if(!(0,e.isObjectLike)(q)||!(0,e.isObjectLike)(F))return F;const U=(0,e.cloneDeep)(q),X=(0,e.cloneDeep)(F),Z=Object.keys(U).reduce((Q,ie)=>(d.call(X,ie)||(Q[ie]=void 0),Q),{});if((0,e.isDate)(U)||(0,e.isDate)(X))return U.valueOf()===X.valueOf()?{}:X;const W=Object.keys(X).reduce((Q,ie)=>{if(!d.call(U,ie))return Q[ie]=X[ie],Q;const fe=(0,e.difference)(U[ie],X[ie]);return(0,e.isObjectLike)(fe)&&(0,e.isEmpty)(fe)&&!(0,e.isDate)(fe)?(0,e.isArray)(U)&&!(0,e.isArray)(X)||!(0,e.isArray)(U)&&(0,e.isArray)(X)?X:Q:(Q[ie]=fe,Q)},Z);return delete W._persist,W};e.difference=b;const S=function(q,F){return F.reduce((U,X)=>{if(U){const Z=parseInt(X,10),W=(0,e.isIntegerString)(X)&&Z<0?U.length+Z:X;return(0,e.isString)(U)?U.charAt(W):U[W]}},q)};e.path=S;const E=function(q,F){return[...q].reverse().reduce((Z,W,Q)=>{const ie=(0,e.isIntegerString)(W)?[]:{};return ie[W]=Q===0?F:Z,ie},{})};e.assocPath=E;const k=function(q,F){const U=(0,e.cloneDeep)(q);return F.reduce((X,Z,W)=>(W===F.length-1&&X&&(0,e.isObjectLike)(X)&&delete X[Z],X&&X[Z]),U),U};e.dissocPath=k;const _=function(q,F,...U){if(!U||!U.length)return F;const X=U.shift(),{preservePlaceholder:Z,preserveUndefined:W}=q;if((0,e.isObjectLike)(F)&&(0,e.isObjectLike)(X))for(const Q in X)if((0,e.isObjectLike)(X[Q])&&(0,e.isObjectLike)(F[Q]))F[Q]||(F[Q]={}),_(q,F[Q],X[Q]);else if((0,e.isArray)(F)){let ie=X[Q];const fe=Z?t.PLACEHOLDER_UNDEFINED:void 0;W||(ie=typeof ie<"u"?ie:F[parseInt(Q,10)]),ie=ie!==t.PLACEHOLDER_UNDEFINED?ie:fe,F[parseInt(Q,10)]=ie}else{const ie=X[Q]!==t.PLACEHOLDER_UNDEFINED?X[Q]:void 0;F[Q]=ie}return _(q,F,...U)},T=function(q,F,U){return _({preservePlaceholder:U==null?void 0:U.preservePlaceholder,preserveUndefined:U==null?void 0:U.preserveUndefined},(0,e.cloneDeep)(q),(0,e.cloneDeep)(F))};e.mergeDeep=T;const A=function(q,F=[],U,X,Z){if(!(0,e.isObjectLike)(q))return q;for(const W in q){const Q=q[W],ie=(0,e.isArray)(q),fe=X?X+"."+W:W;Q===null&&(U===n.ConfigType.WHITELIST&&F.indexOf(fe)===-1||U===n.ConfigType.BLACKLIST&&F.indexOf(fe)!==-1)&&ie&&(q[parseInt(W,10)]=void 0),Q===void 0&&Z&&U===n.ConfigType.BLACKLIST&&F.indexOf(fe)===-1&&ie&&(q[parseInt(W,10)]=t.PLACEHOLDER_UNDEFINED),A(Q,F,U,fe,Z)}},I=function(q,F,U,X){const Z=(0,e.cloneDeep)(q);return A(Z,F,U,"",X),Z};e.preserveUndefined=I;const R=function(q,F,U){return U.indexOf(q)===F};e.unique=R;const D=function(q){return q.reduce((F,U)=>{const X=q.filter(Se=>Se===U),Z=q.filter(Se=>(U+".").indexOf(Se+".")===0),{duplicates:W,subsets:Q}=F,ie=X.length>1&&W.indexOf(U)===-1,fe=Z.length>1;return{duplicates:[...W,...ie?X:[]],subsets:[...Q,...fe?Z:[]].filter(e.unique).sort()}},{duplicates:[],subsets:[]})};e.findDuplicatesAndSubsets=D;const j=function(q,F,U){const X=U===n.ConfigType.WHITELIST?"whitelist":"blacklist",Z=`${t.PACKAGE_NAME}: incorrect ${X} configuration.`,W=`Check your create${U===n.ConfigType.WHITELIST?"White":"Black"}list arguments. + +`;if(!(0,e.isString)(F)||F.length<1)throw new Error(`${Z} Name (key) of reducer is required. ${W}`);if(!q||!q.length)return;const{duplicates:Q,subsets:ie}=(0,e.findDuplicatesAndSubsets)(q);if(Q.length>1)throw new Error(`${Z} Duplicated paths. + + ${JSON.stringify(Q)} + + ${W}`);if(ie.length>1)throw new Error(`${Z} You are trying to persist an entire property and also some of its subset. + +${JSON.stringify(ie)} + + ${W}`)};e.singleTransformValidator=j;const z=function(q){if(!(0,e.isArray)(q))return;const F=(q==null?void 0:q.map(U=>U.deepPersistKey).filter(U=>U))||[];if(F.length){const U=F.filter((X,Z)=>F.indexOf(X)!==Z);if(U.length)throw new Error(`${t.PACKAGE_NAME}: found duplicated keys in transforms creators. You can createWhitelist or createBlacklist for a specific root reducer key only once. Duplicated keys among createWhitelist and createBlacklist transforms are not allowed. + + Duplicates: ${JSON.stringify(U)}`)}};e.transformsValidator=z;const V=function({whitelist:q,blacklist:F}){if(q&&q.length&&F&&F.length)throw new Error(`${t.PACKAGE_NAME}: you should not define a whitelist and blacklist in parallel. It is allowed to use only one of these lists per config.`);if(q){const{duplicates:U,subsets:X}=(0,e.findDuplicatesAndSubsets)(q);(0,e.throwError)({duplicates:U,subsets:X},"whitelist")}if(F){const{duplicates:U,subsets:X}=(0,e.findDuplicatesAndSubsets)(F);(0,e.throwError)({duplicates:U,subsets:X},"blacklist")}};e.configValidator=V;const K=function({duplicates:q,subsets:F},U){if(q.length)throw new Error(`${t.PACKAGE_NAME}: duplicates of paths found in your ${U}. + + ${JSON.stringify(q)}`);if(F.length)throw new Error(`${t.PACKAGE_NAME}: subsets of some parent keys found in your ${U}. You must decide if you want to persist an entire path or its specific subset. + + ${JSON.stringify(F)}`)};e.throwError=K;const te=function(q){return(0,e.isArray)(q)?q.filter(e.unique).reduce((F,U)=>{const X=U.split("."),Z=X[0],W=X.slice(1).join(".")||void 0,Q=F.filter(fe=>Object.keys(fe)[0]===Z)[0],ie=Q?Object.values(Q)[0]:void 0;return Q||F.push({[Z]:W?[W]:void 0}),Q&&!ie&&W&&(Q[Z]=[W]),Q&&ie&&W&&ie.push(W),F},[]):[]};e.getRootKeysGroup=te})(RW);(function(e){var t=wo&&wo.__rest||function(h,m){var y={};for(var b in h)Object.prototype.hasOwnProperty.call(h,b)&&m.indexOf(b)<0&&(y[b]=h[b]);if(h!=null&&typeof Object.getOwnPropertySymbols=="function")for(var S=0,b=Object.getOwnPropertySymbols(h);S!E(_)&&h?h(k,_,T):k,out:(k,_,T)=>!E(_)&&m?m(k,_,T):k,deepPersistKey:b&&b[0]}},a=(h,m,y,{debug:b,whitelist:S,blacklist:E,transforms:k})=>{if(S||E)throw new Error("State reconciler autoMergeDeep uses custom transforms instead of old whitelist or blacklist config properties. Please use createWhitelist or createBlacklist transforms.");(0,n.transformsValidator)(k);const _=(0,n.cloneDeep)(y);let T=h;if(T&&(0,n.isObjectLike)(T)){const A=(0,n.difference)(m,y);(0,n.isEmpty)(A)||(T=(0,n.mergeDeep)(h,A,{preserveUndefined:!0}),b&&console.log(`${r.PACKAGE_NAME}/autoMergeDeep: sub state of your state was modified by reducer during rehydration. Values from reducer will be kept: ${JSON.stringify(A)}`)),Object.keys(T).forEach(I=>{if(I!=="_persist"){if((0,n.isObjectLike)(_[I])){_[I]=(0,n.mergeDeep)(_[I],T[I]);return}_[I]=T[I]}})}return b&&T&&(0,n.isObjectLike)(T)&&console.log(`${r.PACKAGE_NAME}/autoMergeDeep: rehydrated keys ${JSON.stringify(T)}`),_};e.autoMergeDeep=a;const s=(h,m)=>((0,n.singleTransformValidator)(m,h,i.ConfigType.WHITELIST),o(y=>{if(!m||!m.length)return y;let b=null,S;return m.forEach(E=>{const k=E.split(".");S=(0,n.path)(y,k),typeof S>"u"&&(0,n.isIntegerString)(k[k.length-1])&&(S=r.PLACEHOLDER_UNDEFINED);const _=(0,n.assocPath)(k,S),T=(0,n.isArray)(_)?[]:{};b=(0,n.mergeDeep)(b||T,_,{preservePlaceholder:!0})}),b||y},y=>(0,n.preserveUndefined)(y,m,i.ConfigType.WHITELIST),{whitelist:[h]}));e.createWhitelist=s;const l=(h,m)=>((0,n.singleTransformValidator)(m,h,i.ConfigType.BLACKLIST),o(y=>{if(!m||!m.length)return;const b=(0,n.preserveUndefined)(y,m,i.ConfigType.BLACKLIST,!0);return m.map(E=>E.split(".")).reduce((E,k)=>(0,n.dissocPath)(E,k),b)},y=>(0,n.preserveUndefined)(y,m,i.ConfigType.BLACKLIST),{whitelist:[h]}));e.createBlacklist=l;const u=function(h,m){return m.map(y=>{const b=Object.keys(y)[0],S=y[b];return h===i.ConfigType.WHITELIST?(0,e.createWhitelist)(b,S):(0,e.createBlacklist)(b,S)})};e.getTransforms=u;const d=h=>{var{key:m,whitelist:y,blacklist:b,storage:S,transforms:E,rootReducer:k}=h,_=t(h,["key","whitelist","blacklist","storage","transforms","rootReducer"]);(0,n.configValidator)({whitelist:y,blacklist:b});const T=(0,n.getRootKeysGroup)(y),A=(0,n.getRootKeysGroup)(b),I=Object.keys(k(void 0,{type:""})),R=T.map(te=>Object.keys(te)[0]),D=A.map(te=>Object.keys(te)[0]),j=I.filter(te=>R.indexOf(te)===-1&&D.indexOf(te)===-1),z=(0,e.getTransforms)(i.ConfigType.WHITELIST,T),V=(0,e.getTransforms)(i.ConfigType.BLACKLIST,A),K=(0,n.isArray)(y)?j.map(te=>(0,e.createBlacklist)(te)):[];return Object.assign(Object.assign({},_),{key:m,storage:S,transforms:[...z,...V,...K,...E||[]],stateReconciler:e.autoMergeDeep})};e.getPersistConfig=d})(IW);const Ed=(e,t)=>Math.floor(e/t)*t,Gl=(e,t)=>Math.round(e/t)*t;var Ee={},nxe={get exports(){return Ee},set exports(e){Ee=e}};/** + * @license + * Lodash + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */(function(e,t){(function(){var n,r="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",s="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",u=500,d="__lodash_placeholder__",h=1,m=2,y=4,b=1,S=2,E=1,k=2,_=4,T=8,A=16,I=32,R=64,D=128,j=256,z=512,V=30,K="...",te=800,q=16,F=1,U=2,X=3,Z=1/0,W=9007199254740991,Q=17976931348623157e292,ie=0/0,fe=4294967295,Se=fe-1,Te=fe>>>1,ye=[["ary",D],["bind",E],["bindKey",k],["curry",T],["curryRight",A],["flip",z],["partial",I],["partialRight",R],["rearg",j]],He="[object Arguments]",Ne="[object Array]",tt="[object AsyncFunction]",_e="[object Boolean]",lt="[object Date]",wt="[object DOMException]",ct="[object Error]",mt="[object Function]",St="[object GeneratorFunction]",Ae="[object Map]",ut="[object Number]",Mt="[object Null]",at="[object Object]",Ct="[object Promise]",Zt="[object Proxy]",le="[object RegExp]",De="[object Set]",Ue="[object String]",Ye="[object Symbol]",we="[object Undefined]",je="[object WeakMap]",_t="[object WeakSet]",Dt="[object ArrayBuffer]",Le="[object DataView]",At="[object Float32Array]",Fe="[object Float64Array]",vt="[object Int8Array]",nn="[object Int16Array]",Rn="[object Int32Array]",Ke="[object Uint8Array]",xt="[object Uint8ClampedArray]",ft="[object Uint16Array]",Ht="[object Uint32Array]",rn=/\b__p \+= '';/g,pr=/\b(__p \+=) '' \+/g,Mo=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Oi=/&(?:amp|lt|gt|quot|#39);/g,rl=/[&<>"']/g,I0=RegExp(Oi.source),Ba=RegExp(rl.source),kp=/<%-([\s\S]+?)%>/g,R0=/<%([\s\S]+?)%>/g,yc=/<%=([\s\S]+?)%>/g,Ep=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Pp=/^\w*$/,ia=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,vf=/[\\^$.*+?()[\]{}|]/g,D0=RegExp(vf.source),bc=/^\s+/,yf=/\s/,N0=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,il=/\{\n\/\* \[wrapped with (.+)\] \*/,Sc=/,? & /,j0=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,B0=/[()=,{}\[\]\/\s]/,F0=/\\(\\)?/g,$0=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,gs=/\w*$/,z0=/^[-+]0x[0-9a-f]+$/i,H0=/^0b[01]+$/i,V0=/^\[object .+?Constructor\]$/,W0=/^0o[0-7]+$/i,U0=/^(?:0|[1-9]\d*)$/,G0=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ol=/($^)/,q0=/['\n\r\u2028\u2029\\]/g,ms="\\ud800-\\udfff",vu="\\u0300-\\u036f",yu="\\ufe20-\\ufe2f",al="\\u20d0-\\u20ff",bu=vu+yu+al,Tp="\\u2700-\\u27bf",xc="a-z\\xdf-\\xf6\\xf8-\\xff",sl="\\xac\\xb1\\xd7\\xf7",oa="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Dn="\\u2000-\\u206f",Pn=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",aa="A-Z\\xc0-\\xd6\\xd8-\\xde",Hr="\\ufe0e\\ufe0f",li=sl+oa+Dn+Pn,sa="['’]",ll="["+ms+"]",ui="["+li+"]",vs="["+bu+"]",bf="\\d+",Su="["+Tp+"]",ys="["+xc+"]",Sf="[^"+ms+li+bf+Tp+xc+aa+"]",Mi="\\ud83c[\\udffb-\\udfff]",Lp="(?:"+vs+"|"+Mi+")",Ap="[^"+ms+"]",xf="(?:\\ud83c[\\udde6-\\uddff]){2}",ul="[\\ud800-\\udbff][\\udc00-\\udfff]",Io="["+aa+"]",cl="\\u200d",xu="(?:"+ys+"|"+Sf+")",Y0="(?:"+Io+"|"+Sf+")",wc="(?:"+sa+"(?:d|ll|m|re|s|t|ve))?",Cc="(?:"+sa+"(?:D|LL|M|RE|S|T|VE))?",wf=Lp+"?",_c="["+Hr+"]?",Fa="(?:"+cl+"(?:"+[Ap,xf,ul].join("|")+")"+_c+wf+")*",Cf="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",wu="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Yt=_c+wf+Fa,Op="(?:"+[Su,xf,ul].join("|")+")"+Yt,kc="(?:"+[Ap+vs+"?",vs,xf,ul,ll].join("|")+")",Ec=RegExp(sa,"g"),Mp=RegExp(vs,"g"),la=RegExp(Mi+"(?="+Mi+")|"+kc+Yt,"g"),Xn=RegExp([Io+"?"+ys+"+"+wc+"(?="+[ui,Io,"$"].join("|")+")",Y0+"+"+Cc+"(?="+[ui,Io+xu,"$"].join("|")+")",Io+"?"+xu+"+"+wc,Io+"+"+Cc,wu,Cf,bf,Op].join("|"),"g"),_f=RegExp("["+cl+ms+bu+Hr+"]"),Ip=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,kf=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Rp=-1,gn={};gn[At]=gn[Fe]=gn[vt]=gn[nn]=gn[Rn]=gn[Ke]=gn[xt]=gn[ft]=gn[Ht]=!0,gn[He]=gn[Ne]=gn[Dt]=gn[_e]=gn[Le]=gn[lt]=gn[ct]=gn[mt]=gn[Ae]=gn[ut]=gn[at]=gn[le]=gn[De]=gn[Ue]=gn[je]=!1;var Kt={};Kt[He]=Kt[Ne]=Kt[Dt]=Kt[Le]=Kt[_e]=Kt[lt]=Kt[At]=Kt[Fe]=Kt[vt]=Kt[nn]=Kt[Rn]=Kt[Ae]=Kt[ut]=Kt[at]=Kt[le]=Kt[De]=Kt[Ue]=Kt[Ye]=Kt[Ke]=Kt[xt]=Kt[ft]=Kt[Ht]=!0,Kt[ct]=Kt[mt]=Kt[je]=!1;var Dp={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},K0={"&":"&","<":"<",">":">",'"':""","'":"'"},Y={"&":"&","<":"<",">":">",""":'"',"'":"'"},re={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ge=parseFloat,it=parseInt,Wt=typeof wo=="object"&&wo&&wo.Object===Object&&wo,Sn=typeof self=="object"&&self&&self.Object===Object&&self,kt=Wt||Sn||Function("return this")(),Nt=t&&!t.nodeType&&t,Xt=Nt&&!0&&e&&!e.nodeType&&e,Jr=Xt&&Xt.exports===Nt,Ir=Jr&&Wt.process,xn=function(){try{var oe=Xt&&Xt.require&&Xt.require("util").types;return oe||Ir&&Ir.binding&&Ir.binding("util")}catch{}}(),ci=xn&&xn.isArrayBuffer,Ro=xn&&xn.isDate,uo=xn&&xn.isMap,$a=xn&&xn.isRegExp,dl=xn&&xn.isSet,X0=xn&&xn.isTypedArray;function Ii(oe,xe,ve){switch(ve.length){case 0:return oe.call(xe);case 1:return oe.call(xe,ve[0]);case 2:return oe.call(xe,ve[0],ve[1]);case 3:return oe.call(xe,ve[0],ve[1],ve[2])}return oe.apply(xe,ve)}function Z0(oe,xe,ve,nt){for(var It=-1,on=oe==null?0:oe.length;++It-1}function Np(oe,xe,ve){for(var nt=-1,It=oe==null?0:oe.length;++nt-1;);return ve}function bs(oe,xe){for(var ve=oe.length;ve--&&Lc(xe,oe[ve],0)>-1;);return ve}function J0(oe,xe){for(var ve=oe.length,nt=0;ve--;)oe[ve]===xe&&++nt;return nt}var Jy=Lf(Dp),Ss=Lf(K0);function hl(oe){return"\\"+re[oe]}function Bp(oe,xe){return oe==null?n:oe[xe]}function _u(oe){return _f.test(oe)}function Fp(oe){return Ip.test(oe)}function e3(oe){for(var xe,ve=[];!(xe=oe.next()).done;)ve.push(xe.value);return ve}function $p(oe){var xe=-1,ve=Array(oe.size);return oe.forEach(function(nt,It){ve[++xe]=[It,nt]}),ve}function zp(oe,xe){return function(ve){return oe(xe(ve))}}function da(oe,xe){for(var ve=-1,nt=oe.length,It=0,on=[];++ve-1}function b3(c,g){var C=this.__data__,O=Wr(C,c);return O<0?(++this.size,C.push([c,g])):C[O][1]=g,this}fa.prototype.clear=v3,fa.prototype.delete=y3,fa.prototype.get=p1,fa.prototype.has=g1,fa.prototype.set=b3;function ha(c){var g=-1,C=c==null?0:c.length;for(this.clear();++g=g?c:g)),c}function wi(c,g,C,O,B,H){var J,ne=g&h,ce=g&m,ke=g&y;if(C&&(J=B?C(c,O,B,H):C(c)),J!==n)return J;if(!wr(c))return c;var Pe=$t(c);if(Pe){if(J=BK(c),!ne)return Fi(c,J)}else{var Re=ki(c),et=Re==mt||Re==St;if(rd(c))return _l(c,ne);if(Re==at||Re==He||et&&!B){if(J=ce||et?{}:ST(c),!ne)return ce?I1(c,qc(J,c)):zo(c,st(J,c))}else{if(!Kt[Re])return B?c:{};J=FK(c,Re,ne)}}H||(H=new Dr);var bt=H.get(c);if(bt)return bt;H.set(c,J),KT(c)?c.forEach(function(Tt){J.add(wi(Tt,g,C,Tt,c,H))}):qT(c)&&c.forEach(function(Tt,Jt){J.set(Jt,wi(Tt,g,C,Jt,c,H))});var Pt=ke?ce?me:ya:ce?Vo:Ei,qt=Pe?n:Pt(c);return Zn(qt||c,function(Tt,Jt){qt&&(Jt=Tt,Tt=c[Jt]),ml(J,Jt,wi(Tt,g,C,Jt,c,H))}),J}function Kp(c){var g=Ei(c);return function(C){return Xp(C,c,g)}}function Xp(c,g,C){var O=C.length;if(c==null)return!O;for(c=mn(c);O--;){var B=C[O],H=g[B],J=c[B];if(J===n&&!(B in c)||!H(J))return!1}return!0}function b1(c,g,C){if(typeof c!="function")throw new Ri(a);return B1(function(){c.apply(n,C)},g)}function Yc(c,g,C,O){var B=-1,H=Ki,J=!0,ne=c.length,ce=[],ke=g.length;if(!ne)return ce;C&&(g=Un(g,Vr(C))),O?(H=Np,J=!1):g.length>=i&&(H=Oc,J=!1,g=new Wa(g));e:for(;++BB?0:B+C),O=O===n||O>B?B:Vt(O),O<0&&(O+=B),O=C>O?0:ZT(O);C0&&C(ne)?g>1?Ur(ne,g-1,C,O,B):za(B,ne):O||(B[B.length]=ne)}return B}var Qp=kl(),Bo=kl(!0);function va(c,g){return c&&Qp(c,g,Ei)}function Fo(c,g){return c&&Bo(c,g,Ei)}function Jp(c,g){return No(g,function(C){return Iu(c[C])})}function vl(c,g){g=Cl(g,c);for(var C=0,O=g.length;c!=null&&Cg}function tg(c,g){return c!=null&&un.call(c,g)}function ng(c,g){return c!=null&&g in mn(c)}function rg(c,g,C){return c>=fi(g,C)&&c=120&&Pe.length>=120)?new Wa(J&&Pe):n}Pe=c[0];var Re=-1,et=ne[0];e:for(;++Re-1;)ne!==c&&jf.call(ne,ce,1),jf.call(c,ce,1);return c}function Gf(c,g){for(var C=c?g.length:0,O=C-1;C--;){var B=g[C];if(C==O||B!==H){var H=B;Mu(B)?jf.call(c,B,1):hg(c,B)}}return c}function qf(c,g){return c+Eu(l1()*(g-c+1))}function xl(c,g,C,O){for(var B=-1,H=Rr($f((g-c)/(C||1)),0),J=ve(H);H--;)J[O?H:++B]=c,c+=C;return J}function ed(c,g){var C="";if(!c||g<1||g>W)return C;do g%2&&(C+=c),g=Eu(g/2),g&&(c+=c);while(g);return C}function Ot(c,g){return Lw(CT(c,g,Wo),c+"")}function lg(c){return Gc(Sg(c))}function Yf(c,g){var C=Sg(c);return P3(C,Tu(g,0,C.length))}function Au(c,g,C,O){if(!wr(c))return c;g=Cl(g,c);for(var B=-1,H=g.length,J=H-1,ne=c;ne!=null&&++BB?0:B+g),C=C>B?B:C,C<0&&(C+=B),B=g>C?0:C-g>>>0,g>>>=0;for(var H=ve(B);++O>>1,J=c[H];J!==null&&!ba(J)&&(C?J<=g:J=i){var ke=g?null:G(c);if(ke)return If(ke);J=!1,B=Oc,ce=new Wa}else ce=g?[]:ne;e:for(;++O=O?c:qr(c,g,C)}var L1=o3||function(c){return kt.clearTimeout(c)};function _l(c,g){if(g)return c.slice();var C=c.length,O=Nc?Nc(C):new c.constructor(C);return c.copy(O),O}function A1(c){var g=new c.constructor(c.byteLength);return new Di(g).set(new Di(c)),g}function Ou(c,g){var C=g?A1(c.buffer):c.buffer;return new c.constructor(C,c.byteOffset,c.byteLength)}function C3(c){var g=new c.constructor(c.source,gs.exec(c));return g.lastIndex=c.lastIndex,g}function Qn(c){return Hf?mn(Hf.call(c)):{}}function _3(c,g){var C=g?A1(c.buffer):c.buffer;return new c.constructor(C,c.byteOffset,c.length)}function O1(c,g){if(c!==g){var C=c!==n,O=c===null,B=c===c,H=ba(c),J=g!==n,ne=g===null,ce=g===g,ke=ba(g);if(!ne&&!ke&&!H&&c>g||H&&J&&ce&&!ne&&!ke||O&&J&&ce||!C&&ce||!B)return 1;if(!O&&!H&&!ke&&c=ne)return ce;var ke=C[O];return ce*(ke=="desc"?-1:1)}}return c.index-g.index}function k3(c,g,C,O){for(var B=-1,H=c.length,J=C.length,ne=-1,ce=g.length,ke=Rr(H-J,0),Pe=ve(ce+ke),Re=!O;++ne1?C[B-1]:n,J=B>2?C[2]:n;for(H=c.length>3&&typeof H=="function"?(B--,H):n,J&&mo(C[0],C[1],J)&&(H=B<3?n:H,B=1),g=mn(g);++O-1?B[H?g[J]:J]:n}}function D1(c){return mr(function(g){var C=g.length,O=C,B=fo.prototype.thru;for(c&&g.reverse();O--;){var H=g[O];if(typeof H!="function")throw new Ri(a);if(B&&!J&&be(H)=="wrapper")var J=new fo([],!0)}for(O=J?O:C;++O1&&an.reverse(),Pe&&cene))return!1;var ke=H.get(c),Pe=H.get(g);if(ke&&Pe)return ke==g&&Pe==c;var Re=-1,et=!0,bt=C&S?new Wa:n;for(H.set(c,g),H.set(g,c);++Re1?"& ":"")+g[O],g=g.join(C>2?", ":" "),c.replace(N0,`{ +/* [wrapped with `+g+`] */ +`)}function zK(c){return $t(c)||nh(c)||!!(a1&&c&&c[a1])}function Mu(c,g){var C=typeof c;return g=g??W,!!g&&(C=="number"||C!="symbol"&&U0.test(c))&&c>-1&&c%1==0&&c0){if(++g>=te)return arguments[0]}else g=0;return c.apply(n,arguments)}}function P3(c,g){var C=-1,O=c.length,B=O-1;for(g=g===n?O:g;++C1?c[g-1]:n;return C=typeof C=="function"?(c.pop(),C):n,DT(c,C)});function NT(c){var g=$(c);return g.__chain__=!0,g}function QX(c,g){return g(c),c}function T3(c,g){return g(c)}var JX=mr(function(c){var g=c.length,C=g?c[0]:0,O=this.__wrapped__,B=function(H){return Yp(H,c)};return g>1||this.__actions__.length||!(O instanceof Qt)||!Mu(C)?this.thru(B):(O=O.slice(C,+C+(g?1:0)),O.__actions__.push({func:T3,args:[B],thisArg:n}),new fo(O,this.__chain__).thru(function(H){return g&&!H.length&&H.push(n),H}))});function eZ(){return NT(this)}function tZ(){return new fo(this.value(),this.__chain__)}function nZ(){this.__values__===n&&(this.__values__=XT(this.value()));var c=this.__index__>=this.__values__.length,g=c?n:this.__values__[this.__index__++];return{done:c,value:g}}function rZ(){return this}function iZ(c){for(var g,C=this;C instanceof Vf;){var O=LT(C);O.__index__=0,O.__values__=n,g?B.__wrapped__=O:g=O;var B=O;C=C.__wrapped__}return B.__wrapped__=c,g}function oZ(){var c=this.__wrapped__;if(c instanceof Qt){var g=c;return this.__actions__.length&&(g=new Qt(this)),g=g.reverse(),g.__actions__.push({func:T3,args:[Aw],thisArg:n}),new fo(g,this.__chain__)}return this.thru(Aw)}function aZ(){return wl(this.__wrapped__,this.__actions__)}var sZ=gg(function(c,g,C){un.call(c,C)?++c[C]:pa(c,C,1)});function lZ(c,g,C){var O=$t(c)?Wn:S1;return C&&mo(c,g,C)&&(g=n),O(c,Me(g,3))}function uZ(c,g){var C=$t(c)?No:ma;return C(c,Me(g,3))}var cZ=R1(AT),dZ=R1(OT);function fZ(c,g){return Ur(L3(c,g),1)}function hZ(c,g){return Ur(L3(c,g),Z)}function pZ(c,g,C){return C=C===n?1:Vt(C),Ur(L3(c,g),C)}function jT(c,g){var C=$t(c)?Zn:Cs;return C(c,Me(g,3))}function BT(c,g){var C=$t(c)?Do:Zp;return C(c,Me(g,3))}var gZ=gg(function(c,g,C){un.call(c,C)?c[C].push(g):pa(c,C,[g])});function mZ(c,g,C,O){c=Ho(c)?c:Sg(c),C=C&&!O?Vt(C):0;var B=c.length;return C<0&&(C=Rr(B+C,0)),R3(c)?C<=B&&c.indexOf(g,C)>-1:!!B&&Lc(c,g,C)>-1}var vZ=Ot(function(c,g,C){var O=-1,B=typeof g=="function",H=Ho(c)?ve(c.length):[];return Cs(c,function(J){H[++O]=B?Ii(g,J,C):_s(J,g,C)}),H}),yZ=gg(function(c,g,C){pa(c,C,g)});function L3(c,g){var C=$t(c)?Un:jr;return C(c,Me(g,3))}function bZ(c,g,C,O){return c==null?[]:($t(g)||(g=g==null?[]:[g]),C=O?n:C,$t(C)||(C=C==null?[]:[C]),ji(c,g,C))}var SZ=gg(function(c,g,C){c[C?0:1].push(g)},function(){return[[],[]]});function xZ(c,g,C){var O=$t(c)?Ef:jp,B=arguments.length<3;return O(c,Me(g,4),C,B,Cs)}function wZ(c,g,C){var O=$t(c)?Ky:jp,B=arguments.length<3;return O(c,Me(g,4),C,B,Zp)}function CZ(c,g){var C=$t(c)?No:ma;return C(c,M3(Me(g,3)))}function _Z(c){var g=$t(c)?Gc:lg;return g(c)}function kZ(c,g,C){(C?mo(c,g,C):g===n)?g=1:g=Vt(g);var O=$t(c)?xi:Yf;return O(c,g)}function EZ(c){var g=$t(c)?xw:_i;return g(c)}function PZ(c){if(c==null)return 0;if(Ho(c))return R3(c)?Ha(c):c.length;var g=ki(c);return g==Ae||g==De?c.size:Gr(c).length}function TZ(c,g,C){var O=$t(c)?Pc:$o;return C&&mo(c,g,C)&&(g=n),O(c,Me(g,3))}var LZ=Ot(function(c,g){if(c==null)return[];var C=g.length;return C>1&&mo(c,g[0],g[1])?g=[]:C>2&&mo(g[0],g[1],g[2])&&(g=[g[0]]),ji(c,Ur(g,1),[])}),A3=a3||function(){return kt.Date.now()};function AZ(c,g){if(typeof g!="function")throw new Ri(a);return c=Vt(c),function(){if(--c<1)return g.apply(this,arguments)}}function FT(c,g,C){return g=C?n:g,g=c&&g==null?c.length:g,pe(c,D,n,n,n,n,g)}function $T(c,g){var C;if(typeof g!="function")throw new Ri(a);return c=Vt(c),function(){return--c>0&&(C=g.apply(this,arguments)),c<=1&&(g=n),C}}var Mw=Ot(function(c,g,C){var O=E;if(C.length){var B=da(C,Je(Mw));O|=I}return pe(c,O,g,C,B)}),zT=Ot(function(c,g,C){var O=E|k;if(C.length){var B=da(C,Je(zT));O|=I}return pe(g,O,c,C,B)});function HT(c,g,C){g=C?n:g;var O=pe(c,T,n,n,n,n,n,g);return O.placeholder=HT.placeholder,O}function VT(c,g,C){g=C?n:g;var O=pe(c,A,n,n,n,n,n,g);return O.placeholder=VT.placeholder,O}function WT(c,g,C){var O,B,H,J,ne,ce,ke=0,Pe=!1,Re=!1,et=!0;if(typeof c!="function")throw new Ri(a);g=qa(g)||0,wr(C)&&(Pe=!!C.leading,Re="maxWait"in C,H=Re?Rr(qa(C.maxWait)||0,g):H,et="trailing"in C?!!C.trailing:et);function bt(Kr){var Ls=O,Du=B;return O=B=n,ke=Kr,J=c.apply(Du,Ls),J}function Pt(Kr){return ke=Kr,ne=B1(Jt,g),Pe?bt(Kr):J}function qt(Kr){var Ls=Kr-ce,Du=Kr-ke,uL=g-Ls;return Re?fi(uL,H-Du):uL}function Tt(Kr){var Ls=Kr-ce,Du=Kr-ke;return ce===n||Ls>=g||Ls<0||Re&&Du>=H}function Jt(){var Kr=A3();if(Tt(Kr))return an(Kr);ne=B1(Jt,qt(Kr))}function an(Kr){return ne=n,et&&O?bt(Kr):(O=B=n,J)}function Sa(){ne!==n&&L1(ne),ke=0,O=ce=B=ne=n}function vo(){return ne===n?J:an(A3())}function xa(){var Kr=A3(),Ls=Tt(Kr);if(O=arguments,B=this,ce=Kr,Ls){if(ne===n)return Pt(ce);if(Re)return L1(ne),ne=B1(Jt,g),bt(ce)}return ne===n&&(ne=B1(Jt,g)),J}return xa.cancel=Sa,xa.flush=vo,xa}var OZ=Ot(function(c,g){return b1(c,1,g)}),MZ=Ot(function(c,g,C){return b1(c,qa(g)||0,C)});function IZ(c){return pe(c,z)}function O3(c,g){if(typeof c!="function"||g!=null&&typeof g!="function")throw new Ri(a);var C=function(){var O=arguments,B=g?g.apply(this,O):O[0],H=C.cache;if(H.has(B))return H.get(B);var J=c.apply(this,O);return C.cache=H.set(B,J)||H,J};return C.cache=new(O3.Cache||ha),C}O3.Cache=ha;function M3(c){if(typeof c!="function")throw new Ri(a);return function(){var g=arguments;switch(g.length){case 0:return!c.call(this);case 1:return!c.call(this,g[0]);case 2:return!c.call(this,g[0],g[1]);case 3:return!c.call(this,g[0],g[1],g[2])}return!c.apply(this,g)}}function RZ(c){return $T(2,c)}var DZ=_w(function(c,g){g=g.length==1&&$t(g[0])?Un(g[0],Vr(Me())):Un(Ur(g,1),Vr(Me()));var C=g.length;return Ot(function(O){for(var B=-1,H=fi(O.length,C);++B=g}),nh=og(function(){return arguments}())?og:function(c){return Br(c)&&un.call(c,"callee")&&!o1.call(c,"callee")},$t=ve.isArray,XZ=ci?Vr(ci):w1;function Ho(c){return c!=null&&I3(c.length)&&!Iu(c)}function Yr(c){return Br(c)&&Ho(c)}function ZZ(c){return c===!0||c===!1||Br(c)&&Ci(c)==_e}var rd=s3||Ww,QZ=Ro?Vr(Ro):C1;function JZ(c){return Br(c)&&c.nodeType===1&&!F1(c)}function eQ(c){if(c==null)return!0;if(Ho(c)&&($t(c)||typeof c=="string"||typeof c.splice=="function"||rd(c)||bg(c)||nh(c)))return!c.length;var g=ki(c);if(g==Ae||g==De)return!c.size;if(j1(c))return!Gr(c).length;for(var C in c)if(un.call(c,C))return!1;return!0}function tQ(c,g){return Xc(c,g)}function nQ(c,g,C){C=typeof C=="function"?C:n;var O=C?C(c,g):n;return O===n?Xc(c,g,n,C):!!O}function Rw(c){if(!Br(c))return!1;var g=Ci(c);return g==ct||g==wt||typeof c.message=="string"&&typeof c.name=="string"&&!F1(c)}function rQ(c){return typeof c=="number"&&Wp(c)}function Iu(c){if(!wr(c))return!1;var g=Ci(c);return g==mt||g==St||g==tt||g==Zt}function GT(c){return typeof c=="number"&&c==Vt(c)}function I3(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=W}function wr(c){var g=typeof c;return c!=null&&(g=="object"||g=="function")}function Br(c){return c!=null&&typeof c=="object"}var qT=uo?Vr(uo):Cw;function iQ(c,g){return c===g||Zc(c,g,Rt(g))}function oQ(c,g,C){return C=typeof C=="function"?C:n,Zc(c,g,Rt(g),C)}function aQ(c){return YT(c)&&c!=+c}function sQ(c){if(WK(c))throw new It(o);return ag(c)}function lQ(c){return c===null}function uQ(c){return c==null}function YT(c){return typeof c=="number"||Br(c)&&Ci(c)==ut}function F1(c){if(!Br(c)||Ci(c)!=at)return!1;var g=jc(c);if(g===null)return!0;var C=un.call(g,"constructor")&&g.constructor;return typeof C=="function"&&C instanceof C&&br.call(C)==Si}var Dw=$a?Vr($a):Sr;function cQ(c){return GT(c)&&c>=-W&&c<=W}var KT=dl?Vr(dl):Ut;function R3(c){return typeof c=="string"||!$t(c)&&Br(c)&&Ci(c)==Ue}function ba(c){return typeof c=="symbol"||Br(c)&&Ci(c)==Ye}var bg=X0?Vr(X0):ei;function dQ(c){return c===n}function fQ(c){return Br(c)&&ki(c)==je}function hQ(c){return Br(c)&&Ci(c)==_t}var pQ=P(yl),gQ=P(function(c,g){return c<=g});function XT(c){if(!c)return[];if(Ho(c))return R3(c)?Xi(c):Fi(c);if(Bc&&c[Bc])return e3(c[Bc]());var g=ki(c),C=g==Ae?$p:g==De?If:Sg;return C(c)}function Ru(c){if(!c)return c===0?c:0;if(c=qa(c),c===Z||c===-Z){var g=c<0?-1:1;return g*Q}return c===c?c:0}function Vt(c){var g=Ru(c),C=g%1;return g===g?C?g-C:g:0}function ZT(c){return c?Tu(Vt(c),0,fe):0}function qa(c){if(typeof c=="number")return c;if(ba(c))return ie;if(wr(c)){var g=typeof c.valueOf=="function"?c.valueOf():c;c=wr(g)?g+"":g}if(typeof c!="string")return c===0?c:+c;c=co(c);var C=H0.test(c);return C||W0.test(c)?it(c.slice(2),C?2:8):z0.test(c)?ie:+c}function QT(c){return Ua(c,Vo(c))}function mQ(c){return c?Tu(Vt(c),-W,W):c===0?c:0}function Ln(c){return c==null?"":po(c)}var vQ=go(function(c,g){if(j1(g)||Ho(g)){Ua(g,Ei(g),c);return}for(var C in g)un.call(g,C)&&ml(c,C,g[C])}),JT=go(function(c,g){Ua(g,Vo(g),c)}),D3=go(function(c,g,C,O){Ua(g,Vo(g),c,O)}),yQ=go(function(c,g,C,O){Ua(g,Ei(g),c,O)}),bQ=mr(Yp);function SQ(c,g){var C=Pu(c);return g==null?C:st(C,g)}var xQ=Ot(function(c,g){c=mn(c);var C=-1,O=g.length,B=O>2?g[2]:n;for(B&&mo(g[0],g[1],B)&&(O=1);++C1),H}),Ua(c,me(c),C),O&&(C=wi(C,h|m|y,jt));for(var B=g.length;B--;)hg(C,g[B]);return C});function FQ(c,g){return tL(c,M3(Me(g)))}var $Q=mr(function(c,g){return c==null?{}:E1(c,g)});function tL(c,g){if(c==null)return{};var C=Un(me(c),function(O){return[O]});return g=Me(g),sg(c,C,function(O,B){return g(O,B[0])})}function zQ(c,g,C){g=Cl(g,c);var O=-1,B=g.length;for(B||(B=1,c=n);++Og){var O=c;c=g,g=O}if(C||c%1||g%1){var B=l1();return fi(c+B*(g-c+ge("1e-"+((B+"").length-1))),g)}return qf(c,g)}var QQ=El(function(c,g,C){return g=g.toLowerCase(),c+(C?iL(g):g)});function iL(c){return Bw(Ln(c).toLowerCase())}function oL(c){return c=Ln(c),c&&c.replace(G0,Jy).replace(Mp,"")}function JQ(c,g,C){c=Ln(c),g=po(g);var O=c.length;C=C===n?O:Tu(Vt(C),0,O);var B=C;return C-=g.length,C>=0&&c.slice(C,B)==g}function eJ(c){return c=Ln(c),c&&Ba.test(c)?c.replace(rl,Ss):c}function tJ(c){return c=Ln(c),c&&D0.test(c)?c.replace(vf,"\\$&"):c}var nJ=El(function(c,g,C){return c+(C?"-":"")+g.toLowerCase()}),rJ=El(function(c,g,C){return c+(C?" ":"")+g.toLowerCase()}),iJ=vg("toLowerCase");function oJ(c,g,C){c=Ln(c),g=Vt(g);var O=g?Ha(c):0;if(!g||O>=g)return c;var B=(g-O)/2;return f(Eu(B),C)+c+f($f(B),C)}function aJ(c,g,C){c=Ln(c),g=Vt(g);var O=g?Ha(c):0;return g&&O>>0,C?(c=Ln(c),c&&(typeof g=="string"||g!=null&&!Dw(g))&&(g=po(g),!g&&_u(c))?Es(Xi(c),0,C):c.split(g,C)):[]}var hJ=El(function(c,g,C){return c+(C?" ":"")+Bw(g)});function pJ(c,g,C){return c=Ln(c),C=C==null?0:Tu(Vt(C),0,c.length),g=po(g),c.slice(C,C+g.length)==g}function gJ(c,g,C){var O=$.templateSettings;C&&mo(c,g,C)&&(g=n),c=Ln(c),g=D3({},g,O,ze);var B=D3({},g.imports,O.imports,ze),H=Ei(B),J=Mf(B,H),ne,ce,ke=0,Pe=g.interpolate||ol,Re="__p += '",et=Df((g.escape||ol).source+"|"+Pe.source+"|"+(Pe===yc?$0:ol).source+"|"+(g.evaluate||ol).source+"|$","g"),bt="//# sourceURL="+(un.call(g,"sourceURL")?(g.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Rp+"]")+` +`;c.replace(et,function(Tt,Jt,an,Sa,vo,xa){return an||(an=Sa),Re+=c.slice(ke,xa).replace(q0,hl),Jt&&(ne=!0,Re+=`' + +__e(`+Jt+`) + +'`),vo&&(ce=!0,Re+=`'; +`+vo+`; +__p += '`),an&&(Re+=`' + +((__t = (`+an+`)) == null ? '' : __t) + +'`),ke=xa+Tt.length,Tt}),Re+=`'; +`;var Pt=un.call(g,"variable")&&g.variable;if(!Pt)Re=`with (obj) { +`+Re+` +} +`;else if(B0.test(Pt))throw new It(s);Re=(ce?Re.replace(rn,""):Re).replace(pr,"$1").replace(Mo,"$1;"),Re="function("+(Pt||"obj")+`) { +`+(Pt?"":`obj || (obj = {}); +`)+"var __t, __p = ''"+(ne?", __e = _.escape":"")+(ce?`, __j = Array.prototype.join; +function print() { __p += __j.call(arguments, '') } +`:`; +`)+Re+`return __p +}`;var qt=sL(function(){return on(H,bt+"return "+Re).apply(n,J)});if(qt.source=Re,Rw(qt))throw qt;return qt}function mJ(c){return Ln(c).toLowerCase()}function vJ(c){return Ln(c).toUpperCase()}function yJ(c,g,C){if(c=Ln(c),c&&(C||g===n))return co(c);if(!c||!(g=po(g)))return c;var O=Xi(c),B=Xi(g),H=ca(O,B),J=bs(O,B)+1;return Es(O,H,J).join("")}function bJ(c,g,C){if(c=Ln(c),c&&(C||g===n))return c.slice(0,t1(c)+1);if(!c||!(g=po(g)))return c;var O=Xi(c),B=bs(O,Xi(g))+1;return Es(O,0,B).join("")}function SJ(c,g,C){if(c=Ln(c),c&&(C||g===n))return c.replace(bc,"");if(!c||!(g=po(g)))return c;var O=Xi(c),B=ca(O,Xi(g));return Es(O,B).join("")}function xJ(c,g){var C=V,O=K;if(wr(g)){var B="separator"in g?g.separator:B;C="length"in g?Vt(g.length):C,O="omission"in g?po(g.omission):O}c=Ln(c);var H=c.length;if(_u(c)){var J=Xi(c);H=J.length}if(C>=H)return c;var ne=C-Ha(O);if(ne<1)return O;var ce=J?Es(J,0,ne).join(""):c.slice(0,ne);if(B===n)return ce+O;if(J&&(ne+=ce.length-ne),Dw(B)){if(c.slice(ne).search(B)){var ke,Pe=ce;for(B.global||(B=Df(B.source,Ln(gs.exec(B))+"g")),B.lastIndex=0;ke=B.exec(Pe);)var Re=ke.index;ce=ce.slice(0,Re===n?ne:Re)}}else if(c.indexOf(po(B),ne)!=ne){var et=ce.lastIndexOf(B);et>-1&&(ce=ce.slice(0,et))}return ce+O}function wJ(c){return c=Ln(c),c&&I0.test(c)?c.replace(Oi,r3):c}var CJ=El(function(c,g,C){return c+(C?" ":"")+g.toUpperCase()}),Bw=vg("toUpperCase");function aL(c,g,C){return c=Ln(c),g=C?n:g,g===n?Fp(c)?Rf(c):Q0(c):c.match(g)||[]}var sL=Ot(function(c,g){try{return Ii(c,n,g)}catch(C){return Rw(C)?C:new It(C)}}),_J=mr(function(c,g){return Zn(g,function(C){C=Pl(C),pa(c,C,Mw(c[C],c))}),c});function kJ(c){var g=c==null?0:c.length,C=Me();return c=g?Un(c,function(O){if(typeof O[1]!="function")throw new Ri(a);return[C(O[0]),O[1]]}):[],Ot(function(O){for(var B=-1;++BW)return[];var C=fe,O=fi(c,fe);g=Me(g),c-=fe;for(var B=Of(O,g);++C0||g<0)?new Qt(C):(c<0?C=C.takeRight(-c):c&&(C=C.drop(c)),g!==n&&(g=Vt(g),C=g<0?C.dropRight(-g):C.take(g-c)),C)},Qt.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},Qt.prototype.toArray=function(){return this.take(fe)},va(Qt.prototype,function(c,g){var C=/^(?:filter|find|map|reject)|While$/.test(g),O=/^(?:head|last)$/.test(g),B=$[O?"take"+(g=="last"?"Right":""):g],H=O||/^find/.test(g);B&&($.prototype[g]=function(){var J=this.__wrapped__,ne=O?[1]:arguments,ce=J instanceof Qt,ke=ne[0],Pe=ce||$t(J),Re=function(Jt){var an=B.apply($,za([Jt],ne));return O&&et?an[0]:an};Pe&&C&&typeof ke=="function"&&ke.length!=1&&(ce=Pe=!1);var et=this.__chain__,bt=!!this.__actions__.length,Pt=H&&!et,qt=ce&&!bt;if(!H&&Pe){J=qt?J:new Qt(this);var Tt=c.apply(J,ne);return Tt.__actions__.push({func:T3,args:[Re],thisArg:n}),new fo(Tt,et)}return Pt&&qt?c.apply(this,ne):(Tt=this.thru(Re),Pt?O?Tt.value()[0]:Tt.value():Tt)})}),Zn(["pop","push","shift","sort","splice","unshift"],function(c){var g=Ic[c],C=/^(?:push|sort|unshift)$/.test(c)?"tap":"thru",O=/^(?:pop|shift)$/.test(c);$.prototype[c]=function(){var B=arguments;if(O&&!this.__chain__){var H=this.value();return g.apply($t(H)?H:[],B)}return this[C](function(J){return g.apply($t(J)?J:[],B)})}}),va(Qt.prototype,function(c,g){var C=$[g];if(C){var O=C.name+"";un.call(xs,O)||(xs[O]=[]),xs[O].push({name:g,func:C})}}),xs[Jf(n,k).name]=[{name:"wrapper",func:n}],Qt.prototype.clone=Zi,Qt.prototype.reverse=Ni,Qt.prototype.value=f3,$.prototype.at=JX,$.prototype.chain=eZ,$.prototype.commit=tZ,$.prototype.next=nZ,$.prototype.plant=iZ,$.prototype.reverse=oZ,$.prototype.toJSON=$.prototype.valueOf=$.prototype.value=aZ,$.prototype.first=$.prototype.head,Bc&&($.prototype[Bc]=rZ),$},Va=jo();Xt?((Xt.exports=Va)._=Va,Nt._=Va):kt._=Va}).call(wo)})(nxe,Ee);const Ag=(e,t,n,r,i,o,a)=>{const s=e/2-(n+i/2)*a,l=t/2-(r+o/2)*a;return{x:s,y:l}},Og=(e,t,n,r,i=.95)=>{const o=e*i/n,a=t*i/r;return Math.min(1,Math.min(o,a))},rxe=.999,ixe=.1,oxe=20,nv=.95,RI=30,l8=10,DI=e=>({x:Math.floor(e.x),y:Math.floor(e.y)}),oh=e=>{const{width:t,height:n}=e,r={width:t,height:n},i=512*512,o=t/n;let a=t*n,s=448;for(;a1?(r.width=s,r.height=Gl(s/o,64)):o<1&&(r.height=s,r.width=Gl(s*o,64)),a=r.width*r.height;return r},axe=e=>({width:Gl(e.width,64),height:Gl(e.height,64)}),DW=[{key:"Base",value:"base"},{key:"Mask",value:"mask"}],sxe=[{key:"Auto",value:"auto"},{key:"Manual",value:"manual"},{key:"None",value:"none"}],tP=e=>e.kind==="line"&&e.layer==="mask",lxe=e=>e.kind==="line"&&e.layer==="base",U5=e=>e.kind==="image"&&e.layer==="base",uxe=e=>e.kind==="fillRect"&&e.layer==="base",cxe=e=>e.kind==="eraseRect"&&e.layer==="base",dxe=e=>e.kind==="line",kv={objects:[],stagingArea:{images:[],selectedImageIndex:-1}},fxe={boundingBoxCoordinates:{x:0,y:0},boundingBoxDimensions:{width:512,height:512},boundingBoxPreviewFill:{r:0,g:0,b:0,a:.5},boundingBoxScaleMethod:"auto",brushColor:{r:90,g:90,b:255,a:1},brushSize:50,canvasContainerDimensions:{width:0,height:0},colorPickerColor:{r:90,g:90,b:255,a:1},cursorPosition:null,doesCanvasNeedScaling:!1,futureLayerStates:[],isCanvasInitialized:!1,isDrawing:!1,isMaskEnabled:!0,isMouseOverBoundingBox:!1,isMoveBoundingBoxKeyHeld:!1,isMoveStageKeyHeld:!1,isMovingBoundingBox:!1,isMovingStage:!1,isTransformingBoundingBox:!1,layer:"base",layerState:kv,maskColor:{r:255,g:90,b:90,a:1},maxHistory:128,minimumStageScale:1,pastLayerStates:[],scaledBoundingBoxDimensions:{width:512,height:512},shouldAutoSave:!1,shouldCropToBoundingBoxOnSave:!1,shouldDarkenOutsideBoundingBox:!1,shouldLockBoundingBox:!1,shouldPreserveMaskedArea:!1,shouldRestrictStrokesToBox:!0,shouldShowBoundingBox:!0,shouldShowBrush:!0,shouldShowBrushPreview:!1,shouldShowCanvasDebugInfo:!1,shouldShowCheckboardTransparency:!1,shouldShowGrid:!0,shouldShowIntermediates:!0,shouldShowStagingImage:!0,shouldShowStagingOutline:!0,shouldSnapToGrid:!0,stageCoordinates:{x:0,y:0},stageDimensions:{width:0,height:0},stageScale:1,tool:"brush"},NW=cp({name:"canvas",initialState:fxe,reducers:{setTool:(e,t)=>{const n=t.payload;e.tool=t.payload,n!=="move"&&(e.isTransformingBoundingBox=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1)},setLayer:(e,t)=>{e.layer=t.payload},toggleTool:e=>{const t=e.tool;t!=="move"&&(e.tool=t==="brush"?"eraser":"brush")},setMaskColor:(e,t)=>{e.maskColor=t.payload},setBrushColor:(e,t)=>{e.brushColor=t.payload},setBrushSize:(e,t)=>{e.brushSize=t.payload},clearMask:e=>{e.pastLayerStates.push(Ee.cloneDeep(e.layerState)),e.layerState.objects=e.layerState.objects.filter(t=>!tP(t)),e.futureLayerStates=[],e.shouldPreserveMaskedArea=!1},toggleShouldInvertMask:e=>{e.shouldPreserveMaskedArea=!e.shouldPreserveMaskedArea},toggleShouldShowMask:e=>{e.isMaskEnabled=!e.isMaskEnabled},setShouldPreserveMaskedArea:(e,t)=>{e.shouldPreserveMaskedArea=t.payload},setIsMaskEnabled:(e,t)=>{e.isMaskEnabled=t.payload,e.layer=t.payload?"mask":"base"},setShouldShowCheckboardTransparency:(e,t)=>{e.shouldShowCheckboardTransparency=t.payload},setShouldShowBrushPreview:(e,t)=>{e.shouldShowBrushPreview=t.payload},setShouldShowBrush:(e,t)=>{e.shouldShowBrush=t.payload},setCursorPosition:(e,t)=>{e.cursorPosition=t.payload},setInitialCanvasImage:(e,t)=>{const n=t.payload,{stageDimensions:r}=e,i={width:Ed(Ee.clamp(n.width,64,512),64),height:Ed(Ee.clamp(n.height,64,512),64)},o={x:Gl(n.width/2-i.width/2,64),y:Gl(n.height/2-i.height/2,64)};if(e.boundingBoxScaleMethod==="auto"){const l=oh(i);e.scaledBoundingBoxDimensions=l}e.boundingBoxDimensions=i,e.boundingBoxCoordinates=o,e.pastLayerStates.push(Ee.cloneDeep(e.layerState)),e.layerState={...kv,objects:[{kind:"image",layer:"base",x:0,y:0,width:n.width,height:n.height,image:n}]},e.futureLayerStates=[],e.isCanvasInitialized=!1;const a=Og(r.width,r.height,n.width,n.height,nv),s=Ag(r.width,r.height,0,0,n.width,n.height,a);e.stageScale=a,e.stageCoordinates=s,e.doesCanvasNeedScaling=!0},setBoundingBoxDimensions:(e,t)=>{const n=axe(t.payload);if(e.boundingBoxDimensions=n,e.boundingBoxScaleMethod==="auto"){const r=oh(n);e.scaledBoundingBoxDimensions=r}},setBoundingBoxCoordinates:(e,t)=>{e.boundingBoxCoordinates=DI(t.payload)},setStageCoordinates:(e,t)=>{e.stageCoordinates=t.payload},setBoundingBoxPreviewFill:(e,t)=>{e.boundingBoxPreviewFill=t.payload},setDoesCanvasNeedScaling:(e,t)=>{e.doesCanvasNeedScaling=t.payload},setStageScale:(e,t)=>{e.stageScale=t.payload},setShouldDarkenOutsideBoundingBox:(e,t)=>{e.shouldDarkenOutsideBoundingBox=t.payload},setIsDrawing:(e,t)=>{e.isDrawing=t.payload},clearCanvasHistory:e=>{e.pastLayerStates=[],e.futureLayerStates=[]},setShouldLockBoundingBox:(e,t)=>{e.shouldLockBoundingBox=t.payload},toggleShouldLockBoundingBox:e=>{e.shouldLockBoundingBox=!e.shouldLockBoundingBox},setShouldShowBoundingBox:(e,t)=>{e.shouldShowBoundingBox=t.payload},setIsTransformingBoundingBox:(e,t)=>{e.isTransformingBoundingBox=t.payload},setIsMovingBoundingBox:(e,t)=>{e.isMovingBoundingBox=t.payload},setIsMouseOverBoundingBox:(e,t)=>{e.isMouseOverBoundingBox=t.payload},setIsMoveBoundingBoxKeyHeld:(e,t)=>{e.isMoveBoundingBoxKeyHeld=t.payload},setIsMoveStageKeyHeld:(e,t)=>{e.isMoveStageKeyHeld=t.payload},addImageToStagingArea:(e,t)=>{const{boundingBox:n,image:r}=t.payload;!n||!r||(e.pastLayerStates.push(Ee.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea.images.push({kind:"image",layer:"base",...n,image:r}),e.layerState.stagingArea.selectedImageIndex=e.layerState.stagingArea.images.length-1,e.futureLayerStates=[])},discardStagedImages:e=>{e.pastLayerStates.push(Ee.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea={...kv.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingOutline=!0},addFillRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,brushColor:r}=e;e.pastLayerStates.push(Ee.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"fillRect",layer:"base",...t,...n,color:r}),e.futureLayerStates=[]},addEraseRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n}=e;e.pastLayerStates.push(Ee.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"eraseRect",layer:"base",...t,...n}),e.futureLayerStates=[]},addLine:(e,t)=>{const{tool:n,layer:r,brushColor:i,brushSize:o,shouldRestrictStrokesToBox:a}=e;if(n==="move"||n==="colorPicker")return;const s=o/2,l=r==="base"&&n==="brush"?{color:i}:{};e.pastLayerStates.push(Ee.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift();const u={kind:"line",layer:r,tool:n,strokeWidth:s,points:t.payload,...l};a&&(u.clip={...e.boundingBoxCoordinates,...e.boundingBoxDimensions}),e.layerState.objects.push(u),e.futureLayerStates=[]},addPointToCurrentLine:(e,t)=>{const n=e.layerState.objects.findLast(dxe);n&&n.points.push(...t.payload)},undo:e=>{const t=e.pastLayerStates.pop();t&&(e.futureLayerStates.unshift(Ee.cloneDeep(e.layerState)),e.futureLayerStates.length>e.maxHistory&&e.futureLayerStates.pop(),e.layerState=t)},redo:e=>{const t=e.futureLayerStates.shift();t&&(e.pastLayerStates.push(Ee.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState=t)},setShouldShowGrid:(e,t)=>{e.shouldShowGrid=t.payload},setIsMovingStage:(e,t)=>{e.isMovingStage=t.payload},setShouldSnapToGrid:(e,t)=>{e.shouldSnapToGrid=t.payload},setShouldAutoSave:(e,t)=>{e.shouldAutoSave=t.payload},setShouldShowIntermediates:(e,t)=>{e.shouldShowIntermediates=t.payload},resetCanvas:e=>{e.pastLayerStates.push(Ee.cloneDeep(e.layerState)),e.layerState=kv,e.futureLayerStates=[]},setCanvasContainerDimensions:(e,t)=>{e.canvasContainerDimensions=t.payload},resizeAndScaleCanvas:e=>{const{width:t,height:n}=e.canvasContainerDimensions,r=e.layerState.objects.find(U5),i={width:Math.floor(t),height:Math.floor(n)};if(!r){const d=Og(i.width,i.height,512,512,nv),h=Ag(i.width,i.height,0,0,512,512,d),m={width:512,height:512};if(e.stageScale=d,e.stageCoordinates=h,e.stageDimensions=i,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=m,e.boundingBoxScaleMethod==="auto"){const y=oh(m);e.scaledBoundingBoxDimensions=y}return}const{width:o,height:a}=r,l=Og(t,n,o,a,.95),u=Ag(i.width,i.height,0,0,o,a,l);e.minimumStageScale=l,e.stageScale=l,e.stageCoordinates=DI(u),e.stageDimensions=i,e.isCanvasInitialized=!0},resizeCanvas:e=>{const{width:t,height:n}=e.canvasContainerDimensions,r={width:Math.floor(t),height:Math.floor(n)};if(e.stageDimensions=r,!e.layerState.objects.find(U5)){const i=Og(r.width,r.height,512,512,nv),o=Ag(r.width,r.height,0,0,512,512,i),a={width:512,height:512};if(e.stageScale=i,e.stageCoordinates=o,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=a,e.boundingBoxScaleMethod==="auto"){const s=oh(a);e.scaledBoundingBoxDimensions=s}}},resetCanvasView:(e,t)=>{const{contentRect:n,shouldScaleTo1:r}=t.payload,{stageDimensions:{width:i,height:o}}=e,{x:a,y:s,width:l,height:u}=n;if(l!==0&&u!==0){const d=r?1:Og(i,o,l,u,nv),h=Ag(i,o,a,s,l,u,d);e.stageScale=d,e.stageCoordinates=h}else{const d=Og(i,o,512,512,nv),h=Ag(i,o,0,0,512,512,d),m={width:512,height:512};if(e.stageScale=d,e.stageCoordinates=h,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=m,e.boundingBoxScaleMethod==="auto"){const y=oh(m);e.scaledBoundingBoxDimensions=y}}},nextStagingAreaImage:e=>{const t=e.layerState.stagingArea.selectedImageIndex,n=e.layerState.stagingArea.images.length;e.layerState.stagingArea.selectedImageIndex=Math.min(t+1,n-1)},prevStagingAreaImage:e=>{const t=e.layerState.stagingArea.selectedImageIndex;e.layerState.stagingArea.selectedImageIndex=Math.max(t-1,0)},commitStagingAreaImage:e=>{const{images:t,selectedImageIndex:n}=e.layerState.stagingArea;e.pastLayerStates.push(Ee.cloneDeep(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({...t[n]}),e.layerState.stagingArea={...kv.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingImage=!0},fitBoundingBoxToStage:e=>{const{boundingBoxDimensions:t,boundingBoxCoordinates:n,stageDimensions:r,stageScale:i}=e,o=r.width/i,a=r.height/i;if(n.x<0||n.x+t.width>o||n.y<0||n.y+t.height>a){const s={width:Ed(Ee.clamp(o,64,512),64),height:Ed(Ee.clamp(a,64,512),64)},l={x:Gl(o/2-s.width/2,64),y:Gl(a/2-s.height/2,64)};if(e.boundingBoxDimensions=s,e.boundingBoxCoordinates=l,e.boundingBoxScaleMethod==="auto"){const u=oh(s);e.scaledBoundingBoxDimensions=u}}},setBoundingBoxScaleMethod:(e,t)=>{if(e.boundingBoxScaleMethod=t.payload,t.payload==="auto"){const n=oh(e.boundingBoxDimensions);e.scaledBoundingBoxDimensions=n}},setScaledBoundingBoxDimensions:(e,t)=>{e.scaledBoundingBoxDimensions=t.payload},setShouldShowStagingImage:(e,t)=>{e.shouldShowStagingImage=t.payload},setShouldShowStagingOutline:(e,t)=>{e.shouldShowStagingOutline=t.payload},setShouldShowCanvasDebugInfo:(e,t)=>{e.shouldShowCanvasDebugInfo=t.payload},setShouldRestrictStrokesToBox:(e,t)=>{e.shouldRestrictStrokesToBox=t.payload},setShouldCropToBoundingBoxOnSave:(e,t)=>{e.shouldCropToBoundingBoxOnSave=t.payload},setColorPickerColor:(e,t)=>{e.colorPickerColor=t.payload},commitColorPickerColor:e=>{e.brushColor={...e.colorPickerColor,a:e.brushColor.a},e.tool="brush"},setMergedCanvas:(e,t)=>{e.pastLayerStates.push(Ee.cloneDeep(e.layerState)),e.futureLayerStates=[],e.layerState.objects=[t.payload]},resetCanvasInteractionState:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMoveBoundingBoxKeyHeld=!1,e.isMoveStageKeyHeld=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1,e.isTransformingBoundingBox=!1},mouseLeftCanvas:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isTransformingBoundingBox=!1}}}),{addEraseRect:jW,addFillRect:BW,addImageToStagingArea:hxe,addLine:pxe,addPointToCurrentLine:FW,clearCanvasHistory:$W,clearMask:nP,commitColorPickerColor:gxe,commitStagingAreaImage:mxe,discardStagedImages:vxe,fitBoundingBoxToStage:Q$e,mouseLeftCanvas:yxe,nextStagingAreaImage:bxe,prevStagingAreaImage:Sxe,redo:xxe,resetCanvas:rP,resetCanvasInteractionState:wxe,resetCanvasView:zW,resizeAndScaleCanvas:Dx,resizeCanvas:Cxe,setBoundingBoxCoordinates:yC,setBoundingBoxDimensions:Ev,setBoundingBoxPreviewFill:J$e,setBoundingBoxScaleMethod:_xe,setBrushColor:Nm,setBrushSize:jm,setCanvasContainerDimensions:kxe,setColorPickerColor:Exe,setCursorPosition:Pxe,setDoesCanvasNeedScaling:vi,setInitialCanvasImage:Nx,setIsDrawing:HW,setIsMaskEnabled:Dy,setIsMouseOverBoundingBox:Cb,setIsMoveBoundingBoxKeyHeld:eze,setIsMoveStageKeyHeld:tze,setIsMovingBoundingBox:bC,setIsMovingStage:G5,setIsTransformingBoundingBox:SC,setLayer:q5,setMaskColor:VW,setMergedCanvas:Txe,setShouldAutoSave:WW,setShouldCropToBoundingBoxOnSave:UW,setShouldDarkenOutsideBoundingBox:GW,setShouldLockBoundingBox:nze,setShouldPreserveMaskedArea:qW,setShouldShowBoundingBox:Lxe,setShouldShowBrush:rze,setShouldShowBrushPreview:ize,setShouldShowCanvasDebugInfo:YW,setShouldShowCheckboardTransparency:oze,setShouldShowGrid:KW,setShouldShowIntermediates:XW,setShouldShowStagingImage:Axe,setShouldShowStagingOutline:NI,setShouldSnapToGrid:Y5,setStageCoordinates:ZW,setStageScale:Oxe,setTool:tu,toggleShouldLockBoundingBox:aze,toggleTool:sze,undo:Mxe,setScaledBoundingBoxDimensions:_b,setShouldRestrictStrokesToBox:QW}=NW.actions,Ixe=NW.reducer,Rxe={currentImageUuid:"",shouldPinGallery:!0,shouldShowGallery:!0,galleryScrollPosition:0,galleryImageMinimumWidth:64,galleryImageObjectFit:"cover",shouldHoldGalleryOpen:!1,shouldAutoSwitchToNewImages:!0,currentCategory:"result",categories:{user:{images:[],latest_mtime:void 0,earliest_mtime:void 0,areMoreImagesAvailable:!0},result:{images:[],latest_mtime:void 0,earliest_mtime:void 0,areMoreImagesAvailable:!0}},galleryWidth:300,shouldUseSingleGalleryColumn:!1},JW=cp({name:"gallery",initialState:Rxe,reducers:{setCurrentImage:(e,t)=>{e.currentImage=t.payload,e.currentImageUuid=t.payload.uuid},removeImage:(e,t)=>{const{uuid:n,category:r}=t.payload,i=e.categories[r].images,o=i.filter(a=>a.uuid!==n);if(n===e.currentImageUuid){const a=i.findIndex(l=>l.uuid===n),s=Ee.clamp(a,0,o.length-1);e.currentImage=o.length?o[s]:void 0,e.currentImageUuid=o.length?o[s].uuid:""}e.categories[r].images=o},addImage:(e,t)=>{const{image:n,category:r}=t.payload,{uuid:i,url:o,mtime:a}=n,s=e.categories[r];s.images.find(l=>l.url===o&&l.mtime===a)||(s.images.unshift(n),e.shouldAutoSwitchToNewImages&&(e.currentImageUuid=i,e.currentImage=n,e.currentCategory=r),e.intermediateImage=void 0,s.latest_mtime=a)},setIntermediateImage:(e,t)=>{e.intermediateImage=t.payload},clearIntermediateImage:e=>{e.intermediateImage=void 0},selectNextImage:e=>{const{currentImage:t}=e;if(!t)return;const n=e.categories[t.category].images;if(t){const r=n.findIndex(i=>i.uuid===t.uuid);if(r{const{currentImage:t}=e;if(!t)return;const n=e.categories[t.category].images;if(t){const r=n.findIndex(i=>i.uuid===t.uuid);if(r>0){const i=n[r-1];e.currentImage=i,e.currentImageUuid=i.uuid}}},addGalleryImages:(e,t)=>{const{images:n,areMoreImagesAvailable:r,category:i}=t.payload,o=e.categories[i].images;if(n.length>0){const a=n.filter(s=>!o.find(l=>l.url===s.url&&l.mtime===s.mtime));if(e.categories[i].images=o.concat(a).sort((s,l)=>l.mtime-s.mtime),!e.currentImage){const s=n[0];e.currentImage=s,e.currentImageUuid=s.uuid}e.categories[i].latest_mtime=n[0].mtime,e.categories[i].earliest_mtime=n[n.length-1].mtime}r!==void 0&&(e.categories[i].areMoreImagesAvailable=r)},setShouldPinGallery:(e,t)=>{e.shouldPinGallery=t.payload},setShouldShowGallery:(e,t)=>{e.shouldShowGallery=t.payload},setGalleryScrollPosition:(e,t)=>{e.galleryScrollPosition=t.payload},setGalleryImageMinimumWidth:(e,t)=>{e.galleryImageMinimumWidth=t.payload},setGalleryImageObjectFit:(e,t)=>{e.galleryImageObjectFit=t.payload},setShouldHoldGalleryOpen:(e,t)=>{e.shouldHoldGalleryOpen=t.payload},setShouldAutoSwitchToNewImages:(e,t)=>{e.shouldAutoSwitchToNewImages=t.payload},setCurrentCategory:(e,t)=>{e.currentCategory=t.payload},setGalleryWidth:(e,t)=>{e.galleryWidth=t.payload},setShouldUseSingleGalleryColumn:(e,t)=>{e.shouldUseSingleGalleryColumn=t.payload}}}),{addImage:sm,clearIntermediateImage:xC,removeImage:eU,setCurrentImage:jI,addGalleryImages:Dxe,setIntermediateImage:Nxe,selectNextImage:iP,selectPrevImage:oP,setShouldPinGallery:jxe,setShouldShowGallery:Bd,setGalleryScrollPosition:Bxe,setGalleryImageMinimumWidth:rv,setGalleryImageObjectFit:Fxe,setShouldHoldGalleryOpen:tU,setShouldAutoSwitchToNewImages:$xe,setCurrentCategory:kb,setGalleryWidth:zxe,setShouldUseSingleGalleryColumn:Hxe}=JW.actions,Vxe=JW.reducer,Wxe={isLightboxOpen:!1},Uxe=Wxe,nU=cp({name:"lightbox",initialState:Uxe,reducers:{setIsLightboxOpen:(e,t)=>{e.isLightboxOpen=t.payload}}}),{setIsLightboxOpen:Bm}=nU.actions,Gxe=nU.reducer,i2=e=>e.length===1?e[0].prompt:e.map(t=>`${t.prompt}:${t.weight}`).join(" ");function aP(e){let t=i2(e),n=null;const r=new RegExp(new RegExp("(?<=\\[)[^\\][]*(?=])"),"gi"),i=[...t.matchAll(r)];return i&&i.length>0&&(n=i.join(", "),t=t.replaceAll(r,"").replaceAll("[]","").trim()),[t,n]}const qxe=e=>{const r=e.split(",").map(i=>i.split(":")).map(i=>({seed:Number(i[0]),weight:Number(i[1])}));return sP(r)?r:!1},sP=e=>Boolean(typeof e=="string"?qxe(e):e.length&&!e.some(t=>{const{seed:n,weight:r}=t,i=!isNaN(parseInt(n.toString(),10)),o=!isNaN(parseInt(r.toString(),10))&&r>=0&&r<=1;return!(i&&o)})),K5=e=>e.reduce((t,n,r,i)=>{const{seed:o,weight:a}=n;return t+=`${o}:${a}`,r!==i.length-1&&(t+=","),t},""),Yxe=e=>e.split(",").map(r=>r.split(":")).map(r=>[parseInt(r[0],10),parseFloat(r[1])]),rU={cfgScale:7.5,height:512,img2imgStrength:.75,infillMethod:"patchmatch",iterations:1,maskPath:"",perlin:0,prompt:"",negativePrompt:"",sampler:"k_lms",seamBlur:16,seamless:!1,seamSize:96,seamSteps:30,seamStrength:.7,seed:0,seedWeights:"",shouldFitToWidthHeight:!0,shouldGenerateVariations:!1,shouldRandomizeSeed:!0,steps:50,threshold:0,tileSize:32,variationAmount:.1,width:512},Kxe=rU,iU=cp({name:"generation",initialState:Kxe,reducers:{setPrompt:(e,t)=>{const n=t.payload;typeof n=="string"?e.prompt=n:e.prompt=i2(n)},setNegativePrompt:(e,t)=>{const n=t.payload;typeof n=="string"?e.negativePrompt=n:e.negativePrompt=i2(n)},setIterations:(e,t)=>{e.iterations=t.payload},setSteps:(e,t)=>{e.steps=t.payload},setCfgScale:(e,t)=>{e.cfgScale=t.payload},setThreshold:(e,t)=>{e.threshold=t.payload},setPerlin:(e,t)=>{e.perlin=t.payload},setHeight:(e,t)=>{e.height=t.payload},setWidth:(e,t)=>{e.width=t.payload},setSampler:(e,t)=>{e.sampler=t.payload},setSeed:(e,t)=>{e.seed=t.payload,e.shouldRandomizeSeed=!1},setImg2imgStrength:(e,t)=>{e.img2imgStrength=t.payload},setMaskPath:(e,t)=>{e.maskPath=t.payload},setSeamless:(e,t)=>{e.seamless=t.payload},setShouldFitToWidthHeight:(e,t)=>{e.shouldFitToWidthHeight=t.payload},resetSeed:e=>{e.seed=-1},setParameter:(e,t)=>{const{key:n,value:r}=t.payload,i={...e,[n]:r};return n==="seed"&&(i.shouldRandomizeSeed=!1),i},setShouldGenerateVariations:(e,t)=>{e.shouldGenerateVariations=t.payload},setVariationAmount:(e,t)=>{e.variationAmount=t.payload},setSeedWeights:(e,t)=>{e.seedWeights=t.payload,e.shouldGenerateVariations=!0,e.variationAmount=0},setAllTextToImageParameters:(e,t)=>{const{sampler:n,prompt:r,seed:i,variations:o,steps:a,cfg_scale:s,threshold:l,perlin:u,seamless:d,hires_fix:h,width:m,height:y}=t.payload.image;o&&o.length>0?(e.seedWeights=K5(o),e.shouldGenerateVariations=!0,e.variationAmount=0):e.shouldGenerateVariations=!1,i&&(e.seed=i,e.shouldRandomizeSeed=!1),r&&(e.prompt=i2(r)),n&&(e.sampler=n),a&&(e.steps=a),s&&(e.cfgScale=s),typeof l>"u"?e.threshold=0:e.threshold=l,u&&(e.perlin=u),typeof u>"u"&&(e.perlin=0),typeof d=="boolean"&&(e.seamless=d),m&&(e.width=m),y&&(e.height=y)},setAllImageToImageParameters:(e,t)=>{const{type:n,strength:r,fit:i,init_image_path:o,mask_image_path:a}=t.payload.image;n==="img2img"&&(o&&(e.initialImage=o),a&&(e.maskPath=a),r&&(e.img2imgStrength=r),typeof i=="boolean"&&(e.shouldFitToWidthHeight=i))},setAllParameters:(e,t)=>{const{type:n,sampler:r,prompt:i,seed:o,variations:a,steps:s,cfg_scale:l,threshold:u,perlin:d,seamless:h,hires_fix:m,width:y,height:b,strength:S,fit:E,init_image_path:k,mask_image_path:_}=t.payload.image;if(n==="img2img"&&(k&&(e.initialImage=k),_&&(e.maskPath=_),S&&(e.img2imgStrength=S),typeof E=="boolean"&&(e.shouldFitToWidthHeight=E)),a&&a.length>0?(e.seedWeights=K5(a),e.shouldGenerateVariations=!0,e.variationAmount=0):e.shouldGenerateVariations=!1,o&&(e.seed=o,e.shouldRandomizeSeed=!1),i){const[T,A]=aP(i);T&&(e.prompt=T),A?e.negativePrompt=A:e.negativePrompt=""}r&&(e.sampler=r),s&&(e.steps=s),l&&(e.cfgScale=l),u&&(e.threshold=u),typeof u>"u"&&(e.threshold=0),d&&(e.perlin=d),typeof d>"u"&&(e.perlin=0),typeof h=="boolean"&&(e.seamless=h),y&&(e.width=y),b&&(e.height=b)},resetParametersState:e=>({...e,...rU}),setShouldRandomizeSeed:(e,t)=>{e.shouldRandomizeSeed=t.payload},setInitialImage:(e,t)=>{e.initialImage=t.payload},clearInitialImage:e=>{e.initialImage=void 0},setSeamSize:(e,t)=>{e.seamSize=t.payload},setSeamBlur:(e,t)=>{e.seamBlur=t.payload},setSeamStrength:(e,t)=>{e.seamStrength=t.payload},setSeamSteps:(e,t)=>{e.seamSteps=t.payload},setTileSize:(e,t)=>{e.tileSize=t.payload},setInfillMethod:(e,t)=>{e.infillMethod=t.payload}}}),{clearInitialImage:oU,resetParametersState:lze,resetSeed:uze,setAllImageToImageParameters:Xxe,setAllParameters:aU,setAllTextToImageParameters:cze,setCfgScale:sU,setHeight:lU,setImg2imgStrength:u8,setInfillMethod:uU,setInitialImage:k0,setIterations:Zxe,setMaskPath:cU,setParameter:dze,setPerlin:dU,setPrompt:jx,setNegativePrompt:Q2,setSampler:fU,setSeamBlur:BI,setSeamless:hU,setSeamSize:FI,setSeamSteps:$I,setSeamStrength:zI,setSeed:Ny,setSeedWeights:pU,setShouldFitToWidthHeight:gU,setShouldGenerateVariations:Qxe,setShouldRandomizeSeed:Jxe,setSteps:mU,setThreshold:vU,setTileSize:HI,setVariationAmount:ewe,setWidth:yU}=iU.actions,twe=iU.reducer,bU={codeformerFidelity:.75,facetoolStrength:.8,facetoolType:"gfpgan",hiresFix:!1,hiresStrength:.75,shouldLoopback:!1,shouldRunESRGAN:!1,shouldRunFacetool:!1,upscalingLevel:4,upscalingStrength:.75},nwe=bU,SU=cp({name:"postprocessing",initialState:nwe,reducers:{setFacetoolStrength:(e,t)=>{e.facetoolStrength=t.payload},setCodeformerFidelity:(e,t)=>{e.codeformerFidelity=t.payload},setUpscalingLevel:(e,t)=>{e.upscalingLevel=t.payload},setUpscalingStrength:(e,t)=>{e.upscalingStrength=t.payload},setHiresFix:(e,t)=>{e.hiresFix=t.payload},setHiresStrength:(e,t)=>{e.hiresStrength=t.payload},resetPostprocessingState:e=>({...e,...bU}),setShouldRunFacetool:(e,t)=>{e.shouldRunFacetool=t.payload},setFacetoolType:(e,t)=>{e.facetoolType=t.payload},setShouldRunESRGAN:(e,t)=>{e.shouldRunESRGAN=t.payload},setShouldLoopback:(e,t)=>{e.shouldLoopback=t.payload}}}),{resetPostprocessingState:fze,setCodeformerFidelity:xU,setFacetoolStrength:I4,setFacetoolType:R4,setHiresFix:lP,setHiresStrength:VI,setShouldLoopback:rwe,setShouldRunESRGAN:iwe,setShouldRunFacetool:owe,setUpscalingLevel:c8,setUpscalingStrength:d8}=SU.actions,awe=SU.reducer;function Xs(e){return Xs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xs(e)}function hu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function swe(e,t){if(Xs(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Xs(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function wU(e){var t=swe(e,"string");return Xs(t)==="symbol"?t:String(t)}function WI(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:{};hu(this,e),this.init(t,n)}return pu(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=n||hwe,this.options=r,this.debug=r.debug}},{key:"setDebug",value:function(n){this.debug=n}},{key:"log",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i1?r-1:0),o=1;o-1?s.replace(/###/g,"."):s}function i(){return!e||typeof e=="string"}for(var o=typeof t!="string"?[].concat(t):t.split(".");o.length>1;){if(i())return{};var a=r(o.shift());!e[a]&&n&&(e[a]=new n),Object.prototype.hasOwnProperty.call(e,a)?e=e[a]:e={}}return i()?{}:{obj:e,k:r(o.shift())}}function KI(e,t,n){var r=uP(e,t,Object),i=r.obj,o=r.k;i[o]=n}function mwe(e,t,n,r){var i=uP(e,t,Object),o=i.obj,a=i.k;o[a]=o[a]||[],r&&(o[a]=o[a].concat(n)),r||o[a].push(n)}function X5(e,t){var n=uP(e,t),r=n.obj,i=n.k;if(r)return r[i]}function XI(e,t,n){var r=X5(e,n);return r!==void 0?r:X5(t,n)}function CU(e,t,n){for(var r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):CU(e[r],t[r],n):e[r]=t[r]);return e}function Mg(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var vwe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function ywe(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,function(t){return vwe[t]}):e}var Fx=typeof window<"u"&&window.navigator&&typeof window.navigator.userAgentData>"u"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,bwe=[" ",",","?","!",";"];function Swe(e,t,n){t=t||"",n=n||"";var r=bwe.filter(function(s){return t.indexOf(s)<0&&n.indexOf(s)<0});if(r.length===0)return!0;var i=new RegExp("(".concat(r.map(function(s){return s==="?"?"\\?":s}).join("|"),")")),o=!i.test(e);if(!o){var a=e.indexOf(n);a>0&&!i.test(e.substring(0,a))&&(o=!0)}return o}function ZI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Eb(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _U(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(e){if(e[t])return e[t];for(var r=t.split(n),i=e,o=0;oo+a;)a++,s=r.slice(o,o+a).join(n),l=i[s];if(l===void 0)return;if(l===null)return null;if(t.endsWith(s)){if(typeof l=="string")return l;if(s&&typeof l[s]=="string")return l[s]}var u=r.slice(o+a).join(n);return u?_U(l,u,n):void 0}i=i[r[o]]}return i}}var Cwe=function(e){Bx(n,e);var t=xwe(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return hu(this,n),i=t.call(this),Fx&&Qd.call(Fd(i)),i.data=r||{},i.options=o,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.options.ignoreJSONStructure===void 0&&(i.options.ignoreJSONStructure=!0),i}return pu(n,[{key:"addNamespaces",value:function(i){this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}},{key:"removeNamespaces",value:function(i){var o=this.options.ns.indexOf(i);o>-1&&this.options.ns.splice(o,1)}},{key:"getResource",value:function(i,o,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,u=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure,d=[i,o];a&&typeof a!="string"&&(d=d.concat(a)),a&&typeof a=="string"&&(d=d.concat(l?a.split(l):a)),i.indexOf(".")>-1&&(d=i.split("."));var h=X5(this.data,d);return h||!u||typeof a!="string"?h:_U(this.data&&this.data[i]&&this.data[i][o],a,l)}},{key:"addResource",value:function(i,o,a,s){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},u=this.options.keySeparator;u===void 0&&(u=".");var d=[i,o];a&&(d=d.concat(u?a.split(u):a)),i.indexOf(".")>-1&&(d=i.split("."),s=o,o=d[1]),this.addNamespaces(o),KI(this.data,d,s),l.silent||this.emit("added",i,o,a,s)}},{key:"addResources",value:function(i,o,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var l in a)(typeof a[l]=="string"||Object.prototype.toString.apply(a[l])==="[object Array]")&&this.addResource(i,o,l,a[l],{silent:!0});s.silent||this.emit("added",i,o,a)}},{key:"addResourceBundle",value:function(i,o,a,s,l){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},d=[i,o];i.indexOf(".")>-1&&(d=i.split("."),s=a,a=o,o=d[1]),this.addNamespaces(o);var h=X5(this.data,d)||{};s?CU(h,a,l):h=Eb(Eb({},h),a),KI(this.data,d,h),u.silent||this.emit("added",i,o,a)}},{key:"removeResourceBundle",value:function(i,o){this.hasResourceBundle(i,o)&&delete this.data[i][o],this.removeNamespaces(o),this.emit("removed",i,o)}},{key:"hasResourceBundle",value:function(i,o){return this.getResource(i,o)!==void 0}},{key:"getResourceBundle",value:function(i,o){return o||(o=this.options.defaultNS),this.options.compatibilityAPI==="v1"?Eb(Eb({},{}),this.getResource(i,o)):this.getResource(i,o)}},{key:"getDataByLanguage",value:function(i){return this.data[i]}},{key:"hasLanguageSomeTranslations",value:function(i){var o=this.getDataByLanguage(i),a=o&&Object.keys(o)||[];return!!a.find(function(s){return o[s]&&Object.keys(o[s]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),n}(Qd),kU={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,n,r,i,o){var a=this;return t.forEach(function(s){a.processors[s]&&(n=a.processors[s].process(n,r,i,o))}),n}};function QI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function bo(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var JI={},eR=function(e){Bx(n,e);var t=_we(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return hu(this,n),i=t.call(this),Fx&&Qd.call(Fd(i)),gwe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],r,Fd(i)),i.options=o,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.logger=ql.create("translator"),i}return pu(n,[{key:"changeLanguage",value:function(i){i&&(this.language=i)}},{key:"exists",value:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(i==null)return!1;var a=this.resolve(i,o);return a&&a.res!==void 0}},{key:"extractFromKey",value:function(i,o){var a=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;a===void 0&&(a=":");var s=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,l=o.ns||this.options.defaultNS||[],u=a&&i.indexOf(a)>-1,d=!this.options.userDefinedKeySeparator&&!o.keySeparator&&!this.options.userDefinedNsSeparator&&!o.nsSeparator&&!Swe(i,a,s);if(u&&!d){var h=i.match(this.interpolator.nestingRegexp);if(h&&h.length>0)return{key:i,namespaces:l};var m=i.split(a);(a!==s||a===s&&this.options.ns.indexOf(m[0])>-1)&&(l=m.shift()),i=m.join(s)}return typeof l=="string"&&(l=[l]),{key:i,namespaces:l}}},{key:"translate",value:function(i,o,a){var s=this;if(Xs(o)!=="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),o||(o={}),i==null)return"";Array.isArray(i)||(i=[String(i)]);var l=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,u=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,d=this.extractFromKey(i[i.length-1],o),h=d.key,m=d.namespaces,y=m[m.length-1],b=o.lng||this.language,S=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(b&&b.toLowerCase()==="cimode"){if(S){var E=o.nsSeparator||this.options.nsSeparator;return l?(k.res="".concat(y).concat(E).concat(h),k):"".concat(y).concat(E).concat(h)}return l?(k.res=h,k):h}var k=this.resolve(i,o),_=k&&k.res,T=k&&k.usedKey||h,A=k&&k.exactUsedKey||h,I=Object.prototype.toString.apply(_),R=["[object Number]","[object Function]","[object RegExp]"],D=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,j=!this.i18nFormat||this.i18nFormat.handleAsObject,z=typeof _!="string"&&typeof _!="boolean"&&typeof _!="number";if(j&&_&&z&&R.indexOf(I)<0&&!(typeof D=="string"&&I==="[object Array]")){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var V=this.options.returnedObjectHandler?this.options.returnedObjectHandler(T,_,bo(bo({},o),{},{ns:m})):"key '".concat(h," (").concat(this.language,")' returned an object instead of string.");return l?(k.res=V,k):V}if(u){var K=I==="[object Array]",te=K?[]:{},q=K?A:T;for(var F in _)if(Object.prototype.hasOwnProperty.call(_,F)){var U="".concat(q).concat(u).concat(F);te[F]=this.translate(U,bo(bo({},o),{joinArrays:!1,ns:m})),te[F]===U&&(te[F]=_[F])}_=te}}else if(j&&typeof D=="string"&&I==="[object Array]")_=_.join(D),_&&(_=this.extendTranslation(_,i,o,a));else{var X=!1,Z=!1,W=o.count!==void 0&&typeof o.count!="string",Q=n.hasDefaultValue(o),ie=W?this.pluralResolver.getSuffix(b,o.count,o):"",fe=o["defaultValue".concat(ie)]||o.defaultValue;!this.isValidLookup(_)&&Q&&(X=!0,_=fe),this.isValidLookup(_)||(Z=!0,_=h);var Se=o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,Te=Se&&Z?void 0:_,ye=Q&&fe!==_&&this.options.updateMissing;if(Z||X||ye){if(this.logger.log(ye?"updateKey":"missingKey",b,y,h,ye?fe:_),u){var He=this.resolve(h,bo(bo({},o),{},{keySeparator:!1}));He&&He.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var Ne=[],tt=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&tt&&tt[0])for(var _e=0;_e1&&arguments[1]!==void 0?arguments[1]:{},s,l,u,d,h;return typeof i=="string"&&(i=[i]),i.forEach(function(m){if(!o.isValidLookup(s)){var y=o.extractFromKey(m,a),b=y.key;l=b;var S=y.namespaces;o.options.fallbackNS&&(S=S.concat(o.options.fallbackNS));var E=a.count!==void 0&&typeof a.count!="string",k=E&&!a.ordinal&&a.count===0&&o.pluralResolver.shouldUseIntlApi(),_=a.context!==void 0&&(typeof a.context=="string"||typeof a.context=="number")&&a.context!=="",T=a.lngs?a.lngs:o.languageUtils.toResolveHierarchy(a.lng||o.language,a.fallbackLng);S.forEach(function(A){o.isValidLookup(s)||(h=A,!JI["".concat(T[0],"-").concat(A)]&&o.utils&&o.utils.hasLoadedNamespace&&!o.utils.hasLoadedNamespace(h)&&(JI["".concat(T[0],"-").concat(A)]=!0,o.logger.warn('key "'.concat(l,'" for languages "').concat(T.join(", "),`" won't get resolved as namespace "`).concat(h,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),T.forEach(function(I){if(!o.isValidLookup(s)){d=I;var R=[b];if(o.i18nFormat&&o.i18nFormat.addLookupKeys)o.i18nFormat.addLookupKeys(R,b,I,A,a);else{var D;E&&(D=o.pluralResolver.getSuffix(I,a.count,a));var j="".concat(o.options.pluralSeparator,"zero");if(E&&(R.push(b+D),k&&R.push(b+j)),_){var z="".concat(b).concat(o.options.contextSeparator).concat(a.context);R.push(z),E&&(R.push(z+D),k&&R.push(z+j))}}for(var V;V=R.pop();)o.isValidLookup(s)||(u=V,s=o.getResource(I,A,V,a))}}))})}}),{res:s,usedKey:l,exactUsedKey:u,usedLng:d,usedNS:h}}},{key:"isValidLookup",value:function(i){return i!==void 0&&!(!this.options.returnNull&&i===null)&&!(!this.options.returnEmptyString&&i==="")}},{key:"getResource",value:function(i,o,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(i,o,a,s):this.resourceStore.getResource(i,o,a,s)}}],[{key:"hasDefaultValue",value:function(i){var o="defaultValue";for(var a in i)if(Object.prototype.hasOwnProperty.call(i,a)&&o===a.substring(0,o.length)&&i[a]!==void 0)return!0;return!1}}]),n}(Qd);function wC(e){return e.charAt(0).toUpperCase()+e.slice(1)}var tR=function(){function e(t){hu(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ql.create("languageUtils")}return pu(e,[{key:"getScriptPartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return null;var r=n.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}},{key:"getLanguagePartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return n;var r=n.split("-");return this.formatLanguageCode(r[0])}},{key:"formatLanguageCode",value:function(n){if(typeof n=="string"&&n.indexOf("-")>-1){var r=["hans","hant","latn","cyrl","cans","mong","arab"],i=n.split("-");return this.options.lowerCaseLng?i=i.map(function(o){return o.toLowerCase()}):i.length===2?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),r.indexOf(i[1].toLowerCase())>-1&&(i[1]=wC(i[1].toLowerCase()))):i.length===3&&(i[0]=i[0].toLowerCase(),i[1].length===2&&(i[1]=i[1].toUpperCase()),i[0]!=="sgn"&&i[2].length===2&&(i[2]=i[2].toUpperCase()),r.indexOf(i[1].toLowerCase())>-1&&(i[1]=wC(i[1].toLowerCase())),r.indexOf(i[2].toLowerCase())>-1&&(i[2]=wC(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?n.toLowerCase():n}},{key:"isSupportedCode",value:function(n){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(n=this.getLanguagePartFromCode(n)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(n)>-1}},{key:"getBestMatchFromCodes",value:function(n){var r=this;if(!n)return null;var i;return n.forEach(function(o){if(!i){var a=r.formatLanguageCode(o);(!r.options.supportedLngs||r.isSupportedCode(a))&&(i=a)}}),!i&&this.options.supportedLngs&&n.forEach(function(o){if(!i){var a=r.getLanguagePartFromCode(o);if(r.isSupportedCode(a))return i=a;i=r.options.supportedLngs.find(function(s){if(s.indexOf(a)===0)return s})}}),i||(i=this.getFallbackCodes(this.options.fallbackLng)[0]),i}},{key:"getFallbackCodes",value:function(n,r){if(!n)return[];if(typeof n=="function"&&(n=n(r)),typeof n=="string"&&(n=[n]),Object.prototype.toString.apply(n)==="[object Array]")return n;if(!r)return n.default||[];var i=n[r];return i||(i=n[this.getScriptPartFromCode(r)]),i||(i=n[this.formatLanguageCode(r)]),i||(i=n[this.getLanguagePartFromCode(r)]),i||(i=n.default),i||[]}},{key:"toResolveHierarchy",value:function(n,r){var i=this,o=this.getFallbackCodes(r||this.options.fallbackLng||[],n),a=[],s=function(u){u&&(i.isSupportedCode(u)?a.push(u):i.logger.warn("rejecting language code not found in supportedLngs: ".concat(u)))};return typeof n=="string"&&n.indexOf("-")>-1?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(n)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(n)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(n))):typeof n=="string"&&s(this.formatLanguageCode(n)),o.forEach(function(l){a.indexOf(l)<0&&s(i.formatLanguageCode(l))}),a}}]),e}(),Ewe=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],Pwe={1:function(t){return Number(t>1)},2:function(t){return Number(t!=1)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(t==1?0:t>=2&&t<=4?1:2)},7:function(t){return Number(t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(t==1?0:t==2?1:t!=8&&t!=11?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(t==1?0:t==2?1:t<7?2:t<11?3:4)},11:function(t){return Number(t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(t!==0)},14:function(t){return Number(t==1?0:t==2?1:t==3?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:t!==0?1:2)},17:function(t){return Number(t==1||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(t==0?0:t==1?1:2)},19:function(t){return Number(t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(t==1?0:t==0||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3)}},Twe=["v1","v2","v3"],nR={zero:0,one:1,two:2,few:3,many:4,other:5};function Lwe(){var e={};return Ewe.forEach(function(t){t.lngs.forEach(function(n){e[n]={numbers:t.nr,plurals:Pwe[t.fc]}})}),e}var Awe=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};hu(this,e),this.languageUtils=t,this.options=n,this.logger=ql.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=Lwe()}return pu(e,[{key:"addRule",value:function(n,r){this.rules[n]=r}},{key:"getRule",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(n,{type:r.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[n]||this.rules[this.languageUtils.getLanguagePartFromCode(n)]}},{key:"needsPlural",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.getRule(n,r);return this.shouldUseIntlApi()?i&&i.resolvedOptions().pluralCategories.length>1:i&&i.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(n,i).map(function(o){return"".concat(r).concat(o)})}},{key:"getSuffixes",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.getRule(n,i);return o?this.shouldUseIntlApi()?o.resolvedOptions().pluralCategories.sort(function(a,s){return nR[a]-nR[s]}).map(function(a){return"".concat(r.options.prepend).concat(a)}):o.numbers.map(function(a){return r.getSuffix(n,a,i)}):[]}},{key:"getSuffix",value:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=this.getRule(n,i);return o?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(o.select(r)):this.getSuffixRetroCompatible(o,r):(this.logger.warn("no plural rule found for: ".concat(n)),"")}},{key:"getSuffixRetroCompatible",value:function(n,r){var i=this,o=n.noAbs?n.plurals(r):n.plurals(Math.abs(r)),a=n.numbers[o];this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1&&(a===2?a="plural":a===1&&(a=""));var s=function(){return i.options.prepend&&a.toString()?i.options.prepend+a.toString():a.toString()};return this.options.compatibilityJSON==="v1"?a===1?"":typeof a=="number"?"_plural_".concat(a.toString()):s():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1?s():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}},{key:"shouldUseIntlApi",value:function(){return!Twe.includes(this.options.compatibilityJSON)}}]),e}();function rR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Rs(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{};hu(this,e),this.logger=ql.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(n){return n},this.init(t)}return pu(e,[{key:"init",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n.interpolation||(n.interpolation={escapeValue:!0});var r=n.interpolation;this.escape=r.escape!==void 0?r.escape:ywe,this.escapeValue=r.escapeValue!==void 0?r.escapeValue:!0,this.useRawValueToEscape=r.useRawValueToEscape!==void 0?r.useRawValueToEscape:!1,this.prefix=r.prefix?Mg(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?Mg(r.suffix):r.suffixEscaped||"}}",this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",",this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"",this.nestingPrefix=r.nestingPrefix?Mg(r.nestingPrefix):r.nestingPrefixEscaped||Mg("$t("),this.nestingSuffix=r.nestingSuffix?Mg(r.nestingSuffix):r.nestingSuffixEscaped||Mg(")"),this.nestingOptionsSeparator=r.nestingOptionsSeparator?r.nestingOptionsSeparator:r.nestingOptionsSeparator||",",this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3,this.alwaysFormat=r.alwaysFormat!==void 0?r.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var n="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(n,"g");var r="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(r,"g");var i="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(i,"g")}},{key:"interpolate",value:function(n,r,i,o){var a=this,s,l,u,d=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function h(E){return E.replace(/\$/g,"$$$$")}var m=function(k){if(k.indexOf(a.formatSeparator)<0){var _=XI(r,d,k);return a.alwaysFormat?a.format(_,void 0,i,Rs(Rs(Rs({},o),r),{},{interpolationkey:k})):_}var T=k.split(a.formatSeparator),A=T.shift().trim(),I=T.join(a.formatSeparator).trim();return a.format(XI(r,d,A),I,i,Rs(Rs(Rs({},o),r),{},{interpolationkey:A}))};this.resetRegExp();var y=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,b=o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,S=[{regex:this.regexpUnescape,safeValue:function(k){return h(k)}},{regex:this.regexp,safeValue:function(k){return a.escapeValue?h(a.escape(k)):h(k)}}];return S.forEach(function(E){for(u=0;s=E.regex.exec(n);){var k=s[1].trim();if(l=m(k),l===void 0)if(typeof y=="function"){var _=y(n,s,o);l=typeof _=="string"?_:""}else if(o&&o.hasOwnProperty(k))l="";else if(b){l=s[0];continue}else a.logger.warn("missed to pass in variable ".concat(k," for interpolating ").concat(n)),l="";else typeof l!="string"&&!a.useRawValueToEscape&&(l=YI(l));var T=E.safeValue(l);if(n=n.replace(s[0],T),b?(E.regex.lastIndex+=l.length,E.regex.lastIndex-=s[0].length):E.regex.lastIndex=0,u++,u>=a.maxReplaces)break}}),n}},{key:"nest",value:function(n,r){var i=this,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a,s,l;function u(y,b){var S=this.nestingOptionsSeparator;if(y.indexOf(S)<0)return y;var E=y.split(new RegExp("".concat(S,"[ ]*{"))),k="{".concat(E[1]);y=E[0],k=this.interpolate(k,l);var _=k.match(/'/g),T=k.match(/"/g);(_&&_.length%2===0&&!T||T.length%2!==0)&&(k=k.replace(/'/g,'"'));try{l=JSON.parse(k),b&&(l=Rs(Rs({},b),l))}catch(A){return this.logger.warn("failed parsing options string in nesting for key ".concat(y),A),"".concat(y).concat(S).concat(k)}return delete l.defaultValue,y}for(;a=this.nestingRegexp.exec(n);){var d=[];l=Rs({},o),l.applyPostProcessor=!1,delete l.defaultValue;var h=!1;if(a[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(a[1])){var m=a[1].split(this.formatSeparator).map(function(y){return y.trim()});a[1]=m.shift(),d=m,h=!0}if(s=r(u.call(this,a[1].trim(),l),l),s&&a[0]===n&&typeof s!="string")return s;typeof s!="string"&&(s=YI(s)),s||(this.logger.warn("missed to resolve ".concat(a[1]," for nesting ").concat(n)),s=""),h&&(s=d.reduce(function(y,b){return i.format(y,b,o.lng,Rs(Rs({},o),{},{interpolationkey:a[1].trim()}))},s.trim())),n=n.replace(a[0],s),this.regexp.lastIndex=0}return n}}]),e}();function iR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ld(e){for(var t=1;t-1){var r=e.split("(");t=r[0].toLowerCase().trim();var i=r[1].substring(0,r[1].length-1);if(t==="currency"&&i.indexOf(":")<0)n.currency||(n.currency=i.trim());else if(t==="relativetime"&&i.indexOf(":")<0)n.range||(n.range=i.trim());else{var o=i.split(";");o.forEach(function(a){if(a){var s=a.split(":"),l=fwe(s),u=l[0],d=l.slice(1),h=d.join(":").trim().replace(/^'+|'+$/g,"");n[u.trim()]||(n[u.trim()]=h),h==="false"&&(n[u.trim()]=!1),h==="true"&&(n[u.trim()]=!0),isNaN(h)||(n[u.trim()]=parseInt(h,10))}})}}return{formatName:t,formatOptions:n}}function Ig(e){var t={};return function(r,i,o){var a=i+JSON.stringify(o),s=t[a];return s||(s=e(i,o),t[a]=s),s(r)}}var Iwe=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};hu(this,e),this.logger=ql.create("formatter"),this.options=t,this.formats={number:Ig(function(n,r){var i=new Intl.NumberFormat(n,r);return function(o){return i.format(o)}}),currency:Ig(function(n,r){var i=new Intl.NumberFormat(n,ld(ld({},r),{},{style:"currency"}));return function(o){return i.format(o)}}),datetime:Ig(function(n,r){var i=new Intl.DateTimeFormat(n,ld({},r));return function(o){return i.format(o)}}),relativetime:Ig(function(n,r){var i=new Intl.RelativeTimeFormat(n,ld({},r));return function(o){return i.format(o,r.range||"day")}}),list:Ig(function(n,r){var i=new Intl.ListFormat(n,ld({},r));return function(o){return i.format(o)}})},this.init(t)}return pu(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},i=r.interpolation;this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||","}},{key:"add",value:function(n,r){this.formats[n.toLowerCase().trim()]=r}},{key:"addCached",value:function(n,r){this.formats[n.toLowerCase().trim()]=Ig(r)}},{key:"format",value:function(n,r,i,o){var a=this,s=r.split(this.formatSeparator),l=s.reduce(function(u,d){var h=Mwe(d),m=h.formatName,y=h.formatOptions;if(a.formats[m]){var b=u;try{var S=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{},E=S.locale||S.lng||o.locale||o.lng||i;b=a.formats[m](u,E,ld(ld(ld({},y),o),S))}catch(k){a.logger.warn(k)}return b}else a.logger.warn("there was no format function for ".concat(m));return u},n);return l}}]),e}();function oR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function aR(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Nwe(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}var jwe=function(e){Bx(n,e);var t=Rwe(n);function n(r,i,o){var a,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return hu(this,n),a=t.call(this),Fx&&Qd.call(Fd(a)),a.backend=r,a.store=i,a.services=o,a.languageUtils=o.languageUtils,a.options=s,a.logger=ql.create("backendConnector"),a.waitingReads=[],a.maxParallelReads=s.maxParallelReads||10,a.readingCalls=0,a.maxRetries=s.maxRetries>=0?s.maxRetries:5,a.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,a.state={},a.queue=[],a.backend&&a.backend.init&&a.backend.init(o,s.backend,s),a}return pu(n,[{key:"queueLoad",value:function(i,o,a,s){var l=this,u={},d={},h={},m={};return i.forEach(function(y){var b=!0;o.forEach(function(S){var E="".concat(y,"|").concat(S);!a.reload&&l.store.hasResourceBundle(y,S)?l.state[E]=2:l.state[E]<0||(l.state[E]===1?d[E]===void 0&&(d[E]=!0):(l.state[E]=1,b=!1,d[E]===void 0&&(d[E]=!0),u[E]===void 0&&(u[E]=!0),m[S]===void 0&&(m[S]=!0)))}),b||(h[y]=!0)}),(Object.keys(u).length||Object.keys(d).length)&&this.queue.push({pending:d,pendingCount:Object.keys(d).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(u),pending:Object.keys(d),toLoadLanguages:Object.keys(h),toLoadNamespaces:Object.keys(m)}}},{key:"loaded",value:function(i,o,a){var s=i.split("|"),l=s[0],u=s[1];o&&this.emit("failedLoading",l,u,o),a&&this.store.addResourceBundle(l,u,a),this.state[i]=o?-1:2;var d={};this.queue.forEach(function(h){mwe(h.loaded,[l],u),Nwe(h,i),o&&h.errors.push(o),h.pendingCount===0&&!h.done&&(Object.keys(h.loaded).forEach(function(m){d[m]||(d[m]={});var y=h.loaded[m];y.length&&y.forEach(function(b){d[m][b]===void 0&&(d[m][b]=!0)})}),h.done=!0,h.errors.length?h.callback(h.errors):h.callback())}),this.emit("loaded",d),this.queue=this.queue.filter(function(h){return!h.done})}},{key:"read",value:function(i,o,a){var s=this,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,d=arguments.length>5?arguments[5]:void 0;if(!i.length)return d(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:i,ns:o,fcName:a,tried:l,wait:u,callback:d});return}this.readingCalls++;var h=function(S,E){if(s.readingCalls--,s.waitingReads.length>0){var k=s.waitingReads.shift();s.read(k.lng,k.ns,k.fcName,k.tried,k.wait,k.callback)}if(S&&E&&l2&&arguments[2]!==void 0?arguments[2]:{},l=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),l&&l();typeof i=="string"&&(i=this.languageUtils.toResolveHierarchy(i)),typeof o=="string"&&(o=[o]);var u=this.queueLoad(i,o,s,l);if(!u.toLoad.length)return u.pending.length||l(),null;u.toLoad.forEach(function(d){a.loadOne(d)})}},{key:"load",value:function(i,o,a){this.prepareLoading(i,o,{},a)}},{key:"reload",value:function(i,o,a){this.prepareLoading(i,o,{reload:!0},a)}},{key:"loadOne",value:function(i){var o=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",s=i.split("|"),l=s[0],u=s[1];this.read(l,u,"read",void 0,void 0,function(d,h){d&&o.logger.warn("".concat(a,"loading namespace ").concat(u," for language ").concat(l," failed"),d),!d&&h&&o.logger.log("".concat(a,"loaded namespace ").concat(u," for language ").concat(l),h),o.loaded(i,d,h)})}},{key:"saveMissing",value:function(i,o,a,s,l){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},d=arguments.length>6&&arguments[6]!==void 0?arguments[6]:function(){};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(o)){this.logger.warn('did not save key "'.concat(a,'" as the namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(a==null||a==="")){if(this.backend&&this.backend.create){var h=aR(aR({},u),{},{isUpdate:l}),m=this.backend.create.bind(this.backend);if(m.length<6)try{var y;m.length===5?y=m(i,o,a,s,h):y=m(i,o,a,s),y&&typeof y.then=="function"?y.then(function(b){return d(null,b)}).catch(d):d(null,y)}catch(b){d(b)}else m(i,o,a,s,d,h)}!i||!i[0]||this.store.addResource(i[0],o,a,s)}}}]),n}(Qd);function sR(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var n={};if(Xs(t[1])==="object"&&(n=t[1]),typeof t[1]=="string"&&(n.defaultValue=t[1]),typeof t[2]=="string"&&(n.tDescription=t[2]),Xs(t[2])==="object"||Xs(t[3])==="object"){var r=t[3]||t[2];Object.keys(r).forEach(function(i){n[i]=r[i]})}return n},interpolation:{escapeValue:!0,format:function(t,n,r,i){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function lR(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function uR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ml(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Pb(){}function $we(e){var t=Object.getOwnPropertyNames(Object.getPrototypeOf(e));t.forEach(function(n){typeof e[n]=="function"&&(e[n]=e[n].bind(e))})}var Z5=function(e){Bx(n,e);var t=Bwe(n);function n(){var r,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(hu(this,n),r=t.call(this),Fx&&Qd.call(Fd(r)),r.options=lR(i),r.services={},r.logger=ql,r.modules={external:[]},$we(Fd(r)),o&&!r.isInitialized&&!i.isClone){if(!r.options.initImmediate)return r.init(i,o),jy(r,Fd(r));setTimeout(function(){r.init(i,o)},0)}return r}return pu(n,[{key:"init",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;typeof o=="function"&&(a=o,o={}),!o.defaultNS&&o.defaultNS!==!1&&o.ns&&(typeof o.ns=="string"?o.defaultNS=o.ns:o.ns.indexOf("translation")<0&&(o.defaultNS=o.ns[0]));var s=sR();this.options=Ml(Ml(Ml({},s),this.options),lR(o)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=Ml(Ml({},s.interpolation),this.options.interpolation)),o.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=o.keySeparator),o.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=o.nsSeparator);function l(k){return k?typeof k=="function"?new k:k:null}if(!this.options.isClone){this.modules.logger?ql.init(l(this.modules.logger),this.options):ql.init(null,this.options);var u;this.modules.formatter?u=this.modules.formatter:typeof Intl<"u"&&(u=Iwe);var d=new tR(this.options);this.store=new Cwe(this.options.resources,this.options);var h=this.services;h.logger=ql,h.resourceStore=this.store,h.languageUtils=d,h.pluralResolver=new Awe(d,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(h.formatter=l(u),h.formatter.init(h,this.options),this.options.interpolation.format=h.formatter.format.bind(h.formatter)),h.interpolator=new Owe(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new jwe(l(this.modules.backend),h.resourceStore,h,this.options),h.backendConnector.on("*",function(k){for(var _=arguments.length,T=new Array(_>1?_-1:0),A=1;A<_;A++)T[A-1]=arguments[A];i.emit.apply(i,[k].concat(T))}),this.modules.languageDetector&&(h.languageDetector=l(this.modules.languageDetector),h.languageDetector.init&&h.languageDetector.init(h,this.options.detection,this.options)),this.modules.i18nFormat&&(h.i18nFormat=l(this.modules.i18nFormat),h.i18nFormat.init&&h.i18nFormat.init(this)),this.translator=new eR(this.services,this.options),this.translator.on("*",function(k){for(var _=arguments.length,T=new Array(_>1?_-1:0),A=1;A<_;A++)T[A-1]=arguments[A];i.emit.apply(i,[k].concat(T))}),this.modules.external.forEach(function(k){k.init&&k.init(i)})}if(this.format=this.options.interpolation.format,a||(a=Pb),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var m=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);m.length>0&&m[0]!=="dev"&&(this.options.lng=m[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var y=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];y.forEach(function(k){i[k]=function(){var _;return(_=i.store)[k].apply(_,arguments)}});var b=["addResource","addResources","addResourceBundle","removeResourceBundle"];b.forEach(function(k){i[k]=function(){var _;return(_=i.store)[k].apply(_,arguments),i}});var S=iv(),E=function(){var _=function(A,I){i.isInitialized&&!i.initializedStoreOnce&&i.logger.warn("init: i18next is already initialized. You should call init just once!"),i.isInitialized=!0,i.options.isClone||i.logger.log("initialized",i.options),i.emit("initialized",i.options),S.resolve(I),a(A,I)};if(i.languages&&i.options.compatibilityAPI!=="v1"&&!i.isInitialized)return _(null,i.t.bind(i));i.changeLanguage(i.options.lng,_)};return this.options.resources||!this.options.initImmediate?E():setTimeout(E,0),S}},{key:"loadResources",value:function(i){var o=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Pb,s=a,l=typeof i=="string"?i:this.language;if(typeof i=="function"&&(s=i),!this.options.resources||this.options.partialBundledLanguages){if(l&&l.toLowerCase()==="cimode")return s();var u=[],d=function(y){if(y){var b=o.services.languageUtils.toResolveHierarchy(y);b.forEach(function(S){u.indexOf(S)<0&&u.push(S)})}};if(l)d(l);else{var h=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);h.forEach(function(m){return d(m)})}this.options.preload&&this.options.preload.forEach(function(m){return d(m)}),this.services.backendConnector.load(u,this.options.ns,function(m){!m&&!o.resolvedLanguage&&o.language&&o.setResolvedLanguage(o.language),s(m)})}else s(null)}},{key:"reloadResources",value:function(i,o,a){var s=iv();return i||(i=this.languages),o||(o=this.options.ns),a||(a=Pb),this.services.backendConnector.reload(i,o,function(l){s.resolve(),a(l)}),s}},{key:"use",value:function(i){if(!i)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!i.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return i.type==="backend"&&(this.modules.backend=i),(i.type==="logger"||i.log&&i.warn&&i.error)&&(this.modules.logger=i),i.type==="languageDetector"&&(this.modules.languageDetector=i),i.type==="i18nFormat"&&(this.modules.i18nFormat=i),i.type==="postProcessor"&&kU.addPostProcessor(i),i.type==="formatter"&&(this.modules.formatter=i),i.type==="3rdParty"&&this.modules.external.push(i),this}},{key:"setResolvedLanguage",value:function(i){if(!(!i||!this.languages)&&!(["cimode","dev"].indexOf(i)>-1))for(var o=0;o-1)&&this.store.hasLanguageSomeTranslations(a)){this.resolvedLanguage=a;break}}}},{key:"changeLanguage",value:function(i,o){var a=this;this.isLanguageChangingTo=i;var s=iv();this.emit("languageChanging",i);var l=function(m){a.language=m,a.languages=a.services.languageUtils.toResolveHierarchy(m),a.resolvedLanguage=void 0,a.setResolvedLanguage(m)},u=function(m,y){y?(l(y),a.translator.changeLanguage(y),a.isLanguageChangingTo=void 0,a.emit("languageChanged",y),a.logger.log("languageChanged",y)):a.isLanguageChangingTo=void 0,s.resolve(function(){return a.t.apply(a,arguments)}),o&&o(m,function(){return a.t.apply(a,arguments)})},d=function(m){!i&&!m&&a.services.languageDetector&&(m=[]);var y=typeof m=="string"?m:a.services.languageUtils.getBestMatchFromCodes(m);y&&(a.language||l(y),a.translator.language||a.translator.changeLanguage(y),a.services.languageDetector&&a.services.languageDetector.cacheUserLanguage&&a.services.languageDetector.cacheUserLanguage(y)),a.loadResources(y,function(b){u(b,y)})};return!i&&this.services.languageDetector&&!this.services.languageDetector.async?d(this.services.languageDetector.detect()):!i&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(d):this.services.languageDetector.detect(d):d(i),s}},{key:"getFixedT",value:function(i,o,a){var s=this,l=function u(d,h){var m;if(Xs(h)!=="object"){for(var y=arguments.length,b=new Array(y>2?y-2:0),S=2;S1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var s=this.resolvedLanguage||this.languages[0],l=this.options?this.options.fallbackLng:!1,u=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;var d=function(y,b){var S=o.services.backendConnector.state["".concat(y,"|").concat(b)];return S===-1||S===2};if(a.precheck){var h=a.precheck(this,d);if(h!==void 0)return h}return!!(this.hasResourceBundle(s,i)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||d(s,i)&&(!l||d(u,i)))}},{key:"loadNamespaces",value:function(i,o){var a=this,s=iv();return this.options.ns?(typeof i=="string"&&(i=[i]),i.forEach(function(l){a.options.ns.indexOf(l)<0&&a.options.ns.push(l)}),this.loadResources(function(l){s.resolve(),o&&o(l)}),s):(o&&o(),Promise.resolve())}},{key:"loadLanguages",value:function(i,o){var a=iv();typeof i=="string"&&(i=[i]);var s=this.options.preload||[],l=i.filter(function(u){return s.indexOf(u)<0});return l.length?(this.options.preload=s.concat(l),this.loadResources(function(u){a.resolve(),o&&o(u)}),a):(o&&o(),Promise.resolve())}},{key:"dir",value:function(i){if(i||(i=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!i)return"rtl";var o=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],a=this.services&&this.services.languageUtils||new tR(sR());return o.indexOf(a.getLanguagePartFromCode(i))>-1||i.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Pb,s=Ml(Ml(Ml({},this.options),o),{isClone:!0}),l=new n(s);(o.debug!==void 0||o.prefix!==void 0)&&(l.logger=l.logger.clone(o));var u=["store","services","language"];return u.forEach(function(d){l[d]=i[d]}),l.services=Ml({},this.services),l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l.translator=new eR(l.services,l.options),l.translator.on("*",function(d){for(var h=arguments.length,m=new Array(h>1?h-1:0),y=1;y0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new Z5(e,t)});var zt=Z5.createInstance();zt.createInstance=Z5.createInstance;zt.createInstance;zt.dir;zt.init;zt.loadResources;zt.reloadResources;zt.use;zt.changeLanguage;zt.getFixedT;zt.t;zt.exists;zt.setDefaultNamespace;zt.hasLoadedNamespace;zt.loadNamespaces;zt.loadLanguages;function zwe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function J2(e){return J2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},J2(e)}function Hwe(e,t){if(J2(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(J2(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Vwe(e){var t=Hwe(e,"string");return J2(t)==="symbol"?t:String(t)}function cR(e,t){for(var n=0;n0){var s=i.maxAge-0;if(Number.isNaN(s))throw new Error("maxAge should be a Number");a+="; Max-Age=".concat(Math.floor(s))}if(i.domain){if(!dR.test(i.domain))throw new TypeError("option domain is invalid");a+="; Domain=".concat(i.domain)}if(i.path){if(!dR.test(i.path))throw new TypeError("option path is invalid");a+="; Path=".concat(i.path)}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");a+="; Expires=".concat(i.expires.toUTCString())}if(i.httpOnly&&(a+="; HttpOnly"),i.secure&&(a+="; Secure"),i.sameSite){var l=typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite;switch(l){case!0:a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"strict":a+="; SameSite=Strict";break;case"none":a+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return a},fR={create:function(t,n,r,i){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+r*60*1e3)),i&&(o.domain=i),document.cookie=Ywe(t,encodeURIComponent(n),o)},read:function(t){for(var n="".concat(t,"="),r=document.cookie.split(";"),i=0;i-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));for(var i=r.substring(1),o=i.split("&"),a=0;a0){var l=o[a].substring(0,s);l===t.lookupQuerystring&&(n=o[a].substring(s+1))}}}return n}},ov=null,hR=function(){if(ov!==null)return ov;try{ov=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{ov=!1}return ov},Zwe={name:"localStorage",lookup:function(t){var n;if(t.lookupLocalStorage&&hR()){var r=window.localStorage.getItem(t.lookupLocalStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupLocalStorage&&hR()&&window.localStorage.setItem(n.lookupLocalStorage,t)}},av=null,pR=function(){if(av!==null)return av;try{av=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{av=!1}return av},Qwe={name:"sessionStorage",lookup:function(t){var n;if(t.lookupSessionStorage&&pR()){var r=window.sessionStorage.getItem(t.lookupSessionStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupSessionStorage&&pR()&&window.sessionStorage.setItem(n.lookupSessionStorage,t)}},Jwe={name:"navigator",lookup:function(t){var n=[];if(typeof navigator<"u"){if(navigator.languages)for(var r=0;r0?n:void 0}},e6e={name:"htmlTag",lookup:function(t){var n,r=t.htmlTag||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},t6e={name:"path",lookup:function(t){var n;if(typeof window<"u"){var r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(r instanceof Array)if(typeof t.lookupFromPathIndex=="number"){if(typeof r[t.lookupFromPathIndex]!="string")return;n=r[t.lookupFromPathIndex].replace("/","")}else n=r[0].replace("/","")}return n}},n6e={name:"subdomain",lookup:function(t){var n=typeof t.lookupFromSubdomainIndex=="number"?t.lookupFromSubdomainIndex+1:1,r=typeof window<"u"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}};function r6e(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var PU=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};zwe(this,e),this.type="languageDetector",this.detectors={},this.init(t,n)}return Wwe(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=qwe(r,this.options||{},r6e()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(Kwe),this.addDetector(Xwe),this.addDetector(Zwe),this.addDetector(Qwe),this.addDetector(Jwe),this.addDetector(e6e),this.addDetector(t6e),this.addDetector(n6e)}},{key:"addDetector",value:function(n){this.detectors[n.name]=n}},{key:"detect",value:function(n){var r=this;n||(n=this.options.order);var i=[];return n.forEach(function(o){if(r.detectors[o]){var a=r.detectors[o].lookup(r.options);a&&typeof a=="string"&&(a=[a]),a&&(i=i.concat(a))}}),this.services.languageUtils.getBestMatchFromCodes?i:i.length>0?i[0]:null}},{key:"cacheUserLanguage",value:function(n,r){var i=this;r||(r=this.options.caches),r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(n)>-1||r.forEach(function(o){i.detectors[o]&&i.detectors[o].cacheUserLanguage(n,i.options)}))}}]),e}();PU.type="languageDetector";function h8(e){return h8=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h8(e)}var TU=[],i6e=TU.forEach,o6e=TU.slice;function p8(e){return i6e.call(o6e.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e}function LU(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":h8(XMLHttpRequest))==="object"}function a6e(e){return!!e&&typeof e.then=="function"}function s6e(e){return a6e(e)?e:Promise.resolve(e)}function l6e(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var ey={},u6e={get exports(){return ey},set exports(e){ey=e}},o2={},c6e={get exports(){return o2},set exports(e){o2=e}},gR;function d6e(){return gR||(gR=1,function(e,t){var n=typeof self<"u"?self:wo,r=function(){function o(){this.fetch=!1,this.DOMException=n.DOMException}return o.prototype=n,new o}();(function(o){(function(a){var s={searchParams:"URLSearchParams"in o,iterable:"Symbol"in o&&"iterator"in Symbol,blob:"FileReader"in o&&"Blob"in o&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in o,arrayBuffer:"ArrayBuffer"in o};function l(F){return F&&DataView.prototype.isPrototypeOf(F)}if(s.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],d=ArrayBuffer.isView||function(F){return F&&u.indexOf(Object.prototype.toString.call(F))>-1};function h(F){if(typeof F!="string"&&(F=String(F)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(F))throw new TypeError("Invalid character in header field name");return F.toLowerCase()}function m(F){return typeof F!="string"&&(F=String(F)),F}function y(F){var U={next:function(){var X=F.shift();return{done:X===void 0,value:X}}};return s.iterable&&(U[Symbol.iterator]=function(){return U}),U}function b(F){this.map={},F instanceof b?F.forEach(function(U,X){this.append(X,U)},this):Array.isArray(F)?F.forEach(function(U){this.append(U[0],U[1])},this):F&&Object.getOwnPropertyNames(F).forEach(function(U){this.append(U,F[U])},this)}b.prototype.append=function(F,U){F=h(F),U=m(U);var X=this.map[F];this.map[F]=X?X+", "+U:U},b.prototype.delete=function(F){delete this.map[h(F)]},b.prototype.get=function(F){return F=h(F),this.has(F)?this.map[F]:null},b.prototype.has=function(F){return this.map.hasOwnProperty(h(F))},b.prototype.set=function(F,U){this.map[h(F)]=m(U)},b.prototype.forEach=function(F,U){for(var X in this.map)this.map.hasOwnProperty(X)&&F.call(U,this.map[X],X,this)},b.prototype.keys=function(){var F=[];return this.forEach(function(U,X){F.push(X)}),y(F)},b.prototype.values=function(){var F=[];return this.forEach(function(U){F.push(U)}),y(F)},b.prototype.entries=function(){var F=[];return this.forEach(function(U,X){F.push([X,U])}),y(F)},s.iterable&&(b.prototype[Symbol.iterator]=b.prototype.entries);function S(F){if(F.bodyUsed)return Promise.reject(new TypeError("Already read"));F.bodyUsed=!0}function E(F){return new Promise(function(U,X){F.onload=function(){U(F.result)},F.onerror=function(){X(F.error)}})}function k(F){var U=new FileReader,X=E(U);return U.readAsArrayBuffer(F),X}function _(F){var U=new FileReader,X=E(U);return U.readAsText(F),X}function T(F){for(var U=new Uint8Array(F),X=new Array(U.length),Z=0;Z-1?U:F}function j(F,U){U=U||{};var X=U.body;if(F instanceof j){if(F.bodyUsed)throw new TypeError("Already read");this.url=F.url,this.credentials=F.credentials,U.headers||(this.headers=new b(F.headers)),this.method=F.method,this.mode=F.mode,this.signal=F.signal,!X&&F._bodyInit!=null&&(X=F._bodyInit,F.bodyUsed=!0)}else this.url=String(F);if(this.credentials=U.credentials||this.credentials||"same-origin",(U.headers||!this.headers)&&(this.headers=new b(U.headers)),this.method=D(U.method||this.method||"GET"),this.mode=U.mode||this.mode||null,this.signal=U.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&X)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(X)}j.prototype.clone=function(){return new j(this,{body:this._bodyInit})};function z(F){var U=new FormData;return F.trim().split("&").forEach(function(X){if(X){var Z=X.split("="),W=Z.shift().replace(/\+/g," "),Q=Z.join("=").replace(/\+/g," ");U.append(decodeURIComponent(W),decodeURIComponent(Q))}}),U}function V(F){var U=new b,X=F.replace(/\r?\n[\t ]+/g," ");return X.split(/\r?\n/).forEach(function(Z){var W=Z.split(":"),Q=W.shift().trim();if(Q){var ie=W.join(":").trim();U.append(Q,ie)}}),U}I.call(j.prototype);function K(F,U){U||(U={}),this.type="default",this.status=U.status===void 0?200:U.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in U?U.statusText:"OK",this.headers=new b(U.headers),this.url=U.url||"",this._initBody(F)}I.call(K.prototype),K.prototype.clone=function(){return new K(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new b(this.headers),url:this.url})},K.error=function(){var F=new K(null,{status:0,statusText:""});return F.type="error",F};var te=[301,302,303,307,308];K.redirect=function(F,U){if(te.indexOf(U)===-1)throw new RangeError("Invalid status code");return new K(null,{status:U,headers:{location:F}})},a.DOMException=o.DOMException;try{new a.DOMException}catch{a.DOMException=function(U,X){this.message=U,this.name=X;var Z=Error(U);this.stack=Z.stack},a.DOMException.prototype=Object.create(Error.prototype),a.DOMException.prototype.constructor=a.DOMException}function q(F,U){return new Promise(function(X,Z){var W=new j(F,U);if(W.signal&&W.signal.aborted)return Z(new a.DOMException("Aborted","AbortError"));var Q=new XMLHttpRequest;function ie(){Q.abort()}Q.onload=function(){var fe={status:Q.status,statusText:Q.statusText,headers:V(Q.getAllResponseHeaders()||"")};fe.url="responseURL"in Q?Q.responseURL:fe.headers.get("X-Request-URL");var Se="response"in Q?Q.response:Q.responseText;X(new K(Se,fe))},Q.onerror=function(){Z(new TypeError("Network request failed"))},Q.ontimeout=function(){Z(new TypeError("Network request failed"))},Q.onabort=function(){Z(new a.DOMException("Aborted","AbortError"))},Q.open(W.method,W.url,!0),W.credentials==="include"?Q.withCredentials=!0:W.credentials==="omit"&&(Q.withCredentials=!1),"responseType"in Q&&s.blob&&(Q.responseType="blob"),W.headers.forEach(function(fe,Se){Q.setRequestHeader(Se,fe)}),W.signal&&(W.signal.addEventListener("abort",ie),Q.onreadystatechange=function(){Q.readyState===4&&W.signal.removeEventListener("abort",ie)}),Q.send(typeof W._bodyInit>"u"?null:W._bodyInit)})}return q.polyfill=!0,o.fetch||(o.fetch=q,o.Headers=b,o.Request=j,o.Response=K),a.Headers=b,a.Request=j,a.Response=K,a.fetch=q,Object.defineProperty(a,"__esModule",{value:!0}),a})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=r;t=i.fetch,t.default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t}(c6e,o2)),o2}(function(e,t){var n;if(typeof fetch=="function"&&(typeof wo<"u"&&wo.fetch?n=wo.fetch:typeof window<"u"&&window.fetch?n=window.fetch:n=fetch),typeof l6e<"u"&&(typeof window>"u"||typeof window.document>"u")){var r=n||d6e();r.default&&(r=r.default),t.default=r,e.exports=t.default}})(u6e,ey);const AU=ey,mR=rj({__proto__:null,default:AU},[ey]);function Q5(e){return Q5=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Q5(e)}var Yu;typeof fetch=="function"&&(typeof global<"u"&&global.fetch?Yu=global.fetch:typeof window<"u"&&window.fetch?Yu=window.fetch:Yu=fetch);var ty;LU()&&(typeof global<"u"&&global.XMLHttpRequest?ty=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(ty=window.XMLHttpRequest));var J5;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?J5=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(J5=window.ActiveXObject));!Yu&&mR&&!ty&&!J5&&(Yu=AU||mR);typeof Yu!="function"&&(Yu=void 0);var g8=function(t,n){if(n&&Q5(n)==="object"){var r="";for(var i in n)r+="&"+encodeURIComponent(i)+"="+encodeURIComponent(n[i]);if(!r)return t;t=t+(t.indexOf("?")!==-1?"&":"?")+r.slice(1)}return t},vR=function(t,n,r){Yu(t,n).then(function(i){if(!i.ok)return r(i.statusText||"Error",{status:i.status});i.text().then(function(o){r(null,{status:i.status,data:o})}).catch(r)}).catch(r)},yR=!1,f6e=function(t,n,r,i){t.queryStringParams&&(n=g8(n,t.queryStringParams));var o=p8({},typeof t.customHeaders=="function"?t.customHeaders():t.customHeaders);r&&(o["Content-Type"]="application/json");var a=typeof t.requestOptions=="function"?t.requestOptions(r):t.requestOptions,s=p8({method:r?"POST":"GET",body:r?t.stringify(r):void 0,headers:o},yR?{}:a);try{vR(n,s,i)}catch(l){if(!a||Object.keys(a).length===0||!l.message||l.message.indexOf("not implemented")<0)return i(l);try{Object.keys(a).forEach(function(u){delete s[u]}),vR(n,s,i),yR=!0}catch(u){i(u)}}},h6e=function(t,n,r,i){r&&Q5(r)==="object"&&(r=g8("",r).slice(1)),t.queryStringParams&&(n=g8(n,t.queryStringParams));try{var o;ty?o=new ty:o=new J5("MSXML2.XMLHTTP.3.0"),o.open(r?"POST":"GET",n,1),t.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!t.withCredentials,r&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var a=t.customHeaders;if(a=typeof a=="function"?a():a,a)for(var s in a)o.setRequestHeader(s,a[s]);o.onreadystatechange=function(){o.readyState>3&&i(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(r)}catch(l){console&&console.log(l)}},p6e=function(t,n,r,i){if(typeof r=="function"&&(i=r,r=void 0),i=i||function(){},Yu&&n.indexOf("file:")!==0)return f6e(t,n,r,i);if(LU()||typeof ActiveXObject=="function")return h6e(t,n,r,i);i(new Error("No fetch and no xhr implementation found!"))};function ny(e){return ny=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ny(e)}function g6e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bR(e,t){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};g6e(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}return m6e(e,[{key:"init",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=p8(i,this.options||{},b6e()),this.allOptions=o,this.services&&this.options.reloadInterval&&setInterval(function(){return r.reload()},this.options.reloadInterval)}},{key:"readMulti",value:function(n,r,i){this._readAny(n,n,r,r,i)}},{key:"read",value:function(n,r,i){this._readAny([n],n,[r],r,i)}},{key:"_readAny",value:function(n,r,i,o,a){var s=this,l=this.options.loadPath;typeof this.options.loadPath=="function"&&(l=this.options.loadPath(n,i)),l=s6e(l),l.then(function(u){if(!u)return a(null,{});var d=s.services.interpolator.interpolate(u,{lng:n.join("+"),ns:i.join("+")});s.loadUrl(d,a,r,o)})}},{key:"loadUrl",value:function(n,r,i,o){var a=this;this.options.request(this.options,n,void 0,function(s,l){if(l&&(l.status>=500&&l.status<600||!l.status))return r("failed loading "+n+"; status code: "+l.status,!0);if(l&&l.status>=400&&l.status<500)return r("failed loading "+n+"; status code: "+l.status,!1);if(!l&&s&&s.message&&s.message.indexOf("Failed to fetch")>-1)return r("failed loading "+n+": "+s.message,!0);if(s)return r(s,!1);var u,d;try{typeof l.data=="string"?u=a.options.parse(l.data,i,o):u=l.data}catch{d="failed parsing "+n+" to json"}if(d)return r(d,!1);r(null,u)})}},{key:"create",value:function(n,r,i,o,a){var s=this;if(this.options.addPath){typeof n=="string"&&(n=[n]);var l=this.options.parsePayload(r,i,o),u=0,d=[],h=[];n.forEach(function(m){var y=s.options.addPath;typeof s.options.addPath=="function"&&(y=s.options.addPath(m,r));var b=s.services.interpolator.interpolate(y,{lng:m,ns:r});s.options.request(s.options,b,l,function(S,E){u+=1,d.push(S),h.push(E),u===n.length&&a&&a(d,h)})})}}},{key:"reload",value:function(){var n=this,r=this.services,i=r.backendConnector,o=r.languageUtils,a=r.logger,s=i.language;if(!(s&&s.toLowerCase()==="cimode")){var l=[],u=function(h){var m=o.toResolveHierarchy(h);m.forEach(function(y){l.indexOf(y)<0&&l.push(y)})};u(s),this.allOptions.preload&&this.allOptions.preload.forEach(function(d){return u(d)}),l.forEach(function(d){n.allOptions.ns.forEach(function(h){i.read(d,h,"read",null,null,function(m,y){m&&a.warn("loading namespace ".concat(h," for language ").concat(d," failed"),m),!m&&y&&a.log("loaded namespace ".concat(h," for language ").concat(d),y),i.loaded("".concat(d,"|").concat(h),m,y)})})})}}}]),e}();MU.type="backend";function ry(e){return ry=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ry(e)}function S6e(e,t){if(ry(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(ry(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function IU(e){var t=S6e(e,"string");return ry(t)==="symbol"?t:String(t)}function RU(e,t,n){return t=IU(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function x6e(){if(console&&console.warn){for(var e,t=arguments.length,n=new Array(t),r=0;r2&&arguments[2]!==void 0?arguments[2]:{},r=t.languages[0],i=t.options?t.options.fallbackLng:!1,o=t.languages[t.languages.length-1];if(r.toLowerCase()==="cimode")return!0;var a=function(l,u){var d=t.services.backendConnector.state["".concat(l,"|").concat(u)];return d===-1||d===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!a(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(r,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||a(r,e)&&(!i||a(o,e)))}function C6e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!t.languages||!t.languages.length)return m8("i18n.languages were undefined or empty",t.languages),!0;var r=t.options.ignoreJSONStructure!==void 0;return r?t.hasLoadedNamespace(e,{precheck:function(o,a){if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&o.services.backendConnector.backend&&o.isLanguageChangingTo&&!a(o.isLanguageChangingTo,e))return!1}}):w6e(e,t,n)}var _6e=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,k6e={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},E6e=function(t){return k6e[t]},P6e=function(t){return t.replace(_6e,E6e)};function wR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function CR(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{};v8=CR(CR({},v8),e)}function L6e(){return v8}var DU;function A6e(e){DU=e}function O6e(){return DU}function M6e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _R(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:{},n=t.i18n,r=w.useContext(D6e)||{},i=r.i18n,o=r.defaultNS,a=n||i||O6e();if(a&&!a.reportNamespaces&&(a.reportNamespaces=new N6e),!a){m8("You will need to pass in an i18next instance by using initReactI18next");var s=function(z){return Array.isArray(z)?z[z.length-1]:z},l=[s,{},!1];return l.t=s,l.i18n={},l.ready=!1,l}a.options.react&&a.options.react.wait!==void 0&&m8("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var u=CC(CC(CC({},L6e()),a.options.react),t),d=u.useSuspense,h=u.keyPrefix,m=e||o||a.options&&a.options.defaultNS;m=typeof m=="string"?[m]:m||["translation"],a.reportNamespaces.addUsedNamespaces&&a.reportNamespaces.addUsedNamespaces(m);var y=(a.isInitialized||a.initializedStoreOnce)&&m.every(function(j){return C6e(j,a,u)});function b(){return a.getFixedT(null,u.nsMode==="fallback"?m:m[0],h)}var S=w.useState(b),E=z6e(S,2),k=E[0],_=E[1],T=m.join(),A=H6e(T),I=w.useRef(!0);w.useEffect(function(){var j=u.bindI18n,z=u.bindI18nStore;I.current=!0,!y&&!d&&xR(a,m,function(){I.current&&_(b)}),y&&A&&A!==T&&I.current&&_(b);function V(){I.current&&_(b)}return j&&a&&a.on(j,V),z&&a&&a.store.on(z,V),function(){I.current=!1,j&&a&&j.split(" ").forEach(function(K){return a.off(K,V)}),z&&a&&z.split(" ").forEach(function(K){return a.store.off(K,V)})}},[a,T]);var R=w.useRef(!0);w.useEffect(function(){I.current&&!R.current&&_(b),R.current=!1},[a,h]);var D=[k,a,y];if(D.t=k,D.i18n=a,D.ready=y,y||!y&&!d)return D;throw new Promise(function(j){xR(a,m,function(){j()})})}zt.use(MU).use(PU).use(R6e).init({fallbackLng:"en",debug:!1,ns:["common","gallery","hotkeys","parameters","settings","modelmanager","toast","tooltip","unifiedcanvas"],backend:{loadPath:"/locales/{{ns}}/{{lng}}.json"},interpolation:{escapeValue:!1},returnNull:!1});const V6e={isConnected:!1,isProcessing:!1,log:[],shouldShowLogViewer:!1,shouldDisplayInProgressType:"latents",shouldDisplayGuides:!0,isGFPGANAvailable:!0,isESRGANAvailable:!0,socketId:"",shouldConfirmOnDelete:!0,openAccordions:[],currentStep:0,totalSteps:0,currentIteration:0,totalIterations:0,currentStatus:zt.isInitialized?zt.t("common:statusDisconnected"):"Disconnected",currentStatusHasSteps:!1,model:"",model_id:"",model_hash:"",app_id:"",app_version:"",model_list:{},infill_methods:[],hasError:!1,wasErrorSeen:!0,isCancelable:!0,saveIntermediatesInterval:5,enableImageDebugging:!1,toastQueue:[],searchFolder:null,foundModels:null,openModel:null},NU=cp({name:"system",initialState:V6e,reducers:{setShouldDisplayInProgressType:(e,t)=>{e.shouldDisplayInProgressType=t.payload},setIsProcessing:(e,t)=>{e.isProcessing=t.payload},setCurrentStatus:(e,t)=>{e.currentStatus=t.payload},setSystemStatus:(e,t)=>({...e,...t.payload}),errorOccurred:e=>{e.hasError=!0,e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus=zt.t("common:statusError"),e.wasErrorSeen=!1},errorSeen:e=>{e.hasError=!1,e.wasErrorSeen=!0,e.currentStatus=e.isConnected?zt.t("common:statusConnected"):zt.t("common:statusDisconnected")},addLogEntry:(e,t)=>{const{timestamp:n,message:r,level:i}=t.payload,a={timestamp:n,message:r,level:i||"info"};e.log.push(a)},setShouldShowLogViewer:(e,t)=>{e.shouldShowLogViewer=t.payload},setIsConnected:(e,t)=>{e.isConnected=t.payload,e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.hasError=!1},setSocketId:(e,t)=>{e.socketId=t.payload},setShouldConfirmOnDelete:(e,t)=>{e.shouldConfirmOnDelete=t.payload},setOpenAccordions:(e,t)=>{e.openAccordions=t.payload},setSystemConfig:(e,t)=>({...e,...t.payload}),setShouldDisplayGuides:(e,t)=>{e.shouldDisplayGuides=t.payload},processingCanceled:e=>{e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus=zt.t("common:statusProcessingCanceled")},generationRequested:e=>{e.isProcessing=!0,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus=zt.t("common:statusPreparing")},setModelList:(e,t)=>{e.model_list=t.payload},setIsCancelable:(e,t)=>{e.isCancelable=t.payload},modelChangeRequested:e=>{e.currentStatus=zt.t("common:statusLoadingModel"),e.isCancelable=!1,e.isProcessing=!0,e.currentStatusHasSteps=!1},setSaveIntermediatesInterval:(e,t)=>{e.saveIntermediatesInterval=t.payload},setEnableImageDebugging:(e,t)=>{e.enableImageDebugging=t.payload},addToast:(e,t)=>{e.toastQueue.push(t.payload)},clearToastQueue:e=>{e.toastQueue=[]},setProcessingIndeterminateTask:(e,t)=>{e.isProcessing=!0,e.currentStatus=t.payload,e.currentStatusHasSteps=!1},setSearchFolder:(e,t)=>{e.searchFolder=t.payload},setFoundModels:(e,t)=>{e.foundModels=t.payload},setOpenModel:(e,t)=>{e.openModel=t.payload}}}),{setShouldDisplayInProgressType:W6e,setIsProcessing:Hs,addLogEntry:to,setShouldShowLogViewer:_C,setIsConnected:PR,setSocketId:hze,setShouldConfirmOnDelete:jU,setOpenAccordions:U6e,setSystemStatus:G6e,setCurrentStatus:D4,setSystemConfig:q6e,setShouldDisplayGuides:Y6e,processingCanceled:K6e,errorOccurred:TR,errorSeen:BU,setModelList:Tb,setIsCancelable:lm,modelChangeRequested:X6e,setSaveIntermediatesInterval:Z6e,setEnableImageDebugging:Q6e,generationRequested:J6e,addToast:Th,clearToastQueue:eCe,setProcessingIndeterminateTask:tCe,setSearchFolder:FU,setFoundModels:$U,setOpenModel:LR}=NU.actions,nCe=NU.reducer,cP=["txt2img","img2img","unifiedCanvas","nodes","postprocess","training"],rCe={activeTab:0,currentTheme:"dark",parametersPanelScrollPosition:0,shouldHoldParametersPanelOpen:!1,shouldPinParametersPanel:!0,shouldShowParametersPanel:!0,shouldShowDualDisplay:!0,shouldShowImageDetails:!1,shouldUseCanvasBetaLayout:!1,shouldShowExistingModelsInSearch:!1,addNewModelUIOption:null},iCe=rCe,zU=cp({name:"ui",initialState:iCe,reducers:{setActiveTab:(e,t)=>{typeof t.payload=="number"?e.activeTab=t.payload:e.activeTab=cP.indexOf(t.payload)},setCurrentTheme:(e,t)=>{e.currentTheme=t.payload},setParametersPanelScrollPosition:(e,t)=>{e.parametersPanelScrollPosition=t.payload},setShouldPinParametersPanel:(e,t)=>{e.shouldPinParametersPanel=t.payload},setShouldShowParametersPanel:(e,t)=>{e.shouldShowParametersPanel=t.payload},setShouldHoldParametersPanelOpen:(e,t)=>{e.shouldHoldParametersPanelOpen=t.payload},setShouldShowDualDisplay:(e,t)=>{e.shouldShowDualDisplay=t.payload},setShouldShowImageDetails:(e,t)=>{e.shouldShowImageDetails=t.payload},setShouldUseCanvasBetaLayout:(e,t)=>{e.shouldUseCanvasBetaLayout=t.payload},setShouldShowExistingModelsInSearch:(e,t)=>{e.shouldShowExistingModelsInSearch=t.payload},setAddNewModelUIOption:(e,t)=>{e.addNewModelUIOption=t.payload}}}),{setActiveTab:qo,setCurrentTheme:oCe,setParametersPanelScrollPosition:aCe,setShouldHoldParametersPanelOpen:sCe,setShouldPinParametersPanel:lCe,setShouldShowParametersPanel:Ku,setShouldShowDualDisplay:uCe,setShouldShowImageDetails:HU,setShouldUseCanvasBetaLayout:cCe,setShouldShowExistingModelsInSearch:dCe,setAddNewModelUIOption:zh}=zU.actions,fCe=zU.reducer,lu=Object.create(null);lu.open="0";lu.close="1";lu.ping="2";lu.pong="3";lu.message="4";lu.upgrade="5";lu.noop="6";const N4=Object.create(null);Object.keys(lu).forEach(e=>{N4[lu[e]]=e});const hCe={type:"error",data:"parser error"},pCe=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",gCe=typeof ArrayBuffer=="function",mCe=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,VU=({type:e,data:t},n,r)=>pCe&&t instanceof Blob?n?r(t):AR(t,r):gCe&&(t instanceof ArrayBuffer||mCe(t))?n?r(t):AR(new Blob([t]),r):r(lu[e]+(t||"")),AR=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+r)},n.readAsDataURL(e)},OR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Pv=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e{let t=e.length*.75,n=e.length,r,i=0,o,a,s,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),d=new Uint8Array(u);for(r=0;r>4,d[i++]=(a&15)<<4|s>>2,d[i++]=(s&3)<<6|l&63;return u},yCe=typeof ArrayBuffer=="function",WU=(e,t)=>{if(typeof e!="string")return{type:"message",data:UU(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:bCe(e.substring(1),t)}:N4[n]?e.length>1?{type:N4[n],data:e.substring(1)}:{type:N4[n]}:hCe},bCe=(e,t)=>{if(yCe){const n=vCe(e);return UU(n,t)}else return{base64:!0,data:e}},UU=(e,t)=>{switch(t){case"blob":return e instanceof ArrayBuffer?new Blob([e]):e;case"arraybuffer":default:return e}},GU=String.fromCharCode(30),SCe=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,a)=>{VU(o,!1,s=>{r[a]=s,++i===n&&t(r.join(GU))})})},xCe=(e,t)=>{const n=e.split(GU),r=[];for(let i=0;itypeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function YU(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const CCe=setTimeout,_Ce=clearTimeout;function $x(e,t){t.useNativeTimers?(e.setTimeoutFn=CCe.bind(Pd),e.clearTimeoutFn=_Ce.bind(Pd)):(e.setTimeoutFn=setTimeout.bind(Pd),e.clearTimeoutFn=clearTimeout.bind(Pd))}const kCe=1.33;function ECe(e){return typeof e=="string"?PCe(e):Math.ceil((e.byteLength||e.size)*kCe)}function PCe(e){let t=0,n=0;for(let r=0,i=e.length;r=57344?n+=3:(r++,n+=4);return n}class TCe extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class KU extends si{constructor(t){super(),this.writable=!1,$x(this,t),this.opts=t,this.query=t.query,this.readyState="",this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new TCe(t,n,r)),this}open(){return(this.readyState==="closed"||this.readyState==="")&&(this.readyState="opening",this.doOpen()),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=WU(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}}const XU="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),y8=64,LCe={};let MR=0,Lb=0,IR;function RR(e){let t="";do t=XU[e%y8]+t,e=Math.floor(e/y8);while(e>0);return t}function ZU(){const e=RR(+new Date);return e!==IR?(MR=0,IR=e):e+"."+RR(MR++)}for(;Lb{this.readyState="paused",t()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};xCe(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,SCe(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let t=this.query||{};const n=this.opts.secure?"https":"http";let r="";this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=ZU()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.opts.port&&(n==="https"&&Number(this.opts.port)!==443||n==="http"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port);const i=QU(t),o=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(o?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(i.length?"?"+i:"")}request(t={}){return Object.assign(t,{xd:this.xd,xs:this.xs},this.opts),new nu(this.uri(),t)}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class nu extends si{constructor(t,n){super(),$x(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.async=n.async!==!1,this.data=n.data!==void 0?n.data:null,this.create()}create(){const t=YU(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd,t.xscheme=!!this.opts.xs;const n=this.xhr=new eG(t);try{n.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let r in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(r)&&n.setRequestHeader(r,this.opts.extraHeaders[r])}}catch{}if(this.method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}"withCredentials"in n&&(n.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(n.timeout=this.opts.requestTimeout),n.onreadystatechange=()=>{n.readyState===4&&(n.status===200||n.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof n.status=="number"?n.status:0)},0))},n.send(this.data)}catch(r){this.setTimeoutFn(()=>{this.onError(r)},0);return}typeof document<"u"&&(this.index=nu.requestsCount++,nu.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=MCe,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete nu.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}nu.requestsCount=0;nu.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",DR);else if(typeof addEventListener=="function"){const e="onpagehide"in Pd?"pagehide":"unload";addEventListener(e,DR,!1)}}function DR(){for(let e in nu.requests)nu.requests.hasOwnProperty(e)&&nu.requests[e].abort()}const tG=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),Ab=Pd.WebSocket||Pd.MozWebSocket,NR=!0,DCe="arraybuffer",jR=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class NCe extends KU{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),n=this.opts.protocols,r=jR?{}:YU(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=NR&&!jR?n?new Ab(t,n):new Ab(t):new Ab(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType||DCe,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n{const a={};try{NR&&this.ws.send(o)}catch{}i&&tG(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){let t=this.query||{};const n=this.opts.secure?"wss":"ws";let r="";this.opts.port&&(n==="wss"&&Number(this.opts.port)!==443||n==="ws"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port),this.opts.timestampRequests&&(t[this.opts.timestampParam]=ZU()),this.supportsBinary||(t.b64=1);const i=QU(t),o=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(o?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(i.length?"?"+i:"")}check(){return!!Ab}}const jCe={websocket:NCe,polling:RCe},BCe=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,FCe=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function b8(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=BCe.exec(e||""),o={},a=14;for(;a--;)o[FCe[a]]=i[a]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=$Ce(o,o.path),o.queryKey=zCe(o,o.query),o}function $Ce(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function zCe(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}let nG=class Fg extends si{constructor(t,n={}){super(),t&&typeof t=="object"&&(n=t,t=null),t?(t=b8(t),n.hostname=t.host,n.secure=t.protocol==="https"||t.protocol==="wss",n.port=t.port,t.query&&(n.query=t.query)):n.host&&(n.hostname=b8(n.host).host),$x(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},n),this.opts.path=this.opts.path.replace(/\/$/,"")+"/",typeof this.opts.query=="string"&&(this.opts.query=ACe(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=qU,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts.transportOptions[t],this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new jCe[t](r)}open(){let t;if(this.opts.rememberUpgrade&&Fg.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch{this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(t){let n=this.createTransport(t),r=!1;Fg.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",h=>{if(!r)if(h.type==="pong"&&h.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Fg.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const m=new Error("probe error");m.transport=n.name,this.emitReserved("upgradeError",m)}}))};function o(){r||(r=!0,d(),n.close(),n=null)}const a=h=>{const m=new Error("probe error: "+h);m.transport=n.name,o(),this.emitReserved("upgradeError",m)};function s(){a("transport closed")}function l(){a("socket closed")}function u(h){n&&h.name!==n.name&&o()}const d=()=>{n.removeListener("open",i),n.removeListener("error",a),n.removeListener("close",s),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",a),n.once("close",s),this.once("close",l),this.once("upgrading",u),n.open()}onOpen(){if(this.readyState="open",Fg.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade&&this.transport.pause){let t=0;const n=this.upgrades.length;for(;t{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.getWritablePackets();this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r0&&n>this.maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}write(t,n,r){return this.sendPacket("message",t,n,r),this}send(t,n,r){return this.sendPacket("message",t,n,r),this}sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}onError(t){Fg.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const n=[];let r=0;const i=t.length;for(;rtypeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,rG=Object.prototype.toString,UCe=typeof Blob=="function"||typeof Blob<"u"&&rG.call(Blob)==="[object BlobConstructor]",GCe=typeof File=="function"||typeof File<"u"&&rG.call(File)==="[object FileConstructor]";function dP(e){return VCe&&(e instanceof ArrayBuffer||WCe(e))||UCe&&e instanceof Blob||GCe&&e instanceof File}function j4(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n=0&&e.num0;case cn.ACK:case cn.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}class ZCe{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=YCe(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const QCe=Object.freeze(Object.defineProperty({__proto__:null,Decoder:fP,Encoder:XCe,get PacketType(){return cn},protocol:KCe},Symbol.toStringTag,{value:"Module"}));function Bs(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const JCe=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class iG extends si{constructor(t,n,r){super(),this.connected=!1,this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Bs(t,"open",this.onopen.bind(this)),Bs(t,"packet",this.onpacket.bind(this)),Bs(t,"error",this.onerror.bind(this)),Bs(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){if(JCe.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');n.unshift(t);const r={type:cn.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const a=this.ids++,s=n.pop();this._registerAckCallback(a,s),r.id=a}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)||(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(t,n){const r=this.flags.timeout;if(r===void 0){this.acks[t]=n;return}const i=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let o=0;o{this.io.clearTimeoutFn(i),n.apply(this,[null,...o])}}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this.packet({type:cn.CONNECT,data:t})}):this.packet({type:cn.CONNECT,data:this.auth})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case cn.CONNECT:if(t.data&&t.data.sid){const i=t.data.sid;this.onconnect(i)}else this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case cn.EVENT:case cn.BINARY_EVENT:this.onevent(t);break;case cn.ACK:case cn.BINARY_ACK:this.onack(t);break;case cn.DISCONNECT:this.ondisconnect();break;case cn.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t)}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:cn.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(n.apply(this,t.data),delete this.acks[t.id])}onconnect(t){this.id=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:cn.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r0&&e.jitter<=1?e.jitter:0,this.attempts=0}E0.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};E0.prototype.reset=function(){this.attempts=0};E0.prototype.setMin=function(e){this.ms=e};E0.prototype.setMax=function(e){this.max=e};E0.prototype.setJitter=function(e){this.jitter=e};class w8 extends si{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,$x(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new E0({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||QCe;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new nG(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=Bs(n,"open",function(){r.onopen(),t&&t()}),o=Bs(n,"error",a=>{r.cleanup(),r._readyState="closed",this.emitReserved("error",a),t?t(a):r.maybeReconnectOnOpen()});if(this._timeout!==!1){const a=this._timeout;a===0&&i();const s=this.setTimeoutFn(()=>{i(),n.close(),n.emit("error",new Error("timeout"))},a);this.opts.autoUnref&&s.unref(),this.subs.push(function(){clearTimeout(s)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Bs(t,"ping",this.onping.bind(this)),Bs(t,"data",this.ondata.bind(this)),Bs(t,"error",this.onerror.bind(this)),Bs(t,"close",this.onclose.bind(this)),Bs(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){tG(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r||(r=new iG(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;rt()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(function(){clearTimeout(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const sv={};function B4(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=HCe(e,t.path||"/socket.io"),r=n.source,i=n.id,o=n.path,a=sv[i]&&o in sv[i].nsps,s=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let l;return s?l=new w8(r,t):(sv[i]||(sv[i]=new w8(r,t)),l=sv[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(B4,{Manager:w8,Socket:iG,io:B4,connect:B4});const e7e=["ddim","plms","k_lms","k_dpm_2","k_dpm_2_a","k_dpmpp_2","k_dpmpp_2_a","k_euler","k_euler_a","k_heun"],t7e=["ddim","plms","k_lms","dpmpp_2","k_dpm_2","k_dpm_2_a","k_dpmpp_2","k_euler","k_euler_a","k_heun"],n7e=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024,1088,1152,1216,1280,1344,1408,1472,1536,1600,1664,1728,1792,1856,1920,1984,2048],r7e=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024,1088,1152,1216,1280,1344,1408,1472,1536,1600,1664,1728,1792,1856,1920,1984,2048],i7e=[{key:"2x",value:2},{key:"4x",value:4}],hP=0,pP=4294967295,o7e=["gfpgan","codeformer"],a7e=[{key:"None",value:"none"},{key:"Fast",value:"latents"},{key:"Accurate",value:"full-res"}];var s7e=Math.PI/180;function l7e(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}const Fm=typeof global<"u"?global:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},pt={_global:Fm,version:"8.3.14",isBrowser:l7e(),isUnminified:/param/.test(function(e){}.toString()),dblClickWindow:400,getAngle(e){return pt.angleDeg?e*s7e:e},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return pt.DD.isDragging},isDragReady(){return!!pt.DD.node},releaseCanvasOnDestroy:!0,document:Fm.document,_injectGlobal(e){Fm.Konva=e}},Ar=e=>{pt[e.prototype.getClassName()]=e};pt._injectGlobal(pt);class ka{constructor(t=[1,0,0,1,0,0]){this.dirty=!1,this.m=t&&t.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new ka(this.m)}copyInto(t){t.m[0]=this.m[0],t.m[1]=this.m[1],t.m[2]=this.m[2],t.m[3]=this.m[3],t.m[4]=this.m[4],t.m[5]=this.m[5]}point(t){var n=this.m;return{x:n[0]*t.x+n[2]*t.y+n[4],y:n[1]*t.x+n[3]*t.y+n[5]}}translate(t,n){return this.m[4]+=this.m[0]*t+this.m[2]*n,this.m[5]+=this.m[1]*t+this.m[3]*n,this}scale(t,n){return this.m[0]*=t,this.m[1]*=t,this.m[2]*=n,this.m[3]*=n,this}rotate(t){var n=Math.cos(t),r=Math.sin(t),i=this.m[0]*n+this.m[2]*r,o=this.m[1]*n+this.m[3]*r,a=this.m[0]*-r+this.m[2]*n,s=this.m[1]*-r+this.m[3]*n;return this.m[0]=i,this.m[1]=o,this.m[2]=a,this.m[3]=s,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(t,n){var r=this.m[0]+this.m[2]*n,i=this.m[1]+this.m[3]*n,o=this.m[2]+this.m[0]*t,a=this.m[3]+this.m[1]*t;return this.m[0]=r,this.m[1]=i,this.m[2]=o,this.m[3]=a,this}multiply(t){var n=this.m[0]*t.m[0]+this.m[2]*t.m[1],r=this.m[1]*t.m[0]+this.m[3]*t.m[1],i=this.m[0]*t.m[2]+this.m[2]*t.m[3],o=this.m[1]*t.m[2]+this.m[3]*t.m[3],a=this.m[0]*t.m[4]+this.m[2]*t.m[5]+this.m[4],s=this.m[1]*t.m[4]+this.m[3]*t.m[5]+this.m[5];return this.m[0]=n,this.m[1]=r,this.m[2]=i,this.m[3]=o,this.m[4]=a,this.m[5]=s,this}invert(){var t=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),n=this.m[3]*t,r=-this.m[1]*t,i=-this.m[2]*t,o=this.m[0]*t,a=t*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),s=t*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=n,this.m[1]=r,this.m[2]=i,this.m[3]=o,this.m[4]=a,this.m[5]=s,this}getMatrix(){return this.m}decompose(){var t=this.m[0],n=this.m[1],r=this.m[2],i=this.m[3],o=this.m[4],a=this.m[5],s=t*i-n*r;let l={x:o,y:a,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(t!=0||n!=0){var u=Math.sqrt(t*t+n*n);l.rotation=n>0?Math.acos(t/u):-Math.acos(t/u),l.scaleX=u,l.scaleY=s/u,l.skewX=(t*r+n*i)/s,l.skewY=0}else if(r!=0||i!=0){var d=Math.sqrt(r*r+i*i);l.rotation=Math.PI/2-(i>0?Math.acos(-r/d):-Math.acos(r/d)),l.scaleX=s/d,l.scaleY=d,l.skewX=0,l.skewY=(t*r+n*i)/s}return l.rotation=de._getRotation(l.rotation),l}}var u7e="[object Array]",c7e="[object Number]",d7e="[object String]",f7e="[object Boolean]",h7e=Math.PI/180,p7e=180/Math.PI,kC="#",g7e="",m7e="0",v7e="Konva warning: ",BR="Konva error: ",y7e="rgb(",EC={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},b7e=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,Ob=[];const S7e=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(e){setTimeout(e,60)},de={_isElement(e){return!!(e&&e.nodeType==1)},_isFunction(e){return!!(e&&e.constructor&&e.call&&e.apply)},_isPlainObject(e){return!!e&&e.constructor===Object},_isArray(e){return Object.prototype.toString.call(e)===u7e},_isNumber(e){return Object.prototype.toString.call(e)===c7e&&!isNaN(e)&&isFinite(e)},_isString(e){return Object.prototype.toString.call(e)===d7e},_isBoolean(e){return Object.prototype.toString.call(e)===f7e},isObject(e){return e instanceof Object},isValidSelector(e){if(typeof e!="string")return!1;var t=e[0];return t==="#"||t==="."||t===t.toUpperCase()},_sign(e){return e===0||e>0?1:-1},requestAnimFrame(e){Ob.push(e),Ob.length===1&&S7e(function(){const t=Ob;Ob=[],t.forEach(function(n){n()})})},createCanvasElement(){var e=document.createElement("canvas");try{e.style=e.style||{}}catch{}return e},createImageElement(){return document.createElement("img")},_isInDocument(e){for(;e=e.parentNode;)if(e==document)return!0;return!1},_urlToImage(e,t){var n=de.createImageElement();n.onload=function(){t(n)},n.src=e},_rgbToHex(e,t,n){return((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1)},_hexToRgb(e){e=e.replace(kC,g7e);var t=parseInt(e,16);return{r:t>>16&255,g:t>>8&255,b:t&255}},getRandomColor(){for(var e=(Math.random()*16777215<<0).toString(16);e.length<6;)e=m7e+e;return kC+e},getRGB(e){var t;return e in EC?(t=EC[e],{r:t[0],g:t[1],b:t[2]}):e[0]===kC?this._hexToRgb(e.substring(1)):e.substr(0,4)===y7e?(t=b7e.exec(e.replace(/ /g,"")),{r:parseInt(t[1],10),g:parseInt(t[2],10),b:parseInt(t[3],10)}):{r:0,g:0,b:0}},colorToRGBA(e){return e=e||"black",de._namedColorToRBA(e)||de._hex3ColorToRGBA(e)||de._hex6ColorToRGBA(e)||de._rgbColorToRGBA(e)||de._rgbaColorToRGBA(e)||de._hslColorToRGBA(e)},_namedColorToRBA(e){var t=EC[e.toLowerCase()];return t?{r:t[0],g:t[1],b:t[2],a:1}:null},_rgbColorToRGBA(e){if(e.indexOf("rgb(")===0){e=e.match(/rgb\(([^)]+)\)/)[1];var t=e.split(/ *, */).map(Number);return{r:t[0],g:t[1],b:t[2],a:1}}},_rgbaColorToRGBA(e){if(e.indexOf("rgba(")===0){e=e.match(/rgba\(([^)]+)\)/)[1];var t=e.split(/ *, */).map((n,r)=>n.slice(-1)==="%"?r===3?parseInt(n)/100:parseInt(n)/100*255:Number(n));return{r:t[0],g:t[1],b:t[2],a:t[3]}}},_hex6ColorToRGBA(e){if(e[0]==="#"&&e.length===7)return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:1}},_hex3ColorToRGBA(e){if(e[0]==="#"&&e.length===4)return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:1}},_hslColorToRGBA(e){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(e)){const[t,...n]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(e),r=Number(n[0])/360,i=Number(n[1])/100,o=Number(n[2])/100;let a,s,l;if(i===0)return l=o*255,{r:Math.round(l),g:Math.round(l),b:Math.round(l),a:1};o<.5?a=o*(1+i):a=o+i-o*i;const u=2*o-a,d=[0,0,0];for(let h=0;h<3;h++)s=r+1/3*-(h-1),s<0&&s++,s>1&&s--,6*s<1?l=u+(a-u)*6*s:2*s<1?l=a:3*s<2?l=u+(a-u)*(2/3-s)*6:l=u,d[h]=l*255;return{r:Math.round(d[0]),g:Math.round(d[1]),b:Math.round(d[2]),a:1}}},haveIntersection(e,t){return!(t.x>e.x+e.width||t.x+t.widthe.y+e.height||t.y+t.height1?(a=n,s=r,l=(n-i)*(n-i)+(r-o)*(r-o)):(a=e+d*(n-e),s=t+d*(r-t),l=(a-i)*(a-i)+(s-o)*(s-o))}return[a,s,l]},_getProjectionToLine(e,t,n){var r=de.cloneObject(e),i=Number.MAX_VALUE;return t.forEach(function(o,a){if(!(!n&&a===t.length-1)){var s=t[(a+1)%t.length],l=de._getProjectionToSegment(o.x,o.y,s.x,s.y,e.x,e.y),u=l[0],d=l[1],h=l[2];ht.length){var a=t;t=e,e=a}for(r=0;r{t.width=0,t.height=0})}};function df(e){return de._isString(e)?'"'+e+'"':Object.prototype.toString.call(e)==="[object Number]"||de._isBoolean(e)?e:Object.prototype.toString.call(e)}function oG(e){return e>255?255:e<0?0:Math.round(e)}function Ge(){if(pt.isUnminified)return function(e,t){return de._isNumber(e)||de.warn(df(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}function aG(e){if(pt.isUnminified)return function(t,n){let r=de._isNumber(t),i=de._isArray(t)&&t.length==e;return!r&&!i&&de.warn(df(t)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array('+e+")"),t}}function gP(){if(pt.isUnminified)return function(e,t){var n=de._isNumber(e),r=e==="auto";return n||r||de.warn(df(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}function P0(){if(pt.isUnminified)return function(e,t){return de._isString(e)||de.warn(df(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}function sG(){if(pt.isUnminified)return function(e,t){const n=de._isString(e),r=Object.prototype.toString.call(e)==="[object CanvasGradient]"||e&&e.addColorStop;return n||r||de.warn(df(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}function x7e(){if(pt.isUnminified)return function(e,t){const n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&e instanceof n||(de._isArray(e)?e.forEach(function(r){de._isNumber(r)||de.warn('"'+t+'" attribute has non numeric element '+r+". Make sure that all elements are numbers.")}):de.warn(df(e)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),e}}function nl(){if(pt.isUnminified)return function(e,t){var n=e===!0||e===!1;return n||de.warn(df(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}function w7e(e){if(pt.isUnminified)return function(t,n){return t==null||de.isObject(t)||de.warn(df(t)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+e),t}}var lv="get",uv="set";const ee={addGetterSetter(e,t,n,r,i){ee.addGetter(e,t,n),ee.addSetter(e,t,r,i),ee.addOverloadedGetterSetter(e,t)},addGetter(e,t,n){var r=lv+de._capitalize(t);e.prototype[r]=e.prototype[r]||function(){var i=this.attrs[t];return i===void 0?n:i}},addSetter(e,t,n,r){var i=uv+de._capitalize(t);e.prototype[i]||ee.overWriteSetter(e,t,n,r)},overWriteSetter(e,t,n,r){var i=uv+de._capitalize(t);e.prototype[i]=function(o){return n&&o!==void 0&&o!==null&&(o=n.call(this,o,t)),this._setAttr(t,o),r&&r.call(this),this}},addComponentsGetterSetter(e,t,n,r,i){var o=n.length,a=de._capitalize,s=lv+a(t),l=uv+a(t),u,d;e.prototype[s]=function(){var m={};for(u=0;u{this._setAttr(t+a(S),void 0)}),this._fireChangeEvent(t,y,m),i&&i.call(this),this},ee.addOverloadedGetterSetter(e,t)},addOverloadedGetterSetter(e,t){var n=de._capitalize(t),r=uv+n,i=lv+n;e.prototype[t]=function(){return arguments.length?(this[r](arguments[0]),this):this[i]()}},addDeprecatedGetterSetter(e,t,n,r){de.error("Adding deprecated "+t);var i=lv+de._capitalize(t),o=t+" property is deprecated and will be removed soon. Look at Konva change log for more information.";e.prototype[i]=function(){de.error(o);var a=this.attrs[t];return a===void 0?n:a},ee.addSetter(e,t,r,function(){de.error(o)}),ee.addOverloadedGetterSetter(e,t)},backCompat(e,t){de.each(t,function(n,r){var i=e.prototype[r],o=lv+de._capitalize(n),a=uv+de._capitalize(n);function s(){i.apply(this,arguments),de.error('"'+n+'" method is deprecated and will be removed soon. Use ""'+r+'" instead.')}e.prototype[n]=s,e.prototype[o]=s,e.prototype[a]=s})},afterSetFilter(){this._filterUpToDate=!1}};function C7e(e){var t=[],n=e.length,r=de,i,o;for(i=0;itypeof d=="number"?Math.floor(d):d)),o+=_7e+u.join(FR)+k7e)):(o+=s.property,t||(o+=A7e+s.val)),o+=T7e;return o}clearTrace(){this.traceArr=[]}_trace(t){var n=this.traceArr,r;n.push(t),r=n.length,r>=M7e&&n.shift()}reset(){var t=this.getCanvas().getPixelRatio();this.setTransform(1*t,0,0,1*t,0,0)}getCanvas(){return this.canvas}clear(t){var n=this.getCanvas();t?this.clearRect(t.x||0,t.y||0,t.width||0,t.height||0):this.clearRect(0,0,n.getWidth()/n.pixelRatio,n.getHeight()/n.pixelRatio)}_applyLineCap(t){var n=t.getLineCap();n&&this.setAttr("lineCap",n)}_applyOpacity(t){var n=t.getAbsoluteOpacity();n!==1&&this.setAttr("globalAlpha",n)}_applyLineJoin(t){var n=t.attrs.lineJoin;n&&this.setAttr("lineJoin",n)}setAttr(t,n){this._context[t]=n}arc(t,n,r,i,o,a){this._context.arc(t,n,r,i,o,a)}arcTo(t,n,r,i,o){this._context.arcTo(t,n,r,i,o)}beginPath(){this._context.beginPath()}bezierCurveTo(t,n,r,i,o,a){this._context.bezierCurveTo(t,n,r,i,o,a)}clearRect(t,n,r,i){this._context.clearRect(t,n,r,i)}clip(){this._context.clip()}closePath(){this._context.closePath()}createImageData(t,n){var r=arguments;if(r.length===2)return this._context.createImageData(t,n);if(r.length===1)return this._context.createImageData(t)}createLinearGradient(t,n,r,i){return this._context.createLinearGradient(t,n,r,i)}createPattern(t,n){return this._context.createPattern(t,n)}createRadialGradient(t,n,r,i,o,a){return this._context.createRadialGradient(t,n,r,i,o,a)}drawImage(t,n,r,i,o,a,s,l,u){var d=arguments,h=this._context;d.length===3?h.drawImage(t,n,r):d.length===5?h.drawImage(t,n,r,i,o):d.length===9&&h.drawImage(t,n,r,i,o,a,s,l,u)}ellipse(t,n,r,i,o,a,s,l){this._context.ellipse(t,n,r,i,o,a,s,l)}isPointInPath(t,n){return this._context.isPointInPath(t,n)}fill(t){t?this._context.fill(t):this._context.fill()}fillRect(t,n,r,i){this._context.fillRect(t,n,r,i)}strokeRect(t,n,r,i){this._context.strokeRect(t,n,r,i)}fillText(t,n,r,i){i?this._context.fillText(t,n,r,i):this._context.fillText(t,n,r)}measureText(t){return this._context.measureText(t)}getImageData(t,n,r,i){return this._context.getImageData(t,n,r,i)}lineTo(t,n){this._context.lineTo(t,n)}moveTo(t,n){this._context.moveTo(t,n)}rect(t,n,r,i){this._context.rect(t,n,r,i)}putImageData(t,n,r){this._context.putImageData(t,n,r)}quadraticCurveTo(t,n,r,i){this._context.quadraticCurveTo(t,n,r,i)}restore(){this._context.restore()}rotate(t){this._context.rotate(t)}save(){this._context.save()}scale(t,n){this._context.scale(t,n)}setLineDash(t){this._context.setLineDash?this._context.setLineDash(t):"mozDash"in this._context?this._context.mozDash=t:"webkitLineDash"in this._context&&(this._context.webkitLineDash=t)}getLineDash(){return this._context.getLineDash()}setTransform(t,n,r,i,o,a){this._context.setTransform(t,n,r,i,o,a)}stroke(t){t?this._context.stroke(t):this._context.stroke()}strokeText(t,n,r,i){this._context.strokeText(t,n,r,i)}transform(t,n,r,i,o,a){this._context.transform(t,n,r,i,o,a)}translate(t,n){this._context.translate(t,n)}_enableTrace(){var t=this,n=$R.length,r=this.setAttr,i,o,a=function(s){var l=t[s],u;t[s]=function(){return o=C7e(Array.prototype.slice.call(arguments,0)),u=l.apply(t,arguments),t._trace({method:s,args:o}),u}};for(i=0;i{t.dragStatus==="dragging"&&(e=!0)}),e},justDragged:!1,get node(){var e;return vn._dragElements.forEach(t=>{e=t.node}),e},_dragElements:new Map,_drag(e){const t=[];vn._dragElements.forEach((n,r)=>{const{node:i}=n,o=i.getStage();o.setPointersPositions(e),n.pointerId===void 0&&(n.pointerId=de._getFirstPointerId(e));const a=o._changedPointerPositions.find(u=>u.id===n.pointerId);if(a){if(n.dragStatus!=="dragging"){var s=i.dragDistance(),l=Math.max(Math.abs(a.x-n.startPointerPos.x),Math.abs(a.y-n.startPointerPos.y));if(l{n.fire("dragmove",{type:"dragmove",target:n,evt:e},!0)})},_endDragBefore(e){const t=[];vn._dragElements.forEach(n=>{const{node:r}=n,i=r.getStage();if(e&&i.setPointersPositions(e),!i._changedPointerPositions.find(s=>s.id===n.pointerId))return;(n.dragStatus==="dragging"||n.dragStatus==="stopped")&&(vn.justDragged=!0,pt._mouseListenClick=!1,pt._touchListenClick=!1,pt._pointerListenClick=!1,n.dragStatus="stopped");const a=n.node.getLayer()||n.node instanceof pt.Stage&&n.node;a&&t.indexOf(a)===-1&&t.push(a)}),t.forEach(n=>{n.draw()})},_endDragAfter(e){vn._dragElements.forEach((t,n)=>{t.dragStatus==="stopped"&&t.node.fire("dragend",{type:"dragend",target:t.node,evt:e},!0),t.dragStatus!=="dragging"&&vn._dragElements.delete(n)})}};pt.isBrowser&&(window.addEventListener("mouseup",vn._endDragBefore,!0),window.addEventListener("touchend",vn._endDragBefore,!0),window.addEventListener("mousemove",vn._drag),window.addEventListener("touchmove",vn._drag),window.addEventListener("mouseup",vn._endDragAfter,!1),window.addEventListener("touchend",vn._endDragAfter,!1));var F4="absoluteOpacity",Ib="allEventListeners",$u="absoluteTransform",zR="absoluteScale",ah="canvas",N7e="Change",j7e="children",B7e="konva",C8="listening",HR="mouseenter",VR="mouseleave",WR="set",UR="Shape",$4=" ",GR="stage",fd="transform",F7e="Stage",_8="visible",$7e=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join($4);let z7e=1,Xe=class k8{constructor(t){this._id=z7e++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(t),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(t){(t===fd||t===$u)&&this._cache.get(t)?this._cache.get(t).dirty=!0:t?this._cache.delete(t):this._cache.clear()}_getCache(t,n){var r=this._cache.get(t),i=t===fd||t===$u,o=r===void 0||i&&r.dirty===!0;return o&&(r=n.call(this),this._cache.set(t,r)),r}_calculate(t,n,r){if(!this._attachedDepsListeners.get(t)){const i=n.map(o=>o+"Change.konva").join($4);this.on(i,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,r)}_getCanvasCache(){return this._cache.get(ah)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===$u&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(ah)){const{scene:t,filter:n,hit:r}=this._cache.get(ah);de.releaseCanvas(t,n,r),this._cache.delete(ah)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(t){var n=t||{},r={};(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)&&(r=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()}));var i=Math.ceil(n.width||r.width),o=Math.ceil(n.height||r.height),a=n.pixelRatio,s=n.x===void 0?Math.floor(r.x):n.x,l=n.y===void 0?Math.floor(r.y):n.y,u=n.offset||0,d=n.drawBorder||!1,h=n.hitCanvasPixelRatio||1;if(!i||!o){de.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}i+=u*2+1,o+=u*2+1,s-=u,l-=u;var m=new $m({pixelRatio:a,width:i,height:o}),y=new $m({pixelRatio:a,width:0,height:0}),b=new mP({pixelRatio:h,width:i,height:o}),S=m.getContext(),E=b.getContext();return b.isCache=!0,m.isCache=!0,this._cache.delete(ah),this._filterUpToDate=!1,n.imageSmoothingEnabled===!1&&(m.getContext()._context.imageSmoothingEnabled=!1,y.getContext()._context.imageSmoothingEnabled=!1),S.save(),E.save(),S.translate(-s,-l),E.translate(-s,-l),this._isUnderCache=!0,this._clearSelfAndDescendantCache(F4),this._clearSelfAndDescendantCache(zR),this.drawScene(m,this),this.drawHit(b,this),this._isUnderCache=!1,S.restore(),E.restore(),d&&(S.save(),S.beginPath(),S.rect(0,0,i,o),S.closePath(),S.setAttr("strokeStyle","red"),S.setAttr("lineWidth",5),S.stroke(),S.restore()),this._cache.set(ah,{scene:m,filter:y,hit:b,x:s,y:l}),this._requestDraw(),this}isCached(){return this._cache.has(ah)}getClientRect(t){throw new Error('abstract "getClientRect" method call')}_transformedRect(t,n){var r=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],i,o,a,s,l=this.getAbsoluteTransform(n);return r.forEach(function(u){var d=l.point(u);i===void 0&&(i=a=d.x,o=s=d.y),i=Math.min(i,d.x),o=Math.min(o,d.y),a=Math.max(a,d.x),s=Math.max(s,d.y)}),{x:i,y:o,width:a-i,height:s-o}}_drawCachedSceneCanvas(t){t.save(),t._applyOpacity(this),t._applyGlobalCompositeOperation(this);const n=this._getCanvasCache();t.translate(n.x,n.y);var r=this._getCachedSceneCanvas(),i=r.pixelRatio;t.drawImage(r._canvas,0,0,r.width/i,r.height/i),t.restore()}_drawCachedHitCanvas(t){var n=this._getCanvasCache(),r=n.hit;t.save(),t.translate(n.x,n.y),t.drawImage(r._canvas,0,0,r.width/r.pixelRatio,r.height/r.pixelRatio),t.restore()}_getCachedSceneCanvas(){var t=this.filters(),n=this._getCanvasCache(),r=n.scene,i=n.filter,o=i.getContext(),a,s,l,u;if(t){if(!this._filterUpToDate){var d=r.pixelRatio;i.setSize(r.width/r.pixelRatio,r.height/r.pixelRatio);try{for(a=t.length,o.clear(),o.drawImage(r._canvas,0,0,r.getWidth()/d,r.getHeight()/d),s=o.getImageData(0,0,i.getWidth(),i.getHeight()),l=0;l{var n,r;if(!t)return this;for(n in t)n!==j7e&&(r=WR+de._capitalize(n),de._isFunction(this[r])?this[r](t[n]):this._setAttr(n,t[n]))}),this}isListening(){return this._getCache(C8,this._isListening)}_isListening(t){if(!this.listening())return!1;const r=this.getParent();return r&&r!==t&&this!==t?r._isListening(t):!0}isVisible(){return this._getCache(_8,this._isVisible)}_isVisible(t){if(!this.visible())return!1;const r=this.getParent();return r&&r!==t&&this!==t?r._isVisible(t):!0}shouldDrawHit(t,n=!1){if(t)return this._isVisible(t)&&this._isListening(t);var r=this.getLayer(),i=!1;vn._dragElements.forEach(a=>{a.dragStatus==="dragging"&&(a.node.nodeType==="Stage"||a.node.getLayer()===r)&&(i=!0)});var o=!n&&!pt.hitOnDragEnabled&&i;return this.isListening()&&this.isVisible()&&!o}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){var t=this.getDepth(),n=this,r=0,i,o,a,s;function l(u){for(i=[],o=u.length,a=0;a0&&i[0].getDepth()<=t&&l(i)}return n.nodeType!==F7e&&l(n.getStage().getChildren()),r}getDepth(){for(var t=0,n=this.parent;n;)t++,n=n.parent;return t}_batchTransformChanges(t){this._batchingTransformChange=!0,t(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(fd),this._clearSelfAndDescendantCache($u)),this._needClearTransformCache=!1}setPosition(t){return this._batchTransformChanges(()=>{this.x(t.x),this.y(t.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){if(!this.getStage())return null;var t=this.getStage().getPointerPosition();if(!t)return null;var n=this.getAbsoluteTransform().copy();return n.invert(),n.point(t)}getAbsolutePosition(t){let n=!1,r=this.parent;for(;r;){if(r.isCached()){n=!0;break}r=r.parent}n&&!t&&(t=!0);var i=this.getAbsoluteTransform(t).getMatrix(),o=new ka,a=this.offset();return o.m=i.slice(),o.translate(a.x,a.y),o.getTranslation()}setAbsolutePosition(t){var n=this._clearTransform();this.attrs.x=n.x,this.attrs.y=n.y,delete n.x,delete n.y,this._clearCache(fd);var r=this._getAbsoluteTransform().copy();return r.invert(),r.translate(t.x,t.y),t={x:this.attrs.x+r.getTranslation().x,y:this.attrs.y+r.getTranslation().y},this._setTransform(n),this.setPosition({x:t.x,y:t.y}),this._clearCache(fd),this._clearSelfAndDescendantCache($u),this}_setTransform(t){var n;for(n in t)this.attrs[n]=t[n]}_clearTransform(){var t={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,t}move(t){var n=t.x,r=t.y,i=this.x(),o=this.y();return n!==void 0&&(i+=n),r!==void 0&&(o+=r),this.setPosition({x:i,y:o}),this}_eachAncestorReverse(t,n){var r=[],i=this.getParent(),o,a;if(!(n&&n._id===this._id)){for(r.unshift(this);i&&(!n||i._id!==n._id);)r.unshift(i),i=i.parent;for(o=r.length,a=0;a0?(this.parent.children.splice(t,1),this.parent.children.splice(t-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return de.warn("Node has no parent. moveToBottom function is ignored."),!1;var t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(t){if(!this.parent)return de.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&&de.warn("Unexpected value "+t+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");var n=this.index;return this.parent.children.splice(n,1),this.parent.children.splice(t,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(F4,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){var t=this.opacity(),n=this.getParent();return n&&!n._isUnderCache&&(t*=n.getAbsoluteOpacity()),t}moveTo(t){return this.getParent()!==t&&(this._remove(),t.add(this)),this}toObject(){var t={},n=this.getAttrs(),r,i,o,a,s;t.attrs={};for(r in n)i=n[r],s=de.isObject(i)&&!de._isPlainObject(i)&&!de._isArray(i),!s&&(o=typeof this[r]=="function"&&this[r],delete n[r],a=o?o.call(this):null,n[r]=i,a!==i&&(t.attrs[r]=i));return t.className=this.getClassName(),de._prepareToStringify(t)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(t,n,r){var i=[];n&&this._isMatch(t)&&i.push(this);for(var o=this.parent;o;){if(o===r)return i;o._isMatch(t)&&i.push(o),o=o.parent}return i}isAncestorOf(t){return!1}findAncestor(t,n,r){return this.findAncestors(t,n,r)[0]}_isMatch(t){if(!t)return!1;if(typeof t=="function")return t(this);var n=t.replace(/ /g,"").split(","),r=n.length,i,o;for(i=0;i{try{const i=t==null?void 0:t.callback;i&&delete t.callback,de._urlToImage(this.toDataURL(t),function(o){n(o),i==null||i(o)})}catch(i){r(i)}})}toBlob(t){return new Promise((n,r)=>{try{const i=t==null?void 0:t.callback;i&&delete t.callback,this.toCanvas(t).toBlob(o=>{n(o),i==null||i(o)})}catch(i){r(i)}})}setSize(t){return this.width(t.width),this.height(t.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():pt.dragDistance}_off(t,n,r){var i=this.eventListeners[t],o,a,s;for(o=0;o=0;if(r&&!this.isDragging()){var i=!1;vn._dragElements.forEach(o=>{this.isAncestorOf(o.node)&&(i=!0)}),i||this._createDragElement(t)}})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{this._dragCleanup();var t=this.getStage();if(!t)return;const n=vn._dragElements.get(this._id),r=n&&n.dragStatus==="dragging",i=n&&n.dragStatus==="ready";r?this.stopDrag():i&&vn._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(t={x:0,y:0}){const n=this.getStage();if(!n)return!1;const r={x:-t.x,y:-t.y,width:n.width()+2*t.x,height:n.height()+2*t.y};return de.haveIntersection(r,this.getClientRect())}static create(t,n){return de._isString(t)&&(t=JSON.parse(t)),this._createNode(t,n)}static _createNode(t,n){var r=k8.prototype.getClassName.call(t),i=t.children,o,a,s;n&&(t.attrs.container=n),pt[r]||(de.warn('Can not find a node with class name "'+r+'". Fallback to "Shape".'),r="Shape");const l=pt[r];if(o=new l(t.attrs),i)for(a=i.length,s=0;s0}removeChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.destroy()}),this.children=[],this._requestDraw(),this}add(...t){if(arguments.length>1){for(var n=0;n0?n[0]:void 0}_generalFind(t,n){var r=[];return this._descendants(i=>{const o=i._isMatch(t);return o&&r.push(i),!!(o&&n)}),r}_descendants(t){let n=!1;const r=this.getChildren();for(const i of r){if(n=t(i),n)return!0;if(i.hasChildren()&&(n=i._descendants(t),n))return!0}return!1}toObject(){var t=Xe.prototype.toObject.call(this);return t.children=[],this.getChildren().forEach(n=>{t.children.push(n.toObject())}),t}isAncestorOf(t){for(var n=t.getParent();n;){if(n._id===this._id)return!0;n=n.getParent()}return!1}clone(t){var n=Xe.prototype.clone.call(this,t);return this.getChildren().forEach(function(r){n.add(r.clone())}),n}getAllIntersections(t){var n=[];return this.find("Shape").forEach(function(r){r.isVisible()&&r.intersects(t)&&n.push(r)}),n}_clearSelfAndDescendantCache(t){var n;super._clearSelfAndDescendantCache(t),!this.isCached()&&((n=this.children)===null||n===void 0||n.forEach(function(r){r._clearSelfAndDescendantCache(t)}))}_setChildrenIndices(){var t;(t=this.children)===null||t===void 0||t.forEach(function(n,r){n.index=r}),this._requestDraw()}drawScene(t,n){var r=this.getLayer(),i=t||r&&r.getCanvas(),o=i&&i.getContext(),a=this._getCanvasCache(),s=a&&a.scene,l=i&&i.isCache;if(!this.isVisible()&&!l)return this;if(s){o.save();var u=this.getAbsoluteTransform(n).getMatrix();o.transform(u[0],u[1],u[2],u[3],u[4],u[5]),this._drawCachedSceneCanvas(o),o.restore()}else this._drawChildren("drawScene",i,n);return this}drawHit(t,n){if(!this.shouldDrawHit(n))return this;var r=this.getLayer(),i=t||r&&r.hitCanvas,o=i&&i.getContext(),a=this._getCanvasCache(),s=a&&a.hit;if(s){o.save();var l=this.getAbsoluteTransform(n).getMatrix();o.transform(l[0],l[1],l[2],l[3],l[4],l[5]),this._drawCachedHitCanvas(o),o.restore()}else this._drawChildren("drawHit",i,n);return this}_drawChildren(t,n,r){var i,o=n&&n.getContext(),a=this.clipWidth(),s=this.clipHeight(),l=this.clipFunc(),u=a&&s||l;const d=r===this;if(u){o.save();var h=this.getAbsoluteTransform(r),m=h.getMatrix();if(o.transform(m[0],m[1],m[2],m[3],m[4],m[5]),o.beginPath(),l)l.call(this,o,this);else{var y=this.clipX(),b=this.clipY();o.rect(y,b,a,s)}o.clip(),m=h.copy().invert().getMatrix(),o.transform(m[0],m[1],m[2],m[3],m[4],m[5])}var S=!d&&this.globalCompositeOperation()!=="source-over"&&t==="drawScene";S&&(o.save(),o._applyGlobalCompositeOperation(this)),(i=this.children)===null||i===void 0||i.forEach(function(E){E[t](n,r)}),S&&o.restore(),u&&o.restore()}getClientRect(t){var n;t=t||{};var r=t.skipTransform,i=t.relativeTo,o,a,s,l,u={x:1/0,y:1/0,width:0,height:0},d=this;(n=this.children)===null||n===void 0||n.forEach(function(S){if(S.visible()){var E=S.getClientRect({relativeTo:d,skipShadow:t.skipShadow,skipStroke:t.skipStroke});E.width===0&&E.height===0||(o===void 0?(o=E.x,a=E.y,s=E.x+E.width,l=E.y+E.height):(o=Math.min(o,E.x),a=Math.min(a,E.y),s=Math.max(s,E.x+E.width),l=Math.max(l,E.y+E.height)))}});for(var h=this.find("Shape"),m=!1,y=0;ye.indexOf("pointer")>=0?"pointer":e.indexOf("touch")>=0?"touch":"mouse",Rg=e=>{const t=Ov(e);if(t==="pointer")return pt.pointerEventsEnabled&&TC.pointer;if(t==="touch")return TC.touch;if(t==="mouse")return TC.mouse};function YR(e={}){return(e.clipFunc||e.clipWidth||e.clipHeight)&&de.warn("Stage does not support clipping. Please use clip for Layers or Groups."),e}const Y7e="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);",z4=[];let Vx=class extends Aa{constructor(t){super(YR(t)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),z4.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{YR(this.attrs)}),this._checkVisibility()}_validateAdd(t){const n=t.getType()==="Layer",r=t.getType()==="FastLayer";n||r||de.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const t=this.visible()?"":"none";this.content.style.display=t}setContainer(t){if(typeof t===V7e){if(t.charAt(0)==="."){var n=t.slice(1);t=document.getElementsByClassName(n)[0]}else{var r;t.charAt(0)!=="#"?r=t:r=t.slice(1),t=document.getElementById(r)}if(!t)throw"Can not find container in document with id "+r}return this._setAttr("container",t),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),t.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var t=this.children,n=t.length,r;for(r=0;r-1&&z4.splice(n,1),de.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const t=this._pointerPositions[0]||this._changedPointerPositions[0];return t?{x:t.x,y:t.y}:(de.warn(Y7e),null)}_getPointerById(t){return this._pointerPositions.find(n=>n.id===t)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(t){t=t||{},t.x=t.x||0,t.y=t.y||0,t.width=t.width||this.width(),t.height=t.height||this.height();var n=new $m({width:t.width,height:t.height,pixelRatio:t.pixelRatio||1}),r=n.getContext()._context,i=this.children;return(t.x||t.y)&&r.translate(-1*t.x,-1*t.y),i.forEach(function(o){if(o.isVisible()){var a=o._toKonvaCanvas(t);r.drawImage(a._canvas,t.x,t.y,a.getWidth()/a.getPixelRatio(),a.getHeight()/a.getPixelRatio())}}),n}getIntersection(t){if(!t)return null;var n=this.children,r=n.length,i=r-1,o;for(o=i;o>=0;o--){const a=n[o].getIntersection(t);if(a)return a}return null}_resizeDOM(){var t=this.width(),n=this.height();this.content&&(this.content.style.width=t+qR,this.content.style.height=n+qR),this.bufferCanvas.setSize(t,n),this.bufferHitCanvas.setSize(t,n),this.children.forEach(r=>{r.setSize({width:t,height:n}),r.draw()})}add(t,...n){if(arguments.length>1){for(var r=0;rG7e&&de.warn("The stage has "+i+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),t.setSize({width:this.width(),height:this.height()}),t.draw(),pt.isBrowser&&this.content.appendChild(t.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(t){return uG(t,this)}setPointerCapture(t){cG(t,this)}releaseCapture(t){a2(t)}getLayers(){return this.children}_bindContentEvents(){pt.isBrowser&&q7e.forEach(([t,n])=>{this.content.addEventListener(t,r=>{this[n](r)},{passive:!1})})}_pointerenter(t){this.setPointersPositions(t);const n=Rg(t.type);this._fire(n.pointerenter,{evt:t,target:this,currentTarget:this})}_pointerover(t){this.setPointersPositions(t);const n=Rg(t.type);this._fire(n.pointerover,{evt:t,target:this,currentTarget:this})}_getTargetShape(t){let n=this[t+"targetShape"];return n&&!n.getStage()&&(n=null),n}_pointerleave(t){const n=Rg(t.type),r=Ov(t.type);if(n){this.setPointersPositions(t);var i=this._getTargetShape(r),o=!vn.isDragging||pt.hitOnDragEnabled;i&&o?(i._fireAndBubble(n.pointerout,{evt:t}),i._fireAndBubble(n.pointerleave,{evt:t}),this._fire(n.pointerleave,{evt:t,target:this,currentTarget:this}),this[r+"targetShape"]=null):o&&(this._fire(n.pointerleave,{evt:t,target:this,currentTarget:this}),this._fire(n.pointerout,{evt:t,target:this,currentTarget:this})),this.pointerPos=void 0,this._pointerPositions=[]}}_pointerdown(t){const n=Rg(t.type),r=Ov(t.type);if(n){this.setPointersPositions(t);var i=!1;this._changedPointerPositions.forEach(o=>{var a=this.getIntersection(o);if(vn.justDragged=!1,pt["_"+r+"ListenClick"]=!0,!(a&&a.isListening()))return;pt.capturePointerEventsEnabled&&a.setPointerCapture(o.id),this[r+"ClickStartShape"]=a,a._fireAndBubble(n.pointerdown,{evt:t,pointerId:o.id}),i=!0;const l=t.type.indexOf("touch")>=0;a.preventDefault()&&t.cancelable&&l&&t.preventDefault()}),i||this._fire(n.pointerdown,{evt:t,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(t){const n=Rg(t.type),r=Ov(t.type);if(!n)return;vn.isDragging&&vn.node.preventDefault()&&t.cancelable&&t.preventDefault(),this.setPointersPositions(t);var i=!vn.isDragging||pt.hitOnDragEnabled;if(!i)return;var o={};let a=!1;var s=this._getTargetShape(r);this._changedPointerPositions.forEach(l=>{const u=PC(l.id)||this.getIntersection(l),d=l.id,h={evt:t,pointerId:d};var m=s!==u;if(m&&s&&(s._fireAndBubble(n.pointerout,Object.assign({},h),u),s._fireAndBubble(n.pointerleave,Object.assign({},h),u)),u){if(o[u._id])return;o[u._id]=!0}u&&u.isListening()?(a=!0,m&&(u._fireAndBubble(n.pointerover,Object.assign({},h),s),u._fireAndBubble(n.pointerenter,Object.assign({},h),s),this[r+"targetShape"]=u),u._fireAndBubble(n.pointermove,Object.assign({},h))):s&&(this._fire(n.pointerover,{evt:t,target:this,currentTarget:this,pointerId:d}),this[r+"targetShape"]=null)}),a||this._fire(n.pointermove,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(t){const n=Rg(t.type),r=Ov(t.type);if(!n)return;this.setPointersPositions(t);const i=this[r+"ClickStartShape"],o=this[r+"ClickEndShape"];var a={};let s=!1;this._changedPointerPositions.forEach(l=>{const u=PC(l.id)||this.getIntersection(l);if(u){if(u.releaseCapture(l.id),a[u._id])return;a[u._id]=!0}const d=l.id,h={evt:t,pointerId:d};let m=!1;pt["_"+r+"InDblClickWindow"]?(m=!0,clearTimeout(this[r+"DblTimeout"])):vn.justDragged||(pt["_"+r+"InDblClickWindow"]=!0,clearTimeout(this[r+"DblTimeout"])),this[r+"DblTimeout"]=setTimeout(function(){pt["_"+r+"InDblClickWindow"]=!1},pt.dblClickWindow),u&&u.isListening()?(s=!0,this[r+"ClickEndShape"]=u,u._fireAndBubble(n.pointerup,Object.assign({},h)),pt["_"+r+"ListenClick"]&&i&&i===u&&(u._fireAndBubble(n.pointerclick,Object.assign({},h)),m&&o&&o===u&&u._fireAndBubble(n.pointerdblclick,Object.assign({},h)))):(this[r+"ClickEndShape"]=null,pt["_"+r+"ListenClick"]&&this._fire(n.pointerclick,{evt:t,target:this,currentTarget:this,pointerId:d}),m&&this._fire(n.pointerdblclick,{evt:t,target:this,currentTarget:this,pointerId:d}))}),s||this._fire(n.pointerup,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),pt["_"+r+"ListenClick"]=!1,t.cancelable&&r!=="touch"&&t.preventDefault()}_contextmenu(t){this.setPointersPositions(t);var n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(E8,{evt:t}):this._fire(E8,{evt:t,target:this,currentTarget:this})}_wheel(t){this.setPointersPositions(t);var n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(P8,{evt:t}):this._fire(P8,{evt:t,target:this,currentTarget:this})}_pointercancel(t){this.setPointersPositions(t);const n=PC(t.pointerId)||this.getIntersection(this.getPointerPosition());n&&n._fireAndBubble(um,vP(t)),a2(t.pointerId)}_lostpointercapture(t){a2(t.pointerId)}setPointersPositions(t){var n=this._getContentPosition(),r=null,i=null;t=t||window.event,t.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(t.touches,o=>{this._pointerPositions.push({id:o.identifier,x:(o.clientX-n.left)/n.scaleX,y:(o.clientY-n.top)/n.scaleY})}),Array.prototype.forEach.call(t.changedTouches||t.touches,o=>{this._changedPointerPositions.push({id:o.identifier,x:(o.clientX-n.left)/n.scaleX,y:(o.clientY-n.top)/n.scaleY})})):(r=(t.clientX-n.left)/n.scaleX,i=(t.clientY-n.top)/n.scaleY,this.pointerPos={x:r,y:i},this._pointerPositions=[{x:r,y:i,id:de._getFirstPointerId(t)}],this._changedPointerPositions=[{x:r,y:i,id:de._getFirstPointerId(t)}])}_setPointerPosition(t){de.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(t)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var t=this.content.getBoundingClientRect();return{top:t.top,left:t.left,scaleX:t.width/this.content.clientWidth||1,scaleY:t.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new $m({width:this.width(),height:this.height()}),this.bufferHitCanvas=new mP({pixelRatio:1,width:this.width(),height:this.height()}),!!pt.isBrowser){var t=this.container();if(!t)throw"Stage has no container. A container is required.";t.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),t.appendChild(this.content),this._resizeDOM()}}cache(){return de.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(t){t.batchDraw()}),this}};Vx.prototype.nodeType=H7e;Ar(Vx);ee.addGetterSetter(Vx,"container");var xG="hasShadow",wG="shadowRGBA",CG="patternImage",_G="linearGradient",kG="radialGradient";let Bb;function LC(){return Bb||(Bb=de.createCanvasElement().getContext("2d"),Bb)}const s2={};function K7e(e){e.fill()}function X7e(e){e.stroke()}function Z7e(e){e.fill()}function Q7e(e){e.stroke()}function J7e(){this._clearCache(xG)}function e9e(){this._clearCache(wG)}function t9e(){this._clearCache(CG)}function n9e(){this._clearCache(_G)}function r9e(){this._clearCache(kG)}class Be extends Xe{constructor(t){super(t);let n;for(;n=de.getRandomColor(),!(n&&!(n in s2)););this.colorKey=n,s2[n]=this}getContext(){return de.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return de.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(xG,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(CG,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){var t=LC();const n=t.createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(n&&n.setTransform){const r=new ka;r.translate(this.fillPatternX(),this.fillPatternY()),r.rotate(pt.getAngle(this.fillPatternRotation())),r.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),r.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const i=r.getMatrix(),o=typeof DOMMatrix>"u"?{a:i[0],b:i[1],c:i[2],d:i[3],e:i[4],f:i[5]}:new DOMMatrix(i);n.setTransform(o)}return n}}_getLinearGradient(){return this._getCache(_G,this.__getLinearGradient)}__getLinearGradient(){var t=this.fillLinearGradientColorStops();if(t){for(var n=LC(),r=this.fillLinearGradientStartPoint(),i=this.fillLinearGradientEndPoint(),o=n.createLinearGradient(r.x,r.y,i.x,i.y),a=0;athis.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const t=this.hitStrokeWidth();return t==="auto"?this.hasStroke():this.strokeEnabled()&&!!t}intersects(t){var n=this.getStage(),r=n.bufferHitCanvas,i;return r.getContext().clear(),this.drawHit(r,null,!0),i=r.context.getImageData(Math.round(t.x),Math.round(t.y),1,1).data,i[3]>0}destroy(){return Xe.prototype.destroy.call(this),delete s2[this.colorKey],delete this.colorKey,this}_useBufferCanvas(t){var n;if(!this.getStage()||!((n=this.attrs.perfectDrawEnabled)!==null&&n!==void 0?n:!0))return!1;const i=t||this.hasFill(),o=this.hasStroke(),a=this.getAbsoluteOpacity()!==1;if(i&&o&&a)return!0;const s=this.hasShadow(),l=this.shadowForStrokeEnabled();return!!(i&&o&&s&&l)}setStrokeHitEnabled(t){de.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),t?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){var t=this.size();return{x:this._centroid?-t.width/2:0,y:this._centroid?-t.height/2:0,width:t.width,height:t.height}}getClientRect(t={}){const n=t.skipTransform,r=t.relativeTo,i=this.getSelfRect(),a=!t.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,s=i.width+a,l=i.height+a,u=!t.skipShadow&&this.hasShadow(),d=u?this.shadowOffsetX():0,h=u?this.shadowOffsetY():0,m=s+Math.abs(d),y=l+Math.abs(h),b=u&&this.shadowBlur()||0,S=m+b*2,E=y+b*2,k={width:S,height:E,x:-(a/2+b)+Math.min(d,0)+i.x,y:-(a/2+b)+Math.min(h,0)+i.y};return n?k:this._transformedRect(k,r)}drawScene(t,n){var r=this.getLayer(),i=t||r.getCanvas(),o=i.getContext(),a=this._getCanvasCache(),s=this.getSceneFunc(),l=this.hasShadow(),u,d,h,m=i.isCache,y=n===this;if(!this.isVisible()&&!y)return this;if(a){o.save();var b=this.getAbsoluteTransform(n).getMatrix();return o.transform(b[0],b[1],b[2],b[3],b[4],b[5]),this._drawCachedSceneCanvas(o),o.restore(),this}if(!s)return this;if(o.save(),this._useBufferCanvas()&&!m){u=this.getStage(),d=u.bufferCanvas,h=d.getContext(),h.clear(),h.save(),h._applyLineJoin(this);var S=this.getAbsoluteTransform(n).getMatrix();h.transform(S[0],S[1],S[2],S[3],S[4],S[5]),s.call(this,h,this),h.restore();var E=d.pixelRatio;l&&o._applyShadow(this),o._applyOpacity(this),o._applyGlobalCompositeOperation(this),o.drawImage(d._canvas,0,0,d.width/E,d.height/E)}else{if(o._applyLineJoin(this),!y){var S=this.getAbsoluteTransform(n).getMatrix();o.transform(S[0],S[1],S[2],S[3],S[4],S[5]),o._applyOpacity(this),o._applyGlobalCompositeOperation(this)}l&&o._applyShadow(this),s.call(this,o,this)}return o.restore(),this}drawHit(t,n,r=!1){if(!this.shouldDrawHit(n,r))return this;var i=this.getLayer(),o=t||i.hitCanvas,a=o&&o.getContext(),s=this.hitFunc()||this.sceneFunc(),l=this._getCanvasCache(),u=l&&l.hit;if(this.colorKey||de.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),u){a.save();var d=this.getAbsoluteTransform(n).getMatrix();return a.transform(d[0],d[1],d[2],d[3],d[4],d[5]),this._drawCachedHitCanvas(a),a.restore(),this}if(!s)return this;if(a.save(),a._applyLineJoin(this),!(this===n)){var m=this.getAbsoluteTransform(n).getMatrix();a.transform(m[0],m[1],m[2],m[3],m[4],m[5])}return s.call(this,a,this),a.restore(),this}drawHitFromCache(t=0){var n=this._getCanvasCache(),r=this._getCachedSceneCanvas(),i=n.hit,o=i.getContext(),a=i.getWidth(),s=i.getHeight(),l,u,d,h,m,y;o.clear(),o.drawImage(r._canvas,0,0,a,s);try{for(l=o.getImageData(0,0,a,s),u=l.data,d=u.length,h=de._hexToRgb(this.colorKey),m=0;mt?(u[m]=h.r,u[m+1]=h.g,u[m+2]=h.b,u[m+3]=255):u[m+3]=0;o.putImageData(l,0,0)}catch(b){de.error("Unable to draw hit graph from cached scene canvas. "+b.message)}return this}hasPointerCapture(t){return uG(t,this)}setPointerCapture(t){cG(t,this)}releaseCapture(t){a2(t)}}Be.prototype._fillFunc=K7e;Be.prototype._strokeFunc=X7e;Be.prototype._fillFuncHit=Z7e;Be.prototype._strokeFuncHit=Q7e;Be.prototype._centroid=!1;Be.prototype.nodeType="Shape";Ar(Be);Be.prototype.eventListeners={};Be.prototype.on.call(Be.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",J7e);Be.prototype.on.call(Be.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",e9e);Be.prototype.on.call(Be.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",t9e);Be.prototype.on.call(Be.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",n9e);Be.prototype.on.call(Be.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",r9e);ee.addGetterSetter(Be,"stroke",void 0,sG());ee.addGetterSetter(Be,"strokeWidth",2,Ge());ee.addGetterSetter(Be,"fillAfterStrokeEnabled",!1);ee.addGetterSetter(Be,"hitStrokeWidth","auto",gP());ee.addGetterSetter(Be,"strokeHitEnabled",!0,nl());ee.addGetterSetter(Be,"perfectDrawEnabled",!0,nl());ee.addGetterSetter(Be,"shadowForStrokeEnabled",!0,nl());ee.addGetterSetter(Be,"lineJoin");ee.addGetterSetter(Be,"lineCap");ee.addGetterSetter(Be,"sceneFunc");ee.addGetterSetter(Be,"hitFunc");ee.addGetterSetter(Be,"dash");ee.addGetterSetter(Be,"dashOffset",0,Ge());ee.addGetterSetter(Be,"shadowColor",void 0,P0());ee.addGetterSetter(Be,"shadowBlur",0,Ge());ee.addGetterSetter(Be,"shadowOpacity",1,Ge());ee.addComponentsGetterSetter(Be,"shadowOffset",["x","y"]);ee.addGetterSetter(Be,"shadowOffsetX",0,Ge());ee.addGetterSetter(Be,"shadowOffsetY",0,Ge());ee.addGetterSetter(Be,"fillPatternImage");ee.addGetterSetter(Be,"fill",void 0,sG());ee.addGetterSetter(Be,"fillPatternX",0,Ge());ee.addGetterSetter(Be,"fillPatternY",0,Ge());ee.addGetterSetter(Be,"fillLinearGradientColorStops");ee.addGetterSetter(Be,"strokeLinearGradientColorStops");ee.addGetterSetter(Be,"fillRadialGradientStartRadius",0);ee.addGetterSetter(Be,"fillRadialGradientEndRadius",0);ee.addGetterSetter(Be,"fillRadialGradientColorStops");ee.addGetterSetter(Be,"fillPatternRepeat","repeat");ee.addGetterSetter(Be,"fillEnabled",!0);ee.addGetterSetter(Be,"strokeEnabled",!0);ee.addGetterSetter(Be,"shadowEnabled",!0);ee.addGetterSetter(Be,"dashEnabled",!0);ee.addGetterSetter(Be,"strokeScaleEnabled",!0);ee.addGetterSetter(Be,"fillPriority","color");ee.addComponentsGetterSetter(Be,"fillPatternOffset",["x","y"]);ee.addGetterSetter(Be,"fillPatternOffsetX",0,Ge());ee.addGetterSetter(Be,"fillPatternOffsetY",0,Ge());ee.addComponentsGetterSetter(Be,"fillPatternScale",["x","y"]);ee.addGetterSetter(Be,"fillPatternScaleX",1,Ge());ee.addGetterSetter(Be,"fillPatternScaleY",1,Ge());ee.addComponentsGetterSetter(Be,"fillLinearGradientStartPoint",["x","y"]);ee.addComponentsGetterSetter(Be,"strokeLinearGradientStartPoint",["x","y"]);ee.addGetterSetter(Be,"fillLinearGradientStartPointX",0);ee.addGetterSetter(Be,"strokeLinearGradientStartPointX",0);ee.addGetterSetter(Be,"fillLinearGradientStartPointY",0);ee.addGetterSetter(Be,"strokeLinearGradientStartPointY",0);ee.addComponentsGetterSetter(Be,"fillLinearGradientEndPoint",["x","y"]);ee.addComponentsGetterSetter(Be,"strokeLinearGradientEndPoint",["x","y"]);ee.addGetterSetter(Be,"fillLinearGradientEndPointX",0);ee.addGetterSetter(Be,"strokeLinearGradientEndPointX",0);ee.addGetterSetter(Be,"fillLinearGradientEndPointY",0);ee.addGetterSetter(Be,"strokeLinearGradientEndPointY",0);ee.addComponentsGetterSetter(Be,"fillRadialGradientStartPoint",["x","y"]);ee.addGetterSetter(Be,"fillRadialGradientStartPointX",0);ee.addGetterSetter(Be,"fillRadialGradientStartPointY",0);ee.addComponentsGetterSetter(Be,"fillRadialGradientEndPoint",["x","y"]);ee.addGetterSetter(Be,"fillRadialGradientEndPointX",0);ee.addGetterSetter(Be,"fillRadialGradientEndPointY",0);ee.addGetterSetter(Be,"fillPatternRotation",0);ee.backCompat(Be,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});var i9e="#",o9e="beforeDraw",a9e="draw",EG=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],s9e=EG.length;let dp=class extends Aa{constructor(t){super(t),this.canvas=new $m,this.hitCanvas=new mP({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(t){return this.getContext().clear(t),this.getHitCanvas().getContext().clear(t),this}setZIndex(t){super.setZIndex(t);var n=this.getStage();return n&&n.content&&(n.content.removeChild(this.getNativeCanvasElement()),t{this.draw(),this._waitingForDraw=!1})),this}getIntersection(t){if(!this.isListening()||!this.isVisible())return null;for(var n=1,r=!1;;){for(let i=0;i0)return{antialiased:!0};return{}}drawScene(t,n){var r=this.getLayer(),i=t||r&&r.getCanvas();return this._fire(o9e,{node:this}),this.clearBeforeDraw()&&i.getContext().clear(),Aa.prototype.drawScene.call(this,i,n),this._fire(a9e,{node:this}),this}drawHit(t,n){var r=this.getLayer(),i=t||r&&r.hitCanvas;return r&&r.clearBeforeDraw()&&r.getHitCanvas().getContext().clear(),Aa.prototype.drawHit.call(this,i,n),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){de.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return de.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!(!this.parent||!this.parent.content)){var t=this.parent,n=!!this.hitCanvas._canvas.parentNode;n?t.content.removeChild(this.hitCanvas._canvas):t.content.appendChild(this.hitCanvas._canvas)}}destroy(){return de.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};dp.prototype.nodeType="Layer";Ar(dp);ee.addGetterSetter(dp,"imageSmoothingEnabled",!0);ee.addGetterSetter(dp,"clearBeforeDraw",!0);ee.addGetterSetter(dp,"hitGraphEnabled",!0,nl());class yP extends dp{constructor(t){super(t),this.listening(!1),de.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}yP.prototype.nodeType="FastLayer";Ar(yP);let i0=class extends Aa{_validateAdd(t){var n=t.getType();n!=="Group"&&n!=="Shape"&&de.throw("You may only add groups and shapes to groups.")}};i0.prototype.nodeType="Group";Ar(i0);var AC=function(){return Fm.performance&&Fm.performance.now?function(){return Fm.performance.now()}:function(){return new Date().getTime()}}();class ts{constructor(t,n){this.id=ts.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:AC(),frameRate:0},this.func=t,this.setLayers(n)}setLayers(t){var n=[];return t?t.length>0?n=t:n=[t]:n=[],this.layers=n,this}getLayers(){return this.layers}addLayer(t){var n=this.layers,r=n.length,i;for(i=0;ithis.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():t<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=t,this.update())}getTime(){return this._time}setPosition(t){this.prevPos=this._pos,this.propFunc(t),this._pos=t}getPosition(t){return t===void 0&&(t=this._time),this.func(t,this.begin,this._change,this.duration)}play(){this.state=KR,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=XR,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(t){this.pause(),this._time=t,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){var t=this.getTimer()-this._startTime;this.state===KR?this.setTime(t):this.state===XR&&this.setTime(this.duration-t)}pause(){this.state=u9e,this.fire("onPause")}getTimer(){return new Date().getTime()}}class Xr{constructor(t){var n=this,r=t.node,i=r._id,o,a=t.easing||l2.Linear,s=!!t.yoyo,l;typeof t.duration>"u"?o=.3:t.duration===0?o=.001:o=t.duration,this.node=r,this._id=c9e++;var u=r.getLayer()||(r instanceof pt.Stage?r.getLayers():null);u||de.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new ts(function(){n.tween.onEnterFrame()},u),this.tween=new d9e(l,function(d){n._tweenFunc(d)},a,0,1,o*1e3,s),this._addListeners(),Xr.attrs[i]||(Xr.attrs[i]={}),Xr.attrs[i][this._id]||(Xr.attrs[i][this._id]={}),Xr.tweens[i]||(Xr.tweens[i]={});for(l in t)l9e[l]===void 0&&this._addAttr(l,t[l]);this.reset(),this.onFinish=t.onFinish,this.onReset=t.onReset,this.onUpdate=t.onUpdate}_addAttr(t,n){var r=this.node,i=r._id,o,a,s,l,u,d,h,m;if(s=Xr.tweens[i][t],s&&delete Xr.attrs[i][s][t],o=r.getAttr(t),de._isArray(n))if(a=[],u=Math.max(n.length,o.length),t==="points"&&n.length!==o.length&&(n.length>o.length?(h=o,o=de._prepareArrayForTween(o,n,r.closed())):(d=n,n=de._prepareArrayForTween(n,o,r.closed()))),t.indexOf("fill")===0)for(l=0;l{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var t=this.node,n=Xr.attrs[t._id][this._id];n.points&&n.points.trueEnd&&t.setAttr("points",n.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var t=this.node,n=Xr.attrs[t._id][this._id];n.points&&n.points.trueStart&&t.points(n.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(t){return this.tween.seek(t*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){var t=this.node._id,n=this._id,r=Xr.tweens[t],i;this.pause();for(i in r)delete Xr.tweens[t][i];delete Xr.attrs[t][n]}}Xr.attrs={};Xr.tweens={};Xe.prototype.to=function(e){var t=e.onFinish;e.node=this,e.onFinish=function(){this.destroy(),t&&t()};var n=new Xr(e);n.play()};const l2={BackEaseIn(e,t,n,r){var i=1.70158;return n*(e/=r)*e*((i+1)*e-i)+t},BackEaseOut(e,t,n,r){var i=1.70158;return n*((e=e/r-1)*e*((i+1)*e+i)+1)+t},BackEaseInOut(e,t,n,r){var i=1.70158;return(e/=r/2)<1?n/2*(e*e*(((i*=1.525)+1)*e-i))+t:n/2*((e-=2)*e*(((i*=1.525)+1)*e+i)+2)+t},ElasticEaseIn(e,t,n,r,i,o){var a=0;return e===0?t:(e/=r)===1?t+n:(o||(o=r*.3),!i||i0?t:n),d=a*n,h=s*(s>0?t:n),m=l*(l>0?n:t);return{x:u,y:r?-1*m:h,width:d-u,height:m-h}}}cc.prototype._centroid=!0;cc.prototype.className="Arc";cc.prototype._attrsAffectingSize=["innerRadius","outerRadius"];Ar(cc);ee.addGetterSetter(cc,"innerRadius",0,Ge());ee.addGetterSetter(cc,"outerRadius",0,Ge());ee.addGetterSetter(cc,"angle",0,Ge());ee.addGetterSetter(cc,"clockwise",!1,nl());function T8(e,t,n,r,i,o,a){var s=Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2)),l=Math.sqrt(Math.pow(i-n,2)+Math.pow(o-r,2)),u=a*s/(s+l),d=a*l/(s+l),h=n-u*(i-e),m=r-u*(o-t),y=n+d*(i-e),b=r+d*(o-t);return[h,m,y,b]}function QR(e,t){var n=e.length,r=[],i,o;for(i=2;i4){for(s=this.getTensionPoints(),l=s.length,u=o?0:4,o||t.quadraticCurveTo(s[0],s[1],s[2],s[3]);ud?u:d,E=u>d?1:u/d,k=u>d?d/u:1;t.translate(s,l),t.rotate(y),t.scale(E,k),t.arc(0,0,S,h,h+m,1-b),t.scale(1/E,1/k),t.rotate(-y),t.translate(-s,-l);break;case"z":r=!0,t.closePath();break}}!r&&!this.hasFill()?t.strokeShape(this):t.fillStrokeShape(this)}getSelfRect(){var t=[];this.dataArray.forEach(function(u){if(u.command==="A"){var d=u.points[4],h=u.points[5],m=u.points[4]+h,y=Math.PI/180;if(Math.abs(d-m)m;b-=y){const S=Hn.getPointOnEllipticalArc(u.points[0],u.points[1],u.points[2],u.points[3],b,0);t.push(S.x,S.y)}else for(let b=d+y;bthis.dataArray[r].pathLength;)t-=this.dataArray[r].pathLength,++r;if(r===i)return n=this.dataArray[r-1].points.slice(-2),{x:n[0],y:n[1]};if(t<.01)return n=this.dataArray[r].points.slice(0,2),{x:n[0],y:n[1]};var o=this.dataArray[r],a=o.points;switch(o.command){case"L":return Hn.getPointOnLine(t,o.start.x,o.start.y,a[0],a[1]);case"C":return Hn.getPointOnCubicBezier(t/o.pathLength,o.start.x,o.start.y,a[0],a[1],a[2],a[3],a[4],a[5]);case"Q":return Hn.getPointOnQuadraticBezier(t/o.pathLength,o.start.x,o.start.y,a[0],a[1],a[2],a[3]);case"A":var s=a[0],l=a[1],u=a[2],d=a[3],h=a[4],m=a[5],y=a[6];return h+=m*t/o.pathLength,Hn.getPointOnEllipticalArc(s,l,u,d,h,y)}return null}static getLineLength(t,n,r,i){return Math.sqrt((r-t)*(r-t)+(i-n)*(i-n))}static getPointOnLine(t,n,r,i,o,a,s){a===void 0&&(a=n),s===void 0&&(s=r);var l=(o-r)/(i-n+1e-8),u=Math.sqrt(t*t/(1+l*l));i0&&!isNaN(b[0]);){var _=null,T=[],A=l,I=u,R,D,j,z,V,K,te,q,F,U;switch(y){case"l":l+=b.shift(),u+=b.shift(),_="L",T.push(l,u);break;case"L":l=b.shift(),u=b.shift(),T.push(l,u);break;case"m":var X=b.shift(),Z=b.shift();if(l+=X,u+=Z,_="M",a.length>2&&a[a.length-1].command==="z"){for(var W=a.length-2;W>=0;W--)if(a[W].command==="M"){l=a[W].points[0]+X,u=a[W].points[1]+Z;break}}T.push(l,u),y="l";break;case"M":l=b.shift(),u=b.shift(),_="M",T.push(l,u),y="L";break;case"h":l+=b.shift(),_="L",T.push(l,u);break;case"H":l=b.shift(),_="L",T.push(l,u);break;case"v":u+=b.shift(),_="L",T.push(l,u);break;case"V":u=b.shift(),_="L",T.push(l,u);break;case"C":T.push(b.shift(),b.shift(),b.shift(),b.shift()),l=b.shift(),u=b.shift(),T.push(l,u);break;case"c":T.push(l+b.shift(),u+b.shift(),l+b.shift(),u+b.shift()),l+=b.shift(),u+=b.shift(),_="C",T.push(l,u);break;case"S":D=l,j=u,R=a[a.length-1],R.command==="C"&&(D=l+(l-R.points[2]),j=u+(u-R.points[3])),T.push(D,j,b.shift(),b.shift()),l=b.shift(),u=b.shift(),_="C",T.push(l,u);break;case"s":D=l,j=u,R=a[a.length-1],R.command==="C"&&(D=l+(l-R.points[2]),j=u+(u-R.points[3])),T.push(D,j,l+b.shift(),u+b.shift()),l+=b.shift(),u+=b.shift(),_="C",T.push(l,u);break;case"Q":T.push(b.shift(),b.shift()),l=b.shift(),u=b.shift(),T.push(l,u);break;case"q":T.push(l+b.shift(),u+b.shift()),l+=b.shift(),u+=b.shift(),_="Q",T.push(l,u);break;case"T":D=l,j=u,R=a[a.length-1],R.command==="Q"&&(D=l+(l-R.points[0]),j=u+(u-R.points[1])),l=b.shift(),u=b.shift(),_="Q",T.push(D,j,l,u);break;case"t":D=l,j=u,R=a[a.length-1],R.command==="Q"&&(D=l+(l-R.points[0]),j=u+(u-R.points[1])),l+=b.shift(),u+=b.shift(),_="Q",T.push(D,j,l,u);break;case"A":z=b.shift(),V=b.shift(),K=b.shift(),te=b.shift(),q=b.shift(),F=l,U=u,l=b.shift(),u=b.shift(),_="A",T=this.convertEndpointToCenterParameterization(F,U,l,u,te,q,z,V,K);break;case"a":z=b.shift(),V=b.shift(),K=b.shift(),te=b.shift(),q=b.shift(),F=l,U=u,l+=b.shift(),u+=b.shift(),_="A",T=this.convertEndpointToCenterParameterization(F,U,l,u,te,q,z,V,K);break}a.push({command:_||y,points:T,start:{x:A,y:I},pathLength:this.calcLength(A,I,_||y,T)})}(y==="z"||y==="Z")&&a.push({command:"z",points:[],start:void 0,pathLength:0})}return a}static calcLength(t,n,r,i){var o,a,s,l,u=Hn;switch(r){case"L":return u.getLineLength(t,n,i[0],i[1]);case"C":for(o=0,a=u.getPointOnCubicBezier(0,t,n,i[0],i[1],i[2],i[3],i[4],i[5]),l=.01;l<=1;l+=.01)s=u.getPointOnCubicBezier(l,t,n,i[0],i[1],i[2],i[3],i[4],i[5]),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;return o;case"Q":for(o=0,a=u.getPointOnQuadraticBezier(0,t,n,i[0],i[1],i[2],i[3]),l=.01;l<=1;l+=.01)s=u.getPointOnQuadraticBezier(l,t,n,i[0],i[1],i[2],i[3]),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;return o;case"A":o=0;var d=i[4],h=i[5],m=i[4]+h,y=Math.PI/180;if(Math.abs(d-m)m;l-=y)s=u.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],l,0),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;else for(l=d+y;l1&&(s*=Math.sqrt(y),l*=Math.sqrt(y));var b=Math.sqrt((s*s*(l*l)-s*s*(m*m)-l*l*(h*h))/(s*s*(m*m)+l*l*(h*h)));o===a&&(b*=-1),isNaN(b)&&(b=0);var S=b*s*m/l,E=b*-l*h/s,k=(t+r)/2+Math.cos(d)*S-Math.sin(d)*E,_=(n+i)/2+Math.sin(d)*S+Math.cos(d)*E,T=function(V){return Math.sqrt(V[0]*V[0]+V[1]*V[1])},A=function(V,K){return(V[0]*K[0]+V[1]*K[1])/(T(V)*T(K))},I=function(V,K){return(V[0]*K[1]=1&&(z=0),a===0&&z>0&&(z=z-2*Math.PI),a===1&&z<0&&(z=z+2*Math.PI),[k,_,s,l,R,z,d,a]}}Hn.prototype.className="Path";Hn.prototype._attrsAffectingSize=["data"];Ar(Hn);ee.addGetterSetter(Hn,"data");class fp extends dc{_sceneFunc(t){super._sceneFunc(t);var n=Math.PI*2,r=this.points(),i=r,o=this.tension()!==0&&r.length>4;o&&(i=this.getTensionPoints());var a=this.pointerLength(),s=r.length,l,u;if(o){const m=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],r[s-2],r[s-1]],y=Hn.calcLength(i[i.length-4],i[i.length-3],"C",m),b=Hn.getPointOnQuadraticBezier(Math.min(1,1-a/y),m[0],m[1],m[2],m[3],m[4],m[5]);l=r[s-2]-b.x,u=r[s-1]-b.y}else l=r[s-2]-r[s-4],u=r[s-1]-r[s-3];var d=(Math.atan2(u,l)+n)%n,h=this.pointerWidth();this.pointerAtEnding()&&(t.save(),t.beginPath(),t.translate(r[s-2],r[s-1]),t.rotate(d),t.moveTo(0,0),t.lineTo(-a,h/2),t.lineTo(-a,-h/2),t.closePath(),t.restore(),this.__fillStroke(t)),this.pointerAtBeginning()&&(t.save(),t.beginPath(),t.translate(r[0],r[1]),o?(l=(i[0]+i[2])/2-r[0],u=(i[1]+i[3])/2-r[1]):(l=r[2]-r[0],u=r[3]-r[1]),t.rotate((Math.atan2(-u,-l)+n)%n),t.moveTo(0,0),t.lineTo(-a,h/2),t.lineTo(-a,-h/2),t.closePath(),t.restore(),this.__fillStroke(t))}__fillStroke(t){var n=this.dashEnabled();n&&(this.attrs.dashEnabled=!1,t.setLineDash([])),t.fillStrokeShape(this),n&&(this.attrs.dashEnabled=!0)}getSelfRect(){const t=super.getSelfRect(),n=this.pointerWidth()/2;return{x:t.x-n,y:t.y-n,width:t.width+n*2,height:t.height+n*2}}}fp.prototype.className="Arrow";Ar(fp);ee.addGetterSetter(fp,"pointerLength",10,Ge());ee.addGetterSetter(fp,"pointerWidth",10,Ge());ee.addGetterSetter(fp,"pointerAtBeginning",!1);ee.addGetterSetter(fp,"pointerAtEnding",!0);let T0=class extends Be{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius()!==t/2&&this.radius(t/2)}setHeight(t){this.radius()!==t/2&&this.radius(t/2)}};T0.prototype._centroid=!0;T0.prototype.className="Circle";T0.prototype._attrsAffectingSize=["radius"];Ar(T0);ee.addGetterSetter(T0,"radius",0,Ge());class ff extends Be{_sceneFunc(t){var n=this.radiusX(),r=this.radiusY();t.beginPath(),t.save(),n!==r&&t.scale(1,r/n),t.arc(0,0,n,0,Math.PI*2,!1),t.restore(),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(t){this.radiusX(t/2)}setHeight(t){this.radiusY(t/2)}}ff.prototype.className="Ellipse";ff.prototype._centroid=!0;ff.prototype._attrsAffectingSize=["radiusX","radiusY"];Ar(ff);ee.addComponentsGetterSetter(ff,"radius",["x","y"]);ee.addGetterSetter(ff,"radiusX",0,Ge());ee.addGetterSetter(ff,"radiusY",0,Ge());let fc=class PG extends Be{constructor(t){super(t),this.on("imageChange.konva",()=>{this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const t=this.image();t&&t.complete||t&&t.readyState===4||t&&t.addEventListener&&t.addEventListener("load",()=>{this._requestDraw()})}_useBufferCanvas(){return super._useBufferCanvas(!0)}_sceneFunc(t){const n=this.getWidth(),r=this.getHeight(),i=this.attrs.image;let o;if(i){const a=this.attrs.cropWidth,s=this.attrs.cropHeight;a&&s?o=[i,this.cropX(),this.cropY(),a,s,0,0,n,r]:o=[i,0,0,n,r]}(this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)),i&&t.drawImage.apply(t,o)}_hitFunc(t){var n=this.width(),r=this.height();t.beginPath(),t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)}getWidth(){var t,n;return(t=this.attrs.width)!==null&&t!==void 0?t:(n=this.image())===null||n===void 0?void 0:n.width}getHeight(){var t,n;return(t=this.attrs.height)!==null&&t!==void 0?t:(n=this.image())===null||n===void 0?void 0:n.height}static fromURL(t,n,r=null){var i=de.createImageElement();i.onload=function(){var o=new PG({image:i});n(o)},i.onerror=r,i.crossOrigin="Anonymous",i.src=t}};fc.prototype.className="Image";Ar(fc);ee.addGetterSetter(fc,"image");ee.addComponentsGetterSetter(fc,"crop",["x","y","width","height"]);ee.addGetterSetter(fc,"cropX",0,Ge());ee.addGetterSetter(fc,"cropY",0,Ge());ee.addGetterSetter(fc,"cropWidth",0,Ge());ee.addGetterSetter(fc,"cropHeight",0,Ge());var TG=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],f9e="Change.konva",h9e="none",L8="up",A8="right",O8="down",M8="left",p9e=TG.length;class bP extends i0{constructor(t){super(t),this.on("add.konva",function(n){this._addListeners(n.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(t){var n=this,r,i=function(){n._sync()};for(r=0;r{n=Math.min(n,a.x),r=Math.max(r,a.x),i=Math.min(i,a.y),o=Math.max(o,a.y)}),{x:n,y:i,width:r-n,height:o-i}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}pp.prototype.className="RegularPolygon";pp.prototype._centroid=!0;pp.prototype._attrsAffectingSize=["radius"];Ar(pp);ee.addGetterSetter(pp,"radius",0,Ge());ee.addGetterSetter(pp,"sides",0,Ge());var JR=Math.PI*2;class gp extends Be{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.innerRadius(),0,JR,!1),t.moveTo(this.outerRadius(),0),t.arc(0,0,this.outerRadius(),JR,0,!0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}}gp.prototype.className="Ring";gp.prototype._centroid=!0;gp.prototype._attrsAffectingSize=["innerRadius","outerRadius"];Ar(gp);ee.addGetterSetter(gp,"innerRadius",0,Ge());ee.addGetterSetter(gp,"outerRadius",0,Ge());class gu extends Be{constructor(t){super(t),this._updated=!0,this.anim=new ts(()=>{var n=this._updated;return this._updated=!1,n}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(t){var n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],a=this.frameOffsets(),s=o[i+0],l=o[i+1],u=o[i+2],d=o[i+3],h=this.image();if((this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,u,d),t.closePath(),t.fillStrokeShape(this)),h)if(a){var m=a[n],y=r*2;t.drawImage(h,s,l,u,d,m[y+0],m[y+1],u,d)}else t.drawImage(h,s,l,u,d,0,0,u,d)}_hitFunc(t){var n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],a=this.frameOffsets(),s=o[i+2],l=o[i+3];if(t.beginPath(),a){var u=a[n],d=r*2;t.rect(u[d+0],u[d+1],s,l)}else t.rect(0,0,s,l);t.closePath(),t.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){var t=this;this.interval=setInterval(function(){t._updateIndex()},1e3/this.frameRate())}start(){if(!this.isRunning()){var t=this.getLayer();this.anim.setLayers(t),this._setInterval(),this.anim.start()}}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){var t=this.frameIndex(),n=this.animation(),r=this.animations(),i=r[n],o=i.length/4;t{t=t.trim();const n=t.indexOf(" ")>=0,r=t.indexOf('"')>=0||t.indexOf("'")>=0;return n&&!r&&(t=`"${t}"`),t}).join(", ")}var $b;function MC(){return $b||($b=de.createCanvasElement().getContext(v9e),$b)}function T9e(e){e.fillText(this._partialText,this._partialTextX,this._partialTextY)}function L9e(e){e.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function A9e(e){return e=e||{},!e.fillLinearGradientColorStops&&!e.fillRadialGradientColorStops&&!e.fillPatternImage&&(e.fill=e.fill||"black"),e}class Lr extends Be{constructor(t){super(A9e(t)),this._partialTextX=0,this._partialTextY=0;for(var n=0;n1&&(k+=a)}}}_hitFunc(t){var n=this.getWidth(),r=this.getHeight();t.beginPath(),t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)}setText(t){var n=de._isString(t)?t:t==null?"":t+"";return this._setAttr(y9e,n),this}getWidth(){var t=this.attrs.width===Dg||this.attrs.width===void 0;return t?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){var t=this.attrs.height===Dg||this.attrs.height===void 0;return t?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return de.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(t){var n=MC(),r=this.fontSize(),i;return n.save(),n.font=this._getContextFont(),i=n.measureText(t),n.restore(),{width:i.width,height:r}}_getContextFont(){return this.fontStyle()+Fb+this.fontVariant()+Fb+(this.fontSize()+w9e)+P9e(this.fontFamily())}_addTextLine(t){this.align()===cv&&(t=t.trim());var n=this._getTextWidth(t);return this.textArr.push({text:t,width:n,lastInParagraph:!1})}_getTextWidth(t){var n=this.letterSpacing(),r=t.length;return MC().measureText(t).width+(r?n*(r-1):0)}_setTextData(){var t=this.text().split(` +`),n=+this.fontSize(),r=0,i=this.lineHeight()*n,o=this.attrs.width,a=this.attrs.height,s=o!==Dg&&o!==void 0,l=a!==Dg&&a!==void 0,u=this.padding(),d=o-u*2,h=a-u*2,m=0,y=this.wrap(),b=y!==nD,S=y!==k9e&&b,E=this.ellipsis();this.textArr=[],MC().font=this._getContextFont();for(var k=E?this._getTextWidth(OC):0,_=0,T=t.length;_d)for(;A.length>0;){for(var R=0,D=A.length,j="",z=0;R>>1,K=A.slice(0,V+1),te=this._getTextWidth(K)+k;te<=d?(R=V+1,j=K,z=te):D=V}if(j){if(S){var q,F=A[j.length],U=F===Fb||F===eD;U&&z<=d?q=j.length:q=Math.max(j.lastIndexOf(Fb),j.lastIndexOf(eD))+1,q>0&&(R=q,j=j.slice(0,R),z=this._getTextWidth(j))}j=j.trimRight(),this._addTextLine(j),r=Math.max(r,z),m+=i;var X=this._shouldHandleEllipsis(m);if(X){this._tryToAddEllipsisToLastLine();break}if(A=A.slice(R),A=A.trimLeft(),A.length>0&&(I=this._getTextWidth(A),I<=d)){this._addTextLine(A),m+=i,r=Math.max(r,I);break}}else break}else this._addTextLine(A),m+=i,r=Math.max(r,I),this._shouldHandleEllipsis(m)&&_h)break;this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0)}this.textHeight=n,this.textWidth=r}_shouldHandleEllipsis(t){var n=+this.fontSize(),r=this.lineHeight()*n,i=this.attrs.height,o=i!==Dg&&i!==void 0,a=this.padding(),s=i-a*2,l=this.wrap(),u=l!==nD;return!u||o&&t+r>s}_tryToAddEllipsisToLastLine(){var t=this.attrs.width,n=t!==Dg&&t!==void 0,r=this.padding(),i=t-r*2,o=this.ellipsis(),a=this.textArr[this.textArr.length-1];if(!(!a||!o)){if(n){var s=this._getTextWidth(a.text+OC)=1){var r=n[0].p0;t.moveTo(r.x,r.y)}for(var i=0;i0&&(s+=t.dataArray[l].pathLength);var u=0;i==="center"&&(u=Math.max(0,s/2-a/2)),i==="right"&&(u=Math.max(0,s-a));for(var d=LG(this.text()),h=this.text().split(" ").length-1,m,y,b,S=-1,E=0,k=function(){E=0;for(var te=t.dataArray,q=S+1;q0)return S=q,te[q];te[q].command==="M"&&(m={x:te[q].points[0],y:te[q].points[1]})}return{}},_=function(te){var q=t._getTextSize(te).width+r;te===" "&&i==="justify"&&(q+=(s-a)/h);var F=0,U=0;for(y=void 0;Math.abs(q-F)/q>.01&&U<20;){U++;for(var X=F;b===void 0;)b=k(),b&&X+b.pathLengthq?y=Hn.getPointOnLine(q,m.x,m.y,b.points[0],b.points[1],m.x,m.y):b=void 0;break;case"A":var W=b.points[4],Q=b.points[5],ie=b.points[4]+Q;E===0?E=W+1e-8:q>F?E+=Math.PI/180*Q/Math.abs(Q):E-=Math.PI/360*Q/Math.abs(Q),(Q<0&&E=0&&E>ie)&&(E=ie,Z=!0),y=Hn.getPointOnEllipticalArc(b.points[0],b.points[1],b.points[2],b.points[3],E,b.points[6]);break;case"C":E===0?q>b.pathLength?E=1e-8:E=q/b.pathLength:q>F?E+=(q-F)/b.pathLength/2:E=Math.max(E-(F-q)/b.pathLength/2,0),E>1&&(E=1,Z=!0),y=Hn.getPointOnCubicBezier(E,b.start.x,b.start.y,b.points[0],b.points[1],b.points[2],b.points[3],b.points[4],b.points[5]);break;case"Q":E===0?E=q/b.pathLength:q>F?E+=(q-F)/b.pathLength:E-=(F-q)/b.pathLength,E>1&&(E=1,Z=!0),y=Hn.getPointOnQuadraticBezier(E,b.start.x,b.start.y,b.points[0],b.points[1],b.points[2],b.points[3]);break}y!==void 0&&(F=Hn.getLineLength(m.x,m.y,y.x,y.y)),Z&&(Z=!1,b=void 0)}},T="C",A=t._getTextSize(T).width+r,I=u/A-1,R=0;Re+`.${NG}`).join(" "),rD="nodesRect",I9e=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],R9e={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135};const D9e="ontouchstart"in pt._global;function N9e(e,t){if(e==="rotater")return"crosshair";t+=de.degToRad(R9e[e]||0);var n=(de.radToDeg(t)%360+360)%360;return de._inRange(n,315+22.5,360)||de._inRange(n,0,22.5)?"ns-resize":de._inRange(n,45-22.5,45+22.5)?"nesw-resize":de._inRange(n,90-22.5,90+22.5)?"ew-resize":de._inRange(n,135-22.5,135+22.5)?"nwse-resize":de._inRange(n,180-22.5,180+22.5)?"ns-resize":de._inRange(n,225-22.5,225+22.5)?"nesw-resize":de._inRange(n,270-22.5,270+22.5)?"ew-resize":de._inRange(n,315-22.5,315+22.5)?"nwse-resize":(de.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}var eS=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"],iD=1e8;function j9e(e){return{x:e.x+e.width/2*Math.cos(e.rotation)+e.height/2*Math.sin(-e.rotation),y:e.y+e.height/2*Math.cos(e.rotation)+e.width/2*Math.sin(e.rotation)}}function jG(e,t,n){const r=n.x+(e.x-n.x)*Math.cos(t)-(e.y-n.y)*Math.sin(t),i=n.y+(e.x-n.x)*Math.sin(t)+(e.y-n.y)*Math.cos(t);return Object.assign(Object.assign({},e),{rotation:e.rotation+t,x:r,y:i})}function B9e(e,t){const n=j9e(e);return jG(e,t,n)}function F9e(e,t,n){let r=t;for(let i=0;i{const i=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()},o=r._attrsAffectingSize.map(a=>a+"Change."+this._getEventNamespace()).join(" ");r.on(o,i),r.on(I9e.map(a=>a+`.${this._getEventNamespace()}`).join(" "),i),r.on(`absoluteTransformChange.${this._getEventNamespace()}`,i),this._proxyDrag(r)}),this._resetTransformCache();var n=!!this.findOne(".top-left");return n&&this.update(),this}_proxyDrag(t){let n;t.on(`dragstart.${this._getEventNamespace()}`,r=>{n=t.getAbsolutePosition(),!this.isDragging()&&t!==this.findOne(".back")&&this.startDrag(r,!1)}),t.on(`dragmove.${this._getEventNamespace()}`,r=>{if(!n)return;const i=t.getAbsolutePosition(),o=i.x-n.x,a=i.y-n.y;this.nodes().forEach(s=>{if(s===t||s.isDragging())return;const l=s.getAbsolutePosition();s.setAbsolutePosition({x:l.x+o,y:l.y+a}),s.startDrag(r)}),n=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(t=>{t.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(rD),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(rD,this.__getNodeRect)}__getNodeShape(t,n=this.rotation(),r){var i=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),o=t.getAbsoluteScale(r),a=t.getAbsolutePosition(r),s=i.x*o.x-t.offsetX()*o.x,l=i.y*o.y-t.offsetY()*o.y;const u=(pt.getAngle(t.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),d={x:a.x+s*Math.cos(u)+l*Math.sin(-u),y:a.y+l*Math.cos(u)+s*Math.sin(u),width:i.width*o.x,height:i.height*o.y,rotation:u};return jG(d,-pt.getAngle(n),{x:0,y:0})}__getNodeRect(){var t=this.getNode();if(!t)return{x:-iD,y:-iD,width:0,height:0,rotation:0};const n=[];this.nodes().map(u=>{const d=u.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var h=[{x:d.x,y:d.y},{x:d.x+d.width,y:d.y},{x:d.x+d.width,y:d.y+d.height},{x:d.x,y:d.y+d.height}],m=u.getAbsoluteTransform();h.forEach(function(y){var b=m.point(y);n.push(b)})});const r=new ka;r.rotate(-pt.getAngle(this.rotation()));var i,o,a,s;n.forEach(function(u){var d=r.point(u);i===void 0&&(i=a=d.x,o=s=d.y),i=Math.min(i,d.x),o=Math.min(o,d.y),a=Math.max(a,d.x),s=Math.max(s,d.y)}),r.invert();const l=r.point({x:i,y:o});return{x:l.x,y:l.y,width:a-i,height:s-o,rotation:pt.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),eS.forEach(function(t){this._createAnchor(t)}.bind(this)),this._createAnchor("rotater")}_createAnchor(t){var n=new By({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:t+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:D9e?10:"auto"}),r=this;n.on("mousedown touchstart",function(i){r._handleMouseDown(i)}),n.on("dragstart",i=>{n.stopDrag(),i.cancelBubble=!0}),n.on("dragend",i=>{i.cancelBubble=!0}),n.on("mouseenter",()=>{var i=pt.getAngle(this.rotation()),o=N9e(t,i);n.getStage().content&&(n.getStage().content.style.cursor=o),this._cursorChange=!0}),n.on("mouseout",()=>{n.getStage().content&&(n.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(n)}_createBack(){var t=new Be({name:"back",width:0,height:0,draggable:!0,sceneFunc(n){var r=this.getParent(),i=r.padding();n.beginPath(),n.rect(-i,-i,this.width()+i*2,this.height()+i*2),n.moveTo(this.width()/2,-i),r.rotateEnabled()&&n.lineTo(this.width()/2,-r.rotateAnchorOffset()*de._sign(this.height())-i),n.fillStrokeShape(this)},hitFunc:(n,r)=>{if(this.shouldOverdrawWholeArea()){var i=this.padding();n.beginPath(),n.rect(-i,-i,r.width()+i*2,r.height()+i*2),n.fillStrokeShape(r)}}});this.add(t),this._proxyDrag(t),t.on("dragstart",n=>{n.cancelBubble=!0}),t.on("dragmove",n=>{n.cancelBubble=!0}),t.on("dragend",n=>{n.cancelBubble=!0}),this.on("dragmove",n=>{this.update()})}_handleMouseDown(t){this._movingAnchorName=t.target.name().split(" ")[0];var n=this._getNodeRect(),r=n.width,i=n.height,o=Math.sqrt(Math.pow(r,2)+Math.pow(i,2));this.sin=Math.abs(i/o),this.cos=Math.abs(r/o),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;var a=t.target.getAbsolutePosition(),s=t.target.getStage().getPointerPosition();this._anchorDragOffset={x:s.x-a.x,y:s.y-a.y},this._fire("transformstart",{evt:t.evt,target:this.getNode()}),this._nodes.forEach(l=>{l._fire("transformstart",{evt:t.evt,target:l})})}_handleMouseMove(t){var n,r,i,o=this.findOne("."+this._movingAnchorName),a=o.getStage();a.setPointersPositions(t);const s=a.getPointerPosition();let l={x:s.x-this._anchorDragOffset.x,y:s.y-this._anchorDragOffset.y};const u=o.getAbsolutePosition();this.anchorDragBoundFunc()&&(l=this.anchorDragBoundFunc()(u,l,t)),o.setAbsolutePosition(l);const d=o.getAbsolutePosition();if(!(u.x===d.x&&u.y===d.y)){if(this._movingAnchorName==="rotater"){var h=this._getNodeRect();n=o.x()-h.width/2,r=-o.y()+h.height/2;let te=Math.atan2(-r,n)+Math.PI/2;h.height<0&&(te-=Math.PI);var m=pt.getAngle(this.rotation());const q=m+te,F=pt.getAngle(this.rotationSnapTolerance()),X=F9e(this.rotationSnaps(),q,F)-h.rotation,Z=B9e(h,X);this._fitNodesInto(Z,t);return}var y=this.keepRatio()||t.shiftKey,_=this.centeredScaling()||t.altKey;if(this._movingAnchorName==="top-left"){if(y){var b=_?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};i=Math.sqrt(Math.pow(b.x-o.x(),2)+Math.pow(b.y-o.y(),2));var S=this.findOne(".top-left").x()>b.x?-1:1,E=this.findOne(".top-left").y()>b.y?-1:1;n=i*this.cos*S,r=i*this.sin*E,this.findOne(".top-left").x(b.x-n),this.findOne(".top-left").y(b.y-r)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(o.y());else if(this._movingAnchorName==="top-right"){if(y){var b=_?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};i=Math.sqrt(Math.pow(o.x()-b.x,2)+Math.pow(b.y-o.y(),2));var S=this.findOne(".top-right").x()b.y?-1:1;n=i*this.cos*S,r=i*this.sin*E,this.findOne(".top-right").x(b.x+n),this.findOne(".top-right").y(b.y-r)}var k=o.position();this.findOne(".top-left").y(k.y),this.findOne(".bottom-right").x(k.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(o.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(o.x());else if(this._movingAnchorName==="bottom-left"){if(y){var b=_?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};i=Math.sqrt(Math.pow(b.x-o.x(),2)+Math.pow(o.y()-b.y,2));var S=b.x{r._fire("transformend",{evt:t,target:r})}),this._movingAnchorName=null}}_fitNodesInto(t,n){var r=this._getNodeRect();const i=1;if(de._inRange(t.width,-this.padding()*2-i,i)){this.update();return}if(de._inRange(t.height,-this.padding()*2-i,i)){this.update();return}const o=this.flipEnabled();var a=new ka;if(a.rotate(pt.getAngle(this.rotation())),this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("left")>=0){const h=a.point({x:-this.padding()*2,y:0});if(t.x+=h.x,t.y+=h.y,t.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=h.x,this._anchorDragOffset.y-=h.y,!o){this.update();return}}else if(this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("right")>=0){const h=a.point({x:this.padding()*2,y:0});if(this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=h.x,this._anchorDragOffset.y-=h.y,t.width+=this.padding()*2,!o){this.update();return}}if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("top")>=0){const h=a.point({x:0,y:-this.padding()*2});if(t.x+=h.x,t.y+=h.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=h.x,this._anchorDragOffset.y-=h.y,t.height+=this.padding()*2,!o){this.update();return}}else if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const h=a.point({x:0,y:this.padding()*2});if(this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=h.x,this._anchorDragOffset.y-=h.y,t.height+=this.padding()*2,!o){this.update();return}}if(this.boundBoxFunc()){const h=this.boundBoxFunc()(r,t);h?t=h:de.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const s=1e7,l=new ka;l.translate(r.x,r.y),l.rotate(r.rotation),l.scale(r.width/s,r.height/s);const u=new ka;u.translate(t.x,t.y),u.rotate(t.rotation),u.scale(t.width/s,t.height/s);const d=u.multiply(l.invert());this._nodes.forEach(h=>{var m;const y=h.getParent().getAbsoluteTransform(),b=h.getTransform().copy();b.translate(h.offsetX(),h.offsetY());const S=new ka;S.multiply(y.copy().invert()).multiply(d).multiply(y).multiply(b);const E=S.decompose();h.setAttrs(E),this._fire("transform",{evt:n,target:h}),h._fire("transform",{evt:n,target:h}),(m=h.getLayer())===null||m===void 0||m.batchDraw()}),this.rotation(de._getRotation(t.rotation)),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(t,n){this.findOne(t).setAttrs(n)}update(){var t,n=this._getNodeRect();this.rotation(de._getRotation(n.rotation));var r=n.width,i=n.height,o=this.enabledAnchors(),a=this.resizeEnabled(),s=this.padding(),l=this.anchorSize();this.find("._anchor").forEach(u=>{u.setAttrs({width:l,height:l,offsetX:l/2,offsetY:l/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:l/2+s,offsetY:l/2+s,visible:a&&o.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:r/2,y:0,offsetY:l/2+s,visible:a&&o.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:r,y:0,offsetX:l/2-s,offsetY:l/2+s,visible:a&&o.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:i/2,offsetX:l/2+s,visible:a&&o.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:r,y:i/2,offsetX:l/2-s,visible:a&&o.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:i,offsetX:l/2+s,offsetY:l/2-s,visible:a&&o.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:r/2,y:i,offsetY:l/2-s,visible:a&&o.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:r,y:i,offsetX:l/2-s,offsetY:l/2-s,visible:a&&o.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:r/2,y:-this.rotateAnchorOffset()*de._sign(i)-s,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:r,height:i,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0}),(t=this.getLayer())===null||t===void 0||t.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();var t=this.findOne("."+this._movingAnchorName);t&&t.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),i0.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return Xe.prototype.toObject.call(this)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}};function $9e(e){return e instanceof Array||de.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach(function(t){eS.indexOf(t)===-1&&de.warn("Unknown anchor name: "+t+". Available names are: "+eS.join(", "))}),e||[]}In.prototype.className="Transformer";Ar(In);ee.addGetterSetter(In,"enabledAnchors",eS,$9e);ee.addGetterSetter(In,"flipEnabled",!0,nl());ee.addGetterSetter(In,"resizeEnabled",!0);ee.addGetterSetter(In,"anchorSize",10,Ge());ee.addGetterSetter(In,"rotateEnabled",!0);ee.addGetterSetter(In,"rotationSnaps",[]);ee.addGetterSetter(In,"rotateAnchorOffset",50,Ge());ee.addGetterSetter(In,"rotationSnapTolerance",5,Ge());ee.addGetterSetter(In,"borderEnabled",!0);ee.addGetterSetter(In,"anchorStroke","rgb(0, 161, 255)");ee.addGetterSetter(In,"anchorStrokeWidth",1,Ge());ee.addGetterSetter(In,"anchorFill","white");ee.addGetterSetter(In,"anchorCornerRadius",0,Ge());ee.addGetterSetter(In,"borderStroke","rgb(0, 161, 255)");ee.addGetterSetter(In,"borderStrokeWidth",1,Ge());ee.addGetterSetter(In,"borderDash");ee.addGetterSetter(In,"keepRatio",!0);ee.addGetterSetter(In,"centeredScaling",!1);ee.addGetterSetter(In,"ignoreStroke",!1);ee.addGetterSetter(In,"padding",0,Ge());ee.addGetterSetter(In,"node");ee.addGetterSetter(In,"nodes");ee.addGetterSetter(In,"boundBoxFunc");ee.addGetterSetter(In,"anchorDragBoundFunc");ee.addGetterSetter(In,"shouldOverdrawWholeArea",!1);ee.addGetterSetter(In,"useSingleNodeRotation",!0);ee.backCompat(In,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});class hc extends Be{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.radius(),0,pt.getAngle(this.angle()),this.clockwise()),t.lineTo(0,0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}hc.prototype.className="Wedge";hc.prototype._centroid=!0;hc.prototype._attrsAffectingSize=["radius"];Ar(hc);ee.addGetterSetter(hc,"radius",0,Ge());ee.addGetterSetter(hc,"angle",0,Ge());ee.addGetterSetter(hc,"clockwise",!1);ee.backCompat(hc,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});function oD(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var z9e=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],H9e=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function V9e(e,t){var n=e.data,r=e.width,i=e.height,o,a,s,l,u,d,h,m,y,b,S,E,k,_,T,A,I,R,D,j,z,V,K,te,q=t+t+1,F=r-1,U=i-1,X=t+1,Z=X*(X+1)/2,W=new oD,Q=null,ie=W,fe=null,Se=null,Te=z9e[t],ye=H9e[t];for(s=1;s>ye,K!==0?(K=255/K,n[d]=(m*Te>>ye)*K,n[d+1]=(y*Te>>ye)*K,n[d+2]=(b*Te>>ye)*K):n[d]=n[d+1]=n[d+2]=0,m-=E,y-=k,b-=_,S-=T,E-=fe.r,k-=fe.g,_-=fe.b,T-=fe.a,l=h+((l=o+t+1)>ye,K>0?(K=255/K,n[l]=(m*Te>>ye)*K,n[l+1]=(y*Te>>ye)*K,n[l+2]=(b*Te>>ye)*K):n[l]=n[l+1]=n[l+2]=0,m-=E,y-=k,b-=_,S-=T,E-=fe.r,k-=fe.g,_-=fe.b,T-=fe.a,l=o+((l=a+X)0&&V9e(t,n)};ee.addGetterSetter(Xe,"blurRadius",0,Ge(),ee.afterSetFilter);const U9e=function(e){var t=this.brightness()*255,n=e.data,r=n.length,i;for(i=0;i255?255:i,o=o<0?0:o>255?255:o,a=a<0?0:a>255?255:a,n[s]=i,n[s+1]=o,n[s+2]=a};ee.addGetterSetter(Xe,"contrast",0,Ge(),ee.afterSetFilter);const q9e=function(e){var t=this.embossStrength()*10,n=this.embossWhiteLevel()*255,r=this.embossDirection(),i=this.embossBlend(),o=0,a=0,s=e.data,l=e.width,u=e.height,d=l*4,h=u;switch(r){case"top-left":o=-1,a=-1;break;case"top":o=-1,a=0;break;case"top-right":o=-1,a=1;break;case"right":o=0,a=1;break;case"bottom-right":o=1,a=1;break;case"bottom":o=1,a=0;break;case"bottom-left":o=1,a=-1;break;case"left":o=0,a=-1;break;default:de.error("Unknown emboss direction: "+r)}do{var m=(h-1)*d,y=o;h+y<1&&(y=0),h+y>u&&(y=0);var b=(h-1+y)*l*4,S=l;do{var E=m+(S-1)*4,k=a;S+k<1&&(k=0),S+k>l&&(k=0);var _=b+(S-1+k)*4,T=s[E]-s[_],A=s[E+1]-s[_+1],I=s[E+2]-s[_+2],R=T,D=R>0?R:-R,j=A>0?A:-A,z=I>0?I:-I;if(j>D&&(R=A),z>D&&(R=I),R*=t,i){var V=s[E]+R,K=s[E+1]+R,te=s[E+2]+R;s[E]=V>255?255:V<0?0:V,s[E+1]=K>255?255:K<0?0:K,s[E+2]=te>255?255:te<0?0:te}else{var q=n-R;q<0?q=0:q>255&&(q=255),s[E]=s[E+1]=s[E+2]=q}}while(--S)}while(--h)};ee.addGetterSetter(Xe,"embossStrength",.5,Ge(),ee.afterSetFilter);ee.addGetterSetter(Xe,"embossWhiteLevel",.5,Ge(),ee.afterSetFilter);ee.addGetterSetter(Xe,"embossDirection","top-left",null,ee.afterSetFilter);ee.addGetterSetter(Xe,"embossBlend",!1,null,ee.afterSetFilter);function IC(e,t,n,r,i){var o=n-t,a=i-r,s;return o===0?r+a/2:a===0?r:(s=(e-t)/o,s=a*s+r,s)}const Y9e=function(e){var t=e.data,n=t.length,r=t[0],i=r,o,a=t[1],s=a,l,u=t[2],d=u,h,m,y=this.enhance();if(y!==0){for(m=0;mi&&(i=o),l=t[m+1],ls&&(s=l),h=t[m+2],hd&&(d=h);i===r&&(i=255,r=0),s===a&&(s=255,a=0),d===u&&(d=255,u=0);var b,S,E,k,_,T,A,I,R;for(y>0?(S=i+y*(255-i),E=r-y*(r-0),_=s+y*(255-s),T=a-y*(a-0),I=d+y*(255-d),R=u-y*(u-0)):(b=(i+r)*.5,S=i+y*(i-b),E=r+y*(r-b),k=(s+a)*.5,_=s+y*(s-k),T=a+y*(a-k),A=(d+u)*.5,I=d+y*(d-A),R=u+y*(u-A)),m=0;mk?E:k;var _=a,T=o,A,I,R=360/T*Math.PI/180,D,j;for(I=0;IT?_:T;var A=a,I=o,R,D,j=n.polarRotation||0,z,V;for(d=0;dt&&(A=T,I=0,R=-1),i=0;i=0&&y=0&&b=0&&y=0&&b=255*4?255:0}return a}function s8e(e,t,n){for(var r=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],i=Math.round(Math.sqrt(r.length)),o=Math.floor(i/2),a=[],s=0;s=0&&y=0&&b=n))for(o=S;o=r||(a=(n*o+i)*4,s+=A[a+0],l+=A[a+1],u+=A[a+2],d+=A[a+3],T+=1);for(s=s/T,l=l/T,u=u/T,d=d/T,i=y;i=n))for(o=S;o=r||(a=(n*o+i)*4,A[a+0]=s,A[a+1]=l,A[a+2]=u,A[a+3]=d)}};ee.addGetterSetter(Xe,"pixelSize",8,Ge(),ee.afterSetFilter);const d8e=function(e){var t=Math.round(this.levels()*254)+1,n=e.data,r=n.length,i=255/t,o;for(o=0;o255?255:e<0?0:Math.round(e)});ee.addGetterSetter(Xe,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});ee.addGetterSetter(Xe,"blue",0,oG,ee.afterSetFilter);const h8e=function(e){var t=e.data,n=t.length,r=this.red(),i=this.green(),o=this.blue(),a=this.alpha(),s,l;for(s=0;s255?255:e<0?0:Math.round(e)});ee.addGetterSetter(Xe,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});ee.addGetterSetter(Xe,"blue",0,oG,ee.afterSetFilter);ee.addGetterSetter(Xe,"alpha",1,function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e});const p8e=function(e){var t=e.data,n=t.length,r,i,o,a;for(r=0;r127&&(u=255-u),d>127&&(d=255-d),h>127&&(h=255-h),t[l]=u,t[l+1]=d,t[l+2]=h}while(--s)}while(--o)},m8e=function(e){var t=this.threshold()*255,n=e.data,r=n.length,i;for(i=0;i{const{width:n,height:r}=t,i=document.createElement("div"),o=new $g.Stage({container:i,width:n,height:r}),a=new $g.Layer,s=new $g.Layer;a.add(new $g.Rect({...t,fill:"white"})),e.forEach(u=>s.add(new $g.Line({points:u.points,stroke:"black",strokeWidth:u.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,globalCompositeOperation:u.tool==="brush"?"source-over":"destination-out"}))),o.add(a),o.add(s);const l=o.toDataURL({...t});return i.remove(),l};let BG=null,FG=null;const y8e=e=>{BG=e},el=()=>BG,b8e=e=>{FG=e},$G=()=>FG,S8e=e=>{const t=window.open("");t&&e.forEach(n=>{const r=new Image;r.src=n.base64,t.document.write(n.caption),t.document.write("
"),t.document.write(r.outerHTML),t.document.write("

")})},zG=(e,t)=>Math.floor(Math.random()*(t-e+1)+e),x8e=e=>{const t=el(),{generationMode:n,generationState:r,postprocessingState:i,canvasState:o,systemState:a}=e,{codeformerFidelity:s,facetoolStrength:l,facetoolType:u,hiresFix:d,hiresStrength:h,shouldRunESRGAN:m,shouldRunFacetool:y,upscalingLevel:b,upscalingStrength:S}=i,{cfgScale:E,height:k,img2imgStrength:_,infillMethod:T,initialImage:A,iterations:I,perlin:R,prompt:D,negativePrompt:j,sampler:z,seamBlur:V,seamless:K,seamSize:te,seamSteps:q,seamStrength:F,seed:U,seedWeights:X,shouldFitToWidthHeight:Z,shouldGenerateVariations:W,shouldRandomizeSeed:Q,steps:ie,threshold:fe,tileSize:Se,variationAmount:Te,width:ye}=r,{shouldDisplayInProgressType:He,saveIntermediatesInterval:Ne,enableImageDebugging:tt}=a,_e={prompt:D,iterations:I,steps:ie,cfg_scale:E,threshold:fe,perlin:R,height:k,width:ye,sampler_name:z,seed:U,progress_images:He==="full-res",progress_latents:He==="latents",save_intermediates:Ne,generation_mode:n,init_mask:""};let lt=!1,wt=!1;if(j!==""&&(_e.prompt=`${D} [${j}]`),_e.seed=Q?zG(hP,pP):U,["txt2img","img2img"].includes(n)&&(_e.seamless=K,_e.hires_fix=d,d&&(_e.strength=h),m&&(lt={level:b,strength:S}),y&&(wt={type:u,strength:l},u==="codeformer"&&(wt.codeformer_fidelity=s))),n==="img2img"&&A&&(_e.init_img=typeof A=="string"?A:A.url,_e.strength=_,_e.fit=Z),n==="unifiedCanvas"&&t){const{layerState:{objects:ct},boundingBoxCoordinates:mt,boundingBoxDimensions:St,stageScale:Ae,isMaskEnabled:ut,shouldPreserveMaskedArea:Mt,boundingBoxScaleMethod:at,scaledBoundingBoxDimensions:Ct}=o,Zt={...mt,...St},le=v8e(ut?ct.filter(tP):[],Zt);_e.init_mask=le,_e.fit=!1,_e.strength=_,_e.invert_mask=Mt,_e.bounding_box=Zt;const De=t.scale();t.scale({x:1/Ae,y:1/Ae});const Ue=t.getAbsolutePosition(),Ye=t.toDataURL({x:Zt.x+Ue.x,y:Zt.y+Ue.y,width:Zt.width,height:Zt.height});tt&&S8e([{base64:le,caption:"mask sent as init_mask"},{base64:Ye,caption:"image sent as init_img"}]),t.scale(De),_e.init_img=Ye,_e.progress_images=!1,at!=="none"&&(_e.inpaint_width=Ct.width,_e.inpaint_height=Ct.height),_e.seam_size=te,_e.seam_blur=V,_e.seam_strength=F,_e.seam_steps=q,_e.tile_size=Se,_e.infill_method=T,_e.force_outpaint=!1}return W?(_e.variation_amount=Te,X&&(_e.with_variations=Yxe(X))):_e.variation_amount=0,tt&&(_e.enable_image_debugging=tt),{generationParameters:_e,esrganParameters:lt,facetoolParameters:wt}};var w8e=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g,C8e=/\b(?:[A-Z]{1,3}[A-Z][TC])(?:[-+]\d{4})?|((?:Australian )?(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time)\b/g,_8e=/[^-+\dA-Z]/g;function no(e,t,n,r){if(arguments.length===1&&typeof e=="string"&&!/\d/.test(e)&&(t=e,e=void 0),e=e||e===0?e:new Date,e instanceof Date||(e=new Date(e)),isNaN(e))throw TypeError("Invalid date");t=String(aD[t]||t||aD.default);var i=t.slice(0,4);(i==="UTC:"||i==="GMT:")&&(t=t.slice(4),n=!0,i==="GMT:"&&(r=!0));var o=function(){return n?"getUTC":"get"},a=function(){return e[o()+"Date"]()},s=function(){return e[o()+"Day"]()},l=function(){return e[o()+"Month"]()},u=function(){return e[o()+"FullYear"]()},d=function(){return e[o()+"Hours"]()},h=function(){return e[o()+"Minutes"]()},m=function(){return e[o()+"Seconds"]()},y=function(){return e[o()+"Milliseconds"]()},b=function(){return n?0:e.getTimezoneOffset()},S=function(){return k8e(e)},E=function(){return E8e(e)},k={d:function(){return a()},dd:function(){return wa(a())},ddd:function(){return Uo.dayNames[s()]},DDD:function(){return sD({y:u(),m:l(),d:a(),_:o(),dayName:Uo.dayNames[s()],short:!0})},dddd:function(){return Uo.dayNames[s()+7]},DDDD:function(){return sD({y:u(),m:l(),d:a(),_:o(),dayName:Uo.dayNames[s()+7]})},m:function(){return l()+1},mm:function(){return wa(l()+1)},mmm:function(){return Uo.monthNames[l()]},mmmm:function(){return Uo.monthNames[l()+12]},yy:function(){return String(u()).slice(2)},yyyy:function(){return wa(u(),4)},h:function(){return d()%12||12},hh:function(){return wa(d()%12||12)},H:function(){return d()},HH:function(){return wa(d())},M:function(){return h()},MM:function(){return wa(h())},s:function(){return m()},ss:function(){return wa(m())},l:function(){return wa(y(),3)},L:function(){return wa(Math.floor(y()/10))},t:function(){return d()<12?Uo.timeNames[0]:Uo.timeNames[1]},tt:function(){return d()<12?Uo.timeNames[2]:Uo.timeNames[3]},T:function(){return d()<12?Uo.timeNames[4]:Uo.timeNames[5]},TT:function(){return d()<12?Uo.timeNames[6]:Uo.timeNames[7]},Z:function(){return r?"GMT":n?"UTC":P8e(e)},o:function(){return(b()>0?"-":"+")+wa(Math.floor(Math.abs(b())/60)*100+Math.abs(b())%60,4)},p:function(){return(b()>0?"-":"+")+wa(Math.floor(Math.abs(b())/60),2)+":"+wa(Math.floor(Math.abs(b())%60),2)},S:function(){return["th","st","nd","rd"][a()%10>3?0:(a()%100-a()%10!=10)*a()%10]},W:function(){return S()},WW:function(){return wa(S())},N:function(){return E()}};return t.replace(w8e,function(_){return _ in k?k[_]():_.slice(1,_.length-1)})}var aD={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",paddedShortDate:"mm/dd/yyyy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:sso",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",expiresHeaderFormat:"ddd, dd mmm yyyy HH:MM:ss Z"},Uo={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"],timeNames:["a","p","am","pm","A","P","AM","PM"]},wa=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;return String(t).padStart(n,"0")},sD=function(t){var n=t.y,r=t.m,i=t.d,o=t._,a=t.dayName,s=t.short,l=s===void 0?!1:s,u=new Date,d=new Date;d.setDate(d[o+"Date"]()-1);var h=new Date;h.setDate(h[o+"Date"]()+1);var m=function(){return u[o+"Date"]()},y=function(){return u[o+"Month"]()},b=function(){return u[o+"FullYear"]()},S=function(){return d[o+"Date"]()},E=function(){return d[o+"Month"]()},k=function(){return d[o+"FullYear"]()},_=function(){return h[o+"Date"]()},T=function(){return h[o+"Month"]()},A=function(){return h[o+"FullYear"]()};return b()===n&&y()===r&&m()===i?l?"Tdy":"Today":k()===n&&E()===r&&S()===i?l?"Ysd":"Yesterday":A()===n&&T()===r&&_()===i?l?"Tmw":"Tomorrow":a},k8e=function(t){var n=new Date(t.getFullYear(),t.getMonth(),t.getDate());n.setDate(n.getDate()-(n.getDay()+6)%7+3);var r=new Date(n.getFullYear(),0,4);r.setDate(r.getDate()-(r.getDay()+6)%7+3);var i=n.getTimezoneOffset()-r.getTimezoneOffset();n.setHours(n.getHours()-i);var o=(n-r)/(864e5*7);return 1+Math.floor(o)},E8e=function(t){var n=t.getDay();return n===0&&(n=7),n},P8e=function(t){return(String(t).match(C8e)||[""]).pop().replace(_8e,"").replace(/GMT\+0000/g,"UTC")};const T8e=(e,t)=>{const{dispatch:n,getState:r}=e;return{emitGenerateImage:i=>{n(Hs(!0));const o=r(),{generation:a,postprocessing:s,system:l,canvas:u}=o,d={generationMode:i,generationState:a,postprocessingState:s,canvasState:u,systemState:l};n(J6e());const{generationParameters:h,esrganParameters:m,facetoolParameters:y}=x8e(d);t.emit("generateImage",h,m,y),h.init_mask&&(h.init_mask=h.init_mask.substr(0,64).concat("...")),h.init_img&&(h.init_img=h.init_img.substr(0,64).concat("...")),n(to({timestamp:no(new Date,"isoDateTime"),message:`Image generation requested: ${JSON.stringify({...h,...m,...y})}`}))},emitRunESRGAN:i=>{n(Hs(!0));const{postprocessing:{upscalingLevel:o,upscalingStrength:a}}=r(),s={upscale:[o,a]};t.emit("runPostprocessing",i,{type:"esrgan",...s}),n(to({timestamp:no(new Date,"isoDateTime"),message:`ESRGAN upscale requested: ${JSON.stringify({file:i.url,...s})}`}))},emitRunFacetool:i=>{n(Hs(!0));const{postprocessing:{facetoolType:o,facetoolStrength:a,codeformerFidelity:s}}=r(),l={facetool_strength:a};o==="codeformer"&&(l.codeformer_fidelity=s),t.emit("runPostprocessing",i,{type:o,...l}),n(to({timestamp:no(new Date,"isoDateTime"),message:`Face restoration (${o}) requested: ${JSON.stringify({file:i.url,...l})}`}))},emitDeleteImage:i=>{const{url:o,uuid:a,category:s,thumbnail:l}=i;n(eU(i)),t.emit("deleteImage",o,l,a,s)},emitRequestImages:i=>{const o=r().gallery,{earliest_mtime:a}=o.categories[i];t.emit("requestImages",i,a)},emitRequestNewImages:i=>{const o=r().gallery,{latest_mtime:a}=o.categories[i];t.emit("requestLatestImages",i,a)},emitCancelProcessing:()=>{t.emit("cancel")},emitRequestSystemConfig:()=>{t.emit("requestSystemConfig")},emitSearchForModels:i=>{t.emit("searchForModels",i)},emitAddNewModel:i=>{t.emit("addNewModel",i)},emitDeleteModel:i=>{t.emit("deleteModel",i)},emitRequestModelChange:i=>{n(X6e()),t.emit("requestModelChange",i)},emitSaveStagingAreaImageToGallery:i=>{t.emit("requestSaveStagingAreaImageToGallery",i)},emitRequestEmptyTempFolder:()=>{t.emit("requestEmptyTempFolder")}}};let Hb;const L8e=new Uint8Array(16);function A8e(){if(!Hb&&(Hb=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Hb))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Hb(L8e)}const zi=[];for(let e=0;e<256;++e)zi.push((e+256).toString(16).slice(1));function O8e(e,t=0){return(zi[e[t+0]]+zi[e[t+1]]+zi[e[t+2]]+zi[e[t+3]]+"-"+zi[e[t+4]]+zi[e[t+5]]+"-"+zi[e[t+6]]+zi[e[t+7]]+"-"+zi[e[t+8]]+zi[e[t+9]]+"-"+zi[e[t+10]]+zi[e[t+11]]+zi[e[t+12]]+zi[e[t+13]]+zi[e[t+14]]+zi[e[t+15]]).toLowerCase()}const M8e=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),lD={randomUUID:M8e};function cm(e,t,n){if(lD.randomUUID&&!t&&!e)return lD.randomUUID();e=e||{};const r=e.random||(e.rng||A8e)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return O8e(r)}const I8=zr("socketio/generateImage"),I8e=zr("socketio/runESRGAN"),R8e=zr("socketio/runFacetool"),D8e=zr("socketio/deleteImage"),R8=zr("socketio/requestImages"),uD=zr("socketio/requestNewImages"),N8e=zr("socketio/cancelProcessing"),j8e=zr("socketio/requestSystemConfig"),cD=zr("socketio/searchForModels"),Fy=zr("socketio/addNewModel"),B8e=zr("socketio/deleteModel"),HG=zr("socketio/requestModelChange"),F8e=zr("socketio/saveStagingAreaImageToGallery"),$8e=zr("socketio/requestEmptyTempFolder"),z8e=e=>{const{dispatch:t,getState:n}=e;return{onConnect:()=>{try{t(PR(!0)),t(D4(zt.t("common:statusConnected"))),t(j8e());const r=n().gallery;r.categories.result.latest_mtime?t(uD("result")):t(R8("result")),r.categories.user.latest_mtime?t(uD("user")):t(R8("user"))}catch(r){console.error(r)}},onDisconnect:()=>{try{t(PR(!1)),t(D4(zt.t("common:statusDisconnected"))),t(to({timestamp:no(new Date,"isoDateTime"),message:"Disconnected from server",level:"warning"}))}catch(r){console.error(r)}},onGenerationResult:r=>{try{const i=n(),{activeTab:o}=i.ui,{shouldLoopback:a}=i.postprocessing,{boundingBox:s,generationMode:l,...u}=r,d={uuid:cm(),...u};if(["txt2img","img2img"].includes(l)&&t(sm({category:"result",image:{...d,category:"result"}})),l==="unifiedCanvas"&&r.boundingBox){const{boundingBox:h}=r;t(hxe({image:{...d,category:"temp"},boundingBox:h})),i.canvas.shouldAutoSave&&t(sm({image:{...d,category:"result"},category:"result"}))}if(a)switch(cP[o]){case"img2img":{t(k0(d));break}}t(xC()),t(to({timestamp:no(new Date,"isoDateTime"),message:`Image generated: ${r.url}`}))}catch(i){console.error(i)}},onIntermediateResult:r=>{try{t(Nxe({uuid:cm(),...r,category:"result"})),r.isBase64||t(to({timestamp:no(new Date,"isoDateTime"),message:`Intermediate image generated: ${r.url}`}))}catch(i){console.error(i)}},onPostprocessingResult:r=>{try{t(sm({category:"result",image:{uuid:cm(),...r,category:"result"}})),t(to({timestamp:no(new Date,"isoDateTime"),message:`Postprocessed: ${r.url}`}))}catch(i){console.error(i)}},onProgressUpdate:r=>{try{t(Hs(!0)),t(G6e(r))}catch(i){console.error(i)}},onError:r=>{const{message:i,additionalData:o}=r;try{t(to({timestamp:no(new Date,"isoDateTime"),message:`Server error: ${i}`,level:"error"})),t(TR()),t(xC())}catch(a){console.error(a)}},onGalleryImages:r=>{const{images:i,areMoreImagesAvailable:o,category:a}=r,s=i.map(l=>({uuid:cm(),...l}));t(Dxe({images:s,areMoreImagesAvailable:o,category:a})),t(to({timestamp:no(new Date,"isoDateTime"),message:`Loaded ${i.length} images`}))},onProcessingCanceled:()=>{t(K6e());const{intermediateImage:r}=n().gallery;r&&(r.isBase64||(t(sm({category:"result",image:r})),t(to({timestamp:no(new Date,"isoDateTime"),message:`Intermediate image saved: ${r.url}`}))),t(xC())),t(to({timestamp:no(new Date,"isoDateTime"),message:"Processing canceled",level:"warning"}))},onImageDeleted:r=>{const{url:i}=r;t(eU(r));const{generation:{initialImage:o,maskPath:a}}=n();(o===i||(o==null?void 0:o.url)===i)&&t(oU()),a===i&&t(cU("")),t(to({timestamp:no(new Date,"isoDateTime"),message:`Image deleted: ${i}`}))},onSystemConfig:r=>{t(q6e(r)),r.infill_methods.includes("patchmatch")||t(uU(r.infill_methods[0]))},onFoundModels:r=>{const{search_folder:i,found_models:o}=r;t(FU(i)),t($U(o))},onNewModelAdded:r=>{const{new_model_name:i,model_list:o,update:a}=r;t(Tb(o)),t(Hs(!1)),t(to({timestamp:no(new Date,"isoDateTime"),message:`Model Added: ${i}`,level:"info"})),t(Th({title:a?`${zt.t("modelmanager:modelUpdated")}: ${i}`:`${zt.t("modelmanager:modelAdded")}: ${i}`,status:"success",duration:2500,isClosable:!0}))},onModelDeleted:r=>{const{deleted_model_name:i,model_list:o}=r;t(Tb(o)),t(Hs(!1)),t(to({timestamp:no(new Date,"isoDateTime"),message:`${zt.t("modelmanager:modelAdded")}: ${i}`,level:"info"})),t(Th({title:`${zt.t("modelmanager:modelEntryDeleted")}: ${i}`,status:"success",duration:2500,isClosable:!0}))},onModelChanged:r=>{const{model_name:i,model_list:o}=r;t(Tb(o)),t(D4(zt.t("common:statusModelChanged"))),t(Hs(!1)),t(lm(!0)),t(to({timestamp:no(new Date,"isoDateTime"),message:`Model changed: ${i}`,level:"info"}))},onModelChangeFailed:r=>{const{model_name:i,model_list:o}=r;t(Tb(o)),t(Hs(!1)),t(lm(!0)),t(TR()),t(to({timestamp:no(new Date,"isoDateTime"),message:`Model change failed: ${i}`,level:"error"}))},onTempFolderEmptied:()=>{t(Th({title:zt.t("toast:tempFoldersEmptied"),status:"success",duration:2500,isClosable:!0}))}}},H8e=()=>{const{origin:e}=new URL(window.location.href),t=B4(e,{timeout:6e4,path:`${window.location.pathname}socket.io`});let n=!1;return i=>o=>a=>{const{onConnect:s,onDisconnect:l,onError:u,onPostprocessingResult:d,onGenerationResult:h,onIntermediateResult:m,onProgressUpdate:y,onGalleryImages:b,onProcessingCanceled:S,onImageDeleted:E,onSystemConfig:k,onModelChanged:_,onFoundModels:T,onNewModelAdded:A,onModelDeleted:I,onModelChangeFailed:R,onTempFolderEmptied:D}=z8e(i),{emitGenerateImage:j,emitRunESRGAN:z,emitRunFacetool:V,emitDeleteImage:K,emitRequestImages:te,emitRequestNewImages:q,emitCancelProcessing:F,emitRequestSystemConfig:U,emitSearchForModels:X,emitAddNewModel:Z,emitDeleteModel:W,emitRequestModelChange:Q,emitSaveStagingAreaImageToGallery:ie,emitRequestEmptyTempFolder:fe}=T8e(i,t);switch(n||(t.on("connect",()=>s()),t.on("disconnect",()=>l()),t.on("error",Se=>u(Se)),t.on("generationResult",Se=>h(Se)),t.on("postprocessingResult",Se=>d(Se)),t.on("intermediateResult",Se=>m(Se)),t.on("progressUpdate",Se=>y(Se)),t.on("galleryImages",Se=>b(Se)),t.on("processingCanceled",()=>{S()}),t.on("imageDeleted",Se=>{E(Se)}),t.on("systemConfig",Se=>{k(Se)}),t.on("foundModels",Se=>{T(Se)}),t.on("newModelAdded",Se=>{A(Se)}),t.on("modelDeleted",Se=>{I(Se)}),t.on("modelChanged",Se=>{_(Se)}),t.on("modelChangeFailed",Se=>{R(Se)}),t.on("tempFolderEmptied",()=>{D()}),n=!0),a.type){case"socketio/generateImage":{j(a.payload);break}case"socketio/runESRGAN":{z(a.payload);break}case"socketio/runFacetool":{V(a.payload);break}case"socketio/deleteImage":{K(a.payload);break}case"socketio/requestImages":{te(a.payload);break}case"socketio/requestNewImages":{q(a.payload);break}case"socketio/cancelProcessing":{F();break}case"socketio/requestSystemConfig":{U();break}case"socketio/searchForModels":{X(a.payload);break}case"socketio/addNewModel":{Z(a.payload);break}case"socketio/deleteModel":{W(a.payload);break}case"socketio/requestModelChange":{Q(a.payload);break}case"socketio/saveStagingAreaImageToGallery":{ie(a.payload);break}case"socketio/requestEmptyTempFolder":{fe();break}}o(a)}},V8e=["cursorPosition","isCanvasInitialized","doesCanvasNeedScaling"].map(e=>`canvas.${e}`),W8e=["currentIteration","currentStatus","currentStep","isCancelable","isConnected","isESRGANAvailable","isGFPGANAvailable","isProcessing","socketId","totalIterations","totalSteps","openModel"].map(e=>`system.${e}`),U8e=["categories","currentCategory","currentImage","currentImageUuid","shouldAutoSwitchToNewImages","shouldHoldGalleryOpen","intermediateImage"].map(e=>`gallery.${e}`),VG=wW({generation:twe,postprocessing:awe,gallery:Vxe,system:nCe,canvas:Ixe,ui:fCe,lightbox:Gxe}),G8e=IW.getPersistConfig({key:"root",storage:MW,rootReducer:VG,blacklist:[...V8e,...W8e,...U8e],debounce:300}),q8e=$Se(G8e,VG),WG=mSe({reducer:q8e,middleware:e=>e({immutableCheck:!1,serializableCheck:!1}).concat(H8e()),devTools:{actionsDenylist:["canvas/setCursorPosition","canvas/setStageCoordinates","canvas/setStageScale","canvas/setIsDrawing","canvas/setBoundingBoxCoordinates","canvas/setBoundingBoxDimensions","canvas/setIsDrawing","canvas/addPointToCurrentLine"]}}),UG=GSe(WG),SP=w.createContext(null),Ie=A5e,he=b5e;let dD;const xP=()=>({setOpenUploader:e=>{e&&(dD=e)},openUploader:dD}),Or=ot(e=>e.ui,e=>cP[e.activeTab],{memoizeOptions:{equalityCheck:Ee.isEqual}}),Y8e=ot(e=>e.ui,e=>e.activeTab,{memoizeOptions:{equalityCheck:Ee.isEqual}}),mp=ot(e=>e.ui,e=>e,{memoizeOptions:{equalityCheck:Ee.isEqual}}),fD=e=>async(t,n)=>{const{imageFile:r}=e,i=n(),o=Or(i),a=new FormData;a.append("file",r,r.name),a.append("data",JSON.stringify({kind:"init"}));const l=await(await fetch(`${window.location.origin}/upload`,{method:"POST",body:a})).json(),u={uuid:cm(),category:"user",...l};t(sm({image:u,category:"user"})),o==="unifiedCanvas"?t(Nx(u)):o==="img2img"&&t(k0(u))};function K8e(){const{t:e}=Ve();return v.jsxs("div",{className:"work-in-progress nodes-work-in-progress",children:[v.jsx("h1",{children:e("common:nodes")}),v.jsx("p",{children:e("common:nodesDesc")})]})}const X8e=()=>{const{t:e}=Ve();return v.jsxs("div",{className:"work-in-progress post-processing-work-in-progress",children:[v.jsx("h1",{children:e("common:postProcessing")}),v.jsx("p",{children:e("common:postProcessDesc1")}),v.jsx("p",{children:e("common:postProcessDesc2")}),v.jsx("p",{children:e("common:postProcessDesc3")})]})};function Z8e(){const{t:e}=Ve();return v.jsxs("div",{className:"work-in-progress nodes-work-in-progress",children:[v.jsx("h1",{children:e("common:training")}),v.jsxs("p",{children:[e("common:trainingDesc1"),v.jsx("br",{}),v.jsx("br",{}),e("common:trainingDesc2")]})]})}function Q8e(e){const{i18n:t}=Ve(),n=localStorage.getItem("i18nextLng");N.useEffect(()=>{e()},[e]),N.useEffect(()=>{t.on("languageChanged",()=>{e()})},[e,t,n])}const J8e=yt({displayName:"ImageToImageIcon",viewBox:"0 0 3543 3543",path:v.jsx("g",{transform:"matrix(1.10943,0,0,1.10943,-206.981,-213.533)",children:v.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M688.533,2405.95L542.987,2405.95C349.532,2405.95 192.47,2248.89 192.47,2055.44L192.47,542.987C192.47,349.532 349.532,192.47 542.987,192.47L2527.88,192.47C2721.33,192.47 2878.4,349.532 2878.4,542.987L2878.4,1172.79L3023.94,1172.79C3217.4,1172.79 3374.46,1329.85 3374.46,1523.3C3374.46,1523.3 3374.46,3035.75 3374.46,3035.75C3374.46,3229.21 3217.4,3386.27 3023.94,3386.27L1039.05,3386.27C845.595,3386.27 688.533,3229.21 688.533,3035.75L688.533,2405.95ZM3286.96,2634.37L3286.96,1523.3C3286.96,1378.14 3169.11,1260.29 3023.94,1260.29C3023.94,1260.29 1039.05,1260.29 1039.05,1260.29C893.887,1260.29 776.033,1378.14 776.033,1523.3L776.033,2489.79L1440.94,1736.22L2385.83,2775.59L2880.71,2200.41L3286.96,2634.37ZM2622.05,1405.51C2778.5,1405.51 2905.51,1532.53 2905.51,1688.98C2905.51,1845.42 2778.5,1972.44 2622.05,1972.44C2465.6,1972.44 2338.58,1845.42 2338.58,1688.98C2338.58,1532.53 2465.6,1405.51 2622.05,1405.51ZM2790.9,1172.79L1323.86,1172.79L944.882,755.906L279.97,1509.47L279.97,542.987C279.97,397.824 397.824,279.97 542.987,279.97C542.987,279.97 2527.88,279.97 2527.88,279.97C2673.04,279.97 2790.9,397.824 2790.9,542.987L2790.9,1172.79ZM2125.98,425.197C2282.43,425.197 2409.45,552.213 2409.45,708.661C2409.45,865.11 2282.43,992.126 2125.98,992.126C1969.54,992.126 1842.52,865.11 1842.52,708.661C1842.52,552.213 1969.54,425.197 2125.98,425.197Z"})})}),e_e=yt({displayName:"NodesIcon",viewBox:"0 0 3543 3543",path:v.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3543.31,770.787C3543.31,515.578 3336.11,308.38 3080.9,308.38L462.407,308.38C207.197,308.38 0,515.578 0,770.787L0,2766.03C0,3021.24 207.197,3228.44 462.407,3228.44L3080.9,3228.44C3336.11,3228.44 3543.31,3021.24 3543.31,2766.03C3543.31,2766.03 3543.31,770.787 3543.31,770.787ZM3427.88,770.787L3427.88,2766.03C3427.88,2957.53 3272.4,3113.01 3080.9,3113.01C3080.9,3113.01 462.407,3113.01 462.407,3113.01C270.906,3113.01 115.431,2957.53 115.431,2766.03L115.431,770.787C115.431,579.286 270.906,423.812 462.407,423.812L3080.9,423.812C3272.4,423.812 3427.88,579.286 3427.88,770.787ZM1214.23,1130.69L1321.47,1130.69C1324.01,1130.69 1326.54,1130.53 1329.05,1130.2C1329.05,1130.2 1367.3,1125.33 1397.94,1149.8C1421.63,1168.72 1437.33,1204.3 1437.33,1265.48L1437.33,2078.74L1220.99,2078.74C1146.83,2078.74 1086.61,2138.95 1086.61,2213.12L1086.61,2762.46C1086.61,2836.63 1146.83,2896.84 1220.99,2896.84L1770.34,2896.84C1844.5,2896.84 1904.71,2836.63 1904.71,2762.46L1904.71,2213.12C1904.71,2138.95 1844.5,2078.74 1770.34,2078.74L1554,2078.74L1554,1604.84C1625.84,1658.19 1703.39,1658.1 1703.39,1658.1C1703.54,1658.1 1703.69,1658.11 1703.84,1658.11L2362.2,1658.11L2362.2,1874.44C2362.2,1948.61 2422.42,2008.82 2496.58,2008.82L3045.93,2008.82C3120.09,2008.82 3180.3,1948.61 3180.3,1874.44L3180.3,1325.1C3180.3,1250.93 3120.09,1190.72 3045.93,1190.72L2496.58,1190.72C2422.42,1190.72 2362.2,1250.93 2362.2,1325.1L2362.2,1558.97L2362.2,1541.44L1704.23,1541.44C1702.2,1541.37 1650.96,1539.37 1609.51,1499.26C1577.72,1468.49 1554,1416.47 1554,1331.69L1554,1265.48C1554,1153.86 1513.98,1093.17 1470.76,1058.64C1411.24,1011.1 1338.98,1012.58 1319.15,1014.03L1214.23,1014.03L1214.23,796.992C1214.23,722.828 1154.02,662.617 1079.85,662.617L530.507,662.617C456.343,662.617 396.131,722.828 396.131,796.992L396.131,1346.34C396.131,1420.5 456.343,1480.71 530.507,1480.71L1079.85,1480.71C1154.02,1480.71 1214.23,1420.5 1214.23,1346.34L1214.23,1130.69Z"})}),t_e=yt({displayName:"PostprocessingIcon",viewBox:"0 0 3543 3543",path:v.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M709.477,1596.53L992.591,1275.66L2239.09,2646.81L2891.95,1888.03L3427.88,2460.51L3427.88,994.78C3427.88,954.66 3421.05,916.122 3408.5,880.254L3521.9,855.419C3535.8,899.386 3543.31,946.214 3543.31,994.78L3543.31,2990.02C3543.31,3245.23 3336.11,3452.43 3080.9,3452.43C3080.9,3452.43 462.407,3452.43 462.407,3452.43C207.197,3452.43 -0,3245.23 -0,2990.02L-0,994.78C-0,739.571 207.197,532.373 462.407,532.373L505.419,532.373L504.644,532.546L807.104,600.085C820.223,601.729 832.422,607.722 841.77,617.116C850.131,625.517 855.784,636.21 858.055,647.804L462.407,647.804C270.906,647.804 115.431,803.279 115.431,994.78L115.431,2075.73L-0,2101.5L115.431,2127.28L115.431,2269.78L220.47,2150.73L482.345,2209.21C503.267,2211.83 522.722,2221.39 537.63,2236.37C552.538,2251.35 562.049,2270.9 564.657,2291.93L671.84,2776.17L779.022,2291.93C781.631,2270.9 791.141,2251.35 806.05,2236.37C820.958,2221.39 840.413,2211.83 861.334,2209.21L1353.15,2101.5L861.334,1993.8C840.413,1991.18 820.958,1981.62 806.05,1966.64C791.141,1951.66 781.631,1932.11 779.022,1911.08L709.477,1596.53ZM671.84,1573.09L725.556,2006.07C726.863,2016.61 731.63,2026.4 739.101,2033.91C746.573,2041.42 756.323,2046.21 766.808,2047.53L1197.68,2101.5L766.808,2155.48C756.323,2156.8 746.573,2161.59 739.101,2169.09C731.63,2176.6 726.863,2186.4 725.556,2196.94L671.84,2629.92L618.124,2196.94C616.817,2186.4 612.05,2176.6 604.579,2169.09C597.107,2161.59 587.357,2156.8 576.872,2155.48L146.001,2101.5L576.872,2047.53C587.357,2046.21 597.107,2041.42 604.579,2033.91C612.05,2026.4 616.817,2016.61 618.124,2006.07L671.84,1573.09ZM609.035,1710.36L564.657,1911.08C562.049,1932.11 552.538,1951.66 537.63,1966.64C522.722,1981.62 503.267,1991.18 482.345,1993.8L328.665,2028.11L609.035,1710.36ZM2297.12,938.615L2451.12,973.003C2480.59,976.695 2507.99,990.158 2528.99,1011.26C2549.99,1032.37 2563.39,1059.9 2567.07,1089.52L2672.73,1566.9C2634.5,1580.11 2593.44,1587.29 2550.72,1587.29C2344.33,1587.29 2176.77,1419.73 2176.77,1213.34C2176.77,1104.78 2223.13,1006.96 2297.12,938.615ZM2718.05,76.925L2793.72,686.847C2795.56,701.69 2802.27,715.491 2812.8,726.068C2823.32,736.644 2837.06,743.391 2851.83,745.242L3458.78,821.28L2851.83,897.318C2837.06,899.168 2823.32,905.916 2812.8,916.492C2802.27,927.068 2795.56,940.87 2793.72,955.712L2718.05,1565.63L2642.38,955.712C2640.54,940.87 2633.83,927.068 2623.3,916.492C2612.78,905.916 2599.04,899.168 2584.27,897.318L1977.32,821.28L2584.27,745.242C2599.04,743.391 2612.78,736.644 2623.3,726.068C2633.83,715.491 2640.54,701.69 2642.38,686.847L2718.05,76.925ZM2883.68,1043.06C2909.88,1094.13 2924.67,1152.02 2924.67,1213.34C2924.67,1335.4 2866.06,1443.88 2775.49,1512.14L2869.03,1089.52C2871.07,1073.15 2876.07,1057.42 2883.68,1043.06ZM925.928,201.2L959.611,472.704C960.431,479.311 963.42,485.455 968.105,490.163C972.79,494.871 978.904,497.875 985.479,498.698L1255.66,532.546L985.479,566.395C978.904,567.218 972.79,570.222 968.105,574.93C963.42,579.638 960.431,585.781 959.611,592.388L925.928,863.893L892.245,592.388C891.425,585.781 888.436,579.638 883.751,574.93C879.066,570.222 872.952,567.218 866.378,566.395L596.195,532.546L866.378,498.698C872.952,497.875 879.066,494.871 883.751,490.163C888.436,485.455 891.425,479.311 892.245,472.704L925.928,201.2ZM2864.47,532.373L3080.9,532.373C3258.7,532.373 3413.2,632.945 3490.58,780.281L3319.31,742.773C3257.14,683.925 3173.2,647.804 3080.9,647.804L2927.07,647.804C2919.95,642.994 2913.25,637.473 2907.11,631.298C2886.11,610.194 2872.71,582.655 2869.03,553.04L2864.47,532.373ZM1352.36,532.373L2571.64,532.373L2567.07,553.04C2563.39,582.655 2549.99,610.194 2528.99,631.298C2522.85,637.473 2516.16,642.994 2509.03,647.804L993.801,647.804C996.072,636.21 1001.73,625.517 1010.09,617.116C1019.43,607.722 1031.63,601.729 1044.75,600.085L1353.15,532.546L1352.36,532.373Z"})}),n_e=yt({displayName:"TextToImageIcon",viewBox:"0 0 3543 3543",path:v.jsx("g",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",transform:"matrix(1.11667,0,0,1.1066,-231.131,-213.062)",children:v.jsx("path",{d:"M2209.59,1137.35L2209.59,1098.17C2177.13,1108.99 2125.74,1121.91 2055.41,1136.94C2054.77,1137.08 2054.14,1137.21 2053.49,1137.35L1662.79,1137.35C1687.75,1101.98 1720.8,1074.35 1761.93,1054.44C1808.52,1031.9 1875.69,1012.22 1963.45,995.386C2081.86,973.146 2163.91,952.409 2209.59,933.174L2209.59,907.929C2209.59,859.241 2197.57,824.529 2173.53,803.792C2149.48,783.054 2104.1,772.686 2037.38,772.686C1992.3,772.686 1957.14,781.552 1931.89,799.284C1906.64,817.015 1886.21,848.121 1870.58,892.601L1640.67,851.127C1666.51,758.56 1710.99,690.037 1774.11,645.557C1837.22,601.077 1930.99,578.837 2055.41,578.837C2168.42,578.837 2252.57,592.211 2307.87,618.959C2363.17,645.707 2402.09,679.668 2424.63,720.842C2447.17,762.016 2458.44,837.602 2458.44,947.6L2456.7,1137.35L3021.34,1137.35C3214.79,1137.35 3371.86,1294.41 3371.86,1487.87C3371.86,1487.87 3371.86,3000.32 3371.86,3000.32C3371.86,3193.78 3214.79,3350.84 3021.34,3350.84C3021.34,3350.84 1036.45,3350.84 1036.45,3350.84C842.991,3350.84 685.93,3193.78 685.93,3000.32L685.93,1487.87C685.93,1400.21 718.174,1320.03 771.448,1258.54L772.123,1257.76L607.408,1257.76L498.311,1558L215.202,1558L730.028,236.22L1012.24,236.22L1373.06,1137.35L2209.59,1137.35ZM3284.36,2598.93L3284.36,1487.87C3284.36,1342.71 3166.5,1224.85 3021.34,1224.85C3021.34,1224.85 1036.45,1224.85 1036.45,1224.85C891.284,1224.85 773.43,1342.71 773.43,1487.87L773.43,2454.35L1438.34,1700.79L2383.22,2740.16L2878.11,2164.98L3284.36,2598.93ZM2619.44,1370.08C2775.89,1370.08 2902.91,1497.1 2902.91,1653.54C2902.91,1809.99 2775.89,1937.01 2619.44,1937.01C2462.99,1937.01 2335.98,1809.99 2335.98,1653.54C2335.98,1497.1 2462.99,1370.08 2619.44,1370.08ZM772.877,1256.89L772.849,1256.93L773.167,1256.57L772.877,1256.89ZM773.634,1256.04L773.563,1256.12L773.985,1255.64L773.634,1256.04ZM774.394,1255.18L774.276,1255.31L774.746,1254.78L774.394,1255.18ZM775.157,1254.32L774.988,1254.51L775.493,1253.95L775.157,1254.32ZM775.923,1253.47L775.698,1253.72L776.237,1253.12L775.923,1253.47ZM776.691,1252.62L776.403,1252.94L776.979,1252.3L776.691,1252.62ZM777.462,1251.77L777.098,1252.17L777.723,1251.49L777.462,1251.77ZM925.081,1155.44C868.026,1174.57 817.508,1207.99 777.775,1251.43C817.511,1207.99 868.031,1174.57 925.081,1155.44ZM925.646,1155.25L925.108,1155.43L926.103,1155.1L925.646,1155.25ZM935.286,1152.2C932.214,1153.12 929.159,1154.09 926.13,1155.09C929.165,1154.09 932.219,1153.12 935.286,1152.2ZM935.716,1152.07L935.384,1152.17L936.292,1151.89L935.716,1152.07ZM936.843,1151.73L936.451,1151.85L937.327,1151.59L936.843,1151.73ZM937.972,1151.4L937.514,1151.53L938.377,1151.28L937.972,1151.4ZM939.102,1151.07L938.57,1151.22L939.438,1150.97L939.102,1151.07ZM940.233,1150.74L939.613,1150.92L940.505,1150.67L940.233,1150.74ZM946.659,1148.98C944.639,1149.51 942.626,1150.07 940.626,1150.63C942.631,1150.06 944.642,1149.51 946.659,1148.98ZM947.056,1148.87L946.829,1148.93L947.659,1148.71L947.056,1148.87ZM948.198,1148.57L947.919,1148.65L948.705,1148.44L948.198,1148.57ZM949.342,1148.28L949.008,1148.37L949.771,1148.17L949.342,1148.28ZM950.488,1147.99L950.096,1148.09L950.848,1147.9L950.488,1147.99ZM951.635,1147.7L951.182,1147.81L951.932,1147.63L951.635,1147.7ZM952.783,1147.42L952.262,1147.55L953.022,1147.36L952.783,1147.42ZM953.933,1147.14L953.327,1147.28L954.115,1147.09L953.933,1147.14ZM958.213,1146.13C956.927,1146.42 955.644,1146.73 954.354,1147.04C955.637,1146.73 956.923,1146.43 958.213,1146.13ZM958.547,1146.06L958.409,1146.09L959.174,1145.91L958.547,1146.06ZM959.704,1145.79L959.517,1145.84L960.229,1145.68L959.704,1145.79ZM960.863,1145.54L960.626,1145.59L961.311,1145.44L960.863,1145.54ZM962.023,1145.28L961.736,1145.35L962.406,1145.2L962.023,1145.28ZM963.184,1145.03L962.846,1145.11L963.508,1144.97L963.184,1145.03ZM964.347,1144.79L963.956,1144.87L964.615,1144.73L964.347,1144.79ZM965.511,1144.55L965.066,1144.64L965.725,1144.5L965.511,1144.55ZM966.677,1144.31L966.172,1144.41L966.838,1144.28L966.677,1144.31ZM967.844,1144.08L967.269,1144.19L967.953,1144.05L967.844,1144.08ZM970.183,1143.62C969.793,1143.69 969.403,1143.77 969.013,1143.85L969.055,1143.84C969.413,1143.77 969.771,1143.7 970.129,1143.63L970.183,1143.62ZM971.354,1143.4L971.245,1143.42L971.882,1143.3L971.354,1143.4ZM972.526,1143.18L972.37,1143.21L972.987,1143.09L972.526,1143.18ZM973.7,1142.96L973.496,1143L974.103,1142.89L973.7,1142.96ZM974.876,1142.75L974.624,1142.8L975.225,1142.69L974.876,1142.75ZM976.052,1142.55L975.754,1142.6L976.349,1142.49L976.052,1142.55ZM977.23,1142.34L976.885,1142.4L977.476,1142.3L977.23,1142.34ZM978.41,1142.14L978.019,1142.21L978.605,1142.11L978.41,1142.14ZM979.59,1141.95L979.156,1142.02L979.736,1141.92L979.59,1141.95ZM980.772,1141.76L980.299,1141.83L980.868,1141.74L980.772,1141.76ZM981.955,1141.57L981.464,1141.65L982.002,1141.56L981.955,1141.57ZM983.14,1141.39L983.1,1141.39L983.605,1141.32L983.14,1141.39ZM984.326,1141.21L984.239,1141.22L984.778,1141.14L984.326,1141.21ZM985.513,1141.03L985.379,1141.05L985.928,1140.97L985.513,1141.03ZM986.702,1140.86L986.521,1140.89L987.073,1140.81L986.702,1140.86ZM987.891,1140.69L987.665,1140.73L988.218,1140.65L987.891,1140.69ZM989.082,1140.53L988.811,1140.57L989.363,1140.49L989.082,1140.53ZM990.275,1140.37L989.96,1140.41L990.508,1140.34L990.275,1140.37ZM991.468,1140.22L991.113,1140.26L991.654,1140.19L991.468,1140.22ZM992.663,1140.07L992.273,1140.12L992.8,1140.05L992.663,1140.07ZM993.859,1139.92L993.447,1139.97L993.948,1139.91L993.859,1139.92ZM995.056,1139.78L994.671,1139.82L995.097,1139.77L995.056,1139.78ZM996.255,1139.64L996.23,1139.64L996.578,1139.6L996.255,1139.64ZM997.454,1139.5L997.383,1139.51L997.852,1139.46L997.454,1139.5ZM998.655,1139.37L998.537,1139.38L999.041,1139.33L998.655,1139.37ZM999.857,1139.24L999.693,1139.26L1000.21,1139.21L999.857,1139.24ZM1001.06,1139.12L1000.85,1139.14L1001.38,1139.09L1001.06,1139.12ZM1002.26,1139L1002.01,1139.03L1002.54,1138.98L1002.26,1139ZM1003.47,1138.89L1003.18,1138.91L1003.7,1138.87L1003.47,1138.89ZM1004.68,1138.78L1004.34,1138.81L1004.86,1138.76L1004.68,1138.78ZM1005.89,1138.67L1005.52,1138.7L1006.02,1138.66L1005.89,1138.67ZM1007.1,1138.57L1006.71,1138.6L1007.18,1138.56L1007.1,1138.57ZM1008.31,1138.47L1007.96,1138.5L1008.35,1138.46L1008.31,1138.47ZM1009.52,1138.37L1009.5,1138.38L1009.72,1138.36L1009.52,1138.37ZM1010.73,1138.28L1010.67,1138.29L1011.1,1138.26L1010.73,1138.28ZM1011.94,1138.2L1011.84,1138.2L1012.32,1138.17L1011.94,1138.2ZM1013.16,1138.12L1013,1138.13L1013.51,1138.09L1013.16,1138.12ZM1014.37,1138.04L1014.17,1138.05L1014.69,1138.02L1014.37,1138.04ZM1015.59,1137.96L1015.35,1137.98L1015.86,1137.95L1015.59,1137.96ZM1016.81,1137.89L1016.52,1137.91L1017.04,1137.88L1016.81,1137.89ZM1018.03,1137.83L1017.7,1137.85L1018.21,1137.82L1018.03,1137.83ZM1019.25,1137.77L1018.89,1137.79L1019.39,1137.76L1019.25,1137.77ZM1020.47,1137.71L1020.1,1137.73L1020.56,1137.71L1020.47,1137.71ZM1021.69,1137.66L1021.36,1137.67L1021.74,1137.66L1021.69,1137.66ZM1022.92,1137.61L1022.91,1137.61L1023.02,1137.61L1022.92,1137.61ZM1024.14,1137.57L1024.09,1137.57L1024.49,1137.55L1024.14,1137.57ZM1025.37,1137.52L1025.27,1137.53L1025.74,1137.51L1025.37,1137.52ZM1026.6,1137.49L1026.45,1137.49L1026.94,1137.48L1026.6,1137.49ZM1027.82,1137.46L1027.63,1137.46L1028.14,1137.45L1027.82,1137.46ZM1029.05,1137.43L1028.81,1137.43L1029.33,1137.42L1029.05,1137.43ZM1030.28,1137.41L1030,1137.41L1030.52,1137.4L1030.28,1137.41ZM1031.51,1137.39L1031.19,1137.39L1031.7,1137.38L1031.51,1137.39ZM1032.75,1137.37L1032.39,1137.38L1032.89,1137.37L1032.75,1137.37ZM1033.98,1137.36L1033.61,1137.36L1034.07,1137.36L1033.98,1137.36ZM1035.21,1137.35L1034.87,1137.36L1035.26,1137.35L1035.21,1137.35ZM1050.1,1035.06L867.977,544.575L689.455,1035.06L1050.1,1035.06Z"})})}),r_e=yt({displayName:"TrainingIcon",viewBox:"0 0 3544 3544",path:v.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M0,768.593L0,2774.71C0,2930.6 78.519,3068.3 198.135,3150.37C273.059,3202.68 364.177,3233.38 462.407,3233.38C462.407,3233.38 3080.9,3233.38 3080.9,3233.38C3179.13,3233.38 3270.25,3202.68 3345.17,3150.37C3464.79,3068.3 3543.31,2930.6 3543.31,2774.71L3543.31,768.593C3543.31,517.323 3339.31,313.324 3088.04,313.324L455.269,313.324C203.999,313.324 0,517.323 0,768.593ZM3427.88,775.73L3427.88,2770.97C3427.88,2962.47 3272.4,3117.95 3080.9,3117.95L462.407,3117.95C270.906,3117.95 115.431,2962.47 115.431,2770.97C115.431,2770.97 115.431,775.73 115.431,775.73C115.431,584.229 270.906,428.755 462.407,428.755C462.407,428.755 3080.9,428.755 3080.9,428.755C3272.4,428.755 3427.88,584.229 3427.88,775.73ZM796.24,1322.76L796.24,1250.45C796.24,1199.03 836.16,1157.27 885.331,1157.27C885.331,1157.27 946.847,1157.27 946.847,1157.27C996.017,1157.27 1035.94,1199.03 1035.94,1250.45L1035.94,1644.81L2507.37,1644.81L2507.37,1250.45C2507.37,1199.03 2547.29,1157.27 2596.46,1157.27C2596.46,1157.27 2657.98,1157.27 2657.98,1157.27C2707.15,1157.27 2747.07,1199.03 2747.07,1250.45L2747.07,1322.76C2756.66,1319.22 2767.02,1317.29 2777.83,1317.29C2777.83,1317.29 2839.34,1317.29 2839.34,1317.29C2888.51,1317.29 2928.43,1357.21 2928.43,1406.38L2928.43,1527.32C2933.51,1526.26 2938.77,1525.71 2944.16,1525.71L2995.3,1525.71C3036.18,1525.71 3069.37,1557.59 3069.37,1596.86C3069.37,1596.86 3069.37,1946.44 3069.37,1946.44C3069.37,1985.72 3036.18,2017.6 2995.3,2017.6C2995.3,2017.6 2944.16,2017.6 2944.16,2017.6C2938.77,2017.6 2933.51,2017.04 2928.43,2015.99L2928.43,2136.92C2928.43,2186.09 2888.51,2226.01 2839.34,2226.01L2777.83,2226.01C2767.02,2226.01 2756.66,2224.08 2747.07,2220.55L2747.07,2292.85C2747.07,2344.28 2707.15,2386.03 2657.98,2386.03C2657.98,2386.03 2596.46,2386.03 2596.46,2386.03C2547.29,2386.03 2507.37,2344.28 2507.37,2292.85L2507.37,1898.5L1035.94,1898.5L1035.94,2292.85C1035.94,2344.28 996.017,2386.03 946.847,2386.03C946.847,2386.03 885.331,2386.03 885.331,2386.03C836.16,2386.03 796.24,2344.28 796.24,2292.85L796.24,2220.55C786.651,2224.08 776.29,2226.01 765.482,2226.01L703.967,2226.01C654.796,2226.01 614.876,2186.09 614.876,2136.92L614.876,2015.99C609.801,2017.04 604.539,2017.6 599.144,2017.6C599.144,2017.6 548.003,2017.6 548.003,2017.6C507.125,2017.6 473.937,1985.72 473.937,1946.44C473.937,1946.44 473.937,1596.86 473.937,1596.86C473.937,1557.59 507.125,1525.71 548.003,1525.71L599.144,1525.71C604.539,1525.71 609.801,1526.26 614.876,1527.32L614.876,1406.38C614.876,1357.21 654.796,1317.29 703.967,1317.29C703.967,1317.29 765.482,1317.29 765.482,1317.29C776.29,1317.29 786.651,1319.22 796.24,1322.76ZM977.604,1250.45C977.604,1232.7 963.822,1218.29 946.847,1218.29L885.331,1218.29C868.355,1218.29 854.573,1232.7 854.573,1250.45L854.573,2292.85C854.573,2310.61 868.355,2325.02 885.331,2325.02L946.847,2325.02C963.822,2325.02 977.604,2310.61 977.604,2292.85L977.604,1250.45ZM2565.7,1250.45C2565.7,1232.7 2579.49,1218.29 2596.46,1218.29L2657.98,1218.29C2674.95,1218.29 2688.73,1232.7 2688.73,1250.45L2688.73,2292.85C2688.73,2310.61 2674.95,2325.02 2657.98,2325.02L2596.46,2325.02C2579.49,2325.02 2565.7,2310.61 2565.7,2292.85L2565.7,1250.45ZM673.209,1406.38L673.209,2136.92C673.209,2153.9 686.991,2167.68 703.967,2167.68L765.482,2167.68C782.458,2167.68 796.24,2153.9 796.24,2136.92L796.24,1406.38C796.24,1389.41 782.458,1375.63 765.482,1375.63L703.967,1375.63C686.991,1375.63 673.209,1389.41 673.209,1406.38ZM2870.1,1406.38L2870.1,2136.92C2870.1,2153.9 2856.32,2167.68 2839.34,2167.68L2777.83,2167.68C2760.85,2167.68 2747.07,2153.9 2747.07,2136.92L2747.07,1406.38C2747.07,1389.41 2760.85,1375.63 2777.83,1375.63L2839.34,1375.63C2856.32,1375.63 2870.1,1389.41 2870.1,1406.38ZM614.876,1577.5C610.535,1574.24 605.074,1572.3 599.144,1572.3L548.003,1572.3C533.89,1572.3 522.433,1583.3 522.433,1596.86L522.433,1946.44C522.433,1960 533.89,1971.01 548.003,1971.01L599.144,1971.01C605.074,1971.01 610.535,1969.07 614.876,1965.81L614.876,1577.5ZM2928.43,1965.81L2928.43,1577.5C2932.77,1574.24 2938.23,1572.3 2944.16,1572.3L2995.3,1572.3C3009.42,1572.3 3020.87,1583.3 3020.87,1596.86L3020.87,1946.44C3020.87,1960 3009.42,1971.01 2995.3,1971.01L2944.16,1971.01C2938.23,1971.01 2932.77,1969.07 2928.43,1965.81ZM2507.37,1703.14L1035.94,1703.14L1035.94,1840.16L2507.37,1840.16L2507.37,1898.38L2507.37,1659.46L2507.37,1703.14Z"})}),i_e=yt({displayName:"UnifiedCanvasIcon",viewBox:"0 0 3544 3544",path:v.jsx("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3543.31,770.787C3543.31,515.578 3336.11,308.38 3080.9,308.38L462.407,308.38C207.197,308.38 -0,515.578 -0,770.787L-0,2766.03C-0,3021.24 207.197,3228.44 462.407,3228.44L3080.9,3228.44C3336.11,3228.44 3543.31,3021.24 3543.31,2766.03C3543.31,2766.03 3543.31,770.787 3543.31,770.787ZM922.933,3113.01L462.407,3113.01C437.741,3113.01 413.674,3110.43 390.453,3105.52L390.453,2899.11L922.933,2899.11L922.933,3113.01ZM947.933,2899.11L947.933,3113.01L1480.41,3113.01L1480.41,2899.11L947.933,2899.11ZM1505.41,2899.11L1505.41,3113.01L2037.89,3113.01L2037.89,2899.11L1505.41,2899.11ZM2062.89,2899.11L2062.89,3113.01L2595.37,3113.01L2595.37,2899.11L2062.89,2899.11ZM3152.85,3105.52C3129.63,3110.43 3105.57,3113.01 3080.9,3113.01L2620.37,3113.01L2620.37,2899.11L3152.85,2899.11L3152.85,3105.52ZM365.453,3099.26L365.408,3099.24C354.521,3096.07 343.79,3092.37 333.266,3088.14C315.377,3080.95 298.094,3072.26 281.651,3062.2C263.114,3050.85 245.648,3037.77 229.544,3023.17C213.34,3008.49 198.518,2992.28 185.34,2974.83C174.102,2959.94 164.06,2944.16 155.353,2927.66C150.517,2918.5 146.102,2909.13 142.102,2899.57L141.91,2899.11L365.453,2899.11L365.453,3099.26ZM3401.4,2899.11C3361.33,2995.39 3279.12,3069.8 3177.85,3099.26L3177.85,2899.11L3401.4,2899.11ZM132.624,2874.11C121.465,2840.08 115.431,2803.76 115.431,2766.03L115.431,2341.63L365.453,2341.63L365.453,2874.11L132.624,2874.11ZM922.933,918.103L922.933,669.193L390.453,669.193L390.453,1201.67L731.014,1201.67L731.014,1226.67L390.453,1226.67L390.453,1759.15L731.014,1759.15L731.014,1784.15L390.453,1784.15L390.453,2316.63L731.014,2316.63L731.014,2341.63L390.453,2341.63L390.453,2874.11L922.933,2874.11L922.933,2625.2C931.122,2627.1 939.463,2628.6 947.933,2629.66L947.933,2874.11L1480.41,2874.11L1480.41,2631.62L1505.41,2631.62L1505.41,2874.11L2037.89,2874.11L2037.89,2631.62L2062.89,2631.62L2062.89,2874.11L2595.37,2874.11L2595.37,2629.66C2603.85,2628.6 2612.18,2627.1 2620.37,2625.2L2620.37,2874.11L3152.85,2874.11L3152.85,2341.63L2812.29,2341.63L2812.29,2316.63L3152.85,2316.63L3152.85,1784.15L2812.29,1784.15L2812.29,1759.15L3152.85,1759.15L3152.85,1226.67L2812.29,1226.67L2812.29,1201.67L3152.85,1201.67L3152.85,669.193L2620.37,669.193L2620.37,918.103C2612.18,916.203 2603.84,914.708 2595.37,913.642L2595.37,669.193L2062.89,669.193L2062.89,911.688L2037.89,911.688L2037.89,669.193L1505.41,669.193L1505.41,911.688L1480.41,911.688L1480.41,669.193L947.933,669.193L947.933,913.642C939.462,914.708 931.123,916.203 922.933,918.103ZM3427.88,2341.63L3427.88,2766.03C3427.88,2803.76 3421.84,2840.08 3410.68,2874.11L3177.85,2874.11L3177.85,2341.63L3427.88,2341.63ZM2494.01,2603.04L2524.53,2603.04C2541.26,2603.04 2557.62,2601.44 2573.47,2598.39L2598.02,2593.66L2588.56,2544.56L2564.01,2549.29C2551.23,2551.75 2538.03,2553.04 2524.53,2553.04L2494.01,2553.04L2494.01,2603.04ZM1294.01,2603.04L1394.01,2603.04L1394.01,2553.04L1294.01,2553.04L1294.01,2603.04ZM1894.01,2603.04L1994.01,2603.04L1994.01,2553.04L1894.01,2553.04L1894.01,2603.04ZM2194.01,2603.04L2294.01,2603.04L2294.01,2553.04L2194.01,2553.04L2194.01,2603.04ZM1144.01,2603.04L1244.01,2603.04L1244.01,2553.04L1144.01,2553.04L1144.01,2603.04ZM1444.01,2603.04L1544.01,2603.04L1544.01,2553.04L1444.01,2553.04L1444.01,2603.04ZM1594.01,2603.04L1694.01,2603.04L1694.01,2553.04L1594.01,2553.04L1594.01,2603.04ZM2344.01,2603.04L2444.01,2603.04L2444.01,2553.04L2344.01,2553.04L2344.01,2603.04ZM2044.01,2603.04L2144.01,2603.04L2144.01,2553.04L2044.01,2553.04L2044.01,2603.04ZM994.01,2603.04L1094.01,2603.04L1094.01,2553.04L994.01,2553.04L994.01,2603.04ZM1744.01,2603.04L1844.01,2603.04L1844.01,2553.04L1744.01,2553.04L1744.01,2603.04ZM864.145,2551.46C878.835,2562.5 894.741,2572 911.624,2579.74L934.352,2590.15L955.18,2544.7L932.452,2534.28C918.844,2528.05 906.024,2520.39 894.185,2511.49L874.199,2496.47L844.16,2536.44L864.145,2551.46ZM2674.44,2554.92C2689.46,2544.16 2703.28,2531.82 2715.65,2518.14L2732.42,2499.61L2695.35,2466.06L2678.58,2484.6C2668.59,2495.63 2657.44,2505.59 2645.32,2514.28L2625,2528.84L2654.12,2569.48L2674.44,2554.92ZM865.632,1911.31L1339.59,1374.15L2030.89,2134.59L2392.97,1713.77L2677.68,2017.9L2677.68,2324.93C2677.68,2424.23 2597.06,2504.85 2497.76,2504.85C2497.76,2504.85 1045.55,2504.85 1045.55,2504.85C946.251,2504.85 865.632,2424.23 865.632,2324.93L865.632,1911.31ZM771.251,2417.22C776.455,2435.14 783.552,2452.26 792.313,2468.35L804.27,2490.3L848.18,2466.39L836.223,2444.43C829.171,2431.49 823.457,2417.7 819.268,2403.28L812.297,2379.27L764.28,2393.21L771.251,2417.22ZM2770.36,2422.83C2775.83,2405.47 2779.52,2387.33 2781.2,2368.61L2783.43,2343.71L2733.64,2339.24L2731.4,2364.14C2730.05,2379.21 2727.08,2393.82 2722.67,2407.79L2715.15,2431.63L2762.84,2446.67L2770.36,2422.83ZM761.068,2236.12L761.068,2336.12L811.068,2336.12L811.068,2236.12L761.068,2236.12ZM3177.85,1784.15L3177.85,2316.63L3427.88,2316.63L3427.88,1784.15L3177.85,1784.15ZM115.431,1784.15L115.431,2316.63L365.453,2316.63L365.453,1784.15L115.431,1784.15ZM2782.24,2291.41L2782.24,2191.41L2732.24,2191.41L2732.24,2291.41L2782.24,2291.41ZM761.068,2086.12L761.068,2186.12L811.068,2186.12L811.068,2086.12L761.068,2086.12ZM2782.24,2141.41L2782.24,2041.4L2732.24,2041.4L2732.24,2141.41L2782.24,2141.41ZM761.068,1936.12L761.068,2036.12L811.068,2036.12L811.068,1936.12L761.068,1936.12ZM2782.24,1991.4L2782.24,1891.4L2732.24,1891.4L2732.24,1991.4L2782.24,1991.4ZM761.068,1786.12L761.068,1886.12L811.068,1886.12L811.068,1786.12L761.068,1786.12ZM2782.24,1841.4L2782.24,1741.41L2732.24,1741.41L2732.24,1841.4L2782.24,1841.4ZM3177.85,1226.67L3177.85,1759.15L3427.88,1759.15L3427.88,1226.67L3177.85,1226.67ZM115.431,1226.67L115.431,1759.15L365.453,1759.15L365.453,1226.67L115.431,1226.67ZM761.068,1636.12L761.068,1736.12L811.068,1736.12L811.068,1636.12L761.068,1636.12ZM2782.24,1691.41L2782.24,1591.41L2732.24,1591.41L2732.24,1691.41L2782.24,1691.41ZM761.068,1486.12L761.068,1586.12L811.068,1586.12L811.068,1486.12L761.068,1486.12ZM2203.72,1132.2C2318.18,1132.2 2411.11,1225.13 2411.11,1339.59C2411.11,1454.05 2318.18,1546.98 2203.72,1546.98C2089.26,1546.98 1996.33,1454.05 1996.33,1339.59C1996.33,1225.13 2089.26,1132.2 2203.72,1132.2ZM2782.24,1541.41L2782.24,1441.41L2732.24,1441.41L2732.24,1541.41L2782.24,1541.41ZM761.068,1336.12L761.068,1436.12L811.068,1436.12L811.068,1336.12L761.068,1336.12ZM2782.24,1391.41L2782.24,1291.41L2732.24,1291.41L2732.24,1391.41L2782.24,1391.41ZM761.068,1186.12L761.068,1286.12L811.068,1286.12L811.068,1186.12L761.068,1186.12ZM2732.24,1197.98L2732.24,1241.41L2782.24,1241.41L2782.24,1172.98L2781.03,1172.98C2780.06,1162.82 2778.49,1152.83 2776.36,1143.04L2771.04,1118.62L2722.18,1129.24L2727.5,1153.67C2730.61,1167.95 2732.24,1182.78 2732.24,1197.98ZM3412.74,669.193L3412.89,669.694C3414.66,675.5 3416.28,681.348 3417.73,687.238C3420.46,698.265 3422.65,709.427 3424.28,720.67C3425.85,731.554 3426.91,742.513 3427.45,753.497C3427.74,759.256 3427.87,765.021 3427.88,770.787L3427.88,1201.67L3177.85,1201.67L3177.85,669.193L3412.74,669.193ZM115.431,1201.67L115.431,770.787C115.436,765.021 115.572,759.256 115.855,753.497C116.395,742.513 117.453,731.554 119.031,720.67C120.66,709.427 122.844,698.265 125.574,687.238C127.032,681.348 128.65,675.5 130.414,669.694L130.567,669.193L365.453,669.193L365.453,1201.67L115.431,1201.67ZM804.386,1055C794.186,1070.26 785.572,1086.67 778.777,1103.99L769.647,1127.26L816.194,1145.52L825.324,1122.25C830.797,1108.3 837.738,1095.08 845.955,1082.79L859.848,1062L818.279,1034.21L804.386,1055ZM2730.5,1043.14C2719.39,1028.39 2706.73,1014.86 2692.77,1002.81L2673.84,986.48L2641.17,1024.34L2660.1,1040.67C2671.37,1050.39 2681.59,1061.31 2690.56,1073.22L2705.6,1093.19L2745.54,1063.11L2730.5,1043.14ZM933.266,954.821C915.698,961.006 898.998,969.041 883.402,978.694L862.144,991.851L888.457,1034.37L909.715,1021.21C922.275,1013.44 935.723,1006.96 949.871,1001.98L973.452,993.681L956.848,946.518L933.266,954.821ZM2596.18,950.378C2578.71,945.327 2560.49,942.072 2541.72,940.832L2516.78,939.183L2513.48,989.074L2538.43,990.723C2553.54,991.722 2568.22,994.341 2582.28,998.409L2606.3,1005.36L2620.19,957.325L2596.18,950.378ZM2165.09,940.265L2065.09,940.265L2065.09,990.265L2165.09,990.265L2165.09,940.265ZM1865.08,940.265L1765.08,940.265L1765.08,990.265L1865.08,990.265L1865.08,940.265ZM1115.08,940.265L1015.08,940.265L1015.08,990.265L1115.08,990.265L1115.08,940.265ZM2015.09,940.265L1915.09,940.265L1915.09,990.265L2015.09,990.265L2015.09,940.265ZM2315.09,940.265L2215.09,940.265L2215.09,990.265L2315.09,990.265L2315.09,940.265ZM1265.08,940.265L1165.08,940.265L1165.08,990.265L1265.08,990.265L1265.08,940.265ZM1415.08,940.265L1315.08,940.265L1315.08,990.265L1415.08,990.265L1415.08,940.265ZM1565.08,940.265L1465.08,940.265L1465.08,990.265L1565.08,990.265L1565.08,940.265ZM1715.08,940.265L1615.08,940.265L1615.08,990.265L1715.08,990.265L1715.08,940.265ZM2465.09,940.265L2365.09,940.265L2365.09,990.265L2465.09,990.265L2465.09,940.265ZM365.453,437.562L365.453,644.193L139.286,644.193C178.303,544.782 261.917,467.677 365.453,437.562ZM922.933,423.812L922.933,644.193L390.453,644.193L390.453,431.295C413.674,426.391 437.741,423.812 462.407,423.812L922.933,423.812ZM947.933,423.812L947.933,644.193L1480.41,644.193L1480.41,423.812L947.933,423.812ZM1505.41,423.812L1505.41,644.193L2037.89,644.193L2037.89,423.812L1505.41,423.812ZM2062.89,423.812L2062.89,644.193L2595.37,644.193L2595.37,423.812L2062.89,423.812ZM2620.37,423.812L3080.9,423.812C3105.57,423.812 3129.63,426.391 3152.85,431.295L3152.85,644.193L2620.37,644.193L2620.37,423.812ZM3177.85,437.562C3281.38,467.669 3365,544.774 3404.02,644.193L3177.85,644.193L3177.85,437.562Z"})}),Ze=Oe((e,t)=>{const{tooltip:n="",styleClass:r,tooltipProps:i,asCheckbox:o,isChecked:a,...s}=e;return v.jsx(lo,{label:n,hasArrow:!0,...i,...i!=null&&i.placement?{placement:i.placement}:{placement:"top"},children:v.jsx(ss,{ref:t,className:r?`invokeai__icon-button ${r}`:"invokeai__icon-button","data-as-checkbox":o,"data-selected":a!==void 0?a:void 0,...s})})}),cr=Oe((e,t)=>{const{children:n,tooltip:r="",tooltipProps:i,styleClass:o,...a}=e;return v.jsx(lo,{label:r,...i,children:v.jsx(as,{ref:t,className:["invokeai__button",o].join(" "),...a,children:n})})}),Zs=e=>{const{triggerComponent:t,children:n,styleClass:r,hasArrow:i=!0,...o}=e;return v.jsxs(ME,{...o,children:[v.jsx(DE,{children:t}),v.jsxs(RE,{className:`invokeai__popover-content ${r}`,children:[i&&v.jsx(IE,{className:"invokeai__popover-arrow"}),n]})]})},Wx=ot(e=>e.lightbox,e=>e,{memoizeOptions:{equalityCheck:Ee.isEqual}}),hD=/^-?(0\.)?\.?$/,To=e=>{const{label:t,labelFontSize:n="sm",styleClass:r,isDisabled:i=!1,showStepper:o=!0,width:a,textAlign:s,isInvalid:l,value:u,onChange:d,min:h,max:m,isInteger:y=!0,formControlProps:b,formLabelProps:S,numberInputFieldProps:E,numberInputStepperProps:k,tooltipProps:_,...T}=e,[A,I]=w.useState(String(u));w.useEffect(()=>{!A.match(hD)&&u!==Number(A)&&I(String(u))},[u,A]);const R=j=>{I(j),j.match(hD)||d(y?Math.floor(Number(j)):Number(j))},D=j=>{const z=Ee.clamp(y?Math.floor(Number(j.target.value)):Number(j.target.value),h,m);I(String(z)),d(z)};return v.jsx(lo,{..._,children:v.jsxs(dn,{isDisabled:i,isInvalid:l,className:r?`invokeai__number-input-form-control ${r}`:"invokeai__number-input-form-control",...b,children:[t&&v.jsx(kn,{className:"invokeai__number-input-form-label",style:{display:t?"block":"none"},fontSize:n,fontWeight:"bold",marginRight:0,marginBottom:0,whiteSpace:"nowrap",...S,children:t}),v.jsxs(TE,{className:"invokeai__number-input-root",value:A,min:h,max:m,keepWithinRange:!0,clampValueOnBlur:!1,onChange:R,onBlur:D,width:a,...T,children:[v.jsx(LE,{className:"invokeai__number-input-field",textAlign:s,...E}),o&&v.jsxs("div",{className:"invokeai__number-input-stepper",children:[v.jsx(OE,{...k,className:"invokeai__number-input-stepper-button"}),v.jsx(AE,{...k,className:"invokeai__number-input-stepper-button"})]})]})]})})},tl=e=>{const{label:t,isDisabled:n,validValues:r,tooltip:i,tooltipProps:o,size:a="sm",fontSize:s="sm",styleClass:l,...u}=e;return v.jsxs(dn,{isDisabled:n,className:`invokeai__select ${l}`,onClick:d=>{d.stopPropagation(),d.nativeEvent.stopImmediatePropagation(),d.nativeEvent.stopPropagation(),d.nativeEvent.cancelBubble=!0},children:[t&&v.jsx(kn,{className:"invokeai__select-label",fontSize:s,fontWeight:"bold",marginRight:0,marginBottom:0,whiteSpace:"nowrap",children:t}),v.jsx(lo,{label:i,...o,children:v.jsx($V,{className:"invokeai__select-picker",fontSize:s,size:a,...u,children:r.map(d=>typeof d=="string"||typeof d=="number"?v.jsx("option",{value:d,className:"invokeai__select-option",children:d},d):v.jsx("option",{value:d.value,className:"invokeai__select-option",children:d.key},d.value))})})]})},$y=e=>e.postprocessing,ir=e=>e.system,o_e=e=>e.system.toastQueue,GG=ot(ir,e=>{const{model_list:t}=e,n=Ee.reduce(t,(r,i,o)=>(i.status==="active"&&(r=o),r),"");return{...t[n],name:n}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),a_e=ot([$y,ir],({facetoolStrength:e,facetoolType:t,codeformerFidelity:n},{isGFPGANAvailable:r})=>({facetoolStrength:e,facetoolType:t,codeformerFidelity:n,isGFPGANAvailable:r}),{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),wP=()=>{const e=Ie(),{facetoolStrength:t,facetoolType:n,codeformerFidelity:r,isGFPGANAvailable:i}=he(a_e),o=u=>e(I4(u)),a=u=>e(xU(u)),s=u=>e(R4(u.target.value)),{t:l}=Ve();return v.jsxs(qe,{direction:"column",gap:2,children:[v.jsx(tl,{label:l("parameters:type"),validValues:o7e.concat(),value:n,onChange:s}),v.jsx(To,{isDisabled:!i,label:l("parameters:strength"),step:.05,min:0,max:1,onChange:o,value:t,width:"90px",isInteger:!1}),n==="codeformer"&&v.jsx(To,{isDisabled:!i,label:l("parameters:codeformerFidelity"),step:.05,min:0,max:1,onChange:a,value:r,width:"90px",isInteger:!1})]})},s_e=ot([$y,ir],({upscalingLevel:e,upscalingStrength:t},{isESRGANAvailable:n})=>({upscalingLevel:e,upscalingStrength:t,isESRGANAvailable:n}),{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),CP=()=>{const e=Ie(),{upscalingLevel:t,upscalingStrength:n,isESRGANAvailable:r}=he(s_e),{t:i}=Ve(),o=s=>e(c8(Number(s.target.value))),a=s=>e(d8(s));return v.jsxs("div",{className:"upscale-settings",children:[v.jsx(tl,{isDisabled:!r,label:i("parameters:scale"),value:t,onChange:o,validValues:i7e}),v.jsx(To,{isDisabled:!r,label:i("parameters:strength"),step:.05,min:0,max:1,onChange:a,value:n,isInteger:!1})]})};var l_e=Object.create,qG=Object.defineProperty,u_e=Object.getOwnPropertyDescriptor,c_e=Object.getOwnPropertyNames,d_e=Object.getPrototypeOf,f_e=Object.prototype.hasOwnProperty,We=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),h_e=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of c_e(t))!f_e.call(e,i)&&i!==n&&qG(e,i,{get:()=>t[i],enumerable:!(r=u_e(t,i))||r.enumerable});return e},YG=(e,t,n)=>(n=e!=null?l_e(d_e(e)):{},h_e(t||!e||!e.__esModule?qG(n,"default",{value:e,enumerable:!0}):n,e)),p_e=We((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n}),KG=We((e,t)=>{function n(r,i){return r===i||r!==r&&i!==i}t.exports=n}),Ux=We((e,t)=>{var n=KG();function r(i,o){for(var a=i.length;a--;)if(n(i[a][0],o))return a;return-1}t.exports=r}),g_e=We((e,t)=>{var n=Ux(),r=Array.prototype,i=r.splice;function o(a){var s=this.__data__,l=n(s,a);if(l<0)return!1;var u=s.length-1;return l==u?s.pop():i.call(s,l,1),--this.size,!0}t.exports=o}),m_e=We((e,t)=>{var n=Ux();function r(i){var o=this.__data__,a=n(o,i);return a<0?void 0:o[a][1]}t.exports=r}),v_e=We((e,t)=>{var n=Ux();function r(i){return n(this.__data__,i)>-1}t.exports=r}),y_e=We((e,t)=>{var n=Ux();function r(i,o){var a=this.__data__,s=n(a,i);return s<0?(++this.size,a.push([i,o])):a[s][1]=o,this}t.exports=r}),Gx=We((e,t)=>{var n=p_e(),r=g_e(),i=m_e(),o=v_e(),a=y_e();function s(l){var u=-1,d=l==null?0:l.length;for(this.clear();++u{var n=Gx();function r(){this.__data__=new n,this.size=0}t.exports=r}),S_e=We((e,t)=>{function n(r){var i=this.__data__,o=i.delete(r);return this.size=i.size,o}t.exports=n}),x_e=We((e,t)=>{function n(r){return this.__data__.get(r)}t.exports=n}),w_e=We((e,t)=>{function n(r){return this.__data__.has(r)}t.exports=n}),XG=We((e,t)=>{var n=typeof global=="object"&&global&&global.Object===Object&&global;t.exports=n}),pc=We((e,t)=>{var n=XG(),r=typeof self=="object"&&self&&self.Object===Object&&self,i=n||r||Function("return this")();t.exports=i}),_P=We((e,t)=>{var n=pc(),r=n.Symbol;t.exports=r}),C_e=We((e,t)=>{var n=_P(),r=Object.prototype,i=r.hasOwnProperty,o=r.toString,a=n?n.toStringTag:void 0;function s(l){var u=i.call(l,a),d=l[a];try{l[a]=void 0;var h=!0}catch{}var m=o.call(l);return h&&(u?l[a]=d:delete l[a]),m}t.exports=s}),__e=We((e,t)=>{var n=Object.prototype,r=n.toString;function i(o){return r.call(o)}t.exports=i}),qx=We((e,t)=>{var n=_P(),r=C_e(),i=__e(),o="[object Null]",a="[object Undefined]",s=n?n.toStringTag:void 0;function l(u){return u==null?u===void 0?a:o:s&&s in Object(u)?r(u):i(u)}t.exports=l}),ZG=We((e,t)=>{function n(r){var i=typeof r;return r!=null&&(i=="object"||i=="function")}t.exports=n}),QG=We((e,t)=>{var n=qx(),r=ZG(),i="[object AsyncFunction]",o="[object Function]",a="[object GeneratorFunction]",s="[object Proxy]";function l(u){if(!r(u))return!1;var d=n(u);return d==o||d==a||d==i||d==s}t.exports=l}),k_e=We((e,t)=>{var n=pc(),r=n["__core-js_shared__"];t.exports=r}),E_e=We((e,t)=>{var n=k_e(),r=function(){var o=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}();function i(o){return!!r&&r in o}t.exports=i}),JG=We((e,t)=>{var n=Function.prototype,r=n.toString;function i(o){if(o!=null){try{return r.call(o)}catch{}try{return o+""}catch{}}return""}t.exports=i}),P_e=We((e,t)=>{var n=QG(),r=E_e(),i=ZG(),o=JG(),a=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,l=Function.prototype,u=Object.prototype,d=l.toString,h=u.hasOwnProperty,m=RegExp("^"+d.call(h).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function y(b){if(!i(b)||r(b))return!1;var S=n(b)?m:s;return S.test(o(b))}t.exports=y}),T_e=We((e,t)=>{function n(r,i){return r==null?void 0:r[i]}t.exports=n}),L0=We((e,t)=>{var n=P_e(),r=T_e();function i(o,a){var s=r(o,a);return n(s)?s:void 0}t.exports=i}),kP=We((e,t)=>{var n=L0(),r=pc(),i=n(r,"Map");t.exports=i}),Yx=We((e,t)=>{var n=L0(),r=n(Object,"create");t.exports=r}),L_e=We((e,t)=>{var n=Yx();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r}),A_e=We((e,t)=>{function n(r){var i=this.has(r)&&delete this.__data__[r];return this.size-=i?1:0,i}t.exports=n}),O_e=We((e,t)=>{var n=Yx(),r="__lodash_hash_undefined__",i=Object.prototype,o=i.hasOwnProperty;function a(s){var l=this.__data__;if(n){var u=l[s];return u===r?void 0:u}return o.call(l,s)?l[s]:void 0}t.exports=a}),M_e=We((e,t)=>{var n=Yx(),r=Object.prototype,i=r.hasOwnProperty;function o(a){var s=this.__data__;return n?s[a]!==void 0:i.call(s,a)}t.exports=o}),I_e=We((e,t)=>{var n=Yx(),r="__lodash_hash_undefined__";function i(o,a){var s=this.__data__;return this.size+=this.has(o)?0:1,s[o]=n&&a===void 0?r:a,this}t.exports=i}),R_e=We((e,t)=>{var n=L_e(),r=A_e(),i=O_e(),o=M_e(),a=I_e();function s(l){var u=-1,d=l==null?0:l.length;for(this.clear();++u{var n=R_e(),r=Gx(),i=kP();function o(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=o}),N_e=We((e,t)=>{function n(r){var i=typeof r;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?r!=="__proto__":r===null}t.exports=n}),Kx=We((e,t)=>{var n=N_e();function r(i,o){var a=i.__data__;return n(o)?a[typeof o=="string"?"string":"hash"]:a.map}t.exports=r}),j_e=We((e,t)=>{var n=Kx();function r(i){var o=n(this,i).delete(i);return this.size-=o?1:0,o}t.exports=r}),B_e=We((e,t)=>{var n=Kx();function r(i){return n(this,i).get(i)}t.exports=r}),F_e=We((e,t)=>{var n=Kx();function r(i){return n(this,i).has(i)}t.exports=r}),$_e=We((e,t)=>{var n=Kx();function r(i,o){var a=n(this,i),s=a.size;return a.set(i,o),this.size+=a.size==s?0:1,this}t.exports=r}),eq=We((e,t)=>{var n=D_e(),r=j_e(),i=B_e(),o=F_e(),a=$_e();function s(l){var u=-1,d=l==null?0:l.length;for(this.clear();++u{var n=Gx(),r=kP(),i=eq(),o=200;function a(s,l){var u=this.__data__;if(u instanceof n){var d=u.__data__;if(!r||d.length{var n=Gx(),r=b_e(),i=S_e(),o=x_e(),a=w_e(),s=z_e();function l(u){var d=this.__data__=new n(u);this.size=d.size}l.prototype.clear=r,l.prototype.delete=i,l.prototype.get=o,l.prototype.has=a,l.prototype.set=s,t.exports=l}),V_e=We((e,t)=>{var n="__lodash_hash_undefined__";function r(i){return this.__data__.set(i,n),this}t.exports=r}),W_e=We((e,t)=>{function n(r){return this.__data__.has(r)}t.exports=n}),U_e=We((e,t)=>{var n=eq(),r=V_e(),i=W_e();function o(a){var s=-1,l=a==null?0:a.length;for(this.__data__=new n;++s{function n(r,i){for(var o=-1,a=r==null?0:r.length;++o{function n(r,i){return r.has(i)}t.exports=n}),tq=We((e,t)=>{var n=U_e(),r=G_e(),i=q_e(),o=1,a=2;function s(l,u,d,h,m,y){var b=d&o,S=l.length,E=u.length;if(S!=E&&!(b&&E>S))return!1;var k=y.get(l),_=y.get(u);if(k&&_)return k==u&&_==l;var T=-1,A=!0,I=d&a?new n:void 0;for(y.set(l,u),y.set(u,l);++T{var n=pc(),r=n.Uint8Array;t.exports=r}),K_e=We((e,t)=>{function n(r){var i=-1,o=Array(r.size);return r.forEach(function(a,s){o[++i]=[s,a]}),o}t.exports=n}),X_e=We((e,t)=>{function n(r){var i=-1,o=Array(r.size);return r.forEach(function(a){o[++i]=a}),o}t.exports=n}),Z_e=We((e,t)=>{var n=_P(),r=Y_e(),i=KG(),o=tq(),a=K_e(),s=X_e(),l=1,u=2,d="[object Boolean]",h="[object Date]",m="[object Error]",y="[object Map]",b="[object Number]",S="[object RegExp]",E="[object Set]",k="[object String]",_="[object Symbol]",T="[object ArrayBuffer]",A="[object DataView]",I=n?n.prototype:void 0,R=I?I.valueOf:void 0;function D(j,z,V,K,te,q,F){switch(V){case A:if(j.byteLength!=z.byteLength||j.byteOffset!=z.byteOffset)return!1;j=j.buffer,z=z.buffer;case T:return!(j.byteLength!=z.byteLength||!q(new r(j),new r(z)));case d:case h:case b:return i(+j,+z);case m:return j.name==z.name&&j.message==z.message;case S:case k:return j==z+"";case y:var U=a;case E:var X=K&l;if(U||(U=s),j.size!=z.size&&!X)return!1;var Z=F.get(j);if(Z)return Z==z;K|=u,F.set(j,z);var W=o(U(j),U(z),K,te,q,F);return F.delete(j),W;case _:if(R)return R.call(j)==R.call(z)}return!1}t.exports=D}),Q_e=We((e,t)=>{function n(r,i){for(var o=-1,a=i.length,s=r.length;++o{var n=Array.isArray;t.exports=n}),J_e=We((e,t)=>{var n=Q_e(),r=EP();function i(o,a,s){var l=a(o);return r(o)?l:n(l,s(o))}t.exports=i}),eke=We((e,t)=>{function n(r,i){for(var o=-1,a=r==null?0:r.length,s=0,l=[];++o{function n(){return[]}t.exports=n}),nke=We((e,t)=>{var n=eke(),r=tke(),i=Object.prototype,o=i.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(l){return l==null?[]:(l=Object(l),n(a(l),function(u){return o.call(l,u)}))}:r;t.exports=s}),rke=We((e,t)=>{function n(r,i){for(var o=-1,a=Array(r);++o{function n(r){return r!=null&&typeof r=="object"}t.exports=n}),ike=We((e,t)=>{var n=qx(),r=Xx(),i="[object Arguments]";function o(a){return r(a)&&n(a)==i}t.exports=o}),oke=We((e,t)=>{var n=ike(),r=Xx(),i=Object.prototype,o=i.hasOwnProperty,a=i.propertyIsEnumerable,s=n(function(){return arguments}())?n:function(l){return r(l)&&o.call(l,"callee")&&!a.call(l,"callee")};t.exports=s}),ake=We((e,t)=>{function n(){return!1}t.exports=n}),nq=We((e,t)=>{var n=pc(),r=ake(),i=typeof e=="object"&&e&&!e.nodeType&&e,o=i&&typeof t=="object"&&t&&!t.nodeType&&t,a=o&&o.exports===i,s=a?n.Buffer:void 0,l=s?s.isBuffer:void 0,u=l||r;t.exports=u}),ske=We((e,t)=>{var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;function i(o,a){var s=typeof o;return a=a??n,!!a&&(s=="number"||s!="symbol"&&r.test(o))&&o>-1&&o%1==0&&o{var n=9007199254740991;function r(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=n}t.exports=r}),lke=We((e,t)=>{var n=qx(),r=rq(),i=Xx(),o="[object Arguments]",a="[object Array]",s="[object Boolean]",l="[object Date]",u="[object Error]",d="[object Function]",h="[object Map]",m="[object Number]",y="[object Object]",b="[object RegExp]",S="[object Set]",E="[object String]",k="[object WeakMap]",_="[object ArrayBuffer]",T="[object DataView]",A="[object Float32Array]",I="[object Float64Array]",R="[object Int8Array]",D="[object Int16Array]",j="[object Int32Array]",z="[object Uint8Array]",V="[object Uint8ClampedArray]",K="[object Uint16Array]",te="[object Uint32Array]",q={};q[A]=q[I]=q[R]=q[D]=q[j]=q[z]=q[V]=q[K]=q[te]=!0,q[o]=q[a]=q[_]=q[s]=q[T]=q[l]=q[u]=q[d]=q[h]=q[m]=q[y]=q[b]=q[S]=q[E]=q[k]=!1;function F(U){return i(U)&&r(U.length)&&!!q[n(U)]}t.exports=F}),uke=We((e,t)=>{function n(r){return function(i){return r(i)}}t.exports=n}),cke=We((e,t)=>{var n=XG(),r=typeof e=="object"&&e&&!e.nodeType&&e,i=r&&typeof t=="object"&&t&&!t.nodeType&&t,o=i&&i.exports===r,a=o&&n.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||a&&a.binding&&a.binding("util")}catch{}}();t.exports=s}),iq=We((e,t)=>{var n=lke(),r=uke(),i=cke(),o=i&&i.isTypedArray,a=o?r(o):n;t.exports=a}),dke=We((e,t)=>{var n=rke(),r=oke(),i=EP(),o=nq(),a=ske(),s=iq(),l=Object.prototype,u=l.hasOwnProperty;function d(h,m){var y=i(h),b=!y&&r(h),S=!y&&!b&&o(h),E=!y&&!b&&!S&&s(h),k=y||b||S||E,_=k?n(h.length,String):[],T=_.length;for(var A in h)(m||u.call(h,A))&&!(k&&(A=="length"||S&&(A=="offset"||A=="parent")||E&&(A=="buffer"||A=="byteLength"||A=="byteOffset")||a(A,T)))&&_.push(A);return _}t.exports=d}),fke=We((e,t)=>{var n=Object.prototype;function r(i){var o=i&&i.constructor,a=typeof o=="function"&&o.prototype||n;return i===a}t.exports=r}),hke=We((e,t)=>{function n(r,i){return function(o){return r(i(o))}}t.exports=n}),pke=We((e,t)=>{var n=hke(),r=n(Object.keys,Object);t.exports=r}),gke=We((e,t)=>{var n=fke(),r=pke(),i=Object.prototype,o=i.hasOwnProperty;function a(s){if(!n(s))return r(s);var l=[];for(var u in Object(s))o.call(s,u)&&u!="constructor"&&l.push(u);return l}t.exports=a}),mke=We((e,t)=>{var n=QG(),r=rq();function i(o){return o!=null&&r(o.length)&&!n(o)}t.exports=i}),vke=We((e,t)=>{var n=dke(),r=gke(),i=mke();function o(a){return i(a)?n(a):r(a)}t.exports=o}),yke=We((e,t)=>{var n=J_e(),r=nke(),i=vke();function o(a){return n(a,i,r)}t.exports=o}),bke=We((e,t)=>{var n=yke(),r=1,i=Object.prototype,o=i.hasOwnProperty;function a(s,l,u,d,h,m){var y=u&r,b=n(s),S=b.length,E=n(l),k=E.length;if(S!=k&&!y)return!1;for(var _=S;_--;){var T=b[_];if(!(y?T in l:o.call(l,T)))return!1}var A=m.get(s),I=m.get(l);if(A&&I)return A==l&&I==s;var R=!0;m.set(s,l),m.set(l,s);for(var D=y;++_{var n=L0(),r=pc(),i=n(r,"DataView");t.exports=i}),xke=We((e,t)=>{var n=L0(),r=pc(),i=n(r,"Promise");t.exports=i}),wke=We((e,t)=>{var n=L0(),r=pc(),i=n(r,"Set");t.exports=i}),Cke=We((e,t)=>{var n=L0(),r=pc(),i=n(r,"WeakMap");t.exports=i}),_ke=We((e,t)=>{var n=Ske(),r=kP(),i=xke(),o=wke(),a=Cke(),s=qx(),l=JG(),u="[object Map]",d="[object Object]",h="[object Promise]",m="[object Set]",y="[object WeakMap]",b="[object DataView]",S=l(n),E=l(r),k=l(i),_=l(o),T=l(a),A=s;(n&&A(new n(new ArrayBuffer(1)))!=b||r&&A(new r)!=u||i&&A(i.resolve())!=h||o&&A(new o)!=m||a&&A(new a)!=y)&&(A=function(I){var R=s(I),D=R==d?I.constructor:void 0,j=D?l(D):"";if(j)switch(j){case S:return b;case E:return u;case k:return h;case _:return m;case T:return y}return R}),t.exports=A}),kke=We((e,t)=>{var n=H_e(),r=tq(),i=Z_e(),o=bke(),a=_ke(),s=EP(),l=nq(),u=iq(),d=1,h="[object Arguments]",m="[object Array]",y="[object Object]",b=Object.prototype,S=b.hasOwnProperty;function E(k,_,T,A,I,R){var D=s(k),j=s(_),z=D?m:a(k),V=j?m:a(_);z=z==h?y:z,V=V==h?y:V;var K=z==y,te=V==y,q=z==V;if(q&&l(k)){if(!l(_))return!1;D=!0,K=!1}if(q&&!K)return R||(R=new n),D||u(k)?r(k,_,T,A,I,R):i(k,_,z,T,A,I,R);if(!(T&d)){var F=K&&S.call(k,"__wrapped__"),U=te&&S.call(_,"__wrapped__");if(F||U){var X=F?k.value():k,Z=U?_.value():_;return R||(R=new n),I(X,Z,T,A,R)}}return q?(R||(R=new n),o(k,_,T,A,I,R)):!1}t.exports=E}),Eke=We((e,t)=>{var n=kke(),r=Xx();function i(o,a,s,l,u){return o===a?!0:o==null||a==null||!r(o)&&!r(a)?o!==o&&a!==a:n(o,a,s,l,i,u)}t.exports=i}),oq=We((e,t)=>{var n=Eke();function r(i,o){return n(i,o)}t.exports=r}),Pke=["ctrl","shift","alt","meta","mod"],Tke={esc:"escape",return:"enter",left:"arrowleft",up:"arrowup",right:"arrowright",down:"arrowdown"};function RC(e,t=","){return typeof e=="string"?e.split(t):e}function u2(e,t="+"){let n=e.toLocaleLowerCase().split(t).map(o=>o.trim()).map(o=>Tke[o]||o),r={alt:n.includes("alt"),ctrl:n.includes("ctrl"),shift:n.includes("shift"),meta:n.includes("meta"),mod:n.includes("mod")},i=n.filter(o=>!Pke.includes(o));return{...r,keys:i}}function Lke(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function Ake(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function Oke(e){return aq(e,["input","textarea","select"])}function aq({target:e},t=!1){let n=e&&e.tagName;return t instanceof Array?Boolean(n&&t&&t.some(r=>r.toLowerCase()===n.toLowerCase())):Boolean(n&&t&&t===!0)}function Mke(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 '),!0):t?e.some(n=>t.includes(n))||e.includes("*"):!0}var Ike=(e,t,n)=>{let{alt:r,ctrl:i,meta:o,mod:a,shift:s,keys:l}=t,{altKey:u,ctrlKey:d,metaKey:h,shiftKey:m,key:y,code:b}=e,S=b.toLowerCase().replace("key",""),E=y.toLowerCase();if(u!==r&&E!=="alt"||m!==s&&E!=="shift")return!1;if(a){if(!h&&!d)return!1}else if(h!==o&&S!=="meta"||d!==i&&S!=="ctrl")return!1;return l&&l.length===1&&(l.includes(E)||l.includes(S))?!0:l?l.every(k=>n.has(k)):!l},Rke=w.createContext(void 0),Dke=()=>w.useContext(Rke),Nke=w.createContext({hotkeys:[],enabledScopes:[],toggleScope:()=>{},enableScope:()=>{},disableScope:()=>{}}),jke=()=>w.useContext(Nke),Bke=YG(oq());function Fke(e){let t=w.useRef(void 0);return(0,Bke.default)(t.current,e)||(t.current=e),t.current}var pD=e=>{e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()};function Qe(e,t,n,r){let i=w.useRef(null),{current:o}=w.useRef(new Set),a=n instanceof Array?r instanceof Array?void 0:r:n,s=n instanceof Array?n:r instanceof Array?r:[],l=w.useCallback(t,[...s]),u=Fke(a),{enabledScopes:d}=jke(),h=Dke();return w.useLayoutEffect(()=>{if((u==null?void 0:u.enabled)===!1||!Mke(d,u==null?void 0:u.scopes))return;let m=S=>{var E;if(!(Oke(S)&&!aq(S,u==null?void 0:u.enableOnFormTags))){if(i.current!==null&&document.activeElement!==i.current&&!i.current.contains(document.activeElement)){pD(S);return}(E=S.target)!=null&&E.isContentEditable&&!(u!=null&&u.enableOnContentEditable)||RC(e,u==null?void 0:u.splitKey).forEach(k=>{var T;let _=u2(k,u==null?void 0:u.combinationKey);if(Ike(S,_,o)||(T=_.keys)!=null&&T.includes("*")){if(Lke(S,_,u==null?void 0:u.preventDefault),!Ake(S,_,u==null?void 0:u.enabled)){pD(S);return}l(S,_)}})}},y=S=>{o.add(S.key.toLowerCase()),((u==null?void 0:u.keydown)===void 0&&(u==null?void 0:u.keyup)!==!0||u!=null&&u.keydown)&&m(S)},b=S=>{S.key.toLowerCase()!=="meta"?o.delete(S.key.toLowerCase()):o.clear(),u!=null&&u.keyup&&m(S)};return(i.current||document).addEventListener("keyup",b),(i.current||document).addEventListener("keydown",y),h&&RC(e,u==null?void 0:u.splitKey).forEach(S=>h.addHotkey(u2(S,u==null?void 0:u.combinationKey))),()=>{(i.current||document).removeEventListener("keyup",b),(i.current||document).removeEventListener("keydown",y),h&&RC(e,u==null?void 0:u.splitKey).forEach(S=>h.removeHotkey(u2(S,u==null?void 0:u.combinationKey)))}},[e,l,u,d]),i}YG(oq());var D8=new Set;function $ke(e){(Array.isArray(e)?e:[e]).forEach(t=>D8.add(u2(t)))}function zke(e){(Array.isArray(e)?e:[e]).forEach(t=>{var r;let n=u2(t);for(let i of D8)(r=i.keys)!=null&&r.every(o=>{var a;return(a=n.keys)==null?void 0:a.includes(o)})&&D8.delete(i)})}window.addEventListener("DOMContentLoaded",()=>{document.addEventListener("keydown",e=>{$ke(e.key)}),document.addEventListener("keyup",e=>{zke(e.key)})});var sq={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},gD=N.createContext&&N.createContext(sq),$d=globalThis&&globalThis.__assign||function(){return $d=Object.assign||function(e){for(var t,n=1,r=arguments.length;ne.canvas,Mr=ot([ln,Or,ir],(e,t,n)=>e.layerState.stagingArea.images.length>0||t==="unifiedCanvas"&&n.isProcessing),bq=e=>e.canvas.layerState.objects.find(U5),yp=e=>e.gallery,yEe=ot([yp,Wx,Mr,Or],(e,t,n,r)=>{const{categories:i,currentCategory:o,currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:u,galleryImageMinimumWidth:d,galleryImageObjectFit:h,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:y,galleryWidth:b,shouldUseSingleGalleryColumn:S}=e,{isLightboxOpen:E}=t;return{currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:u,galleryImageMinimumWidth:d,galleryImageObjectFit:h,galleryGridTemplateColumns:S?"auto":`repeat(auto-fill, minmax(${d}px, auto))`,activeTabName:r,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:y,images:i[o].images,areMoreImagesAvailable:i[o].areMoreImagesAvailable,currentCategory:o,galleryWidth:b,isLightboxOpen:E,isStaging:n,shouldEnableResize:!(E||r==="unifiedCanvas"&&s),shouldUseSingleGalleryColumn:S}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),bEe=ot([yp,ir,Wx,Or],(e,t,n,r)=>({mayDeleteImage:t.isConnected&&!t.isProcessing,galleryImageObjectFit:e.galleryImageObjectFit,galleryImageMinimumWidth:e.galleryImageMinimumWidth,shouldUseSingleGalleryColumn:e.shouldUseSingleGalleryColumn,activeTabName:r,isLightboxOpen:n.isLightboxOpen}),{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),SEe=ot(ir,e=>{const{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}=e;return{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),tS=w.forwardRef(({image:e,children:t},n)=>{const{isOpen:r,onOpen:i,onClose:o}=Wh(),a=Ie(),{shouldConfirmOnDelete:s,isConnected:l,isProcessing:u}=he(SEe),d=w.useRef(null),h=b=>{b.stopPropagation(),s?i():m()},m=()=>{l&&!u&&e&&a(D8e(e)),o()};Qe("delete",()=>{s?i():m()},[e,s]);const y=b=>a(jU(!b.target.checked));return v.jsxs(v.Fragment,{children:[w.cloneElement(t,{onClick:e?h:void 0,ref:n}),v.jsx(AV,{isOpen:r,leastDestructiveRef:d,onClose:o,children:v.jsx(Kd,{children:v.jsxs(OV,{className:"modal",children:[v.jsx(w0,{fontSize:"lg",fontWeight:"bold",children:"Delete image"}),v.jsx(n0,{children:v.jsxs(qe,{direction:"column",gap:5,children:[v.jsx(fn,{children:"Are you sure? Deleted images will be sent to the Bin. You can restore from there if you wish to."}),v.jsx(dn,{children:v.jsxs(qe,{alignItems:"center",children:[v.jsx(kn,{mb:0,children:"Don't ask me again"}),v.jsx(BE,{checked:!s,onChange:y})]})})]})}),v.jsxs(bx,{children:[v.jsx(as,{ref:d,onClick:o,className:"modal-close-btn",children:"Cancel"}),v.jsx(as,{colorScheme:"red",onClick:m,ml:3,children:"Delete"})]})]})})})]})});tS.displayName="DeleteImageModal";const xEe=ot([ir,yp,$y,mp,Wx,Or],(e,t,n,r,i,o)=>{const{isProcessing:a,isConnected:s,isGFPGANAvailable:l,isESRGANAvailable:u}=e,{upscalingLevel:d,facetoolStrength:h}=n,{isLightboxOpen:m}=i,{shouldShowImageDetails:y}=r,{intermediateImage:b,currentImage:S}=t;return{isProcessing:a,isConnected:s,isGFPGANAvailable:l,isESRGANAvailable:u,upscalingLevel:d,facetoolStrength:h,shouldDisableToolbarButtons:Boolean(b)||!S,currentImage:S,shouldShowImageDetails:y,activeTabName:o,isLightboxOpen:m}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),Sq=()=>{var z,V,K,te,q,F;const e=Ie(),{isProcessing:t,isConnected:n,isGFPGANAvailable:r,isESRGANAvailable:i,upscalingLevel:o,facetoolStrength:a,shouldDisableToolbarButtons:s,shouldShowImageDetails:l,currentImage:u,isLightboxOpen:d,activeTabName:h}=he(xEe),m=Ry(),{t:y}=Ve(),b=()=>{u&&(d&&e(Bm(!1)),e(k0(u)),e(qo("img2img")))},S=async()=>{if(!u)return;const U=await fetch(u.url).then(Z=>Z.blob()),X=[new ClipboardItem({[U.type]:U})];await navigator.clipboard.write(X),m({title:y("toast:imageCopied"),status:"success",duration:2500,isClosable:!0})},E=()=>{navigator.clipboard.writeText(u?window.location.toString()+u.url:"").then(()=>{m({title:y("toast:imageLinkCopied"),status:"success",duration:2500,isClosable:!0})})};Qe("shift+i",()=>{u?(b(),m({title:y("toast:sentToImageToImage"),status:"success",duration:2500,isClosable:!0})):m({title:y("toast:imageNotLoaded"),description:y("toast:imageNotLoadedDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const k=()=>{var U,X;u&&(u.metadata&&e(aU(u.metadata)),((U=u.metadata)==null?void 0:U.image.type)==="img2img"?e(qo("img2img")):((X=u.metadata)==null?void 0:X.image.type)==="txt2img"&&e(qo("txt2img")))};Qe("a",()=>{var U,X;["txt2img","img2img"].includes((X=(U=u==null?void 0:u.metadata)==null?void 0:U.image)==null?void 0:X.type)?(k(),m({title:y("toast:parametersSet"),status:"success",duration:2500,isClosable:!0})):m({title:y("toast:parametersNotSet"),description:y("toast:parametersNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const _=()=>{u!=null&&u.metadata&&e(Ny(u.metadata.image.seed))};Qe("s",()=>{var U,X;(X=(U=u==null?void 0:u.metadata)==null?void 0:U.image)!=null&&X.seed?(_(),m({title:y("toast:seedSet"),status:"success",duration:2500,isClosable:!0})):m({title:y("toast:seedNotSet"),description:y("toast:seedNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const T=()=>{var U,X,Z,W;if((X=(U=u==null?void 0:u.metadata)==null?void 0:U.image)!=null&&X.prompt){const[Q,ie]=aP((W=(Z=u==null?void 0:u.metadata)==null?void 0:Z.image)==null?void 0:W.prompt);Q&&e(jx(Q)),e(Q2(ie||""))}};Qe("p",()=>{var U,X;(X=(U=u==null?void 0:u.metadata)==null?void 0:U.image)!=null&&X.prompt?(T(),m({title:y("toast:promptSet"),status:"success",duration:2500,isClosable:!0})):m({title:y("toast:promptNotSet"),description:y("toast:promptNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const A=()=>{u&&e(I8e(u))};Qe("Shift+U",()=>{i&&!s&&n&&!t&&o?A():m({title:y("toast:upscalingFailed"),status:"error",duration:2500,isClosable:!0})},[u,i,s,n,t,o]);const I=()=>{u&&e(R8e(u))};Qe("Shift+R",()=>{r&&!s&&n&&!t&&a?I():m({title:y("toast:faceRestoreFailed"),status:"error",duration:2500,isClosable:!0})},[u,r,s,n,t,a]);const R=()=>e(HU(!l)),D=()=>{u&&(d&&e(Bm(!1)),e(Nx(u)),e(vi(!0)),h!=="unifiedCanvas"&&e(qo("unifiedCanvas")),m({title:y("toast:sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0}))};Qe("i",()=>{u?R():m({title:y("toast:metadataLoadFailed"),status:"error",duration:2500,isClosable:!0})},[u,l]);const j=()=>{e(Bm(!d))};return v.jsxs("div",{className:"current-image-options",children:[v.jsxs(oo,{isAttached:!0,children:[v.jsx(Zs,{trigger:"hover",triggerComponent:v.jsx(Ze,{"aria-label":`${y("parameters:sendTo")}...`,icon:v.jsx(pEe,{})}),children:v.jsxs("div",{className:"current-image-send-to-popover",children:[v.jsx(cr,{size:"sm",onClick:b,leftIcon:v.jsx(mD,{}),children:y("parameters:sendToImg2Img")}),v.jsx(cr,{size:"sm",onClick:D,leftIcon:v.jsx(mD,{}),children:y("parameters:sendToUnifiedCanvas")}),v.jsx(cr,{size:"sm",onClick:S,leftIcon:v.jsx(o0,{}),children:y("parameters:copyImage")}),v.jsx(cr,{size:"sm",onClick:E,leftIcon:v.jsx(o0,{}),children:y("parameters:copyImageToLink")}),v.jsx(Nh,{download:!0,href:u==null?void 0:u.url,children:v.jsx(cr,{leftIcon:v.jsx(TP,{}),size:"sm",w:"100%",children:y("parameters:downloadImage")})})]})}),v.jsx(Ze,{icon:v.jsx(Jke,{}),tooltip:d?`${y("parameters:closeViewer")} (Z)`:`${y("parameters:openInViewer")} (Z)`,"aria-label":d?`${y("parameters:closeViewer")} (Z)`:`${y("parameters:openInViewer")} (Z)`,"data-selected":d,onClick:j})]}),v.jsxs(oo,{isAttached:!0,children:[v.jsx(Ze,{icon:v.jsx(cEe,{}),tooltip:`${y("parameters:usePrompt")} (P)`,"aria-label":`${y("parameters:usePrompt")} (P)`,isDisabled:!((V=(z=u==null?void 0:u.metadata)==null?void 0:z.image)!=null&&V.prompt),onClick:T}),v.jsx(Ze,{icon:v.jsx(hEe,{}),tooltip:`${y("parameters:useSeed")} (S)`,"aria-label":`${y("parameters:useSeed")} (S)`,isDisabled:!((te=(K=u==null?void 0:u.metadata)==null?void 0:K.image)!=null&&te.seed),onClick:_}),v.jsx(Ze,{icon:v.jsx(Kke,{}),tooltip:`${y("parameters:useAll")} (A)`,"aria-label":`${y("parameters:useAll")} (A)`,isDisabled:!["txt2img","img2img"].includes((F=(q=u==null?void 0:u.metadata)==null?void 0:q.image)==null?void 0:F.type),onClick:k})]}),v.jsxs(oo,{isAttached:!0,children:[v.jsx(Zs,{trigger:"hover",triggerComponent:v.jsx(Ze,{icon:v.jsx(nEe,{}),"aria-label":y("parameters:restoreFaces")}),children:v.jsxs("div",{className:"current-image-postprocessing-popover",children:[v.jsx(wP,{}),v.jsx(cr,{isDisabled:!r||!u||!(n&&!t)||!a,onClick:I,children:y("parameters:restoreFaces")})]})}),v.jsx(Zs,{trigger:"hover",triggerComponent:v.jsx(Ze,{icon:v.jsx(Qke,{}),"aria-label":y("parameters:upscale")}),children:v.jsxs("div",{className:"current-image-postprocessing-popover",children:[v.jsx(CP,{}),v.jsx(cr,{isDisabled:!i||!u||!(n&&!t)||!o,onClick:A,children:y("parameters:upscaleImage")})]})})]}),v.jsx(oo,{isAttached:!0,children:v.jsx(Ze,{icon:v.jsx(fq,{}),tooltip:`${y("parameters:info")} (I)`,"aria-label":`${y("parameters:info")} (I)`,"data-selected":l,onClick:R})}),v.jsx(tS,{image:u,children:v.jsx(Ze,{icon:v.jsx(vp,{}),tooltip:`${y("parameters:deleteImage")} (Del)`,"aria-label":`${y("parameters:deleteImage")} (Del)`,isDisabled:!u||!n||t,style:{backgroundColor:"var(--btn-delete-image)"}})})]})};yt({d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z",displayName:"CopyIcon"});yt({d:"M23.384,21.619,16.855,15.09a9.284,9.284,0,1,0-1.768,1.768l6.529,6.529a1.266,1.266,0,0,0,1.768,0A1.251,1.251,0,0,0,23.384,21.619ZM2.75,9.5a6.75,6.75,0,1,1,6.75,6.75A6.758,6.758,0,0,1,2.75,9.5Z",displayName:"SearchIcon"});yt({d:"M23.414,20.591l-4.645-4.645a10.256,10.256,0,1,0-2.828,2.829l4.645,4.644a2.025,2.025,0,0,0,2.828,0A2,2,0,0,0,23.414,20.591ZM10.25,3.005A7.25,7.25,0,1,1,3,10.255,7.258,7.258,0,0,1,10.25,3.005Z",displayName:"Search2Icon"});yt({d:"M21.4,13.7C20.6,13.9,19.8,14,19,14c-5,0-9-4-9-9c0-0.8,0.1-1.6,0.3-2.4c0.1-0.3,0-0.7-0.3-1 c-0.3-0.3-0.6-0.4-1-0.3C4.3,2.7,1,7.1,1,12c0,6.1,4.9,11,11,11c4.9,0,9.3-3.3,10.6-8.1c0.1-0.3,0-0.7-0.3-1 C22.1,13.7,21.7,13.6,21.4,13.7z",displayName:"MoonIcon"});yt({displayName:"SunIcon",path:N.createElement("g",{strokeLinejoin:"round",strokeLinecap:"round",strokeWidth:"2",fill:"none",stroke:"currentColor"},N.createElement("circle",{cx:"12",cy:"12",r:"5"}),N.createElement("path",{d:"M12 1v2"}),N.createElement("path",{d:"M12 21v2"}),N.createElement("path",{d:"M4.22 4.22l1.42 1.42"}),N.createElement("path",{d:"M18.36 18.36l1.42 1.42"}),N.createElement("path",{d:"M1 12h2"}),N.createElement("path",{d:"M21 12h2"}),N.createElement("path",{d:"M4.22 19.78l1.42-1.42"}),N.createElement("path",{d:"M18.36 5.64l1.42-1.42"}))});yt({d:"M0,12a1.5,1.5,0,0,0,1.5,1.5h8.75a.25.25,0,0,1,.25.25V22.5a1.5,1.5,0,0,0,3,0V13.75a.25.25,0,0,1,.25-.25H22.5a1.5,1.5,0,0,0,0-3H13.75a.25.25,0,0,1-.25-.25V1.5a1.5,1.5,0,0,0-3,0v8.75a.25.25,0,0,1-.25.25H1.5A1.5,1.5,0,0,0,0,12Z",displayName:"AddIcon"});yt({displayName:"SmallAddIcon",viewBox:"0 0 20 20",path:N.createElement("path",{fill:"currentColor",d:"M14 9h-3V6c0-.55-.45-1-1-1s-1 .45-1 1v3H6c-.55 0-1 .45-1 1s.45 1 1 1h3v3c0 .55.45 1 1 1s1-.45 1-1v-3h3c.55 0 1-.45 1-1s-.45-1-1-1z",fillRule:"evenodd"})});yt({viewBox:"0 0 14 14",d:"M14,7.77 L14,6.17 L12.06,5.53 L11.61,4.44 L12.49,2.6 L11.36,1.47 L9.55,2.38 L8.46,1.93 L7.77,0.01 L6.17,0.01 L5.54,1.95 L4.43,2.4 L2.59,1.52 L1.46,2.65 L2.37,4.46 L1.92,5.55 L0,6.23 L0,7.82 L1.94,8.46 L2.39,9.55 L1.51,11.39 L2.64,12.52 L4.45,11.61 L5.54,12.06 L6.23,13.98 L7.82,13.98 L8.45,12.04 L9.56,11.59 L11.4,12.47 L12.53,11.34 L11.61,9.53 L12.08,8.44 L14,7.75 L14,7.77 Z M7,10 C5.34,10 4,8.66 4,7 C4,5.34 5.34,4 7,4 C8.66,4 10,5.34 10,7 C10,8.66 8.66,10 7,10 Z",displayName:"SettingsIcon"});yt({displayName:"CheckCircleIcon",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"});yt({d:"M19.5,9.5h-.75V6.75a6.75,6.75,0,0,0-13.5,0V9.5H4.5a2,2,0,0,0-2,2V22a2,2,0,0,0,2,2h15a2,2,0,0,0,2-2V11.5A2,2,0,0,0,19.5,9.5Zm-9.5,6a2,2,0,1,1,3,1.723V19.5a1,1,0,0,1-2,0V17.223A1.994,1.994,0,0,1,10,15.5ZM7.75,6.75a4.25,4.25,0,0,1,8.5,0V9a.5.5,0,0,1-.5.5H8.25a.5.5,0,0,1-.5-.5Z",displayName:"LockIcon"});yt({d:"M19.5,9.5h-.75V6.75A6.751,6.751,0,0,0,5.533,4.811a1.25,1.25,0,1,0,2.395.717A4.251,4.251,0,0,1,16.25,6.75V9a.5.5,0,0,1-.5.5H4.5a2,2,0,0,0-2,2V22a2,2,0,0,0,2,2h15a2,2,0,0,0,2-2V11.5A2,2,0,0,0,19.5,9.5Zm-9.5,6a2,2,0,1,1,3,1.723V19.5a1,1,0,0,1-2,0V17.223A1.994,1.994,0,0,1,10,15.5Z",displayName:"UnlockIcon"});yt({displayName:"ViewIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M23.432,10.524C20.787,7.614,16.4,4.538,12,4.6,7.6,4.537,3.213,7.615.568,10.524a2.211,2.211,0,0,0,0,2.948C3.182,16.351,7.507,19.4,11.839,19.4h.308c4.347,0,8.671-3.049,11.288-5.929A2.21,2.21,0,0,0,23.432,10.524ZM7.4,12A4.6,4.6,0,1,1,12,16.6,4.6,4.6,0,0,1,7.4,12Z"}),N.createElement("circle",{cx:"12",cy:"12",r:"2"}))});yt({displayName:"ViewOffIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M23.2,10.549a20.954,20.954,0,0,0-4.3-3.6l4-3.995a1,1,0,1,0-1.414-1.414l-.018.018a.737.737,0,0,1-.173.291l-19.5,19.5c-.008.007-.018.009-.026.017a1,1,0,0,0,1.631,1.088l4.146-4.146a11.26,11.26,0,0,0,4.31.939h.3c4.256,0,8.489-2.984,11.051-5.8A2.171,2.171,0,0,0,23.2,10.549ZM16.313,13.27a4.581,4.581,0,0,1-3,3.028,4.3,4.3,0,0,1-3.1-.19.253.253,0,0,1-.068-.407l5.56-5.559a.252.252,0,0,1,.407.067A4.3,4.3,0,0,1,16.313,13.27Z"}),N.createElement("path",{d:"M7.615,13.4a.244.244,0,0,0,.061-.24A4.315,4.315,0,0,1,7.5,12,4.5,4.5,0,0,1,12,7.5a4.276,4.276,0,0,1,1.16.173.244.244,0,0,0,.24-.062l1.941-1.942a.254.254,0,0,0-.1-.421A10.413,10.413,0,0,0,12,4.75C7.7,4.692,3.4,7.7.813,10.549a2.15,2.15,0,0,0-.007,2.9,21.209,21.209,0,0,0,3.438,3.03.256.256,0,0,0,.326-.029Z"}))});yt({d:"M11.2857,6.05714 L10.08571,4.85714 L7.85714,7.14786 L7.85714,1 L6.14286,1 L6.14286,7.14786 L3.91429,4.85714 L2.71429,6.05714 L7,10.42857 L11.2857,6.05714 Z M1,11.2857 L1,13 L13,13 L13,11.2857 L1,11.2857 Z",displayName:"DownloadIcon",viewBox:"0 0 14 14"});var wEe=yt({displayName:"DeleteIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("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"}))});yt({displayName:"RepeatIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M10.319,4.936a7.239,7.239,0,0,1,7.1,2.252,1.25,1.25,0,1,0,1.872-1.657A9.737,9.737,0,0,0,9.743,2.5,10.269,10.269,0,0,0,2.378,9.61a.249.249,0,0,1-.271.178l-1.033-.13A.491.491,0,0,0,.6,9.877a.5.5,0,0,0-.019.526l2.476,4.342a.5.5,0,0,0,.373.248.43.43,0,0,0,.062,0,.5.5,0,0,0,.359-.152l3.477-3.593a.5.5,0,0,0-.3-.844L5.15,10.172a.25.25,0,0,1-.2-.333A7.7,7.7,0,0,1,10.319,4.936Z"}),N.createElement("path",{d:"M23.406,14.1a.5.5,0,0,0,.015-.526l-2.5-4.329A.5.5,0,0,0,20.546,9a.489.489,0,0,0-.421.151l-3.456,3.614a.5.5,0,0,0,.3.842l1.848.221a.249.249,0,0,1,.183.117.253.253,0,0,1,.023.216,7.688,7.688,0,0,1-5.369,4.9,7.243,7.243,0,0,1-7.1-2.253,1.25,1.25,0,1,0-1.872,1.656,9.74,9.74,0,0,0,9.549,3.03,10.261,10.261,0,0,0,7.369-7.12.251.251,0,0,1,.27-.179l1.058.127a.422.422,0,0,0,.06,0A.5.5,0,0,0,23.406,14.1Z"}))});yt({displayName:"RepeatClockIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M12.965,6a1,1,0,0,0-1,1v5.5a1,1,0,0,0,1,1h5a1,1,0,0,0,0-2h-3.75a.25.25,0,0,1-.25-.25V7A1,1,0,0,0,12.965,6Z"}),N.createElement("path",{d:"M12.567,1.258A10.822,10.822,0,0,0,2.818,8.4a.25.25,0,0,1-.271.163L.858,8.309a.514.514,0,0,0-.485.213.5.5,0,0,0-.021.53l2.679,4.7a.5.5,0,0,0,.786.107l3.77-3.746a.5.5,0,0,0-.279-.85L5.593,9.007a.25.25,0,0,1-.192-.35,8.259,8.259,0,1,1,7.866,11.59,1.25,1.25,0,0,0,.045,2.5h.047a10.751,10.751,0,1,0-.792-21.487Z"}))});var CEe=yt({displayName:"EditIcon",path:N.createElement("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"},N.createElement("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),N.createElement("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"}))});yt({d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z",displayName:"ChevronLeftIcon"});yt({d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z",displayName:"ChevronRightIcon"});yt({displayName:"ChevronDownIcon",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"});yt({d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z",displayName:"ChevronUpIcon"});yt({d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z",displayName:"ArrowBackIcon"});yt({d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z",displayName:"ArrowForwardIcon"});yt({d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z",displayName:"ArrowUpIcon"});yt({viewBox:"0 0 16 16",d:"M11.891 9.992a1 1 0 1 1 1.416 1.415l-4.3 4.3a1 1 0 0 1-1.414 0l-4.3-4.3A1 1 0 0 1 4.71 9.992l3.59 3.591 3.591-3.591zm0-3.984L8.3 2.417 4.709 6.008a1 1 0 0 1-1.416-1.415l4.3-4.3a1 1 0 0 1 1.414 0l4.3 4.3a1 1 0 1 1-1.416 1.415z",displayName:"ArrowUpDownIcon"});yt({d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z",displayName:"ArrowDownIcon"});var xq=yt({displayName:"ExternalLinkIcon",path:N.createElement("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"},N.createElement("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),N.createElement("path",{d:"M15 3h6v6"}),N.createElement("path",{d:"M10 14L21 3"}))});yt({displayName:"LinkIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M10.458,18.374,7.721,21.11a2.853,2.853,0,0,1-3.942,0l-.892-.891a2.787,2.787,0,0,1,0-3.941l5.8-5.8a2.789,2.789,0,0,1,3.942,0l.893.892A1,1,0,0,0,14.94,9.952l-.893-.892a4.791,4.791,0,0,0-6.771,0l-5.8,5.8a4.787,4.787,0,0,0,0,6.77l.892.891a4.785,4.785,0,0,0,6.771,0l2.736-2.735a1,1,0,1,0-1.414-1.415Z"}),N.createElement("path",{d:"M22.526,2.363l-.892-.892a4.8,4.8,0,0,0-6.77,0l-2.905,2.9a1,1,0,0,0,1.414,1.414l2.9-2.9a2.79,2.79,0,0,1,3.941,0l.893.893a2.786,2.786,0,0,1,0,3.942l-5.8,5.8a2.769,2.769,0,0,1-1.971.817h0a2.766,2.766,0,0,1-1.969-.816,1,1,0,1,0-1.415,1.412,4.751,4.751,0,0,0,3.384,1.4h0a4.752,4.752,0,0,0,3.385-1.4l5.8-5.8a4.786,4.786,0,0,0,0-6.771Z"}))});yt({displayName:"PlusSquareIcon",path:N.createElement("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"},N.createElement("rect",{height:"18",width:"18",rx:"2",ry:"2",x:"3",y:"3"}),N.createElement("path",{d:"M12 8v8"}),N.createElement("path",{d:"M8 12h8"}))});yt({displayName:"CalendarIcon",viewBox:"0 0 14 14",d:"M10.8889,5.5 L3.11111,5.5 L3.11111,7.05556 L10.8889,7.05556 L10.8889,5.5 Z M12.4444,1.05556 L11.6667,1.05556 L11.6667,0 L10.1111,0 L10.1111,1.05556 L3.88889,1.05556 L3.88889,0 L2.33333,0 L2.33333,1.05556 L1.55556,1.05556 C0.692222,1.05556 0.00777777,1.75556 0.00777777,2.61111 L0,12.5 C0,13.3556 0.692222,14 1.55556,14 L12.4444,14 C13.3,14 14,13.3556 14,12.5 L14,2.61111 C14,1.75556 13.3,1.05556 12.4444,1.05556 Z M12.4444,12.5 L1.55556,12.5 L1.55556,3.94444 L12.4444,3.94444 L12.4444,12.5 Z M8.55556,8.61111 L3.11111,8.61111 L3.11111,10.1667 L8.55556,10.1667 L8.55556,8.61111 Z"});yt({d:"M0.913134,0.920639 C1.49851,0.331726 2.29348,0 3.12342,0 L10.8766,0 C11.7065,0 12.5015,0.331725 13.0869,0.920639 C13.6721,1.50939 14,2.30689 14,3.13746 L14,8.12943 C13.9962,8.51443 13.9059,8.97125 13.7629,9.32852 C13.6128,9.683 13.3552,10.0709 13.0869,10.3462 C12.813,10.6163 12.4265,10.8761 12.0734,11.0274 C11.7172,11.1716 11.2607,11.263 10.8766,11.2669 L10.1234,11.2669 L10.1234,12.5676 L10.1209,12.5676 C10.1204,12.793 10.0633,13.0791 9.97807,13.262 C9.8627,13.466 9.61158,13.7198 9.40818,13.8382 L9.40824,13.8383 C9.4077,13.8386 9.40716,13.8388 9.40661,13.8391 C9.40621,13.8393 9.4058,13.8396 9.40539,13.8398 L9.40535,13.8397 C9.22958,13.9254 8.94505,13.9951 8.75059,14 L8.74789,14 C8.35724,13.9963 7.98473,13.8383 7.71035,13.5617 L5.39553,11.2669 L3.12342,11.2669 C2.29348,11.2669 1.49851,10.9352 0.913134,10.3462 C0.644826,10.0709 0.387187,9.683 0.23711,9.32852 C0.0941235,8.97125 0.00379528,8.51443 0,8.12943 L0,3.13746 C0,2.30689 0.327915,1.50939 0.913134,0.920639 Z M3.12342,1.59494 C2.71959,1.59494 2.33133,1.75628 2.04431,2.04503 C1.75713,2.33395 1.59494,2.72681 1.59494,3.13746 L1.59494,8.12943 C1.59114,8.35901 1.62114,8.51076 1.71193,8.72129 C1.79563,8.9346 1.88065,9.06264 2.04431,9.22185 C2.33133,9.5106 2.71959,9.67195 3.12342,9.67195 L5.72383,9.67195 C5.93413,9.67195 6.13592,9.75502 6.28527,9.90308 L8.52848,12.1269 L8.52848,10.4694 C8.52848,10.029 8.88552,9.67195 9.32595,9.67195 L10.8766,9.67195 C11.1034,9.67583 11.2517,9.64614 11.4599,9.55518 C11.6712,9.47132 11.7976,9.38635 11.9557,9.22185 C12.1193,9.06264 12.2044,8.9346 12.2881,8.72129 C12.3789,8.51076 12.4089,8.35901 12.4051,8.12943 L12.4051,3.13746 C12.4051,2.72681 12.2429,2.33394 11.9557,2.04503 C11.6687,1.75628 11.2804,1.59494 10.8766,1.59494 L3.12342,1.59494 Z",displayName:"ChatIcon",viewBox:"0 0 14 14"});yt({displayName:"TimeIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm0,22A10,10,0,1,1,22,12,10.011,10.011,0,0,1,12,22Z"}),N.createElement("path",{d:"M17.134,15.81,12.5,11.561V6.5a1,1,0,0,0-2,0V12a1,1,0,0,0,.324.738l4.959,4.545a1.01,1.01,0,0,0,1.413-.061A1,1,0,0,0,17.134,15.81Z"}))});yt({displayName:"ArrowRightIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M13.584,12a2.643,2.643,0,0,1-.775,1.875L3.268,23.416a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L.768,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,13.584,12Z"}),N.createElement("path",{d:"M23.75,12a2.643,2.643,0,0,1-.775,1.875l-9.541,9.541a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L10.934,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,23.75,12Z"}))});yt({displayName:"ArrowLeftIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M10.416,12a2.643,2.643,0,0,1,.775-1.875L20.732.584a1.768,1.768,0,0,1,2.5,2.5l-8.739,8.739a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5l-9.541-9.541A2.643,2.643,0,0,1,10.416,12Z"}),N.createElement("path",{d:"M.25,12a2.643,2.643,0,0,1,.775-1.875L10.566.584a1.768,1.768,0,0,1,2.5,2.5L4.327,11.823a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5L1.025,13.875A2.643,2.643,0,0,1,.25,12Z"}))});yt({displayName:"AtSignIcon",d:"M12,.5A11.634,11.634,0,0,0,.262,12,11.634,11.634,0,0,0,12,23.5a11.836,11.836,0,0,0,6.624-2,1.25,1.25,0,1,0-1.393-2.076A9.34,9.34,0,0,1,12,21a9.132,9.132,0,0,1-9.238-9A9.132,9.132,0,0,1,12,3a9.132,9.132,0,0,1,9.238,9v.891a1.943,1.943,0,0,1-3.884,0V12A5.355,5.355,0,1,0,12,17.261a5.376,5.376,0,0,0,3.861-1.634,4.438,4.438,0,0,0,7.877-2.736V12A11.634,11.634,0,0,0,12,.5Zm0,14.261A2.763,2.763,0,1,1,14.854,12,2.812,2.812,0,0,1,12,14.761Z"});yt({displayName:"AttachmentIcon",d:"M21.843,3.455a6.961,6.961,0,0,0-9.846,0L1.619,13.832a5.128,5.128,0,0,0,7.252,7.252L17.3,12.653A3.293,3.293,0,1,0,12.646,8L7.457,13.184A1,1,0,1,0,8.871,14.6L14.06,9.409a1.294,1.294,0,0,1,1.829,1.83L7.457,19.67a3.128,3.128,0,0,1-4.424-4.424L13.411,4.869a4.962,4.962,0,1,1,7.018,7.018L12.646,19.67a1,1,0,1,0,1.414,1.414L21.843,13.3a6.96,6.96,0,0,0,0-9.846Z"});yt({displayName:"UpDownIcon",viewBox:"-1 -1 9 11",d:"M 3.5 0L 3.98809 -0.569442L 3.5 -0.987808L 3.01191 -0.569442L 3.5 0ZM 3.5 9L 3.01191 9.56944L 3.5 9.98781L 3.98809 9.56944L 3.5 9ZM 0.488094 3.56944L 3.98809 0.569442L 3.01191 -0.569442L -0.488094 2.43056L 0.488094 3.56944ZM 3.01191 0.569442L 6.51191 3.56944L 7.48809 2.43056L 3.98809 -0.569442L 3.01191 0.569442ZM -0.488094 6.56944L 3.01191 9.56944L 3.98809 8.43056L 0.488094 5.43056L -0.488094 6.56944ZM 3.98809 9.56944L 7.48809 6.56944L 6.51191 5.43056L 3.01191 8.43056L 3.98809 9.56944Z"});yt({d:"M23.555,8.729a1.505,1.505,0,0,0-1.406-.98H16.062a.5.5,0,0,1-.472-.334L13.405,1.222a1.5,1.5,0,0,0-2.81,0l-.005.016L8.41,7.415a.5.5,0,0,1-.471.334H1.85A1.5,1.5,0,0,0,.887,10.4l5.184,4.3a.5.5,0,0,1,.155.543L4.048,21.774a1.5,1.5,0,0,0,2.31,1.684l5.346-3.92a.5.5,0,0,1,.591,0l5.344,3.919a1.5,1.5,0,0,0,2.312-1.683l-2.178-6.535a.5.5,0,0,1,.155-.543l5.194-4.306A1.5,1.5,0,0,0,23.555,8.729Z",displayName:"StarIcon"});yt({displayName:"EmailIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("path",{d:"M11.114,14.556a1.252,1.252,0,0,0,1.768,0L22.568,4.87a.5.5,0,0,0-.281-.849A1.966,1.966,0,0,0,22,4H2a1.966,1.966,0,0,0-.289.021.5.5,0,0,0-.281.849Z"}),N.createElement("path",{d:"M23.888,5.832a.182.182,0,0,0-.2.039l-6.2,6.2a.251.251,0,0,0,0,.354l5.043,5.043a.75.75,0,1,1-1.06,1.061l-5.043-5.043a.25.25,0,0,0-.354,0l-2.129,2.129a2.75,2.75,0,0,1-3.888,0L7.926,13.488a.251.251,0,0,0-.354,0L2.529,18.531a.75.75,0,0,1-1.06-1.061l5.043-5.043a.251.251,0,0,0,0-.354l-6.2-6.2a.18.18,0,0,0-.2-.039A.182.182,0,0,0,0,6V18a2,2,0,0,0,2,2H22a2,2,0,0,0,2-2V6A.181.181,0,0,0,23.888,5.832Z"}))});yt({d:"M2.20731,0.0127209 C2.1105,-0.0066419 1.99432,-0.00664663 1.91687,0.032079 C0.871279,0.438698 0.212942,1.92964 0.0580392,2.95587 C-0.426031,6.28627 2.20731,9.17133 4.62766,11.0689 C6.77694,12.7534 10.9012,15.5223 13.3409,12.8503 C13.6507,12.5211 14.0186,12.037 13.9993,11.553 C13.9412,10.7397 13.186,10.1588 12.6051,9.71349 C12.1598,9.38432 11.2304,8.47427 10.6495,8.49363 C10.1267,8.51299 9.79754,9.05515 9.46837,9.38432 L8.88748,9.96521 C8.79067,10.062 7.55145,9.24878 7.41591,9.15197 C6.91248,8.8228 6.4284,8.45491 6.00242,8.04829 C5.57644,7.64167 5.18919,7.19632 4.86002,6.73161 C4.7632,6.59607 3.96933,5.41495 4.04678,5.31813 C4.04678,5.31813 4.72448,4.58234 4.91811,4.2919 C5.32473,3.67229 5.63453,3.18822 5.16982,2.45243 C4.99556,2.18135 4.78257,1.96836 4.55021,1.73601 C4.14359,1.34875 3.73698,0.942131 3.27227,0.612963 C3.02055,0.419335 2.59457,0.0708094 2.20731,0.0127209 Z",displayName:"PhoneIcon",viewBox:"0 0 14 14"});yt({viewBox:"0 0 10 10",d:"M3,2 C2.44771525,2 2,1.55228475 2,1 C2,0.44771525 2.44771525,0 3,0 C3.55228475,0 4,0.44771525 4,1 C4,1.55228475 3.55228475,2 3,2 Z M3,6 C2.44771525,6 2,5.55228475 2,5 C2,4.44771525 2.44771525,4 3,4 C3.55228475,4 4,4.44771525 4,5 C4,5.55228475 3.55228475,6 3,6 Z M3,10 C2.44771525,10 2,9.55228475 2,9 C2,8.44771525 2.44771525,8 3,8 C3.55228475,8 4,8.44771525 4,9 C4,9.55228475 3.55228475,10 3,10 Z M7,2 C6.44771525,2 6,1.55228475 6,1 C6,0.44771525 6.44771525,0 7,0 C7.55228475,0 8,0.44771525 8,1 C8,1.55228475 7.55228475,2 7,2 Z M7,6 C6.44771525,6 6,5.55228475 6,5 C6,4.44771525 6.44771525,4 7,4 C7.55228475,4 8,4.44771525 8,5 C8,5.55228475 7.55228475,6 7,6 Z M7,10 C6.44771525,10 6,9.55228475 6,9 C6,8.44771525 6.44771525,8 7,8 C7.55228475,8 8,8.44771525 8,9 C8,9.55228475 7.55228475,10 7,10 Z",displayName:"DragHandleIcon"});yt({displayName:"SpinnerIcon",path:N.createElement(N.Fragment,null,N.createElement("defs",null,N.createElement("linearGradient",{x1:"28.154%",y1:"63.74%",x2:"74.629%",y2:"17.783%",id:"a"},N.createElement("stop",{stopColor:"currentColor",offset:"0%"}),N.createElement("stop",{stopColor:"#fff",stopOpacity:"0",offset:"100%"}))),N.createElement("g",{transform:"translate(2)",fill:"none"},N.createElement("circle",{stroke:"url(#a)",strokeWidth:"4",cx:"10",cy:"12",r:"10"}),N.createElement("path",{d:"M10 2C4.477 2 0 6.477 0 12",stroke:"currentColor",strokeWidth:"4"}),N.createElement("rect",{fill:"currentColor",x:"8",width:"4",height:"4",rx:"8"})))});yt({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"});yt({displayName:"SmallCloseIcon",viewBox:"0 0 16 16",path:N.createElement("path",{d:"M9.41 8l2.29-2.29c.19-.18.3-.43.3-.71a1.003 1.003 0 0 0-1.71-.71L8 6.59l-2.29-2.3a1.003 1.003 0 0 0-1.42 1.42L6.59 8 4.3 10.29c-.19.18-.3.43-.3.71a1.003 1.003 0 0 0 1.71.71L8 9.41l2.29 2.29c.18.19.43.3.71.3a1.003 1.003 0 0 0 .71-1.71L9.41 8z",fillRule:"evenodd",fill:"currentColor"})});yt({d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z",displayName:"NotAllowedIcon"});yt({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",displayName:"TriangleDownIcon"});yt({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",displayName:"TriangleUpIcon"});yt({displayName:"InfoOutlineIcon",path:N.createElement("g",{fill:"currentColor",stroke:"currentColor",strokeLinecap:"square",strokeWidth:"2"},N.createElement("circle",{cx:"12",cy:"12",fill:"none",r:"11",stroke:"currentColor"}),N.createElement("line",{fill:"none",x1:"11.959",x2:"11.959",y1:"11",y2:"17"}),N.createElement("circle",{cx:"11.959",cy:"7",r:"1",stroke:"none"}))});yt({displayName:"BellIcon",d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"});yt({d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"});yt({d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm0,19a1.5,1.5,0,1,1,1.5-1.5A1.5,1.5,0,0,1,12,19Zm1.6-6.08a1,1,0,0,0-.6.917,1,1,0,1,1-2,0,3,3,0,0,1,1.8-2.75A2,2,0,1,0,10,9.255a1,1,0,1,1-2,0,4,4,0,1,1,5.6,3.666Z",displayName:"QuestionIcon"});yt({displayName:"QuestionOutlineIcon",path:N.createElement("g",{stroke:"currentColor",strokeWidth:"1.5"},N.createElement("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),N.createElement("path",{fill:"none",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),N.createElement("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"}))});yt({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",displayName:"WarningIcon"});yt({displayName:"WarningTwoIcon",d:"M23.119,20,13.772,2.15h0a2,2,0,0,0-3.543,0L.881,20a2,2,0,0,0,1.772,2.928H21.347A2,2,0,0,0,23.119,20ZM11,8.423a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Zm1.05,11.51h-.028a1.528,1.528,0,0,1-1.522-1.47,1.476,1.476,0,0,1,1.448-1.53h.028A1.527,1.527,0,0,1,13.5,18.4,1.475,1.475,0,0,1,12.05,19.933Z"});yt({viewBox:"0 0 14 14",path:N.createElement("g",{fill:"currentColor"},N.createElement("polygon",{points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"}))});yt({displayName:"MinusIcon",path:N.createElement("g",{fill:"currentColor"},N.createElement("rect",{height:"4",width:"20",x:"2",y:"10"}))});yt({displayName:"HamburgerIcon",viewBox:"0 0 24 24",d:"M 3 5 A 1.0001 1.0001 0 1 0 3 7 L 21 7 A 1.0001 1.0001 0 1 0 21 5 L 3 5 z M 3 11 A 1.0001 1.0001 0 1 0 3 13 L 21 13 A 1.0001 1.0001 0 1 0 21 11 L 3 11 z M 3 17 A 1.0001 1.0001 0 1 0 3 19 L 21 19 A 1.0001 1.0001 0 1 0 21 17 L 3 17 z"});function _Ee(e){return gt({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M245.09 327.74v-37.32c57.07 0 84.51 13.47 108.58 38.68 5.4 5.65 15 1.32 14.29-6.43-5.45-61.45-34.14-117.09-122.87-117.09v-37.32a8.32 8.32 0 00-14.05-6L146.58 242a8.2 8.2 0 000 11.94L231 333.71a8.32 8.32 0 0014.09-5.97z"}},{tag:"path",attr:{fill:"none",strokeMiterlimit:"10",strokeWidth:"32",d:"M256 64C150 64 64 150 64 256s86 192 192 192 192-86 192-192S362 64 256 64z"}}]})(e)}const zn=({label:e,value:t,onClick:n,isLink:r,labelPosition:i,withCopy:o=!1})=>v.jsxs(qe,{gap:2,children:[n&&v.jsx(lo,{label:`Recall ${e}`,children:v.jsx(ss,{"aria-label":"Use this parameter",icon:v.jsx(_Ee,{}),size:"xs",variant:"ghost",fontSize:20,onClick:n})}),o&&v.jsx(lo,{label:`Copy ${e}`,children:v.jsx(ss,{"aria-label":`Copy ${e}`,icon:v.jsx(o0,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(t.toString())})}),v.jsxs(qe,{direction:i?"column":"row",children:[v.jsxs(fn,{fontWeight:"semibold",whiteSpace:"pre-wrap",pr:2,children:[e,":"]}),r?v.jsxs(Nh,{href:t.toString(),isExternal:!0,wordBreak:"break-all",children:[t.toString()," ",v.jsx(xq,{mx:"2px"})]}):v.jsx(fn,{overflowY:"scroll",wordBreak:"break-all",children:t.toString()})]})]}),kEe=(e,t)=>e.image.uuid===t.image.uuid,MP=w.memo(({image:e,styleClass:t})=>{var V,K;const n=Ie();Qe("esc",()=>{n(HU(!1))});const r=((V=e==null?void 0:e.metadata)==null?void 0:V.image)||{},i=e==null?void 0:e.dreamPrompt,{cfg_scale:o,fit:a,height:s,hires_fix:l,init_image_path:u,mask_image_path:d,orig_path:h,perlin:m,postprocessing:y,prompt:b,sampler:S,scale:E,seamless:k,seed:_,steps:T,strength:A,threshold:I,type:R,variations:D,width:j}=r,z=JSON.stringify(e.metadata,null,2);return v.jsx("div",{className:`image-metadata-viewer ${t}`,children:v.jsxs(qe,{gap:1,direction:"column",width:"100%",children:[v.jsxs(qe,{gap:2,children:[v.jsx(fn,{fontWeight:"semibold",children:"File:"}),v.jsxs(Nh,{href:e.url,isExternal:!0,maxW:"calc(100% - 3rem)",children:[e.url.length>64?e.url.substring(0,64).concat("..."):e.url,v.jsx(xq,{mx:"2px"})]})]}),Object.keys(r).length>0?v.jsxs(v.Fragment,{children:[R&&v.jsx(zn,{label:"Generation type",value:R}),((K=e.metadata)==null?void 0:K.model_weights)&&v.jsx(zn,{label:"Model",value:e.metadata.model_weights}),["esrgan","gfpgan"].includes(R)&&v.jsx(zn,{label:"Original image",value:h}),R==="gfpgan"&&A!==void 0&&v.jsx(zn,{label:"Fix faces strength",value:A,onClick:()=>n(I4(A))}),R==="esrgan"&&E!==void 0&&v.jsx(zn,{label:"Upscaling scale",value:E,onClick:()=>n(c8(E))}),R==="esrgan"&&A!==void 0&&v.jsx(zn,{label:"Upscaling strength",value:A,onClick:()=>n(d8(A))}),b&&v.jsx(zn,{label:"Prompt",labelPosition:"top",value:i2(b),onClick:()=>n(jx(b))}),_!==void 0&&v.jsx(zn,{label:"Seed",value:_,onClick:()=>n(Ny(_))}),I!==void 0&&v.jsx(zn,{label:"Noise Threshold",value:I,onClick:()=>n(vU(I))}),m!==void 0&&v.jsx(zn,{label:"Perlin Noise",value:m,onClick:()=>n(dU(m))}),S&&v.jsx(zn,{label:"Sampler",value:S,onClick:()=>n(fU(S))}),T&&v.jsx(zn,{label:"Steps",value:T,onClick:()=>n(mU(T))}),o!==void 0&&v.jsx(zn,{label:"CFG scale",value:o,onClick:()=>n(sU(o))}),D&&D.length>0&&v.jsx(zn,{label:"Seed-weight pairs",value:K5(D),onClick:()=>n(pU(K5(D)))}),k&&v.jsx(zn,{label:"Seamless",value:k,onClick:()=>n(hU(k))}),l&&v.jsx(zn,{label:"High Resolution Optimization",value:l,onClick:()=>n(lP(l))}),j&&v.jsx(zn,{label:"Width",value:j,onClick:()=>n(yU(j))}),s&&v.jsx(zn,{label:"Height",value:s,onClick:()=>n(lU(s))}),u&&v.jsx(zn,{label:"Initial image",value:u,isLink:!0,onClick:()=>n(k0(u))}),d&&v.jsx(zn,{label:"Mask image",value:d,isLink:!0,onClick:()=>n(cU(d))}),R==="img2img"&&A&&v.jsx(zn,{label:"Image to image strength",value:A,onClick:()=>n(u8(A))}),a&&v.jsx(zn,{label:"Image to image fit",value:a,onClick:()=>n(gU(a))}),y&&y.length>0&&v.jsxs(v.Fragment,{children:[v.jsx(Dh,{size:"sm",children:"Postprocessing"}),y.map((te,q)=>{if(te.type==="esrgan"){const{scale:F,strength:U}=te;return v.jsxs(qe,{pl:"2rem",gap:1,direction:"column",children:[v.jsx(fn,{size:"md",children:`${q+1}: Upscale (ESRGAN)`}),v.jsx(zn,{label:"Scale",value:F,onClick:()=>n(c8(F))}),v.jsx(zn,{label:"Strength",value:U,onClick:()=>n(d8(U))})]},q)}else if(te.type==="gfpgan"){const{strength:F}=te;return v.jsxs(qe,{pl:"2rem",gap:1,direction:"column",children:[v.jsx(fn,{size:"md",children:`${q+1}: Face restoration (GFPGAN)`}),v.jsx(zn,{label:"Strength",value:F,onClick:()=>{n(I4(F)),n(R4("gfpgan"))}})]},q)}else if(te.type==="codeformer"){const{strength:F,fidelity:U}=te;return v.jsxs(qe,{pl:"2rem",gap:1,direction:"column",children:[v.jsx(fn,{size:"md",children:`${q+1}: Face restoration (Codeformer)`}),v.jsx(zn,{label:"Strength",value:F,onClick:()=>{n(I4(F)),n(R4("codeformer"))}}),U&&v.jsx(zn,{label:"Fidelity",value:U,onClick:()=>{n(xU(U)),n(R4("codeformer"))}})]},q)}})]}),i&&v.jsx(zn,{withCopy:!0,label:"Dream Prompt",value:i}),v.jsxs(qe,{gap:2,direction:"column",children:[v.jsxs(qe,{gap:2,children:[v.jsx(lo,{label:"Copy metadata JSON",children:v.jsx(ss,{"aria-label":"Copy metadata JSON",icon:v.jsx(o0,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(z)})}),v.jsx(fn,{fontWeight:"semibold",children:"Metadata JSON:"})]}),v.jsx("div",{className:"image-json-viewer",children:v.jsx("pre",{children:z})})]})]}):v.jsx(u$,{width:"100%",pt:10,children:v.jsx(fn,{fontSize:"lg",fontWeight:"semibold",children:"No metadata available"})})]})})},kEe);MP.displayName="ImageMetadataViewer";const wq=ot([yp,mp],(e,t)=>{const{currentCategory:n,currentImage:r,intermediateImage:i}=e,{shouldShowImageDetails:o}=t,a=e.categories[r?r.category:"result"].images,s=a.findIndex(u=>{var d;return u.uuid===((d=e==null?void 0:e.currentImage)==null?void 0:d.uuid)}),l=a.length;return{imageToDisplay:i||r,isIntermediate:Boolean(i),viewerImageToDisplay:r,currentCategory:n,isOnFirstImage:s===0,isOnLastImage:!isNaN(s)&&s===l-1,shouldShowImageDetails:o,shouldShowPrevImageButton:s===0,shouldShowNextImageButton:!isNaN(s)&&s===l-1}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}});function EEe(){const e=Ie(),{isOnFirstImage:t,isOnLastImage:n,shouldShowImageDetails:r,imageToDisplay:i,isIntermediate:o}=he(wq),[a,s]=w.useState(!1),l=()=>{s(!0)},u=()=>{s(!1)},d=()=>{e(oP())},h=()=>{e(iP())};return v.jsxs("div",{className:"current-image-preview",children:[i&&v.jsx(XS,{src:i.url,width:i.width,height:i.height,style:{imageRendering:o?"pixelated":"initial"}}),!r&&v.jsxs("div",{className:"current-image-next-prev-buttons",children:[v.jsx("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!t&&v.jsx(ss,{"aria-label":"Previous image",icon:v.jsx(uq,{className:"next-prev-button"}),variant:"unstyled",onClick:d})}),v.jsx("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!n&&v.jsx(ss,{"aria-label":"Next image",icon:v.jsx(cq,{className:"next-prev-button"}),variant:"unstyled",onClick:h})})]}),r&&i&&v.jsx(MP,{image:i,styleClass:"current-image-metadata"})]})}var PEe=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},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)}}(),ni=globalThis&&globalThis.__assign||function(){return ni=Object.assign||function(e){for(var t,n=1,r=arguments.length;n"u"?void 0:Number(r),maxHeight:typeof i>"u"?void 0:Number(i),minWidth:typeof o>"u"?void 0:Number(o),minHeight:typeof a>"u"?void 0:Number(a)}},REe=["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"],xD="__resizable_base__",Cq=function(e){AEe(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 i=r.parentNode;if(!i)return null;var o=r.window.document.createElement("div");return o.style.width="100%",o.style.height="100%",o.style.position="absolute",o.style.transform="scale(0, 0)",o.style.left="0",o.style.flex="0 0 100%",o.classList?o.classList.add(xD):o.className+=xD,i.appendChild(o),o},r.removeBase=function(i){var o=r.parentNode;o&&o.removeChild(i)},r.ref=function(i){i&&(r.resizable=i)},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||OEe},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var n=0,r=0;if(this.resizable&&this.window){var i=this.resizable.offsetWidth,o=this.resizable.offsetHeight,a=this.resizable.style.position;a!=="relative"&&(this.resizable.style.position="relative"),n=this.resizable.style.width!=="auto"?this.resizable.offsetWidth:i,r=this.resizable.style.height!=="auto"?this.resizable.offsetHeight:o,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,i=function(s){if(typeof n.state[s]>"u"||n.state[s]==="auto")return"auto";if(n.propsSize&&n.propsSize[s]&&n.propsSize[s].toString().endsWith("%")){if(n.state[s].toString().endsWith("%"))return n.state[s].toString();var l=n.getParentSize(),u=Number(n.state[s].toString().replace("px","")),d=u/l[s]*100;return d+"%"}return DC(n.state[s])},o=r&&typeof r.width<"u"&&!this.state.isResizing?DC(r.width):i("width"),a=r&&typeof r.height<"u"&&!this.state.isResizing?DC(r.height):i("height");return{width:o,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,i=this.parentNode.style.flexWrap;i!=="wrap"&&(r=!0,this.parentNode.style.flexWrap="wrap"),n.style.position="relative",n.style.minWidth="100%",n.style.minHeight="100%";var o={width:n.offsetWidth,height:n.offsetHeight};return r&&(this.parentNode.style.flexWrap=i),this.removeBase(n),o},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 i=this.propsSize&&this.propsSize[r];return this.state[r]==="auto"&&this.state.original[r]===n&&(typeof i>"u"||i==="auto")?"auto":n},t.prototype.calculateNewMaxFromBoundary=function(n,r){var i=this.props.boundsByDirection,o=this.state.direction,a=i&&Ng("left",o),s=i&&Ng("top",o),l,u;if(this.props.bounds==="parent"){var d=this.parentNode;d&&(l=a?this.resizableRight-this.parentLeft:d.offsetWidth+(this.parentLeft-this.resizableLeft),u=s?this.resizableBottom-this.parentTop:d.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(l=a?this.resizableRight:this.window.innerWidth-this.resizableLeft,u=s?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(l=a?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),u=s?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return l&&Number.isFinite(l)&&(n=n&&n"u"?10:o.width,h=typeof i.width>"u"||i.width<0?n:i.width,m=typeof o.height>"u"?10:o.height,y=typeof i.height>"u"||i.height<0?r:i.height,b=l||0,S=u||0;if(s){var E=(m-b)*this.ratio+S,k=(y-b)*this.ratio+S,_=(d-S)/this.ratio+b,T=(h-S)/this.ratio+b,A=Math.max(d,E),I=Math.min(h,k),R=Math.max(m,_),D=Math.min(y,T);n=Wb(n,A,I),r=Wb(r,R,D)}else n=Wb(n,d,h),r=Wb(r,m,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 i=this.props.bounds.getBoundingClientRect();this.targetLeft=i.left,this.targetTop=i.top}if(this.resizable){var o=this.resizable.getBoundingClientRect(),a=o.left,s=o.top,l=o.right,u=o.bottom;this.resizableLeft=a,this.resizableRight=l,this.resizableTop=s,this.resizableBottom=u}},t.prototype.onResizeStart=function(n,r){if(!(!this.resizable||!this.window)){var i=0,o=0;if(n.nativeEvent&&MEe(n.nativeEvent)?(i=n.nativeEvent.clientX,o=n.nativeEvent.clientY):n.nativeEvent&&Ub(n.nativeEvent)&&(i=n.nativeEvent.touches[0].clientX,o=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 s,l=this.window.getComputedStyle(this.resizable);if(l.flexBasis!=="auto"){var u=this.parentNode;if(u){var d=this.window.getComputedStyle(u).flexDirection;this.flexDir=d.startsWith("row")?"row":"column",s=l.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var h={original:{x:i,y:o,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:Nl(Nl({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(n.target).cursor||"auto"}),direction:r,flexBasis:s};this.setState(h)}},t.prototype.onMouseMove=function(n){var r=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&Ub(n))try{n.preventDefault(),n.stopPropagation()}catch{}var i=this.props,o=i.maxWidth,a=i.maxHeight,s=i.minWidth,l=i.minHeight,u=Ub(n)?n.touches[0].clientX:n.clientX,d=Ub(n)?n.touches[0].clientY:n.clientY,h=this.state,m=h.direction,y=h.original,b=h.width,S=h.height,E=this.getParentSize(),k=IEe(E,this.window.innerWidth,this.window.innerHeight,o,a,s,l);o=k.maxWidth,a=k.maxHeight,s=k.minWidth,l=k.minHeight;var _=this.calculateNewSizeFromDirection(u,d),T=_.newHeight,A=_.newWidth,I=this.calculateNewMaxFromBoundary(o,a);this.props.snap&&this.props.snap.x&&(A=SD(A,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(T=SD(T,this.props.snap.y,this.props.snapGap));var R=this.calculateNewSizeFromAspectRatio(A,T,{width:I.maxWidth,height:I.maxHeight},{width:s,height:l});if(A=R.newWidth,T=R.newHeight,this.props.grid){var D=bD(A,this.props.grid[0]),j=bD(T,this.props.grid[1]),z=this.props.snapGap||0;A=z===0||Math.abs(D-A)<=z?D:A,T=z===0||Math.abs(j-T)<=z?j:T}var V={width:A-y.width,height:T-y.height};if(b&&typeof b=="string"){if(b.endsWith("%")){var K=A/E.width*100;A=K+"%"}else if(b.endsWith("vw")){var te=A/this.window.innerWidth*100;A=te+"vw"}else if(b.endsWith("vh")){var q=A/this.window.innerHeight*100;A=q+"vh"}}if(S&&typeof S=="string"){if(S.endsWith("%")){var K=T/E.height*100;T=K+"%"}else if(S.endsWith("vw")){var te=T/this.window.innerWidth*100;T=te+"vw"}else if(S.endsWith("vh")){var q=T/this.window.innerHeight*100;T=q+"vh"}}var F={width:this.createSizeForCssProperty(A,"width"),height:this.createSizeForCssProperty(T,"height")};this.flexDir==="row"?F.flexBasis=F.width:this.flexDir==="column"&&(F.flexBasis=F.height),Qs.flushSync(function(){r.setState(F)}),this.props.onResize&&this.props.onResize(n,m,this.resizable,V)}},t.prototype.onMouseUp=function(n){var r=this.state,i=r.isResizing,o=r.direction,a=r.original;if(!(!i||!this.resizable)){var s={width:this.size.width-a.width,height:this.size.height-a.height};this.props.onResizeStop&&this.props.onResizeStop(n,o,this.resizable,s),this.props.size&&this.setState(this.props.size),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:Nl(Nl({},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,i=r.enable,o=r.handleStyles,a=r.handleClasses,s=r.handleWrapperStyle,l=r.handleWrapperClass,u=r.handleComponent;if(!i)return null;var d=Object.keys(i).map(function(h){return i[h]!==!1?w.createElement(LEe,{key:h,direction:h,onResizeStart:n.onResizeStart,replaceStyles:o&&o[h],className:a&&a[h]},u&&u[h]?u[h]:null):null});return w.createElement("div",{className:l,style:s},d)},t.prototype.render=function(){var n=this,r=Object.keys(this.props).reduce(function(a,s){return REe.indexOf(s)!==-1||(a[s]=n.props[s]),a},{}),i=Nl(Nl(Nl({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&&(i.flexBasis=this.state.flexBasis);var o=this.props.as||"div";return w.createElement(o,Nl({ref:this.ref,style:i,className:this.props.className},r),this.state.isResizing&&w.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}(w.PureComponent);const er=e=>{const{label:t,styleClass:n,...r}=e;return v.jsx(QF,{className:`invokeai__checkbox ${n}`,...r,children:t})};function _q(e){return gt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M21 11H6.414l5.293-5.293-1.414-1.414L2.586 12l7.707 7.707 1.414-1.414L6.414 13H21z"}}]})(e)}function DEe(e){return gt({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 Qx(e){return gt({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 NEe(e){return gt({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 jEe(e){return gt({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 BEe(e){return gt({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 FEe(e){return gt({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)}function na(e){const[t,n]=w.useState(!1),{label:r,value:i,min:o=1,max:a=100,step:s=1,onChange:l,width:u="100%",tooltipSuffix:d="",withSliderMarks:h=!1,sliderMarkLeftOffset:m=0,sliderMarkRightOffset:y=-7,withInput:b=!1,isInteger:S=!1,inputWidth:E="5.5rem",inputReadOnly:k=!1,withReset:_=!1,hideTooltip:T=!1,isCompact:A=!1,handleReset:I,isResetDisabled:R,isSliderDisabled:D,isInputDisabled:j,styleClass:z,sliderFormControlProps:V,sliderFormLabelProps:K,sliderMarkProps:te,sliderTrackProps:q,sliderThumbProps:F,sliderNumberInputProps:U,sliderNumberInputFieldProps:X,sliderNumberInputStepperProps:Z,sliderTooltipProps:W,sliderIAIIconButtonProps:Q,...ie}=e,[fe,Se]=w.useState(String(i));w.useEffect(()=>{Se(i)},[i]);const Te=w.useMemo(()=>U!=null&&U.max?U.max:a,[a,U==null?void 0:U.max]),ye=_e=>{l(_e)},He=_e=>{_e.target.value===""&&(_e.target.value=String(o));const lt=Ee.clamp(S?Math.floor(Number(_e.target.value)):Number(fe),o,Te);l(lt)},Ne=_e=>{Se(_e)},tt=()=>{I&&I()};return v.jsxs(dn,{className:z?`invokeai__slider-component ${z}`:"invokeai__slider-component","data-markers":h,style:A?{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"1rem",margin:0,padding:0}:{},...V,children:[v.jsx(kn,{className:"invokeai__slider-component-label",...K,children:r}),v.jsxs(wy,{w:"100%",gap:2,alignItems:"center",children:[v.jsxs(jE,{"aria-label":r,value:i,min:o,max:a,step:s,onChange:ye,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),focusThumbOnChange:!1,isDisabled:D,width:u,...ie,children:[h&&v.jsxs(v.Fragment,{children:[v.jsx(q9,{value:o,className:"invokeai__slider-mark invokeai__slider-mark-start",ml:m,...te,children:o}),v.jsx(q9,{value:a,className:"invokeai__slider-mark invokeai__slider-mark-end",ml:y,...te,children:a})]}),v.jsx(ZV,{className:"invokeai__slider_track",...q,children:v.jsx(QV,{className:"invokeai__slider_track-filled"})}),v.jsx(lo,{hasArrow:!0,className:"invokeai__slider-component-tooltip",placement:"top",isOpen:t,label:`${i}${d}`,hidden:T,...W,children:v.jsx(XV,{className:"invokeai__slider-thumb",...F})})]}),b&&v.jsxs(TE,{min:o,max:Te,step:s,value:fe,onChange:Ne,onBlur:He,className:"invokeai__slider-number-field",isDisabled:j,...U,children:[v.jsx(LE,{className:"invokeai__slider-number-input",width:E,readOnly:k,minWidth:E,...X}),v.jsxs(IV,{...Z,children:[v.jsx(OE,{onClick:()=>l(Number(fe)),className:"invokeai__slider-number-stepper"}),v.jsx(AE,{onClick:()=>l(Number(fe)),className:"invokeai__slider-number-stepper"})]})]}),_&&v.jsx(Ze,{size:"sm","aria-label":"Reset",tooltip:"Reset",icon:v.jsx(Qx,{}),onClick:tt,isDisabled:R,...Q})]})]})}function kq(e){return gt({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 Eq(e){return gt({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 $Ee(e){return gt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 19.59V8l-6-6H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c.45 0 .85-.15 1.19-.4l-4.43-4.43c-.8.52-1.74.83-2.76.83-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5c0 1.02-.31 1.96-.83 2.75L20 19.59zM9 13c0 1.66 1.34 3 3 3s3-1.34 3-3-1.34-3-3-3-3 1.34-3 3z"}}]})(e)}function zEe(e){return gt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"}}]})(e)}function HEe(e){return gt({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 VEe(e){return gt({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 Pq(e){return gt({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 WEe(e){return gt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"}}]})(e)}function UEe(e){return gt({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}}]})(e)}function GEe(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function qEe(e,t){e.classList?e.classList.add(t):GEe(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function wD(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function YEe(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=wD(e.className,t):e.setAttribute("class",wD(e.className&&e.className.baseVal||"",t))}const CD={disabled:!1},Tq=N.createContext(null);var Lq=function(t){return t.scrollTop},Mv="unmounted",ph="exited",gh="entering",zg="entered",N8="exiting",gc=function(e){yE(t,e);function t(r,i){var o;o=e.call(this,r,i)||this;var a=i,s=a&&!a.isMounting?r.enter:r.appear,l;return o.appearStatus=null,r.in?s?(l=ph,o.appearStatus=gh):l=zg:r.unmountOnExit||r.mountOnEnter?l=Mv:l=ph,o.state={status:l},o.nextCallback=null,o}t.getDerivedStateFromProps=function(i,o){var a=i.in;return a&&o.status===Mv?{status:ph}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var o=null;if(i!==this.props){var a=this.state.status;this.props.in?a!==gh&&a!==zg&&(o=gh):(a===gh||a===zg)&&(o=N8)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,o,a,s;return o=a=s=i,i!=null&&typeof i!="number"&&(o=i.exit,a=i.enter,s=i.appear!==void 0?i.appear:a),{exit:o,enter:a,appear:s}},n.updateStatus=function(i,o){if(i===void 0&&(i=!1),o!==null)if(this.cancelNextCallback(),o===gh){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:vb.findDOMNode(this);a&&Lq(a)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===ph&&this.setState({status:Mv})},n.performEnter=function(i){var o=this,a=this.props.enter,s=this.context?this.context.isMounting:i,l=this.props.nodeRef?[s]:[vb.findDOMNode(this),s],u=l[0],d=l[1],h=this.getTimeouts(),m=s?h.appear:h.enter;if(!i&&!a||CD.disabled){this.safeSetState({status:zg},function(){o.props.onEntered(u)});return}this.props.onEnter(u,d),this.safeSetState({status:gh},function(){o.props.onEntering(u,d),o.onTransitionEnd(m,function(){o.safeSetState({status:zg},function(){o.props.onEntered(u,d)})})})},n.performExit=function(){var i=this,o=this.props.exit,a=this.getTimeouts(),s=this.props.nodeRef?void 0:vb.findDOMNode(this);if(!o||CD.disabled){this.safeSetState({status:ph},function(){i.props.onExited(s)});return}this.props.onExit(s),this.safeSetState({status:N8},function(){i.props.onExiting(s),i.onTransitionEnd(a.exit,function(){i.safeSetState({status:ph},function(){i.props.onExited(s)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,o){o=this.setNextCallback(o),this.setState(i,o)},n.setNextCallback=function(i){var o=this,a=!0;return this.nextCallback=function(s){a&&(a=!1,o.nextCallback=null,i(s))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(i,o){this.setNextCallback(o);var a=this.props.nodeRef?this.props.nodeRef.current:vb.findDOMNode(this),s=i==null&&!this.props.addEndListener;if(!a||s){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],u=l[0],d=l[1];this.props.addEndListener(u,d)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===Mv)return null;var o=this.props,a=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var s=gE(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return N.createElement(Tq.Provider,{value:null},typeof a=="function"?a(i,s):N.cloneElement(N.Children.only(a),s))},t}(N.Component);gc.contextType=Tq;gc.propTypes={};function jg(){}gc.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:jg,onEntering:jg,onEntered:jg,onExit:jg,onExiting:jg,onExited:jg};gc.UNMOUNTED=Mv;gc.EXITED=ph;gc.ENTERING=gh;gc.ENTERED=zg;gc.EXITING=N8;const KEe=gc;var XEe=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return qEe(t,r)})},NC=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return YEe(t,r)})},IP=function(e){yE(t,e);function t(){for(var r,i=arguments.length,o=new Array(i),a=0;ab,Object.values(b));return w.createElement(S.Provider,{value:E},y)}function d(h,m){const y=(m==null?void 0:m[e][l])||s,b=w.useContext(y);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${h}\` must be used within \`${o}\``)}return u.displayName=o+"Provider",[u,d]}const i=()=>{const o=n.map(a=>w.createContext(a));return function(s){const l=(s==null?void 0:s[e])||o;return w.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[r,ZEe(i,...t)]}function ZEe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((s,{useScope:l,scopeName:u})=>{const h=l(o)[`__scope${u}`];return{...s,...h}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function QEe(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Oq(...e){return t=>e.forEach(n=>QEe(n,t))}function fs(...e){return w.useCallback(Oq(...e),e)}const oy=w.forwardRef((e,t)=>{const{children:n,...r}=e,i=w.Children.toArray(n),o=i.find(ePe);if(o){const a=o.props.children,s=i.map(l=>l===o?w.Children.count(a)>1?w.Children.only(null):w.isValidElement(a)?a.props.children:null:l);return w.createElement(j8,bn({},r,{ref:t}),w.isValidElement(a)?w.cloneElement(a,void 0,s):null)}return w.createElement(j8,bn({},r,{ref:t}),n)});oy.displayName="Slot";const j8=w.forwardRef((e,t)=>{const{children:n,...r}=e;return w.isValidElement(n)?w.cloneElement(n,{...tPe(r,n.props),ref:Oq(t,n.ref)}):w.Children.count(n)>1?w.Children.only(null):null});j8.displayName="SlotClone";const JEe=({children:e})=>w.createElement(w.Fragment,null,e);function ePe(e){return w.isValidElement(e)&&e.type===JEe}function tPe(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{o(...s),i(...s)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}const nPe=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],ac=nPe.reduce((e,t)=>{const n=w.forwardRef((r,i)=>{const{asChild:o,...a}=r,s=o?oy:t;return w.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),w.createElement(s,bn({},a,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Mq(e,t){e&&Qs.flushSync(()=>e.dispatchEvent(t))}function Iq(e){const t=e+"CollectionProvider",[n,r]=Hy(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=y=>{const{scope:b,children:S}=y,E=N.useRef(null),k=N.useRef(new Map).current;return N.createElement(i,{scope:b,itemMap:k,collectionRef:E},S)},s=e+"CollectionSlot",l=N.forwardRef((y,b)=>{const{scope:S,children:E}=y,k=o(s,S),_=fs(b,k.collectionRef);return N.createElement(oy,{ref:_},E)}),u=e+"CollectionItemSlot",d="data-radix-collection-item",h=N.forwardRef((y,b)=>{const{scope:S,children:E,...k}=y,_=N.useRef(null),T=fs(b,_),A=o(u,S);return N.useEffect(()=>(A.itemMap.set(_,{ref:_,...k}),()=>void A.itemMap.delete(_))),N.createElement(oy,{[d]:"",ref:T},E)});function m(y){const b=o(e+"CollectionConsumer",y);return N.useCallback(()=>{const E=b.collectionRef.current;if(!E)return[];const k=Array.from(E.querySelectorAll(`[${d}]`));return Array.from(b.itemMap.values()).sort((A,I)=>k.indexOf(A.ref.current)-k.indexOf(I.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:a,Slot:l,ItemSlot:h},m,r]}const rPe=w.createContext(void 0);function Rq(e){const t=w.useContext(rPe);return e||t||"ltr"}function uu(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function iPe(e,t=globalThis==null?void 0:globalThis.document){const n=uu(e);w.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const B8="dismissableLayer.update",oPe="dismissableLayer.pointerDownOutside",aPe="dismissableLayer.focusOutside";let _D;const sPe=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),lPe=w.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:s,onDismiss:l,...u}=e,d=w.useContext(sPe),[h,m]=w.useState(null),y=(n=h==null?void 0:h.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,b]=w.useState({}),S=fs(t,j=>m(j)),E=Array.from(d.layers),[k]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),_=E.indexOf(k),T=h?E.indexOf(h):-1,A=d.layersWithOutsidePointerEventsDisabled.size>0,I=T>=_,R=uPe(j=>{const z=j.target,V=[...d.branches].some(K=>K.contains(z));!I||V||(o==null||o(j),s==null||s(j),j.defaultPrevented||l==null||l())},y),D=cPe(j=>{const z=j.target;[...d.branches].some(K=>K.contains(z))||(a==null||a(j),s==null||s(j),j.defaultPrevented||l==null||l())},y);return iPe(j=>{T===d.layers.size-1&&(i==null||i(j),!j.defaultPrevented&&l&&(j.preventDefault(),l()))},y),w.useEffect(()=>{if(h)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(_D=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),kD(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=_D)}},[h,y,r,d]),w.useEffect(()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),kD())},[h,d]),w.useEffect(()=>{const j=()=>b({});return document.addEventListener(B8,j),()=>document.removeEventListener(B8,j)},[]),w.createElement(ac.div,bn({},u,{ref:S,style:{pointerEvents:A?I?"auto":"none":void 0,...e.style},onFocusCapture:rr(e.onFocusCapture,D.onFocusCapture),onBlurCapture:rr(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:rr(e.onPointerDownCapture,R.onPointerDownCapture)}))});function uPe(e,t=globalThis==null?void 0:globalThis.document){const n=uu(e),r=w.useRef(!1),i=w.useRef(()=>{});return w.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let u=function(){Dq(oPe,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=u,t.addEventListener("click",i.current,{once:!0})):u()}r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function cPe(e,t=globalThis==null?void 0:globalThis.document){const n=uu(e),r=w.useRef(!1);return w.useEffect(()=>{const i=o=>{o.target&&!r.current&&Dq(aPe,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function kD(){const e=new CustomEvent(B8);document.dispatchEvent(e)}function Dq(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Mq(i,o):i.dispatchEvent(o)}let jC=0;function dPe(){w.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:ED()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:ED()),jC++,()=>{jC===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),jC--}},[])}function ED(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}const BC="focusScope.autoFocusOnMount",FC="focusScope.autoFocusOnUnmount",PD={bubbles:!1,cancelable:!0},fPe=w.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[s,l]=w.useState(null),u=uu(i),d=uu(o),h=w.useRef(null),m=fs(t,S=>l(S)),y=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(r){let S=function(k){if(y.paused||!s)return;const _=k.target;s.contains(_)?h.current=_:mh(h.current,{select:!0})},E=function(k){y.paused||!s||s.contains(k.relatedTarget)||mh(h.current,{select:!0})};return document.addEventListener("focusin",S),document.addEventListener("focusout",E),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",E)}}},[r,s,y.paused]),w.useEffect(()=>{if(s){LD.add(y);const S=document.activeElement;if(!s.contains(S)){const k=new CustomEvent(BC,PD);s.addEventListener(BC,u),s.dispatchEvent(k),k.defaultPrevented||(hPe(yPe(Nq(s)),{select:!0}),document.activeElement===S&&mh(s))}return()=>{s.removeEventListener(BC,u),setTimeout(()=>{const k=new CustomEvent(FC,PD);s.addEventListener(FC,d),s.dispatchEvent(k),k.defaultPrevented||mh(S??document.body,{select:!0}),s.removeEventListener(FC,d),LD.remove(y)},0)}}},[s,u,d,y]);const b=w.useCallback(S=>{if(!n&&!r||y.paused)return;const E=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,k=document.activeElement;if(E&&k){const _=S.currentTarget,[T,A]=pPe(_);T&&A?!S.shiftKey&&k===A?(S.preventDefault(),n&&mh(T,{select:!0})):S.shiftKey&&k===T&&(S.preventDefault(),n&&mh(A,{select:!0})):k===_&&S.preventDefault()}},[n,r,y.paused]);return w.createElement(ac.div,bn({tabIndex:-1},a,{ref:m,onKeyDown:b}))});function hPe(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(mh(r,{select:t}),document.activeElement!==n)return}function pPe(e){const t=Nq(e),n=TD(t,e),r=TD(t.reverse(),e);return[n,r]}function Nq(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function TD(e,t){for(const n of e)if(!gPe(n,{upTo:t}))return n}function gPe(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function mPe(e){return e instanceof HTMLInputElement&&"select"in e}function mh(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&mPe(e)&&t&&e.select()}}const LD=vPe();function vPe(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=AD(e,t),e.unshift(t)},remove(t){var n;e=AD(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function AD(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function yPe(e){return e.filter(t=>t.tagName!=="A")}const a0=Boolean(globalThis==null?void 0:globalThis.document)?w.useLayoutEffect:()=>{},bPe=ZC["useId".toString()]||(()=>{});let SPe=0;function xPe(e){const[t,n]=w.useState(bPe());return a0(()=>{e||n(r=>r??String(SPe++))},[e]),e||(t?`radix-${t}`:"")}function A0(e){return e.split("-")[0]}function Jx(e){return e.split("-")[1]}function O0(e){return["top","bottom"].includes(A0(e))?"x":"y"}function RP(e){return e==="y"?"height":"width"}function OD(e,t,n){let{reference:r,floating:i}=e;const o=r.x+r.width/2-i.width/2,a=r.y+r.height/2-i.height/2,s=O0(t),l=RP(s),u=r[l]/2-i[l]/2,d=s==="x";let h;switch(A0(t)){case"top":h={x:o,y:r.y-i.height};break;case"bottom":h={x:o,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:a};break;case"left":h={x:r.x-i.width,y:a};break;default:h={x:r.x,y:r.y}}switch(Jx(t)){case"start":h[s]-=u*(n&&d?-1:1);break;case"end":h[s]+=u*(n&&d?-1:1)}return h}const wPe=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=await(a.isRTL==null?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=OD(l,r,s),h=r,m={},y=0;for(let b=0;b({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=e??{},{x:i,y:o,placement:a,rects:s,platform:l}=t;if(n==null)return{};const u=jq(r),d={x:i,y:o},h=O0(a),m=Jx(a),y=RP(h),b=await l.getDimensions(n),S=h==="y"?"top":"left",E=h==="y"?"bottom":"right",k=s.reference[y]+s.reference[h]-d[h]-s.floating[y],_=d[h]-s.reference[h],T=await(l.getOffsetParent==null?void 0:l.getOffsetParent(n));let A=T?h==="y"?T.clientHeight||0:T.clientWidth||0:0;A===0&&(A=s.floating[y]);const I=k/2-_/2,R=u[S],D=A-b[y]-u[E],j=A/2-b[y]/2+I,z=F8(R,j,D),V=(m==="start"?u[S]:u[E])>0&&j!==z&&s.reference[y]<=s.floating[y];return{[h]:d[h]-(V?jkPe[t])}function EPe(e,t,n){n===void 0&&(n=!1);const r=Jx(e),i=O0(e),o=RP(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=iS(a)),{main:a,cross:iS(a)}}const PPe={start:"end",end:"start"};function ID(e){return e.replace(/start|end/g,t=>PPe[t])}const Bq=["top","right","bottom","left"];Bq.reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);const TPe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:i,rects:o,initialPlacement:a,platform:s,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",flipAlignment:y=!0,...b}=e,S=A0(r),E=h||(S===a||!y?[iS(a)]:function(j){const z=iS(j);return[ID(j),z,ID(z)]}(a)),k=[a,...E],_=await rS(t,b),T=[];let A=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&T.push(_[S]),d){const{main:j,cross:z}=EPe(r,o,await(s.isRTL==null?void 0:s.isRTL(l.floating)));T.push(_[j],_[z])}if(A=[...A,{placement:r,overflows:T}],!T.every(j=>j<=0)){var I,R;const j=((I=(R=i.flip)==null?void 0:R.index)!=null?I:0)+1,z=k[j];if(z)return{data:{index:j,overflows:A},reset:{placement:z}};let V="bottom";switch(m){case"bestFit":{var D;const K=(D=A.map(te=>[te,te.overflows.filter(q=>q>0).reduce((q,F)=>q+F,0)]).sort((te,q)=>te[1]-q[1])[0])==null?void 0:D[0].placement;K&&(V=K);break}case"initialPlacement":V=a}if(r!==V)return{reset:{placement:V}}}return{}}}};function RD(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function DD(e){return Bq.some(t=>e[t]>=0)}const LPe=function(e){let{strategy:t="referenceHidden",...n}=e===void 0?{}:e;return{name:"hide",async fn(r){const{rects:i}=r;switch(t){case"referenceHidden":{const o=RD(await rS(r,{...n,elementContext:"reference"}),i.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:DD(o)}}}case"escaped":{const o=RD(await rS(r,{...n,altBoundary:!0}),i.floating);return{data:{escapedOffsets:o,escaped:DD(o)}}}default:return{}}}}},APe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await async function(o,a){const{placement:s,platform:l,elements:u}=o,d=await(l.isRTL==null?void 0:l.isRTL(u.floating)),h=A0(s),m=Jx(s),y=O0(s)==="x",b=["left","top"].includes(h)?-1:1,S=d&&y?-1:1,E=typeof a=="function"?a(o):a;let{mainAxis:k,crossAxis:_,alignmentAxis:T}=typeof E=="number"?{mainAxis:E,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...E};return m&&typeof T=="number"&&(_=m==="end"?-1*T:T),y?{x:_*S,y:k*b}:{x:k*b,y:_*S}}(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};function Fq(e){return e==="x"?"y":"x"}const OPe=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:E=>{let{x:k,y:_}=E;return{x:k,y:_}}},...l}=e,u={x:n,y:r},d=await rS(t,l),h=O0(A0(i)),m=Fq(h);let y=u[h],b=u[m];if(o){const E=h==="y"?"bottom":"right";y=F8(y+d[h==="y"?"top":"left"],y,y-d[E])}if(a){const E=m==="y"?"bottom":"right";b=F8(b+d[m==="y"?"top":"left"],b,b-d[E])}const S=s.fn({...t,[h]:y,[m]:b});return{...S,data:{x:S.x-n,y:S.y-r}}}}},MPe=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=e,d={x:n,y:r},h=O0(i),m=Fq(h);let y=d[h],b=d[m];const S=typeof s=="function"?s({...o,placement:i}):s,E=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(l){const I=h==="y"?"height":"width",R=o.reference[h]-o.floating[I]+E.mainAxis,D=o.reference[h]+o.reference[I]-E.mainAxis;yD&&(y=D)}if(u){var k,_,T,A;const I=h==="y"?"width":"height",R=["top","left"].includes(A0(i)),D=o.reference[m]-o.floating[I]+(R&&(k=(_=a.offset)==null?void 0:_[m])!=null?k:0)+(R?0:E.crossAxis),j=o.reference[m]+o.reference[I]+(R?0:(T=(A=a.offset)==null?void 0:A[m])!=null?T:0)-(R?E.crossAxis:0);bj&&(b=j)}return{[h]:y,[m]:b}}}};function $q(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function mc(e){if(e==null)return window;if(!$q(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function Vy(e){return mc(e).getComputedStyle(e)}function Xu(e){return $q(e)?"":e?(e.nodeName||"").toLowerCase():""}function zq(){const e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(t=>t.brand+"/"+t.version).join(" "):navigator.userAgent}function cu(e){return e instanceof mc(e).HTMLElement}function Jd(e){return e instanceof mc(e).Element}function DP(e){return typeof ShadowRoot>"u"?!1:e instanceof mc(e).ShadowRoot||e instanceof ShadowRoot}function ew(e){const{overflow:t,overflowX:n,overflowY:r}=Vy(e);return/auto|scroll|overlay|hidden/.test(t+r+n)}function IPe(e){return["table","td","th"].includes(Xu(e))}function ND(e){const t=/firefox/i.test(zq()),n=Vy(e);return n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].includes(n.willChange)||t&&n.willChange==="filter"||t&&!!n.filter&&n.filter!=="none"}function Hq(){return!/^((?!chrome|android).)*safari/i.test(zq())}const jD=Math.min,c2=Math.max,oS=Math.round;function Zu(e,t,n){var r,i,o,a;t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect();let l=1,u=1;t&&cu(e)&&(l=e.offsetWidth>0&&oS(s.width)/e.offsetWidth||1,u=e.offsetHeight>0&&oS(s.height)/e.offsetHeight||1);const d=Jd(e)?mc(e):window,h=!Hq()&&n,m=(s.left+(h&&(r=(i=d.visualViewport)==null?void 0:i.offsetLeft)!=null?r:0))/l,y=(s.top+(h&&(o=(a=d.visualViewport)==null?void 0:a.offsetTop)!=null?o:0))/u,b=s.width/l,S=s.height/u;return{width:b,height:S,top:y,right:m+b,bottom:y+S,left:m,x:m,y}}function zd(e){return(t=e,(t instanceof mc(t).Node?e.ownerDocument:e.document)||window.document).documentElement;var t}function tw(e){return Jd(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Vq(e){return Zu(zd(e)).left+tw(e).scrollLeft}function RPe(e,t,n){const r=cu(t),i=zd(t),o=Zu(e,r&&function(l){const u=Zu(l);return oS(u.width)!==l.offsetWidth||oS(u.height)!==l.offsetHeight}(t),n==="fixed");let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(r||!r&&n!=="fixed")if((Xu(t)!=="body"||ew(i))&&(a=tw(t)),cu(t)){const l=Zu(t,!0);s.x=l.x+t.clientLeft,s.y=l.y+t.clientTop}else i&&(s.x=Vq(i));return{x:o.left+a.scrollLeft-s.x,y:o.top+a.scrollTop-s.y,width:o.width,height:o.height}}function Wq(e){return Xu(e)==="html"?e:e.assignedSlot||e.parentNode||(DP(e)?e.host:null)||zd(e)}function BD(e){return cu(e)&&getComputedStyle(e).position!=="fixed"?e.offsetParent:null}function $8(e){const t=mc(e);let n=BD(e);for(;n&&IPe(n)&&getComputedStyle(n).position==="static";)n=BD(n);return n&&(Xu(n)==="html"||Xu(n)==="body"&&getComputedStyle(n).position==="static"&&!ND(n))?t:n||function(r){let i=Wq(r);for(DP(i)&&(i=i.host);cu(i)&&!["html","body"].includes(Xu(i));){if(ND(i))return i;i=i.parentNode}return null}(e)||t}function FD(e){if(cu(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=Zu(e);return{width:t.width,height:t.height}}function Uq(e){const t=Wq(e);return["html","body","#document"].includes(Xu(t))?e.ownerDocument.body:cu(t)&&ew(t)?t:Uq(t)}function aS(e,t){var n;t===void 0&&(t=[]);const r=Uq(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=mc(r),a=i?[o].concat(o.visualViewport||[],ew(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(aS(a))}function $D(e,t,n){return t==="viewport"?nS(function(r,i){const o=mc(r),a=zd(r),s=o.visualViewport;let l=a.clientWidth,u=a.clientHeight,d=0,h=0;if(s){l=s.width,u=s.height;const m=Hq();(m||!m&&i==="fixed")&&(d=s.offsetLeft,h=s.offsetTop)}return{width:l,height:u,x:d,y:h}}(e,n)):Jd(t)?function(r,i){const o=Zu(r,!1,i==="fixed"),a=o.top+r.clientTop,s=o.left+r.clientLeft;return{top:a,left:s,x:s,y:a,right:s+r.clientWidth,bottom:a+r.clientHeight,width:r.clientWidth,height:r.clientHeight}}(t,n):nS(function(r){var i;const o=zd(r),a=tw(r),s=(i=r.ownerDocument)==null?void 0:i.body,l=c2(o.scrollWidth,o.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),u=c2(o.scrollHeight,o.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0);let d=-a.scrollLeft+Vq(r);const h=-a.scrollTop;return Vy(s||o).direction==="rtl"&&(d+=c2(o.clientWidth,s?s.clientWidth:0)-l),{width:l,height:u,x:d,y:h}}(zd(e)))}function DPe(e){const t=aS(e),n=["absolute","fixed"].includes(Vy(e).position)&&cu(e)?$8(e):e;return Jd(n)?t.filter(r=>Jd(r)&&function(i,o){const a=o.getRootNode==null?void 0:o.getRootNode();if(i.contains(o))return!0;if(a&&DP(a)){let s=o;do{if(s&&i===s)return!0;s=s.parentNode||s.host}while(s)}return!1}(r,n)&&Xu(r)!=="body"):[]}const NPe={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?DPe(t):[].concat(n),r],a=o[0],s=o.reduce((l,u)=>{const d=$D(t,u,i);return l.top=c2(d.top,l.top),l.right=jD(d.right,l.right),l.bottom=jD(d.bottom,l.bottom),l.left=c2(d.left,l.left),l},$D(t,a,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=cu(n),o=zd(n);if(n===o)return t;let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if((i||!i&&r!=="fixed")&&((Xu(n)!=="body"||ew(o))&&(a=tw(n)),cu(n))){const l=Zu(n,!0);s.x=l.x+n.clientLeft,s.y=l.y+n.clientTop}return{...t,x:t.x-a.scrollLeft+s.x,y:t.y-a.scrollTop+s.y}},isElement:Jd,getDimensions:FD,getOffsetParent:$8,getDocumentElement:zd,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:RPe(t,$8(n),r),floating:{...FD(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>Vy(e).direction==="rtl"};function jPe(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=!0,animationFrame:s=!1}=r,l=i&&!s,u=o&&!s,d=l||u?[...Jd(e)?aS(e):[],...aS(t)]:[];d.forEach(b=>{l&&b.addEventListener("scroll",n,{passive:!0}),u&&b.addEventListener("resize",n)});let h,m=null;if(a){let b=!0;m=new ResizeObserver(()=>{b||n(),b=!1}),Jd(e)&&!s&&m.observe(e),m.observe(t)}let y=s?Zu(e):null;return s&&function b(){const S=Zu(e);!y||S.x===y.x&&S.y===y.y&&S.width===y.width&&S.height===y.height||n(),y=S,h=requestAnimationFrame(b)}(),n(),()=>{var b;d.forEach(S=>{l&&S.removeEventListener("scroll",n),u&&S.removeEventListener("resize",n)}),(b=m)==null||b.disconnect(),m=null,s&&cancelAnimationFrame(h)}}const BPe=(e,t,n)=>wPe(e,t,{platform:NPe,...n});var z8=typeof document<"u"?w.useLayoutEffect:w.useEffect;function H8(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,i;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(!H8(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!H8(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function FPe(e){const t=w.useRef(e);return z8(()=>{t.current=e}),t}function $Pe(e){let{middleware:t,placement:n="bottom",strategy:r="absolute",whileElementsMounted:i}=e===void 0?{}:e;const o=w.useRef(null),a=w.useRef(null),s=FPe(i),l=w.useRef(null),[u,d]=w.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{}}),[h,m]=w.useState(t);H8(h==null?void 0:h.map(T=>{let{options:A}=T;return A}),t==null?void 0:t.map(T=>{let{options:A}=T;return A}))||m(t);const y=w.useCallback(()=>{!o.current||!a.current||BPe(o.current,a.current,{middleware:h,placement:n,strategy:r}).then(T=>{b.current&&Qs.flushSync(()=>{d(T)})})},[h,n,r]);z8(()=>{b.current&&y()},[y]);const b=w.useRef(!1);z8(()=>(b.current=!0,()=>{b.current=!1}),[]);const S=w.useCallback(()=>{if(typeof l.current=="function"&&(l.current(),l.current=null),o.current&&a.current)if(s.current){const T=s.current(o.current,a.current,y);l.current=T}else y()},[y,s]),E=w.useCallback(T=>{o.current=T,S()},[S]),k=w.useCallback(T=>{a.current=T,S()},[S]),_=w.useMemo(()=>({reference:o,floating:a}),[]);return w.useMemo(()=>({...u,update:y,refs:_,reference:E,floating:k}),[u,y,_,E,k])}const zPe=e=>{const{element:t,padding:n}=e;function r(i){return Object.prototype.hasOwnProperty.call(i,"current")}return{name:"arrow",options:e,fn(i){return r(t)?t.current!=null?MD({element:t.current,padding:n}).fn(i):{}:t?MD({element:t,padding:n}).fn(i):{}}}};function HPe(e){const[t,n]=w.useState(void 0);return a0(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,s;if("borderBoxSize"in o){const l=o.borderBoxSize,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,s=u.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const Gq="Popper",[NP,qq]=Hy(Gq),[VPe,Yq]=NP(Gq),WPe=e=>{const{__scopePopper:t,children:n}=e,[r,i]=w.useState(null);return w.createElement(VPe,{scope:t,anchor:r,onAnchorChange:i},n)},UPe="PopperAnchor",GPe=w.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=Yq(UPe,n),a=w.useRef(null),s=fs(t,a);return w.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:w.createElement(ac.div,bn({},i,{ref:s}))}),sS="PopperContent",[qPe,wze]=NP(sS),[YPe,KPe]=NP(sS,{hasParent:!1,positionUpdateFns:new Set}),XPe=w.forwardRef((e,t)=>{var n,r,i,o,a,s,l,u;const{__scopePopper:d,side:h="bottom",sideOffset:m=0,align:y="center",alignOffset:b=0,arrowPadding:S=0,collisionBoundary:E=[],collisionPadding:k=0,sticky:_="partial",hideWhenDetached:T=!1,avoidCollisions:A=!0,...I}=e,R=Yq(sS,d),[D,j]=w.useState(null),z=fs(t,le=>j(le)),[V,K]=w.useState(null),te=HPe(V),q=(n=te==null?void 0:te.width)!==null&&n!==void 0?n:0,F=(r=te==null?void 0:te.height)!==null&&r!==void 0?r:0,U=h+(y!=="center"?"-"+y:""),X=typeof k=="number"?k:{top:0,right:0,bottom:0,left:0,...k},Z=Array.isArray(E)?E:[E],W=Z.length>0,Q={padding:X,boundary:Z.filter(QPe),altBoundary:W},{reference:ie,floating:fe,strategy:Se,x:Te,y:ye,placement:He,middlewareData:Ne,update:tt}=$Pe({strategy:"fixed",placement:U,whileElementsMounted:jPe,middleware:[APe({mainAxis:m+F,alignmentAxis:b}),A?OPe({mainAxis:!0,crossAxis:!1,limiter:_==="partial"?MPe():void 0,...Q}):void 0,V?zPe({element:V,padding:S}):void 0,A?TPe({...Q}):void 0,JPe({arrowWidth:q,arrowHeight:F}),T?LPe({strategy:"referenceHidden"}):void 0].filter(ZPe)});a0(()=>{ie(R.anchor)},[ie,R.anchor]);const _e=Te!==null&&ye!==null,[lt,wt]=Kq(He),ct=(i=Ne.arrow)===null||i===void 0?void 0:i.x,mt=(o=Ne.arrow)===null||o===void 0?void 0:o.y,St=((a=Ne.arrow)===null||a===void 0?void 0:a.centerOffset)!==0,[Ae,ut]=w.useState();a0(()=>{D&&ut(window.getComputedStyle(D).zIndex)},[D]);const{hasParent:Mt,positionUpdateFns:at}=KPe(sS,d),Ct=!Mt;w.useLayoutEffect(()=>{if(!Ct)return at.add(tt),()=>{at.delete(tt)}},[Ct,at,tt]),w.useLayoutEffect(()=>{Ct&&_e&&Array.from(at).reverse().forEach(le=>requestAnimationFrame(le))},[Ct,_e,at]);const Zt={"data-side":lt,"data-align":wt,...I,ref:z,style:{...I.style,animation:_e?void 0:"none",opacity:(s=Ne.hide)!==null&&s!==void 0&&s.referenceHidden?0:void 0}};return w.createElement("div",{ref:fe,"data-radix-popper-content-wrapper":"",style:{position:Se,left:0,top:0,transform:_e?`translate3d(${Math.round(Te)}px, ${Math.round(ye)}px, 0)`:"translate3d(0, -200%, 0)",minWidth:"max-content",zIndex:Ae,["--radix-popper-transform-origin"]:[(l=Ne.transformOrigin)===null||l===void 0?void 0:l.x,(u=Ne.transformOrigin)===null||u===void 0?void 0:u.y].join(" ")}},w.createElement(qPe,{scope:d,placedSide:lt,onArrowChange:K,arrowX:ct,arrowY:mt,shouldHideArrow:St},Ct?w.createElement(YPe,{scope:d,hasParent:!0,positionUpdateFns:at},w.createElement(ac.div,Zt)):w.createElement(ac.div,Zt)))});function ZPe(e){return e!==void 0}function QPe(e){return e!==null}const JPe=e=>({name:"transformOrigin",options:e,fn(t){var n,r,i,o,a;const{placement:s,rects:l,middlewareData:u}=t,h=((n=u.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,m=h?0:e.arrowWidth,y=h?0:e.arrowHeight,[b,S]=Kq(s),E={start:"0%",center:"50%",end:"100%"}[S],k=((r=(i=u.arrow)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)+m/2,_=((o=(a=u.arrow)===null||a===void 0?void 0:a.y)!==null&&o!==void 0?o:0)+y/2;let T="",A="";return b==="bottom"?(T=h?E:`${k}px`,A=`${-y}px`):b==="top"?(T=h?E:`${k}px`,A=`${l.floating.height+y}px`):b==="right"?(T=`${-y}px`,A=h?E:`${_}px`):b==="left"&&(T=`${l.floating.width+y}px`,A=h?E:`${_}px`),{data:{x:T,y:A}}}});function Kq(e){const[t,n="center"]=e.split("-");return[t,n]}const eTe=WPe,tTe=GPe,nTe=XPe;function rTe(e,t){return w.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const Xq=e=>{const{present:t,children:n}=e,r=iTe(t),i=typeof n=="function"?n({present:r.isPresent}):w.Children.only(n),o=fs(r.ref,i.ref);return typeof n=="function"||r.isPresent?w.cloneElement(i,{ref:o}):null};Xq.displayName="Presence";function iTe(e){const[t,n]=w.useState(),r=w.useRef({}),i=w.useRef(e),o=w.useRef("none"),a=e?"mounted":"unmounted",[s,l]=rTe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const u=qb(r.current);o.current=s==="mounted"?u:"none"},[s]),a0(()=>{const u=r.current,d=i.current;if(d!==e){const m=o.current,y=qb(u);e?l("MOUNT"):y==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&m!==y?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),a0(()=>{if(t){const u=h=>{const y=qb(r.current).includes(h.animationName);h.target===t&&y&&Qs.flushSync(()=>l("ANIMATION_END"))},d=h=>{h.target===t&&(o.current=qb(r.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:w.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function qb(e){return(e==null?void 0:e.animationName)||"none"}function oTe({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=aTe({defaultProp:t,onChange:n}),o=e!==void 0,a=o?e:r,s=uu(n),l=w.useCallback(u=>{if(o){const h=typeof u=="function"?u(e):u;h!==e&&s(h)}else i(u)},[o,e,i,s]);return[a,l]}function aTe({defaultProp:e,onChange:t}){const n=w.useState(e),[r]=n,i=w.useRef(r),o=uu(t);return w.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}const $C="rovingFocusGroup.onEntryFocus",sTe={bubbles:!1,cancelable:!0},jP="RovingFocusGroup",[V8,Zq,lTe]=Iq(jP),[uTe,Qq]=Hy(jP,[lTe]),[cTe,dTe]=uTe(jP),fTe=w.forwardRef((e,t)=>w.createElement(V8.Provider,{scope:e.__scopeRovingFocusGroup},w.createElement(V8.Slot,{scope:e.__scopeRovingFocusGroup},w.createElement(hTe,bn({},e,{ref:t}))))),hTe=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:u,...d}=e,h=w.useRef(null),m=fs(t,h),y=Rq(o),[b=null,S]=oTe({prop:a,defaultProp:s,onChange:l}),[E,k]=w.useState(!1),_=uu(u),T=Zq(n),A=w.useRef(!1),[I,R]=w.useState(0);return w.useEffect(()=>{const D=h.current;if(D)return D.addEventListener($C,_),()=>D.removeEventListener($C,_)},[_]),w.createElement(cTe,{scope:n,orientation:r,dir:y,loop:i,currentTabStopId:b,onItemFocus:w.useCallback(D=>S(D),[S]),onItemShiftTab:w.useCallback(()=>k(!0),[]),onFocusableItemAdd:w.useCallback(()=>R(D=>D+1),[]),onFocusableItemRemove:w.useCallback(()=>R(D=>D-1),[])},w.createElement(ac.div,bn({tabIndex:E||I===0?-1:0,"data-orientation":r},d,{ref:m,style:{outline:"none",...e.style},onMouseDown:rr(e.onMouseDown,()=>{A.current=!0}),onFocus:rr(e.onFocus,D=>{const j=!A.current;if(D.target===D.currentTarget&&j&&!E){const z=new CustomEvent($C,sTe);if(D.currentTarget.dispatchEvent(z),!z.defaultPrevented){const V=T().filter(U=>U.focusable),K=V.find(U=>U.active),te=V.find(U=>U.id===b),F=[K,te,...V].filter(Boolean).map(U=>U.ref.current);Jq(F)}}A.current=!1}),onBlur:rr(e.onBlur,()=>k(!1))})))}),pTe="RovingFocusGroupItem",gTe=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,...o}=e,a=xPe(),s=dTe(pTe,n),l=s.currentTabStopId===a,u=Zq(n),{onFocusableItemAdd:d,onFocusableItemRemove:h}=s;return w.useEffect(()=>{if(r)return d(),()=>h()},[r,d,h]),w.createElement(V8.ItemSlot,{scope:n,id:a,focusable:r,active:i},w.createElement(ac.span,bn({tabIndex:l?0:-1,"data-orientation":s.orientation},o,{ref:t,onMouseDown:rr(e.onMouseDown,m=>{r?s.onItemFocus(a):m.preventDefault()}),onFocus:rr(e.onFocus,()=>s.onItemFocus(a)),onKeyDown:rr(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){s.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const y=yTe(m,s.orientation,s.dir);if(y!==void 0){m.preventDefault();let S=u().filter(E=>E.focusable).map(E=>E.ref.current);if(y==="last")S.reverse();else if(y==="prev"||y==="next"){y==="prev"&&S.reverse();const E=S.indexOf(m.currentTarget);S=s.loop?bTe(S,E+1):S.slice(E+1)}setTimeout(()=>Jq(S))}})})))}),mTe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function vTe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function yTe(e,t,n){const r=vTe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return mTe[r]}function Jq(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function bTe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const STe=fTe,xTe=gTe,wTe=["Enter"," "],CTe=["ArrowDown","PageUp","Home"],eY=["ArrowUp","PageDown","End"],_Te=[...CTe,...eY],nw="Menu",[W8,kTe,ETe]=Iq(nw),[bp,tY]=Hy(nw,[ETe,qq,Qq]),BP=qq(),nY=Qq(),[PTe,rw]=bp(nw),[TTe,FP]=bp(nw),LTe=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:a=!0}=e,s=BP(t),[l,u]=w.useState(null),d=w.useRef(!1),h=uu(o),m=Rq(i);return w.useEffect(()=>{const y=()=>{d.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>d.current=!1;return document.addEventListener("keydown",y,{capture:!0}),()=>{document.removeEventListener("keydown",y,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),w.createElement(eTe,s,w.createElement(PTe,{scope:t,open:n,onOpenChange:h,content:l,onContentChange:u},w.createElement(TTe,{scope:t,onClose:w.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:d,dir:m,modal:a},r)))},ATe=w.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=BP(n);return w.createElement(tTe,bn({},i,r,{ref:t}))}),OTe="MenuPortal",[Cze,MTe]=bp(OTe,{forceMount:void 0}),Hd="MenuContent",[ITe,rY]=bp(Hd),RTe=w.forwardRef((e,t)=>{const n=MTe(Hd,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=rw(Hd,e.__scopeMenu),a=FP(Hd,e.__scopeMenu);return w.createElement(W8.Provider,{scope:e.__scopeMenu},w.createElement(Xq,{present:r||o.open},w.createElement(W8.Slot,{scope:e.__scopeMenu},a.modal?w.createElement(DTe,bn({},i,{ref:t})):w.createElement(NTe,bn({},i,{ref:t})))))}),DTe=w.forwardRef((e,t)=>{const n=rw(Hd,e.__scopeMenu),r=w.useRef(null),i=fs(t,r);return w.useEffect(()=>{const o=r.current;if(o)return zH(o)},[]),w.createElement(iY,bn({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:rr(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),NTe=w.forwardRef((e,t)=>{const n=rw(Hd,e.__scopeMenu);return w.createElement(iY,bn({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),iY=w.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:h,onDismiss:m,disableOutsideScroll:y,...b}=e,S=rw(Hd,n),E=FP(Hd,n),k=BP(n),_=nY(n),T=kTe(n),[A,I]=w.useState(null),R=w.useRef(null),D=fs(t,R,S.onContentChange),j=w.useRef(0),z=w.useRef(""),V=w.useRef(0),K=w.useRef(null),te=w.useRef("right"),q=w.useRef(0),F=y?PV:w.Fragment,U=y?{as:oy,allowPinchZoom:!0}:void 0,X=W=>{var Q,ie;const fe=z.current+W,Se=T().filter(_e=>!_e.disabled),Te=document.activeElement,ye=(Q=Se.find(_e=>_e.ref.current===Te))===null||Q===void 0?void 0:Q.textValue,He=Se.map(_e=>_e.textValue),Ne=UTe(He,fe,ye),tt=(ie=Se.find(_e=>_e.textValue===Ne))===null||ie===void 0?void 0:ie.ref.current;(function _e(lt){z.current=lt,window.clearTimeout(j.current),lt!==""&&(j.current=window.setTimeout(()=>_e(""),1e3))})(fe),tt&&setTimeout(()=>tt.focus())};w.useEffect(()=>()=>window.clearTimeout(j.current),[]),dPe();const Z=w.useCallback(W=>{var Q,ie;return te.current===((Q=K.current)===null||Q===void 0?void 0:Q.side)&&qTe(W,(ie=K.current)===null||ie===void 0?void 0:ie.area)},[]);return w.createElement(ITe,{scope:n,searchRef:z,onItemEnter:w.useCallback(W=>{Z(W)&&W.preventDefault()},[Z]),onItemLeave:w.useCallback(W=>{var Q;Z(W)||((Q=R.current)===null||Q===void 0||Q.focus(),I(null))},[Z]),onTriggerLeave:w.useCallback(W=>{Z(W)&&W.preventDefault()},[Z]),pointerGraceTimerRef:V,onPointerGraceIntentChange:w.useCallback(W=>{K.current=W},[])},w.createElement(F,U,w.createElement(fPe,{asChild:!0,trapped:i,onMountAutoFocus:rr(o,W=>{var Q;W.preventDefault(),(Q=R.current)===null||Q===void 0||Q.focus()}),onUnmountAutoFocus:a},w.createElement(lPe,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:h,onDismiss:m},w.createElement(STe,bn({asChild:!0},_,{dir:E.dir,orientation:"vertical",loop:r,currentTabStopId:A,onCurrentTabStopIdChange:I,onEntryFocus:W=>{E.isUsingKeyboardRef.current||W.preventDefault()}}),w.createElement(nTe,bn({role:"menu","aria-orientation":"vertical","data-state":HTe(S.open),"data-radix-menu-content":"",dir:E.dir},k,b,{ref:D,style:{outline:"none",...b.style},onKeyDown:rr(b.onKeyDown,W=>{const ie=W.target.closest("[data-radix-menu-content]")===W.currentTarget,fe=W.ctrlKey||W.altKey||W.metaKey,Se=W.key.length===1;ie&&(W.key==="Tab"&&W.preventDefault(),!fe&&Se&&X(W.key));const Te=R.current;if(W.target!==Te||!_Te.includes(W.key))return;W.preventDefault();const He=T().filter(Ne=>!Ne.disabled).map(Ne=>Ne.ref.current);eY.includes(W.key)&&He.reverse(),VTe(He)}),onBlur:rr(e.onBlur,W=>{W.currentTarget.contains(W.target)||(window.clearTimeout(j.current),z.current="")}),onPointerMove:rr(e.onPointerMove,G8(W=>{const Q=W.target,ie=q.current!==W.clientX;if(W.currentTarget.contains(Q)&&ie){const fe=W.clientX>q.current?"right":"left";te.current=fe,q.current=W.clientX}}))})))))))}),U8="MenuItem",zD="menu.itemSelect",jTe=w.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=w.useRef(null),a=FP(U8,e.__scopeMenu),s=rY(U8,e.__scopeMenu),l=fs(t,o),u=w.useRef(!1),d=()=>{const h=o.current;if(!n&&h){const m=new CustomEvent(zD,{bubbles:!0,cancelable:!0});h.addEventListener(zD,y=>r==null?void 0:r(y),{once:!0}),Mq(h,m),m.defaultPrevented?u.current=!1:a.onClose()}};return w.createElement(BTe,bn({},i,{ref:l,disabled:n,onClick:rr(e.onClick,d),onPointerDown:h=>{var m;(m=e.onPointerDown)===null||m===void 0||m.call(e,h),u.current=!0},onPointerUp:rr(e.onPointerUp,h=>{var m;u.current||(m=h.currentTarget)===null||m===void 0||m.click()}),onKeyDown:rr(e.onKeyDown,h=>{const m=s.searchRef.current!=="";n||m&&h.key===" "||wTe.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})}))}),BTe=w.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,a=rY(U8,n),s=nY(n),l=w.useRef(null),u=fs(t,l),[d,h]=w.useState(!1),[m,y]=w.useState("");return w.useEffect(()=>{const b=l.current;if(b){var S;y(((S=b.textContent)!==null&&S!==void 0?S:"").trim())}},[o.children]),w.createElement(W8.ItemSlot,{scope:n,disabled:r,textValue:i??m},w.createElement(xTe,bn({asChild:!0},s,{focusable:!r}),w.createElement(ac.div,bn({role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},o,{ref:u,onPointerMove:rr(e.onPointerMove,G8(b=>{r?a.onItemLeave(b):(a.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus())})),onPointerLeave:rr(e.onPointerLeave,G8(b=>a.onItemLeave(b))),onFocus:rr(e.onFocus,()=>h(!0)),onBlur:rr(e.onBlur,()=>h(!1))}))))}),FTe="MenuRadioGroup";bp(FTe,{value:void 0,onValueChange:()=>{}});const $Te="MenuItemIndicator";bp($Te,{checked:!1});const zTe="MenuSub";bp(zTe);function HTe(e){return e?"open":"closed"}function VTe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function WTe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function UTe(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=WTe(e,Math.max(o,0));i.length===1&&(a=a.filter(u=>u!==n));const l=a.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function GTe(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,a=t.length-1;or!=d>r&&n<(u-s)*(r-l)/(d-l)+s&&(i=!i)}return i}function qTe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return GTe(n,t)}function G8(e){return t=>t.pointerType==="mouse"?e(t):void 0}const YTe=LTe,KTe=ATe,XTe=RTe,ZTe=jTe,oY="ContextMenu",[QTe,_ze]=Hy(oY,[tY]),iw=tY(),[JTe,aY]=QTe(oY),eLe=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:i,modal:o=!0}=e,[a,s]=w.useState(!1),l=iw(t),u=uu(r),d=w.useCallback(h=>{s(h),u(h)},[u]);return w.createElement(JTe,{scope:t,open:a,onOpenChange:d,modal:o},w.createElement(YTe,bn({},l,{dir:i,open:a,onOpenChange:d,modal:o}),n))},tLe="ContextMenuTrigger",nLe=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=aY(tLe,n),o=iw(n),a=w.useRef({x:0,y:0}),s=w.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...a.current})}),l=w.useRef(0),u=w.useCallback(()=>window.clearTimeout(l.current),[]),d=h=>{a.current={x:h.clientX,y:h.clientY},i.onOpenChange(!0)};return w.useEffect(()=>u,[u]),w.createElement(w.Fragment,null,w.createElement(KTe,bn({},o,{virtualRef:s})),w.createElement(ac.span,bn({"data-state":i.open?"open":"closed"},r,{ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:rr(e.onContextMenu,h=>{u(),d(h),h.preventDefault()}),onPointerDown:rr(e.onPointerDown,Yb(h=>{u(),l.current=window.setTimeout(()=>d(h),700)})),onPointerMove:rr(e.onPointerMove,Yb(u)),onPointerCancel:rr(e.onPointerCancel,Yb(u)),onPointerUp:rr(e.onPointerUp,Yb(u))})))}),rLe="ContextMenuContent",iLe=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=aY(rLe,n),o=iw(n),a=w.useRef(!1);return w.createElement(XTe,bn({},o,r,{ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:s=>{var l;(l=e.onCloseAutoFocus)===null||l===void 0||l.call(e,s),!s.defaultPrevented&&a.current&&s.preventDefault(),a.current=!1},onInteractOutside:s=>{var l;(l=e.onInteractOutside)===null||l===void 0||l.call(e,s),!s.defaultPrevented&&!i.modal&&(a.current=!0)},style:{...e.style,["--radix-context-menu-content-transform-origin"]:"var(--radix-popper-transform-origin)"}}))}),oLe=w.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=iw(n);return w.createElement(ZTe,bn({},i,r,{ref:t}))});function Yb(e){return t=>t.pointerType!=="mouse"?e(t):void 0}const aLe=eLe,sLe=nLe,lLe=iLe,ud=oLe,uLe=(e,t)=>e.image.uuid===t.image.uuid&&e.isSelected===t.isSelected,sY=w.memo(e=>{var te,q,F,U,X,Z,W,Q;const t=Ie(),{activeTabName:n,galleryImageObjectFit:r,galleryImageMinimumWidth:i,mayDeleteImage:o,shouldUseSingleGalleryColumn:a}=he(bEe),{image:s,isSelected:l}=e,{url:u,thumbnail:d,uuid:h,metadata:m}=s,[y,b]=w.useState(!1),S=Ry(),{t:E}=Ve(),k=()=>b(!0),_=()=>b(!1),T=()=>{var ie,fe;if(s.metadata){const[Se,Te]=aP((fe=(ie=s.metadata)==null?void 0:ie.image)==null?void 0:fe.prompt);Se&&t(jx(Se)),t(Q2(Te||""))}S({title:E("toast:promptSet"),status:"success",duration:2500,isClosable:!0})},A=()=>{s.metadata&&t(Ny(s.metadata.image.seed)),S({title:E("toast:seedSet"),status:"success",duration:2500,isClosable:!0})},I=()=>{t(k0(s)),n!=="img2img"&&t(qo("img2img")),S({title:E("toast:sentToImageToImage"),status:"success",duration:2500,isClosable:!0})},R=()=>{t(Nx(s)),t(Dx()),n!=="unifiedCanvas"&&t(qo("unifiedCanvas")),S({title:E("toast:sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0})},D=()=>{m&&t(aU(m)),S({title:E("toast:parametersSet"),status:"success",duration:2500,isClosable:!0})},j=async()=>{var ie;if((ie=m==null?void 0:m.image)!=null&&ie.init_image_path&&(await fetch(m.image.init_image_path)).ok){t(qo("img2img")),t(Xxe(m)),S({title:E("toast:initialImageSet"),status:"success",duration:2500,isClosable:!0});return}S({title:E("toast:initialImageNotSet"),description:E("toast:initialImageNotSetDesc"),status:"error",duration:2500,isClosable:!0})},z=()=>t(jI(s)),V=ie=>{ie.dataTransfer.setData("invokeai/imageUuid",h),ie.dataTransfer.effectAllowed="move"},K=()=>{t(jI(s))};return v.jsxs(aLe,{onOpenChange:ie=>{t(tU(ie))},children:[v.jsx(sLe,{children:v.jsxs(_o,{position:"relative",className:"hoverable-image",onMouseOver:k,onMouseOut:_,userSelect:"none",draggable:!0,onDragStart:V,children:[v.jsx(XS,{className:"hoverable-image-image",objectFit:a?"contain":r,rounded:"md",src:d||u,loading:"lazy"}),v.jsx("div",{className:"hoverable-image-content",onClick:z,children:l&&v.jsx(Da,{width:"50%",height:"50%",as:PP,className:"hoverable-image-check"})}),y&&i>=64&&v.jsx("div",{className:"hoverable-image-delete-button",children:v.jsx(tS,{image:s,children:v.jsx(ss,{"aria-label":E("parameters:deleteImage"),icon:v.jsx(gEe,{}),size:"xs",variant:"imageHoverIconButton",fontSize:14,isDisabled:!o})})})]},h)}),v.jsxs(lLe,{className:"hoverable-image-context-menu",sticky:"always",onInteractOutside:ie=>{ie.detail.originalEvent.preventDefault()},children:[v.jsx(ud,{onClickCapture:K,children:E("parameters:openInViewer")}),v.jsx(ud,{onClickCapture:T,disabled:((q=(te=s==null?void 0:s.metadata)==null?void 0:te.image)==null?void 0:q.prompt)===void 0,children:E("parameters:usePrompt")}),v.jsx(ud,{onClickCapture:A,disabled:((U=(F=s==null?void 0:s.metadata)==null?void 0:F.image)==null?void 0:U.seed)===void 0,children:E("parameters:useSeed")}),v.jsx(ud,{onClickCapture:D,disabled:!["txt2img","img2img"].includes((Z=(X=s==null?void 0:s.metadata)==null?void 0:X.image)==null?void 0:Z.type),children:E("parameters:useAll")}),v.jsx(ud,{onClickCapture:j,disabled:((Q=(W=s==null?void 0:s.metadata)==null?void 0:W.image)==null?void 0:Q.type)!=="img2img",children:E("parameters:useInitImg")}),v.jsx(ud,{onClickCapture:I,children:E("parameters:sendToImg2Img")}),v.jsx(ud,{onClickCapture:R,children:E("parameters:sendToUnifiedCanvas")}),v.jsx(ud,{"data-warning":!0,children:v.jsx(tS,{image:s,children:v.jsx("p",{children:E("parameters:deleteImage")})})})]})]})},uLe);sY.displayName="HoverableImage";const Kb=320,HD=40,cLe={txt2img:{galleryMinWidth:200,galleryMaxWidth:500},img2img:{galleryMinWidth:200,galleryMaxWidth:500},unifiedCanvas:{galleryMinWidth:200,galleryMaxWidth:200},nodes:{galleryMinWidth:200,galleryMaxWidth:500},postprocess:{galleryMinWidth:200,galleryMaxWidth:500},training:{galleryMinWidth:200,galleryMaxWidth:500}},VD=400;function lY(){const e=Ie(),{t}=Ve(),{images:n,currentCategory:r,currentImageUuid:i,shouldPinGallery:o,shouldShowGallery:a,galleryScrollPosition:s,galleryImageMinimumWidth:l,galleryGridTemplateColumns:u,activeTabName:d,galleryImageObjectFit:h,shouldHoldGalleryOpen:m,shouldAutoSwitchToNewImages:y,areMoreImagesAvailable:b,galleryWidth:S,isLightboxOpen:E,isStaging:k,shouldEnableResize:_,shouldUseSingleGalleryColumn:T}=he(yEe),{galleryMinWidth:A,galleryMaxWidth:I}=E?{galleryMinWidth:VD,galleryMaxWidth:VD}:cLe[d],[R,D]=w.useState(S>=Kb),[j,z]=w.useState(!1),[V,K]=w.useState(0),te=w.useRef(null),q=w.useRef(null),F=w.useRef(null);w.useEffect(()=>{S>=Kb&&D(!1)},[S]);const U=()=>{e(jxe(!o)),e(vi(!0))},X=()=>{a?W():Z()},Z=()=>{e(Bd(!0)),o&&e(vi(!0))},W=w.useCallback(()=>{e(Bd(!1)),e(tU(!1)),e(Bxe(q.current?q.current.scrollTop:0)),setTimeout(()=>o&&e(vi(!0)),400)},[e,o]),Q=()=>{e(R8(r))},ie=ye=>{e(rv(ye))},fe=()=>{m||(F.current=window.setTimeout(()=>W(),500))},Se=()=>{F.current&&window.clearTimeout(F.current)};Qe("g",()=>{X()},[a,o]),Qe("left",()=>{e(oP())},{enabled:!k||d!=="unifiedCanvas"},[k]),Qe("right",()=>{e(iP())},{enabled:!k||d!=="unifiedCanvas"},[k]),Qe("shift+g",()=>{U()},[o]),Qe("esc",()=>{e(Bd(!1))},{enabled:()=>!o,preventDefault:!0},[o]);const Te=32;return Qe("shift+up",()=>{if(l<256){const ye=Ee.clamp(l+Te,32,256);e(rv(ye))}},[l]),Qe("shift+down",()=>{if(l>32){const ye=Ee.clamp(l-Te,32,256);e(rv(ye))}},[l]),w.useEffect(()=>{q.current&&(q.current.scrollTop=s)},[s,a]),w.useEffect(()=>{function ye(He){!o&&te.current&&!te.current.contains(He.target)&&W()}return document.addEventListener("mousedown",ye),()=>{document.removeEventListener("mousedown",ye)}},[W,o]),v.jsx(Aq,{nodeRef:te,in:a||m,unmountOnExit:!0,timeout:200,classNames:"image-gallery-wrapper",children:v.jsxs("div",{className:"image-gallery-wrapper",style:{zIndex:o?1:100},"data-pinned":o,ref:te,onMouseLeave:o?void 0:fe,onMouseEnter:o?void 0:Se,onMouseOver:o?void 0:Se,children:[v.jsxs(Cq,{minWidth:A,maxWidth:o?I:window.innerWidth,className:"image-gallery-popup",handleStyles:{left:{width:"15px"}},enable:{left:_},size:{width:S,height:o?"100%":"100vh"},onResizeStart:(ye,He,Ne)=>{K(Ne.clientHeight),Ne.style.height=`${Ne.clientHeight}px`,o&&(Ne.style.position="fixed",Ne.style.right="1rem",z(!0))},onResizeStop:(ye,He,Ne,tt)=>{const _e=o?Ee.clamp(Number(S)+tt.width,A,Number(I)):Number(S)+tt.width;e(zxe(_e)),Ne.removeAttribute("data-resize-alert"),o&&(Ne.style.position="relative",Ne.style.removeProperty("right"),Ne.style.setProperty("height",o?"100%":"100vh"),z(!1),e(vi(!0)))},onResize:(ye,He,Ne,tt)=>{const _e=Ee.clamp(Number(S)+tt.width,A,Number(o?I:.95*window.innerWidth));_e>=Kb&&!R?D(!0):_e_e-HD&&e(rv(_e-HD)),o&&(_e>=I?Ne.setAttribute("data-resize-alert","true"):Ne.removeAttribute("data-resize-alert")),Ne.style.height=`${V}px`},children:[v.jsxs("div",{className:"image-gallery-header",children:[v.jsx(oo,{size:"sm",isAttached:!0,variant:"solid",className:"image-gallery-category-btn-group",children:R?v.jsxs(v.Fragment,{children:[v.jsx(cr,{size:"sm","data-selected":r==="result",onClick:()=>e(kb("result")),children:t("gallery:generations")}),v.jsx(cr,{size:"sm","data-selected":r==="user",onClick:()=>e(kb("user")),children:t("gallery:uploads")})]}):v.jsxs(v.Fragment,{children:[v.jsx(Ze,{"aria-label":t("gallery:showGenerations"),tooltip:t("gallery:showGenerations"),"data-selected":r==="result",icon:v.jsx(rEe,{}),onClick:()=>e(kb("result"))}),v.jsx(Ze,{"aria-label":t("gallery:showUploads"),tooltip:t("gallery:showUploads"),"data-selected":r==="user",icon:v.jsx(vEe,{}),onClick:()=>e(kb("user"))})]})}),v.jsxs("div",{className:"image-gallery-header-right-icons",children:[v.jsx(Zs,{isLazy:!0,trigger:"hover",placement:"left",triggerComponent:v.jsx(Ze,{size:"sm","aria-label":t("gallery:gallerySettings"),icon:v.jsx(OP,{}),className:"image-gallery-icon-btn",cursor:"pointer"}),children:v.jsxs("div",{className:"image-gallery-settings-popover",children:[v.jsxs("div",{children:[v.jsx(na,{value:l,onChange:ie,min:32,max:256,hideTooltip:!0,label:t("gallery:galleryImageSize")}),v.jsx(Ze,{size:"sm","aria-label":t("gallery:galleryImageResetSize"),tooltip:t("gallery:galleryImageResetSize"),onClick:()=>e(rv(64)),icon:v.jsx(Qx,{}),"data-selected":o,styleClass:"image-gallery-icon-btn"})]}),v.jsx("div",{children:v.jsx(er,{label:t("gallery:maintainAspectRatio"),isChecked:h==="contain",onChange:()=>e(Fxe(h==="contain"?"cover":"contain"))})}),v.jsx("div",{children:v.jsx(er,{label:t("gallery:autoSwitchNewImages"),isChecked:y,onChange:ye=>e($xe(ye.target.checked))})}),v.jsx("div",{children:v.jsx(er,{label:t("gallery:singleColumnLayout"),isChecked:T,onChange:ye=>e(Hxe(ye.target.checked))})})]})}),v.jsx(Ze,{size:"sm",className:"image-gallery-icon-btn","aria-label":t("gallery:pinGallery"),tooltip:`${t("gallery:pinGallery")} (Shift+G)`,onClick:U,icon:o?v.jsx(kq,{}):v.jsx(Eq,{})})]})]}),v.jsx("div",{className:"image-gallery-container",ref:q,children:n.length||b?v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"image-gallery",style:{gridTemplateColumns:u},children:n.map(ye=>{const{uuid:He}=ye,Ne=i===He;return v.jsx(sY,{image:ye,isSelected:Ne},He)})}),v.jsx(as,{onClick:Q,isDisabled:!b,className:"image-gallery-load-more-btn",children:t(b?"gallery:loadMore":"gallery:allImagesLoaded")})]}):v.jsxs("div",{className:"image-gallery-container-placeholder",children:[v.jsx(Pq,{}),v.jsx("p",{children:t("gallery:noImagesInGallery")})]})})]}),j&&v.jsx("div",{style:{width:`${S}px`,height:"100%"}})]})})}/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var q8=function(e,t){return q8=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},q8(e,t)};function dLe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");q8(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var ru=function(){return ru=Object.assign||function(t){for(var n,r=1,i=arguments.length;r=n?(r(o),e.animation=null):e.animation&&(r(u),requestAnimationFrame(e.animation))},requestAnimationFrame(e.animation)}}function pf(e,t,n,r){var i=PLe(t);if(!(!e.mounted||!i)){var o=e.setTransformState,a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY,d=t.scale-s,h=t.positionX-l,m=t.positionY-u;n===0?o(t.scale,t.positionX,t.positionY):dY(e,r,n,function(y){var b=s+d*y,S=l+h*y,E=u+m*y;o(b,S,E)})}}function PLe(e){var t=e.scale,n=e.positionX,r=e.positionY;return!(isNaN(t)||isNaN(n)||isNaN(r))}function TLe(e,t,n){var r=e.offsetWidth,i=e.offsetHeight,o=t.offsetWidth,a=t.offsetHeight,s=o*n,l=a*n,u=r-s,d=i-l;return{wrapperWidth:r,wrapperHeight:i,newContentWidth:s,newDiffWidth:u,newContentHeight:l,newDiffHeight:d}}var LLe=function(e,t,n,r,i,o,a){var s=e>t?n*(a?1:.5):0,l=r>i?o*(a?1:.5):0,u=e-t-s,d=s,h=r-i-l,m=l;return{minPositionX:u,maxPositionX:d,minPositionY:h,maxPositionY:m}},$P=function(e,t){var n=e.wrapperComponent,r=e.contentComponent,i=e.setup.centerZoomedOut;if(!n||!r)throw new Error("Components are not mounted");var o=TLe(n,r,t),a=o.wrapperWidth,s=o.wrapperHeight,l=o.newContentWidth,u=o.newDiffWidth,d=o.newContentHeight,h=o.newDiffHeight,m=LLe(a,l,u,s,d,h,Boolean(i));return m},s0=function(e,t){var n=$P(e,t);return e.bounds=n,n};function ow(e,t,n,r,i,o,a){var s=n.minPositionX,l=n.minPositionY,u=n.maxPositionX,d=n.maxPositionY,h=0,m=0;a&&(h=i,m=o);var y=Y8(e,s-h,u+h,r),b=Y8(t,l-m,d+m,r);return{x:y,y:b}}var Y8=function(e,t,n,r){return r?en?rs(n,2):rs(e,2):rs(e,2)};function aw(e,t,n,r,i,o){var a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY,d=r-s;if(typeof t!="number"||typeof n!="number")return console.error("Mouse X and Y position were not provided!"),{x:l,y:u};var h=l-t*d,m=u-n*d,y=ow(h,m,i,o,0,0,null);return y}function Wy(e,t,n,r,i){var o=i?r:0,a=t-o;return!isNaN(n)&&e>=n?n:!isNaN(t)&&e<=a?a:e}var UD=function(e,t){var n=e.setup.panning.excluded,r=e.isInitialized,i=e.wrapperComponent,o=t.target,a=i==null?void 0:i.contains(o),s=r&&o&&a;if(!s)return!1;var l=sw(o,n);return!l},GD=function(e){var t=e.isInitialized,n=e.isPanning,r=e.setup,i=r.panning.disabled,o=t&&n&&!i;return!!o},ALe=function(e,t){var n=e.transformState,r=n.positionX,i=n.positionY;e.isPanning=!0;var o=t.clientX,a=t.clientY;e.startCoords={x:o-r,y:a-i}},OLe=function(e,t){var n=t.touches,r=e.transformState,i=r.positionX,o=r.positionY;e.isPanning=!0;var a=n.length===1;if(a){var s=n[0].clientX,l=n[0].clientY;e.startCoords={x:s-i,y:l-o}}};function MLe(e){var t=e.transformState,n=t.positionX,r=t.positionY,i=t.scale,o=e.setup,a=o.disabled,s=o.limitToBounds,l=o.centerZoomedOut,u=e.wrapperComponent;if(!(a||!u||!e.bounds)){var d=e.bounds,h=d.maxPositionX,m=d.minPositionX,y=d.maxPositionY,b=d.minPositionY,S=n>h||ny||rh?u.offsetWidth:e.setup.minPositionX||0,_=r>y?u.offsetHeight:e.setup.minPositionY||0,T=aw(e,k,_,i,e.bounds,s||l),A=T.x,I=T.y;return{scale:i,positionX:S?A:n,positionY:E?I:r}}}function ILe(e,t,n,r,i){var o=e.setup.limitToBounds,a=e.wrapperComponent,s=e.bounds,l=e.transformState,u=l.scale,d=l.positionX,h=l.positionY,m=t!==d,y=n!==h,b=!m||!y;if(!(!a||b||!s)){var S=ow(t,n,s,o,r,i,a),E=S.x,k=S.y;e.setTransformState(u,E,k)}}var RLe=function(e,t,n){var r=e.startCoords,i=e.transformState,o=e.setup.panning,a=o.lockAxisX,s=o.lockAxisY,l=i.positionX,u=i.positionY;if(!r)return{x:l,y:u};var d=t-r.x,h=n-r.y,m=a?l:d,y=s?u:h;return{x:m,y}},lS=function(e,t){var n=e.setup,r=e.transformState,i=r.scale,o=n.minScale;return t>0&&i>=o?t:0},DLe=function(e){var t=e.mounted,n=e.setup,r=n.disabled,i=n.velocityAnimation,o=e.transformState.scale,a=i.disabled,s=!a||o>1||!r||t;return!!s},NLe=function(e){var t=e.mounted,n=e.velocity,r=e.bounds,i=e.setup,o=i.disabled,a=i.velocityAnimation,s=e.transformState.scale,l=a.disabled,u=!l||s>1||!o||t;return!(!u||!n||!r)};function jLe(e,t){var n=e.setup.velocityAnimation,r=n.equalToMove,i=n.animationTime,o=n.sensitivity;return r?i*t*o:i}function qD(e,t,n,r,i,o,a,s,l,u){if(i){if(t>a&&n>a){var d=a+(e-a)*u;return d>l?l:do?o:d}}return r?t:Y8(e,o,a,i)}function BLe(e,t){var n=1;return t?Math.min(n,e.offsetWidth/window.innerWidth):n}function FLe(e,t){var n=DLe(e);if(n){var r=e.lastMousePosition,i=e.velocityTime,o=e.setup,a=e.wrapperComponent,s=o.velocityAnimation.equalToMove,l=Date.now();if(r&&i&&a){var u=BLe(a,s),d=t.x-r.x,h=t.y-r.y,m=d/u,y=h/u,b=l-i,S=d*d+h*h,E=Math.sqrt(S)/b;e.velocity={velocityX:m,velocityY:y,total:E}}e.lastMousePosition=t,e.velocityTime=l}}function $Le(e){var t=e.velocity,n=e.bounds,r=e.setup,i=e.wrapperComponent,o=NLe(e);if(!(!o||!t||!n||!i)){var a=t.velocityX,s=t.velocityY,l=t.total,u=n.maxPositionX,d=n.minPositionX,h=n.maxPositionY,m=n.minPositionY,y=r.limitToBounds,b=r.alignmentAnimation,S=r.zoomAnimation,E=r.panning,k=E.lockAxisY,_=E.lockAxisX,T=S.animationType,A=b.sizeX,I=b.sizeY,R=b.velocityAlignmentTime,D=R,j=jLe(e,l),z=Math.max(j,D),V=lS(e,A),K=lS(e,I),te=V*i.offsetWidth/100,q=K*i.offsetHeight/100,F=u+te,U=d-te,X=h+q,Z=m-q,W=e.transformState,Q=new Date().getTime();dY(e,T,z,function(ie){var fe=e.transformState,Se=fe.scale,Te=fe.positionX,ye=fe.positionY,He=new Date().getTime()-Q,Ne=He/D,tt=uY[b.animationType],_e=1-tt(Math.min(1,Ne)),lt=1-ie,wt=Te+a*lt,ct=ye+s*lt,mt=qD(wt,W.positionX,Te,_,y,d,u,U,F,_e),St=qD(ct,W.positionY,ye,k,y,m,h,Z,X,_e);(Te!==wt||ye!==ct)&&e.setTransformState(Se,mt,St)})}}function YD(e,t){var n=e.transformState.scale;Vl(e),s0(e,n),t.touches?OLe(e,t):ALe(e,t)}function KD(e,t,n){var r=e.startCoords,i=e.setup,o=i.alignmentAnimation,a=o.sizeX,s=o.sizeY;if(r){var l=RLe(e,t,n),u=l.x,d=l.y,h=lS(e,a),m=lS(e,s);FLe(e,{x:u,y:d}),ILe(e,u,d,h,m)}}function zLe(e){if(e.isPanning){var t=e.setup.panning.velocityDisabled,n=e.velocity,r=e.wrapperComponent,i=e.contentComponent;e.isPanning=!1,e.animate=!1,e.animation=null;var o=r==null?void 0:r.getBoundingClientRect(),a=i==null?void 0:i.getBoundingClientRect(),s=(o==null?void 0:o.width)||0,l=(o==null?void 0:o.height)||0,u=(a==null?void 0:a.width)||0,d=(a==null?void 0:a.height)||0,h=s.1&&h;m?$Le(e):fY(e)}}function fY(e){var t=e.transformState.scale,n=e.setup,r=n.minScale,i=n.alignmentAnimation,o=i.disabled,a=i.sizeX,s=i.sizeY,l=i.animationTime,u=i.animationType,d=o||t=a;if((r>=1||s)&&fY(e),!(m||!i||!e.mounted)){var y=t||i.offsetWidth/2,b=n||i.offsetHeight/2,S=zP(e,a,y,b);S&&pf(e,S,d,h)}}function zP(e,t,n,r){var i=e.setup,o=i.minScale,a=i.maxScale,s=i.limitToBounds,l=Wy(rs(t,2),o,a,0,!1),u=s0(e,l),d=aw(e,n,r,l,u,s),h=d.x,m=d.y;return{scale:l,positionX:h,positionY:m}}var dm={previousScale:1,scale:1,positionX:0,positionY:0},HLe=ru(ru({},dm),{setComponents:function(){},contextInstance:null}),fv={disabled:!1,minPositionX:null,maxPositionX:null,minPositionY:null,maxPositionY:null,minScale:1,maxScale:8,limitToBounds:!0,centerZoomedOut:!1,centerOnInit:!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}},pY=function(e){var t,n,r,i;return{previousScale:(t=e.initialScale)!==null&&t!==void 0?t:dm.scale,scale:(n=e.initialScale)!==null&&n!==void 0?n:dm.scale,positionX:(r=e.initialPositionX)!==null&&r!==void 0?r:dm.positionX,positionY:(i=e.initialPositionY)!==null&&i!==void 0?i:dm.positionY}},XD=function(e){var t=ru({},fv);return Object.keys(e).forEach(function(n){var r=typeof e[n]<"u",i=typeof fv[n]<"u";if(i&&r){var o=Object.prototype.toString.call(fv[n]),a=o==="[object Object]",s=o==="[object Array]";a?t[n]=ru(ru({},fv[n]),e[n]):s?t[n]=WD(WD([],fv[n]),e[n]):t[n]=e[n]}}),t},gY=function(e,t,n){var r=e.transformState.scale,i=e.wrapperComponent,o=e.setup,a=o.maxScale,s=o.minScale,l=o.zoomAnimation,u=l.size;if(!i)throw new Error("Wrapper is not mounted");var d=r*Math.exp(t*n),h=Wy(rs(d,3),s,a,u,!1);return h};function mY(e,t,n,r,i){var o=e.wrapperComponent,a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY;if(!o)return console.error("No WrapperComponent found");var d=o.offsetWidth,h=o.offsetHeight,m=(d/2-l)/s,y=(h/2-u)/s,b=gY(e,t,n),S=zP(e,b,m,y);if(!S)return console.error("Error during zoom event. New transformation state was not calculated.");pf(e,S,r,i)}function vY(e,t,n){var r=e.setup,i=e.wrapperComponent,o=r.limitToBounds,a=pY(e.props),s=e.transformState,l=s.scale,u=s.positionX,d=s.positionY;if(i){var h=$P(e,a.scale),m=ow(a.positionX,a.positionY,h,o,0,0,i),y={scale:a.scale,positionX:m.x,positionY:m.y};l===a.scale&&u===a.positionX&&d===a.positionY||pf(e,y,t,n)}}function VLe(e,t,n){var r=e.wrapperComponent,i=e.setup,o=i.limitToBounds,a=i.minScale,s=i.maxScale;if(!r)return dm;var l=r.getBoundingClientRect(),u=WLe(t),d=u.x,h=u.y,m=t.offsetWidth,y=t.offsetHeight,b=r.offsetWidth/m,S=r.offsetHeight/y,E=Wy(n||Math.min(b,S),a,s,0,!1),k=(l.width-m*E)/2,_=(l.height-y*E)/2,T=(l.left-d)*E+k,A=(l.top-h)*E+_,I=$P(e,E),R=ow(T,A,I,o,0,0,r),D=R.x,j=R.y;return{positionX:D,positionY:j,scale:E}}function WLe(e){for(var t=e,n=0,r=0;t;)n+=t.offsetLeft,r+=t.offsetTop,t=t.offsetParent;return{x:n,y:r}}function ULe(e){if(e){if((e==null?void 0:e.offsetWidth)===void 0||(e==null?void 0:e.offsetHeight)===void 0)return console.error("Zoom node is not valid - it must contain offsetWidth and offsetHeight"),!1}else return console.error("Zoom node not found"),!1;return!0}var GLe=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),mY(e,1,t,n,r)}},qLe=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),mY(e,-1,t,n,r)}},YLe=function(e){return function(t,n,r,i,o){i===void 0&&(i=300),o===void 0&&(o="easeOut");var a=e.transformState,s=a.positionX,l=a.positionY,u=a.scale,d=e.wrapperComponent,h=e.contentComponent,m=e.setup.disabled;if(!(m||!d||!h)){var y={positionX:isNaN(t)?s:t,positionY:isNaN(n)?l:n,scale:isNaN(r)?u:r};pf(e,y,i,o)}}},KLe=function(e){return function(t,n){t===void 0&&(t=200),n===void 0&&(n="easeOut"),vY(e,t,n)}},XLe=function(e){return function(t,n,r){n===void 0&&(n=200),r===void 0&&(r="easeOut");var i=e.transformState,o=e.wrapperComponent,a=e.contentComponent;if(o&&a){var s=yY(t||i.scale,o,a);pf(e,s,n,r)}}},ZLe=function(e){return function(t,n,r,i){r===void 0&&(r=600),i===void 0&&(i="easeOut"),Vl(e);var o=e.wrapperComponent,a=typeof t=="string"?document.getElementById(t):t;if(o&&ULe(a)&&a&&o.contains(a)){var s=VLe(e,a,n);pf(e,s,r,i)}}},ri=function(e){return{instance:e,state:e.transformState,zoomIn:GLe(e),zoomOut:qLe(e),setTransform:YLe(e),resetTransform:KLe(e),centerView:XLe(e),zoomToElement:ZLe(e)}},zC=!1;function HC(){try{var e={get passive(){return zC=!0,!1}};return e}catch{return zC=!1,zC}}var sw=function(e,t){var n=e.tagName.toUpperCase(),r=t.find(function(o){return o.toUpperCase()===n});if(r)return!0;var i=t.find(function(o){return e.classList.contains(o)});return!!i},ZD=function(e){e&&clearTimeout(e)},QLe=function(e,t,n){return"translate3d("+e+"px, "+t+"px, 0) scale("+n+")"},yY=function(e,t,n){var r=n.offsetWidth*e,i=n.offsetHeight*e,o=(t.offsetWidth-r)/2,a=(t.offsetHeight-i)/2;return{scale:e,positionX:o,positionY:a}},JLe=function(e,t){var n=e.setup.wheel,r=n.disabled,i=n.wheelDisabled,o=n.touchPadDisabled,a=n.excluded,s=e.isInitialized,l=e.isPanning,u=t.target,d=s&&!l&&!r&&u;if(!d||i&&!t.ctrlKey||o&&t.ctrlKey)return!1;var h=sw(u,a);return!h};function eAe(e,t){var n=e?e.deltaY<0?1:-1:0,r=fLe(t,n);return r}function bY(e,t,n){var r=t.getBoundingClientRect(),i=0,o=0;if("clientX"in e)i=(e.clientX-r.left)/n,o=(e.clientY-r.top)/n;else{var a=e.touches[0];i=(a.clientX-r.left)/n,o=(a.clientY-r.top)/n}return(isNaN(i)||isNaN(o))&&console.error("No mouse or touch offset found"),{x:i,y:o}}var tAe=function(e,t,n,r,i){var o=e.transformState.scale,a=e.wrapperComponent,s=e.setup,l=s.maxScale,u=s.minScale,d=s.zoomAnimation,h=d.size,m=d.disabled;if(!a)throw new Error("Wrapper is not mounted");var y=o+t*(o-o*n)*n;if(i)return y;var b=r?!1:!m,S=Wy(rs(y,3),u,l,h,b);return S},nAe=function(e,t){var n=e.previousWheelEvent,r=e.transformState.scale,i=e.setup,o=i.maxScale,a=i.minScale;return n?ra||Math.sign(n.deltaY)!==Math.sign(t.deltaY)||n.deltaY>0&&n.deltaYt.deltaY||Math.sign(n.deltaY)!==Math.sign(t.deltaY):!1},rAe=function(e,t){var n=e.setup.pinch,r=n.disabled,i=n.excluded,o=e.isInitialized,a=t.target,s=o&&!r&&a;if(!s)return!1;var l=sw(a,i);return!l},iAe=function(e){var t=e.setup.pinch.disabled,n=e.isInitialized,r=e.pinchStartDistance,i=n&&!t&&r;return!!i},oAe=function(e,t,n){var r=n.getBoundingClientRect(),i=e.touches,o=rs(i[0].clientX-r.left,5),a=rs(i[0].clientY-r.top,5),s=rs(i[1].clientX-r.left,5),l=rs(i[1].clientY-r.top,5);return{x:(o+s)/2/t,y:(a+l)/2/t}},SY=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))},aAe=function(e,t){var n=e.pinchStartScale,r=e.pinchStartDistance,i=e.setup,o=i.maxScale,a=i.minScale,s=i.zoomAnimation,l=s.size,u=s.disabled;if(!n||r===null||!t)throw new Error("Pinch touches distance was not provided");if(t<0)return e.transformState.scale;var d=t/r,h=d*n;return Wy(rs(h,2),a,o,l,!u)},sAe=160,lAe=100,uAe=function(e,t){var n=e.props,r=n.onWheelStart,i=n.onZoomStart;e.wheelStopEventTimer||(Vl(e),Pi(ri(e),t,r),Pi(ri(e),t,i))},cAe=function(e,t){var n=e.props,r=n.onWheel,i=n.onZoom,o=e.contentComponent,a=e.setup,s=e.transformState,l=s.scale,u=a.limitToBounds,d=a.centerZoomedOut,h=a.zoomAnimation,m=a.wheel,y=h.size,b=h.disabled,S=m.step;if(!o)throw new Error("Component not mounted");t.preventDefault(),t.stopPropagation();var E=eAe(t,null),k=tAe(e,E,S,!t.ctrlKey);if(l!==k){var _=s0(e,k),T=bY(t,o,l),A=b||y===0||d,I=u&&A,R=aw(e,T.x,T.y,k,_,I),D=R.x,j=R.y;e.previousWheelEvent=t,e.setTransformState(k,D,j),Pi(ri(e),t,r),Pi(ri(e),t,i)}},dAe=function(e,t){var n=e.props,r=n.onWheelStop,i=n.onZoomStop;ZD(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout(function(){e.mounted&&(hY(e,t.x,t.y),e.wheelAnimationTimer=null)},lAe);var o=nAe(e,t);o&&(ZD(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout(function(){e.mounted&&(e.wheelStopEventTimer=null,Pi(ri(e),t,r),Pi(ri(e),t,i))},sAe))},fAe=function(e,t){var n=SY(t);e.pinchStartDistance=n,e.lastDistance=n,e.pinchStartScale=e.transformState.scale,e.isPanning=!1,Vl(e)},hAe=function(e,t){var n=e.contentComponent,r=e.pinchStartDistance,i=e.transformState.scale,o=e.setup,a=o.limitToBounds,s=o.centerZoomedOut,l=o.zoomAnimation,u=l.disabled,d=l.size;if(!(r===null||!n)){var h=oAe(t,i,n);if(!(!isFinite(h.x)||!isFinite(h.y))){var m=SY(t),y=aAe(e,m);if(y!==i){var b=s0(e,y),S=u||d===0||s,E=a&&S,k=aw(e,h.x,h.y,y,b,E),_=k.x,T=k.y;e.pinchMidpoint=h,e.lastDistance=m,e.setTransformState(y,_,T)}}}},pAe=function(e){var t=e.pinchMidpoint;e.velocity=null,e.lastDistance=null,e.pinchMidpoint=null,e.pinchStartScale=null,e.pinchStartDistance=null,hY(e,t==null?void 0:t.x,t==null?void 0:t.y)};function gAe(e,t){var n=e.setup.doubleClick,r=n.disabled,i=n.mode,o=n.step,a=n.animationTime,s=n.animationType;if(!r){if(i==="reset")return vY(e,a,s);var l=e.transformState.scale,u=e.contentComponent;if(!u)return console.error("No ContentComponent found");var d=i==="zoomOut"?-1:1,h=gY(e,d,o),m=bY(t,u,l),y=zP(e,h,m.x,m.y);if(!y)return console.error("Error during zoom event. New transformation state was not calculated.");pf(e,y,a,s)}}var mAe=function(e,t){var n=e.isInitialized,r=e.setup,i=e.wrapperComponent,o=r.doubleClick,a=o.disabled,s=o.excluded,l=t.target,u=i==null?void 0:i.contains(l),d=n&&l&&u&&!a;if(!d)return!1;var h=sw(l,s);return!(h||!d)},xY=N.createContext(HLe),vAe=function(e){dLe(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.mounted=!0,n.transformState=pY(n.props),n.setup=XD(n.props),n.wrapperComponent=null,n.contentComponent=null,n.isInitialized=!1,n.bounds=null,n.previousWheelEvent=null,n.wheelStopEventTimer=null,n.wheelAnimationTimer=null,n.isPanning=!1,n.startCoords=null,n.lastTouch=null,n.distance=null,n.lastDistance=null,n.pinchStartDistance=null,n.pinchStartScale=null,n.pinchMidpoint=null,n.velocity=null,n.velocityTime=null,n.lastMousePosition=null,n.animate=!1,n.animation=null,n.maxBounds=null,n.pressedKeys={},n.handleInitializeWrapperEvents=function(r){var i=HC();r.addEventListener("wheel",n.onWheelZoom,i),r.addEventListener("dblclick",n.onDoubleClick,i),r.addEventListener("touchstart",n.onTouchPanningStart,i),r.addEventListener("touchmove",n.onTouchPanning,i),r.addEventListener("touchend",n.onTouchPanningStop,i)},n.handleInitialize=function(){var r=n.setup.centerOnInit;n.applyTransformation(),n.forceUpdate(),r&&(setTimeout(function(){n.mounted&&n.setCenter()},50),setTimeout(function(){n.mounted&&n.setCenter()},100),setTimeout(function(){n.mounted&&n.setCenter()},200))},n.onWheelZoom=function(r){var i=n.setup.disabled;if(!i){var o=JLe(n,r);if(o){var a=n.isPressingKeys(n.setup.wheel.activationKeys);a&&(uAe(n,r),cAe(n,r),dAe(n,r))}}},n.onPanningStart=function(r){var i=n.setup.disabled,o=n.props.onPanningStart;if(!i){var a=UD(n,r);if(a){var s=n.isPressingKeys(n.setup.panning.activationKeys);s&&(r.preventDefault(),r.stopPropagation(),Vl(n),YD(n,r),Pi(ri(n),r,o))}}},n.onPanning=function(r){var i=n.setup.disabled,o=n.props.onPanning;if(!i){var a=GD(n);if(a){var s=n.isPressingKeys(n.setup.panning.activationKeys);s&&(r.preventDefault(),r.stopPropagation(),KD(n,r.clientX,r.clientY),Pi(ri(n),r,o))}}},n.onPanningStop=function(r){var i=n.props.onPanningStop;n.isPanning&&(zLe(n),Pi(ri(n),r,i))},n.onPinchStart=function(r){var i=n.setup.disabled,o=n.props,a=o.onPinchingStart,s=o.onZoomStart;if(!i){var l=rAe(n,r);l&&(fAe(n,r),Vl(n),Pi(ri(n),r,a),Pi(ri(n),r,s))}},n.onPinch=function(r){var i=n.setup.disabled,o=n.props,a=o.onPinching,s=o.onZoom;if(!i){var l=iAe(n);l&&(r.preventDefault(),r.stopPropagation(),hAe(n,r),Pi(ri(n),r,a),Pi(ri(n),r,s))}},n.onPinchStop=function(r){var i=n.props,o=i.onPinchingStop,a=i.onZoomStop;n.pinchStartScale&&(pAe(n),Pi(ri(n),r,o),Pi(ri(n),r,a))},n.onTouchPanningStart=function(r){var i=n.setup.disabled,o=n.props.onPanningStart;if(!i){var a=UD(n,r);if(a){var s=n.lastTouch&&+new Date-n.lastTouch<200;if(s&&r.touches.length===1)n.onDoubleClick(r);else{n.lastTouch=+new Date,Vl(n);var l=r.touches,u=l.length===1,d=l.length===2;u&&(Vl(n),YD(n,r),Pi(ri(n),r,o)),d&&n.onPinchStart(r)}}}},n.onTouchPanning=function(r){var i=n.setup.disabled,o=n.props.onPanning;if(n.isPanning&&r.touches.length===1){if(i)return;var a=GD(n);if(!a)return;r.preventDefault(),r.stopPropagation();var s=r.touches[0];KD(n,s.clientX,s.clientY),Pi(ri(n),r,o)}else r.touches.length>1&&n.onPinch(r)},n.onTouchPanningStop=function(r){n.onPanningStop(r),n.onPinchStop(r)},n.onDoubleClick=function(r){var i=n.setup.disabled;if(!i){var o=mAe(n,r);o&&gAe(n,r)}},n.clearPanning=function(r){n.isPanning&&n.onPanningStop(r)},n.setKeyPressed=function(r){n.pressedKeys[r.key]=!0},n.setKeyUnPressed=function(r){n.pressedKeys[r.key]=!1},n.isPressingKeys=function(r){return r.length?Boolean(r.find(function(i){return n.pressedKeys[i]})):!0},n.setComponents=function(r,i){n.wrapperComponent=r,n.contentComponent=i,s0(n,n.transformState.scale),n.handleInitializeWrapperEvents(r),n.handleInitialize(),n.handleRef(),n.isInitialized=!0,Pi(ri(n),void 0,n.props.onInit)},n.setTransformState=function(r,i,o){!isNaN(r)&&!isNaN(i)&&!isNaN(o)?(r!==n.transformState.scale&&(n.transformState.previousScale=n.transformState.scale,n.transformState.scale=r),n.transformState.positionX=i,n.transformState.positionY=o,n.applyTransformation()):console.error("Detected NaN set state values")},n.setCenter=function(){if(n.wrapperComponent&&n.contentComponent){var r=yY(n.transformState.scale,n.wrapperComponent,n.contentComponent);n.setTransformState(r.scale,r.positionX,r.positionY)}},n.applyTransformation=function(){if(!(!n.mounted||!n.contentComponent)){var r=n.transformState,i=r.scale,o=r.positionX,a=r.positionY,s=QLe(o,a,i);n.contentComponent.style.transform=s,n.handleRef()}},n.handleRef=function(){n.props.setRef(ri(n))},n}return t.prototype.componentDidMount=function(){var n=HC();window.addEventListener("mousedown",this.onPanningStart,n),window.addEventListener("mousemove",this.onPanning,n),window.addEventListener("mouseup",this.onPanningStop,n),document.addEventListener("mouseleave",this.clearPanning,n),window.addEventListener("keyup",this.setKeyUnPressed,n),window.addEventListener("keydown",this.setKeyPressed,n),this.handleRef()},t.prototype.componentWillUnmount=function(){var n=HC();window.removeEventListener("mousedown",this.onPanningStart,n),window.removeEventListener("mousemove",this.onPanning,n),window.removeEventListener("mouseup",this.onPanningStop,n),window.removeEventListener("keyup",this.setKeyUnPressed,n),window.removeEventListener("keydown",this.setKeyPressed,n),Vl(this)},t.prototype.componentDidUpdate=function(n){n!==this.props&&(s0(this,this.transformState.scale),this.setup=XD(this.props))},t.prototype.render=function(){var n=ri(this),r=this.props.children,i=typeof r=="function"?r(n):r;return N.createElement(xY.Provider,{value:ru(ru({},this.transformState),{setComponents:this.setComponents,contextInstance:this})},i)},t}(w.Component),yAe=N.forwardRef(function(e,t){var n=w.useState(null),r=n[0],i=n[1];return w.useImperativeHandle(t,function(){return r},[r]),N.createElement(vAe,ru({},e,{setRef:i}))});function bAe(e,t){t===void 0&&(t={});var n=t.insertAt;if(!(!e||typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",n==="top"&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var SAe=`.transform-component-module_wrapper__1_Fgj { + 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__2jYgh { + 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__2jYgh img { + pointer-events: none; +} +`,QD={wrapper:"transform-component-module_wrapper__1_Fgj",content:"transform-component-module_content__2jYgh"};bAe(SAe);var xAe=function(e){var t=e.children,n=e.wrapperClass,r=n===void 0?"":n,i=e.contentClass,o=i===void 0?"":i,a=e.wrapperStyle,s=e.contentStyle,l=w.useContext(xY).setComponents,u=w.useRef(null),d=w.useRef(null);return w.useEffect(function(){var h=u.current,m=d.current;h!==null&&m!==null&&l&&l(h,m)},[]),N.createElement("div",{ref:u,className:"react-transform-wrapper "+QD.wrapper+" "+r,style:a},N.createElement("div",{ref:d,className:"react-transform-component "+QD.content+" "+o,style:s},t))};function wAe({image:e,alt:t,ref:n,styleClass:r}){const[i,o]=w.useState(0),[a,s]=w.useState(!1),l=()=>{o(i===-3?0:i-1)},u=()=>{o(i===3?0:i+1)},d=()=>{s(!a)};return v.jsx(yAe,{centerOnInit:!0,minScale:.1,initialPositionX:50,initialPositionY:50,children:({zoomIn:h,zoomOut:m,resetTransform:y,centerView:b})=>v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"lightbox-image-options",children:[v.jsx(Ze,{icon:v.jsx(BEe,{}),"aria-label":"Zoom In",tooltip:"Zoom In",onClick:()=>h(),fontSize:20}),v.jsx(Ze,{icon:v.jsx(FEe,{}),"aria-label":"Zoom Out",tooltip:"Zoom Out",onClick:()=>m(),fontSize:20}),v.jsx(Ze,{icon:v.jsx(NEe,{}),"aria-label":"Rotate Left",tooltip:"Rotate Left",onClick:l,fontSize:20}),v.jsx(Ze,{icon:v.jsx(jEe,{}),"aria-label":"Rotate Right",tooltip:"Rotate Right",onClick:u,fontSize:20}),v.jsx(Ze,{icon:v.jsx(VEe,{}),"aria-label":"Flip Image",tooltip:"Flip Image",onClick:d,fontSize:20}),v.jsx(Ze,{icon:v.jsx(Qx,{}),"aria-label":"Reset",tooltip:"Reset",onClick:()=>{y(),o(0),s(!1)},fontSize:20})]}),v.jsx(xAe,{wrapperStyle:{width:"100%",height:"100%"},children:v.jsx("img",{style:{transform:`rotate(${i*90}deg) scaleX(${a?-1:1})`,width:"100%"},src:e,alt:t,ref:n,className:r||"",onLoad:()=>b(1,0,"easeOut")})})]})})}function CAe(){const e=Ie(),t=he(m=>m.lightbox.isLightboxOpen),{viewerImageToDisplay:n,shouldShowImageDetails:r,isOnFirstImage:i,isOnLastImage:o}=he(wq),[a,s]=w.useState(!1),l=()=>{s(!0)},u=()=>{s(!1)},d=()=>{e(oP())},h=()=>{e(iP())};return Qe("Esc",()=>{t&&e(Bm(!1))},[t]),v.jsxs("div",{className:"lightbox-container",children:[v.jsx(Ze,{icon:v.jsx(DEe,{}),"aria-label":"Exit Viewer",className:"lightbox-close-btn",onClick:()=>{e(Bm(!1))},fontSize:20}),v.jsxs("div",{className:"lightbox-display-container",children:[v.jsxs("div",{className:"lightbox-preview-wrapper",children:[v.jsx(Sq,{}),!r&&v.jsxs("div",{className:"current-image-next-prev-buttons",children:[v.jsx("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!i&&v.jsx(ss,{"aria-label":"Previous image",icon:v.jsx(uq,{className:"next-prev-button"}),variant:"unstyled",onClick:d})}),v.jsx("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!o&&v.jsx(ss,{"aria-label":"Next image",icon:v.jsx(cq,{className:"next-prev-button"}),variant:"unstyled",onClick:h})})]}),n&&v.jsxs(v.Fragment,{children:[v.jsx(wAe,{image:n.url,styleClass:"lightbox-image"}),r&&v.jsx(MP,{image:n})]})]}),v.jsx(lY,{})]})]})}function _Ae(e){return gt({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M14 1H3L2 2v11l1 1h11l1-1V2l-1-1zM8 13H3V2h5v11zm6 0H9V2h5v11z"}}]})(e)}const kAe=ot(yp,e=>({resultImages:e.categories.result.images,userImages:e.categories.user.images})),EAe=()=>{const{resultImages:e,userImages:t}=he(kAe);return n=>{const r=e.find(o=>o.uuid===n);if(r)return r;const i=t.find(o=>o.uuid===n);if(i)return i}},PAe=ot([mp,Wx,Or],(e,t,n)=>{const{shouldShowDualDisplay:r,shouldPinParametersPanel:i}=e,{isLightboxOpen:o}=t;return{shouldShowDualDisplay:r,shouldPinParametersPanel:i,isLightboxOpen:o,shouldShowDualDisplayButton:["inpainting"].includes(n),activeTabName:n}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),HP=e=>{const t=Ie(),{optionsPanel:n,children:r,styleClass:i}=e,{activeTabName:o,shouldShowDualDisplay:a,isLightboxOpen:s,shouldShowDualDisplayButton:l}=he(PAe),u=EAe(),d=()=>{t(uCe(!a)),t(vi(!0))},h=m=>{const y=m.dataTransfer.getData("invokeai/imageUuid"),b=u(y);b&&(o==="img2img"?t(k0(b)):o==="unifiedCanvas"&&t(Nx(b)))};return v.jsx("div",{className:i?`workarea-wrapper ${i}`:"workarea-wrapper",children:v.jsxs("div",{className:"workarea-main",children:[n,v.jsxs("div",{className:"workarea-children-wrapper",onDrop:h,children:[r,l&&v.jsx(lo,{label:"Toggle Split View",children:v.jsx("div",{className:"workarea-split-button","data-selected":a,onClick:d,children:v.jsx(_Ae,{})})})]}),!s&&v.jsx(lY,{})]})})},TAe=e=>{const{styleClass:t}=e,n=w.useContext(SP),r=()=>{n&&n()};return v.jsx("div",{className:`image-uploader-button-outer ${t}`,onClick:r,children:v.jsxs("div",{className:"image-upload-button",children:[v.jsx(Zx,{}),v.jsx(Dh,{size:"lg",children:"Click or Drag and Drop"})]})})},LAe=ot([yp,mp,Or],(e,t,n)=>{const{currentImage:r,intermediateImage:i}=e,{shouldShowImageDetails:o}=t;return{activeTabName:n,shouldShowImageDetails:o,hasAnImageToDisplay:r||i}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),wY=()=>{const{hasAnImageToDisplay:e,activeTabName:t}=he(LAe);return v.jsx("div",{className:"current-image-area","data-tab-name":t,children:e?v.jsxs(v.Fragment,{children:[v.jsx(Sq,{}),v.jsx(EEe,{})]}):v.jsx("div",{className:"current-image-display-placeholder",children:v.jsx(WEe,{})})})},AAe=()=>{const e=w.useContext(SP);return v.jsx(Ze,{"aria-label":"Upload Image",tooltip:"Upload Image",icon:v.jsx(Zx,{}),onClick:e||void 0})};function OAe(){const e=he(o=>o.generation.initialImage),{t}=Ve(),n=Ie(),r=Ry(),i=()=>{r({title:t("toast:parametersFailed"),description:t("toast:parametersFailedDesc"),status:"error",isClosable:!0}),n(oU())};return v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"init-image-preview-header",children:[v.jsx("h2",{children:t("parameters:initialImage")}),v.jsx(AAe,{})]}),e&&v.jsx("div",{className:"init-image-preview",children:v.jsx(XS,{fit:"contain",maxWidth:"100%",maxHeight:"100%",src:typeof e=="string"?e:e.url,onError:i})})]})}const MAe=()=>{const e=he(r=>r.generation.initialImage),{currentImage:t}=he(r=>r.gallery),n=e?v.jsx("div",{className:"image-to-image-area",children:v.jsx(OAe,{})}):v.jsx(TAe,{});return v.jsxs("div",{className:"workarea-split-view",children:[v.jsx("div",{className:"workarea-split-view-left",children:n}),t&&v.jsx("div",{className:"workarea-split-view-right",children:v.jsx(wY,{})})]})};var ao=(e=>(e[e.PROMPT=0]="PROMPT",e[e.GALLERY=1]="GALLERY",e[e.OTHER=2]="OTHER",e[e.SEED=3]="SEED",e[e.VARIATIONS=4]="VARIATIONS",e[e.UPSCALE=5]="UPSCALE",e[e.FACE_CORRECTION=6]="FACE_CORRECTION",e[e.IMAGE_TO_IMAGE=7]="IMAGE_TO_IMAGE",e[e.BOUNDING_BOX=8]="BOUNDING_BOX",e[e.SEAM_CORRECTION=9]="SEAM_CORRECTION",e[e.INFILL_AND_SCALING=10]="INFILL_AND_SCALING",e))(ao||{});const IAe=()=>{const{t:e}=Ve();return w.useMemo(()=>({[0]:{text:e("tooltip:feature.prompt"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[1]:{text:e("tooltip:feature.gallery"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[2]:{text:e("tooltip:feature.other"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[3]:{text:e("tooltip:feature.seed"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[4]:{text:e("tooltip:feature.variations"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[5]:{text:e("tooltip:feature.upscale"),href:"link/to/docs/feature1.html",guideImage:"asset/path.gif"},[6]:{text:e("tooltip:feature.faceCorrection"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[7]:{text:e("tooltip:feature.imageToImage"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[8]:{text:e("tooltip:feature.boundingBox"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[9]:{text:e("tooltip:feature.seamCorrection"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[10]:{text:e("tooltip:feature.infillAndScaling"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}}),[e])},RAe=e=>IAe()[e],Vs=e=>{const{label:t,isDisabled:n=!1,width:r="auto",formControlProps:i,formLabelProps:o,styleClass:a,...s}=e;return v.jsxs(dn,{isDisabled:n,width:r,className:`invokeai__switch-form-control ${a}`,display:"flex",columnGap:"1rem",alignItems:"center",justifyContent:"space-between",...i,children:[v.jsx(kn,{className:"invokeai__switch-form-label",whiteSpace:"nowrap",marginRight:0,marginTop:.5,marginBottom:.5,fontSize:"sm",fontWeight:"bold",width:"auto",...o,children:t}),v.jsx(BE,{className:"invokeai__switch-root",...s})]})};function CY(){const e=he(i=>i.system.isGFPGANAvailable),t=he(i=>i.postprocessing.shouldRunFacetool),n=Ie(),r=i=>n(owe(i.target.checked));return v.jsx(Vs,{isDisabled:!e,isChecked:t,onChange:r})}function DAe(){const e=Ie(),t=he(i=>i.generation.shouldFitToWidthHeight),n=i=>e(gU(i.target.checked)),{t:r}=Ve();return v.jsx(Vs,{label:r("parameters:imageFit"),isChecked:t,onChange:n})}function _Y(e){const{t}=Ve(),{label:n=`${t("parameters:strength")}`,styleClass:r}=e,i=he(l=>l.generation.img2imgStrength),o=Ie(),a=l=>o(u8(l)),s=()=>{o(u8(.75))};return v.jsx(na,{label:n,step:.01,min:.01,max:.99,onChange:a,value:i,isInteger:!1,styleClass:r,withInput:!0,withSliderMarks:!0,inputWidth:"5.5rem",withReset:!0,handleReset:s})}const kY=()=>{const e=Ie(),t=he(i=>i.generation.seamless),n=i=>e(hU(i.target.checked)),{t:r}=Ve();return v.jsx(qe,{gap:2,direction:"column",children:v.jsx(Vs,{label:r("parameters:seamlessTiling"),fontSize:"md",isChecked:t,onChange:n})})},NAe=()=>v.jsx(qe,{gap:2,direction:"column",children:v.jsx(kY,{})});function jAe(){const e=Ie(),t=he(i=>i.generation.perlin),{t:n}=Ve(),r=i=>e(dU(i));return v.jsx(To,{label:n("parameters:perlinNoise"),min:0,max:1,step:.05,onChange:r,value:t,isInteger:!1})}function BAe(){const e=Ie(),{t}=Ve(),n=he(i=>i.generation.shouldRandomizeSeed),r=i=>e(Jxe(i.target.checked));return v.jsx(Vs,{label:t("parameters:randomizeSeed"),isChecked:n,onChange:r})}function FAe(){const e=he(a=>a.generation.seed),t=he(a=>a.generation.shouldRandomizeSeed),n=he(a=>a.generation.shouldGenerateVariations),{t:r}=Ve(),i=Ie(),o=a=>i(Ny(a));return v.jsx(To,{label:r("parameters:seed"),step:1,precision:0,flexGrow:1,min:hP,max:pP,isDisabled:t,isInvalid:e<0&&n,onChange:o,value:e,width:"auto"})}function $Ae(){const e=Ie(),t=he(i=>i.generation.shouldRandomizeSeed),{t:n}=Ve(),r=()=>e(Ny(zG(hP,pP)));return v.jsx(as,{size:"sm",isDisabled:t,onClick:r,padding:"0 1.5rem",children:v.jsx("p",{children:n("parameters:shuffle")})})}function zAe(){const e=Ie(),t=he(i=>i.generation.threshold),{t:n}=Ve(),r=i=>e(vU(i));return v.jsx(To,{label:n("parameters:noiseThreshold"),min:0,max:1e3,step:.1,onChange:r,value:t,isInteger:!1})}const VP=()=>v.jsxs(qe,{gap:2,direction:"column",children:[v.jsx(BAe,{}),v.jsxs(qe,{gap:2,children:[v.jsx(FAe,{}),v.jsx($Ae,{})]}),v.jsx(qe,{gap:2,children:v.jsx(zAe,{})}),v.jsx(qe,{gap:2,children:v.jsx(jAe,{})})]});function EY(){const e=he(i=>i.system.isESRGANAvailable),t=he(i=>i.postprocessing.shouldRunESRGAN),n=Ie(),r=i=>n(iwe(i.target.checked));return v.jsx(Vs,{isDisabled:!e,isChecked:t,onChange:r})}function WP(){const e=he(r=>r.generation.shouldGenerateVariations),t=Ie(),n=r=>t(Qxe(r.target.checked));return v.jsx(Vs,{isChecked:e,width:"auto",onChange:n})}function kr(e){const{label:t="",styleClass:n,isDisabled:r=!1,fontSize:i="sm",width:o,size:a="sm",isInvalid:s,...l}=e;return v.jsxs(dn,{className:`input ${n}`,isInvalid:s,isDisabled:r,children:[t!==""&&v.jsx(kn,{fontSize:i,fontWeight:"bold",alignItems:"center",whiteSpace:"nowrap",marginBottom:0,marginRight:0,className:"input-label",children:t}),v.jsx(hk,{...l,className:"input-entry",size:a,width:o})]})}function HAe(){const e=he(o=>o.generation.seedWeights),t=he(o=>o.generation.shouldGenerateVariations),{t:n}=Ve(),r=Ie(),i=o=>r(pU(o.target.value));return v.jsx(kr,{label:n("parameters:seedWeights"),value:e,isInvalid:t&&!(sP(e)||e===""),isDisabled:!t,onChange:i})}function VAe(){const e=he(o=>o.generation.variationAmount),t=he(o=>o.generation.shouldGenerateVariations),{t:n}=Ve(),r=Ie(),i=o=>r(ewe(o));return v.jsx(To,{label:n("parameters:variationAmount"),value:e,step:.01,min:0,max:1,isDisabled:!t,onChange:i,isInteger:!1})}const UP=()=>v.jsxs(qe,{gap:2,direction:"column",children:[v.jsx(VAe,{}),v.jsx(HAe,{})]});function WAe(){const e=Ie(),t=he(i=>i.generation.cfgScale),{t:n}=Ve(),r=i=>e(sU(i));return v.jsx(To,{label:n("parameters:cfgScale"),step:.5,min:1.01,max:200,onChange:r,value:t,width:"auto",styleClass:"main-settings-block",textAlign:"center",isInteger:!1})}function UAe(){const e=he(o=>o.generation.height),t=he(Or),n=Ie(),{t:r}=Ve(),i=o=>n(lU(Number(o.target.value)));return v.jsx(tl,{isDisabled:t==="unifiedCanvas",label:r("parameters:height"),value:e,flexGrow:1,onChange:i,validValues:r7e,styleClass:"main-settings-block"})}const GAe=ot([e=>e.generation],e=>{const{iterations:t}=e;return{iterations:t}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}});function qAe(){const e=Ie(),{iterations:t}=he(GAe),{t:n}=Ve(),r=i=>e(Zxe(i));return v.jsx(To,{label:n("parameters:images"),step:1,min:1,max:9999,onChange:r,value:t,width:"auto",labelFontSize:.5,styleClass:"main-settings-block",textAlign:"center"})}function YAe(){const e=he(o=>o.generation.sampler),t=he(GG),n=Ie(),{t:r}=Ve(),i=o=>n(fU(o.target.value));return v.jsx(tl,{label:r("parameters:sampler"),value:e,onChange:i,validValues:t.format==="diffusers"?t7e:e7e,styleClass:"main-settings-block"})}function KAe(){const e=Ie(),t=he(i=>i.generation.steps),{t:n}=Ve(),r=i=>e(mU(i));return v.jsx(To,{label:n("parameters:steps"),min:1,max:9999,step:1,onChange:r,value:t,width:"auto",styleClass:"main-settings-block",textAlign:"center"})}function XAe(){const e=he(o=>o.generation.width),t=he(Or),{t:n}=Ve(),r=Ie(),i=o=>r(yU(Number(o.target.value)));return v.jsx(tl,{isDisabled:t==="unifiedCanvas",label:n("parameters:width"),value:e,flexGrow:1,onChange:i,validValues:n7e,styleClass:"main-settings-block"})}function GP(){return v.jsx("div",{className:"main-settings",children:v.jsxs("div",{className:"main-settings-list",children:[v.jsxs("div",{className:"main-settings-row",children:[v.jsx(qAe,{}),v.jsx(KAe,{}),v.jsx(WAe,{})]}),v.jsxs("div",{className:"main-settings-row",children:[v.jsx(XAe,{}),v.jsx(UAe,{}),v.jsx(YAe,{})]})]})})}const ZAe=ot(ir,e=>e.shouldDisplayGuides),QAe=({children:e,feature:t})=>{const n=he(ZAe),{text:r}=RAe(t);return n?v.jsxs(ME,{trigger:"hover",children:[v.jsx(DE,{children:v.jsx(_o,{children:e})}),v.jsxs(RE,{className:"guide-popover-content",maxWidth:"400px",onClick:i=>i.preventDefault(),cursor:"initial",children:[v.jsx(IE,{className:"guide-popover-arrow"}),v.jsx("div",{className:"guide-popover-guide-content",children:r})]})]}):null},JAe=Oe(({feature:e,icon:t=zEe},n)=>v.jsx(QAe,{feature:e,children:v.jsx(_o,{ref:n,children:v.jsx(Da,{marginBottom:"-.15rem",as:t})})}));function eOe(e){const{header:t,feature:n,content:r,additionalHeaderComponents:i}=e;return v.jsxs(Gg,{className:"advanced-parameters-item",children:[v.jsx(Wg,{className:"advanced-parameters-header",children:v.jsxs(qe,{width:"100%",gap:"0.5rem",align:"center",children:[v.jsx(_o,{flexGrow:1,textAlign:"left",children:t}),i,n&&v.jsx(JAe,{feature:n}),v.jsx(Ug,{})]})}),v.jsx(qg,{className:"advanced-parameters-panel",children:r})]})}const qP=e=>{const{accordionInfo:t}=e,n=he(a=>a.system.openAccordions),r=Ie(),i=a=>r(U6e(a)),o=()=>{const a=[];return t&&Object.keys(t).forEach(s=>{const{header:l,feature:u,content:d,additionalHeaderComponents:h}=t[s];a.push(v.jsx(eOe,{header:l,feature:u,content:d,additionalHeaderComponents:h},s))}),a};return v.jsx(ok,{defaultIndex:n,allowMultiple:!0,reduceMotion:!0,onChange:i,className:"advanced-parameters",children:o()})},tOe=ot(ir,e=>({isProcessing:e.isProcessing,isConnected:e.isConnected,isCancelable:e.isCancelable}),{memoizeOptions:{resultEqualityCheck:Ee.isEqual}});function YP(e){const{...t}=e,n=Ie(),{isProcessing:r,isConnected:i,isCancelable:o}=he(tOe),a=()=>n(N8e()),{t:s}=Ve();return Qe("shift+x",()=>{(i||r)&&o&&a()},[i,r,o]),v.jsx(Ze,{icon:v.jsx(UEe,{}),tooltip:s("parameters:cancel"),"aria-label":s("parameters:cancel"),isDisabled:!i||!r||!o,onClick:a,styleClass:"cancel-btn",...t})}const KP=e=>e.generation;ot(KP,({shouldRandomizeSeed:e,shouldGenerateVariations:t})=>e||t,{memoizeOptions:{resultEqualityCheck:Ee.isEqual}});const PY=ot([KP,ir,bq,Or],(e,t,n,r)=>{const{prompt:i,shouldGenerateVariations:o,seedWeights:a,initialImage:s,seed:l}=e,{isProcessing:u,isConnected:d}=t;let h=!0;const m=[];return(!i||Boolean(i.match(/^[\s\r\n]+$/)))&&(h=!1,m.push("Missing prompt")),r==="img2img"&&!s&&(h=!1,m.push("No initial image selected")),u&&(h=!1,m.push("System Busy")),d||(h=!1,m.push("System Disconnected")),o&&(!(sP(a)||a==="")||l===-1)&&(h=!1,m.push("Seed-Weights badly formatted.")),{isReady:h,reasonsWhyNotReady:m}},{memoizeOptions:{equalityCheck:Ee.isEqual,resultEqualityCheck:Ee.isEqual}});function XP(e){const{iconButton:t=!1,...n}=e,r=Ie(),{isReady:i}=he(PY),o=he(Or),a=()=>{r(I8(o))},{t:s}=Ve();return Qe(["ctrl+enter","meta+enter"],()=>{r(I8(o))},{enabled:()=>i,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[i,o]),v.jsx("div",{style:{flexGrow:4},children:t?v.jsx(Ze,{"aria-label":s("parameters:invoke"),type:"submit",icon:v.jsx(uEe,{}),isDisabled:!i,onClick:a,className:"invoke-btn",tooltip:s("parameters:invoke"),tooltipProps:{placement:"bottom"},...n}):v.jsx(cr,{"aria-label":s("parameters:invoke"),type:"submit",isDisabled:!i,onClick:a,className:"invoke-btn",...n,children:"Invoke"})})}const nOe=ot($y,({shouldLoopback:e})=>e),rOe=()=>{const e=Ie(),t=he(nOe),{t:n}=Ve();return v.jsx(Ze,{"aria-label":n("parameters:toggleLoopback"),tooltip:n("parameters:toggleLoopback"),styleClass:"loopback-btn",asCheckbox:!0,isChecked:t,icon:v.jsx(dEe,{}),onClick:()=>{e(rwe(!t))}})},ZP=()=>{const e=he(Or);return v.jsxs("div",{className:"process-buttons",children:[v.jsx(XP,{}),e==="img2img"&&v.jsx(rOe,{}),v.jsx(YP,{})]})},QP=()=>{const e=he(r=>r.generation.negativePrompt),t=Ie(),{t:n}=Ve();return v.jsx(dn,{children:v.jsx(FE,{id:"negativePrompt",name:"negativePrompt",value:e,onChange:r=>t(Q2(r.target.value)),background:"var(--prompt-bg-color)",placeholder:n("parameters:negativePrompts"),_placeholder:{fontSize:"0.8rem"},borderColor:"var(--border-color)",_hover:{borderColor:"var(--border-color-light)"},_focusVisible:{borderColor:"var(--border-color-invalid)",boxShadow:"0 0 10px var(--box-shadow-color-invalid)"},fontSize:"0.9rem",color:"var(--text-color-secondary)"})})},iOe=ot([e=>e.generation,Or],(e,t)=>({prompt:e.prompt,activeTabName:t}),{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),JP=()=>{const e=Ie(),{prompt:t,activeTabName:n}=he(iOe),{isReady:r}=he(PY),i=w.useRef(null),{t:o}=Ve(),a=l=>{e(jx(l.target.value))};Qe("alt+a",()=>{var l;(l=i.current)==null||l.focus()},[]);const s=l=>{l.key==="Enter"&&l.shiftKey===!1&&r&&(l.preventDefault(),e(I8(n)))};return v.jsx("div",{className:"prompt-bar",children:v.jsx(dn,{isInvalid:t.length===0||Boolean(t.match(/^[\s\r\n]+$/)),children:v.jsx(FE,{id:"prompt",name:"prompt",placeholder:o("parameters:promptPlaceholder"),size:"lg",value:t,onChange:a,onKeyDown:s,resize:"vertical",height:30,ref:i,_placeholder:{color:"var(--text-color-secondary)"}})})})},TY=""+new URL("logo-13003d72.png",import.meta.url).href,oOe=ot(mp,e=>{const{shouldShowParametersPanel:t,shouldHoldParametersPanelOpen:n,shouldPinParametersPanel:r,parametersPanelScrollPosition:i}=e;return{shouldShowParametersPanel:t,shouldHoldParametersPanelOpen:n,shouldPinParametersPanel:r,parametersPanelScrollPosition:i}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),eT=e=>{const t=Ie(),{shouldShowParametersPanel:n,shouldHoldParametersPanelOpen:r,shouldPinParametersPanel:i}=he(oOe),o=w.useRef(null),a=w.useRef(null),s=w.useRef(null),{children:l}=e;Qe("o",()=>{t(Ku(!n)),i&&setTimeout(()=>t(vi(!0)),400)},[n,i]),Qe("esc",()=>{t(Ku(!1))},{enabled:()=>!i,preventDefault:!0},[i]),Qe("shift+o",()=>{m(),t(vi(!0))},[i]);const u=w.useCallback(()=>{i||(t(aCe(a.current?a.current.scrollTop:0)),t(Ku(!1)),t(sCe(!1)))},[t,i]),d=()=>{s.current=window.setTimeout(()=>u(),500)},h=()=>{s.current&&window.clearTimeout(s.current)},m=()=>{t(lCe(!i)),t(vi(!0))};return w.useEffect(()=>{function y(b){o.current&&!o.current.contains(b.target)&&u()}return document.addEventListener("mousedown",y),()=>{document.removeEventListener("mousedown",y)}},[u]),v.jsx(Aq,{nodeRef:o,in:n||r&&!i,unmountOnExit:!0,timeout:200,classNames:"parameters-panel-wrapper",children:v.jsx("div",{className:"parameters-panel-wrapper","data-pinned":i,tabIndex:1,ref:o,onMouseEnter:i?void 0:h,onMouseOver:i?void 0:h,style:{borderRight:i?"":"0.3rem solid var(--tab-list-text-inactive)"},children:v.jsx("div",{className:"parameters-panel-margin",children:v.jsxs("div",{className:"parameters-panel",ref:a,onMouseLeave:y=>{y.target!==a.current?h():!i&&d()},children:[v.jsx(lo,{label:"Pin Options Panel",children:v.jsx("div",{className:"parameters-panel-pin-button","data-selected":i,onClick:m,children:i?v.jsx(kq,{}):v.jsx(Eq,{})})}),!i&&v.jsxs("div",{className:"invoke-ai-logo-wrapper",children:[v.jsx("img",{src:TY,alt:"invoke-ai-logo"}),v.jsxs("h1",{children:["invoke ",v.jsx("strong",{children:"ai"})]})]}),l]})})})})};function aOe(){const{t:e}=Ve(),t={seed:{header:`${e("parameters:seed")}`,feature:ao.SEED,content:v.jsx(VP,{})},variations:{header:`${e("parameters:variations")}`,feature:ao.VARIATIONS,content:v.jsx(UP,{}),additionalHeaderComponents:v.jsx(WP,{})},face_restore:{header:`${e("parameters:faceRestoration")}`,feature:ao.FACE_CORRECTION,content:v.jsx(wP,{}),additionalHeaderComponents:v.jsx(CY,{})},upscale:{header:`${e("parameters:upscaling")}`,feature:ao.UPSCALE,content:v.jsx(CP,{}),additionalHeaderComponents:v.jsx(EY,{})},other:{header:`${e("parameters:otherOptions")}`,feature:ao.OTHER,content:v.jsx(NAe,{})}},n=Ie(),r=he(Or);return w.useEffect(()=>{r==="img2img"&&n(lP(!1))},[r,n]),v.jsxs(eT,{children:[v.jsxs(qe,{flexDir:"column",rowGap:"0.5rem",children:[v.jsx(JP,{}),v.jsx(QP,{})]}),v.jsx(ZP,{}),v.jsx(GP,{}),v.jsx(_Y,{label:e("parameters:img2imgStrength"),styleClass:"main-settings-block image-to-image-strength-main-option"}),v.jsx(DAe,{}),v.jsx(qP,{accordionInfo:t})]})}function sOe(){return v.jsx(HP,{optionsPanel:v.jsx(aOe,{}),children:v.jsx(MAe,{})})}const lOe=()=>v.jsx("div",{className:"workarea-single-view",children:v.jsx("div",{className:"text-to-image-area",children:v.jsx(wY,{})})}),uOe=ot([$y],({hiresFix:e,hiresStrength:t})=>({hiresFix:e,hiresStrength:t}),{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),cOe=()=>{const{hiresFix:e,hiresStrength:t}=he(uOe),n=Ie(),{t:r}=Ve(),i=a=>{n(VI(a))},o=()=>{n(VI(.75))};return v.jsx(na,{label:r("parameters:hiresStrength"),step:.01,min:.01,max:.99,onChange:i,value:t,isInteger:!1,withInput:!0,withSliderMarks:!0,inputWidth:"5.5rem",withReset:!0,handleReset:o,isSliderDisabled:!e,isInputDisabled:!e,isResetDisabled:!e})},dOe=()=>{const e=Ie(),t=he(i=>i.postprocessing.hiresFix),{t:n}=Ve(),r=i=>e(lP(i.target.checked));return v.jsxs(qe,{gap:2,direction:"column",children:[v.jsx(Vs,{label:n("parameters:hiresOptim"),fontSize:"md",isChecked:t,onChange:r}),v.jsx(cOe,{})]})},fOe=()=>v.jsxs(qe,{gap:2,direction:"column",children:[v.jsx(kY,{}),v.jsx(dOe,{})]});function hOe(){const{t:e}=Ve(),t={seed:{header:`${e("parameters:seed")}`,feature:ao.SEED,content:v.jsx(VP,{})},variations:{header:`${e("parameters:variations")}`,feature:ao.VARIATIONS,content:v.jsx(UP,{}),additionalHeaderComponents:v.jsx(WP,{})},face_restore:{header:`${e("parameters:faceRestoration")}`,feature:ao.FACE_CORRECTION,content:v.jsx(wP,{}),additionalHeaderComponents:v.jsx(CY,{})},upscale:{header:`${e("parameters:upscaling")}`,feature:ao.UPSCALE,content:v.jsx(CP,{}),additionalHeaderComponents:v.jsx(EY,{})},other:{header:`${e("parameters:otherOptions")}`,feature:ao.OTHER,content:v.jsx(fOe,{})}};return v.jsxs(eT,{children:[v.jsxs(qe,{flexDir:"column",rowGap:"0.5rem",children:[v.jsx(JP,{}),v.jsx(QP,{})]}),v.jsx(ZP,{}),v.jsx(GP,{}),v.jsx(qP,{accordionInfo:t})]})}function pOe(){return v.jsx(HP,{optionsPanel:v.jsx(hOe,{}),children:v.jsx(lOe,{})})}var K8={},gOe={get exports(){return K8},set exports(e){K8=e}};/** + * @license React + * react-reconciler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var mOe=function(t){var n={},r=w,i=Bh,o=Object.assign;function a(f){for(var p="https://reactjs.org/docs/error-decoder.html?invariant="+f,x=1;xse||L[G]!==M[se]){var pe=` +`+L[G].replace(" at new "," at ");return f.displayName&&pe.includes("")&&(pe=pe.replace("",f.displayName)),pe}while(1<=G&&0<=se);break}}}finally{al=!1,Error.prepareStackTrace=x}return(f=f?f.displayName||f.name:"")?yu(f):""}var Tp=Object.prototype.hasOwnProperty,xc=[],sl=-1;function oa(f){return{current:f}}function Dn(f){0>sl||(f.current=xc[sl],xc[sl]=null,sl--)}function Pn(f,p){sl++,xc[sl]=f.current,f.current=p}var aa={},Hr=oa(aa),li=oa(!1),sa=aa;function ll(f,p){var x=f.type.contextTypes;if(!x)return aa;var P=f.stateNode;if(P&&P.__reactInternalMemoizedUnmaskedChildContext===p)return P.__reactInternalMemoizedMaskedChildContext;var L={},M;for(M in x)L[M]=p[M];return P&&(f=f.stateNode,f.__reactInternalMemoizedUnmaskedChildContext=p,f.__reactInternalMemoizedMaskedChildContext=L),L}function ui(f){return f=f.childContextTypes,f!=null}function vs(){Dn(li),Dn(Hr)}function bf(f,p,x){if(Hr.current!==aa)throw Error(a(168));Pn(Hr,p),Pn(li,x)}function Su(f,p,x){var P=f.stateNode;if(p=p.childContextTypes,typeof P.getChildContext!="function")return x;P=P.getChildContext();for(var L in P)if(!(L in p))throw Error(a(108,j(f)||"Unknown",L));return o({},x,P)}function ys(f){return f=(f=f.stateNode)&&f.__reactInternalMemoizedMergedChildContext||aa,sa=Hr.current,Pn(Hr,f),Pn(li,li.current),!0}function Sf(f,p,x){var P=f.stateNode;if(!P)throw Error(a(169));x?(f=Su(f,p,sa),P.__reactInternalMemoizedMergedChildContext=f,Dn(li),Dn(Hr),Pn(Hr,f)):Dn(li),Pn(li,x)}var Mi=Math.clz32?Math.clz32:xf,Lp=Math.log,Ap=Math.LN2;function xf(f){return f>>>=0,f===0?32:31-(Lp(f)/Ap|0)|0}var ul=64,Io=4194304;function cl(f){switch(f&-f){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 f&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return f&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return f}}function xu(f,p){var x=f.pendingLanes;if(x===0)return 0;var P=0,L=f.suspendedLanes,M=f.pingedLanes,G=x&268435455;if(G!==0){var se=G&~L;se!==0?P=cl(se):(M&=G,M!==0&&(P=cl(M)))}else G=x&~L,G!==0?P=cl(G):M!==0&&(P=cl(M));if(P===0)return 0;if(p!==0&&p!==P&&!(p&L)&&(L=P&-P,M=p&-p,L>=M||L===16&&(M&4194240)!==0))return p;if(P&4&&(P|=x&16),p=f.entangledLanes,p!==0)for(f=f.entanglements,p&=P;0x;x++)p.push(f);return p}function Fa(f,p,x){f.pendingLanes|=p,p!==536870912&&(f.suspendedLanes=0,f.pingedLanes=0),f=f.eventTimes,p=31-Mi(p),f[p]=x}function Cf(f,p){var x=f.pendingLanes&~p;f.pendingLanes=p,f.suspendedLanes=0,f.pingedLanes=0,f.expiredLanes&=p,f.mutableReadLanes&=p,f.entangledLanes&=p,p=f.entanglements;var P=f.eventTimes;for(f=f.expirationTimes;0>=G,L-=G,uo=1<<32-Mi(p)+L|x<Gt?(ti=Rt,Rt=null):ti=Rt.sibling;var en=rt(me,Rt,be[Gt],Je);if(en===null){Rt===null&&(Rt=ti);break}f&&Rt&&en.alternate===null&&p(me,Rt),ue=M(en,ue,Gt),Bt===null?Me=en:Bt.sibling=en,Bt=en,Rt=ti}if(Gt===be.length)return x(me,Rt),Wn&&dl(me,Gt),Me;if(Rt===null){for(;GtGt?(ti=Rt,Rt=null):ti=Rt.sibling;var Ps=rt(me,Rt,en.value,Je);if(Ps===null){Rt===null&&(Rt=ti);break}f&&Rt&&Ps.alternate===null&&p(me,Rt),ue=M(Ps,ue,Gt),Bt===null?Me=Ps:Bt.sibling=Ps,Bt=Ps,Rt=ti}if(en.done)return x(me,Rt),Wn&&dl(me,Gt),Me;if(Rt===null){for(;!en.done;Gt++,en=be.next())en=jt(me,en.value,Je),en!==null&&(ue=M(en,ue,Gt),Bt===null?Me=en:Bt.sibling=en,Bt=en);return Wn&&dl(me,Gt),Me}for(Rt=P(me,Rt);!en.done;Gt++,en=be.next())en=Gn(Rt,me,Gt,en.value,Je),en!==null&&(f&&en.alternate!==null&&Rt.delete(en.key===null?Gt:en.key),ue=M(en,ue,Gt),Bt===null?Me=en:Bt.sibling=en,Bt=en);return f&&Rt.forEach(function(ki){return p(me,ki)}),Wn&&dl(me,Gt),Me}function ya(me,ue,be,Je){if(typeof be=="object"&&be!==null&&be.type===d&&be.key===null&&(be=be.props.children),typeof be=="object"&&be!==null){switch(be.$$typeof){case l:e:{for(var Me=be.key,Bt=ue;Bt!==null;){if(Bt.key===Me){if(Me=be.type,Me===d){if(Bt.tag===7){x(me,Bt.sibling),ue=L(Bt,be.props.children),ue.return=me,me=ue;break e}}else if(Bt.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===T&&t1(Me)===Bt.type){x(me,Bt.sibling),ue=L(Bt,be.props),ue.ref=Ha(me,Bt,be),ue.return=me,me=ue;break e}x(me,Bt);break}else p(me,Bt);Bt=Bt.sibling}be.type===d?(ue=kl(be.props.children,me.mode,Je,be.key),ue.return=me,me=ue):(Je=Zf(be.type,be.key,be.props,null,me.mode,Je),Je.ref=Ha(me,ue,be),Je.return=me,me=Je)}return G(me);case u:e:{for(Bt=be.key;ue!==null;){if(ue.key===Bt)if(ue.tag===4&&ue.stateNode.containerInfo===be.containerInfo&&ue.stateNode.implementation===be.implementation){x(me,ue.sibling),ue=L(ue,be.children||[]),ue.return=me,me=ue;break e}else{x(me,ue);break}else p(me,ue);ue=ue.sibling}ue=El(be,me.mode,Je),ue.return=me,me=ue}return G(me);case T:return Bt=be._init,ya(me,ue,Bt(be._payload),Je)}if(U(be))return Nn(me,ue,be,Je);if(R(be))return mr(me,ue,be,Je);Xi(me,be)}return typeof be=="string"&&be!==""||typeof be=="number"?(be=""+be,ue!==null&&ue.tag===6?(x(me,ue.sibling),ue=L(ue,be),ue.return=me,me=ue):(x(me,ue),ue=vg(be,me.mode,Je),ue.return=me,me=ue),G(me)):x(me,ue)}return ya}var Mc=r3(!0),i3=r3(!1),Rf={},jo=oa(Rf),Va=oa(Rf),oe=oa(Rf);function xe(f){if(f===Rf)throw Error(a(174));return f}function ve(f,p){Pn(oe,p),Pn(Va,f),Pn(jo,Rf),f=Z(p),Dn(jo),Pn(jo,f)}function nt(){Dn(jo),Dn(Va),Dn(oe)}function It(f){var p=xe(oe.current),x=xe(jo.current);p=W(x,f.type,p),x!==p&&(Pn(Va,f),Pn(jo,p))}function on(f){Va.current===f&&(Dn(jo),Dn(Va))}var Ft=oa(0);function mn(f){for(var p=f;p!==null;){if(p.tag===13){var x=p.memoizedState;if(x!==null&&(x=x.dehydrated,x===null||bc(x)||yf(x)))return p}else if(p.tag===19&&p.memoizedProps.revealOrder!==void 0){if(p.flags&128)return p}else if(p.child!==null){p.child.return=p,p=p.child;continue}if(p===f)break;for(;p.sibling===null;){if(p.return===null||p.return===f)return null;p=p.return}p.sibling.return=p.return,p=p.sibling}return null}var Df=[];function n1(){for(var f=0;fx?x:4,f(!0);var P=Ic.transition;Ic.transition={};try{f(!1),p()}finally{Yt=x,Ic.transition=P}}function $c(){return Di().memoizedState}function c1(f,p,x){var P=qr(f);if(x={lane:P,action:x,hasEagerState:!1,eagerState:null,next:null},Hc(f))Vc(p,x);else if(x=Oc(f,p,x,P),x!==null){var L=_i();$o(x,f,P,L),zf(x,p,P)}}function zc(f,p,x){var P=qr(f),L={lane:P,action:x,hasEagerState:!1,eagerState:null,next:null};if(Hc(f))Vc(p,L);else{var M=f.alternate;if(f.lanes===0&&(M===null||M.lanes===0)&&(M=p.lastRenderedReducer,M!==null))try{var G=p.lastRenderedState,se=M(G,x);if(L.hasEagerState=!0,L.eagerState=se,Y(se,G)){var pe=p.interleaved;pe===null?(L.next=L,Mf(p)):(L.next=pe.next,pe.next=L),p.interleaved=L;return}}catch{}finally{}x=Oc(f,p,L,P),x!==null&&(L=_i(),$o(x,f,P,L),zf(x,p,P))}}function Hc(f){var p=f.alternate;return f===Tn||p!==null&&p===Tn}function Vc(f,p){Nf=un=!0;var x=f.pending;x===null?p.next=p:(p.next=x.next,x.next=p),f.pending=p}function zf(f,p,x){if(x&4194240){var P=p.lanes;P&=f.pendingLanes,x|=P,p.lanes=x,wu(f,x)}}var xs={readContext:co,useCallback:Si,useContext:Si,useEffect:Si,useImperativeHandle:Si,useInsertionEffect:Si,useLayoutEffect:Si,useMemo:Si,useReducer:Si,useRef:Si,useState:Si,useDebugValue:Si,useDeferredValue:Si,useTransition:Si,useMutableSource:Si,useSyncExternalStore:Si,useId:Si,unstable_isNewReconciler:!1},mw={readContext:co,useCallback:function(f,p){return di().memoizedState=[f,p===void 0?null:p],f},useContext:co,useEffect:s3,useImperativeHandle:function(f,p,x){return x=x!=null?x.concat([f]):null,Eu(4194308,4,Rr.bind(null,p,f),x)},useLayoutEffect:function(f,p){return Eu(4194308,4,f,p)},useInsertionEffect:function(f,p){return Eu(4,2,f,p)},useMemo:function(f,p){var x=di();return p=p===void 0?null:p,f=f(),x.memoizedState=[f,p],f},useReducer:function(f,p,x){var P=di();return p=x!==void 0?x(p):p,P.memoizedState=P.baseState=p,f={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:f,lastRenderedState:p},P.queue=f,f=f.dispatch=c1.bind(null,Tn,f),[P.memoizedState,f]},useRef:function(f){var p=di();return f={current:f},p.memoizedState=f},useState:a3,useDebugValue:s1,useDeferredValue:function(f){return di().memoizedState=f},useTransition:function(){var f=a3(!1),p=f[0];return f=u1.bind(null,f[1]),di().memoizedState=f,[p,f]},useMutableSource:function(){},useSyncExternalStore:function(f,p,x){var P=Tn,L=di();if(Wn){if(x===void 0)throw Error(a(407));x=x()}else{if(x=p(),ei===null)throw Error(a(349));ku&30||a1(P,p,x)}L.memoizedState=x;var M={value:x,getSnapshot:p};return L.queue=M,s3(pl.bind(null,P,M,f),[f]),P.flags|=2048,Ff(9,Bc.bind(null,P,M,x,p),void 0,null),x},useId:function(){var f=di(),p=ei.identifierPrefix;if(Wn){var x=$a,P=uo;x=(P&~(1<<32-Mi(P)-1)).toString(32)+x,p=":"+p+"R"+x,x=Rc++,0sg&&(p.flags|=128,P=!0,Gc(L,!1),p.lanes=4194304)}else{if(!P)if(f=mn(M),f!==null){if(p.flags|=128,P=!0,f=f.updateQueue,f!==null&&(p.updateQueue=f,p.flags|=4),Gc(L,!0),L.tail===null&&L.tailMode==="hidden"&&!M.alternate&&!Wn)return xi(p),null}else 2*Xn()-L.renderingStartTime>sg&&x!==1073741824&&(p.flags|=128,P=!0,Gc(L,!1),p.lanes=4194304);L.isBackwards?(M.sibling=p.child,p.child=M):(f=L.last,f!==null?f.sibling=M:p.child=M,L.last=M)}return L.tail!==null?(p=L.tail,L.rendering=p,L.tail=p.sibling,L.renderingStartTime=Xn(),p.sibling=null,f=Ft.current,Pn(Ft,P?f&1|2:f&1),p):(xi(p),null);case 22:case 23:return td(),x=p.memoizedState!==null,f!==null&&f.memoizedState!==null!==x&&(p.flags|=8192),x&&p.mode&1?ho&1073741824&&(xi(p),ct&&p.subtreeFlags&6&&(p.flags|=8192)):xi(p),null;case 24:return null;case 25:return null}throw Error(a(156,p.tag))}function y1(f,p){switch(Z0(p),p.tag){case 1:return ui(p.type)&&vs(),f=p.flags,f&65536?(p.flags=f&-65537|128,p):null;case 3:return nt(),Dn(li),Dn(Hr),n1(),f=p.flags,f&65536&&!(f&128)?(p.flags=f&-65537|128,p):null;case 5:return on(p),null;case 13:if(Dn(Ft),f=p.memoizedState,f!==null&&f.dehydrated!==null){if(p.alternate===null)throw Error(a(340));Tc()}return f=p.flags,f&65536?(p.flags=f&-65537|128,p):null;case 19:return Dn(Ft),null;case 4:return nt(),null;case 10:return Af(p.type._context),null;case 22:case 23:return td(),null;case 24:return null;default:return null}}var ml=!1,Wr=!1,ww=typeof WeakSet=="function"?WeakSet:Set,st=null;function qc(f,p){var x=f.ref;if(x!==null)if(typeof x=="function")try{x(null)}catch(P){Qn(f,p,P)}else x.current=null}function pa(f,p,x){try{x()}catch(P){Qn(f,p,P)}}var Yp=!1;function Tu(f,p){for(Q(f.containerInfo),st=p;st!==null;)if(f=st,p=f.child,(f.subtreeFlags&1028)!==0&&p!==null)p.return=f,st=p;else for(;st!==null;){f=st;try{var x=f.alternate;if(f.flags&1024)switch(f.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var P=x.memoizedProps,L=x.memoizedState,M=f.stateNode,G=M.getSnapshotBeforeUpdate(f.elementType===f.type?P:ua(f.type,P),L);M.__reactInternalSnapshotBeforeUpdate=G}break;case 3:ct&&rl(f.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(a(163))}}catch(se){Qn(f,f.return,se)}if(p=f.sibling,p!==null){p.return=f.return,st=p;break}st=f.return}return x=Yp,Yp=!1,x}function wi(f,p,x){var P=p.updateQueue;if(P=P!==null?P.lastEffect:null,P!==null){var L=P=P.next;do{if((L.tag&f)===f){var M=L.destroy;L.destroy=void 0,M!==void 0&&pa(p,x,M)}L=L.next}while(L!==P)}}function Kp(f,p){if(p=p.updateQueue,p=p!==null?p.lastEffect:null,p!==null){var x=p=p.next;do{if((x.tag&f)===f){var P=x.create;x.destroy=P()}x=x.next}while(x!==p)}}function Xp(f){var p=f.ref;if(p!==null){var x=f.stateNode;switch(f.tag){case 5:f=X(x);break;default:f=x}typeof p=="function"?p(f):p.current=f}}function b1(f){var p=f.alternate;p!==null&&(f.alternate=null,b1(p)),f.child=null,f.deletions=null,f.sibling=null,f.tag===5&&(p=f.stateNode,p!==null&&at(p)),f.stateNode=null,f.return=null,f.dependencies=null,f.memoizedProps=null,f.memoizedState=null,f.pendingProps=null,f.stateNode=null,f.updateQueue=null}function Yc(f){return f.tag===5||f.tag===3||f.tag===4}function Cs(f){e:for(;;){for(;f.sibling===null;){if(f.return===null||Yc(f.return))return null;f=f.return}for(f.sibling.return=f.return,f=f.sibling;f.tag!==5&&f.tag!==6&&f.tag!==18;){if(f.flags&2||f.child===null||f.tag===4)continue e;f.child.return=f,f=f.child}if(!(f.flags&2))return f.stateNode}}function Zp(f,p,x){var P=f.tag;if(P===5||P===6)f=f.stateNode,p?Ke(x,f,p):At(x,f);else if(P!==4&&(f=f.child,f!==null))for(Zp(f,p,x),f=f.sibling;f!==null;)Zp(f,p,x),f=f.sibling}function S1(f,p,x){var P=f.tag;if(P===5||P===6)f=f.stateNode,p?Rn(x,f,p):Le(x,f);else if(P!==4&&(f=f.child,f!==null))for(S1(f,p,x),f=f.sibling;f!==null;)S1(f,p,x),f=f.sibling}var Nr=null,ga=!1;function ma(f,p,x){for(x=x.child;x!==null;)Ur(f,p,x),x=x.sibling}function Ur(f,p,x){if(Kt&&typeof Kt.onCommitFiberUnmount=="function")try{Kt.onCommitFiberUnmount(gn,x)}catch{}switch(x.tag){case 5:Wr||qc(x,p);case 6:if(ct){var P=Nr,L=ga;Nr=null,ma(f,p,x),Nr=P,ga=L,Nr!==null&&(ga?ft(Nr,x.stateNode):xt(Nr,x.stateNode))}else ma(f,p,x);break;case 18:ct&&Nr!==null&&(ga?G0(Nr,x.stateNode):U0(Nr,x.stateNode));break;case 4:ct?(P=Nr,L=ga,Nr=x.stateNode.containerInfo,ga=!0,ma(f,p,x),Nr=P,ga=L):(mt&&(P=x.stateNode.containerInfo,L=Ba(P),yc(P,L)),ma(f,p,x));break;case 0:case 11:case 14:case 15:if(!Wr&&(P=x.updateQueue,P!==null&&(P=P.lastEffect,P!==null))){L=P=P.next;do{var M=L,G=M.destroy;M=M.tag,G!==void 0&&(M&2||M&4)&&pa(x,p,G),L=L.next}while(L!==P)}ma(f,p,x);break;case 1:if(!Wr&&(qc(x,p),P=x.stateNode,typeof P.componentWillUnmount=="function"))try{P.props=x.memoizedProps,P.state=x.memoizedState,P.componentWillUnmount()}catch(se){Qn(x,p,se)}ma(f,p,x);break;case 21:ma(f,p,x);break;case 22:x.mode&1?(Wr=(P=Wr)||x.memoizedState!==null,ma(f,p,x),Wr=P):ma(f,p,x);break;default:ma(f,p,x)}}function Qp(f){var p=f.updateQueue;if(p!==null){f.updateQueue=null;var x=f.stateNode;x===null&&(x=f.stateNode=new ww),p.forEach(function(P){var L=k3.bind(null,f,P);x.has(P)||(x.add(P),P.then(L,L))})}}function Bo(f,p){var x=p.deletions;if(x!==null)for(var P=0;P";case ng:return":has("+(C1(f)||"")+")";case rg:return'[role="'+f.value+'"]';case ig:return'"'+f.value+'"';case Kc:return'[data-testname="'+f.value+'"]';default:throw Error(a(365))}}function Xc(f,p){var x=[];f=[f,0];for(var P=0;PL&&(L=G),P&=~M}if(P=L,P=Xn()-P,P=(120>P?120:480>P?480:1080>P?1080:1920>P?1920:3e3>P?3e3:4320>P?4320:1960*Cw(P/1960))-P,10f?16:f,Ot===null)var P=!1;else{if(f=Ot,Ot=null,lg=0,Ut&6)throw Error(a(331));var L=Ut;for(Ut|=4,st=f.current;st!==null;){var M=st,G=M.child;if(st.flags&16){var se=M.deletions;if(se!==null){for(var pe=0;peXn()-E1?wl(f,0):k1|=x),hi(f,p)}function O1(f,p){p===0&&(f.mode&1?(p=Io,Io<<=1,!(Io&130023424)&&(Io=4194304)):p=1);var x=_i();f=ca(f,p),f!==null&&(Fa(f,p,x),hi(f,x))}function kw(f){var p=f.memoizedState,x=0;p!==null&&(x=p.retryLane),O1(f,x)}function k3(f,p){var x=0;switch(f.tag){case 13:var P=f.stateNode,L=f.memoizedState;L!==null&&(x=L.retryLane);break;case 19:P=f.stateNode;break;default:throw Error(a(314))}P!==null&&P.delete(p),O1(f,x)}var M1;M1=function(f,p,x){if(f!==null)if(f.memoizedProps!==p.pendingProps||li.current)Zi=!0;else{if(!(f.lanes&x)&&!(p.flags&128))return Zi=!1,Sw(f,p,x);Zi=!!(f.flags&131072)}else Zi=!1,Wn&&p.flags&1048576&&X0(p,Ir,p.index);switch(p.lanes=0,p.tag){case 2:var P=p.type;Wa(f,p),f=p.pendingProps;var L=ll(p,Hr.current);Ac(p,x),L=i1(null,p,P,f,L,x);var M=Dc();return p.flags|=1,typeof L=="object"&&L!==null&&typeof L.render=="function"&&L.$$typeof===void 0?(p.tag=1,p.memoizedState=null,p.updateQueue=null,ui(P)?(M=!0,ys(p)):M=!1,p.memoizedState=L.state!==null&&L.state!==void 0?L.state:null,J0(p),L.updater=da,p.stateNode=L,L._reactInternals=p,e1(p,P,f,x),p=fa(null,p,P,!0,M,x)):(p.tag=0,Wn&&M&&Ii(p),Ni(null,p,L,x),p=p.child),p;case 16:P=p.elementType;e:{switch(Wa(f,p),f=p.pendingProps,L=P._init,P=L(P._payload),p.type=P,L=p.tag=gg(P),f=ua(P,f),L){case 0:p=h1(null,p,P,f,x);break e;case 1:p=m3(null,p,P,f,x);break e;case 11:p=f3(null,p,P,f,x);break e;case 14:p=gl(null,p,P,ua(P.type,f),x);break e}throw Error(a(306,P,""))}return p;case 0:return P=p.type,L=p.pendingProps,L=p.elementType===P?L:ua(P,L),h1(f,p,P,L,x);case 1:return P=p.type,L=p.pendingProps,L=p.elementType===P?L:ua(P,L),m3(f,p,P,L,x);case 3:e:{if(v3(p),f===null)throw Error(a(387));P=p.pendingProps,M=p.memoizedState,L=M.element,Jy(f,p),Fp(p,P,null,x);var G=p.memoizedState;if(P=G.element,St&&M.isDehydrated)if(M={element:P,isDehydrated:!1,cache:G.cache,pendingSuspenseBoundaries:G.pendingSuspenseBoundaries,transitions:G.transitions},p.updateQueue.baseState=M,p.memoizedState=M,p.flags&256){L=Wc(Error(a(423)),p),p=y3(f,p,P,x,L);break e}else if(P!==L){L=Wc(Error(a(424)),p),p=y3(f,p,P,x,L);break e}else for(St&&(Do=B0(p.stateNode.containerInfo),Zn=p,Wn=!0,Ki=null,No=!1),x=i3(p,null,P,x),p.child=x;x;)x.flags=x.flags&-3|4096,x=x.sibling;else{if(Tc(),P===L){p=ws(f,p,x);break e}Ni(f,p,P,x)}p=p.child}return p;case 5:return It(p),f===null&&Ef(p),P=p.type,L=p.pendingProps,M=f!==null?f.memoizedProps:null,G=L.children,He(P,L)?G=null:M!==null&&He(P,M)&&(p.flags|=32),g3(f,p),Ni(f,p,G,x),p.child;case 6:return f===null&&Ef(p),null;case 13:return b3(f,p,x);case 4:return ve(p,p.stateNode.containerInfo),P=p.pendingProps,f===null?p.child=Mc(p,null,P,x):Ni(f,p,P,x),p.child;case 11:return P=p.type,L=p.pendingProps,L=p.elementType===P?L:ua(P,L),f3(f,p,P,L,x);case 7:return Ni(f,p,p.pendingProps,x),p.child;case 8:return Ni(f,p,p.pendingProps.children,x),p.child;case 12:return Ni(f,p,p.pendingProps.children,x),p.child;case 10:e:{if(P=p.type._context,L=p.pendingProps,M=p.memoizedProps,G=L.value,Qy(p,P,G),M!==null)if(Y(M.value,G)){if(M.children===L.children&&!li.current){p=ws(f,p,x);break e}}else for(M=p.child,M!==null&&(M.return=p);M!==null;){var se=M.dependencies;if(se!==null){G=M.child;for(var pe=se.firstContext;pe!==null;){if(pe.context===P){if(M.tag===1){pe=Ss(-1,x&-x),pe.tag=2;var ze=M.updateQueue;if(ze!==null){ze=ze.shared;var dt=ze.pending;dt===null?pe.next=pe:(pe.next=dt.next,dt.next=pe),ze.pending=pe}}M.lanes|=x,pe=M.alternate,pe!==null&&(pe.lanes|=x),Of(M.return,x,p),se.lanes|=x;break}pe=pe.next}}else if(M.tag===10)G=M.type===p.type?null:M.child;else if(M.tag===18){if(G=M.return,G===null)throw Error(a(341));G.lanes|=x,se=G.alternate,se!==null&&(se.lanes|=x),Of(G,x,p),G=M.sibling}else G=M.child;if(G!==null)G.return=M;else for(G=M;G!==null;){if(G===p){G=null;break}if(M=G.sibling,M!==null){M.return=G.return,G=M;break}G=G.return}M=G}Ni(f,p,L.children,x),p=p.child}return p;case 9:return L=p.type,P=p.pendingProps.children,Ac(p,x),L=co(L),P=P(L),p.flags|=1,Ni(f,p,P,x),p.child;case 14:return P=p.type,L=ua(P,p.pendingProps),L=ua(P.type,L),gl(f,p,P,L,x);case 15:return h3(f,p,p.type,p.pendingProps,x);case 17:return P=p.type,L=p.pendingProps,L=p.elementType===P?L:ua(P,L),Wa(f,p),p.tag=1,ui(P)?(f=!0,ys(p)):f=!1,Ac(p,x),t3(p,P,L),e1(p,P,L,x),fa(null,p,P,!0,f,x);case 19:return x3(f,p,x);case 22:return p3(f,p,x)}throw Error(a(156,p.tag))};function Fi(f,p){return kc(f,p)}function Ua(f,p,x,P){this.tag=f,this.key=x,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=p,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=P,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function zo(f,p,x,P){return new Ua(f,p,x,P)}function I1(f){return f=f.prototype,!(!f||!f.isReactComponent)}function gg(f){if(typeof f=="function")return I1(f)?1:0;if(f!=null){if(f=f.$$typeof,f===S)return 11;if(f===_)return 14}return 2}function go(f,p){var x=f.alternate;return x===null?(x=zo(f.tag,p,f.key,f.mode),x.elementType=f.elementType,x.type=f.type,x.stateNode=f.stateNode,x.alternate=f,f.alternate=x):(x.pendingProps=p,x.type=f.type,x.flags=0,x.subtreeFlags=0,x.deletions=null),x.flags=f.flags&14680064,x.childLanes=f.childLanes,x.lanes=f.lanes,x.child=f.child,x.memoizedProps=f.memoizedProps,x.memoizedState=f.memoizedState,x.updateQueue=f.updateQueue,p=f.dependencies,x.dependencies=p===null?null:{lanes:p.lanes,firstContext:p.firstContext},x.sibling=f.sibling,x.index=f.index,x.ref=f.ref,x}function Zf(f,p,x,P,L,M){var G=2;if(P=f,typeof f=="function")I1(f)&&(G=1);else if(typeof f=="string")G=5;else e:switch(f){case d:return kl(x.children,L,M,p);case h:G=8,L|=8;break;case m:return f=zo(12,x,p,L|2),f.elementType=m,f.lanes=M,f;case E:return f=zo(13,x,p,L),f.elementType=E,f.lanes=M,f;case k:return f=zo(19,x,p,L),f.elementType=k,f.lanes=M,f;case A:return mg(x,L,M,p);default:if(typeof f=="object"&&f!==null)switch(f.$$typeof){case y:G=10;break e;case b:G=9;break e;case S:G=11;break e;case _:G=14;break e;case T:G=16,P=null;break e}throw Error(a(130,f==null?f:typeof f,""))}return p=zo(G,x,p,L),p.elementType=f,p.type=P,p.lanes=M,p}function kl(f,p,x,P){return f=zo(7,f,P,p),f.lanes=x,f}function mg(f,p,x,P){return f=zo(22,f,P,p),f.elementType=A,f.lanes=x,f.stateNode={isHidden:!1},f}function vg(f,p,x){return f=zo(6,f,null,p),f.lanes=x,f}function El(f,p,x){return p=zo(4,f.children!==null?f.children:[],f.key,p),p.lanes=x,p.stateNode={containerInfo:f.containerInfo,pendingChildren:null,implementation:f.implementation},p}function Qf(f,p,x,P,L){this.tag=p,this.containerInfo=f,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=lt,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=_c(0),this.expirationTimes=_c(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_c(0),this.identifierPrefix=P,this.onRecoverableError=L,St&&(this.mutableSourceEagerHydrationData=null)}function E3(f,p,x,P,L,M,G,se,pe){return f=new Qf(f,p,x,se,pe),p===1?(p=1,M===!0&&(p|=8)):p=0,M=zo(3,null,null,p),f.current=M,M.stateNode=f,M.memoizedState={element:P,isDehydrated:x,cache:null,transitions:null,pendingSuspenseBoundaries:null},J0(M),f}function R1(f){if(!f)return aa;f=f._reactInternals;e:{if(z(f)!==f||f.tag!==1)throw Error(a(170));var p=f;do{switch(p.tag){case 3:p=p.stateNode.context;break e;case 1:if(ui(p.type)){p=p.stateNode.__reactInternalMemoizedMergedChildContext;break e}}p=p.return}while(p!==null);throw Error(a(171))}if(f.tag===1){var x=f.type;if(ui(x))return Su(f,x,p)}return p}function D1(f){var p=f._reactInternals;if(p===void 0)throw typeof f.render=="function"?Error(a(188)):(f=Object.keys(f).join(","),Error(a(268,f)));return f=te(p),f===null?null:f.stateNode}function Jf(f,p){if(f=f.memoizedState,f!==null&&f.dehydrated!==null){var x=f.retryLane;f.retryLane=x!==0&&x=ze&&M>=jt&&L<=dt&&G<=rt){f.splice(p,1);break}else if(P!==ze||x.width!==pe.width||rtG){if(!(M!==jt||x.height!==pe.height||dtL)){ze>P&&(pe.width+=ze-P,pe.x=P),dtM&&(pe.height+=jt-M,pe.y=M),rtx&&(x=G)),G ")+` + +No matching component was found for: + `)+f.join(" > ")}return null},n.getPublicRootInstance=function(f){if(f=f.current,!f.child)return null;switch(f.child.tag){case 5:return X(f.child.stateNode);default:return f.child.stateNode}},n.injectIntoDevTools=function(f){if(f={bundleType:f.bundleType,version:f.version,rendererPackageName:f.rendererPackageName,rendererConfig:f.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:s.ReactCurrentDispatcher,findHostInstanceByFiber:yg,findFiberByHostInstance:f.findFiberByHostInstance||N1,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")f=!1;else{var p=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(p.isDisabled||!p.supportsFiber)f=!0;else{try{gn=p.inject(f),Kt=p}catch{}f=!!p.checkDCE}}return f},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(f,p,x,P){if(!le)throw Error(a(363));f=_1(f,p);var L=Dt(f,x,P).disconnect;return{disconnect:function(){L()}}},n.registerMutableSourceForHydration=function(f,p){var x=p._getVersion;x=x(p._source),f.mutableSourceEagerHydrationData==null?f.mutableSourceEagerHydrationData=[p,x]:f.mutableSourceEagerHydrationData.push(p,x)},n.runWithPriority=function(f,p){var x=Yt;try{return Yt=f,p()}finally{Yt=x}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(f,p,x,P){var L=p.current,M=_i(),G=qr(L);return x=R1(x),p.context===null?p.context=x:p.pendingContext=x,p=Ss(M,G),p.payload={element:f},P=P===void 0?null:P,P!==null&&(p.callback=P),f=hl(L,p,G),f!==null&&($o(f,L,G,M),Bp(f,L,G)),G},n};(function(e){e.exports=mOe})(gOe);const vOe=d_(K8);var uS={},yOe={get exports(){return uS},set exports(e){uS=e}},Sp={};/** + * @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. + */Sp.ConcurrentRoot=1;Sp.ContinuousEventPriority=4;Sp.DefaultEventPriority=16;Sp.DiscreteEventPriority=1;Sp.IdleEventPriority=536870912;Sp.LegacyRoot=0;(function(e){e.exports=Sp})(yOe);const JD={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let eN=!1,tN=!1;const tT=".react-konva-event",bOe=`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 +`,SOe=`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 +`,xOe={};function lw(e,t,n=xOe){if(!eN&&"zIndex"in t&&(console.warn(SOe),eN=!0),!tN&&t.draggable){var r=t.x!==void 0||t.y!==void 0,i=t.onDragEnd||t.onDragMove;r&&!i&&(console.warn(bOe),tN=!0)}for(var o in n)if(!JD[o]){var a=o.slice(0,2)==="on",s=n[o]!==t[o];if(a&&s){var l=o.substr(2).toLowerCase();l.substr(0,7)==="content"&&(l="content"+l.substr(7,1).toUpperCase()+l.substr(8)),e.off(l,n[o])}var u=!t.hasOwnProperty(o);u&&e.setAttr(o,void 0)}var d=t._useStrictMode,h={},m=!1;const y={};for(var o in t)if(!JD[o]){var a=o.slice(0,2)==="on",b=n[o]!==t[o];if(a&&b){var l=o.substr(2).toLowerCase();l.substr(0,7)==="content"&&(l="content"+l.substr(7,1).toUpperCase()+l.substr(8)),t[o]&&(y[l]=t[o])}!a&&(t[o]!==n[o]||d&&t[o]!==e.getAttr(o))&&(m=!0,h[o]=t[o])}m&&(e.setAttrs(h),gf(e));for(var l in y)e.on(l+tT,y[l])}function gf(e){if(!pt.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const LY={},wOe={};ep.Node.prototype._applyProps=lw;function COe(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),gf(e)}function _Oe(e,t,n){let r=ep[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=ep.Group);const i={},o={};for(var a in t){var s=a.slice(0,2)==="on";s?o[a]=t[a]:i[a]=t[a]}const l=new r(i);return lw(l,o),l}function kOe(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function EOe(e,t,n){return!1}function POe(e){return e}function TOe(){return null}function LOe(){return null}function AOe(e,t,n,r){return wOe}function OOe(){}function MOe(e){}function IOe(e,t){return!1}function ROe(){return LY}function DOe(){return LY}const NOe=setTimeout,jOe=clearTimeout,BOe=-1;function FOe(e,t){return!1}const $Oe=!1,zOe=!0,HOe=!0;function VOe(e,t){t.parent===e?t.moveToTop():e.add(t),gf(e)}function WOe(e,t){t.parent===e?t.moveToTop():e.add(t),gf(e)}function AY(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),gf(e)}function UOe(e,t,n){AY(e,t,n)}function GOe(e,t){t.destroy(),t.off(tT),gf(e)}function qOe(e,t){t.destroy(),t.off(tT),gf(e)}function YOe(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function KOe(e,t,n){}function XOe(e,t,n,r,i){lw(e,i,r)}function ZOe(e){e.hide(),gf(e)}function QOe(e){}function JOe(e,t){(t.visible==null||t.visible)&&e.show()}function eMe(e,t){}function tMe(e){}function nMe(){}const rMe=()=>uS.DefaultEventPriority,iMe=Object.freeze(Object.defineProperty({__proto__:null,appendChild:VOe,appendChildToContainer:WOe,appendInitialChild:COe,cancelTimeout:jOe,clearContainer:tMe,commitMount:KOe,commitTextUpdate:YOe,commitUpdate:XOe,createInstance:_Oe,createTextInstance:kOe,detachDeletedInstance:nMe,finalizeInitialChildren:EOe,getChildHostContext:DOe,getCurrentEventPriority:rMe,getPublicInstance:POe,getRootHostContext:ROe,hideInstance:ZOe,hideTextInstance:QOe,idlePriority:Bh.unstable_IdlePriority,insertBefore:AY,insertInContainerBefore:UOe,isPrimaryRenderer:$Oe,noTimeout:BOe,now:Bh.unstable_now,prepareForCommit:TOe,preparePortalMount:LOe,prepareUpdate:AOe,removeChild:GOe,removeChildFromContainer:qOe,resetAfterCommit:OOe,resetTextContent:MOe,run:Bh.unstable_runWithPriority,scheduleTimeout:NOe,shouldDeprioritizeSubtree:IOe,shouldSetTextContent:FOe,supportsMutation:HOe,unhideInstance:JOe,unhideTextInstance:eMe,warnsIfNotActing:zOe},Symbol.toStringTag,{value:"Module"}));var oMe=Object.defineProperty,aMe=Object.defineProperties,sMe=Object.getOwnPropertyDescriptors,nN=Object.getOwnPropertySymbols,lMe=Object.prototype.hasOwnProperty,uMe=Object.prototype.propertyIsEnumerable,rN=(e,t,n)=>t in e?oMe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,iN=(e,t)=>{for(var n in t||(t={}))lMe.call(t,n)&&rN(e,n,t[n]);if(nN)for(var n of nN(t))uMe.call(t,n)&&rN(e,n,t[n]);return e},cMe=(e,t)=>aMe(e,sMe(t));function nT(e,t,n){if(!e)return;if(n(e)===!0)return e;let r=t?e.return:e.child;for(;r;){const i=nT(r,t,n);if(i)return i;r=t?null:r.sibling}}function OY(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const rT=OY(w.createContext(null));class MY extends w.Component{render(){return w.createElement(rT.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:dMe,ReactCurrentDispatcher:fMe}=w.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function hMe(){const e=w.useContext(rT);if(!e)throw new Error("its-fine: useFiber must be called within a !");const t=w.useId();return w.useMemo(()=>{var r;return(r=dMe.current)!=null?r:nT(e,!1,i=>{let o=i.memoizedState;for(;o;){if(o.memoizedState===t)return!0;o=o.next}})},[e,t])}const hv=[],oN=new WeakMap;function pMe(){var e;const t=hMe();hv.splice(0,hv.length),nT(t,!0,n=>{var r;const i=(r=n.type)==null?void 0:r._context;i&&i!==rT&&hv.push(OY(i))});for(const n of hv){const r=(e=fMe.current)==null?void 0:e.readContext(n);oN.set(n,r)}return w.useMemo(()=>hv.reduce((n,r)=>i=>w.createElement(n,null,w.createElement(r.Provider,cMe(iN({},i),{value:oN.get(r)}))),n=>w.createElement(MY,iN({},n))),[])}function gMe(e){const t=N.useRef();return N.useLayoutEffect(()=>{t.current=e}),t.current}const mMe=e=>{const t=N.useRef(),n=N.useRef(),r=N.useRef(),i=gMe(e),o=pMe(),a=s=>{const{forwardedRef:l}=e;l&&(typeof l=="function"?l(s):l.current=s)};return N.useLayoutEffect(()=>(n.current=new ep.Stage({width:e.width,height:e.height,container:t.current}),a(n.current),r.current=Iv.createContainer(n.current,uS.LegacyRoot,!1,null),Iv.updateContainer(N.createElement(o,{},e.children),r.current),()=>{ep.isBrowser&&(a(null),Iv.updateContainer(null,r.current,null),n.current.destroy())}),[]),N.useLayoutEffect(()=>{a(n.current),lw(n.current,e,i),Iv.updateContainer(N.createElement(o,{},e.children),r.current,null)}),N.createElement("div",{ref:t,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},pv="Layer",sc="Group",lc="Rect",sh="Circle",cS="Line",IY="Image",vMe="Transformer",Iv=vOe(iMe);Iv.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:N.version,rendererPackageName:"react-konva"});const yMe=N.forwardRef((e,t)=>N.createElement(MY,{},N.createElement(mMe,{...e,forwardedRef:t}))),bMe=ot([ln,Mr],(e,t)=>{const{tool:n,isMovingBoundingBox:r}=e;return{tool:n,isStaging:t,isMovingBoundingBox:r}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),SMe=()=>{const e=Ie(),{tool:t,isStaging:n,isMovingBoundingBox:r}=he(bMe);return{handleDragStart:w.useCallback(()=>{(t==="move"||n)&&!r&&e(G5(!0))},[e,r,n,t]),handleDragMove:w.useCallback(i=>{if(!((t==="move"||n)&&!r))return;const o={x:i.target.x(),y:i.target.y()};e(ZW(o))},[e,r,n,t]),handleDragEnd:w.useCallback(()=>{(t==="move"||n)&&!r&&e(G5(!1))},[e,r,n,t])}},xMe=ot([ln,Or,Mr],(e,t,n)=>{const{cursorPosition:r,shouldLockBoundingBox:i,shouldShowBoundingBox:o,tool:a,isMaskEnabled:s,shouldSnapToGrid:l}=e;return{activeTabName:t,isCursorOnCanvas:Boolean(r),shouldLockBoundingBox:i,shouldShowBoundingBox:o,tool:a,isStaging:n,isMaskEnabled:s,shouldSnapToGrid:l}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),wMe=()=>{const e=Ie(),{activeTabName:t,shouldShowBoundingBox:n,tool:r,isStaging:i,isMaskEnabled:o,shouldSnapToGrid:a}=he(xMe),s=w.useRef(null),l=$G(),u=()=>e(nP());Qe(["shift+c"],()=>{u()},{enabled:()=>!i,preventDefault:!0},[]);const d=()=>e(Dy(!o));Qe(["h"],()=>{d()},{enabled:()=>!i,preventDefault:!0},[o]),Qe(["n"],()=>{e(Y5(!a))},{enabled:!0,preventDefault:!0},[a]),Qe("esc",()=>{e(wxe())},{enabled:()=>!0,preventDefault:!0}),Qe("shift+h",()=>{e(Lxe(!n))},{enabled:()=>!i,preventDefault:!0},[t,n]),Qe(["space"],h=>{h.repeat||(l==null||l.container().focus(),r!=="move"&&(s.current=r,e(tu("move"))),r==="move"&&s.current&&s.current!=="move"&&(e(tu(s.current)),s.current="move"))},{keyup:!0,keydown:!0,preventDefault:!0},[r,s])},iT=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}},RY=()=>{const e=Ie(),t=el(),n=$G();return{updateColorUnderCursor:()=>{if(!n||!t)return;const r=n.getPointerPosition();if(!r)return;const i=$g.pixelRatio,[o,a,s,l]=t.getContext().getImageData(r.x*i,r.y*i,1,1).data;e(Exe({r:o,g:a,b:s,a:l}))},commitColorUnderCursor:()=>{e(gxe())}}},CMe=ot([Or,ln,Mr],(e,t,n)=>{const{tool:r}=t;return{tool:r,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),_Me=e=>{const t=Ie(),{tool:n,isStaging:r}=he(CMe),{commitColorUnderCursor:i}=RY();return w.useCallback(o=>{if(!e.current)return;if(e.current.container().focus(),n==="move"||r){t(G5(!0));return}if(n==="colorPicker"){i();return}const a=iT(e.current);a&&(o.evt.preventDefault(),t(HW(!0)),t(pxe([a.x,a.y])))},[e,n,r,t,i])},kMe=ot([Or,ln,Mr],(e,t,n)=>{const{tool:r,isDrawing:i}=t;return{tool:r,isDrawing:i,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),EMe=(e,t,n)=>{const r=Ie(),{isDrawing:i,tool:o,isStaging:a}=he(kMe),{updateColorUnderCursor:s}=RY();return w.useCallback(()=>{if(!e.current)return;const l=iT(e.current);if(l){if(r(Pxe(l)),n.current=l,o==="colorPicker"){s();return}!i||o==="move"||a||(t.current=!0,r(FW([l.x,l.y])))}},[t,r,i,a,n,e,o,s])},PMe=()=>{const e=Ie();return w.useCallback(()=>{e(yxe())},[e])},TMe=ot([Or,ln,Mr],(e,t,n)=>{const{tool:r,isDrawing:i}=t;return{tool:r,isDrawing:i,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),LMe=(e,t)=>{const n=Ie(),{tool:r,isDrawing:i,isStaging:o}=he(TMe);return w.useCallback(()=>{if(r==="move"||o){n(G5(!1));return}if(!t.current&&i&&e.current){const a=iT(e.current);if(!a)return;n(FW([a.x,a.y]))}else t.current=!1;n(HW(!1))},[t,n,i,o,e,r])},AMe=ot([ln],e=>{const{isMoveStageKeyHeld:t,stageScale:n}=e;return{isMoveStageKeyHeld:t,stageScale:n}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),OMe=e=>{const t=Ie(),{isMoveStageKeyHeld:n,stageScale:r}=he(AMe);return w.useCallback(i=>{if(!e.current||n)return;i.evt.preventDefault();const o=e.current.getPointerPosition();if(!o)return;const a={x:(o.x-e.current.x())/r,y:(o.y-e.current.y())/r};let s=i.evt.deltaY;i.evt.ctrlKey&&(s=-s);const l=Ee.clamp(r*rxe**s,ixe,oxe),u={x:o.x-a.x*l,y:o.y-a.y*l};t(Oxe(l)),t(ZW(u))},[e,n,r,t])},MMe=ot(ln,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageDimensions:r,stageScale:i,shouldDarkenOutsideBoundingBox:o,stageCoordinates:a}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,shouldDarkenOutsideBoundingBox:o,stageCoordinates:a,stageDimensions:r,stageScale:i}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),IMe=()=>{const{boundingBoxCoordinates:e,boundingBoxDimensions:t,shouldDarkenOutsideBoundingBox:n,stageCoordinates:r,stageDimensions:i,stageScale:o}=he(MMe);return v.jsxs(sc,{children:[v.jsx(lc,{offsetX:r.x/o,offsetY:r.y/o,height:i.height/o,width:i.width/o,fill:"rgba(0,0,0,0.4)",listening:!1,visible:n}),v.jsx(lc,{x:e.x,y:e.y,width:t.width,height:t.height,fill:"rgb(255,255,255)",listening:!1,visible:n,globalCompositeOperation:"destination-out"})]})},RMe=ot([ln],e=>{const{stageScale:t,stageCoordinates:n,stageDimensions:r}=e;return{stageScale:t,stageCoordinates:n,stageDimensions:r}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),DMe={dark:"rgba(255, 255, 255, 0.2)",green:"rgba(255, 255, 255, 0.2)",light:"rgba(0, 0, 0, 0.2)"},NMe=()=>{const{colorMode:e}=dy(),{stageScale:t,stageCoordinates:n,stageDimensions:r}=he(RMe),[i,o]=w.useState([]),a=w.useCallback(s=>s/t,[t]);return w.useLayoutEffect(()=>{const s=DMe[e],{width:l,height:u}=r,{x:d,y:h}=n,m={x1:0,y1:0,x2:l,y2:u,offset:{x:a(d),y:a(h)}},y={x:Math.ceil(a(d)/64)*64,y:Math.ceil(a(h)/64)*64},b={x1:-y.x,y1:-y.y,x2:a(l)-y.x+64,y2:a(u)-y.y+64},E={x1:Math.min(m.x1,b.x1),y1:Math.min(m.y1,b.y1),x2:Math.max(m.x2,b.x2),y2:Math.max(m.y2,b.y2)},k=E.x2-E.x1,_=E.y2-E.y1,T=Math.round(k/64)+1,A=Math.round(_/64)+1,I=Ee.range(0,T).map(D=>v.jsx(cS,{x:E.x1+D*64,y:E.y1,points:[0,0,0,_],stroke:s,strokeWidth:1},`x_${D}`)),R=Ee.range(0,A).map(D=>v.jsx(cS,{x:E.x1,y:E.y1+D*64,points:[0,0,k,0],stroke:s,strokeWidth:1},`y_${D}`));o(I.concat(R))},[t,n,r,e,a]),v.jsx(sc,{children:i})},jMe=ot([e=>e.gallery],e=>e.intermediateImage?e.intermediateImage:null,{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),BMe=e=>{const{...t}=e,n=he(jMe),[r,i]=w.useState(null);if(w.useEffect(()=>{if(!n)return;const u=new Image;u.onload=()=>{i(u)},u.src=n.url},[n]),!(n!=null&&n.boundingBox))return null;const{boundingBox:{x:o,y:a,width:s,height:l}}=n;return r?v.jsx(IY,{x:o,y:a,width:s,height:l,image:r,listening:!1,...t}):null},Hh=e=>{const{r:t,g:n,b:r,a:i}=e;return`rgba(${t}, ${n}, ${r}, ${i})`},FMe=ot(ln,e=>{const{maskColor:t,stageCoordinates:n,stageDimensions:r,stageScale:i}=e;return{stageCoordinates:n,stageDimensions:r,stageScale:i,maskColorString:Hh(t)}}),aN=e=>`data:image/svg+xml;utf8, + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +`.replaceAll("black",e),$Me=e=>{const{...t}=e,{maskColorString:n,stageCoordinates:r,stageDimensions:i,stageScale:o}=he(FMe),[a,s]=w.useState(null),[l,u]=w.useState(0),d=w.useRef(null),h=w.useCallback(()=>{u(l+1),setTimeout(h,500)},[l]);return w.useEffect(()=>{if(a)return;const m=new Image;m.onload=()=>{s(m)},m.src=aN(n)},[a,n]),w.useEffect(()=>{a&&(a.src=aN(n))},[a,n]),w.useEffect(()=>{const m=setInterval(()=>u(y=>(y+1)%5),50);return()=>clearInterval(m)},[]),!a||!Ee.isNumber(r.x)||!Ee.isNumber(r.y)||!Ee.isNumber(o)||!Ee.isNumber(i.width)||!Ee.isNumber(i.height)?null:v.jsx(lc,{ref:d,offsetX:r.x/o,offsetY:r.y/o,height:i.height/o,width:i.width/o,fillPatternImage:a,fillPatternOffsetY:Ee.isNumber(l)?l:0,fillPatternRepeat:"repeat",fillPatternScale:{x:1/o,y:1/o},listening:!0,globalCompositeOperation:"source-in",...t})},zMe=ot([ln],e=>({objects:e.layerState.objects}),{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),HMe=e=>{const{...t}=e,{objects:n}=he(zMe);return v.jsx(sc,{listening:!1,...t,children:n.filter(tP).map((r,i)=>v.jsx(cS,{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"},i))})};var lh=w,VMe=function(t,n,r){const i=lh.useRef("loading"),o=lh.useRef(),[a,s]=lh.useState(0),l=lh.useRef(),u=lh.useRef(),d=lh.useRef();return(l.current!==t||u.current!==n||d.current!==r)&&(i.current="loading",o.current=void 0,l.current=t,u.current=n,d.current=r),lh.useLayoutEffect(function(){if(!t)return;var h=document.createElement("img");function m(){i.current="loaded",o.current=h,s(Math.random())}function y(){i.current="failed",o.current=void 0,s(Math.random())}return h.addEventListener("load",m),h.addEventListener("error",y),n&&(h.crossOrigin=n),r&&(h.referrerpolicy=r),h.src=t,function(){h.removeEventListener("load",m),h.removeEventListener("error",y)}},[t,n,r]),[o.current,i.current]};const DY=e=>{const{url:t,x:n,y:r}=e,[i]=VMe(t);return v.jsx(IY,{x:n,y:r,image:i,listening:!1})},WMe=ot([ln],e=>{const{layerState:{objects:t}}=e;return{objects:t}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),UMe=()=>{const{objects:e}=he(WMe);return e?v.jsx(sc,{name:"outpainting-objects",listening:!1,children:e.map((t,n)=>{if(U5(t))return v.jsx(DY,{x:t.x,y:t.y,url:t.image.url},n);if(lxe(t)){const r=v.jsx(cS,{points:t.points,stroke:t.color?Hh(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?v.jsx(sc,{clipX:t.clip.x,clipY:t.clip.y,clipWidth:t.clip.width,clipHeight:t.clip.height,children:r},n):r}else{if(uxe(t))return v.jsx(lc,{x:t.x,y:t.y,width:t.width,height:t.height,fill:Hh(t.color)},n);if(cxe(t))return v.jsx(lc,{x:t.x,y:t.y,width:t.width,height:t.height,fill:"rgb(255, 255, 255)",globalCompositeOperation:"destination-out"},n)}})}):null},GMe=ot([ln],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingImage:r,shouldShowStagingOutline:i,boundingBoxCoordinates:{x:o,y:a},boundingBoxDimensions:{width:s,height:l}}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shouldShowStagingImage:r,shouldShowStagingOutline:i,x:o,y:a,width:s,height:l}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),qMe=e=>{const{...t}=e,{currentStagingAreaImage:n,shouldShowStagingImage:r,shouldShowStagingOutline:i,x:o,y:a,width:s,height:l}=he(GMe);return v.jsxs(sc,{...t,children:[r&&n&&v.jsx(DY,{url:n.image.url,x:o,y:a}),i&&v.jsxs(sc,{children:[v.jsx(lc,{x:o,y:a,width:s,height:l,strokeWidth:1,stroke:"white",strokeScaleEnabled:!1}),v.jsx(lc,{x:o,y:a,width:s,height:l,dash:[4,4],strokeWidth:1,stroke:"black",strokeScaleEnabled:!1})]})]})},YMe=ot([ln],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingOutline:r,shouldShowStagingImage:i}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shouldShowStagingImage:i,shouldShowStagingOutline:r}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),KMe=()=>{const e=Ie(),{isOnFirstImage:t,isOnLastImage:n,currentStagingAreaImage:r,shouldShowStagingImage:i}=he(YMe),{t:o}=Ve(),a=w.useCallback(()=>{e(NI(!0))},[e]),s=w.useCallback(()=>{e(NI(!1))},[e]);Qe(["left"],()=>{l()},{enabled:()=>!0,preventDefault:!0}),Qe(["right"],()=>{u()},{enabled:()=>!0,preventDefault:!0}),Qe(["enter"],()=>{d()},{enabled:()=>!0,preventDefault:!0});const l=()=>e(Sxe()),u=()=>e(bxe()),d=()=>e(mxe());return r?v.jsx(qe,{pos:"absolute",bottom:"1rem",w:"100%",align:"center",justify:"center",filter:"drop-shadow(0 0.5rem 1rem rgba(0,0,0))",onMouseOver:a,onMouseOut:s,children:v.jsxs(oo,{isAttached:!0,children:[v.jsx(Ze,{tooltip:`${o("unifiedcanvas:previous")} (Left)`,"aria-label":`${o("unifiedcanvas:previous")} (Left)`,icon:v.jsx(qke,{}),onClick:l,"data-selected":!0,isDisabled:t}),v.jsx(Ze,{tooltip:`${o("unifiedcanvas:next")} (Right)`,"aria-label":`${o("unifiedcanvas:next")} (Right)`,icon:v.jsx(Yke,{}),onClick:u,"data-selected":!0,isDisabled:n}),v.jsx(Ze,{tooltip:`${o("unifiedcanvas:accept")} (Enter)`,"aria-label":`${o("unifiedcanvas:accept")} (Enter)`,icon:v.jsx(PP,{}),onClick:d,"data-selected":!0}),v.jsx(Ze,{tooltip:o("unifiedcanvas:showHide"),"aria-label":o("unifiedcanvas:showHide"),"data-alert":!i,icon:i?v.jsx(tEe,{}):v.jsx(eEe,{}),onClick:()=>e(Axe(!i)),"data-selected":!0}),v.jsx(Ze,{tooltip:o("unifiedcanvas:saveToGallery"),"aria-label":o("unifiedcanvas:saveToGallery"),icon:v.jsx(LP,{}),onClick:()=>e(F8e(r.image.url)),"data-selected":!0}),v.jsx(Ze,{tooltip:o("unifiedcanvas:discardAll"),"aria-label":o("unifiedcanvas:discardAll"),icon:v.jsx(zy,{style:{transform:"rotate(45deg)"}}),onClick:()=>e(vxe()),"data-selected":!0,style:{backgroundColor:"var(--btn-delete-image)"},fontSize:20})]})}):null},fm=e=>Math.round(e*100)/100,XMe=ot([ln],e=>{const{cursorPosition:t}=e,{cursorX:n,cursorY:r}=t?{cursorX:t.x,cursorY:t.y}:{cursorX:-1,cursorY:-1};return{cursorCoordinatesString:`(${fm(n)}, ${fm(r)})`}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}});function ZMe(){const{cursorCoordinatesString:e}=he(XMe),{t}=Ve();return v.jsx("div",{children:`${t("unifiedcanvas:cursorPosition")}: ${e}`})}const QMe=ot([ln],e=>{const{stageDimensions:{width:t,height:n},stageCoordinates:{x:r,y:i},boundingBoxDimensions:{width:o,height:a},scaledBoundingBoxDimensions:{width:s,height:l},boundingBoxCoordinates:{x:u,y:d},stageScale:h,shouldShowCanvasDebugInfo:m,layer:y,boundingBoxScaleMethod:b}=e;let S="inherit";return(b==="none"&&(o<512||a<512)||b==="manual"&&s*l<512*512)&&(S="var(--status-working-color)"),{activeLayerColor:y==="mask"?"var(--status-working-color)":"inherit",activeLayerString:y.charAt(0).toUpperCase()+y.slice(1),boundingBoxColor:S,boundingBoxCoordinatesString:`(${fm(u)}, ${fm(d)})`,boundingBoxDimensionsString:`${o}×${a}`,scaledBoundingBoxDimensionsString:`${s}×${l}`,canvasCoordinatesString:`${fm(r)}×${fm(i)}`,canvasDimensionsString:`${t}×${n}`,canvasScaleString:Math.round(h*100),shouldShowCanvasDebugInfo:m,shouldShowBoundingBox:b!=="auto",shouldShowScaledBoundingBox:b!=="none"}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),JMe=()=>{const{activeLayerColor:e,activeLayerString:t,boundingBoxColor:n,boundingBoxCoordinatesString:r,boundingBoxDimensionsString:i,scaledBoundingBoxDimensionsString:o,shouldShowScaledBoundingBox:a,canvasCoordinatesString:s,canvasDimensionsString:l,canvasScaleString:u,shouldShowCanvasDebugInfo:d,shouldShowBoundingBox:h}=he(QMe),{t:m}=Ve();return v.jsxs("div",{className:"canvas-status-text",children:[v.jsx("div",{style:{color:e},children:`${m("unifiedcanvas:activeLayer")}: ${t}`}),v.jsx("div",{children:`${m("unifiedcanvas:canvasScale")}: ${u}%`}),h&&v.jsx("div",{style:{color:n},children:`${m("unifiedcanvas:boundingBox")}: ${i}`}),a&&v.jsx("div",{style:{color:n},children:`${m("unifiedcanvas:scaledBoundingBox")}: ${o}`}),d&&v.jsxs(v.Fragment,{children:[v.jsx("div",{children:`${m("unifiedcanvas:boundingBoxPosition")}: ${r}`}),v.jsx("div",{children:`${m("unifiedcanvas:canvasDimensions")}: ${l}`}),v.jsx("div",{children:`${m("unifiedcanvas:canvasPosition")}: ${s}`}),v.jsx(ZMe,{})]})]})},eIe=ot(ln,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageScale:r,isDrawing:i,isTransformingBoundingBox:o,isMovingBoundingBox:a,tool:s,shouldSnapToGrid:l}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,isDrawing:i,isMovingBoundingBox:a,isTransformingBoundingBox:o,stageScale:r,shouldSnapToGrid:l,tool:s,hitStrokeWidth:20/r}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),tIe=e=>{const{...t}=e,n=Ie(),{boundingBoxCoordinates:r,boundingBoxDimensions:i,isDrawing:o,isMovingBoundingBox:a,isTransformingBoundingBox:s,stageScale:l,shouldSnapToGrid:u,tool:d,hitStrokeWidth:h}=he(eIe),m=w.useRef(null),y=w.useRef(null),[b,S]=w.useState(!1);w.useEffect(()=>{var te;!m.current||!y.current||(m.current.nodes([y.current]),(te=m.current.getLayer())==null||te.batchDraw())},[]);const E=64*l,k=w.useCallback(te=>{if(!u){n(yC({x:Math.floor(te.target.x()),y:Math.floor(te.target.y())}));return}const q=te.target.x(),F=te.target.y(),U=Gl(q,64),X=Gl(F,64);te.target.x(U),te.target.y(X),n(yC({x:U,y:X}))},[n,u]),_=w.useCallback(()=>{if(!y.current)return;const te=y.current,q=te.scaleX(),F=te.scaleY(),U=Math.round(te.width()*q),X=Math.round(te.height()*F),Z=Math.round(te.x()),W=Math.round(te.y());n(Ev({width:U,height:X})),n(yC({x:u?Ed(Z,64):Z,y:u?Ed(W,64):W})),te.scaleX(1),te.scaleY(1)},[n,u]),T=w.useCallback((te,q,F)=>{const U=te.x%E,X=te.y%E;return{x:Ed(q.x,E)+U,y:Ed(q.y,E)+X}},[E]),A=()=>{n(SC(!0))},I=()=>{n(SC(!1)),n(bC(!1)),n(Cb(!1)),S(!1)},R=()=>{n(bC(!0))},D=()=>{n(SC(!1)),n(bC(!1)),n(Cb(!1)),S(!1)},j=()=>{S(!0)},z=()=>{!s&&!a&&S(!1)},V=()=>{n(Cb(!0))},K=()=>{n(Cb(!1))};return v.jsxs(sc,{...t,children:[v.jsx(lc,{height:i.height,width:i.width,x:r.x,y:r.y,onMouseEnter:V,onMouseOver:V,onMouseLeave:K,onMouseOut:K}),v.jsx(lc,{draggable:!0,fillEnabled:!1,height:i.height,hitStrokeWidth:h,listening:!o&&d==="move",onDragStart:R,onDragEnd:D,onDragMove:k,onMouseDown:R,onMouseOut:z,onMouseOver:j,onMouseEnter:j,onMouseUp:D,onTransform:_,onTransformEnd:I,ref:y,stroke:b?"rgba(255,255,255,0.7)":"white",strokeWidth:(b?8:1)/l,width:i.width,x:r.x,y:r.y}),v.jsx(vMe,{anchorCornerRadius:3,anchorDragBoundFunc:T,anchorFill:"rgba(212,216,234,1)",anchorSize:15,anchorStroke:"rgb(42,42,42)",borderDash:[4,4],borderEnabled:!0,borderStroke:"black",draggable:!1,enabledAnchors:d==="move"?void 0:[],flipEnabled:!1,ignoreStroke:!0,keepRatio:!1,listening:!o&&d==="move",onDragStart:R,onDragEnd:D,onMouseDown:A,onMouseUp:I,onTransformEnd:I,ref:m,rotateEnabled:!1})]})},nIe=ot(ln,e=>{const{cursorPosition:t,brushSize:n,colorPickerColor:r,maskColor:i,brushColor:o,tool:a,layer:s,shouldShowBrush:l,isMovingBoundingBox:u,isTransformingBoundingBox:d,stageScale:h,stageDimensions:m,boundingBoxCoordinates:y,boundingBoxDimensions:b,shouldRestrictStrokesToBox:S}=e,E=S?{clipX:y.x,clipY:y.y,clipWidth:b.width,clipHeight:b.height}:{};return{cursorPosition:t,brushX:t?t.x:m.width/2,brushY:t?t.y:m.height/2,radius:n/2,colorPickerOuterRadius:RI/h,colorPickerInnerRadius:(RI-l8+1)/h,maskColorString:Hh({...i,a:.5}),brushColorString:Hh(o),colorPickerColorString:Hh(r),tool:a,layer:s,shouldShowBrush:l,shouldDrawBrushPreview:!(u||d||!t)&&l,strokeWidth:1.5/h,dotRadius:1.5/h,clip:E}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),rIe=e=>{const{...t}=e,{brushX:n,brushY:r,radius:i,maskColorString:o,tool:a,layer:s,shouldDrawBrushPreview:l,dotRadius:u,strokeWidth:d,brushColorString:h,colorPickerColorString:m,colorPickerInnerRadius:y,colorPickerOuterRadius:b,clip:S}=he(nIe);return l?v.jsxs(sc,{listening:!1,...S,...t,children:[a==="colorPicker"?v.jsxs(v.Fragment,{children:[v.jsx(sh,{x:n,y:r,radius:b,stroke:h,strokeWidth:l8,strokeScaleEnabled:!1}),v.jsx(sh,{x:n,y:r,radius:y,stroke:m,strokeWidth:l8,strokeScaleEnabled:!1})]}):v.jsxs(v.Fragment,{children:[v.jsx(sh,{x:n,y:r,radius:i,fill:s==="mask"?o:h,globalCompositeOperation:a==="eraser"?"destination-out":"source-out"}),v.jsx(sh,{x:n,y:r,radius:i,stroke:"rgba(255,255,255,0.4)",strokeWidth:d*2,strokeEnabled:!0,listening:!1}),v.jsx(sh,{x:n,y:r,radius:i,stroke:"rgba(0,0,0,1)",strokeWidth:d,strokeEnabled:!0,listening:!1})]}),v.jsx(sh,{x:n,y:r,radius:u*2,fill:"rgba(255,255,255,0.4)",listening:!1}),v.jsx(sh,{x:n,y:r,radius:u,fill:"rgba(0,0,0,1)",listening:!1})]}):null},iIe=ot([ln,Mr],(e,t)=>{const{isMaskEnabled:n,stageScale:r,shouldShowBoundingBox:i,isTransformingBoundingBox:o,isMouseOverBoundingBox:a,isMovingBoundingBox:s,stageDimensions:l,stageCoordinates:u,tool:d,isMovingStage:h,shouldShowIntermediates:m,shouldShowGrid:y,shouldRestrictStrokesToBox:b}=e;let S="none";return d==="move"||t?h?S="grabbing":S="grab":o?S=void 0:b&&!a&&(S="default"),{isMaskEnabled:n,isModifyingBoundingBox:o||s,shouldShowBoundingBox:i,shouldShowGrid:y,stageCoordinates:u,stageCursor:S,stageDimensions:l,stageScale:r,tool:d,isStaging:t,shouldShowIntermediates:m}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),NY=()=>{const{isMaskEnabled:e,isModifyingBoundingBox:t,shouldShowBoundingBox:n,shouldShowGrid:r,stageCoordinates:i,stageCursor:o,stageDimensions:a,stageScale:s,tool:l,isStaging:u,shouldShowIntermediates:d}=he(iIe);wMe();const h=w.useRef(null),m=w.useRef(null),y=w.useCallback(z=>{b8e(z),h.current=z},[]),b=w.useCallback(z=>{y8e(z),m.current=z},[]),S=w.useRef({x:0,y:0}),E=w.useRef(!1),k=OMe(h),_=_Me(h),T=LMe(h,E),A=EMe(h,E,S),I=PMe(),{handleDragStart:R,handleDragMove:D,handleDragEnd:j}=SMe();return v.jsx("div",{className:"inpainting-canvas-container",children:v.jsxs("div",{className:"inpainting-canvas-wrapper",children:[v.jsxs(yMe,{tabIndex:-1,ref:y,className:"inpainting-canvas-stage",style:{...o?{cursor:o}:{}},x:i.x,y:i.y,width:a.width,height:a.height,scale:{x:s,y:s},onTouchStart:_,onTouchMove:A,onTouchEnd:T,onMouseDown:_,onMouseLeave:I,onMouseMove:A,onMouseUp:T,onDragStart:R,onDragMove:D,onDragEnd:j,onContextMenu:z=>z.evt.preventDefault(),onWheel:k,draggable:(l==="move"||u)&&!t,children:[v.jsx(pv,{id:"grid",visible:r,children:v.jsx(NMe,{})}),v.jsx(pv,{id:"base",ref:b,listening:!1,imageSmoothingEnabled:!1,children:v.jsx(UMe,{})}),v.jsxs(pv,{id:"mask",visible:e,listening:!1,children:[v.jsx(HMe,{visible:!0,listening:!1}),v.jsx($Me,{listening:!1})]}),v.jsx(pv,{children:v.jsx(IMe,{})}),v.jsxs(pv,{id:"preview",imageSmoothingEnabled:!1,children:[!u&&v.jsx(rIe,{visible:l!=="move",listening:!1}),v.jsx(qMe,{visible:u}),d&&v.jsx(BMe,{}),v.jsx(tIe,{visible:n&&!u})]})]}),v.jsx(JMe,{}),v.jsx(KMe,{})]})})},oIe=ot(ln,bq,Or,(e,t,n)=>{const{doesCanvasNeedScaling:r,isCanvasInitialized:i}=e;return{doesCanvasNeedScaling:r,activeTabName:n,initialCanvasImage:t,isCanvasInitialized:i}}),jY=()=>{const e=Ie(),{doesCanvasNeedScaling:t,activeTabName:n,initialCanvasImage:r,isCanvasInitialized:i}=he(oIe),o=w.useRef(null);return w.useLayoutEffect(()=>{window.setTimeout(()=>{if(!o.current)return;const{clientWidth:a,clientHeight:s}=o.current;e(kxe({width:a,height:s})),e(i?Cxe():Dx()),e(vi(!1))},0)},[e,r,t,n,i]),v.jsx("div",{ref:o,className:"inpainting-canvas-area",children:v.jsx(xy,{thickness:"2px",speed:"1s",size:"xl"})})},aIe=ot([ln,Or,ir],(e,t,n)=>{const{futureLayerStates:r}=e;return{canRedo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}});function BY(){const e=Ie(),{canRedo:t,activeTabName:n}=he(aIe),{t:r}=Ve(),i=()=>{e(xxe())};return Qe(["meta+shift+z","ctrl+shift+z","control+y","meta+y"],()=>{i()},{enabled:()=>t,preventDefault:!0},[n,t]),v.jsx(Ze,{"aria-label":`${r("unifiedcanvas:redo")} (Ctrl+Shift+Z)`,tooltip:`${r("unifiedcanvas:redo")} (Ctrl+Shift+Z)`,icon:v.jsx(fEe,{}),onClick:i,isDisabled:!t})}const sIe=ot([ln,Or,ir],(e,t,n)=>{const{pastLayerStates:r}=e;return{canUndo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}});function FY(){const e=Ie(),{t}=Ve(),{canUndo:n,activeTabName:r}=he(sIe),i=()=>{e(Mxe())};return Qe(["meta+z","ctrl+z"],()=>{i()},{enabled:()=>n,preventDefault:!0},[r,n]),v.jsx(Ze,{"aria-label":`${t("unifiedcanvas:undo")} (Ctrl+Z)`,tooltip:`${t("unifiedcanvas:undo")} (Ctrl+Z)`,icon:v.jsx(mEe,{}),onClick:i,isDisabled:!n})}const lIe=(e,t,n)=>{const r=document.createElement("img");r.addEventListener("load",()=>{const i=document.createElement("canvas");i.width=t,i.height=n;const o=i.getContext("2d");o&&(o.drawImage(r,0,0),i.toBlob(a=>{a&&navigator.clipboard.write([new ClipboardItem({[a.type]:a})])}),i.remove(),r.remove())}),r.src=e},uIe=e=>{const t=document.createElement("a");t.href=e,t.download="",document.body.appendChild(t),t.click(),document.body.removeChild(t),t.remove()},cIe=(e,t,n,r)=>{const i=e.scale(),o=e.getClientRect({relativeTo:e.getParent()});e.scale({x:1/t,y:1/t});const{x:a,y:s,width:l,height:u}=e.getClientRect(),d=r?{x:r.x+n.x,y:r.y+n.y,width:r.width,height:r.height}:{x:a,y:s,width:l,height:u},h=e.toDataURL(d);return e.scale(i),{dataURL:h,boundingBox:{x:o.x,y:o.y,width:l,height:u}}},dIe={cropVisible:!1,cropToBoundingBox:!1,shouldSaveToGallery:!1,shouldDownload:!1,shouldCopy:!1,shouldSetAsInitialImage:!0},Td=(e=dIe)=>async(t,n)=>{const{cropVisible:r,cropToBoundingBox:i,shouldSaveToGallery:o,shouldDownload:a,shouldCopy:s,shouldSetAsInitialImage:l}=e;t(tCe("Exporting Image")),t(lm(!1));const u=n(),{stageScale:d,boundingBoxCoordinates:h,boundingBoxDimensions:m,stageCoordinates:y}=u.canvas,b=el();if(!b){t(Hs(!1)),t(lm(!0));return}const{dataURL:S,boundingBox:E}=cIe(b,d,y,i?{...h,...m}:void 0);if(!S){t(Hs(!1)),t(lm(!0));return}const k=new FormData;k.append("data",JSON.stringify({dataURL:S,filename:"merged_canvas.png",kind:o?"result":"temp",cropVisible:r}));const T=await(await fetch(`${window.location.origin}/upload`,{method:"POST",body:k})).json(),{url:A,width:I,height:R}=T,D={uuid:cm(),category:o?"result":"user",...T};a&&(uIe(A),t(Th({title:zt.t("toast:downloadImageStarted"),status:"success",duration:2500,isClosable:!0}))),s&&(lIe(A,I,R),t(Th({title:zt.t("toast:imageCopied"),status:"success",duration:2500,isClosable:!0}))),o&&(t(sm({image:D,category:"result"})),t(Th({title:zt.t("toast:imageSavedToGallery"),status:"success",duration:2500,isClosable:!0}))),l&&(t(Txe({kind:"image",layer:"base",...E,image:D})),t(Th({title:zt.t("toast:canvasMerged"),status:"success",duration:2500,isClosable:!0}))),t(Hs(!1)),t(D4(zt.t("common:statusConnected"))),t(lm(!0))};function fIe(){const e=he(Mr),t=el(),n=he(s=>s.system.isProcessing),r=he(s=>s.canvas.shouldCropToBoundingBoxOnSave),i=Ie(),{t:o}=Ve();Qe(["meta+c","ctrl+c"],()=>{a()},{enabled:()=>!e,preventDefault:!0},[t,n]);const a=()=>{i(Td({cropVisible:!r,cropToBoundingBox:r,shouldCopy:!0}))};return v.jsx(Ze,{"aria-label":`${o("unifiedcanvas:copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${o("unifiedcanvas:copyToClipboard")} (Cmd/Ctrl+C)`,icon:v.jsx(o0,{}),onClick:a,isDisabled:e})}function hIe(){const e=Ie(),{t}=Ve(),n=el(),r=he(Mr),i=he(s=>s.system.isProcessing),o=he(s=>s.canvas.shouldCropToBoundingBoxOnSave);Qe(["shift+d"],()=>{a()},{enabled:()=>!r,preventDefault:!0},[n,i]);const a=()=>{e(Td({cropVisible:!o,cropToBoundingBox:o,shouldDownload:!0}))};return v.jsx(Ze,{"aria-label":`${t("unifiedcanvas:downloadAsImage")} (Shift+D)`,tooltip:`${t("unifiedcanvas:downloadAsImage")} (Shift+D)`,icon:v.jsx(TP,{}),onClick:a,isDisabled:r})}function pIe(){const e=he(Mr),{openUploader:t}=xP(),{t:n}=Ve();return v.jsx(Ze,{"aria-label":n("common:upload"),tooltip:n("common:upload"),icon:v.jsx(Zx,{}),onClick:t,isDisabled:e})}const gIe=ot([ln,Mr],(e,t)=>{const{layer:n,isMaskEnabled:r}=e;return{layer:n,isMaskEnabled:r,isStaging:t}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}});function mIe(){const e=Ie(),{t}=Ve(),{layer:n,isMaskEnabled:r,isStaging:i}=he(gIe),o=()=>{e(q5(n==="mask"?"base":"mask"))};Qe(["q"],()=>{o()},{enabled:()=>!i,preventDefault:!0},[n]);const a=s=>{const l=s.target.value;e(q5(l)),l==="mask"&&!r&&e(Dy(!0))};return v.jsx(tl,{tooltip:`${t("unifiedcanvas:layer")} (Q)`,tooltipProps:{hasArrow:!0,placement:"top"},value:n,validValues:DW,onChange:a,isDisabled:i})}function vIe(){const e=Ie(),{t}=Ve(),n=el(),r=he(Mr),i=he(a=>a.system.isProcessing);Qe(["shift+m"],()=>{o()},{enabled:()=>!r,preventDefault:!0},[n,i]);const o=()=>{e(Td({cropVisible:!1,shouldSetAsInitialImage:!0}))};return v.jsx(Ze,{"aria-label":`${t("unifiedcanvas:mergeVisible")} (Shift+M)`,tooltip:`${t("unifiedcanvas:mergeVisible")} (Shift+M)`,icon:v.jsx(vq,{}),onClick:o,isDisabled:r})}function yIe(){const e=he(o=>o.canvas.tool),t=he(Mr),n=Ie(),{t:r}=Ve();Qe(["v"],()=>{i()},{enabled:()=>!t,preventDefault:!0},[]);const i=()=>n(tu("move"));return v.jsx(Ze,{"aria-label":`${r("unifiedcanvas:move")} (V)`,tooltip:`${r("unifiedcanvas:move")} (V)`,icon:v.jsx(dq,{}),"data-selected":e==="move"||t,onClick:i})}function bIe(){const e=he(i=>i.ui.shouldPinParametersPanel),t=Ie(),{t:n}=Ve(),r=()=>{t(Ku(!0)),e&&setTimeout(()=>t(vi(!0)),400)};return v.jsxs(qe,{flexDirection:"column",gap:"0.5rem",children:[v.jsx(Ze,{tooltip:`${n("parameters:showOptionsPanel")} (O)`,tooltipProps:{placement:"top"},"aria-label":n("parameters:showOptionsPanel"),onClick:r,children:v.jsx(AP,{})}),v.jsx(qe,{children:v.jsx(XP,{iconButton:!0})}),v.jsx(qe,{children:v.jsx(YP,{width:"100%",height:"40px"})})]})}function SIe(){const e=Ie(),{t}=Ve(),n=he(Mr),r=()=>{e(rP()),e(Dx())};return v.jsx(Ze,{"aria-label":t("unifiedcanvas:clearCanvas"),tooltip:t("unifiedcanvas:clearCanvas"),icon:v.jsx(vp,{}),onClick:r,style:{backgroundColor:"var(--btn-delete-image)"},isDisabled:n})}function $Y(e,t,n=250){const[r,i]=w.useState(0);return w.useEffect(()=>{const o=setTimeout(()=>{r===1&&e(),i(0)},n);return r===2&&t(),()=>clearTimeout(o)},[r,e,t,n]),()=>i(o=>o+1)}function xIe(){const e=el(),t=Ie(),{t:n}=Ve();Qe(["r"],()=>{i()},{enabled:()=>!0,preventDefault:!0},[e]);const r=$Y(()=>i(!1),()=>i(!0)),i=(o=!1)=>{const a=el();if(!a)return;const s=a.getClientRect({skipTransform:!0});t(zW({contentRect:s,shouldScaleTo1:o}))};return v.jsx(Ze,{"aria-label":`${n("unifiedcanvas:resetView")} (R)`,tooltip:`${n("unifiedcanvas:resetView")} (R)`,icon:v.jsx(hq,{}),onClick:r})}function wIe(){const e=he(Mr),t=el(),n=he(s=>s.system.isProcessing),r=he(s=>s.canvas.shouldCropToBoundingBoxOnSave),i=Ie(),{t:o}=Ve();Qe(["shift+s"],()=>{a()},{enabled:()=>!e,preventDefault:!0},[t,n]);const a=()=>{i(Td({cropVisible:!r,cropToBoundingBox:r,shouldSaveToGallery:!0}))};return v.jsx(Ze,{"aria-label":`${o("unifiedcanvas:saveToGallery")} (Shift+S)`,tooltip:`${o("unifiedcanvas:saveToGallery")} (Shift+S)`,icon:v.jsx(LP,{}),onClick:a,isDisabled:e})}const CIe=ot([ln,Mr,ir],(e,t,n)=>{const{isProcessing:r}=n,{tool:i}=e;return{tool:i,isStaging:t,isProcessing:r}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),_Ie=()=>{const e=Ie(),{t}=Ve(),{tool:n,isStaging:r}=he(CIe);Qe(["b"],()=>{i()},{enabled:()=>!r,preventDefault:!0},[]),Qe(["e"],()=>{o()},{enabled:()=>!r,preventDefault:!0},[n]),Qe(["c"],()=>{a()},{enabled:()=>!r,preventDefault:!0},[n]),Qe(["shift+f"],()=>{s()},{enabled:()=>!r,preventDefault:!0}),Qe(["delete","backspace"],()=>{l()},{enabled:()=>!r,preventDefault:!0});const i=()=>e(tu("brush")),o=()=>e(tu("eraser")),a=()=>e(tu("colorPicker")),s=()=>e(BW()),l=()=>e(jW());return v.jsxs(qe,{flexDirection:"column",gap:"0.5rem",children:[v.jsxs(oo,{children:[v.jsx(Ze,{"aria-label":`${t("unifiedcanvas:brush")} (B)`,tooltip:`${t("unifiedcanvas:brush")} (B)`,icon:v.jsx(yq,{}),"data-selected":n==="brush"&&!r,onClick:i,isDisabled:r}),v.jsx(Ze,{"aria-label":`${t("unifiedcanvas:eraser")} (E)`,tooltip:`${t("unifiedcanvas:eraser")} (B)`,icon:v.jsx(pq,{}),"data-selected":n==="eraser"&&!r,isDisabled:r,onClick:o})]}),v.jsxs(oo,{children:[v.jsx(Ze,{"aria-label":`${t("unifiedcanvas:fillBoundingBox")} (Shift+F)`,tooltip:`${t("unifiedcanvas:fillBoundingBox")} (Shift+F)`,icon:v.jsx(mq,{}),isDisabled:r,onClick:s}),v.jsx(Ze,{"aria-label":`${t("unifiedcanvas:eraseBoundingBox")} (Del/Backspace)`,tooltip:`${t("unifiedcanvas:eraseBoundingBox")} (Del/Backspace)`,icon:v.jsx(zy,{style:{transform:"rotate(45deg)"}}),isDisabled:r,onClick:l})]}),v.jsx(Ze,{"aria-label":`${t("unifiedcanvas:colorPicker")} (C)`,tooltip:`${t("unifiedcanvas:colorPicker")} (C)`,icon:v.jsx(gq,{}),"data-selected":n==="colorPicker"&&!r,isDisabled:r,onClick:a,width:"max-content"})]})},oT=Oe((e,t)=>{const{acceptButtonText:n="Accept",acceptCallback:r,cancelButtonText:i="Cancel",cancelCallback:o,children:a,title:s,triggerComponent:l}=e,{isOpen:u,onOpen:d,onClose:h}=Wh(),m=w.useRef(null),y=()=>{r(),h()},b=()=>{o&&o(),h()};return v.jsxs(v.Fragment,{children:[w.cloneElement(l,{onClick:d,ref:t}),v.jsx(AV,{isOpen:u,leastDestructiveRef:m,onClose:h,children:v.jsx(Kd,{children:v.jsxs(OV,{className:"modal",children:[v.jsx(w0,{fontSize:"lg",fontWeight:"bold",children:s}),v.jsx(n0,{children:a}),v.jsxs(bx,{children:[v.jsx(as,{ref:m,onClick:b,className:"modal-close-btn",children:i}),v.jsx(as,{colorScheme:"red",onClick:y,ml:3,children:n})]})]})})})]})}),zY=()=>{const e=he(Mr),t=Ie(),{t:n}=Ve(),r=()=>{t($8e()),t(rP()),t($W())};return v.jsxs(oT,{title:n("unifiedcanvas:emptyTempImageFolder"),acceptCallback:r,acceptButtonText:n("unifiedcanvas:emptyFolder"),triggerComponent:v.jsx(cr,{leftIcon:v.jsx(vp,{}),size:"sm",isDisabled:e,children:n("unifiedcanvas:emptyTempImageFolder")}),children:[v.jsx("p",{children:n("unifiedcanvas:emptyTempImagesFolderMessage")}),v.jsx("br",{}),v.jsx("p",{children:n("unifiedcanvas:emptyTempImagesFolderConfirm")})]})},HY=()=>{const e=he(Mr),t=Ie(),{t:n}=Ve();return v.jsxs(oT,{title:n("unifiedcanvas:clearCanvasHistory"),acceptCallback:()=>t($W()),acceptButtonText:n("unifiedcanvas:clearHistory"),triggerComponent:v.jsx(cr,{size:"sm",leftIcon:v.jsx(vp,{}),isDisabled:e,children:n("unifiedcanvas:clearCanvasHistory")}),children:[v.jsx("p",{children:n("unifiedcanvas:clearCanvasHistoryMessage")}),v.jsx("br",{}),v.jsx("p",{children:n("unifiedcanvas:clearCanvasHistoryConfirm")})]})},kIe=ot([ln],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:i}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:i}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),EIe=()=>{const e=Ie(),{t}=Ve(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldShowCanvasDebugInfo:i,shouldShowIntermediates:o}=he(kIe);return v.jsx(Zs,{trigger:"hover",triggerComponent:v.jsx(Ze,{tooltip:t("unifiedcanvas:canvasSettings"),tooltipProps:{placement:"bottom"},"aria-label":t("unifiedcanvas:canvasSettings"),icon:v.jsx(OP,{})}),children:v.jsxs(qe,{direction:"column",gap:"0.5rem",children:[v.jsx(er,{label:t("unifiedcanvas:showIntermediates"),isChecked:o,onChange:a=>e(XW(a.target.checked))}),v.jsx(er,{label:t("unifiedcanvas:autoSaveToGallery"),isChecked:n,onChange:a=>e(WW(a.target.checked))}),v.jsx(er,{label:t("unifiedcanvas:saveBoxRegionOnly"),isChecked:r,onChange:a=>e(UW(a.target.checked))}),v.jsx(er,{label:t("unifiedcanvas:showCanvasDebugInfo"),isChecked:i,onChange:a=>e(YW(a.target.checked))}),v.jsx(HY,{}),v.jsx(zY,{})]})})},PIe=()=>{const e=he(t=>t.ui.shouldShowParametersPanel);return v.jsxs(qe,{flexDirection:"column",rowGap:"0.5rem",width:"6rem",children:[v.jsx(mIe,{}),v.jsx(_Ie,{}),v.jsxs(qe,{gap:"0.5rem",children:[v.jsx(yIe,{}),v.jsx(xIe,{})]}),v.jsxs(qe,{columnGap:"0.5rem",children:[v.jsx(vIe,{}),v.jsx(wIe,{})]}),v.jsxs(qe,{columnGap:"0.5rem",children:[v.jsx(fIe,{}),v.jsx(hIe,{})]}),v.jsxs(qe,{gap:"0.5rem",children:[v.jsx(FY,{}),v.jsx(BY,{})]}),v.jsxs(qe,{gap:"0.5rem",children:[v.jsx(pIe,{}),v.jsx(SIe,{})]}),v.jsx(EIe,{}),!e&&v.jsx(bIe,{})]})};function TIe(){const e=Ie(),t=he(i=>i.canvas.brushSize),{t:n}=Ve(),r=he(Mr);return Qe(["BracketLeft"],()=>{e(jm(Math.max(t-5,5)))},{enabled:()=>!r,preventDefault:!0},[t]),Qe(["BracketRight"],()=>{e(jm(Math.min(t+5,500)))},{enabled:()=>!r,preventDefault:!0},[t]),v.jsx(na,{label:n("unifiedcanvas:brushSize"),value:t,withInput:!0,onChange:i=>e(jm(i)),sliderNumberInputProps:{max:500},inputReadOnly:!1,width:"100px",isCompact:!0})}function uw(){return(uw=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}function X8(e){var t=w.useRef(e),n=w.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var l0=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e0:E.buttons>0)&&i.current?o(sN(i.current,E,s.current)):S(!1)},b=function(){return S(!1)};function S(E){var k=l.current,_=Z8(i.current),T=E?_.addEventListener:_.removeEventListener;T(k?"touchmove":"mousemove",y),T(k?"touchend":"mouseup",b)}return[function(E){var k=E.nativeEvent,_=i.current;if(_&&(lN(k),!function(A,I){return I&&!d2(A)}(k,l.current)&&_)){if(d2(k)){l.current=!0;var T=k.changedTouches||[];T.length&&(s.current=T[0].identifier)}_.focus(),o(sN(_,k,s.current)),S(!0)}},function(E){var k=E.which||E.keyCode;k<37||k>40||(E.preventDefault(),a({left:k===39?.05:k===37?-.05:0,top:k===40?.05:k===38?-.05:0}))},S]},[a,o]),d=u[0],h=u[1],m=u[2];return w.useEffect(function(){return m},[m]),N.createElement("div",uw({},r,{onTouchStart:d,onMouseDown:d,className:"react-colorful__interactive",ref:i,onKeyDown:h,tabIndex:0,role:"slider"}))}),cw=function(e){return e.filter(Boolean).join(" ")},sT=function(e){var t=e.color,n=e.left,r=e.top,i=r===void 0?.5:r,o=cw(["react-colorful__pointer",e.className]);return N.createElement("div",{className:o,style:{top:100*i+"%",left:100*n+"%"}},N.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},ko=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},WY=function(e){var t=e.s,n=e.v,r=e.a,i=(200-t)*n/100;return{h:ko(e.h),s:ko(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:ko(i/2),a:ko(r,2)}},Q8=function(e){var t=WY(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},VC=function(e){var t=WY(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},LIe=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var o=Math.floor(t),a=r*(1-n),s=r*(1-(t-o)*n),l=r*(1-(1-t+o)*n),u=o%6;return{r:ko(255*[r,s,a,a,l,r][u]),g:ko(255*[l,r,r,s,a,a][u]),b:ko(255*[a,a,l,r,r,s][u]),a:ko(i,2)}},AIe=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,o=Math.max(t,n,r),a=o-Math.min(t,n,r),s=a?o===t?(n-r)/a:o===n?2+(r-t)/a:4+(t-n)/a:0;return{h:ko(60*(s<0?s+6:s)),s:ko(o?a/o*100:0),v:ko(o/255*100),a:i}},OIe=N.memo(function(e){var t=e.hue,n=e.onChange,r=cw(["react-colorful__hue",e.className]);return N.createElement("div",{className:r},N.createElement(aT,{onMove:function(i){n({h:360*i.left})},onKey:function(i){n({h:l0(t+360*i.left,0,360)})},"aria-label":"Hue","aria-valuenow":ko(t),"aria-valuemax":"360","aria-valuemin":"0"},N.createElement(sT,{className:"react-colorful__hue-pointer",left:t/360,color:Q8({h:t,s:100,v:100,a:1})})))}),MIe=N.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:Q8({h:t.h,s:100,v:100,a:1})};return N.createElement("div",{className:"react-colorful__saturation",style:r},N.createElement(aT,{onMove:function(i){n({s:100*i.left,v:100-100*i.top})},onKey:function(i){n({s:l0(t.s+100*i.left,0,100),v:l0(t.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+ko(t.s)+"%, Brightness "+ko(t.v)+"%"},N.createElement(sT,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:Q8(t)})))}),UY=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function IIe(e,t,n){var r=X8(n),i=w.useState(function(){return e.toHsva(t)}),o=i[0],a=i[1],s=w.useRef({color:t,hsva:o});w.useEffect(function(){if(!e.equal(t,s.current.color)){var u=e.toHsva(t);s.current={hsva:u,color:t},a(u)}},[t,e]),w.useEffect(function(){var u;UY(o,s.current.hsva)||e.equal(u=e.fromHsva(o),s.current.color)||(s.current={hsva:o,color:u},r(u))},[o,e,r]);var l=w.useCallback(function(u){a(function(d){return Object.assign({},d,u)})},[]);return[o,l]}var RIe=typeof window<"u"?w.useLayoutEffect:w.useEffect,DIe=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},uN=new Map,NIe=function(e){RIe(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!uN.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,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,uN.set(t,n);var r=DIe();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},jIe=function(e){var t=e.className,n=e.hsva,r=e.onChange,i={backgroundImage:"linear-gradient(90deg, "+VC(Object.assign({},n,{a:0}))+", "+VC(Object.assign({},n,{a:1}))+")"},o=cw(["react-colorful__alpha",t]),a=ko(100*n.a);return N.createElement("div",{className:o},N.createElement("div",{className:"react-colorful__alpha-gradient",style:i}),N.createElement(aT,{onMove:function(s){r({a:s.left})},onKey:function(s){r({a:l0(n.a+s.left)})},"aria-label":"Alpha","aria-valuetext":a+"%","aria-valuenow":a,"aria-valuemin":"0","aria-valuemax":"100"},N.createElement(sT,{className:"react-colorful__alpha-pointer",left:n.a,color:VC(n)})))},BIe=function(e){var t=e.className,n=e.colorModel,r=e.color,i=r===void 0?n.defaultColor:r,o=e.onChange,a=VY(e,["className","colorModel","color","onChange"]),s=w.useRef(null);NIe(s);var l=IIe(n,i,o),u=l[0],d=l[1],h=cw(["react-colorful",t]);return N.createElement("div",uw({},a,{ref:s,className:h}),N.createElement(MIe,{hsva:u,onChange:d}),N.createElement(OIe,{hue:u.h,onChange:d}),N.createElement(jIe,{hsva:u,onChange:d,className:"react-colorful__last-control"}))},FIe={defaultColor:{r:0,g:0,b:0,a:1},toHsva:AIe,fromHsva:LIe,equal:UY},$Ie=function(e){return N.createElement(BIe,uw({},e,{colorModel:FIe}))};const dS=e=>{const{styleClass:t,...n}=e;return v.jsx($Ie,{className:`invokeai__color-picker ${t}`,...n})},zIe=ot([ln,Mr],(e,t)=>{const{brushColor:n,maskColor:r,layer:i}=e;return{brushColor:n,maskColor:r,layer:i,isStaging:t}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}});function HIe(){const e=Ie(),{brushColor:t,maskColor:n,layer:r,isStaging:i}=he(zIe),o=()=>{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 Qe(["shift+BracketLeft"],()=>{e(Nm({...t,a:Ee.clamp(t.a-.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[t]),Qe(["shift+BracketRight"],()=>{e(Nm({...t,a:Ee.clamp(t.a+.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[t]),v.jsx(Zs,{trigger:"hover",triggerComponent:v.jsx(_o,{style:{width:"30px",height:"30px",minWidth:"30px",minHeight:"30px",borderRadius:"99999999px",backgroundColor:o(),cursor:"pointer"}}),children:v.jsxs(qe,{minWidth:"15rem",direction:"column",gap:"1rem",width:"100%",children:[r==="base"&&v.jsx(dS,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:t,onChange:a=>e(Nm(a))}),r==="mask"&&v.jsx(dS,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:n,onChange:a=>e(VW(a))})]})})}function GY(){return v.jsxs(qe,{columnGap:"1rem",alignItems:"center",children:[v.jsx(TIe,{}),v.jsx(HIe,{})]})}function VIe(){const e=Ie(),t=he(r=>r.canvas.shouldRestrictStrokesToBox),{t:n}=Ve();return v.jsx(er,{label:n("unifiedcanvas:betaLimitToBox"),isChecked:t,onChange:r=>e(QW(r.target.checked))})}function WIe(){return v.jsxs(qe,{gap:"1rem",alignItems:"center",children:[v.jsx(GY,{}),v.jsx(VIe,{})]})}function UIe(){const e=Ie(),{t}=Ve(),n=()=>e(nP());return v.jsx(cr,{size:"sm",leftIcon:v.jsx(vp,{}),onClick:n,tooltip:`${t("unifiedcanvas:clearMask")} (Shift+C)`,children:t("unifiedcanvas:betaClear")})}function GIe(){const e=he(i=>i.canvas.isMaskEnabled),t=Ie(),{t:n}=Ve(),r=()=>t(Dy(!e));return v.jsx(er,{label:`${n("unifiedcanvas:enableMask")} (H)`,isChecked:e,onChange:r})}function qIe(){const e=Ie(),{t}=Ve(),n=he(r=>r.canvas.shouldPreserveMaskedArea);return v.jsx(er,{label:t("unifiedcanvas:betaPreserveMasked"),isChecked:n,onChange:r=>e(qW(r.target.checked))})}function YIe(){return v.jsxs(qe,{gap:"1rem",alignItems:"center",children:[v.jsx(GY,{}),v.jsx(GIe,{}),v.jsx(qIe,{}),v.jsx(UIe,{})]})}function KIe(){const e=he(r=>r.canvas.shouldDarkenOutsideBoundingBox),t=Ie(),{t:n}=Ve();return v.jsx(er,{label:n("unifiedcanvas:betaDarkenOutside"),isChecked:e,onChange:r=>t(GW(r.target.checked))})}function XIe(){const e=he(r=>r.canvas.shouldShowGrid),t=Ie(),{t:n}=Ve();return v.jsx(er,{label:n("unifiedcanvas:showGrid"),isChecked:e,onChange:r=>t(KW(r.target.checked))})}function ZIe(){const e=he(i=>i.canvas.shouldSnapToGrid),t=Ie(),{t:n}=Ve(),r=i=>t(Y5(i.target.checked));return v.jsx(er,{label:`${n("unifiedcanvas:snapToGrid")} (N)`,isChecked:e,onChange:r})}function QIe(){return v.jsxs(qe,{alignItems:"center",gap:"1rem",children:[v.jsx(XIe,{}),v.jsx(ZIe,{}),v.jsx(KIe,{})]})}const JIe=ot([ln],e=>{const{tool:t,layer:n}=e;return{tool:t,layer:n}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}});function eRe(){const{tool:e,layer:t}=he(JIe);return v.jsxs(qe,{height:"2rem",minHeight:"2rem",maxHeight:"2rem",alignItems:"center",children:[t=="base"&&["brush","eraser","colorPicker"].includes(e)&&v.jsx(WIe,{}),t=="mask"&&["brush","eraser","colorPicker"].includes(e)&&v.jsx(YIe,{}),e=="move"&&v.jsx(QIe,{})]})}const tRe=ot([ln],e=>{const{doesCanvasNeedScaling:t}=e;return{doesCanvasNeedScaling:t}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),nRe=()=>{const e=Ie(),{doesCanvasNeedScaling:t}=he(tRe);return w.useLayoutEffect(()=>{e(vi(!0));const n=Ee.debounce(()=>{e(vi(!0))},250);return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),v.jsx("div",{className:"workarea-single-view",children:v.jsxs(qe,{flexDirection:"row",width:"100%",height:"100%",columnGap:"1rem",padding:"1rem",children:[v.jsx(PIe,{}),v.jsxs(qe,{width:"100%",height:"100%",flexDirection:"column",rowGap:"1rem",children:[v.jsx(eRe,{}),t?v.jsx(jY,{}):v.jsx(NY,{})]})]})})},rRe=ot([ln,Mr],(e,t)=>{const{maskColor:n,layer:r,isMaskEnabled:i,shouldPreserveMaskedArea:o}=e;return{layer:r,maskColor:n,maskColorString:Hh(n),isMaskEnabled:i,shouldPreserveMaskedArea:o,isStaging:t}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),iRe=()=>{const e=Ie(),{t}=Ve(),{layer:n,maskColor:r,isMaskEnabled:i,shouldPreserveMaskedArea:o,isStaging:a}=he(rRe);Qe(["q"],()=>{s()},{enabled:()=>!a,preventDefault:!0},[n]),Qe(["shift+c"],()=>{l()},{enabled:()=>!a,preventDefault:!0},[]),Qe(["h"],()=>{u()},{enabled:()=>!a,preventDefault:!0},[i]);const s=()=>{e(q5(n==="mask"?"base":"mask"))},l=()=>e(nP()),u=()=>e(Dy(!i));return v.jsx(Zs,{trigger:"hover",triggerComponent:v.jsx(oo,{children:v.jsx(Ze,{"aria-label":t("unifiedcanvas:maskingOptions"),tooltip:t("unifiedcanvas:maskingOptions"),icon:v.jsx(aEe,{}),style:n==="mask"?{backgroundColor:"var(--accent-color)"}:{backgroundColor:"var(--btn-base-color)"},isDisabled:a})}),children:v.jsxs(qe,{direction:"column",gap:"0.5rem",children:[v.jsx(er,{label:`${t("unifiedcanvas:enableMask")} (H)`,isChecked:i,onChange:u}),v.jsx(er,{label:t("unifiedcanvas:preserveMaskedArea"),isChecked:o,onChange:d=>e(qW(d.target.checked))}),v.jsx(dS,{style:{paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:r,onChange:d=>e(VW(d))}),v.jsxs(cr,{size:"sm",leftIcon:v.jsx(vp,{}),onClick:l,children:[t("unifiedcanvas:clearMask")," (Shift+C)"]})]})})},oRe=ot([ln],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:i,shouldShowGrid:o,shouldShowIntermediates:a,shouldSnapToGrid:s,shouldRestrictStrokesToBox:l}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:i,shouldShowGrid:o,shouldShowIntermediates:a,shouldSnapToGrid:s,shouldRestrictStrokesToBox:l}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),aRe=()=>{const e=Ie(),{t}=Ve(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldDarkenOutsideBoundingBox:i,shouldShowCanvasDebugInfo:o,shouldShowGrid:a,shouldShowIntermediates:s,shouldSnapToGrid:l,shouldRestrictStrokesToBox:u}=he(oRe);Qe(["n"],()=>{e(Y5(!l))},{enabled:!0,preventDefault:!0},[l]);const d=h=>e(Y5(h.target.checked));return v.jsx(Zs,{trigger:"hover",triggerComponent:v.jsx(Ze,{tooltip:t("unifiedcanvas:canvasSettings"),"aria-label":t("unifiedcanvas:canvasSettings"),icon:v.jsx(OP,{})}),children:v.jsxs(qe,{direction:"column",gap:"0.5rem",children:[v.jsx(er,{label:t("unifiedcanvas:showIntermediates"),isChecked:s,onChange:h=>e(XW(h.target.checked))}),v.jsx(er,{label:t("unifiedcanvas:showGrid"),isChecked:a,onChange:h=>e(KW(h.target.checked))}),v.jsx(er,{label:t("unifiedcanvas:snapToGrid"),isChecked:l,onChange:d}),v.jsx(er,{label:t("unifiedcanvas:darkenOutsideSelection"),isChecked:i,onChange:h=>e(GW(h.target.checked))}),v.jsx(er,{label:t("unifiedcanvas:autoSaveToGallery"),isChecked:n,onChange:h=>e(WW(h.target.checked))}),v.jsx(er,{label:t("unifiedcanvas:saveBoxRegionOnly"),isChecked:r,onChange:h=>e(UW(h.target.checked))}),v.jsx(er,{label:t("unifiedcanvas:limitStrokesToBox"),isChecked:u,onChange:h=>e(QW(h.target.checked))}),v.jsx(er,{label:t("unifiedcanvas:showCanvasDebugInfo"),isChecked:o,onChange:h=>e(YW(h.target.checked))}),v.jsx(HY,{}),v.jsx(zY,{})]})})},sRe=ot([ln,Mr,ir],(e,t,n)=>{const{isProcessing:r}=n,{tool:i,brushColor:o,brushSize:a}=e;return{tool:i,isStaging:t,isProcessing:r,brushColor:o,brushSize:a}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),lRe=()=>{const e=Ie(),{tool:t,brushColor:n,brushSize:r,isStaging:i}=he(sRe),{t:o}=Ve();Qe(["b"],()=>{a()},{enabled:()=>!i,preventDefault:!0},[]),Qe(["e"],()=>{s()},{enabled:()=>!i,preventDefault:!0},[t]),Qe(["c"],()=>{l()},{enabled:()=>!i,preventDefault:!0},[t]),Qe(["shift+f"],()=>{u()},{enabled:()=>!i,preventDefault:!0}),Qe(["delete","backspace"],()=>{d()},{enabled:()=>!i,preventDefault:!0}),Qe(["BracketLeft"],()=>{e(jm(Math.max(r-5,5)))},{enabled:()=>!i,preventDefault:!0},[r]),Qe(["BracketRight"],()=>{e(jm(Math.min(r+5,500)))},{enabled:()=>!i,preventDefault:!0},[r]),Qe(["shift+BracketLeft"],()=>{e(Nm({...n,a:Ee.clamp(n.a-.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[n]),Qe(["shift+BracketRight"],()=>{e(Nm({...n,a:Ee.clamp(n.a+.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[n]);const a=()=>e(tu("brush")),s=()=>e(tu("eraser")),l=()=>e(tu("colorPicker")),u=()=>e(BW()),d=()=>e(jW());return v.jsxs(oo,{isAttached:!0,children:[v.jsx(Ze,{"aria-label":`${o("unifiedcanvas:brush")} (B)`,tooltip:`${o("unifiedcanvas:brush")} (B)`,icon:v.jsx(yq,{}),"data-selected":t==="brush"&&!i,onClick:a,isDisabled:i}),v.jsx(Ze,{"aria-label":`${o("unifiedcanvas:eraser")} (E)`,tooltip:`${o("unifiedcanvas:eraser")} (E)`,icon:v.jsx(pq,{}),"data-selected":t==="eraser"&&!i,isDisabled:i,onClick:s}),v.jsx(Ze,{"aria-label":`${o("unifiedcanvas:fillBoundingBox")} (Shift+F)`,tooltip:`${o("unifiedcanvas:fillBoundingBox")} (Shift+F)`,icon:v.jsx(mq,{}),isDisabled:i,onClick:u}),v.jsx(Ze,{"aria-label":`${o("unifiedcanvas:eraseBoundingBox")} (Del/Backspace)`,tooltip:`${o("unifiedcanvas:eraseBoundingBox")} (Del/Backspace)`,icon:v.jsx(zy,{style:{transform:"rotate(45deg)"}}),isDisabled:i,onClick:d}),v.jsx(Ze,{"aria-label":`${o("unifiedcanvas:colorPicker")} (C)`,tooltip:`${o("unifiedcanvas:colorPicker")} (C)`,icon:v.jsx(gq,{}),"data-selected":t==="colorPicker"&&!i,isDisabled:i,onClick:l}),v.jsx(Zs,{trigger:"hover",triggerComponent:v.jsx(Ze,{"aria-label":o("unifiedcanvas:brushOptions"),tooltip:o("unifiedcanvas:brushOptions"),icon:v.jsx(AP,{})}),children:v.jsxs(qe,{minWidth:"15rem",direction:"column",gap:"1rem",width:"100%",children:[v.jsx(qe,{gap:"1rem",justifyContent:"space-between",children:v.jsx(na,{label:o("unifiedcanvas:brushSize"),value:r,withInput:!0,onChange:h=>e(jm(h)),sliderNumberInputProps:{max:500},inputReadOnly:!1})}),v.jsx(dS,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:n,onChange:h=>e(Nm(h))})]})})]})},uRe=ot([ir,ln,Mr],(e,t,n)=>{const{isProcessing:r}=e,{tool:i,shouldCropToBoundingBoxOnSave:o,layer:a,isMaskEnabled:s}=t;return{isProcessing:r,isStaging:n,isMaskEnabled:s,tool:i,layer:a,shouldCropToBoundingBoxOnSave:o}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),cRe=()=>{const e=Ie(),{isProcessing:t,isStaging:n,isMaskEnabled:r,layer:i,tool:o,shouldCropToBoundingBoxOnSave:a}=he(uRe),s=el(),{t:l}=Ve(),{openUploader:u}=xP();Qe(["v"],()=>{d()},{enabled:()=>!n,preventDefault:!0},[]),Qe(["r"],()=>{m()},{enabled:()=>!0,preventDefault:!0},[s]),Qe(["shift+m"],()=>{b()},{enabled:()=>!n,preventDefault:!0},[s,t]),Qe(["shift+s"],()=>{S()},{enabled:()=>!n,preventDefault:!0},[s,t]),Qe(["meta+c","ctrl+c"],()=>{E()},{enabled:()=>!n,preventDefault:!0},[s,t]),Qe(["shift+d"],()=>{k()},{enabled:()=>!n,preventDefault:!0},[s,t]);const d=()=>e(tu("move")),h=$Y(()=>m(!1),()=>m(!0)),m=(T=!1)=>{const A=el();if(!A)return;const I=A.getClientRect({skipTransform:!0});e(zW({contentRect:I,shouldScaleTo1:T}))},y=()=>{e(rP()),e(Dx())},b=()=>{e(Td({cropVisible:!1,shouldSetAsInitialImage:!0}))},S=()=>{e(Td({cropVisible:!a,cropToBoundingBox:a,shouldSaveToGallery:!0}))},E=()=>{e(Td({cropVisible:!a,cropToBoundingBox:a,shouldCopy:!0}))},k=()=>{e(Td({cropVisible:!a,cropToBoundingBox:a,shouldDownload:!0}))},_=T=>{const A=T.target.value;e(q5(A)),A==="mask"&&!r&&e(Dy(!0))};return v.jsxs("div",{className:"inpainting-settings",children:[v.jsx(tl,{tooltip:`${l("unifiedcanvas:layer")} (Q)`,tooltipProps:{hasArrow:!0,placement:"top"},value:i,validValues:DW,onChange:_,isDisabled:n}),v.jsx(iRe,{}),v.jsx(lRe,{}),v.jsxs(oo,{isAttached:!0,children:[v.jsx(Ze,{"aria-label":`${l("unifiedcanvas:move")} (V)`,tooltip:`${l("unifiedcanvas:move")} (V)`,icon:v.jsx(dq,{}),"data-selected":o==="move"||n,onClick:d}),v.jsx(Ze,{"aria-label":`${l("unifiedcanvas:resetView")} (R)`,tooltip:`${l("unifiedcanvas:resetView")} (R)`,icon:v.jsx(hq,{}),onClick:h})]}),v.jsxs(oo,{isAttached:!0,children:[v.jsx(Ze,{"aria-label":`${l("unifiedcanvas:mergeVisible")} (Shift+M)`,tooltip:`${l("unifiedcanvas:mergeVisible")} (Shift+M)`,icon:v.jsx(vq,{}),onClick:b,isDisabled:n}),v.jsx(Ze,{"aria-label":`${l("unifiedcanvas:saveToGallery")} (Shift+S)`,tooltip:`${l("unifiedcanvas:saveToGallery")} (Shift+S)`,icon:v.jsx(LP,{}),onClick:S,isDisabled:n}),v.jsx(Ze,{"aria-label":`${l("unifiedcanvas:copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${l("unifiedcanvas:copyToClipboard")} (Cmd/Ctrl+C)`,icon:v.jsx(o0,{}),onClick:E,isDisabled:n}),v.jsx(Ze,{"aria-label":`${l("unifiedcanvas:downloadAsImage")} (Shift+D)`,tooltip:`${l("unifiedcanvas:downloadAsImage")} (Shift+D)`,icon:v.jsx(TP,{}),onClick:k,isDisabled:n})]}),v.jsxs(oo,{isAttached:!0,children:[v.jsx(FY,{}),v.jsx(BY,{})]}),v.jsxs(oo,{isAttached:!0,children:[v.jsx(Ze,{"aria-label":`${l("common:upload")}`,tooltip:`${l("common:upload")}`,icon:v.jsx(Zx,{}),onClick:u,isDisabled:n}),v.jsx(Ze,{"aria-label":`${l("unifiedcanvas:clearCanvas")}`,tooltip:`${l("unifiedcanvas:clearCanvas")}`,icon:v.jsx(vp,{}),onClick:y,style:{backgroundColor:"var(--btn-delete-image)"},isDisabled:n})]}),v.jsx(oo,{isAttached:!0,children:v.jsx(aRe,{})})]})},dRe=ot([ln],e=>{const{doesCanvasNeedScaling:t}=e;return{doesCanvasNeedScaling:t}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),fRe=()=>{const e=Ie(),{doesCanvasNeedScaling:t}=he(dRe);return w.useLayoutEffect(()=>{e(vi(!0));const n=Ee.debounce(()=>{e(vi(!0))},250);return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),v.jsx("div",{className:"workarea-single-view",children:v.jsx("div",{className:"workarea-split-view-left",children:v.jsxs("div",{className:"inpainting-main-area",children:[v.jsx(cRe,{}),v.jsx("div",{className:"inpainting-canvas-area",children:t?v.jsx(jY,{}):v.jsx(NY,{})})]})})})},hRe=ot(ln,e=>{const{boundingBoxDimensions:t,boundingBoxScaleMethod:n}=e;return{boundingBoxDimensions:t,boundingBoxScale:n}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),pRe=()=>{const e=Ie(),{boundingBoxDimensions:t}=he(hRe),{t:n}=Ve(),r=s=>{e(Ev({...t,width:Math.floor(s)}))},i=s=>{e(Ev({...t,height:Math.floor(s)}))},o=()=>{e(Ev({...t,width:Math.floor(512)}))},a=()=>{e(Ev({...t,height:Math.floor(512)}))};return v.jsxs(qe,{direction:"column",gap:"1rem",children:[v.jsx(na,{label:n("parameters:width"),min:64,max:1024,step:64,value:t.width,onChange:r,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:o}),v.jsx(na,{label:n("parameters:height"),min:64,max:1024,step:64,value:t.height,onChange:i,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:a})]})},gRe=ot([KP,ir,ln],(e,t,n)=>{const{tileSize:r,infillMethod:i}=e,{infill_methods:o}=t,{boundingBoxScaleMethod:a,scaledBoundingBoxDimensions:s}=n;return{boundingBoxScale:a,scaledBoundingBoxDimensions:s,tileSize:r,infillMethod:i,availableInfillMethods:o,isManual:a==="manual"}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),mRe=()=>{const e=Ie(),{tileSize:t,infillMethod:n,availableInfillMethods:r,boundingBoxScale:i,isManual:o,scaledBoundingBoxDimensions:a}=he(gRe),{t:s}=Ve(),l=y=>{e(_b({...a,width:Math.floor(y)}))},u=y=>{e(_b({...a,height:Math.floor(y)}))},d=()=>{e(_b({...a,width:Math.floor(512)}))},h=()=>{e(_b({...a,height:Math.floor(512)}))},m=y=>{e(_xe(y.target.value))};return v.jsxs(qe,{direction:"column",gap:"1rem",children:[v.jsx(tl,{label:s("parameters:scaleBeforeProcessing"),validValues:sxe,value:i,onChange:m}),v.jsx(na,{isInputDisabled:!o,isResetDisabled:!o,isSliderDisabled:!o,label:s("parameters:scaledWidth"),min:64,max:1024,step:64,value:a.width,onChange:l,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:d}),v.jsx(na,{isInputDisabled:!o,isResetDisabled:!o,isSliderDisabled:!o,label:s("parameters:scaledHeight"),min:64,max:1024,step:64,value:a.height,onChange:u,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:h}),v.jsx(tl,{label:s("parameters:infillMethod"),value:n,validValues:r,onChange:y=>e(uU(y.target.value))}),v.jsx(na,{isInputDisabled:n!=="tile",isResetDisabled:n!=="tile",isSliderDisabled:n!=="tile",sliderMarkRightOffset:-4,label:s("parameters:tileSize"),min:16,max:64,sliderNumberInputProps:{max:256},value:t,onChange:y=>{e(HI(y))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(HI(32))}})]})};function vRe(){const e=Ie(),t=he(r=>r.generation.seamBlur),{t:n}=Ve();return v.jsx(na,{sliderMarkRightOffset:-4,label:n("parameters:seamBlur"),min:0,max:64,sliderNumberInputProps:{max:512},value:t,onChange:r=>{e(BI(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(BI(16))}})}function yRe(){const e=Ie(),{t}=Ve(),n=he(r=>r.generation.seamSize);return v.jsx(na,{sliderMarkRightOffset:-6,label:t("parameters:seamSize"),min:1,max:256,sliderNumberInputProps:{max:512},value:n,onChange:r=>{e(FI(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>e(FI(96))})}function bRe(){const{t:e}=Ve(),t=he(r=>r.generation.seamSteps),n=Ie();return v.jsx(na,{sliderMarkRightOffset:-4,label:e("parameters:seamSteps"),min:1,max:100,sliderNumberInputProps:{max:999},value:t,onChange:r=>{n($I(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{n($I(30))}})}function SRe(){const e=Ie(),{t}=Ve(),n=he(r=>r.generation.seamStrength);return v.jsx(na,{sliderMarkRightOffset:-7,label:t("parameters:seamStrength"),min:.01,max:.99,step:.01,value:n,onChange:r=>{e(zI(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(zI(.7))}})}const xRe=()=>v.jsxs(qe,{direction:"column",gap:"1rem",children:[v.jsx(yRe,{}),v.jsx(vRe,{}),v.jsx(SRe,{}),v.jsx(bRe,{})]});function wRe(){const{t:e}=Ve(),t={boundingBox:{header:`${e("parameters:boundingBoxHeader")}`,feature:ao.BOUNDING_BOX,content:v.jsx(pRe,{})},seamCorrection:{header:`${e("parameters:seamCorrectionHeader")}`,feature:ao.SEAM_CORRECTION,content:v.jsx(xRe,{})},infillAndScaling:{header:`${e("parameters:infillScalingHeader")}`,feature:ao.INFILL_AND_SCALING,content:v.jsx(mRe,{})},seed:{header:`${e("parameters:seed")}`,feature:ao.SEED,content:v.jsx(VP,{})},variations:{header:`${e("parameters:variations")}`,feature:ao.VARIATIONS,content:v.jsx(UP,{}),additionalHeaderComponents:v.jsx(WP,{})}};return v.jsxs(eT,{children:[v.jsxs(qe,{flexDir:"column",rowGap:"0.5rem",children:[v.jsx(JP,{}),v.jsx(QP,{})]}),v.jsx(ZP,{}),v.jsx(GP,{}),v.jsx(_Y,{label:e("parameters:img2imgStrength"),styleClass:"main-settings-block image-to-image-strength-main-option"}),v.jsx(qP,{accordionInfo:t})]})}function CRe(){const e=he(t=>t.ui.shouldUseCanvasBetaLayout);return v.jsx(HP,{optionsPanel:v.jsx(wRe,{}),styleClass:"inpainting-workarea-overrides",children:e?v.jsx(nRe,{}):v.jsx(fRe,{})})}const es={txt2img:{title:v.jsx(n_e,{fill:"black",boxSize:"2.5rem"}),workarea:v.jsx(pOe,{}),tooltip:"Text To Image"},img2img:{title:v.jsx(J8e,{fill:"black",boxSize:"2.5rem"}),workarea:v.jsx(sOe,{}),tooltip:"Image To Image"},unifiedCanvas:{title:v.jsx(i_e,{fill:"black",boxSize:"2.5rem"}),workarea:v.jsx(CRe,{}),tooltip:"Unified Canvas"},nodes:{title:v.jsx(e_e,{fill:"black",boxSize:"2.5rem"}),workarea:v.jsx(K8e,{}),tooltip:"Nodes"},postprocess:{title:v.jsx(t_e,{fill:"black",boxSize:"2.5rem"}),workarea:v.jsx(X8e,{}),tooltip:"Post Processing"},training:{title:v.jsx(r_e,{fill:"black",boxSize:"2.5rem"}),workarea:v.jsx(Z8e,{}),tooltip:"Training"}};function _Re(){es.txt2img.tooltip=zt.t("common:text2img"),es.img2img.tooltip=zt.t("common:img2img"),es.unifiedCanvas.tooltip=zt.t("common:unifiedCanvas"),es.nodes.tooltip=zt.t("common:nodes"),es.postprocess.tooltip=zt.t("common:postProcessing"),es.training.tooltip=zt.t("common:training")}function kRe(){const e=he(Y8e),t=he(o=>o.lightbox.isLightboxOpen);Q8e(_Re);const n=Ie();Qe("1",()=>{n(qo(0))}),Qe("2",()=>{n(qo(1))}),Qe("3",()=>{n(qo(2))}),Qe("4",()=>{n(qo(3))}),Qe("5",()=>{n(qo(4))}),Qe("6",()=>{n(qo(5))}),Qe("z",()=>{n(Bm(!t))},[t]);const r=()=>{const o=[];return Object.keys(es).forEach(a=>{o.push(v.jsx(lo,{hasArrow:!0,label:es[a].tooltip,placement:"right",children:v.jsx(oW,{children:es[a].title})},a))}),o},i=()=>{const o=[];return Object.keys(es).forEach(a=>{o.push(v.jsx(rW,{className:"app-tabs-panel",children:es[a].workarea},a))}),o};return v.jsxs(nW,{isLazy:!0,className:"app-tabs",variant:"unstyled",defaultIndex:e,index:e,onChange:o=>{n(qo(o))},children:[v.jsx("div",{className:"app-tabs-list",children:r()}),v.jsx(iW,{className:"app-tabs-panels",children:t?v.jsx(CAe,{}):i()})]})}var ERe=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 Uy(e,t){var n=PRe(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 PRe(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),i=ERe.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}var TRe=[".DS_Store","Thumbs.db"];function LRe(e){return m0(this,void 0,void 0,function(){return v0(this,function(t){return fS(e)&&ARe(e.dataTransfer)?[2,RRe(e.dataTransfer,e.type)]:ORe(e)?[2,MRe(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,IRe(e)]:[2,[]]})})}function ARe(e){return fS(e)}function ORe(e){return fS(e)&&fS(e.target)}function fS(e){return typeof e=="object"&&e!==null}function MRe(e){return J8(e.target.files).map(function(t){return Uy(t)})}function IRe(e){return m0(this,void 0,void 0,function(){var t;return v0(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 Uy(r)})]}})})}function RRe(e,t){return m0(this,void 0,void 0,function(){var n,r;return v0(this,function(i){switch(i.label){case 0:return e.items?(n=J8(e.items).filter(function(o){return o.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(DRe))]):[3,2];case 1:return r=i.sent(),[2,cN(qY(r))];case 2:return[2,cN(J8(e.files).map(function(o){return Uy(o)}))]}})})}function cN(e){return e.filter(function(t){return TRe.indexOf(t.name)===-1})}function J8(e){if(e===null)return[];for(var t=[],n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nn)return[!1,gN(n)];if(e.sizen)return[!1,gN(n)]}return[!0,null]}function Sh(e){return e!=null}function ZRe(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,o=e.multiple,a=e.maxFiles,s=e.validator;return!o&&t.length>1||o&&a>=1&&t.length>a?!1:t.every(function(l){var u=ZY(l,n),d=ay(u,1),h=d[0],m=QY(l,r,i),y=ay(m,1),b=y[0],S=s?s(l):null;return h&&b&&!S})}function hS(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Xb(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 vN(e){e.preventDefault()}function QRe(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function JRe(e){return e.indexOf("Edge/")!==-1}function eDe(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return QRe(e)||JRe(e)}function Il(){for(var e=arguments.length,t=new Array(e),n=0;n1?i-1:0),a=1;ae.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function vDe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var lT=w.forwardRef(function(e,t){var n=e.children,r=pS(e,aDe),i=rK(r),o=i.open,a=pS(i,sDe);return w.useImperativeHandle(t,function(){return{open:o}},[o]),N.createElement(w.Fragment,null,n(Cr(Cr({},a),{},{open:o})))});lT.displayName="Dropzone";var nK={disabled:!1,getFilesFromEvent:LRe,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};lT.defaultProps=nK;lT.propTypes={children:jn.func,accept:jn.objectOf(jn.arrayOf(jn.string)),multiple:jn.bool,preventDropOnDocument:jn.bool,noClick:jn.bool,noKeyboard:jn.bool,noDrag:jn.bool,noDragEventsBubbling:jn.bool,minSize:jn.number,maxSize:jn.number,maxFiles:jn.number,disabled:jn.bool,getFilesFromEvent:jn.func,onFileDialogCancel:jn.func,onFileDialogOpen:jn.func,useFsAccessApi:jn.bool,autoFocus:jn.bool,onDragEnter:jn.func,onDragLeave:jn.func,onDragOver:jn.func,onDrop:jn.func,onDropAccepted:jn.func,onDropRejected:jn.func,onError:jn.func,validator:jn.func};var r_={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function rK(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Cr(Cr({},nK),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,o=t.maxSize,a=t.minSize,s=t.multiple,l=t.maxFiles,u=t.onDragEnter,d=t.onDragLeave,h=t.onDragOver,m=t.onDrop,y=t.onDropAccepted,b=t.onDropRejected,S=t.onFileDialogCancel,E=t.onFileDialogOpen,k=t.useFsAccessApi,_=t.autoFocus,T=t.preventDropOnDocument,A=t.noClick,I=t.noKeyboard,R=t.noDrag,D=t.noDragEventsBubbling,j=t.onError,z=t.validator,V=w.useMemo(function(){return rDe(n)},[n]),K=w.useMemo(function(){return nDe(n)},[n]),te=w.useMemo(function(){return typeof E=="function"?E:bN},[E]),q=w.useMemo(function(){return typeof S=="function"?S:bN},[S]),F=w.useRef(null),U=w.useRef(null),X=w.useReducer(yDe,r_),Z=WC(X,2),W=Z[0],Q=Z[1],ie=W.isFocused,fe=W.isFileDialogActive,Se=w.useRef(typeof window<"u"&&window.isSecureContext&&k&&tDe()),Te=function(){!Se.current&&fe&&setTimeout(function(){if(U.current){var je=U.current.files;je.length||(Q({type:"closeDialog"}),q())}},300)};w.useEffect(function(){return window.addEventListener("focus",Te,!1),function(){window.removeEventListener("focus",Te,!1)}},[U,fe,q,Se]);var ye=w.useRef([]),He=function(je){F.current&&F.current.contains(je.target)||(je.preventDefault(),ye.current=[])};w.useEffect(function(){return T&&(document.addEventListener("dragover",vN,!1),document.addEventListener("drop",He,!1)),function(){T&&(document.removeEventListener("dragover",vN),document.removeEventListener("drop",He))}},[F,T]),w.useEffect(function(){return!r&&_&&F.current&&F.current.focus(),function(){}},[F,_,r]);var Ne=w.useCallback(function(we){j?j(we):console.error(we)},[j]),tt=w.useCallback(function(we){we.preventDefault(),we.persist(),le(we),ye.current=[].concat(cDe(ye.current),[we.target]),Xb(we)&&Promise.resolve(i(we)).then(function(je){if(!(hS(we)&&!D)){var _t=je.length,Dt=_t>0&&ZRe({files:je,accept:V,minSize:a,maxSize:o,multiple:s,maxFiles:l,validator:z}),Le=_t>0&&!Dt;Q({isDragAccept:Dt,isDragReject:Le,isDragActive:!0,type:"setDraggedFiles"}),u&&u(we)}}).catch(function(je){return Ne(je)})},[i,u,Ne,D,V,a,o,s,l,z]),_e=w.useCallback(function(we){we.preventDefault(),we.persist(),le(we);var je=Xb(we);if(je&&we.dataTransfer)try{we.dataTransfer.dropEffect="copy"}catch{}return je&&h&&h(we),!1},[h,D]),lt=w.useCallback(function(we){we.preventDefault(),we.persist(),le(we);var je=ye.current.filter(function(Dt){return F.current&&F.current.contains(Dt)}),_t=je.indexOf(we.target);_t!==-1&&je.splice(_t,1),ye.current=je,!(je.length>0)&&(Q({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Xb(we)&&d&&d(we))},[F,d,D]),wt=w.useCallback(function(we,je){var _t=[],Dt=[];we.forEach(function(Le){var At=ZY(Le,V),Fe=WC(At,2),vt=Fe[0],nn=Fe[1],Rn=QY(Le,a,o),Ke=WC(Rn,2),xt=Ke[0],ft=Ke[1],Ht=z?z(Le):null;if(vt&&xt&&!Ht)_t.push(Le);else{var rn=[nn,ft];Ht&&(rn=rn.concat(Ht)),Dt.push({file:Le,errors:rn.filter(function(pr){return pr})})}}),(!s&&_t.length>1||s&&l>=1&&_t.length>l)&&(_t.forEach(function(Le){Dt.push({file:Le,errors:[XRe]})}),_t.splice(0)),Q({acceptedFiles:_t,fileRejections:Dt,type:"setFiles"}),m&&m(_t,Dt,je),Dt.length>0&&b&&b(Dt,je),_t.length>0&&y&&y(_t,je)},[Q,s,V,a,o,l,m,y,b,z]),ct=w.useCallback(function(we){we.preventDefault(),we.persist(),le(we),ye.current=[],Xb(we)&&Promise.resolve(i(we)).then(function(je){hS(we)&&!D||wt(je,we)}).catch(function(je){return Ne(je)}),Q({type:"reset"})},[i,wt,Ne,D]),mt=w.useCallback(function(){if(Se.current){Q({type:"openDialog"}),te();var we={multiple:s,types:K};window.showOpenFilePicker(we).then(function(je){return i(je)}).then(function(je){wt(je,null),Q({type:"closeDialog"})}).catch(function(je){iDe(je)?(q(je),Q({type:"closeDialog"})):oDe(je)?(Se.current=!1,U.current?(U.current.value=null,U.current.click()):Ne(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 was provided."))):Ne(je)});return}U.current&&(Q({type:"openDialog"}),te(),U.current.value=null,U.current.click())},[Q,te,q,k,wt,Ne,K,s]),St=w.useCallback(function(we){!F.current||!F.current.isEqualNode(we.target)||(we.key===" "||we.key==="Enter"||we.keyCode===32||we.keyCode===13)&&(we.preventDefault(),mt())},[F,mt]),Ae=w.useCallback(function(){Q({type:"focus"})},[]),ut=w.useCallback(function(){Q({type:"blur"})},[]),Mt=w.useCallback(function(){A||(eDe()?setTimeout(mt,0):mt())},[A,mt]),at=function(je){return r?null:je},Ct=function(je){return I?null:at(je)},Zt=function(je){return R?null:at(je)},le=function(je){D&&je.stopPropagation()},De=w.useMemo(function(){return function(){var we=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},je=we.refKey,_t=je===void 0?"ref":je,Dt=we.role,Le=we.onKeyDown,At=we.onFocus,Fe=we.onBlur,vt=we.onClick,nn=we.onDragEnter,Rn=we.onDragOver,Ke=we.onDragLeave,xt=we.onDrop,ft=pS(we,lDe);return Cr(Cr(n_({onKeyDown:Ct(Il(Le,St)),onFocus:Ct(Il(At,Ae)),onBlur:Ct(Il(Fe,ut)),onClick:at(Il(vt,Mt)),onDragEnter:Zt(Il(nn,tt)),onDragOver:Zt(Il(Rn,_e)),onDragLeave:Zt(Il(Ke,lt)),onDrop:Zt(Il(xt,ct)),role:typeof Dt=="string"&&Dt!==""?Dt:"presentation"},_t,F),!r&&!I?{tabIndex:0}:{}),ft)}},[F,St,Ae,ut,Mt,tt,_e,lt,ct,I,R,r]),Ue=w.useCallback(function(we){we.stopPropagation()},[]),Ye=w.useMemo(function(){return function(){var we=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},je=we.refKey,_t=je===void 0?"ref":je,Dt=we.onChange,Le=we.onClick,At=pS(we,uDe),Fe=n_({accept:V,multiple:s,type:"file",style:{display:"none"},onChange:at(Il(Dt,ct)),onClick:at(Il(Le,Ue)),tabIndex:-1},_t,U);return Cr(Cr({},Fe),At)}},[U,n,s,ct,r]);return Cr(Cr({},W),{},{isFocused:ie&&!r,getRootProps:De,getInputProps:Ye,rootRef:F,inputRef:U,open:at(mt)})}function yDe(e,t){switch(t.type){case"focus":return Cr(Cr({},e),{},{isFocused:!0});case"blur":return Cr(Cr({},e),{},{isFocused:!1});case"openDialog":return Cr(Cr({},r_),{},{isFileDialogActive:!0});case"closeDialog":return Cr(Cr({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Cr(Cr({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Cr(Cr({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return Cr({},r_);default:return e}}function bN(){}const bDe=e=>{const{isDragAccept:t,isDragReject:n,overlaySecondaryText:r,setIsHandlingUpload:i}=e;return Qe("esc",()=>{i(!1)}),v.jsxs("div",{className:"dropzone-container",children:[t&&v.jsx("div",{className:"dropzone-overlay is-drag-accept",children:v.jsxs(Dh,{size:"lg",children:["Upload Image",r]})}),n&&v.jsxs("div",{className:"dropzone-overlay is-drag-reject",children:[v.jsx(Dh,{size:"lg",children:"Invalid Upload"}),v.jsx(Dh,{size:"md",children:"Must be single JPEG or PNG image"})]})]})},SDe=e=>{const{children:t}=e,n=Ie(),r=he(Or),i=Ry({}),{t:o}=Ve(),[a,s]=w.useState(!1),{setOpenUploader:l}=xP(),u=w.useCallback(T=>{s(!0);const A=T.errors.reduce((I,R)=>`${I} +${R.message}`,"");i({title:o("toast:uploadFailed"),description:A,status:"error",isClosable:!0})},[o,i]),d=w.useCallback(async T=>{n(fD({imageFile:T}))},[n]),h=w.useCallback((T,A)=>{A.forEach(I=>{u(I)}),T.forEach(I=>{d(I)})},[d,u]),{getRootProps:m,getInputProps:y,isDragAccept:b,isDragReject:S,isDragActive:E,open:k}=rK({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},noClick:!0,onDrop:h,onDragOver:()=>s(!0),maxFiles:1});l(k),w.useEffect(()=>{const T=A=>{var j;const I=(j=A.clipboardData)==null?void 0:j.items;if(!I)return;const R=[];for(const z of I)z.kind==="file"&&["image/png","image/jpg"].includes(z.type)&&R.push(z);if(!R.length)return;if(A.stopImmediatePropagation(),R.length>1){i({description:o("toast:uploadFailedMultipleImagesDesc"),status:"error",isClosable:!0});return}const D=R[0].getAsFile();if(!D){i({description:o("toast:uploadFailedUnableToLoadDesc"),status:"error",isClosable:!0});return}n(fD({imageFile:D}))};return document.addEventListener("paste",T),()=>{document.removeEventListener("paste",T)}},[o,n,i,r]);const _=["img2img","unifiedCanvas"].includes(r)?` to ${es[r].tooltip}`:"";return v.jsx(SP.Provider,{value:k,children:v.jsxs("div",{...m({style:{}}),onKeyDown:T=>{T.key},children:[v.jsx("input",{...y()}),t,E&&a&&v.jsx(bDe,{isDragAccept:b,isDragReject:S,overlaySecondaryText:_,setIsHandlingUpload:s})]})})},xDe=ot(ir,e=>e.log,{memoizeOptions:{resultEqualityCheck:(e,t)=>e.length===t.length}}),wDe=ot(ir,e=>({shouldShowLogViewer:e.shouldShowLogViewer,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}),{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),CDe=()=>{const e=Ie(),t=he(xDe),{shouldShowLogViewer:n,hasError:r,wasErrorSeen:i}=he(wDe),[o,a]=w.useState(!0),s=w.useRef(null);w.useLayoutEffect(()=>{s.current!==null&&o&&(s.current.scrollTop=s.current.scrollHeight)},[o,t,n]);const l=()=>{e(BU()),e(_C(!n))};Qe("`",()=>{e(_C(!n))},[n]),Qe("esc",()=>{e(_C(!1))});const u=()=>{s.current&&o&&s.current.scrollTop{const{timestamp:m,message:y,level:b}=d;return v.jsxs("div",{className:`console-entry console-${b}-color`,children:[v.jsxs("p",{className:"console-timestamp",children:[m,":"]}),v.jsx("p",{className:"console-message",children:y})]},h)})})}),n&&v.jsx(lo,{hasArrow:!0,label:o?"Autoscroll On":"Autoscroll Off",children:v.jsx(ss,{className:"console-autoscroll-icon-button","data-autoscroll-enabled":o,size:"sm","aria-label":"Toggle autoscroll",variant:"solid",icon:v.jsx(Gke,{}),onClick:()=>a(!o)})}),v.jsx(lo,{hasArrow:!0,label:n?"Hide Console":"Show Console",children:v.jsx(ss,{className:"console-toggle-icon-button","data-error-seen":r||!i,size:"sm",position:"fixed",variant:"solid","aria-label":"Toggle Log Viewer",icon:n?v.jsx(sEe,{}):v.jsx(fq,{}),onClick:l})})]})},_De=ot(ir,e=>({isProcessing:e.isProcessing,currentStep:e.currentStep,totalSteps:e.totalSteps,currentStatusHasSteps:e.currentStatusHasSteps}),{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),kDe=()=>{const{isProcessing:e,currentStep:t,totalSteps:n,currentStatusHasSteps:r}=he(_De),i=t?Math.round(t*100/n):0;return v.jsx(BV,{value:i,isIndeterminate:e&&!r,className:"progress-bar"})};function EDe(e){const{title:t,hotkey:n,description:r}=e;return v.jsxs("div",{className:"hotkey-modal-item",children:[v.jsxs("div",{className:"hotkey-info",children:[v.jsx("p",{className:"hotkey-title",children:t}),r&&v.jsx("p",{className:"hotkey-description",children:r})]}),v.jsx("div",{className:"hotkey-key",children:n})]})}function PDe({children:e}){const{isOpen:t,onOpen:n,onClose:r}=Wh(),{t:i}=Ve(),o=[{title:i("hotkeys:invoke.title"),desc:i("hotkeys:invoke.desc"),hotkey:"Ctrl+Enter"},{title:i("hotkeys:cancel.title"),desc:i("hotkeys:cancel.desc"),hotkey:"Shift+X"},{title:i("hotkeys:focusPrompt.title"),desc:i("hotkeys:focusPrompt.desc"),hotkey:"Alt+A"},{title:i("hotkeys:toggleOptions.title"),desc:i("hotkeys:toggleOptions.desc"),hotkey:"O"},{title:i("hotkeys:pinOptions.title"),desc:i("hotkeys:pinOptions.desc"),hotkey:"Shift+O"},{title:i("hotkeys:toggleViewer.title"),desc:i("hotkeys:toggleViewer.desc"),hotkey:"Z"},{title:i("hotkeys:toggleGallery.title"),desc:i("hotkeys:toggleGallery.desc"),hotkey:"G"},{title:i("hotkeys:maximizeWorkSpace.title"),desc:i("hotkeys:maximizeWorkSpace.desc"),hotkey:"F"},{title:i("hotkeys:changeTabs.title"),desc:i("hotkeys:changeTabs.desc"),hotkey:"1-5"},{title:i("hotkeys:consoleToggle.title"),desc:i("hotkeys:consoleToggle.desc"),hotkey:"`"}],a=[{title:i("hotkeys:setPrompt.title"),desc:i("hotkeys:setPrompt.desc"),hotkey:"P"},{title:i("hotkeys:setSeed.title"),desc:i("hotkeys:setSeed.desc"),hotkey:"S"},{title:i("hotkeys:setParameters.title"),desc:i("hotkeys:setParameters.desc"),hotkey:"A"},{title:i("hotkeys:restoreFaces.title"),desc:i("hotkeys:restoreFaces.desc"),hotkey:"Shift+R"},{title:i("hotkeys:upscale.title"),desc:i("hotkeys:upscale.desc"),hotkey:"Shift+U"},{title:i("hotkeys:showInfo.title"),desc:i("hotkeys:showInfo.desc"),hotkey:"I"},{title:i("hotkeys:sendToImageToImage.title"),desc:i("hotkeys:sendToImageToImage.desc"),hotkey:"Shift+I"},{title:i("hotkeys:deleteImage.title"),desc:i("hotkeys:deleteImage.desc"),hotkey:"Del"},{title:i("hotkeys:closePanels.title"),desc:i("hotkeys:closePanels.desc"),hotkey:"Esc"}],s=[{title:i("hotkeys:previousImage.title"),desc:i("hotkeys:previousImage.desc"),hotkey:"Arrow Left"},{title:i("hotkeys:nextImage.title"),desc:i("hotkeys:nextImage.desc"),hotkey:"Arrow Right"},{title:i("hotkeys:toggleGalleryPin.title"),desc:i("hotkeys:toggleGalleryPin.desc"),hotkey:"Shift+G"},{title:i("hotkeys:increaseGalleryThumbSize.title"),desc:i("hotkeys:increaseGalleryThumbSize.desc"),hotkey:"Shift+Up"},{title:i("hotkeys:decreaseGalleryThumbSize.title"),desc:i("hotkeys:decreaseGalleryThumbSize.desc"),hotkey:"Shift+Down"}],l=[{title:i("hotkeys:selectBrush.title"),desc:i("hotkeys:selectBrush.desc"),hotkey:"B"},{title:i("hotkeys:selectEraser.title"),desc:i("hotkeys:selectEraser.desc"),hotkey:"E"},{title:i("hotkeys:decreaseBrushSize.title"),desc:i("hotkeys:decreaseBrushSize.desc"),hotkey:"["},{title:i("hotkeys:increaseBrushSize.title"),desc:i("hotkeys:increaseBrushSize.desc"),hotkey:"]"},{title:i("hotkeys:decreaseBrushOpacity.title"),desc:i("hotkeys:decreaseBrushOpacity.desc"),hotkey:"Shift + ["},{title:i("hotkeys:increaseBrushOpacity.title"),desc:i("hotkeys:increaseBrushOpacity.desc"),hotkey:"Shift + ]"},{title:i("hotkeys:moveTool.title"),desc:i("hotkeys:moveTool.desc"),hotkey:"V"},{title:i("hotkeys:fillBoundingBox.title"),desc:i("hotkeys:fillBoundingBox.desc"),hotkey:"Shift + F"},{title:i("hotkeys:eraseBoundingBox.title"),desc:i("hotkeys:eraseBoundingBox.desc"),hotkey:"Delete / Backspace"},{title:i("hotkeys:colorPicker.title"),desc:i("hotkeys:colorPicker.desc"),hotkey:"C"},{title:i("hotkeys:toggleSnap.title"),desc:i("hotkeys:toggleSnap.desc"),hotkey:"N"},{title:i("hotkeys:quickToggleMove.title"),desc:i("hotkeys:quickToggleMove.desc"),hotkey:"Hold Space"},{title:i("hotkeys:toggleLayer.title"),desc:i("hotkeys:toggleLayer.desc"),hotkey:"Q"},{title:i("hotkeys:clearMask.title"),desc:i("hotkeys:clearMask.desc"),hotkey:"Shift+C"},{title:i("hotkeys:hideMask.title"),desc:i("hotkeys:hideMask.desc"),hotkey:"H"},{title:i("hotkeys:showHideBoundingBox.title"),desc:i("hotkeys:showHideBoundingBox.desc"),hotkey:"Shift+H"},{title:i("hotkeys:mergeVisible.title"),desc:i("hotkeys:mergeVisible.desc"),hotkey:"Shift+M"},{title:i("hotkeys:saveToGallery.title"),desc:i("hotkeys:saveToGallery.desc"),hotkey:"Shift+S"},{title:i("hotkeys:copyToClipboard.title"),desc:i("hotkeys:copyToClipboard.desc"),hotkey:"Ctrl+C"},{title:i("hotkeys:downloadImage.title"),desc:i("hotkeys:downloadImage.desc"),hotkey:"Shift+D"},{title:i("hotkeys:undoStroke.title"),desc:i("hotkeys:undoStroke.desc"),hotkey:"Ctrl+Z"},{title:i("hotkeys:redoStroke.title"),desc:i("hotkeys:redoStroke.desc"),hotkey:"Ctrl+Shift+Z, Ctrl+Y"},{title:i("hotkeys:resetView.title"),desc:i("hotkeys:resetView.desc"),hotkey:"R"},{title:i("hotkeys:previousStagingImage.title"),desc:i("hotkeys:previousStagingImage.desc"),hotkey:"Arrow Left"},{title:i("hotkeys:nextStagingImage.title"),desc:i("hotkeys:nextStagingImage.desc"),hotkey:"Arrow Right"},{title:i("hotkeys:acceptStagingImage.title"),desc:i("hotkeys:acceptStagingImage.desc"),hotkey:"Enter"}],u=d=>{const h=[];return d.forEach((m,y)=>{h.push(v.jsx(EDe,{title:m.title,description:m.desc,hotkey:m.hotkey},y))}),v.jsx("div",{className:"hotkey-modal-category",children:h})};return v.jsxs(v.Fragment,{children:[w.cloneElement(e,{onClick:n}),v.jsxs(Yd,{isOpen:t,onClose:r,children:[v.jsx(Kd,{}),v.jsxs(Zh,{className:" modal hotkeys-modal",children:[v.jsx(Ly,{className:"modal-close-btn"}),v.jsx("h1",{children:"Keyboard Shorcuts"}),v.jsx("div",{className:"hotkeys-modal-items",children:v.jsxs(ok,{allowMultiple:!0,children:[v.jsxs(Gg,{children:[v.jsxs(Wg,{className:"hotkeys-modal-button",children:[v.jsx("h2",{children:i("hotkeys:appHotkeys")}),v.jsx(Ug,{})]}),v.jsx(qg,{children:u(o)})]}),v.jsxs(Gg,{children:[v.jsxs(Wg,{className:"hotkeys-modal-button",children:[v.jsx("h2",{children:i("hotkeys:generalHotkeys")}),v.jsx(Ug,{})]}),v.jsx(qg,{children:u(a)})]}),v.jsxs(Gg,{children:[v.jsxs(Wg,{className:"hotkeys-modal-button",children:[v.jsx("h2",{children:i("hotkeys:galleryHotkeys")}),v.jsx(Ug,{})]}),v.jsx(qg,{children:u(s)})]}),v.jsxs(Gg,{children:[v.jsxs(Wg,{className:"hotkeys-modal-button",children:[v.jsx("h2",{children:i("hotkeys:unifiedCanvasHotkeys")}),v.jsx(Ug,{})]}),v.jsx(qg,{children:u(l)})]})]})})]})]})]})}var SN=Array.isArray,xN=Object.keys,TDe=Object.prototype.hasOwnProperty,LDe=typeof Element<"u";function i_(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=SN(e),r=SN(t),i,o,a;if(n&&r){if(o=e.length,o!=t.length)return!1;for(i=o;i--!==0;)if(!i_(e[i],t[i]))return!1;return!0}if(n!=r)return!1;var s=e instanceof Date,l=t instanceof Date;if(s!=l)return!1;if(s&&l)return e.getTime()==t.getTime();var u=e instanceof RegExp,d=t instanceof RegExp;if(u!=d)return!1;if(u&&d)return e.toString()==t.toString();var h=xN(e);if(o=h.length,o!==xN(t).length)return!1;for(i=o;i--!==0;)if(!TDe.call(t,h[i]))return!1;if(LDe&&e instanceof Element&&t instanceof Element)return e===t;for(i=o;i--!==0;)if(a=h[i],!(a==="_owner"&&e.$$typeof)&&!i_(e[a],t[a]))return!1;return!0}return e!==e&&t!==t}var md=function(t,n){try{return i_(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}},ADe=function(t){return ODe(t)&&!MDe(t)};function ODe(e){return!!e&&typeof e=="object"}function MDe(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||DDe(e)}var IDe=typeof Symbol=="function"&&Symbol.for,RDe=IDe?Symbol.for("react.element"):60103;function DDe(e){return e.$$typeof===RDe}function NDe(e){return Array.isArray(e)?[]:{}}function gS(e,t){return t.clone!==!1&&t.isMergeableObject(e)?sy(NDe(e),e,t):e}function jDe(e,t,n){return e.concat(t).map(function(r){return gS(r,n)})}function BDe(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(i){r[i]=gS(e[i],n)}),Object.keys(t).forEach(function(i){!n.isMergeableObject(t[i])||!e[i]?r[i]=gS(t[i],n):r[i]=sy(e[i],t[i],n)}),r}function sy(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||jDe,n.isMergeableObject=n.isMergeableObject||ADe;var r=Array.isArray(t),i=Array.isArray(e),o=r===i;return o?r?n.arrayMerge(e,t,n):BDe(e,t,n):gS(t,n)}sy.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,i){return sy(r,i,n)},{})};var o_=sy,FDe=typeof global=="object"&&global&&global.Object===Object&&global;const iK=FDe;var $De=typeof self=="object"&&self&&self.Object===Object&&self,zDe=iK||$De||Function("return this")();const mu=zDe;var HDe=mu.Symbol;const ef=HDe;var oK=Object.prototype,VDe=oK.hasOwnProperty,WDe=oK.toString,gv=ef?ef.toStringTag:void 0;function UDe(e){var t=VDe.call(e,gv),n=e[gv];try{e[gv]=void 0;var r=!0}catch{}var i=WDe.call(e);return r&&(t?e[gv]=n:delete e[gv]),i}var GDe=Object.prototype,qDe=GDe.toString;function YDe(e){return qDe.call(e)}var KDe="[object Null]",XDe="[object Undefined]",wN=ef?ef.toStringTag:void 0;function xp(e){return e==null?e===void 0?XDe:KDe:wN&&wN in Object(e)?UDe(e):YDe(e)}function aK(e,t){return function(n){return e(t(n))}}var ZDe=aK(Object.getPrototypeOf,Object);const uT=ZDe;function wp(e){return e!=null&&typeof e=="object"}var QDe="[object Object]",JDe=Function.prototype,eNe=Object.prototype,sK=JDe.toString,tNe=eNe.hasOwnProperty,nNe=sK.call(Object);function CN(e){if(!wp(e)||xp(e)!=QDe)return!1;var t=uT(e);if(t===null)return!0;var n=tNe.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&sK.call(n)==nNe}function rNe(){this.__data__=[],this.size=0}function lK(e,t){return e===t||e!==e&&t!==t}function dw(e,t){for(var n=e.length;n--;)if(lK(e[n][0],t))return n;return-1}var iNe=Array.prototype,oNe=iNe.splice;function aNe(e){var t=this.__data__,n=dw(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():oNe.call(t,n,1),--this.size,!0}function sNe(e){var t=this.__data__,n=dw(t,e);return n<0?void 0:t[n][1]}function lNe(e){return dw(this.__data__,e)>-1}function uNe(e,t){var n=this.__data__,r=dw(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function vc(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=mje}var vje="[object Arguments]",yje="[object Array]",bje="[object Boolean]",Sje="[object Date]",xje="[object Error]",wje="[object Function]",Cje="[object Map]",_je="[object Number]",kje="[object Object]",Eje="[object RegExp]",Pje="[object Set]",Tje="[object String]",Lje="[object WeakMap]",Aje="[object ArrayBuffer]",Oje="[object DataView]",Mje="[object Float32Array]",Ije="[object Float64Array]",Rje="[object Int8Array]",Dje="[object Int16Array]",Nje="[object Int32Array]",jje="[object Uint8Array]",Bje="[object Uint8ClampedArray]",Fje="[object Uint16Array]",$je="[object Uint32Array]",sr={};sr[Mje]=sr[Ije]=sr[Rje]=sr[Dje]=sr[Nje]=sr[jje]=sr[Bje]=sr[Fje]=sr[$je]=!0;sr[vje]=sr[yje]=sr[Aje]=sr[bje]=sr[Oje]=sr[Sje]=sr[xje]=sr[wje]=sr[Cje]=sr[_je]=sr[kje]=sr[Eje]=sr[Pje]=sr[Tje]=sr[Lje]=!1;function zje(e){return wp(e)&&gK(e.length)&&!!sr[xp(e)]}function cT(e){return function(t){return e(t)}}var mK=typeof exports=="object"&&exports&&!exports.nodeType&&exports,f2=mK&&typeof module=="object"&&module&&!module.nodeType&&module,Hje=f2&&f2.exports===mK,GC=Hje&&iK.process,Vje=function(){try{var e=f2&&f2.require&&f2.require("util").types;return e||GC&&GC.binding&&GC.binding("util")}catch{}}();const u0=Vje;var LN=u0&&u0.isTypedArray,Wje=LN?cT(LN):zje;const Uje=Wje;var Gje=Object.prototype,qje=Gje.hasOwnProperty;function vK(e,t){var n=qy(e),r=!n&&sje(e),i=!n&&!r&&pK(e),o=!n&&!r&&!i&&Uje(e),a=n||r||i||o,s=a?nje(e.length,String):[],l=s.length;for(var u in e)(t||qje.call(e,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||gje(u,l)))&&s.push(u);return s}var Yje=Object.prototype;function dT(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Yje;return e===n}var Kje=aK(Object.keys,Object);const Xje=Kje;var Zje=Object.prototype,Qje=Zje.hasOwnProperty;function Jje(e){if(!dT(e))return Xje(e);var t=[];for(var n in Object(e))Qje.call(e,n)&&n!="constructor"&&t.push(n);return t}function yK(e){return e!=null&&gK(e.length)&&!uK(e)}function fT(e){return yK(e)?vK(e):Jje(e)}function eBe(e,t){return e&&hw(t,fT(t),e)}function tBe(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var nBe=Object.prototype,rBe=nBe.hasOwnProperty;function iBe(e){if(!Gy(e))return tBe(e);var t=dT(e),n=[];for(var r in e)r=="constructor"&&(t||!rBe.call(e,r))||n.push(r);return n}function hT(e){return yK(e)?vK(e,!0):iBe(e)}function oBe(e,t){return e&&hw(t,hT(t),e)}var bK=typeof exports=="object"&&exports&&!exports.nodeType&&exports,AN=bK&&typeof module=="object"&&module&&!module.nodeType&&module,aBe=AN&&AN.exports===bK,ON=aBe?mu.Buffer:void 0,MN=ON?ON.allocUnsafe:void 0;function sBe(e,t){if(t)return e.slice();var n=e.length,r=MN?MN(n):new e.constructor(n);return e.copy(r),r}function SK(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n=0)&&(n[i]=e[i]);return n}function YN(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var KN=function(t){return Array.isArray(t)&&t.length===0},Go=function(t){return typeof t=="function"},pw=function(t){return t!==null&&typeof t=="object"},o$e=function(t){return String(Math.floor(Number(t)))===t},qC=function(t){return Object.prototype.toString.call(t)==="[object String]"},OK=function(t){return w.Children.count(t)===0},YC=function(t){return pw(t)&&Go(t.then)};function Vi(e,t,n,r){r===void 0&&(r=0);for(var i=AK(t);e&&r=0?[]:{}}}return(o===0?e:i)[a[o]]===n?e:(n===void 0?delete i[a[o]]:i[a[o]]=n,o===0&&n===void 0&&delete r[a[o]],r)}function MK(e,t,n,r){n===void 0&&(n=new WeakMap),r===void 0&&(r={});for(var i=0,o=Object.keys(e);i0?De.map(function(Ye){return j(Ye,Vi(le,Ye))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(Ue).then(function(Ye){return Ye.reduce(function(we,je,_t){return je==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||je&&(we=iu(we,De[_t],je)),we},{})})},[j]),V=w.useCallback(function(le){return Promise.all([z(le),m.validationSchema?D(le):{},m.validate?R(le):{}]).then(function(De){var Ue=De[0],Ye=De[1],we=De[2],je=o_.all([Ue,Ye,we],{arrayMerge:d$e});return je})},[m.validate,m.validationSchema,z,R,D]),K=Ka(function(le){return le===void 0&&(le=A.values),I({type:"SET_ISVALIDATING",payload:!0}),V(le).then(function(De){return k.current&&(I({type:"SET_ISVALIDATING",payload:!1}),I({type:"SET_ERRORS",payload:De})),De})});w.useEffect(function(){a&&k.current===!0&&md(y.current,m.initialValues)&&K(y.current)},[a,K]);var te=w.useCallback(function(le){var De=le&&le.values?le.values:y.current,Ue=le&&le.errors?le.errors:b.current?b.current:m.initialErrors||{},Ye=le&&le.touched?le.touched:S.current?S.current:m.initialTouched||{},we=le&&le.status?le.status:E.current?E.current:m.initialStatus;y.current=De,b.current=Ue,S.current=Ye,E.current=we;var je=function(){I({type:"RESET_FORM",payload:{isSubmitting:!!le&&!!le.isSubmitting,errors:Ue,touched:Ye,status:we,values:De,isValidating:!!le&&!!le.isValidating,submitCount:le&&le.submitCount&&typeof le.submitCount=="number"?le.submitCount:0}})};if(m.onReset){var _t=m.onReset(A.values,ct);YC(_t)?_t.then(je):je()}else je()},[m.initialErrors,m.initialStatus,m.initialTouched]);w.useEffect(function(){k.current===!0&&!md(y.current,m.initialValues)&&(u&&(y.current=m.initialValues,te()),a&&K(y.current))},[u,m.initialValues,te,a,K]),w.useEffect(function(){u&&k.current===!0&&!md(b.current,m.initialErrors)&&(b.current=m.initialErrors||uh,I({type:"SET_ERRORS",payload:m.initialErrors||uh}))},[u,m.initialErrors]),w.useEffect(function(){u&&k.current===!0&&!md(S.current,m.initialTouched)&&(S.current=m.initialTouched||Zb,I({type:"SET_TOUCHED",payload:m.initialTouched||Zb}))},[u,m.initialTouched]),w.useEffect(function(){u&&k.current===!0&&!md(E.current,m.initialStatus)&&(E.current=m.initialStatus,I({type:"SET_STATUS",payload:m.initialStatus}))},[u,m.initialStatus,m.initialTouched]);var q=Ka(function(le){if(_.current[le]&&Go(_.current[le].validate)){var De=Vi(A.values,le),Ue=_.current[le].validate(De);return YC(Ue)?(I({type:"SET_ISVALIDATING",payload:!0}),Ue.then(function(Ye){return Ye}).then(function(Ye){I({type:"SET_FIELD_ERROR",payload:{field:le,value:Ye}}),I({type:"SET_ISVALIDATING",payload:!1})})):(I({type:"SET_FIELD_ERROR",payload:{field:le,value:Ue}}),Promise.resolve(Ue))}else if(m.validationSchema)return I({type:"SET_ISVALIDATING",payload:!0}),D(A.values,le).then(function(Ye){return Ye}).then(function(Ye){I({type:"SET_FIELD_ERROR",payload:{field:le,value:Ye[le]}}),I({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),F=w.useCallback(function(le,De){var Ue=De.validate;_.current[le]={validate:Ue}},[]),U=w.useCallback(function(le){delete _.current[le]},[]),X=Ka(function(le,De){I({type:"SET_TOUCHED",payload:le});var Ue=De===void 0?i:De;return Ue?K(A.values):Promise.resolve()}),Z=w.useCallback(function(le){I({type:"SET_ERRORS",payload:le})},[]),W=Ka(function(le,De){var Ue=Go(le)?le(A.values):le;I({type:"SET_VALUES",payload:Ue});var Ye=De===void 0?n:De;return Ye?K(Ue):Promise.resolve()}),Q=w.useCallback(function(le,De){I({type:"SET_FIELD_ERROR",payload:{field:le,value:De}})},[]),ie=Ka(function(le,De,Ue){I({type:"SET_FIELD_VALUE",payload:{field:le,value:De}});var Ye=Ue===void 0?n:Ue;return Ye?K(iu(A.values,le,De)):Promise.resolve()}),fe=w.useCallback(function(le,De){var Ue=De,Ye=le,we;if(!qC(le)){le.persist&&le.persist();var je=le.target?le.target:le.currentTarget,_t=je.type,Dt=je.name,Le=je.id,At=je.value,Fe=je.checked,vt=je.outerHTML,nn=je.options,Rn=je.multiple;Ue=De||Dt||Le,Ye=/number|range/.test(_t)?(we=parseFloat(At),isNaN(we)?"":we):/checkbox/.test(_t)?h$e(Vi(A.values,Ue),Fe,At):nn&&Rn?f$e(nn):At}Ue&&ie(Ue,Ye)},[ie,A.values]),Se=Ka(function(le){if(qC(le))return function(De){return fe(De,le)};fe(le)}),Te=Ka(function(le,De,Ue){De===void 0&&(De=!0),I({type:"SET_FIELD_TOUCHED",payload:{field:le,value:De}});var Ye=Ue===void 0?i:Ue;return Ye?K(A.values):Promise.resolve()}),ye=w.useCallback(function(le,De){le.persist&&le.persist();var Ue=le.target,Ye=Ue.name,we=Ue.id,je=Ue.outerHTML,_t=De||Ye||we;Te(_t,!0)},[Te]),He=Ka(function(le){if(qC(le))return function(De){return ye(De,le)};ye(le)}),Ne=w.useCallback(function(le){Go(le)?I({type:"SET_FORMIK_STATE",payload:le}):I({type:"SET_FORMIK_STATE",payload:function(){return le}})},[]),tt=w.useCallback(function(le){I({type:"SET_STATUS",payload:le})},[]),_e=w.useCallback(function(le){I({type:"SET_ISSUBMITTING",payload:le})},[]),lt=Ka(function(){return I({type:"SUBMIT_ATTEMPT"}),K().then(function(le){var De=le instanceof Error,Ue=!De&&Object.keys(le).length===0;if(Ue){var Ye;try{if(Ye=mt(),Ye===void 0)return}catch(we){throw we}return Promise.resolve(Ye).then(function(we){return k.current&&I({type:"SUBMIT_SUCCESS"}),we}).catch(function(we){if(k.current)throw I({type:"SUBMIT_FAILURE"}),we})}else if(k.current&&(I({type:"SUBMIT_FAILURE"}),De))throw le})}),wt=Ka(function(le){le&&le.preventDefault&&Go(le.preventDefault)&&le.preventDefault(),le&&le.stopPropagation&&Go(le.stopPropagation)&&le.stopPropagation(),lt().catch(function(De){console.warn("Warning: An unhandled error was caught from submitForm()",De)})}),ct={resetForm:te,validateForm:K,validateField:q,setErrors:Z,setFieldError:Q,setFieldTouched:Te,setFieldValue:ie,setStatus:tt,setSubmitting:_e,setTouched:X,setValues:W,setFormikState:Ne,submitForm:lt},mt=Ka(function(){return d(A.values,ct)}),St=Ka(function(le){le&&le.preventDefault&&Go(le.preventDefault)&&le.preventDefault(),le&&le.stopPropagation&&Go(le.stopPropagation)&&le.stopPropagation(),te()}),Ae=w.useCallback(function(le){return{value:Vi(A.values,le),error:Vi(A.errors,le),touched:!!Vi(A.touched,le),initialValue:Vi(y.current,le),initialTouched:!!Vi(S.current,le),initialError:Vi(b.current,le)}},[A.errors,A.touched,A.values]),ut=w.useCallback(function(le){return{setValue:function(Ue,Ye){return ie(le,Ue,Ye)},setTouched:function(Ue,Ye){return Te(le,Ue,Ye)},setError:function(Ue){return Q(le,Ue)}}},[ie,Te,Q]),Mt=w.useCallback(function(le){var De=pw(le),Ue=De?le.name:le,Ye=Vi(A.values,Ue),we={name:Ue,value:Ye,onChange:Se,onBlur:He};if(De){var je=le.type,_t=le.value,Dt=le.as,Le=le.multiple;je==="checkbox"?_t===void 0?we.checked=!!Ye:(we.checked=!!(Array.isArray(Ye)&&~Ye.indexOf(_t)),we.value=_t):je==="radio"?(we.checked=Ye===_t,we.value=_t):Dt==="select"&&Le&&(we.value=we.value||[],we.multiple=!0)}return we},[He,Se,A.values]),at=w.useMemo(function(){return!md(y.current,A.values)},[y.current,A.values]),Ct=w.useMemo(function(){return typeof s<"u"?at?A.errors&&Object.keys(A.errors).length===0:s!==!1&&Go(s)?s(m):s:A.errors&&Object.keys(A.errors).length===0},[s,at,A.errors,m]),Zt=qn({},A,{initialValues:y.current,initialErrors:b.current,initialTouched:S.current,initialStatus:E.current,handleBlur:He,handleChange:Se,handleReset:St,handleSubmit:wt,resetForm:te,setErrors:Z,setFormikState:Ne,setFieldTouched:Te,setFieldValue:ie,setFieldError:Q,setStatus:tt,setSubmitting:_e,setTouched:X,setValues:W,submitForm:lt,validateForm:K,validateField:q,isValid:Ct,dirty:at,unregisterField:U,registerField:F,getFieldProps:Mt,getFieldMeta:Ae,getFieldHelpers:ut,validateOnBlur:i,validateOnChange:n,validateOnMount:a});return Zt}function Yy(e){var t=l$e(e),n=e.component,r=e.children,i=e.render,o=e.innerRef;return w.useImperativeHandle(o,function(){return t}),w.createElement(a$e,{value:t},n?w.createElement(n,t):i?i(t):r?Go(r)?r(t):OK(r)?null:w.Children.only(r):null)}function u$e(e){var t={};if(e.inner){if(e.inner.length===0)return iu(t,e.path,e.message);for(var i=e.inner,n=Array.isArray(i),r=0,i=n?i:i[Symbol.iterator]();;){var o;if(n){if(r>=i.length)break;o=i[r++]}else{if(r=i.next(),r.done)break;o=r.value}var a=o;Vi(t,a.path)||(t=iu(t,a.path,a.message))}}return t}function c$e(e,t,n,r){n===void 0&&(n=!1),r===void 0&&(r={});var i=c_(e);return t[n?"validateSync":"validate"](i,{abortEarly:!1,context:r})}function c_(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(i){return Array.isArray(i)===!0||CN(i)?c_(i):i!==""?i:void 0}):CN(e[r])?t[r]=c_(e[r]):t[r]=e[r]!==""?e[r]:void 0}return t}function d$e(e,t,n){var r=e.slice();return t.forEach(function(o,a){if(typeof r[a]>"u"){var s=n.clone!==!1,l=s&&n.isMergeableObject(o);r[a]=l?o_(Array.isArray(o)?[]:{},o,n):o}else n.isMergeableObject(o)?r[a]=o_(e[a],o,n):e.indexOf(o)===-1&&r.push(o)}),r}function f$e(e){return Array.from(e).filter(function(t){return t.selected}).map(function(t){return t.value})}function h$e(e,t,n){if(typeof e=="boolean")return Boolean(t);var r=[],i=!1,o=-1;if(Array.isArray(e))r=e,o=e.indexOf(n),i=o>=0;else if(!n||n=="true"||n=="false")return Boolean(t);return t&&n&&!i?r.concat(n):i?r.slice(0,o).concat(r.slice(o+1)):r}var p$e=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?w.useLayoutEffect:w.useEffect;function Ka(e){var t=w.useRef(e);return p$e(function(){t.current=e}),w.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;ir?i:r},0);return Array.from(qn({},t,{length:n+1}))}else return[]},b$e=function(e){i$e(t,e);function t(r){var i;return i=e.call(this,r)||this,i.updateArrayField=function(o,a,s){var l=i.props,u=l.name,d=l.formik.setFormikState;d(function(h){var m=typeof s=="function"?s:o,y=typeof a=="function"?a:o,b=iu(h.values,u,o(Vi(h.values,u))),S=s?m(Vi(h.errors,u)):void 0,E=a?y(Vi(h.touched,u)):void 0;return KN(S)&&(S=void 0),KN(E)&&(E=void 0),qn({},h,{values:b,errors:s?iu(h.errors,u,S):h.errors,touched:a?iu(h.touched,u,E):h.touched})})},i.push=function(o){return i.updateArrayField(function(a){return[].concat(c0(a),[r$e(o)])},!1,!1)},i.handlePush=function(o){return function(){return i.push(o)}},i.swap=function(o,a){return i.updateArrayField(function(s){return v$e(s,o,a)},!0,!0)},i.handleSwap=function(o,a){return function(){return i.swap(o,a)}},i.move=function(o,a){return i.updateArrayField(function(s){return m$e(s,o,a)},!0,!0)},i.handleMove=function(o,a){return function(){return i.move(o,a)}},i.insert=function(o,a){return i.updateArrayField(function(s){return KC(s,o,a)},function(s){return KC(s,o,null)},function(s){return KC(s,o,null)})},i.handleInsert=function(o,a){return function(){return i.insert(o,a)}},i.replace=function(o,a){return i.updateArrayField(function(s){return y$e(s,o,a)},!1,!1)},i.handleReplace=function(o,a){return function(){return i.replace(o,a)}},i.unshift=function(o){var a=-1;return i.updateArrayField(function(s){var l=s?[o].concat(s):[o];return a<0&&(a=l.length),l},function(s){var l=s?[null].concat(s):[null];return a<0&&(a=l.length),l},function(s){var l=s?[null].concat(s):[null];return a<0&&(a=l.length),l}),a},i.handleUnshift=function(o){return function(){return i.unshift(o)}},i.handleRemove=function(o){return function(){return i.remove(o)}},i.handlePop=function(){return function(){return i.pop()}},i.remove=i.remove.bind(YN(i)),i.pop=i.pop.bind(YN(i)),i}var n=t.prototype;return n.componentDidUpdate=function(i){this.props.validateOnChange&&this.props.formik.validateOnChange&&!md(Vi(i.formik.values,i.name),Vi(this.props.formik.values,this.props.name))&&this.props.formik.validateForm(this.props.formik.values)},n.remove=function(i){var o;return this.updateArrayField(function(a){var s=a?c0(a):[];return o||(o=s[i]),Go(s.splice)&&s.splice(i,1),s},!0,!0),o},n.pop=function(){var i;return this.updateArrayField(function(o){var a=o;return i||(i=a&&a.pop&&a.pop()),a},!0,!0),i},n.render=function(){var i={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},o=this.props,a=o.component,s=o.render,l=o.children,u=o.name,d=o.formik,h=Lh(d,["validate","validationSchema"]),m=qn({},i,{form:h,name:u});return a?w.createElement(a,m):s?s(m):l?typeof l=="function"?l(m):OK(l)?null:w.Children.only(l):null},t}(w.Component);b$e.defaultProps={validateOnChange:!0};const S$e=ot([ir],e=>{const{openModel:t,model_list:n}=e;return{model_list:n,openModel:t}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),XN=64,ZN=2048;function x$e(){const{openModel:e,model_list:t}=he(S$e),n=he(l=>l.system.isProcessing),r=Ie(),{t:i}=Ve(),[o,a]=w.useState({name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,default:!1,format:"ckpt"});w.useEffect(()=>{var l,u,d,h,m,y,b;if(e){const S=Ee.pickBy(t,(E,k)=>Ee.isEqual(k,e));a({name:e,description:(l=S[e])==null?void 0:l.description,config:(u=S[e])==null?void 0:u.config,weights:(d=S[e])==null?void 0:d.weights,vae:(h=S[e])==null?void 0:h.vae,width:(m=S[e])==null?void 0:m.width,height:(y=S[e])==null?void 0:y.height,default:(b=S[e])==null?void 0:b.default,format:"ckpt"})}},[t,e]);const s=l=>{r(Fy({...l,width:Number(l.width),height:Number(l.height)}))};return e?v.jsxs(qe,{flexDirection:"column",rowGap:"1rem",width:"100%",children:[v.jsx(qe,{alignItems:"center",children:v.jsx(fn,{fontSize:"lg",fontWeight:"bold",children:e})}),v.jsx(qe,{flexDirection:"column",maxHeight:window.innerHeight-270,overflowY:"scroll",paddingRight:"2rem",children:v.jsx(Yy,{enableReinitialize:!0,initialValues:o,onSubmit:s,children:({handleSubmit:l,errors:u,touched:d})=>v.jsx("form",{onSubmit:l,children:v.jsxs(yn,{rowGap:"0.5rem",alignItems:"start",children:[v.jsxs(dn,{isInvalid:!!u.description&&d.description,isRequired:!0,children:[v.jsx(kn,{htmlFor:"description",fontSize:"sm",children:i("modelmanager:description")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:kr,id:"description",name:"description",type:"text",width:"lg"}),u.description&&d.description?v.jsx(ur,{children:u.description}):v.jsx(lr,{margin:0,children:i("modelmanager:descriptionValidationMsg")})]})]}),v.jsxs(dn,{isInvalid:!!u.config&&d.config,isRequired:!0,children:[v.jsx(kn,{htmlFor:"config",fontSize:"sm",children:i("modelmanager:config")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:kr,id:"config",name:"config",type:"text",width:"lg"}),u.config&&d.config?v.jsx(ur,{children:u.config}):v.jsx(lr,{margin:0,children:i("modelmanager:configValidationMsg")})]})]}),v.jsxs(dn,{isInvalid:!!u.weights&&d.weights,isRequired:!0,children:[v.jsx(kn,{htmlFor:"config",fontSize:"sm",children:i("modelmanager:modelLocation")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:kr,id:"weights",name:"weights",type:"text",width:"lg"}),u.weights&&d.weights?v.jsx(ur,{children:u.weights}):v.jsx(lr,{margin:0,children:i("modelmanager:modelLocationValidationMsg")})]})]}),v.jsxs(dn,{isInvalid:!!u.vae&&d.vae,children:[v.jsx(kn,{htmlFor:"vae",fontSize:"sm",children:i("modelmanager:vaeLocation")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:kr,id:"vae",name:"vae",type:"text",width:"lg"}),u.vae&&d.vae?v.jsx(ur,{children:u.vae}):v.jsx(lr,{margin:0,children:i("modelmanager:vaeLocationValidationMsg")})]})]}),v.jsxs(wy,{width:"100%",children:[v.jsxs(dn,{isInvalid:!!u.width&&d.width,children:[v.jsx(kn,{htmlFor:"width",fontSize:"sm",children:i("modelmanager:width")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{id:"width",name:"width",children:({field:h,form:m})=>v.jsx(To,{id:"width",name:"width",min:XN,max:ZN,step:64,value:m.values.width,onChange:y=>m.setFieldValue(h.name,Number(y))})}),u.width&&d.width?v.jsx(ur,{children:u.width}):v.jsx(lr,{margin:0,children:i("modelmanager:widthValidationMsg")})]})]}),v.jsxs(dn,{isInvalid:!!u.height&&d.height,children:[v.jsx(kn,{htmlFor:"height",fontSize:"sm",children:i("modelmanager:height")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{id:"height",name:"height",children:({field:h,form:m})=>v.jsx(To,{id:"height",name:"height",min:XN,max:ZN,step:64,value:m.values.height,onChange:y=>m.setFieldValue(h.name,Number(y))})}),u.height&&d.height?v.jsx(ur,{children:u.height}):v.jsx(lr,{margin:0,children:i("modelmanager:heightValidationMsg")})]})]})]}),v.jsx(cr,{type:"submit",className:"modal-close-btn",isLoading:n,children:i("modelmanager:updateModel")})]})})})})]}):v.jsx(qe,{width:"100%",justifyContent:"center",alignItems:"center",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",children:v.jsx(fn,{fontWeight:"bold",color:"var(--subtext-color-bright)",children:"Pick A Model To Edit"})})}const w$e=ot([ir],e=>{const{openModel:t,model_list:n}=e;return{model_list:n,openModel:t}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}});function C$e(){const{openModel:e,model_list:t}=he(w$e),n=he(l=>l.system.isProcessing),r=Ie(),{t:i}=Ve(),[o,a]=w.useState({name:"",description:"",repo_id:"",path:"",vae:{repo_id:"",path:""},default:!1,format:"diffusers"});w.useEffect(()=>{var l,u,d,h,m,y,b,S,E,k,_,T,A,I,R,D;if(e){const j=Ee.pickBy(t,(z,V)=>Ee.isEqual(V,e));a({name:e,description:(l=j[e])==null?void 0:l.description,path:(u=j[e])!=null&&u.path&&((d=j[e])==null?void 0:d.path)!=="None"?(h=j[e])==null?void 0:h.path:"",repo_id:(m=j[e])!=null&&m.repo_id&&((y=j[e])==null?void 0:y.repo_id)!=="None"?(b=j[e])==null?void 0:b.repo_id:"",vae:{repo_id:(E=(S=j[e])==null?void 0:S.vae)!=null&&E.repo_id?(_=(k=j[e])==null?void 0:k.vae)==null?void 0:_.repo_id:"",path:(A=(T=j[e])==null?void 0:T.vae)!=null&&A.path?(R=(I=j[e])==null?void 0:I.vae)==null?void 0:R.path:""},default:(D=j[e])==null?void 0:D.default,format:"diffusers"})}},[t,e]);const s=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,r(Fy(l))};return e?v.jsxs(qe,{flexDirection:"column",rowGap:"1rem",width:"100%",children:[v.jsx(qe,{alignItems:"center",children:v.jsx(fn,{fontSize:"lg",fontWeight:"bold",children:e})}),v.jsx(qe,{flexDirection:"column",maxHeight:window.innerHeight-270,overflowY:"scroll",paddingRight:"2rem",children:v.jsx(Yy,{enableReinitialize:!0,initialValues:o,onSubmit:s,children:({handleSubmit:l,errors:u,touched:d})=>{var h,m,y,b,S,E,k,_,T,A;return v.jsx("form",{onSubmit:l,children:v.jsxs(yn,{rowGap:"0.5rem",alignItems:"start",children:[v.jsxs(dn,{isInvalid:!!u.description&&d.description,isRequired:!0,children:[v.jsx(kn,{htmlFor:"description",fontSize:"sm",children:i("modelmanager:description")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:kr,id:"description",name:"description",type:"text",width:"lg"}),u.description&&d.description?v.jsx(ur,{children:u.description}):v.jsx(lr,{margin:0,children:i("modelmanager:descriptionValidationMsg")})]})]}),v.jsxs(dn,{isInvalid:!!u.path&&d.path,isRequired:!0,children:[v.jsx(kn,{htmlFor:"path",fontSize:"sm",children:i("modelmanager:modelLocation")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:kr,id:"path",name:"path",type:"text",width:"lg"}),u.path&&d.path?v.jsx(ur,{children:u.path}):v.jsx(lr,{margin:0,children:i("modelmanager:modelLocationValidationMsg")})]})]}),v.jsxs(dn,{isInvalid:!!u.repo_id&&d.repo_id,children:[v.jsx(kn,{htmlFor:"repo_id",fontSize:"sm",children:i("modelmanager:repo_id")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:kr,id:"repo_id",name:"repo_id",type:"text",width:"lg"}),u.repo_id&&d.repo_id?v.jsx(ur,{children:u.repo_id}):v.jsx(lr,{margin:0,children:i("modelmanager:repoIDValidationMsg")})]})]}),v.jsxs(dn,{isInvalid:!!((h=u.vae)!=null&&h.path)&&((m=d.vae)==null?void 0:m.path),children:[v.jsx(kn,{htmlFor:"vae.path",fontSize:"sm",children:i("modelmanager:vaeLocation")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:kr,id:"vae.path",name:"vae.path",type:"text",width:"lg"}),(y=u.vae)!=null&&y.path&&((b=d.vae)!=null&&b.path)?v.jsx(ur,{children:(S=u.vae)==null?void 0:S.path}):v.jsx(lr,{margin:0,children:i("modelmanager:vaeLocationValidationMsg")})]})]}),v.jsxs(dn,{isInvalid:!!((E=u.vae)!=null&&E.repo_id)&&((k=d.vae)==null?void 0:k.repo_id),children:[v.jsx(kn,{htmlFor:"vae.repo_id",fontSize:"sm",children:i("modelmanager:vaeRepoID")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:kr,id:"vae.repo_id",name:"vae.repo_id",type:"text",width:"lg"}),(_=u.vae)!=null&&_.repo_id&&((T=d.vae)!=null&&T.repo_id)?v.jsx(ur,{children:(A=u.vae)==null?void 0:A.repo_id}):v.jsx(lr,{margin:0,children:i("modelmanager:vaeRepoIDValidationMsg")})]})]}),v.jsx(cr,{type:"submit",className:"modal-close-btn",isLoading:n,children:i("modelmanager:updateModel")})]})})}})})]}):v.jsx(qe,{width:"100%",justifyContent:"center",alignItems:"center",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",children:v.jsx(fn,{fontWeight:"bold",color:"var(--subtext-color-bright)",children:"Pick A Model To Edit"})})}const RK=ot([ir],e=>{const{model_list:t}=e,n=[];return Ee.forEach(t,r=>{n.push(r.weights)}),n});function _$e(){const{t:e}=Ve();return v.jsx(_o,{position:"absolute",zIndex:2,right:4,top:4,fontSize:"0.7rem",fontWeight:"bold",backgroundColor:"var(--accent-color)",padding:"0.2rem 0.5rem",borderRadius:"0.2rem",alignItems:"center",children:e("modelmanager:modelExists")})}function QN({model:e,modelsToAdd:t,setModelsToAdd:n}){const r=he(RK),i=o=>{t.includes(o.target.value)?n(Ee.remove(t,a=>a!==o.target.value)):n([...t,o.target.value])};return v.jsxs(_o,{position:"relative",children:[r.includes(e.location)?v.jsx(_$e,{}):null,v.jsx(er,{value:e.name,label:v.jsx(v.Fragment,{children:v.jsxs(yn,{alignItems:"start",children:[v.jsx("p",{style:{fontWeight:"bold"},children:e.name}),v.jsx("p",{style:{fontStyle:"italic"},children:e.location})]})}),isChecked:t.includes(e.name),isDisabled:r.includes(e.location),onChange:i,padding:"1rem",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",_checked:{backgroundColor:"var(--accent-color)",color:"var(--text-color)"},_disabled:{backgroundColor:"var(--background-color-secondary)"}})]})}function k$e(){const e=Ie(),{t}=Ve(),n=he(S=>S.system.searchFolder),r=he(S=>S.system.foundModels),i=he(RK),o=he(S=>S.ui.shouldShowExistingModelsInSearch),a=he(S=>S.system.isProcessing),[s,l]=N.useState([]),u=()=>{e(FU(null)),e($U(null)),l([])},d=S=>{e(cD(S.checkpointFolder))},h=()=>{l([]),r&&r.forEach(S=>{i.includes(S.location)||l(E=>[...E,S.name])})},m=()=>{l([])},y=()=>{const S=r==null?void 0:r.filter(E=>s.includes(E.name));S==null||S.forEach(E=>{const k={name:E.name,description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:E.location,vae:"",width:512,height:512,default:!1,format:"ckpt"};e(Fy(k))}),l([])},b=()=>{const S=[],E=[];return r&&r.forEach((k,_)=>{i.includes(k.location)?E.push(v.jsx(QN,{model:k,modelsToAdd:s,setModelsToAdd:l},_)):S.push(v.jsx(QN,{model:k,modelsToAdd:s,setModelsToAdd:l},_))}),v.jsxs(v.Fragment,{children:[S,o&&E]})};return v.jsxs(v.Fragment,{children:[n?v.jsxs(qe,{flexDirection:"column",padding:"1rem",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",rowGap:"0.5rem",position:"relative",children:[v.jsx("p",{style:{fontWeight:"bold",fontSize:"0.8rem",backgroundColor:"var(--background-color-secondary)",padding:"0.2rem 1rem",width:"max-content",borderRadius:"0.2rem"},children:t("modelmanager:checkpointFolder")}),v.jsx("p",{style:{fontWeight:"bold",fontSize:"0.8rem",maxWidth:"80%"},children:n}),v.jsx(Ze,{"aria-label":t("modelmanager:scanAgain"),tooltip:t("modelmanager:scanAgain"),icon:v.jsx(Qx,{}),position:"absolute",right:16,fontSize:18,disabled:a,onClick:()=>e(cD(n))}),v.jsx(Ze,{"aria-label":t("modelmanager:clearCheckpointFolder"),icon:v.jsx(zy,{style:{transform:"rotate(45deg)"}}),position:"absolute",right:5,onClick:u})]}):v.jsx(Yy,{initialValues:{checkpointFolder:""},onSubmit:S=>{d(S)},children:({handleSubmit:S})=>v.jsx("form",{onSubmit:S,children:v.jsxs(wy,{columnGap:"0.5rem",children:[v.jsx(dn,{isRequired:!0,width:"max-content",children:v.jsx(dr,{as:kr,id:"checkpointFolder",name:"checkpointFolder",type:"text",width:"lg",size:"md",label:t("modelmanager:checkpointFolder")})}),v.jsx(Ze,{icon:v.jsx($Ee,{}),"aria-label":t("modelmanager:findModels"),tooltip:t("modelmanager:findModels"),type:"submit",disabled:a})]})})}),r&&v.jsxs(qe,{flexDirection:"column",rowGap:"1rem",children:[v.jsxs(qe,{justifyContent:"space-between",alignItems:"center",children:[v.jsxs("p",{children:[t("modelmanager:modelsFound"),": ",r.length]}),v.jsxs("p",{children:[t("modelmanager:selected"),": ",s.length]})]}),v.jsxs(qe,{columnGap:"0.5rem",justifyContent:"space-between",children:[v.jsxs(qe,{columnGap:"0.5rem",children:[v.jsx(cr,{isDisabled:s.length===r.length,onClick:h,children:t("modelmanager:selectAll")}),v.jsx(cr,{isDisabled:s.length===0,onClick:m,children:t("modelmanager:deselectAll")}),v.jsx(er,{label:t("modelmanager:showExisting"),isChecked:o,onChange:()=>e(dCe(!o))})]}),v.jsx(cr,{isDisabled:s.length===0,onClick:y,backgroundColor:s.length>0?"var(--accent-color) !important":"",children:t("modelmanager:addSelected")})]}),v.jsxs(qe,{rowGap:"1rem",flexDirection:"column",maxHeight:"18rem",overflowY:"scroll",paddingRight:"1rem",paddingLeft:"0.2rem",borderRadius:"0.2rem",children:[r.length>0?s.length===0&&v.jsx(fn,{fontWeight:"bold",fontSize:14,padding:"0.5rem",borderRadius:"0.2rem",margin:"0 0.5rem 0 1rem",textAlign:"center",backgroundColor:"var(--notice-color)",boxShadow:"0 0 200px 6px var(--notice-color)",marginTop:"1rem",width:"max-content",children:t("modelmanager:selectAndAdd")}):v.jsx(fn,{fontWeight:"bold",fontSize:14,padding:"0.5rem",borderRadius:"0.2rem",textAlign:"center",backgroundColor:"var(--status-bad-color)",children:t("modelmanager:noModelsFound")}),b()]})]})]})}const JN=64,ej=2048;function E$e(){const e=Ie(),{t}=Ve(),n=he(u=>u.system.isProcessing);function r(u){return/\s/.test(u)}function i(u){let d;return r(u)&&(d=t("modelmanager:cannotUseSpaces")),d}const o={name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,format:"ckpt",default:!1},a=u=>{e(Fy(u)),e(zh(null))},[s,l]=N.useState(!1);return v.jsxs(v.Fragment,{children:[v.jsx(Ze,{"aria-label":t("common:back"),tooltip:t("common:back"),onClick:()=>e(zh(null)),width:"max-content",position:"absolute",zIndex:1,size:"sm",right:12,top:3,icon:v.jsx(_q,{})}),v.jsx(k$e,{}),v.jsx(er,{label:t("modelmanager:addManually"),isChecked:s,onChange:()=>l(!s)}),s&&v.jsx(Yy,{initialValues:o,onSubmit:a,children:({handleSubmit:u,errors:d,touched:h})=>v.jsx("form",{onSubmit:u,children:v.jsxs(yn,{rowGap:"0.5rem",children:[v.jsx(fn,{fontSize:20,fontWeight:"bold",alignSelf:"start",children:t("modelmanager:manual")}),v.jsxs(dn,{isInvalid:!!d.name&&h.name,isRequired:!0,children:[v.jsx(kn,{htmlFor:"name",fontSize:"sm",children:t("modelmanager:name")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:kr,id:"name",name:"name",type:"text",validate:i,width:"2xl"}),d.name&&h.name?v.jsx(ur,{children:d.name}):v.jsx(lr,{margin:0,children:t("modelmanager:nameValidationMsg")})]})]}),v.jsxs(dn,{isInvalid:!!d.description&&h.description,isRequired:!0,children:[v.jsx(kn,{htmlFor:"description",fontSize:"sm",children:t("modelmanager:description")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:kr,id:"description",name:"description",type:"text",width:"2xl"}),d.description&&h.description?v.jsx(ur,{children:d.description}):v.jsx(lr,{margin:0,children:t("modelmanager:descriptionValidationMsg")})]})]}),v.jsxs(dn,{isInvalid:!!d.config&&h.config,isRequired:!0,children:[v.jsx(kn,{htmlFor:"config",fontSize:"sm",children:t("modelmanager:config")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:kr,id:"config",name:"config",type:"text",width:"2xl"}),d.config&&h.config?v.jsx(ur,{children:d.config}):v.jsx(lr,{margin:0,children:t("modelmanager:configValidationMsg")})]})]}),v.jsxs(dn,{isInvalid:!!d.weights&&h.weights,isRequired:!0,children:[v.jsx(kn,{htmlFor:"config",fontSize:"sm",children:t("modelmanager:modelLocation")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:kr,id:"weights",name:"weights",type:"text",width:"2xl"}),d.weights&&h.weights?v.jsx(ur,{children:d.weights}):v.jsx(lr,{margin:0,children:t("modelmanager:modelLocationValidationMsg")})]})]}),v.jsxs(dn,{isInvalid:!!d.vae&&h.vae,children:[v.jsx(kn,{htmlFor:"vae",fontSize:"sm",children:t("modelmanager:vaeLocation")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:kr,id:"vae",name:"vae",type:"text",width:"2xl"}),d.vae&&h.vae?v.jsx(ur,{children:d.vae}):v.jsx(lr,{margin:0,children:t("modelmanager:vaeLocationValidationMsg")})]})]}),v.jsxs(wy,{width:"100%",children:[v.jsxs(dn,{isInvalid:!!d.width&&h.width,children:[v.jsx(kn,{htmlFor:"width",fontSize:"sm",children:t("modelmanager:width")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{id:"width",name:"width",children:({field:m,form:y})=>v.jsx(To,{id:"width",name:"width",min:JN,max:ej,step:64,width:"90%",value:y.values.width,onChange:b=>y.setFieldValue(m.name,Number(b))})}),d.width&&h.width?v.jsx(ur,{children:d.width}):v.jsx(lr,{margin:0,children:t("modelmanager:widthValidationMsg")})]})]}),v.jsxs(dn,{isInvalid:!!d.height&&h.height,children:[v.jsx(kn,{htmlFor:"height",fontSize:"sm",children:t("modelmanager:height")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{id:"height",name:"height",children:({field:m,form:y})=>v.jsx(To,{id:"height",name:"height",min:JN,max:ej,width:"90%",step:64,value:y.values.height,onChange:b=>y.setFieldValue(m.name,Number(b))})}),d.height&&h.height?v.jsx(ur,{children:d.height}):v.jsx(lr,{margin:0,children:t("modelmanager:heightValidationMsg")})]})]})]}),v.jsx(cr,{type:"submit",className:"modal-close-btn",isLoading:n,children:t("modelmanager:addModel")})]})})})]})}function Qb({children:e}){return v.jsx(qe,{flexDirection:"column",backgroundColor:"var(--background-color)",padding:"1rem 1rem",borderRadius:"0.5rem",rowGap:"1rem",width:"100%",children:e})}function P$e(){const e=Ie(),{t}=Ve(),n=he(s=>s.system.isProcessing);function r(s){return/\s/.test(s)}function i(s){let l;return r(s)&&(l=t("modelmanager:cannotUseSpaces")),l}const o={name:"",description:"",repo_id:"",path:"",format:"diffusers",default:!1,vae:{repo_id:"",path:""}},a=s=>{const l=s;s.path===""&&delete l.path,s.repo_id===""&&delete l.repo_id,s.vae.path===""&&delete l.vae.path,s.vae.repo_id===""&&delete l.vae.repo_id,e(Fy(l)),e(zh(null))};return v.jsxs(qe,{children:[v.jsx(Ze,{"aria-label":t("common:back"),tooltip:t("common:back"),onClick:()=>e(zh(null)),width:"max-content",position:"absolute",zIndex:1,size:"sm",right:12,top:3,icon:v.jsx(_q,{})}),v.jsx(Yy,{initialValues:o,onSubmit:a,children:({handleSubmit:s,errors:l,touched:u})=>{var d,h,m,y,b,S,E,k,_,T;return v.jsx("form",{onSubmit:s,children:v.jsxs(yn,{rowGap:"0.5rem",children:[v.jsx(Qb,{children:v.jsxs(dn,{isInvalid:!!l.name&&u.name,isRequired:!0,children:[v.jsx(kn,{htmlFor:"name",fontSize:"sm",children:t("modelmanager:name")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:kr,id:"name",name:"name",type:"text",validate:i,width:"2xl",isRequired:!0}),l.name&&u.name?v.jsx(ur,{children:l.name}):v.jsx(lr,{margin:0,children:t("modelmanager:nameValidationMsg")})]})]})}),v.jsx(Qb,{children:v.jsxs(dn,{isInvalid:!!l.description&&u.description,isRequired:!0,children:[v.jsx(kn,{htmlFor:"description",fontSize:"sm",children:t("modelmanager:description")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:kr,id:"description",name:"description",type:"text",width:"2xl",isRequired:!0}),l.description&&u.description?v.jsx(ur,{children:l.description}):v.jsx(lr,{margin:0,children:t("modelmanager:descriptionValidationMsg")})]})]})}),v.jsxs(Qb,{children:[v.jsx(fn,{fontWeight:"bold",fontSize:"sm",children:t("modelmanager:formMessageDiffusersModelLocation")}),v.jsx(fn,{fontSize:"sm",fontStyle:"italic",color:"var(--text-color-secondary)",children:t("modelmanager:formMessageDiffusersModelLocationDesc")}),v.jsxs(dn,{isInvalid:!!l.path&&u.path,children:[v.jsx(kn,{htmlFor:"path",fontSize:"sm",children:t("modelmanager:modelLocation")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:kr,id:"path",name:"path",type:"text",width:"2xl"}),l.path&&u.path?v.jsx(ur,{children:l.path}):v.jsx(lr,{margin:0,children:t("modelmanager:modelLocationValidationMsg")})]})]}),v.jsxs(dn,{isInvalid:!!l.repo_id&&u.repo_id,children:[v.jsx(kn,{htmlFor:"repo_id",fontSize:"sm",children:t("modelmanager:repo_id")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:kr,id:"repo_id",name:"repo_id",type:"text",width:"2xl"}),l.repo_id&&u.repo_id?v.jsx(ur,{children:l.repo_id}):v.jsx(lr,{margin:0,children:t("modelmanager:repoIDValidationMsg")})]})]})]}),v.jsxs(Qb,{children:[v.jsx(fn,{fontWeight:"bold",children:t("modelmanager:formMessageDiffusersVAELocation")}),v.jsx(fn,{fontSize:"sm",fontStyle:"italic",color:"var(--text-color-secondary)",children:t("modelmanager:formMessageDiffusersVAELocationDesc")}),v.jsxs(dn,{isInvalid:!!((d=l.vae)!=null&&d.path)&&((h=u.vae)==null?void 0:h.path),children:[v.jsx(kn,{htmlFor:"vae.path",fontSize:"sm",children:t("modelmanager:vaeLocation")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:kr,id:"vae.path",name:"vae.path",type:"text",width:"2xl"}),(m=l.vae)!=null&&m.path&&((y=u.vae)!=null&&y.path)?v.jsx(ur,{children:(b=l.vae)==null?void 0:b.path}):v.jsx(lr,{margin:0,children:t("modelmanager:vaeLocationValidationMsg")})]})]}),v.jsxs(dn,{isInvalid:!!((S=l.vae)!=null&&S.repo_id)&&((E=u.vae)==null?void 0:E.repo_id),children:[v.jsx(kn,{htmlFor:"vae.repo_id",fontSize:"sm",children:t("modelmanager:vaeRepoID")}),v.jsxs(yn,{alignItems:"start",children:[v.jsx(dr,{as:kr,id:"vae.repo_id",name:"vae.repo_id",type:"text",width:"2xl"}),(k=l.vae)!=null&&k.repo_id&&((_=u.vae)!=null&&_.repo_id)?v.jsx(ur,{children:(T=l.vae)==null?void 0:T.repo_id}):v.jsx(lr,{margin:0,children:t("modelmanager:vaeRepoIDValidationMsg")})]})]})]}),v.jsx(cr,{type:"submit",className:"modal-close-btn",isLoading:n,children:t("modelmanager:addModel")})]})})}})]})}function tj({text:e,onClick:t}){return v.jsx(qe,{position:"relative",width:"50%",height:"200px",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",justifyContent:"center",alignItems:"center",_hover:{cursor:"pointer",backgroundColor:"var(--accent-color)"},onClick:t,children:v.jsx(fn,{fontWeight:"bold",children:e})})}function T$e(){const{isOpen:e,onOpen:t,onClose:n}=Wh(),r=he(s=>s.ui.addNewModelUIOption),i=Ie(),{t:o}=Ve(),a=()=>{n(),i(zh(null))};return v.jsxs(v.Fragment,{children:[v.jsx(cr,{"aria-label":o("modelmanager:addNewModel"),tooltip:o("modelmanager:addNewModel"),onClick:t,className:"modal-close-btn",size:"sm",children:v.jsxs(qe,{columnGap:"0.5rem",alignItems:"center",children:[v.jsx(zy,{}),o("modelmanager:addNew")]})}),v.jsxs(Yd,{isOpen:e,onClose:a,size:"3xl",closeOnOverlayClick:!1,children:[v.jsx(Kd,{}),v.jsxs(Zh,{className:"modal add-model-modal",fontFamily:"Inter",children:[v.jsx(w0,{children:o("modelmanager:addNewModel")}),v.jsx(Ly,{marginTop:"0.3rem"}),v.jsxs(n0,{className:"add-model-modal-body",children:[r==null&&v.jsxs(qe,{columnGap:"1rem",children:[v.jsx(tj,{text:o("modelmanager:addCheckpointModel"),onClick:()=>i(zh("ckpt"))}),v.jsx(tj,{text:o("modelmanager:addDiffuserModel"),onClick:()=>i(zh("diffusers"))})]}),r=="ckpt"&&v.jsx(E$e,{}),r=="diffusers"&&v.jsx(P$e,{})]})]})]})]})}function Jb(e){const{isProcessing:t,isConnected:n}=he(y=>y.system),r=he(y=>y.system.openModel),{t:i}=Ve(),o=Ie(),{name:a,status:s,description:l}=e,u=()=>{o(HG(a))},d=()=>{o(LR(a))},h=()=>{o(B8e(a)),o(LR(null))},m=()=>{switch(s){case"active":return"var(--status-good-color)";case"cached":return"var(--status-working-color)";case"not loaded":return"var(--text-color-secondary)"}};return v.jsxs(qe,{alignItems:"center",padding:"0.5rem 0.5rem",borderRadius:"0.2rem",backgroundColor:a===r?"var(--accent-color)":"",_hover:{backgroundColor:a===r?"var(--accent-color)":"var(--background-color)"},children:[v.jsx(_o,{onClick:d,cursor:"pointer",children:v.jsx(lo,{label:l,hasArrow:!0,placement:"bottom",children:v.jsx(fn,{fontWeight:"bold",children:a})})}),v.jsx(f$,{onClick:d,cursor:"pointer"}),v.jsxs(qe,{gap:2,alignItems:"center",children:[v.jsx(fn,{color:m(),children:s}),v.jsx(as,{size:"sm",onClick:u,isDisabled:s==="active"||t||!n,className:"modal-close-btn",children:i("modelmanager:load")}),v.jsx(Ze,{icon:v.jsx(CEe,{}),size:"sm",onClick:d,"aria-label":"Modify Config",isDisabled:s==="active"||t||!n,className:" modal-close-btn"}),v.jsx(oT,{title:i("modelmanager:deleteModel"),acceptCallback:h,acceptButtonText:i("modelmanager:delete"),triggerComponent:v.jsx(Ze,{icon:v.jsx(wEe,{}),size:"sm","aria-label":i("modelmanager:deleteConfig"),isDisabled:s==="active"||t||!n,className:" modal-close-btn",style:{backgroundColor:"var(--btn-delete-image)"}}),children:v.jsxs(qe,{rowGap:"1rem",flexDirection:"column",children:[v.jsx("p",{style:{fontWeight:"bold"},children:i("modelmanager:deleteMsg1")}),v.jsx("p",{style:{color:"var(--text-color-secondary"},children:i("modelmanager:deleteMsg2")})]})})]})]})}const L$e=ot(ir,e=>Ee.map(e.model_list,(n,r)=>({name:r,...n})),{memoizeOptions:{resultEqualityCheck:Ee.isEqual}});function XC({label:e,isActive:t,onClick:n}){return v.jsx(cr,{onClick:n,isActive:t,_active:{backgroundColor:"var(--accent-color)",_hover:{backgroundColor:"var(--accent-color)"}},size:"sm",children:e})}const A$e=()=>{const e=he(L$e),[t,n]=w.useState(""),[r,i]=w.useState("all"),[o,a]=w.useTransition(),{t:s}=Ve(),l=d=>{a(()=>{n(d.target.value)})},u=w.useMemo(()=>{const d=[],h=[],m=[],y=[];return e.forEach((b,S)=>{b.name.toLowerCase().includes(t.toLowerCase())&&(m.push(v.jsx(Jb,{name:b.name,status:b.status,description:b.description},S)),b.format===r&&y.push(v.jsx(Jb,{name:b.name,status:b.status,description:b.description},S))),b.format!=="diffusers"?d.push(v.jsx(Jb,{name:b.name,status:b.status,description:b.description},S)):h.push(v.jsx(Jb,{name:b.name,status:b.status,description:b.description},S))}),t!==""?r==="all"?v.jsx(_o,{marginTop:"1rem",children:m}):v.jsx(_o,{marginTop:"1rem",children:y}):v.jsxs(qe,{flexDirection:"column",rowGap:"1.5rem",children:[r==="all"&&v.jsxs(v.Fragment,{children:[v.jsxs(_o,{children:[v.jsx(fn,{fontWeight:"bold",backgroundColor:"var(--background-color)",padding:"0.5rem 1rem",borderRadius:"0.5rem",margin:"1rem 0",width:"max-content",fontSize:"14",children:s("modelmanager:checkpointModels")}),d]}),v.jsxs(_o,{children:[v.jsx(fn,{fontWeight:"bold",backgroundColor:"var(--background-color)",padding:"0.5rem 1rem",borderRadius:"0.5rem",marginBottom:"0.5rem",width:"max-content",fontSize:"14",children:s("modelmanager:diffusersModels")}),h]})]}),r==="ckpt"&&v.jsx(qe,{flexDirection:"column",marginTop:"1rem",children:d}),r==="diffusers"&&v.jsx(qe,{flexDirection:"column",marginTop:"1rem",children:h})]})},[e,t,s,r]);return v.jsxs(qe,{flexDirection:"column",rowGap:"2rem",width:"50%",minWidth:"50%",children:[v.jsxs(qe,{justifyContent:"space-between",children:[v.jsx(fn,{fontSize:"1.4rem",fontWeight:"bold",children:s("modelmanager:availableModels")}),v.jsx(T$e,{})]}),v.jsx(kr,{onChange:l,label:s("modelmanager:search")}),v.jsxs(qe,{flexDirection:"column",gap:1,maxHeight:window.innerHeight-360,overflow:"scroll",paddingRight:"1rem",children:[v.jsxs(qe,{columnGap:"0.5rem",children:[v.jsx(XC,{label:s("modelmanager:allModels"),onClick:()=>i("all"),isActive:r==="all"}),v.jsx(XC,{label:s("modelmanager:checkpointModels"),onClick:()=>i("ckpt"),isActive:r==="ckpt"}),v.jsx(XC,{label:s("modelmanager:diffusersModels"),onClick:()=>i("diffusers"),isActive:r==="diffusers"})]}),u]})]})};function O$e({children:e}){const{isOpen:t,onOpen:n,onClose:r}=Wh(),i=he(s=>s.system.model_list),o=he(s=>s.system.openModel),{t:a}=Ve();return v.jsxs(v.Fragment,{children:[w.cloneElement(e,{onClick:n}),v.jsxs(Yd,{isOpen:t,onClose:r,size:"6xl",children:[v.jsx(Kd,{}),v.jsxs(Zh,{className:"modal",fontFamily:"Inter",children:[v.jsx(Ly,{className:"modal-close-btn"}),v.jsx(w0,{fontWeight:"bold",children:a("modelmanager:modelManager")}),v.jsxs(qe,{padding:"0 1.5rem 1.5rem 1.5rem",width:"100%",columnGap:"2rem",children:[v.jsx(A$e,{}),o&&i[o].format==="diffusers"?v.jsx(C$e,{}):v.jsx(x$e,{})]})]})]})]})}const M$e=ot([ir],e=>{const{isProcessing:t,model_list:n}=e;return{models:Ee.map(n,(i,o)=>o),isProcessing:t}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),I$e=()=>{const e=Ie(),{models:t,isProcessing:n}=he(M$e),r=he(GG),i=o=>{e(HG(o.target.value))};return v.jsx(qe,{style:{paddingLeft:"0.3rem"},children:v.jsx(tl,{style:{fontSize:"0.8rem"},tooltip:r.description,isDisabled:n,value:r.name,validValues:t,onChange:i})})},R$e=ot([ir,mp],(e,t)=>{const{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:i,model_list:o,saveIntermediatesInterval:a,enableImageDebugging:s}=e,{shouldUseCanvasBetaLayout:l}=t;return{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:i,models:Ee.map(o,(u,d)=>d),saveIntermediatesInterval:a,enableImageDebugging:s,shouldUseCanvasBetaLayout:l}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),D$e=({children:e})=>{const t=Ie(),{t:n}=Ve(),r=he(_=>_.generation.steps),{isOpen:i,onOpen:o,onClose:a}=Wh(),{isOpen:s,onOpen:l,onClose:u}=Wh(),{shouldDisplayInProgressType:d,shouldConfirmOnDelete:h,shouldDisplayGuides:m,saveIntermediatesInterval:y,enableImageDebugging:b,shouldUseCanvasBetaLayout:S}=he(R$e),E=()=>{UG.purge().then(()=>{a(),l()})},k=_=>{_>r&&(_=r),_<1&&(_=1),t(Z6e(_))};return v.jsxs(v.Fragment,{children:[w.cloneElement(e,{onClick:o}),v.jsxs(Yd,{isOpen:i,onClose:a,size:"lg",children:[v.jsx(Kd,{}),v.jsxs(Zh,{className:"modal settings-modal",children:[v.jsx(w0,{className:"settings-modal-header",children:n("common:settingsLabel")}),v.jsx(Ly,{className:"modal-close-btn"}),v.jsxs(n0,{className:"settings-modal-content",children:[v.jsxs("div",{className:"settings-modal-items",children:[v.jsxs("div",{className:"settings-modal-item",style:{gridAutoFlow:"row",rowGap:"0.5rem"},children:[v.jsx(tl,{label:n("settings:displayInProgress"),validValues:a7e,value:d,onChange:_=>t(W6e(_.target.value))}),d==="full-res"&&v.jsx(To,{label:n("settings:saveSteps"),min:1,max:r,step:1,onChange:k,value:y,width:"auto",textAlign:"center"})]}),v.jsx(Vs,{styleClass:"settings-modal-item",label:n("settings:confirmOnDelete"),isChecked:h,onChange:_=>t(jU(_.target.checked))}),v.jsx(Vs,{styleClass:"settings-modal-item",label:n("settings:displayHelpIcons"),isChecked:m,onChange:_=>t(Y6e(_.target.checked))}),v.jsx(Vs,{styleClass:"settings-modal-item",label:n("settings:useCanvasBeta"),isChecked:S,onChange:_=>t(cCe(_.target.checked))})]}),v.jsxs("div",{className:"settings-modal-items",children:[v.jsx("h2",{style:{fontWeight:"bold"},children:"Developer"}),v.jsx(Vs,{styleClass:"settings-modal-item",label:n("settings:enableImageDebugging"),isChecked:b,onChange:_=>t(Q6e(_.target.checked))})]}),v.jsxs("div",{className:"settings-modal-reset",children:[v.jsx(Dh,{size:"md",children:n("settings:resetWebUI")}),v.jsx(as,{colorScheme:"red",onClick:E,children:n("settings:resetWebUI")}),v.jsx(fn,{children:n("settings:resetWebUIDesc1")}),v.jsx(fn,{children:n("settings:resetWebUIDesc2")})]})]}),v.jsx(bx,{children:v.jsx(as,{onClick:a,className:"modal-close-btn",children:n("common:close")})})]})]}),v.jsxs(Yd,{closeOnOverlayClick:!1,isOpen:s,onClose:u,isCentered:!0,children:[v.jsx(Kd,{bg:"blackAlpha.300",backdropFilter:"blur(40px)"}),v.jsx(Zh,{children:v.jsx(n0,{pb:6,pt:6,children:v.jsx(qe,{justifyContent:"center",children:v.jsx(fn,{fontSize:"lg",children:v.jsx(fn,{children:n("settings:resetComplete")})})})})})]})]})},N$e=ot(ir,e=>({isConnected:e.isConnected,isProcessing:e.isProcessing,currentIteration:e.currentIteration,totalIterations:e.totalIterations,currentStatus:e.currentStatus,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}),{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),j$e=()=>{const{isConnected:e,isProcessing:t,currentIteration:n,totalIterations:r,currentStatus:i,hasError:o,wasErrorSeen:a}=he(N$e),s=Ie(),{t:l}=Ve();let u;e&&!o?u="status-good":u="status-bad";let d=i;[l("common:statusGenerating"),l("common:statusPreparing"),l("common:statusSavingImage"),l("common:statusRestoringFaces"),l("common:statusUpscaling")].includes(d)&&(u="status-working"),d&&t&&r>1&&(d=`${l(d)} (${n}/${r})`);const m=o&&!a?"Click to clear, check logs for details":void 0,y=o&&!a?"pointer":"initial",b=()=>{(o||!a)&&s(BU())};return v.jsx(lo,{label:m,children:v.jsx(fn,{cursor:y,onClick:b,className:`status ${u}`,children:l(d)})})};function B$e(){const{t:e}=Ve(),{setColorMode:t,colorMode:n}=dy(),r=Ie(),i=he(l=>l.ui.currentTheme),o={dark:e("common:darkTheme"),light:e("common:lightTheme"),green:e("common:greenTheme")};w.useEffect(()=>{n!==i&&t(i)},[t,n,i]);const a=l=>{r(oCe(l))},s=()=>{const l=[];return Object.keys(o).forEach(u=>{l.push(v.jsx(cr,{style:{width:"6rem"},leftIcon:i===u?v.jsx(PP,{}):void 0,size:"sm",onClick:()=>a(u),children:o[u]},u))}),l};return v.jsx(Zs,{trigger:"hover",triggerComponent:v.jsx(Ze,{"aria-label":e("common:themeLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:v.jsx(lEe,{})}),children:v.jsx(yn,{align:"stretch",children:s()})})}function F$e(){const{t:e,i18n:t}=Ve(),n={en:e("common:langEnglish"),nl:e("common:langDutch"),fr:e("common:langFrench"),de:e("common:langGerman"),it:e("common:langItalian"),ja:e("common:langJapanese"),pl:e("common:langPolish"),pt_br:e("common:langBrPortuguese"),ru:e("common:langRussian"),zh_cn:e("common:langSimplifiedChinese"),es:e("common:langSpanish"),ua:e("common:langUkranian")},r=()=>{const i=[];return Object.keys(n).forEach(o=>{i.push(v.jsx(cr,{"data-selected":localStorage.getItem("i18nextLng")===o,onClick:()=>t.changeLanguage(o),className:"modal-close-btn lang-select-btn","aria-label":n[o],tooltip:n[o],size:"sm",minWidth:"200px",children:n[o]},o))}),i};return v.jsx(Zs,{trigger:"hover",triggerComponent:v.jsx(Ze,{"aria-label":e("common:languagePickerLabel"),tooltip:e("common:languagePickerLabel"),icon:v.jsx(oEe,{}),size:"sm",variant:"link","data-variant":"link",fontSize:26}),children:v.jsx(yn,{children:r()})})}const $$e=()=>{const{t:e}=Ve(),t=he(n=>n.system.app_version);return v.jsxs("div",{className:"site-header",children:[v.jsxs("div",{className:"site-header-left-side",children:[v.jsx("img",{src:TY,alt:"invoke-ai-logo"}),v.jsxs(qe,{alignItems:"center",columnGap:"0.6rem",children:[v.jsxs(fn,{fontSize:"1.4rem",children:["invoke ",v.jsx("strong",{children:"ai"})]}),v.jsx(fn,{fontWeight:"bold",color:"var(--text-color-secondary)",marginTop:"0.2rem",children:t})]})]}),v.jsxs("div",{className:"site-header-right-side",children:[v.jsx(j$e,{}),v.jsx(I$e,{}),v.jsx(O$e,{children:v.jsx(Ze,{"aria-label":e("modelmanager:modelManager"),tooltip:e("modelmanager:modelManager"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:v.jsx(Zke,{})})}),v.jsx(PDe,{children:v.jsx(Ze,{"aria-label":e("common:hotkeysLabel"),tooltip:e("common:hotkeysLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:v.jsx(iEe,{})})}),v.jsx(B$e,{}),v.jsx(F$e,{}),v.jsx(Ze,{"aria-label":e("common:reportBugLabel"),tooltip:e("common:reportBugLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:v.jsx(Nh,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI/issues",children:v.jsx(Xke,{})})}),v.jsx(Ze,{"aria-label":e("common:githubLabel"),tooltip:e("common:githubLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:v.jsx(Nh,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI",children:v.jsx(Uke,{})})}),v.jsx(Ze,{"aria-label":e("common:discordLabel"),tooltip:e("common:discordLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:v.jsx(Nh,{isExternal:!0,href:"https://discord.gg/ZmtBAhwWhy",children:v.jsx(Wke,{})})}),v.jsx(D$e,{children:v.jsx(Ze,{"aria-label":e("common:settingsLabel"),tooltip:e("common:settingsLabel"),variant:"link","data-variant":"link",fontSize:22,size:"sm",icon:v.jsx(HEe,{})})})]})]})};function z$e(){async function e(n=""){return await fetch(n,{method:"GET",cache:"no-cache"})}const t=()=>{const n=document.location;e(n+"/flaskwebgui-keep-server-alive").then(i=>i)};(!{}.NODE_ENV||{}.NODE_ENV==="production")&&document.addEventListener("DOMContentLoaded",()=>{t(),setInterval(t,3e3)})}const H$e=()=>{const e=Ie(),t=he(o_e),n=Ry();w.useEffect(()=>{t.forEach(r=>{n(r)}),t.length>0&&e(eCe())},[e,n,t])},DK=ot([yp,mp,Or],(e,t,n)=>{const{shouldPinParametersPanel:r,shouldShowParametersPanel:i,shouldHoldParametersPanelOpen:o,shouldUseCanvasBetaLayout:a}=t,{shouldShowGallery:s,shouldPinGallery:l,shouldHoldGalleryOpen:u}=e,d=a&&n==="unifiedCanvas",h=!d&&!(i||o&&!r)&&["txt2img","img2img","unifiedCanvas"].includes(n),m=!(s||u&&!l)&&["txt2img","img2img","unifiedCanvas"].includes(n);return{shouldPinParametersPanel:r,shouldShowProcessButtons:!d&&(!r||!i),shouldShowParametersPanelButton:h,shouldShowParametersPanel:i,shouldShowGallery:s,shouldPinGallery:l,shouldShowGalleryButton:m}},{memoizeOptions:{resultEqualityCheck:Ee.isEqual}}),V$e=()=>{const e=Ie(),{shouldShowParametersPanel:t,shouldShowParametersPanelButton:n,shouldShowProcessButtons:r,shouldPinParametersPanel:i,shouldShowGallery:o,shouldPinGallery:a}=he(DK),s=()=>{e(Ku(!0)),i&&setTimeout(()=>e(vi(!0)),400)};return Qe("f",()=>{o||t?(e(Ku(!1)),e(Bd(!1))):(e(Ku(!0)),e(Bd(!0))),(a||i)&&setTimeout(()=>e(vi(!0)),400)},[o,t]),n?v.jsxs("div",{className:"show-hide-button-options",children:[v.jsx(Ze,{tooltip:"Show Options Panel (O)",tooltipProps:{placement:"top"},"aria-label":"Show Options Panel",onClick:s,children:v.jsx(AP,{})}),r&&v.jsxs(v.Fragment,{children:[v.jsx(XP,{iconButton:!0}),v.jsx(YP,{})]})]}):null},W$e=()=>{const e=Ie(),{shouldShowGallery:t,shouldShowGalleryButton:n,shouldPinGallery:r,shouldShowParametersPanel:i,shouldPinParametersPanel:o}=he(DK),a=()=>{e(Bd(!0)),r&&e(vi(!0))};return Qe("f",()=>{t||i?(e(Ku(!1)),e(Bd(!1))):(e(Ku(!0)),e(Bd(!0))),(r||o)&&setTimeout(()=>e(vi(!0)),400)},[t,i]),n?v.jsx(Ze,{tooltip:"Show Gallery (G)",tooltipProps:{placement:"top"},"aria-label":"Show Gallery",styleClass:"floating-show-hide-button right show-hide-button-gallery",onClick:a,children:v.jsx(Pq,{})}):null};z$e();const U$e=()=>(H$e(),v.jsxs("div",{className:"App",children:[v.jsxs(SDe,{children:[v.jsx(kDe,{}),v.jsxs("div",{className:"app-content",children:[v.jsx($$e,{}),v.jsx(kRe,{})]}),v.jsx("div",{className:"app-console",children:v.jsx(CDe,{})})]}),v.jsx(V$e,{}),v.jsx(W$e,{})]})),nj=()=>v.jsx(qe,{width:"100vw",height:"100vh",alignItems:"center",justifyContent:"center",children:v.jsx(xy,{thickness:"2px",speed:"1s",emptyColor:"gray.200",color:"gray.400",size:"xl"})});const G$e=Aj({key:"invokeai-style-cache",prepend:!0});Z9.createRoot(document.getElementById("root")).render(v.jsx(N.StrictMode,{children:v.jsx(P5e,{store:WG,children:v.jsx(mW,{loading:v.jsx(nj,{}),persistor:UG,children:v.jsx(Gne,{value:G$e,children:v.jsx(G4e,{children:v.jsx(N.Suspense,{fallback:v.jsx(nj,{}),children:v.jsx(U$e,{})})})})})})})); diff --git a/invokeai/frontend/dist/assets/index-9240ae24.js b/invokeai/frontend/dist/assets/index-9240ae24.js deleted file mode 100644 index 65a8189864..0000000000 --- a/invokeai/frontend/dist/assets/index-9240ae24.js +++ /dev/null @@ -1,612 +0,0 @@ -var dX=Object.defineProperty;var fX=(e,t,n)=>t in e?dX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var kt=(e,t,n)=>(fX(e,typeof t!="symbol"?t+"":t,n),n);function VXe(){import.meta.url,import("_").catch(()=>1);async function*e(){}}function CD(e,t){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerpolicy&&(o.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?o.credentials="include":i.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var Pi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function M7(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var rg={},hX={get exports(){return rg},set exports(e){rg=e}},xb={},S={},pX={get exports(){return S},set exports(e){S=e}},xt={};/** - * @license React - * react.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 e1=Symbol.for("react.element"),mX=Symbol.for("react.portal"),gX=Symbol.for("react.fragment"),vX=Symbol.for("react.strict_mode"),yX=Symbol.for("react.profiler"),bX=Symbol.for("react.provider"),SX=Symbol.for("react.context"),wX=Symbol.for("react.forward_ref"),CX=Symbol.for("react.suspense"),xX=Symbol.for("react.memo"),_X=Symbol.for("react.lazy"),MP=Symbol.iterator;function kX(e){return e===null||typeof e!="object"?null:(e=MP&&e[MP]||e["@@iterator"],typeof e=="function"?e:null)}var xD={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_D=Object.assign,kD={};function Ph(e,t,n){this.props=e,this.context=t,this.refs=kD,this.updater=n||xD}Ph.prototype.isReactComponent={};Ph.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Ph.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function ED(){}ED.prototype=Ph.prototype;function I7(e,t,n){this.props=e,this.context=t,this.refs=kD,this.updater=n||xD}var R7=I7.prototype=new ED;R7.constructor=I7;_D(R7,Ph.prototype);R7.isPureReactComponent=!0;var IP=Array.isArray,PD=Object.prototype.hasOwnProperty,$7={current:null},TD={key:!0,ref:!0,__self:!0,__source:!0};function LD(e,t,n){var r,i={},o=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(o=""+t.key),t)PD.call(t,r)&&!TD.hasOwnProperty(r)&&(i[r]=t[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1{const i=t?n.preventTransition():void 0;document.documentElement.dataset.theme=r,document.documentElement.style.colorScheme=r,i==null||i()},setClassName(r){document.body.classList.add(r?z0.dark:z0.light),document.body.classList.remove(r?z0.light:z0.dark)},query(){return window.matchMedia("(prefers-color-scheme: dark)")},getSystemTheme(r){var o;return((o=n.query().matches)!=null?o:r==="dark")?"dark":"light"},addListener(r){const i=n.query(),o=a=>{r(a.matches?"dark":"light")};return typeof i.addListener=="function"?i.addListener(o):i.addEventListener("change",o),()=>{typeof i.removeListener=="function"?i.removeListener(o):i.removeEventListener("change",o)}},preventTransition(){const r=document.createElement("style");return r.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(r),()=>{window.getComputedStyle(document.body),requestAnimationFrame(()=>{requestAnimationFrame(()=>{document.head.removeChild(r)})})}}};return n}var NX="chakra-ui-color-mode";function BX(e){return{ssr:!1,type:"localStorage",get(t){if(!(globalThis!=null&&globalThis.document))return t;let n;try{n=localStorage.getItem(e)||t}catch(r){}return n||t},set(t){try{localStorage.setItem(e,t)}catch(n){}}}}var FX=BX(NX),$P=()=>{};function DP(e,t){return e.type==="cookie"&&e.ssr?e.get(t):t}function OD(e){const{value:t,children:n,options:{useSystemColorMode:r,initialColorMode:i,disableTransitionOnChange:o}={},colorModeManager:a=FX}=e,s=i==="dark"?"dark":"light",[l,u]=S.useState(()=>DP(a,s)),[c,f]=S.useState(()=>DP(a)),{getSystemTheme:p,setClassName:m,setDataset:g,addListener:v}=S.useMemo(()=>DX({preventTransition:o}),[o]),x=i==="system"&&!l?c:l,C=S.useCallback(P=>{const L=P==="system"?p():P;u(L),m(L==="dark"),g(L),a.set(L)},[a,p,m,g]);ea(()=>{i==="system"&&f(p())},[]),S.useEffect(()=>{const P=a.get();if(P){C(P);return}if(i==="system"){C("system");return}C(s)},[a,s,i,C]);const w=S.useCallback(()=>{C(x==="dark"?"light":"dark")},[x,C]);S.useEffect(()=>{if(r)return v(C)},[r,v,C]);const k=S.useMemo(()=>({colorMode:t!=null?t:x,toggleColorMode:t?$P:w,setColorMode:t?$P:C,forced:t!==void 0}),[x,w,C,t]);return M.createElement(N7.Provider,{value:k},n)}OD.displayName="ColorModeProvider";var K2={},zX={get exports(){return K2},set exports(e){K2=e}};(function(e,t){var n=200,r="__lodash_hash_undefined__",i=800,o=16,a=9007199254740991,s="[object Arguments]",l="[object Array]",u="[object AsyncFunction]",c="[object Boolean]",f="[object Date]",p="[object Error]",m="[object Function]",g="[object GeneratorFunction]",v="[object Map]",x="[object Number]",C="[object Null]",w="[object Object]",k="[object Proxy]",P="[object RegExp]",L="[object Set]",A="[object String]",O="[object Undefined]",I="[object WeakMap]",$="[object ArrayBuffer]",D="[object DataView]",V="[object Float32Array]",Y="[object Float64Array]",z="[object Int8Array]",R="[object Int16Array]",N="[object Int32Array]",U="[object Uint8Array]",G="[object Uint8ClampedArray]",B="[object Uint16Array]",W="[object Uint32Array]",X=/[\\^$.*+?()[\]{}|]/g,re=/^\[object .+?Constructor\]$/,le=/^(?:0|[1-9]\d*)$/,he={};he[V]=he[Y]=he[z]=he[R]=he[N]=he[U]=he[G]=he[B]=he[W]=!0,he[s]=he[l]=he[$]=he[c]=he[D]=he[f]=he[p]=he[m]=he[v]=he[x]=he[w]=he[P]=he[L]=he[A]=he[I]=!1;var se=typeof Pi=="object"&&Pi&&Pi.Object===Object&&Pi,Ae=typeof self=="object"&&self&&self.Object===Object&&self,be=se||Ae||Function("return this")(),De=t&&!t.nodeType&&t,fe=De&&!0&&e&&!e.nodeType&&e,Xe=fe&&fe.exports===De,rt=Xe&&se.process,Ze=function(){try{var H=fe&&fe.require&&fe.require("util").types;return H||rt&&rt.binding&&rt.binding("util")}catch(q){}}(),et=Ze&&Ze.isTypedArray;function nt(H,q,ie){switch(ie.length){case 0:return H.call(q);case 1:return H.call(q,ie[0]);case 2:return H.call(q,ie[0],ie[1]);case 3:return H.call(q,ie[0],ie[1],ie[2])}return H.apply(q,ie)}function ve(H,q){for(var ie=-1,Ne=Array(H);++ie-1}function N4(H,q){var ie=this.__data__,Ne=md(ie,H);return Ne<0?(++this.size,ie.push([H,q])):ie[Ne][1]=q,this}Io.prototype.clear=$4,Io.prototype.delete=D4,Io.prototype.get=K1,Io.prototype.has=rp,Io.prototype.set=N4;function rl(H){var q=-1,ie=H==null?0:H.length;for(this.clear();++q1?ie[St-1]:void 0,_t=St>2?ie[2]:void 0;for(qt=H.length>3&&typeof qt=="function"?(St--,qt):void 0,_t&&X4(ie[0],ie[1],_t)&&(qt=St<3?void 0:qt,St=1),q=Object(q);++Ne-1&&H%1==0&&H0){if(++q>=i)return arguments[0]}else q=0;return H.apply(void 0,arguments)}}function lp(H){if(H!=null){try{return Me.call(H)}catch(q){}try{return H+""}catch(q){}}return""}function va(H,q){return H===q||H!==H&&q!==q}var up=gd(function(){return arguments}())?gd:function(H){return Ln(H)&&$e.call(H,"callee")&&!Ee.call(H,"callee")},$u=Array.isArray;function Ct(H){return H!=null&&J1(H.length)&&!wd(H)}function Q1(H){return Ln(H)&&Ct(H)}var Sd=Nt||J4;function wd(H){if(!ms(H))return!1;var q=ol(H);return q==m||q==g||q==u||q==k}function J1(H){return typeof H=="number"&&H>-1&&H%1==0&&H<=a}function ms(H){var q=typeof H;return H!=null&&(q=="object"||q=="function")}function Ln(H){return H!=null&&typeof H=="object"}function cp(H){if(!Ln(H)||ol(H)!=w)return!1;var q=qe(H);if(q===null)return!0;var ie=$e.call(q,"constructor")&&q.constructor;return typeof ie=="function"&&ie instanceof ie&&Me.call(ie)==ot}var e0=et?Qe(et):op;function dp(H){return zr(H,t0(H))}function t0(H){return Ct(H)?K4(H,!0):al(H)}var Cd=vd(function(H,q,ie,Ne){Ro(H,q,ie,Ne)});function to(H){return function(){return H}}function n0(H){return H}function J4(){return!1}e.exports=Cd})(zX,K2);const za=K2;function ta(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}function uc(e,...t){return jX(e)?e(...t):e}var jX=e=>typeof e=="function",HX=e=>/!(important)?$/.test(e),NP=e=>typeof e=="string"?e.replace(/!(important)?$/,"").trim():e,p6=(e,t)=>n=>{const r=String(t),i=HX(r),o=NP(r),a=e?`${e}.${o}`:o;let s=ta(n.__cssMap)&&a in n.__cssMap?n.__cssMap[a].varRef:t;return s=NP(s),i?`${s} !important`:s};function ig(e){const{scale:t,transform:n,compose:r}=e;return(o,a)=>{var u;const s=p6(t,o)(a);let l=(u=n==null?void 0:n(s,a))!=null?u:s;return r&&(l=r(l,a)),l}}var j0=(...e)=>t=>e.reduce((n,r)=>r(n),t);function zo(e,t){return n=>{const r={property:n,scale:e};return r.transform=ig({scale:e,transform:t}),r}}var VX=({rtl:e,ltr:t})=>n=>n.direction==="rtl"?e:t;function UX(e){const{property:t,scale:n,transform:r}=e;return{scale:n,property:VX(t),transform:n?ig({scale:n,compose:r}):r}}var MD=["rotate(var(--chakra-rotate, 0))","scaleX(var(--chakra-scale-x, 1))","scaleY(var(--chakra-scale-y, 1))","skewX(var(--chakra-skew-x, 0))","skewY(var(--chakra-skew-y, 0))"];function WX(){return["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...MD].join(" ")}function GX(){return["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...MD].join(" ")}var KX={"--chakra-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-sepia":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-drop-shadow":"var(--chakra-empty,/*!*/ /*!*/)",filter:["var(--chakra-blur)","var(--chakra-brightness)","var(--chakra-contrast)","var(--chakra-grayscale)","var(--chakra-hue-rotate)","var(--chakra-invert)","var(--chakra-saturate)","var(--chakra-sepia)","var(--chakra-drop-shadow)"].join(" ")},YX={backdropFilter:["var(--chakra-backdrop-blur)","var(--chakra-backdrop-brightness)","var(--chakra-backdrop-contrast)","var(--chakra-backdrop-grayscale)","var(--chakra-backdrop-hue-rotate)","var(--chakra-backdrop-invert)","var(--chakra-backdrop-opacity)","var(--chakra-backdrop-saturate)","var(--chakra-backdrop-sepia)"].join(" "),"--chakra-backdrop-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-opacity":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-sepia":"var(--chakra-empty,/*!*/ /*!*/)"};function qX(e){return{"--chakra-ring-offset-shadow":"var(--chakra-ring-inset) 0 0 0 var(--chakra-ring-offset-width) var(--chakra-ring-offset-color)","--chakra-ring-shadow":"var(--chakra-ring-inset) 0 0 0 calc(var(--chakra-ring-width) + var(--chakra-ring-offset-width)) var(--chakra-ring-color)","--chakra-ring-width":e,boxShadow:["var(--chakra-ring-offset-shadow)","var(--chakra-ring-shadow)","var(--chakra-shadow, 0 0 #0000)"].join(", ")}}var XX={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},ID="& > :not(style) ~ :not(style)",ZX={[ID]:{marginInlineStart:"calc(var(--chakra-space-x) * calc(1 - var(--chakra-space-x-reverse)))",marginInlineEnd:"calc(var(--chakra-space-x) * var(--chakra-space-x-reverse))"}},QX={[ID]:{marginTop:"calc(var(--chakra-space-y) * calc(1 - var(--chakra-space-y-reverse)))",marginBottom:"calc(var(--chakra-space-y) * var(--chakra-space-y-reverse))"}},m6={"to-t":"to top","to-tr":"to top right","to-r":"to right","to-br":"to bottom right","to-b":"to bottom","to-bl":"to bottom left","to-l":"to left","to-tl":"to top left"},JX=new Set(Object.values(m6)),RD=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),eZ=e=>e.trim();function tZ(e,t){var f;var n;if(e==null||RD.has(e))return e;const r=new RegExp("(?^[a-z-A-Z]+)\\((?(.*))\\)","g"),{type:i,values:o}=(f=(n=r.exec(e))==null?void 0:n.groups)!=null?f:{};if(!i||!o)return e;const a=i.includes("-gradient")?i:`${i}-gradient`,[s,...l]=o.split(",").map(eZ).filter(Boolean);if((l==null?void 0:l.length)===0)return e;const u=s in m6?m6[s]:s;l.unshift(u);const c=l.map(p=>{if(JX.has(p))return p;const m=p.indexOf(" "),[g,v]=m!==-1?[p.substr(0,m),p.substr(m+1)]:[p],x=$D(v)?v:v&&v.split(" "),C=`colors.${g}`,w=C in t.__cssMap?t.__cssMap[C].varRef:g;return x?[w,...Array.isArray(x)?x:[x]].join(" "):w});return`${a}(${c.join(", ")})`}var $D=e=>typeof e=="string"&&e.includes("(")&&e.includes(")"),nZ=(e,t)=>tZ(e,t!=null?t:{});function rZ(e){return/^var\(--.+\)$/.test(e)}var iZ=e=>{const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}},_a=e=>t=>`${e}(${t})`,At={filter(e){return e!=="auto"?e:KX},backdropFilter(e){return e!=="auto"?e:YX},ring(e){return qX(At.px(e))},bgClip(e){return e==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:e}},transform(e){return e==="auto"?WX():e==="auto-gpu"?GX():e},vh(e){return e==="$100vh"?"var(--chakra-vh)":e},px(e){if(e==null)return e;const{unitless:t}=iZ(e);return t||typeof e=="number"?`${e}px`:e},fraction(e){return typeof e!="number"||e>1?e:`${e*100}%`},float(e,t){const n={left:"right",right:"left"};return t.direction==="rtl"?n[e]:e},degree(e){if(rZ(e)||e==null)return e;const t=typeof e=="string"&&!e.endsWith("deg");return typeof e=="number"||t?`${e}deg`:e},gradient:nZ,blur:_a("blur"),opacity:_a("opacity"),brightness:_a("brightness"),contrast:_a("contrast"),dropShadow:_a("drop-shadow"),grayscale:_a("grayscale"),hueRotate:_a("hue-rotate"),invert:_a("invert"),saturate:_a("saturate"),sepia:_a("sepia"),bgImage(e){return e==null||$D(e)||RD.has(e)?e:`url(${e})`},outline(e){const t=String(e)==="0"||String(e)==="none";return e!==null&&t?{outline:"2px solid transparent",outlineOffset:"2px"}:{outline:e}},flexDirection(e){var i;const{space:t,divide:n}=(i=XX[e])!=null?i:{},r={flexDirection:e};return t&&(r[t]=1),n&&(r[n]=1),r}},Z={borderWidths:zo("borderWidths"),borderStyles:zo("borderStyles"),colors:zo("colors"),borders:zo("borders"),radii:zo("radii",At.px),space:zo("space",j0(At.vh,At.px)),spaceT:zo("space",j0(At.vh,At.px)),degreeT(e){return{property:e,transform:At.degree}},prop(e,t,n){return{property:e,scale:t,...t&&{transform:ig({scale:t,transform:n})}}},propT(e,t){return{property:e,transform:t}},sizes:zo("sizes",j0(At.vh,At.px)),sizesT:zo("sizes",j0(At.vh,At.fraction)),shadows:zo("shadows"),logical:UX,blur:zo("blur",At.blur)},a2={background:Z.colors("background"),backgroundColor:Z.colors("backgroundColor"),backgroundImage:Z.propT("backgroundImage",At.bgImage),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:At.bgClip},bgSize:Z.prop("backgroundSize"),bgPosition:Z.prop("backgroundPosition"),bg:Z.colors("background"),bgColor:Z.colors("backgroundColor"),bgPos:Z.prop("backgroundPosition"),bgRepeat:Z.prop("backgroundRepeat"),bgAttachment:Z.prop("backgroundAttachment"),bgGradient:Z.propT("backgroundImage",At.gradient),bgClip:{transform:At.bgClip}};Object.assign(a2,{bgImage:a2.backgroundImage,bgImg:a2.backgroundImage});var Ft={border:Z.borders("border"),borderWidth:Z.borderWidths("borderWidth"),borderStyle:Z.borderStyles("borderStyle"),borderColor:Z.colors("borderColor"),borderRadius:Z.radii("borderRadius"),borderTop:Z.borders("borderTop"),borderBlockStart:Z.borders("borderBlockStart"),borderTopLeftRadius:Z.radii("borderTopLeftRadius"),borderStartStartRadius:Z.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:Z.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:Z.radii("borderTopRightRadius"),borderStartEndRadius:Z.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:Z.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:Z.borders("borderRight"),borderInlineEnd:Z.borders("borderInlineEnd"),borderBottom:Z.borders("borderBottom"),borderBlockEnd:Z.borders("borderBlockEnd"),borderBottomLeftRadius:Z.radii("borderBottomLeftRadius"),borderBottomRightRadius:Z.radii("borderBottomRightRadius"),borderLeft:Z.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:Z.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:Z.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:Z.borders(["borderLeft","borderRight"]),borderInline:Z.borders("borderInline"),borderY:Z.borders(["borderTop","borderBottom"]),borderBlock:Z.borders("borderBlock"),borderTopWidth:Z.borderWidths("borderTopWidth"),borderBlockStartWidth:Z.borderWidths("borderBlockStartWidth"),borderTopColor:Z.colors("borderTopColor"),borderBlockStartColor:Z.colors("borderBlockStartColor"),borderTopStyle:Z.borderStyles("borderTopStyle"),borderBlockStartStyle:Z.borderStyles("borderBlockStartStyle"),borderBottomWidth:Z.borderWidths("borderBottomWidth"),borderBlockEndWidth:Z.borderWidths("borderBlockEndWidth"),borderBottomColor:Z.colors("borderBottomColor"),borderBlockEndColor:Z.colors("borderBlockEndColor"),borderBottomStyle:Z.borderStyles("borderBottomStyle"),borderBlockEndStyle:Z.borderStyles("borderBlockEndStyle"),borderLeftWidth:Z.borderWidths("borderLeftWidth"),borderInlineStartWidth:Z.borderWidths("borderInlineStartWidth"),borderLeftColor:Z.colors("borderLeftColor"),borderInlineStartColor:Z.colors("borderInlineStartColor"),borderLeftStyle:Z.borderStyles("borderLeftStyle"),borderInlineStartStyle:Z.borderStyles("borderInlineStartStyle"),borderRightWidth:Z.borderWidths("borderRightWidth"),borderInlineEndWidth:Z.borderWidths("borderInlineEndWidth"),borderRightColor:Z.colors("borderRightColor"),borderInlineEndColor:Z.colors("borderInlineEndColor"),borderRightStyle:Z.borderStyles("borderRightStyle"),borderInlineEndStyle:Z.borderStyles("borderInlineEndStyle"),borderTopRadius:Z.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:Z.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:Z.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:Z.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(Ft,{rounded:Ft.borderRadius,roundedTop:Ft.borderTopRadius,roundedTopLeft:Ft.borderTopLeftRadius,roundedTopRight:Ft.borderTopRightRadius,roundedTopStart:Ft.borderStartStartRadius,roundedTopEnd:Ft.borderStartEndRadius,roundedBottom:Ft.borderBottomRadius,roundedBottomLeft:Ft.borderBottomLeftRadius,roundedBottomRight:Ft.borderBottomRightRadius,roundedBottomStart:Ft.borderEndStartRadius,roundedBottomEnd:Ft.borderEndEndRadius,roundedLeft:Ft.borderLeftRadius,roundedRight:Ft.borderRightRadius,roundedStart:Ft.borderInlineStartRadius,roundedEnd:Ft.borderInlineEndRadius,borderStart:Ft.borderInlineStart,borderEnd:Ft.borderInlineEnd,borderTopStartRadius:Ft.borderStartStartRadius,borderTopEndRadius:Ft.borderStartEndRadius,borderBottomStartRadius:Ft.borderEndStartRadius,borderBottomEndRadius:Ft.borderEndEndRadius,borderStartRadius:Ft.borderInlineStartRadius,borderEndRadius:Ft.borderInlineEndRadius,borderStartWidth:Ft.borderInlineStartWidth,borderEndWidth:Ft.borderInlineEndWidth,borderStartColor:Ft.borderInlineStartColor,borderEndColor:Ft.borderInlineEndColor,borderStartStyle:Ft.borderInlineStartStyle,borderEndStyle:Ft.borderInlineEndStyle});var oZ={color:Z.colors("color"),textColor:Z.colors("color"),fill:Z.colors("fill"),stroke:Z.colors("stroke")},g6={boxShadow:Z.shadows("boxShadow"),mixBlendMode:!0,blendMode:Z.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:Z.prop("backgroundBlendMode"),opacity:!0};Object.assign(g6,{shadow:g6.boxShadow});var aZ={filter:{transform:At.filter},blur:Z.blur("--chakra-blur"),brightness:Z.propT("--chakra-brightness",At.brightness),contrast:Z.propT("--chakra-contrast",At.contrast),hueRotate:Z.degreeT("--chakra-hue-rotate"),invert:Z.propT("--chakra-invert",At.invert),saturate:Z.propT("--chakra-saturate",At.saturate),dropShadow:Z.propT("--chakra-drop-shadow",At.dropShadow),backdropFilter:{transform:At.backdropFilter},backdropBlur:Z.blur("--chakra-backdrop-blur"),backdropBrightness:Z.propT("--chakra-backdrop-brightness",At.brightness),backdropContrast:Z.propT("--chakra-backdrop-contrast",At.contrast),backdropHueRotate:Z.degreeT("--chakra-backdrop-hue-rotate"),backdropInvert:Z.propT("--chakra-backdrop-invert",At.invert),backdropSaturate:Z.propT("--chakra-backdrop-saturate",At.saturate)},Y2={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:At.flexDirection},experimental_spaceX:{static:ZX,transform:ig({scale:"space",transform:e=>e!==null?{"--chakra-space-x":e}:null})},experimental_spaceY:{static:QX,transform:ig({scale:"space",transform:e=>e!=null?{"--chakra-space-y":e}:null})},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:Z.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:Z.space("gap"),rowGap:Z.space("rowGap"),columnGap:Z.space("columnGap")};Object.assign(Y2,{flexDir:Y2.flexDirection});var DD={gridGap:Z.space("gridGap"),gridColumnGap:Z.space("gridColumnGap"),gridRowGap:Z.space("gridRowGap"),gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridColumnStart:!0,gridColumnEnd:!0,gridRowStart:!0,gridRowEnd:!0,gridAutoRows:!0,gridTemplate:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0},sZ={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:At.outline},outlineOffset:!0,outlineColor:Z.colors("outlineColor")},ho={width:Z.sizesT("width"),inlineSize:Z.sizesT("inlineSize"),height:Z.sizes("height"),blockSize:Z.sizes("blockSize"),boxSize:Z.sizes(["width","height"]),minWidth:Z.sizes("minWidth"),minInlineSize:Z.sizes("minInlineSize"),minHeight:Z.sizes("minHeight"),minBlockSize:Z.sizes("minBlockSize"),maxWidth:Z.sizes("maxWidth"),maxInlineSize:Z.sizes("maxInlineSize"),maxHeight:Z.sizes("maxHeight"),maxBlockSize:Z.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:Z.propT("float",At.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(ho,{w:ho.width,h:ho.height,minW:ho.minWidth,maxW:ho.maxWidth,minH:ho.minHeight,maxH:ho.maxHeight,overscroll:ho.overscrollBehavior,overscrollX:ho.overscrollBehaviorX,overscrollY:ho.overscrollBehaviorY});var lZ={listStyleType:!0,listStylePosition:!0,listStylePos:Z.prop("listStylePosition"),listStyleImage:!0,listStyleImg:Z.prop("listStyleImage")};function uZ(e,t,n,r){const i=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,i,o,a)=>{if(typeof r>"u")return e(r,i,o);t.has(r)||t.set(r,new Map);const s=t.get(r);if(s.has(i))return s.get(i);const l=e(r,i,o,a);return s.set(i,l),l}},dZ=cZ(uZ),fZ={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},hZ={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},nS=(e,t,n)=>{const r={},i=dZ(e,t,{});for(const o in i)o in n&&n[o]!=null||(r[o]=i[o]);return r},pZ={srOnly:{transform(e){return e===!0?fZ:e==="focusable"?hZ:{}}},layerStyle:{processResult:!0,transform:(e,t,n)=>nS(t,`layerStyles.${e}`,n)},textStyle:{processResult:!0,transform:(e,t,n)=>nS(t,`textStyles.${e}`,n)},apply:{processResult:!0,transform:(e,t,n)=>nS(t,e,n)}},xm={position:!0,pos:Z.prop("position"),zIndex:Z.prop("zIndex","zIndices"),inset:Z.spaceT("inset"),insetX:Z.spaceT(["left","right"]),insetInline:Z.spaceT("insetInline"),insetY:Z.spaceT(["top","bottom"]),insetBlock:Z.spaceT("insetBlock"),top:Z.spaceT("top"),insetBlockStart:Z.spaceT("insetBlockStart"),bottom:Z.spaceT("bottom"),insetBlockEnd:Z.spaceT("insetBlockEnd"),left:Z.spaceT("left"),insetInlineStart:Z.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:Z.spaceT("right"),insetInlineEnd:Z.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign(xm,{insetStart:xm.insetInlineStart,insetEnd:xm.insetInlineEnd});var mZ={ring:{transform:At.ring},ringColor:Z.colors("--chakra-ring-color"),ringOffset:Z.prop("--chakra-ring-offset-width"),ringOffsetColor:Z.colors("--chakra-ring-offset-color"),ringInset:Z.prop("--chakra-ring-inset")},Sn={margin:Z.spaceT("margin"),marginTop:Z.spaceT("marginTop"),marginBlockStart:Z.spaceT("marginBlockStart"),marginRight:Z.spaceT("marginRight"),marginInlineEnd:Z.spaceT("marginInlineEnd"),marginBottom:Z.spaceT("marginBottom"),marginBlockEnd:Z.spaceT("marginBlockEnd"),marginLeft:Z.spaceT("marginLeft"),marginInlineStart:Z.spaceT("marginInlineStart"),marginX:Z.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:Z.spaceT("marginInline"),marginY:Z.spaceT(["marginTop","marginBottom"]),marginBlock:Z.spaceT("marginBlock"),padding:Z.space("padding"),paddingTop:Z.space("paddingTop"),paddingBlockStart:Z.space("paddingBlockStart"),paddingRight:Z.space("paddingRight"),paddingBottom:Z.space("paddingBottom"),paddingBlockEnd:Z.space("paddingBlockEnd"),paddingLeft:Z.space("paddingLeft"),paddingInlineStart:Z.space("paddingInlineStart"),paddingInlineEnd:Z.space("paddingInlineEnd"),paddingX:Z.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:Z.space("paddingInline"),paddingY:Z.space(["paddingTop","paddingBottom"]),paddingBlock:Z.space("paddingBlock")};Object.assign(Sn,{m:Sn.margin,mt:Sn.marginTop,mr:Sn.marginRight,me:Sn.marginInlineEnd,marginEnd:Sn.marginInlineEnd,mb:Sn.marginBottom,ml:Sn.marginLeft,ms:Sn.marginInlineStart,marginStart:Sn.marginInlineStart,mx:Sn.marginX,my:Sn.marginY,p:Sn.padding,pt:Sn.paddingTop,py:Sn.paddingY,px:Sn.paddingX,pb:Sn.paddingBottom,pl:Sn.paddingLeft,ps:Sn.paddingInlineStart,paddingStart:Sn.paddingInlineStart,pr:Sn.paddingRight,pe:Sn.paddingInlineEnd,paddingEnd:Sn.paddingInlineEnd});var gZ={textDecorationColor:Z.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:Z.shadows("textShadow")},vZ={clipPath:!0,transform:Z.propT("transform",At.transform),transformOrigin:!0,translateX:Z.spaceT("--chakra-translate-x"),translateY:Z.spaceT("--chakra-translate-y"),skewX:Z.degreeT("--chakra-skew-x"),skewY:Z.degreeT("--chakra-skew-y"),scaleX:Z.prop("--chakra-scale-x"),scaleY:Z.prop("--chakra-scale-y"),scale:Z.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:Z.degreeT("--chakra-rotate")},yZ={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:Z.prop("transitionDuration","transition.duration"),transitionProperty:Z.prop("transitionProperty","transition.property"),transitionTimingFunction:Z.prop("transitionTimingFunction","transition.easing")},bZ={fontFamily:Z.prop("fontFamily","fonts"),fontSize:Z.prop("fontSize","fontSizes",At.px),fontWeight:Z.prop("fontWeight","fontWeights"),lineHeight:Z.prop("lineHeight","lineHeights"),letterSpacing:Z.prop("letterSpacing","letterSpacings"),textAlign:!0,fontStyle:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,noOfLines:{static:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"var(--chakra-line-clamp)"},property:"--chakra-line-clamp"}},SZ={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:Z.spaceT("scrollMargin"),scrollMarginTop:Z.spaceT("scrollMarginTop"),scrollMarginBottom:Z.spaceT("scrollMarginBottom"),scrollMarginLeft:Z.spaceT("scrollMarginLeft"),scrollMarginRight:Z.spaceT("scrollMarginRight"),scrollMarginX:Z.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:Z.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:Z.spaceT("scrollPadding"),scrollPaddingTop:Z.spaceT("scrollPaddingTop"),scrollPaddingBottom:Z.spaceT("scrollPaddingBottom"),scrollPaddingLeft:Z.spaceT("scrollPaddingLeft"),scrollPaddingRight:Z.spaceT("scrollPaddingRight"),scrollPaddingX:Z.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:Z.spaceT(["scrollPaddingTop","scrollPaddingBottom"])};function ND(e){return ta(e)&&e.reference?e.reference:String(e)}var _b=(e,...t)=>t.map(ND).join(` ${e} `).replace(/calc/g,""),BP=(...e)=>`calc(${_b("+",...e)})`,FP=(...e)=>`calc(${_b("-",...e)})`,v6=(...e)=>`calc(${_b("*",...e)})`,zP=(...e)=>`calc(${_b("/",...e)})`,jP=e=>{const t=ND(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:v6(t,-1)},ac=Object.assign(e=>({add:(...t)=>ac(BP(e,...t)),subtract:(...t)=>ac(FP(e,...t)),multiply:(...t)=>ac(v6(e,...t)),divide:(...t)=>ac(zP(e,...t)),negate:()=>ac(jP(e)),toString:()=>e.toString()}),{add:BP,subtract:FP,multiply:v6,divide:zP,negate:jP});function wZ(e,t="-"){return e.replace(/\s+/g,t)}function CZ(e){const t=wZ(e.toString());return _Z(xZ(t))}function xZ(e){return e.includes("\\.")?e:!Number.isInteger(parseFloat(e.toString()))?e.replace(".","\\."):e}function _Z(e){return e.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}function kZ(e,t=""){return[t,e].filter(Boolean).join("-")}function EZ(e,t){return`var(${e}${t?`, ${t}`:""})`}function PZ(e,t=""){return CZ(`--${kZ(e,t)}`)}function rn(e,t,n){const r=PZ(e,n);return{variable:r,reference:EZ(r,t)}}function TZ(e){const t=e==null?0:e.length;return t?e[t-1]:void 0}function LZ(e){const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}}function y6(e){if(e==null)return e;const{unitless:t}=LZ(e);return t||typeof e=="number"?`${e}px`:e}var BD=(e,t)=>parseInt(e[1],10)>parseInt(t[1],10)?1:-1,B7=e=>Object.fromEntries(Object.entries(e).sort(BD));function HP(e){const t=B7(e);return Object.assign(Object.values(t),t)}function AZ(e){const t=Object.keys(B7(e));return new Set(t)}function VP(e){var n;if(!e)return e;e=(n=y6(e))!=null?n:e;const t=e.endsWith("px")?-1:-.0625;return typeof e=="number"?`${e+t}`:e.replace(/(\d+\.?\d*)/u,r=>`${parseFloat(r)+t}`)}function om(e,t){const n=["@media screen"];return e&&n.push("and",`(min-width: ${y6(e)})`),t&&n.push("and",`(max-width: ${y6(t)})`),n.join(" ")}function OZ(e){var o;if(!e)return null;e.base=(o=e.base)!=null?o:"0px";const t=HP(e),n=Object.entries(e).sort(BD).map(([a,s],l,u)=>{var f;let[,c]=(f=u[l+1])!=null?f:[];return c=parseFloat(c)>0?VP(c):void 0,{_minW:VP(s),breakpoint:a,minW:s,maxW:c,maxWQuery:om(null,c),minWQuery:om(s),minMaxQuery:om(s,c)}}),r=AZ(e),i=Array.from(r.values());return{keys:r,normalized:t,isResponsive(a){const s=Object.keys(a);return s.length>0&&s.every(l=>r.has(l))},asObject:B7(e),asArray:HP(e),details:n,media:[null,...t.map(a=>om(a)).slice(1)],toArrayValue(a){if(!ta(a))throw new Error("toArrayValue: value must be an object");const s=i.map(l=>{var u;return(u=a[l])!=null?u:null});for(;TZ(s)===null;)s.pop();return s},toObjectValue(a){if(!Array.isArray(a))throw new Error("toObjectValue: value must be an array");return a.reduce((s,l,u)=>{const c=i[u];return c!=null&&l!=null&&(s[c]=l),s},{})}}}var Ar={hover:(e,t)=>`${e}:hover ${t}, ${e}[data-hover] ${t}`,focus:(e,t)=>`${e}:focus ${t}, ${e}[data-focus] ${t}`,focusVisible:(e,t)=>`${e}:focus-visible ${t}`,focusWithin:(e,t)=>`${e}:focus-within ${t}`,active:(e,t)=>`${e}:active ${t}, ${e}[data-active] ${t}`,disabled:(e,t)=>`${e}:disabled ${t}, ${e}[data-disabled] ${t}`,invalid:(e,t)=>`${e}:invalid ${t}, ${e}[data-invalid] ${t}`,checked:(e,t)=>`${e}:checked ${t}, ${e}[data-checked] ${t}`,indeterminate:(e,t)=>`${e}:indeterminate ${t}, ${e}[aria-checked=mixed] ${t}, ${e}[data-indeterminate] ${t}`,readOnly:(e,t)=>`${e}:read-only ${t}, ${e}[readonly] ${t}, ${e}[data-read-only] ${t}`,expanded:(e,t)=>`${e}:read-only ${t}, ${e}[aria-expanded=true] ${t}, ${e}[data-expanded] ${t}`,placeholderShown:(e,t)=>`${e}:placeholder-shown ${t}`},vl=e=>FD(t=>e(t,"&"),"[role=group]","[data-group]",".group"),ws=e=>FD(t=>e(t,"~ &"),"[data-peer]",".peer"),FD=(e,...t)=>t.map(e).join(", "),kb={_hover:"&:hover, &[data-hover]",_active:"&:active, &[data-active]",_focus:"&:focus, &[data-focus]",_highlighted:"&[data-highlighted]",_focusWithin:"&:focus-within",_focusVisible:"&:focus-visible, &[data-focus-visible]",_disabled:"&:disabled, &[disabled], &[aria-disabled=true], &[data-disabled]",_readOnly:"&[aria-readonly=true], &[readonly], &[data-readonly]",_before:"&::before",_after:"&::after",_empty:"&:empty",_expanded:"&[aria-expanded=true], &[data-expanded]",_checked:"&[aria-checked=true], &[data-checked]",_grabbed:"&[aria-grabbed=true], &[data-grabbed]",_pressed:"&[aria-pressed=true], &[data-pressed]",_invalid:"&[aria-invalid=true], &[data-invalid]",_valid:"&[data-valid], &[data-state=valid]",_loading:"&[data-loading], &[aria-busy=true]",_selected:"&[aria-selected=true], &[data-selected]",_hidden:"&[hidden], &[data-hidden]",_autofill:"&:-webkit-autofill",_even:"&:nth-of-type(even)",_odd:"&:nth-of-type(odd)",_first:"&:first-of-type",_last:"&:last-of-type",_notFirst:"&:not(:first-of-type)",_notLast:"&:not(:last-of-type)",_visited:"&:visited",_activeLink:"&[aria-current=page]",_activeStep:"&[aria-current=step]",_indeterminate:"&:indeterminate, &[aria-checked=mixed], &[data-indeterminate]",_groupHover:vl(Ar.hover),_peerHover:ws(Ar.hover),_groupFocus:vl(Ar.focus),_peerFocus:ws(Ar.focus),_groupFocusVisible:vl(Ar.focusVisible),_peerFocusVisible:ws(Ar.focusVisible),_groupActive:vl(Ar.active),_peerActive:ws(Ar.active),_groupDisabled:vl(Ar.disabled),_peerDisabled:ws(Ar.disabled),_groupInvalid:vl(Ar.invalid),_peerInvalid:ws(Ar.invalid),_groupChecked:vl(Ar.checked),_peerChecked:ws(Ar.checked),_groupFocusWithin:vl(Ar.focusWithin),_peerFocusWithin:ws(Ar.focusWithin),_peerPlaceholderShown:ws(Ar.placeholderShown),_placeholder:"&::placeholder",_placeholderShown:"&:placeholder-shown",_fullScreen:"&:fullscreen",_selection:"&::selection",_rtl:"[dir=rtl] &, &[dir=rtl]",_ltr:"[dir=ltr] &, &[dir=ltr]",_mediaDark:"@media (prefers-color-scheme: dark)",_mediaReduceMotion:"@media (prefers-reduced-motion: reduce)",_dark:".chakra-ui-dark &:not([data-theme]),[data-theme=dark] &:not([data-theme]),&[data-theme=dark]",_light:".chakra-ui-light &:not([data-theme]),[data-theme=light] &:not([data-theme]),&[data-theme=light]"},MZ=Object.keys(kb);function UP(e,t){return rn(String(e).replace(/\./g,"-"),void 0,t)}function IZ(e,t){let n={};const r={};for(const[i,o]of Object.entries(e)){const{isSemantic:a,value:s}=o,{variable:l,reference:u}=UP(i,t==null?void 0:t.cssVarPrefix);if(!a){if(i.startsWith("space")){const p=i.split("."),[m,...g]=p,v=`${m}.-${g.join(".")}`,x=ac.negate(s),C=ac.negate(u);r[v]={value:x,var:l,varRef:C}}n[l]=s,r[i]={value:s,var:l,varRef:u};continue}const c=p=>{const g=[String(i).split(".")[0],p].join(".");if(!e[g])return p;const{reference:x}=UP(g,t==null?void 0:t.cssVarPrefix);return x},f=ta(s)?s:{default:s};n=za(n,Object.entries(f).reduce((p,[m,g])=>{var w;var v;const x=c(g);if(m==="default")return p[l]=x,p;const C=(w=(v=kb)==null?void 0:v[m])!=null?w:m;return p[C]={[l]:x},p},{})),r[i]={value:u,var:l,varRef:u}}return{cssVars:n,cssMap:r}}function RZ(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function $Z(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var DZ=["colors","borders","borderWidths","borderStyles","fonts","fontSizes","fontWeights","letterSpacings","lineHeights","radii","space","shadows","sizes","zIndices","transition","blur"];function NZ(e){return $Z(e,DZ)}function BZ(e){return e.semanticTokens}function FZ(e){const{__cssMap:t,__cssVars:n,__breakpoints:r,...i}=e;return i}function zZ({tokens:e,semanticTokens:t}){var i,o;const n=Object.entries((i=b6(e))!=null?i:{}).map(([a,s])=>[a,{isSemantic:!1,value:s}]),r=Object.entries((o=b6(t,1))!=null?o:{}).map(([a,s])=>[a,{isSemantic:!0,value:s}]);return Object.fromEntries([...n,...r])}function b6(e,t=1/0){return!ta(e)&&!Array.isArray(e)||!t?e:Object.entries(e).reduce((n,[r,i])=>(ta(i)||Array.isArray(i)?Object.entries(b6(i,t-1)).forEach(([o,a])=>{n[`${r}.${o}`]=a}):n[r]=i,n),{})}function jZ(e){var t;const n=FZ(e),r=NZ(n),i=BZ(n),o=zZ({tokens:r,semanticTokens:i}),a=(t=n.config)==null?void 0:t.cssVarPrefix,{cssMap:s,cssVars:l}=IZ(o,{cssVarPrefix:a});return Object.assign(n,{__cssVars:{...{"--chakra-ring-inset":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-ring-offset-width":"0px","--chakra-ring-offset-color":"#fff","--chakra-ring-color":"rgba(66, 153, 225, 0.6)","--chakra-ring-offset-shadow":"0 0 #0000","--chakra-ring-shadow":"0 0 #0000","--chakra-space-x-reverse":"0","--chakra-space-y-reverse":"0"},...l},__cssMap:s,__breakpoints:OZ(n.breakpoints)}),n}var F7=za({},a2,Ft,oZ,Y2,ho,aZ,mZ,sZ,DD,pZ,xm,g6,Sn,SZ,bZ,gZ,vZ,lZ,yZ),HZ=Object.assign({},Sn,ho,Y2,DD,xm),VZ=Object.keys(HZ),UZ=[...Object.keys(F7),...MZ],WZ={...F7,...kb},GZ=e=>e in WZ,KZ=e=>t=>{if(!t.__breakpoints)return e;const{isResponsive:n,toArrayValue:r,media:i}=t.__breakpoints,o={};for(const a in e){let s=uc(e[a],t);if(s==null)continue;if(s=ta(s)&&n(s)?r(s):s,!Array.isArray(s)){o[a]=s;continue}const l=s.slice(0,i.length).length;for(let u=0;ue.startsWith("--")&&typeof t=="string"&&!qZ(t),ZZ=(e,t)=>{var a,s;if(t==null)return t;const n=l=>{var u,c;return(c=(u=e.__cssMap)==null?void 0:u[l])==null?void 0:c.varRef},r=l=>{var u;return(u=n(l))!=null?u:l},[i,o]=YZ(t);return t=(s=(a=n(i))!=null?a:r(o))!=null?s:r(t),t};function QZ(e){const{configs:t={},pseudos:n={},theme:r}=e,i=(o,a=!1)=>{var f,p;var s;const l=uc(o,r),u=KZ(l)(r);let c={};for(let m in u){const g=u[m];let v=uc(g,r);m in n&&(m=n[m]),XZ(m,v)&&(v=ZZ(r,v));let x=t[m];if(x===!0&&(x={property:m}),ta(v)){c[m]=(f=c[m])!=null?f:{},c[m]=za({},c[m],i(v,!0));continue}let C=(p=(s=x==null?void 0:x.transform)==null?void 0:s.call(x,v,r,l))!=null?p:v;C=x!=null&&x.processResult?i(C,!0):C;const w=uc(x==null?void 0:x.property,r);if(!a&&(x!=null&&x.static)){const k=uc(x.static,r);c=za({},c,k)}if(w&&Array.isArray(w)){for(const k of w)c[k]=C;continue}if(w){w==="&"&&ta(C)?c=za({},c,C):c[w]=C;continue}if(ta(C)){c=za({},c,C);continue}c[m]=C}return c};return i}var zD=e=>t=>QZ({theme:t,pseudos:kb,configs:F7})(e);function Tn(e){return{definePartsStyle(t){return t},defineMultiStyleConfig(t){return{parts:e,...t}}}}function JZ(e,t){if(Array.isArray(e))return e;if(ta(e))return t(e);if(e!=null)return[e]}function eQ(e,t){for(let n=t+1;n{za(u,{[k]:p?w[k]:{[C]:w[k]}})});continue}if(!m){p?za(u,w):u[C]=w;continue}u[C]=w}}return u}}function nQ(e){return t=>{var a;const{variant:n,size:r,theme:i}=t,o=tQ(i);return za({},uc((a=e.baseStyle)!=null?a:{},t),o(e,"sizes",r,t),o(e,"variants",n,t))}}function rQ(e,t,n){var o;var r,i;return(o=(i=(r=e.__cssMap)==null?void 0:r[`${t}.${n}`])==null?void 0:i.varRef)!=null?o:n}function Vt(e){return RZ(e,["styleConfig","size","variant","colorScheme"])}function iQ(e){if(e.sheet)return e.sheet;for(var t=0;t0?Rr(Th,--$i):0,th--,ir===10&&(th=1,Pb--),ir}function Ui(){return ir=$i2||ag(ir)>3?"":" "}function gQ(e,t){for(;--t&&Ui()&&!(ir<48||ir>102||ir>57&&ir<65||ir>70&&ir<97););return n1(e,s2()+(t<6&&Ua()==32&&Ui()==32))}function w6(e){for(;Ui();)switch(ir){case e:return $i;case 34:case 39:e!==34&&e!==39&&w6(ir);break;case 40:e===41&&w6(e);break;case 92:Ui();break}return $i}function vQ(e,t){for(;Ui()&&e+ir!==47+10;)if(e+ir===42+42&&Ua()===47)break;return"/*"+n1(t,$i-1)+"*"+Eb(e===47?e:Ui())}function yQ(e){for(;!ag(Ua());)Ui();return n1(e,$i)}function bQ(e){return GD(u2("",null,null,null,[""],e=WD(e),0,[0],e))}function u2(e,t,n,r,i,o,a,s,l){for(var u=0,c=0,f=a,p=0,m=0,g=0,v=1,x=1,C=1,w=0,k="",P=i,L=o,A=r,O=k;x;)switch(g=w,w=Ui()){case 40:if(g!=108&&Rr(O,f-1)==58){S6(O+=Wt(l2(w),"&","&\f"),"&\f")!=-1&&(C=-1);break}case 34:case 39:case 91:O+=l2(w);break;case 9:case 10:case 13:case 32:O+=mQ(g);break;case 92:O+=gQ(s2()-1,7);continue;case 47:switch(Ua()){case 42:case 47:H0(SQ(vQ(Ui(),s2()),t,n),l);break;default:O+="/"}break;case 123*v:s[u++]=Ra(O)*C;case 125*v:case 59:case 0:switch(w){case 0:case 125:x=0;case 59+c:m>0&&Ra(O)-f&&H0(m>32?GP(O+";",r,n,f-1):GP(Wt(O," ","")+";",r,n,f-2),l);break;case 59:O+=";";default:if(H0(A=WP(O,t,n,u,c,i,s,k,P=[],L=[],f),o),w===123)if(c===0)u2(O,t,A,A,P,o,f,s,L);else switch(p===99&&Rr(O,3)===110?100:p){case 100:case 109:case 115:u2(e,A,A,r&&H0(WP(e,A,A,0,0,i,s,k,i,P=[],f),L),i,L,f,s,r?P:L);break;default:u2(O,A,A,A,[""],L,0,s,L)}}u=c=m=0,v=C=1,k=O="",f=a;break;case 58:f=1+Ra(O),m=g;default:if(v<1){if(w==123)--v;else if(w==125&&v++==0&&pQ()==125)continue}switch(O+=Eb(w),w*v){case 38:C=c>0?1:(O+="\f",-1);break;case 44:s[u++]=(Ra(O)-1)*C,C=1;break;case 64:Ua()===45&&(O+=l2(Ui())),p=Ua(),c=f=Ra(k=O+=yQ(s2())),w++;break;case 45:g===45&&Ra(O)==2&&(v=0)}}return o}function WP(e,t,n,r,i,o,a,s,l,u,c){for(var f=i-1,p=i===0?o:[""],m=H7(p),g=0,v=0,x=0;g0?p[C]+" "+w:Wt(w,/&\f/g,p[C])))&&(l[x++]=k);return Tb(e,t,n,i===0?z7:s,l,u,c)}function SQ(e,t,n){return Tb(e,t,n,jD,Eb(hQ()),og(e,2,-2),0)}function GP(e,t,n,r){return Tb(e,t,n,j7,og(e,0,r),og(e,r+1,-1),r)}function Pf(e,t){for(var n="",r=H7(e),i=0;i6)switch(Rr(e,t+1)){case 109:if(Rr(e,t+4)!==45)break;case 102:return Wt(e,/(.+:)(.+)-([^]+)/,"$1"+zt+"$2-$3$1"+q2+(Rr(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~S6(e,"stretch")?YD(Wt(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Rr(e,t+1)!==115)break;case 6444:switch(Rr(e,Ra(e)-3-(~S6(e,"!important")&&10))){case 107:return Wt(e,":",":"+zt)+e;case 101:return Wt(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+zt+(Rr(e,14)===45?"inline-":"")+"box$3$1"+zt+"$2$3$1"+Yr+"$2box$3")+e}break;case 5936:switch(Rr(e,t+11)){case 114:return zt+e+Yr+Wt(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return zt+e+Yr+Wt(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return zt+e+Yr+Wt(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return zt+e+Yr+e+e}return e}var LQ=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case j7:t.return=YD(t.value,t.length);break;case HD:return Pf([Tp(t,{value:Wt(t.value,"@","@"+zt)})],i);case z7:if(t.length)return fQ(t.props,function(o){switch(dQ(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Pf([Tp(t,{props:[Wt(o,/:(read-\w+)/,":"+q2+"$1")]})],i);case"::placeholder":return Pf([Tp(t,{props:[Wt(o,/:(plac\w+)/,":"+zt+"input-$1")]}),Tp(t,{props:[Wt(o,/:(plac\w+)/,":"+q2+"$1")]}),Tp(t,{props:[Wt(o,/:(plac\w+)/,Yr+"input-$1")]})],i)}return""})}},AQ=[LQ],qD=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(v){var x=v.getAttribute("data-emotion");x.indexOf(" ")!==-1&&(document.head.appendChild(v),v.setAttribute("data-s",""))})}var i=t.stylisPlugins||AQ,o={},a,s=[];a=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(v){for(var x=v.getAttribute("data-emotion").split(" "),C=1;C=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var HQ={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},VQ=/[A-Z]|^ms/g,UQ=/_EMO_([^_]+?)_([^]*?)_EMO_/g,tN=function(t){return t.charCodeAt(1)===45},qP=function(t){return t!=null&&typeof t!="boolean"},rS=KD(function(e){return tN(e)?e:e.replace(VQ,"-$&").toLowerCase()}),XP=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(UQ,function(r,i,o){return $a={name:i,styles:o,next:$a},i})}return HQ[t]!==1&&!tN(t)&&typeof n=="number"&&n!==0?n+"px":n};function sg(e,t,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return $a={name:n.name,styles:n.styles,next:$a},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)$a={name:r.name,styles:r.styles,next:$a},r=r.next;var i=n.styles+";";return i}return WQ(e,t,n)}case"function":{if(e!==void 0){var o=$a,a=n(e);return $a=o,sg(e,t,a)}break}}if(t==null)return n;var s=t[n];return s!==void 0?s:n}function WQ(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i{t.includes(r)||(n[r]=e[r])}),n}function lJ(e,t,n,r){const i=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,i,o,a)=>{if(typeof r>"u")return e(r,i,o);t.has(r)||t.set(r,new Map);const s=t.get(r);if(s.has(i))return s.get(i);const l=e(r,i,o,a);return s.set(i,l),l}},lN=uJ(lJ);function uN(e,t){const n={};return Object.keys(e).forEach(r=>{const i=e[r];t(i,r,e)&&(n[r]=i)}),n}var cN=e=>uN(e,t=>t!=null);function cJ(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var dJ=cJ();function dN(e,...t){return aJ(e)?e(...t):e}function fJ(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function hJ(e={}){const{strict:t=!0,errorMessage:n="useContext: `context` is undefined. Seems you forgot to wrap component within the Provider",name:r}=e,i=S.createContext(void 0);i.displayName=r;function o(){var a;const s=S.useContext(i);if(!s&&t){const l=new Error(n);throw l.name="ContextError",(a=Error.captureStackTrace)==null||a.call(Error,l,o),l}return s}return[i.Provider,o,i]}var pJ=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,mJ=KD(function(e){return pJ.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),gJ=mJ,vJ=function(t){return t!=="theme"},eT=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?gJ:vJ},tT=function(t,n,r){var i;if(n){var o=n.shouldForwardProp;i=t.__emotion_forwardProp&&o?function(a){return t.__emotion_forwardProp(a)&&o(a)}:o}return typeof i!="function"&&r&&(i=t.__emotion_forwardProp),i},yJ=function(t){var n=t.cache,r=t.serialized,i=t.isStringTag;return JD(n,r,i),KQ(function(){return eN(n,r,i)}),null},bJ=function e(t,n){var r=t.__emotion_real===t,i=r&&t.__emotion_base||t,o,a;n!==void 0&&(o=n.label,a=n.target);var s=tT(t,n,r),l=s||eT(i),u=!l("as");return function(){var c=arguments,f=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(o!==void 0&&f.push("label:"+o+";"),c[0]==null||c[0].raw===void 0)f.push.apply(f,c);else{f.push(c[0][0]);for(var p=c.length,m=1;m[f,p.selector]))}function s(){return Object.fromEntries(Object.entries(t).map(([f,p])=>[f,p.className]))}function l(c){const m=`chakra-${(["container","root"].includes(c!=null?c:"")?[e]:[e,c]).filter(Boolean).join("__")}`;return{className:m,selector:`.${m}`,toString:()=>c}}return{parts:i,toPart:l,extend:o,selectors:a,classnames:s,get keys(){return Object.keys(t)},__type:{}}}var wJ=Gt("accordion").parts("root","container","button","panel").extend("icon"),CJ=Gt("alert").parts("title","description","container").extend("icon","spinner"),xJ=Gt("avatar").parts("label","badge","container").extend("excessLabel","group"),_J=Gt("breadcrumb").parts("link","item","container").extend("separator");Gt("button").parts();var kJ=Gt("checkbox").parts("control","icon","container").extend("label");Gt("progress").parts("track","filledTrack").extend("label");var EJ=Gt("drawer").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),PJ=Gt("editable").parts("preview","input","textarea"),TJ=Gt("form").parts("container","requiredIndicator","helperText"),LJ=Gt("formError").parts("text","icon"),AJ=Gt("input").parts("addon","field","element"),OJ=Gt("list").parts("container","item","icon"),MJ=Gt("menu").parts("button","list","item").extend("groupTitle","command","divider"),IJ=Gt("modal").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),RJ=Gt("numberinput").parts("root","field","stepperGroup","stepper");Gt("pininput").parts("field");var $J=Gt("popover").parts("content","header","body","footer").extend("popper","arrow","closeButton"),DJ=Gt("progress").parts("label","filledTrack","track"),NJ=Gt("radio").parts("container","control","label"),BJ=Gt("select").parts("field","icon"),FJ=Gt("slider").parts("container","track","thumb","filledTrack","mark"),zJ=Gt("stat").parts("container","label","helpText","number","icon"),jJ=Gt("switch").parts("container","track","thumb"),HJ=Gt("table").parts("table","thead","tbody","tr","th","td","tfoot","caption"),VJ=Gt("tabs").parts("root","tab","tablist","tabpanel","tabpanels","indicator"),UJ=Gt("tag").parts("container","label","closeButton"),WJ=Gt("card").parts("container","header","body","footer");function $r(e,t){GJ(e)&&(e="100%");var n=KJ(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/parseFloat(String(t)):e=e%t/parseFloat(String(t)),e)}function V0(e){return Math.min(1,Math.max(0,e))}function GJ(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function KJ(e){return typeof e=="string"&&e.indexOf("%")!==-1}function fN(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function U0(e){return e<=1?"".concat(Number(e)*100,"%"):e}function cc(e){return e.length===1?"0"+e:String(e)}function YJ(e,t,n){return{r:$r(e,255)*255,g:$r(t,255)*255,b:$r(n,255)*255}}function nT(e,t,n){e=$r(e,255),t=$r(t,255),n=$r(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),o=0,a=0,s=(r+i)/2;if(r===i)a=0,o=0;else{var l=r-i;switch(a=s>.5?l/(2-r-i):l/(r+i),r){case e:o=(t-n)/l+(t1&&(n-=1),n<1/6?e+(t-e)*(6*n):n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function qJ(e,t,n){var r,i,o;if(e=$r(e,360),t=$r(t,100),n=$r(n,100),t===0)i=n,o=n,r=n;else{var a=n<.5?n*(1+t):n+t-n*t,s=2*n-a;r=iS(s,a,e+1/3),i=iS(s,a,e),o=iS(s,a,e-1/3)}return{r:r*255,g:i*255,b:o*255}}function rT(e,t,n){e=$r(e,255),t=$r(t,255),n=$r(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),o=0,a=r,s=r-i,l=r===0?0:s/r;if(r===i)o=0;else{switch(r){case e:o=(t-n)/s+(t>16,g:(e&65280)>>8,b:e&255}}var E6={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function eee(e){var t={r:0,g:0,b:0},n=1,r=null,i=null,o=null,a=!1,s=!1;return typeof e=="string"&&(e=ree(e)),typeof e=="object"&&(Cs(e.r)&&Cs(e.g)&&Cs(e.b)?(t=YJ(e.r,e.g,e.b),a=!0,s=String(e.r).substr(-1)==="%"?"prgb":"rgb"):Cs(e.h)&&Cs(e.s)&&Cs(e.v)?(r=U0(e.s),i=U0(e.v),t=XJ(e.h,r,i),a=!0,s="hsv"):Cs(e.h)&&Cs(e.s)&&Cs(e.l)&&(r=U0(e.s),o=U0(e.l),t=qJ(e.h,r,o),a=!0,s="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=fN(n),{ok:a,format:e.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}var tee="[-\\+]?\\d+%?",nee="[-\\+]?\\d*\\.\\d+%?",Rl="(?:".concat(nee,")|(?:").concat(tee,")"),oS="[\\s|\\(]+(".concat(Rl,")[,|\\s]+(").concat(Rl,")[,|\\s]+(").concat(Rl,")\\s*\\)?"),aS="[\\s|\\(]+(".concat(Rl,")[,|\\s]+(").concat(Rl,")[,|\\s]+(").concat(Rl,")[,|\\s]+(").concat(Rl,")\\s*\\)?"),Wo={CSS_UNIT:new RegExp(Rl),rgb:new RegExp("rgb"+oS),rgba:new RegExp("rgba"+aS),hsl:new RegExp("hsl"+oS),hsla:new RegExp("hsla"+aS),hsv:new RegExp("hsv"+oS),hsva:new RegExp("hsva"+aS),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function ree(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(E6[e])e=E6[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n=Wo.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=Wo.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=Wo.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=Wo.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=Wo.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=Wo.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=Wo.hex8.exec(e),n?{r:zi(n[1]),g:zi(n[2]),b:zi(n[3]),a:oT(n[4]),format:t?"name":"hex8"}:(n=Wo.hex6.exec(e),n?{r:zi(n[1]),g:zi(n[2]),b:zi(n[3]),format:t?"name":"hex"}:(n=Wo.hex4.exec(e),n?{r:zi(n[1]+n[1]),g:zi(n[2]+n[2]),b:zi(n[3]+n[3]),a:oT(n[4]+n[4]),format:t?"name":"hex8"}:(n=Wo.hex3.exec(e),n?{r:zi(n[1]+n[1]),g:zi(n[2]+n[2]),b:zi(n[3]+n[3]),format:t?"name":"hex"}:!1)))))))))}function Cs(e){return Boolean(Wo.CSS_UNIT.exec(String(e)))}var r1=function(){function e(t,n){t===void 0&&(t=""),n===void 0&&(n={});var r;if(t instanceof e)return t;typeof t=="number"&&(t=JJ(t)),this.originalInput=t;var i=eee(t);this.originalInput=t,this.r=i.r,this.g=i.g,this.b=i.b,this.a=i.a,this.roundA=Math.round(100*this.a)/100,this.format=(r=n.format)!==null&&r!==void 0?r:i.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=i.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},e.prototype.getLuminance=function(){var t=this.toRgb(),n,r,i,o=t.r/255,a=t.g/255,s=t.b/255;return o<=.03928?n=o/12.92:n=Math.pow((o+.055)/1.055,2.4),a<=.03928?r=a/12.92:r=Math.pow((a+.055)/1.055,2.4),s<=.03928?i=s/12.92:i=Math.pow((s+.055)/1.055,2.4),.2126*n+.7152*r+.0722*i},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(t){return this.a=fN(t),this.roundA=Math.round(100*this.a)/100,this},e.prototype.toHsv=function(){var t=rT(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}},e.prototype.toHsvString=function(){var t=rT(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),i=Math.round(t.v*100);return this.a===1?"hsv(".concat(n,", ").concat(r,"%, ").concat(i,"%)"):"hsva(".concat(n,", ").concat(r,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var t=nT(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}},e.prototype.toHslString=function(){var t=nT(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),i=Math.round(t.l*100);return this.a===1?"hsl(".concat(n,", ").concat(r,"%, ").concat(i,"%)"):"hsla(".concat(n,", ").concat(r,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(t){return t===void 0&&(t=!1),iT(this.r,this.g,this.b,t)},e.prototype.toHexString=function(t){return t===void 0&&(t=!1),"#"+this.toHex(t)},e.prototype.toHex8=function(t){return t===void 0&&(t=!1),ZJ(this.r,this.g,this.b,this.a,t)},e.prototype.toHex8String=function(t){return t===void 0&&(t=!1),"#"+this.toHex8(t)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var t=Math.round(this.r),n=Math.round(this.g),r=Math.round(this.b);return this.a===1?"rgb(".concat(t,", ").concat(n,", ").concat(r,")"):"rgba(".concat(t,", ").concat(n,", ").concat(r,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var t=function(n){return"".concat(Math.round($r(n,255)*100),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var t=function(n){return Math.round($r(n,255)*100)};return this.a===1?"rgb(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%)"):"rgba(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var t="#"+iT(this.r,this.g,this.b,!1),n=0,r=Object.entries(E6);n=0,o=!n&&i&&(t.startsWith("hex")||t==="name");return o?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l+=t/100,n.l=V0(n.l),new e(n)},e.prototype.brighten=function(t){t===void 0&&(t=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),new e(n)},e.prototype.darken=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l-=t/100,n.l=V0(n.l),new e(n)},e.prototype.tint=function(t){return t===void 0&&(t=10),this.mix("white",t)},e.prototype.shade=function(t){return t===void 0&&(t=10),this.mix("black",t)},e.prototype.desaturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s-=t/100,n.s=V0(n.s),new e(n)},e.prototype.saturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s+=t/100,n.s=V0(n.s),new e(n)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var n=this.toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,new e(n)},e.prototype.mix=function(t,n){n===void 0&&(n=50);var r=this.toRgb(),i=new e(t).toRgb(),o=n/100,a={r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a};return new e(a)},e.prototype.analogous=function(t,n){t===void 0&&(t=6),n===void 0&&(n=30);var r=this.toHsl(),i=360/n,o=[this];for(r.h=(r.h-(i*t>>1)+720)%360;--t;)r.h=(r.h+i)%360,o.push(new e(r));return o},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){t===void 0&&(t=6);for(var n=this.toHsv(),r=n.h,i=n.s,o=n.v,a=[],s=1/t;t--;)a.push(new e({h:r,s:i,v:o})),o=(o+s)%1;return a},e.prototype.splitcomplement=function(){var t=this.toHsl(),n=t.h;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var n=this.toRgb(),r=new e(t).toRgb();return new e({r:r.r+(n.r-r.r)*n.a,g:r.g+(n.g-r.g)*n.a,b:r.b+(n.b-r.b)*n.a})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var n=this.toHsl(),r=n.h,i=[this],o=360/t,a=1;an.length;)e.count=null,e.seed&&(e.seed+=1),n.push(hN(e));return e.count=t,n}var r=iee(e.hue,e.seed),i=oee(r,e),o=aee(r,i,e),a={h:r,s:i,v:o};return e.alpha!==void 0&&(a.a=e.alpha),new r1(a)}function iee(e,t){var n=lee(e),r=X2(n,t);return r<0&&(r=360+r),r}function oee(e,t){if(t.hue==="monochrome")return 0;if(t.luminosity==="random")return X2([0,100],t.seed);var n=pN(e).saturationRange,r=n[0],i=n[1];switch(t.luminosity){case"bright":r=55;break;case"dark":r=i-10;break;case"light":i=55;break}return X2([r,i],t.seed)}function aee(e,t,n){var r=see(e,t),i=100;switch(n.luminosity){case"dark":i=r+20;break;case"light":r=(i+r)/2;break;case"random":r=0,i=100;break}return X2([r,i],n.seed)}function see(e,t){for(var n=pN(e).lowerBounds,r=0;r=i&&t<=a){var l=(s-o)/(a-i),u=o-l*i;return l*t+u}}return 0}function lee(e){var t=parseInt(e,10);if(!Number.isNaN(t)&&t<360&&t>0)return[t,t];if(typeof e=="string"){var n=gN.find(function(a){return a.name===e});if(n){var r=mN(n);if(r.hueRange)return r.hueRange}var i=new r1(e);if(i.isValid){var o=i.toHsv().h;return[o,o]}}return[0,360]}function pN(e){e>=334&&e<=360&&(e-=360);for(var t=0,n=gN;t=i.hueRange[0]&&e<=i.hueRange[1])return i}throw Error("Color not found")}function X2(e,t){if(t===void 0)return Math.floor(e[0]+Math.random()*(e[1]+1-e[0]));var n=e[1]||1,r=e[0]||0;t=(t*9301+49297)%233280;var i=t/233280;return Math.floor(r+i*(n-r))}function mN(e){var t=e.lowerBounds[0][0],n=e.lowerBounds[e.lowerBounds.length-1][0],r=e.lowerBounds[e.lowerBounds.length-1][1],i=e.lowerBounds[0][1];return{name:e.name,hueRange:e.hueRange,lowerBounds:e.lowerBounds,saturationRange:[t,n],brightnessRange:[r,i]}}var gN=[{name:"monochrome",hueRange:null,lowerBounds:[[0,0],[100,0]]},{name:"red",hueRange:[-26,18],lowerBounds:[[20,100],[30,92],[40,89],[50,85],[60,78],[70,70],[80,60],[90,55],[100,50]]},{name:"orange",hueRange:[19,46],lowerBounds:[[20,100],[30,93],[40,88],[50,86],[60,85],[70,70],[100,70]]},{name:"yellow",hueRange:[47,62],lowerBounds:[[25,100],[40,94],[50,89],[60,86],[70,84],[80,82],[90,80],[100,75]]},{name:"green",hueRange:[63,178],lowerBounds:[[30,100],[40,90],[50,85],[60,81],[70,74],[80,64],[90,50],[100,40]]},{name:"blue",hueRange:[179,257],lowerBounds:[[20,100],[30,86],[40,80],[50,74],[60,60],[70,52],[80,44],[90,39],[100,35]]},{name:"purple",hueRange:[258,282],lowerBounds:[[20,100],[30,87],[40,79],[50,70],[60,65],[70,59],[80,52],[90,45],[100,42]]},{name:"pink",hueRange:[283,334],lowerBounds:[[20,100],[30,90],[40,86],[60,84],[80,80],[90,75],[100,73]]}];function uee(e,t,n,r,i){for(t=t.split?t.split("."):t,r=0;rObject.keys(e).length===0,ui=(e,t,n)=>{const r=uee(e,`colors.${t}`,t),{isValid:i}=new r1(r);return i?r:n},dee=e=>t=>{const n=ui(t,e);return new r1(n).isDark()?"dark":"light"},fee=e=>t=>dee(e)(t)==="dark",nh=(e,t)=>n=>{const r=ui(n,e);return new r1(r).setAlpha(t).toRgbString()};function aT(e="1rem",t="rgba(255, 255, 255, 0.15)"){return{backgroundImage:`linear-gradient( - 45deg, - ${t} 25%, - transparent 25%, - transparent 50%, - ${t} 50%, - ${t} 75%, - transparent 75%, - transparent - )`,backgroundSize:`${e} ${e}`}}function hee(e){const t=hN().toHexString();return!e||cee(e)?t:e.string&&e.colors?mee(e.string,e.colors):e.string&&!e.colors?pee(e.string):e.colors&&!e.string?gee(e.colors):t}function pee(e){let t=0;if(e.length===0)return t.toString();for(let r=0;r>r*8&255;n+=`00${i.toString(16)}`.substr(-2)}return n}function mee(e,t){let n=0;if(e.length===0)return t[0];for(let r=0;rn.colorMode==="dark"?t:e}function Y7(e){const{orientation:t,vertical:n,horizontal:r}=e;return t?t==="vertical"?n:r:{}}function vee(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}function vN(e){return vee(e)&&e.reference?e.reference:String(e)}var jb=(e,...t)=>t.map(vN).join(` ${e} `).replace(/calc/g,""),sT=(...e)=>`calc(${jb("+",...e)})`,lT=(...e)=>`calc(${jb("-",...e)})`,P6=(...e)=>`calc(${jb("*",...e)})`,uT=(...e)=>`calc(${jb("/",...e)})`,cT=e=>{const t=vN(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:P6(t,-1)},Ts=Object.assign(e=>({add:(...t)=>Ts(sT(e,...t)),subtract:(...t)=>Ts(lT(e,...t)),multiply:(...t)=>Ts(P6(e,...t)),divide:(...t)=>Ts(uT(e,...t)),negate:()=>Ts(cT(e)),toString:()=>e.toString()}),{add:sT,subtract:lT,multiply:P6,divide:uT,negate:cT});function yee(e){return!Number.isInteger(parseFloat(e.toString()))}function bee(e,t="-"){return e.replace(/\s+/g,t)}function yN(e){const t=bee(e.toString());return t.includes("\\.")?e:yee(e)?t.replace(".","\\."):e}function See(e,t=""){return[t,yN(e)].filter(Boolean).join("-")}function wee(e,t){return`var(${yN(e)}${t?`, ${t}`:""})`}function Cee(e,t=""){return`--${See(e,t)}`}function pr(e,t){const n=Cee(e,t==null?void 0:t.prefix);return{variable:n,reference:wee(n,xee(t==null?void 0:t.fallback))}}function xee(e){return typeof e=="string"?e:e==null?void 0:e.reference}var{definePartsStyle:_ee,defineMultiStyleConfig:kee}=Tn(wJ.keys),Eee={borderTopWidth:"1px",borderColor:"inherit",_last:{borderBottomWidth:"1px"}},Pee={transitionProperty:"common",transitionDuration:"normal",fontSize:"md",_focusVisible:{boxShadow:"outline"},_hover:{bg:"blackAlpha.50"},_disabled:{opacity:.4,cursor:"not-allowed"},px:"4",py:"2"},Tee={pt:"2",px:"4",pb:"5"},Lee={fontSize:"1.25em"},Aee=_ee({container:Eee,button:Pee,panel:Tee,icon:Lee}),Oee=kee({baseStyle:Aee}),{definePartsStyle:i1,defineMultiStyleConfig:Mee}=Tn(CJ.keys),Wi=rn("alert-fg"),Ns=rn("alert-bg"),Iee=i1({container:{bg:Ns.reference,px:"4",py:"3"},title:{fontWeight:"bold",lineHeight:"6",marginEnd:"2"},description:{lineHeight:"6"},icon:{color:Wi.reference,flexShrink:0,marginEnd:"3",w:"5",h:"6"},spinner:{color:Wi.reference,flexShrink:0,marginEnd:"3",w:"5",h:"5"}});function q7(e){const{theme:t,colorScheme:n}=e,r=nh(`${n}.200`,.16)(t);return{light:`colors.${n}.100`,dark:r}}var Ree=i1(e=>{const{colorScheme:t}=e,n=q7(e);return{container:{[Wi.variable]:`colors.${t}.500`,[Ns.variable]:n.light,_dark:{[Wi.variable]:`colors.${t}.200`,[Ns.variable]:n.dark}}}}),$ee=i1(e=>{const{colorScheme:t}=e,n=q7(e);return{container:{[Wi.variable]:`colors.${t}.500`,[Ns.variable]:n.light,_dark:{[Wi.variable]:`colors.${t}.200`,[Ns.variable]:n.dark},paddingStart:"3",borderStartWidth:"4px",borderStartColor:Wi.reference}}}),Dee=i1(e=>{const{colorScheme:t}=e,n=q7(e);return{container:{[Wi.variable]:`colors.${t}.500`,[Ns.variable]:n.light,_dark:{[Wi.variable]:`colors.${t}.200`,[Ns.variable]:n.dark},pt:"2",borderTopWidth:"4px",borderTopColor:Wi.reference}}}),Nee=i1(e=>{const{colorScheme:t}=e;return{container:{[Wi.variable]:"colors.white",[Ns.variable]:`colors.${t}.500`,_dark:{[Wi.variable]:"colors.gray.900",[Ns.variable]:`colors.${t}.200`},color:Wi.reference}}}),Bee={subtle:Ree,"left-accent":$ee,"top-accent":Dee,solid:Nee},Fee=Mee({baseStyle:Iee,variants:Bee,defaultProps:{variant:"subtle",colorScheme:"blue"}}),bN={px:"1px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},zee={max:"max-content",min:"min-content",full:"100%","3xs":"14rem","2xs":"16rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem","8xl":"90rem",prose:"60ch"},jee={sm:"640px",md:"768px",lg:"1024px",xl:"1280px"},Hee={...bN,...zee,container:jee},SN=Hee,Vee=e=>typeof e=="function";function fi(e,...t){return Vee(e)?e(...t):e}var{definePartsStyle:wN,defineMultiStyleConfig:Uee}=Tn(xJ.keys),Tf=rn("avatar-border-color"),sS=rn("avatar-bg"),Wee={borderRadius:"full",border:"0.2em solid",[Tf.variable]:"white",_dark:{[Tf.variable]:"colors.gray.800"},borderColor:Tf.reference},Gee={[sS.variable]:"colors.gray.200",_dark:{[sS.variable]:"colors.whiteAlpha.400"},bgColor:sS.reference},dT=rn("avatar-background"),Kee=e=>{const{name:t,theme:n}=e,r=t?hee({string:t}):"colors.gray.400",i=fee(r)(n);let o="white";return i||(o="gray.800"),{bg:dT.reference,"&:not([data-loaded])":{[dT.variable]:r},color:o,[Tf.variable]:"colors.white",_dark:{[Tf.variable]:"colors.gray.800"},borderColor:Tf.reference,verticalAlign:"top"}},Yee=wN(e=>({badge:fi(Wee,e),excessLabel:fi(Gee,e),container:fi(Kee,e)}));function yl(e){const t=e!=="100%"?SN[e]:void 0;return wN({container:{width:e,height:e,fontSize:`calc(${t!=null?t:e} / 2.5)`},excessLabel:{width:e,height:e},label:{fontSize:`calc(${t!=null?t:e} / 2.5)`,lineHeight:e!=="100%"?t!=null?t:e:void 0}})}var qee={"2xs":yl(4),xs:yl(6),sm:yl(8),md:yl(12),lg:yl(16),xl:yl(24),"2xl":yl(32),full:yl("100%")},Xee=Uee({baseStyle:Yee,sizes:qee,defaultProps:{size:"md"}}),Zee={px:1,textTransform:"uppercase",fontSize:"xs",borderRadius:"sm",fontWeight:"bold"},Lf=rn("badge-bg"),ja=rn("badge-color"),Qee=e=>{const{colorScheme:t,theme:n}=e,r=nh(`${t}.500`,.6)(n);return{[Lf.variable]:`colors.${t}.500`,[ja.variable]:"colors.white",_dark:{[Lf.variable]:r,[ja.variable]:"colors.whiteAlpha.800"},bg:Lf.reference,color:ja.reference}},Jee=e=>{const{colorScheme:t,theme:n}=e,r=nh(`${t}.200`,.16)(n);return{[Lf.variable]:`colors.${t}.100`,[ja.variable]:`colors.${t}.800`,_dark:{[Lf.variable]:r,[ja.variable]:`colors.${t}.200`},bg:Lf.reference,color:ja.reference}},ete=e=>{const{colorScheme:t,theme:n}=e,r=nh(`${t}.200`,.8)(n);return{[ja.variable]:`colors.${t}.500`,_dark:{[ja.variable]:r},color:ja.reference,boxShadow:`inset 0 0 0px 1px ${ja.reference}`}},tte={solid:Qee,subtle:Jee,outline:ete},km={baseStyle:Zee,variants:tte,defaultProps:{variant:"subtle",colorScheme:"gray"}},{defineMultiStyleConfig:nte,definePartsStyle:rte}=Tn(_J.keys),ite={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},ote=rte({link:ite}),ate=nte({baseStyle:ote}),ste={lineHeight:"1.2",borderRadius:"md",fontWeight:"semibold",transitionProperty:"common",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{_disabled:{bg:"initial"}}},CN=e=>{const{colorScheme:t,theme:n}=e;if(t==="gray")return{color:it("inherit","whiteAlpha.900")(e),_hover:{bg:it("gray.100","whiteAlpha.200")(e)},_active:{bg:it("gray.200","whiteAlpha.300")(e)}};const r=nh(`${t}.200`,.12)(n),i=nh(`${t}.200`,.24)(n);return{color:it(`${t}.600`,`${t}.200`)(e),bg:"transparent",_hover:{bg:it(`${t}.50`,r)(e)},_active:{bg:it(`${t}.100`,i)(e)}}},lte=e=>{const{colorScheme:t}=e,n=it("gray.200","whiteAlpha.300")(e);return{border:"1px solid",borderColor:t==="gray"?n:"currentColor",".chakra-button__group[data-attached] > &:not(:last-of-type)":{marginEnd:"-1px"},...fi(CN,e)}},ute={yellow:{bg:"yellow.400",color:"black",hoverBg:"yellow.500",activeBg:"yellow.600"},cyan:{bg:"cyan.400",color:"black",hoverBg:"cyan.500",activeBg:"cyan.600"}},cte=e=>{var s;const{colorScheme:t}=e;if(t==="gray"){const l=it("gray.100","whiteAlpha.200")(e);return{bg:l,_hover:{bg:it("gray.200","whiteAlpha.300")(e),_disabled:{bg:l}},_active:{bg:it("gray.300","whiteAlpha.400")(e)}}}const{bg:n=`${t}.500`,color:r="white",hoverBg:i=`${t}.600`,activeBg:o=`${t}.700`}=(s=ute[t])!=null?s:{},a=it(n,`${t}.200`)(e);return{bg:a,color:it(r,"gray.800")(e),_hover:{bg:it(i,`${t}.300`)(e),_disabled:{bg:a}},_active:{bg:it(o,`${t}.400`)(e)}}},dte=e=>{const{colorScheme:t}=e;return{padding:0,height:"auto",lineHeight:"normal",verticalAlign:"baseline",color:it(`${t}.500`,`${t}.200`)(e),_hover:{textDecoration:"underline",_disabled:{textDecoration:"none"}},_active:{color:it(`${t}.700`,`${t}.500`)(e)}}},fte={bg:"none",color:"inherit",display:"inline",lineHeight:"inherit",m:"0",p:"0"},hte={ghost:CN,outline:lte,solid:cte,link:dte,unstyled:fte},pte={lg:{h:"12",minW:"12",fontSize:"lg",px:"6"},md:{h:"10",minW:"10",fontSize:"md",px:"4"},sm:{h:"8",minW:"8",fontSize:"sm",px:"3"},xs:{h:"6",minW:"6",fontSize:"xs",px:"2"}},mte={baseStyle:ste,variants:hte,sizes:pte,defaultProps:{variant:"solid",size:"md",colorScheme:"gray"}},{definePartsStyle:yc,defineMultiStyleConfig:gte}=Tn(WJ.keys),Z2=rn("card-bg"),Af=rn("card-padding"),vte=yc({container:{[Z2.variable]:"chakra-body-bg",backgroundColor:Z2.reference,color:"chakra-body-text"},body:{padding:Af.reference,flex:"1 1 0%"},header:{padding:Af.reference},footer:{padding:Af.reference}}),yte={sm:yc({container:{borderRadius:"base",[Af.variable]:"space.3"}}),md:yc({container:{borderRadius:"md",[Af.variable]:"space.5"}}),lg:yc({container:{borderRadius:"xl",[Af.variable]:"space.7"}})},bte={elevated:yc({container:{boxShadow:"base",_dark:{[Z2.variable]:"colors.gray.700"}}}),outline:yc({container:{borderWidth:"1px",borderColor:"chakra-border-color"}}),filled:yc({container:{[Z2.variable]:"colors.chakra-subtle-bg"}}),unstyled:{body:{padding:0},header:{padding:0},footer:{padding:0}}},Ste=gte({baseStyle:vte,variants:bte,sizes:yte,defaultProps:{variant:"elevated",size:"md"}}),{definePartsStyle:c2,defineMultiStyleConfig:wte}=Tn(kJ.keys),Em=rn("checkbox-size"),Cte=e=>{const{colorScheme:t}=e;return{w:Em.reference,h:Em.reference,transitionProperty:"box-shadow",transitionDuration:"normal",border:"2px solid",borderRadius:"sm",borderColor:"inherit",color:"white",_checked:{bg:it(`${t}.500`,`${t}.200`)(e),borderColor:it(`${t}.500`,`${t}.200`)(e),color:it("white","gray.900")(e),_hover:{bg:it(`${t}.600`,`${t}.300`)(e),borderColor:it(`${t}.600`,`${t}.300`)(e)},_disabled:{borderColor:it("gray.200","transparent")(e),bg:it("gray.200","whiteAlpha.300")(e),color:it("gray.500","whiteAlpha.500")(e)}},_indeterminate:{bg:it(`${t}.500`,`${t}.200`)(e),borderColor:it(`${t}.500`,`${t}.200`)(e),color:it("white","gray.900")(e)},_disabled:{bg:it("gray.100","whiteAlpha.100")(e),borderColor:it("gray.100","transparent")(e)},_focusVisible:{boxShadow:"outline"},_invalid:{borderColor:it("red.500","red.300")(e)}}},xte={_disabled:{cursor:"not-allowed"}},_te={userSelect:"none",_disabled:{opacity:.4}},kte={transitionProperty:"transform",transitionDuration:"normal"},Ete=c2(e=>({icon:kte,container:xte,control:fi(Cte,e),label:_te})),Pte={sm:c2({control:{[Em.variable]:"sizes.3"},label:{fontSize:"sm"},icon:{fontSize:"3xs"}}),md:c2({control:{[Em.variable]:"sizes.4"},label:{fontSize:"md"},icon:{fontSize:"2xs"}}),lg:c2({control:{[Em.variable]:"sizes.5"},label:{fontSize:"lg"},icon:{fontSize:"2xs"}})},Q2=wte({baseStyle:Ete,sizes:Pte,defaultProps:{size:"md",colorScheme:"blue"}}),Pm=pr("close-button-size"),Lp=pr("close-button-bg"),Tte={w:[Pm.reference],h:[Pm.reference],borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{[Lp.variable]:"colors.blackAlpha.100",_dark:{[Lp.variable]:"colors.whiteAlpha.100"}},_active:{[Lp.variable]:"colors.blackAlpha.200",_dark:{[Lp.variable]:"colors.whiteAlpha.200"}},_focusVisible:{boxShadow:"outline"},bg:Lp.reference},Lte={lg:{[Pm.variable]:"sizes.10",fontSize:"md"},md:{[Pm.variable]:"sizes.8",fontSize:"xs"},sm:{[Pm.variable]:"sizes.6",fontSize:"2xs"}},Ate={baseStyle:Tte,sizes:Lte,defaultProps:{size:"md"}},{variants:Ote,defaultProps:Mte}=km,Ite={fontFamily:"mono",fontSize:"sm",px:"0.2em",borderRadius:"sm"},Rte={baseStyle:Ite,variants:Ote,defaultProps:Mte},$te={w:"100%",mx:"auto",maxW:"prose",px:"4"},Dte={baseStyle:$te},Nte={opacity:.6,borderColor:"inherit"},Bte={borderStyle:"solid"},Fte={borderStyle:"dashed"},zte={solid:Bte,dashed:Fte},jte={baseStyle:Nte,variants:zte,defaultProps:{variant:"solid"}},{definePartsStyle:T6,defineMultiStyleConfig:Hte}=Tn(EJ.keys),lS=rn("drawer-bg"),uS=rn("drawer-box-shadow");function Id(e){return T6(e==="full"?{dialog:{maxW:"100vw",h:"100vh"}}:{dialog:{maxW:e}})}var Vte={bg:"blackAlpha.600",zIndex:"overlay"},Ute={display:"flex",zIndex:"modal",justifyContent:"center"},Wte=e=>{const{isFullHeight:t}=e;return{...t&&{height:"100vh"},zIndex:"modal",maxH:"100vh",color:"inherit",[lS.variable]:"colors.white",[uS.variable]:"shadows.lg",_dark:{[lS.variable]:"colors.gray.700",[uS.variable]:"shadows.dark-lg"},bg:lS.reference,boxShadow:uS.reference}},Gte={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},Kte={position:"absolute",top:"2",insetEnd:"3"},Yte={px:"6",py:"2",flex:"1",overflow:"auto"},qte={px:"6",py:"4"},Xte=T6(e=>({overlay:Vte,dialogContainer:Ute,dialog:fi(Wte,e),header:Gte,closeButton:Kte,body:Yte,footer:qte})),Zte={xs:Id("xs"),sm:Id("md"),md:Id("lg"),lg:Id("2xl"),xl:Id("4xl"),full:Id("full")},Qte=Hte({baseStyle:Xte,sizes:Zte,defaultProps:{size:"xs"}}),{definePartsStyle:Jte,defineMultiStyleConfig:ene}=Tn(PJ.keys),tne={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal"},nne={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},rne={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},ine=Jte({preview:tne,input:nne,textarea:rne}),one=ene({baseStyle:ine}),{definePartsStyle:ane,defineMultiStyleConfig:sne}=Tn(TJ.keys),Of=rn("form-control-color"),lne={marginStart:"1",[Of.variable]:"colors.red.500",_dark:{[Of.variable]:"colors.red.300"},color:Of.reference},une={mt:"2",[Of.variable]:"colors.gray.600",_dark:{[Of.variable]:"colors.whiteAlpha.600"},color:Of.reference,lineHeight:"normal",fontSize:"sm"},cne=ane({container:{width:"100%",position:"relative"},requiredIndicator:lne,helperText:une}),dne=sne({baseStyle:cne}),{definePartsStyle:fne,defineMultiStyleConfig:hne}=Tn(LJ.keys),Mf=rn("form-error-color"),pne={[Mf.variable]:"colors.red.500",_dark:{[Mf.variable]:"colors.red.300"},color:Mf.reference,mt:"2",fontSize:"sm",lineHeight:"normal"},mne={marginEnd:"0.5em",[Mf.variable]:"colors.red.500",_dark:{[Mf.variable]:"colors.red.300"},color:Mf.reference},gne=fne({text:pne,icon:mne}),vne=hne({baseStyle:gne}),yne={fontSize:"md",marginEnd:"3",mb:"2",fontWeight:"medium",transitionProperty:"common",transitionDuration:"normal",opacity:1,_disabled:{opacity:.4}},bne={baseStyle:yne},Sne={fontFamily:"heading",fontWeight:"bold"},wne={"4xl":{fontSize:["6xl",null,"7xl"],lineHeight:1},"3xl":{fontSize:["5xl",null,"6xl"],lineHeight:1},"2xl":{fontSize:["4xl",null,"5xl"],lineHeight:[1.2,null,1]},xl:{fontSize:["3xl",null,"4xl"],lineHeight:[1.33,null,1.2]},lg:{fontSize:["2xl",null,"3xl"],lineHeight:[1.33,null,1.2]},md:{fontSize:"xl",lineHeight:1.2},sm:{fontSize:"md",lineHeight:1.2},xs:{fontSize:"sm",lineHeight:1.2}},Cne={baseStyle:Sne,sizes:wne,defaultProps:{size:"xl"}},{definePartsStyle:Ls,defineMultiStyleConfig:xne}=Tn(AJ.keys),_ne=Ls({field:{width:"100%",minWidth:0,outline:0,position:"relative",appearance:"none",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed"}}}),bl={lg:{fontSize:"lg",px:"4",h:"12",borderRadius:"md"},md:{fontSize:"md",px:"4",h:"10",borderRadius:"md"},sm:{fontSize:"sm",px:"3",h:"8",borderRadius:"sm"},xs:{fontSize:"xs",px:"2",h:"6",borderRadius:"sm"}},kne={lg:Ls({field:bl.lg,addon:bl.lg}),md:Ls({field:bl.md,addon:bl.md}),sm:Ls({field:bl.sm,addon:bl.sm}),xs:Ls({field:bl.xs,addon:bl.xs})};function X7(e){const{focusBorderColor:t,errorBorderColor:n}=e;return{focusBorderColor:t||it("blue.500","blue.300")(e),errorBorderColor:n||it("red.500","red.300")(e)}}var Ene=Ls(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=X7(e);return{field:{border:"1px solid",borderColor:"inherit",bg:"inherit",_hover:{borderColor:it("gray.300","whiteAlpha.400")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:ui(t,r),boxShadow:`0 0 0 1px ${ui(t,r)}`},_focusVisible:{zIndex:1,borderColor:ui(t,n),boxShadow:`0 0 0 1px ${ui(t,n)}`}},addon:{border:"1px solid",borderColor:it("inherit","whiteAlpha.50")(e),bg:it("gray.100","whiteAlpha.300")(e)}}}),Pne=Ls(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=X7(e);return{field:{border:"2px solid",borderColor:"transparent",bg:it("gray.100","whiteAlpha.50")(e),_hover:{bg:it("gray.200","whiteAlpha.100")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:ui(t,r)},_focusVisible:{bg:"transparent",borderColor:ui(t,n)}},addon:{border:"2px solid",borderColor:"transparent",bg:it("gray.100","whiteAlpha.50")(e)}}}),Tne=Ls(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=X7(e);return{field:{borderBottom:"1px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent",_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:ui(t,r),boxShadow:`0px 1px 0px 0px ${ui(t,r)}`},_focusVisible:{borderColor:ui(t,n),boxShadow:`0px 1px 0px 0px ${ui(t,n)}`}},addon:{borderBottom:"2px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent"}}}),Lne=Ls({field:{bg:"transparent",px:"0",height:"auto"},addon:{bg:"transparent",px:"0",height:"auto"}}),Ane={outline:Ene,filled:Pne,flushed:Tne,unstyled:Lne},jt=xne({baseStyle:_ne,sizes:kne,variants:Ane,defaultProps:{size:"md",variant:"outline"}}),cS=rn("kbd-bg"),One={[cS.variable]:"colors.gray.100",_dark:{[cS.variable]:"colors.whiteAlpha.100"},bg:cS.reference,borderRadius:"md",borderWidth:"1px",borderBottomWidth:"3px",fontSize:"0.8em",fontWeight:"bold",lineHeight:"normal",px:"0.4em",whiteSpace:"nowrap"},Mne={baseStyle:One},Ine={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},Rne={baseStyle:Ine},{defineMultiStyleConfig:$ne,definePartsStyle:Dne}=Tn(OJ.keys),Nne={marginEnd:"2",display:"inline",verticalAlign:"text-bottom"},Bne=Dne({icon:Nne}),Fne=$ne({baseStyle:Bne}),{defineMultiStyleConfig:zne,definePartsStyle:jne}=Tn(MJ.keys),Ia=rn("menu-bg"),dS=rn("menu-shadow"),Hne={[Ia.variable]:"#fff",[dS.variable]:"shadows.sm",_dark:{[Ia.variable]:"colors.gray.700",[dS.variable]:"shadows.dark-lg"},color:"inherit",minW:"3xs",py:"2",zIndex:1,borderRadius:"md",borderWidth:"1px",bg:Ia.reference,boxShadow:dS.reference},Vne={py:"1.5",px:"3",transitionProperty:"background",transitionDuration:"ultra-fast",transitionTimingFunction:"ease-in",_focus:{[Ia.variable]:"colors.gray.100",_dark:{[Ia.variable]:"colors.whiteAlpha.100"}},_active:{[Ia.variable]:"colors.gray.200",_dark:{[Ia.variable]:"colors.whiteAlpha.200"}},_expanded:{[Ia.variable]:"colors.gray.100",_dark:{[Ia.variable]:"colors.whiteAlpha.100"}},_disabled:{opacity:.4,cursor:"not-allowed"},bg:Ia.reference},Une={mx:4,my:2,fontWeight:"semibold",fontSize:"sm"},Wne={opacity:.6},Gne={border:0,borderBottom:"1px solid",borderColor:"inherit",my:"2",opacity:.6},Kne={transitionProperty:"common",transitionDuration:"normal"},Yne=jne({button:Kne,list:Hne,item:Vne,groupTitle:Une,command:Wne,divider:Gne}),qne=zne({baseStyle:Yne}),{defineMultiStyleConfig:Xne,definePartsStyle:L6}=Tn(IJ.keys),Zne={bg:"blackAlpha.600",zIndex:"modal"},Qne=e=>{const{isCentered:t,scrollBehavior:n}=e;return{display:"flex",zIndex:"modal",justifyContent:"center",alignItems:t?"center":"flex-start",overflow:n==="inside"?"hidden":"auto"}},Jne=e=>{const{scrollBehavior:t}=e;return{borderRadius:"md",bg:it("white","gray.700")(e),color:"inherit",my:"16",zIndex:"modal",maxH:t==="inside"?"calc(100% - 7.5rem)":void 0,boxShadow:it("lg","dark-lg")(e)}},ere={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},tre={position:"absolute",top:"2",insetEnd:"3"},nre=e=>{const{scrollBehavior:t}=e;return{px:"6",py:"2",flex:"1",overflow:t==="inside"?"auto":void 0}},rre={px:"6",py:"4"},ire=L6(e=>({overlay:Zne,dialogContainer:fi(Qne,e),dialog:fi(Jne,e),header:ere,closeButton:tre,body:fi(nre,e),footer:rre}));function jo(e){return L6(e==="full"?{dialog:{maxW:"100vw",minH:"$100vh",my:"0",borderRadius:"0"}}:{dialog:{maxW:e}})}var ore={xs:jo("xs"),sm:jo("sm"),md:jo("md"),lg:jo("lg"),xl:jo("xl"),"2xl":jo("2xl"),"3xl":jo("3xl"),"4xl":jo("4xl"),"5xl":jo("5xl"),"6xl":jo("6xl"),full:jo("full")},are=Xne({baseStyle:ire,sizes:ore,defaultProps:{size:"md"}}),sre={letterSpacings:{tighter:"-0.05em",tight:"-0.025em",normal:"0",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeights:{normal:"normal",none:1,shorter:1.25,short:1.375,base:1.5,tall:1.625,taller:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},fontWeights:{hairline:100,thin:200,light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800,black:900},fonts:{heading:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',body:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',mono:'SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'},fontSizes:{"3xs":"0.45rem","2xs":"0.625rem",xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem","7xl":"4.5rem","8xl":"6rem","9xl":"8rem"}},xN=sre,{defineMultiStyleConfig:lre,definePartsStyle:_N}=Tn(RJ.keys),Z7=pr("number-input-stepper-width"),kN=pr("number-input-input-padding"),ure=Ts(Z7).add("0.5rem").toString(),fS=pr("number-input-bg"),hS=pr("number-input-color"),pS=pr("number-input-border-color"),cre={[Z7.variable]:"sizes.6",[kN.variable]:ure},dre=e=>{var n;var t;return(n=(t=fi(jt.baseStyle,e))==null?void 0:t.field)!=null?n:{}},fre={width:Z7.reference},hre={borderStart:"1px solid",borderStartColor:pS.reference,color:hS.reference,bg:fS.reference,[hS.variable]:"colors.chakra-body-text",[pS.variable]:"colors.chakra-border-color",_dark:{[hS.variable]:"colors.whiteAlpha.800",[pS.variable]:"colors.whiteAlpha.300"},_active:{[fS.variable]:"colors.gray.200",_dark:{[fS.variable]:"colors.whiteAlpha.300"}},_disabled:{opacity:.4,cursor:"not-allowed"}},pre=_N(e=>{var t;return{root:cre,field:(t=fi(dre,e))!=null?t:{},stepperGroup:fre,stepper:hre}});function W0(e){var s;var t,n;const r=(t=jt.sizes)==null?void 0:t[e],i={lg:"md",md:"md",sm:"sm",xs:"sm"},o=(s=(n=r.field)==null?void 0:n.fontSize)!=null?s:"md",a=xN.fontSizes[o];return _N({field:{...r.field,paddingInlineEnd:kN.reference,verticalAlign:"top"},stepper:{fontSize:Ts(a).multiply(.75).toString(),_first:{borderTopEndRadius:i[e]},_last:{borderBottomEndRadius:i[e],mt:"-1px",borderTopWidth:1}}})}var mre={xs:W0("xs"),sm:W0("sm"),md:W0("md"),lg:W0("lg")},gre=lre({baseStyle:pre,sizes:mre,variants:jt.variants,defaultProps:jt.defaultProps}),fT,vre={...(fT=jt.baseStyle)==null?void 0:fT.field,textAlign:"center"},yre={lg:{fontSize:"lg",w:12,h:12,borderRadius:"md"},md:{fontSize:"md",w:10,h:10,borderRadius:"md"},sm:{fontSize:"sm",w:8,h:8,borderRadius:"sm"},xs:{fontSize:"xs",w:6,h:6,borderRadius:"sm"}},hT,gD,bre={outline:e=>{var r;var t,n;return(r=(n=fi((t=jt.variants)==null?void 0:t.outline,e))==null?void 0:n.field)!=null?r:{}},flushed:e=>{var r;var t,n;return(r=(n=fi((t=jt.variants)==null?void 0:t.flushed,e))==null?void 0:n.field)!=null?r:{}},filled:e=>{var r;var t,n;return(r=(n=fi((t=jt.variants)==null?void 0:t.filled,e))==null?void 0:n.field)!=null?r:{}},unstyled:(gD=(hT=jt.variants)==null?void 0:hT.unstyled.field)!=null?gD:{}},Sre={baseStyle:vre,sizes:yre,variants:bre,defaultProps:jt.defaultProps},{defineMultiStyleConfig:wre,definePartsStyle:Cre}=Tn($J.keys),G0=pr("popper-bg"),xre=pr("popper-arrow-bg"),pT=pr("popper-arrow-shadow-color"),_re={zIndex:10},kre={[G0.variable]:"colors.white",bg:G0.reference,[xre.variable]:G0.reference,[pT.variable]:"colors.gray.200",_dark:{[G0.variable]:"colors.gray.700",[pT.variable]:"colors.whiteAlpha.300"},width:"xs",border:"1px solid",borderColor:"inherit",borderRadius:"md",boxShadow:"sm",zIndex:"inherit",_focusVisible:{outline:0,boxShadow:"outline"}},Ere={px:3,py:2,borderBottomWidth:"1px"},Pre={px:3,py:2},Tre={px:3,py:2,borderTopWidth:"1px"},Lre={position:"absolute",borderRadius:"md",top:1,insetEnd:2,padding:2},Are=Cre({popper:_re,content:kre,header:Ere,body:Pre,footer:Tre,closeButton:Lre}),Ore=wre({baseStyle:Are}),{defineMultiStyleConfig:Mre,definePartsStyle:am}=Tn(DJ.keys),Ire=e=>{const{colorScheme:t,theme:n,isIndeterminate:r,hasStripe:i}=e,o=it(aT(),aT("1rem","rgba(0,0,0,0.1)"))(e),a=it(`${t}.500`,`${t}.200`)(e),s=`linear-gradient( - to right, - transparent 0%, - ${ui(n,a)} 50%, - transparent 100% - )`;return{...!r&&i&&o,...r?{bgImage:s}:{bgColor:a}}},Rre={lineHeight:"1",fontSize:"0.25em",fontWeight:"bold",color:"white"},$re=e=>({bg:it("gray.100","whiteAlpha.300")(e)}),Dre=e=>({transitionProperty:"common",transitionDuration:"slow",...Ire(e)}),Nre=am(e=>({label:Rre,filledTrack:Dre(e),track:$re(e)})),Bre={xs:am({track:{h:"1"}}),sm:am({track:{h:"2"}}),md:am({track:{h:"3"}}),lg:am({track:{h:"4"}})},Fre=Mre({sizes:Bre,baseStyle:Nre,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:zre,definePartsStyle:d2}=Tn(NJ.keys),jre=e=>{var t;const n=(t=fi(Q2.baseStyle,e))==null?void 0:t.control;return{...n,borderRadius:"full",_checked:{...n==null?void 0:n._checked,_before:{content:'""',display:"inline-block",pos:"relative",w:"50%",h:"50%",borderRadius:"50%",bg:"currentColor"}}}},Hre=d2(e=>{var t,n,r,i;return{label:(n=(t=Q2).baseStyle)==null?void 0:n.call(t,e).label,container:(i=(r=Q2).baseStyle)==null?void 0:i.call(r,e).container,control:jre(e)}}),Vre={md:d2({control:{w:"4",h:"4"},label:{fontSize:"md"}}),lg:d2({control:{w:"5",h:"5"},label:{fontSize:"lg"}}),sm:d2({control:{width:"3",height:"3"},label:{fontSize:"sm"}})},Ure=zre({baseStyle:Hre,sizes:Vre,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:Wre,definePartsStyle:Gre}=Tn(BJ.keys),K0=rn("select-bg"),mT,Kre={...(mT=jt.baseStyle)==null?void 0:mT.field,appearance:"none",paddingBottom:"1px",lineHeight:"normal",bg:K0.reference,[K0.variable]:"colors.white",_dark:{[K0.variable]:"colors.gray.700"},"> option, > optgroup":{bg:K0.reference}},Yre={width:"6",height:"100%",insetEnd:"2",position:"relative",color:"currentColor",fontSize:"xl",_disabled:{opacity:.5}},qre=Gre({field:Kre,icon:Yre}),Y0={paddingInlineEnd:"8"},gT,vT,yT,bT,ST,wT,CT,xT,Xre={lg:{...(gT=jt.sizes)==null?void 0:gT.lg,field:{...(vT=jt.sizes)==null?void 0:vT.lg.field,...Y0}},md:{...(yT=jt.sizes)==null?void 0:yT.md,field:{...(bT=jt.sizes)==null?void 0:bT.md.field,...Y0}},sm:{...(ST=jt.sizes)==null?void 0:ST.sm,field:{...(wT=jt.sizes)==null?void 0:wT.sm.field,...Y0}},xs:{...(CT=jt.sizes)==null?void 0:CT.xs,field:{...(xT=jt.sizes)==null?void 0:xT.xs.field,...Y0},icon:{insetEnd:"1"}}},Zre=Wre({baseStyle:qre,sizes:Xre,variants:jt.variants,defaultProps:jt.defaultProps}),mS=rn("skeleton-start-color"),gS=rn("skeleton-end-color"),Qre={[mS.variable]:"colors.gray.100",[gS.variable]:"colors.gray.400",_dark:{[mS.variable]:"colors.gray.800",[gS.variable]:"colors.gray.600"},background:mS.reference,borderColor:gS.reference,opacity:.7,borderRadius:"sm"},Jre={baseStyle:Qre},vS=rn("skip-link-bg"),eie={borderRadius:"md",fontWeight:"semibold",_focusVisible:{boxShadow:"outline",padding:"4",position:"fixed",top:"6",insetStart:"6",[vS.variable]:"colors.white",_dark:{[vS.variable]:"colors.gray.700"},bg:vS.reference}},tie={baseStyle:eie},{defineMultiStyleConfig:nie,definePartsStyle:Hb}=Tn(FJ.keys),cg=rn("slider-thumb-size"),dg=rn("slider-track-size"),Al=rn("slider-bg"),rie=e=>{const{orientation:t}=e;return{display:"inline-block",position:"relative",cursor:"pointer",_disabled:{opacity:.6,cursor:"default",pointerEvents:"none"},...Y7({orientation:t,vertical:{h:"100%"},horizontal:{w:"100%"}})}},iie=e=>({...Y7({orientation:e.orientation,horizontal:{h:dg.reference},vertical:{w:dg.reference}}),overflow:"hidden",borderRadius:"sm",[Al.variable]:"colors.gray.200",_dark:{[Al.variable]:"colors.whiteAlpha.200"},_disabled:{[Al.variable]:"colors.gray.300",_dark:{[Al.variable]:"colors.whiteAlpha.300"}},bg:Al.reference}),oie=e=>{const{orientation:t}=e;return{...Y7({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",_active:{transform:"translateX(-50%) scale(1.15)"}},horizontal:{top:"50%",transform:"translateY(-50%)",_active:{transform:"translateY(-50%) scale(1.15)"}}}),w:cg.reference,h:cg.reference,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",outline:0,zIndex:1,borderRadius:"full",bg:"white",boxShadow:"base",border:"1px solid",borderColor:"transparent",transitionProperty:"transform",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{bg:"gray.300"}}},aie=e=>{const{colorScheme:t}=e;return{width:"inherit",height:"inherit",[Al.variable]:`colors.${t}.500`,_dark:{[Al.variable]:`colors.${t}.200`},bg:Al.reference}},sie=Hb(e=>({container:rie(e),track:iie(e),thumb:oie(e),filledTrack:aie(e)})),lie=Hb({container:{[cg.variable]:"sizes.4",[dg.variable]:"sizes.1"}}),uie=Hb({container:{[cg.variable]:"sizes.3.5",[dg.variable]:"sizes.1"}}),cie=Hb({container:{[cg.variable]:"sizes.2.5",[dg.variable]:"sizes.0.5"}}),die={lg:lie,md:uie,sm:cie},fie=nie({baseStyle:sie,sizes:die,defaultProps:{size:"md",colorScheme:"blue"}}),sc=pr("spinner-size"),hie={width:[sc.reference],height:[sc.reference]},pie={xs:{[sc.variable]:"sizes.3"},sm:{[sc.variable]:"sizes.4"},md:{[sc.variable]:"sizes.6"},lg:{[sc.variable]:"sizes.8"},xl:{[sc.variable]:"sizes.12"}},mie={baseStyle:hie,sizes:pie,defaultProps:{size:"md"}},{defineMultiStyleConfig:gie,definePartsStyle:EN}=Tn(zJ.keys),vie={fontWeight:"medium"},yie={opacity:.8,marginBottom:"2"},bie={verticalAlign:"baseline",fontWeight:"semibold"},Sie={marginEnd:1,w:"3.5",h:"3.5",verticalAlign:"middle"},wie=EN({container:{},label:vie,helpText:yie,number:bie,icon:Sie}),Cie={md:EN({label:{fontSize:"sm"},helpText:{fontSize:"sm"},number:{fontSize:"2xl"}})},xie=gie({baseStyle:wie,sizes:Cie,defaultProps:{size:"md"}}),{defineMultiStyleConfig:_ie,definePartsStyle:f2}=Tn(jJ.keys),Tm=pr("switch-track-width"),bc=pr("switch-track-height"),yS=pr("switch-track-diff"),kie=Ts.subtract(Tm,bc),A6=pr("switch-thumb-x"),Ap=pr("switch-bg"),Eie=e=>{const{colorScheme:t}=e;return{borderRadius:"full",p:"0.5",width:[Tm.reference],height:[bc.reference],transitionProperty:"common",transitionDuration:"fast",[Ap.variable]:"colors.gray.300",_dark:{[Ap.variable]:"colors.whiteAlpha.400"},_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed"},_checked:{[Ap.variable]:`colors.${t}.500`,_dark:{[Ap.variable]:`colors.${t}.200`}},bg:Ap.reference}},Pie={bg:"white",transitionProperty:"transform",transitionDuration:"normal",borderRadius:"inherit",width:[bc.reference],height:[bc.reference],_checked:{transform:`translateX(${A6.reference})`}},Tie=f2(e=>({container:{[yS.variable]:kie,[A6.variable]:yS.reference,_rtl:{[A6.variable]:Ts(yS).negate().toString()}},track:Eie(e),thumb:Pie})),Lie={sm:f2({container:{[Tm.variable]:"1.375rem",[bc.variable]:"sizes.3"}}),md:f2({container:{[Tm.variable]:"1.875rem",[bc.variable]:"sizes.4"}}),lg:f2({container:{[Tm.variable]:"2.875rem",[bc.variable]:"sizes.6"}})},Aie=_ie({baseStyle:Tie,sizes:Lie,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:Oie,definePartsStyle:If}=Tn(HJ.keys),Mie=If({table:{fontVariantNumeric:"lining-nums tabular-nums",borderCollapse:"collapse",width:"full"},th:{fontFamily:"heading",fontWeight:"bold",textTransform:"uppercase",letterSpacing:"wider",textAlign:"start"},td:{textAlign:"start"},caption:{mt:4,fontFamily:"heading",textAlign:"center",fontWeight:"medium"}}),J2={"&[data-is-numeric=true]":{textAlign:"end"}},Iie=If(e=>{const{colorScheme:t}=e;return{th:{color:it("gray.600","gray.400")(e),borderBottom:"1px",borderColor:it(`${t}.100`,`${t}.700`)(e),...J2},td:{borderBottom:"1px",borderColor:it(`${t}.100`,`${t}.700`)(e),...J2},caption:{color:it("gray.600","gray.100")(e)},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),Rie=If(e=>{const{colorScheme:t}=e;return{th:{color:it("gray.600","gray.400")(e),borderBottom:"1px",borderColor:it(`${t}.100`,`${t}.700`)(e),...J2},td:{borderBottom:"1px",borderColor:it(`${t}.100`,`${t}.700`)(e),...J2},caption:{color:it("gray.600","gray.100")(e)},tbody:{tr:{"&:nth-of-type(odd)":{"th, td":{borderBottomWidth:"1px",borderColor:it(`${t}.100`,`${t}.700`)(e)},td:{background:it(`${t}.100`,`${t}.700`)(e)}}}},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),$ie={simple:Iie,striped:Rie,unstyled:{}},Die={sm:If({th:{px:"4",py:"1",lineHeight:"4",fontSize:"xs"},td:{px:"4",py:"2",fontSize:"sm",lineHeight:"4"},caption:{px:"4",py:"2",fontSize:"xs"}}),md:If({th:{px:"6",py:"3",lineHeight:"4",fontSize:"xs"},td:{px:"6",py:"4",lineHeight:"5"},caption:{px:"6",py:"2",fontSize:"sm"}}),lg:If({th:{px:"8",py:"4",lineHeight:"5",fontSize:"sm"},td:{px:"8",py:"5",lineHeight:"6"},caption:{px:"6",py:"2",fontSize:"md"}})},Nie=Oie({baseStyle:Mie,variants:$ie,sizes:Die,defaultProps:{variant:"simple",size:"md",colorScheme:"gray"}}),Ei=rn("tabs-color"),Xo=rn("tabs-bg"),q0=rn("tabs-border-color"),{defineMultiStyleConfig:Bie,definePartsStyle:Wa}=Tn(VJ.keys),Fie=e=>{const{orientation:t}=e;return{display:t==="vertical"?"flex":"block"}},zie=e=>{const{isFitted:t}=e;return{flex:t?1:void 0,transitionProperty:"common",transitionDuration:"normal",_focusVisible:{zIndex:1,boxShadow:"outline"},_disabled:{cursor:"not-allowed",opacity:.4}}},jie=e=>{const{align:t="start",orientation:n}=e;return{justifyContent:{end:"flex-end",center:"center",start:"flex-start"}[t],flexDirection:n==="vertical"?"column":"row"}},Hie={p:4},Vie=Wa(e=>({root:Fie(e),tab:zie(e),tablist:jie(e),tabpanel:Hie})),Uie={sm:Wa({tab:{py:1,px:4,fontSize:"sm"}}),md:Wa({tab:{fontSize:"md",py:2,px:4}}),lg:Wa({tab:{fontSize:"lg",py:3,px:4}})},Wie=Wa(e=>{const{colorScheme:t,orientation:n}=e,r=n==="vertical",i=n==="vertical"?"borderStart":"borderBottom",o=r?"marginStart":"marginBottom";return{tablist:{[i]:"2px solid",borderColor:"inherit"},tab:{[i]:"2px solid",borderColor:"transparent",[o]:"-2px",_selected:{[Ei.variable]:`colors.${t}.600`,_dark:{[Ei.variable]:`colors.${t}.300`},borderColor:"currentColor"},_active:{[Xo.variable]:"colors.gray.200",_dark:{[Xo.variable]:"colors.whiteAlpha.300"}},_disabled:{_active:{bg:"none"}},color:Ei.reference,bg:Xo.reference}}}),Gie=Wa(e=>{const{colorScheme:t}=e;return{tab:{borderTopRadius:"md",border:"1px solid",borderColor:"transparent",mb:"-1px",[q0.reference]:"transparent",_selected:{[Ei.variable]:`colors.${t}.600`,[q0.variable]:"colors.white",_dark:{[Ei.variable]:`colors.${t}.300`,[q0.variable]:"colors.gray.800"},borderColor:"inherit",borderBottomColor:q0.reference},color:Ei.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),Kie=Wa(e=>{const{colorScheme:t}=e;return{tab:{border:"1px solid",borderColor:"inherit",[Xo.variable]:"colors.gray.50",_dark:{[Xo.variable]:"colors.whiteAlpha.50"},mb:"-1px",_notLast:{marginEnd:"-1px"},_selected:{[Xo.variable]:"colors.white",[Ei.variable]:`colors.${t}.600`,_dark:{[Xo.variable]:"colors.gray.800",[Ei.variable]:`colors.${t}.300`},borderColor:"inherit",borderTopColor:"currentColor",borderBottomColor:"transparent"},color:Ei.reference,bg:Xo.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),Yie=Wa(e=>{const{colorScheme:t,theme:n}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",color:"gray.600",_selected:{color:ui(n,`${t}.700`),bg:ui(n,`${t}.100`)}}}}),qie=Wa(e=>{const{colorScheme:t}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",[Ei.variable]:"colors.gray.600",_dark:{[Ei.variable]:"inherit"},_selected:{[Ei.variable]:"colors.white",[Xo.variable]:`colors.${t}.600`,_dark:{[Ei.variable]:"colors.gray.800",[Xo.variable]:`colors.${t}.300`}},color:Ei.reference,bg:Xo.reference}}}),Xie=Wa({}),Zie={line:Wie,enclosed:Gie,"enclosed-colored":Kie,"soft-rounded":Yie,"solid-rounded":qie,unstyled:Xie},Qie=Bie({baseStyle:Vie,sizes:Uie,variants:Zie,defaultProps:{size:"md",variant:"line",colorScheme:"blue"}}),{defineMultiStyleConfig:Jie,definePartsStyle:Sc}=Tn(UJ.keys),eoe={fontWeight:"medium",lineHeight:1.2,outline:0,borderRadius:"md",_focusVisible:{boxShadow:"outline"}},toe={lineHeight:1.2,overflow:"visible"},noe={fontSize:"lg",w:"5",h:"5",transitionProperty:"common",transitionDuration:"normal",borderRadius:"full",marginStart:"1.5",marginEnd:"-1",opacity:.5,_disabled:{opacity:.4},_focusVisible:{boxShadow:"outline",bg:"rgba(0, 0, 0, 0.14)"},_hover:{opacity:.8},_active:{opacity:1}},roe=Sc({container:eoe,label:toe,closeButton:noe}),ioe={sm:Sc({container:{minH:"5",minW:"5",fontSize:"xs",px:"2"},closeButton:{marginEnd:"-2px",marginStart:"0.35rem"}}),md:Sc({container:{minH:"6",minW:"6",fontSize:"sm",px:"2"}}),lg:Sc({container:{minH:"8",minW:"8",fontSize:"md",px:"3"}})},ooe={subtle:Sc(e=>{var t;return{container:(t=km.variants)==null?void 0:t.subtle(e)}}),solid:Sc(e=>{var t;return{container:(t=km.variants)==null?void 0:t.solid(e)}}),outline:Sc(e=>{var t;return{container:(t=km.variants)==null?void 0:t.outline(e)}})},aoe=Jie({variants:ooe,baseStyle:roe,sizes:ioe,defaultProps:{size:"md",variant:"subtle",colorScheme:"gray"}}),_T,soe={...(_T=jt.baseStyle)==null?void 0:_T.field,paddingY:"2",minHeight:"20",lineHeight:"short",verticalAlign:"top"},kT,vD,loe={outline:e=>{var n;var t;return(n=(t=jt.variants)==null?void 0:t.outline(e).field)!=null?n:{}},flushed:e=>{var n;var t;return(n=(t=jt.variants)==null?void 0:t.flushed(e).field)!=null?n:{}},filled:e=>{var n;var t;return(n=(t=jt.variants)==null?void 0:t.filled(e).field)!=null?n:{}},unstyled:(vD=(kT=jt.variants)==null?void 0:kT.unstyled.field)!=null?vD:{}},ET,PT,TT,LT,yD,bD,SD,wD,uoe={xs:(yD=(ET=jt.sizes)==null?void 0:ET.xs.field)!=null?yD:{},sm:(bD=(PT=jt.sizes)==null?void 0:PT.sm.field)!=null?bD:{},md:(SD=(TT=jt.sizes)==null?void 0:TT.md.field)!=null?SD:{},lg:(wD=(LT=jt.sizes)==null?void 0:LT.lg.field)!=null?wD:{}},coe={baseStyle:soe,sizes:uoe,variants:loe,defaultProps:{size:"md",variant:"outline"}},X0=pr("tooltip-bg"),bS=pr("tooltip-fg"),doe=pr("popper-arrow-bg"),foe={bg:X0.reference,color:bS.reference,[X0.variable]:"colors.gray.700",[bS.variable]:"colors.whiteAlpha.900",_dark:{[X0.variable]:"colors.gray.300",[bS.variable]:"colors.gray.900"},[doe.variable]:X0.reference,px:"2",py:"0.5",borderRadius:"sm",fontWeight:"medium",fontSize:"sm",boxShadow:"md",maxW:"xs",zIndex:"tooltip"},hoe={baseStyle:foe},poe={Accordion:Oee,Alert:Fee,Avatar:Xee,Badge:km,Breadcrumb:ate,Button:mte,Checkbox:Q2,CloseButton:Ate,Code:Rte,Container:Dte,Divider:jte,Drawer:Qte,Editable:one,Form:dne,FormError:vne,FormLabel:bne,Heading:Cne,Input:jt,Kbd:Mne,Link:Rne,List:Fne,Menu:qne,Modal:are,NumberInput:gre,PinInput:Sre,Popover:Ore,Progress:Fre,Radio:Ure,Select:Zre,Skeleton:Jre,SkipLink:tie,Slider:fie,Spinner:mie,Stat:xie,Switch:Aie,Table:Nie,Tabs:Qie,Tag:aoe,Textarea:coe,Tooltip:hoe,Card:Ste},moe={none:0,"1px":"1px solid","2px":"2px solid","4px":"4px solid","8px":"8px solid"},goe=moe,voe={base:"0em",sm:"30em",md:"48em",lg:"62em",xl:"80em","2xl":"96em"},yoe=voe,boe={transparent:"transparent",current:"currentColor",black:"#000000",white:"#FFFFFF",whiteAlpha:{50:"rgba(255, 255, 255, 0.04)",100:"rgba(255, 255, 255, 0.06)",200:"rgba(255, 255, 255, 0.08)",300:"rgba(255, 255, 255, 0.16)",400:"rgba(255, 255, 255, 0.24)",500:"rgba(255, 255, 255, 0.36)",600:"rgba(255, 255, 255, 0.48)",700:"rgba(255, 255, 255, 0.64)",800:"rgba(255, 255, 255, 0.80)",900:"rgba(255, 255, 255, 0.92)"},blackAlpha:{50:"rgba(0, 0, 0, 0.04)",100:"rgba(0, 0, 0, 0.06)",200:"rgba(0, 0, 0, 0.08)",300:"rgba(0, 0, 0, 0.16)",400:"rgba(0, 0, 0, 0.24)",500:"rgba(0, 0, 0, 0.36)",600:"rgba(0, 0, 0, 0.48)",700:"rgba(0, 0, 0, 0.64)",800:"rgba(0, 0, 0, 0.80)",900:"rgba(0, 0, 0, 0.92)"},gray:{50:"#F7FAFC",100:"#EDF2F7",200:"#E2E8F0",300:"#CBD5E0",400:"#A0AEC0",500:"#718096",600:"#4A5568",700:"#2D3748",800:"#1A202C",900:"#171923"},red:{50:"#FFF5F5",100:"#FED7D7",200:"#FEB2B2",300:"#FC8181",400:"#F56565",500:"#E53E3E",600:"#C53030",700:"#9B2C2C",800:"#822727",900:"#63171B"},orange:{50:"#FFFAF0",100:"#FEEBC8",200:"#FBD38D",300:"#F6AD55",400:"#ED8936",500:"#DD6B20",600:"#C05621",700:"#9C4221",800:"#7B341E",900:"#652B19"},yellow:{50:"#FFFFF0",100:"#FEFCBF",200:"#FAF089",300:"#F6E05E",400:"#ECC94B",500:"#D69E2E",600:"#B7791F",700:"#975A16",800:"#744210",900:"#5F370E"},green:{50:"#F0FFF4",100:"#C6F6D5",200:"#9AE6B4",300:"#68D391",400:"#48BB78",500:"#38A169",600:"#2F855A",700:"#276749",800:"#22543D",900:"#1C4532"},teal:{50:"#E6FFFA",100:"#B2F5EA",200:"#81E6D9",300:"#4FD1C5",400:"#38B2AC",500:"#319795",600:"#2C7A7B",700:"#285E61",800:"#234E52",900:"#1D4044"},blue:{50:"#ebf8ff",100:"#bee3f8",200:"#90cdf4",300:"#63b3ed",400:"#4299e1",500:"#3182ce",600:"#2b6cb0",700:"#2c5282",800:"#2a4365",900:"#1A365D"},cyan:{50:"#EDFDFD",100:"#C4F1F9",200:"#9DECF9",300:"#76E4F7",400:"#0BC5EA",500:"#00B5D8",600:"#00A3C4",700:"#0987A0",800:"#086F83",900:"#065666"},purple:{50:"#FAF5FF",100:"#E9D8FD",200:"#D6BCFA",300:"#B794F4",400:"#9F7AEA",500:"#805AD5",600:"#6B46C1",700:"#553C9A",800:"#44337A",900:"#322659"},pink:{50:"#FFF5F7",100:"#FED7E2",200:"#FBB6CE",300:"#F687B3",400:"#ED64A6",500:"#D53F8C",600:"#B83280",700:"#97266D",800:"#702459",900:"#521B41"},linkedin:{50:"#E8F4F9",100:"#CFEDFB",200:"#9BDAF3",300:"#68C7EC",400:"#34B3E4",500:"#00A0DC",600:"#008CC9",700:"#0077B5",800:"#005E93",900:"#004471"},facebook:{50:"#E8F4F9",100:"#D9DEE9",200:"#B7C2DA",300:"#6482C0",400:"#4267B2",500:"#385898",600:"#314E89",700:"#29487D",800:"#223B67",900:"#1E355B"},messenger:{50:"#D0E6FF",100:"#B9DAFF",200:"#A2CDFF",300:"#7AB8FF",400:"#2E90FF",500:"#0078FF",600:"#0063D1",700:"#0052AC",800:"#003C7E",900:"#002C5C"},whatsapp:{50:"#dffeec",100:"#b9f5d0",200:"#90edb3",300:"#65e495",400:"#3cdd78",500:"#22c35e",600:"#179848",700:"#0c6c33",800:"#01421c",900:"#001803"},twitter:{50:"#E5F4FD",100:"#C8E9FB",200:"#A8DCFA",300:"#83CDF7",400:"#57BBF5",500:"#1DA1F2",600:"#1A94DA",700:"#1681BF",800:"#136B9E",900:"#0D4D71"},telegram:{50:"#E3F2F9",100:"#C5E4F3",200:"#A2D4EC",300:"#7AC1E4",400:"#47A9DA",500:"#0088CC",600:"#007AB8",700:"#006BA1",800:"#005885",900:"#003F5E"}},Soe=boe,woe={none:"0",sm:"0.125rem",base:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},Coe=woe,xoe={xs:"0 0 0 1px rgba(0, 0, 0, 0.05)",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",base:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",outline:"0 0 0 3px rgba(66, 153, 225, 0.6)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.06)",none:"none","dark-lg":"rgba(0, 0, 0, 0.1) 0px 0px 0px 1px, rgba(0, 0, 0, 0.2) 0px 5px 10px, rgba(0, 0, 0, 0.4) 0px 15px 40px"},_oe=xoe,koe={common:"background-color, border-color, color, fill, stroke, opacity, box-shadow, transform",colors:"background-color, border-color, color, fill, stroke",dimensions:"width, height",position:"left, right, top, bottom",background:"background-color, background-image, background-position"},Eoe={"ease-in":"cubic-bezier(0.4, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.2, 1)","ease-in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},Poe={"ultra-fast":"50ms",faster:"100ms",fast:"150ms",normal:"200ms",slow:"300ms",slower:"400ms","ultra-slow":"500ms"},Toe={property:koe,easing:Eoe,duration:Poe},Loe=Toe,Aoe={hide:-1,auto:"auto",base:0,docked:10,dropdown:1e3,sticky:1100,banner:1200,overlay:1300,modal:1400,popover:1500,skipLink:1600,toast:1700,tooltip:1800},Ooe=Aoe,Moe={none:0,sm:"4px",base:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},Ioe=Moe,Roe={breakpoints:yoe,zIndices:Ooe,radii:Coe,blur:Ioe,colors:Soe,...xN,sizes:SN,shadows:_oe,space:bN,borders:goe,transition:Loe},$oe={colors:{"chakra-body-text":{_light:"gray.800",_dark:"whiteAlpha.900"},"chakra-body-bg":{_light:"white",_dark:"gray.800"},"chakra-border-color":{_light:"gray.200",_dark:"whiteAlpha.300"},"chakra-subtle-bg":{_light:"gray.100",_dark:"gray.700"},"chakra-placeholder-color":{_light:"gray.500",_dark:"whiteAlpha.400"}}},Doe={global:{body:{fontFamily:"body",color:"chakra-body-text",bg:"chakra-body-bg",transitionProperty:"background-color",transitionDuration:"normal",lineHeight:"base"},"*::placeholder":{color:"chakra-placeholder-color"},"*, *::before, &::after":{borderColor:"chakra-border-color",wordWrap:"break-word"}}},Noe="ltr",Boe={useSystemColorMode:!1,initialColorMode:"light",cssVarPrefix:"chakra"},Foe={semanticTokens:$oe,direction:Noe,...Roe,components:poe,styles:Doe,config:Boe},zoe=typeof Element<"u",joe=typeof Map=="function",Hoe=typeof Set=="function",Voe=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function h2(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!h2(e[r],t[r]))return!1;return!0}var o;if(joe&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;for(o=e.entries();!(r=o.next()).done;)if(!h2(r.value[1],t.get(r.value[0])))return!1;return!0}if(Hoe&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(Voe&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;if(zoe&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((i[r]==="_owner"||i[r]==="__v"||i[r]==="__o")&&e.$$typeof)&&!h2(e[i[r]],t[i[r]]))return!1;return!0}return e!==e&&t!==t}var Uoe=function(t,n){try{return h2(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};function Lh(){const e=S.useContext(lg);if(!e)throw Error("useTheme: `theme` is undefined. Seems you forgot to wrap your app in `` or ``");return e}function PN(){const e=t1(),t=Lh();return{...e,theme:t}}function Woe(e,t,n){var i,o;if(t==null)return t;const r=a=>{var s,l;return(l=(s=e.__breakpoints)==null?void 0:s.asArray)==null?void 0:l[a]};return(o=(i=r(t))!=null?i:r(n))!=null?o:n}function Goe(e,t,n){var i,o;if(t==null)return t;const r=a=>{var s,l;return(l=(s=e.__cssMap)==null?void 0:s[a])==null?void 0:l.value};return(o=(i=r(t))!=null?i:r(n))!=null?o:n}function Koe(e,t,n){const r=Array.isArray(t)?t:[t],i=Array.isArray(n)?n:[n];return o=>{const a=i.filter(Boolean),s=r.map((l,u)=>{var f,p;if(e==="breakpoints")return Woe(o,l,(f=a[u])!=null?f:l);const c=`${e}.${l}`;return Goe(o,c,(p=a[u])!=null?p:l)});return Array.isArray(t)?s:s[0]}}function Yoe(e){const{cssVarsRoot:t,theme:n,children:r}=e,i=S.useMemo(()=>jZ(n),[n]);return M.createElement(ZQ,{theme:i},M.createElement(qoe,{root:t}),r)}function qoe({root:e=":host, :root"}){const t=[e,"[data-theme]"].join(",");return M.createElement(Fb,{styles:n=>({[t]:n.__cssVars})})}hJ({name:"StylesContext",errorMessage:"useStyles: `styles` is undefined. Seems you forgot to wrap the components in `` "});function Xoe(){const{colorMode:e}=t1();return M.createElement(Fb,{styles:t=>{const n=lN(t,"styles.global"),r=dN(n,{theme:t,colorMode:e});return r?zD(r)(t):void 0}})}var Zoe=new Set([...UZ,"textStyle","layerStyle","apply","noOfLines","focusBorderColor","errorBorderColor","as","__css","css","sx"]),Qoe=new Set(["htmlWidth","htmlHeight","htmlSize"]);function Joe(e){return Qoe.has(e)||!Zoe.has(e)}var eae=({baseStyle:e})=>t=>{const{theme:n,css:r,__css:i,sx:o,...a}=t,s=uN(a,(f,p)=>GZ(p)),l=dN(e,t),u=Object.assign({},i,l,cN(s),o),c=zD(u)(t.theme);return r?[c,r]:c};function SS(e,t){const{baseStyle:n,...r}=t!=null?t:{};r.shouldForwardProp||(r.shouldForwardProp=Joe);const i=eae({baseStyle:n}),o=k6(e,r)(i);return M.forwardRef(function(l,u){const{colorMode:c,forced:f}=t1();return M.createElement(o,{ref:u,"data-theme":f?c:void 0,...l})})}function pe(e){return S.forwardRef(e)}function TN(e,t={}){var c;const{styleConfig:n,...r}=t,{theme:i,colorMode:o}=PN(),a=e?lN(i,`components.${e}`):void 0,s=n||a,l=za({theme:i,colorMode:o},(c=s==null?void 0:s.defaultProps)!=null?c:{},cN(sJ(r,["children"]))),u=S.useRef({});if(s){const p=nQ(s)(l);Uoe(u.current,p)||(u.current=p)}return u.current}function gi(e,t={}){return TN(e,t)}function Br(e,t={}){return TN(e,t)}function tae(){const e=new Map;return new Proxy(SS,{apply(t,n,r){return SS(...r)},get(t,n){return e.has(n)||e.set(n,SS(n)),e.get(n)}})}var de=tae();function nae(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function Kt(e={}){const{name:t,strict:n=!0,hookName:r="useContext",providerName:i="Provider",errorMessage:o}=e,a=S.createContext(void 0);a.displayName=t;function s(){var l;const u=S.useContext(a);if(!u&&n){const c=new Error(o!=null?o:nae(r,i));throw c.name="ContextError",(l=Error.captureStackTrace)==null||l.call(Error,c,s),c}return u}return[a.Provider,s,a]}function rae(e,t){if(e!=null){if(typeof e=="function"){e(t);return}try{e.current=t}catch(n){throw new Error(`Cannot assign value '${t}' to ref '${e}'`)}}}function ln(...e){return t=>{e.forEach(n=>{rae(n,t)})}}function iae(...e){return S.useMemo(()=>ln(...e),e)}function AT(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 oae=e=>typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE;function OT(e,t,n){let r=e+1;return n&&r>=t&&(r=0),r}function MT(e,t,n){let r=e-1;return n&&r<0&&(r=t),r}var O6=typeof window<"u"?S.useLayoutEffect:S.useEffect,ey=e=>e,aae=class{constructor(){kt(this,"descendants",new Map);kt(this,"register",e=>{if(e!=null)return oae(e)?this.registerNode(e):t=>{this.registerNode(t,e)}});kt(this,"unregister",e=>{this.descendants.delete(e);const t=AT(Array.from(this.descendants.keys()));this.assignIndex(t)});kt(this,"destroy",()=>{this.descendants.clear()});kt(this,"assignIndex",e=>{this.descendants.forEach(t=>{const n=e.indexOf(t.node);t.index=n,t.node.dataset.index=t.index.toString()})});kt(this,"count",()=>this.descendants.size);kt(this,"enabledCount",()=>this.enabledValues().length);kt(this,"values",()=>Array.from(this.descendants.values()).sort((t,n)=>t.index-n.index));kt(this,"enabledValues",()=>this.values().filter(e=>!e.disabled));kt(this,"item",e=>{if(this.count()!==0)return this.values()[e]});kt(this,"enabledItem",e=>{if(this.enabledCount()!==0)return this.enabledValues()[e]});kt(this,"first",()=>this.item(0));kt(this,"firstEnabled",()=>this.enabledItem(0));kt(this,"last",()=>this.item(this.descendants.size-1));kt(this,"lastEnabled",()=>{const e=this.enabledValues().length-1;return this.enabledItem(e)});kt(this,"indexOf",e=>{var n;var t;return e&&(n=(t=this.descendants.get(e))==null?void 0:t.index)!=null?n:-1});kt(this,"enabledIndexOf",e=>e==null?-1:this.enabledValues().findIndex(t=>t.node.isSameNode(e)));kt(this,"next",(e,t=!0)=>{const n=OT(e,this.count(),t);return this.item(n)});kt(this,"nextEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),i=OT(r,this.enabledCount(),t);return this.enabledItem(i)});kt(this,"prev",(e,t=!0)=>{const n=MT(e,this.count()-1,t);return this.item(n)});kt(this,"prevEnabled",(e,t=!0)=>{const n=this.item(e);if(!n)return;const r=this.enabledIndexOf(n.node),i=MT(r,this.enabledCount()-1,t);return this.enabledItem(i)});kt(this,"registerNode",(e,t)=>{if(!e||this.descendants.has(e))return;const n=Array.from(this.descendants.keys()).concat(e),r=AT(n);t!=null&&t.disabled&&(t.disabled=!!t.disabled);const i={node:e,index:-1,...t};this.descendants.set(e,i),this.assignIndex(r)})}};function sae(){const e=S.useRef(new aae);return O6(()=>()=>e.current.destroy()),e.current}var[lae,LN]=Kt({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});function uae(e){const t=LN(),[n,r]=S.useState(-1),i=S.useRef(null);O6(()=>()=>{i.current&&t.unregister(i.current)},[]),O6(()=>{if(!i.current)return;const a=Number(i.current.dataset.index);n!=a&&!Number.isNaN(a)&&r(a)});const o=ey(e?t.register(e):t.register);return{descendants:t,index:n,enabledIndex:t.enabledIndexOf(i.current),register:ln(o,i)}}function AN(){return[ey(lae),()=>ey(LN()),()=>sae(),i=>uae(i)]}var Jn=(...e)=>e.filter(Boolean).join(" "),IT={path:M.createElement("g",{stroke:"currentColor",strokeWidth:"1.5"},M.createElement("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),M.createElement("path",{fill:"currentColor",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),M.createElement("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})),viewBox:"0 0 24 24"},Qi=pe((e,t)=>{const{as:n,viewBox:r,color:i="currentColor",focusable:o=!1,children:a,className:s,__css:l,...u}=e,c=Jn("chakra-icon",s),f={w:"1em",h:"1em",display:"inline-block",lineHeight:"1em",flexShrink:0,color:i,...l},p={ref:t,focusable:o,className:c,__css:f},m=r!=null?r:IT.viewBox;if(n&&typeof n!="string")return M.createElement(de.svg,{as:n,...p,...u});const g=a!=null?a:IT.path;return M.createElement(de.svg,{verticalAlign:"middle",viewBox:m,...p,...u},g)});Qi.displayName="Icon";function Ye(e){const{viewBox:t="0 0 24 24",d:n,displayName:r,defaultProps:i={}}=e,o=S.Children.toArray(e.path),a=pe((s,l)=>M.createElement(Qi,{ref:l,viewBox:t,...i,...s},o.length?o:M.createElement("path",{fill:"currentColor",d:n})));return a.displayName=r,a}function Fn(e,t=[]){const n=S.useRef(e);return S.useEffect(()=>{n.current=e}),S.useCallback((...r)=>{var i;return(i=n.current)==null?void 0:i.call(n,...r)},t)}function Vb(e){const{value:t,defaultValue:n,onChange:r,shouldUpdate:i=(p,m)=>p!==m}=e,o=Fn(r),a=Fn(i),[s,l]=S.useState(n),u=t!==void 0,c=u?t:s,f=Fn(p=>{const g=typeof p=="function"?p(c):p;a(c,g)&&(u||l(g),o(g))},[u,o,c,a]);return[c,f]}const Q7=S.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),Ub=S.createContext({});function cae(){return S.useContext(Ub).visualElement}const Ah=S.createContext(null),Uc=typeof document<"u",ty=Uc?S.useLayoutEffect:S.useEffect,ON=S.createContext({strict:!1});function dae(e,t,n,r){const i=cae(),o=S.useContext(ON),a=S.useContext(Ah),s=S.useContext(Q7).reducedMotion,l=S.useRef();r=r||o.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:i,props:n,presenceId:a?a.id:void 0,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:s}));const u=l.current;return ty(()=>{u&&u.render()}),S.useEffect(()=>{u&&u.animationState&&u.animationState.animateChanges()}),ty(()=>()=>u&&u.notify("Unmount"),[]),u}function tf(e){return typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function fae(e,t,n){return S.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):tf(n)&&(n.current=r))},[t])}function fg(e){return typeof e=="string"||Array.isArray(e)}function Wb(e){return typeof e=="object"&&typeof e.start=="function"}const hae=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function Gb(e){return Wb(e.animate)||hae.some(t=>fg(e[t]))}function MN(e){return Boolean(Gb(e)||e.variants)}function pae(e,t){if(Gb(e)){const{initial:n,animate:r}=e;return{initial:n===!1||fg(n)?n:void 0,animate:fg(r)?r:void 0}}return e.inherit!==!1?t:{}}function mae(e){const{initial:t,animate:n}=pae(e,S.useContext(Ub));return S.useMemo(()=>({initial:t,animate:n}),[RT(t),RT(n)])}function RT(e){return Array.isArray(e)?e.join(" "):e}const xs=e=>({isEnabled:t=>e.some(n=>!!t[n])}),hg={measureLayout:xs(["layout","layoutId","drag"]),animation:xs(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:xs(["exit"]),drag:xs(["drag","dragControls"]),focus:xs(["whileFocus"]),hover:xs(["whileHover","onHoverStart","onHoverEnd"]),tap:xs(["whileTap","onTap","onTapStart","onTapCancel"]),pan:xs(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:xs(["whileInView","onViewportEnter","onViewportLeave"])};function gae(e){for(const t in e)t==="projectionNodeConstructor"?hg.projectionNodeConstructor=e[t]:hg[t].Component=e[t]}function Kb(e){const t=S.useRef(null);return t.current===null&&(t.current=e()),t.current}const Lm={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let vae=1;function yae(){return Kb(()=>{if(Lm.hasEverUpdated)return vae++})}const J7=S.createContext({});class bae extends M.Component{getSnapshotBeforeUpdate(){const{visualElement:t,props:n}=this.props;return t&&t.setProps(n),null}componentDidUpdate(){}render(){return this.props.children}}const IN=S.createContext({}),Sae=Symbol.for("motionComponentSymbol");function wae({preloadedFeatures:e,createVisualElement:t,projectionNodeConstructor:n,useRender:r,useVisualState:i,Component:o}){e&&gae(e);function a(l,u){const c={...S.useContext(Q7),...l,layoutId:Cae(l)},{isStatic:f}=c;let p=null;const m=mae(l),g=f?void 0:yae(),v=i(l,f);if(!f&&Uc){m.visualElement=dae(o,v,c,t);const x=S.useContext(ON).strict,C=S.useContext(IN);m.visualElement&&(p=m.visualElement.loadFeatures(c,x,e,g,n||hg.projectionNodeConstructor,C))}return S.createElement(bae,{visualElement:m.visualElement,props:c},p,S.createElement(Ub.Provider,{value:m},r(o,l,g,fae(v,m.visualElement,u),v,f,m.visualElement)))}const s=S.forwardRef(a);return s[Sae]=o,s}function Cae({layoutId:e}){const t=S.useContext(J7).id;return t&&e!==void 0?t+"-"+e:e}function xae(e){function t(r,i={}){return wae(e(r,i))}if(typeof Proxy>"u")return t;const n=new Map;return new Proxy(t,{get:(r,i)=>(n.has(i)||n.set(i,t(i)),n.get(i))})}const _ae=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];function e9(e){return typeof e!="string"||e.includes("-")?!1:!!(_ae.indexOf(e)>-1||/[A-Z]/.test(e))}const ny={};function kae(e){Object.assign(ny,e)}const ry=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Oh=new Set(ry);function RN(e,{layout:t,layoutId:n}){return Oh.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ny[e]||e==="opacity")}const ts=e=>!!(e!=null&&e.getVelocity),Eae={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Pae=(e,t)=>ry.indexOf(e)-ry.indexOf(t);function Tae({transform:e,transformKeys:t},{enableHardwareAcceleration:n=!0,allowTransformNone:r=!0},i,o){let a="";t.sort(Pae);for(const s of t)a+=`${Eae[s]||s}(${e[s]}) `;return n&&!e.z&&(a+="translateZ(0)"),a=a.trim(),o?a=o(e,i?"":a):r&&i&&(a="none"),a}function $N(e){return e.startsWith("--")}const Lae=(e,t)=>t&&typeof e=="number"?t.transform(e):e,DN=(e,t)=>n=>Math.max(Math.min(n,t),e),Am=e=>e%1?Number(e.toFixed(5)):e,pg=/(-)?([\d]*\.?[\d])+/g,M6=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,Aae=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function o1(e){return typeof e=="string"}const Wc={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Om=Object.assign(Object.assign({},Wc),{transform:DN(0,1)}),Z0=Object.assign(Object.assign({},Wc),{default:1}),a1=e=>({test:t=>o1(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),xl=a1("deg"),Ga=a1("%"),ut=a1("px"),Oae=a1("vh"),Mae=a1("vw"),$T=Object.assign(Object.assign({},Ga),{parse:e=>Ga.parse(e)/100,transform:e=>Ga.transform(e*100)}),t9=(e,t)=>n=>Boolean(o1(n)&&Aae.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),NN=(e,t,n)=>r=>{if(!o1(r))return r;const[i,o,a,s]=r.match(pg);return{[e]:parseFloat(i),[t]:parseFloat(o),[n]:parseFloat(a),alpha:s!==void 0?parseFloat(s):1}},dc={test:t9("hsl","hue"),parse:NN("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Ga.transform(Am(t))+", "+Ga.transform(Am(n))+", "+Am(Om.transform(r))+")"},Iae=DN(0,255),wS=Object.assign(Object.assign({},Wc),{transform:e=>Math.round(Iae(e))}),$l={test:t9("rgb","red"),parse:NN("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+wS.transform(e)+", "+wS.transform(t)+", "+wS.transform(n)+", "+Am(Om.transform(r))+")"};function Rae(e){let t="",n="",r="",i="";return e.length>5?(t=e.substr(1,2),n=e.substr(3,2),r=e.substr(5,2),i=e.substr(7,2)):(t=e.substr(1,1),n=e.substr(2,1),r=e.substr(3,1),i=e.substr(4,1),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const I6={test:t9("#"),parse:Rae,transform:$l.transform},si={test:e=>$l.test(e)||I6.test(e)||dc.test(e),parse:e=>$l.test(e)?$l.parse(e):dc.test(e)?dc.parse(e):I6.parse(e),transform:e=>o1(e)?e:e.hasOwnProperty("red")?$l.transform(e):dc.transform(e)},BN="${c}",FN="${n}";function $ae(e){var t,n,r,i;return isNaN(e)&&o1(e)&&((n=(t=e.match(pg))===null||t===void 0?void 0:t.length)!==null&&n!==void 0?n:0)+((i=(r=e.match(M6))===null||r===void 0?void 0:r.length)!==null&&i!==void 0?i:0)>0}function zN(e){typeof e=="number"&&(e=`${e}`);const t=[];let n=0;const r=e.match(M6);r&&(n=r.length,e=e.replace(M6,BN),t.push(...r.map(si.parse)));const i=e.match(pg);return i&&(e=e.replace(pg,FN),t.push(...i.map(Wc.parse))),{values:t,numColors:n,tokenised:e}}function jN(e){return zN(e).values}function HN(e){const{values:t,numColors:n,tokenised:r}=zN(e),i=t.length;return o=>{let a=r;for(let s=0;stypeof e=="number"?0:e;function Nae(e){const t=jN(e);return HN(e)(t.map(Dae))}const Bs={test:$ae,parse:jN,createTransformer:HN,getAnimatableNone:Nae},Bae=new Set(["brightness","contrast","saturate","opacity"]);function Fae(e){let[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(pg)||[];if(!r)return e;const i=n.replace(r,"");let o=Bae.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+i+")"}const zae=/([a-z-]*)\(.*?\)/g,R6=Object.assign(Object.assign({},Bs),{getAnimatableNone:e=>{const t=e.match(zae);return t?t.map(Fae).join(" "):e}}),DT={...Wc,transform:Math.round},VN={borderWidth:ut,borderTopWidth:ut,borderRightWidth:ut,borderBottomWidth:ut,borderLeftWidth:ut,borderRadius:ut,radius:ut,borderTopLeftRadius:ut,borderTopRightRadius:ut,borderBottomRightRadius:ut,borderBottomLeftRadius:ut,width:ut,maxWidth:ut,height:ut,maxHeight:ut,size:ut,top:ut,right:ut,bottom:ut,left:ut,padding:ut,paddingTop:ut,paddingRight:ut,paddingBottom:ut,paddingLeft:ut,margin:ut,marginTop:ut,marginRight:ut,marginBottom:ut,marginLeft:ut,rotate:xl,rotateX:xl,rotateY:xl,rotateZ:xl,scale:Z0,scaleX:Z0,scaleY:Z0,scaleZ:Z0,skew:xl,skewX:xl,skewY:xl,distance:ut,translateX:ut,translateY:ut,translateZ:ut,x:ut,y:ut,z:ut,perspective:ut,transformPerspective:ut,opacity:Om,originX:$T,originY:$T,originZ:ut,zIndex:DT,fillOpacity:Om,strokeOpacity:Om,numOctaves:DT};function n9(e,t,n,r){const{style:i,vars:o,transform:a,transformKeys:s,transformOrigin:l}=e;s.length=0;let u=!1,c=!1,f=!0;for(const p in t){const m=t[p];if($N(p)){o[p]=m;continue}const g=VN[p],v=Lae(m,g);if(Oh.has(p)){if(u=!0,a[p]=v,s.push(p),!f)continue;m!==(g.default||0)&&(f=!1)}else p.startsWith("origin")?(c=!0,l[p]=v):i[p]=v}if(t.transform||(u||r?i.transform=Tae(e,n,f,r):i.transform&&(i.transform="none")),c){const{originX:p="50%",originY:m="50%",originZ:g=0}=l;i.transformOrigin=`${p} ${m} ${g}`}}const r9=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function UN(e,t,n){for(const r in t)!ts(t[r])&&!RN(r,n)&&(e[r]=t[r])}function jae({transformTemplate:e},t,n){return S.useMemo(()=>{const r=r9();return n9(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)},[t])}function Hae(e,t,n){const r=e.style||{},i={};return UN(i,r,e),Object.assign(i,jae(e,t,n)),e.transformValues?e.transformValues(i):i}function Vae(e,t,n){const r={},i=Hae(e,t,n);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),r.style=i,r}const Uae=["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"],Wae=["whileTap","onTap","onTapStart","onTapCancel"],Gae=["onPan","onPanStart","onPanSessionStart","onPanEnd"],Kae=["whileInView","onViewportEnter","onViewportLeave","viewport"],Yae=new Set(["initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","layoutDependency","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","dragSnapToOrigin","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","onHoverStart","onHoverEnd","layoutScroll",...Kae,...Wae,...Uae,...Gae]);function iy(e){return Yae.has(e)}let WN=e=>!iy(e);function qae(e){e&&(WN=t=>t.startsWith("on")?!iy(t):e(t))}try{qae(require("@emotion/is-prop-valid").default)}catch(e){}function Xae(e,t,n){const r={};for(const i in e)(WN(i)||n===!0&&iy(i)||!t&&!iy(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function NT(e,t,n){return typeof e=="string"?e:ut.transform(t+n*e)}function Zae(e,t,n){const r=NT(t,e.x,e.width),i=NT(n,e.y,e.height);return`${r} ${i}`}const Qae={offset:"stroke-dashoffset",array:"stroke-dasharray"},Jae={offset:"strokeDashoffset",array:"strokeDasharray"};function ese(e,t,n=1,r=0,i=!0){e.pathLength=1;const o=i?Qae:Jae;e[o.offset]=ut.transform(-r);const a=ut.transform(t),s=ut.transform(n);e[o.array]=`${a} ${s}`}function i9(e,{attrX:t,attrY:n,originX:r,originY:i,pathLength:o,pathSpacing:a=1,pathOffset:s=0,...l},u,c){n9(e,l,u,c),e.attrs=e.style,e.style={};const{attrs:f,style:p,dimensions:m}=e;f.transform&&(m&&(p.transform=f.transform),delete f.transform),m&&(r!==void 0||i!==void 0||p.transform)&&(p.transformOrigin=Zae(m,r!==void 0?r:.5,i!==void 0?i:.5)),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),o!==void 0&&ese(f,o,a,s,!1)}const GN=()=>({...r9(),attrs:{}});function tse(e,t){const n=S.useMemo(()=>{const r=GN();return i9(r,t,{enableHardwareAcceleration:!1},e.transformTemplate),{...r.attrs,style:{...r.style}}},[t]);if(e.style){const r={};UN(r,e.style,e),n.style={...r,...n.style}}return n}function nse(e=!1){return(n,r,i,o,{latestValues:a},s)=>{const u=(e9(n)?tse:Vae)(r,a,s),f={...Xae(r,typeof n=="string",e),...u,ref:o};return i&&(f["data-projection-id"]=i),S.createElement(n,f)}}const KN=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function YN(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const o in n)e.style.setProperty(o,n[o])}const qN=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength"]);function XN(e,t,n,r){YN(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(qN.has(i)?i:KN(i),t.attrs[i])}function o9(e){const{style:t}=e,n={};for(const r in t)(ts(t[r])||RN(r,e))&&(n[r]=t[r]);return n}function ZN(e){const t=o9(e);for(const n in e)if(ts(e[n])){const r=n==="x"||n==="y"?"attr"+n.toUpperCase():n;t[r]=e[n]}return t}function a9(e,t,n,r={},i={}){return typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,i)),typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,i)),t}const mg=e=>Array.isArray(e),rse=e=>Boolean(e&&typeof e=="object"&&e.mix&&e.toValue),QN=e=>mg(e)?e[e.length-1]||0:e;function p2(e){const t=ts(e)?e.get():e;return rse(t)?t.toValue():t}function ise({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,i,o){const a={latestValues:ose(r,i,o,e),renderState:t()};return n&&(a.mount=s=>n(r,s,a)),a}const JN=e=>(t,n)=>{const r=S.useContext(Ub),i=S.useContext(Ah),o=()=>ise(e,t,r,i);return n?o():Kb(o)};function ose(e,t,n,r){const i={},o=r(e);for(const p in o)i[p]=p2(o[p]);let{initial:a,animate:s}=e;const l=Gb(e),u=MN(e);t&&u&&!l&&e.inherit!==!1&&(a===void 0&&(a=t.initial),s===void 0&&(s=t.animate));let c=n?n.initial===!1:!1;c=c||a===!1;const f=c?s:a;return f&&typeof f!="boolean"&&!Wb(f)&&(Array.isArray(f)?f:[f]).forEach(m=>{const g=a9(e,m);if(!g)return;const{transitionEnd:v,transition:x,...C}=g;for(const w in C){let k=C[w];if(Array.isArray(k)){const P=c?k.length-1:0;k=k[P]}k!==null&&(i[w]=k)}for(const w in v)i[w]=v[w]}),i}const ase={useVisualState:JN({scrapeMotionValuesFromProps:ZN,createRenderState:GN,onMount:(e,t,{renderState:n,latestValues:r})=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch(i){n.dimensions={x:0,y:0,width:0,height:0}}i9(n,r,{enableHardwareAcceleration:!1},e.transformTemplate),XN(t,n)}})},sse={useVisualState:JN({scrapeMotionValuesFromProps:o9,createRenderState:r9})};function lse(e,{forwardMotionProps:t=!1},n,r,i){return{...e9(e)?ase:sse,preloadedFeatures:n,useRender:nse(t),createVisualElement:r,projectionNodeConstructor:i,Component:e}}var hn;(function(e){e.Animate="animate",e.Hover="whileHover",e.Tap="whileTap",e.Drag="whileDrag",e.Focus="whileFocus",e.InView="whileInView",e.Exit="exit"})(hn||(hn={}));function Yb(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function $6(e,t,n,r){S.useEffect(()=>{const i=e.current;if(n&&i)return Yb(i,t,n,r)},[e,t,n,r])}function use({whileFocus:e,visualElement:t}){const{animationState:n}=t,r=()=>{n&&n.setActive(hn.Focus,!0)},i=()=>{n&&n.setActive(hn.Focus,!1)};$6(t,"focus",e?r:void 0),$6(t,"blur",e?i:void 0)}function eB(e){return typeof PointerEvent<"u"&&e instanceof PointerEvent?e.pointerType==="mouse":e instanceof MouseEvent}function tB(e){return!!e.touches}function cse(e){return t=>{const n=t instanceof MouseEvent;(!n||n&&t.button===0)&&e(t)}}const dse={pageX:0,pageY:0};function fse(e,t="page"){const r=e.touches[0]||e.changedTouches[0]||dse;return{x:r[t+"X"],y:r[t+"Y"]}}function hse(e,t="page"){return{x:e[t+"X"],y:e[t+"Y"]}}function s9(e,t="page"){return{point:tB(e)?fse(e,t):hse(e,t)}}const nB=(e,t=!1)=>{const n=r=>e(r,s9(r));return t?cse(n):n},pse=()=>Uc&&window.onpointerdown===null,mse=()=>Uc&&window.ontouchstart===null,gse=()=>Uc&&window.onmousedown===null,vse={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},yse={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function rB(e){return pse()?e:mse()?yse[e]:gse()?vse[e]:e}function Rf(e,t,n,r){return Yb(e,rB(t),nB(n,t==="pointerdown"),r)}function oy(e,t,n,r){return $6(e,rB(t),n&&nB(n,t==="pointerdown"),r)}function iB(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const BT=iB("dragHorizontal"),FT=iB("dragVertical");function oB(e){let t=!1;if(e==="y")t=FT();else if(e==="x")t=BT();else{const n=BT(),r=FT();n&&r?t=()=>{n(),r()}:(n&&n(),r&&r())}return t}function aB(){const e=oB(!0);return e?(e(),!1):!0}function zT(e,t,n){return(r,i)=>{!eB(r)||aB()||(e.animationState&&e.animationState.setActive(hn.Hover,t),n&&n(r,i))}}function bse({onHoverStart:e,onHoverEnd:t,whileHover:n,visualElement:r}){oy(r,"pointerenter",e||n?zT(r,!0,e):void 0,{passive:!e}),oy(r,"pointerleave",t||n?zT(r,!1,t):void 0,{passive:!t})}const sB=(e,t)=>t?e===t?!0:sB(e,t.parentElement):!1;function l9(e){return S.useEffect(()=>()=>e(),[])}function lB(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 i=0,r=Object.getOwnPropertySymbols(e);iMath.min(Math.max(n,e),t),CS=.001,wse=.01,jT=10,Cse=.05,xse=1;function _se({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let i,o;Sse(e<=jT*1e3);let a=1-t;a=sy(Cse,xse,a),e=sy(wse,jT,e/1e3),a<1?(i=u=>{const c=u*a,f=c*e,p=c-n,m=D6(u,a),g=Math.exp(-f);return CS-p/m*g},o=u=>{const f=u*a*e,p=f*n+n,m=Math.pow(a,2)*Math.pow(u,2)*e,g=Math.exp(-f),v=D6(Math.pow(u,2),a);return(-i(u)+CS>0?-1:1)*((p-m)*g)/v}):(i=u=>{const c=Math.exp(-u*e),f=(u-n)*e+1;return-CS+c*f},o=u=>{const c=Math.exp(-u*e),f=(n-u)*(e*e);return c*f});const s=5/e,l=Ese(i,o,s);if(e=e*1e3,isNaN(l))return{stiffness:100,damping:10,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:a*2*Math.sqrt(r*u),duration:e}}}const kse=12;function Ese(e,t,n){let r=n;for(let i=1;ie[n]!==void 0)}function Lse(e){let t=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},e);if(!HT(e,Tse)&&HT(e,Pse)){const n=_se(e);t=Object.assign(Object.assign(Object.assign({},t),n),{velocity:0,mass:1}),t.isResolvedFromDuration=!0}return t}function u9(e){var{from:t=0,to:n=1,restSpeed:r=2,restDelta:i}=e,o=lB(e,["from","to","restSpeed","restDelta"]);const a={done:!1,value:t};let{stiffness:s,damping:l,mass:u,velocity:c,duration:f,isResolvedFromDuration:p}=Lse(o),m=VT,g=VT;function v(){const x=c?-(c/1e3):0,C=n-t,w=l/(2*Math.sqrt(s*u)),k=Math.sqrt(s/u)/1e3;if(i===void 0&&(i=Math.min(Math.abs(n-t)/100,.4)),w<1){const P=D6(k,w);m=L=>{const A=Math.exp(-w*k*L);return n-A*((x+w*k*C)/P*Math.sin(P*L)+C*Math.cos(P*L))},g=L=>{const A=Math.exp(-w*k*L);return w*k*A*(Math.sin(P*L)*(x+w*k*C)/P+C*Math.cos(P*L))-A*(Math.cos(P*L)*(x+w*k*C)-P*C*Math.sin(P*L))}}else if(w===1)m=P=>n-Math.exp(-k*P)*(C+(x+k*C)*P);else{const P=k*Math.sqrt(w*w-1);m=L=>{const A=Math.exp(-w*k*L),O=Math.min(P*L,300);return n-A*((x+w*k*C)*Math.sinh(O)+P*C*Math.cosh(O))/P}}}return v(),{next:x=>{const C=m(x);if(p)a.done=x>=f;else{const w=g(x)*1e3,k=Math.abs(w)<=r,P=Math.abs(n-C)<=i;a.done=k&&P}return a.value=a.done?n:C,a},flipTarget:()=>{c=-c,[t,n]=[n,t],v()}}}u9.needsInterpolation=(e,t)=>typeof e=="string"||typeof t=="string";const VT=e=>0,gg=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},Kn=(e,t,n)=>-n*e+n*t+e;function xS(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function UT({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,o=0,a=0;if(!t)i=o=a=n;else{const s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;i=xS(l,s,e+1/3),o=xS(l,s,e),a=xS(l,s,e-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(a*255),alpha:r}}const Ase=(e,t,n)=>{const r=e*e,i=t*t;return Math.sqrt(Math.max(0,n*(i-r)+r))},Ose=[I6,$l,dc],WT=e=>Ose.find(t=>t.test(e)),uB=(e,t)=>{let n=WT(e),r=WT(t),i=n.parse(e),o=r.parse(t);n===dc&&(i=UT(i),n=$l),r===dc&&(o=UT(o),r=$l);const a=Object.assign({},i);return s=>{for(const l in a)l!=="alpha"&&(a[l]=Ase(i[l],o[l],s));return a.alpha=Kn(i.alpha,o.alpha,s),n.transform(a)}},N6=e=>typeof e=="number",Mse=(e,t)=>n=>t(e(n)),qb=(...e)=>e.reduce(Mse);function cB(e,t){return N6(e)?n=>Kn(e,t,n):si.test(e)?uB(e,t):fB(e,t)}const dB=(e,t)=>{const n=[...e],r=n.length,i=e.map((o,a)=>cB(o,t[a]));return o=>{for(let a=0;a{const n=Object.assign(Object.assign({},e),t),r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=cB(e[i],t[i]));return i=>{for(const o in r)n[o]=r[o](i);return n}};function GT(e){const t=Bs.parse(e),n=t.length;let r=0,i=0,o=0;for(let a=0;a{const n=Bs.createTransformer(t),r=GT(e),i=GT(t);return r.numHSL===i.numHSL&&r.numRGB===i.numRGB&&r.numNumbers>=i.numNumbers?qb(dB(r.parsed,i.parsed),n):a=>`${a>0?t:e}`},Rse=(e,t)=>n=>Kn(e,t,n);function $se(e){if(typeof e=="number")return Rse;if(typeof e=="string")return si.test(e)?uB:fB;if(Array.isArray(e))return dB;if(typeof e=="object")return Ise}function Dse(e,t,n){const r=[],i=n||$se(e[0]),o=e.length-1;for(let a=0;an(gg(e,t,r))}function Bse(e,t){const n=e.length,r=n-1;return i=>{let o=0,a=!1;if(i<=e[0]?a=!0:i>=e[r]&&(o=r-1,a=!0),!a){let l=1;for(;li||l===r);l++);o=l-1}const s=gg(e[o],e[o+1],i);return t[o](s)}}function hB(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const o=e.length;ay(o===t.length),ay(!r||!Array.isArray(r)||r.length===o-1),e[0]>e[o-1]&&(e=[].concat(e),t=[].concat(t),e.reverse(),t.reverse());const a=Dse(t,r,i),s=o===2?Nse(e,a):Bse(e,a);return n?l=>s(sy(e[0],e[o-1],l)):s}const Xb=e=>t=>1-e(1-t),c9=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Fse=e=>t=>Math.pow(t,e),pB=e=>t=>t*t*((e+1)*t-e),zse=e=>{const t=pB(e);return n=>(n*=2)<1?.5*t(n):.5*(2-Math.pow(2,-10*(n-1)))},mB=1.525,jse=4/11,Hse=8/11,Vse=9/10,d9=e=>e,f9=Fse(2),Use=Xb(f9),gB=c9(f9),vB=e=>1-Math.sin(Math.acos(e)),h9=Xb(vB),Wse=c9(h9),p9=pB(mB),Gse=Xb(p9),Kse=c9(p9),Yse=zse(mB),qse=4356/361,Xse=35442/1805,Zse=16061/1805,ly=e=>{if(e===1||e===0)return e;const t=e*e;return ee<.5?.5*(1-ly(1-e*2)):.5*ly(e*2-1)+.5;function ele(e,t){return e.map(()=>t||gB).splice(0,e.length-1)}function tle(e){const t=e.length;return e.map((n,r)=>r!==0?r/(t-1):0)}function nle(e,t){return e.map(n=>n*t)}function m2({from:e=0,to:t=1,ease:n,offset:r,duration:i=300}){const o={done:!1,value:e},a=Array.isArray(t)?t:[e,t],s=nle(r&&r.length===a.length?r:tle(a),i);function l(){return hB(s,a,{ease:Array.isArray(n)?n:ele(a,n)})}let u=l();return{next:c=>(o.value=u(c),o.done=c>=i,o),flipTarget:()=>{a.reverse(),u=l()}}}function rle({velocity:e=0,from:t=0,power:n=.8,timeConstant:r=350,restDelta:i=.5,modifyTarget:o}){const a={done:!1,value:t};let s=n*e;const l=t+s,u=o===void 0?l:o(l);return u!==l&&(s=u-t),{next:c=>{const f=-s*Math.exp(-c/r);return a.done=!(f>i||f<-i),a.value=a.done?u:u+f,a},flipTarget:()=>{}}}const KT={keyframes:m2,spring:u9,decay:rle};function ile(e){if(Array.isArray(e.to))return m2;if(KT[e.type])return KT[e.type];const t=new Set(Object.keys(e));return t.has("ease")||t.has("duration")&&!t.has("dampingRatio")?m2:t.has("dampingRatio")||t.has("stiffness")||t.has("mass")||t.has("damping")||t.has("restSpeed")||t.has("restDelta")?u9:m2}const yB=1/60*1e3,ole=typeof performance<"u"?()=>performance.now():()=>Date.now(),bB=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(ole()),yB);function ale(e){let t=[],n=[],r=0,i=!1,o=!1;const a=new WeakSet,s={schedule:(l,u=!1,c=!1)=>{const f=c&&i,p=f?t:n;return u&&a.add(l),p.indexOf(l)===-1&&(p.push(l),f&&i&&(r=t.length)),l},cancel:l=>{const u=n.indexOf(l);u!==-1&&n.splice(u,1),a.delete(l)},process:l=>{if(i){o=!0;return}if(i=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let u=0;u(e[t]=ale(()=>vg=!0),e),{}),lle=s1.reduce((e,t)=>{const n=Zb[t];return e[t]=(r,i=!1,o=!1)=>(vg||dle(),n.schedule(r,i,o)),e},{}),ule=s1.reduce((e,t)=>(e[t]=Zb[t].cancel,e),{});s1.reduce((e,t)=>(e[t]=()=>Zb[t].process($f),e),{});const cle=e=>Zb[e].process($f),SB=e=>{vg=!1,$f.delta=B6?yB:Math.max(Math.min(e-$f.timestamp,sle),1),$f.timestamp=e,F6=!0,s1.forEach(cle),F6=!1,vg&&(B6=!1,bB(SB))},dle=()=>{vg=!0,B6=!0,F6||bB(SB)},fle=()=>$f;function wB(e,t,n=0){return e-t-n}function hle(e,t,n=0,r=!0){return r?wB(t+-e,t,n):t-(e-t)+n}function ple(e,t,n,r){return r?e>=t+n:e<=-n}const mle=e=>{const t=({delta:n})=>e(n);return{start:()=>lle.update(t,!0),stop:()=>ule.update(t)}};function CB(e){var t,n,{from:r,autoplay:i=!0,driver:o=mle,elapsed:a=0,repeat:s=0,repeatType:l="loop",repeatDelay:u=0,onPlay:c,onStop:f,onComplete:p,onRepeat:m,onUpdate:g}=e,v=lB(e,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:x}=v,C,w=0,k=v.duration,P,L=!1,A=!0,O;const I=ile(v);!((n=(t=I).needsInterpolation)===null||n===void 0)&&n.call(t,r,x)&&(O=hB([0,100],[r,x],{clamp:!1}),r=0,x=100);const $=I(Object.assign(Object.assign({},v),{from:r,to:x}));function D(){w++,l==="reverse"?(A=w%2===0,a=hle(a,k,u,A)):(a=wB(a,k,u),l==="mirror"&&$.flipTarget()),L=!1,m&&m()}function V(){C.stop(),p&&p()}function Y(R){if(A||(R=-R),a+=R,!L){const N=$.next(Math.max(0,a));P=N.value,O&&(P=O(P)),L=A?N.done:a<=0}g==null||g(P),L&&(w===0&&(k!=null||(k=a)),w{f==null||f(),C.stop()}}}function xB(e,t){return t?e*(1e3/t):0}function gle({from:e=0,velocity:t=0,min:n,max:r,power:i=.8,timeConstant:o=750,bounceStiffness:a=500,bounceDamping:s=10,restDelta:l=1,modifyTarget:u,driver:c,onUpdate:f,onComplete:p,onStop:m}){let g;function v(k){return n!==void 0&&kr}function x(k){return n===void 0?r:r===void 0||Math.abs(n-k){var L;f==null||f(P),(L=k.onUpdate)===null||L===void 0||L.call(k,P)},onComplete:p,onStop:m}))}function w(k){C(Object.assign({type:"spring",stiffness:a,damping:s,restDelta:l},k))}if(v(e))w({from:e,velocity:t,to:x(e)});else{let k=i*t+e;typeof u<"u"&&(k=u(k));const P=x(k),L=P===n?-1:1;let A,O;const I=$=>{A=O,O=$,t=xB($-A,fle().delta),(L===1&&$>P||L===-1&&$g==null?void 0:g.stop()}}const z6=e=>e.hasOwnProperty("x")&&e.hasOwnProperty("y"),YT=e=>z6(e)&&e.hasOwnProperty("z"),Q0=(e,t)=>Math.abs(e-t);function m9(e,t){if(N6(e)&&N6(t))return Q0(e,t);if(z6(e)&&z6(t)){const n=Q0(e.x,t.x),r=Q0(e.y,t.y),i=YT(e)&&YT(t)?Q0(e.z,t.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(r,2)+Math.pow(i,2))}}const _B=(e,t)=>1-3*t+3*e,kB=(e,t)=>3*t-6*e,EB=e=>3*e,uy=(e,t,n)=>((_B(t,n)*e+kB(t,n))*e+EB(t))*e,PB=(e,t,n)=>3*_B(t,n)*e*e+2*kB(t,n)*e+EB(t),vle=1e-7,yle=10;function ble(e,t,n,r,i){let o,a,s=0;do a=t+(n-t)/2,o=uy(a,r,i)-e,o>0?n=a:t=a;while(Math.abs(o)>vle&&++s=wle?Cle(a,f,e,n):p===0?f:ble(a,s,s+J0,e,n)}return a=>a===0||a===1?a:uy(o(a),t,r)}function _le({onTap:e,onTapStart:t,onTapCancel:n,whileTap:r,visualElement:i}){const o=e||t||n||r,a=S.useRef(!1),s=S.useRef(null),l={passive:!(t||e||n||m)};function u(){s.current&&s.current(),s.current=null}function c(){return u(),a.current=!1,i.animationState&&i.animationState.setActive(hn.Tap,!1),!aB()}function f(g,v){c()&&(sB(i.current,g.target)?e&&e(g,v):n&&n(g,v))}function p(g,v){c()&&n&&n(g,v)}function m(g,v){u(),!a.current&&(a.current=!0,s.current=qb(Rf(window,"pointerup",f,l),Rf(window,"pointercancel",p,l)),i.animationState&&i.animationState.setActive(hn.Tap,!0),t&&t(g,v))}oy(i,"pointerdown",o?m:void 0,l),l9(u)}const kle="production",TB=typeof process>"u"||process.env===void 0?kle:"production",qT=new Set;function LB(e,t,n){e||qT.has(t)||(console.warn(t),n&&console.warn(n),qT.add(t))}const j6=new WeakMap,_S=new WeakMap,Ele=e=>{const t=j6.get(e.target);t&&t(e)},Ple=e=>{e.forEach(Ele)};function Tle({root:e,...t}){const n=e||document;_S.has(n)||_S.set(n,{});const r=_S.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Ple,{root:e,...t})),r[i]}function Lle(e,t,n){const r=Tle(t);return j6.set(e,n),r.observe(e),()=>{j6.delete(e),r.unobserve(e)}}function Ale({visualElement:e,whileInView:t,onViewportEnter:n,onViewportLeave:r,viewport:i={}}){const o=S.useRef({hasEnteredView:!1,isInView:!1});let a=Boolean(t||n||r);i.once&&o.current.hasEnteredView&&(a=!1),(typeof IntersectionObserver>"u"?Ile:Mle)(a,o.current,e,i)}const Ole={some:0,all:1};function Mle(e,t,n,{root:r,margin:i,amount:o="some",once:a}){S.useEffect(()=>{if(!e||!n.current)return;const s={root:r==null?void 0:r.current,rootMargin:i,threshold:typeof o=="number"?o:Ole[o]},l=u=>{const{isIntersecting:c}=u;if(t.isInView===c||(t.isInView=c,a&&!c&&t.hasEnteredView))return;c&&(t.hasEnteredView=!0),n.animationState&&n.animationState.setActive(hn.InView,c);const f=n.getProps(),p=c?f.onViewportEnter:f.onViewportLeave;p&&p(u)};return Lle(n.current,s,l)},[e,r,i,o])}function Ile(e,t,n,{fallback:r=!0}){S.useEffect(()=>{!e||!r||(TB!=="production"&&LB(!1,"IntersectionObserver not available on this device. whileInView animations will trigger on mount."),requestAnimationFrame(()=>{t.hasEnteredView=!0;const{onViewportEnter:i}=n.getProps();i&&i(null),n.animationState&&n.animationState.setActive(hn.InView,!0)}))},[e])}const Dl=e=>t=>(e(t),null),Rle={inView:Dl(Ale),tap:Dl(_le),focus:Dl(use),hover:Dl(bse)};function g9(){const e=S.useContext(Ah);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,i=S.useId();return S.useEffect(()=>r(i),[]),!t&&n?[!1,()=>n&&n(i)]:[!0]}function $le(){return Dle(S.useContext(Ah))}function Dle(e){return e===null?!0:e.isPresent}function AB(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;re*1e3,Nle={linear:d9,easeIn:f9,easeInOut:gB,easeOut:Use,circIn:vB,circInOut:Wse,circOut:h9,backIn:p9,backInOut:Kse,backOut:Gse,anticipate:Yse,bounceIn:Qse,bounceInOut:Jse,bounceOut:ly},XT=e=>{if(Array.isArray(e)){ay(e.length===4);const[t,n,r,i]=e;return xle(t,n,r,i)}else if(typeof e=="string")return Nle[e];return e},Ble=e=>Array.isArray(e)&&typeof e[0]!="number",ZT=(e,t)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&Bs.test(t)&&!t.startsWith("url(")),Uu=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),ev=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),kS=()=>({type:"keyframes",ease:"linear",duration:.3}),Fle=e=>({type:"keyframes",duration:.8,values:e}),QT={x:Uu,y:Uu,z:Uu,rotate:Uu,rotateX:Uu,rotateY:Uu,rotateZ:Uu,scaleX:ev,scaleY:ev,scale:ev,opacity:kS,backgroundColor:kS,color:kS,default:ev},zle=(e,t)=>{let n;return mg(t)?n=Fle:n=QT[e]||QT.default,{to:t,...n(t)}},jle={...VN,color:si,backgroundColor:si,outlineColor:si,fill:si,stroke:si,borderColor:si,borderTopColor:si,borderRightColor:si,borderBottomColor:si,borderLeftColor:si,filter:R6,WebkitFilter:R6},v9=e=>jle[e];function y9(e,t){var n;let r=v9(e);return r!==R6&&(r=Bs),(n=r.getAnimatableNone)===null||n===void 0?void 0:n.call(r,t)}const Hle={current:!1},OB=1/60*1e3,Vle=typeof performance<"u"?()=>performance.now():()=>Date.now(),MB=typeof window<"u"?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(Vle()),OB);function Ule(e){let t=[],n=[],r=0,i=!1,o=!1;const a=new WeakSet,s={schedule:(l,u=!1,c=!1)=>{const f=c&&i,p=f?t:n;return u&&a.add(l),p.indexOf(l)===-1&&(p.push(l),f&&i&&(r=t.length)),l},cancel:l=>{const u=n.indexOf(l);u!==-1&&n.splice(u,1),a.delete(l)},process:l=>{if(i){o=!0;return}if(i=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let u=0;u(e[t]=Ule(()=>yg=!0),e),{}),na=l1.reduce((e,t)=>{const n=Qb[t];return e[t]=(r,i=!1,o=!1)=>(yg||Kle(),n.schedule(r,i,o)),e},{}),Oc=l1.reduce((e,t)=>(e[t]=Qb[t].cancel,e),{}),ES=l1.reduce((e,t)=>(e[t]=()=>Qb[t].process(Df),e),{}),Gle=e=>Qb[e].process(Df),IB=e=>{yg=!1,Df.delta=H6?OB:Math.max(Math.min(e-Df.timestamp,Wle),1),Df.timestamp=e,V6=!0,l1.forEach(Gle),V6=!1,yg&&(H6=!1,MB(IB))},Kle=()=>{yg=!0,H6=!0,V6||MB(IB)},U6=()=>Df;function RB(e,t){const n=performance.now(),r=({timestamp:i})=>{const o=i-n;o>=t&&(Oc.read(r),e(o-t))};return na.read(r,!0),()=>Oc.read(r)}function Yle({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:o,repeatType:a,repeatDelay:s,from:l,...u}){return!!Object.keys(u).length}function qle({ease:e,times:t,yoyo:n,flip:r,loop:i,...o}){const a={...o};return t&&(a.offset=t),o.duration&&(a.duration=cy(o.duration)),o.repeatDelay&&(a.repeatDelay=cy(o.repeatDelay)),e&&(a.ease=Ble(e)?e.map(XT):XT(e)),o.type==="tween"&&(a.type="keyframes"),(n||i||r)&&(n?a.repeatType="reverse":i?a.repeatType="loop":r&&(a.repeatType="mirror"),a.repeat=i||n||r||o.repeat),o.type!=="spring"&&(a.type="keyframes"),a}function Xle(e,t){var n,r;return(r=(n=(b9(e,t)||{}).delay)!==null&&n!==void 0?n:e.delay)!==null&&r!==void 0?r:0}function Zle(e){return Array.isArray(e.to)&&e.to[0]===null&&(e.to=[...e.to],e.to[0]=e.from),e}function Qle(e,t,n){return Array.isArray(t.to)&&e.duration===void 0&&(e.duration=.8),Zle(t),Yle(e)||(e={...e,...zle(n,t.to)}),{...t,...qle(e)}}function Jle(e,t,n,r,i){const o=b9(r,e)||{};let a=o.from!==void 0?o.from:t.get();const s=ZT(e,n);a==="none"&&s&&typeof n=="string"?a=y9(e,n):JT(a)&&typeof n=="string"?a=eL(n):!Array.isArray(n)&&JT(n)&&typeof a=="string"&&(n=eL(a));const l=ZT(e,a);function u(){const f={from:a,to:n,velocity:t.getVelocity(),onComplete:i,onUpdate:p=>t.set(p)};return o.type==="inertia"||o.type==="decay"?gle({...f,...o}):CB({...Qle(o,f,e),onUpdate:p=>{f.onUpdate(p),o.onUpdate&&o.onUpdate(p)},onComplete:()=>{f.onComplete(),o.onComplete&&o.onComplete()}})}function c(){const f=QN(n);return t.set(f),i(),o.onUpdate&&o.onUpdate(f),o.onComplete&&o.onComplete(),{stop:()=>{}}}return!l||!s||o.type===!1?c:u}function JT(e){return e===0||typeof e=="string"&&parseFloat(e)===0&&e.indexOf(" ")===-1}function eL(e){return typeof e=="number"?0:y9("",e)}function b9(e,t){return e[t]||e.default||e}function S9(e,t,n,r={}){return Hle.current&&(r={type:!1}),t.start(i=>{let o;const a=Jle(e,t,n,r,i),s=Xle(r,e),l=()=>o=a();let u;return s?u=RB(l,cy(s)):l(),()=>{u&&u(),o&&o.stop()}})}const eue=e=>/^\-?\d*\.?\d+$/.test(e),tue=e=>/^0[^.\s]+$/.test(e);function w9(e,t){e.indexOf(t)===-1&&e.push(t)}function C9(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Mm{constructor(){this.subscriptions=[]}add(t){return w9(this.subscriptions,t),()=>C9(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let o=0;o!isNaN(parseFloat(e));class rue{constructor(t){this.version="7.6.9",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new Mm,this.velocityUpdateSubscribers=new Mm,this.renderSubscribers=new Mm,this.canTrackVelocity=!1,this.updateAndNotify=(n,r=!0)=>{this.prev=this.current,this.current=n;const{delta:i,timestamp:o}=U6();this.lastUpdated!==o&&(this.timeDelta=i,this.lastUpdated=o,na.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.updateSubscribers.notify(this.current),this.velocityUpdateSubscribers.getSize()&&this.velocityUpdateSubscribers.notify(this.getVelocity()),r&&this.renderSubscribers.notify(this.current)},this.scheduleVelocityCheck=()=>na.postRender(this.velocityCheck),this.velocityCheck=({timestamp:n})=>{n!==this.lastUpdated&&(this.prev=this.current,this.velocityUpdateSubscribers.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=nue(this.current)}onChange(t){return this.updateSubscribers.add(t)}clearListeners(){this.updateSubscribers.clear()}onRenderRequest(t){return t(this.get()),this.renderSubscribers.add(t)}attach(t){this.passiveEffect=t}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?xB(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.stopAnimation=t(n)}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()}}function rh(e){return new rue(e)}const $B=e=>t=>t.test(e),iue={test:e=>e==="auto",parse:e=>e},DB=[Wc,ut,Ga,xl,Mae,Oae,iue],Op=e=>DB.find($B(e)),oue=[...DB,si,Bs],aue=e=>oue.find($B(e));function sue(e){const t={};return e.values.forEach((n,r)=>t[r]=n.get()),t}function lue(e){const t={};return e.values.forEach((n,r)=>t[r]=n.getVelocity()),t}function Jb(e,t,n){const r=e.getProps();return a9(r,t,n!==void 0?n:r.custom,sue(e),lue(e))}function uue(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,rh(n))}function cue(e,t){const n=Jb(e,t);let{transitionEnd:r={},transition:i={},...o}=n?e.makeTargetAnimatable(n,!1):{};o={...o,...r};for(const a in o){const s=QN(o[a]);uue(e,a,s)}}function due(e,t,n){var r,i;const o=Object.keys(t).filter(s=>!e.hasValue(s)),a=o.length;if(a)for(let s=0;sW6(e,o,n));r=Promise.all(i)}else if(typeof t=="string")r=W6(e,t,n);else{const i=typeof t=="function"?Jb(e,t,n.custom):t;r=NB(e,i,n)}return r.then(()=>e.notify("AnimationComplete",t))}function W6(e,t,n={}){var r;const i=Jb(e,t,n.custom);let{transition:o=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(o=n.transitionOverride);const a=i?()=>NB(e,i,n):()=>Promise.resolve(),s=!((r=e.variantChildren)===null||r===void 0)&&r.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:f,staggerDirection:p}=o;return mue(e,t,c+u,f,p,n)}:()=>Promise.resolve(),{when:l}=o;if(l){const[u,c]=l==="beforeChildren"?[a,s]:[s,a];return u().then(c)}else return Promise.all([a(),s(n.delay)])}function NB(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var o;let{transition:a=e.getDefaultTransition(),transitionEnd:s,...l}=e.makeTargetAnimatable(t);const u=e.getValue("willChange");r&&(a=r);const c=[],f=i&&((o=e.animationState)===null||o===void 0?void 0:o.getState()[i]);for(const p in l){const m=e.getValue(p),g=l[p];if(!m||g===void 0||f&&vue(f,p))continue;let v={delay:n,...a};e.shouldReduceMotion&&Oh.has(p)&&(v={...v,type:!1,delay:0});let x=S9(p,m,g,v);dy(u)&&(u.add(p),x=x.then(()=>u.remove(p))),c.push(x)}return Promise.all(c).then(()=>{s&&cue(e,s)})}function mue(e,t,n=0,r=0,i=1,o){const a=[],s=(e.variantChildren.size-1)*r,l=i===1?(u=0)=>u*r:(u=0)=>s-u*r;return Array.from(e.variantChildren).sort(gue).forEach((u,c)=>{a.push(W6(u,t,{...o,delay:n+l(c)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function gue(e,t){return e.sortNodePosition(t)}function vue({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}const x9=[hn.Animate,hn.InView,hn.Focus,hn.Hover,hn.Tap,hn.Drag,hn.Exit],yue=[...x9].reverse(),bue=x9.length;function Sue(e){return t=>Promise.all(t.map(({animation:n,options:r})=>pue(e,n,r)))}function wue(e){let t=Sue(e);const n=xue();let r=!0;const i=(l,u)=>{const c=Jb(e,u);if(c){const{transition:f,transitionEnd:p,...m}=c;l={...l,...m,...p}}return l};function o(l){t=l(e)}function a(l,u){var c;const f=e.getProps(),p=e.getVariantContext(!0)||{},m=[],g=new Set;let v={},x=1/0;for(let w=0;wx&&A;const V=Array.isArray(L)?L:[L];let Y=V.reduce(i,{});O===!1&&(Y={});const{prevResolvedValues:z={}}=P,R={...z,...Y},N=U=>{D=!0,g.delete(U),P.needsAnimating[U]=!0};for(const U in R){const G=Y[U],B=z[U];v.hasOwnProperty(U)||(G!==B?mg(G)&&mg(B)?!AB(G,B)||$?N(U):P.protectedKeys[U]=!0:G!==void 0?N(U):g.add(U):G!==void 0&&g.has(U)?N(U):P.protectedKeys[U]=!0)}P.prevProp=L,P.prevResolvedValues=Y,P.isActive&&(v={...v,...Y}),r&&e.blockInitialAnimation&&(D=!1),D&&!I&&m.push(...V.map(U=>({animation:U,options:{type:k,...l}})))}if(g.size){const w={};g.forEach(k=>{const P=e.getBaseTarget(k);P!==void 0&&(w[k]=P)}),m.push({animation:w})}let C=Boolean(m.length);return r&&f.initial===!1&&!e.manuallyAnimateOnMount&&(C=!1),r=!1,C?t(m):Promise.resolve()}function s(l,u,c){var f;if(n[l].isActive===u)return Promise.resolve();(f=e.variantChildren)===null||f===void 0||f.forEach(m=>{var g;return(g=m.animationState)===null||g===void 0?void 0:g.setActive(l,u)}),n[l].isActive=u;const p=a(c,l);for(const m in n)n[m].protectedKeys={};return p}return{animateChanges:a,setActive:s,setAnimateFunction:o,getState:()=>n}}function Cue(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!AB(t,e):!1}function Wu(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function xue(){return{[hn.Animate]:Wu(!0),[hn.InView]:Wu(),[hn.Hover]:Wu(),[hn.Tap]:Wu(),[hn.Drag]:Wu(),[hn.Focus]:Wu(),[hn.Exit]:Wu()}}const _ue={animation:Dl(({visualElement:e,animate:t})=>{e.animationState||(e.animationState=wue(e)),Wb(t)&&S.useEffect(()=>t.subscribe(e),[t])}),exit:Dl(e=>{const{custom:t,visualElement:n}=e,[r,i]=g9(),o=S.useContext(Ah);S.useEffect(()=>{n.isPresent=r;const a=n.animationState&&n.animationState.setActive(hn.Exit,!r,{custom:o&&o.custom||t});a&&!r&&a.then(i)},[r])})};class BB{constructor(t,n,{transformPagePoint:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=TS(this.lastMoveEventInfo,this.history),c=this.startEvent!==null,f=m9(u.offset,{x:0,y:0})>=3;if(!c&&!f)return;const{point:p}=u,{timestamp:m}=U6();this.history.push({...p,timestamp:m});const{onStart:g,onMove:v}=this.handlers;c||(g&&g(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,u)},this.handlePointerMove=(u,c)=>{if(this.lastMoveEvent=u,this.lastMoveEventInfo=PS(c,this.transformPagePoint),eB(u)&&u.buttons===0){this.handlePointerUp(u,c);return}na.update(this.updatePoint,!0)},this.handlePointerUp=(u,c)=>{this.end();const{onEnd:f,onSessionEnd:p}=this.handlers,m=TS(PS(c,this.transformPagePoint),this.history);this.startEvent&&f&&f(u,m),p&&p(u,m)},tB(t)&&t.touches.length>1)return;this.handlers=n,this.transformPagePoint=r;const i=s9(t),o=PS(i,this.transformPagePoint),{point:a}=o,{timestamp:s}=U6();this.history=[{...a,timestamp:s}];const{onSessionStart:l}=n;l&&l(t,TS(o,this.history)),this.removeListeners=qb(Rf(window,"pointermove",this.handlePointerMove),Rf(window,"pointerup",this.handlePointerUp),Rf(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Oc.update(this.updatePoint)}}function PS(e,t){return t?{point:t(e.point)}:e}function tL(e,t){return{x:e.x-t.x,y:e.y-t.y}}function TS({point:e},t){return{point:e,delta:tL(e,FB(t)),offset:tL(e,kue(t)),velocity:Eue(t,.1)}}function kue(e){return e[0]}function FB(e){return e[e.length-1]}function Eue(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=FB(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>cy(t)));)n--;if(!r)return{x:0,y:0};const o=(i.timestamp-r.timestamp)/1e3;if(o===0)return{x:0,y:0};const a={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function Yi(e){return e.max-e.min}function nL(e,t=0,n=.01){return m9(e,t)n&&(e=r?Kn(n,e,r.max):Math.min(e,n)),e}function aL(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function Lue(e,{top:t,left:n,bottom:r,right:i}){return{x:aL(e.x,n,i),y:aL(e.y,t,r)}}function sL(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=gg(t.min,t.max-r,e.min):r>i&&(n=gg(e.min,e.max-i,t.min)),sy(0,1,n)}function Mue(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const G6=.35;function Iue(e=G6){return e===!1?e=0:e===!0&&(e=G6),{x:lL(e,"left","right"),y:lL(e,"top","bottom")}}function lL(e,t,n){return{min:uL(e,t),max:uL(e,n)}}function uL(e,t){var n;return typeof e=="number"?e:(n=e[t])!==null&&n!==void 0?n:0}const cL=()=>({translate:0,scale:1,origin:0,originPoint:0}),$m=()=>({x:cL(),y:cL()}),dL=()=>({min:0,max:0}),cr=()=>({x:dL(),y:dL()});function Aa(e){return[e("x"),e("y")]}function zB({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Rue({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function $ue(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function LS(e){return e===void 0||e===1}function K6({scale:e,scaleX:t,scaleY:n}){return!LS(e)||!LS(t)||!LS(n)}function Zu(e){return K6(e)||jB(e)||e.z||e.rotate||e.rotateX||e.rotateY}function jB(e){return fL(e.x)||fL(e.y)}function fL(e){return e&&e!=="0%"}function fy(e,t,n){const r=e-n,i=t*r;return n+i}function hL(e,t,n,r,i){return i!==void 0&&(e=fy(e,i,r)),fy(e,n,r)+t}function Y6(e,t=0,n=1,r,i){e.min=hL(e.min,t,n,r,i),e.max=hL(e.max,t,n,r,i)}function HB(e,{x:t,y:n}){Y6(e.x,t.translate,t.scale,t.originPoint),Y6(e.y,n.translate,n.scale,n.originPoint)}function Due(e,t,n,r=!1){var i,o;const a=n.length;if(!a)return;t.x=t.y=1;let s,l;for(let u=0;u{this.stopAnimation(),n&&this.snapToCursor(s9(s,"page").point)},i=(s,l)=>{var u;const{drag:c,dragPropagation:f,onDragStart:p}=this.getProps();c&&!f&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=oB(c),!this.openGlobalLock)||(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Aa(m=>{var g,v;let x=this.getAxisMotionValue(m).get()||0;if(Ga.test(x)){const C=(v=(g=this.visualElement.projection)===null||g===void 0?void 0:g.layout)===null||v===void 0?void 0:v.layoutBox[m];C&&(x=Yi(C)*(parseFloat(x)/100))}this.originPoint[m]=x}),p==null||p(s,l),(u=this.visualElement.animationState)===null||u===void 0||u.setActive(hn.Drag,!0))},o=(s,l)=>{const{dragPropagation:u,dragDirectionLock:c,onDirectionLock:f,onDrag:p}=this.getProps();if(!u&&!this.openGlobalLock)return;const{offset:m}=l;if(c&&this.currentDirection===null){this.currentDirection=Hue(m),this.currentDirection!==null&&(f==null||f(this.currentDirection));return}this.updateAxis("x",l.point,m),this.updateAxis("y",l.point,m),this.visualElement.render(),p==null||p(s,l)},a=(s,l)=>this.stop(s,l);this.panSession=new BB(t,{onSessionStart:r,onStart:i,onMove:o,onSessionEnd:a},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:o}=this.getProps();o==null||o(t,n)}cancel(){var t,n;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),(t=this.panSession)===null||t===void 0||t.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),(n=this.visualElement.animationState)===null||n===void 0||n.setActive(hn.Drag,!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!tv(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=Tue(a,this.constraints[t],this.elastic[t])),o.set(a)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),{layout:r}=this.visualElement.projection||{},i=this.constraints;t&&tf(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=Lue(r.layoutBox,t):this.constraints=!1,this.elastic=Iue(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Aa(o=>{this.getAxisMotionValue(o)&&(this.constraints[o]=Mue(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!tf(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=Fue(r,i.root,this.visualElement.getTransformPagePoint());let a=Aue(i.layout.layoutBox,o);if(n){const s=n(Rue(a));this.hasMutatedConstraints=!!s,s&&(a=zB(s))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:o,dragSnapToOrigin:a,onDragTransitionEnd:s}=this.getProps(),l=this.constraints||{},u=Aa(c=>{var f;if(!tv(c,n,this.currentDirection))return;let p=(f=l==null?void 0:l[c])!==null&&f!==void 0?f:{};a&&(p={min:0,max:0});const m=i?200:1e6,g=i?40:1e7,v={type:"inertia",velocity:r?t[c]:0,bounceStiffness:m,bounceDamping:g,timeConstant:750,restDelta:1,restSpeed:10,...o,...p};return this.startAxisValueAnimation(c,v)});return Promise.all(u).then(s)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return S9(t,r,0,n)}stopAnimation(){Aa(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){var n,r;const i="_drag"+t.toUpperCase(),o=this.visualElement.getProps()[i];return o||this.visualElement.getValue(t,(r=(n=this.visualElement.getProps().initial)===null||n===void 0?void 0:n[t])!==null&&r!==void 0?r:0)}snapToCursor(t){Aa(n=>{const{drag:r}=this.getProps();if(!tv(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:a,max:s}=i.layout.layoutBox[n];o.set(t[n]-Kn(a,s,.5))}})}scalePositionWithinConstraints(){var t;if(!this.visualElement.current)return;const{drag:n,dragConstraints:r}=this.getProps(),{projection:i}=this.visualElement;if(!tf(r)||!i||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Aa(s=>{const l=this.getAxisMotionValue(s);if(l){const u=l.get();o[s]=Oue({min:u,max:u},this.constraints[s])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",(t=i.root)===null||t===void 0||t.updateScroll(),i.updateLayout(),this.resolveConstraints(),Aa(s=>{if(!tv(s,n,null))return;const l=this.getAxisMotionValue(s),{min:u,max:c}=this.constraints[s];l.set(Kn(u,c,o[s]))})}addListeners(){var t;if(!this.visualElement.current)return;zue.set(this.visualElement,this);const n=this.visualElement.current,r=Rf(n,"pointerdown",u=>{const{drag:c,dragListener:f=!0}=this.getProps();c&&f&&this.start(u)}),i=()=>{const{dragConstraints:u}=this.getProps();tf(u)&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,a=o.addEventListener("measure",i);o&&!o.layout&&((t=o.root)===null||t===void 0||t.updateScroll(),o.updateLayout()),i();const s=Yb(window,"resize",()=>this.scalePositionWithinConstraints()),l=o.addEventListener("didUpdate",({delta:u,hasLayoutChanged:c})=>{this.isDragging&&c&&(Aa(f=>{const p=this.getAxisMotionValue(f);p&&(this.originPoint[f]+=u[f].translate,p.set(p.get()+u[f].translate))}),this.visualElement.render())});return()=>{s(),r(),a(),l==null||l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:a=G6,dragMomentum:s=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:o,dragElastic:a,dragMomentum:s}}}function tv(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Hue(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}function Vue(e){const{dragControls:t,visualElement:n}=e,r=Kb(()=>new jue(n));S.useEffect(()=>t&&t.subscribe(r),[r,t]),S.useEffect(()=>r.addListeners(),[r])}function Uue({onPan:e,onPanStart:t,onPanEnd:n,onPanSessionStart:r,visualElement:i}){const o=e||t||n||r,a=S.useRef(null),{transformPagePoint:s}=S.useContext(Q7),l={onSessionStart:r,onStart:t,onMove:e,onEnd:(c,f)=>{a.current=null,n&&n(c,f)}};S.useEffect(()=>{a.current!==null&&a.current.updateHandlers(l)});function u(c){a.current=new BB(c,l,{transformPagePoint:s})}oy(i,"pointerdown",o&&u),l9(()=>a.current&&a.current.end())}const Wue={pan:Dl(Uue),drag:Dl(Vue)};function q6(e){return typeof e=="string"&&e.startsWith("var(--")}const UB=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Gue(e){const t=UB.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]}function X6(e,t,n=1){const[r,i]=Gue(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);return o?o.trim():q6(i)?X6(i,t,n+1):i}function Kue(e,{...t},n){const r=e.current;if(!(r instanceof Element))return{target:t,transitionEnd:n};n&&(n={...n}),e.values.forEach(i=>{const o=i.get();if(!q6(o))return;const a=X6(o,r);a&&i.set(a)});for(const i in t){const o=t[i];if(!q6(o))continue;const a=X6(o,r);a&&(t[i]=a,n&&n[i]===void 0&&(n[i]=o))}return{target:t,transitionEnd:n}}const Yue=new Set(["width","height","top","left","right","bottom","x","y"]),WB=e=>Yue.has(e),que=e=>Object.keys(e).some(WB),GB=(e,t)=>{e.set(t,!1),e.set(t)},mL=e=>e===Wc||e===ut;var gL;(function(e){e.width="width",e.height="height",e.left="left",e.right="right",e.top="top",e.bottom="bottom"})(gL||(gL={}));const vL=(e,t)=>parseFloat(e.split(", ")[t]),yL=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/);if(i)return vL(i[1],t);{const o=r.match(/^matrix\((.+)\)$/);return o?vL(o[1],e):0}},Xue=new Set(["x","y","z"]),Zue=ry.filter(e=>!Xue.has(e));function Que(e){const t=[];return Zue.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t.length&&e.render(),t}const bL={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:yL(4,13),y:yL(5,14)},Jue=(e,t,n)=>{const r=t.measureViewportBox(),i=t.current,o=getComputedStyle(i),{display:a}=o,s={};a==="none"&&t.setStaticValue("display",e.display||"block"),n.forEach(u=>{s[u]=bL[u](r,o)}),t.render();const l=t.measureViewportBox();return n.forEach(u=>{const c=t.getValue(u);GB(c,s[u]),e[u]=bL[u](l,o)}),e},ece=(e,t,n={},r={})=>{t={...t},r={...r};const i=Object.keys(t).filter(WB);let o=[],a=!1;const s=[];if(i.forEach(l=>{const u=e.getValue(l);if(!e.hasValue(l))return;let c=n[l],f=Op(c);const p=t[l];let m;if(mg(p)){const g=p.length,v=p[0]===null?1:0;c=p[v],f=Op(c);for(let x=v;x=0?window.pageYOffset:null,u=Jue(t,e,s);return o.length&&o.forEach(([c,f])=>{e.getValue(c).set(f)}),e.render(),Uc&&l!==null&&window.scrollTo({top:l}),{target:u,transitionEnd:r}}else return{target:t,transitionEnd:r}};function tce(e,t,n,r){return que(t)?ece(e,t,n,r):{target:t,transitionEnd:r}}const nce=(e,t,n,r)=>{const i=Kue(e,t,r);return t=i.target,r=i.transitionEnd,tce(e,t,n,r)},Z6={current:null},KB={current:!1};function rce(){if(KB.current=!0,!!Uc)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Z6.current=e.matches;e.addListener(t),t()}else Z6.current=!1}function ice(e,t,n){const{willChange:r}=t;for(const i in t){const o=t[i],a=n[i];if(ts(o))e.addValue(i,o),dy(r)&&r.add(i);else if(ts(a))e.addValue(i,rh(o)),dy(r)&&r.remove(i);else if(a!==o)if(e.hasValue(i)){const s=e.getValue(i);!s.hasAnimated&&s.set(o)}else{const s=e.getStaticValue(i);e.addValue(i,rh(s!==void 0?s:o))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const YB=Object.keys(hg),oce=YB.length,SL=["AnimationStart","AnimationComplete","Update","Unmount","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class ace{constructor({parent:t,props:n,reducedMotionConfig:r,visualState:i},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.isPresent=!0,this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>na.render(this.render,!1,!0);const{latestValues:a,renderState:s}=i;this.latestValues=a,this.baseTarget={...a},this.initialValues=n.initial?{...a}:{},this.renderState=s,this.parent=t,this.props=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=r,this.options=o,this.isControllingVariants=Gb(n),this.isVariantNode=MN(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:l,...u}=this.scrapeMotionValuesFromProps(n);for(const c in u){const f=u[c];a[c]!==void 0&&ts(f)&&(f.set(a[c],!1),dy(l)&&l.add(c))}}scrapeMotionValuesFromProps(t){return{}}mount(t){var n;this.current=t,this.projection&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=(n=this.parent)===null||n===void 0?void 0:n.addVariantChild(this)),this.values.forEach((r,i)=>this.bindToMotionValue(i,r)),KB.current||rce(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Z6.current,this.parent&&this.parent.children.add(this),this.setProps(this.props)}unmount(){var t,n,r;(t=this.projection)===null||t===void 0||t.unmount(),Oc.update(this.notifyUpdate),Oc.render(this.render),this.valueSubscriptions.forEach(i=>i()),(n=this.removeFromVariantTree)===null||n===void 0||n.call(this),(r=this.parent)===null||r===void 0||r.children.delete(this);for(const i in this.events)this.events[i].clear();this.current=null}bindToMotionValue(t,n){const r=Oh.has(t),i=n.onChange(a=>{this.latestValues[t]=a,this.props.onUpdate&&na.update(this.notifyUpdate,!1,!0),r&&this.projection&&(this.projection.isProjectionDirty=!0)}),o=n.onRenderRequest(this.scheduleRender);this.valueSubscriptions.set(t,()=>{i(),o()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}loadFeatures(t,n,r,i,o,a){const s=[];for(let l=0;lthis.scheduleRender(),animationType:typeof u=="string"?u:"both",initialPromotionConfig:a,layoutScroll:p})}return s}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):cr()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}makeTargetAnimatable(t,n=!0){return this.makeTargetAnimatableFromInstance(t,this.props,n)}setProps(t){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.props=t;for(let n=0;nr.variantChildren.delete(t)}addValue(t,n){this.hasValue(t)&&this.removeValue(t),this.values.set(t,n),this.latestValues[t]=n.get(),this.bindToMotionValue(t,n)}removeValue(t){var n;this.values.delete(t),(n=this.valueSubscriptions.get(t))===null||n===void 0||n(),this.valueSubscriptions.delete(t),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=rh(n),this.addValue(t,r)),r}readValue(t){return this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.readValueFromInstance(this.current,t,this.options)}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props,i=typeof r=="string"||typeof r=="object"?(n=a9(this.props,r))===null||n===void 0?void 0:n[t]:void 0;if(r&&i!==void 0)return i;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!ts(o)?o:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Mm),this.events[t].add(n)}notify(t,...n){var r;(r=this.events[t])===null||r===void 0||r.notify(...n)}}const qB=["initial",...x9],sce=qB.length;class XB extends ace{sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){var r;return(r=t.style)===null||r===void 0?void 0:r[n]}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:n,...r},{transformValues:i},o){let a=hue(r,t||{},this);if(i&&(n&&(n=i(n)),r&&(r=i(r)),a&&(a=i(a))),o){due(this,r,a);const s=nce(this,r,a,n);n=s.transitionEnd,r=s.target}return{transition:t,transitionEnd:n,...r}}}function lce(e){return window.getComputedStyle(e)}class uce extends XB{readValueFromInstance(t,n){if(Oh.has(n)){const r=v9(n);return r&&r.default||0}else{const r=lce(t),i=($N(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return VB(t,n)}build(t,n,r,i){n9(t,n,r,i.transformTemplate)}scrapeMotionValuesFromProps(t){return o9(t)}renderInstance(t,n,r,i){YN(t,n,r,i)}}class cce extends XB{getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){var r;return Oh.has(n)?((r=v9(n))===null||r===void 0?void 0:r.default)||0:(n=qN.has(n)?n:KN(n),t.getAttribute(n))}measureInstanceViewportBox(){return cr()}scrapeMotionValuesFromProps(t){return ZN(t)}build(t,n,r,i){i9(t,n,r,i.transformTemplate)}renderInstance(t,n,r,i){XN(t,n,r,i)}}const dce=(e,t)=>e9(e)?new cce(t,{enableHardwareAcceleration:!1}):new uce(t,{enableHardwareAcceleration:!0});function wL(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Mp={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ut.test(e))e=parseFloat(e);else return e;const n=wL(e,t.target.x),r=wL(e,t.target.y);return`${n}% ${r}%`}},CL="_$css",fce={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=e.includes("var("),o=[];i&&(e=e.replace(UB,m=>(o.push(m),CL)));const a=Bs.parse(e);if(a.length>5)return r;const s=Bs.createTransformer(e),l=typeof a[0]!="number"?1:0,u=n.x.scale*t.x,c=n.y.scale*t.y;a[0+l]/=u,a[1+l]/=c;const f=Kn(u,c,.5);typeof a[2+l]=="number"&&(a[2+l]/=f),typeof a[3+l]=="number"&&(a[3+l]/=f);let p=s(a);if(i){let m=0;p=p.replace(CL,()=>{const g=o[m];return m++,g})}return p}};class hce extends M.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:o}=t;kae(mce),o&&(n.group&&n.group.add(o),r&&r.register&&i&&r.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),Lm.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:o}=this.props,a=r.projection;return a&&(a.isPresent=o,i||t.layoutDependency!==n||n===void 0?a.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?a.promote():a.relegate()||na.postRender(()=>{var s;!((s=a.getStack())===null||s===void 0)&&s.members.length||this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),!t.currentAnimation&&t.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n!=null&&n.group&&n.group.remove(i),r!=null&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t==null||t()}render(){return null}}function pce(e){const[t,n]=g9(),r=S.useContext(J7);return M.createElement(hce,{...e,layoutGroup:r,switchLayoutGroup:S.useContext(IN),isPresent:t,safeToRemove:n})}const mce={borderRadius:{...Mp,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Mp,borderTopRightRadius:Mp,borderBottomLeftRadius:Mp,borderBottomRightRadius:Mp,boxShadow:fce},gce={measureLayout:pce};function vce(e,t,n={}){const r=ts(e)?e:rh(e);return S9("",r,t,n),{stop:()=>r.stop(),isAnimating:()=>r.isAnimating()}}const ZB=["TopLeft","TopRight","BottomLeft","BottomRight"],yce=ZB.length,xL=e=>typeof e=="string"?parseFloat(e):e,_L=e=>typeof e=="number"||ut.test(e);function bce(e,t,n,r,i,o){var a,s,l,u;i?(e.opacity=Kn(0,(a=n.opacity)!==null&&a!==void 0?a:1,Sce(r)),e.opacityExit=Kn((s=t.opacity)!==null&&s!==void 0?s:1,0,wce(r))):o&&(e.opacity=Kn((l=t.opacity)!==null&&l!==void 0?l:1,(u=n.opacity)!==null&&u!==void 0?u:1,r));for(let c=0;crt?1:n(gg(e,t,r))}function EL(e,t){e.min=t.min,e.max=t.max}function Ho(e,t){EL(e.x,t.x),EL(e.y,t.y)}function PL(e,t,n,r,i){return e-=t,e=fy(e,1/n,r),i!==void 0&&(e=fy(e,1/i,r)),e}function Cce(e,t=0,n=1,r=.5,i,o=e,a=e){if(Ga.test(t)&&(t=parseFloat(t),t=Kn(a.min,a.max,t/100)-a.min),typeof t!="number")return;let s=Kn(o.min,o.max,r);e===o&&(s-=t),e.min=PL(e.min,t,n,s,i),e.max=PL(e.max,t,n,s,i)}function TL(e,t,[n,r,i],o,a){Cce(e,t[n],t[r],t[i],t.scale,o,a)}const xce=["x","scaleX","originX"],_ce=["y","scaleY","originY"];function LL(e,t,n,r){TL(e.x,t,xce,n==null?void 0:n.x,r==null?void 0:r.x),TL(e.y,t,_ce,n==null?void 0:n.y,r==null?void 0:r.y)}function AL(e){return e.translate===0&&e.scale===1}function JB(e){return AL(e.x)&&AL(e.y)}function eF(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}function OL(e){return Yi(e.x)/Yi(e.y)}function kce(e,t,n=.1){return m9(e,t)<=n}class Ece{constructor(){this.members=[]}add(t){w9(this.members,t),t.scheduleRender()}remove(t){if(C9(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){r=o;break}}return r?(this.promote(r),!0):!1}promote(t,n){var r;const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,n&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),!((r=t.root)===null||r===void 0)&&r.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,r,i,o,a;(r=(n=t.options).onExitComplete)===null||r===void 0||r.call(n),(a=(i=t.resumingFrom)===null||i===void 0?void 0:(o=i.options).onExitComplete)===null||a===void 0||a.call(o)})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function ML(e,t,n){let r="";const i=e.x.translate/t.x,o=e.y.translate/t.y;if((i||o)&&(r=`translate3d(${i}px, ${o}px, 0) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{rotate:l,rotateX:u,rotateY:c}=n;l&&(r+=`rotate(${l}deg) `),u&&(r+=`rotateX(${u}deg) `),c&&(r+=`rotateY(${c}deg) `)}const a=e.x.scale*t.x,s=e.y.scale*t.y;return(a!==1||s!==1)&&(r+=`scale(${a}, ${s})`),r||"none"}const Pce=(e,t)=>e.depth-t.depth;class Tce{constructor(){this.children=[],this.isDirty=!1}add(t){w9(this.children,t),this.isDirty=!0}remove(t){C9(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Pce),this.isDirty=!1,this.children.forEach(t)}}const IL=["","X","Y","Z"],RL=1e3;let Lce=0;function tF({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(a,s={},l=t==null?void 0:t()){this.id=Lce++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.nodes.forEach(Rce),this.nodes.forEach($ce)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.elementId=a,this.latestValues=s,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0,a&&this.root.registerPotentialNode(a,this);for(let u=0;uthis.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,p&&p(),p=RB(m,250),Lm.hasAnimatedSinceResize&&(Lm.hasAnimatedSinceResize=!1,this.nodes.forEach(DL))})}u&&this.root.registerSharedNode(u,this),this.options.animate!==!1&&f&&(u||c)&&this.addEventListener("didUpdate",({delta:p,hasLayoutChanged:m,hasRelativeTargetChanged:g,layout:v})=>{var x,C,w,k,P;if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const L=(C=(x=this.options.transition)!==null&&x!==void 0?x:f.getDefaultTransition())!==null&&C!==void 0?C:zce,{onLayoutAnimationStart:A,onLayoutAnimationComplete:O}=f.getProps(),I=!this.targetLayout||!eF(this.targetLayout,v)||g,$=!m&&g;if(!((w=this.resumeFrom)===null||w===void 0)&&w.instance||$||m&&(I||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(p,$);const D={...b9(L,"layout"),onPlay:A,onComplete:O};f.shouldReduceMotion&&(D.delay=0,D.type=!1),this.startAnimation(D)}else!m&&this.animationProgress===0&&DL(this),this.isLead()&&((P=(k=this.options).onExitComplete)===null||P===void 0||P.call(k));this.targetLayout=v})}unmount(){var a,s;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),(a=this.getStack())===null||a===void 0||a.remove(this),(s=this.parent)===null||s===void 0||s.children.delete(this),this.instance=void 0,Oc.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){var a;return this.isAnimationBlocked||((a=this.parent)===null||a===void 0?void 0:a.isTreeAnimationBlocked())||!1}startUpdate(){var a;this.isUpdateBlocked()||(this.isUpdating=!0,(a=this.nodes)===null||a===void 0||a.forEach(Dce),this.animationId++)}willUpdate(a=!0){var s,l,u;if(this.root.isUpdateBlocked()){(l=(s=this.options).onExitComplete)===null||l===void 0||l.call(s);return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let m=0;m{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){var a;if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{var k;const P=w/1e3;NL(m.x,a.x,P),NL(m.y,a.y,P),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&(!((k=this.relativeParent)===null||k===void 0)&&k.layout)&&(Rm(g,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Bce(this.relativeTarget,this.relativeTargetOrigin,g,P)),v&&(this.animationValues=p,bce(p,f,this.latestValues,P,C,x)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=P},this.mixTargetDelta(0)}startAnimation(a){var s,l;this.notifyListeners("animationStart"),(s=this.currentAnimation)===null||s===void 0||s.stop(),this.resumingFrom&&((l=this.resumingFrom.currentAnimation)===null||l===void 0||l.stop()),this.pendingAnimation&&(Oc.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=na.update(()=>{Lm.hasAnimatedSinceResize=!0,this.currentAnimation=vce(0,RL,{...a,onUpdate:u=>{var c;this.mixTargetDelta(u),(c=a.onUpdate)===null||c===void 0||c.call(a,u)},onComplete:()=>{var u;(u=a.onComplete)===null||u===void 0||u.call(a),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){var a;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),(a=this.getStack())===null||a===void 0||a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){var a;this.currentAnimation&&((a=this.mixTargetDelta)===null||a===void 0||a.call(this,RL),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:s,target:l,layout:u,latestValues:c}=a;if(!(!s||!l||!u)){if(this!==a&&this.layout&&u&&nF(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||cr();const f=Yi(this.layout.layoutBox.x);l.x.min=a.target.x.min,l.x.max=l.x.min+f;const p=Yi(this.layout.layoutBox.y);l.y.min=a.target.y.min,l.y.max=l.y.min+p}Ho(s,l),nf(s,c),Im(this.projectionDeltaWithTransform,this.layoutCorrected,s,c)}}registerSharedNode(a,s){var l,u,c;this.sharedNodes.has(a)||this.sharedNodes.set(a,new Ece),this.sharedNodes.get(a).add(s),s.promote({transition:(l=s.options.initialPromotionConfig)===null||l===void 0?void 0:l.transition,preserveFollowOpacity:(c=(u=s.options.initialPromotionConfig)===null||u===void 0?void 0:u.shouldPreserveFollowOpacity)===null||c===void 0?void 0:c.call(u,s)})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var a;const{layoutId:s}=this.options;return s?((a=this.getStack())===null||a===void 0?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:s}=this.options;return s?(a=this.getStack())===null||a===void 0?void 0:a.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:s,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),a&&(this.projectionDelta=void 0,this.needsReset=!0),s&&this.setOptions({transition:s})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetRotation(){const{visualElement:a}=this.options;if(!a)return;let s=!1;const{latestValues:l}=a;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(s=!0),!s)return;const u={};for(let c=0;c{var s;return(s=a.currentAnimation)===null||s===void 0?void 0:s.stop()}),this.root.nodes.forEach($L),this.root.sharedNodes.clear()}}}function Ace(e){e.updateLayout()}function Oce(e){var t,n,r;const i=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&i&&e.hasListeners("didUpdate")){const{layoutBox:o,measuredBox:a}=e.layout,{animationType:s}=e.options,l=i.source!==e.layout.source;s==="size"?Aa(m=>{const g=l?i.measuredBox[m]:i.layoutBox[m],v=Yi(g);g.min=o[m].min,g.max=g.min+v}):nF(s,i.layoutBox,o)&&Aa(m=>{const g=l?i.measuredBox[m]:i.layoutBox[m],v=Yi(o[m]);g.max=g.min+v});const u=$m();Im(u,o,i.layoutBox);const c=$m();l?Im(c,e.applyTransform(a,!0),i.measuredBox):Im(c,o,i.layoutBox);const f=!JB(u);let p=!1;if(!e.resumeFrom){const m=e.getClosestProjectingParent();if(m&&!m.resumeFrom){const{snapshot:g,layout:v}=m;if(g&&v){const x=cr();Rm(x,i.layoutBox,g.layoutBox);const C=cr();Rm(C,o,v.layoutBox),eF(x,C)||(p=!0)}}}e.notifyListeners("didUpdate",{layout:o,snapshot:i,delta:c,layoutDelta:u,hasLayoutChanged:f,hasRelativeTargetChanged:p})}else e.isLead()&&((r=(n=e.options).onExitComplete)===null||r===void 0||r.call(n));e.options.transition=void 0}function Mce(e){e.clearSnapshot()}function $L(e){e.clearMeasurements()}function Ice(e){const{visualElement:t}=e.options;t!=null&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function DL(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0}function Rce(e){e.resolveTargetDelta()}function $ce(e){e.calcProjection()}function Dce(e){e.resetRotation()}function Nce(e){e.removeLeadSnapshot()}function NL(e,t,n){e.translate=Kn(t.translate,0,n),e.scale=Kn(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function BL(e,t,n,r){e.min=Kn(t.min,n.min,r),e.max=Kn(t.max,n.max,r)}function Bce(e,t,n,r){BL(e.x,t.x,n.x,r),BL(e.y,t.y,n.y,r)}function Fce(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const zce={duration:.45,ease:[.4,0,.1,1]};function jce(e,t){let n=e.root;for(let o=e.path.length-1;o>=0;o--)if(Boolean(e.path[o].instance)){n=e.path[o];break}const i=(n&&n!==e.root?n.instance:document).querySelector(`[data-projection-id="${t}"]`);i&&e.mount(i,!0)}function FL(e){e.min=Math.round(e.min),e.max=Math.round(e.max)}function Hce(e){FL(e.x),FL(e.y)}function nF(e,t,n){return e==="position"||e==="preserve-aspect"&&!kce(OL(t),OL(n),.2)}const Vce=tF({attachResizeListener:(e,t)=>Yb(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),AS={current:void 0},Uce=tF({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!AS.current){const e=new Vce(0,{});e.mount(window),e.setOptions({layoutScroll:!0}),AS.current=e}return AS.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>Boolean(window.getComputedStyle(e).position==="fixed")}),Wce={..._ue,...Rle,...Wue,...gce},ss=xae((e,t)=>lse(e,t,Wce,dce,Uce));function rF(){const e=S.useRef(!1);return ty(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function Gce(){const e=rF(),[t,n]=S.useState(0),r=S.useCallback(()=>{e.current&&n(t+1)},[t]);return[S.useCallback(()=>na.postRender(r),[r]),t]}class Kce extends S.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function Yce({children:e,isPresent:t}){const n=S.useId(),r=S.useRef(null),i=S.useRef({width:0,height:0,top:0,left:0});return S.useInsertionEffect(()=>{const{width:o,height:a,top:s,left:l}=i.current;if(t||!r.current||!o||!a)return;r.current.dataset.motionPopId=n;const u=document.createElement("style");return document.head.appendChild(u),u.sheet&&u.sheet.insertRule(` - [data-motion-pop-id="${n}"] { - position: absolute !important; - width: ${o}px !important; - height: ${a}px !important; - top: ${s}px !important; - left: ${l}px !important; - } - `),()=>{document.head.removeChild(u)}},[t]),S.createElement(Kce,{isPresent:t,childRef:r,sizeRef:i},S.cloneElement(e,{ref:r}))}const OS=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:o,mode:a})=>{const s=Kb(qce),l=S.useId(),u=S.useMemo(()=>({id:l,initial:t,isPresent:n,custom:i,onExitComplete:c=>{s.set(c,!0);for(const f of s.values())if(!f)return;r&&r()},register:c=>(s.set(c,!1),()=>s.delete(c))}),o?void 0:[n]);return S.useMemo(()=>{s.forEach((c,f)=>s.set(f,!1))},[n]),S.useEffect(()=>{!n&&!s.size&&r&&r()},[n]),a==="popLayout"&&(e=S.createElement(Yce,{isPresent:n},e)),S.createElement(Ah.Provider,{value:u},e)};function qce(){return new Map}const Zd=e=>e.key||"";function Xce(e,t){e.forEach(n=>{const r=Zd(n);t.set(r,n)})}function Zce(e){const t=[];return S.Children.forEach(e,n=>{S.isValidElement(n)&&t.push(n)}),t}const mu=({children:e,custom:t,initial:n=!0,onExitComplete:r,exitBeforeEnter:i,presenceAffectsLayout:o=!0,mode:a="sync"})=>{i&&(a="wait",LB(!1,"Replace exitBeforeEnter with mode='wait'"));let[s]=Gce();const l=S.useContext(J7).forceRender;l&&(s=l);const u=rF(),c=Zce(e);let f=c;const p=new Set,m=S.useRef(f),g=S.useRef(new Map).current,v=S.useRef(!0);if(ty(()=>{v.current=!1,Xce(c,g),m.current=f}),l9(()=>{v.current=!0,g.clear(),p.clear()}),v.current)return S.createElement(S.Fragment,null,f.map(k=>S.createElement(OS,{key:Zd(k),isPresent:!0,initial:n?void 0:!1,presenceAffectsLayout:o,mode:a},k)));f=[...f];const x=m.current.map(Zd),C=c.map(Zd),w=x.length;for(let k=0;k{if(C.indexOf(k)!==-1)return;const P=g.get(k);if(!P)return;const L=x.indexOf(k),A=()=>{g.delete(k),p.delete(k);const O=m.current.findIndex(I=>I.key===k);if(m.current.splice(O,1),!p.size){if(m.current=c,u.current===!1)return;s(),r&&r()}};f.splice(L,0,S.createElement(OS,{key:Zd(P),isPresent:!1,onExitComplete:A,custom:t,presenceAffectsLayout:o,mode:a},P))}),f=f.map(k=>{const P=k.key;return p.has(P)?k:S.createElement(OS,{key:Zd(k),isPresent:!0,presenceAffectsLayout:o,mode:a},k)}),TB!=="production"&&a==="wait"&&f.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`),S.createElement(S.Fragment,null,p.size?f:f.map(k=>S.cloneElement(k)))};var Da=function(){return Da=Object.assign||function(t){for(var n,r=1,i=arguments.length;r0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function Q6(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;re.filter(Boolean).join(" ");function Qce(){return!1}var Jce=e=>{const{condition:t,message:n}=e;t&&Qce()&&console.warn(n)},fc={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},Ip={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 J6(e){var n;switch((n=e==null?void 0:e.direction)!=null?n:"right"){case"right":return Ip.slideRight;case"left":return Ip.slideLeft;case"bottom":return Ip.slideDown;case"top":return Ip.slideUp;default:return Ip.slideRight}}var wc={enter:{duration:.2,ease:fc.easeOut},exit:{duration:.1,ease:fc.easeIn}},ra={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})},ede=e=>e!=null&&parseInt(e.toString(),10)>0,jL={exit:{height:{duration:.2,ease:fc.ease},opacity:{duration:.3,ease:fc.ease}},enter:{height:{duration:.3,ease:fc.ease},opacity:{duration:.4,ease:fc.ease}}},tde={exit:({animateOpacity:e,startingHeight:t,transition:n,transitionEnd:r,delay:i})=>{var o;return{...e&&{opacity:ede(t)?1:0},height:t,transitionEnd:r==null?void 0:r.exit,transition:(o=n==null?void 0:n.exit)!=null?o:ra.exit(jL.exit,i)}},enter:({animateOpacity:e,endingHeight:t,transition:n,transitionEnd:r,delay:i})=>{var o;return{...e&&{opacity:1},height:t,transitionEnd:r==null?void 0:r.enter,transition:(o=n==null?void 0:n.enter)!=null?o:ra.enter(jL.enter,i)}}},oF=S.forwardRef((e,t)=>{const{in:n,unmountOnExit:r,animateOpacity:i=!0,startingHeight:o=0,endingHeight:a="auto",style:s,className:l,transition:u,transitionEnd:c,...f}=e,[p,m]=S.useState(!1);S.useEffect(()=>{const w=setTimeout(()=>{m(!0)});return()=>clearTimeout(w)},[]),Jce({condition:Boolean(o>0&&r),message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const g=parseFloat(o.toString())>0,v={startingHeight:o,endingHeight:a,animateOpacity:i,transition:p?u:{enter:{duration:0}},transitionEnd:{enter:c==null?void 0:c.enter,exit:r?c==null?void 0:c.exit:{...c==null?void 0:c.exit,display:g?"block":"none"}}},x=r?n:!0,C=n||r?"enter":"exit";return M.createElement(mu,{initial:!1,custom:v},x&&M.createElement(ss.div,{ref:t,...f,className:u1("chakra-collapse",l),style:{overflow:"hidden",display:"block",...s},custom:v,variants:tde,initial:r?"exit":!1,animate:C,exit:"exit"}))});oF.displayName="Collapse";var nde={enter:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:1,transition:(r=e==null?void 0:e.enter)!=null?r:ra.enter(wc.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:ra.exit(wc.exit,n),transitionEnd:t==null?void 0:t.exit}}},aF={initial:"exit",animate:"enter",exit:"exit",variants:nde},rde=S.forwardRef(function(t,n){const{unmountOnExit:r,in:i,className:o,transition:a,transitionEnd:s,delay:l,...u}=t,c=i||r?"enter":"exit",f=r?i&&r:!0,p={transition:a,transitionEnd:s,delay:l};return M.createElement(mu,{custom:p},f&&M.createElement(ss.div,{ref:n,className:u1("chakra-fade",o),custom:p,...aF,animate:c,...u}))});rde.displayName="Fade";var ide={exit:({reverse:e,initialScale:t,transition:n,transitionEnd:r,delay:i})=>{var o;return{opacity:0,...e?{scale:t,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{scale:t,...r==null?void 0:r.exit}},transition:(o=n==null?void 0:n.exit)!=null?o:ra.exit(wc.exit,i)}},enter:({transitionEnd:e,transition:t,delay:n})=>{var r;return{opacity:1,scale:1,transition:(r=t==null?void 0:t.enter)!=null?r:ra.enter(wc.enter,n),transitionEnd:e==null?void 0:e.enter}}},sF={initial:"exit",animate:"enter",exit:"exit",variants:ide},ode=S.forwardRef(function(t,n){const{unmountOnExit:r,in:i,reverse:o=!0,initialScale:a=.95,className:s,transition:l,transitionEnd:u,delay:c,...f}=t,p=r?i&&r:!0,m=i||r?"enter":"exit",g={initialScale:a,reverse:o,transition:l,transitionEnd:u,delay:c};return M.createElement(mu,{custom:g},p&&M.createElement(ss.div,{ref:n,className:u1("chakra-offset-slide",s),...sF,animate:m,custom:g,...f}))});ode.displayName="ScaleFade";var HL={exit:{duration:.15,ease:fc.easeInOut},enter:{type:"spring",damping:25,stiffness:180}},ade={exit:({direction:e,transition:t,transitionEnd:n,delay:r})=>{var o;const{exit:i}=J6({direction:e});return{...i,transition:(o=t==null?void 0:t.exit)!=null?o:ra.exit(HL.exit,r),transitionEnd:n==null?void 0:n.exit}},enter:({direction:e,transitionEnd:t,transition:n,delay:r})=>{var o;const{enter:i}=J6({direction:e});return{...i,transition:(o=n==null?void 0:n.enter)!=null?o:ra.enter(HL.enter,r),transitionEnd:t==null?void 0:t.enter}}},lF=S.forwardRef(function(t,n){const{direction:r="right",style:i,unmountOnExit:o,in:a,className:s,transition:l,transitionEnd:u,delay:c,motionProps:f,...p}=t,m=J6({direction:r}),g=Object.assign({position:"fixed"},m.position,i),v=o?a&&o:!0,x=a||o?"enter":"exit",C={transitionEnd:u,transition:l,direction:r,delay:c};return M.createElement(mu,{custom:C},v&&M.createElement(ss.div,{...p,ref:n,initial:"exit",className:u1("chakra-slide",s),animate:x,exit:"exit",custom:C,variants:ade,style:g,...f}))});lF.displayName="Slide";var sde={initial:({offsetX:e,offsetY:t,transition:n,transitionEnd:r,delay:i})=>{var o;return{opacity:0,x:e,y:t,transition:(o=n==null?void 0:n.exit)!=null?o:ra.exit(wc.exit,i),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:ra.enter(wc.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({offsetY:e,offsetX:t,transition:n,transitionEnd:r,reverse:i,delay:o})=>{var s;const a={x:t,y:e};return{opacity:0,transition:(s=n==null?void 0:n.exit)!=null?s:ra.exit(wc.exit,o),...i?{...a,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{...a,...r==null?void 0:r.exit}}}}},eC={initial:"initial",animate:"enter",exit:"exit",variants:sde},lde=S.forwardRef(function(t,n){const{unmountOnExit:r,in:i,reverse:o=!0,className:a,offsetX:s=0,offsetY:l=8,transition:u,transitionEnd:c,delay:f,...p}=t,m=r?i&&r:!0,g=i||r?"enter":"exit",v={offsetX:s,offsetY:l,reverse:o,transition:u,transitionEnd:c,delay:f};return M.createElement(mu,{custom:v},m&&M.createElement(ss.div,{ref:n,className:u1("chakra-offset-slide",a),custom:v,...eC,animate:g,...p}))});lde.displayName="SlideFade";var c1=(...e)=>e.filter(Boolean).join(" ");function ude(){return!1}var e3=e=>{const{condition:t,message:n}=e;t&&ude()&&console.warn(n)};function MS(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var[cde,t3]=Kt({name:"AccordionStylesContext",hookName:"useAccordionStyles",providerName:""}),[dde,_9]=Kt({name:"AccordionItemContext",hookName:"useAccordionItemContext",providerName:""}),[fde,WXe,hde,pde]=AN(),rf=pe(function(t,n){const{getButtonProps:r}=_9(),i=r(t,n),a={display:"flex",alignItems:"center",width:"100%",outline:0,...t3().button};return M.createElement(de.button,{...i,className:c1("chakra-accordion__button",t.className),__css:a})});rf.displayName="AccordionButton";function mde(e){const{onChange:t,defaultIndex:n,index:r,allowMultiple:i,allowToggle:o,...a}=e;yde(e),bde(e);const s=hde(),[l,u]=S.useState(-1);S.useEffect(()=>()=>{u(-1)},[]);const[c,f]=Vb({value:r,defaultValue(){return i?n!=null?n:[]:n!=null?n:-1},onChange:t});return{index:c,setIndex:f,htmlProps:a,getAccordionItemProps:m=>{let g=!1;return m!==null&&(g=Array.isArray(c)?c.includes(m):c===m),{isOpen:g,onChange:x=>{if(m!==null)if(i&&Array.isArray(c)){const C=x?c.concat(m):c.filter(w=>w!==m);f(C)}else x?f(m):o&&f(-1)}}},focusedIndex:l,setFocusedIndex:u,descendants:s}}var[gde,k9]=Kt({name:"AccordionContext",hookName:"useAccordionContext",providerName:"Accordion"});function vde(e){const{isDisabled:t,isFocusable:n,id:r,...i}=e,{getAccordionItemProps:o,setFocusedIndex:a}=k9(),s=S.useRef(null),l=S.useId(),u=r!=null?r:l,c=`accordion-button-${u}`,f=`accordion-panel-${u}`;Sde(e);const{register:p,index:m,descendants:g}=pde({disabled:t&&!n}),{isOpen:v,onChange:x}=o(m===-1?null:m);wde({isOpen:v,isDisabled:t});const C=()=>{x==null||x(!0)},w=()=>{x==null||x(!1)},k=S.useCallback(()=>{x==null||x(!v),a(m)},[m,a,v,x]),P=S.useCallback(I=>{const D={ArrowDown:()=>{const V=g.nextEnabled(m);V==null||V.node.focus()},ArrowUp:()=>{const V=g.prevEnabled(m);V==null||V.node.focus()},Home:()=>{const V=g.firstEnabled();V==null||V.node.focus()},End:()=>{const V=g.lastEnabled();V==null||V.node.focus()}}[I.key];D&&(I.preventDefault(),D(I))},[g,m]),L=S.useCallback(()=>{a(m)},[a,m]),A=S.useCallback(function($={},D=null){return{...$,type:"button",ref:ln(p,s,D),id:c,disabled:!!t,"aria-expanded":!!v,"aria-controls":f,onClick:MS($.onClick,k),onFocus:MS($.onFocus,L),onKeyDown:MS($.onKeyDown,P)}},[c,t,v,k,L,P,f,p]),O=S.useCallback(function($={},D=null){return{...$,ref:D,role:"region",id:f,"aria-labelledby":c,hidden:!v}},[c,v,f]);return{isOpen:v,isDisabled:t,isFocusable:n,onOpen:C,onClose:w,getButtonProps:A,getPanelProps:O,htmlProps:i}}function yde(e){const t=e.index||e.defaultIndex,n=t!=null&&!Array.isArray(t)&&e.allowMultiple;e3({condition:!!n,message:`If 'allowMultiple' is passed, then 'index' or 'defaultIndex' must be an array. You passed: ${typeof t},`})}function bde(e){e3({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 Sde(e){e3({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 wde(e){e3({condition:e.isOpen&&!!e.isDisabled,message:"Cannot open a disabled accordion item"})}function of(e){const{isOpen:t,isDisabled:n}=_9(),{reduceMotion:r}=k9(),i=c1("chakra-accordion__icon",e.className),o=t3(),a={opacity:n?.4:1,transform:t?"rotate(-180deg)":void 0,transition:r?void 0:"transform 0.2s",transformOrigin:"center",...o.icon};return M.createElement(Qi,{viewBox:"0 0 24 24","aria-hidden":!0,className:i,__css:a,...e},M.createElement("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"}))}of.displayName="AccordionIcon";var af=pe(function(t,n){const{children:r,className:i}=t,{htmlProps:o,...a}=vde(t),l={...t3().container,overflowAnchor:"none"},u=S.useMemo(()=>a,[a]);return M.createElement(dde,{value:u},M.createElement(de.div,{ref:n,...o,className:c1("chakra-accordion__item",i),__css:l},typeof r=="function"?r({isExpanded:!!a.isOpen,isDisabled:!!a.isDisabled}):r))});af.displayName="AccordionItem";var sf=pe(function(t,n){const{className:r,motionProps:i,...o}=t,{reduceMotion:a}=k9(),{getPanelProps:s,isOpen:l}=_9(),u=s(o,n),c=c1("chakra-accordion__panel",r),f=t3();a||delete u.hidden;const p=M.createElement(de.div,{...u,__css:f.panel,className:c});return a?p:M.createElement(oF,{in:l,...i},p)});sf.displayName="AccordionPanel";var E9=pe(function({children:t,reduceMotion:n,...r},i){const o=Br("Accordion",r),a=Vt(r),{htmlProps:s,descendants:l,...u}=mde(a),c=S.useMemo(()=>({...u,reduceMotion:!!n}),[u,n]);return M.createElement(fde,{value:l},M.createElement(gde,{value:c},M.createElement(cde,{value:o},M.createElement(de.div,{ref:i,...s,className:c1("chakra-accordion",r.className),__css:o.root},t))))});E9.displayName="Accordion";var Cde=(...e)=>e.filter(Boolean).join(" "),xde=pu({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),d1=pe((e,t)=>{const n=gi("Spinner",e),{label:r="Loading...",thickness:i="2px",speed:o="0.45s",emptyColor:a="transparent",className:s,...l}=Vt(e),u=Cde("chakra-spinner",s),c={display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:i,borderBottomColor:a,borderLeftColor:a,animation:`${xde} ${o} linear infinite`,...n};return M.createElement(de.div,{ref:t,__css:c,className:u,...l},r&&M.createElement(de.span,{srOnly:!0},r))});d1.displayName="Spinner";var n3=(...e)=>e.filter(Boolean).join(" ");function _de(e){return M.createElement(Qi,{viewBox:"0 0 24 24",...e},M.createElement("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"}))}function kde(e){return M.createElement(Qi,{viewBox:"0 0 24 24",...e},M.createElement("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"}))}function VL(e){return M.createElement(Qi,{viewBox:"0 0 24 24",...e},M.createElement("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"}))}var[Ede,Pde]=Kt({name:"AlertContext",hookName:"useAlertContext",providerName:""}),[Tde,P9]=Kt({name:"AlertStylesContext",hookName:"useAlertStyles",providerName:""}),uF={info:{icon:kde,colorScheme:"blue"},warning:{icon:VL,colorScheme:"orange"},success:{icon:_de,colorScheme:"green"},error:{icon:VL,colorScheme:"red"},loading:{icon:d1,colorScheme:"blue"}};function Lde(e){return uF[e].colorScheme}function Ade(e){return uF[e].icon}var cF=pe(function(t,n){var u;const{status:r="info",addRole:i=!0,...o}=Vt(t),a=(u=t.colorScheme)!=null?u:Lde(r),s=Br("Alert",{...t,colorScheme:a}),l={width:"100%",display:"flex",alignItems:"center",position:"relative",overflow:"hidden",...s.container};return M.createElement(Ede,{value:{status:r}},M.createElement(Tde,{value:s},M.createElement(de.div,{role:i?"alert":void 0,ref:n,...o,className:n3("chakra-alert",t.className),__css:l})))});cF.displayName="Alert";var dF=pe(function(t,n){const i={display:"inline",...P9().description};return M.createElement(de.div,{ref:n,...t,className:n3("chakra-alert__desc",t.className),__css:i})});dF.displayName="AlertDescription";function fF(e){const{status:t}=Pde(),n=Ade(t),r=P9(),i=t==="loading"?r.spinner:r.icon;return M.createElement(de.span,{display:"inherit",...e,className:n3("chakra-alert__icon",e.className),__css:i},e.children||M.createElement(n,{h:"100%",w:"100%"}))}fF.displayName="AlertIcon";var hF=pe(function(t,n){const r=P9();return M.createElement(de.div,{ref:n,...t,className:n3("chakra-alert__title",t.className),__css:r.title})});hF.displayName="AlertTitle";function Ode(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function Mde(e){const{loading:t,src:n,srcSet:r,onLoad:i,onError:o,crossOrigin:a,sizes:s,ignoreFallback:l}=e,[u,c]=S.useState("pending");S.useEffect(()=>{c(n?"loading":"pending")},[n]);const f=S.useRef(),p=S.useCallback(()=>{if(!n)return;m();const g=new Image;g.src=n,a&&(g.crossOrigin=a),r&&(g.srcset=r),s&&(g.sizes=s),t&&(g.loading=t),g.onload=v=>{m(),c("loaded"),i==null||i(v)},g.onerror=v=>{m(),c("failed"),o==null||o(v)},f.current=g},[n,a,r,s,i,o,t]),m=()=>{f.current&&(f.current.onload=null,f.current.onerror=null,f.current=null)};return ea(()=>{if(!l)return u==="loading"&&p(),()=>{m()}},[u,p,l]),l?"loaded":u}var Ide=(e,t)=>e!=="loaded"&&t==="beforeLoadOrError"||e==="failed"&&t==="onError",hy=pe(function(t,n){const{htmlWidth:r,htmlHeight:i,alt:o,...a}=t;return M.createElement("img",{width:r,height:i,ref:n,alt:o,...a})});hy.displayName="NativeImage";var r3=pe(function(t,n){const{fallbackSrc:r,fallback:i,src:o,srcSet:a,align:s,fit:l,loading:u,ignoreFallback:c,crossOrigin:f,fallbackStrategy:p="beforeLoadOrError",referrerPolicy:m,...g}=t,v=r!==void 0||i!==void 0,x=u!=null||c||!v,C=Mde({...t,ignoreFallback:x}),w=Ide(C,p),k={ref:n,objectFit:l,objectPosition:s,...x?g:Ode(g,["onError","onLoad"])};return w?i||M.createElement(de.img,{as:hy,className:"chakra-image__placeholder",src:r,...k}):M.createElement(de.img,{as:hy,src:o,srcSet:a,crossOrigin:f,loading:u,referrerPolicy:m,className:"chakra-image",...k})});r3.displayName="Image";pe((e,t)=>M.createElement(de.img,{ref:t,as:hy,className:"chakra-image",...e}));function i3(e){return S.Children.toArray(e).filter(t=>S.isValidElement(t))}var o3=(...e)=>e.filter(Boolean).join(" "),UL=e=>e?"":void 0,[Rde,$de]=Kt({strict:!1,name:"ButtonGroupContext"});function tC(e){const{children:t,className:n,...r}=e,i=S.isValidElement(t)?S.cloneElement(t,{"aria-hidden":!0,focusable:!1}):t,o=o3("chakra-button__icon",n);return M.createElement(de.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...r,className:o},i)}tC.displayName="ButtonIcon";function nC(e){const{label:t,placement:n,spacing:r="0.5rem",children:i=M.createElement(d1,{color:"currentColor",width:"1em",height:"1em"}),className:o,__css:a,...s}=e,l=o3("chakra-button__spinner",o),u=n==="start"?"marginEnd":"marginStart",c=S.useMemo(()=>({display:"flex",alignItems:"center",position:t?"relative":"absolute",[u]:t?r:0,fontSize:"1em",lineHeight:"normal",...a}),[a,t,u,r]);return M.createElement(de.div,{className:l,...s,__css:c},i)}nC.displayName="ButtonSpinner";function Dde(e){const[t,n]=S.useState(!e);return{ref:S.useCallback(o=>{o&&n(o.tagName==="BUTTON")},[]),type:t?"button":void 0}}var xo=pe((e,t)=>{const n=$de(),r=gi("Button",{...n,...e}),{isDisabled:i=n==null?void 0:n.isDisabled,isLoading:o,isActive:a,children:s,leftIcon:l,rightIcon:u,loadingText:c,iconSpacing:f="0.5rem",type:p,spinner:m,spinnerPlacement:g="start",className:v,as:x,...C}=Vt(e),w=S.useMemo(()=>{const A={...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:A}}},[r,n]),{ref:k,type:P}=Dde(x),L={rightIcon:u,leftIcon:l,iconSpacing:f,children:s};return M.createElement(de.button,{disabled:i||o,ref:iae(t,k),as:x,type:p!=null?p:P,"data-active":UL(a),"data-loading":UL(o),__css:w,className:o3("chakra-button",v),...C},o&&g==="start"&&M.createElement(nC,{className:"chakra-button__spinner--start",label:c,placement:"start",spacing:f},m),o?c||M.createElement(de.span,{opacity:0},M.createElement(WL,{...L})):M.createElement(WL,{...L}),o&&g==="end"&&M.createElement(nC,{className:"chakra-button__spinner--end",label:c,placement:"end",spacing:f},m))});xo.displayName="Button";function WL(e){const{leftIcon:t,rightIcon:n,children:r,iconSpacing:i}=e;return M.createElement(M.Fragment,null,t&&M.createElement(tC,{marginEnd:i},t),r,n&&M.createElement(tC,{marginStart:i},n))}var Jr=pe(function(t,n){const{size:r,colorScheme:i,variant:o,className:a,spacing:s="0.5rem",isAttached:l,isDisabled:u,...c}=t,f=o3("chakra-button__group",a),p=S.useMemo(()=>({size:r,colorScheme:i,variant:o,isDisabled:u}),[r,i,o,u]);let m={display:"inline-flex"};return l?m={...m,"> *: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}}:m={...m,"& > *:not(style) ~ *:not(style)":{marginStart:s}},M.createElement(Rde,{value:p},M.createElement(de.div,{ref:n,role:"group",__css:m,className:f,"data-attached":l?"":void 0,...c}))});Jr.displayName="ButtonGroup";var _o=pe((e,t)=>{const{icon:n,children:r,isRound:i,"aria-label":o,...a}=e,s=n||r,l=S.isValidElement(s)?S.cloneElement(s,{"aria-hidden":!0,focusable:!1}):null;return M.createElement(xo,{padding:"0",borderRadius:i?"full":void 0,ref:t,"aria-label":o,...a},l)});_o.displayName="IconButton";var Rh=(...e)=>e.filter(Boolean).join(" "),nv=e=>e?"":void 0,IS=e=>e?!0:void 0;function GL(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var[Nde,pF]=Kt({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[Bde,$h]=Kt({strict:!1,name:"FormControlContext"});function Fde(e){const{id:t,isRequired:n,isInvalid:r,isDisabled:i,isReadOnly:o,...a}=e,s=S.useId(),l=t||`field-${s}`,u=`${l}-label`,c=`${l}-feedback`,f=`${l}-helptext`,[p,m]=S.useState(!1),[g,v]=S.useState(!1),[x,C]=S.useState(!1),w=S.useCallback((O={},I=null)=>({id:f,...O,ref:ln(I,$=>{$&&v(!0)})}),[f]),k=S.useCallback((O={},I=null)=>{var $,D;return{...O,ref:I,"data-focus":nv(x),"data-disabled":nv(i),"data-invalid":nv(r),"data-readonly":nv(o),id:($=O.id)!=null?$:u,htmlFor:(D=O.htmlFor)!=null?D:l}},[l,i,x,r,o,u]),P=S.useCallback((O={},I=null)=>({id:c,...O,ref:ln(I,$=>{$&&m(!0)}),"aria-live":"polite"}),[c]),L=S.useCallback((O={},I=null)=>({...O,...a,ref:I,role:"group"}),[a]),A=S.useCallback((O={},I=null)=>({...O,ref:I,role:"presentation","aria-hidden":!0,children:O.children||"*"}),[]);return{isRequired:!!n,isInvalid:!!r,isReadOnly:!!o,isDisabled:!!i,isFocused:!!x,onFocus:()=>C(!0),onBlur:()=>C(!1),hasFeedbackText:p,setHasFeedbackText:m,hasHelpText:g,setHasHelpText:v,id:l,labelId:u,feedbackId:c,helpTextId:f,htmlProps:a,getHelpTextProps:w,getErrorMessageProps:P,getRootProps:L,getLabelProps:k,getRequiredIndicatorProps:A}}var Tt=pe(function(t,n){const r=Br("Form",t),i=Vt(t),{getRootProps:o,htmlProps:a,...s}=Fde(i),l=Rh("chakra-form-control",t.className);return M.createElement(Bde,{value:s},M.createElement(Nde,{value:r},M.createElement(de.div,{...o({},n),className:l,__css:r.container})))});Tt.displayName="FormControl";var xn=pe(function(t,n){const r=$h(),i=pF(),o=Rh("chakra-form__helper-text",t.className);return M.createElement(de.div,{...r==null?void 0:r.getHelpTextProps(t,n),__css:i.helperText,className:o})});xn.displayName="FormHelperText";function T9(e){const{isDisabled:t,isInvalid:n,isReadOnly:r,isRequired:i,...o}=L9(e);return{...o,disabled:t,readOnly:r,required:i,"aria-invalid":IS(n),"aria-required":IS(i),"aria-readonly":IS(r)}}function L9(e){var g,v,x;const t=$h(),{id:n,disabled:r,readOnly:i,required:o,isRequired:a,isInvalid:s,isReadOnly:l,isDisabled:u,onFocus:c,onBlur:f,...p}=e,m=e["aria-describedby"]?[e["aria-describedby"]]:[];return t!=null&&t.hasFeedbackText&&(t!=null&&t.isInvalid)&&m.push(t.feedbackId),t!=null&&t.hasHelpText&&m.push(t.helpTextId),{...p,"aria-describedby":m.join(" ")||void 0,id:n!=null?n:t==null?void 0:t.id,isDisabled:(g=r!=null?r:u)!=null?g:t==null?void 0:t.isDisabled,isReadOnly:(v=i!=null?i:l)!=null?v:t==null?void 0:t.isReadOnly,isRequired:(x=o!=null?o:a)!=null?x:t==null?void 0:t.isRequired,isInvalid:s!=null?s:t==null?void 0:t.isInvalid,onFocus:GL(t==null?void 0:t.onFocus,c),onBlur:GL(t==null?void 0:t.onBlur,f)}}var[zde,jde]=Kt({name:"FormErrorStylesContext",errorMessage:`useFormErrorStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),_n=pe((e,t)=>{const n=Br("FormError",e),r=Vt(e),i=$h();return i!=null&&i.isInvalid?M.createElement(zde,{value:n},M.createElement(de.div,{...i==null?void 0:i.getErrorMessageProps(r,t),className:Rh("chakra-form__error-message",e.className),__css:{display:"flex",alignItems:"center",...n.text}})):null});_n.displayName="FormErrorMessage";var Hde=pe((e,t)=>{const n=jde(),r=$h();if(!(r!=null&&r.isInvalid))return null;const i=Rh("chakra-form__error-icon",e.className);return M.createElement(Qi,{ref:t,"aria-hidden":!0,...e,__css:n.icon,className:i},M.createElement("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"}))});Hde.displayName="FormErrorIcon";var Ht=pe(function(t,n){var p;const r=gi("FormLabel",t),i=Vt(t),{className:o,children:a,requiredIndicator:s=M.createElement(mF,null),optionalIndicator:l=null,...u}=i,c=$h(),f=(p=c==null?void 0:c.getLabelProps(u,n))!=null?p:{ref:n,...u};return M.createElement(de.label,{...f,className:Rh("chakra-form__label",i.className),__css:{display:"block",textAlign:"start",...r}},a,c!=null&&c.isRequired?s:l)});Ht.displayName="FormLabel";var mF=pe(function(t,n){const r=$h(),i=pF();if(!(r!=null&&r.isRequired))return null;const o=Rh("chakra-form__required-indicator",t.className);return M.createElement(de.span,{...r==null?void 0:r.getRequiredIndicatorProps(t,n),__css:i.requiredIndicator,className:o})});mF.displayName="RequiredIndicator";function nu(e,t){const n=S.useRef(!1),r=S.useRef(!1);S.useEffect(()=>{if(n.current&&r.current)return e();r.current=!0},t),S.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])}var A9={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},Vde=de("span",{baseStyle:A9});Vde.displayName="VisuallyHidden";var Ude=de("input",{baseStyle:A9});Ude.displayName="VisuallyHiddenInput";var KL=!1,a3=null,ih=!1,rC=new Set,Wde=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function Gde(e){return!(e.metaKey||!Wde&&e.altKey||e.ctrlKey)}function O9(e,t){rC.forEach(n=>n(e,t))}function YL(e){ih=!0,Gde(e)&&(a3="keyboard",O9("keyboard",e))}function Rd(e){a3="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(ih=!0,O9("pointer",e))}function Kde(e){e.target===window||e.target===document||(ih||(a3="keyboard",O9("keyboard",e)),ih=!1)}function Yde(){ih=!1}function qL(){return a3!=="pointer"}function qde(){if(typeof window>"u"||KL)return;const{focus:e}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...n){ih=!0,e.apply(this,n)},document.addEventListener("keydown",YL,!0),document.addEventListener("keyup",YL,!0),window.addEventListener("focus",Kde,!0),window.addEventListener("blur",Yde,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",Rd,!0),document.addEventListener("pointermove",Rd,!0),document.addEventListener("pointerup",Rd,!0)):(document.addEventListener("mousedown",Rd,!0),document.addEventListener("mousemove",Rd,!0),document.addEventListener("mouseup",Rd,!0)),KL=!0}function Xde(e){qde(),e(qL());const t=()=>e(qL());return rC.add(t),()=>{rC.delete(t)}}var[GXe,Zde]=Kt({name:"CheckboxGroupContext",strict:!1}),Qde=(...e)=>e.filter(Boolean).join(" "),oi=e=>e?"":void 0;function uo(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function Jde(...e){return function(n){e.forEach(r=>{r==null||r(n)})}}function efe(e){return M.createElement(de.svg,{width:"1.2em",viewBox:"0 0 12 10",style:{fill:"none",strokeWidth:2,stroke:"currentColor",strokeDasharray:16},...e},M.createElement("polyline",{points:"1.5 6 4.5 9 10.5 1"}))}function tfe(e){return M.createElement(de.svg,{width:"1.2em",viewBox:"0 0 24 24",style:{stroke:"currentColor",strokeWidth:4},...e},M.createElement("line",{x1:"21",x2:"3",y1:"12",y2:"12"}))}function nfe(e){const{isIndeterminate:t,isChecked:n,...r}=e,i=t?tfe:efe;return n||t?M.createElement(de.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"}},M.createElement(i,{...r})):null}function rfe(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function gF(e={}){const t=L9(e),{isDisabled:n,isReadOnly:r,isRequired:i,isInvalid:o,id:a,onBlur:s,onFocus:l,"aria-describedby":u}=t,{defaultChecked:c,isChecked:f,isFocusable:p,onChange:m,isIndeterminate:g,name:v,value:x,tabIndex:C=void 0,"aria-label":w,"aria-labelledby":k,"aria-invalid":P,...L}=e,A=rfe(L,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),O=Fn(m),I=Fn(s),$=Fn(l),[D,V]=S.useState(!1),[Y,z]=S.useState(!1),[R,N]=S.useState(!1),[U,G]=S.useState(!1);S.useEffect(()=>Xde(V),[]);const B=S.useRef(null),[W,X]=S.useState(!0),[re,le]=S.useState(!!c),he=f!==void 0,se=he?f:re,Ae=S.useCallback(ve=>{if(r||n){ve.preventDefault();return}he||le(se?ve.target.checked:g?!0:ve.target.checked),O==null||O(ve)},[r,n,se,he,g,O]);ea(()=>{B.current&&(B.current.indeterminate=Boolean(g))},[g]),nu(()=>{n&&z(!1)},[n,z]),ea(()=>{const ve=B.current;ve!=null&&ve.form&&(ve.form.onreset=()=>{le(!!c)})},[]);const be=n&&!p,De=S.useCallback(ve=>{ve.key===" "&&G(!0)},[G]),fe=S.useCallback(ve=>{ve.key===" "&&G(!1)},[G]);ea(()=>{if(!B.current)return;B.current.checked!==se&&le(B.current.checked)},[B.current]);const Xe=S.useCallback((ve={},Qe=null)=>{const ct=Je=>{Y&&Je.preventDefault(),G(!0)};return{...ve,ref:Qe,"data-active":oi(U),"data-hover":oi(R),"data-checked":oi(se),"data-focus":oi(Y),"data-focus-visible":oi(Y&&D),"data-indeterminate":oi(g),"data-disabled":oi(n),"data-invalid":oi(o),"data-readonly":oi(r),"aria-hidden":!0,onMouseDown:uo(ve.onMouseDown,ct),onMouseUp:uo(ve.onMouseUp,()=>G(!1)),onMouseEnter:uo(ve.onMouseEnter,()=>N(!0)),onMouseLeave:uo(ve.onMouseLeave,()=>N(!1))}},[U,se,n,Y,D,R,g,o,r]),rt=S.useCallback((ve={},Qe=null)=>({...A,...ve,ref:ln(Qe,ct=>{ct&&X(ct.tagName==="LABEL")}),onClick:uo(ve.onClick,()=>{var ct;W||((ct=B.current)==null||ct.click(),requestAnimationFrame(()=>{var Je;(Je=B.current)==null||Je.focus()}))}),"data-disabled":oi(n),"data-checked":oi(se),"data-invalid":oi(o)}),[A,n,se,o,W]),Ze=S.useCallback((ve={},Qe=null)=>({...ve,ref:ln(B,Qe),type:"checkbox",name:v,value:x,id:a,tabIndex:C,onChange:uo(ve.onChange,Ae),onBlur:uo(ve.onBlur,I,()=>z(!1)),onFocus:uo(ve.onFocus,$,()=>z(!0)),onKeyDown:uo(ve.onKeyDown,De),onKeyUp:uo(ve.onKeyUp,fe),required:i,checked:se,disabled:be,readOnly:r,"aria-label":w,"aria-labelledby":k,"aria-invalid":P?Boolean(P):o,"aria-describedby":u,"aria-disabled":n,style:A9}),[v,x,a,Ae,I,$,De,fe,i,se,be,r,w,k,P,o,u,n,C]),et=S.useCallback((ve={},Qe=null)=>({...ve,ref:Qe,onMouseDown:uo(ve.onMouseDown,XL),onTouchStart:uo(ve.onTouchStart,XL),"data-disabled":oi(n),"data-checked":oi(se),"data-invalid":oi(o)}),[se,n,o]);return{state:{isInvalid:o,isFocused:Y,isChecked:se,isActive:U,isHovered:R,isIndeterminate:g,isDisabled:n,isReadOnly:r,isRequired:i},getRootProps:rt,getCheckboxProps:Xe,getInputProps:Ze,getLabelProps:et,htmlProps:A}}function XL(e){e.preventDefault(),e.stopPropagation()}var ife={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},ofe={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},afe=pu({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),sfe=pu({from:{opacity:0},to:{opacity:1}}),lfe=pu({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),vF=pe(function(t,n){const r=Zde(),i={...r,...t},o=Br("Checkbox",i),a=Vt(t),{spacing:s="0.5rem",className:l,children:u,iconColor:c,iconSize:f,icon:p=M.createElement(nfe,null),isChecked:m,isDisabled:g=r==null?void 0:r.isDisabled,onChange:v,inputProps:x,...C}=a;let w=m;r!=null&&r.value&&a.value&&(w=r.value.includes(a.value));let k=v;r!=null&&r.onChange&&a.value&&(k=Jde(r.onChange,v));const{state:P,getInputProps:L,getCheckboxProps:A,getLabelProps:O,getRootProps:I}=gF({...C,isDisabled:g,isChecked:w,onChange:k}),$=S.useMemo(()=>({animation:P.isIndeterminate?`${sfe} 20ms linear, ${lfe} 200ms linear`:`${afe} 200ms linear`,fontSize:f,color:c,...o.icon}),[c,f,,P.isIndeterminate,o.icon]),D=S.cloneElement(p,{__css:$,isIndeterminate:P.isIndeterminate,isChecked:P.isChecked});return M.createElement(de.label,{__css:{...ofe,...o.container},className:Qde("chakra-checkbox",l),...I()},M.createElement("input",{className:"chakra-checkbox__input",...L(x,n)}),M.createElement(de.span,{__css:{...ife,...o.control},className:"chakra-checkbox__control",...A()},D),u&&M.createElement(de.span,{className:"chakra-checkbox__label",...O(),__css:{marginStart:s,...o.label}},u))});vF.displayName="Checkbox";function ufe(e){return M.createElement(Qi,{focusable:"false","aria-hidden":!0,...e},M.createElement("path",{fill:"currentColor",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"}))}var s3=pe(function(t,n){const r=gi("CloseButton",t),{children:i,isDisabled:o,__css:a,...s}=Vt(t),l={outline:0,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return M.createElement(de.button,{type:"button","aria-label":"Close",ref:n,disabled:o,__css:{...l,...r,...a},...s},i||M.createElement(ufe,{width:"1em",height:"1em"}))});s3.displayName="CloseButton";function cfe(e){const t=parseFloat(e);return typeof t!="number"||Number.isNaN(t)?0:t}function M9(e,t){let n=cfe(e);const r=10**(t!=null?t:10);return n=Math.round(n*r)/r,t?n.toFixed(t):n.toString()}function iC(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 py(e,t,n){return(e-t)*100/(n-t)}function yF(e,t,n){return(n-t)*e+t}function oC(e,t,n){const r=Math.round((e-t)/n)*n+t,i=iC(n);return M9(r,i)}function Nf(e,t,n){return e==null?e:(n{var D;return r==null?"":(D=RS(r,o,n))!=null?D:""}),p=typeof i<"u",m=p?i:c,g=bF(_l(m),o),v=n!=null?n:g,x=S.useCallback(D=>{D!==m&&(p||f(D.toString()),u==null||u(D.toString(),_l(D)))},[u,p,m]),C=S.useCallback(D=>{let V=D;return l&&(V=Nf(V,a,s)),M9(V,v)},[v,l,s,a]),w=S.useCallback((D=o)=>{let V;m===""?V=_l(D):V=_l(m)+D,V=C(V),x(V)},[C,o,x,m]),k=S.useCallback((D=o)=>{let V;m===""?V=_l(-D):V=_l(m)-D,V=C(V),x(V)},[C,o,x,m]),P=S.useCallback(()=>{var V;let D;r==null?D="":D=(V=RS(r,o,n))!=null?V:a,x(D)},[r,n,o,x,a]),L=S.useCallback(D=>{var Y;const V=(Y=RS(D,o,v))!=null?Y:a;x(V)},[v,o,x,a]),A=_l(m);return{isOutOfRange:A>s||AM.createElement(Fb,{styles:SF}),hfe=()=>M.createElement(Fb,{styles:` - html { - line-height: 1.5; - -webkit-text-size-adjust: 100%; - font-family: system-ui, sans-serif; - -webkit-font-smoothing: antialiased; - text-rendering: optimizeLegibility; - -moz-osx-font-smoothing: grayscale; - touch-action: manipulation; - } - - body { - position: relative; - min-height: 100%; - font-feature-settings: 'kern'; - } - - *, - *::before, - *::after { - border-width: 0; - border-style: solid; - box-sizing: border-box; - } - - main { - display: block; - } - - hr { - border-top-width: 1px; - box-sizing: content-box; - height: 0; - overflow: visible; - } - - pre, - code, - kbd, - samp { - font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; - font-size: 1em; - } - - a { - background-color: transparent; - color: inherit; - text-decoration: inherit; - } - - abbr[title] { - border-bottom: none; - text-decoration: underline; - -webkit-text-decoration: underline dotted; - text-decoration: underline dotted; - } - - b, - strong { - font-weight: bold; - } - - small { - font-size: 80%; - } - - sub, - sup { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; - } - - sub { - bottom: -0.25em; - } - - sup { - top: -0.5em; - } - - img { - border-style: none; - } - - button, - input, - optgroup, - select, - textarea { - font-family: inherit; - font-size: 100%; - line-height: 1.15; - margin: 0; - } - - button, - input { - overflow: visible; - } - - button, - select { - text-transform: none; - } - - button::-moz-focus-inner, - [type="button"]::-moz-focus-inner, - [type="reset"]::-moz-focus-inner, - [type="submit"]::-moz-focus-inner { - border-style: none; - padding: 0; - } - - fieldset { - padding: 0.35em 0.75em 0.625em; - } - - legend { - box-sizing: border-box; - color: inherit; - display: table; - max-width: 100%; - padding: 0; - white-space: normal; - } - - progress { - vertical-align: baseline; - } - - textarea { - overflow: auto; - } - - [type="checkbox"], - [type="radio"] { - box-sizing: border-box; - padding: 0; - } - - [type="number"]::-webkit-inner-spin-button, - [type="number"]::-webkit-outer-spin-button { - -webkit-appearance: none !important; - } - - input[type="number"] { - -moz-appearance: textfield; - } - - [type="search"] { - -webkit-appearance: textfield; - outline-offset: -2px; - } - - [type="search"]::-webkit-search-decoration { - -webkit-appearance: none !important; - } - - ::-webkit-file-upload-button { - -webkit-appearance: button; - font: inherit; - } - - details { - display: block; - } - - summary { - display: list-item; - } - - template { - display: none; - } - - [hidden] { - display: none !important; - } - - body, - blockquote, - dl, - dd, - h1, - h2, - h3, - h4, - h5, - h6, - hr, - figure, - p, - pre { - margin: 0; - } - - button { - background: transparent; - padding: 0; - } - - fieldset { - margin: 0; - padding: 0; - } - - ol, - ul { - margin: 0; - padding: 0; - } - - textarea { - resize: vertical; - } - - button, - [role="button"] { - cursor: pointer; - } - - button::-moz-focus-inner { - border: 0 !important; - } - - table { - border-collapse: collapse; - } - - h1, - h2, - h3, - h4, - h5, - h6 { - font-size: inherit; - font-weight: inherit; - } - - button, - input, - optgroup, - select, - textarea { - padding: 0; - line-height: inherit; - color: inherit; - } - - img, - svg, - video, - canvas, - audio, - iframe, - embed, - object { - display: block; - } - - img, - video { - max-width: 100%; - height: auto; - } - - [data-js-focus-visible] :focus:not([data-focus-visible-added]):not([data-focus-visible-disabled]) { - outline: none; - box-shadow: none; - } - - select::-ms-expand { - display: none; - } - - ${SF} - `});function Cc(e,t,n,r){const i=Fn(n);return S.useEffect(()=>{const o=typeof e=="function"?e():e!=null?e:document;if(!(!n||!o))return o.addEventListener(t,i,r),()=>{o.removeEventListener(t,i,r)}},[t,e,r,i,n]),()=>{const o=typeof e=="function"?e():e!=null?e:document;o==null||o.removeEventListener(t,i,r)}}function pfe(e){return"current"in e}var wF=()=>typeof window<"u";function mfe(){var t;const e=navigator.userAgentData;return(t=e==null?void 0:e.platform)!=null?t:navigator.platform}var gfe=e=>wF()&&e.test(navigator.vendor),vfe=e=>wF()&&e.test(mfe()),yfe=()=>vfe(/mac|iphone|ipad|ipod/i),bfe=()=>yfe()&&gfe(/apple/i);function Sfe(e){const{ref:t,elements:n,enabled:r}=e,i=()=>{var a;var o;return(a=(o=t.current)==null?void 0:o.ownerDocument)!=null?a:document};Cc(i,"pointerdown",o=>{if(!bfe()||!r)return;const a=o.target,l=(n!=null?n:[t]).some(u=>{const c=pfe(u)?u.current:u;return(c==null?void 0:c.contains(a))||c===a});i().activeElement!==a&&l&&(o.preventDefault(),a.focus())})}var wfe=dJ?S.useLayoutEffect:S.useEffect;function ZL(e,t=[]){const n=S.useRef(e);return wfe(()=>{n.current=e}),S.useCallback((...r)=>{var i;return(i=n.current)==null?void 0:i.call(n,...r)},t)}function Cfe(e,t){const n=e!==void 0;return[n,n&&typeof e<"u"?e:t]}function xfe(e,t){const n=S.useId();return S.useMemo(()=>e||[t,n].filter(Boolean).join("-"),[e,t,n])}function Mc(e={}){const{onClose:t,onOpen:n,isOpen:r,id:i}=e,o=ZL(n),a=ZL(t),[s,l]=S.useState(e.defaultIsOpen||!1),[u,c]=Cfe(r,s),f=xfe(i,"disclosure"),p=S.useCallback(()=>{u||l(!1),a==null||a()},[u,a]),m=S.useCallback(()=>{u||l(!0),o==null||o()},[u,o]),g=S.useCallback(()=>{(c?p:m)()},[c,m,p]);return{isOpen:!!c,onOpen:m,onClose:p,onToggle:g,isControlled:u,getButtonProps:(v={})=>({...v,"aria-expanded":c,"aria-controls":f,onClick:fJ(v.onClick,g)}),getDisclosureProps:(v={})=>({...v,hidden:!c,id:f})}}function I9(e){const t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}var R9=pe(function(t,n){const{htmlSize:r,...i}=t,o=Br("Input",i),a=Vt(i),s=T9(a),l=Jn("chakra-input",t.className);return M.createElement(de.input,{size:r,...s,__css:o.field,ref:n,className:l})});R9.displayName="Input";R9.id="Input";var[_fe,CF]=Kt({name:"InputGroupStylesContext",errorMessage:`useInputGroupStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),kfe=pe(function(t,n){const r=Br("Input",t),{children:i,className:o,...a}=Vt(t),s=Jn("chakra-input__group",o),l={},u=i3(i),c=r.field;u.forEach(p=>{var m,g;r&&(c&&p.type.id==="InputLeftElement"&&(l.paddingStart=(m=c.height)!=null?m:c.h),c&&p.type.id==="InputRightElement"&&(l.paddingEnd=(g=c.height)!=null?g:c.h),p.type.id==="InputRightAddon"&&(l.borderEndRadius=0),p.type.id==="InputLeftAddon"&&(l.borderStartRadius=0))});const f=u.map(p=>{var m,g;const v=I9({size:((m=p.props)==null?void 0:m.size)||t.size,variant:((g=p.props)==null?void 0:g.variant)||t.variant});return p.type.id!=="Input"?S.cloneElement(p,v):S.cloneElement(p,Object.assign(v,l,p.props))});return M.createElement(de.div,{className:s,ref:n,__css:{width:"100%",display:"flex",position:"relative"},...a},M.createElement(_fe,{value:r},f))});kfe.displayName="InputGroup";var Efe={left:{marginEnd:"-1px",borderEndRadius:0,borderEndColor:"transparent"},right:{marginStart:"-1px",borderStartRadius:0,borderStartColor:"transparent"}},Pfe=de("div",{baseStyle:{flex:"0 0 auto",width:"auto",display:"flex",alignItems:"center",whiteSpace:"nowrap"}}),$9=pe(function(t,n){var s;const{placement:r="left",...i}=t,o=(s=Efe[r])!=null?s:{},a=CF();return M.createElement(Pfe,{ref:n,...i,__css:{...a.addon,...o}})});$9.displayName="InputAddon";var xF=pe(function(t,n){return M.createElement($9,{ref:n,placement:"left",...t,className:Jn("chakra-input__left-addon",t.className)})});xF.displayName="InputLeftAddon";xF.id="InputLeftAddon";var _F=pe(function(t,n){return M.createElement($9,{ref:n,placement:"right",...t,className:Jn("chakra-input__right-addon",t.className)})});_F.displayName="InputRightAddon";_F.id="InputRightAddon";var Tfe=de("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"0",zIndex:2}}),l3=pe(function(t,n){var u,c;const{placement:r="left",...i}=t,o=CF(),a=o.field,l={[r==="left"?"insetStart":"insetEnd"]:"0",width:(u=a==null?void 0:a.height)!=null?u:a==null?void 0:a.h,height:(c=a==null?void 0:a.height)!=null?c:a==null?void 0:a.h,fontSize:a==null?void 0:a.fontSize,...o.element};return M.createElement(Tfe,{ref:n,__css:l,...i})});l3.id="InputElement";l3.displayName="InputElement";var kF=pe(function(t,n){const{className:r,...i}=t,o=Jn("chakra-input__left-element",r);return M.createElement(l3,{ref:n,placement:"left",className:o,...i})});kF.id="InputLeftElement";kF.displayName="InputLeftElement";var EF=pe(function(t,n){const{className:r,...i}=t,o=Jn("chakra-input__right-element",r);return M.createElement(l3,{ref:n,placement:"right",className:o,...i})});EF.id="InputRightElement";EF.displayName="InputRightElement";function Lfe(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}function ru(e,t){return Array.isArray(e)?e.map(n=>n===null?null:t(n)):Lfe(e)?Object.keys(e).reduce((n,r)=>(n[r]=t(e[r]),n),{}):e!=null?t(e):null}var Afe=pe(function(e,t){const{ratio:n=4/3,children:r,className:i,...o}=e,a=S.Children.only(r),s=Jn("chakra-aspect-ratio",i);return M.createElement(de.div,{ref:t,position:"relative",className:s,_before:{height:0,content:'""',display:"block",paddingBottom:ru(n,l=>`${1/l*100}%`)},__css:{"& > *:not(style)":{overflow:"hidden",position:"absolute",top:"0",right:"0",bottom:"0",left:"0",display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},"& > img, & > video":{objectFit:"cover"}},...o},a)});Afe.displayName="AspectRatio";var Ofe=pe(function(t,n){const r=gi("Badge",t),{className:i,...o}=Vt(t);return M.createElement(de.span,{ref:n,className:Jn("chakra-badge",t.className),...o,__css:{display:"inline-block",whiteSpace:"nowrap",verticalAlign:"middle",...r}})});Ofe.displayName="Badge";var ci=de("div");ci.displayName="Box";var PF=pe(function(t,n){const{size:r,centerContent:i=!0,...o}=t,a=i?{display:"flex",alignItems:"center",justifyContent:"center"}:{};return M.createElement(ci,{ref:n,boxSize:r,__css:{...a,flexShrink:0,flexGrow:0},...o})});PF.displayName="Square";var Mfe=pe(function(t,n){const{size:r,...i}=t;return M.createElement(PF,{size:r,ref:n,borderRadius:"9999px",...i})});Mfe.displayName="Circle";var TF=de("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center"}});TF.displayName="Center";var Ife={horizontal:{insetStart:"50%",transform:"translateX(-50%)"},vertical:{top:"50%",transform:"translateY(-50%)"},both:{insetStart:"50%",top:"50%",transform:"translate(-50%, -50%)"}};pe(function(t,n){const{axis:r="both",...i}=t;return M.createElement(de.div,{ref:n,__css:Ife[r],...i,position:"absolute"})});var Rfe=pe(function(t,n){const r=gi("Code",t),{className:i,...o}=Vt(t);return M.createElement(de.code,{ref:n,className:Jn("chakra-code",t.className),...o,__css:{display:"inline-block",...r}})});Rfe.displayName="Code";var $fe=pe(function(t,n){const{className:r,centerContent:i,...o}=Vt(t),a=gi("Container",t);return M.createElement(de.div,{ref:n,className:Jn("chakra-container",r),...o,__css:{...a,...i&&{display:"flex",flexDirection:"column",alignItems:"center"}}})});$fe.displayName="Container";var Dfe=pe(function(t,n){const{borderLeftWidth:r,borderBottomWidth:i,borderTopWidth:o,borderRightWidth:a,borderWidth:s,borderStyle:l,borderColor:u,...c}=gi("Divider",t),{className:f,orientation:p="horizontal",__css:m,...g}=Vt(t),v={vertical:{borderLeftWidth:r||a||s||"1px",height:"100%"},horizontal:{borderBottomWidth:i||o||s||"1px",width:"100%"}};return M.createElement(de.hr,{ref:n,"aria-orientation":p,...g,__css:{...c,border:"0",borderColor:u,borderStyle:l,...v[p],...m},className:Jn("chakra-divider",f)})});Dfe.displayName="Divider";var Le=pe(function(t,n){const{direction:r,align:i,justify:o,wrap:a,basis:s,grow:l,shrink:u,...c}=t,f={display:"flex",flexDirection:r,alignItems:i,justifyContent:o,flexWrap:a,flexBasis:s,flexGrow:l,flexShrink:u};return M.createElement(de.div,{ref:n,__css:f,...c})});Le.displayName="Flex";var LF=pe(function(t,n){const{templateAreas:r,gap:i,rowGap:o,columnGap:a,column:s,row:l,autoFlow:u,autoRows:c,templateRows:f,autoColumns:p,templateColumns:m,...g}=t,v={display:"grid",gridTemplateAreas:r,gridGap:i,gridRowGap:o,gridColumnGap:a,gridAutoColumns:p,gridColumn:s,gridRow:l,gridAutoFlow:u,gridAutoRows:c,gridTemplateRows:f,gridTemplateColumns:m};return M.createElement(de.div,{ref:n,__css:v,...g})});LF.displayName="Grid";function QL(e){return ru(e,t=>t==="auto"?"auto":`span ${t}/span ${t}`)}var Nfe=pe(function(t,n){const{area:r,colSpan:i,colStart:o,colEnd:a,rowEnd:s,rowSpan:l,rowStart:u,...c}=t,f=I9({gridArea:r,gridColumn:QL(i),gridRow:QL(l),gridColumnStart:o,gridColumnEnd:a,gridRowStart:u,gridRowEnd:s});return M.createElement(de.div,{ref:n,__css:f,...c})});Nfe.displayName="GridItem";var xc=pe(function(t,n){const r=gi("Heading",t),{className:i,...o}=Vt(t);return M.createElement(de.h2,{ref:n,className:Jn("chakra-heading",t.className),...o,__css:r})});xc.displayName="Heading";pe(function(t,n){const r=gi("Mark",t),i=Vt(t);return M.createElement(ci,{ref:n,...i,as:"mark",__css:{bg:"transparent",whiteSpace:"nowrap",...r}})});var Bfe=pe(function(t,n){const r=gi("Kbd",t),{className:i,...o}=Vt(t);return M.createElement(de.kbd,{ref:n,className:Jn("chakra-kbd",i),...o,__css:{fontFamily:"mono",...r}})});Bfe.displayName="Kbd";var _c=pe(function(t,n){const r=gi("Link",t),{className:i,isExternal:o,...a}=Vt(t);return M.createElement(de.a,{target:o?"_blank":void 0,rel:o?"noopener":void 0,ref:n,className:Jn("chakra-link",i),...a,__css:r})});_c.displayName="Link";pe(function(t,n){const{isExternal:r,target:i,rel:o,className:a,...s}=t;return M.createElement(de.a,{...s,ref:n,className:Jn("chakra-linkbox__overlay",a),rel:r?"noopener noreferrer":o,target:r?"_blank":i,__css:{position:"static","&::before":{content:"''",cursor:"inherit",display:"block",position:"absolute",top:0,left:0,zIndex:0,width:"100%",height:"100%"}}})});pe(function(t,n){const{className:r,...i}=t;return M.createElement(de.div,{ref:n,position:"relative",...i,className:Jn("chakra-linkbox",r),__css:{"a[href]:not(.chakra-linkbox__overlay), abbr[title]":{position:"relative",zIndex:1}}})});var[Ffe,AF]=Kt({name:"ListStylesContext",errorMessage:`useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),D9=pe(function(t,n){const r=Br("List",t),{children:i,styleType:o="none",stylePosition:a,spacing:s,...l}=Vt(t),u=i3(i),f=s?{["& > *:not(style) ~ *:not(style)"]:{mt:s}}:{};return M.createElement(Ffe,{value:r},M.createElement(de.ul,{ref:n,listStyleType:o,listStylePosition:a,role:"list",__css:{...r.container,...f},...l},u))});D9.displayName="List";var zfe=pe((e,t)=>{const{as:n,...r}=e;return M.createElement(D9,{ref:t,as:"ol",styleType:"decimal",marginStart:"1em",...r})});zfe.displayName="OrderedList";var jfe=pe(function(t,n){const{as:r,...i}=t;return M.createElement(D9,{ref:n,as:"ul",styleType:"initial",marginStart:"1em",...i})});jfe.displayName="UnorderedList";var Hfe=pe(function(t,n){const r=AF();return M.createElement(de.li,{ref:n,...t,__css:r.item})});Hfe.displayName="ListItem";var Vfe=pe(function(t,n){const r=AF();return M.createElement(Qi,{ref:n,role:"presentation",...t,__css:r.icon})});Vfe.displayName="ListIcon";var Ufe=pe(function(t,n){const{columns:r,spacingX:i,spacingY:o,spacing:a,minChildWidth:s,...l}=t,u=Lh(),c=s?Gfe(s,u):Kfe(r);return M.createElement(LF,{ref:n,gap:a,columnGap:i,rowGap:o,templateColumns:c,...l})});Ufe.displayName="SimpleGrid";function Wfe(e){return typeof e=="number"?`${e}px`:e}function Gfe(e,t){return ru(e,n=>{const r=Koe("sizes",n,Wfe(n))(t);return n===null?null:`repeat(auto-fit, minmax(${r}, 1fr))`})}function Kfe(e){return ru(e,t=>t===null?null:`repeat(${t}, minmax(0, 1fr))`)}var OF=de("div",{baseStyle:{flex:1,justifySelf:"stretch",alignSelf:"stretch"}});OF.displayName="Spacer";var aC="& > *:not(style) ~ *:not(style)";function Yfe(e){const{spacing:t,direction:n}=e,r={column:{marginTop:t,marginEnd:0,marginBottom:0,marginStart:0},row:{marginTop:0,marginEnd:0,marginBottom:0,marginStart:t},"column-reverse":{marginTop:0,marginEnd:0,marginBottom:t,marginStart:0},"row-reverse":{marginTop:0,marginEnd:t,marginBottom:0,marginStart:0}};return{flexDirection:n,[aC]:ru(n,i=>r[i])}}function qfe(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{"&":ru(n,i=>r[i])}}var MF=e=>M.createElement(de.div,{className:"chakra-stack__item",...e,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...e.__css}});MF.displayName="StackItem";var N9=pe((e,t)=>{const{isInline:n,direction:r,align:i,justify:o,spacing:a="0.5rem",wrap:s,children:l,divider:u,className:c,shouldWrapChildren:f,...p}=e,m=n?"row":r!=null?r:"column",g=S.useMemo(()=>Yfe({direction:m,spacing:a}),[m,a]),v=S.useMemo(()=>qfe({spacing:a,direction:m}),[a,m]),x=!!u,C=!f&&!x,w=S.useMemo(()=>{const P=i3(l);return C?P:P.map((L,A)=>{const O=typeof L.key<"u"?L.key:A,I=A+1===P.length,D=f?M.createElement(MF,{key:O},L):L;if(!x)return D;const V=S.cloneElement(u,{__css:v}),Y=I?null:V;return M.createElement(S.Fragment,{key:O},D,Y)})},[u,v,x,C,f,l]),k=Jn("chakra-stack",c);return M.createElement(de.div,{ref:t,display:"flex",alignItems:i,justifyContent:o,flexDirection:g.flexDirection,flexWrap:s,className:k,__css:x?{}:{[aC]:g[aC]},...p},w)});N9.displayName="Stack";var f1=pe((e,t)=>M.createElement(N9,{align:"center",...e,direction:"row",ref:t}));f1.displayName="HStack";var $t=pe((e,t)=>M.createElement(N9,{align:"center",...e,direction:"column",ref:t}));$t.displayName="VStack";var Lt=pe(function(t,n){const r=gi("Text",t),{className:i,align:o,decoration:a,casing:s,...l}=Vt(t),u=I9({textAlign:t.align,textDecoration:t.decoration,textTransform:t.casing});return M.createElement(de.p,{ref:n,className:Jn("chakra-text",t.className),...u,...l,__css:r})});Lt.displayName="Text";function JL(e){return typeof e=="number"?`${e}px`:e}var Xfe=pe(function(t,n){const{spacing:r="0.5rem",spacingX:i,spacingY:o,children:a,justify:s,direction:l,align:u,className:c,shouldWrapChildren:f,...p}=t,m=S.useMemo(()=>{const{spacingX:v=r,spacingY:x=r}={spacingX:i,spacingY:o};return{"--chakra-wrap-x-spacing":C=>ru(v,w=>JL(p6("space",w)(C))),"--chakra-wrap-y-spacing":C=>ru(x,w=>JL(p6("space",w)(C))),"--wrap-x-spacing":"calc(var(--chakra-wrap-x-spacing) / 2)","--wrap-y-spacing":"calc(var(--chakra-wrap-y-spacing) / 2)",display:"flex",flexWrap:"wrap",justifyContent:s,alignItems:u,flexDirection:l,listStyleType:"none",padding:"0",margin:"calc(var(--wrap-y-spacing) * -1) calc(var(--wrap-x-spacing) * -1)","& > *:not(style)":{margin:"var(--wrap-y-spacing) var(--wrap-x-spacing)"}}},[r,i,o,s,u,l]),g=S.useMemo(()=>f?S.Children.map(a,(v,x)=>M.createElement(IF,{key:x},v)):a,[a,f]);return M.createElement(de.div,{ref:n,className:Jn("chakra-wrap",c),overflow:"hidden",...p},M.createElement(de.ul,{className:"chakra-wrap__list",__css:m},g))});Xfe.displayName="Wrap";var IF=pe(function(t,n){const{className:r,...i}=t;return M.createElement(de.li,{ref:n,__css:{display:"flex",alignItems:"flex-start"},className:Jn("chakra-wrap__listitem",r),...i})});IF.displayName="WrapItem";var Zfe={body:{classList:{add(){},remove(){}}},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector(){return null},querySelectorAll(){return[]},getElementById(){return null},createEvent(){return{initEvent(){}}},createElement(){return{children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName(){return[]}}}},RF=Zfe,$d=()=>{},Qfe={document:RF,navigator:{userAgent:""},CustomEvent:function(){return this},addEventListener:$d,removeEventListener:$d,getComputedStyle(){return{getPropertyValue(){return""}}},matchMedia(){return{matches:!1,addListener:$d,removeListener:$d}},requestAnimationFrame(e){return typeof setTimeout>"u"?(e(),null):setTimeout(e,0)},cancelAnimationFrame(e){typeof setTimeout>"u"||clearTimeout(e)},setTimeout:()=>0,clearTimeout:$d,setInterval:()=>0,clearInterval:$d},Jfe=Qfe,ehe={window:Jfe,document:RF},$F=typeof window<"u"?{window,document}:ehe,DF=S.createContext($F);DF.displayName="EnvironmentContext";function NF(e){const{children:t,environment:n}=e,[r,i]=S.useState(null),[o,a]=S.useState(!1);S.useEffect(()=>a(!0),[]);const s=S.useMemo(()=>{if(n)return n;const l=r==null?void 0:r.ownerDocument,u=r==null?void 0:r.ownerDocument.defaultView;return l?{document:l,window:u}:$F},[r,n]);return M.createElement(DF.Provider,{value:s},t,!n&&o&&M.createElement("span",{id:"__chakra_env",hidden:!0,ref:l=>{S.startTransition(()=>{l&&i(l)})}}))}NF.displayName="EnvironmentProvider";var the=e=>e?"":void 0;function nhe(){const e=S.useRef(new Map),t=e.current,n=S.useCallback((i,o,a,s)=>{e.current.set(a,{type:o,el:i,options:s}),i.addEventListener(o,a,s)},[]),r=S.useCallback((i,o,a,s)=>{i.removeEventListener(o,a,s),e.current.delete(a)},[]);return S.useEffect(()=>()=>{t.forEach((i,o)=>{r(i.el,i.type,o,i.options)})},[r,t]),{add:n,remove:r}}function $S(e){const t=e.target,{tagName:n,isContentEditable:r}=t;return n!=="INPUT"&&n!=="TEXTAREA"&&r!==!0}function rhe(e={}){const{ref:t,isDisabled:n,isFocusable:r,clickOnEnter:i=!0,clickOnSpace:o=!0,onMouseDown:a,onMouseUp:s,onClick:l,onKeyDown:u,onKeyUp:c,tabIndex:f,onMouseOver:p,onMouseLeave:m,...g}=e,[v,x]=S.useState(!0),[C,w]=S.useState(!1),k=nhe(),P=G=>{G&&G.tagName!=="BUTTON"&&x(!1)},L=v?f:f||0,A=n&&!r,O=S.useCallback(G=>{if(n){G.stopPropagation(),G.preventDefault();return}G.currentTarget.focus(),l==null||l(G)},[n,l]),I=S.useCallback(G=>{C&&$S(G)&&(G.preventDefault(),G.stopPropagation(),w(!1),k.remove(document,"keyup",I,!1))},[C,k]),$=S.useCallback(G=>{if(u==null||u(G),n||G.defaultPrevented||G.metaKey||!$S(G.nativeEvent)||v)return;const B=i&&G.key==="Enter";o&&G.key===" "&&(G.preventDefault(),w(!0)),B&&(G.preventDefault(),G.currentTarget.click()),k.add(document,"keyup",I,!1)},[n,v,u,i,o,k,I]),D=S.useCallback(G=>{if(c==null||c(G),n||G.defaultPrevented||G.metaKey||!$S(G.nativeEvent)||v)return;o&&G.key===" "&&(G.preventDefault(),w(!1),G.currentTarget.click())},[o,v,n,c]),V=S.useCallback(G=>{G.button===0&&(w(!1),k.remove(document,"mouseup",V,!1))},[k]),Y=S.useCallback(G=>{if(G.button!==0)return;if(n){G.stopPropagation(),G.preventDefault();return}v||w(!0),G.currentTarget.focus({preventScroll:!0}),k.add(document,"mouseup",V,!1),a==null||a(G)},[n,v,a,k,V]),z=S.useCallback(G=>{G.button===0&&(v||w(!1),s==null||s(G))},[s,v]),R=S.useCallback(G=>{if(n){G.preventDefault();return}p==null||p(G)},[n,p]),N=S.useCallback(G=>{C&&(G.preventDefault(),w(!1)),m==null||m(G)},[C,m]),U=ln(t,P);return v?{...g,ref:U,type:"button","aria-disabled":A?void 0:n,disabled:A,onClick:O,onMouseDown:a,onMouseUp:s,onKeyUp:c,onKeyDown:u,onMouseOver:p,onMouseLeave:m}:{...g,ref:U,role:"button","data-active":the(C),"aria-disabled":n?"true":void 0,tabIndex:A?void 0:L,onClick:O,onMouseDown:Y,onMouseUp:z,onKeyUp:D,onKeyDown:$,onMouseOver:R,onMouseLeave:N}}function BF(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function FF(e){var n;if(!BF(e))return!1;const t=(n=e.ownerDocument.defaultView)!=null?n:window;return e instanceof t.HTMLElement}function ihe(e){var n;var t;return(n=(t=zF(e))==null?void 0:t.defaultView)!=null?n:window}function zF(e){return BF(e)?e.ownerDocument:document}function ohe(e){return zF(e).activeElement}var jF=e=>e.hasAttribute("tabindex"),ahe=e=>jF(e)&&e.tabIndex===-1;function she(e){return Boolean(e.getAttribute("disabled"))===!0||Boolean(e.getAttribute("aria-disabled"))===!0}function HF(e){return e.parentElement&&HF(e.parentElement)?!0:e.hidden}function lhe(e){const t=e.getAttribute("contenteditable");return t!=="false"&&t!=null}function VF(e){if(!FF(e)||HF(e)||she(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]():lhe(e)?!0:jF(e)}function uhe(e){return e?FF(e)&&VF(e)&&!ahe(e):!1}var che=["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]"],dhe=che.join(),fhe=e=>e.offsetWidth>0&&e.offsetHeight>0;function UF(e){const t=Array.from(e.querySelectorAll(dhe));return t.unshift(e),t.filter(n=>VF(n)&&fhe(n))}function hhe(e){const t=e.current;if(!t)return!1;const n=ohe(t);return!n||t.contains(n)?!1:!!uhe(n)}function phe(e,t){const{shouldFocus:n,visible:r,focusRef:i}=t,o=n&&!r;nu(()=>{if(!o||hhe(e))return;const a=(i==null?void 0:i.current)||e.current;a&&requestAnimationFrame(()=>{a.focus()})},[o,e,i])}var mhe={preventScroll:!0,shouldFocus:!1};function ghe(e,t=mhe){const{focusRef:n,preventScroll:r,shouldFocus:i,visible:o}=t,a=vhe(e)?e.current:e,s=i&&o,l=S.useRef(s),u=S.useRef(o);ea(()=>{!u.current&&o&&(l.current=s),u.current=o},[o,s]);const c=S.useCallback(()=>{if(!(!o||!a||!l.current)&&(l.current=!1,!a.contains(document.activeElement)))if(n!=null&&n.current)requestAnimationFrame(()=>{var f;(f=n.current)==null||f.focus({preventScroll:r})});else{const f=UF(a);f.length>0&&requestAnimationFrame(()=>{f[0].focus({preventScroll:r})})}},[o,r,a,n]);nu(()=>{c()},[c]),Cc(a,"transitionend",c)}function vhe(e){return"current"in e}var Li="top",ko="bottom",Eo="right",Ai="left",B9="auto",h1=[Li,ko,Eo,Ai],oh="start",bg="end",yhe="clippingParents",WF="viewport",Rp="popper",bhe="reference",eA=h1.reduce(function(e,t){return e.concat([t+"-"+oh,t+"-"+bg])},[]),GF=[].concat(h1,[B9]).reduce(function(e,t){return e.concat([t,t+"-"+oh,t+"-"+bg])},[]),She="beforeRead",whe="read",Che="afterRead",xhe="beforeMain",_he="main",khe="afterMain",Ehe="beforeWrite",Phe="write",The="afterWrite",Lhe=[She,whe,Che,xhe,_he,khe,Ehe,Phe,The];function ns(e){return e?(e.nodeName||"").toLowerCase():null}function Ao(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Ic(e){var t=Ao(e).Element;return e instanceof t||e instanceof Element}function wo(e){var t=Ao(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function F9(e){if(typeof ShadowRoot>"u")return!1;var t=Ao(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Ahe(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},o=t.elements[n];!wo(o)||!ns(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(a){var s=i[a];s===!1?o.removeAttribute(a):o.setAttribute(a,s===!0?"":s)}))})}function Ohe(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 i=t.elements[r],o=t.attributes[r]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),s=a.reduce(function(l,u){return l[u]="",l},{});!wo(i)||!ns(i)||(Object.assign(i.style,s),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const Mhe={name:"applyStyles",enabled:!0,phase:"write",fn:Ahe,effect:Ohe,requires:["computeStyles"]};function Ka(e){return e.split("-")[0]}var kc=Math.max,my=Math.min,ah=Math.round;function sC(){var e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function KF(){return!/^((?!chrome|android).)*safari/i.test(sC())}function sh(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&wo(e)&&(i=e.offsetWidth>0&&ah(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&ah(r.height)/e.offsetHeight||1);var a=Ic(e)?Ao(e):window,s=a.visualViewport,l=!KF()&&n,u=(r.left+(l&&s?s.offsetLeft:0))/i,c=(r.top+(l&&s?s.offsetTop:0))/o,f=r.width/i,p=r.height/o;return{width:f,height:p,top:c,right:u+f,bottom:c+p,left:u,x:u,y:c}}function z9(e){var t=sh(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 YF(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&F9(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Fs(e){return Ao(e).getComputedStyle(e)}function Ihe(e){return["table","td","th"].indexOf(ns(e))>=0}function gu(e){return((Ic(e)?e.ownerDocument:e.document)||window.document).documentElement}function u3(e){return ns(e)==="html"?e:e.assignedSlot||e.parentNode||(F9(e)?e.host:null)||gu(e)}function tA(e){return!wo(e)||Fs(e).position==="fixed"?null:e.offsetParent}function Rhe(e){var t=/firefox/i.test(sC()),n=/Trident/i.test(sC());if(n&&wo(e)){var r=Fs(e);if(r.position==="fixed")return null}var i=u3(e);for(F9(i)&&(i=i.host);wo(i)&&["html","body"].indexOf(ns(i))<0;){var o=Fs(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function p1(e){for(var t=Ao(e),n=tA(e);n&&Ihe(n)&&Fs(n).position==="static";)n=tA(n);return n&&(ns(n)==="html"||ns(n)==="body"&&Fs(n).position==="static")?t:n||Rhe(e)||t}function j9(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Dm(e,t,n){return kc(e,my(t,n))}function $he(e,t,n){var r=Dm(e,t,n);return r>n?n:r}function qF(){return{top:0,right:0,bottom:0,left:0}}function XF(e){return Object.assign({},qF(),e)}function ZF(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var Dhe=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,XF(typeof t!="number"?t:ZF(t,h1))};function Nhe(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Ka(n.placement),l=j9(s),u=[Ai,Eo].indexOf(s)>=0,c=u?"height":"width";if(!(!o||!a)){var f=Dhe(i.padding,n),p=z9(o),m=l==="y"?Li:Ai,g=l==="y"?ko:Eo,v=n.rects.reference[c]+n.rects.reference[l]-a[l]-n.rects.popper[c],x=a[l]-n.rects.reference[l],C=p1(o),w=C?l==="y"?C.clientHeight||0:C.clientWidth||0:0,k=v/2-x/2,P=f[m],L=w-p[c]-f[g],A=w/2-p[c]/2+k,O=Dm(P,A,L),I=l;n.modifiersData[r]=(t={},t[I]=O,t.centerOffset=O-A,t)}}function Bhe(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||YF(t.elements.popper,i)&&(t.elements.arrow=i))}const Fhe={name:"arrow",enabled:!0,phase:"main",fn:Nhe,effect:Bhe,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function lh(e){return e.split("-")[1]}var zhe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function jhe(e){var t=e.x,n=e.y,r=window,i=r.devicePixelRatio||1;return{x:ah(t*i)/i||0,y:ah(n*i)/i||0}}function nA(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,u=e.adaptive,c=e.roundOffsets,f=e.isFixed,p=a.x,m=p===void 0?0:p,g=a.y,v=g===void 0?0:g,x=typeof c=="function"?c({x:m,y:v}):{x:m,y:v};m=x.x,v=x.y;var C=a.hasOwnProperty("x"),w=a.hasOwnProperty("y"),k=Ai,P=Li,L=window;if(u){var A=p1(n),O="clientHeight",I="clientWidth";if(A===Ao(n)&&(A=gu(n),Fs(A).position!=="static"&&s==="absolute"&&(O="scrollHeight",I="scrollWidth")),A=A,i===Li||(i===Ai||i===Eo)&&o===bg){P=ko;var $=f&&A===L&&L.visualViewport?L.visualViewport.height:A[O];v-=$-r.height,v*=l?1:-1}if(i===Ai||(i===Li||i===ko)&&o===bg){k=Eo;var D=f&&A===L&&L.visualViewport?L.visualViewport.width:A[I];m-=D-r.width,m*=l?1:-1}}var V=Object.assign({position:s},u&&zhe),Y=c===!0?jhe({x:m,y:v}):{x:m,y:v};if(m=Y.x,v=Y.y,l){var z;return Object.assign({},V,(z={},z[P]=w?"0":"",z[k]=C?"0":"",z.transform=(L.devicePixelRatio||1)<=1?"translate("+m+"px, "+v+"px)":"translate3d("+m+"px, "+v+"px, 0)",z))}return Object.assign({},V,(t={},t[P]=w?v+"px":"",t[k]=C?m+"px":"",t.transform="",t))}function Hhe(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,a=o===void 0?!0:o,s=n.roundOffsets,l=s===void 0?!0:s,u={placement:Ka(t.placement),variation:lh(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,nA(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,nA(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const Vhe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Hhe,data:{}};var rv={passive:!0};function Uhe(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=i===void 0?!0:i,a=r.resize,s=a===void 0?!0:a,l=Ao(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&u.forEach(function(c){c.addEventListener("scroll",n.update,rv)}),s&&l.addEventListener("resize",n.update,rv),function(){o&&u.forEach(function(c){c.removeEventListener("scroll",n.update,rv)}),s&&l.removeEventListener("resize",n.update,rv)}}const Whe={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Uhe,data:{}};var Ghe={left:"right",right:"left",bottom:"top",top:"bottom"};function v2(e){return e.replace(/left|right|bottom|top/g,function(t){return Ghe[t]})}var Khe={start:"end",end:"start"};function rA(e){return e.replace(/start|end/g,function(t){return Khe[t]})}function H9(e){var t=Ao(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function V9(e){return sh(gu(e)).left+H9(e).scrollLeft}function Yhe(e,t){var n=Ao(e),r=gu(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;var u=KF();(u||!u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s+V9(e),y:l}}function qhe(e){var t,n=gu(e),r=H9(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=kc(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=kc(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+V9(e),l=-r.scrollTop;return Fs(i||n).direction==="rtl"&&(s+=kc(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}function U9(e){var t=Fs(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function QF(e){return["html","body","#document"].indexOf(ns(e))>=0?e.ownerDocument.body:wo(e)&&U9(e)?e:QF(u3(e))}function Nm(e,t){var n;t===void 0&&(t=[]);var r=QF(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=Ao(r),a=i?[o].concat(o.visualViewport||[],U9(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(Nm(u3(a)))}function lC(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Xhe(e,t){var n=sh(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 iA(e,t,n){return t===WF?lC(Yhe(e,n)):Ic(t)?Xhe(t,n):lC(qhe(gu(e)))}function Zhe(e){var t=Nm(u3(e)),n=["absolute","fixed"].indexOf(Fs(e).position)>=0,r=n&&wo(e)?p1(e):e;return Ic(r)?t.filter(function(i){return Ic(i)&&YF(i,r)&&ns(i)!=="body"}):[]}function Qhe(e,t,n,r){var i=t==="clippingParents"?Zhe(e):[].concat(t),o=[].concat(i,[n]),a=o[0],s=o.reduce(function(l,u){var c=iA(e,u,r);return l.top=kc(c.top,l.top),l.right=my(c.right,l.right),l.bottom=my(c.bottom,l.bottom),l.left=kc(c.left,l.left),l},iA(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function JF(e){var t=e.reference,n=e.element,r=e.placement,i=r?Ka(r):null,o=r?lh(r):null,a=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,l;switch(i){case Li:l={x:a,y:t.y-n.height};break;case ko:l={x:a,y:t.y+t.height};break;case Eo:l={x:t.x+t.width,y:s};break;case Ai:l={x:t.x-n.width,y:s};break;default:l={x:t.x,y:t.y}}var u=i?j9(i):null;if(u!=null){var c=u==="y"?"height":"width";switch(o){case oh:l[u]=l[u]-(t[c]/2-n[c]/2);break;case bg:l[u]=l[u]+(t[c]/2-n[c]/2);break}}return l}function Sg(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,o=n.strategy,a=o===void 0?e.strategy:o,s=n.boundary,l=s===void 0?yhe:s,u=n.rootBoundary,c=u===void 0?WF:u,f=n.elementContext,p=f===void 0?Rp:f,m=n.altBoundary,g=m===void 0?!1:m,v=n.padding,x=v===void 0?0:v,C=XF(typeof x!="number"?x:ZF(x,h1)),w=p===Rp?bhe:Rp,k=e.rects.popper,P=e.elements[g?w:p],L=Qhe(Ic(P)?P:P.contextElement||gu(e.elements.popper),l,c,a),A=sh(e.elements.reference),O=JF({reference:A,element:k,strategy:"absolute",placement:i}),I=lC(Object.assign({},k,O)),$=p===Rp?I:A,D={top:L.top-$.top+C.top,bottom:$.bottom-L.bottom+C.bottom,left:L.left-$.left+C.left,right:$.right-L.right+C.right},V=e.modifiersData.offset;if(p===Rp&&V){var Y=V[i];Object.keys(D).forEach(function(z){var R=[Eo,ko].indexOf(z)>=0?1:-1,N=[Li,ko].indexOf(z)>=0?"y":"x";D[z]+=Y[N]*R})}return D}function Jhe(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?GF:l,c=lh(r),f=c?s?eA:eA.filter(function(g){return lh(g)===c}):h1,p=f.filter(function(g){return u.indexOf(g)>=0});p.length===0&&(p=f);var m=p.reduce(function(g,v){return g[v]=Sg(e,{placement:v,boundary:i,rootBoundary:o,padding:a})[Ka(v)],g},{});return Object.keys(m).sort(function(g,v){return m[g]-m[v]})}function epe(e){if(Ka(e)===B9)return[];var t=v2(e);return[rA(e),t,rA(t)]}function tpe(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!0:a,l=n.fallbackPlacements,u=n.padding,c=n.boundary,f=n.rootBoundary,p=n.altBoundary,m=n.flipVariations,g=m===void 0?!0:m,v=n.allowedAutoPlacements,x=t.options.placement,C=Ka(x),w=C===x,k=l||(w||!g?[v2(x)]:epe(x)),P=[x].concat(k).reduce(function(se,Ae){return se.concat(Ka(Ae)===B9?Jhe(t,{placement:Ae,boundary:c,rootBoundary:f,padding:u,flipVariations:g,allowedAutoPlacements:v}):Ae)},[]),L=t.rects.reference,A=t.rects.popper,O=new Map,I=!0,$=P[0],D=0;D=0,N=R?"width":"height",U=Sg(t,{placement:V,boundary:c,rootBoundary:f,altBoundary:p,padding:u}),G=R?z?Eo:Ai:z?ko:Li;L[N]>A[N]&&(G=v2(G));var B=v2(G),W=[];if(o&&W.push(U[Y]<=0),s&&W.push(U[G]<=0,U[B]<=0),W.every(function(se){return se})){$=V,I=!1;break}O.set(V,W)}if(I)for(var X=g?3:1,re=function(Ae){var be=P.find(function(De){var fe=O.get(De);if(fe)return fe.slice(0,Ae).every(function(Xe){return Xe})});if(be)return $=be,"break"},le=X;le>0;le--){var he=re(le);if(he==="break")break}t.placement!==$&&(t.modifiersData[r]._skip=!0,t.placement=$,t.reset=!0)}}const npe={name:"flip",enabled:!0,phase:"main",fn:tpe,requiresIfExists:["offset"],data:{_skip:!1}};function oA(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 aA(e){return[Li,Eo,ko,Ai].some(function(t){return e[t]>=0})}function rpe(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=Sg(t,{elementContext:"reference"}),s=Sg(t,{altBoundary:!0}),l=oA(a,r),u=oA(s,i,o),c=aA(l),f=aA(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":f})}const ipe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:rpe};function ope(e,t,n){var r=Ka(e),i=[Ai,Li].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[Ai,Eo].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function ape(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,a=GF.reduce(function(c,f){return c[f]=ope(f,t.rects,o),c},{}),s=a[t.placement],l=s.x,u=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=a}const spe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:ape};function lpe(e){var t=e.state,n=e.name;t.modifiersData[n]=JF({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const upe={name:"popperOffsets",enabled:!0,phase:"read",fn:lpe,data:{}};function cpe(e){return e==="x"?"y":"x"}function dpe(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!1:a,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,f=n.padding,p=n.tether,m=p===void 0?!0:p,g=n.tetherOffset,v=g===void 0?0:g,x=Sg(t,{boundary:l,rootBoundary:u,padding:f,altBoundary:c}),C=Ka(t.placement),w=lh(t.placement),k=!w,P=j9(C),L=cpe(P),A=t.modifiersData.popperOffsets,O=t.rects.reference,I=t.rects.popper,$=typeof v=="function"?v(Object.assign({},t.rects,{placement:t.placement})):v,D=typeof $=="number"?{mainAxis:$,altAxis:$}:Object.assign({mainAxis:0,altAxis:0},$),V=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,Y={x:0,y:0};if(A){if(o){var z,R=P==="y"?Li:Ai,N=P==="y"?ko:Eo,U=P==="y"?"height":"width",G=A[P],B=G+x[R],W=G-x[N],X=m?-I[U]/2:0,re=w===oh?O[U]:I[U],le=w===oh?-I[U]:-O[U],he=t.elements.arrow,se=m&&he?z9(he):{width:0,height:0},Ae=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:qF(),be=Ae[R],De=Ae[N],fe=Dm(0,O[U],se[U]),Xe=k?O[U]/2-X-fe-be-D.mainAxis:re-fe-be-D.mainAxis,rt=k?-O[U]/2+X+fe+De+D.mainAxis:le+fe+De+D.mainAxis,Ze=t.elements.arrow&&p1(t.elements.arrow),et=Ze?P==="y"?Ze.clientTop||0:Ze.clientLeft||0:0,nt=(z=V==null?void 0:V[P])!=null?z:0,ve=G+Xe-nt-et,Qe=G+rt-nt,ct=Dm(m?my(B,ve):B,G,m?kc(W,Qe):W);A[P]=ct,Y[P]=ct-G}if(s){var Je,st=P==="x"?Li:Ai,wt=P==="x"?ko:Eo,J=A[L],xe=L==="y"?"height":"width",Me=J+x[st],$e=J-x[wt],ce=[Li,Ai].indexOf(C)!==-1,we=(Je=V==null?void 0:V[L])!=null?Je:0,ot=ce?Me:J-O[xe]-I[xe]-we+D.altAxis,mt=ce?J+O[xe]+I[xe]-we-D.altAxis:$e,me=m&&ce?$he(ot,J,mt):Dm(m?ot:Me,J,m?mt:$e);A[L]=me,Y[L]=me-J}t.modifiersData[r]=Y}}const fpe={name:"preventOverflow",enabled:!0,phase:"main",fn:dpe,requiresIfExists:["offset"]};function hpe(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function ppe(e){return e===Ao(e)||!wo(e)?H9(e):hpe(e)}function mpe(e){var t=e.getBoundingClientRect(),n=ah(t.width)/e.offsetWidth||1,r=ah(t.height)/e.offsetHeight||1;return n!==1||r!==1}function gpe(e,t,n){n===void 0&&(n=!1);var r=wo(t),i=wo(t)&&mpe(t),o=gu(t),a=sh(e,i,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((ns(t)!=="body"||U9(o))&&(s=ppe(t)),wo(t)?(l=sh(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):o&&(l.x=V9(o))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function vpe(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function i(o){n.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(s){if(!n.has(s)){var l=t.get(s);l&&i(l)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||i(o)}),r}function ype(e){var t=vpe(e);return Lhe.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function bpe(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function Spe(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var sA={placement:"bottom",modifiers:[],strategy:"absolute"};function lA(){for(var e=arguments.length,t=new Array(e),n=0;n({var:e,varRef:t?`var(${e}, ${t})`:`var(${e})`}),or={arrowShadowColor:Dd("--popper-arrow-shadow-color"),arrowSize:Dd("--popper-arrow-size","8px"),arrowSizeHalf:Dd("--popper-arrow-size-half"),arrowBg:Dd("--popper-arrow-bg"),transformOrigin:Dd("--popper-transform-origin"),arrowOffset:Dd("--popper-arrow-offset")};function _pe(e){if(e.includes("top"))return"1px 1px 1px 0 var(--popper-arrow-shadow-color)";if(e.includes("bottom"))return"-1px -1px 1px 0 var(--popper-arrow-shadow-color)";if(e.includes("right"))return"-1px 1px 1px 0 var(--popper-arrow-shadow-color)";if(e.includes("left"))return"1px -1px 1px 0 var(--popper-arrow-shadow-color)"}var kpe={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"},Epe=e=>kpe[e],uA={scroll:!0,resize:!0};function Ppe(e){let t;return typeof e=="object"?t={enabled:!0,options:{...uA,...e}}:t={enabled:e,options:uA},t}var Tpe={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`}},Lpe={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:e})=>{cA(e)},effect:({state:e})=>()=>{cA(e)}},cA=e=>{e.elements.popper.style.setProperty(or.transformOrigin.var,Epe(e.placement))},Ape={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:e})=>{Ope(e)}},Ope=e=>{var t;if(!e.placement)return;const n=Mpe(e.placement);if((t=e.elements)!=null&&t.arrow&&n){Object.assign(e.elements.arrow.style,{[n.property]:n.value,width:or.arrowSize.varRef,height:or.arrowSize.varRef,zIndex:-1});const r={[or.arrowSizeHalf.var]:`calc(${or.arrowSize.varRef} / 2)`,[or.arrowOffset.var]:`calc(${or.arrowSizeHalf.varRef} * -1)`};for(const i in r)e.elements.arrow.style.setProperty(i,r[i])}},Mpe=e=>{if(e.startsWith("top"))return{property:"bottom",value:or.arrowOffset.varRef};if(e.startsWith("bottom"))return{property:"top",value:or.arrowOffset.varRef};if(e.startsWith("left"))return{property:"right",value:or.arrowOffset.varRef};if(e.startsWith("right"))return{property:"left",value:or.arrowOffset.varRef}},Ipe={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:e})=>{dA(e)},effect:({state:e})=>()=>{dA(e)}},dA=e=>{if(!e.elements.arrow)return;const t=e.elements.arrow.querySelector("[data-popper-arrow-inner]");t&&Object.assign(t.style,{transform:"rotate(45deg)",background:or.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:_pe(e.placement)})},Rpe={"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"}},$pe={"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 Dpe(e,t="ltr"){var i;var n;const r=((n=Rpe[e])==null?void 0:n[t])||e;return t==="ltr"?r:(i=$pe[e])!=null?i:r}function ez(e={}){const{enabled:t=!0,modifiers:n,placement:r="bottom",strategy:i="absolute",arrowPadding:o=8,eventListeners:a=!0,offset:s,gutter:l=8,flip:u=!0,boundary:c="clippingParents",preventOverflow:f=!0,matchWidth:p,direction:m="ltr"}=e,g=S.useRef(null),v=S.useRef(null),x=S.useRef(null),C=Dpe(r,m),w=S.useRef(()=>{}),k=S.useCallback(()=>{var D;!t||!g.current||!v.current||((D=w.current)==null||D.call(w),x.current=xpe(g.current,v.current,{placement:C,modifiers:[Ipe,Ape,Lpe,{...Tpe,enabled:!!p},{name:"eventListeners",...Ppe(a)},{name:"arrow",options:{padding:o}},{name:"offset",options:{offset:s!=null?s:[0,l]}},{name:"flip",enabled:!!u,options:{padding:8}},{name:"preventOverflow",enabled:!!f,options:{boundary:c}},...n!=null?n:[]],strategy:i}),x.current.forceUpdate(),w.current=x.current.destroy)},[C,t,n,p,a,o,s,l,u,f,c,i]);S.useEffect(()=>()=>{var D;!g.current&&!v.current&&((D=x.current)==null||D.destroy(),x.current=null)},[]);const P=S.useCallback(D=>{g.current=D,k()},[k]),L=S.useCallback((D={},V=null)=>({...D,ref:ln(P,V)}),[P]),A=S.useCallback(D=>{v.current=D,k()},[k]),O=S.useCallback((D={},V=null)=>({...D,ref:ln(A,V),style:{...D.style,position:i,minWidth:p?void 0:"max-content",inset:"0 auto auto 0"}}),[i,A,p]),I=S.useCallback((D={},V=null)=>{const{size:Y,shadowColor:z,bg:R,style:N,...U}=D;return{...U,ref:V,"data-popper-arrow":"",style:Npe(D)}},[]),$=S.useCallback((D={},V=null)=>({...D,ref:V,"data-popper-arrow-inner":""}),[]);return{update(){var D;(D=x.current)==null||D.update()},forceUpdate(){var D;(D=x.current)==null||D.forceUpdate()},transformOrigin:or.transformOrigin.varRef,referenceRef:P,popperRef:A,getPopperProps:O,getArrowProps:I,getArrowInnerProps:$,getReferenceProps:L}}function Npe(e){const{size:t,shadowColor:n,bg:r,style:i}=e,o={...i,position:"absolute"};return t&&(o["--popper-arrow-size"]=t),n&&(o["--popper-arrow-shadow-color"]=n),r&&(o["--popper-arrow-bg"]=r),o}function tz(e={}){const{onClose:t,onOpen:n,isOpen:r,id:i}=e,o=Fn(n),a=Fn(t),[s,l]=S.useState(e.defaultIsOpen||!1),u=r!==void 0?r:s,c=r!==void 0,f=S.useId(),p=i!=null?i:`disclosure-${f}`,m=S.useCallback(()=>{c||l(!1),a==null||a()},[c,a]),g=S.useCallback(()=>{c||l(!0),o==null||o()},[c,o]),v=S.useCallback(()=>{u?m():g()},[u,g,m]);function x(w={}){return{...w,"aria-expanded":u,"aria-controls":p,onClick(k){var P;(P=w.onClick)==null||P.call(w,k),v()}}}function C(w={}){return{...w,hidden:!u,id:p}}return{isOpen:u,onOpen:g,onClose:m,onToggle:v,isControlled:c,getButtonProps:x,getDisclosureProps:C}}function Bpe(e){const{isOpen:t,ref:n}=e,[r,i]=S.useState(t),[o,a]=S.useState(!1);return S.useEffect(()=>{o||(i(t),a(!0))},[t,o,r]),Cc(()=>n.current,"animationend",()=>{i(t)}),{present:!(t?!1:!r),onComplete(){var l;const u=ihe(n.current),c=new u.CustomEvent("animationend",{bubbles:!0});(l=n.current)==null||l.dispatchEvent(c)}}}function nz(e){const{wasSelected:t,enabled:n,isSelected:r,mode:i="unmount"}=e;return!!(!n||r||i==="keepMounted"&&t)}var la={},Fpe={get exports(){return la},set exports(e){la=e}},Ji={},Ec={},zpe={get exports(){return Ec},set exports(e){Ec=e}},rz={};/** - * @license React - * scheduler.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. - */(function(e){function t(B,W){var X=B.length;B.push(W);e:for(;0>>1,le=B[re];if(0>>1;rei(Ae,X))bei(De,Ae)?(B[re]=De,B[be]=X,re=be):(B[re]=Ae,B[se]=X,re=se);else if(bei(De,X))B[re]=De,B[be]=X,re=be;else break e}}return W}function i(B,W){var X=B.sortIndex-W.sortIndex;return X!==0?X:B.id-W.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],u=[],c=1,f=null,p=3,m=!1,g=!1,v=!1,x=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function k(B){for(var W=n(u);W!==null;){if(W.callback===null)r(u);else if(W.startTime<=B)r(u),W.sortIndex=W.expirationTime,t(l,W);else break;W=n(u)}}function P(B){if(v=!1,k(B),!g)if(n(l)!==null)g=!0,U(L);else{var W=n(u);W!==null&&G(P,W.startTime-B)}}function L(B,W){g=!1,v&&(v=!1,C(I),I=-1),m=!0;var X=p;try{for(k(W),f=n(l);f!==null&&(!(f.expirationTime>W)||B&&!V());){var re=f.callback;if(typeof re=="function"){f.callback=null,p=f.priorityLevel;var le=re(f.expirationTime<=W);W=e.unstable_now(),typeof le=="function"?f.callback=le:f===n(l)&&r(l),k(W)}else r(l);f=n(l)}if(f!==null)var he=!0;else{var se=n(u);se!==null&&G(P,se.startTime-W),he=!1}return he}finally{f=null,p=X,m=!1}}var A=!1,O=null,I=-1,$=5,D=-1;function V(){return!(e.unstable_now()-D<$)}function Y(){if(O!==null){var B=e.unstable_now();D=B;var W=!0;try{W=O(!0,B)}finally{W?z():(A=!1,O=null)}}else A=!1}var z;if(typeof w=="function")z=function(){w(Y)};else if(typeof MessageChannel<"u"){var R=new MessageChannel,N=R.port2;R.port1.onmessage=Y,z=function(){N.postMessage(null)}}else z=function(){x(Y,0)};function U(B){O=B,A||(A=!0,z())}function G(B,W){I=x(function(){B(e.unstable_now())},W)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(B){B.callback=null},e.unstable_continueExecution=function(){g||m||(g=!0,U(L))},e.unstable_forceFrameRate=function(B){0>B||125re?(B.sortIndex=X,t(u,B),n(l)===null&&B===n(u)&&(v?(C(I),I=-1):v=!0,G(P,X-re))):(B.sortIndex=le,t(l,B),g||m||(g=!0,U(L))),B},e.unstable_shouldYield=V,e.unstable_wrapCallback=function(B){var W=p;return function(){var X=p;p=W;try{return B.apply(this,arguments)}finally{p=X}}}})(rz);(function(e){e.exports=rz})(zpe);/** - * @license React - * react-dom.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 iz=S,qi=Ec;function Se(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),uC=Object.prototype.hasOwnProperty,jpe=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,fA={},hA={};function Hpe(e){return uC.call(hA,e)?!0:uC.call(fA,e)?!1:jpe.test(e)?hA[e]=!0:(fA[e]=!0,!1)}function Vpe(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Upe(e,t,n,r){if(t===null||typeof t>"u"||Vpe(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function vi(e,t,n,r,i,o,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var Nr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Nr[e]=new vi(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Nr[t]=new vi(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Nr[e]=new vi(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Nr[e]=new vi(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Nr[e]=new vi(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Nr[e]=new vi(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Nr[e]=new vi(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Nr[e]=new vi(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Nr[e]=new vi(e,5,!1,e.toLowerCase(),null,!1,!1)});var W9=/[\-:]([a-z])/g;function G9(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(W9,G9);Nr[t]=new vi(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(W9,G9);Nr[t]=new vi(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(W9,G9);Nr[t]=new vi(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Nr[e]=new vi(e,1,!1,e.toLowerCase(),null,!1,!1)});Nr.xlinkHref=new vi("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Nr[e]=new vi(e,1,!1,e.toLowerCase(),null,!0,!0)});function K9(e,t,n,r){var i=Nr.hasOwnProperty(t)?Nr[t]:null;(i!==null?i.type!==0:r||!(2s||i[a]!==o[s]){var l=` -`+i[a].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=a&&0<=s);break}}}finally{NS=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?sm(e):""}function Wpe(e){switch(e.tag){case 5:return sm(e.type);case 16:return sm("Lazy");case 13:return sm("Suspense");case 19:return sm("SuspenseList");case 0:case 2:case 15:return e=BS(e.type,!1),e;case 11:return e=BS(e.type.render,!1),e;case 1:return e=BS(e.type,!0),e;default:return""}}function hC(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case uf:return"Fragment";case lf:return"Portal";case cC:return"Profiler";case Y9:return"StrictMode";case dC:return"Suspense";case fC:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case sz:return(e.displayName||"Context")+".Consumer";case az:return(e._context.displayName||"Context")+".Provider";case q9:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case X9:return t=e.displayName||null,t!==null?t:hC(e.type)||"Memo";case Pl:t=e._payload,e=e._init;try{return hC(e(t))}catch(n){}}return null}function Gpe(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return hC(t);case 8:return t===Y9?"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 t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function iu(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function uz(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Kpe(e){var t=uz(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,o.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ov(e){e._valueTracker||(e._valueTracker=Kpe(e))}function cz(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=uz(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function gy(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch(t){return e.body}}function pC(e,t){var n=t.checked;return jn({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n!=null?n:e._wrapperState.initialChecked})}function mA(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=iu(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function dz(e,t){t=t.checked,t!=null&&K9(e,"checked",t,!1)}function mC(e,t){dz(e,t);var n=iu(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?gC(e,t.type,n):t.hasOwnProperty("defaultValue")&&gC(e,t.type,iu(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function gA(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function gC(e,t,n){(t!=="number"||gy(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var lm=Array.isArray;function Bf(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=av.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Cg(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Bm={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ype=["Webkit","ms","Moz","O"];Object.keys(Bm).forEach(function(e){Ype.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Bm[t]=Bm[e]})});function mz(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Bm.hasOwnProperty(e)&&Bm[e]?(""+t).trim():t+"px"}function gz(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=mz(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var qpe=jn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function bC(e,t){if(t){if(qpe[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Se(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Se(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Se(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Se(62))}}function SC(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var wC=null;function Z9(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var CC=null,Ff=null,zf=null;function bA(e){if(e=v1(e)){if(typeof CC!="function")throw Error(Se(280));var t=e.stateNode;t&&(t=p3(t),CC(e.stateNode,e.type,t))}}function vz(e){Ff?zf?zf.push(e):zf=[e]:Ff=e}function yz(){if(Ff){var e=Ff,t=zf;if(zf=Ff=null,bA(e),t)for(e=0;e>>=0,e===0?32:31-(ame(e)/sme|0)|0}var sv=64,lv=4194304;function um(e){switch(e&-e){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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Sy(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,a=n&268435455;if(a!==0){var s=a&~i;s!==0?r=um(s):(o&=a,o!==0&&(r=um(o)))}else a=n&~i,a!==0?r=um(a):o!==0&&(r=um(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function m1(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ia(t),e[t]=n}function dme(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=zm),TA=String.fromCharCode(32),LA=!1;function Bz(e,t){switch(e){case"keyup":return Fme.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Fz(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var cf=!1;function jme(e,t){switch(e){case"compositionend":return Fz(t);case"keypress":return t.which!==32?null:(LA=!0,TA);case"textInput":return e=t.data,e===TA&&LA?null:e;default:return null}}function Hme(e,t){if(cf)return e==="compositionend"||!o8&&Bz(e,t)?(e=Dz(),b2=n8=Nl=null,cf=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=IA(n)}}function Vz(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Vz(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Uz(){for(var e=window,t=gy();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch(r){n=!1}if(n)e=t.contentWindow;else break;t=gy(e.document)}return t}function a8(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Zme(e){var t=Uz(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Vz(n.ownerDocument.documentElement,n)){if(r!==null&&a8(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=RA(n,o);var a=RA(n,r);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,df=null,TC=null,Hm=null,LC=!1;function $A(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;LC||df==null||df!==gy(r)||(r=df,"selectionStart"in r&&a8(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Hm&&Tg(Hm,r)||(Hm=r,r=xy(TC,"onSelect"),0pf||(e.current=$C[pf],$C[pf]=null,pf--)}function pn(e,t){pf++,$C[pf]=e.current,e.current=t}var ou={},ni=yu(ou),Oi=yu(!1),Rc=ou;function ch(e,t){var n=e.type.contextTypes;if(!n)return ou;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Mi(e){return e=e.childContextTypes,e!=null}function ky(){Pn(Oi),Pn(ni)}function HA(e,t,n){if(ni.current!==ou)throw Error(Se(168));pn(ni,t),pn(Oi,n)}function Jz(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(Se(108,Gpe(e)||"Unknown",i));return jn({},n,r)}function Ey(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ou,Rc=ni.current,pn(ni,e),pn(Oi,Oi.current),!0}function VA(e,t,n){var r=e.stateNode;if(!r)throw Error(Se(169));n?(e=Jz(e,t,Rc),r.__reactInternalMemoizedMergedChildContext=e,Pn(Oi),Pn(ni),pn(ni,e)):Pn(Oi),pn(Oi,n)}var Ps=null,m3=!1,QS=!1;function ej(e){Ps===null?Ps=[e]:Ps.push(e)}function uge(e){m3=!0,ej(e)}function bu(){if(!QS&&Ps!==null){QS=!0;var e=0,t=Zt;try{var n=Ps;for(Zt=1;e>=a,i-=a,As=1<<32-ia(t)+i|n<I?($=O,O=null):$=O.sibling;var D=p(C,O,k[I],P);if(D===null){O===null&&(O=$);break}e&&O&&D.alternate===null&&t(C,O),w=o(D,w,I),A===null?L=D:A.sibling=D,A=D,O=$}if(I===k.length)return n(C,O),In&&Qu(C,I),L;if(O===null){for(;II?($=O,O=null):$=O.sibling;var V=p(C,O,D.value,P);if(V===null){O===null&&(O=$);break}e&&O&&V.alternate===null&&t(C,O),w=o(V,w,I),A===null?L=V:A.sibling=V,A=V,O=$}if(D.done)return n(C,O),In&&Qu(C,I),L;if(O===null){for(;!D.done;I++,D=k.next())D=f(C,D.value,P),D!==null&&(w=o(D,w,I),A===null?L=D:A.sibling=D,A=D);return In&&Qu(C,I),L}for(O=r(C,O);!D.done;I++,D=k.next())D=m(O,C,I,D.value,P),D!==null&&(e&&D.alternate!==null&&O.delete(D.key===null?I:D.key),w=o(D,w,I),A===null?L=D:A.sibling=D,A=D);return e&&O.forEach(function(Y){return t(C,Y)}),In&&Qu(C,I),L}function x(C,w,k,P){if(typeof k=="object"&&k!==null&&k.type===uf&&k.key===null&&(k=k.props.children),typeof k=="object"&&k!==null){switch(k.$$typeof){case iv:e:{for(var L=k.key,A=w;A!==null;){if(A.key===L){if(L=k.type,L===uf){if(A.tag===7){n(C,A.sibling),w=i(A,k.props.children),w.return=C,C=w;break e}}else if(A.elementType===L||typeof L=="object"&&L!==null&&L.$$typeof===Pl&&XA(L)===A.type){n(C,A.sibling),w=i(A,k.props),w.ref=zp(C,A,k),w.return=C,C=w;break e}n(C,A);break}else t(C,A);A=A.sibling}k.type===uf?(w=Tc(k.props.children,C.mode,P,k.key),w.return=C,C=w):(P=P2(k.type,k.key,k.props,null,C.mode,P),P.ref=zp(C,w,k),P.return=C,C=P)}return a(C);case lf:e:{for(A=k.key;w!==null;){if(w.key===A)if(w.tag===4&&w.stateNode.containerInfo===k.containerInfo&&w.stateNode.implementation===k.implementation){n(C,w.sibling),w=i(w,k.children||[]),w.return=C,C=w;break e}else{n(C,w);break}else t(C,w);w=w.sibling}w=aw(k,C.mode,P),w.return=C,C=w}return a(C);case Pl:return A=k._init,x(C,w,A(k._payload),P)}if(lm(k))return g(C,w,k,P);if($p(k))return v(C,w,k,P);mv(C,k)}return typeof k=="string"&&k!==""||typeof k=="number"?(k=""+k,w!==null&&w.tag===6?(n(C,w.sibling),w=i(w,k),w.return=C,C=w):(n(C,w),w=ow(k,C.mode,P),w.return=C,C=w),a(C)):n(C,w)}return x}var fh=lj(!0),uj=lj(!1),y1={},qa=yu(y1),Mg=yu(y1),Ig=yu(y1);function mc(e){if(e===y1)throw Error(Se(174));return e}function m8(e,t){switch(pn(Ig,t),pn(Mg,e),pn(qa,y1),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:yC(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=yC(t,e)}Pn(qa),pn(qa,t)}function hh(){Pn(qa),Pn(Mg),Pn(Ig)}function cj(e){mc(Ig.current);var t=mc(qa.current),n=yC(t,e.type);t!==n&&(pn(Mg,e),pn(qa,n))}function g8(e){Mg.current===e&&(Pn(qa),Pn(Mg))}var Nn=yu(0);function My(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var JS=[];function v8(){for(var e=0;en?n:4,e(!0);var r=ew.transition;ew.transition={};try{e(!1),t()}finally{Zt=n,ew.transition=r}}function Ej(){return To().memoizedState}function hge(e,t,n){var r=Yl(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Pj(e))Tj(t,n);else if(n=ij(e,t,n,r),n!==null){var i=hi();oa(n,e,r,i),Lj(n,t,r)}}function pge(e,t,n){var r=Yl(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Pj(e))Tj(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var a=t.lastRenderedState,s=o(a,n);if(i.hasEagerState=!0,i.eagerState=s,ua(s,a)){var l=t.interleaved;l===null?(i.next=i,h8(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch(u){}finally{}n=ij(e,t,i,r),n!==null&&(i=hi(),oa(n,e,r,i),Lj(n,t,r))}}function Pj(e){var t=e.alternate;return e===zn||t!==null&&t===zn}function Tj(e,t){Vm=Iy=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Lj(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,J9(e,n)}}var Ry={readContext:Po,useCallback:Gr,useContext:Gr,useEffect:Gr,useImperativeHandle:Gr,useInsertionEffect:Gr,useLayoutEffect:Gr,useMemo:Gr,useReducer:Gr,useRef:Gr,useState:Gr,useDebugValue:Gr,useDeferredValue:Gr,useTransition:Gr,useMutableSource:Gr,useSyncExternalStore:Gr,useId:Gr,unstable_isNewReconciler:!1},mge={readContext:Po,useCallback:function(e,t){return Oa().memoizedState=[e,t===void 0?null:t],e},useContext:Po,useEffect:QA,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,x2(4194308,4,wj.bind(null,t,e),n)},useLayoutEffect:function(e,t){return x2(4194308,4,e,t)},useInsertionEffect:function(e,t){return x2(4,2,e,t)},useMemo:function(e,t){var n=Oa();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Oa();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=hge.bind(null,zn,e),[r.memoizedState,e]},useRef:function(e){var t=Oa();return e={current:e},t.memoizedState=e},useState:ZA,useDebugValue:C8,useDeferredValue:function(e){return Oa().memoizedState=e},useTransition:function(){var e=ZA(!1),t=e[0];return e=fge.bind(null,e[1]),Oa().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=zn,i=Oa();if(In){if(n===void 0)throw Error(Se(407));n=n()}else{if(n=t(),_r===null)throw Error(Se(349));Dc&30||hj(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,QA(mj.bind(null,r,o,e),[e]),r.flags|=2048,Dg(9,pj.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Oa(),t=_r.identifierPrefix;if(In){var n=Os,r=As;n=(r&~(1<<32-ia(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Rg++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Na]=t,e[Og]=r,Bj(e,t,!1,!1),t.stateNode=e;e:{switch(a=SC(n,r),n){case"dialog":bn("cancel",e),bn("close",e),i=r;break;case"iframe":case"object":case"embed":bn("load",e),i=r;break;case"video":case"audio":for(i=0;imh&&(t.flags|=128,r=!0,jp(o,!1),t.lanes=4194304)}else{if(!r)if(e=My(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),jp(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!In)return Kr(t),null}else 2*Qn()-o.renderingStartTime>mh&&n!==1073741824&&(t.flags|=128,r=!0,jp(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(n=o.last,n!==null?n.sibling=a:t.child=a,o.last=a)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Qn(),t.sibling=null,n=Nn.current,pn(Nn,r?n&1|2:n&1),t):(Kr(t),null);case 22:case 23:return T8(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ji&1073741824&&(Kr(t),t.subtreeFlags&6&&(t.flags|=8192)):Kr(t),null;case 24:return null;case 25:return null}throw Error(Se(156,t.tag))}function xge(e,t){switch(l8(t),t.tag){case 1:return Mi(t.type)&&ky(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return hh(),Pn(Oi),Pn(ni),v8(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return g8(t),null;case 13:if(Pn(Nn),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Se(340));dh()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Pn(Nn),null;case 4:return hh(),null;case 10:return f8(t.type._context),null;case 22:case 23:return T8(),null;case 24:return null;default:return null}}var vv=!1,Qr=!1,_ge=typeof WeakSet=="function"?WeakSet:Set,He=null;function yf(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Gn(e,t,r)}else n.current=null}function KC(e,t,n){try{n()}catch(r){Gn(e,t,r)}}var sO=!1;function kge(e,t){if(AC=wy,e=Uz(),a8(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch(P){n=null;break e}var a=0,s=-1,l=-1,u=0,c=0,f=e,p=null;t:for(;;){for(var m;f!==n||i!==0&&f.nodeType!==3||(s=a+i),f!==o||r!==0&&f.nodeType!==3||(l=a+r),f.nodeType===3&&(a+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break t;if(p===n&&++u===i&&(s=a),p===o&&++c===r&&(l=a),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(OC={focusedElem:e,selectionRange:n},wy=!1,He=t;He!==null;)if(t=He,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,He=e;else for(;He!==null;){t=He;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var v=g.memoizedProps,x=g.memoizedState,C=t.stateNode,w=C.getSnapshotBeforeUpdate(t.elementType===t.type?v:Go(t.type,v),x);C.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var k=t.stateNode.containerInfo;k.nodeType===1?k.textContent="":k.nodeType===9&&k.documentElement&&k.removeChild(k.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Se(163))}}catch(P){Gn(t,t.return,P)}if(e=t.sibling,e!==null){e.return=t.return,He=e;break}He=t.return}return g=sO,sO=!1,g}function Um(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&KC(t,n,o)}i=i.next}while(i!==r)}}function y3(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function YC(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function jj(e){var t=e.alternate;t!==null&&(e.alternate=null,jj(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Na],delete t[Og],delete t[RC],delete t[sge],delete t[lge])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Hj(e){return e.tag===5||e.tag===3||e.tag===4}function lO(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Hj(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function qC(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=_y));else if(r!==4&&(e=e.child,e!==null))for(qC(e,t,n),e=e.sibling;e!==null;)qC(e,t,n),e=e.sibling}function XC(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(XC(e,t,n),e=e.sibling;e!==null;)XC(e,t,n),e=e.sibling}var Mr=null,Ko=!1;function Sl(e,t,n){for(n=n.child;n!==null;)Vj(e,t,n),n=n.sibling}function Vj(e,t,n){if(Ya&&typeof Ya.onCommitFiberUnmount=="function")try{Ya.onCommitFiberUnmount(c3,n)}catch(s){}switch(n.tag){case 5:Qr||yf(n,t);case 6:var r=Mr,i=Ko;Mr=null,Sl(e,t,n),Mr=r,Ko=i,Mr!==null&&(Ko?(e=Mr,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Mr.removeChild(n.stateNode));break;case 18:Mr!==null&&(Ko?(e=Mr,n=n.stateNode,e.nodeType===8?ZS(e.parentNode,n):e.nodeType===1&&ZS(e,n),Eg(e)):ZS(Mr,n.stateNode));break;case 4:r=Mr,i=Ko,Mr=n.stateNode.containerInfo,Ko=!0,Sl(e,t,n),Mr=r,Ko=i;break;case 0:case 11:case 14:case 15:if(!Qr&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&KC(n,t,a),i=i.next}while(i!==r)}Sl(e,t,n);break;case 1:if(!Qr&&(yf(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Gn(n,t,s)}Sl(e,t,n);break;case 21:Sl(e,t,n);break;case 22:n.mode&1?(Qr=(r=Qr)||n.memoizedState!==null,Sl(e,t,n),Qr=r):Sl(e,t,n);break;default:Sl(e,t,n)}}function uO(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new _ge),t.forEach(function(r){var i=Rge.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Vo(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=a),r&=~o}if(r=i,r=Qn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Pge(r/1960))-r,10e?16:e,Bl===null)var r=!1;else{if(e=Bl,Bl=null,Ny=0,Ot&6)throw Error(Se(331));var i=Ot;for(Ot|=4,He=e.current;He!==null;){var o=He,a=o.child;if(He.flags&16){var s=o.deletions;if(s!==null){for(var l=0;lQn()-E8?Pc(e,0):k8|=n),Ii(e,t)}function Zj(e,t){t===0&&(e.mode&1?(t=lv,lv<<=1,!(lv&130023424)&&(lv=4194304)):t=1);var n=hi();e=Hs(e,t),e!==null&&(m1(e,t,n),Ii(e,n))}function Ige(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Zj(e,n)}function Rge(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(Se(314))}r!==null&&r.delete(t),Zj(e,n)}var Qj;Qj=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Oi.current)Ti=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ti=!1,wge(e,t,n);Ti=!!(e.flags&131072)}else Ti=!1,In&&t.flags&1048576&&tj(t,Ty,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;_2(e,t),e=t.pendingProps;var i=ch(t,ni.current);Hf(t,n),i=b8(null,t,r,e,i,n);var o=S8();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Mi(r)?(o=!0,Ey(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,p8(t),i.updater=g3,t.stateNode=i,i._reactInternals=t,zC(t,r,e,n),t=VC(null,t,r,!0,o,n)):(t.tag=0,In&&o&&s8(t),li(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(_2(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=Dge(r),e=Go(r,e),i){case 0:t=HC(null,t,r,e,n);break e;case 1:t=iO(null,t,r,e,n);break e;case 11:t=nO(null,t,r,e,n);break e;case 14:t=rO(null,t,r,Go(r.type,e),n);break e}throw Error(Se(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Go(r,i),HC(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Go(r,i),iO(e,t,r,i,n);case 3:e:{if($j(t),e===null)throw Error(Se(387));r=t.pendingProps,o=t.memoizedState,i=o.element,oj(e,t),Oy(t,r,null,n);var a=t.memoizedState;if(r=a.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=ph(Error(Se(423)),t),t=oO(e,t,r,n,i);break e}else if(r!==i){i=ph(Error(Se(424)),t),t=oO(e,t,r,n,i);break e}else for(Vi=Wl(t.stateNode.containerInfo.firstChild),Gi=t,In=!0,qo=null,n=uj(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(dh(),r===i){t=Vs(e,t,n);break e}li(e,t,r,n)}t=t.child}return t;case 5:return cj(t),e===null&&NC(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,a=i.children,MC(r,i)?a=null:o!==null&&MC(r,o)&&(t.flags|=32),Rj(e,t),li(e,t,a,n),t.child;case 6:return e===null&&NC(t),null;case 13:return Dj(e,t,n);case 4:return m8(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=fh(t,null,r,n):li(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Go(r,i),nO(e,t,r,i,n);case 7:return li(e,t,t.pendingProps,n),t.child;case 8:return li(e,t,t.pendingProps.children,n),t.child;case 12:return li(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,a=i.value,pn(Ly,r._currentValue),r._currentValue=a,o!==null)if(ua(o.value,a)){if(o.children===i.children&&!Oi.current){t=Vs(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var s=o.dependencies;if(s!==null){a=o.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=Ms(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),BC(o.return,n,t),s.lanes|=n;break}l=l.next}}else if(o.tag===10)a=o.type===t.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(Se(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),BC(a,n,t),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}li(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Hf(t,n),i=Po(i),r=r(i),t.flags|=1,li(e,t,r,n),t.child;case 14:return r=t.type,i=Go(r,t.pendingProps),i=Go(r.type,i),rO(e,t,r,i,n);case 15:return Mj(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Go(r,i),_2(e,t),t.tag=1,Mi(r)?(e=!0,Ey(t)):e=!1,Hf(t,n),sj(t,r,i),zC(t,r,i,n),VC(null,t,r,!0,e,n);case 19:return Nj(e,t,n);case 22:return Ij(e,t,n)}throw Error(Se(156,t.tag))};function Jj(e,t){return kz(e,t)}function $ge(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function bo(e,t,n,r){return new $ge(e,t,n,r)}function A8(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Dge(e){if(typeof e=="function")return A8(e)?1:0;if(e!=null){if(e=e.$$typeof,e===q9)return 11;if(e===X9)return 14}return 2}function ql(e,t){var n=e.alternate;return n===null?(n=bo(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function P2(e,t,n,r,i,o){var a=2;if(r=e,typeof e=="function")A8(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case uf:return Tc(n.children,i,o,t);case Y9:a=8,i|=8;break;case cC:return e=bo(12,n,t,i|2),e.elementType=cC,e.lanes=o,e;case dC:return e=bo(13,n,t,i),e.elementType=dC,e.lanes=o,e;case fC:return e=bo(19,n,t,i),e.elementType=fC,e.lanes=o,e;case lz:return S3(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case az:a=10;break e;case sz:a=9;break e;case q9:a=11;break e;case X9:a=14;break e;case Pl:a=16,r=null;break e}throw Error(Se(130,e==null?e:typeof e,""))}return t=bo(a,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function Tc(e,t,n,r){return e=bo(7,e,r,t),e.lanes=n,e}function S3(e,t,n,r){return e=bo(22,e,r,t),e.elementType=lz,e.lanes=n,e.stateNode={isHidden:!1},e}function ow(e,t,n){return e=bo(6,e,null,t),e.lanes=n,e}function aw(e,t,n){return t=bo(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Nge(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=zS(0),this.expirationTimes=zS(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zS(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function O8(e,t,n,r,i,o,a,s,l){return e=new Nge(e,t,n,s,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=bo(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},p8(o),e}function Bge(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}t(),e.exports=Ji})(Fpe);const Sv=M7(la);var[Vge,Uge]=Kt({strict:!1,name:"PortalManagerContext"});function rH(e){const{children:t,zIndex:n}=e;return M.createElement(Vge,{value:{zIndex:n}},t)}rH.displayName="PortalManager";var[iH,Wge]=Kt({strict:!1,name:"PortalContext"}),$8="chakra-portal",Gge=".chakra-portal",Kge=e=>M.createElement("div",{className:"chakra-portal-zIndex",style:{position:"absolute",zIndex:e.zIndex,top:0,left:0,right:0}},e.children),Yge=e=>{const{appendToParentPortal:t,children:n}=e,[r,i]=S.useState(null),o=S.useRef(null),[,a]=S.useState({});S.useEffect(()=>a({}),[]);const s=Wge(),l=Uge();ea(()=>{if(!r)return;const c=r.ownerDocument,f=t&&s!=null?s:c.body;if(!f)return;o.current=c.createElement("div"),o.current.className=$8,f.appendChild(o.current),a({});const p=o.current;return()=>{f.contains(p)&&f.removeChild(p)}},[r]);const u=l!=null&&l.zIndex?M.createElement(Kge,{zIndex:l==null?void 0:l.zIndex},n):n;return o.current?la.createPortal(M.createElement(iH,{value:o.current},u),o.current):M.createElement("span",{ref:c=>{c&&i(c)}})},qge=e=>{const{children:t,containerRef:n,appendToParentPortal:r}=e,i=n.current,o=i!=null?i:typeof window<"u"?document.body:void 0,a=S.useMemo(()=>{const l=i==null?void 0:i.ownerDocument.createElement("div");return l&&(l.className=$8),l},[i]),[,s]=S.useState({});return ea(()=>s({}),[]),ea(()=>{if(!(!a||!o))return o.appendChild(a),()=>{o.removeChild(a)}},[a,o]),o&&a?la.createPortal(M.createElement(iH,{value:r?a:null},t),a):null};function Yc(e){const{containerRef:t,...n}=e;return t?M.createElement(qge,{containerRef:t,...n}):M.createElement(Yge,{...n})}Yc.defaultProps={appendToParentPortal:!0};Yc.className=$8;Yc.selector=Gge;Yc.displayName="Portal";var Xge=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Bd=new WeakMap,wv=new WeakMap,Cv={},sw=0,oH=function(e){return e&&(e.host||oH(e.parentNode))},Zge=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=oH(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return Boolean(n)})},Qge=function(e,t,n,r){var i=Zge(t,Array.isArray(e)?e:[e]);Cv[n]||(Cv[n]=new WeakMap);var o=Cv[n],a=[],s=new Set,l=new Set(i),u=function(f){!f||s.has(f)||(s.add(f),u(f.parentNode))};i.forEach(u);var c=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(p){if(s.has(p))c(p);else{var m=p.getAttribute(r),g=m!==null&&m!=="false",v=(Bd.get(p)||0)+1,x=(o.get(p)||0)+1;Bd.set(p,v),o.set(p,x),a.push(p),v===1&&g&&wv.set(p,!0),x===1&&p.setAttribute(n,"true"),g||p.setAttribute(r,"true")}})};return c(t),s.clear(),sw++,function(){a.forEach(function(f){var p=Bd.get(f)-1,m=o.get(f)-1;Bd.set(f,p),o.set(f,m),p||(wv.has(f)||f.removeAttribute(r),wv.delete(f)),m||f.removeAttribute(n)}),sw--,sw||(Bd=new WeakMap,Bd=new WeakMap,wv=new WeakMap,Cv={})}},aH=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||Xge(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),Qge(r,i,n,"aria-hidden")):function(){return null}};function D8(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var Xt={},Jge={get exports(){return Xt},set exports(e){Xt=e}},e1e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",t1e=e1e,n1e=t1e;function sH(){}function lH(){}lH.resetWarningCache=sH;var r1e=function(){function e(r,i,o,a,s,l){if(l!==n1e){var u=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 u.name="Invariant Violation",u}}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:lH,resetWarningCache:sH};return n.PropTypes=n,n};Jge.exports=r1e();var tx="data-focus-lock",uH="data-focus-lock-disabled",i1e="data-no-focus-lock",o1e="data-autofocus-inside",a1e="data-no-autofocus";function s1e(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function l1e(e,t){var n=S.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}function cH(e,t){return l1e(t||null,function(n){return e.forEach(function(r){return s1e(r,n)})})}var lw={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"};function dH(e){return e}function fH(e,t){t===void 0&&(t=dH);var n=[],r=!1,i={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(o){var a=t(o,r);return n.push(a),function(){n=n.filter(function(s){return s!==a})}},assignSyncMedium:function(o){for(r=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(s){return o(s)},filter:function(){return n}}},assignMedium:function(o){r=!0;var a=[];if(n.length){var s=n;n=[],s.forEach(o),a=n}var l=function(){var c=a;a=[],c.forEach(o)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(c){a.push(c),u()},filter:function(c){return a=a.filter(c),n}}}};return i}function N8(e,t){return t===void 0&&(t=dH),fH(e,t)}function hH(e){e===void 0&&(e={});var t=fH(null);return t.options=Da({async:!0,ssr:!1},e),t}var pH=function(e){var t=e.sideCar,n=iF(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 S.createElement(r,Da({},n))};pH.isSideCarExport=!0;function u1e(e,t){return e.useMedium(t),pH}var mH=N8({},function(e){var t=e.target,n=e.currentTarget;return{target:t,currentTarget:n}}),gH=N8(),c1e=N8(),d1e=hH({async:!0}),f1e=[],B8=S.forwardRef(function(t,n){var r,i=S.useState(),o=i[0],a=i[1],s=S.useRef(),l=S.useRef(!1),u=S.useRef(null),c=t.children,f=t.disabled,p=t.noFocusGuards,m=t.persistentFocus,g=t.crossFrame,v=t.autoFocus;t.allowTextSelection;var x=t.group,C=t.className,w=t.whiteList,k=t.hasPositiveIndices,P=t.shards,L=P===void 0?f1e:P,A=t.as,O=A===void 0?"div":A,I=t.lockProps,$=I===void 0?{}:I,D=t.sideCar,V=t.returnFocus,Y=t.focusOptions,z=t.onActivation,R=t.onDeactivation,N=S.useState({}),U=N[0],G=S.useCallback(function(){u.current=u.current||document&&document.activeElement,s.current&&z&&z(s.current),l.current=!0},[z]),B=S.useCallback(function(){l.current=!1,R&&R(s.current)},[R]);S.useEffect(function(){f||(u.current=null)},[]);var W=S.useCallback(function(De){var fe=u.current;if(fe&&fe.focus){var Xe=typeof V=="function"?V(fe):V;if(Xe){var rt=typeof Xe=="object"?Xe:void 0;u.current=null,De?Promise.resolve().then(function(){return fe.focus(rt)}):fe.focus(rt)}}},[V]),X=S.useCallback(function(De){l.current&&mH.useMedium(De)},[]),re=gH.useMedium,le=S.useCallback(function(De){s.current!==De&&(s.current=De,a(De))},[]),he=Dt((r={},r[uH]=f&&"disabled",r[tx]=x,r),$),se=p!==!0,Ae=se&&p!=="tail",be=cH([n,le]);return S.createElement(S.Fragment,null,se&&[S.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:f?-1:0,style:lw}),k?S.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:f?-1:1,style:lw}):null],!f&&S.createElement(D,{id:U,sideCar:d1e,observed:o,disabled:f,persistentFocus:m,crossFrame:g,autoFocus:v,whiteList:w,shards:L,onActivation:G,onDeactivation:B,returnFocus:W,focusOptions:Y}),S.createElement(O,Dt({ref:be},he,{className:C,onBlur:re,onFocus:X}),c),Ae&&S.createElement("div",{"data-focus-guard":!0,tabIndex:f?-1:0,style:lw}))});B8.propTypes={};B8.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 vH=B8;function nx(e,t){return nx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},nx(e,t)}function F8(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,nx(e,t)}function yH(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h1e(e,t){function n(r){return r.displayName||r.name||"Component"}return function(i){var o=[],a;function s(){a=e(o.map(function(u){return u.props})),t(a)}var l=function(u){F8(c,u);function c(){return u.apply(this,arguments)||this}c.peek=function(){return a};var f=c.prototype;return f.componentDidMount=function(){o.push(this),s()},f.componentDidUpdate=function(){s()},f.componentWillUnmount=function(){var m=o.indexOf(this);o.splice(m,1),s()},f.render=function(){return M.createElement(i,this.props)},c}(S.PureComponent);return yH(l,"displayName","SideEffect("+n(i)+")"),l}}var ls=function(e){for(var t=Array(e.length),n=0;n=0}).sort(w1e)},C1e=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],j8=C1e.join(","),x1e="".concat(j8,", [data-focus-guard]"),PH=function(e,t){var n;return ls(((n=e.shadowRoot)===null||n===void 0?void 0:n.children)||e.children).reduce(function(r,i){return r.concat(i.matches(t?x1e:j8)?[i]:[],PH(i))},[])},H8=function(e,t){return e.reduce(function(n,r){return n.concat(PH(r,t),r.parentNode?ls(r.parentNode.querySelectorAll(j8)).filter(function(i){return i===r}):[])},[])},_1e=function(e){var t=e.querySelectorAll("[".concat(o1e,"]"));return ls(t).map(function(n){return H8([n])}).reduce(function(n,r){return n.concat(r)},[])},V8=function(e,t){return ls(e).filter(function(n){return wH(t,n)}).filter(function(n){return y1e(n)})},vO=function(e,t){return t===void 0&&(t=new Map),ls(e).filter(function(n){return CH(t,n)})},ix=function(e,t,n){return EH(V8(H8(e,n),t),!0,n)},yO=function(e,t){return EH(V8(H8(e),t),!1)},k1e=function(e,t){return V8(_1e(e),t)},Bg=function(e,t){return e.shadowRoot?Bg(e.shadowRoot,t):Object.getPrototypeOf(e).contains!==void 0&&Object.getPrototypeOf(e).contains.call(e,t)?!0:ls(e.children).some(function(n){return Bg(n,t)})},E1e=function(e){for(var t=new Set,n=e.length,r=0;r0&&t.add(i),(o&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter(function(a,s){return!t.has(s)})},TH=function(e){return e.parentNode?TH(e.parentNode):e},U8=function(e){var t=rx(e);return t.filter(Boolean).reduce(function(n,r){var i=r.getAttribute(tx);return n.push.apply(n,i?E1e(ls(TH(r).querySelectorAll("[".concat(tx,'="').concat(i,'"]:not([').concat(uH,'="disabled"])')))):[r]),n},[])},LH=function(e){return e.activeElement?e.activeElement.shadowRoot?LH(e.activeElement.shadowRoot):e.activeElement:void 0},W8=function(){return document.activeElement?document.activeElement.shadowRoot?LH(document.activeElement.shadowRoot):document.activeElement:void 0},P1e=function(e){return e===document.activeElement},T1e=function(e){return Boolean(ls(e.querySelectorAll("iframe")).some(function(t){return P1e(t)}))},AH=function(e){var t=document&&W8();return!t||t.dataset&&t.dataset.focusGuard?!1:U8(e).some(function(n){return Bg(n,t)||T1e(n)})},L1e=function(){var e=document&&W8();return e?ls(document.querySelectorAll("[".concat(i1e,"]"))).some(function(t){return Bg(t,e)}):!1},A1e=function(e,t){return t.filter(kH).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},G8=function(e,t){return kH(e)&&e.name?A1e(e,t):e},O1e=function(e){var t=new Set;return e.forEach(function(n){return t.add(G8(n,e))}),e.filter(function(n){return t.has(n)})},bO=function(e){return e[0]&&e.length>1?G8(e[0],e):e[0]},SO=function(e,t){return e.length>1?e.indexOf(G8(e[t],e)):t},OH="NEW_FOCUS",M1e=function(e,t,n,r){var i=e.length,o=e[0],a=e[i-1],s=z8(n);if(!(n&&e.indexOf(n)>=0)){var l=n!==void 0?t.indexOf(n):-1,u=r?t.indexOf(r):l,c=r?e.indexOf(r):-1,f=l-u,p=t.indexOf(o),m=t.indexOf(a),g=O1e(t),v=n!==void 0?g.indexOf(n):-1,x=v-(r?g.indexOf(r):l),C=SO(e,0),w=SO(e,i-1);if(l===-1||c===-1)return OH;if(!f&&c>=0)return c;if(l<=p&&s&&Math.abs(f)>1)return w;if(l>=m&&s&&Math.abs(f)>1)return C;if(f&&Math.abs(x)>1)return c;if(l<=p)return w;if(l>m)return C;if(f)return Math.abs(f)>1?c:(i+c+f)%i}},I1e=function(e){return function(t){var n,r=(n=xH(t))===null||n===void 0?void 0:n.autofocus;return t.autofocus||r!==void 0&&r!=="false"||e.indexOf(t)>=0}},R1e=function(e,t,n){var r=e.map(function(o){var a=o.node;return a}),i=vO(r.filter(I1e(n)));return i&&i.length?bO(i):bO(vO(t))},ox=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&ox(e.parentNode.host||e.parentNode,t),t},uw=function(e,t){for(var n=ox(e),r=ox(t),i=0;i=0)return o}return!1},MH=function(e,t,n){var r=rx(e),i=rx(t),o=r[0],a=!1;return i.filter(Boolean).forEach(function(s){a=uw(a||s,s)||a,n.filter(Boolean).forEach(function(l){var u=uw(o,l);u&&(!a||Bg(u,a)?a=u:a=uw(u,a))})}),a},$1e=function(e,t){return e.reduce(function(n,r){return n.concat(k1e(r,t))},[])},D1e=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(S1e)},N1e=function(e,t){var n=document&&W8(),r=U8(e).filter(zy),i=MH(n||e,e,r),o=new Map,a=yO(r,o),s=ix(r,o).filter(function(p){var m=p.node;return zy(m)});if(!(!s[0]&&(s=a,!s[0]))){var l=yO([i],o).map(function(p){var m=p.node;return m}),u=D1e(l,s),c=u.map(function(p){var m=p.node;return m}),f=M1e(c,l,n,t);return f===OH?{node:R1e(a,c,$1e(r,o))}:f===void 0?f:u[f]}},B1e=function(e){var t=U8(e).filter(zy),n=MH(e,e,t),r=new Map,i=ix([n],r,!0),o=ix(t,r).filter(function(a){var s=a.node;return zy(s)}).map(function(a){var s=a.node;return s});return i.map(function(a){var s=a.node,l=a.index;return{node:s,index:l,lockItem:o.indexOf(s)>=0,guard:z8(s)}})},F1e=function(e,t){"focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus()},cw=0,dw=!1,z1e=function(e,t,n){n===void 0&&(n={});var r=N1e(e,t);if(!dw&&r){if(cw>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),dw=!0,setTimeout(function(){dw=!1},1);return}cw++,F1e(r.node,n.focusOptions),cw--}};const IH=z1e;function RH(e){var t=window,n=t.setImmediate;typeof n<"u"?n(e):setTimeout(e,1)}var j1e=function(){return document&&document.activeElement===document.body},H1e=function(){return j1e()||L1e()},Uf=null,Sf=null,Wf=null,Fg=!1,V1e=function(){return!0},U1e=function(t){return(Uf.whiteList||V1e)(t)},W1e=function(t,n){Wf={observerNode:t,portaledElement:n}},G1e=function(t){return Wf&&Wf.portaledElement===t};function wO(e,t,n,r){var i=null,o=e;do{var a=r[o];if(a.guard)a.node.dataset.focusAutoGuard&&(i=a);else if(a.lockItem){if(o!==e)return;i=null}else break}while((o+=n)!==t);i&&(i.node.tabIndex=0)}var K1e=function(t){return t&&"current"in t?t.current:t},Y1e=function(t){return t?Boolean(Fg):Fg==="meanwhile"},q1e=function e(t,n,r){return n&&(n.host===t&&(!n.activeElement||r.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,r))},X1e=function(t,n){return n.some(function(r){return q1e(t,r,r)})},jy=function(){var t=!1;if(Uf){var n=Uf,r=n.observed,i=n.persistentFocus,o=n.autoFocus,a=n.shards,s=n.crossFrame,l=n.focusOptions,u=r||Wf&&Wf.portaledElement,c=document&&document.activeElement;if(u){var f=[u].concat(a.map(K1e).filter(Boolean));if((!c||U1e(c))&&(i||Y1e(s)||!H1e()||!Sf&&o)&&(u&&!(AH(f)||c&&X1e(c,f)||G1e(c))&&(document&&!Sf&&c&&!o?(c.blur&&c.blur(),document.body.focus()):(t=IH(f,Sf,{focusOptions:l}),Wf={})),Fg=!1,Sf=document&&document.activeElement),document){var p=document&&document.activeElement,m=B1e(f),g=m.map(function(v){var x=v.node;return x}).indexOf(p);g>-1&&(m.filter(function(v){var x=v.guard,C=v.node;return x&&C.dataset.focusAutoGuard}).forEach(function(v){var x=v.node;return x.removeAttribute("tabIndex")}),wO(g,m.length,1,m),wO(g,-1,-1,m))}}}return t},$H=function(t){jy()&&t&&(t.stopPropagation(),t.preventDefault())},K8=function(){return RH(jy)},Z1e=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||W1e(r,n)},Q1e=function(){return null},DH=function(){Fg="just",setTimeout(function(){Fg="meanwhile"},0)},J1e=function(){document.addEventListener("focusin",$H),document.addEventListener("focusout",K8),window.addEventListener("blur",DH)},e0e=function(){document.removeEventListener("focusin",$H),document.removeEventListener("focusout",K8),window.removeEventListener("blur",DH)};function t0e(e){return e.filter(function(t){var n=t.disabled;return!n})}function n0e(e){var t=e.slice(-1)[0];t&&!Uf&&J1e();var n=Uf,r=n&&t&&t.id===n.id;Uf=t,n&&!r&&(n.onDeactivation(),e.filter(function(i){var o=i.id;return o===n.id}).length||n.returnFocus(!t)),t?(Sf=null,(!r||n.observed!==t.observed)&&t.onActivation(),jy(),RH(jy)):(e0e(),Sf=null)}mH.assignSyncMedium(Z1e);gH.assignMedium(K8);c1e.assignMedium(function(e){return e({moveFocusInside:IH,focusInside:AH})});const r0e=h1e(t0e,n0e)(Q1e);var NH=S.forwardRef(function(t,n){return S.createElement(vH,Dt({sideCar:r0e,ref:n},t))}),BH=vH.propTypes||{};BH.sideCar;D8(BH,["sideCar"]);NH.propTypes={};const i0e=NH;var FH=e=>{const{initialFocusRef:t,finalFocusRef:n,contentRef:r,restoreFocus:i,children:o,isDisabled:a,autoFocus:s,persistentFocus:l,lockFocusAcrossFrames:u}=e,c=S.useCallback(()=>{t!=null&&t.current?t.current.focus():r!=null&&r.current&&UF(r.current).length===0&&requestAnimationFrame(()=>{var g;(g=r.current)==null||g.focus()})},[t,r]),f=S.useCallback(()=>{var m;(m=n==null?void 0:n.current)==null||m.focus()},[n]),p=i&&!n;return M.createElement(i0e,{crossFrame:u,persistentFocus:l,autoFocus:s,disabled:a,onActivation:c,onDeactivation:f,returnFocus:p},o)};FH.displayName="FocusLock";var T2="right-scroll-bar-position",L2="width-before-scroll-bar",o0e="with-scroll-bars-hidden",a0e="--removed-body-scroll-bar-size",zH=hH(),fw=function(){},k3=S.forwardRef(function(e,t){var n=S.useRef(null),r=S.useState({onScrollCapture:fw,onWheelCapture:fw,onTouchMoveCapture:fw}),i=r[0],o=r[1],a=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,c=e.enabled,f=e.shards,p=e.sideCar,m=e.noIsolation,g=e.inert,v=e.allowPinchZoom,x=e.as,C=x===void 0?"div":x,w=iF(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),k=p,P=cH([n,t]),L=Da(Da({},w),i);return S.createElement(S.Fragment,null,c&&S.createElement(k,{sideCar:zH,removeScrollBar:u,shards:f,noIsolation:m,inert:g,setCallbacks:o,allowPinchZoom:!!v,lockRef:n}),a?S.cloneElement(S.Children.only(s),Da(Da({},L),{ref:P})):S.createElement(C,Da({},L,{className:l,ref:P}),s))});k3.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};k3.classNames={fullWidth:L2,zeroRight:T2};var s0e=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function l0e(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=s0e();return t&&e.setAttribute("nonce",t),e}function u0e(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function c0e(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var d0e=function(){var e=0,t=null;return{add:function(n){e==0&&(t=l0e())&&(u0e(t,n),c0e(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},f0e=function(){var e=d0e();return function(t,n){S.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},jH=function(){var e=f0e(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},h0e={left:0,top:0,right:0,gap:0},hw=function(e){return parseInt(e||"",10)||0},p0e=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[hw(n),hw(r),hw(i)]},m0e=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return h0e;var t=p0e(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])}},g0e=jH(),v0e=function(e,t,n,r){var i=e.left,o=e.top,a=e.right,s=e.gap;return n===void 0&&(n="margin"),` - .`.concat(o0e,` { - overflow: hidden `).concat(r,`; - padding-right: `).concat(s,"px ").concat(r,`; - } - body { - overflow: hidden `).concat(r,`; - overscroll-behavior: contain; - `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` - padding-left: `.concat(i,`px; - padding-top: `).concat(o,`px; - padding-right: `).concat(a,`px; - margin-left:0; - margin-top:0; - margin-right: `).concat(s,"px ").concat(r,`; - `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),` - } - - .`).concat(T2,` { - right: `).concat(s,"px ").concat(r,`; - } - - .`).concat(L2,` { - margin-right: `).concat(s,"px ").concat(r,`; - } - - .`).concat(T2," .").concat(T2,` { - right: 0 `).concat(r,`; - } - - .`).concat(L2," .").concat(L2,` { - margin-right: 0 `).concat(r,`; - } - - body { - `).concat(a0e,": ").concat(s,`px; - } -`)},y0e=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r,o=S.useMemo(function(){return m0e(i)},[i]);return S.createElement(g0e,{styles:v0e(o,!t,i,n?"":"!important")})},ax=!1;if(typeof window<"u")try{var xv=Object.defineProperty({},"passive",{get:function(){return ax=!0,!0}});window.addEventListener("test",xv,xv),window.removeEventListener("test",xv,xv)}catch(e){ax=!1}var Fd=ax?{passive:!1}:!1,b0e=function(e){return e.tagName==="TEXTAREA"},HH=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!b0e(e)&&n[t]==="visible")},S0e=function(e){return HH(e,"overflowY")},w0e=function(e){return HH(e,"overflowX")},CO=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=VH(e,n);if(r){var i=UH(e,n),o=i[1],a=i[2];if(o>a)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},C0e=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},x0e=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},VH=function(e,t){return e==="v"?S0e(t):w0e(t)},UH=function(e,t){return e==="v"?C0e(t):x0e(t)},_0e=function(e,t){return e==="h"&&t==="rtl"?-1:1},k0e=function(e,t,n,r,i){var o=_0e(e,window.getComputedStyle(t).direction),a=o*r,s=n.target,l=t.contains(s),u=!1,c=a>0,f=0,p=0;do{var m=UH(e,s),g=m[0],v=m[1],x=m[2],C=v-x-o*g;(g||C)&&VH(e,s)&&(f+=C,p+=g),s=s.parentNode}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(c&&(i&&f===0||!i&&a>f)||!c&&(i&&p===0||!i&&-a>p))&&(u=!0),u},_v=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},xO=function(e){return[e.deltaX,e.deltaY]},_O=function(e){return e&&"current"in e?e.current:e},E0e=function(e,t){return e[0]===t[0]&&e[1]===t[1]},P0e=function(e){return` - .block-interactivity-`.concat(e,` {pointer-events: none;} - .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},T0e=0,zd=[];function L0e(e){var t=S.useRef([]),n=S.useRef([0,0]),r=S.useRef(),i=S.useState(T0e++)[0],o=S.useState(function(){return jH()})[0],a=S.useRef(e);S.useEffect(function(){a.current=e},[e]),S.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var v=Q6([e.lockRef.current],(e.shards||[]).map(_O),!0).filter(Boolean);return v.forEach(function(x){return x.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),v.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=S.useCallback(function(v,x){if("touches"in v&&v.touches.length===2)return!a.current.allowPinchZoom;var C=_v(v),w=n.current,k="deltaX"in v?v.deltaX:w[0]-C[0],P="deltaY"in v?v.deltaY:w[1]-C[1],L,A=v.target,O=Math.abs(k)>Math.abs(P)?"h":"v";if("touches"in v&&O==="h"&&A.type==="range")return!1;var I=CO(O,A);if(!I)return!0;if(I?L=O:(L=O==="v"?"h":"v",I=CO(O,A)),!I)return!1;if(!r.current&&"changedTouches"in v&&(k||P)&&(r.current=L),!L)return!0;var $=r.current||L;return k0e($,x,v,$==="h"?k:P,!0)},[]),l=S.useCallback(function(v){var x=v;if(!(!zd.length||zd[zd.length-1]!==o)){var C="deltaY"in x?xO(x):_v(x),w=t.current.filter(function(L){return L.name===x.type&&L.target===x.target&&E0e(L.delta,C)})[0];if(w&&w.should){x.cancelable&&x.preventDefault();return}if(!w){var k=(a.current.shards||[]).map(_O).filter(Boolean).filter(function(L){return L.contains(x.target)}),P=k.length>0?s(x,k[0]):!a.current.noIsolation;P&&x.cancelable&&x.preventDefault()}}},[]),u=S.useCallback(function(v,x,C,w){var k={name:v,delta:x,target:C,should:w};t.current.push(k),setTimeout(function(){t.current=t.current.filter(function(P){return P!==k})},1)},[]),c=S.useCallback(function(v){n.current=_v(v),r.current=void 0},[]),f=S.useCallback(function(v){u(v.type,xO(v),v.target,s(v,e.lockRef.current))},[]),p=S.useCallback(function(v){u(v.type,_v(v),v.target,s(v,e.lockRef.current))},[]);S.useEffect(function(){return zd.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",l,Fd),document.addEventListener("touchmove",l,Fd),document.addEventListener("touchstart",c,Fd),function(){zd=zd.filter(function(v){return v!==o}),document.removeEventListener("wheel",l,Fd),document.removeEventListener("touchmove",l,Fd),document.removeEventListener("touchstart",c,Fd)}},[]);var m=e.removeScrollBar,g=e.inert;return S.createElement(S.Fragment,null,g?S.createElement(o,{styles:P0e(i)}):null,m?S.createElement(y0e,{gapMode:"margin"}):null)}const A0e=u1e(zH,L0e);var WH=S.forwardRef(function(e,t){return S.createElement(k3,Da({},e,{ref:t,sideCar:A0e}))});WH.classNames=k3.classNames;const GH=WH;var qc=(...e)=>e.filter(Boolean).join(" ");function dm(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var O0e=class{constructor(){kt(this,"modals");this.modals=[]}add(e){this.modals.push(e)}remove(e){this.modals=this.modals.filter(t=>t!==e)}isTopModal(e){return this.modals[this.modals.length-1]===e}},sx=new O0e;function M0e(e,t){S.useEffect(()=>(t&&sx.add(e),()=>{sx.remove(e)}),[t,e])}function I0e(e){const{isOpen:t,onClose:n,id:r,closeOnOverlayClick:i=!0,closeOnEsc:o=!0,useInert:a=!0,onOverlayClick:s,onEsc:l}=e,u=S.useRef(null),c=S.useRef(null),[f,p,m]=$0e(r,"chakra-modal","chakra-modal--header","chakra-modal--body");R0e(u,t&&a),M0e(u,t);const g=S.useRef(null),v=S.useCallback(I=>{g.current=I.target},[]),x=S.useCallback(I=>{I.key==="Escape"&&(I.stopPropagation(),o&&(n==null||n()),l==null||l())},[o,n,l]),[C,w]=S.useState(!1),[k,P]=S.useState(!1),L=S.useCallback((I={},$=null)=>({role:"dialog",...I,ref:ln($,u),id:f,tabIndex:-1,"aria-modal":!0,"aria-labelledby":C?p:void 0,"aria-describedby":k?m:void 0,onClick:dm(I.onClick,D=>D.stopPropagation())}),[m,k,f,p,C]),A=S.useCallback(I=>{I.stopPropagation(),g.current===I.target&&sx.isTopModal(u)&&(i&&(n==null||n()),s==null||s())},[n,i,s]),O=S.useCallback((I={},$=null)=>({...I,ref:ln($,c),onClick:dm(I.onClick,A),onKeyDown:dm(I.onKeyDown,x),onMouseDown:dm(I.onMouseDown,v)}),[x,v,A]);return{isOpen:t,onClose:n,headerId:p,bodyId:m,setBodyMounted:P,setHeaderMounted:w,dialogRef:u,overlayRef:c,getDialogProps:L,getDialogContainerProps:O}}function R0e(e,t){const n=e.current;S.useEffect(()=>{if(!(!e.current||!t))return aH(e.current)},[t,e,n])}function $0e(e,...t){const n=S.useId(),r=e||n;return S.useMemo(()=>t.map(i=>`${i}-${r}`),[r,t])}var[D0e,Xc]=Kt({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[N0e,au]=Kt({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in ``"}),su=e=>{const{portalProps:t,children:n,autoFocus:r,trapFocus:i,initialFocusRef:o,finalFocusRef:a,returnFocusOnClose:s,blockScrollOnMount:l,allowPinchZoom:u,preserveScrollBarGap:c,motionPreset:f,lockFocusAcrossFrames:p,onCloseComplete:m}=e,g=Br("Modal",e),x={...I0e(e),autoFocus:r,trapFocus:i,initialFocusRef:o,finalFocusRef:a,returnFocusOnClose:s,blockScrollOnMount:l,allowPinchZoom:u,preserveScrollBarGap:c,motionPreset:f,lockFocusAcrossFrames:p};return M.createElement(N0e,{value:x},M.createElement(D0e,{value:g},M.createElement(mu,{onExitComplete:m},x.isOpen&&M.createElement(Yc,{...t},n))))};su.defaultProps={lockFocusAcrossFrames:!0,returnFocusOnClose:!0,scrollBehavior:"outside",trapFocus:!0,autoFocus:!0,blockScrollOnMount:!0,allowPinchZoom:!1,motionPreset:"scale"};su.displayName="Modal";var gh=pe((e,t)=>{const{className:n,...r}=e,{bodyId:i,setBodyMounted:o}=au();S.useEffect(()=>(o(!0),()=>o(!1)),[o]);const a=qc("chakra-modal__body",n),s=Xc();return M.createElement(de.div,{ref:t,className:a,id:i,...r,__css:s.body})});gh.displayName="ModalBody";var b1=pe((e,t)=>{const{onClick:n,className:r,...i}=e,{onClose:o}=au(),a=qc("chakra-modal__close-btn",r),s=Xc();return M.createElement(s3,{ref:t,__css:s.closeButton,className:a,onClick:dm(n,l=>{l.stopPropagation(),o()}),...i})});b1.displayName="ModalCloseButton";function KH(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:i,blockScrollOnMount:o,allowPinchZoom:a,finalFocusRef:s,returnFocusOnClose:l,preserveScrollBarGap:u,lockFocusAcrossFrames:c}=au(),[f,p]=g9();return S.useEffect(()=>{!f&&p&&setTimeout(p)},[f,p]),M.createElement(FH,{autoFocus:t,isDisabled:!n,initialFocusRef:i,finalFocusRef:s,restoreFocus:l,contentRef:r,lockFocusAcrossFrames:c},M.createElement(GH,{removeScrollBar:!u,allowPinchZoom:a,enabled:o,forwardProps:!0},e.children))}var B0e={slideInBottom:{...eC,custom:{offsetY:16,reverse:!0}},slideInRight:{...eC,custom:{offsetX:16,reverse:!0}},scale:{...sF,custom:{initialScale:.95,reverse:!0}},none:{}},F0e=de(ss.section),z0e=e=>B0e[e||"none"],YH=S.forwardRef((e,t)=>{const{preset:n,motionProps:r=z0e(n),...i}=e;return M.createElement(F0e,{ref:t,...r,...i})});YH.displayName="ModalTransition";var Fc=pe((e,t)=>{const{className:n,children:r,containerProps:i,motionProps:o,...a}=e,{getDialogProps:s,getDialogContainerProps:l}=au(),u=s(a,t),c=l(i),f=qc("chakra-modal__content",n),p=Xc(),m={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...p.dialog},g={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...p.dialogContainer},{motionPreset:v}=au();return M.createElement(KH,null,M.createElement(de.div,{...c,className:"chakra-modal__content-container",tabIndex:-1,__css:g},M.createElement(YH,{preset:v,motionProps:o,className:f,...u,__css:m},r)))});Fc.displayName="ModalContent";var E3=pe((e,t)=>{const{className:n,...r}=e,i=qc("chakra-modal__footer",n),a={display:"flex",alignItems:"center",justifyContent:"flex-end",...Xc().footer};return M.createElement(de.footer,{ref:t,...r,__css:a,className:i})});E3.displayName="ModalFooter";var Bh=pe((e,t)=>{const{className:n,...r}=e,{headerId:i,setHeaderMounted:o}=au();S.useEffect(()=>(o(!0),()=>o(!1)),[o]);const a=qc("chakra-modal__header",n),l={flex:0,...Xc().header};return M.createElement(de.header,{ref:t,className:a,id:i,...r,__css:l})});Bh.displayName="ModalHeader";var j0e=de(ss.div),lu=pe((e,t)=>{const{className:n,transition:r,motionProps:i,...o}=e,a=qc("chakra-modal__overlay",n),l={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...Xc().overlay},{motionPreset:u}=au(),f=i||(u==="none"?{}:aF);return M.createElement(j0e,{...f,__css:l,ref:t,className:a,...o})});lu.displayName="ModalOverlay";function qH(e){const{leastDestructiveRef:t,...n}=e;return M.createElement(su,{...n,initialFocusRef:t})}var XH=pe((e,t)=>M.createElement(Fc,{ref:t,role:"alertdialog",...e})),[KXe,H0e]=Kt(),V0e=de(lF),U0e=pe((e,t)=>{const{className:n,children:r,motionProps:i,containerProps:o,...a}=e,{getDialogProps:s,getDialogContainerProps:l,isOpen:u}=au(),c=s(a,t),f=l(o),p=qc("chakra-modal__content",n),m=Xc(),g={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...m.dialog},v={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...m.dialogContainer},{placement:x}=H0e();return M.createElement(KH,null,M.createElement(de.div,{...f,className:"chakra-modal__content-container",__css:v},M.createElement(V0e,{motionProps:i,direction:x,in:u,className:p,...c,__css:g},r)))});U0e.displayName="DrawerContent";function W0e(e,t){const n=Fn(e);S.useEffect(()=>{let r=null;const i=()=>n();return t!==null&&(r=window.setInterval(i,t)),()=>{r&&window.clearInterval(r)}},[t,n])}var ZH=(...e)=>e.filter(Boolean).join(" "),pw=e=>e?!0:void 0;function Ea(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var G0e=e=>M.createElement(Qi,{viewBox:"0 0 24 24",...e},M.createElement("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"})),K0e=e=>M.createElement(Qi,{viewBox:"0 0 24 24",...e},M.createElement("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 kO(e,t,n,r){S.useEffect(()=>{var s;if(!e.current||!r)return;const i=(s=e.current.ownerDocument.defaultView)!=null?s:window,o=Array.isArray(t)?t:[t],a=new i.MutationObserver(l=>{for(const u of l)u.type==="attributes"&&u.attributeName&&o.includes(u.attributeName)&&n(u)});return a.observe(e.current,{attributes:!0,attributeFilter:o}),()=>a.disconnect()})}var Y0e=50,EO=300;function q0e(e,t){const[n,r]=S.useState(!1),[i,o]=S.useState(null),[a,s]=S.useState(!0),l=S.useRef(null),u=()=>clearTimeout(l.current);W0e(()=>{i==="increment"&&e(),i==="decrement"&&t()},n?Y0e:null);const c=S.useCallback(()=>{a&&e(),l.current=setTimeout(()=>{s(!1),r(!0),o("increment")},EO)},[e,a]),f=S.useCallback(()=>{a&&t(),l.current=setTimeout(()=>{s(!1),r(!0),o("decrement")},EO)},[t,a]),p=S.useCallback(()=>{s(!0),r(!1),u()},[]);return S.useEffect(()=>()=>u(),[]),{up:c,down:f,stop:p,isSpinning:n}}var X0e=/^[Ee0-9+\-.]$/;function Z0e(e){return X0e.test(e)}function Q0e(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 J0e(e={}){const{focusInputOnChange:t=!0,clampValueOnBlur:n=!0,keepWithinRange:r=!0,min:i=Number.MIN_SAFE_INTEGER,max:o=Number.MAX_SAFE_INTEGER,step:a=1,isReadOnly:s,isDisabled:l,isRequired:u,isInvalid:c,pattern:f="[0-9]*(.[0-9]+)?",inputMode:p="decimal",allowMouseWheel:m,id:g,onChange:v,precision:x,name:C,"aria-describedby":w,"aria-label":k,"aria-labelledby":P,onFocus:L,onBlur:A,onInvalid:O,getAriaValueText:I,isValidCharacter:$,format:D,parse:V,...Y}=e,z=Fn(L),R=Fn(A),N=Fn(O),U=Fn($!=null?$:Z0e),G=Fn(I),B=dfe(e),{update:W,increment:X,decrement:re}=B,[le,he]=S.useState(!1),se=!(s||l),Ae=S.useRef(null),be=S.useRef(null),De=S.useRef(null),fe=S.useRef(null),Xe=S.useCallback(me=>me.split("").filter(U).join(""),[U]),rt=S.useCallback(me=>{var lt;return(lt=V==null?void 0:V(me))!=null?lt:me},[V]),Ze=S.useCallback(me=>{var lt;return((lt=D==null?void 0:D(me))!=null?lt:me).toString()},[D]);nu(()=>{(B.valueAsNumber>o||B.valueAsNumber{if(!Ae.current)return;if(Ae.current.value!=B.value){const lt=rt(Ae.current.value);B.setValue(Xe(lt))}},[rt,Xe]);const et=S.useCallback((me=a)=>{se&&X(me)},[X,se,a]),nt=S.useCallback((me=a)=>{se&&re(me)},[re,se,a]),ve=q0e(et,nt);kO(De,"disabled",ve.stop,ve.isSpinning),kO(fe,"disabled",ve.stop,ve.isSpinning);const Qe=S.useCallback(me=>{if(me.nativeEvent.isComposing)return;const bt=rt(me.currentTarget.value);W(Xe(bt)),be.current={start:me.currentTarget.selectionStart,end:me.currentTarget.selectionEnd}},[W,Xe,rt]),ct=S.useCallback(me=>{var bt,Te;var lt;z==null||z(me),be.current&&(me.target.selectionStart=(bt=be.current.start)!=null?bt:(lt=me.currentTarget.value)==null?void 0:lt.length,me.currentTarget.selectionEnd=(Te=be.current.end)!=null?Te:me.currentTarget.selectionStart)},[z]),Je=S.useCallback(me=>{if(me.nativeEvent.isComposing)return;Q0e(me,U)||me.preventDefault();const lt=st(me)*a,bt=me.key,qe={ArrowUp:()=>et(lt),ArrowDown:()=>nt(lt),Home:()=>W(i),End:()=>W(o)}[bt];qe&&(me.preventDefault(),qe(me))},[U,a,et,nt,W,i,o]),st=me=>{let lt=1;return(me.metaKey||me.ctrlKey)&&(lt=.1),me.shiftKey&&(lt=10),lt},wt=S.useMemo(()=>{const me=G==null?void 0:G(B.value);if(me!=null)return me;const lt=B.value.toString();return lt||void 0},[B.value,G]),J=S.useCallback(()=>{let me=B.value;if(B.value==="")return;/^[eE]/.test(B.value.toString())?B.setValue(""):(B.valueAsNumbero&&(me=o),B.cast(me))},[B,o,i]),xe=S.useCallback(()=>{he(!1),n&&J()},[n,he,J]),Me=S.useCallback(()=>{t&&requestAnimationFrame(()=>{var me;(me=Ae.current)==null||me.focus()})},[t]),$e=S.useCallback(me=>{me.preventDefault(),ve.up(),Me()},[Me,ve]),ce=S.useCallback(me=>{me.preventDefault(),ve.down(),Me()},[Me,ve]);Cc(()=>Ae.current,"wheel",me=>{var Ee;var lt;const Te=((Ee=(lt=Ae.current)==null?void 0:lt.ownerDocument)!=null?Ee:document).activeElement===Ae.current;if(!m||!Te)return;me.preventDefault();const qe=st(me)*a,Ut=Math.sign(me.deltaY);Ut===-1?et(qe):Ut===1&&nt(qe)},{passive:!1});const we=S.useCallback((me={},lt=null)=>{const bt=l||r&&B.isAtMax;return{...me,ref:ln(lt,De),role:"button",tabIndex:-1,onPointerDown:Ea(me.onPointerDown,Te=>{Te.button!==0||bt||$e(Te)}),onPointerLeave:Ea(me.onPointerLeave,ve.stop),onPointerUp:Ea(me.onPointerUp,ve.stop),disabled:bt,"aria-disabled":pw(bt)}},[B.isAtMax,r,$e,ve.stop,l]),ot=S.useCallback((me={},lt=null)=>{const bt=l||r&&B.isAtMin;return{...me,ref:ln(lt,fe),role:"button",tabIndex:-1,onPointerDown:Ea(me.onPointerDown,Te=>{Te.button!==0||bt||ce(Te)}),onPointerLeave:Ea(me.onPointerLeave,ve.stop),onPointerUp:Ea(me.onPointerUp,ve.stop),disabled:bt,"aria-disabled":pw(bt)}},[B.isAtMin,r,ce,ve.stop,l]),mt=S.useCallback((me={},lt=null)=>{var bt,Te,qe,Ut;return{name:C,inputMode:p,type:"text",pattern:f,"aria-labelledby":P,"aria-label":k,"aria-describedby":w,id:g,disabled:l,...me,readOnly:(bt=me.readOnly)!=null?bt:s,"aria-readonly":(Te=me.readOnly)!=null?Te:s,"aria-required":(qe=me.required)!=null?qe:u,required:(Ut=me.required)!=null?Ut:u,ref:ln(Ae,lt),value:Ze(B.value),role:"spinbutton","aria-valuemin":i,"aria-valuemax":o,"aria-valuenow":Number.isNaN(B.valueAsNumber)?void 0:B.valueAsNumber,"aria-invalid":pw(c!=null?c:B.isOutOfRange),"aria-valuetext":wt,autoComplete:"off",autoCorrect:"off",onChange:Ea(me.onChange,Qe),onKeyDown:Ea(me.onKeyDown,Je),onFocus:Ea(me.onFocus,ct,()=>he(!0)),onBlur:Ea(me.onBlur,R,xe)}},[C,p,f,P,k,Ze,w,g,l,u,s,c,B.value,B.valueAsNumber,B.isOutOfRange,i,o,wt,Qe,Je,ct,R,xe]);return{value:Ze(B.value),valueAsNumber:B.valueAsNumber,isFocused:le,isDisabled:l,isReadOnly:s,getIncrementButtonProps:we,getDecrementButtonProps:ot,getInputProps:mt,htmlProps:Y}}var[eve,P3]=Kt({name:"NumberInputStylesContext",errorMessage:`useNumberInputStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[tve,Y8]=Kt({name:"NumberInputContext",errorMessage:"useNumberInputContext: `context` is undefined. Seems you forgot to wrap number-input's components within "}),q8=pe(function(t,n){const r=Br("NumberInput",t),i=Vt(t),o=L9(i),{htmlProps:a,...s}=J0e(o),l=S.useMemo(()=>s,[s]);return M.createElement(tve,{value:l},M.createElement(eve,{value:r},M.createElement(de.div,{...a,ref:n,className:ZH("chakra-numberinput",t.className),__css:{position:"relative",zIndex:0,...r.root}})))});q8.displayName="NumberInput";var QH=pe(function(t,n){const r=P3();return M.createElement(de.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}})});QH.displayName="NumberInputStepper";var X8=pe(function(t,n){const{getInputProps:r}=Y8(),i=r(t,n),o=P3();return M.createElement(de.input,{...i,className:ZH("chakra-numberinput__field",t.className),__css:{width:"100%",...o.field}})});X8.displayName="NumberInputField";var JH=de("div",{baseStyle:{display:"flex",justifyContent:"center",alignItems:"center",flex:1,transitionProperty:"common",transitionDuration:"normal",userSelect:"none",cursor:"pointer",lineHeight:"normal"}}),Z8=pe(function(t,n){var a;const r=P3(),{getDecrementButtonProps:i}=Y8(),o=i(t,n);return M.createElement(JH,{...o,__css:r.stepper},(a=t.children)!=null?a:M.createElement(G0e,null))});Z8.displayName="NumberDecrementStepper";var Q8=pe(function(t,n){var a;const{getIncrementButtonProps:r}=Y8(),i=r(t,n),o=P3();return M.createElement(JH,{...i,__css:o.stepper},(a=t.children)!=null?a:M.createElement(K0e,null))});Q8.displayName="NumberIncrementStepper";var S1=(...e)=>e.filter(Boolean).join(" ");function nve(e,...t){return rve(e)?e(...t):e}var rve=e=>typeof e=="function";function Pa(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function ive(...e){return function(n){e.forEach(r=>{r==null||r(n)})}}var[ove,Zc]=Kt({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within ``"}),[ave,w1]=Kt({name:"PopoverStylesContext",errorMessage:`usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),jd={click:"click",hover:"hover"};function sve(e={}){const{closeOnBlur:t=!0,closeOnEsc:n=!0,initialFocusRef:r,id:i,returnFocusOnClose:o=!0,autoFocus:a=!0,arrowSize:s,arrowShadowColor:l,trigger:u=jd.click,openDelay:c=200,closeDelay:f=200,isLazy:p,lazyBehavior:m="unmount",computePositionOnMount:g,...v}=e,{isOpen:x,onClose:C,onOpen:w,onToggle:k}=tz(e),P=S.useRef(null),L=S.useRef(null),A=S.useRef(null),O=S.useRef(!1),I=S.useRef(!1);x&&(I.current=!0);const[$,D]=S.useState(!1),[V,Y]=S.useState(!1),z=S.useId(),R=i!=null?i:z,[N,U,G,B]=["popover-trigger","popover-content","popover-header","popover-body"].map(Qe=>`${Qe}-${R}`),{referenceRef:W,getArrowProps:X,getPopperProps:re,getArrowInnerProps:le,forceUpdate:he}=ez({...v,enabled:x||!!g}),se=Bpe({isOpen:x,ref:A});Sfe({enabled:x,ref:L}),phe(A,{focusRef:L,visible:x,shouldFocus:o&&u===jd.click}),ghe(A,{focusRef:r,visible:x,shouldFocus:a&&u===jd.click});const Ae=nz({wasSelected:I.current,enabled:p,mode:m,isSelected:se.present}),be=S.useCallback((Qe={},ct=null)=>{const Je={...Qe,style:{...Qe.style,transformOrigin:or.transformOrigin.varRef,[or.arrowSize.var]:s?`${s}px`:void 0,[or.arrowShadowColor.var]:l},ref:ln(A,ct),children:Ae?Qe.children:null,id:U,tabIndex:-1,role:"dialog",onKeyDown:Pa(Qe.onKeyDown,st=>{n&&st.key==="Escape"&&C()}),onBlur:Pa(Qe.onBlur,st=>{const wt=PO(st),J=mw(A.current,wt),xe=mw(L.current,wt);x&&t&&(!J&&!xe)&&C()}),"aria-labelledby":$?G:void 0,"aria-describedby":V?B:void 0};return u===jd.hover&&(Je.role="tooltip",Je.onMouseEnter=Pa(Qe.onMouseEnter,()=>{O.current=!0}),Je.onMouseLeave=Pa(Qe.onMouseLeave,st=>{st.nativeEvent.relatedTarget!==null&&(O.current=!1,setTimeout(()=>C(),f))})),Je},[Ae,U,$,G,V,B,u,n,C,x,t,f,l,s]),De=S.useCallback((Qe={},ct=null)=>re({...Qe,style:{visibility:x?"visible":"hidden",...Qe.style}},ct),[x,re]),fe=S.useCallback((Qe,ct=null)=>({...Qe,ref:ln(ct,P,W)}),[P,W]),Xe=S.useRef(),rt=S.useRef(),Ze=S.useCallback(Qe=>{P.current==null&&W(Qe)},[W]),et=S.useCallback((Qe={},ct=null)=>{const Je={...Qe,ref:ln(L,ct,Ze),id:N,"aria-haspopup":"dialog","aria-expanded":x,"aria-controls":U};return u===jd.click&&(Je.onClick=Pa(Qe.onClick,k)),u===jd.hover&&(Je.onFocus=Pa(Qe.onFocus,()=>{Xe.current===void 0&&w()}),Je.onBlur=Pa(Qe.onBlur,st=>{const wt=PO(st),J=!mw(A.current,wt);x&&t&&J&&C()}),Je.onKeyDown=Pa(Qe.onKeyDown,st=>{st.key==="Escape"&&C()}),Je.onMouseEnter=Pa(Qe.onMouseEnter,()=>{O.current=!0,Xe.current=window.setTimeout(()=>w(),c)}),Je.onMouseLeave=Pa(Qe.onMouseLeave,()=>{O.current=!1,Xe.current&&(clearTimeout(Xe.current),Xe.current=void 0),rt.current=window.setTimeout(()=>{O.current===!1&&C()},f)})),Je},[N,x,U,u,Ze,k,w,t,C,c,f]);S.useEffect(()=>()=>{Xe.current&&clearTimeout(Xe.current),rt.current&&clearTimeout(rt.current)},[]);const nt=S.useCallback((Qe={},ct=null)=>({...Qe,id:G,ref:ln(ct,Je=>{D(!!Je)})}),[G]),ve=S.useCallback((Qe={},ct=null)=>({...Qe,id:B,ref:ln(ct,Je=>{Y(!!Je)})}),[B]);return{forceUpdate:he,isOpen:x,onAnimationComplete:se.onComplete,onClose:C,getAnchorProps:fe,getArrowProps:X,getArrowInnerProps:le,getPopoverPositionerProps:De,getPopoverProps:be,getTriggerProps:et,getHeaderProps:nt,getBodyProps:ve}}function mw(e,t){return e===t||(e==null?void 0:e.contains(t))}function PO(e){var n;const t=e.currentTarget.ownerDocument.activeElement;return(n=e.relatedTarget)!=null?n:t}function J8(e){const t=Br("Popover",e),{children:n,...r}=Vt(e),i=Lh(),o=sve({...r,direction:i.direction});return M.createElement(ove,{value:o},M.createElement(ave,{value:t},nve(n,{isOpen:o.isOpen,onClose:o.onClose,forceUpdate:o.forceUpdate})))}J8.displayName="Popover";function e_(e){var l;const{bg:t,bgColor:n,backgroundColor:r}=e,{getArrowProps:i,getArrowInnerProps:o}=Zc(),a=w1(),s=(l=t!=null?t:n)!=null?l:r;return M.createElement(de.div,{...i(),className:"chakra-popover__arrow-positioner"},M.createElement(de.div,{className:S1("chakra-popover__arrow",e.className),...o(e),__css:{...a.arrow,"--popper-arrow-bg":s?`colors.${s}, ${s}`:void 0}}))}e_.displayName="PopoverArrow";var lve=pe(function(t,n){const{getBodyProps:r}=Zc(),i=w1();return M.createElement(de.div,{...r(t,n),className:S1("chakra-popover__body",t.className),__css:i.body})});lve.displayName="PopoverBody";var uve=pe(function(t,n){const{onClose:r}=Zc(),i=w1();return M.createElement(s3,{size:"sm",onClick:r,className:S1("chakra-popover__close-btn",t.className),__css:i.closeButton,ref:n,...t})});uve.displayName="PopoverCloseButton";function cve(e){if(e)return{enter:{...e.enter,visibility:"visible"},exit:{...e.exit,transitionEnd:{visibility:"hidden"}}}}var dve={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]}}},fve=de(ss.section),eV=pe(function(t,n){const{variants:r=dve,...i}=t,{isOpen:o}=Zc();return M.createElement(fve,{ref:n,variants:cve(r),initial:!1,animate:o?"enter":"exit",...i})});eV.displayName="PopoverTransition";var t_=pe(function(t,n){const{rootProps:r,motionProps:i,...o}=t,{getPopoverProps:a,getPopoverPositionerProps:s,onAnimationComplete:l}=Zc(),u=w1(),c={position:"relative",display:"flex",flexDirection:"column",...u.content};return M.createElement(de.div,{...s(r),__css:u.popper,className:"chakra-popover__popper"},M.createElement(eV,{...i,...a(o,n),onAnimationComplete:ive(l,o.onAnimationComplete),className:S1("chakra-popover__content",t.className),__css:c}))});t_.displayName="PopoverContent";var hve=pe(function(t,n){const{getHeaderProps:r}=Zc(),i=w1();return M.createElement(de.header,{...r(t,n),className:S1("chakra-popover__header",t.className),__css:i.header})});hve.displayName="PopoverHeader";function n_(e){const t=S.Children.only(e.children),{getTriggerProps:n}=Zc();return S.cloneElement(t,n(t.props,t.ref))}n_.displayName="PopoverTrigger";function pve(e,t,n){return(e-t)*100/(n-t)}var mve=pu({"0%":{strokeDasharray:"1, 400",strokeDashoffset:"0"},"50%":{strokeDasharray:"400, 400",strokeDashoffset:"-100"},"100%":{strokeDasharray:"400, 400",strokeDashoffset:"-260"}}),gve=pu({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),vve=pu({"0%":{left:"-40%"},"100%":{left:"100%"}}),yve=pu({from:{backgroundPosition:"1rem 0"},to:{backgroundPosition:"0 0"}});function tV(e){const{value:t=0,min:n,max:r,valueText:i,getValueText:o,isIndeterminate:a,role:s="progressbar"}=e,l=pve(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 o=="function"?o(t,l):i})(),role:s},percent:l,value:t}}var nV=e=>{const{size:t,isIndeterminate:n,...r}=e;return M.createElement(de.svg,{viewBox:"0 0 100 100",__css:{width:t,height:t,animation:n?`${gve} 2s linear infinite`:void 0},...r})};nV.displayName="Shape";var lx=e=>M.createElement(de.circle,{cx:50,cy:50,r:42,fill:"transparent",...e});lx.displayName="Circle";var bve=pe((e,t)=>{var P;const{size:n="48px",max:r=100,min:i=0,valueText:o,getValueText:a,value:s,capIsRound:l,children:u,thickness:c="10px",color:f="#0078d4",trackColor:p="#edebe9",isIndeterminate:m,...g}=e,v=tV({min:i,max:r,value:s,valueText:o,getValueText:a,isIndeterminate:m}),x=m?void 0:((P=v.percent)!=null?P:0)*2.64,C=x==null?void 0:`${x} ${264-x}`,w=m?{css:{animation:`${mve} 1.5s linear infinite`}}:{strokeDashoffset:66,strokeDasharray:C,transitionProperty:"stroke-dasharray, stroke",transitionDuration:"0.6s",transitionTimingFunction:"ease"},k={display:"inline-block",position:"relative",verticalAlign:"middle",fontSize:n};return M.createElement(de.div,{ref:t,className:"chakra-progress",...v.bind,...g,__css:k},M.createElement(nV,{size:n,isIndeterminate:m},M.createElement(lx,{stroke:p,strokeWidth:c,className:"chakra-progress__track"}),M.createElement(lx,{stroke:f,strokeWidth:c,className:"chakra-progress__indicator",strokeLinecap:l?"round":void 0,opacity:v.value===0&&!m?0:void 0,...w})),u)});bve.displayName="CircularProgress";var[Sve,wve]=Kt({name:"ProgressStylesContext",errorMessage:`useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Cve=pe((e,t)=>{const{min:n,max:r,value:i,isIndeterminate:o,role:a,...s}=e,l=tV({value:i,min:n,max:r,isIndeterminate:o,role:a}),c={height:"100%",...wve().filledTrack};return M.createElement(de.div,{ref:t,style:{width:`${l.percent}%`,...s.style},...l.bind,...s,__css:c})}),rV=pe((e,t)=>{var n;const{value:r,min:i=0,max:o=100,hasStripe:a,isAnimated:s,children:l,borderRadius:u,isIndeterminate:c,"aria-label":f,"aria-labelledby":p,title:m,role:g,...v}=Vt(e),x=Br("Progress",e),C=u!=null?u:(n=x.track)==null?void 0:n.borderRadius,w={animation:`${yve} 1s linear infinite`},L={...!c&&a&&s&&w,...c&&{position:"absolute",willChange:"left",minWidth:"50%",animation:`${vve} 1s ease infinite normal none running`}},A={overflow:"hidden",position:"relative",...x.track};return M.createElement(de.div,{ref:t,borderRadius:C,__css:A,...v},M.createElement(Sve,{value:x},M.createElement(Cve,{"aria-label":f,"aria-labelledby":p,min:i,max:o,value:r,isIndeterminate:c,css:L,borderRadius:C,title:m,role:g}),l))});rV.displayName="Progress";var xve=de("div",{baseStyle:{fontSize:"0.24em",top:"50%",left:"50%",width:"100%",textAlign:"center",position:"absolute",transform:"translate(-50%, -50%)"}});xve.displayName="CircularProgressLabel";var _ve=(...e)=>e.filter(Boolean).join(" "),kve=e=>e?"":void 0;function Eve(e,t){const n={},r={};for(const[i,o]of Object.entries(e))t.includes(i)?n[i]=o:r[i]=o;return[n,r]}var iV=pe(function(t,n){const{children:r,placeholder:i,className:o,...a}=t;return M.createElement(de.select,{...a,ref:n,className:_ve("chakra-select",o)},i&&M.createElement("option",{value:""},i),r)});iV.displayName="SelectField";var oV=pe((e,t)=>{var n;const r=Br("Select",e),{rootProps:i,placeholder:o,icon:a,color:s,height:l,h:u,minH:c,minHeight:f,iconColor:p,iconSize:m,...g}=Vt(e),[v,x]=Eve(g,VZ),C=T9(x),w={width:"100%",height:"fit-content",position:"relative",color:s},k={paddingEnd:"2rem",...r.field,_focus:{zIndex:"unset",...(n=r.field)==null?void 0:n._focus}};return M.createElement(de.div,{className:"chakra-select__wrapper",__css:w,...v,...i},M.createElement(iV,{ref:t,height:u!=null?u:l,minH:c!=null?c:f,placeholder:o,...C,__css:k},e.children),M.createElement(aV,{"data-disabled":kve(C.disabled),...(p||s)&&{color:p||s},__css:r.icon,...m&&{fontSize:m}},a))});oV.displayName="Select";var Pve=e=>M.createElement("svg",{viewBox:"0 0 24 24",...e},M.createElement("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})),Tve=de("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),aV=e=>{const{children:t=M.createElement(Pve,null),...n}=e,r=S.cloneElement(t,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return M.createElement(Tve,{...n,className:"chakra-select__icon-wrapper"},S.isValidElement(t)?r:null)};aV.displayName="SelectIcon";function Lve(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Ave(e){const t=Mve(e);return typeof t.PointerEvent<"u"&&e instanceof t.PointerEvent?e.pointerType==="mouse":e instanceof t.MouseEvent}function sV(e){return!!e.touches}function Ove(e){return sV(e)&&e.touches.length>1}function Mve(e){var t;return(t=e.view)!=null?t:window}function Ive(e,t="page"){const n=e.touches[0]||e.changedTouches[0];return{x:n[`${t}X`],y:n[`${t}Y`]}}function Rve(e,t="page"){return{x:e[`${t}X`],y:e[`${t}Y`]}}function lV(e,t="page"){return sV(e)?Ive(e,t):Rve(e,t)}function $ve(e){return t=>{const n=Ave(t);(!n||n&&t.button===0)&&e(t)}}function Dve(e,t=!1){function n(i){e(i,{point:lV(i)})}return t?$ve(n):n}function A2(e,t,n,r){return Lve(e,t,Dve(n,t==="pointerdown"),r)}function uV(e){const t=S.useRef(null);return t.current=e,t}var Nve=class{constructor(e,t,n){kt(this,"history",[]);kt(this,"startEvent",null);kt(this,"lastEvent",null);kt(this,"lastEventInfo",null);kt(this,"handlers",{});kt(this,"removeListeners",()=>{});kt(this,"threshold",3);kt(this,"win");kt(this,"updatePoint",()=>{if(!(this.lastEvent&&this.lastEventInfo))return;const e=gw(this.lastEventInfo,this.history),t=this.startEvent!==null,n=jve(e.offset,{x:0,y:0})>=this.threshold;if(!t&&!n)return;const{timestamp:r}=JP();this.history.push({...e.point,timestamp:r});const{onStart:i,onMove:o}=this.handlers;t||(i==null||i(this.lastEvent,e),this.startEvent=this.lastEvent),o==null||o(this.lastEvent,e)});kt(this,"onPointerMove",(e,t)=>{this.lastEvent=e,this.lastEventInfo=t,nJ.update(this.updatePoint,!0)});kt(this,"onPointerUp",(e,t)=>{const n=gw(t,this.history),{onEnd:r,onSessionEnd:i}=this.handlers;i==null||i(e,n),this.end(),!(!r||!this.startEvent)&&(r==null||r(e,n))});var a;if(this.win=(a=e.view)!=null?a:window,Ove(e))return;this.handlers=t,n&&(this.threshold=n),e.stopPropagation(),e.preventDefault();const r={point:lV(e)},{timestamp:i}=JP();this.history=[{...r.point,timestamp:i}];const{onSessionStart:o}=t;o==null||o(e,gw(r,this.history)),this.removeListeners=zve(A2(this.win,"pointermove",this.onPointerMove),A2(this.win,"pointerup",this.onPointerUp),A2(this.win,"pointercancel",this.onPointerUp))}updateHandlers(e){this.handlers=e}end(){var e;(e=this.removeListeners)==null||e.call(this),rJ.update(this.updatePoint)}};function TO(e,t){return{x:e.x-t.x,y:e.y-t.y}}function gw(e,t){return{point:e.point,delta:TO(e.point,t[t.length-1]),offset:TO(e.point,t[0]),velocity:Fve(t,.1)}}var Bve=e=>e*1e3;function Fve(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=e[e.length-1];for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Bve(t)));)n--;if(!r)return{x:0,y:0};const o=(i.timestamp-r.timestamp)/1e3;if(o===0)return{x:0,y:0};const a={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function zve(...e){return t=>e.reduce((n,r)=>r(n),t)}function vw(e,t){return Math.abs(e-t)}function LO(e){return"x"in e&&"y"in e}function jve(e,t){if(typeof e=="number"&&typeof t=="number")return vw(e,t);if(LO(e)&&LO(t)){const n=vw(e.x,t.x),r=vw(e.y,t.y);return Math.sqrt(n**2+r**2)}return 0}function cV(e,t){const{onPan:n,onPanStart:r,onPanEnd:i,onPanSessionStart:o,onPanSessionEnd:a,threshold:s}=t,l=Boolean(n||r||i||o||a),u=S.useRef(null),c=uV({onSessionStart:o,onSessionEnd:a,onStart:r,onMove:n,onEnd(f,p){u.current=null,i==null||i(f,p)}});S.useEffect(()=>{var f;(f=u.current)==null||f.updateHandlers(c.current)}),S.useEffect(()=>{const f=e.current;if(!f||!l)return;function p(m){u.current=new Nve(m,c.current,s)}return A2(f,"pointerdown",p)},[e,l,c,s]),S.useEffect(()=>()=>{var f;(f=u.current)==null||f.end(),u.current=null},[])}function Hve(e,t){var i;if(!e){t(void 0);return}t({width:e.offsetWidth,height:e.offsetHeight});const n=(i=e.ownerDocument.defaultView)!=null?i:window,r=new n.ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const[a]=o;let s,l;if("borderBoxSize"in a){const u=a.borderBoxSize,c=Array.isArray(u)?u[0]:u;s=c.inlineSize,l=c.blockSize}else s=e.offsetWidth,l=e.offsetHeight;t({width:s,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}var Vve=Boolean(globalThis==null?void 0:globalThis.document)?S.useLayoutEffect:S.useEffect;function Uve(e,t){var o;var n;if(!e||!e.parentElement)return;const r=(o=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?o:window,i=new r.MutationObserver(()=>{t()});return i.observe(e.parentElement,{childList:!0}),()=>{i.disconnect()}}function dV({getNodes:e,observeMutation:t=!0}){const[n,r]=S.useState([]),[i,o]=S.useState(0);return Vve(()=>{const a=e(),s=a.map((l,u)=>Hve(l,c=>{r(f=>[...f.slice(0,u),c,...f.slice(u+1)])}));if(t){const l=a[0];s.push(Uve(l,()=>{o(u=>u+1)}))}return()=>{s.forEach(l=>{l==null||l()})}},[i]),n}function Wve(e){return typeof e=="object"&&e!==null&&"current"in e}function Gve(e){const[t]=dV({observeMutation:!1,getNodes(){return[Wve(e)?e.current:e]}});return t}var Kve=Object.getOwnPropertyNames,Yve=(e,t)=>function(){return e&&(t=(0,e[Kve(e)[0]])(e=0)),t},Su=Yve({"../../../react-shim.js"(){}});Su();Su();Su();var go=e=>e?"":void 0,Gf=e=>e?!0:void 0,wu=(...e)=>e.filter(Boolean).join(" ");Su();function Kf(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}Su();Su();function qve(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 fm(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}var O2={width:0,height:0},kv=e=>e||O2;function fV(e){const{orientation:t,thumbPercents:n,thumbRects:r,isReversed:i}=e,o=v=>{var C;const x=(C=r[v])!=null?C:O2;return{position:"absolute",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",touchAction:"none",...fm({orientation:t,vertical:{bottom:`calc(${n[v]}% - ${x.height/2}px)`},horizontal:{left:`calc(${n[v]}% - ${x.width/2}px)`}})}},a=t==="vertical"?r.reduce((v,x)=>kv(v).height>kv(x).height?v:x,O2):r.reduce((v,x)=>kv(v).width>kv(x).width?v:x,O2),s={position:"relative",touchAction:"none",WebkitTapHighlightColor:"rgba(0,0,0,0)",userSelect:"none",outline:0,...fm({orientation:t,vertical:a?{paddingLeft:a.width/2,paddingRight:a.width/2}:{},horizontal:a?{paddingTop:a.height/2,paddingBottom:a.height/2}:{}})},l={position:"absolute",...fm({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",height:"100%"},horizontal:{top:"50%",transform:"translateY(-50%)",width:"100%"}})},u=n.length===1,c=[0,i?100-n[0]:n[0]],f=u?c:n;let p=f[0];!u&&i&&(p=100-p);const m=Math.abs(f[f.length-1]-f[0]),g={...l,...fm({orientation:t,vertical:i?{height:`${m}%`,top:`${p}%`}:{height:`${m}%`,bottom:`${p}%`},horizontal:i?{width:`${m}%`,right:`${p}%`}:{width:`${m}%`,left:`${p}%`}})};return{trackStyle:l,innerTrackStyle:g,rootStyle:s,getThumbStyle:o}}function hV(e){const{isReversed:t,direction:n,orientation:r}=e;return n==="ltr"||r==="vertical"?t:!t}function Xve(e){const{min:t=0,max:n=100,onChange:r,value:i,defaultValue:o,isReversed:a,direction:s="ltr",orientation:l="horizontal",id:u,isDisabled:c,isReadOnly:f,onChangeStart:p,onChangeEnd:m,step:g=1,getAriaValueText:v,"aria-valuetext":x,"aria-label":C,"aria-labelledby":w,name:k,focusThumbOnChange:P=!0,minStepsBetweenThumbs:L=0,...A}=e,O=Fn(p),I=Fn(m),$=Fn(v),D=hV({isReversed:a,direction:s,orientation:l}),[V,Y]=Vb({value:i,defaultValue:o!=null?o:[25,75],onChange:r});if(!Array.isArray(V))throw new TypeError(`[range-slider] You passed an invalid value for \`value\` or \`defaultValue\`, expected \`Array\` but got \`${typeof V}\``);const[z,R]=S.useState(!1),[N,U]=S.useState(!1),[G,B]=S.useState(-1),W=!(c||f),X=S.useRef(V),re=V.map(Ee=>Nf(Ee,t,n)),le=L*g,he=Zve(re,t,n,le),se=S.useRef({eventSource:null,value:[],valueBounds:[]});se.current.value=re,se.current.valueBounds=he;const Ae=re.map(Ee=>n-Ee+t),De=(D?Ae:re).map(Ee=>py(Ee,t,n)),fe=l==="vertical",Xe=S.useRef(null),rt=S.useRef(null),Ze=dV({getNodes(){const Ee=rt.current,tt=Ee==null?void 0:Ee.querySelectorAll("[role=slider]");return tt?Array.from(tt):[]}}),et=S.useId(),nt=u!=null?u:et,ve=qve(nt),Qe=S.useCallback(Ee=>{var pa;var tt;if(!Xe.current)return;se.current.eventSource="pointer";const Ge=Xe.current.getBoundingClientRect(),{clientX:vt,clientY:Nt}=(pa=(tt=Ee.touches)==null?void 0:tt[0])!=null?pa:Ee,er=fe?Ge.bottom-Nt:vt-Ge.left,qn=fe?Ge.height:Ge.width;let Er=er/qn;return D&&(Er=1-Er),yF(Er,t,n)},[fe,D,n,t]),ct=(n-t)/10,Je=g||(n-t)/100,st=S.useMemo(()=>({setValueAtIndex(Ee,tt){if(!W)return;const Ge=se.current.valueBounds[Ee];tt=parseFloat(oC(tt,Ge.min,Je)),tt=Nf(tt,Ge.min,Ge.max);const vt=[...se.current.value];vt[Ee]=tt,Y(vt)},setActiveIndex:B,stepUp(Ee,tt=Je){const Ge=se.current.value[Ee],vt=D?Ge-tt:Ge+tt;st.setValueAtIndex(Ee,vt)},stepDown(Ee,tt=Je){const Ge=se.current.value[Ee],vt=D?Ge+tt:Ge-tt;st.setValueAtIndex(Ee,vt)},reset(){Y(X.current)}}),[Je,D,Y,W]),wt=S.useCallback(Ee=>{const tt=Ee.key,vt={ArrowRight:()=>st.stepUp(G),ArrowUp:()=>st.stepUp(G),ArrowLeft:()=>st.stepDown(G),ArrowDown:()=>st.stepDown(G),PageUp:()=>st.stepUp(G,ct),PageDown:()=>st.stepDown(G,ct),Home:()=>{const{min:Nt}=he[G];st.setValueAtIndex(G,Nt)},End:()=>{const{max:Nt}=he[G];st.setValueAtIndex(G,Nt)}}[tt];vt&&(Ee.preventDefault(),Ee.stopPropagation(),vt(Ee),se.current.eventSource="keyboard")},[st,G,ct,he]),{getThumbStyle:J,rootStyle:xe,trackStyle:Me,innerTrackStyle:$e}=S.useMemo(()=>fV({isReversed:D,orientation:l,thumbRects:Ze,thumbPercents:De}),[D,l,De,Ze]),ce=S.useCallback(Ee=>{var tt;const Ge=Ee!=null?Ee:G;if(Ge!==-1&&P){const vt=ve.getThumb(Ge),Nt=(tt=rt.current)==null?void 0:tt.ownerDocument.getElementById(vt);Nt&&setTimeout(()=>Nt.focus())}},[P,G,ve]);nu(()=>{se.current.eventSource==="keyboard"&&(I==null||I(se.current.value))},[re,I]);const we=Ee=>{const tt=Qe(Ee)||0,Ge=se.current.value.map(Er=>Math.abs(Er-tt)),vt=Math.min(...Ge);let Nt=Ge.indexOf(vt);const er=Ge.filter(Er=>Er===vt);er.length>1&&tt>se.current.value[Nt]&&(Nt=Nt+er.length-1),B(Nt),st.setValueAtIndex(Nt,tt),ce(Nt)},ot=Ee=>{if(G==-1)return;const tt=Qe(Ee)||0;B(G),st.setValueAtIndex(G,tt),ce(G)};cV(rt,{onPanSessionStart(Ee){W&&(R(!0),we(Ee),O==null||O(se.current.value))},onPanSessionEnd(){W&&(R(!1),I==null||I(se.current.value))},onPan(Ee){W&&ot(Ee)}});const mt=S.useCallback((Ee={},tt=null)=>({...Ee,...A,id:ve.root,ref:ln(tt,rt),tabIndex:-1,"aria-disabled":Gf(c),"data-focused":go(N),style:{...Ee.style,...xe}}),[A,c,N,xe,ve]),me=S.useCallback((Ee={},tt=null)=>({...Ee,ref:ln(tt,Xe),id:ve.track,"data-disabled":go(c),style:{...Ee.style,...Me}}),[c,Me,ve]),lt=S.useCallback((Ee={},tt=null)=>({...Ee,ref:tt,id:ve.innerTrack,style:{...Ee.style,...$e}}),[$e,ve]),bt=S.useCallback((Ee,tt=null)=>{var qn;const{index:Ge,...vt}=Ee,Nt=re[Ge];if(Nt==null)throw new TypeError(`[range-slider > thumb] Cannot find value at index \`${Ge}\`. The \`value\` or \`defaultValue\` length is : ${re.length}`);const er=he[Ge];return{...vt,ref:tt,role:"slider",tabIndex:W?0:void 0,id:ve.getThumb(Ge),"data-active":go(z&&G===Ge),"aria-valuetext":(qn=$==null?void 0:$(Nt))!=null?qn:x==null?void 0:x[Ge],"aria-valuemin":er.min,"aria-valuemax":er.max,"aria-valuenow":Nt,"aria-orientation":l,"aria-disabled":Gf(c),"aria-readonly":Gf(f),"aria-label":C==null?void 0:C[Ge],"aria-labelledby":C!=null&&C[Ge]||w==null?void 0:w[Ge],style:{...Ee.style,...J(Ge)},onKeyDown:Kf(Ee.onKeyDown,wt),onFocus:Kf(Ee.onFocus,()=>{U(!0),B(Ge)}),onBlur:Kf(Ee.onBlur,()=>{U(!1),B(-1)})}},[ve,re,he,W,z,G,$,x,l,c,f,C,w,J,wt,U]),Te=S.useCallback((Ee={},tt=null)=>({...Ee,ref:tt,id:ve.output,htmlFor:re.map((Ge,vt)=>ve.getThumb(vt)).join(" "),"aria-live":"off"}),[ve,re]),qe=S.useCallback((Ee,tt=null)=>{const{value:Ge,...vt}=Ee,Nt=!(Gen),er=Ge>=re[0]&&Ge<=re[re.length-1];let qn=py(Ge,t,n);qn=D?100-qn:qn;const Er={position:"absolute",pointerEvents:"none",...fm({orientation:l,vertical:{bottom:`${qn}%`},horizontal:{left:`${qn}%`}})};return{...vt,ref:tt,id:ve.getMarker(Ee.value),role:"presentation","aria-hidden":!0,"data-disabled":go(c),"data-invalid":go(!Nt),"data-highlighted":go(er),style:{...Ee.style,...Er}}},[c,D,n,t,l,re,ve]),Ut=S.useCallback((Ee,tt=null)=>{const{index:Ge,...vt}=Ee;return{...vt,ref:tt,id:ve.getInput(Ge),type:"hidden",value:re[Ge],name:Array.isArray(k)?k[Ge]:`${k}-${Ge}`}},[k,re,ve]);return{state:{value:re,isFocused:N,isDragging:z,getThumbPercent:Ee=>De[Ee],getThumbMinValue:Ee=>he[Ee].min,getThumbMaxValue:Ee=>he[Ee].max},actions:st,getRootProps:mt,getTrackProps:me,getInnerTrackProps:lt,getThumbProps:bt,getMarkerProps:qe,getInputProps:Ut,getOutputProps:Te}}function Zve(e,t,n,r){return e.map((i,o)=>{const a=o===0?t:e[o-1]+r,s=o===e.length-1?n:e[o+1]-r;return{min:a,max:s}})}var[Qve,T3]=Kt({name:"SliderContext",errorMessage:"useSliderContext: `context` is undefined. Seems you forgot to wrap all slider components within "}),[Jve,r_]=Kt({name:"RangeSliderStylesContext",errorMessage:`useRangeSliderStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),pV=pe(function(t,n){const r=Br("Slider",t),i=Vt(t),{direction:o}=Lh();i.direction=o;const{getRootProps:a,...s}=Xve(i),l=S.useMemo(()=>({...s,name:t.name}),[s,t.name]);return M.createElement(Qve,{value:l},M.createElement(Jve,{value:r},M.createElement(de.div,{...a({},n),className:"chakra-slider",__css:r.container},t.children)))});pV.defaultProps={orientation:"horizontal"};pV.displayName="RangeSlider";var e2e=pe(function(t,n){const{getThumbProps:r,getInputProps:i,name:o}=T3(),a=r_(),s=r(t,n);return M.createElement(de.div,{...s,className:wu("chakra-slider__thumb",t.className),__css:a.thumb},s.children,o&&M.createElement("input",{...i({index:t.index})}))});e2e.displayName="RangeSliderThumb";var t2e=pe(function(t,n){const{getTrackProps:r}=T3(),i=r_(),o=r(t,n);return M.createElement(de.div,{...o,className:wu("chakra-slider__track",t.className),__css:i.track,"data-testid":"chakra-range-slider-track"})});t2e.displayName="RangeSliderTrack";var n2e=pe(function(t,n){const{getInnerTrackProps:r}=T3(),i=r_(),o=r(t,n);return M.createElement(de.div,{...o,className:"chakra-slider__filled-track",__css:i.filledTrack})});n2e.displayName="RangeSliderFilledTrack";var r2e=pe(function(t,n){const{getMarkerProps:r}=T3(),i=r(t,n);return M.createElement(de.div,{...i,className:wu("chakra-slider__marker",t.className)})});r2e.displayName="RangeSliderMark";Su();Su();function i2e(e){var bt;const{min:t=0,max:n=100,onChange:r,value:i,defaultValue:o,isReversed:a,direction:s="ltr",orientation:l="horizontal",id:u,isDisabled:c,isReadOnly:f,onChangeStart:p,onChangeEnd:m,step:g=1,getAriaValueText:v,"aria-valuetext":x,"aria-label":C,"aria-labelledby":w,name:k,focusThumbOnChange:P=!0,...L}=e,A=Fn(p),O=Fn(m),I=Fn(v),$=hV({isReversed:a,direction:s,orientation:l}),[D,V]=Vb({value:i,defaultValue:o!=null?o:a2e(t,n),onChange:r}),[Y,z]=S.useState(!1),[R,N]=S.useState(!1),U=!(c||f),G=(n-t)/10,B=g||(n-t)/100,W=Nf(D,t,n),X=n-W+t,le=py($?X:W,t,n),he=l==="vertical",se=uV({min:t,max:n,step:g,isDisabled:c,value:W,isInteractive:U,isReversed:$,isVertical:he,eventSource:null,focusThumbOnChange:P,orientation:l}),Ae=S.useRef(null),be=S.useRef(null),De=S.useRef(null),fe=S.useId(),Xe=u!=null?u:fe,[rt,Ze]=[`slider-thumb-${Xe}`,`slider-track-${Xe}`],et=S.useCallback(Te=>{var Er;var qe;if(!Ae.current)return;const Ut=se.current;Ut.eventSource="pointer";const Ee=Ae.current.getBoundingClientRect(),{clientX:tt,clientY:Ge}=(Er=(qe=Te.touches)==null?void 0:qe[0])!=null?Er:Te,vt=he?Ee.bottom-Ge:tt-Ee.left,Nt=he?Ee.height:Ee.width;let er=vt/Nt;$&&(er=1-er);let qn=yF(er,Ut.min,Ut.max);return Ut.step&&(qn=parseFloat(oC(qn,Ut.min,Ut.step))),qn=Nf(qn,Ut.min,Ut.max),qn},[he,$,se]),nt=S.useCallback(Te=>{const qe=se.current;qe.isInteractive&&(Te=parseFloat(oC(Te,qe.min,B)),Te=Nf(Te,qe.min,qe.max),V(Te))},[B,V,se]),ve=S.useMemo(()=>({stepUp(Te=B){const qe=$?W-Te:W+Te;nt(qe)},stepDown(Te=B){const qe=$?W+Te:W-Te;nt(qe)},reset(){nt(o||0)},stepTo(Te){nt(Te)}}),[nt,$,W,B,o]),Qe=S.useCallback(Te=>{const qe=se.current,Ee={ArrowRight:()=>ve.stepUp(),ArrowUp:()=>ve.stepUp(),ArrowLeft:()=>ve.stepDown(),ArrowDown:()=>ve.stepDown(),PageUp:()=>ve.stepUp(G),PageDown:()=>ve.stepDown(G),Home:()=>nt(qe.min),End:()=>nt(qe.max)}[Te.key];Ee&&(Te.preventDefault(),Te.stopPropagation(),Ee(Te),qe.eventSource="keyboard")},[ve,nt,G,se]),ct=(bt=I==null?void 0:I(W))!=null?bt:x,Je=Gve(be),{getThumbStyle:st,rootStyle:wt,trackStyle:J,innerTrackStyle:xe}=S.useMemo(()=>{const Te=se.current,qe=Je!=null?Je:{width:0,height:0};return fV({isReversed:$,orientation:Te.orientation,thumbRects:[qe],thumbPercents:[le]})},[$,Je,le,se]),Me=S.useCallback(()=>{se.current.focusThumbOnChange&&setTimeout(()=>{var qe;return(qe=be.current)==null?void 0:qe.focus()})},[se]);nu(()=>{const Te=se.current;Me(),Te.eventSource==="keyboard"&&(O==null||O(Te.value))},[W,O]);function $e(Te){const qe=et(Te);qe!=null&&qe!==se.current.value&&V(qe)}cV(De,{onPanSessionStart(Te){const qe=se.current;qe.isInteractive&&(z(!0),Me(),$e(Te),A==null||A(qe.value))},onPanSessionEnd(){const Te=se.current;Te.isInteractive&&(z(!1),O==null||O(Te.value))},onPan(Te){se.current.isInteractive&&$e(Te)}});const ce=S.useCallback((Te={},qe=null)=>({...Te,...L,ref:ln(qe,De),tabIndex:-1,"aria-disabled":Gf(c),"data-focused":go(R),style:{...Te.style,...wt}}),[L,c,R,wt]),we=S.useCallback((Te={},qe=null)=>({...Te,ref:ln(qe,Ae),id:Ze,"data-disabled":go(c),style:{...Te.style,...J}}),[c,Ze,J]),ot=S.useCallback((Te={},qe=null)=>({...Te,ref:qe,style:{...Te.style,...xe}}),[xe]),mt=S.useCallback((Te={},qe=null)=>({...Te,ref:ln(qe,be),role:"slider",tabIndex:U?0:void 0,id:rt,"data-active":go(Y),"aria-valuetext":ct,"aria-valuemin":t,"aria-valuemax":n,"aria-valuenow":W,"aria-orientation":l,"aria-disabled":Gf(c),"aria-readonly":Gf(f),"aria-label":C,"aria-labelledby":C?void 0:w,style:{...Te.style,...st(0)},onKeyDown:Kf(Te.onKeyDown,Qe),onFocus:Kf(Te.onFocus,()=>N(!0)),onBlur:Kf(Te.onBlur,()=>N(!1))}),[U,rt,Y,ct,t,n,W,l,c,f,C,w,st,Qe]),me=S.useCallback((Te,qe=null)=>{const Ut=!(Te.valuen),Ee=W>=Te.value,tt=py(Te.value,t,n),Ge={position:"absolute",pointerEvents:"none",...o2e({orientation:l,vertical:{bottom:$?`${100-tt}%`:`${tt}%`},horizontal:{left:$?`${100-tt}%`:`${tt}%`}})};return{...Te,ref:qe,role:"presentation","aria-hidden":!0,"data-disabled":go(c),"data-invalid":go(!Ut),"data-highlighted":go(Ee),style:{...Te.style,...Ge}}},[c,$,n,t,l,W]),lt=S.useCallback((Te={},qe=null)=>({...Te,ref:qe,type:"hidden",value:W,name:k}),[k,W]);return{state:{value:W,isFocused:R,isDragging:Y},actions:ve,getRootProps:ce,getTrackProps:we,getInnerTrackProps:ot,getThumbProps:mt,getMarkerProps:me,getInputProps:lt}}function o2e(e){const{orientation:t,vertical:n,horizontal:r}=e;return t==="vertical"?n:r}function a2e(e,t){return t"}),[l2e,A3]=Kt({name:"SliderStylesContext",hookName:"useSliderStyles",providerName:""}),i_=pe((e,t)=>{const n=Br("Slider",e),r=Vt(e),{direction:i}=Lh();r.direction=i;const{getInputProps:o,getRootProps:a,...s}=i2e(r),l=a(),u=o({},t);return M.createElement(s2e,{value:s},M.createElement(l2e,{value:n},M.createElement(de.div,{...l,className:wu("chakra-slider",e.className),__css:n.container},e.children,M.createElement("input",{...u}))))});i_.defaultProps={orientation:"horizontal"};i_.displayName="Slider";var mV=pe((e,t)=>{const{getThumbProps:n}=L3(),r=A3(),i=n(e,t);return M.createElement(de.div,{...i,className:wu("chakra-slider__thumb",e.className),__css:r.thumb})});mV.displayName="SliderThumb";var gV=pe((e,t)=>{const{getTrackProps:n}=L3(),r=A3(),i=n(e,t);return M.createElement(de.div,{...i,className:wu("chakra-slider__track",e.className),__css:r.track})});gV.displayName="SliderTrack";var vV=pe((e,t)=>{const{getInnerTrackProps:n}=L3(),r=A3(),i=n(e,t);return M.createElement(de.div,{...i,className:wu("chakra-slider__filled-track",e.className),__css:r.filledTrack})});vV.displayName="SliderFilledTrack";var ux=pe((e,t)=>{const{getMarkerProps:n}=L3(),r=A3(),i=n(e,t);return M.createElement(de.div,{...i,className:wu("chakra-slider__marker",e.className),__css:r.mark})});ux.displayName="SliderMark";var u2e=(...e)=>e.filter(Boolean).join(" "),AO=e=>e?"":void 0,o_=pe(function(t,n){const r=Br("Switch",t),{spacing:i="0.5rem",children:o,...a}=Vt(t),{state:s,getInputProps:l,getCheckboxProps:u,getRootProps:c,getLabelProps:f}=gF(a),p=S.useMemo(()=>({display:"inline-block",position:"relative",verticalAlign:"middle",lineHeight:0,...r.container}),[r.container]),m=S.useMemo(()=>({display:"inline-flex",flexShrink:0,justifyContent:"flex-start",boxSizing:"content-box",cursor:"pointer",...r.track}),[r.track]),g=S.useMemo(()=>({userSelect:"none",marginStart:i,...r.label}),[i,r.label]);return M.createElement(de.label,{...c(),className:u2e("chakra-switch",t.className),__css:p},M.createElement("input",{className:"chakra-switch__input",...l({},n)}),M.createElement(de.span,{...u(),className:"chakra-switch__track",__css:m},M.createElement(de.span,{__css:r.thumb,className:"chakra-switch__thumb","data-checked":AO(s.isChecked),"data-hover":AO(s.isHovered)})),o&&M.createElement(de.span,{className:"chakra-switch__label",...f(),__css:g},o))});o_.displayName="Switch";var Fh=(...e)=>e.filter(Boolean).join(" ");function cx(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var[c2e,yV,d2e,f2e]=AN();function h2e(e){var w;const{defaultIndex:t,onChange:n,index:r,isManual:i,isLazy:o,lazyBehavior:a="unmount",orientation:s="horizontal",direction:l="ltr",...u}=e,[c,f]=S.useState(t!=null?t:0),[p,m]=Vb({defaultValue:t!=null?t:0,value:r,onChange:n});S.useEffect(()=>{r!=null&&f(r)},[r]);const g=d2e(),v=S.useId();return{id:`tabs-${(w=e.id)!=null?w:v}`,selectedIndex:p,focusedIndex:c,setSelectedIndex:m,setFocusedIndex:f,isManual:i,isLazy:o,lazyBehavior:a,orientation:s,descendants:g,direction:l,htmlProps:u}}var[p2e,C1]=Kt({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within "});function m2e(e){const{focusedIndex:t,orientation:n,direction:r}=C1(),i=yV(),o=S.useCallback(a=>{const s=()=>{var w;const k=i.nextEnabled(t);k&&((w=k.node)==null||w.focus())},l=()=>{var w;const k=i.prevEnabled(t);k&&((w=k.node)==null||w.focus())},u=()=>{var w;const k=i.firstEnabled();k&&((w=k.node)==null||w.focus())},c=()=>{var w;const k=i.lastEnabled();k&&((w=k.node)==null||w.focus())},f=n==="horizontal",p=n==="vertical",m=a.key,g=r==="ltr"?"ArrowLeft":"ArrowRight",v=r==="ltr"?"ArrowRight":"ArrowLeft",C={[g]:()=>f&&l(),[v]:()=>f&&s(),ArrowDown:()=>p&&s(),ArrowUp:()=>p&&l(),Home:u,End:c}[m];C&&(a.preventDefault(),C(a))},[i,t,n,r]);return{...e,role:"tablist","aria-orientation":n,onKeyDown:cx(e.onKeyDown,o)}}function g2e(e){const{isDisabled:t,isFocusable:n,...r}=e,{setSelectedIndex:i,isManual:o,id:a,setFocusedIndex:s,selectedIndex:l}=C1(),{index:u,register:c}=f2e({disabled:t&&!n}),f=u===l,p=()=>{i(u)},m=()=>{s(u),!o&&!(t&&n)&&i(u)},g=rhe({...r,ref:ln(c,e.ref),isDisabled:t,isFocusable:n,onClick:cx(e.onClick,p)}),v="button";return{...g,id:bV(a,u),role:"tab",tabIndex:f?0:-1,type:v,"aria-selected":f,"aria-controls":SV(a,u),onFocus:t?void 0:cx(e.onFocus,m)}}var[v2e,y2e]=Kt({});function b2e(e){const t=C1(),{id:n,selectedIndex:r}=t,o=i3(e.children).map((a,s)=>S.createElement(v2e,{key:s,value:{isSelected:s===r,id:SV(n,s),tabId:bV(n,s),selectedIndex:r}},a));return{...e,children:o}}function S2e(e){const{children:t,...n}=e,{isLazy:r,lazyBehavior:i}=C1(),{isSelected:o,id:a,tabId:s}=y2e(),l=S.useRef(!1);o&&(l.current=!0);const u=nz({wasSelected:l.current,isSelected:o,enabled:r,mode:i});return{tabIndex:0,...n,children:u?t:null,role:"tabpanel","aria-labelledby":s,hidden:!o,id:a}}function w2e(){const e=C1(),t=yV(),{selectedIndex:n,orientation:r}=e,i=r==="horizontal",o=r==="vertical",[a,s]=S.useState(()=>{if(i)return{left:0,width:0};if(o)return{top:0,height:0}}),[l,u]=S.useState(!1);return ea(()=>{if(n==null)return;const c=t.item(n);if(c==null)return;i&&s({left:c.node.offsetLeft,width:c.node.offsetWidth}),o&&s({top:c.node.offsetTop,height:c.node.offsetHeight});const f=requestAnimationFrame(()=>{u(!0)});return()=>{f&&cancelAnimationFrame(f)}},[n,i,o,t]),{position:"absolute",transitionProperty:"left, right, top, bottom, height, width",transitionDuration:l?"200ms":"0ms",transitionTimingFunction:"cubic-bezier(0, 0, 0.2, 1)",...a}}function bV(e,t){return`${e}--tab-${t}`}function SV(e,t){return`${e}--tabpanel-${t}`}var[C2e,x1]=Kt({name:"TabsStylesContext",errorMessage:`useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),wV=pe(function(t,n){const r=Br("Tabs",t),{children:i,className:o,...a}=Vt(t),{htmlProps:s,descendants:l,...u}=h2e(a),c=S.useMemo(()=>u,[u]),{isFitted:f,...p}=s;return M.createElement(c2e,{value:l},M.createElement(p2e,{value:c},M.createElement(C2e,{value:r},M.createElement(de.div,{className:Fh("chakra-tabs",o),ref:n,...p,__css:r.root},i))))});wV.displayName="Tabs";var x2e=pe(function(t,n){const r=w2e(),i={...t.style,...r},o=x1();return M.createElement(de.div,{ref:n,...t,className:Fh("chakra-tabs__tab-indicator",t.className),style:i,__css:o.indicator})});x2e.displayName="TabIndicator";var _2e=pe(function(t,n){const r=m2e({...t,ref:n}),o={display:"flex",...x1().tablist};return M.createElement(de.div,{...r,className:Fh("chakra-tabs__tablist",t.className),__css:o})});_2e.displayName="TabList";var CV=pe(function(t,n){const r=S2e({...t,ref:n}),i=x1();return M.createElement(de.div,{outline:"0",...r,className:Fh("chakra-tabs__tab-panel",t.className),__css:i.tabpanel})});CV.displayName="TabPanel";var xV=pe(function(t,n){const r=b2e(t),i=x1();return M.createElement(de.div,{...r,width:"100%",ref:n,className:Fh("chakra-tabs__tab-panels",t.className),__css:i.tabpanels})});xV.displayName="TabPanels";var _V=pe(function(t,n){const r=x1(),i=g2e({...t,ref:n}),o={outline:"0",display:"flex",alignItems:"center",justifyContent:"center",...r.tab};return M.createElement(de.button,{...i,className:Fh("chakra-tabs__tab",t.className),__css:o})});_V.displayName="Tab";var k2e=(...e)=>e.filter(Boolean).join(" ");function E2e(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var P2e=["h","minH","height","minHeight"],a_=pe((e,t)=>{const n=gi("Textarea",e),{className:r,rows:i,...o}=Vt(e),a=T9(o),s=i?E2e(n,P2e):n;return M.createElement(de.textarea,{ref:t,rows:i,...a,className:k2e("chakra-textarea",r),__css:s})});a_.displayName="Textarea";function T2e(e,t){const n=Fn(e);S.useEffect(()=>{if(t==null)return;let r=null;return r=window.setTimeout(()=>{n()},t),()=>{r&&window.clearTimeout(r)}},[t,n])}function dx(e,...t){return L2e(e)?e(...t):e}var L2e=e=>typeof e=="function";function A2e(e,t){var o;const n=e!=null?e:"bottom",i={"top-start":{ltr:"top-left",rtl:"top-right"},"top-end":{ltr:"top-right",rtl:"top-left"},"bottom-start":{ltr:"bottom-left",rtl:"bottom-right"},"bottom-end":{ltr:"bottom-right",rtl:"bottom-left"}}[n];return(o=i==null?void 0:i[t])!=null?o:n}var O2e=(e,t)=>e.find(n=>n.id===t);function OO(e,t){const n=kV(e,t),r=n?e[n].findIndex(i=>i.id===t):-1;return{position:n,index:r}}function kV(e,t){for(const[n,r]of Object.entries(e))if(O2e(r,t))return n}function M2e(e){const t=e.includes("right"),n=e.includes("left");let r="center";return t&&(r="flex-end"),n&&(r="flex-start"),{display:"flex",flexDirection:"column",alignItems:r}}function I2e(e){const n=e==="top"||e==="bottom"?"0 auto":void 0,r=e.includes("top")?"env(safe-area-inset-top, 0px)":void 0,i=e.includes("bottom")?"env(safe-area-inset-bottom, 0px)":void 0,o=e.includes("left")?void 0:"env(safe-area-inset-right, 0px)",a=e.includes("right")?void 0:"env(safe-area-inset-left, 0px)";return{position:"fixed",zIndex:5500,pointerEvents:"none",display:"flex",flexDirection:"column",margin:n,top:r,bottom:i,right:o,left:a}}var R2e={top:[],"top-left":[],"top-right":[],"bottom-left":[],bottom:[],"bottom-right":[]},Ba=$2e(R2e);function $2e(e){let t=e;const n=new Set,r=i=>{t=i(t),n.forEach(o=>o())};return{getState:()=>t,subscribe:i=>(n.add(i),()=>{r(()=>e),n.delete(i)}),removeToast:(i,o)=>{r(a=>({...a,[o]:a[o].filter(s=>s.id!=i)}))},notify:(i,o)=>{const a=D2e(i,o),{position:s,id:l}=a;return r(u=>{var p,m;const f=s.includes("top")?[a,...(p=u[s])!=null?p:[]]:[...(m=u[s])!=null?m:[],a];return{...u,[s]:f}}),l},update:(i,o)=>{i&&r(a=>{const s={...a},{position:l,index:u}=OO(s,i);return l&&u!==-1&&(s[l][u]={...s[l][u],...o,message:EV(o)}),s})},closeAll:({positions:i}={})=>{r(o=>{const a=["bottom","bottom-right","bottom-left","top","top-left","top-right"];return(i!=null?i:a).reduce((l,u)=>(l[u]=o[u].map(c=>({...c,requestClose:!0})),l),{...o})})},close:i=>{r(o=>{const a=kV(o,i);return a?{...o,[a]:o[a].map(s=>s.id==i?{...s,requestClose:!0}:s)}:o})},isActive:i=>Boolean(OO(Ba.getState(),i).position)}}var MO=0;function D2e(e,t={}){var i,o;MO+=1;const n=(i=t.id)!=null?i:MO,r=(o=t.position)!=null?o:"bottom";return{id:n,message:e,position:r,duration:t.duration,onCloseComplete:t.onCloseComplete,onRequestRemove:()=>Ba.removeToast(String(n),r),status:t.status,requestClose:!1,containerStyle:t.containerStyle}}var N2e=e=>{const{status:t,variant:n="solid",id:r,title:i,isClosable:o,onClose:a,description:s,icon:l}=e,u=r?{root:`toast-${r}`,title:`toast-${r}-title`,description:`toast-${r}-description`}:void 0;return M.createElement(cF,{addRole:!1,status:t,variant:n,id:u==null?void 0:u.root,alignItems:"start",borderRadius:"md",boxShadow:"lg",paddingEnd:8,textAlign:"start",width:"auto"},M.createElement(fF,null,l),M.createElement(de.div,{flex:"1",maxWidth:"100%"},i&&M.createElement(hF,{id:u==null?void 0:u.title},i),s&&M.createElement(dF,{id:u==null?void 0:u.description,display:"block"},s)),o&&M.createElement(s3,{size:"sm",onClick:a,position:"absolute",insetEnd:1,top:1}))};function EV(e={}){const{render:t,toastComponent:n=N2e}=e;return i=>typeof t=="function"?t({...i,...e}):M.createElement(n,{...i,...e})}function B2e(e,t){const n=i=>{var o;return{...t,...i,position:A2e((o=i==null?void 0:i.position)!=null?o:t==null?void 0:t.position,e)}},r=i=>{const o=n(i),a=EV(o);return Ba.notify(a,o)};return r.update=(i,o)=>{Ba.update(i,n(o))},r.promise=(i,o)=>{const a=r({...o.loading,status:"loading",duration:null});i.then(s=>r.update(a,{status:"success",duration:5e3,...dx(o.success,s)})).catch(s=>r.update(a,{status:"error",duration:5e3,...dx(o.error,s)}))},r.closeAll=Ba.closeAll,r.close=Ba.close,r.isActive=Ba.isActive,r}function _1(e){const{theme:t}=PN();return S.useMemo(()=>B2e(t.direction,e),[e,t.direction])}var F2e={initial:e=>{const{position:t}=e,n=["top","bottom"].includes(t)?"y":"x";let r=["top-right","bottom-right"].includes(t)?1:-1;return t==="bottom"&&(r=1),{opacity:0,[n]:r*24}},animate:{opacity:1,y:0,x:0,scale:1,transition:{duration:.4,ease:[.4,0,.2,1]}},exit:{opacity:0,scale:.85,transition:{duration:.2,ease:[.4,0,1,1]}}},PV=S.memo(e=>{const{id:t,message:n,onCloseComplete:r,onRequestRemove:i,requestClose:o=!1,position:a="bottom",duration:s=5e3,containerStyle:l,motionVariants:u=F2e,toastSpacing:c="0.5rem"}=e,[f,p]=S.useState(s),m=$le();nu(()=>{m||r==null||r()},[m]),nu(()=>{p(s)},[s]);const g=()=>p(null),v=()=>p(s),x=()=>{m&&i()};S.useEffect(()=>{m&&o&&i()},[m,o,i]),T2e(x,f);const C=S.useMemo(()=>({pointerEvents:"auto",maxWidth:560,minWidth:300,margin:c,...l}),[l,c]),w=S.useMemo(()=>M2e(a),[a]);return M.createElement(ss.li,{layout:!0,className:"chakra-toast",variants:u,initial:"initial",animate:"animate",exit:"exit",onHoverStart:g,onHoverEnd:v,custom:{position:a},style:w},M.createElement(de.div,{role:"status","aria-atomic":"true",className:"chakra-toast__inner",__css:C},dx(n,{id:t,onClose:x})))});PV.displayName="ToastComponent";var z2e=e=>{const t=S.useSyncExternalStore(Ba.subscribe,Ba.getState,Ba.getState),{children:n,motionVariants:r,component:i=PV,portalProps:o}=e,s=Object.keys(t).map(l=>{const u=t[l];return M.createElement("ul",{role:"region","aria-live":"polite",key:l,id:`chakra-toast-manager-${l}`,style:I2e(l)},M.createElement(mu,{initial:!1},u.map(c=>M.createElement(i,{key:c.id,motionVariants:r,...c}))))});return M.createElement(M.Fragment,null,n,M.createElement(Yc,{...o},s))};function j2e(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function H2e(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}var V2e={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]}}}};function Vp(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var Hy=e=>{var t;return((t=e.current)==null?void 0:t.ownerDocument)||document},fx=e=>{var t,n;return((n=(t=e.current)==null?void 0:t.ownerDocument)==null?void 0:n.defaultView)||window};function U2e(e={}){const{openDelay:t=0,closeDelay:n=0,closeOnClick:r=!0,closeOnMouseDown:i,closeOnScroll:o,closeOnPointerDown:a=i,closeOnEsc:s=!0,onOpen:l,onClose:u,placement:c,id:f,isOpen:p,defaultIsOpen:m,arrowSize:g=10,arrowShadowColor:v,arrowPadding:x,modifiers:C,isDisabled:w,gutter:k,offset:P,direction:L,...A}=e,{isOpen:O,onOpen:I,onClose:$}=tz({isOpen:p,defaultIsOpen:m,onOpen:l,onClose:u}),{referenceRef:D,getPopperProps:V,getArrowInnerProps:Y,getArrowProps:z}=ez({enabled:O,placement:c,arrowPadding:x,modifiers:C,gutter:k,offset:P,direction:L}),R=S.useId(),U=`tooltip-${f!=null?f:R}`,G=S.useRef(null),B=S.useRef(),W=S.useCallback(()=>{B.current&&(clearTimeout(B.current),B.current=void 0)},[]),X=S.useRef(),re=S.useCallback(()=>{X.current&&(clearTimeout(X.current),X.current=void 0)},[]),le=S.useCallback(()=>{re(),$()},[$,re]),he=W2e(G,le),se=S.useCallback(()=>{if(!w&&!B.current){he();const et=fx(G);B.current=et.setTimeout(I,t)}},[he,w,I,t]),Ae=S.useCallback(()=>{W();const et=fx(G);X.current=et.setTimeout(le,n)},[n,le,W]),be=S.useCallback(()=>{O&&r&&Ae()},[r,Ae,O]),De=S.useCallback(()=>{O&&a&&Ae()},[a,Ae,O]),fe=S.useCallback(et=>{O&&et.key==="Escape"&&Ae()},[O,Ae]);Cc(()=>Hy(G),"keydown",s?fe:void 0),Cc(()=>Hy(G),"scroll",()=>{O&&o&&le()}),S.useEffect(()=>{w&&(W(),O&&$())},[w,O,$,W]),S.useEffect(()=>()=>{W(),re()},[W,re]),Cc(()=>G.current,"pointerleave",Ae);const Xe=S.useCallback((et={},nt=null)=>({...et,ref:ln(G,nt,D),onPointerEnter:Vp(et.onPointerEnter,Qe=>{Qe.pointerType!=="touch"&&se()}),onClick:Vp(et.onClick,be),onPointerDown:Vp(et.onPointerDown,De),onFocus:Vp(et.onFocus,se),onBlur:Vp(et.onBlur,Ae),"aria-describedby":O?U:void 0}),[se,Ae,De,O,U,be,D]),rt=S.useCallback((et={},nt=null)=>V({...et,style:{...et.style,[or.arrowSize.var]:g?`${g}px`:void 0,[or.arrowShadowColor.var]:v}},nt),[V,g,v]),Ze=S.useCallback((et={},nt=null)=>{const ve={...et.style,position:"relative",transformOrigin:or.transformOrigin.varRef};return{ref:nt,...A,...et,id:U,role:"tooltip",style:ve}},[A,U]);return{isOpen:O,show:se,hide:Ae,getTriggerProps:Xe,getTooltipProps:Ze,getTooltipPositionerProps:rt,getArrowProps:z,getArrowInnerProps:Y}}var yw="chakra-ui:close-tooltip";function W2e(e,t){return S.useEffect(()=>{const n=Hy(e);return n.addEventListener(yw,t),()=>n.removeEventListener(yw,t)},[t,e]),()=>{const n=Hy(e),r=fx(e);n.dispatchEvent(new r.CustomEvent(yw))}}var G2e=de(ss.div),ri=pe((e,t)=>{var $,D;const n=gi("Tooltip",e),r=Vt(e),i=Lh(),{children:o,label:a,shouldWrapChildren:s,"aria-label":l,hasArrow:u,bg:c,portalProps:f,background:p,backgroundColor:m,bgColor:g,motionProps:v,...x}=r,C=(D=($=p!=null?p:m)!=null?$:c)!=null?D:g;if(C){n.bg=C;const V=rQ(i,"colors",C);n[or.arrowBg.var]=V}const w=U2e({...x,direction:i.direction}),k=typeof o=="string"||s;let P;if(k)P=M.createElement(de.span,{display:"inline-block",tabIndex:0,...w.getTriggerProps()},o);else{const V=S.Children.only(o);P=S.cloneElement(V,w.getTriggerProps(V.props,V.ref))}const L=!!l,A=w.getTooltipProps({},t),O=L?j2e(A,["role","id"]):A,I=H2e(A,["role","id"]);return a?M.createElement(M.Fragment,null,P,M.createElement(mu,null,w.isOpen&&M.createElement(Yc,{...f},M.createElement(de.div,{...w.getTooltipPositionerProps(),__css:{zIndex:n.zIndex,pointerEvents:"none"}},M.createElement(G2e,{variants:V2e,initial:"exit",animate:"enter",exit:"exit",...v,...O,__css:n},a,L&&M.createElement(de.span,{srOnly:!0,...I},l),u&&M.createElement(de.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper"},M.createElement(de.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:n.bg}}))))))):M.createElement(M.Fragment,null,o)});ri.displayName="Tooltip";var K2e=e=>{const{children:t,colorModeManager:n,portalZIndex:r,resetCSS:i=!0,theme:o={},environment:a,cssVarsRoot:s}=e,l=M.createElement(NF,{environment:a},t);return M.createElement(Yoe,{theme:o,cssVarsRoot:s},M.createElement(OD,{colorModeManager:n,options:o.config},i?M.createElement(hfe,null):M.createElement(ffe,null),M.createElement(Xoe,null),r?M.createElement(rH,{zIndex:r},l):l))};function Y2e({children:e,theme:t=Foe,toastOptions:n,...r}){return M.createElement(K2e,{theme:t,...r},e,M.createElement(z2e,{...n}))}var hx={},IO=la;hx.createRoot=IO.createRoot,hx.hydrateRoot=IO.hydrateRoot;var px={},q2e={get exports(){return px},set exports(e){px=e}},TV={};/** - * @license React - * use-sync-external-store-shim.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 vh=S;function X2e(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Z2e=typeof Object.is=="function"?Object.is:X2e,Q2e=vh.useState,J2e=vh.useEffect,eye=vh.useLayoutEffect,tye=vh.useDebugValue;function nye(e,t){var n=t(),r=Q2e({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return eye(function(){i.value=n,i.getSnapshot=t,bw(i)&&o({inst:i})},[e,n,t]),J2e(function(){return bw(i)&&o({inst:i}),e(function(){bw(i)&&o({inst:i})})},[e]),tye(n),n}function bw(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Z2e(e,n)}catch(r){return!0}}function rye(e,t){return t()}var iye=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?rye:nye;TV.useSyncExternalStore=vh.useSyncExternalStore!==void 0?vh.useSyncExternalStore:iye;(function(e){e.exports=TV})(q2e);var mx={},oye={get exports(){return mx},set exports(e){mx=e}},LV={};/** - * @license React - * use-sync-external-store-shim/with-selector.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 O3=S,aye=px;function sye(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var lye=typeof Object.is=="function"?Object.is:sye,uye=aye.useSyncExternalStore,cye=O3.useRef,dye=O3.useEffect,fye=O3.useMemo,hye=O3.useDebugValue;LV.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=cye(null);if(o.current===null){var a={hasValue:!1,value:null};o.current=a}else a=o.current;o=fye(function(){function l(m){if(!u){if(u=!0,c=m,m=r(m),i!==void 0&&a.hasValue){var g=a.value;if(i(g,m))return f=g}return f=m}if(g=f,lye(c,m))return g;var v=r(m);return i!==void 0&&i(g,v)?g:(c=m,f=v)}var u=!1,c,f,p=n===void 0?null:n;return[function(){return l(t())},p===null?void 0:function(){return l(p())}]},[t,n,r,i]);var s=uye(e,o[0],o[1]);return dye(function(){a.hasValue=!0,a.value=s},[s]),hye(s),s};(function(e){e.exports=LV})(oye);function pye(e){e()}let AV=pye;const mye=e=>AV=e,gye=()=>AV,uu=S.createContext(null);function OV(){return S.useContext(uu)}const vye=()=>{throw new Error("uSES not initialized!")};let MV=vye;const yye=e=>{MV=e},bye=(e,t)=>e===t;function Sye(e=uu){const t=e===uu?OV:()=>S.useContext(e);return function(r,i=bye){const{store:o,subscription:a,getServerState:s}=t(),l=MV(a.addNestedSub,o.getState,s||o.getState,r,i);return S.useDebugValue(l),l}}const wye=Sye();var RO={},Cye={get exports(){return RO},set exports(e){RO=e}},Jt={};/** - * @license React - * react-is.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 s_=Symbol.for("react.element"),l_=Symbol.for("react.portal"),M3=Symbol.for("react.fragment"),I3=Symbol.for("react.strict_mode"),R3=Symbol.for("react.profiler"),$3=Symbol.for("react.provider"),D3=Symbol.for("react.context"),xye=Symbol.for("react.server_context"),N3=Symbol.for("react.forward_ref"),B3=Symbol.for("react.suspense"),F3=Symbol.for("react.suspense_list"),z3=Symbol.for("react.memo"),j3=Symbol.for("react.lazy"),_ye=Symbol.for("react.offscreen"),IV;IV=Symbol.for("react.module.reference");function Oo(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case s_:switch(e=e.type,e){case M3:case R3:case I3:case B3:case F3:return e;default:switch(e=e&&e.$$typeof,e){case xye:case D3:case N3:case j3:case z3:case $3:return e;default:return t}}case l_:return t}}}Jt.ContextConsumer=D3;Jt.ContextProvider=$3;Jt.Element=s_;Jt.ForwardRef=N3;Jt.Fragment=M3;Jt.Lazy=j3;Jt.Memo=z3;Jt.Portal=l_;Jt.Profiler=R3;Jt.StrictMode=I3;Jt.Suspense=B3;Jt.SuspenseList=F3;Jt.isAsyncMode=function(){return!1};Jt.isConcurrentMode=function(){return!1};Jt.isContextConsumer=function(e){return Oo(e)===D3};Jt.isContextProvider=function(e){return Oo(e)===$3};Jt.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===s_};Jt.isForwardRef=function(e){return Oo(e)===N3};Jt.isFragment=function(e){return Oo(e)===M3};Jt.isLazy=function(e){return Oo(e)===j3};Jt.isMemo=function(e){return Oo(e)===z3};Jt.isPortal=function(e){return Oo(e)===l_};Jt.isProfiler=function(e){return Oo(e)===R3};Jt.isStrictMode=function(e){return Oo(e)===I3};Jt.isSuspense=function(e){return Oo(e)===B3};Jt.isSuspenseList=function(e){return Oo(e)===F3};Jt.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===M3||e===R3||e===I3||e===B3||e===F3||e===_ye||typeof e=="object"&&e!==null&&(e.$$typeof===j3||e.$$typeof===z3||e.$$typeof===$3||e.$$typeof===D3||e.$$typeof===N3||e.$$typeof===IV||e.getModuleId!==void 0)};Jt.typeOf=Oo;(function(e){e.exports=Jt})(Cye);function kye(){const e=gye();let t=null,n=null;return{clear(){t=null,n=null},notify(){e(()=>{let r=t;for(;r;)r.callback(),r=r.next})},get(){let r=[],i=t;for(;i;)r.push(i),i=i.next;return r},subscribe(r){let i=!0,o=n={callback:r,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){!i||t===null||(i=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}const $O={notify(){},get:()=>[]};function Eye(e,t){let n,r=$O;function i(f){return l(),r.subscribe(f)}function o(){r.notify()}function a(){c.onStateChange&&c.onStateChange()}function s(){return Boolean(n)}function l(){n||(n=t?t.addNestedSub(a):e.subscribe(a),r=kye())}function u(){n&&(n(),n=void 0,r.clear(),r=$O)}const c={addNestedSub:i,notifyNestedSubs:o,handleChangeWrapper:a,isSubscribed:s,trySubscribe:l,tryUnsubscribe:u,getListeners:()=>r};return c}const Pye=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Tye=Pye?S.useLayoutEffect:S.useEffect;function Lye({store:e,context:t,children:n,serverState:r}){const i=S.useMemo(()=>{const s=Eye(e);return{store:e,subscription:s,getServerState:r?()=>r:void 0}},[e,r]),o=S.useMemo(()=>e.getState(),[e]);Tye(()=>{const{subscription:s}=i;return s.onStateChange=s.notifyNestedSubs,s.trySubscribe(),o!==e.getState()&&s.notifyNestedSubs(),()=>{s.tryUnsubscribe(),s.onStateChange=void 0}},[i,o]);const a=t||uu;return M.createElement(a.Provider,{value:i},n)}function RV(e=uu){const t=e===uu?OV:()=>S.useContext(e);return function(){const{store:r}=t();return r}}const Aye=RV();function Oye(e=uu){const t=e===uu?Aye:RV(e);return function(){return t().dispatch}}const Mye=Oye();yye(mx.useSyncExternalStoreWithSelector);mye(la.unstable_batchedUpdates);function M2(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?M2=function(n){return typeof n}:M2=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},M2(e)}function Iye(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function DO(e,t){for(var n=0;n1?t-1:0),r=1;r3?t.i-4:t.i:Array.isArray(e)?1:u_(e)?2:c_(e)?3:0}function Yf(e,t){return zh(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Nye(e,t){return zh(e)===2?e.get(t):e[t]}function DV(e,t,n){var r=zh(e);r===2?e.set(t,n):r===3?(e.delete(t),e.add(n)):e[t]=n}function NV(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function u_(e){return Vye&&e instanceof Map}function c_(e){return Uye&&e instanceof Set}function ec(e){return e.o||e.t}function d_(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=FV(e);delete t[Mn];for(var n=qf(t),r=0;r1&&(e.set=e.add=e.clear=e.delete=Bye),Object.freeze(e),t&&zc(e,function(n,r){return f_(r,!0)},!0)),e}function Bye(){Zo(2)}function h_(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function Xa(e){var t=wx[e];return t||Zo(18,e),t}function Fye(e,t){wx[e]||(wx[e]=t)}function yx(){return zg}function Sw(e,t){t&&(Xa("Patches"),e.u=[],e.s=[],e.v=t)}function Vy(e){bx(e),e.p.forEach(zye),e.p=null}function bx(e){e===zg&&(zg=e.l)}function NO(e){return zg={p:[],l:zg,h:e,m:!0,_:0}}function zye(e){var t=e[Mn];t.i===0||t.i===1?t.j():t.O=!0}function ww(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.g||Xa("ES5").S(t,e,r),r?(n[Mn].P&&(Vy(t),Zo(4)),Us(e)&&(e=Uy(t,e),t.l||Wy(t,e)),t.u&&Xa("Patches").M(n[Mn].t,e,t.u,t.s)):e=Uy(t,n,[]),Vy(t),t.u&&t.v(t.u,t.s),e!==BV?e:void 0}function Uy(e,t,n){if(h_(t))return t;var r=t[Mn];if(!r)return zc(t,function(o,a){return BO(e,r,t,o,a,n)},!0),t;if(r.A!==e)return t;if(!r.P)return Wy(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var i=r.i===4||r.i===5?r.o=d_(r.k):r.o;zc(r.i===3?new Set(i):i,function(o,a){return BO(e,r,i,o,a,n)}),Wy(e,i,!1),n&&e.u&&Xa("Patches").R(r,n,e.u,e.s)}return r.o}function BO(e,t,n,r,i,o){if(cu(i)){var a=Uy(e,i,o&&t&&t.i!==3&&!Yf(t.D,r)?o.concat(r):void 0);if(DV(n,r,a),!cu(a))return;e.m=!1}if(Us(i)&&!h_(i)){if(!e.h.F&&e._<1)return;Uy(e,i),t&&t.A.l||Wy(e,i)}}function Wy(e,t,n){n===void 0&&(n=!1),e.h.F&&e.m&&f_(t,n)}function Cw(e,t){var n=e[Mn];return(n?ec(n):e)[t]}function FO(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function Il(e){e.P||(e.P=!0,e.l&&Il(e.l))}function xw(e){e.o||(e.o=d_(e.t))}function Sx(e,t,n){var r=u_(t)?Xa("MapSet").N(t,n):c_(t)?Xa("MapSet").T(t,n):e.g?function(i,o){var a=Array.isArray(i),s={i:a?1:0,A:o?o.A:yx(),P:!1,I:!1,D:{},l:o,t:i,k:null,o:null,j:null,C:!1},l=s,u=jg;a&&(l=[s],u=hm);var c=Proxy.revocable(l,u),f=c.revoke,p=c.proxy;return s.k=p,s.j=f,p}(t,n):Xa("ES5").J(t,n);return(n?n.A:yx()).p.push(r),r}function jye(e){return cu(e)||Zo(22,e),function t(n){if(!Us(n))return n;var r,i=n[Mn],o=zh(n);if(i){if(!i.P&&(i.i<4||!Xa("ES5").K(i)))return i.t;i.I=!0,r=zO(n,o),i.I=!1}else r=zO(n,o);return zc(r,function(a,s){i&&Nye(i.t,a)===s||DV(r,a,t(s))}),o===3?new Set(r):r}(e)}function zO(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return d_(e)}function Hye(){function e(o,a){var s=i[o];return s?s.enumerable=a:i[o]=s={configurable:!0,enumerable:a,get:function(){var l=this[Mn];return jg.get(l,o)},set:function(l){var u=this[Mn];jg.set(u,o,l)}},s}function t(o){for(var a=o.length-1;a>=0;a--){var s=o[a][Mn];if(!s.P)switch(s.i){case 5:r(s)&&Il(s);break;case 4:n(s)&&Il(s)}}}function n(o){for(var a=o.t,s=o.k,l=qf(s),u=l.length-1;u>=0;u--){var c=l[u];if(c!==Mn){var f=a[c];if(f===void 0&&!Yf(a,c))return!0;var p=s[c],m=p&&p[Mn];if(m?m.t!==f:!NV(p,f))return!0}}var g=!!a[Mn];return l.length!==qf(a).length+(g?0:1)}function r(o){var a=o.k;if(a.length!==o.t.length)return!0;var s=Object.getOwnPropertyDescriptor(a,a.length-1);if(s&&!s.get)return!0;for(var l=0;l1?C-1:0),k=1;k1?c-1:0),p=1;p=0;i--){var o=r[i];if(o.path.length===0&&o.op==="replace"){n=o.value;break}}i>-1&&(r=r.slice(i+1));var a=Xa("Patches").$;return cu(n)?a(n,r):this.produce(n,function(s){return a(s,r)})},e}(),Xi=new Gye,zV=Xi.produce;Xi.produceWithPatches.bind(Xi);Xi.setAutoFreeze.bind(Xi);Xi.setUseProxies.bind(Xi);Xi.applyPatches.bind(Xi);Xi.createDraft.bind(Xi);Xi.finishDraft.bind(Xi);function UO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function WO(e){for(var t=1;t"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Zr(1));return n(m_)(e,t)}if(typeof e!="function")throw new Error(Zr(2));var i=e,o=t,a=[],s=a,l=!1;function u(){s===a&&(s=a.slice())}function c(){if(l)throw new Error(Zr(3));return o}function f(v){if(typeof v!="function")throw new Error(Zr(4));if(l)throw new Error(Zr(5));var x=!0;return u(),s.push(v),function(){if(x){if(l)throw new Error(Zr(6));x=!1,u();var w=s.indexOf(v);s.splice(w,1),a=null}}}function p(v){if(!Kye(v))throw new Error(Zr(7));if(typeof v.type>"u")throw new Error(Zr(8));if(l)throw new Error(Zr(9));try{l=!0,o=i(o,v)}finally{l=!1}for(var x=a=s,C=0;C"u")throw new Error(Zr(12));if(typeof n(void 0,{type:Gy.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Zr(13))})}function jV(e){for(var t=Object.keys(e),n={},r=0;r"u")throw u&&u.type,new Error(Zr(14));f[m]=x,c=c||x!==v}return c=c||o.length!==Object.keys(l).length,c?f:l}}function Ky(){for(var e=arguments.length,t=new Array(e),n=0;n-1){var u=n[l];return l>0&&(n.splice(l,1),n.unshift(u)),u.value}return Yy}function i(s,l){r(s)===Yy&&(n.unshift({key:s,value:l}),n.length>e&&n.pop())}function o(){return n}function a(){n=[]}return{get:r,put:i,getEntries:o,clear:a}}var Qye=function(t,n){return t===n};function Jye(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;for(var i=n.length,o=0;o1?t-1:0),r=1;r0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]{Object.keys(A).forEach(function(O){k(O)&&c[O]!==A[O]&&p.indexOf(O)===-1&&p.push(O)}),Object.keys(c).forEach(function(O){A[O]===void 0&&k(O)&&p.indexOf(O)===-1&&c[O]!==void 0&&p.push(O)}),m===null&&(m=setInterval(C,i)),c=A},o)}function C(){if(p.length===0){m&&clearInterval(m),m=null;return}var A=p.shift(),O=r.reduce(function(I,$){return $.in(I,A,c)},c[A]);if(O!==void 0)try{f[A]=l(O)}catch(I){console.error("redux-persist/createPersistoid: error serializing state",I)}else delete f[A];p.length===0&&w()}function w(){Object.keys(f).forEach(function(A){c[A]===void 0&&delete f[A]}),g=s.setItem(a,l(f)).catch(P)}function k(A){return!(n&&n.indexOf(A)===-1&&A!=="_persist"||t&&t.indexOf(A)!==-1)}function P(A){u&&u(A)}var L=function(){for(;p.length!==0;)C();return g||Promise.resolve()};return{update:x,flush:L}}function Ibe(e){return JSON.stringify(e)}function Rbe(e){var t=e.transforms||[],n="".concat(e.keyPrefix!==void 0?e.keyPrefix:v_).concat(e.key),r=e.storage;e.debug;var i;return e.deserialize===!1?i=function(a){return a}:typeof e.deserialize=="function"?i=e.deserialize:i=$be,r.getItem(n).then(function(o){if(o)try{var a={},s=i(o);return Object.keys(s).forEach(function(l){a[l]=t.reduceRight(function(u,c){return c.out(u,l,s)},i(s[l]))}),a}catch(l){throw l}else return})}function $be(e){return JSON.parse(e)}function Dbe(e){var t=e.storage,n="".concat(e.keyPrefix!==void 0?e.keyPrefix:v_).concat(e.key);return t.removeItem(n,Nbe)}function Nbe(e){}function JO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _s(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function zbe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var jbe=5e3;function Hbe(e,t){var n=e.version!==void 0?e.version:Tbe;e.debug;var r=e.stateReconciler===void 0?Obe:e.stateReconciler,i=e.getStoredState||Rbe,o=e.timeout!==void 0?e.timeout:jbe,a=null,s=!1,l=!0,u=function(f){return f._persist.rehydrated&&a&&!l&&a.update(f),f};return function(c,f){var p=c||{},m=p._persist,g=Fbe(p,["_persist"]),v=g;if(f.type===KV){var x=!1,C=function(I,$){x||(f.rehydrate(e.key,I,$),x=!0)};if(o&&setTimeout(function(){!x&&C(void 0,new Error('redux-persist: persist timed out for persist key "'.concat(e.key,'"')))},o),l=!1,a||(a=Mbe(e)),m)return _s({},t(v,f),{_persist:m});if(typeof f.rehydrate!="function"||typeof f.register!="function")throw new Error("redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.");return f.register(e.key),i(e).then(function(O){var I=e.migrate||function($,D){return Promise.resolve($)};I(O,n).then(function($){C($)},function($){C(void 0,$)})},function(O){C(void 0,O)}),_s({},t(v,f),{_persist:{version:n,rehydrated:!1}})}else{if(f.type===YV)return s=!0,f.result(Dbe(e)),_s({},t(v,f),{_persist:m});if(f.type===WV)return f.result(a&&a.flush()),_s({},t(v,f),{_persist:m});if(f.type===GV)l=!0;else if(f.type===y_){if(s)return _s({},v,{_persist:_s({},m,{rehydrated:!0})});if(f.key===e.key){var w=t(v,f),k=f.payload,P=r!==!1&&k!==void 0?r(k,c,w,e):w,L=_s({},P,{_persist:_s({},m,{rehydrated:!0})});return u(L)}}}if(!m)return t(c,f);var A=t(v,f);return A===v?c:u(_s({},A,{_persist:m}))}}function eM(e){return Wbe(e)||Ube(e)||Vbe()}function Vbe(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function Ube(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)}function Wbe(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0&&arguments[0]!==void 0?arguments[0]:XV,n=arguments.length>1?arguments[1]:void 0;switch(n.type){case qV:return xx({},t,{registry:[].concat(eM(t.registry),[n.key])});case y_:var r=t.registry.indexOf(n.key),i=eM(t.registry);return i.splice(r,1),xx({},t,{registry:i,bootstrapped:i.length===0});default:return t}};function Ybe(e,t,n){var r=n||!1,i=m_(Kbe,XV,t&&t.enhancer?t.enhancer:void 0),o=function(u){i.dispatch({type:qV,key:u})},a=function(u,c,f){var p={type:y_,payload:c,err:f,key:u};e.dispatch(p),i.dispatch(p),r&&s.getState().bootstrapped&&(r(),r=!1)},s=xx({},i,{purge:function(){var u=[];return e.dispatch({type:YV,result:function(f){u.push(f)}}),Promise.all(u)},flush:function(){var u=[];return e.dispatch({type:WV,result:function(f){u.push(f)}}),Promise.all(u)},pause:function(){e.dispatch({type:GV})},persist:function(){e.dispatch({type:KV,register:o,rehydrate:a})}});return t&&t.manualPersist||s.persist(),s}var b_={},S_={};S_.__esModule=!0;S_.default=Zbe;function D2(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?D2=function(n){return typeof n}:D2=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},D2(e)}function Pw(){}var qbe={getItem:Pw,setItem:Pw,removeItem:Pw};function Xbe(e){if((typeof self>"u"?"undefined":D2(self))!=="object"||!(e in self))return!1;try{var t=self[e],n="redux-persist ".concat(e," test");t.setItem(n,"test"),t.getItem(n),t.removeItem(n)}catch(r){return!1}return!0}function Zbe(e){var t="".concat(e,"Storage");return Xbe(t)?self[t]:qbe}b_.__esModule=!0;b_.default=e3e;var Qbe=Jbe(S_);function Jbe(e){return e&&e.__esModule?e:{default:e}}function e3e(e){var t=(0,Qbe.default)(e);return{getItem:function(r){return new Promise(function(i,o){i(t.getItem(r))})},setItem:function(r,i){return new Promise(function(o,a){o(t.setItem(r,i))})},removeItem:function(r){return new Promise(function(i,o){i(t.removeItem(r))})}}}var ZV=void 0,t3e=n3e(b_);function n3e(e){return e&&e.__esModule?e:{default:e}}var r3e=(0,t3e.default)("local");ZV=r3e;var QV={},JV={},jc={};Object.defineProperty(jc,"__esModule",{value:!0});jc.PLACEHOLDER_UNDEFINED=jc.PACKAGE_NAME=void 0;jc.PACKAGE_NAME="redux-deep-persist";jc.PLACEHOLDER_UNDEFINED="@@placeholder/undefined";var w_={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigType=void 0,function(t){t[t.WHITELIST=0]="WHITELIST",t[t.BLACKLIST=1]="BLACKLIST"}(e.ConfigType||(e.ConfigType={}))})(w_);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getRootKeysGroup=e.throwError=e.configValidator=e.transformsValidator=e.singleTransformValidator=e.findDuplicatesAndSubsets=e.unique=e.preserveUndefined=e.mergeDeep=e.dissocPath=e.assocPath=e.path=e.difference=e.cloneDeep=e._cloneDeep=e.getCircularPath=e.isEmpty=e.isDate=e.isString=e.isIntegerString=e.isPlainObject=e.isArray=e.isLength=e.isObjectLike=void 0;const t=jc,n=w_,r=function(z){return typeof z=="object"&&z!==null};e.isObjectLike=r;const i=function(z){return typeof z=="number"&&z>-1&&z%1==0&&z<=Number.MAX_SAFE_INTEGER};e.isLength=i,e.isArray=Array.isArray||function(z){return(0,e.isLength)(z&&z.length)&&Object.prototype.toString.call(z)==="[object Array]"};const o=function(z){return!!z&&typeof z=="object"&&!(0,e.isArray)(z)};e.isPlainObject=o;const a=function(z){return String(~~z)===z&&Number(z)>=0};e.isIntegerString=a;const s=function(z){return Object.prototype.toString.call(z)==="[object String]"};e.isString=s;const l=function(z){return Object.prototype.toString.call(z)==="[object Date]"};e.isDate=l;const u=function(z){return Object.keys(z).length===0};e.isEmpty=u;const c=Object.prototype.hasOwnProperty,f=function(z,R,N){N||(N=new Set([z])),R||(R="");for(const U in z){const G=R?`${R}.${U}`:U,B=z[U];if((0,e.isObjectLike)(B))return N.has(B)?`${R}.${U}:`:(N.add(B),(0,e.getCircularPath)(B,G,N))}return null};e.getCircularPath=f;const p=function(z){if(!(0,e.isObjectLike)(z))return z;if((0,e.isDate)(z))return new Date(+z);const R=(0,e.isArray)(z)?[]:{};for(const N in z){const U=z[N];R[N]=(0,e._cloneDeep)(U)}return R};e._cloneDeep=p;const m=function(z){const R=(0,e.getCircularPath)(z);if(R)throw new Error(`${t.PACKAGE_NAME}: circular dependency detected under the path '${R}' of object you're trying to persist: ${z}`);return(0,e._cloneDeep)(z)};e.cloneDeep=m;const g=function(z,R){if(z===R)return{};if(!(0,e.isObjectLike)(z)||!(0,e.isObjectLike)(R))return R;const N=(0,e.cloneDeep)(z),U=(0,e.cloneDeep)(R),G=Object.keys(N).reduce((W,X)=>(c.call(U,X)||(W[X]=void 0),W),{});if((0,e.isDate)(N)||(0,e.isDate)(U))return N.valueOf()===U.valueOf()?{}:U;const B=Object.keys(U).reduce((W,X)=>{if(!c.call(N,X))return W[X]=U[X],W;const re=(0,e.difference)(N[X],U[X]);return(0,e.isObjectLike)(re)&&(0,e.isEmpty)(re)&&!(0,e.isDate)(re)?(0,e.isArray)(N)&&!(0,e.isArray)(U)||!(0,e.isArray)(N)&&(0,e.isArray)(U)?U:W:(W[X]=re,W)},G);return delete B._persist,B};e.difference=g;const v=function(z,R){return R.reduce((N,U)=>{if(N){const G=parseInt(U,10),B=(0,e.isIntegerString)(U)&&G<0?N.length+G:U;return(0,e.isString)(N)?N.charAt(B):N[B]}},z)};e.path=v;const x=function(z,R){return[...z].reverse().reduce((G,B,W)=>{const X=(0,e.isIntegerString)(B)?[]:{};return X[B]=W===0?R:G,X},{})};e.assocPath=x;const C=function(z,R){const N=(0,e.cloneDeep)(z);return R.reduce((U,G,B)=>(B===R.length-1&&U&&(0,e.isObjectLike)(U)&&delete U[G],U&&U[G]),N),N};e.dissocPath=C;const w=function(z,R,...N){if(!N||!N.length)return R;const U=N.shift(),{preservePlaceholder:G,preserveUndefined:B}=z;if((0,e.isObjectLike)(R)&&(0,e.isObjectLike)(U))for(const W in U)if((0,e.isObjectLike)(U[W])&&(0,e.isObjectLike)(R[W]))R[W]||(R[W]={}),w(z,R[W],U[W]);else if((0,e.isArray)(R)){let X=U[W];const re=G?t.PLACEHOLDER_UNDEFINED:void 0;B||(X=typeof X<"u"?X:R[parseInt(W,10)]),X=X!==t.PLACEHOLDER_UNDEFINED?X:re,R[parseInt(W,10)]=X}else{const X=U[W]!==t.PLACEHOLDER_UNDEFINED?U[W]:void 0;R[W]=X}return w(z,R,...N)},k=function(z,R,N){return w({preservePlaceholder:N==null?void 0:N.preservePlaceholder,preserveUndefined:N==null?void 0:N.preserveUndefined},(0,e.cloneDeep)(z),(0,e.cloneDeep)(R))};e.mergeDeep=k;const P=function(z,R=[],N,U,G){if(!(0,e.isObjectLike)(z))return z;for(const B in z){const W=z[B],X=(0,e.isArray)(z),re=U?U+"."+B:B;W===null&&(N===n.ConfigType.WHITELIST&&R.indexOf(re)===-1||N===n.ConfigType.BLACKLIST&&R.indexOf(re)!==-1)&&X&&(z[parseInt(B,10)]=void 0),W===void 0&&G&&N===n.ConfigType.BLACKLIST&&R.indexOf(re)===-1&&X&&(z[parseInt(B,10)]=t.PLACEHOLDER_UNDEFINED),P(W,R,N,re,G)}},L=function(z,R,N,U){const G=(0,e.cloneDeep)(z);return P(G,R,N,"",U),G};e.preserveUndefined=L;const A=function(z,R,N){return N.indexOf(z)===R};e.unique=A;const O=function(z){return z.reduce((R,N)=>{const U=z.filter(le=>le===N),G=z.filter(le=>(N+".").indexOf(le+".")===0),{duplicates:B,subsets:W}=R,X=U.length>1&&B.indexOf(N)===-1,re=G.length>1;return{duplicates:[...B,...X?U:[]],subsets:[...W,...re?G:[]].filter(e.unique).sort()}},{duplicates:[],subsets:[]})};e.findDuplicatesAndSubsets=O;const I=function(z,R,N){const U=N===n.ConfigType.WHITELIST?"whitelist":"blacklist",G=`${t.PACKAGE_NAME}: incorrect ${U} configuration.`,B=`Check your create${N===n.ConfigType.WHITELIST?"White":"Black"}list arguments. - -`;if(!(0,e.isString)(R)||R.length<1)throw new Error(`${G} Name (key) of reducer is required. ${B}`);if(!z||!z.length)return;const{duplicates:W,subsets:X}=(0,e.findDuplicatesAndSubsets)(z);if(W.length>1)throw new Error(`${G} Duplicated paths. - - ${JSON.stringify(W)} - - ${B}`);if(X.length>1)throw new Error(`${G} You are trying to persist an entire property and also some of its subset. - -${JSON.stringify(X)} - - ${B}`)};e.singleTransformValidator=I;const $=function(z){if(!(0,e.isArray)(z))return;const R=(z==null?void 0:z.map(N=>N.deepPersistKey).filter(N=>N))||[];if(R.length){const N=R.filter((U,G)=>R.indexOf(U)!==G);if(N.length)throw new Error(`${t.PACKAGE_NAME}: found duplicated keys in transforms creators. You can createWhitelist or createBlacklist for a specific root reducer key only once. Duplicated keys among createWhitelist and createBlacklist transforms are not allowed. - - Duplicates: ${JSON.stringify(N)}`)}};e.transformsValidator=$;const D=function({whitelist:z,blacklist:R}){if(z&&z.length&&R&&R.length)throw new Error(`${t.PACKAGE_NAME}: you should not define a whitelist and blacklist in parallel. It is allowed to use only one of these lists per config.`);if(z){const{duplicates:N,subsets:U}=(0,e.findDuplicatesAndSubsets)(z);(0,e.throwError)({duplicates:N,subsets:U},"whitelist")}if(R){const{duplicates:N,subsets:U}=(0,e.findDuplicatesAndSubsets)(R);(0,e.throwError)({duplicates:N,subsets:U},"blacklist")}};e.configValidator=D;const V=function({duplicates:z,subsets:R},N){if(z.length)throw new Error(`${t.PACKAGE_NAME}: duplicates of paths found in your ${N}. - - ${JSON.stringify(z)}`);if(R.length)throw new Error(`${t.PACKAGE_NAME}: subsets of some parent keys found in your ${N}. You must decide if you want to persist an entire path or its specific subset. - - ${JSON.stringify(R)}`)};e.throwError=V;const Y=function(z){return(0,e.isArray)(z)?z.filter(e.unique).reduce((R,N)=>{const U=N.split("."),G=U[0],B=U.slice(1).join(".")||void 0,W=R.filter(re=>Object.keys(re)[0]===G)[0],X=W?Object.values(W)[0]:void 0;return W||R.push({[G]:B?[B]:void 0}),W&&!X&&B&&(W[G]=[B]),W&&X&&B&&X.push(B),R},[]):[]};e.getRootKeysGroup=Y})(JV);(function(e){var t=Pi&&Pi.__rest||function(f,p){var m={};for(var g in f)Object.prototype.hasOwnProperty.call(f,g)&&p.indexOf(g)<0&&(m[g]=f[g]);if(f!=null&&typeof Object.getOwnPropertySymbols=="function")for(var v=0,g=Object.getOwnPropertySymbols(f);v!x(w)&&f?f(C,w,k):C,out:(C,w,k)=>!x(w)&&p?p(C,w,k):C,deepPersistKey:g&&g[0]}},a=(f,p,m,{debug:g,whitelist:v,blacklist:x,transforms:C})=>{if(v||x)throw new Error("State reconciler autoMergeDeep uses custom transforms instead of old whitelist or blacklist config properties. Please use createWhitelist or createBlacklist transforms.");(0,n.transformsValidator)(C);const w=(0,n.cloneDeep)(m);let k=f;if(k&&(0,n.isObjectLike)(k)){const P=(0,n.difference)(p,m);(0,n.isEmpty)(P)||(k=(0,n.mergeDeep)(f,P,{preserveUndefined:!0}),g&&console.log(`${r.PACKAGE_NAME}/autoMergeDeep: sub state of your state was modified by reducer during rehydration. Values from reducer will be kept: ${JSON.stringify(P)}`)),Object.keys(k).forEach(L=>{if(L!=="_persist"){if((0,n.isObjectLike)(w[L])){w[L]=(0,n.mergeDeep)(w[L],k[L]);return}w[L]=k[L]}})}return g&&k&&(0,n.isObjectLike)(k)&&console.log(`${r.PACKAGE_NAME}/autoMergeDeep: rehydrated keys ${JSON.stringify(k)}`),w};e.autoMergeDeep=a;const s=(f,p)=>((0,n.singleTransformValidator)(p,f,i.ConfigType.WHITELIST),o(m=>{if(!p||!p.length)return m;let g=null,v;return p.forEach(x=>{const C=x.split(".");v=(0,n.path)(m,C),typeof v>"u"&&(0,n.isIntegerString)(C[C.length-1])&&(v=r.PLACEHOLDER_UNDEFINED);const w=(0,n.assocPath)(C,v),k=(0,n.isArray)(w)?[]:{};g=(0,n.mergeDeep)(g||k,w,{preservePlaceholder:!0})}),g||m},m=>(0,n.preserveUndefined)(m,p,i.ConfigType.WHITELIST),{whitelist:[f]}));e.createWhitelist=s;const l=(f,p)=>((0,n.singleTransformValidator)(p,f,i.ConfigType.BLACKLIST),o(m=>{if(!p||!p.length)return;const g=(0,n.preserveUndefined)(m,p,i.ConfigType.BLACKLIST,!0);return p.map(x=>x.split(".")).reduce((x,C)=>(0,n.dissocPath)(x,C),g)},m=>(0,n.preserveUndefined)(m,p,i.ConfigType.BLACKLIST),{whitelist:[f]}));e.createBlacklist=l;const u=function(f,p){return p.map(m=>{const g=Object.keys(m)[0],v=m[g];return f===i.ConfigType.WHITELIST?(0,e.createWhitelist)(g,v):(0,e.createBlacklist)(g,v)})};e.getTransforms=u;const c=f=>{var{key:p,whitelist:m,blacklist:g,storage:v,transforms:x,rootReducer:C}=f,w=t(f,["key","whitelist","blacklist","storage","transforms","rootReducer"]);(0,n.configValidator)({whitelist:m,blacklist:g});const k=(0,n.getRootKeysGroup)(m),P=(0,n.getRootKeysGroup)(g),L=Object.keys(C(void 0,{type:""})),A=k.map(Y=>Object.keys(Y)[0]),O=P.map(Y=>Object.keys(Y)[0]),I=L.filter(Y=>A.indexOf(Y)===-1&&O.indexOf(Y)===-1),$=(0,e.getTransforms)(i.ConfigType.WHITELIST,k),D=(0,e.getTransforms)(i.ConfigType.BLACKLIST,P),V=(0,n.isArray)(m)?I.map(Y=>(0,e.createBlacklist)(Y)):[];return Object.assign(Object.assign({},w),{key:p,storage:v,transforms:[...$,...D,...V,...x||[]],stateReconciler:e.autoMergeDeep})};e.getPersistConfig=c})(QV);const Fl=(e,t)=>Math.floor(e/t)*t,Ha=(e,t)=>Math.round(e/t)*t;function i3e(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}var o3e=i3e,a3e=/\s/;function s3e(e){for(var t=e.length;t--&&a3e.test(e.charAt(t)););return t}var l3e=s3e,u3e=l3e,c3e=/^\s+/;function d3e(e){return e&&e.slice(0,u3e(e)+1).replace(c3e,"")}var f3e=d3e;function h3e(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var us=h3e,p3e=typeof Pi=="object"&&Pi&&Pi.Object===Object&&Pi,eU=p3e,m3e=eU,g3e=typeof self=="object"&&self&&self.Object===Object&&self,v3e=m3e||g3e||Function("return this")(),fa=v3e,y3e=fa,b3e=y3e.Symbol,k1=b3e,nM=k1,tU=Object.prototype,S3e=tU.hasOwnProperty,w3e=tU.toString,Up=nM?nM.toStringTag:void 0;function C3e(e){var t=S3e.call(e,Up),n=e[Up];try{e[Up]=void 0;var r=!0}catch(o){}var i=w3e.call(e);return r&&(t?e[Up]=n:delete e[Up]),i}var x3e=C3e,_3e=Object.prototype,k3e=_3e.toString;function E3e(e){return k3e.call(e)}var P3e=E3e,rM=k1,T3e=x3e,L3e=P3e,A3e="[object Null]",O3e="[object Undefined]",iM=rM?rM.toStringTag:void 0;function M3e(e){return e==null?e===void 0?O3e:A3e:iM&&iM in Object(e)?T3e(e):L3e(e)}var jh=M3e;function I3e(e){return e!=null&&typeof e=="object"}var Cu=I3e,R3e=jh,$3e=Cu,D3e="[object Symbol]";function N3e(e){return typeof e=="symbol"||$3e(e)&&R3e(e)==D3e}var H3=N3e,B3e=f3e,oM=us,F3e=H3,aM=0/0,z3e=/^[-+]0x[0-9a-f]+$/i,j3e=/^0b[01]+$/i,H3e=/^0o[0-7]+$/i,V3e=parseInt;function U3e(e){if(typeof e=="number")return e;if(F3e(e))return aM;if(oM(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=oM(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=B3e(e);var n=j3e.test(e);return n||H3e.test(e)?V3e(e.slice(2),n?2:8):z3e.test(e)?aM:+e}var C_=U3e,W3e=o3e,Tw=C_;function G3e(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=Tw(n),n=n===n?n:0),t!==void 0&&(t=Tw(t),t=t===t?t:0),W3e(Tw(e),t,n)}var ti=G3e;function K3e(){this.__data__=[],this.size=0}var Y3e=K3e;function q3e(e,t){return e===t||e!==e&&t!==t}var V3=q3e,X3e=V3;function Z3e(e,t){for(var n=e.length;n--;)if(X3e(e[n][0],t))return n;return-1}var U3=Z3e,Q3e=U3,J3e=Array.prototype,e4e=J3e.splice;function t4e(e){var t=this.__data__,n=Q3e(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():e4e.call(t,n,1),--this.size,!0}var n4e=t4e,r4e=U3;function i4e(e){var t=this.__data__,n=r4e(t,e);return n<0?void 0:t[n][1]}var o4e=i4e,a4e=U3;function s4e(e){return a4e(this.__data__,e)>-1}var l4e=s4e,u4e=U3;function c4e(e,t){var n=this.__data__,r=u4e(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var d4e=c4e,f4e=Y3e,h4e=n4e,p4e=o4e,m4e=l4e,g4e=d4e;function Hh(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=qSe}var P_=XSe,ZSe=jh,QSe=P_,JSe=Cu,ewe="[object Arguments]",twe="[object Array]",nwe="[object Boolean]",rwe="[object Date]",iwe="[object Error]",owe="[object Function]",awe="[object Map]",swe="[object Number]",lwe="[object Object]",uwe="[object RegExp]",cwe="[object Set]",dwe="[object String]",fwe="[object WeakMap]",hwe="[object ArrayBuffer]",pwe="[object DataView]",mwe="[object Float32Array]",gwe="[object Float64Array]",vwe="[object Int8Array]",ywe="[object Int16Array]",bwe="[object Int32Array]",Swe="[object Uint8Array]",wwe="[object Uint8ClampedArray]",Cwe="[object Uint16Array]",xwe="[object Uint32Array]",wn={};wn[mwe]=wn[gwe]=wn[vwe]=wn[ywe]=wn[bwe]=wn[Swe]=wn[wwe]=wn[Cwe]=wn[xwe]=!0;wn[ewe]=wn[twe]=wn[hwe]=wn[nwe]=wn[pwe]=wn[rwe]=wn[iwe]=wn[owe]=wn[awe]=wn[swe]=wn[lwe]=wn[uwe]=wn[cwe]=wn[dwe]=wn[fwe]=!1;function _we(e){return JSe(e)&&QSe(e.length)&&!!wn[ZSe(e)]}var kwe=_we;function Ewe(e){return function(t){return e(t)}}var T_=Ewe,bh={},Pwe={get exports(){return bh},set exports(e){bh=e}};(function(e,t){var n=eU,r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===r,a=o&&n.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||a&&a.binding&&a.binding("util")}catch(u){}}();e.exports=s})(Pwe,bh);var Twe=kwe,Lwe=T_,fM=bh,hM=fM&&fM.isTypedArray,Awe=hM?Lwe(hM):Twe,lU=Awe,Owe=MSe,Mwe=sU,Iwe=Mo,Rwe=yh,$we=E1,Dwe=lU,Nwe=Object.prototype,Bwe=Nwe.hasOwnProperty;function Fwe(e,t){var n=Iwe(e),r=!n&&Mwe(e),i=!n&&!r&&Rwe(e),o=!n&&!r&&!i&&Dwe(e),a=n||r||i||o,s=a?Owe(e.length,String):[],l=s.length;for(var u in e)(t||Bwe.call(e,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||$we(u,l)))&&s.push(u);return s}var uU=Fwe,zwe=Object.prototype;function jwe(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||zwe;return e===n}var L_=jwe;function Hwe(e,t){return function(n){return e(t(n))}}var cU=Hwe,Vwe=cU,Uwe=Vwe(Object.keys,Object),Wwe=Uwe,Gwe=L_,Kwe=Wwe,Ywe=Object.prototype,qwe=Ywe.hasOwnProperty;function Xwe(e){if(!Gwe(e))return Kwe(e);var t=[];for(var n in Object(e))qwe.call(e,n)&&n!="constructor"&&t.push(n);return t}var Zwe=Xwe,Qwe=nU,Jwe=P_;function e6e(e){return e!=null&&Jwe(e.length)&&!Qwe(e)}var P1=e6e,t6e=uU,n6e=Zwe,r6e=P1;function i6e(e){return r6e(e)?t6e(e):n6e(e)}var T1=i6e,o6e=Y3,a6e=T1;function s6e(e,t){return e&&o6e(t,a6e(t),e)}var l6e=s6e;function u6e(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var c6e=u6e,d6e=us,f6e=L_,h6e=c6e,p6e=Object.prototype,m6e=p6e.hasOwnProperty;function g6e(e){if(!d6e(e))return h6e(e);var t=f6e(e),n=[];for(var r in e)r=="constructor"&&(t||!m6e.call(e,r))||n.push(r);return n}var v6e=g6e,y6e=uU,b6e=v6e,S6e=P1;function w6e(e){return S6e(e)?y6e(e,!0):b6e(e)}var A_=w6e,C6e=Y3,x6e=A_;function _6e(e,t){return e&&C6e(t,x6e(t),e)}var k6e=_6e,Xy={},E6e={get exports(){return Xy},set exports(e){Xy=e}};(function(e,t){var n=fa,r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===r,a=o?n.Buffer:void 0,s=a?a.allocUnsafe:void 0;function l(u,c){if(c)return u.slice();var f=u.length,p=s?s(f):new u.constructor(f);return u.copy(p),p}e.exports=l})(E6e,Xy);function P6e(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n{const s=e/2-(n+i/2)*a,l=t/2-(r+o/2)*a;return{x:s,y:l}},Vd=(e,t,n,r,i=.95)=>{const o=e*i/n,a=t*i/r;return Math.min(1,Math.min(o,a))},Y7e=.999,q7e=.1,X7e=20,Wp=.95,LM=30,Lx=10,AM=e=>({x:Math.floor(e.x),y:Math.floor(e.y)}),Gu=e=>{const{width:t,height:n}=e,r={width:t,height:n},i=512*512,o=t/n;let a=t*n,s=448;for(;a1?(r.width=s,r.height=Ha(s/o,64)):o<1&&(r.height=s,r.width=Ha(s*o,64)),a=r.width*r.height;return r},Z7e=e=>({width:Ha(e.width,64),height:Ha(e.height,64)}),xU=[{key:"Base",value:"base"},{key:"Mask",value:"mask"}],Q7e=[{key:"Auto",value:"auto"},{key:"Manual",value:"manual"},{key:"None",value:"none"}],I_=e=>e.kind==="line"&&e.layer==="mask",J7e=e=>e.kind==="line"&&e.layer==="base",Zy=e=>e.kind==="image"&&e.layer==="base",e9e=e=>e.kind==="fillRect"&&e.layer==="base",t9e=e=>e.kind==="eraseRect"&&e.layer==="base",n9e=e=>e.kind==="line",pm={objects:[],stagingArea:{images:[],selectedImageIndex:-1}},r9e={boundingBoxCoordinates:{x:0,y:0},boundingBoxDimensions:{width:512,height:512},boundingBoxPreviewFill:{r:0,g:0,b:0,a:.5},boundingBoxScaleMethod:"auto",brushColor:{r:90,g:90,b:255,a:1},brushSize:50,canvasContainerDimensions:{width:0,height:0},colorPickerColor:{r:90,g:90,b:255,a:1},cursorPosition:null,doesCanvasNeedScaling:!1,futureLayerStates:[],isCanvasInitialized:!1,isDrawing:!1,isMaskEnabled:!0,isMouseOverBoundingBox:!1,isMoveBoundingBoxKeyHeld:!1,isMoveStageKeyHeld:!1,isMovingBoundingBox:!1,isMovingStage:!1,isTransformingBoundingBox:!1,layer:"base",layerState:pm,maskColor:{r:255,g:90,b:90,a:1},maxHistory:128,minimumStageScale:1,pastLayerStates:[],scaledBoundingBoxDimensions:{width:512,height:512},shouldAutoSave:!1,shouldCropToBoundingBoxOnSave:!1,shouldDarkenOutsideBoundingBox:!1,shouldLockBoundingBox:!1,shouldPreserveMaskedArea:!1,shouldRestrictStrokesToBox:!0,shouldShowBoundingBox:!0,shouldShowBrush:!0,shouldShowBrushPreview:!1,shouldShowCanvasDebugInfo:!1,shouldShowCheckboardTransparency:!1,shouldShowGrid:!0,shouldShowIntermediates:!0,shouldShowStagingImage:!0,shouldShowStagingOutline:!0,shouldSnapToGrid:!0,stageCoordinates:{x:0,y:0},stageDimensions:{width:0,height:0},stageScale:1,tool:"brush"},_U=Qc({name:"canvas",initialState:r9e,reducers:{setTool:(e,t)=>{const n=t.payload;e.tool=t.payload,n!=="move"&&(e.isTransformingBoundingBox=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1)},setLayer:(e,t)=>{e.layer=t.payload},toggleTool:e=>{const t=e.tool;t!=="move"&&(e.tool=t==="brush"?"eraser":"brush")},setMaskColor:(e,t)=>{e.maskColor=t.payload},setBrushColor:(e,t)=>{e.brushColor=t.payload},setBrushSize:(e,t)=>{e.brushSize=t.payload},clearMask:e=>{e.pastLayerStates.push(co(e.layerState)),e.layerState.objects=e.layerState.objects.filter(t=>!I_(t)),e.futureLayerStates=[],e.shouldPreserveMaskedArea=!1},toggleShouldInvertMask:e=>{e.shouldPreserveMaskedArea=!e.shouldPreserveMaskedArea},toggleShouldShowMask:e=>{e.isMaskEnabled=!e.isMaskEnabled},setShouldPreserveMaskedArea:(e,t)=>{e.shouldPreserveMaskedArea=t.payload},setIsMaskEnabled:(e,t)=>{e.isMaskEnabled=t.payload,e.layer=t.payload?"mask":"base"},setShouldShowCheckboardTransparency:(e,t)=>{e.shouldShowCheckboardTransparency=t.payload},setShouldShowBrushPreview:(e,t)=>{e.shouldShowBrushPreview=t.payload},setShouldShowBrush:(e,t)=>{e.shouldShowBrush=t.payload},setCursorPosition:(e,t)=>{e.cursorPosition=t.payload},setInitialCanvasImage:(e,t)=>{const n=t.payload,{stageDimensions:r}=e,i={width:Fl(ti(n.width,64,512),64),height:Fl(ti(n.height,64,512),64)},o={x:Ha(n.width/2-i.width/2,64),y:Ha(n.height/2-i.height/2,64)};if(e.boundingBoxScaleMethod==="auto"){const l=Gu(i);e.scaledBoundingBoxDimensions=l}e.boundingBoxDimensions=i,e.boundingBoxCoordinates=o,e.pastLayerStates.push(co(e.layerState)),e.layerState={...pm,objects:[{kind:"image",layer:"base",x:0,y:0,width:n.width,height:n.height,image:n}]},e.futureLayerStates=[],e.isCanvasInitialized=!1;const a=Vd(r.width,r.height,n.width,n.height,Wp),s=Hd(r.width,r.height,0,0,n.width,n.height,a);e.stageScale=a,e.stageCoordinates=s,e.doesCanvasNeedScaling=!0},setBoundingBoxDimensions:(e,t)=>{const n=Z7e(t.payload);if(e.boundingBoxDimensions=n,e.boundingBoxScaleMethod==="auto"){const r=Gu(n);e.scaledBoundingBoxDimensions=r}},setBoundingBoxCoordinates:(e,t)=>{e.boundingBoxCoordinates=AM(t.payload)},setStageCoordinates:(e,t)=>{e.stageCoordinates=t.payload},setBoundingBoxPreviewFill:(e,t)=>{e.boundingBoxPreviewFill=t.payload},setDoesCanvasNeedScaling:(e,t)=>{e.doesCanvasNeedScaling=t.payload},setStageScale:(e,t)=>{e.stageScale=t.payload},setShouldDarkenOutsideBoundingBox:(e,t)=>{e.shouldDarkenOutsideBoundingBox=t.payload},setIsDrawing:(e,t)=>{e.isDrawing=t.payload},clearCanvasHistory:e=>{e.pastLayerStates=[],e.futureLayerStates=[]},setShouldLockBoundingBox:(e,t)=>{e.shouldLockBoundingBox=t.payload},toggleShouldLockBoundingBox:e=>{e.shouldLockBoundingBox=!e.shouldLockBoundingBox},setShouldShowBoundingBox:(e,t)=>{e.shouldShowBoundingBox=t.payload},setIsTransformingBoundingBox:(e,t)=>{e.isTransformingBoundingBox=t.payload},setIsMovingBoundingBox:(e,t)=>{e.isMovingBoundingBox=t.payload},setIsMouseOverBoundingBox:(e,t)=>{e.isMouseOverBoundingBox=t.payload},setIsMoveBoundingBoxKeyHeld:(e,t)=>{e.isMoveBoundingBoxKeyHeld=t.payload},setIsMoveStageKeyHeld:(e,t)=>{e.isMoveStageKeyHeld=t.payload},addImageToStagingArea:(e,t)=>{const{boundingBox:n,image:r}=t.payload;!n||!r||(e.pastLayerStates.push(co(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea.images.push({kind:"image",layer:"base",...n,image:r}),e.layerState.stagingArea.selectedImageIndex=e.layerState.stagingArea.images.length-1,e.futureLayerStates=[])},discardStagedImages:e=>{e.pastLayerStates.push(co(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea={...pm.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingOutline=!0},addFillRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,brushColor:r}=e;e.pastLayerStates.push(co(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"fillRect",layer:"base",...t,...n,color:r}),e.futureLayerStates=[]},addEraseRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n}=e;e.pastLayerStates.push(co(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"eraseRect",layer:"base",...t,...n}),e.futureLayerStates=[]},addLine:(e,t)=>{const{tool:n,layer:r,brushColor:i,brushSize:o,shouldRestrictStrokesToBox:a}=e;if(n==="move"||n==="colorPicker")return;const s=o/2,l=r==="base"&&n==="brush"?{color:i}:{};e.pastLayerStates.push(co(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift();const u={kind:"line",layer:r,tool:n,strokeWidth:s,points:t.payload,...l};a&&(u.clip={...e.boundingBoxCoordinates,...e.boundingBoxDimensions}),e.layerState.objects.push(u),e.futureLayerStates=[]},addPointToCurrentLine:(e,t)=>{const n=e.layerState.objects.findLast(n9e);n&&n.points.push(...t.payload)},undo:e=>{const t=e.pastLayerStates.pop();t&&(e.futureLayerStates.unshift(co(e.layerState)),e.futureLayerStates.length>e.maxHistory&&e.futureLayerStates.pop(),e.layerState=t)},redo:e=>{const t=e.futureLayerStates.shift();t&&(e.pastLayerStates.push(co(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState=t)},setShouldShowGrid:(e,t)=>{e.shouldShowGrid=t.payload},setIsMovingStage:(e,t)=>{e.isMovingStage=t.payload},setShouldSnapToGrid:(e,t)=>{e.shouldSnapToGrid=t.payload},setShouldAutoSave:(e,t)=>{e.shouldAutoSave=t.payload},setShouldShowIntermediates:(e,t)=>{e.shouldShowIntermediates=t.payload},resetCanvas:e=>{e.pastLayerStates.push(co(e.layerState)),e.layerState=pm,e.futureLayerStates=[]},setCanvasContainerDimensions:(e,t)=>{e.canvasContainerDimensions=t.payload},resizeAndScaleCanvas:e=>{const{width:t,height:n}=e.canvasContainerDimensions,r=e.layerState.objects.find(Zy),i={width:Math.floor(t),height:Math.floor(n)};if(!r){const c=Vd(i.width,i.height,512,512,Wp),f=Hd(i.width,i.height,0,0,512,512,c),p={width:512,height:512};if(e.stageScale=c,e.stageCoordinates=f,e.stageDimensions=i,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=p,e.boundingBoxScaleMethod==="auto"){const m=Gu(p);e.scaledBoundingBoxDimensions=m}return}const{width:o,height:a}=r,l=Vd(t,n,o,a,.95),u=Hd(i.width,i.height,0,0,o,a,l);e.minimumStageScale=l,e.stageScale=l,e.stageCoordinates=AM(u),e.stageDimensions=i,e.isCanvasInitialized=!0},resizeCanvas:e=>{const{width:t,height:n}=e.canvasContainerDimensions,r={width:Math.floor(t),height:Math.floor(n)};if(e.stageDimensions=r,!e.layerState.objects.find(Zy)){const i=Vd(r.width,r.height,512,512,Wp),o=Hd(r.width,r.height,0,0,512,512,i),a={width:512,height:512};if(e.stageScale=i,e.stageCoordinates=o,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=a,e.boundingBoxScaleMethod==="auto"){const s=Gu(a);e.scaledBoundingBoxDimensions=s}}},resetCanvasView:(e,t)=>{const{contentRect:n,shouldScaleTo1:r}=t.payload,{stageDimensions:{width:i,height:o}}=e,{x:a,y:s,width:l,height:u}=n;if(l!==0&&u!==0){const c=r?1:Vd(i,o,l,u,Wp),f=Hd(i,o,a,s,l,u,c);e.stageScale=c,e.stageCoordinates=f}else{const c=Vd(i,o,512,512,Wp),f=Hd(i,o,0,0,512,512,c),p={width:512,height:512};if(e.stageScale=c,e.stageCoordinates=f,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=p,e.boundingBoxScaleMethod==="auto"){const m=Gu(p);e.scaledBoundingBoxDimensions=m}}},nextStagingAreaImage:e=>{const t=e.layerState.stagingArea.selectedImageIndex,n=e.layerState.stagingArea.images.length;e.layerState.stagingArea.selectedImageIndex=Math.min(t+1,n-1)},prevStagingAreaImage:e=>{const t=e.layerState.stagingArea.selectedImageIndex;e.layerState.stagingArea.selectedImageIndex=Math.max(t-1,0)},commitStagingAreaImage:e=>{const{images:t,selectedImageIndex:n}=e.layerState.stagingArea;e.pastLayerStates.push(co(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({...t[n]}),e.layerState.stagingArea={...pm.stagingArea},e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingImage=!0},fitBoundingBoxToStage:e=>{const{boundingBoxDimensions:t,boundingBoxCoordinates:n,stageDimensions:r,stageScale:i}=e,o=r.width/i,a=r.height/i;if(n.x<0||n.x+t.width>o||n.y<0||n.y+t.height>a){const s={width:Fl(ti(o,64,512),64),height:Fl(ti(a,64,512),64)},l={x:Ha(o/2-s.width/2,64),y:Ha(a/2-s.height/2,64)};if(e.boundingBoxDimensions=s,e.boundingBoxCoordinates=l,e.boundingBoxScaleMethod==="auto"){const u=Gu(s);e.scaledBoundingBoxDimensions=u}}},setBoundingBoxScaleMethod:(e,t)=>{if(e.boundingBoxScaleMethod=t.payload,t.payload==="auto"){const n=Gu(e.boundingBoxDimensions);e.scaledBoundingBoxDimensions=n}},setScaledBoundingBoxDimensions:(e,t)=>{e.scaledBoundingBoxDimensions=t.payload},setShouldShowStagingImage:(e,t)=>{e.shouldShowStagingImage=t.payload},setShouldShowStagingOutline:(e,t)=>{e.shouldShowStagingOutline=t.payload},setShouldShowCanvasDebugInfo:(e,t)=>{e.shouldShowCanvasDebugInfo=t.payload},setShouldRestrictStrokesToBox:(e,t)=>{e.shouldRestrictStrokesToBox=t.payload},setShouldCropToBoundingBoxOnSave:(e,t)=>{e.shouldCropToBoundingBoxOnSave=t.payload},setColorPickerColor:(e,t)=>{e.colorPickerColor=t.payload},commitColorPickerColor:e=>{e.brushColor={...e.colorPickerColor,a:e.brushColor.a},e.tool="brush"},setMergedCanvas:(e,t)=>{e.pastLayerStates.push(co(e.layerState)),e.futureLayerStates=[],e.layerState.objects=[t.payload]},resetCanvasInteractionState:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMoveBoundingBoxKeyHeld=!1,e.isMoveStageKeyHeld=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1,e.isTransformingBoundingBox=!1},mouseLeftCanvas:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isTransformingBoundingBox=!1}}}),{addEraseRect:kU,addFillRect:EU,addImageToStagingArea:i9e,addLine:o9e,addPointToCurrentLine:PU,clearCanvasHistory:TU,clearMask:R_,commitColorPickerColor:a9e,commitStagingAreaImage:s9e,discardStagedImages:l9e,fitBoundingBoxToStage:YXe,mouseLeftCanvas:u9e,nextStagingAreaImage:c9e,prevStagingAreaImage:d9e,redo:f9e,resetCanvas:$_,resetCanvasInteractionState:h9e,resetCanvasView:LU,resizeAndScaleCanvas:X3,resizeCanvas:p9e,setBoundingBoxCoordinates:Aw,setBoundingBoxDimensions:mm,setBoundingBoxPreviewFill:qXe,setBoundingBoxScaleMethod:m9e,setBrushColor:Xf,setBrushSize:Zf,setCanvasContainerDimensions:g9e,setColorPickerColor:v9e,setCursorPosition:y9e,setDoesCanvasNeedScaling:hr,setInitialCanvasImage:Z3,setIsDrawing:AU,setIsMaskEnabled:L1,setIsMouseOverBoundingBox:Ev,setIsMoveBoundingBoxKeyHeld:XXe,setIsMoveStageKeyHeld:ZXe,setIsMovingBoundingBox:Ow,setIsMovingStage:Qy,setIsTransformingBoundingBox:Mw,setLayer:Jy,setMaskColor:OU,setMergedCanvas:b9e,setShouldAutoSave:MU,setShouldCropToBoundingBoxOnSave:IU,setShouldDarkenOutsideBoundingBox:RU,setShouldLockBoundingBox:QXe,setShouldPreserveMaskedArea:$U,setShouldShowBoundingBox:S9e,setShouldShowBrush:JXe,setShouldShowBrushPreview:eZe,setShouldShowCanvasDebugInfo:DU,setShouldShowCheckboardTransparency:tZe,setShouldShowGrid:NU,setShouldShowIntermediates:BU,setShouldShowStagingImage:w9e,setShouldShowStagingOutline:OM,setShouldSnapToGrid:eb,setStageCoordinates:FU,setStageScale:C9e,setTool:Za,toggleShouldLockBoundingBox:nZe,toggleTool:rZe,undo:x9e,setScaledBoundingBoxDimensions:Pv,setShouldRestrictStrokesToBox:zU}=_U.actions,_9e=_U.reducer,k9e={currentImageUuid:"",shouldPinGallery:!0,shouldShowGallery:!0,galleryScrollPosition:0,galleryImageMinimumWidth:64,galleryImageObjectFit:"cover",shouldHoldGalleryOpen:!1,shouldAutoSwitchToNewImages:!0,currentCategory:"result",categories:{user:{images:[],latest_mtime:void 0,earliest_mtime:void 0,areMoreImagesAvailable:!0},result:{images:[],latest_mtime:void 0,earliest_mtime:void 0,areMoreImagesAvailable:!0}},galleryWidth:300,shouldUseSingleGalleryColumn:!1},jU=Qc({name:"gallery",initialState:k9e,reducers:{setCurrentImage:(e,t)=>{e.currentImage=t.payload,e.currentImageUuid=t.payload.uuid},removeImage:(e,t)=>{const{uuid:n,category:r}=t.payload,i=e.categories[r].images,o=i.filter(a=>a.uuid!==n);if(n===e.currentImageUuid){const a=i.findIndex(l=>l.uuid===n),s=ti(a,0,o.length-1);e.currentImage=o.length?o[s]:void 0,e.currentImageUuid=o.length?o[s].uuid:""}e.categories[r].images=o},addImage:(e,t)=>{const{image:n,category:r}=t.payload,{uuid:i,url:o,mtime:a}=n,s=e.categories[r];s.images.find(l=>l.url===o&&l.mtime===a)||(s.images.unshift(n),e.shouldAutoSwitchToNewImages&&(e.currentImageUuid=i,e.currentImage=n,e.currentCategory=r),e.intermediateImage=void 0,s.latest_mtime=a)},setIntermediateImage:(e,t)=>{e.intermediateImage=t.payload},clearIntermediateImage:e=>{e.intermediateImage=void 0},selectNextImage:e=>{const{currentImage:t}=e;if(!t)return;const n=e.categories[t.category].images;if(t){const r=n.findIndex(i=>i.uuid===t.uuid);if(r{const{currentImage:t}=e;if(!t)return;const n=e.categories[t.category].images;if(t){const r=n.findIndex(i=>i.uuid===t.uuid);if(r>0){const i=n[r-1];e.currentImage=i,e.currentImageUuid=i.uuid}}},addGalleryImages:(e,t)=>{const{images:n,areMoreImagesAvailable:r,category:i}=t.payload,o=e.categories[i].images;if(n.length>0){const a=n.filter(s=>!o.find(l=>l.url===s.url&&l.mtime===s.mtime));if(e.categories[i].images=o.concat(a).sort((s,l)=>l.mtime-s.mtime),!e.currentImage){const s=n[0];e.currentImage=s,e.currentImageUuid=s.uuid}e.categories[i].latest_mtime=n[0].mtime,e.categories[i].earliest_mtime=n[n.length-1].mtime}r!==void 0&&(e.categories[i].areMoreImagesAvailable=r)},setShouldPinGallery:(e,t)=>{e.shouldPinGallery=t.payload},setShouldShowGallery:(e,t)=>{e.shouldShowGallery=t.payload},setGalleryScrollPosition:(e,t)=>{e.galleryScrollPosition=t.payload},setGalleryImageMinimumWidth:(e,t)=>{e.galleryImageMinimumWidth=t.payload},setGalleryImageObjectFit:(e,t)=>{e.galleryImageObjectFit=t.payload},setShouldHoldGalleryOpen:(e,t)=>{e.shouldHoldGalleryOpen=t.payload},setShouldAutoSwitchToNewImages:(e,t)=>{e.shouldAutoSwitchToNewImages=t.payload},setCurrentCategory:(e,t)=>{e.currentCategory=t.payload},setGalleryWidth:(e,t)=>{e.galleryWidth=t.payload},setShouldUseSingleGalleryColumn:(e,t)=>{e.shouldUseSingleGalleryColumn=t.payload}}}),{addImage:wf,clearIntermediateImage:Iw,removeImage:HU,setCurrentImage:MM,addGalleryImages:E9e,setIntermediateImage:P9e,selectNextImage:D_,selectPrevImage:N_,setShouldPinGallery:T9e,setShouldShowGallery:Zl,setGalleryScrollPosition:L9e,setGalleryImageMinimumWidth:Gp,setGalleryImageObjectFit:A9e,setShouldHoldGalleryOpen:VU,setShouldAutoSwitchToNewImages:O9e,setCurrentCategory:Tv,setGalleryWidth:M9e,setShouldUseSingleGalleryColumn:I9e}=jU.actions,R9e=jU.reducer,$9e={isLightboxOpen:!1},D9e=$9e,UU=Qc({name:"lightbox",initialState:D9e,reducers:{setIsLightboxOpen:(e,t)=>{e.isLightboxOpen=t.payload}}}),{setIsLightboxOpen:Qf}=UU.actions,N9e=UU.reducer,Km=e=>e.length===1?e[0].prompt:e.map(t=>`${t.prompt}:${t.weight}`).join(" ");function B_(e){let t=Km(e),n=null;const r=new RegExp(new RegExp("(?<=\\[)[^\\][]*(?=])"),"gi"),i=[...t.matchAll(r)];return i&&i.length>0&&(n=i.join(", "),t=t.replaceAll(r,"").replaceAll("[]","").trim()),[t,n]}const B9e=e=>{const r=e.split(",").map(i=>i.split(":")).map(i=>({seed:Number(i[0]),weight:Number(i[1])}));return F_(r)?r:!1},F_=e=>Boolean(typeof e=="string"?B9e(e):e.length&&!e.some(t=>{const{seed:n,weight:r}=t,i=!isNaN(parseInt(n.toString(),10)),o=!isNaN(parseInt(r.toString(),10))&&r>=0&&r<=1;return!(i&&o)})),tb=e=>e.reduce((t,n,r,i)=>{const{seed:o,weight:a}=n;return t+=`${o}:${a}`,r!==i.length-1&&(t+=","),t},""),F9e=e=>e.split(",").map(r=>r.split(":")).map(r=>[parseInt(r[0],10),parseFloat(r[1])]),WU={cfgScale:7.5,height:512,img2imgStrength:.75,infillMethod:"patchmatch",iterations:1,maskPath:"",perlin:0,prompt:"",negativePrompt:"",sampler:"k_lms",seamBlur:16,seamless:!1,seamSize:96,seamSteps:30,seamStrength:.7,seed:0,seedWeights:"",shouldFitToWidthHeight:!0,shouldGenerateVariations:!1,shouldRandomizeSeed:!0,steps:50,threshold:0,tileSize:32,variationAmount:.1,width:512},z9e=WU,GU=Qc({name:"generation",initialState:z9e,reducers:{setPrompt:(e,t)=>{const n=t.payload;typeof n=="string"?e.prompt=n:e.prompt=Km(n)},setNegativePrompt:(e,t)=>{const n=t.payload;typeof n=="string"?e.negativePrompt=n:e.negativePrompt=Km(n)},setIterations:(e,t)=>{e.iterations=t.payload},setSteps:(e,t)=>{e.steps=t.payload},setCfgScale:(e,t)=>{e.cfgScale=t.payload},setThreshold:(e,t)=>{e.threshold=t.payload},setPerlin:(e,t)=>{e.perlin=t.payload},setHeight:(e,t)=>{e.height=t.payload},setWidth:(e,t)=>{e.width=t.payload},setSampler:(e,t)=>{e.sampler=t.payload},setSeed:(e,t)=>{e.seed=t.payload,e.shouldRandomizeSeed=!1},setImg2imgStrength:(e,t)=>{e.img2imgStrength=t.payload},setMaskPath:(e,t)=>{e.maskPath=t.payload},setSeamless:(e,t)=>{e.seamless=t.payload},setShouldFitToWidthHeight:(e,t)=>{e.shouldFitToWidthHeight=t.payload},resetSeed:e=>{e.seed=-1},setParameter:(e,t)=>{const{key:n,value:r}=t.payload,i={...e,[n]:r};return n==="seed"&&(i.shouldRandomizeSeed=!1),i},setShouldGenerateVariations:(e,t)=>{e.shouldGenerateVariations=t.payload},setVariationAmount:(e,t)=>{e.variationAmount=t.payload},setSeedWeights:(e,t)=>{e.seedWeights=t.payload,e.shouldGenerateVariations=!0,e.variationAmount=0},setAllTextToImageParameters:(e,t)=>{const{sampler:n,prompt:r,seed:i,variations:o,steps:a,cfg_scale:s,threshold:l,perlin:u,seamless:c,hires_fix:f,width:p,height:m}=t.payload.image;o&&o.length>0?(e.seedWeights=tb(o),e.shouldGenerateVariations=!0,e.variationAmount=0):e.shouldGenerateVariations=!1,i&&(e.seed=i,e.shouldRandomizeSeed=!1),r&&(e.prompt=Km(r)),n&&(e.sampler=n),a&&(e.steps=a),s&&(e.cfgScale=s),typeof l>"u"?e.threshold=0:e.threshold=l,u&&(e.perlin=u),typeof u>"u"&&(e.perlin=0),typeof c=="boolean"&&(e.seamless=c),p&&(e.width=p),m&&(e.height=m)},setAllImageToImageParameters:(e,t)=>{const{type:n,strength:r,fit:i,init_image_path:o,mask_image_path:a}=t.payload.image;n==="img2img"&&(o&&(e.initialImage=o),a&&(e.maskPath=a),r&&(e.img2imgStrength=r),typeof i=="boolean"&&(e.shouldFitToWidthHeight=i))},setAllParameters:(e,t)=>{const{type:n,sampler:r,prompt:i,seed:o,variations:a,steps:s,cfg_scale:l,threshold:u,perlin:c,seamless:f,hires_fix:p,width:m,height:g,strength:v,fit:x,init_image_path:C,mask_image_path:w}=t.payload.image;if(n==="img2img"&&(C&&(e.initialImage=C),w&&(e.maskPath=w),v&&(e.img2imgStrength=v),typeof x=="boolean"&&(e.shouldFitToWidthHeight=x)),a&&a.length>0?(e.seedWeights=tb(a),e.shouldGenerateVariations=!0,e.variationAmount=0):e.shouldGenerateVariations=!1,o&&(e.seed=o,e.shouldRandomizeSeed=!1),i){const[k,P]=B_(i);k&&(e.prompt=k),P?e.negativePrompt=P:e.negativePrompt=""}r&&(e.sampler=r),s&&(e.steps=s),l&&(e.cfgScale=l),u&&(e.threshold=u),typeof u>"u"&&(e.threshold=0),c&&(e.perlin=c),typeof c>"u"&&(e.perlin=0),typeof f=="boolean"&&(e.seamless=f),m&&(e.width=m),g&&(e.height=g)},resetParametersState:e=>({...e,...WU}),setShouldRandomizeSeed:(e,t)=>{e.shouldRandomizeSeed=t.payload},setInitialImage:(e,t)=>{e.initialImage=t.payload},clearInitialImage:e=>{e.initialImage=void 0},setSeamSize:(e,t)=>{e.seamSize=t.payload},setSeamBlur:(e,t)=>{e.seamBlur=t.payload},setSeamStrength:(e,t)=>{e.seamStrength=t.payload},setSeamSteps:(e,t)=>{e.seamSteps=t.payload},setTileSize:(e,t)=>{e.tileSize=t.payload},setInfillMethod:(e,t)=>{e.infillMethod=t.payload}}}),{clearInitialImage:KU,resetParametersState:iZe,resetSeed:oZe,setAllImageToImageParameters:j9e,setAllParameters:YU,setAllTextToImageParameters:aZe,setCfgScale:qU,setHeight:XU,setImg2imgStrength:Ax,setInfillMethod:ZU,setInitialImage:Kh,setIterations:H9e,setMaskPath:QU,setParameter:sZe,setPerlin:JU,setPrompt:Q3,setNegativePrompt:Hg,setSampler:eW,setSeamBlur:IM,setSeamless:tW,setSeamSize:RM,setSeamSteps:$M,setSeamStrength:DM,setSeed:A1,setSeedWeights:nW,setShouldFitToWidthHeight:rW,setShouldGenerateVariations:V9e,setShouldRandomizeSeed:U9e,setSteps:iW,setThreshold:oW,setTileSize:NM,setVariationAmount:W9e,setWidth:aW}=GU.actions,G9e=GU.reducer,sW={codeformerFidelity:.75,facetoolStrength:.8,facetoolType:"gfpgan",hiresFix:!1,hiresStrength:.75,shouldLoopback:!1,shouldRunESRGAN:!1,shouldRunFacetool:!1,upscalingLevel:4,upscalingStrength:.75},K9e=sW,lW=Qc({name:"postprocessing",initialState:K9e,reducers:{setFacetoolStrength:(e,t)=>{e.facetoolStrength=t.payload},setCodeformerFidelity:(e,t)=>{e.codeformerFidelity=t.payload},setUpscalingLevel:(e,t)=>{e.upscalingLevel=t.payload},setUpscalingStrength:(e,t)=>{e.upscalingStrength=t.payload},setHiresFix:(e,t)=>{e.hiresFix=t.payload},setHiresStrength:(e,t)=>{e.hiresStrength=t.payload},resetPostprocessingState:e=>({...e,...sW}),setShouldRunFacetool:(e,t)=>{e.shouldRunFacetool=t.payload},setFacetoolType:(e,t)=>{e.facetoolType=t.payload},setShouldRunESRGAN:(e,t)=>{e.shouldRunESRGAN=t.payload},setShouldLoopback:(e,t)=>{e.shouldLoopback=t.payload}}}),{resetPostprocessingState:lZe,setCodeformerFidelity:uW,setFacetoolStrength:B2,setFacetoolType:F2,setHiresFix:z_,setHiresStrength:BM,setShouldLoopback:Y9e,setShouldRunESRGAN:q9e,setShouldRunFacetool:X9e,setUpscalingLevel:Ox,setUpscalingStrength:Mx}=lW.actions,Z9e=lW.reducer;function aa(e){return aa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},aa(e)}function cs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Q9e(e,t){if(aa(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(aa(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cW(e){var t=Q9e(e,"string");return aa(t)==="symbol"?t:String(t)}function FM(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:{};cs(this,e),this.init(t,n)}return ds(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=n||i8e,this.options=r,this.debug=r.debug}},{key:"setDebug",value:function(n){this.debug=n}},{key:"log",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i1?r-1:0),o=1;o-1?s.replace(/###/g,"."):s}function i(){return!e||typeof e=="string"}for(var o=typeof t!="string"?[].concat(t):t.split(".");o.length>1;){if(i())return{};var a=r(o.shift());!e[a]&&n&&(e[a]=new n),Object.prototype.hasOwnProperty.call(e,a)?e=e[a]:e={}}return i()?{}:{obj:e,k:r(o.shift())}}function UM(e,t,n){var r=j_(e,t,Object),i=r.obj,o=r.k;i[o]=n}function s8e(e,t,n,r){var i=j_(e,t,Object),o=i.obj,a=i.k;o[a]=o[a]||[],r&&(o[a]=o[a].concat(n)),r||o[a].push(n)}function nb(e,t){var n=j_(e,t),r=n.obj,i=n.k;if(r)return r[i]}function WM(e,t,n){var r=nb(e,n);return r!==void 0?r:nb(t,n)}function dW(e,t,n){for(var r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):dW(e[r],t[r],n):e[r]=t[r]);return e}function Ud(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var l8e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function u8e(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,function(t){return l8e[t]}):e}var e4=typeof window<"u"&&window.navigator&&typeof window.navigator.userAgentData>"u"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,c8e=[" ",",","?","!",";"];function d8e(e,t,n){t=t||"",n=n||"";var r=c8e.filter(function(s){return t.indexOf(s)<0&&n.indexOf(s)<0});if(r.length===0)return!0;var i=new RegExp("(".concat(r.map(function(s){return s==="?"?"\\?":s}).join("|"),")")),o=!i.test(e);if(!o){var a=e.indexOf(n);a>0&&!i.test(e.substring(0,a))&&(o=!0)}return o}function GM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Lv(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function fW(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(e){if(e[t])return e[t];for(var r=t.split(n),i=e,o=0;oo+a;)a++,s=r.slice(o,o+a).join(n),l=i[s];if(l===void 0)return;if(l===null)return null;if(t.endsWith(s)){if(typeof l=="string")return l;if(s&&typeof l[s]=="string")return l[s]}var u=r.slice(o+a).join(n);return u?fW(l,u,n):void 0}i=i[r[o]]}return i}}var p8e=function(e){J3(n,e);var t=f8e(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return cs(this,n),i=t.call(this),e4&&du.call(Ql(i)),i.data=r||{},i.options=o,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.options.ignoreJSONStructure===void 0&&(i.options.ignoreJSONStructure=!0),i}return ds(n,[{key:"addNamespaces",value:function(i){this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}},{key:"removeNamespaces",value:function(i){var o=this.options.ns.indexOf(i);o>-1&&this.options.ns.splice(o,1)}},{key:"getResource",value:function(i,o,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,u=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure,c=[i,o];a&&typeof a!="string"&&(c=c.concat(a)),a&&typeof a=="string"&&(c=c.concat(l?a.split(l):a)),i.indexOf(".")>-1&&(c=i.split("."));var f=nb(this.data,c);return f||!u||typeof a!="string"?f:fW(this.data&&this.data[i]&&this.data[i][o],a,l)}},{key:"addResource",value:function(i,o,a,s){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},u=this.options.keySeparator;u===void 0&&(u=".");var c=[i,o];a&&(c=c.concat(u?a.split(u):a)),i.indexOf(".")>-1&&(c=i.split("."),s=o,o=c[1]),this.addNamespaces(o),UM(this.data,c,s),l.silent||this.emit("added",i,o,a,s)}},{key:"addResources",value:function(i,o,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var l in a)(typeof a[l]=="string"||Object.prototype.toString.apply(a[l])==="[object Array]")&&this.addResource(i,o,l,a[l],{silent:!0});s.silent||this.emit("added",i,o,a)}},{key:"addResourceBundle",value:function(i,o,a,s,l){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},c=[i,o];i.indexOf(".")>-1&&(c=i.split("."),s=a,a=o,o=c[1]),this.addNamespaces(o);var f=nb(this.data,c)||{};s?dW(f,a,l):f=Lv(Lv({},f),a),UM(this.data,c,f),u.silent||this.emit("added",i,o,a)}},{key:"removeResourceBundle",value:function(i,o){this.hasResourceBundle(i,o)&&delete this.data[i][o],this.removeNamespaces(o),this.emit("removed",i,o)}},{key:"hasResourceBundle",value:function(i,o){return this.getResource(i,o)!==void 0}},{key:"getResourceBundle",value:function(i,o){return o||(o=this.options.defaultNS),this.options.compatibilityAPI==="v1"?Lv(Lv({},{}),this.getResource(i,o)):this.getResource(i,o)}},{key:"getDataByLanguage",value:function(i){return this.data[i]}},{key:"hasLanguageSomeTranslations",value:function(i){var o=this.getDataByLanguage(i),a=o&&Object.keys(o)||[];return!!a.find(function(s){return o[s]&&Object.keys(o[s]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),n}(du),hW={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,n,r,i,o){var a=this;return t.forEach(function(s){a.processors[s]&&(n=a.processors[s].process(n,r,i,o))}),n}};function KM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ai(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}var YM={},qM=function(e){J3(n,e);var t=m8e(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return cs(this,n),i=t.call(this),e4&&du.call(Ql(i)),a8e(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],r,Ql(i)),i.options=o,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.logger=Va.create("translator"),i}return ds(n,[{key:"changeLanguage",value:function(i){i&&(this.language=i)}},{key:"exists",value:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(i==null)return!1;var a=this.resolve(i,o);return a&&a.res!==void 0}},{key:"extractFromKey",value:function(i,o){var a=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;a===void 0&&(a=":");var s=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,l=o.ns||this.options.defaultNS||[],u=a&&i.indexOf(a)>-1,c=!this.options.userDefinedKeySeparator&&!o.keySeparator&&!this.options.userDefinedNsSeparator&&!o.nsSeparator&&!d8e(i,a,s);if(u&&!c){var f=i.match(this.interpolator.nestingRegexp);if(f&&f.length>0)return{key:i,namespaces:l};var p=i.split(a);(a!==s||a===s&&this.options.ns.indexOf(p[0])>-1)&&(l=p.shift()),i=p.join(s)}return typeof l=="string"&&(l=[l]),{key:i,namespaces:l}}},{key:"translate",value:function(i,o,a){var s=this;if(aa(o)!=="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),o||(o={}),i==null)return"";Array.isArray(i)||(i=[String(i)]);var l=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,u=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,c=this.extractFromKey(i[i.length-1],o),f=c.key,p=c.namespaces,m=p[p.length-1],g=o.lng||this.language,v=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(g&&g.toLowerCase()==="cimode"){if(v){var x=o.nsSeparator||this.options.nsSeparator;return l?(C.res="".concat(m).concat(x).concat(f),C):"".concat(m).concat(x).concat(f)}return l?(C.res=f,C):f}var C=this.resolve(i,o),w=C&&C.res,k=C&&C.usedKey||f,P=C&&C.exactUsedKey||f,L=Object.prototype.toString.apply(w),A=["[object Number]","[object Function]","[object RegExp]"],O=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,I=!this.i18nFormat||this.i18nFormat.handleAsObject,$=typeof w!="string"&&typeof w!="boolean"&&typeof w!="number";if(I&&w&&$&&A.indexOf(L)<0&&!(typeof O=="string"&&L==="[object Array]")){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var D=this.options.returnedObjectHandler?this.options.returnedObjectHandler(k,w,ai(ai({},o),{},{ns:p})):"key '".concat(f," (").concat(this.language,")' returned an object instead of string.");return l?(C.res=D,C):D}if(u){var V=L==="[object Array]",Y=V?[]:{},z=V?P:k;for(var R in w)if(Object.prototype.hasOwnProperty.call(w,R)){var N="".concat(z).concat(u).concat(R);Y[R]=this.translate(N,ai(ai({},o),{joinArrays:!1,ns:p})),Y[R]===N&&(Y[R]=w[R])}w=Y}}else if(I&&typeof O=="string"&&L==="[object Array]")w=w.join(O),w&&(w=this.extendTranslation(w,i,o,a));else{var U=!1,G=!1,B=o.count!==void 0&&typeof o.count!="string",W=n.hasDefaultValue(o),X=B?this.pluralResolver.getSuffix(g,o.count,o):"",re=o["defaultValue".concat(X)]||o.defaultValue;!this.isValidLookup(w)&&W&&(U=!0,w=re),this.isValidLookup(w)||(G=!0,w=f);var le=o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,he=le&&G?void 0:w,se=W&&re!==w&&this.options.updateMissing;if(G||U||se){if(this.logger.log(se?"updateKey":"missingKey",g,m,f,se?re:w),u){var Ae=this.resolve(f,ai(ai({},o),{},{keySeparator:!1}));Ae&&Ae.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var be=[],De=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&De&&De[0])for(var fe=0;fe1&&arguments[1]!==void 0?arguments[1]:{},s,l,u,c,f;return typeof i=="string"&&(i=[i]),i.forEach(function(p){if(!o.isValidLookup(s)){var m=o.extractFromKey(p,a),g=m.key;l=g;var v=m.namespaces;o.options.fallbackNS&&(v=v.concat(o.options.fallbackNS));var x=a.count!==void 0&&typeof a.count!="string",C=x&&!a.ordinal&&a.count===0&&o.pluralResolver.shouldUseIntlApi(),w=a.context!==void 0&&(typeof a.context=="string"||typeof a.context=="number")&&a.context!=="",k=a.lngs?a.lngs:o.languageUtils.toResolveHierarchy(a.lng||o.language,a.fallbackLng);v.forEach(function(P){o.isValidLookup(s)||(f=P,!YM["".concat(k[0],"-").concat(P)]&&o.utils&&o.utils.hasLoadedNamespace&&!o.utils.hasLoadedNamespace(f)&&(YM["".concat(k[0],"-").concat(P)]=!0,o.logger.warn('key "'.concat(l,'" for languages "').concat(k.join(", "),`" won't get resolved as namespace "`).concat(f,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),k.forEach(function(L){if(!o.isValidLookup(s)){c=L;var A=[g];if(o.i18nFormat&&o.i18nFormat.addLookupKeys)o.i18nFormat.addLookupKeys(A,g,L,P,a);else{var O;x&&(O=o.pluralResolver.getSuffix(L,a.count,a));var I="".concat(o.options.pluralSeparator,"zero");if(x&&(A.push(g+O),C&&A.push(g+I)),w){var $="".concat(g).concat(o.options.contextSeparator).concat(a.context);A.push($),x&&(A.push($+O),C&&A.push($+I))}}for(var D;D=A.pop();)o.isValidLookup(s)||(u=D,s=o.getResource(L,P,D,a))}}))})}}),{res:s,usedKey:l,exactUsedKey:u,usedLng:c,usedNS:f}}},{key:"isValidLookup",value:function(i){return i!==void 0&&!(!this.options.returnNull&&i===null)&&!(!this.options.returnEmptyString&&i==="")}},{key:"getResource",value:function(i,o,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(i,o,a,s):this.resourceStore.getResource(i,o,a,s)}}],[{key:"hasDefaultValue",value:function(i){var o="defaultValue";for(var a in i)if(Object.prototype.hasOwnProperty.call(i,a)&&o===a.substring(0,o.length)&&i[a]!==void 0)return!0;return!1}}]),n}(du);function Rw(e){return e.charAt(0).toUpperCase()+e.slice(1)}var XM=function(){function e(t){cs(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Va.create("languageUtils")}return ds(e,[{key:"getScriptPartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return null;var r=n.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}},{key:"getLanguagePartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return n;var r=n.split("-");return this.formatLanguageCode(r[0])}},{key:"formatLanguageCode",value:function(n){if(typeof n=="string"&&n.indexOf("-")>-1){var r=["hans","hant","latn","cyrl","cans","mong","arab"],i=n.split("-");return this.options.lowerCaseLng?i=i.map(function(o){return o.toLowerCase()}):i.length===2?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),r.indexOf(i[1].toLowerCase())>-1&&(i[1]=Rw(i[1].toLowerCase()))):i.length===3&&(i[0]=i[0].toLowerCase(),i[1].length===2&&(i[1]=i[1].toUpperCase()),i[0]!=="sgn"&&i[2].length===2&&(i[2]=i[2].toUpperCase()),r.indexOf(i[1].toLowerCase())>-1&&(i[1]=Rw(i[1].toLowerCase())),r.indexOf(i[2].toLowerCase())>-1&&(i[2]=Rw(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?n.toLowerCase():n}},{key:"isSupportedCode",value:function(n){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(n=this.getLanguagePartFromCode(n)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(n)>-1}},{key:"getBestMatchFromCodes",value:function(n){var r=this;if(!n)return null;var i;return n.forEach(function(o){if(!i){var a=r.formatLanguageCode(o);(!r.options.supportedLngs||r.isSupportedCode(a))&&(i=a)}}),!i&&this.options.supportedLngs&&n.forEach(function(o){if(!i){var a=r.getLanguagePartFromCode(o);if(r.isSupportedCode(a))return i=a;i=r.options.supportedLngs.find(function(s){if(s.indexOf(a)===0)return s})}}),i||(i=this.getFallbackCodes(this.options.fallbackLng)[0]),i}},{key:"getFallbackCodes",value:function(n,r){if(!n)return[];if(typeof n=="function"&&(n=n(r)),typeof n=="string"&&(n=[n]),Object.prototype.toString.apply(n)==="[object Array]")return n;if(!r)return n.default||[];var i=n[r];return i||(i=n[this.getScriptPartFromCode(r)]),i||(i=n[this.formatLanguageCode(r)]),i||(i=n[this.getLanguagePartFromCode(r)]),i||(i=n.default),i||[]}},{key:"toResolveHierarchy",value:function(n,r){var i=this,o=this.getFallbackCodes(r||this.options.fallbackLng||[],n),a=[],s=function(u){u&&(i.isSupportedCode(u)?a.push(u):i.logger.warn("rejecting language code not found in supportedLngs: ".concat(u)))};return typeof n=="string"&&n.indexOf("-")>-1?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(n)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(n)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(n))):typeof n=="string"&&s(this.formatLanguageCode(n)),o.forEach(function(l){a.indexOf(l)<0&&s(i.formatLanguageCode(l))}),a}}]),e}(),v8e=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],y8e={1:function(t){return Number(t>1)},2:function(t){return Number(t!=1)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(t==1?0:t>=2&&t<=4?1:2)},7:function(t){return Number(t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(t==1?0:t==2?1:t!=8&&t!=11?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(t==1?0:t==2?1:t<7?2:t<11?3:4)},11:function(t){return Number(t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(t!==0)},14:function(t){return Number(t==1?0:t==2?1:t==3?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:t!==0?1:2)},17:function(t){return Number(t==1||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(t==0?0:t==1?1:2)},19:function(t){return Number(t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(t==1?0:t==0||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3)}},b8e=["v1","v2","v3"],ZM={zero:0,one:1,two:2,few:3,many:4,other:5};function S8e(){var e={};return v8e.forEach(function(t){t.lngs.forEach(function(n){e[n]={numbers:t.nr,plurals:y8e[t.fc]}})}),e}var w8e=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};cs(this,e),this.languageUtils=t,this.options=n,this.logger=Va.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=S8e()}return ds(e,[{key:"addRule",value:function(n,r){this.rules[n]=r}},{key:"getRule",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(n,{type:r.ordinal?"ordinal":"cardinal"})}catch(i){return}return this.rules[n]||this.rules[this.languageUtils.getLanguagePartFromCode(n)]}},{key:"needsPlural",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.getRule(n,r);return this.shouldUseIntlApi()?i&&i.resolvedOptions().pluralCategories.length>1:i&&i.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(n,i).map(function(o){return"".concat(r).concat(o)})}},{key:"getSuffixes",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.getRule(n,i);return o?this.shouldUseIntlApi()?o.resolvedOptions().pluralCategories.sort(function(a,s){return ZM[a]-ZM[s]}).map(function(a){return"".concat(r.options.prepend).concat(a)}):o.numbers.map(function(a){return r.getSuffix(n,a,i)}):[]}},{key:"getSuffix",value:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=this.getRule(n,i);return o?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(o.select(r)):this.getSuffixRetroCompatible(o,r):(this.logger.warn("no plural rule found for: ".concat(n)),"")}},{key:"getSuffixRetroCompatible",value:function(n,r){var i=this,o=n.noAbs?n.plurals(r):n.plurals(Math.abs(r)),a=n.numbers[o];this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1&&(a===2?a="plural":a===1&&(a=""));var s=function(){return i.options.prepend&&a.toString()?i.options.prepend+a.toString():a.toString()};return this.options.compatibilityJSON==="v1"?a===1?"":typeof a=="number"?"_plural_".concat(a.toString()):s():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1?s():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}},{key:"shouldUseIntlApi",value:function(){return!b8e.includes(this.options.compatibilityJSON)}}]),e}();function QM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Uo(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{};cs(this,e),this.logger=Va.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(n){return n},this.init(t)}return ds(e,[{key:"init",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n.interpolation||(n.interpolation={escapeValue:!0});var r=n.interpolation;this.escape=r.escape!==void 0?r.escape:u8e,this.escapeValue=r.escapeValue!==void 0?r.escapeValue:!0,this.useRawValueToEscape=r.useRawValueToEscape!==void 0?r.useRawValueToEscape:!1,this.prefix=r.prefix?Ud(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?Ud(r.suffix):r.suffixEscaped||"}}",this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",",this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"",this.nestingPrefix=r.nestingPrefix?Ud(r.nestingPrefix):r.nestingPrefixEscaped||Ud("$t("),this.nestingSuffix=r.nestingSuffix?Ud(r.nestingSuffix):r.nestingSuffixEscaped||Ud(")"),this.nestingOptionsSeparator=r.nestingOptionsSeparator?r.nestingOptionsSeparator:r.nestingOptionsSeparator||",",this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3,this.alwaysFormat=r.alwaysFormat!==void 0?r.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var n="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(n,"g");var r="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(r,"g");var i="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(i,"g")}},{key:"interpolate",value:function(n,r,i,o){var a=this,s,l,u,c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function f(x){return x.replace(/\$/g,"$$$$")}var p=function(C){if(C.indexOf(a.formatSeparator)<0){var w=WM(r,c,C);return a.alwaysFormat?a.format(w,void 0,i,Uo(Uo(Uo({},o),r),{},{interpolationkey:C})):w}var k=C.split(a.formatSeparator),P=k.shift().trim(),L=k.join(a.formatSeparator).trim();return a.format(WM(r,c,P),L,i,Uo(Uo(Uo({},o),r),{},{interpolationkey:P}))};this.resetRegExp();var m=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,g=o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,v=[{regex:this.regexpUnescape,safeValue:function(C){return f(C)}},{regex:this.regexp,safeValue:function(C){return a.escapeValue?f(a.escape(C)):f(C)}}];return v.forEach(function(x){for(u=0;s=x.regex.exec(n);){var C=s[1].trim();if(l=p(C),l===void 0)if(typeof m=="function"){var w=m(n,s,o);l=typeof w=="string"?w:""}else if(o&&o.hasOwnProperty(C))l="";else if(g){l=s[0];continue}else a.logger.warn("missed to pass in variable ".concat(C," for interpolating ").concat(n)),l="";else typeof l!="string"&&!a.useRawValueToEscape&&(l=VM(l));var k=x.safeValue(l);if(n=n.replace(s[0],k),g?(x.regex.lastIndex+=l.length,x.regex.lastIndex-=s[0].length):x.regex.lastIndex=0,u++,u>=a.maxReplaces)break}}),n}},{key:"nest",value:function(n,r){var i=this,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a,s,l;function u(m,g){var v=this.nestingOptionsSeparator;if(m.indexOf(v)<0)return m;var x=m.split(new RegExp("".concat(v,"[ ]*{"))),C="{".concat(x[1]);m=x[0],C=this.interpolate(C,l);var w=C.match(/'/g),k=C.match(/"/g);(w&&w.length%2===0&&!k||k.length%2!==0)&&(C=C.replace(/'/g,'"'));try{l=JSON.parse(C),g&&(l=Uo(Uo({},g),l))}catch(P){return this.logger.warn("failed parsing options string in nesting for key ".concat(m),P),"".concat(m).concat(v).concat(C)}return delete l.defaultValue,m}for(;a=this.nestingRegexp.exec(n);){var c=[];l=Uo({},o),l.applyPostProcessor=!1,delete l.defaultValue;var f=!1;if(a[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(a[1])){var p=a[1].split(this.formatSeparator).map(function(m){return m.trim()});a[1]=p.shift(),c=p,f=!0}if(s=r(u.call(this,a[1].trim(),l),l),s&&a[0]===n&&typeof s!="string")return s;typeof s!="string"&&(s=VM(s)),s||(this.logger.warn("missed to resolve ".concat(a[1]," for nesting ").concat(n)),s=""),f&&(s=c.reduce(function(m,g){return i.format(m,g,o.lng,Uo(Uo({},o),{},{interpolationkey:a[1].trim()}))},s.trim())),n=n.replace(a[0],s),this.regexp.lastIndex=0}return n}}]),e}();function JM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function wl(e){for(var t=1;t-1){var r=e.split("(");t=r[0].toLowerCase().trim();var i=r[1].substring(0,r[1].length-1);if(t==="currency"&&i.indexOf(":")<0)n.currency||(n.currency=i.trim());else if(t==="relativetime"&&i.indexOf(":")<0)n.range||(n.range=i.trim());else{var o=i.split(";");o.forEach(function(a){if(a){var s=a.split(":"),l=r8e(s),u=l[0],c=l.slice(1),f=c.join(":").trim().replace(/^'+|'+$/g,"");n[u.trim()]||(n[u.trim()]=f),f==="false"&&(n[u.trim()]=!1),f==="true"&&(n[u.trim()]=!0),isNaN(f)||(n[u.trim()]=parseInt(f,10))}})}}return{formatName:t,formatOptions:n}}function Wd(e){var t={};return function(r,i,o){var a=i+JSON.stringify(o),s=t[a];return s||(s=e(i,o),t[a]=s),s(r)}}var _8e=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};cs(this,e),this.logger=Va.create("formatter"),this.options=t,this.formats={number:Wd(function(n,r){var i=new Intl.NumberFormat(n,r);return function(o){return i.format(o)}}),currency:Wd(function(n,r){var i=new Intl.NumberFormat(n,wl(wl({},r),{},{style:"currency"}));return function(o){return i.format(o)}}),datetime:Wd(function(n,r){var i=new Intl.DateTimeFormat(n,wl({},r));return function(o){return i.format(o)}}),relativetime:Wd(function(n,r){var i=new Intl.RelativeTimeFormat(n,wl({},r));return function(o){return i.format(o,r.range||"day")}}),list:Wd(function(n,r){var i=new Intl.ListFormat(n,wl({},r));return function(o){return i.format(o)}})},this.init(t)}return ds(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},i=r.interpolation;this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||","}},{key:"add",value:function(n,r){this.formats[n.toLowerCase().trim()]=r}},{key:"addCached",value:function(n,r){this.formats[n.toLowerCase().trim()]=Wd(r)}},{key:"format",value:function(n,r,i,o){var a=this,s=r.split(this.formatSeparator),l=s.reduce(function(u,c){var f=x8e(c),p=f.formatName,m=f.formatOptions;if(a.formats[p]){var g=u;try{var v=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{},x=v.locale||v.lng||o.locale||o.lng||i;g=a.formats[p](u,x,wl(wl(wl({},m),o),v))}catch(C){a.logger.warn(C)}return g}else a.logger.warn("there was no format function for ".concat(p));return u},n);return l}}]),e}();function eI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function tI(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function P8e(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}var T8e=function(e){J3(n,e);var t=k8e(n);function n(r,i,o){var a,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return cs(this,n),a=t.call(this),e4&&du.call(Ql(a)),a.backend=r,a.store=i,a.services=o,a.languageUtils=o.languageUtils,a.options=s,a.logger=Va.create("backendConnector"),a.waitingReads=[],a.maxParallelReads=s.maxParallelReads||10,a.readingCalls=0,a.maxRetries=s.maxRetries>=0?s.maxRetries:5,a.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,a.state={},a.queue=[],a.backend&&a.backend.init&&a.backend.init(o,s.backend,s),a}return ds(n,[{key:"queueLoad",value:function(i,o,a,s){var l=this,u={},c={},f={},p={};return i.forEach(function(m){var g=!0;o.forEach(function(v){var x="".concat(m,"|").concat(v);!a.reload&&l.store.hasResourceBundle(m,v)?l.state[x]=2:l.state[x]<0||(l.state[x]===1?c[x]===void 0&&(c[x]=!0):(l.state[x]=1,g=!1,c[x]===void 0&&(c[x]=!0),u[x]===void 0&&(u[x]=!0),p[v]===void 0&&(p[v]=!0)))}),g||(f[m]=!0)}),(Object.keys(u).length||Object.keys(c).length)&&this.queue.push({pending:c,pendingCount:Object.keys(c).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(u),pending:Object.keys(c),toLoadLanguages:Object.keys(f),toLoadNamespaces:Object.keys(p)}}},{key:"loaded",value:function(i,o,a){var s=i.split("|"),l=s[0],u=s[1];o&&this.emit("failedLoading",l,u,o),a&&this.store.addResourceBundle(l,u,a),this.state[i]=o?-1:2;var c={};this.queue.forEach(function(f){s8e(f.loaded,[l],u),P8e(f,i),o&&f.errors.push(o),f.pendingCount===0&&!f.done&&(Object.keys(f.loaded).forEach(function(p){c[p]||(c[p]={});var m=f.loaded[p];m.length&&m.forEach(function(g){c[p][g]===void 0&&(c[p][g]=!0)})}),f.done=!0,f.errors.length?f.callback(f.errors):f.callback())}),this.emit("loaded",c),this.queue=this.queue.filter(function(f){return!f.done})}},{key:"read",value:function(i,o,a){var s=this,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,c=arguments.length>5?arguments[5]:void 0;if(!i.length)return c(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:i,ns:o,fcName:a,tried:l,wait:u,callback:c});return}this.readingCalls++;var f=function(v,x){if(s.readingCalls--,s.waitingReads.length>0){var C=s.waitingReads.shift();s.read(C.lng,C.ns,C.fcName,C.tried,C.wait,C.callback)}if(v&&x&&l2&&arguments[2]!==void 0?arguments[2]:{},l=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),l&&l();typeof i=="string"&&(i=this.languageUtils.toResolveHierarchy(i)),typeof o=="string"&&(o=[o]);var u=this.queueLoad(i,o,s,l);if(!u.toLoad.length)return u.pending.length||l(),null;u.toLoad.forEach(function(c){a.loadOne(c)})}},{key:"load",value:function(i,o,a){this.prepareLoading(i,o,{},a)}},{key:"reload",value:function(i,o,a){this.prepareLoading(i,o,{reload:!0},a)}},{key:"loadOne",value:function(i){var o=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",s=i.split("|"),l=s[0],u=s[1];this.read(l,u,"read",void 0,void 0,function(c,f){c&&o.logger.warn("".concat(a,"loading namespace ").concat(u," for language ").concat(l," failed"),c),!c&&f&&o.logger.log("".concat(a,"loaded namespace ").concat(u," for language ").concat(l),f),o.loaded(i,c,f)})}},{key:"saveMissing",value:function(i,o,a,s,l){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},c=arguments.length>6&&arguments[6]!==void 0?arguments[6]:function(){};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(o)){this.logger.warn('did not save key "'.concat(a,'" as the namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(a==null||a==="")){if(this.backend&&this.backend.create){var f=tI(tI({},u),{},{isUpdate:l}),p=this.backend.create.bind(this.backend);if(p.length<6)try{var m;p.length===5?m=p(i,o,a,s,f):m=p(i,o,a,s),m&&typeof m.then=="function"?m.then(function(g){return c(null,g)}).catch(c):c(null,m)}catch(g){c(g)}else p(i,o,a,s,c,f)}!i||!i[0]||this.store.addResource(i[0],o,a,s)}}}]),n}(du);function nI(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var n={};if(aa(t[1])==="object"&&(n=t[1]),typeof t[1]=="string"&&(n.defaultValue=t[1]),typeof t[2]=="string"&&(n.tDescription=t[2]),aa(t[2])==="object"||aa(t[3])==="object"){var r=t[3]||t[2];Object.keys(r).forEach(function(i){n[i]=r[i]})}return n},interpolation:{escapeValue:!0,format:function(t,n,r,i){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function rI(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function iI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ta(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function Av(){}function O8e(e){var t=Object.getOwnPropertyNames(Object.getPrototypeOf(e));t.forEach(function(n){typeof e[n]=="function"&&(e[n]=e[n].bind(e))})}var rb=function(e){J3(n,e);var t=L8e(n);function n(){var r,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(cs(this,n),r=t.call(this),e4&&du.call(Ql(r)),r.options=rI(i),r.services={},r.logger=Va,r.modules={external:[]},O8e(Ql(r)),o&&!r.isInitialized&&!i.isClone){if(!r.options.initImmediate)return r.init(i,o),O1(r,Ql(r));setTimeout(function(){r.init(i,o)},0)}return r}return ds(n,[{key:"init",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;typeof o=="function"&&(a=o,o={}),!o.defaultNS&&o.defaultNS!==!1&&o.ns&&(typeof o.ns=="string"?o.defaultNS=o.ns:o.ns.indexOf("translation")<0&&(o.defaultNS=o.ns[0]));var s=nI();this.options=Ta(Ta(Ta({},s),this.options),rI(o)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=Ta(Ta({},s.interpolation),this.options.interpolation)),o.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=o.keySeparator),o.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=o.nsSeparator);function l(C){return C?typeof C=="function"?new C:C:null}if(!this.options.isClone){this.modules.logger?Va.init(l(this.modules.logger),this.options):Va.init(null,this.options);var u;this.modules.formatter?u=this.modules.formatter:typeof Intl<"u"&&(u=_8e);var c=new XM(this.options);this.store=new p8e(this.options.resources,this.options);var f=this.services;f.logger=Va,f.resourceStore=this.store,f.languageUtils=c,f.pluralResolver=new w8e(c,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(f.formatter=l(u),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new C8e(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new T8e(l(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(C){for(var w=arguments.length,k=new Array(w>1?w-1:0),P=1;P1?w-1:0),P=1;P0&&p[0]!=="dev"&&(this.options.lng=p[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var m=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];m.forEach(function(C){i[C]=function(){var w;return(w=i.store)[C].apply(w,arguments)}});var g=["addResource","addResources","addResourceBundle","removeResourceBundle"];g.forEach(function(C){i[C]=function(){var w;return(w=i.store)[C].apply(w,arguments),i}});var v=Kp(),x=function(){var w=function(P,L){i.isInitialized&&!i.initializedStoreOnce&&i.logger.warn("init: i18next is already initialized. You should call init just once!"),i.isInitialized=!0,i.options.isClone||i.logger.log("initialized",i.options),i.emit("initialized",i.options),v.resolve(L),a(P,L)};if(i.languages&&i.options.compatibilityAPI!=="v1"&&!i.isInitialized)return w(null,i.t.bind(i));i.changeLanguage(i.options.lng,w)};return this.options.resources||!this.options.initImmediate?x():setTimeout(x,0),v}},{key:"loadResources",value:function(i){var o=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Av,s=a,l=typeof i=="string"?i:this.language;if(typeof i=="function"&&(s=i),!this.options.resources||this.options.partialBundledLanguages){if(l&&l.toLowerCase()==="cimode")return s();var u=[],c=function(m){if(m){var g=o.services.languageUtils.toResolveHierarchy(m);g.forEach(function(v){u.indexOf(v)<0&&u.push(v)})}};if(l)c(l);else{var f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.forEach(function(p){return c(p)})}this.options.preload&&this.options.preload.forEach(function(p){return c(p)}),this.services.backendConnector.load(u,this.options.ns,function(p){!p&&!o.resolvedLanguage&&o.language&&o.setResolvedLanguage(o.language),s(p)})}else s(null)}},{key:"reloadResources",value:function(i,o,a){var s=Kp();return i||(i=this.languages),o||(o=this.options.ns),a||(a=Av),this.services.backendConnector.reload(i,o,function(l){s.resolve(),a(l)}),s}},{key:"use",value:function(i){if(!i)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!i.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return i.type==="backend"&&(this.modules.backend=i),(i.type==="logger"||i.log&&i.warn&&i.error)&&(this.modules.logger=i),i.type==="languageDetector"&&(this.modules.languageDetector=i),i.type==="i18nFormat"&&(this.modules.i18nFormat=i),i.type==="postProcessor"&&hW.addPostProcessor(i),i.type==="formatter"&&(this.modules.formatter=i),i.type==="3rdParty"&&this.modules.external.push(i),this}},{key:"setResolvedLanguage",value:function(i){if(!(!i||!this.languages)&&!(["cimode","dev"].indexOf(i)>-1))for(var o=0;o-1)&&this.store.hasLanguageSomeTranslations(a)){this.resolvedLanguage=a;break}}}},{key:"changeLanguage",value:function(i,o){var a=this;this.isLanguageChangingTo=i;var s=Kp();this.emit("languageChanging",i);var l=function(p){a.language=p,a.languages=a.services.languageUtils.toResolveHierarchy(p),a.resolvedLanguage=void 0,a.setResolvedLanguage(p)},u=function(p,m){m?(l(m),a.translator.changeLanguage(m),a.isLanguageChangingTo=void 0,a.emit("languageChanged",m),a.logger.log("languageChanged",m)):a.isLanguageChangingTo=void 0,s.resolve(function(){return a.t.apply(a,arguments)}),o&&o(p,function(){return a.t.apply(a,arguments)})},c=function(p){!i&&!p&&a.services.languageDetector&&(p=[]);var m=typeof p=="string"?p:a.services.languageUtils.getBestMatchFromCodes(p);m&&(a.language||l(m),a.translator.language||a.translator.changeLanguage(m),a.services.languageDetector&&a.services.languageDetector.cacheUserLanguage&&a.services.languageDetector.cacheUserLanguage(m)),a.loadResources(m,function(g){u(g,m)})};return!i&&this.services.languageDetector&&!this.services.languageDetector.async?c(this.services.languageDetector.detect()):!i&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(c):this.services.languageDetector.detect(c):c(i),s}},{key:"getFixedT",value:function(i,o,a){var s=this,l=function u(c,f){var p;if(aa(f)!=="object"){for(var m=arguments.length,g=new Array(m>2?m-2:0),v=2;v1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var s=this.resolvedLanguage||this.languages[0],l=this.options?this.options.fallbackLng:!1,u=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;var c=function(m,g){var v=o.services.backendConnector.state["".concat(m,"|").concat(g)];return v===-1||v===2};if(a.precheck){var f=a.precheck(this,c);if(f!==void 0)return f}return!!(this.hasResourceBundle(s,i)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||c(s,i)&&(!l||c(u,i)))}},{key:"loadNamespaces",value:function(i,o){var a=this,s=Kp();return this.options.ns?(typeof i=="string"&&(i=[i]),i.forEach(function(l){a.options.ns.indexOf(l)<0&&a.options.ns.push(l)}),this.loadResources(function(l){s.resolve(),o&&o(l)}),s):(o&&o(),Promise.resolve())}},{key:"loadLanguages",value:function(i,o){var a=Kp();typeof i=="string"&&(i=[i]);var s=this.options.preload||[],l=i.filter(function(u){return s.indexOf(u)<0});return l.length?(this.options.preload=s.concat(l),this.loadResources(function(u){a.resolve(),o&&o(u)}),a):(o&&o(),Promise.resolve())}},{key:"dir",value:function(i){if(i||(i=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!i)return"rtl";var o=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],a=this.services&&this.services.languageUtils||new XM(nI());return o.indexOf(a.getLanguagePartFromCode(i))>-1||i.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Av,s=Ta(Ta(Ta({},this.options),o),{isClone:!0}),l=new n(s);(o.debug!==void 0||o.prefix!==void 0)&&(l.logger=l.logger.clone(o));var u=["store","services","language"];return u.forEach(function(c){l[c]=i[c]}),l.services=Ta({},this.services),l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l.translator=new qM(l.services,l.options),l.translator.on("*",function(c){for(var f=arguments.length,p=new Array(f>1?f-1:0),m=1;m0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new rb(e,t)});var ht=rb.createInstance();ht.createInstance=rb.createInstance;ht.createInstance;ht.dir;ht.init;ht.loadResources;ht.reloadResources;ht.use;ht.changeLanguage;ht.getFixedT;ht.t;ht.exists;ht.setDefaultNamespace;ht.hasLoadedNamespace;ht.loadNamespaces;ht.loadLanguages;function M8e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Vg(e){return Vg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vg(e)}function I8e(e,t){if(Vg(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Vg(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function R8e(e){var t=I8e(e,"string");return Vg(t)==="symbol"?t:String(t)}function oI(e,t){for(var n=0;n0){var s=i.maxAge-0;if(Number.isNaN(s))throw new Error("maxAge should be a Number");a+="; Max-Age=".concat(Math.floor(s))}if(i.domain){if(!aI.test(i.domain))throw new TypeError("option domain is invalid");a+="; Domain=".concat(i.domain)}if(i.path){if(!aI.test(i.path))throw new TypeError("option path is invalid");a+="; Path=".concat(i.path)}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");a+="; Expires=".concat(i.expires.toUTCString())}if(i.httpOnly&&(a+="; HttpOnly"),i.secure&&(a+="; Secure"),i.sameSite){var l=typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite;switch(l){case!0:a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"strict":a+="; SameSite=Strict";break;case"none":a+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return a},sI={create:function(t,n,r,i){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+r*60*1e3)),i&&(o.domain=i),document.cookie=F8e(t,encodeURIComponent(n),o)},read:function(t){for(var n="".concat(t,"="),r=document.cookie.split(";"),i=0;i-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));for(var i=r.substring(1),o=i.split("&"),a=0;a0){var l=o[a].substring(0,s);l===t.lookupQuerystring&&(n=o[a].substring(s+1))}}}return n}},Yp=null,lI=function(){if(Yp!==null)return Yp;try{Yp=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch(n){Yp=!1}return Yp},H8e={name:"localStorage",lookup:function(t){var n;if(t.lookupLocalStorage&&lI()){var r=window.localStorage.getItem(t.lookupLocalStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupLocalStorage&&lI()&&window.localStorage.setItem(n.lookupLocalStorage,t)}},qp=null,uI=function(){if(qp!==null)return qp;try{qp=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch(n){qp=!1}return qp},V8e={name:"sessionStorage",lookup:function(t){var n;if(t.lookupSessionStorage&&uI()){var r=window.sessionStorage.getItem(t.lookupSessionStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupSessionStorage&&uI()&&window.sessionStorage.setItem(n.lookupSessionStorage,t)}},U8e={name:"navigator",lookup:function(t){var n=[];if(typeof navigator<"u"){if(navigator.languages)for(var r=0;r0?n:void 0}},W8e={name:"htmlTag",lookup:function(t){var n,r=t.htmlTag||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},G8e={name:"path",lookup:function(t){var n;if(typeof window<"u"){var r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(r instanceof Array)if(typeof t.lookupFromPathIndex=="number"){if(typeof r[t.lookupFromPathIndex]!="string")return;n=r[t.lookupFromPathIndex].replace("/","")}else n=r[0].replace("/","")}return n}},K8e={name:"subdomain",lookup:function(t){var n=typeof t.lookupFromSubdomainIndex=="number"?t.lookupFromSubdomainIndex+1:1,r=typeof window<"u"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}};function Y8e(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var mW=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};M8e(this,e),this.type="languageDetector",this.detectors={},this.init(t,n)}return $8e(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=B8e(r,this.options||{},Y8e()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(z8e),this.addDetector(j8e),this.addDetector(H8e),this.addDetector(V8e),this.addDetector(U8e),this.addDetector(W8e),this.addDetector(G8e),this.addDetector(K8e)}},{key:"addDetector",value:function(n){this.detectors[n.name]=n}},{key:"detect",value:function(n){var r=this;n||(n=this.options.order);var i=[];return n.forEach(function(o){if(r.detectors[o]){var a=r.detectors[o].lookup(r.options);a&&typeof a=="string"&&(a=[a]),a&&(i=i.concat(a))}}),this.services.languageUtils.getBestMatchFromCodes?i:i.length>0?i[0]:null}},{key:"cacheUserLanguage",value:function(n,r){var i=this;r||(r=this.options.caches),r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(n)>-1||r.forEach(function(o){i.detectors[o]&&i.detectors[o].cacheUserLanguage(n,i.options)}))}}]),e}();mW.type="languageDetector";function Rx(e){return Rx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rx(e)}var gW=[],q8e=gW.forEach,X8e=gW.slice;function $x(e){return q8e.call(X8e.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e}function vW(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":Rx(XMLHttpRequest))==="object"}function Z8e(e){return!!e&&typeof e.then=="function"}function Q8e(e){return Z8e(e)?e:Promise.resolve(e)}function J8e(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Ug={},e_e={get exports(){return Ug},set exports(e){Ug=e}},Ym={},t_e={get exports(){return Ym},set exports(e){Ym=e}},cI;function n_e(){return cI||(cI=1,function(e,t){var n=typeof self<"u"?self:Pi,r=function(){function o(){this.fetch=!1,this.DOMException=n.DOMException}return o.prototype=n,new o}();(function(o){(function(a){var s={searchParams:"URLSearchParams"in o,iterable:"Symbol"in o&&"iterator"in Symbol,blob:"FileReader"in o&&"Blob"in o&&function(){try{return new Blob,!0}catch(R){return!1}}(),formData:"FormData"in o,arrayBuffer:"ArrayBuffer"in o};function l(R){return R&&DataView.prototype.isPrototypeOf(R)}if(s.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(R){return R&&u.indexOf(Object.prototype.toString.call(R))>-1};function f(R){if(typeof R!="string"&&(R=String(R)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(R))throw new TypeError("Invalid character in header field name");return R.toLowerCase()}function p(R){return typeof R!="string"&&(R=String(R)),R}function m(R){var N={next:function(){var U=R.shift();return{done:U===void 0,value:U}}};return s.iterable&&(N[Symbol.iterator]=function(){return N}),N}function g(R){this.map={},R instanceof g?R.forEach(function(N,U){this.append(U,N)},this):Array.isArray(R)?R.forEach(function(N){this.append(N[0],N[1])},this):R&&Object.getOwnPropertyNames(R).forEach(function(N){this.append(N,R[N])},this)}g.prototype.append=function(R,N){R=f(R),N=p(N);var U=this.map[R];this.map[R]=U?U+", "+N:N},g.prototype.delete=function(R){delete this.map[f(R)]},g.prototype.get=function(R){return R=f(R),this.has(R)?this.map[R]:null},g.prototype.has=function(R){return this.map.hasOwnProperty(f(R))},g.prototype.set=function(R,N){this.map[f(R)]=p(N)},g.prototype.forEach=function(R,N){for(var U in this.map)this.map.hasOwnProperty(U)&&R.call(N,this.map[U],U,this)},g.prototype.keys=function(){var R=[];return this.forEach(function(N,U){R.push(U)}),m(R)},g.prototype.values=function(){var R=[];return this.forEach(function(N){R.push(N)}),m(R)},g.prototype.entries=function(){var R=[];return this.forEach(function(N,U){R.push([U,N])}),m(R)},s.iterable&&(g.prototype[Symbol.iterator]=g.prototype.entries);function v(R){if(R.bodyUsed)return Promise.reject(new TypeError("Already read"));R.bodyUsed=!0}function x(R){return new Promise(function(N,U){R.onload=function(){N(R.result)},R.onerror=function(){U(R.error)}})}function C(R){var N=new FileReader,U=x(N);return N.readAsArrayBuffer(R),U}function w(R){var N=new FileReader,U=x(N);return N.readAsText(R),U}function k(R){for(var N=new Uint8Array(R),U=new Array(N.length),G=0;G-1?N:R}function I(R,N){N=N||{};var U=N.body;if(R instanceof I){if(R.bodyUsed)throw new TypeError("Already read");this.url=R.url,this.credentials=R.credentials,N.headers||(this.headers=new g(R.headers)),this.method=R.method,this.mode=R.mode,this.signal=R.signal,!U&&R._bodyInit!=null&&(U=R._bodyInit,R.bodyUsed=!0)}else this.url=String(R);if(this.credentials=N.credentials||this.credentials||"same-origin",(N.headers||!this.headers)&&(this.headers=new g(N.headers)),this.method=O(N.method||this.method||"GET"),this.mode=N.mode||this.mode||null,this.signal=N.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&U)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(U)}I.prototype.clone=function(){return new I(this,{body:this._bodyInit})};function $(R){var N=new FormData;return R.trim().split("&").forEach(function(U){if(U){var G=U.split("="),B=G.shift().replace(/\+/g," "),W=G.join("=").replace(/\+/g," ");N.append(decodeURIComponent(B),decodeURIComponent(W))}}),N}function D(R){var N=new g,U=R.replace(/\r?\n[\t ]+/g," ");return U.split(/\r?\n/).forEach(function(G){var B=G.split(":"),W=B.shift().trim();if(W){var X=B.join(":").trim();N.append(W,X)}}),N}L.call(I.prototype);function V(R,N){N||(N={}),this.type="default",this.status=N.status===void 0?200:N.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in N?N.statusText:"OK",this.headers=new g(N.headers),this.url=N.url||"",this._initBody(R)}L.call(V.prototype),V.prototype.clone=function(){return new V(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new g(this.headers),url:this.url})},V.error=function(){var R=new V(null,{status:0,statusText:""});return R.type="error",R};var Y=[301,302,303,307,308];V.redirect=function(R,N){if(Y.indexOf(N)===-1)throw new RangeError("Invalid status code");return new V(null,{status:N,headers:{location:R}})},a.DOMException=o.DOMException;try{new a.DOMException}catch(R){a.DOMException=function(N,U){this.message=N,this.name=U;var G=Error(N);this.stack=G.stack},a.DOMException.prototype=Object.create(Error.prototype),a.DOMException.prototype.constructor=a.DOMException}function z(R,N){return new Promise(function(U,G){var B=new I(R,N);if(B.signal&&B.signal.aborted)return G(new a.DOMException("Aborted","AbortError"));var W=new XMLHttpRequest;function X(){W.abort()}W.onload=function(){var re={status:W.status,statusText:W.statusText,headers:D(W.getAllResponseHeaders()||"")};re.url="responseURL"in W?W.responseURL:re.headers.get("X-Request-URL");var le="response"in W?W.response:W.responseText;U(new V(le,re))},W.onerror=function(){G(new TypeError("Network request failed"))},W.ontimeout=function(){G(new TypeError("Network request failed"))},W.onabort=function(){G(new a.DOMException("Aborted","AbortError"))},W.open(B.method,B.url,!0),B.credentials==="include"?W.withCredentials=!0:B.credentials==="omit"&&(W.withCredentials=!1),"responseType"in W&&s.blob&&(W.responseType="blob"),B.headers.forEach(function(re,le){W.setRequestHeader(le,re)}),B.signal&&(B.signal.addEventListener("abort",X),W.onreadystatechange=function(){W.readyState===4&&B.signal.removeEventListener("abort",X)}),W.send(typeof B._bodyInit>"u"?null:B._bodyInit)})}return z.polyfill=!0,o.fetch||(o.fetch=z,o.Headers=g,o.Request=I,o.Response=V),a.Headers=g,a.Request=I,a.Response=V,a.fetch=z,Object.defineProperty(a,"__esModule",{value:!0}),a})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=r;t=i.fetch,t.default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t}(t_e,Ym)),Ym}(function(e,t){var n;if(typeof fetch=="function"&&(typeof Pi<"u"&&Pi.fetch?n=Pi.fetch:typeof window<"u"&&window.fetch?n=window.fetch:n=fetch),typeof J8e<"u"&&(typeof window>"u"||typeof window.document>"u")){var r=n||n_e();r.default&&(r=r.default),t.default=r,e.exports=t.default}})(e_e,Ug);const yW=Ug,dI=CD({__proto__:null,default:yW},[Ug]);function ib(e){return ib=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ib(e)}var Is;typeof fetch=="function"&&(typeof global<"u"&&global.fetch?Is=global.fetch:typeof window<"u"&&window.fetch?Is=window.fetch:Is=fetch);var Wg;vW()&&(typeof global<"u"&&global.XMLHttpRequest?Wg=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(Wg=window.XMLHttpRequest));var ob;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?ob=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(ob=window.ActiveXObject));!Is&&dI&&!Wg&&!ob&&(Is=yW||dI);typeof Is!="function"&&(Is=void 0);var Dx=function(t,n){if(n&&ib(n)==="object"){var r="";for(var i in n)r+="&"+encodeURIComponent(i)+"="+encodeURIComponent(n[i]);if(!r)return t;t=t+(t.indexOf("?")!==-1?"&":"?")+r.slice(1)}return t},fI=function(t,n,r){Is(t,n).then(function(i){if(!i.ok)return r(i.statusText||"Error",{status:i.status});i.text().then(function(o){r(null,{status:i.status,data:o})}).catch(r)}).catch(r)},hI=!1,r_e=function(t,n,r,i){t.queryStringParams&&(n=Dx(n,t.queryStringParams));var o=$x({},typeof t.customHeaders=="function"?t.customHeaders():t.customHeaders);r&&(o["Content-Type"]="application/json");var a=typeof t.requestOptions=="function"?t.requestOptions(r):t.requestOptions,s=$x({method:r?"POST":"GET",body:r?t.stringify(r):void 0,headers:o},hI?{}:a);try{fI(n,s,i)}catch(l){if(!a||Object.keys(a).length===0||!l.message||l.message.indexOf("not implemented")<0)return i(l);try{Object.keys(a).forEach(function(u){delete s[u]}),fI(n,s,i),hI=!0}catch(u){i(u)}}},i_e=function(t,n,r,i){r&&ib(r)==="object"&&(r=Dx("",r).slice(1)),t.queryStringParams&&(n=Dx(n,t.queryStringParams));try{var o;Wg?o=new Wg:o=new ob("MSXML2.XMLHTTP.3.0"),o.open(r?"POST":"GET",n,1),t.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!t.withCredentials,r&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var a=t.customHeaders;if(a=typeof a=="function"?a():a,a)for(var s in a)o.setRequestHeader(s,a[s]);o.onreadystatechange=function(){o.readyState>3&&i(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(r)}catch(l){console&&console.log(l)}},o_e=function(t,n,r,i){if(typeof r=="function"&&(i=r,r=void 0),i=i||function(){},Is&&n.indexOf("file:")!==0)return r_e(t,n,r,i);if(vW()||typeof ActiveXObject=="function")return i_e(t,n,r,i);i(new Error("No fetch and no xhr implementation found!"))};function Gg(e){return Gg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gg(e)}function a_e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pI(e,t){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};a_e(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}return s_e(e,[{key:"init",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=$x(i,this.options||{},c_e()),this.allOptions=o,this.services&&this.options.reloadInterval&&setInterval(function(){return r.reload()},this.options.reloadInterval)}},{key:"readMulti",value:function(n,r,i){this._readAny(n,n,r,r,i)}},{key:"read",value:function(n,r,i){this._readAny([n],n,[r],r,i)}},{key:"_readAny",value:function(n,r,i,o,a){var s=this,l=this.options.loadPath;typeof this.options.loadPath=="function"&&(l=this.options.loadPath(n,i)),l=Q8e(l),l.then(function(u){if(!u)return a(null,{});var c=s.services.interpolator.interpolate(u,{lng:n.join("+"),ns:i.join("+")});s.loadUrl(c,a,r,o)})}},{key:"loadUrl",value:function(n,r,i,o){var a=this;this.options.request(this.options,n,void 0,function(s,l){if(l&&(l.status>=500&&l.status<600||!l.status))return r("failed loading "+n+"; status code: "+l.status,!0);if(l&&l.status>=400&&l.status<500)return r("failed loading "+n+"; status code: "+l.status,!1);if(!l&&s&&s.message&&s.message.indexOf("Failed to fetch")>-1)return r("failed loading "+n+": "+s.message,!0);if(s)return r(s,!1);var u,c;try{typeof l.data=="string"?u=a.options.parse(l.data,i,o):u=l.data}catch(f){c="failed parsing "+n+" to json"}if(c)return r(c,!1);r(null,u)})}},{key:"create",value:function(n,r,i,o,a){var s=this;if(this.options.addPath){typeof n=="string"&&(n=[n]);var l=this.options.parsePayload(r,i,o),u=0,c=[],f=[];n.forEach(function(p){var m=s.options.addPath;typeof s.options.addPath=="function"&&(m=s.options.addPath(p,r));var g=s.services.interpolator.interpolate(m,{lng:p,ns:r});s.options.request(s.options,g,l,function(v,x){u+=1,c.push(v),f.push(x),u===n.length&&a&&a(c,f)})})}}},{key:"reload",value:function(){var n=this,r=this.services,i=r.backendConnector,o=r.languageUtils,a=r.logger,s=i.language;if(!(s&&s.toLowerCase()==="cimode")){var l=[],u=function(f){var p=o.toResolveHierarchy(f);p.forEach(function(m){l.indexOf(m)<0&&l.push(m)})};u(s),this.allOptions.preload&&this.allOptions.preload.forEach(function(c){return u(c)}),l.forEach(function(c){n.allOptions.ns.forEach(function(f){i.read(c,f,"read",null,null,function(p,m){p&&a.warn("loading namespace ".concat(f," for language ").concat(c," failed"),p),!p&&m&&a.log("loaded namespace ".concat(f," for language ").concat(c),m),i.loaded("".concat(c,"|").concat(f),p,m)})})})}}}]),e}();SW.type="backend";function Kg(e){return Kg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kg(e)}function d_e(e,t){if(Kg(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Kg(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function wW(e){var t=d_e(e,"string");return Kg(t)==="symbol"?t:String(t)}function CW(e,t,n){return t=wW(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f_e(){if(console&&console.warn){for(var e,t=arguments.length,n=new Array(t),r=0;r2&&arguments[2]!==void 0?arguments[2]:{},r=t.languages[0],i=t.options?t.options.fallbackLng:!1,o=t.languages[t.languages.length-1];if(r.toLowerCase()==="cimode")return!0;var a=function(l,u){var c=t.services.backendConnector.state["".concat(l,"|").concat(u)];return c===-1||c===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!a(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(r,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||a(r,e)&&(!i||a(o,e)))}function p_e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!t.languages||!t.languages.length)return Nx("i18n.languages were undefined or empty",t.languages),!0;var r=t.options.ignoreJSONStructure!==void 0;return r?t.hasLoadedNamespace(e,{precheck:function(o,a){if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&o.services.backendConnector.backend&&o.isLanguageChangingTo&&!a(o.isLanguageChangingTo,e))return!1}}):h_e(e,t,n)}var m_e=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,g_e={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},v_e=function(t){return g_e[t]},y_e=function(t){return t.replace(m_e,v_e)};function vI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function yI(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{};Bx=yI(yI({},Bx),e)}function S_e(){return Bx}var xW;function w_e(e){xW=e}function C_e(){return xW}function x_e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bI(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:{},n=t.i18n,r=S.useContext(E_e)||{},i=r.i18n,o=r.defaultNS,a=n||i||C_e();if(a&&!a.reportNamespaces&&(a.reportNamespaces=new P_e),!a){Nx("You will need to pass in an i18next instance by using initReactI18next");var s=function($){return Array.isArray($)?$[$.length-1]:$},l=[s,{},!1];return l.t=s,l.i18n={},l.ready=!1,l}a.options.react&&a.options.react.wait!==void 0&&Nx("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var u=$w($w($w({},S_e()),a.options.react),t),c=u.useSuspense,f=u.keyPrefix,p=e||o||a.options&&a.options.defaultNS;p=typeof p=="string"?[p]:p||["translation"],a.reportNamespaces.addUsedNamespaces&&a.reportNamespaces.addUsedNamespaces(p);var m=(a.isInitialized||a.initializedStoreOnce)&&p.every(function(I){return p_e(I,a,u)});function g(){return a.getFixedT(null,u.nsMode==="fallback"?p:p[0],f)}var v=S.useState(g),x=M_e(v,2),C=x[0],w=x[1],k=p.join(),P=I_e(k),L=S.useRef(!0);S.useEffect(function(){var I=u.bindI18n,$=u.bindI18nStore;L.current=!0,!m&&!c&&gI(a,p,function(){L.current&&w(g)}),m&&P&&P!==k&&L.current&&w(g);function D(){L.current&&w(g)}return I&&a&&a.on(I,D),$&&a&&a.store.on($,D),function(){L.current=!1,I&&a&&I.split(" ").forEach(function(V){return a.off(V,D)}),$&&a&&$.split(" ").forEach(function(V){return a.store.off(V,D)})}},[a,k]);var A=S.useRef(!0);S.useEffect(function(){L.current&&!A.current&&w(g),A.current=!1},[a,f]);var O=[C,a,m];if(O.t=C,O.i18n=a,O.ready=m,m||!m&&!c)return O;throw new Promise(function(I){gI(a,p,function(){I()})})}ht.use(SW).use(mW).use(k_e).init({fallbackLng:"en",debug:!1,ns:["common","gallery","hotkeys","parameters","settings","modelmanager","toast","tooltip","unifiedcanvas"],backend:{loadPath:"/locales/{{ns}}/{{lng}}.json"},interpolation:{escapeValue:!1},returnNull:!1});const R_e={isConnected:!1,isProcessing:!1,log:[],shouldShowLogViewer:!1,shouldDisplayInProgressType:"latents",shouldDisplayGuides:!0,isGFPGANAvailable:!0,isESRGANAvailable:!0,socketId:"",shouldConfirmOnDelete:!0,openAccordions:[],currentStep:0,totalSteps:0,currentIteration:0,totalIterations:0,currentStatus:ht.isInitialized?ht.t("common:statusDisconnected"):"Disconnected",currentStatusHasSteps:!1,model:"",model_id:"",model_hash:"",app_id:"",app_version:"",model_list:{},infill_methods:[],hasError:!1,wasErrorSeen:!0,isCancelable:!0,saveIntermediatesInterval:5,enableImageDebugging:!1,toastQueue:[],searchFolder:null,foundModels:null,openModel:null},_W=Qc({name:"system",initialState:R_e,reducers:{setShouldDisplayInProgressType:(e,t)=>{e.shouldDisplayInProgressType=t.payload},setIsProcessing:(e,t)=>{e.isProcessing=t.payload},setCurrentStatus:(e,t)=>{e.currentStatus=t.payload},setSystemStatus:(e,t)=>({...e,...t.payload}),errorOccurred:e=>{e.hasError=!0,e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus=ht.t("common:statusError"),e.wasErrorSeen=!1},errorSeen:e=>{e.hasError=!1,e.wasErrorSeen=!0,e.currentStatus=e.isConnected?ht.t("common:statusConnected"):ht.t("common:statusDisconnected")},addLogEntry:(e,t)=>{const{timestamp:n,message:r,level:i}=t.payload,a={timestamp:n,message:r,level:i||"info"};e.log.push(a)},setShouldShowLogViewer:(e,t)=>{e.shouldShowLogViewer=t.payload},setIsConnected:(e,t)=>{e.isConnected=t.payload,e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.hasError=!1},setSocketId:(e,t)=>{e.socketId=t.payload},setShouldConfirmOnDelete:(e,t)=>{e.shouldConfirmOnDelete=t.payload},setOpenAccordions:(e,t)=>{e.openAccordions=t.payload},setSystemConfig:(e,t)=>({...e,...t.payload}),setShouldDisplayGuides:(e,t)=>{e.shouldDisplayGuides=t.payload},processingCanceled:e=>{e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus=ht.t("common:statusProcessingCanceled")},generationRequested:e=>{e.isProcessing=!0,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus=ht.t("common:statusPreparing")},setModelList:(e,t)=>{e.model_list=t.payload},setIsCancelable:(e,t)=>{e.isCancelable=t.payload},modelChangeRequested:e=>{e.currentStatus=ht.t("common:statusLoadingModel"),e.isCancelable=!1,e.isProcessing=!0,e.currentStatusHasSteps=!1},setSaveIntermediatesInterval:(e,t)=>{e.saveIntermediatesInterval=t.payload},setEnableImageDebugging:(e,t)=>{e.enableImageDebugging=t.payload},addToast:(e,t)=>{e.toastQueue.push(t.payload)},clearToastQueue:e=>{e.toastQueue=[]},setProcessingIndeterminateTask:(e,t)=>{e.isProcessing=!0,e.currentStatus=t.payload,e.currentStatusHasSteps=!1},setSearchFolder:(e,t)=>{e.searchFolder=t.payload},setFoundModels:(e,t)=>{e.foundModels=t.payload},setOpenModel:(e,t)=>{e.openModel=t.payload}}}),{setShouldDisplayInProgressType:$_e,setIsProcessing:Qo,addLogEntry:qr,setShouldShowLogViewer:Dw,setIsConnected:CI,setSocketId:uZe,setShouldConfirmOnDelete:kW,setOpenAccordions:D_e,setSystemStatus:N_e,setCurrentStatus:z2,setSystemConfig:B_e,setShouldDisplayGuides:F_e,processingCanceled:z_e,errorOccurred:xI,errorSeen:EW,setModelList:Ov,setIsCancelable:Cf,modelChangeRequested:j_e,setSaveIntermediatesInterval:H_e,setEnableImageDebugging:V_e,generationRequested:U_e,addToast:gc,clearToastQueue:W_e,setProcessingIndeterminateTask:G_e,setSearchFolder:PW,setFoundModels:TW,setOpenModel:_I}=_W.actions,K_e=_W.reducer,H_=["txt2img","img2img","unifiedCanvas","nodes","postprocess","training"],Y_e={activeTab:0,currentTheme:"dark",parametersPanelScrollPosition:0,shouldHoldParametersPanelOpen:!1,shouldPinParametersPanel:!0,shouldShowParametersPanel:!0,shouldShowDualDisplay:!0,shouldShowImageDetails:!1,shouldUseCanvasBetaLayout:!1,shouldShowExistingModelsInSearch:!1,addNewModelUIOption:null},q_e=Y_e,LW=Qc({name:"ui",initialState:q_e,reducers:{setActiveTab:(e,t)=>{typeof t.payload=="number"?e.activeTab=t.payload:e.activeTab=H_.indexOf(t.payload)},setCurrentTheme:(e,t)=>{e.currentTheme=t.payload},setParametersPanelScrollPosition:(e,t)=>{e.parametersPanelScrollPosition=t.payload},setShouldPinParametersPanel:(e,t)=>{e.shouldPinParametersPanel=t.payload},setShouldShowParametersPanel:(e,t)=>{e.shouldShowParametersPanel=t.payload},setShouldHoldParametersPanelOpen:(e,t)=>{e.shouldHoldParametersPanelOpen=t.payload},setShouldShowDualDisplay:(e,t)=>{e.shouldShowDualDisplay=t.payload},setShouldShowImageDetails:(e,t)=>{e.shouldShowImageDetails=t.payload},setShouldUseCanvasBetaLayout:(e,t)=>{e.shouldUseCanvasBetaLayout=t.payload},setShouldShowExistingModelsInSearch:(e,t)=>{e.shouldShowExistingModelsInSearch=t.payload},setAddNewModelUIOption:(e,t)=>{e.addNewModelUIOption=t.payload}}}),{setActiveTab:_i,setCurrentTheme:X_e,setParametersPanelScrollPosition:Z_e,setShouldHoldParametersPanelOpen:Q_e,setShouldPinParametersPanel:J_e,setShouldShowParametersPanel:Rs,setShouldShowDualDisplay:eke,setShouldShowImageDetails:AW,setShouldUseCanvasBetaLayout:tke,setShouldShowExistingModelsInSearch:nke,setAddNewModelUIOption:Lc}=LW.actions,rke=LW.reducer,is=Object.create(null);is.open="0";is.close="1";is.ping="2";is.pong="3";is.message="4";is.upgrade="5";is.noop="6";const j2=Object.create(null);Object.keys(is).forEach(e=>{j2[is[e]]=e});const ike={type:"error",data:"parser error"},oke=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",ake=typeof ArrayBuffer=="function",ske=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,OW=({type:e,data:t},n,r)=>oke&&t instanceof Blob?n?r(t):kI(t,r):ake&&(t instanceof ArrayBuffer||ske(t))?n?r(t):kI(new Blob([t]),r):r(is[e]+(t||"")),kI=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+r)},n.readAsDataURL(e)},EI="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",gm=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e{let t=e.length*.75,n=e.length,r,i=0,o,a,s,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),c=new Uint8Array(u);for(r=0;r>4,c[i++]=(a&15)<<4|s>>2,c[i++]=(s&3)<<6|l&63;return u},uke=typeof ArrayBuffer=="function",MW=(e,t)=>{if(typeof e!="string")return{type:"message",data:IW(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:cke(e.substring(1),t)}:j2[n]?e.length>1?{type:j2[n],data:e.substring(1)}:{type:j2[n]}:ike},cke=(e,t)=>{if(uke){const n=lke(e);return IW(n,t)}else return{base64:!0,data:e}},IW=(e,t)=>{switch(t){case"blob":return e instanceof ArrayBuffer?new Blob([e]):e;case"arraybuffer":default:return e}},RW=String.fromCharCode(30),dke=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,a)=>{OW(o,!1,s=>{r[a]=s,++i===n&&t(r.join(RW))})})},fke=(e,t)=>{const n=e.split(RW),r=[];for(let i=0;itypeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function DW(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const pke=setTimeout,mke=clearTimeout;function t4(e,t){t.useNativeTimers?(e.setTimeoutFn=pke.bind(zl),e.clearTimeoutFn=mke.bind(zl)):(e.setTimeoutFn=setTimeout.bind(zl),e.clearTimeoutFn=clearTimeout.bind(zl))}const gke=1.33;function vke(e){return typeof e=="string"?yke(e):Math.ceil((e.byteLength||e.size)*gke)}function yke(e){let t=0,n=0;for(let r=0,i=e.length;r=57344?n+=3:(r++,n+=4);return n}class bke extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class NW extends sr{constructor(t){super(),this.writable=!1,t4(this,t),this.opts=t,this.query=t.query,this.readyState="",this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new bke(t,n,r)),this}open(){return(this.readyState==="closed"||this.readyState==="")&&(this.readyState="opening",this.doOpen()),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=MW(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}}const BW="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Fx=64,Ske={};let PI=0,Mv=0,TI;function LI(e){let t="";do t=BW[e%Fx]+t,e=Math.floor(e/Fx);while(e>0);return t}function FW(){const e=LI(+new Date);return e!==TI?(PI=0,TI=e):e+"."+LI(PI++)}for(;Mv{this.readyState="paused",t()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};fke(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,dke(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let t=this.query||{};const n=this.opts.secure?"https":"http";let r="";this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=FW()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.opts.port&&(n==="https"&&Number(this.opts.port)!==443||n==="http"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port);const i=zW(t),o=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(o?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(i.length?"?"+i:"")}request(t={}){return Object.assign(t,{xd:this.xd,xs:this.xs},this.opts),new Qa(this.uri(),t)}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class Qa extends sr{constructor(t,n){super(),t4(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.async=n.async!==!1,this.data=n.data!==void 0?n.data:null,this.create()}create(){const t=DW(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd,t.xscheme=!!this.opts.xs;const n=this.xhr=new HW(t);try{n.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let r in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(r)&&n.setRequestHeader(r,this.opts.extraHeaders[r])}}catch(r){}if(this.method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(r){}try{n.setRequestHeader("Accept","*/*")}catch(r){}"withCredentials"in n&&(n.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(n.timeout=this.opts.requestTimeout),n.onreadystatechange=()=>{n.readyState===4&&(n.status===200||n.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof n.status=="number"?n.status:0)},0))},n.send(this.data)}catch(r){this.setTimeoutFn(()=>{this.onError(r)},0);return}typeof document<"u"&&(this.index=Qa.requestsCount++,Qa.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=xke,t)try{this.xhr.abort()}catch(n){}typeof document<"u"&&delete Qa.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}Qa.requestsCount=0;Qa.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",AI);else if(typeof addEventListener=="function"){const e="onpagehide"in zl?"pagehide":"unload";addEventListener(e,AI,!1)}}function AI(){for(let e in Qa.requests)Qa.requests.hasOwnProperty(e)&&Qa.requests[e].abort()}const VW=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),Iv=zl.WebSocket||zl.MozWebSocket,OI=!0,Eke="arraybuffer",MI=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Pke extends NW{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),n=this.opts.protocols,r=MI?{}:DW(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=OI&&!MI?n?new Iv(t,n):new Iv(t):new Iv(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType||Eke,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n{const a={};try{OI&&this.ws.send(o)}catch(s){}i&&VW(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){let t=this.query||{};const n=this.opts.secure?"wss":"ws";let r="";this.opts.port&&(n==="wss"&&Number(this.opts.port)!==443||n==="ws"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port),this.opts.timestampRequests&&(t[this.opts.timestampParam]=FW()),this.supportsBinary||(t.b64=1);const i=zW(t),o=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(o?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(i.length?"?"+i:"")}check(){return!!Iv}}const Tke={websocket:Pke,polling:kke},Lke=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Ake=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function zx(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=Lke.exec(e||""),o={},a=14;for(;a--;)o[Ake[a]]=i[a]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=Oke(o,o.path),o.queryKey=Mke(o,o.query),o}function Oke(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function Mke(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}let UW=class Qd extends sr{constructor(t,n={}){super(),t&&typeof t=="object"&&(n=t,t=null),t?(t=zx(t),n.hostname=t.host,n.secure=t.protocol==="https"||t.protocol==="wss",n.port=t.port,t.query&&(n.query=t.query)):n.host&&(n.hostname=zx(n.host).host),t4(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},n),this.opts.path=this.opts.path.replace(/\/$/,"")+"/",typeof this.opts.query=="string"&&(this.opts.query=wke(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=$W,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts.transportOptions[t],this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new Tke[t](r)}open(){let t;if(this.opts.rememberUpgrade&&Qd.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch(n){this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(t){let n=this.createTransport(t),r=!1;Qd.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",f=>{if(!r)if(f.type==="pong"&&f.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Qd.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(c(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const p=new Error("probe error");p.transport=n.name,this.emitReserved("upgradeError",p)}}))};function o(){r||(r=!0,c(),n.close(),n=null)}const a=f=>{const p=new Error("probe error: "+f);p.transport=n.name,o(),this.emitReserved("upgradeError",p)};function s(){a("transport closed")}function l(){a("socket closed")}function u(f){n&&f.name!==n.name&&o()}const c=()=>{n.removeListener("open",i),n.removeListener("error",a),n.removeListener("close",s),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",a),n.once("close",s),this.once("close",l),this.once("upgrading",u),n.open()}onOpen(){if(this.readyState="open",Qd.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade&&this.transport.pause){let t=0;const n=this.upgrades.length;for(;t{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.getWritablePackets();this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r0&&n>this.maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}write(t,n,r){return this.sendPacket("message",t,n,r),this}send(t,n,r){return this.sendPacket("message",t,n,r),this}sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}onError(t){Qd.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const n=[];let r=0;const i=t.length;for(;rtypeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,WW=Object.prototype.toString,Dke=typeof Blob=="function"||typeof Blob<"u"&&WW.call(Blob)==="[object BlobConstructor]",Nke=typeof File=="function"||typeof File<"u"&&WW.call(File)==="[object FileConstructor]";function V_(e){return Rke&&(e instanceof ArrayBuffer||$ke(e))||Dke&&e instanceof Blob||Nke&&e instanceof File}function H2(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n=0&&e.num0;case Pt.ACK:case Pt.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}class Hke{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=Fke(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Vke=Object.freeze(Object.defineProperty({__proto__:null,Decoder:U_,Encoder:jke,get PacketType(){return Pt},protocol:zke},Symbol.toStringTag,{value:"Module"}));function Yo(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const Uke=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class GW extends sr{constructor(t,n,r){super(),this.connected=!1,this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Yo(t,"open",this.onopen.bind(this)),Yo(t,"packet",this.onpacket.bind(this)),Yo(t,"error",this.onerror.bind(this)),Yo(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){if(Uke.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');n.unshift(t);const r={type:Pt.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const a=this.ids++,s=n.pop();this._registerAckCallback(a,s),r.id=a}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)||(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(t,n){const r=this.flags.timeout;if(r===void 0){this.acks[t]=n;return}const i=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let o=0;o{this.io.clearTimeoutFn(i),n.apply(this,[null,...o])}}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this.packet({type:Pt.CONNECT,data:t})}):this.packet({type:Pt.CONNECT,data:this.auth})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Pt.CONNECT:if(t.data&&t.data.sid){const i=t.data.sid;this.onconnect(i)}else this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Pt.EVENT:case Pt.BINARY_EVENT:this.onevent(t);break;case Pt.ACK:case Pt.BINARY_ACK:this.onack(t);break;case Pt.DISCONNECT:this.ondisconnect();break;case Pt.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t)}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:Pt.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(n.apply(this,t.data),delete this.acks[t.id])}onconnect(t){this.id=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Pt.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r0&&e.jitter<=1?e.jitter:0,this.attempts=0}Yh.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};Yh.prototype.reset=function(){this.attempts=0};Yh.prototype.setMin=function(e){this.ms=e};Yh.prototype.setMax=function(e){this.max=e};Yh.prototype.setJitter=function(e){this.jitter=e};class Vx extends sr{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,t4(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Yh({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||Vke;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new UW(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=Yo(n,"open",function(){r.onopen(),t&&t()}),o=Yo(n,"error",a=>{r.cleanup(),r._readyState="closed",this.emitReserved("error",a),t?t(a):r.maybeReconnectOnOpen()});if(this._timeout!==!1){const a=this._timeout;a===0&&i();const s=this.setTimeoutFn(()=>{i(),n.close(),n.emit("error",new Error("timeout"))},a);this.opts.autoUnref&&s.unref(),this.subs.push(function(){clearTimeout(s)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Yo(t,"ping",this.onping.bind(this)),Yo(t,"data",this.ondata.bind(this)),Yo(t,"error",this.onerror.bind(this)),Yo(t,"close",this.onclose.bind(this)),Yo(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){VW(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r||(r=new GW(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;rt()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(function(){clearTimeout(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Xp={};function V2(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=Ike(e,t.path||"/socket.io"),r=n.source,i=n.id,o=n.path,a=Xp[i]&&o in Xp[i].nsps,s=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let l;return s?l=new Vx(r,t):(Xp[i]||(Xp[i]=new Vx(r,t)),l=Xp[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(V2,{Manager:Vx,Socket:GW,io:V2,connect:V2});const Wke=["ddim","plms","k_lms","k_dpm_2","k_dpm_2_a","k_dpmpp_2","k_dpmpp_2_a","k_euler","k_euler_a","k_heun"],Gke=["ddim","plms","k_lms","dpmpp_2","k_dpm_2","k_dpm_2_a","k_dpmpp_2","k_euler","k_euler_a","k_heun"],Kke=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024,1088,1152,1216,1280,1344,1408,1472,1536,1600,1664,1728,1792,1856,1920,1984,2048],Yke=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024,1088,1152,1216,1280,1344,1408,1472,1536,1600,1664,1728,1792,1856,1920,1984,2048],qke=[{key:"2x",value:2},{key:"4x",value:4}],W_=0,G_=4294967295,Xke=["gfpgan","codeformer"],Zke=[{key:"None",value:"none"},{key:"Fast",value:"latents"},{key:"Accurate",value:"full-res"}];var Qke=Math.PI/180;function Jke(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}const Jf=typeof global<"u"?global:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},Ve={_global:Jf,version:"8.3.14",isBrowser:Jke(),isUnminified:/param/.test(function(e){}.toString()),dblClickWindow:400,getAngle(e){return Ve.angleDeg?e*Qke:e},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return Ve.DD.isDragging},isDragReady(){return!!Ve.DD.node},releaseCanvasOnDestroy:!0,document:Jf.document,_injectGlobal(e){Jf.Konva=e}},Vn=e=>{Ve[e.prototype.getClassName()]=e};Ve._injectGlobal(Ve);class Hi{constructor(t=[1,0,0,1,0,0]){this.dirty=!1,this.m=t&&t.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new Hi(this.m)}copyInto(t){t.m[0]=this.m[0],t.m[1]=this.m[1],t.m[2]=this.m[2],t.m[3]=this.m[3],t.m[4]=this.m[4],t.m[5]=this.m[5]}point(t){var n=this.m;return{x:n[0]*t.x+n[2]*t.y+n[4],y:n[1]*t.x+n[3]*t.y+n[5]}}translate(t,n){return this.m[4]+=this.m[0]*t+this.m[2]*n,this.m[5]+=this.m[1]*t+this.m[3]*n,this}scale(t,n){return this.m[0]*=t,this.m[1]*=t,this.m[2]*=n,this.m[3]*=n,this}rotate(t){var n=Math.cos(t),r=Math.sin(t),i=this.m[0]*n+this.m[2]*r,o=this.m[1]*n+this.m[3]*r,a=this.m[0]*-r+this.m[2]*n,s=this.m[1]*-r+this.m[3]*n;return this.m[0]=i,this.m[1]=o,this.m[2]=a,this.m[3]=s,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(t,n){var r=this.m[0]+this.m[2]*n,i=this.m[1]+this.m[3]*n,o=this.m[2]+this.m[0]*t,a=this.m[3]+this.m[1]*t;return this.m[0]=r,this.m[1]=i,this.m[2]=o,this.m[3]=a,this}multiply(t){var n=this.m[0]*t.m[0]+this.m[2]*t.m[1],r=this.m[1]*t.m[0]+this.m[3]*t.m[1],i=this.m[0]*t.m[2]+this.m[2]*t.m[3],o=this.m[1]*t.m[2]+this.m[3]*t.m[3],a=this.m[0]*t.m[4]+this.m[2]*t.m[5]+this.m[4],s=this.m[1]*t.m[4]+this.m[3]*t.m[5]+this.m[5];return this.m[0]=n,this.m[1]=r,this.m[2]=i,this.m[3]=o,this.m[4]=a,this.m[5]=s,this}invert(){var t=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),n=this.m[3]*t,r=-this.m[1]*t,i=-this.m[2]*t,o=this.m[0]*t,a=t*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),s=t*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=n,this.m[1]=r,this.m[2]=i,this.m[3]=o,this.m[4]=a,this.m[5]=s,this}getMatrix(){return this.m}decompose(){var t=this.m[0],n=this.m[1],r=this.m[2],i=this.m[3],o=this.m[4],a=this.m[5],s=t*i-n*r;let l={x:o,y:a,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(t!=0||n!=0){var u=Math.sqrt(t*t+n*n);l.rotation=n>0?Math.acos(t/u):-Math.acos(t/u),l.scaleX=u,l.scaleY=s/u,l.skewX=(t*r+n*i)/s,l.skewY=0}else if(r!=0||i!=0){var c=Math.sqrt(r*r+i*i);l.rotation=Math.PI/2-(i>0?Math.acos(-r/c):-Math.acos(r/c)),l.scaleX=s/c,l.scaleY=c,l.skewX=0,l.skewY=(t*r+n*i)/s}return l.rotation=te._getRotation(l.rotation),l}}var eEe="[object Array]",tEe="[object Number]",nEe="[object String]",rEe="[object Boolean]",iEe=Math.PI/180,oEe=180/Math.PI,Nw="#",aEe="",sEe="0",lEe="Konva warning: ",II="Konva error: ",uEe="rgb(",Bw={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},cEe=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,Rv=[];const dEe=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(e){setTimeout(e,60)},te={_isElement(e){return!!(e&&e.nodeType==1)},_isFunction(e){return!!(e&&e.constructor&&e.call&&e.apply)},_isPlainObject(e){return!!e&&e.constructor===Object},_isArray(e){return Object.prototype.toString.call(e)===eEe},_isNumber(e){return Object.prototype.toString.call(e)===tEe&&!isNaN(e)&&isFinite(e)},_isString(e){return Object.prototype.toString.call(e)===nEe},_isBoolean(e){return Object.prototype.toString.call(e)===rEe},isObject(e){return e instanceof Object},isValidSelector(e){if(typeof e!="string")return!1;var t=e[0];return t==="#"||t==="."||t===t.toUpperCase()},_sign(e){return e===0||e>0?1:-1},requestAnimFrame(e){Rv.push(e),Rv.length===1&&dEe(function(){const t=Rv;Rv=[],t.forEach(function(n){n()})})},createCanvasElement(){var e=document.createElement("canvas");try{e.style=e.style||{}}catch(t){}return e},createImageElement(){return document.createElement("img")},_isInDocument(e){for(;e=e.parentNode;)if(e==document)return!0;return!1},_urlToImage(e,t){var n=te.createImageElement();n.onload=function(){t(n)},n.src=e},_rgbToHex(e,t,n){return((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1)},_hexToRgb(e){e=e.replace(Nw,aEe);var t=parseInt(e,16);return{r:t>>16&255,g:t>>8&255,b:t&255}},getRandomColor(){for(var e=(Math.random()*16777215<<0).toString(16);e.length<6;)e=sEe+e;return Nw+e},getRGB(e){var t;return e in Bw?(t=Bw[e],{r:t[0],g:t[1],b:t[2]}):e[0]===Nw?this._hexToRgb(e.substring(1)):e.substr(0,4)===uEe?(t=cEe.exec(e.replace(/ /g,"")),{r:parseInt(t[1],10),g:parseInt(t[2],10),b:parseInt(t[3],10)}):{r:0,g:0,b:0}},colorToRGBA(e){return e=e||"black",te._namedColorToRBA(e)||te._hex3ColorToRGBA(e)||te._hex6ColorToRGBA(e)||te._rgbColorToRGBA(e)||te._rgbaColorToRGBA(e)||te._hslColorToRGBA(e)},_namedColorToRBA(e){var t=Bw[e.toLowerCase()];return t?{r:t[0],g:t[1],b:t[2],a:1}:null},_rgbColorToRGBA(e){if(e.indexOf("rgb(")===0){e=e.match(/rgb\(([^)]+)\)/)[1];var t=e.split(/ *, */).map(Number);return{r:t[0],g:t[1],b:t[2],a:1}}},_rgbaColorToRGBA(e){if(e.indexOf("rgba(")===0){e=e.match(/rgba\(([^)]+)\)/)[1];var t=e.split(/ *, */).map((n,r)=>n.slice(-1)==="%"?r===3?parseInt(n)/100:parseInt(n)/100*255:Number(n));return{r:t[0],g:t[1],b:t[2],a:t[3]}}},_hex6ColorToRGBA(e){if(e[0]==="#"&&e.length===7)return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:1}},_hex3ColorToRGBA(e){if(e[0]==="#"&&e.length===4)return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:1}},_hslColorToRGBA(e){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(e)){const[t,...n]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(e),r=Number(n[0])/360,i=Number(n[1])/100,o=Number(n[2])/100;let a,s,l;if(i===0)return l=o*255,{r:Math.round(l),g:Math.round(l),b:Math.round(l),a:1};o<.5?a=o*(1+i):a=o+i-o*i;const u=2*o-a,c=[0,0,0];for(let f=0;f<3;f++)s=r+1/3*-(f-1),s<0&&s++,s>1&&s--,6*s<1?l=u+(a-u)*6*s:2*s<1?l=a:3*s<2?l=u+(a-u)*(2/3-s)*6:l=u,c[f]=l*255;return{r:Math.round(c[0]),g:Math.round(c[1]),b:Math.round(c[2]),a:1}}},haveIntersection(e,t){return!(t.x>e.x+e.width||t.x+t.widthe.y+e.height||t.y+t.height1?(a=n,s=r,l=(n-i)*(n-i)+(r-o)*(r-o)):(a=e+c*(n-e),s=t+c*(r-t),l=(a-i)*(a-i)+(s-o)*(s-o))}return[a,s,l]},_getProjectionToLine(e,t,n){var r=te.cloneObject(e),i=Number.MAX_VALUE;return t.forEach(function(o,a){if(!(!n&&a===t.length-1)){var s=t[(a+1)%t.length],l=te._getProjectionToSegment(o.x,o.y,s.x,s.y,e.x,e.y),u=l[0],c=l[1],f=l[2];ft.length){var a=t;t=e,e=a}for(r=0;r{t.width=0,t.height=0})}};function _u(e){return te._isString(e)?'"'+e+'"':Object.prototype.toString.call(e)==="[object Number]"||te._isBoolean(e)?e:Object.prototype.toString.call(e)}function KW(e){return e>255?255:e<0?0:Math.round(e)}function Pe(){if(Ve.isUnminified)return function(e,t){return te._isNumber(e)||te.warn(_u(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}function YW(e){if(Ve.isUnminified)return function(t,n){let r=te._isNumber(t),i=te._isArray(t)&&t.length==e;return!r&&!i&&te.warn(_u(t)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array('+e+")"),t}}function K_(){if(Ve.isUnminified)return function(e,t){var n=te._isNumber(e),r=e==="auto";return n||r||te.warn(_u(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}function qh(){if(Ve.isUnminified)return function(e,t){return te._isString(e)||te.warn(_u(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}function qW(){if(Ve.isUnminified)return function(e,t){const n=te._isString(e),r=Object.prototype.toString.call(e)==="[object CanvasGradient]"||e&&e.addColorStop;return n||r||te.warn(_u(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}function fEe(){if(Ve.isUnminified)return function(e,t){const n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&e instanceof n||(te._isArray(e)?e.forEach(function(r){te._isNumber(r)||te.warn('"'+t+'" attribute has non numeric element '+r+". Make sure that all elements are numbers.")}):te.warn(_u(e)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),e}}function ha(){if(Ve.isUnminified)return function(e,t){var n=e===!0||e===!1;return n||te.warn(_u(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}function hEe(e){if(Ve.isUnminified)return function(t,n){return t==null||te.isObject(t)||te.warn(_u(t)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+e),t}}var Zp="get",Qp="set";const K={addGetterSetter(e,t,n,r,i){K.addGetter(e,t,n),K.addSetter(e,t,r,i),K.addOverloadedGetterSetter(e,t)},addGetter(e,t,n){var r=Zp+te._capitalize(t);e.prototype[r]=e.prototype[r]||function(){var i=this.attrs[t];return i===void 0?n:i}},addSetter(e,t,n,r){var i=Qp+te._capitalize(t);e.prototype[i]||K.overWriteSetter(e,t,n,r)},overWriteSetter(e,t,n,r){var i=Qp+te._capitalize(t);e.prototype[i]=function(o){return n&&o!==void 0&&o!==null&&(o=n.call(this,o,t)),this._setAttr(t,o),r&&r.call(this),this}},addComponentsGetterSetter(e,t,n,r,i){var o=n.length,a=te._capitalize,s=Zp+a(t),l=Qp+a(t),u,c;e.prototype[s]=function(){var p={};for(u=0;u{this._setAttr(t+a(v),void 0)}),this._fireChangeEvent(t,m,p),i&&i.call(this),this},K.addOverloadedGetterSetter(e,t)},addOverloadedGetterSetter(e,t){var n=te._capitalize(t),r=Qp+n,i=Zp+n;e.prototype[t]=function(){return arguments.length?(this[r](arguments[0]),this):this[i]()}},addDeprecatedGetterSetter(e,t,n,r){te.error("Adding deprecated "+t);var i=Zp+te._capitalize(t),o=t+" property is deprecated and will be removed soon. Look at Konva change log for more information.";e.prototype[i]=function(){te.error(o);var a=this.attrs[t];return a===void 0?n:a},K.addSetter(e,t,r,function(){te.error(o)}),K.addOverloadedGetterSetter(e,t)},backCompat(e,t){te.each(t,function(n,r){var i=e.prototype[r],o=Zp+te._capitalize(n),a=Qp+te._capitalize(n);function s(){i.apply(this,arguments),te.error('"'+n+'" method is deprecated and will be removed soon. Use ""'+r+'" instead.')}e.prototype[n]=s,e.prototype[o]=s,e.prototype[a]=s})},afterSetFilter(){this._filterUpToDate=!1}};function pEe(e){var t=[],n=e.length,r=te,i,o;for(i=0;itypeof c=="number"?Math.floor(c):c)),o+=mEe+u.join(RI)+gEe)):(o+=s.property,t||(o+=wEe+s.val)),o+=bEe;return o}clearTrace(){this.traceArr=[]}_trace(t){var n=this.traceArr,r;n.push(t),r=n.length,r>=xEe&&n.shift()}reset(){var t=this.getCanvas().getPixelRatio();this.setTransform(1*t,0,0,1*t,0,0)}getCanvas(){return this.canvas}clear(t){var n=this.getCanvas();t?this.clearRect(t.x||0,t.y||0,t.width||0,t.height||0):this.clearRect(0,0,n.getWidth()/n.pixelRatio,n.getHeight()/n.pixelRatio)}_applyLineCap(t){var n=t.getLineCap();n&&this.setAttr("lineCap",n)}_applyOpacity(t){var n=t.getAbsoluteOpacity();n!==1&&this.setAttr("globalAlpha",n)}_applyLineJoin(t){var n=t.attrs.lineJoin;n&&this.setAttr("lineJoin",n)}setAttr(t,n){this._context[t]=n}arc(t,n,r,i,o,a){this._context.arc(t,n,r,i,o,a)}arcTo(t,n,r,i,o){this._context.arcTo(t,n,r,i,o)}beginPath(){this._context.beginPath()}bezierCurveTo(t,n,r,i,o,a){this._context.bezierCurveTo(t,n,r,i,o,a)}clearRect(t,n,r,i){this._context.clearRect(t,n,r,i)}clip(){this._context.clip()}closePath(){this._context.closePath()}createImageData(t,n){var r=arguments;if(r.length===2)return this._context.createImageData(t,n);if(r.length===1)return this._context.createImageData(t)}createLinearGradient(t,n,r,i){return this._context.createLinearGradient(t,n,r,i)}createPattern(t,n){return this._context.createPattern(t,n)}createRadialGradient(t,n,r,i,o,a){return this._context.createRadialGradient(t,n,r,i,o,a)}drawImage(t,n,r,i,o,a,s,l,u){var c=arguments,f=this._context;c.length===3?f.drawImage(t,n,r):c.length===5?f.drawImage(t,n,r,i,o):c.length===9&&f.drawImage(t,n,r,i,o,a,s,l,u)}ellipse(t,n,r,i,o,a,s,l){this._context.ellipse(t,n,r,i,o,a,s,l)}isPointInPath(t,n){return this._context.isPointInPath(t,n)}fill(t){t?this._context.fill(t):this._context.fill()}fillRect(t,n,r,i){this._context.fillRect(t,n,r,i)}strokeRect(t,n,r,i){this._context.strokeRect(t,n,r,i)}fillText(t,n,r,i){i?this._context.fillText(t,n,r,i):this._context.fillText(t,n,r)}measureText(t){return this._context.measureText(t)}getImageData(t,n,r,i){return this._context.getImageData(t,n,r,i)}lineTo(t,n){this._context.lineTo(t,n)}moveTo(t,n){this._context.moveTo(t,n)}rect(t,n,r,i){this._context.rect(t,n,r,i)}putImageData(t,n,r){this._context.putImageData(t,n,r)}quadraticCurveTo(t,n,r,i){this._context.quadraticCurveTo(t,n,r,i)}restore(){this._context.restore()}rotate(t){this._context.rotate(t)}save(){this._context.save()}scale(t,n){this._context.scale(t,n)}setLineDash(t){this._context.setLineDash?this._context.setLineDash(t):"mozDash"in this._context?this._context.mozDash=t:"webkitLineDash"in this._context&&(this._context.webkitLineDash=t)}getLineDash(){return this._context.getLineDash()}setTransform(t,n,r,i,o,a){this._context.setTransform(t,n,r,i,o,a)}stroke(t){t?this._context.stroke(t):this._context.stroke()}strokeText(t,n,r,i){this._context.strokeText(t,n,r,i)}transform(t,n,r,i,o,a){this._context.transform(t,n,r,i,o,a)}translate(t,n){this._context.translate(t,n)}_enableTrace(){var t=this,n=$I.length,r=this.setAttr,i,o,a=function(s){var l=t[s],u;t[s]=function(){return o=pEe(Array.prototype.slice.call(arguments,0)),u=l.apply(t,arguments),t._trace({method:s,args:o}),u}};for(i=0;i{t.dragStatus==="dragging"&&(e=!0)}),e},justDragged:!1,get node(){var e;return Rt._dragElements.forEach(t=>{e=t.node}),e},_dragElements:new Map,_drag(e){const t=[];Rt._dragElements.forEach((n,r)=>{const{node:i}=n,o=i.getStage();o.setPointersPositions(e),n.pointerId===void 0&&(n.pointerId=te._getFirstPointerId(e));const a=o._changedPointerPositions.find(u=>u.id===n.pointerId);if(a){if(n.dragStatus!=="dragging"){var s=i.dragDistance(),l=Math.max(Math.abs(a.x-n.startPointerPos.x),Math.abs(a.y-n.startPointerPos.y));if(l{n.fire("dragmove",{type:"dragmove",target:n,evt:e},!0)})},_endDragBefore(e){const t=[];Rt._dragElements.forEach(n=>{const{node:r}=n,i=r.getStage();if(e&&i.setPointersPositions(e),!i._changedPointerPositions.find(s=>s.id===n.pointerId))return;(n.dragStatus==="dragging"||n.dragStatus==="stopped")&&(Rt.justDragged=!0,Ve._mouseListenClick=!1,Ve._touchListenClick=!1,Ve._pointerListenClick=!1,n.dragStatus="stopped");const a=n.node.getLayer()||n.node instanceof Ve.Stage&&n.node;a&&t.indexOf(a)===-1&&t.push(a)}),t.forEach(n=>{n.draw()})},_endDragAfter(e){Rt._dragElements.forEach((t,n)=>{t.dragStatus==="stopped"&&t.node.fire("dragend",{type:"dragend",target:t.node,evt:e},!0),t.dragStatus!=="dragging"&&Rt._dragElements.delete(n)})}};Ve.isBrowser&&(window.addEventListener("mouseup",Rt._endDragBefore,!0),window.addEventListener("touchend",Rt._endDragBefore,!0),window.addEventListener("mousemove",Rt._drag),window.addEventListener("touchmove",Rt._drag),window.addEventListener("mouseup",Rt._endDragAfter,!1),window.addEventListener("touchend",Rt._endDragAfter,!1));var U2="absoluteOpacity",Dv="allEventListeners",ks="absoluteTransform",DI="absoluteScale",Ku="canvas",PEe="Change",TEe="children",LEe="konva",Ux="listening",NI="mouseenter",BI="mouseleave",FI="set",zI="Shape",W2=" ",jI="stage",kl="transform",AEe="Stage",Wx="visible",OEe=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(W2);let MEe=1,Oe=class Gx{constructor(t){this._id=MEe++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(t),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(t){(t===kl||t===ks)&&this._cache.get(t)?this._cache.get(t).dirty=!0:t?this._cache.delete(t):this._cache.clear()}_getCache(t,n){var r=this._cache.get(t),i=t===kl||t===ks,o=r===void 0||i&&r.dirty===!0;return o&&(r=n.call(this),this._cache.set(t,r)),r}_calculate(t,n,r){if(!this._attachedDepsListeners.get(t)){const i=n.map(o=>o+"Change.konva").join(W2);this.on(i,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,r)}_getCanvasCache(){return this._cache.get(Ku)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===ks&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(Ku)){const{scene:t,filter:n,hit:r}=this._cache.get(Ku);te.releaseCanvas(t,n,r),this._cache.delete(Ku)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(t){var n=t||{},r={};(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)&&(r=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()}));var i=Math.ceil(n.width||r.width),o=Math.ceil(n.height||r.height),a=n.pixelRatio,s=n.x===void 0?Math.floor(r.x):n.x,l=n.y===void 0?Math.floor(r.y):n.y,u=n.offset||0,c=n.drawBorder||!1,f=n.hitCanvasPixelRatio||1;if(!i||!o){te.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}i+=u*2+1,o+=u*2+1,s-=u,l-=u;var p=new eh({pixelRatio:a,width:i,height:o}),m=new eh({pixelRatio:a,width:0,height:0}),g=new Y_({pixelRatio:f,width:i,height:o}),v=p.getContext(),x=g.getContext();return g.isCache=!0,p.isCache=!0,this._cache.delete(Ku),this._filterUpToDate=!1,n.imageSmoothingEnabled===!1&&(p.getContext()._context.imageSmoothingEnabled=!1,m.getContext()._context.imageSmoothingEnabled=!1),v.save(),x.save(),v.translate(-s,-l),x.translate(-s,-l),this._isUnderCache=!0,this._clearSelfAndDescendantCache(U2),this._clearSelfAndDescendantCache(DI),this.drawScene(p,this),this.drawHit(g,this),this._isUnderCache=!1,v.restore(),x.restore(),c&&(v.save(),v.beginPath(),v.rect(0,0,i,o),v.closePath(),v.setAttr("strokeStyle","red"),v.setAttr("lineWidth",5),v.stroke(),v.restore()),this._cache.set(Ku,{scene:p,filter:m,hit:g,x:s,y:l}),this._requestDraw(),this}isCached(){return this._cache.has(Ku)}getClientRect(t){throw new Error('abstract "getClientRect" method call')}_transformedRect(t,n){var r=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],i,o,a,s,l=this.getAbsoluteTransform(n);return r.forEach(function(u){var c=l.point(u);i===void 0&&(i=a=c.x,o=s=c.y),i=Math.min(i,c.x),o=Math.min(o,c.y),a=Math.max(a,c.x),s=Math.max(s,c.y)}),{x:i,y:o,width:a-i,height:s-o}}_drawCachedSceneCanvas(t){t.save(),t._applyOpacity(this),t._applyGlobalCompositeOperation(this);const n=this._getCanvasCache();t.translate(n.x,n.y);var r=this._getCachedSceneCanvas(),i=r.pixelRatio;t.drawImage(r._canvas,0,0,r.width/i,r.height/i),t.restore()}_drawCachedHitCanvas(t){var n=this._getCanvasCache(),r=n.hit;t.save(),t.translate(n.x,n.y),t.drawImage(r._canvas,0,0,r.width/r.pixelRatio,r.height/r.pixelRatio),t.restore()}_getCachedSceneCanvas(){var t=this.filters(),n=this._getCanvasCache(),r=n.scene,i=n.filter,o=i.getContext(),a,s,l,u;if(t){if(!this._filterUpToDate){var c=r.pixelRatio;i.setSize(r.width/r.pixelRatio,r.height/r.pixelRatio);try{for(a=t.length,o.clear(),o.drawImage(r._canvas,0,0,r.getWidth()/c,r.getHeight()/c),s=o.getImageData(0,0,i.getWidth(),i.getHeight()),l=0;l{var n,r;if(!t)return this;for(n in t)n!==TEe&&(r=FI+te._capitalize(n),te._isFunction(this[r])?this[r](t[n]):this._setAttr(n,t[n]))}),this}isListening(){return this._getCache(Ux,this._isListening)}_isListening(t){if(!this.listening())return!1;const r=this.getParent();return r&&r!==t&&this!==t?r._isListening(t):!0}isVisible(){return this._getCache(Wx,this._isVisible)}_isVisible(t){if(!this.visible())return!1;const r=this.getParent();return r&&r!==t&&this!==t?r._isVisible(t):!0}shouldDrawHit(t,n=!1){if(t)return this._isVisible(t)&&this._isListening(t);var r=this.getLayer(),i=!1;Rt._dragElements.forEach(a=>{a.dragStatus==="dragging"&&(a.node.nodeType==="Stage"||a.node.getLayer()===r)&&(i=!0)});var o=!n&&!Ve.hitOnDragEnabled&&i;return this.isListening()&&this.isVisible()&&!o}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){var t=this.getDepth(),n=this,r=0,i,o,a,s;function l(u){for(i=[],o=u.length,a=0;a0&&i[0].getDepth()<=t&&l(i)}return n.nodeType!==AEe&&l(n.getStage().getChildren()),r}getDepth(){for(var t=0,n=this.parent;n;)t++,n=n.parent;return t}_batchTransformChanges(t){this._batchingTransformChange=!0,t(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(kl),this._clearSelfAndDescendantCache(ks)),this._needClearTransformCache=!1}setPosition(t){return this._batchTransformChanges(()=>{this.x(t.x),this.y(t.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){if(!this.getStage())return null;var t=this.getStage().getPointerPosition();if(!t)return null;var n=this.getAbsoluteTransform().copy();return n.invert(),n.point(t)}getAbsolutePosition(t){let n=!1,r=this.parent;for(;r;){if(r.isCached()){n=!0;break}r=r.parent}n&&!t&&(t=!0);var i=this.getAbsoluteTransform(t).getMatrix(),o=new Hi,a=this.offset();return o.m=i.slice(),o.translate(a.x,a.y),o.getTranslation()}setAbsolutePosition(t){var n=this._clearTransform();this.attrs.x=n.x,this.attrs.y=n.y,delete n.x,delete n.y,this._clearCache(kl);var r=this._getAbsoluteTransform().copy();return r.invert(),r.translate(t.x,t.y),t={x:this.attrs.x+r.getTranslation().x,y:this.attrs.y+r.getTranslation().y},this._setTransform(n),this.setPosition({x:t.x,y:t.y}),this._clearCache(kl),this._clearSelfAndDescendantCache(ks),this}_setTransform(t){var n;for(n in t)this.attrs[n]=t[n]}_clearTransform(){var t={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,t}move(t){var n=t.x,r=t.y,i=this.x(),o=this.y();return n!==void 0&&(i+=n),r!==void 0&&(o+=r),this.setPosition({x:i,y:o}),this}_eachAncestorReverse(t,n){var r=[],i=this.getParent(),o,a;if(!(n&&n._id===this._id)){for(r.unshift(this);i&&(!n||i._id!==n._id);)r.unshift(i),i=i.parent;for(o=r.length,a=0;a0?(this.parent.children.splice(t,1),this.parent.children.splice(t-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return te.warn("Node has no parent. moveToBottom function is ignored."),!1;var t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(t){if(!this.parent)return te.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&&te.warn("Unexpected value "+t+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");var n=this.index;return this.parent.children.splice(n,1),this.parent.children.splice(t,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(U2,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){var t=this.opacity(),n=this.getParent();return n&&!n._isUnderCache&&(t*=n.getAbsoluteOpacity()),t}moveTo(t){return this.getParent()!==t&&(this._remove(),t.add(this)),this}toObject(){var t={},n=this.getAttrs(),r,i,o,a,s;t.attrs={};for(r in n)i=n[r],s=te.isObject(i)&&!te._isPlainObject(i)&&!te._isArray(i),!s&&(o=typeof this[r]=="function"&&this[r],delete n[r],a=o?o.call(this):null,n[r]=i,a!==i&&(t.attrs[r]=i));return t.className=this.getClassName(),te._prepareToStringify(t)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(t,n,r){var i=[];n&&this._isMatch(t)&&i.push(this);for(var o=this.parent;o;){if(o===r)return i;o._isMatch(t)&&i.push(o),o=o.parent}return i}isAncestorOf(t){return!1}findAncestor(t,n,r){return this.findAncestors(t,n,r)[0]}_isMatch(t){if(!t)return!1;if(typeof t=="function")return t(this);var n=t.replace(/ /g,"").split(","),r=n.length,i,o;for(i=0;i{try{const i=t==null?void 0:t.callback;i&&delete t.callback,te._urlToImage(this.toDataURL(t),function(o){n(o),i==null||i(o)})}catch(i){r(i)}})}toBlob(t){return new Promise((n,r)=>{try{const i=t==null?void 0:t.callback;i&&delete t.callback,this.toCanvas(t).toBlob(o=>{n(o),i==null||i(o)})}catch(i){r(i)}})}setSize(t){return this.width(t.width),this.height(t.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():Ve.dragDistance}_off(t,n,r){var i=this.eventListeners[t],o,a,s;for(o=0;o=0;if(r&&!this.isDragging()){var i=!1;Rt._dragElements.forEach(o=>{this.isAncestorOf(o.node)&&(i=!0)}),i||this._createDragElement(t)}})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{this._dragCleanup();var t=this.getStage();if(!t)return;const n=Rt._dragElements.get(this._id),r=n&&n.dragStatus==="dragging",i=n&&n.dragStatus==="ready";r?this.stopDrag():i&&Rt._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(t={x:0,y:0}){const n=this.getStage();if(!n)return!1;const r={x:-t.x,y:-t.y,width:n.width()+2*t.x,height:n.height()+2*t.y};return te.haveIntersection(r,this.getClientRect())}static create(t,n){return te._isString(t)&&(t=JSON.parse(t)),this._createNode(t,n)}static _createNode(t,n){var r=Gx.prototype.getClassName.call(t),i=t.children,o,a,s;n&&(t.attrs.container=n),Ve[r]||(te.warn('Can not find a node with class name "'+r+'". Fallback to "Shape".'),r="Shape");const l=Ve[r];if(o=new l(t.attrs),i)for(a=i.length,s=0;s0}removeChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.destroy()}),this.children=[],this._requestDraw(),this}add(...t){if(arguments.length>1){for(var n=0;n0?n[0]:void 0}_generalFind(t,n){var r=[];return this._descendants(i=>{const o=i._isMatch(t);return o&&r.push(i),!!(o&&n)}),r}_descendants(t){let n=!1;const r=this.getChildren();for(const i of r){if(n=t(i),n)return!0;if(i.hasChildren()&&(n=i._descendants(t),n))return!0}return!1}toObject(){var t=Oe.prototype.toObject.call(this);return t.children=[],this.getChildren().forEach(n=>{t.children.push(n.toObject())}),t}isAncestorOf(t){for(var n=t.getParent();n;){if(n._id===this._id)return!0;n=n.getParent()}return!1}clone(t){var n=Oe.prototype.clone.call(this,t);return this.getChildren().forEach(function(r){n.add(r.clone())}),n}getAllIntersections(t){var n=[];return this.find("Shape").forEach(function(r){r.isVisible()&&r.intersects(t)&&n.push(r)}),n}_clearSelfAndDescendantCache(t){var n;super._clearSelfAndDescendantCache(t),!this.isCached()&&((n=this.children)===null||n===void 0||n.forEach(function(r){r._clearSelfAndDescendantCache(t)}))}_setChildrenIndices(){var t;(t=this.children)===null||t===void 0||t.forEach(function(n,r){n.index=r}),this._requestDraw()}drawScene(t,n){var r=this.getLayer(),i=t||r&&r.getCanvas(),o=i&&i.getContext(),a=this._getCanvasCache(),s=a&&a.scene,l=i&&i.isCache;if(!this.isVisible()&&!l)return this;if(s){o.save();var u=this.getAbsoluteTransform(n).getMatrix();o.transform(u[0],u[1],u[2],u[3],u[4],u[5]),this._drawCachedSceneCanvas(o),o.restore()}else this._drawChildren("drawScene",i,n);return this}drawHit(t,n){if(!this.shouldDrawHit(n))return this;var r=this.getLayer(),i=t||r&&r.hitCanvas,o=i&&i.getContext(),a=this._getCanvasCache(),s=a&&a.hit;if(s){o.save();var l=this.getAbsoluteTransform(n).getMatrix();o.transform(l[0],l[1],l[2],l[3],l[4],l[5]),this._drawCachedHitCanvas(o),o.restore()}else this._drawChildren("drawHit",i,n);return this}_drawChildren(t,n,r){var i,o=n&&n.getContext(),a=this.clipWidth(),s=this.clipHeight(),l=this.clipFunc(),u=a&&s||l;const c=r===this;if(u){o.save();var f=this.getAbsoluteTransform(r),p=f.getMatrix();if(o.transform(p[0],p[1],p[2],p[3],p[4],p[5]),o.beginPath(),l)l.call(this,o,this);else{var m=this.clipX(),g=this.clipY();o.rect(m,g,a,s)}o.clip(),p=f.copy().invert().getMatrix(),o.transform(p[0],p[1],p[2],p[3],p[4],p[5])}var v=!c&&this.globalCompositeOperation()!=="source-over"&&t==="drawScene";v&&(o.save(),o._applyGlobalCompositeOperation(this)),(i=this.children)===null||i===void 0||i.forEach(function(x){x[t](n,r)}),v&&o.restore(),u&&o.restore()}getClientRect(t){var n;t=t||{};var r=t.skipTransform,i=t.relativeTo,o,a,s,l,u={x:1/0,y:1/0,width:0,height:0},c=this;(n=this.children)===null||n===void 0||n.forEach(function(v){if(v.visible()){var x=v.getClientRect({relativeTo:c,skipShadow:t.skipShadow,skipStroke:t.skipStroke});x.width===0&&x.height===0||(o===void 0?(o=x.x,a=x.y,s=x.x+x.width,l=x.y+x.height):(o=Math.min(o,x.x),a=Math.min(a,x.y),s=Math.max(s,x.x+x.width),l=Math.max(l,x.y+x.height)))}});for(var f=this.find("Shape"),p=!1,m=0;me.indexOf("pointer")>=0?"pointer":e.indexOf("touch")>=0?"touch":"mouse",Gd=e=>{const t=Sm(e);if(t==="pointer")return Ve.pointerEventsEnabled&&zw.pointer;if(t==="touch")return zw.touch;if(t==="mouse")return zw.mouse};function VI(e={}){return(e.clipFunc||e.clipWidth||e.clipHeight)&&te.warn("Stage does not support clipping. Please use clip for Layers or Groups."),e}const FEe="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);",G2=[];let i4=class extends Ki{constructor(t){super(VI(t)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),G2.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{VI(this.attrs)}),this._checkVisibility()}_validateAdd(t){const n=t.getType()==="Layer",r=t.getType()==="FastLayer";n||r||te.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const t=this.visible()?"":"none";this.content.style.display=t}setContainer(t){if(typeof t===REe){if(t.charAt(0)==="."){var n=t.slice(1);t=document.getElementsByClassName(n)[0]}else{var r;t.charAt(0)!=="#"?r=t:r=t.slice(1),t=document.getElementById(r)}if(!t)throw"Can not find container in document with id "+r}return this._setAttr("container",t),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),t.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var t=this.children,n=t.length,r;for(r=0;r-1&&G2.splice(n,1),te.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const t=this._pointerPositions[0]||this._changedPointerPositions[0];return t?{x:t.x,y:t.y}:(te.warn(FEe),null)}_getPointerById(t){return this._pointerPositions.find(n=>n.id===t)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(t){t=t||{},t.x=t.x||0,t.y=t.y||0,t.width=t.width||this.width(),t.height=t.height||this.height();var n=new eh({width:t.width,height:t.height,pixelRatio:t.pixelRatio||1}),r=n.getContext()._context,i=this.children;return(t.x||t.y)&&r.translate(-1*t.x,-1*t.y),i.forEach(function(o){if(o.isVisible()){var a=o._toKonvaCanvas(t);r.drawImage(a._canvas,t.x,t.y,a.getWidth()/a.getPixelRatio(),a.getHeight()/a.getPixelRatio())}}),n}getIntersection(t){if(!t)return null;var n=this.children,r=n.length,i=r-1,o;for(o=i;o>=0;o--){const a=n[o].getIntersection(t);if(a)return a}return null}_resizeDOM(){var t=this.width(),n=this.height();this.content&&(this.content.style.width=t+HI,this.content.style.height=n+HI),this.bufferCanvas.setSize(t,n),this.bufferHitCanvas.setSize(t,n),this.children.forEach(r=>{r.setSize({width:t,height:n}),r.draw()})}add(t,...n){if(arguments.length>1){for(var r=0;rNEe&&te.warn("The stage has "+i+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),t.setSize({width:this.width(),height:this.height()}),t.draw(),Ve.isBrowser&&this.content.appendChild(t.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(t){return ZW(t,this)}setPointerCapture(t){QW(t,this)}releaseCapture(t){qm(t)}getLayers(){return this.children}_bindContentEvents(){Ve.isBrowser&&BEe.forEach(([t,n])=>{this.content.addEventListener(t,r=>{this[n](r)},{passive:!1})})}_pointerenter(t){this.setPointersPositions(t);const n=Gd(t.type);this._fire(n.pointerenter,{evt:t,target:this,currentTarget:this})}_pointerover(t){this.setPointersPositions(t);const n=Gd(t.type);this._fire(n.pointerover,{evt:t,target:this,currentTarget:this})}_getTargetShape(t){let n=this[t+"targetShape"];return n&&!n.getStage()&&(n=null),n}_pointerleave(t){const n=Gd(t.type),r=Sm(t.type);if(n){this.setPointersPositions(t);var i=this._getTargetShape(r),o=!Rt.isDragging||Ve.hitOnDragEnabled;i&&o?(i._fireAndBubble(n.pointerout,{evt:t}),i._fireAndBubble(n.pointerleave,{evt:t}),this._fire(n.pointerleave,{evt:t,target:this,currentTarget:this}),this[r+"targetShape"]=null):o&&(this._fire(n.pointerleave,{evt:t,target:this,currentTarget:this}),this._fire(n.pointerout,{evt:t,target:this,currentTarget:this})),this.pointerPos=void 0,this._pointerPositions=[]}}_pointerdown(t){const n=Gd(t.type),r=Sm(t.type);if(n){this.setPointersPositions(t);var i=!1;this._changedPointerPositions.forEach(o=>{var a=this.getIntersection(o);if(Rt.justDragged=!1,Ve["_"+r+"ListenClick"]=!0,!(a&&a.isListening()))return;Ve.capturePointerEventsEnabled&&a.setPointerCapture(o.id),this[r+"ClickStartShape"]=a,a._fireAndBubble(n.pointerdown,{evt:t,pointerId:o.id}),i=!0;const l=t.type.indexOf("touch")>=0;a.preventDefault()&&t.cancelable&&l&&t.preventDefault()}),i||this._fire(n.pointerdown,{evt:t,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(t){const n=Gd(t.type),r=Sm(t.type);if(!n)return;Rt.isDragging&&Rt.node.preventDefault()&&t.cancelable&&t.preventDefault(),this.setPointersPositions(t);var i=!Rt.isDragging||Ve.hitOnDragEnabled;if(!i)return;var o={};let a=!1;var s=this._getTargetShape(r);this._changedPointerPositions.forEach(l=>{const u=Fw(l.id)||this.getIntersection(l),c=l.id,f={evt:t,pointerId:c};var p=s!==u;if(p&&s&&(s._fireAndBubble(n.pointerout,Object.assign({},f),u),s._fireAndBubble(n.pointerleave,Object.assign({},f),u)),u){if(o[u._id])return;o[u._id]=!0}u&&u.isListening()?(a=!0,p&&(u._fireAndBubble(n.pointerover,Object.assign({},f),s),u._fireAndBubble(n.pointerenter,Object.assign({},f),s),this[r+"targetShape"]=u),u._fireAndBubble(n.pointermove,Object.assign({},f))):s&&(this._fire(n.pointerover,{evt:t,target:this,currentTarget:this,pointerId:c}),this[r+"targetShape"]=null)}),a||this._fire(n.pointermove,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(t){const n=Gd(t.type),r=Sm(t.type);if(!n)return;this.setPointersPositions(t);const i=this[r+"ClickStartShape"],o=this[r+"ClickEndShape"];var a={};let s=!1;this._changedPointerPositions.forEach(l=>{const u=Fw(l.id)||this.getIntersection(l);if(u){if(u.releaseCapture(l.id),a[u._id])return;a[u._id]=!0}const c=l.id,f={evt:t,pointerId:c};let p=!1;Ve["_"+r+"InDblClickWindow"]?(p=!0,clearTimeout(this[r+"DblTimeout"])):Rt.justDragged||(Ve["_"+r+"InDblClickWindow"]=!0,clearTimeout(this[r+"DblTimeout"])),this[r+"DblTimeout"]=setTimeout(function(){Ve["_"+r+"InDblClickWindow"]=!1},Ve.dblClickWindow),u&&u.isListening()?(s=!0,this[r+"ClickEndShape"]=u,u._fireAndBubble(n.pointerup,Object.assign({},f)),Ve["_"+r+"ListenClick"]&&i&&i===u&&(u._fireAndBubble(n.pointerclick,Object.assign({},f)),p&&o&&o===u&&u._fireAndBubble(n.pointerdblclick,Object.assign({},f)))):(this[r+"ClickEndShape"]=null,Ve["_"+r+"ListenClick"]&&this._fire(n.pointerclick,{evt:t,target:this,currentTarget:this,pointerId:c}),p&&this._fire(n.pointerdblclick,{evt:t,target:this,currentTarget:this,pointerId:c}))}),s||this._fire(n.pointerup,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),Ve["_"+r+"ListenClick"]=!1,t.cancelable&&r!=="touch"&&t.preventDefault()}_contextmenu(t){this.setPointersPositions(t);var n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(Kx,{evt:t}):this._fire(Kx,{evt:t,target:this,currentTarget:this})}_wheel(t){this.setPointersPositions(t);var n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(Yx,{evt:t}):this._fire(Yx,{evt:t,target:this,currentTarget:this})}_pointercancel(t){this.setPointersPositions(t);const n=Fw(t.pointerId)||this.getIntersection(this.getPointerPosition());n&&n._fireAndBubble(xf,q_(t)),qm(t.pointerId)}_lostpointercapture(t){qm(t.pointerId)}setPointersPositions(t){var n=this._getContentPosition(),r=null,i=null;t=t||window.event,t.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(t.touches,o=>{this._pointerPositions.push({id:o.identifier,x:(o.clientX-n.left)/n.scaleX,y:(o.clientY-n.top)/n.scaleY})}),Array.prototype.forEach.call(t.changedTouches||t.touches,o=>{this._changedPointerPositions.push({id:o.identifier,x:(o.clientX-n.left)/n.scaleX,y:(o.clientY-n.top)/n.scaleY})})):(r=(t.clientX-n.left)/n.scaleX,i=(t.clientY-n.top)/n.scaleY,this.pointerPos={x:r,y:i},this._pointerPositions=[{x:r,y:i,id:te._getFirstPointerId(t)}],this._changedPointerPositions=[{x:r,y:i,id:te._getFirstPointerId(t)}])}_setPointerPosition(t){te.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(t)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var t=this.content.getBoundingClientRect();return{top:t.top,left:t.left,scaleX:t.width/this.content.clientWidth||1,scaleY:t.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new eh({width:this.width(),height:this.height()}),this.bufferHitCanvas=new Y_({pixelRatio:1,width:this.width(),height:this.height()}),!!Ve.isBrowser){var t=this.container();if(!t)throw"Stage has no container. A container is required.";t.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),t.appendChild(this.content),this._resizeDOM()}}cache(){return te.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(t){t.batchDraw()}),this}};i4.prototype.nodeType=IEe;Vn(i4);K.addGetterSetter(i4,"container");var uG="hasShadow",cG="shadowRGBA",dG="patternImage",fG="linearGradient",hG="radialGradient";let jv;function jw(){return jv||(jv=te.createCanvasElement().getContext("2d"),jv)}const Xm={};function zEe(e){e.fill()}function jEe(e){e.stroke()}function HEe(e){e.fill()}function VEe(e){e.stroke()}function UEe(){this._clearCache(uG)}function WEe(){this._clearCache(cG)}function GEe(){this._clearCache(dG)}function KEe(){this._clearCache(fG)}function YEe(){this._clearCache(hG)}class ye extends Oe{constructor(t){super(t);let n;for(;n=te.getRandomColor(),!(n&&!(n in Xm)););this.colorKey=n,Xm[n]=this}getContext(){return te.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return te.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(uG,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(dG,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){var t=jw();const n=t.createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(n&&n.setTransform){const r=new Hi;r.translate(this.fillPatternX(),this.fillPatternY()),r.rotate(Ve.getAngle(this.fillPatternRotation())),r.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),r.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const i=r.getMatrix(),o=typeof DOMMatrix>"u"?{a:i[0],b:i[1],c:i[2],d:i[3],e:i[4],f:i[5]}:new DOMMatrix(i);n.setTransform(o)}return n}}_getLinearGradient(){return this._getCache(fG,this.__getLinearGradient)}__getLinearGradient(){var t=this.fillLinearGradientColorStops();if(t){for(var n=jw(),r=this.fillLinearGradientStartPoint(),i=this.fillLinearGradientEndPoint(),o=n.createLinearGradient(r.x,r.y,i.x,i.y),a=0;athis.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const t=this.hitStrokeWidth();return t==="auto"?this.hasStroke():this.strokeEnabled()&&!!t}intersects(t){var n=this.getStage(),r=n.bufferHitCanvas,i;return r.getContext().clear(),this.drawHit(r,null,!0),i=r.context.getImageData(Math.round(t.x),Math.round(t.y),1,1).data,i[3]>0}destroy(){return Oe.prototype.destroy.call(this),delete Xm[this.colorKey],delete this.colorKey,this}_useBufferCanvas(t){var n;if(!this.getStage()||!((n=this.attrs.perfectDrawEnabled)!==null&&n!==void 0?n:!0))return!1;const i=t||this.hasFill(),o=this.hasStroke(),a=this.getAbsoluteOpacity()!==1;if(i&&o&&a)return!0;const s=this.hasShadow(),l=this.shadowForStrokeEnabled();return!!(i&&o&&s&&l)}setStrokeHitEnabled(t){te.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),t?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){var t=this.size();return{x:this._centroid?-t.width/2:0,y:this._centroid?-t.height/2:0,width:t.width,height:t.height}}getClientRect(t={}){const n=t.skipTransform,r=t.relativeTo,i=this.getSelfRect(),a=!t.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,s=i.width+a,l=i.height+a,u=!t.skipShadow&&this.hasShadow(),c=u?this.shadowOffsetX():0,f=u?this.shadowOffsetY():0,p=s+Math.abs(c),m=l+Math.abs(f),g=u&&this.shadowBlur()||0,v=p+g*2,x=m+g*2,C={width:v,height:x,x:-(a/2+g)+Math.min(c,0)+i.x,y:-(a/2+g)+Math.min(f,0)+i.y};return n?C:this._transformedRect(C,r)}drawScene(t,n){var r=this.getLayer(),i=t||r.getCanvas(),o=i.getContext(),a=this._getCanvasCache(),s=this.getSceneFunc(),l=this.hasShadow(),u,c,f,p=i.isCache,m=n===this;if(!this.isVisible()&&!m)return this;if(a){o.save();var g=this.getAbsoluteTransform(n).getMatrix();return o.transform(g[0],g[1],g[2],g[3],g[4],g[5]),this._drawCachedSceneCanvas(o),o.restore(),this}if(!s)return this;if(o.save(),this._useBufferCanvas()&&!p){u=this.getStage(),c=u.bufferCanvas,f=c.getContext(),f.clear(),f.save(),f._applyLineJoin(this);var v=this.getAbsoluteTransform(n).getMatrix();f.transform(v[0],v[1],v[2],v[3],v[4],v[5]),s.call(this,f,this),f.restore();var x=c.pixelRatio;l&&o._applyShadow(this),o._applyOpacity(this),o._applyGlobalCompositeOperation(this),o.drawImage(c._canvas,0,0,c.width/x,c.height/x)}else{if(o._applyLineJoin(this),!m){var v=this.getAbsoluteTransform(n).getMatrix();o.transform(v[0],v[1],v[2],v[3],v[4],v[5]),o._applyOpacity(this),o._applyGlobalCompositeOperation(this)}l&&o._applyShadow(this),s.call(this,o,this)}return o.restore(),this}drawHit(t,n,r=!1){if(!this.shouldDrawHit(n,r))return this;var i=this.getLayer(),o=t||i.hitCanvas,a=o&&o.getContext(),s=this.hitFunc()||this.sceneFunc(),l=this._getCanvasCache(),u=l&&l.hit;if(this.colorKey||te.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),u){a.save();var c=this.getAbsoluteTransform(n).getMatrix();return a.transform(c[0],c[1],c[2],c[3],c[4],c[5]),this._drawCachedHitCanvas(a),a.restore(),this}if(!s)return this;if(a.save(),a._applyLineJoin(this),!(this===n)){var p=this.getAbsoluteTransform(n).getMatrix();a.transform(p[0],p[1],p[2],p[3],p[4],p[5])}return s.call(this,a,this),a.restore(),this}drawHitFromCache(t=0){var n=this._getCanvasCache(),r=this._getCachedSceneCanvas(),i=n.hit,o=i.getContext(),a=i.getWidth(),s=i.getHeight(),l,u,c,f,p,m;o.clear(),o.drawImage(r._canvas,0,0,a,s);try{for(l=o.getImageData(0,0,a,s),u=l.data,c=u.length,f=te._hexToRgb(this.colorKey),p=0;pt?(u[p]=f.r,u[p+1]=f.g,u[p+2]=f.b,u[p+3]=255):u[p+3]=0;o.putImageData(l,0,0)}catch(g){te.error("Unable to draw hit graph from cached scene canvas. "+g.message)}return this}hasPointerCapture(t){return ZW(t,this)}setPointerCapture(t){QW(t,this)}releaseCapture(t){qm(t)}}ye.prototype._fillFunc=zEe;ye.prototype._strokeFunc=jEe;ye.prototype._fillFuncHit=HEe;ye.prototype._strokeFuncHit=VEe;ye.prototype._centroid=!1;ye.prototype.nodeType="Shape";Vn(ye);ye.prototype.eventListeners={};ye.prototype.on.call(ye.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",UEe);ye.prototype.on.call(ye.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",WEe);ye.prototype.on.call(ye.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",GEe);ye.prototype.on.call(ye.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",KEe);ye.prototype.on.call(ye.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",YEe);K.addGetterSetter(ye,"stroke",void 0,qW());K.addGetterSetter(ye,"strokeWidth",2,Pe());K.addGetterSetter(ye,"fillAfterStrokeEnabled",!1);K.addGetterSetter(ye,"hitStrokeWidth","auto",K_());K.addGetterSetter(ye,"strokeHitEnabled",!0,ha());K.addGetterSetter(ye,"perfectDrawEnabled",!0,ha());K.addGetterSetter(ye,"shadowForStrokeEnabled",!0,ha());K.addGetterSetter(ye,"lineJoin");K.addGetterSetter(ye,"lineCap");K.addGetterSetter(ye,"sceneFunc");K.addGetterSetter(ye,"hitFunc");K.addGetterSetter(ye,"dash");K.addGetterSetter(ye,"dashOffset",0,Pe());K.addGetterSetter(ye,"shadowColor",void 0,qh());K.addGetterSetter(ye,"shadowBlur",0,Pe());K.addGetterSetter(ye,"shadowOpacity",1,Pe());K.addComponentsGetterSetter(ye,"shadowOffset",["x","y"]);K.addGetterSetter(ye,"shadowOffsetX",0,Pe());K.addGetterSetter(ye,"shadowOffsetY",0,Pe());K.addGetterSetter(ye,"fillPatternImage");K.addGetterSetter(ye,"fill",void 0,qW());K.addGetterSetter(ye,"fillPatternX",0,Pe());K.addGetterSetter(ye,"fillPatternY",0,Pe());K.addGetterSetter(ye,"fillLinearGradientColorStops");K.addGetterSetter(ye,"strokeLinearGradientColorStops");K.addGetterSetter(ye,"fillRadialGradientStartRadius",0);K.addGetterSetter(ye,"fillRadialGradientEndRadius",0);K.addGetterSetter(ye,"fillRadialGradientColorStops");K.addGetterSetter(ye,"fillPatternRepeat","repeat");K.addGetterSetter(ye,"fillEnabled",!0);K.addGetterSetter(ye,"strokeEnabled",!0);K.addGetterSetter(ye,"shadowEnabled",!0);K.addGetterSetter(ye,"dashEnabled",!0);K.addGetterSetter(ye,"strokeScaleEnabled",!0);K.addGetterSetter(ye,"fillPriority","color");K.addComponentsGetterSetter(ye,"fillPatternOffset",["x","y"]);K.addGetterSetter(ye,"fillPatternOffsetX",0,Pe());K.addGetterSetter(ye,"fillPatternOffsetY",0,Pe());K.addComponentsGetterSetter(ye,"fillPatternScale",["x","y"]);K.addGetterSetter(ye,"fillPatternScaleX",1,Pe());K.addGetterSetter(ye,"fillPatternScaleY",1,Pe());K.addComponentsGetterSetter(ye,"fillLinearGradientStartPoint",["x","y"]);K.addComponentsGetterSetter(ye,"strokeLinearGradientStartPoint",["x","y"]);K.addGetterSetter(ye,"fillLinearGradientStartPointX",0);K.addGetterSetter(ye,"strokeLinearGradientStartPointX",0);K.addGetterSetter(ye,"fillLinearGradientStartPointY",0);K.addGetterSetter(ye,"strokeLinearGradientStartPointY",0);K.addComponentsGetterSetter(ye,"fillLinearGradientEndPoint",["x","y"]);K.addComponentsGetterSetter(ye,"strokeLinearGradientEndPoint",["x","y"]);K.addGetterSetter(ye,"fillLinearGradientEndPointX",0);K.addGetterSetter(ye,"strokeLinearGradientEndPointX",0);K.addGetterSetter(ye,"fillLinearGradientEndPointY",0);K.addGetterSetter(ye,"strokeLinearGradientEndPointY",0);K.addComponentsGetterSetter(ye,"fillRadialGradientStartPoint",["x","y"]);K.addGetterSetter(ye,"fillRadialGradientStartPointX",0);K.addGetterSetter(ye,"fillRadialGradientStartPointY",0);K.addComponentsGetterSetter(ye,"fillRadialGradientEndPoint",["x","y"]);K.addGetterSetter(ye,"fillRadialGradientEndPointX",0);K.addGetterSetter(ye,"fillRadialGradientEndPointY",0);K.addGetterSetter(ye,"fillPatternRotation",0);K.backCompat(ye,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});var qEe="#",XEe="beforeDraw",ZEe="draw",pG=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],QEe=pG.length;let ed=class extends Ki{constructor(t){super(t),this.canvas=new eh,this.hitCanvas=new Y_({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(t){return this.getContext().clear(t),this.getHitCanvas().getContext().clear(t),this}setZIndex(t){super.setZIndex(t);var n=this.getStage();return n&&n.content&&(n.content.removeChild(this.getNativeCanvasElement()),t{this.draw(),this._waitingForDraw=!1})),this}getIntersection(t){if(!this.isListening()||!this.isVisible())return null;for(var n=1,r=!1;;){for(let i=0;i0)return{antialiased:!0};return{}}drawScene(t,n){var r=this.getLayer(),i=t||r&&r.getCanvas();return this._fire(XEe,{node:this}),this.clearBeforeDraw()&&i.getContext().clear(),Ki.prototype.drawScene.call(this,i,n),this._fire(ZEe,{node:this}),this}drawHit(t,n){var r=this.getLayer(),i=t||r&&r.hitCanvas;return r&&r.clearBeforeDraw()&&r.getHitCanvas().getContext().clear(),Ki.prototype.drawHit.call(this,i,n),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){te.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return te.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!(!this.parent||!this.parent.content)){var t=this.parent,n=!!this.hitCanvas._canvas.parentNode;n?t.content.removeChild(this.hitCanvas._canvas):t.content.appendChild(this.hitCanvas._canvas)}}destroy(){return te.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};ed.prototype.nodeType="Layer";Vn(ed);K.addGetterSetter(ed,"imageSmoothingEnabled",!0);K.addGetterSetter(ed,"clearBeforeDraw",!0);K.addGetterSetter(ed,"hitGraphEnabled",!0,ha());class X_ extends ed{constructor(t){super(t),this.listening(!1),te.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}X_.prototype.nodeType="FastLayer";Vn(X_);let Sh=class extends Ki{_validateAdd(t){var n=t.getType();n!=="Group"&&n!=="Shape"&&te.throw("You may only add groups and shapes to groups.")}};Sh.prototype.nodeType="Group";Vn(Sh);var Hw=function(){return Jf.performance&&Jf.performance.now?function(){return Jf.performance.now()}:function(){return new Date().getTime()}}();class yo{constructor(t,n){this.id=yo.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:Hw(),frameRate:0},this.func=t,this.setLayers(n)}setLayers(t){var n=[];return t?t.length>0?n=t:n=[t]:n=[],this.layers=n,this}getLayers(){return this.layers}addLayer(t){var n=this.layers,r=n.length,i;for(i=0;ithis.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():t<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=t,this.update())}getTime(){return this._time}setPosition(t){this.prevPos=this._pos,this.propFunc(t),this._pos=t}getPosition(t){return t===void 0&&(t=this._time),this.func(t,this.begin,this._change,this.duration)}play(){this.state=UI,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=WI,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(t){this.pause(),this._time=t,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){var t=this.getTimer()-this._startTime;this.state===UI?this.setTime(t):this.state===WI&&this.setTime(this.duration-t)}pause(){this.state=ePe,this.fire("onPause")}getTimer(){return new Date().getTime()}}class Zn{constructor(t){var n=this,r=t.node,i=r._id,o,a=t.easing||Zm.Linear,s=!!t.yoyo,l;typeof t.duration>"u"?o=.3:t.duration===0?o=.001:o=t.duration,this.node=r,this._id=tPe++;var u=r.getLayer()||(r instanceof Ve.Stage?r.getLayers():null);u||te.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new yo(function(){n.tween.onEnterFrame()},u),this.tween=new nPe(l,function(c){n._tweenFunc(c)},a,0,1,o*1e3,s),this._addListeners(),Zn.attrs[i]||(Zn.attrs[i]={}),Zn.attrs[i][this._id]||(Zn.attrs[i][this._id]={}),Zn.tweens[i]||(Zn.tweens[i]={});for(l in t)JEe[l]===void 0&&this._addAttr(l,t[l]);this.reset(),this.onFinish=t.onFinish,this.onReset=t.onReset,this.onUpdate=t.onUpdate}_addAttr(t,n){var r=this.node,i=r._id,o,a,s,l,u,c,f,p;if(s=Zn.tweens[i][t],s&&delete Zn.attrs[i][s][t],o=r.getAttr(t),te._isArray(n))if(a=[],u=Math.max(n.length,o.length),t==="points"&&n.length!==o.length&&(n.length>o.length?(f=o,o=te._prepareArrayForTween(o,n,r.closed())):(c=n,n=te._prepareArrayForTween(n,o,r.closed()))),t.indexOf("fill")===0)for(l=0;l{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var t=this.node,n=Zn.attrs[t._id][this._id];n.points&&n.points.trueEnd&&t.setAttr("points",n.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var t=this.node,n=Zn.attrs[t._id][this._id];n.points&&n.points.trueStart&&t.points(n.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(t){return this.tween.seek(t*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){var t=this.node._id,n=this._id,r=Zn.tweens[t],i;this.pause();for(i in r)delete Zn.tweens[t][i];delete Zn.attrs[t][n]}}Zn.attrs={};Zn.tweens={};Oe.prototype.to=function(e){var t=e.onFinish;e.node=this,e.onFinish=function(){this.destroy(),t&&t()};var n=new Zn(e);n.play()};const Zm={BackEaseIn(e,t,n,r){var i=1.70158;return n*(e/=r)*e*((i+1)*e-i)+t},BackEaseOut(e,t,n,r){var i=1.70158;return n*((e=e/r-1)*e*((i+1)*e+i)+1)+t},BackEaseInOut(e,t,n,r){var i=1.70158;return(e/=r/2)<1?n/2*(e*e*(((i*=1.525)+1)*e-i))+t:n/2*((e-=2)*e*(((i*=1.525)+1)*e+i)+2)+t},ElasticEaseIn(e,t,n,r,i,o){var a=0;return e===0?t:(e/=r)===1?t+n:(o||(o=r*.3),!i||i0?t:n),c=a*n,f=s*(s>0?t:n),p=l*(l>0?n:t);return{x:u,y:r?-1*p:f,width:c-u,height:p-f}}}qs.prototype._centroid=!0;qs.prototype.className="Arc";qs.prototype._attrsAffectingSize=["innerRadius","outerRadius"];Vn(qs);K.addGetterSetter(qs,"innerRadius",0,Pe());K.addGetterSetter(qs,"outerRadius",0,Pe());K.addGetterSetter(qs,"angle",0,Pe());K.addGetterSetter(qs,"clockwise",!1,ha());function qx(e,t,n,r,i,o,a){var s=Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2)),l=Math.sqrt(Math.pow(i-n,2)+Math.pow(o-r,2)),u=a*s/(s+l),c=a*l/(s+l),f=n-u*(i-e),p=r-u*(o-t),m=n+c*(i-e),g=r+c*(o-t);return[f,p,m,g]}function KI(e,t){var n=e.length,r=[],i,o;for(i=2;i4){for(s=this.getTensionPoints(),l=s.length,u=o?0:4,o||t.quadraticCurveTo(s[0],s[1],s[2],s[3]);uc?u:c,x=u>c?1:u/c,C=u>c?c/u:1;t.translate(s,l),t.rotate(m),t.scale(x,C),t.arc(0,0,v,f,f+p,1-g),t.scale(1/x,1/C),t.rotate(-m),t.translate(-s,-l);break;case"z":r=!0,t.closePath();break}}!r&&!this.hasFill()?t.strokeShape(this):t.fillStrokeShape(this)}getSelfRect(){var t=[];this.dataArray.forEach(function(u){if(u.command==="A"){var c=u.points[4],f=u.points[5],p=u.points[4]+f,m=Math.PI/180;if(Math.abs(c-p)p;g-=m){const v=nn.getPointOnEllipticalArc(u.points[0],u.points[1],u.points[2],u.points[3],g,0);t.push(v.x,v.y)}else for(let g=c+m;gthis.dataArray[r].pathLength;)t-=this.dataArray[r].pathLength,++r;if(r===i)return n=this.dataArray[r-1].points.slice(-2),{x:n[0],y:n[1]};if(t<.01)return n=this.dataArray[r].points.slice(0,2),{x:n[0],y:n[1]};var o=this.dataArray[r],a=o.points;switch(o.command){case"L":return nn.getPointOnLine(t,o.start.x,o.start.y,a[0],a[1]);case"C":return nn.getPointOnCubicBezier(t/o.pathLength,o.start.x,o.start.y,a[0],a[1],a[2],a[3],a[4],a[5]);case"Q":return nn.getPointOnQuadraticBezier(t/o.pathLength,o.start.x,o.start.y,a[0],a[1],a[2],a[3]);case"A":var s=a[0],l=a[1],u=a[2],c=a[3],f=a[4],p=a[5],m=a[6];return f+=p*t/o.pathLength,nn.getPointOnEllipticalArc(s,l,u,c,f,m)}return null}static getLineLength(t,n,r,i){return Math.sqrt((r-t)*(r-t)+(i-n)*(i-n))}static getPointOnLine(t,n,r,i,o,a,s){a===void 0&&(a=n),s===void 0&&(s=r);var l=(o-r)/(i-n+1e-8),u=Math.sqrt(t*t/(1+l*l));i0&&!isNaN(g[0]);){var w=null,k=[],P=l,L=u,A,O,I,$,D,V,Y,z,R,N;switch(m){case"l":l+=g.shift(),u+=g.shift(),w="L",k.push(l,u);break;case"L":l=g.shift(),u=g.shift(),k.push(l,u);break;case"m":var U=g.shift(),G=g.shift();if(l+=U,u+=G,w="M",a.length>2&&a[a.length-1].command==="z"){for(var B=a.length-2;B>=0;B--)if(a[B].command==="M"){l=a[B].points[0]+U,u=a[B].points[1]+G;break}}k.push(l,u),m="l";break;case"M":l=g.shift(),u=g.shift(),w="M",k.push(l,u),m="L";break;case"h":l+=g.shift(),w="L",k.push(l,u);break;case"H":l=g.shift(),w="L",k.push(l,u);break;case"v":u+=g.shift(),w="L",k.push(l,u);break;case"V":u=g.shift(),w="L",k.push(l,u);break;case"C":k.push(g.shift(),g.shift(),g.shift(),g.shift()),l=g.shift(),u=g.shift(),k.push(l,u);break;case"c":k.push(l+g.shift(),u+g.shift(),l+g.shift(),u+g.shift()),l+=g.shift(),u+=g.shift(),w="C",k.push(l,u);break;case"S":O=l,I=u,A=a[a.length-1],A.command==="C"&&(O=l+(l-A.points[2]),I=u+(u-A.points[3])),k.push(O,I,g.shift(),g.shift()),l=g.shift(),u=g.shift(),w="C",k.push(l,u);break;case"s":O=l,I=u,A=a[a.length-1],A.command==="C"&&(O=l+(l-A.points[2]),I=u+(u-A.points[3])),k.push(O,I,l+g.shift(),u+g.shift()),l+=g.shift(),u+=g.shift(),w="C",k.push(l,u);break;case"Q":k.push(g.shift(),g.shift()),l=g.shift(),u=g.shift(),k.push(l,u);break;case"q":k.push(l+g.shift(),u+g.shift()),l+=g.shift(),u+=g.shift(),w="Q",k.push(l,u);break;case"T":O=l,I=u,A=a[a.length-1],A.command==="Q"&&(O=l+(l-A.points[0]),I=u+(u-A.points[1])),l=g.shift(),u=g.shift(),w="Q",k.push(O,I,l,u);break;case"t":O=l,I=u,A=a[a.length-1],A.command==="Q"&&(O=l+(l-A.points[0]),I=u+(u-A.points[1])),l+=g.shift(),u+=g.shift(),w="Q",k.push(O,I,l,u);break;case"A":$=g.shift(),D=g.shift(),V=g.shift(),Y=g.shift(),z=g.shift(),R=l,N=u,l=g.shift(),u=g.shift(),w="A",k=this.convertEndpointToCenterParameterization(R,N,l,u,Y,z,$,D,V);break;case"a":$=g.shift(),D=g.shift(),V=g.shift(),Y=g.shift(),z=g.shift(),R=l,N=u,l+=g.shift(),u+=g.shift(),w="A",k=this.convertEndpointToCenterParameterization(R,N,l,u,Y,z,$,D,V);break}a.push({command:w||m,points:k,start:{x:P,y:L},pathLength:this.calcLength(P,L,w||m,k)})}(m==="z"||m==="Z")&&a.push({command:"z",points:[],start:void 0,pathLength:0})}return a}static calcLength(t,n,r,i){var o,a,s,l,u=nn;switch(r){case"L":return u.getLineLength(t,n,i[0],i[1]);case"C":for(o=0,a=u.getPointOnCubicBezier(0,t,n,i[0],i[1],i[2],i[3],i[4],i[5]),l=.01;l<=1;l+=.01)s=u.getPointOnCubicBezier(l,t,n,i[0],i[1],i[2],i[3],i[4],i[5]),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;return o;case"Q":for(o=0,a=u.getPointOnQuadraticBezier(0,t,n,i[0],i[1],i[2],i[3]),l=.01;l<=1;l+=.01)s=u.getPointOnQuadraticBezier(l,t,n,i[0],i[1],i[2],i[3]),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;return o;case"A":o=0;var c=i[4],f=i[5],p=i[4]+f,m=Math.PI/180;if(Math.abs(c-p)p;l-=m)s=u.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],l,0),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;else for(l=c+m;l1&&(s*=Math.sqrt(m),l*=Math.sqrt(m));var g=Math.sqrt((s*s*(l*l)-s*s*(p*p)-l*l*(f*f))/(s*s*(p*p)+l*l*(f*f)));o===a&&(g*=-1),isNaN(g)&&(g=0);var v=g*s*p/l,x=g*-l*f/s,C=(t+r)/2+Math.cos(c)*v-Math.sin(c)*x,w=(n+i)/2+Math.sin(c)*v+Math.cos(c)*x,k=function(D){return Math.sqrt(D[0]*D[0]+D[1]*D[1])},P=function(D,V){return(D[0]*V[0]+D[1]*V[1])/(k(D)*k(V))},L=function(D,V){return(D[0]*V[1]=1&&($=0),a===0&&$>0&&($=$-2*Math.PI),a===1&&$<0&&($=$+2*Math.PI),[C,w,s,l,A,$,c,a]}}nn.prototype.className="Path";nn.prototype._attrsAffectingSize=["data"];Vn(nn);K.addGetterSetter(nn,"data");class td extends Xs{_sceneFunc(t){super._sceneFunc(t);var n=Math.PI*2,r=this.points(),i=r,o=this.tension()!==0&&r.length>4;o&&(i=this.getTensionPoints());var a=this.pointerLength(),s=r.length,l,u;if(o){const p=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],r[s-2],r[s-1]],m=nn.calcLength(i[i.length-4],i[i.length-3],"C",p),g=nn.getPointOnQuadraticBezier(Math.min(1,1-a/m),p[0],p[1],p[2],p[3],p[4],p[5]);l=r[s-2]-g.x,u=r[s-1]-g.y}else l=r[s-2]-r[s-4],u=r[s-1]-r[s-3];var c=(Math.atan2(u,l)+n)%n,f=this.pointerWidth();this.pointerAtEnding()&&(t.save(),t.beginPath(),t.translate(r[s-2],r[s-1]),t.rotate(c),t.moveTo(0,0),t.lineTo(-a,f/2),t.lineTo(-a,-f/2),t.closePath(),t.restore(),this.__fillStroke(t)),this.pointerAtBeginning()&&(t.save(),t.beginPath(),t.translate(r[0],r[1]),o?(l=(i[0]+i[2])/2-r[0],u=(i[1]+i[3])/2-r[1]):(l=r[2]-r[0],u=r[3]-r[1]),t.rotate((Math.atan2(-u,-l)+n)%n),t.moveTo(0,0),t.lineTo(-a,f/2),t.lineTo(-a,-f/2),t.closePath(),t.restore(),this.__fillStroke(t))}__fillStroke(t){var n=this.dashEnabled();n&&(this.attrs.dashEnabled=!1,t.setLineDash([])),t.fillStrokeShape(this),n&&(this.attrs.dashEnabled=!0)}getSelfRect(){const t=super.getSelfRect(),n=this.pointerWidth()/2;return{x:t.x-n,y:t.y-n,width:t.width+n*2,height:t.height+n*2}}}td.prototype.className="Arrow";Vn(td);K.addGetterSetter(td,"pointerLength",10,Pe());K.addGetterSetter(td,"pointerWidth",10,Pe());K.addGetterSetter(td,"pointerAtBeginning",!1);K.addGetterSetter(td,"pointerAtEnding",!0);let Xh=class extends ye{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius()!==t/2&&this.radius(t/2)}setHeight(t){this.radius()!==t/2&&this.radius(t/2)}};Xh.prototype._centroid=!0;Xh.prototype.className="Circle";Xh.prototype._attrsAffectingSize=["radius"];Vn(Xh);K.addGetterSetter(Xh,"radius",0,Pe());class ku extends ye{_sceneFunc(t){var n=this.radiusX(),r=this.radiusY();t.beginPath(),t.save(),n!==r&&t.scale(1,r/n),t.arc(0,0,n,0,Math.PI*2,!1),t.restore(),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(t){this.radiusX(t/2)}setHeight(t){this.radiusY(t/2)}}ku.prototype.className="Ellipse";ku.prototype._centroid=!0;ku.prototype._attrsAffectingSize=["radiusX","radiusY"];Vn(ku);K.addComponentsGetterSetter(ku,"radius",["x","y"]);K.addGetterSetter(ku,"radiusX",0,Pe());K.addGetterSetter(ku,"radiusY",0,Pe());let Zs=class mG extends ye{constructor(t){super(t),this.on("imageChange.konva",()=>{this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const t=this.image();t&&t.complete||t&&t.readyState===4||t&&t.addEventListener&&t.addEventListener("load",()=>{this._requestDraw()})}_useBufferCanvas(){return super._useBufferCanvas(!0)}_sceneFunc(t){const n=this.getWidth(),r=this.getHeight(),i=this.attrs.image;let o;if(i){const a=this.attrs.cropWidth,s=this.attrs.cropHeight;a&&s?o=[i,this.cropX(),this.cropY(),a,s,0,0,n,r]:o=[i,0,0,n,r]}(this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)),i&&t.drawImage.apply(t,o)}_hitFunc(t){var n=this.width(),r=this.height();t.beginPath(),t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)}getWidth(){var t,n;return(t=this.attrs.width)!==null&&t!==void 0?t:(n=this.image())===null||n===void 0?void 0:n.width}getHeight(){var t,n;return(t=this.attrs.height)!==null&&t!==void 0?t:(n=this.image())===null||n===void 0?void 0:n.height}static fromURL(t,n,r=null){var i=te.createImageElement();i.onload=function(){var o=new mG({image:i});n(o)},i.onerror=r,i.crossOrigin="Anonymous",i.src=t}};Zs.prototype.className="Image";Vn(Zs);K.addGetterSetter(Zs,"image");K.addComponentsGetterSetter(Zs,"crop",["x","y","width","height"]);K.addGetterSetter(Zs,"cropX",0,Pe());K.addGetterSetter(Zs,"cropY",0,Pe());K.addGetterSetter(Zs,"cropWidth",0,Pe());K.addGetterSetter(Zs,"cropHeight",0,Pe());var gG=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],rPe="Change.konva",iPe="none",Xx="up",Zx="right",Qx="down",Jx="left",oPe=gG.length;class Z_ extends Sh{constructor(t){super(t),this.on("add.konva",function(n){this._addListeners(n.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(t){var n=this,r,i=function(){n._sync()};for(r=0;r{n=Math.min(n,a.x),r=Math.max(r,a.x),i=Math.min(i,a.y),o=Math.max(o,a.y)}),{x:n,y:i,width:r-n,height:o-i}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}rd.prototype.className="RegularPolygon";rd.prototype._centroid=!0;rd.prototype._attrsAffectingSize=["radius"];Vn(rd);K.addGetterSetter(rd,"radius",0,Pe());K.addGetterSetter(rd,"sides",0,Pe());var YI=Math.PI*2;class id extends ye{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.innerRadius(),0,YI,!1),t.moveTo(this.outerRadius(),0),t.arc(0,0,this.outerRadius(),YI,0,!0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}}id.prototype.className="Ring";id.prototype._centroid=!0;id.prototype._attrsAffectingSize=["innerRadius","outerRadius"];Vn(id);K.addGetterSetter(id,"innerRadius",0,Pe());K.addGetterSetter(id,"outerRadius",0,Pe());class fs extends ye{constructor(t){super(t),this._updated=!0,this.anim=new yo(()=>{var n=this._updated;return this._updated=!1,n}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(t){var n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],a=this.frameOffsets(),s=o[i+0],l=o[i+1],u=o[i+2],c=o[i+3],f=this.image();if((this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,u,c),t.closePath(),t.fillStrokeShape(this)),f)if(a){var p=a[n],m=r*2;t.drawImage(f,s,l,u,c,p[m+0],p[m+1],u,c)}else t.drawImage(f,s,l,u,c,0,0,u,c)}_hitFunc(t){var n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],a=this.frameOffsets(),s=o[i+2],l=o[i+3];if(t.beginPath(),a){var u=a[n],c=r*2;t.rect(u[c+0],u[c+1],s,l)}else t.rect(0,0,s,l);t.closePath(),t.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){var t=this;this.interval=setInterval(function(){t._updateIndex()},1e3/this.frameRate())}start(){if(!this.isRunning()){var t=this.getLayer();this.anim.setLayers(t),this._setInterval(),this.anim.start()}}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){var t=this.frameIndex(),n=this.animation(),r=this.animations(),i=r[n],o=i.length/4;t{t=t.trim();const n=t.indexOf(" ")>=0,r=t.indexOf('"')>=0||t.indexOf("'")>=0;return n&&!r&&(t=`"${t}"`),t}).join(", ")}var Vv;function Uw(){return Vv||(Vv=te.createCanvasElement().getContext(lPe),Vv)}function bPe(e){e.fillText(this._partialText,this._partialTextX,this._partialTextY)}function SPe(e){e.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function wPe(e){return e=e||{},!e.fillLinearGradientColorStops&&!e.fillRadialGradientColorStops&&!e.fillPatternImage&&(e.fill=e.fill||"black"),e}class Hn extends ye{constructor(t){super(wPe(t)),this._partialTextX=0,this._partialTextY=0;for(var n=0;n1&&(C+=a)}}}_hitFunc(t){var n=this.getWidth(),r=this.getHeight();t.beginPath(),t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)}setText(t){var n=te._isString(t)?t:t==null?"":t+"";return this._setAttr(uPe,n),this}getWidth(){var t=this.attrs.width===Kd||this.attrs.width===void 0;return t?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){var t=this.attrs.height===Kd||this.attrs.height===void 0;return t?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return te.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(t){var n=Uw(),r=this.fontSize(),i;return n.save(),n.font=this._getContextFont(),i=n.measureText(t),n.restore(),{width:i.width,height:r}}_getContextFont(){return this.fontStyle()+Hv+this.fontVariant()+Hv+(this.fontSize()+hPe)+yPe(this.fontFamily())}_addTextLine(t){this.align()===Jp&&(t=t.trim());var n=this._getTextWidth(t);return this.textArr.push({text:t,width:n,lastInParagraph:!1})}_getTextWidth(t){var n=this.letterSpacing(),r=t.length;return Uw().measureText(t).width+(r?n*(r-1):0)}_setTextData(){var t=this.text().split(` -`),n=+this.fontSize(),r=0,i=this.lineHeight()*n,o=this.attrs.width,a=this.attrs.height,s=o!==Kd&&o!==void 0,l=a!==Kd&&a!==void 0,u=this.padding(),c=o-u*2,f=a-u*2,p=0,m=this.wrap(),g=m!==ZI,v=m!==gPe&&g,x=this.ellipsis();this.textArr=[],Uw().font=this._getContextFont();for(var C=x?this._getTextWidth(Vw):0,w=0,k=t.length;wc)for(;P.length>0;){for(var A=0,O=P.length,I="",$=0;A>>1,V=P.slice(0,D+1),Y=this._getTextWidth(V)+C;Y<=c?(A=D+1,I=V,$=Y):O=D}if(I){if(v){var z,R=P[I.length],N=R===Hv||R===qI;N&&$<=c?z=I.length:z=Math.max(I.lastIndexOf(Hv),I.lastIndexOf(qI))+1,z>0&&(A=z,I=I.slice(0,A),$=this._getTextWidth(I))}I=I.trimRight(),this._addTextLine(I),r=Math.max(r,$),p+=i;var U=this._shouldHandleEllipsis(p);if(U){this._tryToAddEllipsisToLastLine();break}if(P=P.slice(A),P=P.trimLeft(),P.length>0&&(L=this._getTextWidth(P),L<=c)){this._addTextLine(P),p+=i,r=Math.max(r,L);break}}else break}else this._addTextLine(P),p+=i,r=Math.max(r,L),this._shouldHandleEllipsis(p)&&wf)break;this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0)}this.textHeight=n,this.textWidth=r}_shouldHandleEllipsis(t){var n=+this.fontSize(),r=this.lineHeight()*n,i=this.attrs.height,o=i!==Kd&&i!==void 0,a=this.padding(),s=i-a*2,l=this.wrap(),u=l!==ZI;return!u||o&&t+r>s}_tryToAddEllipsisToLastLine(){var t=this.attrs.width,n=t!==Kd&&t!==void 0,r=this.padding(),i=t-r*2,o=this.ellipsis(),a=this.textArr[this.textArr.length-1];if(!(!a||!o)){if(n){var s=this._getTextWidth(a.text+Vw)=1){var r=n[0].p0;t.moveTo(r.x,r.y)}for(var i=0;i0&&(s+=t.dataArray[l].pathLength);var u=0;i==="center"&&(u=Math.max(0,s/2-a/2)),i==="right"&&(u=Math.max(0,s-a));for(var c=vG(this.text()),f=this.text().split(" ").length-1,p,m,g,v=-1,x=0,C=function(){x=0;for(var Y=t.dataArray,z=v+1;z0)return v=z,Y[z];Y[z].command==="M"&&(p={x:Y[z].points[0],y:Y[z].points[1]})}return{}},w=function(Y){var z=t._getTextSize(Y).width+r;Y===" "&&i==="justify"&&(z+=(s-a)/f);var R=0,N=0;for(m=void 0;Math.abs(z-R)/z>.01&&N<20;){N++;for(var U=R;g===void 0;)g=C(),g&&U+g.pathLengthz?m=nn.getPointOnLine(z,p.x,p.y,g.points[0],g.points[1],p.x,p.y):g=void 0;break;case"A":var B=g.points[4],W=g.points[5],X=g.points[4]+W;x===0?x=B+1e-8:z>R?x+=Math.PI/180*W/Math.abs(W):x-=Math.PI/360*W/Math.abs(W),(W<0&&x=0&&x>X)&&(x=X,G=!0),m=nn.getPointOnEllipticalArc(g.points[0],g.points[1],g.points[2],g.points[3],x,g.points[6]);break;case"C":x===0?z>g.pathLength?x=1e-8:x=z/g.pathLength:z>R?x+=(z-R)/g.pathLength/2:x=Math.max(x-(R-z)/g.pathLength/2,0),x>1&&(x=1,G=!0),m=nn.getPointOnCubicBezier(x,g.start.x,g.start.y,g.points[0],g.points[1],g.points[2],g.points[3],g.points[4],g.points[5]);break;case"Q":x===0?x=z/g.pathLength:z>R?x+=(z-R)/g.pathLength:x-=(R-z)/g.pathLength,x>1&&(x=1,G=!0),m=nn.getPointOnQuadraticBezier(x,g.start.x,g.start.y,g.points[0],g.points[1],g.points[2],g.points[3]);break}m!==void 0&&(R=nn.getLineLength(p.x,p.y,m.x,m.y)),G&&(G=!1,g=void 0)}},k="C",P=t._getTextSize(k).width+r,L=u/P-1,A=0;Ae+`.${_G}`).join(" "),QI="nodesRect",_Pe=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],kPe={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135};const EPe="ontouchstart"in Ve._global;function PPe(e,t){if(e==="rotater")return"crosshair";t+=te.degToRad(kPe[e]||0);var n=(te.radToDeg(t)%360+360)%360;return te._inRange(n,315+22.5,360)||te._inRange(n,0,22.5)?"ns-resize":te._inRange(n,45-22.5,45+22.5)?"nesw-resize":te._inRange(n,90-22.5,90+22.5)?"ew-resize":te._inRange(n,135-22.5,135+22.5)?"nwse-resize":te._inRange(n,180-22.5,180+22.5)?"ns-resize":te._inRange(n,225-22.5,225+22.5)?"nesw-resize":te._inRange(n,270-22.5,270+22.5)?"ew-resize":te._inRange(n,315-22.5,315+22.5)?"nwse-resize":(te.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}var ab=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"],JI=1e8;function TPe(e){return{x:e.x+e.width/2*Math.cos(e.rotation)+e.height/2*Math.sin(-e.rotation),y:e.y+e.height/2*Math.cos(e.rotation)+e.width/2*Math.sin(e.rotation)}}function kG(e,t,n){const r=n.x+(e.x-n.x)*Math.cos(t)-(e.y-n.y)*Math.sin(t),i=n.y+(e.x-n.x)*Math.sin(t)+(e.y-n.y)*Math.cos(t);return Object.assign(Object.assign({},e),{rotation:e.rotation+t,x:r,y:i})}function LPe(e,t){const n=TPe(e);return kG(e,t,n)}function APe(e,t,n){let r=t;for(let i=0;i{const i=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()},o=r._attrsAffectingSize.map(a=>a+"Change."+this._getEventNamespace()).join(" ");r.on(o,i),r.on(_Pe.map(a=>a+`.${this._getEventNamespace()}`).join(" "),i),r.on(`absoluteTransformChange.${this._getEventNamespace()}`,i),this._proxyDrag(r)}),this._resetTransformCache();var n=!!this.findOne(".top-left");return n&&this.update(),this}_proxyDrag(t){let n;t.on(`dragstart.${this._getEventNamespace()}`,r=>{n=t.getAbsolutePosition(),!this.isDragging()&&t!==this.findOne(".back")&&this.startDrag(r,!1)}),t.on(`dragmove.${this._getEventNamespace()}`,r=>{if(!n)return;const i=t.getAbsolutePosition(),o=i.x-n.x,a=i.y-n.y;this.nodes().forEach(s=>{if(s===t||s.isDragging())return;const l=s.getAbsolutePosition();s.setAbsolutePosition({x:l.x+o,y:l.y+a}),s.startDrag(r)}),n=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(t=>{t.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(QI),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(QI,this.__getNodeRect)}__getNodeShape(t,n=this.rotation(),r){var i=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),o=t.getAbsoluteScale(r),a=t.getAbsolutePosition(r),s=i.x*o.x-t.offsetX()*o.x,l=i.y*o.y-t.offsetY()*o.y;const u=(Ve.getAngle(t.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),c={x:a.x+s*Math.cos(u)+l*Math.sin(-u),y:a.y+l*Math.cos(u)+s*Math.sin(u),width:i.width*o.x,height:i.height*o.y,rotation:u};return kG(c,-Ve.getAngle(n),{x:0,y:0})}__getNodeRect(){var t=this.getNode();if(!t)return{x:-JI,y:-JI,width:0,height:0,rotation:0};const n=[];this.nodes().map(u=>{const c=u.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var f=[{x:c.x,y:c.y},{x:c.x+c.width,y:c.y},{x:c.x+c.width,y:c.y+c.height},{x:c.x,y:c.y+c.height}],p=u.getAbsoluteTransform();f.forEach(function(m){var g=p.point(m);n.push(g)})});const r=new Hi;r.rotate(-Ve.getAngle(this.rotation()));var i,o,a,s;n.forEach(function(u){var c=r.point(u);i===void 0&&(i=a=c.x,o=s=c.y),i=Math.min(i,c.x),o=Math.min(o,c.y),a=Math.max(a,c.x),s=Math.max(s,c.y)}),r.invert();const l=r.point({x:i,y:o});return{x:l.x,y:l.y,width:a-i,height:s-o,rotation:Ve.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),ab.forEach(function(t){this._createAnchor(t)}.bind(this)),this._createAnchor("rotater")}_createAnchor(t){var n=new M1({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:t+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:EPe?10:"auto"}),r=this;n.on("mousedown touchstart",function(i){r._handleMouseDown(i)}),n.on("dragstart",i=>{n.stopDrag(),i.cancelBubble=!0}),n.on("dragend",i=>{i.cancelBubble=!0}),n.on("mouseenter",()=>{var i=Ve.getAngle(this.rotation()),o=PPe(t,i);n.getStage().content&&(n.getStage().content.style.cursor=o),this._cursorChange=!0}),n.on("mouseout",()=>{n.getStage().content&&(n.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(n)}_createBack(){var t=new ye({name:"back",width:0,height:0,draggable:!0,sceneFunc(n){var r=this.getParent(),i=r.padding();n.beginPath(),n.rect(-i,-i,this.width()+i*2,this.height()+i*2),n.moveTo(this.width()/2,-i),r.rotateEnabled()&&n.lineTo(this.width()/2,-r.rotateAnchorOffset()*te._sign(this.height())-i),n.fillStrokeShape(this)},hitFunc:(n,r)=>{if(this.shouldOverdrawWholeArea()){var i=this.padding();n.beginPath(),n.rect(-i,-i,r.width()+i*2,r.height()+i*2),n.fillStrokeShape(r)}}});this.add(t),this._proxyDrag(t),t.on("dragstart",n=>{n.cancelBubble=!0}),t.on("dragmove",n=>{n.cancelBubble=!0}),t.on("dragend",n=>{n.cancelBubble=!0}),this.on("dragmove",n=>{this.update()})}_handleMouseDown(t){this._movingAnchorName=t.target.name().split(" ")[0];var n=this._getNodeRect(),r=n.width,i=n.height,o=Math.sqrt(Math.pow(r,2)+Math.pow(i,2));this.sin=Math.abs(i/o),this.cos=Math.abs(r/o),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;var a=t.target.getAbsolutePosition(),s=t.target.getStage().getPointerPosition();this._anchorDragOffset={x:s.x-a.x,y:s.y-a.y},this._fire("transformstart",{evt:t.evt,target:this.getNode()}),this._nodes.forEach(l=>{l._fire("transformstart",{evt:t.evt,target:l})})}_handleMouseMove(t){var n,r,i,o=this.findOne("."+this._movingAnchorName),a=o.getStage();a.setPointersPositions(t);const s=a.getPointerPosition();let l={x:s.x-this._anchorDragOffset.x,y:s.y-this._anchorDragOffset.y};const u=o.getAbsolutePosition();this.anchorDragBoundFunc()&&(l=this.anchorDragBoundFunc()(u,l,t)),o.setAbsolutePosition(l);const c=o.getAbsolutePosition();if(!(u.x===c.x&&u.y===c.y)){if(this._movingAnchorName==="rotater"){var f=this._getNodeRect();n=o.x()-f.width/2,r=-o.y()+f.height/2;let Y=Math.atan2(-r,n)+Math.PI/2;f.height<0&&(Y-=Math.PI);var p=Ve.getAngle(this.rotation());const z=p+Y,R=Ve.getAngle(this.rotationSnapTolerance()),U=APe(this.rotationSnaps(),z,R)-f.rotation,G=LPe(f,U);this._fitNodesInto(G,t);return}var m=this.keepRatio()||t.shiftKey,w=this.centeredScaling()||t.altKey;if(this._movingAnchorName==="top-left"){if(m){var g=w?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};i=Math.sqrt(Math.pow(g.x-o.x(),2)+Math.pow(g.y-o.y(),2));var v=this.findOne(".top-left").x()>g.x?-1:1,x=this.findOne(".top-left").y()>g.y?-1:1;n=i*this.cos*v,r=i*this.sin*x,this.findOne(".top-left").x(g.x-n),this.findOne(".top-left").y(g.y-r)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(o.y());else if(this._movingAnchorName==="top-right"){if(m){var g=w?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};i=Math.sqrt(Math.pow(o.x()-g.x,2)+Math.pow(g.y-o.y(),2));var v=this.findOne(".top-right").x()g.y?-1:1;n=i*this.cos*v,r=i*this.sin*x,this.findOne(".top-right").x(g.x+n),this.findOne(".top-right").y(g.y-r)}var C=o.position();this.findOne(".top-left").y(C.y),this.findOne(".bottom-right").x(C.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(o.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(o.x());else if(this._movingAnchorName==="bottom-left"){if(m){var g=w?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};i=Math.sqrt(Math.pow(g.x-o.x(),2)+Math.pow(o.y()-g.y,2));var v=g.x{r._fire("transformend",{evt:t,target:r})}),this._movingAnchorName=null}}_fitNodesInto(t,n){var r=this._getNodeRect();const i=1;if(te._inRange(t.width,-this.padding()*2-i,i)){this.update();return}if(te._inRange(t.height,-this.padding()*2-i,i)){this.update();return}const o=this.flipEnabled();var a=new Hi;if(a.rotate(Ve.getAngle(this.rotation())),this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("left")>=0){const f=a.point({x:-this.padding()*2,y:0});if(t.x+=f.x,t.y+=f.y,t.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=f.x,this._anchorDragOffset.y-=f.y,!o){this.update();return}}else if(this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("right")>=0){const f=a.point({x:this.padding()*2,y:0});if(this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=f.x,this._anchorDragOffset.y-=f.y,t.width+=this.padding()*2,!o){this.update();return}}if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("top")>=0){const f=a.point({x:0,y:-this.padding()*2});if(t.x+=f.x,t.y+=f.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=f.x,this._anchorDragOffset.y-=f.y,t.height+=this.padding()*2,!o){this.update();return}}else if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const f=a.point({x:0,y:this.padding()*2});if(this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=f.x,this._anchorDragOffset.y-=f.y,t.height+=this.padding()*2,!o){this.update();return}}if(this.boundBoxFunc()){const f=this.boundBoxFunc()(r,t);f?t=f:te.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const s=1e7,l=new Hi;l.translate(r.x,r.y),l.rotate(r.rotation),l.scale(r.width/s,r.height/s);const u=new Hi;u.translate(t.x,t.y),u.rotate(t.rotation),u.scale(t.width/s,t.height/s);const c=u.multiply(l.invert());this._nodes.forEach(f=>{var p;const m=f.getParent().getAbsoluteTransform(),g=f.getTransform().copy();g.translate(f.offsetX(),f.offsetY());const v=new Hi;v.multiply(m.copy().invert()).multiply(c).multiply(m).multiply(g);const x=v.decompose();f.setAttrs(x),this._fire("transform",{evt:n,target:f}),f._fire("transform",{evt:n,target:f}),(p=f.getLayer())===null||p===void 0||p.batchDraw()}),this.rotation(te._getRotation(t.rotation)),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(t,n){this.findOne(t).setAttrs(n)}update(){var t,n=this._getNodeRect();this.rotation(te._getRotation(n.rotation));var r=n.width,i=n.height,o=this.enabledAnchors(),a=this.resizeEnabled(),s=this.padding(),l=this.anchorSize();this.find("._anchor").forEach(u=>{u.setAttrs({width:l,height:l,offsetX:l/2,offsetY:l/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:l/2+s,offsetY:l/2+s,visible:a&&o.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:r/2,y:0,offsetY:l/2+s,visible:a&&o.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:r,y:0,offsetX:l/2-s,offsetY:l/2+s,visible:a&&o.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:i/2,offsetX:l/2+s,visible:a&&o.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:r,y:i/2,offsetX:l/2-s,visible:a&&o.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:i,offsetX:l/2+s,offsetY:l/2-s,visible:a&&o.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:r/2,y:i,offsetY:l/2-s,visible:a&&o.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:r,y:i,offsetX:l/2-s,offsetY:l/2-s,visible:a&&o.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:r/2,y:-this.rotateAnchorOffset()*te._sign(i)-s,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:r,height:i,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0}),(t=this.getLayer())===null||t===void 0||t.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();var t=this.findOne("."+this._movingAnchorName);t&&t.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),Sh.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return Oe.prototype.toObject.call(this)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}};function OPe(e){return e instanceof Array||te.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach(function(t){ab.indexOf(t)===-1&&te.warn("Unknown anchor name: "+t+". Available names are: "+ab.join(", "))}),e||[]}Yt.prototype.className="Transformer";Vn(Yt);K.addGetterSetter(Yt,"enabledAnchors",ab,OPe);K.addGetterSetter(Yt,"flipEnabled",!0,ha());K.addGetterSetter(Yt,"resizeEnabled",!0);K.addGetterSetter(Yt,"anchorSize",10,Pe());K.addGetterSetter(Yt,"rotateEnabled",!0);K.addGetterSetter(Yt,"rotationSnaps",[]);K.addGetterSetter(Yt,"rotateAnchorOffset",50,Pe());K.addGetterSetter(Yt,"rotationSnapTolerance",5,Pe());K.addGetterSetter(Yt,"borderEnabled",!0);K.addGetterSetter(Yt,"anchorStroke","rgb(0, 161, 255)");K.addGetterSetter(Yt,"anchorStrokeWidth",1,Pe());K.addGetterSetter(Yt,"anchorFill","white");K.addGetterSetter(Yt,"anchorCornerRadius",0,Pe());K.addGetterSetter(Yt,"borderStroke","rgb(0, 161, 255)");K.addGetterSetter(Yt,"borderStrokeWidth",1,Pe());K.addGetterSetter(Yt,"borderDash");K.addGetterSetter(Yt,"keepRatio",!0);K.addGetterSetter(Yt,"centeredScaling",!1);K.addGetterSetter(Yt,"ignoreStroke",!1);K.addGetterSetter(Yt,"padding",0,Pe());K.addGetterSetter(Yt,"node");K.addGetterSetter(Yt,"nodes");K.addGetterSetter(Yt,"boundBoxFunc");K.addGetterSetter(Yt,"anchorDragBoundFunc");K.addGetterSetter(Yt,"shouldOverdrawWholeArea",!1);K.addGetterSetter(Yt,"useSingleNodeRotation",!0);K.backCompat(Yt,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});class Qs extends ye{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.radius(),0,Ve.getAngle(this.angle()),this.clockwise()),t.lineTo(0,0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}Qs.prototype.className="Wedge";Qs.prototype._centroid=!0;Qs.prototype._attrsAffectingSize=["radius"];Vn(Qs);K.addGetterSetter(Qs,"radius",0,Pe());K.addGetterSetter(Qs,"angle",0,Pe());K.addGetterSetter(Qs,"clockwise",!1);K.backCompat(Qs,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});function eR(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var MPe=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],IPe=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function RPe(e,t){var n=e.data,r=e.width,i=e.height,o,a,s,l,u,c,f,p,m,g,v,x,C,w,k,P,L,A,O,I,$,D,V,Y,z=t+t+1,R=r-1,N=i-1,U=t+1,G=U*(U+1)/2,B=new eR,W=null,X=B,re=null,le=null,he=MPe[t],se=IPe[t];for(s=1;s>se,V!==0?(V=255/V,n[c]=(p*he>>se)*V,n[c+1]=(m*he>>se)*V,n[c+2]=(g*he>>se)*V):n[c]=n[c+1]=n[c+2]=0,p-=x,m-=C,g-=w,v-=k,x-=re.r,C-=re.g,w-=re.b,k-=re.a,l=f+((l=o+t+1)>se,V>0?(V=255/V,n[l]=(p*he>>se)*V,n[l+1]=(m*he>>se)*V,n[l+2]=(g*he>>se)*V):n[l]=n[l+1]=n[l+2]=0,p-=x,m-=C,g-=w,v-=k,x-=re.r,C-=re.g,w-=re.b,k-=re.a,l=o+((l=a+U)0&&RPe(t,n)};K.addGetterSetter(Oe,"blurRadius",0,Pe(),K.afterSetFilter);const DPe=function(e){var t=this.brightness()*255,n=e.data,r=n.length,i;for(i=0;i255?255:i,o=o<0?0:o>255?255:o,a=a<0?0:a>255?255:a,n[s]=i,n[s+1]=o,n[s+2]=a};K.addGetterSetter(Oe,"contrast",0,Pe(),K.afterSetFilter);const BPe=function(e){var t=this.embossStrength()*10,n=this.embossWhiteLevel()*255,r=this.embossDirection(),i=this.embossBlend(),o=0,a=0,s=e.data,l=e.width,u=e.height,c=l*4,f=u;switch(r){case"top-left":o=-1,a=-1;break;case"top":o=-1,a=0;break;case"top-right":o=-1,a=1;break;case"right":o=0,a=1;break;case"bottom-right":o=1,a=1;break;case"bottom":o=1,a=0;break;case"bottom-left":o=1,a=-1;break;case"left":o=0,a=-1;break;default:te.error("Unknown emboss direction: "+r)}do{var p=(f-1)*c,m=o;f+m<1&&(m=0),f+m>u&&(m=0);var g=(f-1+m)*l*4,v=l;do{var x=p+(v-1)*4,C=a;v+C<1&&(C=0),v+C>l&&(C=0);var w=g+(v-1+C)*4,k=s[x]-s[w],P=s[x+1]-s[w+1],L=s[x+2]-s[w+2],A=k,O=A>0?A:-A,I=P>0?P:-P,$=L>0?L:-L;if(I>O&&(A=P),$>O&&(A=L),A*=t,i){var D=s[x]+A,V=s[x+1]+A,Y=s[x+2]+A;s[x]=D>255?255:D<0?0:D,s[x+1]=V>255?255:V<0?0:V,s[x+2]=Y>255?255:Y<0?0:Y}else{var z=n-A;z<0?z=0:z>255&&(z=255),s[x]=s[x+1]=s[x+2]=z}}while(--v)}while(--f)};K.addGetterSetter(Oe,"embossStrength",.5,Pe(),K.afterSetFilter);K.addGetterSetter(Oe,"embossWhiteLevel",.5,Pe(),K.afterSetFilter);K.addGetterSetter(Oe,"embossDirection","top-left",null,K.afterSetFilter);K.addGetterSetter(Oe,"embossBlend",!1,null,K.afterSetFilter);function Ww(e,t,n,r,i){var o=n-t,a=i-r,s;return o===0?r+a/2:a===0?r:(s=(e-t)/o,s=a*s+r,s)}const FPe=function(e){var t=e.data,n=t.length,r=t[0],i=r,o,a=t[1],s=a,l,u=t[2],c=u,f,p,m=this.enhance();if(m!==0){for(p=0;pi&&(i=o),l=t[p+1],ls&&(s=l),f=t[p+2],fc&&(c=f);i===r&&(i=255,r=0),s===a&&(s=255,a=0),c===u&&(c=255,u=0);var g,v,x,C,w,k,P,L,A;for(m>0?(v=i+m*(255-i),x=r-m*(r-0),w=s+m*(255-s),k=a-m*(a-0),L=c+m*(255-c),A=u-m*(u-0)):(g=(i+r)*.5,v=i+m*(i-g),x=r+m*(r-g),C=(s+a)*.5,w=s+m*(s-C),k=a+m*(a-C),P=(c+u)*.5,L=c+m*(c-P),A=u+m*(u-P)),p=0;pC?x:C;var w=a,k=o,P,L,A=360/k*Math.PI/180,O,I;for(L=0;Lk?w:k;var P=a,L=o,A,O,I=n.polarRotation||0,$,D;for(c=0;ct&&(P=k,L=0,A=-1),i=0;i=0&&m=0&&g=0&&m=0&&g=255*4?255:0}return a}function QPe(e,t,n){for(var r=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],i=Math.round(Math.sqrt(r.length)),o=Math.floor(i/2),a=[],s=0;s=0&&m=0&&g=n))for(o=v;o=r||(a=(n*o+i)*4,s+=P[a+0],l+=P[a+1],u+=P[a+2],c+=P[a+3],k+=1);for(s=s/k,l=l/k,u=u/k,c=c/k,i=m;i=n))for(o=v;o=r||(a=(n*o+i)*4,P[a+0]=s,P[a+1]=l,P[a+2]=u,P[a+3]=c)}};K.addGetterSetter(Oe,"pixelSize",8,Pe(),K.afterSetFilter);const nTe=function(e){var t=Math.round(this.levels()*254)+1,n=e.data,r=n.length,i=255/t,o;for(o=0;o255?255:e<0?0:Math.round(e)});K.addGetterSetter(Oe,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});K.addGetterSetter(Oe,"blue",0,KW,K.afterSetFilter);const iTe=function(e){var t=e.data,n=t.length,r=this.red(),i=this.green(),o=this.blue(),a=this.alpha(),s,l;for(s=0;s255?255:e<0?0:Math.round(e)});K.addGetterSetter(Oe,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});K.addGetterSetter(Oe,"blue",0,KW,K.afterSetFilter);K.addGetterSetter(Oe,"alpha",1,function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e});const oTe=function(e){var t=e.data,n=t.length,r,i,o,a;for(r=0;r127&&(u=255-u),c>127&&(c=255-c),f>127&&(f=255-f),t[l]=u,t[l+1]=c,t[l+2]=f}while(--s)}while(--o)},sTe=function(e){var t=this.threshold()*255,n=e.data,r=n.length,i;for(i=0;i{const{width:n,height:r}=t,i=document.createElement("div"),o=new Jd.Stage({container:i,width:n,height:r}),a=new Jd.Layer,s=new Jd.Layer;a.add(new Jd.Rect({...t,fill:"white"})),e.forEach(u=>s.add(new Jd.Line({points:u.points,stroke:"black",strokeWidth:u.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,globalCompositeOperation:u.tool==="brush"?"source-over":"destination-out"}))),o.add(a),o.add(s);const l=o.toDataURL({...t});return i.remove(),l};let EG=null,PG=null;const uTe=e=>{EG=e},ca=()=>EG,cTe=e=>{PG=e},TG=()=>PG,dTe=e=>{const t=window.open("");t&&e.forEach(n=>{const r=new Image;r.src=n.base64,t.document.write(n.caption),t.document.write("
"),t.document.write(r.outerHTML),t.document.write("

")})},LG=(e,t)=>Math.floor(Math.random()*(t-e+1)+e),fTe=e=>{const t=ca(),{generationMode:n,generationState:r,postprocessingState:i,canvasState:o,systemState:a}=e,{codeformerFidelity:s,facetoolStrength:l,facetoolType:u,hiresFix:c,hiresStrength:f,shouldRunESRGAN:p,shouldRunFacetool:m,upscalingLevel:g,upscalingStrength:v}=i,{cfgScale:x,height:C,img2imgStrength:w,infillMethod:k,initialImage:P,iterations:L,perlin:A,prompt:O,negativePrompt:I,sampler:$,seamBlur:D,seamless:V,seamSize:Y,seamSteps:z,seamStrength:R,seed:N,seedWeights:U,shouldFitToWidthHeight:G,shouldGenerateVariations:B,shouldRandomizeSeed:W,steps:X,threshold:re,tileSize:le,variationAmount:he,width:se}=r,{shouldDisplayInProgressType:Ae,saveIntermediatesInterval:be,enableImageDebugging:De}=a,fe={prompt:O,iterations:L,steps:X,cfg_scale:x,threshold:re,perlin:A,height:C,width:se,sampler_name:$,seed:N,progress_images:Ae==="full-res",progress_latents:Ae==="latents",save_intermediates:be,generation_mode:n,init_mask:""};let Xe=!1,rt=!1;if(I!==""&&(fe.prompt=`${O} [${I}]`),fe.seed=W?LG(W_,G_):N,["txt2img","img2img"].includes(n)&&(fe.seamless=V,fe.hires_fix=c,c&&(fe.strength=f),p&&(Xe={level:g,strength:v}),m&&(rt={type:u,strength:l},u==="codeformer"&&(rt.codeformer_fidelity=s))),n==="img2img"&&P&&(fe.init_img=typeof P=="string"?P:P.url,fe.strength=w,fe.fit=G),n==="unifiedCanvas"&&t){const{layerState:{objects:Ze},boundingBoxCoordinates:et,boundingBoxDimensions:nt,stageScale:ve,isMaskEnabled:Qe,shouldPreserveMaskedArea:ct,boundingBoxScaleMethod:Je,scaledBoundingBoxDimensions:st}=o,wt={...et,...nt},J=lTe(Qe?Ze.filter(I_):[],wt);fe.init_mask=J,fe.fit=!1,fe.strength=w,fe.invert_mask=ct,fe.bounding_box=wt;const xe=t.scale();t.scale({x:1/ve,y:1/ve});const Me=t.getAbsolutePosition(),$e=t.toDataURL({x:wt.x+Me.x,y:wt.y+Me.y,width:wt.width,height:wt.height});De&&dTe([{base64:J,caption:"mask sent as init_mask"},{base64:$e,caption:"image sent as init_img"}]),t.scale(xe),fe.init_img=$e,fe.progress_images=!1,Je!=="none"&&(fe.inpaint_width=st.width,fe.inpaint_height=st.height),fe.seam_size=Y,fe.seam_blur=D,fe.seam_strength=R,fe.seam_steps=z,fe.tile_size=le,fe.infill_method=k,fe.force_outpaint=!1}return B?(fe.variation_amount=he,U&&(fe.with_variations=F9e(U))):fe.variation_amount=0,De&&(fe.enable_image_debugging=De),{generationParameters:fe,esrganParameters:Xe,facetoolParameters:rt}};var hTe=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g,pTe=/\b(?:[A-Z]{1,3}[A-Z][TC])(?:[-+]\d{4})?|((?:Australian )?(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time)\b/g,mTe=/[^-+\dA-Z]/g;function Xr(e,t,n,r){if(arguments.length===1&&typeof e=="string"&&!/\d/.test(e)&&(t=e,e=void 0),e=e||e===0?e:new Date,e instanceof Date||(e=new Date(e)),isNaN(e))throw TypeError("Invalid date");t=String(tR[t]||t||tR.default);var i=t.slice(0,4);(i==="UTC:"||i==="GMT:")&&(t=t.slice(4),n=!0,i==="GMT:"&&(r=!0));var o=function(){return n?"getUTC":"get"},a=function(){return e[o()+"Date"]()},s=function(){return e[o()+"Day"]()},l=function(){return e[o()+"Month"]()},u=function(){return e[o()+"FullYear"]()},c=function(){return e[o()+"Hours"]()},f=function(){return e[o()+"Minutes"]()},p=function(){return e[o()+"Seconds"]()},m=function(){return e[o()+"Milliseconds"]()},g=function(){return n?0:e.getTimezoneOffset()},v=function(){return gTe(e)},x=function(){return vTe(e)},C={d:function(){return a()},dd:function(){return Fi(a())},ddd:function(){return Ci.dayNames[s()]},DDD:function(){return nR({y:u(),m:l(),d:a(),_:o(),dayName:Ci.dayNames[s()],short:!0})},dddd:function(){return Ci.dayNames[s()+7]},DDDD:function(){return nR({y:u(),m:l(),d:a(),_:o(),dayName:Ci.dayNames[s()+7]})},m:function(){return l()+1},mm:function(){return Fi(l()+1)},mmm:function(){return Ci.monthNames[l()]},mmmm:function(){return Ci.monthNames[l()+12]},yy:function(){return String(u()).slice(2)},yyyy:function(){return Fi(u(),4)},h:function(){return c()%12||12},hh:function(){return Fi(c()%12||12)},H:function(){return c()},HH:function(){return Fi(c())},M:function(){return f()},MM:function(){return Fi(f())},s:function(){return p()},ss:function(){return Fi(p())},l:function(){return Fi(m(),3)},L:function(){return Fi(Math.floor(m()/10))},t:function(){return c()<12?Ci.timeNames[0]:Ci.timeNames[1]},tt:function(){return c()<12?Ci.timeNames[2]:Ci.timeNames[3]},T:function(){return c()<12?Ci.timeNames[4]:Ci.timeNames[5]},TT:function(){return c()<12?Ci.timeNames[6]:Ci.timeNames[7]},Z:function(){return r?"GMT":n?"UTC":yTe(e)},o:function(){return(g()>0?"-":"+")+Fi(Math.floor(Math.abs(g())/60)*100+Math.abs(g())%60,4)},p:function(){return(g()>0?"-":"+")+Fi(Math.floor(Math.abs(g())/60),2)+":"+Fi(Math.floor(Math.abs(g())%60),2)},S:function(){return["th","st","nd","rd"][a()%10>3?0:(a()%100-a()%10!=10)*a()%10]},W:function(){return v()},WW:function(){return Fi(v())},N:function(){return x()}};return t.replace(hTe,function(w){return w in C?C[w]():w.slice(1,w.length-1)})}var tR={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",paddedShortDate:"mm/dd/yyyy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:sso",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",expiresHeaderFormat:"ddd, dd mmm yyyy HH:MM:ss Z"},Ci={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"],timeNames:["a","p","am","pm","A","P","AM","PM"]},Fi=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;return String(t).padStart(n,"0")},nR=function(t){var n=t.y,r=t.m,i=t.d,o=t._,a=t.dayName,s=t.short,l=s===void 0?!1:s,u=new Date,c=new Date;c.setDate(c[o+"Date"]()-1);var f=new Date;f.setDate(f[o+"Date"]()+1);var p=function(){return u[o+"Date"]()},m=function(){return u[o+"Month"]()},g=function(){return u[o+"FullYear"]()},v=function(){return c[o+"Date"]()},x=function(){return c[o+"Month"]()},C=function(){return c[o+"FullYear"]()},w=function(){return f[o+"Date"]()},k=function(){return f[o+"Month"]()},P=function(){return f[o+"FullYear"]()};return g()===n&&m()===r&&p()===i?l?"Tdy":"Today":C()===n&&x()===r&&v()===i?l?"Ysd":"Yesterday":P()===n&&k()===r&&w()===i?l?"Tmw":"Tomorrow":a},gTe=function(t){var n=new Date(t.getFullYear(),t.getMonth(),t.getDate());n.setDate(n.getDate()-(n.getDay()+6)%7+3);var r=new Date(n.getFullYear(),0,4);r.setDate(r.getDate()-(r.getDay()+6)%7+3);var i=n.getTimezoneOffset()-r.getTimezoneOffset();n.setHours(n.getHours()-i);var o=(n-r)/(864e5*7);return 1+Math.floor(o)},vTe=function(t){var n=t.getDay();return n===0&&(n=7),n},yTe=function(t){return(String(t).match(pTe)||[""]).pop().replace(mTe,"").replace(/GMT\+0000/g,"UTC")};const bTe=(e,t)=>{const{dispatch:n,getState:r}=e;return{emitGenerateImage:i=>{n(Qo(!0));const o=r(),{generation:a,postprocessing:s,system:l,canvas:u}=o,c={generationMode:i,generationState:a,postprocessingState:s,canvasState:u,systemState:l};n(U_e());const{generationParameters:f,esrganParameters:p,facetoolParameters:m}=fTe(c);t.emit("generateImage",f,p,m),f.init_mask&&(f.init_mask=f.init_mask.substr(0,64).concat("...")),f.init_img&&(f.init_img=f.init_img.substr(0,64).concat("...")),n(qr({timestamp:Xr(new Date,"isoDateTime"),message:`Image generation requested: ${JSON.stringify({...f,...p,...m})}`}))},emitRunESRGAN:i=>{n(Qo(!0));const{postprocessing:{upscalingLevel:o,upscalingStrength:a}}=r(),s={upscale:[o,a]};t.emit("runPostprocessing",i,{type:"esrgan",...s}),n(qr({timestamp:Xr(new Date,"isoDateTime"),message:`ESRGAN upscale requested: ${JSON.stringify({file:i.url,...s})}`}))},emitRunFacetool:i=>{n(Qo(!0));const{postprocessing:{facetoolType:o,facetoolStrength:a,codeformerFidelity:s}}=r(),l={facetool_strength:a};o==="codeformer"&&(l.codeformer_fidelity=s),t.emit("runPostprocessing",i,{type:o,...l}),n(qr({timestamp:Xr(new Date,"isoDateTime"),message:`Face restoration (${o}) requested: ${JSON.stringify({file:i.url,...l})}`}))},emitDeleteImage:i=>{const{url:o,uuid:a,category:s,thumbnail:l}=i;n(HU(i)),t.emit("deleteImage",o,l,a,s)},emitRequestImages:i=>{const o=r().gallery,{earliest_mtime:a}=o.categories[i];t.emit("requestImages",i,a)},emitRequestNewImages:i=>{const o=r().gallery,{latest_mtime:a}=o.categories[i];t.emit("requestLatestImages",i,a)},emitCancelProcessing:()=>{t.emit("cancel")},emitRequestSystemConfig:()=>{t.emit("requestSystemConfig")},emitSearchForModels:i=>{t.emit("searchForModels",i)},emitAddNewModel:i=>{t.emit("addNewModel",i)},emitDeleteModel:i=>{t.emit("deleteModel",i)},emitRequestModelChange:i=>{n(j_e()),t.emit("requestModelChange",i)},emitSaveStagingAreaImageToGallery:i=>{t.emit("requestSaveStagingAreaImageToGallery",i)},emitRequestEmptyTempFolder:()=>{t.emit("requestEmptyTempFolder")}}};let Wv;const STe=new Uint8Array(16);function wTe(){if(!Wv&&(Wv=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Wv))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Wv(STe)}const Or=[];for(let e=0;e<256;++e)Or.push((e+256).toString(16).slice(1));function CTe(e,t=0){return(Or[e[t+0]]+Or[e[t+1]]+Or[e[t+2]]+Or[e[t+3]]+"-"+Or[e[t+4]]+Or[e[t+5]]+"-"+Or[e[t+6]]+Or[e[t+7]]+"-"+Or[e[t+8]]+Or[e[t+9]]+"-"+Or[e[t+10]]+Or[e[t+11]]+Or[e[t+12]]+Or[e[t+13]]+Or[e[t+14]]+Or[e[t+15]]).toLowerCase()}const xTe=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),rR={randomUUID:xTe};function _f(e,t,n){if(rR.randomUUID&&!t&&!e)return rR.randomUUID();e=e||{};const r=e.random||(e.rng||wTe)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return CTe(r)}const e7=Yn("socketio/generateImage"),_Te=Yn("socketio/runESRGAN"),kTe=Yn("socketio/runFacetool"),ETe=Yn("socketio/deleteImage"),t7=Yn("socketio/requestImages"),iR=Yn("socketio/requestNewImages"),PTe=Yn("socketio/cancelProcessing"),TTe=Yn("socketio/requestSystemConfig"),oR=Yn("socketio/searchForModels"),I1=Yn("socketio/addNewModel"),LTe=Yn("socketio/deleteModel"),AG=Yn("socketio/requestModelChange"),ATe=Yn("socketio/saveStagingAreaImageToGallery"),OTe=Yn("socketio/requestEmptyTempFolder"),MTe=e=>{const{dispatch:t,getState:n}=e;return{onConnect:()=>{try{t(CI(!0)),t(z2(ht.t("common:statusConnected"))),t(TTe());const r=n().gallery;r.categories.result.latest_mtime?t(iR("result")):t(t7("result")),r.categories.user.latest_mtime?t(iR("user")):t(t7("user"))}catch(r){console.error(r)}},onDisconnect:()=>{try{t(CI(!1)),t(z2(ht.t("common:statusDisconnected"))),t(qr({timestamp:Xr(new Date,"isoDateTime"),message:"Disconnected from server",level:"warning"}))}catch(r){console.error(r)}},onGenerationResult:r=>{try{const i=n(),{activeTab:o}=i.ui,{shouldLoopback:a}=i.postprocessing,{boundingBox:s,generationMode:l,...u}=r,c={uuid:_f(),...u};if(["txt2img","img2img"].includes(l)&&t(wf({category:"result",image:{...c,category:"result"}})),l==="unifiedCanvas"&&r.boundingBox){const{boundingBox:f}=r;t(i9e({image:{...c,category:"temp"},boundingBox:f})),i.canvas.shouldAutoSave&&t(wf({image:{...c,category:"result"},category:"result"}))}if(a)switch(H_[o]){case"img2img":{t(Kh(c));break}}t(Iw()),t(qr({timestamp:Xr(new Date,"isoDateTime"),message:`Image generated: ${r.url}`}))}catch(i){console.error(i)}},onIntermediateResult:r=>{try{t(P9e({uuid:_f(),...r,category:"result"})),r.isBase64||t(qr({timestamp:Xr(new Date,"isoDateTime"),message:`Intermediate image generated: ${r.url}`}))}catch(i){console.error(i)}},onPostprocessingResult:r=>{try{t(wf({category:"result",image:{uuid:_f(),...r,category:"result"}})),t(qr({timestamp:Xr(new Date,"isoDateTime"),message:`Postprocessed: ${r.url}`}))}catch(i){console.error(i)}},onProgressUpdate:r=>{try{t(Qo(!0)),t(N_e(r))}catch(i){console.error(i)}},onError:r=>{const{message:i,additionalData:o}=r;try{t(qr({timestamp:Xr(new Date,"isoDateTime"),message:`Server error: ${i}`,level:"error"})),t(xI()),t(Iw())}catch(a){console.error(a)}},onGalleryImages:r=>{const{images:i,areMoreImagesAvailable:o,category:a}=r,s=i.map(l=>({uuid:_f(),...l}));t(E9e({images:s,areMoreImagesAvailable:o,category:a})),t(qr({timestamp:Xr(new Date,"isoDateTime"),message:`Loaded ${i.length} images`}))},onProcessingCanceled:()=>{t(z_e());const{intermediateImage:r}=n().gallery;r&&(r.isBase64||(t(wf({category:"result",image:r})),t(qr({timestamp:Xr(new Date,"isoDateTime"),message:`Intermediate image saved: ${r.url}`}))),t(Iw())),t(qr({timestamp:Xr(new Date,"isoDateTime"),message:"Processing canceled",level:"warning"}))},onImageDeleted:r=>{const{url:i}=r;t(HU(r));const{generation:{initialImage:o,maskPath:a}}=n();(o===i||(o==null?void 0:o.url)===i)&&t(KU()),a===i&&t(QU("")),t(qr({timestamp:Xr(new Date,"isoDateTime"),message:`Image deleted: ${i}`}))},onSystemConfig:r=>{t(B_e(r)),r.infill_methods.includes("patchmatch")||t(ZU(r.infill_methods[0]))},onFoundModels:r=>{const{search_folder:i,found_models:o}=r;t(PW(i)),t(TW(o))},onNewModelAdded:r=>{const{new_model_name:i,model_list:o,update:a}=r;t(Ov(o)),t(Qo(!1)),t(qr({timestamp:Xr(new Date,"isoDateTime"),message:`Model Added: ${i}`,level:"info"})),t(gc({title:a?`${ht.t("modelmanager:modelUpdated")}: ${i}`:`${ht.t("modelmanager:modelAdded")}: ${i}`,status:"success",duration:2500,isClosable:!0}))},onModelDeleted:r=>{const{deleted_model_name:i,model_list:o}=r;t(Ov(o)),t(Qo(!1)),t(qr({timestamp:Xr(new Date,"isoDateTime"),message:`${ht.t("modelmanager:modelAdded")}: ${i}`,level:"info"})),t(gc({title:`${ht.t("modelmanager:modelEntryDeleted")}: ${i}`,status:"success",duration:2500,isClosable:!0}))},onModelChanged:r=>{const{model_name:i,model_list:o}=r;t(Ov(o)),t(z2(ht.t("common:statusModelChanged"))),t(Qo(!1)),t(Cf(!0)),t(qr({timestamp:Xr(new Date,"isoDateTime"),message:`Model changed: ${i}`,level:"info"}))},onModelChangeFailed:r=>{const{model_name:i,model_list:o}=r;t(Ov(o)),t(Qo(!1)),t(Cf(!0)),t(xI()),t(qr({timestamp:Xr(new Date,"isoDateTime"),message:`Model change failed: ${i}`,level:"error"}))},onTempFolderEmptied:()=>{t(gc({title:ht.t("toast:tempFoldersEmptied"),status:"success",duration:2500,isClosable:!0}))}}},ITe=()=>{const{origin:e}=new URL(window.location.href),t=V2(e,{timeout:6e4,path:`${window.location.pathname}socket.io`});let n=!1;return i=>o=>a=>{const{onConnect:s,onDisconnect:l,onError:u,onPostprocessingResult:c,onGenerationResult:f,onIntermediateResult:p,onProgressUpdate:m,onGalleryImages:g,onProcessingCanceled:v,onImageDeleted:x,onSystemConfig:C,onModelChanged:w,onFoundModels:k,onNewModelAdded:P,onModelDeleted:L,onModelChangeFailed:A,onTempFolderEmptied:O}=MTe(i),{emitGenerateImage:I,emitRunESRGAN:$,emitRunFacetool:D,emitDeleteImage:V,emitRequestImages:Y,emitRequestNewImages:z,emitCancelProcessing:R,emitRequestSystemConfig:N,emitSearchForModels:U,emitAddNewModel:G,emitDeleteModel:B,emitRequestModelChange:W,emitSaveStagingAreaImageToGallery:X,emitRequestEmptyTempFolder:re}=bTe(i,t);switch(n||(t.on("connect",()=>s()),t.on("disconnect",()=>l()),t.on("error",le=>u(le)),t.on("generationResult",le=>f(le)),t.on("postprocessingResult",le=>c(le)),t.on("intermediateResult",le=>p(le)),t.on("progressUpdate",le=>m(le)),t.on("galleryImages",le=>g(le)),t.on("processingCanceled",()=>{v()}),t.on("imageDeleted",le=>{x(le)}),t.on("systemConfig",le=>{C(le)}),t.on("foundModels",le=>{k(le)}),t.on("newModelAdded",le=>{P(le)}),t.on("modelDeleted",le=>{L(le)}),t.on("modelChanged",le=>{w(le)}),t.on("modelChangeFailed",le=>{A(le)}),t.on("tempFolderEmptied",()=>{O()}),n=!0),a.type){case"socketio/generateImage":{I(a.payload);break}case"socketio/runESRGAN":{$(a.payload);break}case"socketio/runFacetool":{D(a.payload);break}case"socketio/deleteImage":{V(a.payload);break}case"socketio/requestImages":{Y(a.payload);break}case"socketio/requestNewImages":{z(a.payload);break}case"socketio/cancelProcessing":{R();break}case"socketio/requestSystemConfig":{N();break}case"socketio/searchForModels":{U(a.payload);break}case"socketio/addNewModel":{G(a.payload);break}case"socketio/deleteModel":{B(a.payload);break}case"socketio/requestModelChange":{W(a.payload);break}case"socketio/saveStagingAreaImageToGallery":{X(a.payload);break}case"socketio/requestEmptyTempFolder":{re();break}}o(a)}},RTe=["cursorPosition","isCanvasInitialized","doesCanvasNeedScaling"].map(e=>`canvas.${e}`),$Te=["currentIteration","currentStatus","currentStep","isCancelable","isConnected","isESRGANAvailable","isGFPGANAvailable","isProcessing","socketId","totalIterations","totalSteps","openModel"].map(e=>`system.${e}`),DTe=["categories","currentCategory","currentImage","currentImageUuid","shouldAutoSwitchToNewImages","shouldHoldGalleryOpen","intermediateImage"].map(e=>`gallery.${e}`),OG=jV({generation:G9e,postprocessing:Z9e,gallery:R9e,system:K_e,canvas:_9e,ui:rke,lightbox:N9e}),NTe=QV.getPersistConfig({key:"root",storage:ZV,rootReducer:OG,blacklist:[...RTe,...$Te,...DTe],debounce:300}),BTe=Hbe(NTe,OG),MG=ybe({reducer:BTe,middleware:e=>e({immutableCheck:!1,serializableCheck:!1}).concat(ITe()),devTools:{actionsDenylist:["canvas/setCursorPosition","canvas/setStageCoordinates","canvas/setStageScale","canvas/setIsDrawing","canvas/setBoundingBoxCoordinates","canvas/setBoundingBoxDimensions","canvas/setIsDrawing","canvas/addPointToCurrentLine"]}}),IG=Ybe(MG),Q_=S.createContext(null),ge=Mye,ne=wye;let aR;const J_=()=>({setOpenUploader:e=>{e&&(aR=e)},openUploader:aR});var FTe="__lodash_hash_undefined__";function zTe(e){return this.__data__.set(e,FTe),this}var jTe=zTe;function HTe(e){return this.__data__.has(e)}var VTe=HTe,UTe=__,WTe=jTe,GTe=VTe;function sb(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new UTe;++ts))return!1;var u=o.get(e),c=o.get(t);if(u&&c)return u==t&&c==e;var f=-1,p=!0,m=n&nLe?new QTe:void 0;for(o.set(e,t),o.set(t,e);++fe.ui,e=>H_[e.activeTab],{memoizeOptions:{equalityCheck:Ue}}),VLe=Fe(e=>e.ui,e=>e.activeTab,{memoizeOptions:{equalityCheck:Ue}}),od=Fe(e=>e.ui,e=>e,{memoizeOptions:{equalityCheck:Ue}}),yR=e=>async(t,n)=>{const{imageFile:r}=e,i=n(),o=Un(i),a=new FormData;a.append("file",r,r.name),a.append("data",JSON.stringify({kind:"init"}));const l=await(await fetch(`${window.location.origin}/upload`,{method:"POST",body:a})).json(),u={uuid:_f(),category:"user",...l};t(wf({image:u,category:"user"})),o==="unifiedCanvas"?t(Z3(u)):o==="img2img"&&t(Kh(u))};function ULe(){const{t:e}=Ce();return j("div",{className:"work-in-progress nodes-work-in-progress",children:[b("h1",{children:e("common:nodes")}),b("p",{children:e("common:nodesDesc")})]})}const WLe=()=>{const{t:e}=Ce();return j("div",{className:"work-in-progress post-processing-work-in-progress",children:[b("h1",{children:e("common:postProcessing")}),b("p",{children:e("common:postProcessDesc1")}),b("p",{children:e("common:postProcessDesc2")}),b("p",{children:e("common:postProcessDesc3")})]})};function GLe(){const{t:e}=Ce();return j("div",{className:"work-in-progress nodes-work-in-progress",children:[b("h1",{children:e("common:training")}),j("p",{children:[e("common:trainingDesc1"),b("br",{}),b("br",{}),e("common:trainingDesc2")]})]})}function KLe(e){const{i18n:t}=Ce(),n=localStorage.getItem("i18nextLng");M.useEffect(()=>{e()},[e]),M.useEffect(()=>{t.on("languageChanged",()=>{e()})},[e,t,n])}const YLe=Ye({displayName:"ImageToImageIcon",viewBox:"0 0 3543 3543",path:b("g",{transform:"matrix(1.10943,0,0,1.10943,-206.981,-213.533)",children:b("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M688.533,2405.95L542.987,2405.95C349.532,2405.95 192.47,2248.89 192.47,2055.44L192.47,542.987C192.47,349.532 349.532,192.47 542.987,192.47L2527.88,192.47C2721.33,192.47 2878.4,349.532 2878.4,542.987L2878.4,1172.79L3023.94,1172.79C3217.4,1172.79 3374.46,1329.85 3374.46,1523.3C3374.46,1523.3 3374.46,3035.75 3374.46,3035.75C3374.46,3229.21 3217.4,3386.27 3023.94,3386.27L1039.05,3386.27C845.595,3386.27 688.533,3229.21 688.533,3035.75L688.533,2405.95ZM3286.96,2634.37L3286.96,1523.3C3286.96,1378.14 3169.11,1260.29 3023.94,1260.29C3023.94,1260.29 1039.05,1260.29 1039.05,1260.29C893.887,1260.29 776.033,1378.14 776.033,1523.3L776.033,2489.79L1440.94,1736.22L2385.83,2775.59L2880.71,2200.41L3286.96,2634.37ZM2622.05,1405.51C2778.5,1405.51 2905.51,1532.53 2905.51,1688.98C2905.51,1845.42 2778.5,1972.44 2622.05,1972.44C2465.6,1972.44 2338.58,1845.42 2338.58,1688.98C2338.58,1532.53 2465.6,1405.51 2622.05,1405.51ZM2790.9,1172.79L1323.86,1172.79L944.882,755.906L279.97,1509.47L279.97,542.987C279.97,397.824 397.824,279.97 542.987,279.97C542.987,279.97 2527.88,279.97 2527.88,279.97C2673.04,279.97 2790.9,397.824 2790.9,542.987L2790.9,1172.79ZM2125.98,425.197C2282.43,425.197 2409.45,552.213 2409.45,708.661C2409.45,865.11 2282.43,992.126 2125.98,992.126C1969.54,992.126 1842.52,865.11 1842.52,708.661C1842.52,552.213 1969.54,425.197 2125.98,425.197Z"})})}),qLe=Ye({displayName:"NodesIcon",viewBox:"0 0 3543 3543",path:b("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3543.31,770.787C3543.31,515.578 3336.11,308.38 3080.9,308.38L462.407,308.38C207.197,308.38 0,515.578 0,770.787L0,2766.03C0,3021.24 207.197,3228.44 462.407,3228.44L3080.9,3228.44C3336.11,3228.44 3543.31,3021.24 3543.31,2766.03C3543.31,2766.03 3543.31,770.787 3543.31,770.787ZM3427.88,770.787L3427.88,2766.03C3427.88,2957.53 3272.4,3113.01 3080.9,3113.01C3080.9,3113.01 462.407,3113.01 462.407,3113.01C270.906,3113.01 115.431,2957.53 115.431,2766.03L115.431,770.787C115.431,579.286 270.906,423.812 462.407,423.812L3080.9,423.812C3272.4,423.812 3427.88,579.286 3427.88,770.787ZM1214.23,1130.69L1321.47,1130.69C1324.01,1130.69 1326.54,1130.53 1329.05,1130.2C1329.05,1130.2 1367.3,1125.33 1397.94,1149.8C1421.63,1168.72 1437.33,1204.3 1437.33,1265.48L1437.33,2078.74L1220.99,2078.74C1146.83,2078.74 1086.61,2138.95 1086.61,2213.12L1086.61,2762.46C1086.61,2836.63 1146.83,2896.84 1220.99,2896.84L1770.34,2896.84C1844.5,2896.84 1904.71,2836.63 1904.71,2762.46L1904.71,2213.12C1904.71,2138.95 1844.5,2078.74 1770.34,2078.74L1554,2078.74L1554,1604.84C1625.84,1658.19 1703.39,1658.1 1703.39,1658.1C1703.54,1658.1 1703.69,1658.11 1703.84,1658.11L2362.2,1658.11L2362.2,1874.44C2362.2,1948.61 2422.42,2008.82 2496.58,2008.82L3045.93,2008.82C3120.09,2008.82 3180.3,1948.61 3180.3,1874.44L3180.3,1325.1C3180.3,1250.93 3120.09,1190.72 3045.93,1190.72L2496.58,1190.72C2422.42,1190.72 2362.2,1250.93 2362.2,1325.1L2362.2,1558.97L2362.2,1541.44L1704.23,1541.44C1702.2,1541.37 1650.96,1539.37 1609.51,1499.26C1577.72,1468.49 1554,1416.47 1554,1331.69L1554,1265.48C1554,1153.86 1513.98,1093.17 1470.76,1058.64C1411.24,1011.1 1338.98,1012.58 1319.15,1014.03L1214.23,1014.03L1214.23,796.992C1214.23,722.828 1154.02,662.617 1079.85,662.617L530.507,662.617C456.343,662.617 396.131,722.828 396.131,796.992L396.131,1346.34C396.131,1420.5 456.343,1480.71 530.507,1480.71L1079.85,1480.71C1154.02,1480.71 1214.23,1420.5 1214.23,1346.34L1214.23,1130.69Z"})}),XLe=Ye({displayName:"PostprocessingIcon",viewBox:"0 0 3543 3543",path:b("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M709.477,1596.53L992.591,1275.66L2239.09,2646.81L2891.95,1888.03L3427.88,2460.51L3427.88,994.78C3427.88,954.66 3421.05,916.122 3408.5,880.254L3521.9,855.419C3535.8,899.386 3543.31,946.214 3543.31,994.78L3543.31,2990.02C3543.31,3245.23 3336.11,3452.43 3080.9,3452.43C3080.9,3452.43 462.407,3452.43 462.407,3452.43C207.197,3452.43 -0,3245.23 -0,2990.02L-0,994.78C-0,739.571 207.197,532.373 462.407,532.373L505.419,532.373L504.644,532.546L807.104,600.085C820.223,601.729 832.422,607.722 841.77,617.116C850.131,625.517 855.784,636.21 858.055,647.804L462.407,647.804C270.906,647.804 115.431,803.279 115.431,994.78L115.431,2075.73L-0,2101.5L115.431,2127.28L115.431,2269.78L220.47,2150.73L482.345,2209.21C503.267,2211.83 522.722,2221.39 537.63,2236.37C552.538,2251.35 562.049,2270.9 564.657,2291.93L671.84,2776.17L779.022,2291.93C781.631,2270.9 791.141,2251.35 806.05,2236.37C820.958,2221.39 840.413,2211.83 861.334,2209.21L1353.15,2101.5L861.334,1993.8C840.413,1991.18 820.958,1981.62 806.05,1966.64C791.141,1951.66 781.631,1932.11 779.022,1911.08L709.477,1596.53ZM671.84,1573.09L725.556,2006.07C726.863,2016.61 731.63,2026.4 739.101,2033.91C746.573,2041.42 756.323,2046.21 766.808,2047.53L1197.68,2101.5L766.808,2155.48C756.323,2156.8 746.573,2161.59 739.101,2169.09C731.63,2176.6 726.863,2186.4 725.556,2196.94L671.84,2629.92L618.124,2196.94C616.817,2186.4 612.05,2176.6 604.579,2169.09C597.107,2161.59 587.357,2156.8 576.872,2155.48L146.001,2101.5L576.872,2047.53C587.357,2046.21 597.107,2041.42 604.579,2033.91C612.05,2026.4 616.817,2016.61 618.124,2006.07L671.84,1573.09ZM609.035,1710.36L564.657,1911.08C562.049,1932.11 552.538,1951.66 537.63,1966.64C522.722,1981.62 503.267,1991.18 482.345,1993.8L328.665,2028.11L609.035,1710.36ZM2297.12,938.615L2451.12,973.003C2480.59,976.695 2507.99,990.158 2528.99,1011.26C2549.99,1032.37 2563.39,1059.9 2567.07,1089.52L2672.73,1566.9C2634.5,1580.11 2593.44,1587.29 2550.72,1587.29C2344.33,1587.29 2176.77,1419.73 2176.77,1213.34C2176.77,1104.78 2223.13,1006.96 2297.12,938.615ZM2718.05,76.925L2793.72,686.847C2795.56,701.69 2802.27,715.491 2812.8,726.068C2823.32,736.644 2837.06,743.391 2851.83,745.242L3458.78,821.28L2851.83,897.318C2837.06,899.168 2823.32,905.916 2812.8,916.492C2802.27,927.068 2795.56,940.87 2793.72,955.712L2718.05,1565.63L2642.38,955.712C2640.54,940.87 2633.83,927.068 2623.3,916.492C2612.78,905.916 2599.04,899.168 2584.27,897.318L1977.32,821.28L2584.27,745.242C2599.04,743.391 2612.78,736.644 2623.3,726.068C2633.83,715.491 2640.54,701.69 2642.38,686.847L2718.05,76.925ZM2883.68,1043.06C2909.88,1094.13 2924.67,1152.02 2924.67,1213.34C2924.67,1335.4 2866.06,1443.88 2775.49,1512.14L2869.03,1089.52C2871.07,1073.15 2876.07,1057.42 2883.68,1043.06ZM925.928,201.2L959.611,472.704C960.431,479.311 963.42,485.455 968.105,490.163C972.79,494.871 978.904,497.875 985.479,498.698L1255.66,532.546L985.479,566.395C978.904,567.218 972.79,570.222 968.105,574.93C963.42,579.638 960.431,585.781 959.611,592.388L925.928,863.893L892.245,592.388C891.425,585.781 888.436,579.638 883.751,574.93C879.066,570.222 872.952,567.218 866.378,566.395L596.195,532.546L866.378,498.698C872.952,497.875 879.066,494.871 883.751,490.163C888.436,485.455 891.425,479.311 892.245,472.704L925.928,201.2ZM2864.47,532.373L3080.9,532.373C3258.7,532.373 3413.2,632.945 3490.58,780.281L3319.31,742.773C3257.14,683.925 3173.2,647.804 3080.9,647.804L2927.07,647.804C2919.95,642.994 2913.25,637.473 2907.11,631.298C2886.11,610.194 2872.71,582.655 2869.03,553.04L2864.47,532.373ZM1352.36,532.373L2571.64,532.373L2567.07,553.04C2563.39,582.655 2549.99,610.194 2528.99,631.298C2522.85,637.473 2516.16,642.994 2509.03,647.804L993.801,647.804C996.072,636.21 1001.73,625.517 1010.09,617.116C1019.43,607.722 1031.63,601.729 1044.75,600.085L1353.15,532.546L1352.36,532.373Z"})}),ZLe=Ye({displayName:"TextToImageIcon",viewBox:"0 0 3543 3543",path:b("g",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",transform:"matrix(1.11667,0,0,1.1066,-231.131,-213.062)",children:b("path",{d:"M2209.59,1137.35L2209.59,1098.17C2177.13,1108.99 2125.74,1121.91 2055.41,1136.94C2054.77,1137.08 2054.14,1137.21 2053.49,1137.35L1662.79,1137.35C1687.75,1101.98 1720.8,1074.35 1761.93,1054.44C1808.52,1031.9 1875.69,1012.22 1963.45,995.386C2081.86,973.146 2163.91,952.409 2209.59,933.174L2209.59,907.929C2209.59,859.241 2197.57,824.529 2173.53,803.792C2149.48,783.054 2104.1,772.686 2037.38,772.686C1992.3,772.686 1957.14,781.552 1931.89,799.284C1906.64,817.015 1886.21,848.121 1870.58,892.601L1640.67,851.127C1666.51,758.56 1710.99,690.037 1774.11,645.557C1837.22,601.077 1930.99,578.837 2055.41,578.837C2168.42,578.837 2252.57,592.211 2307.87,618.959C2363.17,645.707 2402.09,679.668 2424.63,720.842C2447.17,762.016 2458.44,837.602 2458.44,947.6L2456.7,1137.35L3021.34,1137.35C3214.79,1137.35 3371.86,1294.41 3371.86,1487.87C3371.86,1487.87 3371.86,3000.32 3371.86,3000.32C3371.86,3193.78 3214.79,3350.84 3021.34,3350.84C3021.34,3350.84 1036.45,3350.84 1036.45,3350.84C842.991,3350.84 685.93,3193.78 685.93,3000.32L685.93,1487.87C685.93,1400.21 718.174,1320.03 771.448,1258.54L772.123,1257.76L607.408,1257.76L498.311,1558L215.202,1558L730.028,236.22L1012.24,236.22L1373.06,1137.35L2209.59,1137.35ZM3284.36,2598.93L3284.36,1487.87C3284.36,1342.71 3166.5,1224.85 3021.34,1224.85C3021.34,1224.85 1036.45,1224.85 1036.45,1224.85C891.284,1224.85 773.43,1342.71 773.43,1487.87L773.43,2454.35L1438.34,1700.79L2383.22,2740.16L2878.11,2164.98L3284.36,2598.93ZM2619.44,1370.08C2775.89,1370.08 2902.91,1497.1 2902.91,1653.54C2902.91,1809.99 2775.89,1937.01 2619.44,1937.01C2462.99,1937.01 2335.98,1809.99 2335.98,1653.54C2335.98,1497.1 2462.99,1370.08 2619.44,1370.08ZM772.877,1256.89L772.849,1256.93L773.167,1256.57L772.877,1256.89ZM773.634,1256.04L773.563,1256.12L773.985,1255.64L773.634,1256.04ZM774.394,1255.18L774.276,1255.31L774.746,1254.78L774.394,1255.18ZM775.157,1254.32L774.988,1254.51L775.493,1253.95L775.157,1254.32ZM775.923,1253.47L775.698,1253.72L776.237,1253.12L775.923,1253.47ZM776.691,1252.62L776.403,1252.94L776.979,1252.3L776.691,1252.62ZM777.462,1251.77L777.098,1252.17L777.723,1251.49L777.462,1251.77ZM925.081,1155.44C868.026,1174.57 817.508,1207.99 777.775,1251.43C817.511,1207.99 868.031,1174.57 925.081,1155.44ZM925.646,1155.25L925.108,1155.43L926.103,1155.1L925.646,1155.25ZM935.286,1152.2C932.214,1153.12 929.159,1154.09 926.13,1155.09C929.165,1154.09 932.219,1153.12 935.286,1152.2ZM935.716,1152.07L935.384,1152.17L936.292,1151.89L935.716,1152.07ZM936.843,1151.73L936.451,1151.85L937.327,1151.59L936.843,1151.73ZM937.972,1151.4L937.514,1151.53L938.377,1151.28L937.972,1151.4ZM939.102,1151.07L938.57,1151.22L939.438,1150.97L939.102,1151.07ZM940.233,1150.74L939.613,1150.92L940.505,1150.67L940.233,1150.74ZM946.659,1148.98C944.639,1149.51 942.626,1150.07 940.626,1150.63C942.631,1150.06 944.642,1149.51 946.659,1148.98ZM947.056,1148.87L946.829,1148.93L947.659,1148.71L947.056,1148.87ZM948.198,1148.57L947.919,1148.65L948.705,1148.44L948.198,1148.57ZM949.342,1148.28L949.008,1148.37L949.771,1148.17L949.342,1148.28ZM950.488,1147.99L950.096,1148.09L950.848,1147.9L950.488,1147.99ZM951.635,1147.7L951.182,1147.81L951.932,1147.63L951.635,1147.7ZM952.783,1147.42L952.262,1147.55L953.022,1147.36L952.783,1147.42ZM953.933,1147.14L953.327,1147.28L954.115,1147.09L953.933,1147.14ZM958.213,1146.13C956.927,1146.42 955.644,1146.73 954.354,1147.04C955.637,1146.73 956.923,1146.43 958.213,1146.13ZM958.547,1146.06L958.409,1146.09L959.174,1145.91L958.547,1146.06ZM959.704,1145.79L959.517,1145.84L960.229,1145.68L959.704,1145.79ZM960.863,1145.54L960.626,1145.59L961.311,1145.44L960.863,1145.54ZM962.023,1145.28L961.736,1145.35L962.406,1145.2L962.023,1145.28ZM963.184,1145.03L962.846,1145.11L963.508,1144.97L963.184,1145.03ZM964.347,1144.79L963.956,1144.87L964.615,1144.73L964.347,1144.79ZM965.511,1144.55L965.066,1144.64L965.725,1144.5L965.511,1144.55ZM966.677,1144.31L966.172,1144.41L966.838,1144.28L966.677,1144.31ZM967.844,1144.08L967.269,1144.19L967.953,1144.05L967.844,1144.08ZM970.183,1143.62C969.793,1143.69 969.403,1143.77 969.013,1143.85L969.055,1143.84C969.413,1143.77 969.771,1143.7 970.129,1143.63L970.183,1143.62ZM971.354,1143.4L971.245,1143.42L971.882,1143.3L971.354,1143.4ZM972.526,1143.18L972.37,1143.21L972.987,1143.09L972.526,1143.18ZM973.7,1142.96L973.496,1143L974.103,1142.89L973.7,1142.96ZM974.876,1142.75L974.624,1142.8L975.225,1142.69L974.876,1142.75ZM976.052,1142.55L975.754,1142.6L976.349,1142.49L976.052,1142.55ZM977.23,1142.34L976.885,1142.4L977.476,1142.3L977.23,1142.34ZM978.41,1142.14L978.019,1142.21L978.605,1142.11L978.41,1142.14ZM979.59,1141.95L979.156,1142.02L979.736,1141.92L979.59,1141.95ZM980.772,1141.76L980.299,1141.83L980.868,1141.74L980.772,1141.76ZM981.955,1141.57L981.464,1141.65L982.002,1141.56L981.955,1141.57ZM983.14,1141.39L983.1,1141.39L983.605,1141.32L983.14,1141.39ZM984.326,1141.21L984.239,1141.22L984.778,1141.14L984.326,1141.21ZM985.513,1141.03L985.379,1141.05L985.928,1140.97L985.513,1141.03ZM986.702,1140.86L986.521,1140.89L987.073,1140.81L986.702,1140.86ZM987.891,1140.69L987.665,1140.73L988.218,1140.65L987.891,1140.69ZM989.082,1140.53L988.811,1140.57L989.363,1140.49L989.082,1140.53ZM990.275,1140.37L989.96,1140.41L990.508,1140.34L990.275,1140.37ZM991.468,1140.22L991.113,1140.26L991.654,1140.19L991.468,1140.22ZM992.663,1140.07L992.273,1140.12L992.8,1140.05L992.663,1140.07ZM993.859,1139.92L993.447,1139.97L993.948,1139.91L993.859,1139.92ZM995.056,1139.78L994.671,1139.82L995.097,1139.77L995.056,1139.78ZM996.255,1139.64L996.23,1139.64L996.578,1139.6L996.255,1139.64ZM997.454,1139.5L997.383,1139.51L997.852,1139.46L997.454,1139.5ZM998.655,1139.37L998.537,1139.38L999.041,1139.33L998.655,1139.37ZM999.857,1139.24L999.693,1139.26L1000.21,1139.21L999.857,1139.24ZM1001.06,1139.12L1000.85,1139.14L1001.38,1139.09L1001.06,1139.12ZM1002.26,1139L1002.01,1139.03L1002.54,1138.98L1002.26,1139ZM1003.47,1138.89L1003.18,1138.91L1003.7,1138.87L1003.47,1138.89ZM1004.68,1138.78L1004.34,1138.81L1004.86,1138.76L1004.68,1138.78ZM1005.89,1138.67L1005.52,1138.7L1006.02,1138.66L1005.89,1138.67ZM1007.1,1138.57L1006.71,1138.6L1007.18,1138.56L1007.1,1138.57ZM1008.31,1138.47L1007.96,1138.5L1008.35,1138.46L1008.31,1138.47ZM1009.52,1138.37L1009.5,1138.38L1009.72,1138.36L1009.52,1138.37ZM1010.73,1138.28L1010.67,1138.29L1011.1,1138.26L1010.73,1138.28ZM1011.94,1138.2L1011.84,1138.2L1012.32,1138.17L1011.94,1138.2ZM1013.16,1138.12L1013,1138.13L1013.51,1138.09L1013.16,1138.12ZM1014.37,1138.04L1014.17,1138.05L1014.69,1138.02L1014.37,1138.04ZM1015.59,1137.96L1015.35,1137.98L1015.86,1137.95L1015.59,1137.96ZM1016.81,1137.89L1016.52,1137.91L1017.04,1137.88L1016.81,1137.89ZM1018.03,1137.83L1017.7,1137.85L1018.21,1137.82L1018.03,1137.83ZM1019.25,1137.77L1018.89,1137.79L1019.39,1137.76L1019.25,1137.77ZM1020.47,1137.71L1020.1,1137.73L1020.56,1137.71L1020.47,1137.71ZM1021.69,1137.66L1021.36,1137.67L1021.74,1137.66L1021.69,1137.66ZM1022.92,1137.61L1022.91,1137.61L1023.02,1137.61L1022.92,1137.61ZM1024.14,1137.57L1024.09,1137.57L1024.49,1137.55L1024.14,1137.57ZM1025.37,1137.52L1025.27,1137.53L1025.74,1137.51L1025.37,1137.52ZM1026.6,1137.49L1026.45,1137.49L1026.94,1137.48L1026.6,1137.49ZM1027.82,1137.46L1027.63,1137.46L1028.14,1137.45L1027.82,1137.46ZM1029.05,1137.43L1028.81,1137.43L1029.33,1137.42L1029.05,1137.43ZM1030.28,1137.41L1030,1137.41L1030.52,1137.4L1030.28,1137.41ZM1031.51,1137.39L1031.19,1137.39L1031.7,1137.38L1031.51,1137.39ZM1032.75,1137.37L1032.39,1137.38L1032.89,1137.37L1032.75,1137.37ZM1033.98,1137.36L1033.61,1137.36L1034.07,1137.36L1033.98,1137.36ZM1035.21,1137.35L1034.87,1137.36L1035.26,1137.35L1035.21,1137.35ZM1050.1,1035.06L867.977,544.575L689.455,1035.06L1050.1,1035.06Z"})})}),QLe=Ye({displayName:"TrainingIcon",viewBox:"0 0 3544 3544",path:b("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M0,768.593L0,2774.71C0,2930.6 78.519,3068.3 198.135,3150.37C273.059,3202.68 364.177,3233.38 462.407,3233.38C462.407,3233.38 3080.9,3233.38 3080.9,3233.38C3179.13,3233.38 3270.25,3202.68 3345.17,3150.37C3464.79,3068.3 3543.31,2930.6 3543.31,2774.71L3543.31,768.593C3543.31,517.323 3339.31,313.324 3088.04,313.324L455.269,313.324C203.999,313.324 0,517.323 0,768.593ZM3427.88,775.73L3427.88,2770.97C3427.88,2962.47 3272.4,3117.95 3080.9,3117.95L462.407,3117.95C270.906,3117.95 115.431,2962.47 115.431,2770.97C115.431,2770.97 115.431,775.73 115.431,775.73C115.431,584.229 270.906,428.755 462.407,428.755C462.407,428.755 3080.9,428.755 3080.9,428.755C3272.4,428.755 3427.88,584.229 3427.88,775.73ZM796.24,1322.76L796.24,1250.45C796.24,1199.03 836.16,1157.27 885.331,1157.27C885.331,1157.27 946.847,1157.27 946.847,1157.27C996.017,1157.27 1035.94,1199.03 1035.94,1250.45L1035.94,1644.81L2507.37,1644.81L2507.37,1250.45C2507.37,1199.03 2547.29,1157.27 2596.46,1157.27C2596.46,1157.27 2657.98,1157.27 2657.98,1157.27C2707.15,1157.27 2747.07,1199.03 2747.07,1250.45L2747.07,1322.76C2756.66,1319.22 2767.02,1317.29 2777.83,1317.29C2777.83,1317.29 2839.34,1317.29 2839.34,1317.29C2888.51,1317.29 2928.43,1357.21 2928.43,1406.38L2928.43,1527.32C2933.51,1526.26 2938.77,1525.71 2944.16,1525.71L2995.3,1525.71C3036.18,1525.71 3069.37,1557.59 3069.37,1596.86C3069.37,1596.86 3069.37,1946.44 3069.37,1946.44C3069.37,1985.72 3036.18,2017.6 2995.3,2017.6C2995.3,2017.6 2944.16,2017.6 2944.16,2017.6C2938.77,2017.6 2933.51,2017.04 2928.43,2015.99L2928.43,2136.92C2928.43,2186.09 2888.51,2226.01 2839.34,2226.01L2777.83,2226.01C2767.02,2226.01 2756.66,2224.08 2747.07,2220.55L2747.07,2292.85C2747.07,2344.28 2707.15,2386.03 2657.98,2386.03C2657.98,2386.03 2596.46,2386.03 2596.46,2386.03C2547.29,2386.03 2507.37,2344.28 2507.37,2292.85L2507.37,1898.5L1035.94,1898.5L1035.94,2292.85C1035.94,2344.28 996.017,2386.03 946.847,2386.03C946.847,2386.03 885.331,2386.03 885.331,2386.03C836.16,2386.03 796.24,2344.28 796.24,2292.85L796.24,2220.55C786.651,2224.08 776.29,2226.01 765.482,2226.01L703.967,2226.01C654.796,2226.01 614.876,2186.09 614.876,2136.92L614.876,2015.99C609.801,2017.04 604.539,2017.6 599.144,2017.6C599.144,2017.6 548.003,2017.6 548.003,2017.6C507.125,2017.6 473.937,1985.72 473.937,1946.44C473.937,1946.44 473.937,1596.86 473.937,1596.86C473.937,1557.59 507.125,1525.71 548.003,1525.71L599.144,1525.71C604.539,1525.71 609.801,1526.26 614.876,1527.32L614.876,1406.38C614.876,1357.21 654.796,1317.29 703.967,1317.29C703.967,1317.29 765.482,1317.29 765.482,1317.29C776.29,1317.29 786.651,1319.22 796.24,1322.76ZM977.604,1250.45C977.604,1232.7 963.822,1218.29 946.847,1218.29L885.331,1218.29C868.355,1218.29 854.573,1232.7 854.573,1250.45L854.573,2292.85C854.573,2310.61 868.355,2325.02 885.331,2325.02L946.847,2325.02C963.822,2325.02 977.604,2310.61 977.604,2292.85L977.604,1250.45ZM2565.7,1250.45C2565.7,1232.7 2579.49,1218.29 2596.46,1218.29L2657.98,1218.29C2674.95,1218.29 2688.73,1232.7 2688.73,1250.45L2688.73,2292.85C2688.73,2310.61 2674.95,2325.02 2657.98,2325.02L2596.46,2325.02C2579.49,2325.02 2565.7,2310.61 2565.7,2292.85L2565.7,1250.45ZM673.209,1406.38L673.209,2136.92C673.209,2153.9 686.991,2167.68 703.967,2167.68L765.482,2167.68C782.458,2167.68 796.24,2153.9 796.24,2136.92L796.24,1406.38C796.24,1389.41 782.458,1375.63 765.482,1375.63L703.967,1375.63C686.991,1375.63 673.209,1389.41 673.209,1406.38ZM2870.1,1406.38L2870.1,2136.92C2870.1,2153.9 2856.32,2167.68 2839.34,2167.68L2777.83,2167.68C2760.85,2167.68 2747.07,2153.9 2747.07,2136.92L2747.07,1406.38C2747.07,1389.41 2760.85,1375.63 2777.83,1375.63L2839.34,1375.63C2856.32,1375.63 2870.1,1389.41 2870.1,1406.38ZM614.876,1577.5C610.535,1574.24 605.074,1572.3 599.144,1572.3L548.003,1572.3C533.89,1572.3 522.433,1583.3 522.433,1596.86L522.433,1946.44C522.433,1960 533.89,1971.01 548.003,1971.01L599.144,1971.01C605.074,1971.01 610.535,1969.07 614.876,1965.81L614.876,1577.5ZM2928.43,1965.81L2928.43,1577.5C2932.77,1574.24 2938.23,1572.3 2944.16,1572.3L2995.3,1572.3C3009.42,1572.3 3020.87,1583.3 3020.87,1596.86L3020.87,1946.44C3020.87,1960 3009.42,1971.01 2995.3,1971.01L2944.16,1971.01C2938.23,1971.01 2932.77,1969.07 2928.43,1965.81ZM2507.37,1703.14L1035.94,1703.14L1035.94,1840.16L2507.37,1840.16L2507.37,1898.38L2507.37,1659.46L2507.37,1703.14Z"})}),JLe=Ye({displayName:"UnifiedCanvasIcon",viewBox:"0 0 3544 3544",path:b("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M3543.31,770.787C3543.31,515.578 3336.11,308.38 3080.9,308.38L462.407,308.38C207.197,308.38 -0,515.578 -0,770.787L-0,2766.03C-0,3021.24 207.197,3228.44 462.407,3228.44L3080.9,3228.44C3336.11,3228.44 3543.31,3021.24 3543.31,2766.03C3543.31,2766.03 3543.31,770.787 3543.31,770.787ZM922.933,3113.01L462.407,3113.01C437.741,3113.01 413.674,3110.43 390.453,3105.52L390.453,2899.11L922.933,2899.11L922.933,3113.01ZM947.933,2899.11L947.933,3113.01L1480.41,3113.01L1480.41,2899.11L947.933,2899.11ZM1505.41,2899.11L1505.41,3113.01L2037.89,3113.01L2037.89,2899.11L1505.41,2899.11ZM2062.89,2899.11L2062.89,3113.01L2595.37,3113.01L2595.37,2899.11L2062.89,2899.11ZM3152.85,3105.52C3129.63,3110.43 3105.57,3113.01 3080.9,3113.01L2620.37,3113.01L2620.37,2899.11L3152.85,2899.11L3152.85,3105.52ZM365.453,3099.26L365.408,3099.24C354.521,3096.07 343.79,3092.37 333.266,3088.14C315.377,3080.95 298.094,3072.26 281.651,3062.2C263.114,3050.85 245.648,3037.77 229.544,3023.17C213.34,3008.49 198.518,2992.28 185.34,2974.83C174.102,2959.94 164.06,2944.16 155.353,2927.66C150.517,2918.5 146.102,2909.13 142.102,2899.57L141.91,2899.11L365.453,2899.11L365.453,3099.26ZM3401.4,2899.11C3361.33,2995.39 3279.12,3069.8 3177.85,3099.26L3177.85,2899.11L3401.4,2899.11ZM132.624,2874.11C121.465,2840.08 115.431,2803.76 115.431,2766.03L115.431,2341.63L365.453,2341.63L365.453,2874.11L132.624,2874.11ZM922.933,918.103L922.933,669.193L390.453,669.193L390.453,1201.67L731.014,1201.67L731.014,1226.67L390.453,1226.67L390.453,1759.15L731.014,1759.15L731.014,1784.15L390.453,1784.15L390.453,2316.63L731.014,2316.63L731.014,2341.63L390.453,2341.63L390.453,2874.11L922.933,2874.11L922.933,2625.2C931.122,2627.1 939.463,2628.6 947.933,2629.66L947.933,2874.11L1480.41,2874.11L1480.41,2631.62L1505.41,2631.62L1505.41,2874.11L2037.89,2874.11L2037.89,2631.62L2062.89,2631.62L2062.89,2874.11L2595.37,2874.11L2595.37,2629.66C2603.85,2628.6 2612.18,2627.1 2620.37,2625.2L2620.37,2874.11L3152.85,2874.11L3152.85,2341.63L2812.29,2341.63L2812.29,2316.63L3152.85,2316.63L3152.85,1784.15L2812.29,1784.15L2812.29,1759.15L3152.85,1759.15L3152.85,1226.67L2812.29,1226.67L2812.29,1201.67L3152.85,1201.67L3152.85,669.193L2620.37,669.193L2620.37,918.103C2612.18,916.203 2603.84,914.708 2595.37,913.642L2595.37,669.193L2062.89,669.193L2062.89,911.688L2037.89,911.688L2037.89,669.193L1505.41,669.193L1505.41,911.688L1480.41,911.688L1480.41,669.193L947.933,669.193L947.933,913.642C939.462,914.708 931.123,916.203 922.933,918.103ZM3427.88,2341.63L3427.88,2766.03C3427.88,2803.76 3421.84,2840.08 3410.68,2874.11L3177.85,2874.11L3177.85,2341.63L3427.88,2341.63ZM2494.01,2603.04L2524.53,2603.04C2541.26,2603.04 2557.62,2601.44 2573.47,2598.39L2598.02,2593.66L2588.56,2544.56L2564.01,2549.29C2551.23,2551.75 2538.03,2553.04 2524.53,2553.04L2494.01,2553.04L2494.01,2603.04ZM1294.01,2603.04L1394.01,2603.04L1394.01,2553.04L1294.01,2553.04L1294.01,2603.04ZM1894.01,2603.04L1994.01,2603.04L1994.01,2553.04L1894.01,2553.04L1894.01,2603.04ZM2194.01,2603.04L2294.01,2603.04L2294.01,2553.04L2194.01,2553.04L2194.01,2603.04ZM1144.01,2603.04L1244.01,2603.04L1244.01,2553.04L1144.01,2553.04L1144.01,2603.04ZM1444.01,2603.04L1544.01,2603.04L1544.01,2553.04L1444.01,2553.04L1444.01,2603.04ZM1594.01,2603.04L1694.01,2603.04L1694.01,2553.04L1594.01,2553.04L1594.01,2603.04ZM2344.01,2603.04L2444.01,2603.04L2444.01,2553.04L2344.01,2553.04L2344.01,2603.04ZM2044.01,2603.04L2144.01,2603.04L2144.01,2553.04L2044.01,2553.04L2044.01,2603.04ZM994.01,2603.04L1094.01,2603.04L1094.01,2553.04L994.01,2553.04L994.01,2603.04ZM1744.01,2603.04L1844.01,2603.04L1844.01,2553.04L1744.01,2553.04L1744.01,2603.04ZM864.145,2551.46C878.835,2562.5 894.741,2572 911.624,2579.74L934.352,2590.15L955.18,2544.7L932.452,2534.28C918.844,2528.05 906.024,2520.39 894.185,2511.49L874.199,2496.47L844.16,2536.44L864.145,2551.46ZM2674.44,2554.92C2689.46,2544.16 2703.28,2531.82 2715.65,2518.14L2732.42,2499.61L2695.35,2466.06L2678.58,2484.6C2668.59,2495.63 2657.44,2505.59 2645.32,2514.28L2625,2528.84L2654.12,2569.48L2674.44,2554.92ZM865.632,1911.31L1339.59,1374.15L2030.89,2134.59L2392.97,1713.77L2677.68,2017.9L2677.68,2324.93C2677.68,2424.23 2597.06,2504.85 2497.76,2504.85C2497.76,2504.85 1045.55,2504.85 1045.55,2504.85C946.251,2504.85 865.632,2424.23 865.632,2324.93L865.632,1911.31ZM771.251,2417.22C776.455,2435.14 783.552,2452.26 792.313,2468.35L804.27,2490.3L848.18,2466.39L836.223,2444.43C829.171,2431.49 823.457,2417.7 819.268,2403.28L812.297,2379.27L764.28,2393.21L771.251,2417.22ZM2770.36,2422.83C2775.83,2405.47 2779.52,2387.33 2781.2,2368.61L2783.43,2343.71L2733.64,2339.24L2731.4,2364.14C2730.05,2379.21 2727.08,2393.82 2722.67,2407.79L2715.15,2431.63L2762.84,2446.67L2770.36,2422.83ZM761.068,2236.12L761.068,2336.12L811.068,2336.12L811.068,2236.12L761.068,2236.12ZM3177.85,1784.15L3177.85,2316.63L3427.88,2316.63L3427.88,1784.15L3177.85,1784.15ZM115.431,1784.15L115.431,2316.63L365.453,2316.63L365.453,1784.15L115.431,1784.15ZM2782.24,2291.41L2782.24,2191.41L2732.24,2191.41L2732.24,2291.41L2782.24,2291.41ZM761.068,2086.12L761.068,2186.12L811.068,2186.12L811.068,2086.12L761.068,2086.12ZM2782.24,2141.41L2782.24,2041.4L2732.24,2041.4L2732.24,2141.41L2782.24,2141.41ZM761.068,1936.12L761.068,2036.12L811.068,2036.12L811.068,1936.12L761.068,1936.12ZM2782.24,1991.4L2782.24,1891.4L2732.24,1891.4L2732.24,1991.4L2782.24,1991.4ZM761.068,1786.12L761.068,1886.12L811.068,1886.12L811.068,1786.12L761.068,1786.12ZM2782.24,1841.4L2782.24,1741.41L2732.24,1741.41L2732.24,1841.4L2782.24,1841.4ZM3177.85,1226.67L3177.85,1759.15L3427.88,1759.15L3427.88,1226.67L3177.85,1226.67ZM115.431,1226.67L115.431,1759.15L365.453,1759.15L365.453,1226.67L115.431,1226.67ZM761.068,1636.12L761.068,1736.12L811.068,1736.12L811.068,1636.12L761.068,1636.12ZM2782.24,1691.41L2782.24,1591.41L2732.24,1591.41L2732.24,1691.41L2782.24,1691.41ZM761.068,1486.12L761.068,1586.12L811.068,1586.12L811.068,1486.12L761.068,1486.12ZM2203.72,1132.2C2318.18,1132.2 2411.11,1225.13 2411.11,1339.59C2411.11,1454.05 2318.18,1546.98 2203.72,1546.98C2089.26,1546.98 1996.33,1454.05 1996.33,1339.59C1996.33,1225.13 2089.26,1132.2 2203.72,1132.2ZM2782.24,1541.41L2782.24,1441.41L2732.24,1441.41L2732.24,1541.41L2782.24,1541.41ZM761.068,1336.12L761.068,1436.12L811.068,1436.12L811.068,1336.12L761.068,1336.12ZM2782.24,1391.41L2782.24,1291.41L2732.24,1291.41L2732.24,1391.41L2782.24,1391.41ZM761.068,1186.12L761.068,1286.12L811.068,1286.12L811.068,1186.12L761.068,1186.12ZM2732.24,1197.98L2732.24,1241.41L2782.24,1241.41L2782.24,1172.98L2781.03,1172.98C2780.06,1162.82 2778.49,1152.83 2776.36,1143.04L2771.04,1118.62L2722.18,1129.24L2727.5,1153.67C2730.61,1167.95 2732.24,1182.78 2732.24,1197.98ZM3412.74,669.193L3412.89,669.694C3414.66,675.5 3416.28,681.348 3417.73,687.238C3420.46,698.265 3422.65,709.427 3424.28,720.67C3425.85,731.554 3426.91,742.513 3427.45,753.497C3427.74,759.256 3427.87,765.021 3427.88,770.787L3427.88,1201.67L3177.85,1201.67L3177.85,669.193L3412.74,669.193ZM115.431,1201.67L115.431,770.787C115.436,765.021 115.572,759.256 115.855,753.497C116.395,742.513 117.453,731.554 119.031,720.67C120.66,709.427 122.844,698.265 125.574,687.238C127.032,681.348 128.65,675.5 130.414,669.694L130.567,669.193L365.453,669.193L365.453,1201.67L115.431,1201.67ZM804.386,1055C794.186,1070.26 785.572,1086.67 778.777,1103.99L769.647,1127.26L816.194,1145.52L825.324,1122.25C830.797,1108.3 837.738,1095.08 845.955,1082.79L859.848,1062L818.279,1034.21L804.386,1055ZM2730.5,1043.14C2719.39,1028.39 2706.73,1014.86 2692.77,1002.81L2673.84,986.48L2641.17,1024.34L2660.1,1040.67C2671.37,1050.39 2681.59,1061.31 2690.56,1073.22L2705.6,1093.19L2745.54,1063.11L2730.5,1043.14ZM933.266,954.821C915.698,961.006 898.998,969.041 883.402,978.694L862.144,991.851L888.457,1034.37L909.715,1021.21C922.275,1013.44 935.723,1006.96 949.871,1001.98L973.452,993.681L956.848,946.518L933.266,954.821ZM2596.18,950.378C2578.71,945.327 2560.49,942.072 2541.72,940.832L2516.78,939.183L2513.48,989.074L2538.43,990.723C2553.54,991.722 2568.22,994.341 2582.28,998.409L2606.3,1005.36L2620.19,957.325L2596.18,950.378ZM2165.09,940.265L2065.09,940.265L2065.09,990.265L2165.09,990.265L2165.09,940.265ZM1865.08,940.265L1765.08,940.265L1765.08,990.265L1865.08,990.265L1865.08,940.265ZM1115.08,940.265L1015.08,940.265L1015.08,990.265L1115.08,990.265L1115.08,940.265ZM2015.09,940.265L1915.09,940.265L1915.09,990.265L2015.09,990.265L2015.09,940.265ZM2315.09,940.265L2215.09,940.265L2215.09,990.265L2315.09,990.265L2315.09,940.265ZM1265.08,940.265L1165.08,940.265L1165.08,990.265L1265.08,990.265L1265.08,940.265ZM1415.08,940.265L1315.08,940.265L1315.08,990.265L1415.08,990.265L1415.08,940.265ZM1565.08,940.265L1465.08,940.265L1465.08,990.265L1565.08,990.265L1565.08,940.265ZM1715.08,940.265L1615.08,940.265L1615.08,990.265L1715.08,990.265L1715.08,940.265ZM2465.09,940.265L2365.09,940.265L2365.09,990.265L2465.09,990.265L2465.09,940.265ZM365.453,437.562L365.453,644.193L139.286,644.193C178.303,544.782 261.917,467.677 365.453,437.562ZM922.933,423.812L922.933,644.193L390.453,644.193L390.453,431.295C413.674,426.391 437.741,423.812 462.407,423.812L922.933,423.812ZM947.933,423.812L947.933,644.193L1480.41,644.193L1480.41,423.812L947.933,423.812ZM1505.41,423.812L1505.41,644.193L2037.89,644.193L2037.89,423.812L1505.41,423.812ZM2062.89,423.812L2062.89,644.193L2595.37,644.193L2595.37,423.812L2062.89,423.812ZM2620.37,423.812L3080.9,423.812C3105.57,423.812 3129.63,426.391 3152.85,431.295L3152.85,644.193L2620.37,644.193L2620.37,423.812ZM3177.85,437.562C3281.38,467.669 3365,544.774 3404.02,644.193L3177.85,644.193L3177.85,437.562Z"})}),Ie=pe((e,t)=>{const{tooltip:n="",styleClass:r,tooltipProps:i,asCheckbox:o,isChecked:a,...s}=e;return b(ri,{label:n,hasArrow:!0,...i,...i!=null&&i.placement?{placement:i.placement}:{placement:"top"},children:b(_o,{ref:t,className:r?`invokeai__icon-button ${r}`:"invokeai__icon-button","data-as-checkbox":o,"data-selected":a!==void 0?a:void 0,...s})})}),kn=pe((e,t)=>{const{children:n,tooltip:r="",tooltipProps:i,styleClass:o,...a}=e;return b(ri,{label:r,...i,children:b(xo,{ref:t,className:["invokeai__button",o].join(" "),...a,children:n})})}),sa=e=>{const{triggerComponent:t,children:n,styleClass:r,hasArrow:i=!0,...o}=e;return j(J8,{...o,children:[b(n_,{children:t}),j(t_,{className:`invokeai__popover-content ${r}`,children:[i&&b(e_,{className:"invokeai__popover-arrow"}),n]})]})},o4=Fe(e=>e.lightbox,e=>e,{memoizeOptions:{equalityCheck:Ue}}),bR=/^-?(0\.)?\.?$/,pi=e=>{const{label:t,labelFontSize:n="sm",styleClass:r,isDisabled:i=!1,showStepper:o=!0,width:a,textAlign:s,isInvalid:l,value:u,onChange:c,min:f,max:p,isInteger:m=!0,formControlProps:g,formLabelProps:v,numberInputFieldProps:x,numberInputStepperProps:C,tooltipProps:w,...k}=e,[P,L]=S.useState(String(u));S.useEffect(()=>{!P.match(bR)&&u!==Number(P)&&L(String(u))},[u,P]);const A=I=>{L(I),I.match(bR)||c(m?Math.floor(Number(I)):Number(I))},O=I=>{const $=ti(m?Math.floor(Number(I.target.value)):Number(I.target.value),f,p);L(String($)),c($)};return b(ri,{...w,children:j(Tt,{isDisabled:i,isInvalid:l,className:r?`invokeai__number-input-form-control ${r}`:"invokeai__number-input-form-control",...g,children:[t&&b(Ht,{className:"invokeai__number-input-form-label",style:{display:t?"block":"none"},fontSize:n,fontWeight:"bold",marginRight:0,marginBottom:0,whiteSpace:"nowrap",...v,children:t}),j(q8,{className:"invokeai__number-input-root",value:P,min:f,max:p,keepWithinRange:!0,clampValueOnBlur:!1,onChange:A,onBlur:O,width:a,...k,children:[b(X8,{className:"invokeai__number-input-field",textAlign:s,...x}),o&&j("div",{className:"invokeai__number-input-stepper",children:[b(Q8,{...C,className:"invokeai__number-input-stepper-button"}),b(Z8,{...C,className:"invokeai__number-input-stepper-button"})]})]})]})})},da=e=>{const{label:t,isDisabled:n,validValues:r,tooltip:i,tooltipProps:o,size:a="sm",fontSize:s="sm",styleClass:l,...u}=e;return j(Tt,{isDisabled:n,className:`invokeai__select ${l}`,onClick:c=>{c.stopPropagation(),c.nativeEvent.stopImmediatePropagation(),c.nativeEvent.stopPropagation(),c.nativeEvent.cancelBubble=!0},children:[t&&b(Ht,{className:"invokeai__select-label",fontSize:s,fontWeight:"bold",marginRight:0,marginBottom:0,whiteSpace:"nowrap",children:t}),b(ri,{label:i,...o,children:b(oV,{className:"invokeai__select-picker",fontSize:s,size:a,...u,children:r.map(c=>typeof c=="string"||typeof c=="number"?b("option",{value:c,className:"invokeai__select-option",children:c},c):b("option",{value:c.value,className:"invokeai__select-option",children:c.key},c.value))})})]})},R1=e=>e.postprocessing;function eAe(e,t,n,r){var i=-1,o=e==null?0:e.length;for(r&&o&&(n=e[++i]);++ie.system,yMe=e=>e.system.toastQueue,jG=Fe(vn,e=>{const{model_list:t}=e,n=vMe(t,(r,i,o)=>(i.status==="active"&&(r=o),r),"");return{...t[n],name:n}},{memoizeOptions:{resultEqualityCheck:Ue}}),bMe=Fe([R1,vn],({facetoolStrength:e,facetoolType:t,codeformerFidelity:n},{isGFPGANAvailable:r})=>({facetoolStrength:e,facetoolType:t,codeformerFidelity:n,isGFPGANAvailable:r}),{memoizeOptions:{resultEqualityCheck:Ue}}),ok=()=>{const e=ge(),{facetoolStrength:t,facetoolType:n,codeformerFidelity:r,isGFPGANAvailable:i}=ne(bMe),o=u=>e(B2(u)),a=u=>e(uW(u)),s=u=>e(F2(u.target.value)),{t:l}=Ce();return j(Le,{direction:"column",gap:2,children:[b(da,{label:l("parameters:type"),validValues:Xke.concat(),value:n,onChange:s}),b(pi,{isDisabled:!i,label:l("parameters:strength"),step:.05,min:0,max:1,onChange:o,value:t,width:"90px",isInteger:!1}),n==="codeformer"&&b(pi,{isDisabled:!i,label:l("parameters:codeformerFidelity"),step:.05,min:0,max:1,onChange:a,value:r,width:"90px",isInteger:!1})]})},SMe=Fe([R1,vn],({upscalingLevel:e,upscalingStrength:t},{isESRGANAvailable:n})=>({upscalingLevel:e,upscalingStrength:t,isESRGANAvailable:n}),{memoizeOptions:{resultEqualityCheck:Ue}}),ak=()=>{const e=ge(),{upscalingLevel:t,upscalingStrength:n,isESRGANAvailable:r}=ne(SMe),{t:i}=Ce(),o=s=>e(Ox(Number(s.target.value))),a=s=>e(Mx(s));return j("div",{className:"upscale-settings",children:[b(da,{isDisabled:!r,label:i("parameters:scale"),value:t,onChange:o,validValues:qke}),b(pi,{isDisabled:!r,label:i("parameters:strength"),step:.05,min:0,max:1,onChange:a,value:n,isInteger:!1})]})};var wMe=Object.create,HG=Object.defineProperty,CMe=Object.getOwnPropertyDescriptor,xMe=Object.getOwnPropertyNames,_Me=Object.getPrototypeOf,kMe=Object.prototype.hasOwnProperty,ke=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),EMe=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of xMe(t))!kMe.call(e,i)&&i!==n&&HG(e,i,{get:()=>t[i],enumerable:!(r=CMe(t,i))||r.enumerable});return e},VG=(e,t,n)=>(n=e!=null?wMe(_Me(e)):{},EMe(t||!e||!e.__esModule?HG(n,"default",{value:e,enumerable:!0}):n,e)),PMe=ke((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n}),UG=ke((e,t)=>{function n(r,i){return r===i||r!==r&&i!==i}t.exports=n}),l4=ke((e,t)=>{var n=UG();function r(i,o){for(var a=i.length;a--;)if(n(i[a][0],o))return a;return-1}t.exports=r}),TMe=ke((e,t)=>{var n=l4(),r=Array.prototype,i=r.splice;function o(a){var s=this.__data__,l=n(s,a);if(l<0)return!1;var u=s.length-1;return l==u?s.pop():i.call(s,l,1),--this.size,!0}t.exports=o}),LMe=ke((e,t)=>{var n=l4();function r(i){var o=this.__data__,a=n(o,i);return a<0?void 0:o[a][1]}t.exports=r}),AMe=ke((e,t)=>{var n=l4();function r(i){return n(this.__data__,i)>-1}t.exports=r}),OMe=ke((e,t)=>{var n=l4();function r(i,o){var a=this.__data__,s=n(a,i);return s<0?(++this.size,a.push([i,o])):a[s][1]=o,this}t.exports=r}),u4=ke((e,t)=>{var n=PMe(),r=TMe(),i=LMe(),o=AMe(),a=OMe();function s(l){var u=-1,c=l==null?0:l.length;for(this.clear();++u{var n=u4();function r(){this.__data__=new n,this.size=0}t.exports=r}),IMe=ke((e,t)=>{function n(r){var i=this.__data__,o=i.delete(r);return this.size=i.size,o}t.exports=n}),RMe=ke((e,t)=>{function n(r){return this.__data__.get(r)}t.exports=n}),$Me=ke((e,t)=>{function n(r){return this.__data__.has(r)}t.exports=n}),WG=ke((e,t)=>{var n=typeof global=="object"&&global&&global.Object===Object&&global;t.exports=n}),Js=ke((e,t)=>{var n=WG(),r=typeof self=="object"&&self&&self.Object===Object&&self,i=n||r||Function("return this")();t.exports=i}),sk=ke((e,t)=>{var n=Js(),r=n.Symbol;t.exports=r}),DMe=ke((e,t)=>{var n=sk(),r=Object.prototype,i=r.hasOwnProperty,o=r.toString,a=n?n.toStringTag:void 0;function s(l){var u=i.call(l,a),c=l[a];try{l[a]=void 0;var f=!0}catch(m){}var p=o.call(l);return f&&(u?l[a]=c:delete l[a]),p}t.exports=s}),NMe=ke((e,t)=>{var n=Object.prototype,r=n.toString;function i(o){return r.call(o)}t.exports=i}),c4=ke((e,t)=>{var n=sk(),r=DMe(),i=NMe(),o="[object Null]",a="[object Undefined]",s=n?n.toStringTag:void 0;function l(u){return u==null?u===void 0?a:o:s&&s in Object(u)?r(u):i(u)}t.exports=l}),GG=ke((e,t)=>{function n(r){var i=typeof r;return r!=null&&(i=="object"||i=="function")}t.exports=n}),KG=ke((e,t)=>{var n=c4(),r=GG(),i="[object AsyncFunction]",o="[object Function]",a="[object GeneratorFunction]",s="[object Proxy]";function l(u){if(!r(u))return!1;var c=n(u);return c==o||c==a||c==i||c==s}t.exports=l}),BMe=ke((e,t)=>{var n=Js(),r=n["__core-js_shared__"];t.exports=r}),FMe=ke((e,t)=>{var n=BMe(),r=function(){var o=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}();function i(o){return!!r&&r in o}t.exports=i}),YG=ke((e,t)=>{var n=Function.prototype,r=n.toString;function i(o){if(o!=null){try{return r.call(o)}catch(a){}try{return o+""}catch(a){}}return""}t.exports=i}),zMe=ke((e,t)=>{var n=KG(),r=FMe(),i=GG(),o=YG(),a=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,l=Function.prototype,u=Object.prototype,c=l.toString,f=u.hasOwnProperty,p=RegExp("^"+c.call(f).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function m(g){if(!i(g)||r(g))return!1;var v=n(g)?p:s;return v.test(o(g))}t.exports=m}),jMe=ke((e,t)=>{function n(r,i){return r==null?void 0:r[i]}t.exports=n}),Qh=ke((e,t)=>{var n=zMe(),r=jMe();function i(o,a){var s=r(o,a);return n(s)?s:void 0}t.exports=i}),lk=ke((e,t)=>{var n=Qh(),r=Js(),i=n(r,"Map");t.exports=i}),d4=ke((e,t)=>{var n=Qh(),r=n(Object,"create");t.exports=r}),HMe=ke((e,t)=>{var n=d4();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r}),VMe=ke((e,t)=>{function n(r){var i=this.has(r)&&delete this.__data__[r];return this.size-=i?1:0,i}t.exports=n}),UMe=ke((e,t)=>{var n=d4(),r="__lodash_hash_undefined__",i=Object.prototype,o=i.hasOwnProperty;function a(s){var l=this.__data__;if(n){var u=l[s];return u===r?void 0:u}return o.call(l,s)?l[s]:void 0}t.exports=a}),WMe=ke((e,t)=>{var n=d4(),r=Object.prototype,i=r.hasOwnProperty;function o(a){var s=this.__data__;return n?s[a]!==void 0:i.call(s,a)}t.exports=o}),GMe=ke((e,t)=>{var n=d4(),r="__lodash_hash_undefined__";function i(o,a){var s=this.__data__;return this.size+=this.has(o)?0:1,s[o]=n&&a===void 0?r:a,this}t.exports=i}),KMe=ke((e,t)=>{var n=HMe(),r=VMe(),i=UMe(),o=WMe(),a=GMe();function s(l){var u=-1,c=l==null?0:l.length;for(this.clear();++u{var n=KMe(),r=u4(),i=lk();function o(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=o}),qMe=ke((e,t)=>{function n(r){var i=typeof r;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?r!=="__proto__":r===null}t.exports=n}),f4=ke((e,t)=>{var n=qMe();function r(i,o){var a=i.__data__;return n(o)?a[typeof o=="string"?"string":"hash"]:a.map}t.exports=r}),XMe=ke((e,t)=>{var n=f4();function r(i){var o=n(this,i).delete(i);return this.size-=o?1:0,o}t.exports=r}),ZMe=ke((e,t)=>{var n=f4();function r(i){return n(this,i).get(i)}t.exports=r}),QMe=ke((e,t)=>{var n=f4();function r(i){return n(this,i).has(i)}t.exports=r}),JMe=ke((e,t)=>{var n=f4();function r(i,o){var a=n(this,i),s=a.size;return a.set(i,o),this.size+=a.size==s?0:1,this}t.exports=r}),qG=ke((e,t)=>{var n=YMe(),r=XMe(),i=ZMe(),o=QMe(),a=JMe();function s(l){var u=-1,c=l==null?0:l.length;for(this.clear();++u{var n=u4(),r=lk(),i=qG(),o=200;function a(s,l){var u=this.__data__;if(u instanceof n){var c=u.__data__;if(!r||c.length{var n=u4(),r=MMe(),i=IMe(),o=RMe(),a=$Me(),s=eIe();function l(u){var c=this.__data__=new n(u);this.size=c.size}l.prototype.clear=r,l.prototype.delete=i,l.prototype.get=o,l.prototype.has=a,l.prototype.set=s,t.exports=l}),nIe=ke((e,t)=>{var n="__lodash_hash_undefined__";function r(i){return this.__data__.set(i,n),this}t.exports=r}),rIe=ke((e,t)=>{function n(r){return this.__data__.has(r)}t.exports=n}),iIe=ke((e,t)=>{var n=qG(),r=nIe(),i=rIe();function o(a){var s=-1,l=a==null?0:a.length;for(this.__data__=new n;++s{function n(r,i){for(var o=-1,a=r==null?0:r.length;++o{function n(r,i){return r.has(i)}t.exports=n}),XG=ke((e,t)=>{var n=iIe(),r=oIe(),i=aIe(),o=1,a=2;function s(l,u,c,f,p,m){var g=c&o,v=l.length,x=u.length;if(v!=x&&!(g&&x>v))return!1;var C=m.get(l),w=m.get(u);if(C&&w)return C==u&&w==l;var k=-1,P=!0,L=c&a?new n:void 0;for(m.set(l,u),m.set(u,l);++k{var n=Js(),r=n.Uint8Array;t.exports=r}),lIe=ke((e,t)=>{function n(r){var i=-1,o=Array(r.size);return r.forEach(function(a,s){o[++i]=[s,a]}),o}t.exports=n}),uIe=ke((e,t)=>{function n(r){var i=-1,o=Array(r.size);return r.forEach(function(a){o[++i]=a}),o}t.exports=n}),cIe=ke((e,t)=>{var n=sk(),r=sIe(),i=UG(),o=XG(),a=lIe(),s=uIe(),l=1,u=2,c="[object Boolean]",f="[object Date]",p="[object Error]",m="[object Map]",g="[object Number]",v="[object RegExp]",x="[object Set]",C="[object String]",w="[object Symbol]",k="[object ArrayBuffer]",P="[object DataView]",L=n?n.prototype:void 0,A=L?L.valueOf:void 0;function O(I,$,D,V,Y,z,R){switch(D){case P:if(I.byteLength!=$.byteLength||I.byteOffset!=$.byteOffset)return!1;I=I.buffer,$=$.buffer;case k:return!(I.byteLength!=$.byteLength||!z(new r(I),new r($)));case c:case f:case g:return i(+I,+$);case p:return I.name==$.name&&I.message==$.message;case v:case C:return I==$+"";case m:var N=a;case x:var U=V&l;if(N||(N=s),I.size!=$.size&&!U)return!1;var G=R.get(I);if(G)return G==$;V|=u,R.set(I,$);var B=o(N(I),N($),V,Y,z,R);return R.delete(I),B;case w:if(A)return A.call(I)==A.call($)}return!1}t.exports=O}),dIe=ke((e,t)=>{function n(r,i){for(var o=-1,a=i.length,s=r.length;++o{var n=Array.isArray;t.exports=n}),fIe=ke((e,t)=>{var n=dIe(),r=uk();function i(o,a,s){var l=a(o);return r(o)?l:n(l,s(o))}t.exports=i}),hIe=ke((e,t)=>{function n(r,i){for(var o=-1,a=r==null?0:r.length,s=0,l=[];++o{function n(){return[]}t.exports=n}),mIe=ke((e,t)=>{var n=hIe(),r=pIe(),i=Object.prototype,o=i.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(l){return l==null?[]:(l=Object(l),n(a(l),function(u){return o.call(l,u)}))}:r;t.exports=s}),gIe=ke((e,t)=>{function n(r,i){for(var o=-1,a=Array(r);++o{function n(r){return r!=null&&typeof r=="object"}t.exports=n}),vIe=ke((e,t)=>{var n=c4(),r=h4(),i="[object Arguments]";function o(a){return r(a)&&n(a)==i}t.exports=o}),yIe=ke((e,t)=>{var n=vIe(),r=h4(),i=Object.prototype,o=i.hasOwnProperty,a=i.propertyIsEnumerable,s=n(function(){return arguments}())?n:function(l){return r(l)&&o.call(l,"callee")&&!a.call(l,"callee")};t.exports=s}),bIe=ke((e,t)=>{function n(){return!1}t.exports=n}),ZG=ke((e,t)=>{var n=Js(),r=bIe(),i=typeof e=="object"&&e&&!e.nodeType&&e,o=i&&typeof t=="object"&&t&&!t.nodeType&&t,a=o&&o.exports===i,s=a?n.Buffer:void 0,l=s?s.isBuffer:void 0,u=l||r;t.exports=u}),SIe=ke((e,t)=>{var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;function i(o,a){var s=typeof o;return a=a!=null?a:n,!!a&&(s=="number"||s!="symbol"&&r.test(o))&&o>-1&&o%1==0&&o{var n=9007199254740991;function r(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=n}t.exports=r}),wIe=ke((e,t)=>{var n=c4(),r=QG(),i=h4(),o="[object Arguments]",a="[object Array]",s="[object Boolean]",l="[object Date]",u="[object Error]",c="[object Function]",f="[object Map]",p="[object Number]",m="[object Object]",g="[object RegExp]",v="[object Set]",x="[object String]",C="[object WeakMap]",w="[object ArrayBuffer]",k="[object DataView]",P="[object Float32Array]",L="[object Float64Array]",A="[object Int8Array]",O="[object Int16Array]",I="[object Int32Array]",$="[object Uint8Array]",D="[object Uint8ClampedArray]",V="[object Uint16Array]",Y="[object Uint32Array]",z={};z[P]=z[L]=z[A]=z[O]=z[I]=z[$]=z[D]=z[V]=z[Y]=!0,z[o]=z[a]=z[w]=z[s]=z[k]=z[l]=z[u]=z[c]=z[f]=z[p]=z[m]=z[g]=z[v]=z[x]=z[C]=!1;function R(N){return i(N)&&r(N.length)&&!!z[n(N)]}t.exports=R}),CIe=ke((e,t)=>{function n(r){return function(i){return r(i)}}t.exports=n}),xIe=ke((e,t)=>{var n=WG(),r=typeof e=="object"&&e&&!e.nodeType&&e,i=r&&typeof t=="object"&&t&&!t.nodeType&&t,o=i&&i.exports===r,a=o&&n.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||a&&a.binding&&a.binding("util")}catch(u){}}();t.exports=s}),JG=ke((e,t)=>{var n=wIe(),r=CIe(),i=xIe(),o=i&&i.isTypedArray,a=o?r(o):n;t.exports=a}),_Ie=ke((e,t)=>{var n=gIe(),r=yIe(),i=uk(),o=ZG(),a=SIe(),s=JG(),l=Object.prototype,u=l.hasOwnProperty;function c(f,p){var m=i(f),g=!m&&r(f),v=!m&&!g&&o(f),x=!m&&!g&&!v&&s(f),C=m||g||v||x,w=C?n(f.length,String):[],k=w.length;for(var P in f)(p||u.call(f,P))&&!(C&&(P=="length"||v&&(P=="offset"||P=="parent")||x&&(P=="buffer"||P=="byteLength"||P=="byteOffset")||a(P,k)))&&w.push(P);return w}t.exports=c}),kIe=ke((e,t)=>{var n=Object.prototype;function r(i){var o=i&&i.constructor,a=typeof o=="function"&&o.prototype||n;return i===a}t.exports=r}),EIe=ke((e,t)=>{function n(r,i){return function(o){return r(i(o))}}t.exports=n}),PIe=ke((e,t)=>{var n=EIe(),r=n(Object.keys,Object);t.exports=r}),TIe=ke((e,t)=>{var n=kIe(),r=PIe(),i=Object.prototype,o=i.hasOwnProperty;function a(s){if(!n(s))return r(s);var l=[];for(var u in Object(s))o.call(s,u)&&u!="constructor"&&l.push(u);return l}t.exports=a}),LIe=ke((e,t)=>{var n=KG(),r=QG();function i(o){return o!=null&&r(o.length)&&!n(o)}t.exports=i}),AIe=ke((e,t)=>{var n=_Ie(),r=TIe(),i=LIe();function o(a){return i(a)?n(a):r(a)}t.exports=o}),OIe=ke((e,t)=>{var n=fIe(),r=mIe(),i=AIe();function o(a){return n(a,i,r)}t.exports=o}),MIe=ke((e,t)=>{var n=OIe(),r=1,i=Object.prototype,o=i.hasOwnProperty;function a(s,l,u,c,f,p){var m=u&r,g=n(s),v=g.length,x=n(l),C=x.length;if(v!=C&&!m)return!1;for(var w=v;w--;){var k=g[w];if(!(m?k in l:o.call(l,k)))return!1}var P=p.get(s),L=p.get(l);if(P&&L)return P==l&&L==s;var A=!0;p.set(s,l),p.set(l,s);for(var O=m;++w{var n=Qh(),r=Js(),i=n(r,"DataView");t.exports=i}),RIe=ke((e,t)=>{var n=Qh(),r=Js(),i=n(r,"Promise");t.exports=i}),$Ie=ke((e,t)=>{var n=Qh(),r=Js(),i=n(r,"Set");t.exports=i}),DIe=ke((e,t)=>{var n=Qh(),r=Js(),i=n(r,"WeakMap");t.exports=i}),NIe=ke((e,t)=>{var n=IIe(),r=lk(),i=RIe(),o=$Ie(),a=DIe(),s=c4(),l=YG(),u="[object Map]",c="[object Object]",f="[object Promise]",p="[object Set]",m="[object WeakMap]",g="[object DataView]",v=l(n),x=l(r),C=l(i),w=l(o),k=l(a),P=s;(n&&P(new n(new ArrayBuffer(1)))!=g||r&&P(new r)!=u||i&&P(i.resolve())!=f||o&&P(new o)!=p||a&&P(new a)!=m)&&(P=function(L){var A=s(L),O=A==c?L.constructor:void 0,I=O?l(O):"";if(I)switch(I){case v:return g;case x:return u;case C:return f;case w:return p;case k:return m}return A}),t.exports=P}),BIe=ke((e,t)=>{var n=tIe(),r=XG(),i=cIe(),o=MIe(),a=NIe(),s=uk(),l=ZG(),u=JG(),c=1,f="[object Arguments]",p="[object Array]",m="[object Object]",g=Object.prototype,v=g.hasOwnProperty;function x(C,w,k,P,L,A){var O=s(C),I=s(w),$=O?p:a(C),D=I?p:a(w);$=$==f?m:$,D=D==f?m:D;var V=$==m,Y=D==m,z=$==D;if(z&&l(C)){if(!l(w))return!1;O=!0,V=!1}if(z&&!V)return A||(A=new n),O||u(C)?r(C,w,k,P,L,A):i(C,w,$,k,P,L,A);if(!(k&c)){var R=V&&v.call(C,"__wrapped__"),N=Y&&v.call(w,"__wrapped__");if(R||N){var U=R?C.value():C,G=N?w.value():w;return A||(A=new n),L(U,G,k,P,A)}}return z?(A||(A=new n),o(C,w,k,P,L,A)):!1}t.exports=x}),FIe=ke((e,t)=>{var n=BIe(),r=h4();function i(o,a,s,l,u){return o===a?!0:o==null||a==null||!r(o)&&!r(a)?o!==o&&a!==a:n(o,a,s,l,i,u)}t.exports=i}),eK=ke((e,t)=>{var n=FIe();function r(i,o){return n(i,o)}t.exports=r}),zIe=["ctrl","shift","alt","meta","mod"],jIe={esc:"escape",return:"enter",left:"arrowleft",up:"arrowup",right:"arrowright",down:"arrowdown"};function Yw(e,t=","){return typeof e=="string"?e.split(t):e}function Qm(e,t="+"){let n=e.toLocaleLowerCase().split(t).map(o=>o.trim()).map(o=>jIe[o]||o),r={alt:n.includes("alt"),ctrl:n.includes("ctrl"),shift:n.includes("shift"),meta:n.includes("meta"),mod:n.includes("mod")},i=n.filter(o=>!zIe.includes(o));return{...r,keys:i}}function HIe(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function VIe(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function UIe(e){return tK(e,["input","textarea","select"])}function tK({target:e},t=!1){let n=e&&e.tagName;return t instanceof Array?Boolean(n&&t&&t.some(r=>r.toLowerCase()===n.toLowerCase())):Boolean(n&&t&&t===!0)}function WIe(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 '),!0):t?e.some(n=>t.includes(n))||e.includes("*"):!0}var GIe=(e,t,n)=>{let{alt:r,ctrl:i,meta:o,mod:a,shift:s,keys:l}=t,{altKey:u,ctrlKey:c,metaKey:f,shiftKey:p,key:m,code:g}=e,v=g.toLowerCase().replace("key",""),x=m.toLowerCase();if(u!==r&&x!=="alt"||p!==s&&x!=="shift")return!1;if(a){if(!f&&!c)return!1}else if(f!==o&&v!=="meta"||c!==i&&v!=="ctrl")return!1;return l&&l.length===1&&(l.includes(x)||l.includes(v))?!0:l?l.every(C=>n.has(C)):!l},KIe=S.createContext(void 0),YIe=()=>S.useContext(KIe),qIe=S.createContext({hotkeys:[],enabledScopes:[],toggleScope:()=>{},enableScope:()=>{},disableScope:()=>{}}),XIe=()=>S.useContext(qIe),ZIe=VG(eK());function QIe(e){let t=S.useRef(void 0);return(0,ZIe.default)(t.current,e)||(t.current=e),t.current}var xR=e=>{e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()};function Re(e,t,n,r){let i=S.useRef(null),{current:o}=S.useRef(new Set),a=n instanceof Array?r instanceof Array?void 0:r:n,s=n instanceof Array?n:r instanceof Array?r:[],l=S.useCallback(t,[...s]),u=QIe(a),{enabledScopes:c}=XIe(),f=YIe();return S.useLayoutEffect(()=>{if((u==null?void 0:u.enabled)===!1||!WIe(c,u==null?void 0:u.scopes))return;let p=v=>{var x;if(!(UIe(v)&&!tK(v,u==null?void 0:u.enableOnFormTags))){if(i.current!==null&&document.activeElement!==i.current&&!i.current.contains(document.activeElement)){xR(v);return}(x=v.target)!=null&&x.isContentEditable&&!(u!=null&&u.enableOnContentEditable)||Yw(e,u==null?void 0:u.splitKey).forEach(C=>{var k;let w=Qm(C,u==null?void 0:u.combinationKey);if(GIe(v,w,o)||(k=w.keys)!=null&&k.includes("*")){if(HIe(v,w,u==null?void 0:u.preventDefault),!VIe(v,w,u==null?void 0:u.enabled)){xR(v);return}l(v,w)}})}},m=v=>{o.add(v.key.toLowerCase()),((u==null?void 0:u.keydown)===void 0&&(u==null?void 0:u.keyup)!==!0||u!=null&&u.keydown)&&p(v)},g=v=>{v.key.toLowerCase()!=="meta"?o.delete(v.key.toLowerCase()):o.clear(),u!=null&&u.keyup&&p(v)};return(i.current||document).addEventListener("keyup",g),(i.current||document).addEventListener("keydown",m),f&&Yw(e,u==null?void 0:u.splitKey).forEach(v=>f.addHotkey(Qm(v,u==null?void 0:u.combinationKey))),()=>{(i.current||document).removeEventListener("keyup",g),(i.current||document).removeEventListener("keydown",m),f&&Yw(e,u==null?void 0:u.splitKey).forEach(v=>f.removeHotkey(Qm(v,u==null?void 0:u.combinationKey)))}},[e,l,u,c]),i}VG(eK());var n7=new Set;function JIe(e){(Array.isArray(e)?e:[e]).forEach(t=>n7.add(Qm(t)))}function eRe(e){(Array.isArray(e)?e:[e]).forEach(t=>{var r;let n=Qm(t);for(let i of n7)(r=i.keys)!=null&&r.every(o=>{var a;return(a=n.keys)==null?void 0:a.includes(o)})&&n7.delete(i)})}window.addEventListener("DOMContentLoaded",()=>{document.addEventListener("keydown",e=>{JIe(e.key)}),document.addEventListener("keyup",e=>{eRe(e.key)})});var nK={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},_R=M.createContext&&M.createContext(nK),Jl=globalThis&&globalThis.__assign||function(){return Jl=Object.assign||function(e){for(var t,n=1,r=arguments.length;ne.canvas,Wn=Fe([Et,Un,vn],(e,t,n)=>e.layerState.stagingArea.images.length>0||t==="unifiedCanvas"&&n.isProcessing),pK=e=>e.canvas.layerState.objects.find(Zy),sd=e=>e.gallery,ORe=Fe([sd,o4,Wn,Un],(e,t,n,r)=>{const{categories:i,currentCategory:o,currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:u,galleryImageMinimumWidth:c,galleryImageObjectFit:f,shouldHoldGalleryOpen:p,shouldAutoSwitchToNewImages:m,galleryWidth:g,shouldUseSingleGalleryColumn:v}=e,{isLightboxOpen:x}=t;return{currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:u,galleryImageMinimumWidth:c,galleryImageObjectFit:f,galleryGridTemplateColumns:v?"auto":`repeat(auto-fill, minmax(${c}px, auto))`,activeTabName:r,shouldHoldGalleryOpen:p,shouldAutoSwitchToNewImages:m,images:i[o].images,areMoreImagesAvailable:i[o].areMoreImagesAvailable,currentCategory:o,galleryWidth:g,isLightboxOpen:x,isStaging:n,shouldEnableResize:!(x||r==="unifiedCanvas"&&s),shouldUseSingleGalleryColumn:v}},{memoizeOptions:{resultEqualityCheck:Ue}}),MRe=Fe([sd,vn,o4,Un],(e,t,n,r)=>({mayDeleteImage:t.isConnected&&!t.isProcessing,galleryImageObjectFit:e.galleryImageObjectFit,galleryImageMinimumWidth:e.galleryImageMinimumWidth,shouldUseSingleGalleryColumn:e.shouldUseSingleGalleryColumn,activeTabName:r,isLightboxOpen:n.isLightboxOpen}),{memoizeOptions:{resultEqualityCheck:Ue}}),IRe=Fe(vn,e=>{const{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}=e;return{shouldConfirmOnDelete:t,isConnected:n,isProcessing:r}},{memoizeOptions:{resultEqualityCheck:Ue}}),lb=S.forwardRef(({image:e,children:t},n)=>{const{isOpen:r,onOpen:i,onClose:o}=Mc(),a=ge(),{shouldConfirmOnDelete:s,isConnected:l,isProcessing:u}=ne(IRe),c=S.useRef(null),f=g=>{g.stopPropagation(),s?i():p()},p=()=>{l&&!u&&e&&a(ETe(e)),o()};Re("delete",()=>{s?i():p()},[e,s]);const m=g=>a(kW(!g.target.checked));return j(gn,{children:[S.cloneElement(t,{onClick:e?f:void 0,ref:n}),b(qH,{isOpen:r,leastDestructiveRef:c,onClose:o,children:b(lu,{children:j(XH,{className:"modal",children:[b(Bh,{fontSize:"lg",fontWeight:"bold",children:"Delete image"}),b(gh,{children:j(Le,{direction:"column",gap:5,children:[b(Lt,{children:"Are you sure? Deleted images will be sent to the Bin. You can restore from there if you wish to."}),b(Tt,{children:j(Le,{alignItems:"center",children:[b(Ht,{mb:0,children:"Don't ask me again"}),b(o_,{checked:!s,onChange:m})]})})]})}),j(E3,{children:[b(xo,{ref:c,onClick:o,className:"modal-close-btn",children:"Cancel"}),b(xo,{colorScheme:"red",onClick:p,ml:3,children:"Delete"})]})]})})})]})});lb.displayName="DeleteImageModal";const RRe=Fe([vn,sd,R1,od,o4,Un],(e,t,n,r,i,o)=>{const{isProcessing:a,isConnected:s,isGFPGANAvailable:l,isESRGANAvailable:u}=e,{upscalingLevel:c,facetoolStrength:f}=n,{isLightboxOpen:p}=i,{shouldShowImageDetails:m}=r,{intermediateImage:g,currentImage:v}=t;return{isProcessing:a,isConnected:s,isGFPGANAvailable:l,isESRGANAvailable:u,upscalingLevel:c,facetoolStrength:f,shouldDisableToolbarButtons:Boolean(g)||!v,currentImage:v,shouldShowImageDetails:m,activeTabName:o,isLightboxOpen:p}},{memoizeOptions:{resultEqualityCheck:Ue}}),mK=()=>{var $,D,V,Y,z,R;const e=ge(),{isProcessing:t,isConnected:n,isGFPGANAvailable:r,isESRGANAvailable:i,upscalingLevel:o,facetoolStrength:a,shouldDisableToolbarButtons:s,shouldShowImageDetails:l,currentImage:u,isLightboxOpen:c,activeTabName:f}=ne(RRe),p=_1(),{t:m}=Ce(),g=()=>{u&&(c&&e(Qf(!1)),e(Kh(u)),e(_i("img2img")))},v=async()=>{if(!u)return;const N=await fetch(u.url).then(G=>G.blob()),U=[new ClipboardItem({[N.type]:N})];await navigator.clipboard.write(U),p({title:m("toast:imageCopied"),status:"success",duration:2500,isClosable:!0})},x=()=>{navigator.clipboard.writeText(u?window.location.toString()+u.url:"").then(()=>{p({title:m("toast:imageLinkCopied"),status:"success",duration:2500,isClosable:!0})})};Re("shift+i",()=>{u?(g(),p({title:m("toast:sentToImageToImage"),status:"success",duration:2500,isClosable:!0})):p({title:m("toast:imageNotLoaded"),description:m("toast:imageNotLoadedDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const C=()=>{var N,U;u&&(u.metadata&&e(YU(u.metadata)),((N=u.metadata)==null?void 0:N.image.type)==="img2img"?e(_i("img2img")):((U=u.metadata)==null?void 0:U.image.type)==="txt2img"&&e(_i("txt2img")))};Re("a",()=>{var N,U;["txt2img","img2img"].includes((U=(N=u==null?void 0:u.metadata)==null?void 0:N.image)==null?void 0:U.type)?(C(),p({title:m("toast:parametersSet"),status:"success",duration:2500,isClosable:!0})):p({title:m("toast:parametersNotSet"),description:m("toast:parametersNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const w=()=>{u!=null&&u.metadata&&e(A1(u.metadata.image.seed))};Re("s",()=>{var N,U;(U=(N=u==null?void 0:u.metadata)==null?void 0:N.image)!=null&&U.seed?(w(),p({title:m("toast:seedSet"),status:"success",duration:2500,isClosable:!0})):p({title:m("toast:seedNotSet"),description:m("toast:seedNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const k=()=>{var N,U,G,B;if((U=(N=u==null?void 0:u.metadata)==null?void 0:N.image)!=null&&U.prompt){const[W,X]=B_((B=(G=u==null?void 0:u.metadata)==null?void 0:G.image)==null?void 0:B.prompt);W&&e(Q3(W)),e(Hg(X||""))}};Re("p",()=>{var N,U;(U=(N=u==null?void 0:u.metadata)==null?void 0:N.image)!=null&&U.prompt?(k(),p({title:m("toast:promptSet"),status:"success",duration:2500,isClosable:!0})):p({title:m("toast:promptNotSet"),description:m("toast:promptNotSetDesc"),status:"error",duration:2500,isClosable:!0})},[u]);const P=()=>{u&&e(_Te(u))};Re("Shift+U",()=>{i&&!s&&n&&!t&&o?P():p({title:m("toast:upscalingFailed"),status:"error",duration:2500,isClosable:!0})},[u,i,s,n,t,o]);const L=()=>{u&&e(kTe(u))};Re("Shift+R",()=>{r&&!s&&n&&!t&&a?L():p({title:m("toast:faceRestoreFailed"),status:"error",duration:2500,isClosable:!0})},[u,r,s,n,t,a]);const A=()=>e(AW(!l)),O=()=>{u&&(c&&e(Qf(!1)),e(Z3(u)),e(hr(!0)),f!=="unifiedCanvas"&&e(_i("unifiedCanvas")),p({title:m("toast:sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0}))};Re("i",()=>{u?A():p({title:m("toast:metadataLoadFailed"),status:"error",duration:2500,isClosable:!0})},[u,l]);const I=()=>{e(Qf(!c))};return j("div",{className:"current-image-options",children:[j(Jr,{isAttached:!0,children:[b(sa,{trigger:"hover",triggerComponent:b(Ie,{"aria-label":`${m("parameters:sendTo")}...`,icon:b(PRe,{})}),children:j("div",{className:"current-image-send-to-popover",children:[b(kn,{size:"sm",onClick:g,leftIcon:b(kR,{}),children:m("parameters:sendToImg2Img")}),b(kn,{size:"sm",onClick:O,leftIcon:b(kR,{}),children:m("parameters:sendToUnifiedCanvas")}),b(kn,{size:"sm",onClick:v,leftIcon:b(wh,{}),children:m("parameters:copyImage")}),b(kn,{size:"sm",onClick:x,leftIcon:b(wh,{}),children:m("parameters:copyImageToLink")}),b(_c,{download:!0,href:u==null?void 0:u.url,children:b(kn,{leftIcon:b(dk,{}),size:"sm",w:"100%",children:m("parameters:downloadImage")})})]})}),b(Ie,{icon:b(fRe,{}),tooltip:c?`${m("parameters:closeViewer")} (Z)`:`${m("parameters:openInViewer")} (Z)`,"aria-label":c?`${m("parameters:closeViewer")} (Z)`:`${m("parameters:openInViewer")} (Z)`,"data-selected":c,onClick:I})]}),j(Jr,{isAttached:!0,children:[b(Ie,{icon:b(xRe,{}),tooltip:`${m("parameters:usePrompt")} (P)`,"aria-label":`${m("parameters:usePrompt")} (P)`,isDisabled:!((D=($=u==null?void 0:u.metadata)==null?void 0:$.image)!=null&&D.prompt),onClick:k}),b(Ie,{icon:b(ERe,{}),tooltip:`${m("parameters:useSeed")} (S)`,"aria-label":`${m("parameters:useSeed")} (S)`,isDisabled:!((Y=(V=u==null?void 0:u.metadata)==null?void 0:V.image)!=null&&Y.seed),onClick:w}),b(Ie,{icon:b(lRe,{}),tooltip:`${m("parameters:useAll")} (A)`,"aria-label":`${m("parameters:useAll")} (A)`,isDisabled:!["txt2img","img2img"].includes((R=(z=u==null?void 0:u.metadata)==null?void 0:z.image)==null?void 0:R.type),onClick:C})]}),j(Jr,{isAttached:!0,children:[b(sa,{trigger:"hover",triggerComponent:b(Ie,{icon:b(mRe,{}),"aria-label":m("parameters:restoreFaces")}),children:j("div",{className:"current-image-postprocessing-popover",children:[b(ok,{}),b(kn,{isDisabled:!r||!u||!(n&&!t)||!a,onClick:L,children:m("parameters:restoreFaces")})]})}),b(sa,{trigger:"hover",triggerComponent:b(Ie,{icon:b(dRe,{}),"aria-label":m("parameters:upscale")}),children:j("div",{className:"current-image-postprocessing-popover",children:[b(ak,{}),b(kn,{isDisabled:!i||!u||!(n&&!t)||!o,onClick:P,children:m("parameters:upscaleImage")})]})})]}),b(Jr,{isAttached:!0,children:b(Ie,{icon:b(sK,{}),tooltip:`${m("parameters:info")} (I)`,"aria-label":`${m("parameters:info")} (I)`,"data-selected":l,onClick:A})}),b(lb,{image:u,children:b(Ie,{icon:b(ad,{}),tooltip:`${m("parameters:deleteImage")} (Del)`,"aria-label":`${m("parameters:deleteImage")} (Del)`,isDisabled:!u||!n||t,style:{backgroundColor:"var(--btn-delete-image)"}})})]})};Ye({d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z",displayName:"CopyIcon"});Ye({d:"M23.384,21.619,16.855,15.09a9.284,9.284,0,1,0-1.768,1.768l6.529,6.529a1.266,1.266,0,0,0,1.768,0A1.251,1.251,0,0,0,23.384,21.619ZM2.75,9.5a6.75,6.75,0,1,1,6.75,6.75A6.758,6.758,0,0,1,2.75,9.5Z",displayName:"SearchIcon"});Ye({d:"M23.414,20.591l-4.645-4.645a10.256,10.256,0,1,0-2.828,2.829l4.645,4.644a2.025,2.025,0,0,0,2.828,0A2,2,0,0,0,23.414,20.591ZM10.25,3.005A7.25,7.25,0,1,1,3,10.255,7.258,7.258,0,0,1,10.25,3.005Z",displayName:"Search2Icon"});Ye({d:"M21.4,13.7C20.6,13.9,19.8,14,19,14c-5,0-9-4-9-9c0-0.8,0.1-1.6,0.3-2.4c0.1-0.3,0-0.7-0.3-1 c-0.3-0.3-0.6-0.4-1-0.3C4.3,2.7,1,7.1,1,12c0,6.1,4.9,11,11,11c4.9,0,9.3-3.3,10.6-8.1c0.1-0.3,0-0.7-0.3-1 C22.1,13.7,21.7,13.6,21.4,13.7z",displayName:"MoonIcon"});Ye({displayName:"SunIcon",path:M.createElement("g",{strokeLinejoin:"round",strokeLinecap:"round",strokeWidth:"2",fill:"none",stroke:"currentColor"},M.createElement("circle",{cx:"12",cy:"12",r:"5"}),M.createElement("path",{d:"M12 1v2"}),M.createElement("path",{d:"M12 21v2"}),M.createElement("path",{d:"M4.22 4.22l1.42 1.42"}),M.createElement("path",{d:"M18.36 18.36l1.42 1.42"}),M.createElement("path",{d:"M1 12h2"}),M.createElement("path",{d:"M21 12h2"}),M.createElement("path",{d:"M4.22 19.78l1.42-1.42"}),M.createElement("path",{d:"M18.36 5.64l1.42-1.42"}))});Ye({d:"M0,12a1.5,1.5,0,0,0,1.5,1.5h8.75a.25.25,0,0,1,.25.25V22.5a1.5,1.5,0,0,0,3,0V13.75a.25.25,0,0,1,.25-.25H22.5a1.5,1.5,0,0,0,0-3H13.75a.25.25,0,0,1-.25-.25V1.5a1.5,1.5,0,0,0-3,0v8.75a.25.25,0,0,1-.25.25H1.5A1.5,1.5,0,0,0,0,12Z",displayName:"AddIcon"});Ye({displayName:"SmallAddIcon",viewBox:"0 0 20 20",path:M.createElement("path",{fill:"currentColor",d:"M14 9h-3V6c0-.55-.45-1-1-1s-1 .45-1 1v3H6c-.55 0-1 .45-1 1s.45 1 1 1h3v3c0 .55.45 1 1 1s1-.45 1-1v-3h3c.55 0 1-.45 1-1s-.45-1-1-1z",fillRule:"evenodd"})});Ye({viewBox:"0 0 14 14",d:"M14,7.77 L14,6.17 L12.06,5.53 L11.61,4.44 L12.49,2.6 L11.36,1.47 L9.55,2.38 L8.46,1.93 L7.77,0.01 L6.17,0.01 L5.54,1.95 L4.43,2.4 L2.59,1.52 L1.46,2.65 L2.37,4.46 L1.92,5.55 L0,6.23 L0,7.82 L1.94,8.46 L2.39,9.55 L1.51,11.39 L2.64,12.52 L4.45,11.61 L5.54,12.06 L6.23,13.98 L7.82,13.98 L8.45,12.04 L9.56,11.59 L11.4,12.47 L12.53,11.34 L11.61,9.53 L12.08,8.44 L14,7.75 L14,7.77 Z M7,10 C5.34,10 4,8.66 4,7 C4,5.34 5.34,4 7,4 C8.66,4 10,5.34 10,7 C10,8.66 8.66,10 7,10 Z",displayName:"SettingsIcon"});Ye({displayName:"CheckCircleIcon",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"});Ye({d:"M19.5,9.5h-.75V6.75a6.75,6.75,0,0,0-13.5,0V9.5H4.5a2,2,0,0,0-2,2V22a2,2,0,0,0,2,2h15a2,2,0,0,0,2-2V11.5A2,2,0,0,0,19.5,9.5Zm-9.5,6a2,2,0,1,1,3,1.723V19.5a1,1,0,0,1-2,0V17.223A1.994,1.994,0,0,1,10,15.5ZM7.75,6.75a4.25,4.25,0,0,1,8.5,0V9a.5.5,0,0,1-.5.5H8.25a.5.5,0,0,1-.5-.5Z",displayName:"LockIcon"});Ye({d:"M19.5,9.5h-.75V6.75A6.751,6.751,0,0,0,5.533,4.811a1.25,1.25,0,1,0,2.395.717A4.251,4.251,0,0,1,16.25,6.75V9a.5.5,0,0,1-.5.5H4.5a2,2,0,0,0-2,2V22a2,2,0,0,0,2,2h15a2,2,0,0,0,2-2V11.5A2,2,0,0,0,19.5,9.5Zm-9.5,6a2,2,0,1,1,3,1.723V19.5a1,1,0,0,1-2,0V17.223A1.994,1.994,0,0,1,10,15.5Z",displayName:"UnlockIcon"});Ye({displayName:"ViewIcon",path:M.createElement("g",{fill:"currentColor"},M.createElement("path",{d:"M23.432,10.524C20.787,7.614,16.4,4.538,12,4.6,7.6,4.537,3.213,7.615.568,10.524a2.211,2.211,0,0,0,0,2.948C3.182,16.351,7.507,19.4,11.839,19.4h.308c4.347,0,8.671-3.049,11.288-5.929A2.21,2.21,0,0,0,23.432,10.524ZM7.4,12A4.6,4.6,0,1,1,12,16.6,4.6,4.6,0,0,1,7.4,12Z"}),M.createElement("circle",{cx:"12",cy:"12",r:"2"}))});Ye({displayName:"ViewOffIcon",path:M.createElement("g",{fill:"currentColor"},M.createElement("path",{d:"M23.2,10.549a20.954,20.954,0,0,0-4.3-3.6l4-3.995a1,1,0,1,0-1.414-1.414l-.018.018a.737.737,0,0,1-.173.291l-19.5,19.5c-.008.007-.018.009-.026.017a1,1,0,0,0,1.631,1.088l4.146-4.146a11.26,11.26,0,0,0,4.31.939h.3c4.256,0,8.489-2.984,11.051-5.8A2.171,2.171,0,0,0,23.2,10.549ZM16.313,13.27a4.581,4.581,0,0,1-3,3.028,4.3,4.3,0,0,1-3.1-.19.253.253,0,0,1-.068-.407l5.56-5.559a.252.252,0,0,1,.407.067A4.3,4.3,0,0,1,16.313,13.27Z"}),M.createElement("path",{d:"M7.615,13.4a.244.244,0,0,0,.061-.24A4.315,4.315,0,0,1,7.5,12,4.5,4.5,0,0,1,12,7.5a4.276,4.276,0,0,1,1.16.173.244.244,0,0,0,.24-.062l1.941-1.942a.254.254,0,0,0-.1-.421A10.413,10.413,0,0,0,12,4.75C7.7,4.692,3.4,7.7.813,10.549a2.15,2.15,0,0,0-.007,2.9,21.209,21.209,0,0,0,3.438,3.03.256.256,0,0,0,.326-.029Z"}))});Ye({d:"M11.2857,6.05714 L10.08571,4.85714 L7.85714,7.14786 L7.85714,1 L6.14286,1 L6.14286,7.14786 L3.91429,4.85714 L2.71429,6.05714 L7,10.42857 L11.2857,6.05714 Z M1,11.2857 L1,13 L13,13 L13,11.2857 L1,11.2857 Z",displayName:"DownloadIcon",viewBox:"0 0 14 14"});var $Re=Ye({displayName:"DeleteIcon",path:M.createElement("g",{fill:"currentColor"},M.createElement("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"}))});Ye({displayName:"RepeatIcon",path:M.createElement("g",{fill:"currentColor"},M.createElement("path",{d:"M10.319,4.936a7.239,7.239,0,0,1,7.1,2.252,1.25,1.25,0,1,0,1.872-1.657A9.737,9.737,0,0,0,9.743,2.5,10.269,10.269,0,0,0,2.378,9.61a.249.249,0,0,1-.271.178l-1.033-.13A.491.491,0,0,0,.6,9.877a.5.5,0,0,0-.019.526l2.476,4.342a.5.5,0,0,0,.373.248.43.43,0,0,0,.062,0,.5.5,0,0,0,.359-.152l3.477-3.593a.5.5,0,0,0-.3-.844L5.15,10.172a.25.25,0,0,1-.2-.333A7.7,7.7,0,0,1,10.319,4.936Z"}),M.createElement("path",{d:"M23.406,14.1a.5.5,0,0,0,.015-.526l-2.5-4.329A.5.5,0,0,0,20.546,9a.489.489,0,0,0-.421.151l-3.456,3.614a.5.5,0,0,0,.3.842l1.848.221a.249.249,0,0,1,.183.117.253.253,0,0,1,.023.216,7.688,7.688,0,0,1-5.369,4.9,7.243,7.243,0,0,1-7.1-2.253,1.25,1.25,0,1,0-1.872,1.656,9.74,9.74,0,0,0,9.549,3.03,10.261,10.261,0,0,0,7.369-7.12.251.251,0,0,1,.27-.179l1.058.127a.422.422,0,0,0,.06,0A.5.5,0,0,0,23.406,14.1Z"}))});Ye({displayName:"RepeatClockIcon",path:M.createElement("g",{fill:"currentColor"},M.createElement("path",{d:"M12.965,6a1,1,0,0,0-1,1v5.5a1,1,0,0,0,1,1h5a1,1,0,0,0,0-2h-3.75a.25.25,0,0,1-.25-.25V7A1,1,0,0,0,12.965,6Z"}),M.createElement("path",{d:"M12.567,1.258A10.822,10.822,0,0,0,2.818,8.4a.25.25,0,0,1-.271.163L.858,8.309a.514.514,0,0,0-.485.213.5.5,0,0,0-.021.53l2.679,4.7a.5.5,0,0,0,.786.107l3.77-3.746a.5.5,0,0,0-.279-.85L5.593,9.007a.25.25,0,0,1-.192-.35,8.259,8.259,0,1,1,7.866,11.59,1.25,1.25,0,0,0,.045,2.5h.047a10.751,10.751,0,1,0-.792-21.487Z"}))});var DRe=Ye({displayName:"EditIcon",path:M.createElement("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"},M.createElement("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),M.createElement("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"}))});Ye({d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z",displayName:"ChevronLeftIcon"});Ye({d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z",displayName:"ChevronRightIcon"});Ye({displayName:"ChevronDownIcon",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"});Ye({d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z",displayName:"ChevronUpIcon"});Ye({d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z",displayName:"ArrowBackIcon"});Ye({d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z",displayName:"ArrowForwardIcon"});Ye({d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z",displayName:"ArrowUpIcon"});Ye({viewBox:"0 0 16 16",d:"M11.891 9.992a1 1 0 1 1 1.416 1.415l-4.3 4.3a1 1 0 0 1-1.414 0l-4.3-4.3A1 1 0 0 1 4.71 9.992l3.59 3.591 3.591-3.591zm0-3.984L8.3 2.417 4.709 6.008a1 1 0 0 1-1.416-1.415l4.3-4.3a1 1 0 0 1 1.414 0l4.3 4.3a1 1 0 1 1-1.416 1.415z",displayName:"ArrowUpDownIcon"});Ye({d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z",displayName:"ArrowDownIcon"});var gK=Ye({displayName:"ExternalLinkIcon",path:M.createElement("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"},M.createElement("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),M.createElement("path",{d:"M15 3h6v6"}),M.createElement("path",{d:"M10 14L21 3"}))});Ye({displayName:"LinkIcon",path:M.createElement("g",{fill:"currentColor"},M.createElement("path",{d:"M10.458,18.374,7.721,21.11a2.853,2.853,0,0,1-3.942,0l-.892-.891a2.787,2.787,0,0,1,0-3.941l5.8-5.8a2.789,2.789,0,0,1,3.942,0l.893.892A1,1,0,0,0,14.94,9.952l-.893-.892a4.791,4.791,0,0,0-6.771,0l-5.8,5.8a4.787,4.787,0,0,0,0,6.77l.892.891a4.785,4.785,0,0,0,6.771,0l2.736-2.735a1,1,0,1,0-1.414-1.415Z"}),M.createElement("path",{d:"M22.526,2.363l-.892-.892a4.8,4.8,0,0,0-6.77,0l-2.905,2.9a1,1,0,0,0,1.414,1.414l2.9-2.9a2.79,2.79,0,0,1,3.941,0l.893.893a2.786,2.786,0,0,1,0,3.942l-5.8,5.8a2.769,2.769,0,0,1-1.971.817h0a2.766,2.766,0,0,1-1.969-.816,1,1,0,1,0-1.415,1.412,4.751,4.751,0,0,0,3.384,1.4h0a4.752,4.752,0,0,0,3.385-1.4l5.8-5.8a4.786,4.786,0,0,0,0-6.771Z"}))});Ye({displayName:"PlusSquareIcon",path:M.createElement("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"},M.createElement("rect",{height:"18",width:"18",rx:"2",ry:"2",x:"3",y:"3"}),M.createElement("path",{d:"M12 8v8"}),M.createElement("path",{d:"M8 12h8"}))});Ye({displayName:"CalendarIcon",viewBox:"0 0 14 14",d:"M10.8889,5.5 L3.11111,5.5 L3.11111,7.05556 L10.8889,7.05556 L10.8889,5.5 Z M12.4444,1.05556 L11.6667,1.05556 L11.6667,0 L10.1111,0 L10.1111,1.05556 L3.88889,1.05556 L3.88889,0 L2.33333,0 L2.33333,1.05556 L1.55556,1.05556 C0.692222,1.05556 0.00777777,1.75556 0.00777777,2.61111 L0,12.5 C0,13.3556 0.692222,14 1.55556,14 L12.4444,14 C13.3,14 14,13.3556 14,12.5 L14,2.61111 C14,1.75556 13.3,1.05556 12.4444,1.05556 Z M12.4444,12.5 L1.55556,12.5 L1.55556,3.94444 L12.4444,3.94444 L12.4444,12.5 Z M8.55556,8.61111 L3.11111,8.61111 L3.11111,10.1667 L8.55556,10.1667 L8.55556,8.61111 Z"});Ye({d:"M0.913134,0.920639 C1.49851,0.331726 2.29348,0 3.12342,0 L10.8766,0 C11.7065,0 12.5015,0.331725 13.0869,0.920639 C13.6721,1.50939 14,2.30689 14,3.13746 L14,8.12943 C13.9962,8.51443 13.9059,8.97125 13.7629,9.32852 C13.6128,9.683 13.3552,10.0709 13.0869,10.3462 C12.813,10.6163 12.4265,10.8761 12.0734,11.0274 C11.7172,11.1716 11.2607,11.263 10.8766,11.2669 L10.1234,11.2669 L10.1234,12.5676 L10.1209,12.5676 C10.1204,12.793 10.0633,13.0791 9.97807,13.262 C9.8627,13.466 9.61158,13.7198 9.40818,13.8382 L9.40824,13.8383 C9.4077,13.8386 9.40716,13.8388 9.40661,13.8391 C9.40621,13.8393 9.4058,13.8396 9.40539,13.8398 L9.40535,13.8397 C9.22958,13.9254 8.94505,13.9951 8.75059,14 L8.74789,14 C8.35724,13.9963 7.98473,13.8383 7.71035,13.5617 L5.39553,11.2669 L3.12342,11.2669 C2.29348,11.2669 1.49851,10.9352 0.913134,10.3462 C0.644826,10.0709 0.387187,9.683 0.23711,9.32852 C0.0941235,8.97125 0.00379528,8.51443 0,8.12943 L0,3.13746 C0,2.30689 0.327915,1.50939 0.913134,0.920639 Z M3.12342,1.59494 C2.71959,1.59494 2.33133,1.75628 2.04431,2.04503 C1.75713,2.33395 1.59494,2.72681 1.59494,3.13746 L1.59494,8.12943 C1.59114,8.35901 1.62114,8.51076 1.71193,8.72129 C1.79563,8.9346 1.88065,9.06264 2.04431,9.22185 C2.33133,9.5106 2.71959,9.67195 3.12342,9.67195 L5.72383,9.67195 C5.93413,9.67195 6.13592,9.75502 6.28527,9.90308 L8.52848,12.1269 L8.52848,10.4694 C8.52848,10.029 8.88552,9.67195 9.32595,9.67195 L10.8766,9.67195 C11.1034,9.67583 11.2517,9.64614 11.4599,9.55518 C11.6712,9.47132 11.7976,9.38635 11.9557,9.22185 C12.1193,9.06264 12.2044,8.9346 12.2881,8.72129 C12.3789,8.51076 12.4089,8.35901 12.4051,8.12943 L12.4051,3.13746 C12.4051,2.72681 12.2429,2.33394 11.9557,2.04503 C11.6687,1.75628 11.2804,1.59494 10.8766,1.59494 L3.12342,1.59494 Z",displayName:"ChatIcon",viewBox:"0 0 14 14"});Ye({displayName:"TimeIcon",path:M.createElement("g",{fill:"currentColor"},M.createElement("path",{d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm0,22A10,10,0,1,1,22,12,10.011,10.011,0,0,1,12,22Z"}),M.createElement("path",{d:"M17.134,15.81,12.5,11.561V6.5a1,1,0,0,0-2,0V12a1,1,0,0,0,.324.738l4.959,4.545a1.01,1.01,0,0,0,1.413-.061A1,1,0,0,0,17.134,15.81Z"}))});Ye({displayName:"ArrowRightIcon",path:M.createElement("g",{fill:"currentColor"},M.createElement("path",{d:"M13.584,12a2.643,2.643,0,0,1-.775,1.875L3.268,23.416a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L.768,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,13.584,12Z"}),M.createElement("path",{d:"M23.75,12a2.643,2.643,0,0,1-.775,1.875l-9.541,9.541a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L10.934,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,23.75,12Z"}))});Ye({displayName:"ArrowLeftIcon",path:M.createElement("g",{fill:"currentColor"},M.createElement("path",{d:"M10.416,12a2.643,2.643,0,0,1,.775-1.875L20.732.584a1.768,1.768,0,0,1,2.5,2.5l-8.739,8.739a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5l-9.541-9.541A2.643,2.643,0,0,1,10.416,12Z"}),M.createElement("path",{d:"M.25,12a2.643,2.643,0,0,1,.775-1.875L10.566.584a1.768,1.768,0,0,1,2.5,2.5L4.327,11.823a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5L1.025,13.875A2.643,2.643,0,0,1,.25,12Z"}))});Ye({displayName:"AtSignIcon",d:"M12,.5A11.634,11.634,0,0,0,.262,12,11.634,11.634,0,0,0,12,23.5a11.836,11.836,0,0,0,6.624-2,1.25,1.25,0,1,0-1.393-2.076A9.34,9.34,0,0,1,12,21a9.132,9.132,0,0,1-9.238-9A9.132,9.132,0,0,1,12,3a9.132,9.132,0,0,1,9.238,9v.891a1.943,1.943,0,0,1-3.884,0V12A5.355,5.355,0,1,0,12,17.261a5.376,5.376,0,0,0,3.861-1.634,4.438,4.438,0,0,0,7.877-2.736V12A11.634,11.634,0,0,0,12,.5Zm0,14.261A2.763,2.763,0,1,1,14.854,12,2.812,2.812,0,0,1,12,14.761Z"});Ye({displayName:"AttachmentIcon",d:"M21.843,3.455a6.961,6.961,0,0,0-9.846,0L1.619,13.832a5.128,5.128,0,0,0,7.252,7.252L17.3,12.653A3.293,3.293,0,1,0,12.646,8L7.457,13.184A1,1,0,1,0,8.871,14.6L14.06,9.409a1.294,1.294,0,0,1,1.829,1.83L7.457,19.67a3.128,3.128,0,0,1-4.424-4.424L13.411,4.869a4.962,4.962,0,1,1,7.018,7.018L12.646,19.67a1,1,0,1,0,1.414,1.414L21.843,13.3a6.96,6.96,0,0,0,0-9.846Z"});Ye({displayName:"UpDownIcon",viewBox:"-1 -1 9 11",d:"M 3.5 0L 3.98809 -0.569442L 3.5 -0.987808L 3.01191 -0.569442L 3.5 0ZM 3.5 9L 3.01191 9.56944L 3.5 9.98781L 3.98809 9.56944L 3.5 9ZM 0.488094 3.56944L 3.98809 0.569442L 3.01191 -0.569442L -0.488094 2.43056L 0.488094 3.56944ZM 3.01191 0.569442L 6.51191 3.56944L 7.48809 2.43056L 3.98809 -0.569442L 3.01191 0.569442ZM -0.488094 6.56944L 3.01191 9.56944L 3.98809 8.43056L 0.488094 5.43056L -0.488094 6.56944ZM 3.98809 9.56944L 7.48809 6.56944L 6.51191 5.43056L 3.01191 8.43056L 3.98809 9.56944Z"});Ye({d:"M23.555,8.729a1.505,1.505,0,0,0-1.406-.98H16.062a.5.5,0,0,1-.472-.334L13.405,1.222a1.5,1.5,0,0,0-2.81,0l-.005.016L8.41,7.415a.5.5,0,0,1-.471.334H1.85A1.5,1.5,0,0,0,.887,10.4l5.184,4.3a.5.5,0,0,1,.155.543L4.048,21.774a1.5,1.5,0,0,0,2.31,1.684l5.346-3.92a.5.5,0,0,1,.591,0l5.344,3.919a1.5,1.5,0,0,0,2.312-1.683l-2.178-6.535a.5.5,0,0,1,.155-.543l5.194-4.306A1.5,1.5,0,0,0,23.555,8.729Z",displayName:"StarIcon"});Ye({displayName:"EmailIcon",path:M.createElement("g",{fill:"currentColor"},M.createElement("path",{d:"M11.114,14.556a1.252,1.252,0,0,0,1.768,0L22.568,4.87a.5.5,0,0,0-.281-.849A1.966,1.966,0,0,0,22,4H2a1.966,1.966,0,0,0-.289.021.5.5,0,0,0-.281.849Z"}),M.createElement("path",{d:"M23.888,5.832a.182.182,0,0,0-.2.039l-6.2,6.2a.251.251,0,0,0,0,.354l5.043,5.043a.75.75,0,1,1-1.06,1.061l-5.043-5.043a.25.25,0,0,0-.354,0l-2.129,2.129a2.75,2.75,0,0,1-3.888,0L7.926,13.488a.251.251,0,0,0-.354,0L2.529,18.531a.75.75,0,0,1-1.06-1.061l5.043-5.043a.251.251,0,0,0,0-.354l-6.2-6.2a.18.18,0,0,0-.2-.039A.182.182,0,0,0,0,6V18a2,2,0,0,0,2,2H22a2,2,0,0,0,2-2V6A.181.181,0,0,0,23.888,5.832Z"}))});Ye({d:"M2.20731,0.0127209 C2.1105,-0.0066419 1.99432,-0.00664663 1.91687,0.032079 C0.871279,0.438698 0.212942,1.92964 0.0580392,2.95587 C-0.426031,6.28627 2.20731,9.17133 4.62766,11.0689 C6.77694,12.7534 10.9012,15.5223 13.3409,12.8503 C13.6507,12.5211 14.0186,12.037 13.9993,11.553 C13.9412,10.7397 13.186,10.1588 12.6051,9.71349 C12.1598,9.38432 11.2304,8.47427 10.6495,8.49363 C10.1267,8.51299 9.79754,9.05515 9.46837,9.38432 L8.88748,9.96521 C8.79067,10.062 7.55145,9.24878 7.41591,9.15197 C6.91248,8.8228 6.4284,8.45491 6.00242,8.04829 C5.57644,7.64167 5.18919,7.19632 4.86002,6.73161 C4.7632,6.59607 3.96933,5.41495 4.04678,5.31813 C4.04678,5.31813 4.72448,4.58234 4.91811,4.2919 C5.32473,3.67229 5.63453,3.18822 5.16982,2.45243 C4.99556,2.18135 4.78257,1.96836 4.55021,1.73601 C4.14359,1.34875 3.73698,0.942131 3.27227,0.612963 C3.02055,0.419335 2.59457,0.0708094 2.20731,0.0127209 Z",displayName:"PhoneIcon",viewBox:"0 0 14 14"});Ye({viewBox:"0 0 10 10",d:"M3,2 C2.44771525,2 2,1.55228475 2,1 C2,0.44771525 2.44771525,0 3,0 C3.55228475,0 4,0.44771525 4,1 C4,1.55228475 3.55228475,2 3,2 Z M3,6 C2.44771525,6 2,5.55228475 2,5 C2,4.44771525 2.44771525,4 3,4 C3.55228475,4 4,4.44771525 4,5 C4,5.55228475 3.55228475,6 3,6 Z M3,10 C2.44771525,10 2,9.55228475 2,9 C2,8.44771525 2.44771525,8 3,8 C3.55228475,8 4,8.44771525 4,9 C4,9.55228475 3.55228475,10 3,10 Z M7,2 C6.44771525,2 6,1.55228475 6,1 C6,0.44771525 6.44771525,0 7,0 C7.55228475,0 8,0.44771525 8,1 C8,1.55228475 7.55228475,2 7,2 Z M7,6 C6.44771525,6 6,5.55228475 6,5 C6,4.44771525 6.44771525,4 7,4 C7.55228475,4 8,4.44771525 8,5 C8,5.55228475 7.55228475,6 7,6 Z M7,10 C6.44771525,10 6,9.55228475 6,9 C6,8.44771525 6.44771525,8 7,8 C7.55228475,8 8,8.44771525 8,9 C8,9.55228475 7.55228475,10 7,10 Z",displayName:"DragHandleIcon"});Ye({displayName:"SpinnerIcon",path:M.createElement(M.Fragment,null,M.createElement("defs",null,M.createElement("linearGradient",{x1:"28.154%",y1:"63.74%",x2:"74.629%",y2:"17.783%",id:"a"},M.createElement("stop",{stopColor:"currentColor",offset:"0%"}),M.createElement("stop",{stopColor:"#fff",stopOpacity:"0",offset:"100%"}))),M.createElement("g",{transform:"translate(2)",fill:"none"},M.createElement("circle",{stroke:"url(#a)",strokeWidth:"4",cx:"10",cy:"12",r:"10"}),M.createElement("path",{d:"M10 2C4.477 2 0 6.477 0 12",stroke:"currentColor",strokeWidth:"4"}),M.createElement("rect",{fill:"currentColor",x:"8",width:"4",height:"4",rx:"8"})))});Ye({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"});Ye({displayName:"SmallCloseIcon",viewBox:"0 0 16 16",path:M.createElement("path",{d:"M9.41 8l2.29-2.29c.19-.18.3-.43.3-.71a1.003 1.003 0 0 0-1.71-.71L8 6.59l-2.29-2.3a1.003 1.003 0 0 0-1.42 1.42L6.59 8 4.3 10.29c-.19.18-.3.43-.3.71a1.003 1.003 0 0 0 1.71.71L8 9.41l2.29 2.29c.18.19.43.3.71.3a1.003 1.003 0 0 0 .71-1.71L9.41 8z",fillRule:"evenodd",fill:"currentColor"})});Ye({d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z",displayName:"NotAllowedIcon"});Ye({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",displayName:"TriangleDownIcon"});Ye({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",displayName:"TriangleUpIcon"});Ye({displayName:"InfoOutlineIcon",path:M.createElement("g",{fill:"currentColor",stroke:"currentColor",strokeLinecap:"square",strokeWidth:"2"},M.createElement("circle",{cx:"12",cy:"12",fill:"none",r:"11",stroke:"currentColor"}),M.createElement("line",{fill:"none",x1:"11.959",x2:"11.959",y1:"11",y2:"17"}),M.createElement("circle",{cx:"11.959",cy:"7",r:"1",stroke:"none"}))});Ye({displayName:"BellIcon",d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"});Ye({d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"});Ye({d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm0,19a1.5,1.5,0,1,1,1.5-1.5A1.5,1.5,0,0,1,12,19Zm1.6-6.08a1,1,0,0,0-.6.917,1,1,0,1,1-2,0,3,3,0,0,1,1.8-2.75A2,2,0,1,0,10,9.255a1,1,0,1,1-2,0,4,4,0,1,1,5.6,3.666Z",displayName:"QuestionIcon"});Ye({displayName:"QuestionOutlineIcon",path:M.createElement("g",{stroke:"currentColor",strokeWidth:"1.5"},M.createElement("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),M.createElement("path",{fill:"none",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),M.createElement("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"}))});Ye({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",displayName:"WarningIcon"});Ye({displayName:"WarningTwoIcon",d:"M23.119,20,13.772,2.15h0a2,2,0,0,0-3.543,0L.881,20a2,2,0,0,0,1.772,2.928H21.347A2,2,0,0,0,23.119,20ZM11,8.423a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Zm1.05,11.51h-.028a1.528,1.528,0,0,1-1.522-1.47,1.476,1.476,0,0,1,1.448-1.53h.028A1.527,1.527,0,0,1,13.5,18.4,1.475,1.475,0,0,1,12.05,19.933Z"});Ye({viewBox:"0 0 14 14",path:M.createElement("g",{fill:"currentColor"},M.createElement("polygon",{points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"}))});Ye({displayName:"MinusIcon",path:M.createElement("g",{fill:"currentColor"},M.createElement("rect",{height:"4",width:"20",x:"2",y:"10"}))});Ye({displayName:"HamburgerIcon",viewBox:"0 0 24 24",d:"M 3 5 A 1.0001 1.0001 0 1 0 3 7 L 21 7 A 1.0001 1.0001 0 1 0 21 5 L 3 5 z M 3 11 A 1.0001 1.0001 0 1 0 3 13 L 21 13 A 1.0001 1.0001 0 1 0 21 11 L 3 11 z M 3 17 A 1.0001 1.0001 0 1 0 3 19 L 21 19 A 1.0001 1.0001 0 1 0 21 17 L 3 17 z"});function NRe(e){return We({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M245.09 327.74v-37.32c57.07 0 84.51 13.47 108.58 38.68 5.4 5.65 15 1.32 14.29-6.43-5.45-61.45-34.14-117.09-122.87-117.09v-37.32a8.32 8.32 0 00-14.05-6L146.58 242a8.2 8.2 0 000 11.94L231 333.71a8.32 8.32 0 0014.09-5.97z"}},{tag:"path",attr:{fill:"none",strokeMiterlimit:"10",strokeWidth:"32",d:"M256 64C150 64 64 150 64 256s86 192 192 192 192-86 192-192S362 64 256 64z"}}]})(e)}const tn=({label:e,value:t,onClick:n,isLink:r,labelPosition:i,withCopy:o=!1})=>j(Le,{gap:2,children:[n&&b(ri,{label:`Recall ${e}`,children:b(_o,{"aria-label":"Use this parameter",icon:b(NRe,{}),size:"xs",variant:"ghost",fontSize:20,onClick:n})}),o&&b(ri,{label:`Copy ${e}`,children:b(_o,{"aria-label":`Copy ${e}`,icon:b(wh,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText(t.toString())})}),j(Le,{direction:i?"column":"row",children:[j(Lt,{fontWeight:"semibold",whiteSpace:"pre-wrap",pr:2,children:[e,":"]}),r?j(_c,{href:t.toString(),isExternal:!0,wordBreak:"break-all",children:[t.toString()," ",b(gK,{mx:"2px"})]}):b(Lt,{overflowY:"scroll",wordBreak:"break-all",children:t.toString()})]})]}),BRe=(e,t)=>e.image.uuid===t.image.uuid,mk=S.memo(({image:e,styleClass:t})=>{var D,V;const n=ge();Re("esc",()=>{n(AW(!1))});const r=((D=e==null?void 0:e.metadata)==null?void 0:D.image)||{},i=e==null?void 0:e.dreamPrompt,{cfg_scale:o,fit:a,height:s,hires_fix:l,init_image_path:u,mask_image_path:c,orig_path:f,perlin:p,postprocessing:m,prompt:g,sampler:v,scale:x,seamless:C,seed:w,steps:k,strength:P,threshold:L,type:A,variations:O,width:I}=r,$=JSON.stringify(e.metadata,null,2);return b("div",{className:`image-metadata-viewer ${t}`,children:j(Le,{gap:1,direction:"column",width:"100%",children:[j(Le,{gap:2,children:[b(Lt,{fontWeight:"semibold",children:"File:"}),j(_c,{href:e.url,isExternal:!0,maxW:"calc(100% - 3rem)",children:[e.url.length>64?e.url.substring(0,64).concat("..."):e.url,b(gK,{mx:"2px"})]})]}),Object.keys(r).length>0?j(gn,{children:[A&&b(tn,{label:"Generation type",value:A}),((V=e.metadata)==null?void 0:V.model_weights)&&b(tn,{label:"Model",value:e.metadata.model_weights}),["esrgan","gfpgan"].includes(A)&&b(tn,{label:"Original image",value:f}),A==="gfpgan"&&P!==void 0&&b(tn,{label:"Fix faces strength",value:P,onClick:()=>n(B2(P))}),A==="esrgan"&&x!==void 0&&b(tn,{label:"Upscaling scale",value:x,onClick:()=>n(Ox(x))}),A==="esrgan"&&P!==void 0&&b(tn,{label:"Upscaling strength",value:P,onClick:()=>n(Mx(P))}),g&&b(tn,{label:"Prompt",labelPosition:"top",value:Km(g),onClick:()=>n(Q3(g))}),w!==void 0&&b(tn,{label:"Seed",value:w,onClick:()=>n(A1(w))}),L!==void 0&&b(tn,{label:"Noise Threshold",value:L,onClick:()=>n(oW(L))}),p!==void 0&&b(tn,{label:"Perlin Noise",value:p,onClick:()=>n(JU(p))}),v&&b(tn,{label:"Sampler",value:v,onClick:()=>n(eW(v))}),k&&b(tn,{label:"Steps",value:k,onClick:()=>n(iW(k))}),o!==void 0&&b(tn,{label:"CFG scale",value:o,onClick:()=>n(qU(o))}),O&&O.length>0&&b(tn,{label:"Seed-weight pairs",value:tb(O),onClick:()=>n(nW(tb(O)))}),C&&b(tn,{label:"Seamless",value:C,onClick:()=>n(tW(C))}),l&&b(tn,{label:"High Resolution Optimization",value:l,onClick:()=>n(z_(l))}),I&&b(tn,{label:"Width",value:I,onClick:()=>n(aW(I))}),s&&b(tn,{label:"Height",value:s,onClick:()=>n(XU(s))}),u&&b(tn,{label:"Initial image",value:u,isLink:!0,onClick:()=>n(Kh(u))}),c&&b(tn,{label:"Mask image",value:c,isLink:!0,onClick:()=>n(QU(c))}),A==="img2img"&&P&&b(tn,{label:"Image to image strength",value:P,onClick:()=>n(Ax(P))}),a&&b(tn,{label:"Image to image fit",value:a,onClick:()=>n(rW(a))}),m&&m.length>0&&j(gn,{children:[b(xc,{size:"sm",children:"Postprocessing"}),m.map((Y,z)=>{if(Y.type==="esrgan"){const{scale:R,strength:N}=Y;return j(Le,{pl:"2rem",gap:1,direction:"column",children:[b(Lt,{size:"md",children:`${z+1}: Upscale (ESRGAN)`}),b(tn,{label:"Scale",value:R,onClick:()=>n(Ox(R))}),b(tn,{label:"Strength",value:N,onClick:()=>n(Mx(N))})]},z)}else if(Y.type==="gfpgan"){const{strength:R}=Y;return j(Le,{pl:"2rem",gap:1,direction:"column",children:[b(Lt,{size:"md",children:`${z+1}: Face restoration (GFPGAN)`}),b(tn,{label:"Strength",value:R,onClick:()=>{n(B2(R)),n(F2("gfpgan"))}})]},z)}else if(Y.type==="codeformer"){const{strength:R,fidelity:N}=Y;return j(Le,{pl:"2rem",gap:1,direction:"column",children:[b(Lt,{size:"md",children:`${z+1}: Face restoration (Codeformer)`}),b(tn,{label:"Strength",value:R,onClick:()=>{n(B2(R)),n(F2("codeformer"))}}),N&&b(tn,{label:"Fidelity",value:N,onClick:()=>{n(uW(N)),n(F2("codeformer"))}})]},z)}})]}),i&&b(tn,{withCopy:!0,label:"Dream Prompt",value:i}),j(Le,{gap:2,direction:"column",children:[j(Le,{gap:2,children:[b(ri,{label:"Copy metadata JSON",children:b(_o,{"aria-label":"Copy metadata JSON",icon:b(wh,{}),size:"xs",variant:"ghost",fontSize:14,onClick:()=>navigator.clipboard.writeText($)})}),b(Lt,{fontWeight:"semibold",children:"Metadata JSON:"})]}),b("div",{className:"image-json-viewer",children:b("pre",{children:$})})]})]}):b(TF,{width:"100%",pt:10,children:b(Lt,{fontSize:"lg",fontWeight:"semibold",children:"No metadata available"})})]})})},BRe);mk.displayName="ImageMetadataViewer";const vK=Fe([sd,od],(e,t)=>{const{currentCategory:n,currentImage:r,intermediateImage:i}=e,{shouldShowImageDetails:o}=t,a=e.categories[r?r.category:"result"].images,s=a.findIndex(u=>{var c;return u.uuid===((c=e==null?void 0:e.currentImage)==null?void 0:c.uuid)}),l=a.length;return{imageToDisplay:i||r,isIntermediate:Boolean(i),viewerImageToDisplay:r,currentCategory:n,isOnFirstImage:s===0,isOnLastImage:!isNaN(s)&&s===l-1,shouldShowImageDetails:o,shouldShowPrevImageButton:s===0,shouldShowNextImageButton:!isNaN(s)&&s===l-1}},{memoizeOptions:{resultEqualityCheck:Ue}});function FRe(){const e=ge(),{isOnFirstImage:t,isOnLastImage:n,shouldShowImageDetails:r,imageToDisplay:i,isIntermediate:o}=ne(vK),[a,s]=S.useState(!1),l=()=>{s(!0)},u=()=>{s(!1)},c=()=>{e(N_())},f=()=>{e(D_())};return j("div",{className:"current-image-preview",children:[i&&b(r3,{src:i.url,width:i.width,height:i.height,style:{imageRendering:o?"pixelated":"initial"}}),!r&&j("div",{className:"current-image-next-prev-buttons",children:[b("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!t&&b(_o,{"aria-label":"Previous image",icon:b(iK,{className:"next-prev-button"}),variant:"unstyled",onClick:c})}),b("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!n&&b(_o,{"aria-label":"Next image",icon:b(oK,{className:"next-prev-button"}),variant:"unstyled",onClick:f})})]}),r&&i&&b(mk,{image:i,styleClass:"current-image-metadata"})]})}var zRe=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},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)}}(),nr=globalThis&&globalThis.__assign||function(){return nr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n"u"?void 0:Number(r),maxHeight:typeof i>"u"?void 0:Number(i),minWidth:typeof o>"u"?void 0:Number(o),minHeight:typeof a>"u"?void 0:Number(a)}},KRe=["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"],AR="__resizable_base__",yK=function(e){VRe(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 i=r.parentNode;if(!i)return null;var o=r.window.document.createElement("div");return o.style.width="100%",o.style.height="100%",o.style.position="absolute",o.style.transform="scale(0, 0)",o.style.left="0",o.style.flex="0 0 100%",o.classList?o.classList.add(AR):o.className+=AR,i.appendChild(o),o},r.removeBase=function(i){var o=r.parentNode;o&&o.removeChild(i)},r.ref=function(i){i&&(r.resizable=i)},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||URe},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var n=0,r=0;if(this.resizable&&this.window){var i=this.resizable.offsetWidth,o=this.resizable.offsetHeight,a=this.resizable.style.position;a!=="relative"&&(this.resizable.style.position="relative"),n=this.resizable.style.width!=="auto"?this.resizable.offsetWidth:i,r=this.resizable.style.height!=="auto"?this.resizable.offsetHeight:o,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,i=function(s){if(typeof n.state[s]>"u"||n.state[s]==="auto")return"auto";if(n.propsSize&&n.propsSize[s]&&n.propsSize[s].toString().endsWith("%")){if(n.state[s].toString().endsWith("%"))return n.state[s].toString();var l=n.getParentSize(),u=Number(n.state[s].toString().replace("px","")),c=u/l[s]*100;return c+"%"}return qw(n.state[s])},o=r&&typeof r.width<"u"&&!this.state.isResizing?qw(r.width):i("width"),a=r&&typeof r.height<"u"&&!this.state.isResizing?qw(r.height):i("height");return{width:o,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,i=this.parentNode.style.flexWrap;i!=="wrap"&&(r=!0,this.parentNode.style.flexWrap="wrap"),n.style.position="relative",n.style.minWidth="100%",n.style.minHeight="100%";var o={width:n.offsetWidth,height:n.offsetHeight};return r&&(this.parentNode.style.flexWrap=i),this.removeBase(n),o},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 i=this.propsSize&&this.propsSize[r];return this.state[r]==="auto"&&this.state.original[r]===n&&(typeof i>"u"||i==="auto")?"auto":n},t.prototype.calculateNewMaxFromBoundary=function(n,r){var i=this.props.boundsByDirection,o=this.state.direction,a=i&&Yd("left",o),s=i&&Yd("top",o),l,u;if(this.props.bounds==="parent"){var c=this.parentNode;c&&(l=a?this.resizableRight-this.parentLeft:c.offsetWidth+(this.parentLeft-this.resizableLeft),u=s?this.resizableBottom-this.parentTop:c.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(l=a?this.resizableRight:this.window.innerWidth-this.resizableLeft,u=s?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(l=a?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),u=s?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return l&&Number.isFinite(l)&&(n=n&&n"u"?10:o.width,f=typeof i.width>"u"||i.width<0?n:i.width,p=typeof o.height>"u"?10:o.height,m=typeof i.height>"u"||i.height<0?r:i.height,g=l||0,v=u||0;if(s){var x=(p-g)*this.ratio+v,C=(m-g)*this.ratio+v,w=(c-v)/this.ratio+g,k=(f-v)/this.ratio+g,P=Math.max(c,x),L=Math.min(f,C),A=Math.max(p,w),O=Math.min(m,k);n=Yv(n,P,L),r=Yv(r,A,O)}else n=Yv(n,c,f),r=Yv(r,p,m);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 i=this.props.bounds.getBoundingClientRect();this.targetLeft=i.left,this.targetTop=i.top}if(this.resizable){var o=this.resizable.getBoundingClientRect(),a=o.left,s=o.top,l=o.right,u=o.bottom;this.resizableLeft=a,this.resizableRight=l,this.resizableTop=s,this.resizableBottom=u}},t.prototype.onResizeStart=function(n,r){if(!(!this.resizable||!this.window)){var i=0,o=0;if(n.nativeEvent&&WRe(n.nativeEvent)?(i=n.nativeEvent.clientX,o=n.nativeEvent.clientY):n.nativeEvent&&qv(n.nativeEvent)&&(i=n.nativeEvent.touches[0].clientX,o=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 s,l=this.window.getComputedStyle(this.resizable);if(l.flexBasis!=="auto"){var u=this.parentNode;if(u){var c=this.window.getComputedStyle(u).flexDirection;this.flexDir=c.startsWith("row")?"row":"column",s=l.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var f={original:{x:i,y:o,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:Ma(Ma({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(n.target).cursor||"auto"}),direction:r,flexBasis:s};this.setState(f)}},t.prototype.onMouseMove=function(n){var r=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&qv(n))try{n.preventDefault(),n.stopPropagation()}catch(N){}var i=this.props,o=i.maxWidth,a=i.maxHeight,s=i.minWidth,l=i.minHeight,u=qv(n)?n.touches[0].clientX:n.clientX,c=qv(n)?n.touches[0].clientY:n.clientY,f=this.state,p=f.direction,m=f.original,g=f.width,v=f.height,x=this.getParentSize(),C=GRe(x,this.window.innerWidth,this.window.innerHeight,o,a,s,l);o=C.maxWidth,a=C.maxHeight,s=C.minWidth,l=C.minHeight;var w=this.calculateNewSizeFromDirection(u,c),k=w.newHeight,P=w.newWidth,L=this.calculateNewMaxFromBoundary(o,a);this.props.snap&&this.props.snap.x&&(P=LR(P,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(k=LR(k,this.props.snap.y,this.props.snapGap));var A=this.calculateNewSizeFromAspectRatio(P,k,{width:L.maxWidth,height:L.maxHeight},{width:s,height:l});if(P=A.newWidth,k=A.newHeight,this.props.grid){var O=TR(P,this.props.grid[0]),I=TR(k,this.props.grid[1]),$=this.props.snapGap||0;P=$===0||Math.abs(O-P)<=$?O:P,k=$===0||Math.abs(I-k)<=$?I:k}var D={width:P-m.width,height:k-m.height};if(g&&typeof g=="string"){if(g.endsWith("%")){var V=P/x.width*100;P=V+"%"}else if(g.endsWith("vw")){var Y=P/this.window.innerWidth*100;P=Y+"vw"}else if(g.endsWith("vh")){var z=P/this.window.innerHeight*100;P=z+"vh"}}if(v&&typeof v=="string"){if(v.endsWith("%")){var V=k/x.height*100;k=V+"%"}else if(v.endsWith("vw")){var Y=k/this.window.innerWidth*100;k=Y+"vw"}else if(v.endsWith("vh")){var z=k/this.window.innerHeight*100;k=z+"vh"}}var R={width:this.createSizeForCssProperty(P,"width"),height:this.createSizeForCssProperty(k,"height")};this.flexDir==="row"?R.flexBasis=R.width:this.flexDir==="column"&&(R.flexBasis=R.height),la.flushSync(function(){r.setState(R)}),this.props.onResize&&this.props.onResize(n,p,this.resizable,D)}},t.prototype.onMouseUp=function(n){var r=this.state,i=r.isResizing,o=r.direction,a=r.original;if(!(!i||!this.resizable)){var s={width:this.size.width-a.width,height:this.size.height-a.height};this.props.onResizeStop&&this.props.onResizeStop(n,o,this.resizable,s),this.props.size&&this.setState(this.props.size),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:Ma(Ma({},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,i=r.enable,o=r.handleStyles,a=r.handleClasses,s=r.handleWrapperStyle,l=r.handleWrapperClass,u=r.handleComponent;if(!i)return null;var c=Object.keys(i).map(function(f){return i[f]!==!1?S.createElement(HRe,{key:f,direction:f,onResizeStart:n.onResizeStart,replaceStyles:o&&o[f],className:a&&a[f]},u&&u[f]?u[f]:null):null});return S.createElement("div",{className:l,style:s},c)},t.prototype.render=function(){var n=this,r=Object.keys(this.props).reduce(function(a,s){return KRe.indexOf(s)!==-1||(a[s]=n.props[s]),a},{}),i=Ma(Ma(Ma({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&&(i.flexBasis=this.state.flexBasis);var o=this.props.as||"div";return S.createElement(o,Ma({ref:this.ref,style:i,className:this.props.className},r),this.state.isResizing&&S.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}(S.PureComponent);const fn=e=>{const{label:t,styleClass:n,...r}=e;return b(vF,{className:`invokeai__checkbox ${n}`,...r,children:t})};function bK(e){return We({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M21 11H6.414l5.293-5.293-1.414-1.414L2.586 12l7.707 7.707 1.414-1.414L6.414 13H21z"}}]})(e)}function YRe(e){return We({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 m4(e){return We({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 qRe(e){return We({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 XRe(e){return We({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 ZRe(e){return We({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 QRe(e){return We({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)}function Ri(e){const[t,n]=S.useState(!1),{label:r,value:i,min:o=1,max:a=100,step:s=1,onChange:l,width:u="100%",tooltipSuffix:c="",withSliderMarks:f=!1,sliderMarkLeftOffset:p=0,sliderMarkRightOffset:m=-7,withInput:g=!1,isInteger:v=!1,inputWidth:x="5.5rem",inputReadOnly:C=!1,withReset:w=!1,hideTooltip:k=!1,isCompact:P=!1,handleReset:L,isResetDisabled:A,isSliderDisabled:O,isInputDisabled:I,styleClass:$,sliderFormControlProps:D,sliderFormLabelProps:V,sliderMarkProps:Y,sliderTrackProps:z,sliderThumbProps:R,sliderNumberInputProps:N,sliderNumberInputFieldProps:U,sliderNumberInputStepperProps:G,sliderTooltipProps:B,sliderIAIIconButtonProps:W,...X}=e,[re,le]=S.useState(String(i));S.useEffect(()=>{le(i)},[i]);const he=S.useMemo(()=>N!=null&&N.max?N.max:a,[a,N==null?void 0:N.max]),se=fe=>{l(fe)},Ae=fe=>{fe.target.value===""&&(fe.target.value=String(o));const Xe=ti(v?Math.floor(Number(fe.target.value)):Number(re),o,he);l(Xe)},be=fe=>{le(fe)},De=()=>{L&&L()};return j(Tt,{className:$?`invokeai__slider-component ${$}`:"invokeai__slider-component","data-markers":f,style:P?{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"1rem",margin:0,padding:0}:{},...D,children:[b(Ht,{className:"invokeai__slider-component-label",...V,children:r}),j(f1,{w:"100%",gap:2,alignItems:"center",children:[j(i_,{"aria-label":r,value:i,min:o,max:a,step:s,onChange:se,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),focusThumbOnChange:!1,isDisabled:O,width:u,...X,children:[f&&j(gn,{children:[b(ux,{value:o,className:"invokeai__slider-mark invokeai__slider-mark-start",ml:p,...Y,children:o}),b(ux,{value:a,className:"invokeai__slider-mark invokeai__slider-mark-end",ml:m,...Y,children:a})]}),b(gV,{className:"invokeai__slider_track",...z,children:b(vV,{className:"invokeai__slider_track-filled"})}),b(ri,{hasArrow:!0,className:"invokeai__slider-component-tooltip",placement:"top",isOpen:t,label:`${i}${c}`,hidden:k,...B,children:b(mV,{className:"invokeai__slider-thumb",...R})})]}),g&&j(q8,{min:o,max:he,step:s,value:re,onChange:be,onBlur:Ae,className:"invokeai__slider-number-field",isDisabled:I,...N,children:[b(X8,{className:"invokeai__slider-number-input",width:x,readOnly:C,minWidth:x,...U}),j(QH,{...G,children:[b(Q8,{onClick:()=>l(Number(re)),className:"invokeai__slider-number-stepper"}),b(Z8,{onClick:()=>l(Number(re)),className:"invokeai__slider-number-stepper"})]})]}),w&&b(Ie,{size:"sm","aria-label":"Reset",tooltip:"Reset",icon:b(m4,{}),onClick:De,isDisabled:A,...W})]})]})}function SK(e){return We({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 wK(e){return We({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 JRe(e){return We({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 19.59V8l-6-6H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c.45 0 .85-.15 1.19-.4l-4.43-4.43c-.8.52-1.74.83-2.76.83-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5c0 1.02-.31 1.96-.83 2.75L20 19.59zM9 13c0 1.66 1.34 3 3 3s3-1.34 3-3-1.34-3-3-3-3 1.34-3 3z"}}]})(e)}function e$e(e){return We({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"}}]})(e)}function t$e(e){return We({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 n$e(e){return We({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 CK(e){return We({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 r$e(e){return We({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"}}]})(e)}function i$e(e){return We({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}}]})(e)}function o$e(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function a$e(e,t){e.classList?e.classList.add(t):o$e(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function OR(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function s$e(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=OR(e.className,t):e.setAttribute("class",OR(e.className&&e.className.baseVal||"",t))}const MR={disabled:!1},xK=M.createContext(null);var _K=function(t){return t.scrollTop},wm="unmounted",nc="exited",rc="entering",ef="entered",r7="exiting",el=function(e){F8(t,e);function t(r,i){var o;o=e.call(this,r,i)||this;var a=i,s=a&&!a.isMounting?r.enter:r.appear,l;return o.appearStatus=null,r.in?s?(l=nc,o.appearStatus=rc):l=ef:r.unmountOnExit||r.mountOnEnter?l=wm:l=nc,o.state={status:l},o.nextCallback=null,o}t.getDerivedStateFromProps=function(i,o){var a=i.in;return a&&o.status===wm?{status:nc}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var o=null;if(i!==this.props){var a=this.state.status;this.props.in?a!==rc&&a!==ef&&(o=rc):(a===rc||a===ef)&&(o=r7)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,o,a,s;return o=a=s=i,i!=null&&typeof i!="number"&&(o=i.exit,a=i.enter,s=i.appear!==void 0?i.appear:a),{exit:o,enter:a,appear:s}},n.updateStatus=function(i,o){if(i===void 0&&(i=!1),o!==null)if(this.cancelNextCallback(),o===rc){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:Sv.findDOMNode(this);a&&_K(a)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===nc&&this.setState({status:wm})},n.performEnter=function(i){var o=this,a=this.props.enter,s=this.context?this.context.isMounting:i,l=this.props.nodeRef?[s]:[Sv.findDOMNode(this),s],u=l[0],c=l[1],f=this.getTimeouts(),p=s?f.appear:f.enter;if(!i&&!a||MR.disabled){this.safeSetState({status:ef},function(){o.props.onEntered(u)});return}this.props.onEnter(u,c),this.safeSetState({status:rc},function(){o.props.onEntering(u,c),o.onTransitionEnd(p,function(){o.safeSetState({status:ef},function(){o.props.onEntered(u,c)})})})},n.performExit=function(){var i=this,o=this.props.exit,a=this.getTimeouts(),s=this.props.nodeRef?void 0:Sv.findDOMNode(this);if(!o||MR.disabled){this.safeSetState({status:nc},function(){i.props.onExited(s)});return}this.props.onExit(s),this.safeSetState({status:r7},function(){i.props.onExiting(s),i.onTransitionEnd(a.exit,function(){i.safeSetState({status:nc},function(){i.props.onExited(s)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,o){o=this.setNextCallback(o),this.setState(i,o)},n.setNextCallback=function(i){var o=this,a=!0;return this.nextCallback=function(s){a&&(a=!1,o.nextCallback=null,i(s))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(i,o){this.setNextCallback(o);var a=this.props.nodeRef?this.props.nodeRef.current:Sv.findDOMNode(this),s=i==null&&!this.props.addEndListener;if(!a||s){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],u=l[0],c=l[1];this.props.addEndListener(u,c)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===wm)return null;var o=this.props,a=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var s=D8(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return M.createElement(xK.Provider,{value:null},typeof a=="function"?a(i,s):M.cloneElement(M.Children.only(a),s))},t}(M.Component);el.contextType=xK;el.propTypes={};function qd(){}el.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:qd,onEntering:qd,onEntered:qd,onExit:qd,onExiting:qd,onExited:qd};el.UNMOUNTED=wm;el.EXITED=nc;el.ENTERING=rc;el.ENTERED=ef;el.EXITING=r7;const l$e=el;var u$e=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return a$e(t,r)})},Xw=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return s$e(t,r)})},gk=function(e){F8(t,e);function t(){for(var r,i=arguments.length,o=new Array(i),a=0;ag,Object.values(g));return S.createElement(v.Provider,{value:x},m)}function c(f,p){const m=(p==null?void 0:p[e][l])||s,g=S.useContext(m);if(g)return g;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${o}\``)}return u.displayName=o+"Provider",[u,c]}const i=()=>{const o=n.map(a=>S.createContext(a));return function(s){const l=(s==null?void 0:s[e])||o;return S.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[r,c$e(i,...t)]}function c$e(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((s,{useScope:l,scopeName:u})=>{const f=l(o)[`__scope${u}`];return{...s,...f}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function d$e(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function EK(...e){return t=>e.forEach(n=>d$e(n,t))}function Lo(...e){return S.useCallback(EK(...e),e)}const qg=S.forwardRef((e,t)=>{const{children:n,...r}=e,i=S.Children.toArray(n),o=i.find(h$e);if(o){const a=o.props.children,s=i.map(l=>l===o?S.Children.count(a)>1?S.Children.only(null):S.isValidElement(a)?a.props.children:null:l);return S.createElement(i7,Dt({},r,{ref:t}),S.isValidElement(a)?S.cloneElement(a,void 0,s):null)}return S.createElement(i7,Dt({},r,{ref:t}),n)});qg.displayName="Slot";const i7=S.forwardRef((e,t)=>{const{children:n,...r}=e;return S.isValidElement(n)?S.cloneElement(n,{...p$e(r,n.props),ref:EK(t,n.ref)}):S.Children.count(n)>1?S.Children.only(null):null});i7.displayName="SlotClone";const f$e=({children:e})=>S.createElement(S.Fragment,null,e);function h$e(e){return S.isValidElement(e)&&e.type===f$e}function p$e(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{o(...s),i(...s)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}const m$e=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],Ws=m$e.reduce((e,t)=>{const n=S.forwardRef((r,i)=>{const{asChild:o,...a}=r,s=o?qg:t;return S.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),S.createElement(s,Dt({},a,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function PK(e,t){e&&la.flushSync(()=>e.dispatchEvent(t))}function TK(e){const t=e+"CollectionProvider",[n,r]=N1(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=m=>{const{scope:g,children:v}=m,x=M.useRef(null),C=M.useRef(new Map).current;return M.createElement(i,{scope:g,itemMap:C,collectionRef:x},v)},s=e+"CollectionSlot",l=M.forwardRef((m,g)=>{const{scope:v,children:x}=m,C=o(s,v),w=Lo(g,C.collectionRef);return M.createElement(qg,{ref:w},x)}),u=e+"CollectionItemSlot",c="data-radix-collection-item",f=M.forwardRef((m,g)=>{const{scope:v,children:x,...C}=m,w=M.useRef(null),k=Lo(g,w),P=o(u,v);return M.useEffect(()=>(P.itemMap.set(w,{ref:w,...C}),()=>void P.itemMap.delete(w))),M.createElement(qg,{[c]:"",ref:k},x)});function p(m){const g=o(e+"CollectionConsumer",m);return M.useCallback(()=>{const x=g.collectionRef.current;if(!x)return[];const C=Array.from(x.querySelectorAll(`[${c}]`));return Array.from(g.itemMap.values()).sort((P,L)=>C.indexOf(P.ref.current)-C.indexOf(L.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:a,Slot:l,ItemSlot:f},p,r]}const g$e=S.createContext(void 0);function LK(e){const t=S.useContext(g$e);return e||t||"ltr"}function os(e){const t=S.useRef(e);return S.useEffect(()=>{t.current=e}),S.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function v$e(e,t=globalThis==null?void 0:globalThis.document){const n=os(e);S.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const o7="dismissableLayer.update",y$e="dismissableLayer.pointerDownOutside",b$e="dismissableLayer.focusOutside";let IR;const S$e=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),w$e=S.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:s,onDismiss:l,...u}=e,c=S.useContext(S$e),[f,p]=S.useState(null),m=(n=f==null?void 0:f.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,g]=S.useState({}),v=Lo(t,I=>p(I)),x=Array.from(c.layers),[C]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),w=x.indexOf(C),k=f?x.indexOf(f):-1,P=c.layersWithOutsidePointerEventsDisabled.size>0,L=k>=w,A=C$e(I=>{const $=I.target,D=[...c.branches].some(V=>V.contains($));!L||D||(o==null||o(I),s==null||s(I),I.defaultPrevented||l==null||l())},m),O=x$e(I=>{const $=I.target;[...c.branches].some(V=>V.contains($))||(a==null||a(I),s==null||s(I),I.defaultPrevented||l==null||l())},m);return v$e(I=>{k===c.layers.size-1&&(i==null||i(I),!I.defaultPrevented&&l&&(I.preventDefault(),l()))},m),S.useEffect(()=>{if(f)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(IR=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(f)),c.layers.add(f),RR(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=IR)}},[f,m,r,c]),S.useEffect(()=>()=>{f&&(c.layers.delete(f),c.layersWithOutsidePointerEventsDisabled.delete(f),RR())},[f,c]),S.useEffect(()=>{const I=()=>g({});return document.addEventListener(o7,I),()=>document.removeEventListener(o7,I)},[]),S.createElement(Ws.div,Dt({},u,{ref:v,style:{pointerEvents:P?L?"auto":"none":void 0,...e.style},onFocusCapture:mn(e.onFocusCapture,O.onFocusCapture),onBlurCapture:mn(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:mn(e.onPointerDownCapture,A.onPointerDownCapture)}))});function C$e(e,t=globalThis==null?void 0:globalThis.document){const n=os(e),r=S.useRef(!1),i=S.useRef(()=>{});return S.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let u=function(){AK(y$e,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=u,t.addEventListener("click",i.current,{once:!0})):u()}r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function x$e(e,t=globalThis==null?void 0:globalThis.document){const n=os(e),r=S.useRef(!1);return S.useEffect(()=>{const i=o=>{o.target&&!r.current&&AK(b$e,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function RR(){const e=new CustomEvent(o7);document.dispatchEvent(e)}function AK(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?PK(i,o):i.dispatchEvent(o)}let Zw=0;function _$e(){S.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:$R()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:$R()),Zw++,()=>{Zw===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),Zw--}},[])}function $R(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}const Qw="focusScope.autoFocusOnMount",Jw="focusScope.autoFocusOnUnmount",DR={bubbles:!1,cancelable:!0},k$e=S.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[s,l]=S.useState(null),u=os(i),c=os(o),f=S.useRef(null),p=Lo(t,v=>l(v)),m=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(r){let v=function(C){if(m.paused||!s)return;const w=C.target;s.contains(w)?f.current=w:ic(f.current,{select:!0})},x=function(C){m.paused||!s||s.contains(C.relatedTarget)||ic(f.current,{select:!0})};return document.addEventListener("focusin",v),document.addEventListener("focusout",x),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",x)}}},[r,s,m.paused]),S.useEffect(()=>{if(s){BR.add(m);const v=document.activeElement;if(!s.contains(v)){const C=new CustomEvent(Qw,DR);s.addEventListener(Qw,u),s.dispatchEvent(C),C.defaultPrevented||(E$e(O$e(OK(s)),{select:!0}),document.activeElement===v&&ic(s))}return()=>{s.removeEventListener(Qw,u),setTimeout(()=>{const C=new CustomEvent(Jw,DR);s.addEventListener(Jw,c),s.dispatchEvent(C),C.defaultPrevented||ic(v!=null?v:document.body,{select:!0}),s.removeEventListener(Jw,c),BR.remove(m)},0)}}},[s,u,c,m]);const g=S.useCallback(v=>{if(!n&&!r||m.paused)return;const x=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,C=document.activeElement;if(x&&C){const w=v.currentTarget,[k,P]=P$e(w);k&&P?!v.shiftKey&&C===P?(v.preventDefault(),n&&ic(k,{select:!0})):v.shiftKey&&C===k&&(v.preventDefault(),n&&ic(P,{select:!0})):C===w&&v.preventDefault()}},[n,r,m.paused]);return S.createElement(Ws.div,Dt({tabIndex:-1},a,{ref:p,onKeyDown:g}))});function E$e(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ic(r,{select:t}),document.activeElement!==n)return}function P$e(e){const t=OK(e),n=NR(t,e),r=NR(t.reverse(),e);return[n,r]}function OK(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function NR(e,t){for(const n of e)if(!T$e(n,{upTo:t}))return n}function T$e(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function L$e(e){return e instanceof HTMLInputElement&&"select"in e}function ic(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&L$e(e)&&t&&e.select()}}const BR=A$e();function A$e(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=FR(e,t),e.unshift(t)},remove(t){var n;e=FR(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function FR(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function O$e(e){return e.filter(t=>t.tagName!=="A")}const Ch=Boolean(globalThis==null?void 0:globalThis.document)?S.useLayoutEffect:()=>{},M$e=h6["useId".toString()]||(()=>{});let I$e=0;function R$e(e){const[t,n]=S.useState(M$e());return Ch(()=>{e||n(r=>r!=null?r:String(I$e++))},[e]),e||(t?`radix-${t}`:"")}function Jh(e){return e.split("-")[0]}function g4(e){return e.split("-")[1]}function ep(e){return["top","bottom"].includes(Jh(e))?"x":"y"}function vk(e){return e==="y"?"height":"width"}function zR(e,t,n){let{reference:r,floating:i}=e;const o=r.x+r.width/2-i.width/2,a=r.y+r.height/2-i.height/2,s=ep(t),l=vk(s),u=r[l]/2-i[l]/2,c=s==="x";let f;switch(Jh(t)){case"top":f={x:o,y:r.y-i.height};break;case"bottom":f={x:o,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:a};break;case"left":f={x:r.x-i.width,y:a};break;default:f={x:r.x,y:r.y}}switch(g4(t)){case"start":f[s]-=u*(n&&c?-1:1);break;case"end":f[s]+=u*(n&&c?-1:1)}return f}const $$e=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=await(a.isRTL==null?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:c}=zR(l,r,s),f=r,p={},m=0;for(let g=0;g({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=e!=null?e:{},{x:i,y:o,placement:a,rects:s,platform:l}=t;if(n==null)return{};const u=MK(r),c={x:i,y:o},f=ep(a),p=g4(a),m=vk(f),g=await l.getDimensions(n),v=f==="y"?"top":"left",x=f==="y"?"bottom":"right",C=s.reference[m]+s.reference[f]-c[f]-s.floating[m],w=c[f]-s.reference[f],k=await(l.getOffsetParent==null?void 0:l.getOffsetParent(n));let P=k?f==="y"?k.clientHeight||0:k.clientWidth||0:0;P===0&&(P=s.floating[m]);const L=C/2-w/2,A=u[v],O=P-g[m]-u[x],I=P/2-g[m]/2+L,$=a7(A,I,O),D=(p==="start"?u[v]:u[x])>0&&I!==$&&s.reference[m]<=s.floating[m];return{[f]:c[f]-(D?IB$e[t])}function F$e(e,t,n){n===void 0&&(n=!1);const r=g4(e),i=ep(e),o=vk(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=db(a)),{main:a,cross:db(a)}}const z$e={start:"end",end:"start"};function HR(e){return e.replace(/start|end/g,t=>z$e[t])}const IK=["top","right","bottom","left"];IK.reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);const j$e=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:i,rects:o,initialPlacement:a,platform:s,elements:l}=t,{mainAxis:u=!0,crossAxis:c=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",flipAlignment:m=!0,...g}=e,v=Jh(r),x=f||(v===a||!m?[db(a)]:function(I){const $=db(I);return[HR(I),$,HR($)]}(a)),C=[a,...x],w=await cb(t,g),k=[];let P=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&k.push(w[v]),c){const{main:I,cross:$}=F$e(r,o,await(s.isRTL==null?void 0:s.isRTL(l.floating)));k.push(w[I],w[$])}if(P=[...P,{placement:r,overflows:k}],!k.every(I=>I<=0)){var L,A;const I=((L=(A=i.flip)==null?void 0:A.index)!=null?L:0)+1,$=C[I];if($)return{data:{index:I,overflows:P},reset:{placement:$}};let D="bottom";switch(p){case"bestFit":{var O;const V=(O=P.map(Y=>[Y,Y.overflows.filter(z=>z>0).reduce((z,R)=>z+R,0)]).sort((Y,z)=>Y[1]-z[1])[0])==null?void 0:O[0].placement;V&&(D=V);break}case"initialPlacement":D=a}if(r!==D)return{reset:{placement:D}}}return{}}}};function VR(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function UR(e){return IK.some(t=>e[t]>=0)}const H$e=function(e){let{strategy:t="referenceHidden",...n}=e===void 0?{}:e;return{name:"hide",async fn(r){const{rects:i}=r;switch(t){case"referenceHidden":{const o=VR(await cb(r,{...n,elementContext:"reference"}),i.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:UR(o)}}}case"escaped":{const o=VR(await cb(r,{...n,altBoundary:!0}),i.floating);return{data:{escapedOffsets:o,escaped:UR(o)}}}default:return{}}}}},V$e=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await async function(o,a){const{placement:s,platform:l,elements:u}=o,c=await(l.isRTL==null?void 0:l.isRTL(u.floating)),f=Jh(s),p=g4(s),m=ep(s)==="x",g=["left","top"].includes(f)?-1:1,v=c&&m?-1:1,x=typeof a=="function"?a(o):a;let{mainAxis:C,crossAxis:w,alignmentAxis:k}=typeof x=="number"?{mainAxis:x,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...x};return p&&typeof k=="number"&&(w=p==="end"?-1*k:k),m?{x:w*v,y:C*g}:{x:C*g,y:w*v}}(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};function RK(e){return e==="x"?"y":"x"}const U$e=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:x=>{let{x:C,y:w}=x;return{x:C,y:w}}},...l}=e,u={x:n,y:r},c=await cb(t,l),f=ep(Jh(i)),p=RK(f);let m=u[f],g=u[p];if(o){const x=f==="y"?"bottom":"right";m=a7(m+c[f==="y"?"top":"left"],m,m-c[x])}if(a){const x=p==="y"?"bottom":"right";g=a7(g+c[p==="y"?"top":"left"],g,g-c[x])}const v=s.fn({...t,[f]:m,[p]:g});return{...v,data:{x:v.x-n,y:v.y-r}}}}},W$e=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=e,c={x:n,y:r},f=ep(i),p=RK(f);let m=c[f],g=c[p];const v=typeof s=="function"?s({...o,placement:i}):s,x=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(l){const L=f==="y"?"height":"width",A=o.reference[f]-o.floating[L]+x.mainAxis,O=o.reference[f]+o.reference[L]-x.mainAxis;mO&&(m=O)}if(u){var C,w,k,P;const L=f==="y"?"width":"height",A=["top","left"].includes(Jh(i)),O=o.reference[p]-o.floating[L]+(A&&(C=(w=a.offset)==null?void 0:w[p])!=null?C:0)+(A?0:x.crossAxis),I=o.reference[p]+o.reference[L]+(A?0:(k=(P=a.offset)==null?void 0:P[p])!=null?k:0)-(A?x.crossAxis:0);gI&&(g=I)}return{[f]:m,[p]:g}}}};function $K(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function tl(e){if(e==null)return window;if(!$K(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function B1(e){return tl(e).getComputedStyle(e)}function $s(e){return $K(e)?"":e?(e.nodeName||"").toLowerCase():""}function DK(){const e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(t=>t.brand+"/"+t.version).join(" "):navigator.userAgent}function as(e){return e instanceof tl(e).HTMLElement}function fu(e){return e instanceof tl(e).Element}function yk(e){return typeof ShadowRoot>"u"?!1:e instanceof tl(e).ShadowRoot||e instanceof ShadowRoot}function v4(e){const{overflow:t,overflowX:n,overflowY:r}=B1(e);return/auto|scroll|overlay|hidden/.test(t+r+n)}function G$e(e){return["table","td","th"].includes($s(e))}function WR(e){const t=/firefox/i.test(DK()),n=B1(e);return n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].includes(n.willChange)||t&&n.willChange==="filter"||t&&!!n.filter&&n.filter!=="none"}function NK(){return!/^((?!chrome|android).)*safari/i.test(DK())}const GR=Math.min,Jm=Math.max,fb=Math.round;function Ds(e,t,n){var r,i,o,a;t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect();let l=1,u=1;t&&as(e)&&(l=e.offsetWidth>0&&fb(s.width)/e.offsetWidth||1,u=e.offsetHeight>0&&fb(s.height)/e.offsetHeight||1);const c=fu(e)?tl(e):window,f=!NK()&&n,p=(s.left+(f&&(r=(i=c.visualViewport)==null?void 0:i.offsetLeft)!=null?r:0))/l,m=(s.top+(f&&(o=(a=c.visualViewport)==null?void 0:a.offsetTop)!=null?o:0))/u,g=s.width/l,v=s.height/u;return{width:g,height:v,top:m,right:p+g,bottom:m+v,left:p,x:p,y:m}}function eu(e){return(t=e,(t instanceof tl(t).Node?e.ownerDocument:e.document)||window.document).documentElement;var t}function y4(e){return fu(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function BK(e){return Ds(eu(e)).left+y4(e).scrollLeft}function K$e(e,t,n){const r=as(t),i=eu(t),o=Ds(e,r&&function(l){const u=Ds(l);return fb(u.width)!==l.offsetWidth||fb(u.height)!==l.offsetHeight}(t),n==="fixed");let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(r||!r&&n!=="fixed")if(($s(t)!=="body"||v4(i))&&(a=y4(t)),as(t)){const l=Ds(t,!0);s.x=l.x+t.clientLeft,s.y=l.y+t.clientTop}else i&&(s.x=BK(i));return{x:o.left+a.scrollLeft-s.x,y:o.top+a.scrollTop-s.y,width:o.width,height:o.height}}function FK(e){return $s(e)==="html"?e:e.assignedSlot||e.parentNode||(yk(e)?e.host:null)||eu(e)}function KR(e){return as(e)&&getComputedStyle(e).position!=="fixed"?e.offsetParent:null}function s7(e){const t=tl(e);let n=KR(e);for(;n&&G$e(n)&&getComputedStyle(n).position==="static";)n=KR(n);return n&&($s(n)==="html"||$s(n)==="body"&&getComputedStyle(n).position==="static"&&!WR(n))?t:n||function(r){let i=FK(r);for(yk(i)&&(i=i.host);as(i)&&!["html","body"].includes($s(i));){if(WR(i))return i;i=i.parentNode}return null}(e)||t}function YR(e){if(as(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=Ds(e);return{width:t.width,height:t.height}}function zK(e){const t=FK(e);return["html","body","#document"].includes($s(t))?e.ownerDocument.body:as(t)&&v4(t)?t:zK(t)}function hb(e,t){var n;t===void 0&&(t=[]);const r=zK(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=tl(r),a=i?[o].concat(o.visualViewport||[],v4(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(hb(a))}function qR(e,t,n){return t==="viewport"?ub(function(r,i){const o=tl(r),a=eu(r),s=o.visualViewport;let l=a.clientWidth,u=a.clientHeight,c=0,f=0;if(s){l=s.width,u=s.height;const p=NK();(p||!p&&i==="fixed")&&(c=s.offsetLeft,f=s.offsetTop)}return{width:l,height:u,x:c,y:f}}(e,n)):fu(t)?function(r,i){const o=Ds(r,!1,i==="fixed"),a=o.top+r.clientTop,s=o.left+r.clientLeft;return{top:a,left:s,x:s,y:a,right:s+r.clientWidth,bottom:a+r.clientHeight,width:r.clientWidth,height:r.clientHeight}}(t,n):ub(function(r){var i;const o=eu(r),a=y4(r),s=(i=r.ownerDocument)==null?void 0:i.body,l=Jm(o.scrollWidth,o.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),u=Jm(o.scrollHeight,o.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0);let c=-a.scrollLeft+BK(r);const f=-a.scrollTop;return B1(s||o).direction==="rtl"&&(c+=Jm(o.clientWidth,s?s.clientWidth:0)-l),{width:l,height:u,x:c,y:f}}(eu(e)))}function Y$e(e){const t=hb(e),n=["absolute","fixed"].includes(B1(e).position)&&as(e)?s7(e):e;return fu(n)?t.filter(r=>fu(r)&&function(i,o){const a=o.getRootNode==null?void 0:o.getRootNode();if(i.contains(o))return!0;if(a&&yk(a)){let s=o;do{if(s&&i===s)return!0;s=s.parentNode||s.host}while(s)}return!1}(r,n)&&$s(r)!=="body"):[]}const q$e={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?Y$e(t):[].concat(n),r],a=o[0],s=o.reduce((l,u)=>{const c=qR(t,u,i);return l.top=Jm(c.top,l.top),l.right=GR(c.right,l.right),l.bottom=GR(c.bottom,l.bottom),l.left=Jm(c.left,l.left),l},qR(t,a,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=as(n),o=eu(n);if(n===o)return t;let a={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if((i||!i&&r!=="fixed")&&(($s(n)!=="body"||v4(o))&&(a=y4(n)),as(n))){const l=Ds(n,!0);s.x=l.x+n.clientLeft,s.y=l.y+n.clientTop}return{...t,x:t.x-a.scrollLeft+s.x,y:t.y-a.scrollTop+s.y}},isElement:fu,getDimensions:YR,getOffsetParent:s7,getDocumentElement:eu,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:K$e(t,s7(n),r),floating:{...YR(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>B1(e).direction==="rtl"};function X$e(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=!0,animationFrame:s=!1}=r,l=i&&!s,u=o&&!s,c=l||u?[...fu(e)?hb(e):[],...hb(t)]:[];c.forEach(g=>{l&&g.addEventListener("scroll",n,{passive:!0}),u&&g.addEventListener("resize",n)});let f,p=null;if(a){let g=!0;p=new ResizeObserver(()=>{g||n(),g=!1}),fu(e)&&!s&&p.observe(e),p.observe(t)}let m=s?Ds(e):null;return s&&function g(){const v=Ds(e);!m||v.x===m.x&&v.y===m.y&&v.width===m.width&&v.height===m.height||n(),m=v,f=requestAnimationFrame(g)}(),n(),()=>{var g;c.forEach(v=>{l&&v.removeEventListener("scroll",n),u&&v.removeEventListener("resize",n)}),(g=p)==null||g.disconnect(),p=null,s&&cancelAnimationFrame(f)}}const Z$e=(e,t,n)=>$$e(e,t,{platform:q$e,...n});var l7=typeof document<"u"?S.useLayoutEffect:S.useEffect;function u7(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,i;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(!u7(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!u7(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Q$e(e){const t=S.useRef(e);return l7(()=>{t.current=e}),t}function J$e(e){let{middleware:t,placement:n="bottom",strategy:r="absolute",whileElementsMounted:i}=e===void 0?{}:e;const o=S.useRef(null),a=S.useRef(null),s=Q$e(i),l=S.useRef(null),[u,c]=S.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{}}),[f,p]=S.useState(t);u7(f==null?void 0:f.map(k=>{let{options:P}=k;return P}),t==null?void 0:t.map(k=>{let{options:P}=k;return P}))||p(t);const m=S.useCallback(()=>{!o.current||!a.current||Z$e(o.current,a.current,{middleware:f,placement:n,strategy:r}).then(k=>{g.current&&la.flushSync(()=>{c(k)})})},[f,n,r]);l7(()=>{g.current&&m()},[m]);const g=S.useRef(!1);l7(()=>(g.current=!0,()=>{g.current=!1}),[]);const v=S.useCallback(()=>{if(typeof l.current=="function"&&(l.current(),l.current=null),o.current&&a.current)if(s.current){const k=s.current(o.current,a.current,m);l.current=k}else m()},[m,s]),x=S.useCallback(k=>{o.current=k,v()},[v]),C=S.useCallback(k=>{a.current=k,v()},[v]),w=S.useMemo(()=>({reference:o,floating:a}),[]);return S.useMemo(()=>({...u,update:m,refs:w,reference:x,floating:C}),[u,m,w,x,C])}const eDe=e=>{const{element:t,padding:n}=e;function r(i){return Object.prototype.hasOwnProperty.call(i,"current")}return{name:"arrow",options:e,fn(i){return r(t)?t.current!=null?jR({element:t.current,padding:n}).fn(i):{}:t?jR({element:t,padding:n}).fn(i):{}}}};function tDe(e){const[t,n]=S.useState(void 0);return Ch(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,s;if("borderBoxSize"in o){const l=o.borderBoxSize,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,s=u.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const jK="Popper",[bk,HK]=N1(jK),[nDe,VK]=bk(jK),rDe=e=>{const{__scopePopper:t,children:n}=e,[r,i]=S.useState(null);return S.createElement(nDe,{scope:t,anchor:r,onAnchorChange:i},n)},iDe="PopperAnchor",oDe=S.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=VK(iDe,n),a=S.useRef(null),s=Lo(t,a);return S.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:S.createElement(Ws.div,Dt({},i,{ref:s}))}),pb="PopperContent",[aDe,yZe]=bk(pb),[sDe,lDe]=bk(pb,{hasParent:!1,positionUpdateFns:new Set}),uDe=S.forwardRef((e,t)=>{var n,r,i,o,a,s,l,u;const{__scopePopper:c,side:f="bottom",sideOffset:p=0,align:m="center",alignOffset:g=0,arrowPadding:v=0,collisionBoundary:x=[],collisionPadding:C=0,sticky:w="partial",hideWhenDetached:k=!1,avoidCollisions:P=!0,...L}=e,A=VK(pb,c),[O,I]=S.useState(null),$=Lo(t,J=>I(J)),[D,V]=S.useState(null),Y=tDe(D),z=(n=Y==null?void 0:Y.width)!==null&&n!==void 0?n:0,R=(r=Y==null?void 0:Y.height)!==null&&r!==void 0?r:0,N=f+(m!=="center"?"-"+m:""),U=typeof C=="number"?C:{top:0,right:0,bottom:0,left:0,...C},G=Array.isArray(x)?x:[x],B=G.length>0,W={padding:U,boundary:G.filter(dDe),altBoundary:B},{reference:X,floating:re,strategy:le,x:he,y:se,placement:Ae,middlewareData:be,update:De}=J$e({strategy:"fixed",placement:N,whileElementsMounted:X$e,middleware:[V$e({mainAxis:p+R,alignmentAxis:g}),P?U$e({mainAxis:!0,crossAxis:!1,limiter:w==="partial"?W$e():void 0,...W}):void 0,D?eDe({element:D,padding:v}):void 0,P?j$e({...W}):void 0,fDe({arrowWidth:z,arrowHeight:R}),k?H$e({strategy:"referenceHidden"}):void 0].filter(cDe)});Ch(()=>{X(A.anchor)},[X,A.anchor]);const fe=he!==null&&se!==null,[Xe,rt]=UK(Ae),Ze=(i=be.arrow)===null||i===void 0?void 0:i.x,et=(o=be.arrow)===null||o===void 0?void 0:o.y,nt=((a=be.arrow)===null||a===void 0?void 0:a.centerOffset)!==0,[ve,Qe]=S.useState();Ch(()=>{O&&Qe(window.getComputedStyle(O).zIndex)},[O]);const{hasParent:ct,positionUpdateFns:Je}=lDe(pb,c),st=!ct;S.useLayoutEffect(()=>{if(!st)return Je.add(De),()=>{Je.delete(De)}},[st,Je,De]),S.useLayoutEffect(()=>{st&&fe&&Array.from(Je).reverse().forEach(J=>requestAnimationFrame(J))},[st,fe,Je]);const wt={"data-side":Xe,"data-align":rt,...L,ref:$,style:{...L.style,animation:fe?void 0:"none",opacity:(s=be.hide)!==null&&s!==void 0&&s.referenceHidden?0:void 0}};return S.createElement("div",{ref:re,"data-radix-popper-content-wrapper":"",style:{position:le,left:0,top:0,transform:fe?`translate3d(${Math.round(he)}px, ${Math.round(se)}px, 0)`:"translate3d(0, -200%, 0)",minWidth:"max-content",zIndex:ve,["--radix-popper-transform-origin"]:[(l=be.transformOrigin)===null||l===void 0?void 0:l.x,(u=be.transformOrigin)===null||u===void 0?void 0:u.y].join(" ")}},S.createElement(aDe,{scope:c,placedSide:Xe,onArrowChange:V,arrowX:Ze,arrowY:et,shouldHideArrow:nt},st?S.createElement(sDe,{scope:c,hasParent:!0,positionUpdateFns:Je},S.createElement(Ws.div,wt)):S.createElement(Ws.div,wt)))});function cDe(e){return e!==void 0}function dDe(e){return e!==null}const fDe=e=>({name:"transformOrigin",options:e,fn(t){var n,r,i,o,a;const{placement:s,rects:l,middlewareData:u}=t,f=((n=u.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,p=f?0:e.arrowWidth,m=f?0:e.arrowHeight,[g,v]=UK(s),x={start:"0%",center:"50%",end:"100%"}[v],C=((r=(i=u.arrow)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)+p/2,w=((o=(a=u.arrow)===null||a===void 0?void 0:a.y)!==null&&o!==void 0?o:0)+m/2;let k="",P="";return g==="bottom"?(k=f?x:`${C}px`,P=`${-m}px`):g==="top"?(k=f?x:`${C}px`,P=`${l.floating.height+m}px`):g==="right"?(k=`${-m}px`,P=f?x:`${w}px`):g==="left"&&(k=`${l.floating.width+m}px`,P=f?x:`${w}px`),{data:{x:k,y:P}}}});function UK(e){const[t,n="center"]=e.split("-");return[t,n]}const hDe=rDe,pDe=oDe,mDe=uDe;function gDe(e,t){return S.useReducer((n,r)=>{const i=t[n][r];return i!=null?i:n},e)}const WK=e=>{const{present:t,children:n}=e,r=vDe(t),i=typeof n=="function"?n({present:r.isPresent}):S.Children.only(n),o=Lo(r.ref,i.ref);return typeof n=="function"||r.isPresent?S.cloneElement(i,{ref:o}):null};WK.displayName="Presence";function vDe(e){const[t,n]=S.useState(),r=S.useRef({}),i=S.useRef(e),o=S.useRef("none"),a=e?"mounted":"unmounted",[s,l]=gDe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const u=Zv(r.current);o.current=s==="mounted"?u:"none"},[s]),Ch(()=>{const u=r.current,c=i.current;if(c!==e){const p=o.current,m=Zv(u);e?l("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(c&&p!==m?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),Ch(()=>{if(t){const u=f=>{const m=Zv(r.current).includes(f.animationName);f.target===t&&m&&la.flushSync(()=>l("ANIMATION_END"))},c=f=>{f.target===t&&(o.current=Zv(r.current))};return t.addEventListener("animationstart",c),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",c),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:S.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function Zv(e){return(e==null?void 0:e.animationName)||"none"}function yDe({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=bDe({defaultProp:t,onChange:n}),o=e!==void 0,a=o?e:r,s=os(n),l=S.useCallback(u=>{if(o){const f=typeof u=="function"?u(e):u;f!==e&&s(f)}else i(u)},[o,e,i,s]);return[a,l]}function bDe({defaultProp:e,onChange:t}){const n=S.useState(e),[r]=n,i=S.useRef(r),o=os(t);return S.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}const e6="rovingFocusGroup.onEntryFocus",SDe={bubbles:!1,cancelable:!0},Sk="RovingFocusGroup",[c7,GK,wDe]=TK(Sk),[CDe,KK]=N1(Sk,[wDe]),[xDe,_De]=CDe(Sk),kDe=S.forwardRef((e,t)=>S.createElement(c7.Provider,{scope:e.__scopeRovingFocusGroup},S.createElement(c7.Slot,{scope:e.__scopeRovingFocusGroup},S.createElement(EDe,Dt({},e,{ref:t}))))),EDe=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:u,...c}=e,f=S.useRef(null),p=Lo(t,f),m=LK(o),[g=null,v]=yDe({prop:a,defaultProp:s,onChange:l}),[x,C]=S.useState(!1),w=os(u),k=GK(n),P=S.useRef(!1),[L,A]=S.useState(0);return S.useEffect(()=>{const O=f.current;if(O)return O.addEventListener(e6,w),()=>O.removeEventListener(e6,w)},[w]),S.createElement(xDe,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:g,onItemFocus:S.useCallback(O=>v(O),[v]),onItemShiftTab:S.useCallback(()=>C(!0),[]),onFocusableItemAdd:S.useCallback(()=>A(O=>O+1),[]),onFocusableItemRemove:S.useCallback(()=>A(O=>O-1),[])},S.createElement(Ws.div,Dt({tabIndex:x||L===0?-1:0,"data-orientation":r},c,{ref:p,style:{outline:"none",...e.style},onMouseDown:mn(e.onMouseDown,()=>{P.current=!0}),onFocus:mn(e.onFocus,O=>{const I=!P.current;if(O.target===O.currentTarget&&I&&!x){const $=new CustomEvent(e6,SDe);if(O.currentTarget.dispatchEvent($),!$.defaultPrevented){const D=k().filter(N=>N.focusable),V=D.find(N=>N.active),Y=D.find(N=>N.id===g),R=[V,Y,...D].filter(Boolean).map(N=>N.ref.current);YK(R)}}P.current=!1}),onBlur:mn(e.onBlur,()=>C(!1))})))}),PDe="RovingFocusGroupItem",TDe=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,...o}=e,a=R$e(),s=_De(PDe,n),l=s.currentTabStopId===a,u=GK(n),{onFocusableItemAdd:c,onFocusableItemRemove:f}=s;return S.useEffect(()=>{if(r)return c(),()=>f()},[r,c,f]),S.createElement(c7.ItemSlot,{scope:n,id:a,focusable:r,active:i},S.createElement(Ws.span,Dt({tabIndex:l?0:-1,"data-orientation":s.orientation},o,{ref:t,onMouseDown:mn(e.onMouseDown,p=>{r?s.onItemFocus(a):p.preventDefault()}),onFocus:mn(e.onFocus,()=>s.onItemFocus(a)),onKeyDown:mn(e.onKeyDown,p=>{if(p.key==="Tab"&&p.shiftKey){s.onItemShiftTab();return}if(p.target!==p.currentTarget)return;const m=ODe(p,s.orientation,s.dir);if(m!==void 0){p.preventDefault();let v=u().filter(x=>x.focusable).map(x=>x.ref.current);if(m==="last")v.reverse();else if(m==="prev"||m==="next"){m==="prev"&&v.reverse();const x=v.indexOf(p.currentTarget);v=s.loop?MDe(v,x+1):v.slice(x+1)}setTimeout(()=>YK(v))}})})))}),LDe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ADe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function ODe(e,t,n){const r=ADe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return LDe[r]}function YK(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function MDe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const IDe=kDe,RDe=TDe,$De=["Enter"," "],DDe=["ArrowDown","PageUp","Home"],qK=["ArrowUp","PageDown","End"],NDe=[...DDe,...qK],b4="Menu",[d7,BDe,FDe]=TK(b4),[ld,XK]=N1(b4,[FDe,HK,KK]),wk=HK(),ZK=KK(),[zDe,S4]=ld(b4),[jDe,Ck]=ld(b4),HDe=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:a=!0}=e,s=wk(t),[l,u]=S.useState(null),c=S.useRef(!1),f=os(o),p=LK(i);return S.useEffect(()=>{const m=()=>{c.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>c.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),S.createElement(hDe,s,S.createElement(zDe,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:u},S.createElement(jDe,{scope:t,onClose:S.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:c,dir:p,modal:a},r)))},VDe=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=wk(n);return S.createElement(pDe,Dt({},i,r,{ref:t}))}),UDe="MenuPortal",[bZe,WDe]=ld(UDe,{forceMount:void 0}),tu="MenuContent",[GDe,QK]=ld(tu),KDe=S.forwardRef((e,t)=>{const n=WDe(tu,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=S4(tu,e.__scopeMenu),a=Ck(tu,e.__scopeMenu);return S.createElement(d7.Provider,{scope:e.__scopeMenu},S.createElement(WK,{present:r||o.open},S.createElement(d7.Slot,{scope:e.__scopeMenu},a.modal?S.createElement(YDe,Dt({},i,{ref:t})):S.createElement(qDe,Dt({},i,{ref:t})))))}),YDe=S.forwardRef((e,t)=>{const n=S4(tu,e.__scopeMenu),r=S.useRef(null),i=Lo(t,r);return S.useEffect(()=>{const o=r.current;if(o)return aH(o)},[]),S.createElement(JK,Dt({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:mn(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),qDe=S.forwardRef((e,t)=>{const n=S4(tu,e.__scopeMenu);return S.createElement(JK,Dt({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),JK=S.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:c,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...g}=e,v=S4(tu,n),x=Ck(tu,n),C=wk(n),w=ZK(n),k=BDe(n),[P,L]=S.useState(null),A=S.useRef(null),O=Lo(t,A,v.onContentChange),I=S.useRef(0),$=S.useRef(""),D=S.useRef(0),V=S.useRef(null),Y=S.useRef("right"),z=S.useRef(0),R=m?GH:S.Fragment,N=m?{as:qg,allowPinchZoom:!0}:void 0,U=B=>{var W,X;const re=$.current+B,le=k().filter(fe=>!fe.disabled),he=document.activeElement,se=(W=le.find(fe=>fe.ref.current===he))===null||W===void 0?void 0:W.textValue,Ae=le.map(fe=>fe.textValue),be=iNe(Ae,re,se),De=(X=le.find(fe=>fe.textValue===be))===null||X===void 0?void 0:X.ref.current;(function fe(Xe){$.current=Xe,window.clearTimeout(I.current),Xe!==""&&(I.current=window.setTimeout(()=>fe(""),1e3))})(re),De&&setTimeout(()=>De.focus())};S.useEffect(()=>()=>window.clearTimeout(I.current),[]),_$e();const G=S.useCallback(B=>{var W,X;return Y.current===((W=V.current)===null||W===void 0?void 0:W.side)&&aNe(B,(X=V.current)===null||X===void 0?void 0:X.area)},[]);return S.createElement(GDe,{scope:n,searchRef:$,onItemEnter:S.useCallback(B=>{G(B)&&B.preventDefault()},[G]),onItemLeave:S.useCallback(B=>{var W;G(B)||((W=A.current)===null||W===void 0||W.focus(),L(null))},[G]),onTriggerLeave:S.useCallback(B=>{G(B)&&B.preventDefault()},[G]),pointerGraceTimerRef:D,onPointerGraceIntentChange:S.useCallback(B=>{V.current=B},[])},S.createElement(R,N,S.createElement(k$e,{asChild:!0,trapped:i,onMountAutoFocus:mn(o,B=>{var W;B.preventDefault(),(W=A.current)===null||W===void 0||W.focus()}),onUnmountAutoFocus:a},S.createElement(w$e,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:c,onInteractOutside:f,onDismiss:p},S.createElement(IDe,Dt({asChild:!0},w,{dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:P,onCurrentTabStopIdChange:L,onEntryFocus:B=>{x.isUsingKeyboardRef.current||B.preventDefault()}}),S.createElement(mDe,Dt({role:"menu","aria-orientation":"vertical","data-state":tNe(v.open),"data-radix-menu-content":"",dir:x.dir},C,g,{ref:O,style:{outline:"none",...g.style},onKeyDown:mn(g.onKeyDown,B=>{const X=B.target.closest("[data-radix-menu-content]")===B.currentTarget,re=B.ctrlKey||B.altKey||B.metaKey,le=B.key.length===1;X&&(B.key==="Tab"&&B.preventDefault(),!re&&le&&U(B.key));const he=A.current;if(B.target!==he||!NDe.includes(B.key))return;B.preventDefault();const Ae=k().filter(be=>!be.disabled).map(be=>be.ref.current);qK.includes(B.key)&&Ae.reverse(),nNe(Ae)}),onBlur:mn(e.onBlur,B=>{B.currentTarget.contains(B.target)||(window.clearTimeout(I.current),$.current="")}),onPointerMove:mn(e.onPointerMove,h7(B=>{const W=B.target,X=z.current!==B.clientX;if(B.currentTarget.contains(W)&&X){const re=B.clientX>z.current?"right":"left";Y.current=re,z.current=B.clientX}}))})))))))}),f7="MenuItem",XR="menu.itemSelect",XDe=S.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=S.useRef(null),a=Ck(f7,e.__scopeMenu),s=QK(f7,e.__scopeMenu),l=Lo(t,o),u=S.useRef(!1),c=()=>{const f=o.current;if(!n&&f){const p=new CustomEvent(XR,{bubbles:!0,cancelable:!0});f.addEventListener(XR,m=>r==null?void 0:r(m),{once:!0}),PK(f,p),p.defaultPrevented?u.current=!1:a.onClose()}};return S.createElement(ZDe,Dt({},i,{ref:l,disabled:n,onClick:mn(e.onClick,c),onPointerDown:f=>{var p;(p=e.onPointerDown)===null||p===void 0||p.call(e,f),u.current=!0},onPointerUp:mn(e.onPointerUp,f=>{var p;u.current||(p=f.currentTarget)===null||p===void 0||p.click()}),onKeyDown:mn(e.onKeyDown,f=>{const p=s.searchRef.current!=="";n||p&&f.key===" "||$De.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})}))}),ZDe=S.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,a=QK(f7,n),s=ZK(n),l=S.useRef(null),u=Lo(t,l),[c,f]=S.useState(!1),[p,m]=S.useState("");return S.useEffect(()=>{const g=l.current;if(g){var v;m(((v=g.textContent)!==null&&v!==void 0?v:"").trim())}},[o.children]),S.createElement(d7.ItemSlot,{scope:n,disabled:r,textValue:i!=null?i:p},S.createElement(RDe,Dt({asChild:!0},s,{focusable:!r}),S.createElement(Ws.div,Dt({role:"menuitem","data-highlighted":c?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},o,{ref:u,onPointerMove:mn(e.onPointerMove,h7(g=>{r?a.onItemLeave(g):(a.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus())})),onPointerLeave:mn(e.onPointerLeave,h7(g=>a.onItemLeave(g))),onFocus:mn(e.onFocus,()=>f(!0)),onBlur:mn(e.onBlur,()=>f(!1))}))))}),QDe="MenuRadioGroup";ld(QDe,{value:void 0,onValueChange:()=>{}});const JDe="MenuItemIndicator";ld(JDe,{checked:!1});const eNe="MenuSub";ld(eNe);function tNe(e){return e?"open":"closed"}function nNe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function rNe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function iNe(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=rNe(e,Math.max(o,0));i.length===1&&(a=a.filter(u=>u!==n));const l=a.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function oNe(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,a=t.length-1;or!=c>r&&n<(u-s)*(r-l)/(c-l)+s&&(i=!i)}return i}function aNe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return oNe(n,t)}function h7(e){return t=>t.pointerType==="mouse"?e(t):void 0}const sNe=HDe,lNe=VDe,uNe=KDe,cNe=XDe,eY="ContextMenu",[dNe,SZe]=N1(eY,[XK]),w4=XK(),[fNe,tY]=dNe(eY),hNe=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:i,modal:o=!0}=e,[a,s]=S.useState(!1),l=w4(t),u=os(r),c=S.useCallback(f=>{s(f),u(f)},[u]);return S.createElement(fNe,{scope:t,open:a,onOpenChange:c,modal:o},S.createElement(sNe,Dt({},l,{dir:i,open:a,onOpenChange:c,modal:o}),n))},pNe="ContextMenuTrigger",mNe=S.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=tY(pNe,n),o=w4(n),a=S.useRef({x:0,y:0}),s=S.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...a.current})}),l=S.useRef(0),u=S.useCallback(()=>window.clearTimeout(l.current),[]),c=f=>{a.current={x:f.clientX,y:f.clientY},i.onOpenChange(!0)};return S.useEffect(()=>u,[u]),S.createElement(S.Fragment,null,S.createElement(lNe,Dt({},o,{virtualRef:s})),S.createElement(Ws.span,Dt({"data-state":i.open?"open":"closed"},r,{ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:mn(e.onContextMenu,f=>{u(),c(f),f.preventDefault()}),onPointerDown:mn(e.onPointerDown,Qv(f=>{u(),l.current=window.setTimeout(()=>c(f),700)})),onPointerMove:mn(e.onPointerMove,Qv(u)),onPointerCancel:mn(e.onPointerCancel,Qv(u)),onPointerUp:mn(e.onPointerUp,Qv(u))})))}),gNe="ContextMenuContent",vNe=S.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=tY(gNe,n),o=w4(n),a=S.useRef(!1);return S.createElement(uNe,Dt({},o,r,{ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:s=>{var l;(l=e.onCloseAutoFocus)===null||l===void 0||l.call(e,s),!s.defaultPrevented&&a.current&&s.preventDefault(),a.current=!1},onInteractOutside:s=>{var l;(l=e.onInteractOutside)===null||l===void 0||l.call(e,s),!s.defaultPrevented&&!i.modal&&(a.current=!0)},style:{...e.style,["--radix-context-menu-content-transform-origin"]:"var(--radix-popper-transform-origin)"}}))}),yNe=S.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,i=w4(n);return S.createElement(cNe,Dt({},i,r,{ref:t}))});function Qv(e){return t=>t.pointerType!=="mouse"?e(t):void 0}const bNe=hNe,SNe=mNe,wNe=vNe,Cl=yNe,CNe=(e,t)=>e.image.uuid===t.image.uuid&&e.isSelected===t.isSelected,nY=S.memo(e=>{var Y,z,R,N,U,G,B,W;const t=ge(),{activeTabName:n,galleryImageObjectFit:r,galleryImageMinimumWidth:i,mayDeleteImage:o,shouldUseSingleGalleryColumn:a}=ne(MRe),{image:s,isSelected:l}=e,{url:u,thumbnail:c,uuid:f,metadata:p}=s,[m,g]=S.useState(!1),v=_1(),{t:x}=Ce(),C=()=>g(!0),w=()=>g(!1),k=()=>{var X,re;if(s.metadata){const[le,he]=B_((re=(X=s.metadata)==null?void 0:X.image)==null?void 0:re.prompt);le&&t(Q3(le)),t(Hg(he||""))}v({title:x("toast:promptSet"),status:"success",duration:2500,isClosable:!0})},P=()=>{s.metadata&&t(A1(s.metadata.image.seed)),v({title:x("toast:seedSet"),status:"success",duration:2500,isClosable:!0})},L=()=>{t(Kh(s)),n!=="img2img"&&t(_i("img2img")),v({title:x("toast:sentToImageToImage"),status:"success",duration:2500,isClosable:!0})},A=()=>{t(Z3(s)),t(X3()),n!=="unifiedCanvas"&&t(_i("unifiedCanvas")),v({title:x("toast:sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0})},O=()=>{p&&t(YU(p)),v({title:x("toast:parametersSet"),status:"success",duration:2500,isClosable:!0})},I=async()=>{var X;if((X=p==null?void 0:p.image)!=null&&X.init_image_path&&(await fetch(p.image.init_image_path)).ok){t(_i("img2img")),t(j9e(p)),v({title:x("toast:initialImageSet"),status:"success",duration:2500,isClosable:!0});return}v({title:x("toast:initialImageNotSet"),description:x("toast:initialImageNotSetDesc"),status:"error",duration:2500,isClosable:!0})},$=()=>t(MM(s)),D=X=>{X.dataTransfer.setData("invokeai/imageUuid",f),X.dataTransfer.effectAllowed="move"},V=()=>{t(MM(s))};return j(bNe,{onOpenChange:X=>{t(VU(X))},children:[b(SNe,{children:j(ci,{position:"relative",className:"hoverable-image",onMouseOver:C,onMouseOut:w,userSelect:"none",draggable:!0,onDragStart:D,children:[b(r3,{className:"hoverable-image-image",objectFit:a?"contain":r,rounded:"md",src:c||u,loading:"lazy"}),b("div",{className:"hoverable-image-content",onClick:$,children:l&&b(Qi,{width:"50%",height:"50%",as:ck,className:"hoverable-image-check"})}),m&&i>=64&&b("div",{className:"hoverable-image-delete-button",children:b(lb,{image:s,children:b(_o,{"aria-label":x("parameters:deleteImage"),icon:b(TRe,{}),size:"xs",variant:"imageHoverIconButton",fontSize:14,isDisabled:!o})})})]},f)}),j(wNe,{className:"hoverable-image-context-menu",sticky:"always",onInteractOutside:X=>{X.detail.originalEvent.preventDefault()},children:[b(Cl,{onClickCapture:V,children:x("parameters:openInViewer")}),b(Cl,{onClickCapture:k,disabled:((z=(Y=s==null?void 0:s.metadata)==null?void 0:Y.image)==null?void 0:z.prompt)===void 0,children:x("parameters:usePrompt")}),b(Cl,{onClickCapture:P,disabled:((N=(R=s==null?void 0:s.metadata)==null?void 0:R.image)==null?void 0:N.seed)===void 0,children:x("parameters:useSeed")}),b(Cl,{onClickCapture:O,disabled:!["txt2img","img2img"].includes((G=(U=s==null?void 0:s.metadata)==null?void 0:U.image)==null?void 0:G.type),children:x("parameters:useAll")}),b(Cl,{onClickCapture:I,disabled:((W=(B=s==null?void 0:s.metadata)==null?void 0:B.image)==null?void 0:W.type)!=="img2img",children:x("parameters:useInitImg")}),b(Cl,{onClickCapture:L,children:x("parameters:sendToImg2Img")}),b(Cl,{onClickCapture:A,children:x("parameters:sendToUnifiedCanvas")}),b(Cl,{"data-warning":!0,children:b(lb,{image:s,children:b("p",{children:x("parameters:deleteImage")})})})]})]})},CNe);nY.displayName="HoverableImage";const Jv=320,ZR=40,xNe={txt2img:{galleryMinWidth:200,galleryMaxWidth:500},img2img:{galleryMinWidth:200,galleryMaxWidth:500},unifiedCanvas:{galleryMinWidth:200,galleryMaxWidth:200},nodes:{galleryMinWidth:200,galleryMaxWidth:500},postprocess:{galleryMinWidth:200,galleryMaxWidth:500},training:{galleryMinWidth:200,galleryMaxWidth:500}},QR=400;function rY(){const e=ge(),{t}=Ce(),{images:n,currentCategory:r,currentImageUuid:i,shouldPinGallery:o,shouldShowGallery:a,galleryScrollPosition:s,galleryImageMinimumWidth:l,galleryGridTemplateColumns:u,activeTabName:c,galleryImageObjectFit:f,shouldHoldGalleryOpen:p,shouldAutoSwitchToNewImages:m,areMoreImagesAvailable:g,galleryWidth:v,isLightboxOpen:x,isStaging:C,shouldEnableResize:w,shouldUseSingleGalleryColumn:k}=ne(ORe),{galleryMinWidth:P,galleryMaxWidth:L}=x?{galleryMinWidth:QR,galleryMaxWidth:QR}:xNe[c],[A,O]=S.useState(v>=Jv),[I,$]=S.useState(!1),[D,V]=S.useState(0),Y=S.useRef(null),z=S.useRef(null),R=S.useRef(null);S.useEffect(()=>{v>=Jv&&O(!1)},[v]);const N=()=>{e(T9e(!o)),e(hr(!0))},U=()=>{a?B():G()},G=()=>{e(Zl(!0)),o&&e(hr(!0))},B=S.useCallback(()=>{e(Zl(!1)),e(VU(!1)),e(L9e(z.current?z.current.scrollTop:0)),setTimeout(()=>o&&e(hr(!0)),400)},[e,o]),W=()=>{e(t7(r))},X=se=>{e(Gp(se))},re=()=>{p||(R.current=window.setTimeout(()=>B(),500))},le=()=>{R.current&&window.clearTimeout(R.current)};Re("g",()=>{U()},[a,o]),Re("left",()=>{e(N_())},{enabled:!C||c!=="unifiedCanvas"},[C]),Re("right",()=>{e(D_())},{enabled:!C||c!=="unifiedCanvas"},[C]),Re("shift+g",()=>{N()},[o]),Re("esc",()=>{e(Zl(!1))},{enabled:()=>!o,preventDefault:!0},[o]);const he=32;return Re("shift+up",()=>{if(l<256){const se=ti(l+he,32,256);e(Gp(se))}},[l]),Re("shift+down",()=>{if(l>32){const se=ti(l-he,32,256);e(Gp(se))}},[l]),S.useEffect(()=>{z.current&&(z.current.scrollTop=s)},[s,a]),S.useEffect(()=>{function se(Ae){!o&&Y.current&&!Y.current.contains(Ae.target)&&B()}return document.addEventListener("mousedown",se),()=>{document.removeEventListener("mousedown",se)}},[B,o]),b(kK,{nodeRef:Y,in:a||p,unmountOnExit:!0,timeout:200,classNames:"image-gallery-wrapper",children:j("div",{className:"image-gallery-wrapper",style:{zIndex:o?1:100},"data-pinned":o,ref:Y,onMouseLeave:o?void 0:re,onMouseEnter:o?void 0:le,onMouseOver:o?void 0:le,children:[j(yK,{minWidth:P,maxWidth:o?L:window.innerWidth,className:"image-gallery-popup",handleStyles:{left:{width:"15px"}},enable:{left:w},size:{width:v,height:o?"100%":"100vh"},onResizeStart:(se,Ae,be)=>{V(be.clientHeight),be.style.height=`${be.clientHeight}px`,o&&(be.style.position="fixed",be.style.right="1rem",$(!0))},onResizeStop:(se,Ae,be,De)=>{const fe=o?ti(Number(v)+De.width,P,Number(L)):Number(v)+De.width;e(M9e(fe)),be.removeAttribute("data-resize-alert"),o&&(be.style.position="relative",be.style.removeProperty("right"),be.style.setProperty("height",o?"100%":"100vh"),$(!1),e(hr(!0)))},onResize:(se,Ae,be,De)=>{const fe=ti(Number(v)+De.width,P,Number(o?L:.95*window.innerWidth));fe>=Jv&&!A?O(!0):fefe-ZR&&e(Gp(fe-ZR)),o&&(fe>=L?be.setAttribute("data-resize-alert","true"):be.removeAttribute("data-resize-alert")),be.style.height=`${D}px`},children:[j("div",{className:"image-gallery-header",children:[b(Jr,{size:"sm",isAttached:!0,variant:"solid",className:"image-gallery-category-btn-group",children:A?j(gn,{children:[b(kn,{size:"sm","data-selected":r==="result",onClick:()=>e(Tv("result")),children:t("gallery:generations")}),b(kn,{size:"sm","data-selected":r==="user",onClick:()=>e(Tv("user")),children:t("gallery:uploads")})]}):j(gn,{children:[b(Ie,{"aria-label":t("gallery:showGenerations"),tooltip:t("gallery:showGenerations"),"data-selected":r==="result",icon:b(gRe,{}),onClick:()=>e(Tv("result"))}),b(Ie,{"aria-label":t("gallery:showUploads"),tooltip:t("gallery:showUploads"),"data-selected":r==="user",icon:b(ARe,{}),onClick:()=>e(Tv("user"))})]})}),j("div",{className:"image-gallery-header-right-icons",children:[b(sa,{isLazy:!0,trigger:"hover",placement:"left",triggerComponent:b(Ie,{size:"sm","aria-label":t("gallery:gallerySettings"),icon:b(pk,{}),className:"image-gallery-icon-btn",cursor:"pointer"}),children:j("div",{className:"image-gallery-settings-popover",children:[j("div",{children:[b(Ri,{value:l,onChange:X,min:32,max:256,hideTooltip:!0,label:t("gallery:galleryImageSize")}),b(Ie,{size:"sm","aria-label":t("gallery:galleryImageResetSize"),tooltip:t("gallery:galleryImageResetSize"),onClick:()=>e(Gp(64)),icon:b(m4,{}),"data-selected":o,styleClass:"image-gallery-icon-btn"})]}),b("div",{children:b(fn,{label:t("gallery:maintainAspectRatio"),isChecked:f==="contain",onChange:()=>e(A9e(f==="contain"?"cover":"contain"))})}),b("div",{children:b(fn,{label:t("gallery:autoSwitchNewImages"),isChecked:m,onChange:se=>e(O9e(se.target.checked))})}),b("div",{children:b(fn,{label:t("gallery:singleColumnLayout"),isChecked:k,onChange:se=>e(I9e(se.target.checked))})})]})}),b(Ie,{size:"sm",className:"image-gallery-icon-btn","aria-label":t("gallery:pinGallery"),tooltip:`${t("gallery:pinGallery")} (Shift+G)`,onClick:N,icon:o?b(SK,{}):b(wK,{})})]})]}),b("div",{className:"image-gallery-container",ref:z,children:n.length||g?j(gn,{children:[b("div",{className:"image-gallery",style:{gridTemplateColumns:u},children:n.map(se=>{const{uuid:Ae}=se;return b(nY,{image:se,isSelected:i===Ae},Ae)})}),b(xo,{onClick:W,isDisabled:!g,className:"image-gallery-load-more-btn",children:t(g?"gallery:loadMore":"gallery:allImagesLoaded")})]}):j("div",{className:"image-gallery-container-placeholder",children:[b(CK,{}),b("p",{children:t("gallery:noImagesInGallery")})]})})]}),I&&b("div",{style:{width:`${v}px`,height:"100%"}})]})})}/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var p7=function(e,t){return p7=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},p7(e,t)};function _Ne(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");p7(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Ja=function(){return Ja=Object.assign||function(t){for(var n,r=1,i=arguments.length;r=n?(r(o),e.animation=null):e.animation&&(r(u),requestAnimationFrame(e.animation))},requestAnimationFrame(e.animation)}}function Pu(e,t,n,r){var i=zNe(t);if(!(!e.mounted||!i)){var o=e.setTransformState,a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY,c=t.scale-s,f=t.positionX-l,p=t.positionY-u;n===0?o(t.scale,t.positionX,t.positionY):aY(e,r,n,function(m){var g=s+c*m,v=l+f*m,x=u+p*m;o(g,v,x)})}}function zNe(e){var t=e.scale,n=e.positionX,r=e.positionY;return!(isNaN(t)||isNaN(n)||isNaN(r))}function jNe(e,t,n){var r=e.offsetWidth,i=e.offsetHeight,o=t.offsetWidth,a=t.offsetHeight,s=o*n,l=a*n,u=r-s,c=i-l;return{wrapperWidth:r,wrapperHeight:i,newContentWidth:s,newDiffWidth:u,newContentHeight:l,newDiffHeight:c}}var HNe=function(e,t,n,r,i,o,a){var s=e>t?n*(a?1:.5):0,l=r>i?o*(a?1:.5):0,u=e-t-s,c=s,f=r-i-l,p=l;return{minPositionX:u,maxPositionX:c,minPositionY:f,maxPositionY:p}},xk=function(e,t){var n=e.wrapperComponent,r=e.contentComponent,i=e.setup.centerZoomedOut;if(!n||!r)throw new Error("Components are not mounted");var o=jNe(n,r,t),a=o.wrapperWidth,s=o.wrapperHeight,l=o.newContentWidth,u=o.newDiffWidth,c=o.newContentHeight,f=o.newDiffHeight,p=HNe(a,l,u,s,c,f,Boolean(i));return p},xh=function(e,t){var n=xk(e,t);return e.bounds=n,n};function C4(e,t,n,r,i,o,a){var s=n.minPositionX,l=n.minPositionY,u=n.maxPositionX,c=n.maxPositionY,f=0,p=0;a&&(f=i,p=o);var m=m7(e,s-f,u+f,r),g=m7(t,l-p,c+p,r);return{x:m,y:g}}var m7=function(e,t,n,r){return r?en?So(n,2):So(e,2):So(e,2)};function x4(e,t,n,r,i,o){var a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY,c=r-s;if(typeof t!="number"||typeof n!="number")return console.error("Mouse X and Y position were not provided!"),{x:l,y:u};var f=l-t*c,p=u-n*c,m=C4(f,p,i,o,0,0,null);return m}function F1(e,t,n,r,i){var o=i?r:0,a=t-o;return!isNaN(n)&&e>=n?n:!isNaN(t)&&e<=a?a:e}var e$=function(e,t){var n=e.setup.panning.excluded,r=e.isInitialized,i=e.wrapperComponent,o=t.target,a=i==null?void 0:i.contains(o),s=r&&o&&a;if(!s)return!1;var l=_4(o,n);return!l},t$=function(e){var t=e.isInitialized,n=e.isPanning,r=e.setup,i=r.panning.disabled,o=t&&n&&!i;return!!o},VNe=function(e,t){var n=e.transformState,r=n.positionX,i=n.positionY;e.isPanning=!0;var o=t.clientX,a=t.clientY;e.startCoords={x:o-r,y:a-i}},UNe=function(e,t){var n=t.touches,r=e.transformState,i=r.positionX,o=r.positionY;e.isPanning=!0;var a=n.length===1;if(a){var s=n[0].clientX,l=n[0].clientY;e.startCoords={x:s-i,y:l-o}}};function WNe(e){var t=e.transformState,n=t.positionX,r=t.positionY,i=t.scale,o=e.setup,a=o.disabled,s=o.limitToBounds,l=o.centerZoomedOut,u=e.wrapperComponent;if(!(a||!u||!e.bounds)){var c=e.bounds,f=c.maxPositionX,p=c.minPositionX,m=c.maxPositionY,g=c.minPositionY,v=n>f||nm||rf?u.offsetWidth:e.setup.minPositionX||0,w=r>m?u.offsetHeight:e.setup.minPositionY||0,k=x4(e,C,w,i,e.bounds,s||l),P=k.x,L=k.y;return{scale:i,positionX:v?P:n,positionY:x?L:r}}}function GNe(e,t,n,r,i){var o=e.setup.limitToBounds,a=e.wrapperComponent,s=e.bounds,l=e.transformState,u=l.scale,c=l.positionX,f=l.positionY,p=t!==c,m=n!==f,g=!p||!m;if(!(!a||g||!s)){var v=C4(t,n,s,o,r,i,a),x=v.x,C=v.y;e.setTransformState(u,x,C)}}var KNe=function(e,t,n){var r=e.startCoords,i=e.transformState,o=e.setup.panning,a=o.lockAxisX,s=o.lockAxisY,l=i.positionX,u=i.positionY;if(!r)return{x:l,y:u};var c=t-r.x,f=n-r.y,p=a?l:c,m=s?u:f;return{x:p,y:m}},mb=function(e,t){var n=e.setup,r=e.transformState,i=r.scale,o=n.minScale;return t>0&&i>=o?t:0},YNe=function(e){var t=e.mounted,n=e.setup,r=n.disabled,i=n.velocityAnimation,o=e.transformState.scale,a=i.disabled,s=!a||o>1||!r||t;return!!s},qNe=function(e){var t=e.mounted,n=e.velocity,r=e.bounds,i=e.setup,o=i.disabled,a=i.velocityAnimation,s=e.transformState.scale,l=a.disabled,u=!l||s>1||!o||t;return!(!u||!n||!r)};function XNe(e,t){var n=e.setup.velocityAnimation,r=n.equalToMove,i=n.animationTime,o=n.sensitivity;return r?i*t*o:i}function n$(e,t,n,r,i,o,a,s,l,u){if(i){if(t>a&&n>a){var c=a+(e-a)*u;return c>l?l:co?o:c}}return r?t:m7(e,o,a,i)}function ZNe(e,t){var n=1;return t?Math.min(n,e.offsetWidth/window.innerWidth):n}function QNe(e,t){var n=YNe(e);if(n){var r=e.lastMousePosition,i=e.velocityTime,o=e.setup,a=e.wrapperComponent,s=o.velocityAnimation.equalToMove,l=Date.now();if(r&&i&&a){var u=ZNe(a,s),c=t.x-r.x,f=t.y-r.y,p=c/u,m=f/u,g=l-i,v=c*c+f*f,x=Math.sqrt(v)/g;e.velocity={velocityX:p,velocityY:m,total:x}}e.lastMousePosition=t,e.velocityTime=l}}function JNe(e){var t=e.velocity,n=e.bounds,r=e.setup,i=e.wrapperComponent,o=qNe(e);if(!(!o||!t||!n||!i)){var a=t.velocityX,s=t.velocityY,l=t.total,u=n.maxPositionX,c=n.minPositionX,f=n.maxPositionY,p=n.minPositionY,m=r.limitToBounds,g=r.alignmentAnimation,v=r.zoomAnimation,x=r.panning,C=x.lockAxisY,w=x.lockAxisX,k=v.animationType,P=g.sizeX,L=g.sizeY,A=g.velocityAlignmentTime,O=A,I=XNe(e,l),$=Math.max(I,O),D=mb(e,P),V=mb(e,L),Y=D*i.offsetWidth/100,z=V*i.offsetHeight/100,R=u+Y,N=c-Y,U=f+z,G=p-z,B=e.transformState,W=new Date().getTime();aY(e,k,$,function(X){var re=e.transformState,le=re.scale,he=re.positionX,se=re.positionY,Ae=new Date().getTime()-W,be=Ae/O,De=iY[g.animationType],fe=1-De(Math.min(1,be)),Xe=1-X,rt=he+a*Xe,Ze=se+s*Xe,et=n$(rt,B.positionX,he,w,m,c,u,N,R,fe),nt=n$(Ze,B.positionY,se,C,m,p,f,G,U,fe);(he!==rt||se!==Ze)&&e.setTransformState(le,et,nt)})}}function r$(e,t){var n=e.transformState.scale;Fa(e),xh(e,n),t.touches?UNe(e,t):VNe(e,t)}function i$(e,t,n){var r=e.startCoords,i=e.setup,o=i.alignmentAnimation,a=o.sizeX,s=o.sizeY;if(r){var l=KNe(e,t,n),u=l.x,c=l.y,f=mb(e,a),p=mb(e,s);QNe(e,{x:u,y:c}),GNe(e,u,c,f,p)}}function eBe(e){if(e.isPanning){var t=e.setup.panning.velocityDisabled,n=e.velocity,r=e.wrapperComponent,i=e.contentComponent;e.isPanning=!1,e.animate=!1,e.animation=null;var o=r==null?void 0:r.getBoundingClientRect(),a=i==null?void 0:i.getBoundingClientRect(),s=(o==null?void 0:o.width)||0,l=(o==null?void 0:o.height)||0,u=(a==null?void 0:a.width)||0,c=(a==null?void 0:a.height)||0,f=s.1&&f;p?JNe(e):sY(e)}}function sY(e){var t=e.transformState.scale,n=e.setup,r=n.minScale,i=n.alignmentAnimation,o=i.disabled,a=i.sizeX,s=i.sizeY,l=i.animationTime,u=i.animationType,c=o||t=a;if((r>=1||s)&&sY(e),!(p||!i||!e.mounted)){var m=t||i.offsetWidth/2,g=n||i.offsetHeight/2,v=_k(e,a,m,g);v&&Pu(e,v,c,f)}}function _k(e,t,n,r){var i=e.setup,o=i.minScale,a=i.maxScale,s=i.limitToBounds,l=F1(So(t,2),o,a,0,!1),u=xh(e,l),c=x4(e,n,r,l,u,s),f=c.x,p=c.y;return{scale:l,positionX:f,positionY:p}}var kf={previousScale:1,scale:1,positionX:0,positionY:0},tBe=Ja(Ja({},kf),{setComponents:function(){},contextInstance:null}),tm={disabled:!1,minPositionX:null,maxPositionX:null,minPositionY:null,maxPositionY:null,minScale:1,maxScale:8,limitToBounds:!0,centerZoomedOut:!1,centerOnInit:!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}},uY=function(e){var t,n,r,i;return{previousScale:(t=e.initialScale)!==null&&t!==void 0?t:kf.scale,scale:(n=e.initialScale)!==null&&n!==void 0?n:kf.scale,positionX:(r=e.initialPositionX)!==null&&r!==void 0?r:kf.positionX,positionY:(i=e.initialPositionY)!==null&&i!==void 0?i:kf.positionY}},o$=function(e){var t=Ja({},tm);return Object.keys(e).forEach(function(n){var r=typeof e[n]<"u",i=typeof tm[n]<"u";if(i&&r){var o=Object.prototype.toString.call(tm[n]),a=o==="[object Object]",s=o==="[object Array]";a?t[n]=Ja(Ja({},tm[n]),e[n]):s?t[n]=JR(JR([],tm[n]),e[n]):t[n]=e[n]}}),t},cY=function(e,t,n){var r=e.transformState.scale,i=e.wrapperComponent,o=e.setup,a=o.maxScale,s=o.minScale,l=o.zoomAnimation,u=l.size;if(!i)throw new Error("Wrapper is not mounted");var c=r*Math.exp(t*n),f=F1(So(c,3),s,a,u,!1);return f};function dY(e,t,n,r,i){var o=e.wrapperComponent,a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY;if(!o)return console.error("No WrapperComponent found");var c=o.offsetWidth,f=o.offsetHeight,p=(c/2-l)/s,m=(f/2-u)/s,g=cY(e,t,n),v=_k(e,g,p,m);if(!v)return console.error("Error during zoom event. New transformation state was not calculated.");Pu(e,v,r,i)}function fY(e,t,n){var r=e.setup,i=e.wrapperComponent,o=r.limitToBounds,a=uY(e.props),s=e.transformState,l=s.scale,u=s.positionX,c=s.positionY;if(i){var f=xk(e,a.scale),p=C4(a.positionX,a.positionY,f,o,0,0,i),m={scale:a.scale,positionX:p.x,positionY:p.y};l===a.scale&&u===a.positionX&&c===a.positionY||Pu(e,m,t,n)}}function nBe(e,t,n){var r=e.wrapperComponent,i=e.setup,o=i.limitToBounds,a=i.minScale,s=i.maxScale;if(!r)return kf;var l=r.getBoundingClientRect(),u=rBe(t),c=u.x,f=u.y,p=t.offsetWidth,m=t.offsetHeight,g=r.offsetWidth/p,v=r.offsetHeight/m,x=F1(n||Math.min(g,v),a,s,0,!1),C=(l.width-p*x)/2,w=(l.height-m*x)/2,k=(l.left-c)*x+C,P=(l.top-f)*x+w,L=xk(e,x),A=C4(k,P,L,o,0,0,r),O=A.x,I=A.y;return{positionX:O,positionY:I,scale:x}}function rBe(e){for(var t=e,n=0,r=0;t;)n+=t.offsetLeft,r+=t.offsetTop,t=t.offsetParent;return{x:n,y:r}}function iBe(e){if(e){if((e==null?void 0:e.offsetWidth)===void 0||(e==null?void 0:e.offsetHeight)===void 0)return console.error("Zoom node is not valid - it must contain offsetWidth and offsetHeight"),!1}else return console.error("Zoom node not found"),!1;return!0}var oBe=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),dY(e,1,t,n,r)}},aBe=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),dY(e,-1,t,n,r)}},sBe=function(e){return function(t,n,r,i,o){i===void 0&&(i=300),o===void 0&&(o="easeOut");var a=e.transformState,s=a.positionX,l=a.positionY,u=a.scale,c=e.wrapperComponent,f=e.contentComponent,p=e.setup.disabled;if(!(p||!c||!f)){var m={positionX:isNaN(t)?s:t,positionY:isNaN(n)?l:n,scale:isNaN(r)?u:r};Pu(e,m,i,o)}}},lBe=function(e){return function(t,n){t===void 0&&(t=200),n===void 0&&(n="easeOut"),fY(e,t,n)}},uBe=function(e){return function(t,n,r){n===void 0&&(n=200),r===void 0&&(r="easeOut");var i=e.transformState,o=e.wrapperComponent,a=e.contentComponent;if(o&&a){var s=hY(t||i.scale,o,a);Pu(e,s,n,r)}}},cBe=function(e){return function(t,n,r,i){r===void 0&&(r=600),i===void 0&&(i="easeOut"),Fa(e);var o=e.wrapperComponent,a=typeof t=="string"?document.getElementById(t):t;if(o&&iBe(a)&&a&&o.contains(a)){var s=nBe(e,a,n);Pu(e,s,r,i)}}},rr=function(e){return{instance:e,state:e.transformState,zoomIn:oBe(e),zoomOut:aBe(e),setTransform:sBe(e),resetTransform:lBe(e),centerView:uBe(e),zoomToElement:cBe(e)}},t6=!1;function n6(){try{var e={get passive(){return t6=!0,!1}};return e}catch(t){return t6=!1,t6}}var _4=function(e,t){var n=e.tagName.toUpperCase(),r=t.find(function(o){return o.toUpperCase()===n});if(r)return!0;var i=t.find(function(o){return e.classList.contains(o)});return!!i},a$=function(e){e&&clearTimeout(e)},dBe=function(e,t,n){return"translate3d("+e+"px, "+t+"px, 0) scale("+n+")"},hY=function(e,t,n){var r=n.offsetWidth*e,i=n.offsetHeight*e,o=(t.offsetWidth-r)/2,a=(t.offsetHeight-i)/2;return{scale:e,positionX:o,positionY:a}},fBe=function(e,t){var n=e.setup.wheel,r=n.disabled,i=n.wheelDisabled,o=n.touchPadDisabled,a=n.excluded,s=e.isInitialized,l=e.isPanning,u=t.target,c=s&&!l&&!r&&u;if(!c||i&&!t.ctrlKey||o&&t.ctrlKey)return!1;var f=_4(u,a);return!f};function hBe(e,t){var n=e?e.deltaY<0?1:-1:0,r=kNe(t,n);return r}function pY(e,t,n){var r=t.getBoundingClientRect(),i=0,o=0;if("clientX"in e)i=(e.clientX-r.left)/n,o=(e.clientY-r.top)/n;else{var a=e.touches[0];i=(a.clientX-r.left)/n,o=(a.clientY-r.top)/n}return(isNaN(i)||isNaN(o))&&console.error("No mouse or touch offset found"),{x:i,y:o}}var pBe=function(e,t,n,r,i){var o=e.transformState.scale,a=e.wrapperComponent,s=e.setup,l=s.maxScale,u=s.minScale,c=s.zoomAnimation,f=c.size,p=c.disabled;if(!a)throw new Error("Wrapper is not mounted");var m=o+t*(o-o*n)*n;if(i)return m;var g=r?!1:!p,v=F1(So(m,3),u,l,f,g);return v},mBe=function(e,t){var n=e.previousWheelEvent,r=e.transformState.scale,i=e.setup,o=i.maxScale,a=i.minScale;return n?ra||Math.sign(n.deltaY)!==Math.sign(t.deltaY)||n.deltaY>0&&n.deltaYt.deltaY||Math.sign(n.deltaY)!==Math.sign(t.deltaY):!1},gBe=function(e,t){var n=e.setup.pinch,r=n.disabled,i=n.excluded,o=e.isInitialized,a=t.target,s=o&&!r&&a;if(!s)return!1;var l=_4(a,i);return!l},vBe=function(e){var t=e.setup.pinch.disabled,n=e.isInitialized,r=e.pinchStartDistance,i=n&&!t&&r;return!!i},yBe=function(e,t,n){var r=n.getBoundingClientRect(),i=e.touches,o=So(i[0].clientX-r.left,5),a=So(i[0].clientY-r.top,5),s=So(i[1].clientX-r.left,5),l=So(i[1].clientY-r.top,5);return{x:(o+s)/2/t,y:(a+l)/2/t}},mY=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))},bBe=function(e,t){var n=e.pinchStartScale,r=e.pinchStartDistance,i=e.setup,o=i.maxScale,a=i.minScale,s=i.zoomAnimation,l=s.size,u=s.disabled;if(!n||r===null||!t)throw new Error("Pinch touches distance was not provided");if(t<0)return e.transformState.scale;var c=t/r,f=c*n;return F1(So(f,2),a,o,l,!u)},SBe=160,wBe=100,CBe=function(e,t){var n=e.props,r=n.onWheelStart,i=n.onZoomStart;e.wheelStopEventTimer||(Fa(e),Cr(rr(e),t,r),Cr(rr(e),t,i))},xBe=function(e,t){var n=e.props,r=n.onWheel,i=n.onZoom,o=e.contentComponent,a=e.setup,s=e.transformState,l=s.scale,u=a.limitToBounds,c=a.centerZoomedOut,f=a.zoomAnimation,p=a.wheel,m=f.size,g=f.disabled,v=p.step;if(!o)throw new Error("Component not mounted");t.preventDefault(),t.stopPropagation();var x=hBe(t,null),C=pBe(e,x,v,!t.ctrlKey);if(l!==C){var w=xh(e,C),k=pY(t,o,l),P=g||m===0||c,L=u&&P,A=x4(e,k.x,k.y,C,w,L),O=A.x,I=A.y;e.previousWheelEvent=t,e.setTransformState(C,O,I),Cr(rr(e),t,r),Cr(rr(e),t,i)}},_Be=function(e,t){var n=e.props,r=n.onWheelStop,i=n.onZoomStop;a$(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout(function(){e.mounted&&(lY(e,t.x,t.y),e.wheelAnimationTimer=null)},wBe);var o=mBe(e,t);o&&(a$(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout(function(){e.mounted&&(e.wheelStopEventTimer=null,Cr(rr(e),t,r),Cr(rr(e),t,i))},SBe))},kBe=function(e,t){var n=mY(t);e.pinchStartDistance=n,e.lastDistance=n,e.pinchStartScale=e.transformState.scale,e.isPanning=!1,Fa(e)},EBe=function(e,t){var n=e.contentComponent,r=e.pinchStartDistance,i=e.transformState.scale,o=e.setup,a=o.limitToBounds,s=o.centerZoomedOut,l=o.zoomAnimation,u=l.disabled,c=l.size;if(!(r===null||!n)){var f=yBe(t,i,n);if(!(!isFinite(f.x)||!isFinite(f.y))){var p=mY(t),m=bBe(e,p);if(m!==i){var g=xh(e,m),v=u||c===0||s,x=a&&v,C=x4(e,f.x,f.y,m,g,x),w=C.x,k=C.y;e.pinchMidpoint=f,e.lastDistance=p,e.setTransformState(m,w,k)}}}},PBe=function(e){var t=e.pinchMidpoint;e.velocity=null,e.lastDistance=null,e.pinchMidpoint=null,e.pinchStartScale=null,e.pinchStartDistance=null,lY(e,t==null?void 0:t.x,t==null?void 0:t.y)};function TBe(e,t){var n=e.setup.doubleClick,r=n.disabled,i=n.mode,o=n.step,a=n.animationTime,s=n.animationType;if(!r){if(i==="reset")return fY(e,a,s);var l=e.transformState.scale,u=e.contentComponent;if(!u)return console.error("No ContentComponent found");var c=i==="zoomOut"?-1:1,f=cY(e,c,o),p=pY(t,u,l),m=_k(e,f,p.x,p.y);if(!m)return console.error("Error during zoom event. New transformation state was not calculated.");Pu(e,m,a,s)}}var LBe=function(e,t){var n=e.isInitialized,r=e.setup,i=e.wrapperComponent,o=r.doubleClick,a=o.disabled,s=o.excluded,l=t.target,u=i==null?void 0:i.contains(l),c=n&&l&&u&&!a;if(!c)return!1;var f=_4(l,s);return!(f||!c)},gY=M.createContext(tBe),ABe=function(e){_Ne(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.mounted=!0,n.transformState=uY(n.props),n.setup=o$(n.props),n.wrapperComponent=null,n.contentComponent=null,n.isInitialized=!1,n.bounds=null,n.previousWheelEvent=null,n.wheelStopEventTimer=null,n.wheelAnimationTimer=null,n.isPanning=!1,n.startCoords=null,n.lastTouch=null,n.distance=null,n.lastDistance=null,n.pinchStartDistance=null,n.pinchStartScale=null,n.pinchMidpoint=null,n.velocity=null,n.velocityTime=null,n.lastMousePosition=null,n.animate=!1,n.animation=null,n.maxBounds=null,n.pressedKeys={},n.handleInitializeWrapperEvents=function(r){var i=n6();r.addEventListener("wheel",n.onWheelZoom,i),r.addEventListener("dblclick",n.onDoubleClick,i),r.addEventListener("touchstart",n.onTouchPanningStart,i),r.addEventListener("touchmove",n.onTouchPanning,i),r.addEventListener("touchend",n.onTouchPanningStop,i)},n.handleInitialize=function(){var r=n.setup.centerOnInit;n.applyTransformation(),n.forceUpdate(),r&&(setTimeout(function(){n.mounted&&n.setCenter()},50),setTimeout(function(){n.mounted&&n.setCenter()},100),setTimeout(function(){n.mounted&&n.setCenter()},200))},n.onWheelZoom=function(r){var i=n.setup.disabled;if(!i){var o=fBe(n,r);if(o){var a=n.isPressingKeys(n.setup.wheel.activationKeys);a&&(CBe(n,r),xBe(n,r),_Be(n,r))}}},n.onPanningStart=function(r){var i=n.setup.disabled,o=n.props.onPanningStart;if(!i){var a=e$(n,r);if(a){var s=n.isPressingKeys(n.setup.panning.activationKeys);s&&(r.preventDefault(),r.stopPropagation(),Fa(n),r$(n,r),Cr(rr(n),r,o))}}},n.onPanning=function(r){var i=n.setup.disabled,o=n.props.onPanning;if(!i){var a=t$(n);if(a){var s=n.isPressingKeys(n.setup.panning.activationKeys);s&&(r.preventDefault(),r.stopPropagation(),i$(n,r.clientX,r.clientY),Cr(rr(n),r,o))}}},n.onPanningStop=function(r){var i=n.props.onPanningStop;n.isPanning&&(eBe(n),Cr(rr(n),r,i))},n.onPinchStart=function(r){var i=n.setup.disabled,o=n.props,a=o.onPinchingStart,s=o.onZoomStart;if(!i){var l=gBe(n,r);l&&(kBe(n,r),Fa(n),Cr(rr(n),r,a),Cr(rr(n),r,s))}},n.onPinch=function(r){var i=n.setup.disabled,o=n.props,a=o.onPinching,s=o.onZoom;if(!i){var l=vBe(n);l&&(r.preventDefault(),r.stopPropagation(),EBe(n,r),Cr(rr(n),r,a),Cr(rr(n),r,s))}},n.onPinchStop=function(r){var i=n.props,o=i.onPinchingStop,a=i.onZoomStop;n.pinchStartScale&&(PBe(n),Cr(rr(n),r,o),Cr(rr(n),r,a))},n.onTouchPanningStart=function(r){var i=n.setup.disabled,o=n.props.onPanningStart;if(!i){var a=e$(n,r);if(a){var s=n.lastTouch&&+new Date-n.lastTouch<200;if(s&&r.touches.length===1)n.onDoubleClick(r);else{n.lastTouch=+new Date,Fa(n);var l=r.touches,u=l.length===1,c=l.length===2;u&&(Fa(n),r$(n,r),Cr(rr(n),r,o)),c&&n.onPinchStart(r)}}}},n.onTouchPanning=function(r){var i=n.setup.disabled,o=n.props.onPanning;if(n.isPanning&&r.touches.length===1){if(i)return;var a=t$(n);if(!a)return;r.preventDefault(),r.stopPropagation();var s=r.touches[0];i$(n,s.clientX,s.clientY),Cr(rr(n),r,o)}else r.touches.length>1&&n.onPinch(r)},n.onTouchPanningStop=function(r){n.onPanningStop(r),n.onPinchStop(r)},n.onDoubleClick=function(r){var i=n.setup.disabled;if(!i){var o=LBe(n,r);o&&TBe(n,r)}},n.clearPanning=function(r){n.isPanning&&n.onPanningStop(r)},n.setKeyPressed=function(r){n.pressedKeys[r.key]=!0},n.setKeyUnPressed=function(r){n.pressedKeys[r.key]=!1},n.isPressingKeys=function(r){return r.length?Boolean(r.find(function(i){return n.pressedKeys[i]})):!0},n.setComponents=function(r,i){n.wrapperComponent=r,n.contentComponent=i,xh(n,n.transformState.scale),n.handleInitializeWrapperEvents(r),n.handleInitialize(),n.handleRef(),n.isInitialized=!0,Cr(rr(n),void 0,n.props.onInit)},n.setTransformState=function(r,i,o){!isNaN(r)&&!isNaN(i)&&!isNaN(o)?(r!==n.transformState.scale&&(n.transformState.previousScale=n.transformState.scale,n.transformState.scale=r),n.transformState.positionX=i,n.transformState.positionY=o,n.applyTransformation()):console.error("Detected NaN set state values")},n.setCenter=function(){if(n.wrapperComponent&&n.contentComponent){var r=hY(n.transformState.scale,n.wrapperComponent,n.contentComponent);n.setTransformState(r.scale,r.positionX,r.positionY)}},n.applyTransformation=function(){if(!(!n.mounted||!n.contentComponent)){var r=n.transformState,i=r.scale,o=r.positionX,a=r.positionY,s=dBe(o,a,i);n.contentComponent.style.transform=s,n.handleRef()}},n.handleRef=function(){n.props.setRef(rr(n))},n}return t.prototype.componentDidMount=function(){var n=n6();window.addEventListener("mousedown",this.onPanningStart,n),window.addEventListener("mousemove",this.onPanning,n),window.addEventListener("mouseup",this.onPanningStop,n),document.addEventListener("mouseleave",this.clearPanning,n),window.addEventListener("keyup",this.setKeyUnPressed,n),window.addEventListener("keydown",this.setKeyPressed,n),this.handleRef()},t.prototype.componentWillUnmount=function(){var n=n6();window.removeEventListener("mousedown",this.onPanningStart,n),window.removeEventListener("mousemove",this.onPanning,n),window.removeEventListener("mouseup",this.onPanningStop,n),window.removeEventListener("keyup",this.setKeyUnPressed,n),window.removeEventListener("keydown",this.setKeyPressed,n),Fa(this)},t.prototype.componentDidUpdate=function(n){n!==this.props&&(xh(this,this.transformState.scale),this.setup=o$(this.props))},t.prototype.render=function(){var n=rr(this),r=this.props.children,i=typeof r=="function"?r(n):r;return M.createElement(gY.Provider,{value:Ja(Ja({},this.transformState),{setComponents:this.setComponents,contextInstance:this})},i)},t}(S.Component),OBe=M.forwardRef(function(e,t){var n=S.useState(null),r=n[0],i=n[1];return S.useImperativeHandle(t,function(){return r},[r]),M.createElement(ABe,Ja({},e,{setRef:i}))});function MBe(e,t){t===void 0&&(t={});var n=t.insertAt;if(!(!e||typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",n==="top"&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var IBe=`.transform-component-module_wrapper__1_Fgj { - 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__2jYgh { - 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__2jYgh img { - pointer-events: none; -} -`,s$={wrapper:"transform-component-module_wrapper__1_Fgj",content:"transform-component-module_content__2jYgh"};MBe(IBe);var RBe=function(e){var t=e.children,n=e.wrapperClass,r=n===void 0?"":n,i=e.contentClass,o=i===void 0?"":i,a=e.wrapperStyle,s=e.contentStyle,l=S.useContext(gY).setComponents,u=S.useRef(null),c=S.useRef(null);return S.useEffect(function(){var f=u.current,p=c.current;f!==null&&p!==null&&l&&l(f,p)},[]),M.createElement("div",{ref:u,className:"react-transform-wrapper "+s$.wrapper+" "+r,style:a},M.createElement("div",{ref:c,className:"react-transform-component "+s$.content+" "+o,style:s},t))};function $Be({image:e,alt:t,ref:n,styleClass:r}){const[i,o]=S.useState(0),[a,s]=S.useState(!1),l=()=>{o(i===-3?0:i-1)},u=()=>{o(i===3?0:i+1)},c=()=>{s(!a)};return b(OBe,{centerOnInit:!0,minScale:.1,initialPositionX:50,initialPositionY:50,children:({zoomIn:f,zoomOut:p,resetTransform:m,centerView:g})=>j(gn,{children:[j("div",{className:"lightbox-image-options",children:[b(Ie,{icon:b(ZRe,{}),"aria-label":"Zoom In",tooltip:"Zoom In",onClick:()=>f(),fontSize:20}),b(Ie,{icon:b(QRe,{}),"aria-label":"Zoom Out",tooltip:"Zoom Out",onClick:()=>p(),fontSize:20}),b(Ie,{icon:b(qRe,{}),"aria-label":"Rotate Left",tooltip:"Rotate Left",onClick:l,fontSize:20}),b(Ie,{icon:b(XRe,{}),"aria-label":"Rotate Right",tooltip:"Rotate Right",onClick:u,fontSize:20}),b(Ie,{icon:b(n$e,{}),"aria-label":"Flip Image",tooltip:"Flip Image",onClick:c,fontSize:20}),b(Ie,{icon:b(m4,{}),"aria-label":"Reset",tooltip:"Reset",onClick:()=>{m(),o(0),s(!1)},fontSize:20})]}),b(RBe,{wrapperStyle:{width:"100%",height:"100%"},children:b("img",{style:{transform:`rotate(${i*90}deg) scaleX(${a?-1:1})`,width:"100%"},src:e,alt:t,ref:n,className:r||"",onLoad:()=>g(1,0,"easeOut")})})]})})}function DBe(){const e=ge(),t=ne(p=>p.lightbox.isLightboxOpen),{viewerImageToDisplay:n,shouldShowImageDetails:r,isOnFirstImage:i,isOnLastImage:o}=ne(vK),[a,s]=S.useState(!1),l=()=>{s(!0)},u=()=>{s(!1)},c=()=>{e(N_())},f=()=>{e(D_())};return Re("Esc",()=>{t&&e(Qf(!1))},[t]),j("div",{className:"lightbox-container",children:[b(Ie,{icon:b(YRe,{}),"aria-label":"Exit Viewer",className:"lightbox-close-btn",onClick:()=>{e(Qf(!1))},fontSize:20}),j("div",{className:"lightbox-display-container",children:[j("div",{className:"lightbox-preview-wrapper",children:[b(mK,{}),!r&&j("div",{className:"current-image-next-prev-buttons",children:[b("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!i&&b(_o,{"aria-label":"Previous image",icon:b(iK,{className:"next-prev-button"}),variant:"unstyled",onClick:c})}),b("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:l,onMouseOut:u,children:a&&!o&&b(_o,{"aria-label":"Next image",icon:b(oK,{className:"next-prev-button"}),variant:"unstyled",onClick:f})})]}),n&&j(gn,{children:[b($Be,{image:n.url,styleClass:"lightbox-image"}),r&&b(mk,{image:n})]})]}),b(rY,{})]})]})}function NBe(e){return We({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M14 1H3L2 2v11l1 1h11l1-1V2l-1-1zM8 13H3V2h5v11zm6 0H9V2h5v11z"}}]})(e)}const BBe=Fe(sd,e=>({resultImages:e.categories.result.images,userImages:e.categories.user.images})),FBe=()=>{const{resultImages:e,userImages:t}=ne(BBe);return n=>{const r=e.find(o=>o.uuid===n);if(r)return r;const i=t.find(o=>o.uuid===n);if(i)return i}},zBe=Fe([od,o4,Un],(e,t,n)=>{const{shouldShowDualDisplay:r,shouldPinParametersPanel:i}=e,{isLightboxOpen:o}=t;return{shouldShowDualDisplay:r,shouldPinParametersPanel:i,isLightboxOpen:o,shouldShowDualDisplayButton:["inpainting"].includes(n),activeTabName:n}},{memoizeOptions:{resultEqualityCheck:Ue}}),kk=e=>{const t=ge(),{optionsPanel:n,children:r,styleClass:i}=e,{activeTabName:o,shouldShowDualDisplay:a,isLightboxOpen:s,shouldShowDualDisplayButton:l}=ne(zBe),u=FBe(),c=()=>{t(eke(!a)),t(hr(!0))},f=p=>{const m=p.dataTransfer.getData("invokeai/imageUuid"),g=u(m);g&&(o==="img2img"?t(Kh(g)):o==="unifiedCanvas"&&t(Z3(g)))};return b("div",{className:i?`workarea-wrapper ${i}`:"workarea-wrapper",children:j("div",{className:"workarea-main",children:[n,j("div",{className:"workarea-children-wrapper",onDrop:f,children:[r,l&&b(ri,{label:"Toggle Split View",children:b("div",{className:"workarea-split-button","data-selected":a,onClick:c,children:b(NBe,{})})})]}),!s&&b(rY,{})]})})},jBe=e=>{const{styleClass:t}=e,n=S.useContext(Q_),r=()=>{n&&n()};return b("div",{className:`image-uploader-button-outer ${t}`,onClick:r,children:j("div",{className:"image-upload-button",children:[b(p4,{}),b(xc,{size:"lg",children:"Click or Drag and Drop"})]})})},HBe=Fe([sd,od,Un],(e,t,n)=>{const{currentImage:r,intermediateImage:i}=e,{shouldShowImageDetails:o}=t;return{activeTabName:n,shouldShowImageDetails:o,hasAnImageToDisplay:r||i}},{memoizeOptions:{resultEqualityCheck:Ue}}),vY=()=>{const{hasAnImageToDisplay:e,activeTabName:t}=ne(HBe);return b("div",{className:"current-image-area","data-tab-name":t,children:e?j(gn,{children:[b(mK,{}),b(FRe,{})]}):b("div",{className:"current-image-display-placeholder",children:b(r$e,{})})})},VBe=()=>{const e=S.useContext(Q_);return b(Ie,{"aria-label":"Upload Image",tooltip:"Upload Image",icon:b(p4,{}),onClick:e||void 0})};function UBe(){const e=ne(o=>o.generation.initialImage),{t}=Ce(),n=ge(),r=_1(),i=()=>{r({title:t("toast:parametersFailed"),description:t("toast:parametersFailedDesc"),status:"error",isClosable:!0}),n(KU())};return j(gn,{children:[j("div",{className:"init-image-preview-header",children:[b("h2",{children:t("parameters:initialImage")}),b(VBe,{})]}),e&&b("div",{className:"init-image-preview",children:b(r3,{fit:"contain",maxWidth:"100%",maxHeight:"100%",src:typeof e=="string"?e:e.url,onError:i})})]})}const WBe=()=>{const e=ne(r=>r.generation.initialImage),{currentImage:t}=ne(r=>r.gallery);return j("div",{className:"workarea-split-view",children:[b("div",{className:"workarea-split-view-left",children:e?b("div",{className:"image-to-image-area",children:b(UBe,{})}):b(jBe,{})}),t&&b("div",{className:"workarea-split-view-right",children:b(vY,{})})]})};var ei=(e=>(e[e.PROMPT=0]="PROMPT",e[e.GALLERY=1]="GALLERY",e[e.OTHER=2]="OTHER",e[e.SEED=3]="SEED",e[e.VARIATIONS=4]="VARIATIONS",e[e.UPSCALE=5]="UPSCALE",e[e.FACE_CORRECTION=6]="FACE_CORRECTION",e[e.IMAGE_TO_IMAGE=7]="IMAGE_TO_IMAGE",e[e.BOUNDING_BOX=8]="BOUNDING_BOX",e[e.SEAM_CORRECTION=9]="SEAM_CORRECTION",e[e.INFILL_AND_SCALING=10]="INFILL_AND_SCALING",e))(ei||{});const GBe=()=>{const{t:e}=Ce();return S.useMemo(()=>({[0]:{text:e("tooltip:feature.prompt"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[1]:{text:e("tooltip:feature.gallery"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[2]:{text:e("tooltip:feature.other"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[3]:{text:e("tooltip:feature.seed"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[4]:{text:e("tooltip:feature.variations"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[5]:{text:e("tooltip:feature.upscale"),href:"link/to/docs/feature1.html",guideImage:"asset/path.gif"},[6]:{text:e("tooltip:feature.faceCorrection"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[7]:{text:e("tooltip:feature.imageToImage"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[8]:{text:e("tooltip:feature.boundingBox"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[9]:{text:e("tooltip:feature.seamCorrection"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"},[10]:{text:e("tooltip:feature.infillAndScaling"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}}),[e])},KBe=e=>GBe()[e],Jo=e=>{const{label:t,isDisabled:n=!1,width:r="auto",formControlProps:i,formLabelProps:o,styleClass:a,...s}=e;return j(Tt,{isDisabled:n,width:r,className:`invokeai__switch-form-control ${a}`,display:"flex",columnGap:"1rem",alignItems:"center",justifyContent:"space-between",...i,children:[b(Ht,{className:"invokeai__switch-form-label",whiteSpace:"nowrap",marginRight:0,marginTop:.5,marginBottom:.5,fontSize:"sm",fontWeight:"bold",width:"auto",...o,children:t}),b(o_,{className:"invokeai__switch-root",...s})]})};function yY(){const e=ne(i=>i.system.isGFPGANAvailable),t=ne(i=>i.postprocessing.shouldRunFacetool),n=ge();return b(Jo,{isDisabled:!e,isChecked:t,onChange:i=>n(X9e(i.target.checked))})}function YBe(){const e=ge(),t=ne(i=>i.generation.shouldFitToWidthHeight),n=i=>e(rW(i.target.checked)),{t:r}=Ce();return b(Jo,{label:r("parameters:imageFit"),isChecked:t,onChange:n})}function bY(e){const{t}=Ce(),{label:n=`${t("parameters:strength")}`,styleClass:r}=e,i=ne(l=>l.generation.img2imgStrength),o=ge();return b(Ri,{label:n,step:.01,min:.01,max:.99,onChange:l=>o(Ax(l)),value:i,isInteger:!1,styleClass:r,withInput:!0,withSliderMarks:!0,inputWidth:"5.5rem",withReset:!0,handleReset:()=>{o(Ax(.75))}})}const SY=()=>{const e=ge(),t=ne(i=>i.generation.seamless),n=i=>e(tW(i.target.checked)),{t:r}=Ce();return b(Le,{gap:2,direction:"column",children:b(Jo,{label:r("parameters:seamlessTiling"),fontSize:"md",isChecked:t,onChange:n})})},qBe=()=>b(Le,{gap:2,direction:"column",children:b(SY,{})});function XBe(){const e=ge(),t=ne(i=>i.generation.perlin),{t:n}=Ce(),r=i=>e(JU(i));return b(pi,{label:n("parameters:perlinNoise"),min:0,max:1,step:.05,onChange:r,value:t,isInteger:!1})}function ZBe(){const e=ge(),{t}=Ce(),n=ne(i=>i.generation.shouldRandomizeSeed),r=i=>e(U9e(i.target.checked));return b(Jo,{label:t("parameters:randomizeSeed"),isChecked:n,onChange:r})}function QBe(){const e=ne(a=>a.generation.seed),t=ne(a=>a.generation.shouldRandomizeSeed),n=ne(a=>a.generation.shouldGenerateVariations),{t:r}=Ce(),i=ge(),o=a=>i(A1(a));return b(pi,{label:r("parameters:seed"),step:1,precision:0,flexGrow:1,min:W_,max:G_,isDisabled:t,isInvalid:e<0&&n,onChange:o,value:e,width:"auto"})}function JBe(){const e=ge(),t=ne(i=>i.generation.shouldRandomizeSeed),{t:n}=Ce();return b(xo,{size:"sm",isDisabled:t,onClick:()=>e(A1(LG(W_,G_))),padding:"0 1.5rem",children:b("p",{children:n("parameters:shuffle")})})}function eFe(){const e=ge(),t=ne(i=>i.generation.threshold),{t:n}=Ce(),r=i=>e(oW(i));return b(pi,{label:n("parameters:noiseThreshold"),min:0,max:1e3,step:.1,onChange:r,value:t,isInteger:!1})}const Ek=()=>j(Le,{gap:2,direction:"column",children:[b(ZBe,{}),j(Le,{gap:2,children:[b(QBe,{}),b(JBe,{})]}),b(Le,{gap:2,children:b(eFe,{})}),b(Le,{gap:2,children:b(XBe,{})})]});function wY(){const e=ne(i=>i.system.isESRGANAvailable),t=ne(i=>i.postprocessing.shouldRunESRGAN),n=ge();return b(Jo,{isDisabled:!e,isChecked:t,onChange:i=>n(q9e(i.target.checked))})}function Pk(){const e=ne(r=>r.generation.shouldGenerateVariations),t=ge();return b(Jo,{isChecked:e,width:"auto",onChange:r=>t(V9e(r.target.checked))})}function Bn(e){const{label:t="",styleClass:n,isDisabled:r=!1,fontSize:i="sm",width:o,size:a="sm",isInvalid:s,...l}=e;return j(Tt,{className:`input ${n}`,isInvalid:s,isDisabled:r,children:[t!==""&&b(Ht,{fontSize:i,fontWeight:"bold",alignItems:"center",whiteSpace:"nowrap",marginBottom:0,marginRight:0,className:"input-label",children:t}),b(R9,{...l,className:"input-entry",size:a,width:o})]})}function tFe(){const e=ne(o=>o.generation.seedWeights),t=ne(o=>o.generation.shouldGenerateVariations),{t:n}=Ce(),r=ge(),i=o=>r(nW(o.target.value));return b(Bn,{label:n("parameters:seedWeights"),value:e,isInvalid:t&&!(F_(e)||e===""),isDisabled:!t,onChange:i})}function nFe(){const e=ne(o=>o.generation.variationAmount),t=ne(o=>o.generation.shouldGenerateVariations),{t:n}=Ce(),r=ge(),i=o=>r(W9e(o));return b(pi,{label:n("parameters:variationAmount"),value:e,step:.01,min:0,max:1,isDisabled:!t,onChange:i,isInteger:!1})}const Tk=()=>j(Le,{gap:2,direction:"column",children:[b(nFe,{}),b(tFe,{})]});function rFe(){const e=ge(),t=ne(i=>i.generation.cfgScale),{t:n}=Ce(),r=i=>e(qU(i));return b(pi,{label:n("parameters:cfgScale"),step:.5,min:1.01,max:200,onChange:r,value:t,width:"auto",styleClass:"main-settings-block",textAlign:"center",isInteger:!1})}function iFe(){const e=ne(o=>o.generation.height),t=ne(Un),n=ge(),{t:r}=Ce(),i=o=>n(XU(Number(o.target.value)));return b(da,{isDisabled:t==="unifiedCanvas",label:r("parameters:height"),value:e,flexGrow:1,onChange:i,validValues:Yke,styleClass:"main-settings-block"})}const oFe=Fe([e=>e.generation],e=>{const{iterations:t}=e;return{iterations:t}},{memoizeOptions:{resultEqualityCheck:Ue}});function aFe(){const e=ge(),{iterations:t}=ne(oFe),{t:n}=Ce(),r=i=>e(H9e(i));return b(pi,{label:n("parameters:images"),step:1,min:1,max:9999,onChange:r,value:t,width:"auto",labelFontSize:.5,styleClass:"main-settings-block",textAlign:"center"})}function sFe(){const e=ne(o=>o.generation.sampler),t=ne(jG),n=ge(),{t:r}=Ce(),i=o=>n(eW(o.target.value));return b(da,{label:r("parameters:sampler"),value:e,onChange:i,validValues:t.format==="diffusers"?Gke:Wke,styleClass:"main-settings-block"})}function lFe(){const e=ge(),t=ne(i=>i.generation.steps),{t:n}=Ce(),r=i=>e(iW(i));return b(pi,{label:n("parameters:steps"),min:1,max:9999,step:1,onChange:r,value:t,width:"auto",styleClass:"main-settings-block",textAlign:"center"})}function uFe(){const e=ne(o=>o.generation.width),t=ne(Un),{t:n}=Ce(),r=ge(),i=o=>r(aW(Number(o.target.value)));return b(da,{isDisabled:t==="unifiedCanvas",label:n("parameters:width"),value:e,flexGrow:1,onChange:i,validValues:Kke,styleClass:"main-settings-block"})}function Lk(){return b("div",{className:"main-settings",children:j("div",{className:"main-settings-list",children:[j("div",{className:"main-settings-row",children:[b(aFe,{}),b(lFe,{}),b(rFe,{})]}),j("div",{className:"main-settings-row",children:[b(uFe,{}),b(iFe,{}),b(sFe,{})]})]})})}const cFe=Fe(vn,e=>e.shouldDisplayGuides),dFe=({children:e,feature:t})=>{const n=ne(cFe),{text:r}=KBe(t);return n?j(J8,{trigger:"hover",children:[b(n_,{children:b(ci,{children:e})}),j(t_,{className:"guide-popover-content",maxWidth:"400px",onClick:i=>i.preventDefault(),cursor:"initial",children:[b(e_,{className:"guide-popover-arrow"}),b("div",{className:"guide-popover-guide-content",children:r})]})]}):null},fFe=pe(({feature:e,icon:t=e$e},n)=>b(dFe,{feature:e,children:b(ci,{ref:n,children:b(Qi,{marginBottom:"-.15rem",as:t})})}));function hFe(e){const{header:t,feature:n,content:r,additionalHeaderComponents:i}=e;return j(af,{className:"advanced-parameters-item",children:[b(rf,{className:"advanced-parameters-header",children:j(Le,{width:"100%",gap:"0.5rem",align:"center",children:[b(ci,{flexGrow:1,textAlign:"left",children:t}),i,n&&b(fFe,{feature:n}),b(of,{})]})}),b(sf,{className:"advanced-parameters-panel",children:r})]})}const Ak=e=>{const{accordionInfo:t}=e,n=ne(a=>a.system.openAccordions),r=ge();return b(E9,{defaultIndex:n,allowMultiple:!0,reduceMotion:!0,onChange:a=>r(D_e(a)),className:"advanced-parameters",children:(()=>{const a=[];return t&&Object.keys(t).forEach(s=>{const{header:l,feature:u,content:c,additionalHeaderComponents:f}=t[s];a.push(b(hFe,{header:l,feature:u,content:c,additionalHeaderComponents:f},s))}),a})()})},pFe=Fe(vn,e=>({isProcessing:e.isProcessing,isConnected:e.isConnected,isCancelable:e.isCancelable}),{memoizeOptions:{resultEqualityCheck:Ue}});function Ok(e){const{...t}=e,n=ge(),{isProcessing:r,isConnected:i,isCancelable:o}=ne(pFe),a=()=>n(PTe()),{t:s}=Ce();return Re("shift+x",()=>{(i||r)&&o&&a()},[i,r,o]),b(Ie,{icon:b(i$e,{}),tooltip:s("parameters:cancel"),"aria-label":s("parameters:cancel"),isDisabled:!i||!r||!o,onClick:a,styleClass:"cancel-btn",...t})}const Mk=e=>e.generation;Fe(Mk,({shouldRandomizeSeed:e,shouldGenerateVariations:t})=>e||t,{memoizeOptions:{resultEqualityCheck:Ue}});const CY=Fe([Mk,vn,pK,Un],(e,t,n,r)=>{const{prompt:i,shouldGenerateVariations:o,seedWeights:a,initialImage:s,seed:l}=e,{isProcessing:u,isConnected:c}=t;let f=!0;const p=[];return(!i||Boolean(i.match(/^[\s\r\n]+$/)))&&(f=!1,p.push("Missing prompt")),r==="img2img"&&!s&&(f=!1,p.push("No initial image selected")),u&&(f=!1,p.push("System Busy")),c||(f=!1,p.push("System Disconnected")),o&&(!(F_(a)||a==="")||l===-1)&&(f=!1,p.push("Seed-Weights badly formatted.")),{isReady:f,reasonsWhyNotReady:p}},{memoizeOptions:{equalityCheck:Ue,resultEqualityCheck:Ue}});function Ik(e){const{iconButton:t=!1,...n}=e,r=ge(),{isReady:i}=ne(CY),o=ne(Un),a=()=>{r(e7(o))},{t:s}=Ce();return Re(["ctrl+enter","meta+enter"],()=>{r(e7(o))},{enabled:()=>i,preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[i,o]),b("div",{style:{flexGrow:4},children:t?b(Ie,{"aria-label":s("parameters:invoke"),type:"submit",icon:b(CRe,{}),isDisabled:!i,onClick:a,className:"invoke-btn",tooltip:s("parameters:invoke"),tooltipProps:{placement:"bottom"},...n}):b(kn,{"aria-label":s("parameters:invoke"),type:"submit",isDisabled:!i,onClick:a,className:"invoke-btn",...n,children:"Invoke"})})}const mFe=Fe(R1,({shouldLoopback:e})=>e),gFe=()=>{const e=ge(),t=ne(mFe),{t:n}=Ce();return b(Ie,{"aria-label":n("parameters:toggleLoopback"),tooltip:n("parameters:toggleLoopback"),styleClass:"loopback-btn",asCheckbox:!0,isChecked:t,icon:b(_Re,{}),onClick:()=>{e(Y9e(!t))}})},Rk=()=>{const e=ne(Un);return j("div",{className:"process-buttons",children:[b(Ik,{}),e==="img2img"&&b(gFe,{}),b(Ok,{})]})},$k=()=>{const e=ne(r=>r.generation.negativePrompt),t=ge(),{t:n}=Ce();return b(Tt,{children:b(a_,{id:"negativePrompt",name:"negativePrompt",value:e,onChange:r=>t(Hg(r.target.value)),background:"var(--prompt-bg-color)",placeholder:n("parameters:negativePrompts"),_placeholder:{fontSize:"0.8rem"},borderColor:"var(--border-color)",_hover:{borderColor:"var(--border-color-light)"},_focusVisible:{borderColor:"var(--border-color-invalid)",boxShadow:"0 0 10px var(--box-shadow-color-invalid)"},fontSize:"0.9rem",color:"var(--text-color-secondary)"})})},vFe=Fe([e=>e.generation,Un],(e,t)=>({prompt:e.prompt,activeTabName:t}),{memoizeOptions:{resultEqualityCheck:Ue}}),Dk=()=>{const e=ge(),{prompt:t,activeTabName:n}=ne(vFe),{isReady:r}=ne(CY),i=S.useRef(null),{t:o}=Ce(),a=l=>{e(Q3(l.target.value))};Re("alt+a",()=>{var l;(l=i.current)==null||l.focus()},[]);const s=l=>{l.key==="Enter"&&l.shiftKey===!1&&r&&(l.preventDefault(),e(e7(n)))};return b("div",{className:"prompt-bar",children:b(Tt,{isInvalid:t.length===0||Boolean(t.match(/^[\s\r\n]+$/)),children:b(a_,{id:"prompt",name:"prompt",placeholder:o("parameters:promptPlaceholder"),size:"lg",value:t,onChange:a,onKeyDown:s,resize:"vertical",height:30,ref:i,_placeholder:{color:"var(--text-color-secondary)"}})})})},xY=""+new URL("logo-13003d72.png",import.meta.url).href,yFe=Fe(od,e=>{const{shouldShowParametersPanel:t,shouldHoldParametersPanelOpen:n,shouldPinParametersPanel:r,parametersPanelScrollPosition:i}=e;return{shouldShowParametersPanel:t,shouldHoldParametersPanelOpen:n,shouldPinParametersPanel:r,parametersPanelScrollPosition:i}},{memoizeOptions:{resultEqualityCheck:Ue}}),Nk=e=>{const t=ge(),{shouldShowParametersPanel:n,shouldHoldParametersPanelOpen:r,shouldPinParametersPanel:i}=ne(yFe),o=S.useRef(null),a=S.useRef(null),s=S.useRef(null),{children:l}=e;Re("o",()=>{t(Rs(!n)),i&&setTimeout(()=>t(hr(!0)),400)},[n,i]),Re("esc",()=>{t(Rs(!1))},{enabled:()=>!i,preventDefault:!0},[i]),Re("shift+o",()=>{p(),t(hr(!0))},[i]);const u=S.useCallback(()=>{i||(t(Z_e(a.current?a.current.scrollTop:0)),t(Rs(!1)),t(Q_e(!1)))},[t,i]),c=()=>{s.current=window.setTimeout(()=>u(),500)},f=()=>{s.current&&window.clearTimeout(s.current)},p=()=>{t(J_e(!i)),t(hr(!0))};return S.useEffect(()=>{function m(g){o.current&&!o.current.contains(g.target)&&u()}return document.addEventListener("mousedown",m),()=>{document.removeEventListener("mousedown",m)}},[u]),b(kK,{nodeRef:o,in:n||r&&!i,unmountOnExit:!0,timeout:200,classNames:"parameters-panel-wrapper",children:b("div",{className:"parameters-panel-wrapper","data-pinned":i,tabIndex:1,ref:o,onMouseEnter:i?void 0:f,onMouseOver:i?void 0:f,style:{borderRight:i?"":"0.3rem solid var(--tab-list-text-inactive)"},children:b("div",{className:"parameters-panel-margin",children:j("div",{className:"parameters-panel",ref:a,onMouseLeave:m=>{m.target!==a.current?f():!i&&c()},children:[b(ri,{label:"Pin Options Panel",children:b("div",{className:"parameters-panel-pin-button","data-selected":i,onClick:p,children:i?b(SK,{}):b(wK,{})})}),!i&&j("div",{className:"invoke-ai-logo-wrapper",children:[b("img",{src:xY,alt:"invoke-ai-logo"}),j("h1",{children:["invoke ",b("strong",{children:"ai"})]})]}),l]})})})})};function bFe(){const{t:e}=Ce(),t={seed:{header:`${e("parameters:seed")}`,feature:ei.SEED,content:b(Ek,{})},variations:{header:`${e("parameters:variations")}`,feature:ei.VARIATIONS,content:b(Tk,{}),additionalHeaderComponents:b(Pk,{})},face_restore:{header:`${e("parameters:faceRestoration")}`,feature:ei.FACE_CORRECTION,content:b(ok,{}),additionalHeaderComponents:b(yY,{})},upscale:{header:`${e("parameters:upscaling")}`,feature:ei.UPSCALE,content:b(ak,{}),additionalHeaderComponents:b(wY,{})},other:{header:`${e("parameters:otherOptions")}`,feature:ei.OTHER,content:b(qBe,{})}},n=ge(),r=ne(Un);return S.useEffect(()=>{r==="img2img"&&n(z_(!1))},[r,n]),j(Nk,{children:[j(Le,{flexDir:"column",rowGap:"0.5rem",children:[b(Dk,{}),b($k,{})]}),b(Rk,{}),b(Lk,{}),b(bY,{label:e("parameters:img2imgStrength"),styleClass:"main-settings-block image-to-image-strength-main-option"}),b(YBe,{}),b(Ak,{accordionInfo:t})]})}function SFe(){return b(kk,{optionsPanel:b(bFe,{}),children:b(WBe,{})})}const wFe=()=>b("div",{className:"workarea-single-view",children:b("div",{className:"text-to-image-area",children:b(vY,{})})}),CFe=Fe([R1],({hiresFix:e,hiresStrength:t})=>({hiresFix:e,hiresStrength:t}),{memoizeOptions:{resultEqualityCheck:Ue}}),xFe=()=>{const{hiresFix:e,hiresStrength:t}=ne(CFe),n=ge(),{t:r}=Ce(),i=a=>{n(BM(a))},o=()=>{n(BM(.75))};return b(Ri,{label:r("parameters:hiresStrength"),step:.01,min:.01,max:.99,onChange:i,value:t,isInteger:!1,withInput:!0,withSliderMarks:!0,inputWidth:"5.5rem",withReset:!0,handleReset:o,isSliderDisabled:!e,isInputDisabled:!e,isResetDisabled:!e})},_Fe=()=>{const e=ge(),t=ne(i=>i.postprocessing.hiresFix),{t:n}=Ce(),r=i=>e(z_(i.target.checked));return j(Le,{gap:2,direction:"column",children:[b(Jo,{label:n("parameters:hiresOptim"),fontSize:"md",isChecked:t,onChange:r}),b(xFe,{})]})},kFe=()=>j(Le,{gap:2,direction:"column",children:[b(SY,{}),b(_Fe,{})]});function EFe(){const{t:e}=Ce(),t={seed:{header:`${e("parameters:seed")}`,feature:ei.SEED,content:b(Ek,{})},variations:{header:`${e("parameters:variations")}`,feature:ei.VARIATIONS,content:b(Tk,{}),additionalHeaderComponents:b(Pk,{})},face_restore:{header:`${e("parameters:faceRestoration")}`,feature:ei.FACE_CORRECTION,content:b(ok,{}),additionalHeaderComponents:b(yY,{})},upscale:{header:`${e("parameters:upscaling")}`,feature:ei.UPSCALE,content:b(ak,{}),additionalHeaderComponents:b(wY,{})},other:{header:`${e("parameters:otherOptions")}`,feature:ei.OTHER,content:b(kFe,{})}};return j(Nk,{children:[j(Le,{flexDir:"column",rowGap:"0.5rem",children:[b(Dk,{}),b($k,{})]}),b(Rk,{}),b(Lk,{}),b(Ak,{accordionInfo:t})]})}function PFe(){return b(kk,{optionsPanel:b(EFe,{}),children:b(wFe,{})})}var g7={},TFe={get exports(){return g7},set exports(e){g7=e}};/** - * @license React - * react-reconciler.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var LFe=function(t){var n={},r=S,i=Ec,o=Object.assign;function a(d){for(var h="https://reactjs.org/docs/error-decoder.html?invariant="+d,y=1;yQ||E[F]!==T[Q]){var ae=` -`+E[F].replace(" at new "," at ");return d.displayName&&ae.includes("")&&(ae=ae.replace("",d.displayName)),ae}while(1<=F&&0<=Q);break}}}finally{ol=!1,Error.prepareStackTrace=y}return(d=d?d.displayName||d.name:"")?Ou(d):""}var q4=Object.prototype.hasOwnProperty,op=[],al=-1;function Ro(d){return{current:d}}function on(d){0>al||(d.current=op[al],op[al]=null,al--)}function en(d,h){al++,op[al]=d.current,d.current=h}var ga={},gr=Ro(ga),Fr=Ro(!1),ps=ga;function sl(d,h){var y=d.type.contextTypes;if(!y)return ga;var _=d.stateNode;if(_&&_.__reactInternalMemoizedUnmaskedChildContext===h)return _.__reactInternalMemoizedMaskedChildContext;var E={},T;for(T in y)E[T]=h[T];return _&&(d=d.stateNode,d.__reactInternalMemoizedUnmaskedChildContext=h,d.__reactInternalMemoizedMaskedChildContext=E),E}function zr(d){return d=d.childContextTypes,d!=null}function vd(){on(Fr),on(gr)}function Y1(d,h,y){if(gr.current!==ga)throw Error(a(168));en(gr,h),en(Fr,y)}function Mu(d,h,y){var _=d.stateNode;if(h=h.childContextTypes,typeof _.getChildContext!="function")return y;_=_.getChildContext();for(var E in _)if(!(E in h))throw Error(a(108,I(d)||"Unknown",E));return o({},y,_)}function ll(d){return d=(d=d.stateNode)&&d.__reactInternalMemoizedMergedChildContext||ga,ps=gr.current,en(gr,d),en(Fr,Fr.current),!0}function q1(d,h,y){var _=d.stateNode;if(!_)throw Error(a(169));y?(d=Mu(d,h,ps),_.__reactInternalMemoizedMergedChildContext=d,on(Fr),on(gr),en(gr,d)):on(Fr),en(Fr,y)}var Di=Math.clz32?Math.clz32:Z4,X1=Math.log,X4=Math.LN2;function Z4(d){return d>>>=0,d===0?32:31-(X1(d)/X4|0)|0}var yd=64,Iu=4194304;function Ru(d){switch(d&-d){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 d&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return d&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return d}}function bd(d,h){var y=d.pendingLanes;if(y===0)return 0;var _=0,E=d.suspendedLanes,T=d.pingedLanes,F=y&268435455;if(F!==0){var Q=F&~E;Q!==0?_=Ru(Q):(T&=F,T!==0&&(_=Ru(T)))}else F=y&~E,F!==0?_=Ru(F):T!==0&&(_=Ru(T));if(_===0)return 0;if(h!==0&&h!==_&&!(h&E)&&(E=_&-_,T=h&-h,E>=T||E===16&&(T&4194240)!==0))return h;if(_&4&&(_|=y&16),h=d.entangledLanes,h!==0)for(d=d.entanglements,h&=_;0y;y++)h.push(d);return h}function va(d,h,y){d.pendingLanes|=h,h!==536870912&&(d.suspendedLanes=0,d.pingedLanes=0),d=d.eventTimes,h=31-Di(h),d[h]=y}function up(d,h){var y=d.pendingLanes&~h;d.pendingLanes=h,d.suspendedLanes=0,d.pingedLanes=0,d.expiredLanes&=h,d.mutableReadLanes&=h,d.entangledLanes&=h,h=d.entanglements;var _=d.eventTimes;for(d=d.expirationTimes;0>=F,E-=F,no=1<<32-Di(h)+E|y<Mt?(wr=ft,ft=null):wr=ft.sibling;var It=Be(oe,ft,ue[Mt],ze);if(It===null){ft===null&&(ft=wr);break}d&&ft&&It.alternate===null&&h(oe,ft),ee=T(It,ee,Mt),gt===null?at=It:gt.sibling=It,gt=It,ft=wr}if(Mt===ue.length)return y(oe,ft),An&&Du(oe,Mt),at;if(ft===null){for(;MtMt?(wr=ft,ft=null):wr=ft.sibling;var gl=Be(oe,ft,It.value,ze);if(gl===null){ft===null&&(ft=wr);break}d&&ft&&gl.alternate===null&&h(oe,ft),ee=T(gl,ee,Mt),gt===null?at=gl:gt.sibling=gl,gt=gl,ft=wr}if(It.done)return y(oe,ft),An&&Du(oe,Mt),at;if(ft===null){for(;!It.done;Mt++,It=ue.next())It=dt(oe,It.value,ze),It!==null&&(ee=T(It,ee,Mt),gt===null?at=It:gt.sibling=It,gt=It);return An&&Du(oe,Mt),at}for(ft=_(oe,ft);!It.done;Mt++,It=ue.next())It=yn(ft,oe,Mt,It.value,ze),It!==null&&(d&&It.alternate!==null&&ft.delete(It.key===null?Mt:It.key),ee=T(It,ee,Mt),gt===null?at=It:gt.sibling=It,gt=It);return d&&ft.forEach(function(cX){return h(oe,cX)}),An&&Du(oe,Mt),at}function Ss(oe,ee,ue,ze){if(typeof ue=="object"&&ue!==null&&ue.type===c&&ue.key===null&&(ue=ue.props.children),typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case l:e:{for(var at=ue.key,gt=ee;gt!==null;){if(gt.key===at){if(at=ue.type,at===c){if(gt.tag===7){y(oe,gt.sibling),ee=E(gt,ue.props.children),ee.return=oe,oe=ee;break e}}else if(gt.elementType===at||typeof at=="object"&&at!==null&&at.$$typeof===k&&vE(at)===gt.type){y(oe,gt.sibling),ee=E(gt,ue.props),ee.ref=hp(oe,gt,ue),ee.return=oe,oe=ee;break e}y(oe,gt);break}else h(oe,gt);gt=gt.sibling}ue.type===c?(ee=Vu(ue.props.children,oe.mode,ze,ue.key),ee.return=oe,oe=ee):(ze=D0(ue.type,ue.key,ue.props,null,oe.mode,ze),ze.ref=hp(oe,ee,ue),ze.return=oe,oe=ze)}return F(oe);case u:e:{for(gt=ue.key;ee!==null;){if(ee.key===gt)if(ee.tag===4&&ee.stateNode.containerInfo===ue.containerInfo&&ee.stateNode.implementation===ue.implementation){y(oe,ee.sibling),ee=E(ee,ue.children||[]),ee.return=oe,oe=ee;break e}else{y(oe,ee);break}else h(oe,ee);ee=ee.sibling}ee=eS(ue,oe.mode,ze),ee.return=oe,oe=ee}return F(oe);case k:return gt=ue._init,Ss(oe,ee,gt(ue._payload),ze)}if(N(ue))return an(oe,ee,ue,ze);if(A(ue))return wi(oe,ee,ue,ze);c0(oe,ue)}return typeof ue=="string"&&ue!==""||typeof ue=="number"?(ue=""+ue,ee!==null&&ee.tag===6?(y(oe,ee.sibling),ee=E(ee,ue),ee.return=oe,oe=ee):(y(oe,ee),ee=J5(ue,oe.mode,ze),ee.return=oe,oe=ee),F(oe)):y(oe,ee)}return Ss}var Ed=yE(!0),bE=yE(!1),pp={},oo=Ro(pp),mp=Ro(pp),Pd=Ro(pp);function ba(d){if(d===pp)throw Error(a(174));return d}function h5(d,h){en(Pd,h),en(mp,d),en(oo,pp),d=G(h),on(oo),en(oo,d)}function Td(){on(oo),on(mp),on(Pd)}function SE(d){var h=ba(Pd.current),y=ba(oo.current);h=B(y,d.type,h),y!==h&&(en(mp,d),en(oo,h))}function p5(d){mp.current===d&&(on(oo),on(mp))}var Rn=Ro(0);function d0(d){for(var h=d;h!==null;){if(h.tag===13){var y=h.memoizedState;if(y!==null&&(y=y.dehydrated,y===null||K1(y)||rp(y)))return h}else if(h.tag===19&&h.memoizedProps.revealOrder!==void 0){if(h.flags&128)return h}else if(h.child!==null){h.child.return=h,h=h.child;continue}if(h===d)break;for(;h.sibling===null;){if(h.return===null||h.return===d)return null;h=h.return}h.sibling.return=h.return,h=h.sibling}return null}var m5=[];function g5(){for(var d=0;dy?y:4,d(!0);var _=v5.transition;v5.transition={};try{d(!1),h()}finally{Ct=y,v5.transition=_}}function BE(){return ao().memoizedState}function Nq(d,h,y){var _=hl(d);if(y={lane:_,action:y,hasEagerState:!1,eagerState:null,next:null},FE(d))zE(h,y);else if(y=uE(d,h,y,_),y!==null){var E=Wr();so(y,d,_,E),jE(y,h,_)}}function Bq(d,h,y){var _=hl(d),E={lane:_,action:y,hasEagerState:!1,eagerState:null,next:null};if(FE(d))zE(h,E);else{var T=d.alternate;if(d.lanes===0&&(T===null||T.lanes===0)&&(T=h.lastRenderedReducer,T!==null))try{var F=h.lastRenderedState,Q=T(F,y);if(E.hasEagerState=!0,E.eagerState=Q,H(Q,F)){var ae=h.interleaved;ae===null?(E.next=E,u5(h)):(E.next=ae.next,ae.next=E),h.interleaved=E;return}}catch(_e){}finally{}y=uE(d,h,E,_),y!==null&&(E=Wr(),so(y,d,_,E),jE(y,h,_))}}function FE(d){var h=d.alternate;return d===$n||h!==null&&h===$n}function zE(d,h){gp=h0=!0;var y=d.pending;y===null?h.next=h:(h.next=y.next,y.next=h),d.pending=h}function jE(d,h,y){if(y&4194240){var _=h.lanes;_&=d.pendingLanes,y|=_,h.lanes=y,$u(d,y)}}var g0={readContext:io,useCallback:Hr,useContext:Hr,useEffect:Hr,useImperativeHandle:Hr,useInsertionEffect:Hr,useLayoutEffect:Hr,useMemo:Hr,useReducer:Hr,useRef:Hr,useState:Hr,useDebugValue:Hr,useDeferredValue:Hr,useTransition:Hr,useMutableSource:Hr,useSyncExternalStore:Hr,useId:Hr,unstable_isNewReconciler:!1},Fq={readContext:io,useCallback:function(d,h){return Sa().memoizedState=[d,h===void 0?null:h],d},useContext:io,useEffect:AE,useImperativeHandle:function(d,h,y){return y=y!=null?y.concat([d]):null,p0(4194308,4,IE.bind(null,h,d),y)},useLayoutEffect:function(d,h){return p0(4194308,4,d,h)},useInsertionEffect:function(d,h){return p0(4,2,d,h)},useMemo:function(d,h){var y=Sa();return h=h===void 0?null:h,d=d(),y.memoizedState=[d,h],d},useReducer:function(d,h,y){var _=Sa();return h=y!==void 0?y(h):h,_.memoizedState=_.baseState=h,d={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:d,lastRenderedState:h},_.queue=d,d=d.dispatch=Nq.bind(null,$n,d),[_.memoizedState,d]},useRef:function(d){var h=Sa();return d={current:d},h.memoizedState=d},useState:TE,useDebugValue:_5,useDeferredValue:function(d){return Sa().memoizedState=d},useTransition:function(){var d=TE(!1),h=d[0];return d=Dq.bind(null,d[1]),Sa().memoizedState=d,[h,d]},useMutableSource:function(){},useSyncExternalStore:function(d,h,y){var _=$n,E=Sa();if(An){if(y===void 0)throw Error(a(407));y=y()}else{if(y=h(),Sr===null)throw Error(a(349));Bu&30||xE(_,h,y)}E.memoizedState=y;var T={value:y,getSnapshot:h};return E.queue=T,AE(kE.bind(null,_,T,d),[d]),_.flags|=2048,bp(9,_E.bind(null,_,T,y,h),void 0,null),y},useId:function(){var d=Sa(),h=Sr.identifierPrefix;if(An){var y=gs,_=no;y=(_&~(1<<32-Di(_)-1)).toString(32)+y,h=":"+h+"R"+y,y=vp++,0W5&&(h.flags|=128,_=!0,Cp(E,!1),h.lanes=4194304)}else{if(!_)if(d=d0(T),d!==null){if(h.flags|=128,_=!0,d=d.updateQueue,d!==null&&(h.updateQueue=d,h.flags|=4),Cp(E,!0),E.tail===null&&E.tailMode==="hidden"&&!T.alternate&&!An)return Vr(h),null}else 2*Ln()-E.renderingStartTime>W5&&y!==1073741824&&(h.flags|=128,_=!0,Cp(E,!1),h.lanes=4194304);E.isBackwards?(T.sibling=h.child,h.child=T):(d=E.last,d!==null?d.sibling=T:h.child=T,E.last=T)}return E.tail!==null?(h=E.tail,E.rendering=h,E.tail=h.sibling,E.renderingStartTime=Ln(),h.sibling=null,d=Rn.current,en(Rn,_?d&1|2:d&1),h):(Vr(h),null);case 22:case 23:return X5(),y=h.memoizedState!==null,d!==null&&d.memoizedState!==null!==y&&(h.flags|=8192),y&&h.mode&1?Bi&1073741824&&(Vr(h),Ze&&h.subtreeFlags&6&&(h.flags|=8192)):Vr(h),null;case 24:return null;case 25:return null}throw Error(a(156,h.tag))}function Kq(d,h){switch(t5(h),h.tag){case 1:return zr(h.type)&&vd(),d=h.flags,d&65536?(h.flags=d&-65537|128,h):null;case 3:return Td(),on(Fr),on(gr),g5(),d=h.flags,d&65536&&!(d&128)?(h.flags=d&-65537|128,h):null;case 5:return p5(h),null;case 13:if(on(Rn),d=h.memoizedState,d!==null&&d.dehydrated!==null){if(h.alternate===null)throw Error(a(340));xd()}return d=h.flags,d&65536?(h.flags=d&-65537|128,h):null;case 19:return on(Rn),null;case 4:return Td(),null;case 10:return s5(h.type._context),null;case 22:case 23:return X5(),null;case 24:return null;default:return null}}var w0=!1,Ur=!1,Yq=typeof WeakSet=="function"?WeakSet:Set,je=null;function Ad(d,h){var y=d.ref;if(y!==null)if(typeof y=="function")try{y(null)}catch(_){On(d,h,_)}else y.current=null}function I5(d,h,y){try{y()}catch(_){On(d,h,_)}}var aP=!1;function qq(d,h){for(W(d.containerInfo),je=h;je!==null;)if(d=je,h=d.child,(d.subtreeFlags&1028)!==0&&h!==null)h.return=d,je=h;else for(;je!==null;){d=je;try{var y=d.alternate;if(d.flags&1024)switch(d.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var _=y.memoizedProps,E=y.memoizedState,T=d.stateNode,F=T.getSnapshotBeforeUpdate(d.elementType===d.type?_:No(d.type,_),E);T.__reactInternalSnapshotBeforeUpdate=F}break;case 3:Ze&&pa(d.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(a(163))}}catch(Q){On(d,d.return,Q)}if(h=d.sibling,h!==null){h.return=d.return,je=h;break}je=d.return}return y=aP,aP=!1,y}function xp(d,h,y){var _=h.updateQueue;if(_=_!==null?_.lastEffect:null,_!==null){var E=_=_.next;do{if((E.tag&d)===d){var T=E.destroy;E.destroy=void 0,T!==void 0&&I5(h,y,T)}E=E.next}while(E!==_)}}function C0(d,h){if(h=h.updateQueue,h=h!==null?h.lastEffect:null,h!==null){var y=h=h.next;do{if((y.tag&d)===d){var _=y.create;y.destroy=_()}y=y.next}while(y!==h)}}function R5(d){var h=d.ref;if(h!==null){var y=d.stateNode;switch(d.tag){case 5:d=U(y);break;default:d=y}typeof h=="function"?h(d):h.current=d}}function sP(d){var h=d.alternate;h!==null&&(d.alternate=null,sP(h)),d.child=null,d.deletions=null,d.sibling=null,d.tag===5&&(h=d.stateNode,h!==null&&Je(h)),d.stateNode=null,d.return=null,d.dependencies=null,d.memoizedProps=null,d.memoizedState=null,d.pendingProps=null,d.stateNode=null,d.updateQueue=null}function lP(d){return d.tag===5||d.tag===3||d.tag===4}function uP(d){e:for(;;){for(;d.sibling===null;){if(d.return===null||lP(d.return))return null;d=d.return}for(d.sibling.return=d.return,d=d.sibling;d.tag!==5&&d.tag!==6&&d.tag!==18;){if(d.flags&2||d.child===null||d.tag===4)continue e;d.child.return=d,d=d.child}if(!(d.flags&2))return d.stateNode}}function $5(d,h,y){var _=d.tag;if(_===5||_===6)d=d.stateNode,h?Ee(y,d,h):lt(y,d);else if(_!==4&&(d=d.child,d!==null))for($5(d,h,y),d=d.sibling;d!==null;)$5(d,h,y),d=d.sibling}function D5(d,h,y){var _=d.tag;if(_===5||_===6)d=d.stateNode,h?Ut(y,d,h):me(y,d);else if(_!==4&&(d=d.child,d!==null))for(D5(d,h,y),d=d.sibling;d!==null;)D5(d,h,y),d=d.sibling}var Tr=null,Bo=!1;function Ca(d,h,y){for(y=y.child;y!==null;)N5(d,h,y),y=y.sibling}function N5(d,h,y){if(to&&typeof to.onCommitFiberUnmount=="function")try{to.onCommitFiberUnmount(Cd,y)}catch(Q){}switch(y.tag){case 5:Ur||Ad(y,h);case 6:if(Ze){var _=Tr,E=Bo;Tr=null,Ca(d,h,y),Tr=_,Bo=E,Tr!==null&&(Bo?Ge(Tr,y.stateNode):tt(Tr,y.stateNode))}else Ca(d,h,y);break;case 18:Ze&&Tr!==null&&(Bo?K4(Tr,y.stateNode):G4(Tr,y.stateNode));break;case 4:Ze?(_=Tr,E=Bo,Tr=y.stateNode.containerInfo,Bo=!0,Ca(d,h,y),Tr=_,Bo=E):(et&&(_=y.stateNode.containerInfo,E=ma(_),np(_,E)),Ca(d,h,y));break;case 0:case 11:case 14:case 15:if(!Ur&&(_=y.updateQueue,_!==null&&(_=_.lastEffect,_!==null))){E=_=_.next;do{var T=E,F=T.destroy;T=T.tag,F!==void 0&&(T&2||T&4)&&I5(y,h,F),E=E.next}while(E!==_)}Ca(d,h,y);break;case 1:if(!Ur&&(Ad(y,h),_=y.stateNode,typeof _.componentWillUnmount=="function"))try{_.props=y.memoizedProps,_.state=y.memoizedState,_.componentWillUnmount()}catch(Q){On(y,h,Q)}Ca(d,h,y);break;case 21:Ca(d,h,y);break;case 22:y.mode&1?(Ur=(_=Ur)||y.memoizedState!==null,Ca(d,h,y),Ur=_):Ca(d,h,y);break;default:Ca(d,h,y)}}function cP(d){var h=d.updateQueue;if(h!==null){d.updateQueue=null;var y=d.stateNode;y===null&&(y=d.stateNode=new Yq),h.forEach(function(_){var E=iX.bind(null,d,_);y.has(_)||(y.add(_),_.then(E,E))})}}function Fo(d,h){var y=h.deletions;if(y!==null)for(var _=0;_";case _0:return":has("+(z5(d)||"")+")";case k0:return'[role="'+d.value+'"]';case P0:return'"'+d.value+'"';case E0:return'[data-testname="'+d.value+'"]';default:throw Error(a(365))}}function gP(d,h){var y=[];d=[d,0];for(var _=0;_E&&(E=F),_&=~T}if(_=E,_=Ln()-_,_=(120>_?120:480>_?480:1080>_?1080:1920>_?1920:3e3>_?3e3:4320>_?4320:1960*Zq(_/1960))-_,10<_){d.timeoutHandle=De(ju.bind(null,d,bi,bs),_);break}ju(d,bi,bs);break;case 5:ju(d,bi,bs);break;default:throw Error(a(329))}}}return Si(d,Ln()),d.callbackNode===y?vP.bind(null,d):null}function Y5(d,h){var y=Ep;return d.current.memoizedState.isDehydrated&&(zu(d,h).flags|=256),d=$0(d,h),d!==2&&(h=bi,bi=y,h!==null&&q5(h)),d}function q5(d){bi===null?bi=d:bi.push.apply(bi,d)}function Qq(d){for(var h=d;;){if(h.flags&16384){var y=h.updateQueue;if(y!==null&&(y=y.stores,y!==null))for(var _=0;_d?16:d,fl===null)var _=!1;else{if(d=fl,fl=null,M0=0,yt&6)throw Error(a(331));var E=yt;for(yt|=4,je=d.current;je!==null;){var T=je,F=T.child;if(je.flags&16){var Q=T.deletions;if(Q!==null){for(var ae=0;aeLn()-U5?zu(d,0):V5|=y),Si(d,h)}function kP(d,h){h===0&&(d.mode&1?(h=Iu,Iu<<=1,!(Iu&130023424)&&(Iu=4194304)):h=1);var y=Wr();d=ya(d,h),d!==null&&(va(d,h,y),Si(d,y))}function rX(d){var h=d.memoizedState,y=0;h!==null&&(y=h.retryLane),kP(d,y)}function iX(d,h){var y=0;switch(d.tag){case 13:var _=d.stateNode,E=d.memoizedState;E!==null&&(y=E.retryLane);break;case 19:_=d.stateNode;break;default:throw Error(a(314))}_!==null&&_.delete(h),kP(d,y)}var EP;EP=function(d,h,y){if(d!==null)if(d.memoizedProps!==h.pendingProps||Fr.current)yi=!0;else{if(!(d.lanes&y)&&!(h.flags&128))return yi=!1,Wq(d,h,y);yi=!!(d.flags&131072)}else yi=!1,An&&h.flags&1048576&&rE(h,vr,h.index);switch(h.lanes=0,h.tag){case 2:var _=h.type;y0(d,h),d=h.pendingProps;var E=sl(h,gr.current);kd(h,y),E=b5(null,h,_,d,E,y);var T=S5();return h.flags|=1,typeof E=="object"&&E!==null&&typeof E.render=="function"&&E.$$typeof===void 0?(h.tag=1,h.memoizedState=null,h.updateQueue=null,zr(_)?(T=!0,ll(h)):T=!1,h.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,c5(h),E.updater=u0,h.stateNode=E,E._reactInternals=h,f5(h,_,d,y),h=T5(null,h,_,!0,T,y)):(h.tag=0,An&&T&&e5(h),ii(null,h,E,y),h=h.child),h;case 16:_=h.elementType;e:{switch(y0(d,h),d=h.pendingProps,E=_._init,_=E(_._payload),h.type=_,E=h.tag=aX(_),d=No(_,d),E){case 0:h=P5(null,h,_,d,y);break e;case 1:h=QE(null,h,_,d,y);break e;case 11:h=KE(null,h,_,d,y);break e;case 14:h=YE(null,h,_,No(_.type,d),y);break e}throw Error(a(306,_,""))}return h;case 0:return _=h.type,E=h.pendingProps,E=h.elementType===_?E:No(_,E),P5(d,h,_,E,y);case 1:return _=h.type,E=h.pendingProps,E=h.elementType===_?E:No(_,E),QE(d,h,_,E,y);case 3:e:{if(JE(h),d===null)throw Error(a(387));_=h.pendingProps,T=h.memoizedState,E=T.element,cE(d,h),l0(h,_,null,y);var F=h.memoizedState;if(_=F.element,nt&&T.isDehydrated)if(T={element:_,isDehydrated:!1,cache:F.cache,pendingSuspenseBoundaries:F.pendingSuspenseBoundaries,transitions:F.transitions},h.updateQueue.baseState=T,h.memoizedState=T,h.flags&256){E=Ld(Error(a(423)),h),h=eP(d,h,_,y,E);break e}else if(_!==E){E=Ld(Error(a(424)),h),h=eP(d,h,_,y,E);break e}else for(nt&&(ro=F4(h.stateNode.containerInfo),Ni=h,An=!0,Do=null,fp=!1),y=bE(h,null,_,y),h.child=y;y;)y.flags=y.flags&-3|4096,y=y.sibling;else{if(xd(),_===E){h=ys(d,h,y);break e}ii(d,h,_,y)}h=h.child}return h;case 5:return SE(h),d===null&&r5(h),_=h.type,E=h.pendingProps,T=d!==null?d.memoizedProps:null,F=E.children,Ae(_,E)?F=null:T!==null&&Ae(_,T)&&(h.flags|=32),ZE(d,h),ii(d,h,F,y),h.child;case 6:return d===null&&r5(h),null;case 13:return tP(d,h,y);case 4:return h5(h,h.stateNode.containerInfo),_=h.pendingProps,d===null?h.child=Ed(h,null,_,y):ii(d,h,_,y),h.child;case 11:return _=h.type,E=h.pendingProps,E=h.elementType===_?E:No(_,E),KE(d,h,_,E,y);case 7:return ii(d,h,h.pendingProps,y),h.child;case 8:return ii(d,h,h.pendingProps.children,y),h.child;case 12:return ii(d,h,h.pendingProps.children,y),h.child;case 10:e:{if(_=h.type._context,E=h.pendingProps,T=h.memoizedProps,F=E.value,lE(h,_,F),T!==null)if(H(T.value,F)){if(T.children===E.children&&!Fr.current){h=ys(d,h,y);break e}}else for(T=h.child,T!==null&&(T.return=h);T!==null;){var Q=T.dependencies;if(Q!==null){F=T.child;for(var ae=Q.firstContext;ae!==null;){if(ae.context===_){if(T.tag===1){ae=vs(-1,y&-y),ae.tag=2;var _e=T.updateQueue;if(_e!==null){_e=_e.shared;var Ke=_e.pending;Ke===null?ae.next=ae:(ae.next=Ke.next,Ke.next=ae),_e.pending=ae}}T.lanes|=y,ae=T.alternate,ae!==null&&(ae.lanes|=y),l5(T.return,y,h),Q.lanes|=y;break}ae=ae.next}}else if(T.tag===10)F=T.type===h.type?null:T.child;else if(T.tag===18){if(F=T.return,F===null)throw Error(a(341));F.lanes|=y,Q=F.alternate,Q!==null&&(Q.lanes|=y),l5(F,y,h),F=T.sibling}else F=T.child;if(F!==null)F.return=T;else for(F=T;F!==null;){if(F===h){F=null;break}if(T=F.sibling,T!==null){T.return=F.return,F=T;break}F=F.return}T=F}ii(d,h,E.children,y),h=h.child}return h;case 9:return E=h.type,_=h.pendingProps.children,kd(h,y),E=io(E),_=_(E),h.flags|=1,ii(d,h,_,y),h.child;case 14:return _=h.type,E=No(_,h.pendingProps),E=No(_.type,E),YE(d,h,_,E,y);case 15:return qE(d,h,h.type,h.pendingProps,y);case 17:return _=h.type,E=h.pendingProps,E=h.elementType===_?E:No(_,E),y0(d,h),h.tag=1,zr(_)?(d=!0,ll(h)):d=!1,kd(h,y),mE(h,_,E),f5(h,_,E,y),T5(null,h,_,!0,d,y);case 19:return rP(d,h,y);case 22:return XE(d,h,y)}throw Error(a(156,h.tag))};function PP(d,h){return Sd(d,h)}function oX(d,h,y,_){this.tag=d,this.key=y,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=h,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=_,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function lo(d,h,y,_){return new oX(d,h,y,_)}function Q5(d){return d=d.prototype,!(!d||!d.isReactComponent)}function aX(d){if(typeof d=="function")return Q5(d)?1:0;if(d!=null){if(d=d.$$typeof,d===v)return 11;if(d===w)return 14}return 2}function ml(d,h){var y=d.alternate;return y===null?(y=lo(d.tag,h,d.key,d.mode),y.elementType=d.elementType,y.type=d.type,y.stateNode=d.stateNode,y.alternate=d,d.alternate=y):(y.pendingProps=h,y.type=d.type,y.flags=0,y.subtreeFlags=0,y.deletions=null),y.flags=d.flags&14680064,y.childLanes=d.childLanes,y.lanes=d.lanes,y.child=d.child,y.memoizedProps=d.memoizedProps,y.memoizedState=d.memoizedState,y.updateQueue=d.updateQueue,h=d.dependencies,y.dependencies=h===null?null:{lanes:h.lanes,firstContext:h.firstContext},y.sibling=d.sibling,y.index=d.index,y.ref=d.ref,y}function D0(d,h,y,_,E,T){var F=2;if(_=d,typeof d=="function")Q5(d)&&(F=1);else if(typeof d=="string")F=5;else e:switch(d){case c:return Vu(y.children,E,T,h);case f:F=8,E|=8;break;case p:return d=lo(12,y,h,E|2),d.elementType=p,d.lanes=T,d;case x:return d=lo(13,y,h,E),d.elementType=x,d.lanes=T,d;case C:return d=lo(19,y,h,E),d.elementType=C,d.lanes=T,d;case P:return N0(y,E,T,h);default:if(typeof d=="object"&&d!==null)switch(d.$$typeof){case m:F=10;break e;case g:F=9;break e;case v:F=11;break e;case w:F=14;break e;case k:F=16,_=null;break e}throw Error(a(130,d==null?d:typeof d,""))}return h=lo(F,y,h,E),h.elementType=d,h.type=_,h.lanes=T,h}function Vu(d,h,y,_){return d=lo(7,d,_,h),d.lanes=y,d}function N0(d,h,y,_){return d=lo(22,d,_,h),d.elementType=P,d.lanes=y,d.stateNode={isHidden:!1},d}function J5(d,h,y){return d=lo(6,d,null,h),d.lanes=y,d}function eS(d,h,y){return h=lo(4,d.children!==null?d.children:[],d.key,h),h.lanes=y,h.stateNode={containerInfo:d.containerInfo,pendingChildren:null,implementation:d.implementation},h}function sX(d,h,y,_,E){this.tag=h,this.containerInfo=d,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Xe,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=lp(0),this.expirationTimes=lp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=lp(0),this.identifierPrefix=_,this.onRecoverableError=E,nt&&(this.mutableSourceEagerHydrationData=null)}function TP(d,h,y,_,E,T,F,Q,ae){return d=new sX(d,h,y,Q,ae),h===1?(h=1,T===!0&&(h|=8)):h=0,T=lo(3,null,null,h),d.current=T,T.stateNode=d,T.memoizedState={element:_,isDehydrated:y,cache:null,transitions:null,pendingSuspenseBoundaries:null},c5(T),d}function LP(d){if(!d)return ga;d=d._reactInternals;e:{if($(d)!==d||d.tag!==1)throw Error(a(170));var h=d;do{switch(h.tag){case 3:h=h.stateNode.context;break e;case 1:if(zr(h.type)){h=h.stateNode.__reactInternalMemoizedMergedChildContext;break e}}h=h.return}while(h!==null);throw Error(a(171))}if(d.tag===1){var y=d.type;if(zr(y))return Mu(d,y,h)}return h}function AP(d){var h=d._reactInternals;if(h===void 0)throw typeof d.render=="function"?Error(a(188)):(d=Object.keys(d).join(","),Error(a(268,d)));return d=Y(h),d===null?null:d.stateNode}function OP(d,h){if(d=d.memoizedState,d!==null&&d.dehydrated!==null){var y=d.retryLane;d.retryLane=y!==0&&y=_e&&T>=dt&&E<=Ke&&F<=Be){d.splice(h,1);break}else if(_!==_e||y.width!==ae.width||BeF){if(!(T!==dt||y.height!==ae.height||Ke<_||_e>E)){_e>_&&(ae.width+=_e-_,ae.x=_),KeT&&(ae.height+=dt-T,ae.y=T),Bey&&(y=F)),F ")+` - -No matching component was found for: - `)+d.join(" > ")}return null},n.getPublicRootInstance=function(d){if(d=d.current,!d.child)return null;switch(d.child.tag){case 5:return U(d.child.stateNode);default:return d.child.stateNode}},n.injectIntoDevTools=function(d){if(d={bundleType:d.bundleType,version:d.version,rendererPackageName:d.rendererPackageName,rendererConfig:d.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:s.ReactCurrentDispatcher,findHostInstanceByFiber:lX,findFiberByHostInstance:d.findFiberByHostInstance||uX,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")d=!1;else{var h=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(h.isDisabled||!h.supportsFiber)d=!0;else{try{Cd=h.inject(d),to=h}catch(y){}d=!!h.checkDCE}}return d},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(d,h,y,_){if(!J)throw Error(a(363));d=j5(d,h);var E=mt(d,y,_).disconnect;return{disconnect:function(){E()}}},n.registerMutableSourceForHydration=function(d,h){var y=h._getVersion;y=y(h._source),d.mutableSourceEagerHydrationData==null?d.mutableSourceEagerHydrationData=[h,y]:d.mutableSourceEagerHydrationData.push(h,y)},n.runWithPriority=function(d,h){var y=Ct;try{return Ct=d,h()}finally{Ct=y}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(d,h,y,_){var E=h.current,T=Wr(),F=hl(E);return y=LP(y),h.context===null?h.context=y:h.pendingContext=y,h=vs(T,F),h.payload={element:d},_=_===void 0?null:_,_!==null&&(h.callback=_),d=cl(E,h,F),d!==null&&(so(d,E,F,T),s0(d,E,F)),F},n};(function(e){e.exports=LFe})(TFe);const AFe=M7(g7);var gb={},OFe={get exports(){return gb},set exports(e){gb=e}},ud={};/** - * @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. - */ud.ConcurrentRoot=1;ud.ContinuousEventPriority=4;ud.DefaultEventPriority=16;ud.DiscreteEventPriority=1;ud.IdleEventPriority=536870912;ud.LegacyRoot=0;(function(e){e.exports=ud})(OFe);const l$={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let u$=!1,c$=!1;const Bk=".react-konva-event",MFe=`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 -`,IFe=`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 -`,RFe={};function k4(e,t,n=RFe){if(!u$&&"zIndex"in t&&(console.warn(IFe),u$=!0),!c$&&t.draggable){var r=t.x!==void 0||t.y!==void 0,i=t.onDragEnd||t.onDragMove;r&&!i&&(console.warn(MFe),c$=!0)}for(var o in n)if(!l$[o]){var a=o.slice(0,2)==="on",s=n[o]!==t[o];if(a&&s){var l=o.substr(2).toLowerCase();l.substr(0,7)==="content"&&(l="content"+l.substr(7,1).toUpperCase()+l.substr(8)),e.off(l,n[o])}var u=!t.hasOwnProperty(o);u&&e.setAttr(o,void 0)}var c=t._useStrictMode,f={},p=!1;const m={};for(var o in t)if(!l$[o]){var a=o.slice(0,2)==="on",g=n[o]!==t[o];if(a&&g){var l=o.substr(2).toLowerCase();l.substr(0,7)==="content"&&(l="content"+l.substr(7,1).toUpperCase()+l.substr(8)),t[o]&&(m[l]=t[o])}!a&&(t[o]!==n[o]||c&&t[o]!==e.getAttr(o))&&(p=!0,f[o]=t[o])}p&&(e.setAttrs(f),Tu(e));for(var l in m)e.on(l+Bk,m[l])}function Tu(e){if(!Ve.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const _Y={},$Fe={};Hc.Node.prototype._applyProps=k4;function DFe(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),Tu(e)}function NFe(e,t,n){let r=Hc[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=Hc.Group);const i={},o={};for(var a in t){var s=a.slice(0,2)==="on";s?o[a]=t[a]:i[a]=t[a]}const l=new r(i);return k4(l,o),l}function BFe(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function FFe(e,t,n){return!1}function zFe(e){return e}function jFe(){return null}function HFe(){return null}function VFe(e,t,n,r){return $Fe}function UFe(){}function WFe(e){}function GFe(e,t){return!1}function KFe(){return _Y}function YFe(){return _Y}const qFe=setTimeout,XFe=clearTimeout,ZFe=-1;function QFe(e,t){return!1}const JFe=!1,eze=!0,tze=!0;function nze(e,t){t.parent===e?t.moveToTop():e.add(t),Tu(e)}function rze(e,t){t.parent===e?t.moveToTop():e.add(t),Tu(e)}function kY(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),Tu(e)}function ize(e,t,n){kY(e,t,n)}function oze(e,t){t.destroy(),t.off(Bk),Tu(e)}function aze(e,t){t.destroy(),t.off(Bk),Tu(e)}function sze(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function lze(e,t,n){}function uze(e,t,n,r,i){k4(e,i,r)}function cze(e){e.hide(),Tu(e)}function dze(e){}function fze(e,t){(t.visible==null||t.visible)&&e.show()}function hze(e,t){}function pze(e){}function mze(){}const gze=()=>gb.DefaultEventPriority,vze=Object.freeze(Object.defineProperty({__proto__:null,appendChild:nze,appendChildToContainer:rze,appendInitialChild:DFe,cancelTimeout:XFe,clearContainer:pze,commitMount:lze,commitTextUpdate:sze,commitUpdate:uze,createInstance:NFe,createTextInstance:BFe,detachDeletedInstance:mze,finalizeInitialChildren:FFe,getChildHostContext:YFe,getCurrentEventPriority:gze,getPublicInstance:zFe,getRootHostContext:KFe,hideInstance:cze,hideTextInstance:dze,idlePriority:Ec.unstable_IdlePriority,insertBefore:kY,insertInContainerBefore:ize,isPrimaryRenderer:JFe,noTimeout:ZFe,now:Ec.unstable_now,prepareForCommit:jFe,preparePortalMount:HFe,prepareUpdate:VFe,removeChild:oze,removeChildFromContainer:aze,resetAfterCommit:UFe,resetTextContent:WFe,run:Ec.unstable_runWithPriority,scheduleTimeout:qFe,shouldDeprioritizeSubtree:GFe,shouldSetTextContent:QFe,supportsMutation:tze,unhideInstance:fze,unhideTextInstance:hze,warnsIfNotActing:eze},Symbol.toStringTag,{value:"Module"}));var yze=Object.defineProperty,bze=Object.defineProperties,Sze=Object.getOwnPropertyDescriptors,d$=Object.getOwnPropertySymbols,wze=Object.prototype.hasOwnProperty,Cze=Object.prototype.propertyIsEnumerable,f$=(e,t,n)=>t in e?yze(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,h$=(e,t)=>{for(var n in t||(t={}))wze.call(t,n)&&f$(e,n,t[n]);if(d$)for(var n of d$(t))Cze.call(t,n)&&f$(e,n,t[n]);return e},xze=(e,t)=>bze(e,Sze(t));function Fk(e,t,n){if(!e)return;if(n(e)===!0)return e;let r=t?e.return:e.child;for(;r;){const i=Fk(r,t,n);if(i)return i;r=t?null:r.sibling}}function EY(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch(t){return e}}const zk=EY(S.createContext(null));class PY extends S.Component{render(){return S.createElement(zk.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:_ze,ReactCurrentDispatcher:kze}=S.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function Eze(){const e=S.useContext(zk);if(!e)throw new Error("its-fine: useFiber must be called within a !");const t=S.useId();return S.useMemo(()=>{var r;return(r=_ze.current)!=null?r:Fk(e,!1,i=>{let o=i.memoizedState;for(;o;){if(o.memoizedState===t)return!0;o=o.next}})},[e,t])}const nm=[],p$=new WeakMap;function Pze(){var e;const t=Eze();nm.splice(0,nm.length),Fk(t,!0,n=>{var r;const i=(r=n.type)==null?void 0:r._context;i&&i!==zk&&nm.push(EY(i))});for(const n of nm){const r=(e=kze.current)==null?void 0:e.readContext(n);p$.set(n,r)}return S.useMemo(()=>nm.reduce((n,r)=>i=>S.createElement(n,null,S.createElement(r.Provider,xze(h$({},i),{value:p$.get(r)}))),n=>S.createElement(PY,h$({},n))),[])}function Tze(e){const t=M.useRef();return M.useLayoutEffect(()=>{t.current=e}),t.current}const Lze=e=>{const t=M.useRef(),n=M.useRef(),r=M.useRef(),i=Tze(e),o=Pze(),a=s=>{const{forwardedRef:l}=e;l&&(typeof l=="function"?l(s):l.current=s)};return M.useLayoutEffect(()=>(n.current=new Hc.Stage({width:e.width,height:e.height,container:t.current}),a(n.current),r.current=Cm.createContainer(n.current,gb.LegacyRoot,!1,null),Cm.updateContainer(M.createElement(o,{},e.children),r.current),()=>{Hc.isBrowser&&(a(null),Cm.updateContainer(null,r.current,null),n.current.destroy())}),[]),M.useLayoutEffect(()=>{a(n.current),k4(n.current,e,i),Cm.updateContainer(M.createElement(o,{},e.children),r.current,null)}),M.createElement("div",{ref:t,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},rm="Layer",Gs="Group",Ks="Rect",Yu="Circle",vb="Line",TY="Image",Aze="Transformer",Cm=AFe(vze);Cm.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:M.version,rendererPackageName:"react-konva"});const Oze=M.forwardRef((e,t)=>M.createElement(PY,{},M.createElement(Lze,{...e,forwardedRef:t}))),Mze=Fe([Et,Wn],(e,t)=>{const{tool:n,isMovingBoundingBox:r}=e;return{tool:n,isStaging:t,isMovingBoundingBox:r}},{memoizeOptions:{resultEqualityCheck:Ue}}),Ize=()=>{const e=ge(),{tool:t,isStaging:n,isMovingBoundingBox:r}=ne(Mze);return{handleDragStart:S.useCallback(()=>{(t==="move"||n)&&!r&&e(Qy(!0))},[e,r,n,t]),handleDragMove:S.useCallback(i=>{if(!((t==="move"||n)&&!r))return;const o={x:i.target.x(),y:i.target.y()};e(FU(o))},[e,r,n,t]),handleDragEnd:S.useCallback(()=>{(t==="move"||n)&&!r&&e(Qy(!1))},[e,r,n,t])}},Rze=Fe([Et,Un,Wn],(e,t,n)=>{const{cursorPosition:r,shouldLockBoundingBox:i,shouldShowBoundingBox:o,tool:a,isMaskEnabled:s,shouldSnapToGrid:l}=e;return{activeTabName:t,isCursorOnCanvas:Boolean(r),shouldLockBoundingBox:i,shouldShowBoundingBox:o,tool:a,isStaging:n,isMaskEnabled:s,shouldSnapToGrid:l}},{memoizeOptions:{resultEqualityCheck:Ue}}),$ze=()=>{const e=ge(),{activeTabName:t,shouldShowBoundingBox:n,tool:r,isStaging:i,isMaskEnabled:o,shouldSnapToGrid:a}=ne(Rze),s=S.useRef(null),l=TG(),u=()=>e(R_());Re(["shift+c"],()=>{u()},{enabled:()=>!i,preventDefault:!0},[]);const c=()=>e(L1(!o));Re(["h"],()=>{c()},{enabled:()=>!i,preventDefault:!0},[o]),Re(["n"],()=>{e(eb(!a))},{enabled:!0,preventDefault:!0},[a]),Re("esc",()=>{e(h9e())},{enabled:()=>!0,preventDefault:!0}),Re("shift+h",()=>{e(S9e(!n))},{enabled:()=>!i,preventDefault:!0},[t,n]),Re(["space"],f=>{f.repeat||(l==null||l.container().focus(),r!=="move"&&(s.current=r,e(Za("move"))),r==="move"&&s.current&&s.current!=="move"&&(e(Za(s.current)),s.current="move"))},{keyup:!0,keydown:!0,preventDefault:!0},[r,s])},jk=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}},LY=()=>{const e=ge(),t=ca(),n=TG();return{updateColorUnderCursor:()=>{if(!n||!t)return;const r=n.getPointerPosition();if(!r)return;const i=Jd.pixelRatio,[o,a,s,l]=t.getContext().getImageData(r.x*i,r.y*i,1,1).data;e(v9e({r:o,g:a,b:s,a:l}))},commitColorUnderCursor:()=>{e(a9e())}}},Dze=Fe([Un,Et,Wn],(e,t,n)=>{const{tool:r}=t;return{tool:r,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:Ue}}),Nze=e=>{const t=ge(),{tool:n,isStaging:r}=ne(Dze),{commitColorUnderCursor:i}=LY();return S.useCallback(o=>{if(!e.current)return;if(e.current.container().focus(),n==="move"||r){t(Qy(!0));return}if(n==="colorPicker"){i();return}const a=jk(e.current);a&&(o.evt.preventDefault(),t(AU(!0)),t(o9e([a.x,a.y])))},[e,n,r,t,i])},Bze=Fe([Un,Et,Wn],(e,t,n)=>{const{tool:r,isDrawing:i}=t;return{tool:r,isDrawing:i,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:Ue}}),Fze=(e,t,n)=>{const r=ge(),{isDrawing:i,tool:o,isStaging:a}=ne(Bze),{updateColorUnderCursor:s}=LY();return S.useCallback(()=>{if(!e.current)return;const l=jk(e.current);if(l){if(r(y9e(l)),n.current=l,o==="colorPicker"){s();return}!i||o==="move"||a||(t.current=!0,r(PU([l.x,l.y])))}},[t,r,i,a,n,e,o,s])},zze=()=>{const e=ge();return S.useCallback(()=>{e(u9e())},[e])},jze=Fe([Un,Et,Wn],(e,t,n)=>{const{tool:r,isDrawing:i}=t;return{tool:r,isDrawing:i,activeTabName:e,isStaging:n}},{memoizeOptions:{resultEqualityCheck:Ue}}),Hze=(e,t)=>{const n=ge(),{tool:r,isDrawing:i,isStaging:o}=ne(jze);return S.useCallback(()=>{if(r==="move"||o){n(Qy(!1));return}if(!t.current&&i&&e.current){const a=jk(e.current);if(!a)return;n(PU([a.x,a.y]))}else t.current=!1;n(AU(!1))},[t,n,i,o,e,r])},Vze=Fe([Et],e=>{const{isMoveStageKeyHeld:t,stageScale:n}=e;return{isMoveStageKeyHeld:t,stageScale:n}},{memoizeOptions:{resultEqualityCheck:Ue}}),Uze=e=>{const t=ge(),{isMoveStageKeyHeld:n,stageScale:r}=ne(Vze);return S.useCallback(i=>{if(!e.current||n)return;i.evt.preventDefault();const o=e.current.getPointerPosition();if(!o)return;const a={x:(o.x-e.current.x())/r,y:(o.y-e.current.y())/r};let s=i.evt.deltaY;i.evt.ctrlKey&&(s=-s);const l=ti(r*Y7e**s,q7e,X7e),u={x:o.x-a.x*l,y:o.y-a.y*l};t(C9e(l)),t(FU(u))},[e,n,r,t])},Wze=Fe(Et,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageDimensions:r,stageScale:i,shouldDarkenOutsideBoundingBox:o,stageCoordinates:a}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,shouldDarkenOutsideBoundingBox:o,stageCoordinates:a,stageDimensions:r,stageScale:i}},{memoizeOptions:{resultEqualityCheck:Ue}}),Gze=()=>{const{boundingBoxCoordinates:e,boundingBoxDimensions:t,shouldDarkenOutsideBoundingBox:n,stageCoordinates:r,stageDimensions:i,stageScale:o}=ne(Wze);return j(Gs,{children:[b(Ks,{offsetX:r.x/o,offsetY:r.y/o,height:i.height/o,width:i.width/o,fill:"rgba(0,0,0,0.4)",listening:!1,visible:n}),b(Ks,{x:e.x,y:e.y,width:t.width,height:t.height,fill:"rgb(255,255,255)",listening:!1,visible:n,globalCompositeOperation:"destination-out"})]})};var Kze=Math.ceil,Yze=Math.max;function qze(e,t,n,r){for(var i=-1,o=Yze(Kze((t-e)/(n||1)),0),a=Array(o);o--;)a[r?o:++i]=e,e+=n;return a}var Xze=qze,Zze=V3,Qze=P1,Jze=E1,eje=us;function tje(e,t,n){if(!eje(n))return!1;var r=typeof t;return(r=="number"?Qze(n)&&Jze(t,n.length):r=="string"&&t in n)?Zze(n[t],e):!1}var nje=tje,rje=C_,m$=1/0,ije=17976931348623157e292;function oje(e){if(!e)return e===0?e:0;if(e=rje(e),e===m$||e===-m$){var t=e<0?-1:1;return t*ije}return e===e?e:0}var aje=oje,sje=Xze,lje=nje,r6=aje;function uje(e){return function(t,n,r){return r&&typeof r!="number"&&lje(t,n,r)&&(n=r=void 0),t=r6(t),n===void 0?(n=t,t=0):n=r6(n),r=r===void 0?t{const{stageScale:t,stageCoordinates:n,stageDimensions:r}=e;return{stageScale:t,stageCoordinates:n,stageDimensions:r}},{memoizeOptions:{resultEqualityCheck:Ue}}),pje={dark:"rgba(255, 255, 255, 0.2)",green:"rgba(255, 255, 255, 0.2)",light:"rgba(0, 0, 0, 0.2)"},mje=()=>{const{colorMode:e}=t1(),{stageScale:t,stageCoordinates:n,stageDimensions:r}=ne(hje),[i,o]=S.useState([]),a=S.useCallback(s=>s/t,[t]);return S.useLayoutEffect(()=>{const s=pje[e],{width:l,height:u}=r,{x:c,y:f}=n,p={x1:0,y1:0,x2:l,y2:u,offset:{x:a(c),y:a(f)}},m={x:Math.ceil(a(c)/64)*64,y:Math.ceil(a(f)/64)*64},g={x1:-m.x,y1:-m.y,x2:a(l)-m.x+64,y2:a(u)-m.y+64},x={x1:Math.min(p.x1,g.x1),y1:Math.min(p.y1,g.y1),x2:Math.max(p.x2,g.x2),y2:Math.max(p.y2,g.y2)},C=x.x2-x.x1,w=x.y2-x.y1,k=Math.round(C/64)+1,P=Math.round(w/64)+1,L=g$(0,k).map(O=>b(vb,{x:x.x1+O*64,y:x.y1,points:[0,0,0,w],stroke:s,strokeWidth:1},`x_${O}`)),A=g$(0,P).map(O=>b(vb,{x:x.x1,y:x.y1+O*64,points:[0,0,C,0],stroke:s,strokeWidth:1},`y_${O}`));o(L.concat(A))},[t,n,r,e,a]),b(Gs,{children:i})},gje=Fe([e=>e.gallery],e=>e.intermediateImage?e.intermediateImage:null,{memoizeOptions:{resultEqualityCheck:Ue}}),vje=e=>{const{...t}=e,n=ne(gje),[r,i]=S.useState(null);if(S.useEffect(()=>{if(!n)return;const u=new Image;u.onload=()=>{i(u)},u.src=n.url},[n]),!(n!=null&&n.boundingBox))return null;const{boundingBox:{x:o,y:a,width:s,height:l}}=n;return r?b(TY,{x:o,y:a,width:s,height:l,image:r,listening:!1,...t}):null},Ac=e=>{const{r:t,g:n,b:r,a:i}=e;return`rgba(${t}, ${n}, ${r}, ${i})`};var yje=jh,bje=Cu,Sje="[object Number]";function wje(e){return typeof e=="number"||bje(e)&&yje(e)==Sje}var Xd=wje;const Cje=Fe(Et,e=>{const{maskColor:t,stageCoordinates:n,stageDimensions:r,stageScale:i}=e;return{stageCoordinates:n,stageDimensions:r,stageScale:i,maskColorString:Ac(t)}}),v$=e=>`data:image/svg+xml;utf8, - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -`.replaceAll("black",e),xje=e=>{const{...t}=e,{maskColorString:n,stageCoordinates:r,stageDimensions:i,stageScale:o}=ne(Cje),[a,s]=S.useState(null),[l,u]=S.useState(0),c=S.useRef(null),f=S.useCallback(()=>{u(l+1),setTimeout(f,500)},[l]);return S.useEffect(()=>{if(a)return;const p=new Image;p.onload=()=>{s(p)},p.src=v$(n)},[a,n]),S.useEffect(()=>{a&&(a.src=v$(n))},[a,n]),S.useEffect(()=>{const p=setInterval(()=>u(m=>(m+1)%5),50);return()=>clearInterval(p)},[]),!a||!Xd(r.x)||!Xd(r.y)||!Xd(o)||!Xd(i.width)||!Xd(i.height)?null:b(Ks,{ref:c,offsetX:r.x/o,offsetY:r.y/o,height:i.height/o,width:i.width/o,fillPatternImage:a,fillPatternOffsetY:Xd(l)?l:0,fillPatternRepeat:"repeat",fillPatternScale:{x:1/o,y:1/o},listening:!0,globalCompositeOperation:"source-in",...t})},_je=Fe([Et],e=>({objects:e.layerState.objects}),{memoizeOptions:{resultEqualityCheck:Ue}}),kje=e=>{const{...t}=e,{objects:n}=ne(_je);return b(Gs,{listening:!1,...t,children:n.filter(I_).map((r,i)=>b(vb,{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"},i))})};var qu=S,Eje=function(t,n,r){const i=qu.useRef("loading"),o=qu.useRef(),[a,s]=qu.useState(0),l=qu.useRef(),u=qu.useRef(),c=qu.useRef();return(l.current!==t||u.current!==n||c.current!==r)&&(i.current="loading",o.current=void 0,l.current=t,u.current=n,c.current=r),qu.useLayoutEffect(function(){if(!t)return;var f=document.createElement("img");function p(){i.current="loaded",o.current=f,s(Math.random())}function m(){i.current="failed",o.current=void 0,s(Math.random())}return f.addEventListener("load",p),f.addEventListener("error",m),n&&(f.crossOrigin=n),r&&(f.referrerpolicy=r),f.src=t,function(){f.removeEventListener("load",p),f.removeEventListener("error",m)}},[t,n,r]),[o.current,i.current]};const AY=e=>{const{url:t,x:n,y:r}=e,[i]=Eje(t);return b(TY,{x:n,y:r,image:i,listening:!1})},Pje=Fe([Et],e=>{const{layerState:{objects:t}}=e;return{objects:t}},{memoizeOptions:{resultEqualityCheck:Ue}}),Tje=()=>{const{objects:e}=ne(Pje);return e?b(Gs,{name:"outpainting-objects",listening:!1,children:e.map((t,n)=>{if(Zy(t))return b(AY,{x:t.x,y:t.y,url:t.image.url},n);if(J7e(t)){const r=b(vb,{points:t.points,stroke:t.color?Ac(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?b(Gs,{clipX:t.clip.x,clipY:t.clip.y,clipWidth:t.clip.width,clipHeight:t.clip.height,children:r},n):r}else{if(e9e(t))return b(Ks,{x:t.x,y:t.y,width:t.width,height:t.height,fill:Ac(t.color)},n);if(t9e(t))return b(Ks,{x:t.x,y:t.y,width:t.width,height:t.height,fill:"rgb(255, 255, 255)",globalCompositeOperation:"destination-out"},n)}})}):null},Lje=Fe([Et],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingImage:r,shouldShowStagingOutline:i,boundingBoxCoordinates:{x:o,y:a},boundingBoxDimensions:{width:s,height:l}}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shouldShowStagingImage:r,shouldShowStagingOutline:i,x:o,y:a,width:s,height:l}},{memoizeOptions:{resultEqualityCheck:Ue}}),Aje=e=>{const{...t}=e,{currentStagingAreaImage:n,shouldShowStagingImage:r,shouldShowStagingOutline:i,x:o,y:a,width:s,height:l}=ne(Lje);return j(Gs,{...t,children:[r&&n&&b(AY,{url:n.image.url,x:o,y:a}),i&&j(Gs,{children:[b(Ks,{x:o,y:a,width:s,height:l,strokeWidth:1,stroke:"white",strokeScaleEnabled:!1}),b(Ks,{x:o,y:a,width:s,height:l,dash:[4,4],strokeWidth:1,stroke:"black",strokeScaleEnabled:!1})]})]})},Oje=Fe([Et],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingOutline:r,shouldShowStagingImage:i}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shouldShowStagingImage:i,shouldShowStagingOutline:r}},{memoizeOptions:{resultEqualityCheck:Ue}}),Mje=()=>{const e=ge(),{isOnFirstImage:t,isOnLastImage:n,currentStagingAreaImage:r,shouldShowStagingImage:i}=ne(Oje),{t:o}=Ce(),a=S.useCallback(()=>{e(OM(!0))},[e]),s=S.useCallback(()=>{e(OM(!1))},[e]);Re(["left"],()=>{l()},{enabled:()=>!0,preventDefault:!0}),Re(["right"],()=>{u()},{enabled:()=>!0,preventDefault:!0}),Re(["enter"],()=>{c()},{enabled:()=>!0,preventDefault:!0});const l=()=>e(d9e()),u=()=>e(c9e()),c=()=>e(s9e());return r?b(Le,{pos:"absolute",bottom:"1rem",w:"100%",align:"center",justify:"center",filter:"drop-shadow(0 0.5rem 1rem rgba(0,0,0))",onMouseOver:a,onMouseOut:s,children:j(Jr,{isAttached:!0,children:[b(Ie,{tooltip:`${o("unifiedcanvas:previous")} (Left)`,"aria-label":`${o("unifiedcanvas:previous")} (Left)`,icon:b(aRe,{}),onClick:l,"data-selected":!0,isDisabled:t}),b(Ie,{tooltip:`${o("unifiedcanvas:next")} (Right)`,"aria-label":`${o("unifiedcanvas:next")} (Right)`,icon:b(sRe,{}),onClick:u,"data-selected":!0,isDisabled:n}),b(Ie,{tooltip:`${o("unifiedcanvas:accept")} (Enter)`,"aria-label":`${o("unifiedcanvas:accept")} (Enter)`,icon:b(ck,{}),onClick:c,"data-selected":!0}),b(Ie,{tooltip:o("unifiedcanvas:showHide"),"aria-label":o("unifiedcanvas:showHide"),"data-alert":!i,icon:i?b(pRe,{}):b(hRe,{}),onClick:()=>e(w9e(!i)),"data-selected":!0}),b(Ie,{tooltip:o("unifiedcanvas:saveToGallery"),"aria-label":o("unifiedcanvas:saveToGallery"),icon:b(fk,{}),onClick:()=>e(ATe(r.image.url)),"data-selected":!0}),b(Ie,{tooltip:o("unifiedcanvas:discardAll"),"aria-label":o("unifiedcanvas:discardAll"),icon:b(D1,{style:{transform:"rotate(45deg)"}}),onClick:()=>e(l9e()),"data-selected":!0,style:{backgroundColor:"var(--btn-delete-image)"},fontSize:20})]})}):null},Ef=e=>Math.round(e*100)/100,Ije=Fe([Et],e=>{const{cursorPosition:t}=e,{cursorX:n,cursorY:r}=t?{cursorX:t.x,cursorY:t.y}:{cursorX:-1,cursorY:-1};return{cursorCoordinatesString:`(${Ef(n)}, ${Ef(r)})`}},{memoizeOptions:{resultEqualityCheck:Ue}});function Rje(){const{cursorCoordinatesString:e}=ne(Ije),{t}=Ce();return b("div",{children:`${t("unifiedcanvas:cursorPosition")}: ${e}`})}const $je=Fe([Et],e=>{const{stageDimensions:{width:t,height:n},stageCoordinates:{x:r,y:i},boundingBoxDimensions:{width:o,height:a},scaledBoundingBoxDimensions:{width:s,height:l},boundingBoxCoordinates:{x:u,y:c},stageScale:f,shouldShowCanvasDebugInfo:p,layer:m,boundingBoxScaleMethod:g}=e;let v="inherit";return(g==="none"&&(o<512||a<512)||g==="manual"&&s*l<512*512)&&(v="var(--status-working-color)"),{activeLayerColor:m==="mask"?"var(--status-working-color)":"inherit",activeLayerString:m.charAt(0).toUpperCase()+m.slice(1),boundingBoxColor:v,boundingBoxCoordinatesString:`(${Ef(u)}, ${Ef(c)})`,boundingBoxDimensionsString:`${o}×${a}`,scaledBoundingBoxDimensionsString:`${s}×${l}`,canvasCoordinatesString:`${Ef(r)}×${Ef(i)}`,canvasDimensionsString:`${t}×${n}`,canvasScaleString:Math.round(f*100),shouldShowCanvasDebugInfo:p,shouldShowBoundingBox:g!=="auto",shouldShowScaledBoundingBox:g!=="none"}},{memoizeOptions:{resultEqualityCheck:Ue}}),Dje=()=>{const{activeLayerColor:e,activeLayerString:t,boundingBoxColor:n,boundingBoxCoordinatesString:r,boundingBoxDimensionsString:i,scaledBoundingBoxDimensionsString:o,shouldShowScaledBoundingBox:a,canvasCoordinatesString:s,canvasDimensionsString:l,canvasScaleString:u,shouldShowCanvasDebugInfo:c,shouldShowBoundingBox:f}=ne($je),{t:p}=Ce();return j("div",{className:"canvas-status-text",children:[b("div",{style:{color:e},children:`${p("unifiedcanvas:activeLayer")}: ${t}`}),b("div",{children:`${p("unifiedcanvas:canvasScale")}: ${u}%`}),f&&b("div",{style:{color:n},children:`${p("unifiedcanvas:boundingBox")}: ${i}`}),a&&b("div",{style:{color:n},children:`${p("unifiedcanvas:scaledBoundingBox")}: ${o}`}),c&&j(gn,{children:[b("div",{children:`${p("unifiedcanvas:boundingBoxPosition")}: ${r}`}),b("div",{children:`${p("unifiedcanvas:canvasDimensions")}: ${l}`}),b("div",{children:`${p("unifiedcanvas:canvasPosition")}: ${s}`}),b(Rje,{})]})]})},Nje=Fe(Et,e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,stageScale:r,isDrawing:i,isTransformingBoundingBox:o,isMovingBoundingBox:a,tool:s,shouldSnapToGrid:l}=e;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,isDrawing:i,isMovingBoundingBox:a,isTransformingBoundingBox:o,stageScale:r,shouldSnapToGrid:l,tool:s,hitStrokeWidth:20/r}},{memoizeOptions:{resultEqualityCheck:Ue}}),Bje=e=>{const{...t}=e,n=ge(),{boundingBoxCoordinates:r,boundingBoxDimensions:i,isDrawing:o,isMovingBoundingBox:a,isTransformingBoundingBox:s,stageScale:l,shouldSnapToGrid:u,tool:c,hitStrokeWidth:f}=ne(Nje),p=S.useRef(null),m=S.useRef(null),[g,v]=S.useState(!1);S.useEffect(()=>{var Y;!p.current||!m.current||(p.current.nodes([m.current]),(Y=p.current.getLayer())==null||Y.batchDraw())},[]);const x=64*l,C=S.useCallback(Y=>{if(!u){n(Aw({x:Math.floor(Y.target.x()),y:Math.floor(Y.target.y())}));return}const z=Y.target.x(),R=Y.target.y(),N=Ha(z,64),U=Ha(R,64);Y.target.x(N),Y.target.y(U),n(Aw({x:N,y:U}))},[n,u]),w=S.useCallback(()=>{if(!m.current)return;const Y=m.current,z=Y.scaleX(),R=Y.scaleY(),N=Math.round(Y.width()*z),U=Math.round(Y.height()*R),G=Math.round(Y.x()),B=Math.round(Y.y());n(mm({width:N,height:U})),n(Aw({x:u?Fl(G,64):G,y:u?Fl(B,64):B})),Y.scaleX(1),Y.scaleY(1)},[n,u]),k=S.useCallback((Y,z,R)=>{const N=Y.x%x,U=Y.y%x;return{x:Fl(z.x,x)+N,y:Fl(z.y,x)+U}},[x]),P=()=>{n(Mw(!0))},L=()=>{n(Mw(!1)),n(Ow(!1)),n(Ev(!1)),v(!1)},A=()=>{n(Ow(!0))},O=()=>{n(Mw(!1)),n(Ow(!1)),n(Ev(!1)),v(!1)},I=()=>{v(!0)},$=()=>{!s&&!a&&v(!1)},D=()=>{n(Ev(!0))},V=()=>{n(Ev(!1))};return j(Gs,{...t,children:[b(Ks,{height:i.height,width:i.width,x:r.x,y:r.y,onMouseEnter:D,onMouseOver:D,onMouseLeave:V,onMouseOut:V}),b(Ks,{draggable:!0,fillEnabled:!1,height:i.height,hitStrokeWidth:f,listening:!o&&c==="move",onDragStart:A,onDragEnd:O,onDragMove:C,onMouseDown:A,onMouseOut:$,onMouseOver:I,onMouseEnter:I,onMouseUp:O,onTransform:w,onTransformEnd:L,ref:m,stroke:g?"rgba(255,255,255,0.7)":"white",strokeWidth:(g?8:1)/l,width:i.width,x:r.x,y:r.y}),b(Aze,{anchorCornerRadius:3,anchorDragBoundFunc:k,anchorFill:"rgba(212,216,234,1)",anchorSize:15,anchorStroke:"rgb(42,42,42)",borderDash:[4,4],borderEnabled:!0,borderStroke:"black",draggable:!1,enabledAnchors:c==="move"?void 0:[],flipEnabled:!1,ignoreStroke:!0,keepRatio:!1,listening:!o&&c==="move",onDragStart:A,onDragEnd:O,onMouseDown:P,onMouseUp:L,onTransformEnd:L,ref:p,rotateEnabled:!1})]})},Fje=Fe(Et,e=>{const{cursorPosition:t,brushSize:n,colorPickerColor:r,maskColor:i,brushColor:o,tool:a,layer:s,shouldShowBrush:l,isMovingBoundingBox:u,isTransformingBoundingBox:c,stageScale:f,stageDimensions:p,boundingBoxCoordinates:m,boundingBoxDimensions:g,shouldRestrictStrokesToBox:v}=e,x=v?{clipX:m.x,clipY:m.y,clipWidth:g.width,clipHeight:g.height}:{};return{cursorPosition:t,brushX:t?t.x:p.width/2,brushY:t?t.y:p.height/2,radius:n/2,colorPickerOuterRadius:LM/f,colorPickerInnerRadius:(LM-Lx+1)/f,maskColorString:Ac({...i,a:.5}),brushColorString:Ac(o),colorPickerColorString:Ac(r),tool:a,layer:s,shouldShowBrush:l,shouldDrawBrushPreview:!(u||c||!t)&&l,strokeWidth:1.5/f,dotRadius:1.5/f,clip:x}},{memoizeOptions:{resultEqualityCheck:Ue}}),zje=e=>{const{...t}=e,{brushX:n,brushY:r,radius:i,maskColorString:o,tool:a,layer:s,shouldDrawBrushPreview:l,dotRadius:u,strokeWidth:c,brushColorString:f,colorPickerColorString:p,colorPickerInnerRadius:m,colorPickerOuterRadius:g,clip:v}=ne(Fje);return l?j(Gs,{listening:!1,...v,...t,children:[a==="colorPicker"?j(gn,{children:[b(Yu,{x:n,y:r,radius:g,stroke:f,strokeWidth:Lx,strokeScaleEnabled:!1}),b(Yu,{x:n,y:r,radius:m,stroke:p,strokeWidth:Lx,strokeScaleEnabled:!1})]}):j(gn,{children:[b(Yu,{x:n,y:r,radius:i,fill:s==="mask"?o:f,globalCompositeOperation:a==="eraser"?"destination-out":"source-out"}),b(Yu,{x:n,y:r,radius:i,stroke:"rgba(255,255,255,0.4)",strokeWidth:c*2,strokeEnabled:!0,listening:!1}),b(Yu,{x:n,y:r,radius:i,stroke:"rgba(0,0,0,1)",strokeWidth:c,strokeEnabled:!0,listening:!1})]}),b(Yu,{x:n,y:r,radius:u*2,fill:"rgba(255,255,255,0.4)",listening:!1}),b(Yu,{x:n,y:r,radius:u,fill:"rgba(0,0,0,1)",listening:!1})]}):null},jje=Fe([Et,Wn],(e,t)=>{const{isMaskEnabled:n,stageScale:r,shouldShowBoundingBox:i,isTransformingBoundingBox:o,isMouseOverBoundingBox:a,isMovingBoundingBox:s,stageDimensions:l,stageCoordinates:u,tool:c,isMovingStage:f,shouldShowIntermediates:p,shouldShowGrid:m,shouldRestrictStrokesToBox:g}=e;let v="none";return c==="move"||t?f?v="grabbing":v="grab":o?v=void 0:g&&!a&&(v="default"),{isMaskEnabled:n,isModifyingBoundingBox:o||s,shouldShowBoundingBox:i,shouldShowGrid:m,stageCoordinates:u,stageCursor:v,stageDimensions:l,stageScale:r,tool:c,isStaging:t,shouldShowIntermediates:p}},{memoizeOptions:{resultEqualityCheck:Ue}}),OY=()=>{const{isMaskEnabled:e,isModifyingBoundingBox:t,shouldShowBoundingBox:n,shouldShowGrid:r,stageCoordinates:i,stageCursor:o,stageDimensions:a,stageScale:s,tool:l,isStaging:u,shouldShowIntermediates:c}=ne(jje);$ze();const f=S.useRef(null),p=S.useRef(null),m=S.useCallback($=>{cTe($),f.current=$},[]),g=S.useCallback($=>{uTe($),p.current=$},[]),v=S.useRef({x:0,y:0}),x=S.useRef(!1),C=Uze(f),w=Nze(f),k=Hze(f,x),P=Fze(f,x,v),L=zze(),{handleDragStart:A,handleDragMove:O,handleDragEnd:I}=Ize();return b("div",{className:"inpainting-canvas-container",children:j("div",{className:"inpainting-canvas-wrapper",children:[j(Oze,{tabIndex:-1,ref:m,className:"inpainting-canvas-stage",style:{...o?{cursor:o}:{}},x:i.x,y:i.y,width:a.width,height:a.height,scale:{x:s,y:s},onTouchStart:w,onTouchMove:P,onTouchEnd:k,onMouseDown:w,onMouseLeave:L,onMouseMove:P,onMouseUp:k,onDragStart:A,onDragMove:O,onDragEnd:I,onContextMenu:$=>$.evt.preventDefault(),onWheel:C,draggable:(l==="move"||u)&&!t,children:[b(rm,{id:"grid",visible:r,children:b(mje,{})}),b(rm,{id:"base",ref:g,listening:!1,imageSmoothingEnabled:!1,children:b(Tje,{})}),j(rm,{id:"mask",visible:e,listening:!1,children:[b(kje,{visible:!0,listening:!1}),b(xje,{listening:!1})]}),b(rm,{children:b(Gze,{})}),j(rm,{id:"preview",imageSmoothingEnabled:!1,children:[!u&&b(zje,{visible:l!=="move",listening:!1}),b(Aje,{visible:u}),c&&b(vje,{}),b(Bje,{visible:n&&!u})]})]}),b(Dje,{}),b(Mje,{})]})})},Hje=Fe(Et,pK,Un,(e,t,n)=>{const{doesCanvasNeedScaling:r,isCanvasInitialized:i}=e;return{doesCanvasNeedScaling:r,activeTabName:n,initialCanvasImage:t,isCanvasInitialized:i}}),MY=()=>{const e=ge(),{doesCanvasNeedScaling:t,activeTabName:n,initialCanvasImage:r,isCanvasInitialized:i}=ne(Hje),o=S.useRef(null);return S.useLayoutEffect(()=>{window.setTimeout(()=>{if(!o.current)return;const{clientWidth:a,clientHeight:s}=o.current;e(g9e({width:a,height:s})),e(i?p9e():X3()),e(hr(!1))},0)},[e,r,t,n,i]),b("div",{ref:o,className:"inpainting-canvas-area",children:b(d1,{thickness:"2px",speed:"1s",size:"xl"})})};var Vje=fa,Uje=function(){return Vje.Date.now()},Wje=Uje,Gje=us,i6=Wje,y$=C_,Kje="Expected a function",Yje=Math.max,qje=Math.min;function Xje(e,t,n){var r,i,o,a,s,l,u=0,c=!1,f=!1,p=!0;if(typeof e!="function")throw new TypeError(Kje);t=y$(t)||0,Gje(n)&&(c=!!n.leading,f="maxWait"in n,o=f?Yje(y$(n.maxWait)||0,t):o,p="trailing"in n?!!n.trailing:p);function m(A){var O=r,I=i;return r=i=void 0,u=A,a=e.apply(I,O),a}function g(A){return u=A,s=setTimeout(C,t),c?m(A):a}function v(A){var O=A-l,I=A-u,$=t-O;return f?qje($,o-I):$}function x(A){var O=A-l,I=A-u;return l===void 0||O>=t||O<0||f&&I>=o}function C(){var A=i6();if(x(A))return w(A);s=setTimeout(C,v(A))}function w(A){return s=void 0,p&&r?m(A):(r=i=void 0,a)}function k(){s!==void 0&&clearTimeout(s),u=0,r=l=i=s=void 0}function P(){return s===void 0?a:w(i6())}function L(){var A=i6(),O=x(A);if(r=arguments,i=this,l=A,O){if(s===void 0)return g(l);if(f)return clearTimeout(s),s=setTimeout(C,t),m(l)}return s===void 0&&(s=setTimeout(C,t)),a}return L.cancel=k,L.flush=P,L}var IY=Xje;const Zje=Fe([Et,Un,vn],(e,t,n)=>{const{futureLayerStates:r}=e;return{canRedo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:Ue}});function RY(){const e=ge(),{canRedo:t,activeTabName:n}=ne(Zje),{t:r}=Ce(),i=()=>{e(f9e())};return Re(["meta+shift+z","ctrl+shift+z","control+y","meta+y"],()=>{i()},{enabled:()=>t,preventDefault:!0},[n,t]),b(Ie,{"aria-label":`${r("unifiedcanvas:redo")} (Ctrl+Shift+Z)`,tooltip:`${r("unifiedcanvas:redo")} (Ctrl+Shift+Z)`,icon:b(kRe,{}),onClick:i,isDisabled:!t})}const Qje=Fe([Et,Un,vn],(e,t,n)=>{const{pastLayerStates:r}=e;return{canUndo:r.length>0&&!n.isProcessing,activeTabName:t}},{memoizeOptions:{resultEqualityCheck:Ue}});function $Y(){const e=ge(),{t}=Ce(),{canUndo:n,activeTabName:r}=ne(Qje),i=()=>{e(x9e())};return Re(["meta+z","ctrl+z"],()=>{i()},{enabled:()=>n,preventDefault:!0},[r,n]),b(Ie,{"aria-label":`${t("unifiedcanvas:undo")} (Ctrl+Z)`,tooltip:`${t("unifiedcanvas:undo")} (Ctrl+Z)`,icon:b(LRe,{}),onClick:i,isDisabled:!n})}const Jje=(e,t,n)=>{const r=document.createElement("img");r.addEventListener("load",()=>{const i=document.createElement("canvas");i.width=t,i.height=n;const o=i.getContext("2d");o&&(o.drawImage(r,0,0),i.toBlob(a=>{a&&navigator.clipboard.write([new ClipboardItem({[a.type]:a})])}),i.remove(),r.remove())}),r.src=e},eHe=e=>{const t=document.createElement("a");t.href=e,t.download="",document.body.appendChild(t),t.click(),document.body.removeChild(t),t.remove()},tHe=(e,t,n,r)=>{const i=e.scale(),o=e.getClientRect({relativeTo:e.getParent()});e.scale({x:1/t,y:1/t});const{x:a,y:s,width:l,height:u}=e.getClientRect(),c=r?{x:r.x+n.x,y:r.y+n.y,width:r.width,height:r.height}:{x:a,y:s,width:l,height:u},f=e.toDataURL(c);return e.scale(i),{dataURL:f,boundingBox:{x:o.x,y:o.y,width:l,height:u}}},nHe={cropVisible:!1,cropToBoundingBox:!1,shouldSaveToGallery:!1,shouldDownload:!1,shouldCopy:!1,shouldSetAsInitialImage:!0},jl=(e=nHe)=>async(t,n)=>{const{cropVisible:r,cropToBoundingBox:i,shouldSaveToGallery:o,shouldDownload:a,shouldCopy:s,shouldSetAsInitialImage:l}=e;t(G_e("Exporting Image")),t(Cf(!1));const u=n(),{stageScale:c,boundingBoxCoordinates:f,boundingBoxDimensions:p,stageCoordinates:m}=u.canvas,g=ca();if(!g){t(Qo(!1)),t(Cf(!0));return}const{dataURL:v,boundingBox:x}=tHe(g,c,m,i?{...f,...p}:void 0);if(!v){t(Qo(!1)),t(Cf(!0));return}const C=new FormData;C.append("data",JSON.stringify({dataURL:v,filename:"merged_canvas.png",kind:o?"result":"temp",cropVisible:r}));const k=await(await fetch(`${window.location.origin}/upload`,{method:"POST",body:C})).json(),{url:P,width:L,height:A}=k,O={uuid:_f(),category:o?"result":"user",...k};a&&(eHe(P),t(gc({title:ht.t("toast:downloadImageStarted"),status:"success",duration:2500,isClosable:!0}))),s&&(Jje(P,L,A),t(gc({title:ht.t("toast:imageCopied"),status:"success",duration:2500,isClosable:!0}))),o&&(t(wf({image:O,category:"result"})),t(gc({title:ht.t("toast:imageSavedToGallery"),status:"success",duration:2500,isClosable:!0}))),l&&(t(b9e({kind:"image",layer:"base",...x,image:O})),t(gc({title:ht.t("toast:canvasMerged"),status:"success",duration:2500,isClosable:!0}))),t(Qo(!1)),t(z2(ht.t("common:statusConnected"))),t(Cf(!0))};function rHe(){const e=ne(Wn),t=ca(),n=ne(s=>s.system.isProcessing),r=ne(s=>s.canvas.shouldCropToBoundingBoxOnSave),i=ge(),{t:o}=Ce();Re(["meta+c","ctrl+c"],()=>{a()},{enabled:()=>!e,preventDefault:!0},[t,n]);const a=()=>{i(jl({cropVisible:!r,cropToBoundingBox:r,shouldCopy:!0}))};return b(Ie,{"aria-label":`${o("unifiedcanvas:copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${o("unifiedcanvas:copyToClipboard")} (Cmd/Ctrl+C)`,icon:b(wh,{}),onClick:a,isDisabled:e})}function iHe(){const e=ge(),{t}=Ce(),n=ca(),r=ne(Wn),i=ne(s=>s.system.isProcessing),o=ne(s=>s.canvas.shouldCropToBoundingBoxOnSave);Re(["shift+d"],()=>{a()},{enabled:()=>!r,preventDefault:!0},[n,i]);const a=()=>{e(jl({cropVisible:!o,cropToBoundingBox:o,shouldDownload:!0}))};return b(Ie,{"aria-label":`${t("unifiedcanvas:downloadAsImage")} (Shift+D)`,tooltip:`${t("unifiedcanvas:downloadAsImage")} (Shift+D)`,icon:b(dk,{}),onClick:a,isDisabled:r})}function oHe(){const e=ne(Wn),{openUploader:t}=J_(),{t:n}=Ce();return b(Ie,{"aria-label":n("common:upload"),tooltip:n("common:upload"),icon:b(p4,{}),onClick:t,isDisabled:e})}const aHe=Fe([Et,Wn],(e,t)=>{const{layer:n,isMaskEnabled:r}=e;return{layer:n,isMaskEnabled:r,isStaging:t}},{memoizeOptions:{resultEqualityCheck:Ue}});function sHe(){const e=ge(),{t}=Ce(),{layer:n,isMaskEnabled:r,isStaging:i}=ne(aHe),o=()=>{e(Jy(n==="mask"?"base":"mask"))};Re(["q"],()=>{o()},{enabled:()=>!i,preventDefault:!0},[n]);const a=s=>{const l=s.target.value;e(Jy(l)),l==="mask"&&!r&&e(L1(!0))};return b(da,{tooltip:`${t("unifiedcanvas:layer")} (Q)`,tooltipProps:{hasArrow:!0,placement:"top"},value:n,validValues:xU,onChange:a,isDisabled:i})}function lHe(){const e=ge(),{t}=Ce(),n=ca(),r=ne(Wn),i=ne(a=>a.system.isProcessing);Re(["shift+m"],()=>{o()},{enabled:()=>!r,preventDefault:!0},[n,i]);const o=()=>{e(jl({cropVisible:!1,shouldSetAsInitialImage:!0}))};return b(Ie,{"aria-label":`${t("unifiedcanvas:mergeVisible")} (Shift+M)`,tooltip:`${t("unifiedcanvas:mergeVisible")} (Shift+M)`,icon:b(fK,{}),onClick:o,isDisabled:r})}function uHe(){const e=ne(o=>o.canvas.tool),t=ne(Wn),n=ge(),{t:r}=Ce();Re(["v"],()=>{i()},{enabled:()=>!t,preventDefault:!0},[]);const i=()=>n(Za("move"));return b(Ie,{"aria-label":`${r("unifiedcanvas:move")} (V)`,tooltip:`${r("unifiedcanvas:move")} (V)`,icon:b(aK,{}),"data-selected":e==="move"||t,onClick:i})}function cHe(){const e=ne(i=>i.ui.shouldPinParametersPanel),t=ge(),{t:n}=Ce(),r=()=>{t(Rs(!0)),e&&setTimeout(()=>t(hr(!0)),400)};return j(Le,{flexDirection:"column",gap:"0.5rem",children:[b(Ie,{tooltip:`${n("parameters:showOptionsPanel")} (O)`,tooltipProps:{placement:"top"},"aria-label":n("parameters:showOptionsPanel"),onClick:r,children:b(hk,{})}),b(Le,{children:b(Ik,{iconButton:!0})}),b(Le,{children:b(Ok,{width:"100%",height:"40px"})})]})}function dHe(){const e=ge(),{t}=Ce(),n=ne(Wn),r=()=>{e($_()),e(X3())};return b(Ie,{"aria-label":t("unifiedcanvas:clearCanvas"),tooltip:t("unifiedcanvas:clearCanvas"),icon:b(ad,{}),onClick:r,style:{backgroundColor:"var(--btn-delete-image)"},isDisabled:n})}function DY(e,t,n=250){const[r,i]=S.useState(0);return S.useEffect(()=>{const o=setTimeout(()=>{r===1&&e(),i(0)},n);return r===2&&t(),()=>clearTimeout(o)},[r,e,t,n]),()=>i(o=>o+1)}function fHe(){const e=ca(),t=ge(),{t:n}=Ce();Re(["r"],()=>{i()},{enabled:()=>!0,preventDefault:!0},[e]);const r=DY(()=>i(!1),()=>i(!0)),i=(o=!1)=>{const a=ca();if(!a)return;const s=a.getClientRect({skipTransform:!0});t(LU({contentRect:s,shouldScaleTo1:o}))};return b(Ie,{"aria-label":`${n("unifiedcanvas:resetView")} (R)`,tooltip:`${n("unifiedcanvas:resetView")} (R)`,icon:b(lK,{}),onClick:r})}function hHe(){const e=ne(Wn),t=ca(),n=ne(s=>s.system.isProcessing),r=ne(s=>s.canvas.shouldCropToBoundingBoxOnSave),i=ge(),{t:o}=Ce();Re(["shift+s"],()=>{a()},{enabled:()=>!e,preventDefault:!0},[t,n]);const a=()=>{i(jl({cropVisible:!r,cropToBoundingBox:r,shouldSaveToGallery:!0}))};return b(Ie,{"aria-label":`${o("unifiedcanvas:saveToGallery")} (Shift+S)`,tooltip:`${o("unifiedcanvas:saveToGallery")} (Shift+S)`,icon:b(fk,{}),onClick:a,isDisabled:e})}const pHe=Fe([Et,Wn,vn],(e,t,n)=>{const{isProcessing:r}=n,{tool:i}=e;return{tool:i,isStaging:t,isProcessing:r}},{memoizeOptions:{resultEqualityCheck:Ue}}),mHe=()=>{const e=ge(),{t}=Ce(),{tool:n,isStaging:r}=ne(pHe);Re(["b"],()=>{i()},{enabled:()=>!r,preventDefault:!0},[]),Re(["e"],()=>{o()},{enabled:()=>!r,preventDefault:!0},[n]),Re(["c"],()=>{a()},{enabled:()=>!r,preventDefault:!0},[n]),Re(["shift+f"],()=>{s()},{enabled:()=>!r,preventDefault:!0}),Re(["delete","backspace"],()=>{l()},{enabled:()=>!r,preventDefault:!0});const i=()=>e(Za("brush")),o=()=>e(Za("eraser")),a=()=>e(Za("colorPicker")),s=()=>e(EU()),l=()=>e(kU());return j(Le,{flexDirection:"column",gap:"0.5rem",children:[j(Jr,{children:[b(Ie,{"aria-label":`${t("unifiedcanvas:brush")} (B)`,tooltip:`${t("unifiedcanvas:brush")} (B)`,icon:b(hK,{}),"data-selected":n==="brush"&&!r,onClick:i,isDisabled:r}),b(Ie,{"aria-label":`${t("unifiedcanvas:eraser")} (E)`,tooltip:`${t("unifiedcanvas:eraser")} (B)`,icon:b(uK,{}),"data-selected":n==="eraser"&&!r,isDisabled:r,onClick:o})]}),j(Jr,{children:[b(Ie,{"aria-label":`${t("unifiedcanvas:fillBoundingBox")} (Shift+F)`,tooltip:`${t("unifiedcanvas:fillBoundingBox")} (Shift+F)`,icon:b(dK,{}),isDisabled:r,onClick:s}),b(Ie,{"aria-label":`${t("unifiedcanvas:eraseBoundingBox")} (Del/Backspace)`,tooltip:`${t("unifiedcanvas:eraseBoundingBox")} (Del/Backspace)`,icon:b(D1,{style:{transform:"rotate(45deg)"}}),isDisabled:r,onClick:l})]}),b(Ie,{"aria-label":`${t("unifiedcanvas:colorPicker")} (C)`,tooltip:`${t("unifiedcanvas:colorPicker")} (C)`,icon:b(cK,{}),"data-selected":n==="colorPicker"&&!r,isDisabled:r,onClick:a,width:"max-content"})]})},Hk=pe((e,t)=>{const{acceptButtonText:n="Accept",acceptCallback:r,cancelButtonText:i="Cancel",cancelCallback:o,children:a,title:s,triggerComponent:l}=e,{isOpen:u,onOpen:c,onClose:f}=Mc(),p=S.useRef(null),m=()=>{r(),f()},g=()=>{o&&o(),f()};return j(gn,{children:[S.cloneElement(l,{onClick:c,ref:t}),b(qH,{isOpen:u,leastDestructiveRef:p,onClose:f,children:b(lu,{children:j(XH,{className:"modal",children:[b(Bh,{fontSize:"lg",fontWeight:"bold",children:s}),b(gh,{children:a}),j(E3,{children:[b(xo,{ref:p,onClick:g,className:"modal-close-btn",children:i}),b(xo,{colorScheme:"red",onClick:m,ml:3,children:n})]})]})})})]})}),NY=()=>{const e=ne(Wn),t=ge(),{t:n}=Ce(),r=()=>{t(OTe()),t($_()),t(TU())};return j(Hk,{title:n("unifiedcanvas:emptyTempImageFolder"),acceptCallback:r,acceptButtonText:n("unifiedcanvas:emptyFolder"),triggerComponent:b(kn,{leftIcon:b(ad,{}),size:"sm",isDisabled:e,children:n("unifiedcanvas:emptyTempImageFolder")}),children:[b("p",{children:n("unifiedcanvas:emptyTempImagesFolderMessage")}),b("br",{}),b("p",{children:n("unifiedcanvas:emptyTempImagesFolderConfirm")})]})},BY=()=>{const e=ne(Wn),t=ge(),{t:n}=Ce();return j(Hk,{title:n("unifiedcanvas:clearCanvasHistory"),acceptCallback:()=>t(TU()),acceptButtonText:n("unifiedcanvas:clearHistory"),triggerComponent:b(kn,{size:"sm",leftIcon:b(ad,{}),isDisabled:e,children:n("unifiedcanvas:clearCanvasHistory")}),children:[b("p",{children:n("unifiedcanvas:clearCanvasHistoryMessage")}),b("br",{}),b("p",{children:n("unifiedcanvas:clearCanvasHistoryConfirm")})]})},gHe=Fe([Et],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:i}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldShowCanvasDebugInfo:r,shouldShowIntermediates:i}},{memoizeOptions:{resultEqualityCheck:Ue}}),vHe=()=>{const e=ge(),{t}=Ce(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldShowCanvasDebugInfo:i,shouldShowIntermediates:o}=ne(gHe);return b(sa,{trigger:"hover",triggerComponent:b(Ie,{tooltip:t("unifiedcanvas:canvasSettings"),tooltipProps:{placement:"bottom"},"aria-label":t("unifiedcanvas:canvasSettings"),icon:b(pk,{})}),children:j(Le,{direction:"column",gap:"0.5rem",children:[b(fn,{label:t("unifiedcanvas:showIntermediates"),isChecked:o,onChange:a=>e(BU(a.target.checked))}),b(fn,{label:t("unifiedcanvas:autoSaveToGallery"),isChecked:n,onChange:a=>e(MU(a.target.checked))}),b(fn,{label:t("unifiedcanvas:saveBoxRegionOnly"),isChecked:r,onChange:a=>e(IU(a.target.checked))}),b(fn,{label:t("unifiedcanvas:showCanvasDebugInfo"),isChecked:i,onChange:a=>e(DU(a.target.checked))}),b(BY,{}),b(NY,{})]})})},yHe=()=>{const e=ne(t=>t.ui.shouldShowParametersPanel);return j(Le,{flexDirection:"column",rowGap:"0.5rem",width:"6rem",children:[b(sHe,{}),b(mHe,{}),j(Le,{gap:"0.5rem",children:[b(uHe,{}),b(fHe,{})]}),j(Le,{columnGap:"0.5rem",children:[b(lHe,{}),b(hHe,{})]}),j(Le,{columnGap:"0.5rem",children:[b(rHe,{}),b(iHe,{})]}),j(Le,{gap:"0.5rem",children:[b($Y,{}),b(RY,{})]}),j(Le,{gap:"0.5rem",children:[b(oHe,{}),b(dHe,{})]}),b(vHe,{}),!e&&b(cHe,{})]})};function bHe(){const e=ge(),t=ne(i=>i.canvas.brushSize),{t:n}=Ce(),r=ne(Wn);return Re(["BracketLeft"],()=>{e(Zf(Math.max(t-5,5)))},{enabled:()=>!r,preventDefault:!0},[t]),Re(["BracketRight"],()=>{e(Zf(Math.min(t+5,500)))},{enabled:()=>!r,preventDefault:!0},[t]),b(Ri,{label:n("unifiedcanvas:brushSize"),value:t,withInput:!0,onChange:i=>e(Zf(i)),sliderNumberInputProps:{max:500},inputReadOnly:!1,width:"100px",isCompact:!0})}function E4(){return(E4=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}function v7(e){var t=S.useRef(e),n=S.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var _h=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e0:x.buttons>0)&&i.current?o(b$(i.current,x,s.current)):v(!1)},g=function(){return v(!1)};function v(x){var C=l.current,w=y7(i.current),k=x?w.addEventListener:w.removeEventListener;k(C?"touchmove":"mousemove",m),k(C?"touchend":"mouseup",g)}return[function(x){var C=x.nativeEvent,w=i.current;if(w&&(S$(C),!function(P,L){return L&&!eg(P)}(C,l.current)&&w)){if(eg(C)){l.current=!0;var k=C.changedTouches||[];k.length&&(s.current=k[0].identifier)}w.focus(),o(b$(w,C,s.current)),v(!0)}},function(x){var C=x.which||x.keyCode;C<37||C>40||(x.preventDefault(),a({left:C===39?.05:C===37?-.05:0,top:C===40?.05:C===38?-.05:0}))},v]},[a,o]),c=u[0],f=u[1],p=u[2];return S.useEffect(function(){return p},[p]),M.createElement("div",E4({},r,{onTouchStart:c,onMouseDown:c,className:"react-colorful__interactive",ref:i,onKeyDown:f,tabIndex:0,role:"slider"}))}),P4=function(e){return e.filter(Boolean).join(" ")},Uk=function(e){var t=e.color,n=e.left,r=e.top,i=r===void 0?.5:r,o=P4(["react-colorful__pointer",e.className]);return M.createElement("div",{className:o,style:{top:100*i+"%",left:100*n+"%"}},M.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},di=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},zY=function(e){var t=e.s,n=e.v,r=e.a,i=(200-t)*n/100;return{h:di(e.h),s:di(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:di(i/2),a:di(r,2)}},b7=function(e){var t=zY(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},o6=function(e){var t=zY(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},SHe=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var o=Math.floor(t),a=r*(1-n),s=r*(1-(t-o)*n),l=r*(1-(1-t+o)*n),u=o%6;return{r:di(255*[r,s,a,a,l,r][u]),g:di(255*[l,r,r,s,a,a][u]),b:di(255*[a,a,l,r,r,s][u]),a:di(i,2)}},wHe=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,o=Math.max(t,n,r),a=o-Math.min(t,n,r),s=a?o===t?(n-r)/a:o===n?2+(r-t)/a:4+(t-n)/a:0;return{h:di(60*(s<0?s+6:s)),s:di(o?a/o*100:0),v:di(o/255*100),a:i}},CHe=M.memo(function(e){var t=e.hue,n=e.onChange,r=P4(["react-colorful__hue",e.className]);return M.createElement("div",{className:r},M.createElement(Vk,{onMove:function(i){n({h:360*i.left})},onKey:function(i){n({h:_h(t+360*i.left,0,360)})},"aria-label":"Hue","aria-valuenow":di(t),"aria-valuemax":"360","aria-valuemin":"0"},M.createElement(Uk,{className:"react-colorful__hue-pointer",left:t/360,color:b7({h:t,s:100,v:100,a:1})})))}),xHe=M.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:b7({h:t.h,s:100,v:100,a:1})};return M.createElement("div",{className:"react-colorful__saturation",style:r},M.createElement(Vk,{onMove:function(i){n({s:100*i.left,v:100-100*i.top})},onKey:function(i){n({s:_h(t.s+100*i.left,0,100),v:_h(t.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+di(t.s)+"%, Brightness "+di(t.v)+"%"},M.createElement(Uk,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:b7(t)})))}),jY=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function _He(e,t,n){var r=v7(n),i=S.useState(function(){return e.toHsva(t)}),o=i[0],a=i[1],s=S.useRef({color:t,hsva:o});S.useEffect(function(){if(!e.equal(t,s.current.color)){var u=e.toHsva(t);s.current={hsva:u,color:t},a(u)}},[t,e]),S.useEffect(function(){var u;jY(o,s.current.hsva)||e.equal(u=e.fromHsva(o),s.current.color)||(s.current={hsva:o,color:u},r(u))},[o,e,r]);var l=S.useCallback(function(u){a(function(c){return Object.assign({},c,u)})},[]);return[o,l]}var kHe=typeof window<"u"?S.useLayoutEffect:S.useEffect,EHe=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},w$=new Map,PHe=function(e){kHe(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!w$.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,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,w$.set(t,n);var r=EHe();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},THe=function(e){var t=e.className,n=e.hsva,r=e.onChange,i={backgroundImage:"linear-gradient(90deg, "+o6(Object.assign({},n,{a:0}))+", "+o6(Object.assign({},n,{a:1}))+")"},o=P4(["react-colorful__alpha",t]),a=di(100*n.a);return M.createElement("div",{className:o},M.createElement("div",{className:"react-colorful__alpha-gradient",style:i}),M.createElement(Vk,{onMove:function(s){r({a:s.left})},onKey:function(s){r({a:_h(n.a+s.left)})},"aria-label":"Alpha","aria-valuetext":a+"%","aria-valuenow":a,"aria-valuemin":"0","aria-valuemax":"100"},M.createElement(Uk,{className:"react-colorful__alpha-pointer",left:n.a,color:o6(n)})))},LHe=function(e){var t=e.className,n=e.colorModel,r=e.color,i=r===void 0?n.defaultColor:r,o=e.onChange,a=FY(e,["className","colorModel","color","onChange"]),s=S.useRef(null);PHe(s);var l=_He(n,i,o),u=l[0],c=l[1],f=P4(["react-colorful",t]);return M.createElement("div",E4({},a,{ref:s,className:f}),M.createElement(xHe,{hsva:u,onChange:c}),M.createElement(CHe,{hue:u.h,onChange:c}),M.createElement(THe,{hsva:u,onChange:c,className:"react-colorful__last-control"}))},AHe={defaultColor:{r:0,g:0,b:0,a:1},toHsva:wHe,fromHsva:SHe,equal:jY},OHe=function(e){return M.createElement(LHe,E4({},e,{colorModel:AHe}))};const yb=e=>{const{styleClass:t,...n}=e;return b(OHe,{className:`invokeai__color-picker ${t}`,...n})},MHe=Fe([Et,Wn],(e,t)=>{const{brushColor:n,maskColor:r,layer:i}=e;return{brushColor:n,maskColor:r,layer:i,isStaging:t}},{memoizeOptions:{resultEqualityCheck:Ue}});function IHe(){const e=ge(),{brushColor:t,maskColor:n,layer:r,isStaging:i}=ne(MHe),o=()=>{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 Re(["shift+BracketLeft"],()=>{e(Xf({...t,a:ti(t.a-.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[t]),Re(["shift+BracketRight"],()=>{e(Xf({...t,a:ti(t.a+.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[t]),b(sa,{trigger:"hover",triggerComponent:b(ci,{style:{width:"30px",height:"30px",minWidth:"30px",minHeight:"30px",borderRadius:"99999999px",backgroundColor:o(),cursor:"pointer"}}),children:j(Le,{minWidth:"15rem",direction:"column",gap:"1rem",width:"100%",children:[r==="base"&&b(yb,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:t,onChange:a=>e(Xf(a))}),r==="mask"&&b(yb,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:n,onChange:a=>e(OU(a))})]})})}function HY(){return j(Le,{columnGap:"1rem",alignItems:"center",children:[b(bHe,{}),b(IHe,{})]})}function RHe(){const e=ge(),t=ne(r=>r.canvas.shouldRestrictStrokesToBox),{t:n}=Ce();return b(fn,{label:n("unifiedcanvas:betaLimitToBox"),isChecked:t,onChange:r=>e(zU(r.target.checked))})}function $He(){return j(Le,{gap:"1rem",alignItems:"center",children:[b(HY,{}),b(RHe,{})]})}function DHe(){const e=ge(),{t}=Ce();return b(kn,{size:"sm",leftIcon:b(ad,{}),onClick:()=>e(R_()),tooltip:`${t("unifiedcanvas:clearMask")} (Shift+C)`,children:t("unifiedcanvas:betaClear")})}function NHe(){const e=ne(i=>i.canvas.isMaskEnabled),t=ge(),{t:n}=Ce(),r=()=>t(L1(!e));return b(fn,{label:`${n("unifiedcanvas:enableMask")} (H)`,isChecked:e,onChange:r})}function BHe(){const e=ge(),{t}=Ce(),n=ne(r=>r.canvas.shouldPreserveMaskedArea);return b(fn,{label:t("unifiedcanvas:betaPreserveMasked"),isChecked:n,onChange:r=>e($U(r.target.checked))})}function FHe(){return j(Le,{gap:"1rem",alignItems:"center",children:[b(HY,{}),b(NHe,{}),b(BHe,{}),b(DHe,{})]})}function zHe(){const e=ne(r=>r.canvas.shouldDarkenOutsideBoundingBox),t=ge(),{t:n}=Ce();return b(fn,{label:n("unifiedcanvas:betaDarkenOutside"),isChecked:e,onChange:r=>t(RU(r.target.checked))})}function jHe(){const e=ne(r=>r.canvas.shouldShowGrid),t=ge(),{t:n}=Ce();return b(fn,{label:n("unifiedcanvas:showGrid"),isChecked:e,onChange:r=>t(NU(r.target.checked))})}function HHe(){const e=ne(i=>i.canvas.shouldSnapToGrid),t=ge(),{t:n}=Ce(),r=i=>t(eb(i.target.checked));return b(fn,{label:`${n("unifiedcanvas:snapToGrid")} (N)`,isChecked:e,onChange:r})}function VHe(){return j(Le,{alignItems:"center",gap:"1rem",children:[b(jHe,{}),b(HHe,{}),b(zHe,{})]})}const UHe=Fe([Et],e=>{const{tool:t,layer:n}=e;return{tool:t,layer:n}},{memoizeOptions:{resultEqualityCheck:Ue}});function WHe(){const{tool:e,layer:t}=ne(UHe);return j(Le,{height:"2rem",minHeight:"2rem",maxHeight:"2rem",alignItems:"center",children:[t=="base"&&["brush","eraser","colorPicker"].includes(e)&&b($He,{}),t=="mask"&&["brush","eraser","colorPicker"].includes(e)&&b(FHe,{}),e=="move"&&b(VHe,{})]})}const GHe=Fe([Et],e=>{const{doesCanvasNeedScaling:t}=e;return{doesCanvasNeedScaling:t}},{memoizeOptions:{resultEqualityCheck:Ue}}),KHe=()=>{const e=ge(),{doesCanvasNeedScaling:t}=ne(GHe);return S.useLayoutEffect(()=>{e(hr(!0));const n=IY(()=>{e(hr(!0))},250);return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),b("div",{className:"workarea-single-view",children:j(Le,{flexDirection:"row",width:"100%",height:"100%",columnGap:"1rem",padding:"1rem",children:[b(yHe,{}),j(Le,{width:"100%",height:"100%",flexDirection:"column",rowGap:"1rem",children:[b(WHe,{}),t?b(MY,{}):b(OY,{})]})]})})},YHe=Fe([Et,Wn],(e,t)=>{const{maskColor:n,layer:r,isMaskEnabled:i,shouldPreserveMaskedArea:o}=e;return{layer:r,maskColor:n,maskColorString:Ac(n),isMaskEnabled:i,shouldPreserveMaskedArea:o,isStaging:t}},{memoizeOptions:{resultEqualityCheck:Ue}}),qHe=()=>{const e=ge(),{t}=Ce(),{layer:n,maskColor:r,isMaskEnabled:i,shouldPreserveMaskedArea:o,isStaging:a}=ne(YHe);Re(["q"],()=>{s()},{enabled:()=>!a,preventDefault:!0},[n]),Re(["shift+c"],()=>{l()},{enabled:()=>!a,preventDefault:!0},[]),Re(["h"],()=>{u()},{enabled:()=>!a,preventDefault:!0},[i]);const s=()=>{e(Jy(n==="mask"?"base":"mask"))},l=()=>e(R_()),u=()=>e(L1(!i));return b(sa,{trigger:"hover",triggerComponent:b(Jr,{children:b(Ie,{"aria-label":t("unifiedcanvas:maskingOptions"),tooltip:t("unifiedcanvas:maskingOptions"),icon:b(bRe,{}),style:n==="mask"?{backgroundColor:"var(--accent-color)"}:{backgroundColor:"var(--btn-base-color)"},isDisabled:a})}),children:j(Le,{direction:"column",gap:"0.5rem",children:[b(fn,{label:`${t("unifiedcanvas:enableMask")} (H)`,isChecked:i,onChange:u}),b(fn,{label:t("unifiedcanvas:preserveMaskedArea"),isChecked:o,onChange:c=>e($U(c.target.checked))}),b(yb,{style:{paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:r,onChange:c=>e(OU(c))}),j(kn,{size:"sm",leftIcon:b(ad,{}),onClick:l,children:[t("unifiedcanvas:clearMask")," (Shift+C)"]})]})})},XHe=Fe([Et],e=>{const{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:i,shouldShowGrid:o,shouldShowIntermediates:a,shouldSnapToGrid:s,shouldRestrictStrokesToBox:l}=e;return{shouldAutoSave:t,shouldCropToBoundingBoxOnSave:n,shouldDarkenOutsideBoundingBox:r,shouldShowCanvasDebugInfo:i,shouldShowGrid:o,shouldShowIntermediates:a,shouldSnapToGrid:s,shouldRestrictStrokesToBox:l}},{memoizeOptions:{resultEqualityCheck:Ue}}),ZHe=()=>{const e=ge(),{t}=Ce(),{shouldAutoSave:n,shouldCropToBoundingBoxOnSave:r,shouldDarkenOutsideBoundingBox:i,shouldShowCanvasDebugInfo:o,shouldShowGrid:a,shouldShowIntermediates:s,shouldSnapToGrid:l,shouldRestrictStrokesToBox:u}=ne(XHe);Re(["n"],()=>{e(eb(!l))},{enabled:!0,preventDefault:!0},[l]);const c=f=>e(eb(f.target.checked));return b(sa,{trigger:"hover",triggerComponent:b(Ie,{tooltip:t("unifiedcanvas:canvasSettings"),"aria-label":t("unifiedcanvas:canvasSettings"),icon:b(pk,{})}),children:j(Le,{direction:"column",gap:"0.5rem",children:[b(fn,{label:t("unifiedcanvas:showIntermediates"),isChecked:s,onChange:f=>e(BU(f.target.checked))}),b(fn,{label:t("unifiedcanvas:showGrid"),isChecked:a,onChange:f=>e(NU(f.target.checked))}),b(fn,{label:t("unifiedcanvas:snapToGrid"),isChecked:l,onChange:c}),b(fn,{label:t("unifiedcanvas:darkenOutsideSelection"),isChecked:i,onChange:f=>e(RU(f.target.checked))}),b(fn,{label:t("unifiedcanvas:autoSaveToGallery"),isChecked:n,onChange:f=>e(MU(f.target.checked))}),b(fn,{label:t("unifiedcanvas:saveBoxRegionOnly"),isChecked:r,onChange:f=>e(IU(f.target.checked))}),b(fn,{label:t("unifiedcanvas:limitStrokesToBox"),isChecked:u,onChange:f=>e(zU(f.target.checked))}),b(fn,{label:t("unifiedcanvas:showCanvasDebugInfo"),isChecked:o,onChange:f=>e(DU(f.target.checked))}),b(BY,{}),b(NY,{})]})})},QHe=Fe([Et,Wn,vn],(e,t,n)=>{const{isProcessing:r}=n,{tool:i,brushColor:o,brushSize:a}=e;return{tool:i,isStaging:t,isProcessing:r,brushColor:o,brushSize:a}},{memoizeOptions:{resultEqualityCheck:Ue}}),JHe=()=>{const e=ge(),{tool:t,brushColor:n,brushSize:r,isStaging:i}=ne(QHe),{t:o}=Ce();Re(["b"],()=>{a()},{enabled:()=>!i,preventDefault:!0},[]),Re(["e"],()=>{s()},{enabled:()=>!i,preventDefault:!0},[t]),Re(["c"],()=>{l()},{enabled:()=>!i,preventDefault:!0},[t]),Re(["shift+f"],()=>{u()},{enabled:()=>!i,preventDefault:!0}),Re(["delete","backspace"],()=>{c()},{enabled:()=>!i,preventDefault:!0}),Re(["BracketLeft"],()=>{e(Zf(Math.max(r-5,5)))},{enabled:()=>!i,preventDefault:!0},[r]),Re(["BracketRight"],()=>{e(Zf(Math.min(r+5,500)))},{enabled:()=>!i,preventDefault:!0},[r]),Re(["shift+BracketLeft"],()=>{e(Xf({...n,a:ti(n.a-.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[n]),Re(["shift+BracketRight"],()=>{e(Xf({...n,a:ti(n.a+.05,.05,1)}))},{enabled:()=>!i,preventDefault:!0},[n]);const a=()=>e(Za("brush")),s=()=>e(Za("eraser")),l=()=>e(Za("colorPicker")),u=()=>e(EU()),c=()=>e(kU());return j(Jr,{isAttached:!0,children:[b(Ie,{"aria-label":`${o("unifiedcanvas:brush")} (B)`,tooltip:`${o("unifiedcanvas:brush")} (B)`,icon:b(hK,{}),"data-selected":t==="brush"&&!i,onClick:a,isDisabled:i}),b(Ie,{"aria-label":`${o("unifiedcanvas:eraser")} (E)`,tooltip:`${o("unifiedcanvas:eraser")} (E)`,icon:b(uK,{}),"data-selected":t==="eraser"&&!i,isDisabled:i,onClick:s}),b(Ie,{"aria-label":`${o("unifiedcanvas:fillBoundingBox")} (Shift+F)`,tooltip:`${o("unifiedcanvas:fillBoundingBox")} (Shift+F)`,icon:b(dK,{}),isDisabled:i,onClick:u}),b(Ie,{"aria-label":`${o("unifiedcanvas:eraseBoundingBox")} (Del/Backspace)`,tooltip:`${o("unifiedcanvas:eraseBoundingBox")} (Del/Backspace)`,icon:b(D1,{style:{transform:"rotate(45deg)"}}),isDisabled:i,onClick:c}),b(Ie,{"aria-label":`${o("unifiedcanvas:colorPicker")} (C)`,tooltip:`${o("unifiedcanvas:colorPicker")} (C)`,icon:b(cK,{}),"data-selected":t==="colorPicker"&&!i,isDisabled:i,onClick:l}),b(sa,{trigger:"hover",triggerComponent:b(Ie,{"aria-label":o("unifiedcanvas:brushOptions"),tooltip:o("unifiedcanvas:brushOptions"),icon:b(hk,{})}),children:j(Le,{minWidth:"15rem",direction:"column",gap:"1rem",width:"100%",children:[b(Le,{gap:"1rem",justifyContent:"space-between",children:b(Ri,{label:o("unifiedcanvas:brushSize"),value:r,withInput:!0,onChange:f=>e(Zf(f)),sliderNumberInputProps:{max:500},inputReadOnly:!1})}),b(yb,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:n,onChange:f=>e(Xf(f))})]})})]})},eVe=Fe([vn,Et,Wn],(e,t,n)=>{const{isProcessing:r}=e,{tool:i,shouldCropToBoundingBoxOnSave:o,layer:a,isMaskEnabled:s}=t;return{isProcessing:r,isStaging:n,isMaskEnabled:s,tool:i,layer:a,shouldCropToBoundingBoxOnSave:o}},{memoizeOptions:{resultEqualityCheck:Ue}}),tVe=()=>{const e=ge(),{isProcessing:t,isStaging:n,isMaskEnabled:r,layer:i,tool:o,shouldCropToBoundingBoxOnSave:a}=ne(eVe),s=ca(),{t:l}=Ce(),{openUploader:u}=J_();Re(["v"],()=>{c()},{enabled:()=>!n,preventDefault:!0},[]),Re(["r"],()=>{p()},{enabled:()=>!0,preventDefault:!0},[s]),Re(["shift+m"],()=>{g()},{enabled:()=>!n,preventDefault:!0},[s,t]),Re(["shift+s"],()=>{v()},{enabled:()=>!n,preventDefault:!0},[s,t]),Re(["meta+c","ctrl+c"],()=>{x()},{enabled:()=>!n,preventDefault:!0},[s,t]),Re(["shift+d"],()=>{C()},{enabled:()=>!n,preventDefault:!0},[s,t]);const c=()=>e(Za("move")),f=DY(()=>p(!1),()=>p(!0)),p=(k=!1)=>{const P=ca();if(!P)return;const L=P.getClientRect({skipTransform:!0});e(LU({contentRect:L,shouldScaleTo1:k}))},m=()=>{e($_()),e(X3())},g=()=>{e(jl({cropVisible:!1,shouldSetAsInitialImage:!0}))},v=()=>{e(jl({cropVisible:!a,cropToBoundingBox:a,shouldSaveToGallery:!0}))},x=()=>{e(jl({cropVisible:!a,cropToBoundingBox:a,shouldCopy:!0}))},C=()=>{e(jl({cropVisible:!a,cropToBoundingBox:a,shouldDownload:!0}))},w=k=>{const P=k.target.value;e(Jy(P)),P==="mask"&&!r&&e(L1(!0))};return j("div",{className:"inpainting-settings",children:[b(da,{tooltip:`${l("unifiedcanvas:layer")} (Q)`,tooltipProps:{hasArrow:!0,placement:"top"},value:i,validValues:xU,onChange:w,isDisabled:n}),b(qHe,{}),b(JHe,{}),j(Jr,{isAttached:!0,children:[b(Ie,{"aria-label":`${l("unifiedcanvas:move")} (V)`,tooltip:`${l("unifiedcanvas:move")} (V)`,icon:b(aK,{}),"data-selected":o==="move"||n,onClick:c}),b(Ie,{"aria-label":`${l("unifiedcanvas:resetView")} (R)`,tooltip:`${l("unifiedcanvas:resetView")} (R)`,icon:b(lK,{}),onClick:f})]}),j(Jr,{isAttached:!0,children:[b(Ie,{"aria-label":`${l("unifiedcanvas:mergeVisible")} (Shift+M)`,tooltip:`${l("unifiedcanvas:mergeVisible")} (Shift+M)`,icon:b(fK,{}),onClick:g,isDisabled:n}),b(Ie,{"aria-label":`${l("unifiedcanvas:saveToGallery")} (Shift+S)`,tooltip:`${l("unifiedcanvas:saveToGallery")} (Shift+S)`,icon:b(fk,{}),onClick:v,isDisabled:n}),b(Ie,{"aria-label":`${l("unifiedcanvas:copyToClipboard")} (Cmd/Ctrl+C)`,tooltip:`${l("unifiedcanvas:copyToClipboard")} (Cmd/Ctrl+C)`,icon:b(wh,{}),onClick:x,isDisabled:n}),b(Ie,{"aria-label":`${l("unifiedcanvas:downloadAsImage")} (Shift+D)`,tooltip:`${l("unifiedcanvas:downloadAsImage")} (Shift+D)`,icon:b(dk,{}),onClick:C,isDisabled:n})]}),j(Jr,{isAttached:!0,children:[b($Y,{}),b(RY,{})]}),j(Jr,{isAttached:!0,children:[b(Ie,{"aria-label":`${l("common:upload")}`,tooltip:`${l("common:upload")}`,icon:b(p4,{}),onClick:u,isDisabled:n}),b(Ie,{"aria-label":`${l("unifiedcanvas:clearCanvas")}`,tooltip:`${l("unifiedcanvas:clearCanvas")}`,icon:b(ad,{}),onClick:m,style:{backgroundColor:"var(--btn-delete-image)"},isDisabled:n})]}),b(Jr,{isAttached:!0,children:b(ZHe,{})})]})},nVe=Fe([Et],e=>{const{doesCanvasNeedScaling:t}=e;return{doesCanvasNeedScaling:t}},{memoizeOptions:{resultEqualityCheck:Ue}}),rVe=()=>{const e=ge(),{doesCanvasNeedScaling:t}=ne(nVe);return S.useLayoutEffect(()=>{e(hr(!0));const n=IY(()=>{e(hr(!0))},250);return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),b("div",{className:"workarea-single-view",children:b("div",{className:"workarea-split-view-left",children:j("div",{className:"inpainting-main-area",children:[b(tVe,{}),b("div",{className:"inpainting-canvas-area",children:t?b(MY,{}):b(OY,{})})]})})})},iVe=Fe(Et,e=>{const{boundingBoxDimensions:t,boundingBoxScaleMethod:n}=e;return{boundingBoxDimensions:t,boundingBoxScale:n}},{memoizeOptions:{resultEqualityCheck:Ue}}),oVe=()=>{const e=ge(),{boundingBoxDimensions:t}=ne(iVe),{t:n}=Ce(),r=s=>{e(mm({...t,width:Math.floor(s)}))},i=s=>{e(mm({...t,height:Math.floor(s)}))},o=()=>{e(mm({...t,width:Math.floor(512)}))},a=()=>{e(mm({...t,height:Math.floor(512)}))};return j(Le,{direction:"column",gap:"1rem",children:[b(Ri,{label:n("parameters:width"),min:64,max:1024,step:64,value:t.width,onChange:r,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:o}),b(Ri,{label:n("parameters:height"),min:64,max:1024,step:64,value:t.height,onChange:i,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:a})]})},aVe=Fe([Mk,vn,Et],(e,t,n)=>{const{tileSize:r,infillMethod:i}=e,{infill_methods:o}=t,{boundingBoxScaleMethod:a,scaledBoundingBoxDimensions:s}=n;return{boundingBoxScale:a,scaledBoundingBoxDimensions:s,tileSize:r,infillMethod:i,availableInfillMethods:o,isManual:a==="manual"}},{memoizeOptions:{resultEqualityCheck:Ue}}),sVe=()=>{const e=ge(),{tileSize:t,infillMethod:n,availableInfillMethods:r,boundingBoxScale:i,isManual:o,scaledBoundingBoxDimensions:a}=ne(aVe),{t:s}=Ce(),l=m=>{e(Pv({...a,width:Math.floor(m)}))},u=m=>{e(Pv({...a,height:Math.floor(m)}))},c=()=>{e(Pv({...a,width:Math.floor(512)}))},f=()=>{e(Pv({...a,height:Math.floor(512)}))},p=m=>{e(m9e(m.target.value))};return j(Le,{direction:"column",gap:"1rem",children:[b(da,{label:s("parameters:scaleBeforeProcessing"),validValues:Q7e,value:i,onChange:p}),b(Ri,{isInputDisabled:!o,isResetDisabled:!o,isSliderDisabled:!o,label:s("parameters:scaledWidth"),min:64,max:1024,step:64,value:a.width,onChange:l,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:c}),b(Ri,{isInputDisabled:!o,isResetDisabled:!o,isSliderDisabled:!o,label:s("parameters:scaledHeight"),min:64,max:1024,step:64,value:a.height,onChange:u,sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:f}),b(da,{label:s("parameters:infillMethod"),value:n,validValues:r,onChange:m=>e(ZU(m.target.value))}),b(Ri,{isInputDisabled:n!=="tile",isResetDisabled:n!=="tile",isSliderDisabled:n!=="tile",sliderMarkRightOffset:-4,label:s("parameters:tileSize"),min:16,max:64,sliderNumberInputProps:{max:256},value:t,onChange:m=>{e(NM(m))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(NM(32))}})]})};function lVe(){const e=ge(),t=ne(r=>r.generation.seamBlur),{t:n}=Ce();return b(Ri,{sliderMarkRightOffset:-4,label:n("parameters:seamBlur"),min:0,max:64,sliderNumberInputProps:{max:512},value:t,onChange:r=>{e(IM(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(IM(16))}})}function uVe(){const e=ge(),{t}=Ce(),n=ne(r=>r.generation.seamSize);return b(Ri,{sliderMarkRightOffset:-6,label:t("parameters:seamSize"),min:1,max:256,sliderNumberInputProps:{max:512},value:n,onChange:r=>{e(RM(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>e(RM(96))})}function cVe(){const{t:e}=Ce(),t=ne(r=>r.generation.seamSteps),n=ge();return b(Ri,{sliderMarkRightOffset:-4,label:e("parameters:seamSteps"),min:1,max:100,sliderNumberInputProps:{max:999},value:t,onChange:r=>{n($M(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{n($M(30))}})}function dVe(){const e=ge(),{t}=Ce(),n=ne(r=>r.generation.seamStrength);return b(Ri,{sliderMarkRightOffset:-7,label:t("parameters:seamStrength"),min:.01,max:.99,step:.01,value:n,onChange:r=>{e(DM(r))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:()=>{e(DM(.7))}})}const fVe=()=>j(Le,{direction:"column",gap:"1rem",children:[b(uVe,{}),b(lVe,{}),b(dVe,{}),b(cVe,{})]});function hVe(){const{t:e}=Ce(),t={boundingBox:{header:`${e("parameters:boundingBoxHeader")}`,feature:ei.BOUNDING_BOX,content:b(oVe,{})},seamCorrection:{header:`${e("parameters:seamCorrectionHeader")}`,feature:ei.SEAM_CORRECTION,content:b(fVe,{})},infillAndScaling:{header:`${e("parameters:infillScalingHeader")}`,feature:ei.INFILL_AND_SCALING,content:b(sVe,{})},seed:{header:`${e("parameters:seed")}`,feature:ei.SEED,content:b(Ek,{})},variations:{header:`${e("parameters:variations")}`,feature:ei.VARIATIONS,content:b(Tk,{}),additionalHeaderComponents:b(Pk,{})}};return j(Nk,{children:[j(Le,{flexDir:"column",rowGap:"0.5rem",children:[b(Dk,{}),b($k,{})]}),b(Rk,{}),b(Lk,{}),b(bY,{label:e("parameters:img2imgStrength"),styleClass:"main-settings-block image-to-image-strength-main-option"}),b(Ak,{accordionInfo:t})]})}function pVe(){const e=ne(t=>t.ui.shouldUseCanvasBetaLayout);return b(kk,{optionsPanel:b(hVe,{}),styleClass:"inpainting-workarea-overrides",children:e?b(KHe,{}):b(rVe,{})})}const vo={txt2img:{title:b(ZLe,{fill:"black",boxSize:"2.5rem"}),workarea:b(PFe,{}),tooltip:"Text To Image"},img2img:{title:b(YLe,{fill:"black",boxSize:"2.5rem"}),workarea:b(SFe,{}),tooltip:"Image To Image"},unifiedCanvas:{title:b(JLe,{fill:"black",boxSize:"2.5rem"}),workarea:b(pVe,{}),tooltip:"Unified Canvas"},nodes:{title:b(qLe,{fill:"black",boxSize:"2.5rem"}),workarea:b(ULe,{}),tooltip:"Nodes"},postprocess:{title:b(XLe,{fill:"black",boxSize:"2.5rem"}),workarea:b(WLe,{}),tooltip:"Post Processing"},training:{title:b(QLe,{fill:"black",boxSize:"2.5rem"}),workarea:b(GLe,{}),tooltip:"Training"}};function mVe(){vo.txt2img.tooltip=ht.t("common:text2img"),vo.img2img.tooltip=ht.t("common:img2img"),vo.unifiedCanvas.tooltip=ht.t("common:unifiedCanvas"),vo.nodes.tooltip=ht.t("common:nodes"),vo.postprocess.tooltip=ht.t("common:postProcessing"),vo.training.tooltip=ht.t("common:training")}function gVe(){const e=ne(VLe),t=ne(o=>o.lightbox.isLightboxOpen);KLe(mVe);const n=ge();Re("1",()=>{n(_i(0))}),Re("2",()=>{n(_i(1))}),Re("3",()=>{n(_i(2))}),Re("4",()=>{n(_i(3))}),Re("5",()=>{n(_i(4))}),Re("6",()=>{n(_i(5))}),Re("z",()=>{n(Qf(!t))},[t]);const r=()=>{const o=[];return Object.keys(vo).forEach(a=>{o.push(b(ri,{hasArrow:!0,label:vo[a].tooltip,placement:"right",children:b(_V,{children:vo[a].title})},a))}),o},i=()=>{const o=[];return Object.keys(vo).forEach(a=>{o.push(b(CV,{className:"app-tabs-panel",children:vo[a].workarea},a))}),o};return j(wV,{isLazy:!0,className:"app-tabs",variant:"unstyled",defaultIndex:e,index:e,onChange:o=>{n(_i(o))},children:[b("div",{className:"app-tabs-list",children:r()}),b(xV,{className:"app-tabs-panels",children:t?b(DBe,{}):i()})]})}var vVe=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 z1(e,t){var n=yVe(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 yVe(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),i=vVe.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}var bVe=[".DS_Store","Thumbs.db"];function SVe(e){return Mh(this,void 0,void 0,function(){return Ih(this,function(t){return bb(e)&&wVe(e.dataTransfer)?[2,kVe(e.dataTransfer,e.type)]:CVe(e)?[2,xVe(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,_Ve(e)]:[2,[]]})})}function wVe(e){return bb(e)}function CVe(e){return bb(e)&&bb(e.target)}function bb(e){return typeof e=="object"&&e!==null}function xVe(e){return S7(e.target.files).map(function(t){return z1(t)})}function _Ve(e){return Mh(this,void 0,void 0,function(){var t;return Ih(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 z1(r)})]}})})}function kVe(e,t){return Mh(this,void 0,void 0,function(){var n,r;return Ih(this,function(i){switch(i.label){case 0:return e.items?(n=S7(e.items).filter(function(o){return o.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(EVe))]):[3,2];case 1:return r=i.sent(),[2,C$(VY(r))];case 2:return[2,C$(S7(e.files).map(function(o){return z1(o)}))]}})})}function C$(e){return e.filter(function(t){return bVe.indexOf(t.name)===-1})}function S7(e){if(e===null)return[];for(var t=[],n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nn)return[!1,P$(n)];if(e.sizen)return[!1,P$(n)]}return[!0,null]}function lc(e){return e!=null}function HVe(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,o=e.multiple,a=e.maxFiles,s=e.validator;return!o&&t.length>1||o&&a>=1&&t.length>a?!1:t.every(function(l){var u=KY(l,n),c=Xg(u,1),f=c[0],p=YY(l,r,i),m=Xg(p,1),g=m[0],v=s?s(l):null;return f&&g&&!v})}function Sb(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function e2(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 L$(e){e.preventDefault()}function VVe(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function UVe(e){return e.indexOf("Edge/")!==-1}function WVe(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return VVe(e)||UVe(e)}function La(){for(var e=arguments.length,t=new Array(e),n=0;n1?i-1:0),a=1;ae.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function lUe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var Wk=S.forwardRef(function(e,t){var n=e.children,r=wb(e,ZVe),i=JY(r),o=i.open,a=wb(i,QVe);return S.useImperativeHandle(t,function(){return{open:o}},[o]),M.createElement(S.Fragment,null,n(Dn(Dn({},a),{},{open:o})))});Wk.displayName="Dropzone";var QY={disabled:!1,getFilesFromEvent:SVe,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};Wk.defaultProps=QY;Wk.propTypes={children:Xt.func,accept:Xt.objectOf(Xt.arrayOf(Xt.string)),multiple:Xt.bool,preventDropOnDocument:Xt.bool,noClick:Xt.bool,noKeyboard:Xt.bool,noDrag:Xt.bool,noDragEventsBubbling:Xt.bool,minSize:Xt.number,maxSize:Xt.number,maxFiles:Xt.number,disabled:Xt.bool,getFilesFromEvent:Xt.func,onFileDialogCancel:Xt.func,onFileDialogOpen:Xt.func,useFsAccessApi:Xt.bool,autoFocus:Xt.bool,onDragEnter:Xt.func,onDragLeave:Xt.func,onDragOver:Xt.func,onDrop:Xt.func,onDropAccepted:Xt.func,onDropRejected:Xt.func,onError:Xt.func,validator:Xt.func};var _7={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function JY(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Dn(Dn({},QY),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,o=t.maxSize,a=t.minSize,s=t.multiple,l=t.maxFiles,u=t.onDragEnter,c=t.onDragLeave,f=t.onDragOver,p=t.onDrop,m=t.onDropAccepted,g=t.onDropRejected,v=t.onFileDialogCancel,x=t.onFileDialogOpen,C=t.useFsAccessApi,w=t.autoFocus,k=t.preventDropOnDocument,P=t.noClick,L=t.noKeyboard,A=t.noDrag,O=t.noDragEventsBubbling,I=t.onError,$=t.validator,D=S.useMemo(function(){return YVe(n)},[n]),V=S.useMemo(function(){return KVe(n)},[n]),Y=S.useMemo(function(){return typeof x=="function"?x:O$},[x]),z=S.useMemo(function(){return typeof v=="function"?v:O$},[v]),R=S.useRef(null),N=S.useRef(null),U=S.useReducer(uUe,_7),G=a6(U,2),B=G[0],W=G[1],X=B.isFocused,re=B.isFileDialogActive,le=S.useRef(typeof window<"u"&&window.isSecureContext&&C&&GVe()),he=function(){!le.current&&re&&setTimeout(function(){if(N.current){var we=N.current.files;we.length||(W({type:"closeDialog"}),z())}},300)};S.useEffect(function(){return window.addEventListener("focus",he,!1),function(){window.removeEventListener("focus",he,!1)}},[N,re,z,le]);var se=S.useRef([]),Ae=function(we){R.current&&R.current.contains(we.target)||(we.preventDefault(),se.current=[])};S.useEffect(function(){return k&&(document.addEventListener("dragover",L$,!1),document.addEventListener("drop",Ae,!1)),function(){k&&(document.removeEventListener("dragover",L$),document.removeEventListener("drop",Ae))}},[R,k]),S.useEffect(function(){return!r&&w&&R.current&&R.current.focus(),function(){}},[R,w,r]);var be=S.useCallback(function(ce){I?I(ce):console.error(ce)},[I]),De=S.useCallback(function(ce){ce.preventDefault(),ce.persist(),J(ce),se.current=[].concat(tUe(se.current),[ce.target]),e2(ce)&&Promise.resolve(i(ce)).then(function(we){if(!(Sb(ce)&&!O)){var ot=we.length,mt=ot>0&&HVe({files:we,accept:D,minSize:a,maxSize:o,multiple:s,maxFiles:l,validator:$}),me=ot>0&&!mt;W({isDragAccept:mt,isDragReject:me,isDragActive:!0,type:"setDraggedFiles"}),u&&u(ce)}}).catch(function(we){return be(we)})},[i,u,be,O,D,a,o,s,l,$]),fe=S.useCallback(function(ce){ce.preventDefault(),ce.persist(),J(ce);var we=e2(ce);if(we&&ce.dataTransfer)try{ce.dataTransfer.dropEffect="copy"}catch(ot){}return we&&f&&f(ce),!1},[f,O]),Xe=S.useCallback(function(ce){ce.preventDefault(),ce.persist(),J(ce);var we=se.current.filter(function(mt){return R.current&&R.current.contains(mt)}),ot=we.indexOf(ce.target);ot!==-1&&we.splice(ot,1),se.current=we,!(we.length>0)&&(W({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),e2(ce)&&c&&c(ce))},[R,c,O]),rt=S.useCallback(function(ce,we){var ot=[],mt=[];ce.forEach(function(me){var lt=KY(me,D),bt=a6(lt,2),Te=bt[0],qe=bt[1],Ut=YY(me,a,o),Ee=a6(Ut,2),tt=Ee[0],Ge=Ee[1],vt=$?$(me):null;if(Te&&tt&&!vt)ot.push(me);else{var Nt=[qe,Ge];vt&&(Nt=Nt.concat(vt)),mt.push({file:me,errors:Nt.filter(function(er){return er})})}}),(!s&&ot.length>1||s&&l>=1&&ot.length>l)&&(ot.forEach(function(me){mt.push({file:me,errors:[jVe]})}),ot.splice(0)),W({acceptedFiles:ot,fileRejections:mt,type:"setFiles"}),p&&p(ot,mt,we),mt.length>0&&g&&g(mt,we),ot.length>0&&m&&m(ot,we)},[W,s,D,a,o,l,p,m,g,$]),Ze=S.useCallback(function(ce){ce.preventDefault(),ce.persist(),J(ce),se.current=[],e2(ce)&&Promise.resolve(i(ce)).then(function(we){Sb(ce)&&!O||rt(we,ce)}).catch(function(we){return be(we)}),W({type:"reset"})},[i,rt,be,O]),et=S.useCallback(function(){if(le.current){W({type:"openDialog"}),Y();var ce={multiple:s,types:V};window.showOpenFilePicker(ce).then(function(we){return i(we)}).then(function(we){rt(we,null),W({type:"closeDialog"})}).catch(function(we){qVe(we)?(z(we),W({type:"closeDialog"})):XVe(we)?(le.current=!1,N.current?(N.current.value=null,N.current.click()):be(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 was provided."))):be(we)});return}N.current&&(W({type:"openDialog"}),Y(),N.current.value=null,N.current.click())},[W,Y,z,C,rt,be,V,s]),nt=S.useCallback(function(ce){!R.current||!R.current.isEqualNode(ce.target)||(ce.key===" "||ce.key==="Enter"||ce.keyCode===32||ce.keyCode===13)&&(ce.preventDefault(),et())},[R,et]),ve=S.useCallback(function(){W({type:"focus"})},[]),Qe=S.useCallback(function(){W({type:"blur"})},[]),ct=S.useCallback(function(){P||(WVe()?setTimeout(et,0):et())},[P,et]),Je=function(we){return r?null:we},st=function(we){return L?null:Je(we)},wt=function(we){return A?null:Je(we)},J=function(we){O&&we.stopPropagation()},xe=S.useMemo(function(){return function(){var ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},we=ce.refKey,ot=we===void 0?"ref":we,mt=ce.role,me=ce.onKeyDown,lt=ce.onFocus,bt=ce.onBlur,Te=ce.onClick,qe=ce.onDragEnter,Ut=ce.onDragOver,Ee=ce.onDragLeave,tt=ce.onDrop,Ge=wb(ce,JVe);return Dn(Dn(x7({onKeyDown:st(La(me,nt)),onFocus:st(La(lt,ve)),onBlur:st(La(bt,Qe)),onClick:Je(La(Te,ct)),onDragEnter:wt(La(qe,De)),onDragOver:wt(La(Ut,fe)),onDragLeave:wt(La(Ee,Xe)),onDrop:wt(La(tt,Ze)),role:typeof mt=="string"&&mt!==""?mt:"presentation"},ot,R),!r&&!L?{tabIndex:0}:{}),Ge)}},[R,nt,ve,Qe,ct,De,fe,Xe,Ze,L,A,r]),Me=S.useCallback(function(ce){ce.stopPropagation()},[]),$e=S.useMemo(function(){return function(){var ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},we=ce.refKey,ot=we===void 0?"ref":we,mt=ce.onChange,me=ce.onClick,lt=wb(ce,eUe),bt=x7({accept:D,multiple:s,type:"file",style:{display:"none"},onChange:Je(La(mt,Ze)),onClick:Je(La(me,Me)),tabIndex:-1},ot,N);return Dn(Dn({},bt),lt)}},[N,n,s,Ze,r]);return Dn(Dn({},B),{},{isFocused:X&&!r,getRootProps:xe,getInputProps:$e,rootRef:R,inputRef:N,open:Je(et)})}function uUe(e,t){switch(t.type){case"focus":return Dn(Dn({},e),{},{isFocused:!0});case"blur":return Dn(Dn({},e),{},{isFocused:!1});case"openDialog":return Dn(Dn({},_7),{},{isFileDialogActive:!0});case"closeDialog":return Dn(Dn({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Dn(Dn({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Dn(Dn({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return Dn({},_7);default:return e}}function O$(){}const cUe=e=>{const{isDragAccept:t,isDragReject:n,overlaySecondaryText:r,setIsHandlingUpload:i}=e;return Re("esc",()=>{i(!1)}),j("div",{className:"dropzone-container",children:[t&&b("div",{className:"dropzone-overlay is-drag-accept",children:j(xc,{size:"lg",children:["Upload Image",r]})}),n&&j("div",{className:"dropzone-overlay is-drag-reject",children:[b(xc,{size:"lg",children:"Invalid Upload"}),b(xc,{size:"md",children:"Must be single JPEG or PNG image"})]})]})},dUe=e=>{const{children:t}=e,n=ge(),r=ne(Un),i=_1({}),{t:o}=Ce(),[a,s]=S.useState(!1),{setOpenUploader:l}=J_(),u=S.useCallback(k=>{s(!0);const P=k.errors.reduce((L,A)=>`${L} -${A.message}`,"");i({title:o("toast:uploadFailed"),description:P,status:"error",isClosable:!0})},[o,i]),c=S.useCallback(async k=>{n(yR({imageFile:k}))},[n]),f=S.useCallback((k,P)=>{P.forEach(L=>{u(L)}),k.forEach(L=>{c(L)})},[c,u]),{getRootProps:p,getInputProps:m,isDragAccept:g,isDragReject:v,isDragActive:x,open:C}=JY({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},noClick:!0,onDrop:f,onDragOver:()=>s(!0),maxFiles:1});l(C),S.useEffect(()=>{const k=P=>{var I;const L=(I=P.clipboardData)==null?void 0:I.items;if(!L)return;const A=[];for(const $ of L)$.kind==="file"&&["image/png","image/jpg"].includes($.type)&&A.push($);if(!A.length)return;if(P.stopImmediatePropagation(),A.length>1){i({description:o("toast:uploadFailedMultipleImagesDesc"),status:"error",isClosable:!0});return}const O=A[0].getAsFile();if(!O){i({description:o("toast:uploadFailedUnableToLoadDesc"),status:"error",isClosable:!0});return}n(yR({imageFile:O}))};return document.addEventListener("paste",k),()=>{document.removeEventListener("paste",k)}},[o,n,i,r]);const w=["img2img","unifiedCanvas"].includes(r)?` to ${vo[r].tooltip}`:"";return b(Q_.Provider,{value:C,children:j("div",{...p({style:{}}),onKeyDown:k=>{k.key},children:[b("input",{...m()}),t,x&&a&&b(cUe,{isDragAccept:g,isDragReject:v,overlaySecondaryText:w,setIsHandlingUpload:s})]})})},fUe=Fe(vn,e=>e.log,{memoizeOptions:{resultEqualityCheck:(e,t)=>e.length===t.length}}),hUe=Fe(vn,e=>({shouldShowLogViewer:e.shouldShowLogViewer,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}),{memoizeOptions:{resultEqualityCheck:Ue}}),pUe=()=>{const e=ge(),t=ne(fUe),{shouldShowLogViewer:n,hasError:r,wasErrorSeen:i}=ne(hUe),[o,a]=S.useState(!0),s=S.useRef(null);S.useLayoutEffect(()=>{s.current!==null&&o&&(s.current.scrollTop=s.current.scrollHeight)},[o,t,n]);const l=()=>{e(EW()),e(Dw(!n))};return Re("`",()=>{e(Dw(!n))},[n]),Re("esc",()=>{e(Dw(!1))}),j(gn,{children:[n&&b(yK,{defaultSize:{width:"100%",height:200},style:{display:"flex",position:"fixed",left:0,bottom:0,zIndex:9999},maxHeight:"90vh",children:b("div",{className:"console",ref:s,onScroll:()=>{s.current&&o&&s.current.scrollTop{const{timestamp:p,message:m,level:g}=c;return j("div",{className:`console-entry console-${g}-color`,children:[j("p",{className:"console-timestamp",children:[p,":"]}),b("p",{className:"console-message",children:m})]},f)})})}),n&&b(ri,{hasArrow:!0,label:o?"Autoscroll On":"Autoscroll Off",children:b(_o,{className:"console-autoscroll-icon-button","data-autoscroll-enabled":o,size:"sm","aria-label":"Toggle autoscroll",variant:"solid",icon:b(oRe,{}),onClick:()=>a(!o)})}),b(ri,{hasArrow:!0,label:n?"Hide Console":"Show Console",children:b(_o,{className:"console-toggle-icon-button","data-error-seen":r||!i,size:"sm",position:"fixed",variant:"solid","aria-label":"Toggle Log Viewer",icon:n?b(SRe,{}):b(sK,{}),onClick:l})})]})},mUe=Fe(vn,e=>({isProcessing:e.isProcessing,currentStep:e.currentStep,totalSteps:e.totalSteps,currentStatusHasSteps:e.currentStatusHasSteps}),{memoizeOptions:{resultEqualityCheck:Ue}}),gUe=()=>{const{isProcessing:e,currentStep:t,totalSteps:n,currentStatusHasSteps:r}=ne(mUe),i=t?Math.round(t*100/n):0;return b(rV,{value:i,isIndeterminate:e&&!r,className:"progress-bar"})};function vUe(e){const{title:t,hotkey:n,description:r}=e;return j("div",{className:"hotkey-modal-item",children:[j("div",{className:"hotkey-info",children:[b("p",{className:"hotkey-title",children:t}),r&&b("p",{className:"hotkey-description",children:r})]}),b("div",{className:"hotkey-key",children:n})]})}function yUe({children:e}){const{isOpen:t,onOpen:n,onClose:r}=Mc(),{t:i}=Ce(),o=[{title:i("hotkeys:invoke.title"),desc:i("hotkeys:invoke.desc"),hotkey:"Ctrl+Enter"},{title:i("hotkeys:cancel.title"),desc:i("hotkeys:cancel.desc"),hotkey:"Shift+X"},{title:i("hotkeys:focusPrompt.title"),desc:i("hotkeys:focusPrompt.desc"),hotkey:"Alt+A"},{title:i("hotkeys:toggleOptions.title"),desc:i("hotkeys:toggleOptions.desc"),hotkey:"O"},{title:i("hotkeys:pinOptions.title"),desc:i("hotkeys:pinOptions.desc"),hotkey:"Shift+O"},{title:i("hotkeys:toggleViewer.title"),desc:i("hotkeys:toggleViewer.desc"),hotkey:"Z"},{title:i("hotkeys:toggleGallery.title"),desc:i("hotkeys:toggleGallery.desc"),hotkey:"G"},{title:i("hotkeys:maximizeWorkSpace.title"),desc:i("hotkeys:maximizeWorkSpace.desc"),hotkey:"F"},{title:i("hotkeys:changeTabs.title"),desc:i("hotkeys:changeTabs.desc"),hotkey:"1-5"},{title:i("hotkeys:consoleToggle.title"),desc:i("hotkeys:consoleToggle.desc"),hotkey:"`"}],a=[{title:i("hotkeys:setPrompt.title"),desc:i("hotkeys:setPrompt.desc"),hotkey:"P"},{title:i("hotkeys:setSeed.title"),desc:i("hotkeys:setSeed.desc"),hotkey:"S"},{title:i("hotkeys:setParameters.title"),desc:i("hotkeys:setParameters.desc"),hotkey:"A"},{title:i("hotkeys:restoreFaces.title"),desc:i("hotkeys:restoreFaces.desc"),hotkey:"Shift+R"},{title:i("hotkeys:upscale.title"),desc:i("hotkeys:upscale.desc"),hotkey:"Shift+U"},{title:i("hotkeys:showInfo.title"),desc:i("hotkeys:showInfo.desc"),hotkey:"I"},{title:i("hotkeys:sendToImageToImage.title"),desc:i("hotkeys:sendToImageToImage.desc"),hotkey:"Shift+I"},{title:i("hotkeys:deleteImage.title"),desc:i("hotkeys:deleteImage.desc"),hotkey:"Del"},{title:i("hotkeys:closePanels.title"),desc:i("hotkeys:closePanels.desc"),hotkey:"Esc"}],s=[{title:i("hotkeys:previousImage.title"),desc:i("hotkeys:previousImage.desc"),hotkey:"Arrow Left"},{title:i("hotkeys:nextImage.title"),desc:i("hotkeys:nextImage.desc"),hotkey:"Arrow Right"},{title:i("hotkeys:toggleGalleryPin.title"),desc:i("hotkeys:toggleGalleryPin.desc"),hotkey:"Shift+G"},{title:i("hotkeys:increaseGalleryThumbSize.title"),desc:i("hotkeys:increaseGalleryThumbSize.desc"),hotkey:"Shift+Up"},{title:i("hotkeys:decreaseGalleryThumbSize.title"),desc:i("hotkeys:decreaseGalleryThumbSize.desc"),hotkey:"Shift+Down"}],l=[{title:i("hotkeys:selectBrush.title"),desc:i("hotkeys:selectBrush.desc"),hotkey:"B"},{title:i("hotkeys:selectEraser.title"),desc:i("hotkeys:selectEraser.desc"),hotkey:"E"},{title:i("hotkeys:decreaseBrushSize.title"),desc:i("hotkeys:decreaseBrushSize.desc"),hotkey:"["},{title:i("hotkeys:increaseBrushSize.title"),desc:i("hotkeys:increaseBrushSize.desc"),hotkey:"]"},{title:i("hotkeys:decreaseBrushOpacity.title"),desc:i("hotkeys:decreaseBrushOpacity.desc"),hotkey:"Shift + ["},{title:i("hotkeys:increaseBrushOpacity.title"),desc:i("hotkeys:increaseBrushOpacity.desc"),hotkey:"Shift + ]"},{title:i("hotkeys:moveTool.title"),desc:i("hotkeys:moveTool.desc"),hotkey:"V"},{title:i("hotkeys:fillBoundingBox.title"),desc:i("hotkeys:fillBoundingBox.desc"),hotkey:"Shift + F"},{title:i("hotkeys:eraseBoundingBox.title"),desc:i("hotkeys:eraseBoundingBox.desc"),hotkey:"Delete / Backspace"},{title:i("hotkeys:colorPicker.title"),desc:i("hotkeys:colorPicker.desc"),hotkey:"C"},{title:i("hotkeys:toggleSnap.title"),desc:i("hotkeys:toggleSnap.desc"),hotkey:"N"},{title:i("hotkeys:quickToggleMove.title"),desc:i("hotkeys:quickToggleMove.desc"),hotkey:"Hold Space"},{title:i("hotkeys:toggleLayer.title"),desc:i("hotkeys:toggleLayer.desc"),hotkey:"Q"},{title:i("hotkeys:clearMask.title"),desc:i("hotkeys:clearMask.desc"),hotkey:"Shift+C"},{title:i("hotkeys:hideMask.title"),desc:i("hotkeys:hideMask.desc"),hotkey:"H"},{title:i("hotkeys:showHideBoundingBox.title"),desc:i("hotkeys:showHideBoundingBox.desc"),hotkey:"Shift+H"},{title:i("hotkeys:mergeVisible.title"),desc:i("hotkeys:mergeVisible.desc"),hotkey:"Shift+M"},{title:i("hotkeys:saveToGallery.title"),desc:i("hotkeys:saveToGallery.desc"),hotkey:"Shift+S"},{title:i("hotkeys:copyToClipboard.title"),desc:i("hotkeys:copyToClipboard.desc"),hotkey:"Ctrl+C"},{title:i("hotkeys:downloadImage.title"),desc:i("hotkeys:downloadImage.desc"),hotkey:"Shift+D"},{title:i("hotkeys:undoStroke.title"),desc:i("hotkeys:undoStroke.desc"),hotkey:"Ctrl+Z"},{title:i("hotkeys:redoStroke.title"),desc:i("hotkeys:redoStroke.desc"),hotkey:"Ctrl+Shift+Z, Ctrl+Y"},{title:i("hotkeys:resetView.title"),desc:i("hotkeys:resetView.desc"),hotkey:"R"},{title:i("hotkeys:previousStagingImage.title"),desc:i("hotkeys:previousStagingImage.desc"),hotkey:"Arrow Left"},{title:i("hotkeys:nextStagingImage.title"),desc:i("hotkeys:nextStagingImage.desc"),hotkey:"Arrow Right"},{title:i("hotkeys:acceptStagingImage.title"),desc:i("hotkeys:acceptStagingImage.desc"),hotkey:"Enter"}],u=c=>{const f=[];return c.forEach((p,m)=>{f.push(b(vUe,{title:p.title,description:p.desc,hotkey:p.hotkey},m))}),b("div",{className:"hotkey-modal-category",children:f})};return j(gn,{children:[S.cloneElement(e,{onClick:n}),j(su,{isOpen:t,onClose:r,children:[b(lu,{}),j(Fc,{className:" modal hotkeys-modal",children:[b(b1,{className:"modal-close-btn"}),b("h1",{children:"Keyboard Shorcuts"}),b("div",{className:"hotkeys-modal-items",children:j(E9,{allowMultiple:!0,children:[j(af,{children:[j(rf,{className:"hotkeys-modal-button",children:[b("h2",{children:i("hotkeys:appHotkeys")}),b(of,{})]}),b(sf,{children:u(o)})]}),j(af,{children:[j(rf,{className:"hotkeys-modal-button",children:[b("h2",{children:i("hotkeys:generalHotkeys")}),b(of,{})]}),b(sf,{children:u(a)})]}),j(af,{children:[j(rf,{className:"hotkeys-modal-button",children:[b("h2",{children:i("hotkeys:galleryHotkeys")}),b(of,{})]}),b(sf,{children:u(s)})]}),j(af,{children:[j(rf,{className:"hotkeys-modal-button",children:[b("h2",{children:i("hotkeys:unifiedCanvasHotkeys")}),b(of,{})]}),b(sf,{children:u(l)})]})]})})]})]})]})}var M$=Array.isArray,I$=Object.keys,bUe=Object.prototype.hasOwnProperty,SUe=typeof Element<"u";function k7(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=M$(e),r=M$(t),i,o,a;if(n&&r){if(o=e.length,o!=t.length)return!1;for(i=o;i--!==0;)if(!k7(e[i],t[i]))return!1;return!0}if(n!=r)return!1;var s=e instanceof Date,l=t instanceof Date;if(s!=l)return!1;if(s&&l)return e.getTime()==t.getTime();var u=e instanceof RegExp,c=t instanceof RegExp;if(u!=c)return!1;if(u&&c)return e.toString()==t.toString();var f=I$(e);if(o=f.length,o!==I$(t).length)return!1;for(i=o;i--!==0;)if(!bUe.call(t,f[i]))return!1;if(SUe&&e instanceof Element&&t instanceof Element)return e===t;for(i=o;i--!==0;)if(a=f[i],!(a==="_owner"&&e.$$typeof)&&!k7(e[a],t[a]))return!1;return!0}return e!==e&&t!==t}var Ll=function(t,n){try{return k7(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}},wUe=function(t){return CUe(t)&&!xUe(t)};function CUe(e){return!!e&&typeof e=="object"}function xUe(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||EUe(e)}var _Ue=typeof Symbol=="function"&&Symbol.for,kUe=_Ue?Symbol.for("react.element"):60103;function EUe(e){return e.$$typeof===kUe}function PUe(e){return Array.isArray(e)?[]:{}}function Cb(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Zg(PUe(e),e,t):e}function TUe(e,t,n){return e.concat(t).map(function(r){return Cb(r,n)})}function LUe(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(i){r[i]=Cb(e[i],n)}),Object.keys(t).forEach(function(i){!n.isMergeableObject(t[i])||!e[i]?r[i]=Cb(t[i],n):r[i]=Zg(e[i],t[i],n)}),r}function Zg(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||TUe,n.isMergeableObject=n.isMergeableObject||wUe;var r=Array.isArray(t),i=Array.isArray(e),o=r===i;return o?r?n.arrayMerge(e,t,n):LUe(e,t,n):Cb(t,n)}Zg.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,i){return Zg(r,i,n)},{})};var E7=Zg,AUe=typeof global=="object"&&global&&global.Object===Object&&global;const eq=AUe;var OUe=typeof self=="object"&&self&&self.Object===Object&&self,MUe=eq||OUe||Function("return this")();const hs=MUe;var IUe=hs.Symbol;const hu=IUe;var tq=Object.prototype,RUe=tq.hasOwnProperty,$Ue=tq.toString,im=hu?hu.toStringTag:void 0;function DUe(e){var t=RUe.call(e,im),n=e[im];try{e[im]=void 0;var r=!0}catch(o){}var i=$Ue.call(e);return r&&(t?e[im]=n:delete e[im]),i}var NUe=Object.prototype,BUe=NUe.toString;function FUe(e){return BUe.call(e)}var zUe="[object Null]",jUe="[object Undefined]",R$=hu?hu.toStringTag:void 0;function cd(e){return e==null?e===void 0?jUe:zUe:R$&&R$ in Object(e)?DUe(e):FUe(e)}function nq(e,t){return function(n){return e(t(n))}}var HUe=nq(Object.getPrototypeOf,Object);const Gk=HUe;function dd(e){return e!=null&&typeof e=="object"}var VUe="[object Object]",UUe=Function.prototype,WUe=Object.prototype,rq=UUe.toString,GUe=WUe.hasOwnProperty,KUe=rq.call(Object);function $$(e){if(!dd(e)||cd(e)!=VUe)return!1;var t=Gk(e);if(t===null)return!0;var n=GUe.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&rq.call(n)==KUe}function YUe(){this.__data__=[],this.size=0}function iq(e,t){return e===t||e!==e&&t!==t}function T4(e,t){for(var n=e.length;n--;)if(iq(e[n][0],t))return n;return-1}var qUe=Array.prototype,XUe=qUe.splice;function ZUe(e){var t=this.__data__,n=T4(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():XUe.call(t,n,1),--this.size,!0}function QUe(e){var t=this.__data__,n=T4(t,e);return n<0?void 0:t[n][1]}function JUe(e){return T4(this.__data__,e)>-1}function eWe(e,t){var n=this.__data__,r=T4(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function nl(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=sGe}var lGe="[object Arguments]",uGe="[object Array]",cGe="[object Boolean]",dGe="[object Date]",fGe="[object Error]",hGe="[object Function]",pGe="[object Map]",mGe="[object Number]",gGe="[object Object]",vGe="[object RegExp]",yGe="[object Set]",bGe="[object String]",SGe="[object WeakMap]",wGe="[object ArrayBuffer]",CGe="[object DataView]",xGe="[object Float32Array]",_Ge="[object Float64Array]",kGe="[object Int8Array]",EGe="[object Int16Array]",PGe="[object Int32Array]",TGe="[object Uint8Array]",LGe="[object Uint8ClampedArray]",AGe="[object Uint16Array]",OGe="[object Uint32Array]",Cn={};Cn[xGe]=Cn[_Ge]=Cn[kGe]=Cn[EGe]=Cn[PGe]=Cn[TGe]=Cn[LGe]=Cn[AGe]=Cn[OGe]=!0;Cn[lGe]=Cn[uGe]=Cn[wGe]=Cn[cGe]=Cn[CGe]=Cn[dGe]=Cn[fGe]=Cn[hGe]=Cn[pGe]=Cn[mGe]=Cn[gGe]=Cn[vGe]=Cn[yGe]=Cn[bGe]=Cn[SGe]=!1;function MGe(e){return dd(e)&&dq(e.length)&&!!Cn[cd(e)]}function Kk(e){return function(t){return e(t)}}var fq=typeof exports=="object"&&exports&&!exports.nodeType&&exports,tg=fq&&typeof module=="object"&&module&&!module.nodeType&&module,IGe=tg&&tg.exports===fq,l6=IGe&&eq.process,RGe=function(){try{var e=tg&&tg.require&&tg.require("util").types;return e||l6&&l6.binding&&l6.binding("util")}catch(t){}}();const kh=RGe;var j$=kh&&kh.isTypedArray,$Ge=j$?Kk(j$):MGe;const DGe=$Ge;var NGe=Object.prototype,BGe=NGe.hasOwnProperty;function hq(e,t){var n=H1(e),r=!n&&QWe(e),i=!n&&!r&&cq(e),o=!n&&!r&&!i&&DGe(e),a=n||r||i||o,s=a?KWe(e.length,String):[],l=s.length;for(var u in e)(t||BGe.call(e,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||aGe(u,l)))&&s.push(u);return s}var FGe=Object.prototype;function Yk(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||FGe;return e===n}var zGe=nq(Object.keys,Object);const jGe=zGe;var HGe=Object.prototype,VGe=HGe.hasOwnProperty;function UGe(e){if(!Yk(e))return jGe(e);var t=[];for(var n in Object(e))VGe.call(e,n)&&n!="constructor"&&t.push(n);return t}function pq(e){return e!=null&&dq(e.length)&&!oq(e)}function qk(e){return pq(e)?hq(e):UGe(e)}function WGe(e,t){return e&&A4(t,qk(t),e)}function GGe(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var KGe=Object.prototype,YGe=KGe.hasOwnProperty;function qGe(e){if(!j1(e))return GGe(e);var t=Yk(e),n=[];for(var r in e)r=="constructor"&&(t||!YGe.call(e,r))||n.push(r);return n}function Xk(e){return pq(e)?hq(e,!0):qGe(e)}function XGe(e,t){return e&&A4(t,Xk(t),e)}var mq=typeof exports=="object"&&exports&&!exports.nodeType&&exports,H$=mq&&typeof module=="object"&&module&&!module.nodeType&&module,ZGe=H$&&H$.exports===mq,V$=ZGe?hs.Buffer:void 0,U$=V$?V$.allocUnsafe:void 0;function QGe(e,t){if(t)return e.slice();var n=e.length,r=U$?U$(n):new e.constructor(n);return e.copy(r),r}function gq(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n=0)&&(n[i]=e[i]);return n}function aD(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var sD=function(t){return Array.isArray(t)&&t.length===0},xi=function(t){return typeof t=="function"},O4=function(t){return t!==null&&typeof t=="object"},XYe=function(t){return String(Math.floor(Number(t)))===t},u6=function(t){return Object.prototype.toString.call(t)==="[object String]"},Pq=function(t){return S.Children.count(t)===0},c6=function(t){return O4(t)&&xi(t.then)};function Ir(e,t,n,r){r===void 0&&(r=0);for(var i=Eq(t);e&&r=0?[]:{}}}return(o===0?e:i)[a[o]]===n?e:(n===void 0?delete i[a[o]]:i[a[o]]=n,o===0&&n===void 0&&delete r[a[o]],r)}function Tq(e,t,n,r){n===void 0&&(n=new WeakMap),r===void 0&&(r={});for(var i=0,o=Object.keys(e);i0?xe.map(function($e){return I($e,Ir(J,$e))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(Me).then(function($e){return $e.reduce(function(ce,we,ot){return we==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||we&&(ce=es(ce,xe[ot],we)),ce},{})})},[I]),D=S.useCallback(function(J){return Promise.all([$(J),p.validationSchema?O(J):{},p.validate?A(J):{}]).then(function(xe){var Me=xe[0],$e=xe[1],ce=xe[2],we=E7.all([Me,$e,ce],{arrayMerge:nqe});return we})},[p.validate,p.validationSchema,$,A,O]),V=fo(function(J){return J===void 0&&(J=P.values),L({type:"SET_ISVALIDATING",payload:!0}),D(J).then(function(xe){return C.current&&(L({type:"SET_ISVALIDATING",payload:!1}),L({type:"SET_ERRORS",payload:xe})),xe})});S.useEffect(function(){a&&C.current===!0&&Ll(m.current,p.initialValues)&&V(m.current)},[a,V]);var Y=S.useCallback(function(J){var xe=J&&J.values?J.values:m.current,Me=J&&J.errors?J.errors:g.current?g.current:p.initialErrors||{},$e=J&&J.touched?J.touched:v.current?v.current:p.initialTouched||{},ce=J&&J.status?J.status:x.current?x.current:p.initialStatus;m.current=xe,g.current=Me,v.current=$e,x.current=ce;var we=function(){L({type:"RESET_FORM",payload:{isSubmitting:!!J&&!!J.isSubmitting,errors:Me,touched:$e,status:ce,values:xe,isValidating:!!J&&!!J.isValidating,submitCount:J&&J.submitCount&&typeof J.submitCount=="number"?J.submitCount:0}})};if(p.onReset){var ot=p.onReset(P.values,Ze);c6(ot)?ot.then(we):we()}else we()},[p.initialErrors,p.initialStatus,p.initialTouched]);S.useEffect(function(){C.current===!0&&!Ll(m.current,p.initialValues)&&(u&&(m.current=p.initialValues,Y()),a&&V(m.current))},[u,p.initialValues,Y,a,V]),S.useEffect(function(){u&&C.current===!0&&!Ll(g.current,p.initialErrors)&&(g.current=p.initialErrors||Xu,L({type:"SET_ERRORS",payload:p.initialErrors||Xu}))},[u,p.initialErrors]),S.useEffect(function(){u&&C.current===!0&&!Ll(v.current,p.initialTouched)&&(v.current=p.initialTouched||t2,L({type:"SET_TOUCHED",payload:p.initialTouched||t2}))},[u,p.initialTouched]),S.useEffect(function(){u&&C.current===!0&&!Ll(x.current,p.initialStatus)&&(x.current=p.initialStatus,L({type:"SET_STATUS",payload:p.initialStatus}))},[u,p.initialStatus,p.initialTouched]);var z=fo(function(J){if(w.current[J]&&xi(w.current[J].validate)){var xe=Ir(P.values,J),Me=w.current[J].validate(xe);return c6(Me)?(L({type:"SET_ISVALIDATING",payload:!0}),Me.then(function($e){return $e}).then(function($e){L({type:"SET_FIELD_ERROR",payload:{field:J,value:$e}}),L({type:"SET_ISVALIDATING",payload:!1})})):(L({type:"SET_FIELD_ERROR",payload:{field:J,value:Me}}),Promise.resolve(Me))}else if(p.validationSchema)return L({type:"SET_ISVALIDATING",payload:!0}),O(P.values,J).then(function($e){return $e}).then(function($e){L({type:"SET_FIELD_ERROR",payload:{field:J,value:$e[J]}}),L({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),R=S.useCallback(function(J,xe){var Me=xe.validate;w.current[J]={validate:Me}},[]),N=S.useCallback(function(J){delete w.current[J]},[]),U=fo(function(J,xe){L({type:"SET_TOUCHED",payload:J});var Me=xe===void 0?i:xe;return Me?V(P.values):Promise.resolve()}),G=S.useCallback(function(J){L({type:"SET_ERRORS",payload:J})},[]),B=fo(function(J,xe){var Me=xi(J)?J(P.values):J;L({type:"SET_VALUES",payload:Me});var $e=xe===void 0?n:xe;return $e?V(Me):Promise.resolve()}),W=S.useCallback(function(J,xe){L({type:"SET_FIELD_ERROR",payload:{field:J,value:xe}})},[]),X=fo(function(J,xe,Me){L({type:"SET_FIELD_VALUE",payload:{field:J,value:xe}});var $e=Me===void 0?n:Me;return $e?V(es(P.values,J,xe)):Promise.resolve()}),re=S.useCallback(function(J,xe){var Me=xe,$e=J,ce;if(!u6(J)){J.persist&&J.persist();var we=J.target?J.target:J.currentTarget,ot=we.type,mt=we.name,me=we.id,lt=we.value,bt=we.checked,Te=we.outerHTML,qe=we.options,Ut=we.multiple;Me=xe||mt||me,$e=/number|range/.test(ot)?(ce=parseFloat(lt),isNaN(ce)?"":ce):/checkbox/.test(ot)?iqe(Ir(P.values,Me),bt,lt):qe&&Ut?rqe(qe):lt}Me&&X(Me,$e)},[X,P.values]),le=fo(function(J){if(u6(J))return function(xe){return re(xe,J)};re(J)}),he=fo(function(J,xe,Me){xe===void 0&&(xe=!0),L({type:"SET_FIELD_TOUCHED",payload:{field:J,value:xe}});var $e=Me===void 0?i:Me;return $e?V(P.values):Promise.resolve()}),se=S.useCallback(function(J,xe){J.persist&&J.persist();var Me=J.target,$e=Me.name,ce=Me.id,we=Me.outerHTML,ot=xe||$e||ce;he(ot,!0)},[he]),Ae=fo(function(J){if(u6(J))return function(xe){return se(xe,J)};se(J)}),be=S.useCallback(function(J){xi(J)?L({type:"SET_FORMIK_STATE",payload:J}):L({type:"SET_FORMIK_STATE",payload:function(){return J}})},[]),De=S.useCallback(function(J){L({type:"SET_STATUS",payload:J})},[]),fe=S.useCallback(function(J){L({type:"SET_ISSUBMITTING",payload:J})},[]),Xe=fo(function(){return L({type:"SUBMIT_ATTEMPT"}),V().then(function(J){var xe=J instanceof Error,Me=!xe&&Object.keys(J).length===0;if(Me){var $e;try{if($e=et(),$e===void 0)return}catch(ce){throw ce}return Promise.resolve($e).then(function(ce){return C.current&&L({type:"SUBMIT_SUCCESS"}),ce}).catch(function(ce){if(C.current)throw L({type:"SUBMIT_FAILURE"}),ce})}else if(C.current&&(L({type:"SUBMIT_FAILURE"}),xe))throw J})}),rt=fo(function(J){J&&J.preventDefault&&xi(J.preventDefault)&&J.preventDefault(),J&&J.stopPropagation&&xi(J.stopPropagation)&&J.stopPropagation(),Xe().catch(function(xe){console.warn("Warning: An unhandled error was caught from submitForm()",xe)})}),Ze={resetForm:Y,validateForm:V,validateField:z,setErrors:G,setFieldError:W,setFieldTouched:he,setFieldValue:X,setStatus:De,setSubmitting:fe,setTouched:U,setValues:B,setFormikState:be,submitForm:Xe},et=fo(function(){return c(P.values,Ze)}),nt=fo(function(J){J&&J.preventDefault&&xi(J.preventDefault)&&J.preventDefault(),J&&J.stopPropagation&&xi(J.stopPropagation)&&J.stopPropagation(),Y()}),ve=S.useCallback(function(J){return{value:Ir(P.values,J),error:Ir(P.errors,J),touched:!!Ir(P.touched,J),initialValue:Ir(m.current,J),initialTouched:!!Ir(v.current,J),initialError:Ir(g.current,J)}},[P.errors,P.touched,P.values]),Qe=S.useCallback(function(J){return{setValue:function(Me,$e){return X(J,Me,$e)},setTouched:function(Me,$e){return he(J,Me,$e)},setError:function(Me){return W(J,Me)}}},[X,he,W]),ct=S.useCallback(function(J){var xe=O4(J),Me=xe?J.name:J,$e=Ir(P.values,Me),ce={name:Me,value:$e,onChange:le,onBlur:Ae};if(xe){var we=J.type,ot=J.value,mt=J.as,me=J.multiple;we==="checkbox"?ot===void 0?ce.checked=!!$e:(ce.checked=!!(Array.isArray($e)&&~$e.indexOf(ot)),ce.value=ot):we==="radio"?(ce.checked=$e===ot,ce.value=ot):mt==="select"&&me&&(ce.value=ce.value||[],ce.multiple=!0)}return ce},[Ae,le,P.values]),Je=S.useMemo(function(){return!Ll(m.current,P.values)},[m.current,P.values]),st=S.useMemo(function(){return typeof s<"u"?Je?P.errors&&Object.keys(P.errors).length===0:s!==!1&&xi(s)?s(p):s:P.errors&&Object.keys(P.errors).length===0},[s,Je,P.errors,p]),wt=sn({},P,{initialValues:m.current,initialErrors:g.current,initialTouched:v.current,initialStatus:x.current,handleBlur:Ae,handleChange:le,handleReset:nt,handleSubmit:rt,resetForm:Y,setErrors:G,setFormikState:be,setFieldTouched:he,setFieldValue:X,setFieldError:W,setStatus:De,setSubmitting:fe,setTouched:U,setValues:B,submitForm:Xe,validateForm:V,validateField:z,isValid:st,dirty:Je,unregisterField:N,registerField:R,getFieldProps:ct,getFieldMeta:ve,getFieldHelpers:Qe,validateOnBlur:i,validateOnChange:n,validateOnMount:a});return wt}function V1(e){var t=JYe(e),n=e.component,r=e.children,i=e.render,o=e.innerRef;return S.useImperativeHandle(o,function(){return t}),S.createElement(ZYe,{value:t},n?S.createElement(n,t):i?i(t):r?xi(r)?r(t):Pq(r)?null:S.Children.only(r):null)}function eqe(e){var t={};if(e.inner){if(e.inner.length===0)return es(t,e.path,e.message);for(var i=e.inner,n=Array.isArray(i),r=0,i=n?i:i[Symbol.iterator]();;){var o;if(n){if(r>=i.length)break;o=i[r++]}else{if(r=i.next(),r.done)break;o=r.value}var a=o;Ir(t,a.path)||(t=es(t,a.path,a.message))}}return t}function tqe(e,t,n,r){n===void 0&&(n=!1),r===void 0&&(r={});var i=O7(e);return t[n?"validateSync":"validate"](i,{abortEarly:!1,context:r})}function O7(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(i){return Array.isArray(i)===!0||$$(i)?O7(i):i!==""?i:void 0}):$$(e[r])?t[r]=O7(e[r]):t[r]=e[r]!==""?e[r]:void 0}return t}function nqe(e,t,n){var r=e.slice();return t.forEach(function(o,a){if(typeof r[a]>"u"){var s=n.clone!==!1,l=s&&n.isMergeableObject(o);r[a]=l?E7(Array.isArray(o)?[]:{},o,n):o}else n.isMergeableObject(o)?r[a]=E7(e[a],o,n):e.indexOf(o)===-1&&r.push(o)}),r}function rqe(e){return Array.from(e).filter(function(t){return t.selected}).map(function(t){return t.value})}function iqe(e,t,n){if(typeof e=="boolean")return Boolean(t);var r=[],i=!1,o=-1;if(Array.isArray(e))r=e,o=e.indexOf(n),i=o>=0;else if(!n||n=="true"||n=="false")return Boolean(t);return t&&n&&!i?r.concat(n):i?r.slice(0,o).concat(r.slice(o+1)):r}var oqe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?S.useLayoutEffect:S.useEffect;function fo(e){var t=S.useRef(e);return oqe(function(){t.current=e}),S.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;ir?i:r},0);return Array.from(sn({},t,{length:n+1}))}else return[]},cqe=function(e){qYe(t,e);function t(r){var i;return i=e.call(this,r)||this,i.updateArrayField=function(o,a,s){var l=i.props,u=l.name,c=l.formik.setFormikState;c(function(f){var p=typeof s=="function"?s:o,m=typeof a=="function"?a:o,g=es(f.values,u,o(Ir(f.values,u))),v=s?p(Ir(f.errors,u)):void 0,x=a?m(Ir(f.touched,u)):void 0;return sD(v)&&(v=void 0),sD(x)&&(x=void 0),sn({},f,{values:g,errors:s?es(f.errors,u,v):f.errors,touched:a?es(f.touched,u,x):f.touched})})},i.push=function(o){return i.updateArrayField(function(a){return[].concat(Eh(a),[YYe(o)])},!1,!1)},i.handlePush=function(o){return function(){return i.push(o)}},i.swap=function(o,a){return i.updateArrayField(function(s){return lqe(s,o,a)},!0,!0)},i.handleSwap=function(o,a){return function(){return i.swap(o,a)}},i.move=function(o,a){return i.updateArrayField(function(s){return sqe(s,o,a)},!0,!0)},i.handleMove=function(o,a){return function(){return i.move(o,a)}},i.insert=function(o,a){return i.updateArrayField(function(s){return d6(s,o,a)},function(s){return d6(s,o,null)},function(s){return d6(s,o,null)})},i.handleInsert=function(o,a){return function(){return i.insert(o,a)}},i.replace=function(o,a){return i.updateArrayField(function(s){return uqe(s,o,a)},!1,!1)},i.handleReplace=function(o,a){return function(){return i.replace(o,a)}},i.unshift=function(o){var a=-1;return i.updateArrayField(function(s){var l=s?[o].concat(s):[o];return a<0&&(a=l.length),l},function(s){var l=s?[null].concat(s):[null];return a<0&&(a=l.length),l},function(s){var l=s?[null].concat(s):[null];return a<0&&(a=l.length),l}),a},i.handleUnshift=function(o){return function(){return i.unshift(o)}},i.handleRemove=function(o){return function(){return i.remove(o)}},i.handlePop=function(){return function(){return i.pop()}},i.remove=i.remove.bind(aD(i)),i.pop=i.pop.bind(aD(i)),i}var n=t.prototype;return n.componentDidUpdate=function(i){this.props.validateOnChange&&this.props.formik.validateOnChange&&!Ll(Ir(i.formik.values,i.name),Ir(this.props.formik.values,this.props.name))&&this.props.formik.validateForm(this.props.formik.values)},n.remove=function(i){var o;return this.updateArrayField(function(a){var s=a?Eh(a):[];return o||(o=s[i]),xi(s.splice)&&s.splice(i,1),s},!0,!0),o},n.pop=function(){var i;return this.updateArrayField(function(o){var a=o;return i||(i=a&&a.pop&&a.pop()),a},!0,!0),i},n.render=function(){var i={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},o=this.props,a=o.component,s=o.render,l=o.children,u=o.name,c=o.formik,f=vc(c,["validate","validationSchema"]),p=sn({},i,{form:f,name:u});return a?S.createElement(a,p):s?s(p):l?typeof l=="function"?l(p):Pq(l)?null:S.Children.only(l):null},t}(S.Component);cqe.defaultProps={validateOnChange:!0};var dqe=E_,fqe=$1,hqe=E1,lD=us,pqe=Zh;function mqe(e,t,n,r){if(!lD(e))return e;t=fqe(t,e);for(var i=-1,o=t.length,a=o-1,s=e;s!=null&&++i{const{openModel:t,model_list:n}=e;return{model_list:n,openModel:t}},{memoizeOptions:{resultEqualityCheck:Ue}}),uD=64,cD=2048;function Tqe(){const{openModel:e,model_list:t}=ne(Pqe),n=ne(l=>l.system.isProcessing),r=ge(),{t:i}=Ce(),[o,a]=S.useState({name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,default:!1,format:"ckpt"});S.useEffect(()=>{var l,u,c,f,p,m,g;if(e){const v=Aq(t,(x,C)=>Ue(C,e));a({name:e,description:(l=v[e])==null?void 0:l.description,config:(u=v[e])==null?void 0:u.config,weights:(c=v[e])==null?void 0:c.weights,vae:(f=v[e])==null?void 0:f.vae,width:(p=v[e])==null?void 0:p.width,height:(m=v[e])==null?void 0:m.height,default:(g=v[e])==null?void 0:g.default,format:"ckpt"})}},[t,e]);const s=l=>{r(I1({...l,width:Number(l.width),height:Number(l.height)}))};return e?j(Le,{flexDirection:"column",rowGap:"1rem",width:"100%",children:[b(Le,{alignItems:"center",children:b(Lt,{fontSize:"lg",fontWeight:"bold",children:e})}),b(Le,{flexDirection:"column",maxHeight:window.innerHeight-270,overflowY:"scroll",paddingRight:"2rem",children:b(V1,{enableReinitialize:!0,initialValues:o,onSubmit:s,children:({handleSubmit:l,errors:u,touched:c})=>b("form",{onSubmit:l,children:j($t,{rowGap:"0.5rem",alignItems:"start",children:[j(Tt,{isInvalid:!!u.description&&c.description,isRequired:!0,children:[b(Ht,{htmlFor:"description",fontSize:"sm",children:i("modelmanager:description")}),j($t,{alignItems:"start",children:[b(En,{as:Bn,id:"description",name:"description",type:"text",width:"lg"}),u.description&&c.description?b(_n,{children:u.description}):b(xn,{margin:0,children:i("modelmanager:descriptionValidationMsg")})]})]}),j(Tt,{isInvalid:!!u.config&&c.config,isRequired:!0,children:[b(Ht,{htmlFor:"config",fontSize:"sm",children:i("modelmanager:config")}),j($t,{alignItems:"start",children:[b(En,{as:Bn,id:"config",name:"config",type:"text",width:"lg"}),u.config&&c.config?b(_n,{children:u.config}):b(xn,{margin:0,children:i("modelmanager:configValidationMsg")})]})]}),j(Tt,{isInvalid:!!u.weights&&c.weights,isRequired:!0,children:[b(Ht,{htmlFor:"config",fontSize:"sm",children:i("modelmanager:modelLocation")}),j($t,{alignItems:"start",children:[b(En,{as:Bn,id:"weights",name:"weights",type:"text",width:"lg"}),u.weights&&c.weights?b(_n,{children:u.weights}):b(xn,{margin:0,children:i("modelmanager:modelLocationValidationMsg")})]})]}),j(Tt,{isInvalid:!!u.vae&&c.vae,children:[b(Ht,{htmlFor:"vae",fontSize:"sm",children:i("modelmanager:vaeLocation")}),j($t,{alignItems:"start",children:[b(En,{as:Bn,id:"vae",name:"vae",type:"text",width:"lg"}),u.vae&&c.vae?b(_n,{children:u.vae}):b(xn,{margin:0,children:i("modelmanager:vaeLocationValidationMsg")})]})]}),j(f1,{width:"100%",children:[j(Tt,{isInvalid:!!u.width&&c.width,children:[b(Ht,{htmlFor:"width",fontSize:"sm",children:i("modelmanager:width")}),j($t,{alignItems:"start",children:[b(En,{id:"width",name:"width",children:({field:f,form:p})=>b(pi,{id:"width",name:"width",min:uD,max:cD,step:64,value:p.values.width,onChange:m=>p.setFieldValue(f.name,Number(m))})}),u.width&&c.width?b(_n,{children:u.width}):b(xn,{margin:0,children:i("modelmanager:widthValidationMsg")})]})]}),j(Tt,{isInvalid:!!u.height&&c.height,children:[b(Ht,{htmlFor:"height",fontSize:"sm",children:i("modelmanager:height")}),j($t,{alignItems:"start",children:[b(En,{id:"height",name:"height",children:({field:f,form:p})=>b(pi,{id:"height",name:"height",min:uD,max:cD,step:64,value:p.values.height,onChange:m=>p.setFieldValue(f.name,Number(m))})}),u.height&&c.height?b(_n,{children:u.height}):b(xn,{margin:0,children:i("modelmanager:heightValidationMsg")})]})]})]}),b(kn,{type:"submit",className:"modal-close-btn",isLoading:n,children:i("modelmanager:updateModel")})]})})})})]}):b(Le,{width:"100%",justifyContent:"center",alignItems:"center",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",children:b(Lt,{fontWeight:"bold",color:"var(--subtext-color-bright)",children:"Pick A Model To Edit"})})}const Lqe=Fe([vn],e=>{const{openModel:t,model_list:n}=e;return{model_list:n,openModel:t}},{memoizeOptions:{resultEqualityCheck:Ue}});function Aqe(){const{openModel:e,model_list:t}=ne(Lqe),n=ne(l=>l.system.isProcessing),r=ge(),{t:i}=Ce(),[o,a]=S.useState({name:"",description:"",repo_id:"",path:"",vae:{repo_id:"",path:""},default:!1,format:"diffusers"});S.useEffect(()=>{var l,u,c,f,p,m,g,v,x,C,w,k,P,L,A,O;if(e){const I=Aq(t,($,D)=>Ue(D,e));a({name:e,description:(l=I[e])==null?void 0:l.description,path:(u=I[e])!=null&&u.path&&((c=I[e])==null?void 0:c.path)!=="None"?(f=I[e])==null?void 0:f.path:"",repo_id:(p=I[e])!=null&&p.repo_id&&((m=I[e])==null?void 0:m.repo_id)!=="None"?(g=I[e])==null?void 0:g.repo_id:"",vae:{repo_id:(x=(v=I[e])==null?void 0:v.vae)!=null&&x.repo_id?(w=(C=I[e])==null?void 0:C.vae)==null?void 0:w.repo_id:"",path:(P=(k=I[e])==null?void 0:k.vae)!=null&&P.path?(A=(L=I[e])==null?void 0:L.vae)==null?void 0:A.path:""},default:(O=I[e])==null?void 0:O.default,format:"diffusers"})}},[t,e]);const s=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,r(I1(l))};return e?j(Le,{flexDirection:"column",rowGap:"1rem",width:"100%",children:[b(Le,{alignItems:"center",children:b(Lt,{fontSize:"lg",fontWeight:"bold",children:e})}),b(Le,{flexDirection:"column",maxHeight:window.innerHeight-270,overflowY:"scroll",paddingRight:"2rem",children:b(V1,{enableReinitialize:!0,initialValues:o,onSubmit:s,children:({handleSubmit:l,errors:u,touched:c})=>{var f,p,m,g,v,x,C,w,k,P;return b("form",{onSubmit:l,children:j($t,{rowGap:"0.5rem",alignItems:"start",children:[j(Tt,{isInvalid:!!u.description&&c.description,isRequired:!0,children:[b(Ht,{htmlFor:"description",fontSize:"sm",children:i("modelmanager:description")}),j($t,{alignItems:"start",children:[b(En,{as:Bn,id:"description",name:"description",type:"text",width:"lg"}),u.description&&c.description?b(_n,{children:u.description}):b(xn,{margin:0,children:i("modelmanager:descriptionValidationMsg")})]})]}),j(Tt,{isInvalid:!!u.path&&c.path,isRequired:!0,children:[b(Ht,{htmlFor:"path",fontSize:"sm",children:i("modelmanager:modelLocation")}),j($t,{alignItems:"start",children:[b(En,{as:Bn,id:"path",name:"path",type:"text",width:"lg"}),u.path&&c.path?b(_n,{children:u.path}):b(xn,{margin:0,children:i("modelmanager:modelLocationValidationMsg")})]})]}),j(Tt,{isInvalid:!!u.repo_id&&c.repo_id,children:[b(Ht,{htmlFor:"repo_id",fontSize:"sm",children:i("modelmanager:repo_id")}),j($t,{alignItems:"start",children:[b(En,{as:Bn,id:"repo_id",name:"repo_id",type:"text",width:"lg"}),u.repo_id&&c.repo_id?b(_n,{children:u.repo_id}):b(xn,{margin:0,children:i("modelmanager:repoIDValidationMsg")})]})]}),j(Tt,{isInvalid:!!((f=u.vae)!=null&&f.path)&&((p=c.vae)==null?void 0:p.path),children:[b(Ht,{htmlFor:"vae.path",fontSize:"sm",children:i("modelmanager:vaeLocation")}),j($t,{alignItems:"start",children:[b(En,{as:Bn,id:"vae.path",name:"vae.path",type:"text",width:"lg"}),(m=u.vae)!=null&&m.path&&((g=c.vae)!=null&&g.path)?b(_n,{children:(v=u.vae)==null?void 0:v.path}):b(xn,{margin:0,children:i("modelmanager:vaeLocationValidationMsg")})]})]}),j(Tt,{isInvalid:!!((x=u.vae)!=null&&x.repo_id)&&((C=c.vae)==null?void 0:C.repo_id),children:[b(Ht,{htmlFor:"vae.repo_id",fontSize:"sm",children:i("modelmanager:vaeRepoID")}),j($t,{alignItems:"start",children:[b(En,{as:Bn,id:"vae.repo_id",name:"vae.repo_id",type:"text",width:"lg"}),(w=u.vae)!=null&&w.repo_id&&((k=c.vae)!=null&&k.repo_id)?b(_n,{children:(P=u.vae)==null?void 0:P.repo_id}):b(xn,{margin:0,children:i("modelmanager:vaeRepoIDValidationMsg")})]})]}),b(kn,{type:"submit",className:"modal-close-btn",isLoading:n,children:i("modelmanager:updateModel")})]})})}})})]}):b(Le,{width:"100%",justifyContent:"center",alignItems:"center",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",children:b(Lt,{fontWeight:"bold",color:"var(--subtext-color-bright)",children:"Pick A Model To Edit"})})}var Oqe=zG;function Mqe(e){return typeof e=="function"?e:Oqe}var Iqe=Mqe,Rqe=iU,$qe=tk,Dqe=Iqe,Nqe=Mo;function Bqe(e,t){var n=Nqe(e)?Rqe:$qe;return n(e,Dqe(t))}var Fqe=Bqe;function zqe(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var jqe=zqe;function Hqe(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r{const{model_list:t}=e,n=[];return Fqe(t,r=>{n.push(r.weights)}),n});function cXe(){const{t:e}=Ce();return b(ci,{position:"absolute",zIndex:2,right:4,top:4,fontSize:"0.7rem",fontWeight:"bold",backgroundColor:"var(--accent-color)",padding:"0.2rem 0.5rem",borderRadius:"0.2rem",alignItems:"center",children:e("modelmanager:modelExists")})}function dD({model:e,modelsToAdd:t,setModelsToAdd:n}){const r=ne(Oq),i=o=>{t.includes(o.target.value)?n(uXe(t,a=>a!==o.target.value)):n([...t,o.target.value])};return j(ci,{position:"relative",children:[r.includes(e.location)?b(cXe,{}):null,b(fn,{value:e.name,label:b(gn,{children:j($t,{alignItems:"start",children:[b("p",{style:{fontWeight:"bold"},children:e.name}),b("p",{style:{fontStyle:"italic"},children:e.location})]})}),isChecked:t.includes(e.name),isDisabled:r.includes(e.location),onChange:i,padding:"1rem",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",_checked:{backgroundColor:"var(--accent-color)",color:"var(--text-color)"},_disabled:{backgroundColor:"var(--background-color-secondary)"}})]})}function dXe(){const e=ge(),{t}=Ce(),n=ne(v=>v.system.searchFolder),r=ne(v=>v.system.foundModels),i=ne(Oq),o=ne(v=>v.ui.shouldShowExistingModelsInSearch),a=ne(v=>v.system.isProcessing),[s,l]=M.useState([]),u=()=>{e(PW(null)),e(TW(null)),l([])},c=v=>{e(oR(v.checkpointFolder))},f=()=>{l([]),r&&r.forEach(v=>{i.includes(v.location)||l(x=>[...x,v.name])})},p=()=>{l([])},m=()=>{const v=r==null?void 0:r.filter(x=>s.includes(x.name));v==null||v.forEach(x=>{const C={name:x.name,description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:x.location,vae:"",width:512,height:512,default:!1,format:"ckpt"};e(I1(C))}),l([])},g=()=>{const v=[],x=[];return r&&r.forEach((C,w)=>{i.includes(C.location)?x.push(b(dD,{model:C,modelsToAdd:s,setModelsToAdd:l},w)):v.push(b(dD,{model:C,modelsToAdd:s,setModelsToAdd:l},w))}),j(gn,{children:[v,o&&x]})};return j(gn,{children:[n?j(Le,{flexDirection:"column",padding:"1rem",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",rowGap:"0.5rem",position:"relative",children:[b("p",{style:{fontWeight:"bold",fontSize:"0.8rem",backgroundColor:"var(--background-color-secondary)",padding:"0.2rem 1rem",width:"max-content",borderRadius:"0.2rem"},children:t("modelmanager:checkpointFolder")}),b("p",{style:{fontWeight:"bold",fontSize:"0.8rem",maxWidth:"80%"},children:n}),b(Ie,{"aria-label":t("modelmanager:scanAgain"),tooltip:t("modelmanager:scanAgain"),icon:b(m4,{}),position:"absolute",right:16,fontSize:18,disabled:a,onClick:()=>e(oR(n))}),b(Ie,{"aria-label":t("modelmanager:clearCheckpointFolder"),icon:b(D1,{style:{transform:"rotate(45deg)"}}),position:"absolute",right:5,onClick:u})]}):b(V1,{initialValues:{checkpointFolder:""},onSubmit:v=>{c(v)},children:({handleSubmit:v})=>b("form",{onSubmit:v,children:j(f1,{columnGap:"0.5rem",children:[b(Tt,{isRequired:!0,width:"max-content",children:b(En,{as:Bn,id:"checkpointFolder",name:"checkpointFolder",type:"text",width:"lg",size:"md",label:t("modelmanager:checkpointFolder")})}),b(Ie,{icon:b(JRe,{}),"aria-label":t("modelmanager:findModels"),tooltip:t("modelmanager:findModels"),type:"submit",disabled:a})]})})}),r&&j(Le,{flexDirection:"column",rowGap:"1rem",children:[j(Le,{justifyContent:"space-between",alignItems:"center",children:[j("p",{children:[t("modelmanager:modelsFound"),": ",r.length]}),j("p",{children:[t("modelmanager:selected"),": ",s.length]})]}),j(Le,{columnGap:"0.5rem",justifyContent:"space-between",children:[j(Le,{columnGap:"0.5rem",children:[b(kn,{isDisabled:s.length===r.length,onClick:f,children:t("modelmanager:selectAll")}),b(kn,{isDisabled:s.length===0,onClick:p,children:t("modelmanager:deselectAll")}),b(fn,{label:t("modelmanager:showExisting"),isChecked:o,onChange:()=>e(nke(!o))})]}),b(kn,{isDisabled:s.length===0,onClick:m,backgroundColor:s.length>0?"var(--accent-color) !important":"",children:t("modelmanager:addSelected")})]}),j(Le,{rowGap:"1rem",flexDirection:"column",maxHeight:"18rem",overflowY:"scroll",paddingRight:"1rem",paddingLeft:"0.2rem",borderRadius:"0.2rem",children:[r.length>0?s.length===0&&b(Lt,{fontWeight:"bold",fontSize:14,padding:"0.5rem",borderRadius:"0.2rem",margin:"0 0.5rem 0 1rem",textAlign:"center",backgroundColor:"var(--notice-color)",boxShadow:"0 0 200px 6px var(--notice-color)",marginTop:"1rem",width:"max-content",children:t("modelmanager:selectAndAdd")}):b(Lt,{fontWeight:"bold",fontSize:14,padding:"0.5rem",borderRadius:"0.2rem",textAlign:"center",backgroundColor:"var(--status-bad-color)",children:t("modelmanager:noModelsFound")}),g()]})]})]})}const fD=64,hD=2048;function fXe(){const e=ge(),{t}=Ce(),n=ne(u=>u.system.isProcessing);function r(u){return/\s/.test(u)}function i(u){let c;return r(u)&&(c=t("modelmanager:cannotUseSpaces")),c}const o={name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,format:"ckpt",default:!1},a=u=>{e(I1(u)),e(Lc(null))},[s,l]=M.useState(!1);return j(gn,{children:[b(Ie,{"aria-label":t("common:back"),tooltip:t("common:back"),onClick:()=>e(Lc(null)),width:"max-content",position:"absolute",zIndex:1,size:"sm",right:12,top:3,icon:b(bK,{})}),b(dXe,{}),b(fn,{label:t("modelmanager:addManually"),isChecked:s,onChange:()=>l(!s)}),s&&b(V1,{initialValues:o,onSubmit:a,children:({handleSubmit:u,errors:c,touched:f})=>b("form",{onSubmit:u,children:j($t,{rowGap:"0.5rem",children:[b(Lt,{fontSize:20,fontWeight:"bold",alignSelf:"start",children:t("modelmanager:manual")}),j(Tt,{isInvalid:!!c.name&&f.name,isRequired:!0,children:[b(Ht,{htmlFor:"name",fontSize:"sm",children:t("modelmanager:name")}),j($t,{alignItems:"start",children:[b(En,{as:Bn,id:"name",name:"name",type:"text",validate:i,width:"2xl"}),c.name&&f.name?b(_n,{children:c.name}):b(xn,{margin:0,children:t("modelmanager:nameValidationMsg")})]})]}),j(Tt,{isInvalid:!!c.description&&f.description,isRequired:!0,children:[b(Ht,{htmlFor:"description",fontSize:"sm",children:t("modelmanager:description")}),j($t,{alignItems:"start",children:[b(En,{as:Bn,id:"description",name:"description",type:"text",width:"2xl"}),c.description&&f.description?b(_n,{children:c.description}):b(xn,{margin:0,children:t("modelmanager:descriptionValidationMsg")})]})]}),j(Tt,{isInvalid:!!c.config&&f.config,isRequired:!0,children:[b(Ht,{htmlFor:"config",fontSize:"sm",children:t("modelmanager:config")}),j($t,{alignItems:"start",children:[b(En,{as:Bn,id:"config",name:"config",type:"text",width:"2xl"}),c.config&&f.config?b(_n,{children:c.config}):b(xn,{margin:0,children:t("modelmanager:configValidationMsg")})]})]}),j(Tt,{isInvalid:!!c.weights&&f.weights,isRequired:!0,children:[b(Ht,{htmlFor:"config",fontSize:"sm",children:t("modelmanager:modelLocation")}),j($t,{alignItems:"start",children:[b(En,{as:Bn,id:"weights",name:"weights",type:"text",width:"2xl"}),c.weights&&f.weights?b(_n,{children:c.weights}):b(xn,{margin:0,children:t("modelmanager:modelLocationValidationMsg")})]})]}),j(Tt,{isInvalid:!!c.vae&&f.vae,children:[b(Ht,{htmlFor:"vae",fontSize:"sm",children:t("modelmanager:vaeLocation")}),j($t,{alignItems:"start",children:[b(En,{as:Bn,id:"vae",name:"vae",type:"text",width:"2xl"}),c.vae&&f.vae?b(_n,{children:c.vae}):b(xn,{margin:0,children:t("modelmanager:vaeLocationValidationMsg")})]})]}),j(f1,{width:"100%",children:[j(Tt,{isInvalid:!!c.width&&f.width,children:[b(Ht,{htmlFor:"width",fontSize:"sm",children:t("modelmanager:width")}),j($t,{alignItems:"start",children:[b(En,{id:"width",name:"width",children:({field:p,form:m})=>b(pi,{id:"width",name:"width",min:fD,max:hD,step:64,width:"90%",value:m.values.width,onChange:g=>m.setFieldValue(p.name,Number(g))})}),c.width&&f.width?b(_n,{children:c.width}):b(xn,{margin:0,children:t("modelmanager:widthValidationMsg")})]})]}),j(Tt,{isInvalid:!!c.height&&f.height,children:[b(Ht,{htmlFor:"height",fontSize:"sm",children:t("modelmanager:height")}),j($t,{alignItems:"start",children:[b(En,{id:"height",name:"height",children:({field:p,form:m})=>b(pi,{id:"height",name:"height",min:fD,max:hD,width:"90%",step:64,value:m.values.height,onChange:g=>m.setFieldValue(p.name,Number(g))})}),c.height&&f.height?b(_n,{children:c.height}):b(xn,{margin:0,children:t("modelmanager:heightValidationMsg")})]})]})]}),b(kn,{type:"submit",className:"modal-close-btn",isLoading:n,children:t("modelmanager:addModel")})]})})})]})}function n2({children:e}){return b(Le,{flexDirection:"column",backgroundColor:"var(--background-color)",padding:"1rem 1rem",borderRadius:"0.5rem",rowGap:"1rem",width:"100%",children:e})}function hXe(){const e=ge(),{t}=Ce(),n=ne(s=>s.system.isProcessing);function r(s){return/\s/.test(s)}function i(s){let l;return r(s)&&(l=t("modelmanager:cannotUseSpaces")),l}const o={name:"",description:"",repo_id:"",path:"",format:"diffusers",default:!1,vae:{repo_id:"",path:""}},a=s=>{const l=s;s.path===""&&delete l.path,s.repo_id===""&&delete l.repo_id,s.vae.path===""&&delete l.vae.path,s.vae.repo_id===""&&delete l.vae.repo_id,e(I1(l)),e(Lc(null))};return j(Le,{children:[b(Ie,{"aria-label":t("common:back"),tooltip:t("common:back"),onClick:()=>e(Lc(null)),width:"max-content",position:"absolute",zIndex:1,size:"sm",right:12,top:3,icon:b(bK,{})}),b(V1,{initialValues:o,onSubmit:a,children:({handleSubmit:s,errors:l,touched:u})=>{var c,f,p,m,g,v,x,C,w,k;return b("form",{onSubmit:s,children:j($t,{rowGap:"0.5rem",children:[b(n2,{children:j(Tt,{isInvalid:!!l.name&&u.name,isRequired:!0,children:[b(Ht,{htmlFor:"name",fontSize:"sm",children:t("modelmanager:name")}),j($t,{alignItems:"start",children:[b(En,{as:Bn,id:"name",name:"name",type:"text",validate:i,width:"2xl",isRequired:!0}),l.name&&u.name?b(_n,{children:l.name}):b(xn,{margin:0,children:t("modelmanager:nameValidationMsg")})]})]})}),b(n2,{children:j(Tt,{isInvalid:!!l.description&&u.description,isRequired:!0,children:[b(Ht,{htmlFor:"description",fontSize:"sm",children:t("modelmanager:description")}),j($t,{alignItems:"start",children:[b(En,{as:Bn,id:"description",name:"description",type:"text",width:"2xl",isRequired:!0}),l.description&&u.description?b(_n,{children:l.description}):b(xn,{margin:0,children:t("modelmanager:descriptionValidationMsg")})]})]})}),j(n2,{children:[b(Lt,{fontWeight:"bold",fontSize:"sm",children:t("modelmanager:formMessageDiffusersModelLocation")}),b(Lt,{fontSize:"sm",fontStyle:"italic",color:"var(--text-color-secondary)",children:t("modelmanager:formMessageDiffusersModelLocationDesc")}),j(Tt,{isInvalid:!!l.path&&u.path,children:[b(Ht,{htmlFor:"path",fontSize:"sm",children:t("modelmanager:modelLocation")}),j($t,{alignItems:"start",children:[b(En,{as:Bn,id:"path",name:"path",type:"text",width:"2xl"}),l.path&&u.path?b(_n,{children:l.path}):b(xn,{margin:0,children:t("modelmanager:modelLocationValidationMsg")})]})]}),j(Tt,{isInvalid:!!l.repo_id&&u.repo_id,children:[b(Ht,{htmlFor:"repo_id",fontSize:"sm",children:t("modelmanager:repo_id")}),j($t,{alignItems:"start",children:[b(En,{as:Bn,id:"repo_id",name:"repo_id",type:"text",width:"2xl"}),l.repo_id&&u.repo_id?b(_n,{children:l.repo_id}):b(xn,{margin:0,children:t("modelmanager:repoIDValidationMsg")})]})]})]}),j(n2,{children:[b(Lt,{fontWeight:"bold",children:t("modelmanager:formMessageDiffusersVAELocation")}),b(Lt,{fontSize:"sm",fontStyle:"italic",color:"var(--text-color-secondary)",children:t("modelmanager:formMessageDiffusersVAELocationDesc")}),j(Tt,{isInvalid:!!((c=l.vae)!=null&&c.path)&&((f=u.vae)==null?void 0:f.path),children:[b(Ht,{htmlFor:"vae.path",fontSize:"sm",children:t("modelmanager:vaeLocation")}),j($t,{alignItems:"start",children:[b(En,{as:Bn,id:"vae.path",name:"vae.path",type:"text",width:"2xl"}),(p=l.vae)!=null&&p.path&&((m=u.vae)!=null&&m.path)?b(_n,{children:(g=l.vae)==null?void 0:g.path}):b(xn,{margin:0,children:t("modelmanager:vaeLocationValidationMsg")})]})]}),j(Tt,{isInvalid:!!((v=l.vae)!=null&&v.repo_id)&&((x=u.vae)==null?void 0:x.repo_id),children:[b(Ht,{htmlFor:"vae.repo_id",fontSize:"sm",children:t("modelmanager:vaeRepoID")}),j($t,{alignItems:"start",children:[b(En,{as:Bn,id:"vae.repo_id",name:"vae.repo_id",type:"text",width:"2xl"}),(C=l.vae)!=null&&C.repo_id&&((w=u.vae)!=null&&w.repo_id)?b(_n,{children:(k=l.vae)==null?void 0:k.repo_id}):b(xn,{margin:0,children:t("modelmanager:vaeRepoIDValidationMsg")})]})]})]}),b(kn,{type:"submit",className:"modal-close-btn",isLoading:n,children:t("modelmanager:addModel")})]})})}})]})}function pD({text:e,onClick:t}){return b(Le,{position:"relative",width:"50%",height:"200px",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",justifyContent:"center",alignItems:"center",_hover:{cursor:"pointer",backgroundColor:"var(--accent-color)"},onClick:t,children:b(Lt,{fontWeight:"bold",children:e})})}function pXe(){const{isOpen:e,onOpen:t,onClose:n}=Mc(),r=ne(s=>s.ui.addNewModelUIOption),i=ge(),{t:o}=Ce(),a=()=>{n(),i(Lc(null))};return j(gn,{children:[b(kn,{"aria-label":o("modelmanager:addNewModel"),tooltip:o("modelmanager:addNewModel"),onClick:t,className:"modal-close-btn",size:"sm",children:j(Le,{columnGap:"0.5rem",alignItems:"center",children:[b(D1,{}),o("modelmanager:addNew")]})}),j(su,{isOpen:e,onClose:a,size:"3xl",closeOnOverlayClick:!1,children:[b(lu,{}),j(Fc,{className:"modal add-model-modal",fontFamily:"Inter",children:[b(Bh,{children:o("modelmanager:addNewModel")}),b(b1,{marginTop:"0.3rem"}),j(gh,{className:"add-model-modal-body",children:[r==null&&j(Le,{columnGap:"1rem",children:[b(pD,{text:o("modelmanager:addCheckpointModel"),onClick:()=>i(Lc("ckpt"))}),b(pD,{text:o("modelmanager:addDiffuserModel"),onClick:()=>i(Lc("diffusers"))})]}),r=="ckpt"&&b(fXe,{}),r=="diffusers"&&b(hXe,{})]})]})]})]})}function r2(e){const{isProcessing:t,isConnected:n}=ne(m=>m.system),r=ne(m=>m.system.openModel),{t:i}=Ce(),o=ge(),{name:a,status:s,description:l}=e,u=()=>{o(AG(a))},c=()=>{o(_I(a))},f=()=>{o(LTe(a)),o(_I(null))};return j(Le,{alignItems:"center",padding:"0.5rem 0.5rem",borderRadius:"0.2rem",backgroundColor:a===r?"var(--accent-color)":"",_hover:{backgroundColor:a===r?"var(--accent-color)":"var(--background-color)"},children:[b(ci,{onClick:c,cursor:"pointer",children:b(ri,{label:l,hasArrow:!0,placement:"bottom",children:b(Lt,{fontWeight:"bold",children:a})})}),b(OF,{onClick:c,cursor:"pointer"}),j(Le,{gap:2,alignItems:"center",children:[b(Lt,{color:(()=>{switch(s){case"active":return"var(--status-good-color)";case"cached":return"var(--status-working-color)";case"not loaded":return"var(--text-color-secondary)"}})(),children:s}),b(xo,{size:"sm",onClick:u,isDisabled:s==="active"||t||!n,className:"modal-close-btn",children:i("modelmanager:load")}),b(Ie,{icon:b(DRe,{}),size:"sm",onClick:c,"aria-label":"Modify Config",isDisabled:s==="active"||t||!n,className:" modal-close-btn"}),b(Hk,{title:i("modelmanager:deleteModel"),acceptCallback:f,acceptButtonText:i("modelmanager:delete"),triggerComponent:b(Ie,{icon:b($Re,{}),size:"sm","aria-label":i("modelmanager:deleteConfig"),isDisabled:s==="active"||t||!n,className:" modal-close-btn",style:{backgroundColor:"var(--btn-delete-image)"}}),children:j(Le,{rowGap:"1rem",flexDirection:"column",children:[b("p",{style:{fontWeight:"bold"},children:i("modelmanager:deleteMsg1")}),b("p",{style:{color:"var(--text-color-secondary"},children:i("modelmanager:deleteMsg2")})]})})]})]})}var mXe=tk,gXe=P1;function vXe(e,t){var n=-1,r=gXe(e)?Array(e.length):[];return mXe(e,function(i,o,a){r[++n]=t(i,o,a)}),r}var yXe=vXe,bXe=ik,SXe=s4,wXe=yXe,CXe=Mo;function xXe(e,t){var n=CXe(e)?bXe:wXe;return n(e,SXe(t))}var nE=xXe;const _Xe=Fe(vn,e=>nE(e.model_list,(n,r)=>({name:r,...n})),{memoizeOptions:{resultEqualityCheck:Ue}});function f6({label:e,isActive:t,onClick:n}){return b(kn,{onClick:n,isActive:t,_active:{backgroundColor:"var(--accent-color)",_hover:{backgroundColor:"var(--accent-color)"}},size:"sm",children:e})}const kXe=()=>{const e=ne(_Xe),[t,n]=S.useState(""),[r,i]=S.useState("all"),[o,a]=S.useTransition(),{t:s}=Ce(),l=c=>{a(()=>{n(c.target.value)})},u=S.useMemo(()=>{const c=[],f=[],p=[],m=[];return e.forEach((g,v)=>{g.name.toLowerCase().includes(t.toLowerCase())&&(p.push(b(r2,{name:g.name,status:g.status,description:g.description},v)),g.format===r&&m.push(b(r2,{name:g.name,status:g.status,description:g.description},v))),g.format!=="diffusers"?c.push(b(r2,{name:g.name,status:g.status,description:g.description},v)):f.push(b(r2,{name:g.name,status:g.status,description:g.description},v))}),t!==""?r==="all"?b(ci,{marginTop:"1rem",children:p}):b(ci,{marginTop:"1rem",children:m}):j(Le,{flexDirection:"column",rowGap:"1.5rem",children:[r==="all"&&j(gn,{children:[j(ci,{children:[b(Lt,{fontWeight:"bold",backgroundColor:"var(--background-color)",padding:"0.5rem 1rem",borderRadius:"0.5rem",margin:"1rem 0",width:"max-content",fontSize:"14",children:s("modelmanager:checkpointModels")}),c]}),j(ci,{children:[b(Lt,{fontWeight:"bold",backgroundColor:"var(--background-color)",padding:"0.5rem 1rem",borderRadius:"0.5rem",marginBottom:"0.5rem",width:"max-content",fontSize:"14",children:s("modelmanager:diffusersModels")}),f]})]}),r==="ckpt"&&b(Le,{flexDirection:"column",marginTop:"1rem",children:c}),r==="diffusers"&&b(Le,{flexDirection:"column",marginTop:"1rem",children:f})]})},[e,t,s,r]);return j(Le,{flexDirection:"column",rowGap:"2rem",width:"50%",minWidth:"50%",children:[j(Le,{justifyContent:"space-between",children:[b(Lt,{fontSize:"1.4rem",fontWeight:"bold",children:s("modelmanager:availableModels")}),b(pXe,{})]}),b(Bn,{onChange:l,label:s("modelmanager:search")}),j(Le,{flexDirection:"column",gap:1,maxHeight:window.innerHeight-360,overflow:"scroll",paddingRight:"1rem",children:[j(Le,{columnGap:"0.5rem",children:[b(f6,{label:s("modelmanager:allModels"),onClick:()=>i("all"),isActive:r==="all"}),b(f6,{label:s("modelmanager:checkpointModels"),onClick:()=>i("ckpt"),isActive:r==="ckpt"}),b(f6,{label:s("modelmanager:diffusersModels"),onClick:()=>i("diffusers"),isActive:r==="diffusers"})]}),u]})]})};function EXe({children:e}){const{isOpen:t,onOpen:n,onClose:r}=Mc(),i=ne(s=>s.system.model_list),o=ne(s=>s.system.openModel),{t:a}=Ce();return j(gn,{children:[S.cloneElement(e,{onClick:n}),j(su,{isOpen:t,onClose:r,size:"6xl",children:[b(lu,{}),j(Fc,{className:"modal",fontFamily:"Inter",children:[b(b1,{className:"modal-close-btn"}),b(Bh,{fontWeight:"bold",children:a("modelmanager:modelManager")}),j(Le,{padding:"0 1.5rem 1.5rem 1.5rem",width:"100%",columnGap:"2rem",children:[b(kXe,{}),o&&i[o].format==="diffusers"?b(Aqe,{}):b(Tqe,{})]})]})]})]})}const PXe=Fe([vn],e=>{const{isProcessing:t,model_list:n}=e;return{models:nE(n,(i,o)=>o),isProcessing:t}},{memoizeOptions:{resultEqualityCheck:Ue}}),TXe=()=>{const e=ge(),{models:t,isProcessing:n}=ne(PXe),r=ne(jG),i=o=>{e(AG(o.target.value))};return b(Le,{style:{paddingLeft:"0.3rem"},children:b(da,{style:{fontSize:"0.8rem"},tooltip:r.description,isDisabled:n,value:r.name,validValues:t,onChange:i})})},LXe=Fe([vn,od],(e,t)=>{const{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:i,model_list:o,saveIntermediatesInterval:a,enableImageDebugging:s}=e,{shouldUseCanvasBetaLayout:l}=t;return{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:i,models:nE(o,(u,c)=>c),saveIntermediatesInterval:a,enableImageDebugging:s,shouldUseCanvasBetaLayout:l}},{memoizeOptions:{resultEqualityCheck:Ue}}),AXe=({children:e})=>{const t=ge(),{t:n}=Ce(),r=ne(w=>w.generation.steps),{isOpen:i,onOpen:o,onClose:a}=Mc(),{isOpen:s,onOpen:l,onClose:u}=Mc(),{shouldDisplayInProgressType:c,shouldConfirmOnDelete:f,shouldDisplayGuides:p,saveIntermediatesInterval:m,enableImageDebugging:g,shouldUseCanvasBetaLayout:v}=ne(LXe),x=()=>{IG.purge().then(()=>{a(),l()})},C=w=>{w>r&&(w=r),w<1&&(w=1),t(H_e(w))};return j(gn,{children:[S.cloneElement(e,{onClick:o}),j(su,{isOpen:i,onClose:a,size:"lg",children:[b(lu,{}),j(Fc,{className:"modal settings-modal",children:[b(Bh,{className:"settings-modal-header",children:n("common:settingsLabel")}),b(b1,{className:"modal-close-btn"}),j(gh,{className:"settings-modal-content",children:[j("div",{className:"settings-modal-items",children:[j("div",{className:"settings-modal-item",style:{gridAutoFlow:"row",rowGap:"0.5rem"},children:[b(da,{label:n("settings:displayInProgress"),validValues:Zke,value:c,onChange:w=>t($_e(w.target.value))}),c==="full-res"&&b(pi,{label:n("settings:saveSteps"),min:1,max:r,step:1,onChange:C,value:m,width:"auto",textAlign:"center"})]}),b(Jo,{styleClass:"settings-modal-item",label:n("settings:confirmOnDelete"),isChecked:f,onChange:w=>t(kW(w.target.checked))}),b(Jo,{styleClass:"settings-modal-item",label:n("settings:displayHelpIcons"),isChecked:p,onChange:w=>t(F_e(w.target.checked))}),b(Jo,{styleClass:"settings-modal-item",label:n("settings:useCanvasBeta"),isChecked:v,onChange:w=>t(tke(w.target.checked))})]}),j("div",{className:"settings-modal-items",children:[b("h2",{style:{fontWeight:"bold"},children:"Developer"}),b(Jo,{styleClass:"settings-modal-item",label:n("settings:enableImageDebugging"),isChecked:g,onChange:w=>t(V_e(w.target.checked))})]}),j("div",{className:"settings-modal-reset",children:[b(xc,{size:"md",children:n("settings:resetWebUI")}),b(xo,{colorScheme:"red",onClick:x,children:n("settings:resetWebUI")}),b(Lt,{children:n("settings:resetWebUIDesc1")}),b(Lt,{children:n("settings:resetWebUIDesc2")})]})]}),b(E3,{children:b(xo,{onClick:a,className:"modal-close-btn",children:n("common:close")})})]})]}),j(su,{closeOnOverlayClick:!1,isOpen:s,onClose:u,isCentered:!0,children:[b(lu,{bg:"blackAlpha.300",backdropFilter:"blur(40px)"}),b(Fc,{children:b(gh,{pb:6,pt:6,children:b(Le,{justifyContent:"center",children:b(Lt,{fontSize:"lg",children:b(Lt,{children:n("settings:resetComplete")})})})})})]})]})},OXe=Fe(vn,e=>({isConnected:e.isConnected,isProcessing:e.isProcessing,currentIteration:e.currentIteration,totalIterations:e.totalIterations,currentStatus:e.currentStatus,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}),{memoizeOptions:{resultEqualityCheck:Ue}}),MXe=()=>{const{isConnected:e,isProcessing:t,currentIteration:n,totalIterations:r,currentStatus:i,hasError:o,wasErrorSeen:a}=ne(OXe),s=ge(),{t:l}=Ce();let u;e&&!o?u="status-good":u="status-bad";let c=i;return[l("common:statusGenerating"),l("common:statusPreparing"),l("common:statusSavingImage"),l("common:statusRestoringFaces"),l("common:statusUpscaling")].includes(c)&&(u="status-working"),c&&t&&r>1&&(c=`${l(c)} (${n}/${r})`),b(ri,{label:o&&!a?"Click to clear, check logs for details":void 0,children:b(Lt,{cursor:o&&!a?"pointer":"initial",onClick:()=>{(o||!a)&&s(EW())},className:`status ${u}`,children:l(c)})})};function IXe(){const{t:e}=Ce(),{setColorMode:t,colorMode:n}=t1(),r=ge(),i=ne(l=>l.ui.currentTheme),o={dark:e("common:darkTheme"),light:e("common:lightTheme"),green:e("common:greenTheme")};S.useEffect(()=>{n!==i&&t(i)},[t,n,i]);const a=l=>{r(X_e(l))},s=()=>{const l=[];return Object.keys(o).forEach(u=>{l.push(b(kn,{style:{width:"6rem"},leftIcon:i===u?b(ck,{}):void 0,size:"sm",onClick:()=>a(u),children:o[u]},u))}),l};return b(sa,{trigger:"hover",triggerComponent:b(Ie,{"aria-label":e("common:themeLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:b(wRe,{})}),children:b($t,{align:"stretch",children:s()})})}function RXe(){const{t:e,i18n:t}=Ce(),n={en:e("common:langEnglish"),nl:e("common:langDutch"),fr:e("common:langFrench"),de:e("common:langGerman"),it:e("common:langItalian"),ja:e("common:langJapanese"),pl:e("common:langPolish"),pt_br:e("common:langBrPortuguese"),ru:e("common:langRussian"),zh_cn:e("common:langSimplifiedChinese"),es:e("common:langSpanish"),ua:e("common:langUkranian")},r=()=>{const i=[];return Object.keys(n).forEach(o=>{i.push(b(kn,{"data-selected":localStorage.getItem("i18nextLng")===o,onClick:()=>t.changeLanguage(o),className:"modal-close-btn lang-select-btn","aria-label":n[o],tooltip:n[o],size:"sm",minWidth:"200px",children:n[o]},o))}),i};return b(sa,{trigger:"hover",triggerComponent:b(Ie,{"aria-label":e("common:languagePickerLabel"),tooltip:e("common:languagePickerLabel"),icon:b(yRe,{}),size:"sm",variant:"link","data-variant":"link",fontSize:26}),children:b($t,{children:r()})})}const $Xe=()=>{const{t:e}=Ce(),t=ne(n=>n.system.app_version);return j("div",{className:"site-header",children:[j("div",{className:"site-header-left-side",children:[b("img",{src:xY,alt:"invoke-ai-logo"}),j(Le,{alignItems:"center",columnGap:"0.6rem",children:[j(Lt,{fontSize:"1.4rem",children:["invoke ",b("strong",{children:"ai"})]}),b(Lt,{fontWeight:"bold",color:"var(--text-color-secondary)",marginTop:"0.2rem",children:t})]})]}),j("div",{className:"site-header-right-side",children:[b(MXe,{}),b(TXe,{}),b(EXe,{children:b(Ie,{"aria-label":e("modelmanager:modelManager"),tooltip:e("modelmanager:modelManager"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:b(cRe,{})})}),b(yUe,{children:b(Ie,{"aria-label":e("common:hotkeysLabel"),tooltip:e("common:hotkeysLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:b(vRe,{})})}),b(IXe,{}),b(RXe,{}),b(Ie,{"aria-label":e("common:reportBugLabel"),tooltip:e("common:reportBugLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:b(_c,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI/issues",children:b(uRe,{})})}),b(Ie,{"aria-label":e("common:githubLabel"),tooltip:e("common:githubLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:b(_c,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI",children:b(iRe,{})})}),b(Ie,{"aria-label":e("common:discordLabel"),tooltip:e("common:discordLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:b(_c,{isExternal:!0,href:"https://discord.gg/ZmtBAhwWhy",children:b(rRe,{})})}),b(AXe,{children:b(Ie,{"aria-label":e("common:settingsLabel"),tooltip:e("common:settingsLabel"),variant:"link","data-variant":"link",fontSize:22,size:"sm",icon:b(t$e,{})})})]})]})};function DXe(){async function e(n=""){return await fetch(n,{method:"GET",cache:"no-cache"})}const t=()=>{const n=document.location;e(n+"/flaskwebgui-keep-server-alive").then(i=>i)};(!{}.NODE_ENV||{}.NODE_ENV==="production")&&document.addEventListener("DOMContentLoaded",()=>{t(),setInterval(t,3e3)})}const NXe=()=>{const e=ge(),t=ne(yMe),n=_1();S.useEffect(()=>{t.forEach(r=>{n(r)}),t.length>0&&e(W_e())},[e,n,t])},Mq=Fe([sd,od,Un],(e,t,n)=>{const{shouldPinParametersPanel:r,shouldShowParametersPanel:i,shouldHoldParametersPanelOpen:o,shouldUseCanvasBetaLayout:a}=t,{shouldShowGallery:s,shouldPinGallery:l,shouldHoldGalleryOpen:u}=e,c=a&&n==="unifiedCanvas",f=!c&&!(i||o&&!r)&&["txt2img","img2img","unifiedCanvas"].includes(n),p=!(s||u&&!l)&&["txt2img","img2img","unifiedCanvas"].includes(n);return{shouldPinParametersPanel:r,shouldShowProcessButtons:!c&&(!r||!i),shouldShowParametersPanelButton:f,shouldShowParametersPanel:i,shouldShowGallery:s,shouldPinGallery:l,shouldShowGalleryButton:p}},{memoizeOptions:{resultEqualityCheck:Ue}}),BXe=()=>{const e=ge(),{shouldShowParametersPanel:t,shouldShowParametersPanelButton:n,shouldShowProcessButtons:r,shouldPinParametersPanel:i,shouldShowGallery:o,shouldPinGallery:a}=ne(Mq),s=()=>{e(Rs(!0)),i&&setTimeout(()=>e(hr(!0)),400)};return Re("f",()=>{o||t?(e(Rs(!1)),e(Zl(!1))):(e(Rs(!0)),e(Zl(!0))),(a||i)&&setTimeout(()=>e(hr(!0)),400)},[o,t]),n?j("div",{className:"show-hide-button-options",children:[b(Ie,{tooltip:"Show Options Panel (O)",tooltipProps:{placement:"top"},"aria-label":"Show Options Panel",onClick:s,children:b(hk,{})}),r&&j(gn,{children:[b(Ik,{iconButton:!0}),b(Ok,{})]})]}):null},FXe=()=>{const e=ge(),{shouldShowGallery:t,shouldShowGalleryButton:n,shouldPinGallery:r,shouldShowParametersPanel:i,shouldPinParametersPanel:o}=ne(Mq),a=()=>{e(Zl(!0)),r&&e(hr(!0))};return Re("f",()=>{t||i?(e(Rs(!1)),e(Zl(!1))):(e(Rs(!0)),e(Zl(!0))),(r||o)&&setTimeout(()=>e(hr(!0)),400)},[t,i]),n?b(Ie,{tooltip:"Show Gallery (G)",tooltipProps:{placement:"top"},"aria-label":"Show Gallery",styleClass:"floating-show-hide-button right show-hide-button-gallery",onClick:a,children:b(CK,{})}):null};DXe();const zXe=()=>(NXe(),j("div",{className:"App",children:[j(dUe,{children:[b(gUe,{}),j("div",{className:"app-content",children:[b($Xe,{}),b(gVe,{})]}),b("div",{className:"app-console",children:b(pUe,{})})]}),b(BXe,{}),b(FXe,{})]})),mD=()=>b(Le,{width:"100vw",height:"100vh",alignItems:"center",justifyContent:"center",children:b(d1,{thickness:"2px",speed:"1s",emptyColor:"gray.200",color:"gray.400",size:"xl"})});const jXe=qD({key:"invokeai-style-cache",prepend:!0});hx.createRoot(document.getElementById("root")).render(b(M.StrictMode,{children:b(Lye,{store:MG,children:b($V,{loading:b(mD,{}),persistor:IG,children:b(YQ,{value:jXe,children:b(Y2e,{children:b(M.Suspense,{fallback:b(mD,{}),children:b(zXe,{})})})})})})}));export{VXe as __vite_legacy_guard}; diff --git a/invokeai/frontend/dist/assets/index-legacy-3b86d684.js b/invokeai/frontend/dist/assets/index-legacy-3b86d684.js deleted file mode 100644 index 88efe4d2d5..0000000000 --- a/invokeai/frontend/dist/assets/index-legacy-3b86d684.js +++ /dev/null @@ -1,45 +0,0 @@ -!function(){var e=["__cssMap","__cssVars","__breakpoints"],t=["theme","css","__css","sx"],n=["baseStyle"],r=["styleConfig"],o=["as","viewBox","color","focusable","children","className","__css"],i=["attrX","attrY","originX","originY","pathLength","pathSpacing","pathOffset"],a=["transitionEnd","transition"],s=["root"],l=["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from"],u=["ease","times","yoyo","flip","loop"],c=["transitionEnd","transition"],d=["transition","transitionEnd"],f=["transition","transitionEnd"],h=["willChange"],p=["transition","transitionEnd"],v=["in","unmountOnExit","animateOpacity","startingHeight","endingHeight","style","className","transition","transitionEnd"],g=["unmountOnExit","in","className","transition","transitionEnd","delay"],m=["unmountOnExit","in","reverse","initialScale","className","transition","transitionEnd","delay"],y=["direction","style","unmountOnExit","in","className","transition","transitionEnd","delay","motionProps"],b=["unmountOnExit","in","reverse","className","offsetX","offsetY","transition","transitionEnd","delay"],w=["onChange","defaultIndex","index","allowMultiple","allowToggle"],k=["isDisabled","isFocusable","id"],x=["htmlProps"],S=["className","motionProps"],C=["children","reduceMotion"],_=["htmlProps","descendants"],E=["label","thickness","speed","emptyColor","className"],P=["status","addRole"],L=["htmlWidth","htmlHeight","alt"],O=["fallbackSrc","fallback","src","srcSet","align","fit","loading","ignoreFallback","crossOrigin","fallbackStrategy","referrerPolicy"],A=["children","className"],M=["label","placement","spacing","children","className","__css"],T=["isDisabled","isLoading","isActive","children","leftIcon","rightIcon","loadingText","iconSpacing","type","spinner","spinnerPlacement","className","as"],I=["size","colorScheme","variant","className","spacing","isAttached","isDisabled"],R=["icon","children","isRound","aria-label"],N=["id","isRequired","isInvalid","isDisabled","isReadOnly"],D=["getRootProps","htmlProps"],z=["isDisabled","isInvalid","isReadOnly","isRequired"],j=["id","disabled","readOnly","required","isRequired","isInvalid","isReadOnly","isDisabled","onFocus","onBlur"],B=["className","children","requiredIndicator","optionalIndicator"],F=["isIndeterminate","isChecked"],H=["defaultChecked","isChecked","isFocusable","onChange","isIndeterminate","name","value","tabIndex","aria-label","aria-labelledby","aria-invalid"],V=["spacing","className","children","iconColor","iconSize","icon","isChecked","isDisabled","onChange","inputProps"],W=["children","isDisabled","__css"],U=["htmlSize"],G=["children","className"],q=["placement"],Y=["placement"],Z=["className"],X=["className"],$=["ratio","children","className"],K=["className"],Q=["size","centerContent"],J=["size"],ee=["axis"],te=["className"],ne=["className","centerContent"],re=["borderLeftWidth","borderBottomWidth","borderTopWidth","borderRightWidth","borderWidth","borderStyle","borderColor"],oe=["className","orientation","__css"],ie=["direction","align","justify","wrap","basis","grow","shrink"],ae=["templateAreas","gap","rowGap","columnGap","column","row","autoFlow","autoRows","templateRows","autoColumns","templateColumns"],se=["area","colSpan","colStart","colEnd","rowEnd","rowSpan","rowStart"],le=["className"],ue=["className"],ce=["className","isExternal"],de=["isExternal","target","rel","className"],fe=["className"],he=["children","styleType","stylePosition","spacing"],pe=["as"],ve=["as"],ge=["columns","spacingX","spacingY","spacing","minChildWidth"],me=["isInline","direction","align","justify","spacing","wrap","children","divider","className","shouldWrapChildren"],ye=["className","align","decoration","casing"],be=["spacing","spacingX","spacingY","children","justify","direction","align","className","shouldWrapChildren"],we=["className"],ke=["ref","isDisabled","isFocusable","clickOnEnter","clickOnSpace","onMouseDown","onMouseUp","onClick","onKeyDown","onKeyUp","tabIndex","onMouseOver","onMouseLeave"],xe=["size","shadowColor","bg","style"],Se=["containerRef"],Ce=["className"],_e=["onClick","className"],Ee=["preset","motionProps"],Pe=["className","children","containerProps","motionProps"],Le=["className"],Oe=["className"],Ae=["className","transition","motionProps"],Me=["leastDestructiveRef"],Te=["className","children","motionProps","containerProps"],Ie=["focusInputOnChange","clampValueOnBlur","keepWithinRange","min","max","step","isReadOnly","isDisabled","isRequired","isInvalid","pattern","inputMode","allowMouseWheel","id","onChange","precision","name","aria-describedby","aria-label","aria-labelledby","onFocus","onBlur","onInvalid","getAriaValueText","isValidCharacter","format","parse"],Re=["htmlProps"],Ne=["closeOnBlur","closeOnEsc","initialFocusRef","id","returnFocusOnClose","autoFocus","arrowSize","arrowShadowColor","trigger","openDelay","closeDelay","isLazy","lazyBehavior","computePositionOnMount"],De=["children"],ze=["variants"],je=["rootProps","motionProps"],Be=["size","isIndeterminate"],Fe=["size","max","min","valueText","getValueText","value","capIsRound","children","thickness","color","trackColor","isIndeterminate"],He=["min","max","value","isIndeterminate","role"],Ve=["value","min","max","hasStripe","isAnimated","children","borderRadius","isIndeterminate","aria-label","aria-labelledby","title","role"],We=["children","placeholder","className"],Ue=["rootProps","placeholder","icon","color","height","h","minH","minHeight","iconColor","iconSize"],Ge=["children"],qe=["min","max","onChange","value","defaultValue","isReversed","direction","orientation","id","isDisabled","isReadOnly","onChangeStart","onChangeEnd","step","getAriaValueText","aria-valuetext","aria-label","aria-labelledby","name","focusThumbOnChange","minStepsBetweenThumbs"],Ye=["index"],Ze=["value"],Xe=["index"],$e=["getRootProps"],Ke=["min","max","onChange","value","defaultValue","isReversed","direction","orientation","id","isDisabled","isReadOnly","onChangeStart","onChangeEnd","step","getAriaValueText","aria-valuetext","aria-label","aria-labelledby","name","focusThumbOnChange"],Qe=["getInputProps","getRootProps"],Je=["spacing","children"],et=["defaultIndex","onChange","index","isManual","isLazy","lazyBehavior","orientation","direction"],tt=["isDisabled","isFocusable"],nt=["children"],rt=["children","className"],ot=["htmlProps","descendants"],it=["isFitted"],at=["className","rows"],st=["openDelay","closeDelay","closeOnClick","closeOnMouseDown","closeOnScroll","closeOnPointerDown","closeOnEsc","onOpen","onClose","placement","id","isOpen","defaultIsOpen","arrowSize","arrowShadowColor","arrowPadding","modifiers","isDisabled","gutter","offset","direction"],lt=["children","label","shouldWrapChildren","aria-label","hasArrow","bg","portalProps","background","backgroundColor","bgColor","motionProps"],ut=["children","theme","toastOptions"],ct=["boundingBox","generationMode"],dt=["tooltip","styleClass","tooltipProps","asCheckbox","isChecked"],ft=["children","tooltip","tooltipProps","styleClass"],ht=["triggerComponent","children","styleClass","hasArrow"],pt=["label","labelFontSize","styleClass","isDisabled","showStepper","width","textAlign","isInvalid","value","onChange","min","max","isInteger","formControlProps","formLabelProps","numberInputFieldProps","numberInputStepperProps","tooltipProps"],vt=["label","isDisabled","validValues","tooltip","tooltipProps","size","fontSize","styleClass"],gt=["label","styleClass"],mt=["label","value","min","max","step","onChange","width","tooltipSuffix","withSliderMarks","sliderMarkLeftOffset","sliderMarkRightOffset","withInput","isInteger","inputWidth","inputReadOnly","withReset","hideTooltip","isCompact","handleReset","isResetDisabled","isSliderDisabled","isInputDisabled","styleClass","sliderFormControlProps","sliderFormLabelProps","sliderMarkProps","sliderTrackProps","sliderThumbProps","sliderNumberInputProps","sliderNumberInputFieldProps","sliderNumberInputStepperProps","sliderTooltipProps","sliderIAIIconButtonProps"],yt=["scope","children"],bt=["children"],wt=["children"],kt=["asChild"],xt=["scope","children"],St=["disableOutsidePointerEvents","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss"],Ct=["loop","trapped","onMountAutoFocus","onUnmountAutoFocus"],_t=["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","flipAlignment"],Et=["strategy"],Pt=["mainAxis","crossAxis","limiter"],Lt=["__scopePopper","virtualRef"],Ot=["__scopePopper","side","sideOffset","align","alignOffset","arrowPadding","collisionBoundary","collisionPadding","sticky","hideWhenDetached","avoidCollisions"],At=["__scopeRovingFocusGroup","orientation","loop","dir","currentTabStopId","defaultCurrentTabStopId","onCurrentTabStopIdChange","onEntryFocus"],Mt=["__scopeRovingFocusGroup","focusable","active"],Tt=["__scopeMenu"],It=["forceMount"],Rt=["__scopeMenu","loop","trapFocus","onOpenAutoFocus","onCloseAutoFocus","disableOutsidePointerEvents","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","disableOutsideScroll"],Nt=["disabled","onSelect"],Dt=["__scopeMenu","disabled","textValue"],zt=["__scopeContextMenu"],jt=["__scopeContextMenu"],Bt=["__scopeContextMenu"],Ft=["label","isDisabled","width","formControlProps","formLabelProps","styleClass"],Ht=["label","styleClass","isDisabled","fontSize","width","size","isInvalid"],Vt=["iconButton"],Wt=["styleClass"];function Ut(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Ut=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(L){l=function(e,t,n){return e[t]=n}}function u(e,t,n,o){var i=t&&t.prototype instanceof f?t:f,a=Object.create(i.prototype),s=new _(o||[]);return r(a,"_invoke",{value:k(e,n,s)}),a}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(L){return{type:"throw",arg:L}}}e.wrap=u;var d={};function f(){}function h(){}function p(){}var v={};l(v,i,(function(){return this}));var g=Object.getPrototypeOf,m=g&&g(g(E([])));m&&m!==t&&n.call(m,i)&&(v=m);var y=p.prototype=f.prototype=Object.create(v);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function o(r,i,a,s){var l=c(e[r],e,i);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==kn(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){o("next",e,a,s)}),(function(e){o("throw",e,a,s)})):t.resolve(d).then((function(e){u.value=e,a(u)}),(function(e){return o("throw",e,a,s)}))}s(l.arg)}var i;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){o(e,n,t,r)}))}return i=i?i.then(r,r):r()}})}function k(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return P()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=x(a,n);if(s){if(s===d)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=c(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function x(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var o=c(r,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,d;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function E(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function t(){for(;++r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(s&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;C(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:E(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},e}function Gt(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(u){return void n(u)}s.done?t(l):Promise.resolve(l).then(r,o)}function qt(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Gt(i,r,o,a,s,"next",e)}function s(e){Gt(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Yt(){return Yt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=Zt(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},Yt.apply(this,arguments)}function Zt(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=nn(e)););return e}function Xt(e){var t="function"==typeof Map?new Map:void 0;return Xt=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return $t(e,arguments,nn(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),vn(r,e)},Xt(e)}function $t(e,t,n){return $t=tn()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&vn(o,n.prototype),o},$t.apply(null,arguments)}function Kt(e){if(null==e)throw new TypeError("Cannot destructure "+e)}function Qt(e){var t=tn();return function(){var n,r=nn(e);if(t){var o=nn(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return Jt(this,n)}}function Jt(e,t){if(t&&("object"===kn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return en(e)}function en(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function tn(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function nn(e){return nn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},nn(e)}function rn(e,t){for(var n=0;n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function ln(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function un(e){for(var t=1;t]+)>/g,(function(e,t){var n=i[t];return"$"+(Array.isArray(n)?n.join("$"):n)})))}if("function"==typeof o){var a=this;return e[Symbol.replace].call(this,n,(function(){var e=arguments;return"object"!=kn(e[e.length-1])&&(e=[].slice.call(e)).push(r(e,a)),o.apply(this,e)}))}return e[Symbol.replace].call(this,n,o)},hn.apply(this,arguments)}function pn(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&vn(e,t)}function vn(e,t){return vn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},vn(e,t)}function gn(e,t,n){return(t=mn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mn(e){var t=function(e,t){if("object"!==kn(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==kn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===kn(t)?t:String(t)}function yn(e,t){return wn(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(c){u=!0,o=c}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||Sn(e,t)||bn()}function bn(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function wn(e){if(Array.isArray(e))return e}function kn(e){return kn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},kn(e)}function xn(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Sn(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Sn(e,t){if(e){if("string"==typeof e)return Cn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Cn(e,t):void 0}}function Cn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n:nth-child(1).chakra-text{grid-area:status;width:100%;display:flex;justify-content:center}#root .app-content .site-header .site-header-right-side>:nth-child(2){grid-area:sampler;display:flex;justify-content:center;align-items:center}#root .app-content .site-header .site-header-right-side>:nth-child(2) select{width:185px;margin-top:10px}#root .app-content .site-header .site-header-right-side>:nth-child(2) .chakra-select__icon-wrapper{right:10px}#root .app-content .site-header .site-header-right-side>:nth-child(2) .chakra-select__icon-wrapper svg{margin-top:10px}#root .app-content .site-header .site-header-right-side>:nth-child(3){grid-area:btn1}#root .app-content .site-header .site-header-right-side>:nth-child(4){grid-area:btn2}#root .app-content .site-header .site-header-right-side>:nth-child(6){grid-area:btn3}#root .app-content .site-header .site-header-right-side>:nth-child(7){grid-area:btn4}#root .app-content .site-header .site-header-right-side>:nth-child(8){grid-area:btn5}#root .app-content .site-header .site-header-right-side>:nth-child(9){grid-area:btn6}#root .app-content .app-tabs{position:fixed;display:flex;flex-direction:column;row-gap:15px;max-width:100%;overflow:hidden;margin-top:120px}#root .app-content .app-tabs .app-tabs-list{display:flex;justify-content:space-between}#root .app-content .app-tabs .app-tabs-panels{overflow:hidden;overflow-y:scroll}#root .app-content .app-tabs .app-tabs-panels .workarea-main{display:grid;grid-template-areas:"workarea" "options" "gallery";row-gap:15px}#root .app-content .app-tabs .app-tabs-panels .workarea-main .parameters-panel-wrapper{grid-area:options;width:100%;max-width:100%;height:inherit;overflow:inherit;padding:0 10px}#root .app-content .app-tabs .app-tabs-panels .workarea-main .parameters-panel-wrapper .main-settings-row,#root .app-content .app-tabs .app-tabs-panels .workarea-main .parameters-panel-wrapper .advanced-parameters-item{max-width:100%}#root .app-content .app-tabs .app-tabs-panels .workarea-main .workarea-children-wrapper{grid-area:workarea}#root .app-content .app-tabs .app-tabs-panels .workarea-main .workarea-children-wrapper .workarea-split-view{display:flex;flex-direction:column}#root .app-content .app-tabs .app-tabs-panels .workarea-main .workarea-children-wrapper .current-image-options{column-gap:3px}#root .app-content .app-tabs .app-tabs-panels .workarea-main .workarea-children-wrapper .text-to-image-area{padding:0}#root .app-content .app-tabs .app-tabs-panels .workarea-main .workarea-children-wrapper .current-image-preview{height:430px}#root .app-content .app-tabs .app-tabs-panels .workarea-main .workarea-children-wrapper .image-upload-button{row-gap:10px;padding:5px}#root .app-content .app-tabs .app-tabs-panels .workarea-main .workarea-children-wrapper .image-upload-button svg{width:2rem;height:2rem;margin-top:10px}#root .app-content .app-tabs .app-tabs-panels .workarea-main .workarea-children-wrapper .inpainting-settings{display:flex;flex-wrap:wrap;row-gap:10px}#root .app-content .app-tabs .app-tabs-panels .workarea-main .workarea-children-wrapper .inpainting-canvas-area .konvajs-content{height:400px!important}#root .app-content .app-tabs .app-tabs-panels .workarea-main .image-gallery-wrapper{grid-area:gallery;min-height:400px}#root .app-content .app-tabs .app-tabs-panels .workarea-main .image-gallery-wrapper .image-gallery-popup{width:100%!important;max-width:100%!important}}svg{fill:var(--svg-color)}.App{display:grid;width:100vw;height:100vh;background-color:var(--background-color)}.app-content{display:grid;row-gap:1rem;padding:1rem;grid-auto-rows:min-content auto;width:calc(100vw + -0px);height:calc(100vh - .3rem)}.site-header{display:grid;grid-template-columns:auto max-content}.site-header-left-side{display:flex;align-items:center;column-gap:.7rem;padding-left:.5rem}.site-header-left-side img{width:32px;height:32px}.site-header-right-side{display:flex;align-items:center;column-gap:.5rem}.site-header-right-side .lang-select-btn[data-selected=true],.site-header-right-side .lang-select-btn[data-selected=true]:hover{background-color:var(--accent-color)}.status{font-size:.8rem;font-weight:700}.status-good{color:var(--status-good-color);text-shadow:0 0 10px var(--status-good-glow)}.status-bad{color:var(--status-bad-color);text-shadow:0 0 10px var(--status-bad-glow)}.status-working{color:var(--status-working-color);text-shadow:0 0 10px var(--status-working-glow)}.settings-modal{max-height:36rem;font-family:Inter}.settings-modal .settings-modal-content{display:grid;row-gap:2rem;overflow-y:scroll}.settings-modal .settings-modal-header{font-weight:700}.settings-modal .settings-modal-items{display:grid;row-gap:.5rem}.settings-modal .settings-modal-items .settings-modal-item{display:grid;grid-auto-flow:column;background-color:var(--background-color);padding:.4rem 1rem;border-radius:.5rem;align-items:center;width:100%}.settings-modal .settings-modal-reset{display:grid;row-gap:1rem}.settings-modal .settings-modal-reset button{min-width:100%;min-height:100%;background-color:var(--destructive-color)!important}.settings-modal .settings-modal-reset button:hover{background-color:var(--destructive-color-hover)}.settings-modal .settings-modal-reset button:disabled{background-color:var(--btn-base-color)}.settings-modal .settings-modal-reset button:disabled:hover{background-color:var(--btn-base-color)}.settings-modal .settings-modal-reset button svg{width:20px;height:20px;color:var(--btn-svg-color)}.add-model-modal{display:flex}.add-model-modal-body{display:flex;flex-direction:column;row-gap:1rem;padding-bottom:2rem}.add-model-form{display:flex;flex-direction:column;row-gap:.5rem}.hotkeys-modal{width:36rem;max-width:36rem;display:grid;padding:1rem;row-gap:1rem;font-family:Inter}.hotkeys-modal h1{font-size:1.2rem;font-weight:700}.hotkeys-modal h2{font-weight:700}.hotkeys-modal-button{display:flex;align-items:center;justify-content:space-between}.hotkeys-modal-items{max-height:36rem;overflow-y:scroll;-ms-overflow-style:none;scrollbar-width:none}.hotkeys-modal-items::-webkit-scrollbar{display:none}.hotkeys-modal-items .chakra-accordion{display:grid;row-gap:.5rem}.hotkeys-modal-items .chakra-accordion__item{border:none;border-radius:.3rem;background-color:var(--tab-hover-color)}.hotkeys-modal-items button{border-radius:.3rem}.hotkeys-modal-items button[aria-expanded=true]{background-color:var(--tab-hover-color);border-radius:.3rem}.hotkey-modal-category{display:grid;row-gap:.5rem}.hotkey-modal-item{display:grid;grid-template-columns:auto max-content;justify-content:space-between;align-items:center;background-color:var(--background-color);padding:.5rem 1rem;border-radius:.3rem}.hotkey-modal-item .hotkey-info{display:grid}.hotkey-modal-item .hotkey-info .hotkey-title{font-weight:700}.hotkey-modal-item .hotkey-info .hotkey-description{font-size:.9rem;color:var(--text-color-secondary)}.hotkey-modal-item .hotkey-key{font-size:.8rem;font-weight:700;background-color:var(--background-color-light);padding:.2rem .5rem;border-radius:.3rem}.console{width:100vw;display:flex;flex-direction:column;background:var(--console-bg-color);overflow:auto;direction:column;font-family:monospace;padding:0 1rem 1rem 3rem;border-top-width:.3rem;border-color:var(--resizeable-handle-border-color)}.console .console-info-color{color:var(--error-level-info)}.console .console-warning-color{color:var(--error-level-warning)}.console .console-error-color{color:var(--status-bad-color)}.console .console-entry{display:flex;column-gap:.5rem}.console .console-entry .console-timestamp{font-weight:semibold}.console .console-entry .console-message{word-break:break-all}.console-toggle-icon-button{background:var(--console-icon-button-bg-color);position:fixed;left:.5rem;bottom:.5rem;z-index:10000}.console-toggle-icon-button:hover{background:var(--console-icon-button-bg-color-hover)}.console-toggle-icon-button[data-error-seen=true],.console-toggle-icon-button[data-error-seen=true]:hover{background:var(--status-bad-color)}.console-autoscroll-icon-button{background:var(--console-icon-button-bg-color);position:fixed;left:.5rem;bottom:3rem;z-index:10000}.console-autoscroll-icon-button:hover{background:var(--console-icon-button-bg-color-hover)}.console-autoscroll-icon-button[data-autoscroll-enabled=true]{background:var(--accent-color)}.console-autoscroll-icon-button[data-autoscroll-enabled=true]:hover{background:var(--accent-color-hover)}.progress-bar{background-color:var(--root-bg-color);height:.3rem;z-index:99}.progress-bar div{background-color:var(--progress-bar-color)}.progress-bar div[data-indeterminate]{background-color:unset;background-image:linear-gradient(to right,transparent 0%,var(--progress-bar-color) 50%,transparent 100%)}.prompt-bar{display:grid;row-gap:1rem}.prompt-bar input,.prompt-bar textarea{background-color:var(--prompt-bg-color);font-size:1rem;border:2px solid var(--border-color)}.prompt-bar input:hover,.prompt-bar textarea:hover{border:2px solid var(--border-color-light)}.prompt-bar input:focus-visible,.prompt-bar textarea:focus-visible{border:2px solid var(--input-border-color);box-shadow:0 0 10px 0 var(--input-box-shadow-color)}.prompt-bar input[aria-invalid=true],.prompt-bar textarea[aria-invalid=true]{border:2px solid var(--border-color-invalid);box-shadow:0 0 10px 0 var(--box-shadow-color-invalid)}.prompt-bar input:disabled,.prompt-bar textarea:disabled{border:2px solid var(--border-color);box-shadow:none}.prompt-bar textarea{min-height:10rem}.process-buttons{display:flex;column-gap:.5rem}.invoke-btn{flex-grow:1;width:100%;min-width:100%;min-height:100%;background-color:var(--accent-color)!important}.invoke-btn:hover{background-color:var(--accent-color-hover)}.invoke-btn:disabled{background-color:var(--btn-base-color)}.invoke-btn:disabled:hover{background-color:var(--btn-base-color)}.invoke-btn svg{width:16px;height:16px;color:var(--btn-svg-color)}.cancel-btn{min-width:3rem;min-height:100%;background-color:var(--destructive-color)!important}.cancel-btn:hover{background-color:var(--destructive-color-hover)}.cancel-btn:disabled{background-color:var(--btn-base-color)}.cancel-btn:disabled:hover{background-color:var(--btn-base-color)}.cancel-btn svg{width:20px;height:20px;color:var(--btn-svg-color)}.loopback-btn[data-as-checkbox=true]{background-color:var(--btn-btn-base-color);border:3px solid var(--btn-btn-base-color)}.loopback-btn[data-as-checkbox=true] svg{fill:var(--text-color)}.loopback-btn[data-as-checkbox=true]:hover{background-color:var(--btn-btn-base-color);border-color:var(--btn-checkbox-border-hover)}.loopback-btn[data-as-checkbox=true]:hover svg{fill:var(--text-color)}.loopback-btn[data-as-checkbox=true][data-selected=true]{border-color:var(--accent-color);background-color:var(--btn-btn-base-color)}.loopback-btn[data-as-checkbox=true][data-selected=true] svg{fill:var(--text-color)}.loopback-btn[data-as-checkbox=true][data-selected=true]:hover{border-color:var(--accent-color);background-color:var(--btn-btn-base-color)}.loopback-btn[data-as-checkbox=true][data-selected=true]:hover svg{fill:var(--text-color)}.main-settings,.main-settings-list{display:grid;row-gap:1rem}.main-settings-row{display:grid;grid-template-columns:repeat(3,auto);column-gap:.5rem;max-width:22.5rem}.main-settings-block{border-radius:.5rem;display:grid!important;grid-template-columns:auto!important;row-gap:.5rem}.main-settings-block .invokeai__number-input-form-label,.main-settings-block .invokeai__select-label{font-weight:700;font-size:.9rem!important}.main-settings-block .invokeai__select-label{margin:0}.advanced-parameters{padding-top:.5rem;display:grid;row-gap:.5rem}.advanced-parameters-item{display:grid;max-width:22.5rem;border:none;border-top:0px;border-radius:.4rem;background-color:var(--tab-panel-bg)}.advanced-parameters-item[aria-expanded=true]{background-color:var(--tab-hover-color);border-radius:0 0 .4rem .4rem}.advanced-parameters-panel{background-color:var(--tab-panel-bg);border-radius:0 0 .4rem .4rem;padding:1rem}.advanced-parameters-panel button{background-color:var(--btn-base-color)}.advanced-parameters-panel button:hover{background-color:var(--btn-base-color-hover)}.advanced-parameters-panel button:disabled:hover{background-color:var(--btn-base-color)}.advanced-parameters-header{border-radius:.4rem;font-weight:700}.advanced-parameters-header[aria-expanded=true]{background-color:var(--tab-hover-color);border-radius:.4rem .4rem 0 0}.advanced-parameters-header:hover{background-color:var(--tab-hover-color)}.upscale-settings{display:grid;grid-template-columns:auto 1fr;column-gap:1rem}.inpainting-bounding-box-settings{display:flex;flex-direction:column;border-radius:.4rem;border:2px solid var(--tab-color)}.inpainting-bounding-box-header{background-color:var(--tab-color);display:flex;flex-direction:row;justify-content:space-between;padding:.5rem 1rem;border-radius:.3rem .3rem 0 0;align-items:center}.inpainting-bounding-box-header button{width:.5rem;height:1.2rem;background:none}.inpainting-bounding-box-header button:hover{background:none}.inpainting-bounding-box-settings-items{padding:1rem;display:flex;flex-direction:column;row-gap:1rem}.inpainting-bounding-box-settings-items .inpainting-bounding-box-reset-icon-btn{background-color:var(--btn-base-color)}.inpainting-bounding-box-settings-items .inpainting-bounding-box-reset-icon-btn:hover{background-color:var(--btn-base-color-hover)}.inpainting-bounding-box-dimensions-slider-numberinput{display:grid;grid-template-columns:repeat(3,auto);column-gap:1rem}.inpainting-bounding-box-darken{width:max-content}.current-image-area{display:flex;flex-direction:column;height:100%;row-gap:1rem;background-color:var(--background-color-secondary);border-radius:.5rem}.current-image-preview{position:relative;justify-content:center;align-items:center;display:flex;width:100%;height:100%}.current-image-preview img{border-radius:.5rem;object-fit:contain;max-width:100%;max-height:100%;height:auto;position:absolute}.current-image-metadata{grid-area:current-image-preview}.current-image-next-prev-buttons{grid-area:current-image-content;display:flex;justify-content:space-between;z-index:1;height:100%;width:100%;pointer-events:none}.next-prev-button-trigger-area{width:7rem;height:100%;width:15%;display:grid;align-items:center;pointer-events:auto}.next-prev-button-trigger-area.prev-button-trigger-area{justify-content:flex-start}.next-prev-button-trigger-area.next-button-trigger-area{justify-content:flex-end}.next-prev-button{font-size:4rem;fill:var(--white);filter:drop-shadow(0 0 1rem var(--text-color-secondary));opacity:70%}.current-image-display-placeholder{background-color:var(--background-color-secondary);display:grid;display:flex;align-items:center;justify-content:center;width:100%;height:100%;border-radius:.5rem}.current-image-display-placeholder svg{width:10rem;height:10rem;color:var(--svg-color)}.current-image-options{width:100%;display:flex;justify-content:center;align-items:center;column-gap:.5em}.current-image-options .current-image-send-to-popover,.current-image-options .current-image-postprocessing-popover{display:flex;flex-direction:column;row-gap:.5rem;max-width:25rem}.current-image-options .current-image-send-to-popover .invokeai__button{place-content:start}.current-image-options .chakra-popover__popper{z-index:11}.current-image-options .delete-image-btn{background-color:var(--btn-base-color)}.current-image-options .delete-image-btn svg{fill:var(--btn-delete-image)}.image-gallery-wrapper-enter{transform:translate(150%)}.image-gallery-wrapper-enter-active{transform:translate(0);transition:all .12s ease-out}.image-gallery-wrapper-exit{transform:translate(0)}.image-gallery-wrapper-exit-active{transform:translate(150%);transition:all .12s ease-out}.image-gallery-wrapper[data-pinned=false]{position:fixed;height:100vh;top:0;right:0}.image-gallery-wrapper[data-pinned=false] .image-gallery-popup{border-radius:0;box-shadow:0 0 1rem var(--text-color-a3)}.image-gallery-wrapper[data-pinned=false] .image-gallery-popup .image-gallery-container{max-height:calc(100vh + 4.7rem)}.image-gallery-wrapper .image-gallery-popup{background-color:var(--background-color-secondary);padding:1rem;display:flex;flex-direction:column;row-gap:1rem;border-radius:.5rem;border-left-width:.3rem;border-color:var(--tab-list-text-inactive)}.image-gallery-wrapper .image-gallery-popup[data-resize-alert=true]{border-color:var(--status-bad-color)}.image-gallery-wrapper .image-gallery-popup .image-gallery-header{display:flex;align-items:center;column-gap:.5rem;justify-content:space-between}.image-gallery-wrapper .image-gallery-popup .image-gallery-header .image-gallery-header-right-icons{display:flex;flex-direction:row;column-gap:.5rem}.image-gallery-wrapper .image-gallery-popup .image-gallery-header .image-gallery-icon-btn{background-color:var(--btn-load-more)}.image-gallery-wrapper .image-gallery-popup .image-gallery-header .image-gallery-icon-btn:hover{background-color:var(--btn-load-more-hover)}.image-gallery-wrapper .image-gallery-popup .image-gallery-header .image-gallery-settings-popover{display:flex;flex-direction:column;row-gap:.5rem}.image-gallery-wrapper .image-gallery-popup .image-gallery-header .image-gallery-settings-popover div{display:flex;column-gap:.5rem;align-items:center;justify-content:space-between}.image-gallery-wrapper .image-gallery-popup .image-gallery-header h1{font-weight:700}.image-gallery-wrapper .image-gallery-popup .image-gallery-container{display:flex;flex-direction:column;max-height:calc(100vh - (70px + 7rem));overflow-y:scroll;-ms-overflow-style:none;scrollbar-width:none}.image-gallery-wrapper .image-gallery-popup .image-gallery-container::-webkit-scrollbar{display:none}.image-gallery-wrapper .image-gallery-popup .image-gallery-container .image-gallery-container-placeholder{display:flex;flex-direction:column;row-gap:.5rem;background-color:var(--background-color);border-radius:.5rem;place-items:center;padding:2rem;text-align:center}.image-gallery-wrapper .image-gallery-popup .image-gallery-container .image-gallery-container-placeholder p{color:var(--subtext-color-bright);font-family:Inter}.image-gallery-wrapper .image-gallery-popup .image-gallery-container .image-gallery-container-placeholder svg{width:4rem;height:4rem;color:var(--svg-color)}.image-gallery-wrapper .image-gallery-popup .image-gallery-container .image-gallery-load-more-btn{background-color:var(--btn-load-more);font-size:.85rem;padding:.5rem;margin-top:1rem}.image-gallery-wrapper .image-gallery-popup .image-gallery-container .image-gallery-load-more-btn:disabled:hover{background-color:var(--btn-load-more)}.image-gallery-wrapper .image-gallery-popup .image-gallery-container .image-gallery-load-more-btn:hover{background-color:var(--btn-load-more-hover)}.image-gallery-category-btn-group{width:max-content;column-gap:0;justify-content:stretch}.image-gallery-category-btn-group button{background-color:var(--btn-base-color);flex-grow:1}.image-gallery-category-btn-group button:hover{background-color:var(--btn-base-color-hover)}.image-gallery-category-btn-group button[data-selected=true]{background-color:var(--accent-color)}.image-gallery-category-btn-group button[data-selected=true]:hover{background-color:var(--accent-color-hover)}.image-gallery{display:grid;grid-gap:.5rem}.image-gallery .hoverable-image{padding:.5rem;position:relative}.image-gallery .hoverable-image:before{content:"";display:block;padding-bottom:100%}.image-gallery .hoverable-image .hoverable-image-image{position:absolute;max-width:100%;top:50%;left:50%;transform:translate(-50%,-50%)}.hoverable-image{display:flex;justify-content:center;transition:transform .2s ease-out}.hoverable-image:hover{cursor:pointer;border-radius:.5rem;z-index:2}.hoverable-image .hoverable-image-image{width:100%;height:100%;max-width:100%;max-height:100%}.hoverable-image .hoverable-image-delete-button{position:absolute;top:.25rem;right:.25rem}.hoverable-image .hoverable-image-content{display:flex;position:absolute;top:0;left:0;width:100%;height:100%;align-items:center;justify-content:center}.hoverable-image .hoverable-image-content .hoverable-image-check{fill:var(--status-good-color)}.hoverable-image .hoverable-image-icons{position:absolute;bottom:-2rem;display:grid;width:min-content;grid-template-columns:repeat(2,max-content);border-radius:.4rem;background-color:var(--background-color-secondary);padding:.2rem;gap:.2rem;grid-auto-rows:max-content}.hoverable-image .hoverable-image-icons button{width:12px;height:12px;border-radius:.2rem;padding:10px 0;flex-shrink:2}.hoverable-image .hoverable-image-icons button svg{width:12px;height:12px}.hoverable-image-context-menu{z-index:15;padding:.4rem;border-radius:.25rem;background-color:var(--context-menu-bg-color);box-shadow:var(--context-menu-box-shadow)}.hoverable-image-context-menu [role=menuitem]{font-size:.8rem;line-height:1rem;border-radius:3px;display:flex;align-items:center;height:1.75rem;padding:0 .5rem;position:relative;user-select:none;cursor:pointer;outline:none}.hoverable-image-context-menu [role=menuitem][data-disabled]{color:gray;pointer-events:none;cursor:not-allowed}.hoverable-image-context-menu [role=menuitem][data-warning]{color:var(--status-bad-color)}.hoverable-image-context-menu [role=menuitem][data-highlighted]{background-color:var(--context-menu-bg-color-hover)}.image-metadata-viewer{position:absolute;top:0;width:100%;border-radius:.5rem;padding:1rem;background-color:var(--metadata-bg-color);overflow:scroll;max-height:calc(100vh - (70px + 5.4rem));height:100%;z-index:10}.image-json-viewer{border-radius:.5rem;margin:0 .5rem 1rem;padding:1rem;overflow-x:scroll;word-break:break-all;background-color:var(--metadata-json-bg-color)}.lightbox-container{width:100%;height:100%;color:var(--text-color);overflow:hidden;position:absolute;left:0;top:0;background-color:var(--background-color-secondary);z-index:30;animation:popIn .3s ease-in}.lightbox-container .image-gallery-wrapper{max-height:100%!important}.lightbox-container .image-gallery-wrapper .image-gallery-container{max-height:calc(100vh - 5rem)}.lightbox-container .current-image-options{z-index:2;position:absolute;top:1rem}.lightbox-container .image-metadata-viewer{left:0;max-height:100%}.lightbox-close-btn{z-index:3;position:absolute;left:1rem;top:1rem;background-color:var(--btn-base-color)}.lightbox-close-btn:hover{background-color:var(--btn-base-color-hover)}.lightbox-close-btn:disabled:hover{background-color:var(--btn-base-color)}.lightbox-display-container{display:flex;flex-direction:row}.lightbox-preview-wrapper{overflow:hidden;background-color:var(--background-color-secondary);display:grid;grid-template-columns:auto max-content;place-items:center;width:100vw;height:100vh}.lightbox-preview-wrapper .current-image-next-prev-buttons{position:absolute}.lightbox-preview-wrapper .lightbox-image{grid-area:lightbox-content;border-radius:.5rem}.lightbox-preview-wrapper .lightbox-image-options{position:absolute;z-index:2;left:1rem;top:4.5rem;user-select:none;border-radius:.5rem;display:flex;flex-direction:column;row-gap:.5rem}@keyframes popIn{0%{opacity:0;filter:blur(100)}to{opacity:1;filter:blur(0)}}.app-tabs{display:grid;grid-template-columns:min-content auto;column-gap:1rem;height:calc(100vh - (70px + 1rem))}.app-tabs-list{display:grid;row-gap:.3rem;grid-auto-rows:min-content;color:var(--tab-list-text-inactive)}.app-tabs-list button{font-size:.85rem;padding:.5rem}.app-tabs-list button:hover{background-color:var(--tab-hover-color);border-radius:.3rem}.app-tabs-list button svg{width:24px;height:24px}.app-tabs-list button[aria-selected=true]{background-color:var(--tab-list-bg);color:var(--tab-list-text);font-weight:700;border-radius:.3rem;border:none}.app-tabs-panels .app-tabs-panel{padding:0;height:100%}.workarea-wrapper{position:relative;width:100%;height:100%}.workarea-wrapper .workarea-main{display:flex;column-gap:1rem;height:100%}.workarea-wrapper .workarea-main .workarea-children-wrapper{position:relative;width:100%;height:100%}.workarea-wrapper .workarea-main .workarea-split-view{width:100%;height:100%;display:grid;grid-template-columns:1fr 1fr;background-color:var(--background-color-secondary);border-radius:.5rem}.workarea-wrapper .workarea-main .workarea-split-view .workarea-split-view-left{padding-right:.5rem}.workarea-wrapper .workarea-main .workarea-split-view .workarea-split-view-right{padding-left:.5rem}.workarea-wrapper .workarea-main .workarea-single-view{width:100%;height:100%;background-color:var(--background-color-secondary);border-radius:.5rem}.workarea-wrapper .workarea-main .workarea-split-view-left,.workarea-wrapper .workarea-main .workarea-split-view-right{display:flex;flex-direction:column;height:100%;width:100%;row-gap:1rem;background-color:var(--background-color-secondary);border-radius:.5rem;padding:1rem}.workarea-split-button{position:absolute;cursor:pointer;padding:.5rem;top:0;right:0}.workarea-split-button[data-selected=true]{top:0;right:0}.workarea-split-button[data-selected=true] svg{opacity:1}.workarea-split-button svg{opacity:.5}.parameters-panel-wrapper-enter{transform:translate(-150%)}.parameters-panel-wrapper-enter-active{transform:translate(0);transition:all .12s ease-out}.parameters-panel-wrapper-exit{transform:translate(0)}.parameters-panel-wrapper-exit-active{transform:translate(-150%);transition:all .12s ease-out}.parameters-panel-wrapper{background-color:var(--background-color);height:calc(100vh - (70px + 1rem));width:22.5rem;max-width:22.5rem;flex-shrink:0;position:relative;overflow-y:scroll;-ms-overflow-style:none;scrollbar-width:none}.parameters-panel-wrapper::-webkit-scrollbar{display:none}.parameters-panel-wrapper .parameters-panel{display:flex;flex-direction:column;row-gap:1rem;height:100%;-ms-overflow-style:none;scrollbar-width:none;background-color:var(--background-color)}.parameters-panel-wrapper .parameters-panel::-webkit-scrollbar{display:none}.parameters-panel-wrapper[data-pinned=false]{z-index:20;position:fixed;top:0;left:0;filter:var(--floating-panel-drop-shadow);width:24.5rem;max-width:24.5rem;height:100%}.parameters-panel-wrapper[data-pinned=false] .parameters-panel-margin{margin:1rem}.parameters-panel-wrapper .parameters-panel-pin-button{position:absolute;cursor:pointer;padding:.5rem;top:1rem;right:1rem;z-index:20}.parameters-panel-wrapper .parameters-panel-pin-button[data-selected=true]{top:0;right:0}.parameters-panel-wrapper .parameters-panel-pin-button svg{opacity:.5}.invoke-ai-logo-wrapper{display:flex;align-items:center;column-gap:.7rem;padding-left:.5rem;padding-top:.3rem}.invoke-ai-logo-wrapper img{width:32px;height:32px}.invoke-ai-logo-wrapper h1{font-size:1.4rem}.text-to-image-area{padding:1rem;height:100%}.image-to-image-area{display:flex;flex-direction:column;row-gap:1rem;width:100%;height:100%}.image-to-image-strength-main-option{display:flex;row-gap:.5rem!important}.image-to-image-strength-main-option .invokeai__slider-component-label{color:var(--text-color-secondary);font-size:.9rem!important}.init-image-preview-header{display:flex;align-items:center;justify-content:space-between;width:100%}.init-image-preview-header h2{font-weight:700;font-size:.9rem}.init-image-preview{position:relative;height:100%;width:100%;display:flex;align-items:center;justify-content:center}.init-image-preview img{border-radius:.5rem;object-fit:contain;position:absolute}.image-to-image-current-image-display{position:relative}.floating-show-hide-button{position:absolute;top:50%;transform:translateY(-50%);z-index:20;padding:0;background-color:red!important;min-width:2rem;min-height:12rem;background-color:var(--btn-btn-base-color)!important}.floating-show-hide-button.left{left:0;border-radius:0 .5rem .5rem 0}.floating-show-hide-button.right{right:0;border-radius:.5rem 0 0 .5rem}.floating-show-hide-button:hover{background-color:var(--btn-btn-base-color-hover)}.floating-show-hide-button:disabled{background-color:var(--btn-base-color)}.floating-show-hide-button:disabled:hover{background-color:var(--btn-base-color)}.floating-show-hide-button svg{width:20px;height:20px;color:var(--btn-svg-color)}.show-hide-button-options{position:absolute;transform:translateY(-50%);z-index:20;min-width:2rem;top:50%;left:calc(42px + 2rem);border-radius:0 .5rem .5rem 0;display:flex;flex-direction:column;row-gap:.5rem}.show-hide-button-options button{border-radius:0 .3rem .3rem 0}.show-hide-button-gallery{padding-left:.75rem;padding-right:.75rem;background-color:var(--background-color)!important}.inpainting-main-area{display:flex;flex-direction:column;align-items:center;row-gap:1rem;width:100%;height:100%}.inpainting-main-area .inpainting-settings{display:flex;align-items:center;column-gap:.5rem}.inpainting-main-area .inpainting-settings svg{transform:scale(.9)}.inpainting-main-area .inpainting-settings .inpainting-buttons-group{display:flex;align-items:center;column-gap:.5rem}.inpainting-main-area .inpainting-settings .inpainting-button-dropdown{display:flex;flex-direction:column;row-gap:.5rem}.inpainting-main-area .inpainting-settings .inpainting-color-picker{margin-left:1rem}.inpainting-main-area .inpainting-settings .inpainting-brush-options{display:flex;align-items:center;column-gap:1rem}.inpainting-canvas-area{display:flex;flex-direction:column;align-items:center;justify-content:center;row-gap:1rem;width:100%;height:100%}.inpainting-canvas-spiner{display:flex;align-items:center;width:100%;height:100%}.inpainting-canvas-container{display:flex;position:relative;height:100%;width:100%;border-radius:.5rem}.inpainting-canvas-wrapper{position:relative}.inpainting-canvas-stage{outline:none;border-radius:.5rem;box-shadow:0 0 0 1px var(--border-color-light);overflow:hidden}.inpainting-canvas-stage canvas{outline:none;border-radius:.5rem}.inpainting-options-btn{min-height:2rem}.canvas-status-text{position:absolute;top:0;left:0;background-color:var(--background-color);opacity:.65;display:flex;flex-direction:column;font-size:.8rem;padding:.25rem;min-width:12rem;border-radius:.25rem;margin:.25rem;pointer-events:none}.invokeai__number-input-form-control{display:flex;align-items:center;column-gap:1rem}.invokeai__number-input-form-control .invokeai__number-input-form-label{color:var(--text-color-secondary)}.invokeai__number-input-form-control .invokeai__number-input-form-label[data-focus]+.invokeai__number-input-root{outline:none;border:2px solid var(--input-border-color);box-shadow:0 0 10px 0 var(--input-box-shadow-color)}.invokeai__number-input-form-control .invokeai__number-input-form-label[aria-invalid=true]+.invokeai__number-input-root{outline:none;border:2px solid var(--border-color-invalid);box-shadow:0 0 10px 0 var(--box-shadow-color-invalid)}.invokeai__number-input-form-control .invokeai__number-input-root{height:2rem;display:grid;grid-template-columns:auto max-content;column-gap:.5rem;align-items:center;background-color:var(--background-color-secondary);border:2px solid var(--border-color);border-radius:.3rem}.invokeai__number-input-form-control .invokeai__number-input-field{border:none;font-weight:700;width:100%;height:auto;font-size:.9rem;padding:0 .5rem}.invokeai__number-input-form-control .invokeai__number-input-field:focus{outline:none;box-shadow:none}.invokeai__number-input-form-control .invokeai__number-input-field:disabled{opacity:.2}.invokeai__number-input-form-control .invokeai__number-input-stepper{display:grid;padding-right:.5rem}.invokeai__number-input-form-control .invokeai__number-input-stepper .invokeai__number-input-stepper-button{border:none;padding:0 .5rem;margin:0 -.5rem}.invokeai__number-input-form-control .invokeai__number-input-stepper .invokeai__number-input-stepper-button svg{width:10px;height:10px}.input{display:grid;grid-template-columns:max-content auto;column-gap:1rem;align-items:center}.input .input-label{color:var(--text-color-secondary)}.input .input-entry{background-color:var(--background-color-secondary);border:2px solid var(--border-color);border-radius:.2rem;font-weight:700}.input .input-entry:focus{outline:none;border:2px solid var(--input-border-color);box-shadow:0 0 10px 0 var(--input-box-shadow-color)}.input .input-entry:disabled{opacity:.2}.input .input-entry[aria-invalid=true]{outline:none;border:2px solid var(--border-color-invalid);box-shadow:0 0 10px 0 var(--box-shadow-color-invalid)}.invokeai__icon-button{background:var(--btn-base-color);cursor:pointer}.invokeai__icon-button:hover{background-color:var(--btn-base-color-hover)}.invokeai__icon-button[data-selected=true]{background-color:var(--accent-color)}.invokeai__icon-button[data-selected=true]:hover{background-color:var(--accent-color-hover)}.invokeai__icon-button[disabled]{cursor:not-allowed}.invokeai__icon-button[data-variant=link],.invokeai__icon-button[data-variant=link]:hover{background:none}.invokeai__icon-button[data-as-checkbox=true]{background-color:var(--btn-base-color);border:3px solid var(--btn-base-color)}.invokeai__icon-button[data-as-checkbox=true] svg{fill:var(--text-color)}.invokeai__icon-button[data-as-checkbox=true]:hover{background-color:var(--btn-base-color);border-color:var(--btn-checkbox-border-hover)}.invokeai__icon-button[data-as-checkbox=true]:hover svg{fill:var(--text-color)}.invokeai__icon-button[data-as-checkbox=true][data-selected=true]{border-color:var(--accent-color)}.invokeai__icon-button[data-as-checkbox=true][data-selected=true] svg{fill:var(--accent-color-hover)}.invokeai__icon-button[data-as-checkbox=true][data-selected=true]:hover svg{fill:var(--accent-color-hover)}.invokeai__icon-button[data-alert=true]{animation-name:pulseColor;animation-duration:1s;animation-timing-function:ease-in-out;animation-iteration-count:infinite}.invokeai__icon-button[data-alert=true]:hover{animation:none;background-color:var(--accent-color-hover)}@keyframes pulseColor{0%{background-color:var(--accent-color)}50%{background-color:var(--accent-color-dim)}to{background-color:var(--accent-color)}}.invokeai__button{background-color:var(--btn-base-color);place-content:center}.invokeai__button:hover{background-color:var(--btn-base-color-hover)}.invokeai__switch-form-control .invokeai__switch-form-label{color:var(--text-color-secondary)}.invokeai__switch-form-control .invokeai__switch-root span{background-color:var(--switch-bg-color)}.invokeai__switch-form-control .invokeai__switch-root span span{background-color:var(--white)}.invokeai__switch-form-control .invokeai__switch-root[data-checked] span{background:var(--switch-bg-active-color)}.invokeai__switch-form-control .invokeai__switch-root[data-checked] span span{background-color:var(--white)}.invokeai__select{display:flex;column-gap:1rem;align-items:center}.invokeai__select .invokeai__select-label{color:var(--text-color-secondary)}.invokeai__select .invokeai__select-picker{border:2px solid var(--border-color);background-color:var(--background-color-secondary);font-weight:700;font-size:.9rem;height:2rem;border-radius:.2rem}.invokeai__select .invokeai__select-picker:focus{outline:none;border:2px solid var(--input-border-color);box-shadow:0 0 10px 0 var(--input-box-shadow-color)}.invokeai__select .invokeai__select-option{background-color:var(--background-color-secondary);color:var(--text-color-secondary)}.invokeai__slider-component{padding-bottom:.5rem;border-radius:.5rem}.invokeai__slider-component .invokeai__slider-component-label{min-width:max-content;margin:0;font-weight:700;font-size:.9rem;color:var(--text-color-secondary)}.invokeai__slider-component .invokeai__slider_track{background-color:var(--tab-color)}.invokeai__slider-component .invokeai__slider_track-filled{background-color:var(--slider-color)}.invokeai__slider-component .invokeai__slider-thumb{width:4px}.invokeai__slider-component .invokeai__slider-mark{font-size:.75rem;font-weight:700;color:var(--slider-mark-color);margin-top:.3rem}.invokeai__slider-component .invokeai__slider-number-input{border:none;font-size:.9rem;font-weight:700;height:2rem;background-color:var(--background-color-secondary);border:2px solid var(--border-color)}.invokeai__slider-component .invokeai__slider-number-input:focus{outline:none;box-shadow:none;border:2px solid var(--input-border-color);box-shadow:0 0 10px 0 var(--input-box-shadow-color)}.invokeai__slider-component .invokeai__slider-number-input:disabled{opacity:.2}.invokeai__slider-component .invokeai__slider-number-stepper{border:none}.invokeai__slider-component[data-markers=true] .invokeai__slider_container{margin-top:-1rem}.invokeai__checkbox .chakra-checkbox__label{margin-top:1px;color:var(--text-color-secondary);font-size:.9rem}.invokeai__checkbox .chakra-checkbox__control{width:1rem;height:1rem;border:none;border-radius:.2rem;background-color:var(--input-checkbox-bg)}.invokeai__checkbox .chakra-checkbox__control svg{width:.6rem;height:.6rem;stroke-width:3px}.invokeai__checkbox .chakra-checkbox__control[data-checked]{color:var(--text-color);background-color:var(--input-checkbox-checked-bg)}.invokeai__popover-content{min-width:unset;width:unset;padding:1rem;border-radius:.5rem;background-color:var(--background-color);border:2px solid var(--border-color)}.invokeai__popover-content .invokeai__popover-arrow{background-color:var(--background-color)!important}.invokeai__color-picker .react-colorful__hue-pointer,.invokeai__color-picker .react-colorful__saturation-pointer{width:1.5rem;height:1.5rem;border-color:var(--white)}.dropzone-container{position:absolute;top:0;left:0;width:100vw;height:100vh;z-index:999;backdrop-filter:blur(20px)}.dropzone-container .dropzone-overlay{opacity:.5;width:100%;height:100%;display:flex;flex-direction:column;row-gap:1rem;align-items:center;justify-content:center;background-color:var(--background-color)}.dropzone-container .dropzone-overlay.is-drag-accept{box-shadow:inset 0 0 20rem 1rem var(--accent-color)}.dropzone-container .dropzone-overlay.is-drag-reject{box-shadow:inset 0 0 20rem 1rem var(--status-bad-color)}.dropzone-container .dropzone-overlay.is-handling-upload{box-shadow:inset 0 0 20rem 1rem var(--status-working-color)}.image-uploader-button-outer{width:100%;height:100%;display:flex;align-items:center;justify-content:center;cursor:pointer;border-radius:.5rem;color:var(--tab-list-text-inactive);background-color:var(--background-color)}.image-uploader-button-outer:hover{background-color:var(--background-color-light)}.image-upload-button-inner{width:100%;height:100%;display:flex;align-items:center;justify-content:center}.image-upload-button{display:flex;flex-direction:column;row-gap:2rem;align-items:center;justify-content:center;text-align:center}.image-upload-button svg{width:4rem;height:4rem}.image-upload-button h2{font-size:1.2rem}.work-in-progress{display:grid;width:100%;height:calc(100vh - (70px + 1rem));grid-auto-rows:max-content;background-color:var(--background-color-secondary);border-radius:.4rem;place-content:center;place-items:center;row-gap:1rem}.work-in-progress h1{font-size:2rem;font-weight:700}.work-in-progress p{text-align:center;max-width:50rem;color:var(--subtext-color-bright)}.guide-popover-arrow{background-color:var(--tab-panel-bg);box-shadow:none}.guide-popover-content{background-color:var(--background-color-secondary);border:none}.guide-popover-guide-content{background:var(--tab-panel-bg);border:2px solid var(--tab-hover-color);border-radius:.4rem;padding:.75rem 1rem;display:grid;grid-template-rows:repeat(auto-fill,1fr);grid-row-gap:.5rem;justify-content:space-between}.modal{background-color:var(--background-color-secondary);color:var(--text-color);font-family:Inter}.modal-close-btn{background-color:var(--btn-base-color)}.modal-close-btn:hover{background-color:var(--btn-base-color-hover)}.modal-close-btn:disabled:hover{background-color:var(--btn-base-color)}*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}html,body{-ms-overflow-style:none;scrollbar-width:none;background-color:var(--root-bg-color);overflow:hidden}html::-webkit-scrollbar,body::-webkit-scrollbar{display:none}#root{background-color:var(--root-bg-color);color:var(--text-color);font-family:Inter,Arial,Helvetica,sans-serif}\n',document.head.appendChild($t),{execute:function(){var $t,Jt,tn,rn,ln,fn,vn,mn,bn,wn,Sn,Cn,_n,En,Pn,Ln,On,An,Mn,Tn,In,Rn,Nn,Dn,zn,jn,Bn,Fn,Hn,Vn,Wn,Un,Gn,qn,Yn,Zn,Xn,$n,Kn,Qn,Jn,er,tr,nr,rr;function or(e,t){for(var n=function(){var n=t[r];if("string"!=typeof n&&!Array.isArray(n)){var o=function(t){if("default"!==t&&!(t in e)){var r=Object.getOwnPropertyDescriptor(n,t);r&&Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:function(){return n[t]}})}};for(var i in n)o(i)}},r=0;r0&&void 0!==arguments[0]?arguments[0]:{},t=e.preventTransition,n=void 0===t||t,r={setDataset:function(e){var t=n?r.preventTransition():void 0;document.documentElement.dataset.theme=e,document.documentElement.style.colorScheme=e,null==t||t()},setClassName:function(e){document.body.classList.add(e?lo:so),document.body.classList.remove(e?so:lo)},query:function(){return window.matchMedia("(prefers-color-scheme: dark)")},getSystemTheme:function(e){var t;return(null!==(t=r.query().matches)&&void 0!==t?t:"dark"===e)?"dark":"light"},addListener:function(e){var t=r.query(),n=function(t){e(t.matches?"dark":"light")};return"function"==typeof t.addListener?t.addListener(n):t.addEventListener("change",n),function(){"function"==typeof t.removeListener?t.removeListener(n):t.removeEventListener("change",n)}},preventTransition:function(){var e=document.createElement("style");return e.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(e),function(){window.getComputedStyle(document.body),requestAnimationFrame((function(){requestAnimationFrame((function(){document.head.removeChild(e)}))}))}}};return r}({preventTransition:s})}),[s]),y=m.getSystemTheme,b=m.setClassName,w=m.setDataset,k=m.addListener,x="system"!==a||f?f:v,S=cr.useCallback((function(e){var t="system"===e?y():e;h(t),b("dark"===t),w(t),u.set(t)}),[u,y,b,w]);oo((function(){"system"===a&&g(y())}),[]),cr.useEffect((function(){var e=u.get();S(e||("system"!==a?c:"system"))}),[u,c,a,S]);var C=cr.useCallback((function(){S("dark"===x?"light":"dark")}),[x,S]);cr.useEffect((function(){if(i)return k(S)}),[i,k,S]);var _=cr.useMemo((function(){return{colorMode:null!=t?t:x,toggleColorMode:t?fo:C,setColorMode:t?fo:S,forced:void 0!==t}}),[x,C,S,t]);return qr.createElement(io.Provider,{value:_},n)}po.displayName="ColorModeProvider";var vo={},go={get exports(){return vo},set exports(e){vo=e}};!function(e,t){var n="__lodash_hash_undefined__",r=9007199254740991,o="[object Arguments]",i="[object Function]",a="[object Object]",s=/^\[object .+?Constructor\]$/,l=/^(?:0|[1-9]\d*)$/,u={};u["[object Float32Array]"]=u["[object Float64Array]"]=u["[object Int8Array]"]=u["[object Int16Array]"]=u["[object Int32Array]"]=u["[object Uint8Array]"]=u["[object Uint8ClampedArray]"]=u["[object Uint16Array]"]=u["[object Uint32Array]"]=!0,u[o]=u["[object Array]"]=u["[object ArrayBuffer]"]=u["[object Boolean]"]=u["[object DataView]"]=u["[object Date]"]=u["[object Error]"]=u[i]=u["[object Map]"]=u["[object Number]"]=u[a]=u["[object RegExp]"]=u["[object Set]"]=u["[object String]"]=u["[object WeakMap]"]=!1;var c="object"==kn(ir)&&ir&&ir.Object===Object&&ir,d="object"==("undefined"==typeof self?"undefined":kn(self))&&self&&self.Object===Object&&self,f=c||d||Function("return this")(),h=t&&!t.nodeType&&t,p=h&&e&&!e.nodeType&&e,v=p&&p.exports===h,g=v&&c.process,m=function(){try{var e=p&&p.require&&p.require("util").types;return e||g&&g.binding&&g.binding("util")}catch(Dhe){}}(),y=m&&m.isTypedArray;function b(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var w,k=Array.prototype,x=Function.prototype,S=Object.prototype,C=f["__core-js_shared__"],_=x.toString,E=S.hasOwnProperty,P=(w=/[^.]+$/.exec(C&&C.keys&&C.keys.IE_PROTO||""))?"Symbol(src)_1."+w:"",L=S.toString,O=_.call(Object),A=RegExp("^"+_.call(E).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),M=v?f.Buffer:void 0,T=f.Symbol,I=f.Uint8Array,R=M?M.allocUnsafe:void 0,N=function(e,t){return function(n){return e(t(n))}}(Object.getPrototypeOf,Object),D=Object.create,z=S.propertyIsEnumerable,j=k.splice,B=T?T.toStringTag:void 0,F=function(){try{var e=fe(Object,"defineProperty");return e({},"",{}),e}catch(Dhe){}}(),H=M?M.isBuffer:void 0,V=Math.max,W=Date.now,U=fe(f,"Map"),G=fe(Object,"create"),q=function(){function e(){}return function(t){if(!Pe(t))return{};if(D)return D(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Y(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1},Z.prototype.set=function(e,t){var n=this.__data__,r=ee(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},X.prototype.clear=function(){this.size=0,this.__data__={hash:new Y,map:new(U||Z),string:new Y}},X.prototype.delete=function(e){var t=de(this,e).delete(e);return this.size-=t?1:0,t},X.prototype.get=function(e){return de(this,e).get(e)},X.prototype.has=function(e){return de(this,e).has(e)},X.prototype.set=function(e,t){var n=de(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},$.prototype.clear=function(){this.__data__=new Z,this.size=0},$.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},$.prototype.get=function(e){return this.__data__.get(e)},$.prototype.has=function(e){return this.__data__.has(e)},$.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Z){var r=n.__data__;if(!U||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new X(r)}return n.set(e,t),this.size=n.size,this};var ne,re=function(e,t,n){for(var r=-1,o=Object(e),i=n(e),a=i.length;a--;){var s=i[ne?a:++r];if(!1===t(o[s],s,o))break}return e};function oe(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":B&&B in Object(e)?function(e){var t=E.call(e,B),n=e[B];try{e[B]=void 0;var r=!0}catch(Dhe){}var o=L.call(e);r&&(t?e[B]=n:delete e[B]);return o}(e):function(e){return L.call(e)}(e)}function ie(e){return Le(e)&&oe(e)==o}function ae(e){return!(!Pe(e)||(t=e,P&&P in t))&&(_e(e)?A:s).test(function(e){if(null!=e){try{return _.call(e)}catch(Dhe){}try{return e+""}catch(Dhe){}}return""}(e));var t}function se(e){if(!Pe(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=pe(e),n=[];for(var r in e)("constructor"!=r||!t&&E.call(e,r))&&n.push(r);return n}function le(e,t,n,r,o){e!==t&&re(t,(function(i,s){if(o||(o=new $),Pe(i))!function(e,t,n,r,o,i,s){var l=ve(e,n),u=ve(t,n),c=s.get(u);if(c)return void Q(e,n,c);var d=i?i(l,u,n+"",e,t,s):void 0,f=void 0===d;if(f){var h=xe(u),p=!h&&Ce(u),v=!h&&!p&&Oe(u);d=u,h||p||v?xe(l)?d=l:!function(e){return Le(e)&&Se(e)}(l)?p?(f=!1,d=function(e,t){if(t)return e.slice();var n=e.length,r=R?R(n):new e.constructor(n);return e.copy(r),r}(u,!0)):v?(f=!1,g=u,m=!0?(y=g.buffer,b=new y.constructor(y.byteLength),new I(b).set(new I(y)),b):g.buffer,d=new g.constructor(m,g.byteOffset,g.length)):d=[]:d=function(e,t){var n=-1,r=e.length;t||(t=Array(r));for(;++n-1&&e%1==0&&e0){if(++me>=800)return arguments[0]}else me=0;return ge.apply(void 0,arguments)});function we(e,t){return e===t||e!=e&&t!=t}var ke=ie(function(){return arguments}())?ie:function(e){return Le(e)&&E.call(e,"callee")&&!z.call(e,"callee")},xe=Array.isArray;function Se(e){return null!=e&&Ee(e.length)&&!_e(e)}var Ce=H||function(){return!1};function _e(e){if(!Pe(e))return!1;var t=oe(e);return t==i||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ee(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}function Pe(e){var t=kn(e);return null!=e&&("object"==t||"function"==t)}function Le(e){return null!=e&&"object"==kn(e)}var Oe=y?function(e){return function(t){return e(t)}}(y):function(e){return Le(e)&&Ee(e.length)&&!!u[oe(e)]};function Ae(e){return Se(e)?K(e,!0):se(e)}var Me,Te=(Me=function(e,t,n,r){le(e,t,n,r)},ue((function(e,t){var n=-1,r=t.length,o=r>1?t[r-1]:void 0,i=r>2?t[2]:void 0;for(o=Me.length>3&&"function"==typeof o?(r--,o):void 0,i&&function(e,t,n){if(!Pe(n))return!1;var r=kn(t);return!!("number"==r?Se(n)&&he(t,n.length):"string"==r&&t in n)&&we(n[t],e)}(t[0],t[1],i)&&(o=r<3?void 0:o,r=1),e=Object(e);++n1?t-1:0),r=1;r :not(style) ~ :not(style)",Mo=gn({},Ao,{marginInlineStart:"calc(var(--chakra-space-x) * calc(1 - var(--chakra-space-x-reverse)))",marginInlineEnd:"calc(var(--chakra-space-x) * var(--chakra-space-x-reverse))"}),To=gn({},Ao,{marginTop:"calc(var(--chakra-space-y) * calc(1 - var(--chakra-space-y-reverse)))",marginBottom:"calc(var(--chakra-space-y) * var(--chakra-space-y-reverse))"}),Io={"to-t":"to top","to-tr":"to top right","to-r":"to right","to-br":"to bottom right","to-b":"to bottom","to-bl":"to bottom left","to-l":"to left","to-tl":"to top left"},Ro=new Set(Object.values(Io)),No=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),Do=function(e){return e.trim()};var zo=function(e){return"string"==typeof e&&e.includes("(")&&e.includes(")")};var jo=function(e){return function(t){return"".concat(e,"(").concat(t,")")}},Bo={filter:function(e){return"auto"!==e?e:Po},backdropFilter:function(e){return"auto"!==e?e:Lo},ring:function(e){return function(e){return{"--chakra-ring-offset-shadow":"var(--chakra-ring-inset) 0 0 0 var(--chakra-ring-offset-width) var(--chakra-ring-offset-color)","--chakra-ring-shadow":"var(--chakra-ring-inset) 0 0 0 calc(var(--chakra-ring-width) + var(--chakra-ring-offset-width)) var(--chakra-ring-color)","--chakra-ring-width":e,boxShadow:["var(--chakra-ring-offset-shadow)","var(--chakra-ring-shadow)","var(--chakra-shadow, 0 0 #0000)"].join(", ")}}(Bo.px(e))},bgClip:function(e){return"text"===e?{color:"transparent",backgroundClip:"text"}:{backgroundClip:e}},transform:function(e){return"auto"===e?["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))"].concat(Eo).join(" "):"auto-gpu"===e?["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)"].concat(Eo).join(" "):e},vh:function(e){return"$100vh"===e?"var(--chakra-vh)":e},px:function(e){if(null==e)return e;var t=function(e){var t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}}(e);return t.unitless||"number"==typeof e?"".concat(e,"px"):e},fraction:function(e){return"number"!=typeof e||e>1?e:"".concat(100*e,"%")},float:function(e,t){return"rtl"===t.direction?{left:"right",right:"left"}[e]:e},degree:function(e){if(function(e){return/^var\(--.+\)$/.test(e)}(e)||null==e)return e;var t="string"==typeof e&&!e.endsWith("deg");return"number"==typeof e||t?"".concat(e,"deg"):e},gradient:function(e,t){return function(e,t){var n,r;if(null==e||No.has(e))return e;var o=null!==(n=null==(r=hn(/(^[a-z-A-Z]+)\(((.*))\)/g,{type:1,values:2}).exec(e))?void 0:r.groups)&&void 0!==n?n:{},i=o.type,a=o.values;if(!i||!a)return e;var s=i.includes("-gradient")?i:"".concat(i,"-gradient"),l=dn(a.split(",").map(Do).filter(Boolean)),u=l[0],c=l.slice(1);if(0===(null==c?void 0:c.length))return e;var d=u in Io?Io[u]:u;c.unshift(d);var f=c.map((function(e){if(Ro.has(e))return e;var n=e.indexOf(" "),r=yn(-1!==n?[e.substr(0,n),e.substr(n+1)]:[e],2),o=r[0],i=r[1],a=zo(i)?i:i&&i.split(" "),s="colors.".concat(o),l=s in t.__cssMap?t.__cssMap[s].varRef:o;return a?[l].concat(cn(Array.isArray(a)?a:[a])).join(" "):l}));return"".concat(s,"(").concat(f.join(", "),")")}(e,null!=t?t:{})},blur:jo("blur"),opacity:jo("opacity"),brightness:jo("brightness"),contrast:jo("contrast"),dropShadow:jo("drop-shadow"),grayscale:jo("grayscale"),hueRotate:jo("hue-rotate"),invert:jo("invert"),saturate:jo("saturate"),sepia:jo("sepia"),bgImage:function(e){return null==e||zo(e)||No.has(e)?e:"url(".concat(e,")")},outline:function(e){var t="0"===String(e)||"none"===String(e);return null!==e&&t?{outline:"2px solid transparent",outlineOffset:"2px"}:{outline:e}},flexDirection:function(e){var t,n=null!==(t=Oo[e])&&void 0!==t?t:{},r=n.space,o=n.divide,i={flexDirection:e};return r&&(i[r]=1),o&&(i[o]=1),i}},Fo={borderWidths:_o("borderWidths"),borderStyles:_o("borderStyles"),colors:_o("colors"),borders:_o("borders"),radii:_o("radii",Bo.px),space:_o("space",Co(Bo.vh,Bo.px)),spaceT:_o("space",Co(Bo.vh,Bo.px)),degreeT:function(e){return{property:e,transform:Bo.degree}},prop:function(e,t,n){return un({property:e,scale:t},t&&{transform:So({scale:t,transform:n})})},propT:function(e,t){return{property:e,transform:t}},sizes:_o("sizes",Co(Bo.vh,Bo.px)),sizesT:_o("sizes",Co(Bo.vh,Bo.fraction)),shadows:_o("shadows"),logical:function(e){var t,n,r,o=e.property,i=e.scale,a=e.transform;return{scale:i,property:(t=o,n=t.rtl,r=t.ltr,function(e){return"rtl"===e.direction?n:r}),transform:i?So({scale:i,compose:a}):a}},blur:_o("blur",Bo.blur)},Ho={background:Fo.colors("background"),backgroundColor:Fo.colors("backgroundColor"),backgroundImage:Fo.propT("backgroundImage",Bo.bgImage),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:Bo.bgClip},bgSize:Fo.prop("backgroundSize"),bgPosition:Fo.prop("backgroundPosition"),bg:Fo.colors("background"),bgColor:Fo.colors("backgroundColor"),bgPos:Fo.prop("backgroundPosition"),bgRepeat:Fo.prop("backgroundRepeat"),bgAttachment:Fo.prop("backgroundAttachment"),bgGradient:Fo.propT("backgroundImage",Bo.gradient),bgClip:{transform:Bo.bgClip}};Object.assign(Ho,{bgImage:Ho.backgroundImage,bgImg:Ho.backgroundImage});var Vo={border:Fo.borders("border"),borderWidth:Fo.borderWidths("borderWidth"),borderStyle:Fo.borderStyles("borderStyle"),borderColor:Fo.colors("borderColor"),borderRadius:Fo.radii("borderRadius"),borderTop:Fo.borders("borderTop"),borderBlockStart:Fo.borders("borderBlockStart"),borderTopLeftRadius:Fo.radii("borderTopLeftRadius"),borderStartStartRadius:Fo.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:Fo.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:Fo.radii("borderTopRightRadius"),borderStartEndRadius:Fo.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:Fo.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:Fo.borders("borderRight"),borderInlineEnd:Fo.borders("borderInlineEnd"),borderBottom:Fo.borders("borderBottom"),borderBlockEnd:Fo.borders("borderBlockEnd"),borderBottomLeftRadius:Fo.radii("borderBottomLeftRadius"),borderBottomRightRadius:Fo.radii("borderBottomRightRadius"),borderLeft:Fo.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:Fo.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:Fo.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:Fo.borders(["borderLeft","borderRight"]),borderInline:Fo.borders("borderInline"),borderY:Fo.borders(["borderTop","borderBottom"]),borderBlock:Fo.borders("borderBlock"),borderTopWidth:Fo.borderWidths("borderTopWidth"),borderBlockStartWidth:Fo.borderWidths("borderBlockStartWidth"),borderTopColor:Fo.colors("borderTopColor"),borderBlockStartColor:Fo.colors("borderBlockStartColor"),borderTopStyle:Fo.borderStyles("borderTopStyle"),borderBlockStartStyle:Fo.borderStyles("borderBlockStartStyle"),borderBottomWidth:Fo.borderWidths("borderBottomWidth"),borderBlockEndWidth:Fo.borderWidths("borderBlockEndWidth"),borderBottomColor:Fo.colors("borderBottomColor"),borderBlockEndColor:Fo.colors("borderBlockEndColor"),borderBottomStyle:Fo.borderStyles("borderBottomStyle"),borderBlockEndStyle:Fo.borderStyles("borderBlockEndStyle"),borderLeftWidth:Fo.borderWidths("borderLeftWidth"),borderInlineStartWidth:Fo.borderWidths("borderInlineStartWidth"),borderLeftColor:Fo.colors("borderLeftColor"),borderInlineStartColor:Fo.colors("borderInlineStartColor"),borderLeftStyle:Fo.borderStyles("borderLeftStyle"),borderInlineStartStyle:Fo.borderStyles("borderInlineStartStyle"),borderRightWidth:Fo.borderWidths("borderRightWidth"),borderInlineEndWidth:Fo.borderWidths("borderInlineEndWidth"),borderRightColor:Fo.colors("borderRightColor"),borderInlineEndColor:Fo.colors("borderInlineEndColor"),borderRightStyle:Fo.borderStyles("borderRightStyle"),borderInlineEndStyle:Fo.borderStyles("borderInlineEndStyle"),borderTopRadius:Fo.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:Fo.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:Fo.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:Fo.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(Vo,{rounded:Vo.borderRadius,roundedTop:Vo.borderTopRadius,roundedTopLeft:Vo.borderTopLeftRadius,roundedTopRight:Vo.borderTopRightRadius,roundedTopStart:Vo.borderStartStartRadius,roundedTopEnd:Vo.borderStartEndRadius,roundedBottom:Vo.borderBottomRadius,roundedBottomLeft:Vo.borderBottomLeftRadius,roundedBottomRight:Vo.borderBottomRightRadius,roundedBottomStart:Vo.borderEndStartRadius,roundedBottomEnd:Vo.borderEndEndRadius,roundedLeft:Vo.borderLeftRadius,roundedRight:Vo.borderRightRadius,roundedStart:Vo.borderInlineStartRadius,roundedEnd:Vo.borderInlineEndRadius,borderStart:Vo.borderInlineStart,borderEnd:Vo.borderInlineEnd,borderTopStartRadius:Vo.borderStartStartRadius,borderTopEndRadius:Vo.borderStartEndRadius,borderBottomStartRadius:Vo.borderEndStartRadius,borderBottomEndRadius:Vo.borderEndEndRadius,borderStartRadius:Vo.borderInlineStartRadius,borderEndRadius:Vo.borderInlineEndRadius,borderStartWidth:Vo.borderInlineStartWidth,borderEndWidth:Vo.borderInlineEndWidth,borderStartColor:Vo.borderInlineStartColor,borderEndColor:Vo.borderInlineEndColor,borderStartStyle:Vo.borderInlineStartStyle,borderEndStyle:Vo.borderInlineEndStyle});var Wo={color:Fo.colors("color"),textColor:Fo.colors("color"),fill:Fo.colors("fill"),stroke:Fo.colors("stroke")},Uo={boxShadow:Fo.shadows("boxShadow"),mixBlendMode:!0,blendMode:Fo.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:Fo.prop("backgroundBlendMode"),opacity:!0};Object.assign(Uo,{shadow:Uo.boxShadow});var Go={filter:{transform:Bo.filter},blur:Fo.blur("--chakra-blur"),brightness:Fo.propT("--chakra-brightness",Bo.brightness),contrast:Fo.propT("--chakra-contrast",Bo.contrast),hueRotate:Fo.degreeT("--chakra-hue-rotate"),invert:Fo.propT("--chakra-invert",Bo.invert),saturate:Fo.propT("--chakra-saturate",Bo.saturate),dropShadow:Fo.propT("--chakra-drop-shadow",Bo.dropShadow),backdropFilter:{transform:Bo.backdropFilter},backdropBlur:Fo.blur("--chakra-backdrop-blur"),backdropBrightness:Fo.propT("--chakra-backdrop-brightness",Bo.brightness),backdropContrast:Fo.propT("--chakra-backdrop-contrast",Bo.contrast),backdropHueRotate:Fo.degreeT("--chakra-backdrop-hue-rotate"),backdropInvert:Fo.propT("--chakra-backdrop-invert",Bo.invert),backdropSaturate:Fo.propT("--chakra-backdrop-saturate",Bo.saturate)},qo={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:Bo.flexDirection},experimental_spaceX:{static:Mo,transform:So({scale:"space",transform:function(e){return null!==e?{"--chakra-space-x":e}:null}})},experimental_spaceY:{static:To,transform:So({scale:"space",transform:function(e){return null!=e?{"--chakra-space-y":e}:null}})},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:Fo.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:Fo.space("gap"),rowGap:Fo.space("rowGap"),columnGap:Fo.space("columnGap")};Object.assign(qo,{flexDir:qo.flexDirection});var Yo={gridGap:Fo.space("gridGap"),gridColumnGap:Fo.space("gridColumnGap"),gridRowGap:Fo.space("gridRowGap"),gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridColumnStart:!0,gridColumnEnd:!0,gridRowStart:!0,gridRowEnd:!0,gridAutoRows:!0,gridTemplate:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0},Zo={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:Bo.outline},outlineOffset:!0,outlineColor:Fo.colors("outlineColor")},Xo={width:Fo.sizesT("width"),inlineSize:Fo.sizesT("inlineSize"),height:Fo.sizes("height"),blockSize:Fo.sizes("blockSize"),boxSize:Fo.sizes(["width","height"]),minWidth:Fo.sizes("minWidth"),minInlineSize:Fo.sizes("minInlineSize"),minHeight:Fo.sizes("minHeight"),minBlockSize:Fo.sizes("minBlockSize"),maxWidth:Fo.sizes("maxWidth"),maxInlineSize:Fo.sizes("maxInlineSize"),maxHeight:Fo.sizes("maxHeight"),maxBlockSize:Fo.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:Fo.propT("float",Bo.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(Xo,{w:Xo.width,h:Xo.height,minW:Xo.minWidth,maxW:Xo.maxWidth,minH:Xo.minHeight,maxH:Xo.maxHeight,overscroll:Xo.overscrollBehavior,overscrollX:Xo.overscrollBehaviorX,overscrollY:Xo.overscrollBehaviorY});var $o={listStyleType:!0,listStylePosition:!0,listStylePos:Fo.prop("listStylePosition"),listStyleImage:!0,listStyleImg:Fo.prop("listStyleImage")};var Ko=function(e){var t=new WeakMap;return function(n,r,o,i){if(void 0===n)return e(n,r,o);t.has(n)||t.set(n,new Map);var a=t.get(n);if(a.has(r))return a.get(r);var s=e(n,r,o,i);return a.set(r,s),s}}((function(e,t,n,r){var o="string"==typeof t?t.split("."):[t];for(r=0;r1?t-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:"-";return e.replace(/\s+/g,t)}(e.toString());return function(e){return e.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}(function(e){if(e.includes("\\."))return e;var t=!Number.isInteger(parseFloat(e.toString()));return t?e.replace(".","\\."):e}(t))}function bi(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return[t,e].filter(Boolean).join("-")}function wi(e,t){return"var(".concat(e).concat(t?", ".concat(t):"",")")}function ki(e,t,n){var r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return yi("--".concat(bi(e,t)))}(e,n);return{variable:r,reference:wi(r,t)}}function xi(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}function Si(e){if(null==e)return e;var t=function(e){var t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}}(e);return t.unitless||"number"==typeof e?"".concat(e,"px"):e}var Ci=function(e,t){return parseInt(e[1],10)>parseInt(t[1],10)?1:-1},_i=function(e){return Object.fromEntries(Object.entries(e).sort(Ci))};function Ei(e){var t=_i(e);return Object.assign(Object.values(t),t)}function Pi(e){var t;if(!e)return e;var n=(e=null!==(t=Si(e))&&void 0!==t?t:e).endsWith("px")?-1:-.0625;return"number"==typeof e?"".concat(e+n):e.replace(/([0-9]+\.?[0-9]*)/,(function(e){return"".concat(parseFloat(e)+n)}))}function Li(e,t){var n=["@media screen"];return e&&n.push("and","(min-width: ".concat(Si(e),")")),t&&n.push("and","(max-width: ".concat(Si(t),")")),n.join(" ")}function Oi(e){var t;if(!e)return null;e.base=null!==(t=e.base)&&void 0!==t?t:"0px";var n=Ei(e),r=Object.entries(e).sort(Ci).map((function(e,t,n){var r,o=yn(e,2),i=o[0],a=o[1],s=yn(null!==(r=n[t+1])&&void 0!==r?r:[],2)[1];return s=parseFloat(s)>0?Pi(s):void 0,{_minW:Pi(a),breakpoint:i,minW:a,maxW:s,maxWQuery:Li(null,s),minWQuery:Li(a),minMaxQuery:Li(a,s)}})),o=function(e){var t=Object.keys(_i(e));return new Set(t)}(e),i=Array.from(o.values());return{keys:o,normalized:n,isResponsive:function(e){var t=Object.keys(e);return t.length>0&&t.every((function(e){return o.has(e)}))},asObject:_i(e),asArray:Ei(e),details:r,media:[null].concat(cn(n.map((function(e){return Li(e)})).slice(1))),toArrayValue:function(e){if(!yo(e))throw new Error("toArrayValue: value must be an object");for(var t=i.map((function(t){var n;return null!==(n=e[t])&&void 0!==n?n:null}));null===xi(t);)t.pop();return t},toObjectValue:function(e){if(!Array.isArray(e))throw new Error("toObjectValue: value must be an array");return e.reduce((function(e,t,n){var r=i[n];return null!=r&&null!=t&&(e[r]=t),e}),{})}}}var Ai=function(e,t){return"".concat(e,":hover ").concat(t,", ").concat(e,"[data-hover] ").concat(t)},Mi=function(e,t){return"".concat(e,":focus ").concat(t,", ").concat(e,"[data-focus] ").concat(t)},Ti=function(e,t){return"".concat(e,":focus-visible ").concat(t)},Ii=function(e,t){return"".concat(e,":focus-within ").concat(t)},Ri=function(e,t){return"".concat(e,":active ").concat(t,", ").concat(e,"[data-active] ").concat(t)},Ni=function(e,t){return"".concat(e,":disabled ").concat(t,", ").concat(e,"[data-disabled] ").concat(t)},Di=function(e,t){return"".concat(e,":invalid ").concat(t,", ").concat(e,"[data-invalid] ").concat(t)},zi=function(e,t){return"".concat(e,":checked ").concat(t,", ").concat(e,"[data-checked] ").concat(t)},ji=function(e,t){return"".concat(e,":placeholder-shown ").concat(t)},Bi=function(e){return Hi((function(t){return e(t,"&")}),"[role=group]","[data-group]",".group")},Fi=function(e){return Hi((function(t){return e(t,"~ &")}),"[data-peer]",".peer")},Hi=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:1/0;return(yo(e)||Array.isArray(e))&&t?Object.entries(e).reduce((function(e,n){var r=yn(n,2),o=r[0],i=r[1];return yo(i)||Array.isArray(i)?Object.entries(Zi(i,t-1)).forEach((function(t){var n=yn(t,2),r=n[0],i=n[1];e["".concat(o,".").concat(r)]=i})):e[o]=i,e}),{}):e}function Xi(t){var n,r=function(t){return t.__cssMap,t.__cssVars,t.__breakpoints,sn(t,e)}(t),o=Yi(r),i=function(e){return e.semanticTokens}(r),a=function(e){var t,n,r=e.tokens,o=e.semanticTokens,i=Object.entries(null!==(t=Zi(r))&&void 0!==t?t:{}).map((function(e){var t=yn(e,2);return[t[0],{isSemantic:!1,value:t[1]}]})),a=Object.entries(null!==(n=Zi(o,1))&&void 0!==n?n:{}).map((function(e){var t=yn(e,2);return[t[0],{isSemantic:!0,value:t[1]}]}));return Object.fromEntries([].concat(cn(i),cn(a)))}({tokens:o,semanticTokens:i}),s=Gi(a,{cssVarPrefix:null==(n=r.config)?void 0:n.cssVarPrefix}),l=s.cssMap,u=s.cssVars;return Object.assign(r,{__cssVars:un(un({},{"--chakra-ring-inset":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-ring-offset-width":"0px","--chakra-ring-offset-color":"#fff","--chakra-ring-color":"rgba(66, 153, 225, 0.6)","--chakra-ring-offset-shadow":"0 0 #0000","--chakra-ring-shadow":"0 0 #0000","--chakra-space-x-reverse":"0","--chakra-space-y-reverse":"0"}),u),__cssMap:l,__breakpoints:Oi(r.breakpoints)}),r}var $i=mo({},Ho,Vo,Wo,qo,Xo,Go,ri,Zo,Yo,ti,ni,Uo,oi,ui,li,ii,ai,$o,si),Ki=Object.assign({},oi,Xo,qo,Yo,ni),Qi=Object.keys(Ki),Ji=[].concat(cn(Object.keys($i)),Wi),ea=un(un({},$i),Vi),ta=function(e){return e in ea},na=function(e){return function(t){if(!t.__breakpoints)return e;var n=t.__breakpoints,r=n.isResponsive,o=n.toArrayValue,i=n.media,a={};for(var s in e){var l=bo(e[s],t);if(null!=l)if(l=yo(l)&&r(l)?o(l):l,Array.isArray(l))for(var u=l.slice(0,i.length).length,c=0;c1&&void 0!==arguments[1]&&arguments[1],s=bo(t,i),l=na(s)(i),u={};for(var c in l){var d,f=bo(l[c],i);c in o&&(c=o[c]),ra(c,f)&&(f=oa(i,f));var h=n[c];if(!0===h&&(h={property:c}),yo(f)){var p;u[c]=null!==(p=u[c])&&void 0!==p?p:{},u[c]=mo({},u[c],e(f,!0))}else{var v=null!==(d=null==(r=null==h?void 0:h.transform)?void 0:r.call(h,f,i,s))&&void 0!==d?d:f;v=(null==h?void 0:h.processResult)?e(v,!0):v;var g=bo(null==h?void 0:h.property,i);if(!a&&(null==h?void 0:h.static)){var m=bo(h.static,i);u=mo({},u,m)}if(g&&Array.isArray(g)){var y,b=xn(g);try{for(b.s();!(y=b.n()).done;){u[y.value]=v}}catch(w){b.e(w)}finally{b.f()}}else g?"&"===g&&yo(v)?u=mo({},u,v):u[g]=v:yo(v)?u=mo({},u,v):u[c]=v}}return u}}({theme:t,pseudos:Vi,configs:$i});return n(e)}};function aa(e){return{definePartsStyle:function(e){return e},defineMultiStyleConfig:function(t){return un({parts:e},t)}}}function sa(e){var t=e.__breakpoints;return function(e,n,r,o){var i,a;if(t){var s={},l=function(e,t){return Array.isArray(e)?e:yo(e)?t(e):null!=e?[e]:void 0}(r,t.toArrayValue);if(!l)return s;for(var u=l.length,c=1===u,d=!!e.parts,f=function(){var r=t.details[h],u=t.details[function(e,t){for(var n=t+1;n1&&void 0!==arguments[1]?arguments[1]:[],r=Object.assign({},e),o=xn(n);try{for(o.s();!(t=o.n()).done;){var i=t.value;i in r&&delete r[i]}}catch(a){o.e(a)}finally{o.f()}return r}(e,["styleConfig","size","variant","colorScheme"])}var ca=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t0?Ca(Ra,--Ta):0,Aa--,10===Ia&&(Aa=1,Oa--),Ia}function ja(){return Ia=Ta2||Va(Ia)>3?"":" "}function Ya(e,t){for(;--t&&ja()&&!(Ia<48||Ia>102||Ia>57&&Ia<65||Ia>70&&Ia<97););return Ha(e,Fa()+(t<6&&32==Ba()&&32==ja()))}function Za(e){for(;ja();)switch(Ia){case e:return Ta;case 34:case 39:34!==e&&39!==e&&Za(Ia);break;case 40:41===e&&Za(e);break;case 92:ja()}return Ta}function Xa(e,t){for(;ja()&&e+Ia!==57&&(e+Ia!==84||47!==Ba()););return"/*"+Ha(t,Ta-1)+"*"+ba(47===e?e:ja())}function $a(e){for(;!Va(Ba());)ja();return Ha(e,Ta)}function Ka(e){return Ua(Qa("",null,null,null,[""],e=Wa(e),0,[0],e))}function Qa(e,t,n,r,o,i,a,s,l){for(var u=0,c=0,d=a,f=0,h=0,p=0,v=1,g=1,m=1,y=0,b="",w=o,k=i,x=r,S=b;g;)switch(p=y,y=ja()){case 40:if(108!=p&&58==Ca(S,d-1)){-1!=Sa(S+=xa(Ga(y),"&","&\f"),"&\f")&&(m=-1);break}case 34:case 39:case 91:S+=Ga(y);break;case 9:case 10:case 13:case 32:S+=qa(p);break;case 92:S+=Ya(Fa()-1,7);continue;case 47:switch(Ba()){case 42:case 47:La(es(Xa(ja(),Fa()),t,n),l);break;default:S+="/"}break;case 123*v:s[u++]=Ea(S)*m;case 125*v:case 59:case 0:switch(y){case 0:case 125:g=0;case 59+c:h>0&&Ea(S)-d&&La(h>32?ts(S+";",r,n,d-1):ts(xa(S," ","")+";",r,n,d-2),l);break;case 59:S+=";";default:if(La(x=Ja(S,t,n,u,c,o,s,b,w=[],k=[],d),i),123===y)if(0===c)Qa(S,t,x,x,w,i,d,s,k);else switch(99===f&&110===Ca(S,3)?100:f){case 100:case 109:case 115:Qa(e,x,x,r&&La(Ja(e,x,x,0,0,o,s,b,o,w=[],d),k),o,k,d,s,r?w:k);break;default:Qa(S,x,x,x,[""],k,0,s,k)}}u=c=h=0,v=m=1,b=S="",d=a;break;case 58:d=1+Ea(S),h=p;default:if(v<1)if(123==y)--v;else if(125==y&&0==v++&&125==za())continue;switch(S+=ba(y),y*v){case 38:m=c>0?1:(S+="\f",-1);break;case 44:s[u++]=(Ea(S)-1)*m,m=1;break;case 64:45===Ba()&&(S+=Ga(ja())),f=Ba(),c=d=Ea(b=S+=$a(Fa())),y++;break;case 45:45===p&&2==Ea(S)&&(v=0)}}return i}function Ja(e,t,n,r,o,i,a,s,l,u,c){for(var d=o-1,f=0===o?i:[""],h=Pa(f),p=0,v=0,g=0;p0?f[m]+" "+y:xa(y,/&\f/g,f[m])))&&(l[g++]=b);return Na(e,t,n,0===o?va:s,l,u,c)}function es(e,t,n){return Na(e,t,n,pa,ba(Ia),_a(e,2,-2),0)}function ts(e,t,n,r){return Na(e,t,n,ga,_a(e,0,r),_a(e,r+1,-1),r)}function ns(e,t){for(var n="",r=Pa(e),o=0;o6)switch(Ca(e,t+1)){case 109:if(45!==Ca(e,t+4))break;case 102:return xa(e,/(.+:)(.+)-([^]+)/,"$1"+ha+"$2-$3$1"+fa+(108==Ca(e,t+3)?"$3":"$2-$3"))+e;case 115:return~Sa(e,"stretch")?ds(xa(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==Ca(e,t+1))break;case 6444:switch(Ca(e,Ea(e)-3-(~Sa(e,"!important")&&10))){case 107:return xa(e,":",":"+ha)+e;case 101:return xa(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+ha+(45===Ca(e,14)?"inline-":"")+"box$3$1"+ha+"$2$3$1"+da+"$2box$3")+e}break;case 5936:switch(Ca(e,t+11)){case 114:return ha+e+da+xa(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return ha+e+da+xa(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return ha+e+da+xa(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return ha+e+da+e+e}return e}var fs=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case ga:e.return=ds(e.value,e.length);break;case ma:return ns([Da(e,{value:xa(e.value,"@","@"+ha)})],r);case va:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return ns([Da(e,{props:[xa(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return ns([Da(e,{props:[xa(t,/:(plac\w+)/,":"+ha+"input-$1")]}),Da(e,{props:[xa(t,/:(plac\w+)/,":-moz-$1")]}),Da(e,{props:[xa(t,/:(plac\w+)/,da+"input-$1")]})],r)}return""}))}}],hs=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var r,o,i=e.stylisPlugins||fs,a={},s=[];r=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n=4;++r,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(o)+l;return{name:u,styles:o,next:Qs}},tl=!!Yr.useInsertionEffect&&Yr.useInsertionEffect,nl=tl||function(e){return e()},rl=tl||cr.useLayoutEffect,ol=cr.createContext("undefined"!=typeof HTMLElement?hs({key:"css"}):null),il=ol.Provider,al=function(e){return cr.forwardRef((function(t,n){var r=cr.useContext(ol);return e(t,r,n)}))},sl=cr.createContext({}),ll=os((function(e){return os((function(t){return function(e,t){return"function"==typeof t?t(e):ps({},e,t)}(e,t)}))})),ul=function(e){var t=cr.useContext(sl);return e.theme!==t&&(t=ll(t)(e.theme)),cr.createElement(sl.Provider,{value:t},e.children)},cl=al((function(e,t){var n=e.styles,r=el([n],void 0,cr.useContext(sl)),o=cr.useRef();return rl((function(){var e=t.key+"-global",n=new t.sheet.constructor({key:e,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),i=!1,a=document.querySelector('style[data-emotion="'+e+" "+r.name+'"]');return t.sheet.tags.length&&(n.before=t.sheet.tags[0]),null!==a&&(i=!0,a.setAttribute("data-emotion",e),n.hydrate([a])),o.current=[n,i],function(){n.flush()}}),[t]),rl((function(){var e=o.current,n=e[0];if(e[1])e[1]=!1;else{if(void 0!==r.next&&Ws(t,r.next,!0),n.tags.length){var i=n.tags[n.tags.length-1].nextElementSibling;n.before=i,n.flush()}t.insert("",r,n,!1)}}),[t,r.name]),null}));function dl(){for(var e=arguments.length,t=new Array(e),n=0;n1?t-1:0),r=1;r96?jl:Bl},Hl=function(e,t,n){var r;if(t){var o=t.shouldForwardProp;r=e.__emotion_forwardProp&&o?function(t){return e.__emotion_forwardProp(t)&&o(t)}:o}return"function"!=typeof r&&n&&(r=e.__emotion_forwardProp),r},Vl=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return Vs(t,n,r),nl((function(){return Ws(t,n,r)})),null},Wl=function e(t,n){var r,o,i=t.__emotion_real===t,a=i&&t.__emotion_base||t;void 0!==n&&(r=n.label,o=n.target);var s=Hl(t,n,i),l=s||Fl(a),u=!l("as");return function(){var c=arguments,d=i&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==r&&d.push("label:"+r+";"),null==c[0]||void 0===c[0].raw)d.push.apply(d,c);else{d.push(c[0][0]);for(var f=c.length,h=1;h1&&void 0!==arguments[1]?arguments[1]:{},n=!1;function r(){if(n)throw new Error("[anatomy] .part(...) should only be called once. Did you mean to use .extend(...) ?");n=!0}function o(){r();for(var n=arguments.length,o=new Array(n),i=0;i1)&&(e=1),e}function bu(e){return e<=1?"".concat(100*Number(e),"%"):e}function wu(e){return 1===e.length?"0"+e:String(e)}function ku(e,t,n){e=gu(e,255),t=gu(t,255),n=gu(n,255);var r=Math.max(e,t,n),o=Math.min(e,t,n),i=0,a=0,s=(r+o)/2;if(r===o)a=0,i=0;else{var l=r-o;switch(a=s>.5?l/(2-r-o):l/(r+o),r){case e:i=(t-n)/l+(t1&&(n-=1),n<1/6?e+6*n*(t-e):n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Su(e,t,n){e=gu(e,255),t=gu(t,255),n=gu(n,255);var r=Math.max(e,t,n),o=Math.min(e,t,n),i=0,a=r,s=r-o,l=0===r?0:s/r;if(r===o)i=0;else{switch(r){case e:i=(t-n)/s+(t>16,g:(65280&e)>>8,b:255&e}}(t)),this.originalInput=t;var o=Ou(t);this.originalInput=t,this.r=o.r,this.g=o.g,this.b=o.b,this.a=o.a,this.roundA=Math.round(100*this.a)/100,this.format=null!==(r=n.format)&&void 0!==r?r:o.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=o.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},e.prototype.getLuminance=function(){var e=this.toRgb(),t=e.r/255,n=e.g/255,r=e.b/255;return.2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(e){return this.a=yu(e),this.roundA=Math.round(100*this.a)/100,this},e.prototype.toHsv=function(){var e=Su(this.r,this.g,this.b);return{h:360*e.h,s:e.s,v:e.v,a:this.a}},e.prototype.toHsvString=function(){var e=Su(this.r,this.g,this.b),t=Math.round(360*e.h),n=Math.round(100*e.s),r=Math.round(100*e.v);return 1===this.a?"hsv(".concat(t,", ").concat(n,"%, ").concat(r,"%)"):"hsva(".concat(t,", ").concat(n,"%, ").concat(r,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var e=ku(this.r,this.g,this.b);return{h:360*e.h,s:e.s,l:e.l,a:this.a}},e.prototype.toHslString=function(){var e=ku(this.r,this.g,this.b),t=Math.round(360*e.h),n=Math.round(100*e.s),r=Math.round(100*e.l);return 1===this.a?"hsl(".concat(t,", ").concat(n,"%, ").concat(r,"%)"):"hsla(".concat(t,", ").concat(n,"%, ").concat(r,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(e){return void 0===e&&(e=!1),Cu(this.r,this.g,this.b,e)},e.prototype.toHexString=function(e){return void 0===e&&(e=!1),"#"+this.toHex(e)},e.prototype.toHex8=function(e){return void 0===e&&(e=!1),function(e,t,n,r,o){var i=[wu(Math.round(e).toString(16)),wu(Math.round(t).toString(16)),wu(Math.round(n).toString(16)),wu(_u(r))];return o&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))&&i[3].startsWith(i[3].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}(this.r,this.g,this.b,this.a,e)},e.prototype.toHex8String=function(e){return void 0===e&&(e=!1),"#"+this.toHex8(e)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),n=Math.round(this.b);return 1===this.a?"rgb(".concat(e,", ").concat(t,", ").concat(n,")"):"rgba(".concat(e,", ").concat(t,", ").concat(n,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var e=function(e){return"".concat(Math.round(100*gu(e,255)),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var e=function(e){return Math.round(100*gu(e,255))};return 1===this.a?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(0===this.a)return"transparent";if(this.a<1)return!1;for(var e="#"+Cu(this.r,this.g,this.b,!1),t=0,n=Object.entries(Lu);t=0;return t||!r||!e.startsWith("hex")&&"name"!==e?("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString()):"name"===e&&0===this.a?this.toName():this.toRgbString()},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.l+=t/100,n.l=mu(n.l),new e(n)},e.prototype.brighten=function(t){void 0===t&&(t=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(-t/100*255))),n.g=Math.max(0,Math.min(255,n.g-Math.round(-t/100*255))),n.b=Math.max(0,Math.min(255,n.b-Math.round(-t/100*255))),new e(n)},e.prototype.darken=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.l-=t/100,n.l=mu(n.l),new e(n)},e.prototype.tint=function(e){return void 0===e&&(e=10),this.mix("white",e)},e.prototype.shade=function(e){return void 0===e&&(e=10),this.mix("black",e)},e.prototype.desaturate=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.s-=t/100,n.s=mu(n.s),new e(n)},e.prototype.saturate=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.s+=t/100,n.s=mu(n.s),new e(n)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var n=this.toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,new e(n)},e.prototype.mix=function(t,n){void 0===n&&(n=50);var r=this.toRgb(),o=new e(t).toRgb(),i=n/100;return new e({r:(o.r-r.r)*i+r.r,g:(o.g-r.g)*i+r.g,b:(o.b-r.b)*i+r.b,a:(o.a-r.a)*i+r.a})},e.prototype.analogous=function(t,n){void 0===t&&(t=6),void 0===n&&(n=30);var r=this.toHsl(),o=360/n,i=[this];for(r.h=(r.h-(o*t>>1)+720)%360;--t;)r.h=(r.h+o)%360,i.push(new e(r));return i},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){void 0===t&&(t=6);for(var n=this.toHsv(),r=n.h,o=n.s,i=n.v,a=[],s=1/t;t--;)a.push(new e({h:r,s:o,v:i})),i=(i+s)%1;return a},e.prototype.splitcomplement=function(){var t=this.toHsl(),n=t.h;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var n=this.toRgb(),r=new e(t).toRgb();return new e({r:r.r+(n.r-r.r)*n.a,g:r.g+(n.g-r.g)*n.a,b:r.b+(n.b-r.b)*n.a})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var n=this.toHsl(),r=n.h,o=[this],i=360/t,a=1;an.length;)e.count=null,e.seed&&(e.seed+=1),n.push(Du(e));return e.count=t,n}var r=function(e,t){var n=ju(function(e){var t=parseInt(e,10);if(!Number.isNaN(t)&&t<360&&t>0)return[t,t];if("string"==typeof e){var n=Fu.find((function(t){return t.name===e}));if(n){var r=Bu(n);if(r.hueRange)return r.hueRange}var o=new Nu(e);if(o.isValid){var i=o.toHsv().h;return[i,i]}}return[0,360]}(e),t);n<0&&(n=360+n);return n}(e.hue,e.seed),o=function(e,t){if("monochrome"===t.hue)return 0;if("random"===t.luminosity)return ju([0,100],t.seed);var n=zu(e).saturationRange,r=n[0],o=n[1];switch(t.luminosity){case"bright":r=55;break;case"dark":r=o-10;break;case"light":o=55}return ju([r,o],t.seed)}(r,e),i=function(e,t,n){var r=function(e,t){for(var n=zu(e).lowerBounds,r=0;r=o&&t<=a){var l=(s-i)/(a-o);return l*t+(i-l*o)}}return 0}(e,t),o=100;switch(n.luminosity){case"dark":o=r+20;break;case"light":r=(o+r)/2;break;case"random":r=0,o=100}return ju([r,o],n.seed)}(r,o,e),a={h:r,s:o,v:i};return void 0!==e.alpha&&(a.a=e.alpha),new Nu(a)}function zu(e){e>=334&&e<=360&&(e-=360);for(var t=0,n=Fu;t=r.hueRange[0]&&e<=r.hueRange[1])return r}throw Error("Color not found")}function ju(e,t){if(void 0===t)return Math.floor(e[0]+Math.random()*(e[1]+1-e[0]));var n=e[1]||1,r=e[0]||0,o=(t=(9301*t+49297)%233280)/233280;return Math.floor(r+o*(n-r))}function Bu(e){var t=e.lowerBounds[0][0],n=e.lowerBounds[e.lowerBounds.length-1][0],r=e.lowerBounds[e.lowerBounds.length-1][1],o=e.lowerBounds[0][1];return{name:e.name,hueRange:e.hueRange,lowerBounds:e.lowerBounds,saturationRange:[t,n],brightnessRange:[r,o]}}var Fu=[{name:"monochrome",hueRange:null,lowerBounds:[[0,0],[100,0]]},{name:"red",hueRange:[-26,18],lowerBounds:[[20,100],[30,92],[40,89],[50,85],[60,78],[70,70],[80,60],[90,55],[100,50]]},{name:"orange",hueRange:[19,46],lowerBounds:[[20,100],[30,93],[40,88],[50,86],[60,85],[70,70],[100,70]]},{name:"yellow",hueRange:[47,62],lowerBounds:[[25,100],[40,94],[50,89],[60,86],[70,84],[80,82],[90,80],[100,75]]},{name:"green",hueRange:[63,178],lowerBounds:[[30,100],[40,90],[50,85],[60,81],[70,74],[80,64],[90,50],[100,40]]},{name:"blue",hueRange:[179,257],lowerBounds:[[20,100],[30,86],[40,80],[50,74],[60,60],[70,52],[80,44],[90,39],[100,35]]},{name:"purple",hueRange:[258,282],lowerBounds:[[20,100],[30,87],[40,79],[50,70],[60,65],[70,59],[80,52],[90,45],[100,42]]},{name:"pink",hueRange:[283,334],lowerBounds:[[20,100],[30,90],[40,86],[60,84],[80,80],[90,75],[100,73]]}];var Hu=function(e,t,n){var r=function(e,t,n,r,o){for(t=t.split?t.split("."):t,r=0;r0&&void 0!==arguments[0]?arguments[0]:"1rem",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"rgba(255, 255, 255, 0.15)";return{backgroundImage:"linear-gradient(\n 45deg,\n ".concat(t," 25%,\n transparent 25%,\n transparent 50%,\n ").concat(t," 50%,\n ").concat(t," 75%,\n transparent 75%,\n transparent\n )"),backgroundSize:"".concat(e," ").concat(e)}}function Gu(e){var t,n=Du().toHexString();return e&&(t=e,0!==Object.keys(t).length)?e.string&&e.colors?function(e,t){var n=0;if(0===e.length)return t[0];for(var r=0;r>8*o&255).toString(16)).substr(-2)}return r}(e.string):e.colors&&!e.string?function(e){return e[Math.floor(Math.random()*e.length)]}(e.colors):n:n}function qu(e,t){return function(n){return"dark"===n.colorMode?t:e}}function Yu(e){var t=e.orientation,n=e.vertical,r=e.horizontal;return t?"vertical"===t?n:r:{}}function Zu(e){return function(e){var t=kn(e);return null!=e&&("object"===t||"function"===t)&&!Array.isArray(e)}(e)&&e.reference?e.reference:String(e)}var Xu=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:"-";return e.replace(/\s+/g,t)}(e.toString());return t.includes("\\.")?e:function(e){return!Number.isInteger(parseFloat(e.toString()))}(e)?t.replace(".","\\."):e}function rc(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return[t,nc(e)].filter(Boolean).join("-")}function oc(e,t){return"var(".concat(nc(e)).concat(t?", ".concat(t):"",")")}function ic(e,t){var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"--".concat(rc(e,t))}(e,null==t?void 0:t.prefix);return{variable:n,reference:oc(n,ac(null==t?void 0:t.fallback))}}function ac(e){return"string"==typeof e?e:null==e?void 0:e.reference}var sc=aa(Gl.keys),lc=sc.definePartsStyle,uc=(0,sc.defineMultiStyleConfig)({baseStyle:lc({container:{borderTopWidth:"1px",borderColor:"inherit",_last:{borderBottomWidth:"1px"}},button:{transitionProperty:"common",transitionDuration:"normal",fontSize:"md",_focusVisible:{boxShadow:"outline"},_hover:{bg:"blackAlpha.50"},_disabled:{opacity:.4,cursor:"not-allowed"},px:"4",py:"2"},panel:{pt:"2",px:"4",pb:"5"},icon:{fontSize:"1.25em"}})}),cc=aa(ql.keys),dc=cc.definePartsStyle,fc=cc.defineMultiStyleConfig,hc=ki("alert-fg"),pc=ki("alert-bg"),vc=dc({container:{bg:pc.reference,px:"4",py:"3"},title:{fontWeight:"bold",lineHeight:"6",marginEnd:"2"},description:{lineHeight:"6"},icon:{color:hc.reference,flexShrink:0,marginEnd:"3",w:"5",h:"6"},spinner:{color:hc.reference,flexShrink:0,marginEnd:"3",w:"5",h:"5"}});function gc(e){var t=e.theme,n=e.colorScheme,r=Wu("".concat(n,".200"),.16)(t);return{light:"colors.".concat(n,".100"),dark:r}}var mc=dc((function(e){var t,n,r=e.colorScheme,o=gc(e);return{container:(n={},gn(n,hc.variable,"colors.".concat(r,".500")),gn(n,pc.variable,o.light),gn(n,"_dark",(t={},gn(t,hc.variable,"colors.".concat(r,".200")),gn(t,pc.variable,o.dark),t)),n)}})),yc=dc((function(e){var t,n,r=e.colorScheme,o=gc(e);return{container:(n={},gn(n,hc.variable,"colors.".concat(r,".500")),gn(n,pc.variable,o.light),gn(n,"_dark",(t={},gn(t,hc.variable,"colors.".concat(r,".200")),gn(t,pc.variable,o.dark),t)),gn(n,"paddingStart","3"),gn(n,"borderStartWidth","4px"),gn(n,"borderStartColor",hc.reference),n)}})),bc=dc((function(e){var t,n,r=e.colorScheme,o=gc(e);return{container:(n={},gn(n,hc.variable,"colors.".concat(r,".500")),gn(n,pc.variable,o.light),gn(n,"_dark",(t={},gn(t,hc.variable,"colors.".concat(r,".200")),gn(t,pc.variable,o.dark),t)),gn(n,"pt","2"),gn(n,"borderTopWidth","4px"),gn(n,"borderTopColor",hc.reference),n)}})),wc=dc((function(e){var t,n,r=e.colorScheme;return{container:(n={},gn(n,hc.variable,"colors.white"),gn(n,pc.variable,"colors.".concat(r,".500")),gn(n,"_dark",(t={},gn(t,hc.variable,"colors.gray.900"),gn(t,pc.variable,"colors.".concat(r,".200")),t)),gn(n,"color",hc.reference),n)}})),kc=fc({baseStyle:vc,variants:{subtle:mc,"left-accent":yc,"top-accent":bc,solid:wc},defaultProps:{variant:"subtle",colorScheme:"blue"}}),xc={px:"1px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},Sc=un(un(un({},xc),{max:"max-content",min:"min-content",full:"100%","3xs":"14rem","2xs":"16rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem","8xl":"90rem",prose:"60ch"}),{},{container:{sm:"640px",md:"768px",lg:"1024px",xl:"1280px"}}),Cc=function(e){return"function"==typeof e};function _c(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r &:not(:last-of-type)":{marginEnd:"-1px"}},_c(qc,e))},Zc={yellow:{bg:"yellow.400",color:"black",hoverBg:"yellow.500",activeBg:"yellow.600"},cyan:{bg:"cyan.400",color:"black",hoverBg:"cyan.500",activeBg:"cyan.600"}},Xc=function(e){var t,n=e.colorScheme;if("gray"===n){var r=qu("gray.100","whiteAlpha.200")(e);return{bg:r,_hover:{bg:qu("gray.200","whiteAlpha.300")(e),_disabled:{bg:r}},_active:{bg:qu("gray.300","whiteAlpha.400")(e)}}}var o=null!==(t=Zc[n])&&void 0!==t?t:{},i=o.bg,a=void 0===i?"".concat(n,".500"):i,s=o.color,l=void 0===s?"white":s,u=o.hoverBg,c=void 0===u?"".concat(n,".600"):u,d=o.activeBg,f=void 0===d?"".concat(n,".700"):d,h=qu(a,"".concat(n,".200"))(e);return{bg:h,color:qu(l,"gray.800")(e),_hover:{bg:qu(c,"".concat(n,".300"))(e),_disabled:{bg:h}},_active:{bg:qu(f,"".concat(n,".400"))(e)}}},$c=function(e){var t=e.colorScheme;return{padding:0,height:"auto",lineHeight:"normal",verticalAlign:"baseline",color:qu("".concat(t,".500"),"".concat(t,".200"))(e),_hover:{textDecoration:"underline",_disabled:{textDecoration:"none"}},_active:{color:qu("".concat(t,".700"),"".concat(t,".500"))(e)}}},Kc={baseStyle:{lineHeight:"1.2",borderRadius:"md",fontWeight:"semibold",transitionProperty:"common",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{_disabled:{bg:"initial"}}},variants:{ghost:qc,outline:Yc,solid:Xc,link:$c,unstyled:{bg:"none",color:"inherit",display:"inline",lineHeight:"inherit",m:"0",p:"0"}},sizes:{lg:{h:"12",minW:"12",fontSize:"lg",px:"6"},md:{h:"10",minW:"10",fontSize:"md",px:"4"},sm:{h:"8",minW:"8",fontSize:"sm",px:"3"},xs:{h:"6",minW:"6",fontSize:"xs",px:"2"}},defaultProps:{variant:"solid",size:"md",colorScheme:"gray"}},Qc=aa(vu.keys),Jc=Qc.definePartsStyle,ed=Qc.defineMultiStyleConfig,td=ki("card-bg"),nd=ki("card-padding"),rd=Jc({container:(tn={},gn(tn,td.variable,"chakra-body-bg"),gn(tn,"backgroundColor",td.reference),gn(tn,"color","chakra-body-text"),tn),body:{padding:nd.reference,flex:"1 1 0%"},header:{padding:nd.reference},footer:{padding:nd.reference}}),od={sm:Jc({container:gn({borderRadius:"base"},nd.variable,"space.3")}),md:Jc({container:gn({borderRadius:"md"},nd.variable,"space.5")}),lg:Jc({container:gn({borderRadius:"xl"},nd.variable,"space.7")})},id=ed({baseStyle:rd,variants:{elevated:Jc({container:{boxShadow:"base",_dark:gn({},td.variable,"colors.gray.700")}}),outline:Jc({container:{borderWidth:"1px",borderColor:"chakra-border-color"}}),filled:Jc({container:gn({},td.variable,"colors.chakra-subtle-bg")}),unstyled:{body:{padding:0},header:{padding:0},footer:{padding:0}}},sizes:od,defaultProps:{variant:"elevated",size:"md"}}),ad=aa(Xl.keys),sd=ad.definePartsStyle,ld=ad.defineMultiStyleConfig,ud=ki("checkbox-size"),cd=function(e){var t=e.colorScheme;return{w:ud.reference,h:ud.reference,transitionProperty:"box-shadow",transitionDuration:"normal",border:"2px solid",borderRadius:"sm",borderColor:"inherit",color:"white",_checked:{bg:qu("".concat(t,".500"),"".concat(t,".200"))(e),borderColor:qu("".concat(t,".500"),"".concat(t,".200"))(e),color:qu("white","gray.900")(e),_hover:{bg:qu("".concat(t,".600"),"".concat(t,".300"))(e),borderColor:qu("".concat(t,".600"),"".concat(t,".300"))(e)},_disabled:{borderColor:qu("gray.200","transparent")(e),bg:qu("gray.200","whiteAlpha.300")(e),color:qu("gray.500","whiteAlpha.500")(e)}},_indeterminate:{bg:qu("".concat(t,".500"),"".concat(t,".200"))(e),borderColor:qu("".concat(t,".500"),"".concat(t,".200"))(e),color:qu("white","gray.900")(e)},_disabled:{bg:qu("gray.100","whiteAlpha.100")(e),borderColor:qu("gray.100","transparent")(e)},_focusVisible:{boxShadow:"outline"},_invalid:{borderColor:qu("red.500","red.300")(e)}}},dd={_disabled:{cursor:"not-allowed"}},fd={userSelect:"none",_disabled:{opacity:.4}},hd={transitionProperty:"transform",transitionDuration:"normal"},pd=ld({baseStyle:sd((function(e){return{icon:hd,container:dd,control:_c(cd,e),label:fd}})),sizes:{sm:sd({control:gn({},ud.variable,"sizes.3"),label:{fontSize:"sm"},icon:{fontSize:"3xs"}}),md:sd({control:gn({},ud.variable,"sizes.4"),label:{fontSize:"md"},icon:{fontSize:"2xs"}}),lg:sd({control:gn({},ud.variable,"sizes.5"),label:{fontSize:"lg"},icon:{fontSize:"2xs"}})},defaultProps:{size:"md",colorScheme:"blue"}}),vd=ic("close-button-size"),gd=ic("close-button-bg"),md={baseStyle:{w:[vd.reference],h:[vd.reference],borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:(rn={},gn(rn,gd.variable,"colors.blackAlpha.100"),gn(rn,"_dark",gn({},gd.variable,"colors.whiteAlpha.100")),rn),_active:(ln={},gn(ln,gd.variable,"colors.blackAlpha.200"),gn(ln,"_dark",gn({},gd.variable,"colors.whiteAlpha.200")),ln),_focusVisible:{boxShadow:"outline"},bg:gd.reference},sizes:{lg:(fn={},gn(fn,vd.variable,"sizes.10"),gn(fn,"fontSize","md"),fn),md:(vn={},gn(vn,vd.variable,"sizes.8"),gn(vn,"fontSize","xs"),vn),sm:(mn={},gn(mn,vd.variable,"sizes.6"),gn(mn,"fontSize","2xs"),mn)},defaultProps:{size:"md"}},yd={baseStyle:{fontFamily:"mono",fontSize:"sm",px:"0.2em",borderRadius:"sm"},variants:Wc.variants,defaultProps:Wc.defaultProps},bd={baseStyle:{w:"100%",mx:"auto",maxW:"prose",px:"4"}},wd={baseStyle:{opacity:.6,borderColor:"inherit"},variants:{solid:{borderStyle:"solid"},dashed:{borderStyle:"dashed"}},defaultProps:{variant:"solid"}},kd=aa($l.keys),xd=kd.definePartsStyle,Sd=kd.defineMultiStyleConfig,Cd=ki("drawer-bg"),_d=ki("drawer-box-shadow");function Ed(e){return xd("full"===e?{dialog:{maxW:"100vw",h:"100vh"}}:{dialog:{maxW:e}})}var Pd={bg:"blackAlpha.600",zIndex:"overlay"},Ld={display:"flex",zIndex:"modal",justifyContent:"center"},Od=function(e){var t,n;return un(un({},e.isFullHeight&&{height:"100vh"}),{},(gn(n={zIndex:"modal",maxH:"100vh",color:"inherit"},Cd.variable,"colors.white"),gn(n,_d.variable,"shadows.lg"),gn(n,"_dark",(gn(t={},Cd.variable,"colors.gray.700"),gn(t,_d.variable,"shadows.dark-lg"),t)),gn(n,"bg",Cd.reference),gn(n,"boxShadow",_d.reference),n))},Ad={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},Md={position:"absolute",top:"2",insetEnd:"3"},Td={px:"6",py:"2",flex:"1",overflow:"auto"},Id={px:"6",py:"4"},Rd=Sd({baseStyle:xd((function(e){return{overlay:Pd,dialogContainer:Ld,dialog:_c(Od,e),header:Ad,closeButton:Md,body:Td,footer:Id}})),sizes:{xs:Ed("xs"),sm:Ed("md"),md:Ed("lg"),lg:Ed("2xl"),xl:Ed("4xl"),full:Ed("full")},defaultProps:{size:"xs"}}),Nd=aa(Kl.keys),Dd=Nd.definePartsStyle,zd=(0,Nd.defineMultiStyleConfig)({baseStyle:Dd({preview:{borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal"},input:{borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},textarea:{borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}}})}),jd=aa(Ql.keys),Bd=jd.definePartsStyle,Fd=jd.defineMultiStyleConfig,Hd=ki("form-control-color"),Vd=Fd({baseStyle:Bd({container:{width:"100%",position:"relative"},requiredIndicator:(gn(bn={marginStart:"1"},Hd.variable,"colors.red.500"),gn(bn,"_dark",gn({},Hd.variable,"colors.red.300")),gn(bn,"color",Hd.reference),bn),helperText:(gn(wn={mt:"2"},Hd.variable,"colors.gray.600"),gn(wn,"_dark",gn({},Hd.variable,"colors.whiteAlpha.600")),gn(wn,"color",Hd.reference),gn(wn,"lineHeight","normal"),gn(wn,"fontSize","sm"),wn)})}),Wd=aa(Jl.keys),Ud=Wd.definePartsStyle,Gd=Wd.defineMultiStyleConfig,qd=ki("form-error-color"),Yd=Gd({baseStyle:Ud({text:(gn(Sn={},qd.variable,"colors.red.500"),gn(Sn,"_dark",gn({},qd.variable,"colors.red.300")),gn(Sn,"color",qd.reference),gn(Sn,"mt","2"),gn(Sn,"fontSize","sm"),gn(Sn,"lineHeight","normal"),Sn),icon:(gn(Cn={marginEnd:"0.5em"},qd.variable,"colors.red.500"),gn(Cn,"_dark",gn({},qd.variable,"colors.red.300")),gn(Cn,"color",qd.reference),Cn)})}),Zd={baseStyle:{fontSize:"md",marginEnd:"3",mb:"2",fontWeight:"medium",transitionProperty:"common",transitionDuration:"normal",opacity:1,_disabled:{opacity:.4}}},Xd={baseStyle:{fontFamily:"heading",fontWeight:"bold"},sizes:{"4xl":{fontSize:["6xl",null,"7xl"],lineHeight:1},"3xl":{fontSize:["5xl",null,"6xl"],lineHeight:1},"2xl":{fontSize:["4xl",null,"5xl"],lineHeight:[1.2,null,1]},xl:{fontSize:["3xl",null,"4xl"],lineHeight:[1.33,null,1.2]},lg:{fontSize:["2xl",null,"3xl"],lineHeight:[1.33,null,1.2]},md:{fontSize:"xl",lineHeight:1.2},sm:{fontSize:"md",lineHeight:1.2},xs:{fontSize:"sm",lineHeight:1.2}},defaultProps:{size:"xl"}},$d=aa(eu.keys),Kd=$d.definePartsStyle,Qd=$d.defineMultiStyleConfig,Jd=Kd({field:{width:"100%",minWidth:0,outline:0,position:"relative",appearance:"none",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed"}}}),ef={lg:{fontSize:"lg",px:"4",h:"12",borderRadius:"md"},md:{fontSize:"md",px:"4",h:"10",borderRadius:"md"},sm:{fontSize:"sm",px:"3",h:"8",borderRadius:"sm"},xs:{fontSize:"xs",px:"2",h:"6",borderRadius:"sm"}},tf={lg:Kd({field:ef.lg,addon:ef.lg}),md:Kd({field:ef.md,addon:ef.md}),sm:Kd({field:ef.sm,addon:ef.sm}),xs:Kd({field:ef.xs,addon:ef.xs})};function nf(e){var t=e.focusBorderColor,n=e.errorBorderColor;return{focusBorderColor:t||qu("blue.500","blue.300")(e),errorBorderColor:n||qu("red.500","red.300")(e)}}var rf=Kd((function(e){var t=e.theme,n=nf(e),r=n.focusBorderColor,o=n.errorBorderColor;return{field:{border:"1px solid",borderColor:"inherit",bg:"inherit",_hover:{borderColor:qu("gray.300","whiteAlpha.400")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:Hu(t,o),boxShadow:"0 0 0 1px ".concat(Hu(t,o))},_focusVisible:{zIndex:1,borderColor:Hu(t,r),boxShadow:"0 0 0 1px ".concat(Hu(t,r))}},addon:{border:"1px solid",borderColor:qu("inherit","whiteAlpha.50")(e),bg:qu("gray.100","whiteAlpha.300")(e)}}})),of=Kd((function(e){var t=e.theme,n=nf(e),r=n.focusBorderColor,o=n.errorBorderColor;return{field:{border:"2px solid",borderColor:"transparent",bg:qu("gray.100","whiteAlpha.50")(e),_hover:{bg:qu("gray.200","whiteAlpha.100")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:Hu(t,o)},_focusVisible:{bg:"transparent",borderColor:Hu(t,r)}},addon:{border:"2px solid",borderColor:"transparent",bg:qu("gray.100","whiteAlpha.50")(e)}}})),af=Kd((function(e){var t=e.theme,n=nf(e),r=n.focusBorderColor,o=n.errorBorderColor;return{field:{borderBottom:"1px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent",_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:Hu(t,o),boxShadow:"0px 1px 0px 0px ".concat(Hu(t,o))},_focusVisible:{borderColor:Hu(t,r),boxShadow:"0px 1px 0px 0px ".concat(Hu(t,r))}},addon:{borderBottom:"2px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent"}}})),sf=Qd({baseStyle:Jd,sizes:tf,variants:{outline:rf,filled:of,flushed:af,unstyled:Kd({field:{bg:"transparent",px:"0",height:"auto"},addon:{bg:"transparent",px:"0",height:"auto"}})},defaultProps:{size:"md",variant:"outline"}}),lf=ki("kbd-bg"),uf={baseStyle:(gn(_n={},lf.variable,"colors.gray.100"),gn(_n,"_dark",gn({},lf.variable,"colors.whiteAlpha.100")),gn(_n,"bg",lf.reference),gn(_n,"borderRadius","md"),gn(_n,"borderWidth","1px"),gn(_n,"borderBottomWidth","3px"),gn(_n,"fontSize","0.8em"),gn(_n,"fontWeight","bold"),gn(_n,"lineHeight","normal"),gn(_n,"px","0.4em"),gn(_n,"whiteSpace","nowrap"),_n)},cf={baseStyle:{transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}}},df=aa(tu.keys),ff=(0,df.defineMultiStyleConfig)({baseStyle:(0,df.definePartsStyle)({icon:{marginEnd:"2",display:"inline",verticalAlign:"text-bottom"}})}),hf=aa(nu.keys),pf=hf.defineMultiStyleConfig,vf=hf.definePartsStyle,gf=ki("menu-bg"),mf=ki("menu-shadow"),yf=pf({baseStyle:vf({button:{transitionProperty:"common",transitionDuration:"normal"},list:(gn(Pn={},gf.variable,"#fff"),gn(Pn,mf.variable,"shadows.sm"),gn(Pn,"_dark",(gn(En={},gf.variable,"colors.gray.700"),gn(En,mf.variable,"shadows.dark-lg"),En)),gn(Pn,"color","inherit"),gn(Pn,"minW","3xs"),gn(Pn,"py","2"),gn(Pn,"zIndex",1),gn(Pn,"borderRadius","md"),gn(Pn,"borderWidth","1px"),gn(Pn,"bg",gf.reference),gn(Pn,"boxShadow",mf.reference),Pn),item:{py:"1.5",px:"3",transitionProperty:"background",transitionDuration:"ultra-fast",transitionTimingFunction:"ease-in",_focus:(Ln={},gn(Ln,gf.variable,"colors.gray.100"),gn(Ln,"_dark",gn({},gf.variable,"colors.whiteAlpha.100")),Ln),_active:(On={},gn(On,gf.variable,"colors.gray.200"),gn(On,"_dark",gn({},gf.variable,"colors.whiteAlpha.200")),On),_expanded:(An={},gn(An,gf.variable,"colors.gray.100"),gn(An,"_dark",gn({},gf.variable,"colors.whiteAlpha.100")),An),_disabled:{opacity:.4,cursor:"not-allowed"},bg:gf.reference},groupTitle:{mx:4,my:2,fontWeight:"semibold",fontSize:"sm"},command:{opacity:.6},divider:{border:0,borderBottom:"1px solid",borderColor:"inherit",my:"2",opacity:.6}})}),bf=aa(ru.keys),wf=bf.defineMultiStyleConfig,kf=bf.definePartsStyle,xf={bg:"blackAlpha.600",zIndex:"modal"},Sf=function(e){return{display:"flex",zIndex:"modal",justifyContent:"center",alignItems:e.isCentered?"center":"flex-start",overflow:"inside"===e.scrollBehavior?"hidden":"auto"}},Cf=function(e){var t=e.scrollBehavior;return{borderRadius:"md",bg:qu("white","gray.700")(e),color:"inherit",my:"16",zIndex:"modal",maxH:"inside"===t?"calc(100% - 7.5rem)":void 0,boxShadow:qu("lg","dark-lg")(e)}},_f={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},Ef={position:"absolute",top:"2",insetEnd:"3"},Pf=function(e){return{px:"6",py:"2",flex:"1",overflow:"inside"===e.scrollBehavior?"auto":void 0}},Lf={px:"6",py:"4"};function Of(e){return kf("full"===e?{dialog:{maxW:"100vw",minH:"$100vh",my:"0",borderRadius:"0"}}:{dialog:{maxW:e}})}var Af=wf({baseStyle:kf((function(e){return{overlay:xf,dialogContainer:_c(Sf,e),dialog:_c(Cf,e),header:_f,closeButton:Ef,body:_c(Pf,e),footer:Lf}})),sizes:{xs:Of("xs"),sm:Of("sm"),md:Of("md"),lg:Of("lg"),xl:Of("xl"),"2xl":Of("2xl"),"3xl":Of("3xl"),"4xl":Of("4xl"),"5xl":Of("5xl"),"6xl":Of("6xl"),full:Of("full")},defaultProps:{size:"md"}}),Mf={letterSpacings:{tighter:"-0.05em",tight:"-0.025em",normal:"0",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeights:{normal:"normal",none:1,shorter:1.25,short:1.375,base:1.5,tall:1.625,taller:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},fontWeights:{hairline:100,thin:200,light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800,black:900},fonts:{heading:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',body:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',mono:'SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'},fontSizes:{"3xs":"0.45rem","2xs":"0.625rem",xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem","7xl":"4.5rem","8xl":"6rem","9xl":"8rem"}},Tf=aa(ou.keys),If=Tf.defineMultiStyleConfig,Rf=Tf.definePartsStyle,Nf=ic("number-input-stepper-width"),Df=ic("number-input-input-padding"),zf=tc(Nf).add("0.5rem").toString(),jf=ic("number-input-bg"),Bf=ic("number-input-color"),Ff=ic("number-input-border-color"),Hf=(gn(Mn={},Nf.variable,"sizes.6"),gn(Mn,Df.variable,zf),Mn),Vf=function(e){var t,n;return null!==(t=null==(n=_c(sf.baseStyle,e))?void 0:n.field)&&void 0!==t?t:{}},Wf={width:Nf.reference},Uf=(gn(Rn={borderStart:"1px solid",borderStartColor:Ff.reference,color:Bf.reference,bg:jf.reference},Bf.variable,"colors.chakra-body-text"),gn(Rn,Ff.variable,"colors.chakra-border-color"),gn(Rn,"_dark",(gn(Tn={},Bf.variable,"colors.whiteAlpha.800"),gn(Tn,Ff.variable,"colors.whiteAlpha.300"),Tn)),gn(Rn,"_active",(gn(In={},jf.variable,"colors.gray.200"),gn(In,"_dark",gn({},jf.variable,"colors.whiteAlpha.300")),In)),gn(Rn,"_disabled",{opacity:.4,cursor:"not-allowed"}),Rn);function Gf(e){var t,n,r,o=null==(n=sf.sizes)?void 0:n[e],i={lg:"md",md:"md",sm:"sm",xs:"sm"},a=null!==(t=null==(r=o.field)?void 0:r.fontSize)&&void 0!==t?t:"md",s=Mf.fontSizes[a];return Rf({field:un(un({},o.field),{},{paddingInlineEnd:Df.reference,verticalAlign:"top"}),stepper:{fontSize:tc(s).multiply(.75).toString(),_first:{borderTopEndRadius:i[e]},_last:{borderBottomEndRadius:i[e],mt:"-1px",borderTopWidth:1}}})}var qf,Yf,Zf,Xf,$f,Kf,Qf,Jf,eh,th,nh,rh,oh,ih,ah,sh,lh,uh=If({baseStyle:Rf((function(e){var t;return{root:Hf,field:null!==(t=_c(Vf,e))&&void 0!==t?t:{},stepperGroup:Wf,stepper:Uf}})),sizes:{xs:Gf("xs"),sm:Gf("sm"),md:Gf("md"),lg:Gf("lg")},variants:sf.variants,defaultProps:sf.defaultProps}),ch={baseStyle:un(un({},null==(qf=sf.baseStyle)?void 0:qf.field),{},{textAlign:"center"}),sizes:{lg:{fontSize:"lg",w:12,h:12,borderRadius:"md"},md:{fontSize:"md",w:10,h:10,borderRadius:"md"},sm:{fontSize:"sm",w:8,h:8,borderRadius:"sm"},xs:{fontSize:"xs",w:6,h:6,borderRadius:"sm"}},variants:{outline:function(e){var t,n,r;return null!==(t=null==(r=_c(null==(n=sf.variants)?void 0:n.outline,e))?void 0:r.field)&&void 0!==t?t:{}},flushed:function(e){var t,n,r;return null!==(t=null==(r=_c(null==(n=sf.variants)?void 0:n.flushed,e))?void 0:r.field)&&void 0!==t?t:{}},filled:function(e){var t,n,r;return null!==(t=null==(r=_c(null==(n=sf.variants)?void 0:n.filled,e))?void 0:r.field)&&void 0!==t?t:{}},unstyled:null!==(Nn=null==(Yf=sf.variants)?void 0:Yf.unstyled.field)&&void 0!==Nn?Nn:{}},defaultProps:sf.defaultProps},dh=aa(iu.keys),fh=dh.defineMultiStyleConfig,hh=dh.definePartsStyle,ph=ic("popper-bg"),vh=ic("popper-arrow-bg"),gh=ic("popper-arrow-shadow-color"),mh=fh({baseStyle:hh({popper:{zIndex:10},content:(gn(zn={},ph.variable,"colors.white"),gn(zn,"bg",ph.reference),gn(zn,vh.variable,ph.reference),gn(zn,gh.variable,"colors.gray.200"),gn(zn,"_dark",(gn(Dn={},ph.variable,"colors.gray.700"),gn(Dn,gh.variable,"colors.whiteAlpha.300"),Dn)),gn(zn,"width","xs"),gn(zn,"border","1px solid"),gn(zn,"borderColor","inherit"),gn(zn,"borderRadius","md"),gn(zn,"boxShadow","sm"),gn(zn,"zIndex","inherit"),gn(zn,"_focusVisible",{outline:0,boxShadow:"outline"}),zn),header:{px:3,py:2,borderBottomWidth:"1px"},body:{px:3,py:2},footer:{px:3,py:2,borderTopWidth:"1px"},closeButton:{position:"absolute",borderRadius:"md",top:1,insetEnd:2,padding:2}})}),yh=aa(au.keys),bh=yh.defineMultiStyleConfig,wh=yh.definePartsStyle,kh=function(e){var t=e.colorScheme,n=e.theme,r=e.isIndeterminate,o=e.hasStripe,i=qu(Uu(),Uu("1rem","rgba(0,0,0,0.1)"))(e),a=qu("".concat(t,".500"),"".concat(t,".200"))(e),s="linear-gradient(\n to right,\n transparent 0%,\n ".concat(Hu(n,a)," 50%,\n transparent 100%\n )");return un(un({},!r&&o&&i),r?{bgImage:s}:{bgColor:a})},xh={lineHeight:"1",fontSize:"0.25em",fontWeight:"bold",color:"white"},Sh=function(e){return{bg:qu("gray.100","whiteAlpha.300")(e)}},Ch=function(e){return un({transitionProperty:"common",transitionDuration:"slow"},kh(e))},_h=wh((function(e){return{label:xh,filledTrack:Ch(e),track:Sh(e)}})),Eh=bh({sizes:{xs:wh({track:{h:"1"}}),sm:wh({track:{h:"2"}}),md:wh({track:{h:"3"}}),lg:wh({track:{h:"4"}})},baseStyle:_h,defaultProps:{size:"md",colorScheme:"blue"}}),Ph=aa(su.keys),Lh=Ph.defineMultiStyleConfig,Oh=Ph.definePartsStyle,Ah=function(e){var t,n=null==(t=_c(pd.baseStyle,e))?void 0:t.control;return un(un({},n),{},{borderRadius:"full",_checked:un(un({},null==n?void 0:n._checked),{},{_before:{content:'""',display:"inline-block",pos:"relative",w:"50%",h:"50%",borderRadius:"50%",bg:"currentColor"}})})},Mh=Lh({baseStyle:Oh((function(e){var t,n,r,o;return{label:null==(n=(t=pd).baseStyle)?void 0:n.call(t,e).label,container:null==(o=(r=pd).baseStyle)?void 0:o.call(r,e).container,control:Ah(e)}})),sizes:{md:Oh({control:{w:"4",h:"4"},label:{fontSize:"md"}}),lg:Oh({control:{w:"5",h:"5"},label:{fontSize:"lg"}}),sm:Oh({control:{width:"3",height:"3"},label:{fontSize:"sm"}})},defaultProps:{size:"md",colorScheme:"blue"}}),Th=aa(lu.keys),Ih=Th.defineMultiStyleConfig,Rh=Th.definePartsStyle,Nh=ki("select-bg"),Dh={paddingInlineEnd:"8"},zh=Ih({baseStyle:Rh({field:un(un({},null==(Zf=sf.baseStyle)?void 0:Zf.field),{},(gn(jn={appearance:"none",paddingBottom:"1px",lineHeight:"normal",bg:Nh.reference},Nh.variable,"colors.white"),gn(jn,"_dark",gn({},Nh.variable,"colors.gray.700")),gn(jn,"> option, > optgroup",{bg:Nh.reference}),jn)),icon:{width:"6",height:"100%",insetEnd:"2",position:"relative",color:"currentColor",fontSize:"xl",_disabled:{opacity:.5}}}),sizes:{lg:un(un({},null==(Xf=sf.sizes)?void 0:Xf.lg),{},{field:un(un({},null==($f=sf.sizes)?void 0:$f.lg.field),Dh)}),md:un(un({},null==(Kf=sf.sizes)?void 0:Kf.md),{},{field:un(un({},null==(Qf=sf.sizes)?void 0:Qf.md.field),Dh)}),sm:un(un({},null==(Jf=sf.sizes)?void 0:Jf.sm),{},{field:un(un({},null==(eh=sf.sizes)?void 0:eh.sm.field),Dh)}),xs:un(un({},null==(th=sf.sizes)?void 0:th.xs),{},{field:un(un({},null==(nh=sf.sizes)?void 0:nh.xs.field),Dh),icon:{insetEnd:"1"}})},variants:sf.variants,defaultProps:sf.defaultProps}),jh=ki("skeleton-start-color"),Bh=ki("skeleton-end-color"),Fh={baseStyle:(gn(Fn={},jh.variable,"colors.gray.100"),gn(Fn,Bh.variable,"colors.gray.400"),gn(Fn,"_dark",(gn(Bn={},jh.variable,"colors.gray.800"),gn(Bn,Bh.variable,"colors.gray.600"),Bn)),gn(Fn,"background",jh.reference),gn(Fn,"borderColor",Bh.reference),gn(Fn,"opacity",.7),gn(Fn,"borderRadius","sm"),Fn)},Hh=ki("skip-link-bg"),Vh={baseStyle:{borderRadius:"md",fontWeight:"semibold",_focusVisible:(Hn={boxShadow:"outline",padding:"4",position:"fixed",top:"6",insetStart:"6"},gn(Hn,Hh.variable,"colors.white"),gn(Hn,"_dark",gn({},Hh.variable,"colors.gray.700")),gn(Hn,"bg",Hh.reference),Hn)}},Wh=aa(uu.keys),Uh=Wh.defineMultiStyleConfig,Gh=Wh.definePartsStyle,qh=ki("slider-thumb-size"),Yh=ki("slider-track-size"),Zh=ki("slider-bg"),Xh=function(e){return un({display:"inline-block",position:"relative",cursor:"pointer",_disabled:{opacity:.6,cursor:"default",pointerEvents:"none"}},Yu({orientation:e.orientation,vertical:{h:"100%"},horizontal:{w:"100%"}}))},$h=function(e){var t,n;return un(un({},Yu({orientation:e.orientation,horizontal:{h:Yh.reference},vertical:{w:Yh.reference}})),{},(gn(n={overflow:"hidden",borderRadius:"sm"},Zh.variable,"colors.gray.200"),gn(n,"_dark",gn({},Zh.variable,"colors.whiteAlpha.200")),gn(n,"_disabled",(gn(t={},Zh.variable,"colors.gray.300"),gn(t,"_dark",gn({},Zh.variable,"colors.whiteAlpha.300")),t)),gn(n,"bg",Zh.reference),n))},Kh=function(e){return un(un({},Yu({orientation:e.orientation,vertical:{left:"50%",transform:"translateX(-50%)",_active:{transform:"translateX(-50%) scale(1.15)"}},horizontal:{top:"50%",transform:"translateY(-50%)",_active:{transform:"translateY(-50%) scale(1.15)"}}})),{},{w:qh.reference,h:qh.reference,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",outline:0,zIndex:1,borderRadius:"full",bg:"white",boxShadow:"base",border:"1px solid",borderColor:"transparent",transitionProperty:"transform",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{bg:"gray.300"}})},Qh=function(e){var t,n=e.colorScheme;return gn(t={width:"inherit",height:"inherit"},Zh.variable,"colors.".concat(n,".500")),gn(t,"_dark",gn({},Zh.variable,"colors.".concat(n,".200"))),gn(t,"bg",Zh.reference),t},Jh=Uh({baseStyle:Gh((function(e){return{container:Xh(e),track:$h(e),thumb:Kh(e),filledTrack:Qh(e)}})),sizes:{lg:Gh({container:(Vn={},gn(Vn,qh.variable,"sizes.4"),gn(Vn,Yh.variable,"sizes.1"),Vn)}),md:Gh({container:(Wn={},gn(Wn,qh.variable,"sizes.3.5"),gn(Wn,Yh.variable,"sizes.1"),Wn)}),sm:Gh({container:(Un={},gn(Un,qh.variable,"sizes.2.5"),gn(Un,Yh.variable,"sizes.0.5"),Un)})},defaultProps:{size:"md",colorScheme:"blue"}}),ep=ic("spinner-size"),tp={baseStyle:{width:[ep.reference],height:[ep.reference]},sizes:{xs:gn({},ep.variable,"sizes.3"),sm:gn({},ep.variable,"sizes.4"),md:gn({},ep.variable,"sizes.6"),lg:gn({},ep.variable,"sizes.8"),xl:gn({},ep.variable,"sizes.12")},defaultProps:{size:"md"}},np=aa(cu.keys),rp=np.defineMultiStyleConfig,op=np.definePartsStyle,ip=rp({baseStyle:op({container:{},label:{fontWeight:"medium"},helpText:{opacity:.8,marginBottom:"2"},number:{verticalAlign:"baseline",fontWeight:"semibold"},icon:{marginEnd:1,w:"3.5",h:"3.5",verticalAlign:"middle"}}),sizes:{md:op({label:{fontSize:"sm"},helpText:{fontSize:"sm"},number:{fontSize:"2xl"}})},defaultProps:{size:"md"}}),ap=aa(du.keys),sp=ap.defineMultiStyleConfig,lp=ap.definePartsStyle,up=ic("switch-track-width"),cp=ic("switch-track-height"),dp=ic("switch-track-diff"),fp=tc.subtract(up,cp),hp=ic("switch-thumb-x"),pp=ic("switch-bg"),vp=function(e){var t,n,r=e.colorScheme;return gn(n={borderRadius:"full",p:"0.5",width:[up.reference],height:[cp.reference],transitionProperty:"common",transitionDuration:"fast"},pp.variable,"colors.gray.300"),gn(n,"_dark",gn({},pp.variable,"colors.whiteAlpha.400")),gn(n,"_focusVisible",{boxShadow:"outline"}),gn(n,"_disabled",{opacity:.4,cursor:"not-allowed"}),gn(n,"_checked",(gn(t={},pp.variable,"colors.".concat(r,".500")),gn(t,"_dark",gn({},pp.variable,"colors.".concat(r,".200"))),t)),gn(n,"bg",pp.reference),n},gp={bg:"white",transitionProperty:"transform",transitionDuration:"normal",borderRadius:"inherit",width:[cp.reference],height:[cp.reference],_checked:{transform:"translateX(".concat(hp.reference,")")}},mp=sp({baseStyle:lp((function(e){var t;return{container:(t={},gn(t,dp.variable,fp),gn(t,hp.variable,dp.reference),gn(t,"_rtl",gn({},hp.variable,tc(dp).negate().toString())),t),track:vp(e),thumb:gp}})),sizes:{sm:lp({container:(Gn={},gn(Gn,up.variable,"1.375rem"),gn(Gn,cp.variable,"sizes.3"),Gn)}),md:lp({container:(qn={},gn(qn,up.variable,"1.875rem"),gn(qn,cp.variable,"sizes.4"),qn)}),lg:lp({container:(Yn={},gn(Yn,up.variable,"2.875rem"),gn(Yn,cp.variable,"sizes.6"),Yn)})},defaultProps:{size:"md",colorScheme:"blue"}}),yp=aa(fu.keys),bp=yp.defineMultiStyleConfig,wp=yp.definePartsStyle,kp=wp({table:{fontVariantNumeric:"lining-nums tabular-nums",borderCollapse:"collapse",width:"full"},th:{fontFamily:"heading",fontWeight:"bold",textTransform:"uppercase",letterSpacing:"wider",textAlign:"start"},td:{textAlign:"start"},caption:{mt:4,fontFamily:"heading",textAlign:"center",fontWeight:"medium"}}),xp={"&[data-is-numeric=true]":{textAlign:"end"}},Sp=wp((function(e){var t=e.colorScheme;return{th:un({color:qu("gray.600","gray.400")(e),borderBottom:"1px",borderColor:qu("".concat(t,".100"),"".concat(t,".700"))(e)},xp),td:un({borderBottom:"1px",borderColor:qu("".concat(t,".100"),"".concat(t,".700"))(e)},xp),caption:{color:qu("gray.600","gray.100")(e)},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}})),Cp=wp((function(e){var t=e.colorScheme;return{th:un({color:qu("gray.600","gray.400")(e),borderBottom:"1px",borderColor:qu("".concat(t,".100"),"".concat(t,".700"))(e)},xp),td:un({borderBottom:"1px",borderColor:qu("".concat(t,".100"),"".concat(t,".700"))(e)},xp),caption:{color:qu("gray.600","gray.100")(e)},tbody:{tr:{"&:nth-of-type(odd)":{"th, td":{borderBottomWidth:"1px",borderColor:qu("".concat(t,".100"),"".concat(t,".700"))(e)},td:{background:qu("".concat(t,".100"),"".concat(t,".700"))(e)}}}},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}})),_p=bp({baseStyle:kp,variants:{simple:Sp,striped:Cp,unstyled:{}},sizes:{sm:wp({th:{px:"4",py:"1",lineHeight:"4",fontSize:"xs"},td:{px:"4",py:"2",fontSize:"sm",lineHeight:"4"},caption:{px:"4",py:"2",fontSize:"xs"}}),md:wp({th:{px:"6",py:"3",lineHeight:"4",fontSize:"xs"},td:{px:"6",py:"4",lineHeight:"5"},caption:{px:"6",py:"2",fontSize:"sm"}}),lg:wp({th:{px:"8",py:"4",lineHeight:"5",fontSize:"sm"},td:{px:"8",py:"5",lineHeight:"6"},caption:{px:"6",py:"2",fontSize:"md"}})},defaultProps:{variant:"simple",size:"md",colorScheme:"gray"}}),Ep=ki("tabs-color"),Pp=ki("tabs-bg"),Lp=ki("tabs-border-color"),Op=aa(hu.keys),Ap=Op.defineMultiStyleConfig,Mp=Op.definePartsStyle,Tp=function(e){return{display:"vertical"===e.orientation?"flex":"block"}},Ip=function(e){return{flex:e.isFitted?1:void 0,transitionProperty:"common",transitionDuration:"normal",_focusVisible:{zIndex:1,boxShadow:"outline"},_disabled:{cursor:"not-allowed",opacity:.4}}},Rp=function(e){var t=e.align,n=void 0===t?"start":t,r=e.orientation;return{justifyContent:{end:"flex-end",center:"center",start:"flex-start"}[n],flexDirection:"vertical"===r?"column":"row"}},Np={p:4},Dp=Mp((function(e){return{root:Tp(e),tab:Ip(e),tablist:Rp(e),tabpanel:Np}})),zp={sm:Mp({tab:{py:1,px:4,fontSize:"sm"}}),md:Mp({tab:{fontSize:"md",py:2,px:4}}),lg:Mp({tab:{fontSize:"lg",py:3,px:4}})},jp=Mp((function(e){var t,n,r,o,i=e.colorScheme,a=e.orientation,s="vertical"===a?"borderStart":"borderBottom",l="vertical"===a?"marginStart":"marginBottom";return{tablist:(t={},gn(t,s,"2px solid"),gn(t,"borderColor","inherit"),t),tab:(o={},gn(o,s,"2px solid"),gn(o,"borderColor","transparent"),gn(o,l,"-2px"),gn(o,"_selected",(n={},gn(n,Ep.variable,"colors.".concat(i,".600")),gn(n,"_dark",gn({},Ep.variable,"colors.".concat(i,".300"))),gn(n,"borderColor","currentColor"),n)),gn(o,"_active",(r={},gn(r,Pp.variable,"colors.gray.200"),gn(r,"_dark",gn({},Pp.variable,"colors.whiteAlpha.300")),r)),gn(o,"_disabled",{_active:{bg:"none"}}),gn(o,"color",Ep.reference),gn(o,"bg",Pp.reference),o)}})),Bp=Mp((function(e){var t,n,r,o=e.colorScheme;return{tab:(r={borderTopRadius:"md",border:"1px solid",borderColor:"transparent",mb:"-1px"},gn(r,Lp.reference,"transparent"),gn(r,"_selected",(n={},gn(n,Ep.variable,"colors.".concat(o,".600")),gn(n,Lp.variable,"colors.white"),gn(n,"_dark",(t={},gn(t,Ep.variable,"colors.".concat(o,".300")),gn(t,Lp.variable,"colors.gray.800"),t)),gn(n,"borderColor","inherit"),gn(n,"borderBottomColor",Lp.reference),n)),gn(r,"color",Ep.reference),r),tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}})),Fp=Mp((function(e){var t,n,r,o=e.colorScheme;return{tab:(r={border:"1px solid",borderColor:"inherit"},gn(r,Pp.variable,"colors.gray.50"),gn(r,"_dark",gn({},Pp.variable,"colors.whiteAlpha.50")),gn(r,"mb","-1px"),gn(r,"_notLast",{marginEnd:"-1px"}),gn(r,"_selected",(n={},gn(n,Pp.variable,"colors.white"),gn(n,Ep.variable,"colors.".concat(o,".600")),gn(n,"_dark",(t={},gn(t,Pp.variable,"colors.gray.800"),gn(t,Ep.variable,"colors.".concat(o,".300")),t)),gn(n,"borderColor","inherit"),gn(n,"borderTopColor","currentColor"),gn(n,"borderBottomColor","transparent"),n)),gn(r,"color",Ep.reference),gn(r,"bg",Pp.reference),r),tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}})),Hp=Mp((function(e){var t=e.colorScheme,n=e.theme;return{tab:{borderRadius:"full",fontWeight:"semibold",color:"gray.600",_selected:{color:Hu(n,"".concat(t,".700")),bg:Hu(n,"".concat(t,".100"))}}}})),Vp=Mp((function(e){var t,n,r,o=e.colorScheme;return{tab:(r={borderRadius:"full",fontWeight:"semibold"},gn(r,Ep.variable,"colors.gray.600"),gn(r,"_dark",gn({},Ep.variable,"inherit")),gn(r,"_selected",(n={},gn(n,Ep.variable,"colors.white"),gn(n,Pp.variable,"colors.".concat(o,".600")),gn(n,"_dark",(t={},gn(t,Ep.variable,"colors.gray.800"),gn(t,Pp.variable,"colors.".concat(o,".300")),t)),n)),gn(r,"color",Ep.reference),gn(r,"bg",Pp.reference),r)}})),Wp=Ap({baseStyle:Dp,sizes:zp,variants:{line:jp,enclosed:Bp,"enclosed-colored":Fp,"soft-rounded":Hp,"solid-rounded":Vp,unstyled:Mp({})},defaultProps:{size:"md",variant:"line",colorScheme:"blue"}}),Up=aa(pu.keys),Gp=Up.defineMultiStyleConfig,qp=Up.definePartsStyle,Yp=qp({container:{fontWeight:"medium",lineHeight:1.2,outline:0,borderRadius:"md",_focusVisible:{boxShadow:"outline"}},label:{lineHeight:1.2,overflow:"visible"},closeButton:{fontSize:"lg",w:"5",h:"5",transitionProperty:"common",transitionDuration:"normal",borderRadius:"full",marginStart:"1.5",marginEnd:"-1",opacity:.5,_disabled:{opacity:.4},_focusVisible:{boxShadow:"outline",bg:"rgba(0, 0, 0, 0.14)"},_hover:{opacity:.8},_active:{opacity:1}}}),Zp={sm:qp({container:{minH:"5",minW:"5",fontSize:"xs",px:"2"},closeButton:{marginEnd:"-2px",marginStart:"0.35rem"}}),md:qp({container:{minH:"6",minW:"6",fontSize:"sm",px:"2"}}),lg:qp({container:{minH:"8",minW:"8",fontSize:"md",px:"3"}})},Xp=Gp({variants:{subtle:qp((function(e){var t;return{container:null==(t=Wc.variants)?void 0:t.subtle(e)}})),solid:qp((function(e){var t;return{container:null==(t=Wc.variants)?void 0:t.solid(e)}})),outline:qp((function(e){var t;return{container:null==(t=Wc.variants)?void 0:t.outline(e)}}))},baseStyle:Yp,sizes:Zp,defaultProps:{size:"md",variant:"subtle",colorScheme:"gray"}}),$p=un(un({},null==(rh=sf.baseStyle)?void 0:rh.field),{},{paddingY:"2",minHeight:"20",lineHeight:"short",verticalAlign:"top"}),Kp={outline:function(e){var t,n;return null!==(t=null==(n=sf.variants)?void 0:n.outline(e).field)&&void 0!==t?t:{}},flushed:function(e){var t,n;return null!==(t=null==(n=sf.variants)?void 0:n.flushed(e).field)&&void 0!==t?t:{}},filled:function(e){var t,n;return null!==(t=null==(n=sf.variants)?void 0:n.filled(e).field)&&void 0!==t?t:{}},unstyled:null!==(Zn=null==(oh=sf.variants)?void 0:oh.unstyled.field)&&void 0!==Zn?Zn:{}},Qp={baseStyle:$p,sizes:{xs:null!==(Xn=null==(ih=sf.sizes)?void 0:ih.xs.field)&&void 0!==Xn?Xn:{},sm:null!==($n=null==(ah=sf.sizes)?void 0:ah.sm.field)&&void 0!==$n?$n:{},md:null!==(Kn=null==(sh=sf.sizes)?void 0:sh.md.field)&&void 0!==Kn?Kn:{},lg:null!==(Qn=null==(lh=sf.sizes)?void 0:lh.lg.field)&&void 0!==Qn?Qn:{}},variants:Kp,defaultProps:{size:"md",variant:"outline"}},Jp=ic("tooltip-bg"),ev=ic("tooltip-fg"),tv=ic("popper-arrow-bg"),nv=(gn(er={bg:Jp.reference,color:ev.reference},Jp.variable,"colors.gray.700"),gn(er,ev.variable,"colors.whiteAlpha.900"),gn(er,"_dark",(gn(Jn={},Jp.variable,"colors.gray.300"),gn(Jn,ev.variable,"colors.gray.900"),Jn)),gn(er,tv.variable,Jp.reference),gn(er,"px","2"),gn(er,"py","0.5"),gn(er,"borderRadius","sm"),gn(er,"fontWeight","medium"),gn(er,"fontSize","sm"),gn(er,"boxShadow","md"),gn(er,"maxW","xs"),gn(er,"zIndex","tooltip"),er),rv={Accordion:uc,Alert:kc,Avatar:Dc,Badge:Wc,Breadcrumb:Gc,Button:Kc,Checkbox:pd,CloseButton:md,Code:yd,Container:bd,Divider:wd,Drawer:Rd,Editable:zd,Form:Vd,FormError:Yd,FormLabel:Zd,Heading:Xd,Input:sf,Kbd:uf,Link:cf,List:ff,Menu:yf,Modal:Af,NumberInput:uh,PinInput:ch,Popover:mh,Progress:Eh,Radio:Mh,Select:zh,Skeleton:Fh,SkipLink:Vh,Slider:Jh,Spinner:tp,Stat:ip,Switch:mp,Table:_p,Tabs:Wp,Tag:Xp,Textarea:Qp,Tooltip:{baseStyle:nv},Card:id},ov={none:0,"1px":"1px solid","2px":"2px solid","4px":"4px solid","8px":"8px solid"},iv={xs:"0 0 0 1px rgba(0, 0, 0, 0.05)",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",base:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",outline:"0 0 0 3px rgba(66, 153, 225, 0.6)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.06)",none:"none","dark-lg":"rgba(0, 0, 0, 0.1) 0px 0px 0px 1px, rgba(0, 0, 0, 0.2) 0px 5px 10px, rgba(0, 0, 0, 0.4) 0px 15px 40px"},av={property:{common:"background-color, border-color, color, fill, stroke, opacity, box-shadow, transform",colors:"background-color, border-color, color, fill, stroke",dimensions:"width, height",position:"left, right, top, bottom",background:"background-color, background-image, background-position"},easing:{"ease-in":"cubic-bezier(0.4, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.2, 1)","ease-in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},duration:{"ultra-fast":"50ms",faster:"100ms",fast:"150ms",normal:"200ms",slow:"300ms",slower:"400ms","ultra-slow":"500ms"}},sv=un(un({breakpoints:{base:"0em",sm:"30em",md:"48em",lg:"62em",xl:"80em","2xl":"96em"},zIndices:{hide:-1,auto:"auto",base:0,docked:10,dropdown:1e3,sticky:1100,banner:1200,overlay:1300,modal:1400,popover:1500,skipLink:1600,toast:1700,tooltip:1800},radii:{none:"0",sm:"0.125rem",base:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},blur:{none:0,sm:"4px",base:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},colors:{transparent:"transparent",current:"currentColor",black:"#000000",white:"#FFFFFF",whiteAlpha:{50:"rgba(255, 255, 255, 0.04)",100:"rgba(255, 255, 255, 0.06)",200:"rgba(255, 255, 255, 0.08)",300:"rgba(255, 255, 255, 0.16)",400:"rgba(255, 255, 255, 0.24)",500:"rgba(255, 255, 255, 0.36)",600:"rgba(255, 255, 255, 0.48)",700:"rgba(255, 255, 255, 0.64)",800:"rgba(255, 255, 255, 0.80)",900:"rgba(255, 255, 255, 0.92)"},blackAlpha:{50:"rgba(0, 0, 0, 0.04)",100:"rgba(0, 0, 0, 0.06)",200:"rgba(0, 0, 0, 0.08)",300:"rgba(0, 0, 0, 0.16)",400:"rgba(0, 0, 0, 0.24)",500:"rgba(0, 0, 0, 0.36)",600:"rgba(0, 0, 0, 0.48)",700:"rgba(0, 0, 0, 0.64)",800:"rgba(0, 0, 0, 0.80)",900:"rgba(0, 0, 0, 0.92)"},gray:{50:"#F7FAFC",100:"#EDF2F7",200:"#E2E8F0",300:"#CBD5E0",400:"#A0AEC0",500:"#718096",600:"#4A5568",700:"#2D3748",800:"#1A202C",900:"#171923"},red:{50:"#FFF5F5",100:"#FED7D7",200:"#FEB2B2",300:"#FC8181",400:"#F56565",500:"#E53E3E",600:"#C53030",700:"#9B2C2C",800:"#822727",900:"#63171B"},orange:{50:"#FFFAF0",100:"#FEEBC8",200:"#FBD38D",300:"#F6AD55",400:"#ED8936",500:"#DD6B20",600:"#C05621",700:"#9C4221",800:"#7B341E",900:"#652B19"},yellow:{50:"#FFFFF0",100:"#FEFCBF",200:"#FAF089",300:"#F6E05E",400:"#ECC94B",500:"#D69E2E",600:"#B7791F",700:"#975A16",800:"#744210",900:"#5F370E"},green:{50:"#F0FFF4",100:"#C6F6D5",200:"#9AE6B4",300:"#68D391",400:"#48BB78",500:"#38A169",600:"#2F855A",700:"#276749",800:"#22543D",900:"#1C4532"},teal:{50:"#E6FFFA",100:"#B2F5EA",200:"#81E6D9",300:"#4FD1C5",400:"#38B2AC",500:"#319795",600:"#2C7A7B",700:"#285E61",800:"#234E52",900:"#1D4044"},blue:{50:"#ebf8ff",100:"#bee3f8",200:"#90cdf4",300:"#63b3ed",400:"#4299e1",500:"#3182ce",600:"#2b6cb0",700:"#2c5282",800:"#2a4365",900:"#1A365D"},cyan:{50:"#EDFDFD",100:"#C4F1F9",200:"#9DECF9",300:"#76E4F7",400:"#0BC5EA",500:"#00B5D8",600:"#00A3C4",700:"#0987A0",800:"#086F83",900:"#065666"},purple:{50:"#FAF5FF",100:"#E9D8FD",200:"#D6BCFA",300:"#B794F4",400:"#9F7AEA",500:"#805AD5",600:"#6B46C1",700:"#553C9A",800:"#44337A",900:"#322659"},pink:{50:"#FFF5F7",100:"#FED7E2",200:"#FBB6CE",300:"#F687B3",400:"#ED64A6",500:"#D53F8C",600:"#B83280",700:"#97266D",800:"#702459",900:"#521B41"},linkedin:{50:"#E8F4F9",100:"#CFEDFB",200:"#9BDAF3",300:"#68C7EC",400:"#34B3E4",500:"#00A0DC",600:"#008CC9",700:"#0077B5",800:"#005E93",900:"#004471"},facebook:{50:"#E8F4F9",100:"#D9DEE9",200:"#B7C2DA",300:"#6482C0",400:"#4267B2",500:"#385898",600:"#314E89",700:"#29487D",800:"#223B67",900:"#1E355B"},messenger:{50:"#D0E6FF",100:"#B9DAFF",200:"#A2CDFF",300:"#7AB8FF",400:"#2E90FF",500:"#0078FF",600:"#0063D1",700:"#0052AC",800:"#003C7E",900:"#002C5C"},whatsapp:{50:"#dffeec",100:"#b9f5d0",200:"#90edb3",300:"#65e495",400:"#3cdd78",500:"#22c35e",600:"#179848",700:"#0c6c33",800:"#01421c",900:"#001803"},twitter:{50:"#E5F4FD",100:"#C8E9FB",200:"#A8DCFA",300:"#83CDF7",400:"#57BBF5",500:"#1DA1F2",600:"#1A94DA",700:"#1681BF",800:"#136B9E",900:"#0D4D71"},telegram:{50:"#E3F2F9",100:"#C5E4F3",200:"#A2D4EC",300:"#7AC1E4",400:"#47A9DA",500:"#0088CC",600:"#007AB8",700:"#006BA1",800:"#005885",900:"#003F5E"}}},Mf),{},{sizes:Sc,shadows:iv,space:xc,borders:ov,transition:av}),lv=un(un({semanticTokens:{colors:{"chakra-body-text":{_light:"gray.800",_dark:"whiteAlpha.900"},"chakra-body-bg":{_light:"white",_dark:"gray.800"},"chakra-border-color":{_light:"gray.200",_dark:"whiteAlpha.300"},"chakra-subtle-bg":{_light:"gray.100",_dark:"gray.700"},"chakra-placeholder-color":{_light:"gray.500",_dark:"whiteAlpha.400"}}},direction:"ltr"},sv),{},{components:rv,styles:{global:{body:{fontFamily:"body",color:"chakra-body-text",bg:"chakra-body-bg",transitionProperty:"background-color",transitionDuration:"normal",lineHeight:"base"},"*::placeholder":{color:"chakra-placeholder-color"},"*, *::before, &::after":{borderColor:"chakra-border-color",wordWrap:"break-word"}}},config:{useSystemColorMode:!1,initialColorMode:"light",cssVarPrefix:"chakra"}}),uv="undefined"!=typeof Element,cv="function"==typeof Map,dv="function"==typeof Set,fv="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;function hv(e,t){if(e===t)return!0;if(e&&t&&"object"==kn(e)&&"object"==kn(t)){if(e.constructor!==t.constructor)return!1;var n,r,o,i;if(Array.isArray(e)){if((n=e.length)!=t.length)return!1;for(r=n;0!=r--;)if(!hv(e[r],t[r]))return!1;return!0}if(cv&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(i=e.entries();!(r=i.next()).done;)if(!t.has(r.value[0]))return!1;for(i=e.entries();!(r=i.next()).done;)if(!hv(r.value[1],t.get(r.value[0])))return!1;return!0}if(dv&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(i=e.entries();!(r=i.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(fv&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if((n=e.length)!=t.length)return!1;for(r=n;0!=r--;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if((n=(o=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;if(uv&&e instanceof Element)return!1;for(r=n;0!=r--;)if(("_owner"!==o[r]&&"__v"!==o[r]&&"__o"!==o[r]||!e.$$typeof)&&!hv(e[o[r]],t[o[r]]))return!1;return!0}return e!=e&&t!=t}var pv=function(e,t){try{return hv(e,t)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}};function vv(){var e=cr.useContext(sl);if(!e)throw Error("useTheme: `theme` is undefined. Seems you forgot to wrap your app in `` or ``");return e}function gv(){var e=ao(),t=vv();return un(un({},e),{},{theme:t})}function mv(e){var t=e.cssVarsRoot,n=e.theme,r=e.children,o=cr.useMemo((function(){return Xi(n)}),[n]);return qr.createElement(ul,{theme:o},qr.createElement(yv,{root:t}),r)}function yv(e){var t=e.root,n=[void 0===t?":host, :root":t,"[data-theme]"].join(",");return qr.createElement(cl,{styles:function(e){return gn({},n,e.__cssVars)}})}function bv(){var e=ao().colorMode;return qr.createElement(cl,{styles:function(t){var n=Nl(Al(t,"styles.global"),{theme:t,colorMode:e});if(n){var r=ia(n)(t);return r}}})}!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.strict,n=void 0===t||t,r=e.errorMessage,o=void 0===r?"useContext: `context` is undefined. Seems you forgot to wrap component within the Provider":r,i=e.name,a=cr.createContext(void 0);function s(){var e,t=cr.useContext(a);if(!t&&n){var r=new Error(o);throw r.name="ContextError",null==Error.captureStackTrace||e.call(Error,r,s),r}return t}a.displayName=i,a.Provider}({name:"StylesContext",errorMessage:"useStyles: `styles` is undefined. Seems you forgot to wrap the components in `` "});var wv=new Set([].concat(cn(Ji),["textStyle","layerStyle","apply","noOfLines","focusBorderColor","errorBorderColor","as","__css","css","sx"])),kv=new Set(["htmlWidth","htmlHeight","htmlSize"]);function xv(e){return kv.has(e)||!wv.has(e)}function Sv(e,r){var o=null!=r?r:{},i=o.baseStyle,a=sn(o,n);a.shouldForwardProp||(a.shouldForwardProp=xv);var s=function(e){var n=e.baseStyle;return function(e){e.theme;var r=e.css,o=e.__css,i=e.sx,a=Ml(sn(e,t),(function(e,t){return ta(t)})),s=Nl(n,e),l=Object.assign({},o,s,Tl(a),i),u=ia(l)(e.theme);return r?[u,r]:u}}({baseStyle:i}),l=Wl(e,a)(s);return qr.forwardRef((function(e,t){var n=ao(),r=n.colorMode,o=n.forced;return qr.createElement(l,un({ref:t,"data-theme":o?r:void 0},e))}))}function Cv(e){return cr.forwardRef(e)}function _v(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=n.styleConfig,i=sn(n,r),a=gv(),s=a.theme,l=a.colorMode,u=e?Al(s,"components.".concat(e)):void 0,c=o||u,d=mo({theme:s,colorMode:l},null!==(t=null==c?void 0:c.defaultProps)&&void 0!==t?t:{},Tl(Ol(i,["children"]))),f=cr.useRef({});if(c){var h=la(c),p=h(d),v=pv(f.current,p);v||(f.current=p)}return f.current}function Ev(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return _v(e,t)}function Pv(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return _v(e,t)}var Lv=function(){var e=new Map;return new Proxy(Sv,{apply:function(e,t,n){return Sv.apply(void 0,cn(n))},get:function(t,n){return e.has(n)||e.set(n,Sv(n)),e.get(n)}})}();function Ov(e,t){return"".concat(e," returned `undefined`. Seems you forgot to wrap component within ").concat(t)}function Av(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.name,n=e.strict,r=void 0===n||n,o=e.hookName,i=void 0===o?"useContext":o,a=e.providerName,s=void 0===a?"Provider":a,l=e.errorMessage,u=cr.createContext(void 0);function c(){var e,t=cr.useContext(u);if(!t&&r){var n=new Error(null!=l?l:Ov(i,s));throw n.name="ContextError",null==(e=Error.captureStackTrace)||e.call(Error,n,c),n}return t}return u.displayName=t,[u.Provider,c,u]}function Mv(e,t){if(null!=e)if("function"!=typeof e)try{e.current=t}catch(n){throw new Error("Cannot assign value '".concat(t,"' to ref '").concat(e,"'"))}else e(t)}function Tv(){for(var e=arguments.length,t=new Array(e),n=0;n=t&&(r=0),r}function Dv(e,t,n){var r=e-1;return n&&r<0&&(r=t),r}var zv="undefined"!=typeof window?cr.useLayoutEffect:cr.useEffect,jv=on((function e(){var t=this;an(this,e),gn(this,"descendants",new Map),gn(this,"register",(function(e){if(null!=e)return function(e){return"object"==kn(e)&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}(e)?t.registerNode(e):function(n){t.registerNode(n,e)}})),gn(this,"unregister",(function(e){t.descendants.delete(e);var n=Rv(Array.from(t.descendants.keys()));t.assignIndex(n)})),gn(this,"destroy",(function(){t.descendants.clear()})),gn(this,"assignIndex",(function(e){t.descendants.forEach((function(t){var n=e.indexOf(t.node);t.index=n,t.node.dataset.index=t.index.toString()}))})),gn(this,"count",(function(){return t.descendants.size})),gn(this,"enabledCount",(function(){return t.enabledValues().length})),gn(this,"values",(function(){return Array.from(t.descendants.values()).sort((function(e,t){return e.index-t.index}))})),gn(this,"enabledValues",(function(){return t.values().filter((function(e){return!e.disabled}))})),gn(this,"item",(function(e){if(0!==t.count())return t.values()[e]})),gn(this,"enabledItem",(function(e){if(0!==t.enabledCount())return t.enabledValues()[e]})),gn(this,"first",(function(){return t.item(0)})),gn(this,"firstEnabled",(function(){return t.enabledItem(0)})),gn(this,"last",(function(){return t.item(t.descendants.size-1)})),gn(this,"lastEnabled",(function(){var e=t.enabledValues().length-1;return t.enabledItem(e)})),gn(this,"indexOf",(function(e){var n,r;return e&&null!==(n=null==(r=t.descendants.get(e))?void 0:r.index)&&void 0!==n?n:-1})),gn(this,"enabledIndexOf",(function(e){return null==e?-1:t.enabledValues().findIndex((function(t){return t.node.isSameNode(e)}))})),gn(this,"next",(function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=Nv(e,t.count(),n);return t.item(r)})),gn(this,"nextEnabled",(function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=t.item(e);if(r){var o=t.enabledIndexOf(r.node),i=Nv(o,t.enabledCount(),n);return t.enabledItem(i)}})),gn(this,"prev",(function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=Dv(e,t.count()-1,n);return t.item(r)})),gn(this,"prevEnabled",(function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=t.item(e);if(r){var o=t.enabledIndexOf(r.node),i=Dv(o,t.enabledCount()-1,n);return t.enabledItem(i)}})),gn(this,"registerNode",(function(e,n){if(e&&!t.descendants.has(e)){var r=Rv(Array.from(t.descendants.keys()).concat(e));(null==n?void 0:n.disabled)&&(n.disabled=!!n.disabled);var o=un({node:e,index:-1},n);t.descendants.set(e,o),t.assignIndex(r)}}))}));var Bv=yn(Av({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"}),2),Fv=Bv[0],Hv=Bv[1];function Vv(){return[Fv,function(){return Hv()},function(){return e=cr.useRef(new jv),zv((function(){return function(){return e.current.destroy()}})),e.current;var e},function(e){return function(e){var t=Hv(),n=yn(cr.useState(-1),2),r=n[0],o=n[1],i=cr.useRef(null);zv((function(){return function(){i.current&&t.unregister(i.current)}}),[]),zv((function(){if(i.current){var e=Number(i.current.dataset.index);r==e||Number.isNaN(e)||o(e)}}));var a=e?t.register(e):t.register;return{descendants:t,index:r,enabledIndex:t.enabledIndexOf(i.current),register:Tv(a,i)}}(e)}]}var Wv=function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:[],n=cr.useRef(e);return cr.useEffect((function(){n.current=e})),cr.useCallback((function(){for(var e,t,r=arguments.length,o=new Array(r),i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return bg(e(t,n))}if("undefined"==typeof Proxy)return t;var n=new Map;return new Proxy(t,{get:function(e,r){return n.has(r)||n.set(r,t(r)),n.get(r)}})}var kg=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];function xg(e){return"string"==typeof e&&!e.includes("-")&&!!(kg.indexOf(e)>-1||/[A-Z]/.test(e))}var Sg={};var Cg=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],_g=new Set(Cg);function Eg(e,t){var n=t.layout,r=t.layoutId;return _g.has(e)||e.startsWith("origin")||(n||void 0!==r)&&(!!Sg[e]||"opacity"===e)}var Pg=function(e){return!!(null==e?void 0:e.getVelocity)},Lg={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Og=function(e,t){return Cg.indexOf(e)-Cg.indexOf(t)};function Ag(e){return e.startsWith("--")}var Mg=function(e,t){return t&&"number"==typeof e?t.transform(e):e},Tg=function(e,t){return function(n){return Math.max(Math.min(n,t),e)}},Ig=function(e){return e%1?Number(e.toFixed(5)):e},Rg=/(-)?([\d]*\.?[\d])+/g,Ng=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,Dg=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function zg(e){return"string"==typeof e}var jg={test:function(e){return"number"==typeof e},parse:parseFloat,transform:function(e){return e}},Bg=Object.assign(Object.assign({},jg),{transform:Tg(0,1)}),Fg=Object.assign(Object.assign({},jg),{default:1}),Hg=function(e){return{test:function(t){return zg(t)&&t.endsWith(e)&&1===t.split(" ").length},parse:parseFloat,transform:function(t){return"".concat(t).concat(e)}}},Vg=Hg("deg"),Wg=Hg("%"),Ug=Hg("px"),Gg=Hg("vh"),qg=Hg("vw"),Yg=Object.assign(Object.assign({},Wg),{parse:function(e){return Wg.parse(e)/100},transform:function(e){return Wg.transform(100*e)}}),Zg=function(e,t){return function(n){return Boolean(zg(n)&&Dg.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t))}},Xg=function(e,t,n){return function(r){var o;if(!zg(r))return r;var i=yn(r.match(Rg),4),a=i[0],s=i[1],l=i[2],u=i[3];return gn(o={},e,parseFloat(a)),gn(o,t,parseFloat(s)),gn(o,n,parseFloat(l)),gn(o,"alpha",void 0!==u?parseFloat(u):1),o}},$g={test:Zg("hsl","hue"),parse:Xg("hue","saturation","lightness"),transform:function(e){var t=e.hue,n=e.saturation,r=e.lightness,o=e.alpha,i=void 0===o?1:o;return"hsla("+Math.round(t)+", "+Wg.transform(Ig(n))+", "+Wg.transform(Ig(r))+", "+Ig(Bg.transform(i))+")"}},Kg=Tg(0,255),Qg=Object.assign(Object.assign({},jg),{transform:function(e){return Math.round(Kg(e))}}),Jg={test:Zg("rgb","red"),parse:Xg("red","green","blue"),transform:function(e){var t=e.red,n=e.green,r=e.blue,o=e.alpha,i=void 0===o?1:o;return"rgba("+Qg.transform(t)+", "+Qg.transform(n)+", "+Qg.transform(r)+", "+Ig(Bg.transform(i))+")"}};var em={test:Zg("#"),parse:function(e){var t="",n="",r="",o="";return e.length>5?(t=e.substr(1,2),n=e.substr(3,2),r=e.substr(5,2),o=e.substr(7,2)):(t=e.substr(1,1),n=e.substr(2,1),r=e.substr(3,1),o=e.substr(4,1),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}},transform:Jg.transform},tm={test:function(e){return Jg.test(e)||em.test(e)||$g.test(e)},parse:function(e){return Jg.test(e)?Jg.parse(e):$g.test(e)?$g.parse(e):em.parse(e)},transform:function(e){return zg(e)?e:e.hasOwnProperty("red")?Jg.transform(e):$g.transform(e)}},nm="${c}",rm="${n}";function om(e){"number"==typeof e&&(e="".concat(e));var t=[],n=0,r=e.match(Ng);r&&(n=r.length,e=e.replace(Ng,nm),t.push.apply(t,cn(r.map(tm.parse))));var o=e.match(Rg);return o&&(e=e.replace(Rg,rm),t.push.apply(t,cn(o.map(jg.parse)))),{values:t,numColors:n,tokenised:e}}function im(e){return om(e).values}function am(e){var t=om(e),n=t.values,r=t.numColors,o=t.tokenised,i=n.length;return function(e){for(var t=o,n=0;n0},parse:im,createTransformer:am,getAnimatableNone:function(e){var t=im(e);return am(e)(t.map(sm))}},um=new Set(["brightness","contrast","saturate","opacity"]);function cm(e){var t=yn(e.slice(0,-1).split("("),2),n=t[0],r=t[1];if("drop-shadow"===n)return e;var o=yn(r.match(Rg)||[],1)[0];if(!o)return e;var i=r.replace(o,""),a=um.has(n)?1:0;return o!==r&&(a*=100),n+"("+a+i+")"}var dm=/([a-z-]*)\(.*?\)/g,fm=Object.assign(Object.assign({},lm),{getAnimatableNone:function(e){var t=e.match(dm);return t?t.map(cm).join(" "):e}}),hm=un(un({},jg),{},{transform:Math.round}),pm={borderWidth:Ug,borderTopWidth:Ug,borderRightWidth:Ug,borderBottomWidth:Ug,borderLeftWidth:Ug,borderRadius:Ug,radius:Ug,borderTopLeftRadius:Ug,borderTopRightRadius:Ug,borderBottomRightRadius:Ug,borderBottomLeftRadius:Ug,width:Ug,maxWidth:Ug,height:Ug,maxHeight:Ug,size:Ug,top:Ug,right:Ug,bottom:Ug,left:Ug,padding:Ug,paddingTop:Ug,paddingRight:Ug,paddingBottom:Ug,paddingLeft:Ug,margin:Ug,marginTop:Ug,marginRight:Ug,marginBottom:Ug,marginLeft:Ug,rotate:Vg,rotateX:Vg,rotateY:Vg,rotateZ:Vg,scale:Fg,scaleX:Fg,scaleY:Fg,scaleZ:Fg,skew:Vg,skewX:Vg,skewY:Vg,distance:Ug,translateX:Ug,translateY:Ug,translateZ:Ug,x:Ug,y:Ug,z:Ug,perspective:Ug,transformPerspective:Ug,opacity:Bg,originX:Yg,originY:Yg,originZ:Ug,zIndex:hm,fillOpacity:Bg,strokeOpacity:Bg,numOctaves:hm};function vm(e,t,n,r){var o=e.style,i=e.vars,a=e.transform,s=e.transformKeys,l=e.transformOrigin;s.length=0;var u=!1,c=!1,d=!0;for(var f in t){var h=t[f];if(Ag(f))i[f]=h;else{var p=pm[f],v=Mg(h,p);if(_g.has(f)){if(u=!0,a[f]=v,s.push(f),!d)continue;h!==(p.default||0)&&(d=!1)}else f.startsWith("origin")?(c=!0,l[f]=v):o[f]=v}}if(t.transform||(u||r?o.transform=function(e,t,n,r){var o=e.transform,i=e.transformKeys,a=t.enableHardwareAcceleration,s=void 0===a||a,l=t.allowTransformNone,u=void 0===l||l,c="";i.sort(Og);var d,f=xn(i);try{for(f.s();!(d=f.n()).done;){var h=d.value;c+="".concat(Lg[h]||h,"(").concat(o[h],") ")}}catch(p){f.e(p)}finally{f.f()}return s&&!o.z&&(c+="translateZ(0)"),c=c.trim(),r?c=r(o,n?"":c):u&&n&&(c="none"),c}(e,n,d,r):o.transform&&(o.transform="none")),c){var g=l.originX,m=void 0===g?"50%":g,y=l.originY,b=void 0===y?"50%":y,w=l.originZ,k=void 0===w?0:w;o.transformOrigin="".concat(m," ").concat(b," ").concat(k)}}var gm=function(){return{style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}}};function mm(e,t,n){for(var r in t)Pg(t[r])||Eg(r,n)||(e[r]=t[r])}function ym(e,t,n){var r={};return mm(r,e.style||{},e),Object.assign(r,function(e,t,n){var r=e.transformTemplate;return cr.useMemo((function(){var e={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}};return vm(e,t,{enableHardwareAcceleration:!n},r),Object.assign({},e.vars,e.style)}),[t])}(e,t,n)),e.transformValues?e.transformValues(r):r}function bm(e,t,n){var r={},o=ym(e,t,n);return e.drag&&!1!==e.dragListener&&(r.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=!0===e.drag?"none":"pan-".concat("x"===e.drag?"y":"x")),r.style=o,r}var wm=new Set(["initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","layoutDependency","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","dragSnapToOrigin","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","onHoverStart","onHoverEnd","layoutScroll"].concat(["whileInView","onViewportEnter","onViewportLeave","viewport"],["whileTap","onTap","onTapStart","onTapCancel"],["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"],["onPan","onPanStart","onPanSessionStart","onPanEnd"]));function km(e){return wm.has(e)}var xm,Sm=function(e){return!km(e)};try{(xm=require("@emotion/is-prop-valid").default)&&(Sm=function(e){return e.startsWith("on")?!km(e):xm(e)})}catch(qf){}function Cm(e,t,n){var r={};for(var o in e)(Sm(o)||!0===n&&km(o)||!t&&!km(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}function _m(e,t,n){return"string"==typeof e?e:Ug.transform(t+n*e)}var Em={offset:"stroke-dashoffset",array:"stroke-dasharray"},Pm={offset:"strokeDashoffset",array:"strokeDasharray"};function Lm(e,t,n,r){var o=t.attrX,a=t.attrY,s=t.originX,l=t.originY,u=t.pathLength,c=t.pathSpacing,d=void 0===c?1:c,f=t.pathOffset,h=void 0===f?0:f;vm(e,sn(t,i),n,r),e.attrs=e.style,e.style={};var p=e.attrs,v=e.style,g=e.dimensions;p.transform&&(g&&(v.transform=p.transform),delete p.transform),g&&(void 0!==s||void 0!==l||v.transform)&&(v.transformOrigin=function(e,t,n){var r=_m(t,e.x,e.width),o=_m(n,e.y,e.height);return"".concat(r," ").concat(o)}(g,void 0!==s?s:.5,void 0!==l?l:.5)),void 0!==o&&(p.x=o),void 0!==a&&(p.y=a),void 0!==u&&function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];e.pathLength=1;var i=o?Em:Pm;e[i.offset]=Ug.transform(-r);var a=Ug.transform(t),s=Ug.transform(n);e[i.array]="".concat(a," ").concat(s)}(p,u,d,h,!1)}var Om=function(){return un(un({},{style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}}),{},{attrs:{}})};function Am(e,t){var n=cr.useMemo((function(){var n=Om();return Lm(n,t,{enableHardwareAcceleration:!1},e.transformTemplate),un(un({},n.attrs),{},{style:un({},n.style)})}),[t]);if(e.style){var r={};mm(r,e.style,e),n.style=un(un({},r),n.style)}return n}function Mm(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=function(t,n,r,o,i,a){var s=i.latestValues,l=(xg(t)?Am:bm)(n,s,a),u=un(un(un({},Cm(n,"string"==typeof t,e)),l),{},{ref:o});return r&&(u["data-projection-id"]=r),cr.createElement(t,u)};return t}var Tm=function(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()};function Im(e,t,n,r){var o=t.style,i=t.vars;for(var a in Object.assign(e.style,o,r&&r.getProjectionStyles(n)),i)e.style.setProperty(a,i[a])}var Rm=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength"]);function Nm(e,t,n,r){for(var o in Im(e,t,void 0,r),t.attrs)e.setAttribute(Rm.has(o)?o:Tm(o),t.attrs[o])}function Dm(e){var t=e.style,n={};for(var r in t)(Pg(t[r])||Eg(r,e))&&(n[r]=t[r]);return n}function zm(e){var t=Dm(e);for(var n in e){if(Pg(e[n]))t["x"===n||"y"===n?"attr"+n.toUpperCase():n]=e[n]}return t}function jm(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return"function"==typeof t&&(t=t(void 0!==n?n:e.custom,r,o)),"string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t&&(t=t(void 0!==n?n:e.custom,r,o)),t}var Bm=function(e){return Array.isArray(e)},Fm=function(e){return Bm(e)?e[e.length-1]||0:e};function Hm(e){var t=Pg(e)?e.get():e;return function(e){return Boolean(e&&"object"===kn(e)&&e.mix&&e.toValue)}(t)?t.toValue():t}var Vm=function(e){return function(t,n){var r=cr.useContext($v),o=cr.useContext(Kv),i=function(){return function(e,t,n,r){var o=e.scrapeMotionValuesFromProps,i=e.createRenderState,a=e.onMount,s={latestValues:Wm(t,n,r,o),renderState:i()};return a&&(s.mount=function(e){return a(t,e,s)}),s}(e,t,r,o)};return n?i():fg(i)}};function Wm(e,t,n,r){var o={},i=r(e);for(var s in i)o[s]=Hm(i[s]);var l=e.initial,u=e.animate,c=ag(e),d=sg(e);t&&d&&!c&&!1!==e.inherit&&(void 0===l&&(l=t.initial),void 0===u&&(u=t.animate));var f=!!n&&!1===n.initial,h=(f=f||!1===l)?u:l;h&&"boolean"!=typeof h&&!og(h)&&(Array.isArray(h)?h:[h]).forEach((function(t){var n=jm(e,t);if(n){var r=n.transitionEnd,i=(n.transition,sn(n,a));for(var s in i){var l=i[s];if(Array.isArray(l))l=l[f?l.length-1:0];null!==l&&(o[s]=l)}for(var u in r)o[u]=r[u]}}));return o}var Um,Gm={useVisualState:Vm({scrapeMotionValuesFromProps:zm,createRenderState:Om,onMount:function(e,t,n){var r=n.renderState,o=n.latestValues;try{r.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(Dhe){r.dimensions={x:0,y:0,width:0,height:0}}Lm(r,o,{enableHardwareAcceleration:!1},e.transformTemplate),Nm(t,r)}})},qm={useVisualState:Vm({scrapeMotionValuesFromProps:Dm,createRenderState:gm})};function Ym(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{passive:!0};return e.addEventListener(t,n,r),function(){return e.removeEventListener(t,n)}}function Zm(e,t,n,r){cr.useEffect((function(){var o=e.current;if(n&&o)return Ym(o,t,n,r)}),[e,t,n,r])}function Xm(e){return"undefined"!=typeof PointerEvent&&e instanceof PointerEvent?!("mouse"!==e.pointerType):e instanceof MouseEvent}function $m(e){return!!e.touches}function Km(e){return function(t){var n=t instanceof MouseEvent;(!n||n&&0===t.button)&&e(t)}}!function(e){e.Animate="animate",e.Hover="whileHover",e.Tap="whileTap",e.Drag="whileDrag",e.Focus="whileFocus",e.InView="whileInView",e.Exit="exit"}(Um||(Um={}));var Qm={pageX:0,pageY:0};function Jm(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"page",n=e.touches[0]||e.changedTouches[0],r=n||Qm;return{x:r[t+"X"],y:r[t+"Y"]}}function ey(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"page";return{x:e[t+"X"],y:e[t+"Y"]}}function ty(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"page";return{point:$m(e)?Jm(e,t):ey(e,t)}}var ny=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=function(t){return e(t,ty(t))};return t?Km(n):n},ry={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},oy={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function iy(e){return Qv&&null===window.onpointerdown?e:Qv&&null===window.ontouchstart?oy[e]:Qv&&null===window.onmousedown?ry[e]:e}function ay(e,t,n,r){return Ym(e,iy(t),ny(n,"pointerdown"===t),r)}function sy(e,t,n,r){return Zm(e,iy(t),n&&ny(n,"pointerdown"===t),r)}function ly(e){var t=null;return function(){return null===t&&(t=e,function(){t=null})}}var uy=ly("dragHorizontal"),cy=ly("dragVertical");function dy(e){var t=!1;if("y"===e)t=cy();else if("x"===e)t=uy();else{var n=uy(),r=cy();n&&r?t=function(){n(),r()}:(n&&n(),r&&r())}return t}function fy(){var e=dy(!0);return!e||(e(),!1)}function hy(e,t,n){return function(r,o){Xm(r)&&!fy()&&(e.animationState&&e.animationState.setActive(Um.Hover,t),n&&n(r,o))}}var py=function e(t,n){return!!n&&(t===n||e(t,n.parentElement))};function vy(e){return cr.useEffect((function(){return function(){return e()}}),[])}function gy(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o0?-1:1)*((r-i)*a)/s}):(t=function(e){return Math.exp(-e*o)*((e-l)*o+1)-.001},n=function(e){return Math.exp(-e*o)*(o*o*(l-e))});var f=function(e,t,n){for(var r=n,o=1;o<12;o++)r-=e(r)/t(r);return r}(t,n,5/o);if(o*=1e3,isNaN(f))return{stiffness:100,damping:10,duration:o};var h=Math.pow(f,2)*c;return{stiffness:h,damping:2*d*Math.sqrt(c*h),duration:o}}function wy(e,t){return e*Math.sqrt(1-t*t)}var ky=["duration","bounce"],xy=["stiffness","damping","mass"];function Sy(e,t){return t.some((function(t){return void 0!==e[t]}))}function Cy(e){var t=e.from,n=void 0===t?0:t,r=e.to,o=void 0===r?1:r,i=e.restSpeed,a=void 0===i?2:i,s=e.restDelta,l=gy(e,["from","to","restSpeed","restDelta"]),u={done:!1,value:n},c=function(e){var t=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},e);if(!Sy(e,xy)&&Sy(e,ky)){var n=by(e);(t=Object.assign(Object.assign(Object.assign({},t),n),{velocity:0,mass:1})).isResolvedFromDuration=!0}return t}(l),d=c.stiffness,f=c.damping,h=c.mass,p=c.velocity,v=c.duration,g=c.isResolvedFromDuration,m=_y,y=_y;function b(){var e=p?-p/1e3:0,t=o-n,r=f/(2*Math.sqrt(d*h)),i=Math.sqrt(d/h)/1e3;if(void 0===s&&(s=Math.min(Math.abs(o-n)/100,.4)),r<1){var a=wy(i,r);m=function(n){var s=Math.exp(-r*i*n);return o-s*((e+r*i*t)/a*Math.sin(a*n)+t*Math.cos(a*n))},y=function(n){var o=Math.exp(-r*i*n);return r*i*o*(Math.sin(a*n)*(e+r*i*t)/a+t*Math.cos(a*n))-o*(Math.cos(a*n)*(e+r*i*t)-a*t*Math.sin(a*n))}}else if(1===r)m=function(n){return o-Math.exp(-i*n)*(t+(e+i*t)*n)};else{var l=i*Math.sqrt(r*r-1);m=function(n){var a=Math.exp(-r*i*n),s=Math.min(l*n,300);return o-a*((e+r*i*t)*Math.sinh(s)+l*t*Math.cosh(s))/l}}}return b(),{next:function(e){var t=m(e);if(g)u.done=e>=v;else{var n=1e3*y(e),r=Math.abs(n)<=a,i=Math.abs(o-t)<=s;u.done=r&&i}return u.value=u.done?o:t,u},flipTarget:function(){p=-p;var e=[o,n];n=e[0],o=e[1],b()}}}Cy.needsInterpolation=function(e,t){return"string"==typeof e||"string"==typeof t};var _y=function(e){return 0},Ey=function(e,t,n){var r=t-e;return 0===r?1:(n-e)/r},Py=function(e,t,n){return-n*e+n*t+e};function Ly(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Oy(e){var t=e.hue,n=e.saturation,r=e.lightness,o=e.alpha;t/=360,r/=100;var i=0,a=0,s=0;if(n/=100){var l=r<.5?r*(1+n):r+n-r*n,u=2*r-l;i=Ly(u,l,t+1/3),a=Ly(u,l,t),s=Ly(u,l,t-1/3)}else i=a=s=r;return{red:Math.round(255*i),green:Math.round(255*a),blue:Math.round(255*s),alpha:o}}var Ay=function(e,t,n){var r=e*e,o=t*t;return Math.sqrt(Math.max(0,n*(o-r)+r))},My=[em,Jg,$g],Ty=function(e){return My.find((function(t){return t.test(e)}))},Iy=function(e,t){var n=Ty(e),r=Ty(t),o=n.parse(e),i=r.parse(t);n===$g&&(o=Oy(o),n=Jg),r===$g&&(i=Oy(i),r=Jg);var a=Object.assign({},o);return function(e){for(var t in a)"alpha"!==t&&(a[t]=Ay(o[t],i[t],e));return a.alpha=Py(o.alpha,i.alpha,e),n.transform(a)}},Ry=function(e){return"number"==typeof e},Ny=function(e,t){return function(n){return t(e(n))}},Dy=function(){for(var e=arguments.length,t=new Array(e),n=0;n=o.numNumbers?Dy(jy(r.parsed,o.parsed),n):function(n){return"".concat(n>0?t:e)}},Vy=function(e,t){return function(n){return Py(e,t,n)}};function Wy(e,t,n){for(var r=[],o=n||function(e){return"number"==typeof e?Vy:"string"==typeof e?tm.test(e)?Iy:Hy:Array.isArray(e)?jy:"object"===kn(e)?By:void 0}(e[0]),i=e.length-1,a=0;a=e[r]&&(i=r-1,a=!0),!a){for(var s=1;so||s===r);s++);i=s-1}var l=Ey(e[i],e[i+1],o);return t[i](l)}}function qy(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.clamp,o=void 0===r||r,i=n.ease,a=n.mixer,s=e.length;t.length,!i||!Array.isArray(i)||i.length,e[0]>e[s-1]&&(e=[].concat(e),t=[].concat(t),e.reverse(),t.reverse());var l=Wy(t,i,a),u=2===s?Uy(e,l):Gy(e,l);return o?function(t){return u(my(e[0],e[s-1],t))}:u}var Yy,Zy=function(e){return function(t){return 1-e(1-t)}},Xy=function(e){return function(t){return t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2}},$y=function(e){return function(t){return t*t*((e+1)*t-e)}},Ky=function(e){return e},Qy=(Yy=2,function(e){return Math.pow(e,Yy)}),Jy=Zy(Qy),eb=Xy(Qy),tb=function(e){return 1-Math.sin(Math.acos(e))},nb=Zy(tb),rb=Xy(nb),ob=$y(1.525),ib=Zy(ob),ab=Xy(ob),sb=function(e){var t=$y(e);return function(e){return(e*=2)<1?.5*t(e):.5*(2-Math.pow(2,-10*(e-1)))}}(1.525),lb=function(e){if(1===e||0===e)return e;var t=e*e;return e<.36363636363636365?7.5625*t:e<.7272727272727273?9.075*t-9.9*e+3.4:e<.9?12.066481994459833*t-19.63545706371191*e+8.898060941828255:10.8*e*e-20.52*e+10.72},ub=Zy(lb);function cb(e,t){return e.map((function(){return t||eb})).splice(0,e.length-1)}function db(e){var t=e.from,n=void 0===t?0:t,r=e.to,o=void 0===r?1:r,i=e.ease,a=e.offset,s=e.duration,l=void 0===s?300:s,u={done:!1,value:n},c=Array.isArray(o)?o:[n,o],d=function(e,t){return e.map((function(e){return e*t}))}(a&&a.length===c.length?a:function(e){var t=e.length;return e.map((function(e,n){return 0!==n?n/(t-1):0}))}(c),l);function f(){return qy(d,c,{ease:Array.isArray(i)?i:cb(c,i)})}var h=f();return{next:function(e){return u.value=h(e),u.done=e>=l,u},flipTarget:function(){c.reverse(),h=f()}}}var fb={keyframes:db,spring:Cy,decay:function(e){var t=e.velocity,n=void 0===t?0:t,r=e.from,o=void 0===r?0:r,i=e.power,a=void 0===i?.8:i,s=e.timeConstant,l=void 0===s?350:s,u=e.restDelta,c=void 0===u?.5:u,d=e.modifyTarget,f={done:!1,value:o},h=a*n,p=o+h,v=void 0===d?p:d(p);return v!==p&&(h=v-o),{next:function(e){var t=-h*Math.exp(-e/l);return f.done=!(t>c||t<-c),f.value=f.done?v:v+t,f},flipTarget:function(){}}}};var hb=1/60*1e3,pb="undefined"!=typeof performance?function(){return performance.now()}:function(){return Date.now()},vb="undefined"!=typeof window?function(e){return window.requestAnimationFrame(e)}:function(e){return setTimeout((function(){return e(pb())}),hb)};var gb=!0,mb=!1,yb=!1,bb={delta:0,timestamp:0},wb=["read","update","preRender","render","postRender"],kb=wb.reduce((function(e,t){return e[t]=function(e){var t=[],n=[],r=0,o=!1,i=!1,a=new WeakSet,s={schedule:function(e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2]&&o,s=i?t:n;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&a.add(e),-1===s.indexOf(e)&&(s.push(e),i&&o&&(r=t.length)),e},cancel:function(e){var t=n.indexOf(e);-1!==t&&n.splice(t,1),a.delete(e)},process:function(l){if(o)i=!0;else{o=!0;var u=[n,t];if(t=u[0],(n=u[1]).length=0,r=t.length)for(var c=0;c1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return mb||Eb(),n.schedule(e,t,r)},e}),{}),Sb=wb.reduce((function(e,t){return e[t]=kb[t].cancel,e}),{});wb.reduce((function(e,t){return e[t]=function(){return kb[t].process(bb)},e}),{});var Cb=function(e){return kb[e].process(bb)},_b=function e(t){mb=!1,bb.delta=gb?hb:Math.max(Math.min(t-bb.timestamp,40),1),bb.timestamp=t,yb=!0,wb.forEach(Cb),yb=!1,mb&&(gb=!1,vb(e))},Eb=function(){mb=!0,gb=!0,yb||vb(_b)};function Pb(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return e-t-n}var Lb=function(e){var t=function(t){var n=t.delta;return e(n)};return{start:function(){return xb.update(t,!0)},stop:function(){return Sb.update(t)}}};function Ob(e){var t,n,r,o,i,a=e.from,s=e.autoplay,l=void 0===s||s,u=e.driver,c=void 0===u?Lb:u,d=e.elapsed,f=void 0===d?0:d,h=e.repeat,p=void 0===h?0:h,v=e.repeatType,g=void 0===v?"loop":v,m=e.repeatDelay,y=void 0===m?0:m,b=e.onPlay,w=e.onStop,k=e.onComplete,x=e.onRepeat,S=e.onUpdate,C=gy(e,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]),_=C.to,E=0,P=C.duration,L=!1,O=!0,A=function(e){if(Array.isArray(e.to))return db;if(fb[e.type])return fb[e.type];var t=new Set(Object.keys(e));return t.has("ease")||t.has("duration")&&!t.has("dampingRatio")?db:t.has("dampingRatio")||t.has("stiffness")||t.has("mass")||t.has("damping")||t.has("restSpeed")||t.has("restDelta")?Cy:db}(C);(null===(n=(t=A).needsInterpolation)||void 0===n?void 0:n.call(t,a,_))&&(i=qy([0,100],[a,_],{clamp:!1}),a=0,_=100);var M=A(Object.assign(Object.assign({},C),{from:a,to:_}));function T(){E++,"reverse"===g?f=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return r?Pb(t+-e,t,n):t-(e-t)+n}(f,P,y,O=E%2==0):(f=Pb(f,P,y),"mirror"===g&&M.flipTarget()),L=!1,x&&x()}function I(e){if(O||(e=-e),f+=e,!L){var t=M.next(Math.max(0,f));o=t.value,i&&(o=i(o)),L=O?t.done:f<=0}null==S||S(o),L&&(0===E&&(null!=P||(P=f)),E=t+n:e<=-n}(f,P,y,O)&&T():(r.stop(),k&&k()))}return l&&(null==b||b(),(r=c(I)).start()),{stop:function(){null==w||w(),r.stop()}}}function Ab(e,t){return t?e*(1e3/t):0}function Mb(e){var t,n=e.from,r=void 0===n?0:n,o=e.velocity,i=void 0===o?0:o,a=e.min,s=e.max,l=e.power,u=void 0===l?.8:l,c=e.timeConstant,d=void 0===c?750:c,f=e.bounceStiffness,h=void 0===f?500:f,p=e.bounceDamping,v=void 0===p?10:p,g=e.restDelta,m=void 0===g?1:g,y=e.modifyTarget,b=e.driver,w=e.onUpdate,k=e.onComplete,x=e.onStop;function S(e){return void 0!==a&&es}function C(e){return void 0===a?s:void 0===s||Math.abs(a-e)A||-1===M&&e=.001?function(e,t,n,r){for(var o=0;o<8;++o){var i=Fb(t,n,r);if(0===i)return t;t-=(Bb(t,n,r)-e)/i}return t}(t,a,e,n):0===s?a:function(e,t,n,r,o){var i,a,s=0;do{(i=Bb(a=t+(n-t)/2,r,o)-e)>0?n=a:t=a}while(Math.abs(i)>1e-7&&++s<10);return a}(t,r,r+Hb,e,n)}return function(e){return 0===e||1===e?e:Bb(a(e),t,r)}}var Wb=("undefined"==typeof process||process.env,"production"),Ub=new Set;function Gb(e,t,n){e||Ub.has(t)||(console.warn(t),n&&console.warn(n),Ub.add(t))}var qb=new WeakMap,Yb=new WeakMap,Zb=function(e){var t=qb.get(e.target);t&&t(e)},Xb=function(e){e.forEach(Zb)};function $b(e,t,n){var r=function(e){var t=e.root,n=sn(e,s),r=t||document;Yb.has(r)||Yb.set(r,{});var o=Yb.get(r),i=JSON.stringify(n);return o[i]||(o[i]=new IntersectionObserver(Xb,un({root:t},n))),o[i]}(t);return qb.set(e,n),r.observe(e),function(){qb.delete(e),r.unobserve(e)}}var Kb={some:0,all:1};function Qb(e,t,n,r){var o=r.root,i=r.margin,a=r.amount,s=void 0===a?"some":a,l=r.once;cr.useEffect((function(){if(e&&n.current){var r={root:null==o?void 0:o.current,rootMargin:i,threshold:"number"==typeof s?s:Kb[s]};return $b(n.current,r,(function(e){var r=e.isIntersecting;if(t.isInView!==r&&(t.isInView=r,!l||r||!t.hasEnteredView)){r&&(t.hasEnteredView=!0),n.animationState&&n.animationState.setActive(Um.InView,r);var o=n.getProps(),i=r?o.onViewportEnter:o.onViewportLeave;i&&i(e)}}))}}),[e,o,i,s])}function Jb(e,t,n,r){var o=r.fallback,i=void 0===o||o;cr.useEffect((function(){e&&i&&("production"!==Wb&&Gb(!1,"IntersectionObserver not available on this device. whileInView animations will trigger on mount."),requestAnimationFrame((function(){t.hasEnteredView=!0;var e=n.getProps().onViewportEnter;e&&e(null),n.animationState&&n.animationState.setActive(Um.InView,!0)})))}),[e])}var ew=function(e){return function(t){return e(t),null}},tw={inView:ew((function(e){var t=e.visualElement,n=e.whileInView,r=e.onViewportEnter,o=e.onViewportLeave,i=e.viewport,a=void 0===i?{}:i,s=cr.useRef({hasEnteredView:!1,isInView:!1}),l=Boolean(n||r||o);a.once&&s.current.hasEnteredView&&(l=!1),("undefined"==typeof IntersectionObserver?Jb:Qb)(l,s.current,t,a)})),tap:ew((function(e){var t=e.onTap,n=e.onTapStart,r=e.onTapCancel,o=e.whileTap,i=e.visualElement,a=t||n||r||o,s=cr.useRef(!1),l=cr.useRef(null),u={passive:!(n||t||r||p)};function c(){l.current&&l.current(),l.current=null}function d(){return c(),s.current=!1,i.animationState&&i.animationState.setActive(Um.Tap,!1),!fy()}function f(e,n){d()&&(py(i.current,e.target)?t&&t(e,n):r&&r(e,n))}function h(e,t){d()&&r&&r(e,t)}function p(e,t){c(),s.current||(s.current=!0,l.current=Dy(ay(window,"pointerup",f,u),ay(window,"pointercancel",h,u)),i.animationState&&i.animationState.setActive(Um.Tap,!0),n&&n(e,t))}sy(i,"pointerdown",a?p:void 0,u),vy(c)})),focus:ew((function(e){var t=e.whileFocus,n=e.visualElement,r=n.animationState;Zm(n,"focus",t?function(){r&&r.setActive(Um.Focus,!0)}:void 0),Zm(n,"blur",t?function(){r&&r.setActive(Um.Focus,!1)}:void 0)})),hover:ew((function(e){var t=e.onHoverStart,n=e.onHoverEnd,r=e.whileHover,o=e.visualElement;sy(o,"pointerenter",t||r?hy(o,!0,t):void 0,{passive:!t}),sy(o,"pointerleave",n||r?hy(o,!1,n):void 0,{passive:!n})}))};function nw(){var e=cr.useContext(Kv);if(null===e)return[!0,null];var t=e.isPresent,n=e.onExitComplete,r=e.register,o=cr.useId();cr.useEffect((function(){return r(o)}),[]);return!t&&n?[!1,function(){return n&&n(o)}]:[!0]}function rw(){return null===(e=cr.useContext(Kv))||e.isPresent;var e}function ow(e,t){if(!Array.isArray(t))return!1;var n=t.length;if(n!==e.length)return!1;for(var r=0;r2&&void 0!==arguments[2]&&arguments[2]&&o,s=i?t:n;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&a.add(e),-1===s.indexOf(e)&&(s.push(e),i&&o&&(r=t.length)),e},cancel:function(e){var t=n.indexOf(e);-1!==t&&n.splice(t,1),a.delete(e)},process:function(l){if(o)i=!0;else{o=!0;var u=[n,t];if(t=u[0],(n=u[1]).length=0,r=t.length)for(var c=0;c1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return xw||Tw(),n.schedule(e,t,r)},e}),{}),Lw=_w.reduce((function(e,t){return e[t]=Ew[t].cancel,e}),{}),Ow=_w.reduce((function(e,t){return e[t]=function(){return Ew[t].process(Cw)},e}),{}),Aw=function(e){return Ew[e].process(Cw)},Mw=function e(t){xw=!1,Cw.delta=kw?yw:Math.max(Math.min(t-Cw.timestamp,40),1),Cw.timestamp=t,Sw=!0,_w.forEach(Aw),Sw=!1,xw&&(kw=!1,ww(e))},Tw=function(){xw=!0,kw=!0,Sw||ww(Mw)},Iw=function(){return Cw};function Rw(e,t){var n=performance.now(),r=function r(o){var i=o.timestamp-n;i>=t&&(Lw.read(r),e(i-t))};return Pw.read(r,!0),function(){return Lw.read(r)}}function Nw(e){var t=e.ease,n=e.times,r=e.yoyo,o=e.flip,i=e.loop,a=sn(e,u),s=un({},a);return n&&(s.offset=n),a.duration&&(s.duration=iw(a.duration)),a.repeatDelay&&(s.repeatDelay=iw(a.repeatDelay)),t&&(s.ease=function(e){return Array.isArray(e)&&"number"!=typeof e[0]}(t)?t.map(sw):sw(t)),"tween"===a.type&&(s.type="keyframes"),(r||i||o)&&(r?s.repeatType="reverse":i?s.repeatType="loop":o&&(s.repeatType="mirror"),s.repeat=i||r||o||a.repeat),"spring"!==a.type&&(s.type="keyframes"),s}function Dw(e,t){var n,r;return null!==(r=null!==(n=(Hw(e,t)||{}).delay)&&void 0!==n?n:e.delay)&&void 0!==r?r:0}function zw(e,t,n){var r,o;return Array.isArray(t.to)&&void 0===e.duration&&(e.duration=.8),function(e){Array.isArray(e.to)&&null===e.to[0]&&(e.to=cn(e.to),e.to[0]=e.from)}(t),function(e){e.when,e.delay,e.delayChildren,e.staggerChildren,e.staggerDirection,e.repeat,e.repeatType,e.repeatDelay,e.from;var t=sn(e,l);return!!Object.keys(t).length}(e)||(e=un(un({},e),(r=n,un({to:o=t.to},(Bm(o)?fw:hw[r]||hw.default)(o))))),un(un({},t),Nw(e))}function jw(e,t,n,r,o){var i=Hw(r,e)||{},a=void 0!==i.from?i.from:t.get(),s=lw(e,n);return"none"===a&&s&&"string"==typeof n?a=gw(e,n):Bw(a)&&"string"==typeof n?a=Fw(n):!Array.isArray(n)&&Bw(n)&&"string"==typeof a&&(n=Fw(a)),lw(e,a)&&s&&!1!==i.type?function(){var r={from:a,to:n,velocity:t.getVelocity(),onComplete:o,onUpdate:function(e){return t.set(e)}};return"inertia"===i.type||"decay"===i.type?Mb(un(un({},r),i)):Ob(un(un({},zw(i,r,e)),{},{onUpdate:function(e){r.onUpdate(e),i.onUpdate&&i.onUpdate(e)},onComplete:function(){r.onComplete(),i.onComplete&&i.onComplete()}}))}:function(){var e=Fm(n);return t.set(e),o(),i.onUpdate&&i.onUpdate(e),i.onComplete&&i.onComplete(),{stop:function(){}}}}function Bw(e){return 0===e||"string"==typeof e&&0===parseFloat(e)&&-1===e.indexOf(" ")}function Fw(e){return"number"==typeof e?0:gw("",e)}function Hw(e,t){return e[t]||e.default||e}function Vw(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return mw&&(r={type:!1}),t.start((function(o){var i,a,s=jw(e,t,n,r,o),l=Dw(r,e),u=function(){return i=s()};return l?a=Rw(u,iw(l)):u(),function(){a&&a(),i&&i.stop()}}))}var Ww=function(e){return/^\-?\d*\.?\d+$/.test(e)},Uw=function(e){return/^0[^.\s]+$/.test(e)};function Gw(e,t){-1===e.indexOf(t)&&e.push(t)}function qw(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)}var Yw=function(){function e(){an(this,e),this.subscriptions=[]}return on(e,[{key:"add",value:function(e){var t=this;return Gw(this.subscriptions,e),function(){return qw(t.subscriptions,e)}}},{key:"notify",value:function(e,t,n){var r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](e,t,n);else for(var o=0;o1&&void 0!==arguments[1])||arguments[1];n.prev=n.current,n.current=e;var r=Iw(),o=r.delta,i=r.timestamp;n.lastUpdated!==i&&(n.timeDelta=o,n.lastUpdated=i,Pw.postRender(n.scheduleVelocityCheck)),n.prev!==n.current&&n.updateSubscribers.notify(n.current),n.velocityUpdateSubscribers.getSize()&&n.velocityUpdateSubscribers.notify(n.getVelocity()),t&&n.renderSubscribers.notify(n.current)},this.scheduleVelocityCheck=function(){return Pw.postRender(n.velocityCheck)},this.velocityCheck=function(e){e.timestamp!==n.lastUpdated&&(n.prev=n.current,n.velocityUpdateSubscribers.notify(n.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=function(e){return!isNaN(parseFloat(e))}(this.current)}return on(e,[{key:"onChange",value:function(e){return this.updateSubscribers.add(e)}},{key:"clearListeners",value:function(){this.updateSubscribers.clear()}},{key:"onRenderRequest",value:function(e){return e(this.get()),this.renderSubscribers.add(e)}},{key:"attach",value:function(e){this.passiveEffect=e}},{key:"set",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}},{key:"get",value:function(){return this.current}},{key:"getPrevious",value:function(){return this.prev}},{key:"getVelocity",value:function(){return this.canTrackVelocity?Ab(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}},{key:"start",value:function(e){var t=this;return this.stop(),new Promise((function(n){t.hasAnimated=!0,t.stopAnimation=e(n)})).then((function(){return t.clearAnimation()}))}},{key:"stop",value:function(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}},{key:"isAnimating",value:function(){return!!this.stopAnimation}},{key:"clearAnimation",value:function(){this.stopAnimation=null}},{key:"destroy",value:function(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()}}]),e}();function Xw(e){return new Zw(e)}var $w=function(e){return function(t){return t.test(e)}},Kw=[jg,Ug,Wg,Vg,qg,Gg,{test:function(e){return"auto"===e},parse:function(e){return e}}],Qw=function(e){return Kw.find($w(e))},Jw=[].concat(Kw,[tm,lm]),ek=function(e){return Jw.find($w(e))};function tk(e,t,n){var r=e.getProps();return jm(r,t,void 0!==n?n:r.custom,function(e){var t={};return e.values.forEach((function(e,n){return t[n]=e.get()})),t}(e),function(e){var t={};return e.values.forEach((function(e,n){return t[n]=e.getVelocity()})),t}(e))}function nk(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Xw(n))}function rk(e,t){var n=tk(e,t),r=n?e.makeTargetAnimatable(n,!1):{},o=r.transitionEnd,i=void 0===o?{}:o,a=(r.transition,sn(r,c));for(var s in a=un(un({},a),i)){nk(e,s,Fm(a[s]))}}function ok(e,t){if(t)return(t[e]||t.default||t).from}function ik(e){return Boolean(Pg(e)&&e.add)}function ak(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=tk(e,t,r.custom),i=o||{},a=i.transition,s=void 0===a?e.getDefaultTransition()||{}:a;r.transitionOverride&&(s=r.transitionOverride);var l=o?function(){return sk(e,o,r)}:function(){return Promise.resolve()},u=(null===(n=e.variantChildren)||void 0===n?void 0:n.size)?function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=s,i=o.delayChildren,a=void 0===i?0:i,l=o.staggerChildren,u=o.staggerDirection;return lk(e,t,a+n,l,u,r)}:function(){return Promise.resolve()},c=s,d=c.when;if(d){var f="beforeChildren"===d?[l,u]:[u,l],h=yn(f,2),p=h[0],v=h[1];return p().then(v)}return Promise.all([l(),u(r.delay)])}function sk(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=r.delay,i=void 0===o?0:o,a=r.transitionOverride,s=r.type,l=e.makeTargetAnimatable(t),u=l.transition,c=void 0===u?e.getDefaultTransition():u,f=l.transitionEnd,h=sn(l,d),p=e.getValue("willChange");a&&(c=a);var v=[],g=s&&(null===(n=e.animationState)||void 0===n?void 0:n.getState()[s]),m=function(t){var n=e.getValue(t),r=h[t];if(!n||void 0===r||g&&ck(g,t))return"continue";var o=un({delay:i},c);e.shouldReduceMotion&&_g.has(t)&&(o=un(un({},o),{},{type:!1,delay:0}));var a=Vw(t,n,r,o);ik(p)&&(p.add(t),a=a.then((function(){return p.remove(t)}))),v.push(a)};for(var y in h)m(y);return Promise.all(v).then((function(){f&&rk(e,f)}))}function lk(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,i=arguments.length>5?arguments[5]:void 0,a=[],s=(e.variantChildren.size-1)*r,l=1===o?function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return e*r}:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return s-e*r};return Array.from(e.variantChildren).sort(uk).forEach((function(e,r){a.push(ak(e,t,un(un({},i),{},{delay:n+l(r)})).then((function(){return e.notify("AnimationComplete",t)})))})),Promise.all(a)}function uk(e,t){return e.sortNodePosition(t)}function ck(e,t){var n=e.protectedKeys,r=e.needsAnimating,o=n.hasOwnProperty(t)&&!0!==r[t];return r[t]=!1,o}var dk=[Um.Animate,Um.InView,Um.Focus,Um.Hover,Um.Tap,Um.Drag,Um.Exit],fk=[].concat(dk).reverse(),hk=dk.length;function pk(e){return function(t){return Promise.all(t.map((function(t){var n=t.animation,r=t.options;return function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e.notify("AnimationStart",t),Array.isArray(t)){var o=t.map((function(t){return ak(e,t,r)}));n=Promise.all(o)}else if("string"==typeof t)n=ak(e,t,r);else{var i="function"==typeof t?tk(e,t,r.custom):t;n=sk(e,i,r)}return n.then((function(){return e.notify("AnimationComplete",t)}))}(e,n,r)})))}}function vk(e){var t,n=pk(e),r=(gn(t={},Um.Animate,gk(!0)),gn(t,Um.InView,gk()),gn(t,Um.Hover,gk()),gn(t,Um.Tap,gk()),gn(t,Um.Drag,gk()),gn(t,Um.Focus,gk()),gn(t,Um.Exit,gk()),t),o=!0,i=function(t,n){var r=tk(e,n);if(r){r.transition;var o=r.transitionEnd,i=sn(r,f);t=un(un(un({},t),i),o)}return t};function a(t,a){for(var s,l=e.getProps(),u=e.getVariantContext(!0)||{},c=[],d=new Set,f={},h=1/0,p=function(){var n=fk[v],p=r[n],g=null!==(s=l[n])&&void 0!==s?s:u[n],m=rg(g),y=n===a?p.isActive:null;!1===y&&(h=v);var b=g===u[n]&&g!==l[n]&&m;if(b&&o&&e.manuallyAnimateOnMount&&(b=!1),p.protectedKeys=un({},f),!p.isActive&&null===y||!g&&!p.prevProp||og(g)||"boolean"==typeof g)return"continue";var w=function(e,t){if("string"==typeof t)return t!==e;if(Array.isArray(t))return!ow(t,e);return!1}(p.prevProp,g),k=w||n===a&&p.isActive&&!b&&m||v>h&&m,x=Array.isArray(g)?g:[g],S=x.reduce(i,{});!1===y&&(S={});var C=p.prevResolvedValues,_=void 0===C?{}:C,E=un(un({},_),S),P=function(e){k=!0,d.delete(e),p.needsAnimating[e]=!0};for(var L in E){var O=S[L],A=_[L];f.hasOwnProperty(L)||(O!==A?Bm(O)&&Bm(A)?!ow(O,A)||w?P(L):p.protectedKeys[L]=!0:void 0!==O?P(L):d.add(L):void 0!==O&&d.has(L)?P(L):p.protectedKeys[L]=!0)}p.prevProp=g,p.prevResolvedValues=S,p.isActive&&(f=un(un({},f),S)),o&&e.blockInitialAnimation&&(k=!1),k&&!b&&c.push.apply(c,cn(x.map((function(e){return{animation:e,options:un({type:n},t)}}))))},v=0;v0&&void 0!==arguments[0]&&arguments[0];return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}var mk={animation:ew((function(e){var t=e.visualElement,n=e.animate;t.animationState||(t.animationState=vk(t)),og(n)&&cr.useEffect((function(){return n.subscribe(t)}),[n])})),exit:ew((function(e){var t=e.custom,n=e.visualElement,r=yn(nw(),2),o=r[0],i=r[1],a=cr.useContext(Kv);cr.useEffect((function(){n.isPresent=o;var e=n.animationState&&n.animationState.setActive(Um.Exit,!o,{custom:a&&a.custom||t});e&&!o&&e.then(i)}),[o])}))},yk=function(){function e(t,n){var r=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=o.transformPagePoint;if(an(this,e),this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=function(){if(r.lastMoveEvent&&r.lastMoveEventInfo){var e=kk(r.lastMoveEventInfo,r.history),t=null!==r.startEvent,n=Nb(e.offset,{x:0,y:0})>=3;if(t||n){var o=e.point,i=Iw().timestamp;r.history.push(un(un({},o),{},{timestamp:i}));var a=r.handlers,s=a.onStart,l=a.onMove;t||(s&&s(r.lastMoveEvent,e),r.startEvent=r.lastMoveEvent),l&&l(r.lastMoveEvent,e)}}},this.handlePointerMove=function(e,t){r.lastMoveEvent=e,r.lastMoveEventInfo=bk(t,r.transformPagePoint),Xm(e)&&0===e.buttons?r.handlePointerUp(e,t):Pw.update(r.updatePoint,!0)},this.handlePointerUp=function(e,t){r.end();var n=r.handlers,o=n.onEnd,i=n.onSessionEnd,a=kk(bk(t,r.transformPagePoint),r.history);r.startEvent&&o&&o(e,a),i&&i(e,a)},!($m(t)&&t.touches.length>1)){this.handlers=n,this.transformPagePoint=i;var a=ty(t),s=bk(a,this.transformPagePoint),l=s.point,u=Iw(),c=u.timestamp;this.history=[un(un({},l),{},{timestamp:c})];var d=n.onSessionStart;d&&d(t,kk(s,this.history)),this.removeListeners=Dy(ay(window,"pointermove",this.handlePointerMove),ay(window,"pointerup",this.handlePointerUp),ay(window,"pointercancel",this.handlePointerUp))}}return on(e,[{key:"updateHandlers",value:function(e){this.handlers=e}},{key:"end",value:function(){this.removeListeners&&this.removeListeners(),Lw.update(this.updatePoint)}}]),e}();function bk(e,t){return t?{point:t(e.point)}:e}function wk(e,t){return{x:e.x-t.x,y:e.y-t.y}}function kk(e,t){var n=e.point;return{point:n,delta:wk(n,Sk(t)),offset:wk(n,xk(t)),velocity:Ck(t,.1)}}function xk(e){return e[0]}function Sk(e){return e[e.length-1]}function Ck(e,t){if(e.length<2)return{x:0,y:0};for(var n=e.length-1,r=null,o=Sk(e);n>=0&&(r=e[n],!(o.timestamp-r.timestamp>iw(t)));)n--;if(!r)return{x:0,y:0};var i=(o.timestamp-r.timestamp)/1e3;if(0===i)return{x:0,y:0};var a={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function _k(e){return e.max-e.min}function Ek(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.01;return Nb(e,t)3&&void 0!==arguments[3]?arguments[3]:.5;e.origin=r,e.originPoint=Py(t.min,t.max,e.origin),e.scale=_k(n)/_k(t),(Ek(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=Py(n.min,n.max,e.origin)-e.originPoint,(Ek(e.translate)||isNaN(e.translate))&&(e.translate=0)}function Lk(e,t,n,r){Pk(e.x,t.x,n.x,null==r?void 0:r.originX),Pk(e.y,t.y,n.y,null==r?void 0:r.originY)}function Ok(e,t,n){e.min=n.min+t.min,e.max=e.min+_k(t)}function Ak(e,t,n){e.min=t.min-n.min,e.max=e.min+_k(t)}function Mk(e,t,n){Ak(e.x,t.x,n.x),Ak(e.y,t.y,n.y)}function Tk(e,t,n){return{min:void 0!==t?e.min+t:void 0,max:void 0!==n?e.max+n-(e.max-e.min):void 0}}function Ik(e,t){var n=t.min-e.min,r=t.max-e.max;if(t.max-t.min1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;e.min=Gk(e.min,t,n,r,o),e.max=Gk(e.max,t,n,r,o)}function Yk(e,t){var n=t.x,r=t.y;qk(e.x,n.translate,n.scale,n.originPoint),qk(e.y,r.translate,r.scale,r.originPoint)}function Zk(e,t){e.min=e.min+t,e.max=e.max+t}function Xk(e,t,n){var r=yn(n,3),o=r[0],i=r[1],a=r[2],s=void 0!==t[a]?t[a]:.5,l=Py(e.min,e.max,s);qk(e,t[o],t[i],l,t.scale)}var $k=["x","scaleX","originX"],Kk=["y","scaleY","originY"];function Qk(e,t){Xk(e.x,t,$k),Xk(e.y,t,Kk)}function Jk(e,t){return jk(function(e,t){if(!t)return e;var n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(e.getBoundingClientRect(),t))}var ex=new WeakMap,tx=function(){function e(t){an(this,e),this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=t}return on(e,[{key:"start",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.snapToCursor,o=void 0!==r&&r;if(!1!==this.visualElement.isPresent){var i=function(e){t.stopAnimation(),o&&t.snapToCursor(ty(e,"page").point)},a=function(e,n){var r,o=t.getProps(),i=o.drag,a=o.dragPropagation,s=o.onDragStart;(!i||a||(t.openGlobalLock&&t.openGlobalLock(),t.openGlobalLock=dy(i),t.openGlobalLock))&&(t.isDragging=!0,t.currentDirection=null,t.resolveConstraints(),t.visualElement.projection&&(t.visualElement.projection.isAnimationBlocked=!0,t.visualElement.projection.target=void 0),zk((function(e){var n,r,o=t.getAxisMotionValue(e).get()||0;if(Wg.test(o)){var i=null===(r=null===(n=t.visualElement.projection)||void 0===n?void 0:n.layout)||void 0===r?void 0:r.layoutBox[e];if(i)o=_k(i)*(parseFloat(o)/100)}t.originPoint[e]=o})),null==s||s(e,n),null===(r=t.visualElement.animationState)||void 0===r||r.setActive(Um.Drag,!0))},s=function(e,n){var r=t.getProps(),o=r.dragPropagation,i=r.dragDirectionLock,a=r.onDirectionLock,s=r.onDrag;if(o||t.openGlobalLock){var l=n.offset;if(i&&null===t.currentDirection)return t.currentDirection=rx(l),void(null!==t.currentDirection&&(null==a||a(t.currentDirection)));t.updateAxis("x",n.point,l),t.updateAxis("y",n.point,l),t.visualElement.render(),null==s||s(e,n)}},l=function(e,n){return t.stop(e,n)};this.panSession=new yk(e,{onSessionStart:i,onStart:a,onMove:s,onSessionEnd:l},{transformPagePoint:this.visualElement.getTransformPagePoint()})}}},{key:"stop",value:function(e,t){var n=this.isDragging;if(this.cancel(),n){var r=t.velocity;this.startAnimation(r);var o=this.getProps().onDragEnd;null==o||o(e,t)}}},{key:"cancel",value:function(){var e,t;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),null===(e=this.panSession)||void 0===e||e.end(),this.panSession=void 0,!this.getProps().dragPropagation&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),null===(t=this.visualElement.animationState)||void 0===t||t.setActive(Um.Drag,!1)}},{key:"updateAxis",value:function(e,t,n){var r=this.getProps().drag;if(n&&nx(e,r,this.currentDirection)){var o=this.getAxisMotionValue(e),i=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(i=function(e,t,n){var r=t.min,o=t.max;return void 0!==r&&eo&&(e=n?Py(o,e,n.max):Math.min(e,o)),e}(i,this.constraints[e],this.elastic[e])),o.set(i)}}},{key:"resolveConstraints",value:function(){var e=this,t=this.getProps(),n=t.dragConstraints,r=t.dragElastic,o=(this.visualElement.projection||{}).layout,i=this.constraints;n&&ng(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!n||!o)&&function(e,t){var n=t.top,r=t.left,o=t.bottom,i=t.right;return{x:Tk(e.x,r,i),y:Tk(e.y,n,o)}}(o.layoutBox,n),this.elastic=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Rk;return!1===e?e=0:!0===e&&(e=Rk),{x:Nk(e,"left","right"),y:Nk(e,"top","bottom")}}(r),i!==this.constraints&&o&&this.constraints&&!this.hasMutatedConstraints&&zk((function(t){e.getAxisMotionValue(t)&&(e.constraints[t]=function(e,t){var n={};return void 0!==t.min&&(n.min=t.min-e.min),void 0!==t.max&&(n.max=t.max-e.min),n}(o.layoutBox[t],e.constraints[t]))}))}},{key:"resolveRefConstraints",value:function(){var e=this.getProps(),t=e.dragConstraints,n=e.onMeasureDragConstraints;if(!t||!ng(t))return!1;var r=t.current,o=this.visualElement.projection;if(!o||!o.layout)return!1;var i=function(e,t,n){var r=Jk(e,n),o=t.scroll;return o&&(Zk(r.x,o.offset.x),Zk(r.y,o.offset.y)),r}(r,o.root,this.visualElement.getTransformPagePoint()),a=function(e,t){return{x:Ik(e.x,t.x),y:Ik(e.y,t.y)}}(o.layout.layoutBox,i);if(n){var s=n(function(e){var t=e.x,n=e.y;return{top:n.min,right:t.max,bottom:n.max,left:t.min}}(a));this.hasMutatedConstraints=!!s,s&&(a=jk(s))}return a}},{key:"startAnimation",value:function(e){var t=this,n=this.getProps(),r=n.drag,o=n.dragMomentum,i=n.dragElastic,a=n.dragTransition,s=n.dragSnapToOrigin,l=n.onDragTransitionEnd,u=this.constraints||{},c=zk((function(n){var l;if(nx(n,r,t.currentDirection)){var c=null!==(l=null==u?void 0:u[n])&&void 0!==l?l:{};s&&(c={min:0,max:0});var d=i?200:1e6,f=i?40:1e7,h=un(un({type:"inertia",velocity:o?e[n]:0,bounceStiffness:d,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10},a),c);return t.startAxisValueAnimation(n,h)}}));return Promise.all(c).then(l)}},{key:"startAxisValueAnimation",value:function(e,t){return Vw(e,this.getAxisMotionValue(e),0,t)}},{key:"stopAnimation",value:function(){var e=this;zk((function(t){return e.getAxisMotionValue(t).stop()}))}},{key:"getAxisMotionValue",value:function(e){var t,n,r="_drag"+e.toUpperCase(),o=this.visualElement.getProps()[r];return o||this.visualElement.getValue(e,null!==(n=null===(t=this.visualElement.getProps().initial)||void 0===t?void 0:t[e])&&void 0!==n?n:0)}},{key:"snapToCursor",value:function(e){var t=this;zk((function(n){if(nx(n,t.getProps().drag,t.currentDirection)){var r=t.visualElement.projection,o=t.getAxisMotionValue(n);if(r&&r.layout){var i=r.layout.layoutBox[n],a=i.min,s=i.max;o.set(e[n]-Py(a,s,.5))}}}))}},{key:"scalePositionWithinConstraints",value:function(){var e,t=this;if(this.visualElement.current){var n=this.getProps(),r=n.drag,o=n.dragConstraints,i=this.visualElement.projection;if(ng(o)&&i&&this.constraints){this.stopAnimation();var a={x:0,y:0};zk((function(e){var n,r,o,i,s,l=t.getAxisMotionValue(e);if(l){var u=l.get();a[e]=(n={min:u,max:u},r=t.constraints[e],o=.5,i=_k(n),(s=_k(r))>i?o=Ey(r.min,r.max-i,n.min):i>s&&(o=Ey(n.min,n.max-s,r.min)),my(0,1,o))}}));var s=this.visualElement.getProps().transformTemplate;this.visualElement.current.style.transform=s?s({},""):"none",null===(e=i.root)||void 0===e||e.updateScroll(),i.updateLayout(),this.resolveConstraints(),zk((function(e){if(nx(e,r,null)){var n=t.getAxisMotionValue(e),o=t.constraints[e],i=o.min,s=o.max;n.set(Py(i,s,a[e]))}}))}}}},{key:"addListeners",value:function(){var e,t=this;if(this.visualElement.current){ex.set(this.visualElement,this);var n=ay(this.visualElement.current,"pointerdown",(function(e){var n=t.getProps(),r=n.drag,o=n.dragListener;r&&(void 0===o||o)&&t.start(e)})),r=function(){ng(t.getProps().dragConstraints)&&(t.constraints=t.resolveRefConstraints())},o=this.visualElement.projection,i=o.addEventListener("measure",r);o&&!o.layout&&(null===(e=o.root)||void 0===e||e.updateScroll(),o.updateLayout()),r();var a=Ym(window,"resize",(function(){return t.scalePositionWithinConstraints()})),s=o.addEventListener("didUpdate",(function(e){var n=e.delta,r=e.hasLayoutChanged;t.isDragging&&r&&(zk((function(e){var r=t.getAxisMotionValue(e);r&&(t.originPoint[e]+=n[e].translate,r.set(r.get()+n[e].translate))})),t.visualElement.render())}));return function(){a(),n(),i(),null==s||s()}}}},{key:"getProps",value:function(){var e=this.visualElement.getProps(),t=e.drag,n=void 0!==t&&t,r=e.dragDirectionLock,o=void 0!==r&&r,i=e.dragPropagation,a=void 0!==i&&i,s=e.dragConstraints,l=void 0!==s&&s,u=e.dragElastic,c=void 0===u?Rk:u,d=e.dragMomentum,f=void 0===d||d;return un(un({},e),{},{drag:n,dragDirectionLock:o,dragPropagation:a,dragConstraints:l,dragElastic:c,dragMomentum:f})}}]),e}();function nx(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}function rx(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}var ox={pan:ew((function(e){var t=e.onPan,n=e.onPanStart,r=e.onPanEnd,o=e.onPanSessionStart,i=e.visualElement,a=t||n||r||o,s=cr.useRef(null),l=cr.useContext(Xv).transformPagePoint,u={onSessionStart:o,onStart:n,onMove:t,onEnd:function(e,t){s.current=null,r&&r(e,t)}};cr.useEffect((function(){null!==s.current&&s.current.updateHandlers(u)})),sy(i,"pointerdown",a&&function(e){s.current=new yk(e,u,{transformPagePoint:l})}),vy((function(){return s.current&&s.current.end()}))})),drag:ew((function(e){var t=e.dragControls,n=e.visualElement,r=fg((function(){return new tx(n)}));cr.useEffect((function(){return t&&t.subscribe(r)}),[r,t]),cr.useEffect((function(){return r.addListeners()}),[r])}))};function ix(e){return"string"==typeof e&&e.startsWith("var(--")}var ax=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function sx(e){var t=ax.exec(e);if(!t)return[,];var n=yn(t,3);return[n[1],n[2]]}function lx(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=sx(e),o=yn(r,2),i=o[0],a=o[1];if(i){var s=window.getComputedStyle(t).getPropertyValue(i);return s?s.trim():ix(a)?lx(a,t,n+1):a}}var ux,cx=new Set(["width","height","top","left","right","bottom","x","y"]),dx=function(e){return cx.has(e)},fx=function(e,t){e.set(t,!1),e.set(t)},hx=function(e){return e===jg||e===Ug};!function(e){e.width="width",e.height="height",e.left="left",e.right="right",e.top="top",e.bottom="bottom"}(ux||(ux={}));var px=function(e,t){return parseFloat(e.split(", ")[t])},vx=function(e,t){return function(n,r){var o=r.transform;if("none"===o||!o)return 0;var i=o.match(/^matrix3d\((.+)\)$/);if(i)return px(i[1],t);var a=o.match(/^matrix\((.+)\)$/);return a?px(a[1],e):0}},gx=new Set(["x","y","z"]),mx=Cg.filter((function(e){return!gx.has(e)}));function yx(e){var t=[];return mx.forEach((function(n){var r=e.getValue(n);void 0!==r&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))})),t.length&&e.render(),t}var bx={width:function(e,t){var n=e.x,r=t.paddingLeft,o=void 0===r?"0":r,i=t.paddingRight,a=void 0===i?"0":i;return n.max-n.min-parseFloat(o)-parseFloat(a)},height:function(e,t){var n=e.y,r=t.paddingTop,o=void 0===r?"0":r,i=t.paddingBottom,a=void 0===i?"0":i;return n.max-n.min-parseFloat(o)-parseFloat(a)},top:function(e,t){var n=t.top;return parseFloat(n)},left:function(e,t){var n=t.left;return parseFloat(n)},bottom:function(e,t){var n=e.y,r=t.top;return parseFloat(r)+(n.max-n.min)},right:function(e,t){var n=e.x,r=t.left;return parseFloat(r)+(n.max-n.min)},x:vx(4,13),y:vx(5,14)},wx=function(e,t,n){var r=t.measureViewportBox(),o=t.current,i=getComputedStyle(o),a=i.display,s={};"none"===a&&t.setStaticValue("display",e.display||"block"),n.forEach((function(e){s[e]=bx[e](r,i)})),t.render();var l=t.measureViewportBox();return n.forEach((function(n){var r=t.getValue(n);fx(r,s[n]),e[n]=bx[n](l,i)})),e};function kx(e,t,n,r){return function(e){return Object.keys(e).some(dx)}(t)?function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};t=un({},t),r=un({},r);var o=Object.keys(t).filter(dx),i=[],a=!1,s=[];if(o.forEach((function(o){var l=e.getValue(o);if(e.hasValue(o)){var u,c=n[o],d=Qw(c),f=t[o];if(Bm(f)){var h=f.length,p=null===f[0]?1:0;c=f[p],d=Qw(c);for(var v=p;v=0?window.pageYOffset:null,u=wx(t,e,s);return i.length&&i.forEach((function(t){var n=yn(t,2),r=n[0],o=n[1];e.getValue(r).set(o)})),e.render(),Qv&&null!==l&&window.scrollTo({top:l}),{target:u,transitionEnd:r}}return{target:t,transitionEnd:r}}(e,t,n,r):{target:t,transitionEnd:r}}var xx=function(e,t,n,r){var o=function(e,t,n){var r=Object.assign({},(Kt(t),t)),o=e.current;if(!(o instanceof Element))return{target:r,transitionEnd:n};for(var i in n&&(n=un({},n)),e.values.forEach((function(e){var t=e.get();if(ix(t)){var n=lx(t,o);n&&e.set(n)}})),r){var a=r[i];if(ix(a)){var s=lx(a,o);s&&(r[i]=s,n&&void 0===n[i]&&(n[i]=a))}}return{target:r,transitionEnd:n}}(e,t,r);return kx(e,t=o.target,n,r=o.transitionEnd)},Sx={current:null},Cx={current:!1};var _x=Object.keys(dg),Ex=_x.length,Px=["AnimationStart","AnimationComplete","Update","Unmount","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Lx=function(){function e(t){var n=this,r=t.parent,o=t.props,i=t.reducedMotionConfig,a=t.visualState,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};an(this,e),this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.isPresent=!0,this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=function(){return n.notify("Update",n.latestValues)},this.render=function(){n.current&&(n.triggerBuild(),n.renderInstance(n.current,n.renderState,n.props.style,n.projection))},this.scheduleRender=function(){return Pw.render(n.render,!1,!0)};var l=a.latestValues,u=a.renderState;this.latestValues=l,this.baseTarget=un({},l),this.initialValues=o.initial?un({},l):{},this.renderState=u,this.parent=r,this.props=o,this.depth=r?r.depth+1:0,this.reducedMotionConfig=i,this.options=s,this.isControllingVariants=ag(o),this.isVariantNode=sg(o),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(r&&r.current);var c=this.scrapeMotionValuesFromProps(o),d=c.willChange,f=sn(c,h);for(var p in f){var v=f[p];void 0!==l[p]&&Pg(v)&&(v.set(l[p],!1),ik(d)&&d.add(p))}}return on(e,[{key:"scrapeMotionValuesFromProps",value:function(e){return{}}},{key:"mount",value:function(e){var t,n=this;this.current=e,this.projection&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=null===(t=this.parent)||void 0===t?void 0:t.addVariantChild(this)),this.values.forEach((function(e,t){return n.bindToMotionValue(t,e)})),Cx.current||function(){if(Cx.current=!0,Qv)if(window.matchMedia){var e=window.matchMedia("(prefers-reduced-motion)"),t=function(){return Sx.current=e.matches};e.addListener(t),t()}else Sx.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Sx.current),this.parent&&this.parent.children.add(this),this.setProps(this.props)}},{key:"unmount",value:function(){var e,t,n;for(var r in null===(e=this.projection)||void 0===e||e.unmount(),Lw.update(this.notifyUpdate),Lw.render(this.render),this.valueSubscriptions.forEach((function(e){return e()})),null===(t=this.removeFromVariantTree)||void 0===t||t.call(this),null===(n=this.parent)||void 0===n||n.children.delete(this),this.events)this.events[r].clear();this.current=null}},{key:"bindToMotionValue",value:function(e,t){var n=this,r=_g.has(e),o=t.onChange((function(t){n.latestValues[e]=t,n.props.onUpdate&&Pw.update(n.notifyUpdate,!1,!0),r&&n.projection&&(n.projection.isProjectionDirty=!0)})),i=t.onRenderRequest(this.scheduleRender);this.valueSubscriptions.set(e,(function(){o(),i()}))}},{key:"sortNodePosition",value:function(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}},{key:"loadFeatures",value:function(e,t,n,r,o,i){for(var a=this,s=[],l=0;l1&&void 0!==arguments[1])||arguments[1];return this.makeTargetAnimatableFromInstance(e,this.props,t)}},{key:"setProps",value:function(e){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.props=e;for(var t=0;t0&&void 0!==arguments[0]&&arguments[0];if(n)return null===(e=this.parent)||void 0===e?void 0:e.getVariantContext();if(!this.isControllingVariants){var r=(null===(t=this.parent)||void 0===t?void 0:t.getVariantContext())||{};return void 0!==this.props.initial&&(r.initial=this.props.initial),r}for(var o={},i=0;i1?r-1:0),i=1;i5)return o;var l=lm.createTransformer(e),u="number"!=typeof s[0]?1:0,c=r.x.scale*n.x,d=r.y.scale*n.y;s[0+u]/=c,s[1+u]/=d;var f=Py(c,d,.5);"number"==typeof s[2+u]&&(s[2+u]/=f),"number"==typeof s[3+u]&&(s[3+u]/=f);var h=l(s);if(i){var p=0;h=h.replace(zx,(function(){var e=a[p];return p++,e}))}return h}},Bx=function(e){pn(n,e);var t=Qt(n);function n(){return an(this,n),t.apply(this,arguments)}return on(n,[{key:"componentDidMount",value:function(){var e,t=this,n=this.props,r=n.visualElement,o=n.layoutGroup,i=n.switchLayoutGroup,a=n.layoutId,s=r.projection;e=Fx,Object.assign(Sg,e),s&&(o.group&&o.group.add(s),i&&i.register&&a&&i.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",(function(){t.safeToRemove()})),s.setOptions(un(un({},s.options),{},{onExitComplete:function(){return t.safeToRemove()}}))),hg.hasEverUpdated=!0}},{key:"getSnapshotBeforeUpdate",value:function(e){var t=this,n=this.props,r=n.layoutDependency,o=n.visualElement,i=n.drag,a=n.isPresent,s=o.projection;return s?(s.isPresent=a,i||e.layoutDependency!==r||void 0===r?s.willUpdate():this.safeToRemove(),e.isPresent!==a&&(a?s.promote():s.relegate()||Pw.postRender((function(){var e;(null===(e=s.getStack())||void 0===e?void 0:e.members.length)||t.safeToRemove()}))),null):null}},{key:"componentDidUpdate",value:function(){var e=this.props.visualElement.projection;e&&(e.root.didUpdate(),!e.currentAnimation&&e.isLead()&&this.safeToRemove())}},{key:"componentWillUnmount",value:function(){var e=this.props,t=e.visualElement,n=e.layoutGroup,r=e.switchLayoutGroup,o=t.projection;o&&(o.scheduleCheckAfterUnmount(),(null==n?void 0:n.group)&&n.group.remove(o),(null==r?void 0:r.deregister)&&r.deregister(o))}},{key:"safeToRemove",value:function(){var e=this.props.safeToRemove;null==e||e()}},{key:"render",value:function(){return null}}]),n}(qr.Component);var Fx={borderRadius:un(un({},Dx),{},{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:Dx,borderTopRightRadius:Dx,borderBottomLeftRadius:Dx,borderBottomRightRadius:Dx,boxShadow:jx},Hx={measureLayout:function(e){var t=yn(nw(),2),n=t[0],r=t[1],o=cr.useContext(vg);return qr.createElement(Bx,un(un({},e),{},{layoutGroup:o,switchLayoutGroup:cr.useContext(mg),isPresent:n,safeToRemove:r}))}};function Vx(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Pg(e)?e:Xw(e);return Vw("",r,t,n),{stop:function(){return r.stop()},isAnimating:function(){return r.isAnimating()}}}var Wx=["TopLeft","TopRight","BottomLeft","BottomRight"],Ux=Wx.length,Gx=function(e){return"string"==typeof e?parseFloat(e):e},qx=function(e){return"number"==typeof e||Ug.test(e)};function Yx(e,t,n,r,o,i){var a,s,l,u;o?(e.opacity=Py(0,null!==(a=n.opacity)&&void 0!==a?a:1,Xx(r)),e.opacityExit=Py(null!==(s=t.opacity)&&void 0!==s?s:1,0,$x(r))):i&&(e.opacity=Py(null!==(l=t.opacity)&&void 0!==l?l:1,null!==(u=n.opacity)&&void 0!==u?u:1,r));for(var c=0;ct?1:n(Ey(e,t,r))}}function Qx(e,t){e.min=t.min,e.max=t.max}function Jx(e,t){Qx(e.x,t.x),Qx(e.y,t.y)}function eS(e,t,n,r,o){return e=Uk(e-=t,1/n,r),void 0!==o&&(e=Uk(e,1/o,r)),e}function tS(e,t,n,r,o){var i=yn(n,3),a=i[0],s=i[1],l=i[2];!function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5,o=arguments.length>4?arguments[4]:void 0,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:e,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:e;if(Wg.test(t)){t=parseFloat(t),t=Py(a.min,a.max,t/100)-a.min}if("number"==typeof t){var s=Py(i.min,i.max,r);e===i&&(s-=t),e.min=eS(e.min,t,n,s,o),e.max=eS(e.max,t,n,s,o)}}(e,t[a],t[s],t[l],t.scale,r,o)}var nS=["x","scaleX","originX"],rS=["y","scaleY","originY"];function oS(e,t,n,r){tS(e.x,t,nS,null==n?void 0:n.x,null==r?void 0:r.x),tS(e.y,t,rS,null==n?void 0:n.y,null==r?void 0:r.y)}function iS(e){return 0===e.translate&&1===e.scale}function aS(e){return iS(e.x)&&iS(e.y)}function sS(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}function lS(e){return _k(e.x)/_k(e.y)}var uS=function(){function e(){an(this,e),this.members=[]}return on(e,[{key:"add",value:function(e){Gw(this.members,e),e.scheduleRender()}},{key:"remove",value:function(e){if(qw(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){var t=this.members[this.members.length-1];t&&this.promote(t)}}},{key:"relegate",value:function(e){var t,n=this.members.findIndex((function(t){return e===t}));if(0===n)return!1;for(var r=n;r>=0;r--){var o=this.members[r];if(!1!==o.isPresent){t=o;break}}return!!t&&(this.promote(t),!0)}},{key:"promote",value:function(e,t){var n,r=this.lead;e!==r&&(this.prevLead=r,this.lead=e,e.show(),r&&(r.instance&&r.scheduleRender(),e.scheduleRender(),e.resumeFrom=r,t&&(e.resumeFrom.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),(null===(n=e.root)||void 0===n?void 0:n.isUpdating)&&(e.isLayoutDirty=!0),!1===e.options.crossfade&&r.hide()))}},{key:"exitAnimationComplete",value:function(){this.members.forEach((function(e){var t,n,r,o,i;null===(n=(t=e.options).onExitComplete)||void 0===n||n.call(t),null===(i=null===(r=e.resumingFrom)||void 0===r?void 0:(o=r.options).onExitComplete)||void 0===i||i.call(o)}))}},{key:"scheduleRender",value:function(){this.members.forEach((function(e){e.instance&&e.scheduleRender(!1)}))}},{key:"removeLeadSnapshot",value:function(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}]),e}();function cS(e,t,n){var r="",o=e.x.translate/t.x,i=e.y.translate/t.y;if((o||i)&&(r="translate3d(".concat(o,"px, ").concat(i,"px, 0) ")),1===t.x&&1===t.y||(r+="scale(".concat(1/t.x,", ").concat(1/t.y,") ")),n){var a=n.rotate,s=n.rotateX,l=n.rotateY;a&&(r+="rotate(".concat(a,"deg) ")),s&&(r+="rotateX(".concat(s,"deg) ")),l&&(r+="rotateY(".concat(l,"deg) "))}var u=e.x.scale*t.x,c=e.y.scale*t.y;return 1===u&&1===c||(r+="scale(".concat(u,", ").concat(c,")")),r||"none"}var dS=function(e,t){return e.depth-t.depth},fS=function(){function e(){an(this,e),this.children=[],this.isDirty=!1}return on(e,[{key:"add",value:function(e){Gw(this.children,e),this.isDirty=!0}},{key:"remove",value:function(e){qw(this.children,e),this.isDirty=!0}},{key:"forEach",value:function(e){this.isDirty&&this.children.sort(dS),this.isDirty=!1,this.children.forEach(e)}}]),e}(),hS=["","X","Y","Z"],pS=0;function vS(e){var t=e.attachResizeListener,n=e.defaultParent,r=e.measureScroll,o=e.checkIsScrollRoot,i=e.resetTransform;return function(){function e(t){var r=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null==n?void 0:n();an(this,e),this.id=pS++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=function(){r.isUpdating&&(r.isUpdating=!1,r.clearAllSnapshots())},this.updateProjection=function(){r.nodes.forEach(xS),r.nodes.forEach(SS)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.elementId=t,this.latestValues=o,this.root=i?i.root||i:this,this.path=i?[].concat(cn(i.path),[i]):[],this.parent=i,this.depth=i?i.depth+1:0,t&&this.root.registerPotentialNode(t,this);for(var a=0;a1?n-1:0),o=1;o1&&void 0!==arguments[1]&&arguments[1];if(!this.instance){this.isSVG=e instanceof SVGElement&&"svg"!==e.tagName,this.instance=e;var i=this.options,a=i.layoutId,s=i.layout,l=i.visualElement;if(l&&!l.current&&l.mount(e),this.root.nodes.add(this),null===(n=this.parent)||void 0===n||n.children.add(this),this.elementId&&this.root.potentialNodes.delete(this.elementId),o&&(s||a)&&(this.isLayoutDirty=!0),t){var u,c=function(){return r.root.updateBlockedByResize=!1};t(e,(function(){r.root.updateBlockedByResize=!0,u&&u(),u=Rw(c,250),hg.hasAnimatedSinceResize&&(hg.hasAnimatedSinceResize=!1,r.nodes.forEach(kS))}))}a&&this.root.registerSharedNode(a,this),!1!==this.options.animate&&l&&(a||s)&&this.addEventListener("didUpdate",(function(e){var t,n,o,i,a,s=e.delta,u=e.hasLayoutChanged,c=e.hasRelativeTargetChanged,d=e.layout;if(r.isTreeAnimationBlocked())return r.target=void 0,void(r.relativeTarget=void 0);var f=null!==(n=null!==(t=r.options.transition)&&void 0!==t?t:l.getDefaultTransition())&&void 0!==n?n:AS,h=l.getProps(),p=h.onLayoutAnimationStart,v=h.onLayoutAnimationComplete,g=!r.targetLayout||!sS(r.targetLayout,d)||c,m=!u&&c;if((null===(o=r.resumeFrom)||void 0===o?void 0:o.instance)||m||u&&(g||!r.currentAnimation)){r.resumeFrom&&(r.resumingFrom=r.resumeFrom,r.resumingFrom.resumingFrom=void 0),r.setAnimationOrigin(s,m);var y=un(un({},Hw(f,"layout")),{},{onPlay:p,onComplete:v});l.shouldReduceMotion&&(y.delay=0,y.type=!1),r.startAnimation(y)}else u||0!==r.animationProgress||kS(r),r.isLead()&&(null===(a=(i=r.options).onExitComplete)||void 0===a||a.call(i));r.targetLayout=d}))}}},{key:"unmount",value:function(){var e,t;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),null===(e=this.getStack())||void 0===e||e.remove(this),null===(t=this.parent)||void 0===t||t.children.delete(this),this.instance=void 0,Lw.preRender(this.updateProjection)}},{key:"blockUpdate",value:function(){this.updateManuallyBlocked=!0}},{key:"unblockUpdate",value:function(){this.updateManuallyBlocked=!1}},{key:"isUpdateBlocked",value:function(){return this.updateManuallyBlocked||this.updateBlockedByResize}},{key:"isTreeAnimationBlocked",value:function(){var e;return this.isAnimationBlocked||(null===(e=this.parent)||void 0===e?void 0:e.isTreeAnimationBlocked())||!1}},{key:"startUpdate",value:function(){var e;this.isUpdateBlocked()||(this.isUpdating=!0,null===(e=this.nodes)||void 0===e||e.forEach(CS),this.animationId++)}},{key:"willUpdate",value:function(){var e,t,n,r=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.root.isUpdateBlocked())null===(t=(e=this.options).onExitComplete)||void 0===t||t.call(e);else if(!this.root.isUpdating&&this.root.startUpdate(),!this.isLayoutDirty){this.isLayoutDirty=!0;for(var o=0;o0&&void 0!==arguments[0]?arguments[0]:"measure",t=Boolean(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&(this.scroll={animationId:this.root.animationId,phase:e,isRoot:o(this.instance),offset:r(this.instance)})}},{key:"resetTransform",value:function(){var e;if(i){var t=this.isLayoutDirty||this.shouldResetTransform,n=this.projectionDelta&&!aS(this.projectionDelta),r=null===(e=this.options.visualElement)||void 0===e?void 0:e.getProps().transformTemplate,o=null==r?void 0:r(this.latestValues,""),a=o!==this.prevTransformTemplateValue;t&&(n||Hk(this.latestValues)||a)&&(i(this.instance,o),this.shouldResetTransform=!1,this.scheduleRender())}}},{key:"measure",value:function(){var e,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=this.measurePageBox(),r=this.removeElementScroll(n);t&&(r=this.removeTransform(r)),IS(r);var o=null===(e=this.options.visualElement)||void 0===e?void 0:e.readValue("position"),i="fixed"===o||"sticky"===o?o:"static";return{animationId:this.root.animationId,measuredBox:n,layoutBox:r,latestValues:{},source:this.id,position:i}}},{key:"measurePageBox",value:function(){var e=this.options.visualElement;if(!e)return{x:{min:0,max:0},y:{min:0,max:0}};var t=e.measureViewportBox(),n=this.root.scroll;return n&&(Zk(t.x,n.offset.x),Zk(t.y,n.offset.y)),t}},{key:"removeElementScroll",value:function(e){var t={x:{min:0,max:0},y:{min:0,max:0}};Jx(t,e);for(var n=0;n1&&void 0!==arguments[1]&&arguments[1],n={x:{min:0,max:0},y:{min:0,max:0}};Jx(n,e);for(var r=0;r3&&void 0!==arguments[3]&&arguments[3],a=n.length;if(a){var s,l;t.x=t.y=1;for(var u=0;u0&&void 0!==arguments[0])||arguments[0];null===(t=(e=this.options).scheduleRender)||void 0===t||t.call(e),r&&(null===(n=this.getStack())||void 0===n||n.scheduleRender()),this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}},{key:"setAnimationOrigin",value:function(e){var t,n,r=this,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.snapshot,a=(null==i?void 0:i.latestValues)||{},s=un({},this.latestValues),l={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeTarget=this.relativeTargetOrigin=void 0,this.attemptToResolveRelativeTarget=!o;var u={x:{min:0,max:0},y:{min:0,max:0}},c=(null==i?void 0:i.source)!==(null===(t=this.layout)||void 0===t?void 0:t.source),d=((null===(n=this.getStack())||void 0===n?void 0:n.members.length)||0)<=1,f=Boolean(c&&!d&&!0===this.options.crossfade&&!this.path.some(OS));this.animationProgress=0,this.mixTargetDelta=function(t){var n,o=t/1e3;ES(l.x,e.x,o),ES(l.y,e.y,o),r.setTargetDelta(l),r.relativeTarget&&r.relativeTargetOrigin&&r.layout&&(null===(n=r.relativeParent)||void 0===n?void 0:n.layout)&&(Mk(u,r.layout.layoutBox,r.relativeParent.layout.layoutBox),LS(r.relativeTarget,r.relativeTargetOrigin,u,o)),c&&(r.animationValues=s,Yx(s,a,r.latestValues,o,f,d)),r.root.scheduleUpdateProjection(),r.scheduleRender(),r.animationProgress=o},this.mixTargetDelta(0)}},{key:"startAnimation",value:function(e){var t,n,r=this;this.notifyListeners("animationStart"),null===(t=this.currentAnimation)||void 0===t||t.stop(),this.resumingFrom&&(null===(n=this.resumingFrom.currentAnimation)||void 0===n||n.stop()),this.pendingAnimation&&(Lw.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Pw.update((function(){hg.hasAnimatedSinceResize=!0,r.currentAnimation=Vx(0,1e3,un(un({},e),{},{onUpdate:function(t){var n;r.mixTargetDelta(t),null===(n=e.onUpdate)||void 0===n||n.call(e,t)},onComplete:function(){var t;null===(t=e.onComplete)||void 0===t||t.call(e),r.completeAnimation()}})),r.resumingFrom&&(r.resumingFrom.currentAnimation=r.currentAnimation),r.pendingAnimation=void 0}))}},{key:"completeAnimation",value:function(){var e;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),null===(e=this.getStack())||void 0===e||e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}},{key:"finishAnimation",value:function(){var e;this.currentAnimation&&(null===(e=this.mixTargetDelta)||void 0===e||e.call(this,1e3),this.currentAnimation.stop()),this.completeAnimation()}},{key:"applyTransformsToTarget",value:function(){var e=this.getLead(),t=e.targetWithTransforms,n=e.target,r=e.layout,o=e.latestValues;if(t&&n&&r){if(this!==e&&this.layout&&r&&RS(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};var i=_k(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+i;var a=_k(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+a}Jx(t,n),Qk(t,o),Lk(this.projectionDeltaWithTransform,this.layoutCorrected,t,o)}}},{key:"registerSharedNode",value:function(e,t){var n,r,o;this.sharedNodes.has(e)||this.sharedNodes.set(e,new uS),this.sharedNodes.get(e).add(t),t.promote({transition:null===(n=t.options.initialPromotionConfig)||void 0===n?void 0:n.transition,preserveFollowOpacity:null===(o=null===(r=t.options.initialPromotionConfig)||void 0===r?void 0:r.shouldPreserveFollowOpacity)||void 0===o?void 0:o.call(r,t)})}},{key:"isLead",value:function(){var e=this.getStack();return!e||e.lead===this}},{key:"getLead",value:function(){var e;return this.options.layoutId&&(null===(e=this.getStack())||void 0===e?void 0:e.lead)||this}},{key:"getPrevLead",value:function(){var e;return this.options.layoutId?null===(e=this.getStack())||void 0===e?void 0:e.prevLead:void 0}},{key:"getStack",value:function(){var e=this.options.layoutId;if(e)return this.root.sharedNodes.get(e)}},{key:"promote",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.needsReset,n=e.transition,r=e.preserveFollowOpacity,o=this.getStack();o&&o.promote(this,r),t&&(this.projectionDelta=void 0,this.needsReset=!0),n&&this.setOptions({transition:n})}},{key:"relegate",value:function(){var e=this.getStack();return!!e&&e.relegate(this)}},{key:"resetRotation",value:function(){var e=this.options.visualElement;if(e){var t=!1,n=e.latestValues;if((n.rotate||n.rotateX||n.rotateY||n.rotateZ)&&(t=!0),t){for(var r={},o=0;o0&&void 0!==arguments[0]?arguments[0]:{},o={};if(!this.instance||this.isSVG)return o;if(!this.isVisible)return{visibility:"hidden"};o.visibility="";var i=null===(e=this.options.visualElement)||void 0===e?void 0:e.getProps().transformTemplate;if(this.needsReset)return this.needsReset=!1,o.opacity="",o.pointerEvents=Hm(r.pointerEvents)||"",o.transform=i?i(this.latestValues,""):"none",o;var a=this.getLead();if(!this.projectionDelta||!this.layout||!a.target){var s={};return this.options.layoutId&&(s.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,s.pointerEvents=Hm(r.pointerEvents)||""),this.hasProjected&&!Hk(this.latestValues)&&(s.transform=i?i({},""):"none",this.hasProjected=!1),s}var l=a.animationValues||a.latestValues;this.applyTransformsToTarget(),o.transform=cS(this.projectionDeltaWithTransform,this.treeScale,l),i&&(o.transform=i(l,o.transform));var u=this.projectionDelta,c=u.x,d=u.y;for(var f in o.transformOrigin="".concat(100*c.origin,"% ").concat(100*d.origin,"% 0"),a.animationValues?o.opacity=a===this?null!==(n=null!==(t=l.opacity)&&void 0!==t?t:this.latestValues.opacity)&&void 0!==n?n:1:this.preserveOpacity?this.latestValues.opacity:l.opacityExit:o.opacity=a===this?void 0!==l.opacity?l.opacity:"":void 0!==l.opacityExit?l.opacityExit:0,Sg)if(void 0!==l[f]){var h=Sg[f],p=h.correct,v=h.applyTo,g=p(l[f],a);if(v)for(var m=v.length,y=0;y=0;r--)if(Boolean(e.path[r].instance)){n=e.path[r];break}var o=(n&&n!==e.root?n.instance:document).querySelector('[data-projection-id="'.concat(t,'"]'));o&&e.mount(o,!0)}function TS(e){e.min=Math.round(e.min),e.max=Math.round(e.max)}function IS(e){TS(e.x),TS(e.y)}function RS(e,t,n){return"position"===e||"preserve-aspect"===e&&!function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1;return Nb(e,t)<=n}(lS(t),lS(n),.2)}var NS=vS({attachResizeListener:function(e,t){return Ym(e,"resize",t)},measureScroll:function(){return{x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}},checkIsScrollRoot:function(){return!0}}),DS={current:void 0},zS=vS({measureScroll:function(e){return{x:e.scrollLeft,y:e.scrollTop}},defaultParent:function(){if(!DS.current){var e=new NS(0,{});e.mount(window),e.setOptions({layoutScroll:!0}),DS.current=e}return DS.current},resetTransform:function(e,t){e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:function(e){return Boolean("fixed"===window.getComputedStyle(e).position)}}),jS=un(un(un(un({},mk),tw),ox),Hx),BS=wg((function(e,t){return function(e,t,n,r,o){var i=t.forwardMotionProps,a=void 0!==i&&i;return un(un({},xg(e)?Gm:qm),{},{preloadedFeatures:n,useRender:Mm(a),createVisualElement:r,projectionNodeConstructor:o,Component:e})}(e,t,jS,Rx,zS)}));function FS(){var e=cr.useRef(!1);return Jv((function(){return e.current=!0,function(){e.current=!1}}),[]),e}var HS=function(e){pn(n,e);var t=Qt(n);function n(){return an(this,n),t.apply(this,arguments)}return on(n,[{key:"getSnapshotBeforeUpdate",value:function(e){var t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){var n=this.props.sizeRef.current;n.height=t.offsetHeight||0,n.width=t.offsetWidth||0,n.top=t.offsetTop,n.left=t.offsetLeft}return null}},{key:"componentDidUpdate",value:function(){}},{key:"render",value:function(){return this.props.children}}]),n}(cr.Component);function VS(e){var t=e.children,n=e.isPresent,r=cr.useId(),o=cr.useRef(null),i=cr.useRef({width:0,height:0,top:0,left:0});return cr.useInsertionEffect((function(){var e=i.current,t=e.width,a=e.height,s=e.top,l=e.left;if(!n&&o.current&&t&&a){o.current.dataset.motionPopId=r;var u=document.createElement("style");return document.head.appendChild(u),u.sheet&&u.sheet.insertRule('\n [data-motion-pop-id="'.concat(r,'"] {\n position: absolute !important;\n width: ').concat(t,"px !important;\n height: ").concat(a,"px !important;\n top: ").concat(s,"px !important;\n left: ").concat(l,"px !important;\n }\n ")),function(){document.head.removeChild(u)}}}),[n]),cr.createElement(HS,{isPresent:n,childRef:o,sizeRef:i},cr.cloneElement(t,{ref:o}))}var WS=function(e){var t=e.children,n=e.initial,r=e.isPresent,o=e.onExitComplete,i=e.custom,a=e.presenceAffectsLayout,s=e.mode,l=fg(US),u=cr.useId(),c=cr.useMemo((function(){return{id:u,initial:n,isPresent:r,custom:i,onExitComplete:function(e){l.set(e,!0);var t,n=xn(l.values());try{for(n.s();!(t=n.n()).done;){if(!t.value)return}}catch(r){n.e(r)}finally{n.f()}o&&o()},register:function(e){return l.set(e,!1),function(){return l.delete(e)}}}}),a?void 0:[r]);return cr.useMemo((function(){l.forEach((function(e,t){return l.set(t,!1)}))}),[r]),cr.useEffect((function(){!r&&!l.size&&o&&o()}),[r]),"popLayout"===s&&(t=cr.createElement(VS,{isPresent:r},t)),cr.createElement(Kv.Provider,{value:c},t)};function US(){return new Map}var GS=function(e){return e.key||""};var qS=function(e){var t=e.children,n=e.custom,r=e.initial,o=void 0===r||r,i=e.onExitComplete,a=e.exitBeforeEnter,s=e.presenceAffectsLayout,l=void 0===s||s,u=e.mode,c=void 0===u?"sync":u;a&&(c="wait",Gb(!1,"Replace exitBeforeEnter with mode='wait'"));var d=function(){var e=FS(),t=yn(cr.useState(0),2),n=t[0],r=t[1],o=cr.useCallback((function(){e.current&&r(n+1)}),[n]);return[cr.useCallback((function(){return Pw.postRender(o)}),[o]),n]}(),f=yn(d,1)[0],h=cr.useContext(vg).forceRender;h&&(f=h);var p=FS(),v=function(e){var t=[];return cr.Children.forEach(e,(function(e){cr.isValidElement(e)&&t.push(e)})),t}(t),g=v,m=new Set,y=cr.useRef(g),b=cr.useRef(new Map).current,w=cr.useRef(!0);if(Jv((function(){w.current=!1,function(e,t){e.forEach((function(e){var n=GS(e);t.set(n,e)}))}(v,b),y.current=g})),vy((function(){w.current=!0,b.clear(),m.clear()})),w.current)return cr.createElement(cr.Fragment,null,g.map((function(e){return cr.createElement(WS,{key:GS(e),isPresent:!0,initial:!!o&&void 0,presenceAffectsLayout:l,mode:c},e)})));g=cn(g);for(var k=y.current.map(GS),x=v.map(GS),S=k.length,C=0;C1&&console.warn('You\'re attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.'),cr.createElement(cr.Fragment,null,m.size?g:g.map((function(e){return cr.cloneElement(e)})))},YS=function(){return YS=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0)&&!(r=i.next()).done;)a.push(r.value)}catch(s){o={error:s}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function QS(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o0},cC={exit:{height:{duration:.2,ease:eC.ease},opacity:{duration:.3,ease:eC.ease}},enter:{height:{duration:.3,ease:eC.ease},opacity:{duration:.4,ease:eC.ease}}},dC={exit:function(e){var t,n=e.animateOpacity,r=e.startingHeight,o=e.transition,i=e.transitionEnd,a=e.delay;return un(un({},n&&{opacity:uC(r)?1:0}),{},{height:r,transitionEnd:null==i?void 0:i.exit,transition:null!==(t=null==o?void 0:o.exit)&&void 0!==t?t:lC(cC.exit,a)})},enter:function(e){var t,n=e.animateOpacity,r=e.endingHeight,o=e.transition,i=e.transitionEnd,a=e.delay;return un(un({},n&&{opacity:1}),{},{height:r,transitionEnd:null==i?void 0:i.enter,transition:null!==(t=null==o?void 0:o.enter)&&void 0!==t?t:sC(cC.enter,a)})}},fC=cr.forwardRef((function(e,t){var n=e.in,r=e.unmountOnExit,o=e.animateOpacity,i=void 0===o||o,a=e.startingHeight,s=void 0===a?0:a,l=e.endingHeight,u=void 0===l?"auto":l,c=e.style,d=e.className,f=e.transition,h=e.transitionEnd,p=sn(e,v),g=yn(cr.useState(!1),2),m=g[0],y=g[1];cr.useEffect((function(){var e=setTimeout((function(){y(!0)}));return function(){return clearTimeout(e)}}),[]),function(e){e.condition,e.message}({condition:Boolean(s>0&&r),message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});var b=parseFloat(s.toString())>0,w={startingHeight:s,endingHeight:u,animateOpacity:i,transition:m?f:{enter:{duration:0}},transitionEnd:{enter:null==h?void 0:h.enter,exit:r?null==h?void 0:h.exit:un(un({},null==h?void 0:h.exit),{},{display:b?"block":"none"})}},k=!r||n,x=n||r?"enter":"exit";return qr.createElement(qS,{initial:!1,custom:w},k&&qr.createElement(BS.div,un(un({ref:t},p),{},{className:JS("chakra-collapse",d),style:un({overflow:"hidden",display:"block"},c),custom:w,variants:dC,initial:!!r&&"exit",animate:x,exit:"exit"})))}));fC.displayName="Collapse";var hC={enter:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.transition,r=t.transitionEnd,o=t.delay;return{opacity:1,transition:null!==(e=null==n?void 0:n.enter)&&void 0!==e?e:sC(aC.enter,o),transitionEnd:null==r?void 0:r.enter}},exit:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.transition,r=t.transitionEnd,o=t.delay;return{opacity:0,transition:null!==(e=null==n?void 0:n.exit)&&void 0!==e?e:lC(aC.exit,o),transitionEnd:null==r?void 0:r.exit}}},pC={initial:"exit",animate:"enter",exit:"exit",variants:hC},vC=cr.forwardRef((function(e,t){var n=e.unmountOnExit,r=e.in,o=e.className,i=e.transition,a=e.transitionEnd,s=e.delay,l=sn(e,g),u=r||n?"enter":"exit",c=!n||r&&n,d={transition:i,transitionEnd:a,delay:s};return qr.createElement(qS,{custom:d},c&&qr.createElement(BS.div,un(un({ref:t,className:JS("chakra-fade",o),custom:d},pC),{},{animate:u},l)))}));vC.displayName="Fade";var gC={exit:function(e){var t,n=e.reverse,r=e.initialScale,o=e.transition,i=e.transitionEnd,a=e.delay;return un(un({opacity:0},n?{scale:r,transitionEnd:null==i?void 0:i.exit}:{transitionEnd:un({scale:r},null==i?void 0:i.exit)}),{},{transition:null!==(t=null==o?void 0:o.exit)&&void 0!==t?t:lC(aC.exit,a)})},enter:function(e){var t,n=e.transitionEnd,r=e.transition,o=e.delay;return{opacity:1,scale:1,transition:null!==(t=null==r?void 0:r.enter)&&void 0!==t?t:sC(aC.enter,o),transitionEnd:null==n?void 0:n.enter}}},mC={initial:"exit",animate:"enter",exit:"exit",variants:gC},yC=cr.forwardRef((function(e,t){var n=e.unmountOnExit,r=e.in,o=e.reverse,i=void 0===o||o,a=e.initialScale,s=void 0===a?.95:a,l=e.className,u=e.transition,c=e.transitionEnd,d=e.delay,f=sn(e,m),h=!n||r&&n,p=r||n?"enter":"exit",v={initialScale:s,reverse:i,transition:u,transitionEnd:c,delay:d};return qr.createElement(qS,{custom:v},h&&qr.createElement(BS.div,un(un({ref:t,className:JS("chakra-offset-slide",l)},mC),{},{animate:p,custom:v},f)))}));yC.displayName="ScaleFade";var bC={exit:{duration:.15,ease:eC.easeInOut},enter:{type:"spring",damping:25,stiffness:180}},wC={exit:function(e){var t,n=e.direction,r=e.transition,o=e.transitionEnd,i=e.delay;return un(un({},iC({direction:n}).exit),{},{transition:null!==(t=null==r?void 0:r.exit)&&void 0!==t?t:lC(bC.exit,i),transitionEnd:null==o?void 0:o.exit})},enter:function(e){var t,n=e.direction,r=e.transitionEnd,o=e.transition,i=e.delay;return un(un({},iC({direction:n}).enter),{},{transition:null!==(t=null==o?void 0:o.enter)&&void 0!==t?t:sC(bC.enter,i),transitionEnd:null==r?void 0:r.enter})}},kC=cr.forwardRef((function(e,t){var n=e.direction,r=void 0===n?"right":n,o=e.style,i=e.unmountOnExit,a=e.in,s=e.className,l=e.transition,u=e.transitionEnd,c=e.delay,d=e.motionProps,f=sn(e,y),h=iC({direction:r}),p=Object.assign({position:"fixed"},h.position,o),v=!i||a&&i,g=a||i?"enter":"exit",m={transitionEnd:u,transition:l,direction:r,delay:c};return qr.createElement(qS,{custom:m},v&&qr.createElement(BS.div,un(un({},f),{},{ref:t,initial:"exit",className:JS("chakra-slide",s),animate:g,exit:"exit",custom:m,variants:wC,style:p},d)))}));kC.displayName="Slide";var xC={initial:function(e){var t,n=e.offsetX,r=e.offsetY,o=e.transition,i=e.transitionEnd,a=e.delay;return{opacity:0,x:n,y:r,transition:null!==(t=null==o?void 0:o.exit)&&void 0!==t?t:lC(aC.exit,a),transitionEnd:null==i?void 0:i.exit}},enter:function(e){var t,n=e.transition,r=e.transitionEnd,o=e.delay;return{opacity:1,x:0,y:0,transition:null!==(t=null==n?void 0:n.enter)&&void 0!==t?t:sC(aC.enter,o),transitionEnd:null==r?void 0:r.enter}},exit:function(e){var t,n=e.offsetY,r=e.offsetX,o=e.transition,i=e.transitionEnd,a=e.reverse,s=e.delay,l={x:r,y:n};return un({opacity:0,transition:null!==(t=null==o?void 0:o.exit)&&void 0!==t?t:lC(aC.exit,s)},a?un(un({},l),{},{transitionEnd:null==i?void 0:i.exit}):{transitionEnd:un(un({},l),null==i?void 0:i.exit)})}},SC={initial:"initial",animate:"enter",exit:"exit",variants:xC},CC=cr.forwardRef((function(e,t){var n=e.unmountOnExit,r=e.in,o=e.reverse,i=void 0===o||o,a=e.className,s=e.offsetX,l=void 0===s?0:s,u=e.offsetY,c=void 0===u?8:u,d=e.transition,f=e.transitionEnd,h=e.delay,p=sn(e,b),v=!n||r&&n,g=r||n?"enter":"exit",m={offsetX:l,offsetY:c,reverse:i,transition:d,transitionEnd:f,delay:h};return qr.createElement(qS,{custom:m},v&&qr.createElement(BS.div,un(un({ref:t,className:JS("chakra-offset-slide",a),custom:m},SC),{},{animate:g},p)))}));CC.displayName="SlideFade";var _C=function(){for(var e=arguments.length,t=new Array(e),n=0;n"}),2),OC=LC[0],AC=LC[1],MC=yn(Av({name:"AccordionItemContext",hookName:"useAccordionItemContext",providerName:""}),2),TC=MC[0],IC=MC[1],RC=yn(Vv(),4),NC=RC[0],DC=(RC[1],RC[2]),zC=RC[3],jC=Cv((function(e,t){var n=(0,IC().getButtonProps)(e,t),r=un({display:"flex",alignItems:"center",width:"100%",outline:0},AC().button);return qr.createElement(Lv.button,un(un({},n),{},{className:_C("chakra-accordion__button",e.className),__css:r}))}));function BC(e){var t=e.onChange,n=e.defaultIndex,r=e.index,o=e.allowMultiple,i=e.allowToggle,a=sn(e,w);!function(e){var t=e.index||e.defaultIndex,n=null!=t&&!Array.isArray(t)&&e.allowMultiple;EC({condition:!!n,message:"If 'allowMultiple' is passed, then 'index' or 'defaultIndex' must be an array. You passed: ".concat(kn(t),",")})}(e),function(e){EC({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"})}(e);var s=DC(),l=yn(cr.useState(-1),2),u=l[0],c=l[1];cr.useEffect((function(){return function(){c(-1)}}),[]);var d=yn(Zv({value:r,defaultValue:function(){return o?null!=n?n:[]:null!=n?n:-1},onChange:t}),2),f=d[0],h=d[1];return{index:f,setIndex:h,htmlProps:a,getAccordionItemProps:function(e){var t=!1;null!==e&&(t=Array.isArray(f)?f.includes(e):f===e);return{isOpen:t,onChange:function(t){if(null!==e)if(o&&Array.isArray(f)){var n=t?f.concat(e):f.filter((function(t){return t!==e}));h(n)}else t?h(e):i&&h(-1)}}},focusedIndex:u,setFocusedIndex:c,descendants:s}}jC.displayName="AccordionButton";var FC=yn(Av({name:"AccordionContext",hookName:"useAccordionContext",providerName:"Accordion"}),2),HC=FC[0],VC=FC[1];function WC(e){var t=e.isDisabled,n=e.isFocusable,r=e.id,o=sn(e,k),i=VC(),a=i.getAccordionItemProps,s=i.setFocusedIndex,l=cr.useRef(null),u=cr.useId(),c=null!=r?r:u,d="accordion-button-".concat(c),f="accordion-panel-".concat(c);!function(e){EC({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.\n "})}(e);var h=zC({disabled:t&&!n}),p=h.register,v=h.index,g=h.descendants,m=a(-1===v?null:v),y=m.isOpen,b=m.onChange;!function(e){EC({condition:e.isOpen&&!!e.isDisabled,message:"Cannot open a disabled accordion item"})}({isOpen:y,isDisabled:t});var w=cr.useCallback((function(){null==b||b(!y),s(v)}),[v,s,y,b]),x=cr.useCallback((function(e){var t={ArrowDown:function(){var e=g.nextEnabled(v);null==e||e.node.focus()},ArrowUp:function(){var e=g.prevEnabled(v);null==e||e.node.focus()},Home:function(){var e=g.firstEnabled();null==e||e.node.focus()},End:function(){var e=g.lastEnabled();null==e||e.node.focus()}},n=t[e.key];n&&(e.preventDefault(),n(e))}),[g,v]),S=cr.useCallback((function(){s(v)}),[s,v]),C=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({},e),{},{type:"button",ref:Tv(p,l,n),id:d,disabled:!!t,"aria-expanded":!!y,"aria-controls":f,onClick:PC(e.onClick,w),onFocus:PC(e.onFocus,S),onKeyDown:PC(e.onKeyDown,x)})}),[d,t,y,w,S,x,f,p]),_=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({},e),{},{ref:t,role:"region",id:f,"aria-labelledby":d,hidden:!y})}),[d,y,f]);return{isOpen:y,isDisabled:t,isFocusable:n,onOpen:function(){null==b||b(!0)},onClose:function(){null==b||b(!1)},getButtonProps:C,getPanelProps:_,htmlProps:o}}function UC(e){var t=IC(),n=t.isOpen,r=t.isDisabled,o=VC().reduceMotion,i=_C("chakra-accordion__icon",e.className),a=un({opacity:r?.4:1,transform:n?"rotate(-180deg)":void 0,transition:o?void 0:"transform 0.2s",transformOrigin:"center"},AC().icon);return qr.createElement(Gv,un({viewBox:"0 0 24 24","aria-hidden":!0,className:i,__css:a},e),qr.createElement("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"}))}UC.displayName="AccordionIcon";var GC=Cv((function(e,t){var n=e.children,r=e.className,o=WC(e),i=o.htmlProps,a=sn(o,x),s=un(un({},AC().container),{},{overflowAnchor:"none"}),l=cr.useMemo((function(){return a}),[a]);return qr.createElement(TC,{value:l},qr.createElement(Lv.div,un(un({ref:t},i),{},{className:_C("chakra-accordion__item",r),__css:s}),"function"==typeof n?n({isExpanded:!!a.isOpen,isDisabled:!!a.isDisabled}):n))}));GC.displayName="AccordionItem";var qC=Cv((function(e,t){var n=e.className,r=e.motionProps,o=sn(e,S),i=VC().reduceMotion,a=IC(),s=a.getPanelProps,l=a.isOpen,u=s(o,t),c=_C("chakra-accordion__panel",n),d=AC();i||delete u.hidden;var f=qr.createElement(Lv.div,un(un({},u),{},{__css:d.panel,className:c}));return i?f:qr.createElement(fC,un({in:l},r),f)}));qC.displayName="AccordionPanel";var YC=Cv((function(e,t){var n=e.children,r=e.reduceMotion,o=sn(e,C),i=Pv("Accordion",o),a=BC(ua(o)),s=a.htmlProps,l=a.descendants,u=sn(a,_),c=cr.useMemo((function(){return un(un({},u),{},{reduceMotion:!!r})}),[u,r]);return qr.createElement(NC,{value:l},qr.createElement(HC,{value:c},qr.createElement(OC,{value:i},qr.createElement(Lv.div,un(un({ref:t},s),{},{className:_C("chakra-accordion",o.className),__css:i.root}),n))))}));YC.displayName="Accordion";var ZC=fl({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),XC=Cv((function(e,t){var n=Ev("Spinner",e),r=ua(e),o=r.label,i=void 0===o?"Loading...":o,a=r.thickness,s=void 0===a?"2px":a,l=r.speed,u=void 0===l?"0.45s":l,c=r.emptyColor,d=void 0===c?"transparent":c,f=r.className,h=sn(r,E),p=function(){for(var e=arguments.length,t=new Array(e),n=0;n"}),2),JC=QC[0],e_=QC[1],t_=yn(Av({name:"AlertStylesContext",hookName:"useAlertStyles",providerName:""}),2),n_=t_[0],r_=t_[1],o_={info:{icon:function(e){return qr.createElement(Gv,un({viewBox:"0 0 24 24"},e),qr.createElement("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"}))},colorScheme:"blue"},warning:{icon:KC,colorScheme:"orange"},success:{icon:function(e){return qr.createElement(Gv,un({viewBox:"0 0 24 24"},e),qr.createElement("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"}))},colorScheme:"green"},error:{icon:KC,colorScheme:"red"},loading:{icon:XC,colorScheme:"blue"}};var i_=Cv((function(e,t){var n,r=ua(e),o=r.status,i=void 0===o?"info":o,a=r.addRole,s=void 0===a||a,l=sn(r,P),u=null!==(n=e.colorScheme)&&void 0!==n?n:function(e){return o_[e].colorScheme}(i),c=Pv("Alert",un(un({},e),{},{colorScheme:u})),d=un({width:"100%",display:"flex",alignItems:"center",position:"relative",overflow:"hidden"},c.container);return qr.createElement(JC,{value:{status:i}},qr.createElement(n_,{value:c},qr.createElement(Lv.div,un(un({role:s?"alert":void 0,ref:t},l),{},{className:$C("chakra-alert",e.className),__css:d}))))}));i_.displayName="Alert";var a_=Cv((function(e,t){var n=un({display:"inline"},r_().description);return qr.createElement(Lv.div,un(un({ref:t},e),{},{className:$C("chakra-alert__desc",e.className),__css:n}))}));function s_(e){var t=e_().status,n=function(e){return o_[e].icon}(t),r=r_(),o="loading"===t?r.spinner:r.icon;return qr.createElement(Lv.span,un(un({display:"inherit"},e),{},{className:$C("chakra-alert__icon",e.className),__css:o}),e.children||qr.createElement(n,{h:"100%",w:"100%"}))}a_.displayName="AlertDescription",s_.displayName="AlertIcon";var l_=Cv((function(e,t){var n=r_();return qr.createElement(Lv.div,un(un({ref:t},e),{},{className:$C("chakra-alert__title",e.className),__css:n.title}))}));l_.displayName="AlertTitle";var u_=Cv((function(e,t){var n=e.htmlWidth,r=e.htmlHeight,o=e.alt,i=sn(e,L);return qr.createElement("img",un({width:n,height:r,ref:t,alt:o},i))}));u_.displayName="NativeImage";var c_=Cv((function(e,t){var n=e.fallbackSrc,r=e.fallback,o=e.src,i=e.srcSet,a=e.align,s=e.fit,l=e.loading,u=e.ignoreFallback,c=e.crossOrigin,d=e.fallbackStrategy,f=void 0===d?"beforeLoadOrError":d,h=e.referrerPolicy,p=sn(e,O),v=null!=l||u||!(void 0!==n||void 0!==r),g=function(e){var t=e.loading,n=e.src,r=e.srcSet,o=e.onLoad,i=e.onError,a=e.crossOrigin,s=e.sizes,l=e.ignoreFallback,u=yn(cr.useState("pending"),2),c=u[0],d=u[1];cr.useEffect((function(){d(n?"loading":"pending")}),[n]);var f=cr.useRef(),h=cr.useCallback((function(){if(n){p();var e=new Image;e.src=n,a&&(e.crossOrigin=a),r&&(e.srcset=r),s&&(e.sizes=s),t&&(e.loading=t),e.onload=function(e){p(),d("loaded"),null==o||o(e)},e.onerror=function(e){p(),d("failed"),null==i||i(e)},f.current=e}}),[n,a,r,s,o,i,t]),p=function(){f.current&&(f.current.onload=null,f.current.onerror=null,f.current=null)};return oo((function(){if(!l)return"loading"===c&&h(),function(){p()}}),[c,h,l]),l?"loaded":c}(un(un({},e),{},{ignoreFallback:v})),m=function(e,t){return"loaded"!==e&&"beforeLoadOrError"===t||"failed"===e&&"onError"===t}(g,f),y=un({ref:t,objectFit:s,objectPosition:a},v?p:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=Object.assign({},e),o=xn(n);try{for(o.s();!(t=o.n()).done;){var i=t.value;i in r&&delete r[i]}}catch(a){o.e(a)}finally{o.f()}return r}(p,["onError","onLoad"]));return m?r||qr.createElement(Lv.img,un({as:u_,className:"chakra-image__placeholder",src:n},y)):qr.createElement(Lv.img,un({as:u_,src:o,srcSet:i,crossOrigin:c,loading:l,referrerPolicy:h,className:"chakra-image"},y))}));function d_(e){return cr.Children.toArray(e).filter((function(e){return cr.isValidElement(e)}))}c_.displayName="Image",Cv((function(e,t){return qr.createElement(Lv.img,un({ref:t,as:u_,className:"chakra-image"},e))}));var f_=function(){for(var e=arguments.length,t=new Array(e),n=0;n *: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}}:{"& > *:not(style) ~ *:not(style)":{marginStart:s}}),qr.createElement(v_,{value:f},qr.createElement(Lv.div,un({ref:t,role:"group",__css:h,className:d,"data-attached":l?"":void 0},c)))}));k_.displayName="ButtonGroup";var x_=Cv((function(e,t){var n=e.icon,r=e.children,o=e.isRound,i=e["aria-label"],a=sn(e,R),s=n||r,l=cr.isValidElement(s)?cr.cloneElement(s,{"aria-hidden":!0,focusable:!1}):null;return qr.createElement(b_,un({padding:"0",borderRadius:o?"full":void 0,ref:t,"aria-label":i},a),l)}));x_.displayName="IconButton";var S_=function(){for(var e=arguments.length,t=new Array(e),n=0;n\" "}),2),L_=P_[0],O_=P_[1],A_=yn(Av({strict:!1,name:"FormControlContext"}),2),M_=A_[0],T_=A_[1];var I_=Cv((function(e,t){var n=Pv("Form",e),r=function(e){var t=e.id,n=e.isRequired,r=e.isInvalid,o=e.isDisabled,i=e.isReadOnly,a=sn(e,N),s=cr.useId(),l=t||"field-".concat(s),u="".concat(l,"-label"),c="".concat(l,"-feedback"),d="".concat(l,"-helptext"),f=yn(cr.useState(!1),2),h=f[0],p=f[1],v=yn(cr.useState(!1),2),g=v[0],m=v[1],y=yn(cr.useState(!1),2),b=y[0],w=y[1],k=cr.useCallback((function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({id:d},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{ref:Tv(e,(function(e){e&&m(!0)}))})}),[d]),x=cr.useCallback((function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({},n),{},{ref:a,"data-focus":C_(b),"data-disabled":C_(o),"data-invalid":C_(r),"data-readonly":C_(i),id:null!==(e=n.id)&&void 0!==e?e:u,htmlFor:null!==(t=n.htmlFor)&&void 0!==t?t:l})}),[l,o,b,r,i,u]),S=cr.useCallback((function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({id:c},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{ref:Tv(e,(function(e){e&&p(!0)})),"aria-live":"polite"})}),[c]),C=cr.useCallback((function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un(un({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),a),{},{ref:e,role:"group"})}),[a]),_=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({},e),{},{ref:t,role:"presentation","aria-hidden":!0,children:e.children||"*"})}),[]);return{isRequired:!!n,isInvalid:!!r,isReadOnly:!!i,isDisabled:!!o,isFocused:!!b,onFocus:function(){return w(!0)},onBlur:function(){return w(!1)},hasFeedbackText:h,setHasFeedbackText:p,hasHelpText:g,setHasHelpText:m,id:l,labelId:u,feedbackId:c,helpTextId:d,htmlProps:a,getHelpTextProps:k,getErrorMessageProps:S,getRootProps:C,getLabelProps:x,getRequiredIndicatorProps:_}}(ua(e)),o=r.getRootProps,i=(r.htmlProps,sn(r,D)),a=S_("chakra-form-control",e.className);return qr.createElement(M_,{value:i},qr.createElement(L_,{value:n},qr.createElement(Lv.div,un(un({},o({},t)),{},{className:a,__css:n.container}))))}));I_.displayName="FormControl";var R_=Cv((function(e,t){var n=T_(),r=O_(),o=S_("chakra-form__helper-text",e.className);return qr.createElement(Lv.div,un(un({},null==n?void 0:n.getHelpTextProps(e,t)),{},{__css:r.helperText,className:o}))}));function N_(e){var t=D_(e),n=t.isDisabled,r=t.isInvalid,o=t.isReadOnly,i=t.isRequired;return un(un({},sn(t,z)),{},{disabled:n,readOnly:o,required:i,"aria-invalid":__(r),"aria-required":__(i),"aria-readonly":__(o)})}function D_(e){var t,n,r,o=T_(),i=e.id,a=e.disabled,s=e.readOnly,l=e.required,u=e.isRequired,c=e.isInvalid,d=e.isReadOnly,f=e.isDisabled,h=e.onFocus,p=e.onBlur,v=sn(e,j),g=e["aria-describedby"]?[e["aria-describedby"]]:[];return(null==o?void 0:o.hasFeedbackText)&&(null==o?void 0:o.isInvalid)&&g.push(o.feedbackId),(null==o?void 0:o.hasHelpText)&&g.push(o.helpTextId),un(un({},v),{},{"aria-describedby":g.join(" ")||void 0,id:null!=i?i:null==o?void 0:o.id,isDisabled:null!==(t=null!=a?a:f)&&void 0!==t?t:null==o?void 0:o.isDisabled,isReadOnly:null!==(n=null!=s?s:d)&&void 0!==n?n:null==o?void 0:o.isReadOnly,isRequired:null!==(r=null!=l?l:u)&&void 0!==r?r:null==o?void 0:o.isRequired,isInvalid:null!=c?c:null==o?void 0:o.isInvalid,onFocus:E_(null==o?void 0:o.onFocus,h),onBlur:E_(null==o?void 0:o.onBlur,p)})}R_.displayName="FormHelperText";var z_=yn(Av({name:"FormErrorStylesContext",errorMessage:"useFormErrorStyles returned is 'undefined'. Seems you forgot to wrap the components in \"\" "}),2),j_=z_[0],B_=z_[1],F_=Cv((function(e,t){var n=Pv("FormError",e),r=ua(e),o=T_();return(null==o?void 0:o.isInvalid)?qr.createElement(j_,{value:n},qr.createElement(Lv.div,un(un({},null==o?void 0:o.getErrorMessageProps(r,t)),{},{className:S_("chakra-form__error-message",e.className),__css:un({display:"flex",alignItems:"center"},n.text)}))):null}));F_.displayName="FormErrorMessage";var H_=Cv((function(e,t){var n=B_(),r=T_();if(!(null==r?void 0:r.isInvalid))return null;var o=S_("chakra-form__error-icon",e.className);return qr.createElement(Gv,un(un({ref:t,"aria-hidden":!0},e),{},{__css:n.icon,className:o}),qr.createElement("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"}))}));H_.displayName="FormErrorIcon";var V_=Cv((function(e,t){var n,r=Ev("FormLabel",e),o=ua(e),i=(o.className,o.children),a=o.requiredIndicator,s=void 0===a?qr.createElement(W_,null):a,l=o.optionalIndicator,u=void 0===l?null:l,c=sn(o,B),d=T_(),f=null!==(n=null==d?void 0:d.getLabelProps(c,t))&&void 0!==n?n:un({ref:t},c);return qr.createElement(Lv.label,un(un({},f),{},{className:S_("chakra-form__label",o.className),__css:un({display:"block",textAlign:"start"},r)}),i,(null==d?void 0:d.isRequired)?s:u)}));V_.displayName="FormLabel";var W_=Cv((function(e,t){var n=T_(),r=O_();if(!(null==n?void 0:n.isRequired))return null;var o=S_("chakra-form__required-indicator",e.className);return qr.createElement(Lv.span,un(un({},null==n?void 0:n.getRequiredIndicatorProps(e,t)),{},{__css:r.requiredIndicator,className:o}))}));function U_(e,t){var n=cr.useRef(!1),r=cr.useRef(!1);cr.useEffect((function(){if(n.current&&r.current)return e();r.current=!0}),t),cr.useEffect((function(){return n.current=!0,function(){n.current=!1}}),[])}W_.displayName="RequiredIndicator";var G_={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};Lv("span",{baseStyle:G_}).displayName="VisuallyHidden",Lv("input",{baseStyle:G_}).displayName="VisuallyHiddenInput";var q_=!1,Y_=null,Z_=!1,X_=new Set,$_="undefined"!=typeof window&&null!=window.navigator&&/^Mac/.test(window.navigator.platform);function K_(e,t){X_.forEach((function(n){return n(e,t)}))}function Q_(e){Z_=!0,function(e){return!(e.metaKey||!$_&&e.altKey||e.ctrlKey)}(e)&&(Y_="keyboard",K_("keyboard",e))}function J_(e){Y_="pointer","mousedown"!==e.type&&"pointerdown"!==e.type||(Z_=!0,K_("pointer",e))}function eE(e){e.target!==window&&e.target!==document&&(Z_||(Y_="keyboard",K_("keyboard",e)),Z_=!1)}function tE(){Z_=!1}function nE(){return"pointer"!==Y_}function rE(e){!function(){if("undefined"!=typeof window&&!q_){var e=HTMLElement.prototype.focus;HTMLElement.prototype.focus=function(){Z_=!0;for(var t=arguments.length,n=new Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:[],r=Object.assign({},e),o=xn(n);try{for(o.s();!(t=o.n()).done;){var i=t.value;i in r&&delete r[i]}}catch(a){o.e(a)}finally{o.f()}return r}function hE(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=D_(e),n=t.isDisabled,r=t.isReadOnly,o=t.isRequired,i=t.isInvalid,a=t.id,s=t.onBlur,l=t.onFocus,u=t["aria-describedby"],c=e.defaultChecked,d=e.isChecked,f=e.isFocusable,h=e.onChange,p=e.isIndeterminate,v=e.name,g=e.value,m=e.tabIndex,y=void 0===m?void 0:m,b=e["aria-label"],w=e["aria-labelledby"],k=e["aria-invalid"],x=sn(e,H),S=fE(x,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),C=Yv(h),_=Yv(s),E=Yv(l),P=cr.useState(!1),L=yn(P,2),O=L[0],A=L[1],M=cr.useState(!1),T=yn(M,2),I=T[0],R=T[1],N=cr.useState(!1),D=yn(N,2),z=D[0],j=D[1],B=cr.useState(!1),F=yn(B,2),V=F[0],W=F[1];cr.useEffect((function(){return rE(A)}),[]);var U=cr.useRef(null),G=cr.useState(!0),q=yn(G,2),Y=q[0],Z=q[1],X=cr.useState(!!c),$=yn(X,2),K=$[0],Q=$[1],J=void 0!==d,ee=J?d:K,te=cr.useCallback((function(e){r||n?e.preventDefault():(J||Q(ee?e.target.checked:!!p||e.target.checked),null==C||C(e))}),[r,n,ee,J,p,C]);oo((function(){U.current&&(U.current.indeterminate=Boolean(p))}),[p]),U_((function(){n&&R(!1)}),[n,R]),oo((function(){var e=U.current;(null==e?void 0:e.form)&&(e.form.onreset=function(){Q(!!c)})}),[]);var ne=n&&!f,re=cr.useCallback((function(e){" "===e.key&&W(!0)}),[W]),oe=cr.useCallback((function(e){" "===e.key&&W(!1)}),[W]);oo((function(){U.current&&(U.current.checked!==ee&&Q(U.current.checked))}),[U.current]);var ie=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=function(e){I&&e.preventDefault(),W(!0)};return un(un({},e),{},{ref:t,"data-active":sE(V),"data-hover":sE(z),"data-checked":sE(ee),"data-focus":sE(I),"data-focus-visible":sE(I&&O),"data-indeterminate":sE(p),"data-disabled":sE(n),"data-invalid":sE(i),"data-readonly":sE(r),"aria-hidden":!0,onMouseDown:lE(e.onMouseDown,o),onMouseUp:lE(e.onMouseUp,(function(){return W(!1)})),onMouseEnter:lE(e.onMouseEnter,(function(){return j(!0)})),onMouseLeave:lE(e.onMouseLeave,(function(){return j(!1)}))})}),[V,ee,n,I,O,z,p,i,r]),ae=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un(un({},S),e),{},{ref:Tv(t,(function(e){e&&Z("LABEL"===e.tagName)})),onClick:lE(e.onClick,(function(){var e;Y||(null==(e=U.current)||e.click(),requestAnimationFrame((function(){var e;null==(e=U.current)||e.focus()})))})),"data-disabled":sE(n),"data-checked":sE(ee),"data-invalid":sE(i)})}),[S,n,ee,i,Y]),se=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({},e),{},{ref:Tv(U,t),type:"checkbox",name:v,value:g,id:a,tabIndex:y,onChange:lE(e.onChange,te),onBlur:lE(e.onBlur,_,(function(){return R(!1)})),onFocus:lE(e.onFocus,E,(function(){return R(!0)})),onKeyDown:lE(e.onKeyDown,re),onKeyUp:lE(e.onKeyUp,oe),required:o,checked:ee,disabled:ne,readOnly:r,"aria-label":b,"aria-labelledby":w,"aria-invalid":k?Boolean(k):i,"aria-describedby":u,"aria-disabled":n,style:G_})}),[v,g,a,te,_,E,re,oe,o,ee,ne,r,b,w,k,i,u,n,y]),le=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({},e),{},{ref:t,onMouseDown:lE(e.onMouseDown,pE),onTouchStart:lE(e.onTouchStart,pE),"data-disabled":sE(n),"data-checked":sE(ee),"data-invalid":sE(i)})}),[ee,n,i]),ue={isInvalid:i,isFocused:I,isChecked:ee,isActive:V,isHovered:z,isIndeterminate:p,isDisabled:n,isReadOnly:r,isRequired:o};return{state:ue,getRootProps:ae,getCheckboxProps:ie,getInputProps:se,getLabelProps:le,htmlProps:S}}function pE(e){e.preventDefault(),e.stopPropagation()}var vE={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},gE={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},mE=fl({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),yE=fl({from:{opacity:0},to:{opacity:1}}),bE=fl({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),wE=Cv((function(e,t){var n=iE(),r=Pv("Checkbox",un(un({},n),e)),o=ua(e),i=o.spacing,a=void 0===i?"0.5rem":i,s=o.className,l=o.children,u=o.iconColor,c=o.iconSize,d=o.icon,f=void 0===d?qr.createElement(dE,null):d,h=o.isChecked,p=o.isDisabled,v=void 0===p?null==n?void 0:n.isDisabled:p,g=o.onChange,m=o.inputProps,y=sn(o,V),b=h;(null==n?void 0:n.value)&&o.value&&(b=n.value.includes(o.value));var w=g;(null==n?void 0:n.onChange)&&o.value&&(w=function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:{},t=e.onChange,n=e.precision,r=e.defaultValue,o=e.value,i=e.step,a=void 0===i?1:i,s=e.min,l=void 0===s?Number.MIN_SAFE_INTEGER:s,u=e.max,c=void 0===u?Number.MAX_SAFE_INTEGER:u,d=e.keepWithinRange,f=void 0===d||d,h=Yv(t),p=cr.useState((function(){var e;return null==r?"":null!==(e=TE(r,a,n))&&void 0!==e?e:""})),v=yn(p,2),g=v[0],m=v[1],y=void 0!==o,b=y?o:g,w=ME(AE(b),a),k=null!=n?n:w,x=cr.useCallback((function(e){e!==b&&(y||m(e.toString()),null==h||h(e.toString(),AE(e)))}),[h,y,b]),S=cr.useCallback((function(e){var t=e;return f&&(t=LE(t,l,c)),SE(t,k)}),[k,f,c,l]),C=cr.useCallback((function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a;e=""===b?AE(t):AE(b)+t,e=S(e),x(e)}),[S,a,x,b]),_=cr.useCallback((function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a;e=""===b?AE(-t):AE(b)-t,e=S(e),x(e)}),[S,a,x,b]),E=cr.useCallback((function(){var e,t;null==r?e="":e=null!==(t=TE(r,a,n))&&void 0!==t?t:l;x(e)}),[r,n,a,x,l]),P=cr.useCallback((function(e){var t,n=null!==(t=TE(e,a,k))&&void 0!==t?t:l;x(n)}),[k,a,x,l]),L=AE(b),O=L>c||L1&&void 0!==arguments[1]?arguments[1]:[],n=cr.useRef(e);return HE((function(){n.current=e})),cr.useCallback((function(){for(var e,t,r=arguments.length,o=new Array(r),i=0;i0&&void 0!==arguments[0]?arguments[0]:{},t=e.onClose,n=e.onOpen,r=e.isOpen,o=e.id,i=VE(n),a=VE(t),s=cr.useState(e.defaultIsOpen||!1),l=yn(s,2),u=l[0],c=l[1],d=WE(r,u),f=yn(d,2),h=f[0],p=f[1],v=UE(o,"disclosure"),g=cr.useCallback((function(){h||c(!1),null==a||a()}),[h,a]),m=cr.useCallback((function(){h||c(!0),null==i||i()}),[h,i]),y=cr.useCallback((function(){(p?g:m)()}),[p,m,g]);return{isOpen:!!p,onOpen:m,onClose:g,onToggle:y,isControlled:h,getButtonProps:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return un(un({},e),{},{"aria-expanded":p,"aria-controls":v,onClick:Dl(e.onClick,y)})},getDisclosureProps:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return un(un({},e),{},{hidden:!p,id:v})}}}function qE(e){var t=Object.assign({},e);for(var n in t)void 0===t[n]&&delete t[n];return t}var YE=Cv((function(e,t){var n=e.htmlSize,r=sn(e,U),o=Pv("Input",r),i=N_(ua(r)),a=Wv("chakra-input",e.className);return qr.createElement(Lv.input,un(un({size:n},i),{},{__css:o.field,ref:t,className:a}))}));YE.displayName="Input",YE.id="Input";var ZE=yn(Av({name:"InputGroupStylesContext",errorMessage:"useInputGroupStyles returned is 'undefined'. Seems you forgot to wrap the components in \"\" "}),2),XE=ZE[0],$E=ZE[1],KE=Cv((function(e,t){var n=Pv("Input",e),r=ua(e),o=r.children,i=r.className,a=sn(r,G),s=Wv("chakra-input__group",i),l={},u=d_(o),c=n.field;u.forEach((function(e){if(n){var t,r;if(c&&"InputLeftElement"===e.type.id)l.paddingStart=null!==(t=c.height)&&void 0!==t?t:c.h;if(c&&"InputRightElement"===e.type.id)l.paddingEnd=null!==(r=c.height)&&void 0!==r?r:c.h;"InputRightAddon"===e.type.id&&(l.borderEndRadius=0),"InputLeftAddon"===e.type.id&&(l.borderStartRadius=0)}}));var d=u.map((function(t){var n,r,o=qE({size:(null==(n=t.props)?void 0:n.size)||e.size,variant:(null==(r=t.props)?void 0:r.variant)||e.variant});return"Input"!==t.type.id?cr.cloneElement(t,o):cr.cloneElement(t,Object.assign(o,l,t.props))}));return qr.createElement(Lv.div,un({className:s,ref:t,__css:{width:"100%",display:"flex",position:"relative"}},a),qr.createElement(XE,{value:n},d))}));KE.displayName="InputGroup";var QE={left:{marginEnd:"-1px",borderEndRadius:0,borderEndColor:"transparent"},right:{marginStart:"-1px",borderStartRadius:0,borderStartColor:"transparent"}},JE=Lv("div",{baseStyle:{flex:"0 0 auto",width:"auto",display:"flex",alignItems:"center",whiteSpace:"nowrap"}}),eP=Cv((function(e,t){var n,r=e.placement,o=void 0===r?"left":r,i=sn(e,q),a=null!==(n=QE[o])&&void 0!==n?n:{},s=$E();return qr.createElement(JE,un(un({ref:t},i),{},{__css:un(un({},s.addon),a)}))}));eP.displayName="InputAddon";var tP=Cv((function(e,t){return qr.createElement(eP,un(un({ref:t,placement:"left"},e),{},{className:Wv("chakra-input__left-addon",e.className)}))}));tP.displayName="InputLeftAddon",tP.id="InputLeftAddon";var nP=Cv((function(e,t){return qr.createElement(eP,un(un({ref:t,placement:"right"},e),{},{className:Wv("chakra-input__right-addon",e.className)}))}));nP.displayName="InputRightAddon",nP.id="InputRightAddon";var rP=Lv("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"0",zIndex:2}}),oP=Cv((function(e,t){var n,r,o,i=e.placement,a=void 0===i?"left":i,s=sn(e,Y),l=$E(),u=l.field,c=un((gn(o={},"left"===a?"insetStart":"insetEnd","0"),gn(o,"width",null!==(n=null==u?void 0:u.height)&&void 0!==n?n:null==u?void 0:u.h),gn(o,"height",null!==(r=null==u?void 0:u.height)&&void 0!==r?r:null==u?void 0:u.h),gn(o,"fontSize",null==u?void 0:u.fontSize),o),l.element);return qr.createElement(rP,un({ref:t,__css:c},s))}));oP.id="InputElement",oP.displayName="InputElement";var iP=Cv((function(e,t){var n=e.className,r=sn(e,Z),o=Wv("chakra-input__left-element",n);return qr.createElement(oP,un({ref:t,placement:"left",className:o},r))}));iP.id="InputLeftElement",iP.displayName="InputLeftElement";var aP=Cv((function(e,t){var n=e.className,r=sn(e,X),o=Wv("chakra-input__right-element",n);return qr.createElement(oP,un({ref:t,placement:"right",className:o},r))}));function sP(e,t){return Array.isArray(e)?e.map((function(e){return null===e?null:t(e)})):function(e){var t=kn(e);return null!=e&&("object"===t||"function"===t)&&!Array.isArray(e)}(e)?Object.keys(e).reduce((function(n,r){return n[r]=t(e[r]),n}),{}):null!=e?t(e):null}aP.id="InputRightElement",aP.displayName="InputRightElement";var lP=Cv((function(e,t){var n=e.ratio,r=void 0===n?4/3:n,o=e.children,i=e.className,a=sn(e,$),s=cr.Children.only(o),l=Wv("chakra-aspect-ratio",i);return qr.createElement(Lv.div,un({ref:t,position:"relative",className:l,_before:{height:0,content:'""',display:"block",paddingBottom:sP(r,(function(e){return"".concat(1/e*100,"%")}))},__css:{"& > *:not(style)":{overflow:"hidden",position:"absolute",top:"0",right:"0",bottom:"0",left:"0",display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},"& > img, & > video":{objectFit:"cover"}}},a),s)}));lP.displayName="AspectRatio";var uP=Cv((function(e,t){var n=Ev("Badge",e),r=ua(e),o=(r.className,sn(r,K));return qr.createElement(Lv.span,un(un({ref:t,className:Wv("chakra-badge",e.className)},o),{},{__css:un({display:"inline-block",whiteSpace:"nowrap",verticalAlign:"middle"},n)}))}));uP.displayName="Badge";var cP=Lv("div");cP.displayName="Box";var dP=Cv((function(e,t){var n=e.size,r=e.centerContent,o=void 0===r||r,i=sn(e,Q),a=o?{display:"flex",alignItems:"center",justifyContent:"center"}:{};return qr.createElement(cP,un({ref:t,boxSize:n,__css:un(un({},a),{},{flexShrink:0,flexGrow:0})},i))}));dP.displayName="Square";var fP=Cv((function(e,t){var n=e.size,r=sn(e,J);return qr.createElement(dP,un({size:n,ref:t,borderRadius:"9999px"},r))}));fP.displayName="Circle";var hP=Lv("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center"}});hP.displayName="Center";var pP={horizontal:{insetStart:"50%",transform:"translateX(-50%)"},vertical:{top:"50%",transform:"translateY(-50%)"},both:{insetStart:"50%",top:"50%",transform:"translate(-50%, -50%)"}};Cv((function(e,t){var n=e.axis,r=void 0===n?"both":n,o=sn(e,ee);return qr.createElement(Lv.div,un(un({ref:t,__css:pP[r]},o),{},{position:"absolute"}))}));var vP=Cv((function(e,t){var n=Ev("Code",e),r=ua(e),o=(r.className,sn(r,te));return qr.createElement(Lv.code,un(un({ref:t,className:Wv("chakra-code",e.className)},o),{},{__css:un({display:"inline-block"},n)}))}));vP.displayName="Code";var gP=Cv((function(e,t){var n=ua(e),r=n.className,o=n.centerContent,i=sn(n,ne),a=Ev("Container",e);return qr.createElement(Lv.div,un(un({ref:t,className:Wv("chakra-container",r)},i),{},{__css:un(un({},a),o&&{display:"flex",flexDirection:"column",alignItems:"center"})}))}));gP.displayName="Container";var mP=Cv((function(e,t){var n=Ev("Divider",e),r=n.borderLeftWidth,o=n.borderBottomWidth,i=n.borderTopWidth,a=n.borderRightWidth,s=n.borderWidth,l=n.borderStyle,u=n.borderColor,c=sn(n,re),d=ua(e),f=d.className,h=d.orientation,p=void 0===h?"horizontal":h,v=d.__css,g=sn(d,oe),m={vertical:{borderLeftWidth:r||a||s||"1px",height:"100%"},horizontal:{borderBottomWidth:o||i||s||"1px",width:"100%"}};return qr.createElement(Lv.hr,un(un({ref:t,"aria-orientation":p},g),{},{__css:un(un(un({},c),{},{border:"0",borderColor:u,borderStyle:l},m[p]),v),className:Wv("chakra-divider",f)}))}));mP.displayName="Divider";var yP=Cv((function(e,t){var n=e.direction,r=e.align,o=e.justify,i=e.wrap,a=e.basis,s=e.grow,l=e.shrink,u=sn(e,ie),c={display:"flex",flexDirection:n,alignItems:r,justifyContent:o,flexWrap:i,flexBasis:a,flexGrow:s,flexShrink:l};return qr.createElement(Lv.div,un({ref:t,__css:c},u))}));yP.displayName="Flex";var bP=Cv((function(e,t){var n=e.templateAreas,r=e.gap,o=e.rowGap,i=e.columnGap,a=e.column,s=e.row,l=e.autoFlow,u=e.autoRows,c=e.templateRows,d=e.autoColumns,f=e.templateColumns,h=sn(e,ae),p={display:"grid",gridTemplateAreas:n,gridGap:r,gridRowGap:o,gridColumnGap:i,gridAutoColumns:d,gridColumn:a,gridRow:s,gridAutoFlow:l,gridAutoRows:u,gridTemplateRows:c,gridTemplateColumns:f};return qr.createElement(Lv.div,un({ref:t,__css:p},h))}));function wP(e){return sP(e,(function(e){return"auto"===e?"auto":"span ".concat(e,"/span ").concat(e)}))}bP.displayName="Grid";var kP=Cv((function(e,t){var n=e.area,r=e.colSpan,o=e.colStart,i=e.colEnd,a=e.rowEnd,s=e.rowSpan,l=e.rowStart,u=sn(e,se),c=qE({gridArea:n,gridColumn:wP(r),gridRow:wP(s),gridColumnStart:o,gridColumnEnd:i,gridRowStart:l,gridRowEnd:a});return qr.createElement(Lv.div,un({ref:t,__css:c},u))}));kP.displayName="GridItem";var xP=Cv((function(e,t){var n=Ev("Heading",e),r=ua(e),o=(r.className,sn(r,le));return qr.createElement(Lv.h2,un(un({ref:t,className:Wv("chakra-heading",e.className)},o),{},{__css:n}))}));xP.displayName="Heading",Cv((function(e,t){var n=Ev("Mark",e),r=ua(e);return qr.createElement(cP,un(un({ref:t},r),{},{as:"mark",__css:un({bg:"transparent",whiteSpace:"nowrap"},n)}))}));var SP=Cv((function(e,t){var n=Ev("Kbd",e),r=ua(e),o=r.className,i=sn(r,ue);return qr.createElement(Lv.kbd,un(un({ref:t,className:Wv("chakra-kbd",o)},i),{},{__css:un({fontFamily:"mono"},n)}))}));SP.displayName="Kbd";var CP=Cv((function(e,t){var n=Ev("Link",e),r=ua(e),o=r.className,i=r.isExternal,a=sn(r,ce);return qr.createElement(Lv.a,un(un({target:i?"_blank":void 0,rel:i?"noopener":void 0,ref:t,className:Wv("chakra-link",o)},a),{},{__css:n}))}));CP.displayName="Link",Cv((function(e,t){var n=e.isExternal,r=e.target,o=e.rel,i=e.className,a=sn(e,de);return qr.createElement(Lv.a,un(un({},a),{},{ref:t,className:Wv("chakra-linkbox__overlay",i),rel:n?"noopener noreferrer":o,target:n?"_blank":r,__css:{position:"static","&::before":{content:"''",cursor:"inherit",display:"block",position:"absolute",top:0,left:0,zIndex:0,width:"100%",height:"100%"}}}))})),Cv((function(e,t){var n=e.className,r=sn(e,fe);return qr.createElement(Lv.div,un(un({ref:t,position:"relative"},r),{},{className:Wv("chakra-linkbox",n),__css:{"a[href]:not(.chakra-linkbox__overlay), abbr[title]":{position:"relative",zIndex:1}}}))}));var _P=yn(Av({name:"ListStylesContext",errorMessage:"useListStyles returned is 'undefined'. Seems you forgot to wrap the components in \"\" "}),2),EP=_P[0],PP=_P[1],LP=Cv((function(e,t){var n=Pv("List",e),r=ua(e),o=r.children,i=r.styleType,a=void 0===i?"none":i,s=r.stylePosition,l=r.spacing,u=sn(r,he),c=d_(o),d=l?gn({},"& > *:not(style) ~ *:not(style)",{mt:l}):{};return qr.createElement(EP,{value:n},qr.createElement(Lv.ul,un({ref:t,listStyleType:a,listStylePosition:s,role:"list",__css:un(un({},n.container),d)},u),c))}));LP.displayName="List",Cv((function(e,t){e.as;var n=sn(e,pe);return qr.createElement(LP,un({ref:t,as:"ol",styleType:"decimal",marginStart:"1em"},n))})).displayName="OrderedList",Cv((function(e,t){e.as;var n=sn(e,ve);return qr.createElement(LP,un({ref:t,as:"ul",styleType:"initial",marginStart:"1em"},n))})).displayName="UnorderedList";var OP=Cv((function(e,t){var n=PP();return qr.createElement(Lv.li,un(un({ref:t},e),{},{__css:n.item}))}));OP.displayName="ListItem";var AP=Cv((function(e,t){var n=PP();return qr.createElement(Gv,un(un({ref:t,role:"presentation"},e),{},{__css:n.icon}))}));AP.displayName="ListIcon";var MP=Cv((function(e,t){var n=e.columns,r=e.spacingX,o=e.spacingY,i=e.spacing,a=e.minChildWidth,s=sn(e,ge),l=vv(),u=a?function(e,t){return sP(e,(function(e){var n=function(e,t,n){var r=Array.isArray(t)?t:[t],o=Array.isArray(n)?n:[n];return function(n){var i=o.filter(Boolean),a=r.map((function(t,r){var o,a;if("breakpoints"===e)return function(e,t,n){var r,o;if(null==t)return t;var i=function(t){var n,r;return null==(r=null==(n=e.__breakpoints)?void 0:n.asArray)?void 0:r[t]};return null!==(r=null!==(o=i(t))&&void 0!==o?o:i(n))&&void 0!==r?r:n}(n,t,null!==(a=i[r])&&void 0!==a?a:t);var s="".concat(e,".").concat(t);return function(e,t,n){var r,o;if(null==t)return t;var i=function(t){var n,r;return null==(r=null==(n=e.__cssMap)?void 0:n[t])?void 0:r.value};return null!==(r=null!==(o=i(t))&&void 0!==o?o:i(n))&&void 0!==r?r:n}(n,s,null!==(o=i[r])&&void 0!==o?o:t)}));return Array.isArray(t)?a:a[0]}}("sizes",e,function(e){return"number"==typeof e?"".concat(e,"px"):e}(e))(t);return null===e?null:"repeat(auto-fit, minmax(".concat(n,", 1fr))")}))}(a,l):sP(n,(function(e){return null===e?null:"repeat(".concat(e,", minmax(0, 1fr))")}));return qr.createElement(bP,un({ref:t,gap:i,columnGap:r,rowGap:o,templateColumns:u},s))}));MP.displayName="SimpleGrid";var TP=Lv("div",{baseStyle:{flex:1,justifySelf:"stretch",alignSelf:"stretch"}});TP.displayName="Spacer";var IP="& > *:not(style) ~ *:not(style)";var RP=function(e){return qr.createElement(Lv.div,un(un({className:"chakra-stack__item"},e),{},{__css:un({display:"inline-block",flex:"0 0 auto",minWidth:0},e.__css)}))};RP.displayName="StackItem";var NP=Cv((function(e,t){var n=e.isInline,r=e.direction,o=e.align,i=e.justify,a=e.spacing,s=void 0===a?"0.5rem":a,l=e.wrap,u=e.children,c=e.divider,d=e.className,f=e.shouldWrapChildren,h=sn(e,me),p=n?"row":null!=r?r:"column",v=cr.useMemo((function(){return function(e){var t=e.spacing,n=e.direction,r={column:{marginTop:t,marginEnd:0,marginBottom:0,marginStart:0},row:{marginTop:0,marginEnd:0,marginBottom:0,marginStart:t},"column-reverse":{marginTop:0,marginEnd:0,marginBottom:t,marginStart:0},"row-reverse":{marginTop:0,marginEnd:t,marginBottom:0,marginStart:0}};return gn({flexDirection:n},IP,sP(n,(function(e){return r[e]})))}({direction:p,spacing:s})}),[p,s]),g=cr.useMemo((function(){return function(e){var t=e.spacing,n=e.direction,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{"&":sP(n,(function(e){return r[e]}))}}({spacing:s,direction:p})}),[s,p]),m=!!c,y=!f&&!m,b=cr.useMemo((function(){var e=d_(u);return y?e:e.map((function(t,n){var r=void 0!==t.key?t.key:n,o=n+1===e.length,i=f?qr.createElement(RP,{key:r},t):t;if(!m)return i;var a=cr.cloneElement(c,{__css:g}),s=o?null:a;return qr.createElement(cr.Fragment,{key:r},i,s)}))}),[c,g,m,y,f,u]),w=Wv("chakra-stack",d);return qr.createElement(Lv.div,un({ref:t,display:"flex",alignItems:o,justifyContent:i,flexDirection:v.flexDirection,flexWrap:l,className:w,__css:m?{}:gn({},IP,v[IP])},h),b)}));NP.displayName="Stack";var DP=Cv((function(e,t){return qr.createElement(NP,un(un({align:"center"},e),{},{direction:"row",ref:t}))}));DP.displayName="HStack";var zP=Cv((function(e,t){return qr.createElement(NP,un(un({align:"center"},e),{},{direction:"column",ref:t}))}));zP.displayName="VStack";var jP=Cv((function(e,t){var n=Ev("Text",e),r=ua(e),o=(r.className,r.align,r.decoration,r.casing,sn(r,ye)),i=qE({textAlign:e.align,textDecoration:e.decoration,textTransform:e.casing});return qr.createElement(Lv.p,un(un(un({ref:t,className:Wv("chakra-text",e.className)},i),o),{},{__css:n}))}));function BP(e){return"number"==typeof e?"".concat(e,"px"):e}jP.displayName="Text";var FP=Cv((function(e,t){var n=e.spacing,r=void 0===n?"0.5rem":n,o=e.spacingX,i=e.spacingY,a=e.children,s=e.justify,l=e.direction,u=e.align,c=e.className,d=e.shouldWrapChildren,f=sn(e,be),h=cr.useMemo((function(){var e={spacingX:o,spacingY:i},t=e.spacingX,n=void 0===t?r:t,a=e.spacingY,c=void 0===a?r:a;return{"--chakra-wrap-x-spacing":function(e){return sP(n,(function(t){return BP(xo("space",t)(e))}))},"--chakra-wrap-y-spacing":function(e){return sP(c,(function(t){return BP(xo("space",t)(e))}))},"--wrap-x-spacing":"calc(var(--chakra-wrap-x-spacing) / 2)","--wrap-y-spacing":"calc(var(--chakra-wrap-y-spacing) / 2)",display:"flex",flexWrap:"wrap",justifyContent:s,alignItems:u,flexDirection:l,listStyleType:"none",padding:"0",margin:"calc(var(--wrap-y-spacing) * -1) calc(var(--wrap-x-spacing) * -1)","& > *:not(style)":{margin:"var(--wrap-y-spacing) var(--wrap-x-spacing)"}}}),[r,o,i,s,u,l]),p=cr.useMemo((function(){return d?cr.Children.map(a,(function(e,t){return qr.createElement(HP,{key:t},e)})):a}),[a,d]);return qr.createElement(Lv.div,un({ref:t,className:Wv("chakra-wrap",c),overflow:"hidden"},f),qr.createElement(Lv.ul,{className:"chakra-wrap__list",__css:h},p))}));FP.displayName="Wrap";var HP=Cv((function(e,t){var n=e.className,r=sn(e,we);return qr.createElement(Lv.li,un({ref:t,__css:{display:"flex",alignItems:"flex-start"},className:Wv("chakra-wrap__listitem",n)},r))}));HP.displayName="WrapItem";var VP={body:{classList:{add:function(){},remove:function(){}}},addEventListener:function(){},removeEventListener:function(){},activeElement:{blur:function(){},nodeName:""},querySelector:function(){return null},querySelectorAll:function(){return[]},getElementById:function(){return null},createEvent:function(){return{initEvent:function(){}}},createElement:function(){return{children:[],childNodes:[],style:{},setAttribute:function(){},getElementsByTagName:function(){return[]}}}},WP=function(){},UP={document:VP,navigator:{userAgent:""},CustomEvent:function(){return this},addEventListener:WP,removeEventListener:WP,getComputedStyle:function(){return{getPropertyValue:function(){return""}}},matchMedia:function(){return{matches:!1,addListener:WP,removeListener:WP}},requestAnimationFrame:function(e){return"undefined"==typeof setTimeout?(e(),null):setTimeout(e,0)},cancelAnimationFrame:function(e){"undefined"!=typeof setTimeout&&clearTimeout(e)},setTimeout:function(){return 0},clearTimeout:WP,setInterval:function(){return 0},clearInterval:WP},GP="undefined"!=typeof window?{window:window,document:document}:{window:UP,document:VP},qP=cr.createContext(GP);function YP(e){var t=e.children,n=e.environment,r=yn(cr.useState(null),2),o=r[0],i=r[1],a=yn(cr.useState(!1),2),s=a[0],l=a[1];cr.useEffect((function(){return l(!0)}),[]);var u=cr.useMemo((function(){if(n)return n;var e=null==o?void 0:o.ownerDocument,t=null==o?void 0:o.ownerDocument.defaultView;return e?{document:e,window:t}:GP}),[o,n]);return qr.createElement(qP.Provider,{value:u},t,!n&&s&&qr.createElement("span",{id:"__chakra_env",hidden:!0,ref:function(e){cr.startTransition((function(){e&&i(e)}))}}))}qP.displayName="EnvironmentContext",YP.displayName="EnvironmentProvider";var ZP=function(e){return e?"":void 0};function XP(){var e=cr.useRef(new Map),t=e.current,n=cr.useCallback((function(t,n,r,o){e.current.set(r,{type:n,el:t,options:o}),t.addEventListener(n,r,o)}),[]),r=cr.useCallback((function(t,n,r,o){t.removeEventListener(n,r,o),e.current.delete(r)}),[]);return cr.useEffect((function(){return function(){t.forEach((function(e,t){r(e.el,e.type,t,e.options)}))}}),[r,t]),{add:n,remove:r}}function $P(e){var t=e.target,n=t.tagName,r=t.isContentEditable;return"INPUT"!==n&&"TEXTAREA"!==n&&!0!==r}function KP(e){return null!=e&&"object"==kn(e)&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function QP(e){var t;return!!KP(e)&&e instanceof(null!==(t=e.ownerDocument.defaultView)&&void 0!==t?t:window).HTMLElement}function JP(e){return KP(e)?e.ownerDocument:document}var eL=function(e){return e.hasAttribute("tabindex")};function tL(e){return!(!e.parentElement||!tL(e.parentElement))||e.hidden}function nL(e){if(!QP(e)||tL(e)||function(e){return!0===Boolean(e.getAttribute("disabled"))||!0===Boolean(e.getAttribute("aria-disabled"))}(e))return!1;var t=e.localName;if(["input","select","textarea","button"].indexOf(t)>=0)return!0;var n={a:function(){return e.hasAttribute("href")},audio:function(){return e.hasAttribute("controls")},video:function(){return e.hasAttribute("controls")}};return t in n?n[t]():!!function(e){var t=e.getAttribute("contenteditable");return"false"!==t&&null!=t}(e)||eL(e)}function rL(e){return!!e&&(QP(e)&&nL(e)&&!function(e){return eL(e)&&-1===e.tabIndex}(e))}var oL=["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]"].join();function iL(e){var t=Array.from(e.querySelectorAll(oL));return t.unshift(e),t.filter((function(e){return nL(e)&&function(e){return e.offsetWidth>0&&e.offsetHeight>0}(e)}))}function aL(e){var t=e.current;if(!t)return!1;var n=function(e){return JP(e).activeElement}(t);return!!n&&(!t.contains(n)&&!!rL(n))}function sL(e,t){var n=t.shouldFocus,r=t.visible,o=t.focusRef,i=n&&!r;U_((function(){if(i&&!aL(e)){var t=(null==o?void 0:o.current)||e.current;t&&requestAnimationFrame((function(){t.focus()}))}}),[i,e,o])}var lL={preventScroll:!0,shouldFocus:!1};function uL(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:lL,n=t.focusRef,r=t.preventScroll,o=t.shouldFocus,i=t.visible,a=cL(e)?e.current:e,s=o&&i,l=cr.useRef(s),u=cr.useRef(i);oo((function(){!u.current&&i&&(l.current=s),u.current=i}),[i,s]);var c=cr.useCallback((function(){if(i&&a&&l.current&&(l.current=!1,!a.contains(document.activeElement)))if(null==n?void 0:n.current)requestAnimationFrame((function(){var e;null==(e=n.current)||e.focus({preventScroll:r})}));else{var e=iL(a);e.length>0&&requestAnimationFrame((function(){e[0].focus({preventScroll:r})}))}}),[i,r,a,n]);U_((function(){c()}),[c]),DE(a,"transitionend",c)}function cL(e){return"current"in e}var dL="top",fL="bottom",hL="right",pL="left",vL="auto",gL=[dL,fL,hL,pL],mL="start",yL="end",bL="viewport",wL="popper",kL=gL.reduce((function(e,t){return e.concat([t+"-"+mL,t+"-"+yL])}),[]),xL=[].concat(gL,[vL]).reduce((function(e,t){return e.concat([t,t+"-"+mL,t+"-"+yL])}),[]),SL=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function CL(e){return e?(e.nodeName||"").toLowerCase():null}function _L(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function EL(e){return e instanceof _L(e).Element||e instanceof Element}function PL(e){return e instanceof _L(e).HTMLElement||e instanceof HTMLElement}function LL(e){return"undefined"!=typeof ShadowRoot&&(e instanceof _L(e).ShadowRoot||e instanceof ShadowRoot)}var OL={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},o=t.elements[e];PL(o)&&CL(o)&&(Object.assign(o.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)})))}))},effect:function(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(e){var r=t.elements[e],o=t.attributes[e]||{},i=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});PL(r)&&CL(r)&&(Object.assign(r.style,i),Object.keys(o).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};function AL(e){return e.split("-")[0]}var ML=Math.max,TL=Math.min,IL=Math.round;function RL(){var e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function NL(){return!/^((?!chrome|android).)*safari/i.test(RL())}function DL(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=e.getBoundingClientRect(),o=1,i=1;t&&PL(e)&&(o=e.offsetWidth>0&&IL(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&IL(r.height)/e.offsetHeight||1);var a=(EL(e)?_L(e):window).visualViewport,s=!NL()&&n,l=(r.left+(s&&a?a.offsetLeft:0))/o,u=(r.top+(s&&a?a.offsetTop:0))/i,c=r.width/o,d=r.height/i;return{width:c,height:d,top:u,right:l+c,bottom:u+d,left:l,x:l,y:u}}function zL(e){var t=DL(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 jL(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&LL(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function BL(e){return _L(e).getComputedStyle(e)}function FL(e){return["table","td","th"].indexOf(CL(e))>=0}function HL(e){return((EL(e)?e.ownerDocument:e.document)||window.document).documentElement}function VL(e){return"html"===CL(e)?e:e.assignedSlot||e.parentNode||(LL(e)?e.host:null)||HL(e)}function WL(e){return PL(e)&&"fixed"!==BL(e).position?e.offsetParent:null}function UL(e){for(var t=_L(e),n=WL(e);n&&FL(n)&&"static"===BL(n).position;)n=WL(n);return n&&("html"===CL(n)||"body"===CL(n)&&"static"===BL(n).position)?t:n||function(e){var t=/firefox/i.test(RL());if(/Trident/i.test(RL())&&PL(e)&&"fixed"===BL(e).position)return null;var n=VL(e);for(LL(n)&&(n=n.host);PL(n)&&["html","body"].indexOf(CL(n))<0;){var r=BL(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}function GL(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function qL(e,t,n){return ML(e,TL(t,n))}function YL(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function ZL(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}var XL={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=AL(n.placement),l=GL(s),u=[pL,hL].indexOf(s)>=0?"height":"width";if(i&&a){var c=function(e,t){return YL("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:ZL(e,gL))}(o.padding,n),d=zL(i),f="y"===l?dL:pL,h="y"===l?fL:hL,p=n.rects.reference[u]+n.rects.reference[l]-a[l]-n.rects.popper[u],v=a[l]-n.rects.reference[l],g=UL(i),m=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,y=p/2-v/2,b=c[f],w=m-d[u]-c[h],k=m/2-d[u]/2+y,x=qL(b,k,w),S=l;n.modifiersData[r]=((t={})[S]=x,t.centerOffset=x-k,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&jL(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function $L(e){return e.split("-")[1]}var KL={top:"auto",right:"auto",bottom:"auto",left:"auto"};function QL(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,u=e.adaptive,c=e.roundOffsets,d=e.isFixed,f=a.x,h=void 0===f?0:f,p=a.y,v=void 0===p?0:p,g="function"==typeof c?c({x:h,y:v}):{x:h,y:v};h=g.x,v=g.y;var m=a.hasOwnProperty("x"),y=a.hasOwnProperty("y"),b=pL,w=dL,k=window;if(u){var x=UL(n),S="clientHeight",C="clientWidth";if(x===_L(n)&&"static"!==BL(x=HL(n)).position&&"absolute"===s&&(S="scrollHeight",C="scrollWidth"),o===dL||(o===pL||o===hL)&&i===yL)w=fL,v-=(d&&x===k&&k.visualViewport?k.visualViewport.height:x[S])-r.height,v*=l?1:-1;if(o===pL||(o===dL||o===fL)&&i===yL)b=hL,h-=(d&&x===k&&k.visualViewport?k.visualViewport.width:x[C])-r.width,h*=l?1:-1}var _,E=Object.assign({position:s},u&&KL),P=!0===c?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:IL(t*r)/r||0,y:IL(n*r)/r||0}}({x:h,y:v}):{x:h,y:v};return h=P.x,v=P.y,l?Object.assign({},E,((_={})[w]=y?"0":"",_[b]=m?"0":"",_.transform=(k.devicePixelRatio||1)<=1?"translate("+h+"px, "+v+"px)":"translate3d("+h+"px, "+v+"px, 0)",_)):Object.assign({},E,((t={})[w]=y?v+"px":"",t[b]=m?h+"px":"",t.transform="",t))}var JL={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=void 0===r||r,i=n.adaptive,a=void 0===i||i,s=n.roundOffsets,l=void 0===s||s,u={placement:AL(t.placement),variation:$L(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,QL(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,QL(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},eO={passive:!0};var tO={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,i=void 0===o||o,a=r.resize,s=void 0===a||a,l=_L(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&u.forEach((function(e){e.addEventListener("scroll",n.update,eO)})),s&&l.addEventListener("resize",n.update,eO),function(){i&&u.forEach((function(e){e.removeEventListener("scroll",n.update,eO)})),s&&l.removeEventListener("resize",n.update,eO)}},data:{}},nO={left:"right",right:"left",bottom:"top",top:"bottom"};function rO(e){return e.replace(/left|right|bottom|top/g,(function(e){return nO[e]}))}var oO={start:"end",end:"start"};function iO(e){return e.replace(/start|end/g,(function(e){return oO[e]}))}function aO(e){var t=_L(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function sO(e){return DL(HL(e)).left+aO(e).scrollLeft}function lO(e){var t=BL(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function uO(e){return["html","body","#document"].indexOf(CL(e))>=0?e.ownerDocument.body:PL(e)&&lO(e)?e:uO(VL(e))}function cO(e,t){var n;void 0===t&&(t=[]);var r=uO(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=_L(r),a=o?[i].concat(i.visualViewport||[],lO(r)?r:[]):r,s=t.concat(a);return o?s:s.concat(cO(VL(a)))}function dO(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function fO(e,t,n){return t===bL?dO(function(e,t){var n=_L(e),r=HL(e),o=n.visualViewport,i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;var u=NL();(u||!u&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s+sO(e),y:l}}(e,n)):EL(t)?function(e,t){var n=DL(e,!1,"fixed"===t);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}(t,n):dO(function(e){var t,n=HL(e),r=aO(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=ML(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=ML(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-r.scrollLeft+sO(e),l=-r.scrollTop;return"rtl"===BL(o||n).direction&&(s+=ML(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:l}}(HL(e)))}function hO(e,t,n,r){var o="clippingParents"===t?function(e){var t=cO(VL(e)),n=["absolute","fixed"].indexOf(BL(e).position)>=0&&PL(e)?UL(e):e;return EL(n)?t.filter((function(e){return EL(e)&&jL(e,n)&&"body"!==CL(e)})):[]}(e):[].concat(t),i=[].concat(o,[n]),a=i[0],s=i.reduce((function(t,n){var o=fO(e,n,r);return t.top=ML(o.top,t.top),t.right=TL(o.right,t.right),t.bottom=TL(o.bottom,t.bottom),t.left=ML(o.left,t.left),t}),fO(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function pO(e){var t,n=e.reference,r=e.element,o=e.placement,i=o?AL(o):null,a=o?$L(o):null,s=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2;switch(i){case dL:t={x:s,y:n.y-r.height};break;case fL:t={x:s,y:n.y+n.height};break;case hL:t={x:n.x+n.width,y:l};break;case pL:t={x:n.x-r.width,y:l};break;default:t={x:n.x,y:n.y}}var u=i?GL(i):null;if(null!=u){var c="y"===u?"height":"width";switch(a){case mL:t[u]=t[u]-(n[c]/2-r[c]/2);break;case yL:t[u]=t[u]+(n[c]/2-r[c]/2)}}return t}function vO(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=void 0===r?e.placement:r,i=n.strategy,a=void 0===i?e.strategy:i,s=n.boundary,l=void 0===s?"clippingParents":s,u=n.rootBoundary,c=void 0===u?bL:u,d=n.elementContext,f=void 0===d?wL:d,h=n.altBoundary,p=void 0!==h&&h,v=n.padding,g=void 0===v?0:v,m=YL("number"!=typeof g?g:ZL(g,gL)),y=f===wL?"reference":wL,b=e.rects.popper,w=e.elements[p?y:f],k=hO(EL(w)?w:w.contextElement||HL(e.elements.popper),l,c,a),x=DL(e.elements.reference),S=pO({reference:x,element:b,strategy:"absolute",placement:o}),C=dO(Object.assign({},b,S)),_=f===wL?C:x,E={top:k.top-_.top+m.top,bottom:_.bottom-k.bottom+m.bottom,left:k.left-_.left+m.left,right:_.right-k.right+m.right},P=e.modifiersData.offset;if(f===wL&&P){var L=P[o];Object.keys(E).forEach((function(e){var t=[hL,fL].indexOf(e)>=0?1:-1,n=[dL,fL].indexOf(e)>=0?"y":"x";E[e]+=L[n]*t}))}return E}function gO(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,u=void 0===l?xL:l,c=$L(r),d=c?s?kL:kL.filter((function(e){return $L(e)===c})):gL,f=d.filter((function(e){return u.indexOf(e)>=0}));0===f.length&&(f=d);var h=f.reduce((function(t,n){return t[n]=vO(e,{placement:n,boundary:o,rootBoundary:i,padding:a})[AL(n)],t}),{});return Object.keys(h).sort((function(e,t){return h[e]-h[t]}))}var mO={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0===a||a,l=n.fallbackPlacements,u=n.padding,c=n.boundary,d=n.rootBoundary,f=n.altBoundary,h=n.flipVariations,p=void 0===h||h,v=n.allowedAutoPlacements,g=t.options.placement,m=AL(g),y=l||(m===g||!p?[rO(g)]:function(e){if(AL(e)===vL)return[];var t=rO(e);return[iO(e),t,iO(t)]}(g)),b=[g].concat(y).reduce((function(e,n){return e.concat(AL(n)===vL?gO(t,{placement:n,boundary:c,rootBoundary:d,padding:u,flipVariations:p,allowedAutoPlacements:v}):n)}),[]),w=t.rects.reference,k=t.rects.popper,x=new Map,S=!0,C=b[0],_=0;_=0,A=O?"width":"height",M=vO(t,{placement:E,boundary:c,rootBoundary:d,altBoundary:f,padding:u}),T=O?L?hL:pL:L?fL:dL;w[A]>k[A]&&(T=rO(T));var I=rO(T),R=[];if(i&&R.push(M[P]<=0),s&&R.push(M[T]<=0,M[I]<=0),R.every((function(e){return e}))){C=E,S=!1;break}x.set(E,R)}if(S)for(var N=function(e){var t=b.find((function(t){var n=x.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return C=t,"break"},D=p?3:1;D>0;D--){if("break"===N(D))break}t.placement!==C&&(t.modifiersData[r]._skip=!0,t.placement=C,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function yO(e,t,n){return void 0===n&&(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 bO(e){return[dL,hL,fL,pL].some((function(t){return e[t]>=0}))}var wO={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=vO(t,{elementContext:"reference"}),s=vO(t,{altBoundary:!0}),l=yO(a,r),u=yO(s,o,i),c=bO(l),d=bO(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}};var kO={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=void 0===o?[0,0]:o,a=xL.reduce((function(e,n){return e[n]=function(e,t,n){var r=AL(e),o=[pL,dL].indexOf(r)>=0?-1:1,i="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[pL,hL].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,i),e}),{}),s=a[t.placement],l=s.x,u=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=a}};var xO={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=pO({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};var SO={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0!==a&&a,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,d=n.padding,f=n.tether,h=void 0===f||f,p=n.tetherOffset,v=void 0===p?0:p,g=vO(t,{boundary:l,rootBoundary:u,padding:d,altBoundary:c}),m=AL(t.placement),y=$L(t.placement),b=!y,w=GL(m),k="x"===w?"y":"x",x=t.modifiersData.popperOffsets,S=t.rects.reference,C=t.rects.popper,_="function"==typeof v?v(Object.assign({},t.rects,{placement:t.placement})):v,E="number"==typeof _?{mainAxis:_,altAxis:_}:Object.assign({mainAxis:0,altAxis:0},_),P=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,L={x:0,y:0};if(x){if(i){var O,A="y"===w?dL:pL,M="y"===w?fL:hL,T="y"===w?"height":"width",I=x[w],R=I+g[A],N=I-g[M],D=h?-C[T]/2:0,z=y===mL?S[T]:C[T],j=y===mL?-C[T]:-S[T],B=t.elements.arrow,F=h&&B?zL(B):{width:0,height:0},H=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},V=H[A],W=H[M],U=qL(0,S[T],F[T]),G=b?S[T]/2-D-U-V-E.mainAxis:z-U-V-E.mainAxis,q=b?-S[T]/2+D+U+W+E.mainAxis:j+U+W+E.mainAxis,Y=t.elements.arrow&&UL(t.elements.arrow),Z=Y?"y"===w?Y.clientTop||0:Y.clientLeft||0:0,X=null!=(O=null==P?void 0:P[w])?O:0,$=I+q-X,K=qL(h?TL(R,I+G-X-Z):R,I,h?ML(N,$):N);x[w]=K,L[w]=K-I}if(s){var Q,J="x"===w?dL:pL,ee="x"===w?fL:hL,te=x[k],ne="y"===k?"height":"width",re=te+g[J],oe=te-g[ee],ie=-1!==[dL,pL].indexOf(m),ae=null!=(Q=null==P?void 0:P[k])?Q:0,se=ie?re:te-S[ne]-C[ne]-ae+E.altAxis,le=ie?te+S[ne]+C[ne]-ae-E.altAxis:oe,ue=h&&ie?function(e,t,n){var r=qL(e,t,n);return r>n?n:r}(se,te,le):qL(h?se:re,te,h?le:oe);x[k]=ue,L[k]=ue-te}t.modifiersData[r]=L}},requiresIfExists:["offset"]};function CO(e,t,n){void 0===n&&(n=!1);var r=PL(t),o=PL(t)&&function(e){var t=e.getBoundingClientRect(),n=IL(t.width)/e.offsetWidth||1,r=IL(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),i=HL(t),a=DL(e,o,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&(("body"!==CL(t)||lO(i))&&(s=function(e){return e!==_L(e)&&PL(e)?{scrollLeft:(t=e).scrollLeft,scrollTop:t.scrollTop}:aO(e);var t}(t)),PL(t)?((l=DL(t,!0)).x+=t.clientLeft,l.y+=t.clientTop):i&&(l.x=sO(i))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function _O(e){var t=new Map,n=new Set,r=[];function o(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&o(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||o(e)})),r}function EO(e){var t;return function(){return t||(t=new Promise((function(n){Promise.resolve().then((function(){t=void 0,n(e())}))}))),t}}var PO={placement:"bottom",modifiers:[],strategy:"absolute"};function LO(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:"ltr",o=(null==(n=UO[e])?void 0:n[r])||e;return"ltr"===r?o:null!==(t=GO[e])&&void 0!==t?t:o}function YO(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.enabled,n=void 0===t||t,r=e.modifiers,o=e.placement,i=void 0===o?"bottom":o,a=e.strategy,s=void 0===a?"absolute":a,l=e.arrowPadding,u=void 0===l?8:l,c=e.eventListeners,d=void 0===c||c,f=e.offset,h=e.gutter,p=void 0===h?8:h,v=e.flip,g=void 0===v||v,m=e.boundary,y=void 0===m?"clippingParents":m,b=e.preventOverflow,w=void 0===b||b,k=e.matchWidth,x=e.direction,S=void 0===x?"ltr":x,C=cr.useRef(null),_=cr.useRef(null),E=cr.useRef(null),P=qO(i,S),L=cr.useRef((function(){})),O=cr.useCallback((function(){var e;n&&C.current&&_.current&&(null==(e=L.current)||e.call(L),E.current=AO(C.current,_.current,{placement:P,modifiers:[VO,BO,zO,un(un({},DO),{},{enabled:!!k}),un({name:"eventListeners"},NO(d)),{name:"arrow",options:{padding:u}},{name:"offset",options:{offset:null!=f?f:[0,p]}},{name:"flip",enabled:!!g,options:{padding:8}},{name:"preventOverflow",enabled:!!w,options:{boundary:y}}].concat(cn(null!=r?r:[])),strategy:s}),E.current.forceUpdate(),L.current=E.current.destroy)}),[P,n,r,k,d,u,f,p,g,w,y,s]);cr.useEffect((function(){return function(){var e;C.current||_.current||(null==(e=E.current)||e.destroy(),E.current=null)}}),[]);var A=cr.useCallback((function(e){C.current=e,O()}),[O]),M=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({},e),{},{ref:Tv(A,t)})}),[A]),T=cr.useCallback((function(e){_.current=e,O()}),[O]),I=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({},e),{},{ref:Tv(T,t),style:un(un({},e.style),{},{position:s,minWidth:k?void 0:"max-content",inset:"0 auto auto 0"})})}),[s,T,k]),R=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=(e.size,e.shadowColor,e.bg,e.style,sn(e,xe));return un(un({},n),{},{ref:t,"data-popper-arrow":"",style:ZO(e)})}),[]),N=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({},e),{},{ref:t,"data-popper-arrow-inner":""})}),[]);return{update:function(){var e;null==(e=E.current)||e.update()},forceUpdate:function(){var e;null==(e=E.current)||e.forceUpdate()},transformOrigin:TO.transformOrigin.varRef,referenceRef:A,popperRef:T,getPopperProps:I,getArrowProps:R,getArrowInnerProps:N,getReferenceProps:M}}function ZO(e){var t=e.size,n=e.shadowColor,r=e.bg,o=un(un({},e.style),{},{position:"absolute"});return t&&(o["--popper-arrow-size"]=t),n&&(o["--popper-arrow-shadow-color"]=n),r&&(o["--popper-arrow-bg"]=r),o}function XO(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.onClose,n=e.onOpen,r=e.isOpen,o=e.id,i=Yv(n),a=Yv(t),s=cr.useState(e.defaultIsOpen||!1),l=yn(s,2),u=l[0],c=l[1],d=void 0!==r?r:u,f=void 0!==r,h=cr.useId(),p=null!=o?o:"disclosure-".concat(h),v=cr.useCallback((function(){f||c(!1),null==a||a()}),[f,a]),g=cr.useCallback((function(){f||c(!0),null==i||i()}),[f,i]),m=cr.useCallback((function(){d?v():g()}),[d,g,v]);function y(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return un(un({},e),{},{"aria-expanded":d,"aria-controls":p,onClick:function(t){var n;null==(n=e.onClick)||n.call(e,t),m()}})}function b(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return un(un({},e),{},{hidden:!d,id:p})}return{isOpen:d,onOpen:g,onClose:v,onToggle:m,isControlled:f,getButtonProps:y,getDisclosureProps:b}}function $O(e){var t=e.isOpen,n=e.ref,r=yn(cr.useState(t),2),o=r[0],i=r[1],a=yn(cr.useState(!1),2),s=a[0],l=a[1];return cr.useEffect((function(){s||(i(t),l(!0))}),[t,s,o]),DE((function(){return n.current}),"animationend",(function(){i(t)})),{present:!(!t&&!o),onComplete:function(){var e,t=function(e){var t,n;return null!==(t=null==(n=JP(e))?void 0:n.defaultView)&&void 0!==t?t:window}(n.current),r=new t.CustomEvent("animationend",{bubbles:!0});null==(e=n.current)||e.dispatchEvent(r)}}}function KO(e){var t=e.wasSelected,n=e.enabled,r=e.isSelected,o=e.mode;return!n||(!!r||!("keepMounted"!==(void 0===o?"unmount":o)||!t))}var QO={},JO={get exports(){return QO},set exports(e){QO=e}},eA={},tA={},nA={get exports(){return tA},set exports(e){tA=e}},rA={}; -/** - * @license React - * scheduler.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. - */ -!function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0>>1,i=e[r];if(!(0>>1;ro(l,n))uo(c,l)?(e[r]=c,e[u]=n,r=u):(e[r]=l,e[s]=n,r=s);else{if(!(uo(c,n)))break e;e[r]=c,e[u]=n,r=u}}}return t}function o(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"===("undefined"==typeof performance?"undefined":kn(performance))&&"function"==typeof performance.now){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],u=[],c=1,d=null,f=3,h=!1,p=!1,v=!1,g="function"==typeof setTimeout?setTimeout:null,m="function"==typeof clearTimeout?clearTimeout:null,y="undefined"!=typeof setImmediate?setImmediate:null;function b(e){for(var o=n(u);null!==o;){if(null===o.callback)r(u);else{if(!(o.startTime<=e))break;r(u),o.sortIndex=o.expirationTime,t(l,o)}o=n(u)}}function w(e){if(v=!1,b(e),!p)if(null!==n(l))p=!0,T(k);else{var t=n(u);null!==t&&I(w,t.startTime-e)}}function k(t,o){p=!1,v&&(v=!1,m(_),_=-1),h=!0;var i=f;try{for(b(o),d=n(l);null!==d&&(!(d.expirationTime>o)||t&&!L());){var a=d.callback;if("function"==typeof a){d.callback=null,f=d.priorityLevel;var s=a(d.expirationTime<=o);o=e.unstable_now(),"function"==typeof s?d.callback=s:d===n(l)&&r(l),b(o)}else r(l);d=n(l)}if(null!==d)var c=!0;else{var g=n(u);null!==g&&I(w,g.startTime-o),c=!1}return c}finally{d=null,f=i,h=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var x,S=!1,C=null,_=-1,E=5,P=-1;function L(){return!(e.unstable_now()-Pe||125a?(r.sortIndex=i,t(u,r),null===n(l)&&r===n(u)&&(v?(m(_),_=-1):v=!0,I(w,i-a))):(r.sortIndex=s,t(l,r),p||h||(p=!0,T(k))),r},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}}(rA),function(e){e.exports=rA}(nA); -/** - * @license React - * react-dom.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 oA=cr,iA=tA;function aA(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;nt}return!1}function mA(e,t,n,r,o,i,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var yA={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){yA[e]=new mA(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];yA[t]=new mA(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){yA[e]=new mA(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){yA[e]=new mA(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){yA[e]=new mA(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){yA[e]=new mA(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){yA[e]=new mA(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){yA[e]=new mA(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){yA[e]=new mA(e,5,!1,e.toLowerCase(),null,!1,!1)}));var bA=/[\-:]([a-z])/g;function wA(e){return e[1].toUpperCase()}function kA(e,t,n,r){var o=yA.hasOwnProperty(t)?yA[t]:null;(null!==o?0!==o.type:r||!(2--s||o[a]!==i[s]){var l="\n"+o[a].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}}while(1<=a&&0<=s);break}}}finally{HA=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?FA(e):""}function WA(e){switch(e.tag){case 5:return FA(e.type);case 16:return FA("Lazy");case 13:return FA("Suspense");case 19:return FA("SuspenseList");case 0:case 2:case 15:return e=VA(e.type,!1);case 11:return e=VA(e.type.render,!1);case 1:return e=VA(e.type,!0);default:return""}}function UA(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case _A:return"Fragment";case CA:return"Portal";case PA:return"Profiler";case EA:return"StrictMode";case MA:return"Suspense";case TA:return"SuspenseList"}if("object"===kn(e))switch(e.$$typeof){case OA:return(e.displayName||"Context")+".Consumer";case LA:return(e._context.displayName||"Context")+".Provider";case AA:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case IA:return null!==(t=e.displayName||null)?t:UA(e.type)||"Memo";case RA:t=e._payload,e=e._init;try{return UA(e(t))}catch(qke){}}return null}function GA(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return UA(t);case 8:return t===EA?"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("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t}return null}function qA(e){switch(kn(e)){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function YA(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function ZA(e){e._valueTracker||(e._valueTracker=function(e){var t=YA(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(e){r=""+e,i.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function XA(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=YA(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function $A(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(nxe){return e.body}}function KA(e,t){var n=t.checked;return BA({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function QA(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=qA(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function JA(e,t){null!=(t=t.checked)&&kA(e,"checked",t,!1)}function eM(e,t){JA(e,t);var n=qA(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?nM(e,t.type,n):t.hasOwnProperty("defaultValue")&&nM(e,t.type,qA(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function tM(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function nM(e,t,n){"number"===t&&$A(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var rM=Array.isArray;function oM(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=dM.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}}));function hM(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var pM={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},vM=["Webkit","ms","Moz","O"];function gM(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||pM.hasOwnProperty(e)&&pM[e]?(""+t).trim():t+"px"}function mM(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),o=gM(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}Object.keys(pM).forEach((function(e){vM.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),pM[t]=pM[e]}))}));var yM=BA({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function bM(e,t){if(t){if(yM[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(aA(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(aA(60));if("object"!==kn(t.dangerouslySetInnerHTML)||!("__html"in t.dangerouslySetInnerHTML))throw Error(aA(61))}if(null!=t.style&&"object"!==kn(t.style))throw Error(aA(62))}}function wM(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var kM=null;function xM(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var SM=null,CM=null,_M=null;function EM(e){if(e=bN(e)){if("function"!=typeof SM)throw Error(aA(280));var t=e.stateNode;t&&(t=kN(t),SM(e.stateNode,e.type,t))}}function PM(e){CM?_M?_M.push(e):_M=[e]:CM=e}function LM(){if(CM){var e=CM,t=_M;if(_M=CM=null,EM(e),t)for(e=0;e>>=0,0===e?32:31-(lT(e)/uT|0)|0},lT=Math.log,uT=Math.LN2;var cT=64,dT=4194304;function fT(e){switch(e&-e){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 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function hT(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,a=268435455&n;if(0!==a){var s=a&~o;0!==s?r=fT(s):0!==(i&=a)&&(r=fT(i))}else 0!==(a=n&~o)?r=fT(a):0!==i&&(r=fT(i));if(0===r)return 0;if(0!==t&&t!==r&&0==(t&o)&&((o=r&-r)>=(i=t&-t)||16===o&&0!=(4194240&i)))return t;if(0!=(4&r)&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function yT(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-sT(t)]=n}function bT(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-sT(n),o=1<=NI),jI=String.fromCharCode(32),BI=!1;function FI(e,t){switch(e){case"keyup":return-1!==II.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function HI(e){return"object"===kn(e=e.detail)&&"data"in e?e.data:null}var VI=!1;var WI={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function UI(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!WI[e.type]:"textarea"===t}function GI(e,t,n,r){PM(r),0<(t=qR(t,"onChange")).length&&(n=new cI("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var qI=null,YI=null;function ZI(e){jR(e,0)}function XI(e){if(XA(wN(e)))return e}function $I(e,t){if("change"===e)return t}var KI=!1;if(dA){var QI;if(dA){var JI="oninput"in document;if(!JI){var eR=document.createElement("div");eR.setAttribute("oninput","return;"),JI="function"==typeof eR.oninput}QI=JI}else QI=!1;KI=QI&&(!document.documentMode||9=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=uR(r)}}function dR(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?dR(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function fR(){for(var e=window,t=$A();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(Kke){n=!1}if(!n)break;t=$A((e=t.contentWindow).document)}return t}function hR(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function pR(e){var t=fR(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&dR(n.ownerDocument.documentElement,n)){if(null!==r&&hR(n))if(t=r.start,void 0===(e=r.end)&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if((e=(t=n.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=void 0===r.end?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=cR(n,i);var a=cR(n,r);o&&a&&(1!==e.rangeCount||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&((t=t.createRange()).setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"==typeof n.focus&&n.focus(),n=0;n=document.documentMode,gR=null,mR=null,yR=null,bR=!1;function wR(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;bR||null==gR||gR!==$A(r)||("selectionStart"in(r=gR)&&hR(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},yR&&lR(yR,r)||(yR=r,0<(r=qR(mR,"onSelect")).length&&(t=new cI("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=gR)))}function kR(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var xR={animationend:kR("Animation","AnimationEnd"),animationiteration:kR("Animation","AnimationIteration"),animationstart:kR("Animation","AnimationStart"),transitionend:kR("Transition","TransitionEnd")},SR={},CR={};function _R(e){if(SR[e])return SR[e];if(!xR[e])return e;var t,n=xR[e];for(t in n)if(n.hasOwnProperty(t)&&t in CR)return SR[e]=n[t];return e}dA&&(CR=document.createElement("div").style,"AnimationEvent"in window||(delete xR.animationend.animation,delete xR.animationiteration.animation,delete xR.animationstart.animation),"TransitionEvent"in window||delete xR.transitionend.transition);var ER=_R("animationend"),PR=_R("animationiteration"),LR=_R("animationstart"),OR=_R("transitionend"),AR=new Map,MR="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function TR(e,t){AR.set(e,t),uA(t,[e])}for(var IR=0;IRSN||(e.current=xN[SN],xN[SN]=null,SN--)}function EN(e,t){SN++,xN[SN]=e.current,e.current=t}var PN={},LN=CN(PN),ON=CN(!1),AN=PN;function MN(e,t){var n=e.type.contextTypes;if(!n)return PN;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o,i={};for(o in n)i[o]=t[o];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function TN(e){return null!=(e=e.childContextTypes)}function IN(){_N(ON),_N(LN)}function RN(e,t,n){if(LN.current!==PN)throw Error(aA(168));EN(LN,t),EN(ON,n)}function NN(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var o in r=r.getChildContext())if(!(o in t))throw Error(aA(108,GA(e)||"Unknown",o));return BA({},n,r)}function DN(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||PN,AN=LN.current,EN(LN,e),EN(ON,ON.current),!0}function zN(e,t,n){var r=e.stateNode;if(!r)throw Error(aA(169));n?(e=NN(e,t,AN),r.__reactInternalMemoizedMergedChildContext=e,_N(ON),_N(LN),EN(LN,e)):_N(ON),EN(ON,n)}var jN=null,BN=!1,FN=!1;function HN(e){null===jN?jN=[e]:jN.push(e)}function VN(){if(!FN&&null!==jN){FN=!0;var e=0,t=wT;try{var n=jN;for(wT=1;e>=a,o-=a,$N=1<<32-sT(t)+o|n<v?(g=p,p=null):g=p.sibling;var m=f(o,p,s[v],l);if(null===m){null===p&&(p=g);break}e&&p&&null===m.alternate&&t(o,p),a=i(m,a,v),null===c?u=m:c.sibling=m,c=m,p=g}if(v===s.length)return n(o,p),oD&&QN(o,v),u;if(null===p){for(;vv?(g=p,p=null):g=p.sibling;var y=f(o,p,m.value,l);if(null===y){null===p&&(p=g);break}e&&p&&null===y.alternate&&t(o,p),a=i(y,a,v),null===c?u=y:c.sibling=y,c=y,p=g}if(m.done)return n(o,p),oD&&QN(o,v),u;if(null===p){for(;!m.done;v++,m=s.next())null!==(m=d(o,m.value,l))&&(a=i(m,a,v),null===c?u=m:c.sibling=m,c=m);return oD&&QN(o,v),u}for(p=r(o,p);!m.done;v++,m=s.next())null!==(m=h(p,o,v,m.value,l))&&(e&&null!==m.alternate&&p.delete(null===m.key?v:m.key),a=i(m,a,v),null===c?u=m:c.sibling=m,c=m);return e&&p.forEach((function(e){return t(o,e)})),oD&&QN(o,v),u}return function e(r,i,s,l){if("object"===kn(s)&&null!==s&&s.type===_A&&null===s.key&&(s=s.props.children),"object"===kn(s)&&null!==s){switch(s.$$typeof){case SA:e:{for(var u=s.key,c=i;null!==c;){if(c.key===u){if((u=s.type)===_A){if(7===c.tag){n(r,c.sibling),(i=o(c,s.props.children)).return=r,r=i;break e}}else if(c.elementType===u||"object"===kn(u)&&null!==u&&u.$$typeof===RA&&ZD(u)===c.type){n(r,c.sibling),(i=o(c,s.props)).ref=qD(r,c,s),i.return=r,r=i;break e}n(r,c);break}t(r,c),c=c.sibling}s.type===_A?((i=RF(s.props.children,r.mode,l,s.key)).return=r,r=i):((l=IF(s.type,s.key,s.props,null,r.mode,l)).ref=qD(r,i,s),l.return=r,r=l)}return a(r);case CA:e:{for(c=s.key;null!==i;){if(i.key===c){if(4===i.tag&&i.stateNode.containerInfo===s.containerInfo&&i.stateNode.implementation===s.implementation){n(r,i.sibling),(i=o(i,s.children||[])).return=r,r=i;break e}n(r,i);break}t(r,i),i=i.sibling}(i=zF(s,r.mode,l)).return=r,r=i}return a(r);case RA:return e(r,i,(c=s._init)(s._payload),l)}if(rM(s))return p(r,i,s,l);if(zA(s))return v(r,i,s,l);YD(r,s)}return"string"==typeof s&&""!==s||"number"==typeof s?(s=""+s,null!==i&&6===i.tag?(n(r,i.sibling),(i=o(i,s)).return=r,r=i):(n(r,i),(i=DF(s,r.mode,l)).return=r,r=i),a(r)):n(r,i)}}var $D=XD(!0),KD=XD(!1),QD={},JD=CN(QD),ez=CN(QD),tz=CN(QD);function nz(e){if(e===QD)throw Error(aA(174));return e}function rz(e,t){switch(EN(tz,t),EN(ez,e),EN(JD,QD),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:cM(null,"");break;default:t=cM(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}_N(JD),EN(JD,t)}function oz(){_N(JD),_N(ez),_N(tz)}function iz(e){nz(tz.current);var t=nz(JD.current),n=cM(t,e.type);t!==n&&(EN(ez,e),EN(JD,n))}function az(e){ez.current===e&&(_N(JD),_N(ez))}var sz=CN(0);function lz(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var uz=[];function cz(){for(var e=0;en?n:4,e(!0);var r=fz.transition;fz.transition={};try{e(!1),t()}finally{wT=n,fz.transition=r}}function Jz(){return Ez().memoizedState}function ej(e,t,n){var r=eF(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},nj(e))rj(t,n);else if(null!==(n=LD(e,t,n,r))){tF(n,e,r,JB()),oj(n,t,r)}}function tj(e,t,n){var r=eF(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(nj(e))rj(t,o);else{var i=e.alternate;if(0===e.lanes&&(null===i||0===i.lanes)&&null!==(i=t.lastRenderedReducer))try{var a=t.lastRenderedState,s=i(a,n);if(o.hasEagerState=!0,o.eagerState=s,sR(s,a)){var l=t.interleaved;return null===l?(o.next=o,PD(t)):(o.next=l.next,l.next=o),void(t.interleaved=o)}}catch(hpe){}null!==(n=LD(e,t,o,r))&&(tF(n,e,r,o=JB()),oj(n,t,r))}}function nj(e){var t=e.alternate;return e===pz||null!==t&&t===pz}function rj(e,t){yz=mz=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function oj(e,t,n){if(0!=(4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,bT(e,n)}}var ij={readContext:_D,useCallback:kz,useContext:kz,useEffect:kz,useImperativeHandle:kz,useInsertionEffect:kz,useLayoutEffect:kz,useMemo:kz,useReducer:kz,useRef:kz,useState:kz,useDebugValue:kz,useDeferredValue:kz,useTransition:kz,useMutableSource:kz,useSyncExternalStore:kz,useId:kz,unstable_isNewReconciler:!1},aj={readContext:_D,useCallback:function(e,t){return _z().memoizedState=[e,void 0===t?null:t],e},useContext:_D,useEffect:Vz,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,Fz(4194308,4,qz.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Fz(4194308,4,e,t)},useInsertionEffect:function(e,t){return Fz(4,2,e,t)},useMemo:function(e,t){var n=_z();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=_z();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=ej.bind(null,pz,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},_z().memoizedState=e},useState:zz,useDebugValue:Zz,useDeferredValue:function(e){return _z().memoizedState=e},useTransition:function(){var e=zz(!1),t=e[0];return e=Qz.bind(null,e[1]),_z().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=pz,o=_z();if(oD){if(void 0===n)throw Error(aA(407));n=n()}else{if(n=t(),null===LB)throw Error(aA(349));0!=(30&hz)||Tz(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,Vz(Rz.bind(null,r,i,e),[e]),r.flags|=2048,jz(9,Iz.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=_z(),t=LB.identifierPrefix;if(oD){var n=KN;t=":"+t+"R"+(n=($N&~(1<<32-sT($N)-1)).toString(32)+n),0<(n=bz++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=wz++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},sj={readContext:_D,useCallback:Xz,useContext:_D,useEffect:Wz,useImperativeHandle:Yz,useInsertionEffect:Uz,useLayoutEffect:Gz,useMemo:$z,useReducer:Lz,useRef:Bz,useState:function(){return Lz(Pz)},useDebugValue:Zz,useDeferredValue:function(e){return Kz(Ez(),vz.memoizedState,e)},useTransition:function(){return[Lz(Pz)[0],Ez().memoizedState]},useMutableSource:Az,useSyncExternalStore:Mz,useId:Jz,unstable_isNewReconciler:!1},lj={readContext:_D,useCallback:Xz,useContext:_D,useEffect:Wz,useImperativeHandle:Yz,useInsertionEffect:Uz,useLayoutEffect:Gz,useMemo:$z,useReducer:Oz,useRef:Bz,useState:function(){return Oz(Pz)},useDebugValue:Zz,useDeferredValue:function(e){var t=Ez();return null===vz?t.memoizedState=e:Kz(t,vz.memoizedState,e)},useTransition:function(){return[Oz(Pz)[0],Ez().memoizedState]},useMutableSource:Az,useSyncExternalStore:Mz,useId:Jz,unstable_isNewReconciler:!1};function uj(e,t){try{var n="",r=t;do{n+=WA(r),r=r.return}while(r);var o=n}catch(Xke){o="\nError generating stack: "+Xke.message+"\n"+Xke.stack}return{value:e,source:t,stack:o,digest:null}}function cj(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function dj(e,t){try{console.error(t.value)}catch(qke){setTimeout((function(){throw qke}))}}var fj="function"==typeof WeakMap?WeakMap:Map;function hj(e,t,n){(n=ID(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){WB||(WB=!0,UB=r),dj(0,t)},n}function pj(e,t,n){(n=ID(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){dj(0,t)}}var i=e.stateNode;return null!==i&&"function"==typeof i.componentDidCatch&&(n.callback=function(){dj(0,t),"function"!=typeof r&&(null===GB?GB=new Set([this]):GB.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function vj(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new fj;var o=new Set;r.set(t,o)}else void 0===(o=r.get(t))&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=CF.bind(null,e,t,n),t.then(e,e))}function gj(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function mj(e,t,n,r,o){return 0==(1&e.mode)?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=ID(-1,1)).tag=2,RD(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var yj=xA.ReactCurrentOwner,bj=!1;function wj(e,t,n,r){t.child=null===e?KD(t,null,n,r):$D(t,e.child,n,r)}function kj(e,t,n,r,o){n=n.render;var i=t.ref;return CD(t,o),r=Sz(e,t,n,r,i,o),n=Cz(),null===e||bj?(oD&&n&&eD(t),t.flags|=1,wj(e,t,r,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Wj(e,t,o))}function xj(e,t,n,r,o){if(null===e){var i=n.type;return"function"!=typeof i||MF(i)||void 0!==i.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=IF(n.type,null,r,t,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=i,Sj(e,t,i,r,o))}if(i=e.child,0==(e.lanes&o)){var a=i.memoizedProps;if((n=null!==(n=n.compare)?n:lR)(a,r)&&e.ref===t.ref)return Wj(e,t,o)}return t.flags|=1,(e=TF(i,r)).ref=t.ref,e.return=t,t.child=e}function Sj(e,t,n,r,o){if(null!==e){var i=e.memoizedProps;if(lR(i,r)&&e.ref===t.ref){if(bj=!1,t.pendingProps=r=i,0==(e.lanes&o))return t.lanes=e.lanes,Wj(e,t,o);0!=(131072&e.flags)&&(bj=!0)}}return Ej(e,t,n,r,o)}function Cj(e,t,n){var r=t.pendingProps,o=r.children,i=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(0==(1&t.mode))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},EN(TB,MB),MB|=n;else{if(0==(1073741824&n))return e=null!==i?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,EN(TB,MB),MB|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==i?i.baseLanes:n,EN(TB,MB),MB|=r}else null!==i?(r=i.baseLanes|n,t.memoizedState=null):r=n,EN(TB,MB),MB|=r;return wj(e,t,o,n),t.child}function _j(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ej(e,t,n,r,o){var i=TN(n)?AN:LN.current;return i=MN(t,i),CD(t,o),n=Sz(e,t,n,r,i,o),r=Cz(),null===e||bj?(oD&&r&&eD(t),t.flags|=1,wj(e,t,n,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Wj(e,t,o))}function Pj(e,t,n,r,o){if(TN(n)){var i=!0;DN(t)}else i=!1;if(CD(t,o),null===t.stateNode)Vj(e,t),WD(t,n,r),GD(t,n,r,o),r=!0;else if(null===e){var a=t.stateNode,s=t.memoizedProps;a.props=s;var l=a.context,u=n.contextType;"object"===kn(u)&&null!==u?u=_D(u):u=MN(t,u=TN(n)?AN:LN.current);var c=n.getDerivedStateFromProps,d="function"==typeof c||"function"==typeof a.getSnapshotBeforeUpdate;d||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==r||l!==u)&&UD(t,a,r,u),AD=!1;var f=t.memoizedState;a.state=f,zD(t,r,a,o),l=t.memoizedState,s!==r||f!==l||ON.current||AD?("function"==typeof c&&(FD(t,n,c,r),l=t.memoizedState),(s=AD||VD(t,n,s,r,f,l,u))?(d||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(t.flags|=4194308)):("function"==typeof a.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=u,r=s):("function"==typeof a.componentDidMount&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,TD(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:gD(t.type,s),a.props=u,d=t.pendingProps,f=a.context,"object"===kn(l=n.contextType)&&null!==l?l=_D(l):l=MN(t,l=TN(n)?AN:LN.current);var h=n.getDerivedStateFromProps;(c="function"==typeof h||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==d||f!==l)&&UD(t,a,r,l),AD=!1,f=t.memoizedState,a.state=f,zD(t,r,a,o);var p=t.memoizedState;s!==d||f!==p||ON.current||AD?("function"==typeof h&&(FD(t,n,h,r),p=t.memoizedState),(u=AD||VD(t,n,u,r,f,p,l)||!1)?(c||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(r,p,l),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,p,l)),"function"==typeof a.componentDidUpdate&&(t.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=l,r=u):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Lj(e,t,n,r,i,o)}function Lj(e,t,n,r,o,i){_j(e,t);var a=0!=(128&t.flags);if(!r&&!a)return o&&zN(t,n,!1),Wj(e,t,i);r=t.stateNode,yj.current=t;var s=a&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&a?(t.child=$D(t,e.child,null,i),t.child=$D(t,null,s,i)):wj(e,t,s,i),t.memoizedState=r.state,o&&zN(t,n,!0),t.child}function Oj(e){var t=e.stateNode;t.pendingContext?RN(0,t.pendingContext,t.pendingContext!==t.context):t.context&&RN(0,t.context,!1),rz(e,t.containerInfo)}function Aj(e,t,n,r,o){return hD(),pD(o),t.flags|=256,wj(e,t,n,r),t.child}var Mj,Tj,Ij,Rj={dehydrated:null,treeContext:null,retryLane:0};function Nj(e){return{baseLanes:e,cachePool:null,transitions:null}}function Dj(e,t,n){var r,o=t.pendingProps,i=sz.current,a=!1,s=0!=(128&t.flags);if((r=s)||(r=(null===e||null!==e.memoizedState)&&0!=(2&i)),r?(a=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(i|=1),EN(sz,1&i),null===e)return uD(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(0==(1&t.mode)?t.lanes=1:"$!"===e.data?t.lanes=8:t.lanes=1073741824,null):(s=o.children,e=o.fallback,a?(o=t.mode,a=t.child,s={mode:"hidden",children:s},0==(1&o)&&null!==a?(a.childLanes=0,a.pendingProps=s):a=NF(s,o,0,null),e=RF(e,o,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Nj(n),t.memoizedState=Rj,e):zj(t,s));if(null!==(i=e.memoizedState)&&null!==(r=i.dehydrated))return function(e,t,n,r,o,i,a){if(n)return 256&t.flags?(t.flags&=-257,jj(e,t,a,r=cj(Error(aA(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=NF({mode:"visible",children:r.children},o,0,null),(i=RF(i,o,a,null)).flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,0!=(1&t.mode)&&$D(t,e.child,null,a),t.child.memoizedState=Nj(a),t.memoizedState=Rj,i);if(0==(1&t.mode))return jj(e,t,a,null);if("$!"===o.data){if(r=o.nextSibling&&o.nextSibling.dataset)var s=r.dgst;return r=s,jj(e,t,a,r=cj(i=Error(aA(419)),r,void 0))}if(s=0!=(a&e.childLanes),bj||s){if(null!==(r=LB)){switch(a&-a){case 4:o=2;break;case 16:o=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:o=32;break;case 536870912:o=268435456;break;default:o=0}0!==(o=0!=(o&(r.suspendedLanes|a))?0:o)&&o!==i.retryLane&&(i.retryLane=o,OD(e,o),tF(r,e,o,-1))}return pF(),jj(e,t,a,r=cj(Error(aA(421))))}return"$?"===o.data?(t.flags|=128,t.child=e.child,t=EF.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,rD=uN(o.nextSibling),nD=t,oD=!0,iD=null,null!==e&&(YN[ZN++]=$N,YN[ZN++]=KN,YN[ZN++]=XN,$N=e.id,KN=e.overflow,XN=t),t=zj(t,r.children),t.flags|=4096,t)}(e,t,s,o,r,i,n);if(a){a=o.fallback,s=t.mode,r=(i=e.child).sibling;var l={mode:"hidden",children:o.children};return 0==(1&s)&&t.child!==i?((o=t.child).childLanes=0,o.pendingProps=l,t.deletions=null):(o=TF(i,l)).subtreeFlags=14680064&i.subtreeFlags,null!==r?a=TF(r,a):(a=RF(a,s,n,null)).flags|=2,a.return=t,o.return=t,o.sibling=a,t.child=o,o=a,a=t.child,s=null===(s=e.child.memoizedState)?Nj(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},a.memoizedState=s,a.childLanes=e.childLanes&~n,t.memoizedState=Rj,o}return e=(a=e.child).sibling,o=TF(a,{mode:"visible",children:o.children}),0==(1&t.mode)&&(o.lanes=n),o.return=t,o.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=o,t.memoizedState=null,o}function zj(e,t){return(t=NF({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function jj(e,t,n,r){return null!==r&&pD(r),$D(t,e.child,null,n),(e=zj(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Bj(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),SD(e.return,t,n)}function Fj(e,t,n,r,o){var i=e.memoizedState;null===i?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function Hj(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(wj(e,t,r.children,n),0!=(2&(r=sz.current)))r=1&r|2,t.flags|=128;else{if(null!==e&&0!=(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Bj(e,n,t);else if(19===e.tag)Bj(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(EN(sz,r),0==(1&t.mode))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;null!==n;)null!==(e=n.alternate)&&null===lz(e)&&(o=n),n=n.sibling;null===(n=o)?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Fj(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;null!==o;){if(null!==(e=o.alternate)&&null===lz(e)){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Fj(t,!0,n,null,i);break;case"together":Fj(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Vj(e,t){0==(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Wj(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),NB|=t.lanes,0==(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(aA(153));if(null!==t.child){for(n=TF(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=TF(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function Uj(e,t){if(!oD)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Gj(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=14680064&o.subtreeFlags,r|=14680064&o.flags,o.return=e,o=o.sibling;else for(o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function qj(e,t,n){var r=t.pendingProps;switch(tD(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Gj(t),null;case 1:case 17:return TN(t.type)&&IN(),Gj(t),null;case 3:return r=t.stateNode,oz(),_N(ON),_N(LN),cz(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(dD(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&0==(256&t.flags)||(t.flags|=1024,null!==iD&&(iF(iD),iD=null))),Gj(t),null;case 5:az(t);var o=nz(tz.current);if(n=t.type,null!==e&&null!=t.stateNode)Tj(e,t,n,r),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(null===t.stateNode)throw Error(aA(166));return Gj(t),null}if(e=nz(JD.current),dD(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[fN]=t,r[hN]=i,e=0!=(1&t.mode),n){case"dialog":BR("cancel",r),BR("close",r);break;case"iframe":case"object":case"embed":BR("load",r);break;case"video":case"audio":for(o=0;o<\/script>",e=e.removeChild(e.firstChild)):"string"==typeof r.is?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),"select"===n&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[fN]=t,e[hN]=r,Mj(e,t),t.stateNode=e;e:{switch(a=wM(n,r),n){case"dialog":BR("cancel",e),BR("close",e),o=r;break;case"iframe":case"object":case"embed":BR("load",e),o=r;break;case"video":case"audio":for(o=0;oHB&&(t.flags|=128,r=!0,Uj(i,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=lz(a))){if(t.flags|=128,r=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),Uj(i,!0),null===i.tail&&"hidden"===i.tailMode&&!a.alternate&&!oD)return Gj(t),null}else 2*QM()-i.renderingStartTime>HB&&1073741824!==n&&(t.flags|=128,r=!0,Uj(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(null!==(n=i.last)?n.sibling=a:t.child=a,i.last=a)}return null!==i.tail?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=QM(),t.sibling=null,n=sz.current,EN(sz,r?1&n|2:1&n),t):(Gj(t),null);case 22:case 23:return cF(),r=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==r&&(t.flags|=8192),r&&0!=(1&t.mode)?0!=(1073741824&MB)&&(Gj(t),6&t.subtreeFlags&&(t.flags|=8192)):Gj(t),null;case 24:case 25:return null}throw Error(aA(156,t.tag))}function Yj(e,t){switch(tD(t),t.tag){case 1:return TN(t.type)&&IN(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return oz(),_N(ON),_N(LN),cz(),0!=(65536&(e=t.flags))&&0==(128&e)?(t.flags=-65537&e|128,t):null;case 5:return az(t),null;case 13:if(_N(sz),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(aA(340));hD()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return _N(sz),null;case 4:return oz(),null;case 10:return xD(t.type._context),null;case 22:case 23:return cF(),null;default:return null}}Mj=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Tj=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,nz(JD.current);var i,a=null;switch(n){case"input":o=KA(e,o),r=KA(e,r),a=[];break;case"select":o=BA({},o,{value:void 0}),r=BA({},r,{value:void 0}),a=[];break;case"textarea":o=iM(e,o),r=iM(e,r),a=[];break;default:"function"!=typeof o.onClick&&"function"==typeof r.onClick&&(e.onclick=JR)}for(u in bM(n,r),n=null,o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&null!=o[u])if("style"===u){var s=o[u];for(i in s)s.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else"dangerouslySetInnerHTML"!==u&&"children"!==u&&"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&"autoFocus"!==u&&(lA.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in r){var l=r[u];if(s=null!=o?o[u]:void 0,r.hasOwnProperty(u)&&l!==s&&(null!=l||null!=s))if("style"===u)if(s){for(i in s)!s.hasOwnProperty(i)||l&&l.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in l)l.hasOwnProperty(i)&&s[i]!==l[i]&&(n||(n={}),n[i]=l[i])}else n||(a||(a=[]),a.push(u,n)),n=l;else"dangerouslySetInnerHTML"===u?(l=l?l.__html:void 0,s=s?s.__html:void 0,null!=l&&s!==l&&(a=a||[]).push(u,l)):"children"===u?"string"!=typeof l&&"number"!=typeof l||(a=a||[]).push(u,""+l):"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&(lA.hasOwnProperty(u)?(null!=l&&"onScroll"===u&&BR("scroll",e),a||s===l||(a=[])):(a=a||[]).push(u,l))}n&&(a=a||[]).push("style",n);var u=a;(t.updateQueue=u)&&(t.flags|=4)}},Ij=function(e,t,n,r){n!==r&&(t.flags|=4)};var Zj=!1,Xj=!1,$j="function"==typeof WeakSet?WeakSet:Set,Kj=null;function Qj(e,t){var n=e.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(Kke){SF(e,t,Kke)}else n.current=null}function Jj(e,t,n){try{n()}catch(Kke){SF(e,t,Kke)}}var eB=!1;function tB(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,void 0!==i&&Jj(t,n,i)}o=o.next}while(o!==r)}}function nB(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function rB(e){var t=e.ref;if(null!==t){var n=e.stateNode;e.tag,e=n,"function"==typeof t?t(e):t.current=e}}function oB(e){var t=e.alternate;null!==t&&(e.alternate=null,oB(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&(delete t[fN],delete t[hN],delete t[vN],delete t[gN],delete t[mN])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function iB(e){return 5===e.tag||3===e.tag||4===e.tag}function aB(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||iB(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function sB(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=JR));else if(4!==r&&null!==(e=e.child))for(sB(e,t,n),e=e.sibling;null!==e;)sB(e,t,n),e=e.sibling}function lB(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(lB(e,t,n),e=e.sibling;null!==e;)lB(e,t,n),e=e.sibling}var uB=null,cB=!1;function dB(e,t,n){for(n=n.child;null!==n;)fB(e,t,n),n=n.sibling}function fB(e,t,n){if(aT&&"function"==typeof aT.onCommitFiberUnmount)try{aT.onCommitFiberUnmount(iT,n)}catch(Qke){}switch(n.tag){case 5:Xj||Qj(n,t);case 6:var r=uB,o=cB;uB=null,dB(e,t,n),cB=o,null!==(uB=r)&&(cB?(e=uB,n=n.stateNode,8===e.nodeType?e.parentNode.removeChild(n):e.removeChild(n)):uB.removeChild(n.stateNode));break;case 18:null!==uB&&(cB?(e=uB,n=n.stateNode,8===e.nodeType?lN(e.parentNode,n):1===e.nodeType&&lN(e,n),WT(e)):lN(uB,n.stateNode));break;case 4:r=uB,o=cB,uB=n.stateNode.containerInfo,cB=!0,dB(e,t,n),uB=r,cB=o;break;case 0:case 11:case 14:case 15:if(!Xj&&(null!==(r=n.updateQueue)&&null!==(r=r.lastEffect))){o=r=r.next;do{var i=o,a=i.destroy;i=i.tag,void 0!==a&&(0!=(2&i)||0!=(4&i))&&Jj(n,t,a),o=o.next}while(o!==r)}dB(e,t,n);break;case 1:if(!Xj&&(Qj(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(Qke){SF(n,t,Qke)}dB(e,t,n);break;case 21:dB(e,t,n);break;case 22:1&n.mode?(Xj=(r=Xj)||null!==n.memoizedState,dB(e,t,n),Xj=r):dB(e,t,n);break;default:dB(e,t,n)}}function hB(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new $j),t.forEach((function(t){var r=PF.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function pB(e,t){var n=t.deletions;if(null!==n)for(var r=0;ro&&(o=a),r&=~i}if(r=o,10<(r=(120>(r=QM()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*SB(r/1960))-r)){e.timeoutHandle=rN(wF.bind(null,e,BB,VB),r);break}wF(e,BB,VB);break;default:throw Error(aA(329))}}}return nF(e,QM()),e.callbackNode===n?rF.bind(null,e):null}function oF(e,t){var n=jB;return e.current.memoizedState.isDehydrated&&(dF(e,t).flags|=256),2!==(e=vF(e,t))&&(t=BB,BB=n,null!==t&&iF(t)),e}function iF(e){null===BB?BB=e:BB.push.apply(BB,e)}function aF(e,t){for(t&=~zB,t&=~DB,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0e?16:e,null===YB)var r=!1;else{if(e=YB,YB=null,ZB=0,0!=(6&PB))throw Error(aA(331));var o=PB;for(PB|=4,Kj=e.current;null!==Kj;){var i=Kj,a=i.child;if(0!=(16&Kj.flags)){var s=i.deletions;if(null!==s){for(var l=0;lQM()-FB?dF(e,0):zB|=n),nF(e,t)}function _F(e,t){0===t&&(0==(1&e.mode)?t=1:(t=dT,0==(130023424&(dT<<=1))&&(dT=4194304)));var n=JB();null!==(e=OD(e,t))&&(yT(e,t,n),nF(e,n))}function EF(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),_F(e,n)}function PF(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;null!==o&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(aA(314))}null!==r&&r.delete(t),_F(e,n)}function LF(e,t){return ZM(e,t)}function OF(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function AF(e,t,n,r){return new OF(e,t,n,r)}function MF(e){return!(!(e=e.prototype)||!e.isReactComponent)}function TF(e,t){var n=e.alternate;return null===n?((n=AF(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function IF(e,t,n,r,o,i){var a=2;if(r=e,"function"==typeof e)MF(e)&&(a=1);else if("string"==typeof e)a=5;else e:switch(e){case _A:return RF(n.children,o,i,t);case EA:a=8,o|=8;break;case PA:return(e=AF(12,n,t,2|o)).elementType=PA,e.lanes=i,e;case MA:return(e=AF(13,n,t,o)).elementType=MA,e.lanes=i,e;case TA:return(e=AF(19,n,t,o)).elementType=TA,e.lanes=i,e;case NA:return NF(n,o,i,t);default:if("object"===kn(e)&&null!==e)switch(e.$$typeof){case LA:a=10;break e;case OA:a=9;break e;case AA:a=11;break e;case IA:a=14;break e;case RA:a=16,r=null;break e}throw Error(aA(130,null==e?e:kn(e),""))}return(t=AF(a,n,t,o)).elementType=e,t.type=r,t.lanes=i,t}function RF(e,t,n,r){return(e=AF(7,e,r,t)).lanes=n,e}function NF(e,t,n,r){return(e=AF(22,e,r,t)).elementType=NA,e.lanes=n,e.stateNode={isHidden:!1},e}function DF(e,t,n){return(e=AF(6,e,null,t)).lanes=n,e}function zF(e,t,n){return(t=AF(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function jF(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=mT(0),this.expirationTimes=mT(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mT(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function BF(e,t,n,r,o,i,a,s,l){return e=new jF(e,t,n,s,l),1===t?(t=1,!0===i&&(t|=8)):t=0,i=AF(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},MD(i),e}function FF(e,t,n){var r=3=0||(o[n]=e[n]);return o}var _H={},EH={get exports(){return _H},set exports(e){_H=e}};function PH(){}function LH(){}LH.resetWarningCache=PH;EH.exports=function(){function e(e,t,n,r,o,i){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==i){var a=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 a.name="Invariant Violation",a}}function t(){return e}e.isRequired=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:LH,resetWarningCache:PH};return n.PropTypes=n,n}();var OH="data-focus-lock",AH="data-focus-lock-disabled";function MH(e,t){return n=t||null,r=function(t){return e.forEach((function(e){return function(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}(e,t)}))},o=cr.useState((function(){return{value:n,callback:r,facade:{get current(){return o.value},set current(e){var t=o.value;t!==e&&(o.value=e,o.callback(e,t))}}}}))[0],o.callback=r,o.facade;var n,r,o}var TH={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"};function IH(e){return e}function RH(e,t){void 0===t&&(t=IH);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(e){var o=t(e,r);return n.push(o),function(){n=n.filter((function(e){return e!==o}))}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var i=function(){var n=t;t=[],n.forEach(e)},a=function(){return Promise.resolve().then(i)};a(),n={push:function(e){t.push(e),a()},filter:function(e){return t=t.filter(e),n}}}};return o}function NH(e,t){return void 0===t&&(t=IH),RH(e,t)}function DH(e){void 0===e&&(e={});var t=RH(null);return t.options=YS({async:!0,ssr:!1},e),t}var zH=function(e){var t=e.sideCar,n=ZS(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 cr.createElement(r,YS({},n))};zH.isSideCarExport=!0;var jH=NH({},(function(e){return{target:e.target,currentTarget:e.currentTarget}})),BH=NH(),FH=NH(),HH=DH({async:!0}),VH=[],WH=cr.forwardRef((function(e,t){var n,r=cr.useState(),o=r[0],i=r[1],a=cr.useRef(),s=cr.useRef(!1),l=cr.useRef(null),u=e.children,c=e.disabled,d=e.noFocusGuards,f=e.persistentFocus,h=e.crossFrame,p=e.autoFocus;e.allowTextSelection;var v=e.group,g=e.className,m=e.whiteList,y=e.hasPositiveIndices,b=e.shards,w=void 0===b?VH:b,k=e.as,x=void 0===k?"div":k,S=e.lockProps,C=void 0===S?{}:S,_=e.sideCar,E=e.returnFocus,P=e.focusOptions,L=e.onActivation,O=e.onDeactivation,A=cr.useState({})[0],M=cr.useCallback((function(){l.current=l.current||document&&document.activeElement,a.current&&L&&L(a.current),s.current=!0}),[L]),T=cr.useCallback((function(){s.current=!1,O&&O(a.current)}),[O]);cr.useEffect((function(){c||(l.current=null)}),[]);var I=cr.useCallback((function(e){var t=l.current;if(t&&t.focus){var n="function"==typeof E?E(t):E;if(n){var r="object"===kn(n)?n:void 0;l.current=null,e?Promise.resolve().then((function(){return t.focus(r)})):t.focus(r)}}}),[E]),R=cr.useCallback((function(e){s.current&&jH.useMedium(e)}),[]),N=BH.useMedium,D=cr.useCallback((function(e){a.current!==e&&(a.current=e,i(e))}),[]),z=ps(((n={})[AH]=c&&"disabled",n[OH]=v,n),C),j=!0!==d,B=j&&"tail"!==d,F=MH([t,D]);return cr.createElement(cr.Fragment,null,j&&[cr.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:c?-1:0,style:TH}),y?cr.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:c?-1:1,style:TH}):null],!c&&cr.createElement(_,{id:A,sideCar:HH,observed:o,disabled:c,persistentFocus:f,crossFrame:h,autoFocus:p,whiteList:m,shards:w,onActivation:M,onDeactivation:T,returnFocus:I,focusOptions:P}),cr.createElement(x,ps({ref:F},z,{className:g,onBlur:N,onFocus:R}),u),B&&cr.createElement("div",{"data-focus-guard":!0,tabIndex:c?-1:0,style:TH}))}));WH.propTypes={},WH.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};var UH=WH;function GH(e,t){return GH=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},GH(e,t)}function qH(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,GH(e,t)}function YH(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ZH=function(e){for(var t=Array(e.length),n=0;n=0})).sort(lV)},cV=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"].join(","),dV="".concat(cV,", [data-focus-guard]"),fV=function e(t,n){var r;return ZH((null===(r=t.shadowRoot)||void 0===r?void 0:r.children)||t.children).reduce((function(t,r){return t.concat(r.matches(n?dV:cV)?[r]:[],e(r))}),[])},hV=function(e,t){return e.reduce((function(e,n){return e.concat(fV(n,t),n.parentNode?ZH(n.parentNode.querySelectorAll(cV)).filter((function(e){return e===n})):[])}),[])},pV=function(e,t){return ZH(e).filter((function(e){return JH(t,e)})).filter((function(e){return function(e){return!((nV(e)||function(e){return"BUTTON"===e.tagName}(e))&&("hidden"===e.type||e.disabled))}(e)}))},vV=function(e,t){return void 0===t&&(t=new Map),ZH(e).filter((function(e){return eV(t,e)}))},gV=function(e,t,n){return uV(pV(hV(e,n),t),!0,n)},mV=function(e,t){return uV(pV(hV(e),t),!1)},yV=function(e,t){return pV(function(e){var t=e.querySelectorAll("[".concat("data-autofocus-inside","]"));return ZH(t).map((function(e){return hV([e])})).reduce((function(e,t){return e.concat(t)}),[])}(e),t)},bV=function e(t,n){return t.shadowRoot?e(t.shadowRoot,n):!(void 0===Object.getPrototypeOf(t).contains||!Object.getPrototypeOf(t).contains.call(t,n))||ZH(t.children).some((function(t){return e(t,n)}))},wV=function e(t){return t.parentNode?e(t.parentNode):t},kV=function(e){return XH(e).filter(Boolean).reduce((function(e,t){var n=t.getAttribute(OH);return e.push.apply(e,n?function(e){for(var t=new Set,n=e.length,r=0;r0&&t.add(o),(i&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter((function(e,n){return!t.has(n)}))}(ZH(wV(t).querySelectorAll("[".concat(OH,'="').concat(n,'"]:not([').concat(AH,'="disabled"])')))):[t]),e}),[])},xV=function e(t){return t.activeElement?t.activeElement.shadowRoot?e(t.activeElement.shadowRoot):t.activeElement:void 0},SV=function(){return document.activeElement?document.activeElement.shadowRoot?xV(document.activeElement.shadowRoot):document.activeElement:void 0},CV=function(e){return Boolean(ZH(e.querySelectorAll("iframe")).some((function(e){return function(e){return e===document.activeElement}(e)})))},_V=function(e){var t=document&&SV();return!(!t||t.dataset&&t.dataset.focusGuard)&&kV(e).some((function(e){return bV(e,t)||CV(e)}))},EV=function(e,t){return rV(e)&&e.name?function(e,t){return t.filter(rV).filter((function(t){return t.name===e.name})).filter((function(e){return e.checked}))[0]||e}(e,t):e},PV=function(e){return e[0]&&e.length>1?EV(e[0],e):e[0]},LV=function(e,t){return e.length>1?e.indexOf(EV(e[t],e)):t},OV="NEW_FOCUS",AV=function(e,t,n,r){var o=e.length,i=e[0],a=e[o-1],s=iV(n);if(!(n&&e.indexOf(n)>=0)){var l,u,c=void 0!==n?t.indexOf(n):-1,d=r?t.indexOf(r):c,f=r?e.indexOf(r):-1,h=c-d,p=t.indexOf(i),v=t.indexOf(a),g=(l=t,u=new Set,l.forEach((function(e){return u.add(EV(e,l))})),l.filter((function(e){return u.has(e)}))),m=(void 0!==n?g.indexOf(n):-1)-(r?g.indexOf(r):c),y=LV(e,0),b=LV(e,o-1);return-1===c||-1===f?OV:!h&&f>=0?f:c<=p&&s&&Math.abs(h)>1?b:c>=v&&s&&Math.abs(h)>1?y:h&&Math.abs(m)>1?f:c<=p?b:c>v?y:h?Math.abs(h)>1?f:(o+f+h)%o:void 0}},MV=function(e,t,n){var r,o=e.map((function(e){return e.node})),i=vV(o.filter((r=n,function(e){var t,n=null===(t=tV(e))||void 0===t?void 0:t.autofocus;return e.autofocus||void 0!==n&&"false"!==n||r.indexOf(e)>=0})));return i&&i.length?PV(i):PV(vV(t))},TV=function e(t,n){return void 0===n&&(n=[]),n.push(t),t.parentNode&&e(t.parentNode.host||t.parentNode,n),n},IV=function(e,t){for(var n=TV(e),r=TV(t),o=0;o=0)return i}return!1},RV=function(e,t,n){var r=XH(e),o=XH(t),i=r[0],a=!1;return o.filter(Boolean).forEach((function(e){a=IV(a||e,e)||a,n.filter(Boolean).forEach((function(e){var t=IV(i,e);t&&(a=!a||bV(t,a)?t:IV(t,a))}))})),a},NV=function(e,t){return e.reduce((function(e,n){return e.concat(yV(n,t))}),[])},DV=function(e,t){var n=document&&SV(),r=kV(e).filter(aV),o=RV(n||e,e,r),i=new Map,a=mV(r,i),s=gV(r,i).filter((function(e){var t=e.node;return aV(t)}));if(s[0]||(s=a)[0]){var l=mV([o],i).map((function(e){return e.node})),u=function(e,t){var n=new Map;return t.forEach((function(e){return n.set(e.node,e)})),e.map((function(e){return n.get(e)})).filter(sV)}(l,s),c=u.map((function(e){return e.node})),d=AV(c,l,n,t);return d===OV?{node:MV(a,c,NV(r,i))}:void 0===d?d:u[d]}},zV=0,jV=!1,BV=function(e,t,n){void 0===n&&(n={});var r,o,i=DV(e,t);if(!jV&&i){if(zV>2)return console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),jV=!0,void setTimeout((function(){jV=!1}),1);zV++,r=i.node,o=n.focusOptions,"focus"in r&&r.focus(o),"contentWindow"in r&&r.contentWindow&&r.contentWindow.focus(),zV--}};function FV(e){var t=window.setImmediate;void 0!==t?t(e):setTimeout(e,1)}var HV=function(){return document&&document.activeElement===document.body||!!(e=document&&SV())&&ZH(document.querySelectorAll("[".concat("data-no-focus-lock","]"))).some((function(t){return bV(t,e)}));var e},VV=null,WV=null,UV=null,GV=!1,qV=function(){return!0};function YV(e,t,n,r){var o=null,i=e;do{var a=r[i];if(a.guard)a.node.dataset.focusAutoGuard&&(o=a);else{if(!a.lockItem)break;if(i!==e)return;o=null}}while((i+=n)!==t);o&&(o.node.tabIndex=0)}var ZV=function(e){return e&&"current"in e?e.current:e},XV=function e(t,n,r){return n&&(n.host===t&&(!n.activeElement||r.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,r))},$V=function(){var e,t,n,r,o,i,a,s=!1;if(VV){var l=VV,u=l.observed,c=l.persistentFocus,d=l.autoFocus,f=l.shards,h=l.crossFrame,p=l.focusOptions,v=u||UV&&UV.portaledElement,g=document&&document.activeElement;if(v){var m=[v].concat(f.map(ZV).filter(Boolean));if(g&&!function(e){return(VV.whiteList||qV)(e)}(g)||(c||(h?Boolean(GV):"meanwhile"===GV)||!HV()||!WV&&d)&&(v&&!(_V(m)||g&&function(e,t){return t.some((function(t){return XV(e,t,t)}))}(g,m)||(a=g,UV&&UV.portaledElement===a))&&(document&&!WV&&g&&!d?(g.blur&&g.blur(),document.body.focus()):(s=BV(m,WV,{focusOptions:p}),UV={})),GV=!1,WV=document&&document.activeElement),document){var y=document&&document.activeElement,b=(t=kV(e=m).filter(aV),n=RV(e,e,t),r=new Map,o=gV([n],r,!0),i=gV(t,r).filter((function(e){var t=e.node;return aV(t)})).map((function(e){return e.node})),o.map((function(e){var t=e.node;return{node:t,index:e.index,lockItem:i.indexOf(t)>=0,guard:iV(t)}}))),w=b.map((function(e){return e.node})).indexOf(y);w>-1&&(b.filter((function(e){var t=e.guard,n=e.node;return t&&n.dataset.focusAutoGuard})).forEach((function(e){return e.node.removeAttribute("tabIndex")})),YV(w,b.length,1,b),YV(w,-1,-1,b))}}}return s},KV=function(e){$V()&&e&&(e.stopPropagation(),e.preventDefault())},QV=function(){return FV($V)},JV=function(){GV="just",setTimeout((function(){GV="meanwhile"}),0)};jH.assignSyncMedium((function(e){var t=e.target,n=e.currentTarget;n.contains(t)||(UV={observerNode:n,portaledElement:t})})),BH.assignMedium(QV),FH.assignMedium((function(e){return e({moveFocusInside:BV,focusInside:_V})}));var eW=function(e,t){return function(n){var r,o=[];function i(){r=e(o.map((function(e){return e.props}))),t(r)}var a=function(e){function t(){return e.apply(this,arguments)||this}qH(t,e),t.peek=function(){return r};var a=t.prototype;return a.componentDidMount=function(){o.push(this),i()},a.componentDidUpdate=function(){i()},a.componentWillUnmount=function(){var e=o.indexOf(this);o.splice(e,1),i()},a.render=function(){return qr.createElement(n,this.props)},t}(cr.PureComponent);return YH(a,"displayName","SideEffect("+function(e){return e.displayName||e.name||"Component"}(n)+")"),a}}((function(e){return e.filter((function(e){return!e.disabled}))}),(function(e){var t=e.slice(-1)[0];t&&!VV&&(document.addEventListener("focusin",KV),document.addEventListener("focusout",QV),window.addEventListener("blur",JV));var n=VV,r=n&&t&&t.id===n.id;VV=t,n&&!r&&(n.onDeactivation(),e.filter((function(e){return e.id===n.id})).length||n.returnFocus(!t)),t?(WV=null,r&&n.observed===t.observed||t.onActivation(),$V(),FV($V)):(document.removeEventListener("focusin",KV),document.removeEventListener("focusout",QV),window.removeEventListener("blur",JV),WV=null)}))((function(){return null})),tW=cr.forwardRef((function(e,t){return cr.createElement(UH,ps({sideCar:eW,ref:t},e))})),nW=UH.propTypes||{};nW.sideCar,CH(nW,["sideCar"]),tW.propTypes={};var rW=tW,oW=function(e){var t=e.initialFocusRef,n=e.finalFocusRef,r=e.contentRef,o=e.restoreFocus,i=e.children,a=e.isDisabled,s=e.autoFocus,l=e.persistentFocus,u=e.lockFocusAcrossFrames,c=cr.useCallback((function(){if(null==t?void 0:t.current)t.current.focus();else if(null==r?void 0:r.current){0===iL(r.current).length&&requestAnimationFrame((function(){var e;null==(e=r.current)||e.focus()}))}}),[t,r]),d=cr.useCallback((function(){var e;null==(e=null==n?void 0:n.current)||e.focus()}),[n]),f=o&&!n;return qr.createElement(rW,{crossFrame:u,persistentFocus:l,autoFocus:s,disabled:a,onActivation:c,onDeactivation:d,returnFocus:f},i)};oW.displayName="FocusLock";var iW="right-scroll-bar-position",aW="width-before-scroll-bar",sW=DH(),lW=function(){},uW=cr.forwardRef((function(e,t){var n=cr.useRef(null),r=cr.useState({onScrollCapture:lW,onWheelCapture:lW,onTouchMoveCapture:lW}),o=r[0],i=r[1],a=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,c=e.enabled,d=e.shards,f=e.sideCar,h=e.noIsolation,p=e.inert,v=e.allowPinchZoom,g=e.as,m=void 0===g?"div":g,y=ZS(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),b=f,w=MH([n,t]),k=YS(YS({},y),o);return cr.createElement(cr.Fragment,null,c&&cr.createElement(b,{sideCar:sW,removeScrollBar:u,shards:d,noIsolation:h,inert:p,setCallbacks:i,allowPinchZoom:!!v,lockRef:n}),a?cr.cloneElement(cr.Children.only(s),YS(YS({},k),{ref:w})):cr.createElement(m,YS({},k,{className:l,ref:w}),s))}));uW.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},uW.classNames={fullWidth:aW,zeroRight:iW};function cW(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var dW=function(){var e=0,t=null;return{add:function(n){var r;0==e&&(t=cW())&&(!function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}(t,n),r=t,(document.head||document.getElementsByTagName("head")[0]).appendChild(r)),e++},remove:function(){!--e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},fW=function(){var e,t=(e=dW(),function(t,n){cr.useEffect((function(){return e.add(t),function(){e.remove()}}),[t&&n])});return function(e){var n=e.styles,r=e.dynamic;return t(n,r),null}},hW={left:0,top:0,right:0,gap:0},pW=function(e){return parseInt(e||"",10)||0},vW=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return hW;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[pW(n),pW(r),pW(o)]}(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])}},gW=fW(),mW=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,s=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(s,"px ").concat(r,";\n }\n body {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(i,"px;\n padding-right: ").concat(a,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(s,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(iW," {\n right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(aW," {\n margin-right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(iW," .").concat(iW," {\n right: 0 ").concat(r,";\n }\n \n .").concat(aW," .").concat(aW," {\n margin-right: 0 ").concat(r,";\n }\n \n body {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},yW=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=void 0===r?"margin":r,i=cr.useMemo((function(){return vW(o)}),[o]);return cr.createElement(gW,{styles:mW(i,!t,o,n?"":"!important")})},bW=!1;if("undefined"!=typeof window)try{var wW=Object.defineProperty({},"passive",{get:function(){return bW=!0,!0}});window.addEventListener("test",wW,wW),window.removeEventListener("test",wW,wW)}catch(COe){bW=!1}var kW=!!bW&&{passive:!1},xW=function(e,t){var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},SW=function(e,t){var n=t;do{if("undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),CW(e,n)){var r=_W(e,n);if(r[1]>r[2])return!0}n=n.parentNode}while(n&&n!==document.body);return!1},CW=function(e,t){return"v"===e?function(e){return xW(e,"overflowY")}(t):function(e){return xW(e,"overflowX")}(t)},_W=function(e,t){return"v"===e?function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]}(t):function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t)},EW=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},PW=function(e){return[e.deltaX,e.deltaY]},LW=function(e){return e&&"current"in e?e.current:e},OW=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},AW=0,MW=[];var TW,IW=(TW=function(e){var t=cr.useRef([]),n=cr.useRef([0,0]),r=cr.useRef(),o=cr.useState(AW++)[0],i=cr.useState((function(){return fW()}))[0],a=cr.useRef(e);cr.useEffect((function(){a.current=e}),[e]),cr.useEffect((function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=QS([e.lockRef.current],(e.shards||[]).map(LW),!0).filter(Boolean);return t.forEach((function(e){return e.classList.add("allow-interactivity-".concat(o))})),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach((function(e){return e.classList.remove("allow-interactivity-".concat(o))}))}}}),[e.inert,e.lockRef.current,e.shards]);var s=cr.useCallback((function(e,t){if("touches"in e&&2===e.touches.length)return!a.current.allowPinchZoom;var o,i=EW(e),s=n.current,l="deltaX"in e?e.deltaX:s[0]-i[0],u="deltaY"in e?e.deltaY:s[1]-i[1],c=e.target,d=Math.abs(l)>Math.abs(u)?"h":"v";if("touches"in e&&"h"===d&&"range"===c.type)return!1;var f=SW(d,c);if(!f)return!0;if(f?o=d:(o="v"===d?"h":"v",f=SW(d,c)),!f)return!1;if(!r.current&&"changedTouches"in e&&(l||u)&&(r.current=o),!o)return!0;var h=r.current||o;return function(e,t,n,r,o){var i=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),a=i*r,s=n.target,l=t.contains(s),u=!1,c=a>0,d=0,f=0;do{var h=_W(e,s),p=h[0],v=h[1]-h[2]-i*p;(p||v)&&CW(e,s)&&(d+=v,f+=p),s=s.parentNode}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(c&&(o&&0===d||!o&&a>d)||!c&&(o&&0===f||!o&&-a>f))&&(u=!0),u}(h,t,e,"h"===h?l:u,!0)}),[]),l=cr.useCallback((function(e){var n=e;if(MW.length&&MW[MW.length-1]===i){var r="deltaY"in n?PW(n):EW(n),o=t.current.filter((function(e){return e.name===n.type&&e.target===n.target&&function(e,t){return e[0]===t[0]&&e[1]===t[1]}(e.delta,r)}))[0];if(o&&o.should)n.cancelable&&n.preventDefault();else if(!o){var l=(a.current.shards||[]).map(LW).filter(Boolean).filter((function(e){return e.contains(n.target)}));(l.length>0?s(n,l[0]):!a.current.noIsolation)&&n.cancelable&&n.preventDefault()}}}),[]),u=cr.useCallback((function(e,n,r,o){var i={name:e,delta:n,target:r,should:o};t.current.push(i),setTimeout((function(){t.current=t.current.filter((function(e){return e!==i}))}),1)}),[]),c=cr.useCallback((function(e){n.current=EW(e),r.current=void 0}),[]),d=cr.useCallback((function(t){u(t.type,PW(t),t.target,s(t,e.lockRef.current))}),[]),f=cr.useCallback((function(t){u(t.type,EW(t),t.target,s(t,e.lockRef.current))}),[]);cr.useEffect((function(){return MW.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,kW),document.addEventListener("touchmove",l,kW),document.addEventListener("touchstart",c,kW),function(){MW=MW.filter((function(e){return e!==i})),document.removeEventListener("wheel",l,kW),document.removeEventListener("touchmove",l,kW),document.removeEventListener("touchstart",c,kW)}}),[]);var h=e.removeScrollBar,p=e.inert;return cr.createElement(cr.Fragment,null,p?cr.createElement(i,{styles:OW(o)}):null,h?cr.createElement(yW,{gapMode:"margin"}):null)},sW.useMedium(TW),zH),RW=cr.forwardRef((function(e,t){return cr.createElement(uW,YS({},e,{ref:t,sideCar:IW}))}));RW.classNames=uW.classNames;var NW=RW,DW=function(){for(var e=arguments.length,t=new Array(e),n=0;n1?t-1:0),r=1;r0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({role:"dialog"},e),{},{ref:Tv(t,v),id:b,tabIndex:-1,"aria-modal":!0,"aria-labelledby":E?w:void 0,"aria-describedby":O?k:void 0,onClick:zW(e.onClick,(function(e){return e.stopPropagation()}))})}),[k,O,b,w,E]),T=cr.useCallback((function(e){e.stopPropagation(),x.current===e.target&&jW.isTopModal(v)&&(l&&(null==i||i()),null==h||h())}),[i,l,h]),I=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({},e),{},{ref:Tv(t,g),onClick:zW(e.onClick,T),onKeyDown:zW(e.onKeyDown,C),onMouseDown:zW(e.onMouseDown,S)})}),[C,S,T]);return{isOpen:o,onClose:i,headerId:w,bodyId:k,setBodyMounted:A,setHeaderMounted:P,dialogRef:v,overlayRef:g,getDialogProps:M,getDialogContainerProps:I}}var FW=yn(Av({name:"ModalStylesContext",errorMessage:"useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in \"\" "}),2),HW=FW[0],VW=FW[1],WW=yn(Av({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in ``"}),2),UW=WW[0],GW=WW[1],qW=function(e){var t=e.portalProps,n=e.children,r=e.autoFocus,o=e.trapFocus,i=e.initialFocusRef,a=e.finalFocusRef,s=e.returnFocusOnClose,l=e.blockScrollOnMount,u=e.allowPinchZoom,c=e.preserveScrollBarGap,d=e.motionPreset,f=e.lockFocusAcrossFrames,h=e.onCloseComplete,p=Pv("Modal",e),v=un(un({},BW(e)),{},{autoFocus:r,trapFocus:o,initialFocusRef:i,finalFocusRef:a,returnFocusOnClose:s,blockScrollOnMount:l,allowPinchZoom:u,preserveScrollBarGap:c,motionPreset:d,lockFocusAcrossFrames:f});return qr.createElement(UW,{value:v},qr.createElement(HW,{value:p},qr.createElement(qS,{onExitComplete:h},v.isOpen&&qr.createElement(gH,un({},t),n))))};qW.defaultProps={lockFocusAcrossFrames:!0,returnFocusOnClose:!0,scrollBehavior:"outside",trapFocus:!0,autoFocus:!0,blockScrollOnMount:!0,allowPinchZoom:!1,motionPreset:"scale"},qW.displayName="Modal";var YW=Cv((function(e,t){var n=e.className,r=sn(e,Ce),o=GW(),i=o.bodyId,a=o.setBodyMounted;cr.useEffect((function(){return a(!0),function(){return a(!1)}}),[a]);var s=DW("chakra-modal__body",n),l=VW();return qr.createElement(Lv.div,un(un({ref:t,className:s,id:i},r),{},{__css:l.body}))}));YW.displayName="ModalBody";var ZW=Cv((function(e,t){var n=e.onClick,r=e.className,o=sn(e,_e),i=GW().onClose,a=DW("chakra-modal__close-btn",r),s=VW();return qr.createElement(xE,un({ref:t,__css:s.closeButton,className:a,onClick:zW(n,(function(e){e.stopPropagation(),i()}))},o))}));function XW(e){var t=GW(),n=t.autoFocus,r=t.trapFocus,o=t.dialogRef,i=t.initialFocusRef,a=t.blockScrollOnMount,s=t.allowPinchZoom,l=t.finalFocusRef,u=t.returnFocusOnClose,c=t.preserveScrollBarGap,d=t.lockFocusAcrossFrames,f=yn(nw(),2),h=f[0],p=f[1];return cr.useEffect((function(){!h&&p&&setTimeout(p)}),[h,p]),qr.createElement(oW,{autoFocus:n,isDisabled:!r,initialFocusRef:i,finalFocusRef:l,restoreFocus:u,contentRef:o,lockFocusAcrossFrames:d},qr.createElement(NW,{removeScrollBar:!c,allowPinchZoom:s,enabled:a,forwardProps:!0},e.children))}ZW.displayName="ModalCloseButton";var $W={slideInBottom:un(un({},SC),{},{custom:{offsetY:16,reverse:!0}}),slideInRight:un(un({},SC),{},{custom:{offsetX:16,reverse:!0}}),scale:un(un({},mC),{},{custom:{initialScale:.95,reverse:!0}}),none:{}},KW=Lv(BS.section),QW=cr.forwardRef((function(e,t){var n=e.preset,r=e.motionProps,o=void 0===r?function(e){return $W[e||"none"]}(n):r,i=sn(e,Ee);return qr.createElement(KW,un(un({ref:t},o),i))}));QW.displayName="ModalTransition";var JW=Cv((function(e,t){var n=e.className,r=e.children,o=e.containerProps,i=e.motionProps,a=sn(e,Pe),s=GW(),l=s.getDialogProps,u=s.getDialogContainerProps,c=l(a,t),d=u(o),f=DW("chakra-modal__content",n),h=VW(),p=un({display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0},h.dialog),v=un({display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0},h.dialogContainer),g=GW().motionPreset;return qr.createElement(XW,null,qr.createElement(Lv.div,un(un({},d),{},{className:"chakra-modal__content-container",tabIndex:-1,__css:v}),qr.createElement(QW,un(un({preset:g,motionProps:i,className:f},c),{},{__css:p}),r)))}));JW.displayName="ModalContent";var eU=Cv((function(e,t){var n=e.className,r=sn(e,Le),o=DW("chakra-modal__footer",n),i=un({display:"flex",alignItems:"center",justifyContent:"flex-end"},VW().footer);return qr.createElement(Lv.footer,un(un({ref:t},r),{},{__css:i,className:o}))}));eU.displayName="ModalFooter";var tU=Cv((function(e,t){var n=e.className,r=sn(e,Oe),o=GW(),i=o.headerId,a=o.setHeaderMounted;cr.useEffect((function(){return a(!0),function(){return a(!1)}}),[a]);var s=DW("chakra-modal__header",n),l=un({flex:0},VW().header);return qr.createElement(Lv.header,un(un({ref:t,className:s,id:i},r),{},{__css:l}))}));tU.displayName="ModalHeader";var nU=Lv(BS.div),rU=Cv((function(e,t){var n=e.className,r=(e.transition,e.motionProps),o=sn(e,Ae),i=DW("chakra-modal__overlay",n),a=un({pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh"},VW().overlay),s=GW().motionPreset,l=r||("none"===s?{}:pC);return qr.createElement(nU,un(un({},l),{},{__css:a,ref:t,className:i},o))}));function oU(e){var t=e.leastDestructiveRef,n=sn(e,Me);return qr.createElement(qW,un(un({},n),{},{initialFocusRef:t}))}rU.displayName="ModalOverlay";var iU=Cv((function(e,t){return qr.createElement(JW,un({ref:t,role:"alertdialog"},e))})),aU=yn(Av(),2),sU=(aU[0],aU[1]),lU=Lv(kC),uU=Cv((function(e,t){var n=e.className,r=e.children,o=e.motionProps,i=e.containerProps,a=sn(e,Te),s=GW(),l=s.getDialogProps,u=s.getDialogContainerProps,c=s.isOpen,d=l(a,t),f=u(i),h=DW("chakra-modal__content",n),p=VW(),v=un({display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0},p.dialog),g=un({display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0},p.dialogContainer),m=sU().placement;return qr.createElement(XW,null,qr.createElement(Lv.div,un(un({},f),{},{className:"chakra-modal__content-container",__css:g}),qr.createElement(lU,un(un({motionProps:o,direction:m,in:c,className:h},d),{},{__css:v}),r)))}));uU.displayName="DrawerContent";var cU=function(){for(var e=arguments.length,t=new Array(e),n=0;n\" "}),2),kU=wU[0],xU=wU[1],SU=yn(Av({name:"NumberInputContext",errorMessage:"useNumberInputContext: `context` is undefined. Seems you forgot to wrap number-input's components within "}),2),CU=SU[0],_U=SU[1],EU=Cv((function(e,t){var n=Pv("NumberInput",e),r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.focusInputOnChange,n=void 0===t||t,r=e.clampValueOnBlur,o=void 0===r||r,i=e.keepWithinRange,a=void 0===i||i,s=e.min,l=void 0===s?Number.MIN_SAFE_INTEGER:s,u=e.max,c=void 0===u?Number.MAX_SAFE_INTEGER:u,d=e.step,f=void 0===d?1:d,h=e.isReadOnly,p=e.isDisabled,v=e.isRequired,g=e.isInvalid,m=e.pattern,y=void 0===m?"[0-9]*(.[0-9]+)?":m,b=e.inputMode,w=void 0===b?"decimal":b,k=e.allowMouseWheel,x=e.id,S=(e.onChange,e.precision,e.name),C=e["aria-describedby"],_=e["aria-label"],E=e["aria-labelledby"],P=e.onFocus,L=e.onBlur,O=e.onInvalid,A=e.getAriaValueText,M=e.isValidCharacter,T=e.format,I=e.parse,R=sn(e,Ie),N=Yv(P),D=Yv(L),z=Yv(O),j=Yv(null!=M?M:yU),B=Yv(A),F=OE(e),H=F.update,V=F.increment,W=F.decrement,U=yn(cr.useState(!1),2),G=U[0],q=U[1],Y=!(h||p),Z=cr.useRef(null),X=cr.useRef(null),$=cr.useRef(null),K=cr.useRef(null),Q=cr.useCallback((function(e){return e.split("").filter(j).join("")}),[j]),J=cr.useCallback((function(e){var t;return null!==(t=null==I?void 0:I(e))&&void 0!==t?t:e}),[I]),ee=cr.useCallback((function(e){var t;return(null!==(t=null==T?void 0:T(e))&&void 0!==t?t:e).toString()}),[T]);U_((function(){(F.valueAsNumber>c||F.valueAsNumber0&&void 0!==arguments[0]?arguments[0]:f)}),[V,Y,f]),ne=cr.useCallback((function(){Y&&W(arguments.length>0&&void 0!==arguments[0]?arguments[0]:f)}),[W,Y,f]),re=gU(te,ne);vU($,"disabled",re.stop,re.isSpinning),vU(K,"disabled",re.stop,re.isSpinning);var oe=cr.useCallback((function(e){if(!e.nativeEvent.isComposing){var t=J(e.currentTarget.value);H(Q(t)),X.current={start:e.currentTarget.selectionStart,end:e.currentTarget.selectionEnd}}}),[H,Q,J]),ie=cr.useCallback((function(e){var t,n,r;null==N||N(e),X.current&&(e.target.selectionStart=null!==(t=X.current.start)&&void 0!==t?t:null==(r=e.currentTarget.value)?void 0:r.length,e.currentTarget.selectionEnd=null!==(n=X.current.end)&&void 0!==n?n:e.currentTarget.selectionStart)}),[N]),ae=cr.useCallback((function(e){if(!e.nativeEvent.isComposing){bU(e,j)||e.preventDefault();var t=se(e)*f,n={ArrowUp:function(){return te(t)},ArrowDown:function(){return ne(t)},Home:function(){return H(l)},End:function(){return H(c)}}[e.key];n&&(e.preventDefault(),n(e))}}),[j,f,te,ne,H,l,c]),se=function(e){var t=1;return(e.metaKey||e.ctrlKey)&&(t=.1),e.shiftKey&&(t=10),t},le=cr.useMemo((function(){var e=null==B?void 0:B(F.value);return null!=e?e:F.value.toString()||void 0}),[F.value,B]),ue=cr.useCallback((function(){var e=F.value;""!==F.value&&(/^[eE]/.test(F.value.toString())?F.setValue(""):(F.valueAsNumberc&&(e=c),F.cast(e)))}),[F,c,l]),ce=cr.useCallback((function(){q(!1),o&&ue()}),[o,q,ue]),de=cr.useCallback((function(){n&&requestAnimationFrame((function(){var e;null==(e=Z.current)||e.focus()}))}),[n]),fe=cr.useCallback((function(e){e.preventDefault(),re.up(),de()}),[de,re]),he=cr.useCallback((function(e){e.preventDefault(),re.down(),de()}),[de,re]);DE((function(){return Z.current}),"wheel",(function(e){var t,n,r=(null!==(t=null==(n=Z.current)?void 0:n.ownerDocument)&&void 0!==t?t:document).activeElement===Z.current;if(k&&r){e.preventDefault();var o=se(e)*f,i=Math.sign(e.deltaY);-1===i?te(o):1===i&&ne(o)}}),{passive:!1});var pe=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=p||a&&F.isAtMax;return un(un({},e),{},{ref:Tv(t,$),role:"button",tabIndex:-1,onPointerDown:fU(e.onPointerDown,(function(e){0!==e.button||n||fe(e)})),onPointerLeave:fU(e.onPointerLeave,re.stop),onPointerUp:fU(e.onPointerUp,re.stop),disabled:n,"aria-disabled":dU(n)})}),[F.isAtMax,a,fe,re.stop,p]),ve=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=p||a&&F.isAtMin;return un(un({},e),{},{ref:Tv(t,K),role:"button",tabIndex:-1,onPointerDown:fU(e.onPointerDown,(function(e){0!==e.button||n||he(e)})),onPointerLeave:fU(e.onPointerLeave,re.stop),onPointerUp:fU(e.onPointerUp,re.stop),disabled:n,"aria-disabled":dU(n)})}),[F.isAtMin,a,he,re.stop,p]),ge=cr.useCallback((function(){var e,t,n,r,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({name:S,inputMode:w,type:"text",pattern:y,"aria-labelledby":E,"aria-label":_,"aria-describedby":C,id:x,disabled:p},o),{},{readOnly:null!==(e=o.readOnly)&&void 0!==e?e:h,"aria-readonly":null!==(t=o.readOnly)&&void 0!==t?t:h,"aria-required":null!==(n=o.required)&&void 0!==n?n:v,required:null!==(r=o.required)&&void 0!==r?r:v,ref:Tv(Z,i),value:ee(F.value),role:"spinbutton","aria-valuemin":l,"aria-valuemax":c,"aria-valuenow":Number.isNaN(F.valueAsNumber)?void 0:F.valueAsNumber,"aria-invalid":dU(null!=g?g:F.isOutOfRange),"aria-valuetext":le,autoComplete:"off",autoCorrect:"off",onChange:fU(o.onChange,oe),onKeyDown:fU(o.onKeyDown,ae),onFocus:fU(o.onFocus,ie,(function(){return q(!0)})),onBlur:fU(o.onBlur,D,ce)})}),[S,w,y,E,_,ee,C,x,p,v,h,g,F.value,F.valueAsNumber,F.isOutOfRange,l,c,le,oe,ae,ie,D,ce]);return{value:ee(F.value),valueAsNumber:F.valueAsNumber,isFocused:G,isDisabled:p,isReadOnly:h,getIncrementButtonProps:pe,getDecrementButtonProps:ve,getInputProps:ge,htmlProps:R}}(D_(ua(e))),o=r.htmlProps,i=sn(r,Re),a=cr.useMemo((function(){return i}),[i]);return qr.createElement(CU,{value:a},qr.createElement(kU,{value:n},qr.createElement(Lv.div,un(un({},o),{},{ref:t,className:cU("chakra-numberinput",e.className),__css:un({position:"relative",zIndex:0},n.root)}))))}));EU.displayName="NumberInput";var PU=Cv((function(e,t){var n=xU();return qr.createElement(Lv.div,un(un({"aria-hidden":!0,ref:t},e),{},{__css:un({display:"flex",flexDirection:"column",position:"absolute",top:"0",insetEnd:"0px",margin:"1px",height:"calc(100% - 2px)",zIndex:1},n.stepperGroup)}))}));PU.displayName="NumberInputStepper";var LU=Cv((function(e,t){var n=(0,_U().getInputProps)(e,t),r=xU();return qr.createElement(Lv.input,un(un({},n),{},{className:cU("chakra-numberinput__field",e.className),__css:un({width:"100%"},r.field)}))}));LU.displayName="NumberInputField";var OU=Lv("div",{baseStyle:{display:"flex",justifyContent:"center",alignItems:"center",flex:1,transitionProperty:"common",transitionDuration:"normal",userSelect:"none",cursor:"pointer",lineHeight:"normal"}}),AU=Cv((function(e,t){var n,r=xU(),o=(0,_U().getDecrementButtonProps)(e,t);return qr.createElement(OU,un(un({},o),{},{__css:r.stepper}),null!==(n=e.children)&&void 0!==n?n:qr.createElement(hU,null))}));AU.displayName="NumberDecrementStepper";var MU=Cv((function(e,t){var n,r=(0,_U().getIncrementButtonProps)(e,t),o=xU();return qr.createElement(OU,un(un({},r),{},{__css:o.stepper}),null!==(n=e.children)&&void 0!==n?n:qr.createElement(pU,null))}));MU.displayName="NumberIncrementStepper";var TU=function(){for(var e=arguments.length,t=new Array(e),n=0;n`"}),2),zU=DU[0],jU=DU[1],BU=yn(Av({name:"PopoverStylesContext",errorMessage:"usePopoverStyles returned is 'undefined'. Seems you forgot to wrap the components in \"\" "}),2),FU=BU[0],HU=BU[1],VU="click",WU="hover";function UU(e,t){return e===t||(null==e?void 0:e.contains(t))}function GU(e){var t,n=e.currentTarget.ownerDocument.activeElement;return null!==(t=e.relatedTarget)&&void 0!==t?t:n}function qU(e){var t=Pv("Popover",e),n=ua(e),r=n.children,o=sn(n,De),i=vv(),a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.closeOnBlur,n=void 0===t||t,r=e.closeOnEsc,o=void 0===r||r,i=e.initialFocusRef,a=e.id,s=e.returnFocusOnClose,l=void 0===s||s,u=e.autoFocus,c=void 0===u||u,d=e.arrowSize,f=e.arrowShadowColor,h=e.trigger,p=void 0===h?VU:h,v=e.openDelay,g=void 0===v?200:v,m=e.closeDelay,y=void 0===m?200:m,b=e.isLazy,w=e.lazyBehavior,k=void 0===w?"unmount":w,x=e.computePositionOnMount,S=sn(e,Ne),C=XO(e),_=C.isOpen,E=C.onClose,P=C.onOpen,L=C.onToggle,O=cr.useRef(null),A=cr.useRef(null),M=cr.useRef(null),T=cr.useRef(!1),I=cr.useRef(!1);_&&(I.current=!0);var R=yn(cr.useState(!1),2),N=R[0],D=R[1],z=yn(cr.useState(!1),2),j=z[0],B=z[1],F=cr.useId(),H=null!=a?a:F,V=yn(["popover-trigger","popover-content","popover-header","popover-body"].map((function(e){return"".concat(e,"-").concat(H)})),4),W=V[0],U=V[1],G=V[2],q=V[3],Y=YO(un(un({},S),{},{enabled:_||!!x})),Z=Y.referenceRef,X=Y.getArrowProps,$=Y.getPopperProps,K=Y.getArrowInnerProps,Q=Y.forceUpdate,J=$O({isOpen:_,ref:M});FE({enabled:_,ref:A}),sL(M,{focusRef:A,visible:_,shouldFocus:l&&p===VU}),uL(M,{focusRef:i,visible:_,shouldFocus:c&&p===VU});var ee=KO({wasSelected:I.current,enabled:b,mode:k,isSelected:J.present}),te=cr.useCallback((function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=un(un({},t),{},{style:un(un({},t.style),{},(e={transformOrigin:TO.transformOrigin.varRef},gn(e,TO.arrowSize.var,d?"".concat(d,"px"):void 0),gn(e,TO.arrowShadowColor.var,f),e)),ref:Tv(M,r),children:ee?t.children:null,id:U,tabIndex:-1,role:"dialog",onKeyDown:RU(t.onKeyDown,(function(e){o&&"Escape"===e.key&&E()})),onBlur:RU(t.onBlur,(function(e){var t=GU(e),r=UU(M.current,t),o=UU(A.current,t);_&&n&&!r&&!o&&E()})),"aria-labelledby":N?G:void 0,"aria-describedby":j?q:void 0});return p===WU&&(i.role="tooltip",i.onMouseEnter=RU(t.onMouseEnter,(function(){T.current=!0})),i.onMouseLeave=RU(t.onMouseLeave,(function(e){null!==e.nativeEvent.relatedTarget&&(T.current=!1,setTimeout((function(){return E()}),y))}))),i}),[ee,U,N,G,j,q,p,o,E,_,n,y,f,d]),ne=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return $(un(un({},e),{},{style:un({visibility:_?"visible":"hidden"},e.style)}),t)}),[_,$]),re=cr.useCallback((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({},e),{},{ref:Tv(t,O,Z)})}),[O,Z]),oe=cr.useRef(),ie=cr.useRef(),ae=cr.useCallback((function(e){null==O.current&&Z(e)}),[Z]),se=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=un(un({},e),{},{ref:Tv(A,t,ae),id:W,"aria-haspopup":"dialog","aria-expanded":_,"aria-controls":U});return p===VU&&(r.onClick=RU(e.onClick,L)),p===WU&&(r.onFocus=RU(e.onFocus,(function(){void 0===oe.current&&P()})),r.onBlur=RU(e.onBlur,(function(e){var t=GU(e),r=!UU(M.current,t);_&&n&&r&&E()})),r.onKeyDown=RU(e.onKeyDown,(function(e){"Escape"===e.key&&E()})),r.onMouseEnter=RU(e.onMouseEnter,(function(){T.current=!0,oe.current=window.setTimeout((function(){return P()}),g)})),r.onMouseLeave=RU(e.onMouseLeave,(function(){T.current=!1,oe.current&&(clearTimeout(oe.current),oe.current=void 0),ie.current=window.setTimeout((function(){!1===T.current&&E()}),y)}))),r}),[W,_,U,p,ae,L,P,n,E,g,y]);cr.useEffect((function(){return function(){oe.current&&clearTimeout(oe.current),ie.current&&clearTimeout(ie.current)}}),[]);var le=cr.useCallback((function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{id:G,ref:Tv(e,(function(e){D(!!e)}))})}),[G]),ue=cr.useCallback((function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{id:q,ref:Tv(e,(function(e){B(!!e)}))})}),[q]);return{forceUpdate:Q,isOpen:_,onAnimationComplete:J.onComplete,onClose:E,getAnchorProps:re,getArrowProps:X,getArrowInnerProps:K,getPopoverPositionerProps:ne,getPopoverProps:te,getTriggerProps:se,getHeaderProps:le,getBodyProps:ue}}(un(un({},o),{},{direction:i.direction}));return qr.createElement(zU,{value:a},qr.createElement(FU,{value:t},function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r\" "}),2),fG=dG[0],hG=dG[1],pG=Cv((function(e,t){var n=e.min,r=e.max,o=e.value,i=e.isIndeterminate,a=e.role,s=sn(e,He),l=sG({value:o,min:n,max:r,isIndeterminate:i,role:a}),u=un({height:"100%"},hG().filledTrack);return qr.createElement(Lv.div,un(un(un({ref:t,style:un({width:"".concat(l.percent,"%")},s.style)},l.bind),s),{},{__css:u}))})),vG=Cv((function(e,t){var n,r=ua(e),o=r.value,i=r.min,a=void 0===i?0:i,s=r.max,l=void 0===s?100:s,u=r.hasStripe,c=r.isAnimated,d=r.children,f=r.borderRadius,h=r.isIndeterminate,p=r["aria-label"],v=r["aria-labelledby"],g=r.title,m=r.role,y=sn(r,Ve),b=Pv("Progress",e),w=null!=f?f:null==(n=b.track)?void 0:n.borderRadius,k={animation:"".concat(aG," 1s linear infinite")},x=un(un({},!h&&u&&c&&k),h&&{position:"absolute",willChange:"left",minWidth:"50%",animation:"".concat(iG," 1s ease infinite normal none running")}),S=un({overflow:"hidden",position:"relative"},b.track);return qr.createElement(Lv.div,un({ref:t,borderRadius:w,__css:S},y),qr.createElement(fG,{value:b},qr.createElement(pG,{"aria-label":p,"aria-labelledby":v,min:a,max:l,value:o,isIndeterminate:h,css:x,borderRadius:w,title:g,role:m}),d))}));vG.displayName="Progress",Lv("div",{baseStyle:{fontSize:"0.24em",top:"50%",left:"50%",width:"100%",textAlign:"center",position:"absolute",transform:"translate(-50%, -50%)"}}).displayName="CircularProgressLabel";var gG=function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:"page",n=e.touches[0]||e.changedTouches[0];return{x:n["".concat(t,"X")],y:n["".concat(t,"Y")]}}function _G(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"page";return{x:e["".concat(t,"X")],y:e["".concat(t,"Y")]}}function EG(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"page";return SG(e)?CG(e,t):_G(e,t)}function PG(e){return function(t){var n=xG(t);(!n||n&&0===t.button)&&e(t)}}function LG(e,t,n,r){return function(e,t,n,r){return e.addEventListener(t,n,r),function(){e.removeEventListener(t,n,r)}}(e,t,function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];function n(t){e(t,{point:EG(t)})}var r=t?PG(n):n;return r}(n,"pointerdown"===t),r)}function OG(e){var t=cr.useRef(null);return t.current=e,t}kG.displayName="SelectIcon";var AG=function(){function e(t,n,r){var o,i=this;if(an(this,e),gn(this,"history",[]),gn(this,"startEvent",null),gn(this,"lastEvent",null),gn(this,"lastEventInfo",null),gn(this,"handlers",{}),gn(this,"removeListeners",(function(){})),gn(this,"threshold",3),gn(this,"win",void 0),gn(this,"updatePoint",(function(){if(i.lastEvent&&i.lastEventInfo){var e=TG(i.lastEventInfo,i.history),t=null!==i.startEvent,n=function(e,t){if("number"==typeof e&&"number"==typeof t)return NG(e,t);if(DG(e)&&DG(t)){var n=NG(e.x,t.x),r=NG(e.y,t.y);return Math.sqrt(Math.pow(n,2)+Math.pow(r,2))}return 0}(e.offset,{x:0,y:0})>=i.threshold;if(t||n){var r=Pl().timestamp;i.history.push(un(un({},e.point),{},{timestamp:r}));var o=i.handlers,a=o.onStart,s=o.onMove;t||(null==a||a(i.lastEvent,e),i.startEvent=i.lastEvent),null==s||s(i.lastEvent,e)}}})),gn(this,"onPointerMove",(function(e,t){i.lastEvent=e,i.lastEventInfo=t,xl.update(i.updatePoint,!0)})),gn(this,"onPointerUp",(function(e,t){var n=TG(t,i.history),r=i.handlers,o=r.onEnd,a=r.onSessionEnd;null==a||a(e,n),i.end(),o&&i.startEvent&&(null==o||o(e,n))})),this.win=null!==(o=t.view)&&void 0!==o?o:window,!(SG(a=t)&&a.touches.length>1)){var a;this.handlers=n,r&&(this.threshold=r),t.stopPropagation(),t.preventDefault();var s={point:EG(t)},l=Pl().timestamp;this.history=[un(un({},s.point),{},{timestamp:l})];var u=n.onSessionStart;null==u||u(t,TG(s,this.history)),this.removeListeners=function(){for(var e=arguments.length,t=new Array(e),n=0;n=0&&(r=e[n],!(o.timestamp-r.timestamp>IG(t)));)n--;if(!r)return{x:0,y:0};var i=(o.timestamp-r.timestamp)/1e3;if(0===i)return{x:0,y:0};var a={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function NG(e,t){return Math.abs(e-t)}function DG(e){return"x"in e&&"y"in e}function zG(e,t){var n=t.onPan,r=t.onPanStart,o=t.onPanEnd,i=t.onPanSessionStart,a=t.onPanSessionEnd,s=t.threshold,l=Boolean(n||r||o||i||a),u=cr.useRef(null),c=OG({onSessionStart:i,onSessionEnd:a,onStart:r,onMove:n,onEnd:function(e,t){u.current=null,null==o||o(e,t)}});cr.useEffect((function(){var e;null==(e=u.current)||e.updateHandlers(c.current)})),cr.useEffect((function(){var t=e.current;if(t&&l)return LG(t,"pointerdown",(function(e){u.current=new AG(e,c.current,s)}))}),[e,l,c,s]),cr.useEffect((function(){return function(){var e;null==(e=u.current)||e.end(),u.current=null}}),[])}var jG=Boolean(null==globalThis?void 0:globalThis.document)?cr.useLayoutEffect:cr.useEffect;function BG(e){var t=e.getNodes,n=e.observeMutation,r=void 0===n||n,o=yn(cr.useState([]),2),i=o[0],a=o[1],s=yn(cr.useState(0),2),l=s[0],u=s[1];return jG((function(){var e=t(),n=e.map((function(e,t){return function(e,t){var n;if(e){t({width:e.offsetWidth,height:e.offsetHeight});var r=new(null!==(n=e.ownerDocument.defaultView)&&void 0!==n?n:window).ResizeObserver((function(n){if(Array.isArray(n)&&n.length){var r,o,i=yn(n,1)[0];if("borderBoxSize"in i){var a=i.borderBoxSize,s=Array.isArray(a)?a[0]:a;r=s.inlineSize,o=s.blockSize}else r=e.offsetWidth,o=e.offsetHeight;t({width:r,height:o})}}));return r.observe(e,{box:"border-box"}),function(){return r.unobserve(e)}}t(void 0)}(e,(function(e){a((function(n){return[].concat(cn(n.slice(0,t)),[e],cn(n.slice(t+1)))}))}))}));if(r){var o=e[0];n.push(function(e,t){var n,r;if(e&&e.parentElement){var o=new(null!==(n=null==(r=e.ownerDocument)?void 0:r.defaultView)&&void 0!==n?n:window).MutationObserver((function(){t()}));return o.observe(e.parentElement,{childList:!0}),function(){o.disconnect()}}}(o,(function(){u((function(e){return e+1}))})))}return function(){n.forEach((function(e){null==e||e()}))}}),[l]),i}function FG(e){return yn(BG({observeMutation:!1,getNodes:function(){var t;return["object"===kn(t=e)&&null!==t&&"current"in t?e.current:e]}}),1)[0]}var HG=Object.getOwnPropertyNames,VG=function(e,t){return function(){return e&&(t=(0,e[HG(e)[0]])(e=0)),t}}({"../../../react-shim.js":function(){}});VG(),VG(),VG();var WG=function(e){return e?"":void 0},UG=function(e){return!!e||void 0},GG=function(){for(var e=arguments.length,t=new Array(e),n=0;nXG(t).height?e:t}),ZG):r.reduce((function(e,t){return XG(e).width>XG(t).width?e:t}),ZG),a=un({position:"relative",touchAction:"none",WebkitTapHighlightColor:"rgba(0,0,0,0)",userSelect:"none",outline:0},YG({orientation:t,vertical:i?{paddingLeft:i.width/2,paddingRight:i.width/2}:{},horizontal:i?{paddingTop:i.height/2,paddingBottom:i.height/2}:{}})),s=un({position:"absolute"},YG({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",height:"100%"},horizontal:{top:"50%",transform:"translateY(-50%)",width:"100%"}})),l=1===n.length,u=[0,o?100-n[0]:n[0]],c=l?u:n,d=c[0];!l&&o&&(d=100-d);var f=Math.abs(c[c.length-1]-c[0]);return{trackStyle:s,innerTrackStyle:un(un({},s),YG({orientation:t,vertical:o?{height:"".concat(f,"%"),top:"".concat(d,"%")}:{height:"".concat(f,"%"),bottom:"".concat(d,"%")},horizontal:o?{width:"".concat(f,"%"),right:"".concat(d,"%")}:{width:"".concat(f,"%"),left:"".concat(d,"%")}})),rootStyle:a,getThumbStyle:function(e){var o,i=null!==(o=r[e])&&void 0!==o?o:ZG;return un({position:"absolute",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",touchAction:"none"},YG({orientation:t,vertical:{bottom:"calc(".concat(n[e],"% - ").concat(i.height/2,"px)")},horizontal:{left:"calc(".concat(n[e],"% - ").concat(i.width/2,"px)")}}))}}}function KG(e){var t=e.isReversed,n=e.direction,r=e.orientation;return"ltr"===n||"vertical"===r?t:!t}function QG(e){var t=e.min,n=void 0===t?0:t,r=e.max,o=void 0===r?100:r,i=e.onChange,a=e.value,s=e.defaultValue,l=e.isReversed,u=e.direction,c=void 0===u?"ltr":u,d=e.orientation,f=void 0===d?"horizontal":d,h=e.id,p=e.isDisabled,v=e.isReadOnly,g=e.onChangeStart,m=e.onChangeEnd,y=e.step,b=void 0===y?1:y,w=e.getAriaValueText,k=e["aria-valuetext"],x=e["aria-label"],S=e["aria-labelledby"],C=e.name,_=e.focusThumbOnChange,E=void 0===_||_,P=e.minStepsBetweenThumbs,L=void 0===P?0:P,O=sn(e,qe),A=Yv(g),M=Yv(m),T=Yv(w),I=KG({isReversed:l,direction:c,orientation:f}),R=yn(Zv({value:a,defaultValue:null!=s?s:[25,75],onChange:i}),2),N=R[0],D=R[1];if(!Array.isArray(N))throw new TypeError("[range-slider] You passed an invalid value for `value` or `defaultValue`, expected `Array` but got `".concat(kn(N),"`"));var z=yn(cr.useState(!1),2),j=z[0],B=z[1],F=yn(cr.useState(!1),2),H=F[0],V=F[1],W=yn(cr.useState(-1),2),U=W[0],G=W[1],q=!(p||v),Y=cr.useRef(N),Z=N.map((function(e){return LE(e,n,o)})),X=function(e,t,n,r){return e.map((function(o,i){return{min:0===i?t:e[i-1]+r,max:i===e.length-1?n:e[i+1]-r}}))}(Z,n,o,L*b),$=cr.useRef({eventSource:null,value:[],valueBounds:[]});$.current.value=Z,$.current.valueBounds=X;var K=Z.map((function(e){return o-e+n})),Q=(I?K:Z).map((function(e){return _E(e,n,o)})),J="vertical"===f,ee=cr.useRef(null),te=cr.useRef(null),ne=BG({getNodes:function(){var e=te.current,t=null==e?void 0:e.querySelectorAll("[role=slider]");return t?Array.from(t):[]}}),re=cr.useId(),oe=function(e){return{root:"slider-root-".concat(e),getThumb:function(t){return"slider-thumb-".concat(e,"-").concat(t)},getInput:function(t){return"slider-input-".concat(e,"-").concat(t)},track:"slider-track-".concat(e),innerTrack:"slider-filled-track-".concat(e),getMarker:function(t){return"slider-marker-".concat(e,"-").concat(t)},output:"slider-output-".concat(e)}}(null!=h?h:re),ie=cr.useCallback((function(e){var t,r;if(ee.current){$.current.eventSource="pointer";var i=ee.current.getBoundingClientRect(),a=null!==(t=null==(r=e.touches)?void 0:r[0])&&void 0!==t?t:e,s=a.clientX,l=a.clientY,u=(J?i.bottom-l:s-i.left)/(J?i.height:i.width);return I&&(u=1-u),EE(u,n,o)}}),[J,I,o,n]),ae=(o-n)/10,se=b||(o-n)/100,le=cr.useMemo((function(){return{setValueAtIndex:function(e,t){if(q){var n=$.current.valueBounds[e];t=LE(t=parseFloat(PE(t,n.min,se)),n.min,n.max);var r=cn($.current.value);r[e]=t,D(r)}},setActiveIndex:G,stepUp:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:se,n=$.current.value[e],r=I?n-t:n+t;le.setValueAtIndex(e,r)},stepDown:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:se,n=$.current.value[e],r=I?n+t:n-t;le.setValueAtIndex(e,r)},reset:function(){D(Y.current)}}}),[se,I,D,q]),ue=cr.useCallback((function(e){var t={ArrowRight:function(){return le.stepUp(U)},ArrowUp:function(){return le.stepUp(U)},ArrowLeft:function(){return le.stepDown(U)},ArrowDown:function(){return le.stepDown(U)},PageUp:function(){return le.stepUp(U,ae)},PageDown:function(){return le.stepDown(U,ae)},Home:function(){var e=X[U].min;le.setValueAtIndex(U,e)},End:function(){var e=X[U].max;le.setValueAtIndex(U,e)}}[e.key];t&&(e.preventDefault(),e.stopPropagation(),t(e),$.current.eventSource="keyboard")}),[le,U,ae,X]),ce=cr.useMemo((function(){return $G({isReversed:I,orientation:f,thumbRects:ne,thumbPercents:Q})}),[I,f,Q,ne]),de=ce.getThumbStyle,fe=ce.rootStyle,he=ce.trackStyle,pe=ce.innerTrackStyle,ve=cr.useCallback((function(e){var t,n=null!=e?e:U;if(-1!==n&&E){var r=oe.getThumb(n),o=null==(t=te.current)?void 0:t.ownerDocument.getElementById(r);o&&setTimeout((function(){return o.focus()}))}}),[E,U,oe]);U_((function(){"keyboard"===$.current.eventSource&&(null==M||M($.current.value))}),[Z,M]);zG(te,{onPanSessionStart:function(e){q&&(B(!0),function(e){var t=ie(e)||0,n=$.current.value.map((function(e){return Math.abs(e-t)})),r=Math.min.apply(Math,cn(n)),o=n.indexOf(r),i=n.filter((function(e){return e===r}));i.length>1&&t>$.current.value[o]&&(o=o+i.length-1),G(o),le.setValueAtIndex(o,t),ve(o)}(e),null==A||A($.current.value))},onPanSessionEnd:function(){q&&(B(!1),null==M||M($.current.value))},onPan:function(e){q&&function(e){if(-1!=U){var t=ie(e)||0;G(U),le.setValueAtIndex(U,t),ve(U)}}(e)}});var ge=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un(un({},e),O),{},{id:oe.root,ref:Tv(t,te),tabIndex:-1,"aria-disabled":UG(p),"data-focused":WG(H),style:un(un({},e.style),fe)})}),[O,p,H,fe,oe]),me=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({},e),{},{ref:Tv(t,ee),id:oe.track,"data-disabled":WG(p),style:un(un({},e.style),he)})}),[p,he,oe]),ye=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({},e),{},{ref:t,id:oe.innerTrack,style:un(un({},e.style),pe)})}),[pe,oe]),be=cr.useCallback((function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=e.index,o=sn(e,Ye),i=Z[r];if(null==i)throw new TypeError("[range-slider > thumb] Cannot find value at index `".concat(r,"`. The `value` or `defaultValue` length is : ").concat(Z.length));var a=X[r];return un(un({},o),{},{ref:n,role:"slider",tabIndex:q?0:void 0,id:oe.getThumb(r),"data-active":WG(j&&U===r),"aria-valuetext":null!==(t=null==T?void 0:T(i))&&void 0!==t?t:null==k?void 0:k[r],"aria-valuemin":a.min,"aria-valuemax":a.max,"aria-valuenow":i,"aria-orientation":f,"aria-disabled":UG(p),"aria-readonly":UG(v),"aria-label":null==x?void 0:x[r],"aria-labelledby":(null==x?void 0:x[r])||null==S?void 0:S[r],style:un(un({},e.style),de(r)),onKeyDown:qG(e.onKeyDown,ue),onFocus:qG(e.onFocus,(function(){V(!0),G(r)})),onBlur:qG(e.onBlur,(function(){V(!1),G(-1)}))})}),[oe,Z,X,q,j,U,T,k,f,p,v,x,S,de,ue,V]),we=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({},e),{},{ref:t,id:oe.output,htmlFor:Z.map((function(e,t){return oe.getThumb(t)})).join(" "),"aria-live":"off"})}),[oe,Z]),ke=cr.useCallback((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=e.value,i=sn(e,Ze),a=!(ro),s=r>=Z[0]&&r<=Z[Z.length-1],l=_E(r,n,o),u=un({position:"absolute",pointerEvents:"none"},YG({orientation:f,vertical:{bottom:"".concat(l=I?100-l:l,"%")},horizontal:{left:"".concat(l,"%")}}));return un(un({},i),{},{ref:t,id:oe.getMarker(e.value),role:"presentation","aria-hidden":!0,"data-disabled":WG(p),"data-invalid":WG(!a),"data-highlighted":WG(s),style:un(un({},e.style),u)})}),[p,I,o,n,f,Z,oe]),xe=cr.useCallback((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=e.index,r=sn(e,Xe);return un(un({},r),{},{ref:t,id:oe.getInput(n),type:"hidden",value:Z[n],name:Array.isArray(C)?C[n]:"".concat(C,"-").concat(n)})}),[C,Z,oe]);return{state:{value:Z,isFocused:H,isDragging:j,getThumbPercent:function(e){return Q[e]},getThumbMinValue:function(e){return X[e].min},getThumbMaxValue:function(e){return X[e].max}},actions:le,getRootProps:ge,getTrackProps:me,getInnerTrackProps:ye,getThumbProps:be,getMarkerProps:ke,getInputProps:xe,getOutputProps:we}}var JG=yn(Av({name:"SliderContext",errorMessage:"useSliderContext: `context` is undefined. Seems you forgot to wrap all slider components within "}),2),eq=JG[0],tq=JG[1],nq=yn(Av({name:"RangeSliderStylesContext",errorMessage:"useRangeSliderStyles returned is 'undefined'. Seems you forgot to wrap the components in \"\" "}),2),rq=nq[0],oq=nq[1],iq=Cv((function(e,t){var n=Pv("Slider",e),r=ua(e),o=vv().direction;r.direction=o;var i=QG(r),a=i.getRootProps,s=sn(i,$e),l=cr.useMemo((function(){return un(un({},s),{},{name:e.name})}),[s,e.name]);return qr.createElement(eq,{value:l},qr.createElement(rq,{value:n},qr.createElement(Lv.div,un(un({},a({},t)),{},{className:"chakra-slider",__css:n.container}),e.children)))}));iq.defaultProps={orientation:"horizontal"},iq.displayName="RangeSlider";var aq=Cv((function(e,t){var n=tq(),r=n.getThumbProps,o=n.getInputProps,i=n.name,a=oq(),s=r(e,t);return qr.createElement(Lv.div,un(un({},s),{},{className:GG("chakra-slider__thumb",e.className),__css:a.thumb}),s.children,i&&qr.createElement("input",un({},o({index:e.index}))))}));aq.displayName="RangeSliderThumb";var sq=Cv((function(e,t){var n=tq().getTrackProps,r=oq(),o=n(e,t);return qr.createElement(Lv.div,un(un({},o),{},{className:GG("chakra-slider__track",e.className),__css:r.track,"data-testid":"chakra-range-slider-track"}))}));sq.displayName="RangeSliderTrack";var lq=Cv((function(e,t){var n=tq().getInnerTrackProps,r=oq(),o=n(e,t);return qr.createElement(Lv.div,un(un({},o),{},{className:"chakra-slider__filled-track",__css:r.filledTrack}))}));function uq(e){var t=e.orientation,n=e.vertical,r=e.horizontal;return"vertical"===t?n:r}function cq(e,t){return t"}),2),fq=dq[0],hq=dq[1],pq=yn(Av({name:"SliderStylesContext",hookName:"useSliderStyles",providerName:""}),2),vq=pq[0],gq=pq[1],mq=Cv((function(e,t){var n=Pv("Slider",e),r=ua(e),o=vv().direction;r.direction=o;var i=function(e){var t,n=e.min,r=void 0===n?0:n,o=e.max,i=void 0===o?100:o,a=e.onChange,s=e.value,l=e.defaultValue,u=e.isReversed,c=e.direction,d=void 0===c?"ltr":c,f=e.orientation,h=void 0===f?"horizontal":f,p=e.id,v=e.isDisabled,g=e.isReadOnly,m=e.onChangeStart,y=e.onChangeEnd,b=e.step,w=void 0===b?1:b,k=e.getAriaValueText,x=e["aria-valuetext"],S=e["aria-label"],C=e["aria-labelledby"],_=e.name,E=e.focusThumbOnChange,P=void 0===E||E,L=sn(e,Ke),O=Yv(m),A=Yv(y),M=Yv(k),T=KG({isReversed:u,direction:d,orientation:h}),I=yn(Zv({value:s,defaultValue:null!=l?l:cq(r,i),onChange:a}),2),R=I[0],N=I[1],D=yn(cr.useState(!1),2),z=D[0],j=D[1],B=yn(cr.useState(!1),2),F=B[0],H=B[1],V=!(v||g),W=(i-r)/10,U=w||(i-r)/100,G=LE(R,r,i),q=_E(T?i-G+r:G,r,i),Y="vertical"===h,Z=OG({min:r,max:i,step:w,isDisabled:v,value:G,isInteractive:V,isReversed:T,isVertical:Y,eventSource:null,focusThumbOnChange:P,orientation:h}),X=cr.useRef(null),$=cr.useRef(null),K=cr.useRef(null),Q=cr.useId(),J=null!=p?p:Q,ee="slider-thumb-".concat(J),te="slider-track-".concat(J),ne=cr.useCallback((function(e){var t,n;if(X.current){var r=Z.current;r.eventSource="pointer";var o=X.current.getBoundingClientRect(),i=null!==(t=null==(n=e.touches)?void 0:n[0])&&void 0!==t?t:e,a=i.clientX,s=i.clientY,l=(Y?o.bottom-s:a-o.left)/(Y?o.height:o.width);T&&(l=1-l);var u=EE(l,r.min,r.max);return r.step&&(u=parseFloat(PE(u,r.min,r.step))),LE(u,r.min,r.max)}}),[Y,T,Z]),re=cr.useCallback((function(e){var t=Z.current;t.isInteractive&&(e=LE(e=parseFloat(PE(e,t.min,U)),t.min,t.max),N(e))}),[U,N,Z]),oe=cr.useMemo((function(){return{stepUp:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:U;re(T?G-e:G+e)},stepDown:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:U;re(T?G+e:G-e)},reset:function(){re(l||0)},stepTo:function(e){re(e)}}}),[re,T,G,U,l]),ie=cr.useCallback((function(e){var t=Z.current,n={ArrowRight:function(){return oe.stepUp()},ArrowUp:function(){return oe.stepUp()},ArrowLeft:function(){return oe.stepDown()},ArrowDown:function(){return oe.stepDown()},PageUp:function(){return oe.stepUp(W)},PageDown:function(){return oe.stepDown(W)},Home:function(){return re(t.min)},End:function(){return re(t.max)}}[e.key];n&&(e.preventDefault(),e.stopPropagation(),n(e),t.eventSource="keyboard")}),[oe,re,W,Z]),ae=null!==(t=null==M?void 0:M(G))&&void 0!==t?t:x,se=FG($),le=cr.useMemo((function(){var e=Z.current,t=null!=se?se:{width:0,height:0};return $G({isReversed:T,orientation:e.orientation,thumbRects:[t],thumbPercents:[q]})}),[T,se,q,Z]),ue=le.getThumbStyle,ce=le.rootStyle,de=le.trackStyle,fe=le.innerTrackStyle,he=cr.useCallback((function(){Z.current.focusThumbOnChange&&setTimeout((function(){var e;return null==(e=$.current)?void 0:e.focus()}))}),[Z]);function pe(e){var t=ne(e);null!=t&&t!==Z.current.value&&N(t)}U_((function(){var e=Z.current;he(),"keyboard"===e.eventSource&&(null==A||A(e.value))}),[G,A]),zG(K,{onPanSessionStart:function(e){var t=Z.current;t.isInteractive&&(j(!0),he(),pe(e),null==O||O(t.value))},onPanSessionEnd:function(){var e=Z.current;e.isInteractive&&(j(!1),null==A||A(e.value))},onPan:function(e){Z.current.isInteractive&&pe(e)}});var ve=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un(un({},e),L),{},{ref:Tv(t,K),tabIndex:-1,"aria-disabled":UG(v),"data-focused":WG(F),style:un(un({},e.style),ce)})}),[L,v,F,ce]),ge=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({},e),{},{ref:Tv(t,X),id:te,"data-disabled":WG(v),style:un(un({},e.style),de)})}),[v,te,de]),me=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({},e),{},{ref:t,style:un(un({},e.style),fe)})}),[fe]),ye=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({},e),{},{ref:Tv(t,$),role:"slider",tabIndex:V?0:void 0,id:ee,"data-active":WG(z),"aria-valuetext":ae,"aria-valuemin":r,"aria-valuemax":i,"aria-valuenow":G,"aria-orientation":h,"aria-disabled":UG(v),"aria-readonly":UG(g),"aria-label":S,"aria-labelledby":S?void 0:C,style:un(un({},e.style),ue(0)),onKeyDown:qG(e.onKeyDown,ie),onFocus:qG(e.onFocus,(function(){return H(!0)})),onBlur:qG(e.onBlur,(function(){return H(!1)}))})}),[V,ee,z,ae,r,i,G,h,v,g,S,C,ue,ie]),be=cr.useCallback((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=!(e.valuei),o=G>=e.value,a=_E(e.value,r,i),s=un({position:"absolute",pointerEvents:"none"},uq({orientation:h,vertical:{bottom:"".concat(T?100-a:a,"%")},horizontal:{left:"".concat(T?100-a:a,"%")}}));return un(un({},e),{},{ref:t,role:"presentation","aria-hidden":!0,"data-disabled":WG(v),"data-invalid":WG(!n),"data-highlighted":WG(o),style:un(un({},e.style),s)})}),[v,T,i,r,h,G]),we=cr.useCallback((function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return un(un({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{ref:e,type:"hidden",value:G,name:_})}),[_,G]);return{state:{value:G,isFocused:F,isDragging:z},actions:oe,getRootProps:ve,getTrackProps:ge,getInnerTrackProps:me,getThumbProps:ye,getMarkerProps:be,getInputProps:we}}(r),a=i.getInputProps,s=i.getRootProps,l=sn(i,Qe),u=s(),c=a({},t);return qr.createElement(fq,{value:l},qr.createElement(vq,{value:n},qr.createElement(Lv.div,un(un({},u),{},{className:GG("chakra-slider",e.className),__css:n.container}),e.children,qr.createElement("input",un({},c)))))}));mq.defaultProps={orientation:"horizontal"},mq.displayName="Slider";var yq=Cv((function(e,t){var n=hq().getThumbProps,r=gq(),o=n(e,t);return qr.createElement(Lv.div,un(un({},o),{},{className:GG("chakra-slider__thumb",e.className),__css:r.thumb}))}));yq.displayName="SliderThumb";var bq=Cv((function(e,t){var n=hq().getTrackProps,r=gq(),o=n(e,t);return qr.createElement(Lv.div,un(un({},o),{},{className:GG("chakra-slider__track",e.className),__css:r.track}))}));bq.displayName="SliderTrack";var wq=Cv((function(e,t){var n=hq().getInnerTrackProps,r=gq(),o=n(e,t);return qr.createElement(Lv.div,un(un({},o),{},{className:GG("chakra-slider__filled-track",e.className),__css:r.filledTrack}))}));wq.displayName="SliderFilledTrack";var kq=Cv((function(e,t){var n=hq().getMarkerProps,r=gq(),o=n(e,t);return qr.createElement(Lv.div,un(un({},o),{},{className:GG("chakra-slider__marker",e.className),__css:r.mark}))}));kq.displayName="SliderMark";var xq=function(){for(var e=arguments.length,t=new Array(e),n=0;n"}),2),Iq=Tq[0],Rq=Tq[1];function Nq(e){var t=e.isDisabled,n=e.isFocusable,r=sn(e,tt),o=Rq(),i=o.setSelectedIndex,a=o.isManual,s=o.id,l=o.setFocusedIndex,u=o.selectedIndex,c=Mq({disabled:t&&!n}),d=c.index,f=c.register,h=d===u,p=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.ref,n=e.isDisabled,r=e.isFocusable,o=e.clickOnEnter,i=void 0===o||o,a=e.clickOnSpace,s=void 0===a||a,l=e.onMouseDown,u=e.onMouseUp,c=e.onClick,d=e.onKeyDown,f=e.onKeyUp,h=e.tabIndex,p=e.onMouseOver,v=e.onMouseLeave,g=sn(e,ke),m=yn(cr.useState(!0),2),y=m[0],b=m[1],w=yn(cr.useState(!1),2),k=w[0],x=w[1],S=XP(),C=function(e){e&&"BUTTON"!==e.tagName&&b(!1)},_=y?h:h||0,E=n&&!r,P=cr.useCallback((function(e){if(n)return e.stopPropagation(),void e.preventDefault();e.currentTarget.focus(),null==c||c(e)}),[n,c]),L=cr.useCallback((function(e){k&&$P(e)&&(e.preventDefault(),e.stopPropagation(),x(!1),S.remove(document,"keyup",L,!1))}),[k,S]),O=cr.useCallback((function(e){if(null==d||d(e),!(n||e.defaultPrevented||e.metaKey)&&$P(e.nativeEvent)&&!y){var t=i&&"Enter"===e.key;s&&" "===e.key&&(e.preventDefault(),x(!0)),t&&(e.preventDefault(),e.currentTarget.click()),S.add(document,"keyup",L,!1)}}),[n,y,d,i,s,S,L]),A=cr.useCallback((function(e){null==f||f(e),n||e.defaultPrevented||e.metaKey||$P(e.nativeEvent)&&!y&&s&&" "===e.key&&(e.preventDefault(),x(!1),e.currentTarget.click())}),[s,y,n,f]),M=cr.useCallback((function(e){0===e.button&&(x(!1),S.remove(document,"mouseup",M,!1))}),[S]),T=cr.useCallback((function(e){if(0===e.button){if(n)return e.stopPropagation(),void e.preventDefault();y||x(!0),e.currentTarget.focus({preventScroll:!0}),S.add(document,"mouseup",M,!1),null==l||l(e)}}),[n,y,l,S,M]),I=cr.useCallback((function(e){0===e.button&&(y||x(!1),null==u||u(e))}),[u,y]),R=cr.useCallback((function(e){n?e.preventDefault():null==p||p(e)}),[n,p]),N=cr.useCallback((function(e){k&&(e.preventDefault(),x(!1)),null==v||v(e)}),[k,v]),D=Tv(t,C);return un(un({},g),{},y?{ref:D,type:"button","aria-disabled":E?void 0:n,disabled:E,onClick:P,onMouseDown:l,onMouseUp:u,onKeyUp:f,onKeyDown:d,onMouseOver:p,onMouseLeave:v}:{ref:D,role:"button","data-active":ZP(k),"aria-disabled":n?"true":void 0,tabIndex:E?void 0:_,onClick:P,onMouseDown:T,onMouseUp:I,onKeyUp:A,onKeyDown:O,onMouseOver:R,onMouseLeave:N})}(un(un({},r),{},{ref:Tv(f,e.ref),isDisabled:t,isFocusable:n,onClick:Eq(e.onClick,(function(){i(d)}))}));return un(un({},p),{},{id:Bq(s,d),role:"tab",tabIndex:h?0:-1,type:"button","aria-selected":h,"aria-controls":Fq(s,d),onFocus:t?void 0:Eq(e.onFocus,(function(){l(d),!a&&!(t&&n)&&i(d)}))})}var Dq=yn(Av({}),2),zq=Dq[0],jq=Dq[1];function Bq(e,t){return"".concat(e,"--tab-").concat(t)}function Fq(e,t){return"".concat(e,"--tabpanel-").concat(t)}var Hq=yn(Av({name:"TabsStylesContext",errorMessage:"useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in \"\" "}),2),Vq=Hq[0],Wq=Hq[1],Uq=Cv((function(e,t){var n=Pv("Tabs",e),r=ua(e),o=r.children,i=r.className,a=function(e){var t,n=e.defaultIndex,r=e.onChange,o=e.index,i=e.isManual,a=e.isLazy,s=e.lazyBehavior,l=void 0===s?"unmount":s,u=e.orientation,c=void 0===u?"horizontal":u,d=e.direction,f=void 0===d?"ltr":d,h=sn(e,et),p=yn(cr.useState(null!=n?n:0),2),v=p[0],g=p[1],m=yn(Zv({defaultValue:null!=n?n:0,value:o,onChange:r}),2),y=m[0],b=m[1];cr.useEffect((function(){null!=o&&g(o)}),[o]);var w=Aq(),k=cr.useId(),x=null!==(t=e.id)&&void 0!==t?t:k;return{id:"tabs-".concat(x),selectedIndex:y,focusedIndex:v,setSelectedIndex:b,setFocusedIndex:g,isManual:i,isLazy:a,lazyBehavior:l,orientation:c,descendants:w,direction:f,htmlProps:h}}(sn(r,rt)),s=a.htmlProps,l=a.descendants,u=sn(a,ot),c=cr.useMemo((function(){return u}),[u]),d=(s.isFitted,sn(s,it));return qr.createElement(Lq,{value:l},qr.createElement(Iq,{value:c},qr.createElement(Vq,{value:n},qr.createElement(Lv.div,un(un({className:_q("chakra-tabs",i),ref:t},d),{},{__css:n.root}),o))))}));Uq.displayName="Tabs";var Gq=Cv((function(e,t){var n,r,o,i,a,s,l,u,c,d,f,h,p=(n=Rq(),r=Oq(),o=n.selectedIndex,i=n.orientation,a="horizontal"===i,s="vertical"===i,l=yn(cr.useState((function(){return a?{left:0,width:0}:s?{top:0,height:0}:void 0})),2),u=l[0],c=l[1],d=yn(cr.useState(!1),2),f=d[0],h=d[1],oo((function(){if(null!=o){var e=r.item(o);if(null!=e){a&&c({left:e.node.offsetLeft,width:e.node.offsetWidth}),s&&c({top:e.node.offsetTop,height:e.node.offsetHeight});var t=requestAnimationFrame((function(){h(!0)}));return function(){t&&cancelAnimationFrame(t)}}}}),[o,a,s,r]),un({position:"absolute",transitionProperty:"left, right, top, bottom, height, width",transitionDuration:f?"200ms":"0ms",transitionTimingFunction:"cubic-bezier(0, 0, 0.2, 1)"},u)),v=un(un({},e.style),p),g=Wq();return qr.createElement(Lv.div,un(un({ref:t},e),{},{className:_q("chakra-tabs__tab-indicator",e.className),style:v,__css:g.indicator}))}));Gq.displayName="TabIndicator";var qq=Cv((function(e,t){var n=function(e){var t=Rq(),n=t.focusedIndex,r=t.orientation,o=t.direction,i=Oq(),a=cr.useCallback((function(e){var t,a=function(){var e,t=i.nextEnabled(n);t&&(null==(e=t.node)||e.focus())},s=function(){var e,t=i.prevEnabled(n);t&&(null==(e=t.node)||e.focus())},l="horizontal"===r,u="vertical"===r,c=e.key,d="ltr"===o?"ArrowRight":"ArrowLeft",f=(gn(t={},"ltr"===o?"ArrowLeft":"ArrowRight",(function(){return l&&s()})),gn(t,d,(function(){return l&&a()})),gn(t,"ArrowDown",(function(){return u&&a()})),gn(t,"ArrowUp",(function(){return u&&s()})),gn(t,"Home",(function(){var e,t=i.firstEnabled();t&&(null==(e=t.node)||e.focus())})),gn(t,"End",(function(){var e,t=i.lastEnabled();t&&(null==(e=t.node)||e.focus())})),t),h=f[c];h&&(e.preventDefault(),h(e))}),[i,n,r,o]);return un(un({},e),{},{role:"tablist","aria-orientation":r,onKeyDown:Eq(e.onKeyDown,a)})}(un(un({},e),{},{ref:t})),r=un({display:"flex"},Wq().tablist);return qr.createElement(Lv.div,un(un({},n),{},{className:_q("chakra-tabs__tablist",e.className),__css:r}))}));qq.displayName="TabList";var Yq=Cv((function(e,t){var n=function(e){var t=e.children,n=sn(e,nt),r=Rq(),o=r.isLazy,i=r.lazyBehavior,a=jq(),s=a.isSelected,l=a.id,u=a.tabId,c=cr.useRef(!1);s&&(c.current=!0);var d=KO({wasSelected:c.current,isSelected:s,enabled:o,mode:i});return un(un({tabIndex:0},n),{},{children:d?t:null,role:"tabpanel","aria-labelledby":u,hidden:!s,id:l})}(un(un({},e),{},{ref:t})),r=Wq();return qr.createElement(Lv.div,un(un({outline:"0"},n),{},{className:_q("chakra-tabs__tab-panel",e.className),__css:r.tabpanel}))}));Yq.displayName="TabPanel";var Zq=Cv((function(e,t){var n=function(e){var t=Rq(),n=t.id,r=t.selectedIndex,o=d_(e.children).map((function(e,t){return cr.createElement(zq,{key:t,value:{isSelected:t===r,id:Fq(n,t),tabId:Bq(n,t),selectedIndex:r}},e)}));return un(un({},e),{},{children:o})}(e),r=Wq();return qr.createElement(Lv.div,un(un({},n),{},{width:"100%",ref:t,className:_q("chakra-tabs__tab-panels",e.className),__css:r.tabpanels}))}));Zq.displayName="TabPanels";var Xq=Cv((function(e,t){var n=Wq(),r=Nq(un(un({},e),{},{ref:t})),o=un({outline:"0",display:"flex",alignItems:"center",justifyContent:"center"},n.tab);return qr.createElement(Lv.button,un(un({},r),{},{className:_q("chakra-tabs__tab",e.className),__css:o}))}));Xq.displayName="Tab";var $q=function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:[],r=Object.assign({},e),o=xn(n);try{for(o.s();!(t=o.n()).done;){var i=t.value;i in r&&delete r[i]}}catch(COe){o.e(COe)}finally{o.f()}return r}(n,Kq):n;return qr.createElement(Lv.textarea,un(un({ref:t,rows:i},a),{},{className:$q("chakra-textarea",o),__css:s}))}));function Jq(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:{};sY+=1;var o=null!==(t=r.id)&&void 0!==t?t:sY,i=null!==(n=r.position)&&void 0!==n?n:"bottom";return{id:o,message:e,position:i,duration:r.duration,onCloseComplete:r.onCloseComplete,onRequestRemove:function(){return aY.removeToast(String(o),i)},status:r.status,requestClose:!1,containerStyle:r.containerStyle}}(e,t),o=n.position,i=n.id;return r((function(e){var t,r,i=o.includes("top")?[n].concat(cn(null!==(t=e[o])&&void 0!==t?t:[])):[].concat(cn(null!==(r=e[o])&&void 0!==r?r:[]),[n]);return un(un({},e),{},gn({},o,i))})),i},update:function(e,t){e&&r((function(n){var r=un({},n),o=rY(r,e),i=o.position,a=o.index;return i&&-1!==a&&(r[i][a]=un(un(un({},r[i][a]),t),{},{message:uY(t)})),r}))},closeAll:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.positions;r((function(e){return(null!=t?t:["bottom","bottom-right","bottom-left","top","top-left","top-right"]).reduce((function(t,n){return t[n]=e[n].map((function(e){return un(un({},e),{},{requestClose:!0})})),t}),un({},e))}))},close:function(e){r((function(t){var n=oY(t,e);return n?un(un({},t),{},gn({},n,t[n].map((function(t){return t.id==e?un(un({},t),{},{requestClose:!0}):t})))):t}))},isActive:function(e){return Boolean(rY(aY.getState(),e).position)}}}({top:[],"top-left":[],"top-right":[],"bottom-left":[],bottom:[],"bottom-right":[]});var sY=0;var lY=function(e){var t=e.status,n=e.variant,r=void 0===n?"solid":n,o=e.id,i=e.title,a=e.isClosable,s=e.onClose,l=e.description,u=e.icon,c=o?{root:"toast-".concat(o),title:"toast-".concat(o,"-title"),description:"toast-".concat(o,"-description")}:void 0;return qr.createElement(i_,{addRole:!1,status:t,variant:r,id:null==c?void 0:c.root,alignItems:"start",borderRadius:"md",boxShadow:"lg",paddingEnd:8,textAlign:"start",width:"auto"},qr.createElement(s_,null,u),qr.createElement(Lv.div,{flex:"1",maxWidth:"100%"},i&&qr.createElement(l_,{id:null==c?void 0:c.title},i),l&&qr.createElement(a_,{id:null==c?void 0:c.description,display:"block"},l)),a&&qr.createElement(xE,{size:"sm",onClick:s,position:"absolute",insetEnd:1,top:1}))};function uY(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.render,n=e.toastComponent,r=void 0===n?lY:n,o=function(n){return"function"==typeof t?t(un(un({},n),e)):qr.createElement(r,un(un({},n),e))};return o}function cY(e){var t=gv().theme;return cr.useMemo((function(){return function(e,t){var n=function(n){var r;return un(un(un({},t),n),{},{position:tY(null!==(r=null==n?void 0:n.position)&&void 0!==r?r:null==t?void 0:t.position,e)})},r=function(e){var t=n(e),r=uY(t);return aY.notify(r,t)};return r.update=function(e,t){aY.update(e,n(t))},r.promise=function(e,t){var n=r(un(un({},t.loading),{},{status:"loading",duration:null}));e.then((function(e){return r.update(n,un({status:"success",duration:5e3},Jq(t.success,e)))})).catch((function(e){return r.update(n,un({status:"error",duration:5e3},Jq(t.error,e)))}))},r.closeAll=aY.closeAll,r.close=aY.close,r.isActive=aY.isActive,r}(t.direction,e)}),[e,t.direction])}var dY={initial:function(e){var t=e.position,n=["top","bottom"].includes(t)?"y":"x",r=["top-right","bottom-right"].includes(t)?1:-1;return"bottom"===t&&(r=1),gn({opacity:0},n,24*r)},animate:{opacity:1,y:0,x:0,scale:1,transition:{duration:.4,ease:[.4,0,.2,1]}},exit:{opacity:0,scale:.85,transition:{duration:.2,ease:[.4,0,1,1]}}},fY=cr.memo((function(e){var t=e.id,n=e.message,r=e.onCloseComplete,o=e.onRequestRemove,i=e.requestClose,a=void 0!==i&&i,s=e.position,l=void 0===s?"bottom":s,u=e.duration,c=void 0===u?5e3:u,d=e.containerStyle,f=e.motionVariants,h=void 0===f?dY:f,p=e.toastSpacing,v=void 0===p?"0.5rem":p,g=yn(cr.useState(c),2),m=g[0],y=g[1],b=rw();U_((function(){b||null==r||r()}),[b]),U_((function(){y(c)}),[c]);var w=function(){b&&o()};cr.useEffect((function(){b&&a&&o()}),[b,a,o]),function(e,t){var n=Yv(e);cr.useEffect((function(){var e;if(null!=t)return e=window.setTimeout((function(){n()}),t),function(){e&&window.clearTimeout(e)}}),[t,n])}(w,m);var k=cr.useMemo((function(){return un({pointerEvents:"auto",maxWidth:560,minWidth:300,margin:v},d)}),[d,v]),x=cr.useMemo((function(){return function(e){var t="center";return e.includes("right")&&(t="flex-end"),e.includes("left")&&(t="flex-start"),{display:"flex",flexDirection:"column",alignItems:t}}(l)}),[l]);return qr.createElement(BS.li,{layout:!0,className:"chakra-toast",variants:h,initial:"initial",animate:"animate",exit:"exit",onHoverStart:function(){return y(null)},onHoverEnd:function(){return y(c)},custom:{position:l},style:x},qr.createElement(Lv.div,{role:"status","aria-atomic":"true",className:"chakra-toast__inner",__css:k},Jq(n,{id:t,onClose:w})))}));fY.displayName="ToastComponent";var hY=function(e){var t=cr.useSyncExternalStore(aY.subscribe,aY.getState,aY.getState),n=e.children,r=e.motionVariants,o=e.component,i=void 0===o?fY:o,a=e.portalProps,s=Object.keys(t).map((function(e){var n=t[e];return qr.createElement("ul",{role:"region","aria-live":"polite",key:e,id:"chakra-toast-manager-".concat(e),style:iY(e)},qr.createElement(qS,{initial:!1},n.map((function(e){return qr.createElement(i,un({key:e.id,motionVariants:r},e))}))))}));return qr.createElement(qr.Fragment,null,n,qr.createElement(gH,un({},a),s))};var pY={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]}}}};function vY(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:{},t=e.openDelay,n=void 0===t?0:t,r=e.closeDelay,o=void 0===r?0:r,i=e.closeOnClick,a=void 0===i||i,s=e.closeOnMouseDown,l=e.closeOnScroll,u=e.closeOnPointerDown,c=void 0===u?s:u,d=e.closeOnEsc,f=void 0===d||d,h=e.onOpen,p=e.onClose,v=e.placement,g=e.id,m=e.isOpen,y=e.defaultIsOpen,b=e.arrowSize,w=void 0===b?10:b,k=e.arrowShadowColor,x=e.arrowPadding,S=e.modifiers,C=e.isDisabled,_=e.gutter,E=e.offset,P=e.direction,L=sn(e,st),O=XO({isOpen:m,defaultIsOpen:y,onOpen:h,onClose:p}),A=O.isOpen,M=O.onOpen,T=O.onClose,I=YO({enabled:A,placement:v,arrowPadding:x,modifiers:S,gutter:_,offset:E,direction:P}),R=I.referenceRef,N=I.getPopperProps,D=I.getArrowInnerProps,z=I.getArrowProps,j=cr.useId(),B=null!=g?g:j,F="tooltip-".concat(B),H=cr.useRef(null),V=cr.useRef(),W=cr.useCallback((function(){V.current&&(clearTimeout(V.current),V.current=void 0)}),[]),U=cr.useRef(),G=cr.useCallback((function(){U.current&&(clearTimeout(U.current),U.current=void 0)}),[]),q=cr.useCallback((function(){G(),T()}),[T,G]),Y=bY(H,q),Z=cr.useCallback((function(){if(!C&&!V.current){Y();var e=mY(H);V.current=e.setTimeout(M,n)}}),[Y,C,M,n]),X=cr.useCallback((function(){W();var e=mY(H);U.current=e.setTimeout(q,o)}),[o,q,W]),$=cr.useCallback((function(){A&&a&&X()}),[a,X,A]),K=cr.useCallback((function(){A&&c&&X()}),[c,X,A]),Q=cr.useCallback((function(e){A&&"Escape"===e.key&&X()}),[A,X]);DE((function(){return gY(H)}),"keydown",f?Q:void 0),DE((function(){return gY(H)}),"scroll",(function(){A&&l&&q()})),cr.useEffect((function(){C&&(W(),A&&T())}),[C,A,T,W]),cr.useEffect((function(){return function(){W(),G()}}),[W,G]),DE((function(){return H.current}),"pointerleave",X);var J=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=un(un({},e),{},{ref:Tv(H,t,R),onPointerEnter:vY(e.onPointerEnter,(function(e){"touch"!==e.pointerType&&Z()})),onClick:vY(e.onClick,$),onPointerDown:vY(e.onPointerDown,K),onFocus:vY(e.onFocus,Z),onBlur:vY(e.onBlur,X),"aria-describedby":A?F:void 0});return n}),[Z,X,K,A,F,$,R]),ee=cr.useCallback((function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return N(un(un({},t),{},{style:un(un({},t.style),{},(e={},gn(e,TO.arrowSize.var,w?"".concat(w,"px"):void 0),gn(e,TO.arrowShadowColor.var,k),e))}),n)}),[N,w,k]),te=cr.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=un(un({},e.style),{},{position:"relative",transformOrigin:TO.transformOrigin.varRef});return un(un(un({ref:t},L),e),{},{id:F,role:"tooltip",style:n})}),[L,F]);return{isOpen:A,show:Z,hide:X,getTriggerProps:J,getTooltipProps:te,getTooltipPositionerProps:ee,getArrowProps:z,getArrowInnerProps:D}}(un(un({},y),{},{direction:a.direction}));if("string"==typeof s||u)k=qr.createElement(Lv.span,un({display:"inline-block",tabIndex:0},x.getTriggerProps()),s);else{var S=cr.Children.only(s);k=cr.cloneElement(S,x.getTriggerProps(S.props,S.ref))}var C=!!c,_=x.getTooltipProps({},t),E=C?function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=Object.assign({},e),o=xn(n);try{for(o.s();!(t=o.n()).done;){var i=t.value;i in r&&delete r[i]}}catch(COe){o.e(COe)}finally{o.f()}return r}(_,["role","id"]):_,P=function(e,t){var n,r={},o=xn(t);try{for(o.s();!(n=o.n()).done;){var i=n.value;i in e&&(r[i]=e[i])}}catch(COe){o.e(COe)}finally{o.f()}return r}(_,["role","id"]);return l?qr.createElement(qr.Fragment,null,k,qr.createElement(qS,null,x.isOpen&&qr.createElement(gH,un({},h),qr.createElement(Lv.div,un(un({},x.getTooltipPositionerProps()),{},{__css:{zIndex:o.zIndex,pointerEvents:"none"}}),qr.createElement(wY,un(un(un({variants:pY,initial:"exit",animate:"enter",exit:"exit"},m),E),{},{__css:o}),l,C&&qr.createElement(Lv.span,un({srOnly:!0},P),c),d&&qr.createElement(Lv.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper"},qr.createElement(Lv.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:o.bg}}))))))):qr.createElement(qr.Fragment,null,s)}));kY.displayName="Tooltip";var xY=function(e){var t=e.children,n=e.colorModeManager,r=e.portalZIndex,o=e.resetCSS,i=void 0===o||o,a=e.theme,s=void 0===a?{}:a,l=e.environment,u=e.cssVarsRoot,c=qr.createElement(YP,{environment:l},t);return qr.createElement(mv,{theme:s,cssVarsRoot:u},qr.createElement(po,{colorModeManager:n,options:s.config},i?qr.createElement(NE,null):qr.createElement(RE,null),qr.createElement(bv,null),r?qr.createElement(lH,{zIndex:r},c):c))};function SY(e){var t=e.children,n=e.theme,r=void 0===n?lv:n,o=e.toastOptions,i=sn(e,ut);return qr.createElement(xY,un({theme:r},i),t,qr.createElement(hY,un({},o)))}var CY={},_Y=QO;CY.createRoot=_Y.createRoot,CY.hydrateRoot=_Y.hydrateRoot;var EY={},PY={get exports(){return EY},set exports(e){EY=e}},LY={},OY=cr;var AY="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},MY=OY.useState,TY=OY.useEffect,IY=OY.useLayoutEffect,RY=OY.useDebugValue;function NY(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!AY(e,n)}catch(Xke){return!0}}var DY="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=MY({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return IY((function(){o.value=n,o.getSnapshot=t,NY(o)&&i({inst:o})}),[e,n,t]),TY((function(){return NY(o)&&i({inst:o}),e((function(){NY(o)&&i({inst:o})}))}),[e]),RY(n),n};LY.useSyncExternalStore=void 0!==OY.useSyncExternalStore?OY.useSyncExternalStore:DY,function(e){e.exports=LY}(PY);var zY={},jY={get exports(){return zY},set exports(e){zY=e}},BY={},FY=cr,HY=EY;var VY="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},WY=HY.useSyncExternalStore,UY=FY.useRef,GY=FY.useEffect,qY=FY.useMemo,YY=FY.useDebugValue;BY.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=UY(null);if(null===i.current){var a={hasValue:!1,value:null};i.current=a}else a=i.current;i=qY((function(){function e(e){if(!l){if(l=!0,i=e,e=r(e),void 0!==o&&a.hasValue){var t=a.value;if(o(t,e))return s=t}return s=e}if(t=s,VY(i,e))return t;var n=r(e);return void 0!==o&&o(t,n)?t:(i=e,s=n)}var i,s,l=!1,u=void 0===n?null:n;return[function(){return e(t())},null===u?void 0:function(){return e(u())}]}),[t,n,r,o]);var s=WY(e,i[0],i[1]);return GY((function(){a.hasValue=!0,a.value=s}),[s]),YY(s),s},function(e){e.exports=BY}(jY);var ZY=function(e){e()},XY=function(){return ZY},$Y=cr.createContext(null);function KY(){return cr.useContext($Y)}var QY=function(){throw new Error("uSES not initialized!")},JY=function(e,t){return e===t};function eZ(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$Y,t=e===$Y?KY:function(){return cr.useContext(e)};return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:JY,r=t(),o=r.store,i=r.subscription,a=r.getServerState,s=QY(i.addNestedSub,o.getState,a||o.getState,e,n);return cr.useDebugValue(s),s}}var tZ,nZ=eZ(),rZ={},oZ={get exports(){return rZ},set exports(e){rZ=e}},iZ={},aZ=Symbol.for("react.element"),sZ=Symbol.for("react.portal"),lZ=Symbol.for("react.fragment"),uZ=Symbol.for("react.strict_mode"),cZ=Symbol.for("react.profiler"),dZ=Symbol.for("react.provider"),fZ=Symbol.for("react.context"),hZ=Symbol.for("react.server_context"),pZ=Symbol.for("react.forward_ref"),vZ=Symbol.for("react.suspense"),gZ=Symbol.for("react.suspense_list"),mZ=Symbol.for("react.memo"),yZ=Symbol.for("react.lazy"),bZ=Symbol.for("react.offscreen");function wZ(e){if("object"===kn(e)&&null!==e){var t=e.$$typeof;switch(t){case aZ:switch(e=e.type){case lZ:case cZ:case uZ:case vZ:case gZ:return e;default:switch(e=e&&e.$$typeof){case hZ:case fZ:case pZ:case yZ:case mZ:case dZ:return e;default:return t}}case sZ:return t}}}tZ=Symbol.for("react.module.reference"),iZ.ContextConsumer=fZ,iZ.ContextProvider=dZ,iZ.Element=aZ,iZ.ForwardRef=pZ,iZ.Fragment=lZ,iZ.Lazy=yZ,iZ.Memo=mZ,iZ.Portal=sZ,iZ.Profiler=cZ,iZ.StrictMode=uZ,iZ.Suspense=vZ,iZ.SuspenseList=gZ,iZ.isAsyncMode=function(){return!1},iZ.isConcurrentMode=function(){return!1},iZ.isContextConsumer=function(e){return wZ(e)===fZ},iZ.isContextProvider=function(e){return wZ(e)===dZ},iZ.isElement=function(e){return"object"===kn(e)&&null!==e&&e.$$typeof===aZ},iZ.isForwardRef=function(e){return wZ(e)===pZ},iZ.isFragment=function(e){return wZ(e)===lZ},iZ.isLazy=function(e){return wZ(e)===yZ},iZ.isMemo=function(e){return wZ(e)===mZ},iZ.isPortal=function(e){return wZ(e)===sZ},iZ.isProfiler=function(e){return wZ(e)===cZ},iZ.isStrictMode=function(e){return wZ(e)===uZ},iZ.isSuspense=function(e){return wZ(e)===vZ},iZ.isSuspenseList=function(e){return wZ(e)===gZ},iZ.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===lZ||e===cZ||e===uZ||e===vZ||e===gZ||e===bZ||"object"===kn(e)&&null!==e&&(e.$$typeof===yZ||e.$$typeof===mZ||e.$$typeof===dZ||e.$$typeof===fZ||e.$$typeof===pZ||e.$$typeof===tZ||void 0!==e.getModuleId)},iZ.typeOf=wZ,function(e){e.exports=iZ}(oZ);var kZ={notify:function(){},get:function(){return[]}};function xZ(e,t){var n,r=kZ;function o(){a.onStateChange&&a.onStateChange()}function i(){n||(n=t?t.addNestedSub(o):e.subscribe(o),r=function(){var e=XY(),t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e((function(){for(var e=t;e;)e.callback(),e=e.next}))},get:function(){for(var e=[],n=t;n;)e.push(n),n=n.next;return e},subscribe:function(e){var r=!0,o=n={callback:e,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){r&&null!==t&&(r=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}())}var a={addNestedSub:function(e){return i(),r.subscribe(e)},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:o,isSubscribed:function(){return Boolean(n)},trySubscribe:i,tryUnsubscribe:function(){n&&(n(),n=void 0,r.clear(),r=kZ)},getListeners:function(){return r}};return a}var SZ=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement)?cr.useLayoutEffect:cr.useEffect;function CZ(e){var t=e.store,n=e.context,r=e.children,o=e.serverState,i=cr.useMemo((function(){var e=xZ(t);return{store:t,subscription:e,getServerState:o?function(){return o}:void 0}}),[t,o]),a=cr.useMemo((function(){return t.getState()}),[t]);SZ((function(){var e=i.subscription;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),a!==t.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=void 0}}),[i,a]);var s=n||$Y;return qr.createElement(s.Provider,{value:i},r)}function _Z(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$Y,t=e===$Y?KY:function(){return cr.useContext(e)};return function(){return t().store}}var EZ=_Z();function PZ(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$Y,t=e===$Y?EZ:_Z(e);return function(){return t().dispatch}}var LZ,OZ=PZ();function AZ(e){return AZ="function"==typeof Symbol&&"symbol"===kn(Symbol.iterator)?function(e){return kn(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":kn(e)},AZ(e)}function MZ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function TZ(e,t){for(var n=0;n1?t-1:0),r=1;r3?t.i-4:t.i:Array.isArray(e)?1:YZ(e)?2:ZZ(e)?3:0}function UZ(e,t){return 2===WZ(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function GZ(e,t,n){var r=WZ(e);2===r?e.set(t,n):3===r?(e.delete(t),e.add(n)):e[t]=n}function qZ(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function YZ(e){return kX&&e instanceof Map}function ZZ(e){return xX&&e instanceof Set}function XZ(e){return e.o||e.t}function $Z(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=OX(e);delete t[EX];for(var n=LX(t),r=0;r1&&(e.set=e.add=e.clear=e.delete=QZ),Object.freeze(e),t&&VZ(e,(function(e,t){return KZ(t,!0)}),!0)),e}function QZ(){BZ(2)}function JZ(e){return null==e||"object"!=kn(e)||Object.isFrozen(e)}function eX(e){var t=AX[e];return t||BZ(18,e),t}function tX(){return bX}function nX(e,t){t&&(eX("Patches"),e.u=[],e.s=[],e.v=t)}function rX(e){oX(e),e.p.forEach(aX),e.p=null}function oX(e){e===bX&&(bX=e.l)}function iX(e){return bX={p:[],l:bX,h:e,m:!0,_:0}}function aX(e){var t=e[EX];0===t.i||1===t.i?t.j():t.O=!0}function sX(e,t){t._=t.p.length;var n=t.p[0],r=void 0!==e&&e!==n;return t.h.g||eX("ES5").S(t,e,r),r?(n[EX].P&&(rX(t),BZ(4)),HZ(e)&&(e=lX(t,e),t.l||cX(t,e)),t.u&&eX("Patches").M(n[EX].t,e,t.u,t.s)):e=lX(t,n,[]),rX(t),t.u&&t.v(t.u,t.s),e!==CX?e:void 0}function lX(e,t,n){if(JZ(t))return t;var r=t[EX];if(!r)return VZ(t,(function(o,i){return uX(e,r,t,o,i,n)}),!0),t;if(r.A!==e)return t;if(!r.P)return cX(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var o=4===r.i||5===r.i?r.o=$Z(r.k):r.o;VZ(3===r.i?new Set(o):o,(function(t,i){return uX(e,r,o,t,i,n)})),cX(e,o,!1),n&&e.u&&eX("Patches").R(r,n,e.u,e.s)}return r.o}function uX(e,t,n,r,o,i){if(FZ(o)){var a=lX(e,o,i&&t&&3!==t.i&&!UZ(t.D,r)?i.concat(r):void 0);if(GZ(n,r,a),!FZ(a))return;e.m=!1}if(HZ(o)&&!JZ(o)){if(!e.h.F&&e._<1)return;lX(e,o),t&&t.A.l||cX(e,o)}}function cX(e,t,n){void 0===n&&(n=!1),e.h.F&&e.m&&KZ(t,n)}function dX(e,t){var n=e[EX];return(n?XZ(n):e)[t]}function fX(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function hX(e){e.P||(e.P=!0,e.l&&hX(e.l))}function pX(e){e.o||(e.o=$Z(e.t))}function vX(e,t,n){var r=YZ(t)?eX("MapSet").N(t,n):ZZ(t)?eX("MapSet").T(t,n):e.g?function(e,t){var n=Array.isArray(e),r={i:n?1:0,A:t?t.A:tX(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},o=r,i=MX;n&&(o=[r],i=TX);var a=Proxy.revocable(o,i),s=a.revoke,l=a.proxy;return r.k=l,r.j=s,l}(t,n):eX("ES5").J(t,n);return(n?n.A:tX()).p.push(r),r}function gX(e){return FZ(e)||BZ(22,e),function e(t){if(!HZ(t))return t;var n,r=t[EX],o=WZ(t);if(r){if(!r.P&&(r.i<4||!eX("ES5").K(r)))return r.t;r.I=!0,n=mX(t,o),r.I=!1}else n=mX(t,o);return VZ(n,(function(t,o){r&&function(e,t){return 2===WZ(e)?e.get(t):e[t]}(r.t,t)===o||GZ(n,t,e(o))})),3===o?new Set(n):n}(e)}function mX(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return $Z(e)}zZ(jZ,"defaultProps",{children:null,loading:null});var yX,bX,wX="undefined"!=typeof Symbol&&"symbol"==kn(Symbol("x")),kX="undefined"!=typeof Map,xX="undefined"!=typeof Set,SX="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,CX=wX?Symbol.for("immer-nothing"):((yX={})["immer-nothing"]=!0,yX),_X=wX?Symbol.for("immer-draftable"):"__$immer_draftable",EX=wX?Symbol.for("immer-state"):"__$immer_state",PX=""+Object.prototype.constructor,LX="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,OX=Object.getOwnPropertyDescriptors||function(e){var t={};return LX(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)})),t},AX={},MX={get:function(e,t){if(t===EX)return e;var n=XZ(e);if(!UZ(n,t))return function(e,t,n){var r,o=fX(t,n);return o?"value"in o?o.value:null===(r=o.get)||void 0===r?void 0:r.call(e.k):void 0}(e,n,t);var r=n[t];return e.I||!HZ(r)?r:r===dX(e.t,t)?(pX(e),e.o[t]=vX(e.A.h,r,e)):r},has:function(e,t){return t in XZ(e)},ownKeys:function(e){return Reflect.ownKeys(XZ(e))},set:function(e,t,n){var r=fX(XZ(e),t);if(null==r?void 0:r.set)return r.set.call(e.k,n),!0;if(!e.P){var o=dX(XZ(e),t),i=null==o?void 0:o[EX];if(i&&i.t===n)return e.o[t]=n,e.D[t]=!1,!0;if(qZ(n,o)&&(void 0!==n||UZ(e.t,t)))return!0;pX(e),hX(e)}return e.o[t]===n&&"number"!=typeof n&&(void 0!==n||t in e.o)||(e.o[t]=n,e.D[t]=!0,!0)},deleteProperty:function(e,t){return void 0!==dX(e.t,t)||t in e.t?(e.D[t]=!1,pX(e),hX(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=XZ(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty:function(){BZ(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){BZ(12)}},TX={};VZ(MX,(function(e,t){TX[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),TX.deleteProperty=function(e,t){return TX.set.call(this,e,t,void 0)},TX.set=function(e,t,n){return MX.set.call(this,e[0],t,n,e[0])};var IX=function(){function e(e){var t=this;this.g=SX,this.F=!0,this.produce=function(e,n,r){if("function"==typeof e&&"function"!=typeof n){var o=n;n=e;var i=t;return function(e){var t=this;void 0===e&&(e=o);for(var r=arguments.length,a=Array(r>1?r-1:0),s=1;s1?r-1:0),i=1;i=0;n--){var r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));var o=eX("Patches").$;return FZ(e)?o(e,t):this.produce(e,(function(e){return o(e,t)}))},e}(),RX=new IX,NX=RX.produce;function DX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function zX(e){for(var t=1;t-1){var o=n[r];return r>0&&(n.splice(r,1),n.unshift(o)),o.value}return YX}return{get:r,put:function(t,o){r(t)===YX&&(n.unshift({key:t,value:o}),n.length>e&&n.pop())},getEntries:function(){return n},clear:function(){n=[]}}}(l,c);function f(){var t=d.get(arguments);if(t===YX){if(t=e.apply(null,arguments),u){var n=d.getEntries(),r=n.find((function(e){return u(e.value,t)}));r&&(t=r.value)}d.put(arguments,t)}return t}return f.clearCache=function(){return d.clear()},f}function $X(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every((function(e){return"function"==typeof e}))){var n=t.map((function(e){return"function"==typeof e?"function "+(e.name||"unnamed")+"()":kn(e)})).join(", ");throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+n+"]")}return t}function KX(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]=0;t--){var o=e[t][EX];if(!o.P)switch(o.i){case 5:r(o)&&hX(o);break;case 4:n(o)&&hX(o)}}}function n(e){for(var t=e.t,n=e.k,r=LX(n),o=r.length-1;o>=0;o--){var i=r[o];if(i!==EX){var a=t[i];if(void 0===a&&!UZ(t,i))return!0;var s=n[i],l=s&&s[EX];if(l?l.t!==a:!qZ(s,a))return!0}}var u=!!t[EX];return r.length!==LX(t).length+(u?0:1)}function r(e){var t=e.k;if(t.length!==e.t.length)return!0;var n=Object.getOwnPropertyDescriptor(t,t.length-1);if(n&&!n.get)return!0;for(var r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Z$(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:Q$,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case R$:return $$({},e,{registry:[].concat(Z$(e.registry),[t.key])});case A$:var n=e.registry.indexOf(t.key),r=Z$(e.registry);return r.splice(n,1),$$({},e,{registry:r,bootstrapped:0===r.length});default:return e}};var eK={},tK={};function nK(e){return nK="function"==typeof Symbol&&"symbol"===kn(Symbol.iterator)?function(e){return kn(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":kn(e)},nK(e)}function rK(){}tK.__esModule=!0,tK.default=function(e){var t="".concat(e,"Storage");return function(e){if("object"!==("undefined"==typeof self?"undefined":nK(self))||!(e in self))return!1;try{var t=self[e],n="redux-persist ".concat(e," test");t.setItem(n,"test"),t.getItem(n),t.removeItem(n)}catch(Dhe){return!1}return!0}(t)?self[t]:oK};var oK={getItem:rK,setItem:rK,removeItem:rK};eK.__esModule=!0,eK.default=function(e){var t=(0,aK.default)(e);return{getItem:function(e){return new Promise((function(n,r){n(t.getItem(e))}))},setItem:function(e,n){return new Promise((function(r,o){r(t.setItem(e,n))}))},removeItem:function(e){return new Promise((function(n,r){n(t.removeItem(e))}))}}};var iK,aK=(iK=tK)&&iK.__esModule?iK:{default:iK};var sK,lK=function(e){return e&&e.__esModule?e:{default:e}}(eK);sK=(0,lK.default)("local");var uK={},cK={},dK={};Object.defineProperty(dK,"__esModule",{value:!0}),dK.PLACEHOLDER_UNDEFINED=dK.PACKAGE_NAME=void 0,dK.PACKAGE_NAME="redux-deep-persist",dK.PLACEHOLDER_UNDEFINED="@@placeholder/undefined";var fK={};!function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigType=void 0,(t=e.ConfigType||(e.ConfigType={}))[t.WHITELIST=0]="WHITELIST",t[t.BLACKLIST=1]="BLACKLIST"}(fK),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getRootKeysGroup=e.throwError=e.configValidator=e.transformsValidator=e.singleTransformValidator=e.findDuplicatesAndSubsets=e.unique=e.preserveUndefined=e.mergeDeep=e.dissocPath=e.assocPath=e.path=e.difference=e.cloneDeep=e._cloneDeep=e.getCircularPath=e.isEmpty=e.isDate=e.isString=e.isIntegerString=e.isPlainObject=e.isArray=e.isLength=e.isObjectLike=void 0;var t=dK,n=fK;e.isObjectLike=function(e){return"object"===kn(e)&&null!==e};e.isLength=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=Number.MAX_SAFE_INTEGER},e.isArray=Array.isArray||function(t){return(0,e.isLength)(t&&t.length)&&"[object Array]"===Object.prototype.toString.call(t)};e.isPlainObject=function(t){return!!t&&"object"===kn(t)&&!(0,e.isArray)(t)};e.isIntegerString=function(e){return String(~~e)===e&&Number(e)>=0};e.isString=function(e){return"[object String]"===Object.prototype.toString.call(e)};e.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)};e.isEmpty=function(e){return 0===Object.keys(e).length};var r=Object.prototype.hasOwnProperty;e.getCircularPath=function(t,n,r){for(var o in r||(r=new Set([t])),n||(n=""),t){var i=n?"".concat(n,".").concat(o):o,a=t[o];if((0,e.isObjectLike)(a))return r.has(a)?"".concat(n,".").concat(o,":"):(r.add(a),(0,e.getCircularPath)(a,i,r))}return null};e._cloneDeep=function(t){if(!(0,e.isObjectLike)(t))return t;if((0,e.isDate)(t))return new Date(+t);var n=(0,e.isArray)(t)?[]:{};for(var r in t){var o=t[r];n[r]=(0,e._cloneDeep)(o)}return n};e.cloneDeep=function(n){var r=(0,e.getCircularPath)(n);if(r)throw new Error("".concat(t.PACKAGE_NAME,": circular dependency detected under the path '").concat(r,"' of object you're trying to persist: ").concat(n));return(0,e._cloneDeep)(n)};e.difference=function(t,n){if(t===n)return{};if(!(0,e.isObjectLike)(t)||!(0,e.isObjectLike)(n))return n;var o=(0,e.cloneDeep)(t),i=(0,e.cloneDeep)(n),a=Object.keys(o).reduce((function(e,t){return r.call(i,t)||(e[t]=void 0),e}),{});if((0,e.isDate)(o)||(0,e.isDate)(i))return o.valueOf()===i.valueOf()?{}:i;var s=Object.keys(i).reduce((function(t,n){if(!r.call(o,n))return t[n]=i[n],t;var a=(0,e.difference)(o[n],i[n]);return(0,e.isObjectLike)(a)&&(0,e.isEmpty)(a)&&!(0,e.isDate)(a)?(0,e.isArray)(o)&&!(0,e.isArray)(i)||!(0,e.isArray)(o)&&(0,e.isArray)(i)?i:t:(t[n]=a,t)}),a);return delete s._persist,s};e.path=function(t,n){return n.reduce((function(t,n){if(t){var r=parseInt(n,10),o=(0,e.isIntegerString)(n)&&r<0?t.length+r:n;return(0,e.isString)(t)?t.charAt(o):t[o]}}),t)};e.assocPath=function(t,n){var r=cn(t).reverse().reduce((function(t,r,o){var i=(0,e.isIntegerString)(r)?[]:{};return i[r]=0===o?n:t,i}),{});return r};e.dissocPath=function(t,n){var r=(0,e.cloneDeep)(t);return n.reduce((function(t,r,o){return o===n.length-1&&t&&(0,e.isObjectLike)(t)&&delete t[r],t&&t[r]}),r),r};var o=function n(r,o){for(var i=arguments.length,a=new Array(i>2?i-2:0),s=2;s1&&void 0!==arguments[1]?arguments[1]:[],a=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0,l=arguments.length>4?arguments[4]:void 0;if(!(0,e.isObjectLike)(o))return o;for(var u in o){var c=o[u],d=(0,e.isArray)(o),f=s?s+"."+u:u;null===c&&(a===n.ConfigType.WHITELIST&&-1===i.indexOf(f)||a===n.ConfigType.BLACKLIST&&-1!==i.indexOf(f))&&d&&(o[parseInt(u,10)]=void 0),void 0===c&&l&&a===n.ConfigType.BLACKLIST&&-1===i.indexOf(f)&&d&&(o[parseInt(u,10)]=t.PLACEHOLDER_UNDEFINED),r(c,i,a,f,l)}};e.preserveUndefined=function(t,n,r,o){var a=(0,e.cloneDeep)(t);return i(a,n,r,"",o),a};e.unique=function(e,t,n){return n.indexOf(e)===t};e.findDuplicatesAndSubsets=function(t){return t.reduce((function(n,r){var o=t.filter((function(e){return e===r})),i=t.filter((function(e){return 0===(r+".").indexOf(e+".")})),a=n.duplicates,s=n.subsets,l=o.length>1&&-1===a.indexOf(r),u=i.length>1;return{duplicates:[].concat(cn(a),cn(l?o:[])),subsets:[].concat(cn(s),cn(u?i:[])).filter(e.unique).sort()}}),{duplicates:[],subsets:[]})};e.singleTransformValidator=function(r,o,i){var a=i===n.ConfigType.WHITELIST?"whitelist":"blacklist",s="".concat(t.PACKAGE_NAME,": incorrect ").concat(a," configuration."),l="Check your create".concat(i===n.ConfigType.WHITELIST?"White":"Black","list arguments.\n\n");if(!(0,e.isString)(o)||o.length<1)throw new Error("".concat(s," Name (key) of reducer is required. ").concat(l));if(r&&r.length){var u=(0,e.findDuplicatesAndSubsets)(r),c=u.duplicates,d=u.subsets;if(c.length>1)throw new Error("".concat(s," Duplicated paths.\n\n ").concat(JSON.stringify(c),"\n\n ").concat(l));if(d.length>1)throw new Error("".concat(s," You are trying to persist an entire property and also some of its subset.\n\n").concat(JSON.stringify(d),"\n\n ").concat(l))}};e.transformsValidator=function(n){if((0,e.isArray)(n)){var r=(null==n?void 0:n.map((function(e){return e.deepPersistKey})).filter((function(e){return e})))||[];if(r.length){var o=r.filter((function(e,t){return r.indexOf(e)!==t}));if(o.length)throw new Error("".concat(t.PACKAGE_NAME,": found duplicated keys in transforms creators. You can createWhitelist or createBlacklist for a specific root reducer key only once. Duplicated keys among createWhitelist and createBlacklist transforms are not allowed.\n\n Duplicates: ").concat(JSON.stringify(o)))}}};e.configValidator=function(n){var r=n.whitelist,o=n.blacklist;if(r&&r.length&&o&&o.length)throw new Error("".concat(t.PACKAGE_NAME,": you should not define a whitelist and blacklist in parallel. It is allowed to use only one of these lists per config."));if(r){var i=(0,e.findDuplicatesAndSubsets)(r),a=i.duplicates,s=i.subsets;(0,e.throwError)({duplicates:a,subsets:s},"whitelist")}if(o){var l=(0,e.findDuplicatesAndSubsets)(o),u=l.duplicates,c=l.subsets;(0,e.throwError)({duplicates:u,subsets:c},"blacklist")}};e.throwError=function(e,n){var r=e.duplicates,o=e.subsets;if(r.length)throw new Error("".concat(t.PACKAGE_NAME,": duplicates of paths found in your ").concat(n,".\n\n ").concat(JSON.stringify(r)));if(o.length)throw new Error("".concat(t.PACKAGE_NAME,": subsets of some parent keys found in your ").concat(n,". You must decide if you want to persist an entire path or its specific subset.\n\n ").concat(JSON.stringify(o)))};e.getRootKeysGroup=function(t){return(0,e.isArray)(t)?t.filter(e.unique).reduce((function(e,t){var n=t.split("."),r=n[0],o=n.slice(1).join(".")||void 0,i=e.filter((function(e){return Object.keys(e)[0]===r}))[0],a=i?Object.values(i)[0]:void 0;return i||e.push(gn({},r,o?[o]:void 0)),i&&!a&&o&&(i[r]=[o]),i&&a&&o&&a.push(o),e}),[]):[]}}(cK),function(e){var t=ir&&ir.__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(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o2&&void 0!==arguments[2]?arguments[2]:{},r=n.whitelist||null,o=n.blacklist||null;function i(e){return!(!r||-1!==r.indexOf(e))||!(!o||-1===o.indexOf(e))}return{in:function(t,n,r){return!i(n)&&e?e(t,n,r):t},out:function(e,n,r){return!i(n)&&t?t(e,n,r):e},deepPersistKey:r&&r[0]}};e.autoMergeDeep=function(e,t,o,i){var a=i.debug,s=i.whitelist,l=i.blacklist,u=i.transforms;if(s||l)throw new Error("State reconciler autoMergeDeep uses custom transforms instead of old whitelist or blacklist config properties. Please use createWhitelist or createBlacklist transforms.");(0,n.transformsValidator)(u);var c=(0,n.cloneDeep)(o),d=e;if(d&&(0,n.isObjectLike)(d)){var f=(0,n.difference)(t,o);(0,n.isEmpty)(f)||(d=(0,n.mergeDeep)(e,f,{preserveUndefined:!0}),a&&console.log("".concat(r.PACKAGE_NAME,"/autoMergeDeep: sub state of your state was modified by reducer during rehydration. Values from reducer will be kept: ").concat(JSON.stringify(f)))),Object.keys(d).forEach((function(e){"_persist"!==e&&((0,n.isObjectLike)(c[e])?c[e]=(0,n.mergeDeep)(c[e],d[e]):c[e]=d[e])}))}return a&&d&&(0,n.isObjectLike)(d)&&console.log("".concat(r.PACKAGE_NAME,"/autoMergeDeep: rehydrated keys ").concat(JSON.stringify(d))),c};e.createWhitelist=function(e,t){return(0,n.singleTransformValidator)(t,e,o.ConfigType.WHITELIST),i((function(e){if(!t||!t.length)return e;var o,i=null;return t.forEach((function(t){var a=t.split(".");void 0===(o=(0,n.path)(e,a))&&(0,n.isIntegerString)(a[a.length-1])&&(o=r.PLACEHOLDER_UNDEFINED);var s=(0,n.assocPath)(a,o),l=(0,n.isArray)(s)?[]:{};i=(0,n.mergeDeep)(i||l,s,{preservePlaceholder:!0})})),i||e}),(function(e){return(0,n.preserveUndefined)(e,t,o.ConfigType.WHITELIST)}),{whitelist:[e]})};e.createBlacklist=function(e,t){return(0,n.singleTransformValidator)(t,e,o.ConfigType.BLACKLIST),i((function(e){if(t&&t.length){var r=(0,n.preserveUndefined)(e,t,o.ConfigType.BLACKLIST,!0);return t.map((function(e){return e.split(".")})).reduce((function(e,t){return(0,n.dissocPath)(e,t)}),r)}}),(function(e){return(0,n.preserveUndefined)(e,t,o.ConfigType.BLACKLIST)}),{whitelist:[e]})};e.getTransforms=function(t,n){return n.map((function(n){var r=Object.keys(n)[0],i=n[r];return t===o.ConfigType.WHITELIST?(0,e.createWhitelist)(r,i):(0,e.createBlacklist)(r,i)}))};e.getPersistConfig=function(r){var i=r.key,a=r.whitelist,s=r.blacklist,l=r.storage,u=r.transforms,c=r.rootReducer,d=t(r,["key","whitelist","blacklist","storage","transforms","rootReducer"]);(0,n.configValidator)({whitelist:a,blacklist:s});var f=(0,n.getRootKeysGroup)(a),h=(0,n.getRootKeysGroup)(s),p=Object.keys(c(void 0,{type:""})),v=f.map((function(e){return Object.keys(e)[0]})),g=h.map((function(e){return Object.keys(e)[0]})),m=p.filter((function(e){return-1===v.indexOf(e)&&-1===g.indexOf(e)})),y=(0,e.getTransforms)(o.ConfigType.WHITELIST,f),b=(0,e.getTransforms)(o.ConfigType.BLACKLIST,h),w=(0,n.isArray)(a)?m.map((function(t){return(0,e.createBlacklist)(t)})):[];return Object.assign(Object.assign({},d),{key:i,storage:l,transforms:[].concat(cn(y),cn(b),cn(w),cn(u||[])),stateReconciler:e.autoMergeDeep})}}(uK);var hK=function(e,t){return Math.floor(e/t)*t},pK=function(e,t){return Math.round(e/t)*t};var vK=function(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e},gK=/\s/;var mK=function(e){for(var t=e.length;t--&&gK.test(e.charAt(t)););return t},yK=mK,bK=/^\s+/;var wK=function(e){return e?e.slice(0,yK(e)+1).replace(bK,""):e};var kK=function(e){var t=kn(e);return null!=e&&("object"==t||"function"==t)},xK="object"==kn(ir)&&ir&&ir.Object===Object&&ir,SK=xK,CK="object"==("undefined"==typeof self?"undefined":kn(self))&&self&&self.Object===Object&&self,_K=SK||CK||Function("return this")(),EK=_K.Symbol,PK=EK,LK=Object.prototype,OK=LK.hasOwnProperty,AK=LK.toString,MK=PK?PK.toStringTag:void 0;var TK=function(e){var t=OK.call(e,MK),n=e[MK];try{e[MK]=void 0;var r=!0}catch(Dhe){}var o=AK.call(e);return r&&(t?e[MK]=n:delete e[MK]),o},IK=Object.prototype.toString;var RK=function(e){return IK.call(e)},NK=TK,DK=RK,zK=EK?EK.toStringTag:void 0;var jK=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":zK&&zK in Object(e)?NK(e):DK(e)};var BK=function(e){return null!=e&&"object"==kn(e)},FK=jK,HK=BK;var VK=function(e){return"symbol"==kn(e)||HK(e)&&"[object Symbol]"==FK(e)},WK=wK,UK=kK,GK=VK,qK=/^[-+]0x[0-9a-f]+$/i,YK=/^0b[01]+$/i,ZK=/^0o[0-7]+$/i,XK=parseInt;var $K=function(e){if("number"==typeof e)return e;if(GK(e))return NaN;if(UK(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=UK(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=WK(e);var n=YK.test(e);return n||ZK.test(e)?XK(e.slice(2),n?2:8):qK.test(e)?NaN:+e},KK=vK,QK=$K;var JK=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=QK(n))==n?n:0),void 0!==t&&(t=(t=QK(t))==t?t:0),KK(QK(e),t,n)};var eQ=function(){this.__data__=[],this.size=0};var tQ=function(e,t){return e===t||e!=e&&t!=t},nQ=tQ;var rQ=function(e,t){for(var n=e.length;n--;)if(nQ(e[n][0],t))return n;return-1},oQ=rQ,iQ=Array.prototype.splice;var aQ=function(e){var t=this.__data__,n=oQ(t,e);return!(n<0)&&(n==t.length-1?t.pop():iQ.call(t,n,1),--this.size,!0)},sQ=rQ;var lQ=function(e){var t=this.__data__,n=sQ(t,e);return n<0?void 0:t[n][1]},uQ=rQ;var cQ=function(e){return uQ(this.__data__,e)>-1},dQ=rQ;var fQ=function(e,t){var n=this.__data__,r=dQ(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},hQ=eQ,pQ=aQ,vQ=lQ,gQ=cQ,mQ=fQ;function yQ(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991},x0=jK,S0=k0,C0=BK,_0={};_0["[object Float32Array]"]=_0["[object Float64Array]"]=_0["[object Int8Array]"]=_0["[object Int16Array]"]=_0["[object Int32Array]"]=_0["[object Uint8Array]"]=_0["[object Uint8ClampedArray]"]=_0["[object Uint16Array]"]=_0["[object Uint32Array]"]=!0,_0["[object Arguments]"]=_0["[object Array]"]=_0["[object ArrayBuffer]"]=_0["[object Boolean]"]=_0["[object DataView]"]=_0["[object Date]"]=_0["[object Error]"]=_0["[object Function]"]=_0["[object Map]"]=_0["[object Number]"]=_0["[object Object]"]=_0["[object RegExp]"]=_0["[object Set]"]=_0["[object String]"]=_0["[object WeakMap]"]=!1;var E0=function(e){return C0(e)&&S0(e.length)&&!!_0[x0(e)]};var P0=function(e){return function(t){return e(t)}},L0={},O0={get exports(){return L0},set exports(e){L0=e}};!function(e,t){var n=xK,r=t&&!t.nodeType&&t,o=r&&e&&!e.nodeType&&e,i=o&&o.exports===r&&n.process,a=function(){try{var e=o&&o.require&&o.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(Dhe){}}();e.exports=a}(O0,L0);var A0=E0,M0=P0,T0=L0&&L0.isTypedArray,I0=T0?M0(T0):A0,R0=o0,N0=p0,D0=v0,z0=g0,j0=w0,B0=I0,F0=Object.prototype.hasOwnProperty;var H0=function(e,t){var n=D0(e),r=!n&&N0(e),o=!n&&!r&&z0(e),i=!n&&!r&&!o&&B0(e),a=n||r||o||i,s=a?R0(e.length,String):[],l=s.length;for(var u in e)!t&&!F0.call(e,u)||a&&("length"==u||o&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||j0(u,l))||s.push(u);return s},V0=Object.prototype;var W0=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||V0)};var U0=function(e,t){return function(n){return e(t(n))}},G0=U0(Object.keys,Object),q0=W0,Y0=G0,Z0=Object.prototype.hasOwnProperty;var X0=function(e){if(!q0(e))return Y0(e);var t=[];for(var n in Object(e))Z0.call(e,n)&&"constructor"!=n&&t.push(n);return t},$0=LQ,K0=k0;var Q0=function(e){return null!=e&&K0(e.length)&&!$0(e)},J0=H0,e1=X0,t1=Q0;var n1=function(e){return t1(e)?J0(e):e1(e)},r1=r0,o1=n1;var i1=function(e,t){return e&&r1(t,o1(t),e)};var a1=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t},s1=kK,l1=W0,u1=a1,c1=Object.prototype.hasOwnProperty;var d1=function(e){if(!s1(e))return u1(e);var t=l1(e),n=[];for(var r in e)("constructor"!=r||!t&&c1.call(e,r))&&n.push(r);return n},f1=H0,h1=d1,p1=Q0;var v1=function(e){return p1(e)?f1(e,!0):h1(e)},g1=r0,m1=v1;var y1=function(e,t){return e&&g1(t,m1(t),e)},b1={},w1={get exports(){return b1},set exports(e){b1=e}};!function(e,t){var n=_K,r=t&&!t.nodeType&&t,o=r&&e&&!e.nodeType&&e,i=o&&o.exports===r?n.Buffer:void 0,a=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=a?a(n):new e.constructor(n);return e.copy(r),r}}(w1,b1);var k1=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n4&&void 0!==arguments[4]?arguments[4]:.95,i=e*o/n,a=t*o/r,s=Math.min(1,Math.min(i,a));return s},I5=.95,R5=function(e){return{x:Math.floor(e.x),y:Math.floor(e.y)}},N5=function(e){for(var t=e.width,n=e.height,r={width:t,height:n},o=t/n,i=t*n,a=448;i<262144;){if(a+=64,t===n){r.width=512,r.height=512;break}o>1?(r.width=a,r.height=pK(a/o,64)):o<1&&(r.height=a,r.width=pK(a*o,64)),i=r.width*r.height}return r},D5=[{key:"Base",value:"base"},{key:"Mask",value:"mask"}],z5=[{key:"Auto",value:"auto"},{key:"Manual",value:"manual"},{key:"None",value:"none"}],j5=function(e){return"line"===e.kind&&"mask"===e.layer},B5=function(e){return"image"===e.kind&&"base"===e.layer},F5=function(e){return"line"===e.kind},H5={objects:[],stagingArea:{images:[],selectedImageIndex:-1}},V5=k$({name:"canvas",initialState:{boundingBoxCoordinates:{x:0,y:0},boundingBoxDimensions:{width:512,height:512},boundingBoxPreviewFill:{r:0,g:0,b:0,a:.5},boundingBoxScaleMethod:"auto",brushColor:{r:90,g:90,b:255,a:1},brushSize:50,canvasContainerDimensions:{width:0,height:0},colorPickerColor:{r:90,g:90,b:255,a:1},cursorPosition:null,doesCanvasNeedScaling:!1,futureLayerStates:[],isCanvasInitialized:!1,isDrawing:!1,isMaskEnabled:!0,isMouseOverBoundingBox:!1,isMoveBoundingBoxKeyHeld:!1,isMoveStageKeyHeld:!1,isMovingBoundingBox:!1,isMovingStage:!1,isTransformingBoundingBox:!1,layer:"base",layerState:H5,maskColor:{r:255,g:90,b:90,a:1},maxHistory:128,minimumStageScale:1,pastLayerStates:[],scaledBoundingBoxDimensions:{width:512,height:512},shouldAutoSave:!1,shouldCropToBoundingBoxOnSave:!1,shouldDarkenOutsideBoundingBox:!1,shouldLockBoundingBox:!1,shouldPreserveMaskedArea:!1,shouldRestrictStrokesToBox:!0,shouldShowBoundingBox:!0,shouldShowBrush:!0,shouldShowBrushPreview:!1,shouldShowCanvasDebugInfo:!1,shouldShowCheckboardTransparency:!1,shouldShowGrid:!0,shouldShowIntermediates:!0,shouldShowStagingImage:!0,shouldShowStagingOutline:!0,shouldSnapToGrid:!0,stageCoordinates:{x:0,y:0},stageDimensions:{width:0,height:0},stageScale:1,tool:"brush"},reducers:{setTool:function(e,t){var n=t.payload;e.tool=t.payload,"move"!==n&&(e.isTransformingBoundingBox=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1)},setLayer:function(e,t){e.layer=t.payload},toggleTool:function(e){var t=e.tool;"move"!==t&&(e.tool="brush"===t?"eraser":"brush")},setMaskColor:function(e,t){e.maskColor=t.payload},setBrushColor:function(e,t){e.brushColor=t.payload},setBrushSize:function(e,t){e.brushSize=t.payload},clearMask:function(e){e.pastLayerStates.push(A5(e.layerState)),e.layerState.objects=e.layerState.objects.filter((function(e){return!j5(e)})),e.futureLayerStates=[],e.shouldPreserveMaskedArea=!1},toggleShouldInvertMask:function(e){e.shouldPreserveMaskedArea=!e.shouldPreserveMaskedArea},toggleShouldShowMask:function(e){e.isMaskEnabled=!e.isMaskEnabled},setShouldPreserveMaskedArea:function(e,t){e.shouldPreserveMaskedArea=t.payload},setIsMaskEnabled:function(e,t){e.isMaskEnabled=t.payload,e.layer=t.payload?"mask":"base"},setShouldShowCheckboardTransparency:function(e,t){e.shouldShowCheckboardTransparency=t.payload},setShouldShowBrushPreview:function(e,t){e.shouldShowBrushPreview=t.payload},setShouldShowBrush:function(e,t){e.shouldShowBrush=t.payload},setCursorPosition:function(e,t){e.cursorPosition=t.payload},setInitialCanvasImage:function(e,t){var n=t.payload,r=e.stageDimensions,o={width:hK(JK(n.width,64,512),64),height:hK(JK(n.height,64,512),64)},i={x:pK(n.width/2-o.width/2,64),y:pK(n.height/2-o.height/2,64)};if("auto"===e.boundingBoxScaleMethod){var a=N5(o);e.scaledBoundingBoxDimensions=a}e.boundingBoxDimensions=o,e.boundingBoxCoordinates=i,e.pastLayerStates.push(A5(e.layerState)),e.layerState=un(un({},H5),{},{objects:[{kind:"image",layer:"base",x:0,y:0,width:n.width,height:n.height,image:n}]}),e.futureLayerStates=[],e.isCanvasInitialized=!1;var s=T5(r.width,r.height,n.width,n.height,I5),l=M5(r.width,r.height,0,0,n.width,n.height,s);e.stageScale=s,e.stageCoordinates=l,e.doesCanvasNeedScaling=!0},setBoundingBoxDimensions:function(e,t){var n,r=(n=t.payload,{width:pK(n.width,64),height:pK(n.height,64)});if(e.boundingBoxDimensions=r,"auto"===e.boundingBoxScaleMethod){var o=N5(r);e.scaledBoundingBoxDimensions=o}},setBoundingBoxCoordinates:function(e,t){e.boundingBoxCoordinates=R5(t.payload)},setStageCoordinates:function(e,t){e.stageCoordinates=t.payload},setBoundingBoxPreviewFill:function(e,t){e.boundingBoxPreviewFill=t.payload},setDoesCanvasNeedScaling:function(e,t){e.doesCanvasNeedScaling=t.payload},setStageScale:function(e,t){e.stageScale=t.payload},setShouldDarkenOutsideBoundingBox:function(e,t){e.shouldDarkenOutsideBoundingBox=t.payload},setIsDrawing:function(e,t){e.isDrawing=t.payload},clearCanvasHistory:function(e){e.pastLayerStates=[],e.futureLayerStates=[]},setShouldLockBoundingBox:function(e,t){e.shouldLockBoundingBox=t.payload},toggleShouldLockBoundingBox:function(e){e.shouldLockBoundingBox=!e.shouldLockBoundingBox},setShouldShowBoundingBox:function(e,t){e.shouldShowBoundingBox=t.payload},setIsTransformingBoundingBox:function(e,t){e.isTransformingBoundingBox=t.payload},setIsMovingBoundingBox:function(e,t){e.isMovingBoundingBox=t.payload},setIsMouseOverBoundingBox:function(e,t){e.isMouseOverBoundingBox=t.payload},setIsMoveBoundingBoxKeyHeld:function(e,t){e.isMoveBoundingBoxKeyHeld=t.payload},setIsMoveStageKeyHeld:function(e,t){e.isMoveStageKeyHeld=t.payload},addImageToStagingArea:function(e,t){var n=t.payload,r=n.boundingBox,o=n.image;r&&o&&(e.pastLayerStates.push(A5(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea.images.push(un(un({kind:"image",layer:"base"},r),{},{image:o})),e.layerState.stagingArea.selectedImageIndex=e.layerState.stagingArea.images.length-1,e.futureLayerStates=[])},discardStagedImages:function(e){e.pastLayerStates.push(A5(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea=un({},H5.stagingArea),e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingOutline=!0},addFillRect:function(e){var t=e.boundingBoxCoordinates,n=e.boundingBoxDimensions,r=e.brushColor;e.pastLayerStates.push(A5(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push(un(un(un({kind:"fillRect",layer:"base"},t),n),{},{color:r})),e.futureLayerStates=[]},addEraseRect:function(e){var t=e.boundingBoxCoordinates,n=e.boundingBoxDimensions;e.pastLayerStates.push(A5(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push(un(un({kind:"eraseRect",layer:"base"},t),n)),e.futureLayerStates=[]},addLine:function(e,t){var n=e.tool,r=e.layer,o=e.brushColor,i=e.brushSize,a=e.shouldRestrictStrokesToBox;if("move"!==n&&"colorPicker"!==n){var s=i/2,l="base"===r&&"brush"===n?{color:o}:{};e.pastLayerStates.push(A5(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift();var u=un({kind:"line",layer:r,tool:n,strokeWidth:s,points:t.payload},l);a&&(u.clip=un(un({},e.boundingBoxCoordinates),e.boundingBoxDimensions)),e.layerState.objects.push(u),e.futureLayerStates=[]}},addPointToCurrentLine:function(e,t){var n,r=e.layerState.objects.findLast(F5);r&&(n=r.points).push.apply(n,cn(t.payload))},undo:function(e){var t=e.pastLayerStates.pop();t&&(e.futureLayerStates.unshift(A5(e.layerState)),e.futureLayerStates.length>e.maxHistory&&e.futureLayerStates.pop(),e.layerState=t)},redo:function(e){var t=e.futureLayerStates.shift();t&&(e.pastLayerStates.push(A5(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState=t)},setShouldShowGrid:function(e,t){e.shouldShowGrid=t.payload},setIsMovingStage:function(e,t){e.isMovingStage=t.payload},setShouldSnapToGrid:function(e,t){e.shouldSnapToGrid=t.payload},setShouldAutoSave:function(e,t){e.shouldAutoSave=t.payload},setShouldShowIntermediates:function(e,t){e.shouldShowIntermediates=t.payload},resetCanvas:function(e){e.pastLayerStates.push(A5(e.layerState)),e.layerState=H5,e.futureLayerStates=[]},setCanvasContainerDimensions:function(e,t){e.canvasContainerDimensions=t.payload},resizeAndScaleCanvas:function(e){var t=e.canvasContainerDimensions,n=t.width,r=t.height,o=e.layerState.objects.find(B5),i={width:Math.floor(n),height:Math.floor(r)};if(o){var a=o.width,s=o.height,l=T5(n,r,a,s,.95),u=M5(i.width,i.height,0,0,a,s,l);e.minimumStageScale=l,e.stageScale=l,e.stageCoordinates=R5(u),e.stageDimensions=i,e.isCanvasInitialized=!0}else{var c=T5(i.width,i.height,512,512,I5),d=M5(i.width,i.height,0,0,512,512,c),f={width:512,height:512};if(e.stageScale=c,e.stageCoordinates=d,e.stageDimensions=i,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=f,"auto"===e.boundingBoxScaleMethod){var h=N5(f);e.scaledBoundingBoxDimensions=h}}},resizeCanvas:function(e){var t=e.canvasContainerDimensions,n=t.width,r=t.height,o={width:Math.floor(n),height:Math.floor(r)};if(e.stageDimensions=o,!e.layerState.objects.find(B5)){var i=T5(o.width,o.height,512,512,I5),a=M5(o.width,o.height,0,0,512,512,i),s={width:512,height:512};if(e.stageScale=i,e.stageCoordinates=a,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=s,"auto"===e.boundingBoxScaleMethod){var l=N5(s);e.scaledBoundingBoxDimensions=l}}},resetCanvasView:function(e,t){var n=t.payload,r=n.contentRect,o=n.shouldScaleTo1,i=e.stageDimensions,a=i.width,s=i.height,l=r.x,u=r.y,c=r.width,d=r.height;if(0!==c&&0!==d){var f=o?1:T5(a,s,c,d,I5),h=M5(a,s,l,u,c,d,f);e.stageScale=f,e.stageCoordinates=h}else{var p=T5(a,s,512,512,I5),v=M5(a,s,0,0,512,512,p),g={width:512,height:512};if(e.stageScale=p,e.stageCoordinates=v,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=g,"auto"===e.boundingBoxScaleMethod){var m=N5(g);e.scaledBoundingBoxDimensions=m}}},nextStagingAreaImage:function(e){var t=e.layerState.stagingArea.selectedImageIndex,n=e.layerState.stagingArea.images.length;e.layerState.stagingArea.selectedImageIndex=Math.min(t+1,n-1)},prevStagingAreaImage:function(e){var t=e.layerState.stagingArea.selectedImageIndex;e.layerState.stagingArea.selectedImageIndex=Math.max(t-1,0)},commitStagingAreaImage:function(e){var t=e.layerState.stagingArea,n=t.images,r=t.selectedImageIndex;e.pastLayerStates.push(A5(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push(un({},n[r])),e.layerState.stagingArea=un({},H5.stagingArea),e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingImage=!0},fitBoundingBoxToStage:function(e){var t=e.boundingBoxDimensions,n=e.boundingBoxCoordinates,r=e.stageDimensions,o=e.stageScale,i=r.width/o,a=r.height/o;if(n.x<0||n.x+t.width>i||n.y<0||n.y+t.height>a){var s={width:hK(JK(i,64,512),64),height:hK(JK(a,64,512),64)},l={x:pK(i/2-s.width/2,64),y:pK(a/2-s.height/2,64)};if(e.boundingBoxDimensions=s,e.boundingBoxCoordinates=l,"auto"===e.boundingBoxScaleMethod){var u=N5(s);e.scaledBoundingBoxDimensions=u}}},setBoundingBoxScaleMethod:function(e,t){if(e.boundingBoxScaleMethod=t.payload,"auto"===t.payload){var n=N5(e.boundingBoxDimensions);e.scaledBoundingBoxDimensions=n}},setScaledBoundingBoxDimensions:function(e,t){e.scaledBoundingBoxDimensions=t.payload},setShouldShowStagingImage:function(e,t){e.shouldShowStagingImage=t.payload},setShouldShowStagingOutline:function(e,t){e.shouldShowStagingOutline=t.payload},setShouldShowCanvasDebugInfo:function(e,t){e.shouldShowCanvasDebugInfo=t.payload},setShouldRestrictStrokesToBox:function(e,t){e.shouldRestrictStrokesToBox=t.payload},setShouldCropToBoundingBoxOnSave:function(e,t){e.shouldCropToBoundingBoxOnSave=t.payload},setColorPickerColor:function(e,t){e.colorPickerColor=t.payload},commitColorPickerColor:function(e){e.brushColor=un(un({},e.colorPickerColor),{},{a:e.brushColor.a}),e.tool="brush"},setMergedCanvas:function(e,t){e.pastLayerStates.push(A5(e.layerState)),e.futureLayerStates=[],e.layerState.objects=[t.payload]},resetCanvasInteractionState:function(e){e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMoveBoundingBoxKeyHeld=!1,e.isMoveStageKeyHeld=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1,e.isTransformingBoundingBox=!1},mouseLeftCanvas:function(e){e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isTransformingBoundingBox=!1}}}),W5=V5.actions,U5=W5.addEraseRect,G5=W5.addFillRect,q5=W5.addImageToStagingArea,Y5=W5.addLine,Z5=W5.addPointToCurrentLine,X5=W5.clearCanvasHistory,$5=W5.clearMask,K5=W5.commitColorPickerColor,Q5=W5.commitStagingAreaImage,J5=W5.discardStagedImages,e3=(W5.fitBoundingBoxToStage,W5.mouseLeftCanvas),t3=W5.nextStagingAreaImage,n3=W5.prevStagingAreaImage,r3=W5.redo,o3=W5.resetCanvas,i3=W5.resetCanvasInteractionState,a3=W5.resetCanvasView,s3=W5.resizeAndScaleCanvas,l3=W5.resizeCanvas,u3=W5.setBoundingBoxCoordinates,c3=W5.setBoundingBoxDimensions,d3=(W5.setBoundingBoxPreviewFill,W5.setBoundingBoxScaleMethod),f3=W5.setBrushColor,h3=W5.setBrushSize,p3=W5.setCanvasContainerDimensions,v3=W5.setColorPickerColor,g3=W5.setCursorPosition,m3=W5.setDoesCanvasNeedScaling,y3=W5.setInitialCanvasImage,b3=W5.setIsDrawing,w3=W5.setIsMaskEnabled,k3=W5.setIsMouseOverBoundingBox,x3=(W5.setIsMoveBoundingBoxKeyHeld,W5.setIsMoveStageKeyHeld,W5.setIsMovingBoundingBox),S3=W5.setIsMovingStage,C3=W5.setIsTransformingBoundingBox,_3=W5.setLayer,E3=W5.setMaskColor,P3=W5.setMergedCanvas,L3=W5.setShouldAutoSave,O3=W5.setShouldCropToBoundingBoxOnSave,A3=W5.setShouldDarkenOutsideBoundingBox,M3=(W5.setShouldLockBoundingBox,W5.setShouldPreserveMaskedArea),T3=W5.setShouldShowBoundingBox,I3=(W5.setShouldShowBrush,W5.setShouldShowBrushPreview,W5.setShouldShowCanvasDebugInfo),R3=(W5.setShouldShowCheckboardTransparency,W5.setShouldShowGrid),N3=W5.setShouldShowIntermediates,D3=W5.setShouldShowStagingImage,z3=W5.setShouldShowStagingOutline,j3=W5.setShouldSnapToGrid,B3=W5.setStageCoordinates,F3=W5.setStageScale,H3=W5.setTool,V3=(W5.toggleShouldLockBoundingBox,W5.toggleTool,W5.undo),W3=W5.setScaledBoundingBoxDimensions,U3=W5.setShouldRestrictStrokesToBox,G3=V5.reducer,q3=k$({name:"gallery",initialState:{currentImageUuid:"",shouldPinGallery:!0,shouldShowGallery:!0,galleryScrollPosition:0,galleryImageMinimumWidth:64,galleryImageObjectFit:"cover",shouldHoldGalleryOpen:!1,shouldAutoSwitchToNewImages:!0,currentCategory:"result",categories:{user:{images:[],latest_mtime:void 0,earliest_mtime:void 0,areMoreImagesAvailable:!0},result:{images:[],latest_mtime:void 0,earliest_mtime:void 0,areMoreImagesAvailable:!0}},galleryWidth:300,shouldUseSingleGalleryColumn:!1},reducers:{setCurrentImage:function(e,t){e.currentImage=t.payload,e.currentImageUuid=t.payload.uuid},removeImage:function(e,t){var n=t.payload,r=n.uuid,o=n.category,i=e.categories[o].images,a=i.filter((function(e){return e.uuid!==r}));if(r===e.currentImageUuid){var s=i.findIndex((function(e){return e.uuid===r})),l=JK(s,0,a.length-1);e.currentImage=a.length?a[l]:void 0,e.currentImageUuid=a.length?a[l].uuid:""}e.categories[o].images=a},addImage:function(e,t){var n=t.payload,r=n.image,o=n.category,i=r.uuid,a=r.url,s=r.mtime,l=e.categories[o];l.images.find((function(e){return e.url===a&&e.mtime===s}))||(l.images.unshift(r),e.shouldAutoSwitchToNewImages&&(e.currentImageUuid=i,e.currentImage=r,e.currentCategory=o),e.intermediateImage=void 0,l.latest_mtime=s)},setIntermediateImage:function(e,t){e.intermediateImage=t.payload},clearIntermediateImage:function(e){e.intermediateImage=void 0},selectNextImage:function(e){var t=e.currentImage;if(t){var n=e.categories[t.category].images;if(t){var r=n.findIndex((function(e){return e.uuid===t.uuid}));if(r0){var o=n[r-1];e.currentImage=o,e.currentImageUuid=o.uuid}}}},addGalleryImages:function(e,t){var n=t.payload,r=n.images,o=n.areMoreImagesAvailable,i=n.category,a=e.categories[i].images;if(r.length>0){var s=r.filter((function(e){return!a.find((function(t){return t.url===e.url&&t.mtime===e.mtime}))}));if(e.categories[i].images=a.concat(s).sort((function(e,t){return t.mtime-e.mtime})),!e.currentImage){var l=r[0];e.currentImage=l,e.currentImageUuid=l.uuid}e.categories[i].latest_mtime=r[0].mtime,e.categories[i].earliest_mtime=r[r.length-1].mtime}void 0!==o&&(e.categories[i].areMoreImagesAvailable=o)},setShouldPinGallery:function(e,t){e.shouldPinGallery=t.payload},setShouldShowGallery:function(e,t){e.shouldShowGallery=t.payload},setGalleryScrollPosition:function(e,t){e.galleryScrollPosition=t.payload},setGalleryImageMinimumWidth:function(e,t){e.galleryImageMinimumWidth=t.payload},setGalleryImageObjectFit:function(e,t){e.galleryImageObjectFit=t.payload},setShouldHoldGalleryOpen:function(e,t){e.shouldHoldGalleryOpen=t.payload},setShouldAutoSwitchToNewImages:function(e,t){e.shouldAutoSwitchToNewImages=t.payload},setCurrentCategory:function(e,t){e.currentCategory=t.payload},setGalleryWidth:function(e,t){e.galleryWidth=t.payload},setShouldUseSingleGalleryColumn:function(e,t){e.shouldUseSingleGalleryColumn=t.payload}}}),Y3=q3.actions,Z3=Y3.addImage,X3=Y3.clearIntermediateImage,$3=Y3.removeImage,K3=Y3.setCurrentImage,Q3=Y3.addGalleryImages,J3=Y3.setIntermediateImage,e4=Y3.selectNextImage,t4=Y3.selectPrevImage,n4=Y3.setShouldPinGallery,r4=Y3.setShouldShowGallery,o4=Y3.setGalleryScrollPosition,i4=Y3.setGalleryImageMinimumWidth,a4=Y3.setGalleryImageObjectFit,s4=Y3.setShouldHoldGalleryOpen,l4=Y3.setShouldAutoSwitchToNewImages,u4=Y3.setCurrentCategory,c4=Y3.setGalleryWidth,d4=Y3.setShouldUseSingleGalleryColumn,f4=q3.reducer,h4=k$({name:"lightbox",initialState:{isLightboxOpen:!1},reducers:{setIsLightboxOpen:function(e,t){e.isLightboxOpen=t.payload}}}),p4=h4.actions.setIsLightboxOpen,v4=h4.reducer,g4=function(e){return 1===e.length?e[0].prompt:e.map((function(e){return"".concat(e.prompt,":").concat(e.weight)})).join(" ")};function m4(e){var t=g4(e),n=null,r=new RegExp(/(?<=\[)[^\][]*(?=])/,"gi"),o=cn(t.matchAll(r));return o&&o.length>0&&(n=o.join(", "),t=t.replaceAll(r,"").replaceAll("[]","").trim()),[t,n]}var y4=function(e){var t=e.split(",").map((function(e){return e.split(":")})),n=t.map((function(e){return{seed:Number(e[0]),weight:Number(e[1])}}));return!!b4(n)&&n},b4=function(e){return"string"==typeof e?Boolean(y4(e)):Boolean(e.length&&!e.some((function(e){var t=e.seed,n=e.weight,r=!isNaN(parseInt(t.toString(),10)),o=!isNaN(parseInt(n.toString(),10))&&n>=0&&n<=1;return!(r&&o)})))},w4=function(e){return e.reduce((function(e,t,n,r){var o=t.seed,i=t.weight;return e+="".concat(o,":").concat(i),n!==r.length-1&&(e+=","),e}),"")},k4={cfgScale:7.5,height:512,img2imgStrength:.75,infillMethod:"patchmatch",iterations:1,maskPath:"",perlin:0,prompt:"",negativePrompt:"",sampler:"k_lms",seamBlur:16,seamless:!1,seamSize:96,seamSteps:30,seamStrength:.7,seed:0,seedWeights:"",shouldFitToWidthHeight:!0,shouldGenerateVariations:!1,shouldRandomizeSeed:!0,steps:50,threshold:0,tileSize:32,variationAmount:.1,width:512},x4=k$({name:"generation",initialState:k4,reducers:{setPrompt:function(e,t){var n=t.payload;e.prompt="string"==typeof n?n:g4(n)},setNegativePrompt:function(e,t){var n=t.payload;e.negativePrompt="string"==typeof n?n:g4(n)},setIterations:function(e,t){e.iterations=t.payload},setSteps:function(e,t){e.steps=t.payload},setCfgScale:function(e,t){e.cfgScale=t.payload},setThreshold:function(e,t){e.threshold=t.payload},setPerlin:function(e,t){e.perlin=t.payload},setHeight:function(e,t){e.height=t.payload},setWidth:function(e,t){e.width=t.payload},setSampler:function(e,t){e.sampler=t.payload},setSeed:function(e,t){e.seed=t.payload,e.shouldRandomizeSeed=!1},setImg2imgStrength:function(e,t){e.img2imgStrength=t.payload},setMaskPath:function(e,t){e.maskPath=t.payload},setSeamless:function(e,t){e.seamless=t.payload},setShouldFitToWidthHeight:function(e,t){e.shouldFitToWidthHeight=t.payload},resetSeed:function(e){e.seed=-1},setParameter:function(e,t){var n=t.payload,r=n.key,o=n.value,i=un(un({},e),{},gn({},r,o));return"seed"===r&&(i.shouldRandomizeSeed=!1),i},setShouldGenerateVariations:function(e,t){e.shouldGenerateVariations=t.payload},setVariationAmount:function(e,t){e.variationAmount=t.payload},setSeedWeights:function(e,t){e.seedWeights=t.payload,e.shouldGenerateVariations=!0,e.variationAmount=0},setAllTextToImageParameters:function(e,t){var n=t.payload.image,r=n.sampler,o=n.prompt,i=n.seed,a=n.variations,s=n.steps,l=n.cfg_scale,u=n.threshold,c=n.perlin,d=n.seamless,f=(n.hires_fix,n.width),h=n.height;a&&a.length>0?(e.seedWeights=w4(a),e.shouldGenerateVariations=!0,e.variationAmount=0):e.shouldGenerateVariations=!1,i&&(e.seed=i,e.shouldRandomizeSeed=!1),o&&(e.prompt=g4(o)),r&&(e.sampler=r),s&&(e.steps=s),l&&(e.cfgScale=l),e.threshold=void 0===u?0:u,c&&(e.perlin=c),void 0===c&&(e.perlin=0),"boolean"==typeof d&&(e.seamless=d),f&&(e.width=f),h&&(e.height=h)},setAllImageToImageParameters:function(e,t){var n=t.payload.image,r=n.type,o=n.strength,i=n.fit,a=n.init_image_path,s=n.mask_image_path;"img2img"===r&&(a&&(e.initialImage=a),s&&(e.maskPath=s),o&&(e.img2imgStrength=o),"boolean"==typeof i&&(e.shouldFitToWidthHeight=i))},setAllParameters:function(e,t){var n=t.payload.image,r=n.type,o=n.sampler,i=n.prompt,a=n.seed,s=n.variations,l=n.steps,u=n.cfg_scale,c=n.threshold,d=n.perlin,f=n.seamless,h=(n.hires_fix,n.width),p=n.height,v=n.strength,g=n.fit,m=n.init_image_path,y=n.mask_image_path;if("img2img"===r&&(m&&(e.initialImage=m),y&&(e.maskPath=y),v&&(e.img2imgStrength=v),"boolean"==typeof g&&(e.shouldFitToWidthHeight=g)),s&&s.length>0?(e.seedWeights=w4(s),e.shouldGenerateVariations=!0,e.variationAmount=0):e.shouldGenerateVariations=!1,a&&(e.seed=a,e.shouldRandomizeSeed=!1),i){var b=yn(m4(i),2),w=b[0],k=b[1];w&&(e.prompt=w),e.negativePrompt=k||""}o&&(e.sampler=o),l&&(e.steps=l),u&&(e.cfgScale=u),c&&(e.threshold=c),void 0===c&&(e.threshold=0),d&&(e.perlin=d),void 0===d&&(e.perlin=0),"boolean"==typeof f&&(e.seamless=f),h&&(e.width=h),p&&(e.height=p)},resetParametersState:function(e){return un(un({},e),k4)},setShouldRandomizeSeed:function(e,t){e.shouldRandomizeSeed=t.payload},setInitialImage:function(e,t){e.initialImage=t.payload},clearInitialImage:function(e){e.initialImage=void 0},setSeamSize:function(e,t){e.seamSize=t.payload},setSeamBlur:function(e,t){e.seamBlur=t.payload},setSeamStrength:function(e,t){e.seamStrength=t.payload},setSeamSteps:function(e,t){e.seamSteps=t.payload},setTileSize:function(e,t){e.tileSize=t.payload},setInfillMethod:function(e,t){e.infillMethod=t.payload}}}),S4=x4.actions,C4=S4.clearInitialImage,_4=(S4.resetParametersState,S4.resetSeed,S4.setAllImageToImageParameters),E4=S4.setAllParameters,P4=(S4.setAllTextToImageParameters,S4.setCfgScale),L4=S4.setHeight,O4=S4.setImg2imgStrength,A4=S4.setInfillMethod,M4=S4.setInitialImage,T4=S4.setIterations,I4=S4.setMaskPath,R4=(S4.setParameter,S4.setPerlin),N4=S4.setPrompt,D4=S4.setNegativePrompt,z4=S4.setSampler,j4=S4.setSeamBlur,B4=S4.setSeamless,F4=S4.setSeamSize,H4=S4.setSeamSteps,V4=S4.setSeamStrength,W4=S4.setSeed,U4=S4.setSeedWeights,G4=S4.setShouldFitToWidthHeight,q4=S4.setShouldGenerateVariations,Y4=S4.setShouldRandomizeSeed,Z4=S4.setSteps,X4=S4.setThreshold,$4=S4.setTileSize,K4=S4.setVariationAmount,Q4=S4.setWidth,J4=x4.reducer,e6={codeformerFidelity:.75,facetoolStrength:.8,facetoolType:"gfpgan",hiresFix:!1,hiresStrength:.75,shouldLoopback:!1,shouldRunESRGAN:!1,shouldRunFacetool:!1,upscalingLevel:4,upscalingStrength:.75},t6=k$({name:"postprocessing",initialState:e6,reducers:{setFacetoolStrength:function(e,t){e.facetoolStrength=t.payload},setCodeformerFidelity:function(e,t){e.codeformerFidelity=t.payload},setUpscalingLevel:function(e,t){e.upscalingLevel=t.payload},setUpscalingStrength:function(e,t){e.upscalingStrength=t.payload},setHiresFix:function(e,t){e.hiresFix=t.payload},setHiresStrength:function(e,t){e.hiresStrength=t.payload},resetPostprocessingState:function(e){return un(un({},e),e6)},setShouldRunFacetool:function(e,t){e.shouldRunFacetool=t.payload},setFacetoolType:function(e,t){e.facetoolType=t.payload},setShouldRunESRGAN:function(e,t){e.shouldRunESRGAN=t.payload},setShouldLoopback:function(e,t){e.shouldLoopback=t.payload}}}),n6=t6.actions,r6=(n6.resetPostprocessingState,n6.setCodeformerFidelity),o6=n6.setFacetoolStrength,i6=n6.setFacetoolType,a6=n6.setHiresFix,s6=n6.setHiresStrength,l6=n6.setShouldLoopback,u6=n6.setShouldRunESRGAN,c6=n6.setShouldRunFacetool,d6=n6.setUpscalingLevel,f6=n6.setUpscalingStrength,h6=t6.reducer;function p6(e){return p6="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p6(e)}function v6(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g6(e){var t=function(e,t){if("object"!==p6(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==p6(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===p6(t)?t:String(t)}function m6(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{};v6(this,e),this.init(t,n)}return y6(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||O6,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n1?t-1:0),r=1;r-1?e.replace(/###/g,"."):e}function o(){return!e||"string"==typeof e}for(var i="string"!=typeof t?[].concat(t):t.split(".");i.length>1;){if(o())return{};var a=r(i.shift());!e[a]&&n&&(e[a]=new n),e=Object.prototype.hasOwnProperty.call(e,a)?e[a]:{}}return o()?{}:{obj:e,k:r(i.shift())}}function z6(e,t,n){var r=D6(e,t,Object);r.obj[r.k]=n}function j6(e,t){var n=D6(e,t),r=n.obj,o=n.k;if(r)return r[o]}function B6(e,t,n){var r=j6(e,n);return void 0!==r?r:j6(t,n)}function F6(e,t,n){for(var r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof t[r]||t[r]instanceof String?n&&(e[r]=t[r]):F6(e[r],t[r],n):e[r]=t[r]);return e}function H6(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var V6={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function W6(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return V6[e]})):e}var U6="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,G6=[" ",",","?","!",";"];function q6(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Y6(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:".";if(e){if(e[t])return e[t];for(var r=t.split(n),o=e,i=0;ii+a;)a++,l=o[s=r.slice(i,i+a).join(n)];if(void 0===l)return;if(null===l)return null;if(t.endsWith(s)){if("string"==typeof l)return l;if(s&&"string"==typeof l[s])return l[s]}var u=r.slice(i+a).join(n);return u?X6(l,u,n):void 0}o=o[r[i]]}return o}}var $6=function(e){k6(n,e);var t=Z6(n);function n(e){var r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return v6(this,n),r=t.call(this),U6&&T6.call(b6(r)),r.data=e||{},r.options=o,void 0===r.options.keySeparator&&(r.options.keySeparator="."),void 0===r.options.ignoreJSONStructure&&(r.options.ignoreJSONStructure=!0),r}return y6(n,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,i=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure,a=[e,t];n&&"string"!=typeof n&&(a=a.concat(n)),n&&"string"==typeof n&&(a=a.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(a=e.split("."));var s=j6(this.data,a);return s||!i||"string"!=typeof n?s:X6(this.data&&this.data[e]&&this.data[e][t],n,o)}},{key:"addResource",value:function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},i=this.options.keySeparator;void 0===i&&(i=".");var a=[e,t];n&&(a=a.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(r=t,t=(a=e.split("."))[1]),this.addNamespaces(t),z6(this.data,a,r),o.silent||this.emit("added",e,t,n,r)}},{key:"addResources",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var o in n)"string"!=typeof n[o]&&"[object Array]"!==Object.prototype.toString.apply(n[o])||this.addResource(e,t,o,n[o],{silent:!0});r.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[e,t];e.indexOf(".")>-1&&(r=n,n=t,t=(a=e.split("."))[1]),this.addNamespaces(t);var s=j6(this.data,a)||{};r?F6(s,n,o):s=Y6(Y6({},s),n),z6(this.data,a,s),i.silent||this.emit("added",e,t,n)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?Y6(Y6({},{}),this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"hasLanguageSomeTranslations",value:function(e){var t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((function(e){return t[e]&&Object.keys(t[e]).length>0}))}},{key:"toJSON",value:function(){return this.data}}]),n}(T6),K6={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,r,o){var i=this;return e.forEach((function(e){i.processors[e]&&(t=i.processors[e].process(t,n,r,o))})),t}};function Q6(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function J6(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};return v6(this,n),r=t.call(this),U6&&T6.call(b6(r)),N6(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,b6(r)),r.options=o,void 0===r.options.keySeparator&&(r.options.keySeparator="."),r.logger=M6.create("translator"),r}return y6(n,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;var n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(e,t){var n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,o=t.ns||this.options.defaultNS||[],i=n&&e.indexOf(n)>-1,a=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||function(e,t,n){t=t||"",n=n||"";var r=G6.filter((function(e){return t.indexOf(e)<0&&n.indexOf(e)<0}));if(0===r.length)return!0;var o=new RegExp("(".concat(r.map((function(e){return"?"===e?"\\?":e})).join("|"),")")),i=!o.test(e);if(!i){var a=e.indexOf(n);a>0&&!o.test(e.substring(0,a))&&(i=!0)}return i}(e,n,r));if(i&&!a){var s=e.match(this.interpolator.nestingRegexp);if(s&&s.length>0)return{key:e,namespaces:o};var l=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(l[0])>-1)&&(o=l.shift()),e=l.join(r)}return"string"==typeof o&&(o=[o]),{key:e,namespaces:o}}},{key:"translate",value:function(e,t,r){var o=this;if("object"!==p6(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var i=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,a=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,s=this.extractFromKey(e[e.length-1],t),l=s.key,u=s.namespaces,c=u[u.length-1],d=t.lng||this.language,f=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d&&"cimode"===d.toLowerCase()){if(f){var h=t.nsSeparator||this.options.nsSeparator;return i?(p.res="".concat(c).concat(h).concat(l),p):"".concat(c).concat(h).concat(l)}return i?(p.res=l,p):l}var p=this.resolve(e,t),v=p&&p.res,g=p&&p.usedKey||l,m=p&&p.exactUsedKey||l,y=Object.prototype.toString.apply(v),b=["[object Number]","[object Function]","[object RegExp]"],w=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,k=!this.i18nFormat||this.i18nFormat.handleAsObject,x="string"!=typeof v&&"boolean"!=typeof v&&"number"!=typeof v;if(k&&v&&x&&b.indexOf(y)<0&&("string"!=typeof w||"[object Array]"!==y)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var S=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,v,J6(J6({},t),{},{ns:u})):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.");return i?(p.res=S,p):S}if(a){var C="[object Array]"===y,_=C?[]:{},E=C?m:g;for(var P in v)if(Object.prototype.hasOwnProperty.call(v,P)){var L="".concat(E).concat(a).concat(P);_[P]=this.translate(L,J6(J6({},t),{joinArrays:!1,ns:u})),_[P]===L&&(_[P]=v[P])}v=_}}else if(k&&"string"==typeof w&&"[object Array]"===y)(v=v.join(w))&&(v=this.extendTranslation(v,e,t,r));else{var O=!1,A=!1,M=void 0!==t.count&&"string"!=typeof t.count,T=n.hasDefaultValue(t),I=M?this.pluralResolver.getSuffix(d,t.count,t):"",R=t["defaultValue".concat(I)]||t.defaultValue;!this.isValidLookup(v)&&T&&(O=!0,v=R),this.isValidLookup(v)||(A=!0,v=l);var N=t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,D=N&&A?void 0:v,z=T&&R!==v&&this.options.updateMissing;if(A||O||z){if(this.logger.log(z?"updateKey":"missingKey",d,c,l,z?R:v),a){var j=this.resolve(l,J6(J6({},t),{},{keySeparator:!1}));j&&j.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var B=[],F=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&F&&F[0])for(var H=0;H1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!a.isValidLookup(t)){var l=a.extractFromKey(e,s),u=l.key;n=u;var c=l.namespaces;a.options.fallbackNS&&(c=c.concat(a.options.fallbackNS));var d=void 0!==s.count&&"string"!=typeof s.count,f=d&&!s.ordinal&&0===s.count&&a.pluralResolver.shouldUseIntlApi(),h=void 0!==s.context&&("string"==typeof s.context||"number"==typeof s.context)&&""!==s.context,p=s.lngs?s.lngs:a.languageUtils.toResolveHierarchy(s.lng||a.language,s.fallbackLng);c.forEach((function(e){a.isValidLookup(t)||(i=e,!t7["".concat(p[0],"-").concat(e)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(i)&&(t7["".concat(p[0],"-").concat(e)]=!0,a.logger.warn('key "'.concat(n,'" for languages "').concat(p.join(", "),'" won\'t get resolved as namespace "').concat(i,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach((function(n){if(!a.isValidLookup(t)){o=n;var i,l=[u];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(l,u,n,e,s);else{var c;d&&(c=a.pluralResolver.getSuffix(n,s.count,s));var p="".concat(a.options.pluralSeparator,"zero");if(d&&(l.push(u+c),f&&l.push(u+p)),h){var v="".concat(u).concat(a.options.contextSeparator).concat(s.context);l.push(v),d&&(l.push(v+c),f&&l.push(v+p))}}for(;i=l.pop();)a.isValidLookup(t)||(r=i,t=a.getResource(n,e,i,s))}})))}))}})),{res:t,usedKey:n,exactUsedKey:r,usedLng:o,usedNS:i}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}}],[{key:"hasDefaultValue",value:function(e){var t="defaultValue";for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&void 0!==e[n])return!0;return!1}}]),n}(T6);function r7(e){return e.charAt(0).toUpperCase()+e.slice(1)}var o7=function(){function e(t){v6(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=M6.create("languageUtils")}return y6(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=r7(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=r7(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=r7(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,n=this;return e?(e.forEach((function(e){if(!t){var r=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(r)||(t=r)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var r=n.getLanguagePartFromCode(e);if(n.isSupportedCode(r))return t=r;t=n.options.supportedLngs.find((function(e){if(0===e.indexOf(r))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}},{key:"toResolveHierarchy",value:function(e,t){var n=this,r=this.getFallbackCodes(t||this.options.fallbackLng||[],e),o=[],i=function(e){e&&(n.isSupportedCode(e)?o.push(e):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):"string"==typeof e&&i(this.formatLanguageCode(e)),r.forEach((function(e){o.indexOf(e)<0&&i(n.formatLanguageCode(e))})),o}}]),e}(),i7=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],a7={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},s7=["v1","v2","v3"],l7={zero:0,one:1,two:2,few:3,many:4,other:5};function u7(){var e={};return i7.forEach((function(t){t.lngs.forEach((function(n){e[n]={numbers:t.nr,plurals:a7[t.fc]}}))})),e}var c7=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};v6(this,e),this.languageUtils=t,this.options=n,this.logger=M6.create("pluralResolver"),this.options.compatibilityJSON&&"v4"!==this.options.compatibilityJSON||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=u7()}return y6(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(e,{type:t.ordinal?"ordinal":"cardinal"})}catch(n){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map((function(e){return"".concat(t).concat(e)}))}},{key:"getSuffixes",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((function(e,t){return l7[e]-l7[t]})).map((function(e){return"".concat(t.options.prepend).concat(e)})):r.numbers.map((function(r){return t.getSuffix(e,r,n)})):[]}},{key:"getSuffix",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(r.select(t)):this.getSuffixRetroCompatible(r,t):(this.logger.warn("no plural rule found for: ".concat(e)),"")}},{key:"getSuffixRetroCompatible",value:function(e,t){var n=this,r=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),o=e.numbers[r];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===o?o="plural":1===o&&(o=""));var i=function(){return n.options.prepend&&o.toString()?n.options.prepend+o.toString():o.toString()};return"v1"===this.options.compatibilityJSON?1===o?"":"number"==typeof o?"_plural_".concat(o.toString()):i():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?i():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}},{key:"shouldUseIntlApi",value:function(){return!s7.includes(this.options.compatibilityJSON)}}]),e}();function d7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f7(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};v6(this,e),this.logger=M6.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return y6(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:W6,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?H6(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?H6(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?H6(t.nestingPrefix):t.nestingPrefixEscaped||H6("$t("),this.nestingSuffix=t.nestingSuffix?H6(t.nestingSuffix):t.nestingSuffixEscaped||H6(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(e,t,n,r){var o,i,a,s=this,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function u(e){return e.replace(/\$/g,"$$$$")}var c=function(e){if(e.indexOf(s.formatSeparator)<0){var o=B6(t,l,e);return s.alwaysFormat?s.format(o,void 0,n,f7(f7(f7({},r),t),{},{interpolationkey:e})):o}var i=e.split(s.formatSeparator),a=i.shift().trim(),u=i.join(s.formatSeparator).trim();return s.format(B6(t,l,a),u,n,f7(f7(f7({},r),t),{},{interpolationkey:a}))};this.resetRegExp();var d=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,f=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return u(e)}},{regex:this.regexp,safeValue:function(e){return s.escapeValue?u(s.escape(e)):u(e)}}].forEach((function(t){for(a=0;o=t.regex.exec(e);){var n=o[1].trim();if(void 0===(i=c(n)))if("function"==typeof d){var l=d(e,o,r);i="string"==typeof l?l:""}else if(r&&r.hasOwnProperty(n))i="";else{if(f){i=o[0];continue}s.logger.warn("missed to pass in variable ".concat(n," for interpolating ").concat(e)),i=""}else"string"==typeof i||s.useRawValueToEscape||(i=R6(i));var u=t.safeValue(i);if(e=e.replace(o[0],u),f?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,++a>=s.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var n,r,o,i=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};function s(e,t){var n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;var r=e.split(new RegExp("".concat(n,"[ ]*{"))),i="{".concat(r[1]);e=r[0];var a=(i=this.interpolate(i,o)).match(/'/g),s=i.match(/"/g);(a&&a.length%2==0&&!s||s.length%2!=0)&&(i=i.replace(/'/g,'"'));try{o=JSON.parse(i),t&&(o=f7(f7({},t),o))}catch(Dhe){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),Dhe),"".concat(e).concat(n).concat(i)}return delete o.defaultValue,e}for(;n=this.nestingRegexp.exec(e);){var l=[];(o=f7({},a)).applyPostProcessor=!1,delete o.defaultValue;var u=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){var c=n[1].split(this.formatSeparator).map((function(e){return e.trim()}));n[1]=c.shift(),l=c,u=!0}if((r=t(s.call(this,n[1].trim(),o),o))&&n[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=R6(r)),r||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),r=""),u&&(r=l.reduce((function(e,t){return i.format(e,t,a.lng,f7(f7({},a),{},{interpolationkey:n[1].trim()}))}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}]),e}();function p7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function v7(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};v6(this,e),this.logger=M6.create("formatter"),this.options=t,this.formats={number:g7((function(e,t){var n=new Intl.NumberFormat(e,t);return function(e){return n.format(e)}})),currency:g7((function(e,t){var n=new Intl.NumberFormat(e,v7(v7({},t),{},{style:"currency"}));return function(e){return n.format(e)}})),datetime:g7((function(e,t){var n=new Intl.DateTimeFormat(e,v7({},t));return function(e){return n.format(e)}})),relativetime:g7((function(e,t){var n=new Intl.RelativeTimeFormat(e,v7({},t));return function(e){return n.format(e,t.range||"day")}})),list:g7((function(e,t){var n=new Intl.ListFormat(e,v7({},t));return function(e){return n.format(e)}}))},this.init(t)}return y6(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=t.interpolation;this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||","}},{key:"add",value:function(e,t){this.formats[e.toLowerCase().trim()]=t}},{key:"addCached",value:function(e,t){this.formats[e.toLowerCase().trim()]=g7(t)}},{key:"format",value:function(e,t,n,r){var o=this,i=t.split(this.formatSeparator).reduce((function(e,t){var i=function(e){var t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){var r=e.split("(");t=r[0].toLowerCase().trim();var o=r[1].substring(0,r[1].length-1);"currency"===t&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):"relativetime"===t&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach((function(e){if(e){var t=E6(e.split(":")),r=t[0],o=t.slice(1).join(":").trim().replace(/^'+|'+$/g,"");n[r.trim()]||(n[r.trim()]=o),"false"===o&&(n[r.trim()]=!1),"true"===o&&(n[r.trim()]=!0),isNaN(o)||(n[r.trim()]=parseInt(o,10))}}))}return{formatName:t,formatOptions:n}}(t),a=i.formatName,s=i.formatOptions;if(o.formats[a]){var l=e;try{var u=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},c=u.locale||u.lng||r.locale||r.lng||n;l=o.formats[a](e,c,v7(v7(v7({},s),r),u))}catch(d){o.logger.warn(d)}return l}return o.logger.warn("there was no format function for ".concat(a)),e}),e);return i}}]),e}();function y7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function b7(e){for(var t=1;t3&&void 0!==arguments[3]?arguments[3]:{};return v6(this,n),i=t.call(this),U6&&T6.call(b6(i)),i.backend=e,i.store=r,i.services=o,i.languageUtils=o.languageUtils,i.options=a,i.logger=M6.create("backendConnector"),i.waitingReads=[],i.maxParallelReads=a.maxParallelReads||10,i.readingCalls=0,i.maxRetries=a.maxRetries>=0?a.maxRetries:5,i.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,i.state={},i.queue=[],i.backend&&i.backend.init&&i.backend.init(o,a.backend,a),i}return y6(n,[{key:"queueLoad",value:function(e,t,n,r){var o=this,i={},a={},s={},l={};return e.forEach((function(e){var r=!0;t.forEach((function(t){var s="".concat(e,"|").concat(t);!n.reload&&o.store.hasResourceBundle(e,t)?o.state[s]=2:o.state[s]<0||(1===o.state[s]?void 0===a[s]&&(a[s]=!0):(o.state[s]=1,r=!1,void 0===a[s]&&(a[s]=!0),void 0===i[s]&&(i[s]=!0),void 0===l[t]&&(l[t]=!0)))})),r||(s[e]=!0)})),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}},{key:"loaded",value:function(e,t,n){var r=e.split("|"),o=r[0],i=r[1];t&&this.emit("failedLoading",o,i,t),n&&this.store.addResourceBundle(o,i,n),this.state[e]=t?-1:2;var a={};this.queue.forEach((function(n){!function(e,t,n,r){var o=D6(e,t,Object),i=o.obj,a=o.k;i[a]=i[a]||[],r&&(i[a]=i[a].concat(n)),r||i[a].push(n)}(n.loaded,[o],i),function(e,t){void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)}(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((function(e){a[e]||(a[e]={});var t=n.loaded[e];t.length&&t.forEach((function(t){void 0===a[e][t]&&(a[e][t]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",a),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,n){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads)this.waitingReads.push({lng:e,ns:t,fcName:n,tried:o,wait:i,callback:a});else{this.readingCalls++;var s=function(s,l){if(r.readingCalls--,r.waitingReads.length>0){var u=r.waitingReads.shift();r.read(u.lng,u.ns,u.fcName,u.tried,u.wait,u.callback)}s&&l&&o2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var i=this.queueLoad(e,t,r,o);if(!i.toLoad.length)return i.pending.length||o(),null;i.toLoad.forEach((function(e){n.loadOne(e)}))}},{key:"load",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.split("|"),o=r[0],i=r[1];this.read(o,i,"read",void 0,void 0,(function(r,a){r&&t.logger.warn("".concat(n,"loading namespace ").concat(i," for language ").concat(o," failed"),r),!r&&a&&t.logger.log("".concat(n,"loaded namespace ").concat(i," for language ").concat(o),a),t.loaded(e,r,a)}))}},{key:"saveMissing",value:function(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:function(){};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t))this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");else if(null!=n&&""!==n){if(this.backend&&this.backend.create){var s=b7(b7({},i),{},{isUpdate:o}),l=this.backend.create.bind(this.backend);if(l.length<6)try{var u;(u=5===l.length?l(e,t,n,r,s):l(e,t,n,r))&&"function"==typeof u.then?u.then((function(e){return a(null,e)})).catch(a):a(null,u)}catch(COe){a(COe)}else l(e,t,n,r,a,s)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}}]),n}(T6);function x7(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===p6(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===p6(e[2])||"object"===p6(e[3])){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,n,r){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function S7(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function C7(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _7(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(v6(this,n),e=t.call(this),U6&&T6.call(b6(e)),e.options=S7(r),e.services={},e.logger=M6,e.modules={external:[]},L7(b6(e)),o&&!e.isInitialized&&!r.isClone){if(!e.options.initImmediate)return e.init(r,o),x6(e,b6(e));setTimeout((function(){e.init(r,o)}),0)}return e}return y6(n,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(n=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));var r=x7();function o(e){return e?"function"==typeof e?new e:e:null}if(this.options=_7(_7(_7({},r),this.options),S7(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=_7(_7({},r.interpolation),this.options.interpolation)),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){var i;this.modules.logger?M6.init(o(this.modules.logger),this.options):M6.init(null,this.options),this.modules.formatter?i=this.modules.formatter:"undefined"!=typeof Intl&&(i=m7);var a=new o7(this.options);this.store=new $6(this.options.resources,this.options);var s=this.services;s.logger=M6,s.resourceStore=this.store,s.languageUtils=a,s.pluralResolver=new c7(a,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!i||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(s.formatter=o(i),s.formatter.init(s,this.options),this.options.interpolation.format=s.formatter.format.bind(s.formatter)),s.interpolator=new h7(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new k7(o(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o1?n-1:0),o=1;o0&&"dev"!==l[0]&&(this.options.lng=l[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");var u=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];u.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments)}}));var c=["addResource","addResources","addResourceBundle","removeResourceBundle"];c.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments),e}}));var d=I6(),f=function(){var t=function(t,r){e.isInitialized&&!e.initializedStoreOnce&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),d.resolve(r),n(t,r)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?f():setTimeout(f,0),d}},{key:"loadResources",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:P7,r=n,o="string"==typeof e?e:this.language;if("function"==typeof e&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(o&&"cimode"===o.toLowerCase())return r();var i=[],a=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){i.indexOf(e)<0&&i.push(e)}))};if(o)a(o);else{var s=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);s.forEach((function(e){return a(e)}))}this.options.preload&&this.options.preload.forEach((function(e){return a(e)})),this.services.backendConnector.load(i,this.options.ns,(function(e){e||t.resolvedLanguage||!t.language||t.setResolvedLanguage(t.language),r(e)}))}else r(null)}},{key:"reloadResources",value:function(e,t,n){var r=I6();return e||(e=this.languages),t||(t=this.options.ns),n||(n=P7),this.services.backendConnector.reload(e,t,(function(e){r.resolve(),n(e)})),r}},{key:"use",value:function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&K6.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"setResolvedLanguage",value:function(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(var t=0;t-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}},{key:"changeLanguage",value:function(e,t){var n=this;this.isLanguageChangingTo=e;var r=I6();this.emit("languageChanging",e);var o=function(e){n.language=e,n.languages=n.services.languageUtils.toResolveHierarchy(e),n.resolvedLanguage=void 0,n.setResolvedLanguage(e)},i=function(i){e||i||!n.services.languageDetector||(i=[]);var a="string"==typeof i?i:n.services.languageUtils.getBestMatchFromCodes(i);a&&(n.language||o(a),n.translator.language||n.translator.changeLanguage(a),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage&&n.services.languageDetector.cacheUserLanguage(a)),n.loadResources(a,(function(e){!function(e,i){i?(o(i),n.translator.changeLanguage(i),n.isLanguageChangingTo=void 0,n.emit("languageChanged",i),n.logger.log("languageChanged",i)):n.isLanguageChangingTo=void 0,r.resolve((function(){return n.t.apply(n,arguments)})),t&&t(e,(function(){return n.t.apply(n,arguments)}))}(e,a)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(i):this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(e,t,n){var r=this,o=function e(t,o){var i;if("object"!==p6(o)){for(var a=arguments.length,s=new Array(a>2?a-2:0),l=2;l1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var r=this.resolvedLanguage||this.languages[0],o=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var a=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};if(n.precheck){var s=n.precheck(this,a);if(void 0!==s)return s}return!!this.hasResourceBundle(r,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!a(r,e)||o&&!a(i,e)))}},{key:"loadNamespaces",value:function(e,t){var n=this,r=I6();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)})),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var n=I6();"string"==typeof e&&(e=[e]);var r=this.options.preload||[],o=e.filter((function(e){return r.indexOf(e)<0}));return o.length?(this.options.preload=r.concat(o),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";var t=this.services&&this.services.languageUtils||new o7(x7());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:P7,o=_7(_7(_7({},this.options),t),{isClone:!0}),i=new n(o);void 0===t.debug&&void 0===t.prefix||(i.logger=i.logger.clone(t));var a=["store","services","language"];return a.forEach((function(t){i[t]=e[t]})),i.services=_7({},this.services),i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i.translator=new n7(i.services,i.options),i.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new O7(e,t)}));var A7=O7.createInstance();function M7(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function T7(e){return T7="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},T7(e)}function I7(e){var t=function(e,t){if("object"!==T7(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==T7(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===T7(t)?t:String(t)}function R7(e,t){for(var n=0;n0){var a=r.maxAge-0;if(Number.isNaN(a))throw new Error("maxAge should be a Number");i+="; Max-Age=".concat(Math.floor(a))}if(r.domain){if(!B7.test(r.domain))throw new TypeError("option domain is invalid");i+="; Domain=".concat(r.domain)}if(r.path){if(!B7.test(r.path))throw new TypeError("option path is invalid");i+="; Path=".concat(r.path)}if(r.expires){if("function"!=typeof r.expires.toUTCString)throw new TypeError("option expires is invalid");i+="; Expires=".concat(r.expires.toUTCString())}if(r.httpOnly&&(i+="; HttpOnly"),r.secure&&(i+="; Secure"),r.sameSite)switch("string"==typeof r.sameSite?r.sameSite.toLowerCase():r.sameSite){case!0:i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"strict":i+="; SameSite=Strict";break;case"none":i+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return i},H7=function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{path:"/",sameSite:"strict"};n&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+60*n*1e3)),r&&(o.domain=r),document.cookie=F7(e,encodeURIComponent(t),o)},V7=function(e){for(var t="".concat(e,"="),n=document.cookie.split(";"),r=0;r-1&&(n=window.location.hash.substring(window.location.hash.indexOf("?")));for(var r=n.substring(1).split("&"),o=0;o0)r[o].substring(0,i)===e.lookupQuerystring&&(t=r[o].substring(i+1))}}return t}},G7=null,q7=function(){if(null!==G7)return G7;try{G7="undefined"!==window&&null!==window.localStorage;var e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch(Dhe){G7=!1}return G7},Y7={name:"localStorage",lookup:function(e){var t;if(e.lookupLocalStorage&&q7()){var n=window.localStorage.getItem(e.lookupLocalStorage);n&&(t=n)}return t},cacheUserLanguage:function(e,t){t.lookupLocalStorage&&q7()&&window.localStorage.setItem(t.lookupLocalStorage,e)}},Z7=null,X7=function(){if(null!==Z7)return Z7;try{Z7="undefined"!==window&&null!==window.sessionStorage;var e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch(Dhe){Z7=!1}return Z7},$7={name:"sessionStorage",lookup:function(e){var t;if(e.lookupSessionStorage&&X7()){var n=window.sessionStorage.getItem(e.lookupSessionStorage);n&&(t=n)}return t},cacheUserLanguage:function(e,t){t.lookupSessionStorage&&X7()&&window.sessionStorage.setItem(t.lookupSessionStorage,e)}},K7={name:"navigator",lookup:function(e){var t=[];if("undefined"!=typeof navigator){if(navigator.languages)for(var n=0;n0?t:void 0}},Q7={name:"htmlTag",lookup:function(e){var t,n=e.htmlTag||("undefined"!=typeof document?document.documentElement:null);return n&&"function"==typeof n.getAttribute&&(t=n.getAttribute("lang")),t}},J7={name:"path",lookup:function(e){var t;if("undefined"!=typeof window){var n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(n instanceof Array)if("number"==typeof e.lookupFromPathIndex){if("string"!=typeof n[e.lookupFromPathIndex])return;t=n[e.lookupFromPathIndex].replace("/","")}else t=n[0].replace("/","")}return t}},e9={name:"subdomain",lookup:function(e){var t="number"==typeof e.lookupFromSubdomainIndex?e.lookupFromSubdomainIndex+1:1,n="undefined"!=typeof window&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(n)return n[t]}};var t9=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};M7(this,e),this.type="languageDetector",this.detectors={},this.init(t,n)}var t,n,r;return t=e,n=[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=j7(t,this.options||{},{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(W7),this.addDetector(U7),this.addDetector(Y7),this.addDetector($7),this.addDetector(K7),this.addDetector(Q7),this.addDetector(J7),this.addDetector(e9)}},{key:"addDetector",value:function(e){this.detectors[e.name]=e}},{key:"detect",value:function(e){var t=this;e||(e=this.options.order);var n=[];return e.forEach((function(e){if(t.detectors[e]){var r=t.detectors[e].lookup(t.options);r&&"string"==typeof r&&(r=[r]),r&&(n=n.concat(r))}})),this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}},{key:"cacheUserLanguage",value:function(e,t){var n=this;t||(t=this.options.caches),t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach((function(t){n.detectors[t]&&n.detectors[t].cacheUserLanguage(e,n.options)})))}}],n&&R7(t.prototype,n),r&&R7(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function n9(e){return n9="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n9(e)}t9.type="languageDetector";var r9=[],o9=r9.forEach,i9=r9.slice;function a9(e){return o9.call(i9.call(arguments,1),(function(t){if(t)for(var n in t)void 0===e[n]&&(e[n]=t[n])})),e}function s9(){return"function"==typeof XMLHttpRequest||"object"===("undefined"==typeof XMLHttpRequest?"undefined":n9(XMLHttpRequest))}function l9(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var u9,c9={},d9={get exports(){return c9},set exports(e){c9=e}},f9={},h9={get exports(){return f9},set exports(e){f9=e}};function p9(){return u9||(u9=1,function(e,t){var n="undefined"!=typeof self?self:ir,r=function(){function e(){this.fetch=!1,this.DOMException=n.DOMException}return e.prototype=n,new e}();!function(e){!function(t){var n="URLSearchParams"in e,r="Symbol"in e&&"iterator"in Symbol,o="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(Dhe){return!1}}(),i="FormData"in e,a="ArrayBuffer"in e;if(a)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(e){return e&&s.indexOf(Object.prototype.toString.call(e))>-1};function u(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function c(e){return"string"!=typeof e&&(e=String(e)),e}function d(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r&&(t[Symbol.iterator]=function(){return t}),t}function f(e){this.map={},e instanceof f?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function h(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function p(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function v(e){var t=new FileReader,n=p(t);return t.readAsArrayBuffer(e),n}function g(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(e){this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:o&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:i&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:n&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():a&&o&&function(e){return e&&DataView.prototype.isPrototypeOf(e)}(e)?(this._bodyArrayBuffer=g(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(e)||l(e))?this._bodyArrayBuffer=g(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o&&(this.blob=function(){var e=h(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?h(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(v)}),this.text=function(){var e=h(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=p(t);return t.readAsText(e),n}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}function w(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}})),t}function k(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new f(t.headers),this.url=t.url||"",this._initBody(e)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},m.call(b.prototype),m.call(k.prototype),k.prototype.clone=function(){return new k(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},k.error=function(){var e=new k(null,{status:0,statusText:""});return e.type="error",e};var x=[301,302,303,307,308];k.redirect=function(e,t){if(-1===x.indexOf(t))throw new RangeError("Invalid status code");return new k(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(COe){t.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function S(e,n){return new Promise((function(r,i){var a=new b(e,n);if(a.signal&&a.signal.aborted)return i(new t.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function l(){s.abort()}s.onload=function(){var e,t,n={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new f,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();t.append(r,o)}})),t)};n.url="responseURL"in s?s.responseURL:n.headers.get("X-Request-URL");var o="response"in s?s.response:s.responseText;r(new k(o,n))},s.onerror=function(){i(new TypeError("Network request failed"))},s.ontimeout=function(){i(new TypeError("Network request failed"))},s.onabort=function(){i(new t.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&o&&(s.responseType="blob"),a.headers.forEach((function(e,t){s.setRequestHeader(t,e)})),a.signal&&(a.signal.addEventListener("abort",l),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",l)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}S.polyfill=!0,e.fetch||(e.fetch=S,e.Headers=f,e.Request=b,e.Response=k),t.Headers=f,t.Request=b,t.Response=k,t.fetch=S,Object.defineProperty(t,"__esModule",{value:!0})}({})}(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var o=r;(t=o.fetch).default=o.fetch,t.fetch=o.fetch,t.Headers=o.Headers,t.Request=o.Request,t.Response=o.Response,e.exports=t}(h9,f9)),f9}!function(e,t){var n;if("function"==typeof fetch&&(n=void 0!==ir&&ir.fetch?ir.fetch:"undefined"!=typeof window&&window.fetch?window.fetch:fetch),void 0!==l9&&("undefined"==typeof window||void 0===window.document)){var r=n||p9();r.default&&(r=r.default),t.default=r,e.exports=t.default}}(d9,c9);var v9,g9,m9,y9=c9,b9=or({__proto__:null,default:y9},[c9]);function w9(e){return w9="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},w9(e)}"function"==typeof fetch&&(v9="undefined"!=typeof global&&global.fetch?global.fetch:"undefined"!=typeof window&&window.fetch?window.fetch:fetch),s9()&&("undefined"!=typeof global&&global.XMLHttpRequest?g9=global.XMLHttpRequest:"undefined"!=typeof window&&window.XMLHttpRequest&&(g9=window.XMLHttpRequest)),"function"==typeof ActiveXObject&&("undefined"!=typeof global&&global.ActiveXObject?m9=global.ActiveXObject:"undefined"!=typeof window&&window.ActiveXObject&&(m9=window.ActiveXObject)),v9||!b9||g9||m9||(v9=y9||b9),"function"!=typeof v9&&(v9=void 0);var k9=function(e,t){if(t&&"object"===w9(t)){var n="";for(var r in t)n+="&"+encodeURIComponent(r)+"="+encodeURIComponent(t[r]);if(!n)return e;e=e+(-1!==e.indexOf("?")?"&":"?")+n.slice(1)}return e},x9=function(e,t,n){v9(e,t).then((function(e){if(!e.ok)return n(e.statusText||"Error",{status:e.status});e.text().then((function(t){n(null,{status:e.status,data:t})})).catch(n)})).catch(n)},S9=!1,C9=function(e,t,n,r){return"function"==typeof n&&(r=n,n=void 0),r=r||function(){},v9&&0!==t.indexOf("file:")?function(e,t,n,r){e.queryStringParams&&(t=k9(t,e.queryStringParams));var o=a9({},"function"==typeof e.customHeaders?e.customHeaders():e.customHeaders);n&&(o["Content-Type"]="application/json");var i="function"==typeof e.requestOptions?e.requestOptions(n):e.requestOptions,a=a9({method:n?"POST":"GET",body:n?e.stringify(n):void 0,headers:o},S9?{}:i);try{x9(t,a,r)}catch(Dhe){if(!i||0===Object.keys(i).length||!Dhe.message||Dhe.message.indexOf("not implemented")<0)return r(Dhe);try{Object.keys(i).forEach((function(e){delete a[e]})),x9(t,a,r),S9=!0}catch(COe){r(COe)}}}(e,t,n,r):s9()||"function"==typeof ActiveXObject?function(e,t,n,r){n&&"object"===w9(n)&&(n=k9("",n).slice(1)),e.queryStringParams&&(t=k9(t,e.queryStringParams));try{var o;(o=g9?new g9:new m9("MSXML2.XMLHTTP.3.0")).open(n?"POST":"GET",t,1),e.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!e.withCredentials,n&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var i=e.customHeaders;if(i="function"==typeof i?i():i)for(var a in i)o.setRequestHeader(a,i[a]);o.onreadystatechange=function(){o.readyState>3&&r(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(n)}catch(Dhe){console&&console.log(Dhe)}}(e,t,n,r):void r(new Error("No fetch and no xhr implementation found!"))};function _9(e){return _9="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_9(e)}function E9(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function P9(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};E9(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}var t,n,r;return t=e,n=[{key:"init",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=a9(n,this.options||{},O9()),this.allOptions=r,this.services&&this.options.reloadInterval&&setInterval((function(){return t.reload()}),this.options.reloadInterval)}},{key:"readMulti",value:function(e,t,n){this._readAny(e,e,t,t,n)}},{key:"read",value:function(e,t,n){this._readAny([e],e,[t],t,n)}},{key:"_readAny",value:function(e,t,n,r,o){var i,a=this,s=this.options.loadPath;"function"==typeof this.options.loadPath&&(s=this.options.loadPath(e,n)),(s=function(e){return!!e&&"function"==typeof e.then}(i=s)?i:Promise.resolve(i)).then((function(i){if(!i)return o(null,{});var s=a.services.interpolator.interpolate(i,{lng:e.join("+"),ns:n.join("+")});a.loadUrl(s,o,t,r)}))}},{key:"loadUrl",value:function(e,t,n,r){var o=this;this.options.request(this.options,e,void 0,(function(i,a){if(a&&(a.status>=500&&a.status<600||!a.status))return t("failed loading "+e+"; status code: "+a.status,!0);if(a&&a.status>=400&&a.status<500)return t("failed loading "+e+"; status code: "+a.status,!1);if(!a&&i&&i.message&&i.message.indexOf("Failed to fetch")>-1)return t("failed loading "+e+": "+i.message,!0);if(i)return t(i,!1);var s,l;try{s="string"==typeof a.data?o.options.parse(a.data,n,r):a.data}catch(Dhe){l="failed parsing "+e+" to json"}if(l)return t(l,!1);t(null,s)}))}},{key:"create",value:function(e,t,n,r,o){var i=this;if(this.options.addPath){"string"==typeof e&&(e=[e]);var a=this.options.parsePayload(t,n,r),s=0,l=[],u=[];e.forEach((function(n){var r=i.options.addPath;"function"==typeof i.options.addPath&&(r=i.options.addPath(n,t));var c=i.services.interpolator.interpolate(r,{lng:n,ns:t});i.options.request(i.options,c,a,(function(t,n){s+=1,l.push(t),u.push(n),s===e.length&&o&&o(l,u)}))}))}}},{key:"reload",value:function(){var e=this,t=this.services,n=t.backendConnector,r=t.languageUtils,o=t.logger,i=n.language;if(!i||"cimode"!==i.toLowerCase()){var a=[],s=function(e){r.toResolveHierarchy(e).forEach((function(e){a.indexOf(e)<0&&a.push(e)}))};s(i),this.allOptions.preload&&this.allOptions.preload.forEach((function(e){return s(e)})),a.forEach((function(t){e.allOptions.ns.forEach((function(e){n.read(t,e,"read",null,null,(function(r,i){r&&o.warn("loading namespace ".concat(e," for language ").concat(t," failed"),r),!r&&i&&o.log("loaded namespace ".concat(e," for language ").concat(t),i),n.loaded("".concat(t,"|").concat(e),r,i)}))}))}))}}}],n&&P9(t.prototype,n),r&&P9(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function M9(e){return M9="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},M9(e)}function T9(e){var t=function(e,t){if("object"!==M9(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==M9(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===M9(t)?t:String(t)}function I9(e,t,n){return(t=T9(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function R9(){if(console&&console.warn){for(var e,t=arguments.length,n=new Array(t),r=0;r2&&void 0!==arguments[2]?arguments[2]:{},r=t.languages[0],o=!!t.options&&t.options.fallbackLng,i=t.languages[t.languages.length-1];if("cimode"===r.toLowerCase())return!0;var a=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};return!(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!a(t.isLanguageChangingTo,e))&&(!!t.hasResourceBundle(r,e)||(!(t.services.backendConnector.backend&&(!t.options.resources||t.options.partialBundledLanguages))||!(!a(r,e)||o&&!a(i,e))))}function B9(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t.languages||!t.languages.length)return D9("i18n.languages were undefined or empty",t.languages),!0;var r=void 0!==t.options.ignoreJSONStructure;return r?t.hasLoadedNamespace(e,{precheck:function(t,r){if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}}):j9(e,t,n)}var F9=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,H9={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},V9=function(e){return H9[e]};function W9(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function U9(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};q9=U9(U9({},q9),e)}(e.options.react),function(e){G9=e}(e)}},K9=cr.createContext(),Q9=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.usedNamespaces={}}var t,n,r;return t=e,(n=[{key:"addUsedNamespaces",value:function(e){var t=this;e.forEach((function(e){t.usedNamespaces[e]||(t.usedNamespaces[e]=!0)}))}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}])&&X9(t.prototype,n),r&&X9(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function J9(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},n=t.i18n,r=cr.useContext(K9)||{},o=r.i18n,i=r.defaultNS,a=n||o||Z9();if(a&&!a.reportNamespaces&&(a.reportNamespaces=new Q9),!a){D9("You will need to pass in an i18next instance by using initReactI18next");var s=function(e){return Array.isArray(e)?e[e.length-1]:e},l=[s,{},!1];return l.t=s,l.i18n={},l.ready=!1,l}a.options.react&&void 0!==a.options.react.wait&&D9("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var u=n8(n8(n8({},Y9()),a.options.react),t),c=u.useSuspense,d=u.keyPrefix,f=e||i||a.options&&a.options.defaultNS;f="string"==typeof f?[f]:f||["translation"],a.reportNamespaces.addUsedNamespaces&&a.reportNamespaces.addUsedNamespaces(f);var h=(a.isInitialized||a.initializedStoreOnce)&&f.every((function(e){return B9(e,a,u)}));function p(){return a.getFixedT(null,"fallback"===u.nsMode?f:f[0],d)}var v=cr.useState(p),g=e8(v,2),m=g[0],y=g[1],b=f.join(),w=r8(b),k=cr.useRef(!0);cr.useEffect((function(){var e=u.bindI18n,t=u.bindI18nStore;function n(){k.current&&y(p)}return k.current=!0,h||c||z9(a,f,(function(){k.current&&y(p)})),h&&w&&w!==b&&k.current&&y(p),e&&a&&a.on(e,n),t&&a&&a.store.on(t,n),function(){k.current=!1,e&&a&&e.split(" ").forEach((function(e){return a.off(e,n)})),t&&a&&t.split(" ").forEach((function(e){return a.store.off(e,n)}))}}),[a,b]);var x=cr.useRef(!0);cr.useEffect((function(){k.current&&!x.current&&y(p),x.current=!1}),[a,d]);var S=[m,a,h];if(S.t=m,S.i18n=a,S.ready=h,h)return S;if(!h&&!c)return S;throw new Promise((function(e){z9(a,f,(function(){e()}))}))}A7.use(A9).use(t9).use($9).init({fallbackLng:"en",debug:!1,ns:["common","gallery","hotkeys","parameters","settings","modelmanager","toast","tooltip","unifiedcanvas"],backend:{loadPath:"/locales/{{ns}}/{{lng}}.json"},interpolation:{escapeValue:!1},returnNull:!1});var i8=k$({name:"system",initialState:{isConnected:!1,isProcessing:!1,log:[],shouldShowLogViewer:!1,shouldDisplayInProgressType:"latents",shouldDisplayGuides:!0,isGFPGANAvailable:!0,isESRGANAvailable:!0,socketId:"",shouldConfirmOnDelete:!0,openAccordions:[],currentStep:0,totalSteps:0,currentIteration:0,totalIterations:0,currentStatus:A7.isInitialized?A7.t("common:statusDisconnected"):"Disconnected",currentStatusHasSteps:!1,model:"",model_id:"",model_hash:"",app_id:"",app_version:"",model_list:{},infill_methods:[],hasError:!1,wasErrorSeen:!0,isCancelable:!0,saveIntermediatesInterval:5,enableImageDebugging:!1,toastQueue:[],searchFolder:null,foundModels:null,openModel:null},reducers:{setShouldDisplayInProgressType:function(e,t){e.shouldDisplayInProgressType=t.payload},setIsProcessing:function(e,t){e.isProcessing=t.payload},setCurrentStatus:function(e,t){e.currentStatus=t.payload},setSystemStatus:function(e,t){return un(un({},e),t.payload)},errorOccurred:function(e){e.hasError=!0,e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus=A7.t("common:statusError"),e.wasErrorSeen=!1},errorSeen:function(e){e.hasError=!1,e.wasErrorSeen=!0,e.currentStatus=e.isConnected?A7.t("common:statusConnected"):A7.t("common:statusDisconnected")},addLogEntry:function(e,t){var n=t.payload,r={timestamp:n.timestamp,message:n.message,level:n.level||"info"};e.log.push(r)},setShouldShowLogViewer:function(e,t){e.shouldShowLogViewer=t.payload},setIsConnected:function(e,t){e.isConnected=t.payload,e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.hasError=!1},setSocketId:function(e,t){e.socketId=t.payload},setShouldConfirmOnDelete:function(e,t){e.shouldConfirmOnDelete=t.payload},setOpenAccordions:function(e,t){e.openAccordions=t.payload},setSystemConfig:function(e,t){return un(un({},e),t.payload)},setShouldDisplayGuides:function(e,t){e.shouldDisplayGuides=t.payload},processingCanceled:function(e){e.isProcessing=!1,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus=A7.t("common:statusProcessingCanceled")},generationRequested:function(e){e.isProcessing=!0,e.isCancelable=!0,e.currentStep=0,e.totalSteps=0,e.currentIteration=0,e.totalIterations=0,e.currentStatusHasSteps=!1,e.currentStatus=A7.t("common:statusPreparing")},setModelList:function(e,t){e.model_list=t.payload},setIsCancelable:function(e,t){e.isCancelable=t.payload},modelChangeRequested:function(e){e.currentStatus=A7.t("common:statusLoadingModel"),e.isCancelable=!1,e.isProcessing=!0,e.currentStatusHasSteps=!1},setSaveIntermediatesInterval:function(e,t){e.saveIntermediatesInterval=t.payload},setEnableImageDebugging:function(e,t){e.enableImageDebugging=t.payload},addToast:function(e,t){e.toastQueue.push(t.payload)},clearToastQueue:function(e){e.toastQueue=[]},setProcessingIndeterminateTask:function(e,t){e.isProcessing=!0,e.currentStatus=t.payload,e.currentStatusHasSteps=!1},setSearchFolder:function(e,t){e.searchFolder=t.payload},setFoundModels:function(e,t){e.foundModels=t.payload},setOpenModel:function(e,t){e.openModel=t.payload}}}),a8=i8.actions,s8=a8.setShouldDisplayInProgressType,l8=a8.setIsProcessing,u8=a8.addLogEntry,c8=a8.setShouldShowLogViewer,d8=a8.setIsConnected,f8=(a8.setSocketId,a8.setShouldConfirmOnDelete),h8=a8.setOpenAccordions,p8=a8.setSystemStatus,v8=a8.setCurrentStatus,g8=a8.setSystemConfig,m8=a8.setShouldDisplayGuides,y8=a8.processingCanceled,b8=a8.errorOccurred,w8=a8.errorSeen,k8=a8.setModelList,x8=a8.setIsCancelable,S8=a8.modelChangeRequested,C8=a8.setSaveIntermediatesInterval,_8=a8.setEnableImageDebugging,E8=a8.generationRequested,P8=a8.addToast,L8=a8.clearToastQueue,O8=a8.setProcessingIndeterminateTask,A8=a8.setSearchFolder,M8=a8.setFoundModels,T8=a8.setOpenModel,I8=i8.reducer,R8=["txt2img","img2img","unifiedCanvas","nodes","postprocess","training"],N8=k$({name:"ui",initialState:{activeTab:0,currentTheme:"dark",parametersPanelScrollPosition:0,shouldHoldParametersPanelOpen:!1,shouldPinParametersPanel:!0,shouldShowParametersPanel:!0,shouldShowDualDisplay:!0,shouldShowImageDetails:!1,shouldUseCanvasBetaLayout:!1,shouldShowExistingModelsInSearch:!1,addNewModelUIOption:null},reducers:{setActiveTab:function(e,t){"number"==typeof t.payload?e.activeTab=t.payload:e.activeTab=R8.indexOf(t.payload)},setCurrentTheme:function(e,t){e.currentTheme=t.payload},setParametersPanelScrollPosition:function(e,t){e.parametersPanelScrollPosition=t.payload},setShouldPinParametersPanel:function(e,t){e.shouldPinParametersPanel=t.payload},setShouldShowParametersPanel:function(e,t){e.shouldShowParametersPanel=t.payload},setShouldHoldParametersPanelOpen:function(e,t){e.shouldHoldParametersPanelOpen=t.payload},setShouldShowDualDisplay:function(e,t){e.shouldShowDualDisplay=t.payload},setShouldShowImageDetails:function(e,t){e.shouldShowImageDetails=t.payload},setShouldUseCanvasBetaLayout:function(e,t){e.shouldUseCanvasBetaLayout=t.payload},setShouldShowExistingModelsInSearch:function(e,t){e.shouldShowExistingModelsInSearch=t.payload},setAddNewModelUIOption:function(e,t){e.addNewModelUIOption=t.payload}}}),D8=N8.actions,z8=D8.setActiveTab,j8=D8.setCurrentTheme,B8=D8.setParametersPanelScrollPosition,F8=D8.setShouldHoldParametersPanelOpen,H8=D8.setShouldPinParametersPanel,V8=D8.setShouldShowParametersPanel,W8=D8.setShouldShowDualDisplay,U8=D8.setShouldShowImageDetails,G8=D8.setShouldUseCanvasBetaLayout,q8=D8.setShouldShowExistingModelsInSearch,Y8=D8.setAddNewModelUIOption,Z8=N8.reducer,X8=Object.create(null);X8.open="0",X8.close="1",X8.ping="2",X8.pong="3",X8.message="4",X8.upgrade="5",X8.noop="6";var $8=Object.create(null);Object.keys(X8).forEach((function(e){$8[X8[e]]=e}));for(var K8={type:"error",data:"parser error"},Q8="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),J8="function"==typeof ArrayBuffer,eee=function(e,t,n){var r=e.type,o=e.data;return Q8&&o instanceof Blob?t?n(o):tee(o,n):J8&&(o instanceof ArrayBuffer||function(e){return"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer}(o))?t?n(o):tee(new Blob([o]),n):n(X8[r]+(o||""))},tee=function(e,t){var n=new FileReader;return n.onload=function(){var e=n.result.split(",")[1];t("b"+e)},n.readAsDataURL(e)},nee="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ree="undefined"==typeof Uint8Array?[]:new Uint8Array(256),oee=0;oee1?{type:$8[n],data:e.substring(1)}:{type:$8[n]}:K8},see=function(e,t){if(iee){var n=function(e){var t,n,r,o,i,a=.75*e.length,s=e.length,l=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);var u=new ArrayBuffer(a),c=new Uint8Array(u);for(t=0;t>4,c[l++]=(15&r)<<4|o>>2,c[l++]=(3&o)<<6|63&i;return u}(e);return lee(n,t)}return{base64:!0,data:e}},lee=function(e,t){return"blob"===t&&e instanceof ArrayBuffer?new Blob([e]):e},uee=String.fromCharCode(30);function cee(e){if(e)return function(e){for(var t in cee.prototype)e[t]=cee.prototype[t];return e}(e)}cee.prototype.on=cee.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},cee.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},cee.prototype.off=cee.prototype.removeListener=cee.prototype.removeAllListeners=cee.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o1?t-1:0),r=1;r=57344?n+=3:(r++,n+=4);return n}(e):Math.ceil(1.33*(e.byteLength||e.size))}var mee,yee=function(e){pn(n,e);var t=Qt(n);function n(e,r,o){var i;return an(this,n),(i=t.call(this,e)).description=r,i.context=o,i.type="TransportError",i}return on(n)}(Xt(Error)),bee=function(e){pn(n,e);var t=Qt(n);function n(e){var r;return an(this,n),(r=t.call(this)).writable=!1,vee(en(r),e),r.opts=e,r.query=e.query,r.readyState="",r.socket=e.socket,r}return on(n,[{key:"onError",value:function(e,t,r){return Yt(nn(n.prototype),"emitReserved",this).call(this,"error",new yee(e,t,r)),this}},{key:"open",value:function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this}},{key:"close",value:function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}},{key:"send",value:function(e){"open"===this.readyState&&this.write(e)}},{key:"onOpen",value:function(){this.readyState="open",this.writable=!0,Yt(nn(n.prototype),"emitReserved",this).call(this,"open")}},{key:"onData",value:function(e){var t=aee(e,this.socket.binaryType);this.onPacket(t)}},{key:"onPacket",value:function(e){Yt(nn(n.prototype),"emitReserved",this).call(this,"packet",e)}},{key:"onClose",value:function(e){this.readyState="closed",Yt(nn(n.prototype),"emitReserved",this).call(this,"close",e)}}]),n}(cee),wee="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),kee={},xee=0,See=0;function Cee(e){var t="";do{t=wee[e%64]+t,e=Math.floor(e/64)}while(e>0);return t}function _ee(){var e=Cee(+new Date);return e!==mee?(xee=0,mee=e):e+"."+Cee(xee++)}for(;See<64;See++)kee[wee[See]]=See;function Eee(e){var t="";for(var n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function Pee(e){for(var t={},n=e.split("&"),r=0,o=n.length;r0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign(e,{xd:this.xd,xs:this.xs},this.opts),new Ree(this.uri(),e)}},{key:"doWrite",value:function(e,t){var n=this,r=this.request({method:"POST",data:e});r.on("success",t),r.on("error",(function(e,t){n.onError("xhr post error",e,t)}))}},{key:"doPoll",value:function(){var e=this,t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(function(t,n){e.onError("xhr poll error",t,n)})),this.pollXhr=t}}]),n}(bee),Ree=function(e){pn(n,e);var t=Qt(n);function n(e,r){var o;return an(this,n),vee(en(o=t.call(this)),r),o.opts=r,o.method=r.method||"GET",o.uri=e,o.async=!1!==r.async,o.data=void 0!==r.data?r.data:null,o.create(),o}return on(n,[{key:"create",value:function(){var e=this,t=fee(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd,t.xscheme=!!this.opts.xs;var r=this.xhr=new Aee(t);try{r.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders)for(var o in r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0),this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(o)&&r.setRequestHeader(o,this.opts.extraHeaders[o])}catch(Dhe){}if("POST"===this.method)try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(Dhe){}try{r.setRequestHeader("Accept","*/*")}catch(Dhe){}"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=function(){4===r.readyState&&(200===r.status||1223===r.status?e.onLoad():e.setTimeoutFn((function(){e.onError("number"==typeof r.status?r.status:0)}),0))},r.send(this.data)}catch(Dhe){return void this.setTimeoutFn((function(){e.onError(Dhe)}),0)}"undefined"!=typeof document&&(this.index=n.requestsCount++,n.requests[this.index]=this)}},{key:"onError",value:function(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}},{key:"cleanup",value:function(e){if(void 0!==this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=Mee,e)try{this.xhr.abort()}catch(Dhe){}"undefined"!=typeof document&&delete n.requests[this.index],this.xhr=null}}},{key:"onLoad",value:function(){var e=this.xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}},{key:"abort",value:function(){this.cleanup()}}]),n}(cee);if(Ree.requestsCount=0,Ree.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",Nee);else if("function"==typeof addEventListener){addEventListener("onpagehide"in dee?"pagehide":"unload",Nee,!1)}function Nee(){for(var e in Ree.requests)Ree.requests.hasOwnProperty(e)&&Ree.requests[e].abort()}var Dee="function"==typeof Promise&&"function"==typeof Promise.resolve?function(e){return Promise.resolve().then(e)}:function(e,t){return t(e,0)},zee=dee.WebSocket||dee.MozWebSocket,jee="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase(),Bee=function(e){pn(n,e);var t=Qt(n);function n(e){var r;return an(this,n),(r=t.call(this,e)).supportsBinary=!e.forceBase64,r}return on(n,[{key:"name",get:function(){return"websocket"}},{key:"doOpen",value:function(){if(this.check()){var e=this.uri(),t=this.opts.protocols,n=jee?{}:fee(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=jee?new zee(e,t,n):t?new zee(e,t):new zee(e)}catch(COe){return this.emitReserved("error",COe)}this.ws.binaryType=this.socket.binaryType||"arraybuffer",this.addEventListeners()}}},{key:"addEventListeners",value:function(){var e=this;this.ws.onopen=function(){e.opts.autoUnref&&e.ws._socket.unref(),e.onOpen()},this.ws.onclose=function(t){return e.onClose({description:"websocket connection closed",context:t})},this.ws.onmessage=function(t){return e.onData(t.data)},this.ws.onerror=function(t){return e.onError("websocket error",t)}}},{key:"write",value:function(e){var t=this;this.writable=!1;for(var n=function(){var n=e[r],o=r===e.length-1;eee(n,t.supportsBinary,(function(e){try{t.ws.send(e)}catch(Dhe){}o&&Dee((function(){t.writable=!0,t.emitReserved("drain")}),t.setTimeoutFn)}))},r=0;r1&&void 0!==arguments[1]?arguments[1]:{};return an(this,n),r=t.call(this),e&&"object"===kn(e)&&(o=e,e=null),e?(e=Wee(e),o.hostname=e.host,o.secure="https"===e.protocol||"wss"===e.protocol,o.port=e.port,e.query&&(o.query=e.query)):o.host&&(o.hostname=Wee(o.host).host),vee(en(r),o),r.secure=null!=o.secure?o.secure:"undefined"!=typeof location&&"https:"===location.protocol,o.hostname&&!o.port&&(o.port=r.secure?"443":"80"),r.hostname=o.hostname||("undefined"!=typeof location?location.hostname:"localhost"),r.port=o.port||("undefined"!=typeof location&&location.port?location.port:r.secure?"443":"80"),r.transports=o.transports||["polling","websocket"],r.readyState="",r.writeBuffer=[],r.prevBufferLen=0,r.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},o),r.opts.path=r.opts.path.replace(/\/$/,"")+"/","string"==typeof r.opts.query&&(r.opts.query=Pee(r.opts.query)),r.id=null,r.upgrades=null,r.pingInterval=null,r.pingTimeout=null,r.pingTimeoutTimer=null,"function"==typeof addEventListener&&(r.opts.closeOnBeforeunload&&(r.beforeunloadEventListener=function(){r.transport&&(r.transport.removeAllListeners(),r.transport.close())},addEventListener("beforeunload",r.beforeunloadEventListener,!1)),"localhost"!==r.hostname&&(r.offlineEventListener=function(){r.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",r.offlineEventListener,!1))),r.open(),r}return on(n,[{key:"createTransport",value:function(e){var t=Object.assign({},this.opts.query);t.EIO=4,t.transport=e,this.id&&(t.sid=this.id);var n=Object.assign({},this.opts.transportOptions[e],this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new Fee[e](n)}},{key:"open",value:function(){var e,t=this;if(this.opts.rememberUpgrade&&n.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length)return void this.setTimeoutFn((function(){t.emitReserved("error","No transports available")}),0);e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(Dhe){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)}},{key:"setTransport",value:function(e){var t=this;this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",(function(e){return t.onClose("transport close",e)}))}},{key:"probe",value:function(e){var t=this,r=this.createTransport(e),o=!1;n.priorWebsocketSuccess=!1;var i=function(){o||(r.send([{type:"ping",data:"probe"}]),r.once("packet",(function(e){if(!o)if("pong"===e.type&&"probe"===e.data){if(t.upgrading=!0,t.emitReserved("upgrading",r),!r)return;n.priorWebsocketSuccess="websocket"===r.name,t.transport.pause((function(){o||"closed"!==t.readyState&&(d(),t.setTransport(r),r.send([{type:"upgrade"}]),t.emitReserved("upgrade",r),r=null,t.upgrading=!1,t.flush())}))}else{var i=new Error("probe error");i.transport=r.name,t.emitReserved("upgradeError",i)}})))};function a(){o||(o=!0,d(),r.close(),r=null)}var s=function(e){var n=new Error("probe error: "+e);n.transport=r.name,a(),t.emitReserved("upgradeError",n)};function l(){s("transport closed")}function u(){s("socket closed")}function c(e){r&&e.name!==r.name&&a()}var d=function(){r.removeListener("open",i),r.removeListener("error",s),r.removeListener("close",l),t.off("close",u),t.off("upgrading",c)};r.once("open",i),r.once("error",s),r.once("close",l),this.once("close",u),this.once("upgrading",c),r.open()}},{key:"onOpen",value:function(){if(this.readyState="open",n.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade&&this.transport.pause)for(var e=0,t=this.upgrades.length;e1))return this.writeBuffer;for(var e=1,t=0;t0&&e>this.maxPayload)return this.writeBuffer.slice(0,t);e+=2}return this.writeBuffer}},{key:"write",value:function(e,t,n){return this.sendPacket("message",e,t,n),this}},{key:"send",value:function(e,t,n){return this.sendPacket("message",e,t,n),this}},{key:"sendPacket",value:function(e,t,n,r){if("function"==typeof t&&(r=t,t=void 0),"function"==typeof n&&(r=n,n=null),"closing"!==this.readyState&&"closed"!==this.readyState){(n=n||{}).compress=!1!==n.compress;var o={type:e,data:t,options:n};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),r&&this.once("flush",r),this.flush()}}},{key:"close",value:function(){var e=this,t=function(){e.onClose("forced close"),e.transport.close()},n=function n(){e.off("upgrade",n),e.off("upgradeError",n),t()},r=function(){e.once("upgrade",n),e.once("upgradeError",n)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(function(){e.upgrading?r():t()})):this.upgrading?r():t()),this}},{key:"onError",value:function(e){n.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}},{key:"onClose",value:function(e,t){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"==typeof removeEventListener&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)}},{key:"filterUpgrades",value:function(e){for(var t=[],n=0,r=e.length;n=0&&e.num0;case tte.ACK:case tte.BINARY_ACK:return Array.isArray(t)}}}]),n}(cee),ote=function(){function e(t){an(this,e),this.packet=t,this.buffers=[],this.reconPack=t}return on(e,[{key:"takeBinaryData",value:function(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){var t=Jee(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}},{key:"finishedReconstruction",value:function(){this.reconPack=null,this.buffers=[]}}]),e}(),ite=Object.freeze(Object.defineProperty({__proto__:null,Decoder:rte,Encoder:nte,get PacketType(){return tte},protocol:5},Symbol.toStringTag,{value:"Module"}));function ate(e,t,n){return e.on(t,n),function(){e.off(t,n)}}var ste=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),lte=function(e){pn(n,e);var t=Qt(n);function n(e,r,o){var i;return an(this,n),(i=t.call(this)).connected=!1,i.receiveBuffer=[],i.sendBuffer=[],i.ids=0,i.acks={},i.flags={},i.io=e,i.nsp=r,o&&o.auth&&(i.auth=o.auth),i.io._autoConnect&&i.open(),i}return on(n,[{key:"disconnected",get:function(){return!this.connected}},{key:"subEvents",value:function(){if(!this.subs){var e=this.io;this.subs=[ate(e,"open",this.onopen.bind(this)),ate(e,"packet",this.onpacket.bind(this)),ate(e,"error",this.onerror.bind(this)),ate(e,"close",this.onclose.bind(this))]}}},{key:"active",get:function(){return!!this.subs}},{key:"connect",value:function(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}},{key:"open",value:function(){return this.connect()}},{key:"send",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n1?t-1:0),r=1;r0&&e.jitter<=1?e.jitter:0,this.attempts=0}ute.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=0==(1&Math.floor(10*t))?e-n:e+n}return 0|Math.min(e,this.max)},ute.prototype.reset=function(){this.attempts=0},ute.prototype.setMin=function(e){this.ms=e},ute.prototype.setMax=function(e){this.max=e},ute.prototype.setJitter=function(e){this.jitter=e};var cte=function(e){pn(n,e);var t=Qt(n);function n(e,r){var o,i;an(this,n),(o=t.call(this)).nsps={},o.subs=[],e&&"object"===kn(e)&&(r=e,e=void 0),(r=r||{}).path=r.path||"/socket.io",o.opts=r,vee(en(o),r),o.reconnection(!1!==r.reconnection),o.reconnectionAttempts(r.reconnectionAttempts||1/0),o.reconnectionDelay(r.reconnectionDelay||1e3),o.reconnectionDelayMax(r.reconnectionDelayMax||5e3),o.randomizationFactor(null!==(i=r.randomizationFactor)&&void 0!==i?i:.5),o.backoff=new ute({min:o.reconnectionDelay(),max:o.reconnectionDelayMax(),jitter:o.randomizationFactor()}),o.timeout(null==r.timeout?2e4:r.timeout),o._readyState="closed",o.uri=e;var a=r.parser||ite;return o.encoder=new a.Encoder,o.decoder=new a.Decoder,o._autoConnect=!1!==r.autoConnect,o._autoConnect&&o.open(),o}return on(n,[{key:"reconnection",value:function(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}},{key:"reconnectionAttempts",value:function(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}},{key:"reconnectionDelay",value:function(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null===(t=this.backoff)||void 0===t||t.setMin(e),this)}},{key:"randomizationFactor",value:function(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null===(t=this.backoff)||void 0===t||t.setJitter(e),this)}},{key:"reconnectionDelayMax",value:function(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null===(t=this.backoff)||void 0===t||t.setMax(e),this)}},{key:"timeout",value:function(e){return arguments.length?(this._timeout=e,this):this._timeout}},{key:"maybeReconnectOnOpen",value:function(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}},{key:"open",value:function(e){var t=this;if(~this._readyState.indexOf("open"))return this;this.engine=new Uee(this.uri,this.opts);var n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;var o=ate(n,"open",(function(){r.onopen(),e&&e()})),i=ate(n,"error",(function(n){r.cleanup(),r._readyState="closed",t.emitReserved("error",n),e?e(n):r.maybeReconnectOnOpen()}));if(!1!==this._timeout){var a=this._timeout;0===a&&o();var s=this.setTimeoutFn((function(){o(),n.close(),n.emit("error",new Error("timeout"))}),a);this.opts.autoUnref&&s.unref(),this.subs.push((function(){clearTimeout(s)}))}return this.subs.push(o),this.subs.push(i),this}},{key:"connect",value:function(e){return this.open(e)}},{key:"onopen",value:function(){this.cleanup(),this._readyState="open",this.emitReserved("open");var e=this.engine;this.subs.push(ate(e,"ping",this.onping.bind(this)),ate(e,"data",this.ondata.bind(this)),ate(e,"error",this.onerror.bind(this)),ate(e,"close",this.onclose.bind(this)),ate(this.decoder,"decoded",this.ondecoded.bind(this)))}},{key:"onping",value:function(){this.emitReserved("ping")}},{key:"ondata",value:function(e){try{this.decoder.add(e)}catch(Dhe){this.onclose("parse error",Dhe)}}},{key:"ondecoded",value:function(e){var t=this;Dee((function(){t.emitReserved("packet",e)}),this.setTimeoutFn)}},{key:"onerror",value:function(e){this.emitReserved("error",e)}},{key:"socket",value:function(e,t){var n=this.nsps[e];return n||(n=new lte(this,e,t),this.nsps[e]=n),n}},{key:"_destroy",value:function(e){for(var t=0,n=Object.keys(this.nsps);t=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{var n=this.backoff.duration();this._reconnecting=!0;var r=this.setTimeoutFn((function(){t.skipReconnect||(e.emitReserved("reconnect_attempt",t.backoff.attempts),t.skipReconnect||t.open((function(n){n?(t._reconnecting=!1,t.reconnect(),e.emitReserved("reconnect_error",n)):t.onreconnect()})))}),n);this.opts.autoUnref&&r.unref(),this.subs.push((function(){clearTimeout(r)}))}}},{key:"onreconnect",value:function(){var e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}]),n}(cee),dte={};function fte(e,t){"object"===kn(e)&&(t=e,e=void 0);var n,r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,r=e;n=n||"undefined"!=typeof location&&location,null==e&&(e=n.protocol+"//"+n.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?n.protocol+e:n.host+e),/^(https?|wss?):\/\//.test(e)||(e=void 0!==n?n.protocol+"//"+e:"https://"+e),r=Wee(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";var o=-1!==r.host.indexOf(":"),i=o?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+i+":"+r.port+t,r.href=r.protocol+"://"+i+(n&&n.port===r.port?"":":"+r.port),r}(e,(t=t||{}).path||"/socket.io"),o=r.source,i=r.id,a=r.path,s=dte[i]&&a in dte[i].nsps;return t.forceNew||t["force new connection"]||!1===t.multiplex||s?n=new cte(o,t):(dte[i]||(dte[i]=new cte(o,t)),n=dte[i]),r.query&&!t.query&&(t.query=r.queryKey),n.socket(r.path,t)}Object.assign(fte,{Manager:cte,Socket:lte,io:fte,connect:fte});var hte=["ddim","plms","k_lms","k_dpm_2","k_dpm_2_a","k_dpmpp_2","k_dpmpp_2_a","k_euler","k_euler_a","k_heun"],pte=["ddim","plms","k_lms","dpmpp_2","k_dpm_2","k_dpm_2_a","k_dpmpp_2","k_euler","k_euler_a","k_heun"],vte=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024,1088,1152,1216,1280,1344,1408,1472,1536,1600,1664,1728,1792,1856,1920,1984,2048],gte=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024,1088,1152,1216,1280,1344,1408,1472,1536,1600,1664,1728,1792,1856,1920,1984,2048],mte=[{key:"2x",value:2},{key:"4x",value:4}],yte=4294967295,bte=["gfpgan","codeformer"],wte=[{key:"None",value:"none"},{key:"Fast",value:"latents"},{key:"Accurate",value:"full-res"}],kte=Math.PI/180;var xte="undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope?self:{},Ste={_global:xte,version:"8.3.14",isBrowser:"undefined"!=typeof window&&("[object Window]"==={}.toString.call(window)||"[object global]"==={}.toString.call(window)),isUnminified:/param/.test(function(e){}.toString()),dblClickWindow:400,getAngle:function(e){return Ste.angleDeg?e*kte:e},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,pixelRatio:"undefined"!=typeof window&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging:function(){return Ste.DD.isDragging},isDragReady:function(){return!!Ste.DD.node},releaseCanvasOnDestroy:!0,document:xte.document,_injectGlobal:function(e){xte.Konva=e}},Cte=function(e){Ste[e.prototype.getClassName()]=e};Ste._injectGlobal(Ste);var _te=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[1,0,0,1,0,0];an(this,e),this.dirty=!1,this.m=t&&t.slice()||[1,0,0,1,0,0]}return on(e,[{key:"reset",value:function(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}},{key:"copy",value:function(){return new e(this.m)}},{key:"copyInto",value:function(e){e.m[0]=this.m[0],e.m[1]=this.m[1],e.m[2]=this.m[2],e.m[3]=this.m[3],e.m[4]=this.m[4],e.m[5]=this.m[5]}},{key:"point",value:function(e){var t=this.m;return{x:t[0]*e.x+t[2]*e.y+t[4],y:t[1]*e.x+t[3]*e.y+t[5]}}},{key:"translate",value:function(e,t){return this.m[4]+=this.m[0]*e+this.m[2]*t,this.m[5]+=this.m[1]*e+this.m[3]*t,this}},{key:"scale",value:function(e,t){return this.m[0]*=e,this.m[1]*=e,this.m[2]*=t,this.m[3]*=t,this}},{key:"rotate",value:function(e){var t=Math.cos(e),n=Math.sin(e),r=this.m[0]*t+this.m[2]*n,o=this.m[1]*t+this.m[3]*n,i=this.m[0]*-n+this.m[2]*t,a=this.m[1]*-n+this.m[3]*t;return this.m[0]=r,this.m[1]=o,this.m[2]=i,this.m[3]=a,this}},{key:"getTranslation",value:function(){return{x:this.m[4],y:this.m[5]}}},{key:"skew",value:function(e,t){var n=this.m[0]+this.m[2]*t,r=this.m[1]+this.m[3]*t,o=this.m[2]+this.m[0]*e,i=this.m[3]+this.m[1]*e;return this.m[0]=n,this.m[1]=r,this.m[2]=o,this.m[3]=i,this}},{key:"multiply",value:function(e){var t=this.m[0]*e.m[0]+this.m[2]*e.m[1],n=this.m[1]*e.m[0]+this.m[3]*e.m[1],r=this.m[0]*e.m[2]+this.m[2]*e.m[3],o=this.m[1]*e.m[2]+this.m[3]*e.m[3],i=this.m[0]*e.m[4]+this.m[2]*e.m[5]+this.m[4],a=this.m[1]*e.m[4]+this.m[3]*e.m[5]+this.m[5];return this.m[0]=t,this.m[1]=n,this.m[2]=r,this.m[3]=o,this.m[4]=i,this.m[5]=a,this}},{key:"invert",value:function(){var e=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),t=this.m[3]*e,n=-this.m[1]*e,r=-this.m[2]*e,o=this.m[0]*e,i=e*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),a=e*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=t,this.m[1]=n,this.m[2]=r,this.m[3]=o,this.m[4]=i,this.m[5]=a,this}},{key:"getMatrix",value:function(){return this.m}},{key:"decompose",value:function(){var e=this.m[0],t=this.m[1],n=this.m[2],r=this.m[3],o=e*r-t*n,i={x:this.m[4],y:this.m[5],rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!=e||0!=t){var a=Math.sqrt(e*e+t*t);i.rotation=t>0?Math.acos(e/a):-Math.acos(e/a),i.scaleX=a,i.scaleY=o/a,i.skewX=(e*n+t*r)/o,i.skewY=0}else if(0!=n||0!=r){var s=Math.sqrt(n*n+r*r);i.rotation=Math.PI/2-(r>0?Math.acos(-n/s):-Math.acos(n/s)),i.scaleX=o/s,i.scaleY=s,i.skewX=0,i.skewY=(e*n+t*r)/o}return i.rotation=Ite._getRotation(i.rotation),i}}]),e}(),Ete=Math.PI/180,Pte=180/Math.PI,Lte="Konva error: ",Ote={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},Ate=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,Mte=[],Tte="undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||function(e){setTimeout(e,60)},Ite={_isElement:function(e){return!(!e||1!=e.nodeType)},_isFunction:function(e){return!!(e&&e.constructor&&e.call&&e.apply)},_isPlainObject:function(e){return!!e&&e.constructor===Object},_isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},_isNumber:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&!isNaN(e)&&isFinite(e)},_isString:function(e){return"[object String]"===Object.prototype.toString.call(e)},_isBoolean:function(e){return"[object Boolean]"===Object.prototype.toString.call(e)},isObject:function(e){return e instanceof Object},isValidSelector:function(e){if("string"!=typeof e)return!1;var t=e[0];return"#"===t||"."===t||t===t.toUpperCase()},_sign:function(e){return 0===e||e>0?1:-1},requestAnimFrame:function(e){Mte.push(e),1===Mte.length&&Tte((function(){var e=Mte;Mte=[],e.forEach((function(e){e()}))}))},createCanvasElement:function(){var e=document.createElement("canvas");try{e.style=e.style||{}}catch(Dhe){}return e},createImageElement:function(){return document.createElement("img")},_isInDocument:function(e){for(;e=e.parentNode;)if(e==document)return!0;return!1},_urlToImage:function(e,t){var n=Ite.createImageElement();n.onload=function(){t(n)},n.src=e},_rgbToHex:function(e,t,n){return((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1)},_hexToRgb:function(e){e=e.replace("#","");var t=parseInt(e,16);return{r:t>>16&255,g:t>>8&255,b:255&t}},getRandomColor:function(){for(var e=(16777215*Math.random()<<0).toString(16);e.length<6;)e="0"+e;return"#"+e},getRGB:function(e){var t;return e in Ote?{r:(t=Ote[e])[0],g:t[1],b:t[2]}:"#"===e[0]?this._hexToRgb(e.substring(1)):"rgb("===e.substr(0,4)?(t=Ate.exec(e.replace(/ /g,"")),{r:parseInt(t[1],10),g:parseInt(t[2],10),b:parseInt(t[3],10)}):{r:0,g:0,b:0}},colorToRGBA:function(e){return e=e||"black",Ite._namedColorToRBA(e)||Ite._hex3ColorToRGBA(e)||Ite._hex6ColorToRGBA(e)||Ite._rgbColorToRGBA(e)||Ite._rgbaColorToRGBA(e)||Ite._hslColorToRGBA(e)},_namedColorToRBA:function(e){var t=Ote[e.toLowerCase()];return t?{r:t[0],g:t[1],b:t[2],a:1}:null},_rgbColorToRGBA:function(e){if(0===e.indexOf("rgb(")){var t=(e=e.match(/rgb\(([^)]+)\)/)[1]).split(/ *, */).map(Number);return{r:t[0],g:t[1],b:t[2],a:1}}},_rgbaColorToRGBA:function(e){if(0===e.indexOf("rgba(")){var t=(e=e.match(/rgba\(([^)]+)\)/)[1]).split(/ *, */).map((function(e,t){return"%"===e.slice(-1)?3===t?parseInt(e)/100:parseInt(e)/100*255:Number(e)}));return{r:t[0],g:t[1],b:t[2],a:t[3]}}},_hex6ColorToRGBA:function(e){if("#"===e[0]&&7===e.length)return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:1}},_hex3ColorToRGBA:function(e){if("#"===e[0]&&4===e.length)return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:1}},_hslColorToRGBA:function(e){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(e)){var t,n,r,o=dn(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(e)),i=(o[0],o.slice(1)),a=Number(i[0])/360,s=Number(i[1])/100,l=Number(i[2])/100;if(0===s)return r=255*l,{r:Math.round(r),g:Math.round(r),b:Math.round(r),a:1};for(var u=2*l-(t=l<.5?l*(1+s):l+s-l*s),c=[0,0,0],d=0;d<3;d++)(n=a+1/3*-(d-1))<0&&n++,n>1&&n--,r=6*n<1?u+6*(t-u)*n:2*n<1?t:3*n<2?u+(t-u)*(2/3-n)*6:u,c[d]=255*r;return{r:Math.round(c[0]),g:Math.round(c[1]),b:Math.round(c[2]),a:1}}},haveIntersection:function(e,t){return!(t.x>e.x+e.width||t.x+t.widthe.y+e.height||t.y+t.height1?(a=n,s=r,l=(n-o)*(n-o)+(r-i)*(r-i)):l=((a=e+c*(n-e))-o)*(a-o)+((s=t+c*(r-t))-i)*(s-i)}return[a,s,l]},_getProjectionToLine:function(e,t,n){var r=Ite.cloneObject(e),o=Number.MAX_VALUE;return t.forEach((function(i,a){if(n||a!==t.length-1){var s=t[(a+1)%t.length],l=Ite._getProjectionToSegment(i.x,i.y,s.x,s.y,e.x,e.y),u=l[0],c=l[1],d=l[2];dt.length){var a=t;t=e,e=a}for(r=0;r255?255:e<0?0:Math.round(e)}function Dte(){if(Ste.isUnminified)return function(e,t){return Ite._isNumber(e)||Ite.warn(Rte(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}function zte(e){if(Ste.isUnminified)return function(t,n){var r=Ite._isNumber(t),o=Ite._isArray(t)&&t.length==e;return r||o||Ite.warn(Rte(t)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array('+e+")"),t}}function jte(){if(Ste.isUnminified)return function(e,t){return Ite._isNumber(e)||"auto"===e||Ite.warn(Rte(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}function Bte(){if(Ste.isUnminified)return function(e,t){return Ite._isString(e)||Ite.warn(Rte(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}function Fte(){if(Ste.isUnminified)return function(e,t){var n=Ite._isString(e),r="[object CanvasGradient]"===Object.prototype.toString.call(e)||e&&e.addColorStop;return n||r||Ite.warn(Rte(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}function Hte(){if(Ste.isUnminified)return function(e,t){return!0===e||!1===e||Ite.warn(Rte(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}var Vte="get",Wte="set",Ute={addGetterSetter:function(e,t,n,r,o){Ute.addGetter(e,t,n),Ute.addSetter(e,t,r,o),Ute.addOverloadedGetterSetter(e,t)},addGetter:function(e,t,n){var r=Vte+Ite._capitalize(t);e.prototype[r]=e.prototype[r]||function(){var e=this.attrs[t];return void 0===e?n:e}},addSetter:function(e,t,n,r){var o=Wte+Ite._capitalize(t);e.prototype[o]||Ute.overWriteSetter(e,t,n,r)},overWriteSetter:function(e,t,n,r){var o=Wte+Ite._capitalize(t);e.prototype[o]=function(e){return n&&null!=e&&(e=n.call(this,e,t)),this._setAttr(t,e),r&&r.call(this),this}},addComponentsGetterSetter:function(e,t,n,r,o){var i,a,s=n.length,l=Ite._capitalize,u=Vte+l(t),c=Wte+l(t);e.prototype[u]=function(){var e={};for(i=0;i=100&&t.shift()}},{key:"reset",value:function(){var e=this.getCanvas().getPixelRatio();this.setTransform(1*e,0,0,1*e,0,0)}},{key:"getCanvas",value:function(){return this.canvas}},{key:"clear",value:function(e){var t=this.getCanvas();e?this.clearRect(e.x||0,e.y||0,e.width||0,e.height||0):this.clearRect(0,0,t.getWidth()/t.pixelRatio,t.getHeight()/t.pixelRatio)}},{key:"_applyLineCap",value:function(e){var t=e.getLineCap();t&&this.setAttr("lineCap",t)}},{key:"_applyOpacity",value:function(e){var t=e.getAbsoluteOpacity();1!==t&&this.setAttr("globalAlpha",t)}},{key:"_applyLineJoin",value:function(e){var t=e.attrs.lineJoin;t&&this.setAttr("lineJoin",t)}},{key:"setAttr",value:function(e,t){this._context[e]=t}},{key:"arc",value:function(e,t,n,r,o,i){this._context.arc(e,t,n,r,o,i)}},{key:"arcTo",value:function(e,t,n,r,o){this._context.arcTo(e,t,n,r,o)}},{key:"beginPath",value:function(){this._context.beginPath()}},{key:"bezierCurveTo",value:function(e,t,n,r,o,i){this._context.bezierCurveTo(e,t,n,r,o,i)}},{key:"clearRect",value:function(e,t,n,r){this._context.clearRect(e,t,n,r)}},{key:"clip",value:function(){this._context.clip()}},{key:"closePath",value:function(){this._context.closePath()}},{key:"createImageData",value:function(e,t){var n=arguments;return 2===n.length?this._context.createImageData(e,t):1===n.length?this._context.createImageData(e):void 0}},{key:"createLinearGradient",value:function(e,t,n,r){return this._context.createLinearGradient(e,t,n,r)}},{key:"createPattern",value:function(e,t){return this._context.createPattern(e,t)}},{key:"createRadialGradient",value:function(e,t,n,r,o,i){return this._context.createRadialGradient(e,t,n,r,o,i)}},{key:"drawImage",value:function(e,t,n,r,o,i,a,s,l){var u=arguments,c=this._context;3===u.length?c.drawImage(e,t,n):5===u.length?c.drawImage(e,t,n,r,o):9===u.length&&c.drawImage(e,t,n,r,o,i,a,s,l)}},{key:"ellipse",value:function(e,t,n,r,o,i,a,s){this._context.ellipse(e,t,n,r,o,i,a,s)}},{key:"isPointInPath",value:function(e,t){return this._context.isPointInPath(e,t)}},{key:"fill",value:function(e){e?this._context.fill(e):this._context.fill()}},{key:"fillRect",value:function(e,t,n,r){this._context.fillRect(e,t,n,r)}},{key:"strokeRect",value:function(e,t,n,r){this._context.strokeRect(e,t,n,r)}},{key:"fillText",value:function(e,t,n,r){r?this._context.fillText(e,t,n,r):this._context.fillText(e,t,n)}},{key:"measureText",value:function(e){return this._context.measureText(e)}},{key:"getImageData",value:function(e,t,n,r){return this._context.getImageData(e,t,n,r)}},{key:"lineTo",value:function(e,t){this._context.lineTo(e,t)}},{key:"moveTo",value:function(e,t){this._context.moveTo(e,t)}},{key:"rect",value:function(e,t,n,r){this._context.rect(e,t,n,r)}},{key:"putImageData",value:function(e,t,n){this._context.putImageData(e,t,n)}},{key:"quadraticCurveTo",value:function(e,t,n,r){this._context.quadraticCurveTo(e,t,n,r)}},{key:"restore",value:function(){this._context.restore()}},{key:"rotate",value:function(e){this._context.rotate(e)}},{key:"save",value:function(){this._context.save()}},{key:"scale",value:function(e,t){this._context.scale(e,t)}},{key:"setLineDash",value:function(e){this._context.setLineDash?this._context.setLineDash(e):"mozDash"in this._context?this._context.mozDash=e:"webkitLineDash"in this._context&&(this._context.webkitLineDash=e)}},{key:"getLineDash",value:function(){return this._context.getLineDash()}},{key:"setTransform",value:function(e,t,n,r,o,i){this._context.setTransform(e,t,n,r,o,i)}},{key:"stroke",value:function(e){e?this._context.stroke(e):this._context.stroke()}},{key:"strokeText",value:function(e,t,n,r){this._context.strokeText(e,t,n,r)}},{key:"transform",value:function(e,t,n,r,o,i){this._context.transform(e,t,n,r,o,i)}},{key:"translate",value:function(e,t){this._context.translate(e,t)}},{key:"_enableTrace",value:function(){var e,t,n=this,r=qte.length,o=this.setAttr,i=function(e){var r,o=n[e];n[e]=function(){return t=Gte(Array.prototype.slice.call(arguments,0)),r=o.apply(n,arguments),n._trace({method:e,args:t}),r}};for(e=0;e0&&void 0!==arguments[0]?arguments[0]:{width:0,height:0};return an(this,n),(e=t.call(this,r)).context=new Xte(en(e)),e.setSize(r.width,r.height),e}return on(n)}(Kte),Jte=function(e){pn(n,e);var t=Qt(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{width:0,height:0};return an(this,n),(e=t.call(this,r)).hitCanvas=!0,e.context=new $te(en(e)),e.setSize(r.width,r.height),e}return on(n)}(Kte),ene={get isDragging(){var e=!1;return ene._dragElements.forEach((function(t){"dragging"===t.dragStatus&&(e=!0)})),e},justDragged:!1,get node(){var e;return ene._dragElements.forEach((function(t){e=t.node})),e},_dragElements:new Map,_drag:function(e){var t=[];ene._dragElements.forEach((function(n,r){var o=n.node,i=o.getStage();i.setPointersPositions(e),void 0===n.pointerId&&(n.pointerId=Ite._getFirstPointerId(e));var a=i._changedPointerPositions.find((function(e){return e.id===n.pointerId}));if(a){if("dragging"!==n.dragStatus){var s=o.dragDistance();if(Math.max(Math.abs(a.x-n.startPointerPos.x),Math.abs(a.y-n.startPointerPos.y))1&&void 0!==arguments[1]&&arguments[1];if(e)return this._isVisible(e)&&this._isListening(e);var n=this.getLayer(),r=!1;ene._dragElements.forEach((function(e){"dragging"===e.dragStatus&&("Stage"===e.node.nodeType||e.node.getLayer()===n)&&(r=!0)}));var o=!t&&!Ste.hitOnDragEnabled&&r;return this.isListening()&&this.isVisible()&&!o}},{key:"show",value:function(){return this.visible(!0),this}},{key:"hide",value:function(){return this.visible(!1),this}},{key:"getZIndex",value:function(){return this.index||0}},{key:"getAbsoluteZIndex",value:function(){var e,t,n,r,o=this.getDepth(),i=this,a=0;return"Stage"!==i.nodeType&&function s(l){for(e=[],t=l.length,n=0;n0&&e[0].getDepth()<=o&&s(e)}(i.getStage().getChildren()),a}},{key:"getDepth",value:function(){for(var e=0,t=this.parent;t;)e++,t=t.parent;return e}},{key:"_batchTransformChanges",value:function(e){this._batchingTransformChange=!0,e(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(fne),this._clearSelfAndDescendantCache(rne)),this._needClearTransformCache=!1}},{key:"setPosition",value:function(e){var t=this;return this._batchTransformChanges((function(){t.x(e.x),t.y(e.y)})),this}},{key:"getPosition",value:function(){return{x:this.x(),y:this.y()}}},{key:"getRelativePointerPosition",value:function(){if(!this.getStage())return null;var e=this.getStage().getPointerPosition();if(!e)return null;var t=this.getAbsoluteTransform().copy();return t.invert(),t.point(e)}},{key:"getAbsolutePosition",value:function(e){for(var t=!1,n=this.parent;n;){if(n.isCached()){t=!0;break}n=n.parent}t&&!e&&(e=!0);var r=this.getAbsoluteTransform(e).getMatrix(),o=new _te,i=this.offset();return o.m=r.slice(),o.translate(i.x,i.y),o.getTranslation()}},{key:"setAbsolutePosition",value:function(e){var t=this._clearTransform();this.attrs.x=t.x,this.attrs.y=t.y,delete t.x,delete t.y,this._clearCache(fne);var n=this._getAbsoluteTransform().copy();return n.invert(),n.translate(e.x,e.y),e={x:this.attrs.x+n.getTranslation().x,y:this.attrs.y+n.getTranslation().y},this._setTransform(t),this.setPosition({x:e.x,y:e.y}),this._clearCache(fne),this._clearSelfAndDescendantCache(rne),this}},{key:"_setTransform",value:function(e){var t;for(t in e)this.attrs[t]=e[t]}},{key:"_clearTransform",value:function(){var e={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,e}},{key:"move",value:function(e){var t=e.x,n=e.y,r=this.x(),o=this.y();return void 0!==t&&(r+=t),void 0!==n&&(o+=n),this.setPosition({x:r,y:o}),this}},{key:"_eachAncestorReverse",value:function(e,t){var n,r,o=[],i=this.getParent();if(!t||t._id!==this._id){for(o.unshift(this);i&&(!t||i._id!==t._id);)o.unshift(i),i=i.parent;for(n=o.length,r=0;r0&&(this.parent.children.splice(e,1),this.parent.children.splice(e-1,0,this),this.parent._setChildrenIndices(),!0)}},{key:"moveToBottom",value:function(){if(!this.parent)return Ite.warn("Node has no parent. moveToBottom function is ignored."),!1;var e=this.index;return e>0&&(this.parent.children.splice(e,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0)}},{key:"setZIndex",value:function(e){if(!this.parent)return Ite.warn("Node has no parent. zIndex parameter is ignored."),this;(e<0||e>=this.parent.children.length)&&Ite.warn("Unexpected value "+e+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");var t=this.index;return this.parent.children.splice(t,1),this.parent.children.splice(e,0,this),this.parent._setChildrenIndices(),this}},{key:"getAbsoluteOpacity",value:function(){return this._getCache(tne,this._getAbsoluteOpacity)}},{key:"_getAbsoluteOpacity",value:function(){var e=this.opacity(),t=this.getParent();return t&&!t._isUnderCache&&(e*=t.getAbsoluteOpacity()),e}},{key:"moveTo",value:function(e){return this.getParent()!==e&&(this._remove(),e.add(this)),this}},{key:"toObject",value:function(){var e,t,n,r,o={},i=this.getAttrs();for(e in o.attrs={},i)t=i[e],Ite.isObject(t)&&!Ite._isPlainObject(t)&&!Ite._isArray(t)||(n="function"==typeof this[e]&&this[e],delete i[e],r=n?n.call(this):null,i[e]=t,r!==t&&(o.attrs[e]=t));return o.className=this.getClassName(),Ite._prepareToStringify(o)}},{key:"toJSON",value:function(){return JSON.stringify(this.toObject())}},{key:"getParent",value:function(){return this.parent}},{key:"findAncestors",value:function(e,t,n){var r=[];t&&this._isMatch(e)&&r.push(this);for(var o=this.parent;o;){if(o===n)return r;o._isMatch(e)&&r.push(o),o=o.parent}return r}},{key:"isAncestorOf",value:function(e){return!1}},{key:"findAncestor",value:function(e,t,n){return this.findAncestors(e,t,n)[0]}},{key:"_isMatch",value:function(e){if(!e)return!1;if("function"==typeof e)return e(this);var t,n,r=e.replace(/ /g,"").split(","),o=r.length;for(t=0;t1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return t.target=t.target||this,n?this._fireAndBubble(e,t):this._fire(e,t),this}},{key:"getAbsoluteTransform",value:function(e){return e?this._getAbsoluteTransform(e):this._getCache(rne,this._getAbsoluteTransform)}},{key:"_getAbsoluteTransform",value:function(e){var t;if(e)return t=new _te,this._eachAncestorReverse((function(e){var n=e.transformsEnabled();"all"===n?t.multiply(e.getTransform()):"position"===n&&t.translate(e.x()-e.offsetX(),e.y()-e.offsetY())}),e),t;t=this._cache.get(rne)||new _te,this.parent?this.parent.getAbsoluteTransform().copyInto(t):t.reset();var n=this.transformsEnabled();if("all"===n)t.multiply(this.getTransform());else if("position"===n){var r=this.attrs.x||0,o=this.attrs.y||0,i=this.attrs.offsetX||0,a=this.attrs.offsetY||0;t.translate(r-i,o-a)}return t.dirty=!1,t}},{key:"getAbsoluteScale",value:function(e){for(var t=this;t;)t._isUnderCache&&(e=t),t=t.getParent();var n=this.getAbsoluteTransform(e).decompose();return{x:n.scaleX,y:n.scaleY}}},{key:"getAbsoluteRotation",value:function(){return this.getAbsoluteTransform().decompose().rotation}},{key:"getTransform",value:function(){return this._getCache(fne,this._getTransform)}},{key:"_getTransform",value:function(){var e,t,n=this._cache.get(fne)||new _te;n.reset();var r=this.x(),o=this.y(),i=Ste.getAngle(this.rotation()),a=null!==(e=this.attrs.scaleX)&&void 0!==e?e:1,s=null!==(t=this.attrs.scaleY)&&void 0!==t?t:1,l=this.attrs.skewX||0,u=this.attrs.skewY||0,c=this.attrs.offsetX||0,d=this.attrs.offsetY||0;return 0===r&&0===o||n.translate(r,o),0!==i&&n.rotate(i),0===l&&0===u||n.skew(l,u),1===a&&1===s||n.scale(a,s),0===c&&0===d||n.translate(-1*c,-1*d),n.dirty=!1,n}},{key:"clone",value:function(e){var t,n,r,o,i,a=Ite.cloneObject(this.attrs);for(t in e)a[t]=e[t];var s=new this.constructor(a);for(t in this.eventListeners)for(r=(n=this.eventListeners[t]).length,o=0;o1&&void 0!==arguments[1])||arguments[1];ene._dragElements.has(this._id)||this._createDragElement(e);var n=ene._dragElements.get(this._id);n.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:e&&e.evt},t)}},{key:"_setDragPosition",value:function(e,t){var n=this.getStage()._getPointerById(t.pointerId);if(n){var r={x:n.x-t.offset.x,y:n.y-t.offset.y},o=this.dragBoundFunc();if(void 0!==o){var i=o.call(this,r,e);i?r=i:Ite.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}this._lastPos&&this._lastPos.x===r.x&&this._lastPos.y===r.y||(this.setAbsolutePosition(r),this._requestDraw()),this._lastPos=r}}},{key:"stopDrag",value:function(e){var t=ene._dragElements.get(this._id);t&&(t.dragStatus="stopped"),ene._endDragBefore(e),ene._endDragAfter(e)}},{key:"setDraggable",value:function(e){this._setAttr("draggable",e),this._dragChange()}},{key:"isDragging",value:function(){var e=ene._dragElements.get(this._id);return!!e&&"dragging"===e.dragStatus}},{key:"_listenDrag",value:function(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",(function(e){var t=this;if((!(void 0!==e.evt.button)||Ste.dragButtons.indexOf(e.evt.button)>=0)&&!this.isDragging()){var n=!1;ene._dragElements.forEach((function(e){t.isAncestorOf(e.node)&&(n=!0)})),n||this._createDragElement(e)}}))}},{key:"_dragChange",value:function(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;var e=ene._dragElements.get(this._id),t=e&&"dragging"===e.dragStatus,n=e&&"ready"===e.dragStatus;t?this.stopDrag():n&&ene._dragElements.delete(this._id)}}},{key:"_dragCleanup",value:function(){this.off("mousedown.konva"),this.off("touchstart.konva")}},{key:"isClientRectOnScreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{x:0,y:0},t=this.getStage();if(!t)return!1;var n={x:-e.x,y:-e.y,width:t.width()+2*e.x,height:t.height()+2*e.y};return Ite.haveIntersection(n,this.getClientRect())}}],[{key:"create",value:function(e,t){return Ite._isString(e)&&(e=JSON.parse(e)),this._createNode(e,t)}},{key:"_createNode",value:function(t,n){var r,o,i,a=e.prototype.getClassName.call(t),s=t.children;if(n&&(t.attrs.container=n),Ste[a]||(Ite.warn('Can not find a node with class name "'+a+'". Fallback to "Shape".'),a="Shape"),r=new(0,Ste[a])(t.attrs),s)for(o=s.length,i=0;i0}},{key:"removeChildren",value:function(){return this.getChildren().forEach((function(e){e.parent=null,e.index=0,e.remove()})),this.children=[],this._requestDraw(),this}},{key:"destroyChildren",value:function(){return this.getChildren().forEach((function(e){e.parent=null,e.index=0,e.destroy()})),this.children=[],this._requestDraw(),this}},{key:"add",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n1){for(var r=0;r0?t[0]:void 0}},{key:"_generalFind",value:function(e,t){var n=[];return this._descendants((function(r){var o=r._isMatch(e);return o&&n.push(r),!(!o||!t)})),n}},{key:"_descendants",value:function(e){var t,n=xn(this.getChildren());try{for(n.s();!(t=n.n()).done;){var r=t.value;if(e(r))return!0;if(r.hasChildren()&&r._descendants(e))return!0}}catch(COe){n.e(COe)}finally{n.f()}return!1}},{key:"toObject",value:function(){var e=gne.prototype.toObject.call(this);return e.children=[],this.getChildren().forEach((function(t){e.children.push(t.toObject())})),e}},{key:"isAncestorOf",value:function(e){for(var t=e.getParent();t;){if(t._id===this._id)return!0;t=t.getParent()}return!1}},{key:"clone",value:function(e){var t=gne.prototype.clone.call(this,e);return this.getChildren().forEach((function(e){t.add(e.clone())})),t}},{key:"getAllIntersections",value:function(e){var t=[];return this.find("Shape").forEach((function(n){n.isVisible()&&n.intersects(e)&&t.push(n)})),t}},{key:"_clearSelfAndDescendantCache",value:function(e){var t;Yt(nn(n.prototype),"_clearSelfAndDescendantCache",this).call(this,e),this.isCached()||null===(t=this.children)||void 0===t||t.forEach((function(t){t._clearSelfAndDescendantCache(e)}))}},{key:"_setChildrenIndices",value:function(){var e;null===(e=this.children)||void 0===e||e.forEach((function(e,t){e.index=t})),this._requestDraw()}},{key:"drawScene",value:function(e,t){var n=this.getLayer(),r=e||n&&n.getCanvas(),o=r&&r.getContext(),i=this._getCanvasCache(),a=i&&i.scene,s=r&&r.isCache;if(!this.isVisible()&&!s)return this;if(a){o.save();var l=this.getAbsoluteTransform(t).getMatrix();o.transform(l[0],l[1],l[2],l[3],l[4],l[5]),this._drawCachedSceneCanvas(o),o.restore()}else this._drawChildren("drawScene",r,t);return this}},{key:"drawHit",value:function(e,t){if(!this.shouldDrawHit(t))return this;var n=this.getLayer(),r=e||n&&n.hitCanvas,o=r&&r.getContext(),i=this._getCanvasCache();if(i&&i.hit){o.save();var a=this.getAbsoluteTransform(t).getMatrix();o.transform(a[0],a[1],a[2],a[3],a[4],a[5]),this._drawCachedHitCanvas(o),o.restore()}else this._drawChildren("drawHit",r,t);return this}},{key:"_drawChildren",value:function(e,t,n){var r,o=t&&t.getContext(),i=this.clipWidth(),a=this.clipHeight(),s=this.clipFunc(),l=i&&a||s,u=n===this;if(l){o.save();var c=this.getAbsoluteTransform(n),d=c.getMatrix();if(o.transform(d[0],d[1],d[2],d[3],d[4],d[5]),o.beginPath(),s)s.call(this,o,this);else{var f=this.clipX(),h=this.clipY();o.rect(f,h,i,a)}o.clip(),d=c.copy().invert().getMatrix(),o.transform(d[0],d[1],d[2],d[3],d[4],d[5])}var p=!u&&"source-over"!==this.globalCompositeOperation()&&"drawScene"===e;p&&(o.save(),o._applyGlobalCompositeOperation(this)),null===(r=this.children)||void 0===r||r.forEach((function(r){r[e](t,n)})),p&&o.restore(),l&&o.restore()}},{key:"getClientRect",value:function(e){var t,n,r,o,i,a=(e=e||{}).skipTransform,s=e.relativeTo,l={x:1/0,y:1/0,width:0,height:0},u=this;null===(t=this.children)||void 0===t||t.forEach((function(t){if(t.visible()){var a=t.getClientRect({relativeTo:u,skipShadow:e.skipShadow,skipStroke:e.skipStroke});0===a.width&&0===a.height||(void 0===n?(n=a.x,r=a.y,o=a.x+a.width,i=a.y+a.height):(n=Math.min(n,a.x),r=Math.min(r,a.y),o=Math.max(o,a.x+a.width),i=Math.max(i,a.y+a.height)))}}));for(var c=this.find("Shape"),d=!1,f=0;f=0?"pointer":e.indexOf("touch")>=0?"touch":"mouse"},Xne=function(e){var t=Zne(e);return"pointer"===t?Ste.pointerEventsEnabled&&Yne.pointer:"touch"===t?Yne.touch:"mouse"===t?Yne.mouse:void 0};function $ne(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(e.clipFunc||e.clipWidth||e.clipHeight)&&Ite.warn("Stage does not support clipping. Please use clip for Layers or Groups."),e}var Kne=[],Qne=function(e){pn(n,e);var t=Qt(n);function n(e){var r;return an(this,n),(r=t.call(this,$ne(e)))._pointerPositions=[],r._changedPointerPositions=[],r._buildDOM(),r._bindContentEvents(),Kne.push(en(r)),r.on("widthChange.konva heightChange.konva",r._resizeDOM),r.on("visibleChange.konva",r._checkVisibility),r.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",(function(){$ne(r.attrs)})),r._checkVisibility(),r}return on(n,[{key:"_validateAdd",value:function(e){var t="Layer"===e.getType(),n="FastLayer"===e.getType();t||n||Ite.throw("You may only add layers to the stage.")}},{key:"_checkVisibility",value:function(){if(this.content){var e=this.visible()?"":"none";this.content.style.display=e}}},{key:"setContainer",value:function(e){if("string"===kn(e)){if("."===e.charAt(0)){var t=e.slice(1);e=document.getElementsByClassName(t)[0]}else{var n;n="#"!==e.charAt(0)?e:e.slice(1),e=document.getElementById(n)}if(!e)throw"Can not find container in document with id "+n}return this._setAttr("container",e),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),e.appendChild(this.content)),this}},{key:"shouldDrawHit",value:function(){return!0}},{key:"clear",value:function(){var e,t=this.children,n=t.length;for(e=0;e-1&&Kne.splice(t,1),Ite.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}},{key:"getPointerPosition",value:function(){var e=this._pointerPositions[0]||this._changedPointerPositions[0];return e?{x:e.x,y:e.y}:(Ite.warn("Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);"),null)}},{key:"_getPointerById",value:function(e){return this._pointerPositions.find((function(t){return t.id===e}))}},{key:"getPointersPositions",value:function(){return this._pointerPositions}},{key:"getStage",value:function(){return this}},{key:"getContent",value:function(){return this.content}},{key:"_toKonvaCanvas",value:function(e){(e=e||{}).x=e.x||0,e.y=e.y||0,e.width=e.width||this.width(),e.height=e.height||this.height();var t=new Qte({width:e.width,height:e.height,pixelRatio:e.pixelRatio||1}),n=t.getContext()._context,r=this.children;return(e.x||e.y)&&n.translate(-1*e.x,-1*e.y),r.forEach((function(t){if(t.isVisible()){var r=t._toKonvaCanvas(e);n.drawImage(r._canvas,e.x,e.y,r.getWidth()/r.getPixelRatio(),r.getHeight()/r.getPixelRatio())}})),t}},{key:"getIntersection",value:function(e){if(!e)return null;var t,n=this.children;for(t=n.length-1;t>=0;t--){var r=n[t].getIntersection(e);if(r)return r}return null}},{key:"_resizeDOM",value:function(){var e=this.width(),t=this.height();this.content&&(this.content.style.width=e+"px",this.content.style.height=t+"px"),this.bufferCanvas.setSize(e,t),this.bufferHitCanvas.setSize(e,t),this.children.forEach((function(n){n.setSize({width:e,height:t}),n.draw()}))}},{key:"add",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o1){for(var i=0;i5&&Ite.warn("The stage has "+a+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),e.setSize({width:this.width(),height:this.height()}),e.draw(),Ste.isBrowser&&this.content.appendChild(e.canvas._canvas),this}},{key:"getParent",value:function(){return null}},{key:"getLayer",value:function(){return null}},{key:"hasPointerCapture",value:function(e){return Sne(e,this)}},{key:"setPointerCapture",value:function(e){Cne(e,this)}},{key:"releaseCapture",value:function(e){_ne(e)}},{key:"getLayers",value:function(){return this.children}},{key:"_bindContentEvents",value:function(){var e=this;Ste.isBrowser&&qne.forEach((function(t){var n=yn(t,2),r=n[0],o=n[1];e.content.addEventListener(r,(function(t){e[o](t)}),{passive:!1})}))}},{key:"_pointerenter",value:function(e){this.setPointersPositions(e);var t=Xne(e.type);this._fire(t.pointerenter,{evt:e,target:this,currentTarget:this})}},{key:"_pointerover",value:function(e){this.setPointersPositions(e);var t=Xne(e.type);this._fire(t.pointerover,{evt:e,target:this,currentTarget:this})}},{key:"_getTargetShape",value:function(e){var t=this[e+"targetShape"];return t&&!t.getStage()&&(t=null),t}},{key:"_pointerleave",value:function(e){var t=Xne(e.type),n=Zne(e.type);if(t){this.setPointersPositions(e);var r=this._getTargetShape(n),o=!ene.isDragging||Ste.hitOnDragEnabled;r&&o?(r._fireAndBubble(t.pointerout,{evt:e}),r._fireAndBubble(t.pointerleave,{evt:e}),this._fire(t.pointerleave,{evt:e,target:this,currentTarget:this}),this[n+"targetShape"]=null):o&&(this._fire(t.pointerleave,{evt:e,target:this,currentTarget:this}),this._fire(t.pointerout,{evt:e,target:this,currentTarget:this})),this.pointerPos=void 0,this._pointerPositions=[]}}},{key:"_pointerdown",value:function(e){var t=this,n=Xne(e.type),r=Zne(e.type);if(n){this.setPointersPositions(e);var o=!1;this._changedPointerPositions.forEach((function(i){var a=t.getIntersection(i);if(ene.justDragged=!1,Ste["_"+r+"ListenClick"]=!0,a&&a.isListening()){Ste.capturePointerEventsEnabled&&a.setPointerCapture(i.id),t[r+"ClickStartShape"]=a,a._fireAndBubble(n.pointerdown,{evt:e,pointerId:i.id}),o=!0;var s=e.type.indexOf("touch")>=0;a.preventDefault()&&e.cancelable&&s&&e.preventDefault()}})),o||this._fire(n.pointerdown,{evt:e,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}},{key:"_pointermove",value:function(e){var t=this,n=Xne(e.type),r=Zne(e.type);if(n&&(ene.isDragging&&ene.node.preventDefault()&&e.cancelable&&e.preventDefault(),this.setPointersPositions(e),!ene.isDragging||Ste.hitOnDragEnabled)){var o={},i=!1,a=this._getTargetShape(r);this._changedPointerPositions.forEach((function(s){var l=kne(s.id)||t.getIntersection(s),u=s.id,c={evt:e,pointerId:u},d=a!==l;if(d&&a&&(a._fireAndBubble(n.pointerout,Object.assign({},c),l),a._fireAndBubble(n.pointerleave,Object.assign({},c),l)),l){if(o[l._id])return;o[l._id]=!0}l&&l.isListening()?(i=!0,d&&(l._fireAndBubble(n.pointerover,Object.assign({},c),a),l._fireAndBubble(n.pointerenter,Object.assign({},c),a),t[r+"targetShape"]=l),l._fireAndBubble(n.pointermove,Object.assign({},c))):a&&(t._fire(n.pointerover,{evt:e,target:t,currentTarget:t,pointerId:u}),t[r+"targetShape"]=null)})),i||this._fire(n.pointermove,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}}},{key:"_pointerup",value:function(e){var t=this,n=Xne(e.type),r=Zne(e.type);if(n){this.setPointersPositions(e);var o=this[r+"ClickStartShape"],i=this[r+"ClickEndShape"],a={},s=!1;this._changedPointerPositions.forEach((function(l){var u=kne(l.id)||t.getIntersection(l);if(u){if(u.releaseCapture(l.id),a[u._id])return;a[u._id]=!0}var c=l.id,d={evt:e,pointerId:c},f=!1;Ste["_"+r+"InDblClickWindow"]?(f=!0,clearTimeout(t[r+"DblTimeout"])):ene.justDragged||(Ste["_"+r+"InDblClickWindow"]=!0,clearTimeout(t[r+"DblTimeout"])),t[r+"DblTimeout"]=setTimeout((function(){Ste["_"+r+"InDblClickWindow"]=!1}),Ste.dblClickWindow),u&&u.isListening()?(s=!0,t[r+"ClickEndShape"]=u,u._fireAndBubble(n.pointerup,Object.assign({},d)),Ste["_"+r+"ListenClick"]&&o&&o===u&&(u._fireAndBubble(n.pointerclick,Object.assign({},d)),f&&i&&i===u&&u._fireAndBubble(n.pointerdblclick,Object.assign({},d)))):(t[r+"ClickEndShape"]=null,Ste["_"+r+"ListenClick"]&&t._fire(n.pointerclick,{evt:e,target:t,currentTarget:t,pointerId:c}),f&&t._fire(n.pointerdblclick,{evt:e,target:t,currentTarget:t,pointerId:c}))})),s||this._fire(n.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),Ste["_"+r+"ListenClick"]=!1,e.cancelable&&"touch"!==r&&e.preventDefault()}}},{key:"_contextmenu",value:function(e){this.setPointersPositions(e);var t=this.getIntersection(this.getPointerPosition());t&&t.isListening()?t._fireAndBubble(Fne,{evt:e}):this._fire(Fne,{evt:e,target:this,currentTarget:this})}},{key:"_wheel",value:function(e){this.setPointersPositions(e);var t=this.getIntersection(this.getPointerPosition());t&&t.isListening()?t._fireAndBubble(Gne,{evt:e}):this._fire(Gne,{evt:e,target:this,currentTarget:this})}},{key:"_pointercancel",value:function(e){this.setPointersPositions(e);var t=kne(e.pointerId)||this.getIntersection(this.getPointerPosition());t&&t._fireAndBubble(Rne,xne(e)),_ne(e.pointerId)}},{key:"_lostpointercapture",value:function(e){_ne(e.pointerId)}},{key:"setPointersPositions",value:function(e){var t=this,n=this._getContentPosition(),r=null,o=null;void 0!==(e=e||window.event).touches?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(e.touches,(function(e){t._pointerPositions.push({id:e.identifier,x:(e.clientX-n.left)/n.scaleX,y:(e.clientY-n.top)/n.scaleY})})),Array.prototype.forEach.call(e.changedTouches||e.touches,(function(e){t._changedPointerPositions.push({id:e.identifier,x:(e.clientX-n.left)/n.scaleX,y:(e.clientY-n.top)/n.scaleY})}))):(r=(e.clientX-n.left)/n.scaleX,o=(e.clientY-n.top)/n.scaleY,this.pointerPos={x:r,y:o},this._pointerPositions=[{x:r,y:o,id:Ite._getFirstPointerId(e)}],this._changedPointerPositions=[{x:r,y:o,id:Ite._getFirstPointerId(e)}])}},{key:"_setPointerPosition",value:function(e){Ite.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(e)}},{key:"_getContentPosition",value:function(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var e=this.content.getBoundingClientRect();return{top:e.top,left:e.left,scaleX:e.width/this.content.clientWidth||1,scaleY:e.height/this.content.clientHeight||1}}},{key:"_buildDOM",value:function(){if(this.bufferCanvas=new Qte({width:this.width(),height:this.height()}),this.bufferHitCanvas=new Jte({pixelRatio:1,width:this.width(),height:this.height()}),Ste.isBrowser){var e=this.container();if(!e)throw"Stage has no container. A container is required.";e.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),e.appendChild(this.content),this._resizeDOM()}}},{key:"cache",value:function(){return Ite.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}},{key:"clearCache",value:function(){return this}},{key:"batchDraw",value:function(){return this.getChildren().forEach((function(e){e.batchDraw()})),this}}]),n}(yne);Qne.prototype.nodeType="Stage",Cte(Qne),Ute.addGetterSetter(Qne,"container");var Jne,ere="hasShadow",tre="shadowRGBA",nre="patternImage",rre="linearGradient",ore="radialGradient";function ire(){return Jne||(Jne=Ite.createCanvasElement().getContext("2d"))}var are={};var sre=function(e){pn(n,e);var t=Qt(n);function n(e){var r,o;for(an(this,n),r=t.call(this,e);!(o=Ite.getRandomColor())||o in are;);return r.colorKey=o,are[o]=en(r),r}return on(n,[{key:"getContext",value:function(){return Ite.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}},{key:"getCanvas",value:function(){return Ite.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}},{key:"getSceneFunc",value:function(){return this.attrs.sceneFunc||this._sceneFunc}},{key:"getHitFunc",value:function(){return this.attrs.hitFunc||this._hitFunc}},{key:"hasShadow",value:function(){return this._getCache(ere,this._hasShadow)}},{key:"_hasShadow",value:function(){return this.shadowEnabled()&&0!==this.shadowOpacity()&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}},{key:"_getFillPattern",value:function(){return this._getCache(nre,this.__getFillPattern)}},{key:"__getFillPattern",value:function(){if(this.fillPatternImage()){var e=ire().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(e&&e.setTransform){var t=new _te;t.translate(this.fillPatternX(),this.fillPatternY()),t.rotate(Ste.getAngle(this.fillPatternRotation())),t.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),t.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());var n=t.getMatrix(),r="undefined"==typeof DOMMatrix?{a:n[0],b:n[1],c:n[2],d:n[3],e:n[4],f:n[5]}:new DOMMatrix(n);e.setTransform(r)}return e}}},{key:"_getLinearGradient",value:function(){return this._getCache(rre,this.__getLinearGradient)}},{key:"__getLinearGradient",value:function(){var e=this.fillLinearGradientColorStops();if(e){for(var t=ire(),n=this.fillLinearGradientStartPoint(),r=this.fillLinearGradientEndPoint(),o=t.createLinearGradient(n.x,n.y,r.x,r.y),i=0;i0}},{key:"destroy",value:function(){return gne.prototype.destroy.call(this),delete are[this.colorKey],delete this.colorKey,this}},{key:"_useBufferCanvas",value:function(e){var t;if(!this.getStage())return!1;if(!(null===(t=this.attrs.perfectDrawEnabled)||void 0===t||t))return!1;var n=e||this.hasFill(),r=this.hasStroke(),o=1!==this.getAbsoluteOpacity();if(n&&r&&o)return!0;var i=this.hasShadow(),a=this.shadowForStrokeEnabled();return!!(n&&r&&i&&a)}},{key:"setStrokeHitEnabled",value:function(e){Ite.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),e?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}},{key:"getStrokeHitEnabled",value:function(){return 0!==this.hitStrokeWidth()}},{key:"getSelfRect",value:function(){var e=this.size();return{x:this._centroid?-e.width/2:0,y:this._centroid?-e.height/2:0,width:e.width,height:e.height}}},{key:"getClientRect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.skipTransform,n=e.relativeTo,r=this.getSelfRect(),o=!e.skipStroke&&this.hasStroke(),i=o&&this.strokeWidth()||0,a=r.width+i,s=r.height+i,l=!e.skipShadow&&this.hasShadow(),u=l?this.shadowOffsetX():0,c=l?this.shadowOffsetY():0,d=a+Math.abs(u),f=s+Math.abs(c),h=l&&this.shadowBlur()||0,p=d+2*h,v=f+2*h,g={width:p,height:v,x:-(i/2+h)+Math.min(u,0)+r.x,y:-(i/2+h)+Math.min(c,0)+r.y};return t?g:this._transformedRect(g,n)}},{key:"drawScene",value:function(e,t){var n,r,o=this.getLayer(),i=e||o.getCanvas(),a=i.getContext(),s=this._getCanvasCache(),l=this.getSceneFunc(),u=this.hasShadow(),c=i.isCache,d=t===this;if(!this.isVisible()&&!d)return this;if(s){a.save();var f=this.getAbsoluteTransform(t).getMatrix();return a.transform(f[0],f[1],f[2],f[3],f[4],f[5]),this._drawCachedSceneCanvas(a),a.restore(),this}if(!l)return this;if(a.save(),this._useBufferCanvas()&&!c){(r=(n=this.getStage().bufferCanvas).getContext()).clear(),r.save(),r._applyLineJoin(this);var h=this.getAbsoluteTransform(t).getMatrix();r.transform(h[0],h[1],h[2],h[3],h[4],h[5]),l.call(this,r,this),r.restore();var p=n.pixelRatio;u&&a._applyShadow(this),a._applyOpacity(this),a._applyGlobalCompositeOperation(this),a.drawImage(n._canvas,0,0,n.width/p,n.height/p)}else{if(a._applyLineJoin(this),!d){h=this.getAbsoluteTransform(t).getMatrix();a.transform(h[0],h[1],h[2],h[3],h[4],h[5]),a._applyOpacity(this),a._applyGlobalCompositeOperation(this)}u&&a._applyShadow(this),l.call(this,a,this)}return a.restore(),this}},{key:"drawHit",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!this.shouldDrawHit(t,n))return this;var r=this.getLayer(),o=e||r.hitCanvas,i=o&&o.getContext(),a=this.hitFunc()||this.sceneFunc(),s=this._getCanvasCache(),l=s&&s.hit;if(this.colorKey||Ite.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),l){i.save();var u=this.getAbsoluteTransform(t).getMatrix();return i.transform(u[0],u[1],u[2],u[3],u[4],u[5]),this._drawCachedHitCanvas(i),i.restore(),this}if(!a)return this;i.save(),i._applyLineJoin(this);var c=this===t;if(!c){var d=this.getAbsoluteTransform(t).getMatrix();i.transform(d[0],d[1],d[2],d[3],d[4],d[5])}return a.call(this,i,this),i.restore(),this}},{key:"drawHitFromCache",value:function(){var e,t,n,r,o,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,a=this._getCanvasCache(),s=this._getCachedSceneCanvas(),l=a.hit,u=l.getContext(),c=l.getWidth(),d=l.getHeight();u.clear(),u.drawImage(s._canvas,0,0,c,d);try{for(n=(t=(e=u.getImageData(0,0,c,d)).data).length,r=Ite._hexToRgb(this.colorKey),o=0;oi?(t[o]=r.r,t[o+1]=r.g,t[o+2]=r.b,t[o+3]=255):t[o+3]=0;u.putImageData(e,0,0)}catch(Dhe){Ite.error("Unable to draw hit graph from cached scene canvas. "+Dhe.message)}return this}},{key:"hasPointerCapture",value:function(e){return Sne(e,this)}},{key:"setPointerCapture",value:function(e){Cne(e,this)}},{key:"releaseCapture",value:function(e){_ne(e)}}]),n}(gne);sre.prototype._fillFunc=function(e){e.fill()},sre.prototype._strokeFunc=function(e){e.stroke()},sre.prototype._fillFuncHit=function(e){e.fill()},sre.prototype._strokeFuncHit=function(e){e.stroke()},sre.prototype._centroid=!1,sre.prototype.nodeType="Shape",Cte(sre),sre.prototype.eventListeners={},sre.prototype.on.call(sre.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",(function(){this._clearCache(ere)})),sre.prototype.on.call(sre.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",(function(){this._clearCache(tre)})),sre.prototype.on.call(sre.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",(function(){this._clearCache(nre)})),sre.prototype.on.call(sre.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",(function(){this._clearCache(rre)})),sre.prototype.on.call(sre.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",(function(){this._clearCache(ore)})),Ute.addGetterSetter(sre,"stroke",void 0,Fte()),Ute.addGetterSetter(sre,"strokeWidth",2,Dte()),Ute.addGetterSetter(sre,"fillAfterStrokeEnabled",!1),Ute.addGetterSetter(sre,"hitStrokeWidth","auto",jte()),Ute.addGetterSetter(sre,"strokeHitEnabled",!0,Hte()),Ute.addGetterSetter(sre,"perfectDrawEnabled",!0,Hte()),Ute.addGetterSetter(sre,"shadowForStrokeEnabled",!0,Hte()),Ute.addGetterSetter(sre,"lineJoin"),Ute.addGetterSetter(sre,"lineCap"),Ute.addGetterSetter(sre,"sceneFunc"),Ute.addGetterSetter(sre,"hitFunc"),Ute.addGetterSetter(sre,"dash"),Ute.addGetterSetter(sre,"dashOffset",0,Dte()),Ute.addGetterSetter(sre,"shadowColor",void 0,Bte()),Ute.addGetterSetter(sre,"shadowBlur",0,Dte()),Ute.addGetterSetter(sre,"shadowOpacity",1,Dte()),Ute.addComponentsGetterSetter(sre,"shadowOffset",["x","y"]),Ute.addGetterSetter(sre,"shadowOffsetX",0,Dte()),Ute.addGetterSetter(sre,"shadowOffsetY",0,Dte()),Ute.addGetterSetter(sre,"fillPatternImage"),Ute.addGetterSetter(sre,"fill",void 0,Fte()),Ute.addGetterSetter(sre,"fillPatternX",0,Dte()),Ute.addGetterSetter(sre,"fillPatternY",0,Dte()),Ute.addGetterSetter(sre,"fillLinearGradientColorStops"),Ute.addGetterSetter(sre,"strokeLinearGradientColorStops"),Ute.addGetterSetter(sre,"fillRadialGradientStartRadius",0),Ute.addGetterSetter(sre,"fillRadialGradientEndRadius",0),Ute.addGetterSetter(sre,"fillRadialGradientColorStops"),Ute.addGetterSetter(sre,"fillPatternRepeat","repeat"),Ute.addGetterSetter(sre,"fillEnabled",!0),Ute.addGetterSetter(sre,"strokeEnabled",!0),Ute.addGetterSetter(sre,"shadowEnabled",!0),Ute.addGetterSetter(sre,"dashEnabled",!0),Ute.addGetterSetter(sre,"strokeScaleEnabled",!0),Ute.addGetterSetter(sre,"fillPriority","color"),Ute.addComponentsGetterSetter(sre,"fillPatternOffset",["x","y"]),Ute.addGetterSetter(sre,"fillPatternOffsetX",0,Dte()),Ute.addGetterSetter(sre,"fillPatternOffsetY",0,Dte()),Ute.addComponentsGetterSetter(sre,"fillPatternScale",["x","y"]),Ute.addGetterSetter(sre,"fillPatternScaleX",1,Dte()),Ute.addGetterSetter(sre,"fillPatternScaleY",1,Dte()),Ute.addComponentsGetterSetter(sre,"fillLinearGradientStartPoint",["x","y"]),Ute.addComponentsGetterSetter(sre,"strokeLinearGradientStartPoint",["x","y"]),Ute.addGetterSetter(sre,"fillLinearGradientStartPointX",0),Ute.addGetterSetter(sre,"strokeLinearGradientStartPointX",0),Ute.addGetterSetter(sre,"fillLinearGradientStartPointY",0),Ute.addGetterSetter(sre,"strokeLinearGradientStartPointY",0),Ute.addComponentsGetterSetter(sre,"fillLinearGradientEndPoint",["x","y"]),Ute.addComponentsGetterSetter(sre,"strokeLinearGradientEndPoint",["x","y"]),Ute.addGetterSetter(sre,"fillLinearGradientEndPointX",0),Ute.addGetterSetter(sre,"strokeLinearGradientEndPointX",0),Ute.addGetterSetter(sre,"fillLinearGradientEndPointY",0),Ute.addGetterSetter(sre,"strokeLinearGradientEndPointY",0),Ute.addComponentsGetterSetter(sre,"fillRadialGradientStartPoint",["x","y"]),Ute.addGetterSetter(sre,"fillRadialGradientStartPointX",0),Ute.addGetterSetter(sre,"fillRadialGradientStartPointY",0),Ute.addComponentsGetterSetter(sre,"fillRadialGradientEndPoint",["x","y"]),Ute.addGetterSetter(sre,"fillRadialGradientEndPointX",0),Ute.addGetterSetter(sre,"fillRadialGradientEndPointY",0),Ute.addGetterSetter(sre,"fillPatternRotation",0),Ute.backCompat(sre,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});var lre=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],ure=lre.length,cre=function(e){pn(n,e);var t=Qt(n);function n(e){var r;return an(this,n),(r=t.call(this,e)).canvas=new Qte,r.hitCanvas=new Jte({pixelRatio:1}),r._waitingForDraw=!1,r.on("visibleChange.konva",r._checkVisibility),r._checkVisibility(),r.on("imageSmoothingEnabledChange.konva",r._setSmoothEnabled),r._setSmoothEnabled(),r}return on(n,[{key:"createPNGStream",value:function(){return this.canvas._canvas.createPNGStream()}},{key:"getCanvas",value:function(){return this.canvas}},{key:"getNativeCanvasElement",value:function(){return this.canvas._canvas}},{key:"getHitCanvas",value:function(){return this.hitCanvas}},{key:"getContext",value:function(){return this.getCanvas().getContext()}},{key:"clear",value:function(e){return this.getContext().clear(e),this.getHitCanvas().getContext().clear(e),this}},{key:"setZIndex",value:function(e){Yt(nn(n.prototype),"setZIndex",this).call(this,e);var t=this.getStage();return t&&t.content&&(t.content.removeChild(this.getNativeCanvasElement()),e0?{antialiased:!0}:{}}},{key:"drawScene",value:function(e,t){var n=this.getLayer(),r=e||n&&n.getCanvas();return this._fire("beforeDraw",{node:this}),this.clearBeforeDraw()&&r.getContext().clear(),yne.prototype.drawScene.call(this,r,t),this._fire("draw",{node:this}),this}},{key:"drawHit",value:function(e,t){var n=this.getLayer(),r=e||n&&n.hitCanvas;return n&&n.clearBeforeDraw()&&n.getHitCanvas().getContext().clear(),yne.prototype.drawHit.call(this,r,t),this}},{key:"enableHitGraph",value:function(){return this.hitGraphEnabled(!0),this}},{key:"disableHitGraph",value:function(){return this.hitGraphEnabled(!1),this}},{key:"setHitGraphEnabled",value:function(e){Ite.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(e)}},{key:"getHitGraphEnabled",value:function(e){return Ite.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}},{key:"toggleHitCanvas",value:function(){if(this.parent&&this.parent.content){var e=this.parent;!!this.hitCanvas._canvas.parentNode?e.content.removeChild(this.hitCanvas._canvas):e.content.appendChild(this.hitCanvas._canvas)}}},{key:"destroy",value:function(){return Ite.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),Yt(nn(n.prototype),"destroy",this).call(this)}}]),n}(yne);cre.prototype.nodeType="Layer",Cte(cre),Ute.addGetterSetter(cre,"imageSmoothingEnabled",!0),Ute.addGetterSetter(cre,"clearBeforeDraw",!0),Ute.addGetterSetter(cre,"hitGraphEnabled",!0,Hte());var dre=function(e){pn(n,e);var t=Qt(n);function n(e){var r;return an(this,n),(r=t.call(this,e)).listening(!1),Ite.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.'),r}return on(n)}(cre);dre.prototype.nodeType="FastLayer",Cte(dre);var fre=function(e){pn(n,e);var t=Qt(n);function n(){return an(this,n),t.apply(this,arguments)}return on(n,[{key:"_validateAdd",value:function(e){var t=e.getType();"Group"!==t&&"Shape"!==t&&Ite.throw("You may only add groups and shapes to groups.")}}]),n}(yne);fre.prototype.nodeType="Group",Cte(fre);var hre=xte.performance&&xte.performance.now?function(){return xte.performance.now()}:function(){return(new Date).getTime()},pre=function(){function e(t,n){an(this,e),this.id=e.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:hre(),frameRate:0},this.func=t,this.setLayers(n)}return on(e,[{key:"setLayers",value:function(e){var t=[];return t=e?e.length>0?e:[e]:[],this.layers=t,this}},{key:"getLayers",value:function(){return this.layers}},{key:"addLayer",value:function(e){var t,n=this.layers,r=n.length;for(t=0;tthis.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():e<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=e,this.update())}},{key:"getTime",value:function(){return this._time}},{key:"setPosition",value:function(e){this.prevPos=this._pos,this.propFunc(e),this._pos=e}},{key:"getPosition",value:function(e){return void 0===e&&(e=this._time),this.func(e,this.begin,this._change,this.duration)}},{key:"play",value:function(){this.state=2,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}},{key:"reverse",value:function(){this.state=3,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}},{key:"seek",value:function(e){this.pause(),this._time=e,this.update(),this.fire("onSeek")}},{key:"reset",value:function(){this.pause(),this._time=0,this.update(),this.fire("onReset")}},{key:"finish",value:function(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}},{key:"update",value:function(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}},{key:"onEnterFrame",value:function(){var e=this.getTimer()-this._startTime;2===this.state?this.setTime(e):3===this.state&&this.setTime(this.duration-e)}},{key:"pause",value:function(){this.state=1,this.fire("onPause")}},{key:"getTimer",value:function(){return(new Date).getTime()}}]),e}(),bre=function(){function e(t){an(this,e);var n,r,o=this,i=t.node,a=i._id,s=t.easing||wre.Linear,l=!!t.yoyo;n=void 0===t.duration?.3:0===t.duration?.001:t.duration,this.node=i,this._id=gre++;var u=i.getLayer()||(i instanceof Ste.Stage?i.getLayers():null);for(r in u||Ite.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new pre((function(){o.tween.onEnterFrame()}),u),this.tween=new yre(r,(function(e){o._tweenFunc(e)}),s,0,1,1e3*n,l),this._addListeners(),e.attrs[a]||(e.attrs[a]={}),e.attrs[a][this._id]||(e.attrs[a][this._id]={}),e.tweens[a]||(e.tweens[a]={}),t)void 0===vre[r]&&this._addAttr(r,t[r]);this.reset(),this.onFinish=t.onFinish,this.onReset=t.onReset,this.onUpdate=t.onUpdate}return on(e,[{key:"_addAttr",value:function(t,n){var r,o,i,a,s,l,u,c,d=this.node,f=d._id;if((i=e.tweens[f][t])&&delete e.attrs[f][i][t],r=d.getAttr(t),Ite._isArray(n))if(o=[],s=Math.max(n.length,r.length),"points"===t&&n.length!==r.length&&(n.length>r.length?(u=r,r=Ite._prepareArrayForTween(r,n,d.closed())):(l=n,n=Ite._prepareArrayForTween(n,r,d.closed()))),0===t.indexOf("fill"))for(a=0;a0?e:t),l=i*(i>0?e:t),u=a*(a>0?t:e);return{x:s,y:n?-1*u:l,width:1*t-s,height:u-l}}}]),n}(sre);function Sre(e,t,n,r,o,i,a){var s=Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2)),l=Math.sqrt(Math.pow(o-n,2)+Math.pow(i-r,2)),u=a*s/(s+l),c=a*l/(s+l);return[n-u*(o-e),r-u*(i-t),n+c*(o-e),r+c*(i-t)]}function Cre(e,t){var n,r,o=e.length,i=[];for(n=2;n4){for(n=(t=this.getTensionPoints()).length,r=s?0:4,s||e.quadraticCurveTo(t[0],t[1],t[2],t[3]);ru?l:u,v=l>u?1:l/u,g=l>u?u/l:1;e.translate(a,s),e.rotate(f),e.scale(v,g),e.arc(0,0,p,c,c+d,1-h),e.scale(1/v,1/g),e.rotate(-f),e.translate(-a,-s);break;case"z":n=!0,e.closePath()}}n||this.hasFill()?e.fillStrokeShape(this):e.strokeShape(this)}},{key:"getSelfRect",value:function(){var e=[];this.dataArray.forEach((function(t){if("A"===t.command){var r=t.points[4],o=t.points[5],i=t.points[4]+o,a=Math.PI/180;if(Math.abs(r-i)i;s-=a){var l=n.getPointOnEllipticalArc(t.points[0],t.points[1],t.points[2],t.points[3],s,0);e.push(l.x,l.y)}else for(var u=r+a;uthis.dataArray[r].pathLength;)e-=this.dataArray[r].pathLength,++r;if(r===o)return{x:(t=this.dataArray[r-1].points.slice(-2))[0],y:t[1]};if(e<.01)return{x:(t=this.dataArray[r].points.slice(0,2))[0],y:t[1]};var i=this.dataArray[r],a=i.points;switch(i.command){case"L":return n.getPointOnLine(e,i.start.x,i.start.y,a[0],a[1]);case"C":return n.getPointOnCubicBezier(e/i.pathLength,i.start.x,i.start.y,a[0],a[1],a[2],a[3],a[4],a[5]);case"Q":return n.getPointOnQuadraticBezier(e/i.pathLength,i.start.x,i.start.y,a[0],a[1],a[2],a[3]);case"A":var s=a[0],l=a[1],u=a[2],c=a[3],d=a[4],f=a[5],h=a[6];return d+=f*e/i.pathLength,n.getPointOnEllipticalArc(s,l,u,c,d,h)}return null}}],[{key:"getLineLength",value:function(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))}},{key:"getPointOnLine",value:function(e,t,n,r,o,i,a){void 0===i&&(i=t),void 0===a&&(a=n);var s=(o-n)/(r-t+1e-8),l=Math.sqrt(e*e/(1+s*s));r0&&!isNaN(h[0]);){var m,y,b,w,k,x,S,C,_,E,P=null,L=[],O=l,A=u;switch(f){case"l":l+=h.shift(),u+=h.shift(),P="L",L.push(l,u);break;case"L":l=h.shift(),u=h.shift(),L.push(l,u);break;case"m":var M=h.shift(),T=h.shift();if(l+=M,u+=T,P="M",a.length>2&&"z"===a[a.length-1].command)for(var I=a.length-2;I>=0;I--)if("M"===a[I].command){l=a[I].points[0]+M,u=a[I].points[1]+T;break}L.push(l,u),f="l";break;case"M":l=h.shift(),u=h.shift(),P="M",L.push(l,u),f="L";break;case"h":l+=h.shift(),P="L",L.push(l,u);break;case"H":l=h.shift(),P="L",L.push(l,u);break;case"v":u+=h.shift(),P="L",L.push(l,u);break;case"V":u=h.shift(),P="L",L.push(l,u);break;case"C":L.push(h.shift(),h.shift(),h.shift(),h.shift()),l=h.shift(),u=h.shift(),L.push(l,u);break;case"c":L.push(l+h.shift(),u+h.shift(),l+h.shift(),u+h.shift()),l+=h.shift(),u+=h.shift(),P="C",L.push(l,u);break;case"S":y=l,b=u,"C"===(m=a[a.length-1]).command&&(y=l+(l-m.points[2]),b=u+(u-m.points[3])),L.push(y,b,h.shift(),h.shift()),l=h.shift(),u=h.shift(),P="C",L.push(l,u);break;case"s":y=l,b=u,"C"===(m=a[a.length-1]).command&&(y=l+(l-m.points[2]),b=u+(u-m.points[3])),L.push(y,b,l+h.shift(),u+h.shift()),l+=h.shift(),u+=h.shift(),P="C",L.push(l,u);break;case"Q":L.push(h.shift(),h.shift()),l=h.shift(),u=h.shift(),L.push(l,u);break;case"q":L.push(l+h.shift(),u+h.shift()),l+=h.shift(),u+=h.shift(),P="Q",L.push(l,u);break;case"T":y=l,b=u,"Q"===(m=a[a.length-1]).command&&(y=l+(l-m.points[0]),b=u+(u-m.points[1])),l=h.shift(),u=h.shift(),P="Q",L.push(y,b,l,u);break;case"t":y=l,b=u,"Q"===(m=a[a.length-1]).command&&(y=l+(l-m.points[0]),b=u+(u-m.points[1])),l+=h.shift(),u+=h.shift(),P="Q",L.push(y,b,l,u);break;case"A":w=h.shift(),k=h.shift(),x=h.shift(),S=h.shift(),C=h.shift(),_=l,E=u,l=h.shift(),u=h.shift(),P="A",L=this.convertEndpointToCenterParameterization(_,E,l,u,S,C,w,k,x);break;case"a":w=h.shift(),k=h.shift(),x=h.shift(),S=h.shift(),C=h.shift(),_=l,E=u,l+=h.shift(),u+=h.shift(),P="A",L=this.convertEndpointToCenterParameterization(_,E,l,u,S,C,w,k,x)}a.push({command:P||f,points:L,start:{x:O,y:A},pathLength:this.calcLength(O,A,P||f,L)})}"z"!==f&&"Z"!==f||a.push({command:"z",points:[],start:void 0,pathLength:0})}return a}},{key:"calcLength",value:function(e,t,r,o){var i,a,s,l,u=n;switch(r){case"L":return u.getLineLength(e,t,o[0],o[1]);case"C":for(i=0,a=u.getPointOnCubicBezier(0,e,t,o[0],o[1],o[2],o[3],o[4],o[5]),l=.01;l<=1;l+=.01)s=u.getPointOnCubicBezier(l,e,t,o[0],o[1],o[2],o[3],o[4],o[5]),i+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;return i;case"Q":for(i=0,a=u.getPointOnQuadraticBezier(0,e,t,o[0],o[1],o[2],o[3]),l=.01;l<=1;l+=.01)s=u.getPointOnQuadraticBezier(l,e,t,o[0],o[1],o[2],o[3]),i+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;return i;case"A":i=0;var c=o[4],d=o[5],f=o[4]+d,h=Math.PI/180;if(Math.abs(c-f)f;l-=h)s=u.getPointOnEllipticalArc(o[0],o[1],o[2],o[3],l,0),i+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;else for(l=c+h;l1&&(a*=Math.sqrt(f),s*=Math.sqrt(f));var h=Math.sqrt((a*a*(s*s)-a*a*(d*d)-s*s*(c*c))/(a*a*(d*d)+s*s*(c*c)));o===i&&(h*=-1),isNaN(h)&&(h=0);var p=h*a*d/s,v=h*-s*c/a,g=(e+n)/2+Math.cos(u)*p-Math.sin(u)*v,m=(t+r)/2+Math.sin(u)*p+Math.cos(u)*v,y=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},b=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(y(e)*y(t))},w=function(e,t){return(e[0]*t[1]=1&&(C=0),0===i&&C>0&&(C-=2*Math.PI),1===i&&C<0&&(C+=2*Math.PI),[g,m,a,s,k,C,u,i]}}]),n}(sre);Ere.prototype.className="Path",Ere.prototype._attrsAffectingSize=["data"],Cte(Ere),Ute.addGetterSetter(Ere,"data");var Pre=function(e){pn(n,e);var t=Qt(n);function n(){return an(this,n),t.apply(this,arguments)}return on(n,[{key:"_sceneFunc",value:function(e){Yt(nn(n.prototype),"_sceneFunc",this).call(this,e);var t=2*Math.PI,r=this.points(),o=r,i=0!==this.tension()&&r.length>4;i&&(o=this.getTensionPoints());var a,s,l=this.pointerLength(),u=r.length;if(i){var c=[o[o.length-4],o[o.length-3],o[o.length-2],o[o.length-1],r[u-2],r[u-1]],d=Ere.calcLength(o[o.length-4],o[o.length-3],"C",c),f=Ere.getPointOnQuadraticBezier(Math.min(1,1-l/d),c[0],c[1],c[2],c[3],c[4],c[5]);a=r[u-2]-f.x,s=r[u-1]-f.y}else a=r[u-2]-r[u-4],s=r[u-1]-r[u-3];var h=(Math.atan2(s,a)+t)%t,p=this.pointerWidth();this.pointerAtEnding()&&(e.save(),e.beginPath(),e.translate(r[u-2],r[u-1]),e.rotate(h),e.moveTo(0,0),e.lineTo(-l,p/2),e.lineTo(-l,-p/2),e.closePath(),e.restore(),this.__fillStroke(e)),this.pointerAtBeginning()&&(e.save(),e.beginPath(),e.translate(r[0],r[1]),i?(a=(o[0]+o[2])/2-r[0],s=(o[1]+o[3])/2-r[1]):(a=r[2]-r[0],s=r[3]-r[1]),e.rotate((Math.atan2(-s,-a)+t)%t),e.moveTo(0,0),e.lineTo(-l,p/2),e.lineTo(-l,-p/2),e.closePath(),e.restore(),this.__fillStroke(e))}},{key:"__fillStroke",value:function(e){var t=this.dashEnabled();t&&(this.attrs.dashEnabled=!1,e.setLineDash([])),e.fillStrokeShape(this),t&&(this.attrs.dashEnabled=!0)}},{key:"getSelfRect",value:function(){var e=Yt(nn(n.prototype),"getSelfRect",this).call(this),t=this.pointerWidth()/2;return{x:e.x-t,y:e.y-t,width:e.width+2*t,height:e.height+2*t}}}]),n}(_re);Pre.prototype.className="Arrow",Cte(Pre),Ute.addGetterSetter(Pre,"pointerLength",10,Dte()),Ute.addGetterSetter(Pre,"pointerWidth",10,Dte()),Ute.addGetterSetter(Pre,"pointerAtBeginning",!1),Ute.addGetterSetter(Pre,"pointerAtEnding",!0);var Lre=function(e){pn(n,e);var t=Qt(n);function n(){return an(this,n),t.apply(this,arguments)}return on(n,[{key:"_sceneFunc",value:function(e){e.beginPath(),e.arc(0,0,this.attrs.radius||0,0,2*Math.PI,!1),e.closePath(),e.fillStrokeShape(this)}},{key:"getWidth",value:function(){return 2*this.radius()}},{key:"getHeight",value:function(){return 2*this.radius()}},{key:"setWidth",value:function(e){this.radius()!==e/2&&this.radius(e/2)}},{key:"setHeight",value:function(e){this.radius()!==e/2&&this.radius(e/2)}}]),n}(sre);Lre.prototype._centroid=!0,Lre.prototype.className="Circle",Lre.prototype._attrsAffectingSize=["radius"],Cte(Lre),Ute.addGetterSetter(Lre,"radius",0,Dte());var Ore=function(e){pn(n,e);var t=Qt(n);function n(){return an(this,n),t.apply(this,arguments)}return on(n,[{key:"_sceneFunc",value:function(e){var t=this.radiusX(),n=this.radiusY();e.beginPath(),e.save(),t!==n&&e.scale(1,n/t),e.arc(0,0,t,0,2*Math.PI,!1),e.restore(),e.closePath(),e.fillStrokeShape(this)}},{key:"getWidth",value:function(){return 2*this.radiusX()}},{key:"getHeight",value:function(){return 2*this.radiusY()}},{key:"setWidth",value:function(e){this.radiusX(e/2)}},{key:"setHeight",value:function(e){this.radiusY(e/2)}}]),n}(sre);Ore.prototype.className="Ellipse",Ore.prototype._centroid=!0,Ore.prototype._attrsAffectingSize=["radiusX","radiusY"],Cte(Ore),Ute.addComponentsGetterSetter(Ore,"radius",["x","y"]),Ute.addGetterSetter(Ore,"radiusX",0,Dte()),Ute.addGetterSetter(Ore,"radiusY",0,Dte());var Are=function(e){pn(n,e);var t=Qt(n);function n(e){var r;return an(this,n),(r=t.call(this,e)).on("imageChange.konva",(function(){r._setImageLoad()})),r._setImageLoad(),r}return on(n,[{key:"_setImageLoad",value:function(){var e=this,t=this.image();t&&t.complete||t&&4===t.readyState||t&&t.addEventListener&&t.addEventListener("load",(function(){e._requestDraw()}))}},{key:"_useBufferCanvas",value:function(){return Yt(nn(n.prototype),"_useBufferCanvas",this).call(this,!0)}},{key:"_sceneFunc",value:function(e){var t,n=this.getWidth(),r=this.getHeight(),o=this.attrs.image;if(o){var i=this.attrs.cropWidth,a=this.attrs.cropHeight;t=i&&a?[o,this.cropX(),this.cropY(),i,a,0,0,n,r]:[o,0,0,n,r]}(this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,n,r),e.closePath(),e.fillStrokeShape(this)),o&&e.drawImage.apply(e,t)}},{key:"_hitFunc",value:function(e){var t=this.width(),n=this.height();e.beginPath(),e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)}},{key:"getWidth",value:function(){var e,t;return null!==(e=this.attrs.width)&&void 0!==e?e:null===(t=this.image())||void 0===t?void 0:t.width}},{key:"getHeight",value:function(){var e,t;return null!==(e=this.attrs.height)&&void 0!==e?e:null===(t=this.image())||void 0===t?void 0:t.height}}],[{key:"fromURL",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=Ite.createImageElement();o.onload=function(){var e=new n({image:o});t(e)},o.onerror=r,o.crossOrigin="Anonymous",o.src=e}}]),n}(sre);Are.prototype.className="Image",Cte(Are),Ute.addGetterSetter(Are,"image"),Ute.addComponentsGetterSetter(Are,"crop",["x","y","width","height"]),Ute.addGetterSetter(Are,"cropX",0,Dte()),Ute.addGetterSetter(Are,"cropY",0,Dte()),Ute.addGetterSetter(Are,"cropWidth",0,Dte()),Ute.addGetterSetter(Are,"cropHeight",0,Dte());var Mre=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],Tre="up",Ire="right",Rre="down",Nre="left",Dre=Mre.length,zre=function(e){pn(n,e);var t=Qt(n);function n(e){var r;return an(this,n),(r=t.call(this,e)).on("add.konva",(function(e){this._addListeners(e.child),this._sync()})),r}return on(n,[{key:"getText",value:function(){return this.find("Text")[0]}},{key:"getTag",value:function(){return this.find("Tag")[0]}},{key:"_addListeners",value:function(e){var t,n=this,r=function(){n._sync()};for(t=0;t1&&(g+=a)}}}},{key:"_hitFunc",value:function(e){var t=this.getWidth(),n=this.getHeight();e.beginPath(),e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)}},{key:"setText",value:function(e){var t=Ite._isString(e)?e:null==e?"":e+"";return this._setAttr("text",t),this}},{key:"getWidth",value:function(){return this.attrs.width===Yre||void 0===this.attrs.width?this.getTextWidth()+2*this.padding():this.attrs.width}},{key:"getHeight",value:function(){return this.attrs.height===Yre||void 0===this.attrs.height?this.fontSize()*this.textArr.length*this.lineHeight()+2*this.padding():this.attrs.height}},{key:"getTextWidth",value:function(){return this.textWidth}},{key:"getTextHeight",value:function(){return Ite.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}},{key:"measureSize",value:function(e){var t,n=noe(),r=this.fontSize();return n.save(),n.font=this._getContextFont(),t=n.measureText(e),n.restore(),{width:t.width,height:r}}},{key:"_getContextFont",value:function(){return this.fontStyle()+Qre+this.fontVariant()+Qre+(this.fontSize()+"px ")+this.fontFamily().split(",").map((function(e){var t=(e=e.trim()).indexOf(" ")>=0,n=e.indexOf('"')>=0||e.indexOf("'")>=0;return t&&!n&&(e='"'.concat(e,'"')),e})).join(", ")}},{key:"_addTextLine",value:function(e){this.align()===Zre&&(e=e.trim());var t=this._getTextWidth(e);return this.textArr.push({text:e,width:t,lastInParagraph:!1})}},{key:"_getTextWidth",value:function(e){var t=this.letterSpacing(),n=e.length;return noe().measureText(e).width+(n?t*(n-1):0)}},{key:"_setTextData",value:function(){var e=this.text().split("\n"),t=+this.fontSize(),n=0,r=this.lineHeight()*t,o=this.attrs.width,i=this.attrs.height,a=o!==Yre&&void 0!==o,s=i!==Yre&&void 0!==i,l=this.padding(),u=o-2*l,c=i-2*l,d=0,f=this.wrap(),h="char"!==f&&f!==Jre,p=this.ellipsis();this.textArr=[],noe().font=this._getContextFont();for(var v=p?this._getTextWidth("…"):0,g=0,m=e.length;gu)for(;y.length>0;){for(var w=0,k=y.length,x="",S=0;w>>1,_=y.slice(0,C+1),E=this._getTextWidth(_)+v;E<=u?(w=C+1,x=_,S=E):k=C}if(!x)break;if(h){var P,L=y[x.length];(P=(L===Qre||"-"===L)&&S<=u?x.length:Math.max(x.lastIndexOf(Qre),x.lastIndexOf("-"))+1)>0&&(w=P,x=x.slice(0,w),S=this._getTextWidth(x))}if(x=x.trimRight(),this._addTextLine(x),n=Math.max(n,S),d+=r,this._shouldHandleEllipsis(d)){this._tryToAddEllipsisToLastLine();break}if((y=(y=y.slice(w)).trimLeft()).length>0&&(b=this._getTextWidth(y))<=u){this._addTextLine(y),d+=r,n=Math.max(n,b);break}}else this._addTextLine(y),d+=r,n=Math.max(n,b),this._shouldHandleEllipsis(d)&&gc)break;this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0)}this.textHeight=t,this.textWidth=n}},{key:"_shouldHandleEllipsis",value:function(e){var t=+this.fontSize(),n=this.lineHeight()*t,r=this.attrs.height,o=r!==Yre&&void 0!==r,i=r-2*this.padding();return!(this.wrap()!==Jre)||o&&e+n>i}},{key:"_tryToAddEllipsisToLastLine",value:function(){var e=this.attrs.width,t=e!==Yre&&void 0!==e,n=e-2*this.padding(),r=this.ellipsis(),o=this.textArr[this.textArr.length-1];if(o&&r){if(t)this._getTextWidth(o.text+"…")=1){var n=t[0].p0;e.moveTo(n.x,n.y)}for(var r=0;r0&&(a+=e.dataArray[s].pathLength);var l=0;"center"===r&&(l=Math.max(0,a/2-i/2)),"right"===r&&(l=Math.max(0,a-i));for(var u,c,d,f=Gre(this.text()),h=this.text().split(" ").length-1,p=-1,v=0,g=function(){v=0;for(var t=e.dataArray,n=p+1;n0)return p=n,t[n];"M"===t[n].command&&(u={x:t[n].points[0],y:t[n].points[1]})}return{}},m=function(t){var o=e._getTextSize(t).width+n;" "===t&&"justify"===r&&(o+=(a-i)/h);var s=0,l=0;for(c=void 0;Math.abs(o-s)/o>.01&&l<20;){l++;for(var f=s;void 0===d;)(d=g())&&f+d.pathLengtho?c=Ere.getPointOnLine(o,u.x,u.y,d.points[0],d.points[1],u.x,u.y):d=void 0;break;case"A":var m=d.points[4],y=d.points[5],b=d.points[4]+y;0===v?v=m+1e-8:o>s?v+=Math.PI/180*y/Math.abs(y):v-=Math.PI/360*y/Math.abs(y),(y<0&&v=0&&v>b)&&(v=b,p=!0),c=Ere.getPointOnEllipticalArc(d.points[0],d.points[1],d.points[2],d.points[3],v,d.points[6]);break;case"C":0===v?v=o>d.pathLength?1e-8:o/d.pathLength:o>s?v+=(o-s)/d.pathLength/2:v=Math.max(v-(s-o)/d.pathLength/2,0),v>1&&(v=1,p=!0),c=Ere.getPointOnCubicBezier(v,d.start.x,d.start.y,d.points[0],d.points[1],d.points[2],d.points[3],d.points[4],d.points[5]);break;case"Q":0===v?v=o/d.pathLength:o>s?v+=(o-s)/d.pathLength:v-=(s-o)/d.pathLength,v>1&&(v=1,p=!0),c=Ere.getPointOnQuadraticBezier(v,d.start.x,d.start.y,d.points[0],d.points[1],d.points[2],d.points[3])}void 0!==c&&(s=Ere.getLineLength(u.x,u.y,c.x,c.y)),p&&(p=!1,d=void 0)}},y=l/(e._getTextSize("C").width+n)-1,b=0;b0&&void 0!==arguments[0]?arguments[0]:[];this._nodes&&this._nodes.length&&this.detach(),this._nodes=t,1===t.length&&this.useSingleNodeRotation()?this.rotation(t[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach((function(t){var n=function(){1===e.nodes().length&&e.useSingleNodeRotation()&&e.rotation(e.nodes()[0].getAbsoluteRotation()),e._resetTransformCache(),e._transforming||e.isDragging()||e.update()},r=t._attrsAffectingSize.map((function(t){return t+"Change."+e._getEventNamespace()})).join(" ");t.on(r,n),t.on(doe.map((function(t){return t+".".concat(e._getEventNamespace())})).join(" "),n),t.on("absoluteTransformChange.".concat(e._getEventNamespace()),n),e._proxyDrag(t)})),this._resetTransformCache();var n=!!this.findOne(".top-left");return n&&this.update(),this}},{key:"_proxyDrag",value:function(e){var t,n=this;e.on("dragstart.".concat(this._getEventNamespace()),(function(r){t=e.getAbsolutePosition(),n.isDragging()||e===n.findOne(".back")||n.startDrag(r,!1)})),e.on("dragmove.".concat(this._getEventNamespace()),(function(r){if(t){var o=e.getAbsolutePosition(),i=o.x-t.x,a=o.y-t.y;n.nodes().forEach((function(t){if(t!==e&&!t.isDragging()){var n=t.getAbsolutePosition();t.setAbsolutePosition({x:n.x+i,y:n.y+a}),t.startDrag(r)}})),t=null}}))}},{key:"getNodes",value:function(){return this._nodes||[]}},{key:"getActiveAnchor",value:function(){return this._movingAnchorName}},{key:"detach",value:function(){var e=this;this._nodes&&this._nodes.forEach((function(t){t.off("."+e._getEventNamespace())})),this._nodes=[],this._resetTransformCache()}},{key:"_resetTransformCache",value:function(){this._clearCache(coe),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}},{key:"_getNodeRect",value:function(){return this._getCache(coe,this.__getNodeRect)}},{key:"__getNodeShape",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.rotation(),n=arguments.length>2?arguments[2]:void 0,r=e.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),o=e.getAbsoluteScale(n),i=e.getAbsolutePosition(n),a=r.x*o.x-e.offsetX()*o.x,s=r.y*o.y-e.offsetY()*o.y,l=(Ste.getAngle(e.getAbsoluteRotation())+2*Math.PI)%(2*Math.PI),u={x:i.x+a*Math.cos(l)+s*Math.sin(-l),y:i.y+s*Math.cos(l)+a*Math.sin(l),width:r.width*o.x,height:r.height*o.y,rotation:l};return voe(u,-Ste.getAngle(t),{x:0,y:0})}},{key:"__getNodeRect",value:function(){var e=this;if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};var t=[];this.nodes().map((function(n){var r=n.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:e.ignoreStroke()}),o=[{x:r.x,y:r.y},{x:r.x+r.width,y:r.y},{x:r.x+r.width,y:r.y+r.height},{x:r.x,y:r.y+r.height}],i=n.getAbsoluteTransform();o.forEach((function(e){var n=i.point(e);t.push(n)}))}));var n,r,o,i,a=new _te;a.rotate(-Ste.getAngle(this.rotation())),t.forEach((function(e){var t=a.point(e);void 0===n&&(n=o=t.x,r=i=t.y),n=Math.min(n,t.x),r=Math.min(r,t.y),o=Math.max(o,t.x),i=Math.max(i,t.y)})),a.invert();var s=a.point({x:n,y:r});return{x:s.x,y:s.y,width:o-n,height:i-r,rotation:Ste.getAngle(this.rotation())}}},{key:"getX",value:function(){return this._getNodeRect().x}},{key:"getY",value:function(){return this._getNodeRect().y}},{key:"getWidth",value:function(){return this._getNodeRect().width}},{key:"getHeight",value:function(){return this._getNodeRect().height}},{key:"_createElements",value:function(){this._createBack(),poe.forEach(function(e){this._createAnchor(e)}.bind(this)),this._createAnchor("rotater")}},{key:"_createAnchor",value:function(e){var t=this,n=new Bre({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:e+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:hoe?10:"auto"}),r=this;n.on("mousedown touchstart",(function(e){r._handleMouseDown(e)})),n.on("dragstart",(function(e){n.stopDrag(),e.cancelBubble=!0})),n.on("dragend",(function(e){e.cancelBubble=!0})),n.on("mouseenter",(function(){var r=Ste.getAngle(t.rotation()),o=function(e,t){if("rotater"===e)return"crosshair";t+=Ite.degToRad(foe[e]||0);var n=(Ite.radToDeg(t)%360+360)%360;return Ite._inRange(n,337.5,360)||Ite._inRange(n,0,22.5)?"ns-resize":Ite._inRange(n,22.5,67.5)?"nesw-resize":Ite._inRange(n,67.5,112.5)?"ew-resize":Ite._inRange(n,112.5,157.5)?"nwse-resize":Ite._inRange(n,157.5,202.5)?"ns-resize":Ite._inRange(n,202.5,247.5)?"nesw-resize":Ite._inRange(n,247.5,292.5)?"ew-resize":Ite._inRange(n,292.5,337.5)?"nwse-resize":(Ite.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}(e,r);n.getStage().content&&(n.getStage().content.style.cursor=o),t._cursorChange=!0})),n.on("mouseout",(function(){n.getStage().content&&(n.getStage().content.style.cursor=""),t._cursorChange=!1})),this.add(n)}},{key:"_createBack",value:function(){var e=this,t=new sre({name:"back",width:0,height:0,draggable:!0,sceneFunc:function(e){var t=this.getParent(),n=t.padding();e.beginPath(),e.rect(-n,-n,this.width()+2*n,this.height()+2*n),e.moveTo(this.width()/2,-n),t.rotateEnabled()&&e.lineTo(this.width()/2,-t.rotateAnchorOffset()*Ite._sign(this.height())-n),e.fillStrokeShape(this)},hitFunc:function(t,n){if(e.shouldOverdrawWholeArea()){var r=e.padding();t.beginPath(),t.rect(-r,-r,n.width()+2*r,n.height()+2*r),t.fillStrokeShape(n)}}});this.add(t),this._proxyDrag(t),t.on("dragstart",(function(e){e.cancelBubble=!0})),t.on("dragmove",(function(e){e.cancelBubble=!0})),t.on("dragend",(function(e){e.cancelBubble=!0})),this.on("dragmove",(function(t){e.update()}))}},{key:"_handleMouseDown",value:function(e){this._movingAnchorName=e.target.name().split(" ")[0];var t=this._getNodeRect(),n=t.width,r=t.height,o=Math.sqrt(Math.pow(n,2)+Math.pow(r,2));this.sin=Math.abs(r/o),this.cos=Math.abs(n/o),"undefined"!=typeof window&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;var i=e.target.getAbsolutePosition(),a=e.target.getStage().getPointerPosition();this._anchorDragOffset={x:a.x-i.x,y:a.y-i.y},this._fire("transformstart",{evt:e.evt,target:this.getNode()}),this._nodes.forEach((function(t){t._fire("transformstart",{evt:e.evt,target:t})}))}},{key:"_handleMouseMove",value:function(e){var t,n,r,o=this.findOne("."+this._movingAnchorName),i=o.getStage();i.setPointersPositions(e);var a=i.getPointerPosition(),s={x:a.x-this._anchorDragOffset.x,y:a.y-this._anchorDragOffset.y},l=o.getAbsolutePosition();this.anchorDragBoundFunc()&&(s=this.anchorDragBoundFunc()(l,s,e)),o.setAbsolutePosition(s);var u=o.getAbsolutePosition();if(l.x!==u.x||l.y!==u.y)if("rotater"!==this._movingAnchorName){var c=this.keepRatio()||e.shiftKey,d=this.centeredScaling()||e.altKey;if("top-left"===this._movingAnchorName){if(c){var f=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};r=Math.sqrt(Math.pow(f.x-o.x(),2)+Math.pow(f.y-o.y(),2));var h=this.findOne(".top-left").x()>f.x?-1:1,p=this.findOne(".top-left").y()>f.y?-1:1;t=r*this.cos*h,n=r*this.sin*p,this.findOne(".top-left").x(f.x-t),this.findOne(".top-left").y(f.y-n)}}else if("top-center"===this._movingAnchorName)this.findOne(".top-left").y(o.y());else if("top-right"===this._movingAnchorName){if(c){f=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};r=Math.sqrt(Math.pow(o.x()-f.x,2)+Math.pow(f.y-o.y(),2));h=this.findOne(".top-right").x()f.y?-1:1;t=r*this.cos*h,n=r*this.sin*p,this.findOne(".top-right").x(f.x+t),this.findOne(".top-right").y(f.y-n)}var v=o.position();this.findOne(".top-left").y(v.y),this.findOne(".bottom-right").x(v.x)}else if("middle-left"===this._movingAnchorName)this.findOne(".top-left").x(o.x());else if("middle-right"===this._movingAnchorName)this.findOne(".bottom-right").x(o.x());else if("bottom-left"===this._movingAnchorName){if(c){f=d?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};r=Math.sqrt(Math.pow(f.x-o.x(),2)+Math.pow(o.y()-f.y,2));h=f.x=0){var a=i.point({x:2*-this.padding(),y:0});if(e.x+=a.x,e.y+=a.y,e.width+=2*this.padding(),this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=a.x,this._anchorDragOffset.y-=a.y,!o)return void this.update()}else if(this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("right")>=0){var s=i.point({x:2*this.padding(),y:0});if(this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=s.x,this._anchorDragOffset.y-=s.y,e.width+=2*this.padding(),!o)return void this.update()}if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("top")>=0){var l=i.point({x:0,y:2*-this.padding()});if(e.x+=l.x,e.y+=l.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=l.x,this._anchorDragOffset.y-=l.y,e.height+=2*this.padding(),!o)return void this.update()}else if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("bottom")>=0){var u=i.point({x:0,y:2*this.padding()});if(this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=u.x,this._anchorDragOffset.y-=u.y,e.height+=2*this.padding(),!o)return void this.update()}if(this.boundBoxFunc()){var c=this.boundBoxFunc()(r,e);c?e=c:Ite.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}var d=1e7,f=new _te;f.translate(r.x,r.y),f.rotate(r.rotation),f.scale(r.width/d,r.height/d);var h=new _te;h.translate(e.x,e.y),h.rotate(e.rotation),h.scale(e.width/d,e.height/d);var p=h.multiply(f.invert());this._nodes.forEach((function(e){var r,o=e.getParent().getAbsoluteTransform(),i=e.getTransform().copy();i.translate(e.offsetX(),e.offsetY());var a=new _te;a.multiply(o.copy().invert()).multiply(p).multiply(o).multiply(i);var s=a.decompose();e.setAttrs(s),n._fire("transform",{evt:t,target:e}),e._fire("transform",{evt:t,target:e}),null===(r=e.getLayer())||void 0===r||r.batchDraw()})),this.rotation(Ite._getRotation(e.rotation)),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}}},{key:"forceUpdate",value:function(){this._resetTransformCache(),this.update()}},{key:"_batchChangeChild",value:function(e,t){this.findOne(e).setAttrs(t)}},{key:"update",value:function(){var e,t=this,n=this._getNodeRect();this.rotation(Ite._getRotation(n.rotation));var r=n.width,o=n.height,i=this.enabledAnchors(),a=this.resizeEnabled(),s=this.padding(),l=this.anchorSize();this.find("._anchor").forEach((function(e){e.setAttrs({width:l,height:l,offsetX:l/2,offsetY:l/2,stroke:t.anchorStroke(),strokeWidth:t.anchorStrokeWidth(),fill:t.anchorFill(),cornerRadius:t.anchorCornerRadius()})})),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:l/2+s,offsetY:l/2+s,visible:a&&i.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:r/2,y:0,offsetY:l/2+s,visible:a&&i.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:r,y:0,offsetX:l/2-s,offsetY:l/2+s,visible:a&&i.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:o/2,offsetX:l/2+s,visible:a&&i.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:r,y:o/2,offsetX:l/2-s,visible:a&&i.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:o,offsetX:l/2+s,offsetY:l/2-s,visible:a&&i.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:r/2,y:o,offsetY:l/2-s,visible:a&&i.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:r,y:o,offsetX:l/2-s,offsetY:l/2-s,visible:a&&i.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:r/2,y:-this.rotateAnchorOffset()*Ite._sign(o)-s,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:r,height:o,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0}),null===(e=this.getLayer())||void 0===e||e.batchDraw()}},{key:"isTransforming",value:function(){return this._transforming}},{key:"stopTransform",value:function(){if(this._transforming){this._removeEvents();var e=this.findOne("."+this._movingAnchorName);e&&e.stopDrag()}}},{key:"destroy",value:function(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),fre.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}},{key:"toObject",value:function(){return gne.prototype.toObject.call(this)}},{key:"getClientRect",value:function(){return this.nodes().length>0?Yt(nn(n.prototype),"getClientRect",this).call(this):{x:0,y:0,width:0,height:0}}}]),n}(fre);moe.prototype.className="Transformer",Cte(moe),Ute.addGetterSetter(moe,"enabledAnchors",poe,(function(e){return e instanceof Array||Ite.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach((function(e){-1===poe.indexOf(e)&&Ite.warn("Unknown anchor name: "+e+". Available names are: "+poe.join(", "))})),e||[]})),Ute.addGetterSetter(moe,"flipEnabled",!0,Hte()),Ute.addGetterSetter(moe,"resizeEnabled",!0),Ute.addGetterSetter(moe,"anchorSize",10,Dte()),Ute.addGetterSetter(moe,"rotateEnabled",!0),Ute.addGetterSetter(moe,"rotationSnaps",[]),Ute.addGetterSetter(moe,"rotateAnchorOffset",50,Dte()),Ute.addGetterSetter(moe,"rotationSnapTolerance",5,Dte()),Ute.addGetterSetter(moe,"borderEnabled",!0),Ute.addGetterSetter(moe,"anchorStroke","rgb(0, 161, 255)"),Ute.addGetterSetter(moe,"anchorStrokeWidth",1,Dte()),Ute.addGetterSetter(moe,"anchorFill","white"),Ute.addGetterSetter(moe,"anchorCornerRadius",0,Dte()),Ute.addGetterSetter(moe,"borderStroke","rgb(0, 161, 255)"),Ute.addGetterSetter(moe,"borderStrokeWidth",1,Dte()),Ute.addGetterSetter(moe,"borderDash"),Ute.addGetterSetter(moe,"keepRatio",!0),Ute.addGetterSetter(moe,"centeredScaling",!1),Ute.addGetterSetter(moe,"ignoreStroke",!1),Ute.addGetterSetter(moe,"padding",0,Dte()),Ute.addGetterSetter(moe,"node"),Ute.addGetterSetter(moe,"nodes"),Ute.addGetterSetter(moe,"boundBoxFunc"),Ute.addGetterSetter(moe,"anchorDragBoundFunc"),Ute.addGetterSetter(moe,"shouldOverdrawWholeArea",!1),Ute.addGetterSetter(moe,"useSingleNodeRotation",!0),Ute.backCompat(moe,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});var yoe=function(e){pn(n,e);var t=Qt(n);function n(){return an(this,n),t.apply(this,arguments)}return on(n,[{key:"_sceneFunc",value:function(e){e.beginPath(),e.arc(0,0,this.radius(),0,Ste.getAngle(this.angle()),this.clockwise()),e.lineTo(0,0),e.closePath(),e.fillStrokeShape(this)}},{key:"getWidth",value:function(){return 2*this.radius()}},{key:"getHeight",value:function(){return 2*this.radius()}},{key:"setWidth",value:function(e){this.radius(e/2)}},{key:"setHeight",value:function(e){this.radius(e/2)}}]),n}(sre);function boe(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}yoe.prototype.className="Wedge",yoe.prototype._centroid=!0,yoe.prototype._attrsAffectingSize=["radius"],Cte(yoe),Ute.addGetterSetter(yoe,"radius",0,Dte()),Ute.addGetterSetter(yoe,"angle",0,Dte()),Ute.addGetterSetter(yoe,"clockwise",!1),Ute.backCompat(yoe,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});var woe=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],koe=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];Ute.addGetterSetter(gne,"blurRadius",0,Dte(),Ute.afterSetFilter);Ute.addGetterSetter(gne,"brightness",0,Dte(),Ute.afterSetFilter);Ute.addGetterSetter(gne,"contrast",0,Dte(),Ute.afterSetFilter);function xoe(e,t,n,r,o){var i=n-t,a=o-r;return 0===i?r+a/2:0===a?r:a*((e-t)/i)+r}Ute.addGetterSetter(gne,"embossStrength",.5,Dte(),Ute.afterSetFilter),Ute.addGetterSetter(gne,"embossWhiteLevel",.5,Dte(),Ute.afterSetFilter),Ute.addGetterSetter(gne,"embossDirection","top-left",null,Ute.afterSetFilter),Ute.addGetterSetter(gne,"embossBlend",!1,null,Ute.afterSetFilter);Ute.addGetterSetter(gne,"enhance",0,Dte(),Ute.afterSetFilter);Ute.addGetterSetter(gne,"hue",0,Dte(),Ute.afterSetFilter),Ute.addGetterSetter(gne,"saturation",0,Dte(),Ute.afterSetFilter),Ute.addGetterSetter(gne,"luminance",0,Dte(),Ute.afterSetFilter);Ute.addGetterSetter(gne,"hue",0,Dte(),Ute.afterSetFilter),Ute.addGetterSetter(gne,"saturation",0,Dte(),Ute.afterSetFilter),Ute.addGetterSetter(gne,"value",0,Dte(),Ute.afterSetFilter);function Soe(e,t,n){var r=4*(n*e.width+t),o=[];return o.push(e.data[r++],e.data[r++],e.data[r++],e.data[r++]),o}function Coe(e,t){return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2))}Ute.addGetterSetter(gne,"kaleidoscopePower",2,Dte(),Ute.afterSetFilter),Ute.addGetterSetter(gne,"kaleidoscopeAngle",0,Dte(),Ute.afterSetFilter);Ute.addGetterSetter(gne,"threshold",0,Dte(),Ute.afterSetFilter);Ute.addGetterSetter(gne,"noise",.2,Dte(),Ute.afterSetFilter);Ute.addGetterSetter(gne,"pixelSize",8,Dte(),Ute.afterSetFilter);Ute.addGetterSetter(gne,"levels",.5,Dte(),Ute.afterSetFilter);Ute.addGetterSetter(gne,"red",0,(function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)})),Ute.addGetterSetter(gne,"green",0,(function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)})),Ute.addGetterSetter(gne,"blue",0,Nte,Ute.afterSetFilter);Ute.addGetterSetter(gne,"red",0,(function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)})),Ute.addGetterSetter(gne,"green",0,(function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)})),Ute.addGetterSetter(gne,"blue",0,Nte,Ute.afterSetFilter),Ute.addGetterSetter(gne,"alpha",1,(function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e}));Ute.addGetterSetter(gne,"threshold",.5,Dte(),Ute.afterSetFilter);var _oe=kre.Util._assign(kre,{Arc:xre,Arrow:Pre,Circle:Lre,Ellipse:Ore,Image:Are,Label:zre,Tag:jre,Line:_re,Path:Ere,Rect:Bre,RegularPolygon:Fre,Ring:Vre,Sprite:Wre,Star:Ure,Text:roe,TextPath:soe,Transformer:moe,Wedge:yoe,Filters:{Blur:function(e){var t=Math.round(this.blurRadius());t>0&&function(e,t){var n,r,o,i,a,s,l,u,c,d,f,h,p,v,g,m,y,b,w,k,x,S,C,_,E=e.data,P=e.width,L=e.height,O=t+t+1,A=P-1,M=L-1,T=t+1,I=T*(T+1)/2,R=new boe,N=null,D=R,z=null,j=null,B=woe[t],F=koe[t];for(o=1;o>F,0!==C?(C=255/C,E[s]=(u*B>>F)*C,E[s+1]=(c*B>>F)*C,E[s+2]=(d*B>>F)*C):E[s]=E[s+1]=E[s+2]=0,u-=h,c-=p,d-=v,f-=g,h-=z.r,p-=z.g,v-=z.b,g-=z.a,i=l+((i=n+t+1)>F,C>0?(C=255/C,E[i]=(u*B>>F)*C,E[i+1]=(c*B>>F)*C,E[i+2]=(d*B>>F)*C):E[i]=E[i+1]=E[i+2]=0,u-=h,c-=p,d-=v,f-=g,h-=z.r,p-=z.g,v-=z.b,g-=z.a,i=n+((i=r+T)255?255:i,a=(a*=255)<0?0:a>255?255:a,s=(s*=255)<0?0:s>255?255:s,r[t]=i,r[t+1]=a,r[t+2]=s},Emboss:function(e){var t=10*this.embossStrength(),n=255*this.embossWhiteLevel(),r=this.embossDirection(),o=this.embossBlend(),i=0,a=0,s=e.data,l=e.width,u=e.height,c=4*l,d=u;switch(r){case"top-left":i=-1,a=-1;break;case"top":i=-1,a=0;break;case"top-right":i=-1,a=1;break;case"right":i=0,a=1;break;case"bottom-right":i=1,a=1;break;case"bottom":i=1,a=0;break;case"bottom-left":i=1,a=-1;break;case"left":i=0,a=-1;break;default:Ite.error("Unknown emboss direction: "+r)}do{var f=(d-1)*c,h=i;d+h<1&&(h=0),d+h>u&&(h=0);var p=(d-1+h)*l*4,v=l;do{var g=f+4*(v-1),m=a;v+m<1&&(m=0),v+m>l&&(m=0);var y=p+4*(v-1+m),b=s[g]-s[y],w=s[g+1]-s[y+1],k=s[g+2]-s[y+2],x=b,S=x>0?x:-x;if((w>0?w:-w)>S&&(x=w),(k>0?k:-k)>S&&(x=k),x*=t,o){var C=s[g]+x,_=s[g+1]+x,E=s[g+2]+x;s[g]=C>255?255:C<0?0:C,s[g+1]=_>255?255:_<0?0:_,s[g+2]=E>255?255:E<0?0:E}else{var P=n-x;P<0?P=0:P>255&&(P=255),s[g]=s[g+1]=s[g+2]=P}}while(--v)}while(--d)},Enhance:function(e){var t,n,r,o,i=e.data,a=i.length,s=i[0],l=s,u=i[1],c=u,d=i[2],f=d,h=this.enhance();if(0!==h){for(o=0;ol&&(l=t),(n=i[o+1])c&&(c=n),(r=i[o+2])f&&(f=r);var p,v,g,m,y,b,w,k,x;for(l===s&&(l=255,s=0),c===u&&(c=255,u=0),f===d&&(f=255,d=0),h>0?(v=l+h*(255-l),g=s-h*(s-0),y=c+h*(255-c),b=u-h*(u-0),k=f+h*(255-f),x=d-h*(d-0)):(v=l+h*(l-(p=.5*(l+s))),g=s+h*(s-p),y=c+h*(c-(m=.5*(c+u))),b=u+h*(u-m),k=f+h*(f-(w=.5*(f+d))),x=d+h*(d-w)),o=0;om?a:m;var y,b,w,k,x=c,S=u,C=360/S*Math.PI/180;for(b=0;bc&&(b=y,w=0,k=-1),n=0;nb?l:b;var w,k,x,S=f,C=d,_=n.polarRotation||0;for(o=0;o=0&&h=0&&p=0&&h=0&&p=1020?255:0}return a}(t,e.width,e.height),t=function(e,t,n){for(var r=[1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9],o=Math.round(Math.sqrt(r.length)),i=Math.floor(o/2),a=[],s=0;s=0&&h=0&&p=g))for(n=c;n=m||(o+=w[(r=4*(g*n+t))+0],i+=w[r+1],a+=w[r+2],s+=w[r+3],p+=1);for(o/=p,i/=p,a/=p,s/=p,t=l;t=g))for(n=c;n=m||(w[(r=4*(g*n+t))+0]=o,w[r+1]=i,w[r+2]=a,w[r+3]=s)}},Posterize:function(e){var t,n=Math.round(254*this.levels())+1,r=e.data,o=r.length,i=255/n;for(t=0;t127&&(l=255-l),u>127&&(u=255-u),c>127&&(c=255-c),t[s]=l,t[s+1]=u,t[s+2]=c}while(--a)}while(--o)},Threshold:function(e){var t,n=255*this.threshold(),r=e.data,o=r.length;for(t=0;t"),t.document.write(n.outerHTML),t.document.write("

")}))}([{base64:re,caption:"mask sent as init_mask"},{base64:ae,caption:"image sent as init_img"}]),n.scale(oe),G.init_img=ae,G.progress_images=!1,"none"!==ee&&(G.inpaint_width=te.width,G.inpaint_height=te.height),G.seam_size=O,G.seam_blur=P,G.seam_strength=M,G.seam_steps=A,G.tile_size=B,G.infill_method=w,G.force_outpaint=!1}return N?(G.variation_amount=F,I&&(G.with_variations=(t=I.split(",").map((function(e){return e.split(":")})),t.map((function(e){return[parseInt(e[0],10),parseFloat(e[1])]}))))):G.variation_amount=0,U&&(G.enable_image_debugging=U),{generationParameters:G,esrganParameters:q,facetoolParameters:Y}},Toe=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g,Ioe=/\b(?:[A-Z]{1,3}[A-Z][TC])(?:[-+]\d{4})?|((?:Australian )?(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time)\b/g,Roe=/[^-+\dA-Z]/g;function Noe(e,t,n,r){if(1!==arguments.length||"string"!=typeof e||/\d/.test(e)||(t=e,e=void 0),(e=e||0===e?e:new Date)instanceof Date||(e=new Date(e)),isNaN(e))throw TypeError("Invalid date");var o=(t=String(zoe[t]||t||zoe.default)).slice(0,4);"UTC:"!==o&&"GMT:"!==o||(t=t.slice(4),n=!0,"GMT:"===o&&(r=!0));var i=function(){return n?"getUTC":"get"},a=function(){return e[i()+"Date"]()},s=function(){return e[i()+"Day"]()},l=function(){return e[i()+"Month"]()},u=function(){return e[i()+"FullYear"]()},c=function(){return e[i()+"Hours"]()},d=function(){return e[i()+"Minutes"]()},f=function(){return e[i()+"Seconds"]()},h=function(){return e[i()+"Milliseconds"]()},p=function(){return n?0:e.getTimezoneOffset()},v=function(){return Hoe(e)},g=function(){return Voe(e)},m={d:function(){return a()},dd:function(){return Boe(a())},ddd:function(){return joe.dayNames[s()]},DDD:function(){return Foe({y:u(),m:l(),d:a(),_:i(),dayName:joe.dayNames[s()],short:!0})},dddd:function(){return joe.dayNames[s()+7]},DDDD:function(){return Foe({y:u(),m:l(),d:a(),_:i(),dayName:joe.dayNames[s()+7]})},m:function(){return l()+1},mm:function(){return Boe(l()+1)},mmm:function(){return joe.monthNames[l()]},mmmm:function(){return joe.monthNames[l()+12]},yy:function(){return String(u()).slice(2)},yyyy:function(){return Boe(u(),4)},h:function(){return c()%12||12},hh:function(){return Boe(c()%12||12)},H:function(){return c()},HH:function(){return Boe(c())},M:function(){return d()},MM:function(){return Boe(d())},s:function(){return f()},ss:function(){return Boe(f())},l:function(){return Boe(h(),3)},L:function(){return Boe(Math.floor(h()/10))},t:function(){return c()<12?joe.timeNames[0]:joe.timeNames[1]},tt:function(){return c()<12?joe.timeNames[2]:joe.timeNames[3]},T:function(){return c()<12?joe.timeNames[4]:joe.timeNames[5]},TT:function(){return c()<12?joe.timeNames[6]:joe.timeNames[7]},Z:function(){return r?"GMT":n?"UTC":Woe(e)},o:function(){return(p()>0?"-":"+")+Boe(100*Math.floor(Math.abs(p())/60)+Math.abs(p())%60,4)},p:function(){return(p()>0?"-":"+")+Boe(Math.floor(Math.abs(p())/60),2)+":"+Boe(Math.floor(Math.abs(p())%60),2)},S:function(){return["th","st","nd","rd"][a()%10>3?0:(a()%100-a()%10!=10)*a()%10]},W:function(){return v()},WW:function(){return Boe(v())},N:function(){return g()}};return t.replace(Toe,(function(e){return e in m?m[e]():e.slice(1,e.length-1)}))}var Doe,zoe={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",paddedShortDate:"mm/dd/yyyy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:sso",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",expiresHeaderFormat:"ddd, dd mmm yyyy HH:MM:ss Z"},joe={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"],timeNames:["a","p","am","pm","A","P","AM","PM"]},Boe=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return String(e).padStart(t,"0")},Foe=function(e){var t=e.y,n=e.m,r=e.d,o=e._,i=e.dayName,a=e.short,s=void 0!==a&&a,l=new Date,u=new Date;u.setDate(u[o+"Date"]()-1);var c=new Date;c.setDate(c[o+"Date"]()+1);return l[o+"FullYear"]()===t&&l[o+"Month"]()===n&&l[o+"Date"]()===r?s?"Tdy":"Today":u[o+"FullYear"]()===t&&u[o+"Month"]()===n&&u[o+"Date"]()===r?s?"Ysd":"Yesterday":c[o+"FullYear"]()===t&&c[o+"Month"]()===n&&c[o+"Date"]()===r?s?"Tmw":"Tomorrow":i},Hoe=function(e){var t=new Date(e.getFullYear(),e.getMonth(),e.getDate());t.setDate(t.getDate()-(t.getDay()+6)%7+3);var n=new Date(t.getFullYear(),0,4);n.setDate(n.getDate()-(n.getDay()+6)%7+3);var r=t.getTimezoneOffset()-n.getTimezoneOffset();t.setHours(t.getHours()-r);var o=(t-n)/6048e5;return 1+Math.floor(o)},Voe=function(e){var t=e.getDay();return 0===t&&(t=7),t},Woe=function(e){return(String(e).match(Ioe)||[""]).pop().replace(Roe,"").replace(/GMT\+0000/g,"UTC")},Uoe=new Uint8Array(16);function Goe(){if(!Doe&&!(Doe="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Doe(Uoe)}for(var qoe=[],Yoe=0;Yoe<256;++Yoe)qoe.push((Yoe+256).toString(16).slice(1));var Zoe={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Xoe(e,t,n){if(Zoe.randomUUID&&!t&&!e)return Zoe.randomUUID();var r=(e=e||{}).random||(e.rng||Goe)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(qoe[e[t+0]]+qoe[e[t+1]]+qoe[e[t+2]]+qoe[e[t+3]]+"-"+qoe[e[t+4]]+qoe[e[t+5]]+"-"+qoe[e[t+6]]+qoe[e[t+7]]+"-"+qoe[e[t+8]]+qoe[e[t+9]]+"-"+qoe[e[t+10]]+qoe[e[t+11]]+qoe[e[t+12]]+qoe[e[t+13]]+qoe[e[t+14]]+qoe[e[t+15]]).toLowerCase()}(r)}var $oe,Koe=b$("socketio/generateImage"),Qoe=b$("socketio/runESRGAN"),Joe=b$("socketio/runFacetool"),eie=b$("socketio/deleteImage"),tie=b$("socketio/requestImages"),nie=b$("socketio/requestNewImages"),rie=b$("socketio/cancelProcessing"),oie=b$("socketio/requestSystemConfig"),iie=b$("socketio/searchForModels"),aie=b$("socketio/addNewModel"),sie=b$("socketio/deleteModel"),lie=b$("socketio/requestModelChange"),uie=b$("socketio/saveStagingAreaImageToGallery"),cie=b$("socketio/requestEmptyTempFolder"),die=function(){var e=fte(new URL(window.location.href).origin,{timeout:6e4,path:"".concat(window.location.pathname,"socket.io")}),t=!1;return function(n){return function(r){return function(o){var i=function(e){var t=e.dispatch,n=e.getState;return{onConnect:function(){try{t(d8(!0)),t(v8(A7.t("common:statusConnected"))),t(oie());var e=n().gallery;e.categories.result.latest_mtime?t(nie("result")):t(tie("result")),e.categories.user.latest_mtime?t(nie("user")):t(tie("user"))}catch(Dhe){console.error(Dhe)}},onDisconnect:function(){try{t(d8(!1)),t(v8(A7.t("common:statusDisconnected"))),t(u8({timestamp:Noe(new Date,"isoDateTime"),message:"Disconnected from server",level:"warning"}))}catch(Dhe){console.error(Dhe)}},onGenerationResult:function(e){try{var r=n(),o=r.ui.activeTab,i=r.postprocessing.shouldLoopback,a=(e.boundingBox,e.generationMode),s=sn(e,ct),l=un({uuid:Xoe()},s);if(["txt2img","img2img"].includes(a)&&t(Z3({category:"result",image:un(un({},l),{},{category:"result"})})),"unifiedCanvas"===a&&e.boundingBox){var u=e.boundingBox;t(q5({image:un(un({},l),{},{category:"temp"}),boundingBox:u})),r.canvas.shouldAutoSave&&t(Z3({image:un(un({},l),{},{category:"result"}),category:"result"}))}i&&"img2img"===R8[o]&&t(M4(l)),t(X3()),t(u8({timestamp:Noe(new Date,"isoDateTime"),message:"Image generated: ".concat(e.url)}))}catch(Dhe){console.error(Dhe)}},onIntermediateResult:function(e){try{t(J3(un(un({uuid:Xoe()},e),{},{category:"result"}))),e.isBase64||t(u8({timestamp:Noe(new Date,"isoDateTime"),message:"Intermediate image generated: ".concat(e.url)}))}catch(Dhe){console.error(Dhe)}},onPostprocessingResult:function(e){try{t(Z3({category:"result",image:un(un({uuid:Xoe()},e),{},{category:"result"})})),t(u8({timestamp:Noe(new Date,"isoDateTime"),message:"Postprocessed: ".concat(e.url)}))}catch(Dhe){console.error(Dhe)}},onProgressUpdate:function(e){try{t(l8(!0)),t(p8(e))}catch(Dhe){console.error(Dhe)}},onError:function(e){var n=e.message;e.additionalData;try{t(u8({timestamp:Noe(new Date,"isoDateTime"),message:"Server error: ".concat(n),level:"error"})),t(b8()),t(X3())}catch(Dhe){console.error(Dhe)}},onGalleryImages:function(e){var n=e.images,r=e.areMoreImagesAvailable,o=e.category,i=n.map((function(e){return un({uuid:Xoe()},e)}));t(Q3({images:i,areMoreImagesAvailable:r,category:o})),t(u8({timestamp:Noe(new Date,"isoDateTime"),message:"Loaded ".concat(n.length," images")}))},onProcessingCanceled:function(){t(y8());var e=n().gallery.intermediateImage;e&&(e.isBase64||(t(Z3({category:"result",image:e})),t(u8({timestamp:Noe(new Date,"isoDateTime"),message:"Intermediate image saved: ".concat(e.url)}))),t(X3())),t(u8({timestamp:Noe(new Date,"isoDateTime"),message:"Processing canceled",level:"warning"}))},onImageDeleted:function(e){var r=e.url;t($3(e));var o=n().generation,i=o.initialImage,a=o.maskPath;i!==r&&(null==i?void 0:i.url)!==r||t(C4()),a===r&&t(I4("")),t(u8({timestamp:Noe(new Date,"isoDateTime"),message:"Image deleted: ".concat(r)}))},onSystemConfig:function(e){t(g8(e)),e.infill_methods.includes("patchmatch")||t(A4(e.infill_methods[0]))},onFoundModels:function(e){var n=e.search_folder,r=e.found_models;t(A8(n)),t(M8(r))},onNewModelAdded:function(e){var n=e.new_model_name,r=e.model_list,o=e.update;t(k8(r)),t(l8(!1)),t(u8({timestamp:Noe(new Date,"isoDateTime"),message:"Model Added: ".concat(n),level:"info"})),t(P8({title:o?"".concat(A7.t("modelmanager:modelUpdated"),": ").concat(n):"".concat(A7.t("modelmanager:modelAdded"),": ").concat(n),status:"success",duration:2500,isClosable:!0}))},onModelDeleted:function(e){var n=e.deleted_model_name,r=e.model_list;t(k8(r)),t(l8(!1)),t(u8({timestamp:Noe(new Date,"isoDateTime"),message:"".concat(A7.t("modelmanager:modelAdded"),": ").concat(n),level:"info"})),t(P8({title:"".concat(A7.t("modelmanager:modelEntryDeleted"),": ").concat(n),status:"success",duration:2500,isClosable:!0}))},onModelChanged:function(e){var n=e.model_name,r=e.model_list;t(k8(r)),t(v8(A7.t("common:statusModelChanged"))),t(l8(!1)),t(x8(!0)),t(u8({timestamp:Noe(new Date,"isoDateTime"),message:"Model changed: ".concat(n),level:"info"}))},onModelChangeFailed:function(e){var n=e.model_name,r=e.model_list;t(k8(r)),t(l8(!1)),t(x8(!0)),t(b8()),t(u8({timestamp:Noe(new Date,"isoDateTime"),message:"Model change failed: ".concat(n),level:"error"}))},onTempFolderEmptied:function(){t(P8({title:A7.t("toast:tempFoldersEmptied"),status:"success",duration:2500,isClosable:!0}))}}}(n),a=i.onConnect,s=i.onDisconnect,l=i.onError,u=i.onPostprocessingResult,c=i.onGenerationResult,d=i.onIntermediateResult,f=i.onProgressUpdate,h=i.onGalleryImages,p=i.onProcessingCanceled,v=i.onImageDeleted,g=i.onSystemConfig,m=i.onModelChanged,y=i.onFoundModels,b=i.onNewModelAdded,w=i.onModelDeleted,k=i.onModelChangeFailed,x=i.onTempFolderEmptied,S=function(e,t){var n=e.dispatch,r=e.getState;return{emitGenerateImage:function(e){n(l8(!0));var o=r(),i=o.generation,a=o.postprocessing,s=o.system,l={generationMode:e,generationState:i,postprocessingState:a,canvasState:o.canvas,systemState:s};n(E8());var u=Moe(l),c=u.generationParameters,d=u.esrganParameters,f=u.facetoolParameters;t.emit("generateImage",c,d,f),c.init_mask&&(c.init_mask=c.init_mask.substr(0,64).concat("...")),c.init_img&&(c.init_img=c.init_img.substr(0,64).concat("...")),n(u8({timestamp:Noe(new Date,"isoDateTime"),message:"Image generation requested: ".concat(JSON.stringify(un(un(un({},c),d),f)))}))},emitRunESRGAN:function(e){n(l8(!0));var o=r().postprocessing,i={upscale:[o.upscalingLevel,o.upscalingStrength]};t.emit("runPostprocessing",e,un({type:"esrgan"},i)),n(u8({timestamp:Noe(new Date,"isoDateTime"),message:"ESRGAN upscale requested: ".concat(JSON.stringify(un({file:e.url},i)))}))},emitRunFacetool:function(e){n(l8(!0));var o=r().postprocessing,i=o.facetoolType,a=o.facetoolStrength,s=o.codeformerFidelity,l={facetool_strength:a};"codeformer"===i&&(l.codeformer_fidelity=s),t.emit("runPostprocessing",e,un({type:i},l)),n(u8({timestamp:Noe(new Date,"isoDateTime"),message:"Face restoration (".concat(i,") requested: ").concat(JSON.stringify(un({file:e.url},l)))}))},emitDeleteImage:function(e){var r=e.url,o=e.uuid,i=e.category,a=e.thumbnail;n($3(e)),t.emit("deleteImage",r,a,o,i)},emitRequestImages:function(e){var n=r().gallery.categories[e].earliest_mtime;t.emit("requestImages",e,n)},emitRequestNewImages:function(e){var n=r().gallery.categories[e].latest_mtime;t.emit("requestLatestImages",e,n)},emitCancelProcessing:function(){t.emit("cancel")},emitRequestSystemConfig:function(){t.emit("requestSystemConfig")},emitSearchForModels:function(e){t.emit("searchForModels",e)},emitAddNewModel:function(e){t.emit("addNewModel",e)},emitDeleteModel:function(e){t.emit("deleteModel",e)},emitRequestModelChange:function(e){n(S8()),t.emit("requestModelChange",e)},emitSaveStagingAreaImageToGallery:function(e){t.emit("requestSaveStagingAreaImageToGallery",e)},emitRequestEmptyTempFolder:function(){t.emit("requestEmptyTempFolder")}}}(n,e),C=S.emitGenerateImage,_=S.emitRunESRGAN,E=S.emitRunFacetool,P=S.emitDeleteImage,L=S.emitRequestImages,O=S.emitRequestNewImages,A=S.emitCancelProcessing,M=S.emitRequestSystemConfig,T=S.emitSearchForModels,I=S.emitAddNewModel,R=S.emitDeleteModel,N=S.emitRequestModelChange,D=S.emitSaveStagingAreaImageToGallery,z=S.emitRequestEmptyTempFolder;switch(t||(e.on("connect",(function(){return a()})),e.on("disconnect",(function(){return s()})),e.on("error",(function(e){return l(e)})),e.on("generationResult",(function(e){return c(e)})),e.on("postprocessingResult",(function(e){return u(e)})),e.on("intermediateResult",(function(e){return d(e)})),e.on("progressUpdate",(function(e){return f(e)})),e.on("galleryImages",(function(e){return h(e)})),e.on("processingCanceled",(function(){p()})),e.on("imageDeleted",(function(e){v(e)})),e.on("systemConfig",(function(e){g(e)})),e.on("foundModels",(function(e){y(e)})),e.on("newModelAdded",(function(e){b(e)})),e.on("modelDeleted",(function(e){w(e)})),e.on("modelChanged",(function(e){m(e)})),e.on("modelChangeFailed",(function(e){k(e)})),e.on("tempFolderEmptied",(function(){x()})),t=!0),o.type){case"socketio/generateImage":C(o.payload);break;case"socketio/runESRGAN":_(o.payload);break;case"socketio/runFacetool":E(o.payload);break;case"socketio/deleteImage":P(o.payload);break;case"socketio/requestImages":L(o.payload);break;case"socketio/requestNewImages":O(o.payload);break;case"socketio/cancelProcessing":A();break;case"socketio/requestSystemConfig":M();break;case"socketio/searchForModels":T(o.payload);break;case"socketio/addNewModel":I(o.payload);break;case"socketio/deleteModel":R(o.payload);break;case"socketio/requestModelChange":N(o.payload);break;case"socketio/saveStagingAreaImageToGallery":D(o.payload);break;case"socketio/requestEmptyTempFolder":z()}r(o)}}}},fie=["cursorPosition","isCanvasInitialized","doesCanvasNeedScaling"].map((function(e){return"canvas.".concat(e)})),hie=["currentIteration","currentStatus","currentStep","isCancelable","isConnected","isESRGANAvailable","isGFPGANAvailable","isProcessing","socketId","totalIterations","totalSteps","openModel"].map((function(e){return"system.".concat(e)})),pie=["categories","currentCategory","currentImage","currentImageUuid","shouldAutoSwitchToNewImages","shouldHoldGalleryOpen","intermediateImage"].map((function(e){return"gallery.".concat(e)})),vie=UX({generation:J4,postprocessing:h6,gallery:f4,system:I8,canvas:G3,ui:Z8,lightbox:v4}),gie=function(e,t){var n=void 0!==e.version?e.version:-1;e.debug;var r=void 0===e.stateReconciler?j$:e.stateReconciler,o=e.getStoredState||H$,i=void 0!==e.timeout?e.timeout:5e3,a=null,s=!1,l=!0,u=function(e){return e._persist.rehydrated&&a&&!l&&a.update(e),e};return function(c,d){var f=c||{},h=f._persist,p=Y$(f,["_persist"]);if(d.type===T$){var v=!1,g=function(t,n){v||(d.rehydrate(e.key,t,n),v=!0)};if(i&&setTimeout((function(){!v&&g(void 0,new Error('redux-persist: persist timed out for persist key "'.concat(e.key,'"')))}),i),l=!1,a||(a=B$(e)),h)return G$({},t(p,d),{_persist:h});if("function"!=typeof d.rehydrate||"function"!=typeof d.register)throw new Error("redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.");return d.register(e.key),o(e).then((function(t){var r=e.migrate||function(e,t){return Promise.resolve(e)};r(t,n).then((function(e){g(e)}),(function(e){g(void 0,e)}))}),(function(e){g(void 0,e)})),G$({},t(p,d),{_persist:{version:n,rehydrated:!1}})}if(d.type===I$)return s=!0,d.result(function(e){var t=e.storage,n="".concat(void 0!==e.keyPrefix?e.keyPrefix:L$).concat(e.key);return t.removeItem(n,W$)}(e)),G$({},t(p,d),{_persist:h});if(d.type===O$)return d.result(a&&a.flush()),G$({},t(p,d),{_persist:h});if(d.type===M$)l=!0;else if(d.type===A$){if(s)return G$({},p,{_persist:G$({},h,{rehydrated:!0})});if(d.key===e.key){var m=t(p,d),y=d.payload,b=G$({},!1!==r&&void 0!==y?r(y,c,m,e):m,{_persist:G$({},h,{rehydrated:!0})});return u(b)}}if(!h)return t(c,d);var w=t(p,d);return w===p?c:u(G$({},w,{_persist:h}))}}(uK.getPersistConfig({key:"root",storage:sK,rootReducer:vie,blacklist:[].concat(cn(fie),cn(hie),cn(pie)),debounce:300}),vie),mie=function(e){var t,n=y$(),r=e||{},o=r.reducer,i=void 0===o?void 0:o,a=r.middleware,s=void 0===a?n():a,l=r.devTools,u=void 0===l||l,c=r.preloadedState,d=void 0===c?void 0:c,f=r.enhancers,h=void 0===f?void 0:f;if("function"==typeof i)t=i;else{if(!function(e){if("object"!==kn(e)||null===e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;for(var n=t;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return t===n}(i))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');t=UX(i)}var p=s;"function"==typeof p&&(p=p(n));var v=qX.apply(void 0,p),g=GX;u&&(g=v$(h$({trace:!1},"object"===kn(u)&&u)));var m=[v];return Array.isArray(h)?m=i$([v],h):"function"==typeof h&&(m=h(m)),WX(t,d,g.apply(void 0,m))}({reducer:gie,middleware:function(e){return e({immutableCheck:!1,serializableCheck:!1}).concat(die())},devTools:{actionsDenylist:["canvas/setCursorPosition","canvas/setStageCoordinates","canvas/setStageScale","canvas/setIsDrawing","canvas/setBoundingBoxCoordinates","canvas/setBoundingBoxDimensions","canvas/setIsDrawing","canvas/addPointToCurrentLine"]}}),yie=function(e,t,n){var r=n||!1,o=WX(J$,Q$,t&&t.enhancer?t.enhancer:void 0),i=function(e){o.dispatch({type:R$,key:e})},a=function(t,n,i){var a={type:A$,payload:n,err:i,key:t};e.dispatch(a),o.dispatch(a),r&&s.getState().bootstrapped&&(r(),r=!1)},s=$$({},o,{purge:function(){var t=[];return e.dispatch({type:I$,result:function(e){t.push(e)}}),Promise.all(t)},flush:function(){var t=[];return e.dispatch({type:O$,result:function(e){t.push(e)}}),Promise.all(t)},pause:function(){e.dispatch({type:M$})},persist:function(){e.dispatch({type:T$,register:i,rehydrate:a})}});return t&&t.manualPersist||s.persist(),s}(mie),bie=cr.createContext(null),wie=OZ,kie=nZ,xie=function(){return{setOpenUploader:function(e){e&&($oe=e)},openUploader:$oe}};var Sie=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this};var Cie=function(e){return this.__data__.has(e)},_ie=RJ,Eie=Sie,Pie=Cie;function Lie(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new _ie;++ts))return!1;var u=i.get(e),c=i.get(t);if(u&&c)return u==t&&c==e;var d=-1,f=!0,h=2&n?new Mie:void 0;for(i.set(e,t),i.set(t,e);++d-1}})),Hle=Ile((function(e,t){var n=zle();t.exports=function(e,t){var r=this.__data__,o=n(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}})),Vle=Ile((function(e,t){var n=Nle(),r=jle(),o=Ble(),i=Fle(),a=Hle();function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++tc))return!1;var f=l.get(e),h=l.get(t);if(f&&h)return f==t&&h==e;var p=-1,v=!0,g=2&i?new n:void 0;for(l.set(e,t),l.set(t,e);++p-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991}})),Xue=Ile((function(e,t){var n=Qle(),r=Zue(),o=Vue(),i={};i["[object Float32Array]"]=i["[object Float64Array]"]=i["[object Int8Array]"]=i["[object Int16Array]"]=i["[object Int32Array]"]=i["[object Uint8Array]"]=i["[object Uint8ClampedArray]"]=i["[object Uint16Array]"]=i["[object Uint32Array]"]=!0,i["[object Arguments]"]=i["[object Array]"]=i["[object ArrayBuffer]"]=i["[object Boolean]"]=i["[object DataView]"]=i["[object Date]"]=i["[object Error]"]=i["[object Function]"]=i["[object Map]"]=i["[object Number]"]=i["[object Object]"]=i["[object RegExp]"]=i["[object Set]"]=i["[object String]"]=i["[object WeakMap]"]=!1,t.exports=function(e){return o(e)&&r(e.length)&&!!i[n(e)]}})),$ue=Ile((function(e,t){t.exports=function(e){return function(t){return e(t)}}})),Kue=Ile((function(e,t){var n=Yle(),r="object"==kn(e)&&e&&!e.nodeType&&e,o=r&&"object"==kn(t)&&t&&!t.nodeType&&t,i=o&&o.exports===r&&n.process,a=function(){try{return o&&o.require&&o.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();t.exports=a})),Que=Ile((function(e,t){var n=Xue(),r=$ue(),o=Kue(),i=o&&o.isTypedArray,a=i?r(i):n;t.exports=a})),Jue=Ile((function(e,t){var n=Hue(),r=Uue(),o=Due(),i=que(),a=Yue(),s=Que(),l=Object.prototype.hasOwnProperty;t.exports=function(e,t){var u=o(e),c=!u&&r(e),d=!u&&!c&&i(e),f=!u&&!c&&!d&&s(e),h=u||c||d||f,p=h?n(e.length,String):[],v=p.length;for(var g in e)(t||l.call(e,g))&&(!h||!("length"==g||d&&("offset"==g||"parent"==g)||f&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||a(g,v)))&&p.push(g);return p}})),ece=Ile((function(e,t){var n=Object.prototype;t.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}})),tce=Ile((function(e,t){t.exports=function(e,t){return function(n){return e(t(n))}}})),nce=Ile((function(e,t){var n=tce()(Object.keys,Object);t.exports=n})),rce=Ile((function(e,t){var n=ece(),r=nce(),o=Object.prototype.hasOwnProperty;t.exports=function(e){if(!n(e))return r(e);var t=[];for(var i in Object(e))o.call(e,i)&&"constructor"!=i&&t.push(i);return t}})),oce=Ile((function(e,t){var n=eue(),r=Zue();t.exports=function(e){return null!=e&&r(e.length)&&!n(e)}})),ice=Ile((function(e,t){var n=Jue(),r=rce(),o=oce();t.exports=function(e){return o(e)?n(e):r(e)}})),ace=Ile((function(e,t){var n=zue(),r=Fue(),o=ice();t.exports=function(e){return n(e,o,r)}})),sce=Ile((function(e,t){var n=ace(),r=Object.prototype.hasOwnProperty;t.exports=function(e,t,o,i,a,s){var l=1&o,u=n(e),c=u.length;if(c!=n(t).length&&!l)return!1;for(var d=c;d--;){var f=u[d];if(!(l?f in t:r.call(t,f)))return!1}var h=s.get(e),p=s.get(t);if(h&&p)return h==t&&p==e;var v=!0;s.set(e,t),s.set(t,e);for(var g=l;++d1&&void 0!==arguments[1]?arguments[1]:",";return"string"==typeof e?e.split(t):e}function bce(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"+",n=e.toLocaleLowerCase().split(t).map((function(e){return e.trim()})).map((function(e){return mce[e]||e})),r={alt:n.includes("alt"),ctrl:n.includes("ctrl"),shift:n.includes("shift"),meta:n.includes("meta"),mod:n.includes("mod")},o=n.filter((function(e){return!gce.includes(e)}));return un(un({},r),{},{keys:o})}function wce(e){var t=e.target,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t&&t.tagName;return n instanceof Array?Boolean(r&&n&&n.some((function(e){return e.toLowerCase()===r.toLowerCase()}))):Boolean(r&&n&&!0===n)}var kce=cr.createContext(void 0),xce=cr.createContext({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),Sce=Rle(vce());var Cce=function(e){e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()};function _ce(e,t,n,r){var o=cr.useRef(null),i=cr.useRef(new Set).current,a=n instanceof Array?r instanceof Array?void 0:r:n,s=n instanceof Array?n:r instanceof Array?r:[],l=cr.useCallback(t,cn(s)),u=function(e){var t=cr.useRef(void 0);return(0,Sce.default)(t.current,e)||(t.current=e),t.current}(a),c=cr.useContext(xce).enabledScopes,d=cr.useContext(kce);return cr.useLayoutEffect((function(){if(!1!==(null==u?void 0:u.enabled)&&function(e,t){return 0===e.length&&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 '),!0):!t||e.some((function(e){return t.includes(e)}))||e.includes("*")}(c,null==u?void 0:u.scopes)){var t=function(t){if(!function(e){return wce(e,["input","textarea","select"])}(t)||wce(t,null==u?void 0:u.enableOnFormTags)){var n;if(null!==o.current&&document.activeElement!==o.current&&!o.current.contains(document.activeElement))return void Cce(t);(null===(n=t.target)||void 0===n?void 0:n.isContentEditable)&&(null==u||!u.enableOnContentEditable)||yce(e,null==u?void 0:u.splitKey).forEach((function(e){var n,r=bce(e,null==u?void 0:u.combinationKey);if(function(e,t,n){var r=t.alt,o=t.ctrl,i=t.meta,a=t.mod,s=t.shift,l=t.keys,u=e.altKey,c=e.ctrlKey,d=e.metaKey,f=e.shiftKey,h=e.key,p=e.code.toLowerCase().replace("key",""),v=h.toLowerCase();if(u!==r&&"alt"!==v||f!==s&&"shift"!==v)return!1;if(a){if(!d&&!c)return!1}else if(d!==i&&"meta"!==p||c!==o&&"ctrl"!==p)return!1;return!(!l||1!==l.length||!l.includes(v)&&!l.includes(p))||(l?l.every((function(e){return n.has(e)})):!l)}(t,r,i)||null!==(n=r.keys)&&void 0!==n&&n.includes("*")){if(function(e,t,n){("function"==typeof n&&n(e,t)||!0===n)&&e.preventDefault()}(t,r,null==u?void 0:u.preventDefault),!function(e,t,n){return"function"==typeof n?n(e,t):!0===n||void 0===n}(t,r,null==u?void 0:u.enabled))return void Cce(t);l(t,r)}}))}},n=function(e){i.add(e.key.toLowerCase()),(void 0===(null==u?void 0:u.keydown)&&!0!==(null==u?void 0:u.keyup)||(null==u?void 0:u.keydown))&&t(e)},r=function(e){"meta"!==e.key.toLowerCase()?i.delete(e.key.toLowerCase()):i.clear(),(null==u?void 0:u.keyup)&&t(e)};return(o.current||document).addEventListener("keyup",r),(o.current||document).addEventListener("keydown",n),d&&yce(e,null==u?void 0:u.splitKey).forEach((function(e){return d.addHotkey(bce(e,null==u?void 0:u.combinationKey))})),function(){(o.current||document).removeEventListener("keyup",r),(o.current||document).removeEventListener("keydown",n),d&&yce(e,null==u?void 0:u.splitKey).forEach((function(e){return d.removeHotkey(bce(e,null==u?void 0:u.combinationKey))}))}}}),[e,l,u,c]),o}Rle(vce());var Ece=new Set;window.addEventListener("DOMContentLoaded",(function(){document.addEventListener("keydown",(function(e){!function(e){(Array.isArray(e)?e:[e]).forEach((function(e){return Ece.add(bce(e))}))}(e.key)})),document.addEventListener("keyup",(function(e){!function(e){(Array.isArray(e)?e:[e]).forEach((function(e){var t,n=bce(e),r=xn(Ece);try{for(r.s();!(t=r.n()).done;){var o,i=t.value;(null===(o=i.keys)||void 0===o?void 0:o.every((function(e){var t;return null===(t=n.keys)||void 0===t?void 0:t.includes(e)})))&&Ece.delete(i)}}catch(COe){r.e(COe)}finally{r.f()}}))}(e.key)}))}));var Pce={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Lce=qr.createContext&&qr.createContext(Pce),Oce=globalThis&&globalThis.__assign||function(){return Oce=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0||"unifiedCanvas"===t&&n.isProcessing})),Ade=function(e){return e.canvas.layerState.objects.find(B5)},Mde=function(e){return e.gallery},Tde=QX([Mde,Lae,Ode,fae],(function(e,t,n,r){var o=e.categories,i=e.currentCategory,a=e.currentImageUuid,s=e.shouldPinGallery,l=e.shouldShowGallery,u=e.galleryScrollPosition,c=e.galleryImageMinimumWidth,d=e.galleryImageObjectFit,f=e.shouldHoldGalleryOpen,h=e.shouldAutoSwitchToNewImages,p=e.galleryWidth,v=e.shouldUseSingleGalleryColumn,g=t.isLightboxOpen;return{currentImageUuid:a,shouldPinGallery:s,shouldShowGallery:l,galleryScrollPosition:u,galleryImageMinimumWidth:c,galleryImageObjectFit:d,galleryGridTemplateColumns:v?"auto":"repeat(auto-fill, minmax(".concat(c,"px, auto))"),activeTabName:r,shouldHoldGalleryOpen:f,shouldAutoSwitchToNewImages:h,images:o[i].images,areMoreImagesAvailable:o[i].areMoreImagesAvailable,currentCategory:i,galleryWidth:p,isLightboxOpen:g,isStaging:n,shouldEnableResize:!(g||"unifiedCanvas"===r&&s),shouldUseSingleGalleryColumn:v}}),{memoizeOptions:{resultEqualityCheck:dae}}),Ide=QX([Mde,wle,Lae,fae],(function(e,t,n,r){return{mayDeleteImage:t.isConnected&&!t.isProcessing,galleryImageObjectFit:e.galleryImageObjectFit,galleryImageMinimumWidth:e.galleryImageMinimumWidth,shouldUseSingleGalleryColumn:e.shouldUseSingleGalleryColumn,activeTabName:r,isLightboxOpen:n.isLightboxOpen}}),{memoizeOptions:{resultEqualityCheck:dae}}),Rde=QX(wle,(function(e){return{shouldConfirmOnDelete:e.shouldConfirmOnDelete,isConnected:e.isConnected,isProcessing:e.isProcessing}}),{memoizeOptions:{resultEqualityCheck:dae}}),Nde=cr.forwardRef((function(e,t){var n=e.image,r=e.children,o=GE(),i=o.isOpen,a=o.onOpen,s=o.onClose,l=wie(),u=kie(Rde),c=u.shouldConfirmOnDelete,d=u.isConnected,f=u.isProcessing,h=cr.useRef(null),p=function(){d&&!f&&n&&l(eie(n)),s()};_ce("delete",(function(){c?a():p()}),[n,c]);return ro(to,{children:[cr.cloneElement(r,{onClick:n?function(e){e.stopPropagation(),c?a():p()}:void 0,ref:t}),no(oU,{isOpen:i,leastDestructiveRef:h,onClose:s,children:no(rU,{children:ro(iU,{className:"modal",children:[no(tU,{fontSize:"lg",fontWeight:"bold",children:"Delete image"}),no(YW,{children:ro(yP,{direction:"column",gap:5,children:[no(jP,{children:"Are you sure? Deleted images will be sent to the Bin. You can restore from there if you wish to."}),no(I_,{children:ro(yP,{alignItems:"center",children:[no(V_,{mb:0,children:"Don't ask me again"}),no(Cq,{checked:!c,onChange:function(e){return l(f8(!e.target.checked))}})]})})]})}),ro(eU,{children:[no(b_,{ref:h,onClick:s,className:"modal-close-btn",children:"Cancel"}),no(b_,{colorScheme:"red",onClick:p,ml:3,children:"Delete"})]})]})})})]})}));Nde.displayName="DeleteImageModal";var Dde=QX([wle,Mde,Tae,pae,Lae,fae],(function(e,t,n,r,o,i){var a=e.isProcessing,s=e.isConnected,l=e.isGFPGANAvailable,u=e.isESRGANAvailable,c=n.upscalingLevel,d=n.facetoolStrength,f=o.isLightboxOpen,h=r.shouldShowImageDetails,p=t.intermediateImage,v=t.currentImage;return{isProcessing:a,isConnected:s,isGFPGANAvailable:l,isESRGANAvailable:u,upscalingLevel:c,facetoolStrength:d,shouldDisableToolbarButtons:Boolean(p)||!v,currentImage:v,shouldShowImageDetails:h,activeTabName:i,isLightboxOpen:f}}),{memoizeOptions:{resultEqualityCheck:dae}}),zde=function(){var e,t,n,r,o,i,a=wie(),s=kie(Dde),l=s.isProcessing,u=s.isConnected,c=s.isGFPGANAvailable,d=s.isESRGANAvailable,f=s.upscalingLevel,h=s.facetoolStrength,p=s.shouldDisableToolbarButtons,v=s.shouldShowImageDetails,g=s.currentImage,m=s.isLightboxOpen,y=s.activeTabName,b=cY(),w=o8().t,k=function(){g&&(m&&a(p4(!1)),a(M4(g)),a(z8("img2img")))},x=function(){var e=qt(Ut().mark((function e(){var t,n;return Ut().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(g){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,fetch(g.url).then((function(e){return e.blob()}));case 4:return t=e.sent,n=[new ClipboardItem(gn({},t.type,t))],e.next=8,navigator.clipboard.write(n);case 8:b({title:w("toast:imageCopied"),status:"success",duration:2500,isClosable:!0});case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();_ce("shift+i",(function(){g?(k(),b({title:w("toast:sentToImageToImage"),status:"success",duration:2500,isClosable:!0})):b({title:w("toast:imageNotLoaded"),description:w("toast:imageNotLoadedDesc"),status:"error",duration:2500,isClosable:!0})}),[g]);var S=function(){var e,t;g&&(g.metadata&&a(E4(g.metadata)),"img2img"===(null===(e=g.metadata)||void 0===e?void 0:e.image.type)?a(z8("img2img")):"txt2img"===(null===(t=g.metadata)||void 0===t?void 0:t.image.type)&&a(z8("txt2img")))};_ce("a",(function(){var e,t;["txt2img","img2img"].includes(null==g||null===(e=g.metadata)||void 0===e||null===(t=e.image)||void 0===t?void 0:t.type)?(S(),b({title:w("toast:parametersSet"),status:"success",duration:2500,isClosable:!0})):b({title:w("toast:parametersNotSet"),description:w("toast:parametersNotSetDesc"),status:"error",duration:2500,isClosable:!0})}),[g]);var C=function(){(null==g?void 0:g.metadata)&&a(W4(g.metadata.image.seed))};_ce("s",(function(){var e,t;null!=g&&null!==(e=g.metadata)&&void 0!==e&&null!==(t=e.image)&&void 0!==t&&t.seed?(C(),b({title:w("toast:seedSet"),status:"success",duration:2500,isClosable:!0})):b({title:w("toast:seedNotSet"),description:w("toast:seedNotSetDesc"),status:"error",duration:2500,isClosable:!0})}),[g]);var _=function(){var e,t;if(null!=g&&null!==(e=g.metadata)&&void 0!==e&&null!==(t=e.image)&&void 0!==t&&t.prompt){var n,r,o=yn(m4(null==g||null===(n=g.metadata)||void 0===n||null===(r=n.image)||void 0===r?void 0:r.prompt),2),i=o[0],s=o[1];i&&a(N4(i)),a(D4(s||""))}};_ce("p",(function(){var e,t;null!=g&&null!==(e=g.metadata)&&void 0!==e&&null!==(t=e.image)&&void 0!==t&&t.prompt?(_(),b({title:w("toast:promptSet"),status:"success",duration:2500,isClosable:!0})):b({title:w("toast:promptNotSet"),description:w("toast:promptNotSetDesc"),status:"error",duration:2500,isClosable:!0})}),[g]);var E=function(){g&&a(Qoe(g))};_ce("Shift+U",(function(){d&&!p&&u&&!l&&f?E():b({title:w("toast:upscalingFailed"),status:"error",duration:2500,isClosable:!0})}),[g,d,p,u,l,f]);var P=function(){g&&a(Joe(g))};_ce("Shift+R",(function(){c&&!p&&u&&!l&&h?P():b({title:w("toast:faceRestoreFailed"),status:"error",duration:2500,isClosable:!0})}),[g,c,p,u,l,h]);var L=function(){return a(U8(!v))};_ce("i",(function(){g?L():b({title:w("toast:metadataLoadFailed"),status:"error",duration:2500,isClosable:!0})}),[g,v]);return ro("div",{className:"current-image-options",children:[ro(k_,{isAttached:!0,children:[no(Pae,{trigger:"hover",triggerComponent:no(_ae,{"aria-label":"".concat(w("parameters:sendTo"),"..."),icon:no(bde,{})}),children:ro("div",{className:"current-image-send-to-popover",children:[no(Eae,{size:"sm",onClick:k,leftIcon:no(wde,{}),children:w("parameters:sendToImg2Img")}),no(Eae,{size:"sm",onClick:function(){g&&(m&&a(p4(!1)),a(y3(g)),a(m3(!0)),"unifiedCanvas"!==y&&a(z8("unifiedCanvas")),b({title:w("toast:sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0}))},leftIcon:no(wde,{}),children:w("parameters:sendToUnifiedCanvas")}),no(Eae,{size:"sm",onClick:x,leftIcon:no(qce,{}),children:w("parameters:copyImage")}),no(Eae,{size:"sm",onClick:function(){navigator.clipboard.writeText(g?window.location.toString()+g.url:"").then((function(){b({title:w("toast:imageLinkCopied"),status:"success",duration:2500,isClosable:!0})}))},leftIcon:no(qce,{}),children:w("parameters:copyImageToLink")}),no(CP,{download:!0,href:null==g?void 0:g.url,children:no(Eae,{leftIcon:no(Xce,{}),size:"sm",w:"100%",children:w("parameters:downloadImage")})})]})}),no(_ae,{icon:no(Qce,{}),tooltip:"".concat(w(m?"parameters:closeViewer":"parameters:openInViewer")," (Z)"),"aria-label":"".concat(w(m?"parameters:closeViewer":"parameters:openInViewer")," (Z)"),"data-selected":m,onClick:function(){a(p4(!m))}})]}),ro(k_,{isAttached:!0,children:[no(_ae,{icon:no(pde,{}),tooltip:"".concat(w("parameters:usePrompt")," (P)"),"aria-label":"".concat(w("parameters:usePrompt")," (P)"),isDisabled:!(null!=g&&null!==(e=g.metadata)&&void 0!==e&&null!==(t=e.image)&&void 0!==t&&t.prompt),onClick:_}),no(_ae,{icon:no(yde,{}),tooltip:"".concat(w("parameters:useSeed")," (S)"),"aria-label":"".concat(w("parameters:useSeed")," (S)"),isDisabled:!(null!=g&&null!==(n=g.metadata)&&void 0!==n&&null!==(r=n.image)&&void 0!==r&&r.seed),onClick:C}),no(_ae,{icon:no(Vce,{}),tooltip:"".concat(w("parameters:useAll")," (A)"),"aria-label":"".concat(w("parameters:useAll")," (A)"),isDisabled:!["txt2img","img2img"].includes(null==g||null===(o=g.metadata)||void 0===o||null===(i=o.image)||void 0===i?void 0:i.type),onClick:S})]}),ro(k_,{isAttached:!0,children:[no(Pae,{trigger:"hover",triggerComponent:no(_ae,{icon:no(rde,{}),"aria-label":w("parameters:restoreFaces")}),children:ro("div",{className:"current-image-postprocessing-popover",children:[no(Cle,{}),no(Eae,{isDisabled:!(c&&g&&u&&!l&&h),onClick:P,children:w("parameters:restoreFaces")})]})}),no(Pae,{trigger:"hover",triggerComponent:no(_ae,{icon:no(Kce,{}),"aria-label":w("parameters:upscale")}),children:ro("div",{className:"current-image-postprocessing-popover",children:[no(Ele,{}),no(Eae,{isDisabled:!(d&&g&&u&&!l&&f),onClick:E,children:w("parameters:upscaleImage")})]})})]}),no(k_,{isAttached:!0,children:no(_ae,{icon:no(Gce,{}),tooltip:"".concat(w("parameters:info")," (I)"),"aria-label":"".concat(w("parameters:info")," (I)"),"data-selected":v,onClick:L})}),no(Nde,{image:g,children:no(_ae,{icon:no(Sde,{}),tooltip:"".concat(w("parameters:deleteImage")," (Del)"),"aria-label":"".concat(w("parameters:deleteImage")," (Del)"),isDisabled:!g||!u||l,style:{backgroundColor:"var(--btn-delete-image)"}})})]})};qv({d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z",displayName:"CopyIcon"}),qv({d:"M23.384,21.619,16.855,15.09a9.284,9.284,0,1,0-1.768,1.768l6.529,6.529a1.266,1.266,0,0,0,1.768,0A1.251,1.251,0,0,0,23.384,21.619ZM2.75,9.5a6.75,6.75,0,1,1,6.75,6.75A6.758,6.758,0,0,1,2.75,9.5Z",displayName:"SearchIcon"}),qv({d:"M23.414,20.591l-4.645-4.645a10.256,10.256,0,1,0-2.828,2.829l4.645,4.644a2.025,2.025,0,0,0,2.828,0A2,2,0,0,0,23.414,20.591ZM10.25,3.005A7.25,7.25,0,1,1,3,10.255,7.258,7.258,0,0,1,10.25,3.005Z",displayName:"Search2Icon"}),qv({d:"M21.4,13.7C20.6,13.9,19.8,14,19,14c-5,0-9-4-9-9c0-0.8,0.1-1.6,0.3-2.4c0.1-0.3,0-0.7-0.3-1 c-0.3-0.3-0.6-0.4-1-0.3C4.3,2.7,1,7.1,1,12c0,6.1,4.9,11,11,11c4.9,0,9.3-3.3,10.6-8.1c0.1-0.3,0-0.7-0.3-1 C22.1,13.7,21.7,13.6,21.4,13.7z",displayName:"MoonIcon"}),qv({displayName:"SunIcon",path:qr.createElement("g",{strokeLinejoin:"round",strokeLinecap:"round",strokeWidth:"2",fill:"none",stroke:"currentColor"},qr.createElement("circle",{cx:"12",cy:"12",r:"5"}),qr.createElement("path",{d:"M12 1v2"}),qr.createElement("path",{d:"M12 21v2"}),qr.createElement("path",{d:"M4.22 4.22l1.42 1.42"}),qr.createElement("path",{d:"M18.36 18.36l1.42 1.42"}),qr.createElement("path",{d:"M1 12h2"}),qr.createElement("path",{d:"M21 12h2"}),qr.createElement("path",{d:"M4.22 19.78l1.42-1.42"}),qr.createElement("path",{d:"M18.36 5.64l1.42-1.42"}))}),qv({d:"M0,12a1.5,1.5,0,0,0,1.5,1.5h8.75a.25.25,0,0,1,.25.25V22.5a1.5,1.5,0,0,0,3,0V13.75a.25.25,0,0,1,.25-.25H22.5a1.5,1.5,0,0,0,0-3H13.75a.25.25,0,0,1-.25-.25V1.5a1.5,1.5,0,0,0-3,0v8.75a.25.25,0,0,1-.25.25H1.5A1.5,1.5,0,0,0,0,12Z",displayName:"AddIcon"}),qv({displayName:"SmallAddIcon",viewBox:"0 0 20 20",path:qr.createElement("path",{fill:"currentColor",d:"M14 9h-3V6c0-.55-.45-1-1-1s-1 .45-1 1v3H6c-.55 0-1 .45-1 1s.45 1 1 1h3v3c0 .55.45 1 1 1s1-.45 1-1v-3h3c.55 0 1-.45 1-1s-.45-1-1-1z",fillRule:"evenodd"})}),qv({viewBox:"0 0 14 14",d:"M14,7.77 L14,6.17 L12.06,5.53 L11.61,4.44 L12.49,2.6 L11.36,1.47 L9.55,2.38 L8.46,1.93 L7.77,0.01 L6.17,0.01 L5.54,1.95 L4.43,2.4 L2.59,1.52 L1.46,2.65 L2.37,4.46 L1.92,5.55 L0,6.23 L0,7.82 L1.94,8.46 L2.39,9.55 L1.51,11.39 L2.64,12.52 L4.45,11.61 L5.54,12.06 L6.23,13.98 L7.82,13.98 L8.45,12.04 L9.56,11.59 L11.4,12.47 L12.53,11.34 L11.61,9.53 L12.08,8.44 L14,7.75 L14,7.77 Z M7,10 C5.34,10 4,8.66 4,7 C4,5.34 5.34,4 7,4 C8.66,4 10,5.34 10,7 C10,8.66 8.66,10 7,10 Z",displayName:"SettingsIcon"}),qv({displayName:"CheckCircleIcon",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"}),qv({d:"M19.5,9.5h-.75V6.75a6.75,6.75,0,0,0-13.5,0V9.5H4.5a2,2,0,0,0-2,2V22a2,2,0,0,0,2,2h15a2,2,0,0,0,2-2V11.5A2,2,0,0,0,19.5,9.5Zm-9.5,6a2,2,0,1,1,3,1.723V19.5a1,1,0,0,1-2,0V17.223A1.994,1.994,0,0,1,10,15.5ZM7.75,6.75a4.25,4.25,0,0,1,8.5,0V9a.5.5,0,0,1-.5.5H8.25a.5.5,0,0,1-.5-.5Z",displayName:"LockIcon"}),qv({d:"M19.5,9.5h-.75V6.75A6.751,6.751,0,0,0,5.533,4.811a1.25,1.25,0,1,0,2.395.717A4.251,4.251,0,0,1,16.25,6.75V9a.5.5,0,0,1-.5.5H4.5a2,2,0,0,0-2,2V22a2,2,0,0,0,2,2h15a2,2,0,0,0,2-2V11.5A2,2,0,0,0,19.5,9.5Zm-9.5,6a2,2,0,1,1,3,1.723V19.5a1,1,0,0,1-2,0V17.223A1.994,1.994,0,0,1,10,15.5Z",displayName:"UnlockIcon"}),qv({displayName:"ViewIcon",path:qr.createElement("g",{fill:"currentColor"},qr.createElement("path",{d:"M23.432,10.524C20.787,7.614,16.4,4.538,12,4.6,7.6,4.537,3.213,7.615.568,10.524a2.211,2.211,0,0,0,0,2.948C3.182,16.351,7.507,19.4,11.839,19.4h.308c4.347,0,8.671-3.049,11.288-5.929A2.21,2.21,0,0,0,23.432,10.524ZM7.4,12A4.6,4.6,0,1,1,12,16.6,4.6,4.6,0,0,1,7.4,12Z"}),qr.createElement("circle",{cx:"12",cy:"12",r:"2"}))}),qv({displayName:"ViewOffIcon",path:qr.createElement("g",{fill:"currentColor"},qr.createElement("path",{d:"M23.2,10.549a20.954,20.954,0,0,0-4.3-3.6l4-3.995a1,1,0,1,0-1.414-1.414l-.018.018a.737.737,0,0,1-.173.291l-19.5,19.5c-.008.007-.018.009-.026.017a1,1,0,0,0,1.631,1.088l4.146-4.146a11.26,11.26,0,0,0,4.31.939h.3c4.256,0,8.489-2.984,11.051-5.8A2.171,2.171,0,0,0,23.2,10.549ZM16.313,13.27a4.581,4.581,0,0,1-3,3.028,4.3,4.3,0,0,1-3.1-.19.253.253,0,0,1-.068-.407l5.56-5.559a.252.252,0,0,1,.407.067A4.3,4.3,0,0,1,16.313,13.27Z"}),qr.createElement("path",{d:"M7.615,13.4a.244.244,0,0,0,.061-.24A4.315,4.315,0,0,1,7.5,12,4.5,4.5,0,0,1,12,7.5a4.276,4.276,0,0,1,1.16.173.244.244,0,0,0,.24-.062l1.941-1.942a.254.254,0,0,0-.1-.421A10.413,10.413,0,0,0,12,4.75C7.7,4.692,3.4,7.7.813,10.549a2.15,2.15,0,0,0-.007,2.9,21.209,21.209,0,0,0,3.438,3.03.256.256,0,0,0,.326-.029Z"}))}),qv({d:"M11.2857,6.05714 L10.08571,4.85714 L7.85714,7.14786 L7.85714,1 L6.14286,1 L6.14286,7.14786 L3.91429,4.85714 L2.71429,6.05714 L7,10.42857 L11.2857,6.05714 Z M1,11.2857 L1,13 L13,13 L13,11.2857 L1,11.2857 Z",displayName:"DownloadIcon",viewBox:"0 0 14 14"});var jde=qv({displayName:"DeleteIcon",path:qr.createElement("g",{fill:"currentColor"},qr.createElement("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"}))});qv({displayName:"RepeatIcon",path:qr.createElement("g",{fill:"currentColor"},qr.createElement("path",{d:"M10.319,4.936a7.239,7.239,0,0,1,7.1,2.252,1.25,1.25,0,1,0,1.872-1.657A9.737,9.737,0,0,0,9.743,2.5,10.269,10.269,0,0,0,2.378,9.61a.249.249,0,0,1-.271.178l-1.033-.13A.491.491,0,0,0,.6,9.877a.5.5,0,0,0-.019.526l2.476,4.342a.5.5,0,0,0,.373.248.43.43,0,0,0,.062,0,.5.5,0,0,0,.359-.152l3.477-3.593a.5.5,0,0,0-.3-.844L5.15,10.172a.25.25,0,0,1-.2-.333A7.7,7.7,0,0,1,10.319,4.936Z"}),qr.createElement("path",{d:"M23.406,14.1a.5.5,0,0,0,.015-.526l-2.5-4.329A.5.5,0,0,0,20.546,9a.489.489,0,0,0-.421.151l-3.456,3.614a.5.5,0,0,0,.3.842l1.848.221a.249.249,0,0,1,.183.117.253.253,0,0,1,.023.216,7.688,7.688,0,0,1-5.369,4.9,7.243,7.243,0,0,1-7.1-2.253,1.25,1.25,0,1,0-1.872,1.656,9.74,9.74,0,0,0,9.549,3.03,10.261,10.261,0,0,0,7.369-7.12.251.251,0,0,1,.27-.179l1.058.127a.422.422,0,0,0,.06,0A.5.5,0,0,0,23.406,14.1Z"}))}),qv({displayName:"RepeatClockIcon",path:qr.createElement("g",{fill:"currentColor"},qr.createElement("path",{d:"M12.965,6a1,1,0,0,0-1,1v5.5a1,1,0,0,0,1,1h5a1,1,0,0,0,0-2h-3.75a.25.25,0,0,1-.25-.25V7A1,1,0,0,0,12.965,6Z"}),qr.createElement("path",{d:"M12.567,1.258A10.822,10.822,0,0,0,2.818,8.4a.25.25,0,0,1-.271.163L.858,8.309a.514.514,0,0,0-.485.213.5.5,0,0,0-.021.53l2.679,4.7a.5.5,0,0,0,.786.107l3.77-3.746a.5.5,0,0,0-.279-.85L5.593,9.007a.25.25,0,0,1-.192-.35,8.259,8.259,0,1,1,7.866,11.59,1.25,1.25,0,0,0,.045,2.5h.047a10.751,10.751,0,1,0-.792-21.487Z"}))});var Bde=qv({displayName:"EditIcon",path:qr.createElement("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"},qr.createElement("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),qr.createElement("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"}))});qv({d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z",displayName:"ChevronLeftIcon"}),qv({d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z",displayName:"ChevronRightIcon"}),qv({displayName:"ChevronDownIcon",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"}),qv({d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z",displayName:"ChevronUpIcon"}),qv({d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z",displayName:"ArrowBackIcon"}),qv({d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z",displayName:"ArrowForwardIcon"}),qv({d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z",displayName:"ArrowUpIcon"}),qv({viewBox:"0 0 16 16",d:"M11.891 9.992a1 1 0 1 1 1.416 1.415l-4.3 4.3a1 1 0 0 1-1.414 0l-4.3-4.3A1 1 0 0 1 4.71 9.992l3.59 3.591 3.591-3.591zm0-3.984L8.3 2.417 4.709 6.008a1 1 0 0 1-1.416-1.415l4.3-4.3a1 1 0 0 1 1.414 0l4.3 4.3a1 1 0 1 1-1.416 1.415z",displayName:"ArrowUpDownIcon"}),qv({d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z",displayName:"ArrowDownIcon"});var Fde=qv({displayName:"ExternalLinkIcon",path:qr.createElement("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"},qr.createElement("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),qr.createElement("path",{d:"M15 3h6v6"}),qr.createElement("path",{d:"M10 14L21 3"}))});function Hde(e){return Tce({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)}qv({displayName:"LinkIcon",path:qr.createElement("g",{fill:"currentColor"},qr.createElement("path",{d:"M10.458,18.374,7.721,21.11a2.853,2.853,0,0,1-3.942,0l-.892-.891a2.787,2.787,0,0,1,0-3.941l5.8-5.8a2.789,2.789,0,0,1,3.942,0l.893.892A1,1,0,0,0,14.94,9.952l-.893-.892a4.791,4.791,0,0,0-6.771,0l-5.8,5.8a4.787,4.787,0,0,0,0,6.77l.892.891a4.785,4.785,0,0,0,6.771,0l2.736-2.735a1,1,0,1,0-1.414-1.415Z"}),qr.createElement("path",{d:"M22.526,2.363l-.892-.892a4.8,4.8,0,0,0-6.77,0l-2.905,2.9a1,1,0,0,0,1.414,1.414l2.9-2.9a2.79,2.79,0,0,1,3.941,0l.893.893a2.786,2.786,0,0,1,0,3.942l-5.8,5.8a2.769,2.769,0,0,1-1.971.817h0a2.766,2.766,0,0,1-1.969-.816,1,1,0,1,0-1.415,1.412,4.751,4.751,0,0,0,3.384,1.4h0a4.752,4.752,0,0,0,3.385-1.4l5.8-5.8a4.786,4.786,0,0,0,0-6.771Z"}))}),qv({displayName:"PlusSquareIcon",path:qr.createElement("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"},qr.createElement("rect",{height:"18",width:"18",rx:"2",ry:"2",x:"3",y:"3"}),qr.createElement("path",{d:"M12 8v8"}),qr.createElement("path",{d:"M8 12h8"}))}),qv({displayName:"CalendarIcon",viewBox:"0 0 14 14",d:"M10.8889,5.5 L3.11111,5.5 L3.11111,7.05556 L10.8889,7.05556 L10.8889,5.5 Z M12.4444,1.05556 L11.6667,1.05556 L11.6667,0 L10.1111,0 L10.1111,1.05556 L3.88889,1.05556 L3.88889,0 L2.33333,0 L2.33333,1.05556 L1.55556,1.05556 C0.692222,1.05556 0.00777777,1.75556 0.00777777,2.61111 L0,12.5 C0,13.3556 0.692222,14 1.55556,14 L12.4444,14 C13.3,14 14,13.3556 14,12.5 L14,2.61111 C14,1.75556 13.3,1.05556 12.4444,1.05556 Z M12.4444,12.5 L1.55556,12.5 L1.55556,3.94444 L12.4444,3.94444 L12.4444,12.5 Z M8.55556,8.61111 L3.11111,8.61111 L3.11111,10.1667 L8.55556,10.1667 L8.55556,8.61111 Z"}),qv({d:"M0.913134,0.920639 C1.49851,0.331726 2.29348,0 3.12342,0 L10.8766,0 C11.7065,0 12.5015,0.331725 13.0869,0.920639 C13.6721,1.50939 14,2.30689 14,3.13746 L14,8.12943 C13.9962,8.51443 13.9059,8.97125 13.7629,9.32852 C13.6128,9.683 13.3552,10.0709 13.0869,10.3462 C12.813,10.6163 12.4265,10.8761 12.0734,11.0274 C11.7172,11.1716 11.2607,11.263 10.8766,11.2669 L10.1234,11.2669 L10.1234,12.5676 L10.1209,12.5676 C10.1204,12.793 10.0633,13.0791 9.97807,13.262 C9.8627,13.466 9.61158,13.7198 9.40818,13.8382 L9.40824,13.8383 C9.4077,13.8386 9.40716,13.8388 9.40661,13.8391 C9.40621,13.8393 9.4058,13.8396 9.40539,13.8398 L9.40535,13.8397 C9.22958,13.9254 8.94505,13.9951 8.75059,14 L8.74789,14 C8.35724,13.9963 7.98473,13.8383 7.71035,13.5617 L5.39553,11.2669 L3.12342,11.2669 C2.29348,11.2669 1.49851,10.9352 0.913134,10.3462 C0.644826,10.0709 0.387187,9.683 0.23711,9.32852 C0.0941235,8.97125 0.00379528,8.51443 0,8.12943 L0,3.13746 C0,2.30689 0.327915,1.50939 0.913134,0.920639 Z M3.12342,1.59494 C2.71959,1.59494 2.33133,1.75628 2.04431,2.04503 C1.75713,2.33395 1.59494,2.72681 1.59494,3.13746 L1.59494,8.12943 C1.59114,8.35901 1.62114,8.51076 1.71193,8.72129 C1.79563,8.9346 1.88065,9.06264 2.04431,9.22185 C2.33133,9.5106 2.71959,9.67195 3.12342,9.67195 L5.72383,9.67195 C5.93413,9.67195 6.13592,9.75502 6.28527,9.90308 L8.52848,12.1269 L8.52848,10.4694 C8.52848,10.029 8.88552,9.67195 9.32595,9.67195 L10.8766,9.67195 C11.1034,9.67583 11.2517,9.64614 11.4599,9.55518 C11.6712,9.47132 11.7976,9.38635 11.9557,9.22185 C12.1193,9.06264 12.2044,8.9346 12.2881,8.72129 C12.3789,8.51076 12.4089,8.35901 12.4051,8.12943 L12.4051,3.13746 C12.4051,2.72681 12.2429,2.33394 11.9557,2.04503 C11.6687,1.75628 11.2804,1.59494 10.8766,1.59494 L3.12342,1.59494 Z",displayName:"ChatIcon",viewBox:"0 0 14 14"}),qv({displayName:"TimeIcon",path:qr.createElement("g",{fill:"currentColor"},qr.createElement("path",{d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm0,22A10,10,0,1,1,22,12,10.011,10.011,0,0,1,12,22Z"}),qr.createElement("path",{d:"M17.134,15.81,12.5,11.561V6.5a1,1,0,0,0-2,0V12a1,1,0,0,0,.324.738l4.959,4.545a1.01,1.01,0,0,0,1.413-.061A1,1,0,0,0,17.134,15.81Z"}))}),qv({displayName:"ArrowRightIcon",path:qr.createElement("g",{fill:"currentColor"},qr.createElement("path",{d:"M13.584,12a2.643,2.643,0,0,1-.775,1.875L3.268,23.416a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L.768,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,13.584,12Z"}),qr.createElement("path",{d:"M23.75,12a2.643,2.643,0,0,1-.775,1.875l-9.541,9.541a1.768,1.768,0,0,1-2.5-2.5l8.739-8.739a.25.25,0,0,0,0-.354L10.934,3.084a1.768,1.768,0,0,1,2.5-2.5l9.541,9.541A2.643,2.643,0,0,1,23.75,12Z"}))}),qv({displayName:"ArrowLeftIcon",path:qr.createElement("g",{fill:"currentColor"},qr.createElement("path",{d:"M10.416,12a2.643,2.643,0,0,1,.775-1.875L20.732.584a1.768,1.768,0,0,1,2.5,2.5l-8.739,8.739a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5l-9.541-9.541A2.643,2.643,0,0,1,10.416,12Z"}),qr.createElement("path",{d:"M.25,12a2.643,2.643,0,0,1,.775-1.875L10.566.584a1.768,1.768,0,0,1,2.5,2.5L4.327,11.823a.25.25,0,0,0,0,.354l8.739,8.739a1.768,1.768,0,0,1-2.5,2.5L1.025,13.875A2.643,2.643,0,0,1,.25,12Z"}))}),qv({displayName:"AtSignIcon",d:"M12,.5A11.634,11.634,0,0,0,.262,12,11.634,11.634,0,0,0,12,23.5a11.836,11.836,0,0,0,6.624-2,1.25,1.25,0,1,0-1.393-2.076A9.34,9.34,0,0,1,12,21a9.132,9.132,0,0,1-9.238-9A9.132,9.132,0,0,1,12,3a9.132,9.132,0,0,1,9.238,9v.891a1.943,1.943,0,0,1-3.884,0V12A5.355,5.355,0,1,0,12,17.261a5.376,5.376,0,0,0,3.861-1.634,4.438,4.438,0,0,0,7.877-2.736V12A11.634,11.634,0,0,0,12,.5Zm0,14.261A2.763,2.763,0,1,1,14.854,12,2.812,2.812,0,0,1,12,14.761Z"}),qv({displayName:"AttachmentIcon",d:"M21.843,3.455a6.961,6.961,0,0,0-9.846,0L1.619,13.832a5.128,5.128,0,0,0,7.252,7.252L17.3,12.653A3.293,3.293,0,1,0,12.646,8L7.457,13.184A1,1,0,1,0,8.871,14.6L14.06,9.409a1.294,1.294,0,0,1,1.829,1.83L7.457,19.67a3.128,3.128,0,0,1-4.424-4.424L13.411,4.869a4.962,4.962,0,1,1,7.018,7.018L12.646,19.67a1,1,0,1,0,1.414,1.414L21.843,13.3a6.96,6.96,0,0,0,0-9.846Z"}),qv({displayName:"UpDownIcon",viewBox:"-1 -1 9 11",d:"M 3.5 0L 3.98809 -0.569442L 3.5 -0.987808L 3.01191 -0.569442L 3.5 0ZM 3.5 9L 3.01191 9.56944L 3.5 9.98781L 3.98809 9.56944L 3.5 9ZM 0.488094 3.56944L 3.98809 0.569442L 3.01191 -0.569442L -0.488094 2.43056L 0.488094 3.56944ZM 3.01191 0.569442L 6.51191 3.56944L 7.48809 2.43056L 3.98809 -0.569442L 3.01191 0.569442ZM -0.488094 6.56944L 3.01191 9.56944L 3.98809 8.43056L 0.488094 5.43056L -0.488094 6.56944ZM 3.98809 9.56944L 7.48809 6.56944L 6.51191 5.43056L 3.01191 8.43056L 3.98809 9.56944Z"}),qv({d:"M23.555,8.729a1.505,1.505,0,0,0-1.406-.98H16.062a.5.5,0,0,1-.472-.334L13.405,1.222a1.5,1.5,0,0,0-2.81,0l-.005.016L8.41,7.415a.5.5,0,0,1-.471.334H1.85A1.5,1.5,0,0,0,.887,10.4l5.184,4.3a.5.5,0,0,1,.155.543L4.048,21.774a1.5,1.5,0,0,0,2.31,1.684l5.346-3.92a.5.5,0,0,1,.591,0l5.344,3.919a1.5,1.5,0,0,0,2.312-1.683l-2.178-6.535a.5.5,0,0,1,.155-.543l5.194-4.306A1.5,1.5,0,0,0,23.555,8.729Z",displayName:"StarIcon"}),qv({displayName:"EmailIcon",path:qr.createElement("g",{fill:"currentColor"},qr.createElement("path",{d:"M11.114,14.556a1.252,1.252,0,0,0,1.768,0L22.568,4.87a.5.5,0,0,0-.281-.849A1.966,1.966,0,0,0,22,4H2a1.966,1.966,0,0,0-.289.021.5.5,0,0,0-.281.849Z"}),qr.createElement("path",{d:"M23.888,5.832a.182.182,0,0,0-.2.039l-6.2,6.2a.251.251,0,0,0,0,.354l5.043,5.043a.75.75,0,1,1-1.06,1.061l-5.043-5.043a.25.25,0,0,0-.354,0l-2.129,2.129a2.75,2.75,0,0,1-3.888,0L7.926,13.488a.251.251,0,0,0-.354,0L2.529,18.531a.75.75,0,0,1-1.06-1.061l5.043-5.043a.251.251,0,0,0,0-.354l-6.2-6.2a.18.18,0,0,0-.2-.039A.182.182,0,0,0,0,6V18a2,2,0,0,0,2,2H22a2,2,0,0,0,2-2V6A.181.181,0,0,0,23.888,5.832Z"}))}),qv({d:"M2.20731,0.0127209 C2.1105,-0.0066419 1.99432,-0.00664663 1.91687,0.032079 C0.871279,0.438698 0.212942,1.92964 0.0580392,2.95587 C-0.426031,6.28627 2.20731,9.17133 4.62766,11.0689 C6.77694,12.7534 10.9012,15.5223 13.3409,12.8503 C13.6507,12.5211 14.0186,12.037 13.9993,11.553 C13.9412,10.7397 13.186,10.1588 12.6051,9.71349 C12.1598,9.38432 11.2304,8.47427 10.6495,8.49363 C10.1267,8.51299 9.79754,9.05515 9.46837,9.38432 L8.88748,9.96521 C8.79067,10.062 7.55145,9.24878 7.41591,9.15197 C6.91248,8.8228 6.4284,8.45491 6.00242,8.04829 C5.57644,7.64167 5.18919,7.19632 4.86002,6.73161 C4.7632,6.59607 3.96933,5.41495 4.04678,5.31813 C4.04678,5.31813 4.72448,4.58234 4.91811,4.2919 C5.32473,3.67229 5.63453,3.18822 5.16982,2.45243 C4.99556,2.18135 4.78257,1.96836 4.55021,1.73601 C4.14359,1.34875 3.73698,0.942131 3.27227,0.612963 C3.02055,0.419335 2.59457,0.0708094 2.20731,0.0127209 Z",displayName:"PhoneIcon",viewBox:"0 0 14 14"}),qv({viewBox:"0 0 10 10",d:"M3,2 C2.44771525,2 2,1.55228475 2,1 C2,0.44771525 2.44771525,0 3,0 C3.55228475,0 4,0.44771525 4,1 C4,1.55228475 3.55228475,2 3,2 Z M3,6 C2.44771525,6 2,5.55228475 2,5 C2,4.44771525 2.44771525,4 3,4 C3.55228475,4 4,4.44771525 4,5 C4,5.55228475 3.55228475,6 3,6 Z M3,10 C2.44771525,10 2,9.55228475 2,9 C2,8.44771525 2.44771525,8 3,8 C3.55228475,8 4,8.44771525 4,9 C4,9.55228475 3.55228475,10 3,10 Z M7,2 C6.44771525,2 6,1.55228475 6,1 C6,0.44771525 6.44771525,0 7,0 C7.55228475,0 8,0.44771525 8,1 C8,1.55228475 7.55228475,2 7,2 Z M7,6 C6.44771525,6 6,5.55228475 6,5 C6,4.44771525 6.44771525,4 7,4 C7.55228475,4 8,4.44771525 8,5 C8,5.55228475 7.55228475,6 7,6 Z M7,10 C6.44771525,10 6,9.55228475 6,9 C6,8.44771525 6.44771525,8 7,8 C7.55228475,8 8,8.44771525 8,9 C8,9.55228475 7.55228475,10 7,10 Z",displayName:"DragHandleIcon"}),qv({displayName:"SpinnerIcon",path:qr.createElement(qr.Fragment,null,qr.createElement("defs",null,qr.createElement("linearGradient",{x1:"28.154%",y1:"63.74%",x2:"74.629%",y2:"17.783%",id:"a"},qr.createElement("stop",{stopColor:"currentColor",offset:"0%"}),qr.createElement("stop",{stopColor:"#fff",stopOpacity:"0",offset:"100%"}))),qr.createElement("g",{transform:"translate(2)",fill:"none"},qr.createElement("circle",{stroke:"url(#a)",strokeWidth:"4",cx:"10",cy:"12",r:"10"}),qr.createElement("path",{d:"M10 2C4.477 2 0 6.477 0 12",stroke:"currentColor",strokeWidth:"4"}),qr.createElement("rect",{fill:"currentColor",x:"8",width:"4",height:"4",rx:"8"})))}),qv({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"}),qv({displayName:"SmallCloseIcon",viewBox:"0 0 16 16",path:qr.createElement("path",{d:"M9.41 8l2.29-2.29c.19-.18.3-.43.3-.71a1.003 1.003 0 0 0-1.71-.71L8 6.59l-2.29-2.3a1.003 1.003 0 0 0-1.42 1.42L6.59 8 4.3 10.29c-.19.18-.3.43-.3.71a1.003 1.003 0 0 0 1.71.71L8 9.41l2.29 2.29c.18.19.43.3.71.3a1.003 1.003 0 0 0 .71-1.71L9.41 8z",fillRule:"evenodd",fill:"currentColor"})}),qv({d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z",displayName:"NotAllowedIcon"}),qv({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",displayName:"TriangleDownIcon"}),qv({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",displayName:"TriangleUpIcon"}),qv({displayName:"InfoOutlineIcon",path:qr.createElement("g",{fill:"currentColor",stroke:"currentColor",strokeLinecap:"square",strokeWidth:"2"},qr.createElement("circle",{cx:"12",cy:"12",fill:"none",r:"11",stroke:"currentColor"}),qr.createElement("line",{fill:"none",x1:"11.959",x2:"11.959",y1:"11",y2:"17"}),qr.createElement("circle",{cx:"11.959",cy:"7",r:"1",stroke:"none"}))}),qv({displayName:"BellIcon",d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"}),qv({d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"}),qv({d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm0,19a1.5,1.5,0,1,1,1.5-1.5A1.5,1.5,0,0,1,12,19Zm1.6-6.08a1,1,0,0,0-.6.917,1,1,0,1,1-2,0,3,3,0,0,1,1.8-2.75A2,2,0,1,0,10,9.255a1,1,0,1,1-2,0,4,4,0,1,1,5.6,3.666Z",displayName:"QuestionIcon"}),qv({displayName:"QuestionOutlineIcon",path:qr.createElement("g",{stroke:"currentColor",strokeWidth:"1.5"},qr.createElement("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),qr.createElement("path",{fill:"none",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),qr.createElement("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"}))}),qv({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",displayName:"WarningIcon"}),qv({displayName:"WarningTwoIcon",d:"M23.119,20,13.772,2.15h0a2,2,0,0,0-3.543,0L.881,20a2,2,0,0,0,1.772,2.928H21.347A2,2,0,0,0,23.119,20ZM11,8.423a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Zm1.05,11.51h-.028a1.528,1.528,0,0,1-1.522-1.47,1.476,1.476,0,0,1,1.448-1.53h.028A1.527,1.527,0,0,1,13.5,18.4,1.475,1.475,0,0,1,12.05,19.933Z"}),qv({viewBox:"0 0 14 14",path:qr.createElement("g",{fill:"currentColor"},qr.createElement("polygon",{points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"}))}),qv({displayName:"MinusIcon",path:qr.createElement("g",{fill:"currentColor"},qr.createElement("rect",{height:"4",width:"20",x:"2",y:"10"}))}),qv({displayName:"HamburgerIcon",viewBox:"0 0 24 24",d:"M 3 5 A 1.0001 1.0001 0 1 0 3 7 L 21 7 A 1.0001 1.0001 0 1 0 21 5 L 3 5 z M 3 11 A 1.0001 1.0001 0 1 0 3 13 L 21 13 A 1.0001 1.0001 0 1 0 21 11 L 3 11 z M 3 17 A 1.0001 1.0001 0 1 0 3 19 L 21 19 A 1.0001 1.0001 0 1 0 21 17 L 3 17 z"});var Vde=function(e){var t=e.label,n=e.value,r=e.onClick,o=e.isLink,i=e.labelPosition,a=e.withCopy,s=void 0!==a&&a;return ro(yP,{gap:2,children:[r&&no(kY,{label:"Recall ".concat(t),children:no(x_,{"aria-label":"Use this parameter",icon:no(Hde,{}),size:"xs",variant:"ghost",fontSize:20,onClick:r})}),s&&no(kY,{label:"Copy ".concat(t),children:no(x_,{"aria-label":"Copy ".concat(t),icon:no(qce,{}),size:"xs",variant:"ghost",fontSize:14,onClick:function(){return navigator.clipboard.writeText(n.toString())}})}),ro(yP,{direction:i?"column":"row",children:[ro(jP,{fontWeight:"semibold",whiteSpace:"pre-wrap",pr:2,children:[t,":"]}),o?ro(CP,{href:n.toString(),isExternal:!0,wordBreak:"break-all",children:[n.toString()," ",no(Fde,{mx:"2px"})]}):no(jP,{overflowY:"scroll",wordBreak:"break-all",children:n.toString()})]})]})},Wde=cr.memo((function(e){var t,n,r=e.image,o=e.styleClass,i=wie();_ce("esc",(function(){i(U8(!1))}));var a=(null==r||null===(t=r.metadata)||void 0===t?void 0:t.image)||{},s=null==r?void 0:r.dreamPrompt,l=a.cfg_scale,u=a.fit,c=a.height,d=a.hires_fix,f=a.init_image_path,h=a.mask_image_path,p=a.orig_path,v=a.perlin,g=a.postprocessing,m=a.prompt,y=a.sampler,b=a.scale,w=a.seamless,k=a.seed,x=a.steps,S=a.strength,C=a.threshold,_=a.type,E=a.variations,P=a.width,L=JSON.stringify(r.metadata,null,2);return no("div",{className:"image-metadata-viewer ".concat(o),children:ro(yP,{gap:1,direction:"column",width:"100%",children:[ro(yP,{gap:2,children:[no(jP,{fontWeight:"semibold",children:"File:"}),ro(CP,{href:r.url,isExternal:!0,maxW:"calc(100% - 3rem)",children:[r.url.length>64?r.url.substring(0,64).concat("..."):r.url,no(Fde,{mx:"2px"})]})]}),Object.keys(a).length>0?ro(to,{children:[_&&no(Vde,{label:"Generation type",value:_}),(null===(n=r.metadata)||void 0===n?void 0:n.model_weights)&&no(Vde,{label:"Model",value:r.metadata.model_weights}),["esrgan","gfpgan"].includes(_)&&no(Vde,{label:"Original image",value:p}),"gfpgan"===_&&void 0!==S&&no(Vde,{label:"Fix faces strength",value:S,onClick:function(){return i(o6(S))}}),"esrgan"===_&&void 0!==b&&no(Vde,{label:"Upscaling scale",value:b,onClick:function(){return i(d6(b))}}),"esrgan"===_&&void 0!==S&&no(Vde,{label:"Upscaling strength",value:S,onClick:function(){return i(f6(S))}}),m&&no(Vde,{label:"Prompt",labelPosition:"top",value:g4(m),onClick:function(){return i(N4(m))}}),void 0!==k&&no(Vde,{label:"Seed",value:k,onClick:function(){return i(W4(k))}}),void 0!==C&&no(Vde,{label:"Noise Threshold",value:C,onClick:function(){return i(X4(C))}}),void 0!==v&&no(Vde,{label:"Perlin Noise",value:v,onClick:function(){return i(R4(v))}}),y&&no(Vde,{label:"Sampler",value:y,onClick:function(){return i(z4(y))}}),x&&no(Vde,{label:"Steps",value:x,onClick:function(){return i(Z4(x))}}),void 0!==l&&no(Vde,{label:"CFG scale",value:l,onClick:function(){return i(P4(l))}}),E&&E.length>0&&no(Vde,{label:"Seed-weight pairs",value:w4(E),onClick:function(){return i(U4(w4(E)))}}),w&&no(Vde,{label:"Seamless",value:w,onClick:function(){return i(B4(w))}}),d&&no(Vde,{label:"High Resolution Optimization",value:d,onClick:function(){return i(a6(d))}}),P&&no(Vde,{label:"Width",value:P,onClick:function(){return i(Q4(P))}}),c&&no(Vde,{label:"Height",value:c,onClick:function(){return i(L4(c))}}),f&&no(Vde,{label:"Initial image",value:f,isLink:!0,onClick:function(){return i(M4(f))}}),h&&no(Vde,{label:"Mask image",value:h,isLink:!0,onClick:function(){return i(I4(h))}}),"img2img"===_&&S&&no(Vde,{label:"Image to image strength",value:S,onClick:function(){return i(O4(S))}}),u&&no(Vde,{label:"Image to image fit",value:u,onClick:function(){return i(G4(u))}}),g&&g.length>0&&ro(to,{children:[no(xP,{size:"sm",children:"Postprocessing"}),g.map((function(e,t){if("esrgan"===e.type){var n=e.scale,r=e.strength;return ro(yP,{pl:"2rem",gap:1,direction:"column",children:[no(jP,{size:"md",children:"".concat(t+1,": Upscale (ESRGAN)")}),no(Vde,{label:"Scale",value:n,onClick:function(){return i(d6(n))}}),no(Vde,{label:"Strength",value:r,onClick:function(){return i(f6(r))}})]},t)}if("gfpgan"===e.type){var o=e.strength;return ro(yP,{pl:"2rem",gap:1,direction:"column",children:[no(jP,{size:"md",children:"".concat(t+1,": Face restoration (GFPGAN)")}),no(Vde,{label:"Strength",value:o,onClick:function(){i(o6(o)),i(i6("gfpgan"))}})]},t)}if("codeformer"===e.type){var a=e.strength,s=e.fidelity;return ro(yP,{pl:"2rem",gap:1,direction:"column",children:[no(jP,{size:"md",children:"".concat(t+1,": Face restoration (Codeformer)")}),no(Vde,{label:"Strength",value:a,onClick:function(){i(o6(a)),i(i6("codeformer"))}}),s&&no(Vde,{label:"Fidelity",value:s,onClick:function(){i(r6(s)),i(i6("codeformer"))}})]},t)}}))]}),s&&no(Vde,{withCopy:!0,label:"Dream Prompt",value:s}),ro(yP,{gap:2,direction:"column",children:[ro(yP,{gap:2,children:[no(kY,{label:"Copy metadata JSON",children:no(x_,{"aria-label":"Copy metadata JSON",icon:no(qce,{}),size:"xs",variant:"ghost",fontSize:14,onClick:function(){return navigator.clipboard.writeText(L)}})}),no(jP,{fontWeight:"semibold",children:"Metadata JSON:"})]}),no("div",{className:"image-json-viewer",children:no("pre",{children:L})})]})]}):no(hP,{width:"100%",pt:10,children:no(jP,{fontSize:"lg",fontWeight:"semibold",children:"No metadata available"})})]})})}),(function(e,t){return e.image.uuid===t.image.uuid}));Wde.displayName="ImageMetadataViewer";var Ude=QX([Mde,pae],(function(e,t){var n=e.currentCategory,r=e.currentImage,o=e.intermediateImage,i=t.shouldShowImageDetails,a=e.categories[r?r.category:"result"].images,s=a.findIndex((function(t){var n;return t.uuid===(null==e||null===(n=e.currentImage)||void 0===n?void 0:n.uuid)})),l=a.length;return{imageToDisplay:o||r,isIntermediate:Boolean(o),viewerImageToDisplay:r,currentCategory:n,isOnFirstImage:0===s,isOnLastImage:!isNaN(s)&&s===l-1,shouldShowImageDetails:i,shouldShowPrevImageButton:0===s,shouldShowNextImageButton:!isNaN(s)&&s===l-1}}),{memoizeOptions:{resultEqualityCheck:dae}});function Gde(){var e=wie(),t=kie(Ude),n=t.isOnFirstImage,r=t.isOnLastImage,o=t.shouldShowImageDetails,i=t.imageToDisplay,a=t.isIntermediate,s=yn(cr.useState(!1),2),l=s[0],u=s[1],c=function(){u(!0)},d=function(){u(!1)};return ro("div",{className:"current-image-preview",children:[i&&no(c_,{src:i.url,width:i.width,height:i.height,style:{imageRendering:a?"pixelated":"initial"}}),!o&&ro("div",{className:"current-image-next-prev-buttons",children:[no("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:c,onMouseOut:d,children:l&&!n&&no(x_,{"aria-label":"Previous image",icon:no(zce,{className:"next-prev-button"}),variant:"unstyled",onClick:function(){e(t4())}})}),no("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:c,onMouseOut:d,children:l&&!r&&no(x_,{"aria-label":"Next image",icon:no(jce,{className:"next-prev-button"}),variant:"unstyled",onClick:function(){e(e4())}})})]}),o&&i&&no(Wde,{image:i,styleClass:"current-image-metadata"})]})}var qde,Yde,Zde=globalThis&&globalThis.__extends||(qde=function(e,t){return qde=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},qde(e,t)},function(e,t){function n(){this.constructor=e}qde(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),Xde=globalThis&&globalThis.__assign||function(){return Xde=Object.assign||function(e){for(var t,n=1,r=arguments.length;n2&&void 0!==arguments[2]?arguments[2]:{},r=n.checkForDefaultPrevented,o=void 0===r||r;return function(n){if(null==e||e(n),!1===o||!n.defaultPrevented)return null==t?void 0:t(n)}}function Xfe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[];function r(t,r){var o=cr.createContext(r),i=n.length;function a(t){var n=t.scope,r=t.children,a=sn(t,yt),s=(null==n?void 0:n[e][i])||o,l=cr.useMemo((function(){return a}),Object.values(a));return cr.createElement(s.Provider,{value:l},r)}return n=[].concat(cn(n),[r]),a.displayName=t+"Provider",[a,function(n,a){var s=(null==a?void 0:a[e][i])||o,l=cr.useContext(s);if(l)return l;if(void 0!==r)return r;throw new Error("`".concat(n,"` must be used within `").concat(t,"`"))}]}var o=function(){var t=n.map((function(e){return cr.createContext(e)}));return function(n){var r=(null==n?void 0:n[e])||t;return cr.useMemo((function(){return gn({},"__scope".concat(e),un(un({},n),{},gn({},e,r)))}),[n,r])}};return o.scopeName=e,[r,$fe.apply(void 0,[o].concat(cn(t)))]}function $fe(){for(var e=arguments.length,t=new Array(e),n=0;n1?cr.Children.only(null):cr.isValidElement(a)?a.props.children:null:e}));return cr.createElement(the,ps({},r,{ref:t}),cr.isValidElement(a)?cr.cloneElement(a,void 0,s):null)}return cr.createElement(the,ps({},r,{ref:t}),n)}));ehe.displayName="Slot";var the=cr.forwardRef((function(e,t){var n=e.children,r=sn(e,wt);return cr.isValidElement(n)?cr.cloneElement(n,un(un({},function(e,t){var n=un({},t),r=function(){var r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=function(){i.apply(void 0,arguments),r.apply(void 0,arguments)}:r&&(n[o]=r):"style"===o?n[o]=un(un({},r),i):"className"===o&&(n[o]=[r,i].filter(Boolean).join(" "))};for(var o in t)r();return un(un({},e),n)}(r,n.props)),{},{ref:Qfe(t,n.ref)})):cr.Children.count(n)>1?cr.Children.only(null):null}));the.displayName="SlotClone";var nhe=function(e){var t=e.children;return cr.createElement(cr.Fragment,null,t)};function rhe(e){return cr.isValidElement(e)&&e.type===nhe}var ohe=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"].reduce((function(e,t){var n=cr.forwardRef((function(e,n){var r=e.asChild,o=sn(e,kt),i=r?ehe:t;return cr.useEffect((function(){window[Symbol.for("radix-ui")]=!0}),[]),cr.createElement(i,ps({},o,{ref:n}))}));return n.displayName="Primitive.".concat(t),un(un({},e),{},gn({},t,n))}),{});function ihe(e,t){e&&QO.flushSync((function(){return e.dispatchEvent(t)}))}function ahe(e){var t=e+"CollectionProvider",n=yn(Xfe(t),2),r=n[0],o=n[1],i=yn(r(t,{collectionRef:{current:null},itemMap:new Map}),2),a=i[0],s=i[1],l=e+"CollectionSlot",u=e+"CollectionItemSlot",c="data-radix-collection-item";return[{Provider:function(e){var t=e.scope,n=e.children,r=qr.useRef(null),o=qr.useRef(new Map).current;return qr.createElement(a,{scope:t,itemMap:o,collectionRef:r},n)},Slot:qr.forwardRef((function(e,t){var n=e.scope,r=e.children,o=Jfe(t,s(l,n).collectionRef);return qr.createElement(ehe,{ref:o},r)})),ItemSlot:qr.forwardRef((function(e,t){var n,r=e.scope,o=e.children,i=sn(e,xt),a=qr.useRef(null),l=Jfe(t,a),d=s(u,r);return qr.useEffect((function(){return d.itemMap.set(a,un({ref:a},i)),function(){d.itemMap.delete(a)}})),qr.createElement(ehe,(gn(n={},c,""),gn(n,"ref",l),n),o)}))},function(t){var n=s(e+"CollectionConsumer",t),r=qr.useCallback((function(){var e=n.collectionRef.current;if(!e)return[];var t=Array.from(e.querySelectorAll("[".concat(c,"]"))),r=Array.from(n.itemMap.values()).sort((function(e,n){return t.indexOf(e.ref.current)-t.indexOf(n.ref.current)}));return r}),[n.collectionRef,n.itemMap]);return r},o]}var she=cr.createContext(void 0);function lhe(e){var t=cr.useContext(she);return e||t||"ltr"}function uhe(e){var t=cr.useRef(e);return cr.useEffect((function(){t.current=e})),cr.useMemo((function(){return function(){for(var e,n,r=arguments.length,o=new Array(r),i=0;i0,S=k>=w,C=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null===globalThis||void 0===globalThis?void 0:globalThis.document,n=uhe(e),r=cr.useRef(!1),o=cr.useRef((function(){}));return cr.useEffect((function(){var e=function(e){if(e.target&&!r.current){var i=function(){mhe(fhe,n,a,{discrete:!0})},a={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=i,t.addEventListener("click",o.current,{once:!0})):i()}r.current=!1},i=window.setTimeout((function(){t.addEventListener("pointerdown",e)}),0);return function(){window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}}),[t,n]),{onPointerDownCapture:function(){return r.current=!0}}}((function(e){var t=e.target,n=cn(d.branches).some((function(e){return e.contains(t)}));S&&!n&&(null==a||a(e),null==l||l(e),e.defaultPrevented||null==u||u())}),v),_=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null===globalThis||void 0===globalThis?void 0:globalThis.document,n=uhe(e),r=cr.useRef(!1);return cr.useEffect((function(){var e=function(e){e.target&&!r.current&&mhe(hhe,n,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),function(){return t.removeEventListener("focusin",e)}}),[t,n]),{onFocusCapture:function(){return r.current=!0},onBlurCapture:function(){return r.current=!1}}}((function(e){var t=e.target;cn(d.branches).some((function(e){return e.contains(t)}))||(null==s||s(e),null==l||l(e),e.defaultPrevented||null==u||u())}),v);return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null===globalThis||void 0===globalThis?void 0:globalThis.document,n=uhe(e);cr.useEffect((function(){var e=function(e){"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e),function(){return t.removeEventListener("keydown",e)}}),[n,t])}((function(e){k===d.layers.size-1&&(null==i||i(e),!e.defaultPrevented&&u&&(e.preventDefault(),u()))}),v),cr.useEffect((function(){if(h)return o&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(che=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),ghe(),function(){o&&1===d.layersWithOutsidePointerEventsDisabled.size&&(v.body.style.pointerEvents=che)}}),[h,v,o,d]),cr.useEffect((function(){return function(){h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),ghe())}}),[h,d]),cr.useEffect((function(){var e=function(){return g({})};return document.addEventListener(dhe,e),function(){return document.removeEventListener(dhe,e)}}),[]),cr.createElement(ohe.div,ps({},c,{ref:m,style:un({pointerEvents:x?S?"auto":"none":void 0},e.style),onFocusCapture:Zfe(e.onFocusCapture,_.onFocusCapture),onBlurCapture:Zfe(e.onBlurCapture,_.onBlurCapture),onPointerDownCapture:Zfe(e.onPointerDownCapture,C.onPointerDownCapture)}))}));function ghe(){var e=new CustomEvent(dhe);document.dispatchEvent(e)}function mhe(e,t,n,r){var o=r.discrete,i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),o?ihe(i,a):i.dispatchEvent(a)}var yhe=0;function bhe(){var e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var whe="focusScope.autoFocusOnMount",khe="focusScope.autoFocusOnUnmount",xhe={bubbles:!1,cancelable:!0},She=cr.forwardRef((function(e,t){var n=e.loop,r=void 0!==n&&n,o=e.trapped,i=void 0!==o&&o,a=e.onMountAutoFocus,s=e.onUnmountAutoFocus,l=sn(e,Ct),u=yn(cr.useState(null),2),c=u[0],d=u[1],f=uhe(a),h=uhe(s),p=cr.useRef(null),v=Jfe(t,(function(e){return d(e)})),g=cr.useRef({paused:!1,pause:function(){this.paused=!0},resume:function(){this.paused=!1}}).current;cr.useEffect((function(){if(i){var e=function(e){if(!g.paused&&c){var t=e.target;c.contains(t)?p.current=t:Lhe(p.current,{select:!0})}},t=function(e){!g.paused&&c&&(c.contains(e.relatedTarget)||Lhe(p.current,{select:!0}))};return document.addEventListener("focusin",e),document.addEventListener("focusout",t),function(){document.removeEventListener("focusin",e),document.removeEventListener("focusout",t)}}}),[i,c,g.paused]),cr.useEffect((function(){if(c){Ahe.add(g);var e=document.activeElement;if(!c.contains(e)){var t=new CustomEvent(whe,xhe);c.addEventListener(whe,f),c.dispatchEvent(t),t.defaultPrevented||(!function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.select,o=void 0!==r&&r,i=document.activeElement,a=xn(e);try{for(a.s();!(t=a.n()).done;){if(Lhe(t.value,{select:o}),document.activeElement!==i)return}}catch(COe){a.e(COe)}finally{a.f()}}((n=Che(c),n.filter((function(e){return"A"!==e.tagName}))),{select:!0}),document.activeElement===e&&Lhe(c))}return function(){c.removeEventListener(whe,f),setTimeout((function(){var t=new CustomEvent(khe,xhe);c.addEventListener(khe,h),c.dispatchEvent(t),t.defaultPrevented||Lhe(null!=e?e:document.body,{select:!0}),c.removeEventListener(khe,h),Ahe.remove(g)}),0)}}var n}),[c,f,h,g]);var m=cr.useCallback((function(e){if((r||i)&&!g.paused){var t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){var o=e.currentTarget,a=function(e){var t=Che(e),n=_he(t,e),r=_he(t.reverse(),e);return[n,r]}(o),s=yn(a,2),l=s[0],u=s[1];l&&u?e.shiftKey||n!==u?e.shiftKey&&n===l&&(e.preventDefault(),r&&Lhe(u,{select:!0})):(e.preventDefault(),r&&Lhe(l,{select:!0})):n===o&&e.preventDefault()}}}),[r,i,g.paused]);return cr.createElement(ohe.div,ps({tabIndex:-1},l,{ref:v,onKeyDown:m}))}));function Che(e){for(var t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:function(e){var t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});n.nextNode();)t.push(n.currentNode);return t}function _he(e,t){var n,r=xn(e);try{for(r.s();!(n=r.n()).done;){var o=n.value;if(!Ehe(o,{upTo:t}))return o}}catch(COe){r.e(COe)}finally{r.f()}}function Ehe(e,t){var n=t.upTo;if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==n&&e===n)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function Phe(e){return e instanceof HTMLInputElement&&"select"in e}function Lhe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.select,r=void 0!==n&&n;if(e&&e.focus){var o=document.activeElement;e.focus({preventScroll:!0}),e!==o&&Phe(e)&&r&&e.select()}}var Ohe,Ahe=(Ohe=[],{add:function(e){var t=Ohe[0];e!==t&&(null==t||t.pause()),(Ohe=Mhe(Ohe,e)).unshift(e)},remove:function(e){var t;null===(t=(Ohe=Mhe(Ohe,e))[0])||void 0===t||t.resume()}});function Mhe(e,t){var n=cn(e),r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var The=Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)?cr.useLayoutEffect:function(){},Ihe=Yr["useId".toString()]||function(){},Rhe=0;function Nhe(e){return e.split("-")[0]}function Dhe(e){return e.split("-")[1]}function zhe(e){return["top","bottom"].includes(Nhe(e))?"x":"y"}function jhe(e){return"y"===e?"height":"width"}function Bhe(e,t,n){var r,o=e.reference,i=e.floating,a=o.x+o.width/2-i.width/2,s=o.y+o.height/2-i.height/2,l=zhe(t),u=jhe(l),c=o[u]/2-i[u]/2,d="x"===l;switch(Nhe(t)){case"top":r={x:a,y:o.y-i.height};break;case"bottom":r={x:a,y:o.y+o.height};break;case"right":r={x:o.x+o.width,y:s};break;case"left":r={x:o.x-i.width,y:s};break;default:r={x:o.x,y:o.y}}switch(Dhe(t)){case"start":r[l]-=c*(n&&d?-1:1);break;case"end":r[l]+=c*(n&&d?-1:1)}return r}var Fhe=function(){var e=qt(Ut().mark((function e(t,n,r){var o,i,a,s,l,u,c,d,f,h,p,v,g,m,y,b,w,k,x,S,C,_,E,P,L;return Ut().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.placement,i=void 0===o?"bottom":o,a=r.strategy,s=void 0===a?"absolute":a,l=r.middleware,u=void 0===l?[]:l,c=r.platform,e.next=9,null==c.isRTL?void 0:c.isRTL(n);case 9:return d=e.sent,e.next=12,c.getElementRects({reference:t,floating:n,strategy:s});case 12:f=e.sent,h=Bhe(f,i,d),p=h.x,v=h.y,g=i,m={},y=0,b=0;case 20:if(!(b0&&O!==A&&f.reference[y]<=f.floating[y],n.abrupt("return",(gn(o={},g,v[g]-(M?Ot.floating[i]&&(a=$he(a)),{main:a,cross:$he(a)}}var Qhe={start:"end",end:"start"};function Jhe(e){return e.replace(/start|end/g,(function(e){return Qhe[e]}))}var epe=["top","right","bottom","left"];epe.reduce((function(e,t){return e.concat(t,t+"-start",t+"-end")}),[]);var tpe=function(e){return void 0===e&&(e={}),{name:"flip",options:e,fn:function(t){return qt(Ut().mark((function n(){var r,o,i,a,s,l,u,c,d,f,h,p,v,g,m,y,b,w,k,x,S,C,_,E,P,L,O,A,M,T,I,R,N,D;return Ut().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o=t.placement,i=t.middlewareData,a=t.rects,s=t.initialPlacement,l=t.platform,u=t.elements,d=(c=e).mainAxis,f=void 0===d||d,h=c.crossAxis,p=void 0===h||h,v=c.fallbackPlacements,g=c.fallbackStrategy,m=void 0===g?"bestFit":g,y=c.flipAlignment,b=void 0===y||y,w=sn(c,_t),k=Nhe(o),x=v||(k!==s&&b?function(e){var t=$he(e);return[Jhe(e),t,Jhe(t)]}(s):[$he(s)]),S=[s].concat(cn(x)),n.next=22,Whe(t,w);case 22:if(C=n.sent,_=[],E=(null==(r=i.flip)?void 0:r.overflows)||[],f&&_.push(C[k]),!p){n.next=36;break}return n.t0=Khe,n.t1=o,n.t2=a,n.next=31,null==l.isRTL?void 0:l.isRTL(u.floating);case 31:n.t3=n.sent,P=(0,n.t0)(n.t1,n.t2,n.t3),L=P.main,O=P.cross,_.push(C[L],C[O]);case 36:if(E=[].concat(cn(E),[{placement:o,overflows:_}]),_.every((function(e){return e<=0}))){n.next=50;break}if(T=(null!=(A=null==(M=i.flip)?void 0:M.index)?A:0)+1,!(I=S[T])){n.next=40;break}return n.abrupt("return",{data:{index:T,overflows:E},reset:{placement:I}});case 40:R="bottom",n.t4=m,n.next="bestFit"===n.t4?44:"initialPlacement"===n.t4?47:48;break;case 44:return D=null==(N=E.map((function(e){return[e,e.overflows.filter((function(e){return e>0})).reduce((function(e,t){return e+t}),0)]})).sort((function(e,t){return e[1]-t[1]}))[0])?void 0:N[0].placement,D&&(R=D),n.abrupt("break",48);case 47:R=s;case 48:if(o===R){n.next=50;break}return n.abrupt("return",{reset:{placement:R}});case 50:return n.abrupt("return",{});case 51:case"end":return n.stop()}}),n)})))()}}};function npe(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function rpe(e){return epe.some((function(t){return e[t]>=0}))}var ope=function(e){var t=void 0===e?{}:e,n=t.strategy,r=void 0===n?"referenceHidden":n,o=sn(t,Et);return{name:"hide",fn:function(e){return qt(Ut().mark((function t(){var n,i,a;return Ut().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=e.rects,t.t0=r,t.next="referenceHidden"===t.t0?4:"escaped"===t.t0?11:18;break;case 4:return t.t1=npe,t.next=7,Whe(e,un(un({},o),{},{elementContext:"reference"}));case 7:return t.t2=t.sent,t.t3=n.reference,i=(0,t.t1)(t.t2,t.t3),t.abrupt("return",{data:{referenceHiddenOffsets:i,referenceHidden:rpe(i)}});case 11:return t.t4=npe,t.next=14,Whe(e,un(un({},o),{},{altBoundary:!0}));case 14:return t.t5=t.sent,t.t6=n.floating,a=(0,t.t4)(t.t5,t.t6),t.abrupt("return",{data:{escapedOffsets:a,escaped:rpe(a)}});case 18:return t.abrupt("return",{});case 19:case"end":return t.stop()}}),t)})))()}}},ipe=function(e){return void 0===e&&(e=0),{name:"offset",options:e,fn:function(t){return qt(Ut().mark((function n(){var r,o,i;return Ut().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=t.x,o=t.y,n.next=4,function(){var e=qt(Ut().mark((function e(t,n){var r,o,i,a,s,l,u,c,d,f,h,p,v,g;return Ut().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.placement,o=t.platform,i=t.elements,e.next=5,null==o.isRTL?void 0:o.isRTL(i.floating);case 5:return a=e.sent,s=Nhe(r),l=Dhe(r),u="x"===zhe(r),c=["left","top"].includes(s)?-1:1,d=a&&u?-1:1,f="function"==typeof n?n(t):n,h="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:un({mainAxis:0,crossAxis:0,alignmentAxis:null},f),p=h.mainAxis,v=h.crossAxis,g=h.alignmentAxis,e.abrupt("return",(l&&"number"==typeof g&&(v="end"===l?-1*g:g),u?{x:v*d,y:p*c}:{x:p*c,y:v*d}));case 14:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()(t,e);case 4:return i=n.sent,n.abrupt("return",{x:r+i.x,y:o+i.y,data:i});case 6:case"end":return n.stop()}}),n)})))()}}};function ape(e){return"x"===e?"y":"x"}var spe=function(e){return void 0===e&&(e={}),{name:"shift",options:e,fn:function(t){return qt(Ut().mark((function n(){var r,o,i,a,s,l,u,c,d,f,h,p,v,g,m,y,b,w,k,x,S;return Ut().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o=t.x,i=t.y,a=t.placement,l=(s=e).mainAxis,u=void 0===l||l,c=s.crossAxis,d=void 0!==c&&c,f=s.limiter,h=void 0===f?{fn:function(e){return{x:e.x,y:e.y}}}:f,p=sn(s,Pt),v={x:o,y:i},n.next=14,Whe(t,p);case 14:return g=n.sent,m=zhe(Nhe(a)),y=ape(m),b=v[m],w=v[y],u&&(k="y"===m?"bottom":"right",b=Yhe(b+g["y"===m?"top":"left"],b,b-g[k])),d&&(x="y"===y?"bottom":"right",w=Yhe(w+g["y"===y?"top":"left"],w,w-g[x])),S=h.fn(un(un({},t),{},(gn(r={},m,b),gn(r,y,w),r))),n.abrupt("return",un(un({},S),{},{data:{x:S.x-o,y:S.y-i}}));case 22:case"end":return n.stop()}}),n)})))()}}},lpe=function(e){return void 0===e&&(e={}),{options:e,fn:function(t){var n,r=t.x,o=t.y,i=t.placement,a=t.rects,s=t.middlewareData,l=e,u=l.offset,c=void 0===u?0:u,d=l.mainAxis,f=void 0===d||d,h=l.crossAxis,p=void 0===h||h,v={x:r,y:o},g=zhe(i),m=ape(g),y=v[g],b=v[m],w="function"==typeof c?c(un(un({},a),{},{placement:i})):c,k="number"==typeof w?{mainAxis:w,crossAxis:0}:un({mainAxis:0,crossAxis:0},w);if(f){var x="y"===g?"height":"width",S=a.reference[g]-a.floating[x]+k.mainAxis,C=a.reference[g]+a.reference[x]-k.mainAxis;yC&&(y=C)}if(p){var _,E,P,L,O="y"===g?"width":"height",A=["top","left"].includes(Nhe(i)),M=a.reference[m]-a.floating[O]+(A&&null!=(_=null==(E=s.offset)?void 0:E[m])?_:0)+(A?0:k.crossAxis),T=a.reference[m]+a.reference[O]+(A?0:null!=(P=null==(L=s.offset)?void 0:L[m])?P:0)-(A?k.crossAxis:0);bT&&(b=T)}return gn(n={},g,y),gn(n,m,b),n}}};function upe(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function cpe(e){if(null==e)return window;if(!upe(e)){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function dpe(e){return cpe(e).getComputedStyle(e)}function fpe(e){return upe(e)?"":e?(e.nodeName||"").toLowerCase():""}function hpe(){var e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function ppe(e){return e instanceof cpe(e).HTMLElement}function vpe(e){return e instanceof cpe(e).Element}function gpe(e){return"undefined"!=typeof ShadowRoot&&(e instanceof cpe(e).ShadowRoot||e instanceof ShadowRoot)}function mpe(e){var t=dpe(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function ype(e){return["table","td","th"].includes(fpe(e))}function bpe(e){var t=/firefox/i.test(hpe()),n=dpe(e);return"none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||["transform","perspective"].includes(n.willChange)||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter}function wpe(){return!/^((?!chrome|android).)*safari/i.test(hpe())}var kpe=Math.min,xpe=Math.max,Spe=Math.round;function Cpe(e,t,n){var r,o,i,a;void 0===t&&(t=!1),void 0===n&&(n=!1);var s=e.getBoundingClientRect(),l=1,u=1;t&&ppe(e)&&(l=e.offsetWidth>0&&Spe(s.width)/e.offsetWidth||1,u=e.offsetHeight>0&&Spe(s.height)/e.offsetHeight||1);var c=vpe(e)?cpe(e):window,d=!wpe()&&n,f=(s.left+(d&&null!=(r=null==(o=c.visualViewport)?void 0:o.offsetLeft)?r:0))/l,h=(s.top+(d&&null!=(i=null==(a=c.visualViewport)?void 0:a.offsetTop)?i:0))/u,p=s.width/l,v=s.height/u;return{width:p,height:v,top:h,right:f+p,bottom:h+v,left:f,x:f,y:h}}function _pe(e){return(t=e,(t instanceof cpe(t).Node?e.ownerDocument:e.document)||window.document).documentElement;var t}function Epe(e){return vpe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Ppe(e){return Cpe(_pe(e)).left+Epe(e).scrollLeft}function Lpe(e,t,n){var r=ppe(t),o=_pe(t),i=Cpe(e,r&&function(e){var t=Cpe(e);return Spe(t.width)!==e.offsetWidth||Spe(t.height)!==e.offsetHeight}(t),"fixed"===n),a={scrollLeft:0,scrollTop:0},s={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==fpe(t)||mpe(o))&&(a=Epe(t)),ppe(t)){var l=Cpe(t,!0);s.x=l.x+t.clientLeft,s.y=l.y+t.clientTop}else o&&(s.x=Ppe(o));return{x:i.left+a.scrollLeft-s.x,y:i.top+a.scrollTop-s.y,width:i.width,height:i.height}}function Ope(e){return"html"===fpe(e)?e:e.assignedSlot||e.parentNode||(gpe(e)?e.host:null)||_pe(e)}function Ape(e){return ppe(e)&&"fixed"!==getComputedStyle(e).position?e.offsetParent:null}function Mpe(e){for(var t=cpe(e),n=Ape(e);n&&ype(n)&&"static"===getComputedStyle(n).position;)n=Ape(n);return n&&("html"===fpe(n)||"body"===fpe(n)&&"static"===getComputedStyle(n).position&&!bpe(n))?t:n||function(e){var t=Ope(e);for(gpe(t)&&(t=t.host);ppe(t)&&!["html","body"].includes(fpe(t));){if(bpe(t))return t;t=t.parentNode}return null}(e)||t}function Tpe(e){if(ppe(e))return{width:e.offsetWidth,height:e.offsetHeight};var t=Cpe(e);return{width:t.width,height:t.height}}function Ipe(e){var t=Ope(e);return["html","body","#document"].includes(fpe(t))?e.ownerDocument.body:ppe(t)&&mpe(t)?t:Ipe(t)}function Rpe(e,t){var n;void 0===t&&(t=[]);var r=Ipe(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=cpe(r),a=o?[i].concat(i.visualViewport||[],mpe(r)?r:[]):r,s=t.concat(a);return o?s:s.concat(Rpe(a))}function Npe(e,t,n){return"viewport"===t?Vhe(function(e,t){var n=cpe(e),r=_pe(e),o=n.visualViewport,i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;var u=wpe();(u||!u&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s,y:l}}(e,n)):vpe(t)?function(e,t){var n=Cpe(e,!1,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft;return{top:r,left:o,x:o,y:r,right:o+e.clientWidth,bottom:r+e.clientHeight,width:e.clientWidth,height:e.clientHeight}}(t,n):Vhe(function(e){var t,n=_pe(e),r=Epe(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=xpe(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=xpe(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-r.scrollLeft+Ppe(e),l=-r.scrollTop;return"rtl"===dpe(o||n).direction&&(s+=xpe(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:l}}(_pe(e)))}function Dpe(e){var t=Rpe(e),n=["absolute","fixed"].includes(dpe(e).position)&&ppe(e)?Mpe(e):e;return vpe(n)?t.filter((function(e){return vpe(e)&&function(e,t){var n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&gpe(n)){var r=t;do{if(r&&e===r)return!0;r=r.parentNode||r.host}while(r)}return!1}(e,n)&&"body"!==fpe(e)})):[]}var zpe={getClippingRect:function(e){var t=e.element,n=e.boundary,r=e.rootBoundary,o=e.strategy,i=[].concat(cn("clippingAncestors"===n?Dpe(t):[].concat(n)),[r]),a=i[0],s=i.reduce((function(e,n){var r=Npe(t,n,o);return e.top=xpe(r.top,e.top),e.right=kpe(r.right,e.right),e.bottom=kpe(r.bottom,e.bottom),e.left=xpe(r.left,e.left),e}),Npe(t,a,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){var t=e.rect,n=e.offsetParent,r=e.strategy,o=ppe(n),i=_pe(n);if(n===i)return t;var a={scrollLeft:0,scrollTop:0},s={x:0,y:0};if((o||!o&&"fixed"!==r)&&(("body"!==fpe(n)||mpe(i))&&(a=Epe(n)),ppe(n))){var l=Cpe(n,!0);s.x=l.x+n.clientLeft,s.y=l.y+n.clientTop}return un(un({},t),{},{x:t.x-a.scrollLeft+s.x,y:t.y-a.scrollTop+s.y})},isElement:vpe,getDimensions:Tpe,getOffsetParent:Mpe,getDocumentElement:_pe,getElementRects:function(e){var t=e.reference,n=e.floating,r=e.strategy;return{reference:Lpe(t,Mpe(n),r),floating:un(un({},Tpe(n)),{},{x:0,y:0})}},getClientRects:function(e){return Array.from(e.getClientRects())},isRTL:function(e){return"rtl"===dpe(e).direction}};function jpe(e,t,n,r){void 0===r&&(r={});var o=r,i=o.ancestorScroll,a=void 0===i||i,s=o.ancestorResize,l=void 0===s||s,u=o.elementResize,c=void 0===u||u,d=o.animationFrame,f=void 0!==d&&d,h=a&&!f,p=l&&!f,v=h||p?[].concat(cn(vpe(e)?Rpe(e):[]),cn(Rpe(t))):[];v.forEach((function(e){h&&e.addEventListener("scroll",n,{passive:!0}),p&&e.addEventListener("resize",n)}));var g,m=null;if(c){var y=!0;m=new ResizeObserver((function(){y||n(),y=!1})),vpe(e)&&!f&&m.observe(e),m.observe(t)}var b=f?Cpe(e):null;return f&&function t(){var r=Cpe(e);!b||r.x===b.x&&r.y===b.y&&r.width===b.width&&r.height===b.height||n(),b=r,g=requestAnimationFrame(t)}(),n(),function(){var e;v.forEach((function(e){h&&e.removeEventListener("scroll",n),p&&e.removeEventListener("resize",n)})),null==(e=m)||e.disconnect(),m=null,f&&cancelAnimationFrame(g)}}var Bpe="undefined"!=typeof document?cr.useLayoutEffect:cr.useEffect;function Fpe(e,t){if(e===t)return!0;if(kn(e)!==kn(t))return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;var n,r,o;if(e&&t&&"object"==kn(e)){if(Array.isArray(e)){if((n=e.length)!=t.length)return!1;for(r=n;0!=r--;)if(!Fpe(e[r],t[r]))return!1;return!0}if((n=(o=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){var i=o[r];if(("_owner"!==i||!e.$$typeof)&&!Fpe(e[i],t[i]))return!1}return!0}return e!=e&&t!=t}function Hpe(e){var t=void 0===e?{}:e,n=t.middleware,r=t.placement,o=void 0===r?"bottom":r,i=t.strategy,a=void 0===i?"absolute":i,s=t.whileElementsMounted,l=cr.useRef(null),u=cr.useRef(null),c=function(e){var t=cr.useRef(e);return Bpe((function(){t.current=e})),t}(s),d=cr.useRef(null),f=yn(cr.useState({x:null,y:null,strategy:a,placement:o,middlewareData:{}}),2),h=f[0],p=f[1],v=yn(cr.useState(n),2),g=v[0],m=v[1];Fpe(null==g?void 0:g.map((function(e){return e.options})),null==n?void 0:n.map((function(e){return e.options})))||m(n);var y=cr.useCallback((function(){l.current&&u.current&&function(e,t,n){return Fhe(e,t,un({platform:zpe},n))}(l.current,u.current,{middleware:g,placement:o,strategy:a}).then((function(e){b.current&&QO.flushSync((function(){p(e)}))}))}),[g,o,a]);Bpe((function(){b.current&&y()}),[y]);var b=cr.useRef(!1);Bpe((function(){return b.current=!0,function(){b.current=!1}}),[]);var w=cr.useCallback((function(){if("function"==typeof d.current&&(d.current(),d.current=null),l.current&&u.current)if(c.current){var e=c.current(l.current,u.current,y);d.current=e}else y()}),[y,c]),k=cr.useCallback((function(e){l.current=e,w()}),[w]),x=cr.useCallback((function(e){u.current=e,w()}),[w]),S=cr.useMemo((function(){return{reference:l,floating:u}}),[]);return cr.useMemo((function(){return un(un({},h),{},{update:y,refs:S,reference:k,floating:x})}),[h,y,S,k,x])}var Vpe=function(e){var t=e.element,n=e.padding;return{name:"arrow",options:e,fn:function(e){return function(e){return Object.prototype.hasOwnProperty.call(e,"current")}(t)?null!=t.current?Zhe({element:t.current,padding:n}).fn(e):{}:t?Zhe({element:t,padding:n}).fn(e):{}}}};var Wpe="Popper",Upe=yn(Xfe(Wpe),2),Gpe=Upe[0],qpe=Upe[1],Ype=yn(Gpe(Wpe),2),Zpe=Ype[0],Xpe=Ype[1],$pe=cr.forwardRef((function(e,t){var n=e.__scopePopper,r=e.virtualRef,o=sn(e,Lt),i=Xpe("PopperAnchor",n),a=cr.useRef(null),s=Jfe(t,a);return cr.useEffect((function(){i.onAnchorChange((null==r?void 0:r.current)||a.current)})),r?null:cr.createElement(ohe.div,ps({},o,{ref:s}))})),Kpe="PopperContent",Qpe=yn(Gpe(Kpe),2),Jpe=Qpe[0],eve=(Qpe[1],yn(Gpe(Kpe,{hasParent:!1,positionUpdateFns:new Set}),2)),tve=eve[0],nve=eve[1],rve=cr.forwardRef((function(e,t){var n,r,o,i,a,s,l,u,c=e.__scopePopper,d=e.side,f=void 0===d?"bottom":d,h=e.sideOffset,p=void 0===h?0:h,v=e.align,g=void 0===v?"center":v,m=e.alignOffset,y=void 0===m?0:m,b=e.arrowPadding,w=void 0===b?0:b,k=e.collisionBoundary,x=void 0===k?[]:k,S=e.collisionPadding,C=void 0===S?0:S,_=e.sticky,E=void 0===_?"partial":_,P=e.hideWhenDetached,L=void 0!==P&&P,O=e.avoidCollisions,A=void 0===O||O,M=sn(e,Ot),T=Xpe(Kpe,c),I=yn(cr.useState(null),2),R=I[0],N=I[1],D=Jfe(t,(function(e){return N(e)})),z=yn(cr.useState(null),2),j=z[0],B=z[1],F=function(e){var t=yn(cr.useState(void 0),2),n=t[0],r=t[1];return The((function(){if(e){r({width:e.offsetWidth,height:e.offsetHeight});var t=new ResizeObserver((function(t){if(Array.isArray(t)&&t.length){var n,o,i=t[0];if("borderBoxSize"in i){var a=i.borderBoxSize,s=Array.isArray(a)?a[0]:a;n=s.inlineSize,o=s.blockSize}else n=e.offsetWidth,o=e.offsetHeight;r({width:n,height:o})}}));return t.observe(e,{box:"border-box"}),function(){return t.unobserve(e)}}r(void 0)}),[e]),n}(j),H=null!==(n=null==F?void 0:F.width)&&void 0!==n?n:0,V=null!==(r=null==F?void 0:F.height)&&void 0!==r?r:0,W=f+("center"!==g?"-"+g:""),U="number"==typeof C?C:un({top:0,right:0,bottom:0,left:0},C),G=Array.isArray(x)?x:[x],q=G.length>0,Y={padding:U,boundary:G.filter(ive),altBoundary:q},Z=Hpe({strategy:"fixed",placement:W,whileElementsMounted:jpe,middleware:[ipe({mainAxis:p+V,alignmentAxis:y}),A?spe(un({mainAxis:!0,crossAxis:!1,limiter:"partial"===E?lpe():void 0},Y)):void 0,j?Vpe({element:j,padding:w}):void 0,A?tpe(un({},Y)):void 0,ave({arrowWidth:H,arrowHeight:V}),L?ope({strategy:"referenceHidden"}):void 0].filter(ove)}),X=Z.reference,$=Z.floating,K=Z.strategy,Q=Z.x,J=Z.y,ee=Z.placement,te=Z.middlewareData,ne=Z.update;The((function(){X(T.anchor)}),[X,T.anchor]);var re=null!==Q&&null!==J,oe=yn(sve(ee),2),ie=oe[0],ae=oe[1],se=null===(o=te.arrow)||void 0===o?void 0:o.x,le=null===(i=te.arrow)||void 0===i?void 0:i.y,ue=0!==(null===(a=te.arrow)||void 0===a?void 0:a.centerOffset),ce=yn(cr.useState(),2),de=ce[0],fe=ce[1];The((function(){R&&fe(window.getComputedStyle(R).zIndex)}),[R]);var he=nve(Kpe,c),pe=he.hasParent,ve=he.positionUpdateFns,ge=!pe;cr.useLayoutEffect((function(){if(!ge)return ve.add(ne),function(){ve.delete(ne)}}),[ge,ve,ne]),cr.useLayoutEffect((function(){ge&&re&&Array.from(ve).reverse().forEach((function(e){return requestAnimationFrame(e)}))}),[ge,re,ve]);var me=un(un({"data-side":ie,"data-align":ae},M),{},{ref:D,style:un(un({},M.style),{},{animation:re?void 0:"none",opacity:null!==(s=te.hide)&&void 0!==s&&s.referenceHidden?0:void 0})});return cr.createElement("div",{ref:$,"data-radix-popper-content-wrapper":"",style:gn({position:K,left:0,top:0,transform:re?"translate3d(".concat(Math.round(Q),"px, ").concat(Math.round(J),"px, 0)"):"translate3d(0, -200%, 0)",minWidth:"max-content",zIndex:de},"--radix-popper-transform-origin",[null===(l=te.transformOrigin)||void 0===l?void 0:l.x,null===(u=te.transformOrigin)||void 0===u?void 0:u.y].join(" "))},cr.createElement(Jpe,{scope:c,placedSide:ie,onArrowChange:B,arrowX:se,arrowY:le,shouldHideArrow:ue},ge?cr.createElement(tve,{scope:c,hasParent:!0,positionUpdateFns:ve},cr.createElement(ohe.div,me)):cr.createElement(ohe.div,me)))}));function ove(e){return void 0!==e}function ive(e){return null!==e}var ave=function(e){return{name:"transformOrigin",options:e,fn:function(t){var n,r,o,i,a,s=t.placement,l=t.rects,u=t.middlewareData,c=0!==(null===(n=u.arrow)||void 0===n?void 0:n.centerOffset),d=c?0:e.arrowWidth,f=c?0:e.arrowHeight,h=yn(sve(s),2),p=h[0],v={start:"0%",center:"50%",end:"100%"}[h[1]],g=(null!==(r=null===(o=u.arrow)||void 0===o?void 0:o.x)&&void 0!==r?r:0)+d/2,m=(null!==(i=null===(a=u.arrow)||void 0===a?void 0:a.y)&&void 0!==i?i:0)+f/2,y="",b="";return"bottom"===p?(y=c?v:"".concat(g,"px"),b="".concat(-f,"px")):"top"===p?(y=c?v:"".concat(g,"px"),b="".concat(l.floating.height+f,"px")):"right"===p?(y="".concat(-f,"px"),b=c?v:"".concat(m,"px")):"left"===p&&(y="".concat(l.floating.width+f,"px"),b=c?v:"".concat(m,"px")),{data:{x:y,y:b}}}}};function sve(e){var t=yn(e.split("-"),2),n=t[0],r=t[1];return[n,void 0===r?"center":r]}var lve=function(e){var t=e.__scopePopper,n=e.children,r=yn(cr.useState(null),2),o=r[0],i=r[1];return cr.createElement(Zpe,{scope:t,anchor:o,onAnchorChange:i},n)},uve=$pe,cve=rve;var dve=function(e){var t=e.present,n=e.children,r=function(e){var t=yn(cr.useState(),2),n=t[0],r=t[1],o=cr.useRef({}),i=cr.useRef(e),a=cr.useRef("none"),s=e?"mounted":"unmounted",l=function(e,t){return cr.useReducer((function(e,n){var r=t[e][n];return null!=r?r:e}),e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}}),u=yn(l,2),c=u[0],d=u[1];return cr.useEffect((function(){var e=fve(o.current);a.current="mounted"===c?e:"none"}),[c]),The((function(){var t=o.current,n=i.current;if(n!==e){var r=a.current,s=fve(t);if(e)d("MOUNT");else if("none"===s||"none"===(null==t?void 0:t.display))d("UNMOUNT");else{d(n&&r!==s?"ANIMATION_OUT":"UNMOUNT")}i.current=e}}),[e,d]),The((function(){if(n){var e=function(e){var t=fve(o.current).includes(e.animationName);e.target===n&&t&&QO.flushSync((function(){return d("ANIMATION_END")}))},t=function(e){e.target===n&&(a.current=fve(o.current))};return n.addEventListener("animationstart",t),n.addEventListener("animationcancel",e),n.addEventListener("animationend",e),function(){n.removeEventListener("animationstart",t),n.removeEventListener("animationcancel",e),n.removeEventListener("animationend",e)}}d("ANIMATION_END")}),[n,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:cr.useCallback((function(e){e&&(o.current=getComputedStyle(e)),r(e)}),[])}}(t),o="function"==typeof n?n({present:r.isPresent}):cr.Children.only(n),i=Jfe(r.ref,o.ref);return"function"==typeof n||r.isPresent?cr.cloneElement(o,{ref:i}):null};function fve(e){return(null==e?void 0:e.animationName)||"none"}function hve(e){var t=e.prop,n=e.defaultProp,r=e.onChange,o=void 0===r?function(){}:r,i=function(e){var t=e.defaultProp,n=e.onChange,r=cr.useState(t),o=yn(r,1)[0],i=cr.useRef(o),a=uhe(n);return cr.useEffect((function(){i.current!==o&&(a(o),i.current=o)}),[o,i,a]),r}({defaultProp:n,onChange:o}),a=yn(i,2),s=a[0],l=a[1],u=void 0!==t,c=u?t:s,d=uhe(o);return[c,cr.useCallback((function(e){if(u){var n="function"==typeof e?e(t):e;n!==t&&d(n)}else l(e)}),[u,t,l,d])]}dve.displayName="Presence";var pve="rovingFocusGroup.onEntryFocus",vve={bubbles:!1,cancelable:!0},gve="RovingFocusGroup",mve=yn(ahe(gve),3),yve=mve[0],bve=mve[1],wve=yn(Xfe(gve,[mve[2]]),2),kve=wve[0],xve=wve[1],Sve=yn(kve(gve),2),Cve=Sve[0],_ve=Sve[1],Eve=cr.forwardRef((function(e,t){return cr.createElement(yve.Provider,{scope:e.__scopeRovingFocusGroup},cr.createElement(yve.Slot,{scope:e.__scopeRovingFocusGroup},cr.createElement(Pve,ps({},e,{ref:t}))))})),Pve=cr.forwardRef((function(e,t){var n=e.__scopeRovingFocusGroup,r=e.orientation,o=e.loop,i=void 0!==o&&o,a=e.dir,s=e.currentTabStopId,l=e.defaultCurrentTabStopId,u=e.onCurrentTabStopIdChange,c=e.onEntryFocus,d=sn(e,At),f=cr.useRef(null),h=Jfe(t,f),p=lhe(a),v=yn(hve({prop:s,defaultProp:l,onChange:u}),2),g=v[0],m=void 0===g?null:g,y=v[1],b=yn(cr.useState(!1),2),w=b[0],k=b[1],x=uhe(c),S=bve(n),C=cr.useRef(!1),_=yn(cr.useState(0),2),E=_[0],P=_[1];return cr.useEffect((function(){var e=f.current;if(e)return e.addEventListener(pve,x),function(){return e.removeEventListener(pve,x)}}),[x]),cr.createElement(Cve,{scope:n,orientation:r,dir:p,loop:i,currentTabStopId:m,onItemFocus:cr.useCallback((function(e){return y(e)}),[y]),onItemShiftTab:cr.useCallback((function(){return k(!0)}),[]),onFocusableItemAdd:cr.useCallback((function(){return P((function(e){return e+1}))}),[]),onFocusableItemRemove:cr.useCallback((function(){return P((function(e){return e-1}))}),[])},cr.createElement(ohe.div,ps({tabIndex:w||0===E?-1:0,"data-orientation":r},d,{ref:h,style:un({outline:"none"},e.style),onMouseDown:Zfe(e.onMouseDown,(function(){C.current=!0})),onFocus:Zfe(e.onFocus,(function(e){var t=!C.current;if(e.target===e.currentTarget&&t&&!w){var n=new CustomEvent(pve,vve);if(e.currentTarget.dispatchEvent(n),!n.defaultPrevented){var r=S().filter((function(e){return e.focusable}));Ave([r.find((function(e){return e.active})),r.find((function(e){return e.id===m}))].concat(cn(r)).filter(Boolean).map((function(e){return e.ref.current})))}}C.current=!1})),onBlur:Zfe(e.onBlur,(function(){return k(!1)}))})))})),Lve=cr.forwardRef((function(e,t){var n=e.__scopeRovingFocusGroup,r=e.focusable,o=void 0===r||r,i=e.active,a=void 0!==i&&i,s=sn(e,Mt),l=function(e){var t=yn(cr.useState(Ihe()),2),n=t[0],r=t[1];return The((function(){e||r((function(e){return null!=e?e:String(Rhe++)}))}),[e]),e||(n?"radix-".concat(n):"")}(),u=_ve("RovingFocusGroupItem",n),c=u.currentTabStopId===l,d=bve(n),f=u.onFocusableItemAdd,h=u.onFocusableItemRemove;return cr.useEffect((function(){if(o)return f(),function(){return h()}}),[o,f,h]),cr.createElement(yve.ItemSlot,{scope:n,id:l,focusable:o,active:a},cr.createElement(ohe.span,ps({tabIndex:c?0:-1,"data-orientation":u.orientation},s,{ref:t,onMouseDown:Zfe(e.onMouseDown,(function(e){o?u.onItemFocus(l):e.preventDefault()})),onFocus:Zfe(e.onFocus,(function(){return u.onItemFocus(l)})),onKeyDown:Zfe(e.onKeyDown,(function(e){if("Tab"===e.key&&e.shiftKey)u.onItemShiftTab();else if(e.target===e.currentTarget){var t,n,r=function(e,t,n){var r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:Ove[r]}(e,u.orientation,u.dir);if(void 0!==r){e.preventDefault();var o=d().filter((function(e){return e.focusable})).map((function(e){return e.ref.current}));if("last"===r)o.reverse();else if("prev"===r||"next"===r){"prev"===r&&o.reverse();var i=o.indexOf(e.currentTarget);o=u.loop?(n=i+1,(t=o).map((function(e,r){return t[(n+r)%t.length]}))):o.slice(i+1)}setTimeout((function(){return Ave(o)}))}}}))})))})),Ove={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ave(e){var t,n=document.activeElement,r=xn(e);try{for(r.s();!(t=r.n()).done;){var o=t.value;if(o===n)return;if(o.focus(),document.activeElement!==n)return}}catch(COe){r.e(COe)}finally{r.f()}}var Mve=Eve,Tve=Lve,Ive=["Enter"," "],Rve=["ArrowUp","PageDown","End"],Nve=[].concat(["ArrowDown","PageUp","Home"],Rve),Dve="Menu",zve=yn(ahe(Dve),3),jve=zve[0],Bve=zve[1],Fve=yn(Xfe(Dve,[zve[2],qpe,xve]),2),Hve=Fve[0],Vve=Fve[1],Wve=qpe(),Uve=xve(),Gve=yn(Hve(Dve),2),qve=Gve[0],Yve=Gve[1],Zve=yn(Hve(Dve),2),Xve=Zve[0],$ve=Zve[1],Kve=cr.forwardRef((function(e,t){var n=e.__scopeMenu,r=sn(e,Tt),o=Wve(n);return cr.createElement(uve,ps({},o,r,{ref:t}))})),Qve=yn(Hve("MenuPortal",{forceMount:void 0}),2),Jve=(Qve[0],Qve[1]),ege="MenuContent",tge=yn(Hve(ege),2),nge=tge[0],rge=tge[1],oge=cr.forwardRef((function(e,t){var n=Jve(ege,e.__scopeMenu),r=e.forceMount,o=void 0===r?n.forceMount:r,i=sn(e,It),a=Yve(ege,e.__scopeMenu),s=$ve(ege,e.__scopeMenu);return cr.createElement(jve.Provider,{scope:e.__scopeMenu},cr.createElement(dve,{present:o||a.open},cr.createElement(jve.Slot,{scope:e.__scopeMenu},s.modal?cr.createElement(ige,ps({},i,{ref:t})):cr.createElement(age,ps({},i,{ref:t})))))})),ige=cr.forwardRef((function(e,t){var n=Yve(ege,e.__scopeMenu),r=cr.useRef(null),o=Jfe(t,r);return cr.useEffect((function(){var e=r.current;if(e)return SH(e)}),[]),cr.createElement(sge,ps({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Zfe(e.onFocusOutside,(function(e){return e.preventDefault()}),{checkForDefaultPrevented:!1}),onDismiss:function(){return n.onOpenChange(!1)}}))})),age=cr.forwardRef((function(e,t){var n=Yve(ege,e.__scopeMenu);return cr.createElement(sge,ps({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:function(){return n.onOpenChange(!1)}}))})),sge=cr.forwardRef((function(e,t){var n=e.__scopeMenu,r=e.loop,o=void 0!==r&&r,i=e.trapFocus,a=e.onOpenAutoFocus,s=e.onCloseAutoFocus,l=e.disableOutsidePointerEvents,u=e.onEscapeKeyDown,c=e.onPointerDownOutside,d=e.onFocusOutside,f=e.onInteractOutside,h=e.onDismiss,p=e.disableOutsideScroll,v=sn(e,Rt),g=Yve(ege,n),m=$ve(ege,n),y=Wve(n),b=Uve(n),w=Bve(n),k=yn(cr.useState(null),2),x=k[0],S=k[1],C=cr.useRef(null),_=Jfe(t,C,g.onContentChange),E=cr.useRef(0),P=cr.useRef(""),L=cr.useRef(0),O=cr.useRef(null),A=cr.useRef("right"),M=cr.useRef(0),T=p?NW:cr.Fragment,I=p?{as:ehe,allowPinchZoom:!0}:void 0,R=function(e){var t,n,r=P.current+e,o=w().filter((function(e){return!e.disabled})),i=document.activeElement,a=null===(t=o.find((function(e){return e.ref.current===i})))||void 0===t?void 0:t.textValue,s=function(e,t,n){var r=t.length>1&&Array.from(t).every((function(e){return e===t[0]})),o=r?t[0]:t,i=n?e.indexOf(n):-1,a=(s=e,l=Math.max(i,0),s.map((function(e,t){return s[(l+t)%s.length]})));var s,l;1===o.length&&(a=a.filter((function(e){return e!==n})));var u=a.find((function(e){return e.toLowerCase().startsWith(o.toLowerCase())}));return u!==n?u:void 0}(o.map((function(e){return e.textValue})),r,a),l=null===(n=o.find((function(e){return e.textValue===s})))||void 0===n?void 0:n.ref.current;!function e(t){P.current=t,window.clearTimeout(E.current),""!==t&&(E.current=window.setTimeout((function(){return e("")}),1e3))}(r),l&&setTimeout((function(){return l.focus()}))};cr.useEffect((function(){return function(){return window.clearTimeout(E.current)}}),[]),cr.useEffect((function(){var e,t,n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",null!==(e=n[0])&&void 0!==e?e:bhe()),document.body.insertAdjacentElement("beforeend",null!==(t=n[1])&&void 0!==t?t:bhe()),yhe++,function(){1===yhe&&document.querySelectorAll("[data-radix-focus-guard]").forEach((function(e){return e.remove()})),yhe--}}),[]);var N,D=cr.useCallback((function(e){var t,n;return A.current===(null===(t=O.current)||void 0===t?void 0:t.side)&&function(e,t){if(!t)return!1;var n={x:e.clientX,y:e.clientY};return function(e,t){for(var n=e.x,r=e.y,o=!1,i=0,a=t.length-1;ir!=c>r&&n<(u-s)*(r-l)/(c-l)+s&&(o=!o)}return o}(n,t)}(e,null===(n=O.current)||void 0===n?void 0:n.area)}),[]);return cr.createElement(nge,{scope:n,searchRef:P,onItemEnter:cr.useCallback((function(e){D(e)&&e.preventDefault()}),[D]),onItemLeave:cr.useCallback((function(e){var t;D(e)||(null===(t=C.current)||void 0===t||t.focus(),S(null))}),[D]),onTriggerLeave:cr.useCallback((function(e){D(e)&&e.preventDefault()}),[D]),pointerGraceTimerRef:L,onPointerGraceIntentChange:cr.useCallback((function(e){O.current=e}),[])},cr.createElement(T,I,cr.createElement(She,{asChild:!0,trapped:i,onMountAutoFocus:Zfe(a,(function(e){var t;e.preventDefault(),null===(t=C.current)||void 0===t||t.focus()})),onUnmountAutoFocus:s},cr.createElement(vhe,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:f,onDismiss:h},cr.createElement(Mve,ps({asChild:!0},b,{dir:m.dir,orientation:"vertical",loop:o,currentTabStopId:x,onCurrentTabStopIdChange:S,onEntryFocus:function(e){m.isUsingKeyboardRef.current||e.preventDefault()}}),cr.createElement(cve,ps({role:"menu","aria-orientation":"vertical","data-state":(N=g.open,N?"open":"closed"),"data-radix-menu-content":"",dir:m.dir},y,v,{ref:_,style:un({outline:"none"},v.style),onKeyDown:Zfe(v.onKeyDown,(function(e){var t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!n&&r&&R(e.key));var o=C.current;if(e.target===o&&Nve.includes(e.key)){e.preventDefault();var i=w().filter((function(e){return!e.disabled})).map((function(e){return e.ref.current}));Rve.includes(e.key)&&i.reverse(),function(e){var t,n=document.activeElement,r=xn(e);try{for(r.s();!(t=r.n()).done;){var o=t.value;if(o===n)return;if(o.focus(),document.activeElement!==n)return}}catch(COe){r.e(COe)}finally{r.f()}}(i)}})),onBlur:Zfe(e.onBlur,(function(e){e.currentTarget.contains(e.target)||(window.clearTimeout(E.current),P.current="")})),onPointerMove:Zfe(e.onPointerMove,fge((function(e){var t=e.target,n=M.current!==e.clientX;if(e.currentTarget.contains(t)&&n){var r=e.clientX>M.current?"right":"left";A.current=r,M.current=e.clientX}})))})))))))})),lge="MenuItem",uge="menu.itemSelect",cge=cr.forwardRef((function(e,t){var n=e.disabled,r=void 0!==n&&n,o=e.onSelect,i=sn(e,Nt),a=cr.useRef(null),s=$ve(lge,e.__scopeMenu),l=rge(lge,e.__scopeMenu),u=Jfe(t,a),c=cr.useRef(!1);return cr.createElement(dge,ps({},i,{ref:u,disabled:r,onClick:Zfe(e.onClick,(function(){var e=a.current;if(!r&&e){var t=new CustomEvent(uge,{bubbles:!0,cancelable:!0});e.addEventListener(uge,(function(e){return null==o?void 0:o(e)}),{once:!0}),ihe(e,t),t.defaultPrevented?c.current=!1:s.onClose()}})),onPointerDown:function(t){var n;null===(n=e.onPointerDown)||void 0===n||n.call(e,t),c.current=!0},onPointerUp:Zfe(e.onPointerUp,(function(e){var t;c.current||null===(t=e.currentTarget)||void 0===t||t.click()})),onKeyDown:Zfe(e.onKeyDown,(function(e){var t=""!==l.searchRef.current;r||t&&" "===e.key||Ive.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())}))}))})),dge=cr.forwardRef((function(e,t){var n=e.__scopeMenu,r=e.disabled,o=void 0!==r&&r,i=e.textValue,a=sn(e,Dt),s=rge(lge,n),l=Uve(n),u=cr.useRef(null),c=Jfe(t,u),d=yn(cr.useState(!1),2),f=d[0],h=d[1],p=yn(cr.useState(""),2),v=p[0],g=p[1];return cr.useEffect((function(){var e,t=u.current;t&&g((null!==(e=t.textContent)&&void 0!==e?e:"").trim())}),[a.children]),cr.createElement(jve.ItemSlot,{scope:n,disabled:o,textValue:null!=i?i:v},cr.createElement(Tve,ps({asChild:!0},l,{focusable:!o}),cr.createElement(ohe.div,ps({role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0},a,{ref:c,onPointerMove:Zfe(e.onPointerMove,fge((function(e){o?s.onItemLeave(e):(s.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus())}))),onPointerLeave:Zfe(e.onPointerLeave,fge((function(e){return s.onItemLeave(e)}))),onFocus:Zfe(e.onFocus,(function(){return h(!0)})),onBlur:Zfe(e.onBlur,(function(){return h(!1)}))}))))}));Hve("MenuRadioGroup",{value:void 0,onValueChange:function(){}});Hve("MenuItemIndicator",{checked:!1});function fge(e){return function(t){return"mouse"===t.pointerType?e(t):void 0}}Hve("MenuSub");var hge=function(e){var t=e.__scopeMenu,n=e.open,r=void 0!==n&&n,o=e.children,i=e.dir,a=e.onOpenChange,s=e.modal,l=void 0===s||s,u=Wve(t),c=yn(cr.useState(null),2),d=c[0],f=c[1],h=cr.useRef(!1),p=uhe(a),v=lhe(i);return cr.useEffect((function(){var e=function(){h.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=function(){return h.current=!1};return document.addEventListener("keydown",e,{capture:!0}),function(){document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}}),[]),cr.createElement(lve,u,cr.createElement(qve,{scope:t,open:r,onOpenChange:p,content:d,onContentChange:f},cr.createElement(Xve,{scope:t,onClose:cr.useCallback((function(){return p(!1)}),[p]),isUsingKeyboardRef:h,dir:v,modal:l},o)))},pge=Kve,vge=oge,gge=cge,mge="ContextMenu",yge=yn(Xfe(mge,[Vve]),2),bge=yge[0],wge=(yge[1],Vve()),kge=yn(bge(mge),2),xge=kge[0],Sge=kge[1];function Cge(e){return function(t){return"mouse"!==t.pointerType?e(t):void 0}}var _ge=function(e){var t=e.__scopeContextMenu,n=e.children,r=e.onOpenChange,o=e.dir,i=e.modal,a=void 0===i||i,s=yn(cr.useState(!1),2),l=s[0],u=s[1],c=wge(t),d=uhe(r),f=cr.useCallback((function(e){u(e),d(e)}),[d]);return cr.createElement(xge,{scope:t,open:l,onOpenChange:f,modal:a},cr.createElement(hge,ps({},c,{dir:o,open:l,onOpenChange:f,modal:a}),n))},Ege=cr.forwardRef((function(e,t){var n=e.__scopeContextMenu,r=sn(e,zt),o=Sge("ContextMenuTrigger",n),i=wge(n),a=cr.useRef({x:0,y:0}),s=cr.useRef({getBoundingClientRect:function(){return DOMRect.fromRect(un({width:0,height:0},a.current))}}),l=cr.useRef(0),u=cr.useCallback((function(){return window.clearTimeout(l.current)}),[]),c=function(e){a.current={x:e.clientX,y:e.clientY},o.onOpenChange(!0)};return cr.useEffect((function(){return u}),[u]),cr.createElement(cr.Fragment,null,cr.createElement(pge,ps({},i,{virtualRef:s})),cr.createElement(ohe.span,ps({"data-state":o.open?"open":"closed"},r,{ref:t,style:un({WebkitTouchCallout:"none"},e.style),onContextMenu:Zfe(e.onContextMenu,(function(e){u(),c(e),e.preventDefault()})),onPointerDown:Zfe(e.onPointerDown,Cge((function(e){u(),l.current=window.setTimeout((function(){return c(e)}),700)}))),onPointerMove:Zfe(e.onPointerMove,Cge(u)),onPointerCancel:Zfe(e.onPointerCancel,Cge(u)),onPointerUp:Zfe(e.onPointerUp,Cge(u))})))})),Pge=cr.forwardRef((function(e,t){var n=e.__scopeContextMenu,r=sn(e,jt),o=Sge("ContextMenuContent",n),i=wge(n),a=cr.useRef(!1);return cr.createElement(vge,ps({},i,r,{ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:function(t){var n;null===(n=e.onCloseAutoFocus)||void 0===n||n.call(e,t),!t.defaultPrevented&&a.current&&t.preventDefault(),a.current=!1},onInteractOutside:function(t){var n;null===(n=e.onInteractOutside)||void 0===n||n.call(e,t),t.defaultPrevented||o.modal||(a.current=!0)},style:un(un({},e.style),{},gn({},"--radix-context-menu-content-transform-origin","var(--radix-popper-transform-origin)"))}))})),Lge=cr.forwardRef((function(e,t){var n=e.__scopeContextMenu,r=sn(e,Bt),o=wge(n);return cr.createElement(gge,ps({},o,r,{ref:t}))})),Oge=cr.memo((function(e){var t,n,r,o,i,a,s,l,u=wie(),c=kie(Ide),d=c.activeTabName,f=c.galleryImageObjectFit,h=c.galleryImageMinimumWidth,p=c.mayDeleteImage,v=c.shouldUseSingleGalleryColumn,g=e.image,m=e.isSelected,y=g.url,b=g.thumbnail,w=g.uuid,k=g.metadata,x=yn(cr.useState(!1),2),S=x[0],C=x[1],_=cY(),E=o8().t,P=function(){var e=qt(Ut().mark((function e(){var t;return Ut().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==k||null===(t=k.image)||void 0===t||!t.init_image_path){e.next=9;break}return e.next=3,fetch(k.image.init_image_path);case 3:if(!e.sent.ok){e.next=9;break}return u(z8("img2img")),u(_4(k)),_({title:E("toast:initialImageSet"),status:"success",duration:2500,isClosable:!0}),e.abrupt("return");case 9:_({title:E("toast:initialImageNotSet"),description:E("toast:initialImageNotSetDesc"),status:"error",duration:2500,isClosable:!0});case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return ro(_ge,{onOpenChange:function(e){u(s4(e))},children:[no(Ege,{children:ro(cP,{position:"relative",className:"hoverable-image",onMouseOver:function(){return C(!0)},onMouseOut:function(){return C(!1)},userSelect:"none",draggable:!0,onDragStart:function(e){e.dataTransfer.setData("invokeai/imageUuid",w),e.dataTransfer.effectAllowed="move"},children:[no(c_,{className:"hoverable-image-image",objectFit:v?"contain":f,rounded:"md",src:b||y,loading:"lazy"}),no("div",{className:"hoverable-image-content",onClick:function(){return u(K3(g))},children:m&&no(Gv,{width:"50%",height:"50%",as:Uce,className:"hoverable-image-check"})}),S&&h>=64&&no("div",{className:"hoverable-image-delete-button",children:no(Nde,{image:g,children:no(x_,{"aria-label":E("parameters:deleteImage"),icon:no(xde,{}),size:"xs",variant:"imageHoverIconButton",fontSize:14,isDisabled:!p})})})]},w)}),ro(Pge,{className:"hoverable-image-context-menu",sticky:"always",onInteractOutside:function(e){e.detail.originalEvent.preventDefault()},children:[no(Lge,{onClickCapture:function(){u(K3(g))},children:E("parameters:openInViewer")}),no(Lge,{onClickCapture:function(){if(g.metadata){var e,t,n=yn(m4(null===(e=g.metadata)||void 0===e||null===(t=e.image)||void 0===t?void 0:t.prompt),2),r=n[0],o=n[1];r&&u(N4(r)),u(D4(o||""))}_({title:E("toast:promptSet"),status:"success",duration:2500,isClosable:!0})},disabled:void 0===(null==g||null===(t=g.metadata)||void 0===t||null===(n=t.image)||void 0===n?void 0:n.prompt),children:E("parameters:usePrompt")}),no(Lge,{onClickCapture:function(){g.metadata&&u(W4(g.metadata.image.seed)),_({title:E("toast:seedSet"),status:"success",duration:2500,isClosable:!0})},disabled:void 0===(null==g||null===(r=g.metadata)||void 0===r||null===(o=r.image)||void 0===o?void 0:o.seed),children:E("parameters:useSeed")}),no(Lge,{onClickCapture:function(){k&&u(E4(k)),_({title:E("toast:parametersSet"),status:"success",duration:2500,isClosable:!0})},disabled:!["txt2img","img2img"].includes(null==g||null===(i=g.metadata)||void 0===i||null===(a=i.image)||void 0===a?void 0:a.type),children:E("parameters:useAll")}),no(Lge,{onClickCapture:P,disabled:"img2img"!==(null==g||null===(s=g.metadata)||void 0===s||null===(l=s.image)||void 0===l?void 0:l.type),children:E("parameters:useInitImg")}),no(Lge,{onClickCapture:function(){u(M4(g)),"img2img"!==d&&u(z8("img2img")),_({title:E("toast:sentToImageToImage"),status:"success",duration:2500,isClosable:!0})},children:E("parameters:sendToImg2Img")}),no(Lge,{onClickCapture:function(){u(y3(g)),u(s3()),"unifiedCanvas"!==d&&u(z8("unifiedCanvas")),_({title:E("toast:sentToUnifiedCanvas"),status:"success",duration:2500,isClosable:!0})},children:E("parameters:sendToUnifiedCanvas")}),no(Lge,{"data-warning":!0,children:no(Nde,{image:g,children:no("p",{children:E("parameters:deleteImage")})})})]})]})}),(function(e,t){return e.image.uuid===t.image.uuid&&e.isSelected===t.isSelected}));Oge.displayName="HoverableImage";var Age=320,Mge={txt2img:{galleryMinWidth:200,galleryMaxWidth:500},img2img:{galleryMinWidth:200,galleryMaxWidth:500},unifiedCanvas:{galleryMinWidth:200,galleryMaxWidth:200},nodes:{galleryMinWidth:200,galleryMaxWidth:500},postprocess:{galleryMinWidth:200,galleryMaxWidth:500},training:{galleryMinWidth:200,galleryMaxWidth:500}};function Tge(){var e=wie(),t=o8().t,n=kie(Tde),r=n.images,o=n.currentCategory,i=n.currentImageUuid,a=n.shouldPinGallery,s=n.shouldShowGallery,l=n.galleryScrollPosition,u=n.galleryImageMinimumWidth,c=n.galleryGridTemplateColumns,d=n.activeTabName,f=n.galleryImageObjectFit,h=n.shouldHoldGalleryOpen,p=n.shouldAutoSwitchToNewImages,v=n.areMoreImagesAvailable,g=n.galleryWidth,m=n.isLightboxOpen,y=n.isStaging,b=n.shouldEnableResize,w=n.shouldUseSingleGalleryColumn,k=m?{galleryMinWidth:400,galleryMaxWidth:400}:Mge[d],x=k.galleryMinWidth,S=k.galleryMaxWidth,C=yn(cr.useState(g>=Age),2),_=C[0],E=C[1],P=yn(cr.useState(!1),2),L=P[0],O=P[1],A=yn(cr.useState(0),2),M=A[0],T=A[1],I=cr.useRef(null),R=cr.useRef(null),N=cr.useRef(null);cr.useEffect((function(){g>=Age&&E(!1)}),[g]);var D=function(){e(n4(!a)),e(m3(!0))},z=function(){e(r4(!0)),a&&e(m3(!0))},j=cr.useCallback((function(){e(r4(!1)),e(s4(!1)),e(o4(R.current?R.current.scrollTop:0)),setTimeout((function(){return a&&e(m3(!0))}),400)}),[e,a]),B=function(){N.current&&window.clearTimeout(N.current)};_ce("g",(function(){s?j():z()}),[s,a]),_ce("left",(function(){e(t4())}),{enabled:!y||"unifiedCanvas"!==d},[y]),_ce("right",(function(){e(e4())}),{enabled:!y||"unifiedCanvas"!==d},[y]),_ce("shift+g",(function(){D()}),[a]),_ce("esc",(function(){e(r4(!1))}),{enabled:function(){return!a},preventDefault:!0},[a]);return _ce("shift+up",(function(){if(u<256){var t=JK(u+32,32,256);e(i4(t))}}),[u]),_ce("shift+down",(function(){if(u>32){var t=JK(u-32,32,256);e(i4(t))}}),[u]),cr.useEffect((function(){R.current&&(R.current.scrollTop=l)}),[l,s]),cr.useEffect((function(){function e(e){a||!I.current||I.current.contains(e.target)||j()}return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[j,a]),no(Yfe,{nodeRef:I,in:s||h,unmountOnExit:!0,timeout:200,classNames:"image-gallery-wrapper",children:ro("div",{className:"image-gallery-wrapper",style:{zIndex:a?1:100},"data-pinned":a,ref:I,onMouseLeave:a?void 0:function(){h||(N.current=window.setTimeout((function(){return j()}),500))},onMouseEnter:a?void 0:B,onMouseOver:a?void 0:B,children:[ro(hfe,{minWidth:x,maxWidth:a?S:window.innerWidth,className:"image-gallery-popup",handleStyles:{left:{width:"15px"}},enable:{left:b},size:{width:g,height:a?"100%":"100vh"},onResizeStart:function(e,t,n){T(n.clientHeight),n.style.height="".concat(n.clientHeight,"px"),a&&(n.style.position="fixed",n.style.right="1rem",O(!0))},onResizeStop:function(t,n,r,o){var i=a?JK(Number(g)+o.width,x,Number(S)):Number(g)+o.width;e(c4(i)),r.removeAttribute("data-resize-alert"),a&&(r.style.position="relative",r.style.removeProperty("right"),r.style.setProperty("height",a?"100%":"100vh"),O(!1),e(m3(!0)))},onResize:function(t,n,r,o){var i=JK(Number(g)+o.width,x,Number(a?S:.95*window.innerWidth));i>=Age&&!_?E(!0):ii-40&&e(i4(i-40)),a&&(i>=S?r.setAttribute("data-resize-alert","true"):r.removeAttribute("data-resize-alert")),r.style.height="".concat(M,"px")},children:[ro("div",{className:"image-gallery-header",children:[no(k_,{size:"sm",isAttached:!0,variant:"solid",className:"image-gallery-category-btn-group",children:ro(to,_?{children:[no(Eae,{size:"sm","data-selected":"result"===o,onClick:function(){return e(u4("result"))},children:t("gallery:generations")}),no(Eae,{size:"sm","data-selected":"user"===o,onClick:function(){return e(u4("user"))},children:t("gallery:uploads")})]}:{children:[no(_ae,{"aria-label":t("gallery:showGenerations"),tooltip:t("gallery:showGenerations"),"data-selected":"result"===o,icon:no(ode,{}),onClick:function(){return e(u4("result"))}}),no(_ae,{"aria-label":t("gallery:showUploads"),tooltip:t("gallery:showUploads"),"data-selected":"user"===o,icon:no(Ede,{}),onClick:function(){return e(u4("user"))}})]})}),ro("div",{className:"image-gallery-header-right-icons",children:[no(Pae,{isLazy:!0,trigger:"hover",placement:"left",triggerComponent:no(_ae,{size:"sm","aria-label":t("gallery:gallerySettings"),icon:no(Pde,{}),className:"image-gallery-icon-btn",cursor:"pointer"}),children:ro("div",{className:"image-gallery-settings-popover",children:[ro("div",{children:[no(xfe,{value:u,onChange:function(t){e(i4(t))},min:32,max:256,hideTooltip:!0,label:t("gallery:galleryImageSize")}),no(_ae,{size:"sm","aria-label":t("gallery:galleryImageResetSize"),tooltip:t("gallery:galleryImageResetSize"),onClick:function(){return e(i4(64))},icon:no(mfe,{}),"data-selected":a,styleClass:"image-gallery-icon-btn"})]}),no("div",{children:no(pfe,{label:t("gallery:maintainAspectRatio"),isChecked:"contain"===f,onChange:function(){return e(a4("contain"===f?"cover":"contain"))}})}),no("div",{children:no(pfe,{label:t("gallery:autoSwitchNewImages"),isChecked:p,onChange:function(t){return e(l4(t.target.checked))}})}),no("div",{children:no(pfe,{label:t("gallery:singleColumnLayout"),isChecked:w,onChange:function(t){return e(d4(t.target.checked))}})})]})}),no(_ae,{size:"sm",className:"image-gallery-icon-btn","aria-label":t("gallery:pinGallery"),tooltip:"".concat(t("gallery:pinGallery")," (Shift+G)"),onClick:D,icon:no(a?Sfe:Cfe,{})})]})]}),no("div",{className:"image-gallery-container",ref:R,children:r.length||v?ro(to,{children:[no("div",{className:"image-gallery",style:{gridTemplateColumns:c},children:r.map((function(e){var t=e.uuid;return no(Oge,{image:e,isSelected:i===t},t)}))}),no(b_,{onClick:function(){e(tie(o))},isDisabled:!v,className:"image-gallery-load-more-btn",children:t(v?"gallery:loadMore":"gallery:allImagesLoaded")})]}):ro("div",{className:"image-gallery-container-placeholder",children:[no(Ofe,{}),no("p",{children:t("gallery:noImagesInGallery")})]})})]}),L&&no("div",{style:{width:"".concat(g,"px"),height:"100%"}})]})})} -/*! ***************************************************************************** - Copyright (c) Microsoft Corporation. - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. - ***************************************************************************** */var Ige=function(e,t){return Ige=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Ige(e,t)};var Rge=function(){return Rge=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=n?(r(1),e.animation=null):e.animation&&(r(a),requestAnimationFrame(e.animation))},requestAnimationFrame(e.animation)}}function Vge(e,t,n,r){var o=function(e){var t=e.scale,n=e.positionX,r=e.positionY;if(isNaN(t)||isNaN(n)||isNaN(r))return!1;return!0}(t);if(e.mounted&&o){var i=e.setTransformState,a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY,c=t.scale-s,d=t.positionX-l,f=t.positionY-u;0===n?i(t.scale,t.positionX,t.positionY):Hge(e,r,n,(function(e){i(s+c*e,l+d*e,u+f*e)}))}}var Wge=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 i=function(e,t,n){var r=e.offsetWidth,o=e.offsetHeight,i=t.offsetWidth*n,a=t.offsetHeight*n;return{wrapperWidth:r,wrapperHeight:o,newContentWidth:i,newDiffWidth:r-i,newContentHeight:a,newDiffHeight:o-a}}(n,r,t),a=i.wrapperWidth,s=i.wrapperHeight,l=function(e,t,n,r,o,i,a){var s=e>t?n*(a?1:.5):0,l=r>o?i*(a?1:.5):0;return{minPositionX:e-t-s,maxPositionX:s,minPositionY:r-o-l,maxPositionY:l}}(a,i.newContentWidth,i.newDiffWidth,s,i.newContentHeight,i.newDiffHeight,Boolean(o));return l},Uge=function(e,t){var n=Wge(e,t);return e.bounds=n,n};function Gge(e,t,n,r,o,i,a){var s=n.minPositionX,l=n.minPositionY,u=n.maxPositionX,c=n.maxPositionY,d=0,f=0;return a&&(d=o,f=i),{x:qge(e,s-d,u+d,r),y:qge(t,l-f,c+f,r)}}var qge=function(e,t,n,r){return Dge(r?en?n:e:e,2)};function Yge(e,t,n,r,o,i){var a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY,c=r-s;return"number"!=typeof t||"number"!=typeof n?(console.error("Mouse X and Y position were not provided!"),{x:l,y:u}):Gge(l-t*c,u-n*c,o,i,0,0,null)}function Zge(e,t,n,r,o){var i=t-(o?r:0);return!isNaN(n)&&e>=n?n:!isNaN(t)&&e<=i?i:e}var Xge=function(e,t){var n=e.setup.panning.excluded,r=e.isInitialized,o=e.wrapperComponent,i=t.target,a=null==o?void 0:o.contains(i);return!!(r&&i&&a)&&!xme(i,n)},$ge=function(e){var t=e.isInitialized,n=e.isPanning,r=e.setup.panning.disabled;return!(!t||!n||r)};var Kge=function(e,t){var n=e.setup,r=e.transformState.scale,o=n.minScale;return t>0&&r>=o?t:0};function Qge(e,t,n,r,o,i,a,s,l,u){if(o){var c;if(t>a&&n>a)return(c=a+(e-a)*u)>l?l:ci?i:c}return r?t:qge(e,i,a,o)}function Jge(e,t){var n=function(e){var t=e.mounted,n=e.setup,r=n.disabled,o=n.velocityAnimation,i=e.transformState.scale;return!(o.disabled&&!(i>1)&&r&&!t)}(e);if(n){var r=e.lastMousePosition,o=e.velocityTime,i=e.setup,a=e.wrapperComponent,s=i.velocityAnimation.equalToMove,l=Date.now();if(r&&o&&a){var u=function(e,t){return t?Math.min(1,e.offsetWidth/window.innerWidth):1}(a,s),c=t.x-r.x,d=t.y-r.y,f=c/u,h=d/u,p=l-o,v=c*c+d*d,g=Math.sqrt(v)/p;e.velocity={velocityX:f,velocityY:h,total:g}}e.lastMousePosition=t,e.velocityTime=l}}function eme(e,t){var n=e.transformState.scale;Fge(e),Uge(e,n),t.touches?function(e,t){var n=t.touches,r=e.transformState,o=r.positionX,i=r.positionY;if(e.isPanning=!0,1===n.length){var a=n[0].clientX,s=n[0].clientY;e.startCoords={x:a-o,y:s-i}}}(e,t):function(e,t){var n=e.transformState,r=n.positionX,o=n.positionY;e.isPanning=!0;var i=t.clientX,a=t.clientY;e.startCoords={x:i-r,y:a-o}}(e,t)}function tme(e,t,n){var r=e.startCoords,o=e.setup.alignmentAnimation,i=o.sizeX,a=o.sizeY;if(r){var s=function(e,t,n){var r=e.startCoords,o=e.transformState,i=e.setup.panning,a=i.lockAxisX,s=i.lockAxisY,l=o.positionX,u=o.positionY;if(!r)return{x:l,y:u};var c=t-r.x,d=n-r.y;return{x:a?l:c,y:s?u:d}}(e,t,n),l=s.x,u=s.y,c=Kge(e,i),d=Kge(e,a);Jge(e,{x:l,y:u}),function(e,t,n,r,o){var i=e.setup.limitToBounds,a=e.wrapperComponent,s=e.bounds,l=e.transformState,u=l.scale,c=l.positionX,d=l.positionY;if(a&&t!==c&&n!==d&&s){var f=Gge(t,n,s,i,r,o,a),h=f.x,p=f.y;e.setTransformState(u,h,p)}}(e,l,u,c,d)}}function nme(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 i=null==r?void 0:r.getBoundingClientRect(),a=null==o?void 0:o.getBoundingClientRect(),s=(null==i?void 0:i.width)||0,l=(null==i?void 0:i.height)||0,u=(null==a?void 0:a.width)||0,c=(null==a?void 0:a.height)||0,d=s.1&&d?function(e){var t=e.velocity,n=e.bounds,r=e.setup,o=e.wrapperComponent,i=function(e){var t=e.mounted,n=e.velocity,r=e.bounds,o=e.setup,i=o.disabled,a=o.velocityAnimation,s=e.transformState.scale;return!(a.disabled&&!(s>1)&&i&&!t||!n||!r)}(e);if(i&&t&&n&&o){var a=t.velocityX,s=t.velocityY,l=t.total,u=n.maxPositionX,c=n.minPositionX,d=n.maxPositionY,f=n.minPositionY,h=r.limitToBounds,p=r.alignmentAnimation,v=r.zoomAnimation,g=r.panning,m=g.lockAxisY,y=g.lockAxisX,b=v.animationType,w=p.sizeX,k=p.sizeY,x=p.velocityAlignmentTime,S=function(e,t){var n=e.setup.velocityAnimation,r=n.equalToMove,o=n.animationTime,i=n.sensitivity;return r?o*t*i:o}(e,l),C=Math.max(S,x),_=Kge(e,w),E=Kge(e,k),P=_*o.offsetWidth/100,L=E*o.offsetHeight/100,O=u+P,A=c-P,M=d+L,T=f-L,I=e.transformState,R=(new Date).getTime();Hge(e,b,C,(function(t){var n=e.transformState,r=n.scale,o=n.positionX,i=n.positionY,l=((new Date).getTime()-R)/x,v=1-(0,jge[p.animationType])(Math.min(1,l)),g=1-t,b=o+a*g,w=i+s*g,k=Qge(b,I.positionX,o,y,h,c,u,A,O,v),S=Qge(w,I.positionY,i,m,h,f,d,T,M,v);o===b&&i===w||e.setTransformState(r,k,S)}))}}(e):rme(e)}}function rme(e){var t=e.transformState.scale,n=e.setup,r=n.minScale,o=n.alignmentAnimation,i=o.disabled,a=o.sizeX,s=o.sizeY,l=o.animationTime,u=o.animationType;if(!(i||td||nh||rd?u.offsetWidth:e.setup.minPositionX||0,r>h?u.offsetHeight:e.setup.minPositionY||0,o,e.bounds,s||l),y=m.x,b=m.y;return{scale:o,positionX:v?y:n,positionY:g?b:r}}}(e);c&&Vge(e,c,l,u)}}function ome(e,t,n){var r=e.transformState.scale,o=e.wrapperComponent,i=e.setup,a=i.minScale,s=i.limitToBounds,l=i.zoomAnimation,u=l.disabled,c=l.animationTime,d=l.animationType,f=u||r>=a;if((r>=1||s)&&rme(e),!f&&o&&e.mounted){var h=ime(e,a,t||o.offsetWidth/2,n||o.offsetHeight/2);h&&Vge(e,h,c,d)}}function ime(e,t,n,r){var o=e.setup,i=o.minScale,a=o.maxScale,s=o.limitToBounds,l=Zge(Dge(t,2),i,a,0,!1),u=Yge(e,n,r,l,Uge(e,l),s);return{scale:l,positionX:u.x,positionY:u.y}}var ame={previousScale:1,scale:1,positionX:0,positionY:0},sme=Rge(Rge({},ame),{setComponents:function(){},contextInstance:null}),lme={disabled:!1,minPositionX:null,maxPositionX:null,minPositionY:null,maxPositionY:null,minScale:1,maxScale:8,limitToBounds:!0,centerZoomedOut:!1,centerOnInit:!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}},ume=function(e){var t,n,r,o;return{previousScale:null!==(t=e.initialScale)&&void 0!==t?t:ame.scale,scale:null!==(n=e.initialScale)&&void 0!==n?n:ame.scale,positionX:null!==(r=e.initialPositionX)&&void 0!==r?r:ame.positionX,positionY:null!==(o=e.initialPositionY)&&void 0!==o?o:ame.positionY}},cme=function(e){var t=Rge({},lme);return Object.keys(e).forEach((function(n){var r=void 0!==e[n];if(void 0!==lme[n]&&r){var o=Object.prototype.toString.call(lme[n]),i="[object Object]"===o,a="[object Array]"===o;t[n]=i?Rge(Rge({},lme[n]),e[n]):a?Nge(Nge([],lme[n]),e[n]):e[n]}})),t},dme=function(e,t,n){var r=e.transformState.scale,o=e.wrapperComponent,i=e.setup,a=i.maxScale,s=i.minScale,l=i.zoomAnimation.size;if(!o)throw new Error("Wrapper is not mounted");var u=r*Math.exp(t*n);return Zge(Dge(u,3),s,a,l,!1)};function fme(e,t,n,r,o){var i=e.wrapperComponent,a=e.transformState,s=a.scale,l=a.positionX,u=a.positionY;if(!i)return console.error("No WrapperComponent found");var c=(i.offsetWidth/2-l)/s,d=(i.offsetHeight/2-u)/s,f=ime(e,dme(e,t,n),c,d);if(!f)return console.error("Error during zoom event. New transformation state was not calculated.");Vge(e,f,r,o)}function hme(e,t,n){var r=e.setup,o=e.wrapperComponent,i=r.limitToBounds,a=ume(e.props),s=e.transformState,l=s.scale,u=s.positionX,c=s.positionY;if(o){var d=Wge(e,a.scale),f=Gge(a.positionX,a.positionY,d,i,0,0,o),h={scale:a.scale,positionX:f.x,positionY:f.y};l===a.scale&&u===a.positionX&&c===a.positionY||Vge(e,h,t,n)}}var pme=function(e){return function(t,n,r){void 0===t&&(t=.5),void 0===n&&(n=300),void 0===r&&(r="easeOut"),fme(e,1,t,n,r)}},vme=function(e){return function(t,n,r){void 0===t&&(t=.5),void 0===n&&(n=300),void 0===r&&(r="easeOut"),fme(e,-1,t,n,r)}},gme=function(e){return function(t,n,r,o,i){void 0===o&&(o=300),void 0===i&&(i="easeOut");var a=e.transformState,s=a.positionX,l=a.positionY,u=a.scale,c=e.wrapperComponent,d=e.contentComponent;if(!e.setup.disabled&&c&&d){var f={positionX:isNaN(t)?s:t,positionY:isNaN(n)?l:n,scale:isNaN(r)?u:r};Vge(e,f,o,i)}}},mme=function(e){return function(t,n){void 0===t&&(t=200),void 0===n&&(n="easeOut"),hme(e,t,n)}},yme=function(e){return function(t,n,r){void 0===n&&(n=200),void 0===r&&(r="easeOut");var o=e.transformState,i=e.wrapperComponent,a=e.contentComponent;if(i&&a){var s=_me(t||o.scale,i,a);Vge(e,s,n,r)}}},bme=function(e){return function(t,n,r,o){void 0===r&&(r=600),void 0===o&&(o="easeOut"),Fge(e);var i=e.wrapperComponent,a="string"==typeof t?document.getElementById(t):t;if(i&&function(e){return e?void 0!==(null==e?void 0:e.offsetWidth)&&void 0!==(null==e?void 0:e.offsetHeight)||(console.error("Zoom node is not valid - it must contain offsetWidth and offsetHeight"),!1):(console.error("Zoom node not found"),!1)}(a)&&a&&i.contains(a)){var s=function(e,t,n){var r=e.wrapperComponent,o=e.setup,i=o.limitToBounds,a=o.minScale,s=o.maxScale;if(!r)return ame;var l=r.getBoundingClientRect(),u=function(e){for(var t=e,n=0,r=0;t;)n+=t.offsetLeft,r+=t.offsetTop,t=t.offsetParent;return{x:n,y:r}}(t),c=u.x,d=u.y,f=t.offsetWidth,h=t.offsetHeight,p=r.offsetWidth/f,v=r.offsetHeight/h,g=Zge(n||Math.min(p,v),a,s,0,!1),m=(l.width-f*g)/2,y=(l.height-h*g)/2,b=Gge((l.left-c)*g+m,(l.top-d)*g+y,Wge(e,g),i,0,0,r);return{positionX:b.x,positionY:b.y,scale:g}}(e,a,n);Vge(e,s,r,o)}}},wme=function(e){return{instance:e,state:e.transformState,zoomIn:pme(e),zoomOut:vme(e),setTransform:gme(e),resetTransform:mme(e),centerView:yme(e),zoomToElement:bme(e)}};function kme(){try{return{get passive(){return!0,!1}}}catch(COe){return!1}}var xme=function(e,t){var n=e.tagName.toUpperCase();return!!t.find((function(e){return e.toUpperCase()===n}))||!!t.find((function(t){return e.classList.contains(t)}))},Sme=function(e){e&&clearTimeout(e)},Cme=function(e,t,n){return"translate3d("+e+"px, "+t+"px, 0) scale("+n+")"},_me=function(e,t,n){var r=n.offsetWidth*e,o=n.offsetHeight*e;return{scale:e,positionX:(t.offsetWidth-r)/2,positionY:(t.offsetHeight-o)/2}},Eme=function(e,t){var n=e.setup.wheel,r=n.disabled,o=n.wheelDisabled,i=n.touchPadDisabled,a=n.excluded,s=e.isInitialized,l=e.isPanning,u=t.target;return!(!s||l||r||!u)&&(!(o&&!t.ctrlKey)&&((!i||!t.ctrlKey)&&!xme(u,a)))};function Pme(e,t,n){var r=t.getBoundingClientRect(),o=0,i=0;if("clientX"in e)o=(e.clientX-r.left)/n,i=(e.clientY-r.top)/n;else{var a=e.touches[0];o=(a.clientX-r.left)/n,i=(a.clientY-r.top)/n}return(isNaN(o)||isNaN(i))&&console.error("No mouse or touch offset found"),{x:o,y:i}}var Lme=function(e,t){var n=e.setup.pinch,r=n.disabled,o=n.excluded,i=e.isInitialized,a=t.target;return!(!i||r||!a)&&!xme(a,o)},Ome=function(e){var t=e.setup.pinch.disabled,n=e.isInitialized,r=e.pinchStartDistance;return!(!n||t||!r)},Ame=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))},Mme=function(e,t){var n=e.props,r=n.onWheelStart,o=n.onZoomStart;e.wheelStopEventTimer||(Fge(e),zge(wme(e),t,r),zge(wme(e),t,o))},Tme=function(e,t){var n=e.props,r=n.onWheel,o=n.onZoom,i=e.contentComponent,a=e.setup,s=e.transformState.scale,l=a.limitToBounds,u=a.centerZoomedOut,c=a.zoomAnimation,d=a.wheel,f=c.size,h=c.disabled,p=d.step;if(!i)throw new Error("Component not mounted");t.preventDefault(),t.stopPropagation();var v=function(e,t){var n,r,o=e?e.deltaY<0?1:-1:0;return r=o,"number"==typeof(n=t)?n:r}(t,null),g=function(e,t,n,r,o){var i=e.transformState.scale,a=e.wrapperComponent,s=e.setup,l=s.maxScale,u=s.minScale,c=s.zoomAnimation,d=c.size,f=c.disabled;if(!a)throw new Error("Wrapper is not mounted");var h=i+t*(i-i*n)*n;if(o)return h;var p=!r&&!f;return Zge(Dge(h,3),u,l,d,p)}(e,v,p,!t.ctrlKey);if(s!==g){var m=Uge(e,g),y=Pme(t,i,s),b=l&&(h||0===f||u),w=Yge(e,y.x,y.y,g,m,b),k=w.x,x=w.y;e.previousWheelEvent=t,e.setTransformState(g,k,x),zge(wme(e),t,r),zge(wme(e),t,o)}},Ime=function(e,t){var n=e.props,r=n.onWheelStop,o=n.onZoomStop;Sme(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout((function(){e.mounted&&(ome(e,t.x,t.y),e.wheelAnimationTimer=null)}),100);var i=function(e,t){var n=e.previousWheelEvent,r=e.transformState.scale,o=e.setup,i=o.maxScale,a=o.minScale;return!!n&&(ra||Math.sign(n.deltaY)!==Math.sign(t.deltaY)||n.deltaY>0&&n.deltaYt.deltaY||Math.sign(n.deltaY)!==Math.sign(t.deltaY))}(e,t);i&&(Sme(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout((function(){e.mounted&&(e.wheelStopEventTimer=null,zge(wme(e),t,r),zge(wme(e),t,o))}),160))},Rme=function(e,t){var n=Ame(t);e.pinchStartDistance=n,e.lastDistance=n,e.pinchStartScale=e.transformState.scale,e.isPanning=!1,Fge(e)},Nme=function(e,t){var n=e.contentComponent,r=e.pinchStartDistance,o=e.transformState.scale,i=e.setup,a=i.limitToBounds,s=i.centerZoomedOut,l=i.zoomAnimation,u=l.disabled,c=l.size;if(null!==r&&n){var d=function(e,t,n){var r=n.getBoundingClientRect(),o=e.touches,i=Dge(o[0].clientX-r.left,5),a=Dge(o[0].clientY-r.top,5);return{x:(i+Dge(o[1].clientX-r.left,5))/2/t,y:(a+Dge(o[1].clientY-r.top,5))/2/t}}(t,o,n);if(isFinite(d.x)&&isFinite(d.y)){var f=Ame(t),h=function(e,t){var n=e.pinchStartScale,r=e.pinchStartDistance,o=e.setup,i=o.maxScale,a=o.minScale,s=o.zoomAnimation,l=s.size,u=s.disabled;if(!n||null===r||!t)throw new Error("Pinch touches distance was not provided");return t<0?e.transformState.scale:Zge(Dge(t/r*n,2),a,i,l,!u)}(e,f);if(h!==o){var p=Uge(e,h),v=a&&(u||0===c||s),g=Yge(e,d.x,d.y,h,p,v),m=g.x,y=g.y;e.pinchMidpoint=d,e.lastDistance=f,e.setTransformState(h,m,y)}}}},Dme=function(e){var t=e.pinchMidpoint;e.velocity=null,e.lastDistance=null,e.pinchMidpoint=null,e.pinchStartScale=null,e.pinchStartDistance=null,ome(e,null==t?void 0:t.x,null==t?void 0:t.y)};function zme(e,t){var n=e.setup.doubleClick,r=n.disabled,o=n.mode,i=n.step,a=n.animationTime,s=n.animationType;if(!r){if("reset"===o)return hme(e,a,s);var l=e.transformState.scale,u=e.contentComponent;if(!u)return console.error("No ContentComponent found");var c=dme(e,"zoomOut"===o?-1:1,i),d=Pme(t,u,l),f=ime(e,c,d.x,d.y);if(!f)return console.error("Error during zoom event. New transformation state was not calculated.");Vge(e,f,a,s)}}var jme=function(e,t){var n=e.isInitialized,r=e.setup,o=e.wrapperComponent,i=r.doubleClick,a=i.disabled,s=i.excluded,l=t.target,u=null==o?void 0:o.contains(l),c=n&&l&&u&&!a;return!!c&&(!xme(l,s)&&!!c)},Bme=qr.createContext(sme),Fme=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.mounted=!0,t.transformState=ume(t.props),t.setup=cme(t.props),t.wrapperComponent=null,t.contentComponent=null,t.isInitialized=!1,t.bounds=null,t.previousWheelEvent=null,t.wheelStopEventTimer=null,t.wheelAnimationTimer=null,t.isPanning=!1,t.startCoords=null,t.lastTouch=null,t.distance=null,t.lastDistance=null,t.pinchStartDistance=null,t.pinchStartScale=null,t.pinchMidpoint=null,t.velocity=null,t.velocityTime=null,t.lastMousePosition=null,t.animate=!1,t.animation=null,t.maxBounds=null,t.pressedKeys={},t.handleInitializeWrapperEvents=function(e){var n=kme();e.addEventListener("wheel",t.onWheelZoom,n),e.addEventListener("dblclick",t.onDoubleClick,n),e.addEventListener("touchstart",t.onTouchPanningStart,n),e.addEventListener("touchmove",t.onTouchPanning,n),e.addEventListener("touchend",t.onTouchPanningStop,n)},t.handleInitialize=function(){var e=t.setup.centerOnInit;t.applyTransformation(),t.forceUpdate(),e&&(setTimeout((function(){t.mounted&&t.setCenter()}),50),setTimeout((function(){t.mounted&&t.setCenter()}),100),setTimeout((function(){t.mounted&&t.setCenter()}),200))},t.onWheelZoom=function(e){t.setup.disabled||Eme(t,e)&&t.isPressingKeys(t.setup.wheel.activationKeys)&&(Mme(t,e),Tme(t,e),Ime(t,e))},t.onPanningStart=function(e){var n=t.setup.disabled,r=t.props.onPanningStart;n||Xge(t,e)&&t.isPressingKeys(t.setup.panning.activationKeys)&&(e.preventDefault(),e.stopPropagation(),Fge(t),eme(t,e),zge(wme(t),e,r))},t.onPanning=function(e){var n=t.setup.disabled,r=t.props.onPanning;n||$ge(t)&&t.isPressingKeys(t.setup.panning.activationKeys)&&(e.preventDefault(),e.stopPropagation(),tme(t,e.clientX,e.clientY),zge(wme(t),e,r))},t.onPanningStop=function(e){var n=t.props.onPanningStop;t.isPanning&&(nme(t),zge(wme(t),e,n))},t.onPinchStart=function(e){var n=t.setup.disabled,r=t.props,o=r.onPinchingStart,i=r.onZoomStart;n||Lme(t,e)&&(Rme(t,e),Fge(t),zge(wme(t),e,o),zge(wme(t),e,i))},t.onPinch=function(e){var n=t.setup.disabled,r=t.props,o=r.onPinching,i=r.onZoom;n||Ome(t)&&(e.preventDefault(),e.stopPropagation(),Nme(t,e),zge(wme(t),e,o),zge(wme(t),e,i))},t.onPinchStop=function(e){var n=t.props,r=n.onPinchingStop,o=n.onZoomStop;t.pinchStartScale&&(Dme(t),zge(wme(t),e,r),zge(wme(t),e,o))},t.onTouchPanningStart=function(e){var n=t.setup.disabled,r=t.props.onPanningStart;if(!n&&Xge(t,e))if(t.lastTouch&&+new Date-t.lastTouch<200&&1===e.touches.length)t.onDoubleClick(e);else{t.lastTouch=+new Date,Fge(t);var o=e.touches,i=1===o.length,a=2===o.length;i&&(Fge(t),eme(t,e),zge(wme(t),e,r)),a&&t.onPinchStart(e)}},t.onTouchPanning=function(e){var n=t.setup.disabled,r=t.props.onPanning;if(t.isPanning&&1===e.touches.length){if(n)return;if(!$ge(t))return;e.preventDefault(),e.stopPropagation();var o=e.touches[0];tme(t,o.clientX,o.clientY),zge(wme(t),e,r)}else e.touches.length>1&&t.onPinch(e)},t.onTouchPanningStop=function(e){t.onPanningStop(e),t.onPinchStop(e)},t.onDoubleClick=function(e){t.setup.disabled||jme(t,e)&&zme(t,e)},t.clearPanning=function(e){t.isPanning&&t.onPanningStop(e)},t.setKeyPressed=function(e){t.pressedKeys[e.key]=!0},t.setKeyUnPressed=function(e){t.pressedKeys[e.key]=!1},t.isPressingKeys=function(e){return!e.length||Boolean(e.find((function(e){return t.pressedKeys[e]})))},t.setComponents=function(e,n){t.wrapperComponent=e,t.contentComponent=n,Uge(t,t.transformState.scale),t.handleInitializeWrapperEvents(e),t.handleInitialize(),t.handleRef(),t.isInitialized=!0,zge(wme(t),void 0,t.props.onInit)},t.setTransformState=function(e,n,r){isNaN(e)||isNaN(n)||isNaN(r)?console.error("Detected NaN set state values"):(e!==t.transformState.scale&&(t.transformState.previousScale=t.transformState.scale,t.transformState.scale=e),t.transformState.positionX=n,t.transformState.positionY=r,t.applyTransformation())},t.setCenter=function(){if(t.wrapperComponent&&t.contentComponent){var e=_me(t.transformState.scale,t.wrapperComponent,t.contentComponent);t.setTransformState(e.scale,e.positionX,e.positionY)}},t.applyTransformation=function(){if(t.mounted&&t.contentComponent){var e=t.transformState,n=e.scale,r=e.positionX,o=e.positionY,i=Cme(r,o,n);t.contentComponent.style.transform=i,t.handleRef()}},t.handleRef=function(){t.props.setRef(wme(t))},t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Ige(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.componentDidMount=function(){var e=kme();window.addEventListener("mousedown",this.onPanningStart,e),window.addEventListener("mousemove",this.onPanning,e),window.addEventListener("mouseup",this.onPanningStop,e),document.addEventListener("mouseleave",this.clearPanning,e),window.addEventListener("keyup",this.setKeyUnPressed,e),window.addEventListener("keydown",this.setKeyPressed,e),this.handleRef()},t.prototype.componentWillUnmount=function(){var e=kme();window.removeEventListener("mousedown",this.onPanningStart,e),window.removeEventListener("mousemove",this.onPanning,e),window.removeEventListener("mouseup",this.onPanningStop,e),window.removeEventListener("keyup",this.setKeyUnPressed,e),window.removeEventListener("keydown",this.setKeyPressed,e),Fge(this)},t.prototype.componentDidUpdate=function(e){e!==this.props&&(Uge(this,this.transformState.scale),this.setup=cme(this.props))},t.prototype.render=function(){var e=wme(this),t=this.props.children,n="function"==typeof t?t(e):t;return qr.createElement(Bme.Provider,{value:Rge(Rge({},this.transformState),{setComponents:this.setComponents,contextInstance:this})},n)},t}(cr.Component),Hme=qr.forwardRef((function(e,t){var n=cr.useState(null),r=n[0],o=n[1];return cr.useImperativeHandle(t,(function(){return r}),[r]),qr.createElement(Fme,Rge({},e,{setRef:o}))}));var Vme="transform-component-module_wrapper__1_Fgj",Wme="transform-component-module_content__2jYgh";!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".transform-component-module_wrapper__1_Fgj {\n position: relative;\n width: -moz-fit-content;\n width: fit-content;\n height: -moz-fit-content;\n height: fit-content;\n overflow: hidden;\n -webkit-touch-callout: none; /* iOS Safari */\n -webkit-user-select: none; /* Safari */\n -khtml-user-select: none; /* Konqueror HTML */\n -moz-user-select: none; /* Firefox */\n -ms-user-select: none; /* Internet Explorer/Edge */\n user-select: none;\n margin: 0;\n padding: 0;\n}\n.transform-component-module_content__2jYgh {\n display: flex;\n flex-wrap: wrap;\n width: -moz-fit-content;\n width: fit-content;\n height: -moz-fit-content;\n height: fit-content;\n margin: 0;\n padding: 0;\n transform-origin: 0% 0%;\n}\n.transform-component-module_content__2jYgh img {\n pointer-events: none;\n}\n");var Ume=function(e){var t=e.children,n=e.wrapperClass,r=void 0===n?"":n,o=e.contentClass,i=void 0===o?"":o,a=e.wrapperStyle,s=e.contentStyle,l=cr.useContext(Bme).setComponents,u=cr.useRef(null),c=cr.useRef(null);return cr.useEffect((function(){var e=u.current,t=c.current;null!==e&&null!==t&&l&&l(e,t)}),[]),qr.createElement("div",{ref:u,className:"react-transform-wrapper "+Vme+" "+r,style:a},qr.createElement("div",{ref:c,className:"react-transform-component "+Wme+" "+i,style:s},t))};function Gme(e){var t=e.image,n=e.alt,r=e.ref,o=e.styleClass,i=yn(cr.useState(0),2),a=i[0],s=i[1],l=yn(cr.useState(!1),2),u=l[0],c=l[1],d=function(){s(-3===a?0:a-1)},f=function(){s(3===a?0:a+1)},h=function(){c(!u)};return no(Hme,{centerOnInit:!0,minScale:.1,initialPositionX:50,initialPositionY:50,children:function(e){var i=e.zoomIn,l=e.zoomOut,p=e.resetTransform,v=e.centerView;return ro(to,{children:[ro("div",{className:"lightbox-image-options",children:[no(_ae,{icon:no(wfe,{}),"aria-label":"Zoom In",tooltip:"Zoom In",onClick:function(){return i()},fontSize:20}),no(_ae,{icon:no(kfe,{}),"aria-label":"Zoom Out",tooltip:"Zoom Out",onClick:function(){return l()},fontSize:20}),no(_ae,{icon:no(yfe,{}),"aria-label":"Rotate Left",tooltip:"Rotate Left",onClick:d,fontSize:20}),no(_ae,{icon:no(bfe,{}),"aria-label":"Rotate Right",tooltip:"Rotate Right",onClick:f,fontSize:20}),no(_ae,{icon:no(Lfe,{}),"aria-label":"Flip Image",tooltip:"Flip Image",onClick:h,fontSize:20}),no(_ae,{icon:no(mfe,{}),"aria-label":"Reset",tooltip:"Reset",onClick:function(){p(),s(0),c(!1)},fontSize:20})]}),no(Ume,{wrapperStyle:{width:"100%",height:"100%"},children:no("img",{style:{transform:"rotate(".concat(90*a,"deg) scaleX(").concat(u?-1:1,")"),width:"100%"},src:t,alt:n,ref:r,className:o||"",onLoad:function(){return v(1,0,"easeOut")}})})]})}})}function qme(){var e=wie(),t=kie((function(e){return e.lightbox.isLightboxOpen})),n=kie(Ude),r=n.viewerImageToDisplay,o=n.shouldShowImageDetails,i=n.isOnFirstImage,a=n.isOnLastImage,s=yn(cr.useState(!1),2),l=s[0],u=s[1],c=function(){u(!0)},d=function(){u(!1)};return _ce("Esc",(function(){t&&e(p4(!1))}),[t]),ro("div",{className:"lightbox-container",children:[no(_ae,{icon:no(gfe,{}),"aria-label":"Exit Viewer",className:"lightbox-close-btn",onClick:function(){e(p4(!1))},fontSize:20}),ro("div",{className:"lightbox-display-container",children:[ro("div",{className:"lightbox-preview-wrapper",children:[no(zde,{}),!o&&ro("div",{className:"current-image-next-prev-buttons",children:[no("div",{className:"next-prev-button-trigger-area prev-button-trigger-area",onMouseOver:c,onMouseOut:d,children:l&&!i&&no(x_,{"aria-label":"Previous image",icon:no(zce,{className:"next-prev-button"}),variant:"unstyled",onClick:function(){e(t4())}})}),no("div",{className:"next-prev-button-trigger-area next-button-trigger-area",onMouseOver:c,onMouseOut:d,children:l&&!a&&no(x_,{"aria-label":"Next image",icon:no(jce,{className:"next-prev-button"}),variant:"unstyled",onClick:function(){e(e4())}})})]}),r&&ro(to,{children:[no(Gme,{image:r.url,styleClass:"lightbox-image"}),o&&no(Wde,{image:r})]})]}),no(Tge,{})]})]})}function Yme(e){return Tce({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M14 1H3L2 2v11l1 1h11l1-1V2l-1-1zM8 13H3V2h5v11zm6 0H9V2h5v11z"}}]})(e)}var Zme=QX(Mde,(function(e){return{resultImages:e.categories.result.images,userImages:e.categories.user.images}})),Xme=QX([pae,Lae,fae],(function(e,t,n){return{shouldShowDualDisplay:e.shouldShowDualDisplay,shouldPinParametersPanel:e.shouldPinParametersPanel,isLightboxOpen:t.isLightboxOpen,shouldShowDualDisplayButton:["inpainting"].includes(n),activeTabName:n}}),{memoizeOptions:{resultEqualityCheck:dae}}),$me=function(e){var t,n,r,o=wie(),i=e.optionsPanel,a=e.children,s=e.styleClass,l=kie(Xme),u=l.activeTabName,c=l.shouldShowDualDisplay,d=l.isLightboxOpen,f=l.shouldShowDualDisplayButton,h=(t=kie(Zme),n=t.resultImages,r=t.userImages,function(e){var t=n.find((function(t){return t.uuid===e}));return t||r.find((function(t){return t.uuid===e}))||void 0});return no("div",{className:s?"workarea-wrapper ".concat(s):"workarea-wrapper",children:ro("div",{className:"workarea-main",children:[i,ro("div",{className:"workarea-children-wrapper",onDrop:function(e){var t=e.dataTransfer.getData("invokeai/imageUuid"),n=h(t);n&&("img2img"===u?o(M4(n)):"unifiedCanvas"===u&&o(y3(n)))},children:[a,f&&no(kY,{label:"Toggle Split View",children:no("div",{className:"workarea-split-button","data-selected":c,onClick:function(){o(W8(!c)),o(m3(!0))},children:no(Yme,{})})})]}),!d&&no(Tge,{})]})})},Kme=function(e){var t=e.styleClass,n=cr.useContext(bie);return no("div",{className:"image-uploader-button-outer ".concat(t),onClick:function(){n&&n()},children:ro("div",{className:"image-upload-button",children:[no(_de,{}),no(xP,{size:"lg",children:"Click or Drag and Drop"})]})})},Qme=QX([Mde,pae,fae],(function(e,t,n){var r=e.currentImage,o=e.intermediateImage;return{activeTabName:n,shouldShowImageDetails:t.shouldShowImageDetails,hasAnImageToDisplay:r||o}}),{memoizeOptions:{resultEqualityCheck:dae}}),Jme=function(){var e=kie(Qme),t=e.hasAnImageToDisplay,n=e.activeTabName;return no("div",{className:"current-image-area","data-tab-name":n,children:t?ro(to,{children:[no(zde,{}),no(Gde,{})]}):no("div",{className:"current-image-display-placeholder",children:no(Afe,{})})})},eye=function(){var e=cr.useContext(bie);return no(_ae,{"aria-label":"Upload Image",tooltip:"Upload Image",icon:no(_de,{}),onClick:e||void 0})};function tye(){var e=kie((function(e){return e.generation.initialImage})),t=o8().t,n=wie(),r=cY();return ro(to,{children:[ro("div",{className:"init-image-preview-header",children:[no("h2",{children:t("parameters:initialImage")}),no(eye,{})]}),e&&no("div",{className:"init-image-preview",children:no(c_,{fit:"contain",maxWidth:"100%",maxHeight:"100%",src:"string"==typeof e?e:e.url,onError:function(){r({title:t("toast:parametersFailed"),description:t("toast:parametersFailedDesc"),status:"error",isClosable:!0}),n(C4())}})})]})}var nye=function(){var e=kie((function(e){return e.generation.initialImage})),t=kie((function(e){return e.gallery})),n=t.currentImage;return ro("div",{className:"workarea-split-view",children:[no("div",{className:"workarea-split-view-left",children:e?no("div",{className:"image-to-image-area",children:no(tye,{})}):no(Kme,{})}),n&&no("div",{className:"workarea-split-view-right",children:no(Jme,{})})]})},rye=function(e){return e[e.PROMPT=0]="PROMPT",e[e.GALLERY=1]="GALLERY",e[e.OTHER=2]="OTHER",e[e.SEED=3]="SEED",e[e.VARIATIONS=4]="VARIATIONS",e[e.UPSCALE=5]="UPSCALE",e[e.FACE_CORRECTION=6]="FACE_CORRECTION",e[e.IMAGE_TO_IMAGE=7]="IMAGE_TO_IMAGE",e[e.BOUNDING_BOX=8]="BOUNDING_BOX",e[e.SEAM_CORRECTION=9]="SEAM_CORRECTION",e[e.INFILL_AND_SCALING=10]="INFILL_AND_SCALING",e}(rye||{}),oye=function(e){var t=function(){var e=o8().t;return cr.useMemo((function(){var t;return gn(t={},0,{text:e("tooltip:feature.prompt"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}),gn(t,1,{text:e("tooltip:feature.gallery"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}),gn(t,2,{text:e("tooltip:feature.other"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}),gn(t,3,{text:e("tooltip:feature.seed"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}),gn(t,4,{text:e("tooltip:feature.variations"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}),gn(t,5,{text:e("tooltip:feature.upscale"),href:"link/to/docs/feature1.html",guideImage:"asset/path.gif"}),gn(t,6,{text:e("tooltip:feature.faceCorrection"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}),gn(t,7,{text:e("tooltip:feature.imageToImage"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}),gn(t,8,{text:e("tooltip:feature.boundingBox"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}),gn(t,9,{text:e("tooltip:feature.seamCorrection"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}),gn(t,10,{text:e("tooltip:feature.infillAndScaling"),href:"link/to/docs/feature3.html",guideImage:"asset/path.gif"}),t}),[e])}();return t[e]},iye=function(e){var t=e.label,n=e.isDisabled,r=void 0!==n&&n,o=e.width,i=void 0===o?"auto":o,a=e.formControlProps,s=e.formLabelProps,l=e.styleClass,u=sn(e,Ft);return ro(I_,un(un({isDisabled:r,width:i,className:"invokeai__switch-form-control ".concat(l),display:"flex",columnGap:"1rem",alignItems:"center",justifyContent:"space-between"},a),{},{children:[no(V_,un(un({className:"invokeai__switch-form-label",whiteSpace:"nowrap",marginRight:0,marginTop:.5,marginBottom:.5,fontSize:"sm",fontWeight:"bold",width:"auto"},s),{},{children:t})),no(Cq,un({className:"invokeai__switch-root"},u))]}))};function aye(){var e=kie((function(e){return e.system.isGFPGANAvailable})),t=kie((function(e){return e.postprocessing.shouldRunFacetool})),n=wie();return no(iye,{isDisabled:!e,isChecked:t,onChange:function(e){return n(c6(e.target.checked))}})}function sye(){var e=wie(),t=kie((function(e){return e.generation.shouldFitToWidthHeight})),n=o8().t;return no(iye,{label:n("parameters:imageFit"),isChecked:t,onChange:function(t){return e(G4(t.target.checked))}})}function lye(e){var t=o8().t,n=e.label,r=void 0===n?"".concat(t("parameters:strength")):n,o=e.styleClass,i=kie((function(e){return e.generation.img2imgStrength})),a=wie();return no(xfe,{label:r,step:.01,min:.01,max:.99,onChange:function(e){return a(O4(e))},value:i,isInteger:!1,styleClass:o,withInput:!0,withSliderMarks:!0,inputWidth:"5.5rem",withReset:!0,handleReset:function(){a(O4(.75))}})}var uye=function(){var e=wie(),t=kie((function(e){return e.generation.seamless})),n=o8().t;return no(yP,{gap:2,direction:"column",children:no(iye,{label:n("parameters:seamlessTiling"),fontSize:"md",isChecked:t,onChange:function(t){return e(B4(t.target.checked))}})})},cye=function(){return no(yP,{gap:2,direction:"column",children:no(uye,{})})};function dye(){var e=wie(),t=kie((function(e){return e.generation.perlin})),n=o8().t;return no(Aae,{label:n("parameters:perlinNoise"),min:0,max:1,step:.05,onChange:function(t){return e(R4(t))},value:t,isInteger:!1})}function fye(){var e=wie(),t=o8().t,n=kie((function(e){return e.generation.shouldRandomizeSeed}));return no(iye,{label:t("parameters:randomizeSeed"),isChecked:n,onChange:function(t){return e(Y4(t.target.checked))}})}function hye(){var e=kie((function(e){return e.generation.seed})),t=kie((function(e){return e.generation.shouldRandomizeSeed})),n=kie((function(e){return e.generation.shouldGenerateVariations})),r=o8().t,o=wie();return no(Aae,{label:r("parameters:seed"),step:1,precision:0,flexGrow:1,min:0,max:yte,isDisabled:t,isInvalid:e<0&&n,onChange:function(e){return o(W4(e))},value:e,width:"auto"})}function pye(){var e=wie(),t=kie((function(e){return e.generation.shouldRandomizeSeed})),n=o8().t;return no(b_,{size:"sm",isDisabled:t,onClick:function(){return e(W4(Aoe(0,yte)))},padding:"0 1.5rem",children:no("p",{children:n("parameters:shuffle")})})}function vye(){var e=wie(),t=kie((function(e){return e.generation.threshold})),n=o8().t;return no(Aae,{label:n("parameters:noiseThreshold"),min:0,max:1e3,step:.1,onChange:function(t){return e(X4(t))},value:t,isInteger:!1})}var gye=function(){return ro(yP,{gap:2,direction:"column",children:[no(fye,{}),ro(yP,{gap:2,children:[no(hye,{}),no(pye,{})]}),no(yP,{gap:2,children:no(vye,{})}),no(yP,{gap:2,children:no(dye,{})})]})};function mye(){var e=kie((function(e){return e.system.isESRGANAvailable})),t=kie((function(e){return e.postprocessing.shouldRunESRGAN})),n=wie();return no(iye,{isDisabled:!e,isChecked:t,onChange:function(e){return n(u6(e.target.checked))}})}function yye(){var e=kie((function(e){return e.generation.shouldGenerateVariations})),t=wie();return no(iye,{isChecked:e,width:"auto",onChange:function(e){return t(q4(e.target.checked))}})}function bye(e){var t=e.label,n=void 0===t?"":t,r=e.styleClass,o=e.isDisabled,i=void 0!==o&&o,a=e.fontSize,s=void 0===a?"sm":a,l=e.width,u=e.size,c=void 0===u?"sm":u,d=e.isInvalid,f=sn(e,Ht);return ro(I_,{className:"input ".concat(r),isInvalid:d,isDisabled:i,children:[""!==n&&no(V_,{fontSize:s,fontWeight:"bold",alignItems:"center",whiteSpace:"nowrap",marginBottom:0,marginRight:0,className:"input-label",children:n}),no(YE,un(un({},f),{},{className:"input-entry",size:c,width:l}))]})}function wye(){var e=kie((function(e){return e.generation.seedWeights})),t=kie((function(e){return e.generation.shouldGenerateVariations})),n=o8().t,r=wie();return no(bye,{label:n("parameters:seedWeights"),value:e,isInvalid:t&&!(b4(e)||""===e),isDisabled:!t,onChange:function(e){return r(U4(e.target.value))}})}function kye(){var e=kie((function(e){return e.generation.variationAmount})),t=kie((function(e){return e.generation.shouldGenerateVariations})),n=o8().t,r=wie();return no(Aae,{label:n("parameters:variationAmount"),value:e,step:.01,min:0,max:1,isDisabled:!t,onChange:function(e){return r(K4(e))},isInteger:!1})}var xye=function(){return ro(yP,{gap:2,direction:"column",children:[no(kye,{}),no(wye,{})]})};function Sye(){var e=wie(),t=kie((function(e){return e.generation.cfgScale})),n=o8().t;return no(Aae,{label:n("parameters:cfgScale"),step:.5,min:1.01,max:200,onChange:function(t){return e(P4(t))},value:t,width:"auto",styleClass:"main-settings-block",textAlign:"center",isInteger:!1})}function Cye(){var e=kie((function(e){return e.generation.height})),t=kie(fae),n=wie(),r=o8().t;return no(Mae,{isDisabled:"unifiedCanvas"===t,label:r("parameters:height"),value:e,flexGrow:1,onChange:function(e){return n(L4(Number(e.target.value)))},validValues:gte,styleClass:"main-settings-block"})}var _ye=QX([function(e){return e.generation}],(function(e){return{iterations:e.iterations}}),{memoizeOptions:{resultEqualityCheck:dae}});function Eye(){var e=wie(),t=kie(_ye).iterations,n=o8().t;return no(Aae,{label:n("parameters:images"),step:1,min:1,max:9999,onChange:function(t){return e(T4(t))},value:t,width:"auto",labelFontSize:.5,styleClass:"main-settings-block",textAlign:"center"})}function Pye(){var e=kie((function(e){return e.generation.sampler})),t=kie(xle),n=wie(),r=o8().t;return no(Mae,{label:r("parameters:sampler"),value:e,onChange:function(e){return n(z4(e.target.value))},validValues:"diffusers"===t.format?pte:hte,styleClass:"main-settings-block"})}function Lye(){var e=wie(),t=kie((function(e){return e.generation.steps})),n=o8().t;return no(Aae,{label:n("parameters:steps"),min:1,max:9999,step:1,onChange:function(t){return e(Z4(t))},value:t,width:"auto",styleClass:"main-settings-block",textAlign:"center"})}function Oye(){var e=kie((function(e){return e.generation.width})),t=kie(fae),n=o8().t,r=wie();return no(Mae,{isDisabled:"unifiedCanvas"===t,label:n("parameters:width"),value:e,flexGrow:1,onChange:function(e){return r(Q4(Number(e.target.value)))},validValues:vte,styleClass:"main-settings-block"})}function Aye(){return no("div",{className:"main-settings",children:ro("div",{className:"main-settings-list",children:[ro("div",{className:"main-settings-row",children:[no(Eye,{}),no(Lye,{}),no(Sye,{})]}),ro("div",{className:"main-settings-row",children:[no(Oye,{}),no(Cye,{}),no(Pye,{})]})]})})}var Mye=QX(wle,(function(e){return e.shouldDisplayGuides})),Tye=function(e){var t=e.children,n=e.feature,r=kie(Mye),o=oye(n).text;return r?ro(qU,{trigger:"hover",children:[no(nG,{children:no(cP,{children:t})}),ro(eG,{className:"guide-popover-content",maxWidth:"400px",onClick:function(e){return e.preventDefault()},cursor:"initial",children:[no(YU,{className:"guide-popover-arrow"}),no("div",{className:"guide-popover-guide-content",children:o})]})]}):null},Iye=Cv((function(e,t){var n=e.feature,r=e.icon;return no(Tye,{feature:n,children:no(cP,{ref:t,children:no(Gv,{marginBottom:"-.15rem",as:void 0===r?Efe:r})})})}));function Rye(e){var t=e.header,n=e.feature,r=e.content,o=e.additionalHeaderComponents;return ro(GC,{className:"advanced-parameters-item",children:[no(jC,{className:"advanced-parameters-header",children:ro(yP,{width:"100%",gap:"0.5rem",align:"center",children:[no(cP,{flexGrow:1,textAlign:"left",children:t}),o,n&&no(Iye,{feature:n}),no(UC,{})]})}),no(qC,{className:"advanced-parameters-panel",children:r})]})}var Nye=function(e){var t,n=e.accordionInfo,r=kie((function(e){return e.system.openAccordions})),o=wie();return no(YC,{defaultIndex:r,allowMultiple:!0,reduceMotion:!0,onChange:function(e){return o(h8(e))},className:"advanced-parameters",children:(t=[],n&&Object.keys(n).forEach((function(e){var r=n[e],o=r.header,i=r.feature,a=r.content,s=r.additionalHeaderComponents;t.push(no(Rye,{header:o,feature:i,content:a,additionalHeaderComponents:s},e))})),t)})},Dye=QX(wle,(function(e){return{isProcessing:e.isProcessing,isConnected:e.isConnected,isCancelable:e.isCancelable}}),{memoizeOptions:{resultEqualityCheck:dae}});function zye(e){var t=Object.assign({},(Kt(e),e)),n=wie(),r=kie(Dye),o=r.isProcessing,i=r.isConnected,a=r.isCancelable,s=function(){return n(rie())},l=o8().t;return _ce("shift+x",(function(){(i||o)&&a&&s()}),[i,o,a]),no(_ae,un({icon:no(Mfe,{}),tooltip:l("parameters:cancel"),"aria-label":l("parameters:cancel"),isDisabled:!i||!o||!a,onClick:s,styleClass:"cancel-btn"},t))}var jye=function(e){return e.generation};QX(jye,(function(e){var t=e.shouldRandomizeSeed,n=e.shouldGenerateVariations;return t||n}),{memoizeOptions:{resultEqualityCheck:dae}});var Bye=QX([jye,wle,Ade,fae],(function(e,t,n,r){var o=e.prompt,i=e.shouldGenerateVariations,a=e.seedWeights,s=e.initialImage,l=e.seed,u=t.isProcessing,c=t.isConnected,d=!0,f=[];return o&&!Boolean(o.match(/^[\s\r\n]+$/))||(d=!1,f.push("Missing prompt")),"img2img"!==r||s||(d=!1,f.push("No initial image selected")),u&&(d=!1,f.push("System Busy")),c||(d=!1,f.push("System Disconnected")),i&&(!b4(a)&&""!==a||-1===l)&&(d=!1,f.push("Seed-Weights badly formatted.")),{isReady:d,reasonsWhyNotReady:f}}),{memoizeOptions:{equalityCheck:dae,resultEqualityCheck:dae}});function Fye(e){var t=e.iconButton,n=void 0!==t&&t,r=sn(e,Vt),o=wie(),i=kie(Bye).isReady,a=kie(fae),s=function(){o(Koe(a))},l=o8().t;return _ce(["ctrl+enter","meta+enter"],(function(){o(Koe(a))}),{enabled:function(){return i},preventDefault:!0,enableOnFormTags:["input","textarea","select"]},[i,a]),no("div",{style:{flexGrow:4},children:n?no(_ae,un({"aria-label":l("parameters:invoke"),type:"submit",icon:no(fde,{}),isDisabled:!i,onClick:s,className:"invoke-btn",tooltip:l("parameters:invoke"),tooltipProps:{placement:"bottom"}},r)):no(Eae,un(un({"aria-label":l("parameters:invoke"),type:"submit",isDisabled:!i,onClick:s,className:"invoke-btn"},r),{},{children:"Invoke"}))})}var Hye=QX(Tae,(function(e){return e.shouldLoopback})),Vye=function(){var e=wie(),t=kie(Hye),n=o8().t;return no(_ae,{"aria-label":n("parameters:toggleLoopback"),tooltip:n("parameters:toggleLoopback"),styleClass:"loopback-btn",asCheckbox:!0,isChecked:t,icon:no(vde,{}),onClick:function(){e(l6(!t))}})},Wye=function(){var e=kie(fae);return ro("div",{className:"process-buttons",children:[no(Fye,{}),"img2img"===e&&no(Vye,{}),no(zye,{})]})},Uye=function(){var e=kie((function(e){return e.generation.negativePrompt})),t=wie(),n=o8().t;return no(I_,{children:no(Qq,{id:"negativePrompt",name:"negativePrompt",value:e,onChange:function(e){return t(D4(e.target.value))},background:"var(--prompt-bg-color)",placeholder:n("parameters:negativePrompts"),_placeholder:{fontSize:"0.8rem"},borderColor:"var(--border-color)",_hover:{borderColor:"var(--border-color-light)"},_focusVisible:{borderColor:"var(--border-color-invalid)",boxShadow:"0 0 10px var(--box-shadow-color-invalid)"},fontSize:"0.9rem",color:"var(--text-color-secondary)"})})},Gye=QX([function(e){return e.generation},fae],(function(e,t){return{prompt:e.prompt,activeTabName:t}}),{memoizeOptions:{resultEqualityCheck:dae}}),qye=function(){var e=wie(),t=kie(Gye),n=t.prompt,r=t.activeTabName,o=kie(Bye).isReady,i=cr.useRef(null),a=o8().t;_ce("alt+a",(function(){var e;null===(e=i.current)||void 0===e||e.focus()}),[]);return no("div",{className:"prompt-bar",children:no(I_,{isInvalid:0===n.length||Boolean(n.match(/^[\s\r\n]+$/)),children:no(Qq,{id:"prompt",name:"prompt",placeholder:a("parameters:promptPlaceholder"),size:"lg",value:n,onChange:function(t){e(N4(t.target.value))},onKeyDown:function(t){"Enter"===t.key&&!1===t.shiftKey&&o&&(t.preventDefault(),e(Koe(r)))},resize:"vertical",height:30,ref:i,_placeholder:{color:"var(--text-color-secondary)"}})})})},Yye=""+new URL("logo-13003d72.png",Zt.meta.url).href,Zye=QX(pae,(function(e){return{shouldShowParametersPanel:e.shouldShowParametersPanel,shouldHoldParametersPanelOpen:e.shouldHoldParametersPanelOpen,shouldPinParametersPanel:e.shouldPinParametersPanel,parametersPanelScrollPosition:e.parametersPanelScrollPosition}}),{memoizeOptions:{resultEqualityCheck:dae}}),Xye=function(e){var t=wie(),n=kie(Zye),r=n.shouldShowParametersPanel,o=n.shouldHoldParametersPanelOpen,i=n.shouldPinParametersPanel,a=cr.useRef(null),s=cr.useRef(null),l=cr.useRef(null),u=e.children;_ce("o",(function(){t(V8(!r)),i&&setTimeout((function(){return t(m3(!0))}),400)}),[r,i]),_ce("esc",(function(){t(V8(!1))}),{enabled:function(){return!i},preventDefault:!0},[i]),_ce("shift+o",(function(){f(),t(m3(!0))}),[i]);var c=cr.useCallback((function(){i||(t(B8(s.current?s.current.scrollTop:0)),t(V8(!1)),t(F8(!1)))}),[t,i]),d=function(){l.current&&window.clearTimeout(l.current)},f=function(){t(H8(!i)),t(m3(!0))};return cr.useEffect((function(){function e(e){a.current&&!a.current.contains(e.target)&&c()}return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[c]),no(Yfe,{nodeRef:a,in:r||o&&!i,unmountOnExit:!0,timeout:200,classNames:"parameters-panel-wrapper",children:no("div",{className:"parameters-panel-wrapper","data-pinned":i,tabIndex:1,ref:a,onMouseEnter:i?void 0:d,onMouseOver:i?void 0:d,style:{borderRight:i?"":"0.3rem solid var(--tab-list-text-inactive)"},children:no("div",{className:"parameters-panel-margin",children:ro("div",{className:"parameters-panel",ref:s,onMouseLeave:function(e){e.target!==s.current?d():!i&&(l.current=window.setTimeout((function(){return c()}),500))},children:[no(kY,{label:"Pin Options Panel",children:no("div",{className:"parameters-panel-pin-button","data-selected":i,onClick:f,children:no(i?Sfe:Cfe,{})})}),!i&&ro("div",{className:"invoke-ai-logo-wrapper",children:[no("img",{src:Yye,alt:"invoke-ai-logo"}),ro("h1",{children:["invoke ",no("strong",{children:"ai"})]})]}),u]})})})})};function $ye(){var e=o8().t,t={seed:{header:"".concat(e("parameters:seed")),feature:rye.SEED,content:no(gye,{})},variations:{header:"".concat(e("parameters:variations")),feature:rye.VARIATIONS,content:no(xye,{}),additionalHeaderComponents:no(yye,{})},face_restore:{header:"".concat(e("parameters:faceRestoration")),feature:rye.FACE_CORRECTION,content:no(Cle,{}),additionalHeaderComponents:no(aye,{})},upscale:{header:"".concat(e("parameters:upscaling")),feature:rye.UPSCALE,content:no(Ele,{}),additionalHeaderComponents:no(mye,{})},other:{header:"".concat(e("parameters:otherOptions")),feature:rye.OTHER,content:no(cye,{})}},n=wie(),r=kie(fae);return cr.useEffect((function(){if("img2img"===r){n(a6(!1))}}),[r,n]),ro(Xye,{children:[ro(yP,{flexDir:"column",rowGap:"0.5rem",children:[no(qye,{}),no(Uye,{})]}),no(Wye,{}),no(Aye,{}),no(lye,{label:e("parameters:img2imgStrength"),styleClass:"main-settings-block image-to-image-strength-main-option"}),no(sye,{}),no(Nye,{accordionInfo:t})]})}function Kye(){return no($me,{optionsPanel:no($ye,{}),children:no(nye,{})})}var Qye=function(){return no("div",{className:"workarea-single-view",children:no("div",{className:"text-to-image-area",children:no(Jme,{})})})},Jye=QX([Tae],(function(e){return{hiresFix:e.hiresFix,hiresStrength:e.hiresStrength}}),{memoizeOptions:{resultEqualityCheck:dae}}),ebe=function(){var e=kie(Jye),t=e.hiresFix,n=e.hiresStrength,r=wie(),o=o8().t;return no(xfe,{label:o("parameters:hiresStrength"),step:.01,min:.01,max:.99,onChange:function(e){r(s6(e))},value:n,isInteger:!1,withInput:!0,withSliderMarks:!0,inputWidth:"5.5rem",withReset:!0,handleReset:function(){r(s6(.75))},isSliderDisabled:!t,isInputDisabled:!t,isResetDisabled:!t})},tbe=function(){var e=wie(),t=kie((function(e){return e.postprocessing.hiresFix})),n=o8().t;return ro(yP,{gap:2,direction:"column",children:[no(iye,{label:n("parameters:hiresOptim"),fontSize:"md",isChecked:t,onChange:function(t){return e(a6(t.target.checked))}}),no(ebe,{})]})},nbe=function(){return ro(yP,{gap:2,direction:"column",children:[no(uye,{}),no(tbe,{})]})};function rbe(){var e=o8().t,t={seed:{header:"".concat(e("parameters:seed")),feature:rye.SEED,content:no(gye,{})},variations:{header:"".concat(e("parameters:variations")),feature:rye.VARIATIONS,content:no(xye,{}),additionalHeaderComponents:no(yye,{})},face_restore:{header:"".concat(e("parameters:faceRestoration")),feature:rye.FACE_CORRECTION,content:no(Cle,{}),additionalHeaderComponents:no(aye,{})},upscale:{header:"".concat(e("parameters:upscaling")),feature:rye.UPSCALE,content:no(Ele,{}),additionalHeaderComponents:no(mye,{})},other:{header:"".concat(e("parameters:otherOptions")),feature:rye.OTHER,content:no(nbe,{})}};return ro(Xye,{children:[ro(yP,{flexDir:"column",rowGap:"0.5rem",children:[no(qye,{}),no(Uye,{})]}),no(Wye,{}),no(Aye,{}),no(Nye,{accordionInfo:t})]})}function obe(){return no($me,{optionsPanel:no(rbe,{}),children:no(Qye,{})})}var ibe={},abe={get exports(){return ibe},set exports(e){ibe=e}},sbe=function(e){var t={},n=cr,r=tA,o=Object.assign;function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n--s||o[a]!==i[s]){var l="\n"+o[a].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}}while(1<=a&&0<=s);break}}}finally{tt=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?et(e):""}var rt=Object.prototype.hasOwnProperty,ot=[],it=-1;function at(e){return{current:e}}function st(e){0>it||(e.current=ot[it],ot[it]=null,it--)}function lt(e,t){it++,ot[it]=e.current,e.current=t}var ut={},ct=at(ut),dt=at(!1),ft=ut;function ht(e,t){var n=e.type.contextTypes;if(!n)return ut;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o,i={};for(o in n)i[o]=t[o];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function pt(e){return null!=(e=e.childContextTypes)}function vt(){st(dt),st(ct)}function gt(e,t,n){if(ct.current!==ut)throw Error(i(168));lt(ct,t),lt(dt,n)}function mt(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var a in r=r.getChildContext())if(!(a in t))throw Error(i(108,S(e)||"Unknown",a));return o({},n,r)}function yt(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ut,ft=ct.current,lt(ct,e),lt(dt,dt.current),!0}function bt(e,t,n){var r=e.stateNode;if(!r)throw Error(i(169));n?(e=mt(e,t,ft),r.__reactInternalMemoizedMergedChildContext=e,st(dt),st(ct),lt(ct,e)):st(dt),lt(dt,n)}var wt=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(kt(e)/xt|0)|0},kt=Math.log,xt=Math.LN2;var St=64,Ct=4194304;function _t(e){switch(e&-e){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 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Et(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,a=268435455&n;if(0!==a){var s=a&~o;0!==s?r=_t(s):0!==(i&=a)&&(r=_t(i))}else 0!==(a=n&~o)?r=_t(a):0!==i&&(r=_t(i));if(0===r)return 0;if(0!==t&&t!==r&&0==(t&o)&&((o=r&-r)>=(i=t&-t)||16===o&&0!=(4194240&i)))return t;if(0!=(4&r)&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Mt(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-wt(t)]=n}function Tt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-wt(n),o=1<>=a,o-=a,an=1<<32-wt(t)+o|n<f?(h=d,d=null):h=d.sibling;var p=g(o,d,s[f],l);if(null===p){null===d&&(d=h);break}e&&d&&null===p.alternate&&t(o,d),i=a(p,i,f),null===c?u=p:c.sibling=p,c=p,d=h}if(f===s.length)return n(o,d),pn&&ln(o,f),u;if(null===d){for(;fh?(p=f,f=null):p=f.sibling;var b=g(o,f,y.value,u);if(null===b){null===f&&(f=p);break}e&&f&&null===b.alternate&&t(o,f),s=a(b,s,h),null===d?c=b:d.sibling=b,d=b,f=p}if(y.done)return n(o,f),pn&&ln(o,h),c;if(null===f){for(;!y.done;h++,y=l.next())null!==(y=v(o,y.value,u))&&(s=a(y,s,h),null===d?c=y:d.sibling=y,d=y);return pn&&ln(o,h),c}for(f=r(o,f);!y.done;h++,y=l.next())null!==(y=m(f,o,h,y.value,u))&&(e&&null!==y.alternate&&f.delete(null===y.key?h:y.key),s=a(y,s,h),null===d?c=y:d.sibling=y,d=y);return e&&f.forEach((function(e){return t(o,e)})),pn&&ln(o,h),c}return function e(r,i,a,d){if("object"===kn(a)&&null!==a&&a.type===u&&null===a.key&&(a=a.props.children),"object"===kn(a)&&null!==a){switch(a.$$typeof){case s:e:{for(var f=a.key,h=i;null!==h;){if(h.key===f){if((f=a.type)===u){if(7===h.tag){n(r,h.sibling),(i=o(h,a.props.children)).return=r,r=i;break e}}else if(h.elementType===f||"object"===kn(f)&&null!==f&&f.$$typeof===y&&ur(f)===h.type){n(r,h.sibling),(i=o(h,a.props)).ref=sr(r,h,a),i.return=r,r=i;break e}n(r,h);break}t(r,h),h=h.sibling}a.type===u?((i=fs(a.props.children,r.mode,d,a.key)).return=r,r=i):((d=ds(a.type,a.key,a.props,null,r.mode,d)).ref=sr(r,i,a),d.return=r,r=d)}return c(r);case l:e:{for(h=a.key;null!==i;){if(i.key===h){if(4===i.tag&&i.stateNode.containerInfo===a.containerInfo&&i.stateNode.implementation===a.implementation){n(r,i.sibling),(i=o(i,a.children||[])).return=r,r=i;break e}n(r,i);break}t(r,i),i=i.sibling}(i=vs(a,r.mode,d)).return=r,r=i}return c(r);case y:return e(r,i,(h=a._init)(a._payload),d)}if(M(a))return b(r,i,a,d);if(k(a))return w(r,i,a,d);lr(r,a)}return"string"==typeof a&&""!==a||"number"==typeof a?(a=""+a,null!==i&&6===i.tag?(n(r,i.sibling),(i=o(i,a)).return=r,r=i):(n(r,i),(i=ps(a,r.mode,d)).return=r,r=i),c(r)):n(r,i)}}var fr=dr(!0),hr=dr(!1),pr={},vr=at(pr),gr=at(pr),mr=at(pr);function yr(e){if(e===pr)throw Error(i(174));return e}function br(e,t){lt(mr,t),lt(gr,e),lt(vr,pr),e=I(t),st(vr),lt(vr,e)}function wr(){st(vr),st(gr),st(mr)}function kr(e){var t=yr(mr.current),n=yr(vr.current);n!==(t=R(n,e.type,t))&&(lt(gr,e),lt(vr,t))}function xr(e){gr.current===e&&(st(vr),st(gr))}var Sr=at(0);function Cr(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||Ne(n)||De(n)))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var _r=[];function Er(){for(var e=0;e<_r.length;e++){var t=_r[e];q?t._workInProgressVersionPrimary=null:t._workInProgressVersionSecondary=null}_r.length=0}var Pr=a.ReactCurrentDispatcher,Lr=a.ReactCurrentBatchConfig,Or=0,Ar=null,Mr=null,Tr=null,Ir=!1,Rr=!1,Nr=0,Dr=0;function zr(){throw Error(i(321))}function jr(e,t){if(null===t)return!1;for(var n=0;nn?n:4,e(!0);var r=Lr.transition;Lr.transition={};try{e(!1),t()}finally{It=n,Lr.transition=r}}function go(){return Vr().memoizedState}function mo(e,t,n){var r=Ia(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},bo(e))wo(t,n);else if(null!==(n=Wn(e,t,n,r))){Ra(n,e,r,Ta()),ko(n,t,r)}}function yo(e,t,n){var r=Ia(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(bo(e))wo(t,o);else{var i=e.alternate;if(0===e.lanes&&(null===i||0===i.lanes)&&null!==(i=t.lastRenderedReducer))try{var a=t.lastRenderedState,s=i(a,n);if(o.hasEagerState=!0,o.eagerState=s,qt(s,a)){var l=t.interleaved;return null===l?(o.next=o,Vn(t)):(o.next=l.next,l.next=o),void(t.interleaved=o)}}catch(hpe){}null!==(n=Wn(e,t,o,r))&&(Ra(n,e,r,o=Ta()),ko(n,t,r))}}function bo(e){var t=e.alternate;return e===Ar||null!==t&&t===Ar}function wo(e,t){Rr=Ir=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ko(e,t,n){if(0!=(4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,Tt(e,n)}}var xo={readContext:Fn,useCallback:zr,useContext:zr,useEffect:zr,useImperativeHandle:zr,useInsertionEffect:zr,useLayoutEffect:zr,useMemo:zr,useReducer:zr,useRef:zr,useState:zr,useDebugValue:zr,useDeferredValue:zr,useTransition:zr,useMutableSource:zr,useSyncExternalStore:zr,useId:zr,unstable_isNewReconciler:!1},So={readContext:Fn,useCallback:function(e,t){return Hr().memoizedState=[e,void 0===t?null:t],e},useContext:Fn,useEffect:oo,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,no(4194308,4,lo.bind(null,t,e),n)},useLayoutEffect:function(e,t){return no(4194308,4,e,t)},useInsertionEffect:function(e,t){return no(4,2,e,t)},useMemo:function(e,t){var n=Hr();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Hr();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=mo.bind(null,Ar,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},Hr().memoizedState=e},useState:Jr,useDebugValue:co,useDeferredValue:function(e){return Hr().memoizedState=e},useTransition:function(){var e=Jr(!1),t=e[0];return e=vo.bind(null,e[1]),Hr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ar,o=Hr();if(pn){if(void 0===n)throw Error(i(407));n=n()}else{if(n=t(),null===ia)throw Error(i(349));0!=(30&Or)||Zr(r,t,n)}o.memoizedState=n;var a={value:n,getSnapshot:t};return o.queue=a,oo($r.bind(null,r,a,e),[e]),r.flags|=2048,eo(9,Xr.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=Hr(),t=ia.identifierPrefix;if(pn){var n=sn;t=":"+t+"R"+(n=(an&~(1<<32-wt(an)-1)).toString(32)+n),0<(n=Nr++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=Dr++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Co={readContext:Fn,useCallback:fo,useContext:Fn,useEffect:io,useImperativeHandle:uo,useInsertionEffect:ao,useLayoutEffect:so,useMemo:ho,useReducer:Ur,useRef:to,useState:function(){return Ur(Wr)},useDebugValue:co,useDeferredValue:function(e){return po(Vr(),Mr.memoizedState,e)},useTransition:function(){return[Ur(Wr)[0],Vr().memoizedState]},useMutableSource:qr,useSyncExternalStore:Yr,useId:go,unstable_isNewReconciler:!1},_o={readContext:Fn,useCallback:fo,useContext:Fn,useEffect:io,useImperativeHandle:uo,useInsertionEffect:ao,useLayoutEffect:so,useMemo:ho,useReducer:Gr,useRef:to,useState:function(){return Gr(Wr)},useDebugValue:co,useDeferredValue:function(e){var t=Vr();return null===Mr?t.memoizedState=e:po(t,Mr.memoizedState,e)},useTransition:function(){return[Gr(Wr)[0],Vr().memoizedState]},useMutableSource:qr,useSyncExternalStore:Yr,useId:go,unstable_isNewReconciler:!1};function Eo(e,t){try{var n="",r=t;do{n+=On(r),r=r.return}while(r);var o=n}catch(Xke){o="\nError generating stack: "+Xke.message+"\n"+Xke.stack}return{value:e,source:t,stack:o,digest:null}}function Po(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function Lo(e,t){try{console.error(t.value)}catch(qke){setTimeout((function(){throw qke}))}}var Oo="function"==typeof WeakMap?WeakMap:Map;function Ao(e,t,n){(n=Zn(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){xa||(xa=!0,Sa=r),Lo(0,t)},n}function Mo(e,t,n){(n=Zn(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){Lo(0,t)}}var i=e.stateNode;return null!==i&&"function"==typeof i.componentDidCatch&&(n.callback=function(){Lo(0,t),"function"!=typeof r&&(null===Ca?Ca=new Set([this]):Ca.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function To(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new Oo;var o=new Set;r.set(t,o)}else void 0===(o=r.get(t))&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=ns.bind(null,e,t,n),t.then(e,e))}function Io(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function Ro(e,t,n,r,o){return 0==(1&e.mode)?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=Zn(-1,1)).tag=2,Xn(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var No=a.ReactCurrentOwner,Do=!1;function zo(e,t,n,r){t.child=null===e?hr(t,null,n,r):fr(t,e.child,n,r)}function jo(e,t,n,r,o){n=n.render;var i=t.ref;return Bn(t,o),r=Br(e,t,n,r,i,o),n=Fr(),null===e||Do?(pn&&n&&cn(t),t.flags|=1,zo(e,t,r,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,si(e,t,o))}function Bo(e,t,n,r,o){if(null===e){var i=n.type;return"function"!=typeof i||us(i)||void 0!==i.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=ds(n.type,null,r,t,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=i,Fo(e,t,i,r,o))}if(i=e.child,0==(e.lanes&o)){var a=i.memoizedProps;if((n=null!==(n=n.compare)?n:Ln)(a,r)&&e.ref===t.ref)return si(e,t,o)}return t.flags|=1,(e=cs(i,r)).ref=t.ref,e.return=t,t.child=e}function Fo(e,t,n,r,o){if(null!==e){var i=e.memoizedProps;if(Ln(i,r)&&e.ref===t.ref){if(Do=!1,t.pendingProps=r=i,0==(e.lanes&o))return t.lanes=e.lanes,si(e,t,o);0!=(131072&e.flags)&&(Do=!0)}}return Wo(e,t,n,r,o)}function Ho(e,t,n){var r=t.pendingProps,o=r.children,i=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(0==(1&t.mode))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},lt(ua,la),la|=n;else{if(0==(1073741824&n))return e=null!==i?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,lt(ua,la),la|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==i?i.baseLanes:n,lt(ua,la),la|=r}else null!==i?(r=i.baseLanes|n,t.memoizedState=null):r=n,lt(ua,la),la|=r;return zo(e,t,o,n),t.child}function Vo(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Wo(e,t,n,r,o){var i=pt(n)?ft:ct.current;return i=ht(t,i),Bn(t,o),n=Br(e,t,n,r,i,o),r=Fr(),null===e||Do?(pn&&r&&cn(t),t.flags|=1,zo(e,t,n,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,si(e,t,o))}function Uo(e,t,n,r,o){if(pt(n)){var i=!0;yt(t)}else i=!1;if(Bn(t,o),null===t.stateNode)ai(e,t),or(t,n,r),ar(t,n,r,o),r=!0;else if(null===e){var a=t.stateNode,s=t.memoizedProps;a.props=s;var l=a.context,u=n.contextType;"object"===kn(u)&&null!==u?u=Fn(u):u=ht(t,u=pt(n)?ft:ct.current);var c=n.getDerivedStateFromProps,d="function"==typeof c||"function"==typeof a.getSnapshotBeforeUpdate;d||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==r||l!==u)&&ir(t,a,r,u),Gn=!1;var f=t.memoizedState;a.state=f,Qn(t,r,a,o),l=t.memoizedState,s!==r||f!==l||dt.current||Gn?("function"==typeof c&&(tr(t,n,c,r),l=t.memoizedState),(s=Gn||rr(t,n,s,r,f,l,u))?(d||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(t.flags|=4194308)):("function"==typeof a.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=u,r=s):("function"==typeof a.componentDidMount&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Yn(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:An(t.type,s),a.props=u,d=t.pendingProps,f=a.context,"object"===kn(l=n.contextType)&&null!==l?l=Fn(l):l=ht(t,l=pt(n)?ft:ct.current);var h=n.getDerivedStateFromProps;(c="function"==typeof h||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==d||f!==l)&&ir(t,a,r,l),Gn=!1,f=t.memoizedState,a.state=f,Qn(t,r,a,o);var p=t.memoizedState;s!==d||f!==p||dt.current||Gn?("function"==typeof h&&(tr(t,n,h,r),p=t.memoizedState),(u=Gn||rr(t,n,u,r,f,p,l)||!1)?(c||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(r,p,l),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,p,l)),"function"==typeof a.componentDidUpdate&&(t.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=l,r=u):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Go(e,t,n,r,i,o)}function Go(e,t,n,r,o,i){Vo(e,t);var a=0!=(128&t.flags);if(!r&&!a)return o&&bt(t,n,!1),si(e,t,i);r=t.stateNode,No.current=t;var s=a&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&a?(t.child=fr(t,e.child,null,i),t.child=fr(t,null,s,i)):zo(e,t,s,i),t.memoizedState=r.state,o&&bt(t,n,!0),t.child}function qo(e){var t=e.stateNode;t.pendingContext?gt(0,t.pendingContext,t.pendingContext!==t.context):t.context&>(0,t.context,!1),br(e,t.containerInfo)}function Yo(e,t,n,r,o){return _n(),En(o),t.flags|=256,zo(e,t,n,r),t.child}var Zo,Xo,$o,Ko,Qo={dehydrated:null,treeContext:null,retryLane:0};function Jo(e){return{baseLanes:e,cachePool:null,transitions:null}}function ei(e,t,n){var r,o=t.pendingProps,a=Sr.current,s=!1,l=0!=(128&t.flags);if((r=l)||(r=(null===e||null!==e.memoizedState)&&0!=(2&a)),r?(s=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(a|=1),lt(Sr,1&a),null===e)return wn(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(0==(1&t.mode)?t.lanes=1:De(e)?t.lanes=8:t.lanes=1073741824,null):(l=o.children,e=o.fallback,s?(o=t.mode,s=t.child,l={mode:"hidden",children:l},0==(1&o)&&null!==s?(s.childLanes=0,s.pendingProps=l):s=hs(l,o,0,null),e=fs(e,o,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Jo(n),t.memoizedState=Qo,e):ti(t,l));if(null!==(a=e.memoizedState)&&null!==(r=a.dehydrated))return function(e,t,n,r,o,a,s){if(n)return 256&t.flags?(t.flags&=-257,ni(e,t,s,r=Po(Error(i(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(a=r.fallback,o=t.mode,r=hs({mode:"visible",children:r.children},o,0,null),(a=fs(a,o,s,null)).flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,0!=(1&t.mode)&&fr(t,e.child,null,s),t.child.memoizedState=Jo(s),t.memoizedState=Qo,a);if(0==(1&t.mode))return ni(e,t,s,null);if(De(o))return r=ze(o).digest,a=Error(i(419)),r=Po(a,r,void 0),ni(e,t,s,r);if(n=0!=(s&e.childLanes),Do||n){if(null!==(r=ia)){switch(s&-s){case 4:o=2;break;case 16:o=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:o=32;break;case 536870912:o=268435456;break;default:o=0}0!==(o=0!=(o&(r.suspendedLanes|s))?0:o)&&o!==a.retryLane&&(a.retryLane=o,Un(e,o),Ra(r,e,o,-1))}return qa(),ni(e,t,s,r=Po(Error(i(421))))}return Ne(o)?(t.flags|=128,t.child=e.child,t=os.bind(null,e),je(o,t),null):(e=a.treeContext,X&&(hn=Ve(o),fn=t,pn=!0,gn=null,vn=!1,null!==e&&(nn[rn++]=an,nn[rn++]=sn,nn[rn++]=on,an=e.id,sn=e.overflow,on=t)),t=ti(t,r.children),t.flags|=4096,t)}(e,t,l,o,r,a,n);if(s){s=o.fallback,l=t.mode,r=(a=e.child).sibling;var u={mode:"hidden",children:o.children};return 0==(1&l)&&t.child!==a?((o=t.child).childLanes=0,o.pendingProps=u,t.deletions=null):(o=cs(a,u)).subtreeFlags=14680064&a.subtreeFlags,null!==r?s=cs(r,s):(s=fs(s,l,n,null)).flags|=2,s.return=t,o.return=t,o.sibling=s,t.child=o,o=s,s=t.child,l=null===(l=e.child.memoizedState)?Jo(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},s.memoizedState=l,s.childLanes=e.childLanes&~n,t.memoizedState=Qo,o}return e=(s=e.child).sibling,o=cs(s,{mode:"visible",children:o.children}),0==(1&t.mode)&&(o.lanes=n),o.return=t,o.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=o,t.memoizedState=null,o}function ti(e,t){return(t=hs({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function ni(e,t,n,r){return null!==r&&En(r),fr(t,e.child,null,n),(e=ti(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function ri(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),jn(e.return,t,n)}function oi(e,t,n,r,o){var i=e.memoizedState;null===i?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function ii(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(zo(e,t,r.children,n),0!=(2&(r=Sr.current)))r=1&r|2,t.flags|=128;else{if(null!==e&&0!=(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&ri(e,n,t);else if(19===e.tag)ri(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(lt(Sr,r),0==(1&t.mode))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;null!==n;)null!==(e=n.alternate)&&null===Cr(e)&&(o=n),n=n.sibling;null===(n=o)?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),oi(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;null!==o;){if(null!==(e=o.alternate)&&null===Cr(e)){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}oi(t,!0,n,null,i);break;case"together":oi(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ai(e,t){0==(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function si(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),fa|=t.lanes,0==(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(i(153));if(null!==t.child){for(n=cs(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=cs(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function li(e){e.flags|=4}function ui(e,t){if(null!==e&&e.child===t.child)return!0;if(0!=(16&t.flags))return!1;for(e=t.child;null!==e;){if(0!=(12854&e.flags)||0!=(12854&e.subtreeFlags))return!1;e=e.sibling}return!0}if(Y)Zo=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)j(e,n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Xo=function(){},$o=function(e,t,n,r,o){if((e=e.memoizedProps)!==r){var i=t.stateNode,a=yr(vr.current);n=F(i,n,e,r,o,a),(t.updateQueue=n)&&li(t)}},Ko=function(e,t,n,r){n!==r&&li(t)};else if(Z){Zo=function(e,t,n,r){for(var o=t.child;null!==o;){if(5===o.tag){var i=o.stateNode;n&&r&&(i=Ae(i,o.type,o.memoizedProps,o)),j(e,i)}else if(6===o.tag)i=o.stateNode,n&&r&&(i=Me(i,o.memoizedProps,o)),j(e,i);else if(4!==o.tag)if(22===o.tag&&null!==o.memoizedState)null!==(i=o.child)&&(i.return=o),Zo(e,o,!0,!0);else if(null!==o.child){o.child.return=o,o=o.child;continue}if(o===t)break;for(;null===o.sibling;){if(null===o.return||o.return===t)return;o=o.return}o.sibling.return=o.return,o=o.sibling}};var ci=function e(t,n,r,o){for(var i=n.child;null!==i;){if(5===i.tag){var a=i.stateNode;r&&o&&(a=Ae(a,i.type,i.memoizedProps,i)),Pe(t,a)}else if(6===i.tag)a=i.stateNode,r&&o&&(a=Me(a,i.memoizedProps,i)),Pe(t,a);else if(4!==i.tag)if(22===i.tag&&null!==i.memoizedState)null!==(a=i.child)&&(a.return=i),e(t,i,!0,!0);else if(null!==i.child){i.child.return=i,i=i.child;continue}if(i===n)break;for(;null===i.sibling;){if(null===i.return||i.return===n)return;i=i.return}i.sibling.return=i.return,i=i.sibling}};Xo=function(e,t){var n=t.stateNode;if(!ui(e,t)){e=n.containerInfo;var r=Ee(e);ci(r,t,!1,!1),n.pendingChildren=r,li(t),Le(e,r)}},$o=function(e,t,n,r,o){var i=e.stateNode,a=e.memoizedProps;if((e=ui(e,t))&&a===r)t.stateNode=i;else{var s=t.stateNode,l=yr(vr.current),u=null;a!==r&&(u=F(s,n,a,r,o,l)),e&&null===u?t.stateNode=i:(i=_e(i,u,n,a,r,t,e,s),B(i,n,r,o,l)&&li(t),t.stateNode=i,e?li(t):Zo(i,t,!1,!1))}},Ko=function(e,t,n,r){n!==r?(e=yr(mr.current),n=yr(vr.current),t.stateNode=V(r,e,n,t),li(t)):t.stateNode=e.stateNode}}else Xo=function(){},$o=function(){},Ko=function(){};function di(e,t){if(!pn)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function fi(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=14680064&o.subtreeFlags,r|=14680064&o.flags,o.return=e,o=o.sibling;else for(o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function hi(e,t,n){var r=t.pendingProps;switch(dn(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return fi(t),null;case 1:case 17:return pt(t.type)&&vt(),fi(t),null;case 3:return n=t.stateNode,wr(),st(dt),st(ct),Er(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||(Sn(t)?li(t):null===e||e.memoizedState.isDehydrated&&0==(256&t.flags)||(t.flags|=1024,null!==gn&&(ja(gn),gn=null))),Xo(e,t),fi(t),null;case 5:xr(t),n=yr(mr.current);var o=t.type;if(null!==e&&null!=t.stateNode)$o(e,t,o,r,n),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(null===t.stateNode)throw Error(i(166));return fi(t),null}if(e=yr(vr.current),Sn(t)){if(!X)throw Error(i(175));e=We(t.stateNode,t.type,t.memoizedProps,n,e,t,!vn),t.updateQueue=e,null!==e&&li(t)}else{var a=z(o,r,n,e,t);Zo(a,t,!1,!1),t.stateNode=a,B(a,o,r,n,e)&&li(t)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return fi(t),null;case 6:if(e&&null!=t.stateNode)Ko(e,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(i(166));if(e=yr(mr.current),n=yr(vr.current),Sn(t)){if(!X)throw Error(i(176));if(e=t.stateNode,n=t.memoizedProps,(r=Ue(e,n,t,!vn))&&null!==(o=fn))switch(o.tag){case 3:Qe(o.stateNode.containerInfo,e,n,0!=(1&o.mode));break;case 5:Je(o.type,o.memoizedProps,o.stateNode,e,n,0!=(1&o.mode))}r&&li(t)}else t.stateNode=V(r,e,n,t)}return fi(t),null;case 13:if(st(Sr),r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(pn&&null!==hn&&0!=(1&t.mode)&&0==(128&t.flags))Cn(),_n(),t.flags|=98560,o=!1;else if(o=Sn(t),null!==r&&null!==r.dehydrated){if(null===e){if(!o)throw Error(i(318));if(!X)throw Error(i(344));if(!(o=null!==(o=t.memoizedState)?o.dehydrated:null))throw Error(i(317));Ge(o,t)}else _n(),0==(128&t.flags)&&(t.memoizedState=null),t.flags|=4;fi(t),o=!1}else null!==gn&&(ja(gn),gn=null),o=!0;if(!o)return 65536&t.flags?t:null}return 0!=(128&t.flags)?(t.lanes=n,t):((n=null!==r)!==(null!==e&&null!==e.memoizedState)&&n&&(t.child.flags|=8192,0!=(1&t.mode)&&(null===e||0!=(1&Sr.current)?0===ca&&(ca=3):qa())),null!==t.updateQueue&&(t.flags|=4),fi(t),null);case 4:return wr(),Xo(e,t),null===e&&K(t.stateNode.containerInfo),fi(t),null;case 10:return zn(t.type._context),fi(t),null;case 19:if(st(Sr),null===(o=t.memoizedState))return fi(t),null;if(r=0!=(128&t.flags),null===(a=o.rendering))if(r)di(o,!1);else{if(0!==ca||null!==e&&0!=(128&e.flags))for(e=t.child;null!==e;){if(null!==(a=Cr(e))){for(t.flags|=128,di(o,!1),null!==(e=a.updateQueue)&&(t.updateQueue=e,t.flags|=4),t.subtreeFlags=0,e=n,n=t.child;null!==n;)o=e,(r=n).flags&=14680066,null===(a=r.alternate)?(r.childLanes=0,r.lanes=o,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=a.childLanes,r.lanes=a.lanes,r.child=a.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=a.memoizedProps,r.memoizedState=a.memoizedState,r.updateQueue=a.updateQueue,r.type=a.type,o=a.dependencies,r.dependencies=null===o?null:{lanes:o.lanes,firstContext:o.firstContext}),n=n.sibling;return lt(Sr,1&Sr.current|2),t.child}e=e.sibling}null!==o.tail&&Bt()>ya&&(t.flags|=128,r=!0,di(o,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=Cr(a))){if(t.flags|=128,r=!0,null!==(e=e.updateQueue)&&(t.updateQueue=e,t.flags|=4),di(o,!0),null===o.tail&&"hidden"===o.tailMode&&!a.alternate&&!pn)return fi(t),null}else 2*Bt()-o.renderingStartTime>ya&&1073741824!==n&&(t.flags|=128,r=!0,di(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(null!==(e=o.last)?e.sibling=a:t.child=a,o.last=a)}return null!==o.tail?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Bt(),t.sibling=null,e=Sr.current,lt(Sr,r?1&e|2:1&e),t):(fi(t),null);case 22:case 23:return Va(),n=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==n&&(t.flags|=8192),n&&0!=(1&t.mode)?0!=(1073741824&la)&&(fi(t),Y&&6&t.subtreeFlags&&(t.flags|=8192)):fi(t),null;case 24:case 25:return null}throw Error(i(156,t.tag))}function pi(e,t){switch(dn(t),t.tag){case 1:return pt(t.type)&&vt(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return wr(),st(dt),st(ct),Er(),0!=(65536&(e=t.flags))&&0==(128&e)?(t.flags=-65537&e|128,t):null;case 5:return xr(t),null;case 13:if(st(Sr),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(i(340));_n()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return st(Sr),null;case 4:return wr(),null;case 10:return zn(t.type._context),null;case 22:case 23:return Va(),null;default:return null}}var vi=!1,gi=!1,mi="function"==typeof WeakSet?WeakSet:Set,yi=null;function bi(e,t){var n=e.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(Kke){ts(e,t,Kke)}else n.current=null}function wi(e,t,n){try{n()}catch(Kke){ts(e,t,Kke)}}var ki=!1;function xi(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,void 0!==i&&wi(t,n,i)}o=o.next}while(o!==r)}}function Si(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Ci(e){var t=e.ref;if(null!==t){var n=e.stateNode;if(5===e.tag)e=T(n);else e=n;"function"==typeof t?t(e):t.current=e}}function _i(e){var t=e.alternate;null!==t&&(e.alternate=null,_i(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&J(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Ei(e){return 5===e.tag||3===e.tag||4===e.tag}function Pi(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||Ei(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function Li(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?ge(n,e,t):de(n,e);else if(4!==r&&null!==(e=e.child))for(Li(e,t,n),e=e.sibling;null!==e;)Li(e,t,n),e=e.sibling}function Oi(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?ve(n,e,t):ce(n,e);else if(4!==r&&null!==(e=e.child))for(Oi(e,t,n),e=e.sibling;null!==e;)Oi(e,t,n),e=e.sibling}var Ai=null,Mi=!1;function Ti(e,t,n){for(n=n.child;null!==n;)Ii(e,t,n),n=n.sibling}function Ii(e,t,n){if(Gt&&"function"==typeof Gt.onCommitFiberUnmount)try{Gt.onCommitFiberUnmount(Ut,n)}catch(Qke){}switch(n.tag){case 5:gi||bi(n,t);case 6:if(Y){var r=Ai,o=Mi;Ai=null,Ti(e,t,n),Mi=o,null!==(Ai=r)&&(Mi?ye(Ai,n.stateNode):me(Ai,n.stateNode))}else Ti(e,t,n);break;case 18:Y&&null!==Ai&&(Mi?$e(Ai,n.stateNode):Xe(Ai,n.stateNode));break;case 4:Y?(r=Ai,o=Mi,Ai=n.stateNode.containerInfo,Mi=!0,Ti(e,t,n),Ai=r,Mi=o):(Z&&(r=n.stateNode.containerInfo,o=Ee(r),Oe(r,o)),Ti(e,t,n));break;case 0:case 11:case 14:case 15:if(!gi&&(null!==(r=n.updateQueue)&&null!==(r=r.lastEffect))){o=r=r.next;do{var i=o,a=i.destroy;i=i.tag,void 0!==a&&(0!=(2&i)||0!=(4&i))&&wi(n,t,a),o=o.next}while(o!==r)}Ti(e,t,n);break;case 1:if(!gi&&(bi(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(Qke){ts(n,t,Qke)}Ti(e,t,n);break;case 21:Ti(e,t,n);break;case 22:1&n.mode?(gi=(r=gi)||null!==n.memoizedState,Ti(e,t,n),gi=r):Ti(e,t,n);break;default:Ti(e,t,n)}}function Ri(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new mi),t.forEach((function(t){var r=is.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function Ni(e,t){var n=t.deletions;if(null!==n)for(var r=0;r";case Ui:return":has("+(Ki(e)||"")+")";case Gi:return'[role="'+e.value+'"]';case Yi:return'"'+e.value+'"';case qi:return'[data-testname="'+e.value+'"]';default:throw Error(i(365))}}function Qi(e,t){var n=[];e=[e,0];for(var r=0;ro&&(o=s),r&=~a}if(r=o,10<(r=(120>(r=Bt()-r)?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*ea(r/1960))-r)){e.timeoutHandle=W(Qa.bind(null,e,ga,ba),r);break}Qa(e,ga,ba);break;default:throw Error(i(329))}}}return Na(e,Bt()),e.callbackNode===n?Da.bind(null,e):null}function za(e,t){var n=va;return e.current.memoizedState.isDehydrated&&(Wa(e,t).flags|=256),2!==(e=Ya(e,t))&&(t=ga,ga=n,null!==t&&ja(t)),e}function ja(e){null===ga?ga=e:ga.push.apply(ga,e)}function Ba(e,t){for(t&=~pa,t&=~ha,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0e?16:e,null===Ea)var r=!1;else{if(e=Ea,Ea=null,Pa=0,0!=(6&oa))throw Error(i(331));var o=oa;for(oa|=4,yi=e.current;null!==yi;){var a=yi,s=a.child;if(0!=(16&yi.flags)){var l=a.deletions;if(null!==l){for(var u=0;uBt()-ma?Wa(e,0):pa|=n),Na(e,t)}function rs(e,t){0===t&&(0==(1&e.mode)?t=1:(t=Ct,0==(130023424&(Ct<<=1))&&(Ct=4194304)));var n=Ta();null!==(e=Un(e,t))&&(Mt(e,t,n),Na(e,n))}function os(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),rs(e,n)}function is(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;null!==o&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(i(314))}null!==r&&r.delete(t),rs(e,n)}function as(e,t){return Nt(e,t)}function ss(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ls(e,t,n,r){return new ss(e,t,n,r)}function us(e){return!(!(e=e.prototype)||!e.isReactComponent)}function cs(e,t){var n=e.alternate;return null===n?((n=ls(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ds(e,t,n,r,o,a){var s=2;if(r=e,"function"==typeof e)us(e)&&(s=1);else if("string"==typeof e)s=5;else e:switch(e){case u:return fs(n.children,o,a,t);case c:s=8,o|=8;break;case d:return(e=ls(12,n,t,2|o)).elementType=d,e.lanes=a,e;case v:return(e=ls(13,n,t,o)).elementType=v,e.lanes=a,e;case g:return(e=ls(19,n,t,o)).elementType=g,e.lanes=a,e;case b:return hs(n,o,a,t);default:if("object"===kn(e)&&null!==e)switch(e.$$typeof){case f:s=10;break e;case h:s=9;break e;case p:s=11;break e;case m:s=14;break e;case y:s=16,r=null;break e}throw Error(i(130,null==e?e:kn(e),""))}return(t=ls(s,n,t,o)).elementType=e,t.type=r,t.lanes=a,t}function fs(e,t,n,r){return(e=ls(7,e,r,t)).lanes=n,e}function hs(e,t,n,r){return(e=ls(22,e,r,t)).elementType=b,e.lanes=n,e.stateNode={isHidden:!1},e}function ps(e,t,n){return(e=ls(6,e,null,t)).lanes=n,e}function vs(e,t,n){return(t=ls(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function gs(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=G,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=At(0),this.expirationTimes=At(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=At(0),this.identifierPrefix=r,this.onRecoverableError=o,X&&(this.mutableSourceEagerHydrationData=null)}function ms(e,t,n,r,o,i,a,s,l){return e=new gs(e,t,n,s,l),1===t?(t=1,!0===i&&(t|=8)):t=0,i=ls(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},qn(i),e}function ys(e){if(!e)return ut;e:{if(C(e=e._reactInternals)!==e||1!==e.tag)throw Error(i(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(pt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(i(171))}if(1===e.tag){var n=e.type;if(pt(n))return mt(e,n,t)}return t}function bs(e){var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(i(188));throw e=Object.keys(e).join(","),Error(i(268,e))}return null===(e=P(t))?null:e.stateNode}function ws(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n=c&&a>=f&&o<=d&&s<=h){e.splice(t,1);break}if(!(r!==c||n.width!==u.width||hs)){f>a&&(u.height+=f-a,u.y=a),ho)){c>r&&(u.width+=c-r,u.x=r),dn&&(n=s)),s ")+"\n\nNo matching component was found for:\n "+e.join(" > ")}return null},t.getPublicRootInstance=function(e){return(e=e.current).child?5===e.child.tag?T(e.child.stateNode):e.child.stateNode:null},t.injectIntoDevTools=function(e){if(e={bundleType:e.bundleType,version:e.version,rendererPackageName:e.rendererPackageName,rendererConfig:e.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:a.ReactCurrentDispatcher,findHostInstanceByFiber:xs,findFiberByHostInstance:e.findFiberByHostInstance||Ss,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},"undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)e=!1;else{var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)e=!0;else{try{Ut=t.inject(e),Gt=t}catch(qke){}e=!!t.checkDCE}}return e},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(e,t,n,r){if(!ne)throw Error(i(363));e=Ji(e,t);var o=ue(e,n,r).disconnect;return{disconnect:function(){o()}}},t.registerMutableSourceForHydration=function(e,t){var n=t._getVersion;n=n(t._source),null==e.mutableSourceEagerHydrationData?e.mutableSourceEagerHydrationData=[t,n]:e.mutableSourceEagerHydrationData.push(t,n)},t.runWithPriority=function(e,t){var n=It;try{return It=e,t()}finally{It=n}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(e,t,n,r){var o=t.current,i=Ta(),a=Ia(o);return n=ys(n),null===t.context?t.context=n:t.pendingContext=n,(t=Zn(i,a)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=Xn(o,t,a))&&(Ra(e,o,a,i),$n(e,o,a)),a},t};!function(e){e.exports=sbe}(abe);var lbe=ar(ibe),ube={},cbe={get exports(){return ube},set exports(e){ube=e}},dbe={ -/** - * @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. - */ -ConcurrentRoot:1,ContinuousEventPriority:4,DefaultEventPriority:16,DiscreteEventPriority:1,IdleEventPriority:536870912,LegacyRoot:0};!function(e){e.exports=dbe}(cbe);var fbe={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0},hbe=!1,pbe=!1,vbe=".react-konva-event",gbe="ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.\nPosition of a node will be changed during drag&drop, so you should update state of the react app as well.\nConsider to add onDragMove or onDragEnd events.\nFor more info see: https://github.com/konvajs/react-konva/issues/256\n",mbe='ReactKonva: You are using "zIndex" attribute for a Konva node.\nreact-konva may get confused with ordering. Just define correct order of elements in your render function of a component.\nFor more info see: https://github.com/konvajs/react-konva/issues/194\n',ybe={};function bbe(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ybe;if(!hbe&&"zIndex"in t&&(console.warn(mbe),hbe=!0),!pbe&&t.draggable){var r=void 0!==t.x||void 0!==t.y,o=t.onDragEnd||t.onDragMove;r&&!o&&(console.warn(gbe),pbe=!0)}for(var i in n)if(!fbe[i]){var a="on"===i.slice(0,2),s=n[i]!==t[i];if(a&&s)"content"===(p=i.substr(2).toLowerCase()).substr(0,7)&&(p="content"+p.substr(7,1).toUpperCase()+p.substr(8)),e.off(p,n[i]);var l=!t.hasOwnProperty(i);l&&e.setAttr(i,void 0)}var u=t._useStrictMode,c={},d=!1,f={};for(var i in t)if(!fbe[i]){a="on"===i.slice(0,2);var h=n[i]!==t[i];if(a&&h)"content"===(p=i.substr(2).toLowerCase()).substr(0,7)&&(p="content"+p.substr(7,1).toUpperCase()+p.substr(8)),t[i]&&(f[p]=t[i]);!a&&(t[i]!==n[i]||u&&t[i]!==e.getAttr(i))&&(d=!0,c[i]=t[i])}for(var p in d&&(e.setAttrs(c),wbe(e)),f)e.on(p+vbe,f[p])}function wbe(e){if(!Ste.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}var kbe={},xbe={};kre.Node.prototype._applyProps=bbe;var Sbe=setTimeout,Cbe=clearTimeout;function _be(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),wbe(e)}var Ebe=Object.freeze(Object.defineProperty({__proto__:null,appendChild:function(e,t){t.parent===e?t.moveToTop():e.add(t),wbe(e)},appendChildToContainer:function(e,t){t.parent===e?t.moveToTop():e.add(t),wbe(e)},appendInitialChild:function(e,t){"string"!=typeof t?(e.add(t),wbe(e)):console.error("Do not use plain text as child of Konva.Node. You are using text: ".concat(t))},cancelTimeout:Cbe,clearContainer:function(e){},commitMount:function(e,t,n){},commitTextUpdate:function(e,t,n){console.error('Text components are not yet supported in ReactKonva. You text is: "'.concat(n,'"'))},commitUpdate:function(e,t,n,r,o){bbe(e,o,r)},createInstance:function(e,t,n){var r=kre[e];r||(console.error("Konva has no node with the type ".concat(e,'. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/').concat(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=kre.Group);var o={},i={};for(var a in t){"on"===a.slice(0,2)?i[a]=t[a]:o[a]=t[a]}var s=new r(o);return bbe(s,i),s},createTextInstance:function(e,t,n){console.error('Text components are not supported for now in ReactKonva. Your text is: "'.concat(e,'"'))},detachDeletedInstance:function(){},finalizeInitialChildren:function(e,t,n){return!1},getChildHostContext:function(){return kbe},getCurrentEventPriority:function(){return ube.DefaultEventPriority},getPublicInstance:function(e){return e},getRootHostContext:function(){return kbe},hideInstance:function(e){e.hide(),wbe(e)},hideTextInstance:function(e){},idlePriority:tA.unstable_IdlePriority,insertBefore:_be,insertInContainerBefore:function(e,t,n){_be(e,t,n)},isPrimaryRenderer:!1,noTimeout:-1,now:tA.unstable_now,prepareForCommit:function(){return null},preparePortalMount:function(){return null},prepareUpdate:function(e,t,n,r){return xbe},removeChild:function(e,t){t.destroy(),t.off(vbe),wbe(e)},removeChildFromContainer:function(e,t){t.destroy(),t.off(vbe),wbe(e)},resetAfterCommit:function(){},resetTextContent:function(e){},run:tA.unstable_runWithPriority,scheduleTimeout:Sbe,shouldDeprioritizeSubtree:function(e,t){return!1},shouldSetTextContent:function(e,t){return!1},supportsMutation:!0,unhideInstance:function(e,t){(null==t.visible||t.visible)&&e.show()},unhideTextInstance:function(e,t){},warnsIfNotActing:!0},Symbol.toStringTag,{value:"Module"})),Pbe=Object.defineProperty,Lbe=Object.defineProperties,Obe=Object.getOwnPropertyDescriptors,Abe=Object.getOwnPropertySymbols,Mbe=Object.prototype.hasOwnProperty,Tbe=Object.prototype.propertyIsEnumerable,Ibe=function(e,t,n){return t in e?Pbe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Rbe=function(e,t){for(var n in t||(t={}))Mbe.call(t,n)&&Ibe(e,n,t[n]);if(Abe){var r,o=xn(Abe(t));try{for(o.s();!(r=o.n()).done;){n=r.value;Tbe.call(t,n)&&Ibe(e,n,t[n])}}catch(COe){o.e(COe)}finally{o.f()}}return e};function Nbe(e,t,n){if(e){if(!0===n(e))return e;for(var r=t?e.return:e.child;r;){var o=Nbe(r,t,n);if(o)return o;r=t?null:r.sibling}}}function Dbe(e){try{return Object.defineProperties(e,{_currentRenderer:{get:function(){return null},set:function(){}},_currentRenderer2:{get:function(){return null},set:function(){}}})}catch(bce){return e}}var zbe=Dbe(cr.createContext(null)),jbe=function(e){pn(n,e);var t=Qt(n);function n(){return an(this,n),t.apply(this,arguments)}return on(n,[{key:"render",value:function(){return cr.createElement(zbe.Provider,{value:this._reactInternals},this.props.children)}}]),n}(cr.Component),Bbe=cr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Fbe=Bbe.ReactCurrentOwner,Hbe=Bbe.ReactCurrentDispatcher;var Vbe=[],Wbe=new WeakMap;function Ube(){var e,t=function(){var e=cr.useContext(zbe);if(!e)throw new Error("its-fine: useFiber must be called within a !");var t=cr.useId(),n=cr.useMemo((function(){var n;return null!=(n=Fbe.current)?n:Nbe(e,!1,(function(e){for(var n=e.memoizedState;n;){if(n.memoizedState===t)return!0;n=n.next}}))}),[e,t]);return n}();Vbe.splice(0,Vbe.length),Nbe(t,!0,(function(e){var t,n=null==(t=e.type)?void 0:t._context;n&&n!==zbe&&Vbe.push(Dbe(n))}));for(var n=0,r=Vbe;n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n'.replaceAll("black",e)},jwe=function(e){var t=Object.assign({},(Kt(e),e)),n=kie(Dwe),r=n.maskColorString,o=n.stageCoordinates,i=n.stageDimensions,a=n.stageScale,s=yn(cr.useState(null),2),l=s[0],u=s[1],c=yn(cr.useState(0),2),d=c[0],f=c[1],h=cr.useRef(null),p=cr.useCallback((function(){f(d+1),setTimeout(p,500)}),[d]);return cr.useEffect((function(){if(!l){var e=new Image;e.onload=function(){u(e)},e.src=zwe(r)}}),[l,r]),cr.useEffect((function(){l&&(l.src=zwe(r))}),[l,r]),cr.useEffect((function(){var e=setInterval((function(){return f((function(e){return(e+1)%5}))}),50);return function(){return clearInterval(e)}}),[]),l&&Nwe(o.x)&&Nwe(o.y)&&Nwe(a)&&Nwe(i.width)&&Nwe(i.height)?no(Zbe,un({ref:h,offsetX:o.x/a,offsetY:o.y/a,height:i.height/a,width:i.width/a,fillPatternImage:l,fillPatternOffsetY:Nwe(d)?d:0,fillPatternRepeat:"repeat",fillPatternScale:{x:1/a,y:1/a},listening:!0,globalCompositeOperation:"source-in"},t)):null},Bwe=QX([Lde],(function(e){return{objects:e.layerState.objects}}),{memoizeOptions:{resultEqualityCheck:dae}}),Fwe=function(e){var t=Object.assign({},(Kt(e),e)),n=kie(Bwe).objects;return no(Ybe,un(un({listening:!1},t),{},{children:n.filter(j5).map((function(e,t){return no($be,{points:e.points,stroke:"rgb(0,0,0)",strokeWidth:2*e.strokeWidth,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:"brush"===e.tool?"source-over":"destination-out"},t)}))}))},Hwe=cr,Vwe=function(e){var t=e.url,n=e.x,r=e.y,o=function(e,t,n){var r=Hwe.useRef("loading"),o=Hwe.useRef(),i=yn(Hwe.useState(0),2),a=(i[0],i[1]),s=Hwe.useRef(),l=Hwe.useRef(),u=Hwe.useRef();return s.current===e&&l.current===t&&u.current===n||(r.current="loading",o.current=void 0,s.current=e,l.current=t,u.current=n),Hwe.useLayoutEffect((function(){if(e){var i=document.createElement("img");return i.addEventListener("load",s),i.addEventListener("error",l),t&&(i.crossOrigin=t),n&&(i.referrerpolicy=n),i.src=e,function(){i.removeEventListener("load",s),i.removeEventListener("error",l)}}function s(){r.current="loaded",o.current=i,a(Math.random())}function l(){r.current="failed",o.current=void 0,a(Math.random())}}),[e,t,n]),[o.current,r.current]}(t),i=yn(o,1)[0];return no(Kbe,{x:n,y:r,image:i,listening:!1})},Wwe=QX([Lde],(function(e){return{objects:e.layerState.objects}}),{memoizeOptions:{resultEqualityCheck:dae}}),Uwe=function(){var e=kie(Wwe).objects;return e?no(Ybe,{name:"outpainting-objects",listening:!1,children:e.map((function(e,t){if(B5(e))return no(Vwe,{x:e.x,y:e.y,url:e.image.url},t);if(function(e){return"line"===e.kind&&"base"===e.layer}(e)){var n=no($be,{points:e.points,stroke:e.color?Twe(e.color):"rgb(0,0,0)",strokeWidth:2*e.strokeWidth,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:"brush"===e.tool?"source-over":"destination-out"},t);return e.clip?no(Ybe,{clipX:e.clip.x,clipY:e.clip.y,clipWidth:e.clip.width,clipHeight:e.clip.height,children:n},t):n}return function(e){return"fillRect"===e.kind&&"base"===e.layer}(e)?no(Zbe,{x:e.x,y:e.y,width:e.width,height:e.height,fill:Twe(e.color)},t):function(e){return"eraseRect"===e.kind&&"base"===e.layer}(e)?no(Zbe,{x:e.x,y:e.y,width:e.width,height:e.height,fill:"rgb(255, 255, 255)",globalCompositeOperation:"destination-out"},t):void 0}))}):null},Gwe=QX([Lde],(function(e){var t=e.layerState.stagingArea,n=t.images,r=t.selectedImageIndex,o=e.shouldShowStagingImage,i=e.shouldShowStagingOutline,a=e.boundingBoxCoordinates,s=a.x,l=a.y,u=e.boundingBoxDimensions,c=u.width,d=u.height;return{currentStagingAreaImage:n.length>0?n[r]:void 0,isOnFirstImage:0===r,isOnLastImage:r===n.length-1,shouldShowStagingImage:o,shouldShowStagingOutline:i,x:s,y:l,width:c,height:d}}),{memoizeOptions:{resultEqualityCheck:dae}}),qwe=function(e){var t=Object.assign({},(Kt(e),e)),n=kie(Gwe),r=n.currentStagingAreaImage,o=n.shouldShowStagingImage,i=n.shouldShowStagingOutline,a=n.x,s=n.y,l=n.width,u=n.height;return ro(Ybe,un(un({},t),{},{children:[o&&r&&no(Vwe,{url:r.image.url,x:a,y:s}),i&&ro(Ybe,{children:[no(Zbe,{x:a,y:s,width:l,height:u,strokeWidth:1,stroke:"white",strokeScaleEnabled:!1}),no(Zbe,{x:a,y:s,width:l,height:u,dash:[4,4],strokeWidth:1,stroke:"black",strokeScaleEnabled:!1})]})]}))},Ywe=QX([Lde],(function(e){var t=e.layerState.stagingArea,n=t.images,r=t.selectedImageIndex,o=e.shouldShowStagingOutline,i=e.shouldShowStagingImage;return{currentStagingAreaImage:n.length>0?n[r]:void 0,isOnFirstImage:0===r,isOnLastImage:r===n.length-1,shouldShowStagingImage:i,shouldShowStagingOutline:o}}),{memoizeOptions:{resultEqualityCheck:dae}}),Zwe=function(){var e=wie(),t=kie(Ywe),n=t.isOnFirstImage,r=t.isOnLastImage,o=t.currentStagingAreaImage,i=t.shouldShowStagingImage,a=o8().t,s=cr.useCallback((function(){e(z3(!0))}),[e]),l=cr.useCallback((function(){e(z3(!1))}),[e]);_ce(["left"],(function(){u()}),{enabled:function(){return!0},preventDefault:!0}),_ce(["right"],(function(){c()}),{enabled:function(){return!0},preventDefault:!0}),_ce(["enter"],(function(){d()}),{enabled:function(){return!0},preventDefault:!0});var u=function(){return e(n3())},c=function(){return e(t3())},d=function(){return e(Q5())};return o?no(yP,{pos:"absolute",bottom:"1rem",w:"100%",align:"center",justify:"center",filter:"drop-shadow(0 0.5rem 1rem rgba(0,0,0))",onMouseOver:s,onMouseOut:l,children:ro(k_,{isAttached:!0,children:[no(_ae,{tooltip:"".concat(a("unifiedcanvas:previous")," (Left)"),"aria-label":"".concat(a("unifiedcanvas:previous")," (Left)"),icon:no(Bce,{}),onClick:u,"data-selected":!0,isDisabled:n}),no(_ae,{tooltip:"".concat(a("unifiedcanvas:next")," (Right)"),"aria-label":"".concat(a("unifiedcanvas:next")," (Right)"),icon:no(Fce,{}),onClick:c,"data-selected":!0,isDisabled:r}),no(_ae,{tooltip:"".concat(a("unifiedcanvas:accept")," (Enter)"),"aria-label":"".concat(a("unifiedcanvas:accept")," (Enter)"),icon:no(Uce,{}),onClick:d,"data-selected":!0}),no(_ae,{tooltip:a("unifiedcanvas:showHide"),"aria-label":a("unifiedcanvas:showHide"),"data-alert":!i,icon:no(i?tde:ede,{}),onClick:function(){return e(D3(!i))},"data-selected":!0}),no(_ae,{tooltip:a("unifiedcanvas:saveToGallery"),"aria-label":a("unifiedcanvas:saveToGallery"),icon:no(mde,{}),onClick:function(){return e(uie(o.image.url))},"data-selected":!0}),no(_ae,{tooltip:a("unifiedcanvas:discardAll"),"aria-label":a("unifiedcanvas:discardAll"),icon:no(hde,{style:{transform:"rotate(45deg)"}}),onClick:function(){return e(J5())},"data-selected":!0,style:{backgroundColor:"var(--btn-delete-image)"},fontSize:20})]})}):null},Xwe=function(e){return Math.round(100*e)/100},$we=QX([Lde],(function(e){var t=e.cursorPosition,n=t?{cursorX:t.x,cursorY:t.y}:{cursorX:-1,cursorY:-1},r=n.cursorY;return{cursorCoordinatesString:"(".concat(Xwe(n.cursorX),", ").concat(Xwe(r),")")}}),{memoizeOptions:{resultEqualityCheck:dae}});function Kwe(){var e=kie($we).cursorCoordinatesString,t=o8().t;return no("div",{children:"".concat(t("unifiedcanvas:cursorPosition"),": ").concat(e)})}var Qwe=QX([Lde],(function(e){var t=e.stageDimensions,n=t.width,r=t.height,o=e.stageCoordinates,i=o.x,a=o.y,s=e.boundingBoxDimensions,l=s.width,u=s.height,c=e.scaledBoundingBoxDimensions,d=c.width,f=c.height,h=e.boundingBoxCoordinates,p=h.x,v=h.y,g=e.stageScale,m=e.shouldShowCanvasDebugInfo,y=e.layer,b=e.boundingBoxScaleMethod,w="inherit";return("none"===b&&(l<512||u<512)||"manual"===b&&d*f<262144)&&(w="var(--status-working-color)"),{activeLayerColor:"mask"===y?"var(--status-working-color)":"inherit",activeLayerString:y.charAt(0).toUpperCase()+y.slice(1),boundingBoxColor:w,boundingBoxCoordinatesString:"(".concat(Xwe(p),", ").concat(Xwe(v),")"),boundingBoxDimensionsString:"".concat(l,"×").concat(u),scaledBoundingBoxDimensionsString:"".concat(d,"×").concat(f),canvasCoordinatesString:"".concat(Xwe(i),"×").concat(Xwe(a)),canvasDimensionsString:"".concat(n,"×").concat(r),canvasScaleString:Math.round(100*g),shouldShowCanvasDebugInfo:m,shouldShowBoundingBox:"auto"!==b,shouldShowScaledBoundingBox:"none"!==b}}),{memoizeOptions:{resultEqualityCheck:dae}}),Jwe=function(){var e=kie(Qwe),t=e.activeLayerColor,n=e.activeLayerString,r=e.boundingBoxColor,o=e.boundingBoxCoordinatesString,i=e.boundingBoxDimensionsString,a=e.scaledBoundingBoxDimensionsString,s=e.shouldShowScaledBoundingBox,l=e.canvasCoordinatesString,u=e.canvasDimensionsString,c=e.canvasScaleString,d=e.shouldShowCanvasDebugInfo,f=e.shouldShowBoundingBox,h=o8().t;return ro("div",{className:"canvas-status-text",children:[no("div",{style:{color:t},children:"".concat(h("unifiedcanvas:activeLayer"),": ").concat(n)}),no("div",{children:"".concat(h("unifiedcanvas:canvasScale"),": ").concat(c,"%")}),f&&no("div",{style:{color:r},children:"".concat(h("unifiedcanvas:boundingBox"),": ").concat(i)}),s&&no("div",{style:{color:r},children:"".concat(h("unifiedcanvas:scaledBoundingBox"),": ").concat(a)}),d&&ro(to,{children:[no("div",{children:"".concat(h("unifiedcanvas:boundingBoxPosition"),": ").concat(o)}),no("div",{children:"".concat(h("unifiedcanvas:canvasDimensions"),": ").concat(u)}),no("div",{children:"".concat(h("unifiedcanvas:canvasPosition"),": ").concat(l)}),no(Kwe,{})]})]})},eke=QX(Lde,(function(e){var t=e.boundingBoxCoordinates,n=e.boundingBoxDimensions,r=e.stageScale,o=e.isDrawing,i=e.isTransformingBoundingBox,a=e.isMovingBoundingBox,s=e.tool;return{boundingBoxCoordinates:t,boundingBoxDimensions:n,isDrawing:o,isMovingBoundingBox:a,isTransformingBoundingBox:i,stageScale:r,shouldSnapToGrid:e.shouldSnapToGrid,tool:s,hitStrokeWidth:20/r}}),{memoizeOptions:{resultEqualityCheck:dae}}),tke=function(e){var t=Object.assign({},(Kt(e),e)),n=wie(),r=kie(eke),o=r.boundingBoxCoordinates,i=r.boundingBoxDimensions,a=r.isDrawing,s=r.isMovingBoundingBox,l=r.isTransformingBoundingBox,u=r.stageScale,c=r.shouldSnapToGrid,d=r.tool,f=r.hitStrokeWidth,h=cr.useRef(null),p=cr.useRef(null),v=yn(cr.useState(!1),2),g=v[0],m=v[1];cr.useEffect((function(){var e;h.current&&p.current&&(h.current.nodes([p.current]),null===(e=h.current.getLayer())||void 0===e||e.batchDraw())}),[]);var y=64*u,b=cr.useCallback((function(e){if(c){var t=e.target.x(),r=e.target.y(),o=pK(t,64),i=pK(r,64);e.target.x(o),e.target.y(i),n(u3({x:o,y:i}))}else n(u3({x:Math.floor(e.target.x()),y:Math.floor(e.target.y())}))}),[n,c]),w=cr.useCallback((function(){if(p.current){var e=p.current,t=e.scaleX(),r=e.scaleY(),o=Math.round(e.width()*t),i=Math.round(e.height()*r),a=Math.round(e.x()),s=Math.round(e.y());n(c3({width:o,height:i})),n(u3({x:c?hK(a,64):a,y:c?hK(s,64):s})),e.scaleX(1),e.scaleY(1)}}),[n,c]),k=cr.useCallback((function(e,t,n){var r=e.x%y,o=e.y%y;return{x:hK(t.x,y)+r,y:hK(t.y,y)+o}}),[y]),x=function(){n(C3(!1)),n(x3(!1)),n(k3(!1)),m(!1)},S=function(){n(x3(!0))},C=function(){n(C3(!1)),n(x3(!1)),n(k3(!1)),m(!1)},_=function(){m(!0)},E=function(){n(k3(!0))},P=function(){n(k3(!1))};return ro(Ybe,un(un({},t),{},{children:[no(Zbe,{height:i.height,width:i.width,x:o.x,y:o.y,onMouseEnter:E,onMouseOver:E,onMouseLeave:P,onMouseOut:P}),no(Zbe,{draggable:!0,fillEnabled:!1,height:i.height,hitStrokeWidth:f,listening:!a&&"move"===d,onDragStart:S,onDragEnd:C,onDragMove:b,onMouseDown:S,onMouseOut:function(){!l&&!s&&m(!1)},onMouseOver:_,onMouseEnter:_,onMouseUp:C,onTransform:w,onTransformEnd:x,ref:p,stroke:g?"rgba(255,255,255,0.7)":"white",strokeWidth:(g?8:1)/u,width:i.width,x:o.x,y:o.y}),no("Transformer",{anchorCornerRadius:3,anchorDragBoundFunc:k,anchorFill:"rgba(212,216,234,1)",anchorSize:15,anchorStroke:"rgb(42,42,42)",borderDash:[4,4],borderEnabled:!0,borderStroke:"black",draggable:!1,enabledAnchors:"move"===d?void 0:[],flipEnabled:!1,ignoreStroke:!0,keepRatio:!1,listening:!a&&"move"===d,onDragStart:S,onDragEnd:C,onMouseDown:function(){n(C3(!0))},onMouseUp:x,onTransformEnd:x,ref:h,rotateEnabled:!1})]}))},nke=QX(Lde,(function(e){var t=e.cursorPosition,n=e.brushSize,r=e.colorPickerColor,o=e.maskColor,i=e.brushColor,a=e.tool,s=e.layer,l=e.shouldShowBrush,u=e.isMovingBoundingBox,c=e.isTransformingBoundingBox,d=e.stageScale,f=e.stageDimensions,h=e.boundingBoxCoordinates,p=e.boundingBoxDimensions,v=e.shouldRestrictStrokesToBox?{clipX:h.x,clipY:h.y,clipWidth:p.width,clipHeight:p.height}:{};return{cursorPosition:t,brushX:t?t.x:f.width/2,brushY:t?t.y:f.height/2,radius:n/2,colorPickerOuterRadius:30/d,colorPickerInnerRadius:21/d,maskColorString:Twe(un(un({},o),{},{a:.5})),brushColorString:Twe(i),colorPickerColorString:Twe(r),tool:a,layer:s,shouldShowBrush:l,shouldDrawBrushPreview:!(u||c||!t)&&l,strokeWidth:1.5/d,dotRadius:1.5/d,clip:v}}),{memoizeOptions:{resultEqualityCheck:dae}}),rke=function(e){var t=Object.assign({},(Kt(e),e)),n=kie(nke),r=n.brushX,o=n.brushY,i=n.radius,a=n.maskColorString,s=n.tool,l=n.layer,u=n.shouldDrawBrushPreview,c=n.dotRadius,d=n.strokeWidth,f=n.brushColorString,h=n.colorPickerColorString,p=n.colorPickerInnerRadius,v=n.colorPickerOuterRadius,g=n.clip;return u?ro(Ybe,un(un(un({listening:!1},g),t),{},{children:[ro(to,"colorPicker"===s?{children:[no(Xbe,{x:r,y:o,radius:v,stroke:f,strokeWidth:10,strokeScaleEnabled:!1}),no(Xbe,{x:r,y:o,radius:p,stroke:h,strokeWidth:10,strokeScaleEnabled:!1})]}:{children:[no(Xbe,{x:r,y:o,radius:i,fill:"mask"===l?a:f,globalCompositeOperation:"eraser"===s?"destination-out":"source-out"}),no(Xbe,{x:r,y:o,radius:i,stroke:"rgba(255,255,255,0.4)",strokeWidth:2*d,strokeEnabled:!0,listening:!1}),no(Xbe,{x:r,y:o,radius:i,stroke:"rgba(0,0,0,1)",strokeWidth:d,strokeEnabled:!0,listening:!1})]}),no(Xbe,{x:r,y:o,radius:2*c,fill:"rgba(255,255,255,0.4)",listening:!1}),no(Xbe,{x:r,y:o,radius:c,fill:"rgba(0,0,0,1)",listening:!1})]})):null},oke=QX([Lde,Ode],(function(e,t){var n=e.isMaskEnabled,r=e.stageScale,o=e.shouldShowBoundingBox,i=e.isTransformingBoundingBox,a=e.isMouseOverBoundingBox,s=e.isMovingBoundingBox,l=e.stageDimensions,u=e.stageCoordinates,c=e.tool,d=e.isMovingStage,f=e.shouldShowIntermediates,h=e.shouldShowGrid,p=e.shouldRestrictStrokesToBox,v="none";return"move"===c||t?v=d?"grabbing":"grab":i?v=void 0:p&&!a&&(v="default"),{isMaskEnabled:n,isModifyingBoundingBox:i||s,shouldShowBoundingBox:o,shouldShowGrid:h,stageCoordinates:u,stageCursor:v,stageDimensions:l,stageScale:r,tool:c,isStaging:t,shouldShowIntermediates:f}}),{memoizeOptions:{resultEqualityCheck:dae}}),ike=function(){var e=kie(oke),t=e.isMaskEnabled,n=e.isModifyingBoundingBox,r=e.shouldShowBoundingBox,o=e.shouldShowGrid,i=e.stageCoordinates,a=e.stageCursor,s=e.stageDimensions,l=e.stageScale,u=e.tool,c=e.isStaging,d=e.shouldShowIntermediates;nwe();var f,h=cr.useRef(null),p=cr.useRef(null),v=cr.useCallback((function(e){Poe=e,h.current=e}),[]),g=cr.useCallback((function(e){Eoe=e,p.current=e}),[]),m=cr.useRef({x:0,y:0}),y=cr.useRef(!1),b=function(e){var t=wie(),n=kie(lwe),r=n.isMoveStageKeyHeld,o=n.stageScale;return cr.useCallback((function(n){if(e.current&&!r){n.evt.preventDefault();var i=e.current.getPointerPosition();if(i){var a=(i.x-e.current.x())/o,s=(i.y-e.current.y())/o,l=n.evt.deltaY;n.evt.ctrlKey&&(l=-l);var u=JK(o*Math.pow(.999,l),.1,20),c={x:i.x-a*u,y:i.y-s*u};t(F3(u)),t(B3(c))}}}),[e,r,o,t])}(h),w=function(e){var t=wie(),n=kie(iwe),r=n.tool,o=n.isStaging,i=owe().commitColorUnderCursor;return cr.useCallback((function(n){if(e.current)if(e.current.container().focus(),"move"===r||o)t(S3(!0));else if("colorPicker"!==r){var a=rwe(e.current);a&&(n.evt.preventDefault(),t(b3(!0)),t(Y5([a.x,a.y])))}else i()}),[e,r,o,t,i])}(h),k=function(e,t){var n=wie(),r=kie(swe),o=r.tool,i=r.isDrawing,a=r.isStaging;return cr.useCallback((function(){if("move"===o||a)n(S3(!1));else{if(!t.current&&i&&e.current){var r=rwe(e.current);if(!r)return;n(Z5([r.x,r.y]))}else t.current=!1;n(b3(!1))}}),[t,n,i,a,e,o])}(h,y),x=function(e,t,n){var r=wie(),o=kie(awe),i=o.isDrawing,a=o.tool,s=o.isStaging,l=owe().updateColorUnderCursor;return cr.useCallback((function(){if(e.current){var o=rwe(e.current);o&&(r(g3(o)),n.current=o,"colorPicker"!==a?i&&"move"!==a&&!s&&(t.current=!0,r(Z5([o.x,o.y]))):l())}}),[t,r,i,s,n,e,a,l])}(h,y,m),S=(f=wie(),cr.useCallback((function(){f(e3())}),[f])),C=function(){var e=wie(),t=kie(ewe),n=t.tool,r=t.isStaging,o=t.isMovingBoundingBox;return{handleDragStart:cr.useCallback((function(){"move"!==n&&!r||o||e(S3(!0))}),[e,o,r,n]),handleDragMove:cr.useCallback((function(t){if(("move"===n||r)&&!o){var i={x:t.target.x(),y:t.target.y()};e(B3(i))}}),[e,o,r,n]),handleDragEnd:cr.useCallback((function(){"move"!==n&&!r||o||e(S3(!1))}),[e,o,r,n])}}(),_=C.handleDragStart,E=C.handleDragMove,P=C.handleDragEnd;return no("div",{className:"inpainting-canvas-container",children:ro("div",{className:"inpainting-canvas-wrapper",children:[ro(Jbe,{tabIndex:-1,ref:v,className:"inpainting-canvas-stage",style:un({},a?{cursor:a}:{}),x:i.x,y:i.y,width:s.width,height:s.height,scale:{x:l,y:l},onTouchStart:w,onTouchMove:x,onTouchEnd:k,onMouseDown:w,onMouseLeave:S,onMouseMove:x,onMouseUp:k,onDragStart:_,onDragMove:E,onDragEnd:P,onContextMenu:function(e){return e.evt.preventDefault()},onWheel:b,draggable:("move"===u||c)&&!n,children:[no(qbe,{id:"grid",visible:o,children:no(Owe,{})}),no(qbe,{id:"base",ref:g,listening:!1,imageSmoothingEnabled:!1,children:no(Uwe,{})}),ro(qbe,{id:"mask",visible:t,listening:!1,children:[no(Fwe,{visible:!0,listening:!1}),no(jwe,{listening:!1})]}),no(qbe,{children:no(cwe,{})}),ro(qbe,{id:"preview",imageSmoothingEnabled:!1,children:[!c&&no(rke,{visible:"move"!==u,listening:!1}),no(qwe,{visible:c}),d&&no(Mwe,{}),no(tke,{visible:r&&!c})]})]}),no(Jwe,{}),no(Zwe,{})]})})},ake=QX(Lde,Ade,fae,(function(e,t,n){return{doesCanvasNeedScaling:e.doesCanvasNeedScaling,activeTabName:n,initialCanvasImage:t,isCanvasInitialized:e.isCanvasInitialized}})),ske=function(){var e=wie(),t=kie(ake),n=t.doesCanvasNeedScaling,r=t.activeTabName,o=t.initialCanvasImage,i=t.isCanvasInitialized,a=cr.useRef(null);return cr.useLayoutEffect((function(){window.setTimeout((function(){if(a.current){var t=a.current,n=t.clientWidth,r=t.clientHeight;e(p3({width:n,height:r})),e(i?l3():s3()),e(m3(!1))}}),0)}),[e,o,n,r,i]),no("div",{ref:a,className:"inpainting-canvas-area",children:no(XC,{thickness:"2px",speed:"1s",size:"xl"})})},lke=_K,uke=kK,cke=function(){return lke.Date.now()},dke=$K,fke=Math.max,hke=Math.min;var pke=function(e,t,n){var r,o,i,a,s,l,u=0,c=!1,d=!1,f=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function h(t){var n=r,i=o;return r=o=void 0,u=t,a=e.apply(i,n)}function p(e){return u=e,s=setTimeout(g,t),c?h(e):a}function v(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-u>=i}function g(){var e=cke();if(v(e))return m(e);s=setTimeout(g,function(e){var n=t-(e-l);return d?hke(n,i-(e-u)):n}(e))}function m(e){return s=void 0,f&&r?h(e):(r=o=void 0,a)}function y(){var e=cke(),n=v(e);if(r=arguments,o=this,l=e,n){if(void 0===s)return p(l);if(d)return clearTimeout(s),s=setTimeout(g,t),h(l)}return void 0===s&&(s=setTimeout(g,t)),a}return t=dke(t)||0,uke(n)&&(c=!!n.leading,i=(d="maxWait"in n)?fke(dke(n.maxWait)||0,t):i,f="trailing"in n?!!n.trailing:f),y.cancel=function(){void 0!==s&&clearTimeout(s),u=0,r=l=o=s=void 0},y.flush=function(){return void 0===s?a:m(cke())},y},vke=QX([Lde,fae,wle],(function(e,t,n){return{canRedo:e.futureLayerStates.length>0&&!n.isProcessing,activeTabName:t}}),{memoizeOptions:{resultEqualityCheck:dae}});function gke(){var e=wie(),t=kie(vke),n=t.canRedo,r=t.activeTabName,o=o8().t,i=function(){e(r3())};return _ce(["meta+shift+z","ctrl+shift+z","control+y","meta+y"],(function(){i()}),{enabled:function(){return n},preventDefault:!0},[r,n]),no(_ae,{"aria-label":"".concat(o("unifiedcanvas:redo")," (Ctrl+Shift+Z)"),tooltip:"".concat(o("unifiedcanvas:redo")," (Ctrl+Shift+Z)"),icon:no(gde,{}),onClick:i,isDisabled:!n})}var mke=QX([Lde,fae,wle],(function(e,t,n){return{canUndo:e.pastLayerStates.length>0&&!n.isProcessing,activeTabName:t}}),{memoizeOptions:{resultEqualityCheck:dae}});function yke(){var e=wie(),t=o8().t,n=kie(mke),r=n.canUndo,o=n.activeTabName,i=function(){e(V3())};return _ce(["meta+z","ctrl+z"],(function(){i()}),{enabled:function(){return r},preventDefault:!0},[o,r]),no(_ae,{"aria-label":"".concat(t("unifiedcanvas:undo")," (Ctrl+Z)"),tooltip:"".concat(t("unifiedcanvas:undo")," (Ctrl+Z)"),icon:no(Cde,{}),onClick:i,isDisabled:!r})}var bke=function(e,t,n){var r=document.createElement("img");r.addEventListener("load",(function(){var e=document.createElement("canvas");e.width=t,e.height=n;var o=e.getContext("2d");o&&(o.drawImage(r,0,0),e.toBlob((function(e){e&&navigator.clipboard.write([new ClipboardItem(gn({},e.type,e))])})),e.remove(),r.remove())})),r.src=e},wke=function(e){var t=document.createElement("a");t.href=e,t.download="",document.body.appendChild(t),t.click(),document.body.removeChild(t),t.remove()},kke=function(e,t,n,r){var o=e.scale(),i=e.getClientRect({relativeTo:e.getParent()});e.scale({x:1/t,y:1/t});var a=e.getClientRect(),s=a.x,l=a.y,u=a.width,c=a.height,d=r?{x:r.x+n.x,y:r.y+n.y,width:r.width,height:r.height}:{x:s,y:l,width:u,height:c},f=e.toDataURL(d);return e.scale(o),{dataURL:f,boundingBox:{x:i.x,y:i.y,width:u,height:c}}},xke={cropVisible:!1,cropToBoundingBox:!1,shouldSaveToGallery:!1,shouldDownload:!1,shouldCopy:!1,shouldSetAsInitialImage:!0},Ske=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:xke;return function(){var t=qt(Ut().mark((function t(n,r){var o,i,a,s,l,u,c,d,f,h,p,v,g,m,y,b,w,k,x,S,C,_,E;return Ut().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=e.cropVisible,i=e.cropToBoundingBox,a=e.shouldSaveToGallery,s=e.shouldDownload,l=e.shouldCopy,u=e.shouldSetAsInitialImage,n(O8("Exporting Image")),n(x8(!1)),c=r(),d=c.canvas,f=d.stageScale,h=d.boundingBoxCoordinates,p=d.boundingBoxDimensions,v=d.stageCoordinates,g=Loe()){t.next=10;break}return n(l8(!1)),n(x8(!0)),t.abrupt("return");case 10:if(m=kke(g,f,v,i?un(un({},h),p):void 0),y=m.dataURL,b=m.boundingBox,y){t.next=15;break}return n(l8(!1)),n(x8(!0)),t.abrupt("return");case 15:return(w=new FormData).append("data",JSON.stringify({dataURL:y,filename:"merged_canvas.png",kind:a?"result":"temp",cropVisible:o})),t.next=19,fetch("".concat(window.location.origin,"/upload"),{method:"POST",body:w});case 19:return k=t.sent,t.next=22,k.json();case 22:x=t.sent,S=x.url,C=x.width,_=x.height,E=un({uuid:Xoe(),category:a?"result":"user"},x),s&&(wke(S),n(P8({title:A7.t("toast:downloadImageStarted"),status:"success",duration:2500,isClosable:!0}))),l&&(bke(S,C,_),n(P8({title:A7.t("toast:imageCopied"),status:"success",duration:2500,isClosable:!0}))),a&&(n(Z3({image:E,category:"result"})),n(P8({title:A7.t("toast:imageSavedToGallery"),status:"success",duration:2500,isClosable:!0}))),u&&(n(P3(un(un({kind:"image",layer:"base"},b),{},{image:E}))),n(P8({title:A7.t("toast:canvasMerged"),status:"success",duration:2500,isClosable:!0}))),n(l8(!1)),n(v8(A7.t("common:statusConnected"))),n(x8(!0));case 32:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}()};function Cke(){var e=kie(Ode),t=Loe(),n=kie((function(e){return e.system.isProcessing})),r=kie((function(e){return e.canvas.shouldCropToBoundingBoxOnSave})),o=wie(),i=o8().t;_ce(["meta+c","ctrl+c"],(function(){a()}),{enabled:function(){return!e},preventDefault:!0},[t,n]);var a=function(){o(Ske({cropVisible:!r,cropToBoundingBox:r,shouldCopy:!0}))};return no(_ae,{"aria-label":"".concat(i("unifiedcanvas:copyToClipboard")," (Cmd/Ctrl+C)"),tooltip:"".concat(i("unifiedcanvas:copyToClipboard")," (Cmd/Ctrl+C)"),icon:no(qce,{}),onClick:a,isDisabled:e})}function _ke(){var e=wie(),t=o8().t,n=Loe(),r=kie(Ode),o=kie((function(e){return e.system.isProcessing})),i=kie((function(e){return e.canvas.shouldCropToBoundingBoxOnSave}));_ce(["shift+d"],(function(){a()}),{enabled:function(){return!r},preventDefault:!0},[n,o]);var a=function(){e(Ske({cropVisible:!i,cropToBoundingBox:i,shouldDownload:!0}))};return no(_ae,{"aria-label":"".concat(t("unifiedcanvas:downloadAsImage")," (Shift+D)"),tooltip:"".concat(t("unifiedcanvas:downloadAsImage")," (Shift+D)"),icon:no(Xce,{}),onClick:a,isDisabled:r})}function Eke(){var e=kie(Ode),t=xie().openUploader,n=o8().t;return no(_ae,{"aria-label":n("common:upload"),tooltip:n("common:upload"),icon:no(_de,{}),onClick:t,isDisabled:e})}var Pke=QX([Lde,Ode],(function(e,t){return{layer:e.layer,isMaskEnabled:e.isMaskEnabled,isStaging:t}}),{memoizeOptions:{resultEqualityCheck:dae}});function Lke(){var e=wie(),t=o8().t,n=kie(Pke),r=n.layer,o=n.isMaskEnabled,i=n.isStaging;_ce(["q"],(function(){e(_3("mask"===r?"base":"mask"))}),{enabled:function(){return!i},preventDefault:!0},[r]);return no(Mae,{tooltip:"".concat(t("unifiedcanvas:layer")," (Q)"),tooltipProps:{hasArrow:!0,placement:"top"},value:r,validValues:D5,onChange:function(t){var n=t.target.value;e(_3(n)),"mask"!==n||o||e(w3(!0))},isDisabled:i})}function Oke(){var e=wie(),t=o8().t,n=Loe(),r=kie(Ode),o=kie((function(e){return e.system.isProcessing}));_ce(["shift+m"],(function(){i()}),{enabled:function(){return!r},preventDefault:!0},[n,o]);var i=function(){e(Ske({cropVisible:!1,shouldSetAsInitialImage:!0}))};return no(_ae,{"aria-label":"".concat(t("unifiedcanvas:mergeVisible")," (Shift+M)"),tooltip:"".concat(t("unifiedcanvas:mergeVisible")," (Shift+M)"),icon:no(sde,{}),onClick:i,isDisabled:r})}function Ake(){var e=kie((function(e){return e.canvas.tool})),t=kie(Ode),n=wie(),r=o8().t;_ce(["v"],(function(){o()}),{enabled:function(){return!t},preventDefault:!0},[]);var o=function(){return n(H3("move"))};return no(_ae,{"aria-label":"".concat(r("unifiedcanvas:move")," (V)"),tooltip:"".concat(r("unifiedcanvas:move")," (V)"),icon:no(Hce,{}),"data-selected":"move"===e||t,onClick:o})}function Mke(){var e=kie((function(e){return e.ui.shouldPinParametersPanel})),t=wie(),n=o8().t;return ro(yP,{flexDirection:"column",gap:"0.5rem",children:[no(_ae,{tooltip:"".concat(n("parameters:showOptionsPanel")," (O)"),tooltipProps:{placement:"top"},"aria-label":n("parameters:showOptionsPanel"),onClick:function(){t(V8(!0)),e&&setTimeout((function(){return t(m3(!0))}),400)},children:no(kde,{})}),no(yP,{children:no(Fye,{iconButton:!0})}),no(yP,{children:no(zye,{width:"100%",height:"40px"})})]})}function Tke(){var e=wie(),t=o8().t,n=kie(Ode);return no(_ae,{"aria-label":t("unifiedcanvas:clearCanvas"),tooltip:t("unifiedcanvas:clearCanvas"),icon:no(Sde,{}),onClick:function(){e(o3()),e(s3())},style:{backgroundColor:"var(--btn-delete-image)"},isDisabled:n})}function Ike(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:250,r=cr.useState(0),o=yn(r,2),i=o[0],a=o[1];return cr.useEffect((function(){var r=setTimeout((function(){1===i&&e(),a(0)}),n);return 2===i&&t(),function(){return clearTimeout(r)}}),[i,e,t,n]),function(){return a((function(e){return e+1}))}}function Rke(){var e=Loe(),t=wie(),n=o8().t;_ce(["r"],(function(){o()}),{enabled:function(){return!0},preventDefault:!0},[e]);var r=Ike((function(){return o(!1)}),(function(){return o(!0)})),o=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=Loe();if(n){var r=n.getClientRect({skipTransform:!0});t(a3({contentRect:r,shouldScaleTo1:e}))}};return no(_ae,{"aria-label":"".concat(n("unifiedcanvas:resetView")," (R)"),tooltip:"".concat(n("unifiedcanvas:resetView")," (R)"),icon:no(Yce,{}),onClick:r})}function Nke(){var e=kie(Ode),t=Loe(),n=kie((function(e){return e.system.isProcessing})),r=kie((function(e){return e.canvas.shouldCropToBoundingBoxOnSave})),o=wie(),i=o8().t;_ce(["shift+s"],(function(){a()}),{enabled:function(){return!e},preventDefault:!0},[t,n]);var a=function(){o(Ske({cropVisible:!r,cropToBoundingBox:r,shouldSaveToGallery:!0}))};return no(_ae,{"aria-label":"".concat(i("unifiedcanvas:saveToGallery")," (Shift+S)"),tooltip:"".concat(i("unifiedcanvas:saveToGallery")," (Shift+S)"),icon:no(mde,{}),onClick:a,isDisabled:e})}var Dke=QX([Lde,Ode,wle],(function(e,t,n){var r=n.isProcessing;return{tool:e.tool,isStaging:t,isProcessing:r}}),{memoizeOptions:{resultEqualityCheck:dae}}),zke=function(){var e=wie(),t=o8().t,n=kie(Dke),r=n.tool,o=n.isStaging;_ce(["b"],(function(){i()}),{enabled:function(){return!o},preventDefault:!0},[]),_ce(["e"],(function(){a()}),{enabled:function(){return!o},preventDefault:!0},[r]),_ce(["c"],(function(){s()}),{enabled:function(){return!o},preventDefault:!0},[r]),_ce(["shift+f"],(function(){l()}),{enabled:function(){return!o},preventDefault:!0}),_ce(["delete","backspace"],(function(){u()}),{enabled:function(){return!o},preventDefault:!0});var i=function(){return e(H3("brush"))},a=function(){return e(H3("eraser"))},s=function(){return e(H3("colorPicker"))},l=function(){return e(G5())},u=function(){return e(U5())};return ro(yP,{flexDirection:"column",gap:"0.5rem",children:[ro(k_,{children:[no(_ae,{"aria-label":"".concat(t("unifiedcanvas:brush")," (B)"),tooltip:"".concat(t("unifiedcanvas:brush")," (B)"),icon:no(cde,{}),"data-selected":"brush"===r&&!o,onClick:i,isDisabled:o}),no(_ae,{"aria-label":"".concat(t("unifiedcanvas:eraser")," (E)"),tooltip:"".concat(t("unifiedcanvas:eraser")," (B)"),icon:no($ce,{}),"data-selected":"eraser"===r&&!o,isDisabled:o,onClick:a})]}),ro(k_,{children:[no(_ae,{"aria-label":"".concat(t("unifiedcanvas:fillBoundingBox")," (Shift+F)"),tooltip:"".concat(t("unifiedcanvas:fillBoundingBox")," (Shift+F)"),icon:no(nde,{}),isDisabled:o,onClick:l}),no(_ae,{"aria-label":"".concat(t("unifiedcanvas:eraseBoundingBox")," (Del/Backspace)"),tooltip:"".concat(t("unifiedcanvas:eraseBoundingBox")," (Del/Backspace)"),icon:no(hde,{style:{transform:"rotate(45deg)"}}),isDisabled:o,onClick:u})]}),no(_ae,{"aria-label":"".concat(t("unifiedcanvas:colorPicker")," (C)"),tooltip:"".concat(t("unifiedcanvas:colorPicker")," (C)"),icon:no(Jce,{}),"data-selected":"colorPicker"===r&&!o,isDisabled:o,onClick:s,width:"max-content"})]})},jke=Cv((function(e,t){var n=e.acceptButtonText,r=void 0===n?"Accept":n,o=e.acceptCallback,i=e.cancelButtonText,a=void 0===i?"Cancel":i,s=e.cancelCallback,l=e.children,u=e.title,c=e.triggerComponent,d=GE(),f=d.isOpen,h=d.onOpen,p=d.onClose,v=cr.useRef(null);return ro(to,{children:[cr.cloneElement(c,{onClick:h,ref:t}),no(oU,{isOpen:f,leastDestructiveRef:v,onClose:p,children:no(rU,{children:ro(iU,{className:"modal",children:[no(tU,{fontSize:"lg",fontWeight:"bold",children:u}),no(YW,{children:l}),ro(eU,{children:[no(b_,{ref:v,onClick:function(){s&&s(),p()},className:"modal-close-btn",children:a}),no(b_,{colorScheme:"red",onClick:function(){o(),p()},ml:3,children:r})]})]})})})]})})),Bke=function(){var e=kie(Ode),t=wie(),n=o8().t;return ro(jke,{title:n("unifiedcanvas:emptyTempImageFolder"),acceptCallback:function(){t(cie()),t(o3()),t(X5())},acceptButtonText:n("unifiedcanvas:emptyFolder"),triggerComponent:no(Eae,{leftIcon:no(Sde,{}),size:"sm",isDisabled:e,children:n("unifiedcanvas:emptyTempImageFolder")}),children:[no("p",{children:n("unifiedcanvas:emptyTempImagesFolderMessage")}),no("br",{}),no("p",{children:n("unifiedcanvas:emptyTempImagesFolderConfirm")})]})},Fke=function(){var e=kie(Ode),t=wie(),n=o8().t;return ro(jke,{title:n("unifiedcanvas:clearCanvasHistory"),acceptCallback:function(){return t(X5())},acceptButtonText:n("unifiedcanvas:clearHistory"),triggerComponent:no(Eae,{size:"sm",leftIcon:no(Sde,{}),isDisabled:e,children:n("unifiedcanvas:clearCanvasHistory")}),children:[no("p",{children:n("unifiedcanvas:clearCanvasHistoryMessage")}),no("br",{}),no("p",{children:n("unifiedcanvas:clearCanvasHistoryConfirm")})]})},Hke=QX([Lde],(function(e){return{shouldAutoSave:e.shouldAutoSave,shouldCropToBoundingBoxOnSave:e.shouldCropToBoundingBoxOnSave,shouldShowCanvasDebugInfo:e.shouldShowCanvasDebugInfo,shouldShowIntermediates:e.shouldShowIntermediates}}),{memoizeOptions:{resultEqualityCheck:dae}}),Vke=function(){var e=wie(),t=o8().t,n=kie(Hke),r=n.shouldAutoSave,o=n.shouldCropToBoundingBoxOnSave,i=n.shouldShowCanvasDebugInfo,a=n.shouldShowIntermediates;return no(Pae,{trigger:"hover",triggerComponent:no(_ae,{tooltip:t("unifiedcanvas:canvasSettings"),tooltipProps:{placement:"bottom"},"aria-label":t("unifiedcanvas:canvasSettings"),icon:no(Pde,{})}),children:ro(yP,{direction:"column",gap:"0.5rem",children:[no(pfe,{label:t("unifiedcanvas:showIntermediates"),isChecked:a,onChange:function(t){return e(N3(t.target.checked))}}),no(pfe,{label:t("unifiedcanvas:autoSaveToGallery"),isChecked:r,onChange:function(t){return e(L3(t.target.checked))}}),no(pfe,{label:t("unifiedcanvas:saveBoxRegionOnly"),isChecked:o,onChange:function(t){return e(O3(t.target.checked))}}),no(pfe,{label:t("unifiedcanvas:showCanvasDebugInfo"),isChecked:i,onChange:function(t){return e(I3(t.target.checked))}}),no(Fke,{}),no(Bke,{})]})})},Wke=function(){var e=kie((function(e){return e.ui.shouldShowParametersPanel}));return ro(yP,{flexDirection:"column",rowGap:"0.5rem",width:"6rem",children:[no(Lke,{}),no(zke,{}),ro(yP,{gap:"0.5rem",children:[no(Ake,{}),no(Rke,{})]}),ro(yP,{columnGap:"0.5rem",children:[no(Oke,{}),no(Nke,{})]}),ro(yP,{columnGap:"0.5rem",children:[no(Cke,{}),no(_ke,{})]}),ro(yP,{gap:"0.5rem",children:[no(yke,{}),no(gke,{})]}),ro(yP,{gap:"0.5rem",children:[no(Eke,{}),no(Tke,{})]}),no(Vke,{}),!e&&no(Mke,{})]})};function Uke(){var e=wie(),t=kie((function(e){return e.canvas.brushSize})),n=o8().t,r=kie(Ode);return _ce(["BracketLeft"],(function(){e(h3(Math.max(t-5,5)))}),{enabled:function(){return!r},preventDefault:!0},[t]),_ce(["BracketRight"],(function(){e(h3(Math.min(t+5,500)))}),{enabled:function(){return!r},preventDefault:!0},[t]),no(xfe,{label:n("unifiedcanvas:brushSize"),value:t,withInput:!0,onChange:function(t){return e(h3(t))},sliderNumberInputProps:{max:500},inputReadOnly:!1,width:"100px",isCompact:!0})}function Gke(){return(Gke=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}function Yke(e){var t=cr.useRef(e),n=cr.useRef((function(e){t.current&&t.current(e)}));return t.current=e,n.current}var Zke=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e0:e.buttons>0)&&o.current?i(Kke(o.current,e,s.current)):n(!1)},t=function(){return n(!1)};function n(n){var r=l.current,i=$ke(o.current),a=n?i.addEventListener:i.removeEventListener;a(r?"touchmove":"mousemove",e),a(r?"touchend":"mouseup",t)}return[function(e){var t=e.nativeEvent,r=o.current;if(r&&(Qke(t),!function(e,t){return t&&!Xke(e)}(t,l.current)&&r)){if(Xke(t)){l.current=!0;var a=t.changedTouches||[];a.length&&(s.current=a[0].identifier)}r.focus(),i(Kke(r,t,s.current)),n(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),a({left:39===t?.05:37===t?-.05:0,top:40===t?.05:38===t?-.05:0}))},n]}),[a,i]),c=u[0],d=u[1],f=u[2];return cr.useEffect((function(){return f}),[f]),qr.createElement("div",Gke({},r,{onTouchStart:c,onMouseDown:c,className:"react-colorful__interactive",ref:o,onKeyDown:d,tabIndex:0,role:"slider"}))})),exe=function(e){return e.filter(Boolean).join(" ")},txe=function(e){var t=e.color,n=e.left,r=e.top,o=void 0===r?.5:r,i=exe(["react-colorful__pointer",e.className]);return qr.createElement("div",{className:i,style:{top:100*o+"%",left:100*n+"%"}},qr.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},nxe=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n},rxe=function(e){var t=e.s,n=e.v,r=e.a,o=(200-t)*n/100;return{h:nxe(e.h),s:nxe(o>0&&o<200?t*n/100/(o<=100?o:200-o)*100:0),l:nxe(o/2),a:nxe(r,2)}},oxe=function(e){var t=rxe(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},ixe=function(e){var t=rxe(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},axe=qr.memo((function(e){var t=e.hue,n=e.onChange,r=exe(["react-colorful__hue",e.className]);return qr.createElement("div",{className:r},qr.createElement(Jke,{onMove:function(e){n({h:360*e.left})},onKey:function(e){n({h:Zke(t+360*e.left,0,360)})},"aria-label":"Hue","aria-valuenow":nxe(t),"aria-valuemax":"360","aria-valuemin":"0"},qr.createElement(txe,{className:"react-colorful__hue-pointer",left:t/360,color:oxe({h:t,s:100,v:100,a:1})})))})),sxe=qr.memo((function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:oxe({h:t.h,s:100,v:100,a:1})};return qr.createElement("div",{className:"react-colorful__saturation",style:r},qr.createElement(Jke,{onMove:function(e){n({s:100*e.left,v:100-100*e.top})},onKey:function(e){n({s:Zke(t.s+100*e.left,0,100),v:Zke(t.v-100*e.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+nxe(t.s)+"%, Brightness "+nxe(t.v)+"%"},qr.createElement(txe,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:oxe(t)})))})),lxe=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function uxe(e,t,n){var r=Yke(n),o=cr.useState((function(){return e.toHsva(t)})),i=o[0],a=o[1],s=cr.useRef({color:t,hsva:i});cr.useEffect((function(){if(!e.equal(t,s.current.color)){var n=e.toHsva(t);s.current={hsva:n,color:t},a(n)}}),[t,e]),cr.useEffect((function(){var t;lxe(i,s.current.hsva)||e.equal(t=e.fromHsva(i),s.current.color)||(s.current={hsva:i,color:t},r(t))}),[i,e,r]);var l=cr.useCallback((function(e){a((function(t){return Object.assign({},t,e)}))}),[]);return[i,l]}var cxe="undefined"!=typeof window?cr.useLayoutEffect:cr.useEffect,dxe=new Map,fxe=function(e){cxe((function(){var t=e.current?e.current.ownerDocument:document;if(void 0!==t&&!dxe.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,\')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}',dxe.set(t,n);var r="undefined"!=typeof __webpack_nonce__?__webpack_nonce__:void 0;r&&n.setAttribute("nonce",r),t.head.appendChild(n)}}),[])},hxe=function(e){var t=e.className,n=e.hsva,r=e.onChange,o={backgroundImage:"linear-gradient(90deg, "+ixe(Object.assign({},n,{a:0}))+", "+ixe(Object.assign({},n,{a:1}))+")"},i=exe(["react-colorful__alpha",t]),a=nxe(100*n.a);return qr.createElement("div",{className:i},qr.createElement("div",{className:"react-colorful__alpha-gradient",style:o}),qr.createElement(Jke,{onMove:function(e){r({a:e.left})},onKey:function(e){r({a:Zke(n.a+e.left)})},"aria-label":"Alpha","aria-valuetext":a+"%","aria-valuenow":a,"aria-valuemin":"0","aria-valuemax":"100"},qr.createElement(txe,{className:"react-colorful__alpha-pointer",left:n.a,color:ixe(n)})))},pxe=function(e){var t=e.className,n=e.colorModel,r=e.color,o=void 0===r?n.defaultColor:r,i=e.onChange,a=qke(e,["className","colorModel","color","onChange"]),s=cr.useRef(null);fxe(s);var l=uxe(n,o,i),u=l[0],c=l[1],d=exe(["react-colorful",t]);return qr.createElement("div",Gke({},a,{ref:s,className:d}),qr.createElement(sxe,{hsva:u,onChange:c}),qr.createElement(axe,{hue:u.h,onChange:c}),qr.createElement(hxe,{hsva:u,onChange:c,className:"react-colorful__last-control"}))},vxe={defaultColor:{r:0,g:0,b:0,a:1},toHsva:function(e){var t=e.r,n=e.g,r=e.b,o=e.a,i=Math.max(t,n,r),a=i-Math.min(t,n,r),s=a?i===t?(n-r)/a:i===n?2+(r-t)/a:4+(t-n)/a:0;return{h:nxe(60*(s<0?s+6:s)),s:nxe(i?a/i*100:0),v:nxe(i/255*100),a:o}},fromHsva:function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var i=Math.floor(t),a=r*(1-n),s=r*(1-(t-i)*n),l=r*(1-(1-t+i)*n),u=i%6;return{r:nxe(255*[r,s,a,a,l,r][u]),g:nxe(255*[l,r,r,s,a,a][u]),b:nxe(255*[a,a,l,r,r,s][u]),a:nxe(o,2)}},equal:lxe},gxe=function(e){return qr.createElement(pxe,Gke({},e,{colorModel:vxe}))},mxe=function(e){var t=e.styleClass,n=sn(e,Wt);return no(gxe,un({className:"invokeai__color-picker ".concat(t)},n))},yxe=QX([Lde,Ode],(function(e,t){return{brushColor:e.brushColor,maskColor:e.maskColor,layer:e.layer,isStaging:t}}),{memoizeOptions:{resultEqualityCheck:dae}});function bxe(){var e=wie(),t=kie(yxe),n=t.brushColor,r=t.maskColor,o=t.layer,i=t.isStaging;return _ce(["shift+BracketLeft"],(function(){e(f3(un(un({},n),{},{a:JK(n.a-.05,.05,1)})))}),{enabled:function(){return!i},preventDefault:!0},[n]),_ce(["shift+BracketRight"],(function(){e(f3(un(un({},n),{},{a:JK(n.a+.05,.05,1)})))}),{enabled:function(){return!i},preventDefault:!0},[n]),no(Pae,{trigger:"hover",triggerComponent:no(cP,{style:{width:"30px",height:"30px",minWidth:"30px",minHeight:"30px",borderRadius:"99999999px",backgroundColor:"base"===o?"rgba(".concat(n.r,",").concat(n.g,",").concat(n.b,",").concat(n.a,")"):"mask"===o?"rgba(".concat(r.r,",").concat(r.g,",").concat(r.b,",").concat(r.a,")"):void 0,cursor:"pointer"}}),children:ro(yP,{minWidth:"15rem",direction:"column",gap:"1rem",width:"100%",children:["base"===o&&no(mxe,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:n,onChange:function(t){return e(f3(t))}}),"mask"===o&&no(mxe,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:r,onChange:function(t){return e(E3(t))}})]})})}function wxe(){return ro(yP,{columnGap:"1rem",alignItems:"center",children:[no(Uke,{}),no(bxe,{})]})}function kxe(){var e=wie(),t=kie((function(e){return e.canvas.shouldRestrictStrokesToBox})),n=o8().t;return no(pfe,{label:n("unifiedcanvas:betaLimitToBox"),isChecked:t,onChange:function(t){return e(U3(t.target.checked))}})}function xxe(){return ro(yP,{gap:"1rem",alignItems:"center",children:[no(wxe,{}),no(kxe,{})]})}function Sxe(){var e=wie(),t=o8().t;return no(Eae,{size:"sm",leftIcon:no(Sde,{}),onClick:function(){return e($5())},tooltip:"".concat(t("unifiedcanvas:clearMask")," (Shift+C)"),children:t("unifiedcanvas:betaClear")})}function Cxe(){var e=kie((function(e){return e.canvas.isMaskEnabled})),t=wie(),n=o8().t;return no(pfe,{label:"".concat(n("unifiedcanvas:enableMask")," (H)"),isChecked:e,onChange:function(){return t(w3(!e))}})}function _xe(){var e=wie(),t=o8().t,n=kie((function(e){return e.canvas.shouldPreserveMaskedArea}));return no(pfe,{label:t("unifiedcanvas:betaPreserveMasked"),isChecked:n,onChange:function(t){return e(M3(t.target.checked))}})}function Exe(){return ro(yP,{gap:"1rem",alignItems:"center",children:[no(wxe,{}),no(Cxe,{}),no(_xe,{}),no(Sxe,{})]})}function Pxe(){var e=kie((function(e){return e.canvas.shouldDarkenOutsideBoundingBox})),t=wie(),n=o8().t;return no(pfe,{label:n("unifiedcanvas:betaDarkenOutside"),isChecked:e,onChange:function(e){return t(A3(e.target.checked))}})}function Lxe(){var e=kie((function(e){return e.canvas.shouldShowGrid})),t=wie(),n=o8().t;return no(pfe,{label:n("unifiedcanvas:showGrid"),isChecked:e,onChange:function(e){return t(R3(e.target.checked))}})}function Oxe(){var e=kie((function(e){return e.canvas.shouldSnapToGrid})),t=wie(),n=o8().t;return no(pfe,{label:"".concat(n("unifiedcanvas:snapToGrid")," (N)"),isChecked:e,onChange:function(e){return t(j3(e.target.checked))}})}function Axe(){return ro(yP,{alignItems:"center",gap:"1rem",children:[no(Lxe,{}),no(Oxe,{}),no(Pxe,{})]})}var Mxe=QX([Lde],(function(e){return{tool:e.tool,layer:e.layer}}),{memoizeOptions:{resultEqualityCheck:dae}});function Txe(){var e=kie(Mxe),t=e.tool,n=e.layer;return ro(yP,{height:"2rem",minHeight:"2rem",maxHeight:"2rem",alignItems:"center",children:["base"==n&&["brush","eraser","colorPicker"].includes(t)&&no(xxe,{}),"mask"==n&&["brush","eraser","colorPicker"].includes(t)&&no(Exe,{}),"move"==t&&no(Axe,{})]})}var Ixe=QX([Lde],(function(e){return{doesCanvasNeedScaling:e.doesCanvasNeedScaling}}),{memoizeOptions:{resultEqualityCheck:dae}}),Rxe=function(){var e=wie(),t=kie(Ixe).doesCanvasNeedScaling;return cr.useLayoutEffect((function(){e(m3(!0));var t=pke((function(){e(m3(!0))}),250);return window.addEventListener("resize",t),function(){return window.removeEventListener("resize",t)}}),[e]),no("div",{className:"workarea-single-view",children:ro(yP,{flexDirection:"row",width:"100%",height:"100%",columnGap:"1rem",padding:"1rem",children:[no(Wke,{}),ro(yP,{width:"100%",height:"100%",flexDirection:"column",rowGap:"1rem",children:[no(Txe,{}),no(t?ske:ike,{})]})]})})},Nxe=QX([Lde,Ode],(function(e,t){var n=e.maskColor,r=e.layer,o=e.isMaskEnabled,i=e.shouldPreserveMaskedArea;return{layer:r,maskColor:n,maskColorString:Twe(n),isMaskEnabled:o,shouldPreserveMaskedArea:i,isStaging:t}}),{memoizeOptions:{resultEqualityCheck:dae}}),Dxe=function(){var e=wie(),t=o8().t,n=kie(Nxe),r=n.layer,o=n.maskColor,i=n.isMaskEnabled,a=n.shouldPreserveMaskedArea,s=n.isStaging;_ce(["q"],(function(){l()}),{enabled:function(){return!s},preventDefault:!0},[r]),_ce(["shift+c"],(function(){u()}),{enabled:function(){return!s},preventDefault:!0},[]),_ce(["h"],(function(){c()}),{enabled:function(){return!s},preventDefault:!0},[i]);var l=function(){e(_3("mask"===r?"base":"mask"))},u=function(){return e($5())},c=function(){return e(w3(!i))};return no(Pae,{trigger:"hover",triggerComponent:no(k_,{children:no(_ae,{"aria-label":t("unifiedcanvas:maskingOptions"),tooltip:t("unifiedcanvas:maskingOptions"),icon:no(lde,{}),style:"mask"===r?{backgroundColor:"var(--accent-color)"}:{backgroundColor:"var(--btn-base-color)"},isDisabled:s})}),children:ro(yP,{direction:"column",gap:"0.5rem",children:[no(pfe,{label:"".concat(t("unifiedcanvas:enableMask")," (H)"),isChecked:i,onChange:c}),no(pfe,{label:t("unifiedcanvas:preserveMaskedArea"),isChecked:a,onChange:function(t){return e(M3(t.target.checked))}}),no(mxe,{style:{paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:o,onChange:function(t){return e(E3(t))}}),ro(Eae,{size:"sm",leftIcon:no(Sde,{}),onClick:u,children:[t("unifiedcanvas:clearMask")," (Shift+C)"]})]})})},zxe=QX([Lde],(function(e){return{shouldAutoSave:e.shouldAutoSave,shouldCropToBoundingBoxOnSave:e.shouldCropToBoundingBoxOnSave,shouldDarkenOutsideBoundingBox:e.shouldDarkenOutsideBoundingBox,shouldShowCanvasDebugInfo:e.shouldShowCanvasDebugInfo,shouldShowGrid:e.shouldShowGrid,shouldShowIntermediates:e.shouldShowIntermediates,shouldSnapToGrid:e.shouldSnapToGrid,shouldRestrictStrokesToBox:e.shouldRestrictStrokesToBox}}),{memoizeOptions:{resultEqualityCheck:dae}}),jxe=function(){var e=wie(),t=o8().t,n=kie(zxe),r=n.shouldAutoSave,o=n.shouldCropToBoundingBoxOnSave,i=n.shouldDarkenOutsideBoundingBox,a=n.shouldShowCanvasDebugInfo,s=n.shouldShowGrid,l=n.shouldShowIntermediates,u=n.shouldSnapToGrid,c=n.shouldRestrictStrokesToBox;_ce(["n"],(function(){e(j3(!u))}),{enabled:!0,preventDefault:!0},[u]);return no(Pae,{trigger:"hover",triggerComponent:no(_ae,{tooltip:t("unifiedcanvas:canvasSettings"),"aria-label":t("unifiedcanvas:canvasSettings"),icon:no(Pde,{})}),children:ro(yP,{direction:"column",gap:"0.5rem",children:[no(pfe,{label:t("unifiedcanvas:showIntermediates"),isChecked:l,onChange:function(t){return e(N3(t.target.checked))}}),no(pfe,{label:t("unifiedcanvas:showGrid"),isChecked:s,onChange:function(t){return e(R3(t.target.checked))}}),no(pfe,{label:t("unifiedcanvas:snapToGrid"),isChecked:u,onChange:function(t){return e(j3(t.target.checked))}}),no(pfe,{label:t("unifiedcanvas:darkenOutsideSelection"),isChecked:i,onChange:function(t){return e(A3(t.target.checked))}}),no(pfe,{label:t("unifiedcanvas:autoSaveToGallery"),isChecked:r,onChange:function(t){return e(L3(t.target.checked))}}),no(pfe,{label:t("unifiedcanvas:saveBoxRegionOnly"),isChecked:o,onChange:function(t){return e(O3(t.target.checked))}}),no(pfe,{label:t("unifiedcanvas:limitStrokesToBox"),isChecked:c,onChange:function(t){return e(U3(t.target.checked))}}),no(pfe,{label:t("unifiedcanvas:showCanvasDebugInfo"),isChecked:a,onChange:function(t){return e(I3(t.target.checked))}}),no(Fke,{}),no(Bke,{})]})})},Bxe=QX([Lde,Ode,wle],(function(e,t,n){var r=n.isProcessing;return{tool:e.tool,isStaging:t,isProcessing:r,brushColor:e.brushColor,brushSize:e.brushSize}}),{memoizeOptions:{resultEqualityCheck:dae}}),Fxe=function(){var e=wie(),t=kie(Bxe),n=t.tool,r=t.brushColor,o=t.brushSize,i=t.isStaging,a=o8().t;_ce(["b"],(function(){s()}),{enabled:function(){return!i},preventDefault:!0},[]),_ce(["e"],(function(){l()}),{enabled:function(){return!i},preventDefault:!0},[n]),_ce(["c"],(function(){u()}),{enabled:function(){return!i},preventDefault:!0},[n]),_ce(["shift+f"],(function(){c()}),{enabled:function(){return!i},preventDefault:!0}),_ce(["delete","backspace"],(function(){d()}),{enabled:function(){return!i},preventDefault:!0}),_ce(["BracketLeft"],(function(){e(h3(Math.max(o-5,5)))}),{enabled:function(){return!i},preventDefault:!0},[o]),_ce(["BracketRight"],(function(){e(h3(Math.min(o+5,500)))}),{enabled:function(){return!i},preventDefault:!0},[o]),_ce(["shift+BracketLeft"],(function(){e(f3(un(un({},r),{},{a:JK(r.a-.05,.05,1)})))}),{enabled:function(){return!i},preventDefault:!0},[r]),_ce(["shift+BracketRight"],(function(){e(f3(un(un({},r),{},{a:JK(r.a+.05,.05,1)})))}),{enabled:function(){return!i},preventDefault:!0},[r]);var s=function(){return e(H3("brush"))},l=function(){return e(H3("eraser"))},u=function(){return e(H3("colorPicker"))},c=function(){return e(G5())},d=function(){return e(U5())};return ro(k_,{isAttached:!0,children:[no(_ae,{"aria-label":"".concat(a("unifiedcanvas:brush")," (B)"),tooltip:"".concat(a("unifiedcanvas:brush")," (B)"),icon:no(cde,{}),"data-selected":"brush"===n&&!i,onClick:s,isDisabled:i}),no(_ae,{"aria-label":"".concat(a("unifiedcanvas:eraser")," (E)"),tooltip:"".concat(a("unifiedcanvas:eraser")," (E)"),icon:no($ce,{}),"data-selected":"eraser"===n&&!i,isDisabled:i,onClick:l}),no(_ae,{"aria-label":"".concat(a("unifiedcanvas:fillBoundingBox")," (Shift+F)"),tooltip:"".concat(a("unifiedcanvas:fillBoundingBox")," (Shift+F)"),icon:no(nde,{}),isDisabled:i,onClick:c}),no(_ae,{"aria-label":"".concat(a("unifiedcanvas:eraseBoundingBox")," (Del/Backspace)"),tooltip:"".concat(a("unifiedcanvas:eraseBoundingBox")," (Del/Backspace)"),icon:no(hde,{style:{transform:"rotate(45deg)"}}),isDisabled:i,onClick:d}),no(_ae,{"aria-label":"".concat(a("unifiedcanvas:colorPicker")," (C)"),tooltip:"".concat(a("unifiedcanvas:colorPicker")," (C)"),icon:no(Jce,{}),"data-selected":"colorPicker"===n&&!i,isDisabled:i,onClick:u}),no(Pae,{trigger:"hover",triggerComponent:no(_ae,{"aria-label":a("unifiedcanvas:brushOptions"),tooltip:a("unifiedcanvas:brushOptions"),icon:no(kde,{})}),children:ro(yP,{minWidth:"15rem",direction:"column",gap:"1rem",width:"100%",children:[no(yP,{gap:"1rem",justifyContent:"space-between",children:no(xfe,{label:a("unifiedcanvas:brushSize"),value:o,withInput:!0,onChange:function(t){return e(h3(t))},sliderNumberInputProps:{max:500},inputReadOnly:!1})}),no(mxe,{style:{width:"100%",paddingTop:"0.5rem",paddingBottom:"0.5rem"},color:r,onChange:function(t){return e(f3(t))}})]})})]})},Hxe=QX([wle,Lde,Ode],(function(e,t,n){var r=e.isProcessing,o=t.tool,i=t.shouldCropToBoundingBoxOnSave,a=t.layer;return{isProcessing:r,isStaging:n,isMaskEnabled:t.isMaskEnabled,tool:o,layer:a,shouldCropToBoundingBoxOnSave:i}}),{memoizeOptions:{resultEqualityCheck:dae}}),Vxe=function(){var e=wie(),t=kie(Hxe),n=t.isProcessing,r=t.isStaging,o=t.isMaskEnabled,i=t.layer,a=t.tool,s=t.shouldCropToBoundingBoxOnSave,l=Loe(),u=o8().t,c=xie().openUploader;_ce(["v"],(function(){d()}),{enabled:function(){return!r},preventDefault:!0},[]),_ce(["r"],(function(){h()}),{enabled:function(){return!0},preventDefault:!0},[l]),_ce(["shift+m"],(function(){p()}),{enabled:function(){return!r},preventDefault:!0},[l,n]),_ce(["shift+s"],(function(){v()}),{enabled:function(){return!r},preventDefault:!0},[l,n]),_ce(["meta+c","ctrl+c"],(function(){g()}),{enabled:function(){return!r},preventDefault:!0},[l,n]),_ce(["shift+d"],(function(){m()}),{enabled:function(){return!r},preventDefault:!0},[l,n]);var d=function(){return e(H3("move"))},f=Ike((function(){return h(!1)}),(function(){return h(!0)})),h=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=Loe();if(n){var r=n.getClientRect({skipTransform:!0});e(a3({contentRect:r,shouldScaleTo1:t}))}},p=function(){e(Ske({cropVisible:!1,shouldSetAsInitialImage:!0}))},v=function(){e(Ske({cropVisible:!s,cropToBoundingBox:s,shouldSaveToGallery:!0}))},g=function(){e(Ske({cropVisible:!s,cropToBoundingBox:s,shouldCopy:!0}))},m=function(){e(Ske({cropVisible:!s,cropToBoundingBox:s,shouldDownload:!0}))};return ro("div",{className:"inpainting-settings",children:[no(Mae,{tooltip:"".concat(u("unifiedcanvas:layer")," (Q)"),tooltipProps:{hasArrow:!0,placement:"top"},value:i,validValues:D5,onChange:function(t){var n=t.target.value;e(_3(n)),"mask"!==n||o||e(w3(!0))},isDisabled:r}),no(Dxe,{}),no(Fxe,{}),ro(k_,{isAttached:!0,children:[no(_ae,{"aria-label":"".concat(u("unifiedcanvas:move")," (V)"),tooltip:"".concat(u("unifiedcanvas:move")," (V)"),icon:no(Hce,{}),"data-selected":"move"===a||r,onClick:d}),no(_ae,{"aria-label":"".concat(u("unifiedcanvas:resetView")," (R)"),tooltip:"".concat(u("unifiedcanvas:resetView")," (R)"),icon:no(Yce,{}),onClick:f})]}),ro(k_,{isAttached:!0,children:[no(_ae,{"aria-label":"".concat(u("unifiedcanvas:mergeVisible")," (Shift+M)"),tooltip:"".concat(u("unifiedcanvas:mergeVisible")," (Shift+M)"),icon:no(sde,{}),onClick:p,isDisabled:r}),no(_ae,{"aria-label":"".concat(u("unifiedcanvas:saveToGallery")," (Shift+S)"),tooltip:"".concat(u("unifiedcanvas:saveToGallery")," (Shift+S)"),icon:no(mde,{}),onClick:v,isDisabled:r}),no(_ae,{"aria-label":"".concat(u("unifiedcanvas:copyToClipboard")," (Cmd/Ctrl+C)"),tooltip:"".concat(u("unifiedcanvas:copyToClipboard")," (Cmd/Ctrl+C)"),icon:no(qce,{}),onClick:g,isDisabled:r}),no(_ae,{"aria-label":"".concat(u("unifiedcanvas:downloadAsImage")," (Shift+D)"),tooltip:"".concat(u("unifiedcanvas:downloadAsImage")," (Shift+D)"),icon:no(Xce,{}),onClick:m,isDisabled:r})]}),ro(k_,{isAttached:!0,children:[no(yke,{}),no(gke,{})]}),ro(k_,{isAttached:!0,children:[no(_ae,{"aria-label":"".concat(u("common:upload")),tooltip:"".concat(u("common:upload")),icon:no(_de,{}),onClick:c,isDisabled:r}),no(_ae,{"aria-label":"".concat(u("unifiedcanvas:clearCanvas")),tooltip:"".concat(u("unifiedcanvas:clearCanvas")),icon:no(Sde,{}),onClick:function(){e(o3()),e(s3())},style:{backgroundColor:"var(--btn-delete-image)"},isDisabled:r})]}),no(k_,{isAttached:!0,children:no(jxe,{})})]})},Wxe=QX([Lde],(function(e){return{doesCanvasNeedScaling:e.doesCanvasNeedScaling}}),{memoizeOptions:{resultEqualityCheck:dae}}),Uxe=function(){var e=wie(),t=kie(Wxe).doesCanvasNeedScaling;return cr.useLayoutEffect((function(){e(m3(!0));var t=pke((function(){e(m3(!0))}),250);return window.addEventListener("resize",t),function(){return window.removeEventListener("resize",t)}}),[e]),no("div",{className:"workarea-single-view",children:no("div",{className:"workarea-split-view-left",children:ro("div",{className:"inpainting-main-area",children:[no(Vxe,{}),no("div",{className:"inpainting-canvas-area",children:no(t?ske:ike,{})})]})})})},Gxe=QX(Lde,(function(e){return{boundingBoxDimensions:e.boundingBoxDimensions,boundingBoxScale:e.boundingBoxScaleMethod}}),{memoizeOptions:{resultEqualityCheck:dae}}),qxe=function(){var e=wie(),t=kie(Gxe).boundingBoxDimensions,n=o8().t;return ro(yP,{direction:"column",gap:"1rem",children:[no(xfe,{label:n("parameters:width"),min:64,max:1024,step:64,value:t.width,onChange:function(n){e(c3(un(un({},t),{},{width:Math.floor(n)})))},sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:function(){e(c3(un(un({},t),{},{width:Math.floor(512)})))}}),no(xfe,{label:n("parameters:height"),min:64,max:1024,step:64,value:t.height,onChange:function(n){e(c3(un(un({},t),{},{height:Math.floor(n)})))},sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:function(){e(c3(un(un({},t),{},{height:Math.floor(512)})))}})]})},Yxe=QX([jye,wle,Lde],(function(e,t,n){var r=e.tileSize,o=e.infillMethod,i=t.infill_methods,a=n.boundingBoxScaleMethod;return{boundingBoxScale:a,scaledBoundingBoxDimensions:n.scaledBoundingBoxDimensions,tileSize:r,infillMethod:o,availableInfillMethods:i,isManual:"manual"===a}}),{memoizeOptions:{resultEqualityCheck:dae}}),Zxe=function(){var e=wie(),t=kie(Yxe),n=t.tileSize,r=t.infillMethod,o=t.availableInfillMethods,i=t.boundingBoxScale,a=t.isManual,s=t.scaledBoundingBoxDimensions,l=o8().t;return ro(yP,{direction:"column",gap:"1rem",children:[no(Mae,{label:l("parameters:scaleBeforeProcessing"),validValues:z5,value:i,onChange:function(t){e(d3(t.target.value))}}),no(xfe,{isInputDisabled:!a,isResetDisabled:!a,isSliderDisabled:!a,label:l("parameters:scaledWidth"),min:64,max:1024,step:64,value:s.width,onChange:function(t){e(W3(un(un({},s),{},{width:Math.floor(t)})))},sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:function(){e(W3(un(un({},s),{},{width:Math.floor(512)})))}}),no(xfe,{isInputDisabled:!a,isResetDisabled:!a,isSliderDisabled:!a,label:l("parameters:scaledHeight"),min:64,max:1024,step:64,value:s.height,onChange:function(t){e(W3(un(un({},s),{},{height:Math.floor(t)})))},sliderNumberInputProps:{max:4096},withSliderMarks:!0,withInput:!0,inputReadOnly:!0,withReset:!0,handleReset:function(){e(W3(un(un({},s),{},{height:Math.floor(512)})))}}),no(Mae,{label:l("parameters:infillMethod"),value:r,validValues:o,onChange:function(t){return e(A4(t.target.value))}}),no(xfe,{isInputDisabled:"tile"!==r,isResetDisabled:"tile"!==r,isSliderDisabled:"tile"!==r,sliderMarkRightOffset:-4,label:l("parameters:tileSize"),min:16,max:64,sliderNumberInputProps:{max:256},value:n,onChange:function(t){e($4(t))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:function(){e($4(32))}})]})};function Xxe(){var e=wie(),t=kie((function(e){return e.generation.seamBlur})),n=o8().t;return no(xfe,{sliderMarkRightOffset:-4,label:n("parameters:seamBlur"),min:0,max:64,sliderNumberInputProps:{max:512},value:t,onChange:function(t){e(j4(t))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:function(){e(j4(16))}})}function $xe(){var e=wie(),t=o8().t,n=kie((function(e){return e.generation.seamSize}));return no(xfe,{sliderMarkRightOffset:-6,label:t("parameters:seamSize"),min:1,max:256,sliderNumberInputProps:{max:512},value:n,onChange:function(t){e(F4(t))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:function(){return e(F4(96))}})}function Kxe(){var e=o8().t,t=kie((function(e){return e.generation.seamSteps})),n=wie();return no(xfe,{sliderMarkRightOffset:-4,label:e("parameters:seamSteps"),min:1,max:100,sliderNumberInputProps:{max:999},value:t,onChange:function(e){n(H4(e))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:function(){n(H4(30))}})}function Qxe(){var e=wie(),t=o8().t,n=kie((function(e){return e.generation.seamStrength}));return no(xfe,{sliderMarkRightOffset:-7,label:t("parameters:seamStrength"),min:.01,max:.99,step:.01,value:n,onChange:function(t){e(V4(t))},withInput:!0,withSliderMarks:!0,withReset:!0,handleReset:function(){e(V4(.7))}})}var Jxe=function(){return ro(yP,{direction:"column",gap:"1rem",children:[no($xe,{}),no(Xxe,{}),no(Qxe,{}),no(Kxe,{})]})};function eSe(){var e=o8().t,t={boundingBox:{header:"".concat(e("parameters:boundingBoxHeader")),feature:rye.BOUNDING_BOX,content:no(qxe,{})},seamCorrection:{header:"".concat(e("parameters:seamCorrectionHeader")),feature:rye.SEAM_CORRECTION,content:no(Jxe,{})},infillAndScaling:{header:"".concat(e("parameters:infillScalingHeader")),feature:rye.INFILL_AND_SCALING,content:no(Zxe,{})},seed:{header:"".concat(e("parameters:seed")),feature:rye.SEED,content:no(gye,{})},variations:{header:"".concat(e("parameters:variations")),feature:rye.VARIATIONS,content:no(xye,{}),additionalHeaderComponents:no(yye,{})}};return ro(Xye,{children:[ro(yP,{flexDir:"column",rowGap:"0.5rem",children:[no(qye,{}),no(Uye,{})]}),no(Wye,{}),no(Aye,{}),no(lye,{label:e("parameters:img2imgStrength"),styleClass:"main-settings-block image-to-image-strength-main-option"}),no(Nye,{accordionInfo:t})]})}function tSe(){var e=kie((function(e){return e.ui.shouldUseCanvasBetaLayout}));return no($me,{optionsPanel:no(eSe,{}),styleClass:"inpainting-workarea-overrides",children:no(e?Rxe:Uxe,{})})}var nSe={txt2img:{title:no(xae,{fill:"black",boxSize:"2.5rem"}),workarea:no(obe,{}),tooltip:"Text To Image"},img2img:{title:no(bae,{fill:"black",boxSize:"2.5rem"}),workarea:no(Kye,{}),tooltip:"Image To Image"},unifiedCanvas:{title:no(Cae,{fill:"black",boxSize:"2.5rem"}),workarea:no(tSe,{}),tooltip:"Unified Canvas"},nodes:{title:no(wae,{fill:"black",boxSize:"2.5rem"}),workarea:no(gae,{}),tooltip:"Nodes"},postprocess:{title:no(kae,{fill:"black",boxSize:"2.5rem"}),workarea:no(mae,{}),tooltip:"Post Processing"},training:{title:no(Sae,{fill:"black",boxSize:"2.5rem"}),workarea:no(yae,{}),tooltip:"Training"}};function rSe(){nSe.txt2img.tooltip=A7.t("common:text2img"),nSe.img2img.tooltip=A7.t("common:img2img"),nSe.unifiedCanvas.tooltip=A7.t("common:unifiedCanvas"),nSe.nodes.tooltip=A7.t("common:nodes"),nSe.postprocess.tooltip=A7.t("common:postProcessing"),nSe.training.tooltip=A7.t("common:training")}function oSe(){var e=kie(hae),t=kie((function(e){return e.lightbox.isLightboxOpen}));!function(e){var t=o8().i18n,n=localStorage.getItem("i18nextLng");qr.useEffect((function(){e()}),[e]),qr.useEffect((function(){t.on("languageChanged",(function(){e()}))}),[e,t,n])}(rSe);var n=wie();_ce("1",(function(){n(z8(0))})),_ce("2",(function(){n(z8(1))})),_ce("3",(function(){n(z8(2))})),_ce("4",(function(){n(z8(3))})),_ce("5",(function(){n(z8(4))})),_ce("6",(function(){n(z8(5))})),_ce("z",(function(){n(p4(!t))}),[t]);var r,o;return ro(Uq,{isLazy:!0,className:"app-tabs",variant:"unstyled",defaultIndex:e,index:e,onChange:function(e){n(z8(e))},children:[no("div",{className:"app-tabs-list",children:(o=[],Object.keys(nSe).forEach((function(e){o.push(no(kY,{hasArrow:!0,label:nSe[e].tooltip,placement:"right",children:no(Xq,{children:nSe[e].title})},e))})),o)}),no(Zq,{className:"app-tabs-panels",children:t?no(qme,{}):(r=[],Object.keys(nSe).forEach((function(e){r.push(no(Yq,{className:"app-tabs-panel",children:nSe[e].workarea},e))})),r)})]})}var iSe=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 aSe(e,t){var n=function(e){var t=e.name;if(t&&-1!==t.lastIndexOf(".")&&!e.type){var n=t.split(".").pop().toLowerCase(),r=iSe.get(n);r&&Object.defineProperty(e,"type",{value:r,writable:!1,configurable:!1,enumerable:!0})}return e}(e);if("string"!=typeof n.path){var r=e.webkitRelativePath;Object.defineProperty(n,"path",{value:"string"==typeof t?t:"string"==typeof r&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}var sSe=[".DS_Store","Thumbs.db"];function lSe(e){return"object"===kn(e)&&null!==e}function uSe(e){return hSe(e.target.files).map((function(e){return aSe(e)}))}function cSe(e){return XS(this,void 0,void 0,(function(){return $S(this,(function(t){switch(t.label){case 0:return[4,Promise.all(e.map((function(e){return e.getFile()})))];case 1:return[2,t.sent().map((function(e){return aSe(e)}))]}}))}))}function dSe(e,t){return XS(this,void 0,void 0,(function(){var n;return $S(this,(function(r){switch(r.label){case 0:return e.items?(n=hSe(e.items).filter((function(e){return"file"===e.kind})),"drop"!==t?[2,n]:[4,Promise.all(n.map(pSe))]):[3,2];case 1:return[2,fSe(vSe(r.sent()))];case 2:return[2,fSe(hSe(e.files).map((function(e){return aSe(e)})))]}}))}))}function fSe(e){return e.filter((function(e){return-1===sSe.indexOf(e.name)}))}function hSe(e){if(null===e)return[];for(var t=[],n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nn)return[!1,LSe(n)];if(e.sizen)return[!1,LSe(n)]}return[!0,null]}function ISe(e){return null!=e}function RSe(e){var t=e.files,n=e.accept,r=e.minSize,o=e.maxSize,i=e.multiple,a=e.maxFiles,s=e.validator;return!(!i&&t.length>1||i&&a>=1&&t.length>a)&&t.every((function(e){var t=CSe(MSe(e,n),1)[0],i=CSe(TSe(e,r,o),1)[0],a=s?s(e):null;return t&&i&&!a}))}function NSe(e){return"function"==typeof e.isPropagationStopped?e.isPropagationStopped():void 0!==e.cancelBubble&&e.cancelBubble}function DSe(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,(function(e){return"Files"===e||"application/x-moz-file"===e})):!!e.target&&!!e.target.files}function zSe(e){e.preventDefault()}function jSe(e){return-1!==e.indexOf("MSIE")||-1!==e.indexOf("Trident/")}function BSe(e){return-1!==e.indexOf("Edge/")}function FSe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.navigator.userAgent;return jSe(e)||BSe(e)}function HSe(){for(var e=arguments.length,t=new Array(e),n=0;n1?n-1:0),o=1;oe.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var sCe=cr.forwardRef((function(e,t){var n=e.children,r=cCe(aCe(e,XSe)),o=r.open,i=aCe(r,$Se);return cr.useImperativeHandle(t,(function(){return{open:o}}),[o]),qr.createElement(cr.Fragment,null,n(oCe(oCe({},i),{},{open:o})))}));sCe.displayName="Dropzone";var lCe={disabled:!1,getFilesFromEvent:function(e){return XS(this,void 0,void 0,(function(){return $S(this,(function(t){return lSe(e)&&function(e){return lSe(e)}(e.dataTransfer)?[2,dSe(e.dataTransfer,e.type)]:function(e){return lSe(e)&&lSe(e.target)}(e)?[2,uSe(e)]:Array.isArray(e)&&e.every((function(e){return"getFile"in e&&"function"==typeof e.getFile}))?[2,cSe(e)]:[2,[]]}))}))},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};sCe.defaultProps=lCe,sCe.propTypes={children:_H.func,accept:_H.objectOf(_H.arrayOf(_H.string)),multiple:_H.bool,preventDropOnDocument:_H.bool,noClick:_H.bool,noKeyboard:_H.bool,noDrag:_H.bool,noDragEventsBubbling:_H.bool,minSize:_H.number,maxSize:_H.number,maxFiles:_H.number,disabled:_H.bool,getFilesFromEvent:_H.func,onFileDialogCancel:_H.func,onFileDialogOpen:_H.func,useFsAccessApi:_H.bool,autoFocus:_H.bool,onDragEnter:_H.func,onDragLeave:_H.func,onDragOver:_H.func,onDrop:_H.func,onDropAccepted:_H.func,onDropRejected:_H.func,onError:_H.func,validator:_H.func};var uCe={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function cCe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=oCe(oCe({},lCe),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,i=t.maxSize,a=t.minSize,s=t.multiple,l=t.maxFiles,u=t.onDragEnter,c=t.onDragLeave,d=t.onDragOver,f=t.onDrop,h=t.onDropAccepted,p=t.onDropRejected,v=t.onFileDialogCancel,g=t.onFileDialogOpen,m=t.useFsAccessApi,y=t.autoFocus,b=t.preventDropOnDocument,w=t.noClick,k=t.noKeyboard,x=t.noDrag,S=t.noDragEventsBubbling,C=t.onError,_=t.validator,E=cr.useMemo((function(){return USe(n)}),[n]),P=cr.useMemo((function(){return WSe(n)}),[n]),L=cr.useMemo((function(){return"function"==typeof g?g:fCe}),[g]),O=cr.useMemo((function(){return"function"==typeof v?v:fCe}),[v]),A=cr.useRef(null),M=cr.useRef(null),T=cr.useReducer(dCe,uCe),I=eCe(T,2),R=I[0],N=I[1],D=R.isFocused,z=R.isFileDialogActive,j=cr.useRef("undefined"!=typeof window&&window.isSecureContext&&m&&VSe()),B=function(){!j.current&&z&&setTimeout((function(){M.current&&(M.current.files.length||(N({type:"closeDialog"}),O()))}),300)};cr.useEffect((function(){return window.addEventListener("focus",B,!1),function(){window.removeEventListener("focus",B,!1)}}),[M,z,O,j]);var F=cr.useRef([]),H=function(e){A.current&&A.current.contains(e.target)||(e.preventDefault(),F.current=[])};cr.useEffect((function(){return b&&(document.addEventListener("dragover",zSe,!1),document.addEventListener("drop",H,!1)),function(){b&&(document.removeEventListener("dragover",zSe),document.removeEventListener("drop",H))}}),[A,b]),cr.useEffect((function(){return!r&&y&&A.current&&A.current.focus(),function(){}}),[A,y,r]);var V=cr.useCallback((function(e){C?C(e):console.error(e)}),[C]),W=cr.useCallback((function(e){e.preventDefault(),e.persist(),ne(e),F.current=[].concat(JSe(F.current),[e.target]),DSe(e)&&Promise.resolve(o(e)).then((function(t){if(!NSe(e)||S){var n=t.length,r=n>0&&RSe({files:t,accept:E,minSize:a,maxSize:i,multiple:s,maxFiles:l,validator:_});N({isDragAccept:r,isDragReject:n>0&&!r,isDragActive:!0,type:"setDraggedFiles"}),u&&u(e)}})).catch((function(e){return V(e)}))}),[o,u,V,S,E,a,i,s,l,_]),U=cr.useCallback((function(e){e.preventDefault(),e.persist(),ne(e);var t=DSe(e);if(t&&e.dataTransfer)try{e.dataTransfer.dropEffect="copy"}catch(n){}return t&&d&&d(e),!1}),[d,S]),G=cr.useCallback((function(e){e.preventDefault(),e.persist(),ne(e);var t=F.current.filter((function(e){return A.current&&A.current.contains(e)})),n=t.indexOf(e.target);-1!==n&&t.splice(n,1),F.current=t,t.length>0||(N({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),DSe(e)&&c&&c(e))}),[A,c,S]),q=cr.useCallback((function(e,t){var n=[],r=[];e.forEach((function(e){var t=eCe(MSe(e,E),2),o=t[0],s=t[1],l=eCe(TSe(e,a,i),2),u=l[0],c=l[1],d=_?_(e):null;if(o&&u&&!d)n.push(e);else{var f=[s,c];d&&(f=f.concat(d)),r.push({file:e,errors:f.filter((function(e){return e}))})}})),(!s&&n.length>1||s&&l>=1&&n.length>l)&&(n.forEach((function(e){r.push({file:e,errors:[ASe]})})),n.splice(0)),N({acceptedFiles:n,fileRejections:r,type:"setFiles"}),f&&f(n,r,t),r.length>0&&p&&p(r,t),n.length>0&&h&&h(n,t)}),[N,s,E,a,i,l,f,h,p,_]),Y=cr.useCallback((function(e){e.preventDefault(),e.persist(),ne(e),F.current=[],DSe(e)&&Promise.resolve(o(e)).then((function(t){NSe(e)&&!S||q(t,e)})).catch((function(e){return V(e)})),N({type:"reset"})}),[o,q,V,S]),Z=cr.useCallback((function(){if(j.current){N({type:"openDialog"}),L();var e={multiple:s,types:P};window.showOpenFilePicker(e).then((function(e){return o(e)})).then((function(e){q(e,null),N({type:"closeDialog"})})).catch((function(e){GSe(e)?(O(e),N({type:"closeDialog"})):qSe(e)?(j.current=!1,M.current?(M.current.value=null,M.current.click()):V(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 was provided."))):V(e)}))}else M.current&&(N({type:"openDialog"}),L(),M.current.value=null,M.current.click())}),[N,L,O,m,q,V,P,s]),X=cr.useCallback((function(e){A.current&&A.current.isEqualNode(e.target)&&(" "!==e.key&&"Enter"!==e.key&&32!==e.keyCode&&13!==e.keyCode||(e.preventDefault(),Z()))}),[A,Z]),$=cr.useCallback((function(){N({type:"focus"})}),[]),K=cr.useCallback((function(){N({type:"blur"})}),[]),Q=cr.useCallback((function(){w||(FSe()?setTimeout(Z,0):Z())}),[w,Z]),J=function(e){return r?null:e},ee=function(e){return k?null:J(e)},te=function(e){return x?null:J(e)},ne=function(e){S&&e.stopPropagation()},re=cr.useMemo((function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.refKey,n=void 0===t?"ref":t,o=e.role,i=e.onKeyDown,a=e.onFocus,s=e.onBlur,l=e.onClick,u=e.onDragEnter,c=e.onDragOver,d=e.onDragLeave,f=e.onDrop,h=aCe(e,KSe);return oCe(oCe(iCe({onKeyDown:ee(HSe(i,X)),onFocus:ee(HSe(a,$)),onBlur:ee(HSe(s,K)),onClick:J(HSe(l,Q)),onDragEnter:te(HSe(u,W)),onDragOver:te(HSe(c,U)),onDragLeave:te(HSe(d,G)),onDrop:te(HSe(f,Y)),role:"string"==typeof o&&""!==o?o:"presentation"},n,A),r||k?{}:{tabIndex:0}),h)}}),[A,X,$,K,Q,W,U,G,Y,k,x,r]),oe=cr.useCallback((function(e){e.stopPropagation()}),[]),ie=cr.useMemo((function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.refKey,n=void 0===t?"ref":t,r=e.onChange,o=e.onClick,i=aCe(e,QSe),a=iCe({accept:E,multiple:s,type:"file",style:{display:"none"},onChange:J(HSe(r,Y)),onClick:J(HSe(o,oe)),tabIndex:-1},n,M);return oCe(oCe({},a),i)}}),[M,n,s,Y,r]);return oCe(oCe({},R),{},{isFocused:D&&!r,getRootProps:re,getInputProps:ie,rootRef:A,inputRef:M,open:J(Z)})}function dCe(e,t){switch(t.type){case"focus":return oCe(oCe({},e),{},{isFocused:!0});case"blur":return oCe(oCe({},e),{},{isFocused:!1});case"openDialog":return oCe(oCe({},uCe),{},{isFileDialogActive:!0});case"closeDialog":return oCe(oCe({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return oCe(oCe({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return oCe(oCe({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return oCe({},uCe);default:return e}}function fCe(){}var hCe=function(e){var t=e.isDragAccept,n=e.isDragReject,r=e.overlaySecondaryText,o=e.setIsHandlingUpload;return _ce("esc",(function(){o(!1)})),ro("div",{className:"dropzone-container",children:[t&&no("div",{className:"dropzone-overlay is-drag-accept",children:ro(xP,{size:"lg",children:["Upload Image",r]})}),n&&ro("div",{className:"dropzone-overlay is-drag-reject",children:[no(xP,{size:"lg",children:"Invalid Upload"}),no(xP,{size:"md",children:"Must be single JPEG or PNG image"})]})]})},pCe=function(e){var t=e.children,n=wie(),r=kie(fae),o=cY({}),i=o8().t,a=yn(cr.useState(!1),2),s=a[0],l=a[1],u=xie().setOpenUploader,c=cr.useCallback((function(e){l(!0);var t=e.errors.reduce((function(e,t){return"".concat(e,"\n").concat(t.message)}),"");o({title:i("toast:uploadFailed"),description:t,status:"error",isClosable:!0})}),[i,o]),d=cr.useCallback(function(){var e=qt(Ut().mark((function e(t){return Ut().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n(vae({imageFile:t}));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[n]),f=cCe({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},noClick:!0,onDrop:cr.useCallback((function(e,t){t.forEach((function(e){c(e)})),e.forEach((function(e){d(e)}))}),[d,c]),onDragOver:function(){return l(!0)},maxFiles:1}),h=f.getRootProps,p=f.getInputProps,v=f.isDragAccept,g=f.isDragReject,m=f.isDragActive,y=f.open;u(y),cr.useEffect((function(){var e=function(e){var t,r=null===(t=e.clipboardData)||void 0===t?void 0:t.items;if(r){var a,s=[],l=xn(r);try{for(l.s();!(a=l.n()).done;){var u=a.value;"file"===u.kind&&["image/png","image/jpg"].includes(u.type)&&s.push(u)}}catch(COe){l.e(COe)}finally{l.f()}if(s.length)if(e.stopImmediatePropagation(),s.length>1)o({description:i("toast:uploadFailedMultipleImagesDesc"),status:"error",isClosable:!0});else{var c=s[0].getAsFile();c?n(vae({imageFile:c})):o({description:i("toast:uploadFailedUnableToLoadDesc"),status:"error",isClosable:!0})}}};return document.addEventListener("paste",e),function(){document.removeEventListener("paste",e)}}),[i,n,o,r]);var b=["img2img","unifiedCanvas"].includes(r)?" to ".concat(nSe[r].tooltip):"";return no(bie.Provider,{value:y,children:ro("div",un(un({},h({style:{}})),{},{onKeyDown:function(e){e.key},children:[no("input",un({},p())),t,m&&s&&no(hCe,{isDragAccept:v,isDragReject:g,overlaySecondaryText:b,setIsHandlingUpload:l})]}))})},vCe=QX(wle,(function(e){return e.log}),{memoizeOptions:{resultEqualityCheck:function(e,t){return e.length===t.length}}}),gCe=QX(wle,(function(e){return{shouldShowLogViewer:e.shouldShowLogViewer,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}}),{memoizeOptions:{resultEqualityCheck:dae}}),mCe=function(){var e=wie(),t=kie(vCe),n=kie(gCe),r=n.shouldShowLogViewer,o=n.hasError,i=n.wasErrorSeen,a=yn(cr.useState(!0),2),s=a[0],l=a[1],u=cr.useRef(null);cr.useLayoutEffect((function(){null!==u.current&&s&&(u.current.scrollTop=u.current.scrollHeight)}),[s,t,r]);_ce("`",(function(){e(c8(!r))}),[r]),_ce("esc",(function(){e(c8(!1))}));return ro(to,{children:[r&&no(hfe,{defaultSize:{width:"100%",height:200},style:{display:"flex",position:"fixed",left:0,bottom:0,zIndex:9999},maxHeight:"90vh",children:no("div",{className:"console",ref:u,onScroll:function(){u.current&&s&&u.current.scrollTop-1},r_e.prototype.set=function(e,t){var n=this.__data__,r=t_e(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function i_e(e){if(!o_e(e))return!1;var t=UCe(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var a_e=DCe["__core-js_shared__"],s_e=function(){var e=/[^.]+$/.exec(a_e&&a_e.keys&&a_e.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();var l_e=Function.prototype.toString;function u_e(e){if(null!=e){try{return l_e.call(e)}catch(Dhe){}try{return e+""}catch(Dhe){}}return""}var c_e=/^\[object .+?Constructor\]$/,d_e=Function.prototype,f_e=Object.prototype,h_e=d_e.toString,p_e=f_e.hasOwnProperty,v_e=RegExp("^"+h_e.call(p_e).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function g_e(e){return!(!o_e(e)||(t=e,s_e&&s_e in t))&&(i_e(e)?v_e:c_e).test(u_e(e));var t}function m_e(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return g_e(n)?n:void 0}var y_e=m_e(DCe,"Map"),b_e=m_e(Object,"create");var w_e=Object.prototype.hasOwnProperty;var k_e=Object.prototype.hasOwnProperty;function x_e(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991}var G_e={};function q_e(e){return function(t){return e(t)}}G_e["[object Float32Array]"]=G_e["[object Float64Array]"]=G_e["[object Int8Array]"]=G_e["[object Int16Array]"]=G_e["[object Int32Array]"]=G_e["[object Uint8Array]"]=G_e["[object Uint8ClampedArray]"]=G_e["[object Uint16Array]"]=G_e["[object Uint32Array]"]=!0,G_e["[object Arguments]"]=G_e["[object Array]"]=G_e["[object ArrayBuffer]"]=G_e["[object Boolean]"]=G_e["[object DataView]"]=G_e["[object Date]"]=G_e["[object Error]"]=G_e["[object Function]"]=G_e["[object Map]"]=G_e["[object Number]"]=G_e["[object Object]"]=G_e["[object RegExp]"]=G_e["[object Set]"]=G_e["[object String]"]=G_e["[object WeakMap]"]=!1;var Y_e="object"==kn(Gt)&&Gt&&!Gt.nodeType&&Gt,Z_e=Y_e&&"object"==kn(Zt)&&Zt&&!Zt.nodeType&&Zt,X_e=Z_e&&Z_e.exports===Y_e&&RCe.process,$_e=function(){try{var e=Z_e&&Z_e.require&&Z_e.require("util").types;return e||X_e&&X_e.binding&&X_e.binding("util")}catch(Dhe){}}(),K_e=$_e,Q_e=K_e&&K_e.isTypedArray,J_e=Q_e?q_e(Q_e):function(e){return YCe(e)&&U_e(e.length)&&!!G_e[UCe(e)]},eEe=J_e,tEe=Object.prototype.hasOwnProperty;function nEe(e,t){var n=z_e(e),r=!n&&D_e(e),o=!n&&!r&&H_e(e),i=!n&&!r&&!o&&eEe(e),a=n||r||o||i,s=a?function(e,t){for(var n=-1,r=Array(e);++n=0||(o[n]=e[n]);return o}function _Pe(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var EPe=function(e){return Array.isArray(e)&&0===e.length},PPe=function(e){return"function"==typeof e},LPe=function(e){return null!==e&&"object"===kn(e)},OPe=function(e){return String(Math.floor(Number(e)))===e},APe=function(e){return"[object String]"===Object.prototype.toString.call(e)},MPe=function(e){return 0===cr.Children.count(e)},TPe=function(e){return LPe(e)&&PPe(e.then)};function IPe(e,t,n,r){void 0===r&&(r=0);for(var o=kPe(t);e&&r=0?[]:{}}}return(0===i?e:o)[a[i]]===n?e:(void 0===n?delete o[a[i]]:o[a[i]]=n,0===i&&void 0===n&&delete r[a[i]],r)}function NPe(e,t,n,r){void 0===n&&(n=new WeakMap),void 0===r&&(r={});for(var o=0,i=Object.keys(e);o=n.length)break;i=n[o++]}else{if((o=n.next()).done)break;i=o.value}var a=i;IPe(t,a.path)||(t=RPe(t,a.path,a.message))}}return t}(n)):t(n)}))}))}),[f.validationSchema]),C=cr.useCallback((function(e,t){return new Promise((function(n){return n(y.current[e].validate(t))}))}),[]),_=cr.useCallback((function(e){var t=Object.keys(y.current).filter((function(e){return PPe(y.current[e].validate)})),n=t.length>0?t.map((function(t){return C(t,IPe(e,t))})):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(n).then((function(e){return e.reduce((function(e,n,r){return"DO_NOT_DELETE_YOU_WILL_BE_FIRED"===n||n&&(e=RPe(e,t[r],n)),e}),{})}))}),[C]),E=cr.useCallback((function(e){return Promise.all([_(e),f.validationSchema?S(e):{},f.validate?x(e):{}]).then((function(e){var t=e[0],n=e[1],r=e[2];return ICe.all([t,n,r],{arrayMerge:GPe})}))}),[f.validate,f.validationSchema,_,x,S]),P=YPe((function(e){return void 0===e&&(e=w.values),k({type:"SET_ISVALIDATING",payload:!0}),E(e).then((function(e){return m.current&&(k({type:"SET_ISVALIDATING",payload:!1}),k({type:"SET_ERRORS",payload:e})),e}))}));cr.useEffect((function(){a&&!0===m.current&&PCe(h.current,f.initialValues)&&P(h.current)}),[a,P]);var L=cr.useCallback((function(e){var t=e&&e.values?e.values:h.current,n=e&&e.errors?e.errors:p.current?p.current:f.initialErrors||{},r=e&&e.touched?e.touched:v.current?v.current:f.initialTouched||{},o=e&&e.status?e.status:g.current?g.current:f.initialStatus;h.current=t,p.current=n,v.current=r,g.current=o;var i=function(){k({type:"RESET_FORM",payload:{isSubmitting:!!e&&!!e.isSubmitting,errors:n,touched:r,status:o,values:t,isValidating:!!e&&!!e.isValidating,submitCount:e&&e.submitCount&&"number"==typeof e.submitCount?e.submitCount:0}})};if(f.onReset){var a=f.onReset(w.values,Y);TPe(a)?a.then(i):i()}else i()}),[f.initialErrors,f.initialStatus,f.initialTouched]);cr.useEffect((function(){!0!==m.current||PCe(h.current,f.initialValues)||(u&&(h.current=f.initialValues,L()),a&&P(h.current))}),[u,f.initialValues,L,a,P]),cr.useEffect((function(){u&&!0===m.current&&!PCe(p.current,f.initialErrors)&&(p.current=f.initialErrors||FPe,k({type:"SET_ERRORS",payload:f.initialErrors||FPe}))}),[u,f.initialErrors]),cr.useEffect((function(){u&&!0===m.current&&!PCe(v.current,f.initialTouched)&&(v.current=f.initialTouched||HPe,k({type:"SET_TOUCHED",payload:f.initialTouched||HPe}))}),[u,f.initialTouched]),cr.useEffect((function(){u&&!0===m.current&&!PCe(g.current,f.initialStatus)&&(g.current=f.initialStatus,k({type:"SET_STATUS",payload:f.initialStatus}))}),[u,f.initialStatus,f.initialTouched]);var O=YPe((function(e){if(y.current[e]&&PPe(y.current[e].validate)){var t=IPe(w.values,e),n=y.current[e].validate(t);return TPe(n)?(k({type:"SET_ISVALIDATING",payload:!0}),n.then((function(e){return e})).then((function(t){k({type:"SET_FIELD_ERROR",payload:{field:e,value:t}}),k({type:"SET_ISVALIDATING",payload:!1})}))):(k({type:"SET_FIELD_ERROR",payload:{field:e,value:n}}),Promise.resolve(n))}return f.validationSchema?(k({type:"SET_ISVALIDATING",payload:!0}),S(w.values,e).then((function(e){return e})).then((function(t){k({type:"SET_FIELD_ERROR",payload:{field:e,value:t[e]}}),k({type:"SET_ISVALIDATING",payload:!1})}))):Promise.resolve()})),A=cr.useCallback((function(e,t){var n=t.validate;y.current[e]={validate:n}}),[]),M=cr.useCallback((function(e){delete y.current[e]}),[]),T=YPe((function(e,t){return k({type:"SET_TOUCHED",payload:e}),(void 0===t?o:t)?P(w.values):Promise.resolve()})),I=cr.useCallback((function(e){k({type:"SET_ERRORS",payload:e})}),[]),R=YPe((function(e,t){var r=PPe(e)?e(w.values):e;return k({type:"SET_VALUES",payload:r}),(void 0===t?n:t)?P(r):Promise.resolve()})),N=cr.useCallback((function(e,t){k({type:"SET_FIELD_ERROR",payload:{field:e,value:t}})}),[]),D=YPe((function(e,t,r){return k({type:"SET_FIELD_VALUE",payload:{field:e,value:t}}),(void 0===r?n:r)?P(RPe(w.values,e,t)):Promise.resolve()})),z=cr.useCallback((function(e,t){var n,r=t,o=e;if(!APe(e)){e.persist&&e.persist();var i=e.target?e.target:e.currentTarget,a=i.type,s=i.name,l=i.id,u=i.value,c=i.checked,d=(i.outerHTML,i.options),f=i.multiple;r=t||(s||l),o=/number|range/.test(a)?(n=parseFloat(u),isNaN(n)?"":n):/checkbox/.test(a)?function(e,t,n){if("boolean"==typeof e)return Boolean(t);var r=[],o=!1,i=-1;if(Array.isArray(e))r=e,o=(i=e.indexOf(n))>=0;else if(!n||"true"==n||"false"==n)return Boolean(t);if(t&&n&&!o)return r.concat(n);if(!o)return r;return r.slice(0,i).concat(r.slice(i+1))}(IPe(w.values,r),c,u):d&&f?function(e){return Array.from(e).filter((function(e){return e.selected})).map((function(e){return e.value}))}(d):u}r&&D(r,o)}),[D,w.values]),j=YPe((function(e){if(APe(e))return function(t){return z(t,e)};z(e)})),B=YPe((function(e,t,n){return void 0===t&&(t=!0),k({type:"SET_FIELD_TOUCHED",payload:{field:e,value:t}}),(void 0===n?o:n)?P(w.values):Promise.resolve()})),F=cr.useCallback((function(e,t){e.persist&&e.persist();var n=e.target,r=n.name,o=n.id,i=(n.outerHTML,t||(r||o));B(i,!0)}),[B]),H=YPe((function(e){if(APe(e))return function(t){return F(t,e)};F(e)})),V=cr.useCallback((function(e){PPe(e)?k({type:"SET_FORMIK_STATE",payload:e}):k({type:"SET_FORMIK_STATE",payload:function(){return e}})}),[]),W=cr.useCallback((function(e){k({type:"SET_STATUS",payload:e})}),[]),U=cr.useCallback((function(e){k({type:"SET_ISSUBMITTING",payload:e})}),[]),G=YPe((function(){return k({type:"SUBMIT_ATTEMPT"}),P().then((function(e){var t=e instanceof Error;if(!t&&0===Object.keys(e).length){var n;try{if(void 0===(n=Z()))return}catch(r){throw r}return Promise.resolve(n).then((function(e){return m.current&&k({type:"SUBMIT_SUCCESS"}),e})).catch((function(e){if(m.current)throw k({type:"SUBMIT_FAILURE"}),e}))}if(m.current&&(k({type:"SUBMIT_FAILURE"}),t))throw e}))})),q=YPe((function(e){e&&e.preventDefault&&PPe(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&PPe(e.stopPropagation)&&e.stopPropagation(),G().catch((function(e){console.warn("Warning: An unhandled error was caught from submitForm()",e)}))})),Y={resetForm:L,validateForm:P,validateField:O,setErrors:I,setFieldError:N,setFieldTouched:B,setFieldValue:D,setStatus:W,setSubmitting:U,setTouched:T,setValues:R,setFormikState:V,submitForm:G},Z=YPe((function(){return c(w.values,Y)})),X=YPe((function(e){e&&e.preventDefault&&PPe(e.preventDefault)&&e.preventDefault(),e&&e.stopPropagation&&PPe(e.stopPropagation)&&e.stopPropagation(),L()})),$=cr.useCallback((function(e){return{value:IPe(w.values,e),error:IPe(w.errors,e),touched:!!IPe(w.touched,e),initialValue:IPe(h.current,e),initialTouched:!!IPe(v.current,e),initialError:IPe(p.current,e)}}),[w.errors,w.touched,w.values]),K=cr.useCallback((function(e){return{setValue:function(t,n){return D(e,t,n)},setTouched:function(t,n){return B(e,t,n)},setError:function(t){return N(e,t)}}}),[D,B,N]),Q=cr.useCallback((function(e){var t=LPe(e),n=t?e.name:e,r=IPe(w.values,n),o={name:n,value:r,onChange:j,onBlur:H};if(t){var i=e.type,a=e.value,s=e.as,l=e.multiple;"checkbox"===i?void 0===a?o.checked=!!r:(o.checked=!(!Array.isArray(r)||!~r.indexOf(a)),o.value=a):"radio"===i?(o.checked=r===a,o.value=a):"select"===s&&l&&(o.value=o.value||[],o.multiple=!0)}return o}),[H,j,w.values]),J=cr.useMemo((function(){return!PCe(h.current,w.values)}),[h.current,w.values]),ee=cr.useMemo((function(){return void 0!==s?J?w.errors&&0===Object.keys(w.errors).length:!1!==s&&PPe(s)?s(f):s:w.errors&&0===Object.keys(w.errors).length}),[s,J,w.errors,f]);return SPe({},w,{initialValues:h.current,initialErrors:p.current,initialTouched:v.current,initialStatus:g.current,handleBlur:H,handleChange:j,handleReset:X,handleSubmit:q,resetForm:L,setErrors:I,setFormikState:V,setFieldTouched:B,setFieldValue:D,setFieldError:N,setStatus:W,setSubmitting:U,setTouched:T,setValues:R,submitForm:G,validateForm:P,validateField:O,isValid:ee,dirty:J,unregisterField:M,registerField:A,getFieldProps:Q,getFieldMeta:$,getFieldHelpers:K,validateOnBlur:o,validateOnChange:n,validateOnMount:a})}function WPe(e){var t=VPe(e),n=e.component,r=e.children,o=e.render,i=e.innerRef;return cr.useImperativeHandle(i,(function(){return t})),cr.createElement(zPe,{value:t},n?cr.createElement(n,t):o?o(t):r?PPe(r)?r(t):MPe(r)?null:cr.Children.only(r):null)}function UPe(e){var t=Array.isArray(e)?[]:{};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=String(n);!0===Array.isArray(e[r])?t[r]=e[r].map((function(e){return!0===Array.isArray(e)||JCe(e)?UPe(e):""!==e?e:void 0})):JCe(e[r])?t[r]=UPe(e[r]):t[r]=""!==e[r]?e[r]:void 0}return t}function GPe(e,t,n){var r=e.slice();return t.forEach((function(t,o){if(void 0===r[o]){var i=!1!==n.clone&&n.isMergeableObject(t);r[o]=i?ICe(Array.isArray(t)?[]:{},t,n):t}else n.isMergeableObject(t)?r[o]=ICe(e[o],t,n):-1===e.indexOf(t)&&r.push(t)})),r}var qPe="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?cr.useLayoutEffect:cr.useEffect;function YPe(e){var t=cr.useRef(e);return qPe((function(){t.current=e})),cr.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;re?t:e}),0);return Array.from(SPe({},e,{length:t+1}))}return[]},KPe=function(e){var t,n;function r(t){var n;return(n=e.call(this,t)||this).updateArrayField=function(e,t,r){var o=n.props,i=o.name;(0,o.formik.setFormikState)((function(n){var o="function"==typeof r?r:e,a="function"==typeof t?t:e,s=RPe(n.values,i,e(IPe(n.values,i))),l=r?o(IPe(n.errors,i)):void 0,u=t?a(IPe(n.touched,i)):void 0;return EPe(l)&&(l=void 0),EPe(u)&&(u=void 0),SPe({},n,{values:s,errors:r?RPe(n.errors,i,l):n.errors,touched:t?RPe(n.touched,i,u):n.touched})}))},n.push=function(e){return n.updateArrayField((function(t){return[].concat($Pe(t),[xPe(e)])}),!1,!1)},n.handlePush=function(e){return function(){return n.push(e)}},n.swap=function(e,t){return n.updateArrayField((function(n){return function(e,t,n){var r=$Pe(e),o=r[t];return r[t]=r[n],r[n]=o,r}(n,e,t)}),!0,!0)},n.handleSwap=function(e,t){return function(){return n.swap(e,t)}},n.move=function(e,t){return n.updateArrayField((function(n){return function(e,t,n){var r=$Pe(e),o=r[t];return r.splice(t,1),r.splice(n,0,o),r}(n,e,t)}),!0,!0)},n.handleMove=function(e,t){return function(){return n.move(e,t)}},n.insert=function(e,t){return n.updateArrayField((function(n){return XPe(n,e,t)}),(function(t){return XPe(t,e,null)}),(function(t){return XPe(t,e,null)}))},n.handleInsert=function(e,t){return function(){return n.insert(e,t)}},n.replace=function(e,t){return n.updateArrayField((function(n){return function(e,t,n){var r=$Pe(e);return r[t]=n,r}(n,e,t)}),!1,!1)},n.handleReplace=function(e,t){return function(){return n.replace(e,t)}},n.unshift=function(e){var t=-1;return n.updateArrayField((function(n){var r=n?[e].concat(n):[e];return t<0&&(t=r.length),r}),(function(e){var n=e?[null].concat(e):[null];return t<0&&(t=n.length),n}),(function(e){var n=e?[null].concat(e):[null];return t<0&&(t=n.length),n})),t},n.handleUnshift=function(e){return function(){return n.unshift(e)}},n.handleRemove=function(e){return function(){return n.remove(e)}},n.handlePop=function(){return function(){return n.pop()}},n.remove=n.remove.bind(_Pe(n)),n.pop=n.pop.bind(_Pe(n)),n}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var o=r.prototype;return o.componentDidUpdate=function(e){this.props.validateOnChange&&this.props.formik.validateOnChange&&!PCe(IPe(e.formik.values,e.name),IPe(this.props.formik.values,this.props.name))&&this.props.formik.validateForm(this.props.formik.values)},o.remove=function(e){var t;return this.updateArrayField((function(n){var r=n?$Pe(n):[];return t||(t=r[e]),PPe(r.splice)&&r.splice(e,1),r}),!0,!0),t},o.pop=function(){var e;return this.updateArrayField((function(t){var n=t;return e||(e=n&&n.pop&&n.pop()),n}),!0,!0),e},o.render=function(){var e={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},t=this.props,n=t.component,r=t.render,o=t.children,i=t.name,a=SPe({},e,{form:CPe(t.formik,["validate","validationSchema"]),name:i});return n?cr.createElement(n,a):r?r(a):o?"function"==typeof o?o(a):MPe(o)?null:cr.Children.only(o):null},r}(cr.Component);KPe.defaultProps={validateOnChange:!0};var QPe=e0,JPe=_se,eLe=w0,tLe=kK,nLe=Pse;var rLe=function(e,t,n,r){if(!tLe(e))return e;for(var o=-1,i=(t=JPe(t,e)).length,a=i-1,s=e;null!=s&&++oo?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r0?"var(--accent-color) !important":"",children:r("modelmanager:addSelected")})]}),ro(yP,{rowGap:"1rem",flexDirection:"column",maxHeight:"18rem",overflowY:"scroll",paddingRight:"1rem",paddingLeft:"0.2rem",borderRadius:"0.2rem",children:[i.length>0?0===c.length&&no(jP,{fontWeight:"bold",fontSize:14,padding:"0.5rem",borderRadius:"0.2rem",margin:"0 0.5rem 0 1rem",textAlign:"center",backgroundColor:"var(--notice-color)",boxShadow:"0 0 200px 6px var(--notice-color)",marginTop:"1rem",width:"max-content",children:r("modelmanager:selectAndAdd")}):no(jP,{fontWeight:"bold",fontSize:14,padding:"0.5rem",borderRadius:"0.2rem",textAlign:"center",backgroundColor:"var(--status-bad-color)",children:r("modelmanager:noModelsFound")}),(e=[],t=[],i&&i.forEach((function(n,r){a.includes(n.location)?t.push(no(WLe,{model:n,modelsToAdd:c,setModelsToAdd:d},r)):e.push(no(WLe,{model:n,modelsToAdd:c,setModelsToAdd:d},r))})),ro(to,{children:[e,s&&t]}))]})]})]})}function GLe(){var e=wie(),t=o8().t,n=kie((function(e){return e.system.isProcessing}));function r(e){var n;return function(e){return/\s/.test(e)}(e)&&(n=t("modelmanager:cannotUseSpaces")),n}var o=yn(qr.useState(!1),2),i=o[0],a=o[1];return ro(to,{children:[no(_ae,{"aria-label":t("common:back"),tooltip:t("common:back"),onClick:function(){return e(Y8(null))},width:"max-content",position:"absolute",zIndex:1,size:"sm",right:12,top:3,icon:no(vfe,{})}),no(ULe,{}),no(pfe,{label:t("modelmanager:addManually"),isChecked:i,onChange:function(){return a(!i)}}),i&&no(WPe,{initialValues:{name:"",description:"",config:"configs/stable-diffusion/v1-inference.yaml",weights:"",vae:"",width:512,height:512,format:"ckpt",default:!1},onSubmit:function(t){e(aie(t)),e(Y8(null))},children:function(e){var o=e.handleSubmit,i=e.errors,a=e.touched;return no("form",{onSubmit:o,children:ro(zP,{rowGap:"0.5rem",children:[no(jP,{fontSize:20,fontWeight:"bold",alignSelf:"start",children:t("modelmanager:manual")}),ro(I_,{isInvalid:!!i.name&&a.name,isRequired:!0,children:[no(V_,{htmlFor:"name",fontSize:"sm",children:t("modelmanager:name")}),ro(zP,{alignItems:"start",children:[no(ZPe,{as:bye,id:"name",name:"name",type:"text",validate:r,width:"2xl"}),i.name&&a.name?no(F_,{children:i.name}):no(R_,{margin:0,children:t("modelmanager:nameValidationMsg")})]})]}),ro(I_,{isInvalid:!!i.description&&a.description,isRequired:!0,children:[no(V_,{htmlFor:"description",fontSize:"sm",children:t("modelmanager:description")}),ro(zP,{alignItems:"start",children:[no(ZPe,{as:bye,id:"description",name:"description",type:"text",width:"2xl"}),i.description&&a.description?no(F_,{children:i.description}):no(R_,{margin:0,children:t("modelmanager:descriptionValidationMsg")})]})]}),ro(I_,{isInvalid:!!i.config&&a.config,isRequired:!0,children:[no(V_,{htmlFor:"config",fontSize:"sm",children:t("modelmanager:config")}),ro(zP,{alignItems:"start",children:[no(ZPe,{as:bye,id:"config",name:"config",type:"text",width:"2xl"}),i.config&&a.config?no(F_,{children:i.config}):no(R_,{margin:0,children:t("modelmanager:configValidationMsg")})]})]}),ro(I_,{isInvalid:!!i.weights&&a.weights,isRequired:!0,children:[no(V_,{htmlFor:"config",fontSize:"sm",children:t("modelmanager:modelLocation")}),ro(zP,{alignItems:"start",children:[no(ZPe,{as:bye,id:"weights",name:"weights",type:"text",width:"2xl"}),i.weights&&a.weights?no(F_,{children:i.weights}):no(R_,{margin:0,children:t("modelmanager:modelLocationValidationMsg")})]})]}),ro(I_,{isInvalid:!!i.vae&&a.vae,children:[no(V_,{htmlFor:"vae",fontSize:"sm",children:t("modelmanager:vaeLocation")}),ro(zP,{alignItems:"start",children:[no(ZPe,{as:bye,id:"vae",name:"vae",type:"text",width:"2xl"}),i.vae&&a.vae?no(F_,{children:i.vae}):no(R_,{margin:0,children:t("modelmanager:vaeLocationValidationMsg")})]})]}),ro(DP,{width:"100%",children:[ro(I_,{isInvalid:!!i.width&&a.width,children:[no(V_,{htmlFor:"width",fontSize:"sm",children:t("modelmanager:width")}),ro(zP,{alignItems:"start",children:[no(ZPe,{id:"width",name:"width",children:function(e){var t=e.field,n=e.form;return no(Aae,{id:"width",name:"width",min:64,max:2048,step:64,width:"90%",value:n.values.width,onChange:function(e){return n.setFieldValue(t.name,Number(e))}})}}),i.width&&a.width?no(F_,{children:i.width}):no(R_,{margin:0,children:t("modelmanager:widthValidationMsg")})]})]}),ro(I_,{isInvalid:!!i.height&&a.height,children:[no(V_,{htmlFor:"height",fontSize:"sm",children:t("modelmanager:height")}),ro(zP,{alignItems:"start",children:[no(ZPe,{id:"height",name:"height",children:function(e){var t=e.field,n=e.form;return no(Aae,{id:"height",name:"height",min:64,max:2048,width:"90%",step:64,value:n.values.height,onChange:function(e){return n.setFieldValue(t.name,Number(e))}})}}),i.height&&a.height?no(F_,{children:i.height}):no(R_,{margin:0,children:t("modelmanager:heightValidationMsg")})]})]})]}),no(Eae,{type:"submit",className:"modal-close-btn",isLoading:n,children:t("modelmanager:addModel")})]})})}})]})}function qLe(e){var t=e.children;return no(yP,{flexDirection:"column",backgroundColor:"var(--background-color)",padding:"1rem 1rem",borderRadius:"0.5rem",rowGap:"1rem",width:"100%",children:t})}function YLe(){var e=wie(),t=o8().t,n=kie((function(e){return e.system.isProcessing}));function r(e){var n;return function(e){return/\s/.test(e)}(e)&&(n=t("modelmanager:cannotUseSpaces")),n}return ro(yP,{children:[no(_ae,{"aria-label":t("common:back"),tooltip:t("common:back"),onClick:function(){return e(Y8(null))},width:"max-content",position:"absolute",zIndex:1,size:"sm",right:12,top:3,icon:no(vfe,{})}),no(WPe,{initialValues:{name:"",description:"",repo_id:"",path:"",format:"diffusers",default:!1,vae:{repo_id:"",path:""}},onSubmit:function(t){var n=t;""===t.path&&delete n.path,""===t.repo_id&&delete n.repo_id,""===t.vae.path&&delete n.vae.path,""===t.vae.repo_id&&delete n.vae.repo_id,e(aie(n)),e(Y8(null))},children:function(e){var o,i,a,s,l,u,c,d,f,h,p=e.handleSubmit,v=e.errors,g=e.touched;return no("form",{onSubmit:p,children:ro(zP,{rowGap:"0.5rem",children:[no(qLe,{children:ro(I_,{isInvalid:!!v.name&&g.name,isRequired:!0,children:[no(V_,{htmlFor:"name",fontSize:"sm",children:t("modelmanager:name")}),ro(zP,{alignItems:"start",children:[no(ZPe,{as:bye,id:"name",name:"name",type:"text",validate:r,width:"2xl",isRequired:!0}),v.name&&g.name?no(F_,{children:v.name}):no(R_,{margin:0,children:t("modelmanager:nameValidationMsg")})]})]})}),no(qLe,{children:ro(I_,{isInvalid:!!v.description&&g.description,isRequired:!0,children:[no(V_,{htmlFor:"description",fontSize:"sm",children:t("modelmanager:description")}),ro(zP,{alignItems:"start",children:[no(ZPe,{as:bye,id:"description",name:"description",type:"text",width:"2xl",isRequired:!0}),v.description&&g.description?no(F_,{children:v.description}):no(R_,{margin:0,children:t("modelmanager:descriptionValidationMsg")})]})]})}),ro(qLe,{children:[no(jP,{fontWeight:"bold",fontSize:"sm",children:t("modelmanager:formMessageDiffusersModelLocation")}),no(jP,{fontSize:"sm",fontStyle:"italic",color:"var(--text-color-secondary)",children:t("modelmanager:formMessageDiffusersModelLocationDesc")}),ro(I_,{isInvalid:!!v.path&&g.path,children:[no(V_,{htmlFor:"path",fontSize:"sm",children:t("modelmanager:modelLocation")}),ro(zP,{alignItems:"start",children:[no(ZPe,{as:bye,id:"path",name:"path",type:"text",width:"2xl"}),v.path&&g.path?no(F_,{children:v.path}):no(R_,{margin:0,children:t("modelmanager:modelLocationValidationMsg")})]})]}),ro(I_,{isInvalid:!!v.repo_id&&g.repo_id,children:[no(V_,{htmlFor:"repo_id",fontSize:"sm",children:t("modelmanager:repo_id")}),ro(zP,{alignItems:"start",children:[no(ZPe,{as:bye,id:"repo_id",name:"repo_id",type:"text",width:"2xl"}),v.repo_id&&g.repo_id?no(F_,{children:v.repo_id}):no(R_,{margin:0,children:t("modelmanager:repoIDValidationMsg")})]})]})]}),ro(qLe,{children:[no(jP,{fontWeight:"bold",children:t("modelmanager:formMessageDiffusersVAELocation")}),no(jP,{fontSize:"sm",fontStyle:"italic",color:"var(--text-color-secondary)",children:t("modelmanager:formMessageDiffusersVAELocationDesc")}),ro(I_,{isInvalid:!(null===(o=v.vae)||void 0===o||!o.path)&&(null===(i=g.vae)||void 0===i?void 0:i.path),children:[no(V_,{htmlFor:"vae.path",fontSize:"sm",children:t("modelmanager:vaeLocation")}),ro(zP,{alignItems:"start",children:[no(ZPe,{as:bye,id:"vae.path",name:"vae.path",type:"text",width:"2xl"}),null!==(a=v.vae)&&void 0!==a&&a.path&&null!==(s=g.vae)&&void 0!==s&&s.path?no(F_,{children:null===(l=v.vae)||void 0===l?void 0:l.path}):no(R_,{margin:0,children:t("modelmanager:vaeLocationValidationMsg")})]})]}),ro(I_,{isInvalid:!(null===(u=v.vae)||void 0===u||!u.repo_id)&&(null===(c=g.vae)||void 0===c?void 0:c.repo_id),children:[no(V_,{htmlFor:"vae.repo_id",fontSize:"sm",children:t("modelmanager:vaeRepoID")}),ro(zP,{alignItems:"start",children:[no(ZPe,{as:bye,id:"vae.repo_id",name:"vae.repo_id",type:"text",width:"2xl"}),null!==(d=v.vae)&&void 0!==d&&d.repo_id&&null!==(f=g.vae)&&void 0!==f&&f.repo_id?no(F_,{children:null===(h=v.vae)||void 0===h?void 0:h.repo_id}):no(R_,{margin:0,children:t("modelmanager:vaeRepoIDValidationMsg")})]})]})]}),no(Eae,{type:"submit",className:"modal-close-btn",isLoading:n,children:t("modelmanager:addModel")})]})})}})]})}function ZLe(e){var t=e.text,n=e.onClick;return no(yP,{position:"relative",width:"50%",height:"200px",backgroundColor:"var(--background-color)",borderRadius:"0.5rem",justifyContent:"center",alignItems:"center",_hover:{cursor:"pointer",backgroundColor:"var(--accent-color)"},onClick:n,children:no(jP,{fontWeight:"bold",children:t})})}function XLe(){var e=GE(),t=e.isOpen,n=e.onOpen,r=e.onClose,o=kie((function(e){return e.ui.addNewModelUIOption})),i=wie(),a=o8().t;return ro(to,{children:[no(Eae,{"aria-label":a("modelmanager:addNewModel"),tooltip:a("modelmanager:addNewModel"),onClick:n,className:"modal-close-btn",size:"sm",children:ro(yP,{columnGap:"0.5rem",alignItems:"center",children:[no(hde,{}),a("modelmanager:addNew")]})}),ro(qW,{isOpen:t,onClose:function(){r(),i(Y8(null))},size:"3xl",closeOnOverlayClick:!1,children:[no(rU,{}),ro(JW,{className:"modal add-model-modal",fontFamily:"Inter",children:[no(tU,{children:a("modelmanager:addNewModel")}),no(ZW,{marginTop:"0.3rem"}),ro(YW,{className:"add-model-modal-body",children:[null==o&&ro(yP,{columnGap:"1rem",children:[no(ZLe,{text:a("modelmanager:addCheckpointModel"),onClick:function(){return i(Y8("ckpt"))}}),no(ZLe,{text:a("modelmanager:addDiffuserModel"),onClick:function(){return i(Y8("diffusers"))}})]}),"ckpt"==o&&no(GLe,{}),"diffusers"==o&&no(YLe,{})]})]})]})]})}function $Le(e){var t=kie((function(e){return e.system})),n=t.isProcessing,r=t.isConnected,o=kie((function(e){return e.system.openModel})),i=o8().t,a=wie(),s=e.name,l=e.status,u=e.description,c=function(){a(T8(s))};return ro(yP,{alignItems:"center",padding:"0.5rem 0.5rem",borderRadius:"0.2rem",backgroundColor:s===o?"var(--accent-color)":"",_hover:{backgroundColor:s===o?"var(--accent-color)":"var(--background-color)"},children:[no(cP,{onClick:c,cursor:"pointer",children:no(kY,{label:u,hasArrow:!0,placement:"bottom",children:no(jP,{fontWeight:"bold",children:s})})}),no(TP,{onClick:c,cursor:"pointer"}),ro(yP,{gap:2,alignItems:"center",children:[no(jP,{color:function(){switch(l){case"active":return"var(--status-good-color)";case"cached":return"var(--status-working-color)";case"not loaded":return"var(--text-color-secondary)"}}(),children:l}),no(b_,{size:"sm",onClick:function(){a(lie(s))},isDisabled:"active"===l||n||!r,className:"modal-close-btn",children:i("modelmanager:load")}),no(_ae,{icon:no(Bde,{}),size:"sm",onClick:c,"aria-label":"Modify Config",isDisabled:"active"===l||n||!r,className:" modal-close-btn"}),no(jke,{title:i("modelmanager:deleteModel"),acceptCallback:function(){a(sie(s)),a(T8(null))},acceptButtonText:i("modelmanager:delete"),triggerComponent:no(_ae,{icon:no(jde,{}),size:"sm","aria-label":i("modelmanager:deleteConfig"),isDisabled:"active"===l||n||!r,className:" modal-close-btn",style:{backgroundColor:"var(--btn-delete-image)"}}),children:ro(yP,{rowGap:"1rem",flexDirection:"column",children:[no("p",{style:{fontWeight:"bold"},children:i("modelmanager:deleteMsg1")}),no("p",{style:{color:"var(--text-color-secondary"},children:i("modelmanager:deleteMsg2")})]})})]})]})}var KLe=Bae,QLe=Q0;var JLe=function(e,t){var n=-1,r=QLe(e)?Array(e.length):[];return KLe(e,(function(e,o,i){r[++n]=t(e,o,i)})),r},eOe=fse,tOe=fle,nOe=JLe,rOe=v0;var oOe=function(e,t){return(rOe(e)?eOe:nOe)(e,tOe(t))},iOe=QX(wle,(function(e){var t=oOe(e.model_list,(function(e,t){return un({name:t},e)}));return t}),{memoizeOptions:{resultEqualityCheck:dae}});function aOe(e){var t=e.label,n=e.isActive,r=e.onClick;return no(Eae,{onClick:r,isActive:n,_active:{backgroundColor:"var(--accent-color)",_hover:{backgroundColor:"var(--accent-color)"}},size:"sm",children:t})}var sOe=function(){var e=kie(iOe),t=yn(cr.useState(""),2),n=t[0],r=t[1],o=yn(cr.useState("all"),2),i=o[0],a=o[1],s=yn(cr.useTransition(),2),l=(s[0],s[1]),u=o8().t,c=cr.useMemo((function(){var t=[],r=[],o=[],a=[];return e.forEach((function(e,s){e.name.toLowerCase().includes(n.toLowerCase())&&(o.push(no($Le,{name:e.name,status:e.status,description:e.description},s)),e.format===i&&a.push(no($Le,{name:e.name,status:e.status,description:e.description},s))),"diffusers"!==e.format?t.push(no($Le,{name:e.name,status:e.status,description:e.description},s)):r.push(no($Le,{name:e.name,status:e.status,description:e.description},s))})),""!==n?no(cP,"all"===i?{marginTop:"1rem",children:o}:{marginTop:"1rem",children:a}):ro(yP,{flexDirection:"column",rowGap:"1.5rem",children:["all"===i&&ro(to,{children:[ro(cP,{children:[no(jP,{fontWeight:"bold",backgroundColor:"var(--background-color)",padding:"0.5rem 1rem",borderRadius:"0.5rem",margin:"1rem 0",width:"max-content",fontSize:"14",children:u("modelmanager:checkpointModels")}),t]}),ro(cP,{children:[no(jP,{fontWeight:"bold",backgroundColor:"var(--background-color)",padding:"0.5rem 1rem",borderRadius:"0.5rem",marginBottom:"0.5rem",width:"max-content",fontSize:"14",children:u("modelmanager:diffusersModels")}),r]})]}),"ckpt"===i&&no(yP,{flexDirection:"column",marginTop:"1rem",children:t}),"diffusers"===i&&no(yP,{flexDirection:"column",marginTop:"1rem",children:r})]})}),[e,n,u,i]);return ro(yP,{flexDirection:"column",rowGap:"2rem",width:"50%",minWidth:"50%",children:[ro(yP,{justifyContent:"space-between",children:[no(jP,{fontSize:"1.4rem",fontWeight:"bold",children:u("modelmanager:availableModels")}),no(XLe,{})]}),no(bye,{onChange:function(e){l((function(){r(e.target.value)}))},label:u("modelmanager:search")}),ro(yP,{flexDirection:"column",gap:1,maxHeight:window.innerHeight-360,overflow:"scroll",paddingRight:"1rem",children:[ro(yP,{columnGap:"0.5rem",children:[no(aOe,{label:u("modelmanager:allModels"),onClick:function(){return a("all")},isActive:"all"===i}),no(aOe,{label:u("modelmanager:checkpointModels"),onClick:function(){return a("ckpt")},isActive:"ckpt"===i}),no(aOe,{label:u("modelmanager:diffusersModels"),onClick:function(){return a("diffusers")},isActive:"diffusers"===i})]}),c]})]})};function lOe(e){var t=e.children,n=GE(),r=n.isOpen,o=n.onOpen,i=n.onClose,a=kie((function(e){return e.system.model_list})),s=kie((function(e){return e.system.openModel})),l=o8().t;return ro(to,{children:[cr.cloneElement(t,{onClick:o}),ro(qW,{isOpen:r,onClose:i,size:"6xl",children:[no(rU,{}),ro(JW,{className:"modal",fontFamily:"Inter",children:[no(ZW,{className:"modal-close-btn"}),no(tU,{fontWeight:"bold",children:l("modelmanager:modelManager")}),ro(yP,{padding:"0 1.5rem 1.5rem 1.5rem",width:"100%",columnGap:"2rem",children:[no(sOe,{}),s&&"diffusers"===a[s].format?no(gLe,{}):no(pLe,{})]})]})]})]})}var uOe=QX([wle],(function(e){var t=e.isProcessing,n=e.model_list,r=oOe(n,(function(e,t){return t}));return{models:r,isProcessing:t}}),{memoizeOptions:{resultEqualityCheck:dae}}),cOe=function(){var e=wie(),t=kie(uOe),n=t.models,r=t.isProcessing,o=kie(xle);return no(yP,{style:{paddingLeft:"0.3rem"},children:no(Mae,{style:{fontSize:"0.8rem"},tooltip:o.description,isDisabled:r,value:o.name,validValues:n,onChange:function(t){e(lie(t.target.value))}})})},dOe=QX([wle,pae],(function(e,t){var n=e.shouldDisplayInProgressType,r=e.shouldConfirmOnDelete,o=e.shouldDisplayGuides,i=e.model_list,a=e.saveIntermediatesInterval,s=e.enableImageDebugging,l=t.shouldUseCanvasBetaLayout;return{shouldDisplayInProgressType:n,shouldConfirmOnDelete:r,shouldDisplayGuides:o,models:oOe(i,(function(e,t){return t})),saveIntermediatesInterval:a,enableImageDebugging:s,shouldUseCanvasBetaLayout:l}}),{memoizeOptions:{resultEqualityCheck:dae}}),fOe=function(e){var t=e.children,n=wie(),r=o8().t,o=kie((function(e){return e.generation.steps})),i=GE(),a=i.isOpen,s=i.onOpen,l=i.onClose,u=GE(),c=u.isOpen,d=u.onOpen,f=u.onClose,h=kie(dOe),p=h.shouldDisplayInProgressType,v=h.shouldConfirmOnDelete,g=h.shouldDisplayGuides,m=h.saveIntermediatesInterval,y=h.enableImageDebugging,b=h.shouldUseCanvasBetaLayout;return ro(to,{children:[cr.cloneElement(t,{onClick:s}),ro(qW,{isOpen:a,onClose:l,size:"lg",children:[no(rU,{}),ro(JW,{className:"modal settings-modal",children:[no(tU,{className:"settings-modal-header",children:r("common:settingsLabel")}),no(ZW,{className:"modal-close-btn"}),ro(YW,{className:"settings-modal-content",children:[ro("div",{className:"settings-modal-items",children:[ro("div",{className:"settings-modal-item",style:{gridAutoFlow:"row",rowGap:"0.5rem"},children:[no(Mae,{label:r("settings:displayInProgress"),validValues:wte,value:p,onChange:function(e){return n(s8(e.target.value))}}),"full-res"===p&&no(Aae,{label:r("settings:saveSteps"),min:1,max:o,step:1,onChange:function(e){e>o&&(e=o),e<1&&(e=1),n(C8(e))},value:m,width:"auto",textAlign:"center"})]}),no(iye,{styleClass:"settings-modal-item",label:r("settings:confirmOnDelete"),isChecked:v,onChange:function(e){return n(f8(e.target.checked))}}),no(iye,{styleClass:"settings-modal-item",label:r("settings:displayHelpIcons"),isChecked:g,onChange:function(e){return n(m8(e.target.checked))}}),no(iye,{styleClass:"settings-modal-item",label:r("settings:useCanvasBeta"),isChecked:b,onChange:function(e){return n(G8(e.target.checked))}})]}),ro("div",{className:"settings-modal-items",children:[no("h2",{style:{fontWeight:"bold"},children:"Developer"}),no(iye,{styleClass:"settings-modal-item",label:r("settings:enableImageDebugging"),isChecked:y,onChange:function(e){return n(_8(e.target.checked))}})]}),ro("div",{className:"settings-modal-reset",children:[no(xP,{size:"md",children:r("settings:resetWebUI")}),no(b_,{colorScheme:"red",onClick:function(){yie.purge().then((function(){l(),d()}))},children:r("settings:resetWebUI")}),no(jP,{children:r("settings:resetWebUIDesc1")}),no(jP,{children:r("settings:resetWebUIDesc2")})]})]}),no(eU,{children:no(b_,{onClick:l,className:"modal-close-btn",children:r("common:close")})})]})]}),ro(qW,{closeOnOverlayClick:!1,isOpen:c,onClose:f,isCentered:!0,children:[no(rU,{bg:"blackAlpha.300",backdropFilter:"blur(40px)"}),no(JW,{children:no(YW,{pb:6,pt:6,children:no(yP,{justifyContent:"center",children:no(jP,{fontSize:"lg",children:no(jP,{children:r("settings:resetComplete")})})})})})]})]})},hOe=QX(wle,(function(e){return{isConnected:e.isConnected,isProcessing:e.isProcessing,currentIteration:e.currentIteration,totalIterations:e.totalIterations,currentStatus:e.currentStatus,hasError:e.hasError,wasErrorSeen:e.wasErrorSeen}}),{memoizeOptions:{resultEqualityCheck:dae}}),pOe=function(){var e,t=kie(hOe),n=t.isConnected,r=t.isProcessing,o=t.currentIteration,i=t.totalIterations,a=t.currentStatus,s=t.hasError,l=t.wasErrorSeen,u=wie(),c=o8().t;e=n&&!s?"status-good":"status-bad";var d=a;[c("common:statusGenerating"),c("common:statusPreparing"),c("common:statusSavingImage"),c("common:statusRestoringFaces"),c("common:statusUpscaling")].includes(d)&&(e="status-working"),d&&r&&i>1&&(d="".concat(c(d)," (").concat(o,"/").concat(i,")"));return no(kY,{label:s&&!l?"Click to clear, check logs for details":void 0,children:no(jP,{cursor:s&&!l?"pointer":"initial",onClick:function(){!s&&l||u(w8())},className:"status ".concat(e),children:c(d)})})};function vOe(){var e=o8().t,t=ao(),n=t.setColorMode,r=t.colorMode,o=wie(),i=kie((function(e){return e.ui.currentTheme})),a={dark:e("common:darkTheme"),light:e("common:lightTheme"),green:e("common:greenTheme")};cr.useEffect((function(){r!==i&&n(i)}),[n,r,i]);var s;return no(Pae,{trigger:"hover",triggerComponent:no(_ae,{"aria-label":e("common:themeLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:no(dde,{})}),children:no(zP,{align:"stretch",children:(s=[],Object.keys(a).forEach((function(e){s.push(no(Eae,{style:{width:"6rem"},leftIcon:i===e?no(Uce,{}):void 0,size:"sm",onClick:function(){return function(e){o(j8(e))}(e)},children:a[e]},e))})),s)})})}function gOe(){var e,t=o8(),n=t.t,r=t.i18n,o={en:n("common:langEnglish"),nl:n("common:langDutch"),fr:n("common:langFrench"),de:n("common:langGerman"),it:n("common:langItalian"),ja:n("common:langJapanese"),pl:n("common:langPolish"),pt_br:n("common:langBrPortuguese"),ru:n("common:langRussian"),zh_cn:n("common:langSimplifiedChinese"),es:n("common:langSpanish"),ua:n("common:langUkranian")};return no(Pae,{trigger:"hover",triggerComponent:no(_ae,{"aria-label":n("common:languagePickerLabel"),tooltip:n("common:languagePickerLabel"),icon:no(ade,{}),size:"sm",variant:"link","data-variant":"link",fontSize:26}),children:no(zP,{children:(e=[],Object.keys(o).forEach((function(t){e.push(no(Eae,{"data-selected":localStorage.getItem("i18nextLng")===t,onClick:function(){return r.changeLanguage(t)},className:"modal-close-btn lang-select-btn","aria-label":o[t],tooltip:o[t],size:"sm",minWidth:"200px",children:o[t]},t))})),e)})})}var mOe=function(){var e=o8().t,t=kie((function(e){return e.system.app_version}));return ro("div",{className:"site-header",children:[ro("div",{className:"site-header-left-side",children:[no("img",{src:Yye,alt:"invoke-ai-logo"}),ro(yP,{alignItems:"center",columnGap:"0.6rem",children:[ro(jP,{fontSize:"1.4rem",children:["invoke ",no("strong",{children:"ai"})]}),no(jP,{fontWeight:"bold",color:"var(--text-color-secondary)",marginTop:"0.2rem",children:t})]})]}),ro("div",{className:"site-header-right-side",children:[no(pOe,{}),no(cOe,{}),no(lOe,{children:no(_ae,{"aria-label":e("modelmanager:modelManager"),tooltip:e("modelmanager:modelManager"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:no(Zce,{})})}),no(kCe,{children:no(_ae,{"aria-label":e("common:hotkeysLabel"),tooltip:e("common:hotkeysLabel"),size:"sm",variant:"link","data-variant":"link",fontSize:20,icon:no(ide,{})})}),no(vOe,{}),no(gOe,{}),no(_ae,{"aria-label":e("common:reportBugLabel"),tooltip:e("common:reportBugLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:no(CP,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI/issues",children:no(Wce,{})})}),no(_ae,{"aria-label":e("common:githubLabel"),tooltip:e("common:githubLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:no(CP,{isExternal:!0,href:"http://github.com/invoke-ai/InvokeAI",children:no(Nce,{})})}),no(_ae,{"aria-label":e("common:discordLabel"),tooltip:e("common:discordLabel"),variant:"link","data-variant":"link",fontSize:20,size:"sm",icon:no(CP,{isExternal:!0,href:"https://discord.gg/ZmtBAhwWhy",children:no(Rce,{})})}),no(fOe,{children:no(_ae,{"aria-label":e("common:settingsLabel"),tooltip:e("common:settingsLabel"),variant:"link","data-variant":"link",fontSize:22,size:"sm",icon:no(Pfe,{})})})]})]})};var yOe=QX([Mde,pae,fae],(function(e,t,n){var r=t.shouldPinParametersPanel,o=t.shouldShowParametersPanel,i=t.shouldHoldParametersPanelOpen,a=t.shouldUseCanvasBetaLayout,s=e.shouldShowGallery,l=e.shouldPinGallery,u=e.shouldHoldGalleryOpen,c=a&&"unifiedCanvas"===n;return{shouldPinParametersPanel:r,shouldShowProcessButtons:!(c||r&&o),shouldShowParametersPanelButton:!c&&!(o||i&&!r)&&["txt2img","img2img","unifiedCanvas"].includes(n),shouldShowParametersPanel:o,shouldShowGallery:s,shouldPinGallery:l,shouldShowGalleryButton:!(s||u&&!l)&&["txt2img","img2img","unifiedCanvas"].includes(n)}}),{memoizeOptions:{resultEqualityCheck:dae}}),bOe=function(){var e=wie(),t=kie(yOe),n=t.shouldShowParametersPanel,r=t.shouldShowParametersPanelButton,o=t.shouldShowProcessButtons,i=t.shouldPinParametersPanel,a=t.shouldShowGallery,s=t.shouldPinGallery;return _ce("f",(function(){a||n?(e(V8(!1)),e(r4(!1))):(e(V8(!0)),e(r4(!0))),(s||i)&&setTimeout((function(){return e(m3(!0))}),400)}),[a,n]),r?ro("div",{className:"show-hide-button-options",children:[no(_ae,{tooltip:"Show Options Panel (O)",tooltipProps:{placement:"top"},"aria-label":"Show Options Panel",onClick:function(){e(V8(!0)),i&&setTimeout((function(){return e(m3(!0))}),400)},children:no(kde,{})}),o&&ro(to,{children:[no(Fye,{iconButton:!0}),no(zye,{})]})]}):null},wOe=function(){var e=wie(),t=kie(yOe),n=t.shouldShowGallery,r=t.shouldShowGalleryButton,o=t.shouldPinGallery,i=t.shouldShowParametersPanel,a=t.shouldPinParametersPanel;return _ce("f",(function(){n||i?(e(V8(!1)),e(r4(!1))):(e(V8(!0)),e(r4(!0))),(o||a)&&setTimeout((function(){return e(m3(!0))}),400)}),[n,i]),r?no(_ae,{tooltip:"Show Gallery (G)",tooltipProps:{placement:"top"},"aria-label":"Show Gallery",styleClass:"floating-show-hide-button right show-hide-button-gallery",onClick:function(){e(r4(!0)),o&&e(m3(!0))},children:no(Ofe,{})}):null};!function(){function e(){return e=qt(Ut().mark((function e(){var t,n,r=arguments;return Ut().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.length>0&&void 0!==r[0]?r[0]:"",e.next=3,fetch(t,{method:"GET",cache:"no-cache"});case 3:return n=e.sent,e.abrupt("return",n);case 5:case"end":return e.stop()}}),e)}))),e.apply(this,arguments)}var t=function(){(function(){return e.apply(this,arguments)})(document.location+"/flaskwebgui-keep-server-alive").then((function(e){return e}))};({}).NODE_ENV&&"production"!=={}.NODE_ENV||document.addEventListener("DOMContentLoaded",(function(){t(),setInterval(t,3e3)}))}();var kOe=function(){var e,t,n;return e=wie(),t=kie(kle),n=cY(),cr.useEffect((function(){t.forEach((function(e){n(e)})),t.length>0&&e(L8())}),[e,n,t]),ro("div",{className:"App",children:[ro(pCe,{children:[no(bCe,{}),ro("div",{className:"app-content",children:[no(mOe,{}),no(oSe,{})]}),no("div",{className:"app-console",children:no(mCe,{})})]}),no(bOe,{}),no(wOe,{})]})},xOe=function(){return no(yP,{width:"100vw",height:"100vh",alignItems:"center",justifyContent:"center",children:no(XC,{thickness:"2px",speed:"1s",emptyColor:"gray.200",color:"gray.400",size:"xl"})})},SOe=hs({key:"invokeai-style-cache",prepend:!0});CY.createRoot(document.getElementById("root")).render(no(qr.StrictMode,{children:no(CZ,{store:mie,children:no(jZ,{loading:no(xOe,{}),persistor:yie,children:no(il,{value:SOe,children:no(SY,{children:no(qr.Suspense,{fallback:no(xOe,{}),children:no(kOe,{})})})})})})}))}}}))}(); diff --git a/invokeai/frontend/dist/assets/polyfills-db6c30c5.js b/invokeai/frontend/dist/assets/polyfills-db6c30c5.js deleted file mode 100644 index f093a476d3..0000000000 --- a/invokeai/frontend/dist/assets/polyfills-db6c30c5.js +++ /dev/null @@ -1 +0,0 @@ -var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=function(t){return t&&t.Math==Math&&t},e=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof t&&t)||function(){return this}()||Function("return this")(),r={},o=function(t){try{return!!t()}catch(n){return!0}},i=!o((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),u=!o((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),c=u,f=Function.prototype.call,a=c?f.bind(f):function(){return f.apply(f,arguments)},l={},s={}.propertyIsEnumerable,p=Object.getOwnPropertyDescriptor,y=p&&!s.call({1:2},1);l.f=y?function(t){var n=p(this,t);return!!n&&n.enumerable}:s;var b,v,d=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}},g=u,h=Function.prototype,m=h.call,O=g&&h.bind.bind(m,m),w=g?O:function(t){return function(){return m.apply(t,arguments)}},S=w,j=S({}.toString),P=S("".slice),E=function(t){return P(j(t),8,-1)},T=o,L=E,I=Object,M=w("".split),F=T((function(){return!I("z").propertyIsEnumerable(0)}))?function(t){return"String"==L(t)?M(t,""):I(t)}:I,D=function(t){return null==t},A=D,C=TypeError,x=function(t){if(A(t))throw C("Can't call method on "+t);return t},_=F,k=x,z=function(t){return _(k(t))},N="object"==typeof document&&document.all,R={all:N,IS_HTMLDDA:void 0===N&&void 0!==N},W=R.all,G=R.IS_HTMLDDA?function(t){return"function"==typeof t||t===W}:function(t){return"function"==typeof t},H=G,B=R.all,U=R.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:H(t)||t===B}:function(t){return"object"==typeof t?null!==t:H(t)},X=e,q=G,K=function(t){return q(t)?t:void 0},V=function(t,n){return arguments.length<2?K(X[t]):X[t]&&X[t][n]},Y=w({}.isPrototypeOf),$=e,J="undefined"!=typeof navigator&&String(navigator.userAgent)||"",Q=$.process,Z=$.Deno,tt=Q&&Q.versions||Z&&Z.version,nt=tt&&tt.v8;nt&&(v=(b=nt.split("."))[0]>0&&b[0]<4?1:+(b[0]+b[1])),!v&&J&&(!(b=J.match(/Edge\/(\d+)/))||b[1]>=74)&&(b=J.match(/Chrome\/(\d+)/))&&(v=+b[1]);var et=v,rt=o,ot=!!Object.getOwnPropertySymbols&&!rt((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&et&&et<41})),it=ot&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,ut=V,ct=G,ft=Y,at=Object,lt=it?function(t){return"symbol"==typeof t}:function(t){var n=ut("Symbol");return ct(n)&&ft(n.prototype,at(t))},st=String,pt=G,yt=function(t){try{return st(t)}catch(n){return"Object"}},bt=TypeError,vt=function(t){if(pt(t))return t;throw bt(yt(t)+" is not a function")},dt=vt,gt=D,ht=a,mt=G,Ot=U,wt=TypeError,St={},jt={get exports(){return St},set exports(t){St=t}},Pt=e,Et=Object.defineProperty,Tt=function(t,n){try{Et(Pt,t,{value:n,configurable:!0,writable:!0})}catch(e){Pt[t]=n}return n},Lt=Tt,It="__core-js_shared__",Mt=e[It]||Lt(It,{}),Ft=Mt;(jt.exports=function(t,n){return Ft[t]||(Ft[t]=void 0!==n?n:{})})("versions",[]).push({version:"3.27.2",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.27.2/LICENSE",source:"https://github.com/zloirock/core-js"});var Dt=x,At=Object,Ct=function(t){return At(Dt(t))},xt=Ct,_t=w({}.hasOwnProperty),kt=Object.hasOwn||function(t,n){return _t(xt(t),n)},zt=w,Nt=0,Rt=Math.random(),Wt=zt(1..toString),Gt=function(t){return"Symbol("+(void 0===t?"":t)+")_"+Wt(++Nt+Rt,36)},Ht=St,Bt=kt,Ut=Gt,Xt=ot,qt=it,Kt=e.Symbol,Vt=Ht("wks"),Yt=qt?Kt.for||Kt:Kt&&Kt.withoutSetter||Ut,$t=function(t){return Bt(Vt,t)||(Vt[t]=Xt&&Bt(Kt,t)?Kt[t]:Yt("Symbol."+t)),Vt[t]},Jt=a,Qt=U,Zt=lt,tn=function(t,n){var e=t[n];return gt(e)?void 0:dt(e)},nn=function(t,n){var e,r;if("string"===n&&mt(e=t.toString)&&!Ot(r=ht(e,t)))return r;if(mt(e=t.valueOf)&&!Ot(r=ht(e,t)))return r;if("string"!==n&&mt(e=t.toString)&&!Ot(r=ht(e,t)))return r;throw wt("Can't convert object to primitive value")},en=TypeError,rn=$t("toPrimitive"),on=function(t,n){if(!Qt(t)||Zt(t))return t;var e,r=tn(t,rn);if(r){if(void 0===n&&(n="default"),e=Jt(r,t,n),!Qt(e)||Zt(e))return e;throw en("Can't convert object to primitive value")}return void 0===n&&(n="number"),nn(t,n)},un=lt,cn=function(t){var n=on(t,"string");return un(n)?n:n+""},fn=U,an=e.document,ln=fn(an)&&fn(an.createElement),sn=function(t){return ln?an.createElement(t):{}},pn=sn,yn=!i&&!o((function(){return 7!=Object.defineProperty(pn("div"),"a",{get:function(){return 7}}).a})),bn=i,vn=a,dn=l,gn=d,hn=z,mn=cn,On=kt,wn=yn,Sn=Object.getOwnPropertyDescriptor;r.f=bn?Sn:function(t,n){if(t=hn(t),n=mn(n),wn)try{return Sn(t,n)}catch(e){}if(On(t,n))return gn(!vn(dn.f,t,n),t[n])};var jn={},Pn=i&&o((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),En=U,Tn=String,Ln=TypeError,In=function(t){if(En(t))return t;throw Ln(Tn(t)+" is not an object")},Mn=i,Fn=yn,Dn=Pn,An=In,Cn=cn,xn=TypeError,_n=Object.defineProperty,kn=Object.getOwnPropertyDescriptor,zn="enumerable",Nn="configurable",Rn="writable";jn.f=Mn?Dn?function(t,n,e){if(An(t),n=Cn(n),An(e),"function"==typeof t&&"prototype"===n&&"value"in e&&Rn in e&&!e[Rn]){var r=kn(t,n);r&&r[Rn]&&(t[n]=e.value,e={configurable:Nn in e?e[Nn]:r[Nn],enumerable:zn in e?e[zn]:r[zn],writable:!1})}return _n(t,n,e)}:_n:function(t,n,e){if(An(t),n=Cn(n),An(e),Fn)try{return _n(t,n,e)}catch(r){}if("get"in e||"set"in e)throw xn("Accessors not supported");return"value"in e&&(t[n]=e.value),t};var Wn=jn,Gn=d,Hn=i?function(t,n,e){return Wn.f(t,n,Gn(1,e))}:function(t,n,e){return t[n]=e,t},Bn={},Un={get exports(){return Bn},set exports(t){Bn=t}},Xn=i,qn=kt,Kn=Function.prototype,Vn=Xn&&Object.getOwnPropertyDescriptor,Yn=qn(Kn,"name"),$n={EXISTS:Yn,PROPER:Yn&&"something"===function(){}.name,CONFIGURABLE:Yn&&(!Xn||Xn&&Vn(Kn,"name").configurable)},Jn=G,Qn=Mt,Zn=w(Function.toString);Jn(Qn.inspectSource)||(Qn.inspectSource=function(t){return Zn(t)});var te,ne,ee,re=Qn.inspectSource,oe=G,ie=e.WeakMap,ue=oe(ie)&&/native code/.test(String(ie)),ce=Gt,fe=St("keys"),ae=function(t){return fe[t]||(fe[t]=ce(t))},le={},se=ue,pe=e,ye=U,be=Hn,ve=kt,de=Mt,ge=ae,he=le,me="Object already initialized",Oe=pe.TypeError,we=pe.WeakMap;if(se||de.state){var Se=de.state||(de.state=new we);Se.get=Se.get,Se.has=Se.has,Se.set=Se.set,te=function(t,n){if(Se.has(t))throw Oe(me);return n.facade=t,Se.set(t,n),n},ne=function(t){return Se.get(t)||{}},ee=function(t){return Se.has(t)}}else{var je=ge("state");he[je]=!0,te=function(t,n){if(ve(t,je))throw Oe(me);return n.facade=t,be(t,je,n),n},ne=function(t){return ve(t,je)?t[je]:{}},ee=function(t){return ve(t,je)}}var Pe={set:te,get:ne,has:ee,enforce:function(t){return ee(t)?ne(t):te(t,{})},getterFor:function(t){return function(n){var e;if(!ye(n)||(e=ne(n)).type!==t)throw Oe("Incompatible receiver, "+t+" required");return e}}},Ee=w,Te=o,Le=G,Ie=kt,Me=i,Fe=$n.CONFIGURABLE,De=re,Ae=Pe.enforce,Ce=Pe.get,xe=String,_e=Object.defineProperty,ke=Ee("".slice),ze=Ee("".replace),Ne=Ee([].join),Re=Me&&!Te((function(){return 8!==_e((function(){}),"length",{value:8}).length})),We=String(String).split("String"),Ge=Un.exports=function(t,n,e){"Symbol("===ke(xe(n),0,7)&&(n="["+ze(xe(n),/^Symbol\(([^)]*)\)/,"$1")+"]"),e&&e.getter&&(n="get "+n),e&&e.setter&&(n="set "+n),(!Ie(t,"name")||Fe&&t.name!==n)&&(Me?_e(t,"name",{value:n,configurable:!0}):t.name=n),Re&&e&&Ie(e,"arity")&&t.length!==e.arity&&_e(t,"length",{value:e.arity});try{e&&Ie(e,"constructor")&&e.constructor?Me&&_e(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(o){}var r=Ae(t);return Ie(r,"source")||(r.source=Ne(We,"string"==typeof n?n:"")),t};Function.prototype.toString=Ge((function(){return Le(this)&&Ce(this).source||De(this)}),"toString");var He=G,Be=jn,Ue=Bn,Xe=Tt,qe={},Ke=Math.ceil,Ve=Math.floor,Ye=Math.trunc||function(t){var n=+t;return(n>0?Ve:Ke)(n)},$e=function(t){var n=+t;return n!=n||0===n?0:Ye(n)},Je=$e,Qe=Math.max,Ze=Math.min,tr=$e,nr=Math.min,er=function(t){return t>0?nr(tr(t),9007199254740991):0},rr=function(t){return er(t.length)},or=z,ir=function(t,n){var e=Je(t);return e<0?Qe(e+n,0):Ze(e,n)},ur=rr,cr=function(t){return function(n,e,r){var o,i=or(n),u=ur(i),c=ir(r,u);if(t&&e!=e){for(;u>c;)if((o=i[c++])!=o)return!0}else for(;u>c;c++)if((t||c in i)&&i[c]===e)return t||c||0;return!t&&-1}},fr={includes:cr(!0),indexOf:cr(!1)},ar=kt,lr=z,sr=fr.indexOf,pr=le,yr=w([].push),br=function(t,n){var e,r=lr(t),o=0,i=[];for(e in r)!ar(pr,e)&&ar(r,e)&&yr(i,e);for(;n.length>o;)ar(r,e=n[o++])&&(~sr(i,e)||yr(i,e));return i},vr=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],dr=br,gr=vr.concat("length","prototype");qe.f=Object.getOwnPropertyNames||function(t){return dr(t,gr)};var hr={};hr.f=Object.getOwnPropertySymbols;var mr=V,Or=qe,wr=hr,Sr=In,jr=w([].concat),Pr=mr("Reflect","ownKeys")||function(t){var n=Or.f(Sr(t)),e=wr.f;return e?jr(n,e(t)):n},Er=kt,Tr=Pr,Lr=r,Ir=jn,Mr=o,Fr=G,Dr=/#|\.prototype\./,Ar=function(t,n){var e=xr[Cr(t)];return e==kr||e!=_r&&(Fr(n)?Mr(n):!!n)},Cr=Ar.normalize=function(t){return String(t).replace(Dr,".").toLowerCase()},xr=Ar.data={},_r=Ar.NATIVE="N",kr=Ar.POLYFILL="P",zr=Ar,Nr=e,Rr=r.f,Wr=Hn,Gr=function(t,n,e,r){r||(r={});var o=r.enumerable,i=void 0!==r.name?r.name:n;if(He(e)&&Ue(e,i,r),r.global)o?t[n]=e:Xe(n,e);else{try{r.unsafe?t[n]&&(o=!0):delete t[n]}catch(u){}o?t[n]=e:Be.f(t,n,{value:e,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return t},Hr=Tt,Br=function(t,n,e){for(var r=Tr(n),o=Ir.f,i=Lr.f,u=0;u0;)if(f(i=c[a],a,u))switch(t){case 0:return i;case 1:return a}return n?-1:void 0}},eo={findLast:no(0),findLastIndex:no(1)},ro={},oo=br,io=vr,uo=Object.keys||function(t){return oo(t,io)},co=i,fo=Pn,ao=jn,lo=In,so=z,po=uo;ro.f=co&&!fo?Object.defineProperties:function(t,n){lo(t);for(var e,r=so(n),o=po(n),i=o.length,u=0;i>u;)ao.f(t,e=o[u++],r[e]);return t};var yo,bo=V("document","documentElement"),vo=In,go=ro,ho=vr,mo=le,Oo=bo,wo=sn,So="prototype",jo="script",Po=ae("IE_PROTO"),Eo=function(){},To=function(t){return"<"+jo+">"+t+""},Lo=function(t){t.write(To("")),t.close();var n=t.parentWindow.Object;return t=null,n},Io=function(){try{yo=new ActiveXObject("htmlfile")}catch(o){}var t,n,e;Io="undefined"!=typeof document?document.domain&&yo?Lo(yo):(n=wo("iframe"),e="java"+jo+":",n.style.display="none",Oo.appendChild(n),n.src=String(e),(t=n.contentWindow.document).open(),t.write(To("document.F=Object")),t.close(),t.F):Lo(yo);for(var r=ho.length;r--;)delete Io[So][ho[r]];return Io()};mo[Po]=!0;var Mo=$t,Fo=Object.create||function(t,n){var e;return null!==t?(Eo[So]=vo(t),e=new Eo,Eo[So]=null,e[Po]=t):e=Io(),void 0===n?e:go.f(e,n)},Do=jn.f,Ao=Mo("unscopables"),Co=Array.prototype;null==Co[Ao]&&Do(Co,Ao,{configurable:!0,value:Fo(null)});var xo=eo.findLast,_o=function(t){Co[Ao][t]=!0};(function(t,n){var e,r,o,i,u,c=t.target,f=t.global,a=t.stat;if(e=f?Nr:a?Nr[c]||Hr(c,{}):(Nr[c]||{}).prototype)for(r in n){if(i=n[r],o=t.dontCallGetSet?(u=Rr(e,r))&&u.value:e[r],!Ur(f?r:c+(a?".":"#")+r,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;Br(i,o)}(t.sham||o&&o.sham)&&Wr(i,"sham",!0),Gr(e,r,i,t)}})({target:"Array",proto:!0},{findLast:function(t){return xo(this,t,arguments.length>1?arguments[1]:void 0)}}),_o("findLast"); diff --git a/invokeai/frontend/dist/assets/polyfills-legacy-70c7b801.js b/invokeai/frontend/dist/assets/polyfills-legacy-70c7b801.js deleted file mode 100644 index 101c4e0541..0000000000 --- a/invokeai/frontend/dist/assets/polyfills-legacy-70c7b801.js +++ /dev/null @@ -1 +0,0 @@ -!function(){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},r=function(t){return t&&t.Math==Math&&t},e=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof t&&t)||function(){return this}()||Function("return this")(),n=e,o=function(t){try{return!!t()}catch(r){return!0}},i=!o((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),a=i,u=Function.prototype,c=u.call,s=a&&u.bind.bind(c,c),f=a?s:function(t){return function(){return c.apply(t,arguments)}},l=function(t){return null==t},h=l,p=TypeError,v=function(t){if(h(t))throw p("Can't call method on "+t);return t},d=v,g=Object,y=function(t){return g(d(t))},m=y,b=f({}.hasOwnProperty),E=Object.hasOwn||function(t,r){return b(m(t),r)},w={},S={},A={get exports(){return S},set exports(t){S=t}},x=e,O=Object.defineProperty,R=function(t,r){try{O(x,t,{value:r,configurable:!0,writable:!0})}catch(e){x[t]=r}return r},T=R,I="__core-js_shared__",P=e[I]||T(I,{}),j=P;(A.exports=function(t,r){return j[t]||(j[t]=void 0!==r?r:{})})("versions",[]).push({version:"3.27.2",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.27.2/LICENSE",source:"https://github.com/zloirock/core-js"});var M,L,k=f,C=0,_=Math.random(),N=k(1..toString),U=function(t){return"Symbol("+(void 0===t?"":t)+")_"+N(++C+_,36)},F="undefined"!=typeof navigator&&String(navigator.userAgent)||"",D=e,B=F,z=D.process,W=D.Deno,H=z&&z.versions||W&&W.version,q=H&&H.v8;q&&(L=(M=q.split("."))[0]>0&&M[0]<4?1:+(M[0]+M[1])),!L&&B&&(!(M=B.match(/Edge\/(\d+)/))||M[1]>=74)&&(M=B.match(/Chrome\/(\d+)/))&&(L=+M[1]);var V=L,G=V,Y=o,$=!!Object.getOwnPropertySymbols&&!Y((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&G&&G<41})),K=$&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,J=S,X=E,Q=U,Z=$,tt=K,rt=e.Symbol,et=J("wks"),nt=tt?rt.for||rt:rt&&rt.withoutSetter||Q,ot=function(t){return X(et,t)||(et[t]=Z&&X(rt,t)?rt[t]:nt("Symbol."+t)),et[t]},it=ot;w.f=it;var at={},ut=!o((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),ct="object"==typeof document&&document.all,st={all:ct,IS_HTMLDDA:void 0===ct&&void 0!==ct},ft=st.all,lt=st.IS_HTMLDDA?function(t){return"function"==typeof t||t===ft}:function(t){return"function"==typeof t},ht=lt,pt=st.all,vt=st.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:ht(t)||t===pt}:function(t){return"object"==typeof t?null!==t:ht(t)},dt=vt,gt=e.document,yt=dt(gt)&&dt(gt.createElement),mt=function(t){return yt?gt.createElement(t):{}},bt=mt,Et=!ut&&!o((function(){return 7!=Object.defineProperty(bt("div"),"a",{get:function(){return 7}}).a})),wt=ut&&o((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),St=vt,At=String,xt=TypeError,Ot=function(t){if(St(t))return t;throw xt(At(t)+" is not an object")},Rt=i,Tt=Function.prototype.call,It=Rt?Tt.bind(Tt):function(){return Tt.apply(Tt,arguments)},Pt=e,jt=lt,Mt=function(t){return jt(t)?t:void 0},Lt=function(t,r){return arguments.length<2?Mt(Pt[t]):Pt[t]&&Pt[t][r]},kt=f({}.isPrototypeOf),Ct=Lt,_t=lt,Nt=kt,Ut=Object,Ft=K?function(t){return"symbol"==typeof t}:function(t){var r=Ct("Symbol");return _t(r)&&Nt(r.prototype,Ut(t))},Dt=String,Bt=function(t){try{return Dt(t)}catch(r){return"Object"}},zt=lt,Wt=Bt,Ht=TypeError,qt=function(t){if(zt(t))return t;throw Ht(Wt(t)+" is not a function")},Vt=qt,Gt=l,Yt=function(t,r){var e=t[r];return Gt(e)?void 0:Vt(e)},$t=It,Kt=lt,Jt=vt,Xt=TypeError,Qt=function(t,r){var e,n;if("string"===r&&Kt(e=t.toString)&&!Jt(n=$t(e,t)))return n;if(Kt(e=t.valueOf)&&!Jt(n=$t(e,t)))return n;if("string"!==r&&Kt(e=t.toString)&&!Jt(n=$t(e,t)))return n;throw Xt("Can't convert object to primitive value")},Zt=It,tr=vt,rr=Ft,er=Yt,nr=Qt,or=TypeError,ir=ot("toPrimitive"),ar=function(t,r){if(!tr(t)||rr(t))return t;var e,n=er(t,ir);if(n){if(void 0===r&&(r="default"),e=Zt(n,t,r),!tr(e)||rr(e))return e;throw or("Can't convert object to primitive value")}return void 0===r&&(r="number"),nr(t,r)},ur=ar,cr=Ft,sr=function(t){var r=ur(t,"string");return cr(r)?r:r+""},fr=ut,lr=Et,hr=wt,pr=Ot,vr=sr,dr=TypeError,gr=Object.defineProperty,yr=Object.getOwnPropertyDescriptor,mr="enumerable",br="configurable",Er="writable";at.f=fr?hr?function(t,r,e){if(pr(t),r=vr(r),pr(e),"function"==typeof t&&"prototype"===r&&"value"in e&&Er in e&&!e[Er]){var n=yr(t,r);n&&n[Er]&&(t[r]=e.value,e={configurable:br in e?e[br]:n[br],enumerable:mr in e?e[mr]:n[mr],writable:!1})}return gr(t,r,e)}:gr:function(t,r,e){if(pr(t),r=vr(r),pr(e),lr)try{return gr(t,r,e)}catch(n){}if("get"in e||"set"in e)throw dr("Accessors not supported");return"value"in e&&(t[r]=e.value),t};var wr=n,Sr=E,Ar=w,xr=at.f,Or=function(t){var r=wr.Symbol||(wr.Symbol={});Sr(r,t)||xr(r,t,{value:Ar.f(t)})};Or("replace");var Rr={},Tr={},Ir={}.propertyIsEnumerable,Pr=Object.getOwnPropertyDescriptor,jr=Pr&&!Ir.call({1:2},1);Tr.f=jr?function(t){var r=Pr(this,t);return!!r&&r.enumerable}:Ir;var Mr=function(t,r){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:r}},Lr=f,kr=Lr({}.toString),Cr=Lr("".slice),_r=function(t){return Cr(kr(t),8,-1)},Nr=o,Ur=_r,Fr=Object,Dr=f("".split),Br=Nr((function(){return!Fr("z").propertyIsEnumerable(0)}))?function(t){return"String"==Ur(t)?Dr(t,""):Fr(t)}:Fr,zr=Br,Wr=v,Hr=function(t){return zr(Wr(t))},qr=ut,Vr=It,Gr=Tr,Yr=Mr,$r=Hr,Kr=sr,Jr=E,Xr=Et,Qr=Object.getOwnPropertyDescriptor;Rr.f=qr?Qr:function(t,r){if(t=$r(t),r=Kr(r),Xr)try{return Qr(t,r)}catch(e){}if(Jr(t,r))return Yr(!Vr(Gr.f,t,r),t[r])};var Zr=at,te=Mr,re=ut?function(t,r,e){return Zr.f(t,r,te(1,e))}:function(t,r,e){return t[r]=e,t},ee={},ne={get exports(){return ee},set exports(t){ee=t}},oe=ut,ie=E,ae=Function.prototype,ue=oe&&Object.getOwnPropertyDescriptor,ce=ie(ae,"name"),se={EXISTS:ce,PROPER:ce&&"something"===function(){}.name,CONFIGURABLE:ce&&(!oe||oe&&ue(ae,"name").configurable)},fe=lt,le=P,he=f(Function.toString);fe(le.inspectSource)||(le.inspectSource=function(t){return he(t)});var pe,ve,de,ge=le.inspectSource,ye=lt,me=e.WeakMap,be=ye(me)&&/native code/.test(String(me)),Ee=U,we=S("keys"),Se=function(t){return we[t]||(we[t]=Ee(t))},Ae={},xe=be,Oe=e,Re=vt,Te=re,Ie=E,Pe=P,je=Se,Me=Ae,Le="Object already initialized",ke=Oe.TypeError,Ce=Oe.WeakMap;if(xe||Pe.state){var _e=Pe.state||(Pe.state=new Ce);_e.get=_e.get,_e.has=_e.has,_e.set=_e.set,pe=function(t,r){if(_e.has(t))throw ke(Le);return r.facade=t,_e.set(t,r),r},ve=function(t){return _e.get(t)||{}},de=function(t){return _e.has(t)}}else{var Ne=je("state");Me[Ne]=!0,pe=function(t,r){if(Ie(t,Ne))throw ke(Le);return r.facade=t,Te(t,Ne,r),r},ve=function(t){return Ie(t,Ne)?t[Ne]:{}},de=function(t){return Ie(t,Ne)}}var Ue={set:pe,get:ve,has:de,enforce:function(t){return de(t)?ve(t):pe(t,{})},getterFor:function(t){return function(r){var e;if(!Re(r)||(e=ve(r)).type!==t)throw ke("Incompatible receiver, "+t+" required");return e}}},Fe=f,De=o,Be=lt,ze=E,We=ut,He=se.CONFIGURABLE,qe=ge,Ve=Ue.enforce,Ge=Ue.get,Ye=String,$e=Object.defineProperty,Ke=Fe("".slice),Je=Fe("".replace),Xe=Fe([].join),Qe=We&&!De((function(){return 8!==$e((function(){}),"length",{value:8}).length})),Ze=String(String).split("String"),tn=ne.exports=function(t,r,e){"Symbol("===Ke(Ye(r),0,7)&&(r="["+Je(Ye(r),/^Symbol\(([^)]*)\)/,"$1")+"]"),e&&e.getter&&(r="get "+r),e&&e.setter&&(r="set "+r),(!ze(t,"name")||He&&t.name!==r)&&(We?$e(t,"name",{value:r,configurable:!0}):t.name=r),Qe&&e&&ze(e,"arity")&&t.length!==e.arity&&$e(t,"length",{value:e.arity});try{e&&ze(e,"constructor")&&e.constructor?We&&$e(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(o){}var n=Ve(t);return ze(n,"source")||(n.source=Xe(Ze,"string"==typeof r?r:"")),t};Function.prototype.toString=tn((function(){return Be(this)&&Ge(this).source||qe(this)}),"toString");var rn=lt,en=at,nn=ee,on=R,an=function(t,r,e,n){n||(n={});var o=n.enumerable,i=void 0!==n.name?n.name:r;if(rn(e)&&nn(e,i,n),n.global)o?t[r]=e:on(r,e);else{try{n.unsafe?t[r]&&(o=!0):delete t[r]}catch(a){}o?t[r]=e:en.f(t,r,{value:e,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return t},un={},cn=Math.ceil,sn=Math.floor,fn=Math.trunc||function(t){var r=+t;return(r>0?sn:cn)(r)},ln=function(t){var r=+t;return r!=r||0===r?0:fn(r)},hn=ln,pn=Math.max,vn=Math.min,dn=function(t,r){var e=hn(t);return e<0?pn(e+r,0):vn(e,r)},gn=ln,yn=Math.min,mn=function(t){return t>0?yn(gn(t),9007199254740991):0},bn=mn,En=function(t){return bn(t.length)},wn=Hr,Sn=dn,An=En,xn=function(t){return function(r,e,n){var o,i=wn(r),a=An(i),u=Sn(n,a);if(t&&e!=e){for(;a>u;)if((o=i[u++])!=o)return!0}else for(;a>u;u++)if((t||u in i)&&i[u]===e)return t||u||0;return!t&&-1}},On={includes:xn(!0),indexOf:xn(!1)},Rn=E,Tn=Hr,In=On.indexOf,Pn=Ae,jn=f([].push),Mn=function(t,r){var e,n=Tn(t),o=0,i=[];for(e in n)!Rn(Pn,e)&&Rn(n,e)&&jn(i,e);for(;r.length>o;)Rn(n,e=r[o++])&&(~In(i,e)||jn(i,e));return i},Ln=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],kn=Mn,Cn=Ln.concat("length","prototype");un.f=Object.getOwnPropertyNames||function(t){return kn(t,Cn)};var _n={};_n.f=Object.getOwnPropertySymbols;var Nn=Lt,Un=un,Fn=_n,Dn=Ot,Bn=f([].concat),zn=Nn("Reflect","ownKeys")||function(t){var r=Un.f(Dn(t)),e=Fn.f;return e?Bn(r,e(t)):r},Wn=E,Hn=zn,qn=Rr,Vn=at,Gn=function(t,r,e){for(var n=Hn(r),o=Vn.f,i=qn.f,a=0;aa;)ko.f(t,e=o[a++],n[e]);return t};var Uo,Fo=Lt("document","documentElement"),Do=Ot,Bo=To,zo=Ln,Wo=Ae,Ho=Fo,qo=mt,Vo="prototype",Go="script",Yo=Se("IE_PROTO"),$o=function(){},Ko=function(t){return"<"+Go+">"+t+""},Jo=function(t){t.write(Ko("")),t.close();var r=t.parentWindow.Object;return t=null,r},Xo=function(){try{Uo=new ActiveXObject("htmlfile")}catch(o){}var t,r,e;Xo="undefined"!=typeof document?document.domain&&Uo?Jo(Uo):(r=qo("iframe"),e="java"+Go+":",r.style.display="none",Ho.appendChild(r),r.src=String(e),(t=r.contentWindow.document).open(),t.write(Ko("document.F=Object")),t.close(),t.F):Jo(Uo);for(var n=zo.length;n--;)delete Xo[Vo][zo[n]];return Xo()};Wo[Yo]=!0;var Qo=Object.create||function(t,r){var e;return null!==t?($o[Vo]=Do(t),e=new $o,$o[Vo]=null,e[Yo]=t):e=Xo(),void 0===r?e:Bo.f(e,r)},Zo=ot,ti=Qo,ri=at.f,ei=Zo("unscopables"),ni=Array.prototype;null==ni[ei]&&ri(ni,ei,{configurable:!0,value:ti(null)});var oi,ii,ai,ui=function(t){ni[ei][t]=!0},ci={},si=o,fi=lt,li=vt,hi=Eo,pi=an,vi=ot("iterator"),di=!1;[].keys&&("next"in(ai=[].keys())?(ii=hi(hi(ai)))!==Object.prototype&&(oi=ii):di=!0);var gi=!li(oi)||si((function(){var t={};return oi[vi].call(t)!==t}));gi&&(oi={}),fi(oi[vi])||pi(oi,vi,(function(){return this}));var yi={IteratorPrototype:oi,BUGGY_SAFARI_ITERATORS:di},mi=at.f,bi=E,Ei=ot("toStringTag"),wi=function(t,r,e){t&&!e&&(t=t.prototype),t&&!bi(t,Ei)&&mi(t,Ei,{configurable:!0,value:r})},Si=yi.IteratorPrototype,Ai=Qo,xi=Mr,Oi=wi,Ri=ci,Ti=function(){return this},Ii=function(t,r,e,n){var o=r+" Iterator";return t.prototype=Ai(Si,{next:xi(+!n,e)}),Oi(t,o,!1),Ri[o]=Ti,t},Pi=lt,ji=String,Mi=TypeError,Li=f,ki=Ot,Ci=function(t){if("object"==typeof t||Pi(t))return t;throw Mi("Can't set "+ji(t)+" as a prototype")},_i=Object.setPrototypeOf||("__proto__"in{}?function(){var t,r=!1,e={};try{(t=Li(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(e,[]),r=e instanceof Array}catch(n){}return function(e,n){return ki(e),Ci(n),r?t(e,n):e.__proto__=n,e}}():void 0),Ni=so,Ui=It,Fi=lt,Di=Ii,Bi=Eo,zi=_i,Wi=wi,Hi=re,qi=an,Vi=ci,Gi=se.PROPER,Yi=se.CONFIGURABLE,$i=yi.IteratorPrototype,Ki=yi.BUGGY_SAFARI_ITERATORS,Ji=ot("iterator"),Xi="keys",Qi="values",Zi="entries",ta=function(){return this},ra=function(t,r,e,n,o,i,a){Di(e,r,n);var u,c,s,f=function(t){if(t===o&&d)return d;if(!Ki&&t in p)return p[t];switch(t){case Xi:case Qi:case Zi:return function(){return new e(this,t)}}return function(){return new e(this)}},l=r+" Iterator",h=!1,p=t.prototype,v=p[Ji]||p["@@iterator"]||o&&p[o],d=!Ki&&v||f(o),g="Array"==r&&p.entries||v;if(g&&(u=Bi(g.call(new t)))!==Object.prototype&&u.next&&(Bi(u)!==$i&&(zi?zi(u,$i):Fi(u[Ji])||qi(u,Ji,ta)),Wi(u,l,!0)),Gi&&o==Qi&&v&&v.name!==Qi&&(Yi?Hi(p,"name",Qi):(h=!0,d=function(){return Ui(v,this)})),o)if(c={values:f(Qi),keys:i?d:f(Xi),entries:f(Zi)},a)for(s in c)(Ki||h||!(s in p))&&qi(p,s,c[s]);else Ni({target:r,proto:!0,forced:Ki||h},c);return p[Ji]!==d&&qi(p,Ji,d,{name:o}),Vi[r]=d,c},ea=function(t,r){return{value:t,done:r}},na=Hr,oa=ui,ia=ci,aa=Ue,ua=at.f,ca=ra,sa=ea,fa=ut,la="Array Iterator",ha=aa.set,pa=aa.getterFor(la),va=ca(Array,"Array",(function(t,r){ha(this,{type:la,target:na(t),index:0,kind:r})}),(function(){var t=pa(this),r=t.target,e=t.kind,n=t.index++;return!r||n>=r.length?(t.target=void 0,sa(void 0,!0)):sa("keys"==e?n:"values"==e?r[n]:[n,r[n]],!1)}),"values"),da=ia.Arguments=ia.Array;if(oa("keys"),oa("values"),oa("entries"),fa&&"values"!==da.name)try{ua(da,"name",{value:"values"})}catch(ZW){}var ga={};ga[ot("toStringTag")]="z";var ya="[object z]"===String(ga),ma=ya,ba=lt,Ea=_r,wa=ot("toStringTag"),Sa=Object,Aa="Arguments"==Ea(function(){return arguments}()),xa=ma?Ea:function(t){var r,e,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(e=function(t,r){try{return t[r]}catch(ZW){}}(r=Sa(t),wa))?e:Aa?Ea(r):"Object"==(n=Ea(r))&&ba(r.callee)?"Arguments":n},Oa=xa,Ra=ya?{}.toString:function(){return"[object "+Oa(this)+"]"};ya||an(Object.prototype,"toString",Ra,{unsafe:!0});var Ta=xa,Ia=String,Pa=function(t){if("Symbol"===Ta(t))throw TypeError("Cannot convert a Symbol value to a string");return Ia(t)},ja=f,Ma=ln,La=Pa,ka=v,Ca=ja("".charAt),_a=ja("".charCodeAt),Na=ja("".slice),Ua=function(t){return function(r,e){var n,o,i=La(ka(r)),a=Ma(e),u=i.length;return a<0||a>=u?t?"":void 0:(n=_a(i,a))<55296||n>56319||a+1===u||(o=_a(i,a+1))<56320||o>57343?t?Ca(i,a):n:t?Na(i,a,a+2):o-56320+(n-55296<<10)+65536}},Fa={codeAt:Ua(!1),charAt:Ua(!0)},Da=Fa.charAt,Ba=Pa,za=Ue,Wa=ra,Ha=ea,qa="String Iterator",Va=za.set,Ga=za.getterFor(qa);Wa(String,"String",(function(t){Va(this,{type:qa,string:Ba(t),index:0})}),(function(){var t,r=Ga(this),e=r.string,n=r.index;return n>=e.length?Ha(void 0,!0):(t=Da(e,n),r.index+=t.length,Ha(t,!1))}));var Ya={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},$a=mt("span").classList,Ka=$a&&$a.constructor&&$a.constructor.prototype,Ja=Ka===Object.prototype?void 0:Ka,Xa=e,Qa=Ya,Za=Ja,tu=va,ru=re,eu=ot,nu=eu("iterator"),ou=eu("toStringTag"),iu=tu.values,au=function(t,r){if(t){if(t[nu]!==iu)try{ru(t,nu,iu)}catch(ZW){t[nu]=iu}if(t[ou]||ru(t,ou,r),Qa[r])for(var e in tu)if(t[e]!==tu[e])try{ru(t,e,tu[e])}catch(ZW){t[e]=tu[e]}}};for(var uu in Qa)au(Xa[uu]&&Xa[uu].prototype,uu);au(Za,"DOMTokenList");var cu=o,su=ot("iterator"),fu=!cu((function(){var t=new URL("b?a=1&b=2&c=3","http://a"),r=t.searchParams,e="";return t.pathname="c%20d",r.forEach((function(t,n){r.delete("b"),e+=n+t})),!r.sort||"http://a/c%20d?a=1&c=3"!==t.href||"3"!==r.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!r[su]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==e||"x"!==new URL("http://x",void 0).host})),lu=_r,hu=f,pu=function(t){if("Function"===lu(t))return hu(t)},vu=qt,du=i,gu=pu(pu.bind),yu=function(t,r){return vu(t),void 0===r?t:du?gu(t,r):function(){return t.apply(r,arguments)}},mu=ee,bu=at,Eu=function(t,r,e){return e.get&&mu(e.get,r,{getter:!0}),e.set&&mu(e.set,r,{setter:!0}),bu.f(t,r,e)},wu=kt,Su=TypeError,Au=function(t,r){if(wu(r,t))return t;throw Su("Incorrect invocation")},xu=ut,Ou=f,Ru=It,Tu=o,Iu=jo,Pu=_n,ju=Tr,Mu=y,Lu=Br,ku=Object.assign,Cu=Object.defineProperty,_u=Ou([].concat),Nu=!ku||Tu((function(){if(xu&&1!==ku({b:1},ku(Cu({},"a",{enumerable:!0,get:function(){Cu(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},r={},e=Symbol(),n="abcdefghijklmnopqrst";return t[e]=7,n.split("").forEach((function(t){r[t]=t})),7!=ku({},t)[e]||Iu(ku({},r)).join("")!=n}))?function(t,r){for(var e=Mu(t),n=arguments.length,o=1,i=Pu.f,a=ju.f;n>o;)for(var u,c=Lu(arguments[o++]),s=i?_u(Iu(c),i(c)):Iu(c),f=s.length,l=0;f>l;)u=s[l++],xu&&!Ru(a,c,u)||(e[u]=c[u]);return e}:ku,Uu=It,Fu=Ot,Du=Yt,Bu=function(t,r,e){var n,o;Fu(t);try{if(!(n=Du(t,"return"))){if("throw"===r)throw e;return e}n=Uu(n,t)}catch(ZW){o=!0,n=ZW}if("throw"===r)throw e;if(o)throw n;return Fu(n),e},zu=Ot,Wu=Bu,Hu=ci,qu=ot("iterator"),Vu=Array.prototype,Gu=function(t){return void 0!==t&&(Hu.Array===t||Vu[qu]===t)},Yu=f,$u=o,Ku=lt,Ju=xa,Xu=ge,Qu=function(){},Zu=[],tc=Lt("Reflect","construct"),rc=/^\s*(?:class|function)\b/,ec=Yu(rc.exec),nc=!rc.exec(Qu),oc=function(t){if(!Ku(t))return!1;try{return tc(Qu,Zu,t),!0}catch(ZW){return!1}},ic=function(t){if(!Ku(t))return!1;switch(Ju(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return nc||!!ec(rc,Xu(t))}catch(ZW){return!0}};ic.sham=!0;var ac=!tc||$u((function(){var t;return oc(oc.call)||!oc(Object)||!oc((function(){t=!0}))||t}))?ic:oc,uc=sr,cc=at,sc=Mr,fc=function(t,r,e){var n=uc(r);n in t?cc.f(t,n,sc(0,e)):t[n]=e},lc=xa,hc=Yt,pc=l,vc=ci,dc=ot("iterator"),gc=function(t){if(!pc(t))return hc(t,dc)||hc(t,"@@iterator")||vc[lc(t)]},yc=It,mc=qt,bc=Ot,Ec=Bt,wc=gc,Sc=TypeError,Ac=function(t,r){var e=arguments.length<2?wc(t):r;if(mc(e))return bc(yc(e,t));throw Sc(Ec(t)+" is not iterable")},xc=yu,Oc=It,Rc=y,Tc=function(t,r,e,n){try{return n?r(zu(e)[0],e[1]):r(e)}catch(ZW){Wu(t,"throw",ZW)}},Ic=Gu,Pc=ac,jc=En,Mc=fc,Lc=Ac,kc=gc,Cc=Array,_c=function(t){var r=Rc(t),e=Pc(this),n=arguments.length,o=n>1?arguments[1]:void 0,i=void 0!==o;i&&(o=xc(o,n>2?arguments[2]:void 0));var a,u,c,s,f,l,h=kc(r),p=0;if(!h||this===Cc&&Ic(h))for(a=jc(r),u=e?new this(a):Cc(a);a>p;p++)l=i?o(r[p],p):r[p],Mc(u,p,l);else for(f=(s=Lc(r,h)).next,u=e?new this:[];!(c=Oc(f,s)).done;p++)l=i?Tc(s,o,[c.value,p],!0):c.value,Mc(u,p,l);return u.length=p,u},Nc=dn,Uc=En,Fc=fc,Dc=Array,Bc=Math.max,zc=function(t,r,e){for(var n=Uc(t),o=Nc(r,n),i=Nc(void 0===e?n:e,n),a=Dc(Bc(i-o,0)),u=0;o>1,t+=Kc(t/r);t>455;)t=Kc(t/35),n+=36;return Kc(n+36*t/(t+38))},is=function(t){var r=[];t=function(t){for(var r=[],e=0,n=t.length;e=55296&&o<=56319&&e=i&&nKc((Hc-a)/l))throw Yc(Gc);for(a+=(f-i)*l,i=f,e=0;eHc)throw Yc(Gc);if(n==i){for(var h=a,p=36;;){var v=p<=u?1:p>=u+26?26:p-u;if(h0;)t[n]=t[--n];n!==i++&&(t[n]=e)}return t},vs=function(t,r,e,n){for(var o=r.length,i=e.length,a=0,u=0;a0?arguments[0]:void 0;qs(this,new Af(t))},Of=xf.prototype;if(As(Of,{append:function(t,r){Ds(arguments.length,2);var e=Vs(this);uf(e.entries,{key:Cs(t),value:Cs(r)}),e.updateURL()},delete:function(t){Ds(arguments.length,1);for(var r=Vs(this),e=r.entries,n=Cs(t),o=0;or.key?1:-1})),t.updateURL()},forEach:function(t){for(var r,e=Vs(this).entries,n=js(t,arguments.length>1?arguments[1]:void 0),o=0;o1?If(arguments[1]):{})}}),Is(Js)){var Pf=function(t){return Ts(this,Qs),new Js(t,arguments.length>1?If(arguments[1]):{})};Qs.constructor=Pf,Pf.prototype=Qs,gs({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:Pf})}}var jf,Mf=so,Lf=ut,kf=fu,Cf=e,_f=yu,Nf=f,Uf=an,Ff=Eu,Df=Au,Bf=E,zf=Nu,Wf=_c,Hf=zc,qf=Fa.codeAt,Vf=function(t){var r,e,n=[],o=rs(ts(es(t),Vc,"."),".");for(r=0;r?@[\\\]^|]/,Pl=/[\0\t\n\r #/:<>?@[\\\]^|]/,jl=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,Ml=/[\t\n\r]/g,Ll=function(t){var r,e,n,o;if("number"==typeof t){for(r=[],e=0;e<4;e++)yl(r,t%256),t=ol(t/256);return cl(r,".")}if("object"==typeof t){for(r="",n=function(t){for(var r=null,e=1,n=null,o=0,i=0;i<8;i++)0!==t[i]?(o>e&&(r=n,e=o),n=null,o=0):(null===n&&(n=i),++o);return o>e&&(r=n,e=o),r}(t),e=0;e<8;e++)o&&0===t[e]||(o&&(o=!1),n===e?(r+=e?":":"::",o=!0):(r+=sl(t[e],16),e<7&&(r+=":")));return"["+r+"]"}return t},kl={},Cl=zf({},kl,{" ":1,'"':1,"<":1,">":1,"`":1}),_l=zf({},Cl,{"#":1,"?":1,"{":1,"}":1}),Nl=zf({},_l,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Ul=function(t,r){var e=qf(t,0);return e>32&&e<127&&!Bf(r,t)?t:encodeURIComponent(t)},Fl={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Dl=function(t,r){var e;return 2==t.length&&ul(wl,al(t,0))&&(":"==(e=al(t,1))||!r&&"|"==e)},Bl=function(t){var r;return t.length>1&&Dl(dl(t,0,2))&&(2==t.length||"/"===(r=al(t,2))||"\\"===r||"?"===r||"#"===r)},zl=function(t){return"."===t||"%2e"===gl(t)},Wl={},Hl={},ql={},Vl={},Gl={},Yl={},$l={},Kl={},Jl={},Xl={},Ql={},Zl={},th={},rh={},eh={},nh={},oh={},ih={},ah={},uh={},ch={},sh=function(t,r,e){var n,o,i,a=Gf(t);if(r){if(o=this.parse(a))throw el(o);this.searchParams=null}else{if(void 0!==e&&(n=new sh(e,!0)),o=this.parse(a,null,n))throw el(o);(i=tl(new Zf)).bindURL(this),this.searchParams=i}};sh.prototype={type:"URL",parse:function(t,r,e){var n,o,i,a,u,c=this,s=r||Wl,f=0,l="",h=!1,p=!1,v=!1;for(t=Gf(t),r||(c.scheme="",c.username="",c.password="",c.host=null,c.port=null,c.path=[],c.query=null,c.fragment=null,c.cannotBeABaseURL=!1,t=hl(t,jl,"")),t=hl(t,Ml,""),n=Wf(t);f<=n.length;){switch(o=n[f],s){case Wl:if(!o||!ul(wl,o)){if(r)return ml;s=ql;continue}l+=gl(o),s=Hl;break;case Hl:if(o&&(ul(Sl,o)||"+"==o||"-"==o||"."==o))l+=gl(o);else{if(":"!=o){if(r)return ml;l="",s=ql,f=0;continue}if(r&&(c.isSpecial()!=Bf(Fl,l)||"file"==l&&(c.includesCredentials()||null!==c.port)||"file"==c.scheme&&!c.host))return;if(c.scheme=l,r)return void(c.isSpecial()&&Fl[c.scheme]==c.port&&(c.port=null));l="","file"==c.scheme?s=rh:c.isSpecial()&&e&&e.scheme==c.scheme?s=Vl:c.isSpecial()?s=Kl:"/"==n[f+1]?(s=Gl,f++):(c.cannotBeABaseURL=!0,ll(c.path,""),s=ah)}break;case ql:if(!e||e.cannotBeABaseURL&&"#"!=o)return ml;if(e.cannotBeABaseURL&&"#"==o){c.scheme=e.scheme,c.path=Hf(e.path),c.query=e.query,c.fragment="",c.cannotBeABaseURL=!0,s=ch;break}s="file"==e.scheme?rh:Yl;continue;case Vl:if("/"!=o||"/"!=n[f+1]){s=Yl;continue}s=Jl,f++;break;case Gl:if("/"==o){s=Xl;break}s=ih;continue;case Yl:if(c.scheme=e.scheme,o==jf)c.username=e.username,c.password=e.password,c.host=e.host,c.port=e.port,c.path=Hf(e.path),c.query=e.query;else if("/"==o||"\\"==o&&c.isSpecial())s=$l;else if("?"==o)c.username=e.username,c.password=e.password,c.host=e.host,c.port=e.port,c.path=Hf(e.path),c.query="",s=uh;else{if("#"!=o){c.username=e.username,c.password=e.password,c.host=e.host,c.port=e.port,c.path=Hf(e.path),c.path.length--,s=ih;continue}c.username=e.username,c.password=e.password,c.host=e.host,c.port=e.port,c.path=Hf(e.path),c.query=e.query,c.fragment="",s=ch}break;case $l:if(!c.isSpecial()||"/"!=o&&"\\"!=o){if("/"!=o){c.username=e.username,c.password=e.password,c.host=e.host,c.port=e.port,s=ih;continue}s=Xl}else s=Jl;break;case Kl:if(s=Jl,"/"!=o||"/"!=al(l,f+1))continue;f++;break;case Jl:if("/"!=o&&"\\"!=o){s=Xl;continue}break;case Xl:if("@"==o){h&&(l="%40"+l),h=!0,i=Wf(l);for(var d=0;d65535)return El;c.port=c.isSpecial()&&m===Fl[c.scheme]?null:m,l=""}if(r)return;s=oh;continue}return El}l+=o;break;case rh:if(c.scheme="file","/"==o||"\\"==o)s=eh;else{if(!e||"file"!=e.scheme){s=ih;continue}if(o==jf)c.host=e.host,c.path=Hf(e.path),c.query=e.query;else if("?"==o)c.host=e.host,c.path=Hf(e.path),c.query="",s=uh;else{if("#"!=o){Bl(cl(Hf(n,f),""))||(c.host=e.host,c.path=Hf(e.path),c.shortenPath()),s=ih;continue}c.host=e.host,c.path=Hf(e.path),c.query=e.query,c.fragment="",s=ch}}break;case eh:if("/"==o||"\\"==o){s=nh;break}e&&"file"==e.scheme&&!Bl(cl(Hf(n,f),""))&&(Dl(e.path[0],!0)?ll(c.path,e.path[0]):c.host=e.host),s=ih;continue;case nh:if(o==jf||"/"==o||"\\"==o||"?"==o||"#"==o){if(!r&&Dl(l))s=ih;else if(""==l){if(c.host="",r)return;s=oh}else{if(a=c.parseHost(l))return a;if("localhost"==c.host&&(c.host=""),r)return;l="",s=oh}continue}l+=o;break;case oh:if(c.isSpecial()){if(s=ih,"/"!=o&&"\\"!=o)continue}else if(r||"?"!=o)if(r||"#"!=o){if(o!=jf&&(s=ih,"/"!=o))continue}else c.fragment="",s=ch;else c.query="",s=uh;break;case ih:if(o==jf||"/"==o||"\\"==o&&c.isSpecial()||!r&&("?"==o||"#"==o)){if(".."===(u=gl(u=l))||"%2e."===u||".%2e"===u||"%2e%2e"===u?(c.shortenPath(),"/"==o||"\\"==o&&c.isSpecial()||ll(c.path,"")):zl(l)?"/"==o||"\\"==o&&c.isSpecial()||ll(c.path,""):("file"==c.scheme&&!c.path.length&&Dl(l)&&(c.host&&(c.host=""),l=al(l,0)+":"),ll(c.path,l)),l="","file"==c.scheme&&(o==jf||"?"==o||"#"==o))for(;c.path.length>1&&""===c.path[0];)pl(c.path);"?"==o?(c.query="",s=uh):"#"==o&&(c.fragment="",s=ch)}else l+=Ul(o,_l);break;case ah:"?"==o?(c.query="",s=uh):"#"==o?(c.fragment="",s=ch):o!=jf&&(c.path[0]+=Ul(o,kl));break;case uh:r||"#"!=o?o!=jf&&("'"==o&&c.isSpecial()?c.query+="%27":c.query+="#"==o?"%23":Ul(o,kl)):(c.fragment="",s=ch);break;case ch:o!=jf&&(c.fragment+=Ul(o,Cl))}f++}},parseHost:function(t){var r,e,n;if("["==al(t,0)){if("]"!=al(t,t.length-1))return bl;if(r=function(t){var r,e,n,o,i,a,u,c=[0,0,0,0,0,0,0,0],s=0,f=null,l=0,h=function(){return al(t,l)};if(":"==h()){if(":"!=al(t,1))return;l+=2,f=++s}for(;h();){if(8==s)return;if(":"!=h()){for(r=e=0;e<4&&ul(Tl,h());)r=16*r+nl(h(),16),l++,e++;if("."==h()){if(0==e)return;if(l-=e,s>6)return;for(n=0;h();){if(o=null,n>0){if(!("."==h()&&n<4))return;l++}if(!ul(Al,h()))return;for(;ul(Al,h());){if(i=nl(h(),10),null===o)o=i;else{if(0==o)return;o=10*o+i}if(o>255)return;l++}c[s]=256*c[s]+o,2!=++n&&4!=n||s++}if(4!=n)return;break}if(":"==h()){if(l++,!h())return}else if(h())return;c[s++]=r}else{if(null!==f)return;l++,f=++s}}if(null!==f)for(a=s-f,s=7;0!=s&&a>0;)u=c[s],c[s--]=c[f+a-1],c[f+--a]=u;else if(8!=s)return;return c}(dl(t,1,-1)),!r)return bl;this.host=r}else if(this.isSpecial()){if(t=Vf(t),ul(Il,t))return bl;if(r=function(t){var r,e,n,o,i,a,u,c=vl(t,".");if(c.length&&""==c[c.length-1]&&c.length--,(r=c.length)>4)return t;for(e=[],n=0;n1&&"0"==al(o,0)&&(i=ul(xl,o)?16:8,o=dl(o,8==i?1:2)),""===o)a=0;else{if(!ul(10==i?Rl:8==i?Ol:Tl,o))return t;a=nl(o,i)}ll(e,a)}for(n=0;n=il(256,5-r))return null}else if(a>255)return null;for(u=fl(e),n=0;n1?arguments[1]:void 0,n=Xf(r,new sh(t,!1,e));Lf||(r.href=n.serialize(),r.origin=n.getOrigin(),r.protocol=n.getProtocol(),r.username=n.getUsername(),r.password=n.getPassword(),r.host=n.getHost(),r.hostname=n.getHostname(),r.port=n.getPort(),r.pathname=n.getPathname(),r.search=n.getSearch(),r.searchParams=n.getSearchParams(),r.hash=n.getHash())},lh=fh.prototype,hh=function(t,r){return{get:function(){return Qf(this)[t]()},set:r&&function(t){return Qf(this)[r](t)},configurable:!0,enumerable:!0}};if(Lf&&(Ff(lh,"href",hh("serialize","setHref")),Ff(lh,"origin",hh("getOrigin")),Ff(lh,"protocol",hh("getProtocol","setProtocol")),Ff(lh,"username",hh("getUsername","setUsername")),Ff(lh,"password",hh("getPassword","setPassword")),Ff(lh,"host",hh("getHost","setHost")),Ff(lh,"hostname",hh("getHostname","setHostname")),Ff(lh,"port",hh("getPort","setPort")),Ff(lh,"pathname",hh("getPathname","setPathname")),Ff(lh,"search",hh("getSearch","setSearch")),Ff(lh,"searchParams",hh("getSearchParams")),Ff(lh,"hash",hh("getHash","setHash"))),Uf(lh,"toJSON",(function(){return Qf(this).serialize()}),{enumerable:!0}),Uf(lh,"toString",(function(){return Qf(this).serialize()}),{enumerable:!0}),rl){var ph=rl.createObjectURL,vh=rl.revokeObjectURL;ph&&Uf(fh,"createObjectURL",_f(ph,rl)),vh&&Uf(fh,"revokeObjectURL",_f(vh,rl))}Yf(fh,"URL"),Mf({global:!0,constructor:!0,forced:!kf,sham:!Lf},{URL:fh});var dh=!o((function(){return Object.isExtensible(Object.preventExtensions({}))})),gh={},yh={get exports(){return gh},set exports(t){gh=t}},mh={},bh=_r,Eh=Hr,wh=un.f,Sh=zc,Ah="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];mh.f=function(t){return Ah&&"Window"==bh(t)?function(t){try{return wh(t)}catch(ZW){return Sh(Ah)}}(t):wh(Eh(t))};var xh=o((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}})),Oh=o,Rh=vt,Th=_r,Ih=xh,Ph=Object.isExtensible,jh=Oh((function(){Ph(1)}))||Ih?function(t){return!!Rh(t)&&((!Ih||"ArrayBuffer"!=Th(t))&&(!Ph||Ph(t)))}:Ph,Mh=so,Lh=f,kh=Ae,Ch=vt,_h=E,Nh=at.f,Uh=un,Fh=mh,Dh=jh,Bh=dh,zh=!1,Wh=U("meta"),Hh=0,qh=function(t){Nh(t,Wh,{value:{objectID:"O"+Hh++,weakData:{}}})},Vh=yh.exports={enable:function(){Vh.enable=function(){},zh=!0;var t=Uh.f,r=Lh([].splice),e={};e[Wh]=1,t(e).length&&(Uh.f=function(e){for(var n=t(e),o=0,i=n.length;om;m++)if((u||m in d)&&(p=g(h=d[m],m,v),t))if(r)E[m]=p;else if(p)switch(t){case 3:return!0;case 5:return h;case 6:return m;case 2:Sp(E,h)}else switch(t){case 4:return!1;case 7:Sp(E,h)}return i?-1:n||o?o:E}},xp={forEach:Ap(0),map:Ap(1),filter:Ap(2),some:Ap(3),every:Ap(4),find:Ap(5),findIndex:Ap(6),filterReject:Ap(7)},Op=so,Rp=e,Tp=It,Ip=f,Pp=ut,jp=$,Mp=o,Lp=E,kp=kt,Cp=Ot,_p=Hr,Np=sr,Up=Pa,Fp=Mr,Dp=Qo,Bp=jo,zp=un,Wp=mh,Hp=_n,qp=Rr,Vp=at,Gp=To,Yp=Tr,$p=an,Kp=S,Jp=Ae,Xp=U,Qp=ot,Zp=w,tv=Or,rv=up,ev=wi,nv=Ue,ov=xp.forEach,iv=Se("hidden"),av="Symbol",uv="prototype",cv=nv.set,sv=nv.getterFor(av),fv=Object[uv],lv=Rp.Symbol,hv=lv&&lv[uv],pv=Rp.TypeError,vv=Rp.QObject,dv=qp.f,gv=Vp.f,yv=Wp.f,mv=Yp.f,bv=Ip([].push),Ev=Kp("symbols"),wv=Kp("op-symbols"),Sv=Kp("wks"),Av=!vv||!vv[uv]||!vv[uv].findChild,xv=Pp&&Mp((function(){return 7!=Dp(gv({},"a",{get:function(){return gv(this,"a",{value:7}).a}})).a}))?function(t,r,e){var n=dv(fv,r);n&&delete fv[r],gv(t,r,e),n&&t!==fv&&gv(fv,r,n)}:gv,Ov=function(t,r){var e=Ev[t]=Dp(hv);return cv(e,{type:av,tag:t,description:r}),Pp||(e.description=r),e},Rv=function(t,r,e){t===fv&&Rv(wv,r,e),Cp(t);var n=Np(r);return Cp(e),Lp(Ev,n)?(e.enumerable?(Lp(t,iv)&&t[iv][n]&&(t[iv][n]=!1),e=Dp(e,{enumerable:Fp(0,!1)})):(Lp(t,iv)||gv(t,iv,Fp(1,{})),t[iv][n]=!0),xv(t,n,e)):gv(t,n,e)},Tv=function(t,r){Cp(t);var e=_p(r),n=Bp(e).concat(Mv(e));return ov(n,(function(r){Pp&&!Tp(Iv,e,r)||Rv(t,r,e[r])})),t},Iv=function(t){var r=Np(t),e=Tp(mv,this,r);return!(this===fv&&Lp(Ev,r)&&!Lp(wv,r))&&(!(e||!Lp(this,r)||!Lp(Ev,r)||Lp(this,iv)&&this[iv][r])||e)},Pv=function(t,r){var e=_p(t),n=Np(r);if(e!==fv||!Lp(Ev,n)||Lp(wv,n)){var o=dv(e,n);return!o||!Lp(Ev,n)||Lp(e,iv)&&e[iv][n]||(o.enumerable=!0),o}},jv=function(t){var r=yv(_p(t)),e=[];return ov(r,(function(t){Lp(Ev,t)||Lp(Jp,t)||bv(e,t)})),e},Mv=function(t){var r=t===fv,e=yv(r?wv:_p(t)),n=[];return ov(e,(function(t){!Lp(Ev,t)||r&&!Lp(fv,t)||bv(n,Ev[t])})),n};jp||(lv=function(){if(kp(hv,this))throw pv("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?Up(arguments[0]):void 0,r=Xp(t),e=function(t){this===fv&&Tp(e,wv,t),Lp(this,iv)&&Lp(this[iv],r)&&(this[iv][r]=!1),xv(this,r,Fp(1,t))};return Pp&&Av&&xv(fv,r,{configurable:!0,set:e}),Ov(r,t)},$p(hv=lv[uv],"toString",(function(){return sv(this).tag})),$p(lv,"withoutSetter",(function(t){return Ov(Xp(t),t)})),Yp.f=Iv,Vp.f=Rv,Gp.f=Tv,qp.f=Pv,zp.f=Wp.f=jv,Hp.f=Mv,Zp.f=function(t){return Ov(Qp(t),t)},Pp&&(gv(hv,"description",{configurable:!0,get:function(){return sv(this).description}}),$p(fv,"propertyIsEnumerable",Iv,{unsafe:!0}))),Op({global:!0,constructor:!0,wrap:!0,forced:!jp,sham:!jp},{Symbol:lv}),ov(Bp(Sv),(function(t){tv(t)})),Op({target:av,stat:!0,forced:!jp},{useSetter:function(){Av=!0},useSimple:function(){Av=!1}}),Op({target:"Object",stat:!0,forced:!jp,sham:!Pp},{create:function(t,r){return void 0===r?Dp(t):Tv(Dp(t),r)},defineProperty:Rv,defineProperties:Tv,getOwnPropertyDescriptor:Pv}),Op({target:"Object",stat:!0,forced:!jp},{getOwnPropertyNames:jv}),rv(),ev(lv,av),Jp[iv]=!0;var Lv=$&&!!Symbol.for&&!!Symbol.keyFor,kv=so,Cv=Lt,_v=E,Nv=Pa,Uv=S,Fv=Lv,Dv=Uv("string-to-symbol-registry"),Bv=Uv("symbol-to-string-registry");kv({target:"Symbol",stat:!0,forced:!Fv},{for:function(t){var r=Nv(t);if(_v(Dv,r))return Dv[r];var e=Cv("Symbol")(r);return Dv[r]=e,Bv[e]=r,e}});var zv=so,Wv=E,Hv=Ft,qv=Bt,Vv=Lv,Gv=S("symbol-to-string-registry");zv({target:"Symbol",stat:!0,forced:!Vv},{keyFor:function(t){if(!Hv(t))throw TypeError(qv(t)+" is not a symbol");if(Wv(Gv,t))return Gv[t]}});var Yv=i,$v=Function.prototype,Kv=$v.apply,Jv=$v.call,Xv="object"==typeof Reflect&&Reflect.apply||(Yv?Jv.bind(Kv):function(){return Jv.apply(Kv,arguments)}),Qv=f([].slice),Zv=so,td=Lt,rd=Xv,ed=It,nd=f,od=o,id=sp,ad=lt,ud=vt,cd=Ft,sd=Qv,fd=$,ld=td("JSON","stringify"),hd=nd(/./.exec),pd=nd("".charAt),vd=nd("".charCodeAt),dd=nd("".replace),gd=nd(1..toString),yd=/[\uD800-\uDFFF]/g,md=/^[\uD800-\uDBFF]$/,bd=/^[\uDC00-\uDFFF]$/,Ed=!fd||od((function(){var t=td("Symbol")();return"[null]"!=ld([t])||"{}"!=ld({a:t})||"{}"!=ld(Object(t))})),wd=od((function(){return'"\\udf06\\ud834"'!==ld("\udf06\ud834")||'"\\udead"'!==ld("\udead")})),Sd=function(t,r){var e=sd(arguments),n=r;if((ud(r)||void 0!==t)&&!cd(t))return id(r)||(r=function(t,r){if(ad(n)&&(r=ed(n,this,t,r)),!cd(r))return r}),e[1]=r,rd(ld,null,e)},Ad=function(t,r,e){var n=pd(e,r-1),o=pd(e,r+1);return hd(md,t)&&!hd(bd,o)||hd(bd,t)&&!hd(md,n)?"\\u"+gd(vd(t,0),16):t};ld&&Zv({target:"JSON",stat:!0,arity:3,forced:Ed||wd},{stringify:function(t,r,e){var n=sd(arguments),o=rd(Ed?Sd:ld,null,n);return wd&&"string"==typeof o?dd(o,yd,Ad):o}});var xd=_n,Od=y;so({target:"Object",stat:!0,forced:!$||o((function(){xd.f(1)}))},{getOwnPropertySymbols:function(t){var r=xd.f;return r?r(Od(t)):[]}});var Rd=so,Td=ut,Id=e,Pd=f,jd=E,Md=lt,Ld=kt,kd=Pa,Cd=at.f,_d=Gn,Nd=Id.Symbol,Ud=Nd&&Nd.prototype;if(Td&&Md(Nd)&&(!("description"in Ud)||void 0!==Nd().description)){var Fd={},Dd=function(){var t=arguments.length<1||void 0===arguments[0]?void 0:kd(arguments[0]),r=Ld(Ud,this)?new Nd(t):void 0===t?Nd():Nd(t);return""===t&&(Fd[r]=!0),r};_d(Dd,Nd),Dd.prototype=Ud,Ud.constructor=Dd;var Bd="Symbol(test)"==String(Nd("test")),zd=Pd(Ud.valueOf),Wd=Pd(Ud.toString),Hd=/^Symbol\((.*)\)[^)]+$/,qd=Pd("".replace),Vd=Pd("".slice);Cd(Ud,"description",{configurable:!0,get:function(){var t=zd(this);if(jd(Fd,t))return"";var r=Wd(t),e=Bd?Vd(r,7,-1):qd(r,Hd,"$1");return""===e?void 0:e}}),Rd({global:!0,constructor:!0,forced:!0},{Symbol:Dd})}var Gd=so,Yd=o,$d=Hr,Kd=Rr.f,Jd=ut;Gd({target:"Object",stat:!0,forced:!Jd||Yd((function(){Kd(1)})),sham:!Jd},{getOwnPropertyDescriptor:function(t,r){return Kd($d(t),r)}});var Xd,Qd,Zd,tg,rg="undefined"!=typeof process&&"process"==_r(process),eg=Lt,ng=at,og=ut,ig=ot("species"),ag=function(t){var r=eg(t),e=ng.f;og&&r&&!r[ig]&&e(r,ig,{configurable:!0,get:function(){return this}})},ug=ac,cg=Bt,sg=TypeError,fg=function(t){if(ug(t))return t;throw sg(cg(t)+" is not a constructor")},lg=Ot,hg=fg,pg=l,vg=ot("species"),dg=function(t,r){var e,n=lg(t).constructor;return void 0===n||pg(e=lg(n)[vg])?r:hg(e)},gg=/(?:ipad|iphone|ipod).*applewebkit/i.test(F),yg=e,mg=Xv,bg=yu,Eg=lt,wg=E,Sg=o,Ag=Fo,xg=Qv,Og=mt,Rg=us,Tg=gg,Ig=rg,Pg=yg.setImmediate,jg=yg.clearImmediate,Mg=yg.process,Lg=yg.Dispatch,kg=yg.Function,Cg=yg.MessageChannel,_g=yg.String,Ng=0,Ug={},Fg="onreadystatechange";Sg((function(){Xd=yg.location}));var Dg=function(t){if(wg(Ug,t)){var r=Ug[t];delete Ug[t],r()}},Bg=function(t){return function(){Dg(t)}},zg=function(t){Dg(t.data)},Wg=function(t){yg.postMessage(_g(t),Xd.protocol+"//"+Xd.host)};Pg&&jg||(Pg=function(t){Rg(arguments.length,1);var r=Eg(t)?t:kg(t),e=xg(arguments,1);return Ug[++Ng]=function(){mg(r,void 0,e)},Qd(Ng),Ng},jg=function(t){delete Ug[t]},Ig?Qd=function(t){Mg.nextTick(Bg(t))}:Lg&&Lg.now?Qd=function(t){Lg.now(Bg(t))}:Cg&&!Tg?(tg=(Zd=new Cg).port2,Zd.port1.onmessage=zg,Qd=bg(tg.postMessage,tg)):yg.addEventListener&&Eg(yg.postMessage)&&!yg.importScripts&&Xd&&"file:"!==Xd.protocol&&!Sg(Wg)?(Qd=Wg,yg.addEventListener("message",zg,!1)):Qd=Fg in Og("script")?function(t){Ag.appendChild(Og("script"))[Fg]=function(){Ag.removeChild(this),Dg(t)}}:function(t){setTimeout(Bg(t),0)});var Hg={set:Pg,clear:jg},qg=function(){this.head=null,this.tail=null};qg.prototype={add:function(t){var r={item:t,next:null},e=this.tail;e?e.next=r:this.head=r,this.tail=r},get:function(){var t=this.head;if(t)return null===(this.head=t.next)&&(this.tail=null),t.item}};var Vg,Gg,Yg,$g,Kg,Jg=qg,Xg=/ipad|iphone|ipod/i.test(F)&&"undefined"!=typeof Pebble,Qg=/web0s(?!.*chrome)/i.test(F),Zg=e,ty=yu,ry=Rr.f,ey=Hg.set,ny=Jg,oy=gg,iy=Xg,ay=Qg,uy=rg,cy=Zg.MutationObserver||Zg.WebKitMutationObserver,sy=Zg.document,fy=Zg.process,ly=Zg.Promise,hy=ry(Zg,"queueMicrotask"),py=hy&&hy.value;if(!py){var vy=new ny,dy=function(){var t,r;for(uy&&(t=fy.domain)&&t.exit();r=vy.get();)try{r()}catch(ZW){throw vy.head&&Vg(),ZW}t&&t.enter()};oy||uy||ay||!cy||!sy?!iy&&ly&&ly.resolve?(($g=ly.resolve(void 0)).constructor=ly,Kg=ty($g.then,$g),Vg=function(){Kg(dy)}):uy?Vg=function(){fy.nextTick(dy)}:(ey=ty(ey,Zg),Vg=function(){ey(dy)}):(Gg=!0,Yg=sy.createTextNode(""),new cy(dy).observe(Yg,{characterData:!0}),Vg=function(){Yg.data=Gg=!Gg}),py=function(t){vy.head||Vg(),vy.add(t)}}var gy=py,yy=function(t){try{return{error:!1,value:t()}}catch(ZW){return{error:!0,value:ZW}}},my=e.Promise,by="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,Ey=!by&&!rg&&"object"==typeof window&&"object"==typeof document,wy=e,Sy=my,Ay=lt,xy=ro,Oy=ge,Ry=ot,Ty=Ey,Iy=by,Py=V;Sy&&Sy.prototype;var jy=Ry("species"),My=!1,Ly=Ay(wy.PromiseRejectionEvent),ky=xy("Promise",(function(){var t=Oy(Sy),r=t!==String(Sy);if(!r&&66===Py)return!0;if(!Py||Py<51||!/native code/.test(t)){var e=new Sy((function(t){t(1)})),n=function(t){t((function(){}),(function(){}))};if((e.constructor={})[jy]=n,!(My=e.then((function(){}))instanceof n))return!0}return!r&&(Ty||Iy)&&!Ly})),Cy={CONSTRUCTOR:ky,REJECTION_EVENT:Ly,SUBCLASSING:My},_y={},Ny=qt,Uy=TypeError,Fy=function(t){var r,e;this.promise=new t((function(t,n){if(void 0!==r||void 0!==e)throw Uy("Bad Promise constructor");r=t,e=n})),this.resolve=Ny(r),this.reject=Ny(e)};_y.f=function(t){return new Fy(t)};var Dy,By,zy,Wy=so,Hy=rg,qy=e,Vy=It,Gy=an,Yy=_i,$y=wi,Ky=ag,Jy=qt,Xy=lt,Qy=vt,Zy=Au,tm=dg,rm=Hg.set,em=gy,nm=function(t,r){try{1==arguments.length?console.error(t):console.error(t,r)}catch(ZW){}},om=yy,im=Jg,am=Ue,um=my,cm=_y,sm="Promise",fm=Cy.CONSTRUCTOR,lm=Cy.REJECTION_EVENT,hm=Cy.SUBCLASSING,pm=am.getterFor(sm),vm=am.set,dm=um&&um.prototype,gm=um,ym=dm,mm=qy.TypeError,bm=qy.document,Em=qy.process,wm=cm.f,Sm=wm,Am=!!(bm&&bm.createEvent&&qy.dispatchEvent),xm="unhandledrejection",Om=function(t){var r;return!(!Qy(t)||!Xy(r=t.then))&&r},Rm=function(t,r){var e,n,o,i=r.value,a=1==r.state,u=a?t.ok:t.fail,c=t.resolve,s=t.reject,f=t.domain;try{u?(a||(2===r.rejection&&Mm(r),r.rejection=1),!0===u?e=i:(f&&f.enter(),e=u(i),f&&(f.exit(),o=!0)),e===t.promise?s(mm("Promise-chain cycle")):(n=Om(e))?Vy(n,e,c,s):c(e)):s(i)}catch(ZW){f&&!o&&f.exit(),s(ZW)}},Tm=function(t,r){t.notified||(t.notified=!0,em((function(){for(var e,n=t.reactions;e=n.get();)Rm(e,t);t.notified=!1,r&&!t.rejection&&Pm(t)})))},Im=function(t,r,e){var n,o;Am?((n=bm.createEvent("Event")).promise=r,n.reason=e,n.initEvent(t,!1,!0),qy.dispatchEvent(n)):n={promise:r,reason:e},!lm&&(o=qy["on"+t])?o(n):t===xm&&nm("Unhandled promise rejection",e)},Pm=function(t){Vy(rm,qy,(function(){var r,e=t.facade,n=t.value;if(jm(t)&&(r=om((function(){Hy?Em.emit("unhandledRejection",n,e):Im(xm,e,n)})),t.rejection=Hy||jm(t)?2:1,r.error))throw r.value}))},jm=function(t){return 1!==t.rejection&&!t.parent},Mm=function(t){Vy(rm,qy,(function(){var r=t.facade;Hy?Em.emit("rejectionHandled",r):Im("rejectionhandled",r,t.value)}))},Lm=function(t,r,e){return function(n){t(r,n,e)}},km=function(t,r,e){t.done||(t.done=!0,e&&(t=e),t.value=r,t.state=2,Tm(t,!0))},Cm=function(t,r,e){if(!t.done){t.done=!0,e&&(t=e);try{if(t.facade===r)throw mm("Promise can't be resolved itself");var n=Om(r);n?em((function(){var e={done:!1};try{Vy(n,r,Lm(Cm,e,t),Lm(km,e,t))}catch(ZW){km(e,ZW,t)}})):(t.value=r,t.state=1,Tm(t,!1))}catch(ZW){km({done:!1},ZW,t)}}};if(fm&&(ym=(gm=function(t){Zy(this,ym),Jy(t),Vy(Dy,this);var r=pm(this);try{t(Lm(Cm,r),Lm(km,r))}catch(ZW){km(r,ZW)}}).prototype,(Dy=function(t){vm(this,{type:sm,done:!1,notified:!1,parent:!1,reactions:new im,rejection:!1,state:0,value:void 0})}).prototype=Gy(ym,"then",(function(t,r){var e=pm(this),n=wm(tm(this,gm));return e.parent=!0,n.ok=!Xy(t)||t,n.fail=Xy(r)&&r,n.domain=Hy?Em.domain:void 0,0==e.state?e.reactions.add(n):em((function(){Rm(n,e)})),n.promise})),By=function(){var t=new Dy,r=pm(t);this.promise=t,this.resolve=Lm(Cm,r),this.reject=Lm(km,r)},cm.f=wm=function(t){return t===gm||undefined===t?new By(t):Sm(t)},Xy(um)&&dm!==Object.prototype)){zy=dm.then,hm||Gy(dm,"then",(function(t,r){var e=this;return new gm((function(t,r){Vy(zy,e,t,r)})).then(t,r)}),{unsafe:!0});try{delete dm.constructor}catch(ZW){}Yy&&Yy(dm,ym)}Wy({global:!0,constructor:!0,wrap:!0,forced:fm},{Promise:gm}),$y(gm,sm,!1),Ky(sm);var _m=yu,Nm=It,Um=Ot,Fm=Bt,Dm=Gu,Bm=En,zm=kt,Wm=Ac,Hm=gc,qm=Bu,Vm=TypeError,Gm=function(t,r){this.stopped=t,this.result=r},Ym=Gm.prototype,$m=function(t,r,e){var n,o,i,a,u,c,s,f=e&&e.that,l=!(!e||!e.AS_ENTRIES),h=!(!e||!e.IS_RECORD),p=!(!e||!e.IS_ITERATOR),v=!(!e||!e.INTERRUPTED),d=_m(r,f),g=function(t){return n&&qm(n,"normal",t),new Gm(!0,t)},y=function(t){return l?(Um(t),v?d(t[0],t[1],g):d(t[0],t[1])):v?d(t,g):d(t)};if(h)n=t.iterator;else if(p)n=t;else{if(!(o=Hm(t)))throw Vm(Fm(t)+" is not iterable");if(Dm(o)){for(i=0,a=Bm(t);a>i;i++)if((u=y(t[i]))&&zm(Ym,u))return u;return new Gm(!1)}n=Wm(t,o)}for(c=h?t.next:n.next;!(s=Nm(c,n)).done;){try{u=y(s.value)}catch(ZW){qm(n,"throw",ZW)}if("object"==typeof u&&u&&zm(Ym,u))return u}return new Gm(!1)},Km=ot("iterator"),Jm=!1;try{var Xm=0,Qm={next:function(){return{done:!!Xm++}},return:function(){Jm=!0}};Qm[Km]=function(){return this},Array.from(Qm,(function(){throw 2}))}catch(ZW){}var Zm=function(t,r){if(!r&&!Jm)return!1;var e=!1;try{var n={};n[Km]=function(){return{next:function(){return{done:e=!0}}}},t(n)}catch(ZW){}return e},tb=my,rb=Cy.CONSTRUCTOR||!Zm((function(t){tb.all(t).then(void 0,(function(){}))})),eb=It,nb=qt,ob=_y,ib=yy,ab=$m;so({target:"Promise",stat:!0,forced:rb},{all:function(t){var r=this,e=ob.f(r),n=e.resolve,o=e.reject,i=ib((function(){var e=nb(r.resolve),i=[],a=0,u=1;ab(t,(function(t){var c=a++,s=!1;u++,eb(e,r,t).then((function(t){s||(s=!0,i[c]=t,--u||n(i))}),o)})),--u||n(i)}));return i.error&&o(i.value),e.promise}});var ub=so,cb=Cy.CONSTRUCTOR,sb=my,fb=Lt,lb=lt,hb=an,pb=sb&&sb.prototype;if(ub({target:"Promise",proto:!0,forced:cb,real:!0},{catch:function(t){return this.then(void 0,t)}}),lb(sb)){var vb=fb("Promise").prototype.catch;pb.catch!==vb&&hb(pb,"catch",vb,{unsafe:!0})}var db=It,gb=qt,yb=_y,mb=yy,bb=$m;so({target:"Promise",stat:!0,forced:rb},{race:function(t){var r=this,e=yb.f(r),n=e.reject,o=mb((function(){var o=gb(r.resolve);bb(t,(function(t){db(o,r,t).then(e.resolve,n)}))}));return o.error&&n(o.value),e.promise}});var Eb=It,wb=_y;so({target:"Promise",stat:!0,forced:Cy.CONSTRUCTOR},{reject:function(t){var r=wb.f(this);return Eb(r.reject,void 0,t),r.promise}});var Sb=Ot,Ab=vt,xb=_y,Ob=function(t,r){if(Sb(t),Ab(r)&&r.constructor===t)return r;var e=xb.f(t);return(0,e.resolve)(r),e.promise},Rb=so,Tb=Cy.CONSTRUCTOR,Ib=Ob;Lt("Promise"),Rb({target:"Promise",stat:!0,forced:Tb},{resolve:function(t){return Ib(this,t)}});var Pb=e;so({global:!0,forced:Pb.globalThis!==Pb},{globalThis:Pb}),Or("iterator");var jb=Nu;so({target:"Object",stat:!0,arity:2,forced:Object.assign!==jb},{assign:jb});var Mb=at.f,Lb=function(t,r,e){e in t||Mb(t,e,{configurable:!0,get:function(){return r[e]},set:function(t){r[e]=t}})},kb=lt,Cb=vt,_b=_i,Nb=function(t,r,e){var n,o;return _b&&kb(n=r.constructor)&&n!==e&&Cb(o=n.prototype)&&o!==e.prototype&&_b(t,o),t},Ub=Pa,Fb=function(t,r){return void 0===t?arguments.length<2?"":r:Ub(t)},Db=vt,Bb=re,zb=Error,Wb=f("".replace),Hb=String(zb("zxcasd").stack),qb=/\n\s*at [^:]*:[^\n]*/,Vb=qb.test(Hb),Gb=function(t,r){if(Vb&&"string"==typeof t&&!zb.prepareStackTrace)for(;r--;)t=Wb(t,qb,"");return t},Yb=Mr,$b=!o((function(){var t=Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",Yb(1,7)),7!==t.stack)})),Kb=re,Jb=Gb,Xb=$b,Qb=Error.captureStackTrace,Zb=Lt,tE=E,rE=re,eE=kt,nE=_i,oE=Gn,iE=Lb,aE=Nb,uE=Fb,cE=function(t,r){Db(r)&&"cause"in r&&Bb(t,"cause",r.cause)},sE=function(t,r,e,n){Xb&&(Qb?Qb(t,r):Kb(t,"stack",Jb(e,n)))},fE=ut,lE=so,hE=Xv,pE=function(t,r,e,n){var o="stackTraceLimit",i=n?2:1,a=t.split("."),u=a[a.length-1],c=Zb.apply(null,a);if(c){var s=c.prototype;if(tE(s,"cause")&&delete s.cause,!e)return c;var f=Zb("Error"),l=r((function(t,r){var e=uE(n?r:t,void 0),o=n?new c(t):new c;return void 0!==e&&rE(o,"message",e),sE(o,l,o.stack,2),this&&eE(s,this)&&aE(o,this,l),arguments.length>i&&cE(o,arguments[i]),o}));l.prototype=s,"Error"!==u?nE?nE(l,f):oE(l,f,{name:!0}):fE&&o in c&&(iE(l,c,o),iE(l,c,"prepareStackTrace")),oE(l,c);try{s.name!==u&&rE(s,"name",u),s.constructor=l}catch(ZW){}return l}},vE="WebAssembly",dE=e[vE],gE=7!==Error("e",{cause:7}).cause,yE=function(t,r){var e={};e[t]=pE(t,r,gE),lE({global:!0,constructor:!0,arity:1,forced:gE},e)},mE=function(t,r){if(dE&&dE[t]){var e={};e[t]=pE(vE+"."+t,r,gE),lE({target:vE,stat:!0,constructor:!0,arity:1,forced:gE},e)}};yE("Error",(function(t){return function(r){return hE(t,this,arguments)}})),yE("EvalError",(function(t){return function(r){return hE(t,this,arguments)}})),yE("RangeError",(function(t){return function(r){return hE(t,this,arguments)}})),yE("ReferenceError",(function(t){return function(r){return hE(t,this,arguments)}})),yE("SyntaxError",(function(t){return function(r){return hE(t,this,arguments)}})),yE("TypeError",(function(t){return function(r){return hE(t,this,arguments)}})),yE("URIError",(function(t){return function(r){return hE(t,this,arguments)}})),mE("CompileError",(function(t){return function(r){return hE(t,this,arguments)}})),mE("LinkError",(function(t){return function(r){return hE(t,this,arguments)}})),mE("RuntimeError",(function(t){return function(r){return hE(t,this,arguments)}}));var bE=Ot,EE=function(){var t=bE(this),r="";return t.hasIndices&&(r+="d"),t.global&&(r+="g"),t.ignoreCase&&(r+="i"),t.multiline&&(r+="m"),t.dotAll&&(r+="s"),t.unicode&&(r+="u"),t.unicodeSets&&(r+="v"),t.sticky&&(r+="y"),r},wE=o,SE=e.RegExp,AE=wE((function(){var t=SE("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),xE=AE||wE((function(){return!SE("a","y").sticky})),OE=AE||wE((function(){var t=SE("^r","gy");return t.lastIndex=2,null!=t.exec("str")})),RE={BROKEN_CARET:OE,MISSED_STICKY:xE,UNSUPPORTED_Y:AE},TE=o,IE=e.RegExp,PE=TE((function(){var t=IE(".","s");return!(t.dotAll&&t.exec("\n")&&"s"===t.flags)})),jE=o,ME=e.RegExp,LE=jE((function(){var t=ME("(?b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$c")})),kE=It,CE=f,_E=Pa,NE=EE,UE=RE,FE=Qo,DE=Ue.get,BE=PE,zE=LE,WE=S("native-string-replace",String.prototype.replace),HE=RegExp.prototype.exec,qE=HE,VE=CE("".charAt),GE=CE("".indexOf),YE=CE("".replace),$E=CE("".slice),KE=function(){var t=/a/,r=/b*/g;return kE(HE,t,"a"),kE(HE,r,"a"),0!==t.lastIndex||0!==r.lastIndex}(),JE=UE.BROKEN_CARET,XE=void 0!==/()??/.exec("")[1];(KE||XE||JE||BE||zE)&&(qE=function(t){var r,e,n,o,i,a,u,c=this,s=DE(c),f=_E(t),l=s.raw;if(l)return l.lastIndex=c.lastIndex,r=kE(qE,l,f),c.lastIndex=l.lastIndex,r;var h=s.groups,p=JE&&c.sticky,v=kE(NE,c),d=c.source,g=0,y=f;if(p&&(v=YE(v,"y",""),-1===GE(v,"g")&&(v+="g"),y=$E(f,c.lastIndex),c.lastIndex>0&&(!c.multiline||c.multiline&&"\n"!==VE(f,c.lastIndex-1))&&(d="(?: "+d+")",y=" "+y,g++),e=new RegExp("^(?:"+d+")",v)),XE&&(e=new RegExp("^"+d+"$(?!\\s)",v)),KE&&(n=c.lastIndex),o=kE(HE,p?e:c,y),p?o?(o.input=$E(o.input,g),o[0]=$E(o[0],g),o.index=c.lastIndex,c.lastIndex+=o[0].length):c.lastIndex=0:KE&&o&&(c.lastIndex=c.global?o.index+o[0].length:n),XE&&o&&o.length>1&&kE(WE,o[0],e,(function(){for(i=1;i]*>)/g,yw=/\$([$&'`]|\d{1,2})/g,mw=function(t,r,e,n,o,i){var a=e+t.length,u=n.length,c=yw;return void 0!==o&&(o=lw(o),c=gw),vw(i,c,(function(i,c){var s;switch(pw(c,0)){case"$":return"$";case"&":return t;case"`":return dw(r,0,e);case"'":return dw(r,a);case"<":s=o[dw(c,1,-1)];break;default:var f=+c;if(0===f)return i;if(f>u){var l=hw(f/10);return 0===l?i:l<=u?void 0===n[l-1]?pw(c,1):n[l-1]+pw(c,1):i}s=n[f-1]}return void 0===s?"":s}))},bw=It,Ew=Ot,ww=lt,Sw=_r,Aw=QE,xw=TypeError,Ow=function(t,r){var e=t.exec;if(ww(e)){var n=bw(e,t,r);return null!==n&&Ew(n),n}if("RegExp"===Sw(t))return bw(Aw,t,r);throw xw("RegExp#exec called on incompatible receiver")},Rw=Xv,Tw=It,Iw=f,Pw=uw,jw=o,Mw=Ot,Lw=lt,kw=l,Cw=ln,_w=mn,Nw=Pa,Uw=v,Fw=sw,Dw=Yt,Bw=mw,zw=Ow,Ww=ot("replace"),Hw=Math.max,qw=Math.min,Vw=Iw([].concat),Gw=Iw([].push),Yw=Iw("".indexOf),$w=Iw("".slice),Kw="$0"==="a".replace(/./,"$0"),Jw=!!/./[Ww]&&""===/./[Ww]("a","$0"),Xw=!jw((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$")}));Pw("replace",(function(t,r,e){var n=Jw?"$":"$0";return[function(t,e){var n=Uw(this),o=kw(t)?void 0:Dw(t,Ww);return o?Tw(o,t,n,e):Tw(r,Nw(n),t,e)},function(t,o){var i=Mw(this),a=Nw(t);if("string"==typeof o&&-1===Yw(o,n)&&-1===Yw(o,"$<")){var u=e(r,i,a,o);if(u.done)return u.value}var c=Lw(o);c||(o=Nw(o));var s=i.global;if(s){var f=i.unicode;i.lastIndex=0}for(var l=[];;){var h=zw(i,a);if(null===h)break;if(Gw(l,h),!s)break;""===Nw(h[0])&&(i.lastIndex=Fw(a,_w(i.lastIndex),f))}for(var p,v="",d=0,g=0;g=d&&(v+=$w(a,d,m)+A,d=m+y.length)}return v+$w(a,d)}]}),!Xw||!Kw||Jw);var Qw=It,Zw=E,tS=kt,rS=EE,eS=RegExp.prototype,nS=function(t){var r=t.flags;return void 0!==r||"flags"in eS||Zw(t,"flags")||!tS(eS,t)?r:Qw(rS,t)},oS=se.PROPER,iS=an,aS=Ot,uS=Pa,cS=o,sS=nS,fS="toString",lS=RegExp.prototype[fS],hS=cS((function(){return"/a/b"!=lS.call({source:"a",flags:"b"})})),pS=oS&&lS.name!=fS;(hS||pS)&&iS(RegExp.prototype,fS,(function(){var t=aS(this);return"/"+uS(t.source)+"/"+uS(sS(t))}),{unsafe:!0});var vS=ut,dS=sp,gS=TypeError,yS=Object.getOwnPropertyDescriptor,mS=vS&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(ZW){return ZW instanceof TypeError}}()?function(t,r){if(dS(t)&&!yS(t,"length").writable)throw gS("Cannot set read only .length");return t.length=r}:function(t,r){return t.length=r},bS=TypeError,ES=function(t){if(t>9007199254740991)throw bS("Maximum allowed index exceeded");return t},wS=y,SS=En,AS=mS,xS=ES;so({target:"Array",proto:!0,arity:1,forced:o((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(ZW){return ZW instanceof TypeError}}()},{push:function(t){var r=wS(this),e=SS(r),n=arguments.length;xS(e+n);for(var o=0;o@^][^\s!#%&*+<=>@^]*>/,vA=/a/g,dA=/a/g,gA=new iA(vA)!==vA,yA=KS.MISSED_STICKY,mA=KS.UNSUPPORTED_Y,bA=FS&&(!gA||yA||eA||nA||QS((function(){return dA[oA]=!1,iA(vA)!=vA||iA(dA)==dA||"/a/i"!=iA(vA,"i")})));if(zS("RegExp",bA)){for(var EA=function(t,r){var e,n,o,i,a,u,c=VS(aA,this),s=GS(t),f=void 0===r,l=[],h=t;if(!c&&s&&f&&t.constructor===EA)return t;if((s||VS(aA,t))&&(t=t.source,f&&(r=$S(h))),t=void 0===t?"":YS(t),r=void 0===r?"":YS(r),h=t,eA&&"dotAll"in vA&&(n=!!r&&lA(r,"s")>-1)&&(r=fA(r,/s/g,"")),e=r,yA&&"sticky"in vA&&(o=!!r&&lA(r,"y")>-1)&&mA&&(r=fA(r,/y/g,"")),nA&&(i=function(t){for(var r,e=t.length,n=0,o="",i=[],a={},u=!1,c=!1,s=0,f="";n<=e;n++){if("\\"===(r=sA(t,n)))r+=sA(t,++n);else if("]"===r)u=!1;else if(!u)switch(!0){case"["===r:u=!0;break;case"("===r:cA(pA,hA(t,n+1))&&(n+=2,c=!0),o+=r,s++;continue;case">"===r&&c:if(""===f||ZS(a,f))throw new uA("Invalid capture group name");a[f]=!0,i[i.length]=[f,s],c=!1,f="";continue}c?f+=r:o+=r}return[o,i]}(t),t=i[0],l=i[1]),a=WS(iA(t,r),c?this:aA,EA),(n||o||l.length)&&(u=tA(a),n&&(u.dotAll=!0,u.raw=EA(function(t){for(var r,e=t.length,n=0,o="",i=!1;n<=e;n++)"\\"!==(r=sA(t,n))?i||"."!==r?("["===r?i=!0:"]"===r&&(i=!1),o+=r):o+="[\\s\\S]":o+=r+sA(t,++n);return o}(t),e)),o&&(u.sticky=!0),l.length&&(u.groups=l)),t!==h)try{HS(a,"source",""===h?"(?:)":h)}catch(ZW){}return a},wA=qS(iA),SA=0;wA.length>SA;)JS(EA,iA,wA[SA++]);aA.constructor=EA,EA.prototype=aA,XS(DS,"RegExp",EA,{constructor:!0})}rA("RegExp");var AA=ut,xA=PE,OA=_r,RA=Eu,TA=Ue.get,IA=RegExp.prototype,PA=TypeError;AA&&xA&&RA(IA,"dotAll",{configurable:!0,get:function(){if(this!==IA){if("RegExp"===OA(this))return!!TA(this).dotAll;throw PA("Incompatible receiver, RegExp required")}}});var jA=ut,MA=RE.MISSED_STICKY,LA=_r,kA=Eu,CA=Ue.get,_A=RegExp.prototype,NA=TypeError;jA&&MA&&kA(_A,"sticky",{configurable:!0,get:function(){if(this!==_A){if("RegExp"===LA(this))return!!CA(this).sticky;throw NA("Incompatible receiver, RegExp required")}}});var UA=y,FA=Eo,DA=lo;so({target:"Object",stat:!0,forced:o((function(){FA(1)})),sham:!DA},{getPrototypeOf:function(t){return FA(UA(t))}});var BA=Bt,zA=TypeError,WA=function(t,r){if(!delete t[r])throw zA("Cannot delete property "+BA(r)+" of "+BA(t))},HA=o,qA=V,VA=ot("species"),GA=function(t){return qA>=51||!HA((function(){var r=[];return(r.constructor={})[VA]=function(){return{foo:1}},1!==r[t](Boolean).foo}))},YA=so,$A=y,KA=dn,JA=ln,XA=En,QA=mS,ZA=ES,tx=gp,rx=fc,ex=WA,nx=GA("splice"),ox=Math.max,ix=Math.min;YA({target:"Array",proto:!0,forced:!nx},{splice:function(t,r){var e,n,o,i,a,u,c=$A(this),s=XA(c),f=KA(t,s),l=arguments.length;for(0===l?e=n=0:1===l?(e=0,n=s-f):(e=l-2,n=ix(ox(JA(r),0),s-f)),ZA(s+e-n),o=tx(c,n),i=0;is-n+e;i--)ex(c,i-1)}else if(e>n)for(i=s-n;i>f;i--)u=i+e-1,(a=i+n-1)in c?c[u]=c[a]:ex(c,u);for(i=0;i1?arguments[1]:void 0)}});var jx="\t\n\v\f\r                 \u2028\u2029\ufeff",Mx=v,Lx=Pa,kx=jx,Cx=f("".replace),_x="["+kx+"]",Nx=RegExp("^"+_x+_x+"*"),Ux=RegExp(_x+_x+"*$"),Fx=function(t){return function(r){var e=Lx(Mx(r));return 1&t&&(e=Cx(e,Nx,"")),2&t&&(e=Cx(e,Ux,"")),e}},Dx={start:Fx(1),end:Fx(2),trim:Fx(3)},Bx=se.PROPER,zx=o,Wx=jx,Hx=function(t){return zx((function(){return!!Wx[t]()||"​…᠎"!=="​…᠎"[t]()||Bx&&Wx[t].name!==t}))},qx=Dx.trim;so({target:"String",proto:!0,forced:Hx("trim")},{trim:function(){return qx(this)}});var Vx=so,Gx=o,Yx=sp,$x=vt,Kx=y,Jx=En,Xx=ES,Qx=fc,Zx=gp,tO=GA,rO=V,eO=ot("isConcatSpreadable"),nO=rO>=51||!Gx((function(){var t=[];return t[eO]=!1,t.concat()[0]!==t})),oO=function(t){if(!$x(t))return!1;var r=t[eO];return void 0!==r?!!r:Yx(t)};Vx({target:"Array",proto:!0,arity:1,forced:!nO||!tO("concat")},{concat:function(t){var r,e,n,o,i,a=Kx(this),u=Zx(a,0),c=0;for(r=-1,n=arguments.length;r=0:u>c;c+=s)c in a&&(o=e(o,a[c],c,i));return o}},lO={left:fO(!1),right:fO(!0)},hO=lO.left;so({target:"Array",proto:!0,forced:!rg&&V>79&&V<83||!RS("reduce")},{reduce:function(t){var r=arguments.length;return hO(this,t,r,r>1?arguments[1]:void 0)}});var pO=so,vO=e,dO=f,gO=ro,yO=an,mO=gh,bO=$m,EO=Au,wO=lt,SO=l,AO=vt,xO=o,OO=Zm,RO=wi,TO=Nb,IO=function(t,r,e){var n=-1!==t.indexOf("Map"),o=-1!==t.indexOf("Weak"),i=n?"set":"add",a=vO[t],u=a&&a.prototype,c=a,s={},f=function(t){var r=dO(u[t]);yO(u,t,"add"==t?function(t){return r(this,0===t?0:t),this}:"delete"==t?function(t){return!(o&&!AO(t))&&r(this,0===t?0:t)}:"get"==t?function(t){return o&&!AO(t)?void 0:r(this,0===t?0:t)}:"has"==t?function(t){return!(o&&!AO(t))&&r(this,0===t?0:t)}:function(t,e){return r(this,0===t?0:t,e),this})};if(gO(t,!wO(a)||!(o||u.forEach&&!xO((function(){(new a).entries().next()})))))c=e.getConstructor(r,t,n,i),mO.enable();else if(gO(t,!0)){var l=new c,h=l[i](o?{}:-0,1)!=l,p=xO((function(){l.has(1)})),v=OO((function(t){new a(t)})),d=!o&&xO((function(){for(var t=new a,r=5;r--;)t[i](r,r);return!t.has(-0)}));v||((c=r((function(t,r){EO(t,u);var e=TO(new a,t,c);return SO(r)||bO(r,e[i],{that:e,AS_ENTRIES:n}),e}))).prototype=u,u.constructor=c),(p||d)&&(f("delete"),f("has"),n&&f("get")),(d||h)&&f(i),o&&u.clear&&delete u.clear}return s[t]=c,pO({global:!0,constructor:!0,forced:c!=a},s),RO(c,t),o||e.setStrong(c,t,n),c},PO=at.f,jO=Qo,MO=ss,LO=yu,kO=Au,CO=l,_O=$m,NO=ra,UO=ea,FO=ag,DO=ut,BO=gh.fastKey,zO=Ue.set,WO=Ue.getterFor,HO={getConstructor:function(t,r,e,n){var o=t((function(t,o){kO(t,i),zO(t,{type:r,index:jO(null),first:void 0,last:void 0,size:0}),DO||(t.size=0),CO(o)||_O(o,t[n],{that:t,AS_ENTRIES:e})})),i=o.prototype,a=WO(r),u=function(t,r,e){var n,o,i=a(t),u=c(t,r);return u?u.value=e:(i.last=u={index:o=BO(r,!0),key:r,value:e,previous:n=i.last,next:void 0,removed:!1},i.first||(i.first=u),n&&(n.next=u),DO?i.size++:t.size++,"F"!==o&&(i.index[o]=u)),t},c=function(t,r){var e,n=a(t),o=BO(r);if("F"!==o)return n.index[o];for(e=n.first;e;e=e.next)if(e.key==r)return e};return MO(i,{clear:function(){for(var t=a(this),r=t.index,e=t.first;e;)e.removed=!0,e.previous&&(e.previous=e.previous.next=void 0),delete r[e.index],e=e.next;t.first=t.last=void 0,DO?t.size=0:this.size=0},delete:function(t){var r=this,e=a(r),n=c(r,t);if(n){var o=n.next,i=n.previous;delete e.index[n.index],n.removed=!0,i&&(i.next=o),o&&(o.previous=i),e.first==n&&(e.first=o),e.last==n&&(e.last=i),DO?e.size--:r.size--}return!!n},forEach:function(t){for(var r,e=a(this),n=LO(t,arguments.length>1?arguments[1]:void 0);r=r?r.next:e.first;)for(n(r.value,r.key,this);r&&r.removed;)r=r.previous},has:function(t){return!!c(this,t)}}),MO(i,e?{get:function(t){var r=c(this,t);return r&&r.value},set:function(t,r){return u(this,0===t?0:t,r)}}:{add:function(t){return u(this,t=0===t?0:t,t)}}),DO&&PO(i,"size",{get:function(){return a(this).size}}),o},setStrong:function(t,r,e){var n=r+" Iterator",o=WO(r),i=WO(n);NO(t,r,(function(t,r){zO(this,{type:n,target:t,state:o(t),kind:r,last:void 0})}),(function(){for(var t=i(this),r=t.kind,e=t.last;e&&e.removed;)e=e.previous;return t.target&&(t.last=e=e?e.next:t.state.first)?UO("keys"==r?e.key:"values"==r?e.value:[e.key,e.value],!1):(t.target=void 0,UO(void 0,!0))}),e?"entries":"values",!e,!0),FO(r)}};IO("Set",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),HO);var qO=ut,VO=f,GO=jo,YO=Hr,$O=VO(Tr.f),KO=VO([].push),JO=function(t){return function(r){for(var e,n=YO(r),o=GO(n),i=o.length,a=0,u=[];i>a;)e=o[a++],qO&&!$O(n,e)||KO(u,t?[e,n[e]]:n[e]);return u}},XO={entries:JO(!0),values:JO(!1)},QO=XO.values;so({target:"Object",stat:!0},{values:function(t){return QO(t)}});var ZO=On.includes,tR=ui;so({target:"Array",proto:!0,forced:o((function(){return!Array(1).includes()}))},{includes:function(t){return ZO(this,t,arguments.length>1?arguments[1]:void 0)}}),tR("includes");var rR=US,eR=TypeError,nR=function(t){if(rR(t))throw eR("The method doesn't accept regular expressions");return t},oR=ot("match"),iR=function(t){var r=/./;try{"/./"[t](r)}catch(e){try{return r[oR]=!1,"/./"[t](r)}catch(n){}}return!1},aR=so,uR=nR,cR=v,sR=Pa,fR=iR,lR=f("".indexOf);aR({target:"String",proto:!0,forced:!fR("includes")},{includes:function(t){return!!~lR(sR(cR(this)),sR(uR(t)),arguments.length>1?arguments[1]:void 0)}});var hR=xp.filter;so({target:"Array",proto:!0,forced:!GA("filter")},{filter:function(t){return hR(this,t,arguments.length>1?arguments[1]:void 0)}});var pR=y,vR=En,dR=mS,gR=WA,yR=ES;so({target:"Array",proto:!0,arity:1,forced:1!==[].unshift(0)||!function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(ZW){return ZW instanceof TypeError}}()},{unshift:function(t){var r=pR(this),e=vR(r),n=arguments.length;if(n){yR(e+n);for(var o=e;o--;){var i=o+n;o in r?r[i]=r[o]:gR(r,i)}for(var a=0;a1?arguments[1]:void 0;return SR?wR(this,t,r)||0:bR(this,t,r)}});var AR=e,xR=o,OR=Pa,RR=Dx.trim,TR=jx,IR=f("".charAt),PR=AR.parseFloat,jR=AR.Symbol,MR=jR&&jR.iterator,LR=1/PR(TR+"-0")!=-1/0||MR&&!xR((function(){PR(Object(MR))}))?function(t){var r=RR(OR(t)),e=PR(r);return 0===e&&"-"==IR(r,0)?-0:e}:PR;so({global:!0,forced:parseFloat!=LR},{parseFloat:LR});var kR=so,CR=pu,_R=Rr.f,NR=mn,UR=Pa,FR=nR,DR=v,BR=iR,zR=CR("".endsWith),WR=CR("".slice),HR=Math.min,qR=BR("endsWith"),VR=!qR&&!!function(){var t=_R(String.prototype,"endsWith");return t&&!t.writable}();kR({target:"String",proto:!0,forced:!VR&&!qR},{endsWith:function(t){var r=UR(DR(this));FR(t);var e=arguments.length>1?arguments[1]:void 0,n=r.length,o=void 0===e?n:HR(NR(e),n),i=UR(t);return zR?zR(r,i,o):WR(r,o-i.length,o)===i}});var GR=f,YR=ss,$R=gh.getWeakData,KR=Au,JR=Ot,XR=l,QR=vt,ZR=$m,tT=E,rT=Ue.set,eT=Ue.getterFor,nT=xp.find,oT=xp.findIndex,iT=GR([].splice),aT=0,uT=function(t){return t.frozen||(t.frozen=new cT)},cT=function(){this.entries=[]},sT=function(t,r){return nT(t.entries,(function(t){return t[0]===r}))};cT.prototype={get:function(t){var r=sT(this,t);if(r)return r[1]},has:function(t){return!!sT(this,t)},set:function(t,r){var e=sT(this,t);e?e[1]=r:this.entries.push([t,r])},delete:function(t){var r=oT(this.entries,(function(r){return r[0]===t}));return~r&&iT(this.entries,r,1),!!~r}};var fT,lT={getConstructor:function(t,r,e,n){var o=t((function(t,o){KR(t,i),rT(t,{type:r,id:aT++,frozen:void 0}),XR(o)||ZR(o,t[n],{that:t,AS_ENTRIES:e})})),i=o.prototype,a=eT(r),u=function(t,r,e){var n=a(t),o=$R(JR(r),!0);return!0===o?uT(n).set(r,e):o[n.id]=e,t};return YR(i,{delete:function(t){var r=a(this);if(!QR(t))return!1;var e=$R(t);return!0===e?uT(r).delete(t):e&&tT(e,r.id)&&delete e[r.id]},has:function(t){var r=a(this);if(!QR(t))return!1;var e=$R(t);return!0===e?uT(r).has(t):e&&tT(e,r.id)}}),YR(i,e?{get:function(t){var r=a(this);if(QR(t)){var e=$R(t);return!0===e?uT(r).get(t):e?e[r.id]:void 0}},set:function(t,r){return u(this,t,r)}}:{add:function(t){return u(this,t,!0)}}),o}},hT=dh,pT=e,vT=f,dT=ss,gT=gh,yT=IO,mT=lT,bT=vt,ET=Ue.enforce,wT=o,ST=be,AT=Object,xT=Array.isArray,OT=AT.isExtensible,RT=AT.isFrozen,TT=AT.isSealed,IT=AT.freeze,PT=AT.seal,jT={},MT={},LT=!pT.ActiveXObject&&"ActiveXObject"in pT,kT=function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},CT=yT("WeakMap",kT,mT),_T=CT.prototype,NT=vT(_T.set);if(ST)if(LT){fT=mT.getConstructor(kT,"WeakMap",!0),gT.enable();var UT=vT(_T.delete),FT=vT(_T.has),DT=vT(_T.get);dT(_T,{delete:function(t){if(bT(t)&&!OT(t)){var r=ET(this);return r.frozen||(r.frozen=new fT),UT(this,t)||r.frozen.delete(t)}return UT(this,t)},has:function(t){if(bT(t)&&!OT(t)){var r=ET(this);return r.frozen||(r.frozen=new fT),FT(this,t)||r.frozen.has(t)}return FT(this,t)},get:function(t){if(bT(t)&&!OT(t)){var r=ET(this);return r.frozen||(r.frozen=new fT),FT(this,t)?DT(this,t):r.frozen.get(t)}return DT(this,t)},set:function(t,r){if(bT(t)&&!OT(t)){var e=ET(this);e.frozen||(e.frozen=new fT),FT(this,t)?NT(this,t,r):e.frozen.set(t,r)}else NT(this,t,r);return this}})}else hT&&wT((function(){var t=IT([]);return NT(new CT,t,1),!RT(t)}))&&dT(_T,{set:function(t,r){var e;return xT(t)&&(RT(t)?e=jT:TT(t)&&(e=MT)),NT(this,t,r),e==jT&&IT(t),e==MT&&PT(t),this}});IO("Map",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),HO),so({target:"Number",stat:!0},{isNaN:function(t){return t!=t}});var BT=f(1..valueOf),zT=so,WT=ut,HT=e,qT=n,VT=f,GT=ro,YT=E,$T=Nb,KT=kt,JT=Ft,XT=ar,QT=o,ZT=un.f,tI=Rr.f,rI=at.f,eI=BT,nI=Dx.trim,oI="Number",iI=HT[oI];qT[oI];var aI=iI.prototype,uI=HT.TypeError,cI=VT("".slice),sI=VT("".charCodeAt),fI=function(t){var r=XT(t,"number");return"bigint"==typeof r?r:lI(r)},lI=function(t){var r,e,n,o,i,a,u,c,s=XT(t,"number");if(JT(s))throw uI("Cannot convert a Symbol value to a number");if("string"==typeof s&&s.length>2)if(s=nI(s),43===(r=sI(s,0))||45===r){if(88===(e=sI(s,2))||120===e)return NaN}else if(48===r){switch(sI(s,1)){case 66:case 98:n=2,o=49;break;case 79:case 111:n=8,o=55;break;default:return+s}for(a=(i=cI(s,2)).length,u=0;uo)return NaN;return parseInt(i,n)}return+s},hI=GT(oI,!iI(" 0o1")||!iI("0b1")||iI("+0x1")),pI=function(t){return KT(aI,t)&&QT((function(){eI(t)}))},vI=function(t){var r=arguments.length<1?0:iI(fI(t));return pI(this)?$T(Object(r),this,vI):r};vI.prototype=aI,hI&&(aI.constructor=vI),zT({global:!0,constructor:!0,wrap:!0,forced:hI},{Number:vI});hI&&function(t,r){for(var e,n=WT?ZT(r):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),o=0;n.length>o;o++)YT(r,e=n[o])&&!YT(t,e)&&rI(t,e,tI(r,e))}(qT[oI],iI);var dI=so,gI=pu,yI=Rr.f,mI=mn,bI=Pa,EI=nR,wI=v,SI=iR,AI=gI("".startsWith),xI=gI("".slice),OI=Math.min,RI=SI("startsWith"),TI=!RI&&!!function(){var t=yI(String.prototype,"startsWith");return t&&!t.writable}();dI({target:"String",proto:!0,forced:!TI&&!RI},{startsWith:function(t){var r=bI(wI(this));EI(t);var e=mI(OI(arguments.length>1?arguments[1]:void 0,r.length)),n=bI(t);return AI?AI(r,n,e):xI(r,e,e+n.length)===n}});var II=vt,PI=Math.floor,jI=Number.isInteger||function(t){return!II(t)&&isFinite(t)&&PI(t)===t};so({target:"Number",stat:!0},{isInteger:jI});var MI=e,LI=o,kI=f,CI=Pa,_I=Dx.trim,NI=jx,UI=MI.parseInt,FI=MI.Symbol,DI=FI&&FI.iterator,BI=/^[+-]?0x/i,zI=kI(BI.exec),WI=8!==UI(NI+"08")||22!==UI(NI+"0x16")||DI&&!LI((function(){UI(Object(DI))}))?function(t,r){var e=_I(CI(t));return UI(e,r>>>0||(zI(BI,e)?16:10))}:UI;so({global:!0,forced:parseInt!=WI},{parseInt:WI});var HI=$m,qI=fc;so({target:"Object",stat:!0},{fromEntries:function(t){var r={};return HI(t,(function(t,e){qI(r,t,e)}),{AS_ENTRIES:!0}),r}});var VI=F.match(/firefox\/(\d+)/i),GI=!!VI&&+VI[1],YI=/MSIE|Trident/.test(F),$I=F.match(/AppleWebKit\/(\d+)\./),KI=!!$I&&+$I[1],JI=so,XI=f,QI=qt,ZI=y,tP=En,rP=WA,eP=Pa,nP=o,oP=ds,iP=RS,aP=GI,uP=YI,cP=V,sP=KI,fP=[],lP=XI(fP.sort),hP=XI(fP.push),pP=nP((function(){fP.sort(void 0)})),vP=nP((function(){fP.sort(null)})),dP=iP("sort"),gP=!nP((function(){if(cP)return cP<70;if(!(aP&&aP>3)){if(uP)return!0;if(sP)return sP<603;var t,r,e,n,o="";for(t=65;t<76;t++){switch(r=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:e=3;break;case 68:case 71:e=4;break;default:e=2}for(n=0;n<47;n++)fP.push({k:r+n,v:e})}for(fP.sort((function(t,r){return r.v-t.v})),n=0;neP(e)?1:-1}}(t)),e=tP(o),n=0;n1?arguments[1]:void 0)},wP=e,SP=Ya,AP=Ja,xP=EP,OP=re,RP=function(t){if(t&&t.forEach!==xP)try{OP(t,"forEach",xP)}catch(ZW){t.forEach=xP}};for(var TP in SP)SP[TP]&&RP(wP[TP]&&wP[TP].prototype);RP(AP);var IP=ut,PP=se.EXISTS,jP=f,MP=at.f,LP=Function.prototype,kP=jP(LP.toString),CP=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,_P=jP(CP.exec);IP&&!PP&&MP(LP,"name",{configurable:!0,get:function(){try{return _P(CP,kP(this))[1]}catch(ZW){return""}}}),IO("WeakSet",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),lT);var NP=so,UP=xp.find,FP=ui,DP="find",BP=!0;DP in[]&&Array(1)[DP]((function(){BP=!1})),NP({target:"Array",proto:!0,forced:BP},{find:function(t){return UP(this,t,arguments.length>1?arguments[1]:void 0)}}),FP(DP);var zP=Xv,WP=It,HP=f,qP=uw,VP=Ot,GP=l,YP=US,$P=v,KP=dg,JP=sw,XP=mn,QP=Pa,ZP=Yt,tj=zc,rj=Ow,ej=QE,nj=o,oj=RE.UNSUPPORTED_Y,ij=4294967295,aj=Math.min,uj=[].push,cj=HP(/./.exec),sj=HP(uj),fj=HP("".slice),lj=!nj((function(){var t=/(?:)/,r=t.exec;t.exec=function(){return r.apply(this,arguments)};var e="ab".split(t);return 2!==e.length||"a"!==e[0]||"b"!==e[1]}));qP("split",(function(t,r,e){var n;return n="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,e){var n=QP($P(this)),o=void 0===e?ij:e>>>0;if(0===o)return[];if(void 0===t)return[n];if(!YP(t))return WP(r,n,t,o);for(var i,a,u,c=[],s=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),f=0,l=new RegExp(t.source,s+"g");(i=WP(ej,l,n))&&!((a=l.lastIndex)>f&&(sj(c,fj(n,f,i.index)),i.length>1&&i.index=o));)l.lastIndex===i.index&&l.lastIndex++;return f===n.length?!u&&cj(l,"")||sj(c,""):sj(c,fj(n,f)),c.length>o?tj(c,0,o):c}:"0".split(void 0,0).length?function(t,e){return void 0===t&&0===e?[]:WP(r,this,t,e)}:r,[function(r,e){var o=$P(this),i=GP(r)?void 0:ZP(r,t);return i?WP(i,r,o,e):WP(n,QP(o),r,e)},function(t,o){var i=VP(this),a=QP(t),u=e(n,i,a,o,n!==r);if(u.done)return u.value;var c=KP(i,RegExp),s=i.unicode,f=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.unicode?"u":"")+(oj?"g":"y"),l=new c(oj?"^(?:"+i.source+")":i,f),h=void 0===o?ij:o>>>0;if(0===h)return[];if(0===a.length)return null===rj(l,a)?[a]:[];for(var p=0,v=0,d=[];v>1,f=23===r?bj(2,-24)-bj(2,-77):0,l=t<0||0===t&&1/t<0?1:0,h=0;for((t=mj(t))!=t||t===1/0?(o=t!=t?1:0,n=c):(n=Ej(wj(t)/Sj),t*(i=bj(2,-n))<1&&(n--,i*=2),(t+=n+s>=1?f/i:f*bj(2,1-s))*i>=2&&(n++,i/=2),n+s>=c?(o=0,n=c):n+s>=1?(o=(t*i-1)*bj(2,r),n+=s):(o=t*bj(2,s-1)*bj(2,r),n=0));r>=8;)a[h++]=255&o,o/=256,r-=8;for(n=n<0;)a[h++]=255&n,n/=256,u-=8;return a[--h]|=128*l,a},unpack:function(t,r){var e,n=t.length,o=8*n-r-1,i=(1<>1,u=o-7,c=n-1,s=t[c--],f=127&s;for(s>>=7;u>0;)f=256*f+t[c--],u-=8;for(e=f&(1<<-u)-1,f>>=-u,u+=r;u>0;)e=256*e+t[c--],u-=8;if(0===f)f=1-a;else{if(f===i)return e?NaN:s?-1/0:1/0;e+=bj(2,r),f-=a}return(s?-1:1)*e*bj(2,f-r)}},xj=y,Oj=dn,Rj=En,Tj=function(t){for(var r=xj(this),e=Rj(r),n=arguments.length,o=Oj(n>1?arguments[1]:void 0,e),i=n>2?arguments[2]:void 0,a=void 0===i?e:Oj(i,e);a>o;)r[o++]=t;return r},Ij=e,Pj=f,jj=ut,Mj=hj,Lj=se,kj=re,Cj=ss,_j=o,Nj=Au,Uj=ln,Fj=mn,Dj=gj,Bj=Aj,zj=Eo,Wj=_i,Hj=un.f,qj=at.f,Vj=Tj,Gj=zc,Yj=wi,$j=Lj.PROPER,Kj=Lj.CONFIGURABLE,Jj=Ue.get,Xj=Ue.set,Qj="ArrayBuffer",Zj="DataView",tM="prototype",rM="Wrong index",eM=Ij[Qj],nM=eM,oM=nM&&nM[tM],iM=Ij[Zj],aM=iM&&iM[tM],uM=Object.prototype,cM=Ij.Array,sM=Ij.RangeError,fM=Pj(Vj),lM=Pj([].reverse),hM=Bj.pack,pM=Bj.unpack,vM=function(t){return[255&t]},dM=function(t){return[255&t,t>>8&255]},gM=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},yM=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},mM=function(t){return hM(t,23,4)},bM=function(t){return hM(t,52,8)},EM=function(t,r){qj(t[tM],r,{get:function(){return Jj(this)[r]}})},wM=function(t,r,e,n){var o=Dj(e),i=Jj(t);if(o+r>i.byteLength)throw sM(rM);var a=Jj(i.buffer).bytes,u=o+i.byteOffset,c=Gj(a,u,u+r);return n?c:lM(c)},SM=function(t,r,e,n,o,i){var a=Dj(e),u=Jj(t);if(a+r>u.byteLength)throw sM(rM);for(var c=Jj(u.buffer).bytes,s=a+u.byteOffset,f=n(+o),l=0;lRM;)(xM=OM[RM++])in nM||kj(nM,xM,eM[xM]);oM.constructor=nM}Wj&&zj(aM)!==uM&&Wj(aM,uM);var TM=new iM(new nM(2)),IM=Pj(aM.setInt8);TM.setInt8(0,2147483648),TM.setInt8(1,2147483649),!TM.getInt8(0)&&TM.getInt8(1)||Cj(aM,{setInt8:function(t,r){IM(this,t,r<<24>>24)},setUint8:function(t,r){IM(this,t,r<<24>>24)}},{unsafe:!0})}else oM=(nM=function(t){Nj(this,oM);var r=Dj(t);Xj(this,{bytes:fM(cM(r),0),byteLength:r}),jj||(this.byteLength=r)})[tM],aM=(iM=function(t,r,e){Nj(this,aM),Nj(t,oM);var n=Jj(t).byteLength,o=Uj(r);if(o<0||o>n)throw sM("Wrong offset");if(o+(e=void 0===e?n-o:Fj(e))>n)throw sM("Wrong length");Xj(this,{buffer:t,byteLength:e,byteOffset:o}),jj||(this.buffer=t,this.byteLength=e,this.byteOffset=o)})[tM],jj&&(EM(nM,"byteLength"),EM(iM,"buffer"),EM(iM,"byteLength"),EM(iM,"byteOffset")),Cj(aM,{getInt8:function(t){return wM(this,1,t)[0]<<24>>24},getUint8:function(t){return wM(this,1,t)[0]},getInt16:function(t){var r=wM(this,2,t,arguments.length>1?arguments[1]:void 0);return(r[1]<<8|r[0])<<16>>16},getUint16:function(t){var r=wM(this,2,t,arguments.length>1?arguments[1]:void 0);return r[1]<<8|r[0]},getInt32:function(t){return yM(wM(this,4,t,arguments.length>1?arguments[1]:void 0))},getUint32:function(t){return yM(wM(this,4,t,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(t){return pM(wM(this,4,t,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(t){return pM(wM(this,8,t,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(t,r){SM(this,1,t,vM,r)},setUint8:function(t,r){SM(this,1,t,vM,r)},setInt16:function(t,r){SM(this,2,t,dM,r,arguments.length>2?arguments[2]:void 0)},setUint16:function(t,r){SM(this,2,t,dM,r,arguments.length>2?arguments[2]:void 0)},setInt32:function(t,r){SM(this,4,t,gM,r,arguments.length>2?arguments[2]:void 0)},setUint32:function(t,r){SM(this,4,t,gM,r,arguments.length>2?arguments[2]:void 0)},setFloat32:function(t,r){SM(this,4,t,mM,r,arguments.length>2?arguments[2]:void 0)},setFloat64:function(t,r){SM(this,8,t,bM,r,arguments.length>2?arguments[2]:void 0)}});Yj(nM,Qj),Yj(iM,Zj);var PM={ArrayBuffer:nM,DataView:iM},jM=ag,MM="ArrayBuffer",LM=PM[MM];so({global:!0,constructor:!0,forced:e[MM]!==LM},{ArrayBuffer:LM}),jM(MM);var kM=ut,CM=Eu,_M=EE,NM=o,UM=e.RegExp,FM=UM.prototype,DM=kM&&NM((function(){var t=!0;try{UM(".","d")}catch(ZW){t=!1}var r={},e="",n=t?"dgimsy":"gimsy",o=function(t,n){Object.defineProperty(r,t,{get:function(){return e+=n,!0}})},i={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var a in t&&(i.hasIndices="d"),i)o(a,i[a]);return Object.getOwnPropertyDescriptor(FM,"flags").get.call(r)!==n||e!==n}));DM&&CM(FM,"flags",{configurable:!0,get:_M});var BM=It,zM=Ot,WM=l,HM=mn,qM=Pa,VM=v,GM=Yt,YM=sw,$M=Ow;uw("match",(function(t,r,e){return[function(r){var e=VM(this),n=WM(r)?void 0:GM(r,t);return n?BM(n,r,e):new RegExp(r)[t](qM(e))},function(t){var n=zM(this),o=qM(t),i=e(r,n,o);if(i.done)return i.value;if(!n.global)return $M(n,o);var a=n.unicode;n.lastIndex=0;for(var u,c=[],s=0;null!==(u=$M(n,o));){var f=qM(u[0]);c[s]=f,""===f&&(n.lastIndex=YM(o,HM(n.lastIndex),a)),s++}return 0===s?null:c}]}));var KM=so,JM=xp.findIndex,XM=ui,QM="findIndex",ZM=!0;QM in[]&&Array(1)[QM]((function(){ZM=!1})),KM({target:"Array",proto:!0,forced:ZM},{findIndex:function(t){return JM(this,t,arguments.length>1?arguments[1]:void 0)}}),XM(QM);var tL=ln,rL=Pa,eL=v,nL=RangeError,oL=function(t){var r=rL(eL(this)),e="",n=tL(t);if(n<0||n==1/0)throw nL("Wrong number of repetitions");for(;n>0;(n>>>=1)&&(r+=r))1&n&&(e+=r);return e},iL=so,aL=f,uL=ln,cL=BT,sL=oL,fL=o,lL=RangeError,hL=String,pL=Math.floor,vL=aL(sL),dL=aL("".slice),gL=aL(1..toFixed),yL=function(t,r,e){return 0===r?e:r%2==1?yL(t,r-1,e*t):yL(t*t,r/2,e)},mL=function(t,r,e){for(var n=-1,o=e;++n<6;)o+=r*t[n],t[n]=o%1e7,o=pL(o/1e7)},bL=function(t,r){for(var e=6,n=0;--e>=0;)n+=t[e],t[e]=pL(n/r),n=n%r*1e7},EL=function(t){for(var r=6,e="";--r>=0;)if(""!==e||0===r||0!==t[r]){var n=hL(t[r]);e=""===e?n:e+vL("0",7-n.length)+n}return e};iL({target:"Number",proto:!0,forced:fL((function(){return"0.000"!==gL(8e-5,3)||"1"!==gL(.9,0)||"1.25"!==gL(1.255,2)||"1000000000000000128"!==gL(0xde0b6b3a7640080,0)}))||!fL((function(){gL({})}))},{toFixed:function(t){var r,e,n,o,i=cL(this),a=uL(t),u=[0,0,0,0,0,0],c="",s="0";if(a<0||a>20)throw lL("Incorrect fraction digits");if(i!=i)return"NaN";if(i<=-1e21||i>=1e21)return hL(i);if(i<0&&(c="-",i=-i),i>1e-21)if(e=(r=function(t){for(var r=0,e=t;e>=4096;)r+=12,e/=4096;for(;e>=2;)r+=1,e/=2;return r}(i*yL(2,69,1))-69)<0?i*yL(2,-r,1):i/yL(2,r,1),e*=4503599627370496,(r=52-r)>0){for(mL(u,0,e),n=a;n>=7;)mL(u,1e7,0),n-=7;for(mL(u,yL(10,n,1),0),n=r-1;n>=23;)bL(u,1<<23),n-=23;bL(u,1<0?c+((o=s.length)<=a?"0."+vL("0",a-o)+s:dL(s,0,o-a)+"."+dL(s,o-a)):c+s}});var wL=Math.expm1,SL=Math.exp,AL=!wL||wL(10)>22025.465794806718||wL(10)<22025.465794806718||-2e-17!=wL(-2e-17)?function(t){var r=+t;return 0==r?r:r>-1e-6&&r<1e-6?r+r*r/2:SL(r)-1}:wL,xL=so,OL=o,RL=AL,TL=Math.abs,IL=Math.exp,PL=Math.E;xL({target:"Math",stat:!0,forced:OL((function(){return-2e-17!=Math.sinh(-2e-17)}))},{sinh:function(t){var r=+t;return TL(r)<1?(RL(r)-RL(-r))/2:(IL(r-1)-IL(-r-1))*(PL/2)}});var jL=so,ML=AL,LL=Math.cosh,kL=Math.abs,CL=Math.E;jL({target:"Math",stat:!0,forced:!LL||LL(710)===1/0},{cosh:function(t){var r=ML(kL(t)-1)+1;return(r+1/(r*CL*CL))*(CL/2)}}),so({target:"String",proto:!0},{repeat:oL});var _L,NL,UL,FL={},DL={get exports(){return FL},set exports(t){FL=t}},BL=hj,zL=ut,WL=e,HL=lt,qL=vt,VL=E,GL=xa,YL=Bt,$L=re,KL=an,JL=at.f,XL=kt,QL=Eo,ZL=_i,tk=ot,rk=U,ek=Ue.enforce,nk=Ue.get,ok=WL.Int8Array,ik=ok&&ok.prototype,ak=WL.Uint8ClampedArray,uk=ak&&ak.prototype,ck=ok&&QL(ok),sk=ik&&QL(ik),fk=Object.prototype,lk=WL.TypeError,hk=tk("toStringTag"),pk=rk("TYPED_ARRAY_TAG"),vk="TypedArrayConstructor",dk=BL&&!!ZL&&"Opera"!==GL(WL.opera),gk=!1,yk={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},mk={BigInt64Array:8,BigUint64Array:8},bk=function(t){var r=QL(t);if(qL(r)){var e=nk(r);return e&&VL(e,vk)?e[vk]:bk(r)}},Ek=function(t){if(!qL(t))return!1;var r=GL(t);return VL(yk,r)||VL(mk,r)};for(_L in yk)(UL=(NL=WL[_L])&&NL.prototype)?ek(UL)[vk]=NL:dk=!1;for(_L in mk)(UL=(NL=WL[_L])&&NL.prototype)&&(ek(UL)[vk]=NL);if((!dk||!HL(ck)||ck===Function.prototype)&&(ck=function(){throw lk("Incorrect invocation")},dk))for(_L in yk)WL[_L]&&ZL(WL[_L],ck);if((!dk||!sk||sk===fk)&&(sk=ck.prototype,dk))for(_L in yk)WL[_L]&&ZL(WL[_L].prototype,sk);if(dk&&QL(uk)!==sk&&ZL(uk,sk),zL&&!VL(sk,hk))for(_L in gk=!0,JL(sk,hk,{get:function(){return qL(this)?this[pk]:void 0}}),yk)WL[_L]&&$L(WL[_L],pk,_L);var wk={NATIVE_ARRAY_BUFFER_VIEWS:dk,TYPED_ARRAY_TAG:gk&&pk,aTypedArray:function(t){if(Ek(t))return t;throw lk("Target is not a typed array")},aTypedArrayConstructor:function(t){if(HL(t)&&(!ZL||XL(ck,t)))return t;throw lk(YL(t)+" is not a typed array constructor")},exportTypedArrayMethod:function(t,r,e,n){if(zL){if(e)for(var o in yk){var i=WL[o];if(i&&VL(i.prototype,t))try{delete i.prototype[t]}catch(ZW){try{i.prototype[t]=r}catch(a){}}}sk[t]&&!e||KL(sk,t,e?r:dk&&ik[t]||r,n)}},exportTypedArrayStaticMethod:function(t,r,e){var n,o;if(zL){if(ZL){if(e)for(n in yk)if((o=WL[n])&&VL(o,t))try{delete o[t]}catch(ZW){}if(ck[t]&&!e)return;try{return KL(ck,t,e?r:dk&&ck[t]||r)}catch(ZW){}}for(n in yk)!(o=WL[n])||o[t]&&!e||KL(o,t,r)}},getTypedArrayConstructor:bk,isView:function(t){if(!qL(t))return!1;var r=GL(t);return"DataView"===r||VL(yk,r)||VL(mk,r)},isTypedArray:Ek,TypedArray:ck,TypedArrayPrototype:sk},Sk=e,Ak=o,xk=Zm,Ok=wk.NATIVE_ARRAY_BUFFER_VIEWS,Rk=Sk.ArrayBuffer,Tk=Sk.Int8Array,Ik=!Ok||!Ak((function(){Tk(1)}))||!Ak((function(){new Tk(-1)}))||!xk((function(t){new Tk,new Tk(null),new Tk(1.5),new Tk(t)}),!0)||Ak((function(){return 1!==new Tk(new Rk(2),1,void 0).length})),Pk=ln,jk=RangeError,Mk=function(t){var r=Pk(t);if(r<0)throw jk("The argument can't be less than 0");return r},Lk=RangeError,kk=function(t,r){var e=Mk(t);if(e%r)throw Lk("Wrong offset");return e},Ck=xa,_k=function(t){var r=Ck(t);return"BigInt64Array"==r||"BigUint64Array"==r},Nk=ar,Uk=TypeError,Fk=function(t){var r=Nk(t,"number");if("number"==typeof r)throw Uk("Can't convert number to bigint");return BigInt(r)},Dk=yu,Bk=It,zk=fg,Wk=y,Hk=En,qk=Ac,Vk=gc,Gk=Gu,Yk=_k,$k=wk.aTypedArrayConstructor,Kk=Fk,Jk=so,Xk=e,Qk=It,Zk=ut,tC=Ik,rC=wk,eC=PM,nC=Au,oC=Mr,iC=re,aC=jI,uC=mn,cC=gj,sC=kk,fC=sr,lC=E,hC=xa,pC=vt,vC=Ft,dC=Qo,gC=kt,yC=_i,mC=un.f,bC=function(t){var r,e,n,o,i,a,u,c,s=zk(this),f=Wk(t),l=arguments.length,h=l>1?arguments[1]:void 0,p=void 0!==h,v=Vk(f);if(v&&!Gk(v))for(c=(u=qk(f,v)).next,f=[];!(a=Bk(c,u)).done;)f.push(a.value);for(p&&l>2&&(h=Dk(h,arguments[2])),e=Hk(f),n=new($k(s))(e),o=Yk(n),r=0;e>r;r++)i=p?h(f[r],r):f[r],n[r]=o?Kk(i):+i;return n},EC=xp.forEach,wC=ag,SC=at,AC=Rr,xC=Nb,OC=Ue.get,RC=Ue.set,TC=Ue.enforce,IC=SC.f,PC=AC.f,jC=Math.round,MC=Xk.RangeError,LC=eC.ArrayBuffer,kC=LC.prototype,CC=eC.DataView,_C=rC.NATIVE_ARRAY_BUFFER_VIEWS,NC=rC.TYPED_ARRAY_TAG,UC=rC.TypedArray,FC=rC.TypedArrayPrototype,DC=rC.aTypedArrayConstructor,BC=rC.isTypedArray,zC="BYTES_PER_ELEMENT",WC="Wrong length",HC=function(t,r){DC(t);for(var e=0,n=r.length,o=new t(n);n>e;)o[e]=r[e++];return o},qC=function(t,r){IC(t,r,{get:function(){return OC(this)[r]}})},VC=function(t){var r;return gC(kC,t)||"ArrayBuffer"==(r=hC(t))||"SharedArrayBuffer"==r},GC=function(t,r){return BC(t)&&!vC(r)&&r in t&&aC(+r)&&r>=0},YC=function(t,r){return r=fC(r),GC(t,r)?oC(2,t[r]):PC(t,r)},$C=function(t,r,e){return r=fC(r),!(GC(t,r)&&pC(e)&&lC(e,"value"))||lC(e,"get")||lC(e,"set")||e.configurable||lC(e,"writable")&&!e.writable||lC(e,"enumerable")&&!e.enumerable?IC(t,r,e):(t[r]=e.value,t)};Zk?(_C||(AC.f=YC,SC.f=$C,qC(FC,"buffer"),qC(FC,"byteOffset"),qC(FC,"byteLength"),qC(FC,"length")),Jk({target:"Object",stat:!0,forced:!_C},{getOwnPropertyDescriptor:YC,defineProperty:$C}),DL.exports=function(t,r,e){var n=t.match(/\d+$/)[0]/8,o=t+(e?"Clamped":"")+"Array",i="get"+t,a="set"+t,u=Xk[o],c=u,s=c&&c.prototype,f={},l=function(t,r){IC(t,r,{get:function(){return function(t,r){var e=OC(t);return e.view[i](r*n+e.byteOffset,!0)}(this,r)},set:function(t){return function(t,r,o){var i=OC(t);e&&(o=(o=jC(o))<0?0:o>255?255:255&o),i.view[a](r*n+i.byteOffset,o,!0)}(this,r,t)},enumerable:!0})};_C?tC&&(c=r((function(t,r,e,o){return nC(t,s),xC(pC(r)?VC(r)?void 0!==o?new u(r,sC(e,n),o):void 0!==e?new u(r,sC(e,n)):new u(r):BC(r)?HC(c,r):Qk(bC,c,r):new u(cC(r)),t,c)})),yC&&yC(c,UC),EC(mC(u),(function(t){t in c||iC(c,t,u[t])})),c.prototype=s):(c=r((function(t,r,e,o){nC(t,s);var i,a,u,f=0,h=0;if(pC(r)){if(!VC(r))return BC(r)?HC(c,r):Qk(bC,c,r);i=r,h=sC(e,n);var p=r.byteLength;if(void 0===o){if(p%n)throw MC(WC);if((a=p-h)<0)throw MC(WC)}else if((a=uC(o)*n)+h>p)throw MC(WC);u=a/n}else u=cC(r),i=new LC(a=u*n);for(RC(t,{buffer:i,byteOffset:h,byteLength:a,length:u,view:new CC(i)});f=0?n:e+n;return o<0||o>=e?void 0:r[o]}));var QC=y,ZC=dn,t_=En,r_=WA,e_=Math.min,n_=[].copyWithin||function(t,r){var e=QC(this),n=t_(e),o=ZC(t,n),i=ZC(r,n),a=arguments.length>2?arguments[2]:void 0,u=e_((void 0===a?n:ZC(a,n))-i,n-o),c=1;for(i0;)i in e?e[o]=e[i]:r_(e,o),o+=c,i+=c;return e},o_=wk,i_=f(n_),a_=o_.aTypedArray;(0,o_.exportTypedArrayMethod)("copyWithin",(function(t,r){return i_(a_(this),t,r,arguments.length>2?arguments[2]:void 0)}));var u_=xp.every,c_=wk.aTypedArray;(0,wk.exportTypedArrayMethod)("every",(function(t){return u_(c_(this),t,arguments.length>1?arguments[1]:void 0)}));var s_=Tj,f_=Fk,l_=xa,h_=It,p_=o,v_=wk.aTypedArray,d_=wk.exportTypedArrayMethod,g_=f("".slice);d_("fill",(function(t){var r=arguments.length;v_(this);var e="Big"===g_(l_(this),0,3)?f_(t):+t;return h_(s_,this,e,r>1?arguments[1]:void 0,r>2?arguments[2]:void 0)}),p_((function(){var t=0;return new Int8Array(2).fill({valueOf:function(){return t++}}),1!==t})));var y_=En,m_=function(t,r){for(var e=0,n=y_(r),o=new t(n);n>e;)o[e]=r[e++];return o},b_=dg,E_=wk.aTypedArrayConstructor,w_=wk.getTypedArrayConstructor,S_=function(t){return E_(b_(t,w_(t)))},A_=m_,x_=S_,O_=xp.filter,R_=function(t,r){return A_(x_(t),r)},T_=wk.aTypedArray;(0,wk.exportTypedArrayMethod)("filter",(function(t){var r=O_(T_(this),t,arguments.length>1?arguments[1]:void 0);return R_(this,r)}));var I_=xp.find,P_=wk.aTypedArray;(0,wk.exportTypedArrayMethod)("find",(function(t){return I_(P_(this),t,arguments.length>1?arguments[1]:void 0)}));var j_=xp.findIndex,M_=wk.aTypedArray;(0,wk.exportTypedArrayMethod)("findIndex",(function(t){return j_(M_(this),t,arguments.length>1?arguments[1]:void 0)}));var L_=yu,k_=Br,C_=y,__=En,N_=function(t){var r=1==t;return function(e,n,o){for(var i,a=C_(e),u=k_(a),c=L_(n,o),s=__(u);s-- >0;)if(c(i=u[s],s,a))switch(t){case 0:return i;case 1:return s}return r?-1:void 0}},U_={findLast:N_(0),findLastIndex:N_(1)},F_=U_.findLast,D_=wk.aTypedArray;(0,wk.exportTypedArrayMethod)("findLast",(function(t){return F_(D_(this),t,arguments.length>1?arguments[1]:void 0)}));var B_=U_.findLastIndex,z_=wk.aTypedArray;(0,wk.exportTypedArrayMethod)("findLastIndex",(function(t){return B_(z_(this),t,arguments.length>1?arguments[1]:void 0)}));var W_=xp.forEach,H_=wk.aTypedArray;(0,wk.exportTypedArrayMethod)("forEach",(function(t){W_(H_(this),t,arguments.length>1?arguments[1]:void 0)}));var q_=On.includes,V_=wk.aTypedArray;(0,wk.exportTypedArrayMethod)("includes",(function(t){return q_(V_(this),t,arguments.length>1?arguments[1]:void 0)}));var G_=On.indexOf,Y_=wk.aTypedArray;(0,wk.exportTypedArrayMethod)("indexOf",(function(t){return G_(Y_(this),t,arguments.length>1?arguments[1]:void 0)}));var $_=e,K_=o,J_=f,X_=wk,Q_=va,Z_=ot("iterator"),tN=$_.Uint8Array,rN=J_(Q_.values),eN=J_(Q_.keys),nN=J_(Q_.entries),oN=X_.aTypedArray,iN=X_.exportTypedArrayMethod,aN=tN&&tN.prototype,uN=!K_((function(){aN[Z_].call([1])})),cN=!!aN&&aN.values&&aN[Z_]===aN.values&&"values"===aN.values.name,sN=function(){return rN(oN(this))};iN("entries",(function(){return nN(oN(this))}),uN),iN("keys",(function(){return eN(oN(this))}),uN),iN("values",sN,uN||!cN,{name:"values"}),iN(Z_,sN,uN||!cN,{name:"values"});var fN=wk.aTypedArray,lN=wk.exportTypedArrayMethod,hN=f([].join);lN("join",(function(t){return hN(fN(this),t)}));var pN=Xv,vN=Hr,dN=ln,gN=En,yN=RS,mN=Math.min,bN=[].lastIndexOf,EN=!!bN&&1/[1].lastIndexOf(1,-0)<0,wN=yN("lastIndexOf"),SN=EN||!wN?function(t){if(EN)return pN(bN,this,arguments)||0;var r=vN(this),e=gN(r),n=e-1;for(arguments.length>1&&(n=mN(n,dN(arguments[1]))),n<0&&(n=e+n);n>=0;n--)if(n in r&&r[n]===t)return n||0;return-1}:bN,AN=Xv,xN=SN,ON=wk.aTypedArray;(0,wk.exportTypedArrayMethod)("lastIndexOf",(function(t){var r=arguments.length;return AN(xN,ON(this),r>1?[t,arguments[1]]:[t])}));var RN=xp.map,TN=S_,IN=wk.aTypedArray;(0,wk.exportTypedArrayMethod)("map",(function(t){return RN(IN(this),t,arguments.length>1?arguments[1]:void 0,(function(t,r){return new(TN(t))(r)}))}));var PN=lO.left,jN=wk.aTypedArray;(0,wk.exportTypedArrayMethod)("reduce",(function(t){var r=arguments.length;return PN(jN(this),t,r,r>1?arguments[1]:void 0)}));var MN=lO.right,LN=wk.aTypedArray;(0,wk.exportTypedArrayMethod)("reduceRight",(function(t){var r=arguments.length;return MN(LN(this),t,r,r>1?arguments[1]:void 0)}));var kN=wk.aTypedArray,CN=wk.exportTypedArrayMethod,_N=Math.floor;CN("reverse",(function(){for(var t,r=this,e=kN(r).length,n=_N(e/2),o=0;o1?arguments[1]:void 0,1),e=zN(t);if(KN)return UN(GN,this,e,r);var n=this.length,o=DN(e),i=0;if(o+r>n)throw HN("Wrong length");for(;io;)a[o]=e[o++];return a}),o((function(){new Int8Array(1).slice()})));var tU=xp.some,rU=wk.aTypedArray;(0,wk.exportTypedArrayMethod)("some",(function(t){return tU(rU(this),t,arguments.length>1?arguments[1]:void 0)}));var eU=pu,nU=o,oU=qt,iU=ds,aU=GI,uU=YI,cU=V,sU=KI,fU=wk.aTypedArray,lU=wk.exportTypedArrayMethod,hU=e.Uint16Array,pU=hU&&eU(hU.prototype.sort),vU=!(!pU||nU((function(){pU(new hU(2),null)}))&&nU((function(){pU(new hU(2),{})}))),dU=!!pU&&!nU((function(){if(cU)return cU<74;if(aU)return aU<67;if(uU)return!0;if(sU)return sU<602;var t,r,e=new hU(516),n=Array(516);for(t=0;t<516;t++)r=t%4,e[t]=515-t,n[t]=t-2*r+3;for(pU(e,(function(t,r){return(t/4|0)-(r/4|0)})),t=0;t<516;t++)if(e[t]!==n[t])return!0}));lU("sort",(function(t){return void 0!==t&&oU(t),dU?pU(this,t):iU(fU(this),function(t){return function(r,e){return void 0!==t?+t(r,e)||0:e!=e?-1:r!=r?1:0===r&&0===e?1/r>0&&1/e<0?1:-1:r>e}}(t))}),!dU||vU);var gU=mn,yU=dn,mU=S_,bU=wk.aTypedArray;(0,wk.exportTypedArrayMethod)("subarray",(function(t,r){var e=bU(this),n=e.length,o=yU(t,n);return new(mU(e))(e.buffer,e.byteOffset+o*e.BYTES_PER_ELEMENT,gU((void 0===r?n:yU(r,n))-o))}));var EU=Xv,wU=wk,SU=o,AU=Qv,xU=e.Int8Array,OU=wU.aTypedArray,RU=wU.exportTypedArrayMethod,TU=[].toLocaleString,IU=!!xU&&SU((function(){TU.call(new xU(1))}));RU("toLocaleString",(function(){return EU(TU,IU?AU(OU(this)):OU(this),AU(arguments))}),SU((function(){return[1,2].toLocaleString()!=new xU([1,2]).toLocaleString()}))||!SU((function(){xU.prototype.toLocaleString.call([1,2])})));var PU=wk.exportTypedArrayMethod,jU=o,MU=f,LU=e.Uint8Array,kU=LU&&LU.prototype||{},CU=[].toString,_U=MU([].join);jU((function(){CU.call({})}))&&(CU=function(){return _U(this)});var NU=kU.toString!=CU;PU("toString",CU,NU);var UU=En,FU=function(t,r){for(var e=UU(t),n=new r(e),o=0;o=o||a<0)throw KU("Incorrect index");for(var u=new r(o),c=0;ch;h++)a=c[h],(i=uF(s(a,h,u)))in f?hF(f[i],a):f[i]=[a];if(n&&(o=n(u))!==lF)for(i in f)f[i]=fF(o,f[i]);return f},vF=ui;so({target:"Array",proto:!0},{group:function(t){var r=arguments.length>1?arguments[1]:void 0;return pF(this,t,r)}}),vF("group");var dF=e.isFinite;so({target:"Number",stat:!0},{isFinite:Number.isFinite||function(t){return"number"==typeof t&&dF(t)}}),so({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MIN_SAFE_INTEGER:-9007199254740991}),so({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MAX_SAFE_INTEGER:9007199254740991});var gF=Hg.clear;so({global:!0,bind:!0,enumerable:!0,forced:e.clearImmediate!==gF},{clearImmediate:gF});var yF="function"==typeof Bun&&Bun&&"string"==typeof Bun.version,mF=e,bF=Xv,EF=lt,wF=yF,SF=F,AF=Qv,xF=us,OF=mF.Function,RF=/MSIE .\./.test(SF)||wF&&function(){var t=mF.Bun.version.split(".");return t.length<3||0==t[0]&&(t[1]<3||3==t[1]&&0==t[2])}(),TF=so,IF=e,PF=Hg.set,jF=function(t,r){var e=r?2:1;return RF?function(n,o){var i=xF(arguments.length,1)>e,a=EF(n)?n:OF(n),u=i?AF(arguments,e):[],c=i?function(){bF(a,this,u)}:a;return r?t(c,o):t(c)}:t},MF=IF.setImmediate?jF(PF,!1):PF;TF({global:!0,bind:!0,enumerable:!0,forced:IF.setImmediate!==MF},{setImmediate:MF});var LF=e,kF=wi;so({global:!0},{Reflect:{}}),kF(LF.Reflect,"Reflect",!0);var CF=f,_F=qt,NF=vt,UF=E,FF=Qv,DF=i,BF=Function,zF=CF([].concat),WF=CF([].join),HF={},qF=function(t,r,e){if(!UF(HF,r)){for(var n=[],o=0;o>>0;return r?31-uD(cD(r+.5)*sD):32}});var fD=Object.is||function(t,r){return t===r?0!==t||1/t==1/r:t!=t&&r!=r};so({target:"Object",stat:!0},{is:fD});var lD=so,hD=gy,pD=qt,vD=us,dD=rg,gD=e.process;lD({global:!0,enumerable:!0,dontCallGetSet:!0},{queueMicrotask:function(t){vD(arguments.length,1),pD(t);var r=dD&&gD.domain;hD(r?r.bind(t):t)}}),so({target:"Object",stat:!0},{setPrototypeOf:_i}),so({target:"Math",stat:!0},{sign:Math.sign||function(t){var r=+t;return 0==r||r!=r?r:r<0?-1:1}});var yD=so,mD=o,bD=mh.f;yD({target:"Object",stat:!0,forced:mD((function(){return!Object.getOwnPropertyNames(1)}))},{getOwnPropertyNames:bD});var ED=so,wD=my,SD=o,AD=Lt,xD=lt,OD=dg,RD=Ob,TD=an,ID=wD&&wD.prototype;if(ED({target:"Promise",proto:!0,real:!0,forced:!!wD&&SD((function(){ID.finally.call({then:function(){}},(function(){}))}))},{finally:function(t){var r=OD(this,AD("Promise")),e=xD(t);return this.then(e?function(e){return RD(r,t()).then((function(){return e}))}:t,e?function(e){return RD(r,t()).then((function(){throw e}))}:t)}}),xD(wD)){var PD=AD("Promise").prototype.finally;ID.finally!==PD&&TD(ID,"finally",PD,{unsafe:!0})}var jD=so,MD=o,LD=vt,kD=_r,CD=xh,_D=Object.isFrozen;jD({target:"Object",stat:!0,forced:CD||MD((function(){_D(1)}))},{isFrozen:function(t){return!LD(t)||(!(!CD||"ArrayBuffer"!=kD(t))||!!_D&&_D(t))}}),so({target:"Reflect",stat:!0},{ownKeys:zn});var ND=zn,UD=Hr,FD=Rr,DD=fc;so({target:"Object",stat:!0,sham:!ut},{getOwnPropertyDescriptors:function(t){for(var r,e,n=UD(t),o=FD.f,i=ND(n),a={},u=0;i.length>u;)void 0!==(e=o(n,r=i[u++]))&&DD(a,r,e);return a}});var BD=Ot,zD=Rr;so({target:"Reflect",stat:!0,sham:!ut},{getOwnPropertyDescriptor:function(t,r){return zD.f(BD(t),r)}});var WD=so,HD=ut,qD=To.f;WD({target:"Object",stat:!0,forced:Object.defineProperties!==qD,sham:!HD},{defineProperties:qD}),Or("species"),ag("Array");var VD=lO.right;so({target:"Array",proto:!0,forced:!rg&&V>79&&V<83||!RS("reduceRight")},{reduceRight:function(t){return VD(this,t,arguments.length,arguments.length>1?arguments[1]:void 0)}});var GD=U_.findLast,YD=ui;so({target:"Array",proto:!0},{findLast:function(t){return GD(this,t,arguments.length>1?arguments[1]:void 0)}}),YD("findLast");var $D=so,KD=It,JD=pu,XD=Ii,QD=ea,ZD=v,tB=mn,rB=Pa,eB=Ot,nB=l,oB=US,iB=nS,aB=Yt,uB=an,cB=o,sB=dg,fB=sw,lB=Ow,hB=Ue,pB=ot("matchAll"),vB="RegExp String",dB=vB+" Iterator",gB=hB.set,yB=hB.getterFor(dB),mB=RegExp.prototype,bB=TypeError,EB=JD("".indexOf),wB=JD("".matchAll),SB=!!wB&&!cB((function(){wB("a",/./)})),AB=XD((function(t,r,e,n){gB(this,{type:dB,regexp:t,string:r,global:e,unicode:n,done:!1})}),vB,(function(){var t=yB(this);if(t.done)return QD(void 0,!0);var r=t.regexp,e=t.string,n=lB(r,e);return null===n?(t.done=!0,QD(void 0,!0)):t.global?(""===rB(n[0])&&(r.lastIndex=fB(e,tB(r.lastIndex),t.unicode)),QD(n,!1)):(t.done=!0,QD(n,!1))})),xB=function(t){var r,e,n,o=eB(this),i=rB(t),a=sB(o,RegExp),u=rB(iB(o));return r=new a(a===RegExp?o.source:o,u),e=!!~EB(u,"g"),n=!!~EB(u,"u"),r.lastIndex=tB(o.lastIndex),new AB(r,i,e,n)};$D({target:"String",proto:!0,forced:SB},{matchAll:function(t){var r,e,n,o=ZD(this);if(nB(t)){if(SB)return wB(o,t)}else{if(oB(t)&&(r=rB(ZD(iB(t))),!~EB(r,"g")))throw bB("`.matchAll` does not allow non-global regexes");if(SB)return wB(o,t);if(n=aB(t,pB))return KD(n,t,o)}return e=rB(o),new RegExp(t,"g")[pB](e)}}),pB in mB||uB(mB,pB,xB);var OB=so,RB=It,TB=f,IB=v,PB=lt,jB=l,MB=US,LB=Pa,kB=Yt,CB=nS,_B=mw,NB=ot("replace"),UB=TypeError,FB=TB("".indexOf);TB("".replace);var DB=TB("".slice),BB=Math.max,zB=function(t,r,e){return e>t.length?-1:""===r?e:FB(t,r,e)};OB({target:"String",proto:!0},{replaceAll:function(t,r){var e,n,o,i,a,u,c,s,f=IB(this),l=0,h=0,p="";if(!jB(t)){if(MB(t)&&(e=LB(IB(CB(t))),!~FB(e,"g")))throw UB("`.replaceAll` does not allow non-global regexes");if(n=kB(t,NB))return RB(n,t,f,r)}for(o=LB(f),i=LB(t),(a=PB(r))||(r=LB(r)),u=i.length,c=BB(1,u),l=zB(o,i,0);-1!==l;)s=a?LB(r(i,l,o)):_B(i,o,l,[],void 0,r),p+=DB(o,h,l)+s,h=l+u,l=zB(o,i,l+c);return ho&&(i=BW(i,0,o)),t?a+i:i+a)}},HW={start:WW(!1),end:WW(!0)},qW=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(F),VW=HW.start;so({target:"String",proto:!0,forced:qW},{padStart:function(t){return VW(this,t,arguments.length>1?arguments[1]:void 0)}});var GW=v,YW=Pa,$W=/"/g,KW=f("".replace),JW=o,XW=function(t,r,e,n){var o=YW(GW(t)),i="<"+r;return""!==e&&(i+=" "+e+'="'+KW(YW(n),$W,""")+'"'),i+">"+o+""},QW=function(t){return JW((function(){var r=""[t]('"');return r!==r.toLowerCase()||r.split('"').length>3}))};so({target:"String",proto:!0,forced:QW("anchor")},{anchor:function(t){return XW(this,"a","name",t)}}),function(){function r(t,r){return(r||"")+" (SystemJS https://github.com/systemjs/systemjs/blob/main/docs/errors.md#"+t+")"}function e(t,r){if(-1!==t.indexOf("\\")&&(t=t.replace(x,"/")),"/"===t[0]&&"/"===t[1])return r.slice(0,r.indexOf(":")+1)+t;if("."===t[0]&&("/"===t[1]||"."===t[1]&&("/"===t[2]||2===t.length&&(t+="/"))||1===t.length&&(t+="/"))||"/"===t[0]){var e,n=r.slice(0,r.indexOf(":")+1);if(e="/"===r[n.length+1]?"file:"!==n?(e=r.slice(n.length+2)).slice(e.indexOf("/")+1):r.slice(8):r.slice(n.length+("/"===r[n.length])),"/"===t[0])return r.slice(0,r.length-e.length-1)+t;for(var o=e.slice(0,e.lastIndexOf("/")+1)+t,i=[],a=-1,u=0;ue.length&&"/"!==n[n.length-1]))return n+t.slice(e.length);c("W2",e,n)}}function c(t,e,n){console.warn(r(t,[n,e].join(", ")))}function s(t,r,e){for(var n=t.scopes,o=e&&a(e,n);o;){var i=u(r,n[o]);if(i)return i;o=a(o.slice(0,o.lastIndexOf("/")),n)}return u(r,t.imports)||-1!==r.indexOf(":")&&r}function f(){this[R]={}}function l(t,e,n){var o=t[R][e];if(o)return o;var i=[],a=Object.create(null);O&&Object.defineProperty(a,O,{value:"Module"});var u=Promise.resolve().then((function(){return t.instantiate(e,n)})).then((function(n){if(!n)throw Error(r(2,e));var u=n[1]((function(t,r){o.h=!0;var e=!1;if("string"==typeof t)t in a&&a[t]===r||(a[t]=r,e=!0);else{for(var n in t)r=t[n],n in a&&a[n]===r||(a[n]=r,e=!0);t&&t.__esModule&&(a.__esModule=t.__esModule)}if(e)for(var u=0;u-1){var e=document.createEvent("Event");e.initEvent("error",!1,!1),t.dispatchEvent(e)}return Promise.reject(r)}))}else if("systemjs-importmap"===t.type){t.sp=!0;var e=t.src?(System.fetch||fetch)(t.src,{integrity:t.integrity,passThrough:!0}).then((function(t){if(!t.ok)throw Error(t.status);return t.text()})).catch((function(e){return e.message=r("W4",t.src)+"\n"+e.message,console.warn(e),"function"==typeof t.onerror&&t.onerror(),"{}"})):t.innerHTML;M=M.then((function(){return e})).then((function(e){!function(t,e,n){var o={};try{o=JSON.parse(e)}catch(u){console.warn(Error(r("W5")))}i(o,n,t)}(L,e,t.src||g)}))}}))}var g,y="undefined"!=typeof Symbol,m="undefined"!=typeof self,b="undefined"!=typeof document,E=m?self:t;if(b){var w=document.querySelector("base[href]");w&&(g=w.href)}if(!g&&"undefined"!=typeof location){var S=(g=location.href.split("#")[0].split("?")[0]).lastIndexOf("/");-1!==S&&(g=g.slice(0,S+1))}var A,x=/\\/g,O=y&&Symbol.toStringTag,R=y?Symbol():"@",T=f.prototype;T.import=function(t,r){var e=this;return Promise.resolve(e.prepareImport()).then((function(){return e.resolve(t,r)})).then((function(t){var r=l(e,t);return r.C||p(e,r)}))},T.createContext=function(t){var r=this;return{url:t,resolve:function(e,n){return Promise.resolve(r.resolve(e,n||t))}}},T.register=function(t,r){A=[t,r]},T.getRegister=function(){var t=A;return A=void 0,t};var I=Object.freeze(Object.create(null));E.System=new f;var P,j,M=Promise.resolve(),L={imports:{},scopes:{},depcache:{},integrity:{}},k=b;if(T.prepareImport=function(t){return(k||t)&&(d(),k=!1),M},b&&(d(),window.addEventListener("DOMContentLoaded",d)),T.addImportMap=function(t,r){i(t,r||g,L)},b){window.addEventListener("error",(function(t){_=t.filename,N=t.error}));var C=location.origin}T.createScript=function(t){var r=document.createElement("script");r.async=!0,t.indexOf(C+"/")&&(r.crossOrigin="anonymous");var e=L.integrity[t];return e&&(r.integrity=e),r.src=t,r};var _,N,U={},F=T.register;T.register=function(t,r){if(b&&"loading"===document.readyState&&"string"!=typeof t){var e=document.querySelectorAll("script[src]"),n=e[e.length-1];if(n){P=t;var o=this;j=setTimeout((function(){U[n.src]=[t,r],o.import(n.src)}))}}else P=void 0;return F.call(this,t,r)},T.instantiate=function(t,e){var n=U[t];if(n)return delete U[t],n;var o=this;return Promise.resolve(T.createScript(t)).then((function(n){return new Promise((function(i,a){n.addEventListener("error",(function(){a(Error(r(3,[t,e].join(", "))))})),n.addEventListener("load",(function(){if(document.head.removeChild(n),_===t)a(N);else{var r=o.getRegister(t);r&&r[0]===P&&clearTimeout(j),i(r)}})),document.head.appendChild(n)}))}))},T.shouldFetch=function(){return!1},"undefined"!=typeof fetch&&(T.fetch=fetch);var D=T.instantiate,B=/^(text|application)\/(x-)?javascript(;|$)/;T.instantiate=function(t,e){var n=this;return this.shouldFetch(t)?this.fetch(t,{credentials:"same-origin",integrity:L.integrity[t]}).then((function(o){if(!o.ok)throw Error(r(7,[o.status,o.statusText,t,e].join(", ")));var i=o.headers.get("content-type");if(!i||!B.test(i))throw Error(r(4,i));return o.text().then((function(r){return r.indexOf("//# sourceURL=")<0&&(r+="\n//# sourceURL="+t),(0,eval)(r),n.getRegister(t)}))})):D.apply(this,arguments)},T.resolve=function(t,n){return s(L,e(t,n=n||g)||t,n)||function(t,e){throw Error(r(8,[t,e].join(", ")))}(t,n)};var z=T.instantiate;T.instantiate=function(t,r){var e=L.depcache[t];if(e)for(var n=0;n - - InvokeAI - A Stable Diffusion Toolkit - + - -
- - - diff --git a/invokeai/frontend/stats.html b/invokeai/frontend/stats.html index b1b2a7f36f..bded7299f2 100644 --- a/invokeai/frontend/stats.html +++ b/invokeai/frontend/stats.html @@ -6157,7 +6157,7 @@ var drawChart = (function (exports) {