IOPaint/inpaint/web_app/assets/index-VrFIcmY_.js
root 70af4845af new file: inpaint/__init__.py
new file:   inpaint/__main__.py
	new file:   inpaint/api.py
	new file:   inpaint/batch_processing.py
	new file:   inpaint/benchmark.py
	new file:   inpaint/cli.py
	new file:   inpaint/const.py
	new file:   inpaint/download.py
	new file:   inpaint/file_manager/__init__.py
	new file:   inpaint/file_manager/file_manager.py
	new file:   inpaint/file_manager/storage_backends.py
	new file:   inpaint/file_manager/utils.py
	new file:   inpaint/helper.py
	new file:   inpaint/installer.py
	new file:   inpaint/model/__init__.py
	new file:   inpaint/model/anytext/__init__.py
	new file:   inpaint/model/anytext/anytext_model.py
	new file:   inpaint/model/anytext/anytext_pipeline.py
	new file:   inpaint/model/anytext/anytext_sd15.yaml
	new file:   inpaint/model/anytext/cldm/__init__.py
	new file:   inpaint/model/anytext/cldm/cldm.py
	new file:   inpaint/model/anytext/cldm/ddim_hacked.py
	new file:   inpaint/model/anytext/cldm/embedding_manager.py
	new file:   inpaint/model/anytext/cldm/hack.py
	new file:   inpaint/model/anytext/cldm/model.py
	new file:   inpaint/model/anytext/cldm/recognizer.py
	new file:   inpaint/model/anytext/ldm/__init__.py
	new file:   inpaint/model/anytext/ldm/models/__init__.py
	new file:   inpaint/model/anytext/ldm/models/autoencoder.py
	new file:   inpaint/model/anytext/ldm/models/diffusion/__init__.py
	new file:   inpaint/model/anytext/ldm/models/diffusion/ddim.py
	new file:   inpaint/model/anytext/ldm/models/diffusion/ddpm.py
	new file:   inpaint/model/anytext/ldm/models/diffusion/dpm_solver/__init__.py
	new file:   inpaint/model/anytext/ldm/models/diffusion/dpm_solver/dpm_solver.py
	new file:   inpaint/model/anytext/ldm/models/diffusion/dpm_solver/sampler.py
	new file:   inpaint/model/anytext/ldm/models/diffusion/plms.py
	new file:   inpaint/model/anytext/ldm/models/diffusion/sampling_util.py
	new file:   inpaint/model/anytext/ldm/modules/__init__.py
	new file:   inpaint/model/anytext/ldm/modules/attention.py
	new file:   inpaint/model/anytext/ldm/modules/diffusionmodules/__init__.py
	new file:   inpaint/model/anytext/ldm/modules/diffusionmodules/model.py
	new file:   inpaint/model/anytext/ldm/modules/diffusionmodules/openaimodel.py
	new file:   inpaint/model/anytext/ldm/modules/diffusionmodules/upscaling.py
	new file:   inpaint/model/anytext/ldm/modules/diffusionmodules/util.py
	new file:   inpaint/model/anytext/ldm/modules/distributions/__init__.py
	new file:   inpaint/model/anytext/ldm/modules/distributions/distributions.py
	new file:   inpaint/model/anytext/ldm/modules/ema.py
	new file:   inpaint/model/anytext/ldm/modules/encoders/__init__.py
	new file:   inpaint/model/anytext/ldm/modules/encoders/modules.py
	new file:   inpaint/model/anytext/ldm/util.py
	new file:   inpaint/model/anytext/main.py
	new file:   inpaint/model/anytext/ocr_recog/RNN.py
	new file:   inpaint/model/anytext/ocr_recog/RecCTCHead.py
	new file:   inpaint/model/anytext/ocr_recog/RecModel.py
	new file:   inpaint/model/anytext/ocr_recog/RecMv1_enhance.py
	new file:   inpaint/model/anytext/ocr_recog/RecSVTR.py
	new file:   inpaint/model/anytext/ocr_recog/__init__.py
	new file:   inpaint/model/anytext/ocr_recog/common.py
	new file:   inpaint/model/anytext/ocr_recog/en_dict.txt
	new file:   inpaint/model/anytext/ocr_recog/ppocr_keys_v1.txt
	new file:   inpaint/model/anytext/utils.py
	new file:   inpaint/model/base.py
	new file:   inpaint/model/brushnet/__init__.py
	new file:   inpaint/model/brushnet/brushnet.py
	new file:   inpaint/model/brushnet/brushnet_unet_forward.py
	new file:   inpaint/model/brushnet/brushnet_wrapper.py
	new file:   inpaint/model/brushnet/pipeline_brushnet.py
	new file:   inpaint/model/brushnet/unet_2d_blocks.py
	new file:   inpaint/model/controlnet.py
	new file:   inpaint/model/ddim_sampler.py
	new file:   inpaint/model/fcf.py
	new file:   inpaint/model/helper/__init__.py
	new file:   inpaint/model/helper/controlnet_preprocess.py
	new file:   inpaint/model/helper/cpu_text_encoder.py
	new file:   inpaint/model/helper/g_diffuser_bot.py
	new file:   inpaint/model/instruct_pix2pix.py
	new file:   inpaint/model/kandinsky.py
	new file:   inpaint/model/lama.py
	new file:   inpaint/model/ldm.py
	new file:   inpaint/model/manga.py
	new file:   inpaint/model/mat.py
	new file:   inpaint/model/mi_gan.py
	new file:   inpaint/model/opencv2.py
	new file:   inpaint/model/original_sd_configs/__init__.py
	new file:   inpaint/model/original_sd_configs/sd_xl_base.yaml
	new file:   inpaint/model/original_sd_configs/sd_xl_refiner.yaml
	new file:   inpaint/model/original_sd_configs/v1-inference.yaml
	new file:   inpaint/model/original_sd_configs/v2-inference-v.yaml
	new file:   inpaint/model/paint_by_example.py
	new file:   inpaint/model/plms_sampler.py
	new file:   inpaint/model/power_paint/__init__.py
	new file:   inpaint/model/power_paint/pipeline_powerpaint.py
	new file:   inpaint/model/power_paint/power_paint.py
	new file:   inpaint/model/power_paint/power_paint_v2.py
	new file:   inpaint/model/power_paint/powerpaint_tokenizer.py
2024-08-20 21:17:33 +02:00

166 lines
748 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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

var Uv=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var j=(e,t,n)=>(Uv(e,t,"read from private field"),n?n.call(e):t.get(e)),ke=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},we=(e,t,n,r)=>(Uv(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var Yf=(e,t,n,r)=>({set _(o){we(e,t,o,n)},get _(){return j(e,t,r)}}),tt=(e,t,n)=>(Uv(e,t,"access private method"),n);function R9(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const i=Object.getOwnPropertyDescriptor(r,o);i&&Object.defineProperty(e,o,i.get?i:{enumerable:!0,get:()=>r[o]})}}}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 o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var Qc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function pm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _$={exports:{}},mm={},E$={exports:{}},it={};/**
* @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 Pd=Symbol.for("react.element"),P9=Symbol.for("react.portal"),T9=Symbol.for("react.fragment"),k9=Symbol.for("react.strict_mode"),A9=Symbol.for("react.profiler"),M9=Symbol.for("react.provider"),O9=Symbol.for("react.context"),N9=Symbol.for("react.forward_ref"),D9=Symbol.for("react.suspense"),I9=Symbol.for("react.memo"),L9=Symbol.for("react.lazy"),H_=Symbol.iterator;function F9(e){return e===null||typeof e!="object"?null:(e=H_&&e[H_]||e["@@iterator"],typeof e=="function"?e:null)}var C$={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},$$=Object.assign,R$={};function xc(e,t,n){this.props=e,this.context=t,this.refs=R$,this.updater=n||C$}xc.prototype.isReactComponent={};xc.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")};xc.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function P$(){}P$.prototype=xc.prototype;function sw(e,t,n){this.props=e,this.context=t,this.refs=R$,this.updater=n||C$}var aw=sw.prototype=new P$;aw.constructor=sw;$$(aw,xc.prototype);aw.isPureReactComponent=!0;var K_=Array.isArray,T$=Object.prototype.hasOwnProperty,lw={current:null},k$={key:!0,ref:!0,__self:!0,__source:!0};function A$(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)T$.call(t,r)&&!k$.hasOwnProperty(r)&&(o[r]=t[r]);var l=arguments.length-2;if(l===1)o.children=n;else if(1<l){for(var u=Array(l),f=0;f<l;f++)u[f]=arguments[f+2];o.children=u}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)o[r]===void 0&&(o[r]=l[r]);return{$$typeof:Pd,type:e,key:i,ref:s,props:o,_owner:lw.current}}function j9(e,t){return{$$typeof:Pd,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function cw(e){return typeof e=="object"&&e!==null&&e.$$typeof===Pd}function B9(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var G_=/\/+/g;function Vv(e,t){return typeof e=="object"&&e!==null&&e.key!=null?B9(""+e.key):t.toString(36)}function Oh(e,t,n,r,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case Pd:case P9:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+Vv(s,0):r,K_(o)?(n="",e!=null&&(n=e.replace(G_,"$&/")+"/"),Oh(o,t,n,"",function(f){return f})):o!=null&&(cw(o)&&(o=j9(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(G_,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",K_(e))for(var l=0;l<e.length;l++){i=e[l];var u=r+Vv(i,l);s+=Oh(i,t,n,u,o)}else if(u=F9(e),typeof u=="function")for(e=u.call(e),l=0;!(i=e.next()).done;)i=i.value,u=r+Vv(i,l++),s+=Oh(i,t,n,u,o);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function Xf(e,t,n){if(e==null)return e;var r=[],o=0;return Oh(e,r,"","",function(i){return t.call(n,i,o++)}),r}function z9(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var zn={current:null},Nh={transition:null},U9={ReactCurrentDispatcher:zn,ReactCurrentBatchConfig:Nh,ReactCurrentOwner:lw};it.Children={map:Xf,forEach:function(e,t,n){Xf(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Xf(e,function(){t++}),t},toArray:function(e){return Xf(e,function(t){return t})||[]},only:function(e){if(!cw(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};it.Component=xc;it.Fragment=T9;it.Profiler=A9;it.PureComponent=sw;it.StrictMode=k9;it.Suspense=D9;it.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=U9;it.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=$$({},e.props),o=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=lw.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(u in t)T$.call(t,u)&&!k$.hasOwnProperty(u)&&(r[u]=t[u]===void 0&&l!==void 0?l[u]:t[u])}var u=arguments.length-2;if(u===1)r.children=n;else if(1<u){l=Array(u);for(var f=0;f<u;f++)l[f]=arguments[f+2];r.children=l}return{$$typeof:Pd,type:e.type,key:o,ref:i,props:r,_owner:s}};it.createContext=function(e){return e={$$typeof:O9,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:M9,_context:e},e.Consumer=e};it.createElement=A$;it.createFactory=function(e){var t=A$.bind(null,e);return t.type=e,t};it.createRef=function(){return{current:null}};it.forwardRef=function(e){return{$$typeof:N9,render:e}};it.isValidElement=cw;it.lazy=function(e){return{$$typeof:L9,_payload:{_status:-1,_result:e},_init:z9}};it.memo=function(e,t){return{$$typeof:I9,type:e,compare:t===void 0?null:t}};it.startTransition=function(e){var t=Nh.transition;Nh.transition={};try{e()}finally{Nh.transition=t}};it.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};it.useCallback=function(e,t){return zn.current.useCallback(e,t)};it.useContext=function(e){return zn.current.useContext(e)};it.useDebugValue=function(){};it.useDeferredValue=function(e){return zn.current.useDeferredValue(e)};it.useEffect=function(e,t){return zn.current.useEffect(e,t)};it.useId=function(){return zn.current.useId()};it.useImperativeHandle=function(e,t,n){return zn.current.useImperativeHandle(e,t,n)};it.useInsertionEffect=function(e,t){return zn.current.useInsertionEffect(e,t)};it.useLayoutEffect=function(e,t){return zn.current.useLayoutEffect(e,t)};it.useMemo=function(e,t){return zn.current.useMemo(e,t)};it.useReducer=function(e,t,n){return zn.current.useReducer(e,t,n)};it.useRef=function(e){return zn.current.useRef(e)};it.useState=function(e){return zn.current.useState(e)};it.useSyncExternalStore=function(e,t,n){return zn.current.useSyncExternalStore(e,t,n)};it.useTransition=function(){return zn.current.useTransition()};it.version="18.2.0";E$.exports=it;var d=E$.exports;const Be=pm(d),V9=R9({__proto__:null,default:Be},[d]);/**
* @license React
* react-jsx-runtime.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 W9=d,H9=Symbol.for("react.element"),K9=Symbol.for("react.fragment"),G9=Object.prototype.hasOwnProperty,Y9=W9.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,X9={key:!0,ref:!0,__self:!0,__source:!0};function M$(e,t,n){var r,o={},i=null,s=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)G9.call(t,r)&&!X9.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:H9,type:e,key:i,ref:s,props:o,_owner:Y9.current}}mm.Fragment=K9;mm.jsx=M$;mm.jsxs=M$;_$.exports=mm;var v=_$.exports,X0={},O$={exports:{}},Sr={},N$={exports:{}},D$={};/**
* @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(G,Z){var Q=G.length;G.push(Z);e:for(;0<Q;){var le=Q-1>>>1,L=G[le];if(0<o(L,Z))G[le]=Z,G[Q]=L,Q=le;else break e}}function n(G){return G.length===0?null:G[0]}function r(G){if(G.length===0)return null;var Z=G[0],Q=G.pop();if(Q!==Z){G[0]=Q;e:for(var le=0,L=G.length,ue=L>>>1;le<ue;){var Ne=2*(le+1)-1,Ke=G[Ne],Me=Ne+1,me=G[Me];if(0>o(Ke,Q))Me<L&&0>o(me,Ke)?(G[le]=me,G[Me]=Q,le=Me):(G[le]=Ke,G[Ne]=Q,le=Ne);else if(Me<L&&0>o(me,Q))G[le]=me,G[Me]=Q,le=Me;else break e}}return Z}function o(G,Z){var Q=G.sortIndex-Z.sortIndex;return Q!==0?Q:G.id-Z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var u=[],f=[],m=1,p=null,g=3,y=!1,x=!1,S=!1,E=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function C(G){for(var Z=n(f);Z!==null;){if(Z.callback===null)r(f);else if(Z.startTime<=G)r(f),Z.sortIndex=Z.expirationTime,t(u,Z);else break;Z=n(f)}}function R(G){if(S=!1,C(G),!x)if(n(u)!==null)x=!0,V(k);else{var Z=n(f);Z!==null&&J(R,Z.startTime-G)}}function k(G,Z){x=!1,S&&(S=!1,_(I),I=-1),y=!0;var Q=g;try{for(C(Z),p=n(u);p!==null&&(!(p.expirationTime>Z)||G&&!ie());){var le=p.callback;if(typeof le=="function"){p.callback=null,g=p.priorityLevel;var L=le(p.expirationTime<=Z);Z=e.unstable_now(),typeof L=="function"?p.callback=L:p===n(u)&&r(u),C(Z)}else r(u);p=n(u)}if(p!==null)var ue=!0;else{var Ne=n(f);Ne!==null&&J(R,Ne.startTime-Z),ue=!1}return ue}finally{p=null,g=Q,y=!1}}var O=!1,A=null,I=-1,z=5,H=-1;function ie(){return!(e.unstable_now()-H<z)}function K(){if(A!==null){var G=e.unstable_now();H=G;var Z=!0;try{Z=A(!0,G)}finally{Z?te():(O=!1,A=null)}}else O=!1}var te;if(typeof b=="function")te=function(){b(K)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,re=U.port2;U.port1.onmessage=K,te=function(){re.postMessage(null)}}else te=function(){E(K,0)};function V(G){A=G,O||(O=!0,te())}function J(G,Z){I=E(function(){G(e.unstable_now())},Z)}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(G){G.callback=null},e.unstable_continueExecution=function(){x||y||(x=!0,V(k))},e.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<G?Math.floor(1e3/G):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(G){switch(g){case 1:case 2:case 3:var Z=3;break;default:Z=g}var Q=g;g=Z;try{return G()}finally{g=Q}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(G,Z){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var Q=g;g=G;try{return Z()}finally{g=Q}},e.unstable_scheduleCallback=function(G,Z,Q){var le=e.unstable_now();switch(typeof Q=="object"&&Q!==null?(Q=Q.delay,Q=typeof Q=="number"&&0<Q?le+Q:le):Q=le,G){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=Q+L,G={id:m++,callback:Z,priorityLevel:G,startTime:Q,expirationTime:L,sortIndex:-1},Q>le?(G.sortIndex=Q,t(f,G),n(u)===null&&G===n(f)&&(S?(_(I),I=-1):S=!0,J(R,Q-le))):(G.sortIndex=L,t(u,G),x||y||(x=!0,V(k))),G},e.unstable_shouldYield=ie,e.unstable_wrapCallback=function(G){var Z=g;return function(){var Q=g;g=Z;try{return G.apply(this,arguments)}finally{g=Q}}}})(D$);N$.exports=D$;var Z9=N$.exports;/**
* @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 I$=d,wr=Z9;function de(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var L$=new Set,Fu={};function Fa(e,t){Jl(e,t),Jl(e+"Capture",t)}function Jl(e,t){for(Fu[e]=t,e=0;e<t.length;e++)L$.add(t[e])}var _i=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Z0=Object.prototype.hasOwnProperty,q9=/^[: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]*$/,Y_={},X_={};function Q9(e){return Z0.call(X_,e)?!0:Z0.call(Y_,e)?!1:q9.test(e)?X_[e]=!0:(Y_[e]=!0,!1)}function J9(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 eD(e,t,n,r){if(t===null||typeof t>"u"||J9(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 Un(e,t,n,r,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var wn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){wn[e]=new Un(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];wn[t]=new Un(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){wn[e]=new Un(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){wn[e]=new Un(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){wn[e]=new Un(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){wn[e]=new Un(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){wn[e]=new Un(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){wn[e]=new Un(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){wn[e]=new Un(e,5,!1,e.toLowerCase(),null,!1,!1)});var uw=/[\-:]([a-z])/g;function dw(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(uw,dw);wn[t]=new Un(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(uw,dw);wn[t]=new Un(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(uw,dw);wn[t]=new Un(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){wn[e]=new Un(e,1,!1,e.toLowerCase(),null,!1,!1)});wn.xlinkHref=new Un("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){wn[e]=new Un(e,1,!1,e.toLowerCase(),null,!0,!0)});function fw(e,t,n,r){var o=wn.hasOwnProperty(t)?wn[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(eD(t,n,o,r)&&(n=null),r||o===null?Q9(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Oi=I$.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Zf=Symbol.for("react.element"),vl=Symbol.for("react.portal"),yl=Symbol.for("react.fragment"),hw=Symbol.for("react.strict_mode"),q0=Symbol.for("react.profiler"),F$=Symbol.for("react.provider"),j$=Symbol.for("react.context"),pw=Symbol.for("react.forward_ref"),Q0=Symbol.for("react.suspense"),J0=Symbol.for("react.suspense_list"),mw=Symbol.for("react.memo"),ns=Symbol.for("react.lazy"),B$=Symbol.for("react.offscreen"),Z_=Symbol.iterator;function Jc(e){return e===null||typeof e!="object"?null:(e=Z_&&e[Z_]||e["@@iterator"],typeof e=="function"?e:null)}var jt=Object.assign,Wv;function gu(e){if(Wv===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Wv=t&&t[1]||""}return`
`+Wv+e}var Hv=!1;function Kv(e,t){if(!e||Hv)return"";Hv=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(f){var r=f}Reflect.construct(e,[],t)}else{try{t.call()}catch(f){r=f}e.call(t.prototype)}else{try{throw Error()}catch(f){r=f}e()}}catch(f){if(f&&r&&typeof f.stack=="string"){for(var o=f.stack.split(`
`),i=r.stack.split(`
`),s=o.length-1,l=i.length-1;1<=s&&0<=l&&o[s]!==i[l];)l--;for(;1<=s&&0<=l;s--,l--)if(o[s]!==i[l]){if(s!==1||l!==1)do if(s--,l--,0>l||o[s]!==i[l]){var u=`
`+o[s].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=s&&0<=l);break}}}finally{Hv=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?gu(e):""}function tD(e){switch(e.tag){case 5:return gu(e.type);case 16:return gu("Lazy");case 13:return gu("Suspense");case 19:return gu("SuspenseList");case 0:case 2:case 15:return e=Kv(e.type,!1),e;case 11:return e=Kv(e.type.render,!1),e;case 1:return e=Kv(e.type,!0),e;default:return""}}function ey(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 yl:return"Fragment";case vl:return"Portal";case q0:return"Profiler";case hw:return"StrictMode";case Q0:return"Suspense";case J0:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case j$:return(e.displayName||"Context")+".Consumer";case F$:return(e._context.displayName||"Context")+".Provider";case pw:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case mw:return t=e.displayName||null,t!==null?t:ey(e.type)||"Memo";case ns:t=e._payload,e=e._init;try{return ey(e(t))}catch{}}return null}function nD(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 ey(t);case 8:return t===hw?"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 As(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function z$(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function rD(e){var t=z$(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 o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function qf(e){e._valueTracker||(e._valueTracker=rD(e))}function U$(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=z$(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function up(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 ty(e,t){var n=t.checked;return jt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function q_(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=As(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 V$(e,t){t=t.checked,t!=null&&fw(e,"checked",t,!1)}function ny(e,t){V$(e,t);var n=As(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")?ry(e,t.type,n):t.hasOwnProperty("defaultValue")&&ry(e,t.type,As(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Q_(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 ry(e,t,n){(t!=="number"||up(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var vu=Array.isArray;function kl(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+As(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function oy(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(de(91));return jt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function J_(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(de(92));if(vu(n)){if(1<n.length)throw Error(de(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:As(n)}}function W$(e,t){var n=As(t.value),r=As(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function eE(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function H$(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function iy(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?H$(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Qf,K$=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Qf=Qf||document.createElement("div"),Qf.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Qf.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ju(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Eu={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},oD=["Webkit","ms","Moz","O"];Object.keys(Eu).forEach(function(e){oD.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Eu[t]=Eu[e]})});function G$(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Eu.hasOwnProperty(e)&&Eu[e]?(""+t).trim():t+"px"}function Y$(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=G$(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var iD=jt({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 sy(e,t){if(t){if(iD[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(de(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(de(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(de(61))}if(t.style!=null&&typeof t.style!="object")throw Error(de(62))}}function ay(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 ly=null;function gw(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var cy=null,Al=null,Ml=null;function tE(e){if(e=Ad(e)){if(typeof cy!="function")throw Error(de(280));var t=e.stateNode;t&&(t=xm(t),cy(e.stateNode,e.type,t))}}function X$(e){Al?Ml?Ml.push(e):Ml=[e]:Al=e}function Z$(){if(Al){var e=Al,t=Ml;if(Ml=Al=null,tE(e),t)for(e=0;e<t.length;e++)tE(t[e])}}function q$(e,t){return e(t)}function Q$(){}var Gv=!1;function J$(e,t,n){if(Gv)return e(t,n);Gv=!0;try{return q$(e,t,n)}finally{Gv=!1,(Al!==null||Ml!==null)&&(Q$(),Z$())}}function Bu(e,t){var n=e.stateNode;if(n===null)return null;var r=xm(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(de(231,t,typeof n));return n}var uy=!1;if(_i)try{var eu={};Object.defineProperty(eu,"passive",{get:function(){uy=!0}}),window.addEventListener("test",eu,eu),window.removeEventListener("test",eu,eu)}catch{uy=!1}function sD(e,t,n,r,o,i,s,l,u){var f=Array.prototype.slice.call(arguments,3);try{t.apply(n,f)}catch(m){this.onError(m)}}var Cu=!1,dp=null,fp=!1,dy=null,aD={onError:function(e){Cu=!0,dp=e}};function lD(e,t,n,r,o,i,s,l,u){Cu=!1,dp=null,sD.apply(aD,arguments)}function cD(e,t,n,r,o,i,s,l,u){if(lD.apply(this,arguments),Cu){if(Cu){var f=dp;Cu=!1,dp=null}else throw Error(de(198));fp||(fp=!0,dy=f)}}function ja(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function e5(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function nE(e){if(ja(e)!==e)throw Error(de(188))}function uD(e){var t=e.alternate;if(!t){if(t=ja(e),t===null)throw Error(de(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var i=o.alternate;if(i===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return nE(o),e;if(i===r)return nE(o),t;i=i.sibling}throw Error(de(188))}if(n.return!==r.return)n=o,r=i;else{for(var s=!1,l=o.child;l;){if(l===n){s=!0,n=o,r=i;break}if(l===r){s=!0,r=o,n=i;break}l=l.sibling}if(!s){for(l=i.child;l;){if(l===n){s=!0,n=i,r=o;break}if(l===r){s=!0,r=i,n=o;break}l=l.sibling}if(!s)throw Error(de(189))}}if(n.alternate!==r)throw Error(de(190))}if(n.tag!==3)throw Error(de(188));return n.stateNode.current===n?e:t}function t5(e){return e=uD(e),e!==null?n5(e):null}function n5(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=n5(e);if(t!==null)return t;e=e.sibling}return null}var r5=wr.unstable_scheduleCallback,rE=wr.unstable_cancelCallback,dD=wr.unstable_shouldYield,fD=wr.unstable_requestPaint,Gt=wr.unstable_now,hD=wr.unstable_getCurrentPriorityLevel,vw=wr.unstable_ImmediatePriority,o5=wr.unstable_UserBlockingPriority,hp=wr.unstable_NormalPriority,pD=wr.unstable_LowPriority,i5=wr.unstable_IdlePriority,gm=null,Go=null;function mD(e){if(Go&&typeof Go.onCommitFiberRoot=="function")try{Go.onCommitFiberRoot(gm,e,void 0,(e.current.flags&128)===128)}catch{}}var bo=Math.clz32?Math.clz32:yD,gD=Math.log,vD=Math.LN2;function yD(e){return e>>>=0,e===0?32:31-(gD(e)/vD|0)|0}var Jf=64,eh=4194304;function yu(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 pp(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var l=s&~o;l!==0?r=yu(l):(i&=s,i!==0&&(r=yu(i)))}else s=n&~o,s!==0?r=yu(s):i!==0&&(r=yu(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-bo(t),o=1<<n,r|=e[n],t&=~o;return r}function wD(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function xD(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-bo(i),l=1<<s,u=o[s];u===-1?(!(l&n)||l&r)&&(o[s]=wD(l,t)):u<=t&&(e.expiredLanes|=l),i&=~l}}function fy(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function s5(){var e=Jf;return Jf<<=1,!(Jf&4194240)&&(Jf=64),e}function Yv(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Td(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-bo(t),e[t]=n}function bD(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<n;){var o=31-bo(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function yw(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-bo(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var bt=0;function a5(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var l5,ww,c5,u5,d5,hy=!1,th=[],xs=null,bs=null,Ss=null,zu=new Map,Uu=new Map,os=[],SD="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function oE(e,t){switch(e){case"focusin":case"focusout":xs=null;break;case"dragenter":case"dragleave":bs=null;break;case"mouseover":case"mouseout":Ss=null;break;case"pointerover":case"pointerout":zu.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Uu.delete(t.pointerId)}}function tu(e,t,n,r,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},t!==null&&(t=Ad(t),t!==null&&ww(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function _D(e,t,n,r,o){switch(t){case"focusin":return xs=tu(xs,e,t,n,r,o),!0;case"dragenter":return bs=tu(bs,e,t,n,r,o),!0;case"mouseover":return Ss=tu(Ss,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return zu.set(i,tu(zu.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,Uu.set(i,tu(Uu.get(i)||null,e,t,n,r,o)),!0}return!1}function f5(e){var t=fa(e.target);if(t!==null){var n=ja(t);if(n!==null){if(t=n.tag,t===13){if(t=e5(n),t!==null){e.blockedOn=t,d5(e.priority,function(){c5(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Dh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=py(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);ly=r,n.target.dispatchEvent(r),ly=null}else return t=Ad(n),t!==null&&ww(t),e.blockedOn=n,!1;t.shift()}return!0}function iE(e,t,n){Dh(e)&&n.delete(t)}function ED(){hy=!1,xs!==null&&Dh(xs)&&(xs=null),bs!==null&&Dh(bs)&&(bs=null),Ss!==null&&Dh(Ss)&&(Ss=null),zu.forEach(iE),Uu.forEach(iE)}function nu(e,t){e.blockedOn===t&&(e.blockedOn=null,hy||(hy=!0,wr.unstable_scheduleCallback(wr.unstable_NormalPriority,ED)))}function Vu(e){function t(o){return nu(o,e)}if(0<th.length){nu(th[0],e);for(var n=1;n<th.length;n++){var r=th[n];r.blockedOn===e&&(r.blockedOn=null)}}for(xs!==null&&nu(xs,e),bs!==null&&nu(bs,e),Ss!==null&&nu(Ss,e),zu.forEach(t),Uu.forEach(t),n=0;n<os.length;n++)r=os[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<os.length&&(n=os[0],n.blockedOn===null);)f5(n),n.blockedOn===null&&os.shift()}var Ol=Oi.ReactCurrentBatchConfig,mp=!0;function CD(e,t,n,r){var o=bt,i=Ol.transition;Ol.transition=null;try{bt=1,xw(e,t,n,r)}finally{bt=o,Ol.transition=i}}function $D(e,t,n,r){var o=bt,i=Ol.transition;Ol.transition=null;try{bt=4,xw(e,t,n,r)}finally{bt=o,Ol.transition=i}}function xw(e,t,n,r){if(mp){var o=py(e,t,n,r);if(o===null)o0(e,t,r,gp,n),oE(e,r);else if(_D(o,e,t,n,r))r.stopPropagation();else if(oE(e,r),t&4&&-1<SD.indexOf(e)){for(;o!==null;){var i=Ad(o);if(i!==null&&l5(i),i=py(e,t,n,r),i===null&&o0(e,t,r,gp,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else o0(e,t,r,null,n)}}var gp=null;function py(e,t,n,r){if(gp=null,e=gw(r),e=fa(e),e!==null)if(t=ja(e),t===null)e=null;else if(n=t.tag,n===13){if(e=e5(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return gp=e,null}function h5(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(hD()){case vw:return 1;case o5:return 4;case hp:case pD:return 16;case i5:return 536870912;default:return 16}default:return 16}}var hs=null,bw=null,Ih=null;function p5(){if(Ih)return Ih;var e,t=bw,n=t.length,r,o="value"in hs?hs.value:hs.textContent,i=o.length;for(e=0;e<n&&t[e]===o[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===o[i-r];r++);return Ih=o.slice(e,1<r?1-r:void 0)}function Lh(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function nh(){return!0}function sE(){return!1}function _r(e){function t(n,r,o,i,s){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?nh:sE,this.isPropagationStopped=sE,this}return jt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=nh)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=nh)},persist:function(){},isPersistent:nh}),t}var bc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sw=_r(bc),kd=jt({},bc,{view:0,detail:0}),RD=_r(kd),Xv,Zv,ru,vm=jt({},kd,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:_w,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ru&&(ru&&e.type==="mousemove"?(Xv=e.screenX-ru.screenX,Zv=e.screenY-ru.screenY):Zv=Xv=0,ru=e),Xv)},movementY:function(e){return"movementY"in e?e.movementY:Zv}}),aE=_r(vm),PD=jt({},vm,{dataTransfer:0}),TD=_r(PD),kD=jt({},kd,{relatedTarget:0}),qv=_r(kD),AD=jt({},bc,{animationName:0,elapsedTime:0,pseudoElement:0}),MD=_r(AD),OD=jt({},bc,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ND=_r(OD),DD=jt({},bc,{data:0}),lE=_r(DD),ID={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},LD={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},FD={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function jD(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=FD[e])?!!t[e]:!1}function _w(){return jD}var BD=jt({},kd,{key:function(e){if(e.key){var t=ID[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Lh(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?LD[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:_w,charCode:function(e){return e.type==="keypress"?Lh(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Lh(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),zD=_r(BD),UD=jt({},vm,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),cE=_r(UD),VD=jt({},kd,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:_w}),WD=_r(VD),HD=jt({},bc,{propertyName:0,elapsedTime:0,pseudoElement:0}),KD=_r(HD),GD=jt({},vm,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),YD=_r(GD),XD=[9,13,27,32],Ew=_i&&"CompositionEvent"in window,$u=null;_i&&"documentMode"in document&&($u=document.documentMode);var ZD=_i&&"TextEvent"in window&&!$u,m5=_i&&(!Ew||$u&&8<$u&&11>=$u),uE=" ",dE=!1;function g5(e,t){switch(e){case"keyup":return XD.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function v5(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var wl=!1;function qD(e,t){switch(e){case"compositionend":return v5(t);case"keypress":return t.which!==32?null:(dE=!0,uE);case"textInput":return e=t.data,e===uE&&dE?null:e;default:return null}}function QD(e,t){if(wl)return e==="compositionend"||!Ew&&g5(e,t)?(e=p5(),Ih=bw=hs=null,wl=!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.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return m5&&t.locale!=="ko"?null:t.data;default:return null}}var JD={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 fE(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!JD[e.type]:t==="textarea"}function y5(e,t,n,r){X$(r),t=vp(t,"onChange"),0<t.length&&(n=new Sw("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Ru=null,Wu=null;function eI(e){T5(e,0)}function ym(e){var t=Sl(e);if(U$(t))return e}function tI(e,t){if(e==="change")return t}var w5=!1;if(_i){var Qv;if(_i){var Jv="oninput"in document;if(!Jv){var hE=document.createElement("div");hE.setAttribute("oninput","return;"),Jv=typeof hE.oninput=="function"}Qv=Jv}else Qv=!1;w5=Qv&&(!document.documentMode||9<document.documentMode)}function pE(){Ru&&(Ru.detachEvent("onpropertychange",x5),Wu=Ru=null)}function x5(e){if(e.propertyName==="value"&&ym(Wu)){var t=[];y5(t,Wu,e,gw(e)),J$(eI,t)}}function nI(e,t,n){e==="focusin"?(pE(),Ru=t,Wu=n,Ru.attachEvent("onpropertychange",x5)):e==="focusout"&&pE()}function rI(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ym(Wu)}function oI(e,t){if(e==="click")return ym(t)}function iI(e,t){if(e==="input"||e==="change")return ym(t)}function sI(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Eo=typeof Object.is=="function"?Object.is:sI;function Hu(e,t){if(Eo(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!Z0.call(t,o)||!Eo(e[o],t[o]))return!1}return!0}function mE(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function gE(e,t){var n=mE(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=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=mE(n)}}function b5(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?b5(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function S5(){for(var e=window,t=up();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=up(e.document)}return t}function Cw(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 aI(e){var t=S5(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&b5(n.ownerDocument.documentElement,n)){if(r!==null&&Cw(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 o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=gE(n,i);var s=gE(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.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<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var lI=_i&&"documentMode"in document&&11>=document.documentMode,xl=null,my=null,Pu=null,gy=!1;function vE(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;gy||xl==null||xl!==up(r)||(r=xl,"selectionStart"in r&&Cw(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}),Pu&&Hu(Pu,r)||(Pu=r,r=vp(my,"onSelect"),0<r.length&&(t=new Sw("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=xl)))}function rh(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var bl={animationend:rh("Animation","AnimationEnd"),animationiteration:rh("Animation","AnimationIteration"),animationstart:rh("Animation","AnimationStart"),transitionend:rh("Transition","TransitionEnd")},e0={},_5={};_i&&(_5=document.createElement("div").style,"AnimationEvent"in window||(delete bl.animationend.animation,delete bl.animationiteration.animation,delete bl.animationstart.animation),"TransitionEvent"in window||delete bl.transitionend.transition);function wm(e){if(e0[e])return e0[e];if(!bl[e])return e;var t=bl[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in _5)return e0[e]=t[n];return e}var E5=wm("animationend"),C5=wm("animationiteration"),$5=wm("animationstart"),R5=wm("transitionend"),P5=new Map,yE="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 Ls(e,t){P5.set(e,t),Fa(t,[e])}for(var t0=0;t0<yE.length;t0++){var n0=yE[t0],cI=n0.toLowerCase(),uI=n0[0].toUpperCase()+n0.slice(1);Ls(cI,"on"+uI)}Ls(E5,"onAnimationEnd");Ls(C5,"onAnimationIteration");Ls($5,"onAnimationStart");Ls("dblclick","onDoubleClick");Ls("focusin","onFocus");Ls("focusout","onBlur");Ls(R5,"onTransitionEnd");Jl("onMouseEnter",["mouseout","mouseover"]);Jl("onMouseLeave",["mouseout","mouseover"]);Jl("onPointerEnter",["pointerout","pointerover"]);Jl("onPointerLeave",["pointerout","pointerover"]);Fa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Fa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Fa("onBeforeInput",["compositionend","keypress","textInput","paste"]);Fa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Fa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Fa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var wu="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),dI=new Set("cancel close invalid load scroll toggle".split(" ").concat(wu));function wE(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,cD(r,t,void 0,e),e.currentTarget=null}function T5(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var s=r.length-1;0<=s;s--){var l=r[s],u=l.instance,f=l.currentTarget;if(l=l.listener,u!==i&&o.isPropagationStopped())break e;wE(o,l,f),i=u}else for(s=0;s<r.length;s++){if(l=r[s],u=l.instance,f=l.currentTarget,l=l.listener,u!==i&&o.isPropagationStopped())break e;wE(o,l,f),i=u}}}if(fp)throw e=dy,fp=!1,dy=null,e}function kt(e,t){var n=t[by];n===void 0&&(n=t[by]=new Set);var r=e+"__bubble";n.has(r)||(k5(t,e,2,!1),n.add(r))}function r0(e,t,n){var r=0;t&&(r|=4),k5(n,e,r,t)}var oh="_reactListening"+Math.random().toString(36).slice(2);function Ku(e){if(!e[oh]){e[oh]=!0,L$.forEach(function(n){n!=="selectionchange"&&(dI.has(n)||r0(n,!1,e),r0(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[oh]||(t[oh]=!0,r0("selectionchange",!1,t))}}function k5(e,t,n,r){switch(h5(t)){case 1:var o=CD;break;case 4:o=$D;break;default:o=xw}n=o.bind(null,t,n,e),o=void 0,!uy||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function o0(e,t,n,r,o){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var l=r.stateNode.containerInfo;if(l===o||l.nodeType===8&&l.parentNode===o)break;if(s===4)for(s=r.return;s!==null;){var u=s.tag;if((u===3||u===4)&&(u=s.stateNode.containerInfo,u===o||u.nodeType===8&&u.parentNode===o))return;s=s.return}for(;l!==null;){if(s=fa(l),s===null)return;if(u=s.tag,u===5||u===6){r=i=s;continue e}l=l.parentNode}}r=r.return}J$(function(){var f=i,m=gw(n),p=[];e:{var g=P5.get(e);if(g!==void 0){var y=Sw,x=e;switch(e){case"keypress":if(Lh(n)===0)break e;case"keydown":case"keyup":y=zD;break;case"focusin":x="focus",y=qv;break;case"focusout":x="blur",y=qv;break;case"beforeblur":case"afterblur":y=qv;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":y=aE;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":y=TD;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":y=WD;break;case E5:case C5:case $5:y=MD;break;case R5:y=KD;break;case"scroll":y=RD;break;case"wheel":y=YD;break;case"copy":case"cut":case"paste":y=ND;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":y=cE}var S=(t&4)!==0,E=!S&&e==="scroll",_=S?g!==null?g+"Capture":null:g;S=[];for(var b=f,C;b!==null;){C=b;var R=C.stateNode;if(C.tag===5&&R!==null&&(C=R,_!==null&&(R=Bu(b,_),R!=null&&S.push(Gu(b,R,C)))),E)break;b=b.return}0<S.length&&(g=new y(g,x,null,n,m),p.push({event:g,listeners:S}))}}if(!(t&7)){e:{if(g=e==="mouseover"||e==="pointerover",y=e==="mouseout"||e==="pointerout",g&&n!==ly&&(x=n.relatedTarget||n.fromElement)&&(fa(x)||x[Ei]))break e;if((y||g)&&(g=m.window===m?m:(g=m.ownerDocument)?g.defaultView||g.parentWindow:window,y?(x=n.relatedTarget||n.toElement,y=f,x=x?fa(x):null,x!==null&&(E=ja(x),x!==E||x.tag!==5&&x.tag!==6)&&(x=null)):(y=null,x=f),y!==x)){if(S=aE,R="onMouseLeave",_="onMouseEnter",b="mouse",(e==="pointerout"||e==="pointerover")&&(S=cE,R="onPointerLeave",_="onPointerEnter",b="pointer"),E=y==null?g:Sl(y),C=x==null?g:Sl(x),g=new S(R,b+"leave",y,n,m),g.target=E,g.relatedTarget=C,R=null,fa(m)===f&&(S=new S(_,b+"enter",x,n,m),S.target=C,S.relatedTarget=E,R=S),E=R,y&&x)t:{for(S=y,_=x,b=0,C=S;C;C=il(C))b++;for(C=0,R=_;R;R=il(R))C++;for(;0<b-C;)S=il(S),b--;for(;0<C-b;)_=il(_),C--;for(;b--;){if(S===_||_!==null&&S===_.alternate)break t;S=il(S),_=il(_)}S=null}else S=null;y!==null&&xE(p,g,y,S,!1),x!==null&&E!==null&&xE(p,E,x,S,!0)}}e:{if(g=f?Sl(f):window,y=g.nodeName&&g.nodeName.toLowerCase(),y==="select"||y==="input"&&g.type==="file")var k=tI;else if(fE(g))if(w5)k=iI;else{k=rI;var O=nI}else(y=g.nodeName)&&y.toLowerCase()==="input"&&(g.type==="checkbox"||g.type==="radio")&&(k=oI);if(k&&(k=k(e,f))){y5(p,k,n,m);break e}O&&O(e,g,f),e==="focusout"&&(O=g._wrapperState)&&O.controlled&&g.type==="number"&&ry(g,"number",g.value)}switch(O=f?Sl(f):window,e){case"focusin":(fE(O)||O.contentEditable==="true")&&(xl=O,my=f,Pu=null);break;case"focusout":Pu=my=xl=null;break;case"mousedown":gy=!0;break;case"contextmenu":case"mouseup":case"dragend":gy=!1,vE(p,n,m);break;case"selectionchange":if(lI)break;case"keydown":case"keyup":vE(p,n,m)}var A;if(Ew)e:{switch(e){case"compositionstart":var I="onCompositionStart";break e;case"compositionend":I="onCompositionEnd";break e;case"compositionupdate":I="onCompositionUpdate";break e}I=void 0}else wl?g5(e,n)&&(I="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(I="onCompositionStart");I&&(m5&&n.locale!=="ko"&&(wl||I!=="onCompositionStart"?I==="onCompositionEnd"&&wl&&(A=p5()):(hs=m,bw="value"in hs?hs.value:hs.textContent,wl=!0)),O=vp(f,I),0<O.length&&(I=new lE(I,e,null,n,m),p.push({event:I,listeners:O}),A?I.data=A:(A=v5(n),A!==null&&(I.data=A)))),(A=ZD?qD(e,n):QD(e,n))&&(f=vp(f,"onBeforeInput"),0<f.length&&(m=new lE("onBeforeInput","beforeinput",null,n,m),p.push({event:m,listeners:f}),m.data=A))}T5(p,t)})}function Gu(e,t,n){return{instance:e,listener:t,currentTarget:n}}function vp(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=Bu(e,n),i!=null&&r.unshift(Gu(e,i,o)),i=Bu(e,t),i!=null&&r.push(Gu(e,i,o))),e=e.return}return r}function il(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function xE(e,t,n,r,o){for(var i=t._reactName,s=[];n!==null&&n!==r;){var l=n,u=l.alternate,f=l.stateNode;if(u!==null&&u===r)break;l.tag===5&&f!==null&&(l=f,o?(u=Bu(n,i),u!=null&&s.unshift(Gu(n,u,l))):o||(u=Bu(n,i),u!=null&&s.push(Gu(n,u,l)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var fI=/\r\n?/g,hI=/\u0000|\uFFFD/g;function bE(e){return(typeof e=="string"?e:""+e).replace(fI,`
`).replace(hI,"")}function ih(e,t,n){if(t=bE(t),bE(e)!==t&&n)throw Error(de(425))}function yp(){}var vy=null,yy=null;function wy(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var xy=typeof setTimeout=="function"?setTimeout:void 0,pI=typeof clearTimeout=="function"?clearTimeout:void 0,SE=typeof Promise=="function"?Promise:void 0,mI=typeof queueMicrotask=="function"?queueMicrotask:typeof SE<"u"?function(e){return SE.resolve(null).then(e).catch(gI)}:xy;function gI(e){setTimeout(function(){throw e})}function i0(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),Vu(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);Vu(t)}function _s(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function _E(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Sc=Math.random().toString(36).slice(2),jo="__reactFiber$"+Sc,Yu="__reactProps$"+Sc,Ei="__reactContainer$"+Sc,by="__reactEvents$"+Sc,vI="__reactListeners$"+Sc,yI="__reactHandles$"+Sc;function fa(e){var t=e[jo];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ei]||n[jo]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=_E(e);e!==null;){if(n=e[jo])return n;e=_E(e)}return t}e=n,n=e.parentNode}return null}function Ad(e){return e=e[jo]||e[Ei],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Sl(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(de(33))}function xm(e){return e[Yu]||null}var Sy=[],_l=-1;function Fs(e){return{current:e}}function At(e){0>_l||(e.current=Sy[_l],Sy[_l]=null,_l--)}function Rt(e,t){_l++,Sy[_l]=e.current,e.current=t}var Ms={},Rn=Fs(Ms),Qn=Fs(!1),Ta=Ms;function ec(e,t){var n=e.type.contextTypes;if(!n)return Ms;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Jn(e){return e=e.childContextTypes,e!=null}function wp(){At(Qn),At(Rn)}function EE(e,t,n){if(Rn.current!==Ms)throw Error(de(168));Rt(Rn,t),Rt(Qn,n)}function A5(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(de(108,nD(e)||"Unknown",o));return jt({},n,r)}function xp(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ms,Ta=Rn.current,Rt(Rn,e),Rt(Qn,Qn.current),!0}function CE(e,t,n){var r=e.stateNode;if(!r)throw Error(de(169));n?(e=A5(e,t,Ta),r.__reactInternalMemoizedMergedChildContext=e,At(Qn),At(Rn),Rt(Rn,e)):At(Qn),Rt(Qn,n)}var vi=null,bm=!1,s0=!1;function M5(e){vi===null?vi=[e]:vi.push(e)}function wI(e){bm=!0,M5(e)}function js(){if(!s0&&vi!==null){s0=!0;var e=0,t=bt;try{var n=vi;for(bt=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}vi=null,bm=!1}catch(o){throw vi!==null&&(vi=vi.slice(e+1)),r5(vw,js),o}finally{bt=t,s0=!1}}return null}var El=[],Cl=0,bp=null,Sp=0,Br=[],zr=0,ka=null,yi=1,wi="";function ra(e,t){El[Cl++]=Sp,El[Cl++]=bp,bp=e,Sp=t}function O5(e,t,n){Br[zr++]=yi,Br[zr++]=wi,Br[zr++]=ka,ka=e;var r=yi;e=wi;var o=32-bo(r)-1;r&=~(1<<o),n+=1;var i=32-bo(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,yi=1<<32-bo(t)+o|n<<o|r,wi=i+e}else yi=1<<i|n<<o|r,wi=e}function $w(e){e.return!==null&&(ra(e,1),O5(e,1,0))}function Rw(e){for(;e===bp;)bp=El[--Cl],El[Cl]=null,Sp=El[--Cl],El[Cl]=null;for(;e===ka;)ka=Br[--zr],Br[zr]=null,wi=Br[--zr],Br[zr]=null,yi=Br[--zr],Br[zr]=null}var vr=null,gr=null,Nt=!1,go=null;function N5(e,t){var n=Kr(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function $E(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,vr=e,gr=_s(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,vr=e,gr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=ka!==null?{id:yi,overflow:wi}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Kr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,vr=e,gr=null,!0):!1;default:return!1}}function _y(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Ey(e){if(Nt){var t=gr;if(t){var n=t;if(!$E(e,t)){if(_y(e))throw Error(de(418));t=_s(n.nextSibling);var r=vr;t&&$E(e,t)?N5(r,n):(e.flags=e.flags&-4097|2,Nt=!1,vr=e)}}else{if(_y(e))throw Error(de(418));e.flags=e.flags&-4097|2,Nt=!1,vr=e}}}function RE(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;vr=e}function sh(e){if(e!==vr)return!1;if(!Nt)return RE(e),Nt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!wy(e.type,e.memoizedProps)),t&&(t=gr)){if(_y(e))throw D5(),Error(de(418));for(;t;)N5(e,t),t=_s(t.nextSibling)}if(RE(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(de(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){gr=_s(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}gr=null}}else gr=vr?_s(e.stateNode.nextSibling):null;return!0}function D5(){for(var e=gr;e;)e=_s(e.nextSibling)}function tc(){gr=vr=null,Nt=!1}function Pw(e){go===null?go=[e]:go.push(e)}var xI=Oi.ReactCurrentBatchConfig;function co(e,t){if(e&&e.defaultProps){t=jt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}var _p=Fs(null),Ep=null,$l=null,Tw=null;function kw(){Tw=$l=Ep=null}function Aw(e){var t=_p.current;At(_p),e._currentValue=t}function Cy(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Nl(e,t){Ep=e,Tw=$l=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(qn=!0),e.firstContext=null)}function qr(e){var t=e._currentValue;if(Tw!==e)if(e={context:e,memoizedValue:t,next:null},$l===null){if(Ep===null)throw Error(de(308));$l=e,Ep.dependencies={lanes:0,firstContext:e}}else $l=$l.next=e;return t}var ha=null;function Mw(e){ha===null?ha=[e]:ha.push(e)}function I5(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Mw(t)):(n.next=o.next,o.next=n),t.interleaved=n,Ci(e,r)}function Ci(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var rs=!1;function Ow(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function L5(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function bi(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Es(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ft&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Ci(e,n)}return o=r.interleaved,o===null?(t.next=t,Mw(r)):(t.next=o.next,o.next=t),r.interleaved=t,Ci(e,n)}function Fh(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,yw(e,n)}}function PE(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Cp(e,t,n,r){var o=e.updateQueue;rs=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,l=o.shared.pending;if(l!==null){o.shared.pending=null;var u=l,f=u.next;u.next=null,s===null?i=f:s.next=f,s=u;var m=e.alternate;m!==null&&(m=m.updateQueue,l=m.lastBaseUpdate,l!==s&&(l===null?m.firstBaseUpdate=f:l.next=f,m.lastBaseUpdate=u))}if(i!==null){var p=o.baseState;s=0,m=f=u=null,l=i;do{var g=l.lane,y=l.eventTime;if((r&g)===g){m!==null&&(m=m.next={eventTime:y,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var x=e,S=l;switch(g=t,y=n,S.tag){case 1:if(x=S.payload,typeof x=="function"){p=x.call(y,p,g);break e}p=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=S.payload,g=typeof x=="function"?x.call(y,p,g):x,g==null)break e;p=jt({},p,g);break e;case 2:rs=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,g=o.effects,g===null?o.effects=[l]:g.push(l))}else y={eventTime:y,lane:g,tag:l.tag,payload:l.payload,callback:l.callback,next:null},m===null?(f=m=y,u=p):m=m.next=y,s|=g;if(l=l.next,l===null){if(l=o.shared.pending,l===null)break;g=l,l=g.next,g.next=null,o.lastBaseUpdate=g,o.shared.pending=null}}while(!0);if(m===null&&(u=p),o.baseState=u,o.firstBaseUpdate=f,o.lastBaseUpdate=m,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);Ma|=s,e.lanes=s,e.memoizedState=p}}function TE(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(de(191,o));o.call(r)}}}var F5=new I$.Component().refs;function $y(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:jt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Sm={isMounted:function(e){return(e=e._reactInternals)?ja(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=jn(),o=$s(e),i=bi(r,o);i.payload=t,n!=null&&(i.callback=n),t=Es(e,i,o),t!==null&&(So(t,e,o,r),Fh(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=jn(),o=$s(e),i=bi(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Es(e,i,o),t!==null&&(So(t,e,o,r),Fh(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=jn(),r=$s(e),o=bi(n,r);o.tag=2,t!=null&&(o.callback=t),t=Es(e,o,r),t!==null&&(So(t,e,r,n),Fh(t,e,r))}};function kE(e,t,n,r,o,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,s):t.prototype&&t.prototype.isPureReactComponent?!Hu(n,r)||!Hu(o,i):!0}function j5(e,t,n){var r=!1,o=Ms,i=t.contextType;return typeof i=="object"&&i!==null?i=qr(i):(o=Jn(t)?Ta:Rn.current,r=t.contextTypes,i=(r=r!=null)?ec(e,o):Ms),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Sm,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function AE(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Sm.enqueueReplaceState(t,t.state,null)}function Ry(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs=F5,Ow(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=qr(i):(i=Jn(t)?Ta:Rn.current,o.context=ec(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&($y(e,t,i,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&Sm.enqueueReplaceState(o,o.state,null),Cp(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function ou(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(de(309));var r=n.stateNode}if(!r)throw Error(de(147,e));var o=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(s){var l=o.refs;l===F5&&(l=o.refs={}),s===null?delete l[i]:l[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(de(284));if(!n._owner)throw Error(de(290,e))}return e}function ah(e,t){throw e=Object.prototype.toString.call(t),Error(de(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ME(e){var t=e._init;return t(e._payload)}function B5(e){function t(_,b){if(e){var C=_.deletions;C===null?(_.deletions=[b],_.flags|=16):C.push(b)}}function n(_,b){if(!e)return null;for(;b!==null;)t(_,b),b=b.sibling;return null}function r(_,b){for(_=new Map;b!==null;)b.key!==null?_.set(b.key,b):_.set(b.index,b),b=b.sibling;return _}function o(_,b){return _=Rs(_,b),_.index=0,_.sibling=null,_}function i(_,b,C){return _.index=C,e?(C=_.alternate,C!==null?(C=C.index,C<b?(_.flags|=2,b):C):(_.flags|=2,b)):(_.flags|=1048576,b)}function s(_){return e&&_.alternate===null&&(_.flags|=2),_}function l(_,b,C,R){return b===null||b.tag!==6?(b=h0(C,_.mode,R),b.return=_,b):(b=o(b,C),b.return=_,b)}function u(_,b,C,R){var k=C.type;return k===yl?m(_,b,C.props.children,R,C.key):b!==null&&(b.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===ns&&ME(k)===b.type)?(R=o(b,C.props),R.ref=ou(_,b,C),R.return=_,R):(R=Wh(C.type,C.key,C.props,null,_.mode,R),R.ref=ou(_,b,C),R.return=_,R)}function f(_,b,C,R){return b===null||b.tag!==4||b.stateNode.containerInfo!==C.containerInfo||b.stateNode.implementation!==C.implementation?(b=p0(C,_.mode,R),b.return=_,b):(b=o(b,C.children||[]),b.return=_,b)}function m(_,b,C,R,k){return b===null||b.tag!==7?(b=Pa(C,_.mode,R,k),b.return=_,b):(b=o(b,C),b.return=_,b)}function p(_,b,C){if(typeof b=="string"&&b!==""||typeof b=="number")return b=h0(""+b,_.mode,C),b.return=_,b;if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Zf:return C=Wh(b.type,b.key,b.props,null,_.mode,C),C.ref=ou(_,null,b),C.return=_,C;case vl:return b=p0(b,_.mode,C),b.return=_,b;case ns:var R=b._init;return p(_,R(b._payload),C)}if(vu(b)||Jc(b))return b=Pa(b,_.mode,C,null),b.return=_,b;ah(_,b)}return null}function g(_,b,C,R){var k=b!==null?b.key:null;if(typeof C=="string"&&C!==""||typeof C=="number")return k!==null?null:l(_,b,""+C,R);if(typeof C=="object"&&C!==null){switch(C.$$typeof){case Zf:return C.key===k?u(_,b,C,R):null;case vl:return C.key===k?f(_,b,C,R):null;case ns:return k=C._init,g(_,b,k(C._payload),R)}if(vu(C)||Jc(C))return k!==null?null:m(_,b,C,R,null);ah(_,C)}return null}function y(_,b,C,R,k){if(typeof R=="string"&&R!==""||typeof R=="number")return _=_.get(C)||null,l(b,_,""+R,k);if(typeof R=="object"&&R!==null){switch(R.$$typeof){case Zf:return _=_.get(R.key===null?C:R.key)||null,u(b,_,R,k);case vl:return _=_.get(R.key===null?C:R.key)||null,f(b,_,R,k);case ns:var O=R._init;return y(_,b,C,O(R._payload),k)}if(vu(R)||Jc(R))return _=_.get(C)||null,m(b,_,R,k,null);ah(b,R)}return null}function x(_,b,C,R){for(var k=null,O=null,A=b,I=b=0,z=null;A!==null&&I<C.length;I++){A.index>I?(z=A,A=null):z=A.sibling;var H=g(_,A,C[I],R);if(H===null){A===null&&(A=z);break}e&&A&&H.alternate===null&&t(_,A),b=i(H,b,I),O===null?k=H:O.sibling=H,O=H,A=z}if(I===C.length)return n(_,A),Nt&&ra(_,I),k;if(A===null){for(;I<C.length;I++)A=p(_,C[I],R),A!==null&&(b=i(A,b,I),O===null?k=A:O.sibling=A,O=A);return Nt&&ra(_,I),k}for(A=r(_,A);I<C.length;I++)z=y(A,_,I,C[I],R),z!==null&&(e&&z.alternate!==null&&A.delete(z.key===null?I:z.key),b=i(z,b,I),O===null?k=z:O.sibling=z,O=z);return e&&A.forEach(function(ie){return t(_,ie)}),Nt&&ra(_,I),k}function S(_,b,C,R){var k=Jc(C);if(typeof k!="function")throw Error(de(150));if(C=k.call(C),C==null)throw Error(de(151));for(var O=k=null,A=b,I=b=0,z=null,H=C.next();A!==null&&!H.done;I++,H=C.next()){A.index>I?(z=A,A=null):z=A.sibling;var ie=g(_,A,H.value,R);if(ie===null){A===null&&(A=z);break}e&&A&&ie.alternate===null&&t(_,A),b=i(ie,b,I),O===null?k=ie:O.sibling=ie,O=ie,A=z}if(H.done)return n(_,A),Nt&&ra(_,I),k;if(A===null){for(;!H.done;I++,H=C.next())H=p(_,H.value,R),H!==null&&(b=i(H,b,I),O===null?k=H:O.sibling=H,O=H);return Nt&&ra(_,I),k}for(A=r(_,A);!H.done;I++,H=C.next())H=y(A,_,I,H.value,R),H!==null&&(e&&H.alternate!==null&&A.delete(H.key===null?I:H.key),b=i(H,b,I),O===null?k=H:O.sibling=H,O=H);return e&&A.forEach(function(K){return t(_,K)}),Nt&&ra(_,I),k}function E(_,b,C,R){if(typeof C=="object"&&C!==null&&C.type===yl&&C.key===null&&(C=C.props.children),typeof C=="object"&&C!==null){switch(C.$$typeof){case Zf:e:{for(var k=C.key,O=b;O!==null;){if(O.key===k){if(k=C.type,k===yl){if(O.tag===7){n(_,O.sibling),b=o(O,C.props.children),b.return=_,_=b;break e}}else if(O.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===ns&&ME(k)===O.type){n(_,O.sibling),b=o(O,C.props),b.ref=ou(_,O,C),b.return=_,_=b;break e}n(_,O);break}else t(_,O);O=O.sibling}C.type===yl?(b=Pa(C.props.children,_.mode,R,C.key),b.return=_,_=b):(R=Wh(C.type,C.key,C.props,null,_.mode,R),R.ref=ou(_,b,C),R.return=_,_=R)}return s(_);case vl:e:{for(O=C.key;b!==null;){if(b.key===O)if(b.tag===4&&b.stateNode.containerInfo===C.containerInfo&&b.stateNode.implementation===C.implementation){n(_,b.sibling),b=o(b,C.children||[]),b.return=_,_=b;break e}else{n(_,b);break}else t(_,b);b=b.sibling}b=p0(C,_.mode,R),b.return=_,_=b}return s(_);case ns:return O=C._init,E(_,b,O(C._payload),R)}if(vu(C))return x(_,b,C,R);if(Jc(C))return S(_,b,C,R);ah(_,C)}return typeof C=="string"&&C!==""||typeof C=="number"?(C=""+C,b!==null&&b.tag===6?(n(_,b.sibling),b=o(b,C),b.return=_,_=b):(n(_,b),b=h0(C,_.mode,R),b.return=_,_=b),s(_)):n(_,b)}return E}var nc=B5(!0),z5=B5(!1),Md={},Yo=Fs(Md),Xu=Fs(Md),Zu=Fs(Md);function pa(e){if(e===Md)throw Error(de(174));return e}function Nw(e,t){switch(Rt(Zu,t),Rt(Xu,e),Rt(Yo,Md),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:iy(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=iy(t,e)}At(Yo),Rt(Yo,t)}function rc(){At(Yo),At(Xu),At(Zu)}function U5(e){pa(Zu.current);var t=pa(Yo.current),n=iy(t,e.type);t!==n&&(Rt(Xu,e),Rt(Yo,n))}function Dw(e){Xu.current===e&&(At(Yo),At(Xu))}var It=Fs(0);function $p(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 a0=[];function Iw(){for(var e=0;e<a0.length;e++)a0[e]._workInProgressVersionPrimary=null;a0.length=0}var jh=Oi.ReactCurrentDispatcher,l0=Oi.ReactCurrentBatchConfig,Aa=0,Ft=null,rn=null,un=null,Rp=!1,Tu=!1,qu=0,bI=0;function _n(){throw Error(de(321))}function Lw(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Eo(e[n],t[n]))return!1;return!0}function Fw(e,t,n,r,o,i){if(Aa=i,Ft=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,jh.current=e===null||e.memoizedState===null?CI:$I,e=n(r,o),Tu){i=0;do{if(Tu=!1,qu=0,25<=i)throw Error(de(301));i+=1,un=rn=null,t.updateQueue=null,jh.current=RI,e=n(r,o)}while(Tu)}if(jh.current=Pp,t=rn!==null&&rn.next!==null,Aa=0,un=rn=Ft=null,Rp=!1,t)throw Error(de(300));return e}function jw(){var e=qu!==0;return qu=0,e}function Mo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return un===null?Ft.memoizedState=un=e:un=un.next=e,un}function Qr(){if(rn===null){var e=Ft.alternate;e=e!==null?e.memoizedState:null}else e=rn.next;var t=un===null?Ft.memoizedState:un.next;if(t!==null)un=t,rn=e;else{if(e===null)throw Error(de(310));rn=e,e={memoizedState:rn.memoizedState,baseState:rn.baseState,baseQueue:rn.baseQueue,queue:rn.queue,next:null},un===null?Ft.memoizedState=un=e:un=un.next=e}return un}function Qu(e,t){return typeof t=="function"?t(e):t}function c0(e){var t=Qr(),n=t.queue;if(n===null)throw Error(de(311));n.lastRenderedReducer=e;var r=rn,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var s=o.next;o.next=i.next,i.next=s}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var l=s=null,u=null,f=i;do{var m=f.lane;if((Aa&m)===m)u!==null&&(u=u.next={lane:0,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null}),r=f.hasEagerState?f.eagerState:e(r,f.action);else{var p={lane:m,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null};u===null?(l=u=p,s=r):u=u.next=p,Ft.lanes|=m,Ma|=m}f=f.next}while(f!==null&&f!==i);u===null?s=r:u.next=l,Eo(r,t.memoizedState)||(qn=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=u,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,Ft.lanes|=i,Ma|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function u0(e){var t=Qr(),n=t.queue;if(n===null)throw Error(de(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var s=o=o.next;do i=e(i,s.action),s=s.next;while(s!==o);Eo(i,t.memoizedState)||(qn=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function V5(){}function W5(e,t){var n=Ft,r=Qr(),o=t(),i=!Eo(r.memoizedState,o);if(i&&(r.memoizedState=o,qn=!0),r=r.queue,Bw(G5.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||un!==null&&un.memoizedState.tag&1){if(n.flags|=2048,Ju(9,K5.bind(null,n,r,o,t),void 0,null),dn===null)throw Error(de(349));Aa&30||H5(n,t,o)}return o}function H5(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ft.updateQueue,t===null?(t={lastEffect:null,stores:null},Ft.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function K5(e,t,n,r){t.value=n,t.getSnapshot=r,Y5(t)&&X5(e)}function G5(e,t,n){return n(function(){Y5(t)&&X5(e)})}function Y5(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Eo(e,n)}catch{return!0}}function X5(e){var t=Ci(e,1);t!==null&&So(t,e,1,-1)}function OE(e){var t=Mo();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Qu,lastRenderedState:e},t.queue=e,e=e.dispatch=EI.bind(null,Ft,e),[t.memoizedState,e]}function Ju(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ft.updateQueue,t===null?(t={lastEffect:null,stores:null},Ft.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Z5(){return Qr().memoizedState}function Bh(e,t,n,r){var o=Mo();Ft.flags|=e,o.memoizedState=Ju(1|t,n,void 0,r===void 0?null:r)}function _m(e,t,n,r){var o=Qr();r=r===void 0?null:r;var i=void 0;if(rn!==null){var s=rn.memoizedState;if(i=s.destroy,r!==null&&Lw(r,s.deps)){o.memoizedState=Ju(t,n,i,r);return}}Ft.flags|=e,o.memoizedState=Ju(1|t,n,i,r)}function NE(e,t){return Bh(8390656,8,e,t)}function Bw(e,t){return _m(2048,8,e,t)}function q5(e,t){return _m(4,2,e,t)}function Q5(e,t){return _m(4,4,e,t)}function J5(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function eR(e,t,n){return n=n!=null?n.concat([e]):null,_m(4,4,J5.bind(null,t,e),n)}function zw(){}function tR(e,t){var n=Qr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Lw(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function nR(e,t){var n=Qr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Lw(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function rR(e,t,n){return Aa&21?(Eo(n,t)||(n=s5(),Ft.lanes|=n,Ma|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,qn=!0),e.memoizedState=n)}function SI(e,t){var n=bt;bt=n!==0&&4>n?n:4,e(!0);var r=l0.transition;l0.transition={};try{e(!1),t()}finally{bt=n,l0.transition=r}}function oR(){return Qr().memoizedState}function _I(e,t,n){var r=$s(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},iR(e))sR(t,n);else if(n=I5(e,t,n,r),n!==null){var o=jn();So(n,e,r,o),aR(n,t,r)}}function EI(e,t,n){var r=$s(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(iR(e))sR(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,l=i(s,n);if(o.hasEagerState=!0,o.eagerState=l,Eo(l,s)){var u=t.interleaved;u===null?(o.next=o,Mw(t)):(o.next=u.next,u.next=o),t.interleaved=o;return}}catch{}finally{}n=I5(e,t,o,r),n!==null&&(o=jn(),So(n,e,r,o),aR(n,t,r))}}function iR(e){var t=e.alternate;return e===Ft||t!==null&&t===Ft}function sR(e,t){Tu=Rp=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function aR(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,yw(e,n)}}var Pp={readContext:qr,useCallback:_n,useContext:_n,useEffect:_n,useImperativeHandle:_n,useInsertionEffect:_n,useLayoutEffect:_n,useMemo:_n,useReducer:_n,useRef:_n,useState:_n,useDebugValue:_n,useDeferredValue:_n,useTransition:_n,useMutableSource:_n,useSyncExternalStore:_n,useId:_n,unstable_isNewReconciler:!1},CI={readContext:qr,useCallback:function(e,t){return Mo().memoizedState=[e,t===void 0?null:t],e},useContext:qr,useEffect:NE,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Bh(4194308,4,J5.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Bh(4194308,4,e,t)},useInsertionEffect:function(e,t){return Bh(4,2,e,t)},useMemo:function(e,t){var n=Mo();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Mo();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=_I.bind(null,Ft,e),[r.memoizedState,e]},useRef:function(e){var t=Mo();return e={current:e},t.memoizedState=e},useState:OE,useDebugValue:zw,useDeferredValue:function(e){return Mo().memoizedState=e},useTransition:function(){var e=OE(!1),t=e[0];return e=SI.bind(null,e[1]),Mo().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ft,o=Mo();if(Nt){if(n===void 0)throw Error(de(407));n=n()}else{if(n=t(),dn===null)throw Error(de(349));Aa&30||H5(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,NE(G5.bind(null,r,i,e),[e]),r.flags|=2048,Ju(9,K5.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Mo(),t=dn.identifierPrefix;if(Nt){var n=wi,r=yi;n=(r&~(1<<32-bo(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=qu++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=bI++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},$I={readContext:qr,useCallback:tR,useContext:qr,useEffect:Bw,useImperativeHandle:eR,useInsertionEffect:q5,useLayoutEffect:Q5,useMemo:nR,useReducer:c0,useRef:Z5,useState:function(){return c0(Qu)},useDebugValue:zw,useDeferredValue:function(e){var t=Qr();return rR(t,rn.memoizedState,e)},useTransition:function(){var e=c0(Qu)[0],t=Qr().memoizedState;return[e,t]},useMutableSource:V5,useSyncExternalStore:W5,useId:oR,unstable_isNewReconciler:!1},RI={readContext:qr,useCallback:tR,useContext:qr,useEffect:Bw,useImperativeHandle:eR,useInsertionEffect:q5,useLayoutEffect:Q5,useMemo:nR,useReducer:u0,useRef:Z5,useState:function(){return u0(Qu)},useDebugValue:zw,useDeferredValue:function(e){var t=Qr();return rn===null?t.memoizedState=e:rR(t,rn.memoizedState,e)},useTransition:function(){var e=u0(Qu)[0],t=Qr().memoizedState;return[e,t]},useMutableSource:V5,useSyncExternalStore:W5,useId:oR,unstable_isNewReconciler:!1};function oc(e,t){try{var n="",r=t;do n+=tD(r),r=r.return;while(r);var o=n}catch(i){o=`
Error generating stack: `+i.message+`
`+i.stack}return{value:e,source:t,stack:o,digest:null}}function d0(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Py(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var PI=typeof WeakMap=="function"?WeakMap:Map;function lR(e,t,n){n=bi(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){kp||(kp=!0,Fy=r),Py(e,t)},n}function cR(e,t,n){n=bi(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){Py(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Py(e,t),typeof r!="function"&&(Cs===null?Cs=new Set([this]):Cs.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function DE(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new PI;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=UI.bind(null,e,t,n),t.then(e,e))}function IE(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function LE(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=bi(-1,1),t.tag=2,Es(n,t,1))),n.lanes|=1),e)}var TI=Oi.ReactCurrentOwner,qn=!1;function In(e,t,n,r){t.child=e===null?z5(t,null,n,r):nc(t,e.child,n,r)}function FE(e,t,n,r,o){n=n.render;var i=t.ref;return Nl(t,o),r=Fw(e,t,n,r,i,o),n=jw(),e!==null&&!qn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,$i(e,t,o)):(Nt&&n&&$w(t),t.flags|=1,In(e,t,r,o),t.child)}function jE(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!Xw(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,uR(e,t,i,r,o)):(e=Wh(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:Hu,n(s,r)&&e.ref===t.ref)return $i(e,t,o)}return t.flags|=1,e=Rs(i,r),e.ref=t.ref,e.return=t,t.child=e}function uR(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(Hu(i,r)&&e.ref===t.ref)if(qn=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(qn=!0);else return t.lanes=e.lanes,$i(e,t,o)}return Ty(e,t,n,r,o)}function dR(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Rt(Pl,hr),hr|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Rt(Pl,hr),hr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,Rt(Pl,hr),hr|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,Rt(Pl,hr),hr|=r;return In(e,t,o,n),t.child}function fR(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ty(e,t,n,r,o){var i=Jn(n)?Ta:Rn.current;return i=ec(t,i),Nl(t,o),n=Fw(e,t,n,r,i,o),r=jw(),e!==null&&!qn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,$i(e,t,o)):(Nt&&r&&$w(t),t.flags|=1,In(e,t,n,o),t.child)}function BE(e,t,n,r,o){if(Jn(n)){var i=!0;xp(t)}else i=!1;if(Nl(t,o),t.stateNode===null)zh(e,t),j5(t,n,r),Ry(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,l=t.memoizedProps;s.props=l;var u=s.context,f=n.contextType;typeof f=="object"&&f!==null?f=qr(f):(f=Jn(n)?Ta:Rn.current,f=ec(t,f));var m=n.getDerivedStateFromProps,p=typeof m=="function"||typeof s.getSnapshotBeforeUpdate=="function";p||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==r||u!==f)&&AE(t,s,r,f),rs=!1;var g=t.memoizedState;s.state=g,Cp(t,r,s,o),u=t.memoizedState,l!==r||g!==u||Qn.current||rs?(typeof m=="function"&&($y(t,n,m,r),u=t.memoizedState),(l=rs||kE(t,n,l,r,g,u,f))?(p||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),s.props=r,s.state=u,s.context=f,r=l):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,L5(e,t),l=t.memoizedProps,f=t.type===t.elementType?l:co(t.type,l),s.props=f,p=t.pendingProps,g=s.context,u=n.contextType,typeof u=="object"&&u!==null?u=qr(u):(u=Jn(n)?Ta:Rn.current,u=ec(t,u));var y=n.getDerivedStateFromProps;(m=typeof y=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==p||g!==u)&&AE(t,s,r,u),rs=!1,g=t.memoizedState,s.state=g,Cp(t,r,s,o);var x=t.memoizedState;l!==p||g!==x||Qn.current||rs?(typeof y=="function"&&($y(t,n,y,r),x=t.memoizedState),(f=rs||kE(t,n,f,r,g,x,u)||!1)?(m||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,x,u),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,x,u)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&g===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&g===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=x),s.props=r,s.state=x,s.context=u,r=f):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&g===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&g===e.memoizedState||(t.flags|=1024),r=!1)}return ky(e,t,n,r,i,o)}function ky(e,t,n,r,o,i){fR(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&CE(t,n,!1),$i(e,t,i);r=t.stateNode,TI.current=t;var l=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=nc(t,e.child,null,i),t.child=nc(t,null,l,i)):In(e,t,l,i),t.memoizedState=r.state,o&&CE(t,n,!0),t.child}function hR(e){var t=e.stateNode;t.pendingContext?EE(e,t.pendingContext,t.pendingContext!==t.context):t.context&&EE(e,t.context,!1),Nw(e,t.containerInfo)}function zE(e,t,n,r,o){return tc(),Pw(o),t.flags|=256,In(e,t,n,r),t.child}var Ay={dehydrated:null,treeContext:null,retryLane:0};function My(e){return{baseLanes:e,cachePool:null,transitions:null}}function pR(e,t,n){var r=t.pendingProps,o=It.current,i=!1,s=(t.flags&128)!==0,l;if((l=s)||(l=e!==null&&e.memoizedState===null?!1:(o&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),Rt(It,o&1),e===null)return Ey(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=r.children,e=r.fallback,i?(r=t.mode,i=t.child,s={mode:"hidden",children:s},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=s):i=$m(s,r,0,null),e=Pa(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=My(n),t.memoizedState=Ay,e):Uw(t,s));if(o=e.memoizedState,o!==null&&(l=o.dehydrated,l!==null))return kI(e,t,s,r,l,o,n);if(i){i=r.fallback,s=t.mode,o=e.child,l=o.sibling;var u={mode:"hidden",children:r.children};return!(s&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=Rs(o,u),r.subtreeFlags=o.subtreeFlags&14680064),l!==null?i=Rs(l,i):(i=Pa(i,s,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,s=e.child.memoizedState,s=s===null?My(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=Ay,r}return i=e.child,e=i.sibling,r=Rs(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Uw(e,t){return t=$m({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function lh(e,t,n,r){return r!==null&&Pw(r),nc(t,e.child,null,n),e=Uw(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function kI(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=d0(Error(de(422))),lh(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=$m({mode:"visible",children:r.children},o,0,null),i=Pa(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&nc(t,e.child,null,s),t.child.memoizedState=My(s),t.memoizedState=Ay,i);if(!(t.mode&1))return lh(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,i=Error(de(419)),r=d0(i,r,void 0),lh(e,t,s,r)}if(l=(s&e.childLanes)!==0,qn||l){if(r=dn,r!==null){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}o=o&(r.suspendedLanes|s)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,Ci(e,o),So(r,e,o,-1))}return Yw(),r=d0(Error(de(421))),lh(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=VI.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,gr=_s(o.nextSibling),vr=t,Nt=!0,go=null,e!==null&&(Br[zr++]=yi,Br[zr++]=wi,Br[zr++]=ka,yi=e.id,wi=e.overflow,ka=t),t=Uw(t,r.children),t.flags|=4096,t)}function UE(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Cy(e.return,t,n)}function f0(e,t,n,r,o){var i=e.memoizedState;i===null?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 mR(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(In(e,t,r.children,n),r=It.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&UE(e,n,t);else if(e.tag===19)UE(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Rt(It,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&$p(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),f0(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&$p(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}f0(t,!0,n,null,i);break;case"together":f0(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function zh(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function $i(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ma|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(de(153));if(t.child!==null){for(e=t.child,n=Rs(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Rs(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function AI(e,t,n){switch(t.tag){case 3:hR(t),tc();break;case 5:U5(t);break;case 1:Jn(t.type)&&xp(t);break;case 4:Nw(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;Rt(_p,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Rt(It,It.current&1),t.flags|=128,null):n&t.child.childLanes?pR(e,t,n):(Rt(It,It.current&1),e=$i(e,t,n),e!==null?e.sibling:null);Rt(It,It.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return mR(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Rt(It,It.current),r)break;return null;case 22:case 23:return t.lanes=0,dR(e,t,n)}return $i(e,t,n)}var gR,Oy,vR,yR;gR=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Oy=function(){};vR=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,pa(Yo.current);var i=null;switch(n){case"input":o=ty(e,o),r=ty(e,r),i=[];break;case"select":o=jt({},o,{value:void 0}),r=jt({},r,{value:void 0}),i=[];break;case"textarea":o=oy(e,o),r=oy(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=yp)}sy(n,r);var s;n=null;for(f in o)if(!r.hasOwnProperty(f)&&o.hasOwnProperty(f)&&o[f]!=null)if(f==="style"){var l=o[f];for(s in l)l.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else f!=="dangerouslySetInnerHTML"&&f!=="children"&&f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&f!=="autoFocus"&&(Fu.hasOwnProperty(f)?i||(i=[]):(i=i||[]).push(f,null));for(f in r){var u=r[f];if(l=o!=null?o[f]:void 0,r.hasOwnProperty(f)&&u!==l&&(u!=null||l!=null))if(f==="style")if(l){for(s in l)!l.hasOwnProperty(s)||u&&u.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in u)u.hasOwnProperty(s)&&l[s]!==u[s]&&(n||(n={}),n[s]=u[s])}else n||(i||(i=[]),i.push(f,n)),n=u;else f==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,l=l?l.__html:void 0,u!=null&&l!==u&&(i=i||[]).push(f,u)):f==="children"?typeof u!="string"&&typeof u!="number"||(i=i||[]).push(f,""+u):f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&(Fu.hasOwnProperty(f)?(u!=null&&f==="onScroll"&&kt("scroll",e),i||l===u||(i=[])):(i=i||[]).push(f,u))}n&&(i=i||[]).push("style",n);var f=i;(t.updateQueue=f)&&(t.flags|=4)}};yR=function(e,t,n,r){n!==r&&(t.flags|=4)};function iu(e,t){if(!Nt)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function En(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)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 MI(e,t,n){var r=t.pendingProps;switch(Rw(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return En(t),null;case 1:return Jn(t.type)&&wp(),En(t),null;case 3:return r=t.stateNode,rc(),At(Qn),At(Rn),Iw(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(sh(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,go!==null&&(zy(go),go=null))),Oy(e,t),En(t),null;case 5:Dw(t);var o=pa(Zu.current);if(n=t.type,e!==null&&t.stateNode!=null)vR(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(de(166));return En(t),null}if(e=pa(Yo.current),sh(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[jo]=t,r[Yu]=i,e=(t.mode&1)!==0,n){case"dialog":kt("cancel",r),kt("close",r);break;case"iframe":case"object":case"embed":kt("load",r);break;case"video":case"audio":for(o=0;o<wu.length;o++)kt(wu[o],r);break;case"source":kt("error",r);break;case"img":case"image":case"link":kt("error",r),kt("load",r);break;case"details":kt("toggle",r);break;case"input":q_(r,i),kt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},kt("invalid",r);break;case"textarea":J_(r,i),kt("invalid",r)}sy(n,i),o=null;for(var s in i)if(i.hasOwnProperty(s)){var l=i[s];s==="children"?typeof l=="string"?r.textContent!==l&&(i.suppressHydrationWarning!==!0&&ih(r.textContent,l,e),o=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&ih(r.textContent,l,e),o=["children",""+l]):Fu.hasOwnProperty(s)&&l!=null&&s==="onScroll"&&kt("scroll",r)}switch(n){case"input":qf(r),Q_(r,i,!0);break;case"textarea":qf(r),eE(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=yp)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=H$(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[jo]=t,e[Yu]=r,gR(e,t,!1,!1),t.stateNode=e;e:{switch(s=ay(n,r),n){case"dialog":kt("cancel",e),kt("close",e),o=r;break;case"iframe":case"object":case"embed":kt("load",e),o=r;break;case"video":case"audio":for(o=0;o<wu.length;o++)kt(wu[o],e);o=r;break;case"source":kt("error",e),o=r;break;case"img":case"image":case"link":kt("error",e),kt("load",e),o=r;break;case"details":kt("toggle",e),o=r;break;case"input":q_(e,r),o=ty(e,r),kt("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=jt({},r,{value:void 0}),kt("invalid",e);break;case"textarea":J_(e,r),o=oy(e,r),kt("invalid",e);break;default:o=r}sy(n,o),l=o;for(i in l)if(l.hasOwnProperty(i)){var u=l[i];i==="style"?Y$(e,u):i==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&K$(e,u)):i==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&ju(e,u):typeof u=="number"&&ju(e,""+u):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Fu.hasOwnProperty(i)?u!=null&&i==="onScroll"&&kt("scroll",e):u!=null&&fw(e,i,u,s))}switch(n){case"input":qf(e),Q_(e,r,!1);break;case"textarea":qf(e),eE(e);break;case"option":r.value!=null&&e.setAttribute("value",""+As(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?kl(e,!!r.multiple,i,!1):r.defaultValue!=null&&kl(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=yp)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return En(t),null;case 6:if(e&&t.stateNode!=null)yR(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(de(166));if(n=pa(Zu.current),pa(Yo.current),sh(t)){if(r=t.stateNode,n=t.memoizedProps,r[jo]=t,(i=r.nodeValue!==n)&&(e=vr,e!==null))switch(e.tag){case 3:ih(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ih(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[jo]=t,t.stateNode=r}return En(t),null;case 13:if(At(It),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Nt&&gr!==null&&t.mode&1&&!(t.flags&128))D5(),tc(),t.flags|=98560,i=!1;else if(i=sh(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(de(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(de(317));i[jo]=t}else tc(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;En(t),i=!1}else go!==null&&(zy(go),go=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||It.current&1?on===0&&(on=3):Yw())),t.updateQueue!==null&&(t.flags|=4),En(t),null);case 4:return rc(),Oy(e,t),e===null&&Ku(t.stateNode.containerInfo),En(t),null;case 10:return Aw(t.type._context),En(t),null;case 17:return Jn(t.type)&&wp(),En(t),null;case 19:if(At(It),i=t.memoizedState,i===null)return En(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)iu(i,!1);else{if(on!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=$p(e),s!==null){for(t.flags|=128,iu(i,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Rt(It,It.current&1|2),t.child}e=e.sibling}i.tail!==null&&Gt()>ic&&(t.flags|=128,r=!0,iu(i,!1),t.lanes=4194304)}else{if(!r)if(e=$p(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),iu(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!Nt)return En(t),null}else 2*Gt()-i.renderingStartTime>ic&&n!==1073741824&&(t.flags|=128,r=!0,iu(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Gt(),t.sibling=null,n=It.current,Rt(It,r?n&1|2:n&1),t):(En(t),null);case 22:case 23:return Gw(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?hr&1073741824&&(En(t),t.subtreeFlags&6&&(t.flags|=8192)):En(t),null;case 24:return null;case 25:return null}throw Error(de(156,t.tag))}function OI(e,t){switch(Rw(t),t.tag){case 1:return Jn(t.type)&&wp(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return rc(),At(Qn),At(Rn),Iw(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Dw(t),null;case 13:if(At(It),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(de(340));tc()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return At(It),null;case 4:return rc(),null;case 10:return Aw(t.type._context),null;case 22:case 23:return Gw(),null;case 24:return null;default:return null}}var ch=!1,$n=!1,NI=typeof WeakSet=="function"?WeakSet:Set,$e=null;function Rl(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Vt(e,t,r)}else n.current=null}function Ny(e,t,n){try{n()}catch(r){Vt(e,t,r)}}var VE=!1;function DI(e,t){if(vy=mp,e=S5(),Cw(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 o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,l=-1,u=-1,f=0,m=0,p=e,g=null;t:for(;;){for(var y;p!==n||o!==0&&p.nodeType!==3||(l=s+o),p!==i||r!==0&&p.nodeType!==3||(u=s+r),p.nodeType===3&&(s+=p.nodeValue.length),(y=p.firstChild)!==null;)g=p,p=y;for(;;){if(p===e)break t;if(g===n&&++f===o&&(l=s),g===i&&++m===r&&(u=s),(y=p.nextSibling)!==null)break;p=g,g=p.parentNode}p=y}n=l===-1||u===-1?null:{start:l,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(yy={focusedElem:e,selectionRange:n},mp=!1,$e=t;$e!==null;)if(t=$e,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,$e=e;else for(;$e!==null;){t=$e;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var S=x.memoizedProps,E=x.memoizedState,_=t.stateNode,b=_.getSnapshotBeforeUpdate(t.elementType===t.type?S:co(t.type,S),E);_.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var C=t.stateNode.containerInfo;C.nodeType===1?C.textContent="":C.nodeType===9&&C.documentElement&&C.removeChild(C.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(de(163))}}catch(R){Vt(t,t.return,R)}if(e=t.sibling,e!==null){e.return=t.return,$e=e;break}$e=t.return}return x=VE,VE=!1,x}function ku(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&Ny(t,n,i)}o=o.next}while(o!==r)}}function Em(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 Dy(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 wR(e){var t=e.alternate;t!==null&&(e.alternate=null,wR(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[jo],delete t[Yu],delete t[by],delete t[vI],delete t[yI])),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 xR(e){return e.tag===5||e.tag===3||e.tag===4}function WE(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||xR(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 Iy(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=yp));else if(r!==4&&(e=e.child,e!==null))for(Iy(e,t,n),e=e.sibling;e!==null;)Iy(e,t,n),e=e.sibling}function Ly(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(Ly(e,t,n),e=e.sibling;e!==null;)Ly(e,t,n),e=e.sibling}var mn=null,ho=!1;function Xi(e,t,n){for(n=n.child;n!==null;)bR(e,t,n),n=n.sibling}function bR(e,t,n){if(Go&&typeof Go.onCommitFiberUnmount=="function")try{Go.onCommitFiberUnmount(gm,n)}catch{}switch(n.tag){case 5:$n||Rl(n,t);case 6:var r=mn,o=ho;mn=null,Xi(e,t,n),mn=r,ho=o,mn!==null&&(ho?(e=mn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):mn.removeChild(n.stateNode));break;case 18:mn!==null&&(ho?(e=mn,n=n.stateNode,e.nodeType===8?i0(e.parentNode,n):e.nodeType===1&&i0(e,n),Vu(e)):i0(mn,n.stateNode));break;case 4:r=mn,o=ho,mn=n.stateNode.containerInfo,ho=!0,Xi(e,t,n),mn=r,ho=o;break;case 0:case 11:case 14:case 15:if(!$n&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&Ny(n,t,s),o=o.next}while(o!==r)}Xi(e,t,n);break;case 1:if(!$n&&(Rl(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Vt(n,t,l)}Xi(e,t,n);break;case 21:Xi(e,t,n);break;case 22:n.mode&1?($n=(r=$n)||n.memoizedState!==null,Xi(e,t,n),$n=r):Xi(e,t,n);break;default:Xi(e,t,n)}}function HE(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new NI),t.forEach(function(r){var o=WI.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function ao(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,s=t,l=s;e:for(;l!==null;){switch(l.tag){case 5:mn=l.stateNode,ho=!1;break e;case 3:mn=l.stateNode.containerInfo,ho=!0;break e;case 4:mn=l.stateNode.containerInfo,ho=!0;break e}l=l.return}if(mn===null)throw Error(de(160));bR(i,s,o),mn=null,ho=!1;var u=o.alternate;u!==null&&(u.return=null),o.return=null}catch(f){Vt(o,t,f)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)SR(t,e),t=t.sibling}function SR(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ao(t,e),Ao(e),r&4){try{ku(3,e,e.return),Em(3,e)}catch(S){Vt(e,e.return,S)}try{ku(5,e,e.return)}catch(S){Vt(e,e.return,S)}}break;case 1:ao(t,e),Ao(e),r&512&&n!==null&&Rl(n,n.return);break;case 5:if(ao(t,e),Ao(e),r&512&&n!==null&&Rl(n,n.return),e.flags&32){var o=e.stateNode;try{ju(o,"")}catch(S){Vt(e,e.return,S)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,s=n!==null?n.memoizedProps:i,l=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&V$(o,i),ay(l,s);var f=ay(l,i);for(s=0;s<u.length;s+=2){var m=u[s],p=u[s+1];m==="style"?Y$(o,p):m==="dangerouslySetInnerHTML"?K$(o,p):m==="children"?ju(o,p):fw(o,m,p,f)}switch(l){case"input":ny(o,i);break;case"textarea":W$(o,i);break;case"select":var g=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var y=i.value;y!=null?kl(o,!!i.multiple,y,!1):g!==!!i.multiple&&(i.defaultValue!=null?kl(o,!!i.multiple,i.defaultValue,!0):kl(o,!!i.multiple,i.multiple?[]:"",!1))}o[Yu]=i}catch(S){Vt(e,e.return,S)}}break;case 6:if(ao(t,e),Ao(e),r&4){if(e.stateNode===null)throw Error(de(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(S){Vt(e,e.return,S)}}break;case 3:if(ao(t,e),Ao(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Vu(t.containerInfo)}catch(S){Vt(e,e.return,S)}break;case 4:ao(t,e),Ao(e);break;case 13:ao(t,e),Ao(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(Hw=Gt())),r&4&&HE(e);break;case 22:if(m=n!==null&&n.memoizedState!==null,e.mode&1?($n=(f=$n)||m,ao(t,e),$n=f):ao(t,e),Ao(e),r&8192){if(f=e.memoizedState!==null,(e.stateNode.isHidden=f)&&!m&&e.mode&1)for($e=e,m=e.child;m!==null;){for(p=$e=m;$e!==null;){switch(g=$e,y=g.child,g.tag){case 0:case 11:case 14:case 15:ku(4,g,g.return);break;case 1:Rl(g,g.return);var x=g.stateNode;if(typeof x.componentWillUnmount=="function"){r=g,n=g.return;try{t=r,x.props=t.memoizedProps,x.state=t.memoizedState,x.componentWillUnmount()}catch(S){Vt(r,n,S)}}break;case 5:Rl(g,g.return);break;case 22:if(g.memoizedState!==null){GE(p);continue}}y!==null?(y.return=g,$e=y):GE(p)}m=m.sibling}e:for(m=null,p=e;;){if(p.tag===5){if(m===null){m=p;try{o=p.stateNode,f?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=p.stateNode,u=p.memoizedProps.style,s=u!=null&&u.hasOwnProperty("display")?u.display:null,l.style.display=G$("display",s))}catch(S){Vt(e,e.return,S)}}}else if(p.tag===6){if(m===null)try{p.stateNode.nodeValue=f?"":p.memoizedProps}catch(S){Vt(e,e.return,S)}}else if((p.tag!==22&&p.tag!==23||p.memoizedState===null||p===e)&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===e)break e;for(;p.sibling===null;){if(p.return===null||p.return===e)break e;m===p&&(m=null),p=p.return}m===p&&(m=null),p.sibling.return=p.return,p=p.sibling}}break;case 19:ao(t,e),Ao(e),r&4&&HE(e);break;case 21:break;default:ao(t,e),Ao(e)}}function Ao(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(xR(n)){var r=n;break e}n=n.return}throw Error(de(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(ju(o,""),r.flags&=-33);var i=WE(e);Ly(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,l=WE(e);Iy(e,l,s);break;default:throw Error(de(161))}}catch(u){Vt(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function II(e,t,n){$e=e,_R(e)}function _R(e,t,n){for(var r=(e.mode&1)!==0;$e!==null;){var o=$e,i=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||ch;if(!s){var l=o.alternate,u=l!==null&&l.memoizedState!==null||$n;l=ch;var f=$n;if(ch=s,($n=u)&&!f)for($e=o;$e!==null;)s=$e,u=s.child,s.tag===22&&s.memoizedState!==null?YE(o):u!==null?(u.return=s,$e=u):YE(o);for(;i!==null;)$e=i,_R(i),i=i.sibling;$e=o,ch=l,$n=f}KE(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,$e=i):KE(e)}}function KE(e){for(;$e!==null;){var t=$e;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:$n||Em(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!$n)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:co(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&TE(t,i,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}TE(t,s,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var f=t.alternate;if(f!==null){var m=f.memoizedState;if(m!==null){var p=m.dehydrated;p!==null&&Vu(p)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(de(163))}$n||t.flags&512&&Dy(t)}catch(g){Vt(t,t.return,g)}}if(t===e){$e=null;break}if(n=t.sibling,n!==null){n.return=t.return,$e=n;break}$e=t.return}}function GE(e){for(;$e!==null;){var t=$e;if(t===e){$e=null;break}var n=t.sibling;if(n!==null){n.return=t.return,$e=n;break}$e=t.return}}function YE(e){for(;$e!==null;){var t=$e;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Em(4,t)}catch(u){Vt(t,n,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(u){Vt(t,o,u)}}var i=t.return;try{Dy(t)}catch(u){Vt(t,i,u)}break;case 5:var s=t.return;try{Dy(t)}catch(u){Vt(t,s,u)}}}catch(u){Vt(t,t.return,u)}if(t===e){$e=null;break}var l=t.sibling;if(l!==null){l.return=t.return,$e=l;break}$e=t.return}}var LI=Math.ceil,Tp=Oi.ReactCurrentDispatcher,Vw=Oi.ReactCurrentOwner,Xr=Oi.ReactCurrentBatchConfig,ft=0,dn=null,Zt=null,yn=0,hr=0,Pl=Fs(0),on=0,ed=null,Ma=0,Cm=0,Ww=0,Au=null,Xn=null,Hw=0,ic=1/0,mi=null,kp=!1,Fy=null,Cs=null,uh=!1,ps=null,Ap=0,Mu=0,jy=null,Uh=-1,Vh=0;function jn(){return ft&6?Gt():Uh!==-1?Uh:Uh=Gt()}function $s(e){return e.mode&1?ft&2&&yn!==0?yn&-yn:xI.transition!==null?(Vh===0&&(Vh=s5()),Vh):(e=bt,e!==0||(e=window.event,e=e===void 0?16:h5(e.type)),e):1}function So(e,t,n,r){if(50<Mu)throw Mu=0,jy=null,Error(de(185));Td(e,n,r),(!(ft&2)||e!==dn)&&(e===dn&&(!(ft&2)&&(Cm|=n),on===4&&is(e,yn)),er(e,r),n===1&&ft===0&&!(t.mode&1)&&(ic=Gt()+500,bm&&js()))}function er(e,t){var n=e.callbackNode;xD(e,t);var r=pp(e,e===dn?yn:0);if(r===0)n!==null&&rE(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&rE(n),t===1)e.tag===0?wI(XE.bind(null,e)):M5(XE.bind(null,e)),mI(function(){!(ft&6)&&js()}),n=null;else{switch(a5(r)){case 1:n=vw;break;case 4:n=o5;break;case 16:n=hp;break;case 536870912:n=i5;break;default:n=hp}n=AR(n,ER.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function ER(e,t){if(Uh=-1,Vh=0,ft&6)throw Error(de(327));var n=e.callbackNode;if(Dl()&&e.callbackNode!==n)return null;var r=pp(e,e===dn?yn:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Mp(e,r);else{t=r;var o=ft;ft|=2;var i=$R();(dn!==e||yn!==t)&&(mi=null,ic=Gt()+500,Ra(e,t));do try{BI();break}catch(l){CR(e,l)}while(!0);kw(),Tp.current=i,ft=o,Zt!==null?t=0:(dn=null,yn=0,t=on)}if(t!==0){if(t===2&&(o=fy(e),o!==0&&(r=o,t=By(e,o))),t===1)throw n=ed,Ra(e,0),is(e,r),er(e,Gt()),n;if(t===6)is(e,r);else{if(o=e.current.alternate,!(r&30)&&!FI(o)&&(t=Mp(e,r),t===2&&(i=fy(e),i!==0&&(r=i,t=By(e,i))),t===1))throw n=ed,Ra(e,0),is(e,r),er(e,Gt()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(de(345));case 2:oa(e,Xn,mi);break;case 3:if(is(e,r),(r&130023424)===r&&(t=Hw+500-Gt(),10<t)){if(pp(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){jn(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=xy(oa.bind(null,e,Xn,mi),t);break}oa(e,Xn,mi);break;case 4:if(is(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-bo(r);i=1<<s,s=t[s],s>o&&(o=s),r&=~i}if(r=o,r=Gt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*LI(r/1960))-r,10<r){e.timeoutHandle=xy(oa.bind(null,e,Xn,mi),r);break}oa(e,Xn,mi);break;case 5:oa(e,Xn,mi);break;default:throw Error(de(329))}}}return er(e,Gt()),e.callbackNode===n?ER.bind(null,e):null}function By(e,t){var n=Au;return e.current.memoizedState.isDehydrated&&(Ra(e,t).flags|=256),e=Mp(e,t),e!==2&&(t=Xn,Xn=n,t!==null&&zy(t)),e}function zy(e){Xn===null?Xn=e:Xn.push.apply(Xn,e)}function FI(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!Eo(i(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function is(e,t){for(t&=~Ww,t&=~Cm,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-bo(t),r=1<<n;e[n]=-1,t&=~r}}function XE(e){if(ft&6)throw Error(de(327));Dl();var t=pp(e,0);if(!(t&1))return er(e,Gt()),null;var n=Mp(e,t);if(e.tag!==0&&n===2){var r=fy(e);r!==0&&(t=r,n=By(e,r))}if(n===1)throw n=ed,Ra(e,0),is(e,t),er(e,Gt()),n;if(n===6)throw Error(de(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,oa(e,Xn,mi),er(e,Gt()),null}function Kw(e,t){var n=ft;ft|=1;try{return e(t)}finally{ft=n,ft===0&&(ic=Gt()+500,bm&&js())}}function Oa(e){ps!==null&&ps.tag===0&&!(ft&6)&&Dl();var t=ft;ft|=1;var n=Xr.transition,r=bt;try{if(Xr.transition=null,bt=1,e)return e()}finally{bt=r,Xr.transition=n,ft=t,!(ft&6)&&js()}}function Gw(){hr=Pl.current,At(Pl)}function Ra(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,pI(n)),Zt!==null)for(n=Zt.return;n!==null;){var r=n;switch(Rw(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&wp();break;case 3:rc(),At(Qn),At(Rn),Iw();break;case 5:Dw(r);break;case 4:rc();break;case 13:At(It);break;case 19:At(It);break;case 10:Aw(r.type._context);break;case 22:case 23:Gw()}n=n.return}if(dn=e,Zt=e=Rs(e.current,null),yn=hr=t,on=0,ed=null,Ww=Cm=Ma=0,Xn=Au=null,ha!==null){for(t=0;t<ha.length;t++)if(n=ha[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var s=i.next;i.next=o,r.next=s}n.pending=r}ha=null}return e}function CR(e,t){do{var n=Zt;try{if(kw(),jh.current=Pp,Rp){for(var r=Ft.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Rp=!1}if(Aa=0,un=rn=Ft=null,Tu=!1,qu=0,Vw.current=null,n===null||n.return===null){on=1,ed=t,Zt=null;break}e:{var i=e,s=n.return,l=n,u=t;if(t=yn,l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var f=u,m=l,p=m.tag;if(!(m.mode&1)&&(p===0||p===11||p===15)){var g=m.alternate;g?(m.updateQueue=g.updateQueue,m.memoizedState=g.memoizedState,m.lanes=g.lanes):(m.updateQueue=null,m.memoizedState=null)}var y=IE(s);if(y!==null){y.flags&=-257,LE(y,s,l,i,t),y.mode&1&&DE(i,f,t),t=y,u=f;var x=t.updateQueue;if(x===null){var S=new Set;S.add(u),t.updateQueue=S}else x.add(u);break e}else{if(!(t&1)){DE(i,f,t),Yw();break e}u=Error(de(426))}}else if(Nt&&l.mode&1){var E=IE(s);if(E!==null){!(E.flags&65536)&&(E.flags|=256),LE(E,s,l,i,t),Pw(oc(u,l));break e}}i=u=oc(u,l),on!==4&&(on=2),Au===null?Au=[i]:Au.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var _=lR(i,u,t);PE(i,_);break e;case 1:l=u;var b=i.type,C=i.stateNode;if(!(i.flags&128)&&(typeof b.getDerivedStateFromError=="function"||C!==null&&typeof C.componentDidCatch=="function"&&(Cs===null||!Cs.has(C)))){i.flags|=65536,t&=-t,i.lanes|=t;var R=cR(i,l,t);PE(i,R);break e}}i=i.return}while(i!==null)}PR(n)}catch(k){t=k,Zt===n&&n!==null&&(Zt=n=n.return);continue}break}while(!0)}function $R(){var e=Tp.current;return Tp.current=Pp,e===null?Pp:e}function Yw(){(on===0||on===3||on===2)&&(on=4),dn===null||!(Ma&268435455)&&!(Cm&268435455)||is(dn,yn)}function Mp(e,t){var n=ft;ft|=2;var r=$R();(dn!==e||yn!==t)&&(mi=null,Ra(e,t));do try{jI();break}catch(o){CR(e,o)}while(!0);if(kw(),ft=n,Tp.current=r,Zt!==null)throw Error(de(261));return dn=null,yn=0,on}function jI(){for(;Zt!==null;)RR(Zt)}function BI(){for(;Zt!==null&&!dD();)RR(Zt)}function RR(e){var t=kR(e.alternate,e,hr);e.memoizedProps=e.pendingProps,t===null?PR(e):Zt=t,Vw.current=null}function PR(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=OI(n,t),n!==null){n.flags&=32767,Zt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{on=6,Zt=null;return}}else if(n=MI(n,t,hr),n!==null){Zt=n;return}if(t=t.sibling,t!==null){Zt=t;return}Zt=t=e}while(t!==null);on===0&&(on=5)}function oa(e,t,n){var r=bt,o=Xr.transition;try{Xr.transition=null,bt=1,zI(e,t,n,r)}finally{Xr.transition=o,bt=r}return null}function zI(e,t,n,r){do Dl();while(ps!==null);if(ft&6)throw Error(de(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(de(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(bD(e,i),e===dn&&(Zt=dn=null,yn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||uh||(uh=!0,AR(hp,function(){return Dl(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=Xr.transition,Xr.transition=null;var s=bt;bt=1;var l=ft;ft|=4,Vw.current=null,DI(e,n),SR(n,e),aI(yy),mp=!!vy,yy=vy=null,e.current=n,II(n),fD(),ft=l,bt=s,Xr.transition=i}else e.current=n;if(uh&&(uh=!1,ps=e,Ap=o),i=e.pendingLanes,i===0&&(Cs=null),mD(n.stateNode),er(e,Gt()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(kp)throw kp=!1,e=Fy,Fy=null,e;return Ap&1&&e.tag!==0&&Dl(),i=e.pendingLanes,i&1?e===jy?Mu++:(Mu=0,jy=e):Mu=0,js(),null}function Dl(){if(ps!==null){var e=a5(Ap),t=Xr.transition,n=bt;try{if(Xr.transition=null,bt=16>e?16:e,ps===null)var r=!1;else{if(e=ps,ps=null,Ap=0,ft&6)throw Error(de(331));var o=ft;for(ft|=4,$e=e.current;$e!==null;){var i=$e,s=i.child;if($e.flags&16){var l=i.deletions;if(l!==null){for(var u=0;u<l.length;u++){var f=l[u];for($e=f;$e!==null;){var m=$e;switch(m.tag){case 0:case 11:case 15:ku(8,m,i)}var p=m.child;if(p!==null)p.return=m,$e=p;else for(;$e!==null;){m=$e;var g=m.sibling,y=m.return;if(wR(m),m===f){$e=null;break}if(g!==null){g.return=y,$e=g;break}$e=y}}}var x=i.alternate;if(x!==null){var S=x.child;if(S!==null){x.child=null;do{var E=S.sibling;S.sibling=null,S=E}while(S!==null)}}$e=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,$e=s;else e:for(;$e!==null;){if(i=$e,i.flags&2048)switch(i.tag){case 0:case 11:case 15:ku(9,i,i.return)}var _=i.sibling;if(_!==null){_.return=i.return,$e=_;break e}$e=i.return}}var b=e.current;for($e=b;$e!==null;){s=$e;var C=s.child;if(s.subtreeFlags&2064&&C!==null)C.return=s,$e=C;else e:for(s=b;$e!==null;){if(l=$e,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Em(9,l)}}catch(k){Vt(l,l.return,k)}if(l===s){$e=null;break e}var R=l.sibling;if(R!==null){R.return=l.return,$e=R;break e}$e=l.return}}if(ft=o,js(),Go&&typeof Go.onPostCommitFiberRoot=="function")try{Go.onPostCommitFiberRoot(gm,e)}catch{}r=!0}return r}finally{bt=n,Xr.transition=t}}return!1}function ZE(e,t,n){t=oc(n,t),t=lR(e,t,1),e=Es(e,t,1),t=jn(),e!==null&&(Td(e,1,t),er(e,t))}function Vt(e,t,n){if(e.tag===3)ZE(e,e,n);else for(;t!==null;){if(t.tag===3){ZE(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Cs===null||!Cs.has(r))){e=oc(n,e),e=cR(t,e,1),t=Es(t,e,1),e=jn(),t!==null&&(Td(t,1,e),er(t,e));break}}t=t.return}}function UI(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=jn(),e.pingedLanes|=e.suspendedLanes&n,dn===e&&(yn&n)===n&&(on===4||on===3&&(yn&130023424)===yn&&500>Gt()-Hw?Ra(e,0):Ww|=n),er(e,t)}function TR(e,t){t===0&&(e.mode&1?(t=eh,eh<<=1,!(eh&130023424)&&(eh=4194304)):t=1);var n=jn();e=Ci(e,t),e!==null&&(Td(e,t,n),er(e,n))}function VI(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),TR(e,n)}function WI(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(de(314))}r!==null&&r.delete(t),TR(e,n)}var kR;kR=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Qn.current)qn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return qn=!1,AI(e,t,n);qn=!!(e.flags&131072)}else qn=!1,Nt&&t.flags&1048576&&O5(t,Sp,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;zh(e,t),e=t.pendingProps;var o=ec(t,Rn.current);Nl(t,n),o=Fw(null,t,r,e,o,n);var i=jw();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Jn(r)?(i=!0,xp(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Ow(t),o.updater=Sm,t.stateNode=o,o._reactInternals=t,Ry(t,r,e,n),t=ky(null,t,r,!0,i,n)):(t.tag=0,Nt&&i&&$w(t),In(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(zh(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=KI(r),e=co(r,e),o){case 0:t=Ty(null,t,r,e,n);break e;case 1:t=BE(null,t,r,e,n);break e;case 11:t=FE(null,t,r,e,n);break e;case 14:t=jE(null,t,r,co(r.type,e),n);break e}throw Error(de(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:co(r,o),Ty(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:co(r,o),BE(e,t,r,o,n);case 3:e:{if(hR(t),e===null)throw Error(de(387));r=t.pendingProps,i=t.memoizedState,o=i.element,L5(e,t),Cp(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=oc(Error(de(423)),t),t=zE(e,t,r,n,o);break e}else if(r!==o){o=oc(Error(de(424)),t),t=zE(e,t,r,n,o);break e}else for(gr=_s(t.stateNode.containerInfo.firstChild),vr=t,Nt=!0,go=null,n=z5(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(tc(),r===o){t=$i(e,t,n);break e}In(e,t,r,n)}t=t.child}return t;case 5:return U5(t),e===null&&Ey(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,wy(r,o)?s=null:i!==null&&wy(r,i)&&(t.flags|=32),fR(e,t),In(e,t,s,n),t.child;case 6:return e===null&&Ey(t),null;case 13:return pR(e,t,n);case 4:return Nw(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=nc(t,null,r,n):In(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:co(r,o),FE(e,t,r,o,n);case 7:return In(e,t,t.pendingProps,n),t.child;case 8:return In(e,t,t.pendingProps.children,n),t.child;case 12:return In(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,Rt(_p,r._currentValue),r._currentValue=s,i!==null)if(Eo(i.value,s)){if(i.children===o.children&&!Qn.current){t=$i(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){s=i.child;for(var u=l.firstContext;u!==null;){if(u.context===r){if(i.tag===1){u=bi(-1,n&-n),u.tag=2;var f=i.updateQueue;if(f!==null){f=f.shared;var m=f.pending;m===null?u.next=u:(u.next=m.next,m.next=u),f.pending=u}}i.lanes|=n,u=i.alternate,u!==null&&(u.lanes|=n),Cy(i.return,n,t),l.lanes|=n;break}u=u.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(de(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Cy(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}In(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Nl(t,n),o=qr(o),r=r(o),t.flags|=1,In(e,t,r,n),t.child;case 14:return r=t.type,o=co(r,t.pendingProps),o=co(r.type,o),jE(e,t,r,o,n);case 15:return uR(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:co(r,o),zh(e,t),t.tag=1,Jn(r)?(e=!0,xp(t)):e=!1,Nl(t,n),j5(t,r,o),Ry(t,r,o,n),ky(null,t,r,!0,e,n);case 19:return mR(e,t,n);case 22:return dR(e,t,n)}throw Error(de(156,t.tag))};function AR(e,t){return r5(e,t)}function HI(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 Kr(e,t,n,r){return new HI(e,t,n,r)}function Xw(e){return e=e.prototype,!(!e||!e.isReactComponent)}function KI(e){if(typeof e=="function")return Xw(e)?1:0;if(e!=null){if(e=e.$$typeof,e===pw)return 11;if(e===mw)return 14}return 2}function Rs(e,t){var n=e.alternate;return n===null?(n=Kr(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 Wh(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")Xw(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case yl:return Pa(n.children,o,i,t);case hw:s=8,o|=8;break;case q0:return e=Kr(12,n,t,o|2),e.elementType=q0,e.lanes=i,e;case Q0:return e=Kr(13,n,t,o),e.elementType=Q0,e.lanes=i,e;case J0:return e=Kr(19,n,t,o),e.elementType=J0,e.lanes=i,e;case B$:return $m(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case F$:s=10;break e;case j$:s=9;break e;case pw:s=11;break e;case mw:s=14;break e;case ns:s=16,r=null;break e}throw Error(de(130,e==null?e:typeof e,""))}return t=Kr(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Pa(e,t,n,r){return e=Kr(7,e,r,t),e.lanes=n,e}function $m(e,t,n,r){return e=Kr(22,e,r,t),e.elementType=B$,e.lanes=n,e.stateNode={isHidden:!1},e}function h0(e,t,n){return e=Kr(6,e,null,t),e.lanes=n,e}function p0(e,t,n){return t=Kr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function GI(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=Yv(0),this.expirationTimes=Yv(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yv(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Zw(e,t,n,r,o,i,s,l,u){return e=new GI(e,t,n,l,u),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Kr(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ow(i),e}function YI(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:vl,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function MR(e){if(!e)return Ms;e=e._reactInternals;e:{if(ja(e)!==e||e.tag!==1)throw Error(de(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Jn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(de(171))}if(e.tag===1){var n=e.type;if(Jn(n))return A5(e,n,t)}return t}function OR(e,t,n,r,o,i,s,l,u){return e=Zw(n,r,!0,e,o,i,s,l,u),e.context=MR(null),n=e.current,r=jn(),o=$s(n),i=bi(r,o),i.callback=t??null,Es(n,i,o),e.current.lanes=o,Td(e,o,r),er(e,r),e}function Rm(e,t,n,r){var o=t.current,i=jn(),s=$s(o);return n=MR(n),t.context===null?t.context=n:t.pendingContext=n,t=bi(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Es(o,t,s),e!==null&&(So(e,o,s,i),Fh(e,o,s)),s}function Op(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function qE(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function qw(e,t){qE(e,t),(e=e.alternate)&&qE(e,t)}function XI(){return null}var NR=typeof reportError=="function"?reportError:function(e){console.error(e)};function Qw(e){this._internalRoot=e}Pm.prototype.render=Qw.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(de(409));Rm(e,t,null,null)};Pm.prototype.unmount=Qw.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Oa(function(){Rm(null,e,null,null)}),t[Ei]=null}};function Pm(e){this._internalRoot=e}Pm.prototype.unstable_scheduleHydration=function(e){if(e){var t=u5();e={blockedOn:null,target:e,priority:t};for(var n=0;n<os.length&&t!==0&&t<os[n].priority;n++);os.splice(n,0,e),n===0&&f5(e)}};function Jw(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Tm(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function QE(){}function ZI(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var f=Op(s);i.call(f)}}var s=OR(t,r,e,0,null,!1,!1,"",QE);return e._reactRootContainer=s,e[Ei]=s.current,Ku(e.nodeType===8?e.parentNode:e),Oa(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var l=r;r=function(){var f=Op(u);l.call(f)}}var u=Zw(e,0,!1,null,null,!1,!1,"",QE);return e._reactRootContainer=u,e[Ei]=u.current,Ku(e.nodeType===8?e.parentNode:e),Oa(function(){Rm(t,u,n,r)}),u}function km(e,t,n,r,o){var i=n._reactRootContainer;if(i){var s=i;if(typeof o=="function"){var l=o;o=function(){var u=Op(s);l.call(u)}}Rm(t,s,e,o)}else s=ZI(n,t,e,o,r);return Op(s)}l5=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=yu(t.pendingLanes);n!==0&&(yw(t,n|1),er(t,Gt()),!(ft&6)&&(ic=Gt()+500,js()))}break;case 13:Oa(function(){var r=Ci(e,1);if(r!==null){var o=jn();So(r,e,1,o)}}),qw(e,1)}};ww=function(e){if(e.tag===13){var t=Ci(e,134217728);if(t!==null){var n=jn();So(t,e,134217728,n)}qw(e,134217728)}};c5=function(e){if(e.tag===13){var t=$s(e),n=Ci(e,t);if(n!==null){var r=jn();So(n,e,t,r)}qw(e,t)}};u5=function(){return bt};d5=function(e,t){var n=bt;try{return bt=e,t()}finally{bt=n}};cy=function(e,t,n){switch(t){case"input":if(ny(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=xm(r);if(!o)throw Error(de(90));U$(r),ny(r,o)}}}break;case"textarea":W$(e,n);break;case"select":t=n.value,t!=null&&kl(e,!!n.multiple,t,!1)}};q$=Kw;Q$=Oa;var qI={usingClientEntryPoint:!1,Events:[Ad,Sl,xm,X$,Z$,Kw]},su={findFiberByHostInstance:fa,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},QI={bundleType:su.bundleType,version:su.version,rendererPackageName:su.rendererPackageName,rendererConfig:su.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Oi.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=t5(e),e===null?null:e.stateNode},findFiberByHostInstance:su.findFiberByHostInstance||XI,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var dh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!dh.isDisabled&&dh.supportsFiber)try{gm=dh.inject(QI),Go=dh}catch{}}Sr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=qI;Sr.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Jw(t))throw Error(de(200));return YI(e,t,null,n)};Sr.createRoot=function(e,t){if(!Jw(e))throw Error(de(299));var n=!1,r="",o=NR;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Zw(e,1,!1,null,null,n,!1,r,o),e[Ei]=t.current,Ku(e.nodeType===8?e.parentNode:e),new Qw(t)};Sr.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(de(188)):(e=Object.keys(e).join(","),Error(de(268,e)));return e=t5(t),e=e===null?null:e.stateNode,e};Sr.flushSync=function(e){return Oa(e)};Sr.hydrate=function(e,t,n){if(!Tm(t))throw Error(de(200));return km(null,e,t,!0,n)};Sr.hydrateRoot=function(e,t,n){if(!Jw(e))throw Error(de(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=NR;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=OR(t,null,e,1,n??null,o,!1,i,s),e[Ei]=t.current,Ku(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new Pm(t)};Sr.render=function(e,t,n){if(!Tm(t))throw Error(de(200));return km(null,e,t,!1,n)};Sr.unmountComponentAtNode=function(e){if(!Tm(e))throw Error(de(40));return e._reactRootContainer?(Oa(function(){km(null,null,e,!1,function(){e._reactRootContainer=null,e[Ei]=null})}),!0):!1};Sr.unstable_batchedUpdates=Kw;Sr.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Tm(n))throw Error(de(200));if(e==null||e._reactInternals===void 0)throw Error(de(38));return km(e,t,n,!1,r)};Sr.version="18.2.0-next-9e3b772b8-20220608";function DR(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(DR)}catch(e){console.error(e)}}DR(),O$.exports=Sr;var Bs=O$.exports;const JI=pm(Bs);var JE=Bs;X0.createRoot=JE.createRoot,X0.hydrateRoot=JE.hydrateRoot;var Od=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},sc=typeof window>"u"||"Deno"in window;function Lr(){}function eL(e,t){return typeof e=="function"?e(t):e}function Uy(e){return typeof e=="number"&&e>=0&&e!==1/0}function IR(e,t){return Math.max(e+(t||0)-Date.now(),0)}function eC(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:l}=e;if(s){if(r){if(t.queryHash!==ex(s,t.options))return!1}else if(!nd(t.queryKey,s))return!1}if(n!=="all"){const u=t.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||typeof o<"u"&&o!==t.state.fetchStatus||i&&!i(t))}function tC(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(td(t.options.mutationKey)!==td(i))return!1}else if(!nd(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function ex(e,t){return((t==null?void 0:t.queryKeyHashFn)||td)(e)}function td(e){return JSON.stringify(e,(t,n)=>Wy(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function nd(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!nd(e[n],t[n])):!1}function LR(e,t){if(e===t)return e;const n=nC(e)&&nC(t);if(n||Wy(e)&&Wy(t)){const r=n?e.length:Object.keys(e).length,o=n?t:Object.keys(t),i=o.length,s=n?[]:{};let l=0;for(let u=0;u<i;u++){const f=n?u:o[u];s[f]=LR(e[f],t[f]),s[f]===e[f]&&l++}return r===i&&l===r?e:s}return t}function Vy(e,t){if(e&&!t||t&&!e)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function nC(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Wy(e){if(!rC(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!rC(n)||!n.hasOwnProperty("isPrototypeOf"))}function rC(e){return Object.prototype.toString.call(e)==="[object Object]"}function FR(e){return new Promise(t=>{setTimeout(t,e)})}function oC(e){FR(0).then(e)}function Hy(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?LR(e,t):t}function tL(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function nL(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ya,ss,Fl,p$,rL=(p$=class extends Od{constructor(){super();ke(this,ya,void 0);ke(this,ss,void 0);ke(this,Fl,void 0);we(this,Fl,t=>{if(!sc&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){j(this,ss)||this.setEventListener(j(this,Fl))}onUnsubscribe(){var t;this.hasListeners()||((t=j(this,ss))==null||t.call(this),we(this,ss,void 0))}setEventListener(t){var n;we(this,Fl,t),(n=j(this,ss))==null||n.call(this),we(this,ss,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){j(this,ya)!==t&&(we(this,ya,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof j(this,ya)=="boolean"?j(this,ya):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ya=new WeakMap,ss=new WeakMap,Fl=new WeakMap,p$),Np=new rL,jl,as,Bl,m$,oL=(m$=class extends Od{constructor(){super();ke(this,jl,!0);ke(this,as,void 0);ke(this,Bl,void 0);we(this,Bl,t=>{if(!sc&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){j(this,as)||this.setEventListener(j(this,Bl))}onUnsubscribe(){var t;this.hasListeners()||((t=j(this,as))==null||t.call(this),we(this,as,void 0))}setEventListener(t){var n;we(this,Bl,t),(n=j(this,as))==null||n.call(this),we(this,as,t(this.setOnline.bind(this)))}setOnline(t){j(this,jl)!==t&&(we(this,jl,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return j(this,jl)}},jl=new WeakMap,as=new WeakMap,Bl=new WeakMap,m$),Dp=new oL;function iL(e){return Math.min(1e3*2**e,3e4)}function Am(e){return(e??"online")==="online"?Dp.isOnline():!0}var jR=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function m0(e){return e instanceof jR}function BR(e){let t=!1,n=0,r=!1,o,i,s;const l=new Promise((E,_)=>{i=E,s=_}),u=E=>{var _;r||(y(new jR(E)),(_=e.abort)==null||_.call(e))},f=()=>{t=!0},m=()=>{t=!1},p=()=>!Np.isFocused()||e.networkMode!=="always"&&!Dp.isOnline(),g=E=>{var _;r||(r=!0,(_=e.onSuccess)==null||_.call(e,E),o==null||o(),i(E))},y=E=>{var _;r||(r=!0,(_=e.onError)==null||_.call(e,E),o==null||o(),s(E))},x=()=>new Promise(E=>{var _;o=b=>{const C=r||!p();return C&&E(b),C},(_=e.onPause)==null||_.call(e)}).then(()=>{var E;o=void 0,r||(E=e.onContinue)==null||E.call(e)}),S=()=>{if(r)return;let E;try{E=e.fn()}catch(_){E=Promise.reject(_)}Promise.resolve(E).then(g).catch(_=>{var O;if(r)return;const b=e.retry??(sc?0:3),C=e.retryDelay??iL,R=typeof C=="function"?C(n,_):C,k=b===!0||typeof b=="number"&&n<b||typeof b=="function"&&b(n,_);if(t||!k){y(_);return}n++,(O=e.onFail)==null||O.call(e,n,_),FR(R).then(()=>{if(p())return x()}).then(()=>{t?y(_):S()})})};return Am(e.networkMode)?S():x().then(S),{promise:l,cancel:u,continue:()=>(o==null?void 0:o())?l:Promise.resolve(),cancelRetry:f,continueRetry:m}}function sL(){let e=[],t=0,n=m=>{m()},r=m=>{m()};const o=m=>{let p;t++;try{p=m()}finally{t--,t||l()}return p},i=m=>{t?e.push(m):oC(()=>{n(m)})},s=m=>(...p)=>{i(()=>{m(...p)})},l=()=>{const m=e;e=[],m.length&&oC(()=>{r(()=>{m.forEach(p=>{n(p)})})})};return{batch:o,batchCalls:s,schedule:i,setNotifyFunction:m=>{n=m},setBatchNotifyFunction:m=>{r=m}}}var gn=sL(),wa,g$,zR=(g$=class{constructor(){ke(this,wa,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Uy(this.gcTime)&&we(this,wa,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(sc?1/0:5*60*1e3))}clearGcTimeout(){j(this,wa)&&(clearTimeout(j(this,wa)),we(this,wa,void 0))}},wa=new WeakMap,g$),zl,Ul,Nr,ls,Dr,cn,vd,xa,Vl,Hh,fo,pi,v$,aL=(v$=class extends zR{constructor(t){super();ke(this,Vl);ke(this,fo);ke(this,zl,void 0);ke(this,Ul,void 0);ke(this,Nr,void 0);ke(this,ls,void 0);ke(this,Dr,void 0);ke(this,cn,void 0);ke(this,vd,void 0);ke(this,xa,void 0);we(this,xa,!1),we(this,vd,t.defaultOptions),tt(this,Vl,Hh).call(this,t.options),we(this,cn,[]),we(this,Nr,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,we(this,zl,t.state||lL(this.options)),this.state=j(this,zl),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!j(this,cn).length&&this.state.fetchStatus==="idle"&&j(this,Nr).remove(this)}setData(t,n){const r=Hy(this.state.data,t,this.options);return tt(this,fo,pi).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){tt(this,fo,pi).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r;const n=j(this,ls);return(r=j(this,Dr))==null||r.cancel(t),n?n.then(Lr).catch(Lr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(j(this,zl))}isActive(){return j(this,cn).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||j(this,cn).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!IR(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=j(this,cn).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=j(this,Dr))==null||n.continue()}onOnline(){var n;const t=j(this,cn).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=j(this,Dr))==null||n.continue()}addObserver(t){j(this,cn).includes(t)||(j(this,cn).push(t),this.clearGcTimeout(),j(this,Nr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){j(this,cn).includes(t)&&(we(this,cn,j(this,cn).filter(n=>n!==t)),j(this,cn).length||(j(this,Dr)&&(j(this,xa)?j(this,Dr).cancel({revert:!0}):j(this,Dr).cancelRetry()),this.scheduleGc()),j(this,Nr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return j(this,cn).length}invalidate(){this.state.isInvalidated||tt(this,fo,pi).call(this,{type:"invalidate"})}fetch(t,n){var f,m,p,g;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(j(this,ls))return(f=j(this,Dr))==null||f.continueRetry(),j(this,ls)}if(t&&tt(this,Vl,Hh).call(this,t),!this.options.queryFn){const y=j(this,cn).find(x=>x.options.queryFn);y&&tt(this,Vl,Hh).call(this,y.options)}const r=new AbortController,o={queryKey:this.queryKey,meta:this.meta},i=y=>{Object.defineProperty(y,"signal",{enumerable:!0,get:()=>(we(this,xa,!0),r.signal)})};i(o);const s=()=>this.options.queryFn?(we(this,xa,!1),this.options.persister?this.options.persister(this.options.queryFn,o,this):this.options.queryFn(o)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),l={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(l),(m=this.options.behavior)==null||m.onFetch(l,this),we(this,Ul,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((p=l.fetchOptions)==null?void 0:p.meta))&&tt(this,fo,pi).call(this,{type:"fetch",meta:(g=l.fetchOptions)==null?void 0:g.meta});const u=y=>{var x,S,E,_;m0(y)&&y.silent||tt(this,fo,pi).call(this,{type:"error",error:y}),m0(y)||((S=(x=j(this,Nr).config).onError)==null||S.call(x,y,this),(_=(E=j(this,Nr).config).onSettled)==null||_.call(E,this.state.data,y,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return we(this,Dr,BR({fn:l.fetchFn,abort:r.abort.bind(r),onSuccess:y=>{var x,S,E,_;if(typeof y>"u"){u(new Error(`${this.queryHash} data is undefined`));return}this.setData(y),(S=(x=j(this,Nr).config).onSuccess)==null||S.call(x,y,this),(_=(E=j(this,Nr).config).onSettled)==null||_.call(E,y,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:u,onFail:(y,x)=>{tt(this,fo,pi).call(this,{type:"failed",failureCount:y,error:x})},onPause:()=>{tt(this,fo,pi).call(this,{type:"pause"})},onContinue:()=>{tt(this,fo,pi).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode})),we(this,ls,j(this,Dr).promise),j(this,ls)}},zl=new WeakMap,Ul=new WeakMap,Nr=new WeakMap,ls=new WeakMap,Dr=new WeakMap,cn=new WeakMap,vd=new WeakMap,xa=new WeakMap,Vl=new WeakSet,Hh=function(t){this.options={...j(this,vd),...t},this.updateGcTime(this.options.gcTime)},fo=new WeakSet,pi=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:t.meta??null,fetchStatus:Am(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return m0(o)&&o.revert&&j(this,Ul)?{...j(this,Ul),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),gn.batch(()=>{j(this,cn).forEach(r=>{r.onQueryUpdate()}),j(this,Nr).notify({query:this,type:"updated",action:t})})},v$);function lL(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Do,y$,cL=(y$=class extends Od{constructor(t={}){super();ke(this,Do,void 0);this.config=t,we(this,Do,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??ex(o,n);let s=this.get(i);return s||(s=new aL({cache:this,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){j(this,Do).has(t.queryHash)||(j(this,Do).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=j(this,Do).get(t.queryHash);n&&(t.destroy(),n===t&&j(this,Do).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){gn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return j(this,Do).get(t)}getAll(){return[...j(this,Do).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>eC(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>eC(t,r)):n}notify(t){gn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){gn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){gn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Do=new WeakMap,y$),Io,yd,fr,Wl,Lo,es,w$,uL=(w$=class extends zR{constructor(t){super();ke(this,Lo);ke(this,Io,void 0);ke(this,yd,void 0);ke(this,fr,void 0);ke(this,Wl,void 0);this.mutationId=t.mutationId,we(this,yd,t.defaultOptions),we(this,fr,t.mutationCache),we(this,Io,[]),this.state=t.state||dL(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...j(this,yd),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){j(this,Io).includes(t)||(j(this,Io).push(t),this.clearGcTimeout(),j(this,fr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){we(this,Io,j(this,Io).filter(n=>n!==t)),this.scheduleGc(),j(this,fr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){j(this,Io).length||(this.state.status==="pending"?this.scheduleGc():j(this,fr).remove(this))}continue(){var t;return((t=j(this,Wl))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,l,u,f,m,p,g,y,x,S,E,_,b,C,R,k,O,A;const n=()=>(we(this,Wl,BR({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(I,z)=>{tt(this,Lo,es).call(this,{type:"failed",failureCount:I,error:z})},onPause:()=>{tt(this,Lo,es).call(this,{type:"pause"})},onContinue:()=>{tt(this,Lo,es).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),j(this,Wl).promise),r=this.state.status==="pending";try{if(!r){tt(this,Lo,es).call(this,{type:"pending",variables:t}),await((i=(o=j(this,fr).config).onMutate)==null?void 0:i.call(o,t,this));const z=await((l=(s=this.options).onMutate)==null?void 0:l.call(s,t));z!==this.state.context&&tt(this,Lo,es).call(this,{type:"pending",context:z,variables:t})}const I=await n();return await((f=(u=j(this,fr).config).onSuccess)==null?void 0:f.call(u,I,t,this.state.context,this)),await((p=(m=this.options).onSuccess)==null?void 0:p.call(m,I,t,this.state.context)),await((y=(g=j(this,fr).config).onSettled)==null?void 0:y.call(g,I,null,this.state.variables,this.state.context,this)),await((S=(x=this.options).onSettled)==null?void 0:S.call(x,I,null,t,this.state.context)),tt(this,Lo,es).call(this,{type:"success",data:I}),I}catch(I){try{throw await((_=(E=j(this,fr).config).onError)==null?void 0:_.call(E,I,t,this.state.context,this)),await((C=(b=this.options).onError)==null?void 0:C.call(b,I,t,this.state.context)),await((k=(R=j(this,fr).config).onSettled)==null?void 0:k.call(R,void 0,I,this.state.variables,this.state.context,this)),await((A=(O=this.options).onSettled)==null?void 0:A.call(O,void 0,I,t,this.state.context)),I}finally{tt(this,Lo,es).call(this,{type:"error",error:I})}}}},Io=new WeakMap,yd=new WeakMap,fr=new WeakMap,Wl=new WeakMap,Lo=new WeakSet,es=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!Am(this.options.networkMode),status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),gn.batch(()=>{j(this,Io).forEach(r=>{r.onMutationUpdate(t)}),j(this,fr).notify({mutation:this,type:"updated",action:t})})},w$);function dL(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ir,wd,ba,x$,fL=(x$=class extends Od{constructor(t={}){super();ke(this,Ir,void 0);ke(this,wd,void 0);ke(this,ba,void 0);this.config=t,we(this,Ir,[]),we(this,wd,0)}build(t,n,r){const o=new uL({mutationCache:this,mutationId:++Yf(this,wd)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){j(this,Ir).push(t),this.notify({type:"added",mutation:t})}remove(t){we(this,Ir,j(this,Ir).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){gn.batch(()=>{j(this,Ir).forEach(t=>{this.remove(t)})})}getAll(){return j(this,Ir)}find(t){const n={exact:!0,...t};return j(this,Ir).find(r=>tC(n,r))}findAll(t={}){return j(this,Ir).filter(n=>tC(t,n))}notify(t){gn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return we(this,ba,(j(this,ba)??Promise.resolve()).then(()=>{const t=j(this,Ir).filter(n=>n.state.isPaused);return gn.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(Lr)),Promise.resolve()))}).then(()=>{we(this,ba,void 0)})),j(this,ba)}},Ir=new WeakMap,wd=new WeakMap,ba=new WeakMap,x$);function hL(e){return{onFetch:(t,n)=>{const r=async()=>{var x,S,E,_,b;const o=t.options,i=(E=(S=(x=t.fetchOptions)==null?void 0:x.meta)==null?void 0:S.fetchMore)==null?void 0:E.direction,s=((_=t.state.data)==null?void 0:_.pages)||[],l=((b=t.state.data)==null?void 0:b.pageParams)||[],u={pages:[],pageParams:[]};let f=!1;const m=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(t.signal.aborted?f=!0:t.signal.addEventListener("abort",()=>{f=!0}),t.signal)})},p=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),g=async(C,R,k)=>{if(f)return Promise.reject();if(R==null&&C.pages.length)return Promise.resolve(C);const O={queryKey:t.queryKey,pageParam:R,direction:k?"backward":"forward",meta:t.options.meta};m(O);const A=await p(O),{maxPages:I}=t.options,z=k?nL:tL;return{pages:z(C.pages,A,I),pageParams:z(C.pageParams,R,I)}};let y;if(i&&s.length){const C=i==="backward",R=C?pL:iC,k={pages:s,pageParams:l},O=R(o,k);y=await g(k,O,C)}else{y=await g(u,l[0]??o.initialPageParam);const C=e??s.length;for(let R=1;R<C;R++){const k=iC(o,y);y=await g(y,k)}}return y};t.options.persister?t.fetchFn=()=>{var o,i;return(i=(o=t.options).persister)==null?void 0:i.call(o,r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=r}}}function iC(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function pL(e,{pages:t,pageParams:n}){var r;return(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n)}var nn,cs,us,Hl,Kl,ds,Gl,Yl,b$,mL=(b$=class{constructor(e={}){ke(this,nn,void 0);ke(this,cs,void 0);ke(this,us,void 0);ke(this,Hl,void 0);ke(this,Kl,void 0);ke(this,ds,void 0);ke(this,Gl,void 0);ke(this,Yl,void 0);we(this,nn,e.queryCache||new cL),we(this,cs,e.mutationCache||new fL),we(this,us,e.defaultOptions||{}),we(this,Hl,new Map),we(this,Kl,new Map),we(this,ds,0)}mount(){Yf(this,ds)._++,j(this,ds)===1&&(we(this,Gl,Np.subscribe(()=>{Np.isFocused()&&(this.resumePausedMutations(),j(this,nn).onFocus())})),we(this,Yl,Dp.subscribe(()=>{Dp.isOnline()&&(this.resumePausedMutations(),j(this,nn).onOnline())})))}unmount(){var e,t;Yf(this,ds)._--,j(this,ds)===0&&((e=j(this,Gl))==null||e.call(this),we(this,Gl,void 0),(t=j(this,Yl))==null||t.call(this),we(this,Yl,void 0))}isFetching(e){return j(this,nn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return j(this,cs).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=j(this,nn).find({queryKey:e}))==null?void 0:t.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);return t!==void 0?Promise.resolve(t):this.fetchQuery(e)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=j(this,nn).find({queryKey:e}),o=r==null?void 0:r.state.data,i=eL(t,o);if(typeof i>"u")return;const s=this.defaultQueryOptions({queryKey:e});return j(this,nn).build(this,s).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return gn.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var t;return(t=j(this,nn).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=j(this,nn);gn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=j(this,nn),r={type:"active",...e};return gn.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=gn.batch(()=>j(this,nn).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Lr).catch(Lr)}invalidateQueries(e={},t={}){return gn.batch(()=>{if(j(this,nn).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=gn.batch(()=>j(this,nn).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(Lr)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Lr)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const n=j(this,nn).build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Lr).catch(Lr)}fetchInfiniteQuery(e){return e.behavior=hL(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Lr).catch(Lr)}resumePausedMutations(){return j(this,cs).resumePausedMutations()}getQueryCache(){return j(this,nn)}getMutationCache(){return j(this,cs)}getDefaultOptions(){return j(this,us)}setDefaultOptions(e){we(this,us,e)}setQueryDefaults(e,t){j(this,Hl).set(td(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...j(this,Hl).values()];let n={};return t.forEach(r=>{nd(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){j(this,Kl).set(td(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...j(this,Kl).values()];let n={};return t.forEach(r=>{nd(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...j(this,us).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=ex(t.queryKey,t)),typeof t.refetchOnReconnect>"u"&&(t.refetchOnReconnect=t.networkMode!=="always"),typeof t.throwOnError>"u"&&(t.throwOnError=!!t.suspense),typeof t.networkMode>"u"&&t.persister&&(t.networkMode="offlineFirst"),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...j(this,us).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){j(this,nn).clear(),j(this,cs).clear()}},nn=new WeakMap,cs=new WeakMap,us=new WeakMap,Hl=new WeakMap,Kl=new WeakMap,ds=new WeakMap,Gl=new WeakMap,Yl=new WeakMap,b$),Gn,$t,Xl,Cn,Sa,Zl,Fo,xd,ql,Ql,_a,Ea,fs,Ca,$a,xu,bd,Ky,Sd,Gy,_d,Yy,Ed,Xy,Cd,Zy,$d,qy,Rd,Qy,hm,UR,S$,gL=(S$=class extends Od{constructor(t,n){super();ke(this,$a);ke(this,bd);ke(this,Sd);ke(this,_d);ke(this,Ed);ke(this,Cd);ke(this,$d);ke(this,Rd);ke(this,hm);ke(this,Gn,void 0);ke(this,$t,void 0);ke(this,Xl,void 0);ke(this,Cn,void 0);ke(this,Sa,void 0);ke(this,Zl,void 0);ke(this,Fo,void 0);ke(this,xd,void 0);ke(this,ql,void 0);ke(this,Ql,void 0);ke(this,_a,void 0);ke(this,Ea,void 0);ke(this,fs,void 0);ke(this,Ca,void 0);we(this,$t,void 0),we(this,Xl,void 0),we(this,Cn,void 0),we(this,Ca,new Set),we(this,Gn,t),this.options=n,we(this,Fo,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(j(this,$t).addObserver(this),sC(j(this,$t),this.options)?tt(this,$a,xu).call(this):this.updateResult(),tt(this,Ed,Xy).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Jy(j(this,$t),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Jy(j(this,$t),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,tt(this,Cd,Zy).call(this),tt(this,$d,qy).call(this),j(this,$t).removeObserver(this)}setOptions(t,n){const r=this.options,o=j(this,$t);if(this.options=j(this,Gn).defaultQueryOptions(t),Vy(r,this.options)||j(this,Gn).getQueryCache().notify({type:"observerOptionsUpdated",query:j(this,$t),observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),tt(this,Rd,Qy).call(this);const i=this.hasListeners();i&&aC(j(this,$t),o,this.options,r)&&tt(this,$a,xu).call(this),this.updateResult(n),i&&(j(this,$t)!==o||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&tt(this,bd,Ky).call(this);const s=tt(this,Sd,Gy).call(this);i&&(j(this,$t)!==o||this.options.enabled!==r.enabled||s!==j(this,fs))&&tt(this,_d,Yy).call(this,s)}getOptimisticResult(t){const n=j(this,Gn).getQueryCache().build(j(this,Gn),t),r=this.createResult(n,t);return yL(this,r)&&(we(this,Cn,r),we(this,Zl,this.options),we(this,Sa,j(this,$t).state)),r}getCurrentResult(){return j(this,Cn)}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(j(this,Ca).add(r),t[r])})}),n}getCurrentQuery(){return j(this,$t)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=j(this,Gn).defaultQueryOptions(t),r=j(this,Gn).getQueryCache().build(j(this,Gn),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return tt(this,$a,xu).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),j(this,Cn)))}createResult(t,n){var O;const r=j(this,$t),o=this.options,i=j(this,Cn),s=j(this,Sa),l=j(this,Zl),f=t!==r?t.state:j(this,Xl),{state:m}=t;let{error:p,errorUpdatedAt:g,fetchStatus:y,status:x}=m,S=!1,E;if(n._optimisticResults){const A=this.hasListeners(),I=!A&&sC(t,n),z=A&&aC(t,r,n,o);(I||z)&&(y=Am(t.options.networkMode)?"fetching":"paused",m.dataUpdatedAt||(x="pending")),n._optimisticResults==="isRestoring"&&(y="idle")}if(n.select&&typeof m.data<"u")if(i&&m.data===(s==null?void 0:s.data)&&n.select===j(this,xd))E=j(this,ql);else try{we(this,xd,n.select),E=n.select(m.data),E=Hy(i==null?void 0:i.data,E,n),we(this,ql,E),we(this,Fo,null)}catch(A){we(this,Fo,A)}else E=m.data;if(typeof n.placeholderData<"u"&&typeof E>"u"&&x==="pending"){let A;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData))A=i.data;else if(A=typeof n.placeholderData=="function"?n.placeholderData((O=j(this,Ql))==null?void 0:O.state.data,j(this,Ql)):n.placeholderData,n.select&&typeof A<"u")try{A=n.select(A),we(this,Fo,null)}catch(I){we(this,Fo,I)}typeof A<"u"&&(x="success",E=Hy(i==null?void 0:i.data,A,n),S=!0)}j(this,Fo)&&(p=j(this,Fo),E=j(this,ql),g=Date.now(),x="error");const _=y==="fetching",b=x==="pending",C=x==="error",R=b&&_;return{status:x,fetchStatus:y,isPending:b,isSuccess:x==="success",isError:C,isInitialLoading:R,isLoading:R,data:E,dataUpdatedAt:m.dataUpdatedAt,error:p,errorUpdatedAt:g,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:m.dataUpdateCount>0||m.errorUpdateCount>0,isFetchedAfterMount:m.dataUpdateCount>f.dataUpdateCount||m.errorUpdateCount>f.errorUpdateCount,isFetching:_,isRefetching:_&&!b,isLoadingError:C&&m.dataUpdatedAt===0,isPaused:y==="paused",isPlaceholderData:S,isRefetchError:C&&m.dataUpdatedAt!==0,isStale:tx(t,n),refetch:this.refetch}}updateResult(t){const n=j(this,Cn),r=this.createResult(j(this,$t),this.options);if(we(this,Sa,j(this,$t).state),we(this,Zl,this.options),j(this,Sa).data!==void 0&&we(this,Ql,j(this,$t)),Vy(r,n))return;we(this,Cn,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,l=typeof s=="function"?s():s;if(l==="all"||!l&&!j(this,Ca).size)return!0;const u=new Set(l??j(this,Ca));return this.options.throwOnError&&u.add("error"),Object.keys(j(this,Cn)).some(f=>{const m=f;return j(this,Cn)[m]!==n[m]&&u.has(m)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),tt(this,hm,UR).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&tt(this,Ed,Xy).call(this)}},Gn=new WeakMap,$t=new WeakMap,Xl=new WeakMap,Cn=new WeakMap,Sa=new WeakMap,Zl=new WeakMap,Fo=new WeakMap,xd=new WeakMap,ql=new WeakMap,Ql=new WeakMap,_a=new WeakMap,Ea=new WeakMap,fs=new WeakMap,Ca=new WeakMap,$a=new WeakSet,xu=function(t){tt(this,Rd,Qy).call(this);let n=j(this,$t).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Lr)),n},bd=new WeakSet,Ky=function(){if(tt(this,Cd,Zy).call(this),sc||j(this,Cn).isStale||!Uy(this.options.staleTime))return;const n=IR(j(this,Cn).dataUpdatedAt,this.options.staleTime)+1;we(this,_a,setTimeout(()=>{j(this,Cn).isStale||this.updateResult()},n))},Sd=new WeakSet,Gy=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(j(this,$t)):this.options.refetchInterval)??!1},_d=new WeakSet,Yy=function(t){tt(this,$d,qy).call(this),we(this,fs,t),!(sc||this.options.enabled===!1||!Uy(j(this,fs))||j(this,fs)===0)&&we(this,Ea,setInterval(()=>{(this.options.refetchIntervalInBackground||Np.isFocused())&&tt(this,$a,xu).call(this)},j(this,fs)))},Ed=new WeakSet,Xy=function(){tt(this,bd,Ky).call(this),tt(this,_d,Yy).call(this,tt(this,Sd,Gy).call(this))},Cd=new WeakSet,Zy=function(){j(this,_a)&&(clearTimeout(j(this,_a)),we(this,_a,void 0))},$d=new WeakSet,qy=function(){j(this,Ea)&&(clearInterval(j(this,Ea)),we(this,Ea,void 0))},Rd=new WeakSet,Qy=function(){const t=j(this,Gn).getQueryCache().build(j(this,Gn),this.options);if(t===j(this,$t))return;const n=j(this,$t);we(this,$t,t),we(this,Xl,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},hm=new WeakSet,UR=function(t){gn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(j(this,Cn))}),j(this,Gn).getQueryCache().notify({query:j(this,$t),type:"observerResultsUpdated"})})},S$);function vL(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function sC(e,t){return vL(e,t)||e.state.dataUpdatedAt>0&&Jy(e,t,t.refetchOnMount)}function Jy(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&tx(e,t)}return!1}function aC(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&tx(e,n)}function tx(e,t){return e.isStaleByTime(t.staleTime)}function yL(e,t){return!Vy(e.getCurrentResult(),t)}var VR=d.createContext(void 0),wL=e=>{const t=d.useContext(VR);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},xL=({client:e,children:t})=>(d.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),d.createElement(VR.Provider,{value:e},t)),WR=d.createContext(!1),bL=()=>d.useContext(WR);WR.Provider;function SL(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var _L=d.createContext(SL()),EL=()=>d.useContext(_L);function CL(e,t){return typeof e=="function"?e(...t):!!e}var $L=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},RL=e=>{d.useEffect(()=>{e.clearReset()},[e])},PL=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&CL(n,[e.error,r]),TL=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},kL=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,AL=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function ML(e,t,n){const r=wL(n),o=bL(),i=EL(),s=r.defaultQueryOptions(e);s._optimisticResults=o?"isRestoring":"optimistic",TL(s),$L(s,i),RL(i);const[l]=d.useState(()=>new t(r,s)),u=l.getOptimisticResult(s);if(d.useSyncExternalStore(d.useCallback(f=>{const m=o?()=>{}:l.subscribe(gn.batchCalls(f));return l.updateResult(),m},[l,o]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),d.useEffect(()=>{l.setOptions(s,{listeners:!1})},[s,l]),kL(s,u))throw l.setOptions(s,{listeners:!1}),AL(s,l,i);if(PL({result:u,errorResetBoundary:i,throwOnError:s.throwOnError,query:l.getCurrentQuery()}))throw u.error;return s.notifyOnChangeProps?u:l.trackResult(u)}function OL(e,t){return ML(e,gL,t)}var Oo=(e=>(e.RemoveBG="RemoveBG",e.AnimeSeg="AnimeSeg",e.RealESRGAN="RealESRGAN",e.GFPGAN="GFPGAN",e.RestoreFormer="RestoreFormer",e.InteractiveSeg="InteractiveSeg",e))(Oo||{}),Ps=(e=>(e.NAME="name",e.CTIME="ctime",e.MTIME="mtime",e))(Ps||{}),Ou=(e=>(e.DESCENDING="desc",e.ASCENDING="asc",e))(Ou||{}),nx=(e=>(e.ddim="ddim",e.plms="plms",e))(nx||{}),rx=(e=>(e.INPAINT_NS="INPAINT_NS",e.INPAINT_TELEA="INPAINT_TELEA",e))(rx||{}),Ln=(e=>(e.x="x",e.y="y",e.xy="xy",e))(Ln||{}),ma=(e=>(e.text_guided="text-guided",e.shape_guided="shape-guided",e.context_aware="context-aware",e.object_remove="object-remove",e.outpainting="outpainting",e))(ma||{});function HR(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=HR(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function KR(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=HR(e))&&(r&&(r+=" "),r+=t);return r}const ox="-";function NL(e){const t=IL(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function o(s){const l=s.split(ox);return l[0]===""&&l.length!==1&&l.shift(),GR(l,t)||DL(s)}function i(s,l){const u=n[s]||[];return l&&r[s]?[...u,...r[s]]:u}return{getClassGroupId:o,getConflictingClassGroupIds:i}}function GR(e,t){var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?GR(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(ox);return(s=t.validators.find(({validator:l})=>l(i)))==null?void 0:s.classGroupId}const lC=/^\[(.+)\]$/;function DL(e){if(lC.test(e)){const t=lC.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function IL(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return FL(Object.entries(e.classGroups),n).forEach(([i,s])=>{e1(s,r,i,t)}),r}function e1(e,t,n,r){e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:cC(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(LL(o)){e1(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{e1(s,cC(t,i),n,r)})})}function cC(e,t){let n=e;return t.split(ox).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function LL(e){return e.isThemeGetter}function FL(e,t){return t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,l])=>[t+s,l])):i);return[n,o]}):e}function jL(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function o(i,s){n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map)}return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}}const YR="!";function BL(e){const t=e.separator,n=t.length===1,r=t[0],o=t.length;return function(s){const l=[];let u=0,f=0,m;for(let S=0;S<s.length;S++){let E=s[S];if(u===0){if(E===r&&(n||s.slice(S,S+o)===t)){l.push(s.slice(f,S)),f=S+o;continue}if(E==="/"){m=S;continue}}E==="["?u++:E==="]"&&u--}const p=l.length===0?s:s.substring(f),g=p.startsWith(YR),y=g?p.substring(1):p,x=m&&m>f?m-f:void 0;return{modifiers:l,hasImportantModifier:g,baseClassName:y,maybePostfixModifierPosition:x}}}function zL(e){if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t}function UL(e){return{cache:jL(e.cacheSize),splitModifiers:BL(e),...NL(e)}}const VL=/\s+/;function WL(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=new Set;return e.trim().split(VL).map(s=>{const{modifiers:l,hasImportantModifier:u,baseClassName:f,maybePostfixModifierPosition:m}=n(s);let p=r(m?f.substring(0,m):f),g=!!m;if(!p){if(!m)return{isTailwindClass:!1,originalClassName:s};if(p=r(f),!p)return{isTailwindClass:!1,originalClassName:s};g=!1}const y=zL(l).join(":");return{isTailwindClass:!0,modifierId:u?y+YR:y,classGroupId:p,originalClassName:s,hasPostfixModifier:g}}).reverse().filter(s=>{if(!s.isTailwindClass)return!0;const{modifierId:l,classGroupId:u,hasPostfixModifier:f}=s,m=l+u;return i.has(m)?!1:(i.add(m),o(u,f).forEach(p=>i.add(l+p)),!0)}).reverse().map(s=>s.originalClassName).join(" ")}function HL(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=XR(t))&&(r&&(r+=" "),r+=n);return r}function XR(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=XR(e[r]))&&(n&&(n+=" "),n+=t);return n}function KL(e,...t){let n,r,o,i=s;function s(u){const f=t.reduce((m,p)=>p(m),e());return n=UL(f),r=n.cache.get,o=n.cache.set,i=l,l(u)}function l(u){const f=r(u);if(f)return f;const m=WL(u,n);return o(u,m),m}return function(){return i(HL.apply(null,arguments))}}function Tt(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const ZR=/^\[(?:([a-z-]+):)?(.+)\]$/i,GL=/^\d+\/\d+$/,YL=new Set(["px","full","screen"]),XL=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ZL=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,qL=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,QL=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function lo(e){return ga(e)||YL.has(e)||GL.test(e)}function Zi(e){return _c(e,"length",sF)}function ga(e){return!!e&&!Number.isNaN(Number(e))}function fh(e){return _c(e,"number",ga)}function au(e){return!!e&&Number.isInteger(Number(e))}function JL(e){return e.endsWith("%")&&ga(e.slice(0,-1))}function Je(e){return ZR.test(e)}function qi(e){return XL.test(e)}const eF=new Set(["length","size","percentage"]);function tF(e){return _c(e,eF,qR)}function nF(e){return _c(e,"position",qR)}const rF=new Set(["image","url"]);function oF(e){return _c(e,rF,lF)}function iF(e){return _c(e,"",aF)}function lu(){return!0}function _c(e,t,n){const r=ZR.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function sF(e){return ZL.test(e)}function qR(){return!1}function aF(e){return qL.test(e)}function lF(e){return QL.test(e)}function cF(){const e=Tt("colors"),t=Tt("spacing"),n=Tt("blur"),r=Tt("brightness"),o=Tt("borderColor"),i=Tt("borderRadius"),s=Tt("borderSpacing"),l=Tt("borderWidth"),u=Tt("contrast"),f=Tt("grayscale"),m=Tt("hueRotate"),p=Tt("invert"),g=Tt("gap"),y=Tt("gradientColorStops"),x=Tt("gradientColorStopPositions"),S=Tt("inset"),E=Tt("margin"),_=Tt("opacity"),b=Tt("padding"),C=Tt("saturate"),R=Tt("scale"),k=Tt("sepia"),O=Tt("skew"),A=Tt("space"),I=Tt("translate"),z=()=>["auto","contain","none"],H=()=>["auto","hidden","clip","visible","scroll"],ie=()=>["auto",Je,t],K=()=>[Je,t],te=()=>["",lo,Zi],U=()=>["auto",ga,Je],re=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],V=()=>["solid","dashed","dotted","double","none"],J=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],G=()=>["start","end","center","between","around","evenly","stretch"],Z=()=>["","0",Je],Q=()=>["auto","avoid","all","avoid-page","page","left","right","column"],le=()=>[ga,fh],L=()=>[ga,Je];return{cacheSize:500,separator:":",theme:{colors:[lu],spacing:[lo,Zi],blur:["none","",qi,Je],brightness:le(),borderColor:[e],borderRadius:["none","","full",qi,Je],borderSpacing:K(),borderWidth:te(),contrast:le(),grayscale:Z(),hueRotate:L(),invert:Z(),gap:K(),gradientColorStops:[e],gradientColorStopPositions:[JL,Zi],inset:ie(),margin:ie(),opacity:le(),padding:K(),saturate:le(),scale:le(),sepia:Z(),skew:L(),space:K(),translate:K()},classGroups:{aspect:[{aspect:["auto","square","video",Je]}],container:["container"],columns:[{columns:[qi]}],"break-after":[{"break-after":Q()}],"break-before":[{"break-before":Q()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none"]}],clear:[{clear:["left","right","both","none"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...re(),Je]}],overflow:[{overflow:H()}],"overflow-x":[{"overflow-x":H()}],"overflow-y":[{"overflow-y":H()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[S]}],"inset-x":[{"inset-x":[S]}],"inset-y":[{"inset-y":[S]}],start:[{start:[S]}],end:[{end:[S]}],top:[{top:[S]}],right:[{right:[S]}],bottom:[{bottom:[S]}],left:[{left:[S]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",au,Je]}],basis:[{basis:ie()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Je]}],grow:[{grow:Z()}],shrink:[{shrink:Z()}],order:[{order:["first","last","none",au,Je]}],"grid-cols":[{"grid-cols":[lu]}],"col-start-end":[{col:["auto",{span:["full",au,Je]},Je]}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":[lu]}],"row-start-end":[{row:["auto",{span:[au,Je]},Je]}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Je]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Je]}],gap:[{gap:[g]}],"gap-x":[{"gap-x":[g]}],"gap-y":[{"gap-y":[g]}],"justify-content":[{justify:["normal",...G()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...G(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...G(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[E]}],mx:[{mx:[E]}],my:[{my:[E]}],ms:[{ms:[E]}],me:[{me:[E]}],mt:[{mt:[E]}],mr:[{mr:[E]}],mb:[{mb:[E]}],ml:[{ml:[E]}],"space-x":[{"space-x":[A]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[A]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit",Je,t]}],"min-w":[{"min-w":["min","max","fit",Je,lo]}],"max-w":[{"max-w":["0","none","full","min","max","fit","prose",{screen:[qi]},qi,Je]}],h:[{h:[Je,t,"auto","min","max","fit"]}],"min-h":[{"min-h":["min","max","fit",lo,Je]}],"max-h":[{"max-h":[Je,t,"min","max","fit"]}],"font-size":[{text:["base",qi,Zi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",fh]}],"font-family":[{font:[lu]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Je]}],"line-clamp":[{"line-clamp":["none",ga,fh]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",lo,Je]}],"list-image":[{"list-image":["none",Je]}],"list-style-type":[{list:["none","disc","decimal",Je]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[_]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[_]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...V(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",lo,Zi]}],"underline-offset":[{"underline-offset":["auto",lo,Je]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],indent:[{indent:K()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Je]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Je]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[_]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...re(),nF]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",tF]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},oF]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[y]}],"gradient-via":[{via:[y]}],"gradient-to":[{to:[y]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[_]}],"border-style":[{border:[...V(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[_]}],"divide-style":[{divide:V()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...V()]}],"outline-offset":[{"outline-offset":[lo,Je]}],"outline-w":[{outline:[lo,Zi]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[_]}],"ring-offset-w":[{"ring-offset":[lo,Zi]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",qi,iF]}],"shadow-color":[{shadow:[lu]}],opacity:[{opacity:[_]}],"mix-blend":[{"mix-blend":J()}],"bg-blend":[{"bg-blend":J()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",qi,Je]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[m]}],invert:[{invert:[p]}],saturate:[{saturate:[C]}],sepia:[{sepia:[k]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[m]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[_]}],"backdrop-saturate":[{"backdrop-saturate":[C]}],"backdrop-sepia":[{"backdrop-sepia":[k]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Je]}],duration:[{duration:L()}],ease:[{ease:["linear","in","out","in-out",Je]}],delay:[{delay:L()}],animate:[{animate:["none","spin","ping","pulse","bounce",Je]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[R]}],"scale-x":[{"scale-x":[R]}],"scale-y":[{"scale-y":[R]}],rotate:[{rotate:[au,Je]}],"translate-x":[{"translate-x":[I]}],"translate-y":[{"translate-y":[I]}],"skew-x":[{"skew-x":[O]}],"skew-y":[{"skew-y":[O]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Je]}],accent:[{accent:["auto",e]}],appearance:["appearance-none"],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Je]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":K()}],"scroll-mx":[{"scroll-mx":K()}],"scroll-my":[{"scroll-my":K()}],"scroll-ms":[{"scroll-ms":K()}],"scroll-me":[{"scroll-me":K()}],"scroll-mt":[{"scroll-mt":K()}],"scroll-mr":[{"scroll-mr":K()}],"scroll-mb":[{"scroll-mb":K()}],"scroll-ml":[{"scroll-ml":K()}],"scroll-p":[{"scroll-p":K()}],"scroll-px":[{"scroll-px":K()}],"scroll-py":[{"scroll-py":K()}],"scroll-ps":[{"scroll-ps":K()}],"scroll-pe":[{"scroll-pe":K()}],"scroll-pt":[{"scroll-pt":K()}],"scroll-pr":[{"scroll-pr":K()}],"scroll-pb":[{"scroll-pb":K()}],"scroll-pl":[{"scroll-pl":K()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Je]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[lo,Zi,fh]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const ix=KL(cF),uF=40,dF=3,QR=200,ms="inpaint",hh="diffusers_sd",uC="diffusers_sdxl",ph="diffusers_sd_inpaint",dC="diffusers_sdxl_inpaint",g0="diffusers_other",Kh="#ffcc00bb",fC="ldm",hC="cv2",JR="Fantasy-Studio/Paint-by-Example",fF="timbrooks/instruct-pix2pix",hF="Sanster/PowerPaint-V1-stable-diffusion-inpainting",pF="Sanster/AnyText",mF="out of frame, lowres, error, cropped, worst quality, low quality, jpeg artifacts, ugly, duplicate, morbid, mutilated, out of frame, mutation, deformed, blurry, dehydrated, bad anatomy, bad proportions, extra limbs, disfigured, gross proportions, malformed limbs, watermark, signature";function xe(...e){return ix(KR(e))}function gF(){async function e(r=""){return(await fetch(r,{method:"GET",cache:"no-cache"})).json()}const t=()=>{const r=document.location;e(r+"/flaskwebgui-keep-server-alive").then(i=>i)},n=3*1e3;t(),setInterval(t,n)}function pC(e){const t=e.split(",")[0].split(":")[1].split(";")[0],n=atob(e.split(",")[1]),r=[];for(let o=0;o<n.length;o+=1)r.push(n.charCodeAt(o));return new Blob([new Uint8Array(r)],{type:t})}function bu(e,t){return new Promise((n,r)=>{const o=e.src,i=e;i.onload=n,i.onerror=s=>{i.src=o,r(s)},i.src=t})}async function vF(e){const t=URL.createObjectURL(e),n=new Image;return await bu(n,t),n}function mC(e){return new Promise((t,n)=>{const r=new Image;r.addEventListener("load",()=>{t(r)}),r.addEventListener("error",o=>{n(o)}),r.src=e.toDataURL()})}function yF(e){return new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{const o=new Image;o.onload=()=>{t(o)},o.onerror=()=>{n("无法加载图像。")},o.src=r.result},r.onerror=()=>{n("无法读取文件。")},r.readAsDataURL(e)})}function Nu(e,t,n){return fetch(e).then(function(r){return r.arrayBuffer()}).then(function(r){return new File([r],t,{type:n})})}async function wF(){try{const{state:e}=await navigator.permissions.query({name:"clipboard-write"});return e==="granted"}catch{return!1}}function xF(e,t){return new Promise((n,r)=>e.toBlob(async o=>{o?n(o):r(new Error("Expected toBlob() to be defined"))},t))}const bF=async e=>{const t=[new ClipboardItem({[e.type]:e})];await navigator.clipboard.write(t)};function gC(e){return e.nativeEvent.button===2}function vC(e){return e.nativeEvent.button===1}async function SF(e){const t=await xF(e,"image/png");try{await bF(t)}catch{console.log("Copy image failed!")}}function _F(e,t){const n=document.createElement("a");n.href=e,n.download=t,n.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window})),setTimeout(()=>{n.remove()},100)}function v0(e){const t=e.nativeEvent;if("touches"in e){const n=e.target.getBoundingClientRect(),o=e.touches[0];return{x:(o.clientX-n.x)/n.width*o.target.offsetWidth,y:(o.clientY-n.y)/n.height*o.target.offsetHeight}}return{x:t.offsetX,y:t.offsetY}}function eP(e,t,n=Kh){e.strokeStyle=n,e.lineCap="round",e.lineJoin="round",t.forEach(r=>{!(r!=null&&r.pts.length)||!r.size||(e.lineWidth=r.size,e.beginPath(),e.moveTo(r.pts[0].x,r.pts[0].y),r.pts.forEach(o=>e.lineTo(o.x,o.y)),e.stroke())})}const Gh=(e,t,n,r=[],o="white")=>{const i=document.createElement("canvas");i.width=e,i.height=t;const s=i.getContext("2d");if(!s)throw new Error("could not retrieve mask canvas");return r.forEach(l=>{s.drawImage(l,0,0,e,t)}),n.forEach(l=>{eP(s,l,o)}),i},Du=e=>new Promise((t,n)=>{const r=new FileReader;r.onload=o=>{var s;const i=(s=o.target)==null?void 0:s.result;t(i)},r.onerror=o=>{n(o)},r.readAsDataURL(e)});function tP(e,t){return function(){return e.apply(t,arguments)}}const{toString:EF}=Object.prototype,{getPrototypeOf:sx}=Object,Mm=(e=>t=>{const n=EF.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),ni=e=>(e=e.toLowerCase(),t=>Mm(t)===e),Om=e=>t=>typeof t===e,{isArray:Ec}=Array,rd=Om("undefined");function CF(e){return e!==null&&!rd(e)&&e.constructor!==null&&!rd(e.constructor)&&Zr(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const nP=ni("ArrayBuffer");function $F(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&nP(e.buffer),t}const RF=Om("string"),Zr=Om("function"),rP=Om("number"),Nm=e=>e!==null&&typeof e=="object",PF=e=>e===!0||e===!1,Yh=e=>{if(Mm(e)!=="object")return!1;const t=sx(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},TF=ni("Date"),kF=ni("File"),AF=ni("Blob"),MF=ni("FileList"),OF=e=>Nm(e)&&Zr(e.pipe),NF=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Zr(e.append)&&((t=Mm(e))==="formdata"||t==="object"&&Zr(e.toString)&&e.toString()==="[object FormData]"))},DF=ni("URLSearchParams"),IF=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Nd(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),Ec(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const i=n?Object.getOwnPropertyNames(e):Object.keys(e),s=i.length;let l;for(r=0;r<s;r++)l=i[r],t.call(null,e[l],l,e)}}function oP(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,o;for(;r-- >0;)if(o=n[r],t===o.toLowerCase())return o;return null}const iP=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,sP=e=>!rd(e)&&e!==iP;function t1(){const{caseless:e}=sP(this)&&this||{},t={},n=(r,o)=>{const i=e&&oP(t,o)||o;Yh(t[i])&&Yh(r)?t[i]=t1(t[i],r):Yh(r)?t[i]=t1({},r):Ec(r)?t[i]=r.slice():t[i]=r};for(let r=0,o=arguments.length;r<o;r++)arguments[r]&&Nd(arguments[r],n);return t}const LF=(e,t,n,{allOwnKeys:r}={})=>(Nd(t,(o,i)=>{n&&Zr(o)?e[i]=tP(o,n):e[i]=o},{allOwnKeys:r}),e),FF=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),jF=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},BF=(e,t,n,r)=>{let o,i,s;const l={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],(!r||r(s,e,t))&&!l[s]&&(t[s]=e[s],l[s]=!0);e=n!==!1&&sx(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},zF=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},UF=e=>{if(!e)return null;if(Ec(e))return e;let t=e.length;if(!rP(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},VF=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&sx(Uint8Array)),WF=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let o;for(;(o=r.next())&&!o.done;){const i=o.value;t.call(e,i[0],i[1])}},HF=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},KF=ni("HTMLFormElement"),GF=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),yC=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),YF=ni("RegExp"),aP=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Nd(n,(o,i)=>{let s;(s=t(o,i,e))!==!1&&(r[i]=s||o)}),Object.defineProperties(e,r)},XF=e=>{aP(e,(t,n)=>{if(Zr(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Zr(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},ZF=(e,t)=>{const n={},r=o=>{o.forEach(i=>{n[i]=!0})};return Ec(e)?r(e):r(String(e).split(t)),n},qF=()=>{},QF=(e,t)=>(e=+e,Number.isFinite(e)?e:t),y0="abcdefghijklmnopqrstuvwxyz",wC="0123456789",lP={DIGIT:wC,ALPHA:y0,ALPHA_DIGIT:y0+y0.toUpperCase()+wC},JF=(e=16,t=lP.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function ej(e){return!!(e&&Zr(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const tj=e=>{const t=new Array(10),n=(r,o)=>{if(Nm(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[o]=r;const i=Ec(r)?[]:{};return Nd(r,(s,l)=>{const u=n(s,o+1);!rd(u)&&(i[l]=u)}),t[o]=void 0,i}}return r};return n(e,0)},nj=ni("AsyncFunction"),rj=e=>e&&(Nm(e)||Zr(e))&&Zr(e.then)&&Zr(e.catch),ae={isArray:Ec,isArrayBuffer:nP,isBuffer:CF,isFormData:NF,isArrayBufferView:$F,isString:RF,isNumber:rP,isBoolean:PF,isObject:Nm,isPlainObject:Yh,isUndefined:rd,isDate:TF,isFile:kF,isBlob:AF,isRegExp:YF,isFunction:Zr,isStream:OF,isURLSearchParams:DF,isTypedArray:VF,isFileList:MF,forEach:Nd,merge:t1,extend:LF,trim:IF,stripBOM:FF,inherits:jF,toFlatObject:BF,kindOf:Mm,kindOfTest:ni,endsWith:zF,toArray:UF,forEachEntry:WF,matchAll:HF,isHTMLForm:KF,hasOwnProperty:yC,hasOwnProp:yC,reduceDescriptors:aP,freezeMethods:XF,toObjectSet:ZF,toCamelCase:GF,noop:qF,toFiniteNumber:QF,findKey:oP,global:iP,isContextDefined:sP,ALPHABET:lP,generateString:JF,isSpecCompliantForm:ej,toJSONObject:tj,isAsyncFn:nj,isThenable:rj};function ct(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o)}ae.inherits(ct,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ae.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const cP=ct.prototype,uP={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{uP[e]={value:e}});Object.defineProperties(ct,uP);Object.defineProperty(cP,"isAxiosError",{value:!0});ct.from=(e,t,n,r,o,i)=>{const s=Object.create(cP);return ae.toFlatObject(e,s,function(u){return u!==Error.prototype},l=>l!=="isAxiosError"),ct.call(s,e.message,t,n,r,o),s.cause=e,s.name=e.name,i&&Object.assign(s,i),s};const oj=null;function n1(e){return ae.isPlainObject(e)||ae.isArray(e)}function dP(e){return ae.endsWith(e,"[]")?e.slice(0,-2):e}function xC(e,t,n){return e?e.concat(t).map(function(o,i){return o=dP(o),!n&&i?"["+o+"]":o}).join(n?".":""):t}function ij(e){return ae.isArray(e)&&!e.some(n1)}const sj=ae.toFlatObject(ae,{},null,function(t){return/^is[A-Z]/.test(t)});function Dm(e,t,n){if(!ae.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=ae.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(S,E){return!ae.isUndefined(E[S])});const r=n.metaTokens,o=n.visitor||m,i=n.dots,s=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&ae.isSpecCompliantForm(t);if(!ae.isFunction(o))throw new TypeError("visitor must be a function");function f(x){if(x===null)return"";if(ae.isDate(x))return x.toISOString();if(!u&&ae.isBlob(x))throw new ct("Blob is not supported. Use a Buffer instead.");return ae.isArrayBuffer(x)||ae.isTypedArray(x)?u&&typeof Blob=="function"?new Blob([x]):Buffer.from(x):x}function m(x,S,E){let _=x;if(x&&!E&&typeof x=="object"){if(ae.endsWith(S,"{}"))S=r?S:S.slice(0,-2),x=JSON.stringify(x);else if(ae.isArray(x)&&ij(x)||(ae.isFileList(x)||ae.endsWith(S,"[]"))&&(_=ae.toArray(x)))return S=dP(S),_.forEach(function(C,R){!(ae.isUndefined(C)||C===null)&&t.append(s===!0?xC([S],R,i):s===null?S:S+"[]",f(C))}),!1}return n1(x)?!0:(t.append(xC(E,S,i),f(x)),!1)}const p=[],g=Object.assign(sj,{defaultVisitor:m,convertValue:f,isVisitable:n1});function y(x,S){if(!ae.isUndefined(x)){if(p.indexOf(x)!==-1)throw Error("Circular reference detected in "+S.join("."));p.push(x),ae.forEach(x,function(_,b){(!(ae.isUndefined(_)||_===null)&&o.call(t,_,ae.isString(b)?b.trim():b,S,g))===!0&&y(_,S?S.concat(b):[b])}),p.pop()}}if(!ae.isObject(e))throw new TypeError("data must be an object");return y(e),t}function bC(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function ax(e,t){this._pairs=[],e&&Dm(e,this,t)}const fP=ax.prototype;fP.append=function(t,n){this._pairs.push([t,n])};fP.toString=function(t){const n=t?function(r){return t.call(this,r,bC)}:bC;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function aj(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function hP(e,t,n){if(!t)return e;const r=n&&n.encode||aj,o=n&&n.serialize;let i;if(o?i=o(t,n):i=ae.isURLSearchParams(t)?t.toString():new ax(t,n).toString(r),i){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class lj{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){ae.forEach(this.handlers,function(r){r!==null&&t(r)})}}const SC=lj,pP={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},cj=typeof URLSearchParams<"u"?URLSearchParams:ax,uj=typeof FormData<"u"?FormData:null,dj=typeof Blob<"u"?Blob:null,fj={isBrowser:!0,classes:{URLSearchParams:cj,FormData:uj,Blob:dj},protocols:["http","https","file","blob","url","data"]},mP=typeof window<"u"&&typeof document<"u",hj=(e=>mP&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),pj=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",mj=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:mP,hasStandardBrowserEnv:hj,hasStandardBrowserWebWorkerEnv:pj},Symbol.toStringTag,{value:"Module"})),Wo={...mj,...fj};function gj(e,t){return Dm(e,new Wo.classes.URLSearchParams,Object.assign({visitor:function(n,r,o,i){return Wo.isNode&&ae.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function vj(e){return ae.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function yj(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],t[i]=e[i];return t}function gP(e){function t(n,r,o,i){let s=n[i++];const l=Number.isFinite(+s),u=i>=n.length;return s=!s&&ae.isArray(o)?o.length:s,u?(ae.hasOwnProp(o,s)?o[s]=[o[s],r]:o[s]=r,!l):((!o[s]||!ae.isObject(o[s]))&&(o[s]=[]),t(n,r,o[s],i)&&ae.isArray(o[s])&&(o[s]=yj(o[s])),!l)}if(ae.isFormData(e)&&ae.isFunction(e.entries)){const n={};return ae.forEachEntry(e,(r,o)=>{t(vj(r),o,n,0)}),n}return null}function wj(e,t,n){if(ae.isString(e))try{return(t||JSON.parse)(e),ae.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const lx={transitional:pP,adapter:["xhr","http"],transformRequest:[function(t,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,i=ae.isObject(t);if(i&&ae.isHTMLForm(t)&&(t=new FormData(t)),ae.isFormData(t))return o&&o?JSON.stringify(gP(t)):t;if(ae.isArrayBuffer(t)||ae.isBuffer(t)||ae.isStream(t)||ae.isFile(t)||ae.isBlob(t))return t;if(ae.isArrayBufferView(t))return t.buffer;if(ae.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return gj(t,this.formSerializer).toString();if((l=ae.isFileList(t))||r.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return Dm(l?{"files[]":t}:t,u&&new u,this.formSerializer)}}return i||o?(n.setContentType("application/json",!1),wj(t)):t}],transformResponse:[function(t){const n=this.transitional||lx.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(t&&ae.isString(t)&&(r&&!this.responseType||o)){const s=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t)}catch(l){if(s)throw l.name==="SyntaxError"?ct.from(l,ct.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Wo.classes.FormData,Blob:Wo.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ae.forEach(["delete","get","head","post","put","patch"],e=>{lx.headers[e]={}});const cx=lx,xj=ae.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),bj=e=>{const t={};let n,r,o;return e&&e.split(`
`).forEach(function(s){o=s.indexOf(":"),n=s.substring(0,o).trim().toLowerCase(),r=s.substring(o+1).trim(),!(!n||t[n]&&xj[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},_C=Symbol("internals");function cu(e){return e&&String(e).trim().toLowerCase()}function Xh(e){return e===!1||e==null?e:ae.isArray(e)?e.map(Xh):String(e)}function Sj(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const _j=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function w0(e,t,n,r,o){if(ae.isFunction(r))return r.call(this,t,n);if(o&&(t=n),!!ae.isString(t)){if(ae.isString(r))return t.indexOf(r)!==-1;if(ae.isRegExp(r))return r.test(t)}}function Ej(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Cj(e,t){const n=ae.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(o,i,s){return this[r].call(this,t,o,i,s)},configurable:!0})})}class Im{constructor(t){t&&this.set(t)}set(t,n,r){const o=this;function i(l,u,f){const m=cu(u);if(!m)throw new Error("header name must be a non-empty string");const p=ae.findKey(o,m);(!p||o[p]===void 0||f===!0||f===void 0&&o[p]!==!1)&&(o[p||u]=Xh(l))}const s=(l,u)=>ae.forEach(l,(f,m)=>i(f,m,u));return ae.isPlainObject(t)||t instanceof this.constructor?s(t,n):ae.isString(t)&&(t=t.trim())&&!_j(t)?s(bj(t),n):t!=null&&i(n,t,r),this}get(t,n){if(t=cu(t),t){const r=ae.findKey(this,t);if(r){const o=this[r];if(!n)return o;if(n===!0)return Sj(o);if(ae.isFunction(n))return n.call(this,o,r);if(ae.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=cu(t),t){const r=ae.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||w0(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let o=!1;function i(s){if(s=cu(s),s){const l=ae.findKey(r,s);l&&(!n||w0(r,r[l],l,n))&&(delete r[l],o=!0)}}return ae.isArray(t)?t.forEach(i):i(t),o}clear(t){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const i=n[r];(!t||w0(this,this[i],i,t,!0))&&(delete this[i],o=!0)}return o}normalize(t){const n=this,r={};return ae.forEach(this,(o,i)=>{const s=ae.findKey(r,i);if(s){n[s]=Xh(o),delete n[i];return}const l=t?Ej(i):String(i).trim();l!==i&&delete n[i],n[l]=Xh(o),r[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return ae.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=t&&ae.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(o=>r.set(o)),r}static accessor(t){const r=(this[_C]=this[_C]={accessors:{}}).accessors,o=this.prototype;function i(s){const l=cu(s);r[l]||(Cj(o,s),r[l]=!0)}return ae.isArray(t)?t.forEach(i):i(t),this}}Im.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ae.reduceDescriptors(Im.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});ae.freezeMethods(Im);const Si=Im;function x0(e,t){const n=this||cx,r=t||n,o=Si.from(r.headers);let i=r.data;return ae.forEach(e,function(l){i=l.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function vP(e){return!!(e&&e.__CANCEL__)}function Dd(e,t,n){ct.call(this,e??"canceled",ct.ERR_CANCELED,t,n),this.name="CanceledError"}ae.inherits(Dd,ct,{__CANCEL__:!0});function $j(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new ct("Request failed with status code "+n.status,[ct.ERR_BAD_REQUEST,ct.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const Rj=Wo.hasStandardBrowserEnv?{write(e,t,n,r,o,i){const s=[e+"="+encodeURIComponent(t)];ae.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),ae.isString(r)&&s.push("path="+r),ae.isString(o)&&s.push("domain="+o),i===!0&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Pj(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Tj(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function yP(e,t){return e&&!Pj(t)?Tj(e,t):t}const kj=Wo.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function o(i){let s=i;return t&&(n.setAttribute("href",s),s=n.href),n.setAttribute("href",s),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=o(window.location.href),function(s){const l=ae.isString(s)?o(s):s;return l.protocol===r.protocol&&l.host===r.host}}():function(){return function(){return!0}}();function Aj(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Mj(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,i=0,s;return t=t!==void 0?t:1e3,function(u){const f=Date.now(),m=r[i];s||(s=f),n[o]=u,r[o]=f;let p=i,g=0;for(;p!==o;)g+=n[p++],p=p%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),f-s<t)return;const y=m&&f-m;return y?Math.round(g*1e3/y):void 0}}function EC(e,t){let n=0;const r=Mj(50,250);return o=>{const i=o.loaded,s=o.lengthComputable?o.total:void 0,l=i-n,u=r(l),f=i<=s;n=i;const m={loaded:i,total:s,progress:s?i/s:void 0,bytes:l,rate:u||void 0,estimated:u&&s&&f?(s-i)/u:void 0,event:o};m[t?"download":"upload"]=!0,e(m)}}const Oj=typeof XMLHttpRequest<"u",Nj=Oj&&function(e){return new Promise(function(n,r){let o=e.data;const i=Si.from(e.headers).normalize();let{responseType:s,withXSRFToken:l}=e,u;function f(){e.cancelToken&&e.cancelToken.unsubscribe(u),e.signal&&e.signal.removeEventListener("abort",u)}let m;if(ae.isFormData(o)){if(Wo.hasStandardBrowserEnv||Wo.hasStandardBrowserWebWorkerEnv)i.setContentType(!1);else if((m=i.getContentType())!==!1){const[S,...E]=m?m.split(";").map(_=>_.trim()).filter(Boolean):[];i.setContentType([S||"multipart/form-data",...E].join("; "))}}let p=new XMLHttpRequest;if(e.auth){const S=e.auth.username||"",E=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(S+":"+E))}const g=yP(e.baseURL,e.url);p.open(e.method.toUpperCase(),hP(g,e.params,e.paramsSerializer),!0),p.timeout=e.timeout;function y(){if(!p)return;const S=Si.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),_={data:!s||s==="text"||s==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:S,config:e,request:p};$j(function(C){n(C),f()},function(C){r(C),f()},_),p=null}if("onloadend"in p?p.onloadend=y:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(y)},p.onabort=function(){p&&(r(new ct("Request aborted",ct.ECONNABORTED,e,p)),p=null)},p.onerror=function(){r(new ct("Network Error",ct.ERR_NETWORK,e,p)),p=null},p.ontimeout=function(){let E=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const _=e.transitional||pP;e.timeoutErrorMessage&&(E=e.timeoutErrorMessage),r(new ct(E,_.clarifyTimeoutError?ct.ETIMEDOUT:ct.ECONNABORTED,e,p)),p=null},Wo.hasStandardBrowserEnv&&(l&&ae.isFunction(l)&&(l=l(e)),l||l!==!1&&kj(g))){const S=e.xsrfHeaderName&&e.xsrfCookieName&&Rj.read(e.xsrfCookieName);S&&i.set(e.xsrfHeaderName,S)}o===void 0&&i.setContentType(null),"setRequestHeader"in p&&ae.forEach(i.toJSON(),function(E,_){p.setRequestHeader(_,E)}),ae.isUndefined(e.withCredentials)||(p.withCredentials=!!e.withCredentials),s&&s!=="json"&&(p.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&p.addEventListener("progress",EC(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&p.upload&&p.upload.addEventListener("progress",EC(e.onUploadProgress)),(e.cancelToken||e.signal)&&(u=S=>{p&&(r(!S||S.type?new Dd(null,e,p):S),p.abort(),p=null)},e.cancelToken&&e.cancelToken.subscribe(u),e.signal&&(e.signal.aborted?u():e.signal.addEventListener("abort",u)));const x=Aj(g);if(x&&Wo.protocols.indexOf(x)===-1){r(new ct("Unsupported protocol "+x+":",ct.ERR_BAD_REQUEST,e));return}p.send(o||null)})},r1={http:oj,xhr:Nj};ae.forEach(r1,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const CC=e=>`- ${e}`,Dj=e=>ae.isFunction(e)||e===null||e===!1,wP={getAdapter:e=>{e=ae.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let i=0;i<t;i++){n=e[i];let s;if(r=n,!Dj(n)&&(r=r1[(s=String(n)).toLowerCase()],r===void 0))throw new ct(`Unknown adapter '${s}'`);if(r)break;o[s||"#"+i]=r}if(!r){const i=Object.entries(o).map(([l,u])=>`adapter ${l} `+(u===!1?"is not supported by the environment":"is not available in the build"));let s=t?i.length>1?`since :
`+i.map(CC).join(`
`):" "+CC(i[0]):"as no adapter specified";throw new ct("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return r},adapters:r1};function b0(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Dd(null,e)}function $C(e){return b0(e),e.headers=Si.from(e.headers),e.data=x0.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),wP.getAdapter(e.adapter||cx.adapter)(e).then(function(r){return b0(e),r.data=x0.call(e,e.transformResponse,r),r.headers=Si.from(r.headers),r},function(r){return vP(r)||(b0(e),r&&r.response&&(r.response.data=x0.call(e,e.transformResponse,r.response),r.response.headers=Si.from(r.response.headers))),Promise.reject(r)})}const RC=e=>e instanceof Si?e.toJSON():e;function ac(e,t){t=t||{};const n={};function r(f,m,p){return ae.isPlainObject(f)&&ae.isPlainObject(m)?ae.merge.call({caseless:p},f,m):ae.isPlainObject(m)?ae.merge({},m):ae.isArray(m)?m.slice():m}function o(f,m,p){if(ae.isUndefined(m)){if(!ae.isUndefined(f))return r(void 0,f,p)}else return r(f,m,p)}function i(f,m){if(!ae.isUndefined(m))return r(void 0,m)}function s(f,m){if(ae.isUndefined(m)){if(!ae.isUndefined(f))return r(void 0,f)}else return r(void 0,m)}function l(f,m,p){if(p in t)return r(f,m);if(p in e)return r(void 0,f)}const u={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l,headers:(f,m)=>o(RC(f),RC(m),!0)};return ae.forEach(Object.keys(Object.assign({},e,t)),function(m){const p=u[m]||o,g=p(e[m],t[m],m);ae.isUndefined(g)&&p!==l||(n[m]=g)}),n}const xP="1.6.2",ux={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ux[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const PC={};ux.transitional=function(t,n,r){function o(i,s){return"[Axios v"+xP+"] Transitional option '"+i+"'"+s+(r?". "+r:"")}return(i,s,l)=>{if(t===!1)throw new ct(o(s," has been removed"+(n?" in "+n:"")),ct.ERR_DEPRECATED);return n&&!PC[s]&&(PC[s]=!0,console.warn(o(s," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,s,l):!0}};function Ij(e,t,n){if(typeof e!="object")throw new ct("options must be an object",ct.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],s=t[i];if(s){const l=e[i],u=l===void 0||s(l,i,e);if(u!==!0)throw new ct("option "+i+" must be "+u,ct.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ct("Unknown option "+i,ct.ERR_BAD_OPTION)}}const o1={assertOptions:Ij,validators:ux},Qi=o1.validators;class Ip{constructor(t){this.defaults=t,this.interceptors={request:new SC,response:new SC}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ac(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&o1.assertOptions(r,{silentJSONParsing:Qi.transitional(Qi.boolean),forcedJSONParsing:Qi.transitional(Qi.boolean),clarifyTimeoutError:Qi.transitional(Qi.boolean)},!1),o!=null&&(ae.isFunction(o)?n.paramsSerializer={serialize:o}:o1.assertOptions(o,{encode:Qi.function,serialize:Qi.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=i&&ae.merge(i.common,i[n.method]);i&&ae.forEach(["delete","get","head","post","put","patch","common"],x=>{delete i[x]}),n.headers=Si.concat(s,i);const l=[];let u=!0;this.interceptors.request.forEach(function(S){typeof S.runWhen=="function"&&S.runWhen(n)===!1||(u=u&&S.synchronous,l.unshift(S.fulfilled,S.rejected))});const f=[];this.interceptors.response.forEach(function(S){f.push(S.fulfilled,S.rejected)});let m,p=0,g;if(!u){const x=[$C.bind(this),void 0];for(x.unshift.apply(x,l),x.push.apply(x,f),g=x.length,m=Promise.resolve(n);p<g;)m=m.then(x[p++],x[p++]);return m}g=l.length;let y=n;for(p=0;p<g;){const x=l[p++],S=l[p++];try{y=x(y)}catch(E){S.call(this,E);break}}try{m=$C.call(this,y)}catch(x){return Promise.reject(x)}for(p=0,g=f.length;p<g;)m=m.then(f[p++],f[p++]);return m}getUri(t){t=ac(this.defaults,t);const n=yP(t.baseURL,t.url);return hP(n,t.params,t.paramsSerializer)}}ae.forEach(["delete","get","head","options"],function(t){Ip.prototype[t]=function(n,r){return this.request(ac(r||{},{method:t,url:n,data:(r||{}).data}))}});ae.forEach(["post","put","patch"],function(t){function n(r){return function(i,s,l){return this.request(ac(l||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}Ip.prototype[t]=n(),Ip.prototype[t+"Form"]=n(!0)});const Zh=Ip;class dx{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(o=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(l=>{r.subscribe(l),i=l}).then(o);return s.cancel=function(){r.unsubscribe(i)},s},t(function(i,s,l){r.reason||(r.reason=new Dd(i,s,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new dx(function(o){t=o}),cancel:t}}}const Lj=dx;function Fj(e){return function(n){return e.apply(null,n)}}function jj(e){return ae.isObject(e)&&e.isAxiosError===!0}const i1={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(i1).forEach(([e,t])=>{i1[t]=e});const Bj=i1;function bP(e){const t=new Zh(e),n=tP(Zh.prototype.request,t);return ae.extend(n,Zh.prototype,t,{allOwnKeys:!0}),ae.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return bP(ac(e,o))},n}const Qt=bP(cx);Qt.Axios=Zh;Qt.CanceledError=Dd;Qt.CancelToken=Lj;Qt.isCancel=vP;Qt.VERSION=xP;Qt.toFormData=Dm;Qt.AxiosError=ct;Qt.Cancel=Qt.CanceledError;Qt.all=function(t){return Promise.all(t)};Qt.spread=Fj;Qt.isAxiosError=jj;Qt.mergeConfig=ac;Qt.AxiosHeaders=Si;Qt.formToJSON=e=>gP(ae.isHTMLForm(e)?new FormData(e):e);Qt.getAdapter=wP.getAdapter;Qt.HttpStatusCode=Bj;Qt.default=Qt;const zj=Qt,Ni="/api/v1",Cc=zj.create({baseURL:Ni});async function Uj(e,t,n,r,o,i=null){const s=await Du(e),l=await Du(o),u=i?await Du(i):null,f=await fetch(`${Ni}/inpaint`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({image:s,mask:l,ldm_steps:t.ldmSteps,ldm_sampler:t.ldmSampler,zits_wireframe:t.zitsWireframe,cv2_flag:t.cv2Flag,cv2_radius:t.cv2Radius,hd_strategy:"Crop",hd_strategy_crop_triger_size:640,hd_strategy_crop_margin:128,hd_trategy_resize_imit:2048,prompt:t.prompt,negative_prompt:t.negativePrompt,use_croper:t.showCropper,croper_x:n.x,croper_y:n.y,croper_height:n.height,croper_width:n.width,use_extender:t.showExtender,extender_x:r.x,extender_y:r.y,extender_height:r.height,extender_width:r.width,sd_mask_blur:t.sdMaskBlur,sd_strength:t.sdStrength,sd_steps:t.sdSteps,sd_guidance_scale:t.sdGuidanceScale,sd_sampler:t.sdSampler,sd_seed:t.seedFixed?t.seed:-1,sd_match_histograms:t.sdMatchHistograms,sd_lcm_lora:t.enableLCMLora,paint_by_example_example_image:u,p2p_image_guidance_scale:t.p2pImageGuidanceScale,enable_controlnet:t.enableControlnet,controlnet_conditioning_scale:t.controlnetConditioningScale,controlnet_method:t.controlnetMethod?t.controlnetMethod:"",enable_brushnet:t.enableBrushNet,brushnet_method:t.brushnetMethod?t.brushnetMethod:"",brushnet_conditioning_scale:t.brushnetConditioningScale,enable_powerpaint_v2:t.enablePowerPaintV2,powerpaint_task:t.showExtender?ma.outpainting:t.powerpaintTask})});if(f.ok){const p=await f.blob();return{blob:URL.createObjectURL(p),seed:f.headers.get("X-Seed")}}const m=await f.json();throw new Error(`Something went wrong: ${m.errors}`)}async function SP(){return(await Cc.get("/server-config")).data}async function Vj(e){return(await Cc.post("/model",{name:e})).data}async function S0(e,t){return Cc.post("/switch_plugin_model",{plugin_name:e,model_name:t})}async function Wj(){return(await Cc.get("/model")).data}async function _P(e,t,n,r,o){const i=await Du(n),l=await fetch(`${Ni}/${e?"run_plugin_gen_mask":"run_plugin_gen_image"}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t,image:i,scale:r,clicks:o})});if(l.ok){const f=await l.blob();return{blob:URL.createObjectURL(f)}}const u=await l.json();throw new Error(u)}async function Hj(e,t){const n=await fetch(`${Ni}/media_file?tab=${e}&filename=${encodeURIComponent(t)}`,{method:"GET"});if(n.ok){const o=await n.blob();return new File([o],t,{type:n.headers.get("Content-Type")??"image/png"})}const r=await n.json();throw new Error(r.errors)}async function Kj(e,t){const n=await fetch(`${Ni}/media_file?tab=${e}&filename=${encodeURIComponent(t)}`,{method:"GET"});if(n.ok)return await n.blob();const r=await n.json();throw new Error(r.errors)}async function Gj(e){return(await Cc.get("medias",{params:{tab:e}})).data}async function Yj(e,t,n){const r=await Nu(e.src,t,n),o=new FormData;o.append("file",r);try{const i=await fetch(`${Ni}/save_image`,{method:"POST",body:o});if(!i.ok){const s=await i.text();throw new Error(s)}}catch(i){throw new Error(`Something went wrong: ${i}`)}}async function Xj(e){const t=new FormData;return t.append("file",e),(await Cc.post("/gen-info",t)).data}async function Zj(e,t,n){const r=await Du(e),o=await fetch(`${Ni}/adjust_mask`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mask:r,operate:t,kernel_size:n})});if(o.ok)return await o.blob();const i=await o.json();throw new Error(i)}function qj(){const[e,t]=d.useState(null),n=d.useCallback(()=>{const r=new Headers;r.append("pragma","no-cache"),r.append("cache-control","no-cache"),fetch(`${Ni}/inputimage`,{headers:r}).then(async o=>{var l;if(!o.ok)return;const i=(l=o.headers.get("content-disposition"))==null?void 0:l.split("filename=")[1].split(";")[0],s=await o.blob();if(s&&s.type.startsWith("image")){const u=new File([s],i!==void 0?i:"inputImage");t(u)}}).catch(o=>{console.log(o)})},[t]);return d.useEffect(()=>{n()},[n]),e}function Co(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var Qj=["color"],Jj=d.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Co(e,Qj);return d.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),d.createElement("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),eB=["color"],EP=d.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Co(e,eB);return d.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),d.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),tB=["color"],nB=d.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Co(e,tB);return d.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),d.createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),rB=["color"],oB=d.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Co(e,rB);return d.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),d.createElement("path",{d:"M6.1584 3.13508C6.35985 2.94621 6.67627 2.95642 6.86514 3.15788L10.6151 7.15788C10.7954 7.3502 10.7954 7.64949 10.6151 7.84182L6.86514 11.8418C6.67627 12.0433 6.35985 12.0535 6.1584 11.8646C5.95694 11.6757 5.94673 11.3593 6.1356 11.1579L9.565 7.49985L6.1356 3.84182C5.94673 3.64036 5.95694 3.32394 6.1584 3.13508Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),iB=["color"],sB=d.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Co(e,iB);return d.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),d.createElement("path",{d:"M3.13523 8.84197C3.3241 9.04343 3.64052 9.05363 3.84197 8.86477L7.5 5.43536L11.158 8.86477C11.3595 9.05363 11.6759 9.04343 11.8648 8.84197C12.0536 8.64051 12.0434 8.32409 11.842 8.13523L7.84197 4.38523C7.64964 4.20492 7.35036 4.20492 7.15803 4.38523L3.15803 8.13523C2.95657 8.32409 2.94637 8.64051 3.13523 8.84197Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),aB=["color"],CP=d.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Co(e,aB);return d.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),d.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),lB=["color"],cB=d.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Co(e,lB);return d.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),d.createElement("path",{d:"M9.875 7.5C9.875 8.81168 8.81168 9.875 7.5 9.875C6.18832 9.875 5.125 8.81168 5.125 7.5C5.125 6.18832 6.18832 5.125 7.5 5.125C8.81168 5.125 9.875 6.18832 9.875 7.5Z",fill:r}))}),uB=["color"],dB=d.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Co(e,uB);return d.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),d.createElement("path",{d:"M10 6.5C10 8.433 8.433 10 6.5 10C4.567 10 3 8.433 3 6.5C3 4.567 4.567 3 6.5 3C8.433 3 10 4.567 10 6.5ZM9.30884 10.0159C8.53901 10.6318 7.56251 11 6.5 11C4.01472 11 2 8.98528 2 6.5C2 4.01472 4.01472 2 6.5 2C8.98528 2 11 4.01472 11 6.5C11 7.56251 10.6318 8.53901 10.0159 9.30884L12.8536 12.1464C13.0488 12.3417 13.0488 12.6583 12.8536 12.8536C12.6583 13.0488 12.3417 13.0488 12.1464 12.8536L9.30884 10.0159Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),fB=["color"],hB=d.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Co(e,fB);return d.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),d.createElement("path",{d:"M3.24182 2.32181C3.3919 2.23132 3.5784 2.22601 3.73338 2.30781L12.7334 7.05781C12.8974 7.14436 13 7.31457 13 7.5C13 7.68543 12.8974 7.85564 12.7334 7.94219L3.73338 12.6922C3.5784 12.774 3.3919 12.7687 3.24182 12.6782C3.09175 12.5877 3 12.4252 3 12.25V2.75C3 2.57476 3.09175 2.4123 3.24182 2.32181ZM4 3.57925V11.4207L11.4288 7.5L4 3.57925Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),pB=["color"],mB=d.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Co(e,pB);return d.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),d.createElement("path",{d:"M7 2H1.5C1.22386 2 1 2.22386 1 2.5V7H7V2ZM8 2V7H14V2.5C14 2.22386 13.7761 2 13.5 2H8ZM7 8H1V12.5C1 12.7761 1.22386 13 1.5 13H7V8ZM8 13V8H14V12.5C14 12.7761 13.7761 13 13.5 13H8ZM1.5 1C0.671573 1 0 1.67157 0 2.5V12.5C0 13.3284 0.671573 14 1.5 14H13.5C14.3284 14 15 13.3284 15 12.5V2.5C15 1.67157 14.3284 1 13.5 1H1.5Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),gB=["color"],vB=d.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Co(e,gB);return d.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),d.createElement("path",{d:"M1.5 2H13.5C13.7761 2 14 2.22386 14 2.5V7H1V2.5C1 2.22386 1.22386 2 1.5 2ZM1 8V12.5C1 12.7761 1.22386 13 1.5 13H13.5C13.7761 13 14 12.7761 14 12.5V8H1ZM0 2.5C0 1.67157 0.671573 1 1.5 1H13.5C14.3284 1 15 1.67157 15 2.5V12.5C15 13.3284 14.3284 14 13.5 14H1.5C0.671573 14 0 13.3284 0 12.5V2.5Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});function Y(){return Y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Y.apply(this,arguments)}function yB(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Lm(...e){return t=>e.forEach(n=>yB(n,t))}function Ve(...e){return d.useCallback(Lm(...e),e)}const Qo=d.forwardRef((e,t)=>{const{children:n,...r}=e,o=d.Children.toArray(n),i=o.find(wB);if(i){const s=i.props.children,l=o.map(u=>u===i?d.Children.count(s)>1?d.Children.only(null):d.isValidElement(s)?s.props.children:null:u);return d.createElement(s1,Y({},r,{ref:t}),d.isValidElement(s)?d.cloneElement(s,void 0,l):null)}return d.createElement(s1,Y({},r,{ref:t}),n)});Qo.displayName="Slot";const s1=d.forwardRef((e,t)=>{const{children:n,...r}=e;return d.isValidElement(n)?d.cloneElement(n,{...xB(r,n.props),ref:t?Lm(t,n.ref):n.ref}):d.Children.count(n)>1?d.Children.only(null):null});s1.displayName="SlotClone";const fx=({children:e})=>d.createElement(d.Fragment,null,e);function wB(e){return d.isValidElement(e)&&e.type===fx}function xB(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...l)=>{i(...l),o(...l)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const TC=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,kC=KR,Fm=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return kC(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(f=>{const m=n==null?void 0:n[f],p=i==null?void 0:i[f];if(m===null)return null;const g=TC(m)||TC(p);return o[f][g]}),l=n&&Object.entries(n).reduce((f,m)=>{let[p,g]=m;return g===void 0||(f[p]=g),f},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,m)=>{let{class:p,className:g,...y}=m;return Object.entries(y).every(x=>{let[S,E]=x;return Array.isArray(E)?E.includes({...i,...l}[S]):{...i,...l}[S]===E})?[...f,p,g]:f},[]);return kC(e,s,u,n==null?void 0:n.class,n==null?void 0:n.className)};var bB={VITE_BACKEND:"http://127.0.0.1:8080",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};function SB(e,t){let n;try{n=e()}catch{return}return{getItem:o=>{var i;const s=u=>u===null?null:JSON.parse(u,t==null?void 0:t.reviver),l=(i=n.getItem(o))!=null?i:null;return l instanceof Promise?l.then(s):s(l)},setItem:(o,i)=>n.setItem(o,JSON.stringify(i,t==null?void 0:t.replacer)),removeItem:o=>n.removeItem(o)}}const od=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return od(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return od(r)(n)}}}},_B=(e,t)=>(n,r,o)=>{let i={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:E=>E,version:0,merge:(E,_)=>({..._,...E}),...t},s=!1;const l=new Set,u=new Set;let f;try{f=i.getStorage()}catch{}if(!f)return e((...E)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...E)},r,o);const m=od(i.serialize),p=()=>{const E=i.partialize({...r()});let _;const b=m({state:E,version:i.version}).then(C=>f.setItem(i.name,C)).catch(C=>{_=C});if(_)throw _;return b},g=o.setState;o.setState=(E,_)=>{g(E,_),p()};const y=e((...E)=>{n(...E),p()},r,o);let x;const S=()=>{var E;if(!f)return;s=!1,l.forEach(b=>b(r()));const _=((E=i.onRehydrateStorage)==null?void 0:E.call(i,r()))||void 0;return od(f.getItem.bind(f))(i.name).then(b=>{if(b)return i.deserialize(b)}).then(b=>{if(b)if(typeof b.version=="number"&&b.version!==i.version){if(i.migrate)return i.migrate(b.state,b.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return b.state}).then(b=>{var C;return x=i.merge(b,(C=r())!=null?C:y),n(x,!0),p()}).then(()=>{_==null||_(x,void 0),s=!0,u.forEach(b=>b(x))}).catch(b=>{_==null||_(void 0,b)})};return o.persist={setOptions:E=>{i={...i,...E},E.getStorage&&(f=E.getStorage())},clearStorage:()=>{f==null||f.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>S(),hasHydrated:()=>s,onHydrate:E=>(l.add(E),()=>{l.delete(E)}),onFinishHydration:E=>(u.add(E),()=>{u.delete(E)})},S(),x||y},EB=(e,t)=>(n,r,o)=>{let i={storage:SB(()=>localStorage),partialize:S=>S,version:0,merge:(S,E)=>({...E,...S}),...t},s=!1;const l=new Set,u=new Set;let f=i.storage;if(!f)return e((...S)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...S)},r,o);const m=()=>{const S=i.partialize({...r()});return f.setItem(i.name,{state:S,version:i.version})},p=o.setState;o.setState=(S,E)=>{p(S,E),m()};const g=e((...S)=>{n(...S),m()},r,o);let y;const x=()=>{var S,E;if(!f)return;s=!1,l.forEach(b=>{var C;return b((C=r())!=null?C:g)});const _=((E=i.onRehydrateStorage)==null?void 0:E.call(i,(S=r())!=null?S:g))||void 0;return od(f.getItem.bind(f))(i.name).then(b=>{if(b)if(typeof b.version=="number"&&b.version!==i.version){if(i.migrate)return i.migrate(b.state,b.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return b.state}).then(b=>{var C;return y=i.merge(b,(C=r())!=null?C:g),n(y,!0),m()}).then(()=>{_==null||_(y,void 0),y=r(),s=!0,u.forEach(b=>b(y))}).catch(b=>{_==null||_(void 0,b)})};return o.persist={setOptions:S=>{i={...i,...S},S.storage&&(f=S.storage)},clearStorage:()=>{f==null||f.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>x(),hasHydrated:()=>s,onHydrate:S=>(l.add(S),()=>{l.delete(S)}),onFinishHydration:S=>(u.add(S),()=>{u.delete(S)})},i.skipHydration||x(),y||g},CB=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?((bB?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),_B(e,t)):EB(e,t),$B=CB;function RB(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,o]of e)if(!Object.is(o,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}var $P=Symbol.for("immer-nothing"),AC=Symbol.for("immer-draftable"),xr=Symbol.for("immer-state");function vo(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var lc=Object.getPrototypeOf;function cc(e){return!!e&&!!e[xr]}function Na(e){var t;return e?RP(e)||Array.isArray(e)||!!e[AC]||!!((t=e.constructor)!=null&&t[AC])||Bm(e)||zm(e):!1}var PB=Object.prototype.constructor.toString();function RP(e){if(!e||typeof e!="object")return!1;const t=lc(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===PB}function id(e,t){jm(e)===0?Object.entries(e).forEach(([n,r])=>{t(n,r,e)}):e.forEach((n,r)=>t(r,n,e))}function jm(e){const t=e[xr];return t?t.type_:Array.isArray(e)?1:Bm(e)?2:zm(e)?3:0}function a1(e,t){return jm(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function PP(e,t,n){const r=jm(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function TB(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Bm(e){return e instanceof Map}function zm(e){return e instanceof Set}function ia(e){return e.copy_||e.base_}function l1(e,t){if(Bm(e))return new Map(e);if(zm(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&RP(e))return lc(e)?{...e}:Object.assign(Object.create(null),e);const n=Object.getOwnPropertyDescriptors(e);delete n[xr];let r=Reflect.ownKeys(n);for(let o=0;o<r.length;o++){const i=r[o],s=n[i];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(n[i]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[i]})}return Object.create(lc(e),n)}function hx(e,t=!1){return Um(e)||cc(e)||!Na(e)||(jm(e)>1&&(e.set=e.add=e.clear=e.delete=kB),Object.freeze(e),t&&id(e,(n,r)=>hx(r,!0))),e}function kB(){vo(2)}function Um(e){return Object.isFrozen(e)}var AB={};function Da(e){const t=AB[e];return t||vo(0,e),t}var sd;function TP(){return sd}function MB(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function MC(e,t){t&&(Da("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function c1(e){u1(e),e.drafts_.forEach(OB),e.drafts_=null}function u1(e){e===sd&&(sd=e.parent_)}function OC(e){return sd=MB(sd,e)}function OB(e){const t=e[xr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function NC(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[xr].modified_&&(c1(t),vo(4)),Na(e)&&(e=Lp(t,e),t.parent_||Fp(t,e)),t.patches_&&Da("Patches").generateReplacementPatches_(n[xr].base_,e,t.patches_,t.inversePatches_)):e=Lp(t,n,[]),c1(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==$P?e:void 0}function Lp(e,t,n){if(Um(t))return t;const r=t[xr];if(!r)return id(t,(o,i)=>DC(e,r,t,o,i,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return Fp(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const o=r.copy_;let i=o,s=!1;r.type_===3&&(i=new Set(o),o.clear(),s=!0),id(i,(l,u)=>DC(e,r,o,l,u,n,s)),Fp(e,o,!1),n&&e.patches_&&Da("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function DC(e,t,n,r,o,i,s){if(cc(o)){const l=i&&t&&t.type_!==3&&!a1(t.assigned_,r)?i.concat(r):void 0,u=Lp(e,o,l);if(PP(n,r,u),cc(u))e.canAutoFreeze_=!1;else return}else s&&n.add(o);if(Na(o)&&!Um(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Lp(e,o),(!t||!t.scope_.parent_)&&Fp(e,o)}}function Fp(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&hx(t,n)}function NB(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:TP(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=px;n&&(o=[r],i=ad);const{revoke:s,proxy:l}=Proxy.revocable(o,i);return r.draft_=l,r.revoke_=s,l}var px={get(e,t){if(t===xr)return e;const n=ia(e);if(!a1(n,t))return DB(e,n,t);const r=n[t];return e.finalized_||!Na(r)?r:r===_0(e.base_,t)?(E0(e),e.copy_[t]=f1(r,e)):r},has(e,t){return t in ia(e)},ownKeys(e){return Reflect.ownKeys(ia(e))},set(e,t,n){const r=kP(ia(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const o=_0(ia(e),t),i=o==null?void 0:o[xr];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(TB(n,o)&&(n!==void 0||a1(e.base_,t)))return!0;E0(e),d1(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return _0(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,E0(e),d1(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=ia(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){vo(11)},getPrototypeOf(e){return lc(e.base_)},setPrototypeOf(){vo(12)}},ad={};id(px,(e,t)=>{ad[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});ad.deleteProperty=function(e,t){return ad.set.call(this,e,t,void 0)};ad.set=function(e,t,n){return px.set.call(this,e[0],t,n,e[0])};function _0(e,t){const n=e[xr];return(n?ia(n):e)[t]}function DB(e,t,n){var o;const r=kP(t,n);return r?"value"in r?r.value:(o=r.get)==null?void 0:o.call(e.draft_):void 0}function kP(e,t){if(!(t in e))return;let n=lc(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=lc(n)}}function d1(e){e.modified_||(e.modified_=!0,e.parent_&&d1(e.parent_))}function E0(e){e.copy_||(e.copy_=l1(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var IB=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const i=n;n=t;const s=this;return function(u=i,...f){return s.produce(u,m=>n.call(this,m,...f))}}typeof n!="function"&&vo(6),r!==void 0&&typeof r!="function"&&vo(7);let o;if(Na(t)){const i=OC(this),s=f1(t,void 0);let l=!0;try{o=n(s),l=!1}finally{l?c1(i):u1(i)}return MC(i,r),NC(o,i)}else if(!t||typeof t!="object"){if(o=n(t),o===void 0&&(o=t),o===$P&&(o=void 0),this.autoFreeze_&&hx(o,!0),r){const i=[],s=[];Da("Patches").generateReplacementPatches_(t,o,i,s),r(i,s)}return o}else vo(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...l)=>this.produceWithPatches(s,u=>t(u,...l));let r,o;return[this.produce(t,n,(s,l)=>{r=s,o=l}),r,o]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Na(e)||vo(8),cc(e)&&(e=LB(e));const t=OC(this),n=f1(e,void 0);return n[xr].isManual_=!0,u1(t),n}finishDraft(e,t){const n=e&&e[xr];(!n||!n.isManual_)&&vo(9);const{scope_:r}=n;return MC(r,t),NC(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const o=t[n];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}n>-1&&(t=t.slice(n+1));const r=Da("Patches").applyPatches_;return cc(e)?r(e,t):this.produce(e,o=>r(o,t))}};function f1(e,t){const n=Bm(e)?Da("MapSet").proxyMap_(e,t):zm(e)?Da("MapSet").proxySet_(e,t):NB(e,t);return(t?t.scope_:TP()).drafts_.push(n),n}function LB(e){return cc(e)||vo(10,e),AP(e)}function AP(e){if(!Na(e)||Um(e))return e;const t=e[xr];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=l1(e,t.scope_.immer_.useStrictShallowCopy_)}else n=l1(e,!0);return id(n,(r,o)=>{PP(n,r,AP(o))}),t&&(t.finalized_=!1),n}var br=new IB,FB=br.produce;br.produceWithPatches.bind(br);br.setAutoFreeze.bind(br);br.setUseStrictShallowCopy.bind(br);br.applyPatches.bind(br);br.createDraft.bind(br);br.finishDraft.bind(br);const jB=e=>(t,n,r)=>(r.setState=(o,i,...s)=>{const l=typeof o=="function"?FB(o):o;return t(l,i,...s)},e(r.setState,n,r)),BB=jB;var MP={exports:{}},OP={},NP={exports:{}},DP={};/**
* @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 uc=d;function zB(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var UB=typeof Object.is=="function"?Object.is:zB,VB=uc.useState,WB=uc.useEffect,HB=uc.useLayoutEffect,KB=uc.useDebugValue;function GB(e,t){var n=t(),r=VB({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return HB(function(){o.value=n,o.getSnapshot=t,C0(o)&&i({inst:o})},[e,n,t]),WB(function(){return C0(o)&&i({inst:o}),e(function(){C0(o)&&i({inst:o})})},[e]),KB(n),n}function C0(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!UB(e,n)}catch{return!0}}function YB(e,t){return t()}var XB=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?YB:GB;DP.useSyncExternalStore=uc.useSyncExternalStore!==void 0?uc.useSyncExternalStore:XB;NP.exports=DP;var ZB=NP.exports;/**
* @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 Vm=d,qB=ZB;function QB(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var JB=typeof Object.is=="function"?Object.is:QB,ez=qB.useSyncExternalStore,tz=Vm.useRef,nz=Vm.useEffect,rz=Vm.useMemo,oz=Vm.useDebugValue;OP.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=tz(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=rz(function(){function u(y){if(!f){if(f=!0,m=y,y=r(y),o!==void 0&&s.hasValue){var x=s.value;if(o(x,y))return p=x}return p=y}if(x=p,JB(m,y))return x;var S=r(y);return o!==void 0&&o(x,S)?x:(m=y,p=S)}var f=!1,m,p,g=n===void 0?null:n;return[function(){return u(t())},g===null?void 0:function(){return u(g())}]},[t,n,r,o]);var l=ez(e,i[0],i[1]);return nz(function(){s.hasValue=!0,s.value=l},[l]),oz(l),l};MP.exports=OP;var iz=MP.exports;const sz=pm(iz);var az={VITE_BACKEND:"http://127.0.0.1:8080",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const IC=e=>{let t;const n=new Set,r=(u,f)=>{const m=typeof u=="function"?u(t):u;if(!Object.is(m,t)){const p=t;t=f??typeof m!="object"?m:Object.assign({},t,m),n.forEach(g=>g(t,p))}},o=()=>t,l={setState:r,getState:o,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(az?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(r,o,l),l},lz=e=>e?IC(e):IC,{useDebugValue:cz}=Be,{useSyncExternalStoreWithSelector:uz}=sz;function dz(e,t=e.getState,n){const r=uz(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return cz(r),r}const LC=(e,t)=>{const n=lz(e),r=(o,i=t)=>dz(n,o,i);return Object.assign(r,n),r},fz=(e,t)=>e?LC(e,t):LC,hz=1,pz=1e6;let $0=0;function mz(){return $0=($0+1)%Number.MAX_VALUE,$0.toString()}const R0=new Map,FC=e=>{if(R0.has(e))return;const t=setTimeout(()=>{R0.delete(e),Iu({type:"REMOVE_TOAST",toastId:e})},pz);R0.set(e,t)},gz=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,hz)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?FC(n):e.toasts.forEach(r=>{FC(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},qh=[];let Qh={toasts:[]};function Iu(e){Qh=gz(Qh,e),qh.forEach(t=>{t(Qh)})}function hl({...e}){const t=mz(),n=o=>Iu({type:"UPDATE_TOAST",toast:{...o,id:t}}),r=()=>Iu({type:"DISMISS_TOAST",toastId:t});return Iu({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||r()}}}),{id:t,dismiss:r,update:n}}function Id(){const[e,t]=d.useState(Qh);return d.useEffect(()=>(qh.push(t),()=>{const n=qh.indexOf(t);n>-1&&qh.splice(n,1)}),[e]),{...e,toast:hl,dismiss:n=>Iu({type:"DISMISS_TOAST",toastId:n})}}const na={file:null,paintByExampleFile:null,customMask:null,imageHeight:0,imageWidth:0,isInpainting:!1,isPluginRunning:!1,isAdjustingMask:!1,disableShortCuts:!1,windowSize:{height:600,width:800},editorState:{baseBrushSize:uF,brushSizeScale:1,renders:[],extraMasks:[],prevExtraMasks:[],temporaryMasks:[],lineGroups:[],lastLineGroup:[],curLineGroup:[],redoRenders:[],redoCurLines:[],redoLineGroups:[]},interactiveSegState:{isInteractiveSeg:!1,tmpInteractiveSegMask:null,clicks:[]},cropperState:{x:0,y:0,width:512,height:512},extenderState:{x:0,y:0,width:512,height:512},isCropperExtenderResizing:!1,fileManagerState:{sortBy:Ps.CTIME,sortOrder:Ou.DESCENDING,layout:"masonry",searchText:"",inputDirectory:"",outputDirectory:""},serverConfig:{plugins:[],modelInfos:[],removeBGModel:"briaai/RMBG-1.4",removeBGModels:[],realesrganModel:"realesr-general-x4v3",realesrganModels:[],interactiveSegModel:"vit_b",interactiveSegModels:[],enableFileManager:!1,enableAutoSaving:!1,enableControlnet:!1,controlnetMethod:"lllyasviel/control_v11p_sd15_canny",disableModelSwitch:!1,isDesktop:!1,samplers:["DPM++ 2M SDE Karras"]},settings:{model:{name:"lama",path:"lama",model_type:"inpaint",support_controlnet:!1,support_brushnet:!1,support_strength:!1,support_outpainting:!1,support_powerpaint_v2:!1,controlnets:[],brushnets:[],support_lcm_lora:!1,is_single_file_diffusers:!1,need_prompt:!1},showCropper:!1,showExtender:!1,extenderDirection:Ln.xy,enableDownloadMask:!1,enableManualInpainting:!1,enableUploadMask:!1,enableAutoExtractPrompt:!0,ldmSteps:30,ldmSampler:nx.ddim,zitsWireframe:!0,cv2Radius:5,cv2Flag:rx.INPAINT_NS,prompt:"",negativePrompt:mF,seed:42,seedFixed:!1,sdMaskBlur:12,sdStrength:1,sdSteps:50,sdGuidanceScale:7.5,sdSampler:"DPM++ 2M",sdMatchHistograms:!1,sdScale:1,p2pImageGuidanceScale:1.5,enableControlnet:!1,controlnetMethod:"lllyasviel/control_v11p_sd15_canny",controlnetConditioningScale:.4,enableBrushNet:!1,brushnetMethod:"random_mask",brushnetConditioningScale:1,enableLCMLora:!1,enablePowerPaintV2:!1,powerpaintTask:ma.text_guided,adjustMaskKernelSize:12}},xt=fz()($B(BB((e,t)=>({...na,showPrevMask:async()=>{if(t().settings.showExtender)return;const{lastLineGroup:n,curLineGroup:r,prevExtraMasks:o,extraMasks:i}=t().editorState;if(r.length!==0||i.length!==0)return;const{imageWidth:s,imageHeight:l}=t(),u=Gh(s,l,[n],o,Kh);try{const f=await mC(u);e(m=>{m.editorState.temporaryMasks.push(f)})}catch(f){console.error(f);return}},hidePrevMask:()=>{e(n=>{n.editorState.temporaryMasks=[]})},getCurrentTargetFile:async()=>{const n=t().file,r=t().editorState.renders;let o=n;if(r.length>0){const i=r[r.length-1];o=await Nu(i.currentSrc,n.name,n.type)}return o},runInpainting:async()=>{const{isInpainting:n,file:r,paintByExampleFile:o,imageWidth:i,imageHeight:s,settings:l,cropperState:u,extenderState:f}=t();if(n||r===null||t().settings.model.support_outpainting&&l.showExtender&&f.x===0&&f.y===0&&f.height===s&&f.width===i)return;const{lastLineGroup:m,curLineGroup:p,lineGroups:g,renders:y,prevExtraMasks:x,extraMasks:S}=t().editorState,E=p.length===0&&S.length===0&&!l.showExtender;let _=[],b=[];if(E===!0?(b=m,_=x):(b=p,_=S),b.length===0&&_===null&&!l.showExtender){hl({variant:"destructive",description:"Please draw mask on picture"});return}const C=[...g,b];e(O=>{O.isInpainting=!0});let R=r;if(E===!0){if(y.length>1){const O=y[y.length-2];R=await Nu(O.currentSrc,r.name,r.type)}}else if(y.length>0){const O=y[y.length-1];R=await Nu(O.currentSrc,r.name,r.type)}const k=Gh(i,s,[b],_,Kh);if(E){const O=await mC(k);e(A=>{A.editorState.temporaryMasks=[O]})}try{const O=await Uj(R,l,u,f,pC(k.toDataURL()),o),{blob:A,seed:I}=O;I&&t().setSeed(parseInt(I,10));const z=new Image;await bu(z,A);const H=[...y,z];t().setImageSize(z.width,z.height),t().updateEditorState({renders:H,lineGroups:C,lastLineGroup:b,curLineGroup:[],extraMasks:[],prevExtraMasks:_})}catch(O){hl({variant:"destructive",description:O.message?O.message:O.toString()})}t().resetRedoState(),e(O=>{O.isInpainting=!1,O.editorState.temporaryMasks=[]})},runRenderablePlugin:async(n,r,o={upscale:1})=>{const{renders:i,lineGroups:s}=t().editorState;e(l=>{l.isPluginRunning=!0});try{const l=new Date,u=await t().getCurrentTargetFile(),f=await _P(n,r,u,o.upscale),{blob:m}=f;if(n){const y=new Image;await bu(y,m),e(x=>{x.editorState.extraMasks.push(y)})}else{const y=new Image;await bu(y,m),t().setImageSize(y.width,y.height);const x=[...i,y],S=[...s,[]];t().updateEditorState({renders:x,lineGroups:S})}const g=new Date().getTime()-l.getTime();hl({description:`Run ${r} successfully in ${g/1e3}s`})}catch(l){hl({variant:"destructive",description:l.message?l.message:l.toString()})}e(l=>{l.isPluginRunning=!1})},updateEditorState:n=>{e(r=>{r.editorState={...r.editorState,...n}})},cleanCurLineGroup:()=>{t().updateEditorState({curLineGroup:[]})},handleCanvasMouseDown:n=>{let r=[];const o=t();o.runMannually()&&(r=[...o.editorState.curLineGroup]),r.push({size:o.getBrushSize(),pts:[n]}),e(i=>{i.editorState.curLineGroup=r})},handleCanvasMouseMove:n=>{e(r=>{const o=r.editorState.curLineGroup;o.length&&o[o.length-1].pts.push(n)})},runMannually:()=>{const n=t();return n.settings.enableManualInpainting||n.settings.model.model_type!==ms},getIsProcessing:()=>t().isInpainting||t().isPluginRunning||t().isAdjustingMask,isSD:()=>t().settings.model.model_type!==ms,undoDisabled:()=>{const n=t().editorState;if(n.renders.length>0)return!1;if(t().runMannually()){if(n.curLineGroup.length===0)return!0}else if(n.renders.length===0)return!0;return!1},undo:()=>{t().runMannually()&&t().editorState.curLineGroup.length!==0?e(n=>{const r=n.editorState;if(r.curLineGroup.length===0)return;r.lastLineGroup=[];const o=r.curLineGroup.pop();r.redoCurLines.push(o)}):e(n=>{const r=n.editorState;if(r.renders.length===0||r.lineGroups.length===0)return;const o=r.lineGroups.pop();r.redoLineGroups.push(o),r.redoCurLines=[],r.curLineGroup=[];const i=r.renders.pop();r.redoRenders.push(i)})},redoDisabled:()=>{const n=t().editorState;if(n.redoRenders.length>0)return!1;if(t().runMannually()){if(n.redoCurLines.length===0)return!0}else if(n.redoRenders.length===0)return!0;return!1},redo:()=>{t().runMannually()&&t().editorState.redoCurLines.length!==0?e(n=>{const r=n.editorState;if(r.redoCurLines.length===0)return;const o=r.redoCurLines.pop();r.curLineGroup.push(o)}):e(n=>{const r=n.editorState;if(r.redoRenders.length===0||r.redoLineGroups.length===0)return;const o=r.redoLineGroups.pop();r.lineGroups.push(o),r.curLineGroup=[];const i=r.redoRenders.pop();r.renders.push(i)})},resetRedoState:()=>{e(n=>{n.editorState.redoCurLines=[],n.editorState.redoLineGroups=[],n.editorState.redoRenders=[]})},updateAppState:n=>{e(()=>n)},getBrushSize:()=>t().editorState.baseBrushSize*t().editorState.brushSizeScale,showPromptInput:()=>{const n=t().settings.model;return n.model_type!==ms&&n.name!==JR},setServerConfig:n=>{e(r=>{r.serverConfig=n,r.settings.enableControlnet=n.enableControlnet,r.settings.controlnetMethod=n.controlnetMethod})},updateSettings:n=>{e(r=>{r.settings={...r.settings,...n}})},updateEnablePowerPaintV2:n=>{t().updateSettings({enablePowerPaintV2:n}),n&&t().updateSettings({enableBrushNet:!1,enableControlnet:!1,enableLCMLora:!1})},updateEnableBrushNet:n=>{t().updateSettings({enableBrushNet:n}),n&&t().updateSettings({enablePowerPaintV2:!1,enableControlnet:!1,enableLCMLora:!1})},updateEnableControlnet(n){t().updateSettings({enableControlnet:n}),n&&t().updateSettings({enablePowerPaintV2:!1,enableBrushNet:!1})},updateLCMLora(n){t().updateSettings({enableLCMLora:n}),n&&t().updateSettings({enablePowerPaintV2:!1,enableBrushNet:!1})},setModel:n=>{e(r=>{r.settings.model=n,n.support_controlnet&&!n.controlnets.includes(r.settings.controlnetMethod)&&(r.settings.controlnetMethod=n.controlnets[0])})},updateFileManagerState:n=>{e(r=>{r.fileManagerState={...r.fileManagerState,...n}})},updateInteractiveSegState:n=>{e(r=>({...r,interactiveSegState:{...r.interactiveSegState,...n}}))},resetInteractiveSegState:()=>{t().updateInteractiveSegState(na.interactiveSegState)},handleInteractiveSegAccept:()=>{e(n=>{n.interactiveSegState.tmpInteractiveSegMask&&n.editorState.extraMasks.push(n.interactiveSegState.tmpInteractiveSegMask),n.interactiveSegState={...na.interactiveSegState}})},handleFileManagerMaskSelect:async n=>{const r=new Image;await bu(r,URL.createObjectURL(n)),e(o=>{o.editorState.extraMasks.push(r)}),t().runInpainting()},setIsInpainting:n=>e(r=>{r.isInpainting=n}),setFile:async n=>{if(t().settings.enableAutoExtractPrompt)try{const r=await Xj(n);r.prompt&&e(o=>{o.settings.prompt=r.prompt}),r.negative_prompt&&e(o=>{o.settings.negativePrompt=r.negative_prompt})}catch(r){hl({variant:"destructive",description:r.message?r.message:r.toString()})}e(r=>{r.file=n,r.interactiveSegState=na.interactiveSegState,r.editorState=na.editorState,r.cropperState=na.cropperState})},setCustomFile:n=>e(r=>{r.customMask=n}),setBaseBrushSize:n=>e(r=>{r.editorState.baseBrushSize=n}),decreaseBaseBrushSize:()=>{const n=t().editorState.baseBrushSize;let r=n;n>10&&(r=n-10),n<=10&&n>0&&(r=n-3),t().setBaseBrushSize(r)},increaseBaseBrushSize:()=>{const n=t().editorState.baseBrushSize,r=Math.min(n+10,QR);t().setBaseBrushSize(r)},setImageSize:(n,r)=>{e(o=>{o.imageWidth=n,o.imageHeight=r,o.editorState.brushSizeScale=Math.max(Math.min(n,r),512)/512}),t().resetExtender(n,r)},setCropperX:n=>e(r=>{r.cropperState.x=n}),setCropperY:n=>e(r=>{r.cropperState.y=n}),setCropperWidth:n=>e(r=>{r.cropperState.width=n}),setCropperHeight:n=>e(r=>{r.cropperState.height=n}),setExtenderX:n=>e(r=>{r.extenderState.x=n}),setExtenderY:n=>e(r=>{r.extenderState.y=n}),setExtenderWidth:n=>e(r=>{r.extenderState.width=n}),setExtenderHeight:n=>e(r=>{r.extenderState.height=n}),setIsCropperExtenderResizing:n=>e(r=>{r.isCropperExtenderResizing=n}),updateExtenderDirection:n=>{console.log(`updateExtenderDirection: ${JSON.stringify(t().extenderState)}`),e(r=>{r.settings.extenderDirection=n,r.extenderState.x=0,r.extenderState.y=0,r.extenderState.width=r.imageWidth,r.extenderState.height=r.imageHeight}),t().updateExtenderByBuiltIn(n,1.5)},updateExtenderByBuiltIn:(n,r)=>{const o={...na.extenderState};let{x:i,y:s,width:l,height:u}=o;const{imageWidth:f,imageHeight:m}=t();switch(l=f,u=m,n){case Ln.x:i=-Math.ceil(f*(r-1)/2),l=Math.ceil(f*r);break;case Ln.y:s=-Math.ceil(m*(r-1)/2),u=Math.ceil(m*r);break;case Ln.xy:i=-Math.ceil(f*(r-1)/2),s=-Math.ceil(m*(r-1)/2),l=Math.ceil(f*r),u=Math.ceil(m*r);break}e(p=>{p.extenderState.x=i,p.extenderState.y=s,p.extenderState.width=l,p.extenderState.height=u})},resetExtender:(n,r)=>{e(o=>{o.extenderState.x=0,o.extenderState.y=0,o.extenderState.width=n,o.extenderState.height=r})},setSeed:n=>e(r=>{r.settings.seed=n}),adjustMask:async n=>{const{imageWidth:r,imageHeight:o}=t(),{curLineGroup:i,extraMasks:s}=t().editorState,{adjustMaskKernelSize:l}=t().settings;if(i.length===0&&s.length===0)return;e(g=>{g.isAdjustingMask=!0});const u=Gh(r,o,[i],s,Kh),f=pC(u.toDataURL()),m=await Zj(f,n,l),p=await vF(m);e(g=>{g.editorState.extraMasks=[p],g.editorState.curLineGroup=[]}),e(g=>{g.isAdjustingMask=!1})},clearMask:()=>{e(n=>{n.editorState.extraMasks=[],n.editorState.curLineGroup=[]})}})),{name:"ZUSTAND_STATE",version:2,partialize:e=>Object.fromEntries(Object.entries(e).filter(([t])=>["fileManagerState","settings"].includes(t)))}),RB),Wm=d.forwardRef(({className:e,type:t,...n},r)=>{const o=xt(l=>l.updateAppState),i=()=>{o({disableShortCuts:!0})},s=()=>{o({disableShortCuts:!1})};return v.jsx("input",{type:t,className:xe("flex h-8 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,autoComplete:"off",tabIndex:-1,onFocus:i,onBlur:s,...n})});Wm.displayName="Input";const No=d.forwardRef(({numberValue:e,allowFloat:t,onNumberValueChange:n,className:r,...o},i)=>{const[s,l]=d.useState(e.toString());d.useEffect(()=>{s!==e.toString()+"."&&l(e.toString())},[e]);const u=f=>{let p=f.target.value;if(t){if(p=p.replace(/[^0-9.]/g,"").replace(/(\..*?)\..*/g,"$1"),p.length===0){n(0);return}n(parseFloat(p))}else{if(p=p.replace(/\D/g,""),p.length===0){n(0);return}n(parseInt(p,10))}l(p)};return v.jsx(Wm,{ref:i,value:s,onInput:u,className:xe("text-center h-7 px-1",r),...o})});function fe(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function vz(e,t){const n=d.createContext(t);function r(i){const{children:s,...l}=i,u=d.useMemo(()=>l,Object.values(l));return d.createElement(n.Provider,{value:u},s)}function o(i){const s=d.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return r.displayName=e+"Provider",[r,o]}function Tn(e,t=[]){let n=[];function r(i,s){const l=d.createContext(s),u=n.length;n=[...n,s];function f(p){const{scope:g,children:y,...x}=p,S=(g==null?void 0:g[e][u])||l,E=d.useMemo(()=>x,Object.values(x));return d.createElement(S.Provider,{value:E},y)}function m(p,g){const y=(g==null?void 0:g[e][u])||l,x=d.useContext(y);if(x)return x;if(s!==void 0)return s;throw new Error(`\`${p}\` must be used within \`${i}\``)}return f.displayName=i+"Provider",[f,m]}const o=()=>{const i=n.map(s=>d.createContext(s));return function(l){const u=(l==null?void 0:l[e])||i;return d.useMemo(()=>({[`__scope${e}`]:{...l,[e]:u}}),[l,u])}};return o.scopeName=e,[r,yz(o,...t)]}function yz(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((l,{useScope:u,scopeName:f})=>{const p=u(i)[`__scope${f}`];return{...l,...p}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}const wz=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ae=wz.reduce((e,t)=>{const n=d.forwardRef((r,o)=>{const{asChild:i,...s}=r,l=i?Qo:t;return d.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),d.createElement(l,Y({},s,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function mx(e,t){e&&Bs.flushSync(()=>e.dispatchEvent(t))}function Lt(e){const t=d.useRef(e);return d.useEffect(()=>{t.current=e}),d.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function xz(e,t=globalThis==null?void 0:globalThis.document){const n=Lt(e);d.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const h1="dismissableLayer.update",bz="dismissableLayer.pointerDownOutside",Sz="dismissableLayer.focusOutside";let jC;const IP=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),$c=d.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:l,onDismiss:u,...f}=e,m=d.useContext(IP),[p,g]=d.useState(null),y=(n=p==null?void 0:p.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,x]=d.useState({}),S=Ve(t,I=>g(I)),E=Array.from(m.layers),[_]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),b=E.indexOf(_),C=p?E.indexOf(p):-1,R=m.layersWithOutsidePointerEventsDisabled.size>0,k=C>=b,O=Ez(I=>{const z=I.target,H=[...m.branches].some(ie=>ie.contains(z));!k||H||(i==null||i(I),l==null||l(I),I.defaultPrevented||u==null||u())},y),A=Cz(I=>{const z=I.target;[...m.branches].some(ie=>ie.contains(z))||(s==null||s(I),l==null||l(I),I.defaultPrevented||u==null||u())},y);return xz(I=>{C===m.layers.size-1&&(o==null||o(I),!I.defaultPrevented&&u&&(I.preventDefault(),u()))},y),d.useEffect(()=>{if(p)return r&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(jC=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(p)),m.layers.add(p),BC(),()=>{r&&m.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=jC)}},[p,y,r,m]),d.useEffect(()=>()=>{p&&(m.layers.delete(p),m.layersWithOutsidePointerEventsDisabled.delete(p),BC())},[p,m]),d.useEffect(()=>{const I=()=>x({});return document.addEventListener(h1,I),()=>document.removeEventListener(h1,I)},[]),d.createElement(Ae.div,Y({},f,{ref:S,style:{pointerEvents:R?k?"auto":"none":void 0,...e.style},onFocusCapture:fe(e.onFocusCapture,A.onFocusCapture),onBlurCapture:fe(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:fe(e.onPointerDownCapture,O.onPointerDownCapture)}))}),_z=d.forwardRef((e,t)=>{const n=d.useContext(IP),r=d.useRef(null),o=Ve(t,r);return d.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),d.createElement(Ae.div,Y({},e,{ref:o}))});function Ez(e,t=globalThis==null?void 0:globalThis.document){const n=Lt(e),r=d.useRef(!1),o=d.useRef(()=>{});return d.useEffect(()=>{const i=l=>{if(l.target&&!r.current){let m=function(){LP(bz,n,f,{discrete:!0})};var u=m;const f={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=m,t.addEventListener("click",o.current,{once:!0})):m()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Cz(e,t=globalThis==null?void 0:globalThis.document){const n=Lt(e),r=d.useRef(!1);return d.useEffect(()=>{const o=i=>{i.target&&!r.current&&LP(Sz,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function BC(){const e=new CustomEvent(h1);document.dispatchEvent(e)}function LP(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?mx(o,i):o.dispatchEvent(i)}const $z=$c,Rz=_z,Pn=globalThis!=null&&globalThis.document?d.useLayoutEffect:()=>{},Pz=V9.useId||(()=>{});let Tz=0;function tr(e){const[t,n]=d.useState(Pz());return Pn(()=>{e||n(r=>r??String(Tz++))},[e]),e||(t?`radix-${t}`:"")}const kz=["top","right","bottom","left"],Os=Math.min,pr=Math.max,jp=Math.round,mh=Math.floor,Ns=e=>({x:e,y:e}),Az={left:"right",right:"left",bottom:"top",top:"bottom"},Mz={start:"end",end:"start"};function p1(e,t,n){return pr(e,Os(t,n))}function Ri(e,t){return typeof e=="function"?e(t):e}function Pi(e){return e.split("-")[0]}function Rc(e){return e.split("-")[1]}function gx(e){return e==="x"?"y":"x"}function vx(e){return e==="y"?"height":"width"}function Pc(e){return["top","bottom"].includes(Pi(e))?"y":"x"}function yx(e){return gx(Pc(e))}function Oz(e,t,n){n===void 0&&(n=!1);const r=Rc(e),o=yx(e),i=vx(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Bp(s)),[s,Bp(s)]}function Nz(e){const t=Bp(e);return[m1(e),t,m1(t)]}function m1(e){return e.replace(/start|end/g,t=>Mz[t])}function Dz(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function Iz(e,t,n,r){const o=Rc(e);let i=Dz(Pi(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(m1)))),i}function Bp(e){return e.replace(/left|right|bottom|top/g,t=>Az[t])}function Lz(e){return{top:0,right:0,bottom:0,left:0,...e}}function FP(e){return typeof e!="number"?Lz(e):{top:e,right:e,bottom:e,left:e}}function zp(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function zC(e,t,n){let{reference:r,floating:o}=e;const i=Pc(t),s=yx(t),l=vx(s),u=Pi(t),f=i==="y",m=r.x+r.width/2-o.width/2,p=r.y+r.height/2-o.height/2,g=r[l]/2-o[l]/2;let y;switch(u){case"top":y={x:m,y:r.y-o.height};break;case"bottom":y={x:m,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:p};break;case"left":y={x:r.x-o.width,y:p};break;default:y={x:r.x,y:r.y}}switch(Rc(t)){case"start":y[s]-=g*(n&&f?-1:1);break;case"end":y[s]+=g*(n&&f?-1:1);break}return y}const Fz=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,l=i.filter(Boolean),u=await(s.isRTL==null?void 0:s.isRTL(t));let f=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:m,y:p}=zC(f,r,u),g=r,y={},x=0;for(let S=0;S<l.length;S++){const{name:E,fn:_}=l[S],{x:b,y:C,data:R,reset:k}=await _({x:m,y:p,initialPlacement:r,placement:g,strategy:o,middlewareData:y,rects:f,platform:s,elements:{reference:e,floating:t}});if(m=b??m,p=C??p,y={...y,[E]:{...y[E],...R}},k&&x<=50){x++,typeof k=="object"&&(k.placement&&(g=k.placement),k.rects&&(f=k.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):k.rects),{x:m,y:p}=zC(f,g,u)),S=-1;continue}}return{x:m,y:p,placement:g,strategy:o,middlewareData:y}};async function ld(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:l,strategy:u}=e,{boundary:f="clippingAncestors",rootBoundary:m="viewport",elementContext:p="floating",altBoundary:g=!1,padding:y=0}=Ri(t,e),x=FP(y),E=l[g?p==="floating"?"reference":"floating":p],_=zp(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(E)))==null||n?E:E.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:f,rootBoundary:m,strategy:u})),b=p==="floating"?{...s.floating,x:r,y:o}:s.reference,C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),R=await(i.isElement==null?void 0:i.isElement(C))?await(i.getScale==null?void 0:i.getScale(C))||{x:1,y:1}:{x:1,y:1},k=zp(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:b,offsetParent:C,strategy:u}):b);return{top:(_.top-k.top+x.top)/R.y,bottom:(k.bottom-_.bottom+x.bottom)/R.y,left:(_.left-k.left+x.left)/R.x,right:(k.right-_.right+x.right)/R.x}}const UC=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:l,middlewareData:u}=t,{element:f,padding:m=0}=Ri(e,t)||{};if(f==null)return{};const p=FP(m),g={x:n,y:r},y=yx(o),x=vx(y),S=await s.getDimensions(f),E=y==="y",_=E?"top":"left",b=E?"bottom":"right",C=E?"clientHeight":"clientWidth",R=i.reference[x]+i.reference[y]-g[y]-i.floating[x],k=g[y]-i.reference[y],O=await(s.getOffsetParent==null?void 0:s.getOffsetParent(f));let A=O?O[C]:0;(!A||!await(s.isElement==null?void 0:s.isElement(O)))&&(A=l.floating[C]||i.floating[x]);const I=R/2-k/2,z=A/2-S[x]/2-1,H=Os(p[_],z),ie=Os(p[b],z),K=H,te=A-S[x]-ie,U=A/2-S[x]/2+I,re=p1(K,U,te),V=!u.arrow&&Rc(o)!=null&&U!=re&&i.reference[x]/2-(U<K?H:ie)-S[x]/2<0,J=V?U<K?U-K:U-te:0;return{[y]:g[y]+J,data:{[y]:re,centerOffset:U-re-J,...V&&{alignmentOffset:J}},reset:V}}}),jz=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:l,platform:u,elements:f}=t,{mainAxis:m=!0,crossAxis:p=!0,fallbackPlacements:g,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:S=!0,...E}=Ri(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const _=Pi(o),b=Pi(l)===l,C=await(u.isRTL==null?void 0:u.isRTL(f.floating)),R=g||(b||!S?[Bp(l)]:Nz(l));!g&&x!=="none"&&R.push(...Iz(l,S,x,C));const k=[l,...R],O=await ld(t,E),A=[];let I=((r=i.flip)==null?void 0:r.overflows)||[];if(m&&A.push(O[_]),p){const K=Oz(o,s,C);A.push(O[K[0]],O[K[1]])}if(I=[...I,{placement:o,overflows:A}],!A.every(K=>K<=0)){var z,H;const K=(((z=i.flip)==null?void 0:z.index)||0)+1,te=k[K];if(te)return{data:{index:K,overflows:I},reset:{placement:te}};let U=(H=I.filter(re=>re.overflows[0]<=0).sort((re,V)=>re.overflows[1]-V.overflows[1])[0])==null?void 0:H.placement;if(!U)switch(y){case"bestFit":{var ie;const re=(ie=I.map(V=>[V.placement,V.overflows.filter(J=>J>0).reduce((J,G)=>J+G,0)]).sort((V,J)=>V[1]-J[1])[0])==null?void 0:ie[0];re&&(U=re);break}case"initialPlacement":U=l;break}if(o!==U)return{reset:{placement:U}}}return{}}}};function VC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function WC(e){return kz.some(t=>e[t]>=0)}const Bz=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Ri(e,t);switch(r){case"referenceHidden":{const i=await ld(t,{...o,elementContext:"reference"}),s=VC(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:WC(s)}}}case"escaped":{const i=await ld(t,{...o,altBoundary:!0}),s=VC(i,n.floating);return{data:{escapedOffsets:s,escaped:WC(s)}}}default:return{}}}}};async function zz(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Pi(n),l=Rc(n),u=Pc(n)==="y",f=["left","top"].includes(s)?-1:1,m=i&&u?-1:1,p=Ri(t,e);let{mainAxis:g,crossAxis:y,alignmentAxis:x}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...p};return l&&typeof x=="number"&&(y=l==="end"?x*-1:x),u?{x:y*m,y:g*f}:{x:g*f,y:y*m}}const Uz=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await zz(t,e);return{x:n+o.x,y:r+o.y,data:o}}}},Vz=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:E=>{let{x:_,y:b}=E;return{x:_,y:b}}},...u}=Ri(e,t),f={x:n,y:r},m=await ld(t,u),p=Pc(Pi(o)),g=gx(p);let y=f[g],x=f[p];if(i){const E=g==="y"?"top":"left",_=g==="y"?"bottom":"right",b=y+m[E],C=y-m[_];y=p1(b,y,C)}if(s){const E=p==="y"?"top":"left",_=p==="y"?"bottom":"right",b=x+m[E],C=x-m[_];x=p1(b,x,C)}const S=l.fn({...t,[g]:y,[p]:x});return{...S,data:{x:S.x-n,y:S.y-r}}}}},Wz=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:l=0,mainAxis:u=!0,crossAxis:f=!0}=Ri(e,t),m={x:n,y:r},p=Pc(o),g=gx(p);let y=m[g],x=m[p];const S=Ri(l,t),E=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(u){const C=g==="y"?"height":"width",R=i.reference[g]-i.floating[C]+E.mainAxis,k=i.reference[g]+i.reference[C]-E.mainAxis;y<R?y=R:y>k&&(y=k)}if(f){var _,b;const C=g==="y"?"width":"height",R=["top","left"].includes(Pi(o)),k=i.reference[p]-i.floating[C]+(R&&((_=s.offset)==null?void 0:_[p])||0)+(R?0:E.crossAxis),O=i.reference[p]+i.reference[C]+(R?0:((b=s.offset)==null?void 0:b[p])||0)-(R?E.crossAxis:0);x<k?x=k:x>O&&(x=O)}return{[g]:y,[p]:x}}}},Hz=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...l}=Ri(e,t),u=await ld(t,l),f=Pi(n),m=Rc(n),p=Pc(n)==="y",{width:g,height:y}=r.floating;let x,S;f==="top"||f==="bottom"?(x=f,S=m===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(S=f,x=m==="end"?"top":"bottom");const E=y-u[x],_=g-u[S],b=!t.middlewareData.shift;let C=E,R=_;if(p){const O=g-u.left-u.right;R=m||b?Os(_,O):O}else{const O=y-u.top-u.bottom;C=m||b?Os(E,O):O}if(b&&!m){const O=pr(u.left,0),A=pr(u.right,0),I=pr(u.top,0),z=pr(u.bottom,0);p?R=g-2*(O!==0||A!==0?O+A:pr(u.left,u.right)):C=y-2*(I!==0||z!==0?I+z:pr(u.top,u.bottom))}await s({...t,availableWidth:R,availableHeight:C});const k=await o.getDimensions(i.floating);return g!==k.width||y!==k.height?{reset:{rects:!0}}:{}}}};function Ds(e){return jP(e)?(e.nodeName||"").toLowerCase():"#document"}function yr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Di(e){var t;return(t=(jP(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function jP(e){return e instanceof Node||e instanceof yr(e).Node}function Ti(e){return e instanceof Element||e instanceof yr(e).Element}function Jo(e){return e instanceof HTMLElement||e instanceof yr(e).HTMLElement}function HC(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof yr(e).ShadowRoot}function Ld(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Jr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Kz(e){return["table","td","th"].includes(Ds(e))}function wx(e){const t=xx(),n=Jr(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Gz(e){let t=dc(e);for(;Jo(t)&&!Hm(t);){if(wx(t))return t;t=dc(t)}return null}function xx(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Hm(e){return["html","body","#document"].includes(Ds(e))}function Jr(e){return yr(e).getComputedStyle(e)}function Km(e){return Ti(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function dc(e){if(Ds(e)==="html")return e;const t=e.assignedSlot||e.parentNode||HC(e)&&e.host||Di(e);return HC(t)?t.host:t}function BP(e){const t=dc(e);return Hm(t)?e.ownerDocument?e.ownerDocument.body:e.body:Jo(t)&&Ld(t)?t:BP(t)}function cd(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=BP(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=yr(o);return i?t.concat(s,s.visualViewport||[],Ld(o)?o:[],s.frameElement&&n?cd(s.frameElement):[]):t.concat(o,cd(o,[],n))}function zP(e){const t=Jr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Jo(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,l=jp(n)!==i||jp(r)!==s;return l&&(n=i,r=s),{width:n,height:r,$:l}}function bx(e){return Ti(e)?e:e.contextElement}function Il(e){const t=bx(e);if(!Jo(t))return Ns(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=zP(t);let s=(i?jp(n.width):n.width)/r,l=(i?jp(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const Yz=Ns(0);function UP(e){const t=yr(e);return!xx()||!t.visualViewport?Yz:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Xz(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==yr(e)?!1:t}function Ia(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=bx(e);let s=Ns(1);t&&(r?Ti(r)&&(s=Il(r)):s=Il(e));const l=Xz(i,n,r)?UP(i):Ns(0);let u=(o.left+l.x)/s.x,f=(o.top+l.y)/s.y,m=o.width/s.x,p=o.height/s.y;if(i){const g=yr(i),y=r&&Ti(r)?yr(r):r;let x=g.frameElement;for(;x&&r&&y!==g;){const S=Il(x),E=x.getBoundingClientRect(),_=Jr(x),b=E.left+(x.clientLeft+parseFloat(_.paddingLeft))*S.x,C=E.top+(x.clientTop+parseFloat(_.paddingTop))*S.y;u*=S.x,f*=S.y,m*=S.x,p*=S.y,u+=b,f+=C,x=yr(x).frameElement}}return zp({width:m,height:p,x:u,y:f})}function Zz(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=Jo(n),i=Di(n);if(n===i)return t;let s={scrollLeft:0,scrollTop:0},l=Ns(1);const u=Ns(0);if((o||!o&&r!=="fixed")&&((Ds(n)!=="body"||Ld(i))&&(s=Km(n)),Jo(n))){const f=Ia(n);l=Il(n),u.x=f.x+n.clientLeft,u.y=f.y+n.clientTop}return{width:t.width*l.x,height:t.height*l.y,x:t.x*l.x-s.scrollLeft*l.x+u.x,y:t.y*l.y-s.scrollTop*l.y+u.y}}function qz(e){return Array.from(e.getClientRects())}function VP(e){return Ia(Di(e)).left+Km(e).scrollLeft}function Qz(e){const t=Di(e),n=Km(e),r=e.ownerDocument.body,o=pr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=pr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+VP(e);const l=-n.scrollTop;return Jr(r).direction==="rtl"&&(s+=pr(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:l}}function Jz(e,t){const n=yr(e),r=Di(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,l=0,u=0;if(o){i=o.width,s=o.height;const f=xx();(!f||f&&t==="fixed")&&(l=o.offsetLeft,u=o.offsetTop)}return{width:i,height:s,x:l,y:u}}function eU(e,t){const n=Ia(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Jo(e)?Il(e):Ns(1),s=e.clientWidth*i.x,l=e.clientHeight*i.y,u=o*i.x,f=r*i.y;return{width:s,height:l,x:u,y:f}}function KC(e,t,n){let r;if(t==="viewport")r=Jz(e,n);else if(t==="document")r=Qz(Di(e));else if(Ti(t))r=eU(t,n);else{const o=UP(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return zp(r)}function WP(e,t){const n=dc(e);return n===t||!Ti(n)||Hm(n)?!1:Jr(n).position==="fixed"||WP(n,t)}function tU(e,t){const n=t.get(e);if(n)return n;let r=cd(e,[],!1).filter(l=>Ti(l)&&Ds(l)!=="body"),o=null;const i=Jr(e).position==="fixed";let s=i?dc(e):e;for(;Ti(s)&&!Hm(s);){const l=Jr(s),u=wx(s);!u&&l.position==="fixed"&&(o=null),(i?!u&&!o:!u&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Ld(s)&&!u&&WP(e,s))?r=r.filter(m=>m!==s):o=l,s=dc(s)}return t.set(e,r),r}function nU(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?tU(t,this._c):[].concat(n),r],l=s[0],u=s.reduce((f,m)=>{const p=KC(t,m,o);return f.top=pr(p.top,f.top),f.right=Os(p.right,f.right),f.bottom=Os(p.bottom,f.bottom),f.left=pr(p.left,f.left),f},KC(t,l,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function rU(e){return zP(e)}function oU(e,t,n){const r=Jo(t),o=Di(t),i=n==="fixed",s=Ia(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const u=Ns(0);if(r||!r&&!i)if((Ds(t)!=="body"||Ld(o))&&(l=Km(t)),r){const f=Ia(t,!0,i,t);u.x=f.x+t.clientLeft,u.y=f.y+t.clientTop}else o&&(u.x=VP(o));return{x:s.left+l.scrollLeft-u.x,y:s.top+l.scrollTop-u.y,width:s.width,height:s.height}}function GC(e,t){return!Jo(e)||Jr(e).position==="fixed"?null:t?t(e):e.offsetParent}function HP(e,t){const n=yr(e);if(!Jo(e))return n;let r=GC(e,t);for(;r&&Kz(r)&&Jr(r).position==="static";)r=GC(r,t);return r&&(Ds(r)==="html"||Ds(r)==="body"&&Jr(r).position==="static"&&!wx(r))?n:r||Gz(e)||n}const iU=async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||HP,i=this.getDimensions;return{reference:oU(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}};function sU(e){return Jr(e).direction==="rtl"}const aU={convertOffsetParentRelativeRectToViewportRelativeRect:Zz,getDocumentElement:Di,getClippingRect:nU,getOffsetParent:HP,getElementRects:iU,getClientRects:qz,getDimensions:rU,getScale:Il,isElement:Ti,isRTL:sU};function lU(e,t){let n=null,r;const o=Di(e);function i(){clearTimeout(r),n&&n.disconnect(),n=null}function s(l,u){l===void 0&&(l=!1),u===void 0&&(u=1),i();const{left:f,top:m,width:p,height:g}=e.getBoundingClientRect();if(l||t(),!p||!g)return;const y=mh(m),x=mh(o.clientWidth-(f+p)),S=mh(o.clientHeight-(m+g)),E=mh(f),b={rootMargin:-y+"px "+-x+"px "+-S+"px "+-E+"px",threshold:pr(0,Os(1,u))||1};let C=!0;function R(k){const O=k[0].intersectionRatio;if(O!==u){if(!C)return s();O?s(!1,O):r=setTimeout(()=>{s(!1,1e-7)},100)}C=!1}try{n=new IntersectionObserver(R,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(R,b)}n.observe(e)}return s(!0),i}function cU(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,f=bx(e),m=o||i?[...f?cd(f):[],...cd(t)]:[];m.forEach(_=>{o&&_.addEventListener("scroll",n,{passive:!0}),i&&_.addEventListener("resize",n)});const p=f&&l?lU(f,n):null;let g=-1,y=null;s&&(y=new ResizeObserver(_=>{let[b]=_;b&&b.target===f&&y&&(y.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{y&&y.observe(t)})),n()}),f&&!u&&y.observe(f),y.observe(t));let x,S=u?Ia(e):null;u&&E();function E(){const _=Ia(e);S&&(_.x!==S.x||_.y!==S.y||_.width!==S.width||_.height!==S.height)&&n(),S=_,x=requestAnimationFrame(E)}return n(),()=>{m.forEach(_=>{o&&_.removeEventListener("scroll",n),i&&_.removeEventListener("resize",n)}),p&&p(),y&&y.disconnect(),y=null,u&&cancelAnimationFrame(x)}}const uU=(e,t,n)=>{const r=new Map,o={platform:aU,...n},i={...o.platform,_c:r};return Fz(e,t,{...o,platform:i})},dU=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?UC({element:r.current,padding:o}).fn(n):{}:r?UC({element:r,padding:o}).fn(n):{}}}};var Jh=typeof document<"u"?d.useLayoutEffect:d.useEffect;function Up(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!Up(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Up(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function KP(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function YC(e,t){const n=KP(e);return Math.round(t*n)/n}function XC(e){const t=d.useRef(e);return Jh(()=>{t.current=e}),t}function fU(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:u,open:f}=e,[m,p]=d.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,y]=d.useState(r);Up(g,r)||y(r);const[x,S]=d.useState(null),[E,_]=d.useState(null),b=d.useCallback(V=>{V!=O.current&&(O.current=V,S(V))},[S]),C=d.useCallback(V=>{V!==A.current&&(A.current=V,_(V))},[_]),R=i||x,k=s||E,O=d.useRef(null),A=d.useRef(null),I=d.useRef(m),z=XC(u),H=XC(o),ie=d.useCallback(()=>{if(!O.current||!A.current)return;const V={placement:t,strategy:n,middleware:g};H.current&&(V.platform=H.current),uU(O.current,A.current,V).then(J=>{const G={...J,isPositioned:!0};K.current&&!Up(I.current,G)&&(I.current=G,Bs.flushSync(()=>{p(G)}))})},[g,t,n,H]);Jh(()=>{f===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,p(V=>({...V,isPositioned:!1})))},[f]);const K=d.useRef(!1);Jh(()=>(K.current=!0,()=>{K.current=!1}),[]),Jh(()=>{if(R&&(O.current=R),k&&(A.current=k),R&&k){if(z.current)return z.current(R,k,ie);ie()}},[R,k,ie,z]);const te=d.useMemo(()=>({reference:O,floating:A,setReference:b,setFloating:C}),[b,C]),U=d.useMemo(()=>({reference:R,floating:k}),[R,k]),re=d.useMemo(()=>{const V={position:n,left:0,top:0};if(!U.floating)return V;const J=YC(U.floating,m.x),G=YC(U.floating,m.y);return l?{...V,transform:"translate("+J+"px, "+G+"px)",...KP(U.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:J,top:G}},[n,l,U.floating,m.x,m.y]);return d.useMemo(()=>({...m,update:ie,refs:te,elements:U,floatingStyles:re}),[m,ie,te,U,re])}function Sx(e){const[t,n]=d.useState(void 0);return Pn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,l;if("borderBoxSize"in i){const u=i.borderBoxSize,f=Array.isArray(u)?u[0]:u;s=f.inlineSize,l=f.blockSize}else s=e.offsetWidth,l=e.offsetHeight;n({width:s,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const GP="Popper",[YP,zs]=Tn(GP),[hU,XP]=YP(GP),pU=e=>{const{__scopePopper:t,children:n}=e,[r,o]=d.useState(null);return d.createElement(hU,{scope:t,anchor:r,onAnchorChange:o},n)},mU="PopperAnchor",gU=d.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=XP(mU,n),s=d.useRef(null),l=Ve(t,s);return d.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:d.createElement(Ae.div,Y({},o,{ref:l}))}),ZP="PopperContent",[vU,ute]=YP(ZP),yU=d.forwardRef((e,t)=>{var n,r,o,i,s,l,u,f;const{__scopePopper:m,side:p="bottom",sideOffset:g=0,align:y="center",alignOffset:x=0,arrowPadding:S=0,avoidCollisions:E=!0,collisionBoundary:_=[],collisionPadding:b=0,sticky:C="partial",hideWhenDetached:R=!1,updatePositionStrategy:k="optimized",onPlaced:O,...A}=e,I=XP(ZP,m),[z,H]=d.useState(null),ie=Ve(t,Yt=>H(Yt)),[K,te]=d.useState(null),U=Sx(K),re=(n=U==null?void 0:U.width)!==null&&n!==void 0?n:0,V=(r=U==null?void 0:U.height)!==null&&r!==void 0?r:0,J=p+(y!=="center"?"-"+y:""),G=typeof b=="number"?b:{top:0,right:0,bottom:0,left:0,...b},Z=Array.isArray(_)?_:[_],Q=Z.length>0,le={padding:G,boundary:Z.filter(wU),altBoundary:Q},{refs:L,floatingStyles:ue,placement:Ne,isPositioned:Ke,middlewareData:Me}=fU({strategy:"fixed",placement:J,whileElementsMounted:(...Yt)=>cU(...Yt,{animationFrame:k==="always"}),elements:{reference:I.anchor},middleware:[Uz({mainAxis:g+V,alignmentAxis:x}),E&&Vz({mainAxis:!0,crossAxis:!1,limiter:C==="partial"?Wz():void 0,...le}),E&&jz({...le}),Hz({...le,apply:({elements:Yt,rects:rr,availableWidth:Jt,availableHeight:Li})=>{const{width:N,height:X}=rr.reference,ee=Yt.floating.style;ee.setProperty("--radix-popper-available-width",`${Jt}px`),ee.setProperty("--radix-popper-available-height",`${Li}px`),ee.setProperty("--radix-popper-anchor-width",`${N}px`),ee.setProperty("--radix-popper-anchor-height",`${X}px`)}}),K&&dU({element:K,padding:S}),xU({arrowWidth:re,arrowHeight:V}),R&&Bz({strategy:"referenceHidden",...le})]}),[me,be]=qP(Ne),Ee=Lt(O);Pn(()=>{Ke&&(Ee==null||Ee())},[Ke,Ee]);const Oe=(o=Me.arrow)===null||o===void 0?void 0:o.x,Ie=(i=Me.arrow)===null||i===void 0?void 0:i.y,ze=((s=Me.arrow)===null||s===void 0?void 0:s.centerOffset)!==0,[ht,st]=d.useState();return Pn(()=>{z&&st(window.getComputedStyle(z).zIndex)},[z]),d.createElement("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...ue,transform:Ke?ue.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ht,"--radix-popper-transform-origin":[(l=Me.transformOrigin)===null||l===void 0?void 0:l.x,(u=Me.transformOrigin)===null||u===void 0?void 0:u.y].join(" ")},dir:e.dir},d.createElement(vU,{scope:m,placedSide:me,onArrowChange:te,arrowX:Oe,arrowY:Ie,shouldHideArrow:ze},d.createElement(Ae.div,Y({"data-side":me,"data-align":be},A,{ref:ie,style:{...A.style,animation:Ke?void 0:"none",opacity:(f=Me.hide)!==null&&f!==void 0&&f.referenceHidden?0:void 0}}))))});function wU(e){return e!==null}const xU=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o,i,s;const{placement:l,rects:u,middlewareData:f}=t,p=((n=f.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,g=p?0:e.arrowWidth,y=p?0:e.arrowHeight,[x,S]=qP(l),E={start:"0%",center:"50%",end:"100%"}[S],_=((r=(o=f.arrow)===null||o===void 0?void 0:o.x)!==null&&r!==void 0?r:0)+g/2,b=((i=(s=f.arrow)===null||s===void 0?void 0:s.y)!==null&&i!==void 0?i:0)+y/2;let C="",R="";return x==="bottom"?(C=p?E:`${_}px`,R=`${-y}px`):x==="top"?(C=p?E:`${_}px`,R=`${u.floating.height+y}px`):x==="right"?(C=`${-y}px`,R=p?E:`${b}px`):x==="left"&&(C=`${u.floating.width+y}px`,R=p?E:`${b}px`),{data:{x:C,y:R}}}});function qP(e){const[t,n="center"]=e.split("-");return[t,n]}const Fd=pU,Gm=gU,Ym=yU,jd=d.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...o}=e;return r?JI.createPortal(d.createElement(Ae.div,Y({},o,{ref:t})),r):null});function bU(e,t){return d.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const xn=e=>{const{present:t,children:n}=e,r=SU(t),o=typeof n=="function"?n({present:r.isPresent}):d.Children.only(n),i=Ve(r.ref,o.ref);return typeof n=="function"||r.isPresent?d.cloneElement(o,{ref:i}):null};xn.displayName="Presence";function SU(e){const[t,n]=d.useState(),r=d.useRef({}),o=d.useRef(e),i=d.useRef("none"),s=e?"mounted":"unmounted",[l,u]=bU(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const f=gh(r.current);i.current=l==="mounted"?f:"none"},[l]),Pn(()=>{const f=r.current,m=o.current;if(m!==e){const g=i.current,y=gh(f);e?u("MOUNT"):y==="none"||(f==null?void 0:f.display)==="none"?u("UNMOUNT"):u(m&&g!==y?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),Pn(()=>{if(t){const f=p=>{const y=gh(r.current).includes(p.animationName);p.target===t&&y&&Bs.flushSync(()=>u("ANIMATION_END"))},m=p=>{p.target===t&&(i.current=gh(r.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:d.useCallback(f=>{f&&(r.current=getComputedStyle(f)),n(f)},[])}}function gh(e){return(e==null?void 0:e.animationName)||"none"}function eo({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=_U({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,l=Lt(n),u=d.useCallback(f=>{if(i){const p=typeof f=="function"?f(e):f;p!==e&&l(p)}else o(f)},[i,e,o,l]);return[s,u]}function _U({defaultProp:e,onChange:t}){const n=d.useState(e),[r]=n,o=d.useRef(r),i=Lt(t);return d.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const Xm=d.forwardRef((e,t)=>d.createElement(Ae.span,Y({},e,{ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}))),EU=Xm,[Zm,dte]=Tn("Tooltip",[zs]),_x=zs(),CU="TooltipProvider",$U=700,g1="tooltip.open",[RU,Ex]=Zm(CU),PU=e=>{const{__scopeTooltip:t,delayDuration:n=$U,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,[s,l]=d.useState(!0),u=d.useRef(!1),f=d.useRef(0);return d.useEffect(()=>{const m=f.current;return()=>window.clearTimeout(m)},[]),d.createElement(RU,{scope:t,isOpenDelayed:s,delayDuration:n,onOpen:d.useCallback(()=>{window.clearTimeout(f.current),l(!1)},[]),onClose:d.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>l(!0),r)},[r]),isPointerInTransitRef:u,onPointerInTransitChange:d.useCallback(m=>{u.current=m},[]),disableHoverableContent:o},i)},Cx="Tooltip",[TU,qm]=Zm(Cx),kU=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:s,delayDuration:l}=e,u=Ex(Cx,e.__scopeTooltip),f=_x(t),[m,p]=d.useState(null),g=tr(),y=d.useRef(0),x=s??u.disableHoverableContent,S=l??u.delayDuration,E=d.useRef(!1),[_=!1,b]=eo({prop:r,defaultProp:o,onChange:A=>{A?(u.onOpen(),document.dispatchEvent(new CustomEvent(g1))):u.onClose(),i==null||i(A)}}),C=d.useMemo(()=>_?E.current?"delayed-open":"instant-open":"closed",[_]),R=d.useCallback(()=>{window.clearTimeout(y.current),E.current=!1,b(!0)},[b]),k=d.useCallback(()=>{window.clearTimeout(y.current),b(!1)},[b]),O=d.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{E.current=!0,b(!0)},S)},[S,b]);return d.useEffect(()=>()=>window.clearTimeout(y.current),[]),d.createElement(Fd,f,d.createElement(TU,{scope:t,contentId:g,open:_,stateAttribute:C,trigger:m,onTriggerChange:p,onTriggerEnter:d.useCallback(()=>{u.isOpenDelayed?O():R()},[u.isOpenDelayed,O,R]),onTriggerLeave:d.useCallback(()=>{x?k():window.clearTimeout(y.current)},[k,x]),onOpen:R,onClose:k,disableHoverableContent:x},n))},ZC="TooltipTrigger",AU=d.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=qm(ZC,n),i=Ex(ZC,n),s=_x(n),l=d.useRef(null),u=Ve(t,l,o.onTriggerChange),f=d.useRef(!1),m=d.useRef(!1),p=d.useCallback(()=>f.current=!1,[]);return d.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),d.createElement(Gm,Y({asChild:!0},s),d.createElement(Ae.button,Y({"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute},r,{ref:u,onPointerMove:fe(e.onPointerMove,g=>{g.pointerType!=="touch"&&!m.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),m.current=!0)}),onPointerLeave:fe(e.onPointerLeave,()=>{o.onTriggerLeave(),m.current=!1}),onPointerDown:fe(e.onPointerDown,()=>{f.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:fe(e.onFocus,()=>{f.current||o.onOpen()}),onBlur:fe(e.onBlur,o.onClose),onClick:fe(e.onClick,o.onClose)})))}),MU="TooltipPortal",[fte,OU]=Zm(MU,{forceMount:void 0}),ud="TooltipContent",NU=d.forwardRef((e,t)=>{const n=OU(ud,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=qm(ud,e.__scopeTooltip);return d.createElement(xn,{present:r||s.open},s.disableHoverableContent?d.createElement(QP,Y({side:o},i,{ref:t})):d.createElement(DU,Y({side:o},i,{ref:t})))}),DU=d.forwardRef((e,t)=>{const n=qm(ud,e.__scopeTooltip),r=Ex(ud,e.__scopeTooltip),o=d.useRef(null),i=Ve(t,o),[s,l]=d.useState(null),{trigger:u,onClose:f}=n,m=o.current,{onPointerInTransitChange:p}=r,g=d.useCallback(()=>{l(null),p(!1)},[p]),y=d.useCallback((x,S)=>{const E=x.currentTarget,_={x:x.clientX,y:x.clientY},b=LU(_,E.getBoundingClientRect()),C=FU(_,b),R=jU(S.getBoundingClientRect()),k=zU([...C,...R]);l(k),p(!0)},[p]);return d.useEffect(()=>()=>g(),[g]),d.useEffect(()=>{if(u&&m){const x=E=>y(E,m),S=E=>y(E,u);return u.addEventListener("pointerleave",x),m.addEventListener("pointerleave",S),()=>{u.removeEventListener("pointerleave",x),m.removeEventListener("pointerleave",S)}}},[u,m,y,g]),d.useEffect(()=>{if(s){const x=S=>{const E=S.target,_={x:S.clientX,y:S.clientY},b=(u==null?void 0:u.contains(E))||(m==null?void 0:m.contains(E)),C=!BU(_,s);b?g():C&&(g(),f())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[u,m,s,f,g]),d.createElement(QP,Y({},e,{ref:i}))}),[IU,hte]=Zm(Cx,{isInside:!1}),QP=d.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...l}=e,u=qm(ud,n),f=_x(n),{onClose:m}=u;return d.useEffect(()=>(document.addEventListener(g1,m),()=>document.removeEventListener(g1,m)),[m]),d.useEffect(()=>{if(u.trigger){const p=g=>{const y=g.target;y!=null&&y.contains(u.trigger)&&m()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[u.trigger,m]),d.createElement($c,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:p=>p.preventDefault(),onDismiss:m},d.createElement(Ym,Y({"data-state":u.stateAttribute},f,l,{ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}}),d.createElement(fx,null,r),d.createElement(IU,{scope:n,isInside:!0},d.createElement(EU,{id:u.contentId,role:"tooltip"},o||r))))});function LU(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function FU(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function jU(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function BU(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const l=t[i].x,u=t[i].y,f=t[s].x,m=t[s].y;u>r!=m>r&&n<(f-l)*(r-u)/(m-u)+l&&(o=!o)}return o}function zU(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),UU(t)}function UU(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}const VU=PU,WU=kU,HU=AU,JP=NU,KU=VU,eT=WU,tT=HU,$x=d.forwardRef(({className:e,sideOffset:t=4,...n},r)=>v.jsx(JP,{ref:r,sideOffset:t,className:xe("z-50 border overflow-hidden rounded-md bg-background text-foreground px-3 py-1.5 text-xs animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));$x.displayName=JP.displayName;const Rx=Fm("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),vn=d.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const s=r?Qo:"button";return v.jsx(s,{className:xe(Rx({variant:t,size:n,className:e}),"outline-none cursor-default select-none"),ref:i,tabIndex:-1,...o})});vn.displayName="Button";const Zn=d.forwardRef(({tooltip:e,children:t,...n},r)=>v.jsxs(eT,{children:[v.jsx(tT,{asChild:!0,children:v.jsx(vn,{variant:"ghost",size:"icon",...n,ref:r,tabIndex:-1,className:"cursor-default bg-background",children:v.jsx("div",{className:"icon-button-icon-wrapper",children:t})})}),v.jsx($x,{children:v.jsx("p",{children:e})})]})),nT=e=>{const{onFileUpload:t,children:n,...r}=e,[o]=d.useState(`file-upload-${Math.random().toString()}`),i=s=>{var u;const l=(u=s.currentTarget.files)==null?void 0:u[0];l&&t(l)};return v.jsxs(v.Fragment,{children:[v.jsx("label",{htmlFor:o,children:v.jsx(Zn,{...r,asChild:!0,children:n})}),v.jsx(Wm,{style:{display:"none"},id:o,name:o,type:"file",onChange:i,accept:"image/png, image/jpeg"})]})};function GU(e,t){const[n,r]=d.useState(e);return d.useEffect(()=>{const o=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(o)}},[e,t]),n}function rT(e){const[t,n]=d.useState(()=>typeof e=="boolean"?e:!!e),r=d.useCallback(o=>n(typeof o=="boolean"?o:i=>!i),[]);return[t,r]}const P0="focusScope.autoFocusOnMount",T0="focusScope.autoFocusOnUnmount",qC={bubbles:!1,cancelable:!0},Qm=d.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[l,u]=d.useState(null),f=Lt(o),m=Lt(i),p=d.useRef(null),g=Ve(t,S=>u(S)),y=d.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;d.useEffect(()=>{if(r){let b=function(O){if(y.paused||!l)return;const A=O.target;l.contains(A)?p.current=A:ts(p.current,{select:!0})},C=function(O){if(y.paused||!l)return;const A=O.relatedTarget;A!==null&&(l.contains(A)||ts(p.current,{select:!0}))},R=function(O){if(document.activeElement===document.body)for(const I of O)I.removedNodes.length>0&&ts(l)};var S=b,E=C,_=R;document.addEventListener("focusin",b),document.addEventListener("focusout",C);const k=new MutationObserver(R);return l&&k.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",C),k.disconnect()}}},[r,l,y.paused]),d.useEffect(()=>{if(l){JC.add(y);const S=document.activeElement;if(!l.contains(S)){const _=new CustomEvent(P0,qC);l.addEventListener(P0,f),l.dispatchEvent(_),_.defaultPrevented||(YU(JU(oT(l)),{select:!0}),document.activeElement===S&&ts(l))}return()=>{l.removeEventListener(P0,f),setTimeout(()=>{const _=new CustomEvent(T0,qC);l.addEventListener(T0,m),l.dispatchEvent(_),_.defaultPrevented||ts(S??document.body,{select:!0}),l.removeEventListener(T0,m),JC.remove(y)},0)}}},[l,f,m,y]);const x=d.useCallback(S=>{if(!n&&!r||y.paused)return;const E=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,_=document.activeElement;if(E&&_){const b=S.currentTarget,[C,R]=XU(b);C&&R?!S.shiftKey&&_===R?(S.preventDefault(),n&&ts(C,{select:!0})):S.shiftKey&&_===C&&(S.preventDefault(),n&&ts(R,{select:!0})):_===b&&S.preventDefault()}},[n,r,y.paused]);return d.createElement(Ae.div,Y({tabIndex:-1},s,{ref:g,onKeyDown:x}))});function YU(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ts(r,{select:t}),document.activeElement!==n)return}function XU(e){const t=oT(e),n=QC(t,e),r=QC(t.reverse(),e);return[n,r]}function oT(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function QC(e,t){for(const n of e)if(!ZU(n,{upTo:t}))return n}function ZU(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 qU(e){return e instanceof HTMLInputElement&&"select"in e}function ts(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&qU(e)&&t&&e.select()}}const JC=QU();function QU(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=e2(e,t),e.unshift(t)},remove(t){var n;e=e2(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function e2(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function JU(e){return e.filter(t=>t.tagName!=="A")}let k0=0;function Jm(){d.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:t2()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:t2()),k0++,()=>{k0===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),k0--}},[])}function t2(){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}var Bo=function(){return Bo=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Bo.apply(this,arguments)};function iT(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function eV(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var ep="right-scroll-bar-position",tp="width-before-scroll-bar",tV="with-scroll-bars-hidden",nV="--removed-body-scroll-bar-size";function rV(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function oV(e,t){var n=d.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}function iV(e,t){return oV(t||null,function(n){return e.forEach(function(r){return rV(r,n)})})}function sV(e){return e}function aV(e,t){t===void 0&&(t=sV);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(i){var s=t(i,r);return n.push(s),function(){n=n.filter(function(l){return l!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(l){return i(l)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var l=n;n=[],l.forEach(i),s=n}var u=function(){var m=s;s=[],m.forEach(i)},f=function(){return Promise.resolve().then(u)};f(),n={push:function(m){s.push(m),f()},filter:function(m){return s=s.filter(m),n}}}};return o}function lV(e){e===void 0&&(e={});var t=aV(null);return t.options=Bo({async:!0,ssr:!1},e),t}var sT=function(e){var t=e.sideCar,n=iT(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 d.createElement(r,Bo({},n))};sT.isSideCarExport=!0;function cV(e,t){return e.useMedium(t),sT}var aT=lV(),A0=function(){},eg=d.forwardRef(function(e,t){var n=d.useRef(null),r=d.useState({onScrollCapture:A0,onWheelCapture:A0,onTouchMoveCapture:A0}),o=r[0],i=r[1],s=e.forwardProps,l=e.children,u=e.className,f=e.removeScrollBar,m=e.enabled,p=e.shards,g=e.sideCar,y=e.noIsolation,x=e.inert,S=e.allowPinchZoom,E=e.as,_=E===void 0?"div":E,b=iT(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),C=g,R=iV([n,t]),k=Bo(Bo({},b),o);return d.createElement(d.Fragment,null,m&&d.createElement(C,{sideCar:aT,removeScrollBar:f,shards:p,noIsolation:y,inert:x,setCallbacks:i,allowPinchZoom:!!S,lockRef:n}),s?d.cloneElement(d.Children.only(l),Bo(Bo({},k),{ref:R})):d.createElement(_,Bo({},k,{className:u,ref:R}),l))});eg.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};eg.classNames={fullWidth:tp,zeroRight:ep};var n2,uV=function(){if(n2)return n2;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function dV(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=uV();return t&&e.setAttribute("nonce",t),e}function fV(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function hV(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var pV=function(){var e=0,t=null;return{add:function(n){e==0&&(t=dV())&&(fV(t,n),hV(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},mV=function(){var e=pV();return function(t,n){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},lT=function(){var e=mV(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},gV={left:0,top:0,right:0,gap:0},M0=function(e){return parseInt(e||"",10)||0},vV=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[M0(n),M0(r),M0(o)]},yV=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return gV;var t=vV(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])}},wV=lT(),xV=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,l=e.gap;return n===void 0&&(n="margin"),`
.`.concat(tV,` {
overflow: hidden `).concat(r,`;
padding-right: `).concat(l,"px ").concat(r,`;
}
body {
overflow: hidden `).concat(r,`;
overscroll-behavior: contain;
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
padding-left: `.concat(o,`px;
padding-top: `).concat(i,`px;
padding-right: `).concat(s,`px;
margin-left:0;
margin-top:0;
margin-right: `).concat(l,"px ").concat(r,`;
`),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
}
.`).concat(ep,` {
right: `).concat(l,"px ").concat(r,`;
}
.`).concat(tp,` {
margin-right: `).concat(l,"px ").concat(r,`;
}
.`).concat(ep," .").concat(ep,` {
right: 0 `).concat(r,`;
}
.`).concat(tp," .").concat(tp,` {
margin-right: 0 `).concat(r,`;
}
body {
`).concat(nV,": ").concat(l,`px;
}
`)},bV=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,i=d.useMemo(function(){return yV(o)},[o]);return d.createElement(wV,{styles:xV(i,!t,o,n?"":"!important")})},v1=!1;if(typeof window<"u")try{var vh=Object.defineProperty({},"passive",{get:function(){return v1=!0,!0}});window.addEventListener("test",vh,vh),window.removeEventListener("test",vh,vh)}catch{v1=!1}var sl=v1?{passive:!1}:!1,SV=function(e){return e.tagName==="TEXTAREA"},cT=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!SV(e)&&n[t]==="visible")},_V=function(e){return cT(e,"overflowY")},EV=function(e){return cT(e,"overflowX")},r2=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=uT(e,n);if(r){var o=dT(e,n),i=o[1],s=o[2];if(i>s)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},CV=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},$V=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},uT=function(e,t){return e==="v"?_V(t):EV(t)},dT=function(e,t){return e==="v"?CV(t):$V(t)},RV=function(e,t){return e==="h"&&t==="rtl"?-1:1},PV=function(e,t,n,r,o){var i=RV(e,window.getComputedStyle(t).direction),s=i*r,l=n.target,u=t.contains(l),f=!1,m=s>0,p=0,g=0;do{var y=dT(e,l),x=y[0],S=y[1],E=y[2],_=S-E-i*x;(x||_)&&uT(e,l)&&(p+=_,g+=x),l=l.parentNode}while(!u&&l!==document.body||u&&(t.contains(l)||t===l));return(m&&(o&&p===0||!o&&s>p)||!m&&(o&&g===0||!o&&-s>g))&&(f=!0),f},yh=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},o2=function(e){return[e.deltaX,e.deltaY]},i2=function(e){return e&&"current"in e?e.current:e},TV=function(e,t){return e[0]===t[0]&&e[1]===t[1]},kV=function(e){return`
.block-interactivity-`.concat(e,` {pointer-events: none;}
.allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},AV=0,al=[];function MV(e){var t=d.useRef([]),n=d.useRef([0,0]),r=d.useRef(),o=d.useState(AV++)[0],i=d.useState(function(){return lT()})[0],s=d.useRef(e);d.useEffect(function(){s.current=e},[e]),d.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var S=eV([e.lockRef.current],(e.shards||[]).map(i2),!0).filter(Boolean);return S.forEach(function(E){return E.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),S.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=d.useCallback(function(S,E){if("touches"in S&&S.touches.length===2)return!s.current.allowPinchZoom;var _=yh(S),b=n.current,C="deltaX"in S?S.deltaX:b[0]-_[0],R="deltaY"in S?S.deltaY:b[1]-_[1],k,O=S.target,A=Math.abs(C)>Math.abs(R)?"h":"v";if("touches"in S&&A==="h"&&O.type==="range")return!1;var I=r2(A,O);if(!I)return!0;if(I?k=A:(k=A==="v"?"h":"v",I=r2(A,O)),!I)return!1;if(!r.current&&"changedTouches"in S&&(C||R)&&(r.current=k),!k)return!0;var z=r.current||k;return PV(z,E,S,z==="h"?C:R,!0)},[]),u=d.useCallback(function(S){var E=S;if(!(!al.length||al[al.length-1]!==i)){var _="deltaY"in E?o2(E):yh(E),b=t.current.filter(function(k){return k.name===E.type&&k.target===E.target&&TV(k.delta,_)})[0];if(b&&b.should){E.cancelable&&E.preventDefault();return}if(!b){var C=(s.current.shards||[]).map(i2).filter(Boolean).filter(function(k){return k.contains(E.target)}),R=C.length>0?l(E,C[0]):!s.current.noIsolation;R&&E.cancelable&&E.preventDefault()}}},[]),f=d.useCallback(function(S,E,_,b){var C={name:S,delta:E,target:_,should:b};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(R){return R!==C})},1)},[]),m=d.useCallback(function(S){n.current=yh(S),r.current=void 0},[]),p=d.useCallback(function(S){f(S.type,o2(S),S.target,l(S,e.lockRef.current))},[]),g=d.useCallback(function(S){f(S.type,yh(S),S.target,l(S,e.lockRef.current))},[]);d.useEffect(function(){return al.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:g}),document.addEventListener("wheel",u,sl),document.addEventListener("touchmove",u,sl),document.addEventListener("touchstart",m,sl),function(){al=al.filter(function(S){return S!==i}),document.removeEventListener("wheel",u,sl),document.removeEventListener("touchmove",u,sl),document.removeEventListener("touchstart",m,sl)}},[]);var y=e.removeScrollBar,x=e.inert;return d.createElement(d.Fragment,null,x?d.createElement(i,{styles:kV(o)}):null,y?d.createElement(bV,{gapMode:"margin"}):null)}const OV=cV(aT,MV);var fT=d.forwardRef(function(e,t){return d.createElement(eg,Bo({},e,{ref:t,sideCar:OV}))});fT.classNames=eg.classNames;const tg=fT;var NV=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ll=new WeakMap,wh=new WeakMap,xh={},O0=0,hT=function(e){return e&&(e.host||hT(e.parentNode))},DV=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=hT(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},IV=function(e,t,n,r){var o=DV(t,Array.isArray(e)?e:[e]);xh[n]||(xh[n]=new WeakMap);var i=xh[n],s=[],l=new Set,u=new Set(o),f=function(p){!p||l.has(p)||(l.add(p),f(p.parentNode))};o.forEach(f);var m=function(p){!p||u.has(p)||Array.prototype.forEach.call(p.children,function(g){if(l.has(g))m(g);else{var y=g.getAttribute(r),x=y!==null&&y!=="false",S=(ll.get(g)||0)+1,E=(i.get(g)||0)+1;ll.set(g,S),i.set(g,E),s.push(g),S===1&&x&&wh.set(g,!0),E===1&&g.setAttribute(n,"true"),x||g.setAttribute(r,"true")}})};return m(t),l.clear(),O0++,function(){s.forEach(function(p){var g=ll.get(p)-1,y=i.get(p)-1;ll.set(p,g),i.set(p,y),g||(wh.has(p)||p.removeAttribute(r),wh.delete(p)),y||p.removeAttribute(n)}),O0--,O0||(ll=new WeakMap,ll=new WeakMap,wh=new WeakMap,xh={})}},ng=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||NV(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),IV(r,o,n,"aria-hidden")):function(){return null}};const pT="Dialog",[mT,gT]=Tn(pT),[LV,$o]=mT(pT),FV=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,l=d.useRef(null),u=d.useRef(null),[f=!1,m]=eo({prop:r,defaultProp:o,onChange:i});return d.createElement(LV,{scope:t,triggerRef:l,contentRef:u,contentId:tr(),titleId:tr(),descriptionId:tr(),open:f,onOpenChange:m,onOpenToggle:d.useCallback(()=>m(p=>!p),[m]),modal:s},n)},jV="DialogTrigger",vT=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=$o(jV,n),i=Ve(t,o.triggerRef);return d.createElement(Ae.button,Y({type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Px(o.open)},r,{ref:i,onClick:fe(e.onClick,o.onOpenToggle)}))}),yT="DialogPortal",[BV,wT]=mT(yT,{forceMount:void 0}),zV=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=$o(yT,t);return d.createElement(BV,{scope:t,forceMount:n},d.Children.map(r,s=>d.createElement(xn,{present:n||i.open},d.createElement(jd,{asChild:!0,container:o},s))))},y1="DialogOverlay",UV=d.forwardRef((e,t)=>{const n=wT(y1,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=$o(y1,e.__scopeDialog);return i.modal?d.createElement(xn,{present:r||i.open},d.createElement(VV,Y({},o,{ref:t}))):null}),VV=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=$o(y1,n);return d.createElement(tg,{as:Qo,allowPinchZoom:!0,shards:[o.contentRef]},d.createElement(Ae.div,Y({"data-state":Px(o.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),fc="DialogContent",WV=d.forwardRef((e,t)=>{const n=wT(fc,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=$o(fc,e.__scopeDialog);return d.createElement(xn,{present:r||i.open},i.modal?d.createElement(HV,Y({},o,{ref:t})):d.createElement(KV,Y({},o,{ref:t})))}),HV=d.forwardRef((e,t)=>{const n=$o(fc,e.__scopeDialog),r=d.useRef(null),o=Ve(t,n.contentRef,r);return d.useEffect(()=>{const i=r.current;if(i)return ng(i)},[]),d.createElement(xT,Y({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:fe(e.onCloseAutoFocus,i=>{var s;i.preventDefault(),(s=n.triggerRef.current)===null||s===void 0||s.focus()}),onPointerDownOutside:fe(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0;(s.button===2||l)&&i.preventDefault()}),onFocusOutside:fe(e.onFocusOutside,i=>i.preventDefault())}))}),KV=d.forwardRef((e,t)=>{const n=$o(fc,e.__scopeDialog),r=d.useRef(!1),o=d.useRef(!1);return d.createElement(xT,Y({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s;if((s=e.onCloseAutoFocus)===null||s===void 0||s.call(e,i),!i.defaultPrevented){var l;r.current||(l=n.triggerRef.current)===null||l===void 0||l.focus(),i.preventDefault()}r.current=!1,o.current=!1},onInteractOutside:i=>{var s,l;(s=e.onInteractOutside)===null||s===void 0||s.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const u=i.target;((l=n.triggerRef.current)===null||l===void 0?void 0:l.contains(u))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}}))}),xT=d.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,l=$o(fc,n),u=d.useRef(null),f=Ve(t,u);return Jm(),d.createElement(d.Fragment,null,d.createElement(Qm,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},d.createElement($c,Y({role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Px(l.open)},s,{ref:f,onDismiss:()=>l.onOpenChange(!1)}))),!1)}),bT="DialogTitle",GV=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=$o(bT,n);return d.createElement(Ae.h2,Y({id:o.titleId},r,{ref:t}))}),YV="DialogDescription",XV=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=$o(YV,n);return d.createElement(Ae.p,Y({id:o.descriptionId},r,{ref:t}))}),ZV="DialogClose",qV=d.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=$o(ZV,n);return d.createElement(Ae.button,Y({type:"button"},r,{ref:t,onClick:fe(e.onClick,()=>o.onOpenChange(!1))}))});function Px(e){return e?"open":"closed"}const QV="DialogTitleWarning",[JV,pte]=vz(QV,{contentName:fc,titleName:bT,docsSlug:"dialog"}),Tx=FV,ST=vT,kx=zV,Bd=UV,zd=WV,Ud=GV,Vd=XV,Ax=qV,Mx=Tx,_T=ST,eW=kx,ET=d.forwardRef(({className:e,...t},n)=>v.jsx(Bd,{ref:n,className:xe("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));ET.displayName=Bd.displayName;const rg=d.forwardRef(({className:e,children:t,...n},r)=>v.jsxs(eW,{children:[v.jsx(ET,{}),v.jsxs(zd,{ref:r,className:xe("fixed left-[50%] top-[50%] z-50 flex flex-col w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e,"outline-none"),onCloseAutoFocus:o=>o.preventDefault(),...n,children:[t,v.jsxs(Ax,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[v.jsx(CP,{className:"h-4 w-4"}),v.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));rg.displayName=zd.displayName;const CT=({className:e,...t})=>v.jsx("div",{className:xe("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});CT.displayName="DialogHeader";const og=d.forwardRef(({className:e,...t},n)=>v.jsx(Ud,{ref:n,className:xe("text-2xl font-semibold leading-none tracking-tight",e),...t}));og.displayName=Ud.displayName;const tW=d.forwardRef(({className:e,...t},n)=>v.jsx(Vd,{ref:n,className:xe("text-sm text-muted-foreground",e),...t}));tW.displayName=Vd.displayName;function w1(){return w1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},w1.apply(this,arguments)}var $T=["shift","alt","meta","mod","ctrl"],nW={esc:"escape",return:"enter",".":"period",",":"comma","-":"slash"," ":"space","`":"backquote","#":"backslash","+":"bracketright",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function gs(e){return(nW[e]||e).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function rW(e){return $T.includes(e)}function N0(e,t){return t===void 0&&(t=","),e.split(t)}function D0(e,t,n){t===void 0&&(t="+");var r=e.toLocaleLowerCase().split(t).map(function(s){return gs(s)}),o={alt:r.includes("alt"),ctrl:r.includes("ctrl")||r.includes("control"),shift:r.includes("shift"),meta:r.includes("meta"),mod:r.includes("mod")},i=r.filter(function(s){return!$T.includes(s)});return w1({},o,{keys:i,description:n})}(function(){typeof document<"u"&&(document.addEventListener("keydown",function(e){e.key!==void 0&&RT([gs(e.key),gs(e.code)])}),document.addEventListener("keyup",function(e){e.key!==void 0&&PT([gs(e.key),gs(e.code)])})),typeof window<"u"&&window.addEventListener("blur",function(){vs.clear()})})();var vs=new Set;function Ox(e){return Array.isArray(e)}function oW(e,t){t===void 0&&(t=",");var n=Ox(e)?e:e.split(t);return n.every(function(r){return vs.has(r.trim().toLowerCase())})}function RT(e){var t=Array.isArray(e)?e:[e];vs.has("meta")&&vs.forEach(function(n){return!rW(n)&&vs.delete(n.toLowerCase())}),t.forEach(function(n){return vs.add(n.toLowerCase())})}function PT(e){var t=Array.isArray(e)?e:[e];e==="meta"?vs.clear():t.forEach(function(n){return vs.delete(n.toLowerCase())})}function iW(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function sW(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function aW(e){return TT(e,["input","textarea","select"])}function TT(e,t){var n=e.target;t===void 0&&(t=!1);var r=n&&n.tagName;return Ox(t)?!!(r&&t&&t.some(function(o){return o.toLowerCase()===r.toLowerCase()})):!!(r&&t&&t===!0)}function lW(e,t){return e.length===0&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>'),!0):t?e.some(function(n){return t.includes(n)})||e.includes("*"):!0}var cW=function(t,n,r){r===void 0&&(r=!1);var o=n.alt,i=n.meta,s=n.mod,l=n.shift,u=n.ctrl,f=n.keys,m=t.key,p=t.code,g=t.ctrlKey,y=t.metaKey,x=t.shiftKey,S=t.altKey,E=gs(p),_=m.toLowerCase();if(!r){if(o===!S&&_!=="alt"||l===!x&&_!=="shift")return!1;if(s){if(!y&&!g)return!1}else if(i===!y&&_!=="meta"&&_!=="os"||u===!g&&_!=="ctrl"&&_!=="control")return!1}return f&&f.length===1&&(f.includes(_)||f.includes(E))?!0:f?oW(f):!f},uW=d.createContext(void 0),dW=function(){return d.useContext(uW)};function kT(e,t){return e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(e).length===Object.keys(t).length&&Object.keys(e).reduce(function(n,r){return n&&kT(e[r],t[r])},!0):e===t}var fW=d.createContext({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),hW=function(){return d.useContext(fW)};function pW(e){var t=d.useRef(void 0);return kT(t.current,e)||(t.current=e),t.current}var s2=function(t){t.stopPropagation(),t.preventDefault(),t.stopImmediatePropagation()},mW=typeof window<"u"?d.useLayoutEffect:d.useEffect;function gW(e,t,n,r){var o=d.useRef(null),i=d.useRef(!1),s=n instanceof Array?r instanceof Array?void 0:r:n,l=Ox(e)?e.join(s==null?void 0:s.splitKey):e,u=n instanceof Array?n:r instanceof Array?r:void 0,f=d.useCallback(t,u??[]),m=d.useRef(f);u?m.current=f:m.current=t;var p=pW(s),g=hW(),y=g.enabledScopes,x=dW();return mW(function(){if(!((p==null?void 0:p.enabled)===!1||!lW(y,p==null?void 0:p.scopes))){var S=function(R,k){var O;if(k===void 0&&(k=!1),!(aW(R)&&!TT(R,p==null?void 0:p.enableOnFormTags))&&!(p!=null&&p.ignoreEventWhen!=null&&p.ignoreEventWhen(R))){if(o.current!==null&&document.activeElement!==o.current&&!o.current.contains(document.activeElement)){s2(R);return}(O=R.target)!=null&&O.isContentEditable&&!(p!=null&&p.enableOnContentEditable)||N0(l,p==null?void 0:p.splitKey).forEach(function(A){var I,z=D0(A,p==null?void 0:p.combinationKey);if(cW(R,z,p==null?void 0:p.ignoreModifiers)||(I=z.keys)!=null&&I.includes("*")){if(k&&i.current)return;if(iW(R,z,p==null?void 0:p.preventDefault),!sW(R,z,p==null?void 0:p.enabled)){s2(R);return}m.current(R,z),k||(i.current=!0)}})}},E=function(R){R.key!==void 0&&(RT(gs(R.code)),((p==null?void 0:p.keydown)===void 0&&(p==null?void 0:p.keyup)!==!0||p!=null&&p.keydown)&&S(R))},_=function(R){R.key!==void 0&&(PT(gs(R.code)),i.current=!1,p!=null&&p.keyup&&S(R,!0))},b=o.current||(s==null?void 0:s.document)||document;return b.addEventListener("keyup",_),b.addEventListener("keydown",E),x&&N0(l,p==null?void 0:p.splitKey).forEach(function(C){return x.addHotkey(D0(C,p==null?void 0:p.combinationKey,p==null?void 0:p.description))}),function(){b.removeEventListener("keyup",_),b.removeEventListener("keydown",E),x&&N0(l,p==null?void 0:p.splitKey).forEach(function(C){return x.removeHotkey(D0(C,p==null?void 0:p.combinationKey,p==null?void 0:p.description))})}}},[l,p,y]),o}const Yn=(e,t,n)=>{const r=xt(i=>i.disableShortCuts);return gW(e,t,{enabled:!r},n)};function dr(e){const{content:t,keys:n}=e;return v.jsxs("div",{className:"flex justify-between",children:[v.jsx("div",{children:t}),v.jsx("div",{className:"flex gap-[8px]",children:n.map(r=>v.jsx("div",{className:"border px-2 py-1 rounded-lg",children:r},r))})]})}const vW=function(){return/macintosh|mac os x/i.test(navigator.userAgent)},bh=()=>vW()?"Cmd":"Ctrl";function yW(){const[e,t]=rT(!1);return Yn("h",()=>{t()}),v.jsxs(Mx,{open:e,onOpenChange:t,children:[v.jsx(_T,{asChild:!0}),v.jsx(rg,{children:v.jsxs(CT,{children:[v.jsx(og,{children:"Hotkeys"}),v.jsxs("div",{className:"flex gap-2 flex-col pt-4",children:[v.jsx(dr,{content:"Pan",keys:["Space + Drag"]}),v.jsx(dr,{content:"Reset Zoom/Pan",keys:["Esc"]}),v.jsx(dr,{content:"Decrease Brush Size",keys:["["]}),v.jsx(dr,{content:"Increase Brush Size",keys:["]"]}),v.jsx(dr,{content:"View Original Image",keys:["Hold Tab"]}),v.jsx(dr,{content:"Undo",keys:[bh(),"Z"]}),v.jsx(dr,{content:"Redo",keys:[bh(),"Shift","Z"]}),v.jsx(dr,{content:"Copy Result",keys:[bh(),"C"]}),v.jsx(dr,{content:"Paste Image",keys:[bh(),"V"]}),v.jsx(dr,{content:"Trigger Manually Inpainting",keys:["Shift","R"]}),v.jsx(dr,{content:"Toggle Hotkeys Dialog",keys:["H"]}),v.jsx(dr,{content:"Toggle Settings Dialog",keys:["S"]}),v.jsx(dr,{content:"Toggle File Manager",keys:["F"]})]})]})})]})}function Nx(e){const[t]=d.useState(new Image),[n,r]=d.useState(!1);return d.useEffect(()=>{if(e)return t.onload=()=>{r(!0)},r(!1),t.src=URL.createObjectURL(e),()=>{t.onload=null}},[e,t]),[t,n]}const AT="Popover",[MT,mte]=Tn(AT,[zs]),Dx=zs(),[wW,Tc]=MT(AT),xW=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,l=Dx(t),u=d.useRef(null),[f,m]=d.useState(!1),[p=!1,g]=eo({prop:r,defaultProp:o,onChange:i});return d.createElement(Fd,l,d.createElement(wW,{scope:t,contentId:tr(),triggerRef:u,open:p,onOpenChange:g,onOpenToggle:d.useCallback(()=>g(y=>!y),[g]),hasCustomAnchor:f,onCustomAnchorAdd:d.useCallback(()=>m(!0),[]),onCustomAnchorRemove:d.useCallback(()=>m(!1),[]),modal:s},n))},bW="PopoverTrigger",SW=d.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Tc(bW,n),i=Dx(n),s=Ve(t,o.triggerRef),l=d.createElement(Ae.button,Y({type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":DT(o.open)},r,{ref:s,onClick:fe(e.onClick,o.onOpenToggle)}));return o.hasCustomAnchor?l:d.createElement(Gm,Y({asChild:!0},i),l)}),OT="PopoverPortal",[_W,EW]=MT(OT,{forceMount:void 0}),CW=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=Tc(OT,t);return d.createElement(_W,{scope:t,forceMount:n},d.createElement(xn,{present:n||i.open},d.createElement(jd,{asChild:!0,container:o},r)))},dd="PopoverContent",$W=d.forwardRef((e,t)=>{const n=EW(dd,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=Tc(dd,e.__scopePopover);return d.createElement(xn,{present:r||i.open},i.modal?d.createElement(RW,Y({},o,{ref:t})):d.createElement(PW,Y({},o,{ref:t})))}),RW=d.forwardRef((e,t)=>{const n=Tc(dd,e.__scopePopover),r=d.useRef(null),o=Ve(t,r),i=d.useRef(!1);return d.useEffect(()=>{const s=r.current;if(s)return ng(s)},[]),d.createElement(tg,{as:Qo,allowPinchZoom:!0},d.createElement(NT,Y({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:fe(e.onCloseAutoFocus,s=>{var l;s.preventDefault(),i.current||(l=n.triggerRef.current)===null||l===void 0||l.focus()}),onPointerDownOutside:fe(e.onPointerDownOutside,s=>{const l=s.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,f=l.button===2||u;i.current=f},{checkForDefaultPrevented:!1}),onFocusOutside:fe(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})))}),PW=d.forwardRef((e,t)=>{const n=Tc(dd,e.__scopePopover),r=d.useRef(!1),o=d.useRef(!1);return d.createElement(NT,Y({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s;if((s=e.onCloseAutoFocus)===null||s===void 0||s.call(e,i),!i.defaultPrevented){var l;r.current||(l=n.triggerRef.current)===null||l===void 0||l.focus(),i.preventDefault()}r.current=!1,o.current=!1},onInteractOutside:i=>{var s,l;(s=e.onInteractOutside)===null||s===void 0||s.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const u=i.target;((l=n.triggerRef.current)===null||l===void 0?void 0:l.contains(u))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}}))}),NT=d.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:m,...p}=e,g=Tc(dd,n),y=Dx(n);return Jm(),d.createElement(Qm,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},d.createElement($c,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:m,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:f,onDismiss:()=>g.onOpenChange(!1)},d.createElement(Ym,Y({"data-state":DT(g.open),role:"dialog",id:g.contentId},y,p,{ref:t,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}}))))});function DT(e){return e?"open":"closed"}const TW=xW,kW=SW,AW=CW,IT=$W,MW=TW,OW=kW,LT=d.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>v.jsx(AW,{children:v.jsx(IT,{ref:o,align:t,tabIndex:-1,sideOffset:n,className:xe("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));LT.displayName=IT.displayName;function NW(){var e=d.useRef(!0);return e.current?(e.current=!1,!0):e.current}var DW=function(e,t){var n=NW();d.useEffect(function(){if(!n)return e()},t)};const IW=DW;var LW=function(){};function Ix(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.addEventListener&&e.addEventListener.apply(e,t)}function Lx(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.removeEventListener&&e.removeEventListener.apply(e,t)}var np=typeof window<"u",FW=function(e,t){return typeof t=="boolean"?t:!e},jW=function(e){return d.useReducer(FW,e)};const Fx=jW;var BW=["mousedown","touchstart"],zW=function(e,t,n){n===void 0&&(n=BW);var r=d.useRef(t);d.useEffect(function(){r.current=t},[t]),d.useEffect(function(){for(var o=function(u){var f=e.current;f&&!f.contains(u.target)&&r.current(u)},i=0,s=n;i<s.length;i++){var l=s[i];Ix(document,l,o)}return function(){for(var u=0,f=n;u<f.length;u++){var m=f[u];Lx(document,m,o)}}},[n,e])};const FT=zW;var UW=function(e){d.useEffect(e,[])};const VW=UW;var WW=np?window:null,a2=function(e){return!!e.addEventListener},l2=function(e){return!!e.on},HW=function(e,t,n,r){n===void 0&&(n=WW),d.useEffect(function(){if(t&&n)return a2(n)?Ix(n,e,t,r):l2(n)&&n.on(e,t,r),function(){a2(n)?Lx(n,e,t,r):l2(n)&&n.off(e,t,r)}},[e,t,n,JSON.stringify(r)])};const KW=HW;var GW=function(e){return typeof e=="function"?e:typeof e=="string"?function(t){return t.key===e}:e?function(){return!0}:function(){return!1}},YW=function(e,t,n,r){t===void 0&&(t=LW),n===void 0&&(n={}),r===void 0&&(r=[e]);var o=n.event,i=o===void 0?"keydown":o,s=n.target,l=n.options,u=d.useMemo(function(){var f=GW(e),m=function(p){if(f(p))return t(p)};return m},r);KW(i,u,s,l)};const c2=YW;var XW=function(e){var t=d.useState([!1,null]),n=t[0],r=t[1];return c2(e,function(o){return r([!0,o])},{event:"keydown"},[n]),c2(e,function(o){return r([!1,o])},{event:"keyup"},[n]),n};const ZW=XW;var qW=function(e,t,n,r){r===void 0&&(r=ZW);var o=r(e),i=o[0],s=o[1];IW(function(){!i&&n?n(s):i&&t&&t(s)},[i])};const I0=qW;var QW=function(e){var t=d.useRef(e);t.current=e,VW(function(){return function(){return t.current()}})};const JW=QW;var eH=function(e){var t=d.useRef(0),n=d.useState(e),r=n[0],o=n[1],i=d.useCallback(function(s){cancelAnimationFrame(t.current),t.current=requestAnimationFrame(function(){o(s)})},[]);return JW(function(){cancelAnimationFrame(t.current)}),[r,i]};const tH=eH;var nH=function(e,t){e===void 0&&(e=1/0),t===void 0&&(t=1/0);var n=tH({width:np?window.innerWidth:e,height:np?window.innerHeight:t}),r=n[0],o=n[1];return d.useEffect(function(){if(np){var i=function(){o({width:window.innerWidth,height:window.innerHeight})};return Ix(window,"resize",i),function(){Lx(window,"resize",i)}}},[]),r};const rH=nH,jx=d.forwardRef(({className:e,...t},n)=>{const r=xt(s=>s.updateAppState),o=()=>{r({disableShortCuts:!0})},i=()=>{r({disableShortCuts:!1})};return v.jsx("textarea",{className:xe("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50","overflow-auto",e),tabIndex:-1,ref:n,onFocus:o,onBlur:i,...t})});jx.displayName="Textarea";const oH=()=>{const[e,t,n,r,o,i]=xt(x=>[x.getIsProcessing(),x.settings.prompt,x.updateSettings,x.runInpainting,x.showPrevMask,x.hidePrevMask]),[s,l]=Fx(!1),u=d.useRef(null);FT(u,()=>{u!=null&&u.current&&u.current.blur()});const f=x=>{x.preventDefault(),x.stopPropagation();const S=x.target;n({prompt:S.value})},m=()=>{e||r()},p=x=>{x.key==="Enter"&&x.ctrlKey&&t.length!==0&&m()},g=()=>{o()},y=()=>{i()};return v.jsx("div",{className:"flex gap-4 relative w-full justify-center h-full",children:v.jsxs("div",{className:"absolute flex gap-4",children:[v.jsx(jx,{ref:u,placeholder:"I want to repaint of...",className:xe(s?"focus:overflow-y-auto":"overflow-y-hidden","min-h-[32px] h-[32px] overflow-x-hidden focus:h-[120px] overflow-y-hidden transition-[height] w-[500px] py-1 px-3 bg-background resize-none"),style:{scrollbarGutter:"stable"},value:t,onInput:f,onKeyUp:p,onTransitionEnd:l}),v.jsx(vn,{size:"sm",onClick:m,disabled:e,onMouseEnter:g,onMouseLeave:y,children:"Paint"})]})})};var iH={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const sH=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),kn=(e,t)=>{const n=d.forwardRef(({color:r="currentColor",size:o=24,strokeWidth:i=2,absoluteStrokeWidth:s,children:l,...u},f)=>d.createElement("svg",{ref:f,...iH,width:o,height:o,stroke:r,strokeWidth:s?Number(i)*24/Number(o):i,className:`lucide lucide-${sH(e)}`,...u},[...t.map(([m,p])=>d.createElement(m,p)),...(Array.isArray(l)?l:[l])||[]]));return n.displayName=`${e}`,n},aH=kn("Blocks",[["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["path",{d:"M10 21V8a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1H3",key:"1fpvtg"}]]),lH=kn("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),cH=kn("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),uH=kn("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]),dH=kn("Eraser",[["path",{d:"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21",key:"182aya"}],["path",{d:"M22 21H7",key:"t4ddhn"}],["path",{d:"m5 11 9 9",key:"1mo9qw"}]]),fH=kn("Expand",[["path",{d:"m21 21-6-6m6 6v-4.8m0 4.8h-4.8",key:"1c15vz"}],["path",{d:"M3 16.2V21m0 0h4.8M3 21l6-6",key:"1fsnz2"}],["path",{d:"M21 7.8V3m0 0h-4.8M21 3l-6 6",key:"hawz9i"}],["path",{d:"M3 7.8V3m0 0h4.8M3 3l6 6",key:"u9ee12"}]]),hH=kn("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),pH=kn("FolderClosed",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"M2 10h20",key:"1ir3d8"}]]),jT=kn("Fullscreen",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["rect",{width:"10",height:"8",x:"7",y:"8",rx:"1",key:"vys8me"}]]),mH=kn("MousePointerClick",[["path",{d:"m9 9 5 12 1.8-5.2L21 14Z",key:"1b76lo"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}]]),gH=kn("Redo",[["path",{d:"M21 7v6h-6",key:"3ptur4"}],["path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7",key:"1kgawr"}]]),vH=kn("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),u2=kn("Slice",[["path",{d:"m8 14-6 6h9v-3",key:"zo3j9a"}],["path",{d:"M18.37 3.63 8 14l3 3L21.37 6.63a2.12 2.12 0 1 0-3-3Z",key:"1dzx0j"}]]),d2=kn("Smile",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]]),yH=kn("Undo",[["path",{d:"M3 7v6h6",key:"1v2h90"}],["path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13",key:"1r6uu6"}]]),BT=kn("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);var Vp={exports:{}};/**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/Vp.exports;(function(e,t){(function(){var n,r="4.17.21",o=200,i="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",l="Invalid `variable` option passed into `_.template`",u="__lodash_hash_undefined__",f=500,m="__lodash_placeholder__",p=1,g=2,y=4,x=1,S=2,E=1,_=2,b=4,C=8,R=16,k=32,O=64,A=128,I=256,z=512,H=30,ie="...",K=800,te=16,U=1,re=2,V=3,J=1/0,G=9007199254740991,Z=17976931348623157e292,Q=NaN,le=4294967295,L=le-1,ue=le>>>1,Ne=[["ary",A],["bind",E],["bindKey",_],["curry",C],["curryRight",R],["flip",z],["partial",k],["partialRight",O],["rearg",I]],Ke="[object Arguments]",Me="[object Array]",me="[object AsyncFunction]",be="[object Boolean]",Ee="[object Date]",Oe="[object DOMException]",Ie="[object Error]",ze="[object Function]",ht="[object GeneratorFunction]",st="[object Map]",Yt="[object Number]",rr="[object Null]",Jt="[object Object]",Li="[object Promise]",N="[object Proxy]",X="[object RegExp]",ee="[object Set]",Se="[object String]",pe="[object Symbol]",he="[object Undefined]",Te="[object WeakMap]",ut="[object WeakSet]",gt="[object ArrayBuffer]",An="[object DataView]",Mn="[object Float32Array]",Fi="[object Float64Array]",Ro="[object Int8Array]",Cr="[object Int16Array]",Ks="[object Int32Array]",ri="[object Uint8Array]",ji="[object Uint8ClampedArray]",or="[object Uint16Array]",Zd="[object Uint32Array]",$g=/\b__p \+= '';/g,qd=/\b(__p \+=) '' \+/g,Rg=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Qd=/&(?:amp|lt|gt|quot|#39);/g,Nc=/[&<>"']/g,Jd=RegExp(Qd.source),ef=RegExp(Nc.source),tf=/<%-([\s\S]+?)%>/g,nf=/<%([\s\S]+?)%>/g,Va=/<%=([\s\S]+?)%>/g,Pg=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Dc=/^\w*$/,rf=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Wa=/[\\^$.*+?()[\]{}|]/g,Tg=RegExp(Wa.source),Ic=/^\s+/,kg=/\s/,Ag=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,W=/\{\n\/\* \[wrapped with (.+)\] \*/,We=/,? & /,dt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,no=/[()=,{}\[\]\/\s]/,an=/\\(\\)?/g,of=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,wb=/\w*$/,hM=/^[-+]0x[0-9a-f]+$/i,pM=/^0b[01]+$/i,mM=/^\[object .+?Constructor\]$/,gM=/^0o[0-7]+$/i,vM=/^(?:0|[1-9]\d*)$/,yM=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,sf=/($^)/,wM=/['\n\r\u2028\u2029\\]/g,af="\\ud800-\\udfff",xM="\\u0300-\\u036f",bM="\\ufe20-\\ufe2f",SM="\\u20d0-\\u20ff",xb=xM+bM+SM,bb="\\u2700-\\u27bf",Sb="a-z\\xdf-\\xf6\\xf8-\\xff",_M="\\xac\\xb1\\xd7\\xf7",EM="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",CM="\\u2000-\\u206f",$M=" \\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",_b="A-Z\\xc0-\\xd6\\xd8-\\xde",Eb="\\ufe0e\\ufe0f",Cb=_M+EM+CM+$M,Mg="[']",RM="["+af+"]",$b="["+Cb+"]",lf="["+xb+"]",Rb="\\d+",PM="["+bb+"]",Pb="["+Sb+"]",Tb="[^"+af+Cb+Rb+bb+Sb+_b+"]",Og="\\ud83c[\\udffb-\\udfff]",TM="(?:"+lf+"|"+Og+")",kb="[^"+af+"]",Ng="(?:\\ud83c[\\udde6-\\uddff]){2}",Dg="[\\ud800-\\udbff][\\udc00-\\udfff]",Ha="["+_b+"]",Ab="\\u200d",Mb="(?:"+Pb+"|"+Tb+")",kM="(?:"+Ha+"|"+Tb+")",Ob="(?:"+Mg+"(?:d|ll|m|re|s|t|ve))?",Nb="(?:"+Mg+"(?:D|LL|M|RE|S|T|VE))?",Db=TM+"?",Ib="["+Eb+"]?",AM="(?:"+Ab+"(?:"+[kb,Ng,Dg].join("|")+")"+Ib+Db+")*",MM="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",OM="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Lb=Ib+Db+AM,NM="(?:"+[PM,Ng,Dg].join("|")+")"+Lb,DM="(?:"+[kb+lf+"?",lf,Ng,Dg,RM].join("|")+")",IM=RegExp(Mg,"g"),LM=RegExp(lf,"g"),Ig=RegExp(Og+"(?="+Og+")|"+DM+Lb,"g"),FM=RegExp([Ha+"?"+Pb+"+"+Ob+"(?="+[$b,Ha,"$"].join("|")+")",kM+"+"+Nb+"(?="+[$b,Ha+Mb,"$"].join("|")+")",Ha+"?"+Mb+"+"+Ob,Ha+"+"+Nb,OM,MM,Rb,NM].join("|"),"g"),jM=RegExp("["+Ab+af+xb+Eb+"]"),BM=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,zM=["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"],UM=-1,Pt={};Pt[Mn]=Pt[Fi]=Pt[Ro]=Pt[Cr]=Pt[Ks]=Pt[ri]=Pt[ji]=Pt[or]=Pt[Zd]=!0,Pt[Ke]=Pt[Me]=Pt[gt]=Pt[be]=Pt[An]=Pt[Ee]=Pt[Ie]=Pt[ze]=Pt[st]=Pt[Yt]=Pt[Jt]=Pt[X]=Pt[ee]=Pt[Se]=Pt[Te]=!1;var Ct={};Ct[Ke]=Ct[Me]=Ct[gt]=Ct[An]=Ct[be]=Ct[Ee]=Ct[Mn]=Ct[Fi]=Ct[Ro]=Ct[Cr]=Ct[Ks]=Ct[st]=Ct[Yt]=Ct[Jt]=Ct[X]=Ct[ee]=Ct[Se]=Ct[pe]=Ct[ri]=Ct[ji]=Ct[or]=Ct[Zd]=!0,Ct[Ie]=Ct[ze]=Ct[Te]=!1;var VM={À:"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"},WM={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},HM={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},KM={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},GM=parseFloat,YM=parseInt,Fb=typeof Qc=="object"&&Qc&&Qc.Object===Object&&Qc,XM=typeof self=="object"&&self&&self.Object===Object&&self,fn=Fb||XM||Function("return this")(),Lg=t&&!t.nodeType&&t,Gs=Lg&&!0&&e&&!e.nodeType&&e,jb=Gs&&Gs.exports===Lg,Fg=jb&&Fb.process,$r=function(){try{var F=Gs&&Gs.require&&Gs.require("util").types;return F||Fg&&Fg.binding&&Fg.binding("util")}catch{}}(),Bb=$r&&$r.isArrayBuffer,zb=$r&&$r.isDate,Ub=$r&&$r.isMap,Vb=$r&&$r.isRegExp,Wb=$r&&$r.isSet,Hb=$r&&$r.isTypedArray;function ir(F,ne,q){switch(q.length){case 0:return F.call(ne);case 1:return F.call(ne,q[0]);case 2:return F.call(ne,q[0],q[1]);case 3:return F.call(ne,q[0],q[1],q[2])}return F.apply(ne,q)}function ZM(F,ne,q,Ce){for(var Ge=-1,pt=F==null?0:F.length;++Ge<pt;){var en=F[Ge];ne(Ce,en,q(en),F)}return Ce}function Rr(F,ne){for(var q=-1,Ce=F==null?0:F.length;++q<Ce&&ne(F[q],q,F)!==!1;);return F}function qM(F,ne){for(var q=F==null?0:F.length;q--&&ne(F[q],q,F)!==!1;);return F}function Kb(F,ne){for(var q=-1,Ce=F==null?0:F.length;++q<Ce;)if(!ne(F[q],q,F))return!1;return!0}function Bi(F,ne){for(var q=-1,Ce=F==null?0:F.length,Ge=0,pt=[];++q<Ce;){var en=F[q];ne(en,q,F)&&(pt[Ge++]=en)}return pt}function cf(F,ne){var q=F==null?0:F.length;return!!q&&Ka(F,ne,0)>-1}function jg(F,ne,q){for(var Ce=-1,Ge=F==null?0:F.length;++Ce<Ge;)if(q(ne,F[Ce]))return!0;return!1}function Mt(F,ne){for(var q=-1,Ce=F==null?0:F.length,Ge=Array(Ce);++q<Ce;)Ge[q]=ne(F[q],q,F);return Ge}function zi(F,ne){for(var q=-1,Ce=ne.length,Ge=F.length;++q<Ce;)F[Ge+q]=ne[q];return F}function Bg(F,ne,q,Ce){var Ge=-1,pt=F==null?0:F.length;for(Ce&&pt&&(q=F[++Ge]);++Ge<pt;)q=ne(q,F[Ge],Ge,F);return q}function QM(F,ne,q,Ce){var Ge=F==null?0:F.length;for(Ce&&Ge&&(q=F[--Ge]);Ge--;)q=ne(q,F[Ge],Ge,F);return q}function zg(F,ne){for(var q=-1,Ce=F==null?0:F.length;++q<Ce;)if(ne(F[q],q,F))return!0;return!1}var JM=Ug("length");function e6(F){return F.split("")}function t6(F){return F.match(dt)||[]}function Gb(F,ne,q){var Ce;return q(F,function(Ge,pt,en){if(ne(Ge,pt,en))return Ce=pt,!1}),Ce}function uf(F,ne,q,Ce){for(var Ge=F.length,pt=q+(Ce?1:-1);Ce?pt--:++pt<Ge;)if(ne(F[pt],pt,F))return pt;return-1}function Ka(F,ne,q){return ne===ne?h6(F,ne,q):uf(F,Yb,q)}function n6(F,ne,q,Ce){for(var Ge=q-1,pt=F.length;++Ge<pt;)if(Ce(F[Ge],ne))return Ge;return-1}function Yb(F){return F!==F}function Xb(F,ne){var q=F==null?0:F.length;return q?Wg(F,ne)/q:Q}function Ug(F){return function(ne){return ne==null?n:ne[F]}}function Vg(F){return function(ne){return F==null?n:F[ne]}}function Zb(F,ne,q,Ce,Ge){return Ge(F,function(pt,en,St){q=Ce?(Ce=!1,pt):ne(q,pt,en,St)}),q}function r6(F,ne){var q=F.length;for(F.sort(ne);q--;)F[q]=F[q].value;return F}function Wg(F,ne){for(var q,Ce=-1,Ge=F.length;++Ce<Ge;){var pt=ne(F[Ce]);pt!==n&&(q=q===n?pt:q+pt)}return q}function Hg(F,ne){for(var q=-1,Ce=Array(F);++q<F;)Ce[q]=ne(q);return Ce}function o6(F,ne){return Mt(ne,function(q){return[q,F[q]]})}function qb(F){return F&&F.slice(0,tS(F)+1).replace(Ic,"")}function sr(F){return function(ne){return F(ne)}}function Kg(F,ne){return Mt(ne,function(q){return F[q]})}function Lc(F,ne){return F.has(ne)}function Qb(F,ne){for(var q=-1,Ce=F.length;++q<Ce&&Ka(ne,F[q],0)>-1;);return q}function Jb(F,ne){for(var q=F.length;q--&&Ka(ne,F[q],0)>-1;);return q}function i6(F,ne){for(var q=F.length,Ce=0;q--;)F[q]===ne&&++Ce;return Ce}var s6=Vg(VM),a6=Vg(WM);function l6(F){return"\\"+KM[F]}function c6(F,ne){return F==null?n:F[ne]}function Ga(F){return jM.test(F)}function u6(F){return BM.test(F)}function d6(F){for(var ne,q=[];!(ne=F.next()).done;)q.push(ne.value);return q}function Gg(F){var ne=-1,q=Array(F.size);return F.forEach(function(Ce,Ge){q[++ne]=[Ge,Ce]}),q}function eS(F,ne){return function(q){return F(ne(q))}}function Ui(F,ne){for(var q=-1,Ce=F.length,Ge=0,pt=[];++q<Ce;){var en=F[q];(en===ne||en===m)&&(F[q]=m,pt[Ge++]=q)}return pt}function df(F){var ne=-1,q=Array(F.size);return F.forEach(function(Ce){q[++ne]=Ce}),q}function f6(F){var ne=-1,q=Array(F.size);return F.forEach(function(Ce){q[++ne]=[Ce,Ce]}),q}function h6(F,ne,q){for(var Ce=q-1,Ge=F.length;++Ce<Ge;)if(F[Ce]===ne)return Ce;return-1}function p6(F,ne,q){for(var Ce=q+1;Ce--;)if(F[Ce]===ne)return Ce;return Ce}function Ya(F){return Ga(F)?g6(F):JM(F)}function ro(F){return Ga(F)?v6(F):e6(F)}function tS(F){for(var ne=F.length;ne--&&kg.test(F.charAt(ne)););return ne}var m6=Vg(HM);function g6(F){for(var ne=Ig.lastIndex=0;Ig.test(F);)++ne;return ne}function v6(F){return F.match(Ig)||[]}function y6(F){return F.match(FM)||[]}var w6=function F(ne){ne=ne==null?fn:Xa.defaults(fn.Object(),ne,Xa.pick(fn,zM));var q=ne.Array,Ce=ne.Date,Ge=ne.Error,pt=ne.Function,en=ne.Math,St=ne.Object,Yg=ne.RegExp,x6=ne.String,Pr=ne.TypeError,ff=q.prototype,b6=pt.prototype,Za=St.prototype,hf=ne["__core-js_shared__"],pf=b6.toString,yt=Za.hasOwnProperty,S6=0,nS=function(){var a=/[^.]+$/.exec(hf&&hf.keys&&hf.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""}(),mf=Za.toString,_6=pf.call(St),E6=fn._,C6=Yg("^"+pf.call(yt).replace(Wa,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),gf=jb?ne.Buffer:n,Vi=ne.Symbol,vf=ne.Uint8Array,rS=gf?gf.allocUnsafe:n,yf=eS(St.getPrototypeOf,St),oS=St.create,iS=Za.propertyIsEnumerable,wf=ff.splice,sS=Vi?Vi.isConcatSpreadable:n,Fc=Vi?Vi.iterator:n,Ys=Vi?Vi.toStringTag:n,xf=function(){try{var a=Js(St,"defineProperty");return a({},"",{}),a}catch{}}(),$6=ne.clearTimeout!==fn.clearTimeout&&ne.clearTimeout,R6=Ce&&Ce.now!==fn.Date.now&&Ce.now,P6=ne.setTimeout!==fn.setTimeout&&ne.setTimeout,bf=en.ceil,Sf=en.floor,Xg=St.getOwnPropertySymbols,T6=gf?gf.isBuffer:n,aS=ne.isFinite,k6=ff.join,A6=eS(St.keys,St),tn=en.max,bn=en.min,M6=Ce.now,O6=ne.parseInt,lS=en.random,N6=ff.reverse,Zg=Js(ne,"DataView"),jc=Js(ne,"Map"),qg=Js(ne,"Promise"),qa=Js(ne,"Set"),Bc=Js(ne,"WeakMap"),zc=Js(St,"create"),_f=Bc&&new Bc,Qa={},D6=ea(Zg),I6=ea(jc),L6=ea(qg),F6=ea(qa),j6=ea(Bc),Ef=Vi?Vi.prototype:n,Uc=Ef?Ef.valueOf:n,cS=Ef?Ef.toString:n;function P(a){if(Bt(a)&&!Ye(a)&&!(a instanceof ot)){if(a instanceof Tr)return a;if(yt.call(a,"__wrapped__"))return u_(a)}return new Tr(a)}var Ja=function(){function a(){}return function(c){if(!Dt(c))return{};if(oS)return oS(c);a.prototype=c;var h=new a;return a.prototype=n,h}}();function Cf(){}function Tr(a,c){this.__wrapped__=a,this.__actions__=[],this.__chain__=!!c,this.__index__=0,this.__values__=n}P.templateSettings={escape:tf,evaluate:nf,interpolate:Va,variable:"",imports:{_:P}},P.prototype=Cf.prototype,P.prototype.constructor=P,Tr.prototype=Ja(Cf.prototype),Tr.prototype.constructor=Tr;function ot(a){this.__wrapped__=a,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=le,this.__views__=[]}function B6(){var a=new ot(this.__wrapped__);return a.__actions__=Vn(this.__actions__),a.__dir__=this.__dir__,a.__filtered__=this.__filtered__,a.__iteratees__=Vn(this.__iteratees__),a.__takeCount__=this.__takeCount__,a.__views__=Vn(this.__views__),a}function z6(){if(this.__filtered__){var a=new ot(this);a.__dir__=-1,a.__filtered__=!0}else a=this.clone(),a.__dir__*=-1;return a}function U6(){var a=this.__wrapped__.value(),c=this.__dir__,h=Ye(a),w=c<0,$=h?a.length:0,T=eO(0,$,this.__views__),M=T.start,D=T.end,B=D-M,oe=w?D:M-1,se=this.__iteratees__,ce=se.length,ve=0,Pe=bn(B,this.__takeCount__);if(!h||!w&&$==B&&Pe==B)return OS(a,this.__actions__);var Fe=[];e:for(;B--&&ve<Pe;){oe+=c;for(var Qe=-1,je=a[oe];++Qe<ce;){var nt=se[Qe],at=nt.iteratee,cr=nt.type,Dn=at(je);if(cr==re)je=Dn;else if(!Dn){if(cr==U)continue e;break e}}Fe[ve++]=je}return Fe}ot.prototype=Ja(Cf.prototype),ot.prototype.constructor=ot;function Xs(a){var c=-1,h=a==null?0:a.length;for(this.clear();++c<h;){var w=a[c];this.set(w[0],w[1])}}function V6(){this.__data__=zc?zc(null):{},this.size=0}function W6(a){var c=this.has(a)&&delete this.__data__[a];return this.size-=c?1:0,c}function H6(a){var c=this.__data__;if(zc){var h=c[a];return h===u?n:h}return yt.call(c,a)?c[a]:n}function K6(a){var c=this.__data__;return zc?c[a]!==n:yt.call(c,a)}function G6(a,c){var h=this.__data__;return this.size+=this.has(a)?0:1,h[a]=zc&&c===n?u:c,this}Xs.prototype.clear=V6,Xs.prototype.delete=W6,Xs.prototype.get=H6,Xs.prototype.has=K6,Xs.prototype.set=G6;function oi(a){var c=-1,h=a==null?0:a.length;for(this.clear();++c<h;){var w=a[c];this.set(w[0],w[1])}}function Y6(){this.__data__=[],this.size=0}function X6(a){var c=this.__data__,h=$f(c,a);if(h<0)return!1;var w=c.length-1;return h==w?c.pop():wf.call(c,h,1),--this.size,!0}function Z6(a){var c=this.__data__,h=$f(c,a);return h<0?n:c[h][1]}function q6(a){return $f(this.__data__,a)>-1}function Q6(a,c){var h=this.__data__,w=$f(h,a);return w<0?(++this.size,h.push([a,c])):h[w][1]=c,this}oi.prototype.clear=Y6,oi.prototype.delete=X6,oi.prototype.get=Z6,oi.prototype.has=q6,oi.prototype.set=Q6;function ii(a){var c=-1,h=a==null?0:a.length;for(this.clear();++c<h;){var w=a[c];this.set(w[0],w[1])}}function J6(){this.size=0,this.__data__={hash:new Xs,map:new(jc||oi),string:new Xs}}function e7(a){var c=Ff(this,a).delete(a);return this.size-=c?1:0,c}function t7(a){return Ff(this,a).get(a)}function n7(a){return Ff(this,a).has(a)}function r7(a,c){var h=Ff(this,a),w=h.size;return h.set(a,c),this.size+=h.size==w?0:1,this}ii.prototype.clear=J6,ii.prototype.delete=e7,ii.prototype.get=t7,ii.prototype.has=n7,ii.prototype.set=r7;function Zs(a){var c=-1,h=a==null?0:a.length;for(this.__data__=new ii;++c<h;)this.add(a[c])}function o7(a){return this.__data__.set(a,u),this}function i7(a){return this.__data__.has(a)}Zs.prototype.add=Zs.prototype.push=o7,Zs.prototype.has=i7;function oo(a){var c=this.__data__=new oi(a);this.size=c.size}function s7(){this.__data__=new oi,this.size=0}function a7(a){var c=this.__data__,h=c.delete(a);return this.size=c.size,h}function l7(a){return this.__data__.get(a)}function c7(a){return this.__data__.has(a)}function u7(a,c){var h=this.__data__;if(h instanceof oi){var w=h.__data__;if(!jc||w.length<o-1)return w.push([a,c]),this.size=++h.size,this;h=this.__data__=new ii(w)}return h.set(a,c),this.size=h.size,this}oo.prototype.clear=s7,oo.prototype.delete=a7,oo.prototype.get=l7,oo.prototype.has=c7,oo.prototype.set=u7;function uS(a,c){var h=Ye(a),w=!h&&ta(a),$=!h&&!w&&Yi(a),T=!h&&!w&&!$&&rl(a),M=h||w||$||T,D=M?Hg(a.length,x6):[],B=D.length;for(var oe in a)(c||yt.call(a,oe))&&!(M&&(oe=="length"||$&&(oe=="offset"||oe=="parent")||T&&(oe=="buffer"||oe=="byteLength"||oe=="byteOffset")||ci(oe,B)))&&D.push(oe);return D}function dS(a){var c=a.length;return c?a[lv(0,c-1)]:n}function d7(a,c){return jf(Vn(a),qs(c,0,a.length))}function f7(a){return jf(Vn(a))}function Qg(a,c,h){(h!==n&&!io(a[c],h)||h===n&&!(c in a))&&si(a,c,h)}function Vc(a,c,h){var w=a[c];(!(yt.call(a,c)&&io(w,h))||h===n&&!(c in a))&&si(a,c,h)}function $f(a,c){for(var h=a.length;h--;)if(io(a[h][0],c))return h;return-1}function h7(a,c,h,w){return Wi(a,function($,T,M){c(w,$,h($),M)}),w}function fS(a,c){return a&&To(c,ln(c),a)}function p7(a,c){return a&&To(c,Hn(c),a)}function si(a,c,h){c=="__proto__"&&xf?xf(a,c,{configurable:!0,enumerable:!0,value:h,writable:!0}):a[c]=h}function Jg(a,c){for(var h=-1,w=c.length,$=q(w),T=a==null;++h<w;)$[h]=T?n:Ov(a,c[h]);return $}function qs(a,c,h){return a===a&&(h!==n&&(a=a<=h?a:h),c!==n&&(a=a>=c?a:c)),a}function kr(a,c,h,w,$,T){var M,D=c&p,B=c&g,oe=c&y;if(h&&(M=$?h(a,w,$,T):h(a)),M!==n)return M;if(!Dt(a))return a;var se=Ye(a);if(se){if(M=nO(a),!D)return Vn(a,M)}else{var ce=Sn(a),ve=ce==ze||ce==ht;if(Yi(a))return IS(a,D);if(ce==Jt||ce==Ke||ve&&!$){if(M=B||ve?{}:t_(a),!D)return B?H7(a,p7(M,a)):W7(a,fS(M,a))}else{if(!Ct[ce])return $?a:{};M=rO(a,ce,D)}}T||(T=new oo);var Pe=T.get(a);if(Pe)return Pe;T.set(a,M),k_(a)?a.forEach(function(je){M.add(kr(je,c,h,je,a,T))}):P_(a)&&a.forEach(function(je,nt){M.set(nt,kr(je,c,h,nt,a,T))});var Fe=oe?B?wv:yv:B?Hn:ln,Qe=se?n:Fe(a);return Rr(Qe||a,function(je,nt){Qe&&(nt=je,je=a[nt]),Vc(M,nt,kr(je,c,h,nt,a,T))}),M}function m7(a){var c=ln(a);return function(h){return hS(h,a,c)}}function hS(a,c,h){var w=h.length;if(a==null)return!w;for(a=St(a);w--;){var $=h[w],T=c[$],M=a[$];if(M===n&&!($ in a)||!T(M))return!1}return!0}function pS(a,c,h){if(typeof a!="function")throw new Pr(s);return Zc(function(){a.apply(n,h)},c)}function Wc(a,c,h,w){var $=-1,T=cf,M=!0,D=a.length,B=[],oe=c.length;if(!D)return B;h&&(c=Mt(c,sr(h))),w?(T=jg,M=!1):c.length>=o&&(T=Lc,M=!1,c=new Zs(c));e:for(;++$<D;){var se=a[$],ce=h==null?se:h(se);if(se=w||se!==0?se:0,M&&ce===ce){for(var ve=oe;ve--;)if(c[ve]===ce)continue e;B.push(se)}else T(c,ce,w)||B.push(se)}return B}var Wi=zS(Po),mS=zS(tv,!0);function g7(a,c){var h=!0;return Wi(a,function(w,$,T){return h=!!c(w,$,T),h}),h}function Rf(a,c,h){for(var w=-1,$=a.length;++w<$;){var T=a[w],M=c(T);if(M!=null&&(D===n?M===M&&!lr(M):h(M,D)))var D=M,B=T}return B}function v7(a,c,h,w){var $=a.length;for(h=qe(h),h<0&&(h=-h>$?0:$+h),w=w===n||w>$?$:qe(w),w<0&&(w+=$),w=h>w?0:M_(w);h<w;)a[h++]=c;return a}function gS(a,c){var h=[];return Wi(a,function(w,$,T){c(w,$,T)&&h.push(w)}),h}function hn(a,c,h,w,$){var T=-1,M=a.length;for(h||(h=iO),$||($=[]);++T<M;){var D=a[T];c>0&&h(D)?c>1?hn(D,c-1,h,w,$):zi($,D):w||($[$.length]=D)}return $}var ev=US(),vS=US(!0);function Po(a,c){return a&&ev(a,c,ln)}function tv(a,c){return a&&vS(a,c,ln)}function Pf(a,c){return Bi(c,function(h){return ui(a[h])})}function Qs(a,c){c=Ki(c,a);for(var h=0,w=c.length;a!=null&&h<w;)a=a[ko(c[h++])];return h&&h==w?a:n}function yS(a,c,h){var w=c(a);return Ye(a)?w:zi(w,h(a))}function On(a){return a==null?a===n?he:rr:Ys&&Ys in St(a)?J7(a):fO(a)}function nv(a,c){return a>c}function y7(a,c){return a!=null&&yt.call(a,c)}function w7(a,c){return a!=null&&c in St(a)}function x7(a,c,h){return a>=bn(c,h)&&a<tn(c,h)}function rv(a,c,h){for(var w=h?jg:cf,$=a[0].length,T=a.length,M=T,D=q(T),B=1/0,oe=[];M--;){var se=a[M];M&&c&&(se=Mt(se,sr(c))),B=bn(se.length,B),D[M]=!h&&(c||$>=120&&se.length>=120)?new Zs(M&&se):n}se=a[0];var ce=-1,ve=D[0];e:for(;++ce<$&&oe.length<B;){var Pe=se[ce],Fe=c?c(Pe):Pe;if(Pe=h||Pe!==0?Pe:0,!(ve?Lc(ve,Fe):w(oe,Fe,h))){for(M=T;--M;){var Qe=D[M];if(!(Qe?Lc(Qe,Fe):w(a[M],Fe,h)))continue e}ve&&ve.push(Fe),oe.push(Pe)}}return oe}function b7(a,c,h,w){return Po(a,function($,T,M){c(w,h($),T,M)}),w}function Hc(a,c,h){c=Ki(c,a),a=i_(a,c);var w=a==null?a:a[ko(Mr(c))];return w==null?n:ir(w,a,h)}function wS(a){return Bt(a)&&On(a)==Ke}function S7(a){return Bt(a)&&On(a)==gt}function _7(a){return Bt(a)&&On(a)==Ee}function Kc(a,c,h,w,$){return a===c?!0:a==null||c==null||!Bt(a)&&!Bt(c)?a!==a&&c!==c:E7(a,c,h,w,Kc,$)}function E7(a,c,h,w,$,T){var M=Ye(a),D=Ye(c),B=M?Me:Sn(a),oe=D?Me:Sn(c);B=B==Ke?Jt:B,oe=oe==Ke?Jt:oe;var se=B==Jt,ce=oe==Jt,ve=B==oe;if(ve&&Yi(a)){if(!Yi(c))return!1;M=!0,se=!1}if(ve&&!se)return T||(T=new oo),M||rl(a)?QS(a,c,h,w,$,T):q7(a,c,B,h,w,$,T);if(!(h&x)){var Pe=se&&yt.call(a,"__wrapped__"),Fe=ce&&yt.call(c,"__wrapped__");if(Pe||Fe){var Qe=Pe?a.value():a,je=Fe?c.value():c;return T||(T=new oo),$(Qe,je,h,w,T)}}return ve?(T||(T=new oo),Q7(a,c,h,w,$,T)):!1}function C7(a){return Bt(a)&&Sn(a)==st}function ov(a,c,h,w){var $=h.length,T=$,M=!w;if(a==null)return!T;for(a=St(a);$--;){var D=h[$];if(M&&D[2]?D[1]!==a[D[0]]:!(D[0]in a))return!1}for(;++$<T;){D=h[$];var B=D[0],oe=a[B],se=D[1];if(M&&D[2]){if(oe===n&&!(B in a))return!1}else{var ce=new oo;if(w)var ve=w(oe,se,B,a,c,ce);if(!(ve===n?Kc(se,oe,x|S,w,ce):ve))return!1}}return!0}function xS(a){if(!Dt(a)||aO(a))return!1;var c=ui(a)?C6:mM;return c.test(ea(a))}function $7(a){return Bt(a)&&On(a)==X}function R7(a){return Bt(a)&&Sn(a)==ee}function P7(a){return Bt(a)&&Hf(a.length)&&!!Pt[On(a)]}function bS(a){return typeof a=="function"?a:a==null?Kn:typeof a=="object"?Ye(a)?ES(a[0],a[1]):_S(a):V_(a)}function iv(a){if(!Xc(a))return A6(a);var c=[];for(var h in St(a))yt.call(a,h)&&h!="constructor"&&c.push(h);return c}function T7(a){if(!Dt(a))return dO(a);var c=Xc(a),h=[];for(var w in a)w=="constructor"&&(c||!yt.call(a,w))||h.push(w);return h}function sv(a,c){return a<c}function SS(a,c){var h=-1,w=Wn(a)?q(a.length):[];return Wi(a,function($,T,M){w[++h]=c($,T,M)}),w}function _S(a){var c=bv(a);return c.length==1&&c[0][2]?r_(c[0][0],c[0][1]):function(h){return h===a||ov(h,a,c)}}function ES(a,c){return _v(a)&&n_(c)?r_(ko(a),c):function(h){var w=Ov(h,a);return w===n&&w===c?Nv(h,a):Kc(c,w,x|S)}}function Tf(a,c,h,w,$){a!==c&&ev(c,function(T,M){if($||($=new oo),Dt(T))k7(a,c,M,h,Tf,w,$);else{var D=w?w(Cv(a,M),T,M+"",a,c,$):n;D===n&&(D=T),Qg(a,M,D)}},Hn)}function k7(a,c,h,w,$,T,M){var D=Cv(a,h),B=Cv(c,h),oe=M.get(B);if(oe){Qg(a,h,oe);return}var se=T?T(D,B,h+"",a,c,M):n,ce=se===n;if(ce){var ve=Ye(B),Pe=!ve&&Yi(B),Fe=!ve&&!Pe&&rl(B);se=B,ve||Pe||Fe?Ye(D)?se=D:Ht(D)?se=Vn(D):Pe?(ce=!1,se=IS(B,!0)):Fe?(ce=!1,se=LS(B,!0)):se=[]:qc(B)||ta(B)?(se=D,ta(D)?se=O_(D):(!Dt(D)||ui(D))&&(se=t_(B))):ce=!1}ce&&(M.set(B,se),$(se,B,w,T,M),M.delete(B)),Qg(a,h,se)}function CS(a,c){var h=a.length;if(h)return c+=c<0?h:0,ci(c,h)?a[c]:n}function $S(a,c,h){c.length?c=Mt(c,function(T){return Ye(T)?function(M){return Qs(M,T.length===1?T[0]:T)}:T}):c=[Kn];var w=-1;c=Mt(c,sr(Le()));var $=SS(a,function(T,M,D){var B=Mt(c,function(oe){return oe(T)});return{criteria:B,index:++w,value:T}});return r6($,function(T,M){return V7(T,M,h)})}function A7(a,c){return RS(a,c,function(h,w){return Nv(a,w)})}function RS(a,c,h){for(var w=-1,$=c.length,T={};++w<$;){var M=c[w],D=Qs(a,M);h(D,M)&&Gc(T,Ki(M,a),D)}return T}function M7(a){return function(c){return Qs(c,a)}}function av(a,c,h,w){var $=w?n6:Ka,T=-1,M=c.length,D=a;for(a===c&&(c=Vn(c)),h&&(D=Mt(a,sr(h)));++T<M;)for(var B=0,oe=c[T],se=h?h(oe):oe;(B=$(D,se,B,w))>-1;)D!==a&&wf.call(D,B,1),wf.call(a,B,1);return a}function PS(a,c){for(var h=a?c.length:0,w=h-1;h--;){var $=c[h];if(h==w||$!==T){var T=$;ci($)?wf.call(a,$,1):dv(a,$)}}return a}function lv(a,c){return a+Sf(lS()*(c-a+1))}function O7(a,c,h,w){for(var $=-1,T=tn(bf((c-a)/(h||1)),0),M=q(T);T--;)M[w?T:++$]=a,a+=h;return M}function cv(a,c){var h="";if(!a||c<1||c>G)return h;do c%2&&(h+=a),c=Sf(c/2),c&&(a+=a);while(c);return h}function et(a,c){return $v(o_(a,c,Kn),a+"")}function N7(a){return dS(ol(a))}function D7(a,c){var h=ol(a);return jf(h,qs(c,0,h.length))}function Gc(a,c,h,w){if(!Dt(a))return a;c=Ki(c,a);for(var $=-1,T=c.length,M=T-1,D=a;D!=null&&++$<T;){var B=ko(c[$]),oe=h;if(B==="__proto__"||B==="constructor"||B==="prototype")return a;if($!=M){var se=D[B];oe=w?w(se,B,D):n,oe===n&&(oe=Dt(se)?se:ci(c[$+1])?[]:{})}Vc(D,B,oe),D=D[B]}return a}var TS=_f?function(a,c){return _f.set(a,c),a}:Kn,I7=xf?function(a,c){return xf(a,"toString",{configurable:!0,enumerable:!1,value:Iv(c),writable:!0})}:Kn;function L7(a){return jf(ol(a))}function Ar(a,c,h){var w=-1,$=a.length;c<0&&(c=-c>$?0:$+c),h=h>$?$:h,h<0&&(h+=$),$=c>h?0:h-c>>>0,c>>>=0;for(var T=q($);++w<$;)T[w]=a[w+c];return T}function F7(a,c){var h;return Wi(a,function(w,$,T){return h=c(w,$,T),!h}),!!h}function kf(a,c,h){var w=0,$=a==null?w:a.length;if(typeof c=="number"&&c===c&&$<=ue){for(;w<$;){var T=w+$>>>1,M=a[T];M!==null&&!lr(M)&&(h?M<=c:M<c)?w=T+1:$=T}return $}return uv(a,c,Kn,h)}function uv(a,c,h,w){var $=0,T=a==null?0:a.length;if(T===0)return 0;c=h(c);for(var M=c!==c,D=c===null,B=lr(c),oe=c===n;$<T;){var se=Sf(($+T)/2),ce=h(a[se]),ve=ce!==n,Pe=ce===null,Fe=ce===ce,Qe=lr(ce);if(M)var je=w||Fe;else oe?je=Fe&&(w||ve):D?je=Fe&&ve&&(w||!Pe):B?je=Fe&&ve&&!Pe&&(w||!Qe):Pe||Qe?je=!1:je=w?ce<=c:ce<c;je?$=se+1:T=se}return bn(T,L)}function kS(a,c){for(var h=-1,w=a.length,$=0,T=[];++h<w;){var M=a[h],D=c?c(M):M;if(!h||!io(D,B)){var B=D;T[$++]=M===0?0:M}}return T}function AS(a){return typeof a=="number"?a:lr(a)?Q:+a}function ar(a){if(typeof a=="string")return a;if(Ye(a))return Mt(a,ar)+"";if(lr(a))return cS?cS.call(a):"";var c=a+"";return c=="0"&&1/a==-J?"-0":c}function Hi(a,c,h){var w=-1,$=cf,T=a.length,M=!0,D=[],B=D;if(h)M=!1,$=jg;else if(T>=o){var oe=c?null:X7(a);if(oe)return df(oe);M=!1,$=Lc,B=new Zs}else B=c?[]:D;e:for(;++w<T;){var se=a[w],ce=c?c(se):se;if(se=h||se!==0?se:0,M&&ce===ce){for(var ve=B.length;ve--;)if(B[ve]===ce)continue e;c&&B.push(ce),D.push(se)}else $(B,ce,h)||(B!==D&&B.push(ce),D.push(se))}return D}function dv(a,c){return c=Ki(c,a),a=i_(a,c),a==null||delete a[ko(Mr(c))]}function MS(a,c,h,w){return Gc(a,c,h(Qs(a,c)),w)}function Af(a,c,h,w){for(var $=a.length,T=w?$:-1;(w?T--:++T<$)&&c(a[T],T,a););return h?Ar(a,w?0:T,w?T+1:$):Ar(a,w?T+1:0,w?$:T)}function OS(a,c){var h=a;return h instanceof ot&&(h=h.value()),Bg(c,function(w,$){return $.func.apply($.thisArg,zi([w],$.args))},h)}function fv(a,c,h){var w=a.length;if(w<2)return w?Hi(a[0]):[];for(var $=-1,T=q(w);++$<w;)for(var M=a[$],D=-1;++D<w;)D!=$&&(T[$]=Wc(T[$]||M,a[D],c,h));return Hi(hn(T,1),c,h)}function NS(a,c,h){for(var w=-1,$=a.length,T=c.length,M={};++w<$;){var D=w<T?c[w]:n;h(M,a[w],D)}return M}function hv(a){return Ht(a)?a:[]}function pv(a){return typeof a=="function"?a:Kn}function Ki(a,c){return Ye(a)?a:_v(a,c)?[a]:c_(vt(a))}var j7=et;function Gi(a,c,h){var w=a.length;return h=h===n?w:h,!c&&h>=w?a:Ar(a,c,h)}var DS=$6||function(a){return fn.clearTimeout(a)};function IS(a,c){if(c)return a.slice();var h=a.length,w=rS?rS(h):new a.constructor(h);return a.copy(w),w}function mv(a){var c=new a.constructor(a.byteLength);return new vf(c).set(new vf(a)),c}function B7(a,c){var h=c?mv(a.buffer):a.buffer;return new a.constructor(h,a.byteOffset,a.byteLength)}function z7(a){var c=new a.constructor(a.source,wb.exec(a));return c.lastIndex=a.lastIndex,c}function U7(a){return Uc?St(Uc.call(a)):{}}function LS(a,c){var h=c?mv(a.buffer):a.buffer;return new a.constructor(h,a.byteOffset,a.length)}function FS(a,c){if(a!==c){var h=a!==n,w=a===null,$=a===a,T=lr(a),M=c!==n,D=c===null,B=c===c,oe=lr(c);if(!D&&!oe&&!T&&a>c||T&&M&&B&&!D&&!oe||w&&M&&B||!h&&B||!$)return 1;if(!w&&!T&&!oe&&a<c||oe&&h&&$&&!w&&!T||D&&h&&$||!M&&$||!B)return-1}return 0}function V7(a,c,h){for(var w=-1,$=a.criteria,T=c.criteria,M=$.length,D=h.length;++w<M;){var B=FS($[w],T[w]);if(B){if(w>=D)return B;var oe=h[w];return B*(oe=="desc"?-1:1)}}return a.index-c.index}function jS(a,c,h,w){for(var $=-1,T=a.length,M=h.length,D=-1,B=c.length,oe=tn(T-M,0),se=q(B+oe),ce=!w;++D<B;)se[D]=c[D];for(;++$<M;)(ce||$<T)&&(se[h[$]]=a[$]);for(;oe--;)se[D++]=a[$++];return se}function BS(a,c,h,w){for(var $=-1,T=a.length,M=-1,D=h.length,B=-1,oe=c.length,se=tn(T-D,0),ce=q(se+oe),ve=!w;++$<se;)ce[$]=a[$];for(var Pe=$;++B<oe;)ce[Pe+B]=c[B];for(;++M<D;)(ve||$<T)&&(ce[Pe+h[M]]=a[$++]);return ce}function Vn(a,c){var h=-1,w=a.length;for(c||(c=q(w));++h<w;)c[h]=a[h];return c}function To(a,c,h,w){var $=!h;h||(h={});for(var T=-1,M=c.length;++T<M;){var D=c[T],B=w?w(h[D],a[D],D,h,a):n;B===n&&(B=a[D]),$?si(h,D,B):Vc(h,D,B)}return h}function W7(a,c){return To(a,Sv(a),c)}function H7(a,c){return To(a,JS(a),c)}function Mf(a,c){return function(h,w){var $=Ye(h)?ZM:h7,T=c?c():{};return $(h,a,Le(w,2),T)}}function el(a){return et(function(c,h){var w=-1,$=h.length,T=$>1?h[$-1]:n,M=$>2?h[2]:n;for(T=a.length>3&&typeof T=="function"?($--,T):n,M&&Nn(h[0],h[1],M)&&(T=$<3?n:T,$=1),c=St(c);++w<$;){var D=h[w];D&&a(c,D,w,T)}return c})}function zS(a,c){return function(h,w){if(h==null)return h;if(!Wn(h))return a(h,w);for(var $=h.length,T=c?$:-1,M=St(h);(c?T--:++T<$)&&w(M[T],T,M)!==!1;);return h}}function US(a){return function(c,h,w){for(var $=-1,T=St(c),M=w(c),D=M.length;D--;){var B=M[a?D:++$];if(h(T[B],B,T)===!1)break}return c}}function K7(a,c,h){var w=c&E,$=Yc(a);function T(){var M=this&&this!==fn&&this instanceof T?$:a;return M.apply(w?h:this,arguments)}return T}function VS(a){return function(c){c=vt(c);var h=Ga(c)?ro(c):n,w=h?h[0]:c.charAt(0),$=h?Gi(h,1).join(""):c.slice(1);return w[a]()+$}}function tl(a){return function(c){return Bg(z_(B_(c).replace(IM,"")),a,"")}}function Yc(a){return function(){var c=arguments;switch(c.length){case 0:return new a;case 1:return new a(c[0]);case 2:return new a(c[0],c[1]);case 3:return new a(c[0],c[1],c[2]);case 4:return new a(c[0],c[1],c[2],c[3]);case 5:return new a(c[0],c[1],c[2],c[3],c[4]);case 6:return new a(c[0],c[1],c[2],c[3],c[4],c[5]);case 7:return new a(c[0],c[1],c[2],c[3],c[4],c[5],c[6])}var h=Ja(a.prototype),w=a.apply(h,c);return Dt(w)?w:h}}function G7(a,c,h){var w=Yc(a);function $(){for(var T=arguments.length,M=q(T),D=T,B=nl($);D--;)M[D]=arguments[D];var oe=T<3&&M[0]!==B&&M[T-1]!==B?[]:Ui(M,B);if(T-=oe.length,T<h)return YS(a,c,Of,$.placeholder,n,M,oe,n,n,h-T);var se=this&&this!==fn&&this instanceof $?w:a;return ir(se,this,M)}return $}function WS(a){return function(c,h,w){var $=St(c);if(!Wn(c)){var T=Le(h,3);c=ln(c),h=function(D){return T($[D],D,$)}}var M=a(c,h,w);return M>-1?$[T?c[M]:M]:n}}function HS(a){return li(function(c){var h=c.length,w=h,$=Tr.prototype.thru;for(a&&c.reverse();w--;){var T=c[w];if(typeof T!="function")throw new Pr(s);if($&&!M&&Lf(T)=="wrapper")var M=new Tr([],!0)}for(w=M?w:h;++w<h;){T=c[w];var D=Lf(T),B=D=="wrapper"?xv(T):n;B&&Ev(B[0])&&B[1]==(A|C|k|I)&&!B[4].length&&B[9]==1?M=M[Lf(B[0])].apply(M,B[3]):M=T.length==1&&Ev(T)?M[D]():M.thru(T)}return function(){var oe=arguments,se=oe[0];if(M&&oe.length==1&&Ye(se))return M.plant(se).value();for(var ce=0,ve=h?c[ce].apply(this,oe):se;++ce<h;)ve=c[ce].call(this,ve);return ve}})}function Of(a,c,h,w,$,T,M,D,B,oe){var se=c&A,ce=c&E,ve=c&_,Pe=c&(C|R),Fe=c&z,Qe=ve?n:Yc(a);function je(){for(var nt=arguments.length,at=q(nt),cr=nt;cr--;)at[cr]=arguments[cr];if(Pe)var Dn=nl(je),ur=i6(at,Dn);if(w&&(at=jS(at,w,$,Pe)),T&&(at=BS(at,T,M,Pe)),nt-=ur,Pe&&nt<oe){var Kt=Ui(at,Dn);return YS(a,c,Of,je.placeholder,h,at,Kt,D,B,oe-nt)}var so=ce?h:this,fi=ve?so[a]:a;return nt=at.length,D?at=hO(at,D):Fe&&nt>1&&at.reverse(),se&&B<nt&&(at.length=B),this&&this!==fn&&this instanceof je&&(fi=Qe||Yc(fi)),fi.apply(so,at)}return je}function KS(a,c){return function(h,w){return b7(h,a,c(w),{})}}function Nf(a,c){return function(h,w){var $;if(h===n&&w===n)return c;if(h!==n&&($=h),w!==n){if($===n)return w;typeof h=="string"||typeof w=="string"?(h=ar(h),w=ar(w)):(h=AS(h),w=AS(w)),$=a(h,w)}return $}}function gv(a){return li(function(c){return c=Mt(c,sr(Le())),et(function(h){var w=this;return a(c,function($){return ir($,w,h)})})})}function Df(a,c){c=c===n?" ":ar(c);var h=c.length;if(h<2)return h?cv(c,a):c;var w=cv(c,bf(a/Ya(c)));return Ga(c)?Gi(ro(w),0,a).join(""):w.slice(0,a)}function Y7(a,c,h,w){var $=c&E,T=Yc(a);function M(){for(var D=-1,B=arguments.length,oe=-1,se=w.length,ce=q(se+B),ve=this&&this!==fn&&this instanceof M?T:a;++oe<se;)ce[oe]=w[oe];for(;B--;)ce[oe++]=arguments[++D];return ir(ve,$?h:this,ce)}return M}function GS(a){return function(c,h,w){return w&&typeof w!="number"&&Nn(c,h,w)&&(h=w=n),c=di(c),h===n?(h=c,c=0):h=di(h),w=w===n?c<h?1:-1:di(w),O7(c,h,w,a)}}function If(a){return function(c,h){return typeof c=="string"&&typeof h=="string"||(c=Or(c),h=Or(h)),a(c,h)}}function YS(a,c,h,w,$,T,M,D,B,oe){var se=c&C,ce=se?M:n,ve=se?n:M,Pe=se?T:n,Fe=se?n:T;c|=se?k:O,c&=~(se?O:k),c&b||(c&=~(E|_));var Qe=[a,c,$,Pe,ce,Fe,ve,D,B,oe],je=h.apply(n,Qe);return Ev(a)&&s_(je,Qe),je.placeholder=w,a_(je,a,c)}function vv(a){var c=en[a];return function(h,w){if(h=Or(h),w=w==null?0:bn(qe(w),292),w&&aS(h)){var $=(vt(h)+"e").split("e"),T=c($[0]+"e"+(+$[1]+w));return $=(vt(T)+"e").split("e"),+($[0]+"e"+(+$[1]-w))}return c(h)}}var X7=qa&&1/df(new qa([,-0]))[1]==J?function(a){return new qa(a)}:jv;function XS(a){return function(c){var h=Sn(c);return h==st?Gg(c):h==ee?f6(c):o6(c,a(c))}}function ai(a,c,h,w,$,T,M,D){var B=c&_;if(!B&&typeof a!="function")throw new Pr(s);var oe=w?w.length:0;if(oe||(c&=~(k|O),w=$=n),M=M===n?M:tn(qe(M),0),D=D===n?D:qe(D),oe-=$?$.length:0,c&O){var se=w,ce=$;w=$=n}var ve=B?n:xv(a),Pe=[a,c,h,w,$,se,ce,T,M,D];if(ve&&uO(Pe,ve),a=Pe[0],c=Pe[1],h=Pe[2],w=Pe[3],$=Pe[4],D=Pe[9]=Pe[9]===n?B?0:a.length:tn(Pe[9]-oe,0),!D&&c&(C|R)&&(c&=~(C|R)),!c||c==E)var Fe=K7(a,c,h);else c==C||c==R?Fe=G7(a,c,D):(c==k||c==(E|k))&&!$.length?Fe=Y7(a,c,h,w):Fe=Of.apply(n,Pe);var Qe=ve?TS:s_;return a_(Qe(Fe,Pe),a,c)}function ZS(a,c,h,w){return a===n||io(a,Za[h])&&!yt.call(w,h)?c:a}function qS(a,c,h,w,$,T){return Dt(a)&&Dt(c)&&(T.set(c,a),Tf(a,c,n,qS,T),T.delete(c)),a}function Z7(a){return qc(a)?n:a}function QS(a,c,h,w,$,T){var M=h&x,D=a.length,B=c.length;if(D!=B&&!(M&&B>D))return!1;var oe=T.get(a),se=T.get(c);if(oe&&se)return oe==c&&se==a;var ce=-1,ve=!0,Pe=h&S?new Zs:n;for(T.set(a,c),T.set(c,a);++ce<D;){var Fe=a[ce],Qe=c[ce];if(w)var je=M?w(Qe,Fe,ce,c,a,T):w(Fe,Qe,ce,a,c,T);if(je!==n){if(je)continue;ve=!1;break}if(Pe){if(!zg(c,function(nt,at){if(!Lc(Pe,at)&&(Fe===nt||$(Fe,nt,h,w,T)))return Pe.push(at)})){ve=!1;break}}else if(!(Fe===Qe||$(Fe,Qe,h,w,T))){ve=!1;break}}return T.delete(a),T.delete(c),ve}function q7(a,c,h,w,$,T,M){switch(h){case An:if(a.byteLength!=c.byteLength||a.byteOffset!=c.byteOffset)return!1;a=a.buffer,c=c.buffer;case gt:return!(a.byteLength!=c.byteLength||!T(new vf(a),new vf(c)));case be:case Ee:case Yt:return io(+a,+c);case Ie:return a.name==c.name&&a.message==c.message;case X:case Se:return a==c+"";case st:var D=Gg;case ee:var B=w&x;if(D||(D=df),a.size!=c.size&&!B)return!1;var oe=M.get(a);if(oe)return oe==c;w|=S,M.set(a,c);var se=QS(D(a),D(c),w,$,T,M);return M.delete(a),se;case pe:if(Uc)return Uc.call(a)==Uc.call(c)}return!1}function Q7(a,c,h,w,$,T){var M=h&x,D=yv(a),B=D.length,oe=yv(c),se=oe.length;if(B!=se&&!M)return!1;for(var ce=B;ce--;){var ve=D[ce];if(!(M?ve in c:yt.call(c,ve)))return!1}var Pe=T.get(a),Fe=T.get(c);if(Pe&&Fe)return Pe==c&&Fe==a;var Qe=!0;T.set(a,c),T.set(c,a);for(var je=M;++ce<B;){ve=D[ce];var nt=a[ve],at=c[ve];if(w)var cr=M?w(at,nt,ve,c,a,T):w(nt,at,ve,a,c,T);if(!(cr===n?nt===at||$(nt,at,h,w,T):cr)){Qe=!1;break}je||(je=ve=="constructor")}if(Qe&&!je){var Dn=a.constructor,ur=c.constructor;Dn!=ur&&"constructor"in a&&"constructor"in c&&!(typeof Dn=="function"&&Dn instanceof Dn&&typeof ur=="function"&&ur instanceof ur)&&(Qe=!1)}return T.delete(a),T.delete(c),Qe}function li(a){return $v(o_(a,n,h_),a+"")}function yv(a){return yS(a,ln,Sv)}function wv(a){return yS(a,Hn,JS)}var xv=_f?function(a){return _f.get(a)}:jv;function Lf(a){for(var c=a.name+"",h=Qa[c],w=yt.call(Qa,c)?h.length:0;w--;){var $=h[w],T=$.func;if(T==null||T==a)return $.name}return c}function nl(a){var c=yt.call(P,"placeholder")?P:a;return c.placeholder}function Le(){var a=P.iteratee||Lv;return a=a===Lv?bS:a,arguments.length?a(arguments[0],arguments[1]):a}function Ff(a,c){var h=a.__data__;return sO(c)?h[typeof c=="string"?"string":"hash"]:h.map}function bv(a){for(var c=ln(a),h=c.length;h--;){var w=c[h],$=a[w];c[h]=[w,$,n_($)]}return c}function Js(a,c){var h=c6(a,c);return xS(h)?h:n}function J7(a){var c=yt.call(a,Ys),h=a[Ys];try{a[Ys]=n;var w=!0}catch{}var $=mf.call(a);return w&&(c?a[Ys]=h:delete a[Ys]),$}var Sv=Xg?function(a){return a==null?[]:(a=St(a),Bi(Xg(a),function(c){return iS.call(a,c)}))}:Bv,JS=Xg?function(a){for(var c=[];a;)zi(c,Sv(a)),a=yf(a);return c}:Bv,Sn=On;(Zg&&Sn(new Zg(new ArrayBuffer(1)))!=An||jc&&Sn(new jc)!=st||qg&&Sn(qg.resolve())!=Li||qa&&Sn(new qa)!=ee||Bc&&Sn(new Bc)!=Te)&&(Sn=function(a){var c=On(a),h=c==Jt?a.constructor:n,w=h?ea(h):"";if(w)switch(w){case D6:return An;case I6:return st;case L6:return Li;case F6:return ee;case j6:return Te}return c});function eO(a,c,h){for(var w=-1,$=h.length;++w<$;){var T=h[w],M=T.size;switch(T.type){case"drop":a+=M;break;case"dropRight":c-=M;break;case"take":c=bn(c,a+M);break;case"takeRight":a=tn(a,c-M);break}}return{start:a,end:c}}function tO(a){var c=a.match(W);return c?c[1].split(We):[]}function e_(a,c,h){c=Ki(c,a);for(var w=-1,$=c.length,T=!1;++w<$;){var M=ko(c[w]);if(!(T=a!=null&&h(a,M)))break;a=a[M]}return T||++w!=$?T:($=a==null?0:a.length,!!$&&Hf($)&&ci(M,$)&&(Ye(a)||ta(a)))}function nO(a){var c=a.length,h=new a.constructor(c);return c&&typeof a[0]=="string"&&yt.call(a,"index")&&(h.index=a.index,h.input=a.input),h}function t_(a){return typeof a.constructor=="function"&&!Xc(a)?Ja(yf(a)):{}}function rO(a,c,h){var w=a.constructor;switch(c){case gt:return mv(a);case be:case Ee:return new w(+a);case An:return B7(a,h);case Mn:case Fi:case Ro:case Cr:case Ks:case ri:case ji:case or:case Zd:return LS(a,h);case st:return new w;case Yt:case Se:return new w(a);case X:return z7(a);case ee:return new w;case pe:return U7(a)}}function oO(a,c){var h=c.length;if(!h)return a;var w=h-1;return c[w]=(h>1?"& ":"")+c[w],c=c.join(h>2?", ":" "),a.replace(Ag,`{
/* [wrapped with `+c+`] */
`)}function iO(a){return Ye(a)||ta(a)||!!(sS&&a&&a[sS])}function ci(a,c){var h=typeof a;return c=c??G,!!c&&(h=="number"||h!="symbol"&&vM.test(a))&&a>-1&&a%1==0&&a<c}function Nn(a,c,h){if(!Dt(h))return!1;var w=typeof c;return(w=="number"?Wn(h)&&ci(c,h.length):w=="string"&&c in h)?io(h[c],a):!1}function _v(a,c){if(Ye(a))return!1;var h=typeof a;return h=="number"||h=="symbol"||h=="boolean"||a==null||lr(a)?!0:Dc.test(a)||!Pg.test(a)||c!=null&&a in St(c)}function sO(a){var c=typeof a;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?a!=="__proto__":a===null}function Ev(a){var c=Lf(a),h=P[c];if(typeof h!="function"||!(c in ot.prototype))return!1;if(a===h)return!0;var w=xv(h);return!!w&&a===w[0]}function aO(a){return!!nS&&nS in a}var lO=hf?ui:zv;function Xc(a){var c=a&&a.constructor,h=typeof c=="function"&&c.prototype||Za;return a===h}function n_(a){return a===a&&!Dt(a)}function r_(a,c){return function(h){return h==null?!1:h[a]===c&&(c!==n||a in St(h))}}function cO(a){var c=Vf(a,function(w){return h.size===f&&h.clear(),w}),h=c.cache;return c}function uO(a,c){var h=a[1],w=c[1],$=h|w,T=$<(E|_|A),M=w==A&&h==C||w==A&&h==I&&a[7].length<=c[8]||w==(A|I)&&c[7].length<=c[8]&&h==C;if(!(T||M))return a;w&E&&(a[2]=c[2],$|=h&E?0:b);var D=c[3];if(D){var B=a[3];a[3]=B?jS(B,D,c[4]):D,a[4]=B?Ui(a[3],m):c[4]}return D=c[5],D&&(B=a[5],a[5]=B?BS(B,D,c[6]):D,a[6]=B?Ui(a[5],m):c[6]),D=c[7],D&&(a[7]=D),w&A&&(a[8]=a[8]==null?c[8]:bn(a[8],c[8])),a[9]==null&&(a[9]=c[9]),a[0]=c[0],a[1]=$,a}function dO(a){var c=[];if(a!=null)for(var h in St(a))c.push(h);return c}function fO(a){return mf.call(a)}function o_(a,c,h){return c=tn(c===n?a.length-1:c,0),function(){for(var w=arguments,$=-1,T=tn(w.length-c,0),M=q(T);++$<T;)M[$]=w[c+$];$=-1;for(var D=q(c+1);++$<c;)D[$]=w[$];return D[c]=h(M),ir(a,this,D)}}function i_(a,c){return c.length<2?a:Qs(a,Ar(c,0,-1))}function hO(a,c){for(var h=a.length,w=bn(c.length,h),$=Vn(a);w--;){var T=c[w];a[w]=ci(T,h)?$[T]:n}return a}function Cv(a,c){if(!(c==="constructor"&&typeof a[c]=="function")&&c!="__proto__")return a[c]}var s_=l_(TS),Zc=P6||function(a,c){return fn.setTimeout(a,c)},$v=l_(I7);function a_(a,c,h){var w=c+"";return $v(a,oO(w,pO(tO(w),h)))}function l_(a){var c=0,h=0;return function(){var w=M6(),$=te-(w-h);if(h=w,$>0){if(++c>=K)return arguments[0]}else c=0;return a.apply(n,arguments)}}function jf(a,c){var h=-1,w=a.length,$=w-1;for(c=c===n?w:c;++h<c;){var T=lv(h,$),M=a[T];a[T]=a[h],a[h]=M}return a.length=c,a}var c_=cO(function(a){var c=[];return a.charCodeAt(0)===46&&c.push(""),a.replace(rf,function(h,w,$,T){c.push($?T.replace(an,"$1"):w||h)}),c});function ko(a){if(typeof a=="string"||lr(a))return a;var c=a+"";return c=="0"&&1/a==-J?"-0":c}function ea(a){if(a!=null){try{return pf.call(a)}catch{}try{return a+""}catch{}}return""}function pO(a,c){return Rr(Ne,function(h){var w="_."+h[0];c&h[1]&&!cf(a,w)&&a.push(w)}),a.sort()}function u_(a){if(a instanceof ot)return a.clone();var c=new Tr(a.__wrapped__,a.__chain__);return c.__actions__=Vn(a.__actions__),c.__index__=a.__index__,c.__values__=a.__values__,c}function mO(a,c,h){(h?Nn(a,c,h):c===n)?c=1:c=tn(qe(c),0);var w=a==null?0:a.length;if(!w||c<1)return[];for(var $=0,T=0,M=q(bf(w/c));$<w;)M[T++]=Ar(a,$,$+=c);return M}function gO(a){for(var c=-1,h=a==null?0:a.length,w=0,$=[];++c<h;){var T=a[c];T&&($[w++]=T)}return $}function vO(){var a=arguments.length;if(!a)return[];for(var c=q(a-1),h=arguments[0],w=a;w--;)c[w-1]=arguments[w];return zi(Ye(h)?Vn(h):[h],hn(c,1))}var yO=et(function(a,c){return Ht(a)?Wc(a,hn(c,1,Ht,!0)):[]}),wO=et(function(a,c){var h=Mr(c);return Ht(h)&&(h=n),Ht(a)?Wc(a,hn(c,1,Ht,!0),Le(h,2)):[]}),xO=et(function(a,c){var h=Mr(c);return Ht(h)&&(h=n),Ht(a)?Wc(a,hn(c,1,Ht,!0),n,h):[]});function bO(a,c,h){var w=a==null?0:a.length;return w?(c=h||c===n?1:qe(c),Ar(a,c<0?0:c,w)):[]}function SO(a,c,h){var w=a==null?0:a.length;return w?(c=h||c===n?1:qe(c),c=w-c,Ar(a,0,c<0?0:c)):[]}function _O(a,c){return a&&a.length?Af(a,Le(c,3),!0,!0):[]}function EO(a,c){return a&&a.length?Af(a,Le(c,3),!0):[]}function CO(a,c,h,w){var $=a==null?0:a.length;return $?(h&&typeof h!="number"&&Nn(a,c,h)&&(h=0,w=$),v7(a,c,h,w)):[]}function d_(a,c,h){var w=a==null?0:a.length;if(!w)return-1;var $=h==null?0:qe(h);return $<0&&($=tn(w+$,0)),uf(a,Le(c,3),$)}function f_(a,c,h){var w=a==null?0:a.length;if(!w)return-1;var $=w-1;return h!==n&&($=qe(h),$=h<0?tn(w+$,0):bn($,w-1)),uf(a,Le(c,3),$,!0)}function h_(a){var c=a==null?0:a.length;return c?hn(a,1):[]}function $O(a){var c=a==null?0:a.length;return c?hn(a,J):[]}function RO(a,c){var h=a==null?0:a.length;return h?(c=c===n?1:qe(c),hn(a,c)):[]}function PO(a){for(var c=-1,h=a==null?0:a.length,w={};++c<h;){var $=a[c];w[$[0]]=$[1]}return w}function p_(a){return a&&a.length?a[0]:n}function TO(a,c,h){var w=a==null?0:a.length;if(!w)return-1;var $=h==null?0:qe(h);return $<0&&($=tn(w+$,0)),Ka(a,c,$)}function kO(a){var c=a==null?0:a.length;return c?Ar(a,0,-1):[]}var AO=et(function(a){var c=Mt(a,hv);return c.length&&c[0]===a[0]?rv(c):[]}),MO=et(function(a){var c=Mr(a),h=Mt(a,hv);return c===Mr(h)?c=n:h.pop(),h.length&&h[0]===a[0]?rv(h,Le(c,2)):[]}),OO=et(function(a){var c=Mr(a),h=Mt(a,hv);return c=typeof c=="function"?c:n,c&&h.pop(),h.length&&h[0]===a[0]?rv(h,n,c):[]});function NO(a,c){return a==null?"":k6.call(a,c)}function Mr(a){var c=a==null?0:a.length;return c?a[c-1]:n}function DO(a,c,h){var w=a==null?0:a.length;if(!w)return-1;var $=w;return h!==n&&($=qe(h),$=$<0?tn(w+$,0):bn($,w-1)),c===c?p6(a,c,$):uf(a,Yb,$,!0)}function IO(a,c){return a&&a.length?CS(a,qe(c)):n}var LO=et(m_);function m_(a,c){return a&&a.length&&c&&c.length?av(a,c):a}function FO(a,c,h){return a&&a.length&&c&&c.length?av(a,c,Le(h,2)):a}function jO(a,c,h){return a&&a.length&&c&&c.length?av(a,c,n,h):a}var BO=li(function(a,c){var h=a==null?0:a.length,w=Jg(a,c);return PS(a,Mt(c,function($){return ci($,h)?+$:$}).sort(FS)),w});function zO(a,c){var h=[];if(!(a&&a.length))return h;var w=-1,$=[],T=a.length;for(c=Le(c,3);++w<T;){var M=a[w];c(M,w,a)&&(h.push(M),$.push(w))}return PS(a,$),h}function Rv(a){return a==null?a:N6.call(a)}function UO(a,c,h){var w=a==null?0:a.length;return w?(h&&typeof h!="number"&&Nn(a,c,h)?(c=0,h=w):(c=c==null?0:qe(c),h=h===n?w:qe(h)),Ar(a,c,h)):[]}function VO(a,c){return kf(a,c)}function WO(a,c,h){return uv(a,c,Le(h,2))}function HO(a,c){var h=a==null?0:a.length;if(h){var w=kf(a,c);if(w<h&&io(a[w],c))return w}return-1}function KO(a,c){return kf(a,c,!0)}function GO(a,c,h){return uv(a,c,Le(h,2),!0)}function YO(a,c){var h=a==null?0:a.length;if(h){var w=kf(a,c,!0)-1;if(io(a[w],c))return w}return-1}function XO(a){return a&&a.length?kS(a):[]}function ZO(a,c){return a&&a.length?kS(a,Le(c,2)):[]}function qO(a){var c=a==null?0:a.length;return c?Ar(a,1,c):[]}function QO(a,c,h){return a&&a.length?(c=h||c===n?1:qe(c),Ar(a,0,c<0?0:c)):[]}function JO(a,c,h){var w=a==null?0:a.length;return w?(c=h||c===n?1:qe(c),c=w-c,Ar(a,c<0?0:c,w)):[]}function eN(a,c){return a&&a.length?Af(a,Le(c,3),!1,!0):[]}function tN(a,c){return a&&a.length?Af(a,Le(c,3)):[]}var nN=et(function(a){return Hi(hn(a,1,Ht,!0))}),rN=et(function(a){var c=Mr(a);return Ht(c)&&(c=n),Hi(hn(a,1,Ht,!0),Le(c,2))}),oN=et(function(a){var c=Mr(a);return c=typeof c=="function"?c:n,Hi(hn(a,1,Ht,!0),n,c)});function iN(a){return a&&a.length?Hi(a):[]}function sN(a,c){return a&&a.length?Hi(a,Le(c,2)):[]}function aN(a,c){return c=typeof c=="function"?c:n,a&&a.length?Hi(a,n,c):[]}function Pv(a){if(!(a&&a.length))return[];var c=0;return a=Bi(a,function(h){if(Ht(h))return c=tn(h.length,c),!0}),Hg(c,function(h){return Mt(a,Ug(h))})}function g_(a,c){if(!(a&&a.length))return[];var h=Pv(a);return c==null?h:Mt(h,function(w){return ir(c,n,w)})}var lN=et(function(a,c){return Ht(a)?Wc(a,c):[]}),cN=et(function(a){return fv(Bi(a,Ht))}),uN=et(function(a){var c=Mr(a);return Ht(c)&&(c=n),fv(Bi(a,Ht),Le(c,2))}),dN=et(function(a){var c=Mr(a);return c=typeof c=="function"?c:n,fv(Bi(a,Ht),n,c)}),fN=et(Pv);function hN(a,c){return NS(a||[],c||[],Vc)}function pN(a,c){return NS(a||[],c||[],Gc)}var mN=et(function(a){var c=a.length,h=c>1?a[c-1]:n;return h=typeof h=="function"?(a.pop(),h):n,g_(a,h)});function v_(a){var c=P(a);return c.__chain__=!0,c}function gN(a,c){return c(a),a}function Bf(a,c){return c(a)}var vN=li(function(a){var c=a.length,h=c?a[0]:0,w=this.__wrapped__,$=function(T){return Jg(T,a)};return c>1||this.__actions__.length||!(w instanceof ot)||!ci(h)?this.thru($):(w=w.slice(h,+h+(c?1:0)),w.__actions__.push({func:Bf,args:[$],thisArg:n}),new Tr(w,this.__chain__).thru(function(T){return c&&!T.length&&T.push(n),T}))});function yN(){return v_(this)}function wN(){return new Tr(this.value(),this.__chain__)}function xN(){this.__values__===n&&(this.__values__=A_(this.value()));var a=this.__index__>=this.__values__.length,c=a?n:this.__values__[this.__index__++];return{done:a,value:c}}function bN(){return this}function SN(a){for(var c,h=this;h instanceof Cf;){var w=u_(h);w.__index__=0,w.__values__=n,c?$.__wrapped__=w:c=w;var $=w;h=h.__wrapped__}return $.__wrapped__=a,c}function _N(){var a=this.__wrapped__;if(a instanceof ot){var c=a;return this.__actions__.length&&(c=new ot(this)),c=c.reverse(),c.__actions__.push({func:Bf,args:[Rv],thisArg:n}),new Tr(c,this.__chain__)}return this.thru(Rv)}function EN(){return OS(this.__wrapped__,this.__actions__)}var CN=Mf(function(a,c,h){yt.call(a,h)?++a[h]:si(a,h,1)});function $N(a,c,h){var w=Ye(a)?Kb:g7;return h&&Nn(a,c,h)&&(c=n),w(a,Le(c,3))}function RN(a,c){var h=Ye(a)?Bi:gS;return h(a,Le(c,3))}var PN=WS(d_),TN=WS(f_);function kN(a,c){return hn(zf(a,c),1)}function AN(a,c){return hn(zf(a,c),J)}function MN(a,c,h){return h=h===n?1:qe(h),hn(zf(a,c),h)}function y_(a,c){var h=Ye(a)?Rr:Wi;return h(a,Le(c,3))}function w_(a,c){var h=Ye(a)?qM:mS;return h(a,Le(c,3))}var ON=Mf(function(a,c,h){yt.call(a,h)?a[h].push(c):si(a,h,[c])});function NN(a,c,h,w){a=Wn(a)?a:ol(a),h=h&&!w?qe(h):0;var $=a.length;return h<0&&(h=tn($+h,0)),Kf(a)?h<=$&&a.indexOf(c,h)>-1:!!$&&Ka(a,c,h)>-1}var DN=et(function(a,c,h){var w=-1,$=typeof c=="function",T=Wn(a)?q(a.length):[];return Wi(a,function(M){T[++w]=$?ir(c,M,h):Hc(M,c,h)}),T}),IN=Mf(function(a,c,h){si(a,h,c)});function zf(a,c){var h=Ye(a)?Mt:SS;return h(a,Le(c,3))}function LN(a,c,h,w){return a==null?[]:(Ye(c)||(c=c==null?[]:[c]),h=w?n:h,Ye(h)||(h=h==null?[]:[h]),$S(a,c,h))}var FN=Mf(function(a,c,h){a[h?0:1].push(c)},function(){return[[],[]]});function jN(a,c,h){var w=Ye(a)?Bg:Zb,$=arguments.length<3;return w(a,Le(c,4),h,$,Wi)}function BN(a,c,h){var w=Ye(a)?QM:Zb,$=arguments.length<3;return w(a,Le(c,4),h,$,mS)}function zN(a,c){var h=Ye(a)?Bi:gS;return h(a,Wf(Le(c,3)))}function UN(a){var c=Ye(a)?dS:N7;return c(a)}function VN(a,c,h){(h?Nn(a,c,h):c===n)?c=1:c=qe(c);var w=Ye(a)?d7:D7;return w(a,c)}function WN(a){var c=Ye(a)?f7:L7;return c(a)}function HN(a){if(a==null)return 0;if(Wn(a))return Kf(a)?Ya(a):a.length;var c=Sn(a);return c==st||c==ee?a.size:iv(a).length}function KN(a,c,h){var w=Ye(a)?zg:F7;return h&&Nn(a,c,h)&&(c=n),w(a,Le(c,3))}var GN=et(function(a,c){if(a==null)return[];var h=c.length;return h>1&&Nn(a,c[0],c[1])?c=[]:h>2&&Nn(c[0],c[1],c[2])&&(c=[c[0]]),$S(a,hn(c,1),[])}),Uf=R6||function(){return fn.Date.now()};function YN(a,c){if(typeof c!="function")throw new Pr(s);return a=qe(a),function(){if(--a<1)return c.apply(this,arguments)}}function x_(a,c,h){return c=h?n:c,c=a&&c==null?a.length:c,ai(a,A,n,n,n,n,c)}function b_(a,c){var h;if(typeof c!="function")throw new Pr(s);return a=qe(a),function(){return--a>0&&(h=c.apply(this,arguments)),a<=1&&(c=n),h}}var Tv=et(function(a,c,h){var w=E;if(h.length){var $=Ui(h,nl(Tv));w|=k}return ai(a,w,c,h,$)}),S_=et(function(a,c,h){var w=E|_;if(h.length){var $=Ui(h,nl(S_));w|=k}return ai(c,w,a,h,$)});function __(a,c,h){c=h?n:c;var w=ai(a,C,n,n,n,n,n,c);return w.placeholder=__.placeholder,w}function E_(a,c,h){c=h?n:c;var w=ai(a,R,n,n,n,n,n,c);return w.placeholder=E_.placeholder,w}function C_(a,c,h){var w,$,T,M,D,B,oe=0,se=!1,ce=!1,ve=!0;if(typeof a!="function")throw new Pr(s);c=Or(c)||0,Dt(h)&&(se=!!h.leading,ce="maxWait"in h,T=ce?tn(Or(h.maxWait)||0,c):T,ve="trailing"in h?!!h.trailing:ve);function Pe(Kt){var so=w,fi=$;return w=$=n,oe=Kt,M=a.apply(fi,so),M}function Fe(Kt){return oe=Kt,D=Zc(nt,c),se?Pe(Kt):M}function Qe(Kt){var so=Kt-B,fi=Kt-oe,W_=c-so;return ce?bn(W_,T-fi):W_}function je(Kt){var so=Kt-B,fi=Kt-oe;return B===n||so>=c||so<0||ce&&fi>=T}function nt(){var Kt=Uf();if(je(Kt))return at(Kt);D=Zc(nt,Qe(Kt))}function at(Kt){return D=n,ve&&w?Pe(Kt):(w=$=n,M)}function cr(){D!==n&&DS(D),oe=0,w=B=$=D=n}function Dn(){return D===n?M:at(Uf())}function ur(){var Kt=Uf(),so=je(Kt);if(w=arguments,$=this,B=Kt,so){if(D===n)return Fe(B);if(ce)return DS(D),D=Zc(nt,c),Pe(B)}return D===n&&(D=Zc(nt,c)),M}return ur.cancel=cr,ur.flush=Dn,ur}var XN=et(function(a,c){return pS(a,1,c)}),ZN=et(function(a,c,h){return pS(a,Or(c)||0,h)});function qN(a){return ai(a,z)}function Vf(a,c){if(typeof a!="function"||c!=null&&typeof c!="function")throw new Pr(s);var h=function(){var w=arguments,$=c?c.apply(this,w):w[0],T=h.cache;if(T.has($))return T.get($);var M=a.apply(this,w);return h.cache=T.set($,M)||T,M};return h.cache=new(Vf.Cache||ii),h}Vf.Cache=ii;function Wf(a){if(typeof a!="function")throw new Pr(s);return function(){var c=arguments;switch(c.length){case 0:return!a.call(this);case 1:return!a.call(this,c[0]);case 2:return!a.call(this,c[0],c[1]);case 3:return!a.call(this,c[0],c[1],c[2])}return!a.apply(this,c)}}function QN(a){return b_(2,a)}var JN=j7(function(a,c){c=c.length==1&&Ye(c[0])?Mt(c[0],sr(Le())):Mt(hn(c,1),sr(Le()));var h=c.length;return et(function(w){for(var $=-1,T=bn(w.length,h);++$<T;)w[$]=c[$].call(this,w[$]);return ir(a,this,w)})}),kv=et(function(a,c){var h=Ui(c,nl(kv));return ai(a,k,n,c,h)}),$_=et(function(a,c){var h=Ui(c,nl($_));return ai(a,O,n,c,h)}),e4=li(function(a,c){return ai(a,I,n,n,n,c)});function t4(a,c){if(typeof a!="function")throw new Pr(s);return c=c===n?c:qe(c),et(a,c)}function n4(a,c){if(typeof a!="function")throw new Pr(s);return c=c==null?0:tn(qe(c),0),et(function(h){var w=h[c],$=Gi(h,0,c);return w&&zi($,w),ir(a,this,$)})}function r4(a,c,h){var w=!0,$=!0;if(typeof a!="function")throw new Pr(s);return Dt(h)&&(w="leading"in h?!!h.leading:w,$="trailing"in h?!!h.trailing:$),C_(a,c,{leading:w,maxWait:c,trailing:$})}function o4(a){return x_(a,1)}function i4(a,c){return kv(pv(c),a)}function s4(){if(!arguments.length)return[];var a=arguments[0];return Ye(a)?a:[a]}function a4(a){return kr(a,y)}function l4(a,c){return c=typeof c=="function"?c:n,kr(a,y,c)}function c4(a){return kr(a,p|y)}function u4(a,c){return c=typeof c=="function"?c:n,kr(a,p|y,c)}function d4(a,c){return c==null||hS(a,c,ln(c))}function io(a,c){return a===c||a!==a&&c!==c}var f4=If(nv),h4=If(function(a,c){return a>=c}),ta=wS(function(){return arguments}())?wS:function(a){return Bt(a)&&yt.call(a,"callee")&&!iS.call(a,"callee")},Ye=q.isArray,p4=Bb?sr(Bb):S7;function Wn(a){return a!=null&&Hf(a.length)&&!ui(a)}function Ht(a){return Bt(a)&&Wn(a)}function m4(a){return a===!0||a===!1||Bt(a)&&On(a)==be}var Yi=T6||zv,g4=zb?sr(zb):_7;function v4(a){return Bt(a)&&a.nodeType===1&&!qc(a)}function y4(a){if(a==null)return!0;if(Wn(a)&&(Ye(a)||typeof a=="string"||typeof a.splice=="function"||Yi(a)||rl(a)||ta(a)))return!a.length;var c=Sn(a);if(c==st||c==ee)return!a.size;if(Xc(a))return!iv(a).length;for(var h in a)if(yt.call(a,h))return!1;return!0}function w4(a,c){return Kc(a,c)}function x4(a,c,h){h=typeof h=="function"?h:n;var w=h?h(a,c):n;return w===n?Kc(a,c,n,h):!!w}function Av(a){if(!Bt(a))return!1;var c=On(a);return c==Ie||c==Oe||typeof a.message=="string"&&typeof a.name=="string"&&!qc(a)}function b4(a){return typeof a=="number"&&aS(a)}function ui(a){if(!Dt(a))return!1;var c=On(a);return c==ze||c==ht||c==me||c==N}function R_(a){return typeof a=="number"&&a==qe(a)}function Hf(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=G}function Dt(a){var c=typeof a;return a!=null&&(c=="object"||c=="function")}function Bt(a){return a!=null&&typeof a=="object"}var P_=Ub?sr(Ub):C7;function S4(a,c){return a===c||ov(a,c,bv(c))}function _4(a,c,h){return h=typeof h=="function"?h:n,ov(a,c,bv(c),h)}function E4(a){return T_(a)&&a!=+a}function C4(a){if(lO(a))throw new Ge(i);return xS(a)}function $4(a){return a===null}function R4(a){return a==null}function T_(a){return typeof a=="number"||Bt(a)&&On(a)==Yt}function qc(a){if(!Bt(a)||On(a)!=Jt)return!1;var c=yf(a);if(c===null)return!0;var h=yt.call(c,"constructor")&&c.constructor;return typeof h=="function"&&h instanceof h&&pf.call(h)==_6}var Mv=Vb?sr(Vb):$7;function P4(a){return R_(a)&&a>=-G&&a<=G}var k_=Wb?sr(Wb):R7;function Kf(a){return typeof a=="string"||!Ye(a)&&Bt(a)&&On(a)==Se}function lr(a){return typeof a=="symbol"||Bt(a)&&On(a)==pe}var rl=Hb?sr(Hb):P7;function T4(a){return a===n}function k4(a){return Bt(a)&&Sn(a)==Te}function A4(a){return Bt(a)&&On(a)==ut}var M4=If(sv),O4=If(function(a,c){return a<=c});function A_(a){if(!a)return[];if(Wn(a))return Kf(a)?ro(a):Vn(a);if(Fc&&a[Fc])return d6(a[Fc]());var c=Sn(a),h=c==st?Gg:c==ee?df:ol;return h(a)}function di(a){if(!a)return a===0?a:0;if(a=Or(a),a===J||a===-J){var c=a<0?-1:1;return c*Z}return a===a?a:0}function qe(a){var c=di(a),h=c%1;return c===c?h?c-h:c:0}function M_(a){return a?qs(qe(a),0,le):0}function Or(a){if(typeof a=="number")return a;if(lr(a))return Q;if(Dt(a)){var c=typeof a.valueOf=="function"?a.valueOf():a;a=Dt(c)?c+"":c}if(typeof a!="string")return a===0?a:+a;a=qb(a);var h=pM.test(a);return h||gM.test(a)?YM(a.slice(2),h?2:8):hM.test(a)?Q:+a}function O_(a){return To(a,Hn(a))}function N4(a){return a?qs(qe(a),-G,G):a===0?a:0}function vt(a){return a==null?"":ar(a)}var D4=el(function(a,c){if(Xc(c)||Wn(c)){To(c,ln(c),a);return}for(var h in c)yt.call(c,h)&&Vc(a,h,c[h])}),N_=el(function(a,c){To(c,Hn(c),a)}),Gf=el(function(a,c,h,w){To(c,Hn(c),a,w)}),I4=el(function(a,c,h,w){To(c,ln(c),a,w)}),L4=li(Jg);function F4(a,c){var h=Ja(a);return c==null?h:fS(h,c)}var j4=et(function(a,c){a=St(a);var h=-1,w=c.length,$=w>2?c[2]:n;for($&&Nn(c[0],c[1],$)&&(w=1);++h<w;)for(var T=c[h],M=Hn(T),D=-1,B=M.length;++D<B;){var oe=M[D],se=a[oe];(se===n||io(se,Za[oe])&&!yt.call(a,oe))&&(a[oe]=T[oe])}return a}),B4=et(function(a){return a.push(n,qS),ir(D_,n,a)});function z4(a,c){return Gb(a,Le(c,3),Po)}function U4(a,c){return Gb(a,Le(c,3),tv)}function V4(a,c){return a==null?a:ev(a,Le(c,3),Hn)}function W4(a,c){return a==null?a:vS(a,Le(c,3),Hn)}function H4(a,c){return a&&Po(a,Le(c,3))}function K4(a,c){return a&&tv(a,Le(c,3))}function G4(a){return a==null?[]:Pf(a,ln(a))}function Y4(a){return a==null?[]:Pf(a,Hn(a))}function Ov(a,c,h){var w=a==null?n:Qs(a,c);return w===n?h:w}function X4(a,c){return a!=null&&e_(a,c,y7)}function Nv(a,c){return a!=null&&e_(a,c,w7)}var Z4=KS(function(a,c,h){c!=null&&typeof c.toString!="function"&&(c=mf.call(c)),a[c]=h},Iv(Kn)),q4=KS(function(a,c,h){c!=null&&typeof c.toString!="function"&&(c=mf.call(c)),yt.call(a,c)?a[c].push(h):a[c]=[h]},Le),Q4=et(Hc);function ln(a){return Wn(a)?uS(a):iv(a)}function Hn(a){return Wn(a)?uS(a,!0):T7(a)}function J4(a,c){var h={};return c=Le(c,3),Po(a,function(w,$,T){si(h,c(w,$,T),w)}),h}function e8(a,c){var h={};return c=Le(c,3),Po(a,function(w,$,T){si(h,$,c(w,$,T))}),h}var t8=el(function(a,c,h){Tf(a,c,h)}),D_=el(function(a,c,h,w){Tf(a,c,h,w)}),n8=li(function(a,c){var h={};if(a==null)return h;var w=!1;c=Mt(c,function(T){return T=Ki(T,a),w||(w=T.length>1),T}),To(a,wv(a),h),w&&(h=kr(h,p|g|y,Z7));for(var $=c.length;$--;)dv(h,c[$]);return h});function r8(a,c){return I_(a,Wf(Le(c)))}var o8=li(function(a,c){return a==null?{}:A7(a,c)});function I_(a,c){if(a==null)return{};var h=Mt(wv(a),function(w){return[w]});return c=Le(c),RS(a,h,function(w,$){return c(w,$[0])})}function i8(a,c,h){c=Ki(c,a);var w=-1,$=c.length;for($||($=1,a=n);++w<$;){var T=a==null?n:a[ko(c[w])];T===n&&(w=$,T=h),a=ui(T)?T.call(a):T}return a}function s8(a,c,h){return a==null?a:Gc(a,c,h)}function a8(a,c,h,w){return w=typeof w=="function"?w:n,a==null?a:Gc(a,c,h,w)}var L_=XS(ln),F_=XS(Hn);function l8(a,c,h){var w=Ye(a),$=w||Yi(a)||rl(a);if(c=Le(c,4),h==null){var T=a&&a.constructor;$?h=w?new T:[]:Dt(a)?h=ui(T)?Ja(yf(a)):{}:h={}}return($?Rr:Po)(a,function(M,D,B){return c(h,M,D,B)}),h}function c8(a,c){return a==null?!0:dv(a,c)}function u8(a,c,h){return a==null?a:MS(a,c,pv(h))}function d8(a,c,h,w){return w=typeof w=="function"?w:n,a==null?a:MS(a,c,pv(h),w)}function ol(a){return a==null?[]:Kg(a,ln(a))}function f8(a){return a==null?[]:Kg(a,Hn(a))}function h8(a,c,h){return h===n&&(h=c,c=n),h!==n&&(h=Or(h),h=h===h?h:0),c!==n&&(c=Or(c),c=c===c?c:0),qs(Or(a),c,h)}function p8(a,c,h){return c=di(c),h===n?(h=c,c=0):h=di(h),a=Or(a),x7(a,c,h)}function m8(a,c,h){if(h&&typeof h!="boolean"&&Nn(a,c,h)&&(c=h=n),h===n&&(typeof c=="boolean"?(h=c,c=n):typeof a=="boolean"&&(h=a,a=n)),a===n&&c===n?(a=0,c=1):(a=di(a),c===n?(c=a,a=0):c=di(c)),a>c){var w=a;a=c,c=w}if(h||a%1||c%1){var $=lS();return bn(a+$*(c-a+GM("1e-"+(($+"").length-1))),c)}return lv(a,c)}var g8=tl(function(a,c,h){return c=c.toLowerCase(),a+(h?j_(c):c)});function j_(a){return Dv(vt(a).toLowerCase())}function B_(a){return a=vt(a),a&&a.replace(yM,s6).replace(LM,"")}function v8(a,c,h){a=vt(a),c=ar(c);var w=a.length;h=h===n?w:qs(qe(h),0,w);var $=h;return h-=c.length,h>=0&&a.slice(h,$)==c}function y8(a){return a=vt(a),a&&ef.test(a)?a.replace(Nc,a6):a}function w8(a){return a=vt(a),a&&Tg.test(a)?a.replace(Wa,"\\$&"):a}var x8=tl(function(a,c,h){return a+(h?"-":"")+c.toLowerCase()}),b8=tl(function(a,c,h){return a+(h?" ":"")+c.toLowerCase()}),S8=VS("toLowerCase");function _8(a,c,h){a=vt(a),c=qe(c);var w=c?Ya(a):0;if(!c||w>=c)return a;var $=(c-w)/2;return Df(Sf($),h)+a+Df(bf($),h)}function E8(a,c,h){a=vt(a),c=qe(c);var w=c?Ya(a):0;return c&&w<c?a+Df(c-w,h):a}function C8(a,c,h){a=vt(a),c=qe(c);var w=c?Ya(a):0;return c&&w<c?Df(c-w,h)+a:a}function $8(a,c,h){return h||c==null?c=0:c&&(c=+c),O6(vt(a).replace(Ic,""),c||0)}function R8(a,c,h){return(h?Nn(a,c,h):c===n)?c=1:c=qe(c),cv(vt(a),c)}function P8(){var a=arguments,c=vt(a[0]);return a.length<3?c:c.replace(a[1],a[2])}var T8=tl(function(a,c,h){return a+(h?"_":"")+c.toLowerCase()});function k8(a,c,h){return h&&typeof h!="number"&&Nn(a,c,h)&&(c=h=n),h=h===n?le:h>>>0,h?(a=vt(a),a&&(typeof c=="string"||c!=null&&!Mv(c))&&(c=ar(c),!c&&Ga(a))?Gi(ro(a),0,h):a.split(c,h)):[]}var A8=tl(function(a,c,h){return a+(h?" ":"")+Dv(c)});function M8(a,c,h){return a=vt(a),h=h==null?0:qs(qe(h),0,a.length),c=ar(c),a.slice(h,h+c.length)==c}function O8(a,c,h){var w=P.templateSettings;h&&Nn(a,c,h)&&(c=n),a=vt(a),c=Gf({},c,w,ZS);var $=Gf({},c.imports,w.imports,ZS),T=ln($),M=Kg($,T),D,B,oe=0,se=c.interpolate||sf,ce="__p += '",ve=Yg((c.escape||sf).source+"|"+se.source+"|"+(se===Va?of:sf).source+"|"+(c.evaluate||sf).source+"|$","g"),Pe="//# sourceURL="+(yt.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++UM+"]")+`
`;a.replace(ve,function(je,nt,at,cr,Dn,ur){return at||(at=cr),ce+=a.slice(oe,ur).replace(wM,l6),nt&&(D=!0,ce+=`' +
__e(`+nt+`) +
'`),Dn&&(B=!0,ce+=`';
`+Dn+`;
__p += '`),at&&(ce+=`' +
((__t = (`+at+`)) == null ? '' : __t) +
'`),oe=ur+je.length,je}),ce+=`';
`;var Fe=yt.call(c,"variable")&&c.variable;if(!Fe)ce=`with (obj) {
`+ce+`
}
`;else if(no.test(Fe))throw new Ge(l);ce=(B?ce.replace($g,""):ce).replace(qd,"$1").replace(Rg,"$1;"),ce="function("+(Fe||"obj")+`) {
`+(Fe?"":`obj || (obj = {});
`)+"var __t, __p = ''"+(D?", __e = _.escape":"")+(B?`, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
`:`;
`)+ce+`return __p
}`;var Qe=U_(function(){return pt(T,Pe+"return "+ce).apply(n,M)});if(Qe.source=ce,Av(Qe))throw Qe;return Qe}function N8(a){return vt(a).toLowerCase()}function D8(a){return vt(a).toUpperCase()}function I8(a,c,h){if(a=vt(a),a&&(h||c===n))return qb(a);if(!a||!(c=ar(c)))return a;var w=ro(a),$=ro(c),T=Qb(w,$),M=Jb(w,$)+1;return Gi(w,T,M).join("")}function L8(a,c,h){if(a=vt(a),a&&(h||c===n))return a.slice(0,tS(a)+1);if(!a||!(c=ar(c)))return a;var w=ro(a),$=Jb(w,ro(c))+1;return Gi(w,0,$).join("")}function F8(a,c,h){if(a=vt(a),a&&(h||c===n))return a.replace(Ic,"");if(!a||!(c=ar(c)))return a;var w=ro(a),$=Qb(w,ro(c));return Gi(w,$).join("")}function j8(a,c){var h=H,w=ie;if(Dt(c)){var $="separator"in c?c.separator:$;h="length"in c?qe(c.length):h,w="omission"in c?ar(c.omission):w}a=vt(a);var T=a.length;if(Ga(a)){var M=ro(a);T=M.length}if(h>=T)return a;var D=h-Ya(w);if(D<1)return w;var B=M?Gi(M,0,D).join(""):a.slice(0,D);if($===n)return B+w;if(M&&(D+=B.length-D),Mv($)){if(a.slice(D).search($)){var oe,se=B;for($.global||($=Yg($.source,vt(wb.exec($))+"g")),$.lastIndex=0;oe=$.exec(se);)var ce=oe.index;B=B.slice(0,ce===n?D:ce)}}else if(a.indexOf(ar($),D)!=D){var ve=B.lastIndexOf($);ve>-1&&(B=B.slice(0,ve))}return B+w}function B8(a){return a=vt(a),a&&Jd.test(a)?a.replace(Qd,m6):a}var z8=tl(function(a,c,h){return a+(h?" ":"")+c.toUpperCase()}),Dv=VS("toUpperCase");function z_(a,c,h){return a=vt(a),c=h?n:c,c===n?u6(a)?y6(a):t6(a):a.match(c)||[]}var U_=et(function(a,c){try{return ir(a,n,c)}catch(h){return Av(h)?h:new Ge(h)}}),U8=li(function(a,c){return Rr(c,function(h){h=ko(h),si(a,h,Tv(a[h],a))}),a});function V8(a){var c=a==null?0:a.length,h=Le();return a=c?Mt(a,function(w){if(typeof w[1]!="function")throw new Pr(s);return[h(w[0]),w[1]]}):[],et(function(w){for(var $=-1;++$<c;){var T=a[$];if(ir(T[0],this,w))return ir(T[1],this,w)}})}function W8(a){return m7(kr(a,p))}function Iv(a){return function(){return a}}function H8(a,c){return a==null||a!==a?c:a}var K8=HS(),G8=HS(!0);function Kn(a){return a}function Lv(a){return bS(typeof a=="function"?a:kr(a,p))}function Y8(a){return _S(kr(a,p))}function X8(a,c){return ES(a,kr(c,p))}var Z8=et(function(a,c){return function(h){return Hc(h,a,c)}}),q8=et(function(a,c){return function(h){return Hc(a,h,c)}});function Fv(a,c,h){var w=ln(c),$=Pf(c,w);h==null&&!(Dt(c)&&($.length||!w.length))&&(h=c,c=a,a=this,$=Pf(c,ln(c)));var T=!(Dt(h)&&"chain"in h)||!!h.chain,M=ui(a);return Rr($,function(D){var B=c[D];a[D]=B,M&&(a.prototype[D]=function(){var oe=this.__chain__;if(T||oe){var se=a(this.__wrapped__),ce=se.__actions__=Vn(this.__actions__);return ce.push({func:B,args:arguments,thisArg:a}),se.__chain__=oe,se}return B.apply(a,zi([this.value()],arguments))})}),a}function Q8(){return fn._===this&&(fn._=E6),this}function jv(){}function J8(a){return a=qe(a),et(function(c){return CS(c,a)})}var e9=gv(Mt),t9=gv(Kb),n9=gv(zg);function V_(a){return _v(a)?Ug(ko(a)):M7(a)}function r9(a){return function(c){return a==null?n:Qs(a,c)}}var o9=GS(),i9=GS(!0);function Bv(){return[]}function zv(){return!1}function s9(){return{}}function a9(){return""}function l9(){return!0}function c9(a,c){if(a=qe(a),a<1||a>G)return[];var h=le,w=bn(a,le);c=Le(c),a-=le;for(var $=Hg(w,c);++h<a;)c(h);return $}function u9(a){return Ye(a)?Mt(a,ko):lr(a)?[a]:Vn(c_(vt(a)))}function d9(a){var c=++S6;return vt(a)+c}var f9=Nf(function(a,c){return a+c},0),h9=vv("ceil"),p9=Nf(function(a,c){return a/c},1),m9=vv("floor");function g9(a){return a&&a.length?Rf(a,Kn,nv):n}function v9(a,c){return a&&a.length?Rf(a,Le(c,2),nv):n}function y9(a){return Xb(a,Kn)}function w9(a,c){return Xb(a,Le(c,2))}function x9(a){return a&&a.length?Rf(a,Kn,sv):n}function b9(a,c){return a&&a.length?Rf(a,Le(c,2),sv):n}var S9=Nf(function(a,c){return a*c},1),_9=vv("round"),E9=Nf(function(a,c){return a-c},0);function C9(a){return a&&a.length?Wg(a,Kn):0}function $9(a,c){return a&&a.length?Wg(a,Le(c,2)):0}return P.after=YN,P.ary=x_,P.assign=D4,P.assignIn=N_,P.assignInWith=Gf,P.assignWith=I4,P.at=L4,P.before=b_,P.bind=Tv,P.bindAll=U8,P.bindKey=S_,P.castArray=s4,P.chain=v_,P.chunk=mO,P.compact=gO,P.concat=vO,P.cond=V8,P.conforms=W8,P.constant=Iv,P.countBy=CN,P.create=F4,P.curry=__,P.curryRight=E_,P.debounce=C_,P.defaults=j4,P.defaultsDeep=B4,P.defer=XN,P.delay=ZN,P.difference=yO,P.differenceBy=wO,P.differenceWith=xO,P.drop=bO,P.dropRight=SO,P.dropRightWhile=_O,P.dropWhile=EO,P.fill=CO,P.filter=RN,P.flatMap=kN,P.flatMapDeep=AN,P.flatMapDepth=MN,P.flatten=h_,P.flattenDeep=$O,P.flattenDepth=RO,P.flip=qN,P.flow=K8,P.flowRight=G8,P.fromPairs=PO,P.functions=G4,P.functionsIn=Y4,P.groupBy=ON,P.initial=kO,P.intersection=AO,P.intersectionBy=MO,P.intersectionWith=OO,P.invert=Z4,P.invertBy=q4,P.invokeMap=DN,P.iteratee=Lv,P.keyBy=IN,P.keys=ln,P.keysIn=Hn,P.map=zf,P.mapKeys=J4,P.mapValues=e8,P.matches=Y8,P.matchesProperty=X8,P.memoize=Vf,P.merge=t8,P.mergeWith=D_,P.method=Z8,P.methodOf=q8,P.mixin=Fv,P.negate=Wf,P.nthArg=J8,P.omit=n8,P.omitBy=r8,P.once=QN,P.orderBy=LN,P.over=e9,P.overArgs=JN,P.overEvery=t9,P.overSome=n9,P.partial=kv,P.partialRight=$_,P.partition=FN,P.pick=o8,P.pickBy=I_,P.property=V_,P.propertyOf=r9,P.pull=LO,P.pullAll=m_,P.pullAllBy=FO,P.pullAllWith=jO,P.pullAt=BO,P.range=o9,P.rangeRight=i9,P.rearg=e4,P.reject=zN,P.remove=zO,P.rest=t4,P.reverse=Rv,P.sampleSize=VN,P.set=s8,P.setWith=a8,P.shuffle=WN,P.slice=UO,P.sortBy=GN,P.sortedUniq=XO,P.sortedUniqBy=ZO,P.split=k8,P.spread=n4,P.tail=qO,P.take=QO,P.takeRight=JO,P.takeRightWhile=eN,P.takeWhile=tN,P.tap=gN,P.throttle=r4,P.thru=Bf,P.toArray=A_,P.toPairs=L_,P.toPairsIn=F_,P.toPath=u9,P.toPlainObject=O_,P.transform=l8,P.unary=o4,P.union=nN,P.unionBy=rN,P.unionWith=oN,P.uniq=iN,P.uniqBy=sN,P.uniqWith=aN,P.unset=c8,P.unzip=Pv,P.unzipWith=g_,P.update=u8,P.updateWith=d8,P.values=ol,P.valuesIn=f8,P.without=lN,P.words=z_,P.wrap=i4,P.xor=cN,P.xorBy=uN,P.xorWith=dN,P.zip=fN,P.zipObject=hN,P.zipObjectDeep=pN,P.zipWith=mN,P.entries=L_,P.entriesIn=F_,P.extend=N_,P.extendWith=Gf,Fv(P,P),P.add=f9,P.attempt=U_,P.camelCase=g8,P.capitalize=j_,P.ceil=h9,P.clamp=h8,P.clone=a4,P.cloneDeep=c4,P.cloneDeepWith=u4,P.cloneWith=l4,P.conformsTo=d4,P.deburr=B_,P.defaultTo=H8,P.divide=p9,P.endsWith=v8,P.eq=io,P.escape=y8,P.escapeRegExp=w8,P.every=$N,P.find=PN,P.findIndex=d_,P.findKey=z4,P.findLast=TN,P.findLastIndex=f_,P.findLastKey=U4,P.floor=m9,P.forEach=y_,P.forEachRight=w_,P.forIn=V4,P.forInRight=W4,P.forOwn=H4,P.forOwnRight=K4,P.get=Ov,P.gt=f4,P.gte=h4,P.has=X4,P.hasIn=Nv,P.head=p_,P.identity=Kn,P.includes=NN,P.indexOf=TO,P.inRange=p8,P.invoke=Q4,P.isArguments=ta,P.isArray=Ye,P.isArrayBuffer=p4,P.isArrayLike=Wn,P.isArrayLikeObject=Ht,P.isBoolean=m4,P.isBuffer=Yi,P.isDate=g4,P.isElement=v4,P.isEmpty=y4,P.isEqual=w4,P.isEqualWith=x4,P.isError=Av,P.isFinite=b4,P.isFunction=ui,P.isInteger=R_,P.isLength=Hf,P.isMap=P_,P.isMatch=S4,P.isMatchWith=_4,P.isNaN=E4,P.isNative=C4,P.isNil=R4,P.isNull=$4,P.isNumber=T_,P.isObject=Dt,P.isObjectLike=Bt,P.isPlainObject=qc,P.isRegExp=Mv,P.isSafeInteger=P4,P.isSet=k_,P.isString=Kf,P.isSymbol=lr,P.isTypedArray=rl,P.isUndefined=T4,P.isWeakMap=k4,P.isWeakSet=A4,P.join=NO,P.kebabCase=x8,P.last=Mr,P.lastIndexOf=DO,P.lowerCase=b8,P.lowerFirst=S8,P.lt=M4,P.lte=O4,P.max=g9,P.maxBy=v9,P.mean=y9,P.meanBy=w9,P.min=x9,P.minBy=b9,P.stubArray=Bv,P.stubFalse=zv,P.stubObject=s9,P.stubString=a9,P.stubTrue=l9,P.multiply=S9,P.nth=IO,P.noConflict=Q8,P.noop=jv,P.now=Uf,P.pad=_8,P.padEnd=E8,P.padStart=C8,P.parseInt=$8,P.random=m8,P.reduce=jN,P.reduceRight=BN,P.repeat=R8,P.replace=P8,P.result=i8,P.round=_9,P.runInContext=F,P.sample=UN,P.size=HN,P.snakeCase=T8,P.some=KN,P.sortedIndex=VO,P.sortedIndexBy=WO,P.sortedIndexOf=HO,P.sortedLastIndex=KO,P.sortedLastIndexBy=GO,P.sortedLastIndexOf=YO,P.startCase=A8,P.startsWith=M8,P.subtract=E9,P.sum=C9,P.sumBy=$9,P.template=O8,P.times=c9,P.toFinite=di,P.toInteger=qe,P.toLength=M_,P.toLower=N8,P.toNumber=Or,P.toSafeInteger=N4,P.toString=vt,P.toUpper=D8,P.trim=I8,P.trimEnd=L8,P.trimStart=F8,P.truncate=j8,P.unescape=B8,P.uniqueId=d9,P.upperCase=z8,P.upperFirst=Dv,P.each=y_,P.eachRight=w_,P.first=p_,Fv(P,function(){var a={};return Po(P,function(c,h){yt.call(P.prototype,h)||(a[h]=c)}),a}(),{chain:!1}),P.VERSION=r,Rr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(a){P[a].placeholder=P}),Rr(["drop","take"],function(a,c){ot.prototype[a]=function(h){h=h===n?1:tn(qe(h),0);var w=this.__filtered__&&!c?new ot(this):this.clone();return w.__filtered__?w.__takeCount__=bn(h,w.__takeCount__):w.__views__.push({size:bn(h,le),type:a+(w.__dir__<0?"Right":"")}),w},ot.prototype[a+"Right"]=function(h){return this.reverse()[a](h).reverse()}}),Rr(["filter","map","takeWhile"],function(a,c){var h=c+1,w=h==U||h==V;ot.prototype[a]=function($){var T=this.clone();return T.__iteratees__.push({iteratee:Le($,3),type:h}),T.__filtered__=T.__filtered__||w,T}}),Rr(["head","last"],function(a,c){var h="take"+(c?"Right":"");ot.prototype[a]=function(){return this[h](1).value()[0]}}),Rr(["initial","tail"],function(a,c){var h="drop"+(c?"":"Right");ot.prototype[a]=function(){return this.__filtered__?new ot(this):this[h](1)}}),ot.prototype.compact=function(){return this.filter(Kn)},ot.prototype.find=function(a){return this.filter(a).head()},ot.prototype.findLast=function(a){return this.reverse().find(a)},ot.prototype.invokeMap=et(function(a,c){return typeof a=="function"?new ot(this):this.map(function(h){return Hc(h,a,c)})}),ot.prototype.reject=function(a){return this.filter(Wf(Le(a)))},ot.prototype.slice=function(a,c){a=qe(a);var h=this;return h.__filtered__&&(a>0||c<0)?new ot(h):(a<0?h=h.takeRight(-a):a&&(h=h.drop(a)),c!==n&&(c=qe(c),h=c<0?h.dropRight(-c):h.take(c-a)),h)},ot.prototype.takeRightWhile=function(a){return this.reverse().takeWhile(a).reverse()},ot.prototype.toArray=function(){return this.take(le)},Po(ot.prototype,function(a,c){var h=/^(?:filter|find|map|reject)|While$/.test(c),w=/^(?:head|last)$/.test(c),$=P[w?"take"+(c=="last"?"Right":""):c],T=w||/^find/.test(c);$&&(P.prototype[c]=function(){var M=this.__wrapped__,D=w?[1]:arguments,B=M instanceof ot,oe=D[0],se=B||Ye(M),ce=function(nt){var at=$.apply(P,zi([nt],D));return w&&ve?at[0]:at};se&&h&&typeof oe=="function"&&oe.length!=1&&(B=se=!1);var ve=this.__chain__,Pe=!!this.__actions__.length,Fe=T&&!ve,Qe=B&&!Pe;if(!T&&se){M=Qe?M:new ot(this);var je=a.apply(M,D);return je.__actions__.push({func:Bf,args:[ce],thisArg:n}),new Tr(je,ve)}return Fe&&Qe?a.apply(this,D):(je=this.thru(ce),Fe?w?je.value()[0]:je.value():je)})}),Rr(["pop","push","shift","sort","splice","unshift"],function(a){var c=ff[a],h=/^(?:push|sort|unshift)$/.test(a)?"tap":"thru",w=/^(?:pop|shift)$/.test(a);P.prototype[a]=function(){var $=arguments;if(w&&!this.__chain__){var T=this.value();return c.apply(Ye(T)?T:[],$)}return this[h](function(M){return c.apply(Ye(M)?M:[],$)})}}),Po(ot.prototype,function(a,c){var h=P[c];if(h){var w=h.name+"";yt.call(Qa,w)||(Qa[w]=[]),Qa[w].push({name:c,func:h})}}),Qa[Of(n,_).name]=[{name:"wrapper",func:n}],ot.prototype.clone=B6,ot.prototype.reverse=z6,ot.prototype.value=U6,P.prototype.at=vN,P.prototype.chain=yN,P.prototype.commit=wN,P.prototype.next=xN,P.prototype.plant=SN,P.prototype.reverse=_N,P.prototype.toJSON=P.prototype.valueOf=P.prototype.value=EN,P.prototype.first=P.prototype.head,Fc&&(P.prototype[Fc]=bN),P},Xa=w6();Gs?((Gs.exports=Xa)._=Xa,Lg._=Xa):fn._=Xa}).call(Qc)})(Vp,Vp.exports);var wH=Vp.exports;const xH=pm(wH);function Gr({width:e,height:t}){return e/t}function Wp(e,t=0){const n=10**t;return Math.round((e+Number.EPSILON)*n)/n}function bH(e){return(t,n)=>e(n)-e(t)}class SH{constructor(t){this.comparator=t,this.heap=[],this.n=0}greater(t,n){return this.comparator(this.heap[t],this.heap[n])<0}swap(t,n){const r=this.heap[t];this.heap[t]=this.heap[n],this.heap[n]=r}swim(t){let n=t,r=Math.floor(n/2);for(;n>1&&this.greater(r,n);)this.swap(r,n),n=r,r=Math.floor(n/2)}sink(t){let n=t,r=n*2;for(;r<=this.n&&(r<this.n&&this.greater(r,r+1)&&(r+=1),!!this.greater(n,r));)this.swap(n,r),n=r,r=n*2}push(t){this.n+=1,this.heap[this.n]=t,this.swim(this.n)}pop(){if(this.n===0)return;this.swap(1,this.n),this.n-=1;const t=this.heap.pop();return this.sink(1),t}size(){return this.n}}function _H(e,t,n){const r=new Map,o=new Set,i=new Map;i.set(t,0);const s=new SH(bH(l=>l.weight));for(s.push({id:t,weight:0});s.size()>0;){const{id:l,weight:u}=s.pop();if(!o.has(l)){const f=e(l);o.add(l),f.forEach((m,p)=>{const g=u+m,y=r.get(p),x=i.get(p);(x===void 0||x>g&&(x/g>1.005||y!==void 0&&y<l))&&(i.set(p,g),s.push({id:p,weight:g}),r.set(p,l))})}}return i.has(n)?r:void 0}function EH(e,t){const n=[];for(let r=t;r!==void 0;r=e.get(r))n.push(r);return n.reverse()}function CH(e,t,n){const r=_H(e,t,n);return r?EH(r,n):void 0}function $H({photos:e,targetRowHeight:t,containerWidth:n}){const r=e.reduce((o,i)=>Math.min(Gr(i),o),Number.MAX_VALUE);return Wp(n/t/r)+2}function zT(e,t,n,r){const o=t-(e.length-1)*n-2*r*e.length,i=e.reduce((s,l)=>s+Gr(l),0);return o/i}function RH(e,t,n,r,o,i,s){const l=e.slice(t,n),u=zT(l,r,i,s);return u>0?(u-o)**2*l.length:void 0}function PH({photos:e,layoutOptions:t,targetRowHeight:n,limitNodeSearch:r,rowConstraints:o}){return i=>{var s,l;const{containerWidth:u,spacing:f,padding:m}=t,p=new Map;p.set(i,0);const g=(s=o==null?void 0:o.minPhotos)!=null?s:1,y=Math.min(r,(l=o==null?void 0:o.maxPhotos)!=null?l:1/0);for(let x=i+g;x<e.length+1&&!(x-i>y);x+=1){const S=RH(e,i,x,u,n,f,m);if(S===void 0)break;p.set(x,S)}return p}}function TH({photos:e,layoutOptions:t}){const{spacing:n,padding:r,containerWidth:o,targetRowHeight:i,rowConstraints:s}=t,l=$H({photos:e,containerWidth:o,targetRowHeight:i}),u=PH({photos:e,layoutOptions:t,targetRowHeight:i,limitNodeSearch:l,rowConstraints:s}),f=CH(u,0,e.length);if(f===void 0)return;const m=[];for(let p=1;p<f.length;p+=1){const g=e.map((x,S)=>({photo:x,index:S})).slice(f[p-1],f[p]),y=zT(g.map(({photo:x})=>x),o,n,r);m.push(g.map(({photo:x,index:S},E)=>({photo:x,layout:{height:y,width:y*Gr(x),index:S,photoIndex:E,photosCount:g.length}})))}return m}function ig(...e){return[...e].filter(t=>!!t).join(" ")}function UT(e,{width:t,photosCount:n},{spacing:r,padding:o,containerWidth:i}){const s=r*(n-1)+2*o*n;return`calc((${e} - ${s}px) / ${Wp((i-s)/t,5)})`}function kH(e,t){return t.layout!=="rows"?`calc(100% - ${2*t.padding}px)`:UT("100%",e,t)}function f2(e,t,n){var r,o;return UT((o=(r=e.match(/calc\((.*)\)/))==null?void 0:r[1])!=null?o:e,t,n)}function AH(e,t,n){let r,o;const i=e.srcSet||e.images;return i&&i.length>0&&(r=i.concat(i.find(({width:s})=>s===e.width)?[]:[{src:e.src,width:e.width,height:e.height}]).sort((s,l)=>s.width-l.width).map(s=>`${s.src} ${s.width}w`).join(", ")),n.sizes?o=(n.sizes.sizes||[]).map(({viewport:s,size:l})=>`${s} ${f2(l,t,n)}`).concat(f2(n.sizes.size,t,n)).join(", "):r&&(o=`${Math.ceil(t.width/n.containerWidth*100)}vw`),{srcSet:r,sizes:o}}function Bx(e){var t,n;const{photo:r,layout:o,layoutOptions:i,imageProps:{style:s,className:l,...u}={},renderPhoto:f}=e,{onClick:m}=i,p={display:"block",boxSizing:"content-box",width:kH(o,i),height:"auto",aspectRatio:`${r.width} / ${r.height}`,...i.padding?{padding:`${i.padding}px`}:null,...(i.layout==="columns"||i.layout==="masonry")&&o.photoIndex<o.photosCount-1?{marginBottom:`${i.spacing}px`}:null,...m?{cursor:"pointer"}:null,...s},g=m?E=>{m({event:E,photo:r,index:o.index})}:void 0,y={src:r.src,alt:(t=r.alt)!=null?t:"",title:r.title,onClick:g,style:p,className:ig("react-photo-album--photo",l),loading:"lazy",decoding:"async",...AH(r,o,i),...u},x=E=>{const{src:_,alt:b,srcSet:C,sizes:R,style:k,...O}=y;return d.createElement("img",{alt:b,...C?{srcSet:C,sizes:R}:null,src:_,style:E!=null&&E.wrapped?{display:"block",width:"100%",height:"100%"}:k,...O})},S=(({display:E,boxSizing:_,width:b,aspectRatio:C,padding:R,marginBottom:k,cursor:O})=>({display:E,boxSizing:_,width:b,aspectRatio:C,padding:R,marginBottom:k,cursor:O}))(p);return d.createElement(d.Fragment,null,(n=f==null?void 0:f({photo:r,layout:o,layoutOptions:i,imageProps:y,renderDefaultPhoto:x,wrapperStyle:S}))!=null?n:x())}function MH({rowContainerProps:e,children:t}){return d.createElement("div",{...e},t)}function OH(e){const{layoutOptions:t,rowIndex:n,rowsCount:r,renderRowContainer:o,rowContainerProps:{style:i,className:s,...l}={},children:u}=e,f={className:ig("react-photo-album--row",s),style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"flex-start",justifyContent:"space-between",...n<r-1?{marginBottom:`${t.spacing}px`}:null,...i},...l};return d.createElement(d.Fragment,null,(o??MH)({layoutOptions:t,rowIndex:n,rowsCount:r,rowContainerProps:f,children:u}))}function NH(e){const{photos:t,layoutOptions:n,renderPhoto:r,renderRowContainer:o,componentsProps:{imageProps:i,rowContainerProps:s}}=e,l=TH({photos:t,layoutOptions:n});return l?d.createElement(d.Fragment,null,l.map((u,f)=>d.createElement(OH,{key:`row-${f}`,layoutOptions:n,rowIndex:f,rowsCount:l.length,renderRowContainer:o,rowContainerProps:s},u.map(({photo:m,layout:p})=>d.createElement(Bx,{key:m.key||m.src,photo:m,layout:p,layoutOptions:n,renderPhoto:r,imageProps:i}))))):null}function DH(e,t,n,r){const o=new Map,i=new Set;i.add(n);for(let s=0;s<t;s+=1){const l=[...i.keys()];i.clear(),l.forEach(u=>{const f=s>0?o.get(u)[s].weight:0;e(u).forEach(({neighbor:m,weight:p})=>{let g=o.get(m);g||(g=[],o.set(m,g));const y=f+p,x=g[s+1];(!x||x.weight>y&&(x.weight/y>1.0001||u<x.node))&&(g[s+1]={node:u,weight:y}),s<t-1&&m!==r&&i.add(m)})})}return o}function IH(e,t,n){const r=[n];for(let o=n,i=t;i>0;i-=1)o=e.get(o)[i].node,r.push(o);return r.reverse()}function LH(e,t,n,r){return IH(DH(e,t,n,r),t,r)}function FH({photos:e,spacing:t,padding:n,targetColumnWidth:r,targetColumnHeight:o}){return i=>{const s=[],l=o*1.5;let u=r/Gr(e[i])+2*n;for(let f=i+1;f<e.length+1&&(s.push({neighbor:f,weight:(o-u)**2}),!(u>l||f===e.length));f+=1)u+=r/Gr(e[f])+t+2*n;return s}}function h2({path:e,photos:t,containerWidth:n,columnsGaps:r,columnsRatios:o,spacing:i,padding:s}){const l=[],u=o.reduce((f,m)=>f+m,0);for(let f=0;f<e.length-1;f+=1){const m=t.map((y,x)=>({photo:y,index:x})).slice(e[f],e[f+1]),p=o.reduce((y,x,S)=>y+(r[f]-r[S])*x,0),g=(n-(e.length-2)*i-2*(e.length-1)*s-p)*o[f]/u;l.push(m.map(({photo:y,index:x},S)=>({photo:y,layout:{width:g,height:g/Gr(y),index:x,photoIndex:S,photosCount:m.length}})))}return l}function jH({photos:e,layoutOptions:t,targetColumnWidth:n}){const{columns:r,spacing:o,padding:i,containerWidth:s}=t,l=[],u=[];if(e.length<=r){const y=e.length>0?e.reduce((S,E)=>S+Gr(E),0)/e.length:1;for(let S=0;S<r;S+=1)l[S]=2*i,u[S]=S<e.length?Gr(e[S]):y;const x=h2({path:Array.from({length:r+1}).map((S,E)=>Math.min(E,e.length)),photos:e,columnsRatios:u,columnsGaps:l,containerWidth:s,spacing:o,padding:i});return{columnsGaps:l,columnsRatios:u,columnsModel:x}}const f=(e.reduce((y,x)=>y+n/Gr(x),0)+o*(e.length-r)+2*i*e.length)/r,m=FH({photos:e,targetColumnWidth:n,targetColumnHeight:f,spacing:o,padding:i}),p=LH(m,r,0,e.length);for(let y=0;y<p.length-1;y+=1){const x=e.slice(p[y],p[y+1]);l[y]=o*(x.length-1)+2*i*x.length,u[y]=1/x.reduce((S,E)=>S+1/Gr(E),0)}const g=h2({path:p,photos:e,columnsRatios:u,columnsGaps:l,containerWidth:s,spacing:o,padding:i});return{columnsGaps:l,columnsRatios:u,columnsModel:g}}function VT(e){const{photos:t,layoutOptions:n}=e,{columns:r,spacing:o,padding:i,containerWidth:s}=n,l=(s-o*(r-1)-2*i*r)/r,{columnsGaps:u,columnsRatios:f,columnsModel:m}=jH({photos:t,layoutOptions:n,targetColumnWidth:l});return m.findIndex(p=>p.findIndex(({layout:{width:g,height:y}})=>g<0||y<0)>=0)>=0?r>1?VT({photos:t,layoutOptions:{...n,columns:r-1}}):void 0:{columnsModel:m,columnsGaps:u,columnsRatios:f}}function BH({photos:e,layoutOptions:t}){return VT({photos:e,layoutOptions:t})}function zH({columnContainerProps:e,children:t}){return d.createElement("div",{...e},t)}function UH(e){const{layoutOptions:t,columnIndex:n,columnsCount:r,columnsGaps:o,columnsRatios:i}=e,{layout:s,spacing:l,padding:u}=t;if(s==="masonry"||!o||!i)return`calc((100% - ${l*(r-1)}px) / ${r})`;const f=i.reduce((p,g)=>p+g,0),m=i.reduce((p,g,y)=>p+(o[n]-o[y])*g,0);return`calc((100% - ${Wp((r-1)*l+2*r*u+m,3)}px) * ${Wp(i[n]/f,5)} + ${2*u}px)`}function WT(e){const{layoutOptions:t,renderColumnContainer:n,children:r,columnContainerProps:{style:o,className:i,...s}={},...l}=e,u={className:ig("react-photo-album--column",i),style:{display:"flex",flexDirection:"column",flexWrap:"nowrap",alignItems:"flex-start",width:UH(e),justifyContent:t.layout==="columns"?"space-between":"flex-start",...o},...s};return d.createElement(d.Fragment,null,(n??zH)({layoutOptions:t,columnContainerProps:u,children:r,...l}))}function VH(e){const{photos:t,layoutOptions:n,renderPhoto:r,renderColumnContainer:o,componentsProps:{imageProps:i,columnContainerProps:s}}=e,l=BH({photos:t,layoutOptions:n});if(!l)return null;const{columnsModel:u,columnsRatios:f,columnsGaps:m}=l;return d.createElement(d.Fragment,null,u.map((p,g)=>d.createElement(WT,{key:`column-${g}`,layoutOptions:n,columnIndex:g,columnsCount:u.length,columnsGaps:m,columnsRatios:f,renderColumnContainer:o,columnContainerProps:s},p.map(({photo:y,layout:x})=>d.createElement(Bx,{key:y.key||y.src,photo:y,layout:x,layoutOptions:n,renderPhoto:r,imageProps:i})))))}function HT(e){const{photos:t,layoutOptions:n}=e,{columns:r,spacing:o,padding:i,containerWidth:s}=n,l=(s-o*(r-1)-2*i*r)/r;if(l<=0)return r>1?HT({...e,layoutOptions:{...n,columns:r-1}}):void 0;const u=[];for(let m=0;m<r;m+=1)u[m]=0;return t.reduce((m,p,g)=>{const y=u.reduce((x,S,E)=>S<u[x]-1?E:x,0);return u[y]=u[y]+l/Gr(p)+o+2*i,m[y].push({photo:p,index:g}),m},Array.from({length:r}).map(()=>[])).map(m=>m.map(({photo:p,index:g},y)=>({photo:p,layout:{width:l,height:l/Gr(p),index:g,photoIndex:y,photosCount:m.length}})))}function WH(e){const{photos:t,layoutOptions:n,renderPhoto:r,renderColumnContainer:o,componentsProps:{imageProps:i,columnContainerProps:s}}=e,l=HT({photos:t,layoutOptions:n});return l?d.createElement(d.Fragment,null,l.map((u,f)=>d.createElement(WT,{key:`masonry-column-${f}`,layoutOptions:n,columnsCount:l.length,columnIndex:f,renderColumnContainer:o,columnContainerProps:s},u.map(({photo:m,layout:p})=>d.createElement(Bx,{key:m.key||m.src,photo:m,layout:p,layoutOptions:n,renderPhoto:r,imageProps:i}))))):null}function HH({containerProps:e,children:t,containerRef:n}){return d.createElement("div",{ref:n,...e},t)}function KH(e){const{layout:t,renderContainer:n,children:r,containerRef:o,containerProps:{style:i,className:s,...l}={}}=e,u={className:ig("react-photo-album",`react-photo-album--${t}`,s),style:{display:"flex",flexWrap:"nowrap",justifyContent:"space-between",flexDirection:t==="rows"?"column":"row",...i},...l};return d.createElement(d.Fragment,null,(n??HH)({containerProps:u,containerRef:o,layout:t,children:r}))}function GH(e){const t=d.useRef(e);return(!e||!t.current||e.join()!==t.current.join())&&(t.current=e),t.current}function YH(e,{newContainerWidth:t,newScrollbarWidth:n}){const{containerWidth:r,scrollbarWidth:o}=e;return r!==void 0&&o!==void 0&&t!==void 0&&n!==void 0&&t>r&&t-r<=20&&n<o?{containerWidth:r,scrollbarWidth:n}:r!==t||o!==n?{containerWidth:t,scrollbarWidth:n}:e}function XH(e,t){let n=e==null?void 0:e.clientWidth;if(n!==void 0&&t&&t.length>0){const r=[...t.filter(i=>i>0)].sort((i,s)=>s-i);r.push(Math.floor(r[r.length-1]/2));const o=n;n=r.find((i,s)=>i<=o||s===r.length-1)}return n}function ZH(e,t){const[{containerWidth:n},r]=d.useReducer(YH,{containerWidth:t}),o=d.useRef(null),i=d.useRef();return{containerRef:d.useCallback(l=>{var u;(u=i.current)==null||u.disconnect(),i.current=void 0,o.current=l;const f=()=>r({newContainerWidth:XH(o.current,e),newScrollbarWidth:window.innerWidth-document.documentElement.clientWidth});f(),l&&typeof ResizeObserver<"u"&&(i.current=new ResizeObserver(f),i.current.observe(l))},[e]),containerWidth:n}}const qH=Object.freeze([1200,600,300,0]);function zx(e,t){return typeof e=="function"?e(t):e}function KT(e,t){return typeof e<"u"?zx(e,t):void 0}function QH(e,t){const n=qH.findIndex(r=>r<=t);return zx(e[n>=0?n:0],t)}function Sh(e,t,n,r=0){const o=KT(e,t);return Math.round(Math.max(o===void 0?QH(n,t):o,r))}function JH({layout:e,onClick:t,containerWidth:n,targetRowHeight:r,rowConstraints:o,columns:i,spacing:s,padding:l,sizes:u}){return{layout:e,onClick:t,containerWidth:n,columns:Sh(i,n,[5,4,3,2],1),spacing:Sh(s,n,[20,15,10,5]),padding:Sh(l,n,[0,0,0,0,0]),targetRowHeight:Sh(r,n,[f=>f/5,f=>f/4,f=>f/3,f=>f/2]),rowConstraints:KT(o,n),sizes:u}}function eK(e,t,n){const{photos:r,componentsProps:o}=e,i=zx(o,t)||{};if(n){const{layout:s,spacing:l,padding:u,rowConstraints:f}=n;if(s==="rows"){const{singleRowMaxHeight:m}=f||{};if(m){const p=Math.floor(r.reduce((g,{width:y,height:x})=>g+y/x*m-2*u,u*r.length*2+l*(r.length-1)));p>0&&(i.containerProps=i.containerProps||{},i.containerProps.style={maxWidth:p,...i.containerProps.style})}}}return i}function tK(e,t,n){const{photos:r,layout:o,renderPhoto:i,renderRowContainer:s,renderColumnContainer:l}=e,u={photos:r,renderPhoto:i,componentsProps:t};return o==="rows"?d.createElement(NH,{layoutOptions:n,renderRowContainer:s,...u}):o==="columns"?d.createElement(VH,{layoutOptions:n,renderColumnContainer:l,...u}):d.createElement(WH,{layoutOptions:n,renderColumnContainer:l,...u})}function nK(e){const{photos:t,layout:n,renderContainer:r,defaultContainerWidth:o,breakpoints:i}=e,{containerRef:s,containerWidth:l}=ZH(GH(i),o);if(!n||!["rows","columns","masonry"].includes(n)||!Array.isArray(t))return null;const u=l?JH({containerWidth:l,...e}):void 0,f=eK(e,l,u);return d.createElement(KH,{layout:n,containerRef:s,renderContainer:r,containerProps:f.containerProps},u&&tK(e,f,u))}function rK({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25"}))}const oK=d.forwardRef(rK),iK=oK;function sK({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 4.5h14.25M3 9h9.75M3 13.5h5.25m5.25-.75L17.25 9m0 0L21 12.75M17.25 9v12"}))}const aK=d.forwardRef(sK),lK=aK;function cK({title:e,titleId:t,...n},r){return d.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?d.createElement("title",{id:t},e):null,d.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.042 21.672L13.684 16.6m0 0l-2.51 2.225.569-9.47 5.227 7.917-3.286-.672zM12 2.25V4.5m5.834.166l-1.591 1.591M20.25 10.5H18M7.757 14.743l-1.59 1.59M6 10.5H3.75m4.007-4.243l-1.59-1.59"}))}const uK=d.forwardRef(cK),dK=uK;function ki(e){return Array.isArray?Array.isArray(e):XT(e)==="[object Array]"}const fK=1/0;function hK(e){if(typeof e=="string")return e;let t=e+"";return t=="0"&&1/e==-fK?"-0":t}function pK(e){return e==null?"":hK(e)}function Ho(e){return typeof e=="string"}function GT(e){return typeof e=="number"}function mK(e){return e===!0||e===!1||gK(e)&&XT(e)=="[object Boolean]"}function YT(e){return typeof e=="object"}function gK(e){return YT(e)&&e!==null}function mr(e){return e!=null}function L0(e){return!e.trim().length}function XT(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const vK="Incorrect 'index' type",yK=e=>`Invalid value for key ${e}`,wK=e=>`Pattern length exceeds max of ${e}.`,xK=e=>`Missing ${e} property in key`,bK=e=>`Property 'weight' in key '${e}' must be a positive integer`,p2=Object.prototype.hasOwnProperty;class SK{constructor(t){this._keys=[],this._keyMap={};let n=0;t.forEach(r=>{let o=ZT(r);this._keys.push(o),this._keyMap[o.id]=o,n+=o.weight}),this._keys.forEach(r=>{r.weight/=n})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function ZT(e){let t=null,n=null,r=null,o=1,i=null;if(Ho(e)||ki(e))r=e,t=m2(e),n=x1(e);else{if(!p2.call(e,"name"))throw new Error(xK("name"));const s=e.name;if(r=s,p2.call(e,"weight")&&(o=e.weight,o<=0))throw new Error(bK(s));t=m2(s),n=x1(s),i=e.getFn}return{path:t,id:n,weight:o,src:r,getFn:i}}function m2(e){return ki(e)?e:e.split(".")}function x1(e){return ki(e)?e.join("."):e}function _K(e,t){let n=[],r=!1;const o=(i,s,l)=>{if(mr(i))if(!s[l])n.push(i);else{let u=s[l];const f=i[u];if(!mr(f))return;if(l===s.length-1&&(Ho(f)||GT(f)||mK(f)))n.push(pK(f));else if(ki(f)){r=!0;for(let m=0,p=f.length;m<p;m+=1)o(f[m],s,l+1)}else s.length&&o(f,s,l+1)}};return o(e,Ho(t)?t.split("."):t,0),r?n:n[0]}const EK={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},CK={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},$K={location:0,threshold:.6,distance:100},RK={useExtendedSearch:!1,getFn:_K,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var He={...CK,...EK,...$K,...RK};const PK=/[^ ]+/g;function TK(e=1,t=3){const n=new Map,r=Math.pow(10,t);return{get(o){const i=o.match(PK).length;if(n.has(i))return n.get(i);const s=1/Math.pow(i,.5*e),l=parseFloat(Math.round(s*r)/r);return n.set(i,l),l},clear(){n.clear()}}}class Ux{constructor({getFn:t=He.getFn,fieldNormWeight:n=He.fieldNormWeight}={}){this.norm=TK(n,3),this.getFn=t,this.isCreated=!1,this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t,this._keysMap={},t.forEach((n,r)=>{this._keysMap[n.id]=r})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Ho(this.docs[0])?this.docs.forEach((t,n)=>{this._addString(t,n)}):this.docs.forEach((t,n)=>{this._addObject(t,n)}),this.norm.clear())}add(t){const n=this.size();Ho(t)?this._addString(t,n):this._addObject(t,n)}removeAt(t){this.records.splice(t,1);for(let n=t,r=this.size();n<r;n+=1)this.records[n].i-=1}getValueForItemAtKeyId(t,n){return t[this._keysMap[n]]}size(){return this.records.length}_addString(t,n){if(!mr(t)||L0(t))return;let r={v:t,i:n,n:this.norm.get(t)};this.records.push(r)}_addObject(t,n){let r={i:n,$:{}};this.keys.forEach((o,i)=>{let s=o.getFn?o.getFn(t):this.getFn(t,o.path);if(mr(s)){if(ki(s)){let l=[];const u=[{nestedArrIndex:-1,value:s}];for(;u.length;){const{nestedArrIndex:f,value:m}=u.pop();if(mr(m))if(Ho(m)&&!L0(m)){let p={v:m,i:f,n:this.norm.get(m)};l.push(p)}else ki(m)&&m.forEach((p,g)=>{u.push({nestedArrIndex:g,value:p})})}r.$[i]=l}else if(Ho(s)&&!L0(s)){let l={v:s,n:this.norm.get(s)};r.$[i]=l}}}),this.records.push(r)}toJSON(){return{keys:this.keys,records:this.records}}}function qT(e,t,{getFn:n=He.getFn,fieldNormWeight:r=He.fieldNormWeight}={}){const o=new Ux({getFn:n,fieldNormWeight:r});return o.setKeys(e.map(ZT)),o.setSources(t),o.create(),o}function kK(e,{getFn:t=He.getFn,fieldNormWeight:n=He.fieldNormWeight}={}){const{keys:r,records:o}=e,i=new Ux({getFn:t,fieldNormWeight:n});return i.setKeys(r),i.setIndexRecords(o),i}function _h(e,{errors:t=0,currentLocation:n=0,expectedLocation:r=0,distance:o=He.distance,ignoreLocation:i=He.ignoreLocation}={}){const s=t/e.length;if(i)return s;const l=Math.abs(r-n);return o?s+l/o:l?1:s}function AK(e=[],t=He.minMatchCharLength){let n=[],r=-1,o=-1,i=0;for(let s=e.length;i<s;i+=1){let l=e[i];l&&r===-1?r=i:!l&&r!==-1&&(o=i-1,o-r+1>=t&&n.push([r,o]),r=-1)}return e[i-1]&&i-r>=t&&n.push([r,i-1]),n}const ua=32;function MK(e,t,n,{location:r=He.location,distance:o=He.distance,threshold:i=He.threshold,findAllMatches:s=He.findAllMatches,minMatchCharLength:l=He.minMatchCharLength,includeMatches:u=He.includeMatches,ignoreLocation:f=He.ignoreLocation}={}){if(t.length>ua)throw new Error(wK(ua));const m=t.length,p=e.length,g=Math.max(0,Math.min(r,p));let y=i,x=g;const S=l>1||u,E=S?Array(p):[];let _;for(;(_=e.indexOf(t,x))>-1;){let A=_h(t,{currentLocation:_,expectedLocation:g,distance:o,ignoreLocation:f});if(y=Math.min(A,y),x=_+m,S){let I=0;for(;I<m;)E[_+I]=1,I+=1}}x=-1;let b=[],C=1,R=m+p;const k=1<<m-1;for(let A=0;A<m;A+=1){let I=0,z=R;for(;I<z;)_h(t,{errors:A,currentLocation:g+z,expectedLocation:g,distance:o,ignoreLocation:f})<=y?I=z:R=z,z=Math.floor((R-I)/2+I);R=z;let H=Math.max(1,g-z+1),ie=s?p:Math.min(g+z,p)+m,K=Array(ie+2);K[ie+1]=(1<<A)-1;for(let U=ie;U>=H;U-=1){let re=U-1,V=n[e.charAt(re)];if(S&&(E[re]=+!!V),K[U]=(K[U+1]<<1|1)&V,A&&(K[U]|=(b[U+1]|b[U])<<1|1|b[U+1]),K[U]&k&&(C=_h(t,{errors:A,currentLocation:re,expectedLocation:g,distance:o,ignoreLocation:f}),C<=y)){if(y=C,x=re,x<=g)break;H=Math.max(1,2*g-x)}}if(_h(t,{errors:A+1,currentLocation:g,expectedLocation:g,distance:o,ignoreLocation:f})>y)break;b=K}const O={isMatch:x>=0,score:Math.max(.001,C)};if(S){const A=AK(E,l);A.length?u&&(O.indices=A):O.isMatch=!1}return O}function OK(e){let t={};for(let n=0,r=e.length;n<r;n+=1){const o=e.charAt(n);t[o]=(t[o]||0)|1<<r-n-1}return t}class QT{constructor(t,{location:n=He.location,threshold:r=He.threshold,distance:o=He.distance,includeMatches:i=He.includeMatches,findAllMatches:s=He.findAllMatches,minMatchCharLength:l=He.minMatchCharLength,isCaseSensitive:u=He.isCaseSensitive,ignoreLocation:f=He.ignoreLocation}={}){if(this.options={location:n,threshold:r,distance:o,includeMatches:i,findAllMatches:s,minMatchCharLength:l,isCaseSensitive:u,ignoreLocation:f},this.pattern=u?t:t.toLowerCase(),this.chunks=[],!this.pattern.length)return;const m=(g,y)=>{this.chunks.push({pattern:g,alphabet:OK(g),startIndex:y})},p=this.pattern.length;if(p>ua){let g=0;const y=p%ua,x=p-y;for(;g<x;)m(this.pattern.substr(g,ua),g),g+=ua;if(y){const S=p-ua;m(this.pattern.substr(S),S)}}else m(this.pattern,0)}searchIn(t){const{isCaseSensitive:n,includeMatches:r}=this.options;if(n||(t=t.toLowerCase()),this.pattern===t){let x={isMatch:!0,score:0};return r&&(x.indices=[[0,t.length-1]]),x}const{location:o,distance:i,threshold:s,findAllMatches:l,minMatchCharLength:u,ignoreLocation:f}=this.options;let m=[],p=0,g=!1;this.chunks.forEach(({pattern:x,alphabet:S,startIndex:E})=>{const{isMatch:_,score:b,indices:C}=MK(t,x,S,{location:o+E,distance:i,threshold:s,findAllMatches:l,minMatchCharLength:u,includeMatches:r,ignoreLocation:f});_&&(g=!0),p+=b,_&&C&&(m=[...m,...C])});let y={isMatch:g,score:g?p/this.chunks.length:1};return g&&r&&(y.indices=m),y}}class Us{constructor(t){this.pattern=t}static isMultiMatch(t){return g2(t,this.multiRegex)}static isSingleMatch(t){return g2(t,this.singleRegex)}search(){}}function g2(e,t){const n=e.match(t);return n?n[1]:null}class NK extends Us{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const n=t===this.pattern;return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class DK extends Us{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const r=t.indexOf(this.pattern)===-1;return{isMatch:r,score:r?0:1,indices:[0,t.length-1]}}}class IK extends Us{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const n=t.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class LK extends Us{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const n=!t.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class FK extends Us{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const n=t.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class jK extends Us{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const n=!t.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class JT extends Us{constructor(t,{location:n=He.location,threshold:r=He.threshold,distance:o=He.distance,includeMatches:i=He.includeMatches,findAllMatches:s=He.findAllMatches,minMatchCharLength:l=He.minMatchCharLength,isCaseSensitive:u=He.isCaseSensitive,ignoreLocation:f=He.ignoreLocation}={}){super(t),this._bitapSearch=new QT(t,{location:n,threshold:r,distance:o,includeMatches:i,findAllMatches:s,minMatchCharLength:l,isCaseSensitive:u,ignoreLocation:f})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class ek extends Us{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let n=0,r;const o=[],i=this.pattern.length;for(;(r=t.indexOf(this.pattern,n))>-1;)n=r+i,o.push([r,n-1]);const s=!!o.length;return{isMatch:s,score:s?0:1,indices:o}}}const b1=[NK,ek,IK,LK,jK,FK,DK,JT],v2=b1.length,BK=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,zK="|";function UK(e,t={}){return e.split(zK).map(n=>{let r=n.trim().split(BK).filter(i=>i&&!!i.trim()),o=[];for(let i=0,s=r.length;i<s;i+=1){const l=r[i];let u=!1,f=-1;for(;!u&&++f<v2;){const m=b1[f];let p=m.isMultiMatch(l);p&&(o.push(new m(p,t)),u=!0)}if(!u)for(f=-1;++f<v2;){const m=b1[f];let p=m.isSingleMatch(l);if(p){o.push(new m(p,t));break}}}return o})}const VK=new Set([JT.type,ek.type]);class WK{constructor(t,{isCaseSensitive:n=He.isCaseSensitive,includeMatches:r=He.includeMatches,minMatchCharLength:o=He.minMatchCharLength,ignoreLocation:i=He.ignoreLocation,findAllMatches:s=He.findAllMatches,location:l=He.location,threshold:u=He.threshold,distance:f=He.distance}={}){this.query=null,this.options={isCaseSensitive:n,includeMatches:r,minMatchCharLength:o,findAllMatches:s,ignoreLocation:i,location:l,threshold:u,distance:f},this.pattern=n?t:t.toLowerCase(),this.query=UK(this.pattern,this.options)}static condition(t,n){return n.useExtendedSearch}searchIn(t){const n=this.query;if(!n)return{isMatch:!1,score:1};const{includeMatches:r,isCaseSensitive:o}=this.options;t=o?t:t.toLowerCase();let i=0,s=[],l=0;for(let u=0,f=n.length;u<f;u+=1){const m=n[u];s.length=0,i=0;for(let p=0,g=m.length;p<g;p+=1){const y=m[p],{isMatch:x,indices:S,score:E}=y.search(t);if(x){if(i+=1,l+=E,r){const _=y.constructor.type;VK.has(_)?s=[...s,...S]:s.push(S)}}else{l=0,i=0,s.length=0;break}}if(i){let p={isMatch:!0,score:l/i};return r&&(p.indices=s),p}}return{isMatch:!1,score:1}}}const S1=[];function HK(...e){S1.push(...e)}function _1(e,t){for(let n=0,r=S1.length;n<r;n+=1){let o=S1[n];if(o.condition(e,t))return new o(e,t)}return new QT(e,t)}const Hp={AND:"$and",OR:"$or"},E1={PATH:"$path",PATTERN:"$val"},C1=e=>!!(e[Hp.AND]||e[Hp.OR]),KK=e=>!!e[E1.PATH],GK=e=>!ki(e)&&YT(e)&&!C1(e),y2=e=>({[Hp.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function tk(e,t,{auto:n=!0}={}){const r=o=>{let i=Object.keys(o);const s=KK(o);if(!s&&i.length>1&&!C1(o))return r(y2(o));if(GK(o)){const u=s?o[E1.PATH]:i[0],f=s?o[E1.PATTERN]:o[u];if(!Ho(f))throw new Error(yK(u));const m={keyId:x1(u),pattern:f};return n&&(m.searcher=_1(f,t)),m}let l={children:[],operator:i[0]};return i.forEach(u=>{const f=o[u];ki(f)&&f.forEach(m=>{l.children.push(r(m))})}),l};return C1(e)||(e=y2(e)),r(e)}function YK(e,{ignoreFieldNorm:t=He.ignoreFieldNorm}){e.forEach(n=>{let r=1;n.matches.forEach(({key:o,norm:i,score:s})=>{const l=o?o.weight:null;r*=Math.pow(s===0&&l?Number.EPSILON:s,(l||1)*(t?1:i))}),n.score=r})}function XK(e,t){const n=e.matches;t.matches=[],mr(n)&&n.forEach(r=>{if(!mr(r.indices)||!r.indices.length)return;const{indices:o,value:i}=r;let s={indices:o,value:i};r.key&&(s.key=r.key.src),r.idx>-1&&(s.refIndex=r.idx),t.matches.push(s)})}function ZK(e,t){t.score=e.score}function qK(e,t,{includeMatches:n=He.includeMatches,includeScore:r=He.includeScore}={}){const o=[];return n&&o.push(XK),r&&o.push(ZK),e.map(i=>{const{idx:s}=i,l={item:t[s],refIndex:s};return o.length&&o.forEach(u=>{u(i,l)}),l})}class kc{constructor(t,n={},r){this.options={...He,...n},this.options.useExtendedSearch,this._keyStore=new SK(this.options.keys),this.setCollection(t,r)}setCollection(t,n){if(this._docs=t,n&&!(n instanceof Ux))throw new Error(vK);this._myIndex=n||qT(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){mr(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const n=[];for(let r=0,o=this._docs.length;r<o;r+=1){const i=this._docs[r];t(i,r)&&(this.removeAt(r),r-=1,o-=1,n.push(i))}return n}removeAt(t){this._docs.splice(t,1),this._myIndex.removeAt(t)}getIndex(){return this._myIndex}search(t,{limit:n=-1}={}){const{includeMatches:r,includeScore:o,shouldSort:i,sortFn:s,ignoreFieldNorm:l}=this.options;let u=Ho(t)?Ho(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return YK(u,{ignoreFieldNorm:l}),i&&u.sort(s),GT(n)&&n>-1&&(u=u.slice(0,n)),qK(u,this._docs,{includeMatches:r,includeScore:o})}_searchStringList(t){const n=_1(t,this.options),{records:r}=this._myIndex,o=[];return r.forEach(({v:i,i:s,n:l})=>{if(!mr(i))return;const{isMatch:u,score:f,indices:m}=n.searchIn(i);u&&o.push({item:i,idx:s,matches:[{score:f,value:i,norm:l,indices:m}]})}),o}_searchLogical(t){const n=tk(t,this.options),r=(l,u,f)=>{if(!l.children){const{keyId:p,searcher:g}=l,y=this._findMatches({key:this._keyStore.get(p),value:this._myIndex.getValueForItemAtKeyId(u,p),searcher:g});return y&&y.length?[{idx:f,item:u,matches:y}]:[]}const m=[];for(let p=0,g=l.children.length;p<g;p+=1){const y=l.children[p],x=r(y,u,f);if(x.length)m.push(...x);else if(l.operator===Hp.AND)return[]}return m},o=this._myIndex.records,i={},s=[];return o.forEach(({$:l,i:u})=>{if(mr(l)){let f=r(n,l,u);f.length&&(i[u]||(i[u]={idx:u,item:l,matches:[]},s.push(i[u])),f.forEach(({matches:m})=>{i[u].matches.push(...m)}))}}),s}_searchObjectList(t){const n=_1(t,this.options),{keys:r,records:o}=this._myIndex,i=[];return o.forEach(({$:s,i:l})=>{if(!mr(s))return;let u=[];r.forEach((f,m)=>{u.push(...this._findMatches({key:f,value:s[m],searcher:n}))}),u.length&&i.push({idx:l,item:s,matches:u})}),i}_findMatches({key:t,value:n,searcher:r}){if(!mr(n))return[];let o=[];if(ki(n))n.forEach(({v:i,i:s,n:l})=>{if(!mr(i))return;const{isMatch:u,score:f,indices:m}=r.searchIn(i);u&&o.push({score:f,key:t,value:i,idx:s,norm:l,indices:m})});else{const{v:i,n:s}=n,{isMatch:l,score:u,indices:f}=r.searchIn(i);l&&o.push({score:u,key:t,value:i,norm:s,indices:f})}return o}}kc.version="7.0.0";kc.createIndex=qT;kc.parseIndex=kK;kc.config=He;kc.parseQuery=tk;HK(WK);function Wd(e){const t=e+"CollectionProvider",[n,r]=Tn(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=y=>{const{scope:x,children:S}=y,E=Be.useRef(null),_=Be.useRef(new Map).current;return Be.createElement(o,{scope:x,itemMap:_,collectionRef:E},S)},l=e+"CollectionSlot",u=Be.forwardRef((y,x)=>{const{scope:S,children:E}=y,_=i(l,S),b=Ve(x,_.collectionRef);return Be.createElement(Qo,{ref:b},E)}),f=e+"CollectionItemSlot",m="data-radix-collection-item",p=Be.forwardRef((y,x)=>{const{scope:S,children:E,..._}=y,b=Be.useRef(null),C=Ve(x,b),R=i(f,S);return Be.useEffect(()=>(R.itemMap.set(b,{ref:b,..._}),()=>void R.itemMap.delete(b))),Be.createElement(Qo,{[m]:"",ref:C},E)});function g(y){const x=i(e+"CollectionConsumer",y);return Be.useCallback(()=>{const E=x.collectionRef.current;if(!E)return[];const _=Array.from(E.querySelectorAll(`[${m}]`));return Array.from(x.itemMap.values()).sort((R,k)=>_.indexOf(R.ref.current)-_.indexOf(k.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:s,Slot:u,ItemSlot:p},g,r]}const QK=d.createContext(void 0);function Ac(e){const t=d.useContext(QK);return e||t||"ltr"}const F0="rovingFocusGroup.onEntryFocus",JK={bubbles:!1,cancelable:!0},Vx="RovingFocusGroup",[$1,nk,eG]=Wd(Vx),[tG,sg]=Tn(Vx,[eG]),[nG,rG]=tG(Vx),oG=d.forwardRef((e,t)=>d.createElement($1.Provider,{scope:e.__scopeRovingFocusGroup},d.createElement($1.Slot,{scope:e.__scopeRovingFocusGroup},d.createElement(iG,Y({},e,{ref:t}))))),iG=d.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:f,...m}=e,p=d.useRef(null),g=Ve(t,p),y=Ac(i),[x=null,S]=eo({prop:s,defaultProp:l,onChange:u}),[E,_]=d.useState(!1),b=Lt(f),C=nk(n),R=d.useRef(!1),[k,O]=d.useState(0);return d.useEffect(()=>{const A=p.current;if(A)return A.addEventListener(F0,b),()=>A.removeEventListener(F0,b)},[b]),d.createElement(nG,{scope:n,orientation:r,dir:y,loop:o,currentTabStopId:x,onItemFocus:d.useCallback(A=>S(A),[S]),onItemShiftTab:d.useCallback(()=>_(!0),[]),onFocusableItemAdd:d.useCallback(()=>O(A=>A+1),[]),onFocusableItemRemove:d.useCallback(()=>O(A=>A-1),[])},d.createElement(Ae.div,Y({tabIndex:E||k===0?-1:0,"data-orientation":r},m,{ref:g,style:{outline:"none",...e.style},onMouseDown:fe(e.onMouseDown,()=>{R.current=!0}),onFocus:fe(e.onFocus,A=>{const I=!R.current;if(A.target===A.currentTarget&&I&&!E){const z=new CustomEvent(F0,JK);if(A.currentTarget.dispatchEvent(z),!z.defaultPrevented){const H=C().filter(re=>re.focusable),ie=H.find(re=>re.active),K=H.find(re=>re.id===x),U=[ie,K,...H].filter(Boolean).map(re=>re.ref.current);rk(U)}}R.current=!1}),onBlur:fe(e.onBlur,()=>_(!1))})))}),sG="RovingFocusGroupItem",aG=d.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,l=tr(),u=i||l,f=rG(sG,n),m=f.currentTabStopId===u,p=nk(n),{onFocusableItemAdd:g,onFocusableItemRemove:y}=f;return d.useEffect(()=>{if(r)return g(),()=>y()},[r,g,y]),d.createElement($1.ItemSlot,{scope:n,id:u,focusable:r,active:o},d.createElement(Ae.span,Y({tabIndex:m?0:-1,"data-orientation":f.orientation},s,{ref:t,onMouseDown:fe(e.onMouseDown,x=>{r?f.onItemFocus(u):x.preventDefault()}),onFocus:fe(e.onFocus,()=>f.onItemFocus(u)),onKeyDown:fe(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){f.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const S=uG(x,f.orientation,f.dir);if(S!==void 0){x.preventDefault();let _=p().filter(b=>b.focusable).map(b=>b.ref.current);if(S==="last")_.reverse();else if(S==="prev"||S==="next"){S==="prev"&&_.reverse();const b=_.indexOf(x.currentTarget);_=f.loop?dG(_,b+1):_.slice(b+1)}setTimeout(()=>rk(_))}})})))}),lG={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function cG(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function uG(e,t,n){const r=cG(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return lG[r]}function rk(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function dG(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const ok=oG,ik=aG,sk="Tabs",[fG,gte]=Tn(sk,[sg]),ak=sg(),[hG,Wx]=fG(sk),pG=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:l,activationMode:u="automatic",...f}=e,m=Ac(l),[p,g]=eo({prop:r,onChange:o,defaultProp:i});return d.createElement(hG,{scope:n,baseId:tr(),value:p,onValueChange:g,orientation:s,dir:m,activationMode:u},d.createElement(Ae.div,Y({dir:m,"data-orientation":s},f,{ref:t})))}),mG="TabsList",gG=d.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=Wx(mG,n),s=ak(n);return d.createElement(ok,Y({asChild:!0},s,{orientation:i.orientation,dir:i.dir,loop:r}),d.createElement(Ae.div,Y({role:"tablist","aria-orientation":i.orientation},o,{ref:t})))}),vG="TabsTrigger",yG=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=Wx(vG,n),l=ak(n),u=lk(s.baseId,r),f=ck(s.baseId,r),m=r===s.value;return d.createElement(ik,Y({asChild:!0},l,{focusable:!o,active:m}),d.createElement(Ae.button,Y({type:"button",role:"tab","aria-selected":m,"aria-controls":f,"data-state":m?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:u},i,{ref:t,onMouseDown:fe(e.onMouseDown,p=>{!o&&p.button===0&&p.ctrlKey===!1?s.onValueChange(r):p.preventDefault()}),onKeyDown:fe(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&s.onValueChange(r)}),onFocus:fe(e.onFocus,()=>{const p=s.activationMode!=="manual";!m&&!o&&p&&s.onValueChange(r)})})))}),wG="TabsContent",xG=d.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,l=Wx(wG,n),u=lk(l.baseId,r),f=ck(l.baseId,r),m=r===l.value,p=d.useRef(m);return d.useEffect(()=>{const g=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(g)},[]),d.createElement(xn,{present:o||m},({present:g})=>d.createElement(Ae.div,Y({"data-state":m?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":u,hidden:!g,id:f,tabIndex:0},s,{ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0}}),g&&i))});function lk(e,t){return`${e}-trigger-${t}`}function ck(e,t){return`${e}-content-${t}`}const bG=pG,uk=gG,dk=yG,fk=xG,hk=bG,Hx=d.forwardRef(({className:e,...t},n)=>v.jsx(uk,{ref:n,className:xe("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),tabIndex:-1,...t}));Hx.displayName=uk.displayName;const ys=d.forwardRef(({className:e,...t},n)=>v.jsx(dk,{ref:n,className:xe("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),tabIndex:-1,...t}));ys.displayName=dk.displayName;const Su=d.forwardRef(({className:e,...t},n)=>v.jsx(fk,{ref:n,className:xe("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),tabIndex:-1,...t}));Su.displayName=fk.displayName;function fd(e,[t,n]){return Math.min(n,Math.max(t,e))}function Kx(e){const t=d.useRef({value:e,previous:e});return d.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}const SG=[" ","Enter","ArrowUp","ArrowDown"],_G=[" ","Enter"],ag="Select",[lg,cg,EG]=Wd(ag),[Mc,vte]=Tn(ag,[EG,zs]),Gx=zs(),[CG,Ba]=Mc(ag),[$G,RG]=Mc(ag),PG=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:l,onValueChange:u,dir:f,name:m,autoComplete:p,disabled:g,required:y}=e,x=Gx(t),[S,E]=d.useState(null),[_,b]=d.useState(null),[C,R]=d.useState(!1),k=Ac(f),[O=!1,A]=eo({prop:r,defaultProp:o,onChange:i}),[I,z]=eo({prop:s,defaultProp:l,onChange:u}),H=d.useRef(null),ie=S?!!S.closest("form"):!0,[K,te]=d.useState(new Set),U=Array.from(K).map(re=>re.props.value).join(";");return d.createElement(Fd,x,d.createElement(CG,{required:y,scope:t,trigger:S,onTriggerChange:E,valueNode:_,onValueNodeChange:b,valueNodeHasChildren:C,onValueNodeHasChildrenChange:R,contentId:tr(),value:I,onValueChange:z,open:O,onOpenChange:A,dir:k,triggerPointerDownPosRef:H,disabled:g},d.createElement(lg.Provider,{scope:t},d.createElement($G,{scope:e.__scopeSelect,onNativeOptionAdd:d.useCallback(re=>{te(V=>new Set(V).add(re))},[]),onNativeOptionRemove:d.useCallback(re=>{te(V=>{const J=new Set(V);return J.delete(re),J})},[])},n)),ie?d.createElement(yk,{key:U,"aria-hidden":!0,required:y,tabIndex:-1,name:m,autoComplete:p,value:I,onChange:re=>z(re.target.value),disabled:g},I===void 0?d.createElement("option",{value:""}):null,Array.from(K)):null))},TG="SelectTrigger",kG=d.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=Gx(n),s=Ba(TG,n),l=s.disabled||r,u=Ve(t,s.onTriggerChange),f=cg(n),[m,p,g]=wk(x=>{const S=f().filter(b=>!b.disabled),E=S.find(b=>b.value===s.value),_=xk(S,x,E);_!==void 0&&s.onValueChange(_.value)}),y=()=>{l||(s.onOpenChange(!0),g())};return d.createElement(Gm,Y({asChild:!0},i),d.createElement(Ae.button,Y({type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":vk(s.value)?"":void 0},o,{ref:u,onClick:fe(o.onClick,x=>{x.currentTarget.focus()}),onPointerDown:fe(o.onPointerDown,x=>{const S=x.target;S.hasPointerCapture(x.pointerId)&&S.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&(y(),s.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)},x.preventDefault())}),onKeyDown:fe(o.onKeyDown,x=>{const S=m.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&p(x.key),!(S&&x.key===" ")&&SG.includes(x.key)&&(y(),x.preventDefault())})})))}),AG="SelectValue",MG=d.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...l}=e,u=Ba(AG,n),{onValueNodeHasChildrenChange:f}=u,m=i!==void 0,p=Ve(t,u.onValueNodeChange);return Pn(()=>{f(m)},[f,m]),d.createElement(Ae.span,Y({},l,{ref:p,style:{pointerEvents:"none"}}),vk(u.value)?d.createElement(d.Fragment,null,s):i)}),OG=d.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return d.createElement(Ae.span,Y({"aria-hidden":!0},o,{ref:t}),r||"▼")}),NG=e=>d.createElement(jd,Y({asChild:!0},e)),hc="SelectContent",DG=d.forwardRef((e,t)=>{const n=Ba(hc,e.__scopeSelect),[r,o]=d.useState();if(Pn(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?Bs.createPortal(d.createElement(pk,{scope:e.__scopeSelect},d.createElement(lg.Slot,{scope:e.__scopeSelect},d.createElement("div",null,e.children))),i):null}return d.createElement(IG,Y({},e,{ref:t}))}),gi=10,[pk,za]=Mc(hc),IG=d.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:u,align:f,alignOffset:m,arrowPadding:p,collisionBoundary:g,collisionPadding:y,sticky:x,hideWhenDetached:S,avoidCollisions:E,..._}=e,b=Ba(hc,n),[C,R]=d.useState(null),[k,O]=d.useState(null),A=Ve(t,me=>R(me)),[I,z]=d.useState(null),[H,ie]=d.useState(null),K=cg(n),[te,U]=d.useState(!1),re=d.useRef(!1);d.useEffect(()=>{if(C)return ng(C)},[C]),Jm();const V=d.useCallback(me=>{const[be,...Ee]=K().map(ze=>ze.ref.current),[Oe]=Ee.slice(-1),Ie=document.activeElement;for(const ze of me)if(ze===Ie||(ze==null||ze.scrollIntoView({block:"nearest"}),ze===be&&k&&(k.scrollTop=0),ze===Oe&&k&&(k.scrollTop=k.scrollHeight),ze==null||ze.focus(),document.activeElement!==Ie))return},[K,k]),J=d.useCallback(()=>V([I,C]),[V,I,C]);d.useEffect(()=>{te&&J()},[te,J]);const{onOpenChange:G,triggerPointerDownPosRef:Z}=b;d.useEffect(()=>{if(C){let me={x:0,y:0};const be=Oe=>{var Ie,ze,ht,st;me={x:Math.abs(Math.round(Oe.pageX)-((Ie=(ze=Z.current)===null||ze===void 0?void 0:ze.x)!==null&&Ie!==void 0?Ie:0)),y:Math.abs(Math.round(Oe.pageY)-((ht=(st=Z.current)===null||st===void 0?void 0:st.y)!==null&&ht!==void 0?ht:0))}},Ee=Oe=>{me.x<=10&&me.y<=10?Oe.preventDefault():C.contains(Oe.target)||G(!1),document.removeEventListener("pointermove",be),Z.current=null};return Z.current!==null&&(document.addEventListener("pointermove",be),document.addEventListener("pointerup",Ee,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",be),document.removeEventListener("pointerup",Ee,{capture:!0})}}},[C,G,Z]),d.useEffect(()=>{const me=()=>G(!1);return window.addEventListener("blur",me),window.addEventListener("resize",me),()=>{window.removeEventListener("blur",me),window.removeEventListener("resize",me)}},[G]);const[Q,le]=wk(me=>{const be=K().filter(Ie=>!Ie.disabled),Ee=be.find(Ie=>Ie.ref.current===document.activeElement),Oe=xk(be,me,Ee);Oe&&setTimeout(()=>Oe.ref.current.focus())}),L=d.useCallback((me,be,Ee)=>{const Oe=!re.current&&!Ee;(b.value!==void 0&&b.value===be||Oe)&&(z(me),Oe&&(re.current=!0))},[b.value]),ue=d.useCallback(()=>C==null?void 0:C.focus(),[C]),Ne=d.useCallback((me,be,Ee)=>{const Oe=!re.current&&!Ee;(b.value!==void 0&&b.value===be||Oe)&&ie(me)},[b.value]),Ke=r==="popper"?w2:LG,Me=Ke===w2?{side:l,sideOffset:u,align:f,alignOffset:m,arrowPadding:p,collisionBoundary:g,collisionPadding:y,sticky:x,hideWhenDetached:S,avoidCollisions:E}:{};return d.createElement(pk,{scope:n,content:C,viewport:k,onViewportChange:O,itemRefCallback:L,selectedItem:I,onItemLeave:ue,itemTextRefCallback:Ne,focusSelectedItem:J,selectedItemText:H,position:r,isPositioned:te,searchRef:Q},d.createElement(tg,{as:Qo,allowPinchZoom:!0},d.createElement(Qm,{asChild:!0,trapped:b.open,onMountAutoFocus:me=>{me.preventDefault()},onUnmountAutoFocus:fe(o,me=>{var be;(be=b.trigger)===null||be===void 0||be.focus({preventScroll:!0}),me.preventDefault()})},d.createElement($c,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:me=>me.preventDefault(),onDismiss:()=>b.onOpenChange(!1)},d.createElement(Ke,Y({role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:me=>me.preventDefault()},_,Me,{onPlaced:()=>U(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",..._.style},onKeyDown:fe(_.onKeyDown,me=>{const be=me.ctrlKey||me.altKey||me.metaKey;if(me.key==="Tab"&&me.preventDefault(),!be&&me.key.length===1&&le(me.key),["ArrowUp","ArrowDown","Home","End"].includes(me.key)){let Oe=K().filter(Ie=>!Ie.disabled).map(Ie=>Ie.ref.current);if(["ArrowUp","End"].includes(me.key)&&(Oe=Oe.slice().reverse()),["ArrowUp","ArrowDown"].includes(me.key)){const Ie=me.target,ze=Oe.indexOf(Ie);Oe=Oe.slice(ze+1)}setTimeout(()=>V(Oe)),me.preventDefault()}})}))))))}),LG=d.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=Ba(hc,n),s=za(hc,n),[l,u]=d.useState(null),[f,m]=d.useState(null),p=Ve(t,A=>m(A)),g=cg(n),y=d.useRef(!1),x=d.useRef(!0),{viewport:S,selectedItem:E,selectedItemText:_,focusSelectedItem:b}=s,C=d.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&f&&S&&E&&_){const A=i.trigger.getBoundingClientRect(),I=f.getBoundingClientRect(),z=i.valueNode.getBoundingClientRect(),H=_.getBoundingClientRect();if(i.dir!=="rtl"){const Ie=H.left-I.left,ze=z.left-Ie,ht=A.left-ze,st=A.width+ht,Yt=Math.max(st,I.width),rr=window.innerWidth-gi,Jt=fd(ze,[gi,rr-Yt]);l.style.minWidth=st+"px",l.style.left=Jt+"px"}else{const Ie=I.right-H.right,ze=window.innerWidth-z.right-Ie,ht=window.innerWidth-A.right-ze,st=A.width+ht,Yt=Math.max(st,I.width),rr=window.innerWidth-gi,Jt=fd(ze,[gi,rr-Yt]);l.style.minWidth=st+"px",l.style.right=Jt+"px"}const ie=g(),K=window.innerHeight-gi*2,te=S.scrollHeight,U=window.getComputedStyle(f),re=parseInt(U.borderTopWidth,10),V=parseInt(U.paddingTop,10),J=parseInt(U.borderBottomWidth,10),G=parseInt(U.paddingBottom,10),Z=re+V+te+G+J,Q=Math.min(E.offsetHeight*5,Z),le=window.getComputedStyle(S),L=parseInt(le.paddingTop,10),ue=parseInt(le.paddingBottom,10),Ne=A.top+A.height/2-gi,Ke=K-Ne,Me=E.offsetHeight/2,me=E.offsetTop+Me,be=re+V+me,Ee=Z-be;if(be<=Ne){const Ie=E===ie[ie.length-1].ref.current;l.style.bottom="0px";const ze=f.clientHeight-S.offsetTop-S.offsetHeight,ht=Math.max(Ke,Me+(Ie?ue:0)+ze+J),st=be+ht;l.style.height=st+"px"}else{const Ie=E===ie[0].ref.current;l.style.top="0px";const ht=Math.max(Ne,re+S.offsetTop+(Ie?L:0)+Me)+Ee;l.style.height=ht+"px",S.scrollTop=be-Ne+S.offsetTop}l.style.margin=`${gi}px 0`,l.style.minHeight=Q+"px",l.style.maxHeight=K+"px",r==null||r(),requestAnimationFrame(()=>y.current=!0)}},[g,i.trigger,i.valueNode,l,f,S,E,_,i.dir,r]);Pn(()=>C(),[C]);const[R,k]=d.useState();Pn(()=>{f&&k(window.getComputedStyle(f).zIndex)},[f]);const O=d.useCallback(A=>{A&&x.current===!0&&(C(),b==null||b(),x.current=!1)},[C,b]);return d.createElement(FG,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:y,onScrollButtonChange:O},d.createElement("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:R}},d.createElement(Ae.div,Y({},o,{ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}}))))}),w2=d.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=gi,...i}=e,s=Gx(n);return d.createElement(Ym,Y({},s,i,{ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[FG,Yx]=Mc(hc,{}),x2="SelectViewport",jG=d.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=za(x2,n),i=Yx(x2,n),s=Ve(t,o.onViewportChange),l=d.useRef(0);return d.createElement(d.Fragment,null,d.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),d.createElement(lg.Slot,{scope:n},d.createElement(Ae.div,Y({"data-radix-select-viewport":"",role:"presentation"},r,{ref:s,style:{position:"relative",flex:1,overflow:"auto",...r.style},onScroll:fe(r.onScroll,u=>{const f=u.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:p}=i;if(p!=null&&p.current&&m){const g=Math.abs(l.current-f.scrollTop);if(g>0){const y=window.innerHeight-gi*2,x=parseFloat(m.style.minHeight),S=parseFloat(m.style.height),E=Math.max(x,S);if(E<y){const _=E+g,b=Math.min(y,_),C=_-b;m.style.height=b+"px",m.style.bottom==="0px"&&(f.scrollTop=C>0?C:0,m.style.justifyContent="flex-end")}}}l.current=f.scrollTop})}))))}),BG="SelectGroup",[zG,UG]=Mc(BG),VG=d.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=tr();return d.createElement(zG,{scope:n,id:o},d.createElement(Ae.div,Y({role:"group","aria-labelledby":o},r,{ref:t})))}),WG="SelectLabel",HG=d.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=UG(WG,n);return d.createElement(Ae.div,Y({id:o.id},r,{ref:t}))}),R1="SelectItem",[KG,mk]=Mc(R1),GG=d.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,l=Ba(R1,n),u=za(R1,n),f=l.value===r,[m,p]=d.useState(i??""),[g,y]=d.useState(!1),x=Ve(t,_=>{var b;return(b=u.itemRefCallback)===null||b===void 0?void 0:b.call(u,_,r,o)}),S=tr(),E=()=>{o||(l.onValueChange(r),l.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.createElement(KG,{scope:n,value:r,disabled:o,textId:S,isSelected:f,onItemTextChange:d.useCallback(_=>{p(b=>{var C;return b||((C=_==null?void 0:_.textContent)!==null&&C!==void 0?C:"").trim()})},[])},d.createElement(lg.ItemSlot,{scope:n,value:r,disabled:o,textValue:m},d.createElement(Ae.div,Y({role:"option","aria-labelledby":S,"data-highlighted":g?"":void 0,"aria-selected":f&&g,"data-state":f?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1},s,{ref:x,onFocus:fe(s.onFocus,()=>y(!0)),onBlur:fe(s.onBlur,()=>y(!1)),onPointerUp:fe(s.onPointerUp,E),onPointerMove:fe(s.onPointerMove,_=>{if(o){var b;(b=u.onItemLeave)===null||b===void 0||b.call(u)}else _.currentTarget.focus({preventScroll:!0})}),onPointerLeave:fe(s.onPointerLeave,_=>{if(_.currentTarget===document.activeElement){var b;(b=u.onItemLeave)===null||b===void 0||b.call(u)}}),onKeyDown:fe(s.onKeyDown,_=>{var b;((b=u.searchRef)===null||b===void 0?void 0:b.current)!==""&&_.key===" "||(_G.includes(_.key)&&E(),_.key===" "&&_.preventDefault())})}))))}),Eh="SelectItemText",YG=d.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=Ba(Eh,n),l=za(Eh,n),u=mk(Eh,n),f=RG(Eh,n),[m,p]=d.useState(null),g=Ve(t,_=>p(_),u.onItemTextChange,_=>{var b;return(b=l.itemTextRefCallback)===null||b===void 0?void 0:b.call(l,_,u.value,u.disabled)}),y=m==null?void 0:m.textContent,x=d.useMemo(()=>d.createElement("option",{key:u.value,value:u.value,disabled:u.disabled},y),[u.disabled,u.value,y]),{onNativeOptionAdd:S,onNativeOptionRemove:E}=f;return Pn(()=>(S(x),()=>E(x)),[S,E,x]),d.createElement(d.Fragment,null,d.createElement(Ae.span,Y({id:u.textId},i,{ref:g})),u.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Bs.createPortal(i.children,s.valueNode):null)}),XG="SelectItemIndicator",ZG=d.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return mk(XG,n).isSelected?d.createElement(Ae.span,Y({"aria-hidden":!0},r,{ref:t})):null}),b2="SelectScrollUpButton",qG=d.forwardRef((e,t)=>{const n=za(b2,e.__scopeSelect),r=Yx(b2,e.__scopeSelect),[o,i]=d.useState(!1),s=Ve(t,r.onScrollButtonChange);return Pn(()=>{if(n.viewport&&n.isPositioned){let f=function(){const m=u.scrollTop>0;i(m)};var l=f;const u=n.viewport;return f(),u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[n.viewport,n.isPositioned]),o?d.createElement(gk,Y({},e,{ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:u}=n;l&&u&&(l.scrollTop=l.scrollTop-u.offsetHeight)}})):null}),S2="SelectScrollDownButton",QG=d.forwardRef((e,t)=>{const n=za(S2,e.__scopeSelect),r=Yx(S2,e.__scopeSelect),[o,i]=d.useState(!1),s=Ve(t,r.onScrollButtonChange);return Pn(()=>{if(n.viewport&&n.isPositioned){let f=function(){const m=u.scrollHeight-u.clientHeight,p=Math.ceil(u.scrollTop)<m;i(p)};var l=f;const u=n.viewport;return f(),u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[n.viewport,n.isPositioned]),o?d.createElement(gk,Y({},e,{ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:u}=n;l&&u&&(l.scrollTop=l.scrollTop+u.offsetHeight)}})):null}),gk=d.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=za("SelectScrollButton",n),s=d.useRef(null),l=cg(n),u=d.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return d.useEffect(()=>()=>u(),[u]),Pn(()=>{var f;const m=l().find(p=>p.ref.current===document.activeElement);m==null||(f=m.ref.current)===null||f===void 0||f.scrollIntoView({block:"nearest"})},[l]),d.createElement(Ae.div,Y({"aria-hidden":!0},o,{ref:t,style:{flexShrink:0,...o.style},onPointerDown:fe(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:fe(o.onPointerMove,()=>{var f;(f=i.onItemLeave)===null||f===void 0||f.call(i),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:fe(o.onPointerLeave,()=>{u()})}))}),JG=d.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return d.createElement(Ae.div,Y({"aria-hidden":!0},r,{ref:t}))});function vk(e){return e===""||e===void 0}const yk=d.forwardRef((e,t)=>{const{value:n,...r}=e,o=d.useRef(null),i=Ve(t,o),s=Kx(n);return d.useEffect(()=>{const l=o.current,u=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(u,"value").set;if(s!==n&&m){const p=new Event("change",{bubbles:!0});m.call(l,n),l.dispatchEvent(p)}},[s,n]),d.createElement(Xm,{asChild:!0},d.createElement("select",Y({},r,{ref:i,defaultValue:n})))});yk.displayName="BubbleSelect";function wk(e){const t=Lt(e),n=d.useRef(""),r=d.useRef(0),o=d.useCallback(s=>{const l=n.current+s;t(l),function u(f){n.current=f,window.clearTimeout(r.current),f!==""&&(r.current=window.setTimeout(()=>u(""),1e3))}(l)},[t]),i=d.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return d.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function xk(e,t,n){const o=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=eY(e,Math.max(i,0));o.length===1&&(s=s.filter(f=>f!==n));const u=s.find(f=>f.textValue.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function eY(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const tY=PG,bk=kG,nY=MG,rY=OG,oY=NG,Sk=DG,iY=jG,sY=VG,_k=HG,Ek=GG,aY=YG,lY=ZG,Ck=qG,$k=QG,Rk=JG,yo=tY,zo=sY,wo=nY,Vr=d.forwardRef(({className:e,children:t,...n},r)=>v.jsxs(bk,{ref:r,className:xe("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent pl-2 pr-1 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),tabIndex:-1,...n,children:[t,v.jsx(rY,{asChild:!0,children:v.jsx(Jj,{className:"h-4 w-4 opacity-50"})})]}));Vr.displayName=bk.displayName;const Pk=d.forwardRef(({className:e,...t},n)=>v.jsx(Ck,{ref:n,className:xe("flex cursor-default items-center justify-center py-1",e),...t,children:v.jsx(sB,{})}));Pk.displayName=Ck.displayName;const Tk=d.forwardRef(({className:e,...t},n)=>v.jsx($k,{ref:n,className:xe("flex cursor-default items-center justify-center py-1",e),...t,children:v.jsx(nB,{})}));Tk.displayName=$k.displayName;const Wr=d.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>v.jsx(oY,{children:v.jsxs(Sk,{ref:o,className:xe("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,onCloseAutoFocus:i=>i.preventDefault(),...r,children:[v.jsx(Pk,{}),v.jsx(iY,{className:xe("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),v.jsx(Tk,{})]})}));Wr.displayName=Sk.displayName;const cY=d.forwardRef(({className:e,...t},n)=>v.jsx(_k,{ref:n,className:xe("px-2 py-1.5 text-sm font-semibold",e),...t}));cY.displayName=_k.displayName;const Hr=d.forwardRef(({className:e,children:t,...n},r)=>v.jsxs(Ek,{ref:r,className:xe("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[v.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:v.jsx(lY,{children:v.jsx(EP,{className:"h-4 w-4"})})}),v.jsx(aY,{children:t})]}));Hr.displayName=Ek.displayName;const uY=d.forwardRef(({className:e,...t},n)=>v.jsx(Rk,{ref:n,className:xe("-mx-1 my-1 h-px bg-muted",e),...t}));uY.displayName=Rk.displayName;function dY(e,t){return d.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const kk="ScrollArea",[Ak,yte]=Tn(kk),[fY,to]=Ak(kk),hY=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:i=600,...s}=e,[l,u]=d.useState(null),[f,m]=d.useState(null),[p,g]=d.useState(null),[y,x]=d.useState(null),[S,E]=d.useState(null),[_,b]=d.useState(0),[C,R]=d.useState(0),[k,O]=d.useState(!1),[A,I]=d.useState(!1),z=Ve(t,ie=>u(ie)),H=Ac(o);return d.createElement(fY,{scope:n,type:r,dir:H,scrollHideDelay:i,scrollArea:l,viewport:f,onViewportChange:m,content:p,onContentChange:g,scrollbarX:y,onScrollbarXChange:x,scrollbarXEnabled:k,onScrollbarXEnabledChange:O,scrollbarY:S,onScrollbarYChange:E,scrollbarYEnabled:A,onScrollbarYEnabledChange:I,onCornerWidthChange:b,onCornerHeightChange:R},d.createElement(Ae.div,Y({dir:H},s,{ref:z,style:{position:"relative","--radix-scroll-area-corner-width":_+"px","--radix-scroll-area-corner-height":C+"px",...e.style}})))}),pY="ScrollAreaViewport",mY=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,...o}=e,i=to(pY,n),s=d.useRef(null),l=Ve(t,s,i.onViewportChange);return d.createElement(d.Fragment,null,d.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),d.createElement(Ae.div,Y({"data-radix-scroll-area-viewport":""},o,{ref:l,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style}}),d.createElement("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"}},r)))}),Ii="ScrollAreaScrollbar",Mk=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=to(Ii,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=o,l=e.orientation==="horizontal";return d.useEffect(()=>(l?i(!0):s(!0),()=>{l?i(!1):s(!1)}),[l,i,s]),o.type==="hover"?d.createElement(gY,Y({},r,{ref:t,forceMount:n})):o.type==="scroll"?d.createElement(vY,Y({},r,{ref:t,forceMount:n})):o.type==="auto"?d.createElement(Ok,Y({},r,{ref:t,forceMount:n})):o.type==="always"?d.createElement(Xx,Y({},r,{ref:t})):null}),gY=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=to(Ii,e.__scopeScrollArea),[i,s]=d.useState(!1);return d.useEffect(()=>{const l=o.scrollArea;let u=0;if(l){const f=()=>{window.clearTimeout(u),s(!0)},m=()=>{u=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return l.addEventListener("pointerenter",f),l.addEventListener("pointerleave",m),()=>{window.clearTimeout(u),l.removeEventListener("pointerenter",f),l.removeEventListener("pointerleave",m)}}},[o.scrollArea,o.scrollHideDelay]),d.createElement(xn,{present:n||i},d.createElement(Ok,Y({"data-state":i?"visible":"hidden"},r,{ref:t})))}),vY=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=to(Ii,e.__scopeScrollArea),i=e.orientation==="horizontal",s=dg(()=>u("SCROLL_END"),100),[l,u]=dY("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return d.useEffect(()=>{if(l==="idle"){const f=window.setTimeout(()=>u("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(f)}},[l,o.scrollHideDelay,u]),d.useEffect(()=>{const f=o.viewport,m=i?"scrollLeft":"scrollTop";if(f){let p=f[m];const g=()=>{const y=f[m];p!==y&&(u("SCROLL"),s()),p=y};return f.addEventListener("scroll",g),()=>f.removeEventListener("scroll",g)}},[o.viewport,i,u,s]),d.createElement(xn,{present:n||l!=="hidden"},d.createElement(Xx,Y({"data-state":l==="hidden"?"hidden":"visible"},r,{ref:t,onPointerEnter:fe(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:fe(e.onPointerLeave,()=>u("POINTER_LEAVE"))})))}),Ok=d.forwardRef((e,t)=>{const n=to(Ii,e.__scopeScrollArea),{forceMount:r,...o}=e,[i,s]=d.useState(!1),l=e.orientation==="horizontal",u=dg(()=>{if(n.viewport){const f=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;s(l?f:m)}},10);return pc(n.viewport,u),pc(n.content,u),d.createElement(xn,{present:r||i},d.createElement(Xx,Y({"data-state":i?"visible":"hidden"},o,{ref:t})))}),Xx=d.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=to(Ii,e.__scopeScrollArea),i=d.useRef(null),s=d.useRef(0),[l,u]=d.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=Lk(l.viewport,l.content),m={...r,sizes:l,onSizesChange:u,hasThumb:f>0&&f<1,onThumbChange:g=>i.current=g,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:g=>s.current=g};function p(g,y){return CY(g,s.current,l,y)}return n==="horizontal"?d.createElement(yY,Y({},m,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const g=o.viewport.scrollLeft,y=_2(g,l,o.dir);i.current.style.transform=`translate3d(${y}px, 0, 0)`}},onWheelScroll:g=>{o.viewport&&(o.viewport.scrollLeft=g)},onDragScroll:g=>{o.viewport&&(o.viewport.scrollLeft=p(g,o.dir))}})):n==="vertical"?d.createElement(wY,Y({},m,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const g=o.viewport.scrollTop,y=_2(g,l);i.current.style.transform=`translate3d(0, ${y}px, 0)`}},onWheelScroll:g=>{o.viewport&&(o.viewport.scrollTop=g)},onDragScroll:g=>{o.viewport&&(o.viewport.scrollTop=p(g))}})):null}),yY=d.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=to(Ii,e.__scopeScrollArea),[s,l]=d.useState(),u=d.useRef(null),f=Ve(t,u,i.onScrollbarXChange);return d.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),d.createElement(Dk,Y({"data-orientation":"horizontal"},o,{ref:f,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":ug(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.x),onDragScroll:m=>e.onDragScroll(m.x),onWheelScroll:(m,p)=>{if(i.viewport){const g=i.viewport.scrollLeft+m.deltaX;e.onWheelScroll(g),jk(g,p)&&m.preventDefault()}},onResize:()=>{u.current&&i.viewport&&s&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:Kp(s.paddingLeft),paddingEnd:Kp(s.paddingRight)}})}}))}),wY=d.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=to(Ii,e.__scopeScrollArea),[s,l]=d.useState(),u=d.useRef(null),f=Ve(t,u,i.onScrollbarYChange);return d.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),d.createElement(Dk,Y({"data-orientation":"vertical"},o,{ref:f,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":ug(n)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.y),onDragScroll:m=>e.onDragScroll(m.y),onWheelScroll:(m,p)=>{if(i.viewport){const g=i.viewport.scrollTop+m.deltaY;e.onWheelScroll(g),jk(g,p)&&m.preventDefault()}},onResize:()=>{u.current&&i.viewport&&s&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:Kp(s.paddingTop),paddingEnd:Kp(s.paddingBottom)}})}}))}),[xY,Nk]=Ak(Ii),Dk=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:l,onThumbPositionChange:u,onDragScroll:f,onWheelScroll:m,onResize:p,...g}=e,y=to(Ii,n),[x,S]=d.useState(null),E=Ve(t,z=>S(z)),_=d.useRef(null),b=d.useRef(""),C=y.viewport,R=r.content-r.viewport,k=Lt(m),O=Lt(u),A=dg(p,10);function I(z){if(_.current){const H=z.clientX-_.current.left,ie=z.clientY-_.current.top;f({x:H,y:ie})}}return d.useEffect(()=>{const z=H=>{const ie=H.target;(x==null?void 0:x.contains(ie))&&k(H,R)};return document.addEventListener("wheel",z,{passive:!1}),()=>document.removeEventListener("wheel",z,{passive:!1})},[C,x,R,k]),d.useEffect(O,[r,O]),pc(x,A),pc(y.content,A),d.createElement(xY,{scope:n,scrollbar:x,hasThumb:o,onThumbChange:Lt(i),onThumbPointerUp:Lt(s),onThumbPositionChange:O,onThumbPointerDown:Lt(l)},d.createElement(Ae.div,Y({},g,{ref:E,style:{position:"absolute",...g.style},onPointerDown:fe(e.onPointerDown,z=>{z.button===0&&(z.target.setPointerCapture(z.pointerId),_.current=x.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",y.viewport&&(y.viewport.style.scrollBehavior="auto"),I(z))}),onPointerMove:fe(e.onPointerMove,I),onPointerUp:fe(e.onPointerUp,z=>{const H=z.target;H.hasPointerCapture(z.pointerId)&&H.releasePointerCapture(z.pointerId),document.body.style.webkitUserSelect=b.current,y.viewport&&(y.viewport.style.scrollBehavior=""),_.current=null})})))}),P1="ScrollAreaThumb",bY=d.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Nk(P1,e.__scopeScrollArea);return d.createElement(xn,{present:n||o.hasThumb},d.createElement(SY,Y({ref:t},r)))}),SY=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=to(P1,n),s=Nk(P1,n),{onThumbPositionChange:l}=s,u=Ve(t,p=>s.onThumbChange(p)),f=d.useRef(),m=dg(()=>{f.current&&(f.current(),f.current=void 0)},100);return d.useEffect(()=>{const p=i.viewport;if(p){const g=()=>{if(m(),!f.current){const y=$Y(p,l);f.current=y,l()}};return l(),p.addEventListener("scroll",g),()=>p.removeEventListener("scroll",g)}},[i.viewport,m,l]),d.createElement(Ae.div,Y({"data-state":s.hasThumb?"visible":"hidden"},o,{ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:fe(e.onPointerDownCapture,p=>{const y=p.target.getBoundingClientRect(),x=p.clientX-y.left,S=p.clientY-y.top;s.onThumbPointerDown({x,y:S})}),onPointerUp:fe(e.onPointerUp,s.onThumbPointerUp)}))}),Ik="ScrollAreaCorner",_Y=d.forwardRef((e,t)=>{const n=to(Ik,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?d.createElement(EY,Y({},e,{ref:t})):null}),EY=d.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=to(Ik,n),[i,s]=d.useState(0),[l,u]=d.useState(0),f=!!(i&&l);return pc(o.scrollbarX,()=>{var m;const p=((m=o.scrollbarX)===null||m===void 0?void 0:m.offsetHeight)||0;o.onCornerHeightChange(p),u(p)}),pc(o.scrollbarY,()=>{var m;const p=((m=o.scrollbarY)===null||m===void 0?void 0:m.offsetWidth)||0;o.onCornerWidthChange(p),s(p)}),f?d.createElement(Ae.div,Y({},r,{ref:t,style:{width:i,height:l,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}})):null});function Kp(e){return e?parseInt(e,10):0}function Lk(e,t){const n=e/t;return isNaN(n)?0:n}function ug(e){const t=Lk(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function CY(e,t,n,r="ltr"){const o=ug(n),i=o/2,s=t||i,l=o-s,u=n.scrollbar.paddingStart+s,f=n.scrollbar.size-n.scrollbar.paddingEnd-l,m=n.content-n.viewport,p=r==="ltr"?[0,m]:[m*-1,0];return Fk([u,f],p)(e)}function _2(e,t,n="ltr"){const r=ug(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,s=t.content-t.viewport,l=i-r,u=n==="ltr"?[0,s]:[s*-1,0],f=fd(e,u);return Fk([0,s],[0,l])(f)}function Fk(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function jk(e,t){return e>0&&e<t}const $Y=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const i={left:e.scrollLeft,top:e.scrollTop},s=n.left!==i.left,l=n.top!==i.top;(s||l)&&t(),n=i,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function dg(e,t){const n=Lt(e),r=d.useRef(0);return d.useEffect(()=>()=>window.clearTimeout(r.current),[]),d.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function pc(e,t){const n=Lt(t);Pn(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}const Bk=hY,RY=mY,PY=_Y,fg=d.forwardRef(({className:e,children:t,...n},r)=>v.jsxs(Bk,{ref:r,className:xe("relative overflow-hidden",e),scrollHideDelay:400,...n,children:[v.jsx(RY,{className:"h-full w-full rounded-[inherit]",children:t}),v.jsx(zk,{}),v.jsx(PY,{})]}));fg.displayName=Bk.displayName;const zk=d.forwardRef(({className:e,orientation:t="vertical",...n},r)=>v.jsx(Mk,{ref:r,orientation:t,className:xe("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:v.jsx(bY,{className:"relative flex-1 rounded-full bg-border"})}));zk.displayName=Mk.displayName;const Uk="Name",Vk="Created time",Wk="Modified time",E2="input",TY="output",Hk="mask",C2={[Ps.NAME]:Uk,[Ps.CTIME]:Vk,[Ps.MTIME]:Wk};function kY(e){const{onPhotoClick:t,photoWidth:n}=e,[r,o]=Fx(!1),[i,s]=xt(H=>[H.fileManagerState,H.updateFileManagerState]),{toast:l}=Id(),[u,f]=d.useState(0),[m,p]=d.useState(0),g=d.useRef(null),y=GU(i.searchText,300),[x,S]=d.useState(E2),[E,_]=d.useState([]),[b,C]=d.useState([]),[R,k]=d.useState(0);Yn("f",()=>{o()}),Yn("left",()=>{let H=R;R>0&&(H=R-1),k(H),t(x,b[H].name)},[R,b]),Yn("right",()=>{let H=R;R<b.length-1&&(H=R+1),k(H),t(x,b[H].name)},[R,b]),d.useEffect(()=>{r||p(u)},[r,u]);const O=d.useCallback(H=>{H!==null&&r&&setTimeout(()=>{H.scrollTo({top:m,left:0})},100)},[r,m]);d.useEffect(()=>{(async()=>{try{const ie=await Gj(x);_(ie)}catch(ie){l({variant:"destructive",title:"Uh oh! Something went wrong.",description:ie.message?ie.message:ie.toString()})}})()},[x]),d.useEffect(()=>{if(!r)return;(async()=>{try{let ie=E;y&&(ie=new kc(ie,{keys:["name"]}).search(y).map(re=>ie[re.refIndex])),ie=xH.orderBy(ie,i.sortBy,i.sortOrder);const K=ie.map(te=>{const U=n,re=te.height*(U/te.width);return{src:`${Ni}/media_thumbnail_file?tab=${x}&filename=${encodeURIComponent(te.name)}&width=${Math.ceil(U)}&height=${Math.ceil(re)}`,height:re,width:U,name:te.name}});C(K)}catch(ie){l({variant:"destructive",title:"Uh oh! Something went wrong.",description:ie.message?ie.message:ie.toString()})}})()},[E,y,i,n,r]);const A=H=>{f(H.currentTarget.scrollTop)},I=({index:H})=>{o(),k(H),t(x,b[H].name)},z=()=>v.jsxs("div",{className:"flex justify-start items-center gap-[12px]",children:[v.jsx("div",{children:`Images (${b.length})`}),v.jsxs("div",{className:"flex",children:[v.jsx(Zn,{tooltip:"Rows layout",onClick:()=>{s({layout:"rows"})},children:v.jsx(vB,{className:i.layout!=="rows"?"opacity-50":""})}),v.jsx(Zn,{tooltip:"Grid layout",onClick:()=>{s({layout:"masonry"})},children:v.jsx(mB,{className:i.layout!=="masonry"?"opacity-50":""})})]})]});return v.jsxs(Mx,{open:r,onOpenChange:o,children:[v.jsx(vT,{asChild:!0,children:v.jsx(Zn,{tooltip:"File Manager",children:v.jsx(pH,{})})}),v.jsxs(rg,{className:"h-4/5 max-w-6xl",children:[v.jsx(og,{children:z()}),v.jsxs("div",{className:"flex justify-between gap-8 items-center",children:[v.jsxs("div",{className:"flex relative justify-start items-center",children:[v.jsx(dB,{className:"absolute left-[8px]"}),v.jsx(Wm,{ref:g,value:i.searchText,className:"w-[250px] pl-[30px]",tabIndex:-1,onInput:H=>{H.preventDefault(),H.stopPropagation();const ie=H.target;s({searchText:ie.value})},placeholder:"Search by file name"})]}),v.jsx(hk,{defaultValue:x,onValueChange:H=>S(H),children:v.jsxs(Hx,{"aria-label":"Manage your account",children:[v.jsx(ys,{value:E2,children:"Image Directory"}),v.jsx(ys,{value:TY,children:"Output Directory"}),v.jsx(ys,{value:Hk,children:"Mask Directory"})]})}),v.jsx("div",{className:"flex gap-2",children:v.jsxs("div",{className:"flex gap-1",children:[v.jsxs(yo,{value:C2[i.sortBy],onValueChange:H=>{switch(H){case Uk:s({sortBy:Ps.NAME});break;case Vk:s({sortBy:Ps.CTIME});break;case Wk:s({sortBy:Ps.MTIME});break}},children:[v.jsx(Vr,{className:"w-[140px]",children:v.jsx(wo,{})}),v.jsx(Wr,{children:Object.values(C2).map(H=>v.jsx(Hr,{value:H,children:H},H))})]}),i.sortOrder===Ou.DESCENDING?v.jsx(Zn,{tooltip:"Descending Order",onClick:()=>{s({sortOrder:Ou.ASCENDING})},children:v.jsx(iK,{})}):v.jsx(Zn,{tooltip:"Ascending Order",onClick:()=>{s({sortOrder:Ou.DESCENDING})},children:v.jsx(lK,{})})]})})]}),v.jsx(fg,{className:"w-full h-full rounded-md",onScroll:A,ref:O,children:v.jsx(nK,{layout:i.layout,photos:b,spacing:12,padding:0,onClick:I})})]})]})}var Hd=e=>e.type==="checkbox",Tl=e=>e instanceof Date,Fn=e=>e==null;const Kk=e=>typeof e=="object";var sn=e=>!Fn(e)&&!Array.isArray(e)&&Kk(e)&&!Tl(e),Gk=e=>sn(e)&&e.target?Hd(e.target)?e.target.checked:e.target.value:e,AY=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Yk=(e,t)=>e.has(AY(t)),MY=e=>{const t=e.constructor&&e.constructor.prototype;return sn(t)&&t.hasOwnProperty("isPrototypeOf")},Zx=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function uo(e){let t;const n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(Zx&&(e instanceof Blob||e instanceof FileList))&&(n||sn(e)))if(t=n?[]:{},!n&&!MY(e))t=e;else for(const r in e)e.hasOwnProperty(r)&&(t[r]=uo(e[r]));else return e;return t}var Kd=e=>Array.isArray(e)?e.filter(Boolean):[],Wt=e=>e===void 0,ye=(e,t,n)=>{if(!t||!sn(e))return n;const r=Kd(t.split(/[,[\].]+?/)).reduce((o,i)=>Fn(o)?o:o[i],e);return Wt(r)||r===e?Wt(e[t])?n:e[t]:r},Uo=e=>typeof e=="boolean";const Gp={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},xo={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},hi={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Xk=Be.createContext(null),hg=()=>Be.useContext(Xk),OY=e=>{const{children:t,...n}=e;return Be.createElement(Xk.Provider,{value:n},t)};var Zk=(e,t,n,r=!0)=>{const o={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(o,i,{get:()=>{const s=i;return t._proxyFormState[s]!==xo.all&&(t._proxyFormState[s]=!r||xo.all),n&&(n[s]=!0),e[s]}});return o},Fr=e=>sn(e)&&!Object.keys(e).length,qk=(e,t,n,r)=>{n(e);const{name:o,...i}=e;return Fr(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(s=>t[s]===(!r||xo.all))},rp=e=>Array.isArray(e)?e:[e],Qk=(e,t,n)=>!e||!t||e===t||rp(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r)));function qx(e){const t=Be.useRef(e);t.current=e,Be.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}function NY(e){const t=hg(),{control:n=t.control,disabled:r,name:o,exact:i}=e||{},[s,l]=Be.useState(n._formState),u=Be.useRef(!0),f=Be.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1}),m=Be.useRef(o);return m.current=o,qx({disabled:r,next:p=>u.current&&Qk(m.current,p.name,i)&&qk(p,f.current,n._updateFormState)&&l({...n._formState,...p}),subject:n._subjects.state}),Be.useEffect(()=>(u.current=!0,f.current.isValid&&n._updateValid(!0),()=>{u.current=!1}),[n]),Zk(s,n,f.current,!1)}var Ko=e=>typeof e=="string",Jk=(e,t,n,r,o)=>Ko(e)?(r&&t.watch.add(e),ye(n,e,o)):Array.isArray(e)?e.map(i=>(r&&t.watch.add(i),ye(n,i))):(r&&(t.watchAll=!0),n);function DY(e){const t=hg(),{control:n=t.control,name:r,defaultValue:o,disabled:i,exact:s}=e||{},l=Be.useRef(r);l.current=r,qx({disabled:i,subject:n._subjects.values,next:m=>{Qk(l.current,m.name,s)&&f(uo(Jk(l.current,n._names,m.values||n._formValues,!1,o)))}});const[u,f]=Be.useState(n._getWatch(r,o));return Be.useEffect(()=>n._removeUnmounted()),u}var Qx=e=>/^\w*$/.test(e),e3=e=>Kd(e.replace(/["|']|\]/g,"").split(/\.|\[/));function wt(e,t,n){let r=-1;const o=Qx(t)?[t]:e3(t),i=o.length,s=i-1;for(;++r<i;){const l=o[r];let u=n;if(r!==s){const f=e[l];u=sn(f)||Array.isArray(f)?f:isNaN(+o[r+1])?{}:[]}e[l]=u,e=e[l]}return e}function IY(e){const t=hg(),{name:n,disabled:r,control:o=t.control,shouldUnregister:i}=e,s=Yk(o._names.array,n),l=DY({control:o,name:n,defaultValue:ye(o._formValues,n,ye(o._defaultValues,n,e.defaultValue)),exact:!0}),u=NY({control:o,name:n}),f=Be.useRef(o.register(n,{...e.rules,value:l}));return f.current=o.register(n,e.rules),Be.useEffect(()=>{const m=o._options.shouldUnregister||i,p=(g,y)=>{const x=ye(o._fields,g);x&&(x._f.mount=y)};if(p(n,!0),m){const g=uo(ye(o._options.defaultValues,n));wt(o._defaultValues,n,g),Wt(ye(o._formValues,n))&&wt(o._formValues,n,g)}return()=>{(s?m&&!o._state.action:m)?o.unregister(n):p(n,!1)}},[n,o,s,i]),Be.useEffect(()=>{ye(o._fields,n)&&o._updateDisabledField({disabled:r,fields:o._fields,name:n,value:ye(o._fields,n)._f.value})},[r,n,o]),{field:{name:n,value:l,...Uo(r)||Uo(u.disabled)?{disabled:u.disabled||r}:{},onChange:Be.useCallback(m=>f.current.onChange({target:{value:Gk(m),name:n},type:Gp.CHANGE}),[n]),onBlur:Be.useCallback(()=>f.current.onBlur({target:{value:ye(o._formValues,n),name:n},type:Gp.BLUR}),[n,o]),ref:m=>{const p=ye(o._fields,n);p&&m&&(p._f.ref={focus:()=>m.focus(),select:()=>m.select(),setCustomValidity:g=>m.setCustomValidity(g),reportValidity:()=>m.reportValidity()})}},formState:u,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!ye(u.errors,n)},isDirty:{enumerable:!0,get:()=>!!ye(u.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!ye(u.touchedFields,n)},error:{enumerable:!0,get:()=>ye(u.errors,n)}})}}const LY=e=>e.render(IY(e));var t3=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},$2=e=>({isOnSubmit:!e||e===xo.onSubmit,isOnBlur:e===xo.onBlur,isOnChange:e===xo.onChange,isOnAll:e===xo.all,isOnTouch:e===xo.onTouched}),R2=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const op=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const i=ye(e,o);if(i){const{_f:s,...l}=i;if(s){if(s.refs&&s.refs[0]&&t(s.refs[0],o)&&!r)break;if(s.ref&&t(s.ref,s.name)&&!r)break}else sn(l)&&op(l,t)}}};var FY=(e,t,n)=>{const r=Kd(ye(e,n));return wt(r,"root",t[n]),wt(e,n,r),e},Jx=e=>e.type==="file",ws=e=>typeof e=="function",Yp=e=>{if(!Zx)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},ip=e=>Ko(e),eb=e=>e.type==="radio",Xp=e=>e instanceof RegExp;const P2={value:!1,isValid:!1},T2={value:!0,isValid:!0};var n3=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Wt(e[0].attributes.value)?Wt(e[0].value)||e[0].value===""?T2:{value:e[0].value,isValid:!0}:T2:P2}return P2};const k2={isValid:!1,value:null};var r3=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,k2):k2;function A2(e,t,n="validate"){if(ip(e)||Array.isArray(e)&&e.every(ip)||Uo(e)&&!e)return{type:n,message:ip(e)?e:"",ref:t}}var cl=e=>sn(e)&&!Xp(e)?e:{value:e,message:""},M2=async(e,t,n,r,o)=>{const{ref:i,refs:s,required:l,maxLength:u,minLength:f,min:m,max:p,pattern:g,validate:y,name:x,valueAsNumber:S,mount:E,disabled:_}=e._f,b=ye(t,x);if(!E||_)return{};const C=s?s[0]:i,R=K=>{r&&C.reportValidity&&(C.setCustomValidity(Uo(K)?"":K||""),C.reportValidity())},k={},O=eb(i),A=Hd(i),I=O||A,z=(S||Jx(i))&&Wt(i.value)&&Wt(b)||Yp(i)&&i.value===""||b===""||Array.isArray(b)&&!b.length,H=t3.bind(null,x,n,k),ie=(K,te,U,re=hi.maxLength,V=hi.minLength)=>{const J=K?te:U;k[x]={type:K?re:V,message:J,ref:i,...H(K?re:V,J)}};if(o?!Array.isArray(b)||!b.length:l&&(!I&&(z||Fn(b))||Uo(b)&&!b||A&&!n3(s).isValid||O&&!r3(s).isValid)){const{value:K,message:te}=ip(l)?{value:!!l,message:l}:cl(l);if(K&&(k[x]={type:hi.required,message:te,ref:C,...H(hi.required,te)},!n))return R(te),k}if(!z&&(!Fn(m)||!Fn(p))){let K,te;const U=cl(p),re=cl(m);if(!Fn(b)&&!isNaN(b)){const V=i.valueAsNumber||b&&+b;Fn(U.value)||(K=V>U.value),Fn(re.value)||(te=V<re.value)}else{const V=i.valueAsDate||new Date(b),J=Q=>new Date(new Date().toDateString()+" "+Q),G=i.type=="time",Z=i.type=="week";Ko(U.value)&&b&&(K=G?J(b)>J(U.value):Z?b>U.value:V>new Date(U.value)),Ko(re.value)&&b&&(te=G?J(b)<J(re.value):Z?b<re.value:V<new Date(re.value))}if((K||te)&&(ie(!!K,U.message,re.message,hi.max,hi.min),!n))return R(k[x].message),k}if((u||f)&&!z&&(Ko(b)||o&&Array.isArray(b))){const K=cl(u),te=cl(f),U=!Fn(K.value)&&b.length>+K.value,re=!Fn(te.value)&&b.length<+te.value;if((U||re)&&(ie(U,K.message,te.message),!n))return R(k[x].message),k}if(g&&!z&&Ko(b)){const{value:K,message:te}=cl(g);if(Xp(K)&&!b.match(K)&&(k[x]={type:hi.pattern,message:te,ref:i,...H(hi.pattern,te)},!n))return R(te),k}if(y){if(ws(y)){const K=await y(b,t),te=A2(K,C);if(te&&(k[x]={...te,...H(hi.validate,te.message)},!n))return R(te.message),k}else if(sn(y)){let K={};for(const te in y){if(!Fr(K)&&!n)break;const U=A2(await y[te](b,t),C,te);U&&(K={...U,...H(te,U.message)},R(U.message),n&&(k[x]=K))}if(!Fr(K)&&(k[x]={ref:C,...K},!n))return k}}return R(!0),k};function jY(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=Wt(e)?r++:e[t[r++]];return e}function BY(e){for(const t in e)if(e.hasOwnProperty(t)&&!Wt(e[t]))return!1;return!0}function pn(e,t){const n=Array.isArray(t)?t:Qx(t)?[t]:e3(t),r=n.length===1?e:jY(e,n),o=n.length-1,i=n[o];return r&&delete r[i],o!==0&&(sn(r)&&Fr(r)||Array.isArray(r)&&BY(r))&&pn(e,n.slice(0,-1)),e}function j0(){let e=[];return{get observers(){return e},next:o=>{for(const i of e)i.next&&i.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(i=>i!==o)}}),unsubscribe:()=>{e=[]}}}var Zp=e=>Fn(e)||!Kk(e);function va(e,t){if(Zp(e)||Zp(t))return e===t;if(Tl(e)&&Tl(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n){const i=e[o];if(!r.includes(o))return!1;if(o!=="ref"){const s=t[o];if(Tl(i)&&Tl(s)||sn(i)&&sn(s)||Array.isArray(i)&&Array.isArray(s)?!va(i,s):i!==s)return!1}}return!0}var o3=e=>e.type==="select-multiple",zY=e=>eb(e)||Hd(e),B0=e=>Yp(e)&&e.isConnected,i3=e=>{for(const t in e)if(ws(e[t]))return!0;return!1};function qp(e,t={}){const n=Array.isArray(e);if(sn(e)||n)for(const r in e)Array.isArray(e[r])||sn(e[r])&&!i3(e[r])?(t[r]=Array.isArray(e[r])?[]:{},qp(e[r],t[r])):Fn(e[r])||(t[r]=!0);return t}function s3(e,t,n){const r=Array.isArray(e);if(sn(e)||r)for(const o in e)Array.isArray(e[o])||sn(e[o])&&!i3(e[o])?Wt(t)||Zp(n[o])?n[o]=Array.isArray(e[o])?qp(e[o],[]):{...qp(e[o])}:s3(e[o],Fn(t)?{}:t[o],n[o]):n[o]=!va(e[o],t[o]);return n}var z0=(e,t)=>s3(e,t,qp(t)),a3=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Wt(e)?e:t?e===""?NaN:e&&+e:n&&Ko(e)?new Date(e):r?r(e):e;function U0(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return Jx(t)?t.files:eb(t)?r3(e.refs).value:o3(t)?[...t.selectedOptions].map(({value:n})=>n):Hd(t)?n3(e.refs).value:a3(Wt(t.value)?e.ref.value:t.value,e)}var UY=(e,t,n,r)=>{const o={};for(const i of e){const s=ye(t,i);s&&wt(o,i,s._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},uu=e=>Wt(e)?e:Xp(e)?e.source:sn(e)?Xp(e.value)?e.value.source:e.value:e,VY=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function O2(e,t,n){const r=ye(e,n);if(r||Qx(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const i=o.join("."),s=ye(t,i),l=ye(e,i);if(s&&!Array.isArray(s)&&n!==i)return{name:n};if(l&&l.type)return{name:i,error:l};o.pop()}return{name:n}}var WY=(e,t,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:(n?r.isOnChange:o.isOnChange)?e:!0,HY=(e,t)=>!Kd(ye(e,t)).length&&pn(e,t);const KY={mode:xo.onSubmit,reValidateMode:xo.onChange,shouldFocusError:!0};function GY(e={},t){let n={...KY,...e},r={submitCount:0,isDirty:!1,isLoading:ws(n.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{},disabled:!1},o={},i=sn(n.defaultValues)||sn(n.values)?uo(n.defaultValues||n.values)||{}:{},s=n.shouldUnregister?{}:uo(i),l={action:!1,mount:!1,watch:!1},u={mount:new Set,unMount:new Set,array:new Set,watch:new Set},f,m=0;const p={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},g={values:j0(),array:j0(),state:j0()},y=e.resetOptions&&e.resetOptions.keepDirtyValues,x=$2(n.mode),S=$2(n.reValidateMode),E=n.criteriaMode===xo.all,_=N=>X=>{clearTimeout(m),m=setTimeout(N,X)},b=async N=>{if(p.isValid||N){const X=n.resolver?Fr((await z()).errors):await ie(o,!0);X!==r.isValid&&g.state.next({isValid:X})}},C=N=>p.isValidating&&g.state.next({isValidating:N}),R=(N,X=[],ee,Se,pe=!0,he=!0)=>{if(Se&&ee){if(l.action=!0,he&&Array.isArray(ye(o,N))){const Te=ee(ye(o,N),Se.argA,Se.argB);pe&&wt(o,N,Te)}if(he&&Array.isArray(ye(r.errors,N))){const Te=ee(ye(r.errors,N),Se.argA,Se.argB);pe&&wt(r.errors,N,Te),HY(r.errors,N)}if(p.touchedFields&&he&&Array.isArray(ye(r.touchedFields,N))){const Te=ee(ye(r.touchedFields,N),Se.argA,Se.argB);pe&&wt(r.touchedFields,N,Te)}p.dirtyFields&&(r.dirtyFields=z0(i,s)),g.state.next({name:N,isDirty:te(N,X),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else wt(s,N,X)},k=(N,X)=>{wt(r.errors,N,X),g.state.next({errors:r.errors})},O=(N,X,ee,Se)=>{const pe=ye(o,N);if(pe){const he=ye(s,N,Wt(ee)?ye(i,N):ee);Wt(he)||Se&&Se.defaultChecked||X?wt(s,N,X?he:U0(pe._f)):V(N,he),l.mount&&b()}},A=(N,X,ee,Se,pe)=>{let he=!1,Te=!1;const ut={name:N};if(!ee||Se){p.isDirty&&(Te=r.isDirty,r.isDirty=ut.isDirty=te(),he=Te!==ut.isDirty);const gt=va(ye(i,N),X);Te=ye(r.dirtyFields,N),gt?pn(r.dirtyFields,N):wt(r.dirtyFields,N,!0),ut.dirtyFields=r.dirtyFields,he=he||p.dirtyFields&&Te!==!gt}if(ee){const gt=ye(r.touchedFields,N);gt||(wt(r.touchedFields,N,ee),ut.touchedFields=r.touchedFields,he=he||p.touchedFields&&gt!==ee)}return he&&pe&&g.state.next(ut),he?ut:{}},I=(N,X,ee,Se)=>{const pe=ye(r.errors,N),he=p.isValid&&Uo(X)&&r.isValid!==X;if(e.delayError&&ee?(f=_(()=>k(N,ee)),f(e.delayError)):(clearTimeout(m),f=null,ee?wt(r.errors,N,ee):pn(r.errors,N)),(ee?!va(pe,ee):pe)||!Fr(Se)||he){const Te={...Se,...he&&Uo(X)?{isValid:X}:{},errors:r.errors,name:N};r={...r,...Te},g.state.next(Te)}C(!1)},z=async N=>n.resolver(s,n.context,UY(N||u.mount,o,n.criteriaMode,n.shouldUseNativeValidation)),H=async N=>{const{errors:X}=await z(N);if(N)for(const ee of N){const Se=ye(X,ee);Se?wt(r.errors,ee,Se):pn(r.errors,ee)}else r.errors=X;return X},ie=async(N,X,ee={valid:!0})=>{for(const Se in N){const pe=N[Se];if(pe){const{_f:he,...Te}=pe;if(he){const ut=u.array.has(he.name),gt=await M2(pe,s,E,n.shouldUseNativeValidation&&!X,ut);if(gt[he.name]&&(ee.valid=!1,X))break;!X&&(ye(gt,he.name)?ut?FY(r.errors,gt,he.name):wt(r.errors,he.name,gt[he.name]):pn(r.errors,he.name))}Te&&await ie(Te,X,ee)}}return ee.valid},K=()=>{for(const N of u.unMount){const X=ye(o,N);X&&(X._f.refs?X._f.refs.every(ee=>!B0(ee)):!B0(X._f.ref))&&me(N)}u.unMount=new Set},te=(N,X)=>(N&&X&&wt(s,N,X),!va(L(),i)),U=(N,X,ee)=>Jk(N,u,{...l.mount?s:Wt(X)?i:Ko(N)?{[N]:X}:X},ee,X),re=N=>Kd(ye(l.mount?s:i,N,e.shouldUnregister?ye(i,N,[]):[])),V=(N,X,ee={})=>{const Se=ye(o,N);let pe=X;if(Se){const he=Se._f;he&&(!he.disabled&&wt(s,N,a3(X,he)),pe=Yp(he.ref)&&Fn(X)?"":X,o3(he.ref)?[...he.ref.options].forEach(Te=>Te.selected=pe.includes(Te.value)):he.refs?Hd(he.ref)?he.refs.length>1?he.refs.forEach(Te=>(!Te.defaultChecked||!Te.disabled)&&(Te.checked=Array.isArray(pe)?!!pe.find(ut=>ut===Te.value):pe===Te.value)):he.refs[0]&&(he.refs[0].checked=!!pe):he.refs.forEach(Te=>Te.checked=Te.value===pe):Jx(he.ref)?he.ref.value="":(he.ref.value=pe,he.ref.type||g.values.next({name:N,values:{...s}})))}(ee.shouldDirty||ee.shouldTouch)&&A(N,pe,ee.shouldTouch,ee.shouldDirty,!0),ee.shouldValidate&&le(N)},J=(N,X,ee)=>{for(const Se in X){const pe=X[Se],he=`${N}.${Se}`,Te=ye(o,he);(u.array.has(N)||!Zp(pe)||Te&&!Te._f)&&!Tl(pe)?J(he,pe,ee):V(he,pe,ee)}},G=(N,X,ee={})=>{const Se=ye(o,N),pe=u.array.has(N),he=uo(X);wt(s,N,he),pe?(g.array.next({name:N,values:{...s}}),(p.isDirty||p.dirtyFields)&&ee.shouldDirty&&g.state.next({name:N,dirtyFields:z0(i,s),isDirty:te(N,he)})):Se&&!Se._f&&!Fn(he)?J(N,he,ee):V(N,he,ee),R2(N,u)&&g.state.next({...r}),g.values.next({name:N,values:{...s}}),!l.mount&&t()},Z=async N=>{const X=N.target;let ee=X.name,Se=!0;const pe=ye(o,ee),he=()=>X.type?U0(pe._f):Gk(N),Te=ut=>{Se=Number.isNaN(ut)||ut===ye(s,ee,ut)};if(pe){let ut,gt;const An=he(),Mn=N.type===Gp.BLUR||N.type===Gp.FOCUS_OUT,Fi=!VY(pe._f)&&!n.resolver&&!ye(r.errors,ee)&&!pe._f.deps||WY(Mn,ye(r.touchedFields,ee),r.isSubmitted,S,x),Ro=R2(ee,u,Mn);wt(s,ee,An),Mn?(pe._f.onBlur&&pe._f.onBlur(N),f&&f(0)):pe._f.onChange&&pe._f.onChange(N);const Cr=A(ee,An,Mn,!1),Ks=!Fr(Cr)||Ro;if(!Mn&&g.values.next({name:ee,type:N.type,values:{...s}}),Fi)return p.isValid&&b(),Ks&&g.state.next({name:ee,...Ro?{}:Cr});if(!Mn&&Ro&&g.state.next({...r}),C(!0),n.resolver){const{errors:ri}=await z([ee]);if(Te(An),Se){const ji=O2(r.errors,o,ee),or=O2(ri,o,ji.name||ee);ut=or.error,ee=or.name,gt=Fr(ri)}}else ut=(await M2(pe,s,E,n.shouldUseNativeValidation))[ee],Te(An),Se&&(ut?gt=!1:p.isValid&&(gt=await ie(o,!0)));Se&&(pe._f.deps&&le(pe._f.deps),I(ee,gt,ut,Cr))}},Q=(N,X)=>{if(ye(r.errors,X)&&N.focus)return N.focus(),1},le=async(N,X={})=>{let ee,Se;const pe=rp(N);if(C(!0),n.resolver){const he=await H(Wt(N)?N:pe);ee=Fr(he),Se=N?!pe.some(Te=>ye(he,Te)):ee}else N?(Se=(await Promise.all(pe.map(async he=>{const Te=ye(o,he);return await ie(Te&&Te._f?{[he]:Te}:Te)}))).every(Boolean),!(!Se&&!r.isValid)&&b()):Se=ee=await ie(o);return g.state.next({...!Ko(N)||p.isValid&&ee!==r.isValid?{}:{name:N},...n.resolver||!N?{isValid:ee}:{},errors:r.errors,isValidating:!1}),X.shouldFocus&&!Se&&op(o,Q,N?pe:u.mount),Se},L=N=>{const X={...i,...l.mount?s:{}};return Wt(N)?X:Ko(N)?ye(X,N):N.map(ee=>ye(X,ee))},ue=(N,X)=>({invalid:!!ye((X||r).errors,N),isDirty:!!ye((X||r).dirtyFields,N),isTouched:!!ye((X||r).touchedFields,N),error:ye((X||r).errors,N)}),Ne=N=>{N&&rp(N).forEach(X=>pn(r.errors,X)),g.state.next({errors:N?r.errors:{}})},Ke=(N,X,ee)=>{const Se=(ye(o,N,{_f:{}})._f||{}).ref;wt(r.errors,N,{...X,ref:Se}),g.state.next({name:N,errors:r.errors,isValid:!1}),ee&&ee.shouldFocus&&Se&&Se.focus&&Se.focus()},Me=(N,X)=>ws(N)?g.values.subscribe({next:ee=>N(U(void 0,X),ee)}):U(N,X,!0),me=(N,X={})=>{for(const ee of N?rp(N):u.mount)u.mount.delete(ee),u.array.delete(ee),X.keepValue||(pn(o,ee),pn(s,ee)),!X.keepError&&pn(r.errors,ee),!X.keepDirty&&pn(r.dirtyFields,ee),!X.keepTouched&&pn(r.touchedFields,ee),!n.shouldUnregister&&!X.keepDefaultValue&&pn(i,ee);g.values.next({values:{...s}}),g.state.next({...r,...X.keepDirty?{isDirty:te()}:{}}),!X.keepIsValid&&b()},be=({disabled:N,name:X,field:ee,fields:Se,value:pe})=>{if(Uo(N)){const he=N?void 0:Wt(pe)?U0(ee?ee._f:ye(Se,X)._f):pe;wt(s,X,he),A(X,he,!1,!1,!0)}},Ee=(N,X={})=>{let ee=ye(o,N);const Se=Uo(X.disabled);return wt(o,N,{...ee||{},_f:{...ee&&ee._f?ee._f:{ref:{name:N}},name:N,mount:!0,...X}}),u.mount.add(N),ee?be({field:ee,disabled:X.disabled,name:N}):O(N,!0,X.value),{...Se?{disabled:X.disabled}:{},...n.progressive?{required:!!X.required,min:uu(X.min),max:uu(X.max),minLength:uu(X.minLength),maxLength:uu(X.maxLength),pattern:uu(X.pattern)}:{},name:N,onChange:Z,onBlur:Z,ref:pe=>{if(pe){Ee(N,X),ee=ye(o,N);const he=Wt(pe.value)&&pe.querySelectorAll&&pe.querySelectorAll("input,select,textarea")[0]||pe,Te=zY(he),ut=ee._f.refs||[];if(Te?ut.find(gt=>gt===he):he===ee._f.ref)return;wt(o,N,{_f:{...ee._f,...Te?{refs:[...ut.filter(B0),he,...Array.isArray(ye(i,N))?[{}]:[]],ref:{type:he.type,name:N}}:{ref:he}}}),O(N,!1,void 0,he)}else ee=ye(o,N,{}),ee._f&&(ee._f.mount=!1),(n.shouldUnregister||X.shouldUnregister)&&!(Yk(u.array,N)&&l.action)&&u.unMount.add(N)}}},Oe=()=>n.shouldFocusError&&op(o,Q,u.mount),Ie=N=>{Uo(N)&&(g.state.next({disabled:N}),op(o,X=>{X.disabled=N},0,!1))},ze=(N,X)=>async ee=>{ee&&(ee.preventDefault&&ee.preventDefault(),ee.persist&&ee.persist());let Se=uo(s);if(g.state.next({isSubmitting:!0}),n.resolver){const{errors:pe,values:he}=await z();r.errors=pe,Se=he}else await ie(o);pn(r.errors,"root"),Fr(r.errors)?(g.state.next({errors:{}}),await N(Se,ee)):(X&&await X({...r.errors},ee),Oe(),setTimeout(Oe)),g.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Fr(r.errors),submitCount:r.submitCount+1,errors:r.errors})},ht=(N,X={})=>{ye(o,N)&&(Wt(X.defaultValue)?G(N,ye(i,N)):(G(N,X.defaultValue),wt(i,N,X.defaultValue)),X.keepTouched||pn(r.touchedFields,N),X.keepDirty||(pn(r.dirtyFields,N),r.isDirty=X.defaultValue?te(N,ye(i,N)):te()),X.keepError||(pn(r.errors,N),p.isValid&&b()),g.state.next({...r}))},st=(N,X={})=>{const ee=N?uo(N):i,Se=uo(ee),pe=N&&!Fr(N)?Se:i;if(X.keepDefaultValues||(i=ee),!X.keepValues){if(X.keepDirtyValues||y)for(const he of u.mount)ye(r.dirtyFields,he)?wt(pe,he,ye(s,he)):G(he,ye(pe,he));else{if(Zx&&Wt(N))for(const he of u.mount){const Te=ye(o,he);if(Te&&Te._f){const ut=Array.isArray(Te._f.refs)?Te._f.refs[0]:Te._f.ref;if(Yp(ut)){const gt=ut.closest("form");if(gt){gt.reset();break}}}}o={}}s=e.shouldUnregister?X.keepDefaultValues?uo(i):{}:uo(pe),g.array.next({values:{...pe}}),g.values.next({values:{...pe}})}u={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!l.mount&&t(),l.mount=!p.isValid||!!X.keepIsValid,l.watch=!!e.shouldUnregister,g.state.next({submitCount:X.keepSubmitCount?r.submitCount:0,isDirty:X.keepDirty?r.isDirty:!!(X.keepDefaultValues&&!va(N,i)),isSubmitted:X.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:X.keepDirtyValues?r.dirtyFields:X.keepDefaultValues&&N?z0(i,N):{},touchedFields:X.keepTouched?r.touchedFields:{},errors:X.keepErrors?r.errors:{},isSubmitSuccessful:X.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},Yt=(N,X)=>st(ws(N)?N(s):N,X);return{control:{register:Ee,unregister:me,getFieldState:ue,handleSubmit:ze,setError:Ke,_executeSchema:z,_getWatch:U,_getDirty:te,_updateValid:b,_removeUnmounted:K,_updateFieldArray:R,_updateDisabledField:be,_getFieldArray:re,_reset:st,_resetDefaultValues:()=>ws(n.defaultValues)&&n.defaultValues().then(N=>{Yt(N,n.resetOptions),g.state.next({isLoading:!1})}),_updateFormState:N=>{r={...r,...N}},_disableForm:Ie,_subjects:g,_proxyFormState:p,get _fields(){return o},get _formValues(){return s},get _state(){return l},set _state(N){l=N},get _defaultValues(){return i},get _names(){return u},set _names(N){u=N},get _formState(){return r},set _formState(N){r=N},get _options(){return n},set _options(N){n={...n,...N}}},trigger:le,register:Ee,handleSubmit:ze,watch:Me,setValue:G,getValues:L,reset:Yt,resetField:ht,clearErrors:Ne,unregister:me,setError:Ke,setFocus:(N,X={})=>{const ee=ye(o,N),Se=ee&&ee._f;if(Se){const pe=Se.refs?Se.refs[0]:Se.ref;pe.focus&&(pe.focus(),X.shouldSelect&&pe.select())}},getFieldState:ue}}function YY(e={}){const t=Be.useRef(),n=Be.useRef(),[r,o]=Be.useState({isDirty:!1,isValidating:!1,isLoading:ws(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},disabled:!1,defaultValues:ws(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...GY(e,()=>o(s=>({...s}))),formState:r});const i=t.current.control;return i._options=e,qx({subject:i._subjects.state,next:s=>{qk(s,i._proxyFormState,i._updateFormState,!0)&&o({...i._formState})}}),Be.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),Be.useEffect(()=>{if(i._proxyFormState.isDirty){const s=i._getDirty();s!==r.isDirty&&i._subjects.state.next({isDirty:s})}},[i,r.isDirty]),Be.useEffect(()=>{e.values&&!va(e.values,n.current)?(i._reset(e.values,i._options.resetOptions),n.current=e.values):i._resetDefaultValues()},[e.values,i]),Be.useEffect(()=>{i._state.mount||(i._updateValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=Zk(r,i),t.current}var N2=function(e,t,n){if(e&&"reportValidity"in e){var r=ye(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},l3=function(e,t){var n=function(o){var i=t.fields[o];i&&i.ref&&"reportValidity"in i.ref?N2(i.ref,o,e):i.refs&&i.refs.forEach(function(s){return N2(s,o,e)})};for(var r in t.fields)n(r)},XY=function(e,t){t.shouldUseNativeValidation&&l3(e,t);var n={};for(var r in e){var o=ye(t.fields,r),i=Object.assign(e[r]||{},{ref:o&&o.ref});if(qY(t.names||Object.keys(e),r)){var s=Object.assign({},ZY(ye(n,r)));wt(s,"root",i),wt(n,r,s)}else wt(n,r,i)}return n},ZY=function(e){return Array.isArray(e)?e.filter(Boolean):[]},qY=function(e,t){return e.some(function(n){return n.startsWith(t+".")})},QY=function(e,t){for(var n={};e.length;){var r=e[0],o=r.code,i=r.message,s=r.path.join(".");if(!n[s])if("unionErrors"in r){var l=r.unionErrors[0].errors[0];n[s]={message:l.message,type:l.code}}else n[s]={message:i,type:o};if("unionErrors"in r&&r.unionErrors.forEach(function(m){return m.errors.forEach(function(p){return e.push(p)})}),t){var u=n[s].types,f=u&&u[r.code];n[s]=t3(s,t,n,o,f?[].concat(f,r.message):r.message)}e.shift()}return n},JY=function(e,t,n){return n===void 0&&(n={}),function(r,o,i){try{return Promise.resolve(function(s,l){try{var u=Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(f){return i.shouldUseNativeValidation&&l3({},i),{errors:{},values:n.raw?r:f}})}catch(f){return l(f)}return u&&u.then?u.then(void 0,l):u}(0,function(s){if(function(l){return l.errors!=null}(s))return{values:{},errors:XY(QY(s.errors,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw s}))}catch(s){return Promise.reject(s)}}},mt;(function(e){e.assertEqual=o=>o;function t(o){}e.assertIs=t;function n(o){throw new Error}e.assertNever=n,e.arrayToEnum=o=>{const i={};for(const s of o)i[s]=s;return i},e.getValidEnumValues=o=>{const i=e.objectKeys(o).filter(l=>typeof o[o[l]]!="number"),s={};for(const l of i)s[l]=o[l];return e.objectValues(s)},e.objectValues=o=>e.objectKeys(o).map(function(i){return o[i]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const i=[];for(const s in o)Object.prototype.hasOwnProperty.call(o,s)&&i.push(s);return i},e.find=(o,i)=>{for(const s of o)if(i(s))return s},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&isFinite(o)&&Math.floor(o)===o;function r(o,i=" | "){return o.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}e.joinValues=r,e.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(mt||(mt={}));var D2;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(D2||(D2={}));const _e=mt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),da=e=>{switch(typeof e){case"undefined":return _e.undefined;case"string":return _e.string;case"number":return isNaN(e)?_e.nan:_e.number;case"boolean":return _e.boolean;case"function":return _e.function;case"bigint":return _e.bigint;case"symbol":return _e.symbol;case"object":return Array.isArray(e)?_e.array:e===null?_e.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?_e.promise:typeof Map<"u"&&e instanceof Map?_e.map:typeof Set<"u"&&e instanceof Set?_e.set:typeof Date<"u"&&e instanceof Date?_e.date:_e.object;default:return _e.unknown}},ge=mt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Xo extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(i){return i.message},r={_errors:[]},o=i=>{for(const s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(o);else if(s.code==="invalid_return_type")o(s.returnTypeError);else if(s.code==="invalid_arguments")o(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let l=r,u=0;for(;u<s.path.length;){const f=s.path[u];u===s.path.length-1?(l[f]=l[f]||{_errors:[]},l[f]._errors.push(n(s))):l[f]=l[f]||{_errors:[]},l=l[f],u++}}};return o(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,mt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const o of this.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Xo.create=e=>new Xo(e);const Qp=(e,t)=>{let n;switch(e.code){case ge.invalid_type:e.received===_e.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case ge.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,mt.jsonStringifyReplacer)}`;break;case ge.unrecognized_keys:n=`Unrecognized key(s) in object: ${mt.joinValues(e.keys,", ")}`;break;case ge.invalid_union:n="Invalid input";break;case ge.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${mt.joinValues(e.options)}`;break;case ge.invalid_enum_value:n=`Invalid enum value. Expected ${mt.joinValues(e.options)}, received '${e.received}'`;break;case ge.invalid_arguments:n="Invalid function arguments";break;case ge.invalid_return_type:n="Invalid function return type";break;case ge.invalid_date:n="Invalid date";break;case ge.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:mt.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case ge.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case ge.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case ge.custom:n="Invalid input";break;case ge.invalid_intersection_types:n="Intersection results could not be merged";break;case ge.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case ge.not_finite:n="Number must be finite";break;default:n=t.defaultError,mt.assertNever(e)}return{message:n}};let eX=Qp;function T1(){return eX}const k1=e=>{const{data:t,path:n,errorMaps:r,issueData:o}=e,i=[...n,...o.path||[]],s={...o,path:i};let l="";const u=r.filter(f=>!!f).slice().reverse();for(const f of u)l=f(s,{data:t,defaultError:l}).message;return{...o,path:i,message:o.message||l}};function Re(e,t){const n=k1({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,T1(),Qp].filter(r=>!!r)});e.common.issues.push(n)}class Bn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const o of n){if(o.status==="aborted")return Ze;o.status==="dirty"&&t.dirty(),r.push(o.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const o of n)r.push({key:await o.key,value:await o.value});return Bn.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const o of n){const{key:i,value:s}=o;if(i.status==="aborted"||s.status==="aborted")return Ze;i.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof s.value<"u"||o.alwaysSet)&&(r[i.value]=s.value)}return{status:t.value,value:r}}}const Ze=Object.freeze({status:"aborted"}),tX=e=>({status:"dirty",value:e}),nr=e=>({status:"valid",value:e}),I2=e=>e.status==="aborted",L2=e=>e.status==="dirty",Jp=e=>e.status==="valid",A1=e=>typeof Promise<"u"&&e instanceof Promise;var De;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(De||(De={}));class ei{constructor(t,n,r,o){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=o}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const F2=(e,t)=>{if(Jp(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Xo(e.common.issues);return this._error=n,this._error}}};function Xe(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:o}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(s,l)=>s.code!=="invalid_type"?{message:l.defaultError}:typeof l.data>"u"?{message:r??l.defaultError}:{message:n??l.defaultError},description:o}}class rt{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return da(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:da(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Bn,ctx:{common:t.parent.common,data:t.data,parsedType:da(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(A1(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const o={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:da(t)},i=this._parseSync({data:t,path:o.path,parent:o});return F2(o,i)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:da(t)},o=this._parse({data:t,path:r.path,parent:r}),i=await(A1(o)?o:Promise.resolve(o));return F2(r,i)}refine(t,n){const r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,i)=>{const s=t(o),l=()=>i.addIssue({code:ge.custom,...r(o)});return typeof Promise<"u"&&s instanceof Promise?s.then(u=>u?!0:(l(),!1)):s?!0:(l(),!1)})}refinement(t,n){return this._refinement((r,o)=>t(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(t){return new Mi({schema:this,typeName:Ue.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Ts.create(this,this._def)}nullable(){return yc.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Zo.create(this,this._def)}promise(){return pd.create(this,this._def)}or(t){return nm.create([this,t],this._def)}and(t){return rm.create(this,t,this._def)}transform(t){return new Mi({...Xe(this._def),schema:this,typeName:Ue.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new lm({...Xe(this._def),innerType:this,defaultValue:n,typeName:Ue.ZodDefault})}brand(){return new hX({typeName:Ue.ZodBranded,type:this,...Xe(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new F1({...Xe(this._def),innerType:this,catchValue:n,typeName:Ue.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return pg.create(this,t)}readonly(){return B1.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const nX=/^c[^\s-]{8,}$/i,rX=/^[a-z][a-z0-9]*$/,oX=/^[0-9A-HJKMNP-TV-Z]{26}$/,iX=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,sX=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,aX="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let V0;const lX=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,cX=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,uX=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function dX(e,t){return!!((t==="v4"||!t)&&lX.test(e)||(t==="v6"||!t)&&cX.test(e))}class xi extends rt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==_e.string){const i=this._getOrReturnCtx(t);return Re(i,{code:ge.invalid_type,expected:_e.string,received:i.parsedType}),Ze}const r=new Bn;let o;for(const i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(o=this._getOrReturnCtx(t,o),Re(o,{code:ge.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")t.data.length>i.value&&(o=this._getOrReturnCtx(t,o),Re(o,{code:ge.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const s=t.data.length>i.value,l=t.data.length<i.value;(s||l)&&(o=this._getOrReturnCtx(t,o),s?Re(o,{code:ge.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):l&&Re(o,{code:ge.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")sX.test(t.data)||(o=this._getOrReturnCtx(t,o),Re(o,{validation:"email",code:ge.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")V0||(V0=new RegExp(aX,"u")),V0.test(t.data)||(o=this._getOrReturnCtx(t,o),Re(o,{validation:"emoji",code:ge.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")iX.test(t.data)||(o=this._getOrReturnCtx(t,o),Re(o,{validation:"uuid",code:ge.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")nX.test(t.data)||(o=this._getOrReturnCtx(t,o),Re(o,{validation:"cuid",code:ge.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")rX.test(t.data)||(o=this._getOrReturnCtx(t,o),Re(o,{validation:"cuid2",code:ge.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")oX.test(t.data)||(o=this._getOrReturnCtx(t,o),Re(o,{validation:"ulid",code:ge.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),Re(o,{validation:"url",code:ge.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),Re(o,{validation:"regex",code:ge.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(t,o),Re(o,{code:ge.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(o=this._getOrReturnCtx(t,o),Re(o,{code:ge.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(o=this._getOrReturnCtx(t,o),Re(o,{code:ge.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?uX(i).test(t.data)||(o=this._getOrReturnCtx(t,o),Re(o,{code:ge.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="ip"?dX(t.data,i.version)||(o=this._getOrReturnCtx(t,o),Re(o,{validation:"ip",code:ge.invalid_string,message:i.message}),r.dirty()):mt.assertNever(i);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(o=>t.test(o),{validation:n,code:ge.invalid_string,...De.errToObj(r)})}_addCheck(t){return new xi({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...De.errToObj(t)})}url(t){return this._addCheck({kind:"url",...De.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...De.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...De.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...De.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...De.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...De.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...De.errToObj(t)})}datetime(t){var n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,...De.errToObj(t==null?void 0:t.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...De.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...De.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...De.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...De.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...De.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...De.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...De.errToObj(n)})}nonempty(t){return this.min(1,De.errToObj(t))}trim(){return new xi({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new xi({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new xi({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}xi.create=e=>{var t;return new xi({checks:[],typeName:Ue.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Xe(e)})};function fX(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,o=n>r?n:r,i=parseInt(e.toFixed(o).replace(".","")),s=parseInt(t.toFixed(o).replace(".",""));return i%s/Math.pow(10,o)}class mc extends rt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==_e.number){const i=this._getOrReturnCtx(t);return Re(i,{code:ge.invalid_type,expected:_e.number,received:i.parsedType}),Ze}let r;const o=new Bn;for(const i of this._def.checks)i.kind==="int"?mt.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),Re(r,{code:ge.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),Re(r,{code:ge.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),Re(r,{code:ge.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?fX(t.data,i.value)!==0&&(r=this._getOrReturnCtx(t,r),Re(r,{code:ge.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),Re(r,{code:ge.not_finite,message:i.message}),o.dirty()):mt.assertNever(i);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,De.toString(n))}gt(t,n){return this.setLimit("min",t,!1,De.toString(n))}lte(t,n){return this.setLimit("max",t,!0,De.toString(n))}lt(t,n){return this.setLimit("max",t,!1,De.toString(n))}setLimit(t,n,r,o){return new mc({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:De.toString(o)}]})}_addCheck(t){return new mc({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:De.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:De.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:De.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:De.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:De.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:De.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:De.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:De.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:De.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&mt.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}mc.create=e=>new mc({checks:[],typeName:Ue.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Xe(e)});class gc extends rt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==_e.bigint){const i=this._getOrReturnCtx(t);return Re(i,{code:ge.invalid_type,expected:_e.bigint,received:i.parsedType}),Ze}let r;const o=new Bn;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),Re(r,{code:ge.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),Re(r,{code:ge.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),Re(r,{code:ge.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):mt.assertNever(i);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,De.toString(n))}gt(t,n){return this.setLimit("min",t,!1,De.toString(n))}lte(t,n){return this.setLimit("max",t,!0,De.toString(n))}lt(t,n){return this.setLimit("max",t,!1,De.toString(n))}setLimit(t,n,r,o){return new gc({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:De.toString(o)}]})}_addCheck(t){return new gc({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:De.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:De.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:De.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:De.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:De.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}gc.create=e=>{var t;return new gc({checks:[],typeName:Ue.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Xe(e)})};class M1 extends rt{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==_e.boolean){const r=this._getOrReturnCtx(t);return Re(r,{code:ge.invalid_type,expected:_e.boolean,received:r.parsedType}),Ze}return nr(t.data)}}M1.create=e=>new M1({typeName:Ue.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Xe(e)});class hd extends rt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==_e.date){const i=this._getOrReturnCtx(t);return Re(i,{code:ge.invalid_type,expected:_e.date,received:i.parsedType}),Ze}if(isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return Re(i,{code:ge.invalid_date}),Ze}const r=new Bn;let o;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(o=this._getOrReturnCtx(t,o),Re(o,{code:ge.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(o=this._getOrReturnCtx(t,o),Re(o,{code:ge.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):mt.assertNever(i);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new hd({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:De.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:De.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}hd.create=e=>new hd({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Ue.ZodDate,...Xe(e)});class O1 extends rt{_parse(t){if(this._getType(t)!==_e.symbol){const r=this._getOrReturnCtx(t);return Re(r,{code:ge.invalid_type,expected:_e.symbol,received:r.parsedType}),Ze}return nr(t.data)}}O1.create=e=>new O1({typeName:Ue.ZodSymbol,...Xe(e)});class em extends rt{_parse(t){if(this._getType(t)!==_e.undefined){const r=this._getOrReturnCtx(t);return Re(r,{code:ge.invalid_type,expected:_e.undefined,received:r.parsedType}),Ze}return nr(t.data)}}em.create=e=>new em({typeName:Ue.ZodUndefined,...Xe(e)});class tm extends rt{_parse(t){if(this._getType(t)!==_e.null){const r=this._getOrReturnCtx(t);return Re(r,{code:ge.invalid_type,expected:_e.null,received:r.parsedType}),Ze}return nr(t.data)}}tm.create=e=>new tm({typeName:Ue.ZodNull,...Xe(e)});class N1 extends rt{constructor(){super(...arguments),this._any=!0}_parse(t){return nr(t.data)}}N1.create=e=>new N1({typeName:Ue.ZodAny,...Xe(e)});class Ll extends rt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return nr(t.data)}}Ll.create=e=>new Ll({typeName:Ue.ZodUnknown,...Xe(e)});class Is extends rt{_parse(t){const n=this._getOrReturnCtx(t);return Re(n,{code:ge.invalid_type,expected:_e.never,received:n.parsedType}),Ze}}Is.create=e=>new Is({typeName:Ue.ZodNever,...Xe(e)});class D1 extends rt{_parse(t){if(this._getType(t)!==_e.undefined){const r=this._getOrReturnCtx(t);return Re(r,{code:ge.invalid_type,expected:_e.void,received:r.parsedType}),Ze}return nr(t.data)}}D1.create=e=>new D1({typeName:Ue.ZodVoid,...Xe(e)});class Zo extends rt{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),o=this._def;if(n.parsedType!==_e.array)return Re(n,{code:ge.invalid_type,expected:_e.array,received:n.parsedType}),Ze;if(o.exactLength!==null){const s=n.data.length>o.exactLength.value,l=n.data.length<o.exactLength.value;(s||l)&&(Re(n,{code:s?ge.too_big:ge.too_small,minimum:l?o.exactLength.value:void 0,maximum:s?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),r.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(Re(n,{code:ge.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),r.dirty()),o.maxLength!==null&&n.data.length>o.maxLength.value&&(Re(n,{code:ge.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,l)=>o.type._parseAsync(new ei(n,s,n.path,l)))).then(s=>Bn.mergeArray(r,s));const i=[...n.data].map((s,l)=>o.type._parseSync(new ei(n,s,n.path,l)));return Bn.mergeArray(r,i)}get element(){return this._def.type}min(t,n){return new Zo({...this._def,minLength:{value:t,message:De.toString(n)}})}max(t,n){return new Zo({...this._def,maxLength:{value:t,message:De.toString(n)}})}length(t,n){return new Zo({...this._def,exactLength:{value:t,message:De.toString(n)}})}nonempty(t){return this.min(1,t)}}Zo.create=(e,t)=>new Zo({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ue.ZodArray,...Xe(t)});function pl(e){if(e instanceof Ut){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Ts.create(pl(r))}return new Ut({...e._def,shape:()=>t})}else return e instanceof Zo?new Zo({...e._def,type:pl(e.element)}):e instanceof Ts?Ts.create(pl(e.unwrap())):e instanceof yc?yc.create(pl(e.unwrap())):e instanceof Ai?Ai.create(e.items.map(t=>pl(t))):e}class Ut extends rt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=mt.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==_e.object){const f=this._getOrReturnCtx(t);return Re(f,{code:ge.invalid_type,expected:_e.object,received:f.parsedType}),Ze}const{status:r,ctx:o}=this._processInputParams(t),{shape:i,keys:s}=this._getCached(),l=[];if(!(this._def.catchall instanceof Is&&this._def.unknownKeys==="strip"))for(const f in o.data)s.includes(f)||l.push(f);const u=[];for(const f of s){const m=i[f],p=o.data[f];u.push({key:{status:"valid",value:f},value:m._parse(new ei(o,p,o.path,f)),alwaysSet:f in o.data})}if(this._def.catchall instanceof Is){const f=this._def.unknownKeys;if(f==="passthrough")for(const m of l)u.push({key:{status:"valid",value:m},value:{status:"valid",value:o.data[m]}});else if(f==="strict")l.length>0&&(Re(o,{code:ge.unrecognized_keys,keys:l}),r.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const m of l){const p=o.data[m];u.push({key:{status:"valid",value:m},value:f._parse(new ei(o,p,o.path,m)),alwaysSet:m in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const f=[];for(const m of u){const p=await m.key;f.push({key:p,value:await m.value,alwaysSet:m.alwaysSet})}return f}).then(f=>Bn.mergeObjectSync(r,f)):Bn.mergeObjectSync(r,u)}get shape(){return this._def.shape()}strict(t){return De.errToObj,new Ut({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var o,i,s,l;const u=(s=(i=(o=this._def).errorMap)===null||i===void 0?void 0:i.call(o,n,r).message)!==null&&s!==void 0?s:r.defaultError;return n.code==="unrecognized_keys"?{message:(l=De.errToObj(t).message)!==null&&l!==void 0?l:u}:{message:u}}}:{}})}strip(){return new Ut({...this._def,unknownKeys:"strip"})}passthrough(){return new Ut({...this._def,unknownKeys:"passthrough"})}extend(t){return new Ut({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Ut({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Ue.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Ut({...this._def,catchall:t})}pick(t){const n={};return mt.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new Ut({...this._def,shape:()=>n})}omit(t){const n={};return mt.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new Ut({...this._def,shape:()=>n})}deepPartial(){return pl(this)}partial(t){const n={};return mt.objectKeys(this.shape).forEach(r=>{const o=this.shape[r];t&&!t[r]?n[r]=o:n[r]=o.optional()}),new Ut({...this._def,shape:()=>n})}required(t){const n={};return mt.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof Ts;)i=i._def.innerType;n[r]=i}}),new Ut({...this._def,shape:()=>n})}keyof(){return c3(mt.objectKeys(this.shape))}}Ut.create=(e,t)=>new Ut({shape:()=>e,unknownKeys:"strip",catchall:Is.create(),typeName:Ue.ZodObject,...Xe(t)});Ut.strictCreate=(e,t)=>new Ut({shape:()=>e,unknownKeys:"strict",catchall:Is.create(),typeName:Ue.ZodObject,...Xe(t)});Ut.lazycreate=(e,t)=>new Ut({shape:e,unknownKeys:"strip",catchall:Is.create(),typeName:Ue.ZodObject,...Xe(t)});class nm extends rt{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function o(i){for(const l of i)if(l.result.status==="valid")return l.result;for(const l of i)if(l.result.status==="dirty")return n.common.issues.push(...l.ctx.common.issues),l.result;const s=i.map(l=>new Xo(l.ctx.common.issues));return Re(n,{code:ge.invalid_union,unionErrors:s}),Ze}if(n.common.async)return Promise.all(r.map(async i=>{const s={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(o);{let i;const s=[];for(const u of r){const f={...n,common:{...n.common,issues:[]},parent:null},m=u._parseSync({data:n.data,path:n.path,parent:f});if(m.status==="valid")return m;m.status==="dirty"&&!i&&(i={result:m,ctx:f}),f.common.issues.length&&s.push(f.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const l=s.map(u=>new Xo(u));return Re(n,{code:ge.invalid_union,unionErrors:l}),Ze}}get options(){return this._def.options}}nm.create=(e,t)=>new nm({options:e,typeName:Ue.ZodUnion,...Xe(t)});const sp=e=>e instanceof im?sp(e.schema):e instanceof Mi?sp(e.innerType()):e instanceof sm?[e.value]:e instanceof La?e.options:e instanceof am?Object.keys(e.enum):e instanceof lm?sp(e._def.innerType):e instanceof em?[void 0]:e instanceof tm?[null]:null;class tb extends rt{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==_e.object)return Re(n,{code:ge.invalid_type,expected:_e.object,received:n.parsedType}),Ze;const r=this.discriminator,o=n.data[r],i=this.optionsMap.get(o);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(Re(n,{code:ge.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Ze)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const o=new Map;for(const i of n){const s=sp(i.shape[t]);if(!s)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const l of s){if(o.has(l))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(l)}`);o.set(l,i)}}return new tb({typeName:Ue.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:o,...Xe(r)})}}function I1(e,t){const n=da(e),r=da(t);if(e===t)return{valid:!0,data:e};if(n===_e.object&&r===_e.object){const o=mt.objectKeys(t),i=mt.objectKeys(e).filter(l=>o.indexOf(l)!==-1),s={...e,...t};for(const l of i){const u=I1(e[l],t[l]);if(!u.valid)return{valid:!1};s[l]=u.data}return{valid:!0,data:s}}else if(n===_e.array&&r===_e.array){if(e.length!==t.length)return{valid:!1};const o=[];for(let i=0;i<e.length;i++){const s=e[i],l=t[i],u=I1(s,l);if(!u.valid)return{valid:!1};o.push(u.data)}return{valid:!0,data:o}}else return n===_e.date&&r===_e.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class rm extends rt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),o=(i,s)=>{if(I2(i)||I2(s))return Ze;const l=I1(i.value,s.value);return l.valid?((L2(i)||L2(s))&&n.dirty(),{status:n.value,value:l.data}):(Re(r,{code:ge.invalid_intersection_types}),Ze)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,s])=>o(i,s)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}rm.create=(e,t,n)=>new rm({left:e,right:t,typeName:Ue.ZodIntersection,...Xe(n)});class Ai extends rt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==_e.array)return Re(r,{code:ge.invalid_type,expected:_e.array,received:r.parsedType}),Ze;if(r.data.length<this._def.items.length)return Re(r,{code:ge.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ze;!this._def.rest&&r.data.length>this._def.items.length&&(Re(r,{code:ge.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((s,l)=>{const u=this._def.items[l]||this._def.rest;return u?u._parse(new ei(r,s,r.path,l)):null}).filter(s=>!!s);return r.common.async?Promise.all(i).then(s=>Bn.mergeArray(n,s)):Bn.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new Ai({...this._def,rest:t})}}Ai.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ai({items:e,typeName:Ue.ZodTuple,rest:null,...Xe(t)})};class om extends rt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==_e.object)return Re(r,{code:ge.invalid_type,expected:_e.object,received:r.parsedType}),Ze;const o=[],i=this._def.keyType,s=this._def.valueType;for(const l in r.data)o.push({key:i._parse(new ei(r,l,r.path,l)),value:s._parse(new ei(r,r.data[l],r.path,l))});return r.common.async?Bn.mergeObjectAsync(n,o):Bn.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof rt?new om({keyType:t,valueType:n,typeName:Ue.ZodRecord,...Xe(r)}):new om({keyType:xi.create(),valueType:t,typeName:Ue.ZodRecord,...Xe(n)})}}class L1 extends rt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==_e.map)return Re(r,{code:ge.invalid_type,expected:_e.map,received:r.parsedType}),Ze;const o=this._def.keyType,i=this._def.valueType,s=[...r.data.entries()].map(([l,u],f)=>({key:o._parse(new ei(r,l,r.path,[f,"key"])),value:i._parse(new ei(r,u,r.path,[f,"value"]))}));if(r.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const u of s){const f=await u.key,m=await u.value;if(f.status==="aborted"||m.status==="aborted")return Ze;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),l.set(f.value,m.value)}return{status:n.value,value:l}})}else{const l=new Map;for(const u of s){const f=u.key,m=u.value;if(f.status==="aborted"||m.status==="aborted")return Ze;(f.status==="dirty"||m.status==="dirty")&&n.dirty(),l.set(f.value,m.value)}return{status:n.value,value:l}}}}L1.create=(e,t,n)=>new L1({valueType:t,keyType:e,typeName:Ue.ZodMap,...Xe(n)});class vc extends rt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==_e.set)return Re(r,{code:ge.invalid_type,expected:_e.set,received:r.parsedType}),Ze;const o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(Re(r,{code:ge.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()),o.maxSize!==null&&r.data.size>o.maxSize.value&&(Re(r,{code:ge.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());const i=this._def.valueType;function s(u){const f=new Set;for(const m of u){if(m.status==="aborted")return Ze;m.status==="dirty"&&n.dirty(),f.add(m.value)}return{status:n.value,value:f}}const l=[...r.data.values()].map((u,f)=>i._parse(new ei(r,u,r.path,f)));return r.common.async?Promise.all(l).then(u=>s(u)):s(l)}min(t,n){return new vc({...this._def,minSize:{value:t,message:De.toString(n)}})}max(t,n){return new vc({...this._def,maxSize:{value:t,message:De.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}vc.create=(e,t)=>new vc({valueType:e,minSize:null,maxSize:null,typeName:Ue.ZodSet,...Xe(t)});class Lu extends rt{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==_e.function)return Re(n,{code:ge.invalid_type,expected:_e.function,received:n.parsedType}),Ze;function r(l,u){return k1({data:l,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,T1(),Qp].filter(f=>!!f),issueData:{code:ge.invalid_arguments,argumentsError:u}})}function o(l,u){return k1({data:l,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,T1(),Qp].filter(f=>!!f),issueData:{code:ge.invalid_return_type,returnTypeError:u}})}const i={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof pd){const l=this;return nr(async function(...u){const f=new Xo([]),m=await l._def.args.parseAsync(u,i).catch(y=>{throw f.addIssue(r(u,y)),f}),p=await Reflect.apply(s,this,m);return await l._def.returns._def.type.parseAsync(p,i).catch(y=>{throw f.addIssue(o(p,y)),f})})}else{const l=this;return nr(function(...u){const f=l._def.args.safeParse(u,i);if(!f.success)throw new Xo([r(u,f.error)]);const m=Reflect.apply(s,this,f.data),p=l._def.returns.safeParse(m,i);if(!p.success)throw new Xo([o(m,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Lu({...this._def,args:Ai.create(t).rest(Ll.create())})}returns(t){return new Lu({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new Lu({args:t||Ai.create([]).rest(Ll.create()),returns:n||Ll.create(),typeName:Ue.ZodFunction,...Xe(r)})}}class im extends rt{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}im.create=(e,t)=>new im({getter:e,typeName:Ue.ZodLazy,...Xe(t)});class sm extends rt{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Re(n,{received:n.data,code:ge.invalid_literal,expected:this._def.value}),Ze}return{status:"valid",value:t.data}}get value(){return this._def.value}}sm.create=(e,t)=>new sm({value:e,typeName:Ue.ZodLiteral,...Xe(t)});function c3(e,t){return new La({values:e,typeName:Ue.ZodEnum,...Xe(t)})}class La extends rt{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return Re(n,{expected:mt.joinValues(r),received:n.parsedType,code:ge.invalid_type}),Ze}if(this._def.values.indexOf(t.data)===-1){const n=this._getOrReturnCtx(t),r=this._def.values;return Re(n,{received:n.data,code:ge.invalid_enum_value,options:r}),Ze}return nr(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t){return La.create(t)}exclude(t){return La.create(this.options.filter(n=>!t.includes(n)))}}La.create=c3;class am extends rt{_parse(t){const n=mt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==_e.string&&r.parsedType!==_e.number){const o=mt.objectValues(n);return Re(r,{expected:mt.joinValues(o),received:r.parsedType,code:ge.invalid_type}),Ze}if(n.indexOf(t.data)===-1){const o=mt.objectValues(n);return Re(r,{received:r.data,code:ge.invalid_enum_value,options:o}),Ze}return nr(t.data)}get enum(){return this._def.values}}am.create=(e,t)=>new am({values:e,typeName:Ue.ZodNativeEnum,...Xe(t)});class pd extends rt{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==_e.promise&&n.common.async===!1)return Re(n,{code:ge.invalid_type,expected:_e.promise,received:n.parsedType}),Ze;const r=n.parsedType===_e.promise?n.data:Promise.resolve(n.data);return nr(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}}pd.create=(e,t)=>new pd({type:e,typeName:Ue.ZodPromise,...Xe(t)});class Mi extends rt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ue.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),o=this._def.effect||null,i={addIssue:s=>{Re(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){const s=o.transform(r.data,i);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(s).then(l=>this._def.schema._parseAsync({data:l,path:r.path,parent:r})):this._def.schema._parseSync({data:s,path:r.path,parent:r})}if(o.type==="refinement"){const s=l=>{const u=o.refinement(l,i);if(r.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return l.status==="aborted"?Ze:(l.status==="dirty"&&n.dirty(),s(l.value),{status:n.value,value:l.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>l.status==="aborted"?Ze:(l.status==="dirty"&&n.dirty(),s(l.value).then(()=>({status:n.value,value:l.value}))))}if(o.type==="transform")if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Jp(s))return s;const l=o.transform(s.value,i);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:l}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>Jp(s)?Promise.resolve(o.transform(s.value,i)).then(l=>({status:n.value,value:l})):s);mt.assertNever(o)}}Mi.create=(e,t,n)=>new Mi({schema:e,typeName:Ue.ZodEffects,effect:t,...Xe(n)});Mi.createWithPreprocess=(e,t,n)=>new Mi({schema:t,effect:{type:"preprocess",transform:e},typeName:Ue.ZodEffects,...Xe(n)});class Ts extends rt{_parse(t){return this._getType(t)===_e.undefined?nr(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Ts.create=(e,t)=>new Ts({innerType:e,typeName:Ue.ZodOptional,...Xe(t)});class yc extends rt{_parse(t){return this._getType(t)===_e.null?nr(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}yc.create=(e,t)=>new yc({innerType:e,typeName:Ue.ZodNullable,...Xe(t)});class lm extends rt{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===_e.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}lm.create=(e,t)=>new lm({innerType:e,typeName:Ue.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Xe(t)});class F1 extends rt{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return A1(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Xo(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Xo(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}F1.create=(e,t)=>new F1({innerType:e,typeName:Ue.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Xe(t)});class j1 extends rt{_parse(t){if(this._getType(t)!==_e.nan){const r=this._getOrReturnCtx(t);return Re(r,{code:ge.invalid_type,expected:_e.nan,received:r.parsedType}),Ze}return{status:"valid",value:t.data}}}j1.create=e=>new j1({typeName:Ue.ZodNaN,...Xe(e)});class hX extends rt{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class pg extends rt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Ze:i.status==="dirty"?(n.dirty(),tX(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Ze:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(t,n){return new pg({in:t,out:n,typeName:Ue.ZodPipeline})}}class B1 extends rt{_parse(t){const n=this._def.innerType._parse(t);return Jp(n)&&(n.value=Object.freeze(n.value)),n}}B1.create=(e,t)=>new B1({innerType:e,typeName:Ue.ZodReadonly,...Xe(t)});Ut.lazycreate;var Ue;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Ue||(Ue={}));const du=xi.create;mc.create;j1.create;gc.create;const fu=M1.create;hd.create;O1.create;em.create;tm.create;N1.create;Ll.create;Is.create;D1.create;Zo.create;const pX=Ut.create;Ut.strictCreate;nm.create;tb.create;rm.create;Ai.create;om.create;L1.create;vc.create;Lu.create;im.create;sm.create;La.create;am.create;pd.create;Mi.create;Ts.create;yc.create;Mi.createWithPreprocess;pg.create;const z1="horizontal",mX=["horizontal","vertical"],u3=d.forwardRef((e,t)=>{const{decorative:n,orientation:r=z1,...o}=e,i=d3(r)?r:z1,l=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return d.createElement(Ae.div,Y({"data-orientation":i},l,o,{ref:t}))});u3.propTypes={orientation(e,t,n){const r=e[t],o=String(r);return r&&!d3(r)?new Error(gX(o,n)):null}};function gX(e,t){return`Invalid prop \`orientation\` of value \`${e}\` supplied to \`${t}\`, expected one of:
- horizontal
- vertical
Defaulting to \`${z1}\`.`}function d3(e){return mX.includes(e)}const f3=u3,Xt=d.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},o)=>v.jsx(f3,{ref:o,decorative:n,orientation:t,className:xe("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));Xt.displayName=f3.displayName;const vX=d.forwardRef((e,t)=>d.createElement(Ae.label,Y({},e,{ref:t,onMouseDown:n=>{var r;(r=e.onMouseDown)===null||r===void 0||r.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault()}}))),h3=vX,yX=Fm("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),nb=d.forwardRef(({className:e,disabled:t,...n},r)=>v.jsx(h3,{ref:r,className:xe(yX(),e,t?"opacity-50":"","select-none"),...n}));nb.displayName=h3.displayName;const wX=OY,p3=d.createContext({}),ul=({...e})=>v.jsx(p3.Provider,{value:{name:e.name},children:v.jsx(LY,{...e})}),mg=()=>{const e=d.useContext(p3),t=d.useContext(m3),{getFieldState:n,formState:r}=hg(),o=n(e.name,r);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=t;return{id:i,name:e.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...o}},m3=d.createContext({}),sa=d.forwardRef(({className:e,...t},n)=>{const r=d.useId();return v.jsx(m3.Provider,{value:{id:r},children:v.jsx("div",{ref:n,className:xe("space-y-2",e),...t})})});sa.displayName="FormItem";const aa=d.forwardRef(({className:e,...t},n)=>{const{error:r,formItemId:o}=mg();return v.jsx(nb,{ref:n,className:xe(r&&"text-destructive","text-sm",e),htmlFor:o,...t})});aa.displayName="FormLabel";const la=d.forwardRef(({...e},t)=>{const{error:n,formItemId:r,formDescriptionId:o,formMessageId:i}=mg();return v.jsx(Qo,{ref:t,id:r,"aria-describedby":n?`${o} ${i}`:`${o}`,"aria-invalid":!!n,...e})});la.displayName="FormControl";const ca=d.forwardRef(({className:e,...t},n)=>{const{formDescriptionId:r}=mg();return v.jsx("p",{ref:n,id:r,className:xe("text-[0.8rem] text-muted-foreground",e),...t})});ca.displayName="FormDescription";const xX=d.forwardRef(({className:e,children:t,...n},r)=>{const{error:o,formMessageId:i}=mg(),s=o?String(o==null?void 0:o.message):t;return s?v.jsx("p",{ref:r,id:i,className:xe("text-[0.8rem] font-medium text-destructive",e),...n,children:s}):null});xX.displayName="FormMessage";const g3="Switch",[bX,wte]=Tn(g3),[SX,_X]=bX(g3),EX=d.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:i,required:s,disabled:l,value:u="on",onCheckedChange:f,...m}=e,[p,g]=d.useState(null),y=Ve(t,b=>g(b)),x=d.useRef(!1),S=p?!!p.closest("form"):!0,[E=!1,_]=eo({prop:o,defaultProp:i,onChange:f});return d.createElement(SX,{scope:n,checked:E,disabled:l},d.createElement(Ae.button,Y({type:"button",role:"switch","aria-checked":E,"aria-required":s,"data-state":v3(E),"data-disabled":l?"":void 0,disabled:l,value:u},m,{ref:y,onClick:fe(e.onClick,b=>{_(C=>!C),S&&(x.current=b.isPropagationStopped(),x.current||b.stopPropagation())})})),S&&d.createElement(RX,{control:p,bubbles:!x.current,name:r,value:u,checked:E,required:s,disabled:l,style:{transform:"translateX(-100%)"}}))}),CX="SwitchThumb",$X=d.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=_X(CX,n);return d.createElement(Ae.span,Y({"data-state":v3(o.checked),"data-disabled":o.disabled?"":void 0},r,{ref:t}))}),RX=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=d.useRef(null),s=Kx(n),l=Sx(t);return d.useEffect(()=>{const u=i.current,f=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(f,"checked").set;if(s!==n&&p){const g=new Event("click",{bubbles:r});p.call(u,n),u.dispatchEvent(g)}},[s,n,r]),d.createElement("input",Y({type:"checkbox","aria-hidden":!0,defaultChecked:n},o,{tabIndex:-1,ref:i,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function v3(e){return e?"checked":"unchecked"}const y3=EX,PX=$X,jr=d.forwardRef(({className:e,...t},n)=>v.jsx(y3,{className:xe("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),tabIndex:-1,...t,ref:n,children:v.jsx(PX,{className:xe("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));jr.displayName=y3.displayName;const TX="AlertDialog",[kX,xte]=Tn(TX,[gT]),Vs=gT(),AX=e=>{const{__scopeAlertDialog:t,...n}=e,r=Vs(t);return d.createElement(Tx,Y({},r,n,{modal:!0}))},MX=e=>{const{__scopeAlertDialog:t,...n}=e,r=Vs(t);return d.createElement(kx,Y({},r,n))},OX=d.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Vs(n);return d.createElement(Bd,Y({},o,r,{ref:t}))}),w3="AlertDialogContent",[NX,DX]=kX(w3),IX=d.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...o}=e,i=Vs(n),s=d.useRef(null),l=Ve(t,s),u=d.useRef(null);return d.createElement(JV,{contentName:w3,titleName:LX,docsSlug:"alert-dialog"},d.createElement(NX,{scope:n,cancelRef:u},d.createElement(zd,Y({role:"alertdialog"},i,o,{ref:l,onOpenAutoFocus:fe(o.onOpenAutoFocus,f=>{var m;f.preventDefault(),(m=u.current)===null||m===void 0||m.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault()}),d.createElement(fx,null,r),!1)))}),LX="AlertDialogTitle",FX=d.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Vs(n);return d.createElement(Ud,Y({},o,r,{ref:t}))}),jX=d.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Vs(n);return d.createElement(Vd,Y({},o,r,{ref:t}))}),BX=d.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Vs(n);return d.createElement(Ax,Y({},o,r,{ref:t}))}),zX="AlertDialogCancel",UX=d.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:o}=DX(zX,n),i=Vs(n),s=Ve(t,o);return d.createElement(Ax,Y({},i,r,{ref:s}))}),VX=AX,WX=MX,x3=OX,b3=IX,S3=BX,_3=UX,E3=FX,C3=jX,HX=VX,KX=WX,$3=d.forwardRef(({className:e,...t},n)=>v.jsx(x3,{className:xe("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));$3.displayName=x3.displayName;const R3=d.forwardRef(({className:e,...t},n)=>v.jsxs(KX,{children:[v.jsx($3,{}),v.jsx(b3,{ref:n,className:xe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));R3.displayName=b3.displayName;const P3=({className:e,...t})=>v.jsx("div",{className:xe("flex flex-col space-y-2 text-center sm:text-left",e),...t});P3.displayName="AlertDialogHeader";const GX=d.forwardRef(({className:e,...t},n)=>v.jsx(E3,{ref:n,className:xe("text-lg font-semibold",e),...t}));GX.displayName=E3.displayName;const YX=d.forwardRef(({className:e,...t},n)=>v.jsx(C3,{ref:n,className:xe("text-sm text-muted-foreground",e),...t}));YX.displayName=C3.displayName;const XX=d.forwardRef(({className:e,...t},n)=>v.jsx(S3,{ref:n,className:xe(Rx(),e),...t}));XX.displayName=S3.displayName;const ZX=d.forwardRef(({className:e,...t},n)=>v.jsx(_3,{ref:n,className:xe(Rx({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));ZX.displayName=_3.displayName;const qX=pX({enableFileManager:fu(),inputDirectory:du(),outputDirectory:du(),enableDownloadMask:fu(),enableManualInpainting:fu(),enableUploadMask:fu(),enableAutoExtractPrompt:fu(),removeBGModel:du(),realesrganModel:du(),interactiveSegModel:du()}),T3="General",U1="Model",k3="Plugins",QX=[U1,T3,k3];function JX(){const[e,t]=rT(!1),[n,r]=d.useState(U1),[o,i,s,l,u,f]=xt(V=>[V.updateAppState,V.settings,V.updateSettings,V.fileManagerState,V.setModel,V.setServerConfig]),{toast:m}=Id(),[p,g]=d.useState(i.model),[y,x]=d.useState([]),S=y.length>0;d.useEffect(()=>{g(i.model)},[i.model]);const{data:E,status:_,refetch:b}=OL({queryKey:["serverConfig"],queryFn:SP}),C=YY({resolver:JY(qX),defaultValues:{enableDownloadMask:i.enableDownloadMask,enableManualInpainting:i.enableManualInpainting,enableUploadMask:i.enableUploadMask,enableAutoExtractPrompt:i.enableAutoExtractPrompt,inputDirectory:l.inputDirectory,outputDirectory:l.outputDirectory,removeBGModel:E==null?void 0:E.removeBGModel,realesrganModel:E==null?void 0:E.realesrganModel,interactiveSegModel:E==null?void 0:E.interactiveSegModel}});d.useEffect(()=>{E&&(f(E),C.setValue("removeBGModel",E.removeBGModel),C.setValue("realesrganModel",E.realesrganModel),C.setValue("interactiveSegModel",E.interactiveSegModel))},[C,E]);async function R(V){s({enableDownloadMask:V.enableDownloadMask,enableManualInpainting:V.enableManualInpainting,enableUploadMask:V.enableUploadMask,enableAutoExtractPrompt:V.enableAutoExtractPrompt});const J=p.name!==i.model.name,G=(E==null?void 0:E.removeBGModel)!==V.removeBGModel&&A,Z=(E==null?void 0:E.realesrganModel)!==V.realesrganModel&&I,Q=(E==null?void 0:E.interactiveSegModel)!==V.interactiveSegModel&&z;if(J||G||Z||Q){const L=[];if(J&&L.push(`Switching model from ${i.model.name} to ${p.name}`),G&&L.push(`Switching RemoveBG model from ${E==null?void 0:E.removeBGModel} to ${V.removeBGModel}`),Z&&L.push(`Switching RealESRGAN model from ${E==null?void 0:E.realesrganModel} to ${V.realesrganModel}`),Q&&L.push(`Switching ${Oo.InteractiveSeg} model from ${E==null?void 0:E.interactiveSegModel} to ${V.interactiveSegModel}`),x(L),o({disableShortCuts:!0}),J)try{const ue=await Vj(p.name);m({title:`Switch to ${ue.name} success`}),u(p)}catch(ue){m({variant:"destructive",title:`Switch to ${p.name} failed: ${ue}`}),g(i.model)}if(G)try{const ue=await S0(Oo.RemoveBG,V.removeBGModel);if(ue.status!==200)throw new Error(ue.statusText)}catch(ue){m({variant:"destructive",title:`Switch RemoveBG model to ${V.removeBGModel} failed: ${ue}`})}if(Z)try{const ue=await S0(Oo.RealESRGAN,V.realesrganModel);if(ue.status!==200)throw new Error(ue.statusText)}catch(ue){m({variant:"destructive",title:`Switch RealESRGAN model to ${V.realesrganModel} failed: ${ue}`})}if(Q)try{const ue=await S0(Oo.InteractiveSeg,V.interactiveSegModel);if(ue.status!==200)throw new Error(ue.statusText)}catch(ue){m({variant:"destructive",title:`Switch ${Oo.InteractiveSeg} model to ${V.interactiveSegModel} failed: ${ue}`})}x([]),o({disableShortCuts:!1}),b()}}if(Yn("s",()=>{t(),e&&R(C.getValues())},[e,C,p,E]),_!=="success")return v.jsx(v.Fragment,{});const k=E.modelInfos,O=E.plugins,A=O.some(V=>V.name===Oo.RemoveBG),I=O.some(V=>V.name===Oo.RealESRGAN),z=O.some(V=>V.name===Oo.InteractiveSeg);function H(V){t(),V||R(C.getValues())}function ie(V){g(V)}function K(V){return k?k.filter(J=>V.includes(J.model_type)).map(J=>v.jsxs("div",{onClick:()=>ie(J),className:"px-2",children:[v.jsx("div",{className:xe([J.name===p.name?"bg-muted":"hover:bg-muted","rounded-md px-2 py-2","cursor-default"]),children:v.jsx("div",{className:"text-base",children:J.name})}),v.jsx(Xt,{className:"my-1"})]},J.name)):v.jsx("div",{children:"Please download model first"})}function te(){let V=ms;for(let J of k)if(p.name===J.name){V=J.model_type,V===uC&&(V=hh),V===dC&&(V=ph);break}return v.jsxs("div",{className:"flex flex-col gap-4 w-[510px]",children:[v.jsxs("div",{className:"flex flex-col gap-4 rounded-md",children:[v.jsx("div",{className:"font-medium",children:"Current Model"}),v.jsx("div",{children:p.name})]}),v.jsx(Xt,{}),v.jsxs("div",{className:"space-y-4 rounded-md",children:[v.jsx("div",{className:"flex gap-1 items-center justify-start",children:v.jsx("div",{className:"font-medium",children:"Available models"})}),v.jsxs(hk,{defaultValue:V,children:[v.jsxs(Hx,{children:[v.jsx(ys,{value:ms,children:"Inpaint"}),v.jsx(ys,{value:hh,children:"Stable Diffusion"}),v.jsx(ys,{value:ph,children:"Stable Diffusion Inpaint"}),v.jsx(ys,{value:g0,children:"Other Diffusion"})]}),v.jsxs(fg,{className:"h-[240px] w-full mt-2 outline-none border rounded-lg",children:[v.jsx(Su,{value:ms,children:K([ms])}),v.jsx(Su,{value:hh,children:K([hh,uC])}),v.jsx(Su,{value:ph,children:K([ph,dC])}),v.jsx(Su,{value:g0,children:K([g0])})]})]})]})]})}function U(){return v.jsxs("div",{className:"space-y-4 w-[510px]",children:[v.jsx(ul,{control:C.control,name:"enableManualInpainting",render:({field:V})=>v.jsxs(sa,{className:"flex items-center justify-between",children:[v.jsxs("div",{className:"space-y-0.5",children:[v.jsx(aa,{children:"Enable manual inpainting"}),v.jsx(ca,{children:"For erase model, click a button to trigger inpainting after draw mask."})]}),v.jsx(la,{children:v.jsx(jr,{checked:V.value,onCheckedChange:V.onChange})})]})}),v.jsx(Xt,{}),v.jsx(ul,{control:C.control,name:"enableDownloadMask",render:({field:V})=>v.jsxs(sa,{className:"flex items-center justify-between",children:[v.jsxs("div",{className:"space-y-0.5",children:[v.jsx(aa,{children:"Enable download mask"}),v.jsx(ca,{children:"Also download the mask after save the inpainting result."})]}),v.jsx(la,{children:v.jsx(jr,{checked:V.value,onCheckedChange:V.onChange})})]})}),v.jsx(Xt,{}),v.jsx(ul,{control:C.control,name:"enableAutoExtractPrompt",render:({field:V})=>v.jsxs(sa,{className:"flex items-center justify-between",children:[v.jsxs("div",{className:"space-y-0.5",children:[v.jsx(aa,{children:"Enable auto extract prompt"}),v.jsx(ca,{children:"Automatically extract prompt/negativate prompt from the image meta."})]}),v.jsx(la,{children:v.jsx(jr,{checked:V.value,onCheckedChange:V.onChange})})]})})]})}function re(){return v.jsxs("div",{className:"space-y-4 w-[510px]",children:[v.jsx(ul,{control:C.control,name:"removeBGModel",render:({field:V})=>v.jsxs(sa,{className:"flex items-center justify-between",children:[v.jsxs("div",{className:"space-y-0.5",children:[v.jsx(aa,{children:"Remove Background"}),v.jsx(ca,{children:"Remove background model"})]}),v.jsxs(yo,{onValueChange:V.onChange,defaultValue:V.value,disabled:!A,children:[v.jsx(la,{children:v.jsx(Vr,{className:"w-auto",children:v.jsx(wo,{placeholder:"Select removebg model"})})}),v.jsx(Wr,{align:"end",children:v.jsx(zo,{children:E==null?void 0:E.removeBGModels.map(J=>v.jsx(Hr,{value:J,children:J},J))})})]})]})}),v.jsx(Xt,{}),v.jsx(ul,{control:C.control,name:"realesrganModel",render:({field:V})=>v.jsxs(sa,{className:"flex items-center justify-between",children:[v.jsxs("div",{className:"space-y-0.5",children:[v.jsx(aa,{children:"RealESRGAN"}),v.jsx(ca,{children:"RealESRGAN Model"})]}),v.jsxs(yo,{onValueChange:V.onChange,defaultValue:V.value,disabled:!I,children:[v.jsx(la,{children:v.jsx(Vr,{className:"w-auto",children:v.jsx(wo,{placeholder:"Select RealESRGAN model"})})}),v.jsx(Wr,{align:"end",children:v.jsx(zo,{children:E==null?void 0:E.realesrganModels.map(J=>v.jsx(Hr,{value:J,children:J},J))})})]})]})}),v.jsx(Xt,{}),v.jsx(ul,{control:C.control,name:"interactiveSegModel",render:({field:V})=>v.jsxs(sa,{className:"flex items-center justify-between",children:[v.jsxs("div",{className:"space-y-0.5",children:[v.jsx(aa,{children:"Interactive Segmentation"}),v.jsx(ca,{children:"Interactive Segmentation Model"})]}),v.jsxs(yo,{onValueChange:V.onChange,defaultValue:V.value,disabled:!z,children:[v.jsx(la,{children:v.jsx(Vr,{className:"w-auto",children:v.jsx(wo,{placeholder:"Select interactive segmentation model"})})}),v.jsx(Wr,{align:"end",children:v.jsx(zo,{children:E==null?void 0:E.interactiveSegModels.map(J=>v.jsx(Hr,{value:J,children:J},J))})})]})]})})]})}return v.jsxs(v.Fragment,{children:[v.jsx(HX,{open:S,children:v.jsx(R3,{children:v.jsx(P3,{children:v.jsxs("div",{className:"flex flex-col justify-center items-center gap-4",children:[v.jsxs("div",{role:"status",children:[v.jsxs("svg",{"aria-hidden":"true",className:"w-8 h-8 text-gray-200 animate-spin dark:text-gray-600 fill-primary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[v.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),v.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),v.jsx("span",{className:"sr-only",children:"Loading..."})]}),y?v.jsx("div",{className:"flex flex-col",children:y.map((V,J)=>v.jsx("div",{children:V},J))}):v.jsx(v.Fragment,{})]})})})}),v.jsxs(Mx,{open:e,onOpenChange:H,children:[v.jsx(_T,{asChild:!0,children:v.jsx(Zn,{tooltip:"Settings",children:v.jsx(vH,{})})}),v.jsxs(rg,{className:"max-w-3xl h-[600px]",onOpenAutoFocus:V=>V.preventDefault(),children:[v.jsx(og,{children:"Settings"}),v.jsx(Xt,{}),v.jsxs("div",{className:"flex flex-row space-x-8 h-full",children:[v.jsx("div",{className:"flex flex-col space-y-1",children:QX.map(V=>v.jsx(vn,{variant:"ghost",onClick:()=>r(V),className:xe(n===V?"bg-muted ":"hover:bg-muted","justify-start"),children:V},V))}),v.jsx(Xt,{orientation:"vertical"}),v.jsx(wX,{...C,children:v.jsx("div",{className:"flex w-full justify-center",children:v.jsxs("form",{onSubmit:C.handleSubmit(R),children:[n===U1?te():v.jsx(v.Fragment,{}),n===T3?U():v.jsx(v.Fragment,{}),n===k3?re():v.jsx(v.Fragment,{}),v.jsx("div",{className:"absolute right-10 bottom-6",children:v.jsx(vn,{onClick:()=>H(!1),children:"Ok"})})]})})})]})]})]})]})}const eZ=()=>{const[e,t,n,r,o,i,s,l,u,f,m,p,g,y,x]=xt(k=>[k.file,k.customMask,k.isInpainting,k.serverConfig,k.runMannually(),k.settings.enableUploadMask,k.settings.model,k.setFile,k.setCustomFile,k.runInpainting,k.showPrevMask,k.hidePrevMask,k.imageHeight,k.imageWidth,k.handleFileManagerMaskSelect]),{toast:S}=Id(),[E,_]=Nx(t),[b,C]=d.useState(!1),R=async(k,O)=>{try{if(k===Hk){const A=await Kj(k,O);x(A)}else{const A=await Hj(k,O);l(A)}}catch(A){S({variant:"destructive",description:A.message?A.message:A.toString()});return}};return v.jsxs("header",{className:"h-[60px] px-6 py-4 absolute top-[0] flex justify-between items-center w-full z-20 border-b backdrop-filter backdrop-blur-md bg-background/70",children:[v.jsxs("div",{className:"flex items-center gap-1",children:[r.enableFileManager?v.jsx(kY,{photoWidth:512,onPhotoClick:R}):v.jsx(v.Fragment,{}),v.jsxs("div",{className:xe(["flex items-center gap-1",e&&i?"visible":"hidden"]),children:[v.jsx(nT,{disabled:n,tooltip:"Upload custom mask",onFileUpload:async k=>{let O=null;try{O=await yF(k)}catch(A){S({variant:"destructive",description:A.message?A.message:A.toString()});return}if(O.naturalHeight!==g||O.naturalWidth!==y){S({variant:"destructive",description:`The size of the mask must same as image: ${y}x${g}`});return}u(k),o||f()},children:v.jsx(BT,{})}),t?v.jsxs(MW,{open:b,children:[v.jsx(OW,{className:"btn-primary side-panel-trigger",onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),style:{visibility:t?"visible":"hidden",outline:"none"},onClick:()=>{},children:v.jsx(Zn,{tooltip:"Run custom mask",children:v.jsx(hB,{})})}),v.jsx(LT,{children:_?v.jsx("img",{src:E.src,alt:"Custom mask"}):v.jsx(v.Fragment,{})})]}):v.jsx(v.Fragment,{})]})]}),s.need_prompt?v.jsx(oH,{}):v.jsx(v.Fragment,{}),v.jsxs("div",{className:"flex gap-1",children:[v.jsx(yW,{}),r.disableModelSwitch?v.jsx(v.Fragment,{}):v.jsx(JX,{})]})]})};var Yr=function(e,t){return Number(e.toFixed(t))},tZ=function(e,t){return typeof e=="number"?e:t},Ot=function(e,t,n){n&&typeof n=="function"&&n(e,t)},nZ=function(e){return-Math.cos(e*Math.PI)/2+.5},rZ=function(e){return e},oZ=function(e){return e*e},iZ=function(e){return e*(2-e)},sZ=function(e){return e<.5?2*e*e:-1+(4-2*e)*e},aZ=function(e){return e*e*e},lZ=function(e){return--e*e*e+1},cZ=function(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1},uZ=function(e){return e*e*e*e},dZ=function(e){return 1- --e*e*e*e},fZ=function(e){return e<.5?8*e*e*e*e:1-8*--e*e*e*e},hZ=function(e){return e*e*e*e*e},pZ=function(e){return 1+--e*e*e*e*e},mZ=function(e){return e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e},A3={easeOut:nZ,linear:rZ,easeInQuad:oZ,easeOutQuad:iZ,easeInOutQuad:sZ,easeInCubic:aZ,easeOutCubic:lZ,easeInOutCubic:cZ,easeInQuart:uZ,easeOutQuart:dZ,easeInOutQuart:fZ,easeInQuint:hZ,easeOutQuint:pZ,easeInOutQuint:mZ},M3=function(e){typeof e=="number"&&cancelAnimationFrame(e)},Vo=function(e){e.mounted&&(M3(e.animation),e.animate=!1,e.animation=null,e.velocity=null)};function O3(e,t,n,r){if(e.mounted){var o=new Date().getTime(),i=1;Vo(e),e.animation=function(){if(!e.mounted)return M3(e.animation);var s=new Date().getTime()-o,l=s/n,u=A3[t],f=u(l);s>=n?(r(i),e.animation=null):e.animation&&(r(f),requestAnimationFrame(e.animation))},requestAnimationFrame(e.animation)}}function gZ(e){var t=e.scale,n=e.positionX,r=e.positionY;return!(Number.isNaN(t)||Number.isNaN(n)||Number.isNaN(r))}function Ws(e,t,n,r){var o=gZ(t);if(!(!e.mounted||!o)){var i=e.setTransformState,s=e.transformState,l=s.scale,u=s.positionX,f=s.positionY,m=t.scale-l,p=t.positionX-u,g=t.positionY-f;n===0?i(t.scale,t.positionX,t.positionY):O3(e,r,n,function(y){var x=l+m*y,S=u+p*y,E=f+g*y;i(x,S,E)})}}function vZ(e,t,n){var r=e.offsetWidth,o=e.offsetHeight,i=t.offsetWidth,s=t.offsetHeight,l=i*n,u=s*n,f=r-l,m=o-u;return{wrapperWidth:r,wrapperHeight:o,newContentWidth:l,newDiffWidth:f,newContentHeight:u,newDiffHeight:m}}var yZ=function(e,t,n,r,o,i,s){var l=e>t?n*(s?1:.5):0,u=r>o?i*(s?1:.5):0,f=e-t-l,m=l,p=r-o-u,g=u;return{minPositionX:f,maxPositionX:m,minPositionY:p,maxPositionY:g}},rb=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=vZ(n,r,t),s=i.wrapperWidth,l=i.wrapperHeight,u=i.newContentWidth,f=i.newDiffWidth,m=i.newContentHeight,p=i.newDiffHeight,g=yZ(s,u,f,l,m,p,!!o);return g},V1=function(e,t,n,r){return r?e<t?Yr(t,2):e>n?Yr(n,2):Yr(e,2):Yr(e,2)},wc=function(e,t){var n=rb(e,t);return e.bounds=n,n};function gg(e,t,n,r,o,i,s){var l=n.minPositionX,u=n.minPositionY,f=n.maxPositionX,m=n.maxPositionY,p=0,g=0;s&&(p=o,g=i);var y=V1(e,l-p,f+p,r),x=V1(t,u-g,m+g,r);return{x:y,y:x}}function vg(e,t,n,r,o,i){var s=e.transformState,l=s.scale,u=s.positionX,f=s.positionY,m=r-l;if(typeof t!="number"||typeof n!="number")return console.error("Mouse X and Y position were not provided!"),{x:u,y:f};var p=u-t*m,g=f-n*m,y=gg(p,g,o,i,0,0,null);return y}function Gd(e,t,n,r,o){var i=o?r:0,s=t-i;return!Number.isNaN(n)&&e>=n?n:!Number.isNaN(t)&&e<=s?s:e}var j2=function(e,t){var n=e.setup.panning.excluded,r=e.isInitialized,o=e.wrapperComponent,i=t.target,s=o==null?void 0:o.contains(i),l=r&&i&&s;if(!l)return!1;var u=yg(i,n);return!u},B2=function(e){var t=e.isInitialized,n=e.isPanning,r=e.setup,o=r.panning.disabled,i=t&&n&&!o;return!!i},wZ=function(e,t){var n=e.transformState,r=n.positionX,o=n.positionY;e.isPanning=!0;var i=t.clientX,s=t.clientY;e.startCoords={x:i-r,y:s-o}},xZ=function(e,t){var n=t.touches,r=e.transformState,o=r.positionX,i=r.positionY;e.isPanning=!0;var s=n.length===1;if(s){var l=n[0].clientX,u=n[0].clientY;e.startCoords={x:l-o,y:u-i}}};function bZ(e){var t=e.transformState,n=t.positionX,r=t.positionY,o=t.scale,i=e.setup,s=i.disabled,l=i.limitToBounds,u=i.centerZoomedOut,f=e.wrapperComponent;if(!(s||!f||!e.bounds)){var m=e.bounds,p=m.maxPositionX,g=m.minPositionX,y=m.maxPositionY,x=m.minPositionY,S=n>p||n<g,E=r>y||r<x,_=n>p?f.offsetWidth:e.setup.minPositionX||0,b=r>y?f.offsetHeight:e.setup.minPositionY||0,C=vg(e,_,b,o,e.bounds,l||u),R=C.x,k=C.y;return{scale:o,positionX:S?R:n,positionY:E?k:r}}}function SZ(e,t,n,r,o){var i=e.setup.limitToBounds,s=e.wrapperComponent,l=e.bounds,u=e.transformState,f=u.scale,m=u.positionX,p=u.positionY;if(!(s===null||l===null||t===m&&n===p)){var g=gg(t,n,l,i,r,o,s),y=g.x,x=g.y;e.setTransformState(f,y,x)}}var _Z=function(e,t,n){var r=e.startCoords,o=e.transformState,i=e.setup.panning,s=i.lockAxisX,l=i.lockAxisY,u=o.positionX,f=o.positionY;if(!r)return{x:u,y:f};var m=t-r.x,p=n-r.y,g=s?u:m,y=l?f:p;return{x:g,y}},cm=function(e,t){var n=e.setup,r=e.transformState,o=r.scale,i=n.minScale,s=n.disablePadding;return t>0&&o>=i&&!s?t:0},EZ=function(e){var t=e.mounted,n=e.setup,r=n.disabled,o=n.velocityAnimation,i=e.transformState.scale,s=o.disabled,l=!s||i>1||!r||t;return!!l},CZ=function(e){var t=e.mounted,n=e.velocity,r=e.bounds,o=e.setup,i=o.disabled,s=o.velocityAnimation,l=e.transformState.scale,u=s.disabled,f=!u||l>1||!i||t;return!(!f||!n||!r)};function $Z(e,t){var n=e.setup.velocityAnimation,r=n.equalToMove,o=n.animationTime,i=n.sensitivity;return r?o*t*i:o}function z2(e,t,n,r,o,i,s,l,u,f){if(o){if(t>s&&n>s){var m=s+(e-s)*f;return m>u?u:m<s?s:m}if(t<i&&n<i){var m=i+(e-i)*f;return m<l?l:m>i?i:m}}return r?t:V1(e,i,s,o)}function RZ(e,t){var n=1;return t?Math.min(n,e.offsetWidth/window.innerWidth):n}function PZ(e,t){var n=EZ(e);if(n){var r=e.lastMousePosition,o=e.velocityTime,i=e.setup,s=e.wrapperComponent,l=i.velocityAnimation.equalToMove,u=Date.now();if(r&&o&&s){var f=RZ(s,l),m=t.x-r.x,p=t.y-r.y,g=m/f,y=p/f,x=u-o,S=m*m+p*p,E=Math.sqrt(S)/x;e.velocity={velocityX:g,velocityY:y,total:E}}e.lastMousePosition=t,e.velocityTime=u}}function TZ(e){var t=e.velocity,n=e.bounds,r=e.setup,o=e.wrapperComponent,i=CZ(e);if(!(!i||!t||!n||!o)){var s=t.velocityX,l=t.velocityY,u=t.total,f=n.maxPositionX,m=n.minPositionX,p=n.maxPositionY,g=n.minPositionY,y=r.limitToBounds,x=r.alignmentAnimation,S=r.zoomAnimation,E=r.panning,_=E.lockAxisY,b=E.lockAxisX,C=S.animationType,R=x.sizeX,k=x.sizeY,O=x.velocityAlignmentTime,A=O,I=$Z(e,u),z=Math.max(I,A),H=cm(e,R),ie=cm(e,k),K=H*o.offsetWidth/100,te=ie*o.offsetHeight/100,U=f+K,re=m-K,V=p+te,J=g-te,G=e.transformState,Z=new Date().getTime();O3(e,C,z,function(Q){var le=e.transformState,L=le.scale,ue=le.positionX,Ne=le.positionY,Ke=new Date().getTime()-Z,Me=Ke/A,me=A3[x.animationType],be=1-me(Math.min(1,Me)),Ee=1-Q,Oe=ue+s*Ee,Ie=Ne+l*Ee,ze=z2(Oe,G.positionX,ue,b,y,m,f,re,U,be),ht=z2(Ie,G.positionY,Ne,_,y,g,p,J,V,be);(ue!==Oe||Ne!==Ie)&&e.setTransformState(L,ze,ht)})}}function U2(e,t){var n=e.transformState.scale;Vo(e),wc(e,n),window.TouchEvent!==void 0&&t instanceof TouchEvent?xZ(e,t):wZ(e,t)}function N3(e){var t=e.transformState.scale,n=e.setup,r=n.minScale,o=n.alignmentAnimation,i=o.disabled,s=o.sizeX,l=o.sizeY,u=o.animationTime,f=o.animationType,m=i||t<r||!s&&!l;if(!m){var p=bZ(e);p&&Ws(e,p,u,f)}}function V2(e,t,n){var r=e.startCoords,o=e.setup,i=o.alignmentAnimation,s=i.sizeX,l=i.sizeY;if(r){var u=_Z(e,t,n),f=u.x,m=u.y,p=cm(e,s),g=cm(e,l);PZ(e,{x:f,y:m}),SZ(e,f,m,p,g)}}function kZ(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=r==null?void 0:r.getBoundingClientRect(),s=o==null?void 0:o.getBoundingClientRect(),l=(i==null?void 0:i.width)||0,u=(i==null?void 0:i.height)||0,f=(s==null?void 0:s.width)||0,m=(s==null?void 0:s.height)||0,p=l<f||u<m,g=!t&&n&&(n==null?void 0:n.total)>.1&&p;g?TZ(e):N3(e)}}function ob(e,t,n,r){var o=e.setup,i=o.minScale,s=o.maxScale,l=o.limitToBounds,u=Gd(Yr(t,2),i,s,0,!1),f=wc(e,u),m=vg(e,n,r,u,f,l),p=m.x,g=m.y;return{scale:u,positionX:p,positionY:g}}function D3(e,t,n){var r=e.transformState.scale,o=e.wrapperComponent,i=e.setup,s=i.minScale,l=i.limitToBounds,u=i.zoomAnimation,f=u.disabled,m=u.animationTime,p=u.animationType,g=f||r>=s;if((r>=1||l)&&N3(e),!(g||!o||!e.mounted)){var y=t||o.offsetWidth/2,x=n||o.offsetHeight/2,S=ob(e,s,y,x);S&&Ws(e,S,m,p)}}var ks=function(){return ks=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},ks.apply(this,arguments)};function W2(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Ch={previousScale:1,scale:1,positionX:0,positionY:0},hu={disabled:!1,minPositionX:null,maxPositionX:null,minPositionY:null,maxPositionY:null,minScale:1,maxScale:8,limitToBounds:!0,centerZoomedOut:!1,centerOnInit:!1,disablePadding:!1,smooth:!0,wheel:{step:.2,disabled:!1,smoothStep:.001,wheelDisabled:!1,touchPadDisabled:!1,activationKeys:[],excluded:[]},panning:{disabled:!1,velocityDisabled:!1,lockAxisX:!1,lockAxisY:!1,allowLeftClickPan:!0,allowMiddleClickPan:!0,allowRightClickPan:!0,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}},I3=function(e){var t,n,r,o;return{previousScale:(t=e.initialScale)!==null&&t!==void 0?t:Ch.scale,scale:(n=e.initialScale)!==null&&n!==void 0?n:Ch.scale,positionX:(r=e.initialPositionX)!==null&&r!==void 0?r:Ch.positionX,positionY:(o=e.initialPositionY)!==null&&o!==void 0?o:Ch.positionY}},H2=function(e){var t=ks({},hu);return Object.keys(e).forEach(function(n){var r=typeof e[n]<"u",o=typeof hu[n]<"u";if(o&&r){var i=Object.prototype.toString.call(hu[n]),s=i==="[object Object]",l=i==="[object Array]";s?t[n]=ks(ks({},hu[n]),e[n]):l?t[n]=W2(W2([],hu[n],!0),e[n],!0):t[n]=e[n]}}),t},L3=function(e,t,n){var r=e.transformState.scale,o=e.wrapperComponent,i=e.setup,s=i.maxScale,l=i.minScale,u=i.zoomAnimation,f=i.smooth,m=u.size;if(!o)throw new Error("Wrapper is not mounted");var p=f?r*Math.exp(t*n):r+t*n,g=Gd(Yr(p,3),l,s,m,!1);return g};function F3(e,t,n,r,o){var i=e.wrapperComponent,s=e.transformState,l=s.scale,u=s.positionX,f=s.positionY;if(!i)return console.error("No WrapperComponent found");var m=i.offsetWidth,p=i.offsetHeight,g=(m/2-u)/l,y=(p/2-f)/l,x=L3(e,t,n),S=ob(e,x,g,y);if(!S)return console.error("Error during zoom event. New transformation state was not calculated.");Ws(e,S,r,o)}function j3(e,t,n,r){var o=e.setup,i=e.wrapperComponent,s=o.limitToBounds,l=I3(e.props),u=e.transformState,f=u.scale,m=u.positionX,p=u.positionY;if(i){var g=rb(e,l.scale),y=gg(l.positionX,l.positionY,g,s,0,0,i),x={scale:l.scale,positionX:y.x,positionY:y.y};f===l.scale&&m===l.positionX&&p===l.positionY||(r==null||r(),Ws(e,x,t,n))}}function AZ(e,t,n,r){var o=e.getBoundingClientRect(),i=t.getBoundingClientRect(),s=n.getBoundingClientRect(),l=i.x*r.scale,u=i.y*r.scale;return{x:(o.x-s.x+l)/r.scale,y:(o.y-s.y+u)/r.scale}}function MZ(e,t,n){var r=e.wrapperComponent,o=e.contentComponent,i=e.transformState,s=e.setup,l=s.limitToBounds,u=s.minScale,f=s.maxScale;if(!r||!o)return i;var m=r.getBoundingClientRect(),p=t.getBoundingClientRect(),g=AZ(t,r,o,i),y=g.x,x=g.y,S=p.width/i.scale,E=p.height/i.scale,_=r.offsetWidth/S,b=r.offsetHeight/E,C=Gd(n||Math.min(_,b),u,f,0,!1),R=(m.width-S*C)/2,k=(m.height-E*C)/2,O=(m.left-y)*C+R,A=(m.top-x)*C+k,I=rb(e,C),z=gg(O,A,I,l,0,0,r),H=z.x,ie=z.y;return{positionX:H,positionY:ie,scale:C}}var OZ=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),F3(e,1,t,n,r)}},NZ=function(e){return function(t,n,r){t===void 0&&(t=.5),n===void 0&&(n=300),r===void 0&&(r="easeOut"),F3(e,-1,t,n,r)}},DZ=function(e){return function(t,n,r,o,i){o===void 0&&(o=300),i===void 0&&(i="easeOut");var s=e.transformState,l=s.positionX,u=s.positionY,f=s.scale,m=e.wrapperComponent,p=e.contentComponent,g=e.setup.disabled;if(!(g||!m||!p)){var y={positionX:Number.isNaN(t)?l:t,positionY:Number.isNaN(n)?u:n,scale:Number.isNaN(r)?f:r};Ws(e,y,o,i)}}},IZ=function(e){return function(t,n){t===void 0&&(t=200),n===void 0&&(n="easeOut"),j3(e,t,n)}},LZ=function(e){return function(t,n,r){n===void 0&&(n=200),r===void 0&&(r="easeOut");var o=e.transformState,i=e.wrapperComponent,s=e.contentComponent;if(i&&s){var l=B3(t||o.scale,i,s);Ws(e,l,n,r)}}},FZ=function(e){return function(t,n,r,o){r===void 0&&(r=600),o===void 0&&(o="easeOut"),Vo(e);var i=e.wrapperComponent,s=typeof t=="string"?document.getElementById(t):t;if(i&&s&&i.contains(s)){var l=MZ(e,s,n);Ws(e,l,r,o)}}},W1=function(e){return{instance:e,zoomIn:OZ(e),zoomOut:NZ(e),setTransform:DZ(e),resetTransform:IZ(e),centerView:LZ(e),zoomToElement:FZ(e)}},jZ=function(e){return{instance:e,state:e.transformState}},Et=function(e){var t={};return Object.assign(t,jZ(e)),Object.assign(t,W1(e)),t},W0=!1;function H0(){try{var e={get passive(){return W0=!0,!1}};return e}catch{return W0=!1,W0}}var yg=function(e,t){var n=e.tagName.toUpperCase(),r=t.find(function(i){return i.toUpperCase()===n});if(r)return!0;var o=t.find(function(i){return e.classList.contains(i)});return!!o},H1=function(e){e&&clearTimeout(e)},BZ=function(e,t,n){return"translate(".concat(e,"px, ").concat(t,"px) scale(").concat(n,")")},B3=function(e,t,n){var r=n.offsetWidth*e,o=n.offsetHeight*e,i=(t.offsetWidth-r)/2,s=(t.offsetHeight-o)/2;return{scale:e,positionX:i,positionY:s}};function zZ(e){return function(t){e.forEach(function(n){typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var UZ=function(e,t){var n=e.setup.wheel,r=n.disabled,o=n.wheelDisabled,i=n.touchPadDisabled,s=n.excluded,l=e.isInitialized,u=e.isPanning,f=t.target,m=l&&!u&&!r&&f;if(!m||o&&!t.ctrlKey||i&&t.ctrlKey)return!1;var p=yg(f,s);return!p},VZ=function(e){return e?e.deltaY<0?1:-1:0};function WZ(e,t){var n=VZ(e),r=tZ(t,n);return r}function z3(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 s=e.touches[0];o=(s.clientX-r.left)/n,i=(s.clientY-r.top)/n}return(Number.isNaN(o)||Number.isNaN(i))&&console.error("No mouse or touch offset found"),{x:o,y:i}}var HZ=function(e,t,n,r,o){var i=e.transformState.scale,s=e.wrapperComponent,l=e.setup,u=l.maxScale,f=l.minScale,m=l.zoomAnimation,p=l.disablePadding,g=m.size,y=m.disabled;if(!s)throw new Error("Wrapper is not mounted");var x=i+t*n;if(o)return x;var S=r?!1:!y,E=Gd(Yr(x,3),f,u,g,S&&!p);return E},KZ=function(e,t){var n=e.previousWheelEvent,r=e.transformState.scale,o=e.setup,i=o.maxScale,s=o.minScale;return n?r<i||r>s||Math.sign(n.deltaY)!==Math.sign(t.deltaY)||n.deltaY>0&&n.deltaY<t.deltaY||n.deltaY<0&&n.deltaY>t.deltaY||Math.sign(n.deltaY)!==Math.sign(t.deltaY):!1},GZ=function(e,t){var n=e.setup.pinch,r=n.disabled,o=n.excluded,i=e.isInitialized,s=t.target,l=i&&!r&&s;if(!l)return!1;var u=yg(s,o);return!u},YZ=function(e){var t=e.setup.pinch.disabled,n=e.isInitialized,r=e.pinchStartDistance,o=n&&!t&&r;return!!o},XZ=function(e,t,n){var r=n.getBoundingClientRect(),o=e.touches,i=Yr(o[0].clientX-r.left,5),s=Yr(o[0].clientY-r.top,5),l=Yr(o[1].clientX-r.left,5),u=Yr(o[1].clientY-r.top,5);return{x:(i+l)/2/t,y:(s+u)/2/t}},U3=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))},ZZ=function(e,t){var n=e.pinchStartScale,r=e.pinchStartDistance,o=e.setup,i=o.maxScale,s=o.minScale,l=o.zoomAnimation,u=o.disablePadding,f=l.size,m=l.disabled;if(!n||r===null||!t)throw new Error("Pinch touches distance was not provided");if(t<0)return e.transformState.scale;var p=t/r,g=p*n;return Gd(Yr(g,2),s,i,f,!m&&!u)},qZ=160,QZ=100,JZ=function(e,t){var n=e.props,r=n.onWheelStart,o=n.onZoomStart;e.wheelStopEventTimer||(Vo(e),Ot(Et(e),t,r),Ot(Et(e),t,o))},eq=function(e,t){var n=e.props,r=n.onWheel,o=n.onZoom,i=e.contentComponent,s=e.setup,l=e.transformState,u=l.scale,f=s.limitToBounds,m=s.centerZoomedOut,p=s.zoomAnimation,g=s.wheel,y=s.disablePadding,x=s.smooth,S=p.size,E=p.disabled,_=g.step,b=g.smoothStep;if(!i)throw new Error("Component not mounted");t.preventDefault(),t.stopPropagation();var C=WZ(t,null),R=x?b*Math.abs(t.deltaY):_,k=HZ(e,C,R,!t.ctrlKey);if(u!==k){var O=wc(e,k),A=z3(t,i,u),I=E||S===0||m||y,z=f&&I,H=vg(e,A.x,A.y,k,O,z),ie=H.x,K=H.y;e.previousWheelEvent=t,e.setTransformState(k,ie,K),Ot(Et(e),t,r),Ot(Et(e),t,o)}},tq=function(e,t){var n=e.props,r=n.onWheelStop,o=n.onZoomStop;H1(e.wheelAnimationTimer),e.wheelAnimationTimer=setTimeout(function(){e.mounted&&(D3(e,t.x,t.y),e.wheelAnimationTimer=null)},QZ);var i=KZ(e,t);i&&(H1(e.wheelStopEventTimer),e.wheelStopEventTimer=setTimeout(function(){e.mounted&&(e.wheelStopEventTimer=null,Ot(Et(e),t,r),Ot(Et(e),t,o))},qZ))},nq=function(e,t){var n=U3(t);e.pinchStartDistance=n,e.lastDistance=n,e.pinchStartScale=e.transformState.scale,e.isPanning=!1,Vo(e)},rq=function(e,t){var n=e.contentComponent,r=e.pinchStartDistance,o=e.transformState.scale,i=e.setup,s=i.limitToBounds,l=i.centerZoomedOut,u=i.zoomAnimation,f=u.disabled,m=u.size;if(!(r===null||!n)){var p=XZ(t,o,n);if(!(!Number.isFinite(p.x)||!Number.isFinite(p.y))){var g=U3(t),y=ZZ(e,g);if(y!==o){var x=wc(e,y),S=f||m===0||l,E=s&&S,_=vg(e,p.x,p.y,y,x,E),b=_.x,C=_.y;e.pinchMidpoint=p,e.lastDistance=g,e.setTransformState(y,b,C)}}}},oq=function(e){var t=e.pinchMidpoint;e.velocity=null,e.lastDistance=null,e.pinchMidpoint=null,e.pinchStartScale=null,e.pinchStartDistance=null,D3(e,t==null?void 0:t.x,t==null?void 0:t.y)},V3=function(e,t){var n=e.props.onZoomStop,r=e.setup.doubleClick.animationTime;H1(e.doubleClickStopEventTimer),e.doubleClickStopEventTimer=setTimeout(function(){e.doubleClickStopEventTimer=null,Ot(Et(e),t,n)},r)},iq=function(e,t){var n=e.props,r=n.onZoomStart,o=n.onZoom,i=e.setup.doubleClick,s=i.animationTime,l=i.animationType;Ot(Et(e),t,r),j3(e,s,l,function(){return Ot(Et(e),t,o)}),V3(e,t)};function sq(e,t){var n=e.setup,r=e.doubleClickStopEventTimer,o=e.transformState,i=e.contentComponent,s=o.scale,l=e.props,u=l.onZoomStart,f=l.onZoom,m=n.doubleClick,p=m.disabled,g=m.mode,y=m.step,x=m.animationTime,S=m.animationType;if(!p&&!r){if(g==="reset")return iq(e,t);if(!i)return console.error("No ContentComponent found");var E=g==="zoomOut"?-1:1,_=L3(e,E,y);if(s!==_){Ot(Et(e),t,u);var b=z3(t,i,s),C=ob(e,_,b.x,b.y);if(!C)return console.error("Error during zoom event. New transformation state was not calculated.");Ot(Et(e),t,f),Ws(e,C,x,S),V3(e,t)}}}var aq=function(e,t){var n=e.isInitialized,r=e.setup,o=e.wrapperComponent,i=r.doubleClick,s=i.disabled,l=i.excluded,u=t.target,f=o==null?void 0:o.contains(u),m=n&&u&&f&&!s;if(!m)return!1;var p=yg(u,l);return!p},lq=function(){function e(t){var n=this;this.mounted=!0,this.onChangeCallbacks=new Set,this.onInitCallbacks=new Set,this.wrapperComponent=null,this.contentComponent=null,this.isInitialized=!1,this.bounds=null,this.previousWheelEvent=null,this.wheelStopEventTimer=null,this.wheelAnimationTimer=null,this.isPanning=!1,this.startCoords=null,this.lastTouch=null,this.distance=null,this.lastDistance=null,this.pinchStartDistance=null,this.pinchStartScale=null,this.pinchMidpoint=null,this.doubleClickStopEventTimer=null,this.velocity=null,this.velocityTime=null,this.lastMousePosition=null,this.animate=!1,this.animation=null,this.maxBounds=null,this.pressedKeys={},this.mount=function(){n.initializeWindowEvents()},this.unmount=function(){n.cleanupWindowEvents()},this.update=function(r){wc(n,n.transformState.scale),n.setup=H2(r)},this.initializeWindowEvents=function(){var r,o=H0(),i=(r=n.wrapperComponent)===null||r===void 0?void 0:r.ownerDocument,s=i==null?void 0:i.defaultView;s==null||s.addEventListener("mousedown",n.onPanningStart,o),s==null||s.addEventListener("mousemove",n.onPanning,o),s==null||s.addEventListener("mouseup",n.onPanningStop,o),i==null||i.addEventListener("mouseleave",n.clearPanning,o),s==null||s.addEventListener("keyup",n.setKeyUnPressed,o),s==null||s.addEventListener("keydown",n.setKeyPressed,o)},this.cleanupWindowEvents=function(){var r,o,i=H0(),s=(r=n.wrapperComponent)===null||r===void 0?void 0:r.ownerDocument,l=s==null?void 0:s.defaultView;l==null||l.removeEventListener("mousedown",n.onPanningStart,i),l==null||l.removeEventListener("mousemove",n.onPanning,i),l==null||l.removeEventListener("mouseup",n.onPanningStop,i),s==null||s.removeEventListener("mouseleave",n.clearPanning,i),l==null||l.removeEventListener("keyup",n.setKeyUnPressed,i),l==null||l.removeEventListener("keydown",n.setKeyPressed,i),document.removeEventListener("mouseleave",n.clearPanning,i),Vo(n),(o=n.observer)===null||o===void 0||o.disconnect()},this.handleInitializeWrapperEvents=function(r){var o=H0();r.addEventListener("wheel",n.onWheelZoom,o),r.addEventListener("dblclick",n.onDoubleClick,o),r.addEventListener("touchstart",n.onTouchPanningStart,o),r.addEventListener("touchmove",n.onTouchPanning,o),r.addEventListener("touchend",n.onTouchPanningStop,o)},this.handleInitialize=function(r){var o=n.setup.centerOnInit;n.applyTransformation(),n.onInitCallbacks.forEach(function(i){return i(Et(n))}),o&&(n.setCenter(),n.observer=new ResizeObserver(function(){var i;n.onInitCallbacks.forEach(function(s){return s(Et(n))}),n.setCenter(),(i=n.observer)===null||i===void 0||i.disconnect()}),n.observer.observe(r))},this.onWheelZoom=function(r){var o=n.setup.disabled;if(!o){var i=UZ(n,r);if(i){var s=n.isPressingKeys(n.setup.wheel.activationKeys);s&&(JZ(n,r),eq(n,r),tq(n,r))}}},this.onPanningStart=function(r){var o=n.setup.disabled,i=n.props.onPanningStart;if(!o){var s=j2(n,r);if(s){var l=n.isPressingKeys(n.setup.panning.activationKeys);l&&(r.button===0&&!n.setup.panning.allowLeftClickPan||r.button===1&&!n.setup.panning.allowMiddleClickPan||r.button===2&&!n.setup.panning.allowRightClickPan||(r.preventDefault(),r.stopPropagation(),Vo(n),U2(n,r),Ot(Et(n),r,i)))}}},this.onPanning=function(r){var o=n.setup.disabled,i=n.props.onPanning;if(!o){var s=B2(n);if(s){var l=n.isPressingKeys(n.setup.panning.activationKeys);l&&(r.preventDefault(),r.stopPropagation(),V2(n,r.clientX,r.clientY),Ot(Et(n),r,i))}}},this.onPanningStop=function(r){var o=n.props.onPanningStop;n.isPanning&&(kZ(n),Ot(Et(n),r,o))},this.onPinchStart=function(r){var o=n.setup.disabled,i=n.props,s=i.onPinchingStart,l=i.onZoomStart;if(!o){var u=GZ(n,r);u&&(nq(n,r),Vo(n),Ot(Et(n),r,s),Ot(Et(n),r,l))}},this.onPinch=function(r){var o=n.setup.disabled,i=n.props,s=i.onPinching,l=i.onZoom;if(!o){var u=YZ(n);u&&(r.preventDefault(),r.stopPropagation(),rq(n,r),Ot(Et(n),r,s),Ot(Et(n),r,l))}},this.onPinchStop=function(r){var o=n.props,i=o.onPinchingStop,s=o.onZoomStop;n.pinchStartScale&&(oq(n),Ot(Et(n),r,i),Ot(Et(n),r,s))},this.onTouchPanningStart=function(r){var o=n.setup.disabled,i=n.props.onPanningStart;if(!o){var s=j2(n,r);if(s){var l=n.lastTouch&&+new Date-n.lastTouch<200;if(l&&r.touches.length===1)n.onDoubleClick(r);else{n.lastTouch=+new Date,Vo(n);var u=r.touches,f=u.length===1,m=u.length===2;f&&(Vo(n),U2(n,r),Ot(Et(n),r,i)),m&&n.onPinchStart(r)}}}},this.onTouchPanning=function(r){var o=n.setup.disabled,i=n.props.onPanning;if(n.isPanning&&r.touches.length===1){if(o)return;var s=B2(n);if(!s)return;r.preventDefault(),r.stopPropagation();var l=r.touches[0];V2(n,l.clientX,l.clientY),Ot(Et(n),r,i)}else r.touches.length>1&&n.onPinch(r)},this.onTouchPanningStop=function(r){n.onPanningStop(r),n.onPinchStop(r)},this.onDoubleClick=function(r){var o=n.setup.disabled;if(!o){var i=aq(n,r);i&&sq(n,r)}},this.clearPanning=function(r){n.isPanning&&n.onPanningStop(r)},this.setKeyPressed=function(r){n.pressedKeys[r.key]=!0},this.setKeyUnPressed=function(r){n.pressedKeys[r.key]=!1},this.isPressingKeys=function(r){return r.length?!!r.find(function(o){return n.pressedKeys[o]}):!0},this.setTransformState=function(r,o,i){var s=n.props.onTransformed;if(!Number.isNaN(r)&&!Number.isNaN(o)&&!Number.isNaN(i)){r!==n.transformState.scale&&(n.transformState.previousScale=n.transformState.scale,n.transformState.scale=r),n.transformState.positionX=o,n.transformState.positionY=i,n.applyTransformation();var l=Et(n);n.onChangeCallbacks.forEach(function(u){return u(l)}),Ot(l,{scale:r,positionX:o,positionY:i},s)}else console.error("Detected NaN set state values")},this.setCenter=function(){if(n.wrapperComponent&&n.contentComponent){var r=B3(n.transformState.scale,n.wrapperComponent,n.contentComponent);n.setTransformState(r.scale,r.positionX,r.positionY)}},this.handleTransformStyles=function(r,o,i){return n.props.customTransform?n.props.customTransform(r,o,i):BZ(r,o,i)},this.applyTransformation=function(){if(!(!n.mounted||!n.contentComponent)){var r=n.transformState,o=r.scale,i=r.positionX,s=r.positionY,l=n.handleTransformStyles(i,s,o);n.contentComponent.style.transform=l}},this.getContext=function(){return Et(n)},this.onChange=function(r){return n.onChangeCallbacks.has(r)||n.onChangeCallbacks.add(r),function(){n.onChangeCallbacks.delete(r)}},this.onInit=function(r){return n.onInitCallbacks.has(r)||n.onInitCallbacks.add(r),function(){n.onInitCallbacks.delete(r)}},this.init=function(r,o){n.cleanupWindowEvents(),n.wrapperComponent=r,n.contentComponent=o,wc(n,n.transformState.scale),n.handleInitializeWrapperEvents(r),n.handleInitialize(o),n.initializeWindowEvents(),n.isInitialized=!0;var i=Et(n);Ot(i,void 0,n.props.onInit)},this.props=t,this.setup=H2(this.props),this.transformState=I3(this.props)}return e}(),ib=Be.createContext(null),cq=function(e,t){return typeof e=="function"?e(t):e},uq=Be.forwardRef(function(e,t){var n=d.useRef(new lq(e)).current,r=cq(e.children,W1(n));return d.useImperativeHandle(t,function(){return W1(n)},[n]),d.useEffect(function(){n.update(e)},[n,e]),Be.createElement(ib.Provider,{value:n},r)});Be.forwardRef(function(e,t){var n=d.useRef(null),r=d.useContext(ib);return d.useEffect(function(){return r.onChange(function(o){if(n.current){var i=0,s=0;n.current.style.transform=r.handleTransformStyles(i,s,1/o.instance.transformState.scale)}})},[r]),Be.createElement("div",ks({},e,{ref:zZ([n,t])}))});function dq(e,t){t===void 0&&(t={});var n=t.insertAt;if(!(!e||typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",n==="top"&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}var fq=`.transform-component-module_wrapper__SPB86 {
position: relative;
width: -moz-fit-content;
width: fit-content;
height: -moz-fit-content;
height: fit-content;
overflow: hidden;
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Safari */
-khtml-user-select: none; /* Konqueror HTML */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none;
margin: 0;
padding: 0;
}
.transform-component-module_content__FBWxo {
display: flex;
flex-wrap: wrap;
width: -moz-fit-content;
width: fit-content;
height: -moz-fit-content;
height: fit-content;
margin: 0;
padding: 0;
transform-origin: 0% 0%;
}
.transform-component-module_content__FBWxo img {
pointer-events: none;
}
`,K2={wrapper:"transform-component-module_wrapper__SPB86",content:"transform-component-module_content__FBWxo"};dq(fq);var hq=function(e){var t=e.children,n=e.wrapperClass,r=n===void 0?"":n,o=e.contentClass,i=o===void 0?"":o,s=e.wrapperStyle,l=e.contentStyle,u=e.wrapperProps,f=u===void 0?{}:u,m=e.contentProps,p=m===void 0?{}:m,g=d.useContext(ib),y=g.init,x=g.cleanupWindowEvents,S=d.useRef(null),E=d.useRef(null);return d.useEffect(function(){var _=S.current,b=E.current;return _!==null&&b!==null&&y&&(y==null||y(_,b)),function(){x==null||x()}},[]),Be.createElement("div",ks({},f,{ref:S,className:"react-transform-wrapper ".concat(K2.wrapper," ").concat(r),style:s}),Be.createElement("div",ks({},p,{ref:E,className:"react-transform-component ".concat(K2.content," ").concat(i),style:l}),t))};const W3=["PageUp","PageDown"],H3=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],K3={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Yd="Slider",[K1,pq,mq]=Wd(Yd),[G3,bte]=Tn(Yd,[mq]),[gq,wg]=G3(Yd),vq=d.forwardRef((e,t)=>{const{name:n,min:r=0,max:o=100,step:i=1,orientation:s="horizontal",disabled:l=!1,minStepsBetweenThumbs:u=0,defaultValue:f=[r],value:m,onValueChange:p=()=>{},onValueCommit:g=()=>{},inverted:y=!1,...x}=e,[S,E]=d.useState(null),_=Ve(t,U=>E(U)),b=d.useRef(new Set),C=d.useRef(0),R=s==="horizontal",k=S?!!S.closest("form"):!0,O=R?yq:wq,[A=[],I]=eo({prop:m,defaultProp:f,onChange:U=>{var re;(re=[...b.current][C.current])===null||re===void 0||re.focus(),p(U)}}),z=d.useRef(A);function H(U){const re=Pq(A,U);te(U,re)}function ie(U){te(U,C.current)}function K(){const U=z.current[C.current];A[C.current]!==U&&g(A)}function te(U,re,{commit:V}={commit:!1}){const J=Mq(i),G=Oq(Math.round((U-r)/i)*i+r,J),Z=fd(G,[r,o]);I((Q=[])=>{const le=$q(Q,Z,re);if(Aq(le,u*i)){C.current=le.indexOf(Z);const L=String(le)!==String(Q);return L&&V&&g(le),L?le:Q}else return Q})}return d.createElement(gq,{scope:e.__scopeSlider,disabled:l,min:r,max:o,valueIndexToChangeRef:C,thumbs:b.current,values:A,orientation:s},d.createElement(K1.Provider,{scope:e.__scopeSlider},d.createElement(K1.Slot,{scope:e.__scopeSlider},d.createElement(O,Y({"aria-disabled":l,"data-disabled":l?"":void 0},x,{ref:_,onPointerDown:fe(x.onPointerDown,()=>{l||(z.current=A)}),min:r,max:o,inverted:y,onSlideStart:l?void 0:H,onSlideMove:l?void 0:ie,onSlideEnd:l?void 0:K,onHomeKeyDown:()=>!l&&te(r,0,{commit:!0}),onEndKeyDown:()=>!l&&te(o,A.length-1,{commit:!0}),onStepKeyDown:({event:U,direction:re})=>{if(!l){const G=W3.includes(U.key)||U.shiftKey&&H3.includes(U.key)?10:1,Z=C.current,Q=A[Z],le=i*G*re;te(Q+le,Z,{commit:!0})}}})))),k&&A.map((U,re)=>d.createElement(Cq,{key:re,name:n?n+(A.length>1?"[]":""):void 0,value:U})))}),[Y3,X3]=G3(Yd,{startEdge:"left",endEdge:"right",size:"width",direction:1}),yq=d.forwardRef((e,t)=>{const{min:n,max:r,dir:o,inverted:i,onSlideStart:s,onSlideMove:l,onSlideEnd:u,onStepKeyDown:f,...m}=e,[p,g]=d.useState(null),y=Ve(t,C=>g(C)),x=d.useRef(),S=Ac(o),E=S==="ltr",_=E&&!i||!E&&i;function b(C){const R=x.current||p.getBoundingClientRect(),k=[0,R.width],A=sb(k,_?[n,r]:[r,n]);return x.current=R,A(C-R.left)}return d.createElement(Y3,{scope:e.__scopeSlider,startEdge:_?"left":"right",endEdge:_?"right":"left",direction:_?1:-1,size:"width"},d.createElement(Z3,Y({dir:S,"data-orientation":"horizontal"},m,{ref:y,style:{...m.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:C=>{const R=b(C.clientX);s==null||s(R)},onSlideMove:C=>{const R=b(C.clientX);l==null||l(R)},onSlideEnd:()=>{x.current=void 0,u==null||u()},onStepKeyDown:C=>{const k=K3[_?"from-left":"from-right"].includes(C.key);f==null||f({event:C,direction:k?-1:1})}})))}),wq=d.forwardRef((e,t)=>{const{min:n,max:r,inverted:o,onSlideStart:i,onSlideMove:s,onSlideEnd:l,onStepKeyDown:u,...f}=e,m=d.useRef(null),p=Ve(t,m),g=d.useRef(),y=!o;function x(S){const E=g.current||m.current.getBoundingClientRect(),_=[0,E.height],C=sb(_,y?[r,n]:[n,r]);return g.current=E,C(S-E.top)}return d.createElement(Y3,{scope:e.__scopeSlider,startEdge:y?"bottom":"top",endEdge:y?"top":"bottom",size:"height",direction:y?1:-1},d.createElement(Z3,Y({"data-orientation":"vertical"},f,{ref:p,style:{...f.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:S=>{const E=x(S.clientY);i==null||i(E)},onSlideMove:S=>{const E=x(S.clientY);s==null||s(E)},onSlideEnd:()=>{g.current=void 0,l==null||l()},onStepKeyDown:S=>{const _=K3[y?"from-bottom":"from-top"].includes(S.key);u==null||u({event:S,direction:_?-1:1})}})))}),Z3=d.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:o,onSlideEnd:i,onHomeKeyDown:s,onEndKeyDown:l,onStepKeyDown:u,...f}=e,m=wg(Yd,n);return d.createElement(Ae.span,Y({},f,{ref:t,onKeyDown:fe(e.onKeyDown,p=>{p.key==="Home"?(s(p),p.preventDefault()):p.key==="End"?(l(p),p.preventDefault()):W3.concat(H3).includes(p.key)&&(u(p),p.preventDefault())}),onPointerDown:fe(e.onPointerDown,p=>{const g=p.target;g.setPointerCapture(p.pointerId),p.preventDefault(),m.thumbs.has(g)?g.focus():r(p)}),onPointerMove:fe(e.onPointerMove,p=>{p.target.hasPointerCapture(p.pointerId)&&o(p)}),onPointerUp:fe(e.onPointerUp,p=>{const g=p.target;g.hasPointerCapture(p.pointerId)&&(g.releasePointerCapture(p.pointerId),i(p))})}))}),xq="SliderTrack",bq=d.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=wg(xq,n);return d.createElement(Ae.span,Y({"data-disabled":o.disabled?"":void 0,"data-orientation":o.orientation},r,{ref:t}))}),G2="SliderRange",Sq=d.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,o=wg(G2,n),i=X3(G2,n),s=d.useRef(null),l=Ve(t,s),u=o.values.length,f=o.values.map(g=>q3(g,o.min,o.max)),m=u>1?Math.min(...f):0,p=100-Math.max(...f);return d.createElement(Ae.span,Y({"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0},r,{ref:l,style:{...e.style,[i.startEdge]:m+"%",[i.endEdge]:p+"%"}}))}),Y2="SliderThumb",_q=d.forwardRef((e,t)=>{const n=pq(e.__scopeSlider),[r,o]=d.useState(null),i=Ve(t,l=>o(l)),s=d.useMemo(()=>r?n().findIndex(l=>l.ref.current===r):-1,[n,r]);return d.createElement(Eq,Y({},e,{ref:i,index:s}))}),Eq=d.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,...o}=e,i=wg(Y2,n),s=X3(Y2,n),[l,u]=d.useState(null),f=Ve(t,E=>u(E)),m=Sx(l),p=i.values[r],g=p===void 0?0:q3(p,i.min,i.max),y=Rq(r,i.values.length),x=m==null?void 0:m[s.size],S=x?Tq(x,g,s.direction):0;return d.useEffect(()=>{if(l)return i.thumbs.add(l),()=>{i.thumbs.delete(l)}},[l,i.thumbs]),d.createElement("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[s.startEdge]:`calc(${g}% + ${S}px)`}},d.createElement(K1.ItemSlot,{scope:e.__scopeSlider},d.createElement(Ae.span,Y({role:"slider","aria-label":e["aria-label"]||y,"aria-valuemin":i.min,"aria-valuenow":p,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,tabIndex:i.disabled?void 0:0},o,{ref:f,style:p===void 0?{display:"none"}:e.style,onFocus:fe(e.onFocus,()=>{i.valueIndexToChangeRef.current=r})}))))}),Cq=e=>{const{value:t,...n}=e,r=d.useRef(null),o=Kx(t);return d.useEffect(()=>{const i=r.current,s=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(s,"value").set;if(o!==t&&u){const f=new Event("input",{bubbles:!0});u.call(i,t),i.dispatchEvent(f)}},[o,t]),d.createElement("input",Y({style:{display:"none"}},n,{ref:r,defaultValue:t}))};function $q(e=[],t,n){const r=[...e];return r[n]=t,r.sort((o,i)=>o-i)}function q3(e,t,n){const i=100/(n-t)*(e-t);return fd(i,[0,100])}function Rq(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function Pq(e,t){if(e.length===1)return 0;const n=e.map(o=>Math.abs(o-t)),r=Math.min(...n);return n.indexOf(r)}function Tq(e,t,n){const r=e/2,i=sb([0,50],[0,r]);return(r-i(t)*n)*n}function kq(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Aq(e,t){if(t>0){const n=kq(e);return Math.min(...n)>=t}return!0}function sb(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Mq(e){return(String(e).split(".")[1]||"").length}function Oq(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}const Q3=vq,Nq=bq,Dq=Sq,Iq=_q,po=d.forwardRef(({className:e,...t},n)=>v.jsxs(Q3,{ref:n,className:xe("relative flex w-full touch-none select-none items-center",e),tabIndex:-1,...t,children:[v.jsx(Nq,{className:"relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20 data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50",children:v.jsx(Dq,{className:"absolute h-full bg-primary data-[disabled]:cursor-not-allowed "})}),v.jsx(Iq,{tabIndex:-1,className:"block h-4 w-4 rounded-full border border-primary/60 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring data-[disabled]:cursor-not-allowed"})]}));po.displayName=Q3.displayName;const dl={capture:!0,passive:!1},Lq=2,X2=(e,t,n,r,o,i)=>{if(e!==n&&t===r){if(e<0)return[0,r];if(e+t>i)return[i-r,r]}else{if(t<o)return e===n?[e,o]:[e+t-o,o];if(e<0)return[0,e+t];if(e+t>i)return[e,i-e]}return[e,t]},Fq=e=>{const{minHeight:t,minWidth:n,maxHeight:r,maxWidth:o,scale:i,show:s}=e,[l,u,f,m,{x:p,y:g,width:y,height:x},S,E,_,b,C,R]=xt(Q=>[Q.imageWidth,Q.imageHeight,Q.isInpainting,Q.isSD(),Q.cropperState,Q.setCropperX,Q.setCropperY,Q.setCropperWidth,Q.setCropperHeight,Q.isCropperExtenderResizing,Q.setIsCropperExtenderResizing]),[k,O]=d.useState(!1);d.useEffect(()=>{S(Math.round((o-512)/2)),E(Math.round((r-512)/2))},[r,o,l,u]);const[A,I]=d.useState({initX:0,initY:0,initHeight:0,initWidth:0,startResizeX:0,startResizeY:0,ord:"top"}),z=()=>{},H=(Q,le)=>X2(Q,le,p,y,n,o),ie=(Q,le)=>X2(Q,le,g,x,t,r),K=Q=>{if(f)return;const le=Q.clientX,L=Q.clientY,ue=Math.round((L-A.startResizeY)/i),Ne=Math.round((le-A.startResizeX)/i),Ke=()=>{const Ee=A.initHeight-ue,Oe=A.initY+ue,[Ie,ze]=ie(Oe,Ee);b(ze),E(Ie)},Me=()=>{const Ee=A.initHeight+ue,[Oe,Ie]=ie(A.initY,Ee);b(Ie),E(Oe)},me=()=>{const Ee=A.initWidth-Ne,Oe=A.initX+Ne,[Ie,ze]=H(Oe,Ee);_(ze),S(Ie)},be=()=>{const Ee=A.initWidth+Ne,[Oe,Ie]=H(A.initX,Ee);_(Ie),S(Oe)};if(C)switch(A.ord){case"topleft":{Ke(),me();break}case"topright":{Ke(),be();break}case"bottomleft":{Me(),me();break}case"bottomright":{Me(),be();break}case"top":{Ke();break}case"right":{be();break}case"bottom":{Me();break}case"left":{me();break}}if(k){const Ee=A.initX+Ne,Oe=A.initY+ue,[Ie,ze]=H(Ee,A.initWidth),[ht,st]=ie(Oe,A.initHeight);_(ze),b(st),S(Ie),E(ht)}},te=()=>{C&&R(!1),k&&O(!1)};d.useEffect(()=>{if(C||k)return document.addEventListener("pointermove",K,dl),document.addEventListener("pointerup",te,dl),document.addEventListener("pointercancel",te,dl),()=>{document.removeEventListener("pointermove",K,dl),document.removeEventListener("pointerup",te,dl),document.removeEventListener("pointercancel",te,dl)}},[C,k,y,x,A]);const U=Q=>{const{ord:le}=Q.target.dataset;le&&(R(!0),I({initX:p,initY:g,initHeight:x,initWidth:y,startResizeX:Q.clientX,startResizeY:Q.clientY,ord:le}))},re=(Q,le,L)=>{const Ke="w-[12px] h-[12px] z-[4] absolute content-[''] block border-2 border-primary borde pointer-events-auto hover:bg-primary";let Me="0",me="0",be=L,Ee="-6px";return L===""&&(Ee="50%",le==="left"||le==="right"?(be="top",me="-50%"):(be="left",Me="-50%")),v.jsx("div",{className:xe(Ke,Q),style:{[le]:-6,[be]:Ee,transform:`translate(${Me}, ${me}) scale(${1/i})`},"data-ord":le+L,"aria-label":le+L,tabIndex:-1,role:"button"})},V=()=>v.jsxs("div",{onFocus:z,onPointerDown:U,className:"absolute top-0 h-full w-full",children:[v.jsx("div",{className:"absolute pointer-events-auto top-0 left-0 w-full cursor-ns-resize h-[12px] mt-[-6px]","data-ord":"top"}),v.jsx("div",{className:"absolute pointer-events-auto top-0 right-0 h-full cursor-ew-resize w-[12px] mr-[-6px]","data-ord":"right"}),v.jsx("div",{className:"absolute pointer-events-auto bottom-0 left-0 w-full cursor-ns-resize h-[12px] mb-[-6px]","data-ord":"bottom"}),v.jsx("div",{className:"absolute pointer-events-auto top-0 left-0 h-full cursor-ew-resize w-[12px] ml-[-6px]","data-ord":"left"}),re("cursor-nw-resize","top","left"),re("cursor-ne-resize","top","right"),re("cursor-sw-resize","bottom","left"),re("cursor-se-resize","bottom","right"),re("cursor-ns-resize","top",""),re("cursor-ns-resize","bottom",""),re("cursor-ew-resize","left",""),re("cursor-ew-resize","right","")]}),J=Q=>{O(!0),I({initX:p,initY:g,initHeight:x,initWidth:y,startResizeX:Q.clientX,startResizeY:Q.clientY,ord:""})},G=()=>v.jsxs("div",{className:ix("border absolute pointer-events-auto px-2 py-1 rounded-full hover:cursor-move bg-background","origin-top-left top-0 left-0"),style:{transform:`scale(${1/i*.8})`},onPointerDown:J,children:[y," x ",x]}),Z=()=>v.jsx("div",{className:"outline-dashed outline-primary",style:{height:x,width:y,outlineWidth:`${Lq/i*1.3}px`}});return s===!1||!m?null:v.jsx("div",{className:"absolute h-full w-full overflow-hidden pointer-events-none z-[2]",children:v.jsxs("div",{className:"relative pointer-events-none z-[2] [box-shadow:0_0_0_9999px_rgba(0,_0,_0,_0.5)]",style:{height:x,width:y,left:p,top:g},children:[Z(),G(),V()]})})},jq=()=>{const[e,t,n]=xt(r=>[r.interactiveSegState,r.resetInteractiveSegState,r.handleInteractiveSegAccept]);return e.isInteractiveSeg?v.jsxs("div",{className:"z-10 absolute top-[68px] rounded-xl border-solid border p-[8px] left-1/2 translate-x-[-50%] flex justify-center items-center gap-[8px] bg-background",children:[v.jsx(vn,{onClick:()=>{t()},size:"sm",variant:"secondary",children:"Cancel"}),v.jsx(vn,{size:"sm",onClick:()=>{n()},children:"Accept"})]}):null},Bq=e=>{const{x:t,y:n,positive:r}=e,o=r?"bg-[rgba(21,_215,_121,_0.936)] outline-[rgba(98,255,179,0.31)]":"bg-[rgba(237,_49,_55,_0.942)] outline-[rgba(255,89,95,0.31)]";return v.jsx("div",{className:`absolute h-[10px] w-[10px] rounded-[50%] ${o} outline-8 outline`,style:{left:t,top:n,transform:"translate(-50%, -50%)"}})},zq=()=>{const e=xt(t=>t.interactiveSegState.clicks);return v.jsx("div",{className:"absolute h-full w-full overflow-hidden pointer-events-none",children:e.map(t=>v.jsx(Bq,{x:t[0],y:t[1],positive:t[2]===1},t[3]))})},Uq=()=>v.jsx("div",{children:v.jsx(jq,{})}),fl={capture:!0,passive:!1},Vq=2,Z2=(e,t,n,r)=>t<r?e===n?[e,r]:[e+t-r,r]:[e,t],Wq=e=>{const{minHeight:t,minWidth:n,scale:r,show:o}=e,[i,s,l,u,{x:f,y:m,width:p,height:g},y,x,S,E,_,b,C]=xt(J=>[J.isInpainting,J.imageHeight,J.imageWidth,J.isSD(),J.extenderState,J.setExtenderX,J.setExtenderY,J.setExtenderWidth,J.setExtenderHeight,J.settings.extenderDirection,J.isCropperExtenderResizing,J.setIsCropperExtenderResizing]),[R,k]=d.useState({initX:0,initY:0,initHeight:0,initWidth:0,startResizeX:0,startResizeY:0,ord:"top"}),O=()=>{},A=(J,G)=>Z2(J,G,f,n),I=(J,G)=>Z2(J,G,m,t),z=J=>{if(i)return;const G=J.clientX,Z=J.clientY,Q=Math.round((Z-R.startResizeY)/r),le=Math.round((G-R.startResizeX)/r),L=()=>{const Me=R.initHeight-Q,me=R.initY+Q;let be=me,Ee=Me;if(_===Ln.xy)be>0&&(be=0,Ee=R.initHeight-Math.abs(R.initY));else{const Oe=I(me,Me);be=Oe[0],Ee=Oe[1]}E(Ee),x(be)},ue=()=>{const Me=R.initHeight+Q;let[me,be]=I(R.initY,Me);_===Ln.xy&&be<Math.abs(me)+s&&(be=Math.abs(me)+s),E(be),x(me)},Ne=()=>{const Me=R.initWidth-le,me=R.initX+le;let be=me,Ee=Me;if(_===Ln.xy)be>0&&(be=0,Ee=R.initWidth-Math.abs(R.initX));else{const Oe=A(me,Me);be=Oe[0],Ee=Oe[1]}S(Ee),y(be)},Ke=()=>{const Me=R.initWidth+le;let[me,be]=A(R.initX,Me);_===Ln.xy&&be<Math.abs(me)+l&&(be=Math.abs(me)+l),S(be),y(me)};if(b)switch(R.ord){case"topleft":{L(),Ne();break}case"topright":{L(),Ke();break}case"bottomleft":{ue(),Ne();break}case"bottomright":{ue(),Ke();break}case"top":{L();break}case"right":{Ke();break}case"bottom":{ue();break}case"left":{Ne();break}}},H=()=>{b&&C(!1)};d.useEffect(()=>{if(b)return document.addEventListener("pointermove",z,fl),document.addEventListener("pointerup",H,fl),document.addEventListener("pointercancel",H,fl),()=>{document.removeEventListener("pointermove",z,fl),document.removeEventListener("pointerup",H,fl),document.removeEventListener("pointercancel",H,fl)}},[b,p,g,R]);const ie=J=>{const{ord:G}=J.target.dataset;G&&(C(!0),k({initX:f,initY:m,initHeight:g,initWidth:p,startResizeX:J.clientX,startResizeY:J.clientY,ord:G}))},K=(J,G,Z)=>{const L="w-[12px] h-[12px] z-[4] absolute content-[''] block border-2 border-primary borde pointer-events-auto hover:bg-primary";let ue="0",Ne="0",Ke=Z,Me="-6px";return Z===""&&(Me="50%",G==="left"||G==="right"?(Ke="top",Ne="-50%"):(Ke="left",ue="-50%")),v.jsx("div",{className:xe(L,J),style:{[G]:-6,[Ke]:Me,transform:`translate(${ue}, ${Ne}) scale(${1/r})`},"data-ord":G+Z,"aria-label":G+Z,tabIndex:-1,role:"button"})},te=()=>v.jsxs("div",{onFocus:O,onPointerDown:ie,className:"absolute top-0 h-full w-full",children:[[Ln.y,Ln.xy].includes(_)?v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"absolute pointer-events-auto top-0 left-0 w-full cursor-ns-resize h-[12px] mt-[-6px]","data-ord":"top"}),v.jsx("div",{className:"absolute pointer-events-auto bottom-0 left-0 w-full cursor-ns-resize h-[12px] mb-[-6px]","data-ord":"bottom"}),K("cursor-ns-resize","top",""),K("cursor-ns-resize","bottom","")]}):v.jsx(v.Fragment,{}),[Ln.x,Ln.xy].includes(_)?v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"absolute pointer-events-auto top-0 right-0 h-full cursor-ew-resize w-[12px] mr-[-6px]","data-ord":"right"}),v.jsx("div",{className:"absolute pointer-events-auto top-0 left-0 h-full cursor-ew-resize w-[12px] ml-[-6px]","data-ord":"left"}),K("cursor-ew-resize","left",""),K("cursor-ew-resize","right","")]}):v.jsx(v.Fragment,{}),_===Ln.xy?v.jsxs(v.Fragment,{children:[K("cursor-nw-resize","top","left"),K("cursor-ne-resize","top","right"),K("cursor-sw-resize","bottom","left"),K("cursor-se-resize","bottom","right")]}):v.jsx(v.Fragment,{})]}),U=J=>{k({initX:f,initY:m,initHeight:g,initWidth:p,startResizeX:J.clientX,startResizeY:J.clientY,ord:""})},re=()=>v.jsxs("div",{className:ix("border absolute pointer-events-auto px-2 py-1 rounded-full bg-background","origin-top-left top-0 left-0"),style:{transform:`scale(${1/r*.8})`},onPointerDown:U,children:[p," x ",g]}),V=()=>v.jsx("div",{className:xe("outline-dashed outline-primary"),style:{height:g,width:p,outlineWidth:`${Vq/r*1.3}px`}});return o===!1||!u?null:v.jsx("div",{className:"absolute h-full w-full pointer-events-none z-[2]",children:v.jsxs("div",{className:"relative pointer-events-none z-[2] [box-shadow:0_0_0_9999px_rgba(0,_0,_0,_0.5)]",style:{height:g,width:p,left:f,top:m},children:[V(),re(),te()]})})},Hq=200,pu=300;function Kq(e){const{file:t}=e,{toast:n}=Id(),[r,o,i,s,l,u,f,m,p,g,y,x,S,E,_,b,C,R,k,O,A,I,z,H]=xt(W=>[W.disableShortCuts,W.windowSize,W.isInpainting,W.imageWidth,W.imageHeight,W.settings,W.serverConfig.enableAutoSaving,W.setImageSize,W.setBaseBrushSize,W.interactiveSegState,W.updateInteractiveSegState,W.handleCanvasMouseDown,W.handleCanvasMouseMove,W.undo,W.redo,W.undoDisabled(),W.redoDisabled(),W.getIsProcessing(),W.updateAppState,W.runMannually(),W.runInpainting,W.isCropperExtenderResizing,W.decreaseBaseBrushSize,W.increaseBaseBrushSize]),ie=xt(W=>W.editorState.baseBrushSize),K=xt(W=>W.getBrushSize()),te=xt(W=>W.editorState.renders),U=xt(W=>W.editorState.extraMasks),re=xt(W=>W.editorState.temporaryMasks),V=xt(W=>W.editorState.lineGroups),J=xt(W=>W.editorState.curLineGroup),[G,Z]=d.useState(!1),[Q,le]=Nx(t),[L,ue]=d.useState(),[Ne,Ke]=d.useState(),[{x:Me,y:me},be]=d.useState({x:-1,y:-1}),[Ee,Oe]=d.useState(!1),[Ie,ze]=d.useState(!1),[ht,st]=d.useState(!1),[Yt,rr]=d.useState(1),[Jt,Li]=d.useState(!1),[N,X]=d.useState(1),ee=o.width/2,Se=o.height/2,pe=d.useRef(null),[he,Te]=d.useState(!1),[ut,gt]=d.useState(!1),[An,Mn]=d.useState(0),[Fi,Ro]=d.useState(!1),Cr=d.useCallback(()=>J.length!==0,[J]);d.useEffect(()=>{if(!Ne||!le||s===0||l===0)return;const W=te.length===0?Q:te[te.length-1];Ne.canvas.width=s,Ne.canvas.height=l,Ne.clearRect(0,0,Ne.canvas.width,Ne.canvas.height),Ne.drawImage(W,0,0,s,l)},[te,Q,le,Ne,l,s]),d.useEffect(()=>{!L||!le||s===0||l===0||(L.canvas.width=s,L.canvas.height=l,L.clearRect(0,0,L.canvas.width,L.canvas.height),re.forEach(W=>{L.drawImage(W,0,0,s,l)}),U.forEach(W=>{L.drawImage(W,0,0,s,l)}),g.isInteractiveSeg&&g.tmpInteractiveSegMask&&L.drawImage(g.tmpInteractiveSegMask,0,0,s,l),eP(L,J))},[re,U,le,g,L,J,l,s]);const Ks=d.useCallback(async()=>{let W=t;if(te.length>0){const We=te[te.length-1];W=await Nu(We.currentSrc,t.name,t.type)}return W},[t,te]),ri=()=>te.length!==0,ji=d.useCallback(()=>{let W=512,We=512;return le?(te.length===0?(W=Q.naturalWidth,We=Q.naturalHeight):te.length!==0&&(W=te[te.length-1].width,We=te[te.length-1].height),[W,We]):[W,We]},[Q,le,te]);d.useEffect(()=>{var of;if(!le)return;const[W,We]=ji();(W!==s||We!==l)&&m(W,We);const dt=o.width/W,no=(o.height-Hq)/We;let an=1;(dt<1||no<1)&&(an=Math.min(dt,no)),X(an),rr(an),console.log(`[on file load] image size: ${W}x${We}, scale: ${an}, initialCentered: ${he}`),L!=null&&L.canvas&&(console.log("[on file load] set canvas size"),W!=L.canvas.width&&(L.canvas.width=W),We!=L.canvas.height&&(L.canvas.height=We)),he||((of=pe.current)==null||of.centerView(an,1),console.log("[on file load] centerView"),Te(!0))},[pe,l,s,Q,le,o,he,ji]),d.useEffect(()=>{var W;console.log("[useEffect] centerView"),(W=pe==null?void 0:pe.current)==null||W.centerView(N,1)},[l,s,pe,N]);const or=d.useCallback(()=>{if(!N||!o)return;const W=pe.current;if(!W)return;const We=(o.width-s*N)/2,dt=(o.height-l*N)/2;W.setTransform(We,dt,N,200,"easeOutQuad"),W.instance.transformState.scale&&(W.instance.transformState.scale=N),rr(N),Li(!1)},[pe,o,l,s,o.height,N]);d.useEffect(()=>(window.addEventListener("resize",()=>{or()}),()=>{window.removeEventListener("resize",()=>{or()})}),[o,or]),Yn("Escape",()=>{R||(ut?gt(!1):or())},[ut,i,or]);const $g=W=>{const We=W.nativeEvent;be({x:We.pageX,y:We.pageY})},qd=W=>{R||g.isInteractiveSeg||ht||ut&&J.length!==0&&S(v0(W))},Rg=async W=>{k({isPluginRunning:!0});const We=await Ks();try{const dt=await _P(!0,Oo.InteractiveSeg,We,void 0,W),{blob:no}=dt,an=new Image;an.onload=()=>{y({tmpInteractiveSegMask:an})},an.src=no}catch(dt){n({variant:"destructive",description:dt.message?dt.message:dt.toString()})}k({isPluginRunning:!1})},Qd=W=>{if(vC(W)){st(!1);return}!Cr()||g.isInteractiveSeg||ht||!Q.src||!(L!=null&&L.canvas)||i||ut&&(O?gt(!1):A())},Nc=W=>{if(g.isInteractiveSeg){const We=v0(W),dt=[...g.clicks];gC(W)?dt.push([We.x,We.y,0,dt.length]):dt.push([We.x,We.y,1,dt.length]),Rg(dt),y({clicks:dt})}},Jd=W=>{if(!(R||g.isInteractiveSeg||ht||!le||!(L!=null&&L.canvas))&&!gC(W)){if(vC(W)){st(!0);return}gt(!0),x(v0(W))}},ef=W=>{W.preventDefault(),E()};Yn("meta+z,ctrl+z",ef);const tf=W=>{W.preventDefault(),_()};Yn("shift+ctrl+z,shift+meta+z",tf),I0("Tab",W=>{W==null||W.preventDefault(),W==null||W.stopPropagation(),ri()&&Z(()=>(window.setTimeout(()=>{Mn(100)},10),!0))},W=>{W==null||W.preventDefault(),W==null||W.stopPropagation(),ri()&&(window.setTimeout(()=>{Mn(0)},10),window.setTimeout(()=>{Z(!1)},pu))});const nf=d.useCallback(async()=>{if(t===void 0)return;if(f&&te.length>0){try{await Yj(te[te.length-1],t.name,t.type),n({description:"Save image success"})}catch(dt){n({variant:"destructive",title:"Uh oh! Something went wrong.",description:dt.message?dt.message:dt.toString()})}return}const W=t.name.replace(/(\.[\w\d_-]+)$/i,"_cleanup$1"),We=te[te.length-1];if(_F(We.currentSrc,W),u.enableDownloadMask){let dt=t.name.replace(/(\.[\w\d_-]+)$/i,"_mask$1");dt=dt.replace(/\.[^/.]+$/,".jpg");const no=Gh(s,l,V),an=document.createElement("a");an.download=dt,an.href=no.toDataURL("image/jpeg"),an.click()}},[t,f,te,u,l,s,V]);Yn("meta+s,ctrl+s",nf);const Va=W=>{W!==Ee&&!ht&&!I&&Oe(W)},Pg=d.useCallback(()=>{if(R)return"default";if(ht)return"grab";if(Ee)return"none"},[Ee,ht,R]);Yn("[",()=>{z()},[z]),Yn("]",()=>{H()},[H]),Yn("shift+r",()=>{O&&Cr()&&A()},[O,A,Cr]),Yn("ctrl+c,meta+c",async()=>{await wF()&&te.length>0&&L!=null&&L.canvas&&(await SF(L==null?void 0:L.canvas),n({title:"Copy inpainting result to clipboard"}))},[te,L]),I0(" ",W=>{r||(W==null||W.preventDefault(),W==null||W.stopPropagation(),Oe(!1),st(!0))},W=>{r||(W==null||W.preventDefault(),W==null||W.stopPropagation(),Oe(!0),st(!1))}),I0("Alt",W=>{r||(W==null||W.preventDefault(),W==null||W.stopPropagation(),Ro(!0))},W=>{r||(W==null||W.preventDefault(),W==null||W.stopPropagation(),Ro(!1))});const Dc=()=>{var We,dt,no,an;let W=N;return((dt=(We=pe.current)==null?void 0:We.instance)==null?void 0:dt.transformState.scale)!==void 0&&(W=(an=(no=pe.current)==null?void 0:no.instance)==null?void 0:an.transformState.scale),W},rf=(W,We)=>{const dt=Dc();return{width:`${K*dt}px`,height:`${K*dt}px`,left:`${W}px`,top:`${We}px`,transform:"translate(-50%, -50%)"}},Wa=W=>v.jsx("div",{className:"absolute rounded-[50%] border-[1px] border-[solid] border-[#ffcc00] pointer-events-none bg-[#ffcc00bb]",style:W}),Tg=W=>{p(W),Ie||(ze(!0),window.setTimeout(()=>{ze(!1)},1e4))},Ic=()=>v.jsx("div",{className:"absolute h-[20px] w-[20px] pointer-events-none rounded-[50%] bg-[rgba(21,_215,_121,_0.936)] [box-shadow:0_0_0_0_rgba(21,_215,_121,_0.936)] animate-pulse",style:{left:`${Me}px`,top:`${me}px`,transform:"translate(-50%, -50%)"},children:v.jsx(dK,{})}),kg=()=>v.jsx(uq,{ref:W=>{W&&(pe.current=W)},panning:{disabled:!ht,velocityDisabled:!0},wheel:{step:.05,wheelDisabled:Fi},centerZoomedOut:!0,alignmentAnimation:{disabled:!0},centerOnInit:!0,limitToBounds:!1,doubleClick:{disabled:!0},initialScale:N,minScale:N*.3,onPanning:()=>{Jt||Li(!0)},onZoom:W=>{rr(W.state.scale)},children:v.jsxs(hq,{contentStyle:{visibility:he?"visible":"hidden"},children:[v.jsxs("div",{className:"grid [grid-template-areas:'editor-content'] gap-y-4",children:[v.jsx("canvas",{className:"[grid-area:editor-content]",style:{clipPath:`inset(0 ${An}% 0 0)`,transition:`clip-path ${pu}ms`},ref:W=>{if(W&&!Ne){const We=W.getContext("2d");We&&Ke(We)}}}),v.jsx("canvas",{className:xe("[grid-area:editor-content]",R?"pointer-events-none animate-pulse duration-600":""),style:{cursor:Pg(),clipPath:`inset(0 ${An}% 0 0)`,transition:`clip-path ${pu}ms`},onContextMenu:W=>{W.preventDefault()},onMouseOver:()=>{Va(!0),ze(!1)},onFocus:()=>Va(!0),onMouseLeave:()=>Va(!1),onMouseDown:Jd,onMouseUp:Nc,onMouseMove:qd,onTouchStart:Jd,onTouchEnd:Nc,onTouchMove:qd,ref:W=>{if(W&&!L){const We=W.getContext("2d");We&&ue(We)}}}),v.jsx("div",{className:"[grid-area:editor-content] pointer-events-none grid [grid-template-areas:'original-image-content']",style:{width:`${s}px`,height:`${l}px`},children:G&&v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"[grid-area:original-image-content] z-10 bg-primary h-full w-[6px] justify-self-end",style:{marginRight:`${An}%`,transition:`margin-right ${pu}ms`}}),v.jsx("img",{className:"[grid-area:original-image-content]",src:Q.src,alt:"original",style:{width:`${s}px`,height:`${l}px`}})]})})]}),v.jsx(Fq,{maxHeight:l,maxWidth:s,minHeight:Math.min(512,l),minWidth:Math.min(512,s),scale:Dc(),show:u.showCropper}),v.jsx(Wq,{minHeight:Math.min(512,l),minWidth:Math.min(512,s),scale:Dc(),show:u.showExtender}),g.isInteractiveSeg?v.jsx(zq,{}):v.jsx(v.Fragment,{})]})}),Ag=W=>{if(!Fi)return;const{deltaY:We}=W;We>0?H():We<0&&z()};return v.jsxs("div",{className:"flex w-screen h-screen justify-center items-center","aria-hidden":"true",onMouseMove:$g,onMouseUp:Qd,onWheel:Ag,children:[kg(),Ee&&!i&&!ht&&(g.isInteractiveSeg?Ic():Wa(rf(Me,me))),Ie&&Wa(rf(ee,Se)),v.jsxs("div",{className:"fixed flex bottom-5 border px-4 py-2 rounded-[3rem] gap-8 items-center justify-center backdrop-filter backdrop-blur-md bg-background/70",children:[v.jsx(po,{className:"w-48",defaultValue:[50],min:dF,max:QR,step:1,tabIndex:-1,value:[ie],onValueChange:W=>Tg(W[0]),onClick:()=>ze(!1)}),v.jsxs("div",{className:"flex gap-2",children:[v.jsx(Zn,{tooltip:"Reset zoom & pan",disabled:Yt===N&&Jt===!1,onClick:or,children:v.jsx(fH,{})}),v.jsx(Zn,{tooltip:"Undo",onClick:ef,disabled:b,children:v.jsx(yH,{})}),v.jsx(Zn,{tooltip:"Redo",onClick:tf,disabled:C,children:v.jsx(gH,{})}),v.jsx(Zn,{tooltip:"Show original image",onPointerDown:W=>{W.preventDefault(),Z(()=>(window.setTimeout(()=>{Mn(100)},10),!0))},onPointerUp:()=>{window.setTimeout(()=>{Mn(0)},10),window.setTimeout(()=>{Z(!1)},pu)},disabled:te.length===0,children:v.jsx(hH,{})}),v.jsx(Zn,{tooltip:"Save Image",disabled:!te.length,onClick:nf,children:v.jsx(uH,{})}),u.enableManualInpainting&&u.model.model_type==="inpaint"?v.jsx(Zn,{tooltip:"Run Inpainting",disabled:R||!Cr()&&U.length===0,onClick:()=>{A()},children:v.jsx(dH,{})}):v.jsx(v.Fragment,{})]})]})]})}const Gq=()=>{const[e,t]=xt(n=>[n.imageWidth,n.imageHeight]);return!e||!t?null:v.jsxs("div",{className:"border rounded-lg px-2 py-[6px] z-10 bg-background",children:[e,"x",t]})},G1=["Enter"," "],Yq=["ArrowDown","PageUp","Home"],J3=["ArrowUp","PageDown","End"],Xq=[...Yq,...J3],Zq={ltr:[...G1,"ArrowRight"],rtl:[...G1,"ArrowLeft"]},qq={ltr:["ArrowLeft"],rtl:["ArrowRight"]},xg="Menu",[md,Qq,Jq]=Wd(xg),[Ua,eA]=Tn(xg,[Jq,zs,sg]),bg=zs(),tA=sg(),[nA,Hs]=Ua(xg),[eQ,Xd]=Ua(xg),tQ=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,l=bg(t),[u,f]=d.useState(null),m=d.useRef(!1),p=Lt(i),g=Ac(o);return d.useEffect(()=>{const y=()=>{m.current=!0,document.addEventListener("pointerdown",x,{capture:!0,once:!0}),document.addEventListener("pointermove",x,{capture:!0,once:!0})},x=()=>m.current=!1;return document.addEventListener("keydown",y,{capture:!0}),()=>{document.removeEventListener("keydown",y,{capture:!0}),document.removeEventListener("pointerdown",x,{capture:!0}),document.removeEventListener("pointermove",x,{capture:!0})}},[]),d.createElement(Fd,l,d.createElement(nA,{scope:t,open:n,onOpenChange:p,content:u,onContentChange:f},d.createElement(eQ,{scope:t,onClose:d.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:m,dir:g,modal:s},r)))},rA=d.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=bg(n);return d.createElement(Gm,Y({},o,r,{ref:t}))}),oA="MenuPortal",[nQ,iA]=Ua(oA,{forceMount:void 0}),rQ=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=Hs(oA,t);return d.createElement(nQ,{scope:t,forceMount:n},d.createElement(xn,{present:n||i.open},d.createElement(jd,{asChild:!0,container:o},r)))},_o="MenuContent",[oQ,ab]=Ua(_o),iQ=d.forwardRef((e,t)=>{const n=iA(_o,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Hs(_o,e.__scopeMenu),s=Xd(_o,e.__scopeMenu);return d.createElement(md.Provider,{scope:e.__scopeMenu},d.createElement(xn,{present:r||i.open},d.createElement(md.Slot,{scope:e.__scopeMenu},s.modal?d.createElement(sQ,Y({},o,{ref:t})):d.createElement(aQ,Y({},o,{ref:t})))))}),sQ=d.forwardRef((e,t)=>{const n=Hs(_o,e.__scopeMenu),r=d.useRef(null),o=Ve(t,r);return d.useEffect(()=>{const i=r.current;if(i)return ng(i)},[]),d.createElement(lb,Y({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:fe(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),aQ=d.forwardRef((e,t)=>{const n=Hs(_o,e.__scopeMenu);return d.createElement(lb,Y({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),lb=d.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:l,onEntryFocus:u,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:p,onInteractOutside:g,onDismiss:y,disableOutsideScroll:x,...S}=e,E=Hs(_o,n),_=Xd(_o,n),b=bg(n),C=tA(n),R=Qq(n),[k,O]=d.useState(null),A=d.useRef(null),I=Ve(t,A,E.onContentChange),z=d.useRef(0),H=d.useRef(""),ie=d.useRef(0),K=d.useRef(null),te=d.useRef("right"),U=d.useRef(0),re=x?tg:d.Fragment,V=x?{as:Qo,allowPinchZoom:!0}:void 0,J=Z=>{var Q,le;const L=H.current+Z,ue=R().filter(Ee=>!Ee.disabled),Ne=document.activeElement,Ke=(Q=ue.find(Ee=>Ee.ref.current===Ne))===null||Q===void 0?void 0:Q.textValue,Me=ue.map(Ee=>Ee.textValue),me=EQ(Me,L,Ke),be=(le=ue.find(Ee=>Ee.textValue===me))===null||le===void 0?void 0:le.ref.current;(function Ee(Oe){H.current=Oe,window.clearTimeout(z.current),Oe!==""&&(z.current=window.setTimeout(()=>Ee(""),1e3))})(L),be&&setTimeout(()=>be.focus())};d.useEffect(()=>()=>window.clearTimeout(z.current),[]),Jm();const G=d.useCallback(Z=>{var Q,le;return te.current===((Q=K.current)===null||Q===void 0?void 0:Q.side)&&$Q(Z,(le=K.current)===null||le===void 0?void 0:le.area)},[]);return d.createElement(oQ,{scope:n,searchRef:H,onItemEnter:d.useCallback(Z=>{G(Z)&&Z.preventDefault()},[G]),onItemLeave:d.useCallback(Z=>{var Q;G(Z)||((Q=A.current)===null||Q===void 0||Q.focus(),O(null))},[G]),onTriggerLeave:d.useCallback(Z=>{G(Z)&&Z.preventDefault()},[G]),pointerGraceTimerRef:ie,onPointerGraceIntentChange:d.useCallback(Z=>{K.current=Z},[])},d.createElement(re,V,d.createElement(Qm,{asChild:!0,trapped:o,onMountAutoFocus:fe(i,Z=>{var Q;Z.preventDefault(),(Q=A.current)===null||Q===void 0||Q.focus()}),onUnmountAutoFocus:s},d.createElement($c,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:p,onInteractOutside:g,onDismiss:y},d.createElement(ok,Y({asChild:!0},C,{dir:_.dir,orientation:"vertical",loop:r,currentTabStopId:k,onCurrentTabStopIdChange:O,onEntryFocus:fe(u,Z=>{_.isUsingKeyboardRef.current||Z.preventDefault()})}),d.createElement(Ym,Y({role:"menu","aria-orientation":"vertical","data-state":dA(E.open),"data-radix-menu-content":"",dir:_.dir},b,S,{ref:I,style:{outline:"none",...S.style},onKeyDown:fe(S.onKeyDown,Z=>{const le=Z.target.closest("[data-radix-menu-content]")===Z.currentTarget,L=Z.ctrlKey||Z.altKey||Z.metaKey,ue=Z.key.length===1;le&&(Z.key==="Tab"&&Z.preventDefault(),!L&&ue&&J(Z.key));const Ne=A.current;if(Z.target!==Ne||!Xq.includes(Z.key))return;Z.preventDefault();const Me=R().filter(me=>!me.disabled).map(me=>me.ref.current);J3.includes(Z.key)&&Me.reverse(),SQ(Me)}),onBlur:fe(e.onBlur,Z=>{Z.currentTarget.contains(Z.target)||(window.clearTimeout(z.current),H.current="")}),onPointerMove:fe(e.onPointerMove,gd(Z=>{const Q=Z.target,le=U.current!==Z.clientX;if(Z.currentTarget.contains(Q)&&le){const L=Z.clientX>U.current?"right":"left";te.current=L,U.current=Z.clientX}}))})))))))}),lQ=d.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return d.createElement(Ae.div,Y({},r,{ref:t}))}),Y1="MenuItem",q2="menu.itemSelect",cb=d.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=d.useRef(null),s=Xd(Y1,e.__scopeMenu),l=ab(Y1,e.__scopeMenu),u=Ve(t,i),f=d.useRef(!1),m=()=>{const p=i.current;if(!n&&p){const g=new CustomEvent(q2,{bubbles:!0,cancelable:!0});p.addEventListener(q2,y=>r==null?void 0:r(y),{once:!0}),mx(p,g),g.defaultPrevented?f.current=!1:s.onClose()}};return d.createElement(sA,Y({},o,{ref:u,disabled:n,onClick:fe(e.onClick,m),onPointerDown:p=>{var g;(g=e.onPointerDown)===null||g===void 0||g.call(e,p),f.current=!0},onPointerUp:fe(e.onPointerUp,p=>{var g;f.current||(g=p.currentTarget)===null||g===void 0||g.click()}),onKeyDown:fe(e.onKeyDown,p=>{const g=l.searchRef.current!=="";n||g&&p.key===" "||G1.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})}))}),sA=d.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=ab(Y1,n),l=tA(n),u=d.useRef(null),f=Ve(t,u),[m,p]=d.useState(!1),[g,y]=d.useState("");return d.useEffect(()=>{const x=u.current;if(x){var S;y(((S=x.textContent)!==null&&S!==void 0?S:"").trim())}},[i.children]),d.createElement(md.ItemSlot,{scope:n,disabled:r,textValue:o??g},d.createElement(ik,Y({asChild:!0},l,{focusable:!r}),d.createElement(Ae.div,Y({role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},i,{ref:f,onPointerMove:fe(e.onPointerMove,gd(x=>{r?s.onItemLeave(x):(s.onItemEnter(x),x.defaultPrevented||x.currentTarget.focus())})),onPointerLeave:fe(e.onPointerLeave,gd(x=>s.onItemLeave(x))),onFocus:fe(e.onFocus,()=>p(!0)),onBlur:fe(e.onBlur,()=>p(!1))}))))}),cQ=d.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return d.createElement(lA,{scope:e.__scopeMenu,checked:n},d.createElement(cb,Y({role:"menuitemcheckbox","aria-checked":um(n)?"mixed":n},o,{ref:t,"data-state":ub(n),onSelect:fe(o.onSelect,()=>r==null?void 0:r(um(n)?!0:!n),{checkForDefaultPrevented:!1})})))}),uQ="MenuRadioGroup",[Ste,dQ]=Ua(uQ,{value:void 0,onValueChange:()=>{}}),fQ="MenuRadioItem",hQ=d.forwardRef((e,t)=>{const{value:n,...r}=e,o=dQ(fQ,e.__scopeMenu),i=n===o.value;return d.createElement(lA,{scope:e.__scopeMenu,checked:i},d.createElement(cb,Y({role:"menuitemradio","aria-checked":i},r,{ref:t,"data-state":ub(i),onSelect:fe(r.onSelect,()=>{var s;return(s=o.onValueChange)===null||s===void 0?void 0:s.call(o,n)},{checkForDefaultPrevented:!1})})))}),aA="MenuItemIndicator",[lA,pQ]=Ua(aA,{checked:!1}),mQ=d.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=pQ(aA,n);return d.createElement(xn,{present:r||um(i.checked)||i.checked===!0},d.createElement(Ae.span,Y({},o,{ref:t,"data-state":ub(i.checked)})))}),gQ=d.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return d.createElement(Ae.div,Y({role:"separator","aria-orientation":"horizontal"},r,{ref:t}))}),cA="MenuSub",[vQ,uA]=Ua(cA),yQ=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:o}=e,i=Hs(cA,t),s=bg(t),[l,u]=d.useState(null),[f,m]=d.useState(null),p=Lt(o);return d.useEffect(()=>(i.open===!1&&p(!1),()=>p(!1)),[i.open,p]),d.createElement(Fd,s,d.createElement(nA,{scope:t,open:r,onOpenChange:p,content:f,onContentChange:m},d.createElement(vQ,{scope:t,contentId:tr(),triggerId:tr(),trigger:l,onTriggerChange:u},n)))},$h="MenuSubTrigger",wQ=d.forwardRef((e,t)=>{const n=Hs($h,e.__scopeMenu),r=Xd($h,e.__scopeMenu),o=uA($h,e.__scopeMenu),i=ab($h,e.__scopeMenu),s=d.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:u}=i,f={__scopeMenu:e.__scopeMenu},m=d.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return d.useEffect(()=>m,[m]),d.useEffect(()=>{const p=l.current;return()=>{window.clearTimeout(p),u(null)}},[l,u]),d.createElement(rA,Y({asChild:!0},f),d.createElement(sA,Y({id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":dA(n.open)},e,{ref:Lm(t,o.onTriggerChange),onClick:p=>{var g;(g=e.onClick)===null||g===void 0||g.call(e,p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:fe(e.onPointerMove,gd(p=>{i.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),m()},100))})),onPointerLeave:fe(e.onPointerLeave,gd(p=>{var g;m();const y=(g=n.content)===null||g===void 0?void 0:g.getBoundingClientRect();if(y){var x;const S=(x=n.content)===null||x===void 0?void 0:x.dataset.side,E=S==="right",_=E?-5:5,b=y[E?"left":"right"],C=y[E?"right":"left"];i.onPointerGraceIntentChange({area:[{x:p.clientX+_,y:p.clientY},{x:b,y:y.top},{x:C,y:y.top},{x:C,y:y.bottom},{x:b,y:y.bottom}],side:S}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(p),p.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:fe(e.onKeyDown,p=>{const g=i.searchRef.current!=="";if(!(e.disabled||g&&p.key===" ")&&Zq[r.dir].includes(p.key)){var y;n.onOpenChange(!0),(y=n.content)===null||y===void 0||y.focus(),p.preventDefault()}})})))}),xQ="MenuSubContent",bQ=d.forwardRef((e,t)=>{const n=iA(_o,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Hs(_o,e.__scopeMenu),s=Xd(_o,e.__scopeMenu),l=uA(xQ,e.__scopeMenu),u=d.useRef(null),f=Ve(t,u);return d.createElement(md.Provider,{scope:e.__scopeMenu},d.createElement(xn,{present:r||i.open},d.createElement(md.Slot,{scope:e.__scopeMenu},d.createElement(lb,Y({id:l.contentId,"aria-labelledby":l.triggerId},o,{ref:f,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:m=>{var p;s.isUsingKeyboardRef.current&&((p=u.current)===null||p===void 0||p.focus()),m.preventDefault()},onCloseAutoFocus:m=>m.preventDefault(),onFocusOutside:fe(e.onFocusOutside,m=>{m.target!==l.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:fe(e.onEscapeKeyDown,m=>{s.onClose(),m.preventDefault()}),onKeyDown:fe(e.onKeyDown,m=>{const p=m.currentTarget.contains(m.target),g=qq[s.dir].includes(m.key);if(p&&g){var y;i.onOpenChange(!1),(y=l.trigger)===null||y===void 0||y.focus(),m.preventDefault()}})})))))});function dA(e){return e?"open":"closed"}function um(e){return e==="indeterminate"}function ub(e){return um(e)?"indeterminate":e?"checked":"unchecked"}function SQ(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function _Q(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function EQ(e,t,n){const o=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=_Q(e,Math.max(i,0));o.length===1&&(s=s.filter(f=>f!==n));const u=s.find(f=>f.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function CQ(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const l=t[i].x,u=t[i].y,f=t[s].x,m=t[s].y;u>r!=m>r&&n<(f-l)*(r-u)/(m-u)+l&&(o=!o)}return o}function $Q(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return CQ(n,t)}function gd(e){return t=>t.pointerType==="mouse"?e(t):void 0}const RQ=tQ,PQ=rA,TQ=rQ,kQ=iQ,AQ=lQ,MQ=cb,OQ=cQ,NQ=hQ,DQ=mQ,IQ=gQ,LQ=yQ,FQ=wQ,jQ=bQ,fA="DropdownMenu",[BQ,_te]=Tn(fA,[eA]),Er=eA(),[zQ,hA]=BQ(fA),UQ=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:l=!0}=e,u=Er(t),f=d.useRef(null),[m=!1,p]=eo({prop:o,defaultProp:i,onChange:s});return d.createElement(zQ,{scope:t,triggerId:tr(),triggerRef:f,contentId:tr(),open:m,onOpenChange:p,onOpenToggle:d.useCallback(()=>p(g=>!g),[p]),modal:l},d.createElement(RQ,Y({},u,{open:m,onOpenChange:p,dir:r,modal:l}),n))},VQ="DropdownMenuTrigger",WQ=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=hA(VQ,n),s=Er(n);return d.createElement(PQ,Y({asChild:!0},s),d.createElement(Ae.button,Y({type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r},o,{ref:Lm(t,i.triggerRef),onPointerDown:fe(e.onPointerDown,l=>{!r&&l.button===0&&l.ctrlKey===!1&&(i.onOpenToggle(),i.open||l.preventDefault())}),onKeyDown:fe(e.onKeyDown,l=>{r||(["Enter"," "].includes(l.key)&&i.onOpenToggle(),l.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})))}),HQ=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Er(t);return d.createElement(TQ,Y({},r,n))},KQ="DropdownMenuContent",GQ=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=hA(KQ,n),i=Er(n),s=d.useRef(!1);return d.createElement(kQ,Y({id:o.contentId,"aria-labelledby":o.triggerId},i,r,{ref:t,onCloseAutoFocus:fe(e.onCloseAutoFocus,l=>{var u;s.current||(u=o.triggerRef.current)===null||u===void 0||u.focus(),s.current=!1,l.preventDefault()}),onInteractOutside:fe(e.onInteractOutside,l=>{const u=l.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0,m=u.button===2||f;(!o.modal||m)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),YQ=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Er(n);return d.createElement(AQ,Y({},o,r,{ref:t}))}),XQ=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Er(n);return d.createElement(MQ,Y({},o,r,{ref:t}))}),ZQ=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Er(n);return d.createElement(OQ,Y({},o,r,{ref:t}))}),qQ=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Er(n);return d.createElement(NQ,Y({},o,r,{ref:t}))}),QQ=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Er(n);return d.createElement(DQ,Y({},o,r,{ref:t}))}),JQ=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Er(n);return d.createElement(IQ,Y({},o,r,{ref:t}))}),eJ=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:o,defaultOpen:i}=e,s=Er(t),[l=!1,u]=eo({prop:r,defaultProp:i,onChange:o});return d.createElement(LQ,Y({},s,{open:l,onOpenChange:u}),n)},tJ=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Er(n);return d.createElement(FQ,Y({},o,r,{ref:t}))}),nJ=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Er(n);return d.createElement(jQ,Y({},o,r,{ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),rJ=UQ,oJ=WQ,iJ=HQ,pA=GQ,mA=YQ,gA=XQ,vA=ZQ,yA=qQ,wA=QQ,xA=JQ,sJ=eJ,bA=tJ,SA=nJ,aJ=rJ,lJ=oJ,Q2=sJ,X1=d.forwardRef(({className:e,inset:t,children:n,...r},o)=>v.jsxs(bA,{ref:o,className:xe("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...r,children:[n,v.jsx(oB,{className:"ml-auto h-4 w-4"})]}));X1.displayName=bA.displayName;const Z1=d.forwardRef(({className:e,...t},n)=>v.jsx(SA,{ref:n,className:xe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Z1.displayName=SA.displayName;const _A=d.forwardRef(({className:e,sideOffset:t=4,...n},r)=>v.jsx(iJ,{children:v.jsx(pA,{ref:r,sideOffset:t,className:xe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),onCloseAutoFocus:o=>o.preventDefault(),...n})}));_A.displayName=pA.displayName;const ml=d.forwardRef(({className:e,inset:t,...n},r)=>v.jsx(gA,{ref:r,className:xe("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));ml.displayName=gA.displayName;const cJ=d.forwardRef(({className:e,children:t,checked:n,...r},o)=>v.jsxs(vA,{ref:o,className:xe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[v.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:v.jsx(wA,{children:v.jsx(EP,{className:"h-4 w-4"})})}),t]}));cJ.displayName=vA.displayName;const uJ=d.forwardRef(({className:e,children:t,...n},r)=>v.jsxs(yA,{ref:r,className:xe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[v.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:v.jsx(wA,{children:v.jsx(cB,{className:"h-4 w-4 fill-current"})})}),t]}));uJ.displayName=yA.displayName;const dJ=d.forwardRef(({className:e,inset:t,...n},r)=>v.jsx(mA,{ref:r,className:xe("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));dJ.displayName=mA.displayName;const fJ=d.forwardRef(({className:e,...t},n)=>v.jsx(xA,{ref:n,className:xe("-mx-1 my-1 h-px bg-muted",e),...t}));fJ.displayName=xA.displayName;const J2={RemoveBG:{IconClass:u2,showName:"RemoveBG"},AnimeSeg:{IconClass:u2,showName:"Anime Segmentation"},RealESRGAN:{IconClass:jT,showName:"RealESRGAN"},GFPGAN:{IconClass:d2,showName:"GFPGAN"},RestoreFormer:{IconClass:d2,showName:"RestoreFormer"},InteractiveSeg:{IconClass:mH,showName:"Interactive Segmentation"}},hJ=()=>{const[e,t,n,r,o]=xt(m=>[m.file,m.serverConfig.plugins,m.isPluginRunning,m.updateInteractiveSegState,m.runRenderablePlugin]),i=!e;if(t.length===0)return null;const s=(m,p)=>{p==="InteractiveSeg"?r({isInteractiveSeg:!0}):o(m,p)},l=()=>v.jsxs(Q2,{children:[v.jsx(X1,{disabled:i,children:v.jsxs("div",{className:"flex gap-2 items-center",children:[v.jsx(jT,{}),"RealESRGAN"]})}),v.jsxs(Z1,{children:[v.jsx(ml,{onClick:()=>o(!1,"RealESRGAN",{upscale:2}),children:"upscale 2x"}),v.jsx(ml,{onClick:()=>o(!1,"RealESRGAN",{upscale:4}),children:"upscale 4x"})]})]},"RealESRGAN"),u=m=>{const{IconClass:p,showName:g}=J2[m.name];return v.jsxs(Q2,{children:[v.jsx(X1,{disabled:i,children:v.jsxs("div",{className:"flex gap-2 items-center",children:[v.jsx(p,{className:"p-1"}),g]})}),v.jsxs(Z1,{children:[v.jsx(ml,{onClick:()=>s(!1,m.name),children:"Remove Background"}),v.jsx(ml,{onClick:()=>s(!0,m.name),children:"Generate Mask"})]})]},m.name)},f=()=>t.map(m=>{const{IconClass:p,showName:g}=J2[m.name];return m.name==="RealESRGAN"?l():m.name==="RemoveBG"||m.name==="AnimeSeg"?u(m):v.jsx(ml,{onClick:()=>s(!1,m.name),disabled:i,children:v.jsxs("div",{className:"flex gap-2 items-center",children:[v.jsx(p,{className:"p-1"}),g]})},m.name)});return v.jsxs(aJ,{modal:!1,children:[v.jsx(lJ,{className:"border rounded-lg z-10 bg-background outline-none",tabIndex:-1,children:v.jsx(vn,{variant:"ghost",size:"icon",asChild:!0,className:"p-1.5",children:n?v.jsx("div",{role:"status",children:v.jsxs("svg",{"aria-hidden":"true",className:"w-5 h-5 animate-spin fill-primary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[v.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),v.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]})}):v.jsx(aH,{strokeWidth:1})})}),v.jsx(_A,{side:"bottom",align:"start",children:f()})]})},pJ=Tx,mJ=ST,gJ=kx,EA=d.forwardRef(({className:e,...t},n)=>v.jsx(Bd,{className:xe("fixed inset-0 bg-background/80 backdrop-blur-sm data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));EA.displayName=Bd.displayName;const vJ=Fm("fixed gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-200 data-[state=open]:duration-300",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),CA=d.forwardRef(({side:e="right",className:t,children:n,...r},o)=>v.jsxs(gJ,{children:[v.jsx(EA,{}),v.jsx(zd,{ref:o,className:xe(vJ({side:e}),t),...r,children:n})]}));CA.displayName=zd.displayName;const $A=({className:e,...t})=>v.jsx("div",{className:xe("flex flex-col space-y-2 text-center sm:text-left",e),...t});$A.displayName="SheetHeader";const yJ=d.forwardRef(({className:e,...t},n)=>v.jsx(Ud,{ref:n,className:xe("text-lg font-semibold text-foreground",e),...t}));yJ.displayName=Ud.displayName;const wJ=d.forwardRef(({className:e,...t},n)=>v.jsx(Vd,{ref:n,className:xe("text-sm text-muted-foreground",e),...t}));wJ.displayName=Vd.displayName;const _t=({children:e})=>v.jsx("div",{className:"flex justify-between items-center pr-4",children:e}),zt=({text:e,toolTip:t="",url:n,htmlFor:r,disabled:o=!1,className:i=""})=>v.jsxs(eT,{children:[v.jsx(tT,{asChild:!0,children:v.jsx(nb,{htmlFor:r||e.toLowerCase().replace(" ","-"),className:xe("font-medium min-w-[65px]",i),disabled:o,children:e})}),t||n?v.jsxs($x,{className:"flex flex-col max-w-xs text-sm",side:"left",children:[v.jsx("p",{children:t}),n?v.jsx(vn,{variant:"link",className:"justify-end",children:v.jsx("a",{href:n,target:"_blank",children:"More info"})}):v.jsx(v.Fragment,{})]}):v.jsx(v.Fragment,{})]}),xJ=()=>{const[e,t]=xt(n=>[n.settings,n.updateSettings]);return v.jsxs("div",{className:"flex flex-col gap-4 mt-4",children:[v.jsxs("div",{className:"flex flex-col gap-1",children:[v.jsx(zt,{htmlFor:"steps",text:"Steps",toolTip:"The number of denoising steps. More denoising steps usually lead to a higher quality image at the expense of slower inference."}),v.jsxs(_t,{children:[v.jsx(po,{className:"w-[180px]",defaultValue:[30],min:1,max:100,step:1,value:[Math.floor(e.ldmSteps)],onValueChange:n=>t({ldmSteps:n[0]})}),v.jsx(No,{id:"steps",className:"w-[50px] rounded-full",numberValue:e.ldmSteps,allowFloat:!1,onNumberValueChange:n=>{t({ldmSteps:n})}})]})]}),v.jsxs(_t,{children:[v.jsx(zt,{text:"Sampler"}),v.jsxs(yo,{value:e.ldmSampler,onValueChange:n=>{t({ldmSampler:n})},children:[v.jsx(Vr,{className:"w-[100px]",children:v.jsx(wo,{placeholder:"Select sampler"})}),v.jsx(Wr,{align:"end",children:v.jsx(zo,{children:Object.values(nx).map(n=>v.jsx(Hr,{value:n,children:n},n))})})]})]})]})},Rh=({text:e,onClick:t})=>{const[n]=xt(r=>[r.settings.showExtender]);return v.jsx(vn,{variant:"outline",className:"p-1 h-8",disabled:!n,onClick:t,children:v.jsx("div",{className:"flex items-center gap-1",children:e})})},bJ=()=>{const[e,t,n,r,o,i,s,l,u,f,m,p,g,y,x]=xt(L=>[L.serverConfig.samplers,L.settings,L.paintByExampleFile,L.getIsProcessing(),L.updateSettings,L.runInpainting,L.updateAppState,L.updateExtenderByBuiltIn,L.updateExtenderDirection,L.adjustMask,L.clearMask,L.updateEnablePowerPaintV2,L.updateEnableBrushNet,L.updateEnableControlnet,L.updateLCMLora]),[S,E]=Nx(n),_=d.useRef(null);FT(_,()=>{_!=null&&_.current&&_.current.blur()});const b=L=>{L.key==="Enter"&&L.ctrlKey&&t.prompt.length!==0&&i()},C=()=>v.jsxs(_t,{children:[v.jsx(zt,{text:"Cropper",toolTip:"Inpainting on part of image, improve inference speed and reduce memory usage."}),v.jsx(jr,{id:"cropper",checked:t.showCropper,onCheckedChange:L=>{o({showCropper:L}),L&&o({showExtender:!1})}})]}),R=()=>{if(!t.model.support_brushnet)return null;let L="BrushNet is a plug-and-play image inpainting model works on any SD1.5 base models.";return v.jsxs("div",{className:"flex flex-col gap-4",children:[v.jsxs("div",{className:"flex flex-col gap-4",children:[v.jsxs(_t,{children:[v.jsx(zt,{text:"BrushNet",url:"https://github.com/TencentARC/BrushNet",toolTip:L}),v.jsx(jr,{id:"brushnet",checked:t.enableBrushNet,onCheckedChange:ue=>{g(ue)}})]}),v.jsx(_t,{children:v.jsxs(yo,{defaultValue:t.brushnetMethod,value:t.brushnetMethod,onValueChange:ue=>{o({brushnetMethod:ue})},disabled:!t.enableBrushNet,children:[v.jsx(Vr,{children:v.jsx(wo,{placeholder:"Select brushnet model"})}),v.jsx(Wr,{align:"end",children:v.jsx(zo,{children:Object.values(t.model.brushnets).map(ue=>v.jsx(Hr,{value:ue,children:ue.split("/")[1]},ue))})})]})})]}),v.jsx(Xt,{})]})},k=()=>{if(!t.model.support_controlnet)return null;let L="Using an additional conditioning image to control how an image is generated";return v.jsxs("div",{className:"flex flex-col gap-4",children:[v.jsxs("div",{className:"flex flex-col gap-4",children:[v.jsxs(_t,{children:[v.jsx(zt,{text:"ControlNet",url:"https://huggingface.co/docs/diffusers/main/en/using-diffusers/inpaint#controlnet",toolTip:L}),v.jsx(jr,{id:"controlnet",checked:t.enableControlnet,onCheckedChange:ue=>{y(ue)}})]}),v.jsx("div",{className:"flex flex-col gap-1",children:v.jsxs(_t,{children:[v.jsx(po,{className:"w-[180px]",defaultValue:[100],min:1,max:100,step:1,disabled:!t.enableControlnet,value:[Math.floor(t.controlnetConditioningScale*100)],onValueChange:ue=>o({controlnetConditioningScale:ue[0]/100})}),v.jsx(No,{id:"controlnet-weight",className:"w-[50px] rounded-full",disabled:!t.enableControlnet,numberValue:t.controlnetConditioningScale,allowFloat:!1,onNumberValueChange:ue=>{o({controlnetConditioningScale:ue})}})]})}),v.jsx(_t,{children:v.jsxs(yo,{defaultValue:t.controlnetMethod,value:t.controlnetMethod,onValueChange:ue=>{o({controlnetMethod:ue})},disabled:!t.enableControlnet,children:[v.jsx(Vr,{children:v.jsx(wo,{placeholder:"Select control method"})}),v.jsx(Wr,{align:"end",children:v.jsx(zo,{children:Object.values(t.model.controlnets).map(ue=>v.jsx(Hr,{value:ue,children:ue.split("/")[1]},ue))})})]})})]}),v.jsx(Xt,{})]})},O=()=>{if(!t.model.support_lcm_lora)return null;let L="Enable quality image generation in typically 2-8 steps. Suggest disabling guidance_scale by setting it to 0. You can also try values between 1.0 and 2.0. When LCM Lora is enabled, LCMSampler will be used automatically.";return v.jsxs(v.Fragment,{children:[v.jsxs(_t,{children:[v.jsx(zt,{text:"LCM LoRA",url:"https://huggingface.co/docs/diffusers/main/en/using-diffusers/inference_with_lcm_lora",toolTip:L}),v.jsx(jr,{id:"lcm-lora",checked:t.enableLCMLora,onCheckedChange:ue=>{x(ue)}})]}),v.jsx(Xt,{})]})},A=()=>t.model.need_prompt?v.jsxs("div",{className:"flex flex-col gap-4",children:[v.jsx(zt,{text:"Negative prompt",url:"https://huggingface.co/docs/diffusers/main/en/using-diffusers/inpaint#negative-prompt",toolTip:"Negative prompt guides the model away from generating certain things in an image"}),v.jsx("div",{className:"pl-2 pr-4",children:v.jsx(jx,{ref:_,rows:4,onKeyUp:b,className:"max-h-[8rem] overflow-y-auto mb-2",placeholder:"",id:"negative-prompt",value:t.negativePrompt,onInput:L=>{L.preventDefault(),L.stopPropagation();const ue=L.target;o({negativePrompt:ue.value})}})})]}):null,I=()=>t.model.name!==JR?null:v.jsxs("div",{children:[v.jsxs(_t,{children:[v.jsx(zt,{text:"Example Image",toolTip:"An example image to guide image generation."}),v.jsx(nT,{tooltip:"Upload example image",onFileUpload:L=>{s({paintByExampleFile:L})},children:v.jsx(BT,{})})]}),E?v.jsx("div",{className:"flex justify-center items-center",children:v.jsx("img",{src:S.src,alt:"example",className:"max-w-[200px] max-h-[200px] m-3"})}):v.jsx(v.Fragment,{}),v.jsx(vn,{variant:"default",className:"w-full",disabled:r||!E,onClick:()=>{i()},children:"Paint"})]}),z=()=>t.model.name!==fF?null:v.jsxs("div",{className:"flex flex-col gap-1",children:[v.jsx(zt,{text:"Image guidance scale",toolTip:"Push the generated image towards the inital image. Higher image guidance scale encourages generated images that are closely linked to the source image, usually at the expense of lower image quality.",url:"https://huggingface.co/docs/diffusers/main/en/api/pipelines/pix2pix"}),v.jsxs(_t,{children:[v.jsx(po,{className:"w-[180px]",defaultValue:[150],min:100,max:1e3,step:1,value:[Math.floor(t.p2pImageGuidanceScale*100)],onValueChange:L=>o({p2pImageGuidanceScale:L[0]/100})}),v.jsx(No,{id:"image-guidance-scale",className:"w-[50px] rounded-full",numberValue:t.p2pImageGuidanceScale,allowFloat:!0,onNumberValueChange:L=>{o({p2pImageGuidanceScale:L})}})]})]}),H=()=>{if(!t.model.support_strength)return null;let L="Strength is a measure of how much noise is added to the base image, which influences how similar the output is to the base image. Higher value means more noise and more different from the base image";return v.jsxs(_t,{children:[v.jsx(zt,{text:"Strength",url:"https://huggingface.co/docs/diffusers/main/en/using-diffusers/inpaint#strength",toolTip:L}),v.jsx(po,{className:"w-[110px]",defaultValue:[100],min:10,max:100,step:1,value:[Math.floor(t.sdStrength*100)],onValueChange:ue=>o({sdStrength:ue[0]/100})}),v.jsx(No,{id:"strength",className:"w-[50px] rounded-full",numberValue:t.sdStrength,allowFloat:!0,onNumberValueChange:ue=>{o({sdStrength:ue})}})]})},ie=()=>t.model.support_outpainting?v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsxs(_t,{children:[v.jsx(zt,{text:"Extender",toolTip:"Perform outpainting on images to expand it's content."}),v.jsx(jr,{id:"extender",checked:t.showExtender,onCheckedChange:L=>{o({showExtender:L}),L&&o({showCropper:!1})}})]}),v.jsxs(_t,{children:[v.jsxs(yo,{defaultValue:t.extenderDirection,value:t.extenderDirection,onValueChange:L=>{u(L)},children:[v.jsx(Vr,{className:"w-[65px] h-7",disabled:!t.showExtender,children:v.jsx(wo,{placeholder:"Select axis"})}),v.jsx(Wr,{align:"end",children:v.jsx(zo,{children:Object.values(Ln).map(L=>v.jsx(Hr,{value:L,children:L},L))})})]}),v.jsxs("div",{className:"flex gap-1 justify-center mt-0",children:[v.jsx(Rh,{text:"1.25x",onClick:()=>l(t.extenderDirection,1.25)}),v.jsx(Rh,{text:"1.5x",onClick:()=>l(t.extenderDirection,1.5)}),v.jsx(Rh,{text:"1.75x",onClick:()=>l(t.extenderDirection,1.75)}),v.jsx(Rh,{text:"2.0x",onClick:()=>l(t.extenderDirection,2)})]})]})]}),v.jsx(Xt,{})]}):null,K=()=>v.jsxs(_t,{children:[v.jsx(zt,{text:"Task",toolTip:"PowerPaint task. When using extender, image-outpainting task will be auto used. For object-removal and image-outpainting, it is recommended to set the guidance_scale at 10 or above."}),v.jsxs(yo,{defaultValue:t.powerpaintTask,value:t.powerpaintTask,onValueChange:L=>{o({powerpaintTask:L})},disabled:t.showExtender,children:[v.jsx(Vr,{className:"w-[130px]",children:v.jsx(wo,{placeholder:"Select task"})}),v.jsx(Wr,{align:"end",children:v.jsx(zo,{children:[ma.text_guided,ma.object_remove,ma.context_aware,ma.shape_guided].map(L=>v.jsx(Hr,{value:L,children:L},L))})})]})]}),te=()=>t.model.name!==hF?null:v.jsxs(v.Fragment,{children:[K(),v.jsx(Xt,{})]}),U=()=>t.model.support_powerpaint_v2===!1?null:v.jsxs(v.Fragment,{children:[v.jsxs(_t,{children:[v.jsx(zt,{text:"PowerPaint V2",toolTip:"PowerPaint is a plug-and-play image inpainting model works on any SD1.5 base models."}),v.jsx(jr,{id:"powerpaint-v2",checked:t.enablePowerPaintV2,onCheckedChange:L=>{p(L)}})]}),K(),v.jsx(Xt,{})]}),re=()=>v.jsxs(_t,{children:[v.jsx(zt,{htmlFor:"steps",text:"Steps",toolTip:"The number of denoising steps. More denoising steps usually lead to a higher quality image at the expense of slower inference."}),v.jsx(po,{className:"w-[110px]",defaultValue:[30],min:1,max:100,step:1,value:[Math.floor(t.sdSteps)],onValueChange:L=>o({sdSteps:L[0]})}),v.jsx(No,{id:"steps",className:"w-[50px] rounded-full",numberValue:t.sdSteps,allowFloat:!1,onNumberValueChange:L=>{o({sdSteps:L})}})]}),V=()=>v.jsxs(_t,{children:[v.jsx(zt,{text:"Guidance",url:"https://huggingface.co/docs/diffusers/main/en/using-diffusers/inpaint#guidance-scale",toolTip:"Guidance scale affects how aligned the text prompt and generated image are. Higher value means the prompt and generated image are closely aligned, so the output is a stricter interpretation of the prompt"}),v.jsx(po,{className:"w-[110px]",defaultValue:[750],min:0,max:1500,step:1,value:[Math.floor(t.sdGuidanceScale*100)],onValueChange:L=>o({sdGuidanceScale:L[0]/100})}),v.jsx(No,{id:"guid",className:"w-[50px] rounded-full",numberValue:t.sdGuidanceScale,allowFloat:!0,onNumberValueChange:L=>{o({sdGuidanceScale:L})}})]}),J=()=>t.model.name===pF?null:v.jsxs(_t,{children:[v.jsx(zt,{text:"Sampler"}),v.jsxs(yo,{defaultValue:t.sdSampler,value:t.sdSampler,onValueChange:L=>{o({sdSampler:L})},children:[v.jsx(Vr,{className:"w-[175px] text-xs",children:v.jsx(wo,{placeholder:"Select sampler"})}),v.jsx(Wr,{align:"end",children:v.jsx(zo,{children:e.map(L=>v.jsx(Hr,{value:L,className:"text-xs",children:L},L))})})]})]}),G=()=>v.jsxs(_t,{children:[v.jsx(zt,{text:"Seed",toolTip:"Using same parameters and a fixed seed can generate same result image."}),v.jsxs("div",{className:"flex gap-2 justify-center items-center",children:[v.jsx(jr,{id:"seed",checked:t.seedFixed,onCheckedChange:L=>{o({seedFixed:L})}}),v.jsx(No,{id:"seed",className:"w-[110px]",disabled:!t.seedFixed,numberValue:t.seed,allowFloat:!1,onNumberValueChange:L=>{o({seed:L})}})]})]}),Z=()=>v.jsxs(v.Fragment,{children:[v.jsxs(_t,{children:[v.jsx(zt,{text:"Mask blur",toolTip:"How much to blur the mask before processing, in pixels. Make the generated inpainting boundaries appear more natural."}),v.jsx(po,{className:"w-[110px]",defaultValue:[t.sdMaskBlur],min:0,max:96,step:1,value:[Math.floor(t.sdMaskBlur)],onValueChange:L=>o({sdMaskBlur:L[0]})}),v.jsx(No,{id:"mask-blur",className:"w-[50px] rounded-full",numberValue:t.sdMaskBlur,allowFloat:!1,onNumberValueChange:L=>{o({sdMaskBlur:L})}})]}),v.jsx(Xt,{})]}),Q=()=>v.jsxs(v.Fragment,{children:[v.jsxs(_t,{children:[v.jsx(zt,{text:"Match histograms",toolTip:"Match the inpainting result histogram to the source image histogram",url:"https://github.com/Sanster/lama-cleaner/pull/143#issuecomment-1325859307"}),v.jsx(jr,{id:"match-histograms",checked:t.sdMatchHistograms,onCheckedChange:L=>{o({sdMatchHistograms:L})}})]}),v.jsx(Xt,{})]}),le=()=>v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsxs(_t,{children:[v.jsx(zt,{htmlFor:"adjustMaskKernelSize",text:"Mask OP",toolTip:"Expand or shrink mask. Using the slider to adjust the kernel size for dilation or erosion."}),v.jsx(po,{className:"w-[110px]",defaultValue:[12],min:1,max:100,step:1,value:[Math.floor(t.adjustMaskKernelSize)],onValueChange:L=>o({adjustMaskKernelSize:L[0]})}),v.jsx(No,{id:"adjustMaskKernelSize",className:"w-[50px] rounded-full",numberValue:t.adjustMaskKernelSize,allowFloat:!1,onNumberValueChange:L=>{o({adjustMaskKernelSize:L})}})]}),v.jsxs(_t,{children:[v.jsx(vn,{variant:"outline",className:"p-1 h-8",onClick:()=>f("expand"),disabled:r,children:v.jsx("div",{className:"flex items-center gap-1 select-none",children:"Expand"})}),v.jsx(vn,{variant:"outline",className:"p-1 h-8",onClick:()=>f("shrink"),disabled:r,children:v.jsx("div",{className:"flex items-center gap-1 select-none",children:"Shrink"})}),v.jsx(vn,{variant:"outline",className:"p-1 h-8",onClick:()=>f("reverse"),disabled:r,children:v.jsx("div",{className:"flex items-center gap-1 select-none",children:"Reverse"})}),v.jsx(vn,{variant:"outline",className:"p-1 h-8 justify-self-end",onClick:m,disabled:r,children:v.jsx("div",{className:"flex items-center gap-1 select-none",children:"Clear"})})]})]}),v.jsx(Xt,{})]});return v.jsxs("div",{className:"flex flex-col gap-[14px] mt-4",children:[C(),ie(),Z(),le(),Q(),te(),re(),V(),z(),H(),J(),G(),A(),v.jsx(Xt,{}),R(),U(),k(),O(),I()]})},SJ=()=>{const[e,t]=xt(n=>[n.settings,n.updateSettings]);return v.jsxs("div",{className:"flex flex-col gap-4 mt-4",children:[v.jsxs(_t,{children:[v.jsx(zt,{text:"CV2 Flag",url:"https://docs.opencv.org/4.8.0/d7/d8b/group__photo__inpaint.html#gga8002a65f5a3328fbf15df81b842d3c3ca892824c38e258feb5e72f308a358d52e"}),v.jsxs(yo,{value:e.cv2Flag,onValueChange:n=>{t({cv2Flag:n})},children:[v.jsx(Vr,{className:"w-[160px]",children:v.jsx(wo,{placeholder:"Select flag"})}),v.jsx(Wr,{align:"end",children:v.jsx(zo,{children:Object.values(rx).map(n=>v.jsx(Hr,{value:n,children:n},n))})})]})]}),v.jsx(zt,{text:"CV2 Radius",url:"https://docs.opencv.org/4.8.0/d7/d8b/group__photo__inpaint.html#gga8002a65f5a3328fbf15df81b842d3c3ca892824c38e258feb5e72f308a358d52e"}),v.jsxs(_t,{children:[v.jsx(po,{className:"w-[180px]",defaultValue:[5],min:1,max:100,step:1,value:[Math.floor(e.cv2Radius)],onValueChange:n=>t({cv2Radius:n[0]})}),v.jsx(No,{id:"cv2-radius",className:"w-[50px] rounded-full",numberValue:e.cv2Radius,allowFloat:!1,onNumberValueChange:n=>{t({cv2Radius:n})}})]})]})},_J=()=>{const[e,t]=xt(i=>[i.settings,i.windowSize]),[n,r]=Fx(!0);if(Yn("c",()=>{r()}),e.model.name!==fC&&e.model.name!==hC&&e.model.model_type===ms)return null;const o=()=>e.model.name===fC?v.jsx(xJ,{}):e.model.name===hC?v.jsx(SJ,{}):v.jsx(bJ,{});return v.jsxs(pJ,{open:n,modal:!1,children:[v.jsx(mJ,{tabIndex:-1,className:"z-10 outline-none absolute top-[68px] right-6 rounded-lg border bg-background",hidden:n,children:v.jsx(vn,{variant:"ghost",size:"icon",asChild:!0,className:"p-1.5",onClick:r,children:v.jsx(lH,{strokeWidth:1})})}),v.jsxs(CA,{side:"right",className:"w-[286px] mt-[60px] outline-none pl-3 pr-1",onOpenAutoFocus:i=>i.preventDefault(),onPointerDownOutside:i=>i.preventDefault(),children:[v.jsxs($A,{children:[v.jsxs(_t,{children:[v.jsx("div",{className:"overflow-hidden mr-8",children:e.model.name.split("/")[e.model.name.split("/").length-1]}),v.jsx(vn,{variant:"ghost",size:"icon",className:"border h-6 w-6",onClick:r,children:v.jsx(cH,{strokeWidth:1})})]}),v.jsx(Xt,{})]}),v.jsx(fg,{style:{height:t.height-160},children:o()})]})]})},ti=Object.create(null);ti.open="0";ti.close="1";ti.ping="2";ti.pong="3";ti.message="4";ti.upgrade="5";ti.noop="6";const ap=Object.create(null);Object.keys(ti).forEach(e=>{ap[ti[e]]=e});const q1={type:"error",data:"parser error"},RA=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",PA=typeof ArrayBuffer=="function",TA=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,db=({type:e,data:t},n,r)=>RA&&t instanceof Blob?n?r(t):e$(t,r):PA&&(t instanceof ArrayBuffer||TA(t))?n?r(t):e$(new Blob([t]),r):r(ti[e]+(t||"")),e$=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function t$(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let K0;function EJ(e,t){if(RA&&e.data instanceof Blob)return e.data.arrayBuffer().then(t$).then(t);if(PA&&(e.data instanceof ArrayBuffer||TA(e.data)))return t(t$(e.data));db(e,!1,n=>{K0||(K0=new TextEncoder),t(K0.encode(n))})}const n$="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_u=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<n$.length;e++)_u[n$.charCodeAt(e)]=e;const CJ=e=>{let t=e.length*.75,n=e.length,r,o=0,i,s,l,u;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const f=new ArrayBuffer(t),m=new Uint8Array(f);for(r=0;r<n;r+=4)i=_u[e.charCodeAt(r)],s=_u[e.charCodeAt(r+1)],l=_u[e.charCodeAt(r+2)],u=_u[e.charCodeAt(r+3)],m[o++]=i<<2|s>>4,m[o++]=(s&15)<<4|l>>2,m[o++]=(l&3)<<6|u&63;return f},$J=typeof ArrayBuffer=="function",fb=(e,t)=>{if(typeof e!="string")return{type:"message",data:kA(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:RJ(e.substring(1),t)}:ap[n]?e.length>1?{type:ap[n],data:e.substring(1)}:{type:ap[n]}:q1},RJ=(e,t)=>{if($J){const n=CJ(e);return kA(n,t)}else return{base64:!0,data:e}},kA=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},AA="",PJ=(e,t)=>{const n=e.length,r=new Array(n);let o=0;e.forEach((i,s)=>{db(i,!1,l=>{r[s]=l,++o===n&&t(r.join(AA))})})},TJ=(e,t)=>{const n=e.split(AA),r=[];for(let o=0;o<n.length;o++){const i=fb(n[o],t);if(r.push(i),i.type==="error")break}return r};function kJ(){return new TransformStream({transform(e,t){EJ(e,n=>{const r=n.length;let o;if(r<126)o=new Uint8Array(1),new DataView(o.buffer).setUint8(0,r);else if(r<65536){o=new Uint8Array(3);const i=new DataView(o.buffer);i.setUint8(0,126),i.setUint16(1,r)}else{o=new Uint8Array(9);const i=new DataView(o.buffer);i.setUint8(0,127),i.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(o[0]|=128),t.enqueue(o),t.enqueue(n)})}})}let G0;function Ph(e){return e.reduce((t,n)=>t+n.length,0)}function Th(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let o=0;o<t;o++)n[o]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function AJ(e,t){G0||(G0=new TextDecoder);const n=[];let r=0,o=-1,i=!1;return new TransformStream({transform(s,l){for(n.push(s);;){if(r===0){if(Ph(n)<1)break;const u=Th(n,1);i=(u[0]&128)===128,o=u[0]&127,o<126?r=3:o===126?r=1:r=2}else if(r===1){if(Ph(n)<2)break;const u=Th(n,2);o=new DataView(u.buffer,u.byteOffset,u.length).getUint16(0),r=3}else if(r===2){if(Ph(n)<8)break;const u=Th(n,8),f=new DataView(u.buffer,u.byteOffset,u.length),m=f.getUint32(0);if(m>Math.pow(2,21)-1){l.enqueue(q1);break}o=m*Math.pow(2,32)+f.getUint32(4),r=3}else{if(Ph(n)<o)break;const u=Th(n,o);l.enqueue(fb(i?u:G0.decode(u),t)),r=0}if(o===0||o>e){l.enqueue(q1);break}}}})}const MA=4;function qt(e){if(e)return MJ(e)}function MJ(e){for(var t in qt.prototype)e[t]=qt.prototype[t];return e}qt.prototype.on=qt.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};qt.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};qt.prototype.off=qt.prototype.removeListener=qt.prototype.removeAllListeners=qt.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,o=0;o<n.length;o++)if(r=n[o],r===t||r.fn===t){n.splice(o,1);break}return n.length===0&&delete this._callbacks["$"+e],this};qt.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,o=n.length;r<o;++r)n[r].apply(this,t)}return this};qt.prototype.emitReserved=qt.prototype.emit;qt.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};qt.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Ur=typeof self<"u"?self:typeof window<"u"?window:Function("return this")();function OA(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const OJ=Ur.setTimeout,NJ=Ur.clearTimeout;function Sg(e,t){t.useNativeTimers?(e.setTimeoutFn=OJ.bind(Ur),e.clearTimeoutFn=NJ.bind(Ur)):(e.setTimeoutFn=Ur.setTimeout.bind(Ur),e.clearTimeoutFn=Ur.clearTimeout.bind(Ur))}const DJ=1.33;function IJ(e){return typeof e=="string"?LJ(e):Math.ceil((e.byteLength||e.size)*DJ)}function LJ(e){let t=0,n=0;for(let r=0,o=e.length;r<o;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function FJ(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function jJ(e){let t={},n=e.split("&");for(let r=0,o=n.length;r<o;r++){let i=n[r].split("=");t[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return t}class BJ extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class hb extends qt{constructor(t){super(),this.writable=!1,Sg(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new BJ(t,n,r)),this}open(){return 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=fb(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=FJ(t);return n.length?"?"+n:""}}const NA="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Q1=64,zJ={};let r$=0,kh=0,o$;function i$(e){let t="";do t=NA[e%Q1]+t,e=Math.floor(e/Q1);while(e>0);return t}function DA(){const e=i$(+new Date);return e!==o$?(r$=0,o$=e):e+"."+i$(r$++)}for(;kh<Q1;kh++)zJ[NA[kh]]=kh;let IA=!1;try{IA=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const UJ=IA;function LA(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||UJ))return new XMLHttpRequest}catch{}if(!t)try{return new Ur[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function VJ(){}const WJ=function(){return new LA({xdomain:!1}).responseType!=null}();class HJ extends hb{constructor(t){if(super(t),this.polling=!1,typeof location<"u"){const r=location.protocol==="https:";let o=location.port;o||(o=r?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||o!==t.port}const n=t&&t.forceBase64;this.supportsBinary=WJ&&!n,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(t){this.readyState="pausing";const n=()=>{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)};TJ(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,PJ(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=DA()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}request(t={}){return Object.assign(t,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new qo(this.uri(),t)}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(o,i)=>{this.onError("xhr post error",o,i)})}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 qo extends qt{constructor(t,n){super(),Sg(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.data=n.data!==void 0?n.data:null,this.create()}create(){var t;const n=OA(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this.opts.xd;const r=this.xhr=new LA(n);try{r.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let o in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(o)&&r.setRequestHeader(o,this.opts.extraHeaders[o])}}catch{}if(this.method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this.opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=()=>{var o;r.readyState===3&&((o=this.opts.cookieJar)===null||o===void 0||o.parseCookies(r)),r.readyState===4&&(r.status===200||r.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof r.status=="number"?r.status:0)},0))},r.send(this.data)}catch(o){this.setTimeoutFn(()=>{this.onError(o)},0);return}typeof document<"u"&&(this.index=qo.requestsCount++,qo.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=VJ,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete qo.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()}}qo.requestsCount=0;qo.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",s$);else if(typeof addEventListener=="function"){const e="onpagehide"in Ur?"pagehide":"unload";addEventListener(e,s$,!1)}}function s$(){for(let e in qo.requests)qo.requests.hasOwnProperty(e)&&qo.requests[e].abort()}const pb=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),Ah=Ur.WebSocket||Ur.MozWebSocket,a$=!0,KJ="arraybuffer",l$=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class GJ extends hb{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=l$?{}:OA(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=a$&&!l$?n?new Ah(t,n):new Ah(t):new Ah(t,n,r)}catch(o){return this.emitReserved("error",o)}this.ws.binaryType=this.socket.binaryType,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<t.length;n++){const r=t[n],o=n===t.length-1;db(r,this.supportsBinary,i=>{const s={};try{a$&&this.ws.send(i)}catch{}o&&pb(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=DA()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}check(){return!!Ah}}class YJ extends hb{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(t=>{const n=AJ(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),o=kJ();o.readable.pipeTo(t.writable),this.writer=o.writable.getWriter();const i=()=>{r.read().then(({done:l,value:u})=>{l||(this.onPacket(u),i())}).catch(l=>{})};i();const s={type:"open"};this.query.sid&&(s.data=`{"sid":"${this.query.sid}"}`),this.writer.write(s).then(()=>this.onOpen())})}))}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],o=n===t.length-1;this.writer.write(r).then(()=>{o&&pb(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this.transport)===null||t===void 0||t.close()}}const XJ={websocket:GJ,webtransport:YJ,polling:HJ},ZJ=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,qJ=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function J1(e){if(e.length>2e3)throw"URI too long";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 o=ZJ.exec(e||""),i={},s=14;for(;s--;)i[qJ[s]]=o[s]||"";return n!=-1&&r!=-1&&(i.source=t,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=QJ(i,i.path),i.queryKey=JJ(i,i.query),i}function QJ(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 JJ(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,o,i){o&&(n[o]=i)}),n}let FA=class gl extends qt{constructor(t,n={}){super(),this.binaryType=KJ,this.writeBuffer=[],t&&typeof t=="object"&&(n=t,t=null),t?(t=J1(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=J1(n.host).host),Sg(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","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=jJ(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=MA,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new XJ[t](r)}open(){let t;if(this.opts.rememberUpgrade&&gl.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;gl.priorWebsocketSuccess=!1;const o=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",p=>{if(!r)if(p.type==="pong"&&p.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;gl.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(m(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const g=new Error("probe error");g.transport=n.name,this.emitReserved("upgradeError",g)}}))};function i(){r||(r=!0,m(),n.close(),n=null)}const s=p=>{const g=new Error("probe error: "+p);g.transport=n.name,i(),this.emitReserved("upgradeError",g)};function l(){s("transport closed")}function u(){s("socket closed")}function f(p){n&&p.name!==n.name&&i()}const m=()=>{n.removeListener("open",o),n.removeListener("error",s),n.removeListener("close",l),this.off("close",u),this.off("upgrading",f)};n.once("open",o),n.once("error",s),n.once("close",l),this.once("close",u),this.once("upgrading",f),this.upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onOpen(){if(this.readyState="open",gl.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let t=0;const n=this.upgrades.length;for(;t<n;t++)this.probe(this.upgrades[t])}}onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),this.resetPingTimeout(),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const n=new Error("server error");n.code=t.data,this.onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{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;r<this.writeBuffer.length;r++){const o=this.writeBuffer[r].data;if(o&&(n+=IJ(o)),r>0&&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,o){if(typeof n=="function"&&(o=n,n=void 0),typeof r=="function"&&(o=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const i={type:t,data:n,options:r};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),o&&this.once("flush",o),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){gl.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 o=t.length;for(;r<o;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}};FA.protocol=MA;function eee(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=J1(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const i=r.host.indexOf(":")!==-1?"["+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}const tee=typeof ArrayBuffer=="function",nee=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,jA=Object.prototype.toString,ree=typeof Blob=="function"||typeof Blob<"u"&&jA.call(Blob)==="[object BlobConstructor]",oee=typeof File=="function"||typeof File<"u"&&jA.call(File)==="[object FileConstructor]";function mb(e){return tee&&(e instanceof ArrayBuffer||nee(e))||ree&&e instanceof Blob||oee&&e instanceof File}function lp(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(lp(e[n]))return!0;return!1}if(mb(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return lp(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&lp(e[n]))return!0;return!1}function iee(e){const t=[],n=e.data,r=e;return r.data=ew(n,t),r.attachments=t.length,{packet:r,buffers:t}}function ew(e,t){if(!e)return e;if(mb(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=ew(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=ew(e[r],t));return n}return e}function see(e,t){return e.data=tw(e.data,t),delete e.attachments,e}function tw(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=tw(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=tw(e[n],t));return e}const aee=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],lee=5;var lt;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(lt||(lt={}));class cee{constructor(t){this.replacer=t}encode(t){return(t.type===lt.EVENT||t.type===lt.ACK)&&lp(t)?this.encodeAsBinary({type:t.type===lt.EVENT?lt.BINARY_EVENT:lt.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===lt.BINARY_EVENT||t.type===lt.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=iee(t),r=this.encodeAsString(n.packet),o=n.buffers;return o.unshift(r),o}}function c$(e){return Object.prototype.toString.call(e)==="[object Object]"}class gb extends qt{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===lt.BINARY_EVENT;r||n.type===lt.BINARY_ACK?(n.type=r?lt.EVENT:lt.ACK,this.reconstructor=new uee(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(mb(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(lt[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===lt.BINARY_EVENT||r.type===lt.BINARY_ACK){const i=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const s=t.substring(i,n);if(s!=Number(s)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(s)}if(t.charAt(n+1)==="/"){const i=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(i,n)}else r.nsp="/";const o=t.charAt(n+1);if(o!==""&&Number(o)==o){const i=n+1;for(;++n;){const s=t.charAt(n);if(s==null||Number(s)!=s){--n;break}if(n===t.length)break}r.id=Number(t.substring(i,n+1))}if(t.charAt(++n)){const i=this.tryParse(t.substr(n));if(gb.isPayloadValid(r.type,i))r.data=i;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case lt.CONNECT:return c$(n);case lt.DISCONNECT:return n===void 0;case lt.CONNECT_ERROR:return typeof n=="string"||c$(n);case lt.EVENT:case lt.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&aee.indexOf(n[0])===-1);case lt.ACK:case lt.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class uee{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=see(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const dee=Object.freeze(Object.defineProperty({__proto__:null,Decoder:gb,Encoder:cee,get PacketType(){return lt},protocol:lee},Symbol.toStringTag,{value:"Module"}));function mo(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const fee=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class BA extends qt{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[mo(t,"open",this.onopen.bind(this)),mo(t,"packet",this.onpacket.bind(this)),mo(t,"error",this.onerror.bind(this)),mo(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(fee.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const r={type:lt.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const s=this.ids++,l=n.pop();this._registerAckCallback(s,l),r.id=s}const o=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!o||!this.connected)||(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(t,n){var r;const o=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(o===void 0){this.acks[t]=n;return}const i=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let s=0;s<this.sendBuffer.length;s++)this.sendBuffer[s].id===t&&this.sendBuffer.splice(s,1);n.call(this,new Error("operation has timed out"))},o);this.acks[t]=(...s)=>{this.io.clearTimeoutFn(i),n.apply(this,[null,...s])}}emitWithAck(t,...n){const r=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((o,i)=>{n.push((s,l)=>r?s?i(s):o(l):o(s)),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((o,...i)=>r!==this._queue[0]?void 0:(o!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(o)):(this._queue.shift(),n&&n(null,...i)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:lt.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}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 lt.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):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 lt.EVENT:case lt.BINARY_EVENT:this.onevent(t);break;case lt.ACK:case lt.BINARY_ACK:this.onack(t);break;case lt.DISCONNECT:this.ondisconnect();break;case lt.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),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...o){r||(r=!0,n.packet({type:lt.ACK,id:t,data:o}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(n.apply(this,t.data),delete this.acks[t.id])}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}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:lt.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;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Oc(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Oc.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};Oc.prototype.reset=function(){this.attempts=0};Oc.prototype.setMin=function(e){this.ms=e};Oc.prototype.setMax=function(e){this.max=e};Oc.prototype.setJitter=function(e){this.jitter=e};class nw extends qt{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,Sg(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 Oc({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const o=n.parser||dee;this.encoder=new o.Encoder,this.decoder=new o.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 FA(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const o=mo(n,"open",function(){r.onopen(),t&&t()}),i=l=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",l),t?t(l):this.maybeReconnectOnOpen()},s=mo(n,"error",i);if(this._timeout!==!1){const l=this._timeout,u=this.setTimeoutFn(()=>{o(),i(new Error("timeout")),n.close()},l);this.opts.autoUnref&&u.unref(),this.subs.push(()=>{this.clearTimeoutFn(u)})}return this.subs.push(o),this.subs.push(s),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(mo(t,"ping",this.onping.bind(this)),mo(t,"data",this.ondata.bind(this)),mo(t,"error",this.onerror.bind(this)),mo(t,"close",this.onclose.bind(this)),mo(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){pb(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new BA(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;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),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(o=>{o?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",o)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const mu={};function cp(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=eee(e,t.path||"/socket.io"),r=n.source,o=n.id,i=n.path,s=mu[o]&&i in mu[o].nsps,l=t.forceNew||t["force new connection"]||t.multiplex===!1||s;let u;return l?u=new nw(r,t):(mu[o]||(mu[o]=new nw(r,t)),u=mu[o]),n.query&&!t.query&&(t.query=n.queryKey),u.socket(n.path,t)}Object.assign(cp,{Manager:nw,Socket:BA,io:cp,connect:cp});const zA="Progress",_g=100,[hee,Ete]=Tn(zA),[pee,mee]=hee(zA),UA=d.forwardRef((e,t)=>{const{__scopeProgress:n,value:r,max:o,getValueLabel:i=yee,...s}=e,l=rw(o)?o:_g,u=WA(r,l)?r:null,f=dm(u)?i(u,l):void 0;return d.createElement(pee,{scope:n,value:u,max:l},d.createElement(Ae.div,Y({"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":dm(u)?u:void 0,"aria-valuetext":f,role:"progressbar","data-state":VA(u,l),"data-value":u??void 0,"data-max":l},s,{ref:t})))});UA.propTypes={max(e,t,n){const r=e[t],o=String(r);return r&&!rw(r)?new Error(wee(o,n)):null},value(e,t,n){const r=e[t],o=String(r),i=rw(e.max)?e.max:_g;return r!=null&&!WA(r,i)?new Error(xee(o,n)):null}};const gee="ProgressIndicator",vee=d.forwardRef((e,t)=>{var n;const{__scopeProgress:r,...o}=e,i=mee(gee,r);return d.createElement(Ae.div,Y({"data-state":VA(i.value,i.max),"data-value":(n=i.value)!==null&&n!==void 0?n:void 0,"data-max":i.max},o,{ref:t}))});function yee(e,t){return`${Math.round(e/t*100)}%`}function VA(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function dm(e){return typeof e=="number"}function rw(e){return dm(e)&&!isNaN(e)&&e>0}function WA(e,t){return dm(e)&&!isNaN(e)&&e<=t&&e>=0}function wee(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${_g}\`.`}function xee(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
- a positive number
- less than the value passed to \`max\` (or ${_g} if no \`max\` prop is set)
- \`null\` if the progress is indeterminate.
Defaulting to \`null\`.`}const HA=UA,bee=vee,KA=d.forwardRef(({className:e,value:t,...n},r)=>v.jsx(HA,{ref:r,className:xe("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",e),...n,children:v.jsx(bee,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));KA.displayName=HA.displayName;const See="",Ji=cp(See),_ee=()=>{const[e,t,n]=xt(u=>[u.settings,u.isInpainting,u.isSD()]),[r,o]=d.useState(!1),[i,s]=d.useState(0),l=Math.min(Math.round(i/e.sdSteps*100),100);return d.useEffect(()=>(Ji.on("connect",()=>{o(!0)}),Ji.on("disconnect",()=>{o(!1)}),Ji.on("diffusion_progress",u=>{u&&s(u.step+1)}),Ji.on("diffusion_finish",()=>{s(0)}),()=>{Ji.off("connect"),Ji.off("disconnect"),Ji.off("diffusion_progress"),Ji.off("diffusion_finish")}),[]),v.jsxs("div",{className:"z-10 fixed bg-background w-[220px] left-1/2 -translate-x-1/2 top-[68px] h-[32px] flex justify-center items-center gap-[18px] border-[1px] border-[solid] rounded-[14px] pl-[8px] pr-[8px]",style:{visibility:r&&t&&n?"visible":"hidden"},children:[v.jsx(KA,{value:l}),v.jsxs("div",{className:"w-[45px] flex justify-center font-nums",children:[l,"%"]})]})},Eee=()=>{const[e,t]=xt(n=>[n.file,n.updateSettings]);return d.useEffect(()=>{(async()=>{const r=await Wj();t({model:r})})()},[]),v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"flex gap-3 absolute top-[68px] left-[24px] items-center",children:[v.jsx(hJ,{}),v.jsx(Gq,{})]}),v.jsx(Uq,{}),v.jsx(_ee,{}),v.jsx(_J,{}),e?v.jsx(Kq,{file:e}):v.jsx(v.Fragment,{})]})},Cee=()=>{const[e,t]=d.useState(window.innerWidth),n=d.useCallback(()=>{t(window.innerWidth)},[]);if(d.useEffect(()=>(window.addEventListener("resize",n),()=>{window.removeEventListener("resize",n)})),e<768)return"mobile";if(e>=768&&e<1224)return"tablet";if(e>=1224)return"desktop"};function $ee(e){const[t]=d.useState(`file-upload-${Math.random().toString()}`),n=Cee();return v.jsx("div",{className:"absolute flex w-screen h-screen justify-center items-center pointer-events-none",children:v.jsx("label",{htmlFor:t,className:"grid bg-background border-[2px] border-[dashed] rounded-lg min-w-[600px] pointer-events-auto",children:v.jsx("div",{className:"grid p-16 w-full h-full",children:v.jsx("p",{className:"text-center",children:"Sollte das Bild nicht geladen werden, drücken sie die F5-Taste, oder klicken sie rechts oben auf den Button"})})})})}const GA="ToastProvider",[vb,Ree,Pee]=Wd("Toast"),[YA,Cte]=Tn("Toast",[Pee]),[Tee,Eg]=YA(GA),XA=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:i=50,children:s}=e,[l,u]=d.useState(null),[f,m]=d.useState(0),p=d.useRef(!1),g=d.useRef(!1);return d.createElement(vb.Provider,{scope:t},d.createElement(Tee,{scope:t,label:n,duration:r,swipeDirection:o,swipeThreshold:i,toastCount:f,viewport:l,onViewportChange:u,onToastAdd:d.useCallback(()=>m(y=>y+1),[]),onToastRemove:d.useCallback(()=>m(y=>y-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:g},s))};XA.propTypes={label(e){if(e.label&&typeof e.label=="string"&&!e.label.trim()){const t=`Invalid prop \`label\` supplied to \`${GA}\`. Expected non-empty \`string\`.`;return new Error(t)}return null}};const kee="ToastViewport",Aee=["F8"],ow="toast.viewportPause",iw="toast.viewportResume",Mee=d.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=Aee,label:o="Notifications ({hotkey})",...i}=e,s=Eg(kee,n),l=Ree(n),u=d.useRef(null),f=d.useRef(null),m=d.useRef(null),p=d.useRef(null),g=Ve(t,p,s.onViewportChange),y=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),x=s.toastCount>0;d.useEffect(()=>{const E=_=>{var b;r.every(R=>_[R]||_.code===R)&&((b=p.current)===null||b===void 0||b.focus())};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[r]),d.useEffect(()=>{const E=u.current,_=p.current;if(x&&E&&_){const b=()=>{if(!s.isClosePausedRef.current){const O=new CustomEvent(ow);_.dispatchEvent(O),s.isClosePausedRef.current=!0}},C=()=>{if(s.isClosePausedRef.current){const O=new CustomEvent(iw);_.dispatchEvent(O),s.isClosePausedRef.current=!1}},R=O=>{!E.contains(O.relatedTarget)&&C()},k=()=>{E.contains(document.activeElement)||C()};return E.addEventListener("focusin",b),E.addEventListener("focusout",R),E.addEventListener("pointermove",b),E.addEventListener("pointerleave",k),window.addEventListener("blur",b),window.addEventListener("focus",C),()=>{E.removeEventListener("focusin",b),E.removeEventListener("focusout",R),E.removeEventListener("pointermove",b),E.removeEventListener("pointerleave",k),window.removeEventListener("blur",b),window.removeEventListener("focus",C)}}},[x,s.isClosePausedRef]);const S=d.useCallback(({tabbingDirection:E})=>{const b=l().map(C=>{const R=C.ref.current,k=[R,...Yee(R)];return E==="forwards"?k:k.reverse()});return(E==="forwards"?b.reverse():b).flat()},[l]);return d.useEffect(()=>{const E=p.current;if(E){const _=b=>{const C=b.altKey||b.ctrlKey||b.metaKey;if(b.key==="Tab"&&!C){const I=document.activeElement,z=b.shiftKey;if(b.target===E&&z){var k;(k=f.current)===null||k===void 0||k.focus();return}const K=S({tabbingDirection:z?"backwards":"forwards"}),te=K.findIndex(U=>U===I);if(Y0(K.slice(te+1)))b.preventDefault();else{var O,A;z?(O=f.current)===null||O===void 0||O.focus():(A=m.current)===null||A===void 0||A.focus()}}};return E.addEventListener("keydown",_),()=>E.removeEventListener("keydown",_)}},[l,S]),d.createElement(Rz,{ref:u,role:"region","aria-label":o.replace("{hotkey}",y),tabIndex:-1,style:{pointerEvents:x?void 0:"none"}},x&&d.createElement(u$,{ref:f,onFocusFromOutsideViewport:()=>{const E=S({tabbingDirection:"forwards"});Y0(E)}}),d.createElement(vb.Slot,{scope:n},d.createElement(Ae.ol,Y({tabIndex:-1},i,{ref:g}))),x&&d.createElement(u$,{ref:m,onFocusFromOutsideViewport:()=>{const E=S({tabbingDirection:"backwards"});Y0(E)}}))}),Oee="ToastFocusProxy",u$=d.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,i=Eg(Oee,n);return d.createElement(Xm,Y({"aria-hidden":!0,tabIndex:0},o,{ref:t,style:{position:"fixed"},onFocus:s=>{var l;const u=s.relatedTarget;!((l=i.viewport)!==null&&l!==void 0&&l.contains(u))&&r()}}))}),Cg="Toast",Nee="toast.swipeStart",Dee="toast.swipeMove",Iee="toast.swipeCancel",Lee="toast.swipeEnd",Fee=d.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:i,...s}=e,[l=!0,u]=eo({prop:r,defaultProp:o,onChange:i});return d.createElement(xn,{present:n||l},d.createElement(ZA,Y({open:l},s,{ref:t,onClose:()=>u(!1),onPause:Lt(e.onPause),onResume:Lt(e.onResume),onSwipeStart:fe(e.onSwipeStart,f=>{f.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:fe(e.onSwipeMove,f=>{const{x:m,y:p}=f.detail.delta;f.currentTarget.setAttribute("data-swipe","move"),f.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${m}px`),f.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${p}px`)}),onSwipeCancel:fe(e.onSwipeCancel,f=>{f.currentTarget.setAttribute("data-swipe","cancel"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),f.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:fe(e.onSwipeEnd,f=>{const{x:m,y:p}=f.detail.delta;f.currentTarget.setAttribute("data-swipe","end"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),f.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${m}px`),f.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${p}px`),u(!1)})})))}),[jee,Bee]=YA(Cg,{onClose(){}}),ZA=d.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:o,open:i,onClose:s,onEscapeKeyDown:l,onPause:u,onResume:f,onSwipeStart:m,onSwipeMove:p,onSwipeCancel:g,onSwipeEnd:y,...x}=e,S=Eg(Cg,n),[E,_]=d.useState(null),b=Ve(t,U=>_(U)),C=d.useRef(null),R=d.useRef(null),k=o||S.duration,O=d.useRef(0),A=d.useRef(k),I=d.useRef(0),{onToastAdd:z,onToastRemove:H}=S,ie=Lt(()=>{var U;(E==null?void 0:E.contains(document.activeElement))&&((U=S.viewport)===null||U===void 0||U.focus()),s()}),K=d.useCallback(U=>{!U||U===1/0||(window.clearTimeout(I.current),O.current=new Date().getTime(),I.current=window.setTimeout(ie,U))},[ie]);d.useEffect(()=>{const U=S.viewport;if(U){const re=()=>{K(A.current),f==null||f()},V=()=>{const J=new Date().getTime()-O.current;A.current=A.current-J,window.clearTimeout(I.current),u==null||u()};return U.addEventListener(ow,V),U.addEventListener(iw,re),()=>{U.removeEventListener(ow,V),U.removeEventListener(iw,re)}}},[S.viewport,k,u,f,K]),d.useEffect(()=>{i&&!S.isClosePausedRef.current&&K(k)},[i,k,S.isClosePausedRef,K]),d.useEffect(()=>(z(),()=>H()),[z,H]);const te=d.useMemo(()=>E?eM(E):null,[E]);return S.viewport?d.createElement(d.Fragment,null,te&&d.createElement(zee,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0},te),d.createElement(jee,{scope:n,onClose:ie},Bs.createPortal(d.createElement(vb.ItemSlot,{scope:n},d.createElement($z,{asChild:!0,onEscapeKeyDown:fe(l,()=>{S.isFocusedToastEscapeKeyDownRef.current||ie(),S.isFocusedToastEscapeKeyDownRef.current=!1})},d.createElement(Ae.li,Y({role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":S.swipeDirection},x,{ref:b,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:fe(e.onKeyDown,U=>{U.key==="Escape"&&(l==null||l(U.nativeEvent),U.nativeEvent.defaultPrevented||(S.isFocusedToastEscapeKeyDownRef.current=!0,ie()))}),onPointerDown:fe(e.onPointerDown,U=>{U.button===0&&(C.current={x:U.clientX,y:U.clientY})}),onPointerMove:fe(e.onPointerMove,U=>{if(!C.current)return;const re=U.clientX-C.current.x,V=U.clientY-C.current.y,J=!!R.current,G=["left","right"].includes(S.swipeDirection),Z=["left","up"].includes(S.swipeDirection)?Math.min:Math.max,Q=G?Z(0,re):0,le=G?0:Z(0,V),L=U.pointerType==="touch"?10:2,ue={x:Q,y:le},Ne={originalEvent:U,delta:ue};J?(R.current=ue,Mh(Dee,p,Ne,{discrete:!1})):d$(ue,S.swipeDirection,L)?(R.current=ue,Mh(Nee,m,Ne,{discrete:!1}),U.target.setPointerCapture(U.pointerId)):(Math.abs(re)>L||Math.abs(V)>L)&&(C.current=null)}),onPointerUp:fe(e.onPointerUp,U=>{const re=R.current,V=U.target;if(V.hasPointerCapture(U.pointerId)&&V.releasePointerCapture(U.pointerId),R.current=null,C.current=null,re){const J=U.currentTarget,G={originalEvent:U,delta:re};d$(re,S.swipeDirection,S.swipeThreshold)?Mh(Lee,y,G,{discrete:!0}):Mh(Iee,g,G,{discrete:!0}),J.addEventListener("click",Z=>Z.preventDefault(),{once:!0})}})})))),S.viewport))):null});ZA.propTypes={type(e){if(e.type&&!["foreground","background"].includes(e.type)){const t=`Invalid prop \`type\` supplied to \`${Cg}\`. Expected \`foreground | background\`.`;return new Error(t)}return null}};const zee=e=>{const{__scopeToast:t,children:n,...r}=e,o=Eg(Cg,t),[i,s]=d.useState(!1),[l,u]=d.useState(!1);return Kee(()=>s(!0)),d.useEffect(()=>{const f=window.setTimeout(()=>u(!0),1e3);return()=>window.clearTimeout(f)},[]),l?null:d.createElement(jd,{asChild:!0},d.createElement(Xm,r,i&&d.createElement(d.Fragment,null,o.label," ",n)))},Uee=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return d.createElement(Ae.div,Y({},r,{ref:t}))}),Vee=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return d.createElement(Ae.div,Y({},r,{ref:t}))}),Wee="ToastAction",qA=d.forwardRef((e,t)=>{const{altText:n,...r}=e;return n?d.createElement(JA,{altText:n,asChild:!0},d.createElement(QA,Y({},r,{ref:t}))):null});qA.propTypes={altText(e){return e.altText?null:new Error(`Missing prop \`altText\` expected on \`${Wee}\``)}};const Hee="ToastClose",QA=d.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=Bee(Hee,n);return d.createElement(JA,{asChild:!0},d.createElement(Ae.button,Y({type:"button"},r,{ref:t,onClick:fe(e.onClick,o.onClose)})))}),JA=d.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return d.createElement(Ae.div,Y({"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0},o,{ref:t}))});function eM(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),Gee(r)){const o=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!o)if(i){const s=r.dataset.radixToastAnnounceAlt;s&&t.push(s)}else t.push(...eM(r))}}),t}function Mh(e,t,n,{discrete:r}){const o=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?mx(o,i):o.dispatchEvent(i)}const d$=(e,t,n=0)=>{const r=Math.abs(e.x),o=Math.abs(e.y),i=r>o;return t==="left"||t==="right"?i&&r>n:!i&&o>n};function Kee(e=()=>{}){const t=Lt(e);Pn(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function Gee(e){return e.nodeType===e.ELEMENT_NODE}function Yee(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Y0(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}const Xee=XA,tM=Mee,nM=Fee,rM=Uee,oM=Vee,iM=qA,sM=QA,Zee=Xee,aM=d.forwardRef(({className:e,...t},n)=>v.jsx(tM,{ref:n,className:xe("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),tabIndex:-1,...t}));aM.displayName=tM.displayName;const qee=Fm("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),lM=d.forwardRef(({className:e,variant:t,...n},r)=>v.jsx(nM,{ref:r,className:xe(qee({variant:t}),e),tabIndex:-1,...n}));lM.displayName=nM.displayName;const Qee=d.forwardRef(({className:e,...t},n)=>v.jsx(iM,{ref:n,className:xe("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),tabIndex:-1,...t}));Qee.displayName=iM.displayName;const cM=d.forwardRef(({className:e,...t},n)=>v.jsx(sM,{ref:n,className:xe("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",tabIndex:-1,...t,children:v.jsx(CP,{className:"h-4 w-4"})}));cM.displayName=sM.displayName;const uM=d.forwardRef(({className:e,...t},n)=>v.jsx(rM,{ref:n,className:xe("text-sm font-semibold [&+div]:text-xs",e),tabIndex:-1,...t}));uM.displayName=rM.displayName;const dM=d.forwardRef(({className:e,...t},n)=>v.jsx(oM,{ref:n,className:xe("text-sm opacity-90",e),...t,tabIndex:-1}));dM.displayName=oM.displayName;function Jee(){const{toasts:e}=Id();return v.jsxs(Zee,{children:[e.map(function({id:t,title:n,description:r,action:o,...i}){return v.jsxs(lM,{...i,children:[v.jsxs("div",{className:"grid gap-1",children:[n&&v.jsx(uM,{children:n}),r&&v.jsx(dM,{children:r})]}),o,v.jsx(cM,{})]},t)}),v.jsx(aM,{})]})}const ete=["image/jpeg","image/png","image/webp","image/bmp","image/tiff"];function tte(){const[e,t,n,r]=xt(g=>[g.file,g.updateAppState,g.setServerConfig,g.setFile]),o=qj(),i=rH();d.useEffect(()=>{o&&r(o)},[o,r]),d.useEffect(()=>{t({windowSize:i})},[i]),d.useEffect(()=>{(async()=>{const y=await SP();n(y),y.isDesktop&&gF()})()},[]);const s=d.useRef(0),l=d.useCallback(g=>{g.preventDefault(),g.stopPropagation()},[]),u=d.useCallback(g=>{g.preventDefault(),g.stopPropagation(),s.current+=1},[]),f=d.useCallback(g=>{g.preventDefault(),g.stopPropagation(),s.current-=1,s.current>0},[]),m=d.useCallback(g=>{if(g.preventDefault(),g.stopPropagation(),g.dataTransfer.files&&g.dataTransfer.files.length>0){if(!(g.dataTransfer.files.length>1)){const y=g.dataTransfer.files[0],x=y.type;ete.includes(x)&&r(y)}g.dataTransfer.clearData()}},[]),p=d.useCallback(g=>{if(!g.clipboardData)return;const y=g.clipboardData.items,x=[].slice.call(y).filter(_=>_.type.indexOf("image")!==-1);if(x.length===0)return;g.preventDefault(),g.stopPropagation();const E=x[0].getAsFile();E&&r(E)},[]);return d.useEffect(()=>(window.addEventListener("dragenter",u),window.addEventListener("dragleave",f),window.addEventListener("dragover",l),window.addEventListener("drop",m),window.addEventListener("paste",p),function(){window.removeEventListener("dragenter",u),window.removeEventListener("dragleave",f),window.removeEventListener("dragover",l),window.removeEventListener("drop",m),window.removeEventListener("paste",p)})),v.jsxs("main",{className:"flex min-h-screen flex-col items-center justify-between w-full bg-[radial-gradient(circle_at_1px_1px,_#8e8e8e8e_1px,_transparent_0)] [background-size:20px_20px] bg-repeat",children:[v.jsx(Jee,{}),v.jsx(eZ,{}),v.jsx(Eee,{}),e?v.jsx(v.Fragment,{}):v.jsx($ee,{onSelection:async g=>{r(g)}})]})}const fm=["light","dark"],yb="(prefers-color-scheme: dark)",nte=typeof window>"u",fM=d.createContext(void 0),rte=e=>d.useContext(fM)?Be.createElement(d.Fragment,null,e.children):Be.createElement(ite,e),ote=["light","dark"],ite=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:o="theme",themes:i=ote,defaultTheme:s=n?"system":"light",attribute:l="data-theme",value:u,children:f,nonce:m})=>{const[p,g]=d.useState(()=>f$(o,s)),[y,x]=d.useState(()=>f$(o)),S=u?Object.values(u):i,E=d.useCallback(R=>{let k=R;if(!k)return;R==="system"&&n&&(k=h$());const O=u?u[k]:k,A=t?ate():null,I=document.documentElement;if(l==="class"?(I.classList.remove(...S),O&&I.classList.add(O)):O?I.setAttribute(l,O):I.removeAttribute(l),r){const z=fm.includes(s)?s:null,H=fm.includes(k)?k:z;I.style.colorScheme=H}A==null||A()},[]),_=d.useCallback(R=>{g(R);try{localStorage.setItem(o,R)}catch{}},[e]),b=d.useCallback(R=>{const k=h$(R);x(k),p==="system"&&n&&!e&&E("system")},[p,e]);d.useEffect(()=>{const R=window.matchMedia(yb);return R.addListener(b),b(R),()=>R.removeListener(b)},[b]),d.useEffect(()=>{const R=k=>{k.key===o&&_(k.newValue||s)};return window.addEventListener("storage",R),()=>window.removeEventListener("storage",R)},[_]),d.useEffect(()=>{E(e??p)},[e,p]);const C=d.useMemo(()=>({theme:p,setTheme:_,forcedTheme:e,resolvedTheme:p==="system"?y:p,themes:n?[...i,"system"]:i,systemTheme:n?y:void 0}),[p,_,e,y,n,i]);return Be.createElement(fM.Provider,{value:C},Be.createElement(ste,{forcedTheme:e,disableTransitionOnChange:t,enableSystem:n,enableColorScheme:r,storageKey:o,themes:i,defaultTheme:s,attribute:l,value:u,children:f,attrs:S,nonce:m}),f)},ste=d.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:o,defaultTheme:i,value:s,attrs:l,nonce:u})=>{const f=i==="system",m=n==="class"?`var d=document.documentElement,c=d.classList;c.remove(${l.map(x=>`'${x}'`).join(",")});`:`var d=document.documentElement,n='${n}',s='setAttribute';`,p=o?fm.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",g=(x,S=!1,E=!0)=>{const _=s?s[x]:x,b=S?x+"|| ''":`'${_}'`;let C="";return o&&E&&!S&&fm.includes(x)&&(C+=`d.style.colorScheme = '${x}';`),n==="class"?C+=S||_?`c.add(${b})`:"null":_&&(C+=`d[s](n,${b})`),C},y=e?`!function(){${m}${g(e)}}()`:r?`!function(){try{${m}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${f})){var t='${yb}',m=window.matchMedia(t);if(m.media!==t||m.matches){${g("dark")}}else{${g("light")}}}else if(e){${s?`var x=${JSON.stringify(s)};`:""}${g(s?"x[e]":"e",!0)}}${f?"":"else{"+g(i,!1,!1)+"}"}${p}}catch(e){}}()`:`!function(){try{${m}var e=localStorage.getItem('${t}');if(e){${s?`var x=${JSON.stringify(s)};`:""}${g(s?"x[e]":"e",!0)}}else{${g(i,!1,!1)};}${p}}catch(t){}}();`;return Be.createElement("script",{nonce:u,dangerouslySetInnerHTML:{__html:y}})},()=>!0),f$=(e,t)=>{if(nte)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},ate=()=>{const 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),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(e)},1)}},h$=e=>(e||(e=window.matchMedia(yb)),e.matches?"dark":"light"),lte=new mL;X0.createRoot(document.getElementById("root")).render(v.jsx(Be.StrictMode,{children:v.jsx(xL,{client:lte,children:v.jsx(rte,{defaultTheme:"dark",disableTransitionOnChange:!0,children:v.jsx(KU,{children:v.jsx(tte,{})})})})}));